diff --git a/.artifactignore b/.artifactignore new file mode 100644 index 000000000000..5af70cce6426 --- /dev/null +++ b/.artifactignore @@ -0,0 +1,12 @@ +**/* +!target/*.bin +!target/*.log +!target/*.img.gz +!target/docker-sonic-vs.gz +!target/docker-ptf.gz +!target/debs/**/*.deb +!target/debs/**/*.deb.log +!target/debs/**/*.deb-install.log +!target/python-wheels/*.whl +!target/python-wheels/*.whl.log +!target/python-wheels/*.whl-install.log diff --git a/.azure-pipelines/azure-pipelines-Official.yml b/.azure-pipelines/azure-pipelines-Official.yml new file mode 100644 index 000000000000..a5a08167ca1d --- /dev/null +++ b/.azure-pipelines/azure-pipelines-Official.yml @@ -0,0 +1,31 @@ +# Starter pipeline +# Start with a minimal pipeline that you can customize to build and deploy your code. +# Add steps that build, run tests, deploy, and more: +# https://aka.ms/yaml + +trigger: none +pr: none + +schedules: +- cron: "0 0 * * *" + displayName: Daily Build + branches: + include: + - 202012 + always: true + +pool: sonicbld + +stages: +- stage: Build + jobs: + - template: azure-pipelines-build.yml + parameters: + buildOptions: 'SONIC_CONFIG_BUILD_JOBS=1 SONIC_VERSION_CONTROL_COMPONENTS=deb,py2,py3,web' + postSteps: + - script: | + make freeze + git status files/build/versions + git add files/build/versions + git diff HEAD files/build/versions + displayName: "Show git diff" diff --git a/.azure-pipelines/azure-pipelines-UpgrateVersion.yml b/.azure-pipelines/azure-pipelines-UpgrateVersion.yml new file mode 100644 index 000000000000..1caf9f8aaa8d --- /dev/null +++ b/.azure-pipelines/azure-pipelines-UpgrateVersion.yml @@ -0,0 +1,181 @@ +# Starter pipeline +# Start with a minimal pipeline that you can customize to build and deploy your code. +# Add steps that build, run tests, deploy, and more: +# https://aka.ms/yaml + +trigger: none +pr: none + +schedules: +- cron: "0 0 * * *" + displayName: Daily Build + branches: + include: + - 202012 + always: true + +resources: + repositories: + - repository: buildimage + type: github + name: sonic-net/sonic-buildimage + ref: master + endpoint: sonic-net + +pool: sonicbld + +parameters: + - name: jobFilters + type: object + default: + - vs + - broadcom + - barefoot + - centec + - generic + - mellanox + - nephos + - centec-arm64 + - marvell-armhf + +stages: +- stage: Prepare + jobs: + - job: Prepare + steps: + - script: | + DEFAULT_MIRROR_URL_PREFIX=http://packages.trafficmanager.net + DEBIAN_TIMESTAMP=$(curl $DEFAULT_MIRROR_URL_PREFIX/snapshot/debian/latest/timestamp) + DEBIAN_SECURITY_TIMESTAMP=$(curl $DEFAULT_MIRROR_URL_PREFIX/snapshot/debian-security/latest/timestamp) + echo "DEBIAN_TIMESTAMP=$DEBIAN_TIMESTAMP, DEBIAN_SECURITY_TIMESTAMP=$DEBIAN_SECURITY_TIMESTAMP" + echo "##vso[task.setvariable variable=DEBIAN_TIMESTAMP;isOutput=true]$DEBIAN_TIMESTAMP" + echo "##vso[task.setvariable variable=DEBIAN_SECURITY_TIMESTAMP;isOutput=true]$DEBIAN_SECURITY_TIMESTAMP" + name: SetVersions + displayName: 'Set snapshot versions' +- stage: Build + dependsOn: Prepare + variables: + - name: CACHE_MODE + value: none + - name: VERSION_CONTROL_OPTIONS + value: 'SONIC_VERSION_CONTROL_COMPONENTS=' + - name: SKIP_CHECKOUT + value: true + - name: DEBIAN_TIMESTAMP + value: $[ stageDependencies.Prepare.Prepare.outputs['SetVersions.DEBIAN_TIMESTAMP'] ] + - name: DEBIAN_SECURITY_TIMESTAMP + value: $[ stageDependencies.Prepare.Prepare.outputs['SetVersions.DEBIAN_SECURITY_TIMESTAMP'] ] + - template: .azure-pipelines/template-variables.yml@buildimage + jobs: + - template: azure-pipelines-build.yml + parameters: + jobFilters: ${{ parameters.jobFilters }} + buildOptions: '${{ variables.VERSION_CONTROL_OPTIONS }} ENABLE_DOCKER_BASE_PULL=n SONIC_BUILD_JOBS=$(nproc) ENABLE_IMAGE_SIGNATURE=y' + preSteps: + - template: .azure-pipelines/template-clean-sonic-slave.yml@buildimage + - checkout: self + submodules: recursive + fetchDepth: 0 + path: s + displayName: 'Checkout code' + - script: | + echo "DEBIAN_TIMESTAMP=$DEBIAN_TIMESTAMP, DEBIAN_SECURITY_TIMESTAMP=$DEBIAN_SECURITY_TIMESTAMP" + if [ "$MIRROR_SNAPSHOT" == y ]; then + mkdir -p target/versions/default/ + echo "debian==$DEBIAN_TIMESTAMP" > target/versions/default/versions-mirror + echo "debian-security==$DEBIAN_SECURITY_TIMESTAMP" >> target/versions/default/versions-mirror + cat target/versions/default/versions-mirror + fi + displayName: 'Set snapshot versions' + +- stage: UpgradeVersions + jobs: + - job: UpgradeVersions + pool: + vmImage: 'ubuntu-20.04' + steps: + - script: | + if [ -z "$(which gh)" ]; then + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key C99B11DEB97541F0 + sudo apt-add-repository https://cli.github.com/packages + sudo apt update + sudo apt install gh + fi + displayName: 'Install gh' + - checkout: self + displayName: 'Checkout code' + - download: current + patterns: '**/versions-*' + - script: | + # Cleanup the old versions + rm -rf files/build/versions + + mkdir -p target + default_platform=broadcom + artifacts=$(find $(Pipeline.Workspace) -maxdepth 1 -type d -name 'sonic-buildimage.*' | grep -v "sonic-buildimage.${default_platform}") + echo "artifacts$artifacts" + cp -r $(Pipeline.Workspace)/sonic-buildimage.${default_platform}/target/versions target/ + make freeze FREEZE_VERSION_OPTIONS=-r + find files/build/versions + ordered_artifacts=$(echo "$artifacts" | grep -v -E "arm64|armhf" && echo "$artifacts" | grep -E "arm64|armhf") + for artifact in $ordered_artifacts + do + rm -rf target/versions + cp -r $artifact/target/versions target/ + OPTIONS="-a -d" + [[ "$artifact" == *arm64* || "$artifact" == *armhf* ]] && OPTIONS="-d" + make freeze FREEZE_VERSION_OPTIONS="$OPTIONS" + done + git diff files/build/versions + displayName: 'Freeze Versions' + - script: | + if [ -z "$GIT_USER" ]; then + echo "Skipped to send the pull request, GIT_USER not set." + exit 0 + fi + GIT_STATUS=$(git status --porcelain files/build/versions) + if [ -z "$GIT_STATUS" ]; then + echo "Skipped to send the pull request, no version change in files/build/versions" + exit 0 + fi + if [ ! -d "$HOME" ]; then + sudo mkdir -p $HOME + sudo chown -R $(id -un):$(id -gn) $HOME + fi + SOURCE_BRANCH=$(Build.SourceBranch) + REPO_NAME=$(Build.Repository.Name) + [ -z "$GIT_REPO" ] && GIT_REPO=${REPO_NAME#*/} + BRANCH_NAME=repd/versions/${SOURCE_BRANCH#refs/heads/} + echo '#!/bin/bash' > git_env_password.sh + echo 'echo $GIT_PASSWORD' >> git_env_password.sh + chmod a+x git_env_password.sh + export GIT_ASKPASS=./git_env_password.sh + + git config user.name $GIT_USER + git config credential.https://github.com.username $GIT_USER + git add files/build/versions + git commit -m "[ci/build]: Upgrade SONiC package versions" + git checkout -b $BRANCH_NAME + git remote add remote https://github.com/$GIT_USER/$GIT_REPO + git push remote HEAD:refs/heads/$BRANCH_NAME -f + git branch -u remote/$BRANCH_NAME + + echo $GIT_PASSWORD | gh auth login --with-token + TITLE="Upgrade SONiC Versions" + BODY="Upgrade SONiC Versions" + RET=0 + if ! gh pr create -t "$TITLE" -b "$BODY" -B $(Build.SourceBranch) -R $(Build.Repository.Name) > pr.log 2>&1; then + if ! grep -q "already exists" pr.log; then + RET=1 + fi + fi + cat pr.log + exit $RET + env: + GIT_USER: $(GIT_USER) + GIT_PASSWORD: $(GIT_PASSWORD) + displayName: 'Send Pull Request' + - publish: $(System.DefaultWorkingDirectory)/files/build/versions + artifact: 'sonic-buildimage.versions' + displayName: 'Archive SONiC versions' + diff --git a/.azure-pipelines/azure-pipelines-build.yml b/.azure-pipelines/azure-pipelines-build.yml new file mode 100644 index 000000000000..79554a98717a --- /dev/null +++ b/.azure-pipelines/azure-pipelines-build.yml @@ -0,0 +1,144 @@ +# The azure pipeline template for Official build, and upgrade version build + +parameters: +- name: 'jobFilters' + type: object + default: '' +- name: 'buildOptions' + type: string + default: 'SONIC_CONFIG_BUILD_JOBS=1' +- name: 'preSteps' + type: stepList + default: [] +- name: 'postSteps' + type: stepList + default: [] +- name: 'jobGroups' + type: object + default: '' + +jobs: +- template: azure-pipelines-image-template.yml + parameters: + jobFilters: ${{ parameters.jobFilters }} + preSteps: ${{ parameters.preSteps }} + postSteps: ${{ parameters.postSteps }} + jobVariables: + PLATFORM_AZP: $(GROUP_NAME) + PLATFORM_ARCH: amd64 + BUILD_NUMBER: $(Build.BuildId) + BUILD_OPTIONS: ${{ parameters.buildOptions }} + DOCKER_DATA_ROOT_FOR_MULTIARCH: /data/march/docker + dbg_image: no + swi_image: no + raw_image: no + docker_syncd_rpc_image: no + syncd_rpc_image: no + platform_rpc: no + ${{ if ne(parameters.jobGroups, '') }}: + jobGroups: ${{ parameters.jobGroups }} + ${{ if eq(parameters.jobGroups, '') }}: + jobGroups: + - name: vs + variables: + dbg_image: yes + + - name: barefoot + variables: + docker_syncd_rpc_image: yes + platform_rpc: bfn + swi_image: yes + + - name: broadcom + variables: + dbg_image: yes + swi_image: yes + raw_image: yes + docker_syncd_rpc_image: yes + platform_rpc: brcm + + - name: centec + variables: + dbg_image: yes + docker_syncd_rpc_image: yes + platform_rpc: centec + + - name: centec-arm64 + pool: sonicbld-arm64 + timeoutInMinutes: 2880 + variables: + PLATFORM_ARCH: arm64 + - name: generic + variables: + dbg_image: yes + + - name: innovium + variables: + dbg_image: yes + + - name: marvell-armhf + pool: sonicbld-armhf + timeoutInMinutes: 2880 + variables: + PLATFORM_ARCH: armhf + - name: mellanox + variables: + dbg_image: yes + docker_syncd_rpc_image: yes + syncd_rpc_image: yes + platform_rpc: mlnx + + - name: nephos + variables: + dbg_image: yes + docker_syncd_rpc_image: no + platform_rpc: nephos + + buildSteps: + - template: .azure-pipelines/template-skipvstest.yml@buildimage + - template: .azure-pipelines/template-daemon.yml@buildimage + - bash: | + set -ex + if [ $(GROUP_NAME) == vs ]; then + if [ $(dbg_image) == yes ]; then + make $BUILD_OPTIONS INSTALL_DEBUG_TOOLS=y target/sonic-vs.img.gz + mv target/sonic-vs.img.gz target/sonic-vs-dbg.img.gz + fi + make $BUILD_OPTIONS target/docker-sonic-vs.gz target/sonic-vs.img.gz target/docker-ptf.gz + if [ $(Build.Reason) != 'PullRequest' ];then + gzip -kd target/sonic-vs.img.gz + SONIC_RUN_CMDS="qemu-img convert target/sonic-vs.img -O vhdx -o subformat=dynamic target/sonic-vs.vhdx" make $BUILD_OPTIONS sonic-slave-run + rm target/sonic-vs.img + fi + else + if [ $(dbg_image) == yes ]; then + make $BUILD_OPTIONS INSTALL_DEBUG_TOOLS=y target/sonic-$(GROUP_NAME).bin + mv target/sonic-$(GROUP_NAME).bin target/sonic-$(GROUP_NAME)-dbg.bin + fi + if [ $(swi_image) == yes ]; then + make $BUILD_OPTIONS ENABLE_IMAGE_SIGNATURE=y target/sonic-aboot-$(GROUP_NAME).swi + fi + if [ $(raw_image) == yes ]; then + make $BUILD_OPTIONS target/sonic-$(GROUP_NAME).raw + fi + if [ $(docker_syncd_rpc_image) == yes ]; then + # workaround for issue in rules/sairedis.dep, git ls-files will list un-exist files for cache + make $BUILD_OPTIONS ENABLE_SYNCD_RPC=y target/docker-syncd-$(platform_rpc)-rpc.gz + pushd ./src/sonic-sairedis/SAI + git stash + popd + if [ $(GROUP_NAME) == broadcom ]; then + make $BUILD_OPTIONS ENABLE_SYNCD_RPC=y SAITHRIFT_V2=y target/docker-saiserverv2-brcm.gz + pushd ./src/sonic-sairedis/SAI + git stash + popd + fi + fi + if [ $(syncd_rpc_image) == yes ]; then + make $BUILD_OPTIONS ENABLE_SYNCD_RPC=y target/sonic-$(GROUP_NAME).bin + mv target/sonic-mellanox.bin target/sonic-$(GROUP_NAME)-rpc.bin + fi + make $BUILD_OPTIONS target/sonic-$(GROUP_NAME).bin + fi + displayName: "Build sonic image" + - template: .azure-pipelines/check-dirty-version.yml@buildimage diff --git a/.azure-pipelines/azure-pipelines-download-certificate.yml b/.azure-pipelines/azure-pipelines-download-certificate.yml new file mode 100644 index 000000000000..3e1a58582f61 --- /dev/null +++ b/.azure-pipelines/azure-pipelines-download-certificate.yml @@ -0,0 +1,33 @@ +parameters: +- name: connectionName + type: string + default: sonic-dev-connection +- name: kevaultName + type: string + default: sonic-kv +- name: certificateName + type: string + default: sonic-secure-boot + +steps: +- task: AzureKeyVault@2 + inputs: + connectedServiceName: ${{ parameters.connectionName }} + keyVaultName: ${{ parameters.kevaultName }} + secretsFilter: ${{ parameters.certificateName }} + +- script: | + set -e + TMP_FILE=$(mktemp) + echo "$CERTIFICATE" | base64 -d > $TMP_FILE + sudo mkdir -p /etc/certificates + mkdir -p $(Build.StagingDirectory)/target + # Save the public key + openssl pkcs12 -in $TMP_FILE -clcerts --nokeys -nodes -passin pass: | sed -z -e "s/.*\(-----BEGIN CERTIFICATE\)/\1/" > $(SIGNING_CERT) + # Save the private key + openssl pkcs12 -in $TMP_FILE -nocerts -nodes -passin pass: | sed -z -e "s/.*\(-----BEGIN PRIVATE KEY\)/\1/" | sudo tee $(SIGNING_KEY) 1>/dev/null + ls -lt $(SIGNING_CERT) $(SIGNING_KEY) + rm $TMP_FILE + env: + CERTIFICATE: $(${{ parameters.certificateName }}) + displayName: "Save certificate" diff --git a/.azure-pipelines/azure-pipelines-image-template.yml b/.azure-pipelines/azure-pipelines-image-template.yml new file mode 100644 index 000000000000..bcd377973d53 --- /dev/null +++ b/.azure-pipelines/azure-pipelines-image-template.yml @@ -0,0 +1,73 @@ +# The azure pipeline template for PR build, Official build, and upgrade version build + +parameters: +- name: 'jobFilters' + type: object + default: '' +- name: 'preSteps' + type: stepList + default: [] +- name: 'buildSteps' + type: stepList + default: [] +- name: 'postSteps' + type: stepList + default: [] +- name: jobGroups + type: object + default: [] +- name: jobVariables + type: object + default: [] +jobs: +- template: azure-pipelines-job-groups.yml + parameters: + jobFilters: ${{ parameters.jobFilters }} + jobVariables: ${{ parameters.jobVariables }} + preSteps: + - template: .azure-pipelines/cleanup.yml@buildimage + - ${{ parameters.preSteps }} + - script: | + [ -n "$OVERRIDE_BUILD_OPTIONS" ] && OVERRIDE_BUILD_OPTIONS=$(OVERRIDE_BUILD_OPTIONS) + BUILD_OPTIONS="$(BUILD_OPTIONS) $OVERRIDE_BUILD_OPTIONS" + if [ -n "$(CACHE_MODE)" ] && echo $(PLATFORM_AZP) | grep -E -q "^(vs|broadcom|mellanox|marvell-armhf)$"; then + CACHE_OPTIONS="SONIC_DPKG_CACHE_METHOD=$(CACHE_MODE) SONIC_DPKG_CACHE_SOURCE=/nfs/dpkg_cache/$(PLATFORM_AZP)" + BUILD_OPTIONS="$BUILD_OPTIONS $CACHE_OPTIONS" + fi + echo $BUILD_OPTIONS + echo "##vso[task.setvariable variable=BUILD_OPTIONS]$BUILD_OPTIONS" + displayName: "Set cache options" + - checkout: self + submodules: recursive + condition: and(succeeded(), eq(variables.SKIP_CHECKOUT, '')) + displayName: 'Checkout code' + - script: | + BRANCH_NAME=$(Build.SourceBranchName) + [ -n "$SYSTEM_PULLREQUEST_PULLREQUESTID" ] && BRANCH_NAME="$SYSTEM_PULLREQUEST_TARGETBRANCH-$SYSTEM_PULLREQUEST_PULLREQUESTNUMBER" + git checkout -b $BRANCH_NAME + sudo modprobe overlay + sudo apt-get install -y acl + sudo bash -c "echo 1 > /proc/sys/vm/compact_memory" + ENABLE_DOCKER_BASE_PULL=y make PLATFORM=$(PLATFORM_AZP) PLATFORM_ARCH=$(PLATFORM_ARCH) $(BUILD_OPTIONS) configure + displayName: 'Make configure' + postSteps: + - script: | + mkdir -p $(Build.ArtifactStagingDirectory)/target + mv target/* $(Build.ArtifactStagingDirectory)/target/ + displayName: Copy Artifacts + - publish: $(Build.ArtifactStagingDirectory) + artifact: 'sonic-buildimage.$(GROUP_NAME)$(GROUP_EXTNAME)' + displayName: "Archive sonic image" + - publish: $(Build.ArtifactStagingDirectory) + condition: failed() + artifact: 'sonic-buildimage.$(GROUP_NAME)$(GROUP_EXTNAME)$(System.JobAttempt)' + displayName: "Archive failed sonic image" + - ${{ if ne(variables['Build.Reason'], 'PullRequest') }}: + - template: trigger-publish-artifacts-build.yml + parameters: + artifactName: 'sonic-buildimage.$(GROUP_NAME)$(GROUP_EXTNAME)' + publishPrefix: '$(Build.DefinitionName)/$(Build.SourceBranchName)/$(GROUP_NAME)' + - ${{ parameters.postSteps }} + - template: .azure-pipelines/cleanup.yml@buildimage + jobGroups: ${{ parameters.jobGroups }} + buildSteps: ${{ parameters.buildSteps }} diff --git a/.azure-pipelines/azure-pipelines-job-groups.yml b/.azure-pipelines/azure-pipelines-job-groups.yml new file mode 100644 index 000000000000..1a4dbb79cc0e --- /dev/null +++ b/.azure-pipelines/azure-pipelines-job-groups.yml @@ -0,0 +1,57 @@ +parameters: +- name: 'preSteps' + type: stepList + default: [] +- name: 'buildSteps' + type: stepList + default: [] +- name: "postSteps" + type: stepList + default: [] +- name: 'jobGroups' + type: object + default: [] +- name: 'jobVariables' + type: object + default: {} +- name: 'scriptEnv' + type: object + default: '' +- name: 'timeoutInMinutes' + type: 'number' + default: 720 +- name: 'jobFilters' + type: object + default: '' + +jobs: +- ${{ each jobGroup in parameters.jobGroups }}: + - ${{ if or(eq(parameters.jobFilters, ''), containsValue(parameters.jobFilters, jobGroup.name), endswith(variables['Build.DefinitionName'], format('.{0}{1}', jobGroup.name, jobGroup.extName))) }}: + - job: ${{ replace(format('{0}{1}', jobGroup.name, jobGroup.extName), '-', '_') }} + ${{ each pair in jobGroup }}: + ${{ if not(in(pair.key, 'job', 'name', 'extName', 'variables', 'steps', 'script', 'scriptEnv')) }}: + ${{ pair.key }}: ${{ pair.value }} + ${{ if eq(jobGroup.timeoutInMinutes, '') }}: + timeoutInMinutes: ${{ parameters.timeoutInMinutes }} + variables: + GROUP_NAME: ${{ jobGroup.name }} + GROUP_EXTNAME: '${{ jobGroup.extName }}' + GROUP_NAMES: ${{ join(',', parameters.jobGroups.*.name ) }} + ${{ if ne(jobGroup.variables, '') }}: + ${{ jobGroup.variables }} + ${{ each para in parameters.jobvariables }}: + ${{ if eq(jobGroup.variables[para.key], '') }}: + ${{ para.key }}: ${{ para.value }} + steps: + - ${{ parameters.preSteps }} + - ${{ if ne(jobGroup.script, '') }}: + - script: | + ${{ jobGroup.script }} + env: + ${{ if ne(parameters.scriptEnv, '') }}: + ${{ parameters.scriptEnv }} + displayName: 'JobScript' + - ${{ if ne(jobGroup.steps, '') }}: + - ${{ jobGroup.steps }} + - ${{ parameters.buildSteps }} + - ${{ parameters.postSteps }} diff --git a/.azure-pipelines/build-commonlib.yml b/.azure-pipelines/build-commonlib.yml new file mode 100644 index 000000000000..a36adc625d71 --- /dev/null +++ b/.azure-pipelines/build-commonlib.yml @@ -0,0 +1,19 @@ +pr: none +trigger: none +schedules: +- cron: "0 0 * * *" + displayName: Daily build + branches: + include: + - master + - 202??? +resources: + repositories: + - repository: buildimage + type: github + name: sonic-net/sonic-buildimage + ref: master + endpoint: sonic-net + +jobs: +- template: .azure-pipelines/template-commonlib.yml@buildimage diff --git a/.azure-pipelines/build-template.yml b/.azure-pipelines/build-template.yml new file mode 100644 index 000000000000..7b5ec1ed2757 --- /dev/null +++ b/.azure-pipelines/build-template.yml @@ -0,0 +1,135 @@ +parameters: +- name: platform + type: string + values: + - broadcom + - centec-arm64 + - marvell-armhf + - mellanox + - vs + +- name: platform_arch + type: string + values: + - amd64 + - armhf + - arm64 + default: amd64 + +- name: platform_short + type: string + values: + - brcm + - centec-arm64 + - marvell-armhf + - mlnx + - vs + +- name: cache_mode + type: string + values: + - wcache + - rcache + - cache + +- name: pool + type: string + values: + - sonicbld + - sonicbld_8c + default: sonicbld + +- name: dbg_image + type: boolean + default: false + +- name: swi_image + type: boolean + default: false + +- name: raw_image + type: boolean + default: false + +- name: sync_rpc_image + type: boolean + default: false + +- name: timeout + type: number + default: 600 + +jobs: +- job: + pool: ${{ parameters.pool }} + displayName: ${{ parameters.platform }} + timeoutInMinutes: ${{ parameters.timeout }} + steps: + - template: cleanup.yml + - checkout: self + clean: true + submodules: recursive + displayName: 'Checkout code' + - script: | + git submodule foreach --recursive 'git clean -xfdf || true' + git submodule foreach --recursive 'git reset --hard || true' + git submodule foreach --recursive 'git remote update || true' + git submodule update --init --recursive + displayName: 'Reset submodules' + - script: | + set -e + sudo modprobe overlay + sudo apt-get install -y acl + export DOCKER_DATA_ROOT_FOR_MULTIARCH=/data/march/docker + CACHE_OPTIONS="SONIC_DPKG_CACHE_METHOD=${{ parameters.cache_mode }} SONIC_DPKG_CACHE_SOURCE=/nfs/dpkg_cache/${{ parameters.platform }}" + ENABLE_DOCKER_BASE_PULL=y make configure PLATFORM=${{ parameters.platform }} PLATFORM_ARCH=${{ parameters.platform_arch }} + trap "sudo rm -rf fsroot" EXIT + + if [ ${{ parameters.platform }} == vs ]; then + if [ ${{ parameters.dbg_image }} == true ]; then + make USERNAME=admin $CACHE_OPTIONS SONIC_BUILD_JOBS=$(nproc) INSTALL_DEBUG_TOOLS=y target/sonic-vs.img.gz && \ + mv target/sonic-vs.img.gz target/sonic-vs-dbg.img.gz + fi + + make USERNAME=admin $CACHE_OPTIONS SONIC_BUILD_JOBS=$(nproc) target/docker-sonic-vs.gz target/sonic-vs.img.gz target/docker-ptf.gz + else + if [ ${{ parameters.dbg_image }} == true ]; then + make USERNAME=admin $CACHE_OPTIONS SONIC_BUILD_JOBS=$(nproc) INSTALL_DEBUG_TOOLS=y target/sonic-${{ parameters.platform }}.bin && \ + mv target/sonic-${{ parameters.platform }}.bin target/sonic-${{ parameters.platform }}-dbg.bin + fi + if [ ${{ parameters.swi_image }} == true ]; then + make USERNAME=admin $CACHE_OPTIONS SONIC_BUILD_JOBS=$(nproc) ENABLE_IMAGE_SIGNATURE=y target/sonic-aboot-${{ parameters.platform }}.swi + fi + if [ ${{ parameters.raw_image }} == true ]; then + make USERNAME=admin $CACHE_OPTIONS SONIC_BUILD_JOBS=$(nproc) target/sonic-${{ parameters.platform }}.raw + fi + if [ ${{ parameters.sync_rpc_image }} == true ]; then + make USERNAME=admin $CACHE_OPTIONS SONIC_BUILD_JOBS=$(nproc) ENABLE_SYNCD_RPC=y target/docker-syncd-${{ parameters.platform_short }}-rpc.gz + # workaround for issue in rules/sairedis.dep, git ls-files will list un-exist files for cache + pushd ./src/sonic-sairedis/SAI + git stash + popd + if [ ${{ parameters.platform }} == broadcom ]; then + make USERNAME=admin $CACHE_OPTIONS SONIC_BUILD_JOBS=$(nproc) ENABLE_SYNCD_RPC=y SAITHRIFT_V2=y target/docker-saiserverv2-brcm.gz + pushd ./src/sonic-sairedis/SAI + git stash + popd + fi + fi + + make USERNAME=admin $CACHE_OPTIONS SONIC_BUILD_JOBS=$(nproc) target/sonic-${{ parameters.platform }}.bin + fi + displayName: 'Build sonic image' + - template: cleanup.yml + - publish: $(System.DefaultWorkingDirectory)/ + artifact: sonic-buildimage.${{ parameters.platform }} + displayName: "Archive sonic image" + - script: | + set -x + find target -name "*.log" | xargs -I{} cp {} $(Build.ArtifactStagingDirectory)/ + condition: failed() + displayName: "Copy build logs" + - publish: $(Build.ArtifactStagingDirectory)/ + artifact: sonic-buildimage.${{ parameters.platform}}.logs@$(System.JobAttempt) + displayName: "Archive build logs" + condition: failed() diff --git a/.azure-pipelines/check-dirty-version.yml b/.azure-pipelines/check-dirty-version.yml new file mode 100644 index 000000000000..5d3909bd280e --- /dev/null +++ b/.azure-pipelines/check-dirty-version.yml @@ -0,0 +1,16 @@ +steps: +- script: | + . functions.sh + SONIC_VERSION=$(sonic_get_version) + echo "SONIC_VERSION=$SONIC_VERSION" + if [[ "$SONIC_VERSION" == *dirty* ]]; then + # Print the detail dirty info + git status --untracked-files=no -s --ignore-submodules + + # Exit with error, if it is a PR build + if [ "$(Build.Reason)" == "PullRequest" ]; then + echo "Build failed for the dirty version: $SONIC_VERSION" 1>&2 + exit 1 + fi + fi + displayName: "Check the dirty version" diff --git a/.azure-pipelines/cleanup.yml b/.azure-pipelines/cleanup.yml new file mode 100644 index 000000000000..4f74de0f413a --- /dev/null +++ b/.azure-pipelines/cleanup.yml @@ -0,0 +1,21 @@ +steps: +- script: | + set -x + # kill daemon process + ps $(cat /tmp/azp_daemon_kill_docker_pid) + sudo kill $(cat /tmp/azp_daemon_kill_docker_pid) + rm /tmp/azp_daemon_kill_docker_pid + + if sudo [ -f /var/run/march/docker.pid ] ; then + pid=`sudo cat /var/run/march/docker.pid` ; sudo kill $pid + fi + sudo rm -f /var/run/march/docker.pid + sudo rm -rf /data/march/docker + + # clean native docker build + if sudo [ -f dockerfs/var/run/docker.pid ] ; then + pid=`sudo cat dockerfs/var/run/docker.pid` ; sudo kill $pid + fi + sudo rm -rf $(ls -A1) + condition: always() + displayName: "Clean Workspace" diff --git a/.azure-pipelines/docker-sonic-mgmt.yml b/.azure-pipelines/docker-sonic-mgmt.yml new file mode 100644 index 000000000000..4dc9aee9bb89 --- /dev/null +++ b/.azure-pipelines/docker-sonic-mgmt.yml @@ -0,0 +1,57 @@ +# Starter pipeline +# Start with a minimal pipeline that you can customize to build and deploy your code. +# Add steps that build, run tests, deploy, and more: +# https://aka.ms/yaml +# Build and push sonic-mgmt image + +schedules: +- cron: "0 8 * * *" + branches: + include: + - master + always: true + +trigger: none +pr: + branches: + include: + - master + paths: + include: + - dockers/docker-sonic-mgmt + +parameters: +- name: registry_url + type: string + default: sonicdev-microsoft.azurecr.io +- name: registry_conn + type: string + default: sonicdev + +stages: +- stage: Build + jobs: + - job: Build + pool: sonicbld + timeoutInMinutes: 360 + steps: + - template: cleanup.yml + - checkout: self + clean: true + submodules: recursive + - bash: | + set -xe + make configure PLATFORM=generic + make target/docker-sonic-mgmt.gz + docker load -i target/docker-sonic-mgmt.gz + docker tag docker-sonic-mgmt $REGISTRY_SERVER/docker-sonic-mgmt:latest + env: + REGISTRY_SERVER: ${{ parameters.registry_url }} + displayName: Build docker-sonic-mgmt.gz + - task: Docker@2 + displayName: Upload image + inputs: + containerRegistry: ${{ parameters.registry_conn }} + repository: docker-sonic-mgmt + command: push + tags: latest diff --git a/.azure-pipelines/docker-sonic-slave.yml b/.azure-pipelines/docker-sonic-slave.yml new file mode 100644 index 000000000000..16471368be3e --- /dev/null +++ b/.azure-pipelines/docker-sonic-slave.yml @@ -0,0 +1,82 @@ +# Starter pipeline +# Start with a minimal pipeline that you can customize to build and deploy your code. +# Add steps that build, run tests, deploy, and more: +# https://aka.ms/yaml +# Build and push sonic-slave-[buster|jessie|stretch] images for amd64/armhf/arm64 +resources: + repositories: + - repository: buildimage + type: github + name: sonic-net/sonic-buildimage + ref: master + endpoint: sonic-net + +schedules: +- cron: "0 0 * * 0" + displayName: Weekly build + branches: + include: + - master + - 202??? + always: true + +pr: none +trigger: + batch: true + branches: + include: + - master + - 202??? + paths: + include: + - sonic-slave-* + - files/build/versions + - Makefile + - Makefile.work + +parameters: +- name: 'arches' + type: object + default: + - amd64 + - armhf + - arm64 +- name: 'dists' + type: object + default: + - buster + - stretch + - jessie +- name: registry_url + type: string + default: sonicdev-microsoft.azurecr.io +- name: registry_conn + type: string + default: sonicdev + +stages: +- stage: Build_in_amd64 + jobs: + - ${{ each dist in parameters.dists }}: + - ${{ if endswith(variables['Build.DefinitionName'], dist) }}: + - ${{ each arch in parameters.arches }}: + - template: .azure-pipelines/docker-sonic-slave-template.yml@buildimage + parameters: + pool: sonicbld + arch: ${{ arch }} + dist: ${{ dist }} + ${{ if ne(arch, 'amd64') }}: + march: _march_${{ arch }} +- stage: Build_native_arm + dependsOn: [] + jobs: + - ${{ each dist in parameters.dists }}: + - ${{ if endswith(variables['Build.DefinitionName'], dist) }}: + - ${{ each arch in parameters.arches }}: + - ${{ if ne(arch, 'amd64') }}: + - template: .azure-pipelines/docker-sonic-slave-template.yml@buildimage + parameters: + pool: sonicbld-${{ arch }} + arch: ${{ arch }} + dist: ${{ dist }} + march: _${{ arch }} diff --git a/.azure-pipelines/dpkg-cache-cleanup.yml b/.azure-pipelines/dpkg-cache-cleanup.yml new file mode 100644 index 000000000000..2789d1818819 --- /dev/null +++ b/.azure-pipelines/dpkg-cache-cleanup.yml @@ -0,0 +1,27 @@ +# Starter pipeline +# Start with a minimal pipeline that you can customize to build and deploy your code. +# Add steps that build, run tests, deploy, and more: +# https://aka.ms/yaml +# Clean up the cache 30 days ago + +schedules: +- cron: "0 0 * * *" + branches: + include: + - master + always: true + +trigger: none +pr: none + +jobs: +- job: Build + pool: sonicbld + timeoutInMinutes: 5 + steps: + - checkout: none + - script: | + set -xe + sudo find /nfs/dpkg_cache/ -name *.tgz -mtime +30 -type f -delete + displayName: clean dpkg cache + diff --git a/.azure-pipelines/official-build-cisco-8000.yml b/.azure-pipelines/official-build-cisco-8000.yml new file mode 100644 index 000000000000..7ec7430fc3ad --- /dev/null +++ b/.azure-pipelines/official-build-cisco-8000.yml @@ -0,0 +1,107 @@ +# Starter pipeline +# Start with a minimal pipeline that you can customize to build and deploy your code. +# Add steps that build, run tests, deploy, and more: +# https://aka.ms/yaml + +schedules: +- cron: "0 8 * * *" + displayName: Daily midnight build + branches: + include: + - master + - 202012 + always: true + +trigger: none +pr: none + +resources: + repositories: + - repository: cisco-8000 + type: github + name: Cisco-8000-sonic/platform-cisco-8000 + endpoint: cisco-connection + + +variables: +- group: SONIC-AKV-STROAGE-1 +- name: StorageSASKey + value: $(sonicstorage-SasToken) +- name: SONIC_ENABLE_SECUREBOOT_SIGNATURE + value: y +- name: SIGNING_KEY + value: /etc/certificates/sonic-secure-boot-private.pem +- name: SIGNING_CERT + value: $(Build.StagingDirectory)/target/sonic-secure-boot-public.pem + +stages: +- stage: Build + pool: sonic + variables: + CACHE_MODE: wcache + SKIP_CHECKOUT: true + TERM: '' + PACKAGE_URL: "https://sonicstorage.blob.core.windows.net/packages" + + jobs: + - template: azure-pipelines-build.yml + parameters: + buildOptions: 'USERNAME=admin SONIC_BUILD_JOBS=$(nproc) ${{ variables.VERSION_CONTROL_OPTIONS }}' + preSteps: + - template: azure-pipelines-download-certificate.yml + - checkout: self + submodules: recursive + path: s + displayName: 'Checkout code' + - checkout: cisco-8000 + submodules: recursive + path: s/platform/cisco-8000 + displayName: 'Checkout cisco-8000' + - script: | + cisco_ref=$(cat platform/checkout/cisco-8000.ini | grep '^ref=' | cut -d= -f2) + echo "The cisco 8000 release version is $cisco_ref" + echo "##vso[task.setvariable variable=cisco.ref]$cisco_ref" + displayName: 'Export cisco release version' + - task: DownloadGitHubRelease@0 + inputs: + connection: cisco-connection + userRepository: Cisco-8000-sonic/platform-cisco-8000 + defaultVersionType: specificTag + version: $(cisco.ref) + itemPattern: 'artifactory-*.tar.gz' + downloadPath: '$(System.ArtifactsDirectory)' + - script: | + make PLATFORM=cisco-8000 platform/cisco-8000 + tar xfz $(System.ArtifactsDirectory)/artifactory-*.tar.gz -C platform/cisco-8000 + displayName: 'Setup cisco artifacts' + - script: | + set -ex + filename=$(find platform/cisco-8000/artifactory/sonic -name cisco-* -type f | head -n 1) + if [ -z "$filename" ]; then + echo "Cisco sai package not found" 1>&2 + exit 1 + fi + cd $(dirname $filename) + echo "PWD=$(pwd)" + ls -l cisco-*.deb + while read -r package; do + # Cisco version format: -sai--- + # The may contain several values in one build, the part is skipped when publishing to storage + # See https://github.com/Cisco-8000-sonic/sdk/blob/master/azure-pipelines.yml + # The $PACKAGE_URL is only accessible for AZP + version=$(echo $package | awk -F_ '{print $(NF-1)}' | cut -d- -f1,2,4,5) + package_url="$PACKAGE_URL/sai/ciscosai/master/$version/$package" + echo "Override package $package from $package_url" + wget "$package_url$StorageSASKey" -O "$package" + done < <(ls cisco-*.deb) + env: + StorageSASKey: $(StorageSASKey) + condition: ne(variables['Build.Reason'], 'PullRequest') + displayName: "Override cisco sai packages" + - script: | + echo "SONIC_ENABLE_SECUREBOOT_SIGNATURE := y" >> rules/config.user + echo "SIGNING_KEY := $(SIGNING_KEY)" >> rules/config.user + echo "SIGNING_CERT := $(SIGNING_CERT)" >> rules/config.user + displayName: "Enable secure boot signature" + jobGroups: + - name: cisco-8000 diff --git a/.azure-pipelines/official-build.yml b/.azure-pipelines/official-build.yml new file mode 100644 index 000000000000..2e96d2899e71 --- /dev/null +++ b/.azure-pipelines/official-build.yml @@ -0,0 +1,40 @@ +# Starter pipeline +# Start with a minimal pipeline that you can customize to build and deploy your code. +# Add steps that build, run tests, deploy, and more: +# https://aka.ms/yaml + +schedules: +- cron: "0 8 * * *" + displayName: Daily midnight build + branches: + include: + - master + - 202012 + always: true + +resources: + repositories: + - repository: buildimage + type: github + name: sonic-net/sonic-buildimage + ref: master + endpoint: sonic-net + +trigger: none +pr: none + +variables: +- template: .azure-pipelines/template-variables.yml@buildimage + +stages: +- stage: Build + pool: sonicbld + variables: + CACHE_MODE: wcache + ${{ if eq(variables['Build.SourceBranchName'], '202012') }}: + VERSION_CONTROL_OPTIONS: 'SONIC_VERSION_CONTROL_COMPONENTS=deb,py2,py3,web,git,docker' + jobs: + - template: azure-pipelines-build.yml + parameters: + buildOptions: 'USERNAME=admin SONIC_BUILD_JOBS=$(nproc) ${{ variables.VERSION_CONTROL_OPTIONS }}' + jobFilters: none diff --git a/.azure-pipelines/run-test-scheduler-template.yml b/.azure-pipelines/run-test-scheduler-template.yml new file mode 100644 index 000000000000..e74c4b157a10 --- /dev/null +++ b/.azure-pipelines/run-test-scheduler-template.yml @@ -0,0 +1,203 @@ +parameters: +- name: TOPOLOGY + type: string + +- name: POLL_INTERVAL + type: number + default: 10 + +- name: POLL_TIMEOUT + type: number + default: 36000 + +- name: MIN_WORKER + type: string + default: 1 + +- name: MAX_WORKER + type: string + default: 1 + +- name: NUM_ASIC + type: number + default: 1 + +- name: TEST_SET + type: string + default: "" + +- name: DEPLOY_MG_EXTRA_PARAMS + type: string + default: "" + +- name: COMMON_EXTRA_PARAMS + type: string + default: "" + +- name: VM_TYPE + type: string + default: "ceos" + +- name: TESTBED_NAME + type: string + default: "" + +- name: IMAGE_URL + type: string + default: "" + +- name: HWSKU + type: string + default: "" + +- name: TEST_PLAN_TYPE + type: string + default: "" + +- name: PLATFORM + type: string + default: "" + +- name: SCRIPTS + type: string + default: "" + +- name: FEATURES + type: string + default: "" + +- name: SCRIPTS_EXCLUDE + type: string + default: "" + +- name: FEATURES_EXCLUDE + type: string + default: "" + +- name: REPO_NAME + type: string + default: "" + +- name: MGMT_BRANCH + type: string + default: "" + +- name: STOP_ON_FAILURE + type: string + default: "" + +- name: RETRY_TIMES + type: string + default: "" + +- name: DUMP_KVM_IF_FAIL + type: string + default: "True" + values: + - "True" + - "False" + +- name: REQUESTER + type: string + default: "" + +- name: MAX_RUN_TEST_MINUTES + type: number + default: 480 + + +steps: + - script: | + set -e + # always use the test plan script from master branch. + wget -O ./.azure-pipelines/test_plan.py https://raw.githubusercontent.com/sonic-net/sonic-mgmt/master/.azure-pipelines/test_plan.py + wget -O ./.azure-pipelines/pr_test_scripts.yaml https://raw.githubusercontent.com/sonic-net/sonic-mgmt/${{ parameters.MGMT_BRANCH }}/.azure-pipelines/pr_test_scripts.yaml + displayName: Download test plan scripts + + - script: | + set -e + pip install PyYAML + rm -f new_test_plan_id.txt + + python ./.azure-pipelines/test_plan.py create \ + -t ${{ parameters.TOPOLOGY }} \ + -o new_test_plan_id.txt \ + --min-worker ${{ parameters.MIN_WORKER }} \ + --max-worker ${{ parameters.MAX_WORKER }} \ + --test-set ${{ parameters.TEST_SET }} \ + --kvm-build-id $(KVM_BUILD_ID) \ + --deploy-mg-extra-params "${{ parameters.DEPLOY_MG_EXTRA_PARAMS }}" \ + --mgmt-branch ${{ parameters.MGMT_BRANCH }} \ + --common-extra-params "${{ parameters.COMMON_EXTRA_PARAMS }}" + + TEST_PLAN_ID=`cat new_test_plan_id.txt` + + echo "Created test plan $TEST_PLAN_ID" + echo "Check $(FRONTEND_URL)/scheduler/testplan/$TEST_PLAN_ID for test plan status" + echo "##vso[task.setvariable variable=TEST_PLAN_ID]$TEST_PLAN_ID" + env: + TESTBED_TOOLS_URL: $(TESTBED_TOOLS_URL) + TENANT_ID: $(TESTBED_TOOLS_MSAL_TENANT_ID) + CLIENT_ID: $(TESTBED_TOOLS_MSAL_CLIENT_ID) + CLIENT_SECRET: $(TESTBED_TOOLS_MSAL_CLIENT_SECRET) + displayName: Trigger test + + - script: | + set -e + echo "Lock testbed" + echo "SONiC PR system-level test is powered by SONiC Elastictest, for any issue, please send email to sonicelastictest@microsoft.com" + echo "Runtime detailed progress at $(FRONTEND_URL)/scheduler/testplan/$TEST_PLAN_ID " + # When "LOCK_TESTBED" finish, it changes into "PREPARE_TESTBED" + python ./.azure-pipelines/test_plan.py poll -i "$(TEST_PLAN_ID)" --expected-state LOCK_TESTBED + env: + TESTBED_TOOLS_URL: $(TESTBED_TOOLS_URL) + displayName: Lock testbed + + - script: | + set -e + echo "Prepare testbed" + echo "Preparing the testbed(add-topo, deploy-mg) may take 15-30 minutes. Before the testbed is ready, the progress of the test plan keeps displayed as 0, please be patient" + echo "SONiC PR system-level test is powered by SONiC Elastictest, for any issue, please send email to sonicelastictest@microsoft.com" + echo "Runtime detailed progress at $(FRONTEND_URL)/scheduler/testplan/$TEST_PLAN_ID " + # When "PREPARE_TESTBED" finish, it changes into "EXECUTING" + python ./.azure-pipelines/test_plan.py poll -i "$(TEST_PLAN_ID)" --expected-state PREPARE_TESTBED + env: + TESTBED_TOOLS_URL: $(TESTBED_TOOLS_URL) + displayName: Prepare testbed + + - script: | + set -e + echo "Run test" + echo "SONiC PR system-level test is powered by SONiC Elastictest, for any issue, please send email to sonicelastictest@microsoft.com" + echo "Runtime detailed progress at $(FRONTEND_URL)/scheduler/testplan/$TEST_PLAN_ID " + # When "EXECUTING" finish, it changes into "KVMDUMP", "FAILED", "CANCELLED" or "FINISHED" + python ./.azure-pipelines/test_plan.py poll -i "$(TEST_PLAN_ID)" --expected-state EXECUTING + env: + TESTBED_TOOLS_URL: $(TESTBED_TOOLS_URL) + displayName: Run test + timeoutInMinutes: ${{ parameters.MAX_RUN_TEST_MINUTES }} + + - ${{ if eq(parameters.DUMP_KVM_IF_FAIL, 'True') }}: + - script: | + set -e + echo "KVM dump" + echo "SONiC PR system-level test is powered by SONiC Elastictest, for any issue, please send email to sonicelastictest@microsoft.com" + echo "Runtime detailed progress at $(FRONTEND_URL)/scheduler/testplan/$TEST_PLAN_ID " + # When "KVMDUMP" finish, it changes into "FAILED", "CANCELLED" or "FINISHED" + python ./.azure-pipelines/test_plan.py poll -i "$(TEST_PLAN_ID)" --expected-state KVMDUMP + condition: succeededOrFailed() + env: + TESTBED_TOOLS_URL: $(TESTBED_TOOLS_URL) + displayName: KVM dump + + - script: | + set -e + echo "Try to cancel test plan $TEST_PLAN_ID, cancelling finished test plan has no effect." + python ./.azure-pipelines/test_plan.py cancel -i "$(TEST_PLAN_ID)" + condition: always() + env: + TESTBED_TOOLS_URL: $(TESTBED_TOOLS_URL) + TENANT_ID: $(TESTBED_TOOLS_MSAL_TENANT_ID) + CLIENT_ID: $(TESTBED_TOOLS_MSAL_CLIENT_ID) + CLIENT_SECRET: $(TESTBED_TOOLS_MSAL_CLIENT_SECRET) + displayName: Finalize running test plan diff --git a/.azure-pipelines/run-test-template.yml b/.azure-pipelines/run-test-template.yml new file mode 100644 index 000000000000..3e6d975594b1 --- /dev/null +++ b/.azure-pipelines/run-test-template.yml @@ -0,0 +1,87 @@ +parameters: +- name: dut + type: string +- name: tbname + type: string +- name: tbtype + type: string +- name: ptf_name + type: string +- name: section + type: string + default: '' + +steps: +- checkout: self + clean: true + displayName: 'checkout sonic-buildimage repo' + +- task: DownloadPipelineArtifact@2 + inputs: + artifact: sonic-buildimage.vs + displayName: "Download sonic-buildimage.vs artifact" + +- script: | + set -x + sudo mkdir -p /data/sonic-vm/images + sudo cp -v ../target/sonic-vs.img.gz /data/sonic-vm/images/sonic-vs.img.gz + sudo gzip -fd /data/sonic-vm/images/sonic-vs.img.gz + username=$(id -un) + sudo chown -R $username.$username /data/sonic-vm + + pushd /data/sonic-mgmt + git remote update + git reset --hard origin/202012 + sed -i s/use_own_value/${username}/ ansible/veos_vtb + echo aaa > ansible/password.txt + docker exec sonic-mgmt bash -c "pushd /data/sonic-mgmt/ansible;./testbed-cli.sh -d /data/sonic-vm -m $(inventory) -t $(testbed_file) -k ceos refresh-dut ${{ parameters.tbname }} password.txt" && sleep 180 + displayName: "Setup testbed" + +- script: | + rm -rf $(Build.ArtifactStagingDirectory)/* + docker exec sonic-mgmt bash -c "/data/sonic-mgmt/tests/kvmtest.sh -en -T ${{ parameters.tbtype }} ${{ parameters.tbname }} ${{ parameters.dut }} ${{ parameters.section }}" + displayName: "Run tests" + +- script: | + # save dut state if test fails + virsh_version=$(virsh --version) + if [ $virsh_version == "6.0.0" ]; then + mkdir -p $(Build.ArtifactStagingDirectory)/kvmdump + virsh -c qemu:///system list + virsh -c qemu:///system save ${{ parameters.dut }} $(Build.ArtifactStagingDirectory)/kvmdump/${{ parameters.dut }}.memdmp + virsh -c qemu:///system dumpxml ${{ parameters.dut }} > $(Build.ArtifactStagingDirectory)/kvmdump/${{ parameters.dut }}.xml + img=$(virsh -c qemu:///system domblklist ${{ parameters.dut }} | grep vda | awk '{print $2}') + cp $img $(Build.ArtifactStagingDirectory)/kvmdump/${{ parameters.dut }}.img + gzip $(Build.ArtifactStagingDirectory)/kvmdump/${{ parameters.dut }}.img + sudo gzip $(Build.ArtifactStagingDirectory)/kvmdump/${{ parameters.dut }}.memdmp + virsh -c qemu:///system undefine ${{ parameters.dut }} + fi + + docker commit ${{ parameters.ptf_name }} docker-ptf:$(Build.BuildNumber) + docker save docker-ptf:$(Build.BuildNumber) | gzip -c > $(Build.ArtifactStagingDirectory)/kvmdump/docker-ptf-dump.gz + docker rmi docker-ptf:$(Build.BuildNumber) + displayName: "Collect kvmdump" + condition: failed() + +- script: | + cp -r /data/sonic-mgmt/tests/logs $(Build.ArtifactStagingDirectory)/ + username=$(id -un) + sudo chown -R $username.$username $(Build.ArtifactStagingDirectory) + displayName: "Collect test logs" + condition: succeededOrFailed() + +- publish: $(Build.ArtifactStagingDirectory)/kvmdump + artifact: sonic-buildimage.kvmtest.${{ parameters.tbtype}}${{ parameters.section }}.memdump@$(System.JobAttempt) + displayName: "Archive sonic kvm memdump" + condition: failed() + +- publish: $(Build.ArtifactStagingDirectory)/logs + artifact: sonic-buildimage.kvmtest.${{ parameters.tbtype }}${{ parameters.section }}.log@$(System.JobAttempt) + displayName: "Archive sonic kvm logs" + condition: succeededOrFailed() + +- task: PublishTestResults@2 + inputs: + testResultsFiles: '$(Build.ArtifactStagingDirectory)/logs/**/*.xml' + testRunTitle: kvmtest.${{ parameters.tbtype }}${{ parameters.section }} + condition: succeededOrFailed() diff --git a/.azure-pipelines/template-clean-sonic-slave.yml b/.azure-pipelines/template-clean-sonic-slave.yml new file mode 100644 index 000000000000..c67f63fff476 --- /dev/null +++ b/.azure-pipelines/template-clean-sonic-slave.yml @@ -0,0 +1,8 @@ +steps: +- script: | + containers=$(docker container ls -a | grep "sonic-slave" | awk '{ print $1 }') + [ -n "$containers" ] && docker container rm -f $containers + docker images | grep "^" | awk '{print$3}' | xargs -i docker rmi {} + images=$(docker images 'sonic-slave-*' -a -q) + [ -n "$images" ] && docker rmi -f $images + displayName: 'Cleanup sonic slave' diff --git a/.azure-pipelines/template-commonlib.yml b/.azure-pipelines/template-commonlib.yml new file mode 100644 index 000000000000..cd7551d83823 --- /dev/null +++ b/.azure-pipelines/template-commonlib.yml @@ -0,0 +1,53 @@ +parameters: +- name: archs + type: object + default: + - amd64 + - armhf + - arm64 + +jobs: +- ${{ each arch in parameters.archs }}: + - job: Build_${{ arch }} + timeoutInMinutes: 120 + ${{ if eq(arch,'amd64') }}: + pool: sonicbld + ${{ else }}: + pool: sonicbld-${{ arch }} + variables: + - template: template-variables.yml + steps: + - checkout: self + clean: true + submodules: recursive + - script: | + set -ex + branch=$(Build.SourceBranchName) + # replace all: '-' -> '_' + branch=${branch//-/_} + # replace all: 'a' -> 'A', DIST_MASTER is set in variable. + BRANCH=DIST_${branch^^} + # variable name is dynamic + bldenvs=${!BRANCH} + [ "$bldenvs" == "" ] && bldenvs="$(COMMON_LIB_BUILD_ENVS)" + for bldenv in $bldenvs + do + BLDENV=$bldenv make -f Makefile.work configure PLATFORM_ARCH=${{ arch }} PLATFORM=vs ENABLE_DOCKER_BASE_PULL=y + done + set +x + echo "##vso[task.setvariable variable=bldenvs;]$bldenvs" + displayName: Make configure + - script: | + set -ex + for bldenv in $(bldenvs) + do + SONIC_BUILD_JOBS=$(nproc) BLDENV=$bldenv make -f Makefile.work lib-packages ENABLE_DOCKER_BASE_PULL=y + done + mv target $(Build.ArtifactStagingDirectory) + displayName: Make common lib packages + - ${{ if eq(arch,'amd64') }}: + - publish: $(Build.ArtifactStagingDirectory) + artifact: common-lib + - ${{ else }}: + - publish: $(Build.ArtifactStagingDirectory) + artifact: common-lib.${{ arch }} diff --git a/.azure-pipelines/template-daemon.yml b/.azure-pipelines/template-daemon.yml new file mode 100644 index 000000000000..903e10c2d5c6 --- /dev/null +++ b/.azure-pipelines/template-daemon.yml @@ -0,0 +1,24 @@ +steps: +- bash: | + ( + while true + do + sleep 120 + now=$(date +%s) + pids=$(ps -C docker -o pid,etime,args | grep "docker build" | cut -d" " -f2) + for pid in $pids + do + start=$(date --date="$(ls -dl /proc/$pid --time-style full-iso | awk '{print$6,$7}')" +%s) + time_s=$(($now-$start)) + if [[ $time_s -gt $(DOCKER_BUILD_TIMEOUT) ]]; then + echo =========== $(date +%F%T) $time_s &>> target/daemon.log + ps $pid &>> target/daemon.log + sudo kill $pid + fi + done + done + ) & + daemon_pid=$! + ps $daemon_pid + echo $daemon_pid >> /tmp/azp_daemon_kill_docker_pid + displayName: start daemon to kill hang docker diff --git a/.azure-pipelines/template-skipvstest.yml b/.azure-pipelines/template-skipvstest.yml new file mode 100644 index 000000000000..b47f17ce6e81 --- /dev/null +++ b/.azure-pipelines/template-skipvstest.yml @@ -0,0 +1,12 @@ +steps: +- ${{ if eq(variables['Build.Reason'], 'PullRequest') }}: + - script: | + set -ex + tar_branch=origin/$(System.PullRequest.TargetBranch) + git diff $tar_branch..HEAD --name-only | grep -v -f .azure-pipelines/vstest-exclude && exit 0 + git diff $tar_branch..HEAD --name-only | grep -f .azure-pipelines/vstest-include && exit 0 + set +x + echo "Skip vstest jobs" + echo "##vso[task.setvariable variable=SKIP_VSTEST;isOutput=true]YES" + name: SetVar + displayName: "Check if vstest is needed." diff --git a/.azure-pipelines/template-variables.yml b/.azure-pipelines/template-variables.yml new file mode 100644 index 000000000000..42d46182d263 --- /dev/null +++ b/.azure-pipelines/template-variables.yml @@ -0,0 +1,8 @@ +variables: + DEFAULT_CONTAINER_REGISTRY: 'publicmirror.azurecr.io' + COMMON_LIB_BUILD_ENVS: 'bullseye' + SONIC_SLAVE_DOCKER_DRIVER: 'overlay2' + SONIC_BUILD_RETRY_COUNT: 3 + SONIC_BUILD_RETRY_INTERVAL: 600 + DOCKER_BUILDKIT: 0 + DOCKER_BUILD_TIMEOUT: 3600 diff --git a/.azure-pipelines/trigger-publish-artifacts-build.yml b/.azure-pipelines/trigger-publish-artifacts-build.yml new file mode 100644 index 000000000000..7a6676e0f1ba --- /dev/null +++ b/.azure-pipelines/trigger-publish-artifacts-build.yml @@ -0,0 +1,62 @@ +# The steps to trigger the pipeline to publish the artifacts + +parameters: +- name: artifactName + type: string + default: "" +- name: publishPrefix + type: string + default: "$(Build.DefinitionName)/$(Build.SourceBranchName)" + +steps: +- script: | + . functions.sh + sonic_version=$(sonic_get_version) + latest_tag=$(git describe --tags --abbrev=0) + docker_tags="$sonic_version $(Build.SourceBranchName)" + if [ "$(Build.SourceBranchName)" == "master" ]; then + docker_tags="$docker_tags latest" + fi + echo "##vso[task.setvariable variable=sonic_version]$sonic_version" + echo "##vso[task.setvariable variable=latest_tag]$latest_tag" + echo "##vso[task.setvariable variable=docker_tags]$docker_tags" + displayName: 'Set trigger build variables' +- task: TriggerBuild@4 + inputs: + definitionIsInCurrentTeamProject: false + teamProject: internal + tfsServer: $(System.CollectionUri) + buildDefinition: 'publish-artifacts' + queueBuildForUserThatTriggeredBuild: true + ignoreSslCertificateErrors: false + useSameSourceVersion: false + useCustomSourceVersion: false + useSameBranch: false + waitForQueuedBuildsToFinish: false + storeInEnvironmentVariable: true + authenticationMethod: 'Personal Access Token' + password: '$(system.accesstoken)' + enableBuildInQueueCondition: false + dependentOnSuccessfulBuildCondition: false + dependentOnFailedBuildCondition: false + checkbuildsoncurrentbranch: false + failTaskIfConditionsAreNotFulfilled: false + buildParameters: '' + templateParameters: | + pipelineContext: {"buildId":"$(Build.BuildId)", + "pipelineId":"$(System.DefinitionId)", + "project": "$(System.TeamProject)", + "branchName":"$(Build.SourceBranchName)"}, + artifactContext: {"artifactName":"${{ parameters.artifactName }}", + "artifactPatterns":"**/*.bin\n + **/*.swi\n + **/*.raw\n + **/*.img.gz\n + **/*-rpc.gz\n + **/python-saithrift*.deb"}, + publishContext: {"publishPrefix":"${{ parameters.publishPrefix }}", + "keepArtifactName":false, + "dockerImagePatterns":"target/*-rpc.gz", + "dockerTags":"$(docker_tags)", + "version":"$(sonic_version)", + "latestTag":"$(latest_tag)"} diff --git a/.azure-pipelines/vstest-exclude b/.azure-pipelines/vstest-exclude new file mode 100644 index 000000000000..573442e15e55 --- /dev/null +++ b/.azure-pipelines/vstest-exclude @@ -0,0 +1,2 @@ +^platform +^.azure-pipelines diff --git a/.azure-pipelines/vstest-include b/.azure-pipelines/vstest-include new file mode 100644 index 000000000000..86fb3a9d88ba --- /dev/null +++ b/.azure-pipelines/vstest-include @@ -0,0 +1,2 @@ +^platform/vs +^.azure-pipelines/run-test-template.yml diff --git a/.github/codeql/codeql-config.yml b/.github/codeql/codeql-config.yml new file mode 100644 index 000000000000..2c8b0498f319 --- /dev/null +++ b/.github/codeql/codeql-config.yml @@ -0,0 +1,4 @@ +name: "CodeQL config" +queries: + - uses: security-and-quality + - uses: security-extended diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100644 index 000000000000..d92f952628b4 --- /dev/null +++ b/.github/labeler.yml @@ -0,0 +1,2 @@ +automerge: +- all: ['files/build/versions/**'] diff --git a/.github/workflows/README.md b/.github/workflows/README.md new file mode 100644 index 000000000000..d013edd4bdea --- /dev/null +++ b/.github/workflows/README.md @@ -0,0 +1,38 @@ +# Github actions README +This is an introduction about auto-cherry-pick workflow. +take 202205 branch for example: +1. pr_cherrypick_prestep: +```mermaid +graph +Start(Origin PR) --> A{merged?} +A -- NO --> STOP +A -- YES --> A1{Approved
for 202205
Branch?} +A1 -- NO --> STOP +A1 -- YES --> A2(pr_cherrypick_prestep) +B(pr_cherrypick_prestep) +B --> B1{cherry pick
conflict?} +B1 -- YES --> B2(Add tag:
Cherry Pick Confclit_202205) --> B3(Add comment:
refer author code conflict) --> STOP1(STOP) +B1 -- NO --> B4(Create New PR) -- success --> B5(New PR add tag:
automerge) --> B6(New PR add comment:
Origin PR link) --> B7(Origin PR add tag:
Created PR to 202205 Branch) --> B8(Origin PR add comment:
New PR link) +B4 -- fail --> STOP1 +``` + +2. automerge: +```mermaid +graph +Start(PR azp finished successfully) --> A{author:
mssonicbld?} +A -- NO --> STOP +A -- YES --> B{tag:
automerge?} -- YES --> C(Merge PR) +B -- NO --> STOP +``` + +3. pr_cherrypick_poststep: +```mermaid +graph +A(PR is Merged) --> B{tag:
automerge?} +B -- YES --> B1{author:
mssonicbld?} +B1 -- YES --> B2{"title starts:
[action] [PR:123]"} +B2 -- YES --> C(Origin PR remove tag:
Created PR to 202205 Branch) --> D(Origin PR add tag:
Included in 202205 Branch) +B -- NO --> STOP +B1 -- NO --> STOP +B2 -- NO --> STOP +``` diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml new file mode 100644 index 000000000000..ee27244bfb1f --- /dev/null +++ b/.github/workflows/automerge.yml @@ -0,0 +1,22 @@ +# This workflow will merge pull requests automatically +# + +name: automerge +on: + check_suite: + types: + - completed + +jobs: + automerge: + if: github.event.check_suite.app.name == 'Azure Pipelines' && github.event.check_suite.conclusion == 'success' + runs-on: ubuntu-latest + steps: + - name: automerge + uses: 'pascalgn/automerge-action@v0.13.1' + env: + GITHUB_TOKEN: '${{ secrets.TOKEN }}' + MERGE_LABELS: 'automerge' + MERGE_METHOD: 'squash' + MERGE_FILTER_AUTHOR: 'mssonicbld' + MERGE_DELETE_BRANCH: true diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 000000000000..6478fb99f7a5 --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,43 @@ +# For more infomation, please visit: https://github.com/github/codeql-action + +name: "CodeQL" + +on: + push: + branches: + - 'master' + - '202[0-9][0-9][0-9]' + pull_request_target: + branches: + - 'master' + - '202[0-9][0-9][0-9]' + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: [ 'python' ] + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + config-file: ./.github/codeql/codeql-config.yml + languages: ${{ matrix.language }} + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 + with: + category: "/language:${{matrix.language}}" diff --git a/.github/workflows/label.yml b/.github/workflows/label.yml new file mode 100644 index 000000000000..f8ae8e7199a2 --- /dev/null +++ b/.github/workflows/label.yml @@ -0,0 +1,25 @@ +# This workflow will triage pull requests and apply a label based on the +# paths that are modified in the pull request. +# +# To use this workflow, you will need to set up a .github/labeler.yml +# file with configuration. For more information, see: +# https://github.com/actions/labeler + +name: Labeler +on: + pull_request_target: + types: + - opened + - reopened + branches: + - '202012' + paths: + - 'files/build/versions/**' + +jobs: + label: + runs-on: ubuntu-latest + steps: + - uses: actions/labeler@main + with: + repo-token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/pr_cherrypick_poststep.yml b/.github/workflows/pr_cherrypick_poststep.yml new file mode 100644 index 000000000000..7be0b7d7cbe5 --- /dev/null +++ b/.github/workflows/pr_cherrypick_poststep.yml @@ -0,0 +1,49 @@ +name: PostCherryPick +on: + pull_request_target: + types: + - closed + branches: + - '20*' + +jobs: + post_cherry_pick: + if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'automerge') && github.event.pull_request.head.user.login == 'mssonicbld' && startsWith(github.event.pull_request.title, '[action]') + runs-on: ubuntu-latest + steps: + - name: Debug + env: + GITHUB_CONTEXT: ${{ toJson(github) }} + run: echo $GITHUB_CONTEXT | jq + - name: Checkout + uses: actions/checkout@v3 + with: + persist-credentials: false + - name: Main + env: + GITHUB_CONTEXT: ${{ toJson(github) }} + TOKEN: ${{ secrets.TOKEN }} + run: | + set -e + pr_url=$(echo $GITHUB_CONTEXT | jq -r ".event.pull_request._links.html.href") + pr_id=$(echo $GITHUB_CONTEXT | jq -r ".event.number") + base_ref=$(echo $GITHUB_CONTEXT | jq -r ".base_ref") + echo ${TOKEN} | gh auth login --with-token + title=$(echo $GITHUB_CONTEXT | jq -r ".event.pull_request.title") + origin_pr_id=$(echo $title | grep -Eo "\[action\] \[PR:[0-9]*\]" | grep -Eo "[0-9]*") + origin_pr_url=$(echo $pr_url | sed "s/$pr_id/$origin_pr_id/") + echo ============================= + echo pr_url: $pr_url + echo pr_id: $pr_id + echo base_ref: $base_ref + echo title: $title + echo origin_pr_id: $origin_pr_id + echo origin_pr_url: $origin_pr_url + echo ============================= + # Add label + if [[ "$origin_pr_id" == "" ]];then + echo "original PR didn't found." + exit 1 + fi + gh pr edit $origin_pr_url --add-label "Included in ${base_ref} Branch" + gh pr edit $origin_pr_url --remove-label "Created PR to ${base_ref} Branch,Approved for ${base_ref} Branch" diff --git a/.github/workflows/pr_cherrypick_prestep.yml b/.github/workflows/pr_cherrypick_prestep.yml new file mode 100644 index 000000000000..3caf3f940843 --- /dev/null +++ b/.github/workflows/pr_cherrypick_prestep.yml @@ -0,0 +1,136 @@ +name: PreCherryPick +on: + pull_request_target: + types: + - labeled + - closed + branches: + - master-test + +jobs: + pre_cherry_pick: + if: github.event.pull_request.merged == true && ( (github.event.action == 'closed' && contains(join(github.event.pull_request.labels.*.name, ','), 'Approved for 20')) || (github.event.action == 'labeled' && startsWith(github.event.label.name, 'Approved for 20')) ) + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + persist-credentials: false + - name: Debug + env: + GITHUB_CONTEXT: ${{ toJson(github) }} + run: echo $GITHUB_CONTEXT | jq + - name: Main + env: + GITHUB_CONTEXT: ${{ toJson(github) }} + TOKEN: ${{ secrets.TOKEN }} + run: | + set -e + + sha=$(echo $GITHUB_CONTEXT | jq -r ".event.pull_request.merge_commit_sha") + pr_id=$(echo $GITHUB_CONTEXT | jq -r ".event.number") + pr_url=$(echo $GITHUB_CONTEXT | jq -r ".event.pull_request._links.html.href") + repository=$(echo $GITHUB_CONTEXT | jq -r ".repository") + labels=$(echo $GITHUB_CONTEXT | jq -r ".event.pull_request.labels[].name") + author=$(echo $GITHUB_CONTEXT | jq -r ".event.pull_request.base.user.login") + branches=$(git branch -a --list 'origin/20????' | awk -F/ '{print$3}' | grep -E "202[0-9]{3}") + if [[ $(echo $GITHUB_CONTEXT | jq -r ".event.action") == "labeled" ]];then + labels=$(echo $GITHUB_CONTEXT | jq -r ".event.label.name") + fi + title=$(echo $GITHUB_CONTEXT | jq -r ".event.pull_request.title") + echo ============================= + echo SHA: $sha + echo PRID: $pr_id + echo pr_url: $pr_url + echo repository: $repository + echo branches: $branches + echo labels: + echo "$labels" + echo ${TOKEN} | gh auth login --with-token + echo author: $author + echo title: $title + echo ============================= + + git config user.name mssonicbld + git config user.email sonicbld@microsoft.com + git config credential.https://github.com.username mssonicbld + git remote add mssonicbld https://mssonicbld:${TOKEN}@github.com/mssonicbld/sonic-buildimage + git fetch mssonicbld + git remote -vv + + cherry_pick(){ + set -e + local create_pr='' + while read label + do + echo label: $label + if [[ "$label" == "Approved for $branch Branch" ]];then + create_pr=1 + fi + if [[ "$label" == "Created PR to $branch Branch" ]];then + echo "already has tag: Created PR to $branch Branch, return" + return 0 + fi + if [[ "$label" == "Included in $branch Branch" ]];then + echo "already has tag: Included in $branch Branch, return" + return 0 + fi + if [[ "$label" == "Cherry Pick Conflict_$branch" ]];then + echo "already has tag: Cherry Pick Conflict_$branch, return" + return 0 + fi + done <<< "$labels" + + if [[ "$create_pr" != "1" ]];then + echo "Didn't find 'Approved for $branch Branch' tag." + return 0 + fi + # Begin to cherry-pick PR + git cherry-pick --abort 2>/dev/null || true + git clean -xdff 2>/dev/null || true + git reset HEAD --hard || true + git checkout -b $branch --track origin/$branch + git status | grep "working tree clean" + + if ! git cherry-pick $sha;then + echo 'cherry-pick failed.' + git cherry-pick --abort + git status | grep "working tree clean" + # Add label + gh pr edit $pr_url --add-label "Cherry Pick Conflict_$branch" + echo 'Add label "Cherry Pick Conflict_$branch" success' + gh pr comment $pr_url --body "@${author} PR conflicts with $branch branch" + echo 'Add commnet "@${author} PR conflicts with $branch branch"' + else + # Create PR to release branch + git push mssonicbld HEAD:$branch-${pr_id} -f + result=$(gh pr create -R ${repository} -H mssonicbld:$branch-${pr_id} -B $branch -t "[action] [PR:$pr_id] $title" -b '' 2>&1) + echo $result | grep "already exists" && { echo $result; return 0; } + echo $result | grep github.com || { echo $result; return 1; } + new_pr_rul=$(echo $result | grep github.com) + echo new_pr_rul: $new_pr_rul + + # Add label to old PR + gh pr edit $pr_url --add-label "Created PR to $branch Branch" + echo Add label Created PR to $branch Branch + # Add comment to old PR + gh pr comment $pr_url --body "Cherry-pick PR to $branch: ${new_pr_rul}" + echo Add comment to old PR + + # Add label to new PR + gh pr edit $new_pr_rul --add-label "automerge" + echo Add label automerge to new PR + # Add comment to new PR + gh pr comment $new_pr_rul --body "Original PR: ${pr_url}" + echo Add comment to new PR + fi + } + + for branch in $branches + do + echo ------------------------------------------- + echo Begin to parse Branch: $branch + cherry_pick + done + diff --git a/.gitignore b/.gitignore index 7e2f73f718e9..f6dc53a5e2f8 100644 --- a/.gitignore +++ b/.gitignore @@ -56,12 +56,20 @@ platform/**/*-none-any.whl platform/**/.pybuild platform/**/debian/* platform/**/build +platform/**/*.ko +platform/**/*.mod.c +platform/**/*.mod.o +platform/**/*.o +platform/**/*.d +platform/**/*.cmd +platform/**/*.order platform/broadcom/sonic-platform-modules-dell/s5232f/sonic_platform/ipmihelper.py platform/broadcom/sonic-platform-modules-dell/s6100/modules/dell_ich.c platform/broadcom/sonic-platform-modules-dell/s6100/modules/dell_s6100_lpc.c platform/broadcom/sonic-platform-modules-dell/z9100/modules/dell_ich.c platform/broadcom/sonic-platform-modules-dell/z9100/modules/dell_mailbox.c platform/broadcom/sonic-platform-modules-dell/z9264f/sonic_platform/ipmihelper.py +platform/cisco-8000/ # buildinfo files/build/buildinfo @@ -69,3 +77,7 @@ files/build/tmp dockers/**/buildinfo platform/**/buildinfo sonic-slave*/**/buildinfo + +# Debian mirror Sources +sources.list.* +!sources.list*.j2 diff --git a/.gitmodules b/.gitmodules index 38b22c4fd687..4eedbea00df9 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,52 +1,50 @@ [submodule "sonic-swss-common"] path = src/sonic-swss-common - url = https://github.com/Azure/sonic-swss-common + url = https://github.com/sonic-net/sonic-swss-common [submodule "sonic-linux-kernel"] path = src/sonic-linux-kernel - url = https://github.com/Azure/sonic-linux-kernel + url = https://github.com/sonic-net/sonic-linux-kernel [submodule "sonic-sairedis"] path = src/sonic-sairedis - url = https://github.com/Azure/sonic-sairedis + url = https://github.com/sonic-net/sonic-sairedis [submodule "sonic-swss"] path = src/sonic-swss - url = https://github.com/Azure/sonic-swss + url = https://github.com/sonic-net/sonic-swss [submodule "src/p4c-bm/p4c-bm"] path = platform/p4/p4c-bm/p4c-bm url = https://github.com/krambn/p4c-bm [submodule "src/p4-hlir/p4-hlir"] path = platform/p4/p4-hlir/p4-hlir url = https://github.com/p4lang/p4-hlir -[submodule "quagga"] - path = src/sonic-quagga - url = https://github.com/Azure/sonic-quagga - branch = debian/0.99.24.1 [submodule "sonic-dbsyncd"] path = src/sonic-dbsyncd - url = https://github.com/Azure/sonic-dbsyncd + url = https://github.com/sonic-net/sonic-dbsyncd [submodule "src/sonic-py-swsssdk"] path = src/sonic-py-swsssdk - url = https://github.com/Azure/sonic-py-swsssdk.git + url = https://github.com/sonic-net/sonic-py-swsssdk.git [submodule "src/sonic-snmpagent"] path = src/sonic-snmpagent - url = https://github.com/Azure/sonic-snmpagent + url = https://github.com/sonic-net/sonic-snmpagent [submodule "src/ptf"] path = src/ptf url = https://github.com/p4lang/ptf.git [submodule "src/sonic-utilities"] path = src/sonic-utilities - url = https://github.com/Azure/sonic-utilities + url = https://github.com/sonic-net/sonic-utilities + branch = 202012 [submodule "platform/broadcom/sonic-platform-modules-arista"] path = platform/broadcom/sonic-platform-modules-arista url = https://github.com/aristanetworks/sonic [submodule "src/sonic-platform-common"] path = src/sonic-platform-common - url = https://github.com/Azure/sonic-platform-common + url = https://github.com/sonic-net/sonic-platform-common + branch = 202012 [submodule "src/sonic-platform-daemons"] path = src/sonic-platform-daemons - url = https://github.com/Azure/sonic-platform-daemons + url = https://github.com/sonic-net/sonic-platform-daemons [submodule "src/sonic-frr/frr"] path = src/sonic-frr/frr - url = https://github.com/Azure/sonic-frr.git + url = https://github.com/sonic-net/sonic-frr.git branch = frr/7.5 [submodule "platform/p4/p4-hlir/p4-hlir-v1.1"] path = platform/p4/p4-hlir/p4-hlir-v1.1 @@ -59,29 +57,37 @@ url = https://github.com/aristanetworks/sonic [submodule "platform/mellanox/hw-management/hw-mgmt"] path = platform/mellanox/hw-management/hw-mgmt - url = https://github.com/Mellanox/hw-mgmt/ + url = https://github.com/Mellanox/hw-mgmt [submodule "src/redis-dump-load"] path = src/redis-dump-load url = https://github.com/p/redis-dump-load.git +[submodule "src/scapy"] + path = src/scapy + url = https://github.com/secdev/scapy.git [submodule "platform/mellanox/mlnx-sai/SAI-Implementation"] path = platform/mellanox/mlnx-sai/SAI-Implementation url = https://github.com/Mellanox/SAI-Implementation [submodule "src/sonic-mgmt-framework"] path = src/sonic-mgmt-framework - url = https://github.com/Azure/sonic-mgmt-framework + url = https://github.com/sonic-net/sonic-mgmt-framework [submodule "src/sonic-telemetry"] path = src/sonic-telemetry - url = https://github.com/Azure/sonic-telemetry -[submodule "Switch-SDK-drivers"] - path = platform/mellanox/sdk-src/sx-kernel/Switch-SDK-drivers - url = https://github.com/Mellanox/Switch-SDK-drivers + url = https://github.com/sonic-net/sonic-gnmi [submodule "src/sonic-ztp"] path = src/sonic-ztp - url = https://github.com/Azure/sonic-ztp + url = https://github.com/sonic-net/sonic-ztp [submodule "src/sonic-restapi"] path = src/sonic-restapi - url = https://github.com/Azure/sonic-restapi.git + url = https://github.com/sonic-net/sonic-restapi.git branch = master [submodule "src/sonic-mgmt-common"] path = src/sonic-mgmt-common - url = https://github.com/Azure/sonic-mgmt-common.git + url = https://github.com/sonic-net/sonic-mgmt-common.git +[submodule "src/linkmgrd"] + path = src/linkmgrd + url = https://github.com/sonic-net/sonic-linkmgrd.git + branch = 202012 +[submodule "src/dhcprelay"] + path = src/dhcprelay + url = https://github.com/sonic-net/sonic-dhcp-relay.git + branch = 202012 diff --git a/Makefile b/Makefile index 2231e6d98231..f3217bf03149 100644 --- a/Makefile +++ b/Makefile @@ -3,15 +3,29 @@ NOJESSIE ?= 1 NOSTRETCH ?= 0 +ifeq ($(NOJESSIE),0) +BUILD_JESSIE=1 +endif + +ifeq ($(NOSTRETCH),0) +BUILD_STRETCH=1 +endif + +PLATFORM_PATH := platform/$(if $(PLATFORM),$(PLATFORM),$(CONFIGURED_PLATFORM)) +PLATFORM_CHECKOUT := platform/checkout +PLATFORM_CHECKOUT_FILE := $(PLATFORM_CHECKOUT)/$(PLATFORM).ini +PLATFORM_CHECKOUT_CMD := $(shell if [ -f $(PLATFORM_CHECKOUT_FILE) ]; then PLATFORM_PATH=$(PLATFORM_PATH) j2 $(PLATFORM_CHECKOUT)/template.j2 $(PLATFORM_CHECKOUT_FILE); fi) +MAKE_WITH_RETRY := ./scripts/run_with_retry $(MAKE) + %:: @echo "+++ --- Making $@ --- +++" ifeq ($(NOJESSIE), 0) - EXTRA_DOCKER_TARGETS=$(notdir $@) make -f Makefile.work jessie + $(MAKE_WITH_RETRY) EXTRA_DOCKER_TARGETS=$(notdir $@) -f Makefile.work jessie endif ifeq ($(NOSTRETCH), 0) - EXTRA_DOCKER_TARGETS=$(notdir $@) BLDENV=stretch make -f Makefile.work stretch + $(MAKE_WITH_RETRY) EXTRA_DOCKER_TARGETS=$(notdir $@) BLDENV=stretch -f Makefile.work stretch endif - BLDENV=buster make -f Makefile.work $@ + $(MAKE_WITH_RETRY) BLDENV=buster -f Makefile.work $@ jessie: @echo "+++ Making $@ +++" @@ -29,15 +43,27 @@ init: @echo "+++ Making $@ +++" make -f Makefile.work $@ -clean configure reset showtag sonic-slave-build sonic-slave-bash : +# +# Function to invoke target $@ in Makefile.work with proper BLDENV +# +define make_work @echo "+++ Making $@ +++" -ifeq ($(NOJESSIE), 0) - make -f Makefile.work $@ -endif -ifeq ($(NOSTRETCH), 0) - BLDENV=stretch make -f Makefile.work $@ -endif + $(if $(BUILD_JESSIE),make -f Makefile.work $@,) + $(if $(BUILD_STRETCH),BLDENV=stretch make -f Makefile.work $@,) BLDENV=buster make -f Makefile.work $@ +endef + +.PHONY: $(PLATFORM_PATH) + +$(PLATFORM_PATH): + @echo "+++ Cheking $@ +++" + $(PLATFORM_CHECKOUT_CMD) + +configure : $(PLATFORM_PATH) + $(call make_work, $@) + +clean reset showtag sonic-slave-build sonic-slave-bash : + $(call make_work, $@) # Freeze the versions, see more detail options: scripts/versions_manager.py freeze -h freeze: diff --git a/Makefile.cache b/Makefile.cache index 4037222ffc93..421b87720d3f 100644 --- a/Makefile.cache +++ b/Makefile.cache @@ -182,7 +182,10 @@ define GET_MOD_DEP_SHA $(eval $(1)_DEP_FILES_MISSING := $(filter-out $(wildcard $($(1)_DEP_MOD_SHA_FILES)),$($(1)_DEP_MOD_SHA_FILES)) ) $(if $($(1)_DEP_FILES_MISSING), $(warning "[ DPKG ] Dependecy file(s) are not found for $(1) : $($(1)_DEP_FILES_MISSING))) - $(eval $(1)_DEP_MOD_SHA := $(shell git hash-object $($(1)_DEP_MOD_SHA_FILES) \ + # Include package dependencies hash values into package hash calculation + $(eval $(1)_DEP_PKGS_SHA := $(foreach dfile,$($(1)_MOD_DEP_PKGS),$($(dfile)_DEP_MOD_SHA) $($(dfile)_MOD_HASH))) + + $(eval $(1)_DEP_MOD_SHA := $(shell bash -c "git hash-object $($(1)_DEP_MOD_SHA_FILES) && echo $($(1)_DEP_PKGS_SHA)" \ | sha1sum | awk '{print substr($$1,0,23);}')) endef @@ -555,6 +558,12 @@ define SHA_DEP_RULES ALL_DEP_FILES_LIST += $(foreach pkg,$(2), $($(filter none,$($(1)_CACHE_MODE)), \ $(addsuffix .$(3),$(addprefix $(pkg)/, $(1))) \ $(addsuffix .$(3).sha,$(addprefix $(pkg)/, $(1))))) +$(foreach docker, $(filter $(SONIC_DOCKER_IMAGES), $(1)), \ + $(eval $(docker)_DEP_FILES+=$(wildcard files/build/versions/default/*) \ + $(wildcard files/build/versions/dockers/$(basename $(docker))/*))) +$(foreach docker, $(filter $(SONIC_DOCKER_DBG_IMAGES), $(1)), \ + $(eval $(docker)_DEP_FILES+=$(wildcard files/build/versions/default/*) \ + $(wildcard files/build/versions/dockers/$(patsubst %-$(DBG_IMAGE_MARK).gz,%,$(docker))/*))) $(addsuffix .$(3),$(addprefix $(2)/, $(1))) : $(2)/%.$(3) : \ $(2)/%.flags $$$$($$$$*_DEP_FILES) $$$$(if $$$$($$$$*_SMDEP_FILES), $(2)/%.smdep) @$$(eval $$*_DEP_FILES_MODIFIED := $$? ) diff --git a/Makefile.work b/Makefile.work index 0d7f62af3917..e4e9159baa83 100644 --- a/Makefile.work +++ b/Makefile.work @@ -10,6 +10,7 @@ # * ENABLE_ZTP: Enables zero touch provisioning. # * SHUTDOWN_BGP_ON_START: Sets admin-down state for all bgp peerings after restart. # * INCLUDE_KUBERNETES: Allows including Kubernetes +# * INCLUDE_MUX: Include MUX feature/services for TOR switch. # * ENABLE_PFCWD_ON_START: Enable PFC Watchdog (PFCWD) on server-facing ports # * by default for TOR switch. # * ENABLE_SYNCD_RPC: Enables rpc-based syncd builds. @@ -38,6 +39,7 @@ # * SONIC_DPKG_CACHE_METHOD: Specifying method of obtaining the Debian packages from cache: none or cache # * SONIC_DPKG_CACHE_SOURCE: Debian package cache location when cache enabled for debian packages # * BUILD_LOG_TIMESTAMP: Set timestamp in the build log (simple/none) +# * DOCKER_EXTRA_OPTS: Extra command line arguments for dockerd running in slave container. # ############################################################################### @@ -46,9 +48,19 @@ SHELL = /bin/bash USER := $(shell id -un) PWD := $(shell pwd) USER_LC := $(shell echo $(USER) | tr A-Z a-z) +DOCKER_MACHINE := $(shell docker run --rm debian:buster uname -m) comma := , +ifeq ($(DOCKER_MACHINE), aarch64) +COMPILE_HOST_ARCH := arm64 +else ifeq ($(shell echo $(DOCKER_MACHINE) | grep -qE "armv7l|armv8l" && echo y),y) +COMPILE_HOST_ARCH := armhf +else +COMPILE_HOST_ARCH := amd64 +endif + + ifeq ($(USER), root) $(error Add your user account to docker group and use your user account to make. root or sudo are not supported!) endif @@ -90,7 +102,17 @@ else SLAVE_DIR = sonic-slave-jessie endif +# Define a do-nothing target for rules/config.user so that when +# the file is missing, make won't try to rebuld everything. +rules/config.user: + @echo -n "" + include rules/config +-include rules/config.user + +ifneq ($(DEFAULT_CONTAINER_REGISTRY),) +override DEFAULT_CONTAINER_REGISTRY := $(DEFAULT_CONTAINER_REGISTRY)/ +endif ifeq ($(ENABLE_DOCKER_BASE_PULL),) override ENABLE_DOCKER_BASE_PULL = n @@ -98,23 +120,31 @@ endif ifeq ($(CONFIGURED_ARCH),amd64) SLAVE_BASE_IMAGE = $(SLAVE_DIR) +MULTIARCH_QEMU_ENVIRON = n else -SLAVE_BASE_IMAGE = $(SLAVE_DIR)-$(CONFIGURED_ARCH) +ifeq ($(CONFIGURED_ARCH), $(COMPILE_HOST_ARCH)) +SLAVE_BASE_IMAGE = $(SLAVE_DIR) +MULTIARCH_QEMU_ENVIRON = n +else ifneq ($(CONFIGURED_ARCH),) +SLAVE_BASE_IMAGE = $(SLAVE_DIR)-march-$(CONFIGURED_ARCH) +MULTIARCH_QEMU_ENVIRON = y +endif endif SLAVE_IMAGE = $(SLAVE_BASE_IMAGE)-$(USER_LC) # Generate the version control build info $(shell SONIC_VERSION_CONTROL_COMPONENTS=$(SONIC_VERSION_CONTROL_COMPONENTS) \ TRUSTED_GPG_URLS=$(TRUSTED_GPG_URLS) PACKAGE_URL_PREFIX=$(PACKAGE_URL_PREFIX) \ + MIRROR_SNAPSHOT=$(MIRROR_SNAPSHOT) \ scripts/generate_buildinfo_config.sh) # Generate the slave Dockerfile, and prepare build info for it -$(shell CONFIGURED_ARCH=$(CONFIGURED_ARCH) j2 $(SLAVE_DIR)/Dockerfile.j2 > $(SLAVE_DIR)/Dockerfile) -$(shell CONFIGURED_ARCH=$(CONFIGURED_ARCH) j2 $(SLAVE_DIR)/Dockerfile.user.j2 > $(SLAVE_DIR)/Dockerfile.user) -$(shell BUILD_SLAVE=y scripts/prepare_docker_buildinfo.sh $(SLAVE_BASE_IMAGE) $(SLAVE_DIR)/Dockerfile $(CONFIGURED_ARCH) "" $(BLDENV)) +$(shell CONFIGURED_ARCH=$(CONFIGURED_ARCH) MULTIARCH_QEMU_ENVIRON=$(MULTIARCH_QEMU_ENVIRON) DOCKER_EXTRA_OPTS=$(DOCKER_EXTRA_OPTS) DEFAULT_CONTAINER_REGISTRY=$(DEFAULT_CONTAINER_REGISTRY) j2 $(SLAVE_DIR)/Dockerfile.j2 > $(SLAVE_DIR)/Dockerfile) +$(shell CONFIGURED_ARCH=$(CONFIGURED_ARCH) MULTIARCH_QEMU_ENVIRON=$(MULTIARCH_QEMU_ENVIRON) j2 $(SLAVE_DIR)/Dockerfile.user.j2 > $(SLAVE_DIR)/Dockerfile.user) +$(shell BUILD_SLAVE=y DEFAULT_CONTAINER_REGISTRY=$(DEFAULT_CONTAINER_REGISTRY) MIRROR_SNAPSHOT=$(MIRROR_SNAPSHOT) scripts/prepare_docker_buildinfo.sh $(SLAVE_BASE_IMAGE) $(SLAVE_DIR)/Dockerfile $(CONFIGURED_ARCH) "" $(BLDENV)) # Add the versions in the tag, if the version change, need to rebuild the slave -SLAVE_BASE_TAG = $(shell cat $(SLAVE_DIR)/Dockerfile $(SLAVE_DIR)/buildinfo/versions/versions-* | sha1sum | awk '{print substr($$1,0,11);}') +SLAVE_BASE_TAG = $(shell cat $(SLAVE_DIR)/Dockerfile $(SLAVE_DIR)/buildinfo/versions/versions-* src/sonic-build-hooks/hooks/* | sha1sum | awk '{print substr($$1,0,11);}') SLAVE_TAG = $(shell cat $(SLAVE_DIR)/Dockerfile.user $(SLAVE_DIR)/Dockerfile $(SLAVE_DIR)/buildinfo/versions/versions-* | sha1sum | awk '{print substr($$1,0,11);}') OVERLAY_MODULE_CHECK := \ @@ -157,7 +187,7 @@ ifeq ($(SONIC_CONFIG_USE_NATIVE_DOCKERD_FOR_BUILD), y) DOCKER_RUN += -v /var/run/docker.sock:/var/run/docker.sock endif -ifneq (,$(filter $(CONFIGURED_ARCH), armhf arm64)) +ifeq ($(MULTIARCH_QEMU_ENVIRON), y) ifeq ($(DOCKER_DATA_ROOT_FOR_MULTIARCH),) DOCKER_DATA_ROOT_FOR_MULTIARCH := /var/lib/march/docker endif @@ -216,6 +246,7 @@ SONIC_BUILD_INSTRUCTION := make \ -f slave.mk \ PLATFORM=$(PLATFORM) \ PLATFORM_ARCH=$(PLATFORM_ARCH) \ + MULTIARCH_QEMU_ENVIRON=$(MULTIARCH_QEMU_ENVIRON) \ BUILD_NUMBER=$(BUILD_NUMBER) \ BUILD_TIMESTAMP=$(BUILD_TIMESTAMP) \ SONIC_IMAGE_VERSION=$(SONIC_IMAGE_VERSION) \ @@ -229,6 +260,7 @@ SONIC_BUILD_INSTRUCTION := make \ SONIC_ENABLE_PFCWD_ON_START=$(ENABLE_PFCWD_ON_START) \ SONIC_ENABLE_SYNCD_RPC=$(ENABLE_SYNCD_RPC) \ SONIC_INSTALL_DEBUG_TOOLS=$(INSTALL_DEBUG_TOOLS) \ + SONIC_SAITHRIFT_V2=$(SAITHRIFT_V2) \ MDEBUG=$(MDEBUG) \ PASSWORD=$(PASSWORD) \ USERNAME=$(USERNAME) \ @@ -242,19 +274,28 @@ SONIC_BUILD_INSTRUCTION := make \ HTTPS_PROXY=$(https_proxy) \ SONIC_INCLUDE_SYSTEM_TELEMETRY=$(INCLUDE_SYSTEM_TELEMETRY) \ SONIC_INCLUDE_RESTAPI=$(INCLUDE_RESTAPI) \ + SONIC_INCLUDE_MUX=$(INCLUDE_MUX) \ TELEMETRY_WRITABLE=$(TELEMETRY_WRITABLE) \ EXTRA_DOCKER_TARGETS=$(EXTRA_DOCKER_TARGETS) \ BUILD_LOG_TIMESTAMP=$(BUILD_LOG_TIMESTAMP) \ SONIC_ENABLE_IMAGE_SIGNATURE=$(ENABLE_IMAGE_SIGNATURE) \ + SONIC_DEFAULT_CONTAINER_REGISTRY=$(DEFAULT_CONTAINER_REGISTRY) \ SLAVE_DIR=$(SLAVE_DIR) \ + MIRROR_URLS=$(MIRROR_URLS) \ + MIRROR_SECURITY_URLS=$(MIRROR_SECURITY_URLS) \ + MIRROR_SNAPSHOT=$(MIRROR_SNAPSHOT) \ $(SONIC_OVERRIDE_BUILD_VARS) .PHONY: sonic-slave-build sonic-slave-bash init reset .DEFAULT_GOAL := all -%:: -ifneq (,$(filter $(CONFIGURED_ARCH), armhf arm64)) +export MIRROR_URLS +export MIRROR_SECURITY_URLS +export SONIC_VERSION_CONTROL_COMPONENTS + +%:: | sonic-build-hooks +ifeq ($(MULTIARCH_QEMU_ENVIRON), y) @$(DOCKER_MULTIARCH_CHECK) ifneq ($(BLDENV), ) @$(DOCKER_SERVICE_MULTIARCH_CHECK) @@ -263,8 +304,6 @@ endif endif @$(OVERLAY_MODULE_CHECK) - @pushd src/sonic-build-hooks; TRUSTED_GPG_URLS=$(TRUSTED_GPG_URLS) make all; popd - @cp src/sonic-build-hooks/buildinfo/sonic-build-hooks* $(SLAVE_DIR)/buildinfo @docker inspect --type image $(SLAVE_BASE_IMAGE):$(SLAVE_BASE_TAG) &> /dev/null || \ { [ $(ENABLE_DOCKER_BASE_PULL) == y ] && { echo Image $(SLAVE_BASE_IMAGE):$(SLAVE_BASE_TAG) not found. Pulling...; } && \ $(DOCKER_BASE_PULL) && \ @@ -289,6 +328,8 @@ endif sonic-build-hooks: @pushd src/sonic-build-hooks; TRUSTED_GPG_URLS=$(TRUSTED_GPG_URLS) make all; popd @cp src/sonic-build-hooks/buildinfo/sonic-build-hooks* $(SLAVE_DIR)/buildinfo + @[ "$(MULTIARCH_QEMU_ENVIRON)" == y ] && scripts/build_mirror_config.sh $(SLAVE_DIR) amd64 $(BLDENV) + @scripts/build_mirror_config.sh $(SLAVE_DIR) $(CONFIGURED_ARCH) $(BLDENV) sonic-slave-base-build : sonic-build-hooks @$(OVERLAY_MODULE_CHECK) @@ -329,7 +370,7 @@ reset : if [ $$ans == y ]; then echo "Resetting local repository. Please wait..."; $(DOCKER_RUN) $(SLAVE_IMAGE):$(SLAVE_TAG) sudo rm -rf fsroot; - if [[ "$(CONFIGURED_ARCH)" == "armhf" || "$(CONFIGURED_ARCH)" == "arm64" ]]; then + if [ "$(MULTIARCH_QEMU_ENVIRON)" == y ] && [[ "$(CONFIGURED_ARCH)" == "armhf" || "$(CONFIGURED_ARCH)" == "arm64" ]]; then echo "Stopping march $(CONFIGURED_ARCH) docker" sudo kill -9 `sudo cat /var/run/march/docker.pid` || true sudo rm -f /var/run/march/docker.pid || true diff --git a/azure-pipelines.yml b/azure-pipelines.yml index ac078ef24b70..511895c94e99 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -4,16 +4,186 @@ # https://aka.ms/yaml trigger: -- main + branches: + include: + - master + - 202012 + paths: + exclude: + - .github -pool: - vmImage: 'ubuntu-latest' +pr: + branches: + include: + - master + - 202012 + paths: + exclude: + - .github -steps: -- script: echo Hello, world! - displayName: 'Run a one-line script' +name: $(TeamProject)_$(Build.DefinitionName)_$(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.r) -- script: | - echo Add other tasks to build, test, and deploy your project. - echo See https://aka.ms/yaml - displayName: 'Run a multi-line script' +resources: + repositories: + - repository: sonic-mgmt + type: github + name: sonic-net/sonic-mgmt + endpoint: sonic-net + ref: refs/heads/202012 + - repository: buildimage + type: github + name: sonic-net/sonic-buildimage + endpoint: sonic-net + ref: master + +variables: +- template: .azure-pipelines/azure-pipelines-repd-build-variables.yml@buildimage +- template: .azure-pipelines/template-variables.yml@buildimage +- name: CACHE_MODE + value: rcache + +stages: +- stage: BuildVS + pool: sonicbld + variables: + CACHE_MODE: rcache + VERSION_CONTROL_OPTIONS: 'SONIC_VERSION_CONTROL_COMPONENTS=deb,py2,py3,web,git,docker' + jobs: + - template: .azure-pipelines/azure-pipelines-build.yml + parameters: + buildOptions: 'USERNAME=admin SONIC_BUILD_JOBS=$(nproc) ${{ variables.VERSION_CONTROL_OPTIONS }}' + jobGroups: + - name: vs + +- stage: Build + pool: sonicbld + dependsOn: [] + variables: + CACHE_MODE: rcache + VERSION_CONTROL_OPTIONS: 'SONIC_VERSION_CONTROL_COMPONENTS=deb,py2,py3,web,git,docker' + jobs: + - template: .azure-pipelines/azure-pipelines-build.yml + parameters: + buildOptions: 'USERNAME=admin SONIC_BUILD_JOBS=$(nproc) ${{ variables.VERSION_CONTROL_OPTIONS }}' + jobGroups: + - name: broadcom + - name: mellanox + - name: marvell-armhf + pool: sonicbld-armhf + timeoutInMinutes: 1200 + variables: + PLATFORM_ARCH: armhf + +- stage: Test + dependsOn: BuildVS + condition: and(succeeded(), and(ne(stageDependencies.BuildVS.outputs['vs.SetVar.SKIP_VSTEST'], 'YES'), in(dependencies.BuildVS.result, 'Succeeded', 'SucceededWithIssues'))) + variables: + - group: SONiC-Elastictest + - name: inventory + value: veos_vtb + - name: testbed_file + value: vtestbed.csv + + jobs: + - job: + pool: sonictest + displayName: "vstest" + timeoutInMinutes: 60 + steps: + - checkout: self + clean: true + submodules: recursive + displayName: 'Checkout code' + + - task: DownloadPipelineArtifact@2 + inputs: + artifact: sonic-buildimage.vs + displayName: "Download sonic-buildimage.vs artifact" + + - script: | + sudo apt-get update + sudo apt-get install -y make libtool m4 autoconf dh-exec debhelper cmake pkg-config \ + libhiredis-dev libnl-3-dev libnl-genl-3-dev libnl-route-3-dev libnl-nf-3-dev swig3.0 \ + libpython2.7-dev libboost-dev libboost-serialization-dev uuid-dev libzmq5 libzmq3-dev python3-pip \ + cmake libgtest-dev libgmock-dev libyang-dev + sudo pip3 install pytest + cd src/sonic-swss-common + ./autogen.sh + dpkg-buildpackage -rfakeroot -us -uc -b -j$(nproc) + sudo dpkg -i --force-confask,confnew ../libswsscommon_*.deb + sudo dpkg -i ../python3-swsscommon_*.deb + displayName: "Compile sonic swss common" + + - script: | + sudo docker load -i ../target/docker-sonic-vs.gz + docker tag docker-sonic-vs:latest docker-sonic-vs:$(Build.BuildNumber) + username=$(id -un) + + trap "docker ps; docker images; ip netns list; \ + docker rmi docker-sonic-vs:$(Build.BuildNumber); \ + ip netns list | grep -E [-]srv[0-9]+ | awk '{print $1}' | xargs -I {} sudo ip netns delete {}; \ + sudo chown -R ${username}.${username} .; \ + sudo chown -R ${username}.${username} $(System.DefaultWorkingDirectory)" EXIT + pushd platform/vs/tests + sudo py.test -v --junitxml=tr.xml --imgname=docker-sonic-vs:$(Build.BuildNumber) + displayName: "Run vs tests" + + - task: PublishTestResults@2 + inputs: + testResultsFiles: '**/tr.xml' + testRunTitle: vstest + + - job: t0_elastictest + pool: ubuntu-20.04 + displayName: "kvmtest-t0 by Elastictest" + timeoutInMinutes: 240 + continueOnError: false + steps: + - template: .azure-pipelines/run-test-scheduler-template.yml + parameters: + TOPOLOGY: t0 + MIN_WORKER: $(T0_INSTANCE_NUM) + MAX_WORKER: $(T0_INSTANCE_NUM) + MGMT_BRANCH: 202012 + + - job: t0_2vlans_elastictest + pool: ubuntu-20.04 + displayName: "kvmtest-t0-2vlans by Elastictest" + timeoutInMinutes: 240 + continueOnError: false + steps: + - template: .azure-pipelines/run-test-scheduler-template.yml + parameters: + TOPOLOGY: t0 + TEST_SET: t0-2vlans + MIN_WORKER: $(T0_2VLANS_INSTANCE_NUM) + MAX_WORKER: $(T0_2VLANS_INSTANCE_NUM) + DEPLOY_MG_EXTRA_PARAMS: "-e vlan_config=two_vlan_a" + MGMT_BRANCH: 202012 + + - job: t1_lag_elastictest + pool: ubuntu-20.04 + displayName: "kvmtest-t1-lag by Elastictest" + timeoutInMinutes: 240 + continueOnError: false + steps: + - template: .azure-pipelines/run-test-scheduler-template.yml + parameters: + TOPOLOGY: t1-lag + MIN_WORKER: $(T1_LAG_INSTANCE_NUM) + MAX_WORKER: $(T1_LAG_INSTANCE_NUM) + MGMT_BRANCH: 202012 + + - job: dualtor_elastictest + pool: ubuntu-20.04 + displayName: "kvmtest-dualtor-t0 by Elastictest" + timeoutInMinutes: 240 + continueOnError: false + steps: + - template: .azure-pipelines/run-test-scheduler-template.yml + parameters: + TOPOLOGY: dualtor + MIN_WORKER: $(T0_DUALTOR_INSTANCE_NUM) + MAX_WORKER: $(T0_DUALTOR_INSTANCE_NUM) + COMMON_EXTRA_PARAMS: "--disable_loganalyzer " + MGMT_BRANCH: 202012 diff --git a/build_debian.sh b/build_debian.sh index c642e5d8cfb2..1dfa04615a53 100755 --- a/build_debian.sh +++ b/build_debian.sh @@ -32,7 +32,7 @@ CONFIGURED_ARCH=$([ -f .arch ] && cat .arch || echo amd64) ## docker engine version (with platform) DOCKER_VERSION=5:18.09.8~3-0~debian-$IMAGE_DISTRO -LINUX_KERNEL_VERSION=4.19.0-9-2 +LINUX_KERNEL_VERSION=4.19.0-12-2 ## Working directory to prepare the file system FILESYSTEM_ROOT=./fsroot @@ -67,6 +67,9 @@ mkdir -p $FILESYSTEM_ROOT/$PLATFORM_DIR mkdir -p $FILESYSTEM_ROOT/$PLATFORM_DIR/x86_64-grub touch $FILESYSTEM_ROOT/$PLATFORM_DIR/firsttime +## ensure proc is mounted +sudo mount proc /proc -t proc || true + ## make / as a mountpoint in chroot env, needed by dockerd pushd $FILESYSTEM_ROOT sudo mount --bind . . @@ -79,6 +82,8 @@ TARGET_PATH=$TARGET_PATH scripts/build_debian_base_system.sh $CONFIGURED_ARCH $I # Prepare buildinfo sudo scripts/prepare_debian_image_buildinfo.sh $CONFIGURED_ARCH $IMAGE_DISTRO $FILESYSTEM_ROOT $http_proxy +sudo chown root:root $FILESYSTEM_ROOT + ## Config hostname and hosts, otherwise 'sudo ...' will complain 'sudo: unable to resolve host ...' sudo LANG=C chroot $FILESYSTEM_ROOT /bin/bash -c "echo '$HOSTNAME' > /etc/hostname" sudo LANG=C chroot $FILESYSTEM_ROOT /bin/bash -c "echo '127.0.0.1 $HOSTNAME' >> /etc/hosts" @@ -102,6 +107,7 @@ sudo LANG=C chroot $FILESYSTEM_ROOT mount [ -d $TRUSTED_GPG_DIR ] && [ ! -z "$(ls $TRUSTED_GPG_DIR)" ] && sudo cp $TRUSTED_GPG_DIR/* ${FILESYSTEM_ROOT}/etc/apt/trusted.gpg.d/ ## Pointing apt to public apt mirrors and getting latest packages, needed for latest security updates +scripts/build_mirror_config.sh files/apt $CONFIGURED_ARCH $IMAGE_DISTRO sudo cp files/apt/sources.list.$CONFIGURED_ARCH $FILESYSTEM_ROOT/etc/apt/sources.list sudo cp files/apt/apt.conf.d/{81norecommends,apt-{clean,gzip-indexes,no-languages},no-check-valid-until} $FILESYSTEM_ROOT/etc/apt/apt.conf.d/ @@ -109,7 +115,7 @@ sudo cp files/apt/apt.conf.d/{81norecommends,apt-{clean,gzip-indexes,no-language sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y update sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y upgrade echo '[INFO] Install packages for building image' -sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y install makedev psmisc systemd-sysv +sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y install makedev psmisc ## Create device files echo '[INFO] MAKEDEV' @@ -187,6 +193,9 @@ if [ -f platform/$CONFIGURED_PLATFORM/modules ]; then cat platform/$CONFIGURED_PLATFORM/modules | sudo tee -a $FILESYSTEM_ROOT/etc/initramfs-tools/modules > /dev/null fi +## Add mtd and uboot firmware tools package +sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y install u-boot-tools mtd-utils device-tree-compiler + ## Install docker echo '[INFO] Install docker' ## Install apparmor utils since they're missing and apparmor is enabled in the kernel @@ -230,7 +239,6 @@ then sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y install kubelet=${KUBERNETES_VERSION}-00 sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y install kubectl=${KUBERNETES_VERSION}-00 sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y install kubeadm=${KUBERNETES_VERSION}-00 - # kubeadm package auto install kubelet & kubectl else echo '[INFO] Skipping Install kubernetes' fi @@ -242,15 +250,16 @@ sudo cp files/docker/docker.service.conf $_ ## Fix systemd race between docker and containerd sudo sed -i '/After=/s/$/ containerd.service/' $FILESYSTEM_ROOT/lib/systemd/system/docker.service -## Create redis group -sudo LANG=C chroot $FILESYSTEM_ROOT groupadd -f redis - ## Create default user ## Note: user should be in the group with the same name, and also in sudo/docker/redis groups -sudo LANG=C chroot $FILESYSTEM_ROOT useradd -G sudo,docker,redis $USERNAME -c "$DEFAULT_USERINFO" -m -s /bin/bash +sudo LANG=C chroot $FILESYSTEM_ROOT useradd -G sudo,docker $USERNAME -c "$DEFAULT_USERINFO" -m -s /bin/bash ## Create password for the default user echo "$USERNAME:$PASSWORD" | sudo LANG=C chroot $FILESYSTEM_ROOT chpasswd +## Create redis group +sudo LANG=C chroot $FILESYSTEM_ROOT groupadd -f redis +sudo LANG=C chroot $FILESYSTEM_ROOT usermod -aG redis $USERNAME + if [[ $CONFIGURED_ARCH == amd64 ]]; then ## Pre-install hardware drivers sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y install \ @@ -275,7 +284,6 @@ sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y in ntpstat \ openssh-server \ python \ - python-jsonschema \ python-apt \ traceroute \ iputils-ping \ @@ -298,10 +306,8 @@ sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y in squashfs-tools \ grub2-common \ rsyslog \ - ethtool \ screen \ hping3 \ - python-scapy \ tcptraceroute \ mtr-tiny \ locales \ @@ -316,7 +322,11 @@ sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y in python3-pip \ cron \ haveged \ - jq + jq \ + auditd + +# Change auditd log file path to fix auditd can't startup issue. +sudo LANG=C chroot $FILESYSTEM_ROOT /bin/bash -c "sudo sed -i 's/^\s*log_file\s*=.*/log_file = \/var\/log\/audit.log/g' /etc/audit/auditd.conf" if [[ $CONFIGURED_ARCH == amd64 ]]; then ## Pre-install the fundamental packages for amd64 (x86) @@ -348,7 +358,9 @@ sudo LANG=C chroot $FILESYSTEM_ROOT bash -c "find /usr/share/i18n/locales/ ! -na # Install certain fundamental packages from $IMAGE_DISTRO-backports in order to get # more up-to-date (but potentially less stable) versions sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y -t $IMAGE_DISTRO-backports install \ - picocom + picocom \ + systemd \ + systemd-sysv if [[ $CONFIGURED_ARCH == amd64 ]]; then sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y download \ @@ -363,7 +375,8 @@ sudo sed -i 's/LOAD_KEXEC=true/LOAD_KEXEC=false/' $FILESYSTEM_ROOT/etc/default/k ## Remove sshd host keys, and will regenerate on first sshd start sudo rm -f $FILESYSTEM_ROOT/etc/ssh/ssh_host_*_key* sudo cp files/sshd/host-ssh-keygen.sh $FILESYSTEM_ROOT/usr/local/bin/ -sudo cp -f files/sshd/sshd.service $FILESYSTEM_ROOT/lib/systemd/system/ssh.service +sudo mkdir $FILESYSTEM_ROOT/etc/systemd/system/ssh.service.d +sudo cp files/sshd/override.conf $FILESYSTEM_ROOT/etc/systemd/system/ssh.service.d/override.conf # Config sshd # 1. Set 'UseDNS' to 'no' # 2. Configure sshd to close all SSH connetions after 15 minutes of inactivity @@ -385,9 +398,9 @@ set /files/etc/ssh/sshd_config/#comment[following-sibling::*[1][self::ClientAliv save quit EOF -# Configure sshd to listen for v4 connections; disable listening for v6 connections -sudo sed -i 's/^ListenAddress ::/#ListenAddress ::/' $FILESYSTEM_ROOT/etc/ssh/sshd_config +# Configure sshd to listen for v4 and v6 connections sudo sed -i 's/^#ListenAddress 0.0.0.0/ListenAddress 0.0.0.0/' $FILESYSTEM_ROOT/etc/ssh/sshd_config +sudo sed -i 's/^#ListenAddress ::/ListenAddress ::/' $FILESYSTEM_ROOT/etc/ssh/sshd_config ## Config rsyslog sudo augtool -r $FILESYSTEM_ROOT --autosave " @@ -418,7 +431,7 @@ done < files/image_config/sysctl/sysctl-net.conf sudo augtool --autosave "$sysctl_net_cmd_string" -r $FILESYSTEM_ROOT # Upgrade pip via PyPI and uninstall the Debian version -sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip2 install --upgrade pip +sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip2 install --upgrade 'pip<21' sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install --upgrade pip sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get purge -y python-pip python3-pip @@ -429,7 +442,13 @@ sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install 'setup sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install 'wheel==0.35.1' # docker Python API package is needed by Ansible docker module as well as some SONiC applications -sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install 'docker==4.3.1' +sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install 'docker==6.1.1' + +# Install scapy +sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install 'scapy==2.4.4' + +# The option --no-build-isolation can be removed when upgrading PyYAML to 6.0.1 +sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install 'PyYAML==5.4.1' --no-build-isolation ## Note: keep pip installed for maintainance purpose @@ -464,12 +483,17 @@ fi ## Version file sudo mkdir -p $FILESYSTEM_ROOT/etc/sonic +if [ -f files/image_config/sonic_release ]; then + sudo cp files/image_config/sonic_release $FILESYSTEM_ROOT/etc/sonic/ +fi sudo tee $FILESYSTEM_ROOT/etc/sonic/sonic_version.yml > /dev/null < self.port_end: + return False + + present_path = self.BASE_CPLD_PATH + "module_present_" + str(port_num) + self.__port_to_is_present = present_path + + try: + val_file = open(self.__port_to_is_present) + content = val_file.readline().rstrip() + val_file.close() + except IOError as e: + print ('Error: unable to access file: %s') % str(e) + return False + + if content == "1": + return True + + return False + + def get_low_power_mode(self, port_num): + # Check for invalid port_num + if port_num < self.QSFP_START or port_num > self.port_end: + return False + + try: + eeprom = None + if not self.get_presence(port_num): + return False + eeprom = open(self.port_to_eeprom_mapping[port_num], "rb") + eeprom.seek(93) + lpmode = ord(eeprom.read(1)) + + # if "Power override" bit is 1 and "Power set" bit is 1 + if ((lpmode & 0x3) == 0x3): + return True + + # High Power Mode if one of the following conditions is matched: + # 1. "Power override" bit is 0 + # 2. "Power override" bit is 1 and "Power set" bit is 0 + else: + return False + + except IOError as e: + print ('Error: unable to open file: %s') % str(e) + return False + finally: + if eeprom is not None: + eeprom.close() + time.sleep(0.01) + + def set_low_power_mode(self, port_num, lpmode): + # Check for invalid port_num + if port_num < self.QSFP_START or port_num > self.port_end: + return False + + try: + eeprom = None + if not self.get_presence(port_num): + return False # Port is not present, unable to set the eeprom + + # Fill in write buffer + # 0x3:Low Power Mode, 0x1:High Power Mode + regval = 0x3 if lpmode else 0x1 + + buffer = create_string_buffer(1) + if sys.version_info[0] >= 3: + buffer[0] = regval + else: + buffer[0] = chr(regval) + + # Write to eeprom + eeprom = open(self.port_to_eeprom_mapping[port_num], "r+b") + eeprom.seek(93) + eeprom.write(buffer[0]) + return True + except IOError as e: + print ('Error: unable to open file: %s') % str(e) + return False + finally: + if eeprom is not None: + eeprom.close() + time.sleep(0.01) + + def reset(self, port_num): + raise NotImplementedError + + @property + def _get_presence_bitmap(self): + + bits = [] + for x in range(self.port_start, self.port_end + 1): + bits.append(str(int(self.get_presence(x)))) + + rev = "".join(bits[::-1]) + return int(rev, 2) + + data = {'present': 0} + + def get_transceiver_change_event(self, timeout=0): + port_dict = {} + + if timeout == 0: + cd_ms = sys.maxsize + else: + cd_ms = timeout + + # poll per second + while cd_ms > 0: + reg_value = self._get_presence_bitmap + changed_ports = self.data['present'] ^ reg_value + if changed_ports != 0: + break + time.sleep(1) + cd_ms = cd_ms - 1000 + + if changed_ports != 0: + for port in range(self.port_start, self.port_end + 1): + # Mask off the bit corresponding to our port + mask = (1 << (port - self.port_start)) + if changed_ports & mask: + if (reg_value & mask) == 0: + port_dict[port] = SFP_STATUS_REMOVED + else: + port_dict[port] = SFP_STATUS_INSERTED + + # Update cache + self.data['present'] = reg_value + return True, port_dict + else: + return True, {} diff --git a/device/accton/x86_64-accton_as4630_54te-r0/pmon_daemon_control.json b/device/accton/x86_64-accton_as4630_54te-r0/pmon_daemon_control.json new file mode 100644 index 000000000000..584a14b9d942 --- /dev/null +++ b/device/accton/x86_64-accton_as4630_54te-r0/pmon_daemon_control.json @@ -0,0 +1,5 @@ +{ + "skip_ledd": true, + "skip_thermalctld": true +} + diff --git a/device/accton/x86_64-accton_as4630_54te-r0/sensors.conf b/device/accton/x86_64-accton_as4630_54te-r0/sensors.conf new file mode 100644 index 000000000000..b22fff04d027 --- /dev/null +++ b/device/accton/x86_64-accton_as4630_54te-r0/sensors.conf @@ -0,0 +1,40 @@ +# libsensors configuration file for as4630-54te +# ------------------------------------------------ +# + +bus "i2c-3" "i2c-1-mux (chan_id 1)" +bus "i2c-10" "i2c-2-mux (chan_id 0)" +bus "i2c-11" "i2c-2-mux (chan_id 1)" +bus "i2c-14" "i2c-2-mux (chan_id 4)" +bus "i2c-24" "i2c-3-mux (chan_id 6)" +bus "i2c-25" "i2c-3-mux (chan_id 7)" + + +chip "ype1200am-i2c-*-58" + label in3 "PSU 1 Voltage" + label fan1 "PSU 1 Fan" + label temp1 "PSU 1 Temperature" + label power2 "PSU 1 Power" + label curr2 "PSU 1 Current" + +chip "ype1200am-i2c-*-59" + label in3 "PSU 2 Voltage" + label fan1 "PSU 2 Fan" + label temp1 "PSU 2 Temperature" + label power2 "PSU 2 Power" + label curr2 "PSU 2 Current" + +chip "as4630_54te_cpld-*" + label fan1 "Fan 1" + label fan2 "Fan 2" + label fan3 "Fan 3" + + +chip "lm77-i2c-*-48" + label temp1 "Main Board Temperature" + +chip "lm75-i2c-*-4a" + label temp1 "Fan Board Temperature" + +chip "lm75-i2c-*-4b" + label temp1 "CPU Board Temperature" diff --git a/device/accton/x86_64-accton_as4630_54te-r0/sonic_platform/__init__.py b/device/accton/x86_64-accton_as4630_54te-r0/sonic_platform/__init__.py new file mode 100644 index 000000000000..a18a2a2d2a3b --- /dev/null +++ b/device/accton/x86_64-accton_as4630_54te-r0/sonic_platform/__init__.py @@ -0,0 +1,2 @@ +__all__ = ['chassis', 'eeprom', 'platform', 'psu', 'sfp', 'thermal', 'fan'] +from . import platform diff --git a/device/accton/x86_64-accton_as4630_54te-r0/sonic_platform/chassis.py b/device/accton/x86_64-accton_as4630_54te-r0/sonic_platform/chassis.py new file mode 100644 index 000000000000..d666e0c5bf86 --- /dev/null +++ b/device/accton/x86_64-accton_as4630_54te-r0/sonic_platform/chassis.py @@ -0,0 +1,194 @@ +############################################################################# +# Edgecore +# +# Module contains an implementation of SONiC Platform Base API and +# provides the Chassis information which are available in the platform +# +############################################################################# + +import os + +try: + from sonic_platform_base.chassis_base import ChassisBase + from .helper import APIHelper +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +NUM_FAN_TRAY = 3 +NUM_FAN = 2 +NUM_PSU = 2 +NUM_THERMAL = 3 +NUM_QSFP = 6 +PORT_START = 49 +PORT_END = 54 +NUM_COMPONENT = 2 +HOST_REBOOT_CAUSE_PATH = "/host/reboot-cause/" +PMON_REBOOT_CAUSE_PATH = "/usr/share/sonic/platform/api_files/reboot-cause/" +REBOOT_CAUSE_FILE = "reboot-cause.txt" +PREV_REBOOT_CAUSE_FILE = "previous-reboot-cause.txt" +HOST_CHK_CMD = "docker > /dev/null 2>&1" + + +class Chassis(ChassisBase): + """Platform-specific Chassis class""" + + def __init__(self): + ChassisBase.__init__(self) + self._api_helper = APIHelper() + self._api_helper = APIHelper() + self.is_host = self._api_helper.is_host() + + self.config_data = {} + + self.__initialize_fan() + self.__initialize_psu() + self.__initialize_thermals() + self.__initialize_components() + self.__initialize_sfp() + self.__initialize_eeprom() + + def __initialize_sfp(self): + from sonic_platform.sfp import Sfp + for index in range(0, PORT_END): + sfp = Sfp(index) + self._sfp_list.append(sfp) + self.sfp_module_initialized = True + + def __initialize_fan(self): + from sonic_platform.fan import Fan + for fant_index in range(0, NUM_FAN_TRAY): + for fan_index in range(0, NUM_FAN): + fan = Fan(fant_index, fan_index) + self._fan_list.append(fan) + + def __initialize_psu(self): + from sonic_platform.psu import Psu + for index in range(0, NUM_PSU): + psu = Psu(index) + self._psu_list.append(psu) + + def __initialize_thermals(self): + from sonic_platform.thermal import Thermal + for index in range(0, NUM_THERMAL): + thermal = Thermal(index) + self._thermal_list.append(thermal) + + def __initialize_eeprom(self): + from sonic_platform.eeprom import Tlv + self._eeprom = Tlv() + + def __initialize_components(self): + from sonic_platform.component import Component + for index in range(0, NUM_COMPONENT): + component = Component(index) + self._component_list.append(component) + + def __initialize_watchdog(self): + from sonic_platform.watchdog import Watchdog + self._watchdog = Watchdog() + + + def __is_host(self): + return os.system(HOST_CHK_CMD) == 0 + + def __read_txt_file(self, file_path): + try: + with open(file_path, 'r') as fd: + data = fd.read() + return data.strip() + except IOError: + pass + return None + + def get_name(self): + """ + Retrieves the name of the device + Returns: + string: The name of the device + """ + + return self._api_helper.hwsku + + def get_presence(self): + """ + Retrieves the presence of the Chassis + Returns: + bool: True if Chassis is present, False if not + """ + return True + + def get_status(self): + """ + Retrieves the operational status of the device + Returns: + A boolean value, True if device is operating properly, False if not + """ + return True + + def get_base_mac(self): + """ + Retrieves the base MAC address for the chassis + Returns: + A string containing the MAC address in the format + 'XX:XX:XX:XX:XX:XX' + """ + return self._eeprom.get_mac() + + def get_serial_number(self): + """ + Retrieves the hardware serial number for the chassis + Returns: + A string containing the hardware serial number for this chassis. + """ + return self._eeprom.get_serial() + + def get_system_eeprom_info(self): + """ + Retrieves the full content of system EEPROM information for the chassis + Returns: + A dictionary where keys are the type code defined in + OCP ONIE TlvInfo EEPROM format and values are their corresponding + values. + """ + return self._eeprom.get_eeprom() + + def get_reboot_cause(self): + """ + Retrieves the cause of the previous reboot + Returns: + A tuple (string, string) where the first element is a string + containing the cause of the previous reboot. This string must be + one of the predefined strings in this class. If the first string + is "REBOOT_CAUSE_HARDWARE_OTHER", the second string can be used + to pass a description of the reboot cause. + """ + + reboot_cause_path = (HOST_REBOOT_CAUSE_PATH + REBOOT_CAUSE_FILE) + sw_reboot_cause = self._api_helper.read_txt_file( + reboot_cause_path) or "Unknown" + + + return ('REBOOT_CAUSE_NON_HARDWARE', sw_reboot_cause) + + def get_sfp(self, index): + """ + Retrieves sfp represented by (1-based) index + Args: + index: An integer, the index (1-based) of the sfp to retrieve. + The index should be the sequence of a physical port in a chassis, + starting from 1. + For example, 1 for Ethernet0, 2 for Ethernet4 and so on. + Returns: + An object dervied from SfpBase representing the specified sfp + """ + sfp = None + if not self.sfp_module_initialized: + self.__initialize_sfp() + + try: + # The index will start from 1 + sfp = self._sfp_list[index-1] + except IndexError: + sys.stderr.write("SFP index {} out of range (1-{})\n".format( + index, len(self._sfp_list))) + return sfp diff --git a/device/accton/x86_64-accton_as4630_54te-r0/sonic_platform/component.py b/device/accton/x86_64-accton_as4630_54te-r0/sonic_platform/component.py new file mode 100644 index 000000000000..c34da704432a --- /dev/null +++ b/device/accton/x86_64-accton_as4630_54te-r0/sonic_platform/component.py @@ -0,0 +1,121 @@ +############################################################################# +# Accton +# +# Component contains an implementation of SONiC Platform Base API and +# provides the components firmware management function +# +############################################################################# + +import shlex +import subprocess + + +try: + from sonic_platform_base.component_base import ComponentBase + from .helper import APIHelper +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +CPLD_ADDR_MAPPING = { + "CPLD1": "3-0060" +} +SYSFS_PATH = "/sys/bus/i2c/devices/" +BIOS_VERSION_PATH = "/sys/class/dmi/id/bios_version" +COMPONENT_LIST= [ + ("CPLD1", "CPLD 1"), + ("BIOS", "Basic Input/Output System") + +] + +class Component(ComponentBase): + """Platform-specific Component class""" + + DEVICE_TYPE = "component" + + def __init__(self, component_index=0): + self._api_helper=APIHelper() + ComponentBase.__init__(self) + self.index = component_index + self.name = self.get_name() + + def __run_command(self, command): + # Run bash command and print output to stdout + try: + process = subprocess.Popen( + shlex.split(command), stdout=subprocess.PIPE) + while True: + output = process.stdout.readline() + if output == '' and process.poll() is not None: + break + rc = process.poll() + if rc != 0: + return False + except Exception: + return False + return True + + def __get_bios_version(self): + # Retrieves the BIOS firmware version + try: + with open(BIOS_VERSION_PATH, 'r') as fd: + bios_version = fd.read() + return bios_version.strip() + except Exception as e: + return None + + def __get_cpld_version(self): + # Retrieves the CPLD firmware version + cpld_version = dict() + for cpld_name in CPLD_ADDR_MAPPING: + try: + cpld_path = "{}{}{}".format(SYSFS_PATH, CPLD_ADDR_MAPPING[cpld_name], '/version') + cpld_version_raw= self._api_helper.read_txt_file(cpld_path) + cpld_version[cpld_name] = "{}".format(int(cpld_version_raw,16)) + except Exception as e: + print('Get exception when read cpld') + cpld_version[cpld_name] = 'None' + + return cpld_version + + def get_name(self): + """ + Retrieves the name of the component + Returns: + A string containing the name of the component + """ + return COMPONENT_LIST[self.index][0] + + def get_description(self): + """ + Retrieves the description of the component + Returns: + A string containing the description of the component + """ + return COMPONENT_LIST[self.index][1] + + + def get_firmware_version(self): + """ + Retrieves the firmware version of module + Returns: + string: The firmware versions of the module + """ + fw_version = None + + if self.name == "BIOS": + fw_version = self.__get_bios_version() + elif "CPLD" in self.name: + cpld_version = self.__get_cpld_version() + fw_version = cpld_version.get(self.name) + + return fw_version + + def install_firmware(self, image_path): + """ + Install firmware to module + Args: + image_path: A string, path to firmware image + Returns: + A boolean, True if install successfully, False if not + """ + raise NotImplementedError diff --git a/device/accton/x86_64-accton_as4630_54te-r0/sonic_platform/eeprom.py b/device/accton/x86_64-accton_as4630_54te-r0/sonic_platform/eeprom.py new file mode 100644 index 000000000000..7bf2bb58d19f --- /dev/null +++ b/device/accton/x86_64-accton_as4630_54te-r0/sonic_platform/eeprom.py @@ -0,0 +1,102 @@ +try: + import os + import sys + import re + if sys.version_info[0] >= 3: + from io import StringIO + else: + from cStringIO import StringIO + + from sonic_platform_base.sonic_eeprom import eeprom_tlvinfo +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +CACHE_ROOT = '/var/cache/sonic/decode-syseeprom' +CACHE_FILE = 'syseeprom_cache' + + +class Tlv(eeprom_tlvinfo.TlvInfoDecoder): + + EEPROM_DECODE_HEADLINES = 6 + + def __init__(self): + self._eeprom_path = "/sys/bus/i2c/devices/1-0057/eeprom" + super(Tlv, self).__init__(self._eeprom_path, 0, '', True) + self._eeprom = self._load_eeprom() + + def __parse_output(self, decode_output): + decode_output.replace('\0', '') + lines = decode_output.split('\n') + lines = lines[self.EEPROM_DECODE_HEADLINES:] + _eeprom_info_dict = dict() + + for line in lines: + try: + match = re.search( + '(0x[0-9a-fA-F]{2})([\s]+[\S]+[\s]+)([\S]+)', line) + if match is not None: + idx = match.group(1) + value = match.group(3).rstrip('\0') + + _eeprom_info_dict[idx] = value + except Exception: + pass + + return _eeprom_info_dict + + def _load_eeprom(self): + original_stdout = sys.stdout + sys.stdout = StringIO() + try: + self.read_eeprom_db() + except Exception: + decode_output = sys.stdout.getvalue() + sys.stdout = original_stdout + return self.__parse_output(decode_output) + + status = self.check_status() + if 'ok' not in status: + return False + + if not os.path.exists(CACHE_ROOT): + try: + os.makedirs(CACHE_ROOT) + except Exception: + pass + + # + # only the eeprom classes that inherit from eeprom_base + # support caching. Others will work normally + # + try: + self.set_cache_name(os.path.join(CACHE_ROOT, CACHE_FILE)) + except Exception: + pass + + e = self.read_eeprom() + if e is None: + return 0 + + try: + self.update_cache(e) + except Exception: + pass + + self.decode_eeprom(e) + decode_output = sys.stdout.getvalue() + sys.stdout = original_stdout + + (is_valid, valid_crc) = self.is_checksum_valid(e) + if not is_valid: + return False + + return self.__parse_output(decode_output) + + def get_eeprom(self): + return self._eeprom + + def get_serial(self): + return self._eeprom.get('0x23', "Undefined.") + + def get_mac(self): + return self._eeprom.get('0x24', "Undefined.") diff --git a/device/accton/x86_64-accton_as4630_54te-r0/sonic_platform/fan.py b/device/accton/x86_64-accton_as4630_54te-r0/sonic_platform/fan.py new file mode 100644 index 000000000000..663c343a75f6 --- /dev/null +++ b/device/accton/x86_64-accton_as4630_54te-r0/sonic_platform/fan.py @@ -0,0 +1,171 @@ +############################################################################# +# Edgecore +# +# Module contains an implementation of SONiC Platform Base API and +# provides the fan status which are available in the platform +# +############################################################################# + +try: + from sonic_platform_base.fan_base import FanBase + from .helper import APIHelper +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +PSU_FAN_MAX_RPM = 26688 + +CPLD_I2C_PATH = "/sys/bus/i2c/devices/3-0060/fan_" +PSU_HWMON_I2C_PATH ="/sys/bus/i2c/devices/{}-00{}/" +PSU_I2C_MAPPING = { + 0: { + "num": 10, + "addr": "58" + }, + 1: { + "num": 11, + "addr": "59" + }, +} + + +class Fan(FanBase): + """Platform-specific Fan class""" + + def __init__(self, fan_tray_index, fan_index=0, is_psu_fan=False, psu_index=0): + self._api_helper=APIHelper() + self.fan_index = fan_index + self.fan_tray_index = fan_tray_index + self.is_psu_fan = is_psu_fan + + if self.is_psu_fan: + self.psu_index = psu_index + self.psu_i2c_num = PSU_I2C_MAPPING[self.psu_index]['num'] + self.psu_i2c_addr = PSU_I2C_MAPPING[self.psu_index]['addr'] + self.psu_hwmon_path = PSU_HWMON_I2C_PATH.format( + self.psu_i2c_num, self.psu_i2c_addr) + + FanBase.__init__(self) + + + def get_direction(self): + """ + Retrieves the direction of fan + Returns: + A string, either FAN_DIRECTION_INTAKE or FAN_DIRECTION_EXHAUST + depending on fan direction + """ + + + if not self.is_psu_fan: + dir_str = "{}{}{}".format(CPLD_I2C_PATH, 'direction_', self.fan_tray_index) + val=self._api_helper.read_txt_file(dir_str) + if val is not None: + if val==0:#F2B + direction=self.FAN_DIRECTION_EXHAUST + else: + direction=self.FAN_DIRECTION_INTAKE + else: + direction=self.FAN_DIRECTION_EXHAUST + + else: #For PSU + dir_str = "{}{}".format(self.psu_hwmon_path,'psu_fan_dir') + val=self._api_helper.read_txt_file(dir_str) + if val is not None: + if val=='F2B': + direction=self.FAN_DIRECTION_EXHAUST + else: + direction=self.FAN_DIRECTION_INTAKE + else: + direction=self.FAN_DIRECTION_EXHAUST + + return direction + + def get_speed(self): + """ + Retrieves the speed of fan as a percentage of full speed + Returns: + An integer, the percentage of full fan speed, in the range 0 (off) + to 100 (full speed) + + """ + speed = 0 + if self.is_psu_fan: + psu_fan_path= "{}{}".format(self.psu_hwmon_path, 'psu_fan1_speed_rpm') + fan_speed_rpm = self._api_helper.read_txt_file(psu_fan_path) + if fan_speed_rpm is not None: + speed = (int(fan_speed_rpm,10))*100/26688 + if speed > 100: + speed=100 + else: + return 0 + elif self.get_presence(): + speed_path = "{}{}".format(CPLD_I2C_PATH, 'duty_cycle_percentage') + speed=self._api_helper.read_txt_file(speed_path) + if speed is None: + return 0 + return int(speed) + + def get_target_speed(self): + """ + Retrieves the target (expected) speed of the fan + Returns: + An integer, the percentage of full fan speed, in the range 0 (off) + to 100 (full speed) + Note: + speed_pc = pwm_target/255*100 + 0 : when PWM mode is use + pwm : when pwm mode is not use + """ + return False #Not supported + + def get_speed_tolerance(self): + """ + Retrieves the speed tolerance of the fan + Returns: + An integer, the percentage of variance from target speed which is + considered tolerable + """ + return False #Not supported + + def set_speed(self, speed): + """ + Sets the fan speed + Args: + speed: An integer, the percentage of full fan speed to set fan to, + in the range 0 (off) to 100 (full speed) + Returns: + A boolean, True if speed is set successfully, False if not + """ + + if not self.is_psu_fan and self.get_presence(): + speed_path = "{}{}".format(CPLD_I2C_PATH, 'duty_cycle_percentage') + return self._api_helper.write_txt_file(speed_path, int(speed)) + + return False + + def set_status_led(self, color): + """ + Sets the state of the fan module status LED + Args: + color: A string representing the color with which to set the + fan module status LED + Returns: + bool: True if status LED state is set successfully, False if not + """ + return False #Not supported + + def get_presence(self): + """ + Retrieves the presence of the FAN + Returns: + bool: True if FAN is present, False if not + """ + present_path = "{}{}{}".format(CPLD_I2C_PATH, 'present_', self.fan_index+1) + val=self._api_helper.read_txt_file(present_path) + if not self.is_psu_fan: + if val is not None: + return int(val, 10)==1 + else: + return False + else: + return True diff --git a/device/accton/x86_64-accton_as4630_54te-r0/sonic_platform/helper.py b/device/accton/x86_64-accton_as4630_54te-r0/sonic_platform/helper.py new file mode 100644 index 000000000000..4cd60ac90611 --- /dev/null +++ b/device/accton/x86_64-accton_as4630_54te-r0/sonic_platform/helper.py @@ -0,0 +1,117 @@ +import os +import struct +import subprocess +from mmap import * +from sonic_py_common import device_info + +HOST_CHK_CMD = "docker > /dev/null 2>&1" +EMPTY_STRING = "" + + +class APIHelper(): + + def __init__(self): + (self.platform, self.hwsku) = device_info.get_platform_and_hwsku() + + def is_host(self): + return os.system(HOST_CHK_CMD) == 0 + + def pci_get_value(self, resource, offset): + status = True + result = "" + try: + fd = os.open(resource, os.O_RDWR) + mm = mmap(fd, 0) + mm.seek(int(offset)) + read_data_stream = mm.read(4) + result = struct.unpack('I', read_data_stream) + except Exception: + status = False + return status, result + + def run_command(self, cmd): + status = True + result = "" + try: + p = subprocess.Popen( + cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + raw_data, err = p.communicate() + if err == '': + result = raw_data.strip() + except Exception: + status = False + return status, result + + def run_interactive_command(self, cmd): + try: + os.system(cmd) + except Exception: + return False + return True + + def read_txt_file(self, file_path): + try: + with open(file_path, 'r') as fd: + data = fd.read() + return data.strip() + except IOError: + pass + return None + + def write_txt_file(self, file_path, value): + try: + with open(file_path, 'w') as fd: + fd.write(str(value)) + except IOError: + return False + return True + + def ipmi_raw(self, netfn, cmd): + status = True + result = "" + try: + cmd = "ipmitool raw {} {}".format(str(netfn), str(cmd)) + p = subprocess.Popen( + cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + raw_data, err = p.communicate() + if err == '': + result = raw_data.strip() + else: + status = False + except Exception: + status = False + return status, result + + def ipmi_fru_id(self, id, key=None): + status = True + result = "" + try: + cmd = "ipmitool fru print {}".format(str( + id)) if not key else "ipmitool fru print {0} | grep '{1}' ".format(str(id), str(key)) + + p = subprocess.Popen( + cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + raw_data, err = p.communicate() + if err == '': + result = raw_data.strip() + else: + status = False + except Exception: + status = False + return status, result + + def ipmi_set_ss_thres(self, id, threshold_key, value): + status = True + result = "" + try: + cmd = "ipmitool sensor thresh '{}' {} {}".format(str(id), str(threshold_key), str(value)) + p = subprocess.Popen( + cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + raw_data, err = p.communicate() + if err == '': + result = raw_data.strip() + else: + status = False + except Exception: + status = False + return status, result diff --git a/device/accton/x86_64-accton_as4630_54te-r0/sonic_platform/platform.py b/device/accton/x86_64-accton_as4630_54te-r0/sonic_platform/platform.py new file mode 100644 index 000000000000..2f2c2a447fcf --- /dev/null +++ b/device/accton/x86_64-accton_as4630_54te-r0/sonic_platform/platform.py @@ -0,0 +1,21 @@ +############################################################################# +# Edgecore +# +# Module contains an implementation of SONiC Platform Base API and +# provides the platform information +# +############################################################################# + +try: + from sonic_platform_base.platform_base import PlatformBase + from sonic_platform.chassis import Chassis +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class Platform(PlatformBase): + """Platform-specific Platform class""" + + def __init__(self): + PlatformBase.__init__(self) + self._chassis = Chassis() diff --git a/device/accton/x86_64-accton_as4630_54te-r0/sonic_platform/psu.py b/device/accton/x86_64-accton_as4630_54te-r0/sonic_platform/psu.py new file mode 100644 index 000000000000..3413ab5779cc --- /dev/null +++ b/device/accton/x86_64-accton_as4630_54te-r0/sonic_platform/psu.py @@ -0,0 +1,228 @@ +############################################################################# +# Edgecore +# +# Module contains an implementation of SONiC Platform Base API and +# provides the PSUs status which are available in the platform +# +############################################################################# + +#import sonic_platform + +try: + from sonic_platform_base.psu_base import PsuBase + #from sonic_platform.fan import Fan + from .helper import APIHelper +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +I2C_PATH ="/sys/bus/i2c/devices/{0}-00{1}/" + +PSU_NAME_LIST = ["PSU-1", "PSU-2"] +PSU_NUM_FAN = [1, 1] +PSU_HWMON_I2C_MAPPING = { + 0: { + "num": 10, + "addr": "58" + }, + 1: { + "num": 11, + "addr": "59" + }, +} + +PSU_CPLD_I2C_MAPPING = { + 0: { + "num": 10, + "addr": "50" + }, + 1: { + "num": 11, + "addr": "51" + }, +} + +class Psu(PsuBase): + """Platform-specific Psu class""" + + def __init__(self, psu_index=0): + PsuBase.__init__(self) + self.index = psu_index + self._api_helper = APIHelper() + + self.i2c_num = PSU_HWMON_I2C_MAPPING[self.index]["num"] + self.i2c_addr = PSU_HWMON_I2C_MAPPING[self.index]["addr"] + self.hwmon_path = I2C_PATH.format(self.i2c_num, self.i2c_addr) + + self.i2c_num = PSU_CPLD_I2C_MAPPING[self.index]["num"] + self.i2c_addr = PSU_CPLD_I2C_MAPPING[self.index]["addr"] + self.cpld_path = I2C_PATH.format(self.i2c_num, self.i2c_addr) + self.__initialize_fan() + ''' + for fan_index in range(0, PSU_NUM_FAN[self.index]): + #def __init__(self, fan_tray_index, fan_index=0, is_psu_fan=False, psu_index=0): + #fan = Fan(fan_index, 0, is_psu_fan=True, psu_index=self.index) + fan = Fan(fan_index, 0, True, self.index) + self._fan_list.append(fan) + ''' + + def __initialize_fan(self): + from sonic_platform.fan import Fan + for fan_index in range(0, PSU_NUM_FAN[self.index]): + fan = Fan(fan_index, 0, is_psu_fan=True, psu_index=self.index) + self._fan_list.append(fan) + + def get_voltage(self): + """ + Retrieves current PSU voltage output + Returns: + A float number, the output voltage in volts, + e.g. 12.1 + """ + vout_path = "{}{}".format(self.hwmon_path, 'psu_v_out') + vout_val=self._api_helper.read_txt_file(vout_path) + if vout_val is not None: + return float(vout_val)/ 1000 + else: + return 0 + + def get_current(self): + """ + Retrieves present electric current supplied by PSU + Returns: + A float number, the electric current in amperes, e.g 15.4 + """ + iout_path = "{}{}".format(self.hwmon_path, 'psu_i_out') + val=self._api_helper.read_txt_file(iout_path) + if val is not None: + return float(val)/1000 + else: + return 0 + + def get_power(self): + """ + Retrieves current energy supplied by PSU + Returns: + A float number, the power in watts, e.g. 302.6 + """ + pout_path = "{}{}".format(self.hwmon_path, 'psu_p_out') + val=self._api_helper.read_txt_file(pout_path) + if val is not None: + return float(val)/1000 + else: + return 0 + + def get_powergood_status(self): + """ + Retrieves the powergood status of PSU + Returns: + A boolean, True if PSU has stablized its output voltages and passed all + its internal self-tests, False if not. + """ + return self.get_status() + + def set_status_led(self, color): + """ + Sets the state of the PSU status LED + Args: + color: A string representing the color with which to set the PSU status LED + Note: Only support green and off + Returns: + bool: True if status LED state is set successfully, False if not + """ + + return False #Controlled by HW + + def get_status_led(self): + """ + Gets the state of the PSU status LED + Returns: + A string, one of the predefined STATUS_LED_COLOR_* strings above + """ + + return False #Controlled by HW + + def get_temperature(self): + """ + Retrieves current temperature reading from PSU + Returns: + A float number of current temperature in Celsius up to nearest thousandth + of one degree Celsius, e.g. 30.125 + """ + temp_path = "{}{}".format(self.hwmon_path, 'psu_temp1_input') + val=self._api_helper.read_txt_file(temp_path) + if val is not None: + return float(val)/1000 + else: + return 0 + + def get_temperature_high_threshold(self): + """ + Retrieves the high threshold temperature of PSU + Returns: + A float number, the high threshold temperature of PSU in Celsius + up to nearest thousandth of one degree Celsius, e.g. 30.125 + """ + return False #Not supported + + def get_voltage_high_threshold(self): + """ + Retrieves the high threshold PSU voltage output + Returns: + A float number, the high threshold output voltage in volts, + e.g. 12.1 + """ + vout_path = "{}{}".format(self.hwmon_path, 'psu_mfr_vout_max') + vout_val=self._api_helper.read_txt_file(vout_path) + if vout_val is not None: + return float(vout_val)/ 1000 + else: + return 0 + + def get_voltage_low_threshold(self): + """ + Retrieves the low threshold PSU voltage output + Returns: + A float number, the low threshold output voltage in volts, + e.g. 12.1 + """ + vout_path = "{}{}".format(self.hwmon_path, 'psu_mfr_vout_min') + vout_val=self._api_helper.read_txt_file(vout_path) + if vout_val is not None: + return float(vout_val)/ 1000 + else: + return 0 + + def get_name(self): + """ + Retrieves the name of the device + Returns: + string: The name of the device + """ + return PSU_NAME_LIST[self.index] + + def get_presence(self): + """ + Retrieves the presence of the PSU + Returns: + bool: True if PSU is present, False if not + """ + presence_path="{}{}".format(self.cpld_path, 'psu_present') + val=self._api_helper.read_txt_file(presence_path) + if val is not None: + return int(val, 10) == 1 + else: + return 0 + + def get_status(self): + """ + Retrieves the operational status of the device + Returns: + A boolean value, True if device is operating properly, False if not + """ + power_path="{}{}".format(self.cpld_path, 'psu_power_good') + val=self._api_helper.read_txt_file(power_path) + if val is not None: + return int(val, 10) == 1 + else: + return 0 diff --git a/device/accton/x86_64-accton_as4630_54te-r0/sonic_platform/sfp.py b/device/accton/x86_64-accton_as4630_54te-r0/sonic_platform/sfp.py new file mode 100644 index 000000000000..25e5bce8fe40 --- /dev/null +++ b/device/accton/x86_64-accton_as4630_54te-r0/sonic_platform/sfp.py @@ -0,0 +1,1169 @@ +#!/usr/bin/env python + +############################################################################# +# Edgecore +# +# Sfp contains an implementation of SONiC Platform Base API and +# provides the sfp device status which are available in the platform +# +############################################################################# + +import os +import time +import sys + +from ctypes import create_string_buffer + +try: + from sonic_platform_base.sfp_base import SfpBase + from sonic_platform_base.sonic_sfp.sff8436 import sff8436Dom + from sonic_platform_base.sonic_sfp.sff8436 import sff8436InterfaceId + from sonic_platform_base.sonic_sfp.sff8472 import sff8472Dom + from sonic_platform_base.sonic_sfp.sff8472 import sff8472InterfaceId + #from sonic_platform_base.sonic_sfp.sff8472 import sffbase + from sonic_platform_base.sonic_sfp.sfputilhelper import SfpUtilHelper + from .helper import APIHelper +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +CPLD_I2C_PATH = "/sys/bus/i2c/devices/3-0060/" + +QSFP_INFO_OFFSET = 128 +QSFP_DOM_OFFSET = 0 + +SFP_INFO_OFFSET = 0 +SFP_DOM_OFFSET = 256 + +XCVR_INTFACE_BULK_OFFSET = 0 +XCVR_INTFACE_BULK_WIDTH_QSFP = 20 +XCVR_INTFACE_BULK_WIDTH_SFP = 21 +XCVR_HW_REV_WIDTH_QSFP = 2 +XCVR_HW_REV_WIDTH_SFP = 4 +XCVR_CABLE_LENGTH_WIDTH_QSFP = 5 +XCVR_VENDOR_NAME_OFFSET = 20 +XCVR_VENDOR_NAME_WIDTH = 16 +XCVR_VENDOR_OUI_OFFSET = 37 +XCVR_VENDOR_OUI_WIDTH = 3 +XCVR_VENDOR_PN_OFFSET = 40 +XCVR_VENDOR_PN_WIDTH = 16 +XCVR_HW_REV_OFFSET = 56 +XCVR_HW_REV_WIDTH_OSFP = 2 +XCVR_HW_REV_WIDTH_SFP = 4 +XCVR_VENDOR_SN_OFFSET = 68 +XCVR_VENDOR_SN_WIDTH = 16 +XCVR_VENDOR_DATE_OFFSET = 84 +XCVR_VENDOR_DATE_WIDTH = 8 +XCVR_DOM_CAPABILITY_OFFSET = 92 +XCVR_DOM_CAPABILITY_WIDTH = 1 + +# Offset for values in QSFP eeprom +QSFP_DOM_REV_OFFSET = 1 +QSFP_DOM_REV_WIDTH = 1 +QSFP_TEMPE_OFFSET = 22 +QSFP_TEMPE_WIDTH = 2 +QSFP_VOLT_OFFSET = 26 +QSFP_VOLT_WIDTH = 2 +QSFP_CHANNL_MON_OFFSET = 34 +QSFP_CHANNL_MON_WIDTH = 16 +QSFP_CHANNL_MON_WITH_TX_POWER_WIDTH = 24 +QSFP_CONTROL_OFFSET = 86 +QSFP_CONTROL_WIDTH = 8 +QSFP_CHANNL_RX_LOS_STATUS_OFFSET = 3 +QSFP_CHANNL_RX_LOS_STATUS_WIDTH = 1 +QSFP_CHANNL_TX_FAULT_STATUS_OFFSET = 4 +QSFP_CHANNL_TX_FAULT_STATUS_WIDTH = 1 +QSFP_POWEROVERRIDE_OFFSET = 93 +QSFP_POWEROVERRIDE_WIDTH = 1 +QSFP_MODULE_THRESHOLD_OFFSET = 128 +QSFP_MODULE_THRESHOLD_WIDTH = 24 +QSFP_CHANNEL_THRESHOLD_OFFSET = 176 +QSFP_CHANNEL_THRESHOLD_WIDTH = 16 + +qsfp_cable_length_tup = ('Length(km)', 'Length OM3(2m)', + 'Length OM2(m)', 'Length OM1(m)', + 'Length Cable Assembly(m)') + +qsfp_compliance_code_tup = ('10/40G Ethernet Compliance Code', 'SONET Compliance codes', + 'SAS/SATA compliance codes', 'Gigabit Ethernet Compliant codes', + 'Fibre Channel link length/Transmitter Technology', + 'Fibre Channel transmission media', 'Fibre Channel Speed') + + +# Offset for values in SFP eeprom +SFP_TEMPE_OFFSET = 96 +SFP_TEMPE_WIDTH = 2 +SFP_VOLT_OFFSET = 98 +SFP_VOLT_WIDTH = 2 +SFP_CHANNL_MON_OFFSET = 100 +SFP_CHANNL_MON_WIDTH = 6 +SFP_MODULE_THRESHOLD_OFFSET = 0 +SFP_MODULE_THRESHOLD_WIDTH = 40 +SFP_CHANNL_THRESHOLD_OFFSET = 112 +SFP_CHANNL_THRESHOLD_WIDTH = 2 +SFP_STATUS_CONTROL_OFFSET = 110 +SFP_STATUS_CONTROL_WIDTH = 1 +SFP_TX_DISABLE_HARD_BIT = 7 +SFP_TX_DISABLE_SOFT_BIT = 6 + +sfp_cable_length_tup = ('LengthSMFkm-UnitsOfKm', 'LengthSMF(UnitsOf100m)', + 'Length50um(UnitsOf10m)', 'Length62.5um(UnitsOfm)', + 'LengthCable(UnitsOfm)', 'LengthOM3(UnitsOf10m)') + +sfp_compliance_code_tup = ('10GEthernetComplianceCode', 'InfinibandComplianceCode', + 'ESCONComplianceCodes', 'SONETComplianceCodes', + 'EthernetComplianceCodes', 'FibreChannelLinkLength', + 'FibreChannelTechnology', 'SFP+CableTechnology', + 'FibreChannelTransmissionMedia', 'FibreChannelSpeed') + + +class Sfp(SfpBase): + """Platform-specific Sfp class""" + + # Port number + PORT_START = 49 + PORT_END = 54 + + # Path to sysfs + PLATFORM_ROOT_PATH = "/usr/share/sonic/device" + PMON_HWSKU_PATH = "/usr/share/sonic/hwsku" + HOST_CHK_CMD = "docker > /dev/null 2>&1" + + PLATFORM = "x86_64-accton_as4630_54te-r0" + HWSKU = "Accton-AS4630-54TE" + + _port_to_i2c_mapping = { + 49: 18, + 50: 19, + 51: 20, + 52: 21, + 53: 22, + 54: 23, + } + + def __init__(self, sfp_index=0): + self._api_helper=APIHelper() + # Init index + self.index = sfp_index + self.port_num = self.index + 1 + # Init eeprom path + eeprom_path = '/sys/bus/i2c/devices/{0}-0050/eeprom' + self.port_to_eeprom_mapping = {} + for x in range(self.PORT_START, self.PORT_END + 1): + self.port_to_eeprom_mapping[x] = eeprom_path.format(self._port_to_i2c_mapping[x]) + + self.info_dict_keys = ['type', 'hardware_rev', 'serial', 'manufacturer', 'model', 'connector', 'encoding', 'ext_identifier', + 'ext_rateselect_compliance', 'cable_type', 'cable_length', 'nominal_bit_rate', 'specification_compliance', 'vendor_date', 'vendor_oui'] + + self.dom_dict_keys = ['rx_los', 'tx_fault', 'reset_status', 'power_lpmode', 'tx_disable', 'tx_disable_channel', 'temperature', 'voltage', + 'rx1power', 'rx2power', 'rx3power', 'rx4power', 'tx1bias', 'tx2bias', 'tx3bias', 'tx4bias', 'tx1power', 'tx2power', 'tx3power', 'tx4power'] + + self.threshold_dict_keys = ['temphighalarm', 'temphighwarning', 'templowalarm', 'templowwarning', 'vcchighalarm', 'vcchighwarning', 'vcclowalarm', 'vcclowwarning', 'rxpowerhighalarm', 'rxpowerhighwarning', + 'rxpowerlowalarm', 'rxpowerlowwarning', 'txpowerhighalarm', 'txpowerhighwarning', 'txpowerlowalarm', 'txpowerlowwarning', 'txbiashighalarm', 'txbiashighwarning', 'txbiaslowalarm', 'txbiaslowwarning'] + + SfpBase.__init__(self) + + def _convert_string_to_num(self, value_str): + if "-inf" in value_str: + return 'N/A' + elif "Unknown" in value_str: + return 'N/A' + elif 'dBm' in value_str: + t_str = value_str.rstrip('dBm') + return float(t_str) + elif 'mA' in value_str: + t_str = value_str.rstrip('mA') + return float(t_str) + elif 'C' in value_str: + t_str = value_str.rstrip('C') + return float(t_str) + elif 'Volts' in value_str: + t_str = value_str.rstrip('Volts') + return float(t_str) + else: + return 'N/A' + + def __write_txt_file(self, file_path, value): + try: + with open(file_path, 'w', buffering=0) as fd: + fd.write(str(value)) + except Exception: + return False + return True + + def __is_host(self): + return os.system(self.HOST_CHK_CMD) == 0 + + def __get_path_to_port_config_file(self): + platform_path = "/".join([self.PLATFORM_ROOT_PATH, self.PLATFORM]) + hwsku_path = "/".join([platform_path, self.HWSKU] + ) if self.__is_host() else self.PMON_HWSKU_PATH + return "/".join([hwsku_path, "port_config.ini"]) + + def __read_eeprom_specific_bytes(self, offset, num_bytes): + sysfsfile_eeprom = None + eeprom_raw = [] + for i in range(0, num_bytes): + eeprom_raw.append("0x00") + + sysfs_sfp_i2c_client_eeprom_path = self.port_to_eeprom_mapping[self.port_num] + try: + sysfsfile_eeprom = open( + sysfs_sfp_i2c_client_eeprom_path, mode="rb", buffering=0) + sysfsfile_eeprom.seek(offset) + raw = sysfsfile_eeprom.read(num_bytes) + if sys.version_info[0] >= 3: + for n in range(0, num_bytes): + eeprom_raw[n] = hex(raw[n])[2:].zfill(2) + else: + for n in range(0, num_bytes): + eeprom_raw[n] = hex(ord(raw[n]))[2:].zfill(2) + except Exception: + pass + finally: + if sysfsfile_eeprom: + sysfsfile_eeprom.close() + + return eeprom_raw + + def get_transceiver_info(self): + """ + Retrieves transceiver info of this SFP + Returns: + A dict which contains following keys/values : + ======================================================================== + keys |Value Format |Information + ---------------------------|---------------|---------------------------- + type |1*255VCHAR |type of SFP + hardware_rev |1*255VCHAR |hardware version of SFP + serial |1*255VCHAR |serial number of the SFP + manufacturer |1*255VCHAR |SFP vendor name + model |1*255VCHAR |SFP model name + connector |1*255VCHAR |connector information + encoding |1*255VCHAR |encoding information + ext_identifier |1*255VCHAR |extend identifier + ext_rateselect_compliance |1*255VCHAR |extended rateSelect compliance + cable_length |INT |cable length in m + nominal_bit_rate |INT |nominal bit rate by 100Mbs + specification_compliance |1*255VCHAR |specification compliance + vendor_date |1*255VCHAR |vendor date + vendor_oui |1*255VCHAR |vendor OUI + ======================================================================== + """ + # check present status + if self.port_num < 49: + return {} + elif self.port_num < 53: + sfpi_obj = sff8472InterfaceId() #SFP + else: + sfpi_obj = sff8436InterfaceId() #QSFP + if not self.get_presence() or not sfpi_obj: + return {} + + if self.port_num < 53: + offset = SFP_INFO_OFFSET + sfp_interface_bulk_raw = self.__read_eeprom_specific_bytes( + (offset + XCVR_INTFACE_BULK_OFFSET), XCVR_INTFACE_BULK_WIDTH_SFP) + else: + offset = QSFP_INFO_OFFSET + sfp_interface_bulk_raw = self.__read_eeprom_specific_bytes( + (offset + XCVR_INTFACE_BULK_OFFSET), XCVR_INTFACE_BULK_WIDTH_QSFP) + + sfp_interface_bulk_data = sfpi_obj.parse_sfp_info_bulk( + sfp_interface_bulk_raw, 0) + + sfp_vendor_name_raw = self.__read_eeprom_specific_bytes( + (offset + XCVR_VENDOR_NAME_OFFSET), XCVR_VENDOR_NAME_WIDTH) + sfp_vendor_name_data = sfpi_obj.parse_vendor_name( + sfp_vendor_name_raw, 0) + + sfp_vendor_pn_raw = self.__read_eeprom_specific_bytes( + (offset + XCVR_VENDOR_PN_OFFSET), XCVR_VENDOR_PN_WIDTH) + sfp_vendor_pn_data = sfpi_obj.parse_vendor_pn( + sfp_vendor_pn_raw, 0) + + if self.port_num < 53: + sfp_vendor_rev_raw = self.__read_eeprom_specific_bytes( + (offset + XCVR_HW_REV_OFFSET), XCVR_HW_REV_WIDTH_SFP) + else: + sfp_vendor_rev_raw = self.__read_eeprom_specific_bytes( + (offset + XCVR_HW_REV_OFFSET), XCVR_HW_REV_WIDTH_QSFP) + + sfp_vendor_rev_data = sfpi_obj.parse_vendor_rev( + sfp_vendor_rev_raw, 0) + + sfp_vendor_sn_raw = self.__read_eeprom_specific_bytes( + (offset + XCVR_VENDOR_SN_OFFSET), XCVR_VENDOR_SN_WIDTH) + sfp_vendor_sn_data = sfpi_obj.parse_vendor_sn( + sfp_vendor_sn_raw, 0) + + sfp_vendor_oui_raw = self.__read_eeprom_specific_bytes( + (offset + XCVR_VENDOR_OUI_OFFSET), XCVR_VENDOR_OUI_WIDTH) + if sfp_vendor_oui_raw is not None: + sfp_vendor_oui_data = sfpi_obj.parse_vendor_oui( + sfp_vendor_oui_raw, 0) + + sfp_vendor_date_raw = self.__read_eeprom_specific_bytes( + (offset + XCVR_VENDOR_DATE_OFFSET), XCVR_VENDOR_DATE_WIDTH) + sfp_vendor_date_data = sfpi_obj.parse_vendor_date( + sfp_vendor_date_raw, 0) + + transceiver_info_dict = dict.fromkeys(self.info_dict_keys, 'N/A') + compliance_code_dict = dict() + + if sfp_interface_bulk_data: + transceiver_info_dict['type'] = sfp_interface_bulk_data['data']['type']['value'] + transceiver_info_dict['connector'] = sfp_interface_bulk_data['data']['Connector']['value'] + transceiver_info_dict['encoding'] = sfp_interface_bulk_data['data']['EncodingCodes']['value'] + transceiver_info_dict['ext_identifier'] = sfp_interface_bulk_data['data']['Extended Identifier']['value'] + transceiver_info_dict['ext_rateselect_compliance'] = sfp_interface_bulk_data['data']['RateIdentifier']['value'] + transceiver_info_dict['type_abbrv_name'] = sfp_interface_bulk_data['data']['type_abbrv_name']['value'] + + transceiver_info_dict['manufacturer'] = sfp_vendor_name_data[ + 'data']['Vendor Name']['value'] if sfp_vendor_name_data else 'N/A' + transceiver_info_dict['model'] = sfp_vendor_pn_data['data']['Vendor PN']['value'] if sfp_vendor_pn_data else 'N/A' + transceiver_info_dict['hardware_rev'] = sfp_vendor_rev_data['data']['Vendor Rev']['value'] if sfp_vendor_rev_data else 'N/A' + transceiver_info_dict['serial'] = sfp_vendor_sn_data['data']['Vendor SN']['value'] if sfp_vendor_sn_data else 'N/A' + transceiver_info_dict['vendor_oui'] = sfp_vendor_oui_data['data']['Vendor OUI']['value'] if sfp_vendor_oui_data else 'N/A' + transceiver_info_dict['vendor_date'] = sfp_vendor_date_data[ + 'data']['VendorDataCode(YYYY-MM-DD Lot)']['value'] if sfp_vendor_date_data else 'N/A' + transceiver_info_dict['cable_type'] = "Unknown" + transceiver_info_dict['cable_length'] = "Unknown" + + if self.port_num < 53: + for key in sfp_cable_length_tup: + if key in sfp_interface_bulk_data['data']: + transceiver_info_dict['cable_type'] = key + transceiver_info_dict['cable_length'] = str( + sfp_interface_bulk_data['data'][key]['value']) + + for key in sfp_compliance_code_tup: + if key in sfp_interface_bulk_data['data']['Specification compliance']['value']: + compliance_code_dict[key] = sfp_interface_bulk_data['data']['Specification compliance']['value'][key]['value'] + + transceiver_info_dict['specification_compliance'] = str( + compliance_code_dict) + transceiver_info_dict['nominal_bit_rate'] = str( + sfp_interface_bulk_data['data']['NominalSignallingRate(UnitsOf100Mbd)']['value']) + else: + for key in qsfp_cable_length_tup: + if key in sfp_interface_bulk_data['data']: + transceiver_info_dict['cable_type'] = key + transceiver_info_dict['cable_length'] = str( + sfp_interface_bulk_data['data'][key]['value']) + + for key in qsfp_compliance_code_tup: + if key in sfp_interface_bulk_data['data']['Specification compliance']['value']: + compliance_code_dict[key] = sfp_interface_bulk_data['data']['Specification compliance']['value'][key]['value'] + + transceiver_info_dict['specification_compliance'] = str( + compliance_code_dict) + transceiver_info_dict['nominal_bit_rate'] = str( + sfp_interface_bulk_data['data']['Nominal Bit Rate(100Mbs)']['value']) + + + return transceiver_info_dict + + def get_transceiver_bulk_status(self): + """ + Retrieves transceiver bulk status of this SFP + Returns: + A dict which contains following keys/values : + ======================================================================== + keys |Value Format |Information + ---------------------------|---------------|---------------------------- + rx_los |BOOLEAN |RX loss-of-signal status, True if has RX los, False if not. + tx_fault |BOOLEAN |TX fault status, True if has TX fault, False if not. + reset_status |BOOLEAN |reset status, True if SFP in reset, False if not. + lp_mode |BOOLEAN |low power mode status, True in lp mode, False if not. + tx_disable |BOOLEAN |TX disable status, True TX disabled, False if not. + tx_disabled_channel |HEX |disabled TX channels in hex, bits 0 to 3 represent channel 0 + | |to channel 3. + temperature |INT |module temperature in Celsius + voltage |INT |supply voltage in mV + txbias |INT |TX Bias Current in mA, n is the channel number, + | |for example, tx2bias stands for tx bias of channel 2. + rxpower |INT |received optical power in mW, n is the channel number, + | |for example, rx2power stands for rx power of channel 2. + txpower |INT |TX output power in mW, n is the channel number, + | |for example, tx2power stands for tx power of channel 2. + ======================================================================== + """ + # check present status + if self.port_num < 53: #SFP case + sfpd_obj = sff8472Dom() + if not self.get_presence() or not sfpd_obj: + return {} + + eeprom_ifraw = self.__read_eeprom_specific_bytes(0, SFP_DOM_OFFSET) + sfpi_obj = sff8472InterfaceId(eeprom_ifraw) + cal_type = sfpi_obj.get_calibration_type() + sfpd_obj._calibration_type = cal_type + + offset = SFP_DOM_OFFSET + transceiver_dom_info_dict = dict.fromkeys(self.dom_dict_keys, 'N/A') + dom_temperature_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_TEMPE_OFFSET), SFP_TEMPE_WIDTH) + + if dom_temperature_raw is not None: + dom_temperature_data = sfpd_obj.parse_temperature( + dom_temperature_raw, 0) + transceiver_dom_info_dict['temperature'] = dom_temperature_data['data']['Temperature']['value'] + + dom_voltage_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_VOLT_OFFSET), SFP_VOLT_WIDTH) + if dom_voltage_raw is not None: + dom_voltage_data = sfpd_obj.parse_voltage(dom_voltage_raw, 0) + transceiver_dom_info_dict['voltage'] = dom_voltage_data['data']['Vcc']['value'] + + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_CHANNL_MON_OFFSET), SFP_CHANNL_MON_WIDTH) + if dom_channel_monitor_raw is not None: + dom_voltage_data = sfpd_obj.parse_channel_monitor_params( + dom_channel_monitor_raw, 0) + transceiver_dom_info_dict['tx1power'] = dom_voltage_data['data']['TXPower']['value'] + transceiver_dom_info_dict['rx1power'] = dom_voltage_data['data']['RXPower']['value'] + transceiver_dom_info_dict['tx1bias'] = dom_voltage_data['data']['TXBias']['value'] + + else: #QSFP case + sfpd_obj = sff8436Dom() + sfpi_obj = sff8436InterfaceId() + + if not self.get_presence() or not sfpi_obj or not sfpd_obj: + return {} + + transceiver_dom_info_dict = dict.fromkeys(self.dom_dict_keys, 'N/A') + offset = QSFP_DOM_OFFSET + offset_xcvr = QSFP_INFO_OFFSET + + # QSFP capability byte parse, through this byte can know whether it support tx_power or not. + # TODO: in the future when decided to migrate to support SFF-8636 instead of SFF-8436, + # need to add more code for determining the capability and version compliance + # in SFF-8636 dom capability definitions evolving with the versions. + qsfp_dom_capability_raw = self.__read_eeprom_specific_bytes( + (offset_xcvr + XCVR_DOM_CAPABILITY_OFFSET), XCVR_DOM_CAPABILITY_WIDTH) + if qsfp_dom_capability_raw is not None: + qspf_dom_capability_data = sfpi_obj.parse_qsfp_dom_capability( + qsfp_dom_capability_raw, 0) + else: + return None + + dom_temperature_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_TEMPE_OFFSET), QSFP_TEMPE_WIDTH) + if dom_temperature_raw is not None: + dom_temperature_data = sfpd_obj.parse_temperature( + dom_temperature_raw, 0) + transceiver_dom_info_dict['temperature'] = dom_temperature_data['data']['Temperature']['value'] + + dom_voltage_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_VOLT_OFFSET), QSFP_VOLT_WIDTH) + if dom_voltage_raw is not None: + dom_voltage_data = sfpd_obj.parse_voltage(dom_voltage_raw, 0) + transceiver_dom_info_dict['voltage'] = dom_voltage_data['data']['Vcc']['value'] + + qsfp_dom_rev_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_DOM_REV_OFFSET), QSFP_DOM_REV_WIDTH) + if qsfp_dom_rev_raw is not None: + qsfp_dom_rev_data = sfpd_obj.parse_sfp_dom_rev(qsfp_dom_rev_raw, 0) + qsfp_dom_rev = qsfp_dom_rev_data['data']['dom_rev']['value'] + + # The tx_power monitoring is only available on QSFP which compliant with SFF-8636 + # and claimed that it support tx_power with one indicator bit. + dom_channel_monitor_data = {} + dom_channel_monitor_raw = None + qsfp_tx_power_support = qspf_dom_capability_data['data']['Tx_power_support']['value'] + if (qsfp_dom_rev[0:8] != 'SFF-8636' or (qsfp_dom_rev[0:8] == 'SFF-8636' and qsfp_tx_power_support != 'on')): + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_CHANNL_MON_OFFSET), QSFP_CHANNL_MON_WIDTH) + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = sfpd_obj.parse_channel_monitor_params( + dom_channel_monitor_raw, 0) + + else: + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_CHANNL_MON_OFFSET), QSFP_CHANNL_MON_WITH_TX_POWER_WIDTH) + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = sfpd_obj.parse_channel_monitor_params_with_tx_power( + dom_channel_monitor_raw, 0) + transceiver_dom_info_dict['tx1power'] = dom_channel_monitor_data['data']['TX1Power']['value'] + transceiver_dom_info_dict['tx2power'] = dom_channel_monitor_data['data']['TX2Power']['value'] + transceiver_dom_info_dict['tx3power'] = dom_channel_monitor_data['data']['TX3Power']['value'] + transceiver_dom_info_dict['tx4power'] = dom_channel_monitor_data['data']['TX4Power']['value'] + + if dom_channel_monitor_raw: + transceiver_dom_info_dict['rx1power'] = dom_channel_monitor_data['data']['RX1Power']['value'] + transceiver_dom_info_dict['rx2power'] = dom_channel_monitor_data['data']['RX2Power']['value'] + transceiver_dom_info_dict['rx3power'] = dom_channel_monitor_data['data']['RX3Power']['value'] + transceiver_dom_info_dict['rx4power'] = dom_channel_monitor_data['data']['RX4Power']['value'] + transceiver_dom_info_dict['tx1bias'] = dom_channel_monitor_data['data']['TX1Bias']['value'] + transceiver_dom_info_dict['tx2bias'] = dom_channel_monitor_data['data']['TX2Bias']['value'] + transceiver_dom_info_dict['tx3bias'] = dom_channel_monitor_data['data']['TX3Bias']['value'] + transceiver_dom_info_dict['tx4bias'] = dom_channel_monitor_data['data']['TX4Bias']['value'] + #End of else + + + for key in transceiver_dom_info_dict: + transceiver_dom_info_dict[key] = self._convert_string_to_num( + transceiver_dom_info_dict[key]) + + transceiver_dom_info_dict['rx_los'] = self.get_rx_los() + transceiver_dom_info_dict['tx_fault'] = self.get_tx_fault() + transceiver_dom_info_dict['reset_status'] = self.get_reset_status() + transceiver_dom_info_dict['lp_mode'] = self.get_lpmode() + + return transceiver_dom_info_dict + + def get_transceiver_threshold_info(self): + """ + Retrieves transceiver threshold info of this SFP + Returns: + A dict which contains following keys/values : + ======================================================================== + keys |Value Format |Information + ---------------------------|---------------|---------------------------- + temphighalarm |FLOAT |High Alarm Threshold value of temperature in Celsius. + templowalarm |FLOAT |Low Alarm Threshold value of temperature in Celsius. + temphighwarning |FLOAT |High Warning Threshold value of temperature in Celsius. + templowwarning |FLOAT |Low Warning Threshold value of temperature in Celsius. + vcchighalarm |FLOAT |High Alarm Threshold value of supply voltage in mV. + vcclowalarm |FLOAT |Low Alarm Threshold value of supply voltage in mV. + vcchighwarning |FLOAT |High Warning Threshold value of supply voltage in mV. + vcclowwarning |FLOAT |Low Warning Threshold value of supply voltage in mV. + rxpowerhighalarm |FLOAT |High Alarm Threshold value of received power in dBm. + rxpowerlowalarm |FLOAT |Low Alarm Threshold value of received power in dBm. + rxpowerhighwarning |FLOAT |High Warning Threshold value of received power in dBm. + rxpowerlowwarning |FLOAT |Low Warning Threshold value of received power in dBm. + txpowerhighalarm |FLOAT |High Alarm Threshold value of transmit power in dBm. + txpowerlowalarm |FLOAT |Low Alarm Threshold value of transmit power in dBm. + txpowerhighwarning |FLOAT |High Warning Threshold value of transmit power in dBm. + txpowerlowwarning |FLOAT |Low Warning Threshold value of transmit power in dBm. + txbiashighalarm |FLOAT |High Alarm Threshold value of tx Bias Current in mA. + txbiaslowalarm |FLOAT |Low Alarm Threshold value of tx Bias Current in mA. + txbiashighwarning |FLOAT |High Warning Threshold value of tx Bias Current in mA. + txbiaslowwarning |FLOAT |Low Warning Threshold value of tx Bias Current in mA. + ======================================================================== + """ + # check present status + if self.port_num < 53: + sfpd_obj = sff8472Dom() + + if not self.get_presence() and not sfpd_obj: + return {} + + eeprom_ifraw = self.__read_eeprom_specific_bytes(0, SFP_DOM_OFFSET) + sfpi_obj = sff8472InterfaceId(eeprom_ifraw) + cal_type = sfpi_obj.get_calibration_type() + sfpd_obj._calibration_type = cal_type + + offset = SFP_DOM_OFFSET + transceiver_dom_threshold_info_dict = dict.fromkeys( + self.threshold_dict_keys, 'N/A') + dom_module_threshold_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_MODULE_THRESHOLD_OFFSET), SFP_MODULE_THRESHOLD_WIDTH) + if dom_module_threshold_raw is not None: + dom_module_threshold_data = sfpd_obj.parse_alarm_warning_threshold( + dom_module_threshold_raw, 0) + + transceiver_dom_threshold_info_dict['temphighalarm'] = dom_module_threshold_data['data']['TempHighAlarm']['value'] + transceiver_dom_threshold_info_dict['templowalarm'] = dom_module_threshold_data['data']['TempLowAlarm']['value'] + transceiver_dom_threshold_info_dict['temphighwarning'] = dom_module_threshold_data['data']['TempHighWarning']['value'] + transceiver_dom_threshold_info_dict['templowwarning'] = dom_module_threshold_data['data']['TempLowWarning']['value'] + transceiver_dom_threshold_info_dict['vcchighalarm'] = dom_module_threshold_data['data']['VoltageHighAlarm']['value'] + transceiver_dom_threshold_info_dict['vcclowalarm'] = dom_module_threshold_data['data']['VoltageLowAlarm']['value'] + transceiver_dom_threshold_info_dict['vcchighwarning'] = dom_module_threshold_data[ + 'data']['VoltageHighWarning']['value'] + transceiver_dom_threshold_info_dict['vcclowwarning'] = dom_module_threshold_data['data']['VoltageLowWarning']['value'] + transceiver_dom_threshold_info_dict['txbiashighalarm'] = dom_module_threshold_data['data']['BiasHighAlarm']['value'] + transceiver_dom_threshold_info_dict['txbiaslowalarm'] = dom_module_threshold_data['data']['BiasLowAlarm']['value'] + transceiver_dom_threshold_info_dict['txbiashighwarning'] = dom_module_threshold_data['data']['BiasHighWarning']['value'] + transceiver_dom_threshold_info_dict['txbiaslowwarning'] = dom_module_threshold_data['data']['BiasLowWarning']['value'] + transceiver_dom_threshold_info_dict['txpowerhighalarm'] = dom_module_threshold_data['data']['TXPowerHighAlarm']['value'] + transceiver_dom_threshold_info_dict['txpowerlowalarm'] = dom_module_threshold_data['data']['TXPowerLowAlarm']['value'] + transceiver_dom_threshold_info_dict['txpowerhighwarning'] = dom_module_threshold_data['data']['TXPowerHighWarning']['value'] + transceiver_dom_threshold_info_dict['txpowerlowwarning'] = dom_module_threshold_data['data']['TXPowerLowWarning']['value'] + transceiver_dom_threshold_info_dict['rxpowerhighalarm'] = dom_module_threshold_data['data']['RXPowerHighAlarm']['value'] + transceiver_dom_threshold_info_dict['rxpowerlowalarm'] = dom_module_threshold_data['data']['RXPowerLowAlarm']['value'] + transceiver_dom_threshold_info_dict['rxpowerhighwarning'] = dom_module_threshold_data['data']['RXPowerHighWarning']['value'] + transceiver_dom_threshold_info_dict['rxpowerlowwarning'] = dom_module_threshold_data['data']['RXPowerLowWarning']['value'] + + for key in transceiver_dom_threshold_info_dict: + transceiver_dom_threshold_info_dict[key] = self._convert_string_to_num( + transceiver_dom_threshold_info_dict[key]) + + return transceiver_dom_threshold_info_dict + + + else: + sfpd_obj = sff8436Dom() + + if not self.get_presence() or not sfpd_obj: + return {} + + transceiver_dom_threshold_dict = dict.fromkeys( + self.threshold_dict_keys, 'N/A') + dom_thres_raw = self.__read_eeprom_specific_bytes( + QSFP_MODULE_THRESHOLD_OFFSET, QSFP_MODULE_THRESHOLD_WIDTH) if self.get_presence() and sfpd_obj else None + + if dom_thres_raw: + module_threshold_values = sfpd_obj.parse_module_threshold_values( + dom_thres_raw, 0) + module_threshold_data = module_threshold_values.get('data') + if module_threshold_data: + transceiver_dom_threshold_dict['temphighalarm'] = module_threshold_data['TempHighAlarm']['value'] + transceiver_dom_threshold_dict['templowalarm'] = module_threshold_data['TempLowAlarm']['value'] + transceiver_dom_threshold_dict['temphighwarning'] = module_threshold_data['TempHighWarning']['value'] + transceiver_dom_threshold_dict['templowwarning'] = module_threshold_data['TempLowWarning']['value'] + transceiver_dom_threshold_dict['vcchighalarm'] = module_threshold_data['VccHighAlarm']['value'] + transceiver_dom_threshold_dict['vcclowalarm'] = module_threshold_data['VccLowAlarm']['value'] + transceiver_dom_threshold_dict['vcchighwarning'] = module_threshold_data['VccHighWarning']['value'] + transceiver_dom_threshold_dict['vcclowwarning'] = module_threshold_data['VccLowWarning']['value'] + + dom_thres_raw = self.__read_eeprom_specific_bytes( + QSFP_CHANNEL_THRESHOLD_OFFSET, QSFP_CHANNEL_THRESHOLD_WIDTH) if self.get_presence() and sfpd_obj else None + channel_threshold_values = sfpd_obj.parse_channel_threshold_values( + dom_thres_raw, 0) + channel_threshold_data = channel_threshold_values.get('data') + if channel_threshold_data: + transceiver_dom_threshold_dict['rxpowerhighalarm'] = channel_threshold_data['RxPowerHighAlarm']['value'] + transceiver_dom_threshold_dict['rxpowerlowalarm'] = channel_threshold_data['RxPowerLowAlarm']['value'] + transceiver_dom_threshold_dict['rxpowerhighwarning'] = channel_threshold_data['RxPowerHighWarning']['value'] + transceiver_dom_threshold_dict['rxpowerlowwarning'] = channel_threshold_data['RxPowerLowWarning']['value'] + transceiver_dom_threshold_dict['txpowerhighalarm'] = "0.0dBm" + transceiver_dom_threshold_dict['txpowerlowalarm'] = "0.0dBm" + transceiver_dom_threshold_dict['txpowerhighwarning'] = "0.0dBm" + transceiver_dom_threshold_dict['txpowerlowwarning'] = "0.0dBm" + transceiver_dom_threshold_dict['txbiashighalarm'] = channel_threshold_data['TxBiasHighAlarm']['value'] + transceiver_dom_threshold_dict['txbiaslowalarm'] = channel_threshold_data['TxBiasLowAlarm']['value'] + transceiver_dom_threshold_dict['txbiashighwarning'] = channel_threshold_data['TxBiasHighWarning']['value'] + transceiver_dom_threshold_dict['txbiaslowwarning'] = channel_threshold_data['TxBiasLowWarning']['value'] + + for key in transceiver_dom_threshold_dict: + transceiver_dom_threshold_dict[key] = self._convert_string_to_num( + transceiver_dom_threshold_dict[key]) + + return transceiver_dom_threshold_dict + + def get_reset_status(self): + """ + Retrieves the reset status of SFP + Returns: + A Boolean, True if reset enabled, False if disabled + """ + if self.port_num < 49: #Copper port, no sysfs + return False + + return False # CPLD port doesn't support this feature + + + def get_rx_los(self): + """ + Retrieves the RX LOS (lost-of-signal) status of SFP + Returns: + A Boolean, True if SFP has RX LOS, False if not. + Note : RX LOS status is latched until a call to get_rx_los or a reset. + """ + rx_los = False + + if self.port_num < 49: #Copper port, no sysfs + return False + + if self.port_num < 53: + rx_path = "{}{}{}".format(CPLD_I2C_PATH, '/module_rx_los_', self.port_num) + rx_los=self._api_helper.read_txt_file(rx_path) + if rx_los is None: + return False + #status_control_raw = self.__read_eeprom_specific_bytes( + # SFP_STATUS_CONTROL_OFFSET, SFP_STATUS_CONTROL_WIDTH) + #if status_control_raw: + # data = int(status_control_raw[0], 16) + # rx_los = (sffbase().test_bit(data, 1) != 0) + + else: + rx_los_list = [] + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + QSFP_CHANNL_RX_LOS_STATUS_OFFSET, QSFP_CHANNL_RX_LOS_STATUS_WIDTH) if self.get_presence() else None + if dom_channel_monitor_raw is not None: + rx_los_data = int(dom_channel_monitor_raw[0], 16) + rx_los_list.append(rx_los_data & 0x01 != 0) + rx_los_list.append(rx_los_data & 0x02 != 0) + rx_los_list.append(rx_los_data & 0x04 != 0) + rx_los_list.append(rx_los_data & 0x08 != 0) + rx_los = rx_los_list[0] and rx_los_list[1] and rx_los_list[2] and rx_los_list[3] + return rx_los + + def get_tx_fault(self): + """ + Retrieves the TX fault status of SFP + Returns: + A Boolean, True if SFP has TX fault, False if not + Note : TX fault status is lached until a call to get_tx_fault or a reset. + """ + tx_fault = False + if self.port_num < 49: #Copper port, no sysfs + return False + + if self.port_num < 53: + tx_path = "{}{}{}".format(CPLD_I2C_PATH, '/module_tx_fault_', self.port_num) + tx_fault=self._api_helper.read_txt_file(tx_path) + if tx_fault is None: + return False + #status_control_raw = self.__read_eeprom_specific_bytes( + # SFP_STATUS_CONTROL_OFFSET, SFP_STATUS_CONTROL_WIDTH) + #if status_control_raw: + # data = int(status_control_raw[0], 16) + # tx_fault = (sffbase().test_bit(data, 2) != 0) + else: + tx_fault_list = [] + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + QSFP_CHANNL_TX_FAULT_STATUS_OFFSET, QSFP_CHANNL_TX_FAULT_STATUS_WIDTH) if self.get_presence() else None + if dom_channel_monitor_raw is not None: + tx_fault_data = int(dom_channel_monitor_raw[0], 16) + tx_fault_list.append(tx_fault_data & 0x01 != 0) + tx_fault_list.append(tx_fault_data & 0x02 != 0) + tx_fault_list.append(tx_fault_data & 0x04 != 0) + tx_fault_list.append(tx_fault_data & 0x08 != 0) + tx_fault = tx_fault_list[0] and tx_fault_list[1] and tx_fault_list[2] and tx_fault_list[3] + + return tx_fault + + def get_tx_disable(self): + """ + Retrieves the tx_disable status of this SFP + Returns: + A Boolean, True if tx_disable is enabled, False if disabled + """ + if self.port_num < 49: #Copper port, no sysfs + return False + + if self.port_num < 53: + tx_disable = False + + tx_path = "{}{}{}".format(CPLD_I2C_PATH, '/module_tx_disable_', self.port_num) + tx_disable=self._api_helper.read_txt_file(tx_path) + + + #status_control_raw = self.__read_eeprom_specific_bytes( + # SFP_STATUS_CONTROL_OFFSET, SFP_STATUS_CONTROL_WIDTH) + #if status_control_raw: + # data = int(status_control_raw[0], 16) + # tx_disable_hard = (sffbase().test_bit( + # data, SFP_TX_DISABLE_HARD_BIT) != 0) + # tx_disable_soft = (sffbase().test_bit( + # data, SFP_TX_DISABLE_SOFT_BIT) != 0) + # tx_disable = tx_disable_hard | tx_disable_soft + if tx_disable is not None: + return tx_disable + else: + return False + + else: + tx_disable_list = [] + + sfpd_obj = sff8436Dom() + if sfpd_obj is None: + return False + + dom_control_raw = self.__read_eeprom_specific_bytes( + QSFP_CONTROL_OFFSET, QSFP_CONTROL_WIDTH) if self.get_presence() else None + if dom_control_raw is not None: + dom_control_data = sfpd_obj.parse_control_bytes(dom_control_raw, 0) + tx_disable_list.append( + 'On' == dom_control_data['data']['TX1Disable']['value']) + tx_disable_list.append( + 'On' == dom_control_data['data']['TX2Disable']['value']) + tx_disable_list.append( + 'On' == dom_control_data['data']['TX3Disable']['value']) + tx_disable_list.append( + 'On' == dom_control_data['data']['TX4Disable']['value']) + + return tx_disable_list + + def get_tx_disable_channel(self): + """ + Retrieves the TX disabled channels in this SFP + Returns: + A hex of 4 bits (bit 0 to bit 3 as channel 0 to channel 3) to represent + TX channels which have been disabled in this SFP. + As an example, a returned value of 0x5 indicates that channel 0 + and channel 2 have been disabled. + """ + if self.port_num < 53: + # SFP doesn't support this feature + return False + else: + tx_disable_list = self.get_tx_disable() + if tx_disable_list is None: + return 0 + tx_disabled = 0 + for i in range(len(tx_disable_list)): + if tx_disable_list[i]: + tx_disabled |= 1 << i + return tx_disabled + + def get_lpmode(self): + """ + Retrieves the lpmode (low power mode) status of this SFP + Returns: + A Boolean, True if lpmode is enabled, False if disabled + """ + if self.port_num < 53: + # SFP doesn't support this feature + return False + else: + power_set=self.get_power_set() + power_override = self.get_power_override() + return power_set and power_override + + + def get_power_set(self): + + if self.port_num < 53: + # SFP doesn't support this feature + return False + else: + power_set = False + + sfpd_obj = sff8436Dom() + if sfpd_obj is None: + return False + + dom_control_raw = self.__read_eeprom_specific_bytes( + QSFP_POWEROVERRIDE_OFFSET, QSFP_CONTROL_WIDTH) if self.get_presence() else None + if dom_control_raw is not None: + dom_control_data = sfpd_obj.parse_control_bytes(dom_control_raw, 0) + power_set = ( + 'On' == dom_control_data['data']['PowerSet']['value']) + + return power_set + + def get_power_override(self): + """ + Retrieves the power-override status of this SFP + Returns: + A Boolean, True if power-override is enabled, False if disabled + """ + if self.port_num < 53: + return False # SFP doesn't support this feature + else: + power_override = False + + + sfpd_obj = sff8436Dom() + if sfpd_obj is None: + return False + + dom_control_raw = self.__read_eeprom_specific_bytes( + QSFP_POWEROVERRIDE_OFFSET, QSFP_CONTROL_WIDTH) if self.get_presence() else None + if dom_control_raw is not None: + dom_control_data = sfpd_obj.parse_control_bytes(dom_control_raw, 0) + power_override = ( + 'On' == dom_control_data['data']['PowerOverride']['value']) + + return power_override + + def get_temperature(self): + """ + Retrieves the temperature of this SFP + Returns: + An integer number of current temperature in Celsius + """ + transceiver_dom_info_dict = self.get_transceiver_bulk_status() + return transceiver_dom_info_dict.get("temperature", "N/A") + + def get_voltage(self): + """ + Retrieves the supply voltage of this SFP + Returns: + An integer number of supply voltage in mV + """ + transceiver_dom_info_dict = self.get_transceiver_bulk_status() + return transceiver_dom_info_dict.get("voltage", "N/A") + + def get_tx_bias(self): + """ + Retrieves the TX bias current of this SFP + Returns: + A list of four integer numbers, representing TX bias in mA + for channel 0 to channel 4. + Ex. ['110.09', '111.12', '108.21', '112.09'] + """ + transceiver_dom_info_dict = self.get_transceiver_bulk_status() + + tx1_bs = transceiver_dom_info_dict.get("tx1bias", "N/A") + if self.port_num < 53: + return [tx1_bs, "N/A", "N/A", "N/A"] if transceiver_dom_info_dict else [] + + tx2_bs = transceiver_dom_info_dict.get("tx2bias", "N/A") + tx3_bs = transceiver_dom_info_dict.get("tx3bias", "N/A") + tx4_bs = transceiver_dom_info_dict.get("tx4bias", "N/A") + return [tx1_bs, tx2_bs, tx3_bs, tx4_bs] if transceiver_dom_info_dict else [] + + def get_rx_power(self): + """ + Retrieves the received optical power for this SFP + Returns: + A list of four integer numbers, representing received optical + power in mW for channel 0 to channel 4. + Ex. ['1.77', '1.71', '1.68', '1.70'] + """ + transceiver_dom_info_dict = self.get_transceiver_bulk_status() + + rx1_pw = transceiver_dom_info_dict.get("rx1power", "N/A") + if self.port_num < 53: + return [rx1_pw, "N/A", "N/A", "N/A"] if transceiver_dom_info_dict else [] + rx2_pw = transceiver_dom_info_dict.get("rx2power", "N/A") + rx3_pw = transceiver_dom_info_dict.get("rx3power", "N/A") + rx4_pw = transceiver_dom_info_dict.get("rx4power", "N/A") + return [rx1_pw, rx2_pw, rx3_pw, rx4_pw] if transceiver_dom_info_dict else [] + + def get_tx_power(self): + """ + Retrieves the TX power of this SFP + Returns: + A list of four integer numbers, representing TX power in mW + for channel 0 to channel 4. + Ex. ['1.86', '1.86', '1.86', '1.86'] + """ + transceiver_dom_info_dict = self.get_transceiver_bulk_status() + tx1_pw = transceiver_dom_info_dict.get("tx1power", "N/A") + if self.port_num < 53: + return [tx1_pw, "N/A", "N/A", "N/A"] if transceiver_dom_info_dict else [] + tx2_pw = transceiver_dom_info_dict.get("tx2power", "N/A") + tx3_pw = transceiver_dom_info_dict.get("tx3power", "N/A") + tx4_pw = transceiver_dom_info_dict.get("tx4power", "N/A") + return [tx1_pw, tx2_pw, tx3_pw, tx4_pw] + + def reset(self): + """ + Reset SFP and return all user module settings to their default srate. + Returns: + A boolean, True if successful, False if not + """ + # Check for invalid port_num + if self.port_num < 49: #Copper port, no sysfs + return False + + ''' + reset_path = "{}{}{}".format(CPLD_I2C_PATH, 'module_reset_', self.port_num) + ret = self.__write_txt_file(reset_path, 1) + if ret is not True: + return ret + + time.sleep(0.01) + ret = self.__write_txt_file(reset_path, 0) + time.sleep(0.2) + + return ret + ''' + + return False #CPLD doens't support this feature + + def tx_disable(self, tx_disable): + """ + Disable SFP TX for all channels + Args: + tx_disable : A Boolean, True to enable tx_disable mode, False to disable + tx_disable mode. + Returns: + A boolean, True if tx_disable is set successfully, False if not + """ + if self.port_num < 49: #Copper port, no sysfs + return False + + if self.port_num < 53: + tx_path = "{}{}{}".format(CPLD_I2C_PATH, '/module_tx_disable_', self.port_num) + ret = self.__write_txt_file(tx_path, 1 if tx_disable else 0) + if ret is not None: + time.sleep(0.01) + return ret + else: + return False + + else: + if not self.get_presence(): + return False + sysfsfile_eeprom = None + try: + tx_disable_ctl = 0xf if tx_disable else 0x0 + buffer = create_string_buffer(1) + if sys.version_info[0] >= 3: + buffer[0] = tx_disable_ctl + else: + buffer[0] = chr(tx_disable_ctl) + # Write to eeprom + sysfsfile_eeprom = open( + self.port_to_eeprom_mapping[self.port_num], "r+b") + sysfsfile_eeprom.seek(QSFP_CONTROL_OFFSET) + sysfsfile_eeprom.write(buffer[0]) + except IOError as e: + print ('Error: unable to open file: ',str(e)) + return False + finally: + if sysfsfile_eeprom is not None: + sysfsfile_eeprom.close() + time.sleep(0.01) + return True + + def tx_disable_channel(self, channel, disable): + """ + Sets the tx_disable for specified SFP channels + Args: + channel : A hex of 4 bits (bit 0 to bit 3) which represent channel 0 to 3, + e.g. 0x5 for channel 0 and channel 2. + disable : A boolean, True to disable TX channels specified in channel, + False to enable + Returns: + A boolean, True if successful, False if not + """ + + if self.port_num < 53: + return False # SFP doesn't support this feature + else: + if not self.get_presence(): + return False + + sysfsfile_eeprom = None + try: + channel_state = self.get_tx_disable_channel() + + for i in range(4): + channel_mask = (1 << i) + if not (channel & channel_mask): + continue + + if disable: + channel_state |= channel_mask + else: + channel_state &= ~channel_mask + + buffer = create_string_buffer(1) + if sys.version_info[0] >= 3: + buffer[0] = channel_state + else: + buffer[0] = chr(channel_state) + # Write to eeprom + sysfsfile_eeprom = open( + self.port_to_eeprom_mapping[self.port_num], "r+b") + sysfsfile_eeprom.seek(QSFP_CONTROL_OFFSET) + sysfsfile_eeprom.write(buffer[0]) + except IOError as e: + print ('Error: unable to open file: ', str(e)) + return False + finally: + if sysfsfile_eeprom is not None: + sysfsfile_eeprom.close() + time.sleep(0.01) + return True + + def set_lpmode(self, lpmode): + """ + Sets the lpmode (low power mode) of SFP + Args: + lpmode: A Boolean, True to enable lpmode, False to disable it + Note : lpmode can be overridden by set_power_override + Returns: + A boolean, True if lpmode is set successfully, False if not + """ + if self.port_num < 53: + return False # SFP doesn't support this feature + else: + if lpmode is True: + self.set_power_override(True, True) + else: + self.set_power_override(False, False) + + return True + + def set_power_override(self, power_override, power_set): + """ + Sets SFP power level using power_override and power_set + Args: + power_override : + A Boolean, True to override set_lpmode and use power_set + to control SFP power, False to disable SFP power control + through power_override/power_set and use set_lpmode + to control SFP power. + power_set : + Only valid when power_override is True. + A Boolean, True to set SFP to low power mode, False to set + SFP to high power mode. + Returns: + A boolean, True if power-override and power_set are set successfully, + False if not + """ + if self.port_num < 53: + return False # SFP doesn't support this feature + else: + if not self.get_presence(): + return False + try: + power_override_bit = (1 << 0) if power_override else 0 + power_set_bit = (1 << 1) if power_set else (1 << 3) + + buffer = create_string_buffer(1) + if sys.version_info[0] >= 3: + buffer[0] = (power_override_bit | power_set_bit) + else: + buffer[0] = chr(power_override_bit | power_set_bit) + # Write to eeprom + with open(self.port_to_eeprom_mapping[self.port_num], "r+b") as fd: + fd.seek(QSFP_POWEROVERRIDE_OFFSET) + fd.write(buffer[0]) + time.sleep(0.01) + except Exception: + print ('Error: unable to open file: ', str(e)) + return False + return True + + def get_name(self): + """ + Retrieves the name of the device + Returns: + string: The name of the device + """ + sfputil_helper = SfpUtilHelper() + sfputil_helper.read_porttab_mappings( + self.__get_path_to_port_config_file()) + name = sfputil_helper.logical[self.index] or "Unknown" + return name + + def get_presence(self): + """ + Retrieves the presence of the device + Returns: + bool: True if device is present, False if not + """ + if self.port_num < 49: #Copper port, no sysfs + return False + + present_path = "{}{}{}".format(CPLD_I2C_PATH, '/module_present_', self.port_num) + val=self._api_helper.read_txt_file(present_path) + if val is not None: + return int(val, 10)==1 + else: + return False + + def get_model(self): + """ + Retrieves the model number (or part number) of the device + Returns: + string: Model/part number of device + """ + transceiver_dom_info_dict = self.get_transceiver_info() + return transceiver_dom_info_dict.get("model", "N/A") + + def get_serial(self): + """ + Retrieves the serial number of the device + Returns: + string: Serial number of device + """ + transceiver_dom_info_dict = self.get_transceiver_info() + return transceiver_dom_info_dict.get("serial", "N/A") + + def get_status(self): + """ + Retrieves the operational status of the device + Returns: + A boolean value, True if device is operating properly, False if not + """ + return self.get_presence() and self.get_transceiver_bulk_status() diff --git a/device/accton/x86_64-accton_as4630_54te-r0/sonic_platform/thermal.py b/device/accton/x86_64-accton_as4630_54te-r0/sonic_platform/thermal.py new file mode 100644 index 000000000000..7a453c594fde --- /dev/null +++ b/device/accton/x86_64-accton_as4630_54te-r0/sonic_platform/thermal.py @@ -0,0 +1,145 @@ +############################################################################# +# Edgecore +# +# Thermal contains an implementation of SONiC Platform Base API and +# provides the thermal device status which are available in the platform +# +############################################################################# + +import os +import os.path +import glob + +try: + from sonic_platform_base.thermal_base import ThermalBase +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class Thermal(ThermalBase): + """Platform-specific Thermal class""" + + THERMAL_NAME_LIST = [] + SYSFS_PATH = "/sys/bus/i2c/devices" + + def __init__(self, thermal_index=0): + self.THERMAL_NAME_LIST = [] + self.SYSFS_PATH = "/sys/bus/i2c/devices" + self.index = thermal_index + # Add thermal name + self.THERMAL_NAME_LIST.append("Temp sensor 1") + self.THERMAL_NAME_LIST.append("Temp sensor 2") + self.THERMAL_NAME_LIST.append("Temp sensor 3") + + # Set hwmon path + i2c_path = { + 0: "14-0048/hwmon/hwmon*/", + 1: "24-004b/hwmon/hwmon*/", + 2: "25-004a/hwmon/hwmon*/" + }.get(self.index, None) + + self.hwmon_path = "{}/{}".format(self.SYSFS_PATH, i2c_path) + self.ss_key = self.THERMAL_NAME_LIST[self.index] + self.ss_index = 1 + + def __read_txt_file(self, file_path): + for filename in glob.glob(file_path): + try: + with open(filename, 'r') as fd: + data =fd.readline().rstrip() + return data + except IOError as e: + pass + + return None + + def __get_temp(self, temp_file): + temp_file_path = os.path.join(self.hwmon_path, temp_file) + raw_temp = self.__read_txt_file(temp_file_path) + if raw_temp is not None: + return float(raw_temp)/1000 + else: + return 0 + + def __set_threshold(self, file_name, temperature): + temp_file_path = os.path.join(self.hwmon_path, file_name) + for filename in glob.glob(temp_file_path): + try: + with open(filename, 'w') as fd: + fd.write(str(temperature)) + return True + except IOError as e: + print("IOError") + + + def get_temperature(self): + """ + Retrieves current temperature reading from thermal + Returns: + A float number of current temperature in Celsius up to nearest thousandth + of one degree Celsius, e.g. 30.125 + """ + temp_file = "temp{}_input".format(self.ss_index) + return self.__get_temp(temp_file) + + def get_high_threshold(self): + """ + Retrieves the high threshold temperature of thermal + Returns: + A float number, the high threshold temperature of thermal in Celsius + up to nearest thousandth of one degree Celsius, e.g. 30.125 + """ + temp_file = "temp{}_max".format(self.ss_index) + return self.__get_temp(temp_file) + + def set_high_threshold(self, temperature): + """ + Sets the high threshold temperature of thermal + Args : + temperature: A float number up to nearest thousandth of one degree Celsius, + e.g. 30.125 + Returns: + A boolean, True if threshold is set successfully, False if not + """ + temp_file = "temp{}_max".format(self.ss_index) + temperature = temperature *1000 + self.__set_threshold(temp_file, temperature) + + return True + + def get_name(self): + """ + Retrieves the name of the thermal device + Returns: + string: The name of the thermal device + """ + return self.THERMAL_NAME_LIST[self.index] + + def get_presence(self): + """ + Retrieves the presence of the Thermal + Returns: + bool: True if Thermal is present, False if not + """ + temp_file = "temp{}_input".format(self.ss_index) + temp_file_path = os.path.join(self.hwmon_path, temp_file) + raw_txt = self.__read_txt_file(temp_file_path) + if raw_txt is not None: + return True + else: + return False + + def get_status(self): + """ + Retrieves the operational status of the device + Returns: + A boolean value, True if device is operating properly, False if not + """ + + file_str = "temp{}_input".format(self.ss_index) + file_path = os.path.join(self.hwmon_path, file_str) + raw_txt = self.__read_txt_file(file_path) + if raw_txt is None: + return False + else: + return int(raw_txt) != 0 diff --git a/device/accton/x86_64-accton_as5712_54x-r0/sensors.conf b/device/accton/x86_64-accton_as5712_54x-r0/sensors.conf new file mode 100644 index 000000000000..913022987a6b --- /dev/null +++ b/device/accton/x86_64-accton_as5712_54x-r0/sensors.conf @@ -0,0 +1,51 @@ +# libsensors configuration file for as5712-54x +# ------------------------------------------------ +# + +bus "i2c-57" "i2c-0-mux (chan_id 1)" +bus "i2c-58" "i2c-0-mux (chan_id 2)" +bus "i2c-61" "i2c-0-mux (chan_id 5)" +bus "i2c-62" "i2c-0-mux (chan_id 6)" +bus "i2c-63" "i2c-0-mux (chan_id 7)" + +chip "cpr_4011_4mxx-i2c-*-3c" + label in1 "PSU 1 Voltage In" + label in2 "PSU 1 Voltage Out" + label fan1 "PSU 1 Fan" + label temp1 "PSU 1 Temperature" + label power1 "PSU 1 Power In" + label power2 "PSU 1 Power Out" + label curr1 "PSU 1 Current In" + label curr2 "PSU 1 Current Out" + +chip "cpr_4011_4mxx-i2c-*-3f" + label in1 "PSU 2 Voltage In" + label in2 "PSU 2 Voltage Out" + label fan1 "PSU 2 Fan" + label temp1 "PSU 2 Temperature" + label power1 "PSU 2 Power In" + label power2 "PSU 2 Power Out" + label curr1 "PSU 2 Current In" + label curr2 "PSU 2 Current Out" + +chip "as5712_54x_fan-*" + label fan1 "Fan 1 Front" + label fan2 "Fan 2 Front" + label fan3 "Fan 3 Front" + label fan4 "Fan 4 Front" + label fan5 "Fan 5 Front" + label fan11 "Fan 1 Rear" + label fan12 "Fan 2 Rear" + label fan13 "Fan 3 Rear" + label fan14 "Fan 4 Rear" + label fan15 "Fan 5 Rear" + + +chip "lm75-i2c-*-48" + label temp1 "Main Board Temperature" + +chip "lm75-i2c-*-49" + label temp1 "Main Board Temperature" + +chip "lm75-i2c-*-4a" + label temp1 "Main Board Temperature" diff --git a/device/accton/x86_64-accton_as5812_54t-r0/sensors.conf b/device/accton/x86_64-accton_as5812_54t-r0/sensors.conf new file mode 100644 index 000000000000..ebd3e6f8b9e2 --- /dev/null +++ b/device/accton/x86_64-accton_as5812_54t-r0/sensors.conf @@ -0,0 +1,66 @@ +# libsensors configuration file for as5812-54t +# ------------------------------------------------ +# + +bus "i2c-16" "i2c-0-mux (chan_id 6)" +bus "i2c-17" "i2c-0-mux (chan_id 7)" +bus "i2c-11" "i2c-0-mux (chan_id 1)" +bus "i2c-12" "i2c-0-mux (chan_id 2)" +bus "i2c-15" "i2c-0-mux (chan_id 5)" + + +chip "cpr_4011_4mxx-i2c-*-3c" + label in1 "PSU 1 Voltage In" + label in2 "PSU 1 Voltage Out" + label fan1 "PSU 1 Fan" + label temp1 "PSU 1 Temperature" + label power1 "PSU 1 Power In" + label power2 "PSU 1 Power Out" + label curr1 "PSU 1 Current In" + label curr2 "PSU 1 Current Out" + +chip "cpr_4011_4mxx-i2c-*-3f" + label in1 "PSU 2 Voltage In" + label in2 "PSU 2 Voltage Out" + label fan1 "PSU 2 Fan" + label temp1 "PSU 2 Temperature" + label power1 "PSU 2 Power In" + label power2 "PSU 2 Power Out" + label curr1 "PSU 2 Current In" + label curr2 "PSU 2 Current Out" + +chip "ym2401-i2c-*-58" + label in3 "PSU 1 Voltage" + label fan1 "PSU 1 Fan" + label temp1 "PSU 1 Temperature" + label power2 "PSU 1 Power" + label curr2 "PSU 1 Current" + +chip "ym2401-i2c-*-5b" + label in3 "PSU 2 Voltage" + label fan1 "PSU 2 Fan" + label temp1 "PSU 2 Temperature" + label power2 "PSU 2 Power" + label curr2 "PSU 2 Current" + +chip "as5812_54t_fan-*" + label fan1 "Fan 1 Front" + label fan2 "Fan 2 Front" + label fan3 "Fan 3 Front" + label fan4 "Fan 4 Front" + label fan5 "Fan 5 Front" + label fan11 "Fan 1 Rear" + label fan12 "Fan 2 Rear" + label fan13 "Fan 3 Rear" + label fan14 "Fan 4 Rear" + label fan15 "Fan 5 Rear" + + +chip "lm75-i2c-*-48" + label temp1 "Main Board Temperature" + +chip "lm75-i2c-*-49" + label temp1 "Main Board Temperature" + +chip "lm75-i2c-*-4a" + label temp1 "Main Board Temperature" diff --git a/device/accton/x86_64-accton_as5812_54x-r0/sensors.conf b/device/accton/x86_64-accton_as5812_54x-r0/sensors.conf new file mode 100644 index 000000000000..73038a4131c2 --- /dev/null +++ b/device/accton/x86_64-accton_as5812_54x-r0/sensors.conf @@ -0,0 +1,31 @@ +# libsensors configuration file for as5812-54x +# ------------------------------------------------ +# + +bus "i2c-57" "i2c-0-mux (chan_id 1)" +bus "i2c-58" "i2c-0-mux (chan_id 2)" +bus "i2c-61" "i2c-0-mux (chan_id 5)" +bus "i2c-62" "i2c-0-mux (chan_id 6)" +bus "i2c-63" "i2c-0-mux (chan_id 7)" + +chip "as5812_54x_fan-*" + label fan1 "Fan 1 Front" + label fan2 "Fan 2 Front" + label fan3 "Fan 3 Front" + label fan4 "Fan 4 Front" + label fan5 "Fan 5 Front" + label fan11 "Fan 1 Rear" + label fan12 "Fan 2 Rear" + label fan13 "Fan 3 Rear" + label fan14 "Fan 4 Rear" + label fan15 "Fan 5 Rear" + + +chip "lm75-i2c-*-48" + label temp1 "Main Board Temperature" + +chip "lm75-i2c-*-49" + label temp1 "Main Board Temperature" + +chip "lm75-i2c-*-4a" + label temp1 "Main Board Temperature" diff --git a/device/accton/x86_64-accton_as5835_54t-r0/sensors.conf b/device/accton/x86_64-accton_as5835_54t-r0/sensors.conf new file mode 100644 index 000000000000..3767cafdb580 --- /dev/null +++ b/device/accton/x86_64-accton_as5835_54t-r0/sensors.conf @@ -0,0 +1,50 @@ +# libsensors configuration file for as5835-54t +# ------------------------------------------------ +# + +bus "i2c-3" "i2c-0-mux (chan_id 1)" +bus "i2c-11" "i2c-2-mux (chan_id 1)" +bus "i2c-12" "i2c-2-mux (chan_id 2)" +bus "i2c-18" "i2c-2-mux (chan_id 0)" +bus "i2c-19" "i2c-2-mux (chan_id 1)" +bus "i2c-20" "i2c-2-mux (chan_id 2)" +bus "i2c-21" "i2c-2-mux (chan_id 3)" + +chip "ym2401-i2c-*-58" + label in3 "PSU 1 Voltage" + label fan1 "PSU 1 Fan" + label temp1 "PSU 1 Temperature" + label power2 "PSU 1 Power" + label curr2 "PSU 1 Current" + +chip "ym2401-i2c-*-5b" + label in3 "PSU 2 Voltage" + label fan1 "PSU 2 Fan" + label temp1 "PSU 2 Temperature" + label power2 "PSU 2 Power" + label curr2 "PSU 2 Current" + +chip "as5835_54t_fan-*" + label fan1 "Fan 1 Front" + label fan2 "Fan 2 Front" + label fan3 "Fan 3 Front" + label fan4 "Fan 4 Front" + label fan5 "Fan 5 Front" + label fan11 "Fan 1 Rear" + label fan12 "Fan 2 Rear" + label fan13 "Fan 3 Rear" + label fan14 "Fan 4 Rear" + label fan15 "Fan 5 Rear" + + +chip "lm75-i2c-*-49" + label temp1 "Main Board Temperature" + +chip "lm75-i2c-*-4a" + label temp1 "Main Board Temperature" + +chip "lm75-i2c-*-4c" + label temp1 "Main Board Temperature" + +chip "lm75-i2c-*-4b" + label temp1 "CPU Board Temperature" diff --git a/device/accton/x86_64-accton_as5835_54x-r0/Accton-AS5835-54X/mv2-as5835-48x10G+6x100G.config.bcm b/device/accton/x86_64-accton_as5835_54x-r0/Accton-AS5835-54X/mv2-as5835-48x10G+6x100G.config.bcm index e72a490b04d2..fb40d7949103 100644 --- a/device/accton/x86_64-accton_as5835_54x-r0/Accton-AS5835-54X/mv2-as5835-48x10G+6x100G.config.bcm +++ b/device/accton/x86_64-accton_as5835_54x-r0/Accton-AS5835-54X/mv2-as5835-48x10G+6x100G.config.bcm @@ -6,6 +6,7 @@ ptp_ts_pll_fref=50000000 ptp_bs_fref_0=50000000 ptp_bs_fref_1=50000000 + oversubscribe_mode=1 pbmp_xport_xe=0x1FFFFFFFFFFFFFFFE @@ -14,10 +15,32 @@ parity_enable=0 mem_cache_enable=0 l2_mem_entries=32768 -#l3_mem_entries=49152 -#fpem_mem_entries=16384 +l3_mem_entries=16384 +fpem_mem_entries=16384 l2xmsg_mode=1 +# Platform specfic +bcm_num_cos=8 +bcm_stat_interval=2000000 +cdma_timeout_usec=3000000 +help_cli_enable=1 +ifp_inports_support_enable=1 +ipv6_lpm_128b_enable=0x1 +l3_alpm_enable=2 +l3_max_ecmp_mode=1 +max_vp_lags=0 +memlist_enable=1 +reglist_enable=1 +miim_intr_enable=0 +module_64ports=1 +port_flex_enable=1 +schan_intr_enable=0 +stable_size=0x5500000 ;Specify the stable cache size in bytes used for Warm boot operations +tdma_timeout_usec=3000000 +skip_L2_USER_ENTRY=0 +bcm_tunnel_term_compatible_mode=1 +l3_alpm_ipv6_128b_bkt_rsvd=1 + #FC0 dport_map_port_1=1 dport_map_port_2=2 @@ -218,9 +241,6 @@ phy_chain_tx_polarity_flip_physical{36.0}=0x0 #FC9 dport_map_port_27=49 -dport_map_port_28=52 -dport_map_port_29=53 -dport_map_port_30=54 portmap_27=37:100:4 phy_chain_rx_lane_map_physical{37.0}=0x2130 phy_chain_rx_lane_map_physical{38.0}=0x2130 @@ -460,8 +480,8 @@ phy_chain_tx_polarity_flip_physical{76.0}=0x0 #FC19 -dport_map_port_64=64 -portmap_64=81:10:m -phy_chain_rx_polarity_flip_physical{81.0}=0x1 -phy_chain_tx_polarity_flip_physical{81.0}=0x1 +#dport_map_port_64=64 +#portmap_64=81:10:m +#phy_chain_rx_polarity_flip_physical{81.0}=0x1 +#phy_chain_tx_polarity_flip_physical{81.0}=0x1 diff --git a/device/accton/x86_64-accton_as5835_54x-r0/Accton-AS5835-54X/sai.profile b/device/accton/x86_64-accton_as5835_54x-r0/Accton-AS5835-54X/sai.profile index 744c6571f7c7..20a54db81412 100644 --- a/device/accton/x86_64-accton_as5835_54x-r0/Accton-AS5835-54X/sai.profile +++ b/device/accton/x86_64-accton_as5835_54x-r0/Accton-AS5835-54X/sai.profile @@ -1,2 +1,2 @@ -SAI_INIT_CONFIG_FILE=/etc/bcm/mv2-as5835-48x10G+6x100G.config.bcm +SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/mv2-as5835-48x10G+6x100G.config.bcm SAI_NUM_ECMP_MEMBERS=64 diff --git a/device/accton/x86_64-accton_as5835_54x-r0/custom_led.bin b/device/accton/x86_64-accton_as5835_54x-r0/custom_led.bin new file mode 100644 index 000000000000..69bb371114ac Binary files /dev/null and b/device/accton/x86_64-accton_as5835_54x-r0/custom_led.bin differ diff --git a/device/accton/x86_64-accton_as5835_54x-r0/led_proc_init.soc b/device/accton/x86_64-accton_as5835_54x-r0/led_proc_init.soc new file mode 100644 index 000000000000..5bef973ed2ae --- /dev/null +++ b/device/accton/x86_64-accton_as5835_54x-r0/led_proc_init.soc @@ -0,0 +1,3 @@ +m0 load 0 0x3800 /usr/share/sonic/platform/custom_led.bin +led start +led auto on diff --git a/device/accton/x86_64-accton_as5835_54x-r0/pmon_daemon_control.json b/device/accton/x86_64-accton_as5835_54x-r0/pmon_daemon_control.json index 584a14b9d942..a3b204e20d8d 100644 --- a/device/accton/x86_64-accton_as5835_54x-r0/pmon_daemon_control.json +++ b/device/accton/x86_64-accton_as5835_54x-r0/pmon_daemon_control.json @@ -1,5 +1,5 @@ { "skip_ledd": true, - "skip_thermalctld": true + "skip_pcied": true } diff --git a/device/accton/x86_64-accton_as5835_54x-r0/sensors.conf b/device/accton/x86_64-accton_as5835_54x-r0/sensors.conf new file mode 100644 index 000000000000..38cf89fc68c4 --- /dev/null +++ b/device/accton/x86_64-accton_as5835_54x-r0/sensors.conf @@ -0,0 +1,51 @@ +# libsensors configuration file for as5835-54x +# ------------------------------------------------ +# + +bus "i2c-3" "i2c-0-mux (chan_id 1)" +bus "i2c-11" "i2c-2-mux (chan_id 1)" +bus "i2c-12" "i2c-2-mux (chan_id 2)" +bus "i2c-18" "i2c-2-mux (chan_id 0)" +bus "i2c-19" "i2c-2-mux (chan_id 1)" +bus "i2c-20" "i2c-2-mux (chan_id 2)" +bus "i2c-21" "i2c-2-mux (chan_id 3)" + + +chip "ym2401-i2c-*-58" + label in3 "PSU 1 Voltage" + label fan1 "PSU 1 Fan" + label temp1 "PSU 1 Temperature" + label power2 "PSU 1 Power" + label curr2 "PSU 1 Current" + +chip "ym2401-i2c-*-5b" + label in3 "PSU 2 Voltage" + label fan1 "PSU 2 Fan" + label temp1 "PSU 2 Temperature" + label power2 "PSU 2 Power" + label curr2 "PSU 2 Current" + +chip "as5835_54x_fan-*" + label fan1 "Fan 1 Front" + label fan2 "Fan 2 Front" + label fan3 "Fan 3 Front" + label fan4 "Fan 4 Front" + label fan5 "Fan 5 Front" + label fan11 "Fan 1 Rear" + label fan12 "Fan 2 Rear" + label fan13 "Fan 3 Rear" + label fan14 "Fan 4 Rear" + label fan15 "Fan 5 Rear" + + +chip "lm75-i2c-*-49" + label temp1 "Main Board Temperature" + +chip "lm75-i2c-*-4a" + label temp1 "Main Board Temperature" + +chip "lm75-i2c-*-4c" + label temp1 "Main Board Temperature" + +chip "lm75-i2c-*-4b" + label temp1 "CPU Board Temperature" diff --git a/device/accton/x86_64-accton_as5835_54x-r0/sonic_platform/__init__.py b/device/accton/x86_64-accton_as5835_54x-r0/sonic_platform/__init__.py new file mode 100644 index 000000000000..73a7720e8979 --- /dev/null +++ b/device/accton/x86_64-accton_as5835_54x-r0/sonic_platform/__init__.py @@ -0,0 +1,2 @@ +__all__ = [ "platform", "chassis", "sfp", "eeprom", "component", "psu", "thermal", "fan", "fan_drawer" ] +from . import platform diff --git a/device/accton/x86_64-accton_as5835_54x-r0/sonic_platform/chassis.py b/device/accton/x86_64-accton_as5835_54x-r0/sonic_platform/chassis.py new file mode 100644 index 000000000000..92ef83d84552 --- /dev/null +++ b/device/accton/x86_64-accton_as5835_54x-r0/sonic_platform/chassis.py @@ -0,0 +1,259 @@ +############################################################################# +# Edgecore +# +# Module contains an implementation of SONiC Platform Base API and +# provides the Chassis information which are available in the platform +# +############################################################################# + +import os +import sys + +try: + from sonic_platform_base.chassis_base import ChassisBase + from .helper import APIHelper + from .event import SfpEvent +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +NUM_FAN_TRAY = 5 +NUM_FAN = 2 +NUM_PSU = 2 +NUM_THERMAL = 4 +NUM_QSFP = 54 +PORT_START = 1 +PORT_END = 54 +NUM_COMPONENT = 4 +HOST_REBOOT_CAUSE_PATH = "/host/reboot-cause/" +PMON_REBOOT_CAUSE_PATH = "/usr/share/sonic/platform/api_files/reboot-cause/" +REBOOT_CAUSE_FILE = "reboot-cause.txt" +PREV_REBOOT_CAUSE_FILE = "previous-reboot-cause.txt" +HOST_CHK_CMD = "docker > /dev/null 2>&1" +SYSLED_FNODE= "/sys/class/leds/as5835_54x_led::diag/brightness" + +SYSLED_MODES = { + "0" : "STATUS_LED_COLOR_OFF", + "1" : "STATUS_LED_COLOR_GREEN", + "2" : "STATUS_LED_COLOR_AMBER", + "5" : "STATUS_LED_COLOR_GREEN_BLINK" +} + + +class Chassis(ChassisBase): + """Platform-specific Chassis class""" + + def __init__(self): + ChassisBase.__init__(self) + self._api_helper = APIHelper() + self._api_helper = APIHelper() + self.is_host = self._api_helper.is_host() + + self.config_data = {} + + self.__initialize_fan() + self.__initialize_psu() + self.__initialize_thermals() + self.__initialize_components() + self.__initialize_sfp() + self.__initialize_eeprom() + + def __initialize_sfp(self): + from sonic_platform.sfp import Sfp + for index in range(0, PORT_END): + sfp = Sfp(index) + self._sfp_list.append(sfp) + self.sfp_module_initialized = True + + def __initialize_fan(self): + from sonic_platform.fan_drawer import FanDrawer + for fant_index in range(NUM_FAN_TRAY): + fandrawer = FanDrawer(fant_index) + self._fan_drawer_list.append(fandrawer) + self._fan_list.extend(fandrawer._fan_list) + + def __initialize_psu(self): + from sonic_platform.psu import Psu + for index in range(0, NUM_PSU): + psu = Psu(index) + self._psu_list.append(psu) + + def __initialize_thermals(self): + from sonic_platform.thermal import Thermal + for index in range(0, NUM_THERMAL): + thermal = Thermal(index) + self._thermal_list.append(thermal) + + def __initialize_eeprom(self): + from sonic_platform.eeprom import Tlv + self._eeprom = Tlv() + + def __initialize_components(self): + from sonic_platform.component import Component + for index in range(0, NUM_COMPONENT): + component = Component(index) + self._component_list.append(component) + + def __initialize_watchdog(self): + from sonic_platform.watchdog import Watchdog + self._watchdog = Watchdog() + + + def __is_host(self): + return os.system(HOST_CHK_CMD) == 0 + + def __read_txt_file(self, file_path): + try: + with open(file_path, 'r') as fd: + data = fd.read() + return data.strip() + except IOError: + pass + return None + + def get_name(self): + """ + Retrieves the name of the device + Returns: + string: The name of the device + """ + + return self._api_helper.hwsku + + def get_presence(self): + """ + Retrieves the presence of the Chassis + Returns: + bool: True if Chassis is present, False if not + """ + return True + + def get_status(self): + """ + Retrieves the operational status of the device + Returns: + A boolean value, True if device is operating properly, False if not + """ + return True + + def get_base_mac(self): + """ + Retrieves the base MAC address for the chassis + Returns: + A string containing the MAC address in the format + 'XX:XX:XX:XX:XX:XX' + """ + return self._eeprom.get_mac() + + def get_model(self): + """ + Retrieves the model number (or part number) of the device + Returns: + string: Model/part number of device + """ + return self._eeprom.get_pn() + + def get_serial(self): + """ + Retrieves the hardware serial number for the chassis + Returns: + A string containing the hardware serial number for this chassis. + """ + return self._eeprom.get_serial() + + def get_system_eeprom_info(self): + """ + Retrieves the full content of system EEPROM information for the chassis + Returns: + A dictionary where keys are the type code defined in + OCP ONIE TlvInfo EEPROM format and values are their corresponding + values. + """ + return self._eeprom.get_eeprom() + + def get_reboot_cause(self): + """ + Retrieves the cause of the previous reboot + + Returns: + A tuple (string, string) where the first element is a string + containing the cause of the previous reboot. This string must be + one of the predefined strings in this class. If the first string + is "REBOOT_CAUSE_HARDWARE_OTHER", the second string can be used + to pass a description of the reboot cause. + """ + + reboot_cause_path = (HOST_REBOOT_CAUSE_PATH + REBOOT_CAUSE_FILE) + sw_reboot_cause = self._api_helper.read_txt_file( + reboot_cause_path) or "Unknown" + + + return ('REBOOT_CAUSE_NON_HARDWARE', sw_reboot_cause) + + def get_change_event(self, timeout=0): + # SFP event + if not self.sfp_module_initialized: + self.__initialize_sfp() + + status, sfp_event = SfpEvent(self._sfp_list).get_sfp_event(timeout) + + return status, sfp_event + + def get_sfp(self, index): + """ + Retrieves sfp represented by (1-based) index + Args: + index: An integer, the index (1-based) of the sfp to retrieve. + The index should be the sequence of a physical port in a chassis, + starting from 1. + For example, 1 for Ethernet0, 2 for Ethernet4 and so on. + Returns: + An object dervied from SfpBase representing the specified sfp + """ + sfp = None + if not self.sfp_module_initialized: + self.__initialize_sfp() + + try: + # The index will start from 1 + sfp = self._sfp_list[index-1] + except IndexError: + sys.stderr.write("SFP index {} out of range (1-{})\n".format( + index, len(self._sfp_list))) + return sfp + + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device. If the agent cannot determine the parent-relative position + for some reason, or if the associated value of entPhysicalContainedIn is '0', then the value '-1' is returned + Returns: + integer: The 1-based relative physical position in parent device or -1 if cannot determine the position + """ + return -1 + + def is_replaceable(self): + """ + Indicate whether this device is replaceable. + Returns: + bool: True if it is replaceable. + """ + return False + + + def initizalize_system_led(self): + return True + + def get_status_led(self): + val = self._api_helper.read_txt_file(SYSLED_FNODE) + return SYSLED_MODES[val] if val in SYSLED_MODES else "UNKNOWN" + + def set_status_led(self, color): + mode = None + for key, val in SYSLED_MODES.items(): + if val == color: + mode = key + break + if mode is None: + return False + else: + return self._api_helper.write_txt_file(SYSLED_FNODE, mode) + diff --git a/device/accton/x86_64-accton_as5835_54x-r0/sonic_platform/component.py b/device/accton/x86_64-accton_as5835_54x-r0/sonic_platform/component.py new file mode 100644 index 000000000000..1e2febef8f46 --- /dev/null +++ b/device/accton/x86_64-accton_as5835_54x-r0/sonic_platform/component.py @@ -0,0 +1,180 @@ +############################################################################# +# Edgecore +# +# Component contains an implementation of SONiC Platform Base API and +# provides the components firmware management function +# +############################################################################# + +import shlex +import subprocess + + +try: + from sonic_platform_base.component_base import ComponentBase + from .helper import APIHelper +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +CPLD_ADDR_MAPPING = { + "CPLD1": "3-0060", + "CPLD2": "3-0061", + "CPLD3": "3-0062", +} +SYSFS_PATH = "/sys/bus/i2c/devices/" +BIOS_VERSION_PATH = "/sys/class/dmi/id/bios_version" +COMPONENT_LIST= [ + ("CPLD1", "CPLD 1"), + ("CPLD2", "CPLD 2"), + ("CPLD3", "CPLD 3"), + ("BIOS", "Basic Input/Output System") + +] +COMPONENT_DES_LIST = ["CPLD","Basic Input/Output System"] + + +class Component(ComponentBase): + """Platform-specific Component class""" + + DEVICE_TYPE = "component" + + def __init__(self, component_index=0): + self._api_helper=APIHelper() + ComponentBase.__init__(self) + self.index = component_index + self.name = self.get_name() + + + def __run_command(self, command): + # Run bash command and print output to stdout + try: + process = subprocess.Popen( + shlex.split(command), stdout=subprocess.PIPE) + while True: + output = process.stdout.readline() + if output == '' and process.poll() is not None: + break + rc = process.poll() + if rc != 0: + return False + except Exception: + return False + return True + + def __get_bios_version(self): + # Retrieves the BIOS firmware version + try: + with open(BIOS_VERSION_PATH, 'r') as fd: + bios_version = fd.read() + return bios_version.strip() + except Exception as e: + print('Get exception when read bios') + return None + + def __get_cpld_version(self): + # Retrieves the CPLD firmware version + cpld_version = dict() + for cpld_name in CPLD_ADDR_MAPPING: + try: + cpld_path = "{}{}{}".format(SYSFS_PATH, CPLD_ADDR_MAPPING[cpld_name], '/version') + cpld_version_raw= self._api_helper.read_txt_file(cpld_path) + cpld_version[cpld_name] = "{}".format(int(cpld_version_raw,16)) + except Exception as e: + print('Get exception when read cpld') + cpld_version[cpld_name] = 'None' + + return cpld_version + + def get_name(self): + """ + Retrieves the name of the component + Returns: + A string containing the name of the component + """ + return COMPONENT_LIST[self.index][0] + + def get_description(self): + """ + Retrieves the description of the component + Returns: + A string containing the description of the component + """ + return COMPONENT_LIST[self.index][1] + #return "testhwsku" + + def get_firmware_version(self): + """ + Retrieves the firmware version of module + Returns: + string: The firmware versions of the module + """ + fw_version = None + if self.name == "BIOS": + fw_version = self.__get_bios_version() + elif "CPLD" in self.name: + cpld_version = self.__get_cpld_version() + fw_version = cpld_version.get(self.name) + + return fw_version + + def install_firmware(self, image_path): + """ + Install firmware to module + Args: + image_path: A string, path to firmware image + Returns: + A boolean, True if install successfully, False if not + """ + raise NotImplementedError + + def get_presence(self): + """ + Retrieves the presence of the device + Returns: + bool: True if device is present, False if not + """ + return True + + def get_model(self): + """ + Retrieves the model number (or part number) of the device + Returns: + string: Model/part number of device + """ + return 'N/A' + + def get_serial(self): + """ + Retrieves the serial number of the device + Returns: + string: Serial number of device + """ + return 'N/A' + + def get_status(self): + """ + Retrieves the operational status of the device + Returns: + A boolean value, True if device is operating properly, False if not + """ + return True + + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device. + If the agent cannot determine the parent-relative position + for some reason, or if the associated value of + entPhysicalContainedIn is'0', then the value '-1' is returned + Returns: + integer: The 1-based relative physical position in parent device + or -1 if cannot determine the position + """ + return -1 + + def is_replaceable(self): + """ + Indicate whether this device is replaceable. + Returns: + bool: True if it is replaceable. + """ + return False diff --git a/device/accton/x86_64-accton_as5835_54x-r0/sonic_platform/eeprom.py b/device/accton/x86_64-accton_as5835_54x-r0/sonic_platform/eeprom.py new file mode 100644 index 000000000000..eba070a9e9b5 --- /dev/null +++ b/device/accton/x86_64-accton_as5835_54x-r0/sonic_platform/eeprom.py @@ -0,0 +1,131 @@ +try: + import os + import sys + import re + if sys.version_info[0] >= 3: + from io import StringIO + else: + from cStringIO import StringIO + + from sonic_platform_base.sonic_eeprom import eeprom_tlvinfo +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +CACHE_ROOT = '/var/cache/sonic/decode-syseeprom' +CACHE_FILE = 'syseeprom_cache' +NULL = 'N/A' + +class Tlv(eeprom_tlvinfo.TlvInfoDecoder): + + EEPROM_DECODE_HEADLINES = 6 + + def __init__(self): + self._eeprom_path = "/sys/bus/i2c/devices/0-0057/eeprom" + super(Tlv, self).__init__(self._eeprom_path, 0, '', True) + self._eeprom = self._load_eeprom() + + def __parse_output(self, decode_output): + decode_output.replace('\0', '') + lines = decode_output.split('\n') + lines = lines[self.EEPROM_DECODE_HEADLINES:] + _eeprom_info_dict = dict() + + for line in lines: + try: + match = re.search( + '(0x[0-9a-fA-F]{2})([\s]+[\S]+[\s]+)([\S]+)', line) + if match is not None: + idx = match.group(1) + value = match.group(3).rstrip('\0') + + _eeprom_info_dict[idx] = value + except Exception: + pass + + return _eeprom_info_dict + + def _load_eeprom(self): + original_stdout = sys.stdout + sys.stdout = StringIO() + try: + self.read_eeprom_db() + except Exception: + decode_output = sys.stdout.getvalue() + sys.stdout = original_stdout + return self.__parse_output(decode_output) + + status = self.check_status() + if 'ok' not in status: + return False + + if not os.path.exists(CACHE_ROOT): + try: + os.makedirs(CACHE_ROOT) + except Exception: + pass + + # + # only the eeprom classes that inherit from eeprom_base + # support caching. Others will work normally + # + try: + self.set_cache_name(os.path.join(CACHE_ROOT, CACHE_FILE)) + except Exception: + pass + + e = self.read_eeprom() + if e is None: + return 0 + + try: + self.update_cache(e) + except Exception: + pass + + self.decode_eeprom(e) + decode_output = sys.stdout.getvalue() + sys.stdout = original_stdout + + (is_valid, valid_crc) = self.is_checksum_valid(e) + if not is_valid: + return False + + return self.__parse_output(decode_output) + + def _valid_tlv(self, eeprom_data): + tlvinfo_type_codes_list = [ + self._TLV_CODE_PRODUCT_NAME, + self._TLV_CODE_PART_NUMBER, + self._TLV_CODE_SERIAL_NUMBER, + self._TLV_CODE_MAC_BASE, + self._TLV_CODE_MANUF_DATE, + self._TLV_CODE_DEVICE_VERSION, + self._TLV_CODE_LABEL_REVISION, + self._TLV_CODE_PLATFORM_NAME, + self._TLV_CODE_ONIE_VERSION, + self._TLV_CODE_MAC_SIZE, + self._TLV_CODE_MANUF_NAME, + self._TLV_CODE_MANUF_COUNTRY, + self._TLV_CODE_VENDOR_NAME, + self._TLV_CODE_DIAG_VERSION, + self._TLV_CODE_SERVICE_TAG, + self._TLV_CODE_VENDOR_EXT, + self._TLV_CODE_CRC_32 + ] + + for code in tlvinfo_type_codes_list: + code_str = "0x{:X}".format(code) + eeprom_data[code_str] = eeprom_data.get(code_str, NULL) + return eeprom_data + + def get_eeprom(self): + return self._valid_tlv(self._eeprom) + + def get_pn(self): + return self._eeprom.get('0x22', NULL) + + def get_serial(self): + return self._eeprom.get('0x23', NULL) + + def get_mac(self): + return self._eeprom.get('0x24', NULL) diff --git a/device/accton/x86_64-accton_as5835_54x-r0/sonic_platform/event.py b/device/accton/x86_64-accton_as5835_54x-r0/sonic_platform/event.py new file mode 100644 index 000000000000..d77ee8c29dc5 --- /dev/null +++ b/device/accton/x86_64-accton_as5835_54x-r0/sonic_platform/event.py @@ -0,0 +1,55 @@ +try: + import time + from .helper import APIHelper + from sonic_py_common.logger import Logger +except ImportError as e: + raise ImportError(repr(e) + " - required module not found") + + +class SfpEvent: + ''' Listen to insert/remove sfp events ''' + + def __init__(self, sfp_list): + self._api_helper = APIHelper() + self._sfp_list = sfp_list + self._logger = Logger() + + sfp_change_event_data = {'valid': 0, 'last': 0, 'present': 0} + def get_sfp_event(self, timeout=2000): + now = time.time() + port_dict = {} + change_dict = {} + change_dict['sfp'] = port_dict + + if timeout < 1000: + timeout = 1000 + timeout = timeout / float(1000) # Convert to secs + + if now < (self.sfp_change_event_data['last'] + timeout) and self.sfp_change_event_data['valid']: + return True, change_dict + + bitmap = 0 + for sfp in self._sfp_list: + modpres = sfp.get_presence() + i=sfp.port_num-1 + if modpres: + bitmap = bitmap | (1 << i) + + changed_ports = self.sfp_change_event_data['present'] ^ bitmap + if changed_ports: + for sfp in self._sfp_list: + i=sfp.port_num-1 + if (changed_ports & (1 << i)): + if (bitmap & (1 << i)) == 0: + port_dict[i+1] = '0' + else: + port_dict[i+1] = '1' + + + # Update the cache dict + self.sfp_change_event_data['present'] = bitmap + self.sfp_change_event_data['last'] = now + self.sfp_change_event_data['valid'] = 1 + return True, change_dict + else: + return True, change_dict diff --git a/device/accton/x86_64-accton_as5835_54x-r0/sonic_platform/fan.py b/device/accton/x86_64-accton_as5835_54x-r0/sonic_platform/fan.py new file mode 100644 index 000000000000..a9f35d367ccb --- /dev/null +++ b/device/accton/x86_64-accton_as5835_54x-r0/sonic_platform/fan.py @@ -0,0 +1,290 @@ +############################################################################# +# Edgecore +# +# Module contains an implementation of SONiC Platform Base API and +# provides the fan status which are available in the platform +# +############################################################################# + + + +try: + from sonic_platform_base.fan_base import FanBase + from .helper import APIHelper +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +PSU_FAN_MAX_RPM = 26688 +SPEED_TOLERANCE = 15 +CPLD_FAN_I2C_PATH = "/sys/bus/i2c/devices/3-0063/fan" +I2C_PATH ="/sys/bus/i2c/devices/{}-00{}/" +PSU_HWMON_I2C_MAPPING = { + 0: { + "num": 11, + "addr": "58" + }, + 1: { + "num": 12, + "addr": "5b" + }, +} + + +PSU_CPLD_I2C_MAPPING = { + 0: { + "num": 11, + "addr": "50" + }, + 1: { + "num": 12, + "addr": "53" + }, +} + + + +FAN_NAME_LIST = ["FAN-1F", "FAN-1R", "FAN-2F", "FAN-2R", + "FAN-3F", "FAN-3R", "FAN-4F", "FAN-4R", + "FAN-5F", "FAN-5R"] + +class Fan(FanBase): + """Platform-specific Fan class""" + + def __init__(self, fan_tray_index, fan_index=0, is_psu_fan=False, psu_index=0): + self._api_helper=APIHelper() + self.fan_index = fan_index + self.fan_tray_index = fan_tray_index + self.is_psu_fan = is_psu_fan + if self.is_psu_fan: + self.psu_index = psu_index + self.psu_i2c_num = PSU_HWMON_I2C_MAPPING[self.psu_index]['num'] + self.psu_i2c_addr = PSU_HWMON_I2C_MAPPING[self.psu_index]['addr'] + self.psu_hwmon_path = I2C_PATH.format( + self.psu_i2c_num, self.psu_i2c_addr) + + self.psu_i2c_num = PSU_CPLD_I2C_MAPPING[self.psu_index]['num'] + self.psu_i2c_addr = PSU_CPLD_I2C_MAPPING[self.psu_index]['addr'] + self.psu_cpld_path = I2C_PATH.format( + self.psu_i2c_num, self.psu_i2c_addr) + + FanBase.__init__(self) + + + def get_direction(self): + """ + Retrieves the direction of fan + Returns: + A string, either FAN_DIRECTION_INTAKE or FAN_DIRECTION_EXHAUST + depending on fan direction + """ + + + if not self.is_psu_fan: + dir_str = "{}{}{}".format(CPLD_FAN_I2C_PATH, self.fan_tray_index+1, '_direction') + val=self._api_helper.read_txt_file(dir_str) + if val is not None: + if int(val, 10)==0: + direction=self.FAN_DIRECTION_EXHAUST + else: + direction=self.FAN_DIRECTION_INTAKE + else: + direction=self.FAN_DIRECTION_EXHAUST + else: #For PSU + dir_str = "{}{}".format(self.psu_hwmon_path,'psu_fan_dir') + + val=self._api_helper.read_txt_file(dir_str) + + if val is not None: + if val=='F2B': + direction=self.FAN_DIRECTION_EXHAUST + else: + direction=self.FAN_DIRECTION_INTAKE + else: + direction=self.FAN_DIRECTION_EXHAUST + + return direction + + def get_speed(self): + """ + Retrieves the speed of fan as a percentage of full speed + Returns: + An integer, the percentage of full fan speed, in the range 0 (off) + to 100 (full speed) + + """ + speed = 0 + if self.is_psu_fan: + psu_fan_path= "{}{}".format(self.psu_hwmon_path, 'psu_fan1_speed_rpm') + fan_speed_rpm = self._api_helper.read_txt_file(psu_fan_path) + if fan_speed_rpm is not None: + speed = (int(fan_speed_rpm,10))*100/26688 + if speed > 100: + speed=100 + else: + return 0 + elif self.get_presence(): + speed_path = "{}{}".format(CPLD_FAN_I2C_PATH, '_duty_cycle_percentage') + speed=self._api_helper.read_txt_file(speed_path) + if speed is None: + return 0 + + return int(speed) + + def get_target_speed(self): + """ + Retrieves the target (expected) speed of the fan + Returns: + An integer, the percentage of full fan speed, in the range 0 (off) + to 100 (full speed) + + Note: + speed_pc = pwm_target/255*100 + + 0 : when PWM mode is use + pwm : when pwm mode is not use + """ + return self.get_speed() + + def get_speed_tolerance(self): + """ + Retrieves the speed tolerance of the fan + Returns: + An integer, the percentage of variance from target speed which is + considered tolerable + """ + return SPEED_TOLERANCE + + def set_speed(self, speed): + """ + Sets the fan speed + Args: + speed: An integer, the percentage of full fan speed to set fan to, + in the range 0 (off) to 100 (full speed) + Returns: + A boolean, True if speed is set successfully, False if not + + """ + + if not self.is_psu_fan and self.get_presence(): + speed_path = "{}{}".format(CPLD_FAN_I2C_PATH, '_duty_cycle_percentage') + return self._api_helper.write_txt_file(speed_path, int(speed)) + + return False + + def set_status_led(self, color): + """ + Sets the state of the fan module status LED + Args: + color: A string representing the color with which to set the + fan module status LED + Returns: + bool: True if status LED state is set successfully, False if not + """ + return False #Not supported + + def get_status_led(self): + """ + Gets the state of the fan status LED + Returns: + A string, one of the predefined STATUS_LED_COLOR_* strings above + """ + status=self.get_presence() + if status is None: + return self.STATUS_LED_COLOR_OFF + + return { + 1: self.STATUS_LED_COLOR_GREEN, + 0: self.STATUS_LED_COLOR_RED + }.get(status, self.STATUS_LED_COLOR_OFF) + + def get_name(self): + """ + Retrieves the name of the device + Returns: + string: The name of the device + """ + fan_name = FAN_NAME_LIST[self.fan_tray_index*2 + self.fan_index] \ + if not self.is_psu_fan \ + else "PSU-{} FAN-{}".format(self.psu_index+1, self.fan_index+1) + + return fan_name + + def get_presence(self): + """ + Retrieves the presence of the FAN + Returns: + bool: True if FAN is present, False if not + """ + + + if self.is_psu_fan: + present_path="{}{}".format(self.psu_cpld_path, 'psu_present') + else: + present_path = "{}{}{}".format(CPLD_FAN_I2C_PATH, self.fan_tray_index+1, '_present') + + val=self._api_helper.read_txt_file(present_path) + if val is not None: + return int(val, 10)==1 + else: + return False + + def get_status(self): + """ + Retrieves the operational status of the device + Returns: + A boolean value, True if device is operating properly, False if not + """ + if self.is_psu_fan: + psu_fan_path= "{}{}".format(self.psu_hwmon_path, 'psu_fan1_fault') + val=self._api_helper.read_txt_file(psu_fan_path) + if val is not None: + return int(val, 10)==0 + else: + return False + else: + path = "{}{}{}".format(CPLD_FAN_I2C_PATH, self.fan_tray_index+1, '_fault') + val=self._api_helper.read_txt_file(path) + if val is not None: + return int(val, 10)==0 + else: + return False + + + def get_model(self): + """ + Retrieves the model number (or part number) of the device + Returns: + string: Model/part number of device + """ + + return "N/A" + + def get_serial(self): + """ + Retrieves the serial number of the device + Returns: + string: Serial number of device + """ + return "N/A" + + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device. + If the agent cannot determine the parent-relative position + for some reason, or if the associated value of + entPhysicalContainedIn is'0', then the value '-1' is returned + Returns: + integer: The 1-based relative physical position in parent device + or -1 if cannot determine the position + """ + return (self.fan_tray_index+1) \ + if not self.is_psu_fan else (self.psu_index+1) + + def is_replaceable(self): + """ + Indicate whether this device is replaceable. + Returns: + bool: True if it is replaceable. + """ + return True if not self.is_psu_fan else False + diff --git a/device/accton/x86_64-accton_as5835_54x-r0/sonic_platform/fan_drawer.py b/device/accton/x86_64-accton_as5835_54x-r0/sonic_platform/fan_drawer.py new file mode 100644 index 000000000000..17d339ee55f6 --- /dev/null +++ b/device/accton/x86_64-accton_as5835_54x-r0/sonic_platform/fan_drawer.py @@ -0,0 +1,90 @@ +######################################################################## +# +# Module contains an implementation of SONiC Platform Base API and +# provides the Fan-Drawers' information available in the platform. +# +######################################################################## + +try: + from sonic_platform_base.fan_drawer_base import FanDrawerBase +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +FANS_PER_FANTRAY = 2 + + +class FanDrawer(FanDrawerBase): + """Platform-specific Fan class""" + + def __init__(self, fantray_index): + + FanDrawerBase.__init__(self) + # FanTray is 0-based in platforms + self.fantrayindex = fantray_index + self.__initialize_fan_drawer() + + + def __initialize_fan_drawer(self): + from sonic_platform.fan import Fan + for i in range(FANS_PER_FANTRAY): + self._fan_list.append(Fan(self.fantrayindex, i)) + + def get_name(self): + """ + Retrieves the fan drawer name + Returns: + string: The name of the device + """ + return "FanTray{}".format(self.fantrayindex+1) + + def get_presence(self): + """ + Retrieves the presence of the device + Returns: + bool: True if device is present, False if not + """ + return self._fan_list[0].get_presence() + + def get_model(self): + """ + Retrieves the model number (or part number) of the device + Returns: + string: Model/part number of device + """ + return self._fan_list[0].get_model() + + def get_serial(self): + """ + Retrieves the serial number of the device + Returns: + string: Serial number of device + """ + return self._fan_list[0].get_serial() + + def get_status(self): + """ + Retrieves the operational status of the device + Returns: + A boolean value, True if device is operating properly, False if not + """ + return self._fan_list[0].get_status() + + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device. + If the agent cannot determine the parent-relative position + for some reason, or if the associated value of + entPhysicalContainedIn is'0', then the value '-1' is returned + Returns: + integer: The 1-based relative physical position in parent device + or -1 if cannot determine the position + """ + return (self.fantrayindex+1) + + def is_replaceable(self): + """ + Indicate whether this device is replaceable. + Returns: + bool: True if it is replaceable. + """ + return True diff --git a/device/accton/x86_64-accton_as5835_54x-r0/sonic_platform/helper.py b/device/accton/x86_64-accton_as5835_54x-r0/sonic_platform/helper.py new file mode 100644 index 000000000000..b124ca29f0df --- /dev/null +++ b/device/accton/x86_64-accton_as5835_54x-r0/sonic_platform/helper.py @@ -0,0 +1,117 @@ +import os +import struct +import subprocess +from mmap import * +from sonic_py_common import device_info + +HOST_CHK_CMD = "docker > /dev/null 2>&1" +EMPTY_STRING = "" + + +class APIHelper(): + + def __init__(self): + (self.platform, self.hwsku) = device_info.get_platform_and_hwsku() + + def is_host(self): + return os.system(HOST_CHK_CMD) == 0 + + def pci_get_value(self, resource, offset): + status = True + result = "" + try: + fd = os.open(resource, os.O_RDWR) + mm = mmap(fd, 0) + mm.seek(int(offset)) + read_data_stream = mm.read(4) + result = struct.unpack('I', read_data_stream) + except Exception: + status = False + return status, result + + def run_command(self, cmd): + status = True + result = "" + try: + p = subprocess.Popen( + cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + raw_data, err = p.communicate() + if err == '': + result = raw_data.strip() + except Exception: + status = False + return status, result + + def run_interactive_command(self, cmd): + try: + os.system(cmd) + except Exception: + return False + return True + + def read_txt_file(self, file_path): + try: + with open(file_path, 'r', errors='replace') as fd: + data = fd.read() + return data.strip() + except IOError: + pass + return None + + def write_txt_file(self, file_path, value): + try: + with open(file_path, 'w') as fd: + fd.write(str(value)) + except IOError: + return False + return True + + def ipmi_raw(self, netfn, cmd): + status = True + result = "" + try: + cmd = "ipmitool raw {} {}".format(str(netfn), str(cmd)) + p = subprocess.Popen( + cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + raw_data, err = p.communicate() + if err == '': + result = raw_data.strip() + else: + status = False + except Exception: + status = False + return status, result + + def ipmi_fru_id(self, id, key=None): + status = True + result = "" + try: + cmd = "ipmitool fru print {}".format(str( + id)) if not key else "ipmitool fru print {0} | grep '{1}' ".format(str(id), str(key)) + + p = subprocess.Popen( + cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + raw_data, err = p.communicate() + if err == '': + result = raw_data.strip() + else: + status = False + except Exception: + status = False + return status, result + + def ipmi_set_ss_thres(self, id, threshold_key, value): + status = True + result = "" + try: + cmd = "ipmitool sensor thresh '{}' {} {}".format(str(id), str(threshold_key), str(value)) + p = subprocess.Popen( + cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + raw_data, err = p.communicate() + if err == '': + result = raw_data.strip() + else: + status = False + except Exception: + status = False + return status, result diff --git a/device/accton/x86_64-accton_as5835_54x-r0/sonic_platform/platform.py b/device/accton/x86_64-accton_as5835_54x-r0/sonic_platform/platform.py new file mode 100644 index 000000000000..2f2c2a447fcf --- /dev/null +++ b/device/accton/x86_64-accton_as5835_54x-r0/sonic_platform/platform.py @@ -0,0 +1,21 @@ +############################################################################# +# Edgecore +# +# Module contains an implementation of SONiC Platform Base API and +# provides the platform information +# +############################################################################# + +try: + from sonic_platform_base.platform_base import PlatformBase + from sonic_platform.chassis import Chassis +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class Platform(PlatformBase): + """Platform-specific Platform class""" + + def __init__(self): + PlatformBase.__init__(self) + self._chassis = Chassis() diff --git a/device/accton/x86_64-accton_as5835_54x-r0/sonic_platform/psu.py b/device/accton/x86_64-accton_as5835_54x-r0/sonic_platform/psu.py new file mode 100644 index 000000000000..330d188abffb --- /dev/null +++ b/device/accton/x86_64-accton_as5835_54x-r0/sonic_platform/psu.py @@ -0,0 +1,270 @@ +############################################################################# +# Edgecore +# +# Module contains an implementation of SONiC Platform Base API and +# provides the PSUs status which are available in the platform +# +############################################################################# + +#import sonic_platform + +try: + from sonic_platform_base.psu_base import PsuBase + #from sonic_platform.fan import Fan + from .helper import APIHelper +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +I2C_PATH ="/sys/bus/i2c/devices/{0}-00{1}/" + +PSU_NAME_LIST = ["PSU-1", "PSU-2"] +PSU_NUM_FAN = [1, 1] +PSU_HWMON_I2C_MAPPING = { + 0: { + "num": 11, + "addr": "58" + }, + 1: { + "num": 12, + "addr": "5b" + }, +} + +PSU_CPLD_I2C_MAPPING = { + 0: { + "num": 11, + "addr": "50" + }, + 1: { + "num": 12, + "addr": "53" + }, +} + +class Psu(PsuBase): + """Platform-specific Psu class""" + + def __init__(self, psu_index=0): + PsuBase.__init__(self) + self.index = psu_index + self._api_helper = APIHelper() + + self.i2c_num = PSU_HWMON_I2C_MAPPING[self.index]["num"] + self.i2c_addr = PSU_HWMON_I2C_MAPPING[self.index]["addr"] + self.hwmon_path = I2C_PATH.format(self.i2c_num, self.i2c_addr) + + self.i2c_num = PSU_CPLD_I2C_MAPPING[self.index]["num"] + self.i2c_addr = PSU_CPLD_I2C_MAPPING[self.index]["addr"] + self.cpld_path = I2C_PATH.format(self.i2c_num, self.i2c_addr) + self.__initialize_fan() + + def __initialize_fan(self): + from sonic_platform.fan import Fan + for fan_index in range(0, PSU_NUM_FAN[self.index]): + fan = Fan(fan_index, 0, is_psu_fan=True, psu_index=self.index) + self._fan_list.append(fan) + + def get_voltage(self): + """ + Retrieves current PSU voltage output + Returns: + A float number, the output voltage in volts, + e.g. 12.1 + """ + vout_path = "{}{}".format(self.hwmon_path, 'psu_v_out') + vout_val=self._api_helper.read_txt_file(vout_path) + if vout_val is not None: + return float(vout_val)/ 1000 + else: + return 0 + + def get_current(self): + """ + Retrieves present electric current supplied by PSU + Returns: + A float number, the electric current in amperes, e.g 15.4 + """ + iout_path = "{}{}".format(self.hwmon_path, 'psu_i_out') + val=self._api_helper.read_txt_file(iout_path) + if val is not None: + return float(val)/1000 + else: + return 0 + + def get_power(self): + """ + Retrieves current energy supplied by PSU + Returns: + A float number, the power in watts, e.g. 302.6 + """ + pout_path = "{}{}".format(self.hwmon_path, 'psu_p_out') + val=self._api_helper.read_txt_file(pout_path) + if val is not None: + return float(val)/1000 + else: + return 0 + + def get_powergood_status(self): + """ + Retrieves the powergood status of PSU + Returns: + A boolean, True if PSU has stablized its output voltages and passed all + its internal self-tests, False if not. + """ + return self.get_status() + + def set_status_led(self, color): + """ + Sets the state of the PSU status LED + Args: + color: A string representing the color with which to set the PSU status LED + Note: Only support green and off + Returns: + bool: True if status LED state is set successfully, False if not + """ + + return False #Controlled by HW + + def get_status_led(self): + """ + Gets the state of the PSU status LED + Returns: + A string, one of the predefined STATUS_LED_COLOR_* strings above + """ + status=self.get_status() + if status is None: + return self.STATUS_LED_COLOR_OFF + + return { + 1: self.STATUS_LED_COLOR_GREEN, + 0: self.STATUS_LED_COLOR_RED + }.get(status, self.STATUS_LED_COLOR_OFF) + + def get_temperature(self): + """ + Retrieves current temperature reading from PSU + Returns: + A float number of current temperature in Celsius up to nearest thousandth + of one degree Celsius, e.g. 30.125 + """ + temp_path = "{}{}".format(self.hwmon_path, 'psu_temp1_input') + val=self._api_helper.read_txt_file(temp_path) + if val is not None: + return float(val)/1000 + else: + return 0 + + def get_temperature_high_threshold(self): + """ + Retrieves the high threshold temperature of PSU + Returns: + A float number, the high threshold temperature of PSU in Celsius + up to nearest thousandth of one degree Celsius, e.g. 30.125 + """ + return False #Not supported + + def get_voltage_high_threshold(self): + """ + Retrieves the high threshold PSU voltage output + Returns: + A float number, the high threshold output voltage in volts, + e.g. 12.1 + """ + vout_path = "{}{}".format(self.hwmon_path, 'psu_mfr_vout_max') + vout_val=self._api_helper.read_txt_file(vout_path) + if vout_val is not None: + return float(vout_val)/ 1000 + else: + return 0 + + def get_voltage_low_threshold(self): + """ + Retrieves the low threshold PSU voltage output + Returns: + A float number, the low threshold output voltage in volts, + e.g. 12.1 + """ + vout_path = "{}{}".format(self.hwmon_path, 'psu_mfr_vout_min') + vout_val=self._api_helper.read_txt_file(vout_path) + if vout_val is not None: + return float(vout_val)/ 1000 + else: + return 0 + + def get_name(self): + """ + Retrieves the name of the device + Returns: + string: The name of the device + """ + return PSU_NAME_LIST[self.index] + + def get_presence(self): + """ + Retrieves the presence of the PSU + Returns: + bool: True if PSU is present, False if not + """ + presence_path="{}{}".format(self.cpld_path, 'psu_present') + val=self._api_helper.read_txt_file(presence_path) + if val is not None: + return int(val, 10) == 1 + else: + return 0 + + def get_status(self): + """ + Retrieves the operational status of the device + Returns: + A boolean value, True if device is operating properly, False if not + """ + power_path="{}{}".format(self.cpld_path, 'psu_power_good') + val=self._api_helper.read_txt_file(power_path) + if val is not None: + return int(val, 10) == 1 + else: + return 0 + + def get_model(self): + """ + Retrieves the model number (or part number) of the device + Returns: + string: Model/part number of device + """ + model_path="{}{}".format(self.cpld_path, 'psu_model_name') + model=self._api_helper.read_txt_file(model_path) + + if model is None: + return "N/A" + return model + + def get_serial(self): + """ + Retrieves the serial number of the device + Returns: + string: Serial number of device + """ + serial_path="{}{}".format(self.cpld_path, 'psu_serial_numer') + serial=self._api_helper.read_txt_file(serial_path) + + if serial is None: + return "N/A" + return serial + + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device. If the agent cannot determine the parent-relative position + for some reason, or if the associated value of entPhysicalContainedIn is '0', then the value '-1' is returned + Returns: + integer: The 1-based relative physical position in parent device or -1 if cannot determine the position + """ + return self.index+1 + + def is_replaceable(self): + """ + Indicate whether this device is replaceable. + Returns: + bool: True if it is replaceable. + """ + return True diff --git a/device/accton/x86_64-accton_as5835_54x-r0/sonic_platform/sfp.py b/device/accton/x86_64-accton_as5835_54x-r0/sonic_platform/sfp.py new file mode 100644 index 000000000000..145f67e2111e --- /dev/null +++ b/device/accton/x86_64-accton_as5835_54x-r0/sonic_platform/sfp.py @@ -0,0 +1,1272 @@ +############################################################################# +# Edgecore +# +# Sfp contains an implementation of SONiC Platform Base API and +# provides the sfp device status which are available in the platform +# +############################################################################# + +import os +import time +import sys + +from ctypes import create_string_buffer + +try: + from sonic_platform_base.sfp_base import SfpBase + from sonic_platform_base.sonic_sfp.sff8436 import sff8436Dom + from sonic_platform_base.sonic_sfp.sff8436 import sff8436InterfaceId + from sonic_platform_base.sonic_sfp.sff8472 import sff8472Dom + from sonic_platform_base.sonic_sfp.sff8472 import sff8472InterfaceId + #from sonic_platform_base.sonic_sfp.sff8472 import sffbase + from sonic_platform_base.sonic_sfp.sfputilhelper import SfpUtilHelper + from .helper import APIHelper +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +CPLD_I2C_PATH = "/sys/bus/i2c/devices/" + +QSFP_INFO_OFFSET = 128 +QSFP_DOM_OFFSET = 0 + +SFP_INFO_OFFSET = 0 +SFP_DOM_OFFSET = 256 + +XCVR_INTFACE_BULK_OFFSET = 0 +XCVR_INTFACE_BULK_WIDTH_QSFP = 20 +XCVR_INTFACE_BULK_WIDTH_SFP = 21 +XCVR_HW_REV_WIDTH_QSFP = 2 +XCVR_HW_REV_WIDTH_SFP = 4 +XCVR_CABLE_LENGTH_WIDTH_QSFP = 5 +XCVR_VENDOR_NAME_OFFSET = 20 +XCVR_VENDOR_NAME_WIDTH = 16 +XCVR_VENDOR_OUI_OFFSET = 37 +XCVR_VENDOR_OUI_WIDTH = 3 +XCVR_VENDOR_PN_OFFSET = 40 +XCVR_VENDOR_PN_WIDTH = 16 +XCVR_HW_REV_OFFSET = 56 +XCVR_HW_REV_WIDTH_OSFP = 2 +XCVR_HW_REV_WIDTH_SFP = 4 +XCVR_VENDOR_SN_OFFSET = 68 +XCVR_VENDOR_SN_WIDTH = 16 +XCVR_VENDOR_DATE_OFFSET = 84 +XCVR_VENDOR_DATE_WIDTH = 8 +XCVR_DOM_CAPABILITY_OFFSET = 92 +XCVR_DOM_CAPABILITY_WIDTH = 1 + +# Offset for values in QSFP eeprom +QSFP_DOM_REV_OFFSET = 1 +QSFP_DOM_REV_WIDTH = 1 +QSFP_TEMPE_OFFSET = 22 +QSFP_TEMPE_WIDTH = 2 +QSFP_VOLT_OFFSET = 26 +QSFP_VOLT_WIDTH = 2 +QSFP_CHANNL_MON_OFFSET = 34 +QSFP_CHANNL_MON_WIDTH = 16 +QSFP_CHANNL_MON_WITH_TX_POWER_WIDTH = 24 +QSFP_CONTROL_OFFSET = 86 +QSFP_CONTROL_WIDTH = 8 +QSFP_CHANNL_RX_LOS_STATUS_OFFSET = 3 +QSFP_CHANNL_RX_LOS_STATUS_WIDTH = 1 +QSFP_CHANNL_TX_FAULT_STATUS_OFFSET = 4 +QSFP_CHANNL_TX_FAULT_STATUS_WIDTH = 1 +QSFP_POWEROVERRIDE_OFFSET = 93 +QSFP_POWEROVERRIDE_WIDTH = 1 +QSFP_MODULE_THRESHOLD_OFFSET = 128 +QSFP_MODULE_THRESHOLD_WIDTH = 24 +QSFP_CHANNEL_THRESHOLD_OFFSET = 176 +QSFP_CHANNEL_THRESHOLD_WIDTH = 16 + +qsfp_cable_length_tup = ('Length(km)', 'Length OM3(2m)', + 'Length OM2(m)', 'Length OM1(m)', + 'Length Cable Assembly(m)') + +qsfp_compliance_code_tup = ('10/40G Ethernet Compliance Code', 'SONET Compliance codes', + 'SAS/SATA compliance codes', 'Gigabit Ethernet Compliant codes', + 'Fibre Channel link length/Transmitter Technology', + 'Fibre Channel transmission media', 'Fibre Channel Speed') + +qsfp_dom_capability_tup = ('Tx_power_support', 'Rx_power_support', + 'Voltage_support', 'Temp_support') + +# Add an EOL to prevent this being viewed as string instead of list +sfp_dom_capability_tup = ('sff8472_dom_support', 'EOL') + + +# Offset for values in SFP eeprom +SFP_TEMPE_OFFSET = 96 +SFP_TEMPE_WIDTH = 2 +SFP_VOLT_OFFSET = 98 +SFP_VOLT_WIDTH = 2 +SFP_CHANNL_MON_OFFSET = 100 +SFP_CHANNL_MON_WIDTH = 6 +SFP_MODULE_THRESHOLD_OFFSET = 0 +SFP_MODULE_THRESHOLD_WIDTH = 40 +SFP_CHANNL_THRESHOLD_OFFSET = 112 +SFP_CHANNL_THRESHOLD_WIDTH = 2 +SFP_STATUS_CONTROL_OFFSET = 110 +SFP_STATUS_CONTROL_WIDTH = 1 +SFP_TX_DISABLE_HARD_BIT = 7 +SFP_TX_DISABLE_SOFT_BIT = 6 + +sfp_cable_length_tup = ('LengthSMFkm-UnitsOfKm', 'LengthSMF(UnitsOf100m)', + 'Length50um(UnitsOf10m)', 'Length62.5um(UnitsOfm)', + 'LengthCable(UnitsOfm)', 'LengthOM3(UnitsOf10m)') + +sfp_compliance_code_tup = ('10GEthernetComplianceCode', 'InfinibandComplianceCode', + 'ESCONComplianceCodes', 'SONETComplianceCodes', + 'EthernetComplianceCodes', 'FibreChannelLinkLength', + 'FibreChannelTechnology', 'SFP+CableTechnology', + 'FibreChannelTransmissionMedia', 'FibreChannelSpeed') + + +class Sfp(SfpBase): + """Platform-specific Sfp class""" + + # Port number + PORT_START = 1 + PORT_END = 54 + QSFP_PORT_START = 49 + + # Path to sysfs + PLATFORM_ROOT_PATH = "/usr/share/sonic/device" + PMON_HWSKU_PATH = "/usr/share/sonic/hwsku" + HOST_CHK_CMD = "docker > /dev/null 2>&1" + + PLATFORM = "x86_64-accton_as5835_54x-r0" + HWSKU = "Accton-AS5835-54X" + + _cpld_mapping = { + 0: "3-0060", + 1: "3-0061", + 2: "3-0062", + } + _port_to_i2c_mapping = { + 1: 42, + 2: 43, + 3: 44, + 4: 45, + 5: 46, + 6: 47, + 7: 48, + 8: 49, + 9: 50, + 10: 51, + 11: 52, + 12: 53, + 13: 54, + 14: 55, + 15: 56, + 16: 57, + 17: 58, + 18: 59, + 19: 60, + 20: 61, + 21: 62, + 22: 63, + 23: 64, + 24: 65, + 25: 66, + 26: 67, + 27: 68, + 28: 69, + 29: 70, + 30: 71, + 31: 72, + 32: 73, + 33: 74, + 34: 75, + 35: 76, + 36: 77, + 37: 78, + 38: 79, + 39: 80, + 40: 81, + 41: 82, + 42: 83, + 43: 84, + 44: 85, + 45: 86, + 46: 87, + 47: 88, + 48: 89, + 49: 28, # QSFP49 + 50: 29, # QSFP50 + 51: 26, # QSFP51 + 52: 30, # QSFP52 + 53: 31, # QSFP53 + 54: 27, # QSFP54 + + } + + def __init__(self, sfp_index=0): + self._api_helper=APIHelper() + # Init index + self.index = sfp_index + self.port_num = self.index + 1 + + # Init eeprom path + eeprom_path = '/sys/bus/i2c/devices/{0}-0050/eeprom' + self.port_to_eeprom_mapping = {} + for x in range(self.PORT_START, self.PORT_END + 1): + self.port_to_eeprom_mapping[x] = eeprom_path.format(self._port_to_i2c_mapping[x]) + + self.info_dict_keys = ['type', 'hardware_rev', 'serial', 'manufacturer', 'model', 'connector', 'encoding', 'ext_identifier', + 'ext_rateselect_compliance', 'cable_type', 'cable_length', 'nominal_bit_rate', 'specification_compliance', 'vendor_date', 'vendor_oui', + 'application_advertisement', 'type_abbrv_name', 'dom_capability'] + + self.dom_dict_keys = ['rx_los', 'tx_fault', 'reset_status', 'power_lpmode', 'tx_disable', 'tx_disable_channel', 'temperature', 'voltage', + 'rx1power', 'rx2power', 'rx3power', 'rx4power', 'tx1bias', 'tx2bias', 'tx3bias', 'tx4bias', 'tx1power', 'tx2power', 'tx3power', 'tx4power'] + + self.threshold_dict_keys = ['temphighalarm', 'temphighwarning', 'templowalarm', 'templowwarning', 'vcchighalarm', 'vcchighwarning', 'vcclowalarm', 'vcclowwarning', 'rxpowerhighalarm', 'rxpowerhighwarning', + 'rxpowerlowalarm', 'rxpowerlowwarning', 'txpowerhighalarm', 'txpowerhighwarning', 'txpowerlowalarm', 'txpowerlowwarning', 'txbiashighalarm', 'txbiashighwarning', 'txbiaslowalarm', 'txbiaslowwarning'] + + SfpBase.__init__(self) + + # For cage 1~38 are at cpld2, others are at cpld3. + def __get_cpld_num(self, port_num): + return 1 if (port_num < 39) else 2 + + + def _convert_string_to_num(self, value_str): + if "-inf" in value_str: + return 'N/A' + elif "Unknown" in value_str: + return 'N/A' + elif 'dBm' in value_str: + t_str = value_str.rstrip('dBm') + return float(t_str) + elif 'mA' in value_str: + t_str = value_str.rstrip('mA') + return float(t_str) + elif 'C' in value_str: + t_str = value_str.rstrip('C') + return float(t_str) + elif 'Volts' in value_str: + t_str = value_str.rstrip('Volts') + return float(t_str) + else: + return 'N/A' + + def __is_host(self): + return os.system(self.HOST_CHK_CMD) == 0 + + def __get_path_to_port_config_file(self): + platform_path = "/".join([self.PLATFORM_ROOT_PATH, self.PLATFORM]) + hwsku_path = "/".join([platform_path, self.HWSKU] + ) if self.__is_host() else self.PMON_HWSKU_PATH + return "/".join([hwsku_path, "port_config.ini"]) + + def __read_eeprom_specific_bytes(self, offset, num_bytes): + sysfsfile_eeprom = None + eeprom_raw = [] + for i in range(0, num_bytes): + eeprom_raw.append("0x00") + + sysfs_sfp_i2c_client_eeprom_path = self.port_to_eeprom_mapping[self.port_num] + try: + sysfsfile_eeprom = open( + sysfs_sfp_i2c_client_eeprom_path, mode="rb", buffering=0) + sysfsfile_eeprom.seek(offset) + raw = sysfsfile_eeprom.read(num_bytes) + if sys.version_info[0] >= 3: + for n in range(0, num_bytes): + eeprom_raw[n] = hex(raw[n])[2:].zfill(2) + else: + for n in range(0, num_bytes): + eeprom_raw[n] = hex(ord(raw[n]))[2:].zfill(2) + except Exception: + pass + finally: + if sysfsfile_eeprom: + sysfsfile_eeprom.close() + + return eeprom_raw + + def get_transceiver_info(self): + """ + Retrieves transceiver info of this SFP + Returns: + A dict which contains following keys/values : + ======================================================================== + keys |Value Format |Information + ---------------------------|---------------|---------------------------- + type |1*255VCHAR |type of SFP + hardware_rev |1*255VCHAR |hardware version of SFP + serial |1*255VCHAR |serial number of the SFP + manufacturer |1*255VCHAR |SFP vendor name + model |1*255VCHAR |SFP model name + connector |1*255VCHAR |connector information + encoding |1*255VCHAR |encoding information + ext_identifier |1*255VCHAR |extend identifier + ext_rateselect_compliance |1*255VCHAR |extended rateSelect compliance + cable_length |INT |cable length in m + nominal_bit_rate |INT |nominal bit rate by 100Mbs + specification_compliance |1*255VCHAR |specification compliance + vendor_date |1*255VCHAR |vendor date + vendor_oui |1*255VCHAR |vendor OUI + application_advertisement |1*255VCHAR |supported applications advertisement + ======================================================================== + """ + # check present status + if self.port_num < 49: + sfpi_obj = sff8472InterfaceId() #SFP + else: + sfpi_obj = sff8436InterfaceId() #QSFP + if not self.get_presence() or not sfpi_obj: + return {} + + if self.port_num < 49: + offset = SFP_INFO_OFFSET + sfp_interface_bulk_raw = self.__read_eeprom_specific_bytes( + (offset + XCVR_INTFACE_BULK_OFFSET), XCVR_INTFACE_BULK_WIDTH_SFP) + else: + offset = QSFP_INFO_OFFSET + sfp_interface_bulk_raw = self.__read_eeprom_specific_bytes( + (offset + XCVR_INTFACE_BULK_OFFSET), XCVR_INTFACE_BULK_WIDTH_QSFP) + + sfp_interface_bulk_data = sfpi_obj.parse_sfp_info_bulk( + sfp_interface_bulk_raw, 0) + + sfp_vendor_name_raw = self.__read_eeprom_specific_bytes( + (offset + XCVR_VENDOR_NAME_OFFSET), XCVR_VENDOR_NAME_WIDTH) + sfp_vendor_name_data = sfpi_obj.parse_vendor_name( + sfp_vendor_name_raw, 0) + + sfp_vendor_pn_raw = self.__read_eeprom_specific_bytes( + (offset + XCVR_VENDOR_PN_OFFSET), XCVR_VENDOR_PN_WIDTH) + sfp_vendor_pn_data = sfpi_obj.parse_vendor_pn( + sfp_vendor_pn_raw, 0) + + if self.port_num < 49: + sfp_vendor_rev_raw = self.__read_eeprom_specific_bytes( + (offset + XCVR_HW_REV_OFFSET), XCVR_HW_REV_WIDTH_SFP) + else: + sfp_vendor_rev_raw = self.__read_eeprom_specific_bytes( + (offset + XCVR_HW_REV_OFFSET), XCVR_HW_REV_WIDTH_QSFP) + + sfp_vendor_rev_data = sfpi_obj.parse_vendor_rev( + sfp_vendor_rev_raw, 0) + + sfp_vendor_sn_raw = self.__read_eeprom_specific_bytes( + (offset + XCVR_VENDOR_SN_OFFSET), XCVR_VENDOR_SN_WIDTH) + sfp_vendor_sn_data = sfpi_obj.parse_vendor_sn( + sfp_vendor_sn_raw, 0) + + sfp_vendor_oui_raw = self.__read_eeprom_specific_bytes( + (offset + XCVR_VENDOR_OUI_OFFSET), XCVR_VENDOR_OUI_WIDTH) + if sfp_vendor_oui_raw is not None: + sfp_vendor_oui_data = sfpi_obj.parse_vendor_oui( + sfp_vendor_oui_raw, 0) + + sfp_vendor_date_raw = self.__read_eeprom_specific_bytes( + (offset + XCVR_VENDOR_DATE_OFFSET), XCVR_VENDOR_DATE_WIDTH) + sfp_vendor_date_data = sfpi_obj.parse_vendor_date( + sfp_vendor_date_raw, 0) + + sfp_dom_capability_raw = self.__read_eeprom_specific_bytes( + (offset + XCVR_DOM_CAPABILITY_OFFSET), XCVR_DOM_CAPABILITY_WIDTH) + if sfp_dom_capability_raw is not None: + sfp_dom_capability_data = sfpi_obj.parse_dom_capability( + sfp_dom_capability_raw, 0) + + + transceiver_info_dict = dict.fromkeys(self.info_dict_keys, 'N/A') + compliance_code_dict = dict() + dom_capability_dict = dict() + + if sfp_interface_bulk_data: + transceiver_info_dict['type'] = sfp_interface_bulk_data['data']['type']['value'] + transceiver_info_dict['connector'] = sfp_interface_bulk_data['data']['Connector']['value'] + transceiver_info_dict['encoding'] = sfp_interface_bulk_data['data']['EncodingCodes']['value'] + transceiver_info_dict['ext_identifier'] = sfp_interface_bulk_data['data']['Extended Identifier']['value'] + transceiver_info_dict['ext_rateselect_compliance'] = sfp_interface_bulk_data['data']['RateIdentifier']['value'] + transceiver_info_dict['type_abbrv_name'] = sfp_interface_bulk_data['data']['type_abbrv_name']['value'] + + transceiver_info_dict['manufacturer'] = sfp_vendor_name_data[ + 'data']['Vendor Name']['value'] if sfp_vendor_name_data else 'N/A' + transceiver_info_dict['model'] = sfp_vendor_pn_data['data']['Vendor PN']['value'] if sfp_vendor_pn_data else 'N/A' + transceiver_info_dict['hardware_rev'] = sfp_vendor_rev_data['data']['Vendor Rev']['value'] if sfp_vendor_rev_data else 'N/A' + transceiver_info_dict['serial'] = sfp_vendor_sn_data['data']['Vendor SN']['value'] if sfp_vendor_sn_data else 'N/A' + transceiver_info_dict['vendor_oui'] = sfp_vendor_oui_data['data']['Vendor OUI']['value'] if sfp_vendor_oui_data else 'N/A' + transceiver_info_dict['vendor_date'] = sfp_vendor_date_data[ + 'data']['VendorDataCode(YYYY-MM-DD Lot)']['value'] if sfp_vendor_date_data else 'N/A' + transceiver_info_dict['cable_type'] = "Unknown" + transceiver_info_dict['cable_length'] = "Unknown" + + if self.port_num < 49: + for key in sfp_cable_length_tup: + if key in sfp_interface_bulk_data['data']: + transceiver_info_dict['cable_type'] = key + transceiver_info_dict['cable_length'] = str( + sfp_interface_bulk_data['data'][key]['value']) + + for key in sfp_compliance_code_tup: + if key in sfp_interface_bulk_data['data']['Specification compliance']['value']: + compliance_code_dict[key] = sfp_interface_bulk_data['data']['Specification compliance']['value'][key]['value'] + + transceiver_info_dict['specification_compliance'] = str( + compliance_code_dict) + transceiver_info_dict['nominal_bit_rate'] = str( + sfp_interface_bulk_data['data']['NominalSignallingRate(UnitsOf100Mbd)']['value']) + + for key in sfp_dom_capability_tup: + if key in sfp_dom_capability_data['data']: + dom_capability_dict[key] = "yes" if sfp_dom_capability_data['data'][key]['value'] == 'on' else "no" + transceiver_info_dict['dom_capability'] = str(dom_capability_dict) + + else: + for key in qsfp_cable_length_tup: + if key in sfp_interface_bulk_data['data']: + transceiver_info_dict['cable_type'] = key + transceiver_info_dict['cable_length'] = str( + sfp_interface_bulk_data['data'][key]['value']) + + for key in qsfp_compliance_code_tup: + if key in sfp_interface_bulk_data['data']['Specification compliance']['value']: + compliance_code_dict[key] = sfp_interface_bulk_data['data']['Specification compliance']['value'][key]['value'] + + transceiver_info_dict['specification_compliance'] = str( + compliance_code_dict) + transceiver_info_dict['nominal_bit_rate'] = str( + sfp_interface_bulk_data['data']['Nominal Bit Rate(100Mbs)']['value']) + + for key in qsfp_dom_capability_tup: + if key in sfp_dom_capability_data['data']: + dom_capability_dict[key] = "yes" if sfp_dom_capability_data['data'][key]['value'] == 'on' else "no" + transceiver_info_dict['dom_capability'] = str(dom_capability_dict) + + return transceiver_info_dict + + def get_transceiver_bulk_status(self): + """ + Retrieves transceiver bulk status of this SFP + Returns: + A dict which contains following keys/values : + ======================================================================== + keys |Value Format |Information + ---------------------------|---------------|---------------------------- + rx_los |BOOLEAN |RX loss-of-signal status, True if has RX los, False if not. + tx_fault |BOOLEAN |TX fault status, True if has TX fault, False if not. + reset_status |BOOLEAN |reset status, True if SFP in reset, False if not. + lp_mode |BOOLEAN |low power mode status, True in lp mode, False if not. + tx_disable |BOOLEAN |TX disable status, True TX disabled, False if not. + tx_disabled_channel |HEX |disabled TX channels in hex, bits 0 to 3 represent channel 0 + | |to channel 3. + temperature |INT |module temperature in Celsius + voltage |INT |supply voltage in mV + txbias |INT |TX Bias Current in mA, n is the channel number, + | |for example, tx2bias stands for tx bias of channel 2. + rxpower |INT |received optical power in mW, n is the channel number, + | |for example, rx2power stands for rx power of channel 2. + txpower |INT |TX output power in mW, n is the channel number, + | |for example, tx2power stands for tx power of channel 2. + ======================================================================== + """ + # check present status + if self.port_num < 49: #SFP case + sfpd_obj = sff8472Dom() + if not self.get_presence() or not sfpd_obj: + return {} + + eeprom_ifraw = self.__read_eeprom_specific_bytes(0, SFP_DOM_OFFSET) + sfpi_obj = sff8472InterfaceId(eeprom_ifraw) + cal_type = sfpi_obj.get_calibration_type() + sfpd_obj._calibration_type = cal_type + + offset = SFP_DOM_OFFSET + transceiver_dom_info_dict = dict.fromkeys(self.dom_dict_keys, 'N/A') + dom_temperature_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_TEMPE_OFFSET), SFP_TEMPE_WIDTH) + + if dom_temperature_raw is not None: + dom_temperature_data = sfpd_obj.parse_temperature( + dom_temperature_raw, 0) + transceiver_dom_info_dict['temperature'] = dom_temperature_data['data']['Temperature']['value'] + + dom_voltage_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_VOLT_OFFSET), SFP_VOLT_WIDTH) + if dom_voltage_raw is not None: + dom_voltage_data = sfpd_obj.parse_voltage(dom_voltage_raw, 0) + transceiver_dom_info_dict['voltage'] = dom_voltage_data['data']['Vcc']['value'] + + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_CHANNL_MON_OFFSET), SFP_CHANNL_MON_WIDTH) + if dom_channel_monitor_raw is not None: + dom_voltage_data = sfpd_obj.parse_channel_monitor_params( + dom_channel_monitor_raw, 0) + transceiver_dom_info_dict['tx1power'] = dom_voltage_data['data']['TXPower']['value'] + transceiver_dom_info_dict['rx1power'] = dom_voltage_data['data']['RXPower']['value'] + transceiver_dom_info_dict['tx1bias'] = dom_voltage_data['data']['TXBias']['value'] + + else: #QSFP case + sfpd_obj = sff8436Dom() + sfpi_obj = sff8436InterfaceId() + + if not self.get_presence() or not sfpi_obj or not sfpd_obj: + return {} + + transceiver_dom_info_dict = dict.fromkeys(self.dom_dict_keys, 'N/A') + offset = QSFP_DOM_OFFSET + offset_xcvr = QSFP_INFO_OFFSET + + # QSFP capability byte parse, through this byte can know whether it support tx_power or not. + # TODO: in the future when decided to migrate to support SFF-8636 instead of SFF-8436, + # need to add more code for determining the capability and version compliance + # in SFF-8636 dom capability definitions evolving with the versions. + qsfp_dom_capability_raw = self.__read_eeprom_specific_bytes( + (offset_xcvr + XCVR_DOM_CAPABILITY_OFFSET), XCVR_DOM_CAPABILITY_WIDTH) + if qsfp_dom_capability_raw is not None: + qspf_dom_capability_data = sfpi_obj.parse_dom_capability( + qsfp_dom_capability_raw, 0) + else: + return None + + dom_temperature_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_TEMPE_OFFSET), QSFP_TEMPE_WIDTH) + if dom_temperature_raw is not None: + dom_temperature_data = sfpd_obj.parse_temperature( + dom_temperature_raw, 0) + transceiver_dom_info_dict['temperature'] = dom_temperature_data['data']['Temperature']['value'] + + dom_voltage_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_VOLT_OFFSET), QSFP_VOLT_WIDTH) + if dom_voltage_raw is not None: + dom_voltage_data = sfpd_obj.parse_voltage(dom_voltage_raw, 0) + transceiver_dom_info_dict['voltage'] = dom_voltage_data['data']['Vcc']['value'] + + qsfp_dom_rev_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_DOM_REV_OFFSET), QSFP_DOM_REV_WIDTH) + if qsfp_dom_rev_raw is not None: + qsfp_dom_rev_data = sfpd_obj.parse_sfp_dom_rev(qsfp_dom_rev_raw, 0) + qsfp_dom_rev = qsfp_dom_rev_data['data']['dom_rev']['value'] + + # The tx_power monitoring is only available on QSFP which compliant with SFF-8636 + # and claimed that it support tx_power with one indicator bit. + dom_channel_monitor_data = {} + dom_channel_monitor_raw = None + qsfp_tx_power_support = qspf_dom_capability_data['data']['Tx_power_support']['value'] + if (qsfp_dom_rev[0:8] != 'SFF-8636' or (qsfp_dom_rev[0:8] == 'SFF-8636' and qsfp_tx_power_support != 'on')): + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_CHANNL_MON_OFFSET), QSFP_CHANNL_MON_WIDTH) + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = sfpd_obj.parse_channel_monitor_params( + dom_channel_monitor_raw, 0) + + else: + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_CHANNL_MON_OFFSET), QSFP_CHANNL_MON_WITH_TX_POWER_WIDTH) + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = sfpd_obj.parse_channel_monitor_params_with_tx_power( + dom_channel_monitor_raw, 0) + transceiver_dom_info_dict['tx1power'] = dom_channel_monitor_data['data']['TX1Power']['value'] + transceiver_dom_info_dict['tx2power'] = dom_channel_monitor_data['data']['TX2Power']['value'] + transceiver_dom_info_dict['tx3power'] = dom_channel_monitor_data['data']['TX3Power']['value'] + transceiver_dom_info_dict['tx4power'] = dom_channel_monitor_data['data']['TX4Power']['value'] + + if dom_channel_monitor_raw: + transceiver_dom_info_dict['rx1power'] = dom_channel_monitor_data['data']['RX1Power']['value'] + transceiver_dom_info_dict['rx2power'] = dom_channel_monitor_data['data']['RX2Power']['value'] + transceiver_dom_info_dict['rx3power'] = dom_channel_monitor_data['data']['RX3Power']['value'] + transceiver_dom_info_dict['rx4power'] = dom_channel_monitor_data['data']['RX4Power']['value'] + transceiver_dom_info_dict['tx1bias'] = dom_channel_monitor_data['data']['TX1Bias']['value'] + transceiver_dom_info_dict['tx2bias'] = dom_channel_monitor_data['data']['TX2Bias']['value'] + transceiver_dom_info_dict['tx3bias'] = dom_channel_monitor_data['data']['TX3Bias']['value'] + transceiver_dom_info_dict['tx4bias'] = dom_channel_monitor_data['data']['TX4Bias']['value'] + #End of else + + + for key in transceiver_dom_info_dict: + transceiver_dom_info_dict[key] = self._convert_string_to_num( + transceiver_dom_info_dict[key]) + + transceiver_dom_info_dict['rx_los'] = self.get_rx_los() + transceiver_dom_info_dict['tx_fault'] = self.get_tx_fault() + transceiver_dom_info_dict['reset_status'] = self.get_reset_status() + transceiver_dom_info_dict['lp_mode'] = self.get_lpmode() + + return transceiver_dom_info_dict + + def get_transceiver_threshold_info(self): + """ + Retrieves transceiver threshold info of this SFP + Returns: + A dict which contains following keys/values : + ======================================================================== + keys |Value Format |Information + ---------------------------|---------------|---------------------------- + temphighalarm |FLOAT |High Alarm Threshold value of temperature in Celsius. + templowalarm |FLOAT |Low Alarm Threshold value of temperature in Celsius. + temphighwarning |FLOAT |High Warning Threshold value of temperature in Celsius. + templowwarning |FLOAT |Low Warning Threshold value of temperature in Celsius. + vcchighalarm |FLOAT |High Alarm Threshold value of supply voltage in mV. + vcclowalarm |FLOAT |Low Alarm Threshold value of supply voltage in mV. + vcchighwarning |FLOAT |High Warning Threshold value of supply voltage in mV. + vcclowwarning |FLOAT |Low Warning Threshold value of supply voltage in mV. + rxpowerhighalarm |FLOAT |High Alarm Threshold value of received power in dBm. + rxpowerlowalarm |FLOAT |Low Alarm Threshold value of received power in dBm. + rxpowerhighwarning |FLOAT |High Warning Threshold value of received power in dBm. + rxpowerlowwarning |FLOAT |Low Warning Threshold value of received power in dBm. + txpowerhighalarm |FLOAT |High Alarm Threshold value of transmit power in dBm. + txpowerlowalarm |FLOAT |Low Alarm Threshold value of transmit power in dBm. + txpowerhighwarning |FLOAT |High Warning Threshold value of transmit power in dBm. + txpowerlowwarning |FLOAT |Low Warning Threshold value of transmit power in dBm. + txbiashighalarm |FLOAT |High Alarm Threshold value of tx Bias Current in mA. + txbiaslowalarm |FLOAT |Low Alarm Threshold value of tx Bias Current in mA. + txbiashighwarning |FLOAT |High Warning Threshold value of tx Bias Current in mA. + txbiaslowwarning |FLOAT |Low Warning Threshold value of tx Bias Current in mA. + ======================================================================== + """ + # check present status + if self.port_num < 49: + sfpd_obj = sff8472Dom() + + if not self.get_presence() and not sfpd_obj: + return {} + + eeprom_ifraw = self.__read_eeprom_specific_bytes(0, SFP_DOM_OFFSET) + sfpi_obj = sff8472InterfaceId(eeprom_ifraw) + cal_type = sfpi_obj.get_calibration_type() + sfpd_obj._calibration_type = cal_type + + offset = SFP_DOM_OFFSET + transceiver_dom_threshold_info_dict = dict.fromkeys( + self.threshold_dict_keys, 'N/A') + dom_module_threshold_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_MODULE_THRESHOLD_OFFSET), SFP_MODULE_THRESHOLD_WIDTH) + if dom_module_threshold_raw is not None: + dom_module_threshold_data = sfpd_obj.parse_alarm_warning_threshold( + dom_module_threshold_raw, 0) + + transceiver_dom_threshold_info_dict['temphighalarm'] = dom_module_threshold_data['data']['TempHighAlarm']['value'] + transceiver_dom_threshold_info_dict['templowalarm'] = dom_module_threshold_data['data']['TempLowAlarm']['value'] + transceiver_dom_threshold_info_dict['temphighwarning'] = dom_module_threshold_data['data']['TempHighWarning']['value'] + transceiver_dom_threshold_info_dict['templowwarning'] = dom_module_threshold_data['data']['TempLowWarning']['value'] + transceiver_dom_threshold_info_dict['vcchighalarm'] = dom_module_threshold_data['data']['VoltageHighAlarm']['value'] + transceiver_dom_threshold_info_dict['vcclowalarm'] = dom_module_threshold_data['data']['VoltageLowAlarm']['value'] + transceiver_dom_threshold_info_dict['vcchighwarning'] = dom_module_threshold_data[ + 'data']['VoltageHighWarning']['value'] + transceiver_dom_threshold_info_dict['vcclowwarning'] = dom_module_threshold_data['data']['VoltageLowWarning']['value'] + transceiver_dom_threshold_info_dict['txbiashighalarm'] = dom_module_threshold_data['data']['BiasHighAlarm']['value'] + transceiver_dom_threshold_info_dict['txbiaslowalarm'] = dom_module_threshold_data['data']['BiasLowAlarm']['value'] + transceiver_dom_threshold_info_dict['txbiashighwarning'] = dom_module_threshold_data['data']['BiasHighWarning']['value'] + transceiver_dom_threshold_info_dict['txbiaslowwarning'] = dom_module_threshold_data['data']['BiasLowWarning']['value'] + transceiver_dom_threshold_info_dict['txpowerhighalarm'] = dom_module_threshold_data['data']['TXPowerHighAlarm']['value'] + transceiver_dom_threshold_info_dict['txpowerlowalarm'] = dom_module_threshold_data['data']['TXPowerLowAlarm']['value'] + transceiver_dom_threshold_info_dict['txpowerhighwarning'] = dom_module_threshold_data['data']['TXPowerHighWarning']['value'] + transceiver_dom_threshold_info_dict['txpowerlowwarning'] = dom_module_threshold_data['data']['TXPowerLowWarning']['value'] + transceiver_dom_threshold_info_dict['rxpowerhighalarm'] = dom_module_threshold_data['data']['RXPowerHighAlarm']['value'] + transceiver_dom_threshold_info_dict['rxpowerlowalarm'] = dom_module_threshold_data['data']['RXPowerLowAlarm']['value'] + transceiver_dom_threshold_info_dict['rxpowerhighwarning'] = dom_module_threshold_data['data']['RXPowerHighWarning']['value'] + transceiver_dom_threshold_info_dict['rxpowerlowwarning'] = dom_module_threshold_data['data']['RXPowerLowWarning']['value'] + + for key in transceiver_dom_threshold_info_dict: + transceiver_dom_threshold_info_dict[key] = self._convert_string_to_num( + transceiver_dom_threshold_info_dict[key]) + + return transceiver_dom_threshold_info_dict + + + else: + sfpd_obj = sff8436Dom() + + if not self.get_presence() or not sfpd_obj: + return {} + + transceiver_dom_threshold_dict = dict.fromkeys( + self.threshold_dict_keys, 'N/A') + dom_thres_raw = self.__read_eeprom_specific_bytes( + QSFP_MODULE_THRESHOLD_OFFSET, QSFP_MODULE_THRESHOLD_WIDTH) if self.get_presence() and sfpd_obj else None + + if dom_thres_raw: + module_threshold_values = sfpd_obj.parse_module_threshold_values( + dom_thres_raw, 0) + module_threshold_data = module_threshold_values.get('data') + if module_threshold_data: + transceiver_dom_threshold_dict['temphighalarm'] = module_threshold_data['TempHighAlarm']['value'] + transceiver_dom_threshold_dict['templowalarm'] = module_threshold_data['TempLowAlarm']['value'] + transceiver_dom_threshold_dict['temphighwarning'] = module_threshold_data['TempHighWarning']['value'] + transceiver_dom_threshold_dict['templowwarning'] = module_threshold_data['TempLowWarning']['value'] + transceiver_dom_threshold_dict['vcchighalarm'] = module_threshold_data['VccHighAlarm']['value'] + transceiver_dom_threshold_dict['vcclowalarm'] = module_threshold_data['VccLowAlarm']['value'] + transceiver_dom_threshold_dict['vcchighwarning'] = module_threshold_data['VccHighWarning']['value'] + transceiver_dom_threshold_dict['vcclowwarning'] = module_threshold_data['VccLowWarning']['value'] + + dom_thres_raw = self.__read_eeprom_specific_bytes( + QSFP_CHANNEL_THRESHOLD_OFFSET, QSFP_CHANNEL_THRESHOLD_WIDTH) if self.get_presence() and sfpd_obj else None + channel_threshold_values = sfpd_obj.parse_channel_threshold_values( + dom_thres_raw, 0) + channel_threshold_data = channel_threshold_values.get('data') + if channel_threshold_data: + transceiver_dom_threshold_dict['rxpowerhighalarm'] = channel_threshold_data['RxPowerHighAlarm']['value'] + transceiver_dom_threshold_dict['rxpowerlowalarm'] = channel_threshold_data['RxPowerLowAlarm']['value'] + transceiver_dom_threshold_dict['rxpowerhighwarning'] = channel_threshold_data['RxPowerHighWarning']['value'] + transceiver_dom_threshold_dict['rxpowerlowwarning'] = channel_threshold_data['RxPowerLowWarning']['value'] + transceiver_dom_threshold_dict['txpowerhighalarm'] = "0.0dBm" + transceiver_dom_threshold_dict['txpowerlowalarm'] = "0.0dBm" + transceiver_dom_threshold_dict['txpowerhighwarning'] = "0.0dBm" + transceiver_dom_threshold_dict['txpowerlowwarning'] = "0.0dBm" + transceiver_dom_threshold_dict['txbiashighalarm'] = channel_threshold_data['TxBiasHighAlarm']['value'] + transceiver_dom_threshold_dict['txbiaslowalarm'] = channel_threshold_data['TxBiasLowAlarm']['value'] + transceiver_dom_threshold_dict['txbiashighwarning'] = channel_threshold_data['TxBiasHighWarning']['value'] + transceiver_dom_threshold_dict['txbiaslowwarning'] = channel_threshold_data['TxBiasLowWarning']['value'] + + for key in transceiver_dom_threshold_dict: + transceiver_dom_threshold_dict[key] = self._convert_string_to_num( + transceiver_dom_threshold_dict[key]) + + return transceiver_dom_threshold_dict + + def get_reset_status(self): + """ + Retrieves the reset status of SFP + Returns: + A Boolean, True if reset enabled, False if disabled + """ + if self.port_num <49: + return False # SPF port doesn't support this feature + + cpld_i = self.__get_cpld_num(self.port_num) + cpld_path = self._cpld_mapping[cpld_i] + reset_path = "{}{}{}{}".format(CPLD_I2C_PATH, cpld_path, '/module_reset_', self.port_num) + val=self._api_helper.read_txt_file(reset_path) + if val is not None: + return int(val, 10)==1 + else: + return False + + def get_rx_los(self): + """ + Retrieves the RX LOS (lost-of-signal) status of SFP + Returns: + A Boolean, True if SFP has RX LOS, False if not. + Note : RX LOS status is latched until a call to get_rx_los or a reset. + """ + rx_los = False + if self.port_num < 49: + cpld_i = self.__get_cpld_num(self.port_num) + cpld_path = self._cpld_mapping[cpld_i] + rx_path = "{}{}{}{}".format(CPLD_I2C_PATH, cpld_path, '/module_rx_los_', self.port_num) + + rx_los=self._api_helper.read_txt_file(rx_path) + if int(rx_los, 10) == 1: + return [True] + else: + return [False] + #status_control_raw = self.__read_eeprom_specific_bytes( + # SFP_STATUS_CONTROL_OFFSET, SFP_STATUS_CONTROL_WIDTH) + #if status_control_raw: + # data = int(status_control_raw[0], 16) + # rx_los = (sffbase().test_bit(data, 1) != 0) + + else: + rx_los_list = [] + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + QSFP_CHANNL_RX_LOS_STATUS_OFFSET, QSFP_CHANNL_RX_LOS_STATUS_WIDTH) if self.get_presence() else None + if dom_channel_monitor_raw is not None: + rx_los_data = int(dom_channel_monitor_raw[0], 16) + rx_los_list.append(rx_los_data & 0x01 != 0) + rx_los_list.append(rx_los_data & 0x02 != 0) + rx_los_list.append(rx_los_data & 0x04 != 0) + rx_los_list.append(rx_los_data & 0x08 != 0) + return rx_los_list + else: + return [False]*4 + + def get_tx_fault(self): + """ + Retrieves the TX fault status of SFP + Returns: + A list of boolean values, representing the TX fault status + of each available channel, value is True if SFP channel + has TX fault, False if not. + E.g., for a tranceiver with four channels: [False, False, True, False] + Note : TX fault status is lached until a call to get_tx_fault or a reset. + """ + tx_fault = False + if self.port_num < 49: + cpld_i = self.__get_cpld_num(self.port_num) + cpld_path = self._cpld_mapping[cpld_i] + tx_path = "{}{}{}{}".format(CPLD_I2C_PATH, cpld_path, '/module_tx_fault_', self.port_num) + + tx_fault=self._api_helper.read_txt_file(tx_path) + if int(tx_fault, 10) == 1: + return [True] + else: + return [False] + #status_control_raw = self.__read_eeprom_specific_bytes( + # SFP_STATUS_CONTROL_OFFSET, SFP_STATUS_CONTROL_WIDTH) + #if status_control_raw: + # data = int(status_control_raw[0], 16) + # tx_fault = (sffbase().test_bit(data, 2) != 0) + else: + tx_fault_list = [] + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + QSFP_CHANNL_TX_FAULT_STATUS_OFFSET, QSFP_CHANNL_TX_FAULT_STATUS_WIDTH) if self.get_presence() else None + if dom_channel_monitor_raw is not None: + tx_fault_data = int(dom_channel_monitor_raw[0], 16) + tx_fault_list.append(tx_fault_data & 0x01 != 0) + tx_fault_list.append(tx_fault_data & 0x02 != 0) + tx_fault_list.append(tx_fault_data & 0x04 != 0) + tx_fault_list.append(tx_fault_data & 0x08 != 0) + return tx_fault_list + else: + return [False]*4 + + + def get_tx_disable(self): + """ + Retrieves the tx_disable status of this SFP + Returns: + A list of boolean values, representing the TX disable status + of each available channel, value is True if SFP channel + is TX disabled, False if not. + E.g., for a tranceiver with four channels: [False, False, True, False] + """ + if self.port_num < 49: + tx_disable = False + + cpld_i = self.__get_cpld_num(self.port_num) + cpld_path = self._cpld_mapping[cpld_i] + tx_path = "{}{}{}{}".format(CPLD_I2C_PATH, cpld_path, '/module_tx_disable_', self.port_num) + + tx_disable=self._api_helper.read_txt_file(tx_path) + + #status_control_raw = self.__read_eeprom_specific_bytes( + # SFP_STATUS_CONTROL_OFFSET, SFP_STATUS_CONTROL_WIDTH) + #if status_control_raw: + # data = int(status_control_raw[0], 16) + # tx_disable_hard = (sffbase().test_bit( + # data, SFP_TX_DISABLE_HARD_BIT) != 0) + # tx_disable_soft = (sffbase().test_bit( + # data, SFP_TX_DISABLE_SOFT_BIT) != 0) + # tx_disable = tx_disable_hard | tx_disable_soft + if int(tx_disable, 10)==0: + return [False] + else: + return [True] + + else: + tx_disable_list = [] + + sfpd_obj = sff8436Dom() + if sfpd_obj is None: + return False + + dom_control_raw = self.__read_eeprom_specific_bytes( + QSFP_CONTROL_OFFSET, QSFP_CONTROL_WIDTH) if self.get_presence() else None + if dom_control_raw is not None: + dom_control_data = sfpd_obj.parse_control_bytes(dom_control_raw, 0) + tx_disable_list.append( + 'On' == dom_control_data['data']['TX1Disable']['value']) + tx_disable_list.append( + 'On' == dom_control_data['data']['TX2Disable']['value']) + tx_disable_list.append( + 'On' == dom_control_data['data']['TX3Disable']['value']) + tx_disable_list.append( + 'On' == dom_control_data['data']['TX4Disable']['value']) + return tx_disable_list + else: + return [False]*4 + + def get_tx_disable_channel(self): + """ + Retrieves the TX disabled channels in this SFP + Returns: + A hex of 4 bits (bit 0 to bit 3 as channel 0 to channel 3) to represent + TX channels which have been disabled in this SFP. + As an example, a returned value of 0x5 indicates that channel 0 + and channel 2 have been disabled. + """ + tx_disable_list = self.get_tx_disable() + if tx_disable_list is None: + return 0 + tx_disabled = 0 + for i in range(len(tx_disable_list)): + if tx_disable_list[i]: + tx_disabled |= 1 << i + return tx_disabled + + def get_lpmode(self): + """ + Retrieves the lpmode (low power mode) status of this SFP + Returns: + A Boolean, True if lpmode is enabled, False if disabled + """ + if self.port_num < 49: + # SFP doesn't support this feature + return False + else: + power_set=self.get_power_set() + power_override = self.get_power_override() + return power_set and power_override + + + def get_power_set(self): + + if self.port_num < 49: + # SFP doesn't support this feature + return False + else: + power_set = False + + sfpd_obj = sff8436Dom() + if sfpd_obj is None: + return False + + dom_control_raw = self.__read_eeprom_specific_bytes( + QSFP_CONTROL_OFFSET, QSFP_CONTROL_WIDTH) if self.get_presence() else None + if dom_control_raw is not None: + dom_control_data = sfpd_obj.parse_control_bytes(dom_control_raw, 0) + power_set = ( + 'On' == dom_control_data['data']['PowerSet']['value']) + + return power_set + + def get_power_override(self): + """ + Retrieves the power-override status of this SFP + Returns: + A Boolean, True if power-override is enabled, False if disabled + """ + if self.port_num < 49: + return False # SFP doesn't support this feature + else: + power_override = False + + + sfpd_obj = sff8436Dom() + if sfpd_obj is None: + return False + + dom_control_raw = self.__read_eeprom_specific_bytes( + QSFP_CONTROL_OFFSET, QSFP_CONTROL_WIDTH) if self.get_presence() else None + if dom_control_raw is not None: + dom_control_data = sfpd_obj.parse_control_bytes(dom_control_raw, 0) + power_override = ( + 'On' == dom_control_data['data']['PowerOverride']['value']) + + return power_override + + def get_temperature(self): + """ + Retrieves the temperature of this SFP + Returns: + An integer number of current temperature in Celsius + """ + transceiver_dom_info_dict = self.get_transceiver_bulk_status() + return transceiver_dom_info_dict.get("temperature", "N/A") + + def get_voltage(self): + """ + Retrieves the supply voltage of this SFP + Returns: + An integer number of supply voltage in mV + """ + transceiver_dom_info_dict = self.get_transceiver_bulk_status() + return transceiver_dom_info_dict.get("voltage", "N/A") + + def get_tx_bias(self): + """ + Retrieves the TX bias current of this SFP + Returns: + A list of four integer numbers, representing TX bias in mA + for channel 0 to channel 4. + Ex. ['110.09', '111.12', '108.21', '112.09'] + """ + transceiver_dom_info_dict = self.get_transceiver_bulk_status() + + tx1_bs = transceiver_dom_info_dict.get("tx1bias", "N/A") + if self.port_num < 49: + return [tx1_bs, "N/A", "N/A", "N/A"] if transceiver_dom_info_dict else [] + + tx2_bs = transceiver_dom_info_dict.get("tx2bias", "N/A") + tx3_bs = transceiver_dom_info_dict.get("tx3bias", "N/A") + tx4_bs = transceiver_dom_info_dict.get("tx4bias", "N/A") + return [tx1_bs, tx2_bs, tx3_bs, tx4_bs] if transceiver_dom_info_dict else [] + + def get_rx_power(self): + """ + Retrieves the received optical power for this SFP + Returns: + A list of four integer numbers, representing received optical + power in mW for channel 0 to channel 4. + Ex. ['1.77', '1.71', '1.68', '1.70'] + """ + transceiver_dom_info_dict = self.get_transceiver_bulk_status() + + rx1_pw = transceiver_dom_info_dict.get("rx1power", "N/A") + if self.port_num < 49: + return [rx1_pw, "N/A", "N/A", "N/A"] if transceiver_dom_info_dict else [] + rx2_pw = transceiver_dom_info_dict.get("rx2power", "N/A") + rx3_pw = transceiver_dom_info_dict.get("rx3power", "N/A") + rx4_pw = transceiver_dom_info_dict.get("rx4power", "N/A") + return [rx1_pw, rx2_pw, rx3_pw, rx4_pw] if transceiver_dom_info_dict else [] + + def get_tx_power(self): + """ + Retrieves the TX power of this SFP + Returns: + A list of four integer numbers, representing TX power in mW + for channel 0 to channel 4. + Ex. ['1.86', '1.86', '1.86', '1.86'] + """ + transceiver_dom_info_dict = self.get_transceiver_bulk_status() + tx1_pw = transceiver_dom_info_dict.get("tx1power", "N/A") + if self.port_num < 49: + return [tx1_pw, "N/A", "N/A", "N/A"] if transceiver_dom_info_dict else [] + tx2_pw = transceiver_dom_info_dict.get("tx2power", "N/A") + tx3_pw = transceiver_dom_info_dict.get("tx3power", "N/A") + tx4_pw = transceiver_dom_info_dict.get("tx4power", "N/A") + return [tx1_pw, tx2_pw, tx3_pw, tx4_pw] + + def reset(self): + """ + Reset SFP and return all user module settings to their default srate. + Returns: + A boolean, True if successful, False if not + """ + if self.port_num <49: + return False # SFP doesn't support this feature + + cpld_i = self.__get_cpld_num(self.port_num) + cpld_path = self._cpld_mapping[cpld_i] + reset_path = "{}{}{}{}".format(CPLD_I2C_PATH, cpld_path, '/module_reset_', self.port_num) + ret = self._api_helper.write_txt_file(reset_path, 1) + + if ret is not True: + return ret + + time.sleep(0.01) + ret = self._api_helper.write_txt_file(reset_path, 0) + time.sleep(0.2) + + return ret + + def tx_disable(self, tx_disable): + """ + Disable SFP TX for all channels + Args: + tx_disable : A Boolean, True to enable tx_disable mode, False to disable + tx_disable mode. + Returns: + A boolean, True if tx_disable is set successfully, False if not + """ + if self.port_num < 49: + cpld_i = self.__get_cpld_num(self.port_num) + cpld_path = self._cpld_mapping[cpld_i] + tx_path = "{}{}{}{}".format(CPLD_I2C_PATH, cpld_path, '/module_tx_disable_', self.port_num) + ret = self._api_helper.write_txt_file(tx_path, 1 if tx_disable else 0) + + if ret is not None: + time.sleep(0.01) + return ret + else: + return False + + else: + if not self.get_presence(): + return False + sysfsfile_eeprom = None + try: + tx_disable_ctl = 0xf if tx_disable else 0x0 + buffer = create_string_buffer(1) + if sys.version_info[0] >= 3: + buffer[0] = tx_disable_ctl + else: + buffer[0] = chr(tx_disable_ctl) + # Write to eeprom + sysfsfile_eeprom = open( + self.port_to_eeprom_mapping[self.port_num], "r+b") + sysfsfile_eeprom.seek(QSFP_CONTROL_OFFSET) + + sysfsfile_eeprom.write(buffer[0]) + except IOError as e: + print ('Error: unable to open file: ',str(e)) + return False + finally: + if sysfsfile_eeprom is not None: + sysfsfile_eeprom.close() + time.sleep(0.01) + return True + + def tx_disable_channel(self, channel, disable): + """ + Sets the tx_disable for specified SFP channels + Args: + channel : A hex of 4 bits (bit 0 to bit 3) which represent channel 0 to 3, + e.g. 0x5 for channel 0 and channel 2. + disable : A boolean, True to disable TX channels specified in channel, + False to enable + Returns: + A boolean, True if successful, False if not + """ + + if self.port_num < 49: + return False # SFP doesn't support this feature + else: + if not self.get_presence(): + return False + + sysfsfile_eeprom = None + try: + channel_state = self.get_tx_disable_channel() + + for i in range(4): + channel_mask = (1 << i) + if not (channel & channel_mask): + continue + + if disable: + channel_state |= channel_mask + else: + channel_state &= ~channel_mask + + buffer = create_string_buffer(1) + if sys.version_info[0] >= 3: + buffer[0] = channel_state + else: + buffer[0] = chr(channel_state) + # Write to eeprom + sysfsfile_eeprom = open( + self.port_to_eeprom_mapping[self.port_num], "r+b") + sysfsfile_eeprom.seek(QSFP_CONTROL_OFFSET) + sysfsfile_eeprom.write(buffer[0]) + except IOError as e: + print ('Error: unable to open file: ', str(e)) + return False + finally: + if sysfsfile_eeprom is not None: + sysfsfile_eeprom.close() + time.sleep(0.01) + return True + + def set_lpmode(self, lpmode): + """ + Sets the lpmode (low power mode) of SFP + Args: + lpmode: A Boolean, True to enable lpmode, False to disable it + Note : lpmode can be overridden by set_power_override + Returns: + A boolean, True if lpmode is set successfully, False if not + """ + if self.port_num < 49: + return False # SFP doesn't support this feature + else: + if lpmode: + self.set_power_override(True, True) + else: + self.set_power_override(False, False) + + return True + + def set_power_override(self, power_override, power_set): + """ + Sets SFP power level using power_override and power_set + Args: + power_override : + A Boolean, True to override set_lpmode and use power_set + to control SFP power, False to disable SFP power control + through power_override/power_set and use set_lpmode + to control SFP power. + power_set : + Only valid when power_override is True. + A Boolean, True to set SFP to low power mode, False to set + SFP to high power mode. + Returns: + A boolean, True if power-override and power_set are set successfully, + False if not + """ + if self.port_num < 49: + return False # SFP doesn't support this feature + else: + if not self.get_presence(): + return False + try: + power_override_bit = (1 << 0) if power_override else 0 + power_set_bit = (1 << 1) if power_set else (1 << 3) + + buffer = create_string_buffer(1) + if sys.version_info[0] >= 3: + buffer[0] = (power_override_bit | power_set_bit) + else: + buffer[0] = chr(power_override_bit | power_set_bit) + # Write to eeprom + with open(self.port_to_eeprom_mapping[self.port_num], "r+b") as fd: + fd.seek(QSFP_POWEROVERRIDE_OFFSET) + fd.write(buffer[0]) + time.sleep(0.01) + except Exception: + print ('Error: unable to open file: ', str(e)) + return False + return True + + def get_name(self): + """ + Retrieves the name of the device + Returns: + string: The name of the device + """ + sfputil_helper = SfpUtilHelper() + sfputil_helper.read_porttab_mappings( + self.__get_path_to_port_config_file()) + name = sfputil_helper.logical[self.index] or "Unknown" + return name + + def get_presence(self): + """ + Retrieves the presence of the device + Returns: + bool: True if device is present, False if not + """ + cpld_i = self.__get_cpld_num(self.port_num) + cpld_path = self._cpld_mapping[cpld_i] + present_path = "{}{}{}{}".format(CPLD_I2C_PATH, cpld_path, '/module_present_', self.port_num) + val=self._api_helper.read_txt_file(present_path) + if val is not None: + return int(val, 10)==1 + else: + return False + + def get_model(self): + """ + Retrieves the model number (or part number) of the device + Returns: + string: Model/part number of device + """ + transceiver_dom_info_dict = self.get_transceiver_info() + return transceiver_dom_info_dict.get("model", "N/A") + + def get_serial(self): + """ + Retrieves the serial number of the device + Returns: + string: Serial number of device + """ + transceiver_dom_info_dict = self.get_transceiver_info() + return transceiver_dom_info_dict.get("serial", "N/A") + + def get_status(self): + """ + Retrieves the operational status of the device + Returns: + A boolean value, True if device is operating properly, False if not + """ + return self.get_presence() and self.get_transceiver_bulk_status() + + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device. If the agent cannot determine the parent-relative position + for some reason, or if the associated value of entPhysicalContainedIn is '0', then the value '-1' is returned + Returns: + integer: The 1-based relative physical position in parent device or -1 if cannot determine the position + """ + return self.port_num + + def is_replaceable(self): + """ + Indicate whether this device is replaceable. + Returns: + bool: True if it is replaceable. + """ + return True diff --git a/device/accton/x86_64-accton_as5835_54x-r0/sonic_platform/thermal.py b/device/accton/x86_64-accton_as5835_54x-r0/sonic_platform/thermal.py new file mode 100644 index 000000000000..4638d803ea63 --- /dev/null +++ b/device/accton/x86_64-accton_as5835_54x-r0/sonic_platform/thermal.py @@ -0,0 +1,239 @@ +############################################################################# +# Edgecore +# +# Thermal contains an implementation of SONiC Platform Base API and +# provides the thermal device status which are available in the platform +# +############################################################################# + +import os +import os.path +import glob + +try: + from sonic_platform_base.thermal_base import ThermalBase +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +PSU_I2C_PATH = "/sys/bus/i2c/devices/{}-00{}/" +PSU_HWMON_I2C_MAPPING = { + 0: { + "num": 11, + "addr": "58" + }, + 1: { + "num": 12, + "addr": "5b" + }, +} + +PSU_CPLD_I2C_MAPPING = { + 0: { + "num": 11, + "addr": "50" + }, + 1: { + "num": 12, + "addr": "53" + }, +} + + +class Thermal(ThermalBase): + """Platform-specific Thermal class""" + + THERMAL_NAME_LIST = [] + PSU_THERMAL_NAME_LIST = [] + SYSFS_PATH = "/sys/bus/i2c/devices" + + def __init__(self, thermal_index=0, is_psu=False, psu_index=0): + self.index = thermal_index + self.is_psu = is_psu + self.psu_index = psu_index + + if self.is_psu: + psu_i2c_bus = PSU_HWMON_I2C_MAPPING[psu_index]["num"] + psu_i2c_addr = PSU_HWMON_I2C_MAPPING[psu_index]["addr"] + self.psu_hwmon_path = PSU_I2C_PATH.format(psu_i2c_bus, + psu_i2c_addr) + psu_i2c_bus = PSU_CPLD_I2C_MAPPING[psu_index]["num"] + psu_i2c_addr = PSU_CPLD_I2C_MAPPING[psu_index]["addr"] + self.cpld_path = PSU_I2C_PATH.format(psu_i2c_bus, psu_i2c_addr) + # Add thermal name + self.THERMAL_NAME_LIST.append("Temp sensor 1") + self.THERMAL_NAME_LIST.append("Temp sensor 2") + self.THERMAL_NAME_LIST.append("Temp sensor 3") + self.PSU_THERMAL_NAME_LIST.append("PSU-1 temp sensor 1") + self.PSU_THERMAL_NAME_LIST.append("PSU-2 temp sensor 1") + + # Set hwmon path + i2c_path = { + 0: "18-004b/hwmon/hwmon*/", + 1: "19-004c/hwmon/hwmon*/", + 2: "20-0049/hwmon/hwmon*/", + 3: "21-004a/hwmon/hwmon*/" + }.get(self.index, None) + + self.hwmon_path = "{}/{}".format(self.SYSFS_PATH, i2c_path) + self.ss_key = self.THERMAL_NAME_LIST[self.index] + self.ss_index = 1 + + def __read_txt_file(self, file_path): + for filename in glob.glob(file_path): + try: + with open(filename, 'r') as fd: + data =fd.readline().rstrip() + return data + except IOError as e: + pass + + return None + + def __get_temp(self, temp_file): + if not self.is_psu: + temp_file_path = os.path.join(self.hwmon_path, temp_file) + else: + temp_file_path = temp_file + raw_temp = self.__read_txt_file(temp_file_path) + if raw_temp is not None: + return float(raw_temp)/1000 + else: + return 0 + + def __set_threshold(self, file_name, temperature): + if self.is_psu: + return True + temp_file_path = os.path.join(self.hwmon_path, file_name) + for filename in glob.glob(temp_file_path): + try: + with open(filename, 'w') as fd: + fd.write(str(temperature)) + return True + except IOError as e: + print("IOError") + return False + + + + def get_temperature(self): + """ + Retrieves current temperature reading from thermal + Returns: + A float number of current temperature in Celsius up to nearest thousandth + of one degree Celsius, e.g. 30.125 + """ + if not self.is_psu: + temp_file = "temp{}_input".format(self.ss_index) + else: + temp_file = self.psu_hwmon_path + "psu_temp1_input" + + return self.__get_temp(temp_file) + + def get_high_threshold(self): + """ + Retrieves the high threshold temperature of thermal + Returns: + A float number, the high threshold temperature of thermal in Celsius + up to nearest thousandth of one degree Celsius, e.g. 30.125 + """ + if self.is_psu: + return 0 + + temp_file = "temp{}_max".format(self.ss_index) + return self.__get_temp(temp_file) + + def set_high_threshold(self, temperature): + """ + Sets the high threshold temperature of thermal + Args : + temperature: A float number up to nearest thousandth of one degree Celsius, + e.g. 30.125 + Returns: + A boolean, True if threshold is set successfully, False if not + """ + temp_file = "temp{}_max".format(self.ss_index) + temperature = temperature *1000 + self.__set_threshold(temp_file, temperature) + + return True + + def get_name(self): + """ + Retrieves the name of the thermal device + Returns: + string: The name of the thermal device + """ + if self.is_psu: + return self.PSU_THERMAL_NAME_LIST[self.psu_index] + else: + return self.THERMAL_NAME_LIST[self.index] + + def get_presence(self): + """ + Retrieves the presence of the Thermal + Returns: + bool: True if Thermal is present, False if not + """ + if self.is_psu: + val = self.__read_txt_file(self.cpld_path + "psu_present") + return int(val, 10) == 1 + temp_file = "temp{}_input".format(self.ss_index) + temp_file_path = os.path.join(self.hwmon_path, temp_file) + raw_txt = self.__read_txt_file(temp_file_path) + if raw_txt is not None: + return True + else: + return False + + def get_status(self): + """ + Retrieves the operational status of the device + Returns: + A boolean value, True if device is operating properly, False if not + """ + if self.is_psu: + temp_file = self.psu_hwmon_path + "psu_temp_fault" + return self.get_presence() and (not int( + self.__read_txt_file(temp_file))) + + file_str = "temp{}_input".format(self.ss_index) + file_path = os.path.join(self.hwmon_path, file_str) + raw_txt = self.__read_txt_file(file_path) + if raw_txt is None: + return False + else: + return int(raw_txt) != 0 + + def get_model(self): + """ + Retrieves the model number (or part number) of the device + Returns: + string: Model/part number of device + """ + + return "N/A" + + def get_serial(self): + """ + Retrieves the serial number of the device + Returns: + string: Serial number of device + """ + return "N/A" + + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device. If the agent cannot determine the parent-relative position + for some reason, or if the associated value of entPhysicalContainedIn is '0', then the value '-1' is returned + Returns: + integer: The 1-based relative physical position in parent device or -1 if cannot determine the position + """ + return -1 + + def is_replaceable(self): + """ + Retrieves whether thermal module is replaceable + Returns: + A boolean value, True if replaceable, False if not + """ + return False diff --git a/device/accton/x86_64-accton_as5835_54x-r0/system_health_monitoring_config.json b/device/accton/x86_64-accton_as5835_54x-r0/system_health_monitoring_config.json new file mode 100644 index 000000000000..5f3b3b07e73f --- /dev/null +++ b/device/accton/x86_64-accton_as5835_54x-r0/system_health_monitoring_config.json @@ -0,0 +1,15 @@ +{ + "services_to_ignore": [], + "devices_to_ignore": [ + "asic", + "psu.temperature" + + ], + "user_defined_checkers": [], + "polling_interval": 60, + "led_color": { + "fault": "STATUS_LED_COLOR_AMBER", + "normal": "STATUS_LED_COLOR_GREEN", + "booting": "STATUS_LED_COLOR_GREEN" + } +} diff --git a/device/accton/x86_64-accton_as6712_32x-r0/sensors.conf b/device/accton/x86_64-accton_as6712_32x-r0/sensors.conf index 84ee0fd9f333..60b8f4734304 100644 --- a/device/accton/x86_64-accton_as6712_32x-r0/sensors.conf +++ b/device/accton/x86_64-accton_as6712_32x-r0/sensors.conf @@ -1,23 +1,56 @@ -# libsensors configuration file for AS6712-32X +# libsensors configuration file for as6712-32x # ------------------------------------------------ +# + +bus "i2c-35" "i2c-0-mux (chan_id 1)" +bus "i2c-36" "i2c-0-mux (chan_id 2)" +bus "i2c-38" "i2c-0-mux (chan_id 4)" +bus "i2c-39" "i2c-0-mux (chan_id 5)" +bus "i2c-40" "i2c-0-mux (chan_id 6)" +bus "i2c-41" "i2c-0-mux (chan_id 7)" + chip "cpr_4011_4mxx-i2c-*-3c" - label in1 "PSU1_VIN" - label in2 "PSU1_VOUT" - label curr1 "PSU1_IIN" - label curr2 "PSU1_IOUT" - label power1 "PSU1_PIN" - label power2 "PSU1_POUT" - label fan1 "PSU1_FAN" - label temp1 "PSU1_TEMP" + label in1 "PSU 1 Voltage In" + label in2 "PSU 1 Voltage Out" + label fan1 "PSU 1 Fan" + label temp1 "PSU 1 Temperature" + label power1 "PSU 1 Power In" + label power2 "PSU 1 Power Out" + label curr1 "PSU 1 Current In" + label curr2 "PSU 1 Current Out" chip "cpr_4011_4mxx-i2c-*-3f" - label in1 "PSU2_VIN" - label in2 "PSU2_VOUT" - label curr1 "PSU2_IIN" - label curr2 "PSU2_IOUT" - label power1 "PSU2_PIN" - label power2 "PSU2_POUT" - label fan1 "PSU2_FAN" - label temp1 "PSU2_TEMP" + label in1 "PSU 2 Voltage In" + label in2 "PSU 2 Voltage Out" + label fan1 "PSU 2 Fan" + label temp1 "PSU 2 Temperature" + label power1 "PSU 2 Power In" + label power2 "PSU 2 Power Out" + label curr1 "PSU 2 Current In" + label curr2 "PSU 2 Current Out" + +chip "as6712_32x_fan-*" + label fan1 "Fan 1 Front" + label fan2 "Fan 2 Front" + label fan3 "Fan 3 Front" + label fan4 "Fan 4 Front" + label fan5 "Fan 5 Front" + label fan11 "Fan 1 Rear" + label fan12 "Fan 2 Rear" + label fan13 "Fan 3 Rear" + label fan14 "Fan 4 Rear" + label fan15 "Fan 5 Rear" + + +chip "lm75-i2c-*-48" + label temp1 "Main Board Temperature" + +chip "lm75-i2c-*-49" + label temp1 "Main Board Temperature" + +chip "lm75-i2c-*-4a" + label temp1 "Main Board Temperature" +chip "lm75-i2c-*-4b" + label temp1 "Main Board Temperature" diff --git a/device/accton/x86_64-accton_as7116_54x-r0/sonic_platform/sfp.py b/device/accton/x86_64-accton_as7116_54x-r0/sonic_platform/sfp.py index 9d85b96be730..2006561ffef0 100644 --- a/device/accton/x86_64-accton_as7116_54x-r0/sonic_platform/sfp.py +++ b/device/accton/x86_64-accton_as7116_54x-r0/sonic_platform/sfp.py @@ -698,7 +698,7 @@ def get_qsfp_transceiver_bulk_status(self): qsfp_dom_capability_raw = self.__read_eeprom_specific_bytes( (offset_xcvr + XCVR_DOM_CAPABILITY_OFFSET), XCVR_DOM_CAPABILITY_WIDTH) if qsfp_dom_capability_raw is not None: - qspf_dom_capability_data = sfpi_obj.parse_qsfp_dom_capability( + qspf_dom_capability_data = sfpi_obj.parse_dom_capability( qsfp_dom_capability_raw, 0) else: return None diff --git a/device/accton/x86_64-accton_as7312_54x-r0/sonic_platform/__init__.py b/device/accton/x86_64-accton_as7312_54x-r0/sonic_platform/__init__.py new file mode 100644 index 000000000000..43435472a423 --- /dev/null +++ b/device/accton/x86_64-accton_as7312_54x-r0/sonic_platform/__init__.py @@ -0,0 +1,2 @@ +__all__ = ['chassis', 'eeprom', 'platform', 'psu', 'sfp', 'thermal', 'fan'] +from . import platform diff --git a/device/accton/x86_64-accton_as7312_54x-r0/sonic_platform/chassis.py b/device/accton/x86_64-accton_as7312_54x-r0/sonic_platform/chassis.py new file mode 100644 index 000000000000..ceece0f9db83 --- /dev/null +++ b/device/accton/x86_64-accton_as7312_54x-r0/sonic_platform/chassis.py @@ -0,0 +1,193 @@ +############################################################################# +# Edgecore +# +# Module contains an implementation of SONiC Platform Base API and +# provides the Chassis information which are available in the platform +# +############################################################################# + +import os + +try: + from sonic_platform_base.chassis_base import ChassisBase + from .helper import APIHelper +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +NUM_FAN_TRAY = 6 +NUM_FAN = 2 +NUM_PSU = 2 +NUM_THERMAL = 4 +PORT_END = 54 +NUM_COMPONENT = 4 +HOST_REBOOT_CAUSE_PATH = "/host/reboot-cause/" +PMON_REBOOT_CAUSE_PATH = "/usr/share/sonic/platform/api_files/reboot-cause/" +REBOOT_CAUSE_FILE = "reboot-cause.txt" +PREV_REBOOT_CAUSE_FILE = "previous-reboot-cause.txt" +HOST_CHK_CMD = "docker > /dev/null 2>&1" + + +class Chassis(ChassisBase): + """Platform-specific Chassis class""" + + def __init__(self): + ChassisBase.__init__(self) + self._api_helper = APIHelper() + self._api_helper = APIHelper() + self.is_host = self._api_helper.is_host() + + self.config_data = {} + + self.__initialize_fan() + self.__initialize_psu() + self.__initialize_thermals() + self.__initialize_components() + self.__initialize_sfp() + self.__initialize_eeprom() + + def __initialize_sfp(self): + from sonic_platform.sfp import Sfp + for index in range(0, PORT_END): + sfp = Sfp(index) + self._sfp_list.append(sfp) + self.sfp_module_initialized = True + + def __initialize_fan(self): + from sonic_platform.fan import Fan + for fant_index in range(0, NUM_FAN_TRAY): + for fan_index in range(0, NUM_FAN): + fan = Fan(fant_index, fan_index) + self._fan_list.append(fan) + + def __initialize_psu(self): + from sonic_platform.psu import Psu + for index in range(0, NUM_PSU): + psu = Psu(index) + self._psu_list.append(psu) + + def __initialize_thermals(self): + from sonic_platform.thermal import Thermal + for index in range(0, NUM_THERMAL): + thermal = Thermal(index) + self._thermal_list.append(thermal) + + def __initialize_eeprom(self): + from sonic_platform.eeprom import Tlv + self._eeprom = Tlv() + + def __initialize_components(self): + from sonic_platform.component import Component + for index in range(0, NUM_COMPONENT): + component = Component(index) + self._component_list.append(component) + + def __initialize_watchdog(self): + from sonic_platform.watchdog import Watchdog + self._watchdog = Watchdog() + + + def __is_host(self): + return os.system(HOST_CHK_CMD) == 0 + + def __read_txt_file(self, file_path): + try: + with open(file_path, 'r') as fd: + data = fd.read() + return data.strip() + except IOError: + pass + return None + + def get_name(self): + """ + Retrieves the name of the device + Returns: + string: The name of the device + """ + + return self._api_helper.hwsku + + def get_presence(self): + """ + Retrieves the presence of the Chassis + Returns: + bool: True if Chassis is present, False if not + """ + return True + + def get_status(self): + """ + Retrieves the operational status of the device + Returns: + A boolean value, True if device is operating properly, False if not + """ + return True + + def get_base_mac(self): + """ + Retrieves the base MAC address for the chassis + Returns: + A string containing the MAC address in the format + 'XX:XX:XX:XX:XX:XX' + """ + return self._eeprom.get_mac() + + def get_serial_number(self): + """ + Retrieves the hardware serial number for the chassis + Returns: + A string containing the hardware serial number for this chassis. + """ + return self._eeprom.get_serial() + + def get_system_eeprom_info(self): + """ + Retrieves the full content of system EEPROM information for the chassis + Returns: + A dictionary where keys are the type code defined in + OCP ONIE TlvInfo EEPROM format and values are their corresponding + values. + """ + return self._eeprom.get_eeprom() + + def get_reboot_cause(self): + """ + Retrieves the cause of the previous reboot + + Returns: + A tuple (string, string) where the first element is a string + containing the cause of the previous reboot. This string must be + one of the predefined strings in this class. If the first string + is "REBOOT_CAUSE_HARDWARE_OTHER", the second string can be used + to pass a description of the reboot cause. + """ + + reboot_cause_path = (HOST_REBOOT_CAUSE_PATH + REBOOT_CAUSE_FILE) + sw_reboot_cause = self._api_helper.read_txt_file( + reboot_cause_path) or "Unknown" + + + return ('REBOOT_CAUSE_NON_HARDWARE', sw_reboot_cause) + + def get_sfp(self, index): + """ + Retrieves sfp represented by (1-based) index + Args: + index: An integer, the index (1-based) of the sfp to retrieve. + The index should be the sequence of a physical port in a chassis, + starting from 1. + For example, 1 for Ethernet0, 2 for Ethernet4 and so on. + Returns: + An object dervied from SfpBase representing the specified sfp + """ + sfp = None + if not self.sfp_module_initialized: + self.__initialize_sfp() + + try: + # The index will start from 1 + sfp = self._sfp_list[index-1] + except IndexError: + sys.stderr.write("SFP index {} out of range (1-{})\n".format( + index, len(self._sfp_list))) + return sfp diff --git a/device/accton/x86_64-accton_as7312_54x-r0/sonic_platform/component.py b/device/accton/x86_64-accton_as7312_54x-r0/sonic_platform/component.py new file mode 100644 index 000000000000..5300e1e73233 --- /dev/null +++ b/device/accton/x86_64-accton_as7312_54x-r0/sonic_platform/component.py @@ -0,0 +1,125 @@ +############################################################################# +# Celestica +# +# Component contains an implementation of SONiC Platform Base API and +# provides the components firmware management function +# +############################################################################# + +import shlex +import subprocess + +try: + from sonic_platform_base.component_base import ComponentBase + from .helper import APIHelper +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +CPLD_ADDR_MAPPING = { + "CPLD1": "4-0060", + "CPLD2": "5-0062", + "CPLD3": "6-0064", +} +SYSFS_PATH = "/sys/bus/i2c/devices/" +BIOS_VERSION_PATH = "/sys/class/dmi/id/bios_version" +COMPONENT_LIST= [ + ("CPLD1", "CPLD 1"), + ("CPLD2", "CPLD 2"), + ("CPLD3", "CPLD 3"), + ("BIOS", "Basic Input/Output System") + +] +COMPONENT_DES_LIST = ["CPLD","Basic Input/Output System"] + + +class Component(ComponentBase): + """Platform-specific Component class""" + + DEVICE_TYPE = "component" + + def __init__(self, component_index=0): + self._api_helper=APIHelper() + ComponentBase.__init__(self) + self.index = component_index + self.name = self.get_name() + + def __run_command(self, command): + # Run bash command and print output to stdout + try: + process = subprocess.Popen( + shlex.split(command), stdout=subprocess.PIPE) + while True: + output = process.stdout.readline() + if output == '' and process.poll() is not None: + break + rc = process.poll() + if rc != 0: + return False + except Exception: + return False + return True + + def __get_bios_version(self): + # Retrieves the BIOS firmware version + try: + with open(BIOS_VERSION_PATH, 'r') as fd: + bios_version = fd.read() + return bios_version.strip() + except Exception as e: + return None + + def __get_cpld_version(self): + # Retrieves the CPLD firmware version + cpld_version = dict() + for cpld_name in CPLD_ADDR_MAPPING: + try: + cpld_path = "{}{}{}".format(SYSFS_PATH, CPLD_ADDR_MAPPING[cpld_name], '/version') + cpld_version_raw= self._api_helper.read_txt_file(cpld_path) + cpld_version[cpld_name] = "{}".format(int(cpld_version_raw,16)) + except Exception as e: + print('Get exception when read cpld') + cpld_version[cpld_name] = 'None' + + return cpld_version + + def get_name(self): + """ + Retrieves the name of the component + Returns: + A string containing the name of the component + """ + return COMPONENT_LIST[self.index][0] + + def get_description(self): + """ + Retrieves the description of the component + Returns: + A string containing the description of the component + """ + return COMPONENT_LIST[self.index][1] + #return "testhwsku" + + def get_firmware_version(self): + """ + Retrieves the firmware version of module + Returns: + string: The firmware versions of the module + """ + fw_version = None + if self.name == "BIOS": + fw_version = self.__get_bios_version() + elif "CPLD" in self.name: + cpld_version = self.__get_cpld_version() + fw_version = cpld_version.get(self.name) + + return fw_version + + def install_firmware(self, image_path): + """ + Install firmware to module + Args: + image_path: A string, path to firmware image + Returns: + A boolean, True if install successfully, False if not + """ + raise NotImplementedError diff --git a/device/accton/x86_64-accton_as7312_54x-r0/sonic_platform/eeprom.py b/device/accton/x86_64-accton_as7312_54x-r0/sonic_platform/eeprom.py new file mode 100644 index 000000000000..1b2f3f276c3e --- /dev/null +++ b/device/accton/x86_64-accton_as7312_54x-r0/sonic_platform/eeprom.py @@ -0,0 +1,102 @@ +try: + import os + import sys + import re + if sys.version_info[0] >= 3: + from io import StringIO + else: + from cStringIO import StringIO + + from sonic_platform_base.sonic_eeprom import eeprom_tlvinfo +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +CACHE_ROOT = '/var/cache/sonic/decode-syseeprom' +CACHE_FILE = 'syseeprom_cache' + + +class Tlv(eeprom_tlvinfo.TlvInfoDecoder): + + EEPROM_DECODE_HEADLINES = 6 + + def __init__(self): + self._eeprom_path = "/sys/bus/i2c/devices/0-0057/eeprom" + super(Tlv, self).__init__(self._eeprom_path, 0, '', True) + self._eeprom = self._load_eeprom() + + def __parse_output(self, decode_output): + decode_output.replace('\0', '') + lines = decode_output.split('\n') + lines = lines[self.EEPROM_DECODE_HEADLINES:] + _eeprom_info_dict = dict() + + for line in lines: + try: + match = re.search( + '(0x[0-9a-fA-F]{2})([\s]+[\S]+[\s]+)([\S]+)', line) + if match is not None: + idx = match.group(1) + value = match.group(3).rstrip('\0') + + _eeprom_info_dict[idx] = value + except Exception: + pass + + return _eeprom_info_dict + + def _load_eeprom(self): + original_stdout = sys.stdout + sys.stdout = StringIO() + try: + self.read_eeprom_db() + except Exception: + decode_output = sys.stdout.getvalue() + sys.stdout = original_stdout + return self.__parse_output(decode_output) + + status = self.check_status() + if 'ok' not in status: + return False + + if not os.path.exists(CACHE_ROOT): + try: + os.makedirs(CACHE_ROOT) + except Exception: + pass + + # + # only the eeprom classes that inherit from eeprom_base + # support caching. Others will work normally + # + try: + self.set_cache_name(os.path.join(CACHE_ROOT, CACHE_FILE)) + except Exception: + pass + + e = self.read_eeprom() + if e is None: + return 0 + + try: + self.update_cache(e) + except Exception: + pass + + self.decode_eeprom(e) + decode_output = sys.stdout.getvalue() + sys.stdout = original_stdout + + (is_valid, valid_crc) = self.is_checksum_valid(e) + if not is_valid: + return False + + return self.__parse_output(decode_output) + + def get_eeprom(self): + return self._eeprom + + def get_serial(self): + return self._eeprom.get('0x23', "Undefined.") + + def get_mac(self): + return self._eeprom.get('0x24', "Undefined.") diff --git a/device/accton/x86_64-accton_as7312_54x-r0/sonic_platform/fan.py b/device/accton/x86_64-accton_as7312_54x-r0/sonic_platform/fan.py new file mode 100644 index 000000000000..fc072941a3d3 --- /dev/null +++ b/device/accton/x86_64-accton_as7312_54x-r0/sonic_platform/fan.py @@ -0,0 +1,177 @@ +############################################################################# +# Edgecore +# +# Module contains an implementation of SONiC Platform Base API and +# provides the fan status which are available in the platform +# +############################################################################# + + +try: + from sonic_platform_base.fan_base import FanBase + from .helper import APIHelper +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +PSU_FAN_MAX_RPM = 26688 + +CPLD_I2C_PATH = "/sys/bus/i2c/devices/2-0066/fan" +PSU_HWMON_I2C_PATH ="/sys/bus/i2c/devices/{}-00{}/" +PSU_I2C_MAPPING = { + 0: { + "num": 11, + "addr": "5b" + }, + 1: { + "num": 10, + "addr": "58" + }, +} + + +class Fan(FanBase): + """Platform-specific Fan class""" + + def __init__(self, fan_tray_index, fan_index=0, is_psu_fan=False, psu_index=0): + self._api_helper=APIHelper() + self.fan_index = fan_index + self.fan_tray_index = fan_tray_index + self.is_psu_fan = is_psu_fan + if self.is_psu_fan: + self.psu_index = psu_index + self.psu_i2c_num = PSU_I2C_MAPPING[self.psu_index]['num'] + self.psu_i2c_addr = PSU_I2C_MAPPING[self.psu_index]['addr'] + self.psu_hwmon_path = PSU_HWMON_I2C_PATH.format( + self.psu_i2c_num, self.psu_i2c_addr) + + FanBase.__init__(self) + + + def get_direction(self): + """ + Retrieves the direction of fan + Returns: + A string, either FAN_DIRECTION_INTAKE or FAN_DIRECTION_EXHAUST + depending on fan direction + """ + + + if not self.is_psu_fan: + dir_str = "{}{}{}".format(CPLD_I2C_PATH, self.fan_tray_index, '_direction') + val=self._api_helper.read_txt_file(dir_str) + if val is not None: + if val==0:#F2B + direction=self.FAN_DIRECTION_EXHAUST + else: + direction=self.FAN_DIRECTION_INTAKE + else: + direction=self.FAN_DIRECTION_EXHAUST + + else: #For PSU + dir_str = "{}{}".format(self.psu_hwmon_path,'psu_hwmon_path') + val=self._api_helper.read_txt_file(dir_str) + if val is not None: + if val=='F2B': + direction=self.FAN_DIRECTION_EXHAUST + else: + direction=self.FAN_DIRECTION_INTAKE + else: + direction=self.FAN_DIRECTION_EXHAUST + + return direction + + def get_speed(self): + """ + Retrieves the speed of fan as a percentage of full speed + Returns: + An integer, the percentage of full fan speed, in the range 0 (off) + to 100 (full speed) + + """ + speed = 0 + if self.is_psu_fan: + psu_fan_path= "{}{}".format(self.psu_hwmon_path, 'psu_fan1_speed_rpm') + fan_speed_rpm = self._api_helper.read_txt_file(psu_fan_path) + if fan_speed_rpm is not None: + speed = (int(fan_speed_rpm,10))*100/26688 + if speed > 100: + speed=100 + else: + return 0 + + elif self.get_presence(): + speed_path = "{}{}".format(CPLD_I2C_PATH, '_duty_cycle_percentage') + speed=self._api_helper.read_txt_file(speed_path) + if speed is None: + return 0 + + return int(speed) + + def get_target_speed(self): + """ + Retrieves the target (expected) speed of the fan + Returns: + An integer, the percentage of full fan speed, in the range 0 (off) + to 100 (full speed) + + Note: + speed_pc = pwm_target/255*100 + + 0 : when PWM mode is use + pwm : when pwm mode is not use + """ + return False #Not supported + + def get_speed_tolerance(self): + """ + Retrieves the speed tolerance of the fan + Returns: + An integer, the percentage of variance from target speed which is + considered tolerable + """ + return False #Not supported + + def set_speed(self, speed): + """ + Sets the fan speed + Args: + speed: An integer, the percentage of full fan speed to set fan to, + in the range 0 (off) to 100 (full speed) + Returns: + A boolean, True if speed is set successfully, False if not + + """ + + if not self.is_psu_fan and self.get_presence(): + speed_path = "{}{}".format(CPLD_I2C_PATH, '_duty_cycle_percentage') + return self._api_helper.write_txt_file(speed_path, int(speed)) + + return False + + def set_status_led(self, color): + """ + Sets the state of the fan module status LED + Args: + color: A string representing the color with which to set the + fan module status LED + Returns: + bool: True if status LED state is set successfully, False if not + """ + return False #Not supported + + def get_presence(self): + """ + Retrieves the presence of the FAN + Returns: + bool: True if FAN is present, False if not + """ + present_path = "{}{}{}".format(CPLD_I2C_PATH, self.fan_tray_index+1, '_present') + val=self._api_helper.read_txt_file(present_path) + + if not self.is_psu_fan: + if val is not None: + return int(val, 10)==1 + else: + return False + else: + return True diff --git a/device/accton/x86_64-accton_as7312_54x-r0/sonic_platform/helper.py b/device/accton/x86_64-accton_as7312_54x-r0/sonic_platform/helper.py new file mode 100644 index 000000000000..4cd60ac90611 --- /dev/null +++ b/device/accton/x86_64-accton_as7312_54x-r0/sonic_platform/helper.py @@ -0,0 +1,117 @@ +import os +import struct +import subprocess +from mmap import * +from sonic_py_common import device_info + +HOST_CHK_CMD = "docker > /dev/null 2>&1" +EMPTY_STRING = "" + + +class APIHelper(): + + def __init__(self): + (self.platform, self.hwsku) = device_info.get_platform_and_hwsku() + + def is_host(self): + return os.system(HOST_CHK_CMD) == 0 + + def pci_get_value(self, resource, offset): + status = True + result = "" + try: + fd = os.open(resource, os.O_RDWR) + mm = mmap(fd, 0) + mm.seek(int(offset)) + read_data_stream = mm.read(4) + result = struct.unpack('I', read_data_stream) + except Exception: + status = False + return status, result + + def run_command(self, cmd): + status = True + result = "" + try: + p = subprocess.Popen( + cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + raw_data, err = p.communicate() + if err == '': + result = raw_data.strip() + except Exception: + status = False + return status, result + + def run_interactive_command(self, cmd): + try: + os.system(cmd) + except Exception: + return False + return True + + def read_txt_file(self, file_path): + try: + with open(file_path, 'r') as fd: + data = fd.read() + return data.strip() + except IOError: + pass + return None + + def write_txt_file(self, file_path, value): + try: + with open(file_path, 'w') as fd: + fd.write(str(value)) + except IOError: + return False + return True + + def ipmi_raw(self, netfn, cmd): + status = True + result = "" + try: + cmd = "ipmitool raw {} {}".format(str(netfn), str(cmd)) + p = subprocess.Popen( + cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + raw_data, err = p.communicate() + if err == '': + result = raw_data.strip() + else: + status = False + except Exception: + status = False + return status, result + + def ipmi_fru_id(self, id, key=None): + status = True + result = "" + try: + cmd = "ipmitool fru print {}".format(str( + id)) if not key else "ipmitool fru print {0} | grep '{1}' ".format(str(id), str(key)) + + p = subprocess.Popen( + cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + raw_data, err = p.communicate() + if err == '': + result = raw_data.strip() + else: + status = False + except Exception: + status = False + return status, result + + def ipmi_set_ss_thres(self, id, threshold_key, value): + status = True + result = "" + try: + cmd = "ipmitool sensor thresh '{}' {} {}".format(str(id), str(threshold_key), str(value)) + p = subprocess.Popen( + cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + raw_data, err = p.communicate() + if err == '': + result = raw_data.strip() + else: + status = False + except Exception: + status = False + return status, result diff --git a/device/accton/x86_64-accton_as7312_54x-r0/sonic_platform/platform.py b/device/accton/x86_64-accton_as7312_54x-r0/sonic_platform/platform.py new file mode 100644 index 000000000000..2f2c2a447fcf --- /dev/null +++ b/device/accton/x86_64-accton_as7312_54x-r0/sonic_platform/platform.py @@ -0,0 +1,21 @@ +############################################################################# +# Edgecore +# +# Module contains an implementation of SONiC Platform Base API and +# provides the platform information +# +############################################################################# + +try: + from sonic_platform_base.platform_base import PlatformBase + from sonic_platform.chassis import Chassis +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class Platform(PlatformBase): + """Platform-specific Platform class""" + + def __init__(self): + PlatformBase.__init__(self) + self._chassis = Chassis() diff --git a/device/accton/x86_64-accton_as7312_54x-r0/sonic_platform/psu.py b/device/accton/x86_64-accton_as7312_54x-r0/sonic_platform/psu.py new file mode 100644 index 000000000000..cb715515d50e --- /dev/null +++ b/device/accton/x86_64-accton_as7312_54x-r0/sonic_platform/psu.py @@ -0,0 +1,220 @@ +############################################################################# +# Edgecore +# +# Module contains an implementation of SONiC Platform Base API and +# provides the PSUs status which are available in the platform +# +############################################################################# + +#import sonic_platform + +try: + from sonic_platform_base.psu_base import PsuBase + from .helper import APIHelper +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +I2C_PATH ="/sys/bus/i2c/devices/{0}-00{1}/" + +PSU_NAME_LIST = ["PSU-1", "PSU-2"] +PSU_NUM_FAN = [1, 1] +PSU_HWMON_I2C_MAPPING = { + 0: { + "num": 11, + "addr": "5b" + }, + 1: { + "num": 10, + "addr": "58" + }, +} + +PSU_CPLD_I2C_MAPPING = { + 0: { + "num": 11, + "addr": "53" + }, + 1: { + "num": 10, + "addr": "50" + }, +} + +class Psu(PsuBase): + """Platform-specific Psu class""" + + def __init__(self, psu_index=0): + PsuBase.__init__(self) + self.index = psu_index + self._api_helper = APIHelper() + + self.i2c_num = PSU_HWMON_I2C_MAPPING[self.index]["num"] + self.i2c_addr = PSU_HWMON_I2C_MAPPING[self.index]["addr"] + self.hwmon_path = I2C_PATH.format(self.i2c_num, self.i2c_addr) + + self.i2c_num = PSU_CPLD_I2C_MAPPING[self.index]["num"] + self.i2c_addr = PSU_CPLD_I2C_MAPPING[self.index]["addr"] + self.cpld_path = I2C_PATH.format(self.i2c_num, self.i2c_addr) + self.__initialize_fan() + + def __initialize_fan(self): + from sonic_platform.fan import Fan + for fan_index in range(0, PSU_NUM_FAN[self.index]): + fan = Fan(fan_index, 0, is_psu_fan=True, psu_index=self.index) + self._fan_list.append(fan) + + def get_voltage(self): + """ + Retrieves current PSU voltage output + Returns: + A float number, the output voltage in volts, + e.g. 12.1 + """ + vout_path = "{}{}".format(self.hwmon_path, 'psu_v_out') + vout_val=self._api_helper.read_txt_file(vout_path) + return float(vout_val)/ 1000 + + def get_current(self): + """ + Retrieves present electric current supplied by PSU + Returns: + A float number, the electric current in amperes, e.g 15.4 + """ + iout_path = "{}{}".format(self.hwmon_path, 'psu_i_out') + val=self._api_helper.read_txt_file(iout_path) + if val is not None: + return float(val)/1000 + else: + return 0 + + def get_power(self): + """ + Retrieves current energy supplied by PSU + Returns: + A float number, the power in watts, e.g. 302.6 + """ + pout_path = "{}{}".format(self.hwmon_path, 'psu_p_out') + val=self._api_helper.read_txt_file(pout_path) + if val is not None: + return float(val)/1000 + else: + return 0 + + def get_powergood_status(self): + """ + Retrieves the powergood status of PSU + Returns: + A boolean, True if PSU has stablized its output voltages and passed all + its internal self-tests, False if not. + """ + return self.get_status() + + def set_status_led(self, color): + """ + Sets the state of the PSU status LED + Args: + color: A string representing the color with which to set the PSU status LED + Note: Only support green and off + Returns: + bool: True if status LED state is set successfully, False if not + """ + + return False #Controlled by HW + + def get_status_led(self): + """ + Gets the state of the PSU status LED + Returns: + A string, one of the predefined STATUS_LED_COLOR_* strings above + """ + + if self.get_status(): + return True + else: + return False + + def get_temperature(self): + """ + Retrieves current temperature reading from PSU + Returns: + A float number of current temperature in Celsius up to nearest thousandth + of one degree Celsius, e.g. 30.125 + """ + temp_path = "{}{}".format(self.hwmon_path, 'psu_temp1_input') + val=self._api_helper.read_txt_file(temp_path) + if val is not None: + return float(val)/1000 + else: + return 0 + + def get_temperature_high_threshold(self): + """ + Retrieves the high threshold temperature of PSU + Returns: + A float number, the high threshold temperature of PSU in Celsius + up to nearest thousandth of one degree Celsius, e.g. 30.125 + """ + return False #Not supported + + def get_voltage_high_threshold(self): + """ + Retrieves the high threshold PSU voltage output + Returns: + A float number, the high threshold output voltage in volts, + e.g. 12.1 + """ + vout_path = "{}{}".format(self.hwmon_path, 'psu_mfr_vout_max') + vout_val=self._api_helper.read_txt_file(vout_path) + if vout_val is not None: + return float(vout_val)/ 1000 + else: + return 0 + + def get_voltage_low_threshold(self): + """ + Retrieves the low threshold PSU voltage output + Returns: + A float number, the low threshold output voltage in volts, + e.g. 12.1 + """ + vout_path = "{}{}".format(self.hwmon_path, 'psu_mfr_vout_min') + vout_val=self._api_helper.read_txt_file(vout_path) + if vout_val is not None: + return float(vout_val)/ 1000 + else: + return 0 + + def get_name(self): + """ + Retrieves the name of the device + Returns: + string: The name of the device + """ + return PSU_NAME_LIST[self.index] + + def get_presence(self): + """ + Retrieves the presence of the PSU + Returns: + bool: True if PSU is present, False if not + """ + presence_path="{}{}".format(self.cpld_path, 'psu_present') + val=self._api_helper.read_txt_file(presence_path) + if val is not None: + return int(val, 10) == 1 + else: + return 0 + + def get_status(self): + """ + Retrieves the operational status of the device + Returns: + A boolean value, True if device is operating properly, False if not + """ + power_path="{}{}".format(self.cpld_path, 'psu_power_good') + val=self._api_helper.read_txt_file(power_path) + if val is not None: + return int(val, 10) == 1 + else: + return 0 diff --git a/device/accton/x86_64-accton_as7312_54x-r0/sonic_platform/sfp.py b/device/accton/x86_64-accton_as7312_54x-r0/sonic_platform/sfp.py new file mode 100644 index 000000000000..b5e38017bc90 --- /dev/null +++ b/device/accton/x86_64-accton_as7312_54x-r0/sonic_platform/sfp.py @@ -0,0 +1,1228 @@ +############################################################################# +# Edgecore +# +# Sfp contains an implementation of SONiC Platform Base API and +# provides the sfp device status which are available in the platform +# +############################################################################# + +import os +import time +import sys + +from ctypes import create_string_buffer + +try: + from sonic_platform_base.sfp_base import SfpBase + from sonic_platform_base.sonic_sfp.sff8436 import sff8436Dom + from sonic_platform_base.sonic_sfp.sff8436 import sff8436InterfaceId + from sonic_platform_base.sonic_sfp.sff8472 import sff8472Dom + from sonic_platform_base.sonic_sfp.sff8472 import sff8472InterfaceId + #from sonic_platform_base.sonic_sfp.sff8472 import sffbase + from sonic_platform_base.sonic_sfp.sfputilhelper import SfpUtilHelper + from .helper import APIHelper +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +CPLD_I2C_PATH = "/sys/bus/i2c/devices/" + +QSFP_INFO_OFFSET = 128 +QSFP_DOM_OFFSET = 0 + +SFP_INFO_OFFSET = 0 +SFP_DOM_OFFSET = 256 + +XCVR_INTFACE_BULK_OFFSET = 0 +XCVR_INTFACE_BULK_WIDTH_QSFP = 20 +XCVR_INTFACE_BULK_WIDTH_SFP = 21 +XCVR_HW_REV_WIDTH_QSFP = 2 +XCVR_HW_REV_WIDTH_SFP = 4 +XCVR_CABLE_LENGTH_WIDTH_QSFP = 5 +XCVR_VENDOR_NAME_OFFSET = 20 +XCVR_VENDOR_NAME_WIDTH = 16 +XCVR_VENDOR_OUI_OFFSET = 37 +XCVR_VENDOR_OUI_WIDTH = 3 +XCVR_VENDOR_PN_OFFSET = 40 +XCVR_VENDOR_PN_WIDTH = 16 +XCVR_HW_REV_OFFSET = 56 +XCVR_HW_REV_WIDTH_OSFP = 2 +XCVR_HW_REV_WIDTH_SFP = 4 +XCVR_VENDOR_SN_OFFSET = 68 +XCVR_VENDOR_SN_WIDTH = 16 +XCVR_VENDOR_DATE_OFFSET = 84 +XCVR_VENDOR_DATE_WIDTH = 8 +XCVR_DOM_CAPABILITY_OFFSET = 92 +XCVR_DOM_CAPABILITY_WIDTH = 1 + +# Offset for values in QSFP eeprom +QSFP_DOM_REV_OFFSET = 1 +QSFP_DOM_REV_WIDTH = 1 +QSFP_TEMPE_OFFSET = 22 +QSFP_TEMPE_WIDTH = 2 +QSFP_VOLT_OFFSET = 26 +QSFP_VOLT_WIDTH = 2 +QSFP_CHANNL_MON_OFFSET = 34 +QSFP_CHANNL_MON_WIDTH = 16 +QSFP_CHANNL_MON_WITH_TX_POWER_WIDTH = 24 +QSFP_CONTROL_OFFSET = 86 +QSFP_CONTROL_WIDTH = 8 +QSFP_CHANNL_RX_LOS_STATUS_OFFSET = 3 +QSFP_CHANNL_RX_LOS_STATUS_WIDTH = 1 +QSFP_CHANNL_TX_FAULT_STATUS_OFFSET = 4 +QSFP_CHANNL_TX_FAULT_STATUS_WIDTH = 1 +QSFP_POWEROVERRIDE_OFFSET = 93 +QSFP_POWEROVERRIDE_WIDTH = 1 +QSFP_MODULE_THRESHOLD_OFFSET = 128 +QSFP_MODULE_THRESHOLD_WIDTH = 24 +QSFP_CHANNEL_THRESHOLD_OFFSET = 176 +QSFP_CHANNEL_THRESHOLD_WIDTH = 16 + +qsfp_cable_length_tup = ('Length(km)', 'Length OM3(2m)', + 'Length OM2(m)', 'Length OM1(m)', + 'Length Cable Assembly(m)') + +qsfp_compliance_code_tup = ('10/40G Ethernet Compliance Code', 'SONET Compliance codes', + 'SAS/SATA compliance codes', 'Gigabit Ethernet Compliant codes', + 'Fibre Channel link length/Transmitter Technology', + 'Fibre Channel transmission media', 'Fibre Channel Speed') + + +# Offset for values in SFP eeprom +SFP_TEMPE_OFFSET = 96 +SFP_TEMPE_WIDTH = 2 +SFP_VOLT_OFFSET = 98 +SFP_VOLT_WIDTH = 2 +SFP_CHANNL_MON_OFFSET = 100 +SFP_CHANNL_MON_WIDTH = 6 +SFP_MODULE_THRESHOLD_OFFSET = 0 +SFP_MODULE_THRESHOLD_WIDTH = 40 +SFP_CHANNL_THRESHOLD_OFFSET = 112 +SFP_CHANNL_THRESHOLD_WIDTH = 2 +SFP_STATUS_CONTROL_OFFSET = 110 +SFP_STATUS_CONTROL_WIDTH = 1 +SFP_TX_DISABLE_HARD_BIT = 7 +SFP_TX_DISABLE_SOFT_BIT = 6 + +sfp_cable_length_tup = ('LengthSMFkm-UnitsOfKm', 'LengthSMF(UnitsOf100m)', + 'Length50um(UnitsOf10m)', 'Length62.5um(UnitsOfm)', + 'LengthCable(UnitsOfm)', 'LengthOM3(UnitsOf10m)') + +sfp_compliance_code_tup = ('10GEthernetComplianceCode', 'InfinibandComplianceCode', + 'ESCONComplianceCodes', 'SONETComplianceCodes', + 'EthernetComplianceCodes', 'FibreChannelLinkLength', + 'FibreChannelTechnology', 'SFP+CableTechnology', + 'FibreChannelTransmissionMedia', 'FibreChannelSpeed') + + +class Sfp(SfpBase): + """Platform-specific Sfp class""" + + # Port number + PORT_START = 1 + PORT_END = 54 + QSFP_PORT_START = 49 + + # Path to sysfs + PLATFORM_ROOT_PATH = "/usr/share/sonic/device" + PMON_HWSKU_PATH = "/usr/share/sonic/hwsku" + HOST_CHK_CMD = "docker > /dev/null 2>&1" + + PLATFORM = "x86_64-accton_as7312_54x-r0" + HWSKU = "Accton-AS7312-54X" + + _cpld_mapping = { + 0: "4-0060", + 1: "5-0062", + 2: "6-0064", + } + _port_to_i2c_mapping = { + 1: 18, + 2: 19, + 3: 20, + 4: 21, + 5: 22, + 6: 23, + 7: 24, + 8: 25, + 9: 26, + 10: 27, + 11: 28, + 12: 29, + 13: 30, + 14: 31, + 15: 32, + 16: 33, + 17: 34, + 18: 35, + 19: 36, + 20: 37, + 21: 38, + 22: 39, + 23: 40, + 24: 41, + 25: 42, + 26: 43, + 27: 44, + 28: 45, + 29: 46, + 30: 47, + 31: 48, + 32: 49, + 33: 50, + 34: 51, + 35: 52, + 36: 53, + 37: 54, + 38: 55, + 39: 56, + 40: 57, + 41: 58, + 42: 59, + 43: 60, + 44: 61, + 45: 62, + 46: 63, + 47: 64, + 48: 65, + 49: 66, # QSFP49 + 50: 67, + 51: 68, + 52: 69, + 53: 70, + 54: 71, # QSFP54 + } + + + def __init__(self, sfp_index=0): + self._api_helper=APIHelper() + # Init index + self.index = sfp_index + self.port_num = self.index + 1 + + # Init eeprom path + eeprom_path = '/sys/bus/i2c/devices/{0}-0050/eeprom' + self.port_to_eeprom_mapping = {} + for x in range(self.PORT_START, self.PORT_END + 1): + self.port_to_eeprom_mapping[x] = eeprom_path.format(self._port_to_i2c_mapping[x]) + + self.info_dict_keys = ['type', 'hardware_rev', 'serial', 'manufacturer', 'model', 'connector', 'encoding', 'ext_identifier', + 'ext_rateselect_compliance', 'cable_type', 'cable_length', 'nominal_bit_rate', 'specification_compliance', 'vendor_date', 'vendor_oui'] + + self.dom_dict_keys = ['rx_los', 'tx_fault', 'reset_status', 'power_lpmode', 'tx_disable', 'tx_disable_channel', 'temperature', 'voltage', + 'rx1power', 'rx2power', 'rx3power', 'rx4power', 'tx1bias', 'tx2bias', 'tx3bias', 'tx4bias', 'tx1power', 'tx2power', 'tx3power', 'tx4power'] + + self.threshold_dict_keys = ['temphighalarm', 'temphighwarning', 'templowalarm', 'templowwarning', 'vcchighalarm', 'vcchighwarning', 'vcclowalarm', 'vcclowwarning', 'rxpowerhighalarm', 'rxpowerhighwarning', + 'rxpowerlowalarm', 'rxpowerlowwarning', 'txpowerhighalarm', 'txpowerhighwarning', 'txpowerlowalarm', 'txpowerlowwarning', 'txbiashighalarm', 'txbiashighwarning', 'txbiaslowalarm', 'txbiaslowwarning'] + + SfpBase.__init__(self) + + def __get_cpld_num(self, port_num): + cpld_i = 1 + if (port_num > 24 and port_num < self.QSFP_PORT_START): + cpld_i = 2 + + if (port_num > 52): + cpld_i = 2 + + return cpld_i + + + def _convert_string_to_num(self, value_str): + if "-inf" in value_str: + return 'N/A' + elif "Unknown" in value_str: + return 'N/A' + elif 'dBm' in value_str: + t_str = value_str.rstrip('dBm') + return float(t_str) + elif 'mA' in value_str: + t_str = value_str.rstrip('mA') + return float(t_str) + elif 'C' in value_str: + t_str = value_str.rstrip('C') + return float(t_str) + elif 'Volts' in value_str: + t_str = value_str.rstrip('Volts') + return float(t_str) + else: + return 'N/A' + + def __write_txt_file(self, file_path, value): + try: + with open(file_path, 'w', buffering=0) as fd: + fd.write(str(value)) + except Exception: + return False + return True + + def __is_host(self): + return os.system(self.HOST_CHK_CMD) == 0 + + def __get_path_to_port_config_file(self): + platform_path = "/".join([self.PLATFORM_ROOT_PATH, self.PLATFORM]) + hwsku_path = "/".join([platform_path, self.HWSKU] + ) if self.__is_host() else self.PMON_HWSKU_PATH + return "/".join([hwsku_path, "port_config.ini"]) + + def __read_eeprom_specific_bytes(self, offset, num_bytes): + sysfsfile_eeprom = None + eeprom_raw = [] + + for i in range(0, num_bytes): + eeprom_raw.append("0x00") + + sysfs_sfp_i2c_client_eeprom_path = self.port_to_eeprom_mapping[self.port_num] + try: + sysfsfile_eeprom = open( + sysfs_sfp_i2c_client_eeprom_path, mode="rb", buffering=0) + sysfsfile_eeprom.seek(offset) + raw = sysfsfile_eeprom.read(num_bytes) + if sys.version_info[0] >= 3: + for n in range(0, num_bytes): + eeprom_raw[n] = hex(raw[n])[2:].zfill(2) + else: + for n in range(0, num_bytes): + eeprom_raw[n] = hex(ord(raw[n]))[2:].zfill(2) + except Exception: + pass + finally: + if sysfsfile_eeprom: + sysfsfile_eeprom.close() + + return eeprom_raw + + def get_transceiver_info(self): + """ + Retrieves transceiver info of this SFP + Returns: + A dict which contains following keys/values : + ======================================================================== + keys |Value Format |Information + ---------------------------|---------------|---------------------------- + type |1*255VCHAR |type of SFP + hardware_rev |1*255VCHAR |hardware version of SFP + serial |1*255VCHAR |serial number of the SFP + manufacturer |1*255VCHAR |SFP vendor name + model |1*255VCHAR |SFP model name + connector |1*255VCHAR |connector information + encoding |1*255VCHAR |encoding information + ext_identifier |1*255VCHAR |extend identifier + ext_rateselect_compliance |1*255VCHAR |extended rateSelect compliance + cable_length |INT |cable length in m + nominal_bit_rate |INT |nominal bit rate by 100Mbs + specification_compliance |1*255VCHAR |specification compliance + vendor_date |1*255VCHAR |vendor date + vendor_oui |1*255VCHAR |vendor OUI + ======================================================================== + """ + # check present status + if self.port_num < 49: + sfpi_obj = sff8472InterfaceId() #SFP + else: + sfpi_obj = sff8436InterfaceId() #QSFP + if not self.get_presence() or not sfpi_obj: + return {} + + if self.port_num < 49: + offset = SFP_INFO_OFFSET + sfp_interface_bulk_raw = self.__read_eeprom_specific_bytes( + (offset + XCVR_INTFACE_BULK_OFFSET), XCVR_INTFACE_BULK_WIDTH_SFP) + else: + offset = QSFP_INFO_OFFSET + sfp_interface_bulk_raw = self.__read_eeprom_specific_bytes( + (offset + XCVR_INTFACE_BULK_OFFSET), XCVR_INTFACE_BULK_WIDTH_QSFP) + + sfp_interface_bulk_data = sfpi_obj.parse_sfp_info_bulk( + sfp_interface_bulk_raw, 0) + + sfp_vendor_name_raw = self.__read_eeprom_specific_bytes( + (offset + XCVR_VENDOR_NAME_OFFSET), XCVR_VENDOR_NAME_WIDTH) + sfp_vendor_name_data = sfpi_obj.parse_vendor_name( + sfp_vendor_name_raw, 0) + + sfp_vendor_pn_raw = self.__read_eeprom_specific_bytes( + (offset + XCVR_VENDOR_PN_OFFSET), XCVR_VENDOR_PN_WIDTH) + sfp_vendor_pn_data = sfpi_obj.parse_vendor_pn( + sfp_vendor_pn_raw, 0) + + if self.port_num < 49: + sfp_vendor_rev_raw = self.__read_eeprom_specific_bytes( + (offset + XCVR_HW_REV_OFFSET), XCVR_HW_REV_WIDTH_SFP) + else: + sfp_vendor_rev_raw = self.__read_eeprom_specific_bytes( + (offset + XCVR_HW_REV_OFFSET), XCVR_HW_REV_WIDTH_QSFP) + + sfp_vendor_rev_data = sfpi_obj.parse_vendor_rev( + sfp_vendor_rev_raw, 0) + + sfp_vendor_sn_raw = self.__read_eeprom_specific_bytes( + (offset + XCVR_VENDOR_SN_OFFSET), XCVR_VENDOR_SN_WIDTH) + sfp_vendor_sn_data = sfpi_obj.parse_vendor_sn( + sfp_vendor_sn_raw, 0) + + sfp_vendor_oui_raw = self.__read_eeprom_specific_bytes( + (offset + XCVR_VENDOR_OUI_OFFSET), XCVR_VENDOR_OUI_WIDTH) + if sfp_vendor_oui_raw is not None: + sfp_vendor_oui_data = sfpi_obj.parse_vendor_oui( + sfp_vendor_oui_raw, 0) + + sfp_vendor_date_raw = self.__read_eeprom_specific_bytes( + (offset + XCVR_VENDOR_DATE_OFFSET), XCVR_VENDOR_DATE_WIDTH) + sfp_vendor_date_data = sfpi_obj.parse_vendor_date( + sfp_vendor_date_raw, 0) + + transceiver_info_dict = dict.fromkeys(self.info_dict_keys, 'N/A') + compliance_code_dict = dict() + + if sfp_interface_bulk_data: + transceiver_info_dict['type'] = sfp_interface_bulk_data['data']['type']['value'] + transceiver_info_dict['connector'] = sfp_interface_bulk_data['data']['Connector']['value'] + transceiver_info_dict['encoding'] = sfp_interface_bulk_data['data']['EncodingCodes']['value'] + transceiver_info_dict['ext_identifier'] = sfp_interface_bulk_data['data']['Extended Identifier']['value'] + transceiver_info_dict['ext_rateselect_compliance'] = sfp_interface_bulk_data['data']['RateIdentifier']['value'] + transceiver_info_dict['type_abbrv_name'] = sfp_interface_bulk_data['data']['type_abbrv_name']['value'] + + transceiver_info_dict['manufacturer'] = sfp_vendor_name_data[ + 'data']['Vendor Name']['value'] if sfp_vendor_name_data else 'N/A' + transceiver_info_dict['model'] = sfp_vendor_pn_data['data']['Vendor PN']['value'] if sfp_vendor_pn_data else 'N/A' + transceiver_info_dict['hardware_rev'] = sfp_vendor_rev_data['data']['Vendor Rev']['value'] if sfp_vendor_rev_data else 'N/A' + transceiver_info_dict['serial'] = sfp_vendor_sn_data['data']['Vendor SN']['value'] if sfp_vendor_sn_data else 'N/A' + transceiver_info_dict['vendor_oui'] = sfp_vendor_oui_data['data']['Vendor OUI']['value'] if sfp_vendor_oui_data else 'N/A' + transceiver_info_dict['vendor_date'] = sfp_vendor_date_data[ + 'data']['VendorDataCode(YYYY-MM-DD Lot)']['value'] if sfp_vendor_date_data else 'N/A' + transceiver_info_dict['cable_type'] = "Unknown" + transceiver_info_dict['cable_length'] = "Unknown" + + if self.port_num < 49: + for key in sfp_cable_length_tup: + if key in sfp_interface_bulk_data['data']: + transceiver_info_dict['cable_type'] = key + transceiver_info_dict['cable_length'] = str( + sfp_interface_bulk_data['data'][key]['value']) + + for key in sfp_compliance_code_tup: + if key in sfp_interface_bulk_data['data']['Specification compliance']['value']: + compliance_code_dict[key] = sfp_interface_bulk_data['data']['Specification compliance']['value'][key]['value'] + + transceiver_info_dict['specification_compliance'] = str( + compliance_code_dict) + transceiver_info_dict['nominal_bit_rate'] = str( + sfp_interface_bulk_data['data']['NominalSignallingRate(UnitsOf100Mbd)']['value']) + else: + for key in qsfp_cable_length_tup: + if key in sfp_interface_bulk_data['data']: + transceiver_info_dict['cable_type'] = key + transceiver_info_dict['cable_length'] = str( + sfp_interface_bulk_data['data'][key]['value']) + + for key in qsfp_compliance_code_tup: + if key in sfp_interface_bulk_data['data']['Specification compliance']['value']: + compliance_code_dict[key] = sfp_interface_bulk_data['data']['Specification compliance']['value'][key]['value'] + + transceiver_info_dict['specification_compliance'] = str( + compliance_code_dict) + transceiver_info_dict['nominal_bit_rate'] = str( + sfp_interface_bulk_data['data']['Nominal Bit Rate(100Mbs)']['value']) + + + return transceiver_info_dict + + def get_transceiver_bulk_status(self): + """ + Retrieves transceiver bulk status of this SFP + Returns: + A dict which contains following keys/values : + ======================================================================== + keys |Value Format |Information + ---------------------------|---------------|---------------------------- + rx_los |BOOLEAN |RX loss-of-signal status, True if has RX los, False if not. + tx_fault |BOOLEAN |TX fault status, True if has TX fault, False if not. + reset_status |BOOLEAN |reset status, True if SFP in reset, False if not. + lp_mode |BOOLEAN |low power mode status, True in lp mode, False if not. + tx_disable |BOOLEAN |TX disable status, True TX disabled, False if not. + tx_disabled_channel |HEX |disabled TX channels in hex, bits 0 to 3 represent channel 0 + | |to channel 3. + temperature |INT |module temperature in Celsius + voltage |INT |supply voltage in mV + txbias |INT |TX Bias Current in mA, n is the channel number, + | |for example, tx2bias stands for tx bias of channel 2. + rxpower |INT |received optical power in mW, n is the channel number, + | |for example, rx2power stands for rx power of channel 2. + txpower |INT |TX output power in mW, n is the channel number, + | |for example, tx2power stands for tx power of channel 2. + ======================================================================== + """ + # check present status + if self.port_num < 49: #SFP case + sfpd_obj = sff8472Dom() + if not self.get_presence() or not sfpd_obj: + return {} + + eeprom_ifraw = self.__read_eeprom_specific_bytes(0, SFP_DOM_OFFSET) + sfpi_obj = sff8472InterfaceId(eeprom_ifraw) + cal_type = sfpi_obj.get_calibration_type() + sfpd_obj._calibration_type = cal_type + + offset = SFP_DOM_OFFSET + transceiver_dom_info_dict = dict.fromkeys(self.dom_dict_keys, 'N/A') + dom_temperature_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_TEMPE_OFFSET), SFP_TEMPE_WIDTH) + + if dom_temperature_raw is not None: + dom_temperature_data = sfpd_obj.parse_temperature( + dom_temperature_raw, 0) + transceiver_dom_info_dict['temperature'] = dom_temperature_data['data']['Temperature']['value'] + + dom_voltage_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_VOLT_OFFSET), SFP_VOLT_WIDTH) + if dom_voltage_raw is not None: + dom_voltage_data = sfpd_obj.parse_voltage(dom_voltage_raw, 0) + transceiver_dom_info_dict['voltage'] = dom_voltage_data['data']['Vcc']['value'] + + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_CHANNL_MON_OFFSET), SFP_CHANNL_MON_WIDTH) + if dom_channel_monitor_raw is not None: + dom_voltage_data = sfpd_obj.parse_channel_monitor_params( + dom_channel_monitor_raw, 0) + transceiver_dom_info_dict['tx1power'] = dom_voltage_data['data']['TXPower']['value'] + transceiver_dom_info_dict['rx1power'] = dom_voltage_data['data']['RXPower']['value'] + transceiver_dom_info_dict['tx1bias'] = dom_voltage_data['data']['TXBias']['value'] + + else: #QSFP case + sfpd_obj = sff8436Dom() + sfpi_obj = sff8436InterfaceId() + + if not self.get_presence() or not sfpi_obj or not sfpd_obj: + return {} + + transceiver_dom_info_dict = dict.fromkeys(self.dom_dict_keys, 'N/A') + offset = QSFP_DOM_OFFSET + offset_xcvr = QSFP_INFO_OFFSET + + # QSFP capability byte parse, through this byte can know whether it support tx_power or not. + # TODO: in the future when decided to migrate to support SFF-8636 instead of SFF-8436, + # need to add more code for determining the capability and version compliance + # in SFF-8636 dom capability definitions evolving with the versions. + qsfp_dom_capability_raw = self.__read_eeprom_specific_bytes( + (offset_xcvr + XCVR_DOM_CAPABILITY_OFFSET), XCVR_DOM_CAPABILITY_WIDTH) + if qsfp_dom_capability_raw is not None: + qspf_dom_capability_data = sfpi_obj.parse_dom_capability( + qsfp_dom_capability_raw, 0) + else: + return None + + dom_temperature_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_TEMPE_OFFSET), QSFP_TEMPE_WIDTH) + if dom_temperature_raw is not None: + dom_temperature_data = sfpd_obj.parse_temperature( + dom_temperature_raw, 0) + transceiver_dom_info_dict['temperature'] = dom_temperature_data['data']['Temperature']['value'] + + dom_voltage_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_VOLT_OFFSET), QSFP_VOLT_WIDTH) + if dom_voltage_raw is not None: + dom_voltage_data = sfpd_obj.parse_voltage(dom_voltage_raw, 0) + transceiver_dom_info_dict['voltage'] = dom_voltage_data['data']['Vcc']['value'] + + qsfp_dom_rev_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_DOM_REV_OFFSET), QSFP_DOM_REV_WIDTH) + if qsfp_dom_rev_raw is not None: + qsfp_dom_rev_data = sfpd_obj.parse_sfp_dom_rev(qsfp_dom_rev_raw, 0) + qsfp_dom_rev = qsfp_dom_rev_data['data']['dom_rev']['value'] + + # The tx_power monitoring is only available on QSFP which compliant with SFF-8636 + # and claimed that it support tx_power with one indicator bit. + dom_channel_monitor_data = {} + dom_channel_monitor_raw = None + qsfp_tx_power_support = qspf_dom_capability_data['data']['Tx_power_support']['value'] + if (qsfp_dom_rev[0:8] != 'SFF-8636' or (qsfp_dom_rev[0:8] == 'SFF-8636' and qsfp_tx_power_support != 'on')): + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_CHANNL_MON_OFFSET), QSFP_CHANNL_MON_WIDTH) + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = sfpd_obj.parse_channel_monitor_params( + dom_channel_monitor_raw, 0) + + else: + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_CHANNL_MON_OFFSET), QSFP_CHANNL_MON_WITH_TX_POWER_WIDTH) + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = sfpd_obj.parse_channel_monitor_params_with_tx_power( + dom_channel_monitor_raw, 0) + transceiver_dom_info_dict['tx1power'] = dom_channel_monitor_data['data']['TX1Power']['value'] + transceiver_dom_info_dict['tx2power'] = dom_channel_monitor_data['data']['TX2Power']['value'] + transceiver_dom_info_dict['tx3power'] = dom_channel_monitor_data['data']['TX3Power']['value'] + transceiver_dom_info_dict['tx4power'] = dom_channel_monitor_data['data']['TX4Power']['value'] + + if dom_channel_monitor_raw: + transceiver_dom_info_dict['rx1power'] = dom_channel_monitor_data['data']['RX1Power']['value'] + transceiver_dom_info_dict['rx2power'] = dom_channel_monitor_data['data']['RX2Power']['value'] + transceiver_dom_info_dict['rx3power'] = dom_channel_monitor_data['data']['RX3Power']['value'] + transceiver_dom_info_dict['rx4power'] = dom_channel_monitor_data['data']['RX4Power']['value'] + transceiver_dom_info_dict['tx1bias'] = dom_channel_monitor_data['data']['TX1Bias']['value'] + transceiver_dom_info_dict['tx2bias'] = dom_channel_monitor_data['data']['TX2Bias']['value'] + transceiver_dom_info_dict['tx3bias'] = dom_channel_monitor_data['data']['TX3Bias']['value'] + transceiver_dom_info_dict['tx4bias'] = dom_channel_monitor_data['data']['TX4Bias']['value'] + #End of else + + + for key in transceiver_dom_info_dict: + transceiver_dom_info_dict[key] = self._convert_string_to_num( + transceiver_dom_info_dict[key]) + + transceiver_dom_info_dict['rx_los'] = self.get_rx_los() + transceiver_dom_info_dict['tx_fault'] = self.get_tx_fault() + transceiver_dom_info_dict['reset_status'] = self.get_reset_status() + transceiver_dom_info_dict['lp_mode'] = self.get_lpmode() + + return transceiver_dom_info_dict + + def get_transceiver_threshold_info(self): + """ + Retrieves transceiver threshold info of this SFP + Returns: + A dict which contains following keys/values : + ======================================================================== + keys |Value Format |Information + ---------------------------|---------------|---------------------------- + temphighalarm |FLOAT |High Alarm Threshold value of temperature in Celsius. + templowalarm |FLOAT |Low Alarm Threshold value of temperature in Celsius. + temphighwarning |FLOAT |High Warning Threshold value of temperature in Celsius. + templowwarning |FLOAT |Low Warning Threshold value of temperature in Celsius. + vcchighalarm |FLOAT |High Alarm Threshold value of supply voltage in mV. + vcclowalarm |FLOAT |Low Alarm Threshold value of supply voltage in mV. + vcchighwarning |FLOAT |High Warning Threshold value of supply voltage in mV. + vcclowwarning |FLOAT |Low Warning Threshold value of supply voltage in mV. + rxpowerhighalarm |FLOAT |High Alarm Threshold value of received power in dBm. + rxpowerlowalarm |FLOAT |Low Alarm Threshold value of received power in dBm. + rxpowerhighwarning |FLOAT |High Warning Threshold value of received power in dBm. + rxpowerlowwarning |FLOAT |Low Warning Threshold value of received power in dBm. + txpowerhighalarm |FLOAT |High Alarm Threshold value of transmit power in dBm. + txpowerlowalarm |FLOAT |Low Alarm Threshold value of transmit power in dBm. + txpowerhighwarning |FLOAT |High Warning Threshold value of transmit power in dBm. + txpowerlowwarning |FLOAT |Low Warning Threshold value of transmit power in dBm. + txbiashighalarm |FLOAT |High Alarm Threshold value of tx Bias Current in mA. + txbiaslowalarm |FLOAT |Low Alarm Threshold value of tx Bias Current in mA. + txbiashighwarning |FLOAT |High Warning Threshold value of tx Bias Current in mA. + txbiaslowwarning |FLOAT |Low Warning Threshold value of tx Bias Current in mA. + ======================================================================== + """ + # check present status + if self.port_num < 49: + sfpd_obj = sff8472Dom() + + if not self.get_presence() and not sfpd_obj: + return {} + + eeprom_ifraw = self.__read_eeprom_specific_bytes(0, SFP_DOM_OFFSET) + sfpi_obj = sff8472InterfaceId(eeprom_ifraw) + cal_type = sfpi_obj.get_calibration_type() + sfpd_obj._calibration_type = cal_type + + offset = SFP_DOM_OFFSET + transceiver_dom_threshold_info_dict = dict.fromkeys( + self.threshold_dict_keys, 'N/A') + dom_module_threshold_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_MODULE_THRESHOLD_OFFSET), SFP_MODULE_THRESHOLD_WIDTH) + if dom_module_threshold_raw is not None: + dom_module_threshold_data = sfpd_obj.parse_alarm_warning_threshold( + dom_module_threshold_raw, 0) + + transceiver_dom_threshold_info_dict['temphighalarm'] = dom_module_threshold_data['data']['TempHighAlarm']['value'] + transceiver_dom_threshold_info_dict['templowalarm'] = dom_module_threshold_data['data']['TempLowAlarm']['value'] + transceiver_dom_threshold_info_dict['temphighwarning'] = dom_module_threshold_data['data']['TempHighWarning']['value'] + transceiver_dom_threshold_info_dict['templowwarning'] = dom_module_threshold_data['data']['TempLowWarning']['value'] + transceiver_dom_threshold_info_dict['vcchighalarm'] = dom_module_threshold_data['data']['VoltageHighAlarm']['value'] + transceiver_dom_threshold_info_dict['vcclowalarm'] = dom_module_threshold_data['data']['VoltageLowAlarm']['value'] + transceiver_dom_threshold_info_dict['vcchighwarning'] = dom_module_threshold_data[ + 'data']['VoltageHighWarning']['value'] + transceiver_dom_threshold_info_dict['vcclowwarning'] = dom_module_threshold_data['data']['VoltageLowWarning']['value'] + transceiver_dom_threshold_info_dict['txbiashighalarm'] = dom_module_threshold_data['data']['BiasHighAlarm']['value'] + transceiver_dom_threshold_info_dict['txbiaslowalarm'] = dom_module_threshold_data['data']['BiasLowAlarm']['value'] + transceiver_dom_threshold_info_dict['txbiashighwarning'] = dom_module_threshold_data['data']['BiasHighWarning']['value'] + transceiver_dom_threshold_info_dict['txbiaslowwarning'] = dom_module_threshold_data['data']['BiasLowWarning']['value'] + transceiver_dom_threshold_info_dict['txpowerhighalarm'] = dom_module_threshold_data['data']['TXPowerHighAlarm']['value'] + transceiver_dom_threshold_info_dict['txpowerlowalarm'] = dom_module_threshold_data['data']['TXPowerLowAlarm']['value'] + transceiver_dom_threshold_info_dict['txpowerhighwarning'] = dom_module_threshold_data['data']['TXPowerHighWarning']['value'] + transceiver_dom_threshold_info_dict['txpowerlowwarning'] = dom_module_threshold_data['data']['TXPowerLowWarning']['value'] + transceiver_dom_threshold_info_dict['rxpowerhighalarm'] = dom_module_threshold_data['data']['RXPowerHighAlarm']['value'] + transceiver_dom_threshold_info_dict['rxpowerlowalarm'] = dom_module_threshold_data['data']['RXPowerLowAlarm']['value'] + transceiver_dom_threshold_info_dict['rxpowerhighwarning'] = dom_module_threshold_data['data']['RXPowerHighWarning']['value'] + transceiver_dom_threshold_info_dict['rxpowerlowwarning'] = dom_module_threshold_data['data']['RXPowerLowWarning']['value'] + + for key in transceiver_dom_threshold_info_dict: + transceiver_dom_threshold_info_dict[key] = self._convert_string_to_num( + transceiver_dom_threshold_info_dict[key]) + + return transceiver_dom_threshold_info_dict + + + else: + sfpd_obj = sff8436Dom() + + if not self.get_presence() or not sfpd_obj: + return {} + + transceiver_dom_threshold_dict = dict.fromkeys( + self.threshold_dict_keys, 'N/A') + dom_thres_raw = self.__read_eeprom_specific_bytes( + QSFP_MODULE_THRESHOLD_OFFSET, QSFP_MODULE_THRESHOLD_WIDTH) if self.get_presence() and sfpd_obj else None + + if dom_thres_raw: + module_threshold_values = sfpd_obj.parse_module_threshold_values( + dom_thres_raw, 0) + module_threshold_data = module_threshold_values.get('data') + if module_threshold_data: + transceiver_dom_threshold_dict['temphighalarm'] = module_threshold_data['TempHighAlarm']['value'] + transceiver_dom_threshold_dict['templowalarm'] = module_threshold_data['TempLowAlarm']['value'] + transceiver_dom_threshold_dict['temphighwarning'] = module_threshold_data['TempHighWarning']['value'] + transceiver_dom_threshold_dict['templowwarning'] = module_threshold_data['TempLowWarning']['value'] + transceiver_dom_threshold_dict['vcchighalarm'] = module_threshold_data['VccHighAlarm']['value'] + transceiver_dom_threshold_dict['vcclowalarm'] = module_threshold_data['VccLowAlarm']['value'] + transceiver_dom_threshold_dict['vcchighwarning'] = module_threshold_data['VccHighWarning']['value'] + transceiver_dom_threshold_dict['vcclowwarning'] = module_threshold_data['VccLowWarning']['value'] + + dom_thres_raw = self.__read_eeprom_specific_bytes( + QSFP_CHANNEL_THRESHOLD_OFFSET, QSFP_CHANNEL_THRESHOLD_WIDTH) if self.get_presence() and sfpd_obj else None + channel_threshold_values = sfpd_obj.parse_channel_threshold_values( + dom_thres_raw, 0) + channel_threshold_data = channel_threshold_values.get('data') + if channel_threshold_data: + transceiver_dom_threshold_dict['rxpowerhighalarm'] = channel_threshold_data['RxPowerHighAlarm']['value'] + transceiver_dom_threshold_dict['rxpowerlowalarm'] = channel_threshold_data['RxPowerLowAlarm']['value'] + transceiver_dom_threshold_dict['rxpowerhighwarning'] = channel_threshold_data['RxPowerHighWarning']['value'] + transceiver_dom_threshold_dict['rxpowerlowwarning'] = channel_threshold_data['RxPowerLowWarning']['value'] + transceiver_dom_threshold_dict['txpowerhighalarm'] = "0.0dBm" + transceiver_dom_threshold_dict['txpowerlowalarm'] = "0.0dBm" + transceiver_dom_threshold_dict['txpowerhighwarning'] = "0.0dBm" + transceiver_dom_threshold_dict['txpowerlowwarning'] = "0.0dBm" + transceiver_dom_threshold_dict['txbiashighalarm'] = channel_threshold_data['TxBiasHighAlarm']['value'] + transceiver_dom_threshold_dict['txbiaslowalarm'] = channel_threshold_data['TxBiasLowAlarm']['value'] + transceiver_dom_threshold_dict['txbiashighwarning'] = channel_threshold_data['TxBiasHighWarning']['value'] + transceiver_dom_threshold_dict['txbiaslowwarning'] = channel_threshold_data['TxBiasLowWarning']['value'] + + for key in transceiver_dom_threshold_dict: + transceiver_dom_threshold_dict[key] = self._convert_string_to_num( + transceiver_dom_threshold_dict[key]) + + return transceiver_dom_threshold_dict + + def get_reset_status(self): + """ + Retrieves the reset status of SFP + Returns: + A Boolean, True if reset enabled, False if disabled + """ + if self.port_num <49: + return False # SPF port doesn't support this feature + + cpld_i = self.__get_cpld_num(self.port_num) + cpld_path = self._cpld_mapping[cpld_i] + reset_path = "{}{}{}{}".format(CPLD_I2C_PATH, cpld_path, '/module_reset_', self.port_num) + val=self._api_helper.read_txt_file(reset_path) + if val is None: + return 0 + + return int(val, 10)==1 + + def get_rx_los(self): + """ + Retrieves the RX LOS (lost-of-signal) status of SFP + Returns: + A Boolean, True if SFP has RX LOS, False if not. + Note : RX LOS status is latched until a call to get_rx_los or a reset. + """ + rx_los = False + if self.port_num < 49: + cpld_i = self.__get_cpld_num(self.port_num) + cpld_path = self._cpld_mapping[cpld_i] + rx_path = "{}{}{}{}".format(CPLD_I2C_PATH, cpld_path, '/module_rx_los_', self.port_num) + rx_los=self._api_helper.read_txt_file(rx_path) + if rx_los is None: + return False + #status_control_raw = self.__read_eeprom_specific_bytes( + # SFP_STATUS_CONTROL_OFFSET, SFP_STATUS_CONTROL_WIDTH) + #if status_control_raw: + # data = int(status_control_raw[0], 16) + # rx_los = (sffbase().test_bit(data, 1) != 0) + + else: + rx_los_list = [] + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + QSFP_CHANNL_RX_LOS_STATUS_OFFSET, QSFP_CHANNL_RX_LOS_STATUS_WIDTH) if self.get_presence() else None + if dom_channel_monitor_raw is not None: + rx_los_data = int(dom_channel_monitor_raw[0], 16) + rx_los_list.append(rx_los_data & 0x01 != 0) + rx_los_list.append(rx_los_data & 0x02 != 0) + rx_los_list.append(rx_los_data & 0x04 != 0) + rx_los_list.append(rx_los_data & 0x08 != 0) + rx_los = rx_los_list[0] and rx_los_list[1] and rx_los_list[2] and rx_los_list[3] + + return rx_los + + def get_tx_fault(self): + """ + Retrieves the TX fault status of SFP + Returns: + A Boolean, True if SFP has TX fault, False if not + Note : TX fault status is lached until a call to get_tx_fault or a reset. + """ + tx_fault = False + if self.port_num < 49: + cpld_i = self.__get_cpld_num(self.port_num) + cpld_path = self._cpld_mapping[cpld_i] + tx_path = "{}{}{}{}".format(CPLD_I2C_PATH, cpld_path, '/module_tx_fault_', self.port_num) + tx_fault=self._api_helper.read_txt_file(tx_path) + if tx_fault is None: + return False + #status_control_raw = self.__read_eeprom_specific_bytes( + # SFP_STATUS_CONTROL_OFFSET, SFP_STATUS_CONTROL_WIDTH) + #if status_control_raw: + # data = int(status_control_raw[0], 16) + # tx_fault = (sffbase().test_bit(data, 2) != 0) + else: + tx_fault_list = [] + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + QSFP_CHANNL_TX_FAULT_STATUS_OFFSET, QSFP_CHANNL_TX_FAULT_STATUS_WIDTH) if self.get_presence() else None + if dom_channel_monitor_raw is not None: + tx_fault_data = int(dom_channel_monitor_raw[0], 16) + tx_fault_list.append(tx_fault_data & 0x01 != 0) + tx_fault_list.append(tx_fault_data & 0x02 != 0) + tx_fault_list.append(tx_fault_data & 0x04 != 0) + tx_fault_list.append(tx_fault_data & 0x08 != 0) + tx_fault = tx_fault_list[0] and tx_fault_list[1] and tx_fault_list[2] and tx_fault_list[3] + + return tx_fault + + def get_tx_disable(self): + """ + Retrieves the tx_disable status of this SFP + Returns: + A Boolean, True if tx_disable is enabled, False if disabled + """ + if self.port_num < 49: + tx_disable = False + + cpld_i = self.__get_cpld_num(self.port_num) + cpld_path = self._cpld_mapping[cpld_i] + tx_path = "{}{}{}{}".format(CPLD_I2C_PATH, cpld_path, '/module_tx_disable_', self.port_num) + tx_disable=self._api_helper.read_txt_file(tx_path) + + #status_control_raw = self.__read_eeprom_specific_bytes( + # SFP_STATUS_CONTROL_OFFSET, SFP_STATUS_CONTROL_WIDTH) + #if status_control_raw: + # data = int(status_control_raw[0], 16) + # tx_disable_hard = (sffbase().test_bit( + # data, SFP_TX_DISABLE_HARD_BIT) != 0) + # tx_disable_soft = (sffbase().test_bit( + # data, SFP_TX_DISABLE_SOFT_BIT) != 0) + # tx_disable = tx_disable_hard | tx_disable_soft + if tx_disable is not None: + return tx_disable + else: + return False + + else: + tx_disable_list = [] + + sfpd_obj = sff8436Dom() + if sfpd_obj is None: + return False + + dom_control_raw = self.__read_eeprom_specific_bytes( + QSFP_CONTROL_OFFSET, QSFP_CONTROL_WIDTH) if self.get_presence() else None + if dom_control_raw is not None: + dom_control_data = sfpd_obj.parse_control_bytes(dom_control_raw, 0) + tx_disable_list.append( + 'On' == dom_control_data['data']['TX1Disable']['value']) + tx_disable_list.append( + 'On' == dom_control_data['data']['TX2Disable']['value']) + tx_disable_list.append( + 'On' == dom_control_data['data']['TX3Disable']['value']) + tx_disable_list.append( + 'On' == dom_control_data['data']['TX4Disable']['value']) + + return tx_disable_list + + def get_tx_disable_channel(self): + """ + Retrieves the TX disabled channels in this SFP + Returns: + A hex of 4 bits (bit 0 to bit 3 as channel 0 to channel 3) to represent + TX channels which have been disabled in this SFP. + As an example, a returned value of 0x5 indicates that channel 0 + and channel 2 have been disabled. + """ + if self.port_num < 49: + # SFP doesn't support this feature + return False + else: + tx_disable_list = self.get_tx_disable() + if tx_disable_list is None: + return 0 + tx_disabled = 0 + for i in range(len(tx_disable_list)): + if tx_disable_list[i]: + tx_disabled |= 1 << i + return tx_disabled + + def get_lpmode(self): + """ + Retrieves the lpmode (low power mode) status of this SFP + Returns: + A Boolean, True if lpmode is enabled, False if disabled + """ + if self.port_num < 49: + # SFP doesn't support this feature + return False + else: + power_set=self.get_power_set() + power_override = self.get_power_override() + return power_set and power_override + + + def get_power_set(self): + + if self.port_num < 49: + # SFP doesn't support this feature + return False + else: + power_set = False + + sfpd_obj = sff8436Dom() + if sfpd_obj is None: + return False + + dom_control_raw = self.__read_eeprom_specific_bytes( + QSFP_POWEROVERRIDE_OFFSET, QSFP_CONTROL_WIDTH) if self.get_presence() else None + if dom_control_raw is not None: + dom_control_data = sfpd_obj.parse_control_bytes(dom_control_raw, 0) + power_set = ( + 'On' == dom_control_data['data']['PowerSet']['value']) + + return power_set + + def get_power_override(self): + """ + Retrieves the power-override status of this SFP + Returns: + A Boolean, True if power-override is enabled, False if disabled + """ + if self.port_num < 49: + return False # SFP doesn't support this feature + else: + power_override = False + + + sfpd_obj = sff8436Dom() + if sfpd_obj is None: + return False + + dom_control_raw = self.__read_eeprom_specific_bytes( + QSFP_POWEROVERRIDE_OFFSET, QSFP_CONTROL_WIDTH) if self.get_presence() else None + if dom_control_raw is not None: + dom_control_data = sfpd_obj.parse_control_bytes(dom_control_raw, 0) + power_override = ( + 'On' == dom_control_data['data']['PowerOverride']['value']) + + return power_override + + def get_temperature(self): + """ + Retrieves the temperature of this SFP + Returns: + An integer number of current temperature in Celsius + """ + transceiver_dom_info_dict = self.get_transceiver_bulk_status() + return transceiver_dom_info_dict.get("temperature", "N/A") + + def get_voltage(self): + """ + Retrieves the supply voltage of this SFP + Returns: + An integer number of supply voltage in mV + """ + transceiver_dom_info_dict = self.get_transceiver_bulk_status() + return transceiver_dom_info_dict.get("voltage", "N/A") + + def get_tx_bias(self): + """ + Retrieves the TX bias current of this SFP + Returns: + A list of four integer numbers, representing TX bias in mA + for channel 0 to channel 4. + Ex. ['110.09', '111.12', '108.21', '112.09'] + """ + transceiver_dom_info_dict = self.get_transceiver_bulk_status() + + tx1_bs = transceiver_dom_info_dict.get("tx1bias", "N/A") + if self.port_num < 49: + return [tx1_bs, "N/A", "N/A", "N/A"] if transceiver_dom_info_dict else [] + + tx2_bs = transceiver_dom_info_dict.get("tx2bias", "N/A") + tx3_bs = transceiver_dom_info_dict.get("tx3bias", "N/A") + tx4_bs = transceiver_dom_info_dict.get("tx4bias", "N/A") + return [tx1_bs, tx2_bs, tx3_bs, tx4_bs] if transceiver_dom_info_dict else [] + + def get_rx_power(self): + """ + Retrieves the received optical power for this SFP + Returns: + A list of four integer numbers, representing received optical + power in mW for channel 0 to channel 4. + Ex. ['1.77', '1.71', '1.68', '1.70'] + """ + transceiver_dom_info_dict = self.get_transceiver_bulk_status() + + rx1_pw = transceiver_dom_info_dict.get("rx1power", "N/A") + if self.port_num < 49: + return [rx1_pw, "N/A", "N/A", "N/A"] if transceiver_dom_info_dict else [] + rx2_pw = transceiver_dom_info_dict.get("rx2power", "N/A") + rx3_pw = transceiver_dom_info_dict.get("rx3power", "N/A") + rx4_pw = transceiver_dom_info_dict.get("rx4power", "N/A") + return [rx1_pw, rx2_pw, rx3_pw, rx4_pw] if transceiver_dom_info_dict else [] + + def get_tx_power(self): + """ + Retrieves the TX power of this SFP + Returns: + A list of four integer numbers, representing TX power in mW + for channel 0 to channel 4. + Ex. ['1.86', '1.86', '1.86', '1.86'] + """ + transceiver_dom_info_dict = self.get_transceiver_bulk_status() + tx1_pw = transceiver_dom_info_dict.get("tx1power", "N/A") + if self.port_num < 49: + return [tx1_pw, "N/A", "N/A", "N/A"] if transceiver_dom_info_dict else [] + tx2_pw = transceiver_dom_info_dict.get("tx2power", "N/A") + tx3_pw = transceiver_dom_info_dict.get("tx3power", "N/A") + tx4_pw = transceiver_dom_info_dict.get("tx4power", "N/A") + return [tx1_pw, tx2_pw, tx3_pw, tx4_pw] + + def reset(self): + """ + Reset SFP and return all user module settings to their default srate. + Returns: + A boolean, True if successful, False if not + """ + if self.port_num <49: + return False # SFP doesn't support this feature + + cpld_i = self.__get_cpld_num(self.port_num) + cpld_path = self._cpld_mapping[cpld_i] + reset_path = "{}{}{}{}".format(CPLD_I2C_PATH, cpld_path, '/module_reset_', self.port_num) + ret = self.__write_txt_file(reset_path, 1) + if ret is not True: + return ret + + time.sleep(0.01) + ret = self.__write_txt_file(reset_path, 0) + time.sleep(0.2) + + return ret + + + def tx_disable(self, tx_disable): + """ + Disable SFP TX for all channels + Args: + tx_disable : A Boolean, True to enable tx_disable mode, False to disable + tx_disable mode. + Returns: + A boolean, True if tx_disable is set successfully, False if not + """ + if self.port_num < 49: + cpld_i = self.__get_cpld_num(self.port_num) + cpld_path = self._cpld_mapping[cpld_i] + tx_path = "{}{}{}{}".format(CPLD_I2C_PATH, cpld_path, '/module_tx_disable_', self.port_num) + ret = self.__write_txt_file(tx_path, 1 if tx_disable else 0) + time.sleep(0.01) + return ret + + else: + if not self.get_presence(): + return False + sysfsfile_eeprom = None + try: + tx_disable_ctl = 0xf if tx_disable else 0x0 + buffer = create_string_buffer(1) + if sys.version_info[0] >= 3: + buffer[0] = tx_disable_ctl + else: + buffer[0] = chr(tx_disable_ctl) + # Write to eeprom + sysfsfile_eeprom = open( + self.port_to_eeprom_mapping[self.port_num], "r+b") + sysfsfile_eeprom.seek(QSFP_CONTROL_OFFSET) + sysfsfile_eeprom.write(buffer[0]) + except IOError as e: + print ('Error: unable to open file: ',str(e)) + return False + finally: + if sysfsfile_eeprom is not None: + sysfsfile_eeprom.close() + time.sleep(0.01) + return True + + def tx_disable_channel(self, channel, disable): + """ + Sets the tx_disable for specified SFP channels + Args: + channel : A hex of 4 bits (bit 0 to bit 3) which represent channel 0 to 3, + e.g. 0x5 for channel 0 and channel 2. + disable : A boolean, True to disable TX channels specified in channel, + False to enable + Returns: + A boolean, True if successful, False if not + """ + + if self.port_num < 49: + return False # SFP doesn't support this feature + else: + if not self.get_presence(): + return False + + sysfsfile_eeprom = None + try: + channel_state = self.get_tx_disable_channel() + + for i in range(4): + channel_mask = (1 << i) + if not (channel & channel_mask): + continue + + if disable: + channel_state |= channel_mask + else: + channel_state &= ~channel_mask + + buffer = create_string_buffer(1) + if sys.version_info[0] >= 3: + buffer[0] = channel_state + else: + buffer[0] = chr(channel_state) + # Write to eeprom + sysfsfile_eeprom = open( + self.port_to_eeprom_mapping[self.port_num], "r+b") + sysfsfile_eeprom.seek(QSFP_CONTROL_OFFSET) + sysfsfile_eeprom.write(buffer[0]) + except IOError as e: + print ('Error: unable to open file: ', str(e)) + return False + finally: + if sysfsfile_eeprom is not None: + sysfsfile_eeprom.close() + time.sleep(0.01) + return True + + def set_lpmode(self, lpmode): + """ + Sets the lpmode (low power mode) of SFP + Args: + lpmode: A Boolean, True to enable lpmode, False to disable it + Note : lpmode can be overridden by set_power_override + Returns: + A boolean, True if lpmode is set successfully, False if not + """ + if self.port_num < 49: + return False # SFP doesn't support this feature + else: + if lpmode is True: + self.set_power_override(True, True) + else: + self.set_power_override(False, False) + + return True + + def set_power_override(self, power_override, power_set): + """ + Sets SFP power level using power_override and power_set + Args: + power_override : + A Boolean, True to override set_lpmode and use power_set + to control SFP power, False to disable SFP power control + through power_override/power_set and use set_lpmode + to control SFP power. + power_set : + Only valid when power_override is True. + A Boolean, True to set SFP to low power mode, False to set + SFP to high power mode. + Returns: + A boolean, True if power-override and power_set are set successfully, + False if not + """ + if self.port_num < 49: + return False # SFP doesn't support this feature + else: + if not self.get_presence(): + return False + try: + power_override_bit = (1 << 0) if power_override else 0 + power_set_bit = (1 << 1) if power_set else (1 << 3) + + buffer = create_string_buffer(1) + if sys.version_info[0] >= 3: + buffer[0] = (power_override_bit | power_set_bit) + else: + buffer[0] = chr(power_override_bit | power_set_bit) + # Write to eeprom + with open(self.port_to_eeprom_mapping[self.port_num], "r+b") as fd: + fd.seek(QSFP_POWEROVERRIDE_OFFSET) + fd.write(buffer[0]) + time.sleep(0.01) + except Exception: + print ('Error: unable to open file: ', str(e)) + return False + return True + + def get_name(self): + """ + Retrieves the name of the device + Returns: + string: The name of the device + """ + sfputil_helper = SfpUtilHelper() + sfputil_helper.read_porttab_mappings( + self.__get_path_to_port_config_file()) + name = sfputil_helper.logical[self.index] or "Unknown" + return name + + def get_presence(self): + """ + Retrieves the presence of the device + Returns: + bool: True if device is present, False if not + """ + cpld_i = self.__get_cpld_num(self.port_num) + cpld_path = self._cpld_mapping[cpld_i] + present_path = "{}{}{}{}".format(CPLD_I2C_PATH, cpld_path, '/module_present_', self.port_num) + val=self._api_helper.read_txt_file(present_path) + if val is not None: + return int(val, 10)==1 + else: + return False + + def get_model(self): + """ + Retrieves the model number (or part number) of the device + Returns: + string: Model/part number of device + """ + transceiver_dom_info_dict = self.get_transceiver_info() + return transceiver_dom_info_dict.get("model", "N/A") + + def get_serial(self): + """ + Retrieves the serial number of the device + Returns: + string: Serial number of device + """ + transceiver_dom_info_dict = self.get_transceiver_info() + return transceiver_dom_info_dict.get("serial", "N/A") + + def get_status(self): + """ + Retrieves the operational status of the device + Returns: + A boolean value, True if device is operating properly, False if not + """ + return self.get_presence() and self.get_transceiver_bulk_status() diff --git a/device/accton/x86_64-accton_as7312_54x-r0/sonic_platform/thermal.py b/device/accton/x86_64-accton_as7312_54x-r0/sonic_platform/thermal.py new file mode 100644 index 000000000000..aeab2caa23db --- /dev/null +++ b/device/accton/x86_64-accton_as7312_54x-r0/sonic_platform/thermal.py @@ -0,0 +1,146 @@ +############################################################################# +# Edgecore +# +# Thermal contains an implementation of SONiC Platform Base API and +# provides the thermal device status which are available in the platform +# +############################################################################# + +import os +import os.path +import glob + +try: + from sonic_platform_base.thermal_base import ThermalBase +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class Thermal(ThermalBase): + """Platform-specific Thermal class""" + + THERMAL_NAME_LIST = [] + SYSFS_PATH = "/sys/bus/i2c/devices" + + def __init__(self, thermal_index=0): + self.index = thermal_index + # Add thermal name + self.THERMAL_NAME_LIST.append("Temp sensor 1") + self.THERMAL_NAME_LIST.append("Temp sensor 2") + self.THERMAL_NAME_LIST.append("Temp sensor 3") + self.THERMAL_NAME_LIST.append("Temp sensor 4") + + # Set hwmon path + i2c_path = { + 0: "3-0048/hwmon/hwmon*/", + 1: "3-0049/hwmon/hwmon*/", + 2: "3-004a/hwmon/hwmon*/", + 3: "3-004b/hwmon/hwmon*/", + }.get(self.index, None) + + self.hwmon_path = "{}/{}".format(self.SYSFS_PATH, i2c_path) + self.ss_key = self.THERMAL_NAME_LIST[self.index] + self.ss_index = 1 + + def __read_txt_file(self, file_path): + for filename in glob.glob(file_path): + try: + with open(filename, 'r') as fd: + data =fd.readline().rstrip() + return data + except IOError as e: + pass + + return None + + def __get_temp(self, temp_file): + temp_file_path = os.path.join(self.hwmon_path, temp_file) + raw_temp = self.__read_txt_file(temp_file_path) + if raw_temp is not None: + return float(raw_temp)/1000 + else: + return 0 + + + def __set_threshold(self, file_name, temperature): + temp_file_path = os.path.join(self.hwmon_path, file_name) + for filename in glob.glob(temp_file_path): + try: + with open(filename, 'w') as fd: + fd.write(str(temperature)) + return True + except IOError as e: + print("IOError") + + + def get_temperature(self): + """ + Retrieves current temperature reading from thermal + Returns: + A float number of current temperature in Celsius up to nearest thousandth + of one degree Celsius, e.g. 30.125 + """ + temp_file = "temp{}_input".format(self.ss_index) + return self.__get_temp(temp_file) + + def get_high_threshold(self): + """ + Retrieves the high threshold temperature of thermal + Returns: + A float number, the high threshold temperature of thermal in Celsius + up to nearest thousandth of one degree Celsius, e.g. 30.125 + """ + temp_file = "temp{}_max".format(self.ss_index) + return self.__get_temp(temp_file) + + def set_high_threshold(self, temperature): + """ + Sets the high threshold temperature of thermal + Args : + temperature: A float number up to nearest thousandth of one degree Celsius, + e.g. 30.125 + Returns: + A boolean, True if threshold is set successfully, False if not + """ + temp_file = "temp{}_max".format(self.ss_index) + temperature = temperature *1000 + self.__set_threshold(temp_file, temperature) + + return True + + def get_name(self): + """ + Retrieves the name of the thermal device + Returns: + string: The name of the thermal device + """ + return self.THERMAL_NAME_LIST[self.index] + + def get_presence(self): + """ + Retrieves the presence of the Thermal + Returns: + bool: True if Thermal is present, False if not + """ + temp_file = "temp{}_input".format(self.ss_index) + temp_file_path = os.path.join(self.hwmon_path, temp_file) + raw_txt = self.__read_txt_file(temp_file_path) + if raw_txt is not None: + return True + else: + return False + + def get_status(self): + """ + Retrieves the operational status of the device + Returns: + A boolean value, True if device is operating properly, False if not + """ + + file_str = "temp{}_input".format(self.ss_index) + file_path = os.path.join(self.hwmon_path, file_str) + raw_txt = self.__read_txt_file(file_path) + if raw_txt is None: + return False + else: + return int(raw_txt) != 0 diff --git a/device/accton/x86_64-accton_as7315_27xb-r0/sensors.conf b/device/accton/x86_64-accton_as7315_27xb-r0/sensors.conf new file mode 100644 index 000000000000..1b5c9059c94d --- /dev/null +++ b/device/accton/x86_64-accton_as7315_27xb-r0/sensors.conf @@ -0,0 +1,42 @@ +# libsensors configuration file for as7315-27xb +# ------------------------------------------------ +# + +bus "i2c-12" "i2c-3-mux (chan_id 2)" +bus "i2c-13" "i2c-3-mux (chan_id 3)" +bus "i2c-50" "i2c-7-mux (chan_id 0)" +bus "i2c-51" "i2c-7-mux (chan_id 1)" +bus "i2c-52" "i2c-7-mux (chan_id 2)" +bus "i2c-53" "i2c-7-mux (chan_id 3)" + + +chip "ym2401-i2c-*-5b" + label in3 "PSU 1 Voltage" + label fan1 "PSU 1 Fan" + label temp1 "PSU 1 Temperature" + label power2 "PSU 1 Power" + label curr2 "PSU 1 Current" + +chip "ym2401-i2c-*-58" + label in3 "PSU 2 Voltage" + label fan1 "PSU 2 Fan" + label temp1 "PSU 2 Temperature" + label power2 "PSU 2 Power" + label curr2 "PSU 2 Current" + +chip "as7315_fan-*" + label fan1 "Fan 1" + label fan2 "Fan 2" + label fan3 "Fan 3" + label fan4 "Fan 4" + label fan5 "Fan 5" + + +chip "lm75-i2c-*-49" + label temp1 "Main Board Temperature" + +chip "lm75-i2c-*-4a" + label temp1 "Main Board Temperature" + +chip "lm75-i2c-*-4c" + label temp1 "Main Board Temperature" diff --git a/device/accton/x86_64-accton_as7326_56x-r0/Accton-AS7326-56X/td3-as7326-48x25G+8x100G.config.bcm b/device/accton/x86_64-accton_as7326_56x-r0/Accton-AS7326-56X/td3-as7326-48x25G+8x100G.config.bcm index 83f614bf093d..5da8cd015da1 100755 --- a/device/accton/x86_64-accton_as7326_56x-r0/Accton-AS7326-56X/td3-as7326-48x25G+8x100G.config.bcm +++ b/device/accton/x86_64-accton_as7326_56x-r0/Accton-AS7326-56X/td3-as7326-48x25G+8x100G.config.bcm @@ -1,3 +1,4 @@ +sai_load_hw_config=/etc/bcm/flex/bcm56870_a0_issu/b870.6.4.1/ #polarity/lanemap is using TH2 style. core_clock_frequency=1525 dpp_clock_ratio=2:3 diff --git a/device/accton/x86_64-accton_as7326_56x-r0/sensors.conf b/device/accton/x86_64-accton_as7326_56x-r0/sensors.conf new file mode 100644 index 000000000000..ec28b6875a0c --- /dev/null +++ b/device/accton/x86_64-accton_as7326_56x-r0/sensors.conf @@ -0,0 +1,50 @@ +# libsensors configuration file for as7326-56x +# ------------------------------------------------ +# + +bus "i2c-11" "i2c-1-mux (chan_id 2)" +bus "i2c-13" "i2c-1-mux (chan_id 4)" +bus "i2c-15" "i2c-1-mux (chan_id 6)" +bus "i2c-17" "i2c-1-mux (chan_id 0)" + + +chip "ym2651-i2c-*-59" + label in3 "PSU 1 Voltage" + label fan1 "PSU 1 Fan" + label temp1 "PSU 1 Temperature" + label power2 "PSU 1 Power" + label curr2 "PSU 1 Current" + +chip "ym2651-i2c-*-5b" + label in3 "PSU 2 Voltage" + label fan1 "PSU 2 Fan" + label temp1 "PSU 2 Temperature" + label power2 "PSU 2 Power" + label curr2 "PSU 2 Current" + +chip "as7326_56x_fan-*" + label fan1 "Fan 1 Front" + label fan2 "Fan 2 Front" + label fan3 "Fan 3 Front" + label fan4 "Fan 4 Front" + label fan5 "Fan 5 Front" + label fan6 "Fan 6 Front" + label fan11 "Fan 1 Rear" + label fan12 "Fan 2 Rear" + label fan13 "Fan 3 Rear" + label fan14 "Fan 4 Rear" + label fan15 "Fan 5 Rear" + label fan16 "Fan 6 Rear" + + +chip "lm75-i2c-*-48" + label temp1 "Main Board Temperature" + +chip "lm75-i2c-*-49" + label temp1 "Main Board Temperature" + +chip "lm75-i2c-*-4a" + label temp1 "Main Board Temperature" + +chip "lm75-i2c-*-4b" + label temp1 "CPU Board Temperature" diff --git a/device/accton/x86_64-accton_as7712_32x-r0/sensors.conf b/device/accton/x86_64-accton_as7712_32x-r0/sensors.conf index 33d75d598123..39796a5c2d13 100644 --- a/device/accton/x86_64-accton_as7712_32x-r0/sensors.conf +++ b/device/accton/x86_64-accton_as7712_32x-r0/sensors.conf @@ -1,23 +1,50 @@ -# libsensors configuration file for AS7712-32X +# libsensors configuration file for as7712-32x # ------------------------------------------------ # -#Comment out the following for sku-sensors-data.yml -#chip "ym2651-*" -# label power1 "PSU Output Power" -# label temp1 "Power Supply Temp" -# label fan1 "Fan Speed" -# -#chip "as7712_32x_fan-*" -# label fan1 "Fan tray 1 front" -# label fan2 "Fan tray 2 front" -# label fan3 "Fan tray 3 front" -# label fan4 "Fan tray 4 front" -# label fan5 "Fan tray 5 front" -# label fan6 "Fan tray 6 front" -# label fan11 "Fan tray 1 rear" -# label fan12 "Fan tray 2 rear" -# label fan13 "Fan tray 3 rear" -# label fan14 "Fan tray 4 rear" -# label fan15 "Fan tray 5 rear" -# label fan16 "Fan tray 6 rear" +bus "i2c-2" "i2c-1-mux (chan_id 0)" +bus "i2c-3" "i2c-1-mux (chan_id 1)" +bus "i2c-10" "i2c-0-mux (chan_id 0)" +bus "i2c-11" "i2c-0-mux (chan_id 1)" + + +chip "ym2651-i2c-*-5b" + label in3 "PSU 1 Voltage" + label fan1 "PSU 1 Fan" + label temp1 "PSU 1 Temperature" + label power2 "PSU 1 Power" + label curr2 "PSU 1 Current" + +chip "ym2651-i2c-*-58" + label in3 "PSU 2 Voltage" + label fan1 "PSU 2 Fan" + label temp1 "PSU 2 Temperature" + label power2 "PSU 2 Power" + label curr2 "PSU 2 Current" + +chip "as7712_32x_fan-*" + label fan1 "Fan 1 Front" + label fan2 "Fan 2 Front" + label fan3 "Fan 3 Front" + label fan4 "Fan 4 Front" + label fan5 "Fan 5 Front" + label fan6 "Fan 6 Front" + label fan11 "Fan 1 Rear" + label fan12 "Fan 2 Rear" + label fan13 "Fan 3 Rear" + label fan14 "Fan 4 Rear" + label fan15 "Fan 5 Rear" + label fan16 "Fan 6 Rear" + + +chip "lm75-i2c-*-48" + label temp1 "Main Board Temperature" + +chip "lm75-i2c-*-49" + label temp1 "Main Board Temperature" + +chip "lm75-i2c-*-4a" + label temp1 "Main Board Temperature" + +chip "lm75-i2c-*-4b" + label temp1 "CPU Board Temperature" diff --git a/device/accton/x86_64-accton_as7716_32x-r0/sensors.conf b/device/accton/x86_64-accton_as7716_32x-r0/sensors.conf new file mode 100644 index 000000000000..30e5bdbd6003 --- /dev/null +++ b/device/accton/x86_64-accton_as7716_32x-r0/sensors.conf @@ -0,0 +1,43 @@ +# libsensors configuration file for as7716-32x +# ------------------------------------------------ +# + +bus "i2c-9" "i2c-1-mux (chan_id 0)" +bus "i2c-10" "i2c-1-mux (chan_id 1)" +bus "i2c-17" "i2c-2-mux (chan_id 0)" +bus "i2c-18" "i2c-2-mux (chan_id 1)" + + +chip "ym2651-i2c-*-5b" + label fan1 "PSU 1 Fan" + label temp1 "PSU 1 Temperature" + label power1 "PSU 1 Power" + +chip "ym2651-i2c-*-58" + label fan1 "PSU 2 Fan" + label temp1 "PSU 2 Temperature" + label power1 "PSU 2 Power" + +chip "as7716_32x_fan-*" + label fan1 "Fan 1 Front" + label fan2 "Fan 2 Front" + label fan3 "Fan 3 Front" + label fan4 "Fan 4 Front" + label fan5 "Fan 5 Front" + label fan6 "Fan 6 Front" + label fan11 "Fan 1 Rear" + label fan12 "Fan 2 Rear" + label fan13 "Fan 3 Rear" + label fan14 "Fan 4 Rear" + label fan15 "Fan 5 Rear" + label fan16 "Fan 6 Rear" + + +chip "lm75-i2c-*-48" + label temp1 "Main Board Temperature" + +chip "lm75-i2c-*-49" + label temp1 "Main Board Temperature" + +chip "lm75-i2c-*-4a" + label temp1 "Main Board Temperature" diff --git a/device/accton/x86_64-accton_as7726_32x-r0/Accton-AS7726-32X/td3-as7726-32x100G.config.bcm b/device/accton/x86_64-accton_as7726_32x-r0/Accton-AS7726-32X/td3-as7726-32x100G.config.bcm index 8042955fcae7..f88656bfd5cf 100755 --- a/device/accton/x86_64-accton_as7726_32x-r0/Accton-AS7726-32X/td3-as7726-32x100G.config.bcm +++ b/device/accton/x86_64-accton_as7726_32x-r0/Accton-AS7726-32X/td3-as7726-32x100G.config.bcm @@ -1,3 +1,4 @@ +sai_load_hw_config=/etc/bcm/flex/bcm56870_a0_issu/b870.6.4.1/ #polarity/lanemap is using TH2 style. core_clock_frequency=1525 dpp_clock_ratio=2:3 diff --git a/device/accton/x86_64-accton_as7726_32x-r0/sensors.conf b/device/accton/x86_64-accton_as7726_32x-r0/sensors.conf new file mode 100644 index 000000000000..a7b356ee0b1f --- /dev/null +++ b/device/accton/x86_64-accton_as7726_32x-r0/sensors.conf @@ -0,0 +1,49 @@ +# libsensors configuration file for as7726-32x +# ------------------------------------------------ +# + +bus "i2c-49" "i2c-2-mux (chan_id 0)" +bus "i2c-50" "i2c-2-mux (chan_id 1)" +bus "i2c-54" "i2c-2-mux (chan_id 5)" +bus "i2c-55" "i2c-2-mux (chan_id 6)" + + +chip "ym2651-i2c-*-5b" + label fan1 "PSU 1 Fan" + label temp1 "PSU 1 Temperature" + label power1 "PSU 1 Power" + +chip "ym2651-i2c-*-58" + label fan1 "PSU 2 Fan" + label temp1 "PSU 2 Temperature" + label power1 "PSU 2 Power" + +chip "as7726_32x_fan-*" + label fan1 "Fan 1 Front" + label fan2 "Fan 2 Front" + label fan3 "Fan 3 Front" + label fan4 "Fan 4 Front" + label fan5 "Fan 5 Front" + label fan6 "Fan 6 Front" + label fan11 "Fan 1 Rear" + label fan12 "Fan 2 Rear" + label fan13 "Fan 3 Rear" + label fan14 "Fan 4 Rear" + label fan15 "Fan 5 Rear" + label fan16 "Fan 6 Rear" + + +chip "lm75-i2c-*-48" + label temp1 "Main Board Temperature" + +chip "lm75-i2c-*-49" + label temp1 "Main Board Temperature" + +chip "lm75-i2c-*-4a" + label temp1 "Main Board Temperature" + +chip "lm75-i2c-*-4b" + label temp1 "CPU Board Temperature" + +chip "lm75-i2c-*-4c" + label temp1 "Fan Board Temperature" diff --git a/device/accton/x86_64-accton_as7726_32x-r0/sonic_platform/__init__.py b/device/accton/x86_64-accton_as7726_32x-r0/sonic_platform/__init__.py new file mode 100644 index 000000000000..43435472a423 --- /dev/null +++ b/device/accton/x86_64-accton_as7726_32x-r0/sonic_platform/__init__.py @@ -0,0 +1,2 @@ +__all__ = ['chassis', 'eeprom', 'platform', 'psu', 'sfp', 'thermal', 'fan'] +from . import platform diff --git a/device/accton/x86_64-accton_as7726_32x-r0/sonic_platform/chassis.py b/device/accton/x86_64-accton_as7726_32x-r0/sonic_platform/chassis.py new file mode 100644 index 000000000000..01d552382dc1 --- /dev/null +++ b/device/accton/x86_64-accton_as7726_32x-r0/sonic_platform/chassis.py @@ -0,0 +1,212 @@ +############################################################################# +# Edgecore +# +# Module contains an implementation of SONiC Platform Base API and +# provides the Chassis information which are available in the platform +# +############################################################################# + +import os +import sys + +try: + from sonic_platform_base.chassis_base import ChassisBase + from .helper import APIHelper + from .event import SfpEvent +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +NUM_FAN_TRAY = 6 +NUM_FAN = 2 +NUM_PSU = 2 +NUM_THERMAL = 5 +NUM_PORT = 34 +NUM_COMPONENT = 4 +HOST_REBOOT_CAUSE_PATH = "/host/reboot-cause/" +PMON_REBOOT_CAUSE_PATH = "/usr/share/sonic/platform/api_files/reboot-cause/" +REBOOT_CAUSE_FILE = "reboot-cause.txt" +PREV_REBOOT_CAUSE_FILE = "previous-reboot-cause.txt" +HOST_CHK_CMD = "docker > /dev/null 2>&1" + + +class Chassis(ChassisBase): + """Platform-specific Chassis class""" + + def __init__(self): + ChassisBase.__init__(self) + self._api_helper = APIHelper() + self._api_helper = APIHelper() + self.is_host = self._api_helper.is_host() + + self.config_data = {} + + self.__initialize_fan() + self.__initialize_psu() + self.__initialize_thermals() + self.__initialize_components() + self.__initialize_sfp() + self.__initialize_eeprom() + + def __initialize_sfp(self): + from sonic_platform.sfp import Sfp + for index in range(0, NUM_PORT): + sfp = Sfp(index) + self._sfp_list.append(sfp) + self.sfp_module_initialized = True + + def __initialize_fan(self): + from sonic_platform.fan import Fan + for fant_index in range(0, NUM_FAN_TRAY): + for fan_index in range(0, NUM_FAN): + fan = Fan(fant_index, fan_index) + self._fan_list.append(fan) + + def __initialize_psu(self): + from sonic_platform.psu import Psu + for index in range(0, NUM_PSU): + psu = Psu(index) + self._psu_list.append(psu) + + def __initialize_thermals(self): + from sonic_platform.thermal import Thermal + for index in range(0, NUM_THERMAL): + thermal = Thermal(index) + self._thermal_list.append(thermal) + + def __initialize_eeprom(self): + from sonic_platform.eeprom import Tlv + self._eeprom = Tlv() + + def __initialize_components(self): + from sonic_platform.component import Component + for index in range(0, NUM_COMPONENT): + component = Component(index) + self._component_list.append(component) + + def __initialize_watchdog(self): + from sonic_platform.watchdog import Watchdog + self._watchdog = Watchdog() + + + def __is_host(self): + return os.system(HOST_CHK_CMD) == 0 + + def __read_txt_file(self, file_path): + try: + with open(file_path, 'r') as fd: + data = fd.read() + return data.strip() + except IOError: + pass + return None + + def get_name(self): + """ + Retrieves the name of the device + Returns: + string: The name of the device + """ + + return self._api_helper.hwsku + + def get_presence(self): + """ + Retrieves the presence of the Chassis + Returns: + bool: True if Chassis is present, False if not + """ + return True + + def get_status(self): + """ + Retrieves the operational status of the device + Returns: + A boolean value, True if device is operating properly, False if not + """ + return True + + def get_base_mac(self): + """ + Retrieves the base MAC address for the chassis + Returns: + A string containing the MAC address in the format + 'XX:XX:XX:XX:XX:XX' + """ + return self._eeprom.get_mac() + + def get_model(self): + """ + Retrieves the model number (or part number) of the device + Returns: + string: Model/part number of device + """ + return self._eeprom.get_pn() + + def get_serial_number(self): + """ + Retrieves the hardware serial number for the chassis + Returns: + A string containing the hardware serial number for this chassis. + """ + return self._eeprom.get_serial() + + def get_system_eeprom_info(self): + """ + Retrieves the full content of system EEPROM information for the chassis + Returns: + A dictionary where keys are the type code defined in + OCP ONIE TlvInfo EEPROM format and values are their corresponding + values. + """ + return self._eeprom.get_eeprom() + + def get_reboot_cause(self): + """ + Retrieves the cause of the previous reboot + + Returns: + A tuple (string, string) where the first element is a string + containing the cause of the previous reboot. This string must be + one of the predefined strings in this class. If the first string + is "REBOOT_CAUSE_HARDWARE_OTHER", the second string can be used + to pass a description of the reboot cause. + """ + + reboot_cause_path = (HOST_REBOOT_CAUSE_PATH + REBOOT_CAUSE_FILE) + sw_reboot_cause = self._api_helper.read_txt_file( + reboot_cause_path) or "Unknown" + + + return ('REBOOT_CAUSE_NON_HARDWARE', sw_reboot_cause) + + def get_change_event(self, timeout=0): + # SFP event + if not self.sfp_module_initialized: + self.__initialize_sfp() + + status, sfp_event = SfpEvent(self._sfp_list).get_sfp_event(timeout) + + return status, sfp_event + + def get_sfp(self, index): + """ + Retrieves sfp represented by (1-based) index + Args: + index: An integer, the index (1-based) of the sfp to retrieve. + The index should be the sequence of a physical port in a chassis, + starting from 1. + For example, 1 for Ethernet0, 2 for Ethernet4 and so on. + Returns: + An object dervied from SfpBase representing the specified sfp + """ + sfp = None + if not self.sfp_module_initialized: + self.__initialize_sfp() + + try: + # The index will start from 1 + sfp = self._sfp_list[index-1] + except IndexError: + sys.stderr.write("SFP index {} out of range (1-{})\n".format( + index, len(self._sfp_list))) + return sfp diff --git a/device/accton/x86_64-accton_as7726_32x-r0/sonic_platform/component.py b/device/accton/x86_64-accton_as7726_32x-r0/sonic_platform/component.py new file mode 100644 index 000000000000..e1e5b2cd4b7f --- /dev/null +++ b/device/accton/x86_64-accton_as7726_32x-r0/sonic_platform/component.py @@ -0,0 +1,123 @@ +############################################################################# +# Edgecore +# +# Component contains an implementation of SONiC Platform Base API and +# provides the components firmware management function +# +############################################################################# + +import shlex +import subprocess + +try: + from sonic_platform_base.component_base import ComponentBase + from .helper import APIHelper +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +CPLD_ADDR_MAPPING = { + "CPLD1": "11-0060", + "CPLD2": "12-0062", + "CPLD3": "13-0064", +} +SYSFS_PATH = "/sys/bus/i2c/devices/" +BIOS_VERSION_PATH = "/sys/class/dmi/id/bios_version" +COMPONENT_LIST= [ + ("CPLD1", "CPLD 1"), + ("CPLD2", "CPLD 2"), + ("CPLD3", "CPLD 3"), + ("BIOS", "Basic Input/Output System") + +] + +class Component(ComponentBase): + """Platform-specific Component class""" + + DEVICE_TYPE = "component" + + def __init__(self, component_index=0): + self._api_helper=APIHelper() + ComponentBase.__init__(self) + self.index = component_index + self.name = self.get_name() + + def __run_command(self, command): + # Run bash command and print output to stdout + try: + process = subprocess.Popen( + shlex.split(command), stdout=subprocess.PIPE) + while True: + output = process.stdout.readline() + if output == '' and process.poll() is not None: + break + rc = process.poll() + if rc != 0: + return False + except Exception: + return False + return True + + def __get_bios_version(self): + # Retrieves the BIOS firmware version + try: + with open(BIOS_VERSION_PATH, 'r') as fd: + bios_version = fd.read() + return bios_version.strip() + except Exception as e: + return None + + def __get_cpld_version(self): + # Retrieves the CPLD firmware version + cpld_version = dict() + for cpld_name in CPLD_ADDR_MAPPING: + try: + cpld_path = "{}{}{}".format(SYSFS_PATH, CPLD_ADDR_MAPPING[cpld_name], '/version') + cpld_version_raw= self._api_helper.read_txt_file(cpld_path) + cpld_version[cpld_name] = "{}".format(int(cpld_version_raw,16)) + except Exception as e: + print('Get exception when read cpld') + cpld_version[cpld_name] = 'None' + + return cpld_version + + def get_name(self): + """ + Retrieves the name of the component + Returns: + A string containing the name of the component + """ + return COMPONENT_LIST[self.index][0] + + def get_description(self): + """ + Retrieves the description of the component + Returns: + A string containing the description of the component + """ + return COMPONENT_LIST[self.index][1] + + def get_firmware_version(self): + """ + Retrieves the firmware version of module + Returns: + string: The firmware versions of the module + """ + fw_version = None + + if self.name == "BIOS": + fw_version = self.__get_bios_version() + elif "CPLD" in self.name: + cpld_version = self.__get_cpld_version() + fw_version = cpld_version.get(self.name) + + return fw_version + + def install_firmware(self, image_path): + """ + Install firmware to module + Args: + image_path: A string, path to firmware image + Returns: + A boolean, True if install successfully, False if not + """ + raise NotImplementedError diff --git a/device/accton/x86_64-accton_as7726_32x-r0/sonic_platform/eeprom.py b/device/accton/x86_64-accton_as7726_32x-r0/sonic_platform/eeprom.py new file mode 100644 index 000000000000..5b586fa09362 --- /dev/null +++ b/device/accton/x86_64-accton_as7726_32x-r0/sonic_platform/eeprom.py @@ -0,0 +1,131 @@ +try: + import os + import sys + import re + if sys.version_info[0] >= 3: + from io import StringIO + else: + from cStringIO import StringIO + + from sonic_platform_base.sonic_eeprom import eeprom_tlvinfo +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +CACHE_ROOT = '/var/cache/sonic/decode-syseeprom' +CACHE_FILE = 'syseeprom_cache' +NULL = 'N/A' + +class Tlv(eeprom_tlvinfo.TlvInfoDecoder): + + EEPROM_DECODE_HEADLINES = 6 + + def __init__(self): + self._eeprom_path = "/sys/bus/i2c/devices/0-0056/eeprom" + super(Tlv, self).__init__(self._eeprom_path, 0, '', True) + self._eeprom = self._load_eeprom() + + def __parse_output(self, decode_output): + decode_output.replace('\0', '') + lines = decode_output.split('\n') + lines = lines[self.EEPROM_DECODE_HEADLINES:] + _eeprom_info_dict = dict() + + for line in lines: + try: + match = re.search( + '(0x[0-9a-fA-F]{2})([\s]+[\S]+[\s]+)([\S]+)', line) + if match is not None: + idx = match.group(1) + value = match.group(3).rstrip('\0') + + _eeprom_info_dict[idx] = value + except Exception: + pass + + return _eeprom_info_dict + + def _load_eeprom(self): + original_stdout = sys.stdout + sys.stdout = StringIO() + try: + self.read_eeprom_db() + except Exception: + decode_output = sys.stdout.getvalue() + sys.stdout = original_stdout + return self.__parse_output(decode_output) + + status = self.check_status() + if 'ok' not in status: + return False + + if not os.path.exists(CACHE_ROOT): + try: + os.makedirs(CACHE_ROOT) + except Exception: + pass + + # + # only the eeprom classes that inherit from eeprom_base + # support caching. Others will work normally + # + try: + self.set_cache_name(os.path.join(CACHE_ROOT, CACHE_FILE)) + except Exception: + pass + + e = self.read_eeprom() + if e is None: + return 0 + + try: + self.update_cache(e) + except Exception: + pass + + self.decode_eeprom(e) + decode_output = sys.stdout.getvalue() + sys.stdout = original_stdout + + (is_valid, valid_crc) = self.is_checksum_valid(e) + if not is_valid: + return False + + return self.__parse_output(decode_output) + + def _valid_tlv(self, eeprom_data): + tlvinfo_type_codes_list = [ + self._TLV_CODE_PRODUCT_NAME, + self._TLV_CODE_PART_NUMBER, + self._TLV_CODE_SERIAL_NUMBER, + self._TLV_CODE_MAC_BASE, + self._TLV_CODE_MANUF_DATE, + self._TLV_CODE_DEVICE_VERSION, + self._TLV_CODE_LABEL_REVISION, + self._TLV_CODE_PLATFORM_NAME, + self._TLV_CODE_ONIE_VERSION, + self._TLV_CODE_MAC_SIZE, + self._TLV_CODE_MANUF_NAME, + self._TLV_CODE_MANUF_COUNTRY, + self._TLV_CODE_VENDOR_NAME, + self._TLV_CODE_DIAG_VERSION, + self._TLV_CODE_SERVICE_TAG, + self._TLV_CODE_VENDOR_EXT, + self._TLV_CODE_CRC_32 + ] + + for code in tlvinfo_type_codes_list: + code_str = "0x{:X}".format(code) + eeprom_data[code_str] = eeprom_data.get(code_str, NULL) + return eeprom_data + + def get_eeprom(self): + return self._valid_tlv(self._eeprom) + + def get_pn(self): + return self._eeprom.get('0x22', NULL) + + def get_serial(self): + return self._eeprom.get('0x23', NULL) + + def get_mac(self): + return self._eeprom.get('0x24', NULL) diff --git a/device/accton/x86_64-accton_as7726_32x-r0/sonic_platform/event.py b/device/accton/x86_64-accton_as7726_32x-r0/sonic_platform/event.py new file mode 100644 index 000000000000..d77ee8c29dc5 --- /dev/null +++ b/device/accton/x86_64-accton_as7726_32x-r0/sonic_platform/event.py @@ -0,0 +1,55 @@ +try: + import time + from .helper import APIHelper + from sonic_py_common.logger import Logger +except ImportError as e: + raise ImportError(repr(e) + " - required module not found") + + +class SfpEvent: + ''' Listen to insert/remove sfp events ''' + + def __init__(self, sfp_list): + self._api_helper = APIHelper() + self._sfp_list = sfp_list + self._logger = Logger() + + sfp_change_event_data = {'valid': 0, 'last': 0, 'present': 0} + def get_sfp_event(self, timeout=2000): + now = time.time() + port_dict = {} + change_dict = {} + change_dict['sfp'] = port_dict + + if timeout < 1000: + timeout = 1000 + timeout = timeout / float(1000) # Convert to secs + + if now < (self.sfp_change_event_data['last'] + timeout) and self.sfp_change_event_data['valid']: + return True, change_dict + + bitmap = 0 + for sfp in self._sfp_list: + modpres = sfp.get_presence() + i=sfp.port_num-1 + if modpres: + bitmap = bitmap | (1 << i) + + changed_ports = self.sfp_change_event_data['present'] ^ bitmap + if changed_ports: + for sfp in self._sfp_list: + i=sfp.port_num-1 + if (changed_ports & (1 << i)): + if (bitmap & (1 << i)) == 0: + port_dict[i+1] = '0' + else: + port_dict[i+1] = '1' + + + # Update the cache dict + self.sfp_change_event_data['present'] = bitmap + self.sfp_change_event_data['last'] = now + self.sfp_change_event_data['valid'] = 1 + return True, change_dict + else: + return True, change_dict diff --git a/device/accton/x86_64-accton_as7726_32x-r0/sonic_platform/fan.py b/device/accton/x86_64-accton_as7726_32x-r0/sonic_platform/fan.py new file mode 100644 index 000000000000..839c3f09b616 --- /dev/null +++ b/device/accton/x86_64-accton_as7726_32x-r0/sonic_platform/fan.py @@ -0,0 +1,238 @@ +############################################################################# +# Edgecore +# +# Module contains an implementation of SONiC Platform Base API and +# provides the fan status which are available in the platform +# +############################################################################# + +try: + from sonic_platform_base.fan_base import FanBase + from .helper import APIHelper +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +PSU_FAN_MAX_RPM = 25500 + +CPLD_I2C_PATH = "/sys/bus/i2c/devices/54-0066/fan" +PSU_HWMON_I2C_PATH ="/sys/bus/i2c/devices/{}-00{}/" +PSU_I2C_MAPPING = { + 0: { + "num": 50, + "addr": "5b" + }, + 1: { + "num": 49, + "addr": "58" + }, +} + +FAN_NAME_LIST = ["FAN-1F", "FAN-1R", "FAN-2F", "FAN-2R", + "FAN-3F", "FAN-3R", "FAN-4F", "FAN-4R", + "FAN-5F", "FAN-5R", "FAN-6F", "FAN-6R"] + +class Fan(FanBase): + """Platform-specific Fan class""" + + def __init__(self, fan_tray_index, fan_index=0, is_psu_fan=False, psu_index=0): + self._api_helper=APIHelper() + self.fan_index = fan_index + self.fan_tray_index = fan_tray_index + self.is_psu_fan = is_psu_fan + + if self.is_psu_fan: + self.psu_index = psu_index + self.psu_i2c_num = PSU_I2C_MAPPING[self.psu_index]['num'] + self.psu_i2c_addr = PSU_I2C_MAPPING[self.psu_index]['addr'] + self.psu_hwmon_path = PSU_HWMON_I2C_PATH.format( + self.psu_i2c_num, self.psu_i2c_addr) + + FanBase.__init__(self) + + def get_direction(self): + """ + Retrieves the direction of fan + Returns: + A string, either FAN_DIRECTION_INTAKE or FAN_DIRECTION_EXHAUST + depending on fan direction + """ + if not self.is_psu_fan: + dir_str = "{}{}{}".format(CPLD_I2C_PATH, self.fan_tray_index+1, '_direction') + val=self._api_helper.read_txt_file(dir_str) + if val is not None: #F2B is FAN_DIRECTION_EXHAUST + direction = self.FAN_DIRECTION_EXHAUST if ( + val == "0") else self.FAN_DIRECTION_INTAKE + else: + direction=self.FAN_DIRECTION_EXHAUST + + else: #For PSU + dir_str = "{}{}".format(self.psu_hwmon_path,'psu_fan_dir') + val=self._api_helper.read_txt_file(dir_str) + if val is not None: + if val=='F2B': + direction=self.FAN_DIRECTION_EXHAUST + else: + direction=self.FAN_DIRECTION_INTAKE + else: + direction=self.FAN_DIRECTION_EXHAUST + + return direction + + def get_speed(self): + """ + Retrieves the speed of fan as a percentage of full speed + Returns: + An integer, the percentage of full fan speed, in the range 0 (off) + to 100 (full speed) + + """ + speed = 0 + if self.is_psu_fan: + psu_fan_path= "{}{}".format(self.psu_hwmon_path, 'psu_fan1_speed_rpm') + fan_speed_rpm = self._api_helper.read_txt_file(psu_fan_path) + if fan_speed_rpm is not None: + speed = (int(fan_speed_rpm,10))*100/PSU_FAN_MAX_RPM + if speed > 100: + speed=100 + else: + return 0 + elif self.get_presence(): + speed_path = "{}{}".format(CPLD_I2C_PATH, '_duty_cycle_percentage') + speed=self._api_helper.read_txt_file(speed_path) + if speed is None: + return 0 + return int(speed) + + def get_target_speed(self): + """ + Retrieves the target (expected) speed of the fan + Returns: + An integer, the percentage of full fan speed, in the range 0 (off) + to 100 (full speed) + + Note: + speed_pc = pwm_target/255*100 + + 0 : when PWM mode is use + pwm : when pwm mode is not use + """ + return False #Not supported + + def get_speed_tolerance(self): + """ + Retrieves the speed tolerance of the fan + Returns: + An integer, the percentage of variance from target speed which is + considered tolerable + """ + return False #Not supported + + def set_speed(self, speed): + """ + Sets the fan speed + Args: + speed: An integer, the percentage of full fan speed to set fan to, + in the range 0 (off) to 100 (full speed) + Returns: + A boolean, True if speed is set successfully, False if not + + """ + + if not self.is_psu_fan and self.get_presence(): + speed_path = "{}{}".format(CPLD_I2C_PATH, '_duty_cycle_percentage') + return self._api_helper.write_txt_file(speed_path, int(speed)) + + return False + + def set_status_led(self, color): + """ + Sets the state of the fan module status LED + Args: + color: A string representing the color with which to set the + fan module status LED + Returns: + bool: True if status LED state is set successfully, False if not + """ + return False #Not supported + + def get_status_led(self): + """ + Gets the state of the fan status LED + Returns: + A string, one of the predefined STATUS_LED_COLOR_* strings above + """ + status=self.get_presence() + if status is None: + return self.STATUS_LED_COLOR_OFF + + return { + 1: self.STATUS_LED_COLOR_GREEN, + 0: self.STATUS_LED_COLOR_RED + }.get(status, self.STATUS_LED_COLOR_OFF) + + def get_name(self): + """ + Retrieves the name of the device + Returns: + string: The name of the device + """ + fan_name = FAN_NAME_LIST[self.fan_tray_index*2 + self.fan_index] \ + if not self.is_psu_fan \ + else "PSU-{} FAN-{}".format(self.psu_index+1, self.fan_index+1) + + return fan_name + + def get_presence(self): + """ + Retrieves the presence of the FAN + Returns: + bool: True if FAN is present, False if not + """ + if not self.is_psu_fan: + present_path = "{}{}{}".format(CPLD_I2C_PATH, self.fan_index+1, '_present') + val=self._api_helper.read_txt_file(present_path) + if val is not None: + return int(val, 10)==1 + else: + return False + else: + return True + + def get_status(self): + """ + Retrieves the operational status of the device + Returns: + A boolean value, True if device is operating properly, False if not + """ + if self.is_psu_fan: + psu_fan_path= "{}{}".format(self.psu_hwmon_path, 'psu_fan1_fault') + val=self._api_helper.read_txt_file(psu_fan_path) + if val is not None: + return int(val, 10)==0 + else: + return False + else: + path = "{}{}{}".format(CPLD_I2C_PATH, self.fan_index+1, '_fault') + val=self._api_helper.read_txt_file(path) + if val is not None: + return int(val, 10)==0 + else: + return False + + + def get_model(self): + """ + Retrieves the model number (or part number) of the device + Returns: + string: Model/part number of device + """ + + return "N/A" + + def get_serial(self): + """ + Retrieves the serial number of the device + Returns: + string: Serial number of device + """ + return "N/A" diff --git a/device/accton/x86_64-accton_as7726_32x-r0/sonic_platform/helper.py b/device/accton/x86_64-accton_as7726_32x-r0/sonic_platform/helper.py new file mode 100644 index 000000000000..4cd60ac90611 --- /dev/null +++ b/device/accton/x86_64-accton_as7726_32x-r0/sonic_platform/helper.py @@ -0,0 +1,117 @@ +import os +import struct +import subprocess +from mmap import * +from sonic_py_common import device_info + +HOST_CHK_CMD = "docker > /dev/null 2>&1" +EMPTY_STRING = "" + + +class APIHelper(): + + def __init__(self): + (self.platform, self.hwsku) = device_info.get_platform_and_hwsku() + + def is_host(self): + return os.system(HOST_CHK_CMD) == 0 + + def pci_get_value(self, resource, offset): + status = True + result = "" + try: + fd = os.open(resource, os.O_RDWR) + mm = mmap(fd, 0) + mm.seek(int(offset)) + read_data_stream = mm.read(4) + result = struct.unpack('I', read_data_stream) + except Exception: + status = False + return status, result + + def run_command(self, cmd): + status = True + result = "" + try: + p = subprocess.Popen( + cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + raw_data, err = p.communicate() + if err == '': + result = raw_data.strip() + except Exception: + status = False + return status, result + + def run_interactive_command(self, cmd): + try: + os.system(cmd) + except Exception: + return False + return True + + def read_txt_file(self, file_path): + try: + with open(file_path, 'r') as fd: + data = fd.read() + return data.strip() + except IOError: + pass + return None + + def write_txt_file(self, file_path, value): + try: + with open(file_path, 'w') as fd: + fd.write(str(value)) + except IOError: + return False + return True + + def ipmi_raw(self, netfn, cmd): + status = True + result = "" + try: + cmd = "ipmitool raw {} {}".format(str(netfn), str(cmd)) + p = subprocess.Popen( + cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + raw_data, err = p.communicate() + if err == '': + result = raw_data.strip() + else: + status = False + except Exception: + status = False + return status, result + + def ipmi_fru_id(self, id, key=None): + status = True + result = "" + try: + cmd = "ipmitool fru print {}".format(str( + id)) if not key else "ipmitool fru print {0} | grep '{1}' ".format(str(id), str(key)) + + p = subprocess.Popen( + cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + raw_data, err = p.communicate() + if err == '': + result = raw_data.strip() + else: + status = False + except Exception: + status = False + return status, result + + def ipmi_set_ss_thres(self, id, threshold_key, value): + status = True + result = "" + try: + cmd = "ipmitool sensor thresh '{}' {} {}".format(str(id), str(threshold_key), str(value)) + p = subprocess.Popen( + cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + raw_data, err = p.communicate() + if err == '': + result = raw_data.strip() + else: + status = False + except Exception: + status = False + return status, result diff --git a/device/accton/x86_64-accton_as7726_32x-r0/sonic_platform/platform.py b/device/accton/x86_64-accton_as7726_32x-r0/sonic_platform/platform.py new file mode 100644 index 000000000000..2f2c2a447fcf --- /dev/null +++ b/device/accton/x86_64-accton_as7726_32x-r0/sonic_platform/platform.py @@ -0,0 +1,21 @@ +############################################################################# +# Edgecore +# +# Module contains an implementation of SONiC Platform Base API and +# provides the platform information +# +############################################################################# + +try: + from sonic_platform_base.platform_base import PlatformBase + from sonic_platform.chassis import Chassis +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class Platform(PlatformBase): + """Platform-specific Platform class""" + + def __init__(self): + PlatformBase.__init__(self) + self._chassis = Chassis() diff --git a/device/accton/x86_64-accton_as7726_32x-r0/sonic_platform/psu.py b/device/accton/x86_64-accton_as7726_32x-r0/sonic_platform/psu.py new file mode 100644 index 000000000000..d8f4614b03b3 --- /dev/null +++ b/device/accton/x86_64-accton_as7726_32x-r0/sonic_platform/psu.py @@ -0,0 +1,257 @@ +############################################################################# +# Edgecore +# +# Module contains an implementation of SONiC Platform Base API and +# provides the PSUs status which are available in the platform +# +############################################################################# + + +import logging + +try: + from sonic_platform_base.psu_base import PsuBase + from .helper import APIHelper +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +I2C_PATH ="/sys/bus/i2c/devices/{0}-00{1}/" + +PSU_NAME_LIST = ["PSU-1", "PSU-2"] +PSU_NUM_FAN = [1, 1] + +PSU_CPLD_I2C_MAPPING = { + 0: { + "num": 50, + "addr": "53" + }, + 1: { + "num": 49, + "addr": "50" + }, +} + +PSU_HWMON_I2C_MAPPING = { + 0: { + "num": 50, + "addr": "5b" + }, + 1: { + "num": 49, + "addr": "58" + }, +} + +class Psu(PsuBase): + """Platform-specific Psu class""" + def __init__(self, psu_index=0): + PsuBase.__init__(self) + self.index = psu_index + self._api_helper = APIHelper() + + self.i2c_num = PSU_HWMON_I2C_MAPPING[self.index]["num"] + self.i2c_addr = PSU_HWMON_I2C_MAPPING[self.index]["addr"] + self.hwmon_path = I2C_PATH.format(self.i2c_num, self.i2c_addr) + + self.i2c_num = PSU_CPLD_I2C_MAPPING[self.index]["num"] + self.i2c_addr = PSU_CPLD_I2C_MAPPING[self.index]["addr"] + self.cpld_path = I2C_PATH.format(self.i2c_num, self.i2c_addr) + + self.__initialize_fan() + + logging.basicConfig(level=logging.DEBUG) + + def __initialize_fan(self): + from sonic_platform.fan import Fan + for fan_index in range(0, PSU_NUM_FAN[self.index]): + fan = Fan(fan_index, 0, is_psu_fan=True, psu_index=self.index) + self._fan_list.append(fan) + + def get_voltage(self): + """ + Retrieves current PSU voltage output + Returns: + A float number, the output voltage in volts, + e.g. 12.1 + """ + vout_path = "{}{}".format(self.hwmon_path, 'psu_v_out') + vout_val=self._api_helper.read_txt_file(vout_path) + + if vout_val is not None: + return float(vout_val)/ 1000 + else: + return 0 + + def get_current(self): + """ + Retrieves present electric current supplied by PSU + Returns: + A float number, the electric current in amperes, e.g 15.4 + """ + iout_path = "{}{}".format(self.hwmon_path, 'psu_i_out') + val=self._api_helper.read_txt_file(iout_path) + if val is not None: + return float(val)/1000 + else: + return 0 + + def get_power(self): + """ + Retrieves current energy supplied by PSU + Returns: + A float number, the power in watts, e.g. 302.6 + """ + pout_path = "{}{}".format(self.hwmon_path, 'psu_p_out') + val=self._api_helper.read_txt_file(pout_path) + if val is not None: + return float(val)/1000 + else: + return 0 + + def get_powergood_status(self): + """ + Retrieves the powergood status of PSU + Returns: + A boolean, True if PSU has stablized its output voltages and passed all + its internal self-tests, False if not. + """ + return self.get_status() + + def set_status_led(self, color): + """ + Sets the state of the PSU status LED + Args: + color: A string representing the color with which to set the PSU status LED + Note: Only support green and off + Returns: + bool: True if status LED state is set successfully, False if not + """ + + return False #Controlled by HW + + def get_status_led(self): + """ + Gets the state of the PSU status LED + Returns: + A string, one of the predefined STATUS_LED_COLOR_* strings above + """ + status=self.get_status() + if status is None: + return self.STATUS_LED_COLOR_OFF + + return { + 1: self.STATUS_LED_COLOR_GREEN, + 0: self.STATUS_LED_COLOR_RED + }.get(status, self.STATUS_LED_COLOR_OFF) + + def get_temperature(self): + """ + Retrieves current temperature reading from PSU + Returns: + A float number of current temperature in Celsius up to nearest thousandth + of one degree Celsius, e.g. 30.125 + """ + temp_path = "{}{}".format(self.hwmon_path, 'psu_temp1_input') + val=self._api_helper.read_txt_file(temp_path) + if val is not None: + return float(val)/1000 + else: + return 0 + + def get_temperature_high_threshold(self): + """ + Retrieves the high threshold temperature of PSU + Returns: + A float number, the high threshold temperature of PSU in Celsius + up to nearest thousandth of one degree Celsius, e.g. 30.125 + """ + return False #Not supported + + def get_voltage_high_threshold(self): + """ + Retrieves the high threshold PSU voltage output + Returns: + A float number, the high threshold output voltage in volts, + e.g. 12.1 + """ + vout_path = "{}{}".format(self.hwmon_path, 'psu_mfr_vout_max') + vout_val=self._api_helper.read_txt_file(vout_path) + if vout_val is not None: + return float(vout_val)/ 1000 + else: + return 0 + + def get_voltage_low_threshold(self): + """ + Retrieves the low threshold PSU voltage output + Returns: + A float number, the low threshold output voltage in volts, + e.g. 12.1 + """ + vout_path = "{}{}".format(self.hwmon_path, 'psu_mfr_vout_min') + vout_val=self._api_helper.read_txt_file(vout_path) + if vout_val is not None: + return float(vout_val)/ 1000 + else: + return 0 + + def get_name(self): + """ + Retrieves the name of the device + Returns: + string: The name of the device + """ + return PSU_NAME_LIST[self.index] + + def get_presence(self): + """ + Retrieves the presence of the PSU + Returns: + bool: True if PSU is present, False if not + """ + presence_path="{}{}".format(self.cpld_path, 'psu_present') + val=self._api_helper.read_txt_file(presence_path) + if val is not None: + return int(val, 10) == 1 + else: + return 0 + + def get_status(self): + """ + Retrieves the operational status of the device + Returns: + A boolean value, True if device is operating properly, False if not + """ + power_path="{}{}".format(self.cpld_path, 'psu_power_good') + val=self._api_helper.read_txt_file(power_path) + if val is not None: + return int(val, 10) == 1 + else: + return 0 + + def get_model(self): + """ + Retrieves the model number (or part number) of the device + Returns: + string: Model/part number of device + """ + model_path="{}{}".format(self.cpld_path, 'psu_model_name') + model=self._api_helper.read_txt_file(model_path) + + if model is None: + return "N/A" + return model + + def get_serial(self): + """ + Retrieves the serial number of the device + Returns: + string: Serial number of device + """ + serial_path="{}{}".format(self.cpld_path, 'psu_serial_number') + serial=self._api_helper.read_txt_file(serial_path) + + if serial is None: + return "N/A" + return serial diff --git a/device/accton/x86_64-accton_as7726_32x-r0/sonic_platform/sfp.py b/device/accton/x86_64-accton_as7726_32x-r0/sonic_platform/sfp.py new file mode 100644 index 000000000000..fdd11be0f253 --- /dev/null +++ b/device/accton/x86_64-accton_as7726_32x-r0/sonic_platform/sfp.py @@ -0,0 +1,1166 @@ +############################################################################# +# Edgecore +# +# Sfp contains an implementation of SONiC Platform Base API and +# provides the sfp device status which are available in the platform +# +############################################################################# + +import os +import time +import sys + +from ctypes import create_string_buffer + +try: + from sonic_platform_base.sfp_base import SfpBase + from sonic_platform_base.sonic_sfp.sff8436 import sff8436Dom + from sonic_platform_base.sonic_sfp.sff8436 import sff8436InterfaceId + from sonic_platform_base.sonic_sfp.sff8472 import sff8472Dom + from sonic_platform_base.sonic_sfp.sff8472 import sff8472InterfaceId + from sonic_platform_base.sonic_sfp.sfputilhelper import SfpUtilHelper + from .helper import APIHelper +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +CPLD_I2C_PATH = "/sys/bus/i2c/devices/11-0060/" + + +QSFP_INFO_OFFSET = 128 +QSFP_DOM_OFFSET = 0 + +SFP_INFO_OFFSET = 0 +SFP_DOM_OFFSET = 256 + +XCVR_INTFACE_BULK_OFFSET = 0 +XCVR_INTFACE_BULK_WIDTH_QSFP = 20 +XCVR_INTFACE_BULK_WIDTH_SFP = 21 +XCVR_HW_REV_WIDTH_QSFP = 2 +XCVR_HW_REV_WIDTH_SFP = 4 +XCVR_CABLE_LENGTH_WIDTH_QSFP = 5 +XCVR_VENDOR_NAME_OFFSET = 20 +XCVR_VENDOR_NAME_WIDTH = 16 +XCVR_VENDOR_OUI_OFFSET = 37 +XCVR_VENDOR_OUI_WIDTH = 3 +XCVR_VENDOR_PN_OFFSET = 40 +XCVR_VENDOR_PN_WIDTH = 16 +XCVR_HW_REV_OFFSET = 56 +XCVR_HW_REV_WIDTH_OSFP = 2 +XCVR_HW_REV_WIDTH_SFP = 4 +XCVR_VENDOR_SN_OFFSET = 68 +XCVR_VENDOR_SN_WIDTH = 16 +XCVR_VENDOR_DATE_OFFSET = 84 +XCVR_VENDOR_DATE_WIDTH = 8 +XCVR_DOM_CAPABILITY_OFFSET = 92 +XCVR_DOM_CAPABILITY_WIDTH = 1 + +# Offset for values in QSFP eeprom +QSFP_DOM_REV_OFFSET = 1 +QSFP_DOM_REV_WIDTH = 1 +QSFP_TEMPE_OFFSET = 22 +QSFP_TEMPE_WIDTH = 2 +QSFP_VOLT_OFFSET = 26 +QSFP_VOLT_WIDTH = 2 +QSFP_CHANNL_MON_OFFSET = 34 +QSFP_CHANNL_MON_WIDTH = 16 +QSFP_CHANNL_MON_WITH_TX_POWER_WIDTH = 24 +QSFP_CONTROL_OFFSET = 86 +QSFP_CONTROL_WIDTH = 8 +QSFP_CHANNL_RX_LOS_STATUS_OFFSET = 3 +QSFP_CHANNL_RX_LOS_STATUS_WIDTH = 1 +QSFP_CHANNL_TX_FAULT_STATUS_OFFSET = 4 +QSFP_CHANNL_TX_FAULT_STATUS_WIDTH = 1 +QSFP_POWEROVERRIDE_OFFSET = 93 +QSFP_POWEROVERRIDE_WIDTH = 1 +QSFP_MODULE_THRESHOLD_OFFSET = 128 +QSFP_MODULE_THRESHOLD_WIDTH = 24 +QSFP_CHANNEL_THRESHOLD_OFFSET = 176 +QSFP_CHANNEL_THRESHOLD_WIDTH = 16 + +qsfp_cable_length_tup = ('Length(km)', 'Length OM3(2m)', + 'Length OM2(m)', 'Length OM1(m)', + 'Length Cable Assembly(m)') + +qsfp_compliance_code_tup = ('10/40G Ethernet Compliance Code', 'SONET Compliance codes', + 'SAS/SATA compliance codes', 'Gigabit Ethernet Compliant codes', + 'Fibre Channel link length/Transmitter Technology', + 'Fibre Channel transmission media', 'Fibre Channel Speed') + + +# Offset for values in SFP eeprom +SFP_TEMPE_OFFSET = 96 +SFP_TEMPE_WIDTH = 2 +SFP_VOLT_OFFSET = 98 +SFP_VOLT_WIDTH = 2 +SFP_CHANNL_MON_OFFSET = 100 +SFP_CHANNL_MON_WIDTH = 6 +SFP_MODULE_THRESHOLD_OFFSET = 0 +SFP_MODULE_THRESHOLD_WIDTH = 40 +SFP_CHANNL_THRESHOLD_OFFSET = 112 +SFP_CHANNL_THRESHOLD_WIDTH = 2 +SFP_STATUS_CONTROL_OFFSET = 110 +SFP_STATUS_CONTROL_WIDTH = 1 +SFP_TX_DISABLE_HARD_BIT = 7 +SFP_TX_DISABLE_SOFT_BIT = 6 + +sfp_cable_length_tup = ('LengthSMFkm-UnitsOfKm', 'LengthSMF(UnitsOf100m)', + 'Length50um(UnitsOf10m)', 'Length62.5um(UnitsOfm)', + 'LengthCable(UnitsOfm)', 'LengthOM3(UnitsOf10m)') + +sfp_compliance_code_tup = ('10GEthernetComplianceCode', 'InfinibandComplianceCode', + 'ESCONComplianceCodes', 'SONETComplianceCodes', + 'EthernetComplianceCodes', 'FibreChannelLinkLength', + 'FibreChannelTechnology', 'SFP+CableTechnology', + 'FibreChannelTransmissionMedia', 'FibreChannelSpeed') + + +class Sfp(SfpBase): + """Platform-specific Sfp class""" + + # Port number + PORT_START = 1 + PORT_END = 34 + + # Path to sysfs + PLATFORM_ROOT_PATH = "/usr/share/sonic/device" + PMON_HWSKU_PATH = "/usr/share/sonic/hwsku" + HOST_CHK_CMD = "docker > /dev/null 2>&1" + + PLATFORM = "x86_64-accton_as7726_32x-r0" + HWSKU = "Accton-AS7726-32X" + + _port_to_i2c_mapping = { + 1: 21, + 2: 22, + 3: 23, + 4: 24, + 5: 26, + 6: 25, + 7: 28, + 8: 27, + 9: 17, + 10: 18, + 11: 19, + 12: 20, + 13: 29, + 14: 30, + 15: 31, + 16: 32, + 17: 33, + 18: 34, + 19: 35, + 20: 36, + 21: 45, + 22: 46, + 23: 47, + 24: 48, + 25: 37, + 26: 38, + 27: 39, + 28: 40, + 29: 41, + 30: 42, + 31: 43, + 32: 44, + 33: 15, + 34: 16 + } + + def __init__(self, sfp_index=0): + self._api_helper=APIHelper() + # Init index + self.index = sfp_index + self.port_num = self.index + 1 + # Init eeprom path + eeprom_path = '/sys/bus/i2c/devices/{0}-0050/eeprom' + self.port_to_eeprom_mapping = {} + for x in range(self.PORT_START, self.PORT_END + 1): + self.port_to_eeprom_mapping[x] = eeprom_path.format(self._port_to_i2c_mapping[x]) + + self.info_dict_keys = ['type', 'hardware_rev', 'serial', 'manufacturer', 'model', 'connector', 'encoding', 'ext_identifier', + 'ext_rateselect_compliance', 'cable_type', 'cable_length', 'nominal_bit_rate', 'specification_compliance', 'vendor_date', 'vendor_oui', + 'application_advertisement', 'type_abbrv_name'] + + self.dom_dict_keys = ['rx_los', 'tx_fault', 'reset_status', 'power_lpmode', 'tx_disable', 'tx_disable_channel', 'temperature', 'voltage', + 'rx1power', 'rx2power', 'rx3power', 'rx4power', 'tx1bias', 'tx2bias', 'tx3bias', 'tx4bias', 'tx1power', 'tx2power', 'tx3power', 'tx4power'] + + self.threshold_dict_keys = ['temphighalarm', 'temphighwarning', 'templowalarm', 'templowwarning', 'vcchighalarm', 'vcchighwarning', 'vcclowalarm', 'vcclowwarning', 'rxpowerhighalarm', 'rxpowerhighwarning', + 'rxpowerlowalarm', 'rxpowerlowwarning', 'txpowerhighalarm', 'txpowerhighwarning', 'txpowerlowalarm', 'txpowerlowwarning', 'txbiashighalarm', 'txbiashighwarning', 'txbiaslowalarm', 'txbiaslowwarning'] + + SfpBase.__init__(self) + + def _convert_string_to_num(self, value_str): + if "-inf" in value_str: + return 'N/A' + elif "Unknown" in value_str: + return 'N/A' + elif 'dBm' in value_str: + t_str = value_str.rstrip('dBm') + return float(t_str) + elif 'mA' in value_str: + t_str = value_str.rstrip('mA') + return float(t_str) + elif 'C' in value_str: + t_str = value_str.rstrip('C') + return float(t_str) + elif 'Volts' in value_str: + t_str = value_str.rstrip('Volts') + return float(t_str) + else: + return 'N/A' + + def __is_host(self): + return os.system(self.HOST_CHK_CMD) == 0 + + def __get_path_to_port_config_file(self): + platform_path = "/".join([self.PLATFORM_ROOT_PATH, self.PLATFORM]) + hwsku_path = "/".join([platform_path, self.HWSKU] + ) if self.__is_host() else self.PMON_HWSKU_PATH + return "/".join([hwsku_path, "port_config.ini"]) + + def __read_eeprom_specific_bytes(self, offset, num_bytes): + sysfsfile_eeprom = None + eeprom_raw = [] + for i in range(0, num_bytes): + eeprom_raw.append("0x00") + + sysfs_sfp_i2c_client_eeprom_path = self.port_to_eeprom_mapping[self.port_num] + try: + sysfsfile_eeprom = open( + sysfs_sfp_i2c_client_eeprom_path, mode="rb", buffering=0) + sysfsfile_eeprom.seek(offset) + raw = sysfsfile_eeprom.read(num_bytes) + if sys.version_info[0] >= 3: + for n in range(0, num_bytes): + eeprom_raw[n] = hex(raw[n])[2:].zfill(2) + else: + for n in range(0, num_bytes): + eeprom_raw[n] = hex(ord(raw[n]))[2:].zfill(2) + except Exception: + pass + finally: + if sysfsfile_eeprom: + sysfsfile_eeprom.close() + + return eeprom_raw + + def get_transceiver_info(self): + """ + Retrieves transceiver info of this SFP + Returns: + A dict which contains following keys/values : + ======================================================================== + keys |Value Format |Information + ---------------------------|---------------|---------------------------- + type |1*255VCHAR |type of SFP + hardware_rev |1*255VCHAR |hardware version of SFP + serial |1*255VCHAR |serial number of the SFP + manufacturer |1*255VCHAR |SFP vendor name + model |1*255VCHAR |SFP model name + connector |1*255VCHAR |connector information + encoding |1*255VCHAR |encoding information + ext_identifier |1*255VCHAR |extend identifier + ext_rateselect_compliance |1*255VCHAR |extended rateSelect compliance + cable_length |INT |cable length in m + nominal_bit_rate |INT |nominal bit rate by 100Mbs + specification_compliance |1*255VCHAR |specification compliance + vendor_date |1*255VCHAR |vendor date + vendor_oui |1*255VCHAR |vendor OUI + application_advertisement |1*255VCHAR |supported applications advertisement + ======================================================================== + """ + if self.port_num >= 33: + sfpi_obj = sff8472InterfaceId() #SFP + else: + sfpi_obj = sff8436InterfaceId() #QSFP + + if not self.get_presence() or not sfpi_obj: + return {} + + if self.port_num >=33: + offset = SFP_INFO_OFFSET + sfp_interface_bulk_raw = self.__read_eeprom_specific_bytes( + (offset + XCVR_INTFACE_BULK_OFFSET), XCVR_INTFACE_BULK_WIDTH_SFP) + else: + offset = QSFP_INFO_OFFSET + sfp_interface_bulk_raw = self.__read_eeprom_specific_bytes( + (offset + XCVR_INTFACE_BULK_OFFSET), XCVR_INTFACE_BULK_WIDTH_QSFP) + + sfp_interface_bulk_data = sfpi_obj.parse_sfp_info_bulk( + sfp_interface_bulk_raw, 0) + + sfp_vendor_name_raw = self.__read_eeprom_specific_bytes( + (offset + XCVR_VENDOR_NAME_OFFSET), XCVR_VENDOR_NAME_WIDTH) + sfp_vendor_name_data = sfpi_obj.parse_vendor_name( + sfp_vendor_name_raw, 0) + + sfp_vendor_pn_raw = self.__read_eeprom_specific_bytes( + (offset + XCVR_VENDOR_PN_OFFSET), XCVR_VENDOR_PN_WIDTH) + sfp_vendor_pn_data = sfpi_obj.parse_vendor_pn( + sfp_vendor_pn_raw, 0) + + if self.port_num >=33: + sfp_vendor_rev_raw = self.__read_eeprom_specific_bytes( + (offset + XCVR_HW_REV_OFFSET), XCVR_HW_REV_WIDTH_SFP) + else: + sfp_vendor_rev_raw = self.__read_eeprom_specific_bytes( + (offset + XCVR_HW_REV_OFFSET), XCVR_HW_REV_WIDTH_QSFP) + + sfp_vendor_rev_data = sfpi_obj.parse_vendor_rev( + sfp_vendor_rev_raw, 0) + + sfp_vendor_sn_raw = self.__read_eeprom_specific_bytes( + (offset + XCVR_VENDOR_SN_OFFSET), XCVR_VENDOR_SN_WIDTH) + sfp_vendor_sn_data = sfpi_obj.parse_vendor_sn( + sfp_vendor_sn_raw, 0) + + sfp_vendor_oui_raw = self.__read_eeprom_specific_bytes( + (offset + XCVR_VENDOR_OUI_OFFSET), XCVR_VENDOR_OUI_WIDTH) + if sfp_vendor_oui_raw is not None: + sfp_vendor_oui_data = sfpi_obj.parse_vendor_oui( + sfp_vendor_oui_raw, 0) + + sfp_vendor_date_raw = self.__read_eeprom_specific_bytes( + (offset + XCVR_VENDOR_DATE_OFFSET), XCVR_VENDOR_DATE_WIDTH) + sfp_vendor_date_data = sfpi_obj.parse_vendor_date( + sfp_vendor_date_raw, 0) + + transceiver_info_dict = dict.fromkeys(self.info_dict_keys, 'N/A') + compliance_code_dict = dict() + + if sfp_interface_bulk_data: + transceiver_info_dict['type'] = sfp_interface_bulk_data['data']['type']['value'] + transceiver_info_dict['connector'] = sfp_interface_bulk_data['data']['Connector']['value'] + transceiver_info_dict['encoding'] = sfp_interface_bulk_data['data']['EncodingCodes']['value'] + transceiver_info_dict['ext_identifier'] = sfp_interface_bulk_data['data']['Extended Identifier']['value'] + transceiver_info_dict['ext_rateselect_compliance'] = sfp_interface_bulk_data['data']['RateIdentifier']['value'] + transceiver_info_dict['type_abbrv_name'] = sfp_interface_bulk_data['data']['type_abbrv_name']['value'] + + transceiver_info_dict['manufacturer'] = sfp_vendor_name_data[ + 'data']['Vendor Name']['value'] if sfp_vendor_name_data else 'N/A' + transceiver_info_dict['model'] = sfp_vendor_pn_data['data']['Vendor PN']['value'] if sfp_vendor_pn_data else 'N/A' + transceiver_info_dict['hardware_rev'] = sfp_vendor_rev_data['data']['Vendor Rev']['value'] if sfp_vendor_rev_data else 'N/A' + transceiver_info_dict['serial'] = sfp_vendor_sn_data['data']['Vendor SN']['value'] if sfp_vendor_sn_data else 'N/A' + transceiver_info_dict['vendor_oui'] = sfp_vendor_oui_data['data']['Vendor OUI']['value'] if sfp_vendor_oui_data else 'N/A' + transceiver_info_dict['vendor_date'] = sfp_vendor_date_data[ + 'data']['VendorDataCode(YYYY-MM-DD Lot)']['value'] if sfp_vendor_date_data else 'N/A' + transceiver_info_dict['cable_type'] = "Unknown" + transceiver_info_dict['cable_length'] = "Unknown" + + if self.port_num >=33: + for key in sfp_cable_length_tup: + if key in sfp_interface_bulk_data['data']: + transceiver_info_dict['cable_type'] = key + transceiver_info_dict['cable_length'] = str( + sfp_interface_bulk_data['data'][key]['value']) + + for key in sfp_compliance_code_tup: + if key in sfp_interface_bulk_data['data']['Specification compliance']['value']: + compliance_code_dict[key] = sfp_interface_bulk_data['data']['Specification compliance']['value'][key]['value'] + + transceiver_info_dict['specification_compliance'] = str( + compliance_code_dict) + transceiver_info_dict['nominal_bit_rate'] = str( + sfp_interface_bulk_data['data']['NominalSignallingRate(UnitsOf100Mbd)']['value']) + else: + for key in qsfp_cable_length_tup: + if key in sfp_interface_bulk_data['data']: + transceiver_info_dict['cable_type'] = key + transceiver_info_dict['cable_length'] = str( + sfp_interface_bulk_data['data'][key]['value']) + + for key in qsfp_compliance_code_tup: + if key in sfp_interface_bulk_data['data']['Specification compliance']['value']: + compliance_code_dict[key] = sfp_interface_bulk_data['data']['Specification compliance']['value'][key]['value'] + + transceiver_info_dict['specification_compliance'] = str( + compliance_code_dict) + transceiver_info_dict['nominal_bit_rate'] = str( + sfp_interface_bulk_data['data']['Nominal Bit Rate(100Mbs)']['value']) + + + return transceiver_info_dict + + def get_transceiver_bulk_status(self): + """ + Retrieves transceiver bulk status of this SFP + Returns: + A dict which contains following keys/values : + ======================================================================== + keys |Value Format |Information + ---------------------------|---------------|---------------------------- + rx_los |BOOLEAN |RX loss-of-signal status, True if has RX los, False if not. + tx_fault |BOOLEAN |TX fault status, True if has TX fault, False if not. + reset_status |BOOLEAN |reset status, True if SFP in reset, False if not. + lp_mode |BOOLEAN |low power mode status, True in lp mode, False if not. + tx_disable |BOOLEAN |TX disable status, True TX disabled, False if not. + tx_disabled_channel |HEX |disabled TX channels in hex, bits 0 to 3 represent channel 0 + | |to channel 3. + temperature |INT |module temperature in Celsius + voltage |INT |supply voltage in mV + txbias |INT |TX Bias Current in mA, n is the channel number, + | |for example, tx2bias stands for tx bias of channel 2. + rxpower |INT |received optical power in mW, n is the channel number, + | |for example, rx2power stands for rx power of channel 2. + txpower |INT |TX output power in mW, n is the channel number, + | |for example, tx2power stands for tx power of channel 2. + ======================================================================== + """ + # check present status + if self.port_num >=33: #SFP case + sfpd_obj = sff8472Dom() + if not self.get_presence() or not sfpd_obj: + return {} + + eeprom_ifraw = self.__read_eeprom_specific_bytes(0, SFP_DOM_OFFSET) + sfpi_obj = sff8472InterfaceId(eeprom_ifraw) + cal_type = sfpi_obj.get_calibration_type() + sfpd_obj._calibration_type = cal_type + + offset = SFP_DOM_OFFSET + transceiver_dom_info_dict = dict.fromkeys(self.dom_dict_keys, 'N/A') + dom_temperature_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_TEMPE_OFFSET), SFP_TEMPE_WIDTH) + + if dom_temperature_raw is not None: + dom_temperature_data = sfpd_obj.parse_temperature( + dom_temperature_raw, 0) + transceiver_dom_info_dict['temperature'] = dom_temperature_data['data']['Temperature']['value'] + + dom_voltage_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_VOLT_OFFSET), SFP_VOLT_WIDTH) + if dom_voltage_raw is not None: + dom_voltage_data = sfpd_obj.parse_voltage(dom_voltage_raw, 0) + transceiver_dom_info_dict['voltage'] = dom_voltage_data['data']['Vcc']['value'] + + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_CHANNL_MON_OFFSET), SFP_CHANNL_MON_WIDTH) + if dom_channel_monitor_raw is not None: + dom_voltage_data = sfpd_obj.parse_channel_monitor_params( + dom_channel_monitor_raw, 0) + transceiver_dom_info_dict['tx1power'] = dom_voltage_data['data']['TXPower']['value'] + transceiver_dom_info_dict['rx1power'] = dom_voltage_data['data']['RXPower']['value'] + transceiver_dom_info_dict['tx1bias'] = dom_voltage_data['data']['TXBias']['value'] + + else: #QSFP case + sfpd_obj = sff8436Dom() + sfpi_obj = sff8436InterfaceId() + + if not self.get_presence() or not sfpi_obj or not sfpd_obj: + return {} + + transceiver_dom_info_dict = dict.fromkeys(self.dom_dict_keys, 'N/A') + offset = QSFP_DOM_OFFSET + offset_xcvr = QSFP_INFO_OFFSET + + # QSFP capability byte parse, through this byte can know whether it support tx_power or not. + # TODO: in the future when decided to migrate to support SFF-8636 instead of SFF-8436, + # need to add more code for determining the capability and version compliance + # in SFF-8636 dom capability definitions evolving with the versions. + qsfp_dom_capability_raw = self.__read_eeprom_specific_bytes( + (offset_xcvr + XCVR_DOM_CAPABILITY_OFFSET), XCVR_DOM_CAPABILITY_WIDTH) + if qsfp_dom_capability_raw is not None: + qspf_dom_capability_data = sfpi_obj.parse_dom_capability( + qsfp_dom_capability_raw, 0) + else: + return None + + dom_temperature_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_TEMPE_OFFSET), QSFP_TEMPE_WIDTH) + if dom_temperature_raw is not None: + dom_temperature_data = sfpd_obj.parse_temperature( + dom_temperature_raw, 0) + transceiver_dom_info_dict['temperature'] = dom_temperature_data['data']['Temperature']['value'] + + dom_voltage_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_VOLT_OFFSET), QSFP_VOLT_WIDTH) + if dom_voltage_raw is not None: + dom_voltage_data = sfpd_obj.parse_voltage(dom_voltage_raw, 0) + transceiver_dom_info_dict['voltage'] = dom_voltage_data['data']['Vcc']['value'] + + qsfp_dom_rev_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_DOM_REV_OFFSET), QSFP_DOM_REV_WIDTH) + if qsfp_dom_rev_raw is not None: + qsfp_dom_rev_data = sfpd_obj.parse_sfp_dom_rev(qsfp_dom_rev_raw, 0) + qsfp_dom_rev = qsfp_dom_rev_data['data']['dom_rev']['value'] + + # The tx_power monitoring is only available on QSFP which compliant with SFF-8636 + # and claimed that it support tx_power with one indicator bit. + dom_channel_monitor_data = {} + dom_channel_monitor_raw = None + qsfp_tx_power_support = qspf_dom_capability_data['data']['Tx_power_support']['value'] + if (qsfp_dom_rev[0:8] != 'SFF-8636' or (qsfp_dom_rev[0:8] == 'SFF-8636' and qsfp_tx_power_support != 'on')): + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_CHANNL_MON_OFFSET), QSFP_CHANNL_MON_WIDTH) + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = sfpd_obj.parse_channel_monitor_params( + dom_channel_monitor_raw, 0) + + else: + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_CHANNL_MON_OFFSET), QSFP_CHANNL_MON_WITH_TX_POWER_WIDTH) + + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = sfpd_obj.parse_channel_monitor_params_with_tx_power( + dom_channel_monitor_raw, 0) + transceiver_dom_info_dict['tx1power'] = dom_channel_monitor_data['data']['TX1Power']['value'] + transceiver_dom_info_dict['tx2power'] = dom_channel_monitor_data['data']['TX2Power']['value'] + transceiver_dom_info_dict['tx3power'] = dom_channel_monitor_data['data']['TX3Power']['value'] + transceiver_dom_info_dict['tx4power'] = dom_channel_monitor_data['data']['TX4Power']['value'] + + if dom_channel_monitor_raw: + transceiver_dom_info_dict['rx1power'] = dom_channel_monitor_data['data']['RX1Power']['value'] + transceiver_dom_info_dict['rx2power'] = dom_channel_monitor_data['data']['RX2Power']['value'] + transceiver_dom_info_dict['rx3power'] = dom_channel_monitor_data['data']['RX3Power']['value'] + transceiver_dom_info_dict['rx4power'] = dom_channel_monitor_data['data']['RX4Power']['value'] + transceiver_dom_info_dict['tx1bias'] = dom_channel_monitor_data['data']['TX1Bias']['value'] + transceiver_dom_info_dict['tx2bias'] = dom_channel_monitor_data['data']['TX2Bias']['value'] + transceiver_dom_info_dict['tx3bias'] = dom_channel_monitor_data['data']['TX3Bias']['value'] + transceiver_dom_info_dict['tx4bias'] = dom_channel_monitor_data['data']['TX4Bias']['value'] + #End of else + + + for key in transceiver_dom_info_dict: + transceiver_dom_info_dict[key] = self._convert_string_to_num( + transceiver_dom_info_dict[key]) + + transceiver_dom_info_dict['rx_los'] = self.get_rx_los() + transceiver_dom_info_dict['tx_fault'] = self.get_tx_fault() + transceiver_dom_info_dict['reset_status'] = self.get_reset_status() + transceiver_dom_info_dict['lp_mode'] = self.get_lpmode() + + return transceiver_dom_info_dict + + def get_transceiver_threshold_info(self): + """ + Retrieves transceiver threshold info of this SFP + Returns: + A dict which contains following keys/values : + ======================================================================== + keys |Value Format |Information + ---------------------------|---------------|---------------------------- + temphighalarm |FLOAT |High Alarm Threshold value of temperature in Celsius. + templowalarm |FLOAT |Low Alarm Threshold value of temperature in Celsius. + temphighwarning |FLOAT |High Warning Threshold value of temperature in Celsius. + templowwarning |FLOAT |Low Warning Threshold value of temperature in Celsius. + vcchighalarm |FLOAT |High Alarm Threshold value of supply voltage in mV. + vcclowalarm |FLOAT |Low Alarm Threshold value of supply voltage in mV. + vcchighwarning |FLOAT |High Warning Threshold value of supply voltage in mV. + vcclowwarning |FLOAT |Low Warning Threshold value of supply voltage in mV. + rxpowerhighalarm |FLOAT |High Alarm Threshold value of received power in dBm. + rxpowerlowalarm |FLOAT |Low Alarm Threshold value of received power in dBm. + rxpowerhighwarning |FLOAT |High Warning Threshold value of received power in dBm. + rxpowerlowwarning |FLOAT |Low Warning Threshold value of received power in dBm. + txpowerhighalarm |FLOAT |High Alarm Threshold value of transmit power in dBm. + txpowerlowalarm |FLOAT |Low Alarm Threshold value of transmit power in dBm. + txpowerhighwarning |FLOAT |High Warning Threshold value of transmit power in dBm. + txpowerlowwarning |FLOAT |Low Warning Threshold value of transmit power in dBm. + txbiashighalarm |FLOAT |High Alarm Threshold value of tx Bias Current in mA. + txbiaslowalarm |FLOAT |Low Alarm Threshold value of tx Bias Current in mA. + txbiashighwarning |FLOAT |High Warning Threshold value of tx Bias Current in mA. + txbiaslowwarning |FLOAT |Low Warning Threshold value of tx Bias Current in mA. + ======================================================================== + """ + # check present status + if self.port_num >= 33: + sfpd_obj = sff8472Dom() + + if not self.get_presence() and not sfpd_obj: + return {} + + eeprom_ifraw = self.__read_eeprom_specific_bytes(0, SFP_DOM_OFFSET) + sfpi_obj = sff8472InterfaceId(eeprom_ifraw) + cal_type = sfpi_obj.get_calibration_type() + sfpd_obj._calibration_type = cal_type + + offset = SFP_DOM_OFFSET + transceiver_dom_threshold_info_dict = dict.fromkeys( + self.threshold_dict_keys, 'N/A') + dom_module_threshold_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_MODULE_THRESHOLD_OFFSET), SFP_MODULE_THRESHOLD_WIDTH) + + if dom_module_threshold_raw is not None: + dom_module_threshold_data = sfpd_obj.parse_alarm_warning_threshold( + dom_module_threshold_raw, 0) + + transceiver_dom_threshold_info_dict['temphighalarm'] = dom_module_threshold_data['data']['TempHighAlarm']['value'] + transceiver_dom_threshold_info_dict['templowalarm'] = dom_module_threshold_data['data']['TempLowAlarm']['value'] + transceiver_dom_threshold_info_dict['temphighwarning'] = dom_module_threshold_data['data']['TempHighWarning']['value'] + transceiver_dom_threshold_info_dict['templowwarning'] = dom_module_threshold_data['data']['TempLowWarning']['value'] + transceiver_dom_threshold_info_dict['vcchighalarm'] = dom_module_threshold_data['data']['VoltageHighAlarm']['value'] + transceiver_dom_threshold_info_dict['vcclowalarm'] = dom_module_threshold_data['data']['VoltageLowAlarm']['value'] + transceiver_dom_threshold_info_dict['vcchighwarning'] = dom_module_threshold_data[ + 'data']['VoltageHighWarning']['value'] + transceiver_dom_threshold_info_dict['vcclowwarning'] = dom_module_threshold_data['data']['VoltageLowWarning']['value'] + transceiver_dom_threshold_info_dict['txbiashighalarm'] = dom_module_threshold_data['data']['BiasHighAlarm']['value'] + transceiver_dom_threshold_info_dict['txbiaslowalarm'] = dom_module_threshold_data['data']['BiasLowAlarm']['value'] + transceiver_dom_threshold_info_dict['txbiashighwarning'] = dom_module_threshold_data['data']['BiasHighWarning']['value'] + transceiver_dom_threshold_info_dict['txbiaslowwarning'] = dom_module_threshold_data['data']['BiasLowWarning']['value'] + transceiver_dom_threshold_info_dict['txpowerhighalarm'] = dom_module_threshold_data['data']['TXPowerHighAlarm']['value'] + transceiver_dom_threshold_info_dict['txpowerlowalarm'] = dom_module_threshold_data['data']['TXPowerLowAlarm']['value'] + transceiver_dom_threshold_info_dict['txpowerhighwarning'] = dom_module_threshold_data['data']['TXPowerHighWarning']['value'] + transceiver_dom_threshold_info_dict['txpowerlowwarning'] = dom_module_threshold_data['data']['TXPowerLowWarning']['value'] + transceiver_dom_threshold_info_dict['rxpowerhighalarm'] = dom_module_threshold_data['data']['RXPowerHighAlarm']['value'] + transceiver_dom_threshold_info_dict['rxpowerlowalarm'] = dom_module_threshold_data['data']['RXPowerLowAlarm']['value'] + transceiver_dom_threshold_info_dict['rxpowerhighwarning'] = dom_module_threshold_data['data']['RXPowerHighWarning']['value'] + transceiver_dom_threshold_info_dict['rxpowerlowwarning'] = dom_module_threshold_data['data']['RXPowerLowWarning']['value'] + + for key in transceiver_dom_threshold_info_dict: + transceiver_dom_threshold_info_dict[key] = self._convert_string_to_num( + transceiver_dom_threshold_info_dict[key]) + + return transceiver_dom_threshold_info_dict + + + else: + sfpd_obj = sff8436Dom() + + if not self.get_presence() or not sfpd_obj: + return {} + + transceiver_dom_threshold_dict = dict.fromkeys( + self.threshold_dict_keys, 'N/A') + dom_thres_raw = self.__read_eeprom_specific_bytes( + QSFP_MODULE_THRESHOLD_OFFSET, QSFP_MODULE_THRESHOLD_WIDTH) if self.get_presence() and sfpd_obj else None + + if dom_thres_raw: + module_threshold_values = sfpd_obj.parse_module_threshold_values( + dom_thres_raw, 0) + module_threshold_data = module_threshold_values.get('data') + if module_threshold_data: + transceiver_dom_threshold_dict['temphighalarm'] = module_threshold_data['TempHighAlarm']['value'] + transceiver_dom_threshold_dict['templowalarm'] = module_threshold_data['TempLowAlarm']['value'] + transceiver_dom_threshold_dict['temphighwarning'] = module_threshold_data['TempHighWarning']['value'] + transceiver_dom_threshold_dict['templowwarning'] = module_threshold_data['TempLowWarning']['value'] + transceiver_dom_threshold_dict['vcchighalarm'] = module_threshold_data['VccHighAlarm']['value'] + transceiver_dom_threshold_dict['vcclowalarm'] = module_threshold_data['VccLowAlarm']['value'] + transceiver_dom_threshold_dict['vcchighwarning'] = module_threshold_data['VccHighWarning']['value'] + transceiver_dom_threshold_dict['vcclowwarning'] = module_threshold_data['VccLowWarning']['value'] + + dom_thres_raw = self.__read_eeprom_specific_bytes( + QSFP_CHANNEL_THRESHOLD_OFFSET, QSFP_CHANNEL_THRESHOLD_WIDTH) if self.get_presence() and sfpd_obj else None + channel_threshold_values = sfpd_obj.parse_channel_threshold_values( + dom_thres_raw, 0) + channel_threshold_data = channel_threshold_values.get('data') + if channel_threshold_data: + transceiver_dom_threshold_dict['rxpowerhighalarm'] = channel_threshold_data['RxPowerHighAlarm']['value'] + transceiver_dom_threshold_dict['rxpowerlowalarm'] = channel_threshold_data['RxPowerLowAlarm']['value'] + transceiver_dom_threshold_dict['rxpowerhighwarning'] = channel_threshold_data['RxPowerHighWarning']['value'] + transceiver_dom_threshold_dict['rxpowerlowwarning'] = channel_threshold_data['RxPowerLowWarning']['value'] + transceiver_dom_threshold_dict['txpowerhighalarm'] = "0.0dBm" + transceiver_dom_threshold_dict['txpowerlowalarm'] = "0.0dBm" + transceiver_dom_threshold_dict['txpowerhighwarning'] = "0.0dBm" + transceiver_dom_threshold_dict['txpowerlowwarning'] = "0.0dBm" + transceiver_dom_threshold_dict['txbiashighalarm'] = channel_threshold_data['TxBiasHighAlarm']['value'] + transceiver_dom_threshold_dict['txbiaslowalarm'] = channel_threshold_data['TxBiasLowAlarm']['value'] + transceiver_dom_threshold_dict['txbiashighwarning'] = channel_threshold_data['TxBiasHighWarning']['value'] + transceiver_dom_threshold_dict['txbiaslowwarning'] = channel_threshold_data['TxBiasLowWarning']['value'] + + for key in transceiver_dom_threshold_dict: + transceiver_dom_threshold_dict[key] = self._convert_string_to_num( + transceiver_dom_threshold_dict[key]) + + return transceiver_dom_threshold_dict + + def get_reset_status(self): + """ + Retrieves the reset status of SFP + Returns: + A Boolean, True if reset enabled, False if disabled + """ + if self.port_num >=33: + return False + + reset_path="{}{}{}".format(CPLD_I2C_PATH , "module_reset_" , str(self.port_num)) + val = self._api_helper.read_txt_file(reset_path) + + if val is not None: + return int(val, 10) == 1 + else: + return False + + def get_rx_los(self): + """ + Retrieves the RX LOS (lost-of-signal) status of SFP + Returns: + A Boolean, True if SFP has RX LOS, False if not. + Note : RX LOS status is latched until a call to get_rx_los or a reset. + """ + #rx_los = False + rx_los_list = [] + + if self.port_num >=33: + #offset = 256 + #status_control_raw = self.__read_eeprom_specific_bytes( + # offset+SFP_STATUS_CONTROL_OFFSET, SFP_STATUS_CONTROL_WIDTH) + #if status_control_raw: + # data = int(status_control_raw[0], 16) + # rx_los_list.append(rx_los_data & 0x02 != 0) + rx_path = "{}{}{}".format(CPLD_I2C_PATH, '/module_rx_los_', self.port_num) + rx_los=self._api_helper.read_txt_file(rx_path) + if rx_los is None: + return [False] + else: + return rx_los + + else: + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + QSFP_CHANNL_RX_LOS_STATUS_OFFSET, QSFP_CHANNL_RX_LOS_STATUS_WIDTH) if self.get_presence() else None + + if dom_channel_monitor_raw is not None: + rx_los_data = int(dom_channel_monitor_raw[0], 16) + + rx_los_list.append(rx_los_data & 0x01 != 0) + rx_los_list.append(rx_los_data & 0x02 != 0) + rx_los_list.append(rx_los_data & 0x04 != 0) + rx_los_list.append(rx_los_data & 0x08 != 0) + #rx_los = rx_los_list[0] and rx_los_list[1] and rx_los_list[2] and rx_los_list[3] + else: + return [False] * 4 + + return rx_los_list + + def get_tx_fault(self): + """ + Retrieves the TX fault status of SFP + Returns: + A Boolean, True if SFP has TX fault, False if not + Note : TX fault status is lached until a call to get_tx_fault or a reset. + """ + #tx_fault = False + + tx_fault_list = [] + + if self.port_num >=33: + offset=256 + status_control_raw = self.__read_eeprom_specific_bytes( + offset+SFP_STATUS_CONTROL_OFFSET, SFP_STATUS_CONTROL_WIDTH) + if status_control_raw is not None: + tx_fault_data = int(status_control_raw[0], 16) + tx_fault_list.append(tx_fault_data & 0x04 != 0) + else: + return None + + else: + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + QSFP_CHANNL_TX_FAULT_STATUS_OFFSET, QSFP_CHANNL_TX_FAULT_STATUS_WIDTH) if self.get_presence() else None + if dom_channel_monitor_raw is not None: + tx_fault_data = int(dom_channel_monitor_raw[0], 16) + tx_fault_list.append(tx_fault_data & 0x01 != 0) + tx_fault_list.append(tx_fault_data & 0x02 != 0) + tx_fault_list.append(tx_fault_data & 0x04 != 0) + tx_fault_list.append(tx_fault_data & 0x08 != 0) + #tx_fault = tx_fault_list[0] and tx_fault_list[1] and tx_fault_list[2] and tx_fault_list[3] + + return tx_fault_list + + def get_tx_disable(self): + """ + Retrieves the tx_disable status of this SFP + Returns: + A Boolean, True if tx_disable is enabled, False if disabled + """ + + tx_disable_list = [] + + if self.port_num >=33: + #offset = 256 + #status_control_raw = self._read_eeprom_specific_bytes( + # (offset + SFP_STATUS_CONTROL_OFFSET), SFP_STATUS_CONTROL_WIDTH) + #if status_control_raw is not None: + # tx_disable_data = int(status_control_raw[0], 16) + # tx_disable_list.append(tx_disable_data & 0xC0 != 0) + #else: + # return [False] + tx_path = "{}{}{}".format(CPLD_I2C_PATH, '/module_tx_disable_', self.port_num) + tx_disable=self._api_helper.read_txt_file(tx_path) + if tx_disable is not None: + return tx_disable + else: + return False + + + else: + sfpd_obj = sff8436Dom() + if sfpd_obj is None: + return False + + dom_control_raw = self.__read_eeprom_specific_bytes( + QSFP_CONTROL_OFFSET, QSFP_CONTROL_WIDTH) if self.get_presence() else None + if dom_control_raw is not None: + dom_control_data = sfpd_obj.parse_control_bytes(dom_control_raw, 0) + tx_disable_list.append( + 'On' == dom_control_data['data']['TX1Disable']['value']) + tx_disable_list.append( + 'On' == dom_control_data['data']['TX2Disable']['value']) + tx_disable_list.append( + 'On' == dom_control_data['data']['TX3Disable']['value']) + tx_disable_list.append( + 'On' == dom_control_data['data']['TX4Disable']['value']) + else: + return [False] * 4 + + return tx_disable_list + + def get_tx_disable_channel(self): + """ + Retrieves the TX disabled channels in this SFP + Returns: + A hex of 4 bits (bit 0 to bit 3 as channel 0 to channel 3) to represent + TX channels which have been disabled in this SFP. + As an example, a returned value of 0x5 indicates that channel 0 + and channel 2 have been disabled. + """ + tx_disable_list = self.get_tx_disable() + if tx_disable_list is None: + return 0 + tx_disabled = 0 + for i in range(len(tx_disable_list)): + if tx_disable_list[i]: + tx_disabled |= 1 << i + return tx_disabled + + def get_lpmode(self): + """ + Retrieves the lpmode (low power mode) status of this SFP + Returns: + A Boolean, True if lpmode is enabled, False if disabled + """ + if self.port_num >=33: #SFP not support it + return False + + power_set=self.get_power_set() + power_override = self.get_power_override() + return power_set and power_override + + def get_power_set(self): + power_set = False + sfpd_obj = sff8436Dom() + if sfpd_obj is None: + return False + + dom_control_raw = self.__read_eeprom_specific_bytes( + QSFP_CONTROL_OFFSET, QSFP_CONTROL_WIDTH) if self.get_presence() else None + if dom_control_raw is not None: + dom_control_data = sfpd_obj.parse_control_bytes(dom_control_raw, 0) + power_set = ( + 'On' == dom_control_data['data']['PowerSet']['value']) + + return power_set + + def get_power_override(self): + """ + Retrieves the power-override status of this SFP + Returns: + A Boolean, True if power-override is enabled, False if disabled + """ + power_override = False + sfpd_obj = sff8436Dom() + if sfpd_obj is None: + return False + + dom_control_raw = self.__read_eeprom_specific_bytes( + QSFP_CONTROL_OFFSET, QSFP_CONTROL_WIDTH) if self.get_presence() else None + if dom_control_raw is not None: + dom_control_data = sfpd_obj.parse_control_bytes(dom_control_raw, 0) + power_override = ( + 'On' == dom_control_data['data']['PowerOverride']['value']) + + return power_override + + def get_temperature(self): + """ + Retrieves the temperature of this SFP + Returns: + An integer number of current temperature in Celsius + """ + transceiver_dom_info_dict = self.get_transceiver_bulk_status() + return transceiver_dom_info_dict.get("temperature", "N/A") + + def get_voltage(self): + """ + Retrieves the supply voltage of this SFP + Returns: + An integer number of supply voltage in mV + """ + transceiver_dom_info_dict = self.get_transceiver_bulk_status() + return transceiver_dom_info_dict.get("voltage", "N/A") + + def get_tx_bias(self): + """ + Retrieves the TX bias current of this SFP + Returns: + A list of four integer numbers, representing TX bias in mA + for channel 0 to channel 4. + Ex. ['110.09', '111.12', '108.21', '112.09'] + """ + transceiver_dom_info_dict = self.get_transceiver_bulk_status() + tx1_bs = transceiver_dom_info_dict.get("tx1bias", "N/A") + tx2_bs = transceiver_dom_info_dict.get("tx2bias", "N/A") + tx3_bs = transceiver_dom_info_dict.get("tx3bias", "N/A") + tx4_bs = transceiver_dom_info_dict.get("tx4bias", "N/A") + + return [tx1_bs, tx2_bs, tx3_bs, tx4_bs] if transceiver_dom_info_dict else [] + + def get_rx_power(self): + """ + Retrieves the received optical power for this SFP + Returns: + A list of four integer numbers, representing received optical + power in mW for channel 0 to channel 4. + Ex. ['1.77', '1.71', '1.68', '1.70'] + """ + transceiver_dom_info_dict = self.get_transceiver_bulk_status() + rx1_pw = transceiver_dom_info_dict.get("rx1power", "N/A") + rx2_pw = transceiver_dom_info_dict.get("rx2power", "N/A") + rx3_pw = transceiver_dom_info_dict.get("rx3power", "N/A") + rx4_pw = transceiver_dom_info_dict.get("rx4power", "N/A") + + return [rx1_pw, rx2_pw, rx3_pw, rx4_pw] if transceiver_dom_info_dict else [] + + def get_tx_power(self): + """ + Retrieves the TX power of this SFP + Returns: + A list of four integer numbers, representing TX power in mW + for channel 0 to channel 4. + Ex. ['1.86', '1.86', '1.86', '1.86'] + """ + transceiver_dom_info_dict = self.get_transceiver_bulk_status() + tx1_pw = transceiver_dom_info_dict.get("tx1power", "N/A") + tx2_pw = transceiver_dom_info_dict.get("tx2power", "N/A") + tx3_pw = transceiver_dom_info_dict.get("tx3power", "N/A") + tx4_pw = transceiver_dom_info_dict.get("tx4power", "N/A") + + return [tx1_pw, tx2_pw, tx3_pw, tx4_pw] + + def reset(self): + """ + Reset SFP and return all user module settings to their default srate. + Returns: + A boolean, True if successful, False if not + """ + if self.port_num >=33: #SFP not support it + return False + + reset_path = "{}{}{}".format(CPLD_I2C_PATH , 'module_reset_' , self.port_num) + ret=self._api_helper.write_txt_file(reset_path, 1) + if ret is not True: + return ret + + time.sleep(0.01) + ret=self._api_helper.write_txt_file(reset_path, 0) + + time.sleep(0.2) + + return ret + + def tx_disable(self, tx_disable): + """ + Disable SFP TX for all channels + Args: + tx_disable : A Boolean, True to enable tx_disable mode, False to disable + tx_disable mode. + Returns: + A boolean, True if tx_disable is set successfully, False if not + """ + if self.port_num >=33: + tx_path = "{}{}{}".format(CPLD_I2C_PATH , 'module_tx_disable_' , self.port_num) + if tx_disable: + ret=self._api_helper.write_txt_file(tx_path, 1) + else: + ret=self._api_helper.write_txt_file(tx_path, 0) + + if ret is not None: + time.sleep(0.01) + return ret + else: + return False + + if not self.get_presence(): + return False + + sysfsfile_eeprom = None + try: + tx_disable_ctl = 0xf if tx_disable else 0x0 + buffer = create_string_buffer(1) + if sys.version_info[0] >= 3: + buffer[0] = tx_disable_ctl + else: + buffer[0] = chr(tx_disable_ctl) + # Write to eeprom + sysfsfile_eeprom = open( + self.port_to_eeprom_mapping[self.port_num], "r+b") + sysfsfile_eeprom.seek(QSFP_CONTROL_OFFSET) + sysfsfile_eeprom.write(buffer[0]) + except IOError as e: + print ('Error: unable to open file: ',str(e)) + return False + finally: + if sysfsfile_eeprom is not None: + sysfsfile_eeprom.close() + time.sleep(0.01) + + return True + + def tx_disable_channel(self, channel, disable): + """ + Sets the tx_disable for specified SFP channels + Args: + channel : A hex of 4 bits (bit 0 to bit 3) which represent channel 0 to 3, + e.g. 0x5 for channel 0 and channel 2. + disable : A boolean, True to disable TX channels specified in channel, + False to enable + Returns: + A boolean, True if successful, False if not + """ + if self.port_num >=33: + return False + + if not self.get_presence(): + return False + + sysfsfile_eeprom = None + try: + channel_state = self.get_tx_disable_channel() + for i in range(4): + channel_mask = (1 << i) + if not (channel & channel_mask): + continue + + if disable: + channel_state |= channel_mask + else: + channel_state &= ~channel_mask + + buffer = create_string_buffer(1) + if sys.version_info[0] >= 3: + buffer[0] = channel_state + else: + buffer[0] = chr(channel_state) + # Write to eeprom + sysfsfile_eeprom = open( + self.port_to_eeprom_mapping[self.port_num], "r+b") + sysfsfile_eeprom.seek(QSFP_CONTROL_OFFSET) + sysfsfile_eeprom.write(buffer[0]) + except IOError as e: + print ('Error: unable to open file: ', str(e)) + return False + finally: + if sysfsfile_eeprom is not None: + sysfsfile_eeprom.close() + time.sleep(0.01) + + return True + + def set_lpmode(self, lpmode): + """ + Sets the lpmode (low power mode) of SFP + Args: + lpmode: A Boolean, True to enable lpmode, False to disable it + Note : lpmode can be overridden by set_power_override + Returns: + A boolean, True if lpmode is set successfully, False if not + """ + if self.port_num >=33: #SFP not support it. + return False + + if lpmode: + self.set_power_override(True, True) + else: + self.set_power_override(False, False) + + return True + + def set_power_override(self, power_override, power_set): + """ + Sets SFP power level using power_override and power_set + Args: + power_override : + A Boolean, True to override set_lpmode and use power_set + to control SFP power, False to disable SFP power control + through power_override/power_set and use set_lpmode + to control SFP power. + power_set : + Only valid when power_override is True. + A Boolean, True to set SFP to low power mode, False to set + SFP to high power mode. + Returns: + A boolean, True if power-override and power_set are set successfully, + False if not + """ + if self.port_num >=33: #SFP not support it. + return False + + if not self.get_presence(): + return False + try: + power_override_bit = (1 << 0) if power_override else 0 + power_set_bit = (1 << 1) if power_set else (1 << 3) + + buffer = create_string_buffer(1) + if sys.version_info[0] >= 3: + buffer[0] = (power_override_bit | power_set_bit) + else: + buffer[0] = chr(power_override_bit | power_set_bit) + # Write to eeprom + with open(self.port_to_eeprom_mapping[self.port_num], "r+b") as fd: + fd.seek(QSFP_POWEROVERRIDE_OFFSET) + fd.write(buffer[0]) + time.sleep(0.01) + except Exception: + print ('Error: unable to open file: ', str(e)) + return False + + return True + + def get_name(self): + """ + Retrieves the name of the device + Returns: + string: The name of the device + """ + sfputil_helper = SfpUtilHelper() + sfputil_helper.read_porttab_mappings( + self.__get_path_to_port_config_file()) + name = sfputil_helper.logical[self.index] or "Unknown" + return name + + def get_presence(self): + """ + Retrieves the presence of the device + Returns: + bool: True if device is present, False if not + """ + present_path = "{}{}{}".format(CPLD_I2C_PATH , '/module_present_' , self.port_num) + val=self._api_helper.read_txt_file(present_path) + if val is not None: + return int(val, 10)==1 + else: + return False + + def get_model(self): + """ + Retrieves the model number (or part number) of the device + Returns: + string: Model/part number of device + """ + transceiver_dom_info_dict = self.get_transceiver_info() + return transceiver_dom_info_dict.get("model", "N/A") + + def get_serial(self): + """ + Retrieves the serial number of the device + Returns: + string: Serial number of device + """ + transceiver_dom_info_dict = self.get_transceiver_info() + return transceiver_dom_info_dict.get("serial", "N/A") + + def get_status(self): + """ + Retrieves the operational status of the device + Returns: + A boolean value, True if device is operating properly, False if not + """ + return self.get_presence() and self.get_transceiver_bulk_status() diff --git a/device/accton/x86_64-accton_as7726_32x-r0/sonic_platform/thermal.py b/device/accton/x86_64-accton_as7726_32x-r0/sonic_platform/thermal.py new file mode 100644 index 000000000000..fea074ec37bb --- /dev/null +++ b/device/accton/x86_64-accton_as7726_32x-r0/sonic_platform/thermal.py @@ -0,0 +1,147 @@ +############################################################################# +# Edgecore +# +# Thermal contains an implementation of SONiC Platform Base API and +# provides the thermal device status which are available in the platform +# +############################################################################# + +import os +import os.path +import glob + +try: + from sonic_platform_base.thermal_base import ThermalBase +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class Thermal(ThermalBase): + """Platform-specific Thermal class""" + + THERMAL_NAME_LIST = [] + SYSFS_PATH = "/sys/bus/i2c/devices" + + def __init__(self, thermal_index=0): + self.index = thermal_index + # Add thermal name + self.THERMAL_NAME_LIST.append("Temp sensor 1") + self.THERMAL_NAME_LIST.append("Temp sensor 2") + self.THERMAL_NAME_LIST.append("Temp sensor 3") + self.THERMAL_NAME_LIST.append("Temp sensor 4") + self.THERMAL_NAME_LIST.append("Temp sensor 5") + + # Set hwmon path + i2c_path = { + 0: "55-0048/hwmon/hwmon*/", + 1: "55-0049/hwmon/hwmon*/", + 2: "55-004a/hwmon/hwmon*/", + 3: "55-004b/hwmon/hwmon*/", + 4: "54-004c/hwmon/hwmon*/" + }.get(self.index, None) + + self.hwmon_path = "{}/{}".format(self.SYSFS_PATH, i2c_path) + self.ss_key = self.THERMAL_NAME_LIST[self.index] + self.ss_index = 1 + + def __read_txt_file(self, file_path): + for filename in glob.glob(file_path): + try: + with open(filename, 'r') as fd: + data =fd.readline().rstrip() + return data + except IOError as e: + pass + + return None + + def __get_temp(self, temp_file): + temp_file_path = os.path.join(self.hwmon_path, temp_file) + raw_temp = self.__read_txt_file(temp_file_path) + if raw_temp is not None: + return float(raw_temp)/1000 + else: + return 0 + + def __set_threshold(self, file_name, temperature): + temp_file_path = os.path.join(self.hwmon_path, file_name) + for filename in glob.glob(temp_file_path): + try: + with open(filename, 'w') as fd: + fd.write(str(temperature)) + return True + except IOError as e: + print("IOError") + + + def get_temperature(self): + """ + Retrieves current temperature reading from thermal + Returns: + A float number of current temperature in Celsius up to nearest thousandth + of one degree Celsius, e.g. 30.125 + """ + temp_file = "temp{}_input".format(self.ss_index) + return self.__get_temp(temp_file) + + def get_high_threshold(self): + """ + Retrieves the high threshold temperature of thermal + Returns: + A float number, the high threshold temperature of thermal in Celsius + up to nearest thousandth of one degree Celsius, e.g. 30.125 + """ + temp_file = "temp{}_max".format(self.ss_index) + return self.__get_temp(temp_file) + + def set_high_threshold(self, temperature): + """ + Sets the high threshold temperature of thermal + Args : + temperature: A float number up to nearest thousandth of one degree Celsius, + e.g. 30.125 + Returns: + A boolean, True if threshold is set successfully, False if not + """ + temp_file = "temp{}_max".format(self.ss_index) + temperature = temperature *1000 + self.__set_threshold(temp_file, temperature) + + return True + + def get_name(self): + """ + Retrieves the name of the thermal device + Returns: + string: The name of the thermal device + """ + return self.THERMAL_NAME_LIST[self.index] + + def get_presence(self): + """ + Retrieves the presence of the Thermal + Returns: + bool: True if Thermal is present, False if not + """ + temp_file = "temp{}_input".format(self.ss_index) + temp_file_path = os.path.join(self.hwmon_path, temp_file) + raw_txt = self.__read_txt_file(temp_file_path) + if raw_txt is not None: + return True + else: + return False + + def get_status(self): + """ + Retrieves the operational status of the device + Returns: + A boolean value, True if device is operating properly, False if not + """ + + file_str = "temp{}_input".format(self.ss_index) + file_path = os.path.join(self.hwmon_path, file_str) + raw_txt = self.__read_txt_file(file_path) + if raw_txt is None: + return False + else: + return int(raw_txt) != 0 diff --git a/device/accton/x86_64-accton_as7816_64x-r0/sensors.conf b/device/accton/x86_64-accton_as7816_64x-r0/sensors.conf new file mode 100644 index 000000000000..56e4817a1b51 --- /dev/null +++ b/device/accton/x86_64-accton_as7816_64x-r0/sensors.conf @@ -0,0 +1,51 @@ +# libsensors configuration file for as7816-64x +# ------------------------------------------------ +# + +bus "i2c-9" "i2c-1-mux (chan_id 0)" +bus "i2c-10" "i2c-1-mux (chan_id 1)" +bus "i2c-17" "i2c-1-mux (chan_id 0)" +bus "i2c-18" "i2c-1-mux (chan_id 1)" + + +chip "ym2851-i2c-*-5b" + label in3 "PSU 1 Voltage" + label fan1 "PSU 1 Fan" + label temp1 "PSU 1 Temperature" + label power2 "PSU 1 Power" + label curr2 "PSU 1 Current" + +chip "ym2851-i2c-*-58" + label in3 "PSU 2 Voltage" + label fan1 "PSU 2 Fan" + label temp1 "PSU 2 Temperature" + label power2 "PSU 2 Power" + label curr2 "PSU 2 Current" + +chip "as7816_64x_fan-*" + label fan1 "Fan 1 Front" + label fan2 "Fan 2 Front" + label fan3 "Fan 3 Front" + label fan4 "Fan 4 Front" + label fan11 "Fan 1 Rear" + label fan12 "Fan 2 Rear" + label fan13 "Fan 3 Rear" + label fan14 "Fan 4 Rear" + +chip "lm75-i2c-*-48" + label temp1 "Main Board Temperature" + +chip "lm75-i2c-*-49" + label temp1 "Main Board Temperature" + +chip "lm75-i2c-*-4a" + label temp1 "Main Board Temperature" + +chip "lm75-i2c-*-4b" + label temp1 "CPU Board Temperature" + +chip "lm75-i2c-*-4d" + label temp1 "Fan Board Temperature" + +chip "lm75-i2c-*-4e" + label temp1 "Fan Board Temperature" diff --git a/device/accton/x86_64-accton_as9716_32d-r0/Accton-AS9716-32D/th3-as9716-32x400G.config.bcm b/device/accton/x86_64-accton_as9716_32d-r0/Accton-AS9716-32D/th3-as9716-32x400G.config.bcm index 5850f4ce4d72..b3ae068dc2de 100644 --- a/device/accton/x86_64-accton_as9716_32d-r0/Accton-AS9716-32D/th3-as9716-32x400G.config.bcm +++ b/device/accton/x86_64-accton_as9716_32d-r0/Accton-AS9716-32D/th3-as9716-32x400G.config.bcm @@ -1,3 +1,7 @@ +# The following 2 SOC properties are needed to prevent FDB Events during Warmboot due to TH3 is SW Managed MACs +l2xmsg_shadow_hit_bits=0 +l2xmsg_no_cb_during_table_rebuild=1 + pbmp_xport_xe.0=0x3ffffffffffffffffffffffffffffffffffffffe # Reference specfic diff --git a/device/accton/x86_64-accton_as9716_32d-r0/plugins/sfputil.py b/device/accton/x86_64-accton_as9716_32d-r0/plugins/sfputil.py index 7b3ca53d4ed4..5a6c664b7217 100755 --- a/device/accton/x86_64-accton_as9716_32d-r0/plugins/sfputil.py +++ b/device/accton/x86_64-accton_as9716_32d-r0/plugins/sfputil.py @@ -9,15 +9,44 @@ import sys from ctypes import create_string_buffer from sonic_sfp.sfputilbase import SfpUtilBase + from sonic_sfp.sff8472 import sff8472InterfaceId + from sonic_sfp.sff8472 import sff8472Dom + from sonic_sfp.sff8436 import sff8436InterfaceId + from sonic_sfp.sff8436 import sff8436Dom + from sonic_sfp.inf8628 import inf8628InterfaceId except ImportError as e: raise ImportError("%s - required module not found" % str(e)) +# definitions of the offset and width for values in XCVR info eeprom +XCVR_TYPE_OFFSET = 0 +XCVR_TYPE_WIDTH = 1 + +SFP_TYPE_CODE_LIST = [ + '03' # SFP/SFP+/SFP28 +] +QSFP_TYPE_CODE_LIST = [ + '0d', # QSFP+ or later + '11' # QSFP28 or later +] +QSFP_DD_TYPE_CODE_LIST = [ + '18' # QSFP-DD Double Density 8X Pluggable Transceiver +] + +SFP_TYPE = "SFP" +QSFP_TYPE = "QSFP" +OSFP_TYPE = "OSFP" +QSFP_DD_TYPE = "QSFP_DD" + +SFP_I2C_START = 25 +I2C_EEPROM_PATH = '/sys/bus/i2c/devices/{0}-0050/eeprom' class SfpUtil(SfpUtilBase): """Platform-specific SfpUtil class""" PORT_START = 0 PORT_END = 33 + OSFP_PORT_START = 0 + OSFP_PORT_END = 31 PORTS_IN_BLOCK = 34 BASE_OOM_PATH = "/sys/bus/i2c/devices/{0}-0050/" @@ -75,7 +104,11 @@ def port_end(self): @property def qsfp_ports(self): - return list(range(self.PORT_START, self.PORTS_IN_BLOCK + 1)) + return [] + + @property + def osfp_ports(self): + return list(range(self.OSFP_PORT_START, self.OSFP_PORT_END + 1)) @property def port_to_eeprom_mapping(self): @@ -91,6 +124,111 @@ def __init__(self): SfpUtilBase.__init__(self) + def _get_eeprom_path(self, port_num): + port_to_i2c_mapping = SFP_I2C_START + port_num + port_eeprom_path = I2C_EEPROM_PATH.format(port_to_i2c_mapping) + return port_eeprom_path + + def _read_eeprom_specific_bytes_(self, offset, num_bytes, port_num): + sysfs_sfp_i2c_client_eeprom_path = self._get_eeprom_path(port_num) + eeprom_raw = [] + try: + eeprom = open( + sysfs_sfp_i2c_client_eeprom_path, + mode="rb", buffering=0) + except IOError: + return None + + for i in range(0, num_bytes): + eeprom_raw.append("0x00") + + try: + eeprom.seek(offset) + raw = eeprom.read(num_bytes) + except IOError: + eeprom.close() + return None + + try: + if isinstance(raw, str): + for n in range(0, num_bytes): + eeprom_raw[n] = hex(ord(raw[n]))[2:].zfill(2) + else: + for n in range(0, num_bytes): + eeprom_raw[n] = hex(raw[n])[2:].zfill(2) + + except BaseException: + eeprom.close() + return None + + eeprom.close() + return eeprom_raw + + def _detect_sfp_type(self, port_num): + sfp_type = QSFP_TYPE + eeprom_raw = [] + eeprom_raw = self._read_eeprom_specific_bytes_( + XCVR_TYPE_OFFSET, XCVR_TYPE_WIDTH, port_num) + if eeprom_raw: + if eeprom_raw[0] in SFP_TYPE_CODE_LIST: + self.sfp_type = SFP_TYPE + elif eeprom_raw[0] in QSFP_TYPE_CODE_LIST: + self.sfp_type = QSFP_TYPE + elif eeprom_raw[0] in QSFP_DD_TYPE_CODE_LIST: + self.sfp_type = QSFP_DD_TYPE + else: + self.sfp_type = sfp_type + else: + self.sfp_type = sfp_type + + def get_eeprom_dict(self, port_num): + """Returns dictionary of interface and dom data. + format: { : {'interface': {'version' : '1.0', 'data' : {...}}, + 'dom' : {'version' : '1.0', 'data' : {...}}}} + """ + self._detect_sfp_type(port_num) + sfp_data = {} + + eeprom_ifraw = self.get_eeprom_raw(port_num) + eeprom_domraw = self.get_eeprom_dom_raw(port_num) + + if eeprom_ifraw is None: + return None + + if self.sfp_type == QSFP_DD_TYPE: + sfpi_obj = inf8628InterfaceId(eeprom_ifraw) + + if sfpi_obj is not None: + sfp_data['interface'] = sfpi_obj.get_data_pretty() + + return sfp_data + elif self.sfp_type == QSFP_TYPE: + sfpi_obj = sff8436InterfaceId(eeprom_ifraw) + + if sfpi_obj is not None: + sfp_data['interface'] = sfpi_obj.get_data_pretty() + + # For Qsfp's the dom data is part of eeprom_if_raw + # The first 128 bytes + sfpd_obj = sff8436Dom(eeprom_ifraw) + if sfpd_obj is not None: + sfp_data['dom'] = sfpd_obj.get_data_pretty() + + return sfp_data + else: + sfpi_obj = sff8472InterfaceId(eeprom_ifraw) + + if sfpi_obj is not None: + sfp_data['interface'] = sfpi_obj.get_data_pretty() + cal_type = sfpi_obj.get_calibration_type() + + if eeprom_domraw is not None: + sfpd_obj = sff8472Dom(eeprom_domraw, cal_type) + if sfpd_obj is not None: + sfp_data['dom'] = sfpd_obj.get_data_pretty() + + return sfp_data + def get_presence(self, port_num): # Check for invalid port_num if port_num < self.port_start or port_num > self.port_end: diff --git a/device/accton/x86_64-accton_as9716_32d-r0/sensors.conf b/device/accton/x86_64-accton_as9716_32d-r0/sensors.conf new file mode 100644 index 000000000000..d375d2315d5c --- /dev/null +++ b/device/accton/x86_64-accton_as9716_32d-r0/sensors.conf @@ -0,0 +1,59 @@ +# libsensors configuration file for as9716-32d +# ------------------------------------------------ +# + +bus "i2c-9" "i2c-1-mux (chan_id 0)" +bus "i2c-10" "i2c-1-mux (chan_id 1)" +bus "i2c-17" "i2c-1-mux (chan_id 0)" +bus "i2c-18" "i2c-1-mux (chan_id 1)" + + +chip "acbel_fsh082-i2c-*-58" + label in3 "PSU 1 Voltage" + label fan1 "PSU 1 Fan" + label temp1 "PSU 1 Temperature" + label power2 "PSU 1 Power" + label curr2 "PSU 1 Current" + +chip "acbel_fsh082-i2c-*-59" + label in3 "PSU 2 Voltage" + label fan1 "PSU 2 Fan" + label temp1 "PSU 2 Temperature" + label power2 "PSU 2 Power" + label curr2 "PSU 2 Current" + +chip "as9716_32d_fan-*" + label fan1 "Fan 1 Front" + label fan2 "Fan 2 Front" + label fan3 "Fan 3 Front" + label fan4 "Fan 4 Front" + label fan5 "Fan 5 Front" + label fan6 "Fan 6 Front" + label fan11 "Fan 1 Rear" + label fan12 "Fan 2 Rear" + label fan13 "Fan 3 Rear" + label fan14 "Fan 4 Rear" + label fan15 "Fan 5 Rear" + label fan16 "Fan 6 Rear" + + +chip "lm75-i2c-*-48" + label temp1 "Main Board Temperature" + +chip "lm75-i2c-*-49" + label temp1 "Main Board Temperature" + +chip "lm75-i2c-*-4a" + label temp1 "Main Board Temperature" + +chip "lm75-i2c-*-4b" + label temp1 "CPU Board Temperature" + +chip "lm75-i2c-*-4c" + label temp1 "OCXO Temperature" + +chip "lm75-i2c-*-4e" + label temp1 "Fan Board Temperature" + +chip "lm75-i2c-*-4f" + label temp1 "Fan Board Temperature" diff --git a/device/accton/x86_64-accton_as9726_32d-r0/Accton-AS9726-32D/port_config.ini b/device/accton/x86_64-accton_as9726_32d-r0/Accton-AS9726-32D/port_config.ini new file mode 100644 index 000000000000..f7fcf8517df8 --- /dev/null +++ b/device/accton/x86_64-accton_as9726_32d-r0/Accton-AS9726-32D/port_config.ini @@ -0,0 +1,35 @@ +# name lanes alias index speed +Ethernet1 73,74,75,76,77,78,79,80 fourHundredGigE1 1 400000 +Ethernet2 65,66,67,68,69,70,71,72 fourHundredGigE2 2 400000 +Ethernet3 81,82,83,84,85,86,87,88 fourHundredGigE3 3 400000 +Ethernet4 89,90,91,92,93,94,95,96 fourHundredGigE4 4 400000 +Ethernet5 97,98,99,100,101,102,103,104 fourHundredGigE5 5 400000 +Ethernet6 105,106,107,108,109,110,111,112 fourHundredGigE6 6 400000 +Ethernet7 113,114,115,116,117,118,119,120 fourHundredGigE7 7 400000 +Ethernet8 121,122,123,124,125,126,127,128 fourHundredGigE8 8 400000 +Ethernet9 41,42,43,44,45,46,47,48 fourHundredGigE9 9 400000 +Ethernet10 33,34,35,36,37,38,39,40 fourHundredGigE10 10 400000 +Ethernet11 49,50,51,52,53,54,55,56 fourHundredGigE11 11 400000 +Ethernet12 57,58,59,60,61,62,63,64 fourHundredGigE12 12 400000 +Ethernet13 129,130,131,132,133,134,135,136 fourHundredGigE13 13 400000 +Ethernet14 137,138,139,140,141,142,143,144 fourHundredGigE14 14 400000 +Ethernet15 145,146,147,148,149,150,151,152 fourHundredGigE15 15 400000 +Ethernet16 153,154,155,156,157,158,159,160 fourHundredGigE16 16 400000 +Ethernet17 169,170,171,172,173,174,175,176 fourHundredGigE17 17 400000 +Ethernet18 161,162,163,164,165,166,167,168 fourHundredGigE18 18 400000 +Ethernet19 177,178,179,180,181,182,183,184 fourHundredGigE19 19 400000 +Ethernet20 185,186,187,188,189,190,191,192 fourHundredGigE20 20 400000 +Ethernet21 1,2,3,4,5,6,7,8 fourHundredGigE21 21 400000 +Ethernet22 9,10,11,12,13,14,15,16 fourHundredGigE22 22 400000 +Ethernet23 17,18,19,20,21,22,23,24 fourHundredGigE23 23 400000 +Ethernet24 25,26,27,28,29,30,31,32 fourHundredGigE24 24 400000 +Ethernet25 201,202,203,204,205,206,207,208 fourHundredGigE25 25 400000 +Ethernet26 193,194,195,196,197,198,199,200 fourHundredGigE26 26 400000 +Ethernet27 217,218,219,220,221,222,223,224 fourHundredGigE27 27 400000 +Ethernet28 209,210,211,212,213,214,215,216 fourHundredGigE28 28 400000 +Ethernet29 233,234,235,236,237,238,239,240 fourHundredGigE29 29 400000 +Ethernet30 225,226,227,228,229,230,231,232 fourHundredGigE30 30 400000 +Ethernet31 249,250,251,252,253,254,255,256 fourHundredGigE31 31 400000 +Ethernet32 241,242,243,244,245,246,247,248 fourHundredGigE32 32 400000 +Ethernet33 249 tenGigE33 33 10000 +Ethernet34 250 tenGigE34 34 10000 diff --git a/device/accton/x86_64-accton_as9726_32d-r0/default_sku b/device/accton/x86_64-accton_as9726_32d-r0/default_sku new file mode 100644 index 000000000000..bfc864f74c74 --- /dev/null +++ b/device/accton/x86_64-accton_as9726_32d-r0/default_sku @@ -0,0 +1 @@ +Accton-AS9726-32D t1 diff --git a/device/accton/x86_64-accton_as9726_32d-r0/installer.conf b/device/accton/x86_64-accton_as9726_32d-r0/installer.conf new file mode 100644 index 000000000000..925a32fc0c3a --- /dev/null +++ b/device/accton/x86_64-accton_as9726_32d-r0/installer.conf @@ -0,0 +1,3 @@ +CONSOLE_PORT=0x3f8 +CONSOLE_DEV=0 +CONSOLE_SPEED=115200 diff --git a/device/accton/x86_64-accton_as9726_32d-r0/plugins/eeprom.py b/device/accton/x86_64-accton_as9726_32d-r0/plugins/eeprom.py new file mode 100755 index 000000000000..7409239d01f3 --- /dev/null +++ b/device/accton/x86_64-accton_as9726_32d-r0/plugins/eeprom.py @@ -0,0 +1,13 @@ +try: + from sonic_eeprom import eeprom_tlvinfo + +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class board(eeprom_tlvinfo.TlvInfoDecoder): + _TLV_INFO_MAX_LEN = 256 + + def __init__(self, name, path, cpld_root, ro): + self.eeprom_path = "/sys/bus/i2c/devices/1-0057/eeprom" + super(board, self).__init__(self.eeprom_path, 0, '', True) diff --git a/device/accton/x86_64-accton_as9726_32d-r0/plugins/psuutil.py b/device/accton/x86_64-accton_as9726_32d-r0/plugins/psuutil.py new file mode 100755 index 000000000000..104fee28c8b5 --- /dev/null +++ b/device/accton/x86_64-accton_as9726_32d-r0/plugins/psuutil.py @@ -0,0 +1,61 @@ +#!/usr/bin/env python + +############################################################################# +# Accton +# +# Module contains an implementation of SONiC PSU Base API and +# provides the PSUs status which are available in the platform +# +############################################################################# + + +try: + from sonic_psu.psu_base import PsuBase +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class PsuUtil(PsuBase): + """Platform-specific PSUutil class""" + + def __init__(self): + PsuBase.__init__(self) + + self.psu_path = "/sys/bus/i2c/devices/" + self.psu_presence = "/psu_present" + self.psu_oper_status = "/psu_power_good" + self.psu_mapping = { + 1: "9-0050", + 2: "9-0051", + } + + def get_num_psus(self): + return len(self.psu_mapping) + + def get_psu_status(self, index): + if index is None: + return False + + status = 0 + node = self.psu_path + self.psu_mapping[index] + self.psu_oper_status + try: + with open(node, 'r') as power_status: + status = int(power_status.read()) + except IOError: + return False + + return status == 1 + + def get_psu_presence(self, index): + if index is None: + return False + + status = 0 + node = self.psu_path + self.psu_mapping[index] + self.psu_presence + try: + with open(node, 'r') as presence_status: + status = int(presence_status.read()) + except IOError: + return False + + return status == 1 diff --git a/device/accton/x86_64-accton_as9726_32d-r0/plugins/sfputil.py b/device/accton/x86_64-accton_as9726_32d-r0/plugins/sfputil.py new file mode 100755 index 000000000000..2a365815cab6 --- /dev/null +++ b/device/accton/x86_64-accton_as9726_32d-r0/plugins/sfputil.py @@ -0,0 +1,293 @@ +# sfputil.py +# +# Platform-specific SFP transceiver interface for SONiC +# + +try: + import time + from ctypes import create_string_buffer + from sonic_sfp.sfputilbase import SfpUtilBase +except ImportError as e: + raise ImportError("%s - required module not found" % str(e)) + + +class SfpUtil(SfpUtilBase): + """Platform-specific SfpUtil class""" + + PORT_START = 1 + QSFP_PORT_END = 32 + PORT_END = 34 + PORTS_IN_BLOCK = 34 + + BASE_OOM_PATH = "/sys/bus/i2c/devices/{0}-0050/" + BASE_CPLD2_PATH = "/sys/bus/i2c/devices/10-0061/" + BASE_CPLD3_PATH = "/sys/bus/i2c/devices/10-0062/" + + _port_to_is_present = {} + _port_to_lp_mode = {} + + _port_to_eeprom_mapping = {} + _port_to_i2c_mapping = { + 1: 17, + 2: 18, + 3: 19, + 4: 20, + 5: 21, + 6: 22, + 7: 23, + 8: 24, + 9: 25, + 10: 26, + 11: 27, + 12: 28, + 13: 29, + 14: 30, + 15: 31, + 16: 32, + 17: 33, + 18: 34, + 19: 35, + 20: 36, + 21: 37, + 22: 38, + 23: 39, + 24: 40, + 25: 41, + 26: 42, + 27: 43, + 28: 44, + 29: 45, + 30: 46, + 31: 47, + 32: 48, + 33: 49, + 34: 50, + } + + @property + def port_start(self): + return self.PORT_START + + @property + def port_end(self): + return self.PORT_END + + @property + def qsfp_ports(self): + return list(range(self.PORT_START, self.PORTS_IN_BLOCK - 1)) + + @property + def port_to_eeprom_mapping(self): + return self._port_to_eeprom_mapping + + def __init__(self): + eeprom_path = self.BASE_OOM_PATH + "eeprom" + + for x in range(self.port_start, self.port_end+1): + self.port_to_eeprom_mapping[x] = eeprom_path.format( + self._port_to_i2c_mapping[x] + ) + + SfpUtilBase.__init__(self) + + def __write_txt_file(self, file_path, value): + try: + reg_file = open(file_path, "w") + except IOError as e: + print("Error: unable to open file: %s" % str(e)) + return False + + reg_file.write(str(value)) + reg_file.close() + + return True + + def get_presence(self, port_num): + if port_num <= 16: + present_path = self.BASE_CPLD2_PATH + "module_present_" + str(port_num) + else: + present_path = self.BASE_CPLD3_PATH + "module_present_" + str(port_num) + self.__port_to_is_present = present_path + + try: + val_file = open(present_path) + content = val_file.readline().rstrip() + val_file.close() + except IOError as e: + print("Error: unable to access file: %s" % str(e)) + return False + + if content == "1": + return True + + return False + + def get_low_power_mode(self, port_num): + if port_num > self.QSFP_PORT_END: #sfp not support lpmode + return False + try: + eeprom = None + + if not self.get_presence(port_num): + return False + + eeprom = open(self.port_to_eeprom_mapping[port_num], "rb") + eeprom.seek(93) + lpmode = ord(eeprom.read(1)) + + if ((lpmode & 0x3) == 0x3): + return True # Low Power Mode if "Power override" bit is 1 and "Power set" bit is 1 + else: + # High Power Mode if one of the following conditions is matched: + # 1. "Power override" bit is 0 + # 2. "Power override" bit is 1 and "Power set" bit is 0 + return False + except IOError as e: + print("Error: unable to open file: %s" % str(e)) + return False + finally: + if eeprom is not None: + eeprom.close() + time.sleep(0.01) + + def set_low_power_mode(self, port_num, lpmode): + # Check for invalid port_num + if port_num > self.QSFP_PORT_END: #sfp not support lpmode: + return False + + try: + eeprom = None + if not self.get_presence(port_num): + return False # Port is not present, unable to set the eeprom + + # Fill in write buffer + # 0x3:Low Power Mode. "Power override" bit is 1 and "Power set" bit is 1 + # 0x9:High Power Mode. "Power override" bit is 1 ,"Power set" bit is 0 and "High Power Class Enable" bit is 1 + regval = 0x3 if lpmode else 0x9 + + buffer = create_string_buffer(1) + buffer[0] = regval + + # Write to eeprom + eeprom = open(self.port_to_eeprom_mapping[port_num], "r+b") + eeprom.seek(93) + eeprom.write(buffer[0]) + return True + except IOError as e: + print("Error: unable to open file: %s" % str(e)) + return False + finally: + if eeprom is not None: + eeprom.close() + time.sleep(0.01) + + def reset(self, port_num): + if port_num > self.QSFP_PORT_END: #sfp not support lpmode: + return False + if not self.get_presence(port_num): + return False # Port is not present, unable to set reset + + if port_num < 16: + mod_rst_path = self.BASE_CPLD2_PATH + "module_reset_" + str(port_num) + else: + mod_rst_path = self.BASE_CPLD3_PATH + "module_reset_" + str(port_num) + + self.__port_to_mod_rst = mod_rst_path + + ret = self.__write_txt_file(self.__port_to_mod_rst, 1) + if ret is not True: + return ret + + time.sleep(0.2) + ret = self.__write_txt_file(self.__port_to_mod_rst, 0) + time.sleep(0.2) + + return ret + + def get_cpld_interrupt(self): + port_dict = {} + for i in range(0, 4): + if i == 0 or i == 1: + cpld_i2c_path = self.BASE_CPLD2_PATH + "cpld_intr_" + str(i+1) + else: + cpld_i2c_path = self.BASE_CPLD3_PATH + "cpld_intr_" + str(i+1) + + start_i = (i*8) + end_i = (i*8+8) + try: + val_file = open(cpld_i2c_path) + except IOError as e: + print("Error: unable to open file: %s" % str(e)) + + for k in range(start_i, end_i): + port_dict[k] = 0 + return port_dict + + status = val_file.readline().rstrip() + val_file.close() + status = status.strip() + status = int(status, 16) + + interrupt_status = ~(status & 0xff) + if interrupt_status: + port_shift = 0 + for k in range(start_i, end_i): + if interrupt_status & (0x1 << port_shift): + port_dict[k] = 1 + else: + port_dict[k] = 0 + port_shift = port_shift+1 + + return port_dict + + def get_transceiver_change_event(self, timeout=0): + start_time = time.time() + port_dict = {} + forever = False + + if timeout == 0: + forever = True + elif timeout > 0: + timeout = timeout / float(1000) # Convert to secs + else: + print("get_transceiver_change_event:Invalid timeout value", timeout) + return False, {} + + end_time = start_time + timeout + if start_time > end_time: + print('get_transceiver_change_event:' + 'time wrap / invalid timeout value', timeout) + + return False, {} # Time wrap or possibly incorrect timeout + + # for i in range(self.port_start, self.port_end+1): + # ori_present[i]=self.get_presence(i) + + while timeout >= 0: + change_status = 0 + + port_dict = self.get_cpld_interrupt() + present = 0 + for key, value in port_dict.items(): + if value == 1: + present = self.get_presence(key) + change_status = 1 + if present: + port_dict[key] = '1' + else: + port_dict[key] = '0' + + if change_status: + return True, port_dict + if forever: + time.sleep(1) + else: + timeout = end_time - time.time() + if timeout >= 1: + time.sleep(1) # We poll at 1 second granularity + else: + if timeout > 0: + time.sleep(timeout) + return True, {} + print("get_evt_change_event: Should not reach here.") + return False, {} diff --git a/device/accton/x86_64-accton_as9726_32d-r0/pmon_daemon_control.json b/device/accton/x86_64-accton_as9726_32d-r0/pmon_daemon_control.json new file mode 100644 index 000000000000..584a14b9d942 --- /dev/null +++ b/device/accton/x86_64-accton_as9726_32d-r0/pmon_daemon_control.json @@ -0,0 +1,5 @@ +{ + "skip_ledd": true, + "skip_thermalctld": true +} + diff --git a/device/accton/x86_64-accton_as9726_32d-r0/sonic_platform/__init__.py b/device/accton/x86_64-accton_as9726_32d-r0/sonic_platform/__init__.py new file mode 100644 index 000000000000..a18a2a2d2a3b --- /dev/null +++ b/device/accton/x86_64-accton_as9726_32d-r0/sonic_platform/__init__.py @@ -0,0 +1,2 @@ +__all__ = ['chassis', 'eeprom', 'platform', 'psu', 'sfp', 'thermal', 'fan'] +from . import platform diff --git a/device/accton/x86_64-accton_as9726_32d-r0/sonic_platform/chassis.py b/device/accton/x86_64-accton_as9726_32d-r0/sonic_platform/chassis.py new file mode 100644 index 000000000000..7eb9601d8b56 --- /dev/null +++ b/device/accton/x86_64-accton_as9726_32d-r0/sonic_platform/chassis.py @@ -0,0 +1,201 @@ +############################################################################# +# Accton +# +# Module contains an implementation of SONiC Platform Base API and +# provides the Chassis information which are available in the platform +# +############################################################################# + +import os + +try: + from sonic_platform_base.chassis_base import ChassisBase + from .helper import APIHelper +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +NUM_FAN_TRAY = 6 +NUM_FAN = 2 +NUM_PSU = 2 +NUM_THERMAL = 3 +NUM_QSFP = 32 +PORT_START = 1 +PORT_END = 34 +QSFP_PORT_START = 0 +QSFP_PORT_END = 31 +NUM_COMPONENT = 2 +HOST_REBOOT_CAUSE_PATH = "/host/reboot-cause/" +PMON_REBOOT_CAUSE_PATH = "/usr/share/sonic/platform/api_files/reboot-cause/" +REBOOT_CAUSE_FILE = "reboot-cause.txt" +PREV_REBOOT_CAUSE_FILE = "previous-reboot-cause.txt" +HOST_CHK_CMD = "docker > /dev/null 2>&1" + + +class Chassis(ChassisBase): + """Platform-specific Chassis class""" + + def __init__(self): + ChassisBase.__init__(self) + self._api_helper = APIHelper() + self.is_host = self._api_helper.is_host() + + self.config_data = {} + + self.__initialize_fan() + self.__initialize_psu() + self.__initialize_thermals() + self.__initialize_components() + self.__initialize_sfp() + self.__initialize_eeprom() + + def __initialize_sfp(self): + from sonic_platform.sfp import Sfp + + self.QSFP_PORT_START = QSFP_PORT_START + self.QSFP_PORT_END = QSFP_PORT_END + for index in range(0, PORT_END): + if index in range(self.QSFP_PORT_START, self.QSFP_PORT_END + 1): + sfp_module = Sfp(index, 'QSFP') + else: + sfp_module = Sfp(index, 'SFP') + self._sfp_list.append(sfp_module) + self.sfp_module_initialized = True + + def __initialize_fan(self): + from sonic_platform.fan import Fan + for fant_index in range(0, NUM_FAN_TRAY): + for fan_index in range(0, NUM_FAN): + fan = Fan(fant_index, fan_index) + self._fan_list.append(fan) + + def __initialize_psu(self): + from sonic_platform.psu import Psu + for index in range(0, NUM_PSU): + psu = Psu(index) + self._psu_list.append(psu) + + def __initialize_thermals(self): + from sonic_platform.thermal import Thermal + for index in range(0, NUM_THERMAL): + thermal = Thermal(index) + self._thermal_list.append(thermal) + + def __initialize_eeprom(self): + from sonic_platform.eeprom import Tlv + self._eeprom = Tlv() + + def __initialize_components(self): + from sonic_platform.component import Component + for index in range(0, NUM_COMPONENT): + component = Component(index) + self._component_list.append(component) + + def __initialize_watchdog(self): + from sonic_platform.watchdog import Watchdog + self._watchdog = Watchdog() + + + def __is_host(self): + return os.system(HOST_CHK_CMD) == 0 + + def __read_txt_file(self, file_path): + try: + with open(file_path, 'r') as fd: + data = fd.read() + return data.strip() + except IOError: + pass + return None + + def get_name(self): + """ + Retrieves the name of the device + Returns: + string: The name of the device + """ + + return self._api_helper.hwsku + + def get_presence(self): + """ + Retrieves the presence of the Chassis + Returns: + bool: True if Chassis is present, False if not + """ + return True + + def get_status(self): + """ + Retrieves the operational status of the device + Returns: + A boolean value, True if device is operating properly, False if not + """ + return True + + def get_base_mac(self): + """ + Retrieves the base MAC address for the chassis + Returns: + A string containing the MAC address in the format + 'XX:XX:XX:XX:XX:XX' + """ + return self._eeprom.get_mac() + + def get_serial_number(self): + """ + Retrieves the hardware serial number for the chassis + Returns: + A string containing the hardware serial number for this chassis. + """ + return self._eeprom.get_serial() + + def get_system_eeprom_info(self): + """ + Retrieves the full content of system EEPROM information for the chassis + Returns: + A dictionary where keys are the type code defined in + OCP ONIE TlvInfo EEPROM format and values are their corresponding + values. + """ + return self._eeprom.get_eeprom() + + def get_reboot_cause(self): + """ + Retrieves the cause of the previous reboot + Returns: + A tuple (string, string) where the first element is a string + containing the cause of the previous reboot. This string must be + one of the predefined strings in this class. If the first string + is "REBOOT_CAUSE_HARDWARE_OTHER", the second string can be used + to pass a description of the reboot cause. + """ + + reboot_cause_path = (HOST_REBOOT_CAUSE_PATH + REBOOT_CAUSE_FILE) + sw_reboot_cause = self._api_helper.read_txt_file( + reboot_cause_path) or "Unknown" + + + return ('REBOOT_CAUSE_NON_HARDWARE', sw_reboot_cause) + + def get_sfp(self, index): + """ + Retrieves sfp represented by (1-based) index + Args: + index: An integer, the index (1-based) of the sfp to retrieve. + The index should be the sequence of a physical port in a chassis, + starting from 1. + For example, 1 for Ethernet0, 2 for Ethernet4 and so on. + Returns: + An object dervied from SfpBase representing the specified sfp + """ + sfp = None + if not self.sfp_module_initialized: + self.__initialize_sfp() + + try: + # The index will start from 1 + sfp = self._sfp_list[index-1] + except IndexError: + sys.stderr.write("SFP index {} out of range (1-{})\n".format( + index, len(self._sfp_list))) + return sfp diff --git a/device/accton/x86_64-accton_as9726_32d-r0/sonic_platform/component.py b/device/accton/x86_64-accton_as9726_32d-r0/sonic_platform/component.py new file mode 100644 index 000000000000..c34da704432a --- /dev/null +++ b/device/accton/x86_64-accton_as9726_32d-r0/sonic_platform/component.py @@ -0,0 +1,121 @@ +############################################################################# +# Accton +# +# Component contains an implementation of SONiC Platform Base API and +# provides the components firmware management function +# +############################################################################# + +import shlex +import subprocess + + +try: + from sonic_platform_base.component_base import ComponentBase + from .helper import APIHelper +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +CPLD_ADDR_MAPPING = { + "CPLD1": "3-0060" +} +SYSFS_PATH = "/sys/bus/i2c/devices/" +BIOS_VERSION_PATH = "/sys/class/dmi/id/bios_version" +COMPONENT_LIST= [ + ("CPLD1", "CPLD 1"), + ("BIOS", "Basic Input/Output System") + +] + +class Component(ComponentBase): + """Platform-specific Component class""" + + DEVICE_TYPE = "component" + + def __init__(self, component_index=0): + self._api_helper=APIHelper() + ComponentBase.__init__(self) + self.index = component_index + self.name = self.get_name() + + def __run_command(self, command): + # Run bash command and print output to stdout + try: + process = subprocess.Popen( + shlex.split(command), stdout=subprocess.PIPE) + while True: + output = process.stdout.readline() + if output == '' and process.poll() is not None: + break + rc = process.poll() + if rc != 0: + return False + except Exception: + return False + return True + + def __get_bios_version(self): + # Retrieves the BIOS firmware version + try: + with open(BIOS_VERSION_PATH, 'r') as fd: + bios_version = fd.read() + return bios_version.strip() + except Exception as e: + return None + + def __get_cpld_version(self): + # Retrieves the CPLD firmware version + cpld_version = dict() + for cpld_name in CPLD_ADDR_MAPPING: + try: + cpld_path = "{}{}{}".format(SYSFS_PATH, CPLD_ADDR_MAPPING[cpld_name], '/version') + cpld_version_raw= self._api_helper.read_txt_file(cpld_path) + cpld_version[cpld_name] = "{}".format(int(cpld_version_raw,16)) + except Exception as e: + print('Get exception when read cpld') + cpld_version[cpld_name] = 'None' + + return cpld_version + + def get_name(self): + """ + Retrieves the name of the component + Returns: + A string containing the name of the component + """ + return COMPONENT_LIST[self.index][0] + + def get_description(self): + """ + Retrieves the description of the component + Returns: + A string containing the description of the component + """ + return COMPONENT_LIST[self.index][1] + + + def get_firmware_version(self): + """ + Retrieves the firmware version of module + Returns: + string: The firmware versions of the module + """ + fw_version = None + + if self.name == "BIOS": + fw_version = self.__get_bios_version() + elif "CPLD" in self.name: + cpld_version = self.__get_cpld_version() + fw_version = cpld_version.get(self.name) + + return fw_version + + def install_firmware(self, image_path): + """ + Install firmware to module + Args: + image_path: A string, path to firmware image + Returns: + A boolean, True if install successfully, False if not + """ + raise NotImplementedError diff --git a/device/accton/x86_64-accton_as9726_32d-r0/sonic_platform/eeprom.py b/device/accton/x86_64-accton_as9726_32d-r0/sonic_platform/eeprom.py new file mode 100644 index 000000000000..7bf2bb58d19f --- /dev/null +++ b/device/accton/x86_64-accton_as9726_32d-r0/sonic_platform/eeprom.py @@ -0,0 +1,102 @@ +try: + import os + import sys + import re + if sys.version_info[0] >= 3: + from io import StringIO + else: + from cStringIO import StringIO + + from sonic_platform_base.sonic_eeprom import eeprom_tlvinfo +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +CACHE_ROOT = '/var/cache/sonic/decode-syseeprom' +CACHE_FILE = 'syseeprom_cache' + + +class Tlv(eeprom_tlvinfo.TlvInfoDecoder): + + EEPROM_DECODE_HEADLINES = 6 + + def __init__(self): + self._eeprom_path = "/sys/bus/i2c/devices/1-0057/eeprom" + super(Tlv, self).__init__(self._eeprom_path, 0, '', True) + self._eeprom = self._load_eeprom() + + def __parse_output(self, decode_output): + decode_output.replace('\0', '') + lines = decode_output.split('\n') + lines = lines[self.EEPROM_DECODE_HEADLINES:] + _eeprom_info_dict = dict() + + for line in lines: + try: + match = re.search( + '(0x[0-9a-fA-F]{2})([\s]+[\S]+[\s]+)([\S]+)', line) + if match is not None: + idx = match.group(1) + value = match.group(3).rstrip('\0') + + _eeprom_info_dict[idx] = value + except Exception: + pass + + return _eeprom_info_dict + + def _load_eeprom(self): + original_stdout = sys.stdout + sys.stdout = StringIO() + try: + self.read_eeprom_db() + except Exception: + decode_output = sys.stdout.getvalue() + sys.stdout = original_stdout + return self.__parse_output(decode_output) + + status = self.check_status() + if 'ok' not in status: + return False + + if not os.path.exists(CACHE_ROOT): + try: + os.makedirs(CACHE_ROOT) + except Exception: + pass + + # + # only the eeprom classes that inherit from eeprom_base + # support caching. Others will work normally + # + try: + self.set_cache_name(os.path.join(CACHE_ROOT, CACHE_FILE)) + except Exception: + pass + + e = self.read_eeprom() + if e is None: + return 0 + + try: + self.update_cache(e) + except Exception: + pass + + self.decode_eeprom(e) + decode_output = sys.stdout.getvalue() + sys.stdout = original_stdout + + (is_valid, valid_crc) = self.is_checksum_valid(e) + if not is_valid: + return False + + return self.__parse_output(decode_output) + + def get_eeprom(self): + return self._eeprom + + def get_serial(self): + return self._eeprom.get('0x23', "Undefined.") + + def get_mac(self): + return self._eeprom.get('0x24', "Undefined.") diff --git a/device/accton/x86_64-accton_as9726_32d-r0/sonic_platform/fan.py b/device/accton/x86_64-accton_as9726_32d-r0/sonic_platform/fan.py new file mode 100644 index 000000000000..a42bdba3bd7e --- /dev/null +++ b/device/accton/x86_64-accton_as9726_32d-r0/sonic_platform/fan.py @@ -0,0 +1,171 @@ +############################################################################# +# Accton +# +# Module contains an implementation of SONiC Platform Base API and +# provides the fan status which are available in the platform +# +############################################################################# + +try: + from sonic_platform_base.fan_base import FanBase + from .helper import APIHelper +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +PSU_FAN_MAX_RPM = 26688 + +CPLD_I2C_PATH = "/sys/bus/i2c/devices/14-0066/fan_" +PSU_HWMON_I2C_PATH ="/sys/bus/i2c/devices/{}-00{}/" +PSU_I2C_MAPPING = { + 0: { + "num": 9, + "addr": "58" + }, + 1: { + "num": 9, + "addr": "59" + }, +} + + +class Fan(FanBase): + """Platform-specific Fan class""" + + def __init__(self, fan_tray_index, fan_index=0, is_psu_fan=False, psu_index=0): + self._api_helper=APIHelper() + self.fan_index = fan_index + self.fan_tray_index = fan_tray_index + self.is_psu_fan = is_psu_fan + + if self.is_psu_fan: + self.psu_index = psu_index + self.psu_i2c_num = PSU_I2C_MAPPING[self.psu_index]['num'] + self.psu_i2c_addr = PSU_I2C_MAPPING[self.psu_index]['addr'] + self.psu_hwmon_path = PSU_HWMON_I2C_PATH.format( + self.psu_i2c_num, self.psu_i2c_addr) + + FanBase.__init__(self) + + + def get_direction(self): + """ + Retrieves the direction of fan + Returns: + A string, either FAN_DIRECTION_INTAKE or FAN_DIRECTION_EXHAUST + depending on fan direction + """ + + + if not self.is_psu_fan: + dir_str = "{}{}{}".format(CPLD_I2C_PATH, 'direction_', self.fan_tray_index) + val=self._api_helper.read_txt_file(dir_str) + if val is not None: + if val==0:#F2B + direction=self.FAN_DIRECTION_EXHAUST + else: + direction=self.FAN_DIRECTION_INTAKE + else: + direction=self.FAN_DIRECTION_EXHAUST + + else: #For PSU + dir_str = "{}{}".format(self.psu_hwmon_path,'psu_fan_dir') + val=self._api_helper.read_txt_file(dir_str) + if val is not None: + if val=='F2B': + direction=self.FAN_DIRECTION_EXHAUST + else: + direction=self.FAN_DIRECTION_INTAKE + else: + direction=self.FAN_DIRECTION_EXHAUST + + return direction + + def get_speed(self): + """ + Retrieves the speed of fan as a percentage of full speed + Returns: + An integer, the percentage of full fan speed, in the range 0 (off) + to 100 (full speed) + + """ + speed = 0 + if self.is_psu_fan: + psu_fan_path= "{}{}".format(self.psu_hwmon_path, 'psu_fan1_speed_rpm') + fan_speed_rpm = self._api_helper.read_txt_file(psu_fan_path) + if fan_speed_rpm is not None: + speed = (int(fan_speed_rpm,10))*100/26688 + if speed > 100: + speed=100 + else: + return 0 + elif self.get_presence(): + speed_path = "{}{}".format(CPLD_I2C_PATH, 'duty_cycle_percentage') + speed=self._api_helper.read_txt_file(speed_path) + if speed is None: + return 0 + return int(speed) + + def get_target_speed(self): + """ + Retrieves the target (expected) speed of the fan + Returns: + An integer, the percentage of full fan speed, in the range 0 (off) + to 100 (full speed) + Note: + speed_pc = pwm_target/255*100 + 0 : when PWM mode is use + pwm : when pwm mode is not use + """ + return False #Not supported + + def get_speed_tolerance(self): + """ + Retrieves the speed tolerance of the fan + Returns: + An integer, the percentage of variance from target speed which is + considered tolerable + """ + return False #Not supported + + def set_speed(self, speed): + """ + Sets the fan speed + Args: + speed: An integer, the percentage of full fan speed to set fan to, + in the range 0 (off) to 100 (full speed) + Returns: + A boolean, True if speed is set successfully, False if not + """ + + if not self.is_psu_fan and self.get_presence(): + speed_path = "{}{}".format(CPLD_I2C_PATH, 'duty_cycle_percentage') + return self._api_helper.write_txt_file(speed_path, int(speed)) + + return False + + def set_status_led(self, color): + """ + Sets the state of the fan module status LED + Args: + color: A string representing the color with which to set the + fan module status LED + Returns: + bool: True if status LED state is set successfully, False if not + """ + return False #Not supported + + def get_presence(self): + """ + Retrieves the presence of the FAN + Returns: + bool: True if FAN is present, False if not + """ + present_path = "{}{}{}".format(CPLD_I2C_PATH, 'present_', self.fan_index+1) + val=self._api_helper.read_txt_file(present_path) + if not self.is_psu_fan: + if val is not None: + return int(val, 10)==1 + else: + return False + else: + return True diff --git a/device/accton/x86_64-accton_as9726_32d-r0/sonic_platform/helper.py b/device/accton/x86_64-accton_as9726_32d-r0/sonic_platform/helper.py new file mode 100644 index 000000000000..4cd60ac90611 --- /dev/null +++ b/device/accton/x86_64-accton_as9726_32d-r0/sonic_platform/helper.py @@ -0,0 +1,117 @@ +import os +import struct +import subprocess +from mmap import * +from sonic_py_common import device_info + +HOST_CHK_CMD = "docker > /dev/null 2>&1" +EMPTY_STRING = "" + + +class APIHelper(): + + def __init__(self): + (self.platform, self.hwsku) = device_info.get_platform_and_hwsku() + + def is_host(self): + return os.system(HOST_CHK_CMD) == 0 + + def pci_get_value(self, resource, offset): + status = True + result = "" + try: + fd = os.open(resource, os.O_RDWR) + mm = mmap(fd, 0) + mm.seek(int(offset)) + read_data_stream = mm.read(4) + result = struct.unpack('I', read_data_stream) + except Exception: + status = False + return status, result + + def run_command(self, cmd): + status = True + result = "" + try: + p = subprocess.Popen( + cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + raw_data, err = p.communicate() + if err == '': + result = raw_data.strip() + except Exception: + status = False + return status, result + + def run_interactive_command(self, cmd): + try: + os.system(cmd) + except Exception: + return False + return True + + def read_txt_file(self, file_path): + try: + with open(file_path, 'r') as fd: + data = fd.read() + return data.strip() + except IOError: + pass + return None + + def write_txt_file(self, file_path, value): + try: + with open(file_path, 'w') as fd: + fd.write(str(value)) + except IOError: + return False + return True + + def ipmi_raw(self, netfn, cmd): + status = True + result = "" + try: + cmd = "ipmitool raw {} {}".format(str(netfn), str(cmd)) + p = subprocess.Popen( + cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + raw_data, err = p.communicate() + if err == '': + result = raw_data.strip() + else: + status = False + except Exception: + status = False + return status, result + + def ipmi_fru_id(self, id, key=None): + status = True + result = "" + try: + cmd = "ipmitool fru print {}".format(str( + id)) if not key else "ipmitool fru print {0} | grep '{1}' ".format(str(id), str(key)) + + p = subprocess.Popen( + cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + raw_data, err = p.communicate() + if err == '': + result = raw_data.strip() + else: + status = False + except Exception: + status = False + return status, result + + def ipmi_set_ss_thres(self, id, threshold_key, value): + status = True + result = "" + try: + cmd = "ipmitool sensor thresh '{}' {} {}".format(str(id), str(threshold_key), str(value)) + p = subprocess.Popen( + cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + raw_data, err = p.communicate() + if err == '': + result = raw_data.strip() + else: + status = False + except Exception: + status = False + return status, result diff --git a/device/accton/x86_64-accton_as9726_32d-r0/sonic_platform/platform.py b/device/accton/x86_64-accton_as9726_32d-r0/sonic_platform/platform.py new file mode 100644 index 000000000000..b6bc56b5cc67 --- /dev/null +++ b/device/accton/x86_64-accton_as9726_32d-r0/sonic_platform/platform.py @@ -0,0 +1,21 @@ +############################################################################# +# Accton +# +# Module contains an implementation of SONiC Platform Base API and +# provides the platform information +# +############################################################################# + +try: + from sonic_platform_base.platform_base import PlatformBase + from sonic_platform.chassis import Chassis +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class Platform(PlatformBase): + """Platform-specific Platform class""" + + def __init__(self): + PlatformBase.__init__(self) + self._chassis = Chassis() diff --git a/device/accton/x86_64-accton_as9726_32d-r0/sonic_platform/psu.py b/device/accton/x86_64-accton_as9726_32d-r0/sonic_platform/psu.py new file mode 100644 index 000000000000..0ccd83faf57d --- /dev/null +++ b/device/accton/x86_64-accton_as9726_32d-r0/sonic_platform/psu.py @@ -0,0 +1,226 @@ +############################################################################# +# Accton +# +# Module contains an implementation of SONiC Platform Base API and +# provides the PSUs status which are available in the platform +# +############################################################################# + +try: + from sonic_platform_base.psu_base import PsuBase + #from sonic_platform.fan import Fan + from .helper import APIHelper +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +I2C_PATH ="/sys/bus/i2c/devices/{0}-00{1}/" + +PSU_NAME_LIST = ["PSU-1", "PSU-2"] +PSU_NUM_FAN = [1, 1] +PSU_HWMON_I2C_MAPPING = { + 0: { + "num": 9, + "addr": "58" + }, + 1: { + "num": 9, + "addr": "59" + }, +} + +PSU_CPLD_I2C_MAPPING = { + 0: { + "num": 9, + "addr": "50" + }, + 1: { + "num": 9, + "addr": "51" + }, +} + +class Psu(PsuBase): + """Platform-specific Psu class""" + + def __init__(self, psu_index=0): + PsuBase.__init__(self) + self.index = psu_index + self._api_helper = APIHelper() + + self.i2c_num = PSU_HWMON_I2C_MAPPING[self.index]["num"] + self.i2c_addr = PSU_HWMON_I2C_MAPPING[self.index]["addr"] + self.hwmon_path = I2C_PATH.format(self.i2c_num, self.i2c_addr) + + self.i2c_num = PSU_CPLD_I2C_MAPPING[self.index]["num"] + self.i2c_addr = PSU_CPLD_I2C_MAPPING[self.index]["addr"] + self.cpld_path = I2C_PATH.format(self.i2c_num, self.i2c_addr) + self.__initialize_fan() + ''' + for fan_index in range(0, PSU_NUM_FAN[self.index]): + #def __init__(self, fan_tray_index, fan_index=0, is_psu_fan=False, psu_index=0): + #fan = Fan(fan_index, 0, is_psu_fan=True, psu_index=self.index) + fan = Fan(fan_index, 0, True, self.index) + self._fan_list.append(fan) + ''' + + def __initialize_fan(self): + from sonic_platform.fan import Fan + for fan_index in range(0, PSU_NUM_FAN[self.index]): + fan = Fan(fan_index, 0, is_psu_fan=True, psu_index=self.index) + self._fan_list.append(fan) + + def get_voltage(self): + """ + Retrieves current PSU voltage output + Returns: + A float number, the output voltage in volts, + e.g. 12.1 + """ + vout_path = "{}{}".format(self.hwmon_path, 'psu_v_out') + vout_val=self._api_helper.read_txt_file(vout_path) + if vout_val is not None: + return float(vout_val)/ 1000 + else: + return 0 + + def get_current(self): + """ + Retrieves present electric current supplied by PSU + Returns: + A float number, the electric current in amperes, e.g 15.4 + """ + iout_path = "{}{}".format(self.hwmon_path, 'psu_i_out') + val=self._api_helper.read_txt_file(iout_path) + if val is not None: + return float(val)/1000 + else: + return 0 + + def get_power(self): + """ + Retrieves current energy supplied by PSU + Returns: + A float number, the power in watts, e.g. 302.6 + """ + pout_path = "{}{}".format(self.hwmon_path, 'psu_p_out') + val=self._api_helper.read_txt_file(pout_path) + if val is not None: + return float(val)/1000 + else: + return 0 + + def get_powergood_status(self): + """ + Retrieves the powergood status of PSU + Returns: + A boolean, True if PSU has stablized its output voltages and passed all + its internal self-tests, False if not. + """ + return self.get_status() + + def set_status_led(self, color): + """ + Sets the state of the PSU status LED + Args: + color: A string representing the color with which to set the PSU status LED + Note: Only support green and off + Returns: + bool: True if status LED state is set successfully, False if not + """ + + return False #Controlled by HW + + def get_status_led(self): + """ + Gets the state of the PSU status LED + Returns: + A string, one of the predefined STATUS_LED_COLOR_* strings above + """ + + return False #Controlled by HW + + def get_temperature(self): + """ + Retrieves current temperature reading from PSU + Returns: + A float number of current temperature in Celsius up to nearest thousandth + of one degree Celsius, e.g. 30.125 + """ + temp_path = "{}{}".format(self.hwmon_path, 'psu_temp1_input') + val=self._api_helper.read_txt_file(temp_path) + if val is not None: + return float(val)/1000 + else: + return 0 + + def get_temperature_high_threshold(self): + """ + Retrieves the high threshold temperature of PSU + Returns: + A float number, the high threshold temperature of PSU in Celsius + up to nearest thousandth of one degree Celsius, e.g. 30.125 + """ + return False #Not supported + + def get_voltage_high_threshold(self): + """ + Retrieves the high threshold PSU voltage output + Returns: + A float number, the high threshold output voltage in volts, + e.g. 12.1 + """ + vout_path = "{}{}".format(self.hwmon_path, 'psu_mfr_vout_max') + vout_val=self._api_helper.read_txt_file(vout_path) + if vout_val is not None: + return float(vout_val)/ 1000 + else: + return 0 + + def get_voltage_low_threshold(self): + """ + Retrieves the low threshold PSU voltage output + Returns: + A float number, the low threshold output voltage in volts, + e.g. 12.1 + """ + vout_path = "{}{}".format(self.hwmon_path, 'psu_mfr_vout_min') + vout_val=self._api_helper.read_txt_file(vout_path) + if vout_val is not None: + return float(vout_val)/ 1000 + else: + return 0 + + def get_name(self): + """ + Retrieves the name of the device + Returns: + string: The name of the device + """ + return PSU_NAME_LIST[self.index] + + def get_presence(self): + """ + Retrieves the presence of the PSU + Returns: + bool: True if PSU is present, False if not + """ + presence_path="{}{}".format(self.cpld_path, 'psu_present') + val=self._api_helper.read_txt_file(presence_path) + if val is not None: + return int(val, 10) == 1 + else: + return 0 + + def get_status(self): + """ + Retrieves the operational status of the device + Returns: + A boolean value, True if device is operating properly, False if not + """ + power_path="{}{}".format(self.cpld_path, 'psu_power_good') + val=self._api_helper.read_txt_file(power_path) + if val is not None: + return int(val, 10) == 1 + else: + return 0 diff --git a/device/accton/x86_64-accton_as9726_32d-r0/sonic_platform/sfp.py b/device/accton/x86_64-accton_as9726_32d-r0/sonic_platform/sfp.py new file mode 100644 index 000000000000..70c6838a8e88 --- /dev/null +++ b/device/accton/x86_64-accton_as9726_32d-r0/sonic_platform/sfp.py @@ -0,0 +1,2221 @@ +############################################################################# +# Accton +# +# Sfp contains an implementation of SONiC Platform Base API and +# provides the sfp device status which are available in the platform +# +############################################################################# + +import os +import sys +import time +import struct + +from ctypes import create_string_buffer + +try: + from sonic_platform_base.sfp_base import SfpBase + from sonic_platform_base.sonic_sfp.sff8472 import sff8472InterfaceId + from sonic_platform_base.sonic_sfp.sff8472 import sff8472Dom + from sonic_platform_base.sonic_sfp.sff8436 import sff8436InterfaceId + from sonic_platform_base.sonic_sfp.sff8436 import sff8436Dom + from sonic_platform_base.sonic_sfp.inf8628 import inf8628InterfaceId + from sonic_platform_base.sonic_sfp.qsfp_dd import qsfp_dd_InterfaceId + from sonic_platform_base.sonic_sfp.qsfp_dd import qsfp_dd_Dom + from sonic_platform_base.sonic_sfp.sfputilhelper import SfpUtilHelper + from .helper import APIHelper +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +#Edge-core definitions +CPLD2_I2C_PATH = "/sys/bus/i2c/devices/10-0061/" +CPLD3_I2C_PATH = "/sys/bus/i2c/devices/10-0062/" + +# definitions of the offset and width for values in XCVR info eeprom +XCVR_INTFACE_BULK_OFFSET = 0 +XCVR_INTFACE_BULK_WIDTH_QSFP = 20 +XCVR_INTFACE_BULK_WIDTH_SFP = 21 +XCVR_TYPE_OFFSET = 0 +XCVR_TYPE_WIDTH = 1 +XCVR_EXT_TYPE_OFFSET = 1 +XCVR_EXT_TYPE_WIDTH = 1 +XCVR_CONNECTOR_OFFSET = 2 +XCVR_CONNECTOR_WIDTH = 1 +XCVR_COMPLIANCE_CODE_OFFSET = 3 +XCVR_COMPLIANCE_CODE_WIDTH = 8 +XCVR_ENCODING_OFFSET = 11 +XCVR_ENCODING_WIDTH = 1 +XCVR_NBR_OFFSET = 12 +XCVR_NBR_WIDTH = 1 +XCVR_EXT_RATE_SEL_OFFSET = 13 +XCVR_EXT_RATE_SEL_WIDTH = 1 +XCVR_CABLE_LENGTH_OFFSET = 14 +XCVR_CABLE_LENGTH_WIDTH_QSFP = 5 +XCVR_CABLE_LENGTH_WIDTH_SFP = 6 +XCVR_VENDOR_NAME_OFFSET = 20 +XCVR_VENDOR_NAME_WIDTH = 16 +XCVR_VENDOR_OUI_OFFSET = 37 +XCVR_VENDOR_OUI_WIDTH = 3 +XCVR_VENDOR_PN_OFFSET = 40 +XCVR_VENDOR_PN_WIDTH = 16 +XCVR_HW_REV_OFFSET = 56 +XCVR_HW_REV_WIDTH_OSFP = 2 +XCVR_HW_REV_WIDTH_QSFP = 2 +XCVR_HW_REV_WIDTH_SFP = 4 +XCVR_EXT_SPECIFICATION_COMPLIANCE_OFFSET = 64 +XCVR_EXT_SPECIFICATION_COMPLIANCE_WIDTH = 1 +XCVR_VENDOR_SN_OFFSET = 68 +XCVR_VENDOR_SN_WIDTH = 16 +XCVR_VENDOR_DATE_OFFSET = 84 +XCVR_VENDOR_DATE_WIDTH = 8 +XCVR_DOM_CAPABILITY_OFFSET = 92 +XCVR_DOM_CAPABILITY_WIDTH = 2 + +XCVR_INTERFACE_DATA_START = 0 +XCVR_INTERFACE_DATA_SIZE = 92 + +QSFP_DOM_BULK_DATA_START = 22 +QSFP_DOM_BULK_DATA_SIZE = 36 +SFP_DOM_BULK_DATA_START = 96 +SFP_DOM_BULK_DATA_SIZE = 10 +QSFP_DD_DOM_BULK_DATA_START = 14 +QSFP_DD_DOM_BULK_DATA_SIZE = 4 + +# definitions of the offset for values in OSFP info eeprom +OSFP_TYPE_OFFSET = 0 +OSFP_VENDOR_NAME_OFFSET = 129 +OSFP_VENDOR_PN_OFFSET = 148 +OSFP_HW_REV_OFFSET = 164 +OSFP_VENDOR_SN_OFFSET = 166 + +# definitions of the offset for values in QSFP_DD info eeprom +QSFP_DD_TYPE_OFFSET = 0 +QSFP_DD_VENDOR_NAME_OFFSET = 1 +QSFP_DD_VENDOR_PN_OFFSET = 20 +QSFP_DD_VENDOR_SN_OFFSET = 38 +QSFP_DD_VENDOR_OUI_OFFSET = 17 + +# definitions of the offset and width for values in XCVR_QSFP_DD info eeprom +XCVR_EXT_TYPE_OFFSET_QSFP_DD = 72 +XCVR_EXT_TYPE_WIDTH_QSFP_DD = 2 +XCVR_CONNECTOR_OFFSET_QSFP_DD = 75 +XCVR_CONNECTOR_WIDTH_QSFP_DD = 1 +XCVR_CABLE_LENGTH_OFFSET_QSFP_DD = 74 +XCVR_CABLE_LENGTH_WIDTH_QSFP_DD = 1 +XCVR_HW_REV_OFFSET_QSFP_DD = 36 +XCVR_HW_REV_WIDTH_QSFP_DD = 2 +XCVR_VENDOR_DATE_OFFSET_QSFP_DD = 54 +XCVR_VENDOR_DATE_WIDTH_QSFP_DD = 8 +XCVR_DOM_CAPABILITY_OFFSET_QSFP_DD = 2 +XCVR_DOM_CAPABILITY_WIDTH_QSFP_DD = 1 +XCVR_MEDIA_TYPE_OFFSET_QSFP_DD = 85 +XCVR_MEDIA_TYPE_WIDTH_QSFP_DD = 1 +XCVR_FIRST_APPLICATION_LIST_OFFSET_QSFP_DD = 86 +XCVR_FIRST_APPLICATION_LIST_WIDTH_QSFP_DD = 32 +XCVR_SECOND_APPLICATION_LIST_OFFSET_QSFP_DD = 351 +XCVR_SECOND_APPLICATION_LIST_WIDTH_QSFP_DD = 28 + +# Offset for values in QSFP eeprom +QSFP_DOM_REV_OFFSET = 1 +QSFP_DOM_REV_WIDTH = 1 +QSFP_TEMPE_OFFSET = 22 +QSFP_TEMPE_WIDTH = 2 +QSFP_VOLT_OFFSET = 26 +QSFP_VOLT_WIDTH = 2 +QSFP_VERSION_COMPLIANCE_OFFSET = 1 +QSFP_VERSION_COMPLIANCE_WIDTH = 2 +QSFP_CHANNL_MON_OFFSET = 34 +QSFP_CHANNL_MON_WIDTH = 16 +QSFP_CHANNL_MON_WITH_TX_POWER_WIDTH = 24 +QSFP_CHANNL_DISABLE_STATUS_OFFSET = 86 +QSFP_CHANNL_DISABLE_STATUS_WIDTH = 1 +QSFP_CHANNL_RX_LOS_STATUS_OFFSET = 3 +QSFP_CHANNL_RX_LOS_STATUS_WIDTH = 1 +QSFP_CHANNL_TX_FAULT_STATUS_OFFSET = 4 +QSFP_CHANNL_TX_FAULT_STATUS_WIDTH = 1 +QSFP_CONTROL_OFFSET = 86 +QSFP_CONTROL_WIDTH = 8 +QSFP_MODULE_MONITOR_OFFSET = 0 +QSFP_MODULE_MONITOR_WIDTH = 9 +QSFP_POWEROVERRIDE_OFFSET = 93 +QSFP_POWEROVERRIDE_WIDTH = 1 +QSFP_POWEROVERRIDE_BIT = 0 +QSFP_POWERSET_BIT = 1 +QSFP_OPTION_VALUE_OFFSET = 192 +QSFP_OPTION_VALUE_WIDTH = 4 +QSFP_MODULE_UPPER_PAGE3_START = 384 +QSFP_MODULE_THRESHOLD_OFFSET = 128 +QSFP_MODULE_THRESHOLD_WIDTH = 24 +QSFP_CHANNL_THRESHOLD_OFFSET = 176 +QSFP_CHANNL_THRESHOLD_WIDTH = 24 + +SFP_MODULE_ADDRA2_OFFSET = 256 +SFP_MODULE_THRESHOLD_OFFSET = 0 +SFP_MODULE_THRESHOLD_WIDTH = 56 +SFP_CHANNL_THRESHOLD_OFFSET = 112 +SFP_CHANNL_THRESHOLD_WIDTH = 2 + +SFP_TEMPE_OFFSET = 96 +SFP_TEMPE_WIDTH = 2 +SFP_VOLT_OFFSET = 98 +SFP_VOLT_WIDTH = 2 +SFP_CHANNL_MON_OFFSET = 100 +SFP_CHANNL_MON_WIDTH = 6 +SFP_CHANNL_STATUS_OFFSET = 110 +SFP_CHANNL_STATUS_WIDTH = 1 + +QSFP_DD_TEMPE_OFFSET = 14 +QSFP_DD_TEMPE_WIDTH = 2 +QSFP_DD_VOLT_OFFSET = 16 +QSFP_DD_VOLT_WIDTH = 2 +QSFP_DD_TX_BIAS_OFFSET = 42 +QSFP_DD_TX_BIAS_WIDTH = 16 +QSFP_DD_RX_POWER_OFFSET = 58 +QSFP_DD_RX_POWER_WIDTH = 16 +QSFP_DD_TX_POWER_OFFSET = 26 +QSFP_DD_TX_POWER_WIDTH = 16 +QSFP_DD_CHANNL_MON_OFFSET = 154 +QSFP_DD_CHANNL_MON_WIDTH = 48 +QSFP_DD_CHANNL_DISABLE_STATUS_OFFSET = 86 +QSFP_DD_CHANNL_DISABLE_STATUS_WIDTH = 1 +QSFP_DD_CHANNL_RX_LOS_STATUS_OFFSET = 19 +QSFP_DD_CHANNL_RX_LOS_STATUS_WIDTH = 1 +QSFP_DD_CHANNL_TX_FAULT_STATUS_OFFSET = 7 +QSFP_DD_CHANNL_TX_FAULT_STATUS_WIDTH = 1 +QSFP_DD_MODULE_THRESHOLD_OFFSET = 0 +QSFP_DD_MODULE_THRESHOLD_WIDTH = 72 +QSFP_DD_CHANNL_STATUS_OFFSET = 26 +QSFP_DD_CHANNL_STATUS_WIDTH = 1 + + +sfp_cable_length_tup = ( + 'LengthSMFkm-UnitsOfKm', 'LengthSMF(UnitsOf100m)', + 'Length50um(UnitsOf10m)', 'Length62.5um(UnitsOfm)', + 'LengthCable(UnitsOfm)', 'LengthOM3(UnitsOf10m)' +) + +sfp_compliance_code_tup = ( + '10GEthernetComplianceCode', 'InfinibandComplianceCode', + 'ESCONComplianceCodes', 'SONETComplianceCodes', + 'EthernetComplianceCodes', 'FibreChannelLinkLength', + 'FibreChannelTechnology', 'SFP+CableTechnology', + 'FibreChannelTransmissionMedia', 'FibreChannelSpeed' +) + +qsfp_compliance_code_tup = ( + '10/40G Ethernet Compliance Code', 'SONET Compliance codes', + 'SAS/SATA compliance codes', 'Gigabit Ethernet Compliant codes', + 'Fibre Channel link length/Transmitter Technology', + 'Fibre Channel transmission media', 'Fibre Channel Speed' +) + +info_dict_keys = [ + 'type', 'hardware_rev', 'serial', 'manufacturer', + 'model', 'connector', 'encoding', 'ext_identifier', + 'ext_rateselect_compliance', 'cable_type', 'cable_length', + 'nominal_bit_rate', 'specification_compliance', 'vendor_date', + 'vendor_oui', 'application_advertisement', 'type_abbrv_name' +] + +qsfp_cable_length_tup = ('Length(km)', 'Length OM3(2m)', + 'Length OM2(m)', 'Length OM1(m)', + 'Length Cable Assembly(m)') + +dom_info_dict_keys = [ + 'rx_los', 'tx_fault', 'reset_status', 'lp_mode', + 'tx_disable', 'tx_disable_channel', 'temperature', 'voltage', + 'rx1power', 'rx2power', 'rx3power', 'rx4power', + 'rx5power', 'rx6power', 'rx7power', 'rx8power', + 'tx1bias', 'tx2bias', 'tx3bias', 'tx4bias', + 'tx5bias', 'tx6bias', 'tx7bias', 'tx8bias', + 'tx1power', 'tx2power', 'tx3power', 'tx4power', + 'tx5power', 'tx6power', 'tx7power', 'tx8power'] + +threshold_dict_keys = [ + 'temphighalarm', 'temphighwarning', + 'templowalarm', 'templowwarning', + 'vcchighalarm', 'vcchighwarning', + 'vcclowalarm', 'vcclowwarning', + 'rxpowerhighalarm', 'rxpowerhighwarning', + 'rxpowerlowalarm', 'rxpowerlowwarning', + 'txpowerhighalarm', 'txpowerhighwarning', + 'txpowerlowalarm', 'txpowerlowwarning', + 'txbiashighalarm', 'txbiashighwarning', + 'txbiaslowalarm', 'txbiaslowwarning'] + +SFP_TYPE_CODE_LIST = [ + '03' # SFP/SFP+/SFP28 +] +QSFP_TYPE_CODE_LIST = [ + '0d', # QSFP+ or later + '11' # QSFP28 or later +] +QSFP_DD_TYPE_CODE_LIST = [ + '18' # QSFP-DD Double Density 8X Pluggable Transceiver +] + +SFP_TYPE = "SFP" +QSFP_TYPE = "QSFP" +OSFP_TYPE = "OSFP" +QSFP_DD_TYPE = "QSFP_DD" + +NULL_VAL = 'N/A' + +PORT_START = 1 +PORT_END = 34 +QSFP_PORT_START = 1 +QSFP_PORT_END = 32 + +SFP_I2C_START = 17 +I2C_EEPROM_PATH = '/sys/bus/i2c/devices/{0}-0050/eeprom' + + +class Sfp(SfpBase): + """Platform-specific Sfp class""" + HOST_CHK_CMD = "docker > /dev/null 2>&1" + PLATFORM = "x86_64-accton_as9726_32d-r0" + HWSKU = "Accton-AS9726-32D" + + # Path to sysfs + PLATFORM_ROOT_PATH = "/usr/share/sonic/device" + PMON_HWSKU_PATH = "/usr/share/sonic/hwsku" + + CPLD2_PORT_START = 1 + CPLD2_PORT_END = 16 + CPLD3_PORT_START = 17 + CPLD3_PORT_END = 32 + PRS_PATH = "/sys/devices/platform/dx010_cpld/qsfp_modprs" + + def __init__(self, sfp_index=0, sfp_name=None): + + self._index = sfp_index + self._port_num = self._index + 1 + self._api_helper = APIHelper() + self._name = sfp_name + + self._dom_capability_detect() + self._eeprom_path = self._get_eeprom_path() + SfpBase.__init__(self) + + def __write_txt_file(self, file_path, value): + try: + reg_file = open(file_path, "w") + except IOError as e: + print("Error: unable to open file: %s" % str(e)) + return False + + reg_file.write(str(value)) + reg_file.close() + + return True + + def __is_host(self): + return os.system(self.HOST_CHK_CMD) == 0 + + def __get_path_to_port_config_file(self): + platform_path = "/".join([self.PLATFORM_ROOT_PATH, self.PLATFORM]) + hwsku_path = "/".join([platform_path, self.HWSKU] + ) if self.__is_host() else self.PMON_HWSKU_PATH + return "/".join([hwsku_path, "port_config.ini"]) + + def _convert_string_to_num(self, value_str): + if "-inf" in value_str: + return 'N/A' + elif "Unknown" in value_str: + return 'N/A' + elif 'dBm' in value_str: + t_str = value_str.rstrip('dBm') + return float(t_str) + elif 'mA' in value_str: + t_str = value_str.rstrip('mA') + return float(t_str) + elif 'C' in value_str: + t_str = value_str.rstrip('C') + return float(t_str) + elif 'Volts' in value_str: + t_str = value_str.rstrip('Volts') + return float(t_str) + else: + return 'N/A' + + def _read_eeprom_specific_bytes(self, offset, num_bytes): + sysfs_sfp_i2c_client_eeprom_path = self._get_eeprom_path() + eeprom_raw = [] + try: + eeprom = open( + sysfs_sfp_i2c_client_eeprom_path, + mode="rb", buffering=0) + except IOError: + return None + + for i in range(0, num_bytes): + eeprom_raw.append("0x00") + + try: + eeprom.seek(offset) + raw = eeprom.read(num_bytes) + except IOError: + eeprom.close() + return None + + try: + if isinstance(raw, str): + for n in range(0, num_bytes): + eeprom_raw[n] = hex(ord(raw[n]))[2:].zfill(2) + else: + for n in range(0, num_bytes): + eeprom_raw[n] = hex(raw[n])[2:].zfill(2) + + except BaseException: + eeprom.close() + return None + + eeprom.close() + return eeprom_raw + + def _detect_sfp_type(self): + sfp_type = QSFP_TYPE + eeprom_raw = [] + eeprom_raw = self._read_eeprom_specific_bytes( + XCVR_TYPE_OFFSET, XCVR_TYPE_WIDTH) + if eeprom_raw: + if eeprom_raw[0] in SFP_TYPE_CODE_LIST: + self.sfp_type = SFP_TYPE + elif eeprom_raw[0] in QSFP_TYPE_CODE_LIST: + self.sfp_type = QSFP_TYPE + elif eeprom_raw[0] in QSFP_DD_TYPE_CODE_LIST: + self.sfp_type = QSFP_DD_TYPE + else: + self.sfp_type = sfp_type + else: + self.sfp_type = sfp_type + + def _get_eeprom_path(self): + port_to_i2c_mapping = SFP_I2C_START + self._index + port_eeprom_path = I2C_EEPROM_PATH.format(port_to_i2c_mapping) + return port_eeprom_path + + def _dom_capability_detect(self): + self._detect_sfp_type() + + if not self.get_presence(): + self.dom_supported = False + self.dom_temp_supported = False + self.dom_volt_supported = False + self.dom_rx_power_supported = False + self.dom_tx_power_supported = False + self.calibration = 0 + return + + if self.sfp_type == QSFP_TYPE: + self.calibration = 1 + sfpi_obj = sff8436InterfaceId() + if sfpi_obj is None: + self.dom_supported = False + offset = 128 + + # QSFP capability byte parse, + # through this byte can know whether it support tx_power or not. + # TODO: in the future when decided to migrate to support SFF-8636 instead of SFF-8436, + # need to add more code for determining the capability and version compliance + # in SFF-8636 dom capability definitions evolving with the versions. + + qsfp_dom_capability_raw = self._read_eeprom_specific_bytes( + (offset + XCVR_DOM_CAPABILITY_OFFSET), + XCVR_DOM_CAPABILITY_WIDTH) + if qsfp_dom_capability_raw is not None: + qsfp_version_compliance_raw = self._read_eeprom_specific_bytes( + QSFP_VERSION_COMPLIANCE_OFFSET, + QSFP_VERSION_COMPLIANCE_WIDTH) + qsfp_version_compliance = int( + qsfp_version_compliance_raw[0], 16) + dom_capability = sfpi_obj.parse_dom_capability( + qsfp_dom_capability_raw, 0) + if qsfp_version_compliance >= 0x08: + self.dom_temp_supported = dom_capability['data']['Temp_support']['value'] == 'On' + self.dom_volt_supported = dom_capability['data']['Voltage_support']['value'] == 'On' + self.dom_rx_power_supported = dom_capability['data']['Rx_power_support']['value'] == 'On' + self.dom_tx_power_supported = dom_capability['data']['Tx_power_support']['value'] == 'On' + else: + self.dom_temp_supported = True + self.dom_volt_supported = True + self.dom_rx_power_supported = dom_capability['data']['Rx_power_support']['value'] == 'On' + self.dom_tx_power_supported = True + + self.dom_supported = True + self.calibration = 1 + sfpd_obj = sff8436Dom() + if sfpd_obj is None: + return None + qsfp_option_value_raw = self._read_eeprom_specific_bytes( + QSFP_OPTION_VALUE_OFFSET, QSFP_OPTION_VALUE_WIDTH) + if qsfp_option_value_raw is not None: + optional_capability = sfpd_obj.parse_option_params( + qsfp_option_value_raw, 0) + self.dom_tx_disable_supported = optional_capability[ + 'data']['TxDisable']['value'] == 'On' + dom_status_indicator = sfpd_obj.parse_dom_status_indicator( + qsfp_version_compliance_raw, 1) + self.qsfp_page3_available = dom_status_indicator['data']['FlatMem']['value'] == 'Off' + else: + self.dom_supported = False + self.dom_temp_supported = False + self.dom_volt_supported = False + self.dom_rx_power_supported = False + self.dom_tx_power_supported = False + self.calibration = 0 + self.qsfp_page3_available = False + + elif self.sfp_type == QSFP_DD_TYPE: + sfpi_obj = qsfp_dd_InterfaceId() + if sfpi_obj is None: + self.dom_supported = False + + offset = 0 + # two types of QSFP-DD cable types supported: Copper and Optical. + qsfp_dom_capability_raw = self._read_eeprom_specific_bytes( + (offset + XCVR_DOM_CAPABILITY_OFFSET_QSFP_DD), XCVR_DOM_CAPABILITY_WIDTH_QSFP_DD) + if qsfp_dom_capability_raw is not None: + self.dom_temp_supported = True + self.dom_volt_supported = True + dom_capability = sfpi_obj.parse_dom_capability( + qsfp_dom_capability_raw, 0) + if dom_capability['data']['Flat_MEM']['value'] == 'Off': + self.dom_supported = True + self.second_application_list = True + self.dom_rx_power_supported = True + self.dom_tx_power_supported = True + self.dom_tx_bias_power_supported = True + self.dom_thresholds_supported = True + # currently set to False becasue Page 11h is not supported by FW + self.dom_rx_tx_power_bias_supported = False + else: + self.dom_supported = False + self.second_application_list = False + self.dom_rx_power_supported = False + self.dom_tx_power_supported = False + self.dom_tx_bias_power_supported = False + self.dom_thresholds_supported = False + self.dom_rx_tx_power_bias_supported = False + else: + self.dom_supported = False + self.dom_temp_supported = False + self.dom_volt_supported = False + self.dom_rx_power_supported = False + self.dom_tx_power_supported = False + self.dom_tx_bias_power_supported = False + self.dom_thresholds_supported = False + self.dom_rx_tx_power_bias_supported = False + + elif self.sfp_type == SFP_TYPE: + sfpi_obj = sff8472InterfaceId() + if sfpi_obj is None: + return None + sfp_dom_capability_raw = self._read_eeprom_specific_bytes( + XCVR_DOM_CAPABILITY_OFFSET, XCVR_DOM_CAPABILITY_WIDTH) + if sfp_dom_capability_raw is not None: + sfp_dom_capability = int(sfp_dom_capability_raw[0], 16) + self.dom_supported = (sfp_dom_capability & 0x40 != 0) + if self.dom_supported: + self.dom_temp_supported = True + self.dom_volt_supported = True + self.dom_rx_power_supported = True + self.dom_tx_power_supported = True + if sfp_dom_capability & 0x20 != 0: + self.calibration = 1 + elif sfp_dom_capability & 0x10 != 0: + self.calibration = 2 + else: + self.calibration = 0 + else: + self.dom_temp_supported = False + self.dom_volt_supported = False + self.dom_rx_power_supported = False + self.dom_tx_power_supported = False + self.calibration = 0 + self.dom_tx_disable_supported = ( + int(sfp_dom_capability_raw[1], 16) & 0x40 != 0) + else: + self.dom_supported = False + self.dom_temp_supported = False + self.dom_volt_supported = False + self.dom_rx_power_supported = False + self.dom_tx_power_supported = False + + def get_transceiver_info(self): + """ + Retrieves transceiver info of this SFP + Returns: + A dict which contains following keys/values : + ================================================================================ + keys |Value Format |Information + ---------------------------|---------------|---------------------------- + type |1*255VCHAR |type of SFP + hardware_rev |1*255VCHAR |hardware version of SFP + serial |1*255VCHAR |serial number of the SFP + manufacturer |1*255VCHAR |SFP vendor name + model |1*255VCHAR |SFP model name + connector |1*255VCHAR |connector information + encoding |1*255VCHAR |encoding information + ext_identifier |1*255VCHAR |extend identifier + ext_rateselect_compliance |1*255VCHAR |extended rateSelect compliance + cable_length |INT |cable length in m + nominal_bit_rate |INT |nominal bit rate by 100Mbs + specification_compliance |1*255VCHAR |specification compliance + vendor_date |1*255VCHAR |vendor date + vendor_oui |1*255VCHAR |vendor OUI + application_advertisement |1*255VCHAR |supported applications advertisement + ================================================================================ + """ + + transceiver_info_dict = {} + compliance_code_dict = {} + transceiver_info_dict = dict.fromkeys( + info_dict_keys, NULL_VAL) + transceiver_info_dict["specification_compliance"] = '{}' + + # ToDo: OSFP tranceiver info parsing not fully supported. + # in inf8628.py lack of some memory map definition + # will be implemented when the inf8628 memory map ready + if self.sfp_type == OSFP_TYPE: + offset = 0 + vendor_rev_width = XCVR_HW_REV_WIDTH_OSFP + + sfpi_obj = inf8628InterfaceId() + if sfpi_obj is None: + return transceiver_info_dict + + sfp_type_raw = self._read_eeprom_specific_bytes( + (offset + OSFP_TYPE_OFFSET), XCVR_TYPE_WIDTH) + if sfp_type_raw is not None: + sfp_type_data = sfpi_obj.parse_sfp_type(sfp_type_raw, 0) + else: + return transceiver_info_dict + + sfp_vendor_name_raw = self._read_eeprom_specific_bytes( + (offset + OSFP_VENDOR_NAME_OFFSET), XCVR_VENDOR_NAME_WIDTH) + if sfp_vendor_name_raw is not None: + sfp_vendor_name_data = sfpi_obj.parse_vendor_name( + sfp_vendor_name_raw, 0) + else: + return transceiver_info_dict + + sfp_vendor_pn_raw = self._read_eeprom_specific_bytes( + (offset + OSFP_VENDOR_PN_OFFSET), XCVR_VENDOR_PN_WIDTH) + if sfp_vendor_pn_raw is not None: + sfp_vendor_pn_data = sfpi_obj.parse_vendor_pn( + sfp_vendor_pn_raw, 0) + else: + return transceiver_info_dict + + sfp_vendor_rev_raw = self._read_eeprom_specific_bytes( + (offset + OSFP_HW_REV_OFFSET), vendor_rev_width) + if sfp_vendor_rev_raw is not None: + sfp_vendor_rev_data = sfpi_obj.parse_vendor_rev( + sfp_vendor_rev_raw, 0) + else: + return transceiver_info_dict + + sfp_vendor_sn_raw = self._read_eeprom_specific_bytes( + (offset + OSFP_VENDOR_SN_OFFSET), XCVR_VENDOR_SN_WIDTH) + if sfp_vendor_sn_raw is not None: + sfp_vendor_sn_data = sfpi_obj.parse_vendor_sn( + sfp_vendor_sn_raw, 0) + else: + return transceiver_info_dict + + transceiver_info_dict['type'] = sfp_type_data['data']['type']['value'] + transceiver_info_dict['manufacturer'] = sfp_vendor_name_data['data']['Vendor Name']['value'] + transceiver_info_dict['model'] = sfp_vendor_pn_data['data']['Vendor PN']['value'] + transceiver_info_dict['hardware_rev'] = sfp_vendor_rev_data['data']['Vendor Rev']['value'] + transceiver_info_dict['serial'] = sfp_vendor_sn_data['data']['Vendor SN']['value'] + + elif self.sfp_type == QSFP_TYPE: + offset = 128 + vendor_rev_width = XCVR_HW_REV_WIDTH_QSFP + interface_info_bulk_width = XCVR_INTFACE_BULK_WIDTH_QSFP + + sfpi_obj = sff8436InterfaceId() + if sfpi_obj is None: + print("Error: sfp_object open failed") + return transceiver_info_dict + + elif self.sfp_type == QSFP_DD_TYPE: + offset = 128 + + sfpi_obj = qsfp_dd_InterfaceId() + if sfpi_obj is None: + print("Error: sfp_object open failed") + return transceiver_info_dict + + sfp_type_raw = self._read_eeprom_specific_bytes( + (offset + QSFP_DD_TYPE_OFFSET), XCVR_TYPE_WIDTH) + if sfp_type_raw is not None: + sfp_type_data = sfpi_obj.parse_sfp_type(sfp_type_raw, 0) + else: + return transceiver_info_dict + + sfp_vendor_name_raw = self._read_eeprom_specific_bytes( + (offset + QSFP_DD_VENDOR_NAME_OFFSET), XCVR_VENDOR_NAME_WIDTH) + if sfp_vendor_name_raw is not None: + sfp_vendor_name_data = sfpi_obj.parse_vendor_name( + sfp_vendor_name_raw, 0) + else: + return transceiver_info_dict + + sfp_vendor_pn_raw = self._read_eeprom_specific_bytes( + (offset + QSFP_DD_VENDOR_PN_OFFSET), XCVR_VENDOR_PN_WIDTH) + if sfp_vendor_pn_raw is not None: + sfp_vendor_pn_data = sfpi_obj.parse_vendor_pn( + sfp_vendor_pn_raw, 0) + else: + return transceiver_info_dict + + sfp_vendor_rev_raw = self._read_eeprom_specific_bytes( + (offset + XCVR_HW_REV_OFFSET_QSFP_DD), XCVR_HW_REV_WIDTH_QSFP_DD) + if sfp_vendor_rev_raw is not None: + sfp_vendor_rev_data = sfpi_obj.parse_vendor_rev( + sfp_vendor_rev_raw, 0) + else: + return transceiver_info_dict + + sfp_vendor_sn_raw = self._read_eeprom_specific_bytes( + (offset + QSFP_DD_VENDOR_SN_OFFSET), XCVR_VENDOR_SN_WIDTH) + if sfp_vendor_sn_raw is not None: + sfp_vendor_sn_data = sfpi_obj.parse_vendor_sn( + sfp_vendor_sn_raw, 0) + else: + return transceiver_info_dict + + sfp_vendor_oui_raw = self._read_eeprom_specific_bytes( + (offset + QSFP_DD_VENDOR_OUI_OFFSET), XCVR_VENDOR_OUI_WIDTH) + if sfp_vendor_oui_raw is not None: + sfp_vendor_oui_data = sfpi_obj.parse_vendor_oui( + sfp_vendor_oui_raw, 0) + else: + return transceiver_info_dict + + sfp_vendor_date_raw = self._read_eeprom_specific_bytes( + (offset + XCVR_VENDOR_DATE_OFFSET_QSFP_DD), XCVR_VENDOR_DATE_WIDTH_QSFP_DD) + if sfp_vendor_date_raw is not None: + sfp_vendor_date_data = sfpi_obj.parse_vendor_date( + sfp_vendor_date_raw, 0) + else: + return transceiver_info_dict + + sfp_connector_raw = self._read_eeprom_specific_bytes( + (offset + XCVR_CONNECTOR_OFFSET_QSFP_DD), XCVR_CONNECTOR_WIDTH_QSFP_DD) + if sfp_connector_raw is not None: + sfp_connector_data = sfpi_obj.parse_connector( + sfp_connector_raw, 0) + else: + return transceiver_info_dict + + sfp_ext_identifier_raw = self._read_eeprom_specific_bytes( + (offset + XCVR_EXT_TYPE_OFFSET_QSFP_DD), XCVR_EXT_TYPE_WIDTH_QSFP_DD) + if sfp_ext_identifier_raw is not None: + sfp_ext_identifier_data = sfpi_obj.parse_ext_iden( + sfp_ext_identifier_raw, 0) + else: + return transceiver_info_dict + + sfp_cable_len_raw = self._read_eeprom_specific_bytes( + (offset + XCVR_CABLE_LENGTH_OFFSET_QSFP_DD), XCVR_CABLE_LENGTH_WIDTH_QSFP_DD) + if sfp_cable_len_raw is not None: + sfp_cable_len_data = sfpi_obj.parse_cable_len( + sfp_cable_len_raw, 0) + else: + return transceiver_info_dict + + sfp_media_type_raw = self._read_eeprom_specific_bytes( + XCVR_MEDIA_TYPE_OFFSET_QSFP_DD, XCVR_MEDIA_TYPE_WIDTH_QSFP_DD) + if sfp_media_type_raw is not None: + sfp_media_type_dict = sfpi_obj.parse_media_type( + sfp_media_type_raw, 0) + if sfp_media_type_dict is None: + return transceiver_info_dict + + host_media_list = "" + sfp_application_type_first_list = self._read_eeprom_specific_bytes( + (XCVR_FIRST_APPLICATION_LIST_OFFSET_QSFP_DD), XCVR_FIRST_APPLICATION_LIST_WIDTH_QSFP_DD) + if self.second_application_list: + possible_application_count = 15 + sfp_application_type_second_list = self._read_eeprom_specific_bytes( + (XCVR_SECOND_APPLICATION_LIST_OFFSET_QSFP_DD), XCVR_SECOND_APPLICATION_LIST_WIDTH_QSFP_DD) + if sfp_application_type_first_list is not None and sfp_application_type_second_list is not None: + sfp_application_type_list = sfp_application_type_first_list + \ + sfp_application_type_second_list + else: + return transceiver_info_dict + else: + possible_application_count = 8 + if sfp_application_type_first_list is not None: + sfp_application_type_list = sfp_application_type_first_list + else: + return transceiver_info_dict + + for i in range(0, possible_application_count): + if sfp_application_type_list[i * 4] == 'ff': + break + host_electrical, media_interface = sfpi_obj.parse_application( + sfp_media_type_dict, sfp_application_type_list[i * 4], sfp_application_type_list[i * 4 + 1]) + host_media_list = host_media_list + host_electrical + \ + ' - ' + media_interface + '\n\t\t\t\t ' + else: + return transceiver_info_dict + + transceiver_info_dict['type'] = str( + sfp_type_data['data']['type']['value']) + transceiver_info_dict['manufacturer'] = str( + sfp_vendor_name_data['data']['Vendor Name']['value']) + transceiver_info_dict['model'] = str( + sfp_vendor_pn_data['data']['Vendor PN']['value']) + transceiver_info_dict['hardware_rev'] = str( + sfp_vendor_rev_data['data']['Vendor Rev']['value']) + transceiver_info_dict['serial'] = str( + sfp_vendor_sn_data['data']['Vendor SN']['value']) + transceiver_info_dict['vendor_oui'] = str( + sfp_vendor_oui_data['data']['Vendor OUI']['value']) + transceiver_info_dict['vendor_date'] = str( + sfp_vendor_date_data['data']['VendorDataCode(YYYY-MM-DD Lot)']['value']) + transceiver_info_dict['connector'] = str( + sfp_connector_data['data']['Connector']['value']) + transceiver_info_dict['encoding'] = "Not supported for CMIS cables" + transceiver_info_dict['ext_identifier'] = str( + sfp_ext_identifier_data['data']['Extended Identifier']['value']) + transceiver_info_dict['ext_rateselect_compliance'] = "Not supported for CMIS cables" + transceiver_info_dict['specification_compliance'] = "Not supported for CMIS cables" + transceiver_info_dict['cable_type'] = "Length Cable Assembly(m)" + transceiver_info_dict['cable_length'] = str( + sfp_cable_len_data['data']['Length Cable Assembly(m)']['value']) + transceiver_info_dict['nominal_bit_rate'] = "Not supported for CMIS cables" + transceiver_info_dict['application_advertisement'] = host_media_list + + else: + offset = 0 + vendor_rev_width = XCVR_HW_REV_WIDTH_SFP + interface_info_bulk_width = XCVR_INTFACE_BULK_WIDTH_SFP + + sfpi_obj = sff8472InterfaceId() + if sfpi_obj is None: + print("Error: sfp_object open failed") + return transceiver_info_dict + + if self.sfp_type != QSFP_DD_TYPE: + sfp_interface_bulk_raw = self._read_eeprom_specific_bytes( + offset + XCVR_INTERFACE_DATA_START, XCVR_INTERFACE_DATA_SIZE) + if sfp_interface_bulk_raw is None: + return transceiver_info_dict + + start = XCVR_INTFACE_BULK_OFFSET - XCVR_INTERFACE_DATA_START + end = start + interface_info_bulk_width + sfp_interface_bulk_data = sfpi_obj.parse_sfp_info_bulk( + sfp_interface_bulk_raw[start: end], 0) + + start = XCVR_VENDOR_NAME_OFFSET - XCVR_INTERFACE_DATA_START + end = start + XCVR_VENDOR_NAME_WIDTH + sfp_vendor_name_data = sfpi_obj.parse_vendor_name( + sfp_interface_bulk_raw[start: end], 0) + + start = XCVR_VENDOR_PN_OFFSET - XCVR_INTERFACE_DATA_START + end = start + XCVR_VENDOR_PN_WIDTH + sfp_vendor_pn_data = sfpi_obj.parse_vendor_pn( + sfp_interface_bulk_raw[start: end], 0) + + start = XCVR_HW_REV_OFFSET - XCVR_INTERFACE_DATA_START + end = start + vendor_rev_width + sfp_vendor_rev_data = sfpi_obj.parse_vendor_rev( + sfp_interface_bulk_raw[start: end], 0) + + start = XCVR_VENDOR_SN_OFFSET - XCVR_INTERFACE_DATA_START + end = start + XCVR_VENDOR_SN_WIDTH + sfp_vendor_sn_data = sfpi_obj.parse_vendor_sn( + sfp_interface_bulk_raw[start: end], 0) + + start = XCVR_VENDOR_OUI_OFFSET - XCVR_INTERFACE_DATA_START + end = start + XCVR_VENDOR_OUI_WIDTH + sfp_vendor_oui_data = sfpi_obj.parse_vendor_oui( + sfp_interface_bulk_raw[start: end], 0) + + start = XCVR_VENDOR_DATE_OFFSET - XCVR_INTERFACE_DATA_START + end = start + XCVR_VENDOR_DATE_WIDTH + sfp_vendor_date_data = sfpi_obj.parse_vendor_date( + sfp_interface_bulk_raw[start: end], 0) + + transceiver_info_dict['type'] = sfp_interface_bulk_data['data']['type']['value'] + transceiver_info_dict['manufacturer'] = sfp_vendor_name_data['data']['Vendor Name']['value'] + transceiver_info_dict['model'] = sfp_vendor_pn_data['data']['Vendor PN']['value'] + transceiver_info_dict['hardware_rev'] = sfp_vendor_rev_data['data']['Vendor Rev']['value'] + transceiver_info_dict['serial'] = sfp_vendor_sn_data['data']['Vendor SN']['value'] + transceiver_info_dict['vendor_oui'] = sfp_vendor_oui_data['data']['Vendor OUI']['value'] + transceiver_info_dict['vendor_date'] = sfp_vendor_date_data[ + 'data']['VendorDataCode(YYYY-MM-DD Lot)']['value'] + transceiver_info_dict['connector'] = sfp_interface_bulk_data['data']['Connector']['value'] + transceiver_info_dict['encoding'] = sfp_interface_bulk_data['data']['EncodingCodes']['value'] + transceiver_info_dict['ext_identifier'] = sfp_interface_bulk_data['data']['Extended Identifier']['value'] + transceiver_info_dict['ext_rateselect_compliance'] = sfp_interface_bulk_data['data']['RateIdentifier']['value'] + + if self.sfp_type == QSFP_TYPE: + for key in qsfp_cable_length_tup: + if key in sfp_interface_bulk_data['data']: + transceiver_info_dict['cable_type'] = key + transceiver_info_dict['cable_length'] = str( + sfp_interface_bulk_data['data'][key]['value']) + + for key in qsfp_compliance_code_tup: + if key in sfp_interface_bulk_data['data']['Specification compliance']['value']: + compliance_code_dict[key] = sfp_interface_bulk_data['data']['Specification compliance']['value'][key]['value'] + sfp_ext_specification_compliance_raw = self._read_eeprom_specific_bytes( + offset + XCVR_EXT_SPECIFICATION_COMPLIANCE_OFFSET, XCVR_EXT_SPECIFICATION_COMPLIANCE_WIDTH) + if sfp_ext_specification_compliance_raw is not None: + sfp_ext_specification_compliance_data = sfpi_obj.parse_ext_specification_compliance( + sfp_ext_specification_compliance_raw[0: 1], 0) + if sfp_ext_specification_compliance_data['data']['Extended Specification compliance']['value'] != "Unspecified": + compliance_code_dict['Extended Specification compliance'] = sfp_ext_specification_compliance_data[ + 'data']['Extended Specification compliance']['value'] + transceiver_info_dict['specification_compliance'] = str( + compliance_code_dict) + transceiver_info_dict['nominal_bit_rate'] = str( + sfp_interface_bulk_data['data']['Nominal Bit Rate(100Mbs)']['value']) + else: + for key in sfp_cable_length_tup: + if key in sfp_interface_bulk_data['data']: + transceiver_info_dict['cable_type'] = key + transceiver_info_dict['cable_length'] = str( + sfp_interface_bulk_data['data'][key]['value']) + + for key in sfp_compliance_code_tup: + if key in sfp_interface_bulk_data['data']['Specification compliance']['value']: + compliance_code_dict[key] = sfp_interface_bulk_data['data']['Specification compliance']['value'][key]['value'] + transceiver_info_dict['specification_compliance'] = str( + compliance_code_dict) + + transceiver_info_dict['nominal_bit_rate'] = str( + sfp_interface_bulk_data['data']['NominalSignallingRate(UnitsOf100Mbd)']['value']) + + return transceiver_info_dict + + def get_transceiver_bulk_status(self): + """ + Retrieves transceiver bulk status of this SFP + Returns: + A dict which contains following keys/values : + ======================================================================== + keys |Value Format |Information + ---------------------------|---------------|---------------------------- + rx_los |BOOLEAN |RX loss-of-signal status, True if has RX los, False if not. + tx_fault |BOOLEAN |TX fault status, True if has TX fault, False if not. + reset_status |BOOLEAN |reset status, True if SFP in reset, False if not. + lp_mode |BOOLEAN |low power mode status, True in lp mode, False if not. + tx_disable |BOOLEAN |TX disable status, True TX disabled, False if not. + tx_disabled_channel |HEX |disabled TX channels in hex, bits 0 to 3 represent channel 0 + | |to channel 3. + temperature |INT |module temperature in Celsius + voltage |INT |supply voltage in mV + txbias |INT |TX Bias Current in mA, n is the channel number, + | |for example, tx2bias stands for tx bias of channel 2. + rxpower |INT |received optical power in mW, n is the channel number, + | |for example, rx2power stands for rx power of channel 2. + txpower |INT |TX output power in mW, n is the channel number, + | |for example, tx2power stands for tx power of channel 2. + ======================================================================== + """ + transceiver_dom_info_dict = dict.fromkeys( + dom_info_dict_keys, NULL_VAL) + + if self.sfp_type == OSFP_TYPE: + pass + + elif self.sfp_type == QSFP_TYPE: + if not self.dom_supported: + return transceiver_dom_info_dict + + offset = 0 + sfpd_obj = sff8436Dom() + if sfpd_obj is None: + return transceiver_dom_info_dict + + dom_data_raw = self._read_eeprom_specific_bytes( + (offset + QSFP_DOM_BULK_DATA_START), QSFP_DOM_BULK_DATA_SIZE) + if dom_data_raw is None: + return transceiver_dom_info_dict + + if self.dom_temp_supported: + start = QSFP_TEMPE_OFFSET - QSFP_DOM_BULK_DATA_START + end = start + QSFP_TEMPE_WIDTH + dom_temperature_data = sfpd_obj.parse_temperature( + dom_data_raw[start: end], 0) + temp = dom_temperature_data['data']['Temperature']['value'] + if temp is not None: + transceiver_dom_info_dict['temperature'] = temp + + if self.dom_volt_supported: + start = QSFP_VOLT_OFFSET - QSFP_DOM_BULK_DATA_START + end = start + QSFP_VOLT_WIDTH + dom_voltage_data = sfpd_obj.parse_voltage( + dom_data_raw[start: end], 0) + volt = dom_voltage_data['data']['Vcc']['value'] + if volt is not None: + transceiver_dom_info_dict['voltage'] = volt + + start = QSFP_CHANNL_MON_OFFSET - QSFP_DOM_BULK_DATA_START + end = start + QSFP_CHANNL_MON_WITH_TX_POWER_WIDTH + dom_channel_monitor_data = sfpd_obj.parse_channel_monitor_params_with_tx_power( + dom_data_raw[start: end], 0) + + if self.dom_tx_power_supported: + transceiver_dom_info_dict['tx1power'] = dom_channel_monitor_data['data']['TX1Power']['value'] + transceiver_dom_info_dict['tx2power'] = dom_channel_monitor_data['data']['TX2Power']['value'] + transceiver_dom_info_dict['tx3power'] = dom_channel_monitor_data['data']['TX3Power']['value'] + transceiver_dom_info_dict['tx4power'] = dom_channel_monitor_data['data']['TX4Power']['value'] + + if self.dom_rx_power_supported: + transceiver_dom_info_dict['rx1power'] = dom_channel_monitor_data['data']['RX1Power']['value'] + transceiver_dom_info_dict['rx2power'] = dom_channel_monitor_data['data']['RX2Power']['value'] + transceiver_dom_info_dict['rx3power'] = dom_channel_monitor_data['data']['RX3Power']['value'] + transceiver_dom_info_dict['rx4power'] = dom_channel_monitor_data['data']['RX4Power']['value'] + + transceiver_dom_info_dict['tx1bias'] = dom_channel_monitor_data['data']['TX1Bias']['value'] + transceiver_dom_info_dict['tx2bias'] = dom_channel_monitor_data['data']['TX2Bias']['value'] + transceiver_dom_info_dict['tx3bias'] = dom_channel_monitor_data['data']['TX3Bias']['value'] + transceiver_dom_info_dict['tx4bias'] = dom_channel_monitor_data['data']['TX4Bias']['value'] + + elif self.sfp_type == QSFP_DD_TYPE: + + offset = 0 + sfpd_obj = qsfp_dd_Dom() + if sfpd_obj is None: + return transceiver_dom_info_dict + + dom_data_raw = self._read_eeprom_specific_bytes( + (offset + QSFP_DD_DOM_BULK_DATA_START), QSFP_DD_DOM_BULK_DATA_SIZE) + if dom_data_raw is None: + return transceiver_dom_info_dict + + if self.dom_temp_supported: + start = QSFP_DD_TEMPE_OFFSET - QSFP_DD_DOM_BULK_DATA_START + end = start + QSFP_DD_TEMPE_WIDTH + dom_temperature_data = sfpd_obj.parse_temperature( + dom_data_raw[start: end], 0) + temp = dom_temperature_data['data']['Temperature']['value'] + if temp is not None: + transceiver_dom_info_dict['temperature'] = temp + + if self.dom_volt_supported: + start = QSFP_DD_VOLT_OFFSET - QSFP_DD_DOM_BULK_DATA_START + end = start + QSFP_DD_VOLT_WIDTH + dom_voltage_data = sfpd_obj.parse_voltage( + dom_data_raw[start: end], 0) + volt = dom_voltage_data['data']['Vcc']['value'] + if volt is not None: + transceiver_dom_info_dict['voltage'] = volt + + if self.dom_rx_tx_power_bias_supported: + # page 11h + dom_data_raw = self._read_eeprom_specific_bytes( + (QSFP_DD_CHANNL_MON_OFFSET), QSFP_DD_CHANNL_MON_WIDTH) + if dom_data_raw is None: + return transceiver_dom_info_dict + dom_channel_monitor_data = sfpd_obj.parse_channel_monitor_params( + dom_data_raw, 0) + + if self.dom_tx_power_supported: + transceiver_dom_info_dict['tx1power'] = str( + dom_channel_monitor_data['data']['TX1Power']['value']) + transceiver_dom_info_dict['tx2power'] = str( + dom_channel_monitor_data['data']['TX2Power']['value']) + transceiver_dom_info_dict['tx3power'] = str( + dom_channel_monitor_data['data']['TX3Power']['value']) + transceiver_dom_info_dict['tx4power'] = str( + dom_channel_monitor_data['data']['TX4Power']['value']) + transceiver_dom_info_dict['tx5power'] = str( + dom_channel_monitor_data['data']['TX5Power']['value']) + transceiver_dom_info_dict['tx6power'] = str( + dom_channel_monitor_data['data']['TX6Power']['value']) + transceiver_dom_info_dict['tx7power'] = str( + dom_channel_monitor_data['data']['TX7Power']['value']) + transceiver_dom_info_dict['tx8power'] = str( + dom_channel_monitor_data['data']['TX8Power']['value']) + + if self.dom_rx_power_supported: + transceiver_dom_info_dict['rx1power'] = str( + dom_channel_monitor_data['data']['RX1Power']['value']) + transceiver_dom_info_dict['rx2power'] = str( + dom_channel_monitor_data['data']['RX2Power']['value']) + transceiver_dom_info_dict['rx3power'] = str( + dom_channel_monitor_data['data']['RX3Power']['value']) + transceiver_dom_info_dict['rx4power'] = str( + dom_channel_monitor_data['data']['RX4Power']['value']) + transceiver_dom_info_dict['rx5power'] = str( + dom_channel_monitor_data['data']['RX5Power']['value']) + transceiver_dom_info_dict['rx6power'] = str( + dom_channel_monitor_data['data']['RX6Power']['value']) + transceiver_dom_info_dict['rx7power'] = str( + dom_channel_monitor_data['data']['RX7Power']['value']) + transceiver_dom_info_dict['rx8power'] = str( + dom_channel_monitor_data['data']['RX8Power']['value']) + + if self.dom_tx_bias_power_supported: + transceiver_dom_info_dict['tx1bias'] = str( + dom_channel_monitor_data['data']['TX1Bias']['value']) + transceiver_dom_info_dict['tx2bias'] = str( + dom_channel_monitor_data['data']['TX2Bias']['value']) + transceiver_dom_info_dict['tx3bias'] = str( + dom_channel_monitor_data['data']['TX3Bias']['value']) + transceiver_dom_info_dict['tx4bias'] = str( + dom_channel_monitor_data['data']['TX4Bias']['value']) + transceiver_dom_info_dict['tx5bias'] = str( + dom_channel_monitor_data['data']['TX5Bias']['value']) + transceiver_dom_info_dict['tx6bias'] = str( + dom_channel_monitor_data['data']['TX6Bias']['value']) + transceiver_dom_info_dict['tx7bias'] = str( + dom_channel_monitor_data['data']['TX7Bias']['value']) + transceiver_dom_info_dict['tx8bias'] = str( + dom_channel_monitor_data['data']['TX8Bias']['value']) + + return transceiver_dom_info_dict + + else: + if not self.dom_supported: + return transceiver_dom_info_dict + + offset = 256 + sfpd_obj = sff8472Dom() + if sfpd_obj is None: + return transceiver_dom_info_dict + sfpd_obj._calibration_type = self.calibration + + dom_data_raw = self._read_eeprom_specific_bytes( + (offset + SFP_DOM_BULK_DATA_START), SFP_DOM_BULK_DATA_SIZE) + + start = SFP_TEMPE_OFFSET - SFP_DOM_BULK_DATA_START + end = start + SFP_TEMPE_WIDTH + dom_temperature_data = sfpd_obj.parse_temperature( + dom_data_raw[start: end], 0) + + start = SFP_VOLT_OFFSET - SFP_DOM_BULK_DATA_START + end = start + SFP_VOLT_WIDTH + dom_voltage_data = sfpd_obj.parse_voltage( + dom_data_raw[start: end], 0) + + start = SFP_CHANNL_MON_OFFSET - SFP_DOM_BULK_DATA_START + end = start + SFP_CHANNL_MON_WIDTH + dom_channel_monitor_data = sfpd_obj.parse_channel_monitor_params( + dom_data_raw[start: end], 0) + + transceiver_dom_info_dict['temperature'] = dom_temperature_data['data']['Temperature']['value'] + transceiver_dom_info_dict['voltage'] = dom_voltage_data['data']['Vcc']['value'] + transceiver_dom_info_dict['rx1power'] = dom_channel_monitor_data['data']['RXPower']['value'] + transceiver_dom_info_dict['tx1bias'] = dom_channel_monitor_data['data']['TXBias']['value'] + transceiver_dom_info_dict['tx1power'] = dom_channel_monitor_data['data']['TXPower']['value'] + + transceiver_dom_info_dict['lp_mode'] = self.get_lpmode() + transceiver_dom_info_dict['reset_status'] = self.get_reset_status() + transceiver_dom_info_dict['tx_disable'] = self.get_tx_disable() + transceiver_dom_info_dict['tx_disabled_channel'] = self.get_tx_disable_channel( + ) + + for key in transceiver_dom_info_dict: + val = transceiver_dom_info_dict[key] + transceiver_dom_info_dict[key] = self._convert_string_to_num( + val) if type(val) is str else val + + return transceiver_dom_info_dict + + def get_transceiver_threshold_info(self): + """ + Retrieves transceiver threshold info of this SFP + + Returns: + A dict which contains following keys/values : + ======================================================================== + keys |Value Format |Information + ---------------------------|---------------|---------------------------- + temphighalarm |FLOAT |High Alarm Threshold value of temperature in Celsius. + templowalarm |FLOAT |Low Alarm Threshold value of temperature in Celsius. + temphighwarning |FLOAT |High Warning Threshold value of temperature in Celsius. + templowwarning |FLOAT |Low Warning Threshold value of temperature in Celsius. + vcchighalarm |FLOAT |High Alarm Threshold value of supply voltage in mV. + vcclowalarm |FLOAT |Low Alarm Threshold value of supply voltage in mV. + vcchighwarning |FLOAT |High Warning Threshold value of supply voltage in mV. + vcclowwarning |FLOAT |Low Warning Threshold value of supply voltage in mV. + rxpowerhighalarm |FLOAT |High Alarm Threshold value of received power in dBm. + rxpowerlowalarm |FLOAT |Low Alarm Threshold value of received power in dBm. + rxpowerhighwarning |FLOAT |High Warning Threshold value of received power in dBm. + rxpowerlowwarning |FLOAT |Low Warning Threshold value of received power in dBm. + txpowerhighalarm |FLOAT |High Alarm Threshold value of transmit power in dBm. + txpowerlowalarm |FLOAT |Low Alarm Threshold value of transmit power in dBm. + txpowerhighwarning |FLOAT |High Warning Threshold value of transmit power in dBm. + txpowerlowwarning |FLOAT |Low Warning Threshold value of transmit power in dBm. + txbiashighalarm |FLOAT |High Alarm Threshold value of tx Bias Current in mA. + txbiaslowalarm |FLOAT |Low Alarm Threshold value of tx Bias Current in mA. + txbiashighwarning |FLOAT |High Warning Threshold value of tx Bias Current in mA. + txbiaslowwarning |FLOAT |Low Warning Threshold value of tx Bias Current in mA. + ======================================================================== + """ + transceiver_dom_threshold_info_dict = dict.fromkeys( + threshold_dict_keys, NULL_VAL) + + if self.sfp_type == OSFP_TYPE: + pass + + elif self.sfp_type == QSFP_TYPE: + if not self.dom_supported or not self.qsfp_page3_available: + return transceiver_dom_threshold_info_dict + + # Dom Threshold data starts from offset 384 + # Revert offset back to 0 once data is retrieved + offset = QSFP_MODULE_UPPER_PAGE3_START + sfpd_obj = sff8436Dom() + if sfpd_obj is None: + return transceiver_dom_threshold_info_dict + + dom_module_threshold_raw = self._read_eeprom_specific_bytes( + (offset + QSFP_MODULE_THRESHOLD_OFFSET), QSFP_MODULE_THRESHOLD_WIDTH) + if dom_module_threshold_raw is None: + return transceiver_dom_threshold_info_dict + + dom_module_threshold_data = sfpd_obj.parse_module_threshold_values( + dom_module_threshold_raw, 0) + + dom_channel_threshold_raw = self._read_eeprom_specific_bytes((offset + QSFP_CHANNL_THRESHOLD_OFFSET), + QSFP_CHANNL_THRESHOLD_WIDTH) + if dom_channel_threshold_raw is None: + return transceiver_dom_threshold_info_dict + dom_channel_threshold_data = sfpd_obj.parse_channel_threshold_values( + dom_channel_threshold_raw, 0) + + # Threshold Data + transceiver_dom_threshold_info_dict['temphighalarm'] = dom_module_threshold_data['data']['TempHighAlarm']['value'] + transceiver_dom_threshold_info_dict['temphighwarning'] = dom_module_threshold_data['data']['TempHighWarning']['value'] + transceiver_dom_threshold_info_dict['templowalarm'] = dom_module_threshold_data['data']['TempLowAlarm']['value'] + transceiver_dom_threshold_info_dict['templowwarning'] = dom_module_threshold_data['data']['TempLowWarning']['value'] + transceiver_dom_threshold_info_dict['vcchighalarm'] = dom_module_threshold_data['data']['VccHighAlarm']['value'] + transceiver_dom_threshold_info_dict['vcchighwarning'] = dom_module_threshold_data['data']['VccHighWarning']['value'] + transceiver_dom_threshold_info_dict['vcclowalarm'] = dom_module_threshold_data['data']['VccLowAlarm']['value'] + transceiver_dom_threshold_info_dict['vcclowwarning'] = dom_module_threshold_data['data']['VccLowWarning']['value'] + transceiver_dom_threshold_info_dict['rxpowerhighalarm'] = dom_channel_threshold_data['data']['RxPowerHighAlarm']['value'] + transceiver_dom_threshold_info_dict['rxpowerhighwarning'] = dom_channel_threshold_data['data']['RxPowerHighWarning']['value'] + transceiver_dom_threshold_info_dict['rxpowerlowalarm'] = dom_channel_threshold_data['data']['RxPowerLowAlarm']['value'] + transceiver_dom_threshold_info_dict['rxpowerlowwarning'] = dom_channel_threshold_data['data']['RxPowerLowWarning']['value'] + transceiver_dom_threshold_info_dict['txbiashighalarm'] = dom_channel_threshold_data['data']['TxBiasHighAlarm']['value'] + transceiver_dom_threshold_info_dict['txbiashighwarning'] = dom_channel_threshold_data['data']['TxBiasHighWarning']['value'] + transceiver_dom_threshold_info_dict['txbiaslowalarm'] = dom_channel_threshold_data['data']['TxBiasLowAlarm']['value'] + transceiver_dom_threshold_info_dict['txbiaslowwarning'] = dom_channel_threshold_data['data']['TxBiasLowWarning']['value'] + transceiver_dom_threshold_info_dict['txpowerhighalarm'] = dom_channel_threshold_data['data']['TxPowerHighAlarm']['value'] + transceiver_dom_threshold_info_dict['txpowerhighwarning'] = dom_channel_threshold_data['data']['TxPowerHighWarning']['value'] + transceiver_dom_threshold_info_dict['txpowerlowalarm'] = dom_channel_threshold_data['data']['TxPowerLowAlarm']['value'] + transceiver_dom_threshold_info_dict['txpowerlowwarning'] = dom_channel_threshold_data['data']['TxPowerLowWarning']['value'] + + elif self.sfp_type == QSFP_DD_TYPE: + if not self.dom_supported: + return transceiver_dom_threshold_info_dict + + if not self.dom_thresholds_supported: + return transceiver_dom_threshold_info_dict + + sfpd_obj = qsfp_dd_Dom() + if sfpd_obj is None: + return transceiver_dom_threshold_info_dict + + # page 02 + offset = 384 + dom_module_threshold_raw = self._read_eeprom_specific_bytes( + (offset + QSFP_DD_MODULE_THRESHOLD_OFFSET), QSFP_DD_MODULE_THRESHOLD_WIDTH) + if dom_module_threshold_raw is None: + return transceiver_dom_threshold_info_dict + + dom_module_threshold_data = sfpd_obj.parse_module_threshold_values( + dom_module_threshold_raw, 0) + + # Threshold Data + transceiver_dom_threshold_info_dict['temphighalarm'] = dom_module_threshold_data['data']['TempHighAlarm']['value'] + transceiver_dom_threshold_info_dict['temphighwarning'] = dom_module_threshold_data['data']['TempHighWarning']['value'] + transceiver_dom_threshold_info_dict['templowalarm'] = dom_module_threshold_data['data']['TempLowAlarm']['value'] + transceiver_dom_threshold_info_dict['templowwarning'] = dom_module_threshold_data['data']['TempLowWarning']['value'] + transceiver_dom_threshold_info_dict['vcchighalarm'] = dom_module_threshold_data['data']['VccHighAlarm']['value'] + transceiver_dom_threshold_info_dict['vcchighwarning'] = dom_module_threshold_data['data']['VccHighWarning']['value'] + transceiver_dom_threshold_info_dict['vcclowalarm'] = dom_module_threshold_data['data']['VccLowAlarm']['value'] + transceiver_dom_threshold_info_dict['vcclowwarning'] = dom_module_threshold_data['data']['VccLowWarning']['value'] + transceiver_dom_threshold_info_dict['rxpowerhighalarm'] = dom_module_threshold_data['data']['RxPowerHighAlarm']['value'] + transceiver_dom_threshold_info_dict['rxpowerhighwarning'] = dom_module_threshold_data['data']['RxPowerHighWarning']['value'] + transceiver_dom_threshold_info_dict['rxpowerlowalarm'] = dom_module_threshold_data['data']['RxPowerLowAlarm']['value'] + transceiver_dom_threshold_info_dict['rxpowerlowwarning'] = dom_module_threshold_data['data']['RxPowerLowWarning']['value'] + transceiver_dom_threshold_info_dict['txbiashighalarm'] = dom_module_threshold_data['data']['TxBiasHighAlarm']['value'] + transceiver_dom_threshold_info_dict['txbiashighwarning'] = dom_module_threshold_data['data']['TxBiasHighWarning']['value'] + transceiver_dom_threshold_info_dict['txbiaslowalarm'] = dom_module_threshold_data['data']['TxBiasLowAlarm']['value'] + transceiver_dom_threshold_info_dict['txbiaslowwarning'] = dom_module_threshold_data['data']['TxBiasLowWarning']['value'] + transceiver_dom_threshold_info_dict['txpowerhighalarm'] = dom_module_threshold_data['data']['TxPowerHighAlarm']['value'] + transceiver_dom_threshold_info_dict['txpowerhighwarning'] = dom_module_threshold_data['data']['TxPowerHighWarning']['value'] + transceiver_dom_threshold_info_dict['txpowerlowalarm'] = dom_module_threshold_data['data']['TxPowerLowAlarm']['value'] + transceiver_dom_threshold_info_dict['txpowerlowwarning'] = dom_module_threshold_data['data']['TxPowerLowWarning']['value'] + + else: + offset = SFP_MODULE_ADDRA2_OFFSET + + if not self.dom_supported: + return transceiver_dom_threshold_info_dict + + sfpd_obj = sff8472Dom(None, self.calibration) + if sfpd_obj is None: + return transceiver_dom_threshold_info_dict + + dom_module_threshold_raw = self._read_eeprom_specific_bytes((offset + SFP_MODULE_THRESHOLD_OFFSET), + SFP_MODULE_THRESHOLD_WIDTH) + if dom_module_threshold_raw is not None: + dom_module_threshold_data = sfpd_obj.parse_alarm_warning_threshold( + dom_module_threshold_raw, 0) + else: + return transceiver_dom_threshold_info_dict + + # Threshold Data + transceiver_dom_threshold_info_dict['temphighalarm'] = dom_module_threshold_data['data']['TempHighAlarm']['value'] + transceiver_dom_threshold_info_dict['templowalarm'] = dom_module_threshold_data['data']['TempLowAlarm']['value'] + transceiver_dom_threshold_info_dict['temphighwarning'] = dom_module_threshold_data['data']['TempHighWarning']['value'] + transceiver_dom_threshold_info_dict['templowwarning'] = dom_module_threshold_data['data']['TempLowWarning']['value'] + transceiver_dom_threshold_info_dict['vcchighalarm'] = dom_module_threshold_data['data']['VoltageHighAlarm']['value'] + transceiver_dom_threshold_info_dict['vcclowalarm'] = dom_module_threshold_data['data']['VoltageLowAlarm']['value'] + transceiver_dom_threshold_info_dict['vcchighwarning'] = dom_module_threshold_data[ + 'data']['VoltageHighWarning']['value'] + transceiver_dom_threshold_info_dict['vcclowwarning'] = dom_module_threshold_data['data']['VoltageLowWarning']['value'] + transceiver_dom_threshold_info_dict['txbiashighalarm'] = dom_module_threshold_data['data']['BiasHighAlarm']['value'] + transceiver_dom_threshold_info_dict['txbiaslowalarm'] = dom_module_threshold_data['data']['BiasLowAlarm']['value'] + transceiver_dom_threshold_info_dict['txbiashighwarning'] = dom_module_threshold_data['data']['BiasHighWarning']['value'] + transceiver_dom_threshold_info_dict['txbiaslowwarning'] = dom_module_threshold_data['data']['BiasLowWarning']['value'] + transceiver_dom_threshold_info_dict['txpowerhighalarm'] = dom_module_threshold_data['data']['TXPowerHighAlarm']['value'] + transceiver_dom_threshold_info_dict['txpowerlowalarm'] = dom_module_threshold_data['data']['TXPowerLowAlarm']['value'] + transceiver_dom_threshold_info_dict['txpowerhighwarning'] = dom_module_threshold_data['data']['TXPowerHighWarning']['value'] + transceiver_dom_threshold_info_dict['txpowerlowwarning'] = dom_module_threshold_data['data']['TXPowerLowWarning']['value'] + transceiver_dom_threshold_info_dict['rxpowerhighalarm'] = dom_module_threshold_data['data']['RXPowerHighAlarm']['value'] + transceiver_dom_threshold_info_dict['rxpowerlowalarm'] = dom_module_threshold_data['data']['RXPowerLowAlarm']['value'] + transceiver_dom_threshold_info_dict['rxpowerhighwarning'] = dom_module_threshold_data['data']['RXPowerHighWarning']['value'] + transceiver_dom_threshold_info_dict['rxpowerlowwarning'] = dom_module_threshold_data['data']['RXPowerLowWarning']['value'] + + for key in transceiver_dom_threshold_info_dict: + transceiver_dom_threshold_info_dict[key] = self._convert_string_to_num( + transceiver_dom_threshold_info_dict[key]) + + return transceiver_dom_threshold_info_dict + + def get_reset_status(self): + """ + Retrieves the reset status of SFP + Returns: + A Boolean, True if reset enabled, False if disabled + """ + if self._port_num <= 16: + reset_path = "{}{}{}".format(CPLD2_I2C_PATH, '/module_reset_', self._port_num) + else: + reset_path = "{}{}{}".format(CPLD3_I2C_PATH, '/module_reset_', self._port_num) + + val=self._api_helper.read_txt_file(reset_path) + if val is not None: + return int(val, 10)==1 + else: + return False + + def get_rx_los(self): + """ + Retrieves the RX LOS (lost-of-signal) status of SFP + Returns: + A Boolean, True if SFP has RX LOS, False if not. + Note : RX LOS status is latched until a call to get_rx_los or a reset. + """ + rx_los_list = [] + + if self.sfp_type == OSFP_TYPE: + return None + elif self.sfp_type == QSFP_TYPE: + offset = 0 + dom_channel_monitor_raw = self._read_eeprom_specific_bytes( + (offset + QSFP_CHANNL_RX_LOS_STATUS_OFFSET), + QSFP_CHANNL_RX_LOS_STATUS_WIDTH) + if dom_channel_monitor_raw is not None: + rx_los_data = int(dom_channel_monitor_raw[0], 16) + rx_los_list.append(rx_los_data & 0x01 != 0) + rx_los_list.append(rx_los_data & 0x02 != 0) + rx_los_list.append(rx_los_data & 0x04 != 0) + rx_los_list.append(rx_los_data & 0x08 != 0) + else: + return [False] * 4 + + elif self.sfp_type == QSFP_DD_TYPE: + # page 11h + if self.dom_rx_tx_power_bias_supported: + offset = 128 + dom_channel_monitor_raw = self._read_eeprom_specific_bytes( + (offset + QSFP_DD_CHANNL_RX_LOS_STATUS_OFFSET), + QSFP_DD_CHANNL_RX_LOS_STATUS_WIDTH) + if dom_channel_monitor_raw is not None: + rx_los_data = int(dom_channel_monitor_raw[0], 8) + rx_los_list.append(rx_los_data & 0x01 != 0) + rx_los_list.append(rx_los_data & 0x02 != 0) + rx_los_list.append(rx_los_data & 0x04 != 0) + rx_los_list.append(rx_los_data & 0x08 != 0) + rx_los_list.append(rx_los_data & 0x10 != 0) + rx_los_list.append(rx_los_data & 0x20 != 0) + rx_los_list.append(rx_los_data & 0x40 != 0) + rx_los_list.append(rx_los_data & 0x80 != 0) + else: + return [False] * 8 + else: + offset = 256 + dom_channel_monitor_raw = self._read_eeprom_specific_bytes( + (offset + SFP_CHANNL_STATUS_OFFSET), SFP_CHANNL_STATUS_WIDTH) + if dom_channel_monitor_raw is not None: + rx_los_data = int(dom_channel_monitor_raw[0], 16) + rx_los_list.append(rx_los_data & 0x02 != 0) + else: + return [False] + return rx_los_list + + def get_tx_fault(self): + """ + Retrieves the TX fault status of SFP + Returns: + A Boolean, True if SFP has TX fault, False if not + Note : TX fault status is lached until a call to get_tx_fault or a reset. + """ + tx_fault_list = [] + + if self.sfp_type == OSFP_TYPE: + return None + elif self.sfp_type == QSFP_TYPE: + offset = 0 + dom_channel_monitor_raw = self._read_eeprom_specific_bytes( + (offset + QSFP_CHANNL_TX_FAULT_STATUS_OFFSET), + QSFP_CHANNL_TX_FAULT_STATUS_WIDTH) + if dom_channel_monitor_raw is not None: + tx_fault_data = int(dom_channel_monitor_raw[0], 16) + tx_fault_list.append(tx_fault_data & 0x01 != 0) + tx_fault_list.append(tx_fault_data & 0x02 != 0) + tx_fault_list.append(tx_fault_data & 0x04 != 0) + tx_fault_list.append(tx_fault_data & 0x08 != 0) + else: + return [False] * 4 + elif self.sfp_type == QSFP_DD_TYPE: + # page 11h + if self.dom_rx_tx_power_bias_supported: + offset = 128 + dom_channel_monitor_raw = self._read_eeprom_specific_bytes( + (offset + QSFP_DD_CHANNL_TX_FAULT_STATUS_OFFSET), + QSFP_DD_CHANNL_TX_FAULT_STATUS_WIDTH) + if dom_channel_monitor_raw is not None: + tx_fault_data = int(dom_channel_monitor_raw[0], 8) + tx_fault_list.append(tx_fault_data & 0x01 != 0) + tx_fault_list.append(tx_fault_data & 0x02 != 0) + tx_fault_list.append(tx_fault_data & 0x04 != 0) + tx_fault_list.append(tx_fault_data & 0x08 != 0) + tx_fault_list.append(tx_fault_data & 0x10 != 0) + tx_fault_list.append(tx_fault_data & 0x20 != 0) + tx_fault_list.append(tx_fault_data & 0x40 != 0) + tx_fault_list.append(tx_fault_data & 0x80 != 0) + else: + return [False] * 8 + else: + offset = 256 + dom_channel_monitor_raw = self._read_eeprom_specific_bytes( + (offset + SFP_CHANNL_STATUS_OFFSET), SFP_CHANNL_STATUS_WIDTH) + if dom_channel_monitor_raw is not None: + tx_fault_data = int(dom_channel_monitor_raw[0], 16) + tx_fault_list.append(tx_fault_data & 0x04 != 0) + else: + return None + return tx_fault_list + + def get_tx_disable(self): + """ + Retrieves the tx_disable status of this SFP + Returns: + A list of boolean values, representing the TX disable status + of each available channel, value is True if SFP channel + is TX disabled, False if not. + E.g., for a tranceiver with four channels: [False, False, True, False] + """ + tx_disable_list = [] + if self.sfp_type == OSFP_TYPE: + return None + elif self.sfp_type == QSFP_TYPE: + offset = 0 + dom_channel_monitor_raw = self._read_eeprom_specific_bytes( + (offset + QSFP_CHANNL_DISABLE_STATUS_OFFSET), + QSFP_CHANNL_DISABLE_STATUS_WIDTH) + if dom_channel_monitor_raw is not None: + tx_disable_data = int(dom_channel_monitor_raw[0], 16) + tx_disable_list.append(tx_disable_data & 0x01 != 0) + tx_disable_list.append(tx_disable_data & 0x02 != 0) + tx_disable_list.append(tx_disable_data & 0x04 != 0) + tx_disable_list.append(tx_disable_data & 0x08 != 0) + else: + return [False] * 4 + + elif self.sfp_type == QSFP_DD_TYPE: + if self.dom_rx_tx_power_bias_supported: + offset = 128 + dom_channel_monitor_raw = self._read_eeprom_specific_bytes( + (offset + QSFP_DD_CHANNL_DISABLE_STATUS_OFFSET), + QSFP_DD_CHANNL_DISABLE_STATUS_WIDTH) + if dom_channel_monitor_raw is not None: + tx_disable_data = int(dom_channel_monitor_raw[0], 16) + tx_disable_list.append(tx_disable_data & 0x01 != 0) + tx_disable_list.append(tx_disable_data & 0x02 != 0) + tx_disable_list.append(tx_disable_data & 0x04 != 0) + tx_disable_list.append(tx_disable_data & 0x08 != 0) + tx_disable_list.append(tx_disable_data & 0x10 != 0) + tx_disable_list.append(tx_disable_data & 0x20 != 0) + tx_disable_list.append(tx_disable_data & 0x40 != 0) + tx_disable_list.append(tx_disable_data & 0x80 != 0) + else: + return [False] * 8 + else: + offset = 256 + dom_channel_monitor_raw = self._read_eeprom_specific_bytes( + (offset + SFP_CHANNL_STATUS_OFFSET), SFP_CHANNL_STATUS_WIDTH) + if dom_channel_monitor_raw is not None: + tx_disable_data = int(dom_channel_monitor_raw[0], 16) + tx_disable_list.append(tx_disable_data & 0xC0 != 0) + else: + return [False] + return tx_disable_list + + def get_tx_disable_channel(self): + """ + Retrieves the TX disabled channels in this SFP + Returns: + A hex of 4 bits (bit 0 to bit 3 as channel 0 to channel 3) to represent + TX channels which have been disabled in this SFP. + As an example, a returned value of 0x5 indicates that channel 0 + and channel 2 have been disabled. + """ + tx_disable_list = self.get_tx_disable() + if tx_disable_list is None: + return 0 + tx_disabled = 0 + for i in range(len(tx_disable_list)): + if tx_disable_list[i]: + tx_disabled |= 1 << i + return tx_disabled + + def get_lpmode(self): + """ + Retrieves the lpmode (low power mode) status of this SFP + Returns: + A Boolean, True if lpmode is enabled, False if disabled + """ + if self._port_num > 32: + # SFP doesn't support this feature + return False + else: + try: + eeprom = None + + if not self.get_presence(): + return False + # Write to eeprom + port_to_i2c_mapping = SFP_I2C_START + self._index + port_eeprom_path = I2C_EEPROM_PATH.format(port_to_i2c_mapping) + + eeprom = open(port_eeprom_path, "rb") + eeprom.seek(QSFP_POWEROVERRIDE_OFFSET) + lpmode = ord(eeprom.read(1)) + + if ((lpmode & 0x3) == 0x3): + return True # Low Power Mode if "Power override" bit is 1 and "Power set" bit is 1 + else: + # High Power Mode if one of the following conditions is matched: + # 1. "Power override" bit is 0 + # 2. "Power override" bit is 1 and "Power set" bit is 0 + return False + except IOError as e: + print("Error: unable to open file: %s" % str(e)) + return False + finally: + if eeprom is not None: + eeprom.close() + time.sleep(0.01) + + def get_power_set(self): + + if self._port_num > 32: + # SFP doesn't support this feature + return False + else: + power_set = False + + sfpd_obj = sff8436Dom() + if sfpd_obj is None: + return False + + dom_control_raw = self._read_eeprom_specific_bytes( + QSFP_POWEROVERRIDE_OFFSET, QSFP_CONTROL_WIDTH) if self.get_presence() else None + if dom_control_raw is not None: + dom_control_data = sfpd_obj.parse_control_bytes(dom_control_raw, 0) + power_set = ( + 'On' == dom_control_data['data']['PowerSet']['value']) + + return power_set + + def get_power_override(self): + """ + Retrieves the power-override status of this SFP + Returns: + A Boolean, True if power-override is enabled, False if disabled + """ + if self.sfp_type == QSFP_TYPE: + offset = 0 + sfpd_obj = sff8436Dom() + if sfpd_obj is None: + return False + + dom_control_raw = self._read_eeprom_specific_bytes( + (offset + QSFP_CONTROL_OFFSET), QSFP_CONTROL_WIDTH) + if dom_control_raw is not None: + dom_control_data = sfpd_obj.parse_control_bytes( + dom_control_raw, 0) + return ('On' == dom_control_data['data']['PowerOverride']) + else: + return False + else: + return NotImplementedError + + def get_temperature(self): + """ + Retrieves the temperature of this SFP + Returns: + An integer number of current temperature in Celsius + """ + default = 0.0 + if not self.dom_supported: + return default + + if self.sfp_type == QSFP_TYPE: + offset = 0 + + sfpd_obj = sff8436Dom() + if sfpd_obj is None: + return default + + if self.dom_temp_supported: + dom_temperature_raw = self._read_eeprom_specific_bytes( + (offset + QSFP_TEMPE_OFFSET), QSFP_TEMPE_WIDTH) + if dom_temperature_raw is not None: + dom_temperature_data = sfpd_obj.parse_temperature( + dom_temperature_raw, 0) + temp = self._convert_string_to_num( + dom_temperature_data['data']['Temperature']['value']) + return temp + + elif self.sfp_type == QSFP_DD_TYPE: + offset = 0 + + sfpd_obj = qsfp_dd_Dom() + if sfpd_obj is None: + return default + + if self.dom_temp_supported: + dom_temperature_raw = self._read_eeprom_specific_bytes( + (offset + QSFP_DD_TEMPE_OFFSET), QSFP_DD_TEMPE_WIDTH) + if dom_temperature_raw is not None: + dom_temperature_data = sfpd_obj.parse_temperature( + dom_temperature_raw, 0) + temp = self._convert_string_to_num( + dom_temperature_data['data']['Temperature']['value']) + return temp + + else: + offset = 256 + sfpd_obj = sff8472Dom() + if sfpd_obj is None: + return default + sfpd_obj._calibration_type = 1 + + dom_temperature_raw = self._read_eeprom_specific_bytes( + (offset + SFP_TEMPE_OFFSET), SFP_TEMPE_WIDTH) + if dom_temperature_raw is not None: + dom_temperature_data = sfpd_obj.parse_temperature( + dom_temperature_raw, 0) + temp = self._convert_string_to_num( + dom_temperature_data['data']['Temperature']['value']) + return temp + + return default + + def get_voltage(self): + """ + Retrieves the supply voltage of this SFP + Returns: + An integer number of supply voltage in mV + """ + default = 0.0 + + if not self.dom_supported: + return default + + if self.sfp_type == QSFP_TYPE: + offset = 0 + sfpd_obj = sff8436Dom() + if sfpd_obj is None: + return default + + if self.dom_volt_supported: + dom_voltage_raw = self._read_eeprom_specific_bytes( + (offset + QSFP_VOLT_OFFSET), QSFP_VOLT_WIDTH) + if dom_voltage_raw is not None: + dom_voltage_data = sfpd_obj.parse_voltage( + dom_voltage_raw, 0) + voltage = self._convert_string_to_num( + dom_voltage_data['data']['Vcc']['value']) + return voltage + + if self.sfp_type == QSFP_DD_TYPE: + offset = 128 + + sfpd_obj = qsfp_dd_Dom() + if sfpd_obj is None: + return default + + if self.dom_volt_supported: + dom_voltage_raw = self._read_eeprom_specific_bytes( + (offset + QSFP_DD_VOLT_OFFSET), QSFP_DD_VOLT_WIDTH) + if dom_voltage_raw is not None: + dom_voltage_data = sfpd_obj.parse_voltage( + dom_voltage_raw, 0) + voltage = self._convert_string_to_num( + dom_voltage_data['data']['Vcc']['value']) + return voltage + + else: + offset = 256 + + sfpd_obj = sff8472Dom() + if sfpd_obj is None: + return default + + sfpd_obj._calibration_type = self.calibration + + dom_voltage_raw = self._read_eeprom_specific_bytes( + (offset + SFP_VOLT_OFFSET), SFP_VOLT_WIDTH) + if dom_voltage_raw is not None: + dom_voltage_data = sfpd_obj.parse_voltage(dom_voltage_raw, 0) + voltage = self._convert_string_to_num( + dom_voltage_data['data']['Vcc']['value']) + return voltage + + return default + + def get_tx_bias(self): + """ + Retrieves the TX bias current of this SFP + Returns: + A list of four integer numbers, representing TX bias in mA + for channel 0 to channel 4. + Ex. ['110.09', '111.12', '108.21', '112.09'] + """ + tx_bias_list = [] + if self.sfp_type == QSFP_TYPE: + offset = 0 + default = [0.0] * 4 + sfpd_obj = sff8436Dom() + if sfpd_obj is None: + return default + + dom_channel_monitor_raw = self._read_eeprom_specific_bytes( + (offset + QSFP_CHANNL_MON_OFFSET), QSFP_CHANNL_MON_WITH_TX_POWER_WIDTH) + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = sfpd_obj.parse_channel_monitor_params_with_tx_power( + dom_channel_monitor_raw, 0) + tx_bias_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TX1Bias']['value'])) + tx_bias_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TX2Bias']['value'])) + tx_bias_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TX3Bias']['value'])) + tx_bias_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TX4Bias']['value'])) + else: + return default + + elif self.sfp_type == QSFP_DD_TYPE: + default = [0.0] * 8 + # page 11h + if self.dom_rx_tx_power_bias_supported: + offset = 128 + sfpd_obj = qsfp_dd_Dom() + if sfpd_obj is None: + return default + + if dom_tx_bias_power_supported: + dom_tx_bias_raw = self._read_eeprom_specific_bytes( + (offset + QSFP_DD_TX_BIAS_OFFSET), QSFP_DD_TX_BIAS_WIDTH) + if dom_tx_bias_raw is not None: + dom_tx_bias_data = sfpd_obj.parse_dom_tx_bias( + dom_tx_bias_raw, 0) + tx_bias_list.append(self._convert_string_to_num( + dom_tx_bias_data['data']['TX1Bias']['value'])) + tx_bias_list.append(self._convert_string_to_num( + dom_tx_bias_data['data']['TX2Bias']['value'])) + tx_bias_list.append(self._convert_string_to_num( + dom_tx_bias_data['data']['TX3Bias']['value'])) + tx_bias_list.append(self._convert_string_to_num( + dom_tx_bias_data['data']['TX4Bias']['value'])) + tx_bias_list.append(self._convert_string_to_num( + dom_tx_bias_data['data']['TX5Bias']['value'])) + tx_bias_list.append(self._convert_string_to_num( + dom_tx_bias_data['data']['TX6Bias']['value'])) + tx_bias_list.append(self._convert_string_to_num( + dom_tx_bias_data['data']['TX7Bias']['value'])) + tx_bias_list.append(self._convert_string_to_num( + dom_tx_bias_data['data']['TX8Bias']['value'])) + else: + return default + else: + return default + + else: + offset = 256 + default = [0.0] + sfpd_obj = sff8472Dom() + if sfpd_obj is None: + return default + sfpd_obj._calibration_type = self.calibration + + if self.dom_supported: + dom_channel_monitor_raw = self._read_eeprom_specific_bytes( + (offset + SFP_CHANNL_MON_OFFSET), SFP_CHANNL_MON_WIDTH) + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = sfpd_obj.parse_channel_monitor_params( + dom_channel_monitor_raw, 0) + tx_bias_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TXBias']['value'])) + else: + return default + else: + return default + + return tx_bias_list + + def get_rx_power(self): + """ + Retrieves the received optical power for this SFP + Returns: + A list of four integer numbers, representing received optical + power in mW for channel 0 to channel 4. + Ex. ['1.77', '1.71', '1.68', '1.70'] + """ + rx_power_list = [] + if self.sfp_type == OSFP_TYPE: + # OSFP not supported on our platform yet. + return None + + elif self.sfp_type == QSFP_TYPE: + offset = 0 + default = [0.0] * 4 + sfpd_obj = sff8436Dom() + if sfpd_obj is None: + return default + + if self.dom_rx_power_supported: + dom_channel_monitor_raw = self._read_eeprom_specific_bytes( + (offset + QSFP_CHANNL_MON_OFFSET), QSFP_CHANNL_MON_WITH_TX_POWER_WIDTH) + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = sfpd_obj.parse_channel_monitor_params_with_tx_power( + dom_channel_monitor_raw, 0) + rx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['RX1Power']['value'])) + rx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['RX2Power']['value'])) + rx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['RX3Power']['value'])) + rx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['RX4Power']['value'])) + else: + return default + else: + return default + + elif self.sfp_type == QSFP_DD_TYPE: + default = [0.0] * 8 + # page 11 + if self.dom_rx_tx_power_bias_supported: + offset = 128 + sfpd_obj = qsfp_dd_Dom() + if sfpd_obj is None: + return default + + if self.dom_rx_power_supported: + dom_rx_power_raw = self._read_eeprom_specific_bytes( + (offset + QSFP_DD_RX_POWER_OFFSET), QSFP_DD_RX_POWER_WIDTH) + if dom_rx_power_raw is not None: + dom_rx_power_data = sfpd_obj.parse_dom_rx_power( + dom_rx_power_raw, 0) + rx_power_list.append(self._convert_string_to_num( + dom_rx_power_data['data']['RX1Power']['value'])) + rx_power_list.append(self._convert_string_to_num( + dom_rx_power_data['data']['RX2Power']['value'])) + rx_power_list.append(self._convert_string_to_num( + dom_rx_power_data['data']['RX3Power']['value'])) + rx_power_list.append(self._convert_string_to_num( + dom_rx_power_data['data']['RX4Power']['value'])) + rx_power_list.append(self._convert_string_to_num( + dom_rx_power_data['data']['RX5Power']['value'])) + rx_power_list.append(self._convert_string_to_num( + dom_rx_power_data['data']['RX6Power']['value'])) + rx_power_list.append(self._convert_string_to_num( + dom_rx_power_data['data']['RX7Power']['value'])) + rx_power_list.append(self._convert_string_to_num( + dom_rx_power_data['data']['RX8Power']['value'])) + else: + return default + else: + return default + + else: + offset = 256 + default = [0.0] + sfpd_obj = sff8472Dom() + if sfpd_obj is None: + return default + + if self.dom_supported: + sfpd_obj._calibration_type = self.calibration + + dom_channel_monitor_raw = self._read_eeprom_specific_bytes( + (offset + SFP_CHANNL_MON_OFFSET), SFP_CHANNL_MON_WIDTH) + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = sfpd_obj.parse_channel_monitor_params( + dom_channel_monitor_raw, 0) + rx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['RXPower']['value'])) + else: + return default + else: + return default + return rx_power_list + + def get_tx_power(self): + """ + Retrieves the TX power of this SFP + Returns: + A list of four integer numbers, representing TX power in mW + for channel 0 to channel 4. + Ex. ['1.86', '1.86', '1.86', '1.86'] + """ + tx_power_list = [] + if self.sfp_type == OSFP_TYPE: + # OSFP not supported on our platform yet. + return tx_power_list + + elif self.sfp_type == QSFP_TYPE: + offset = 0 + default = [0.0] * 4 + + sfpd_obj = sff8436Dom() + if sfpd_obj is None: + return tx_power_list + + if self.dom_tx_power_supported: + dom_channel_monitor_raw = self._read_eeprom_specific_bytes( + (offset + QSFP_CHANNL_MON_OFFSET), + QSFP_CHANNL_MON_WITH_TX_POWER_WIDTH) + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = sfpd_obj.parse_channel_monitor_params_with_tx_power( + dom_channel_monitor_raw, 0) + tx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TX1Power']['value'])) + tx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TX2Power']['value'])) + tx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TX3Power']['value'])) + tx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TX4Power']['value'])) + else: + return default + else: + return default + + elif self.sfp_type == QSFP_DD_TYPE: + default = [0.0] * 8 + + # page 11 + if self.dom_rx_tx_power_bias_supported: + offset = 128 + sfpd_obj = qsfp_dd_Dom() + if sfpd_obj is None: + return default + + if self.dom_tx_power_supported: + dom_tx_power_raw = self._read_eeprom_specific_bytes( + (offset + QSFP_DD_TX_POWER_OFFSET), + QSFP_DD_TX_POWER_WIDTH) + if dom_tx_power_raw is not None: + dom_tx_power_data = sfpd_obj.parse_dom_tx_power( + dom_tx_power_raw, 0) + tx_power_list.append(self._convert_string_to_num( + dom_tx_power_data['data']['TX1Power']['value'])) + tx_power_list.append(self._convert_string_to_num( + dom_tx_power_data['data']['TX2Power']['value'])) + tx_power_list.append(self._convert_string_to_num( + dom_tx_power_data['data']['TX3Power']['value'])) + tx_power_list.append(self._convert_string_to_num( + dom_tx_power_data['data']['TX4Power']['value'])) + tx_power_list.append(self._convert_string_to_num( + dom_tx_power_data['data']['TX5Power']['value'])) + tx_power_list.append(self._convert_string_to_num( + dom_tx_power_data['data']['TX6Power']['value'])) + tx_power_list.append(self._convert_string_to_num( + dom_tx_power_data['data']['TX7Power']['value'])) + tx_power_list.append(self._convert_string_to_num( + dom_tx_power_data['data']['TX8Power']['value'])) + else: + return default + else: + return default + + else: + offset = 256 + default = [0.0] + sfpd_obj = sff8472Dom() + if sfpd_obj is None: + return default + + if self.dom_supported: + sfpd_obj._calibration_type = self.calibration + + dom_channel_monitor_raw = self._read_eeprom_specific_bytes( + (offset + SFP_CHANNL_MON_OFFSET), SFP_CHANNL_MON_WIDTH) + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = sfpd_obj.parse_channel_monitor_params( + dom_channel_monitor_raw, 0) + tx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TXPower']['value'])) + else: + return default + else: + return default + return tx_power_list + + def reset(self): + """ + Reset SFP and return all user module settings to their default srate. + Returns: + A boolean, True if successful, False if not + """ + # Check for invalid port_num + + if self._port_num > 32: + return False # SFP doesn't support this feature + else: + if not self.get_presence(): + return False + + if self._port_num <= self.CPLD2_PORT_END: + reset_path = "{}{}{}".format(CPLD2_I2C_PATH, 'module_reset_', self._port_num) + else: + reset_path = "{}{}{}".format(CPLD3_I2C_PATH, 'module_reset_', self._port_num) + + ret = self.__write_txt_file(reset_path, 1) #sysfs 1: enable reset + if ret is not True: + return ret + + time.sleep(0.2) + ret = self.__write_txt_file(reset_path, 0) #sysfs 0: disable reset + time.sleep(0.2) + + return ret + + def tx_disable(self, tx_disable): + """ + Disable SFP TX for all channels + Args: + tx_disable : A Boolean, True to enable tx_disable mode, False to disable + tx_disable mode. + Returns: + A boolean, True if tx_disable is set successfully, False if not + """ + if self.sfp_type == QSFP_TYPE: + sysfsfile_eeprom = None + try: + tx_disable_value = 0xf if tx_disable else 0x0 + # Write to eeprom + sysfsfile_eeprom = open(self._eeprom_path, "r+b") + sysfsfile_eeprom.seek(QSFP_CONTROL_OFFSET) + sysfsfile_eeprom.write(struct.pack('B', tx_disable_value)) + except IOError: + return False + finally: + if sysfsfile_eeprom is not None: + sysfsfile_eeprom.close() + time.sleep(0.01) + return True + return False + + def tx_disable_channel(self, channel, disable): + """ + Sets the tx_disable for specified SFP channels + Args: + channel : A hex of 4 bits (bit 0 to bit 3) which represent channel 0 to 3, + e.g. 0x5 for channel 0 and channel 2. + disable : A boolean, True to disable TX channels specified in channel, + False to enable + Returns: + A boolean, True if successful, False if not + """ + if self.sfp_type == QSFP_TYPE: + sysfsfile_eeprom = None + try: + current_state = self.get_tx_disable_channel() + tx_disable_value = (current_state | channel) if \ + disable else (current_state & (~channel)) + + # Write to eeprom + sysfsfile_eeprom = open(self._eeprom_path, "r+b") + sysfsfile_eeprom.seek(QSFP_CONTROL_OFFSET) + sysfsfile_eeprom.write(struct.pack('B', tx_disable_value)) + except IOError: + return False + finally: + if sysfsfile_eeprom is not None: + sysfsfile_eeprom.close() + time.sleep(0.01) + return True + return False + + def set_lpmode(self, lpmode): + """ + Sets the lpmode (low power mode) of SFP + Args: + lpmode: A Boolean, True to enable lpmode, False to disable it + Note : lpmode can be overridden by set_power_override + Returns: + A boolean, True if lpmode is set successfully, False if not + """ + if self._port_num > 32: + return False # SFP doesn't support this feature + else: + if not self.get_presence(): + return False + + if lpmode is True: + self.set_power_override(True, True) + else: + self.set_power_override(True, False) + + return True + + def set_power_override(self, power_override, power_set): + """ + Sets SFP power level using power_override and power_set + Args: + power_override : + A Boolean, True to override set_lpmode and use power_set + to control SFP power, False to disable SFP power control + through power_override/power_set and use set_lpmode + to control SFP power. + power_set : + Only valid when power_override is True. + A Boolean, True to set SFP to low power mode, False to set + SFP to high power mode. + Returns: + A boolean, True if power-override and power_set are set successfully, + False if not + """ + if self._port_num > 32: + return False # SFP doesn't support this feature + else: + if not self.get_presence(): + return False + try: + power_override_bit = (1 << 0) if power_override else 0 + power_set_bit = (1 << 1) if power_set else (1 << 3) + + buffer = create_string_buffer(1) + if sys.version_info[0] >= 3: + buffer[0] = (power_override_bit | power_set_bit) + else: + buffer[0] = chr(power_override_bit | power_set_bit) + # Write to eeprom + port_to_i2c_mapping = SFP_I2C_START + self._index + port_eeprom_path = I2C_EEPROM_PATH.format(port_to_i2c_mapping) + with open(port_eeprom_path, "r+b") as fd: + fd.seek(QSFP_POWEROVERRIDE_OFFSET) + fd.write(buffer[0]) + time.sleep(0.01) + except Exception as e: + print ('Error: unable to open file: ', str(e)) + return False + return True + + ############################################################## + ###################### Device methods ######################## + ############################################################## + + def get_name(self): + """ + Retrieves the name of the device + Returns: + string: The name of the device + """ + sfputil_helper = SfpUtilHelper() + sfputil_helper.read_porttab_mappings( + self.__get_path_to_port_config_file()) + name = sfputil_helper.logical[self.index] or "Unknown" + return name + + def get_presence(self): + """ + Retrieves the presence of the device + Returns: + bool: True if device is present, False if not + """ + if self._port_num <= 16: + present_path = "{}{}{}".format(CPLD2_I2C_PATH, '/module_present_', self._port_num) + else: + present_path = "{}{}{}".format(CPLD3_I2C_PATH, '/module_present_', self._port_num) + + val=self._api_helper.read_txt_file(present_path) + if val is not None: + return int(val, 10)==1 + else: + return False + + + def get_model(self): + """ + Retrieves the model number (or part number) of the device + Returns: + string: Model/part number of device + """ + transceiver_dom_info_dict = self.get_transceiver_info() + return transceiver_dom_info_dict.get("model", "N/A") + + def get_serial(self): + """ + Retrieves the serial number of the device + Returns: + string: Serial number of device + """ + transceiver_dom_info_dict = self.get_transceiver_info() + return transceiver_dom_info_dict.get("serial", "N/A") + + def get_status(self): + """ + Retrieves the operational status of the device + Returns: + A boolean value, True if device is operating properly, False if not + """ + return self.get_presence() and not self.get_reset_status() + + def get_position_in_parent(self): + """ + Returns: + Temp return 0 + """ + return 0 + + def is_replaceable(self): + """ + Retrieves if replaceable + Returns: + A boolean value, True if replaceable + """ + return True diff --git a/device/accton/x86_64-accton_as9726_32d-r0/sonic_platform/thermal.py b/device/accton/x86_64-accton_as9726_32d-r0/sonic_platform/thermal.py new file mode 100644 index 000000000000..1a811719deaf --- /dev/null +++ b/device/accton/x86_64-accton_as9726_32d-r0/sonic_platform/thermal.py @@ -0,0 +1,151 @@ +############################################################################# +# Accton +# +# Thermal contains an implementation of SONiC Platform Base API and +# provides the thermal device status which are available in the platform +# +############################################################################# + +import os +import os.path +import glob + +try: + from sonic_platform_base.thermal_base import ThermalBase +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class Thermal(ThermalBase): + """Platform-specific Thermal class""" + + THERMAL_NAME_LIST = [] + SYSFS_PATH = "/sys/bus/i2c/devices" + + def __init__(self, thermal_index=0): + self.THERMAL_NAME_LIST = [] + self.SYSFS_PATH = "/sys/bus/i2c/devices" + self.index = thermal_index + # Add thermal name + self.THERMAL_NAME_LIST.append("Temp sensor 1") + self.THERMAL_NAME_LIST.append("Temp sensor 2") + self.THERMAL_NAME_LIST.append("Temp sensor 3") + self.THERMAL_NAME_LIST.append("Temp sensor 4") + self.THERMAL_NAME_LIST.append("Temp sensor 5") + self.THERMAL_NAME_LIST.append("Temp sensor 6") + + # Set hwmon path + i2c_path = { + 0: "15-0048/hwmon/hwmon*/", + 1: "15-0049/hwmon/hwmon*/", + 2: "15-004a/hwmon/hwmon*/", + 3: "15-004b/hwmon/hwmon*/", + 4: "15-004c/hwmon/hwmon*/", + 5: "15-004f/hwmon/hwmon*/" + }.get(self.index, None) + + self.hwmon_path = "{}/{}".format(self.SYSFS_PATH, i2c_path) + self.ss_key = self.THERMAL_NAME_LIST[self.index] + self.ss_index = 1 + + def __read_txt_file(self, file_path): + for filename in glob.glob(file_path): + try: + with open(filename, 'r') as fd: + data =fd.readline().rstrip() + return data + except IOError as e: + pass + + return None + + def __get_temp(self, temp_file): + temp_file_path = os.path.join(self.hwmon_path, temp_file) + raw_temp = self.__read_txt_file(temp_file_path) + if raw_temp is not None: + return float(raw_temp)/1000 + else: + return 0 + + def __set_threshold(self, file_name, temperature): + temp_file_path = os.path.join(self.hwmon_path, file_name) + for filename in glob.glob(temp_file_path): + try: + with open(filename, 'w') as fd: + fd.write(str(temperature)) + return True + except IOError as e: + print("IOError") + + + def get_temperature(self): + """ + Retrieves current temperature reading from thermal + Returns: + A float number of current temperature in Celsius up to nearest thousandth + of one degree Celsius, e.g. 30.125 + """ + temp_file = "temp{}_input".format(self.ss_index) + return self.__get_temp(temp_file) + + def get_high_threshold(self): + """ + Retrieves the high threshold temperature of thermal + Returns: + A float number, the high threshold temperature of thermal in Celsius + up to nearest thousandth of one degree Celsius, e.g. 30.125 + """ + temp_file = "temp{}_max".format(self.ss_index) + return self.__get_temp(temp_file) + + def set_high_threshold(self, temperature): + """ + Sets the high threshold temperature of thermal + Args : + temperature: A float number up to nearest thousandth of one degree Celsius, + e.g. 30.125 + Returns: + A boolean, True if threshold is set successfully, False if not + """ + temp_file = "temp{}_max".format(self.ss_index) + temperature = temperature *1000 + self.__set_threshold(temp_file, temperature) + + return True + + def get_name(self): + """ + Retrieves the name of the thermal device + Returns: + string: The name of the thermal device + """ + return self.THERMAL_NAME_LIST[self.index] + + def get_presence(self): + """ + Retrieves the presence of the Thermal + Returns: + bool: True if Thermal is present, False if not + """ + temp_file = "temp{}_input".format(self.ss_index) + temp_file_path = os.path.join(self.hwmon_path, temp_file) + raw_txt = self.__read_txt_file(temp_file_path) + if raw_txt is not None: + return True + else: + return False + + def get_status(self): + """ + Retrieves the operational status of the device + Returns: + A boolean value, True if device is operating properly, False if not + """ + + file_str = "temp{}_input".format(self.ss_index) + file_path = os.path.join(self.hwmon_path, file_str) + raw_txt = self.__read_txt_file(file_path) + if raw_txt is None: + return False + else: + return int(raw_txt) != 0 diff --git a/device/arista/x86_64-arista_7050_qx32/Arista-7050-Q16S64/td2-a7050-qx32-16x40G+32x10G+8x40G.config.bcm b/device/arista/x86_64-arista_7050_qx32/Arista-7050-Q16S64/td2-a7050-qx32-16x40G+32x10G+8x40G.config.bcm index d3ee2d5e3b0a..1686cb0bcaea 100644 --- a/device/arista/x86_64-arista_7050_qx32/Arista-7050-Q16S64/td2-a7050-qx32-16x40G+32x10G+8x40G.config.bcm +++ b/device/arista/x86_64-arista_7050_qx32/Arista-7050-Q16S64/td2-a7050-qx32-16x40G+32x10G+8x40G.config.bcm @@ -24,6 +24,12 @@ ipv6_lpm_128b_enable=1 l2_mem_entries=32768 l3_mem_entries=16384 +# disables bcmALPMDH (ALPM distributed hitbit) thread. This thread is purely for debug purpose +l3_alpm_hit_skip=1 + +# Disable Counting ACL Drop towards interface RX_DRP counter +sai_adjust_acl_drop_in_rx_drop=1 + # From old config file os=unix higig2_hdr_mode=1 diff --git a/device/arista/x86_64-arista_7050_qx32/Arista-7050-QX32/BALANCED b/device/arista/x86_64-arista_7050_qx32/Arista-7050-QX32/BALANCED new file mode 120000 index 000000000000..808c3d86217f --- /dev/null +++ b/device/arista/x86_64-arista_7050_qx32/Arista-7050-QX32/BALANCED @@ -0,0 +1 @@ +../../../common/profiles/td2/gen/BALANCED \ No newline at end of file diff --git a/device/arista/x86_64-arista_7050_qx32/Arista-7050-QX32/RDMA-CENTRIC b/device/arista/x86_64-arista_7050_qx32/Arista-7050-QX32/RDMA-CENTRIC new file mode 120000 index 000000000000..8bcc02cca148 --- /dev/null +++ b/device/arista/x86_64-arista_7050_qx32/Arista-7050-QX32/RDMA-CENTRIC @@ -0,0 +1 @@ +../../../common/profiles/td2/gen/RDMA-CENTRIC \ No newline at end of file diff --git a/device/arista/x86_64-arista_7050_qx32/Arista-7050-QX32/TCP-CENTRIC b/device/arista/x86_64-arista_7050_qx32/Arista-7050-QX32/TCP-CENTRIC new file mode 120000 index 000000000000..7ac6cc7160ac --- /dev/null +++ b/device/arista/x86_64-arista_7050_qx32/Arista-7050-QX32/TCP-CENTRIC @@ -0,0 +1 @@ +../../../common/profiles/td2/gen/TCP-CENTRIC \ No newline at end of file diff --git a/device/arista/x86_64-arista_7050_qx32/Arista-7050-QX32/buffer_ports_t0.j2 b/device/arista/x86_64-arista_7050_qx32/Arista-7050-QX32/buffer_ports_t0.j2 new file mode 100644 index 000000000000..48bbf2fc121e --- /dev/null +++ b/device/arista/x86_64-arista_7050_qx32/Arista-7050-QX32/buffer_ports_t0.j2 @@ -0,0 +1,6 @@ +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {% for port_idx in range(0,32) %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} + {% endfor %} +{%- endmacro %} diff --git a/device/arista/x86_64-arista_7050_qx32/Arista-7050-QX32/buffer_ports_t1.j2 b/device/arista/x86_64-arista_7050_qx32/Arista-7050-QX32/buffer_ports_t1.j2 new file mode 100644 index 000000000000..48bbf2fc121e --- /dev/null +++ b/device/arista/x86_64-arista_7050_qx32/Arista-7050-QX32/buffer_ports_t1.j2 @@ -0,0 +1,6 @@ +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {% for port_idx in range(0,32) %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} + {% endfor %} +{%- endmacro %} diff --git a/device/arista/x86_64-arista_7050_qx32/Arista-7050-QX32/buffers_defaults_t0.j2 b/device/arista/x86_64-arista_7050_qx32/Arista-7050-QX32/buffers_defaults_t0.j2 deleted file mode 100644 index 38e34eb571e8..000000000000 --- a/device/arista/x86_64-arista_7050_qx32/Arista-7050-QX32/buffers_defaults_t0.j2 +++ /dev/null @@ -1,45 +0,0 @@ -{%- set default_cable = '300m' %} - -{%- macro generate_port_lists(PORT_ALL) %} - {# Generate list of ports #} - {% for port_idx in range(0,32) %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} - {% endfor %} -{%- endmacro %} - -{%- macro generate_buffer_pool_and_profiles() %} - "BUFFER_POOL": { - "ingress_lossless_pool": { - "size": "12766208", - "type": "ingress", - "mode": "dynamic" - }, - "egress_lossless_pool": { - "size": "12766208", - "type": "egress", - "mode": "static" - }, - "egress_lossy_pool": { - "size": "7326924", - "type": "egress", - "mode": "dynamic" - } - }, - "BUFFER_PROFILE": { - "ingress_lossy_profile": { - "pool":"[BUFFER_POOL|ingress_lossless_pool]", - "size":"0", - "dynamic_th":"3" - }, - "egress_lossless_profile": { - "pool":"[BUFFER_POOL|egress_lossless_pool]", - "size":"0", - "static_th":"12766208" - }, - "egress_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"1518", - "dynamic_th":"3" - } - }, -{%- endmacro %} diff --git a/device/arista/x86_64-arista_7050_qx32/Arista-7050-QX32/buffers_defaults_t0.j2 b/device/arista/x86_64-arista_7050_qx32/Arista-7050-QX32/buffers_defaults_t0.j2 new file mode 120000 index 000000000000..9524e6a476ac --- /dev/null +++ b/device/arista/x86_64-arista_7050_qx32/Arista-7050-QX32/buffers_defaults_t0.j2 @@ -0,0 +1 @@ +BALANCED/buffers_defaults_t0.j2 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7050_qx32/Arista-7050-QX32/buffers_defaults_t1.j2 b/device/arista/x86_64-arista_7050_qx32/Arista-7050-QX32/buffers_defaults_t1.j2 deleted file mode 100644 index 38e34eb571e8..000000000000 --- a/device/arista/x86_64-arista_7050_qx32/Arista-7050-QX32/buffers_defaults_t1.j2 +++ /dev/null @@ -1,45 +0,0 @@ -{%- set default_cable = '300m' %} - -{%- macro generate_port_lists(PORT_ALL) %} - {# Generate list of ports #} - {% for port_idx in range(0,32) %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} - {% endfor %} -{%- endmacro %} - -{%- macro generate_buffer_pool_and_profiles() %} - "BUFFER_POOL": { - "ingress_lossless_pool": { - "size": "12766208", - "type": "ingress", - "mode": "dynamic" - }, - "egress_lossless_pool": { - "size": "12766208", - "type": "egress", - "mode": "static" - }, - "egress_lossy_pool": { - "size": "7326924", - "type": "egress", - "mode": "dynamic" - } - }, - "BUFFER_PROFILE": { - "ingress_lossy_profile": { - "pool":"[BUFFER_POOL|ingress_lossless_pool]", - "size":"0", - "dynamic_th":"3" - }, - "egress_lossless_profile": { - "pool":"[BUFFER_POOL|egress_lossless_pool]", - "size":"0", - "static_th":"12766208" - }, - "egress_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"1518", - "dynamic_th":"3" - } - }, -{%- endmacro %} diff --git a/device/arista/x86_64-arista_7050_qx32/Arista-7050-QX32/buffers_defaults_t1.j2 b/device/arista/x86_64-arista_7050_qx32/Arista-7050-QX32/buffers_defaults_t1.j2 new file mode 120000 index 000000000000..c25cc95d6d57 --- /dev/null +++ b/device/arista/x86_64-arista_7050_qx32/Arista-7050-QX32/buffers_defaults_t1.j2 @@ -0,0 +1 @@ +BALANCED/buffers_defaults_t1.j2 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7050_qx32/Arista-7050-QX32/pg_profile_lookup.ini b/device/arista/x86_64-arista_7050_qx32/Arista-7050-QX32/pg_profile_lookup.ini deleted file mode 100644 index d8190e4893de..000000000000 --- a/device/arista/x86_64-arista_7050_qx32/Arista-7050-QX32/pg_profile_lookup.ini +++ /dev/null @@ -1,11 +0,0 @@ -# PG lossless profiles. -# speed cable size xon xoff threshold xon_offset - 40000 5m 46384 18432 45136 -3 2496 - 50000 5m 46592 18432 45344 -3 2496 - 100000 5m 48464 18432 47216 -3 2496 - 40000 40m 48464 18432 47216 -3 2496 - 50000 40m 49296 18432 48048 -3 2496 - 100000 40m 53872 18432 52624 -3 2496 - 40000 300m 64064 18432 62816 -3 2496 - 50000 300m 68848 18432 67600 -3 2496 - 100000 300m 92976 18432 91728 -3 2496 diff --git a/device/arista/x86_64-arista_7050_qx32/Arista-7050-QX32/pg_profile_lookup.ini b/device/arista/x86_64-arista_7050_qx32/Arista-7050-QX32/pg_profile_lookup.ini new file mode 120000 index 000000000000..297cddb2d223 --- /dev/null +++ b/device/arista/x86_64-arista_7050_qx32/Arista-7050-QX32/pg_profile_lookup.ini @@ -0,0 +1 @@ +BALANCED/pg_profile_lookup.ini \ No newline at end of file diff --git a/device/arista/x86_64-arista_7050_qx32/Arista-7050-QX32/qos.json.j2 b/device/arista/x86_64-arista_7050_qx32/Arista-7050-QX32/qos.json.j2 deleted file mode 100644 index 3e548325ea30..000000000000 --- a/device/arista/x86_64-arista_7050_qx32/Arista-7050-QX32/qos.json.j2 +++ /dev/null @@ -1 +0,0 @@ -{%- include 'qos_config.j2' %} diff --git a/device/arista/x86_64-arista_7050_qx32/Arista-7050-QX32/qos.json.j2 b/device/arista/x86_64-arista_7050_qx32/Arista-7050-QX32/qos.json.j2 new file mode 120000 index 000000000000..aef6b6765cf2 --- /dev/null +++ b/device/arista/x86_64-arista_7050_qx32/Arista-7050-QX32/qos.json.j2 @@ -0,0 +1 @@ +BALANCED/qos.json.j2 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7050_qx32/Arista-7050-QX32/td2-a7050-qx32-32x40G.config.bcm b/device/arista/x86_64-arista_7050_qx32/Arista-7050-QX32/td2-a7050-qx32-32x40G.config.bcm index 7537b36411f7..dc959c02878c 100644 --- a/device/arista/x86_64-arista_7050_qx32/Arista-7050-QX32/td2-a7050-qx32-32x40G.config.bcm +++ b/device/arista/x86_64-arista_7050_qx32/Arista-7050-QX32/td2-a7050-qx32-32x40G.config.bcm @@ -24,6 +24,12 @@ ipv6_lpm_128b_enable=1 l2_mem_entries=32768 l3_mem_entries=16384 +# disables bcmALPMDH (ALPM distributed hitbit) thread. This thread is purely for debug purpose +l3_alpm_hit_skip=1 + +# Disable Counting ACL Drop towards interface RX_DRP counter +sai_adjust_acl_drop_in_rx_drop=1 + # From old config file os=unix higig2_hdr_mode=1 diff --git a/device/arista/x86_64-arista_7050_qx32s/Arista-7050-QX-32S b/device/arista/x86_64-arista_7050_qx32s/Arista-7050-QX-32S new file mode 120000 index 000000000000..16c96007892e --- /dev/null +++ b/device/arista/x86_64-arista_7050_qx32s/Arista-7050-QX-32S @@ -0,0 +1 @@ +Arista-7050QX-32S-S4Q31 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7050_qx32s/Arista-7050-QX-32S/buffers_defaults_t0.j2 b/device/arista/x86_64-arista_7050_qx32s/Arista-7050-QX-32S/buffers_defaults_t0.j2 deleted file mode 100644 index 38e34eb571e8..000000000000 --- a/device/arista/x86_64-arista_7050_qx32s/Arista-7050-QX-32S/buffers_defaults_t0.j2 +++ /dev/null @@ -1,45 +0,0 @@ -{%- set default_cable = '300m' %} - -{%- macro generate_port_lists(PORT_ALL) %} - {# Generate list of ports #} - {% for port_idx in range(0,32) %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} - {% endfor %} -{%- endmacro %} - -{%- macro generate_buffer_pool_and_profiles() %} - "BUFFER_POOL": { - "ingress_lossless_pool": { - "size": "12766208", - "type": "ingress", - "mode": "dynamic" - }, - "egress_lossless_pool": { - "size": "12766208", - "type": "egress", - "mode": "static" - }, - "egress_lossy_pool": { - "size": "7326924", - "type": "egress", - "mode": "dynamic" - } - }, - "BUFFER_PROFILE": { - "ingress_lossy_profile": { - "pool":"[BUFFER_POOL|ingress_lossless_pool]", - "size":"0", - "dynamic_th":"3" - }, - "egress_lossless_profile": { - "pool":"[BUFFER_POOL|egress_lossless_pool]", - "size":"0", - "static_th":"12766208" - }, - "egress_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"1518", - "dynamic_th":"3" - } - }, -{%- endmacro %} diff --git a/device/arista/x86_64-arista_7050_qx32s/Arista-7050-QX-32S/buffers_defaults_t1.j2 b/device/arista/x86_64-arista_7050_qx32s/Arista-7050-QX-32S/buffers_defaults_t1.j2 deleted file mode 100644 index 38e34eb571e8..000000000000 --- a/device/arista/x86_64-arista_7050_qx32s/Arista-7050-QX-32S/buffers_defaults_t1.j2 +++ /dev/null @@ -1,45 +0,0 @@ -{%- set default_cable = '300m' %} - -{%- macro generate_port_lists(PORT_ALL) %} - {# Generate list of ports #} - {% for port_idx in range(0,32) %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} - {% endfor %} -{%- endmacro %} - -{%- macro generate_buffer_pool_and_profiles() %} - "BUFFER_POOL": { - "ingress_lossless_pool": { - "size": "12766208", - "type": "ingress", - "mode": "dynamic" - }, - "egress_lossless_pool": { - "size": "12766208", - "type": "egress", - "mode": "static" - }, - "egress_lossy_pool": { - "size": "7326924", - "type": "egress", - "mode": "dynamic" - } - }, - "BUFFER_PROFILE": { - "ingress_lossy_profile": { - "pool":"[BUFFER_POOL|ingress_lossless_pool]", - "size":"0", - "dynamic_th":"3" - }, - "egress_lossless_profile": { - "pool":"[BUFFER_POOL|egress_lossless_pool]", - "size":"0", - "static_th":"12766208" - }, - "egress_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"1518", - "dynamic_th":"3" - } - }, -{%- endmacro %} diff --git a/device/arista/x86_64-arista_7050_qx32s/Arista-7050-QX-32S/pg_profile_lookup.ini b/device/arista/x86_64-arista_7050_qx32s/Arista-7050-QX-32S/pg_profile_lookup.ini deleted file mode 100644 index d8190e4893de..000000000000 --- a/device/arista/x86_64-arista_7050_qx32s/Arista-7050-QX-32S/pg_profile_lookup.ini +++ /dev/null @@ -1,11 +0,0 @@ -# PG lossless profiles. -# speed cable size xon xoff threshold xon_offset - 40000 5m 46384 18432 45136 -3 2496 - 50000 5m 46592 18432 45344 -3 2496 - 100000 5m 48464 18432 47216 -3 2496 - 40000 40m 48464 18432 47216 -3 2496 - 50000 40m 49296 18432 48048 -3 2496 - 100000 40m 53872 18432 52624 -3 2496 - 40000 300m 64064 18432 62816 -3 2496 - 50000 300m 68848 18432 67600 -3 2496 - 100000 300m 92976 18432 91728 -3 2496 diff --git a/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX-32S-S4Q31/BALANCED b/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX-32S-S4Q31/BALANCED new file mode 120000 index 000000000000..808c3d86217f --- /dev/null +++ b/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX-32S-S4Q31/BALANCED @@ -0,0 +1 @@ +../../../common/profiles/td2/gen/BALANCED \ No newline at end of file diff --git a/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX-32S-S4Q31/RDMA-CENTRIC b/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX-32S-S4Q31/RDMA-CENTRIC new file mode 120000 index 000000000000..8bcc02cca148 --- /dev/null +++ b/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX-32S-S4Q31/RDMA-CENTRIC @@ -0,0 +1 @@ +../../../common/profiles/td2/gen/RDMA-CENTRIC \ No newline at end of file diff --git a/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX-32S-S4Q31/TCP-CENTRIC b/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX-32S-S4Q31/TCP-CENTRIC new file mode 120000 index 000000000000..7ac6cc7160ac --- /dev/null +++ b/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX-32S-S4Q31/TCP-CENTRIC @@ -0,0 +1 @@ +../../../common/profiles/td2/gen/TCP-CENTRIC \ No newline at end of file diff --git a/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX-32S-S4Q31/buffer_ports_t0.j2 b/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX-32S-S4Q31/buffer_ports_t0.j2 new file mode 100644 index 000000000000..102169973943 --- /dev/null +++ b/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX-32S-S4Q31/buffer_ports_t0.j2 @@ -0,0 +1,10 @@ +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {% if PORT_ALL.append("Ethernet0") %}{% endif %} + {% if PORT_ALL.append("Ethernet1") %}{% endif %} + {% if PORT_ALL.append("Ethernet2") %}{% endif %} + {% if PORT_ALL.append("Ethernet3") %}{% endif %} + {% for port_idx in range(1,32) %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} + {% endfor %} +{%- endmacro %} diff --git a/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX-32S-S4Q31/buffer_ports_t1.j2 b/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX-32S-S4Q31/buffer_ports_t1.j2 new file mode 100644 index 000000000000..102169973943 --- /dev/null +++ b/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX-32S-S4Q31/buffer_ports_t1.j2 @@ -0,0 +1,10 @@ +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {% if PORT_ALL.append("Ethernet0") %}{% endif %} + {% if PORT_ALL.append("Ethernet1") %}{% endif %} + {% if PORT_ALL.append("Ethernet2") %}{% endif %} + {% if PORT_ALL.append("Ethernet3") %}{% endif %} + {% for port_idx in range(1,32) %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} + {% endfor %} +{%- endmacro %} diff --git a/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX-32S-S4Q31/buffers_defaults_t0.j2 b/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX-32S-S4Q31/buffers_defaults_t0.j2 new file mode 120000 index 000000000000..9524e6a476ac --- /dev/null +++ b/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX-32S-S4Q31/buffers_defaults_t0.j2 @@ -0,0 +1 @@ +BALANCED/buffers_defaults_t0.j2 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX-32S-S4Q31/buffers_defaults_t1.j2 b/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX-32S-S4Q31/buffers_defaults_t1.j2 deleted file mode 100644 index f72e3eb06fb5..000000000000 --- a/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX-32S-S4Q31/buffers_defaults_t1.j2 +++ /dev/null @@ -1,49 +0,0 @@ -{%- set default_cable = '300m' %} - -{%- macro generate_port_lists(PORT_ALL) %} - {# Generate list of ports #} - {% if PORT_ALL.append("Ethernet0") %}{% endif %} - {% if PORT_ALL.append("Ethernet1") %}{% endif %} - {% if PORT_ALL.append("Ethernet2") %}{% endif %} - {% if PORT_ALL.append("Ethernet3") %}{% endif %} - {% for port_idx in range(1,32) %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} - {% endfor %} -{%- endmacro %} - -{%- macro generate_buffer_pool_and_profiles() %} - "BUFFER_POOL": { - "ingress_lossless_pool": { - "size": "12766208", - "type": "ingress", - "mode": "dynamic" - }, - "egress_lossless_pool": { - "size": "12766208", - "type": "egress", - "mode": "static" - }, - "egress_lossy_pool": { - "size": "8072396", - "type": "egress", - "mode": "dynamic" - } - }, - "BUFFER_PROFILE": { - "ingress_lossy_profile": { - "pool":"[BUFFER_POOL|ingress_lossless_pool]", - "size":"0", - "dynamic_th":"3" - }, - "egress_lossless_profile": { - "pool":"[BUFFER_POOL|egress_lossless_pool]", - "size":"0", - "static_th":"12766208" - }, - "egress_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"1518", - "dynamic_th":"3" - } - }, -{%- endmacro %} diff --git a/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX-32S-S4Q31/buffers_defaults_t1.j2 b/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX-32S-S4Q31/buffers_defaults_t1.j2 new file mode 120000 index 000000000000..c25cc95d6d57 --- /dev/null +++ b/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX-32S-S4Q31/buffers_defaults_t1.j2 @@ -0,0 +1 @@ +BALANCED/buffers_defaults_t1.j2 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX-32S-S4Q31/hwsku.json b/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX-32S-S4Q31/hwsku.json new file mode 100644 index 000000000000..a407ccd84052 --- /dev/null +++ b/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX-32S-S4Q31/hwsku.json @@ -0,0 +1,144 @@ +{ + "interfaces": { + "Ethernet0": { + "default_brkout_mode": "1x10G", + "port_type": "RJ45" + }, + "Ethernet1": { + "default_brkout_mode": "1x10G", + "port_type": "RJ45" + }, + "Ethernet2": { + "default_brkout_mode": "1x10G", + "port_type": "RJ45" + }, + "Ethernet3": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet4": { + "default_brkout_mode": "1x40G", + "port_type": "QSFP+" + }, + "Ethernet8": { + "default_brkout_mode": "1x40G", + "port_type": "QSFP+" + }, + "Ethernet12": { + "default_brkout_mode": "1x40G", + "port_type": "QSFP+" + }, + "Ethernet16": { + "default_brkout_mode": "1x40G", + "port_type": "QSFP+" + }, + "Ethernet20": { + "default_brkout_mode": "1x40G", + "port_type": "QSFP+" + }, + "Ethernet24": { + "default_brkout_mode": "1x40G", + "port_type": "QSFP+" + }, + "Ethernet28": { + "default_brkout_mode": "1x40G", + "port_type": "QSFP+" + }, + "Ethernet32": { + "default_brkout_mode": "1x40G", + "port_type": "QSFP+" + }, + "Ethernet36": { + "default_brkout_mode": "1x40G", + "port_type": "QSFP+" + }, + "Ethernet40": { + "default_brkout_mode": "1x40G", + "port_type": "QSFP+" + }, + "Ethernet44": { + "default_brkout_mode": "1x40G", + "port_type": "QSFP+" + }, + "Ethernet48": { + "default_brkout_mode": "1x40G", + "port_type": "QSFP+" + }, + "Ethernet52": { + "default_brkout_mode": "1x40G", + "port_type": "QSFP+" + }, + "Ethernet56": { + "default_brkout_mode": "1x40G", + "port_type": "QSFP+" + }, + "Ethernet60": { + "default_brkout_mode": "1x40G", + "port_type": "QSFP+" + }, + "Ethernet64": { + "default_brkout_mode": "1x40G", + "port_type": "QSFP+" + }, + "Ethernet68": { + "default_brkout_mode": "1x40G", + "port_type": "QSFP+" + }, + "Ethernet72": { + "default_brkout_mode": "1x40G", + "port_type": "QSFP+" + }, + "Ethernet76": { + "default_brkout_mode": "1x40G", + "port_type": "QSFP+" + }, + "Ethernet80": { + "default_brkout_mode": "1x40G", + "port_type": "QSFP+" + }, + "Ethernet84": { + "default_brkout_mode": "1x40G", + "port_type": "QSFP+" + }, + "Ethernet88": { + "default_brkout_mode": "1x40G", + "port_type": "QSFP+" + }, + "Ethernet92": { + "default_brkout_mode": "1x40G", + "port_type": "QSFP+" + }, + "Ethernet96": { + "default_brkout_mode": "1x40G", + "port_type": "QSFP+" + }, + "Ethernet100": { + "default_brkout_mode": "1x40G", + "port_type": "QSFP+" + }, + "Ethernet104": { + "default_brkout_mode": "1x40G", + "port_type": "QSFP+" + }, + "Ethernet108": { + "default_brkout_mode": "1x40G", + "port_type": "QSFP+" + }, + "Ethernet112": { + "default_brkout_mode": "1x40G", + "port_type": "QSFP+" + }, + "Ethernet116": { + "default_brkout_mode": "1x40G", + "port_type": "QSFP+" + }, + "Ethernet120": { + "default_brkout_mode": "1x40G", + "port_type": "QSFP+" + }, + "Ethernet124": { + "default_brkout_mode": "1x40G", + "port_type": "QSFP+" + } + } +} diff --git a/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX-32S-S4Q31/pg_profile_lookup.ini b/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX-32S-S4Q31/pg_profile_lookup.ini deleted file mode 100644 index f961fd33b138..000000000000 --- a/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX-32S-S4Q31/pg_profile_lookup.ini +++ /dev/null @@ -1,14 +0,0 @@ -# PG lossless profiles. -# speed cable size xon xoff threshold xon_offset - 10000 5m 41808 18432 40560 -4 2496 - 40000 5m 41808 18432 40560 -4 2496 - 50000 5m 41808 18432 40560 -4 2496 - 100000 5m 41808 18432 40560 -4 2496 - 10000 40m 41808 18432 40560 -4 2496 - 40000 40m 41808 18432 40560 -4 2496 - 50000 40m 41808 18432 40560 -4 2496 - 100000 40m 41808 18432 40560 -4 2496 - 10000 300m 41808 18432 40560 -4 2496 - 40000 300m 41808 18432 40560 -4 2496 - 50000 300m 41808 18432 40560 -4 2496 - 100000 300m 41808 18432 40560 -4 2496 diff --git a/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX-32S-S4Q31/pg_profile_lookup.ini b/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX-32S-S4Q31/pg_profile_lookup.ini new file mode 120000 index 000000000000..297cddb2d223 --- /dev/null +++ b/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX-32S-S4Q31/pg_profile_lookup.ini @@ -0,0 +1 @@ +BALANCED/pg_profile_lookup.ini \ No newline at end of file diff --git a/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX-32S-S4Q31/qos.json.j2 b/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX-32S-S4Q31/qos.json.j2 deleted file mode 100644 index 1accac3ddd0d..000000000000 --- a/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX-32S-S4Q31/qos.json.j2 +++ /dev/null @@ -1,148 +0,0 @@ -{ - "TC_TO_PRIORITY_GROUP_MAP": { - "AZURE": { - "0": "0", - "1": "1", - "3": "3", - "4": "4" - } - }, - "MAP_PFC_PRIORITY_TO_QUEUE": { - "AZURE": { - "0": "0", - "1": "1", - "3": "3", - "4": "4" - } - }, - "TC_TO_QUEUE_MAP": { - "AZURE": { - "0": "0", - "1": "1", - "3": "3", - "4": "4" - } - }, - "DSCP_TO_TC_MAP": { - "AZURE": { - "0":"0", - "1":"0", - "2":"0", - "3":"3", - "4":"4", - "5":"0", - "6":"0", - "7":"0", - "8":"1", - "9":"0", - "10":"0", - "11":"0", - "12":"0", - "13":"0", - "14":"0", - "15":"0", - "16":"0", - "17":"0", - "18":"0", - "19":"0", - "20":"0", - "21":"0", - "22":"0", - "23":"0", - "24":"0", - "25":"0", - "26":"0", - "27":"0", - "28":"0", - "29":"0", - "30":"0", - "31":"0", - "32":"0", - "33":"0", - "34":"0", - "35":"0", - "36":"0", - "37":"0", - "38":"0", - "39":"0", - "40":"0", - "41":"0", - "42":"0", - "43":"0", - "44":"0", - "45":"0", - "46":"0", - "47":"0", - "48":"0", - "49":"0", - "50":"0", - "51":"0", - "52":"0", - "53":"0", - "54":"0", - "55":"0", - "56":"0", - "57":"0", - "58":"0", - "59":"0", - "60":"0", - "61":"0", - "62":"0", - "63":"0" - } - }, - "SCHEDULER": { - "scheduler.0" : { - "type":"DWRR", - "weight": "25" - }, - "scheduler.1" : { - "type":"DWRR", - "weight": "30" - }, - "scheduler.2" : { - "type":"DWRR", - "weight": "20" - } - }, - "PORT_QOS_MAP": { - "Ethernet0,Ethernet1,Ethernet2,Ethernet3,Ethernet4,Ethernet8,Ethernet12,Ethernet16,Ethernet20,Ethernet24,Ethernet28,Ethernet32,Ethernet36,Ethernet40,Ethernet44,Ethernet48,Ethernet52,Ethernet56,Ethernet60,Ethernet64,Ethernet68,Ethernet72,Ethernet76,Ethernet80,Ethernet84,Ethernet88,Ethernet92,Ethernet96,Ethernet100,Ethernet104,Ethernet108,Ethernet112,Ethernet116,Ethernet120,Ethernet124": { - "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", - "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", - "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", - "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable": "3,4" - } - }, - "WRED_PROFILE": { - "AZURE_LOSSLESS" : { - "wred_green_enable":"true", - "wred_yellow_enable":"true", - "wred_red_enable":"true", - "ecn":"ecn_all", - "red_max_threshold":"312000", - "red_min_threshold":"104000", - "yellow_max_threshold":"312000", - "yellow_min_threshold":"104000", - "green_max_threshold":"312000", - "green_min_threshold":"104000" - } - }, - "QUEUE": { - "Ethernet0,Ethernet1,Ethernet2,Ethernet3,Ethernet4,Ethernet8,Ethernet12,Ethernet16,Ethernet20,Ethernet24,Ethernet28,Ethernet32,Ethernet36,Ethernet40,Ethernet44,Ethernet48,Ethernet52,Ethernet56,Ethernet60,Ethernet64,Ethernet68,Ethernet72,Ethernet76,Ethernet80,Ethernet84,Ethernet88,Ethernet92,Ethernet96,Ethernet100,Ethernet104,Ethernet108,Ethernet112,Ethernet116,Ethernet120,Ethernet124|3-4" : { - "scheduler" : "[SCHEDULER|scheduler.0]" - }, - "Ethernet0,Ethernet1,Ethernet2,Ethernet3,Ethernet4,Ethernet8,Ethernet12,Ethernet16,Ethernet20,Ethernet24,Ethernet28,Ethernet32,Ethernet36,Ethernet40,Ethernet44,Ethernet48,Ethernet52,Ethernet56,Ethernet60,Ethernet64,Ethernet68,Ethernet72,Ethernet76,Ethernet80,Ethernet84,Ethernet88,Ethernet92,Ethernet96,Ethernet100,Ethernet104,Ethernet108,Ethernet112,Ethernet116,Ethernet120,Ethernet124|3" : { - "wred_profile" : "[WRED_PROFILE|AZURE_LOSSLESS]" - }, - "Ethernet0,Ethernet1,Ethernet2,Ethernet3,Ethernet4,Ethernet8,Ethernet12,Ethernet16,Ethernet20,Ethernet24,Ethernet28,Ethernet32,Ethernet36,Ethernet40,Ethernet44,Ethernet48,Ethernet52,Ethernet56,Ethernet60,Ethernet64,Ethernet68,Ethernet72,Ethernet76,Ethernet80,Ethernet84,Ethernet88,Ethernet92,Ethernet96,Ethernet100,Ethernet104,Ethernet108,Ethernet112,Ethernet116,Ethernet120,Ethernet124|4" : { - "wred_profile" : "[WRED_PROFILE|AZURE_LOSSLESS]" - }, - "Ethernet0,Ethernet1,Ethernet2,Ethernet3,Ethernet4,Ethernet8,Ethernet12,Ethernet16,Ethernet20,Ethernet24,Ethernet28,Ethernet32,Ethernet36,Ethernet40,Ethernet44,Ethernet48,Ethernet52,Ethernet56,Ethernet60,Ethernet64,Ethernet68,Ethernet72,Ethernet76,Ethernet80,Ethernet84,Ethernet88,Ethernet92,Ethernet96,Ethernet100,Ethernet104,Ethernet108,Ethernet112,Ethernet116,Ethernet120,Ethernet124|0" : { - "scheduler" : "[SCHEDULER|scheduler.1]" - }, - "Ethernet0,Ethernet1,Ethernet2,Ethernet3,Ethernet4,Ethernet8,Ethernet12,Ethernet16,Ethernet20,Ethernet24,Ethernet28,Ethernet32,Ethernet36,Ethernet40,Ethernet44,Ethernet48,Ethernet52,Ethernet56,Ethernet60,Ethernet64,Ethernet68,Ethernet72,Ethernet76,Ethernet80,Ethernet84,Ethernet88,Ethernet92,Ethernet96,Ethernet100,Ethernet104,Ethernet108,Ethernet112,Ethernet116,Ethernet120,Ethernet124|1" : { - "scheduler" : "[SCHEDULER|scheduler.2]" - } - } -} diff --git a/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX-32S-S4Q31/qos.json.j2 b/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX-32S-S4Q31/qos.json.j2 new file mode 120000 index 000000000000..aef6b6765cf2 --- /dev/null +++ b/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX-32S-S4Q31/qos.json.j2 @@ -0,0 +1 @@ +BALANCED/qos.json.j2 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX-32S-S4Q31/td2-a7050-q31s4-31x40G-4x10G.config.bcm b/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX-32S-S4Q31/td2-a7050-q31s4-31x40G-4x10G.config.bcm index 4819c7929ecd..ffb3e66e7b0b 100644 --- a/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX-32S-S4Q31/td2-a7050-q31s4-31x40G-4x10G.config.bcm +++ b/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX-32S-S4Q31/td2-a7050-q31s4-31x40G-4x10G.config.bcm @@ -1,17 +1,57 @@ +# ALPM enable +l3_alpm_enable=2 +ipv6_lpm_128b_enable=1 +l2_mem_entries=32768 +l3_mem_entries=16384 + +# disables bcmALPMDH (ALPM distributed hitbit) thread. This thread is purely for debug purpose +l3_alpm_hit_skip=1 + +# Disable Counting ACL Drop towards interface RX_DRP counter +sai_adjust_acl_drop_in_rx_drop=1 + +# From old config file +os=unix +higig2_hdr_mode=1 + +# Parity +parity_correction=1 +parity_enable=1 +stat_if_parity_enable=0 + +# l2 thread related config vars +l2xmsg_hostbuf_size=8192 +l2xmsg_mode=1 + +bcm_num_cos=10 +bcm_stat_interval=2000000 +lls_num_l2uc=12 +max_vp_lags=0 +miim_intr_enable=0 +mmu_lossless=0 +module_64ports=0 + +stable_size=0x2000000 + +tdma_timeout_usec=5000000 +tslam_timeout_usec=15000000 +cdma_timeout_usec=15000000 +dma_desc_timeout_usec=15000000 + +############################### +serdes_fiber_pref=1 +############################### +mdio_output_delay=0x0d +############################### +xgxs_lcpll_xtal_refclk=1 +tdma_intr_enable=1 +tslam_intr_enable=1 +table_dma_enable=1 + arl_clean_timeout_usec=15000000 -bcm_num_cos.0=8 bcm_stat_flags=1 bcm_stat_jumbo.0=9236 -cdma_timeout_usec.0=15000000 -dma_desc_timeout_usec.0=15000000 -higig2_hdr_mode.0=1 -ipv6_lpm_128b_enable.0=2 -l2xmsg_mode.0=1 -max_vp_lags.0=0 -mdio_output_delay=0x0d -miim_intr_enable.0=0 -module_64ports.0=0 -os=unix + pbmp_oversubscribe.0=0x1fffffffffffffffffffffffffe pbmp_xport_xe.0=0x1fffffffffffffffffffffffffe phy_an_c37_1.0=3 @@ -243,10 +283,6 @@ serdes_firmware_mode_101.0=2 serdes_firmware_mode_102.0=2 serdes_firmware_mode_103.0=2 serdes_firmware_mode_104.0=2 -stable_size=0x2000000 -tdma_timeout_usec.0=15000000 -tslam_timeout_usec.0=15000000 -xgxs_lcpll_xtal_refclk.0=1 xgxs_rx_lane_map_1.0=0x3210 xgxs_rx_lane_map_5.0=0x0321 xgxs_rx_lane_map_9.0=0x1302 diff --git a/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX32S-Q32 b/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX32S-Q32 deleted file mode 120000 index 6a90d8a3ac70..000000000000 --- a/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX32S-Q32 +++ /dev/null @@ -1 +0,0 @@ -Arista-7050-QX-32S \ No newline at end of file diff --git a/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX32S-Q32/BALANCED b/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX32S-Q32/BALANCED new file mode 120000 index 000000000000..808c3d86217f --- /dev/null +++ b/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX32S-Q32/BALANCED @@ -0,0 +1 @@ +../../../common/profiles/td2/gen/BALANCED \ No newline at end of file diff --git a/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX32S-Q32/RDMA-CENTRIC b/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX32S-Q32/RDMA-CENTRIC new file mode 120000 index 000000000000..8bcc02cca148 --- /dev/null +++ b/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX32S-Q32/RDMA-CENTRIC @@ -0,0 +1 @@ +../../../common/profiles/td2/gen/RDMA-CENTRIC \ No newline at end of file diff --git a/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX32S-Q32/TCP-CENTRIC b/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX32S-Q32/TCP-CENTRIC new file mode 120000 index 000000000000..7ac6cc7160ac --- /dev/null +++ b/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX32S-Q32/TCP-CENTRIC @@ -0,0 +1 @@ +../../../common/profiles/td2/gen/TCP-CENTRIC \ No newline at end of file diff --git a/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX32S-Q32/buffer_ports_t0.j2 b/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX32S-Q32/buffer_ports_t0.j2 new file mode 100644 index 000000000000..48bbf2fc121e --- /dev/null +++ b/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX32S-Q32/buffer_ports_t0.j2 @@ -0,0 +1,6 @@ +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {% for port_idx in range(0,32) %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} + {% endfor %} +{%- endmacro %} diff --git a/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX32S-Q32/buffer_ports_t1.j2 b/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX32S-Q32/buffer_ports_t1.j2 new file mode 100644 index 000000000000..48bbf2fc121e --- /dev/null +++ b/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX32S-Q32/buffer_ports_t1.j2 @@ -0,0 +1,6 @@ +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {% for port_idx in range(0,32) %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} + {% endfor %} +{%- endmacro %} diff --git a/device/arista/x86_64-arista_7050_qx32s/Arista-7050-QX-32S/buffers.json.j2 b/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX32S-Q32/buffers.json.j2 similarity index 100% rename from device/arista/x86_64-arista_7050_qx32s/Arista-7050-QX-32S/buffers.json.j2 rename to device/arista/x86_64-arista_7050_qx32s/Arista-7050QX32S-Q32/buffers.json.j2 diff --git a/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX32S-Q32/buffers_defaults_t0.j2 b/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX32S-Q32/buffers_defaults_t0.j2 new file mode 120000 index 000000000000..9524e6a476ac --- /dev/null +++ b/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX32S-Q32/buffers_defaults_t0.j2 @@ -0,0 +1 @@ +BALANCED/buffers_defaults_t0.j2 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX32S-Q32/buffers_defaults_t1.j2 b/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX32S-Q32/buffers_defaults_t1.j2 new file mode 120000 index 000000000000..c25cc95d6d57 --- /dev/null +++ b/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX32S-Q32/buffers_defaults_t1.j2 @@ -0,0 +1 @@ +BALANCED/buffers_defaults_t1.j2 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7050_qx32s/Arista-7050-QX-32S/hwsku-init b/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX32S-Q32/hwsku-init similarity index 100% rename from device/arista/x86_64-arista_7050_qx32s/Arista-7050-QX-32S/hwsku-init rename to device/arista/x86_64-arista_7050_qx32s/Arista-7050QX32S-Q32/hwsku-init diff --git a/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX32S-Q32/pg_profile_lookup.ini b/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX32S-Q32/pg_profile_lookup.ini new file mode 120000 index 000000000000..297cddb2d223 --- /dev/null +++ b/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX32S-Q32/pg_profile_lookup.ini @@ -0,0 +1 @@ +BALANCED/pg_profile_lookup.ini \ No newline at end of file diff --git a/device/arista/x86_64-arista_7050_qx32s/Arista-7050-QX-32S/port_config.ini b/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX32S-Q32/port_config.ini similarity index 100% rename from device/arista/x86_64-arista_7050_qx32s/Arista-7050-QX-32S/port_config.ini rename to device/arista/x86_64-arista_7050_qx32s/Arista-7050QX32S-Q32/port_config.ini diff --git a/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX32S-Q32/qos.json.j2 b/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX32S-Q32/qos.json.j2 new file mode 120000 index 000000000000..aef6b6765cf2 --- /dev/null +++ b/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX32S-Q32/qos.json.j2 @@ -0,0 +1 @@ +BALANCED/qos.json.j2 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7050_qx32s/Arista-7050-QX-32S/sai.profile b/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX32S-Q32/sai.profile similarity index 100% rename from device/arista/x86_64-arista_7050_qx32s/Arista-7050-QX-32S/sai.profile rename to device/arista/x86_64-arista_7050_qx32s/Arista-7050QX32S-Q32/sai.profile diff --git a/device/arista/x86_64-arista_7050_qx32s/Arista-7050-QX-32S/td2-a7050-qx32s-32x40G.config.bcm b/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX32S-Q32/td2-a7050-qx32s-32x40G.config.bcm similarity index 99% rename from device/arista/x86_64-arista_7050_qx32s/Arista-7050-QX-32S/td2-a7050-qx32s-32x40G.config.bcm rename to device/arista/x86_64-arista_7050_qx32s/Arista-7050QX32S-Q32/td2-a7050-qx32s-32x40G.config.bcm index 31521e4c43ae..720b03e0fa11 100644 --- a/device/arista/x86_64-arista_7050_qx32s/Arista-7050-QX-32S/td2-a7050-qx32s-32x40G.config.bcm +++ b/device/arista/x86_64-arista_7050_qx32s/Arista-7050QX32S-Q32/td2-a7050-qx32s-32x40G.config.bcm @@ -18,6 +18,12 @@ ipv6_lpm_128b_enable=1 l2_mem_entries=32768 l3_mem_entries=16384 +# disables bcmALPMDH (ALPM distributed hitbit) thread. This thread is purely for debug purpose +l3_alpm_hit_skip=1 + +# Disable Counting ACL Drop towards interface RX_DRP counter +sai_adjust_acl_drop_in_rx_drop=1 + # From old config file os=unix higig2_hdr_mode=1 diff --git a/device/arista/x86_64-arista_7050_qx32s/plugins/pcie.yaml b/device/arista/x86_64-arista_7050_qx32s/pcie.yaml similarity index 100% rename from device/arista/x86_64-arista_7050_qx32s/plugins/pcie.yaml rename to device/arista/x86_64-arista_7050_qx32s/pcie.yaml diff --git a/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C32/BALANCED/buffers_defaults_t0.j2 b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C32/BALANCED/buffers_defaults_t0.j2 new file mode 100644 index 000000000000..97c026b1e450 --- /dev/null +++ b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C32/BALANCED/buffers_defaults_t0.j2 @@ -0,0 +1,52 @@ +{%- set default_cable = '300m' %} + +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {%- for port_idx in range(0,32) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{%- endif %} + {%- endfor %} +{%- endmacro %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "32732160", + "type": "ingress", + "mode": "dynamic", + "xoff": "1622016" + }, + "egress_lossy_pool": { + "size": "24709632", + "type": "egress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "32599040", + "type": "egress", + "mode": "static" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "static_th":"32732160" + }, + "egress_lossless_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"0", + "static_th":"32599040" + }, + "egress_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"1792", + "dynamic_th":"3" + } + }, +{%- endmacro %} + +{% import 'buffers_extra_queues.j2' as defs with context %} + +{%- macro generate_queue_buffers_with_extra_lossless_queues(port_names, port_names_require_extra_buffer) %} +{{ defs.generate_queue_buffers_with_extra_lossless_queues(port_names, port_names_require_extra_buffer) }} +{%- endmacro %} diff --git a/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C32/BALANCED/buffers_defaults_t1.j2 b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C32/BALANCED/buffers_defaults_t1.j2 new file mode 100644 index 000000000000..4e8d7ed881a8 --- /dev/null +++ b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C32/BALANCED/buffers_defaults_t1.j2 @@ -0,0 +1,46 @@ +{%- set default_cable = '300m' %} + +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {%- for port_idx in range(0,32) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{%- endif %} + {%- endfor %} +{%- endmacro %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "32712448", + "type": "ingress", + "mode": "dynamic", + "xoff": "1622016" + }, + "egress_lossy_pool": { + "size": "24709632", + "type": "egress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "32599040", + "type": "egress", + "mode": "static" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "static_th":"32712448" + }, + "egress_lossless_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"0", + "static_th":"32599040" + }, + "egress_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"1792", + "dynamic_th":"3" + } + }, +{%- endmacro %} diff --git a/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C32/BALANCED/pg_profile_lookup.ini b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C32/BALANCED/pg_profile_lookup.ini new file mode 100644 index 000000000000..5b4482bc74c7 --- /dev/null +++ b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C32/BALANCED/pg_profile_lookup.ini @@ -0,0 +1,8 @@ +# PG lossless profiles. +# speed cable size xon xoff threshold xon_offset + 50000 5m 4608 4608 160000 0 4608 + 100000 5m 4608 4608 160000 0 4608 + 50000 40m 4608 4608 160000 0 4608 + 100000 40m 4608 4608 160000 0 4608 + 50000 300m 4608 4608 160000 0 4608 + 100000 300m 4608 4608 160000 0 4608 diff --git a/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C32/BALANCED/qos.json.j2 b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C32/BALANCED/qos.json.j2 new file mode 120000 index 000000000000..5fb0f5c79852 --- /dev/null +++ b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C32/BALANCED/qos.json.j2 @@ -0,0 +1 @@ +../../Arista-7050CX3-32S-D48C8/BALANCED/qos.json.j2 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C32/RDMA-CENTRIC b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C32/RDMA-CENTRIC new file mode 120000 index 000000000000..d6f7127aa748 --- /dev/null +++ b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C32/RDMA-CENTRIC @@ -0,0 +1 @@ +BALANCED \ No newline at end of file diff --git a/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C32/TCP-CENTRIC b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C32/TCP-CENTRIC new file mode 120000 index 000000000000..d6f7127aa748 --- /dev/null +++ b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C32/TCP-CENTRIC @@ -0,0 +1 @@ +BALANCED \ No newline at end of file diff --git a/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C32/buffers_defaults_t0.j2 b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C32/buffers_defaults_t0.j2 deleted file mode 100644 index cc7a687514ce..000000000000 --- a/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C32/buffers_defaults_t0.j2 +++ /dev/null @@ -1,54 +0,0 @@ - -{%- set default_cable = '300m' %} - -{%- set ports2cable = { - 'torrouter_server' : '5m', - 'leafrouter_torrouter' : '40m', - 'spinerouter_leafrouter' : '300m' - } --%} - -{%- macro generate_port_lists(PORT_ALL) %} - {# Generate list of ports #} - {%- for port_idx in range(0,32) %} - {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{%- endif %} - {%- endfor %} -{%- endmacro %} - -{%- macro generate_buffer_pool_and_profiles() %} - "BUFFER_POOL": { - "ingress_lossless_pool": { - "size": "10875072", - "type": "ingress", - "mode": "dynamic", - "xoff": "4194112" - }, - "egress_lossy_pool": { - "size": "9243812", - "type": "egress", - "mode": "dynamic" - }, - "egress_lossless_pool": { - "size": "15982720", - "type": "egress", - "mode": "static" - } - }, - "BUFFER_PROFILE": { - "ingress_lossy_profile": { - "pool":"[BUFFER_POOL|ingress_lossless_pool]", - "size":"0", - "dynamic_th":"3" - }, - "egress_lossless_profile": { - "pool":"[BUFFER_POOL|egress_lossless_pool]", - "size":"1518", - "static_th":"15982720" - }, - "egress_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"1518", - "dynamic_th":"3" - } - }, -{%- endmacro %} diff --git a/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C32/buffers_defaults_t0.j2 b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C32/buffers_defaults_t0.j2 new file mode 120000 index 000000000000..9524e6a476ac --- /dev/null +++ b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C32/buffers_defaults_t0.j2 @@ -0,0 +1 @@ +BALANCED/buffers_defaults_t0.j2 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C32/buffers_defaults_t1.j2 b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C32/buffers_defaults_t1.j2 deleted file mode 100644 index cc7a687514ce..000000000000 --- a/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C32/buffers_defaults_t1.j2 +++ /dev/null @@ -1,54 +0,0 @@ - -{%- set default_cable = '300m' %} - -{%- set ports2cable = { - 'torrouter_server' : '5m', - 'leafrouter_torrouter' : '40m', - 'spinerouter_leafrouter' : '300m' - } --%} - -{%- macro generate_port_lists(PORT_ALL) %} - {# Generate list of ports #} - {%- for port_idx in range(0,32) %} - {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{%- endif %} - {%- endfor %} -{%- endmacro %} - -{%- macro generate_buffer_pool_and_profiles() %} - "BUFFER_POOL": { - "ingress_lossless_pool": { - "size": "10875072", - "type": "ingress", - "mode": "dynamic", - "xoff": "4194112" - }, - "egress_lossy_pool": { - "size": "9243812", - "type": "egress", - "mode": "dynamic" - }, - "egress_lossless_pool": { - "size": "15982720", - "type": "egress", - "mode": "static" - } - }, - "BUFFER_PROFILE": { - "ingress_lossy_profile": { - "pool":"[BUFFER_POOL|ingress_lossless_pool]", - "size":"0", - "dynamic_th":"3" - }, - "egress_lossless_profile": { - "pool":"[BUFFER_POOL|egress_lossless_pool]", - "size":"1518", - "static_th":"15982720" - }, - "egress_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"1518", - "dynamic_th":"3" - } - }, -{%- endmacro %} diff --git a/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C32/buffers_defaults_t1.j2 b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C32/buffers_defaults_t1.j2 new file mode 120000 index 000000000000..c25cc95d6d57 --- /dev/null +++ b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C32/buffers_defaults_t1.j2 @@ -0,0 +1 @@ +BALANCED/buffers_defaults_t1.j2 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C32/buffers_extra_queues.j2 b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C32/buffers_extra_queues.j2 new file mode 120000 index 000000000000..2c4dff993ce9 --- /dev/null +++ b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C32/buffers_extra_queues.j2 @@ -0,0 +1 @@ +../Arista-7050CX3-32S-D48C8/buffers_extra_queues.j2 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C32/config.bcm.j2 b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C32/config.bcm.j2 new file mode 100644 index 000000000000..d6bb753f3e98 --- /dev/null +++ b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C32/config.bcm.j2 @@ -0,0 +1,532 @@ +{# Construct config.bcm to include additional soc properties per specific device metadata requirement #} +{%- set map_prio = '' -%} +{%- if DEVICE_METADATA is defined and DEVICE_METADATA['localhost'] is defined and DEVICE_METADATA['localhost']['subtype'] is defined -%} +{%- set switch_subtype = DEVICE_METADATA['localhost']['subtype'] -%} +{%- if 'dualtor' in switch_subtype.lower() %} +{%- set map_prio = 'sai_remap_prio_on_tnl_egress=1' -%} +{%- endif %} +{%- endif %} +sai_load_hw_config=/etc/bcm/flex/bcm56870_a0_issu/b870.6.4.1/ +l3_alpm_hit_skip=1 +sai_adjust_acl_drop_in_rx_drop=1 +sai_verify_incoming_chksum=0 +{{ map_prio }} +host_as_route_disable=1 +use_all_splithorizon_groups=1 +riot_enable=1 +sai_tunnel_support=1 +sai_tunnel_underlay_route_mode=1 +riot_overlay_l3_intf_mem_size=4096 +riot_overlay_l3_egress_mem_size=32768 +l3_ecmp_levels=2 +riot_overlay_ecmp_resilient_hash_size=16384 +flow_init_mode=1 +arl_clean_timeout_usec=15000000 +asf_mem_profile=2 +bcm_num_cos=10 +bcm_stat_flags=1 +bcm_stat_jumbo=9236 +bcm_tunnel_term_compatible_mode=1 +cdma_timeout_usec=15000000 +core_clock_frequency=1525 +dma_desc_timeout_usec=15000000 +dpp_clock_ratio=2:3 +fpem_mem_entries=0 +higig2_hdr_mode=1 +ifp_inports_support_enable=1 +ipv6_lpm_128b_enable=1 +l2_mem_entries=32768 +l2xmsg_mode=1 +l3_alpm_enable=2 +l3_max_ecmp_mode=1 +l3_mem_entries=16384 +max_vp_lags=0 +miim_intr_enable=0 +module_64ports=1 +multicast_l2_range=16383 +multicast_l3_range=0 +os=unix +oversubscribe_mode=1 +pbmp_xport_xe=0x4888888888888888c2222222222222222 +PHY_AN_ALLOW_PLL_CHANGE=1 +phy_an_c37_130=2 +phy_an_c37_66=2 +phy_an_c73=1 +port_flex_enable=1 +port_init_autoneg=0 +port_phy_addr=0xff +robust_hash_disable_egress_vlan=1 +robust_hash_disable_mpls=1 +robust_hash_disable_vlan=1 +stable_size=0x5500000 +tdma_timeout_usec=15000000 +tslam_timeout_usec=15000000 +sai_optimized_mmu=1 +mmu_init_config="TD3-MSFT-CUSTOM" +buf.map.egress_pool0.ingress_pool=0 +buf.map.egress_pool1.ingress_pool=0 +buf.map.egress_pool2.ingress_pool=1 +phy_chain_rx_lane_map_physical{1.0}=0x1302 +phy_chain_rx_lane_map_physical{101.0}=0x0213 +phy_chain_rx_lane_map_physical{105.0}=0x2031 +phy_chain_rx_lane_map_physical{109.0}=0x0213 +phy_chain_rx_lane_map_physical{113.0}=0x2130 +phy_chain_rx_lane_map_physical{117.0}=0x0213 +phy_chain_rx_lane_map_physical{121.0}=0x2031 +phy_chain_rx_lane_map_physical{125.0}=0x0213 +phy_chain_rx_lane_map_physical{129.0}=0x3210 +phy_chain_rx_lane_map_physical{13.0}=0x3120 +phy_chain_rx_lane_map_physical{17.0}=0x1203 +phy_chain_rx_lane_map_physical{21.0}=0x3120 +phy_chain_rx_lane_map_physical{25.0}=0x3120 +phy_chain_rx_lane_map_physical{29.0}=0x3120 +phy_chain_rx_lane_map_physical{33.0}=0x1203 +phy_chain_rx_lane_map_physical{37.0}=0x3120 +phy_chain_rx_lane_map_physical{41.0}=0x3120 +phy_chain_rx_lane_map_physical{45.0}=0x3120 +phy_chain_rx_lane_map_physical{49.0}=0x1203 +phy_chain_rx_lane_map_physical{5.0}=0x3120 +phy_chain_rx_lane_map_physical{53.0}=0x3120 +phy_chain_rx_lane_map_physical{57.0}=0x3120 +phy_chain_rx_lane_map_physical{61.0}=0x3120 +phy_chain_rx_lane_map_physical{65.0}=0x2130 +phy_chain_rx_lane_map_physical{69.0}=0x0213 +phy_chain_rx_lane_map_physical{73.0}=0x2031 +phy_chain_rx_lane_map_physical{77.0}=0x0213 +phy_chain_rx_lane_map_physical{81.0}=0x2130 +phy_chain_rx_lane_map_physical{85.0}=0x0213 +phy_chain_rx_lane_map_physical{89.0}=0x2031 +phy_chain_rx_lane_map_physical{9.0}=0x3120 +phy_chain_rx_lane_map_physical{93.0}=0x0213 +phy_chain_rx_lane_map_physical{97.0}=0x2130 +phy_chain_rx_polarity_flip_physical{100.0}=0x1 +phy_chain_rx_polarity_flip_physical{10.0}=0x0 +phy_chain_rx_polarity_flip_physical{1.0}=0x0 +phy_chain_rx_polarity_flip_physical{101.0}=0x1 +phy_chain_rx_polarity_flip_physical{102.0}=0x0 +phy_chain_rx_polarity_flip_physical{103.0}=0x0 +phy_chain_rx_polarity_flip_physical{104.0}=0x1 +phy_chain_rx_polarity_flip_physical{105.0}=0x1 +phy_chain_rx_polarity_flip_physical{106.0}=0x1 +phy_chain_rx_polarity_flip_physical{107.0}=0x1 +phy_chain_rx_polarity_flip_physical{108.0}=0x0 +phy_chain_rx_polarity_flip_physical{109.0}=0x0 +phy_chain_rx_polarity_flip_physical{110.0}=0x0 +phy_chain_rx_polarity_flip_physical{11.0}=0x1 +phy_chain_rx_polarity_flip_physical{111.0}=0x1 +phy_chain_rx_polarity_flip_physical{112.0}=0x1 +phy_chain_rx_polarity_flip_physical{113.0}=0x1 +phy_chain_rx_polarity_flip_physical{114.0}=0x1 +phy_chain_rx_polarity_flip_physical{115.0}=0x0 +phy_chain_rx_polarity_flip_physical{116.0}=0x1 +phy_chain_rx_polarity_flip_physical{117.0}=0x0 +phy_chain_rx_polarity_flip_physical{118.0}=0x0 +phy_chain_rx_polarity_flip_physical{119.0}=0x1 +phy_chain_rx_polarity_flip_physical{120.0}=0x1 +phy_chain_rx_polarity_flip_physical{12.0}=0x1 +phy_chain_rx_polarity_flip_physical{121.0}=0x1 +phy_chain_rx_polarity_flip_physical{122.0}=0x1 +phy_chain_rx_polarity_flip_physical{123.0}=0x1 +phy_chain_rx_polarity_flip_physical{124.0}=0x0 +phy_chain_rx_polarity_flip_physical{125.0}=0x0 +phy_chain_rx_polarity_flip_physical{126.0}=0x0 +phy_chain_rx_polarity_flip_physical{127.0}=0x1 +phy_chain_rx_polarity_flip_physical{128.0}=0x1 +phy_chain_rx_polarity_flip_physical{129.0}=0x0 +phy_chain_rx_polarity_flip_physical{13.0}=0x1 +phy_chain_rx_polarity_flip_physical{131.0}=0x0 +phy_chain_rx_polarity_flip_physical{14.0}=0x1 +phy_chain_rx_polarity_flip_physical{15.0}=0x0 +phy_chain_rx_polarity_flip_physical{16.0}=0x0 +phy_chain_rx_polarity_flip_physical{17.0}=0x0 +phy_chain_rx_polarity_flip_physical{18.0}=0x0 +phy_chain_rx_polarity_flip_physical{19.0}=0x1 +phy_chain_rx_polarity_flip_physical{20.0}=0x0 +phy_chain_rx_polarity_flip_physical{2.0}=0x0 +phy_chain_rx_polarity_flip_physical{21.0}=0x1 +phy_chain_rx_polarity_flip_physical{22.0}=0x1 +phy_chain_rx_polarity_flip_physical{23.0}=0x0 +phy_chain_rx_polarity_flip_physical{24.0}=0x0 +phy_chain_rx_polarity_flip_physical{25.0}=0x0 +phy_chain_rx_polarity_flip_physical{26.0}=0x1 +phy_chain_rx_polarity_flip_physical{27.0}=0x1 +phy_chain_rx_polarity_flip_physical{28.0}=0x0 +phy_chain_rx_polarity_flip_physical{29.0}=0x1 +phy_chain_rx_polarity_flip_physical{30.0}=0x1 +phy_chain_rx_polarity_flip_physical{3.0}=0x0 +phy_chain_rx_polarity_flip_physical{31.0}=0x0 +phy_chain_rx_polarity_flip_physical{32.0}=0x0 +phy_chain_rx_polarity_flip_physical{33.0}=0x0 +phy_chain_rx_polarity_flip_physical{34.0}=0x0 +phy_chain_rx_polarity_flip_physical{35.0}=0x1 +phy_chain_rx_polarity_flip_physical{36.0}=0x0 +phy_chain_rx_polarity_flip_physical{37.0}=0x1 +phy_chain_rx_polarity_flip_physical{38.0}=0x1 +phy_chain_rx_polarity_flip_physical{39.0}=0x0 +phy_chain_rx_polarity_flip_physical{40.0}=0x0 +phy_chain_rx_polarity_flip_physical{4.0}=0x1 +phy_chain_rx_polarity_flip_physical{41.0}=0x0 +phy_chain_rx_polarity_flip_physical{42.0}=0x0 +phy_chain_rx_polarity_flip_physical{43.0}=0x1 +phy_chain_rx_polarity_flip_physical{44.0}=0x1 +phy_chain_rx_polarity_flip_physical{45.0}=0x1 +phy_chain_rx_polarity_flip_physical{46.0}=0x1 +phy_chain_rx_polarity_flip_physical{47.0}=0x0 +phy_chain_rx_polarity_flip_physical{48.0}=0x0 +phy_chain_rx_polarity_flip_physical{49.0}=0x0 +phy_chain_rx_polarity_flip_physical{50.0}=0x0 +phy_chain_rx_polarity_flip_physical{5.0}=0x0 +phy_chain_rx_polarity_flip_physical{51.0}=0x1 +phy_chain_rx_polarity_flip_physical{52.0}=0x0 +phy_chain_rx_polarity_flip_physical{53.0}=0x1 +phy_chain_rx_polarity_flip_physical{54.0}=0x1 +phy_chain_rx_polarity_flip_physical{55.0}=0x0 +phy_chain_rx_polarity_flip_physical{56.0}=0x0 +phy_chain_rx_polarity_flip_physical{57.0}=0x0 +phy_chain_rx_polarity_flip_physical{58.0}=0x0 +phy_chain_rx_polarity_flip_physical{59.0}=0x1 +phy_chain_rx_polarity_flip_physical{60.0}=0x1 +phy_chain_rx_polarity_flip_physical{6.0}=0x1 +phy_chain_rx_polarity_flip_physical{61.0}=0x1 +phy_chain_rx_polarity_flip_physical{62.0}=0x1 +phy_chain_rx_polarity_flip_physical{63.0}=0x0 +phy_chain_rx_polarity_flip_physical{64.0}=0x0 +phy_chain_rx_polarity_flip_physical{65.0}=0x1 +phy_chain_rx_polarity_flip_physical{66.0}=0x1 +phy_chain_rx_polarity_flip_physical{67.0}=0x0 +phy_chain_rx_polarity_flip_physical{68.0}=0x1 +phy_chain_rx_polarity_flip_physical{69.0}=0x0 +phy_chain_rx_polarity_flip_physical{70.0}=0x0 +phy_chain_rx_polarity_flip_physical{7.0}=0x0 +phy_chain_rx_polarity_flip_physical{71.0}=0x1 +phy_chain_rx_polarity_flip_physical{72.0}=0x1 +phy_chain_rx_polarity_flip_physical{73.0}=0x1 +phy_chain_rx_polarity_flip_physical{74.0}=0x1 +phy_chain_rx_polarity_flip_physical{75.0}=0x1 +phy_chain_rx_polarity_flip_physical{76.0}=0x0 +phy_chain_rx_polarity_flip_physical{77.0}=0x0 +phy_chain_rx_polarity_flip_physical{78.0}=0x0 +phy_chain_rx_polarity_flip_physical{79.0}=0x1 +phy_chain_rx_polarity_flip_physical{80.0}=0x1 +phy_chain_rx_polarity_flip_physical{8.0}=0x0 +phy_chain_rx_polarity_flip_physical{81.0}=0x1 +phy_chain_rx_polarity_flip_physical{82.0}=0x1 +phy_chain_rx_polarity_flip_physical{83.0}=0x0 +phy_chain_rx_polarity_flip_physical{84.0}=0x1 +phy_chain_rx_polarity_flip_physical{85.0}=0x0 +phy_chain_rx_polarity_flip_physical{86.0}=0x0 +phy_chain_rx_polarity_flip_physical{87.0}=0x1 +phy_chain_rx_polarity_flip_physical{88.0}=0x1 +phy_chain_rx_polarity_flip_physical{89.0}=0x1 +phy_chain_rx_polarity_flip_physical{90.0}=0x1 +phy_chain_rx_polarity_flip_physical{9.0}=0x0 +phy_chain_rx_polarity_flip_physical{91.0}=0x1 +phy_chain_rx_polarity_flip_physical{92.0}=0x0 +phy_chain_rx_polarity_flip_physical{93.0}=0x0 +phy_chain_rx_polarity_flip_physical{94.0}=0x0 +phy_chain_rx_polarity_flip_physical{95.0}=0x1 +phy_chain_rx_polarity_flip_physical{96.0}=0x1 +phy_chain_rx_polarity_flip_physical{97.0}=0x1 +phy_chain_rx_polarity_flip_physical{98.0}=0x1 +phy_chain_rx_polarity_flip_physical{99.0}=0x0 +phy_chain_tx_lane_map_physical{1.0}=0x3021 +phy_chain_tx_lane_map_physical{101.0}=0x3120 +phy_chain_tx_lane_map_physical{105.0}=0x1302 +phy_chain_tx_lane_map_physical{109.0}=0x2130 +phy_chain_tx_lane_map_physical{113.0}=0x1302 +phy_chain_tx_lane_map_physical{117.0}=0x3120 +phy_chain_tx_lane_map_physical{121.0}=0x1302 +phy_chain_tx_lane_map_physical{125.0}=0x3120 +phy_chain_tx_lane_map_physical{129.0}=0x3210 +phy_chain_tx_lane_map_physical{13.0}=0x0213 +phy_chain_tx_lane_map_physical{17.0}=0x2031 +phy_chain_tx_lane_map_physical{21.0}=0x0213 +phy_chain_tx_lane_map_physical{25.0}=0x2031 +phy_chain_tx_lane_map_physical{29.0}=0x1203 +phy_chain_tx_lane_map_physical{33.0}=0x2031 +phy_chain_tx_lane_map_physical{37.0}=0x0213 +phy_chain_tx_lane_map_physical{41.0}=0x2031 +phy_chain_tx_lane_map_physical{45.0}=0x1203 +phy_chain_tx_lane_map_physical{49.0}=0x2031 +phy_chain_tx_lane_map_physical{5.0}=0x1203 +phy_chain_tx_lane_map_physical{53.0}=0x0213 +phy_chain_tx_lane_map_physical{57.0}=0x2031 +phy_chain_tx_lane_map_physical{61.0}=0x1203 +phy_chain_tx_lane_map_physical{65.0}=0x1302 +phy_chain_tx_lane_map_physical{69.0}=0x1302 +phy_chain_tx_lane_map_physical{73.0}=0x1302 +phy_chain_tx_lane_map_physical{77.0}=0x2130 +phy_chain_tx_lane_map_physical{81.0}=0x1302 +phy_chain_tx_lane_map_physical{85.0}=0x3120 +phy_chain_tx_lane_map_physical{89.0}=0x1302 +phy_chain_tx_lane_map_physical{9.0}=0x0213 +phy_chain_tx_lane_map_physical{93.0}=0x2130 +phy_chain_tx_lane_map_physical{97.0}=0x1302 +phy_chain_tx_polarity_flip_physical{100.0}=0x1 +phy_chain_tx_polarity_flip_physical{10.0}=0x1 +phy_chain_tx_polarity_flip_physical{1.0}=0x1 +phy_chain_tx_polarity_flip_physical{101.0}=0x0 +phy_chain_tx_polarity_flip_physical{102.0}=0x1 +phy_chain_tx_polarity_flip_physical{103.0}=0x1 +phy_chain_tx_polarity_flip_physical{104.0}=0x0 +phy_chain_tx_polarity_flip_physical{105.0}=0x1 +phy_chain_tx_polarity_flip_physical{106.0}=0x0 +phy_chain_tx_polarity_flip_physical{107.0}=0x0 +phy_chain_tx_polarity_flip_physical{108.0}=0x0 +phy_chain_tx_polarity_flip_physical{109.0}=0x1 +phy_chain_tx_polarity_flip_physical{110.0}=0x1 +phy_chain_tx_polarity_flip_physical{11.0}=0x0 +phy_chain_tx_polarity_flip_physical{111.0}=0x0 +phy_chain_tx_polarity_flip_physical{112.0}=0x0 +phy_chain_tx_polarity_flip_physical{113.0}=0x0 +phy_chain_tx_polarity_flip_physical{114.0}=0x0 +phy_chain_tx_polarity_flip_physical{115.0}=0x0 +phy_chain_tx_polarity_flip_physical{116.0}=0x0 +phy_chain_tx_polarity_flip_physical{117.0}=0x1 +phy_chain_tx_polarity_flip_physical{118.0}=0x1 +phy_chain_tx_polarity_flip_physical{119.0}=0x0 +phy_chain_tx_polarity_flip_physical{120.0}=0x0 +phy_chain_tx_polarity_flip_physical{12.0}=0x0 +phy_chain_tx_polarity_flip_physical{121.0}=0x1 +phy_chain_tx_polarity_flip_physical{122.0}=0x0 +phy_chain_tx_polarity_flip_physical{123.0}=0x0 +phy_chain_tx_polarity_flip_physical{124.0}=0x0 +phy_chain_tx_polarity_flip_physical{125.0}=0x1 +phy_chain_tx_polarity_flip_physical{126.0}=0x1 +phy_chain_tx_polarity_flip_physical{127.0}=0x0 +phy_chain_tx_polarity_flip_physical{128.0}=0x0 +phy_chain_tx_polarity_flip_physical{129.0}=0x0 +phy_chain_tx_polarity_flip_physical{13.0}=0x1 +phy_chain_tx_polarity_flip_physical{131.0}=0x0 +phy_chain_tx_polarity_flip_physical{14.0}=0x1 +phy_chain_tx_polarity_flip_physical{15.0}=0x0 +phy_chain_tx_polarity_flip_physical{16.0}=0x1 +phy_chain_tx_polarity_flip_physical{17.0}=0x0 +phy_chain_tx_polarity_flip_physical{18.0}=0x0 +phy_chain_tx_polarity_flip_physical{19.0}=0x0 +phy_chain_tx_polarity_flip_physical{20.0}=0x0 +phy_chain_tx_polarity_flip_physical{2.0}=0x1 +phy_chain_tx_polarity_flip_physical{21.0}=0x1 +phy_chain_tx_polarity_flip_physical{22.0}=0x1 +phy_chain_tx_polarity_flip_physical{23.0}=0x0 +phy_chain_tx_polarity_flip_physical{24.0}=0x0 +phy_chain_tx_polarity_flip_physical{25.0}=0x0 +phy_chain_tx_polarity_flip_physical{26.0}=0x0 +phy_chain_tx_polarity_flip_physical{27.0}=0x1 +phy_chain_tx_polarity_flip_physical{28.0}=0x0 +phy_chain_tx_polarity_flip_physical{29.0}=0x0 +phy_chain_tx_polarity_flip_physical{30.0}=0x0 +phy_chain_tx_polarity_flip_physical{3.0}=0x0 +phy_chain_tx_polarity_flip_physical{31.0}=0x1 +phy_chain_tx_polarity_flip_physical{32.0}=0x1 +phy_chain_tx_polarity_flip_physical{33.0}=0x1 +phy_chain_tx_polarity_flip_physical{34.0}=0x1 +phy_chain_tx_polarity_flip_physical{35.0}=0x1 +phy_chain_tx_polarity_flip_physical{36.0}=0x1 +phy_chain_tx_polarity_flip_physical{37.0}=0x0 +phy_chain_tx_polarity_flip_physical{38.0}=0x0 +phy_chain_tx_polarity_flip_physical{39.0}=0x1 +phy_chain_tx_polarity_flip_physical{40.0}=0x1 +phy_chain_tx_polarity_flip_physical{4.0}=0x0 +phy_chain_tx_polarity_flip_physical{41.0}=0x0 +phy_chain_tx_polarity_flip_physical{42.0}=0x1 +phy_chain_tx_polarity_flip_physical{43.0}=0x1 +phy_chain_tx_polarity_flip_physical{44.0}=0x1 +phy_chain_tx_polarity_flip_physical{45.0}=0x0 +phy_chain_tx_polarity_flip_physical{46.0}=0x0 +phy_chain_tx_polarity_flip_physical{47.0}=0x1 +phy_chain_tx_polarity_flip_physical{48.0}=0x1 +phy_chain_tx_polarity_flip_physical{49.0}=0x1 +phy_chain_tx_polarity_flip_physical{50.0}=0x1 +phy_chain_tx_polarity_flip_physical{5.0}=0x1 +phy_chain_tx_polarity_flip_physical{51.0}=0x1 +phy_chain_tx_polarity_flip_physical{52.0}=0x1 +phy_chain_tx_polarity_flip_physical{53.0}=0x0 +phy_chain_tx_polarity_flip_physical{54.0}=0x0 +phy_chain_tx_polarity_flip_physical{55.0}=0x1 +phy_chain_tx_polarity_flip_physical{56.0}=0x1 +phy_chain_tx_polarity_flip_physical{57.0}=0x0 +phy_chain_tx_polarity_flip_physical{58.0}=0x1 +phy_chain_tx_polarity_flip_physical{59.0}=0x1 +phy_chain_tx_polarity_flip_physical{60.0}=0x1 +phy_chain_tx_polarity_flip_physical{6.0}=0x1 +phy_chain_tx_polarity_flip_physical{61.0}=0x0 +phy_chain_tx_polarity_flip_physical{62.0}=0x0 +phy_chain_tx_polarity_flip_physical{63.0}=0x1 +phy_chain_tx_polarity_flip_physical{64.0}=0x1 +phy_chain_tx_polarity_flip_physical{65.0}=0x1 +phy_chain_tx_polarity_flip_physical{66.0}=0x1 +phy_chain_tx_polarity_flip_physical{67.0}=0x1 +phy_chain_tx_polarity_flip_physical{68.0}=0x1 +phy_chain_tx_polarity_flip_physical{69.0}=0x0 +phy_chain_tx_polarity_flip_physical{70.0}=0x1 +phy_chain_tx_polarity_flip_physical{7.0}=0x0 +phy_chain_tx_polarity_flip_physical{71.0}=0x1 +phy_chain_tx_polarity_flip_physical{72.0}=0x1 +phy_chain_tx_polarity_flip_physical{73.0}=0x0 +phy_chain_tx_polarity_flip_physical{74.0}=0x1 +phy_chain_tx_polarity_flip_physical{75.0}=0x1 +phy_chain_tx_polarity_flip_physical{76.0}=0x1 +phy_chain_tx_polarity_flip_physical{77.0}=0x0 +phy_chain_tx_polarity_flip_physical{78.0}=0x0 +phy_chain_tx_polarity_flip_physical{79.0}=0x1 +phy_chain_tx_polarity_flip_physical{80.0}=0x1 +phy_chain_tx_polarity_flip_physical{8.0}=0x1 +phy_chain_tx_polarity_flip_physical{81.0}=0x1 +phy_chain_tx_polarity_flip_physical{82.0}=0x1 +phy_chain_tx_polarity_flip_physical{83.0}=0x1 +phy_chain_tx_polarity_flip_physical{84.0}=0x1 +phy_chain_tx_polarity_flip_physical{85.0}=0x0 +phy_chain_tx_polarity_flip_physical{86.0}=0x0 +phy_chain_tx_polarity_flip_physical{87.0}=0x1 +phy_chain_tx_polarity_flip_physical{88.0}=0x1 +phy_chain_tx_polarity_flip_physical{89.0}=0x0 +phy_chain_tx_polarity_flip_physical{90.0}=0x1 +phy_chain_tx_polarity_flip_physical{9.0}=0x1 +phy_chain_tx_polarity_flip_physical{91.0}=0x1 +phy_chain_tx_polarity_flip_physical{92.0}=0x1 +phy_chain_tx_polarity_flip_physical{93.0}=0x0 +phy_chain_tx_polarity_flip_physical{94.0}=0x0 +phy_chain_tx_polarity_flip_physical{95.0}=0x1 +phy_chain_tx_polarity_flip_physical{96.0}=0x1 +phy_chain_tx_polarity_flip_physical{97.0}=0x1 +phy_chain_tx_polarity_flip_physical{98.0}=0x1 +phy_chain_tx_polarity_flip_physical{99.0}=0x1 +portmap_103=101:100 +portmap_107=105:100 +portmap_1=1:100 +portmap_111=109:100 +portmap_115=113:100 +portmap_119=117:100 +portmap_123=121:100 +portmap_127=125:100 +portmap_130=128:10:m +portmap_13=13:100 +portmap_17=17:100 +portmap_21=21:100 +portmap_25=25:100 +portmap_29=29:100 +portmap_33=33:100 +portmap_37=37:100 +portmap_41=41:100 +portmap_45=45:100 +portmap_49=49:100 +portmap_53=53:100 +portmap_5=5:100 +portmap_57=57:100 +portmap_61=61:100 +portmap_66=129:10:m +portmap_67=65:100 +portmap_71=69:100 +portmap_75=73:100 +portmap_79=77:100 +portmap_83=81:100 +portmap_87=85:100 +portmap_91=89:100 +portmap_95=93:100 +portmap_9=9:100 +portmap_99=97:100 +serdes_core_rx_polarity_flip_physical{101}=0x9 +serdes_core_rx_polarity_flip_physical{105}=0x7 +serdes_core_rx_polarity_flip_physical{109}=0xc +serdes_core_rx_polarity_flip_physical{1}=0x8 +serdes_core_rx_polarity_flip_physical{113}=0xb +serdes_core_rx_polarity_flip_physical{117}=0xc +serdes_core_rx_polarity_flip_physical{121}=0x7 +serdes_core_rx_polarity_flip_physical{125}=0xc +serdes_core_rx_polarity_flip_physical{129}=0x0 +serdes_core_rx_polarity_flip_physical{13}=0x3 +serdes_core_rx_polarity_flip_physical{17}=0x4 +serdes_core_rx_polarity_flip_physical{21}=0x3 +serdes_core_rx_polarity_flip_physical{25}=0x6 +serdes_core_rx_polarity_flip_physical{29}=0x3 +serdes_core_rx_polarity_flip_physical{33}=0x4 +serdes_core_rx_polarity_flip_physical{37}=0x3 +serdes_core_rx_polarity_flip_physical{41}=0xc +serdes_core_rx_polarity_flip_physical{45}=0x3 +serdes_core_rx_polarity_flip_physical{49}=0x4 +serdes_core_rx_polarity_flip_physical{5}=0x2 +serdes_core_rx_polarity_flip_physical{53}=0x3 +serdes_core_rx_polarity_flip_physical{57}=0xc +serdes_core_rx_polarity_flip_physical{61}=0x3 +serdes_core_rx_polarity_flip_physical{65}=0xb +serdes_core_rx_polarity_flip_physical{69}=0xc +serdes_core_rx_polarity_flip_physical{73}=0x7 +serdes_core_rx_polarity_flip_physical{77}=0xc +serdes_core_rx_polarity_flip_physical{81}=0xb +serdes_core_rx_polarity_flip_physical{85}=0xc +serdes_core_rx_polarity_flip_physical{89}=0x7 +serdes_core_rx_polarity_flip_physical{9}=0xc +serdes_core_rx_polarity_flip_physical{93}=0xc +serdes_core_rx_polarity_flip_physical{97}=0xb +serdes_core_tx_polarity_flip_physical{101}=0x6 +serdes_core_tx_polarity_flip_physical{105}=0x1 +serdes_core_tx_polarity_flip_physical{109}=0x3 +serdes_core_tx_polarity_flip_physical{1}=0x3 +serdes_core_tx_polarity_flip_physical{113}=0x0 +serdes_core_tx_polarity_flip_physical{117}=0x3 +serdes_core_tx_polarity_flip_physical{121}=0x1 +serdes_core_tx_polarity_flip_physical{125}=0x3 +serdes_core_tx_polarity_flip_physical{129}=0x0 +serdes_core_tx_polarity_flip_physical{13}=0xb +serdes_core_tx_polarity_flip_physical{17}=0x0 +serdes_core_tx_polarity_flip_physical{21}=0x3 +serdes_core_tx_polarity_flip_physical{25}=0x4 +serdes_core_tx_polarity_flip_physical{29}=0xc +serdes_core_tx_polarity_flip_physical{33}=0xf +serdes_core_tx_polarity_flip_physical{37}=0xc +serdes_core_tx_polarity_flip_physical{41}=0xe +serdes_core_tx_polarity_flip_physical{45}=0xc +serdes_core_tx_polarity_flip_physical{49}=0xf +serdes_core_tx_polarity_flip_physical{5}=0xb +serdes_core_tx_polarity_flip_physical{53}=0xc +serdes_core_tx_polarity_flip_physical{57}=0xe +serdes_core_tx_polarity_flip_physical{61}=0xc +serdes_core_tx_polarity_flip_physical{65}=0xf +serdes_core_tx_polarity_flip_physical{69}=0xe +serdes_core_tx_polarity_flip_physical{73}=0xe +serdes_core_tx_polarity_flip_physical{77}=0xc +serdes_core_tx_polarity_flip_physical{81}=0xf +serdes_core_tx_polarity_flip_physical{85}=0xc +serdes_core_tx_polarity_flip_physical{89}=0xe +serdes_core_tx_polarity_flip_physical{9}=0x3 +serdes_core_tx_polarity_flip_physical{93}=0xc +serdes_core_tx_polarity_flip_physical{97}=0xf +serdes_preemphasis_1=0x14410a +serdes_preemphasis_5=0x14410a +serdes_preemphasis_9=0x14410a +serdes_preemphasis_13=0x14410a +serdes_preemphasis_17=0x14410a +serdes_preemphasis_21=0x14410a +serdes_preemphasis_25=0x14410a +serdes_preemphasis_29=0x14410a +serdes_preemphasis_33=0x14410a +serdes_preemphasis_37=0x14410a +serdes_preemphasis_41=0x14410a +serdes_preemphasis_45=0x14410a +serdes_preemphasis_49=0xf5005 +serdes_preemphasis_53=0xf5005 +serdes_preemphasis_57=0xf5005 +serdes_preemphasis_61=0xf5005 +serdes_driver_current_66=0xe +serdes_preemphasis_66=0x102804 +serdes_preemphasis_67=0xf5005 +serdes_preemphasis_71=0xf5005 +serdes_preemphasis_75=0xf5005 +serdes_preemphasis_79=0xf5005 +serdes_preemphasis_83=0x14410a +serdes_preemphasis_87=0x14410a +serdes_preemphasis_91=0x14410a +serdes_preemphasis_95=0x14410a +serdes_preemphasis_99=0x14410a +serdes_preemphasis_103=0x14410a +serdes_preemphasis_107=0x14410a +serdes_preemphasis_111=0x14410a +serdes_preemphasis_115=0x14410a +serdes_preemphasis_119=0x14410a +serdes_preemphasis_123=0x14410a +serdes_preemphasis_127=0x14410a +serdes_driver_current_130=0xe +serdes_preemphasis_130=0x102804 + +phy_an_lt_msft=1 diff --git a/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C32/pg_profile_lookup.ini b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C32/pg_profile_lookup.ini deleted file mode 100644 index 0b5d680edda7..000000000000 --- a/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C32/pg_profile_lookup.ini +++ /dev/null @@ -1,17 +0,0 @@ -# PG lossless profiles. -# speed cable size xon xoff threshold xon_offset - 10000 5m 1248 2288 35776 0 2288 - 25000 5m 1248 2288 53248 0 2288 - 40000 5m 1248 2288 66560 0 2288 - 50000 5m 1248 2288 79872 0 2288 - 100000 5m 1248 2288 165568 0 2288 - 10000 40m 1248 2288 37024 0 2288 - 25000 40m 1248 2288 56160 0 2288 - 40000 40m 1248 2288 71552 0 2288 - 50000 40m 1248 2288 85696 0 2288 - 100000 40m 1248 2288 177632 0 2288 - 10000 300m 1248 2288 46176 0 2288 - 25000 300m 1248 2288 79040 0 2288 - 40000 300m 1248 2288 108160 0 2288 - 50000 300m 1248 2288 141856 0 2288 - 100000 300m 1248 2288 268736 0 2288 diff --git a/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C32/pg_profile_lookup.ini b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C32/pg_profile_lookup.ini new file mode 120000 index 000000000000..297cddb2d223 --- /dev/null +++ b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C32/pg_profile_lookup.ini @@ -0,0 +1 @@ +BALANCED/pg_profile_lookup.ini \ No newline at end of file diff --git a/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C32/port_config.ini b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C32/port_config.ini index d3d339076a59..4b96b8cf87c9 100644 --- a/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C32/port_config.ini +++ b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C32/port_config.ini @@ -1,35 +1,35 @@ -# name lanes alias index -Ethernet0 1,2,3,4 Ethernet1/1 1 -Ethernet4 5,6,7,8 Ethernet2/1 2 -Ethernet8 9,10,11,12 Ethernet3/1 3 -Ethernet12 13,14,15,16 Ethernet4/1 4 -Ethernet16 21,22,23,24 Ethernet5/1 5 -Ethernet20 17,18,19,20 Ethernet6/1 6 -Ethernet24 25,26,27,28 Ethernet7/1 7 -Ethernet28 29,30,31,32 Ethernet8/1 8 -Ethernet32 37,38,39,40 Ethernet9/1 9 -Ethernet36 33,34,35,36 Ethernet10/1 10 -Ethernet40 41,42,43,44 Ethernet11/1 11 -Ethernet44 45,46,47,48 Ethernet12/1 12 -Ethernet48 53,54,55,56 Ethernet13/1 13 -Ethernet52 49,50,51,52 Ethernet14/1 14 -Ethernet56 57,58,59,60 Ethernet15/1 15 -Ethernet60 61,62,63,64 Ethernet16/1 16 -Ethernet64 69,70,71,72 Ethernet17/1 17 -Ethernet68 65,66,67,68 Ethernet18/1 18 -Ethernet72 73,74,75,76 Ethernet19/1 19 -Ethernet76 77,78,79,80 Ethernet20/1 20 -Ethernet80 85,86,87,88 Ethernet21/1 21 -Ethernet84 81,82,83,84 Ethernet22/1 22 -Ethernet88 89,90,91,92 Ethernet23/1 23 -Ethernet92 93,94,95,96 Ethernet24/1 24 -Ethernet96 101,102,103,104 Ethernet25/1 25 -Ethernet100 97,98,99,100 Ethernet26/1 26 -Ethernet104 105,106,107,108 Ethernet27/1 27 -Ethernet108 109,110,111,112 Ethernet28/1 28 -Ethernet112 117,118,119,120 Ethernet29/1 29 -Ethernet116 113,114,115,116 Ethernet30/1 30 -Ethernet120 121,122,123,124 Ethernet31/1 31 -Ethernet124 125,126,127,128 Ethernet32/1 32 -Ethernet128 129 Ethernet33 33 -Ethernet132 128 Ethernet34 34 +# name lanes alias index speed +Ethernet0 1,2,3,4 Ethernet1/1 1 100000 +Ethernet4 5,6,7,8 Ethernet2/1 2 100000 +Ethernet8 9,10,11,12 Ethernet3/1 3 100000 +Ethernet12 13,14,15,16 Ethernet4/1 4 100000 +Ethernet16 21,22,23,24 Ethernet5/1 5 100000 +Ethernet20 17,18,19,20 Ethernet6/1 6 100000 +Ethernet24 25,26,27,28 Ethernet7/1 7 100000 +Ethernet28 29,30,31,32 Ethernet8/1 8 100000 +Ethernet32 37,38,39,40 Ethernet9/1 9 100000 +Ethernet36 33,34,35,36 Ethernet10/1 10 100000 +Ethernet40 41,42,43,44 Ethernet11/1 11 100000 +Ethernet44 45,46,47,48 Ethernet12/1 12 100000 +Ethernet48 53,54,55,56 Ethernet13/1 13 100000 +Ethernet52 49,50,51,52 Ethernet14/1 14 100000 +Ethernet56 57,58,59,60 Ethernet15/1 15 100000 +Ethernet60 61,62,63,64 Ethernet16/1 16 100000 +Ethernet64 69,70,71,72 Ethernet17/1 17 100000 +Ethernet68 65,66,67,68 Ethernet18/1 18 100000 +Ethernet72 73,74,75,76 Ethernet19/1 19 100000 +Ethernet76 77,78,79,80 Ethernet20/1 20 100000 +Ethernet80 85,86,87,88 Ethernet21/1 21 100000 +Ethernet84 81,82,83,84 Ethernet22/1 22 100000 +Ethernet88 89,90,91,92 Ethernet23/1 23 100000 +Ethernet92 93,94,95,96 Ethernet24/1 24 100000 +Ethernet96 101,102,103,104 Ethernet25/1 25 100000 +Ethernet100 97,98,99,100 Ethernet26/1 26 100000 +Ethernet104 105,106,107,108 Ethernet27/1 27 100000 +Ethernet108 109,110,111,112 Ethernet28/1 28 100000 +Ethernet112 117,118,119,120 Ethernet29/1 29 100000 +Ethernet116 113,114,115,116 Ethernet30/1 30 100000 +Ethernet120 121,122,123,124 Ethernet31/1 31 100000 +Ethernet124 125,126,127,128 Ethernet32/1 32 100000 +Ethernet128 129 Ethernet33 33 10000 +Ethernet132 128 Ethernet34 34 10000 diff --git a/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C32/qos.json.j2 b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C32/qos.json.j2 deleted file mode 100644 index 34002048afdb..000000000000 --- a/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C32/qos.json.j2 +++ /dev/null @@ -1,21 +0,0 @@ -{%- macro generate_wred_profiles() %} - "WRED_PROFILE": { - "AZURE_LOSSLESS" : { - "wred_green_enable" : "true", - "wred_yellow_enable" : "true", - "wred_red_enable" : "true", - "ecn" : "ecn_all", - "green_max_threshold" : "2097152", - "green_min_threshold" : "250000", - "yellow_max_threshold" : "2097152", - "yellow_min_threshold" : "1048576", - "red_max_threshold" : "2097152", - "red_min_threshold" : "1048576", - "green_drop_probability" : "5", - "yellow_drop_probability": "5", - "red_drop_probability" : "5" - } - }, -{%- endmacro %} - -{%- include 'qos_config.j2' %} diff --git a/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C32/qos.json.j2 b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C32/qos.json.j2 new file mode 120000 index 000000000000..aef6b6765cf2 --- /dev/null +++ b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C32/qos.json.j2 @@ -0,0 +1 @@ +BALANCED/qos.json.j2 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C32/sai.profile b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C32/sai.profile index 7d96f190de73..5163d6140f0e 100644 --- a/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C32/sai.profile +++ b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C32/sai.profile @@ -1,2 +1,2 @@ -SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/td3-a7050cx3-32s-32x100G.config.bcm +SAI_INIT_CONFIG_FILE=/etc/sai.d/config.bcm SAI_NUM_ECMP_MEMBERS=64 diff --git a/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C32/td3-a7050cx3-32s-32x100G.config.bcm b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C32/td3-a7050cx3-32s-32x100G.config.bcm deleted file mode 100644 index 09354d6fd8e7..000000000000 --- a/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-C32/td3-a7050cx3-32s-32x100G.config.bcm +++ /dev/null @@ -1,502 +0,0 @@ -arl_clean_timeout_usec=15000000 -asf_mem_profile=2 -bcm_num_cos=10 -bcm_stat_flags=1 -bcm_stat_jumbo=9236 -bcm_tunnel_term_compatible_mode=1 -cdma_timeout_usec=15000000 -core_clock_frequency=1525 -dma_desc_timeout_usec=15000000 -dpp_clock_ratio=2:3 -fpem_mem_entries=0 -higig2_hdr_mode=1 -ifp_inports_support_enable=1 -ipv6_lpm_128b_enable=1 -l2_mem_entries=32768 -l2xmsg_mode=1 -l3_alpm_enable=2 -l3_max_ecmp_mode=1 -l3_mem_entries=16384 -max_vp_lags=0 -miim_intr_enable=0 -module_64ports=1 -multicast_l2_range=16383 -multicast_l3_range=0 -os=unix -oversubscribe_mode=1 -pbmp_xport_xe=0x4888888888888888c2222222222222222 -PHY_AN_ALLOW_PLL_CHANGE=1 -phy_an_c37_130=2 -phy_an_c37_66=2 -phy_an_c73=1 -port_flex_enable=1 -port_init_autoneg=0 -port_phy_addr=0xff -robust_hash_disable_egress_vlan=1 -robust_hash_disable_mpls=1 -robust_hash_disable_vlan=1 -stable_size=0x5500000 -tdma_timeout_usec=15000000 -tslam_timeout_usec=15000000 -phy_chain_rx_lane_map_physical{1.0}=0x1302 -phy_chain_rx_lane_map_physical{101.0}=0x0213 -phy_chain_rx_lane_map_physical{105.0}=0x2031 -phy_chain_rx_lane_map_physical{109.0}=0x0213 -phy_chain_rx_lane_map_physical{113.0}=0x2130 -phy_chain_rx_lane_map_physical{117.0}=0x0213 -phy_chain_rx_lane_map_physical{121.0}=0x2031 -phy_chain_rx_lane_map_physical{125.0}=0x0213 -phy_chain_rx_lane_map_physical{129.0}=0x3210 -phy_chain_rx_lane_map_physical{13.0}=0x3120 -phy_chain_rx_lane_map_physical{17.0}=0x1203 -phy_chain_rx_lane_map_physical{21.0}=0x3120 -phy_chain_rx_lane_map_physical{25.0}=0x3120 -phy_chain_rx_lane_map_physical{29.0}=0x3120 -phy_chain_rx_lane_map_physical{33.0}=0x1203 -phy_chain_rx_lane_map_physical{37.0}=0x3120 -phy_chain_rx_lane_map_physical{41.0}=0x3120 -phy_chain_rx_lane_map_physical{45.0}=0x3120 -phy_chain_rx_lane_map_physical{49.0}=0x1203 -phy_chain_rx_lane_map_physical{5.0}=0x3120 -phy_chain_rx_lane_map_physical{53.0}=0x3120 -phy_chain_rx_lane_map_physical{57.0}=0x3120 -phy_chain_rx_lane_map_physical{61.0}=0x3120 -phy_chain_rx_lane_map_physical{65.0}=0x2130 -phy_chain_rx_lane_map_physical{69.0}=0x0213 -phy_chain_rx_lane_map_physical{73.0}=0x2031 -phy_chain_rx_lane_map_physical{77.0}=0x0213 -phy_chain_rx_lane_map_physical{81.0}=0x2130 -phy_chain_rx_lane_map_physical{85.0}=0x0213 -phy_chain_rx_lane_map_physical{89.0}=0x2031 -phy_chain_rx_lane_map_physical{9.0}=0x3120 -phy_chain_rx_lane_map_physical{93.0}=0x0213 -phy_chain_rx_lane_map_physical{97.0}=0x2130 -phy_chain_rx_polarity_flip_physical{100.0}=0x1 -phy_chain_rx_polarity_flip_physical{10.0}=0x0 -phy_chain_rx_polarity_flip_physical{1.0}=0x0 -phy_chain_rx_polarity_flip_physical{101.0}=0x1 -phy_chain_rx_polarity_flip_physical{102.0}=0x0 -phy_chain_rx_polarity_flip_physical{103.0}=0x0 -phy_chain_rx_polarity_flip_physical{104.0}=0x1 -phy_chain_rx_polarity_flip_physical{105.0}=0x1 -phy_chain_rx_polarity_flip_physical{106.0}=0x1 -phy_chain_rx_polarity_flip_physical{107.0}=0x1 -phy_chain_rx_polarity_flip_physical{108.0}=0x0 -phy_chain_rx_polarity_flip_physical{109.0}=0x0 -phy_chain_rx_polarity_flip_physical{110.0}=0x0 -phy_chain_rx_polarity_flip_physical{11.0}=0x1 -phy_chain_rx_polarity_flip_physical{111.0}=0x1 -phy_chain_rx_polarity_flip_physical{112.0}=0x1 -phy_chain_rx_polarity_flip_physical{113.0}=0x1 -phy_chain_rx_polarity_flip_physical{114.0}=0x1 -phy_chain_rx_polarity_flip_physical{115.0}=0x0 -phy_chain_rx_polarity_flip_physical{116.0}=0x1 -phy_chain_rx_polarity_flip_physical{117.0}=0x0 -phy_chain_rx_polarity_flip_physical{118.0}=0x0 -phy_chain_rx_polarity_flip_physical{119.0}=0x1 -phy_chain_rx_polarity_flip_physical{120.0}=0x1 -phy_chain_rx_polarity_flip_physical{12.0}=0x1 -phy_chain_rx_polarity_flip_physical{121.0}=0x1 -phy_chain_rx_polarity_flip_physical{122.0}=0x1 -phy_chain_rx_polarity_flip_physical{123.0}=0x1 -phy_chain_rx_polarity_flip_physical{124.0}=0x0 -phy_chain_rx_polarity_flip_physical{125.0}=0x0 -phy_chain_rx_polarity_flip_physical{126.0}=0x0 -phy_chain_rx_polarity_flip_physical{127.0}=0x1 -phy_chain_rx_polarity_flip_physical{128.0}=0x1 -phy_chain_rx_polarity_flip_physical{129.0}=0x0 -phy_chain_rx_polarity_flip_physical{13.0}=0x1 -phy_chain_rx_polarity_flip_physical{131.0}=0x0 -phy_chain_rx_polarity_flip_physical{14.0}=0x1 -phy_chain_rx_polarity_flip_physical{15.0}=0x0 -phy_chain_rx_polarity_flip_physical{16.0}=0x0 -phy_chain_rx_polarity_flip_physical{17.0}=0x0 -phy_chain_rx_polarity_flip_physical{18.0}=0x0 -phy_chain_rx_polarity_flip_physical{19.0}=0x1 -phy_chain_rx_polarity_flip_physical{20.0}=0x0 -phy_chain_rx_polarity_flip_physical{2.0}=0x0 -phy_chain_rx_polarity_flip_physical{21.0}=0x1 -phy_chain_rx_polarity_flip_physical{22.0}=0x1 -phy_chain_rx_polarity_flip_physical{23.0}=0x0 -phy_chain_rx_polarity_flip_physical{24.0}=0x0 -phy_chain_rx_polarity_flip_physical{25.0}=0x0 -phy_chain_rx_polarity_flip_physical{26.0}=0x1 -phy_chain_rx_polarity_flip_physical{27.0}=0x1 -phy_chain_rx_polarity_flip_physical{28.0}=0x0 -phy_chain_rx_polarity_flip_physical{29.0}=0x1 -phy_chain_rx_polarity_flip_physical{30.0}=0x1 -phy_chain_rx_polarity_flip_physical{3.0}=0x0 -phy_chain_rx_polarity_flip_physical{31.0}=0x0 -phy_chain_rx_polarity_flip_physical{32.0}=0x0 -phy_chain_rx_polarity_flip_physical{33.0}=0x0 -phy_chain_rx_polarity_flip_physical{34.0}=0x0 -phy_chain_rx_polarity_flip_physical{35.0}=0x1 -phy_chain_rx_polarity_flip_physical{36.0}=0x0 -phy_chain_rx_polarity_flip_physical{37.0}=0x1 -phy_chain_rx_polarity_flip_physical{38.0}=0x1 -phy_chain_rx_polarity_flip_physical{39.0}=0x0 -phy_chain_rx_polarity_flip_physical{40.0}=0x0 -phy_chain_rx_polarity_flip_physical{4.0}=0x1 -phy_chain_rx_polarity_flip_physical{41.0}=0x0 -phy_chain_rx_polarity_flip_physical{42.0}=0x0 -phy_chain_rx_polarity_flip_physical{43.0}=0x1 -phy_chain_rx_polarity_flip_physical{44.0}=0x1 -phy_chain_rx_polarity_flip_physical{45.0}=0x1 -phy_chain_rx_polarity_flip_physical{46.0}=0x1 -phy_chain_rx_polarity_flip_physical{47.0}=0x0 -phy_chain_rx_polarity_flip_physical{48.0}=0x0 -phy_chain_rx_polarity_flip_physical{49.0}=0x0 -phy_chain_rx_polarity_flip_physical{50.0}=0x0 -phy_chain_rx_polarity_flip_physical{5.0}=0x0 -phy_chain_rx_polarity_flip_physical{51.0}=0x1 -phy_chain_rx_polarity_flip_physical{52.0}=0x0 -phy_chain_rx_polarity_flip_physical{53.0}=0x1 -phy_chain_rx_polarity_flip_physical{54.0}=0x1 -phy_chain_rx_polarity_flip_physical{55.0}=0x0 -phy_chain_rx_polarity_flip_physical{56.0}=0x0 -phy_chain_rx_polarity_flip_physical{57.0}=0x0 -phy_chain_rx_polarity_flip_physical{58.0}=0x0 -phy_chain_rx_polarity_flip_physical{59.0}=0x1 -phy_chain_rx_polarity_flip_physical{60.0}=0x1 -phy_chain_rx_polarity_flip_physical{6.0}=0x1 -phy_chain_rx_polarity_flip_physical{61.0}=0x1 -phy_chain_rx_polarity_flip_physical{62.0}=0x1 -phy_chain_rx_polarity_flip_physical{63.0}=0x0 -phy_chain_rx_polarity_flip_physical{64.0}=0x0 -phy_chain_rx_polarity_flip_physical{65.0}=0x1 -phy_chain_rx_polarity_flip_physical{66.0}=0x1 -phy_chain_rx_polarity_flip_physical{67.0}=0x0 -phy_chain_rx_polarity_flip_physical{68.0}=0x1 -phy_chain_rx_polarity_flip_physical{69.0}=0x0 -phy_chain_rx_polarity_flip_physical{70.0}=0x0 -phy_chain_rx_polarity_flip_physical{7.0}=0x0 -phy_chain_rx_polarity_flip_physical{71.0}=0x1 -phy_chain_rx_polarity_flip_physical{72.0}=0x1 -phy_chain_rx_polarity_flip_physical{73.0}=0x1 -phy_chain_rx_polarity_flip_physical{74.0}=0x1 -phy_chain_rx_polarity_flip_physical{75.0}=0x1 -phy_chain_rx_polarity_flip_physical{76.0}=0x0 -phy_chain_rx_polarity_flip_physical{77.0}=0x0 -phy_chain_rx_polarity_flip_physical{78.0}=0x0 -phy_chain_rx_polarity_flip_physical{79.0}=0x1 -phy_chain_rx_polarity_flip_physical{80.0}=0x1 -phy_chain_rx_polarity_flip_physical{8.0}=0x0 -phy_chain_rx_polarity_flip_physical{81.0}=0x1 -phy_chain_rx_polarity_flip_physical{82.0}=0x1 -phy_chain_rx_polarity_flip_physical{83.0}=0x0 -phy_chain_rx_polarity_flip_physical{84.0}=0x1 -phy_chain_rx_polarity_flip_physical{85.0}=0x0 -phy_chain_rx_polarity_flip_physical{86.0}=0x0 -phy_chain_rx_polarity_flip_physical{87.0}=0x1 -phy_chain_rx_polarity_flip_physical{88.0}=0x1 -phy_chain_rx_polarity_flip_physical{89.0}=0x1 -phy_chain_rx_polarity_flip_physical{90.0}=0x1 -phy_chain_rx_polarity_flip_physical{9.0}=0x0 -phy_chain_rx_polarity_flip_physical{91.0}=0x1 -phy_chain_rx_polarity_flip_physical{92.0}=0x0 -phy_chain_rx_polarity_flip_physical{93.0}=0x0 -phy_chain_rx_polarity_flip_physical{94.0}=0x0 -phy_chain_rx_polarity_flip_physical{95.0}=0x1 -phy_chain_rx_polarity_flip_physical{96.0}=0x1 -phy_chain_rx_polarity_flip_physical{97.0}=0x1 -phy_chain_rx_polarity_flip_physical{98.0}=0x1 -phy_chain_rx_polarity_flip_physical{99.0}=0x0 -phy_chain_tx_lane_map_physical{1.0}=0x3021 -phy_chain_tx_lane_map_physical{101.0}=0x3120 -phy_chain_tx_lane_map_physical{105.0}=0x1302 -phy_chain_tx_lane_map_physical{109.0}=0x2130 -phy_chain_tx_lane_map_physical{113.0}=0x1302 -phy_chain_tx_lane_map_physical{117.0}=0x3120 -phy_chain_tx_lane_map_physical{121.0}=0x1302 -phy_chain_tx_lane_map_physical{125.0}=0x3120 -phy_chain_tx_lane_map_physical{129.0}=0x3210 -phy_chain_tx_lane_map_physical{13.0}=0x0213 -phy_chain_tx_lane_map_physical{17.0}=0x2031 -phy_chain_tx_lane_map_physical{21.0}=0x0213 -phy_chain_tx_lane_map_physical{25.0}=0x2031 -phy_chain_tx_lane_map_physical{29.0}=0x1203 -phy_chain_tx_lane_map_physical{33.0}=0x2031 -phy_chain_tx_lane_map_physical{37.0}=0x0213 -phy_chain_tx_lane_map_physical{41.0}=0x2031 -phy_chain_tx_lane_map_physical{45.0}=0x1203 -phy_chain_tx_lane_map_physical{49.0}=0x2031 -phy_chain_tx_lane_map_physical{5.0}=0x1203 -phy_chain_tx_lane_map_physical{53.0}=0x0213 -phy_chain_tx_lane_map_physical{57.0}=0x2031 -phy_chain_tx_lane_map_physical{61.0}=0x1203 -phy_chain_tx_lane_map_physical{65.0}=0x1302 -phy_chain_tx_lane_map_physical{69.0}=0x1302 -phy_chain_tx_lane_map_physical{73.0}=0x1302 -phy_chain_tx_lane_map_physical{77.0}=0x2130 -phy_chain_tx_lane_map_physical{81.0}=0x1302 -phy_chain_tx_lane_map_physical{85.0}=0x3120 -phy_chain_tx_lane_map_physical{89.0}=0x1302 -phy_chain_tx_lane_map_physical{9.0}=0x0213 -phy_chain_tx_lane_map_physical{93.0}=0x2130 -phy_chain_tx_lane_map_physical{97.0}=0x1302 -phy_chain_tx_polarity_flip_physical{100.0}=0x1 -phy_chain_tx_polarity_flip_physical{10.0}=0x1 -phy_chain_tx_polarity_flip_physical{1.0}=0x1 -phy_chain_tx_polarity_flip_physical{101.0}=0x0 -phy_chain_tx_polarity_flip_physical{102.0}=0x1 -phy_chain_tx_polarity_flip_physical{103.0}=0x1 -phy_chain_tx_polarity_flip_physical{104.0}=0x0 -phy_chain_tx_polarity_flip_physical{105.0}=0x1 -phy_chain_tx_polarity_flip_physical{106.0}=0x0 -phy_chain_tx_polarity_flip_physical{107.0}=0x0 -phy_chain_tx_polarity_flip_physical{108.0}=0x0 -phy_chain_tx_polarity_flip_physical{109.0}=0x1 -phy_chain_tx_polarity_flip_physical{110.0}=0x1 -phy_chain_tx_polarity_flip_physical{11.0}=0x0 -phy_chain_tx_polarity_flip_physical{111.0}=0x0 -phy_chain_tx_polarity_flip_physical{112.0}=0x0 -phy_chain_tx_polarity_flip_physical{113.0}=0x0 -phy_chain_tx_polarity_flip_physical{114.0}=0x0 -phy_chain_tx_polarity_flip_physical{115.0}=0x0 -phy_chain_tx_polarity_flip_physical{116.0}=0x0 -phy_chain_tx_polarity_flip_physical{117.0}=0x1 -phy_chain_tx_polarity_flip_physical{118.0}=0x1 -phy_chain_tx_polarity_flip_physical{119.0}=0x0 -phy_chain_tx_polarity_flip_physical{120.0}=0x0 -phy_chain_tx_polarity_flip_physical{12.0}=0x0 -phy_chain_tx_polarity_flip_physical{121.0}=0x1 -phy_chain_tx_polarity_flip_physical{122.0}=0x0 -phy_chain_tx_polarity_flip_physical{123.0}=0x0 -phy_chain_tx_polarity_flip_physical{124.0}=0x0 -phy_chain_tx_polarity_flip_physical{125.0}=0x1 -phy_chain_tx_polarity_flip_physical{126.0}=0x1 -phy_chain_tx_polarity_flip_physical{127.0}=0x0 -phy_chain_tx_polarity_flip_physical{128.0}=0x0 -phy_chain_tx_polarity_flip_physical{129.0}=0x0 -phy_chain_tx_polarity_flip_physical{13.0}=0x1 -phy_chain_tx_polarity_flip_physical{131.0}=0x0 -phy_chain_tx_polarity_flip_physical{14.0}=0x1 -phy_chain_tx_polarity_flip_physical{15.0}=0x0 -phy_chain_tx_polarity_flip_physical{16.0}=0x1 -phy_chain_tx_polarity_flip_physical{17.0}=0x0 -phy_chain_tx_polarity_flip_physical{18.0}=0x0 -phy_chain_tx_polarity_flip_physical{19.0}=0x0 -phy_chain_tx_polarity_flip_physical{20.0}=0x0 -phy_chain_tx_polarity_flip_physical{2.0}=0x1 -phy_chain_tx_polarity_flip_physical{21.0}=0x1 -phy_chain_tx_polarity_flip_physical{22.0}=0x1 -phy_chain_tx_polarity_flip_physical{23.0}=0x0 -phy_chain_tx_polarity_flip_physical{24.0}=0x0 -phy_chain_tx_polarity_flip_physical{25.0}=0x0 -phy_chain_tx_polarity_flip_physical{26.0}=0x0 -phy_chain_tx_polarity_flip_physical{27.0}=0x1 -phy_chain_tx_polarity_flip_physical{28.0}=0x0 -phy_chain_tx_polarity_flip_physical{29.0}=0x0 -phy_chain_tx_polarity_flip_physical{30.0}=0x0 -phy_chain_tx_polarity_flip_physical{3.0}=0x0 -phy_chain_tx_polarity_flip_physical{31.0}=0x1 -phy_chain_tx_polarity_flip_physical{32.0}=0x1 -phy_chain_tx_polarity_flip_physical{33.0}=0x1 -phy_chain_tx_polarity_flip_physical{34.0}=0x1 -phy_chain_tx_polarity_flip_physical{35.0}=0x1 -phy_chain_tx_polarity_flip_physical{36.0}=0x1 -phy_chain_tx_polarity_flip_physical{37.0}=0x0 -phy_chain_tx_polarity_flip_physical{38.0}=0x0 -phy_chain_tx_polarity_flip_physical{39.0}=0x1 -phy_chain_tx_polarity_flip_physical{40.0}=0x1 -phy_chain_tx_polarity_flip_physical{4.0}=0x0 -phy_chain_tx_polarity_flip_physical{41.0}=0x0 -phy_chain_tx_polarity_flip_physical{42.0}=0x1 -phy_chain_tx_polarity_flip_physical{43.0}=0x1 -phy_chain_tx_polarity_flip_physical{44.0}=0x1 -phy_chain_tx_polarity_flip_physical{45.0}=0x0 -phy_chain_tx_polarity_flip_physical{46.0}=0x0 -phy_chain_tx_polarity_flip_physical{47.0}=0x1 -phy_chain_tx_polarity_flip_physical{48.0}=0x1 -phy_chain_tx_polarity_flip_physical{49.0}=0x1 -phy_chain_tx_polarity_flip_physical{50.0}=0x1 -phy_chain_tx_polarity_flip_physical{5.0}=0x1 -phy_chain_tx_polarity_flip_physical{51.0}=0x1 -phy_chain_tx_polarity_flip_physical{52.0}=0x1 -phy_chain_tx_polarity_flip_physical{53.0}=0x0 -phy_chain_tx_polarity_flip_physical{54.0}=0x0 -phy_chain_tx_polarity_flip_physical{55.0}=0x1 -phy_chain_tx_polarity_flip_physical{56.0}=0x1 -phy_chain_tx_polarity_flip_physical{57.0}=0x0 -phy_chain_tx_polarity_flip_physical{58.0}=0x1 -phy_chain_tx_polarity_flip_physical{59.0}=0x1 -phy_chain_tx_polarity_flip_physical{60.0}=0x1 -phy_chain_tx_polarity_flip_physical{6.0}=0x1 -phy_chain_tx_polarity_flip_physical{61.0}=0x0 -phy_chain_tx_polarity_flip_physical{62.0}=0x0 -phy_chain_tx_polarity_flip_physical{63.0}=0x1 -phy_chain_tx_polarity_flip_physical{64.0}=0x1 -phy_chain_tx_polarity_flip_physical{65.0}=0x1 -phy_chain_tx_polarity_flip_physical{66.0}=0x1 -phy_chain_tx_polarity_flip_physical{67.0}=0x1 -phy_chain_tx_polarity_flip_physical{68.0}=0x1 -phy_chain_tx_polarity_flip_physical{69.0}=0x0 -phy_chain_tx_polarity_flip_physical{70.0}=0x1 -phy_chain_tx_polarity_flip_physical{7.0}=0x0 -phy_chain_tx_polarity_flip_physical{71.0}=0x1 -phy_chain_tx_polarity_flip_physical{72.0}=0x1 -phy_chain_tx_polarity_flip_physical{73.0}=0x0 -phy_chain_tx_polarity_flip_physical{74.0}=0x1 -phy_chain_tx_polarity_flip_physical{75.0}=0x1 -phy_chain_tx_polarity_flip_physical{76.0}=0x1 -phy_chain_tx_polarity_flip_physical{77.0}=0x0 -phy_chain_tx_polarity_flip_physical{78.0}=0x0 -phy_chain_tx_polarity_flip_physical{79.0}=0x1 -phy_chain_tx_polarity_flip_physical{80.0}=0x1 -phy_chain_tx_polarity_flip_physical{8.0}=0x1 -phy_chain_tx_polarity_flip_physical{81.0}=0x1 -phy_chain_tx_polarity_flip_physical{82.0}=0x1 -phy_chain_tx_polarity_flip_physical{83.0}=0x1 -phy_chain_tx_polarity_flip_physical{84.0}=0x1 -phy_chain_tx_polarity_flip_physical{85.0}=0x0 -phy_chain_tx_polarity_flip_physical{86.0}=0x0 -phy_chain_tx_polarity_flip_physical{87.0}=0x1 -phy_chain_tx_polarity_flip_physical{88.0}=0x1 -phy_chain_tx_polarity_flip_physical{89.0}=0x0 -phy_chain_tx_polarity_flip_physical{90.0}=0x1 -phy_chain_tx_polarity_flip_physical{9.0}=0x1 -phy_chain_tx_polarity_flip_physical{91.0}=0x1 -phy_chain_tx_polarity_flip_physical{92.0}=0x1 -phy_chain_tx_polarity_flip_physical{93.0}=0x0 -phy_chain_tx_polarity_flip_physical{94.0}=0x0 -phy_chain_tx_polarity_flip_physical{95.0}=0x1 -phy_chain_tx_polarity_flip_physical{96.0}=0x1 -phy_chain_tx_polarity_flip_physical{97.0}=0x1 -phy_chain_tx_polarity_flip_physical{98.0}=0x1 -phy_chain_tx_polarity_flip_physical{99.0}=0x1 -portmap_103=101:100 -portmap_107=105:100 -portmap_1=1:100 -portmap_111=109:100 -portmap_115=113:100 -portmap_119=117:100 -portmap_123=121:100 -portmap_127=125:100 -portmap_130=128:10:m -portmap_13=13:100 -portmap_17=17:100 -portmap_21=21:100 -portmap_25=25:100 -portmap_29=29:100 -portmap_33=33:100 -portmap_37=37:100 -portmap_41=41:100 -portmap_45=45:100 -portmap_49=49:100 -portmap_53=53:100 -portmap_5=5:100 -portmap_57=57:100 -portmap_61=61:100 -portmap_66=129:10:m -portmap_67=65:100 -portmap_71=69:100 -portmap_75=73:100 -portmap_79=77:100 -portmap_83=81:100 -portmap_87=85:100 -portmap_91=89:100 -portmap_95=93:100 -portmap_9=9:100 -portmap_99=97:100 -serdes_core_rx_polarity_flip_physical{101}=0x9 -serdes_core_rx_polarity_flip_physical{105}=0x7 -serdes_core_rx_polarity_flip_physical{109}=0xc -serdes_core_rx_polarity_flip_physical{1}=0x8 -serdes_core_rx_polarity_flip_physical{113}=0xb -serdes_core_rx_polarity_flip_physical{117}=0xc -serdes_core_rx_polarity_flip_physical{121}=0x7 -serdes_core_rx_polarity_flip_physical{125}=0xc -serdes_core_rx_polarity_flip_physical{129}=0x0 -serdes_core_rx_polarity_flip_physical{13}=0x3 -serdes_core_rx_polarity_flip_physical{17}=0x4 -serdes_core_rx_polarity_flip_physical{21}=0x3 -serdes_core_rx_polarity_flip_physical{25}=0x6 -serdes_core_rx_polarity_flip_physical{29}=0x3 -serdes_core_rx_polarity_flip_physical{33}=0x4 -serdes_core_rx_polarity_flip_physical{37}=0x3 -serdes_core_rx_polarity_flip_physical{41}=0xc -serdes_core_rx_polarity_flip_physical{45}=0x3 -serdes_core_rx_polarity_flip_physical{49}=0x4 -serdes_core_rx_polarity_flip_physical{5}=0x2 -serdes_core_rx_polarity_flip_physical{53}=0x3 -serdes_core_rx_polarity_flip_physical{57}=0xc -serdes_core_rx_polarity_flip_physical{61}=0x3 -serdes_core_rx_polarity_flip_physical{65}=0xb -serdes_core_rx_polarity_flip_physical{69}=0xc -serdes_core_rx_polarity_flip_physical{73}=0x7 -serdes_core_rx_polarity_flip_physical{77}=0xc -serdes_core_rx_polarity_flip_physical{81}=0xb -serdes_core_rx_polarity_flip_physical{85}=0xc -serdes_core_rx_polarity_flip_physical{89}=0x7 -serdes_core_rx_polarity_flip_physical{9}=0xc -serdes_core_rx_polarity_flip_physical{93}=0xc -serdes_core_rx_polarity_flip_physical{97}=0xb -serdes_core_tx_polarity_flip_physical{101}=0x6 -serdes_core_tx_polarity_flip_physical{105}=0x1 -serdes_core_tx_polarity_flip_physical{109}=0x3 -serdes_core_tx_polarity_flip_physical{1}=0x3 -serdes_core_tx_polarity_flip_physical{113}=0x0 -serdes_core_tx_polarity_flip_physical{117}=0x3 -serdes_core_tx_polarity_flip_physical{121}=0x1 -serdes_core_tx_polarity_flip_physical{125}=0x3 -serdes_core_tx_polarity_flip_physical{129}=0x0 -serdes_core_tx_polarity_flip_physical{13}=0xb -serdes_core_tx_polarity_flip_physical{17}=0x0 -serdes_core_tx_polarity_flip_physical{21}=0x3 -serdes_core_tx_polarity_flip_physical{25}=0x4 -serdes_core_tx_polarity_flip_physical{29}=0xc -serdes_core_tx_polarity_flip_physical{33}=0xf -serdes_core_tx_polarity_flip_physical{37}=0xc -serdes_core_tx_polarity_flip_physical{41}=0xe -serdes_core_tx_polarity_flip_physical{45}=0xc -serdes_core_tx_polarity_flip_physical{49}=0xf -serdes_core_tx_polarity_flip_physical{5}=0xb -serdes_core_tx_polarity_flip_physical{53}=0xc -serdes_core_tx_polarity_flip_physical{57}=0xe -serdes_core_tx_polarity_flip_physical{61}=0xc -serdes_core_tx_polarity_flip_physical{65}=0xf -serdes_core_tx_polarity_flip_physical{69}=0xe -serdes_core_tx_polarity_flip_physical{73}=0xe -serdes_core_tx_polarity_flip_physical{77}=0xc -serdes_core_tx_polarity_flip_physical{81}=0xf -serdes_core_tx_polarity_flip_physical{85}=0xc -serdes_core_tx_polarity_flip_physical{89}=0xe -serdes_core_tx_polarity_flip_physical{9}=0x3 -serdes_core_tx_polarity_flip_physical{93}=0xc -serdes_core_tx_polarity_flip_physical{97}=0xf -serdes_preemphasis_1=0x14410a -serdes_preemphasis_5=0x14410a -serdes_preemphasis_9=0x14410a -serdes_preemphasis_13=0x14410a -serdes_preemphasis_17=0x14410a -serdes_preemphasis_21=0x14410a -serdes_preemphasis_25=0x14410a -serdes_preemphasis_29=0x14410a -serdes_preemphasis_33=0x14410a -serdes_preemphasis_37=0x14410a -serdes_preemphasis_41=0x14410a -serdes_preemphasis_45=0x14410a -serdes_preemphasis_49=0xf5005 -serdes_preemphasis_53=0xf5005 -serdes_preemphasis_57=0xf5005 -serdes_preemphasis_61=0xf5005 -serdes_driver_current_66=0xe -serdes_preemphasis_66=0x102804 -serdes_preemphasis_67=0xf5005 -serdes_preemphasis_71=0xf5005 -serdes_preemphasis_75=0xf5005 -serdes_preemphasis_79=0xf5005 -serdes_preemphasis_83=0x14410a -serdes_preemphasis_87=0x14410a -serdes_preemphasis_91=0x14410a -serdes_preemphasis_95=0x14410a -serdes_preemphasis_99=0x14410a -serdes_preemphasis_103=0x14410a -serdes_preemphasis_107=0x14410a -serdes_preemphasis_111=0x14410a -serdes_preemphasis_115=0x14410a -serdes_preemphasis_119=0x14410a -serdes_preemphasis_123=0x14410a -serdes_preemphasis_127=0x14410a -serdes_driver_current_130=0xe -serdes_preemphasis_130=0x102804 diff --git a/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-D48C8/BALANCED/buffers_defaults_t0.j2 b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-D48C8/BALANCED/buffers_defaults_t0.j2 new file mode 100644 index 000000000000..2470ff8b988c --- /dev/null +++ b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-D48C8/BALANCED/buffers_defaults_t0.j2 @@ -0,0 +1,53 @@ + +{%- set default_cable = '300m' %} + +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {%- for port_idx in range(0,32) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{%- endif %} + {%- endfor %} +{%- endmacro %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "32689152", + "type": "ingress", + "mode": "dynamic", + "xoff": "2058240" + }, + "egress_lossy_pool": { + "size": "24192256", + "type": "egress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "32340992", + "type": "egress", + "mode": "static" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "static_th":"32689152" + }, + "egress_lossless_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"0", + "static_th":"32340992" + }, + "egress_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"1792", + "dynamic_th":"3" + } + }, +{%- endmacro %} + +{% import 'buffers_extra_queues.j2' as defs with context %} + +{%- macro generate_queue_buffers_with_extra_lossless_queues(port_names, port_names_require_extra_buffer) %} +{{ defs.generate_queue_buffers_with_extra_lossless_queues(port_names, port_names_require_extra_buffer) }} +{%- endmacro %} diff --git a/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-D48C8/BALANCED/pg_profile_lookup.ini b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-D48C8/BALANCED/pg_profile_lookup.ini new file mode 100644 index 000000000000..5b4482bc74c7 --- /dev/null +++ b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-D48C8/BALANCED/pg_profile_lookup.ini @@ -0,0 +1,8 @@ +# PG lossless profiles. +# speed cable size xon xoff threshold xon_offset + 50000 5m 4608 4608 160000 0 4608 + 100000 5m 4608 4608 160000 0 4608 + 50000 40m 4608 4608 160000 0 4608 + 100000 40m 4608 4608 160000 0 4608 + 50000 300m 4608 4608 160000 0 4608 + 100000 300m 4608 4608 160000 0 4608 diff --git a/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-D48C8/BALANCED/qos.json.j2 b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-D48C8/BALANCED/qos.json.j2 new file mode 100644 index 000000000000..74059a27d24b --- /dev/null +++ b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-D48C8/BALANCED/qos.json.j2 @@ -0,0 +1,285 @@ +{% if 'subtype' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['subtype'] == 'DualToR' %} +{% set different_dscp_to_tc_map = true %} +{% set different_tc_to_queue_map = true %} +{%- macro generate_dscp_to_tc_map() %} + "DSCP_TO_TC_MAP": { + "AZURE": { + "0" : "1", + "1" : "1", + "2" : "1", + "3" : "3", + "4" : "4", + "5" : "1", + "6" : "1", + "7" : "1", + "8" : "0", + "9" : "1", + "10": "1", + "11": "1", + "12": "1", + "13": "1", + "14": "1", + "15": "1", + "16": "1", + "17": "1", + "18": "1", + "19": "1", + "20": "1", + "21": "1", + "22": "1", + "23": "1", + "24": "1", + "25": "1", + "26": "1", + "27": "1", + "28": "1", + "29": "1", + "30": "1", + "31": "1", + "32": "1", + "33": "8", + "34": "1", + "35": "1", + "36": "1", + "37": "1", + "38": "1", + "39": "1", + "40": "1", + "41": "1", + "42": "1", + "43": "1", + "44": "1", + "45": "1", + "46": "5", + "47": "1", + "48": "7", + "49": "1", + "50": "1", + "51": "1", + "52": "1", + "53": "1", + "54": "1", + "55": "1", + "56": "1", + "57": "1", + "58": "1", + "59": "1", + "60": "1", + "61": "1", + "62": "1", + "63": "1" + }, + "AZURE_UPLINK": { + "0" : "1", + "1" : "1", + "2" : "2", + "3" : "3", + "4" : "4", + "5" : "1", + "6" : "6", + "7" : "1", + "8" : "0", + "9" : "1", + "10": "1", + "11": "1", + "12": "1", + "13": "1", + "14": "1", + "15": "1", + "16": "1", + "17": "1", + "18": "1", + "19": "1", + "20": "1", + "21": "1", + "22": "1", + "23": "1", + "24": "1", + "25": "1", + "26": "1", + "27": "1", + "28": "1", + "29": "1", + "30": "1", + "31": "1", + "32": "1", + "33": "8", + "34": "1", + "35": "1", + "36": "1", + "37": "1", + "38": "1", + "39": "1", + "40": "1", + "41": "1", + "42": "1", + "43": "1", + "44": "1", + "45": "1", + "46": "5", + "47": "1", + "48": "7", + "49": "1", + "50": "1", + "51": "1", + "52": "1", + "53": "1", + "54": "1", + "55": "1", + "56": "1", + "57": "1", + "58": "1", + "59": "1", + "60": "1", + "61": "1", + "62": "1", + "63": "1" + }, + "AZURE_TUNNEL": { + "0" : "1", + "1" : "1", + "2" : "1", + "3" : "3", + "4" : "4", + "5" : "1", + "6" : "1", + "7" : "1", + "8" : "0", + "9" : "1", + "10": "1", + "11": "1", + "12": "1", + "13": "1", + "14": "1", + "15": "1", + "16": "1", + "17": "1", + "18": "1", + "19": "1", + "20": "1", + "21": "1", + "22": "1", + "23": "1", + "24": "1", + "25": "1", + "26": "1", + "27": "1", + "28": "1", + "29": "1", + "30": "1", + "31": "1", + "32": "1", + "33": "8", + "34": "1", + "35": "1", + "36": "1", + "37": "1", + "38": "1", + "39": "1", + "40": "1", + "41": "1", + "42": "1", + "43": "1", + "44": "1", + "45": "1", + "46": "5", + "47": "1", + "48": "7", + "49": "1", + "50": "1", + "51": "1", + "52": "1", + "53": "1", + "54": "1", + "55": "1", + "56": "1", + "57": "1", + "58": "1", + "59": "1", + "60": "1", + "61": "1", + "62": "1", + "63": "1" + } + }, +{%- endmacro %} +{%- macro generate_tc_to_pg_map() %} + "TC_TO_PRIORITY_GROUP_MAP": { + "AZURE": { + "0": "0", + "1": "0", + "2": "2", + "3": "3", + "4": "4", + "5": "0", + "6": "6", + "7": "0", + "8": "0" + }, + "AZURE_TUNNEL": { + "0": "0", + "1": "0", + "2": "0", + "3": "2", + "4": "6", + "5": "0", + "6": "0", + "7": "0", + "8": "0" + } + }, +{%- endmacro %} +{%- macro generate_tc_to_queue_map() %} + "TC_TO_QUEUE_MAP": { + "AZURE": { + "0": "0", + "1": "1", + "2": "1", + "3": "3", + "4": "4", + "5": "5", + "6": "1", + "7": "7", + "8": "1" + }, + "AZURE_UPLINK": { + "0": "0", + "1": "1", + "2": "2", + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7", + "8": "1" + }, + "AZURE_TUNNEL": { + "0": "0", + "1": "1", + "2": "1", + "3": "2", + "4": "6", + "5": "5", + "6": "1", + "7": "7", + "8": "1" + } + }, +{%- endmacro %} +{%- macro generate_tc_to_dscp_map() %} + "TC_TO_DSCP_MAP": { + "AZURE_TUNNEL": { + "0": "8", + "1": "0", + "2": "0", + "3": "2", + "4": "6", + "5": "46", + "6": "0", + "7": "48", + "8": "33" + } + }, +{%- endmacro %} +{% endif %} +{%- include 'qos_config.j2' %} diff --git a/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-D48C8/RDMA-CENTRIC b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-D48C8/RDMA-CENTRIC new file mode 120000 index 000000000000..d6f7127aa748 --- /dev/null +++ b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-D48C8/RDMA-CENTRIC @@ -0,0 +1 @@ +BALANCED \ No newline at end of file diff --git a/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-D48C8/TCP-CENTRIC b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-D48C8/TCP-CENTRIC new file mode 120000 index 000000000000..d6f7127aa748 --- /dev/null +++ b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-D48C8/TCP-CENTRIC @@ -0,0 +1 @@ +BALANCED \ No newline at end of file diff --git a/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-D48C8/buffers_defaults_t0.j2 b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-D48C8/buffers_defaults_t0.j2 deleted file mode 100644 index 1430479d08e0..000000000000 --- a/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-D48C8/buffers_defaults_t0.j2 +++ /dev/null @@ -1,61 +0,0 @@ -{%- set default_cable = '5m' %} - -{%- macro generate_port_lists(PORT_ALL) %} - {# Generate list of ports #} - {%- for port_idx in range(0,6) %} - {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{%- endif %} - {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 2)) %}{%- endif %} - {%- endfor %} - {%- for port_idx in range(10,22) %} - {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{%- endif %} - {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 2)) %}{%- endif %} - {%- endfor %} - {%- for port_idx in range(26,32) %} - {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{%- endif %} - {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 2)) %}{%- endif %} - {%- endfor %} - {%- for port_idx in range(6,10) %} - {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{%- endif %} - {%- endfor %} - {%- for port_idx in range(22,26) %} - {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{%- endif %} - {%- endfor %} -{%- endmacro %} - -{%- macro generate_buffer_pool_and_profiles() %} - "BUFFER_POOL": { - "ingress_lossless_pool": { - "size": "10875072", - "type": "ingress", - "mode": "dynamic", - "xoff": "4194112" - }, - "egress_lossy_pool": { - "size": "9243812", - "type": "egress", - "mode": "dynamic" - }, - "egress_lossless_pool": { - "size": "15982720", - "type": "egress", - "mode": "static" - } - }, - "BUFFER_PROFILE": { - "ingress_lossy_profile": { - "pool":"[BUFFER_POOL|ingress_lossless_pool]", - "size":"0", - "dynamic_th":"3" - }, - "egress_lossless_profile": { - "pool":"[BUFFER_POOL|egress_lossless_pool]", - "size":"1518", - "static_th":"15982720" - }, - "egress_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"1518", - "dynamic_th":"3" - } - }, -{%- endmacro %} diff --git a/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-D48C8/buffers_defaults_t0.j2 b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-D48C8/buffers_defaults_t0.j2 new file mode 120000 index 000000000000..9524e6a476ac --- /dev/null +++ b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-D48C8/buffers_defaults_t0.j2 @@ -0,0 +1 @@ +BALANCED/buffers_defaults_t0.j2 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-D48C8/buffers_extra_queues.j2 b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-D48C8/buffers_extra_queues.j2 new file mode 100644 index 000000000000..336079e9e3d9 --- /dev/null +++ b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-D48C8/buffers_extra_queues.j2 @@ -0,0 +1,37 @@ +{% if DEVICE_METADATA is defined and 'subtype' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['subtype'] == 'DualToR' %} +{%- macro generate_queue_buffers_with_extra_lossless_queues(port_names, port_names_require_extra_buffer) %} + "BUFFER_QUEUE": { +{% for port in port_names.split(',') %} +{% if port in port_names_require_extra_buffer.split(',') %} + "{{ port }}|0-1": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "{{ port }}|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "{{ port }}|5": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "{{ port }}|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "{{ port }}|7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }{% if not loop.last %},{% endif %} + +{% else %} + "{{ port }}|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "{{ port }}|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "{{ port }}|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }{% if not loop.last %},{% endif %} + +{% endif %} +{% endfor %} + } +{% endmacro %} +{% endif %} diff --git a/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-D48C8/config.bcm.j2 b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-D48C8/config.bcm.j2 new file mode 100644 index 000000000000..26ce93bcdda1 --- /dev/null +++ b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-D48C8/config.bcm.j2 @@ -0,0 +1,575 @@ +{# Construct config.bcm to include additional soc properties per specific device metadata requirement #} +{%- set map_prio = '' -%} +{%- if DEVICE_METADATA is defined and DEVICE_METADATA['localhost'] is defined and DEVICE_METADATA['localhost']['subtype'] is defined -%} +{%- set switch_subtype = DEVICE_METADATA['localhost']['subtype'] -%} +{%- if 'dualtor' in switch_subtype.lower() %} +{%- set map_prio = 'sai_remap_prio_on_tnl_egress=1' -%} +{%- endif %} +{%- endif %} +sai_load_hw_config=/etc/bcm/flex/bcm56870_a0_issu/b870.6.4.1/ +l3_alpm_hit_skip=1 +sai_adjust_acl_drop_in_rx_drop=1 +sai_verify_incoming_chksum=0 +{{ map_prio }} +host_as_route_disable=1 +use_all_splithorizon_groups=1 +riot_enable=1 +sai_tunnel_support=1 +sai_tunnel_underlay_route_mode=1 +riot_overlay_l3_intf_mem_size=4096 +riot_overlay_l3_egress_mem_size=32768 +l3_ecmp_levels=2 +riot_overlay_ecmp_resilient_hash_size=16384 +flow_init_mode=1 +arl_clean_timeout_usec=15000000 +asf_mem_profile=2 +bcm_num_cos=10 +bcm_stat_flags=1 +bcm_stat_jumbo=9236 +bcm_tunnel_term_compatible_mode=1 +cdma_timeout_usec=15000000 +core_clock_frequency=1525 +dma_desc_timeout_usec=15000000 +dpp_clock_ratio=2:3 +fpem_mem_entries=0 +higig2_hdr_mode=1 +ifp_inports_support_enable=1 +ipv6_lpm_128b_enable=1 +l2_mem_entries=32768 +l2xmsg_mode=1 +l3_alpm_enable=2 +l3_max_ecmp_mode=1 +l3_mem_entries=16384 +max_vp_lags=0 +miim_intr_enable=0 +module_64ports=1 +multicast_l2_range=16383 +multicast_l3_range=0 +os=unix +oversubscribe_mode=1 +pbmp_xport_xe=0x7ffffffffffffffffffffffffffffffffe +PHY_AN_ALLOW_PLL_CHANGE=1 +phy_an_c37_130=2 +phy_an_c37_66=2 +phy_an_c73=1 +port_flex_enable=1 +port_init_autoneg=0 +port_phy_addr=0xff +robust_hash_disable_egress_vlan=1 +robust_hash_disable_mpls=1 +robust_hash_disable_vlan=1 +stable_size=0x5500000 +tdma_timeout_usec=15000000 +tslam_timeout_usec=15000000 +sai_optimized_mmu=1 +mmu_init_config="TD3-MSFT-CUSTOM" +buf.map.egress_pool0.ingress_pool=0 +buf.map.egress_pool1.ingress_pool=0 +buf.map.egress_pool2.ingress_pool=1 +phy_chain_rx_lane_map_physical{1.0}=0x1302 +phy_chain_rx_lane_map_physical{5.0}=0x3120 +phy_chain_rx_lane_map_physical{9.0}=0x3120 +phy_chain_rx_lane_map_physical{13.0}=0x3120 +phy_chain_rx_lane_map_physical{17.0}=0x1203 +phy_chain_rx_lane_map_physical{21.0}=0x3120 +phy_chain_rx_lane_map_physical{25.0}=0x3120 +phy_chain_rx_lane_map_physical{29.0}=0x3120 +phy_chain_rx_lane_map_physical{33.0}=0x1203 +phy_chain_rx_lane_map_physical{37.0}=0x3120 +phy_chain_rx_lane_map_physical{41.0}=0x3120 +phy_chain_rx_lane_map_physical{45.0}=0x3120 +phy_chain_rx_lane_map_physical{49.0}=0x1203 +phy_chain_rx_lane_map_physical{53.0}=0x3120 +phy_chain_rx_lane_map_physical{57.0}=0x3120 +phy_chain_rx_lane_map_physical{61.0}=0x3120 +phy_chain_rx_lane_map_physical{65.0}=0x2130 +phy_chain_rx_lane_map_physical{69.0}=0x0213 +phy_chain_rx_lane_map_physical{73.0}=0x2031 +phy_chain_rx_lane_map_physical{77.0}=0x0213 +phy_chain_rx_lane_map_physical{81.0}=0x2130 +phy_chain_rx_lane_map_physical{85.0}=0x0213 +phy_chain_rx_lane_map_physical{89.0}=0x2031 +phy_chain_rx_lane_map_physical{93.0}=0x0213 +phy_chain_rx_lane_map_physical{97.0}=0x2130 +phy_chain_rx_lane_map_physical{101.0}=0x0213 +phy_chain_rx_lane_map_physical{105.0}=0x2031 +phy_chain_rx_lane_map_physical{109.0}=0x0213 +phy_chain_rx_lane_map_physical{113.0}=0x2130 +phy_chain_rx_lane_map_physical{117.0}=0x0213 +phy_chain_rx_lane_map_physical{121.0}=0x2031 +phy_chain_rx_lane_map_physical{125.0}=0x0213 +phy_chain_rx_lane_map_physical{129.0}=0x3210 +phy_chain_rx_polarity_flip_physical{1.0}=0x0 +phy_chain_rx_polarity_flip_physical{2.0}=0x0 +phy_chain_rx_polarity_flip_physical{3.0}=0x0 +phy_chain_rx_polarity_flip_physical{4.0}=0x1 +phy_chain_rx_polarity_flip_physical{5.0}=0x0 +phy_chain_rx_polarity_flip_physical{6.0}=0x1 +phy_chain_rx_polarity_flip_physical{7.0}=0x0 +phy_chain_rx_polarity_flip_physical{8.0}=0x0 +phy_chain_rx_polarity_flip_physical{9.0}=0x0 +phy_chain_rx_polarity_flip_physical{10.0}=0x0 +phy_chain_rx_polarity_flip_physical{11.0}=0x1 +phy_chain_rx_polarity_flip_physical{12.0}=0x1 +phy_chain_rx_polarity_flip_physical{13.0}=0x1 +phy_chain_rx_polarity_flip_physical{14.0}=0x1 +phy_chain_rx_polarity_flip_physical{15.0}=0x0 +phy_chain_rx_polarity_flip_physical{16.0}=0x0 +phy_chain_rx_polarity_flip_physical{17.0}=0x0 +phy_chain_rx_polarity_flip_physical{18.0}=0x0 +phy_chain_rx_polarity_flip_physical{19.0}=0x1 +phy_chain_rx_polarity_flip_physical{20.0}=0x0 +phy_chain_rx_polarity_flip_physical{21.0}=0x1 +phy_chain_rx_polarity_flip_physical{22.0}=0x1 +phy_chain_rx_polarity_flip_physical{23.0}=0x0 +phy_chain_rx_polarity_flip_physical{24.0}=0x0 +phy_chain_rx_polarity_flip_physical{25.0}=0x0 +phy_chain_rx_polarity_flip_physical{26.0}=0x1 +phy_chain_rx_polarity_flip_physical{27.0}=0x1 +phy_chain_rx_polarity_flip_physical{28.0}=0x0 +phy_chain_rx_polarity_flip_physical{29.0}=0x1 +phy_chain_rx_polarity_flip_physical{30.0}=0x1 +phy_chain_rx_polarity_flip_physical{31.0}=0x0 +phy_chain_rx_polarity_flip_physical{32.0}=0x0 +phy_chain_rx_polarity_flip_physical{33.0}=0x0 +phy_chain_rx_polarity_flip_physical{34.0}=0x0 +phy_chain_rx_polarity_flip_physical{35.0}=0x1 +phy_chain_rx_polarity_flip_physical{36.0}=0x0 +phy_chain_rx_polarity_flip_physical{37.0}=0x1 +phy_chain_rx_polarity_flip_physical{38.0}=0x1 +phy_chain_rx_polarity_flip_physical{39.0}=0x0 +phy_chain_rx_polarity_flip_physical{40.0}=0x0 +phy_chain_rx_polarity_flip_physical{41.0}=0x0 +phy_chain_rx_polarity_flip_physical{42.0}=0x0 +phy_chain_rx_polarity_flip_physical{43.0}=0x1 +phy_chain_rx_polarity_flip_physical{44.0}=0x1 +phy_chain_rx_polarity_flip_physical{45.0}=0x1 +phy_chain_rx_polarity_flip_physical{46.0}=0x1 +phy_chain_rx_polarity_flip_physical{47.0}=0x0 +phy_chain_rx_polarity_flip_physical{48.0}=0x0 +phy_chain_rx_polarity_flip_physical{49.0}=0x0 +phy_chain_rx_polarity_flip_physical{50.0}=0x0 +phy_chain_rx_polarity_flip_physical{51.0}=0x1 +phy_chain_rx_polarity_flip_physical{52.0}=0x0 +phy_chain_rx_polarity_flip_physical{53.0}=0x1 +phy_chain_rx_polarity_flip_physical{54.0}=0x1 +phy_chain_rx_polarity_flip_physical{55.0}=0x0 +phy_chain_rx_polarity_flip_physical{56.0}=0x0 +phy_chain_rx_polarity_flip_physical{57.0}=0x0 +phy_chain_rx_polarity_flip_physical{58.0}=0x0 +phy_chain_rx_polarity_flip_physical{59.0}=0x1 +phy_chain_rx_polarity_flip_physical{60.0}=0x1 +phy_chain_rx_polarity_flip_physical{61.0}=0x1 +phy_chain_rx_polarity_flip_physical{62.0}=0x1 +phy_chain_rx_polarity_flip_physical{63.0}=0x0 +phy_chain_rx_polarity_flip_physical{64.0}=0x0 +phy_chain_rx_polarity_flip_physical{65.0}=0x1 +phy_chain_rx_polarity_flip_physical{66.0}=0x1 +phy_chain_rx_polarity_flip_physical{67.0}=0x0 +phy_chain_rx_polarity_flip_physical{68.0}=0x1 +phy_chain_rx_polarity_flip_physical{69.0}=0x0 +phy_chain_rx_polarity_flip_physical{70.0}=0x0 +phy_chain_rx_polarity_flip_physical{71.0}=0x1 +phy_chain_rx_polarity_flip_physical{72.0}=0x1 +phy_chain_rx_polarity_flip_physical{73.0}=0x1 +phy_chain_rx_polarity_flip_physical{74.0}=0x1 +phy_chain_rx_polarity_flip_physical{75.0}=0x1 +phy_chain_rx_polarity_flip_physical{76.0}=0x0 +phy_chain_rx_polarity_flip_physical{77.0}=0x0 +phy_chain_rx_polarity_flip_physical{78.0}=0x0 +phy_chain_rx_polarity_flip_physical{79.0}=0x1 +phy_chain_rx_polarity_flip_physical{80.0}=0x1 +phy_chain_rx_polarity_flip_physical{81.0}=0x1 +phy_chain_rx_polarity_flip_physical{82.0}=0x1 +phy_chain_rx_polarity_flip_physical{83.0}=0x0 +phy_chain_rx_polarity_flip_physical{84.0}=0x1 +phy_chain_rx_polarity_flip_physical{85.0}=0x0 +phy_chain_rx_polarity_flip_physical{86.0}=0x0 +phy_chain_rx_polarity_flip_physical{87.0}=0x1 +phy_chain_rx_polarity_flip_physical{88.0}=0x1 +phy_chain_rx_polarity_flip_physical{89.0}=0x1 +phy_chain_rx_polarity_flip_physical{90.0}=0x1 +phy_chain_rx_polarity_flip_physical{91.0}=0x1 +phy_chain_rx_polarity_flip_physical{92.0}=0x0 +phy_chain_rx_polarity_flip_physical{93.0}=0x0 +phy_chain_rx_polarity_flip_physical{94.0}=0x0 +phy_chain_rx_polarity_flip_physical{95.0}=0x1 +phy_chain_rx_polarity_flip_physical{96.0}=0x1 +phy_chain_rx_polarity_flip_physical{97.0}=0x1 +phy_chain_rx_polarity_flip_physical{98.0}=0x1 +phy_chain_rx_polarity_flip_physical{99.0}=0x0 +phy_chain_rx_polarity_flip_physical{100.0}=0x1 +phy_chain_rx_polarity_flip_physical{101.0}=0x1 +phy_chain_rx_polarity_flip_physical{102.0}=0x0 +phy_chain_rx_polarity_flip_physical{103.0}=0x0 +phy_chain_rx_polarity_flip_physical{104.0}=0x1 +phy_chain_rx_polarity_flip_physical{105.0}=0x1 +phy_chain_rx_polarity_flip_physical{106.0}=0x1 +phy_chain_rx_polarity_flip_physical{107.0}=0x1 +phy_chain_rx_polarity_flip_physical{108.0}=0x0 +phy_chain_rx_polarity_flip_physical{109.0}=0x0 +phy_chain_rx_polarity_flip_physical{110.0}=0x0 +phy_chain_rx_polarity_flip_physical{111.0}=0x1 +phy_chain_rx_polarity_flip_physical{112.0}=0x1 +phy_chain_rx_polarity_flip_physical{113.0}=0x1 +phy_chain_rx_polarity_flip_physical{114.0}=0x1 +phy_chain_rx_polarity_flip_physical{115.0}=0x0 +phy_chain_rx_polarity_flip_physical{116.0}=0x1 +phy_chain_rx_polarity_flip_physical{117.0}=0x0 +phy_chain_rx_polarity_flip_physical{118.0}=0x0 +phy_chain_rx_polarity_flip_physical{119.0}=0x1 +phy_chain_rx_polarity_flip_physical{120.0}=0x1 +phy_chain_rx_polarity_flip_physical{121.0}=0x1 +phy_chain_rx_polarity_flip_physical{122.0}=0x1 +phy_chain_rx_polarity_flip_physical{123.0}=0x1 +phy_chain_rx_polarity_flip_physical{124.0}=0x0 +phy_chain_rx_polarity_flip_physical{125.0}=0x0 +phy_chain_rx_polarity_flip_physical{126.0}=0x0 +phy_chain_rx_polarity_flip_physical{127.0}=0x1 +phy_chain_rx_polarity_flip_physical{128.0}=0x1 +phy_chain_rx_polarity_flip_physical{129.0}=0x0 +phy_chain_rx_polarity_flip_physical{131.0}=0x0 +phy_chain_tx_lane_map_physical{1.0}=0x3021 +phy_chain_tx_lane_map_physical{5.0}=0x1203 +phy_chain_tx_lane_map_physical{9.0}=0x0213 +phy_chain_tx_lane_map_physical{13.0}=0x0213 +phy_chain_tx_lane_map_physical{17.0}=0x2031 +phy_chain_tx_lane_map_physical{21.0}=0x0213 +phy_chain_tx_lane_map_physical{25.0}=0x2031 +phy_chain_tx_lane_map_physical{29.0}=0x1203 +phy_chain_tx_lane_map_physical{33.0}=0x2031 +phy_chain_tx_lane_map_physical{37.0}=0x0213 +phy_chain_tx_lane_map_physical{41.0}=0x2031 +phy_chain_tx_lane_map_physical{45.0}=0x1203 +phy_chain_tx_lane_map_physical{49.0}=0x2031 +phy_chain_tx_lane_map_physical{53.0}=0x0213 +phy_chain_tx_lane_map_physical{57.0}=0x2031 +phy_chain_tx_lane_map_physical{61.0}=0x1203 +phy_chain_tx_lane_map_physical{65.0}=0x1302 +phy_chain_tx_lane_map_physical{69.0}=0x1302 +phy_chain_tx_lane_map_physical{73.0}=0x1302 +phy_chain_tx_lane_map_physical{77.0}=0x2130 +phy_chain_tx_lane_map_physical{81.0}=0x1302 +phy_chain_tx_lane_map_physical{85.0}=0x3120 +phy_chain_tx_lane_map_physical{89.0}=0x1302 +phy_chain_tx_lane_map_physical{93.0}=0x2130 +phy_chain_tx_lane_map_physical{97.0}=0x1302 +phy_chain_tx_lane_map_physical{101.0}=0x3120 +phy_chain_tx_lane_map_physical{105.0}=0x1302 +phy_chain_tx_lane_map_physical{109.0}=0x2130 +phy_chain_tx_lane_map_physical{113.0}=0x1302 +phy_chain_tx_lane_map_physical{117.0}=0x3120 +phy_chain_tx_lane_map_physical{121.0}=0x1302 +phy_chain_tx_lane_map_physical{125.0}=0x3120 +phy_chain_tx_lane_map_physical{129.0}=0x3210 +phy_chain_tx_polarity_flip_physical{1.0}=0x1 +phy_chain_tx_polarity_flip_physical{2.0}=0x1 +phy_chain_tx_polarity_flip_physical{3.0}=0x0 +phy_chain_tx_polarity_flip_physical{4.0}=0x0 +phy_chain_tx_polarity_flip_physical{5.0}=0x1 +phy_chain_tx_polarity_flip_physical{6.0}=0x1 +phy_chain_tx_polarity_flip_physical{7.0}=0x0 +phy_chain_tx_polarity_flip_physical{8.0}=0x1 +phy_chain_tx_polarity_flip_physical{9.0}=0x1 +phy_chain_tx_polarity_flip_physical{10.0}=0x1 +phy_chain_tx_polarity_flip_physical{11.0}=0x0 +phy_chain_tx_polarity_flip_physical{12.0}=0x0 +phy_chain_tx_polarity_flip_physical{13.0}=0x1 +phy_chain_tx_polarity_flip_physical{14.0}=0x1 +phy_chain_tx_polarity_flip_physical{15.0}=0x0 +phy_chain_tx_polarity_flip_physical{16.0}=0x1 +phy_chain_tx_polarity_flip_physical{17.0}=0x0 +phy_chain_tx_polarity_flip_physical{18.0}=0x0 +phy_chain_tx_polarity_flip_physical{19.0}=0x0 +phy_chain_tx_polarity_flip_physical{20.0}=0x0 +phy_chain_tx_polarity_flip_physical{21.0}=0x1 +phy_chain_tx_polarity_flip_physical{22.0}=0x1 +phy_chain_tx_polarity_flip_physical{23.0}=0x0 +phy_chain_tx_polarity_flip_physical{24.0}=0x0 +phy_chain_tx_polarity_flip_physical{25.0}=0x0 +phy_chain_tx_polarity_flip_physical{26.0}=0x0 +phy_chain_tx_polarity_flip_physical{27.0}=0x1 +phy_chain_tx_polarity_flip_physical{28.0}=0x0 +phy_chain_tx_polarity_flip_physical{29.0}=0x0 +phy_chain_tx_polarity_flip_physical{30.0}=0x0 +phy_chain_tx_polarity_flip_physical{31.0}=0x1 +phy_chain_tx_polarity_flip_physical{32.0}=0x1 +phy_chain_tx_polarity_flip_physical{33.0}=0x1 +phy_chain_tx_polarity_flip_physical{34.0}=0x1 +phy_chain_tx_polarity_flip_physical{35.0}=0x1 +phy_chain_tx_polarity_flip_physical{36.0}=0x1 +phy_chain_tx_polarity_flip_physical{37.0}=0x0 +phy_chain_tx_polarity_flip_physical{38.0}=0x0 +phy_chain_tx_polarity_flip_physical{39.0}=0x1 +phy_chain_tx_polarity_flip_physical{40.0}=0x1 +phy_chain_tx_polarity_flip_physical{41.0}=0x0 +phy_chain_tx_polarity_flip_physical{42.0}=0x1 +phy_chain_tx_polarity_flip_physical{43.0}=0x1 +phy_chain_tx_polarity_flip_physical{44.0}=0x1 +phy_chain_tx_polarity_flip_physical{45.0}=0x0 +phy_chain_tx_polarity_flip_physical{46.0}=0x0 +phy_chain_tx_polarity_flip_physical{47.0}=0x1 +phy_chain_tx_polarity_flip_physical{48.0}=0x1 +phy_chain_tx_polarity_flip_physical{49.0}=0x1 +phy_chain_tx_polarity_flip_physical{50.0}=0x1 +phy_chain_tx_polarity_flip_physical{51.0}=0x1 +phy_chain_tx_polarity_flip_physical{52.0}=0x1 +phy_chain_tx_polarity_flip_physical{53.0}=0x0 +phy_chain_tx_polarity_flip_physical{54.0}=0x0 +phy_chain_tx_polarity_flip_physical{55.0}=0x1 +phy_chain_tx_polarity_flip_physical{56.0}=0x1 +phy_chain_tx_polarity_flip_physical{57.0}=0x0 +phy_chain_tx_polarity_flip_physical{58.0}=0x1 +phy_chain_tx_polarity_flip_physical{59.0}=0x1 +phy_chain_tx_polarity_flip_physical{60.0}=0x1 +phy_chain_tx_polarity_flip_physical{61.0}=0x0 +phy_chain_tx_polarity_flip_physical{62.0}=0x0 +phy_chain_tx_polarity_flip_physical{63.0}=0x1 +phy_chain_tx_polarity_flip_physical{64.0}=0x1 +phy_chain_tx_polarity_flip_physical{65.0}=0x1 +phy_chain_tx_polarity_flip_physical{66.0}=0x1 +phy_chain_tx_polarity_flip_physical{67.0}=0x1 +phy_chain_tx_polarity_flip_physical{68.0}=0x1 +phy_chain_tx_polarity_flip_physical{69.0}=0x0 +phy_chain_tx_polarity_flip_physical{70.0}=0x1 +phy_chain_tx_polarity_flip_physical{71.0}=0x1 +phy_chain_tx_polarity_flip_physical{72.0}=0x1 +phy_chain_tx_polarity_flip_physical{73.0}=0x0 +phy_chain_tx_polarity_flip_physical{74.0}=0x1 +phy_chain_tx_polarity_flip_physical{75.0}=0x1 +phy_chain_tx_polarity_flip_physical{76.0}=0x1 +phy_chain_tx_polarity_flip_physical{77.0}=0x0 +phy_chain_tx_polarity_flip_physical{78.0}=0x0 +phy_chain_tx_polarity_flip_physical{79.0}=0x1 +phy_chain_tx_polarity_flip_physical{80.0}=0x1 +phy_chain_tx_polarity_flip_physical{81.0}=0x1 +phy_chain_tx_polarity_flip_physical{82.0}=0x1 +phy_chain_tx_polarity_flip_physical{83.0}=0x1 +phy_chain_tx_polarity_flip_physical{84.0}=0x1 +phy_chain_tx_polarity_flip_physical{85.0}=0x0 +phy_chain_tx_polarity_flip_physical{86.0}=0x0 +phy_chain_tx_polarity_flip_physical{87.0}=0x1 +phy_chain_tx_polarity_flip_physical{88.0}=0x1 +phy_chain_tx_polarity_flip_physical{89.0}=0x0 +phy_chain_tx_polarity_flip_physical{90.0}=0x1 +phy_chain_tx_polarity_flip_physical{91.0}=0x1 +phy_chain_tx_polarity_flip_physical{92.0}=0x1 +phy_chain_tx_polarity_flip_physical{93.0}=0x0 +phy_chain_tx_polarity_flip_physical{94.0}=0x0 +phy_chain_tx_polarity_flip_physical{95.0}=0x1 +phy_chain_tx_polarity_flip_physical{96.0}=0x1 +phy_chain_tx_polarity_flip_physical{97.0}=0x1 +phy_chain_tx_polarity_flip_physical{98.0}=0x1 +phy_chain_tx_polarity_flip_physical{99.0}=0x1 +phy_chain_tx_polarity_flip_physical{100.0}=0x1 +phy_chain_tx_polarity_flip_physical{101.0}=0x0 +phy_chain_tx_polarity_flip_physical{102.0}=0x1 +phy_chain_tx_polarity_flip_physical{103.0}=0x1 +phy_chain_tx_polarity_flip_physical{104.0}=0x0 +phy_chain_tx_polarity_flip_physical{105.0}=0x1 +phy_chain_tx_polarity_flip_physical{106.0}=0x0 +phy_chain_tx_polarity_flip_physical{107.0}=0x0 +phy_chain_tx_polarity_flip_physical{108.0}=0x0 +phy_chain_tx_polarity_flip_physical{109.0}=0x1 +phy_chain_tx_polarity_flip_physical{110.0}=0x1 +phy_chain_tx_polarity_flip_physical{111.0}=0x0 +phy_chain_tx_polarity_flip_physical{112.0}=0x0 +phy_chain_tx_polarity_flip_physical{113.0}=0x0 +phy_chain_tx_polarity_flip_physical{114.0}=0x0 +phy_chain_tx_polarity_flip_physical{115.0}=0x0 +phy_chain_tx_polarity_flip_physical{116.0}=0x0 +phy_chain_tx_polarity_flip_physical{117.0}=0x1 +phy_chain_tx_polarity_flip_physical{118.0}=0x1 +phy_chain_tx_polarity_flip_physical{119.0}=0x0 +phy_chain_tx_polarity_flip_physical{120.0}=0x0 +phy_chain_tx_polarity_flip_physical{121.0}=0x1 +phy_chain_tx_polarity_flip_physical{122.0}=0x0 +phy_chain_tx_polarity_flip_physical{123.0}=0x0 +phy_chain_tx_polarity_flip_physical{124.0}=0x0 +phy_chain_tx_polarity_flip_physical{125.0}=0x1 +phy_chain_tx_polarity_flip_physical{126.0}=0x1 +phy_chain_tx_polarity_flip_physical{127.0}=0x0 +phy_chain_tx_polarity_flip_physical{128.0}=0x0 +phy_chain_tx_polarity_flip_physical{129.0}=0x0 +phy_chain_tx_polarity_flip_physical{131.0}=0x0 +portmap_1=1:50:2 +portmap_3=3:50:2 +portmap_5=5:50:2 +portmap_7=7:50:2 +portmap_9=9:50:2 +portmap_11=11:50:2 +portmap_13=13:50:2 +portmap_15=15:50:2 +portmap_17=17:50:2 +portmap_19=19:50:2 +portmap_21=21:50:2 +portmap_23=23:50:2 +portmap_25=25:100 +portmap_29=29:100 +portmap_33=33:100 +portmap_37=37:100 +portmap_41=41:50:2 +portmap_43=43:50:2 +portmap_45=45:50:2 +portmap_47=47:50:2 +portmap_49=49:50:2 +portmap_51=51:50:2 +portmap_53=53:50:2 +portmap_55=55:50:2 +portmap_57=57:50:2 +portmap_59=59:50:2 +portmap_61=61:50:2 +portmap_63=63:50:2 +# skip 2 +portmap_67=65:50:2 +portmap_69=67:50:2 +portmap_71=69:50:2 +portmap_73=71:50:2 +portmap_75=73:50:2 +portmap_77=75:50:2 +portmap_79=77:50:2 +portmap_81=79:50:2 +portmap_83=81:50:2 +portmap_85=83:50:2 +portmap_87=85:50:2 +portmap_89=87:50:2 +portmap_91=89:100 +portmap_95=93:100 +portmap_99=97:100 +portmap_103=101:100 +portmap_107=105:50:2 +portmap_109=107:50:2 +portmap_111=109:50:2 +portmap_113=111:50:2 +portmap_115=113:50:2 +portmap_117=115:50:2 +portmap_119=117:50:2 +portmap_121=119:50:2 +portmap_123=121:50:2 +portmap_125=123:50:2 +portmap_127=125:50:2 +portmap_129=127:50:2 +serdes_core_rx_polarity_flip_physical{1}=0x8 +serdes_core_rx_polarity_flip_physical{5}=0x2 +serdes_core_rx_polarity_flip_physical{9}=0xc +serdes_core_rx_polarity_flip_physical{13}=0x3 +serdes_core_rx_polarity_flip_physical{17}=0x4 +serdes_core_rx_polarity_flip_physical{21}=0x3 +serdes_core_rx_polarity_flip_physical{25}=0x6 +serdes_core_rx_polarity_flip_physical{29}=0x3 +serdes_core_rx_polarity_flip_physical{33}=0x4 +serdes_core_rx_polarity_flip_physical{37}=0x3 +serdes_core_rx_polarity_flip_physical{41}=0xc +serdes_core_rx_polarity_flip_physical{45}=0x3 +serdes_core_rx_polarity_flip_physical{49}=0x4 +serdes_core_rx_polarity_flip_physical{53}=0x3 +serdes_core_rx_polarity_flip_physical{57}=0xc +serdes_core_rx_polarity_flip_physical{61}=0x3 +serdes_core_rx_polarity_flip_physical{65}=0xb +serdes_core_rx_polarity_flip_physical{69}=0xc +serdes_core_rx_polarity_flip_physical{73}=0x7 +serdes_core_rx_polarity_flip_physical{77}=0xc +serdes_core_rx_polarity_flip_physical{81}=0xb +serdes_core_rx_polarity_flip_physical{85}=0xc +serdes_core_rx_polarity_flip_physical{89}=0x7 +serdes_core_rx_polarity_flip_physical{93}=0xc +serdes_core_rx_polarity_flip_physical{97}=0xb +serdes_core_rx_polarity_flip_physical{101}=0x9 +serdes_core_rx_polarity_flip_physical{105}=0x7 +serdes_core_rx_polarity_flip_physical{109}=0xc +serdes_core_rx_polarity_flip_physical{113}=0xb +serdes_core_rx_polarity_flip_physical{117}=0xc +serdes_core_rx_polarity_flip_physical{121}=0x7 +serdes_core_rx_polarity_flip_physical{125}=0xc +serdes_core_rx_polarity_flip_physical{129}=0x0 +serdes_core_tx_polarity_flip_physical{1}=0x3 +serdes_core_tx_polarity_flip_physical{5}=0xb +serdes_core_tx_polarity_flip_physical{9}=0x3 +serdes_core_tx_polarity_flip_physical{13}=0xb +serdes_core_tx_polarity_flip_physical{17}=0x0 +serdes_core_tx_polarity_flip_physical{21}=0x3 +serdes_core_tx_polarity_flip_physical{25}=0x4 +serdes_core_tx_polarity_flip_physical{29}=0xc +serdes_core_tx_polarity_flip_physical{33}=0xf +serdes_core_tx_polarity_flip_physical{37}=0xc +serdes_core_tx_polarity_flip_physical{41}=0xe +serdes_core_tx_polarity_flip_physical{45}=0xc +serdes_core_tx_polarity_flip_physical{49}=0xf +serdes_core_tx_polarity_flip_physical{53}=0xc +serdes_core_tx_polarity_flip_physical{57}=0xe +serdes_core_tx_polarity_flip_physical{61}=0xc +serdes_core_tx_polarity_flip_physical{65}=0xf +serdes_core_tx_polarity_flip_physical{69}=0xe +serdes_core_tx_polarity_flip_physical{73}=0xe +serdes_core_tx_polarity_flip_physical{77}=0xc +serdes_core_tx_polarity_flip_physical{81}=0xf +serdes_core_tx_polarity_flip_physical{85}=0xc +serdes_core_tx_polarity_flip_physical{89}=0xe +serdes_core_tx_polarity_flip_physical{93}=0xc +serdes_core_tx_polarity_flip_physical{97}=0xf +serdes_core_tx_polarity_flip_physical{101}=0x6 +serdes_core_tx_polarity_flip_physical{105}=0x1 +serdes_core_tx_polarity_flip_physical{109}=0x3 +serdes_core_tx_polarity_flip_physical{113}=0x0 +serdes_core_tx_polarity_flip_physical{117}=0x3 +serdes_core_tx_polarity_flip_physical{121}=0x1 +serdes_core_tx_polarity_flip_physical{125}=0x3 +serdes_core_tx_polarity_flip_physical{129}=0x0 +serdes_preemphasis_1=0x45808 +serdes_preemphasis_3=0x45808 +serdes_preemphasis_5=0x45808 +serdes_preemphasis_7=0x45808 +serdes_preemphasis_9=0x45808 +serdes_preemphasis_11=0x45808 +serdes_preemphasis_13=0x45808 +serdes_preemphasis_15=0x45808 +serdes_preemphasis_17=0x45808 +serdes_preemphasis_19=0x45808 +serdes_preemphasis_21=0x45808 +serdes_preemphasis_23=0x45808 +serdes_preemphasis_25=0xd3e05 +serdes_preemphasis_29=0xd3e05 +serdes_preemphasis_33=0xb3403 +serdes_preemphasis_37=0x93603 +serdes_preemphasis_41=0x580c +serdes_preemphasis_43=0x580c +serdes_preemphasis_45=0x580c +serdes_preemphasis_47=0x580c +serdes_preemphasis_49=0x580c +serdes_preemphasis_51=0x580c +serdes_preemphasis_53=0x580c +serdes_preemphasis_55=0x580c +serdes_preemphasis_57=0x580c +serdes_preemphasis_59=0x580c +serdes_preemphasis_61=0x580c +serdes_preemphasis_63=0x580c +serdes_preemphasis_67=0x580c +serdes_preemphasis_69=0x580c +serdes_preemphasis_71=0x580c +serdes_preemphasis_73=0x580c +serdes_preemphasis_75=0x580c +serdes_preemphasis_77=0x580c +serdes_preemphasis_79=0x580c +serdes_preemphasis_81=0x580c +serdes_preemphasis_83=0x580c +serdes_preemphasis_85=0x580c +serdes_preemphasis_87=0x580c +serdes_preemphasis_89=0x580c +serdes_preemphasis_91=0x93603 +serdes_preemphasis_95=0xd3e05 +serdes_preemphasis_99=0xb3403 +serdes_preemphasis_103=0xd3e05 +serdes_preemphasis_107=0x85804 +serdes_preemphasis_109=0x85804 +serdes_preemphasis_111=0x85804 +serdes_preemphasis_113=0x85804 +serdes_preemphasis_115=0x85804 +serdes_preemphasis_117=0x85804 +serdes_preemphasis_119=0x85804 +serdes_preemphasis_121=0x85804 +serdes_preemphasis_123=0x85804 +serdes_preemphasis_125=0x85804 +serdes_preemphasis_127=0x85804 +serdes_preemphasis_129=0x85804 + +phy_an_lt_msft=1 diff --git a/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-D48C8/pg_profile_lookup.ini b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-D48C8/pg_profile_lookup.ini deleted file mode 100644 index 0b5d680edda7..000000000000 --- a/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-D48C8/pg_profile_lookup.ini +++ /dev/null @@ -1,17 +0,0 @@ -# PG lossless profiles. -# speed cable size xon xoff threshold xon_offset - 10000 5m 1248 2288 35776 0 2288 - 25000 5m 1248 2288 53248 0 2288 - 40000 5m 1248 2288 66560 0 2288 - 50000 5m 1248 2288 79872 0 2288 - 100000 5m 1248 2288 165568 0 2288 - 10000 40m 1248 2288 37024 0 2288 - 25000 40m 1248 2288 56160 0 2288 - 40000 40m 1248 2288 71552 0 2288 - 50000 40m 1248 2288 85696 0 2288 - 100000 40m 1248 2288 177632 0 2288 - 10000 300m 1248 2288 46176 0 2288 - 25000 300m 1248 2288 79040 0 2288 - 40000 300m 1248 2288 108160 0 2288 - 50000 300m 1248 2288 141856 0 2288 - 100000 300m 1248 2288 268736 0 2288 diff --git a/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-D48C8/pg_profile_lookup.ini b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-D48C8/pg_profile_lookup.ini new file mode 120000 index 000000000000..297cddb2d223 --- /dev/null +++ b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-D48C8/pg_profile_lookup.ini @@ -0,0 +1 @@ +BALANCED/pg_profile_lookup.ini \ No newline at end of file diff --git a/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-D48C8/qos.json.j2 b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-D48C8/qos.json.j2 deleted file mode 100644 index 34002048afdb..000000000000 --- a/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-D48C8/qos.json.j2 +++ /dev/null @@ -1,21 +0,0 @@ -{%- macro generate_wred_profiles() %} - "WRED_PROFILE": { - "AZURE_LOSSLESS" : { - "wred_green_enable" : "true", - "wred_yellow_enable" : "true", - "wred_red_enable" : "true", - "ecn" : "ecn_all", - "green_max_threshold" : "2097152", - "green_min_threshold" : "250000", - "yellow_max_threshold" : "2097152", - "yellow_min_threshold" : "1048576", - "red_max_threshold" : "2097152", - "red_min_threshold" : "1048576", - "green_drop_probability" : "5", - "yellow_drop_probability": "5", - "red_drop_probability" : "5" - } - }, -{%- endmacro %} - -{%- include 'qos_config.j2' %} diff --git a/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-D48C8/qos.json.j2 b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-D48C8/qos.json.j2 new file mode 120000 index 000000000000..aef6b6765cf2 --- /dev/null +++ b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-D48C8/qos.json.j2 @@ -0,0 +1 @@ +BALANCED/qos.json.j2 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-D48C8/sai.profile b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-D48C8/sai.profile index 1865041f8d9f..5163d6140f0e 100644 --- a/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-D48C8/sai.profile +++ b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-D48C8/sai.profile @@ -1,2 +1,2 @@ -SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/td3-a7050cx3-32s-48x50G+8x100G.config.bcm +SAI_INIT_CONFIG_FILE=/etc/sai.d/config.bcm SAI_NUM_ECMP_MEMBERS=64 diff --git a/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-D48C8/td3-a7050cx3-32s-48x50G+8x100G.config.bcm b/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-D48C8/td3-a7050cx3-32s-48x50G+8x100G.config.bcm deleted file mode 100644 index 2b7da96358d5..000000000000 --- a/device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-D48C8/td3-a7050cx3-32s-48x50G+8x100G.config.bcm +++ /dev/null @@ -1,545 +0,0 @@ -arl_clean_timeout_usec=15000000 -asf_mem_profile=2 -bcm_num_cos=8 -bcm_stat_flags=1 -bcm_stat_jumbo=9236 -bcm_tunnel_term_compatible_mode=1 -cdma_timeout_usec=15000000 -core_clock_frequency=1525 -dma_desc_timeout_usec=15000000 -dpp_clock_ratio=2:3 -fpem_mem_entries=0 -higig2_hdr_mode=1 -ifp_inports_support_enable=1 -ipv6_lpm_128b_enable=1 -l2_mem_entries=32768 -l2xmsg_mode=1 -l3_alpm_enable=2 -l3_max_ecmp_mode=1 -l3_mem_entries=16384 -max_vp_lags=0 -miim_intr_enable=0 -module_64ports=1 -multicast_l2_range=16383 -multicast_l3_range=0 -os=unix -oversubscribe_mode=1 -pbmp_xport_xe=0x7ffffffffffffffffffffffffffffffffe -PHY_AN_ALLOW_PLL_CHANGE=1 -phy_an_c37_130=2 -phy_an_c37_66=2 -phy_an_c73=1 -port_flex_enable=1 -port_init_autoneg=0 -port_phy_addr=0xff -robust_hash_disable_egress_vlan=1 -robust_hash_disable_mpls=1 -robust_hash_disable_vlan=1 -stable_size=0x5500000 -tdma_timeout_usec=15000000 -tslam_timeout_usec=15000000 -phy_chain_rx_lane_map_physical{1.0}=0x1302 -phy_chain_rx_lane_map_physical{5.0}=0x3120 -phy_chain_rx_lane_map_physical{9.0}=0x3120 -phy_chain_rx_lane_map_physical{13.0}=0x3120 -phy_chain_rx_lane_map_physical{17.0}=0x1203 -phy_chain_rx_lane_map_physical{21.0}=0x3120 -phy_chain_rx_lane_map_physical{25.0}=0x3120 -phy_chain_rx_lane_map_physical{29.0}=0x3120 -phy_chain_rx_lane_map_physical{33.0}=0x1203 -phy_chain_rx_lane_map_physical{37.0}=0x3120 -phy_chain_rx_lane_map_physical{41.0}=0x3120 -phy_chain_rx_lane_map_physical{45.0}=0x3120 -phy_chain_rx_lane_map_physical{49.0}=0x1203 -phy_chain_rx_lane_map_physical{53.0}=0x3120 -phy_chain_rx_lane_map_physical{57.0}=0x3120 -phy_chain_rx_lane_map_physical{61.0}=0x3120 -phy_chain_rx_lane_map_physical{65.0}=0x2130 -phy_chain_rx_lane_map_physical{69.0}=0x0213 -phy_chain_rx_lane_map_physical{73.0}=0x2031 -phy_chain_rx_lane_map_physical{77.0}=0x0213 -phy_chain_rx_lane_map_physical{81.0}=0x2130 -phy_chain_rx_lane_map_physical{85.0}=0x0213 -phy_chain_rx_lane_map_physical{89.0}=0x2031 -phy_chain_rx_lane_map_physical{93.0}=0x0213 -phy_chain_rx_lane_map_physical{97.0}=0x2130 -phy_chain_rx_lane_map_physical{101.0}=0x0213 -phy_chain_rx_lane_map_physical{105.0}=0x2031 -phy_chain_rx_lane_map_physical{109.0}=0x0213 -phy_chain_rx_lane_map_physical{113.0}=0x2130 -phy_chain_rx_lane_map_physical{117.0}=0x0213 -phy_chain_rx_lane_map_physical{121.0}=0x2031 -phy_chain_rx_lane_map_physical{125.0}=0x0213 -phy_chain_rx_lane_map_physical{129.0}=0x3210 -phy_chain_rx_polarity_flip_physical{1.0}=0x0 -phy_chain_rx_polarity_flip_physical{2.0}=0x0 -phy_chain_rx_polarity_flip_physical{3.0}=0x0 -phy_chain_rx_polarity_flip_physical{4.0}=0x1 -phy_chain_rx_polarity_flip_physical{5.0}=0x0 -phy_chain_rx_polarity_flip_physical{6.0}=0x1 -phy_chain_rx_polarity_flip_physical{7.0}=0x0 -phy_chain_rx_polarity_flip_physical{8.0}=0x0 -phy_chain_rx_polarity_flip_physical{9.0}=0x0 -phy_chain_rx_polarity_flip_physical{10.0}=0x0 -phy_chain_rx_polarity_flip_physical{11.0}=0x1 -phy_chain_rx_polarity_flip_physical{12.0}=0x1 -phy_chain_rx_polarity_flip_physical{13.0}=0x1 -phy_chain_rx_polarity_flip_physical{14.0}=0x1 -phy_chain_rx_polarity_flip_physical{15.0}=0x0 -phy_chain_rx_polarity_flip_physical{16.0}=0x0 -phy_chain_rx_polarity_flip_physical{17.0}=0x0 -phy_chain_rx_polarity_flip_physical{18.0}=0x0 -phy_chain_rx_polarity_flip_physical{19.0}=0x1 -phy_chain_rx_polarity_flip_physical{20.0}=0x0 -phy_chain_rx_polarity_flip_physical{21.0}=0x1 -phy_chain_rx_polarity_flip_physical{22.0}=0x1 -phy_chain_rx_polarity_flip_physical{23.0}=0x0 -phy_chain_rx_polarity_flip_physical{24.0}=0x0 -phy_chain_rx_polarity_flip_physical{25.0}=0x0 -phy_chain_rx_polarity_flip_physical{26.0}=0x1 -phy_chain_rx_polarity_flip_physical{27.0}=0x1 -phy_chain_rx_polarity_flip_physical{28.0}=0x0 -phy_chain_rx_polarity_flip_physical{29.0}=0x1 -phy_chain_rx_polarity_flip_physical{30.0}=0x1 -phy_chain_rx_polarity_flip_physical{31.0}=0x0 -phy_chain_rx_polarity_flip_physical{32.0}=0x0 -phy_chain_rx_polarity_flip_physical{33.0}=0x0 -phy_chain_rx_polarity_flip_physical{34.0}=0x0 -phy_chain_rx_polarity_flip_physical{35.0}=0x1 -phy_chain_rx_polarity_flip_physical{36.0}=0x0 -phy_chain_rx_polarity_flip_physical{37.0}=0x1 -phy_chain_rx_polarity_flip_physical{38.0}=0x1 -phy_chain_rx_polarity_flip_physical{39.0}=0x0 -phy_chain_rx_polarity_flip_physical{40.0}=0x0 -phy_chain_rx_polarity_flip_physical{41.0}=0x0 -phy_chain_rx_polarity_flip_physical{42.0}=0x0 -phy_chain_rx_polarity_flip_physical{43.0}=0x1 -phy_chain_rx_polarity_flip_physical{44.0}=0x1 -phy_chain_rx_polarity_flip_physical{45.0}=0x1 -phy_chain_rx_polarity_flip_physical{46.0}=0x1 -phy_chain_rx_polarity_flip_physical{47.0}=0x0 -phy_chain_rx_polarity_flip_physical{48.0}=0x0 -phy_chain_rx_polarity_flip_physical{49.0}=0x0 -phy_chain_rx_polarity_flip_physical{50.0}=0x0 -phy_chain_rx_polarity_flip_physical{51.0}=0x1 -phy_chain_rx_polarity_flip_physical{52.0}=0x0 -phy_chain_rx_polarity_flip_physical{53.0}=0x1 -phy_chain_rx_polarity_flip_physical{54.0}=0x1 -phy_chain_rx_polarity_flip_physical{55.0}=0x0 -phy_chain_rx_polarity_flip_physical{56.0}=0x0 -phy_chain_rx_polarity_flip_physical{57.0}=0x0 -phy_chain_rx_polarity_flip_physical{58.0}=0x0 -phy_chain_rx_polarity_flip_physical{59.0}=0x1 -phy_chain_rx_polarity_flip_physical{60.0}=0x1 -phy_chain_rx_polarity_flip_physical{61.0}=0x1 -phy_chain_rx_polarity_flip_physical{62.0}=0x1 -phy_chain_rx_polarity_flip_physical{63.0}=0x0 -phy_chain_rx_polarity_flip_physical{64.0}=0x0 -phy_chain_rx_polarity_flip_physical{65.0}=0x1 -phy_chain_rx_polarity_flip_physical{66.0}=0x1 -phy_chain_rx_polarity_flip_physical{67.0}=0x0 -phy_chain_rx_polarity_flip_physical{68.0}=0x1 -phy_chain_rx_polarity_flip_physical{69.0}=0x0 -phy_chain_rx_polarity_flip_physical{70.0}=0x0 -phy_chain_rx_polarity_flip_physical{71.0}=0x1 -phy_chain_rx_polarity_flip_physical{72.0}=0x1 -phy_chain_rx_polarity_flip_physical{73.0}=0x1 -phy_chain_rx_polarity_flip_physical{74.0}=0x1 -phy_chain_rx_polarity_flip_physical{75.0}=0x1 -phy_chain_rx_polarity_flip_physical{76.0}=0x0 -phy_chain_rx_polarity_flip_physical{77.0}=0x0 -phy_chain_rx_polarity_flip_physical{78.0}=0x0 -phy_chain_rx_polarity_flip_physical{79.0}=0x1 -phy_chain_rx_polarity_flip_physical{80.0}=0x1 -phy_chain_rx_polarity_flip_physical{81.0}=0x1 -phy_chain_rx_polarity_flip_physical{82.0}=0x1 -phy_chain_rx_polarity_flip_physical{83.0}=0x0 -phy_chain_rx_polarity_flip_physical{84.0}=0x1 -phy_chain_rx_polarity_flip_physical{85.0}=0x0 -phy_chain_rx_polarity_flip_physical{86.0}=0x0 -phy_chain_rx_polarity_flip_physical{87.0}=0x1 -phy_chain_rx_polarity_flip_physical{88.0}=0x1 -phy_chain_rx_polarity_flip_physical{89.0}=0x1 -phy_chain_rx_polarity_flip_physical{90.0}=0x1 -phy_chain_rx_polarity_flip_physical{91.0}=0x1 -phy_chain_rx_polarity_flip_physical{92.0}=0x0 -phy_chain_rx_polarity_flip_physical{93.0}=0x0 -phy_chain_rx_polarity_flip_physical{94.0}=0x0 -phy_chain_rx_polarity_flip_physical{95.0}=0x1 -phy_chain_rx_polarity_flip_physical{96.0}=0x1 -phy_chain_rx_polarity_flip_physical{97.0}=0x1 -phy_chain_rx_polarity_flip_physical{98.0}=0x1 -phy_chain_rx_polarity_flip_physical{99.0}=0x0 -phy_chain_rx_polarity_flip_physical{100.0}=0x1 -phy_chain_rx_polarity_flip_physical{101.0}=0x1 -phy_chain_rx_polarity_flip_physical{102.0}=0x0 -phy_chain_rx_polarity_flip_physical{103.0}=0x0 -phy_chain_rx_polarity_flip_physical{104.0}=0x1 -phy_chain_rx_polarity_flip_physical{105.0}=0x1 -phy_chain_rx_polarity_flip_physical{106.0}=0x1 -phy_chain_rx_polarity_flip_physical{107.0}=0x1 -phy_chain_rx_polarity_flip_physical{108.0}=0x0 -phy_chain_rx_polarity_flip_physical{109.0}=0x0 -phy_chain_rx_polarity_flip_physical{110.0}=0x0 -phy_chain_rx_polarity_flip_physical{111.0}=0x1 -phy_chain_rx_polarity_flip_physical{112.0}=0x1 -phy_chain_rx_polarity_flip_physical{113.0}=0x1 -phy_chain_rx_polarity_flip_physical{114.0}=0x1 -phy_chain_rx_polarity_flip_physical{115.0}=0x0 -phy_chain_rx_polarity_flip_physical{116.0}=0x1 -phy_chain_rx_polarity_flip_physical{117.0}=0x0 -phy_chain_rx_polarity_flip_physical{118.0}=0x0 -phy_chain_rx_polarity_flip_physical{119.0}=0x1 -phy_chain_rx_polarity_flip_physical{120.0}=0x1 -phy_chain_rx_polarity_flip_physical{121.0}=0x1 -phy_chain_rx_polarity_flip_physical{122.0}=0x1 -phy_chain_rx_polarity_flip_physical{123.0}=0x1 -phy_chain_rx_polarity_flip_physical{124.0}=0x0 -phy_chain_rx_polarity_flip_physical{125.0}=0x0 -phy_chain_rx_polarity_flip_physical{126.0}=0x0 -phy_chain_rx_polarity_flip_physical{127.0}=0x1 -phy_chain_rx_polarity_flip_physical{128.0}=0x1 -phy_chain_rx_polarity_flip_physical{129.0}=0x0 -phy_chain_rx_polarity_flip_physical{131.0}=0x0 -phy_chain_tx_lane_map_physical{1.0}=0x3021 -phy_chain_tx_lane_map_physical{5.0}=0x1203 -phy_chain_tx_lane_map_physical{9.0}=0x0213 -phy_chain_tx_lane_map_physical{13.0}=0x0213 -phy_chain_tx_lane_map_physical{17.0}=0x2031 -phy_chain_tx_lane_map_physical{21.0}=0x0213 -phy_chain_tx_lane_map_physical{25.0}=0x2031 -phy_chain_tx_lane_map_physical{29.0}=0x1203 -phy_chain_tx_lane_map_physical{33.0}=0x2031 -phy_chain_tx_lane_map_physical{37.0}=0x0213 -phy_chain_tx_lane_map_physical{41.0}=0x2031 -phy_chain_tx_lane_map_physical{45.0}=0x1203 -phy_chain_tx_lane_map_physical{49.0}=0x2031 -phy_chain_tx_lane_map_physical{53.0}=0x0213 -phy_chain_tx_lane_map_physical{57.0}=0x2031 -phy_chain_tx_lane_map_physical{61.0}=0x1203 -phy_chain_tx_lane_map_physical{65.0}=0x1302 -phy_chain_tx_lane_map_physical{69.0}=0x1302 -phy_chain_tx_lane_map_physical{73.0}=0x1302 -phy_chain_tx_lane_map_physical{77.0}=0x2130 -phy_chain_tx_lane_map_physical{81.0}=0x1302 -phy_chain_tx_lane_map_physical{85.0}=0x3120 -phy_chain_tx_lane_map_physical{89.0}=0x1302 -phy_chain_tx_lane_map_physical{93.0}=0x2130 -phy_chain_tx_lane_map_physical{97.0}=0x1302 -phy_chain_tx_lane_map_physical{101.0}=0x3120 -phy_chain_tx_lane_map_physical{105.0}=0x1302 -phy_chain_tx_lane_map_physical{109.0}=0x2130 -phy_chain_tx_lane_map_physical{113.0}=0x1302 -phy_chain_tx_lane_map_physical{117.0}=0x3120 -phy_chain_tx_lane_map_physical{121.0}=0x1302 -phy_chain_tx_lane_map_physical{125.0}=0x3120 -phy_chain_tx_lane_map_physical{129.0}=0x3210 -phy_chain_tx_polarity_flip_physical{1.0}=0x1 -phy_chain_tx_polarity_flip_physical{2.0}=0x1 -phy_chain_tx_polarity_flip_physical{3.0}=0x0 -phy_chain_tx_polarity_flip_physical{4.0}=0x0 -phy_chain_tx_polarity_flip_physical{5.0}=0x1 -phy_chain_tx_polarity_flip_physical{6.0}=0x1 -phy_chain_tx_polarity_flip_physical{7.0}=0x0 -phy_chain_tx_polarity_flip_physical{8.0}=0x1 -phy_chain_tx_polarity_flip_physical{9.0}=0x1 -phy_chain_tx_polarity_flip_physical{10.0}=0x1 -phy_chain_tx_polarity_flip_physical{11.0}=0x0 -phy_chain_tx_polarity_flip_physical{12.0}=0x0 -phy_chain_tx_polarity_flip_physical{13.0}=0x1 -phy_chain_tx_polarity_flip_physical{14.0}=0x1 -phy_chain_tx_polarity_flip_physical{15.0}=0x0 -phy_chain_tx_polarity_flip_physical{16.0}=0x1 -phy_chain_tx_polarity_flip_physical{17.0}=0x0 -phy_chain_tx_polarity_flip_physical{18.0}=0x0 -phy_chain_tx_polarity_flip_physical{19.0}=0x0 -phy_chain_tx_polarity_flip_physical{20.0}=0x0 -phy_chain_tx_polarity_flip_physical{21.0}=0x1 -phy_chain_tx_polarity_flip_physical{22.0}=0x1 -phy_chain_tx_polarity_flip_physical{23.0}=0x0 -phy_chain_tx_polarity_flip_physical{24.0}=0x0 -phy_chain_tx_polarity_flip_physical{25.0}=0x0 -phy_chain_tx_polarity_flip_physical{26.0}=0x0 -phy_chain_tx_polarity_flip_physical{27.0}=0x1 -phy_chain_tx_polarity_flip_physical{28.0}=0x0 -phy_chain_tx_polarity_flip_physical{29.0}=0x0 -phy_chain_tx_polarity_flip_physical{30.0}=0x0 -phy_chain_tx_polarity_flip_physical{31.0}=0x1 -phy_chain_tx_polarity_flip_physical{32.0}=0x1 -phy_chain_tx_polarity_flip_physical{33.0}=0x1 -phy_chain_tx_polarity_flip_physical{34.0}=0x1 -phy_chain_tx_polarity_flip_physical{35.0}=0x1 -phy_chain_tx_polarity_flip_physical{36.0}=0x1 -phy_chain_tx_polarity_flip_physical{37.0}=0x0 -phy_chain_tx_polarity_flip_physical{38.0}=0x0 -phy_chain_tx_polarity_flip_physical{39.0}=0x1 -phy_chain_tx_polarity_flip_physical{40.0}=0x1 -phy_chain_tx_polarity_flip_physical{41.0}=0x0 -phy_chain_tx_polarity_flip_physical{42.0}=0x1 -phy_chain_tx_polarity_flip_physical{43.0}=0x1 -phy_chain_tx_polarity_flip_physical{44.0}=0x1 -phy_chain_tx_polarity_flip_physical{45.0}=0x0 -phy_chain_tx_polarity_flip_physical{46.0}=0x0 -phy_chain_tx_polarity_flip_physical{47.0}=0x1 -phy_chain_tx_polarity_flip_physical{48.0}=0x1 -phy_chain_tx_polarity_flip_physical{49.0}=0x1 -phy_chain_tx_polarity_flip_physical{50.0}=0x1 -phy_chain_tx_polarity_flip_physical{51.0}=0x1 -phy_chain_tx_polarity_flip_physical{52.0}=0x1 -phy_chain_tx_polarity_flip_physical{53.0}=0x0 -phy_chain_tx_polarity_flip_physical{54.0}=0x0 -phy_chain_tx_polarity_flip_physical{55.0}=0x1 -phy_chain_tx_polarity_flip_physical{56.0}=0x1 -phy_chain_tx_polarity_flip_physical{57.0}=0x0 -phy_chain_tx_polarity_flip_physical{58.0}=0x1 -phy_chain_tx_polarity_flip_physical{59.0}=0x1 -phy_chain_tx_polarity_flip_physical{60.0}=0x1 -phy_chain_tx_polarity_flip_physical{61.0}=0x0 -phy_chain_tx_polarity_flip_physical{62.0}=0x0 -phy_chain_tx_polarity_flip_physical{63.0}=0x1 -phy_chain_tx_polarity_flip_physical{64.0}=0x1 -phy_chain_tx_polarity_flip_physical{65.0}=0x1 -phy_chain_tx_polarity_flip_physical{66.0}=0x1 -phy_chain_tx_polarity_flip_physical{67.0}=0x1 -phy_chain_tx_polarity_flip_physical{68.0}=0x1 -phy_chain_tx_polarity_flip_physical{69.0}=0x0 -phy_chain_tx_polarity_flip_physical{70.0}=0x1 -phy_chain_tx_polarity_flip_physical{71.0}=0x1 -phy_chain_tx_polarity_flip_physical{72.0}=0x1 -phy_chain_tx_polarity_flip_physical{73.0}=0x0 -phy_chain_tx_polarity_flip_physical{74.0}=0x1 -phy_chain_tx_polarity_flip_physical{75.0}=0x1 -phy_chain_tx_polarity_flip_physical{76.0}=0x1 -phy_chain_tx_polarity_flip_physical{77.0}=0x0 -phy_chain_tx_polarity_flip_physical{78.0}=0x0 -phy_chain_tx_polarity_flip_physical{79.0}=0x1 -phy_chain_tx_polarity_flip_physical{80.0}=0x1 -phy_chain_tx_polarity_flip_physical{81.0}=0x1 -phy_chain_tx_polarity_flip_physical{82.0}=0x1 -phy_chain_tx_polarity_flip_physical{83.0}=0x1 -phy_chain_tx_polarity_flip_physical{84.0}=0x1 -phy_chain_tx_polarity_flip_physical{85.0}=0x0 -phy_chain_tx_polarity_flip_physical{86.0}=0x0 -phy_chain_tx_polarity_flip_physical{87.0}=0x1 -phy_chain_tx_polarity_flip_physical{88.0}=0x1 -phy_chain_tx_polarity_flip_physical{89.0}=0x0 -phy_chain_tx_polarity_flip_physical{90.0}=0x1 -phy_chain_tx_polarity_flip_physical{91.0}=0x1 -phy_chain_tx_polarity_flip_physical{92.0}=0x1 -phy_chain_tx_polarity_flip_physical{93.0}=0x0 -phy_chain_tx_polarity_flip_physical{94.0}=0x0 -phy_chain_tx_polarity_flip_physical{95.0}=0x1 -phy_chain_tx_polarity_flip_physical{96.0}=0x1 -phy_chain_tx_polarity_flip_physical{97.0}=0x1 -phy_chain_tx_polarity_flip_physical{98.0}=0x1 -phy_chain_tx_polarity_flip_physical{99.0}=0x1 -phy_chain_tx_polarity_flip_physical{100.0}=0x1 -phy_chain_tx_polarity_flip_physical{101.0}=0x0 -phy_chain_tx_polarity_flip_physical{102.0}=0x1 -phy_chain_tx_polarity_flip_physical{103.0}=0x1 -phy_chain_tx_polarity_flip_physical{104.0}=0x0 -phy_chain_tx_polarity_flip_physical{105.0}=0x1 -phy_chain_tx_polarity_flip_physical{106.0}=0x0 -phy_chain_tx_polarity_flip_physical{107.0}=0x0 -phy_chain_tx_polarity_flip_physical{108.0}=0x0 -phy_chain_tx_polarity_flip_physical{109.0}=0x1 -phy_chain_tx_polarity_flip_physical{110.0}=0x1 -phy_chain_tx_polarity_flip_physical{111.0}=0x0 -phy_chain_tx_polarity_flip_physical{112.0}=0x0 -phy_chain_tx_polarity_flip_physical{113.0}=0x0 -phy_chain_tx_polarity_flip_physical{114.0}=0x0 -phy_chain_tx_polarity_flip_physical{115.0}=0x0 -phy_chain_tx_polarity_flip_physical{116.0}=0x0 -phy_chain_tx_polarity_flip_physical{117.0}=0x1 -phy_chain_tx_polarity_flip_physical{118.0}=0x1 -phy_chain_tx_polarity_flip_physical{119.0}=0x0 -phy_chain_tx_polarity_flip_physical{120.0}=0x0 -phy_chain_tx_polarity_flip_physical{121.0}=0x1 -phy_chain_tx_polarity_flip_physical{122.0}=0x0 -phy_chain_tx_polarity_flip_physical{123.0}=0x0 -phy_chain_tx_polarity_flip_physical{124.0}=0x0 -phy_chain_tx_polarity_flip_physical{125.0}=0x1 -phy_chain_tx_polarity_flip_physical{126.0}=0x1 -phy_chain_tx_polarity_flip_physical{127.0}=0x0 -phy_chain_tx_polarity_flip_physical{128.0}=0x0 -phy_chain_tx_polarity_flip_physical{129.0}=0x0 -phy_chain_tx_polarity_flip_physical{131.0}=0x0 -portmap_1=1:50:2 -portmap_3=3:50:2 -portmap_5=5:50:2 -portmap_7=7:50:2 -portmap_9=9:50:2 -portmap_11=11:50:2 -portmap_13=13:50:2 -portmap_15=15:50:2 -portmap_17=17:50:2 -portmap_19=19:50:2 -portmap_21=21:50:2 -portmap_23=23:50:2 -portmap_25=25:100 -portmap_29=29:100 -portmap_33=33:100 -portmap_37=37:100 -portmap_41=41:50:2 -portmap_43=43:50:2 -portmap_45=45:50:2 -portmap_47=47:50:2 -portmap_49=49:50:2 -portmap_51=51:50:2 -portmap_53=53:50:2 -portmap_55=55:50:2 -portmap_57=57:50:2 -portmap_59=59:50:2 -portmap_61=61:50:2 -portmap_63=63:50:2 -# skip 2 -portmap_67=65:50:2 -portmap_69=67:50:2 -portmap_71=69:50:2 -portmap_73=71:50:2 -portmap_75=73:50:2 -portmap_77=75:50:2 -portmap_79=77:50:2 -portmap_81=79:50:2 -portmap_83=81:50:2 -portmap_85=83:50:2 -portmap_87=85:50:2 -portmap_89=87:50:2 -portmap_91=89:100 -portmap_95=93:100 -portmap_99=97:100 -portmap_103=101:100 -portmap_107=105:50:2 -portmap_109=107:50:2 -portmap_111=109:50:2 -portmap_113=111:50:2 -portmap_115=113:50:2 -portmap_117=115:50:2 -portmap_119=117:50:2 -portmap_121=119:50:2 -portmap_123=121:50:2 -portmap_125=123:50:2 -portmap_127=125:50:2 -portmap_129=127:50:2 -serdes_core_rx_polarity_flip_physical{1}=0x8 -serdes_core_rx_polarity_flip_physical{5}=0x2 -serdes_core_rx_polarity_flip_physical{9}=0xc -serdes_core_rx_polarity_flip_physical{13}=0x3 -serdes_core_rx_polarity_flip_physical{17}=0x4 -serdes_core_rx_polarity_flip_physical{21}=0x3 -serdes_core_rx_polarity_flip_physical{25}=0x6 -serdes_core_rx_polarity_flip_physical{29}=0x3 -serdes_core_rx_polarity_flip_physical{33}=0x4 -serdes_core_rx_polarity_flip_physical{37}=0x3 -serdes_core_rx_polarity_flip_physical{41}=0xc -serdes_core_rx_polarity_flip_physical{45}=0x3 -serdes_core_rx_polarity_flip_physical{49}=0x4 -serdes_core_rx_polarity_flip_physical{53}=0x3 -serdes_core_rx_polarity_flip_physical{57}=0xc -serdes_core_rx_polarity_flip_physical{61}=0x3 -serdes_core_rx_polarity_flip_physical{65}=0xb -serdes_core_rx_polarity_flip_physical{69}=0xc -serdes_core_rx_polarity_flip_physical{73}=0x7 -serdes_core_rx_polarity_flip_physical{77}=0xc -serdes_core_rx_polarity_flip_physical{81}=0xb -serdes_core_rx_polarity_flip_physical{85}=0xc -serdes_core_rx_polarity_flip_physical{89}=0x7 -serdes_core_rx_polarity_flip_physical{93}=0xc -serdes_core_rx_polarity_flip_physical{97}=0xb -serdes_core_rx_polarity_flip_physical{101}=0x9 -serdes_core_rx_polarity_flip_physical{105}=0x7 -serdes_core_rx_polarity_flip_physical{109}=0xc -serdes_core_rx_polarity_flip_physical{113}=0xb -serdes_core_rx_polarity_flip_physical{117}=0xc -serdes_core_rx_polarity_flip_physical{121}=0x7 -serdes_core_rx_polarity_flip_physical{125}=0xc -serdes_core_rx_polarity_flip_physical{129}=0x0 -serdes_core_tx_polarity_flip_physical{1}=0x3 -serdes_core_tx_polarity_flip_physical{5}=0xb -serdes_core_tx_polarity_flip_physical{9}=0x3 -serdes_core_tx_polarity_flip_physical{13}=0xb -serdes_core_tx_polarity_flip_physical{17}=0x0 -serdes_core_tx_polarity_flip_physical{21}=0x3 -serdes_core_tx_polarity_flip_physical{25}=0x4 -serdes_core_tx_polarity_flip_physical{29}=0xc -serdes_core_tx_polarity_flip_physical{33}=0xf -serdes_core_tx_polarity_flip_physical{37}=0xc -serdes_core_tx_polarity_flip_physical{41}=0xe -serdes_core_tx_polarity_flip_physical{45}=0xc -serdes_core_tx_polarity_flip_physical{49}=0xf -serdes_core_tx_polarity_flip_physical{53}=0xc -serdes_core_tx_polarity_flip_physical{57}=0xe -serdes_core_tx_polarity_flip_physical{61}=0xc -serdes_core_tx_polarity_flip_physical{65}=0xf -serdes_core_tx_polarity_flip_physical{69}=0xe -serdes_core_tx_polarity_flip_physical{73}=0xe -serdes_core_tx_polarity_flip_physical{77}=0xc -serdes_core_tx_polarity_flip_physical{81}=0xf -serdes_core_tx_polarity_flip_physical{85}=0xc -serdes_core_tx_polarity_flip_physical{89}=0xe -serdes_core_tx_polarity_flip_physical{93}=0xc -serdes_core_tx_polarity_flip_physical{97}=0xf -serdes_core_tx_polarity_flip_physical{101}=0x6 -serdes_core_tx_polarity_flip_physical{105}=0x1 -serdes_core_tx_polarity_flip_physical{109}=0x3 -serdes_core_tx_polarity_flip_physical{113}=0x0 -serdes_core_tx_polarity_flip_physical{117}=0x3 -serdes_core_tx_polarity_flip_physical{121}=0x1 -serdes_core_tx_polarity_flip_physical{125}=0x3 -serdes_core_tx_polarity_flip_physical{129}=0x0 -serdes_preemphasis_1=0x45808 -serdes_preemphasis_3=0x45808 -serdes_preemphasis_5=0x45808 -serdes_preemphasis_7=0x45808 -serdes_preemphasis_9=0x45808 -serdes_preemphasis_11=0x45808 -serdes_preemphasis_13=0x45808 -serdes_preemphasis_15=0x45808 -serdes_preemphasis_17=0x45808 -serdes_preemphasis_19=0x45808 -serdes_preemphasis_21=0x45808 -serdes_preemphasis_23=0x45808 -serdes_preemphasis_25=0xd3e05 -serdes_preemphasis_29=0xd3e05 -serdes_preemphasis_33=0xb3403 -serdes_preemphasis_37=0x93603 -serdes_preemphasis_41=0x580c -serdes_preemphasis_43=0x580c -serdes_preemphasis_45=0x580c -serdes_preemphasis_47=0x580c -serdes_preemphasis_49=0x580c -serdes_preemphasis_51=0x580c -serdes_preemphasis_53=0x580c -serdes_preemphasis_55=0x580c -serdes_preemphasis_57=0x580c -serdes_preemphasis_59=0x580c -serdes_preemphasis_61=0x580c -serdes_preemphasis_63=0x580c -serdes_preemphasis_67=0x580c -serdes_preemphasis_69=0x580c -serdes_preemphasis_71=0x580c -serdes_preemphasis_73=0x580c -serdes_preemphasis_75=0x580c -serdes_preemphasis_77=0x580c -serdes_preemphasis_79=0x580c -serdes_preemphasis_81=0x580c -serdes_preemphasis_83=0x580c -serdes_preemphasis_85=0x580c -serdes_preemphasis_87=0x580c -serdes_preemphasis_89=0x580c -serdes_preemphasis_91=0x93603 -serdes_preemphasis_95=0xd3e05 -serdes_preemphasis_99=0xb3403 -serdes_preemphasis_103=0xd3e05 -serdes_preemphasis_107=0x85804 -serdes_preemphasis_109=0x85804 -serdes_preemphasis_111=0x85804 -serdes_preemphasis_113=0x85804 -serdes_preemphasis_115=0x85804 -serdes_preemphasis_117=0x85804 -serdes_preemphasis_119=0x85804 -serdes_preemphasis_121=0x85804 -serdes_preemphasis_123=0x85804 -serdes_preemphasis_125=0x85804 -serdes_preemphasis_127=0x85804 -serdes_preemphasis_129=0x85804 diff --git a/device/arista/x86_64-arista_7050cx3_32s/plugins/pcie.yaml b/device/arista/x86_64-arista_7050cx3_32s/pcie.yaml similarity index 100% rename from device/arista/x86_64-arista_7050cx3_32s/plugins/pcie.yaml rename to device/arista/x86_64-arista_7050cx3_32s/pcie.yaml diff --git a/device/arista/x86_64-arista_7050cx3_32s/platform.json b/device/arista/x86_64-arista_7050cx3_32s/platform.json index 632747ad2333..e291eae41785 100644 --- a/device/arista/x86_64-arista_7050cx3_32s/platform.json +++ b/device/arista/x86_64-arista_7050cx3_32s/platform.json @@ -40,46 +40,71 @@ "psus": [ { "name": "psu1", - "fans": [] + "fans": [ + { + "name": "psu1/1", + "speed": { + "controllable": false + } + } + ] }, { "name": "psu2", - "fans": [] + "fans": [ + { + "name": "psu2/1", + "speed": { + "controllable": false + } + } + ] } ], "thermals": [ { - "name": "Cpu temp sensor" + "name": "Cpu temp sensor", + "controllable": false }, { - "name": "Cpu board temp sensor" + "name": "Cpu board temp sensor", + "controllable": false }, { - "name": "Back-panel temp sensor" + "name": "Back-panel temp sensor", + "controllable": false }, { - "name": "Board temp sensor" + "name": "Board temp sensor", + "controllable": false }, { - "name": "Front-panel temp sensor" + "name": "Front-panel temp sensor", + "controllable": false }, { - "name": "Power supply 1 hotspot sensor" + "name": "Power supply 1 hotspot sensor", + "controllable": false }, { - "name": "Power supply 1 inlet temp sensor" + "name": "Power supply 1 inlet temp sensor", + "controllable": false }, { - "name": "Power supply 1 exhaust temp sensor" + "name": "Power supply 1 exhaust temp sensor", + "controllable": false }, { - "name": "Power supply 2 hotspot sensor" + "name": "Power supply 2 hotspot sensor", + "controllable": false }, { - "name": "Power supply 2 inlet temp sensor" + "name": "Power supply 2 inlet temp sensor", + "controllable": false }, { - "name": "Power supply 2 exhaust temp sensor" + "name": "Power supply 2 exhaust temp sensor", + "controllable": false } ], "sfps": [ @@ -188,4 +213,4 @@ ] }, "interfaces": {} -} \ No newline at end of file +} diff --git a/device/arista/x86_64-arista_7050sx3_48c8 b/device/arista/x86_64-arista_7050sx3_48c8 new file mode 120000 index 000000000000..0334c5411d31 --- /dev/null +++ b/device/arista/x86_64-arista_7050sx3_48c8 @@ -0,0 +1 @@ +x86_64-arista_7050sx3_48yc8 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7050sx3_48yc8/Arista-7050SX3-48YC8/buffers.json.j2 b/device/arista/x86_64-arista_7050sx3_48yc8/Arista-7050SX3-48YC8/buffers.json.j2 new file mode 100644 index 000000000000..1083a6210fc9 --- /dev/null +++ b/device/arista/x86_64-arista_7050sx3_48yc8/Arista-7050SX3-48YC8/buffers.json.j2 @@ -0,0 +1,2 @@ +{%- set default_topo = 't0' %} +{%- include 'buffers_config.j2' %} diff --git a/device/arista/x86_64-arista_7050sx3_48yc8/Arista-7050SX3-48YC8/buffers_defaults_t0.j2 b/device/arista/x86_64-arista_7050sx3_48yc8/Arista-7050SX3-48YC8/buffers_defaults_t0.j2 new file mode 100644 index 000000000000..b6e6a948928d --- /dev/null +++ b/device/arista/x86_64-arista_7050sx3_48yc8/Arista-7050SX3-48YC8/buffers_defaults_t0.j2 @@ -0,0 +1,50 @@ +{%- set default_cable = '5m' %} + +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {%- for port_idx in range(0,28) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{%- endif %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 2)) %}{%- endif %} + {%- endfor %} + {%- for port_idx in range(28,32) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{%- endif %} + {%- endfor %} +{%- endmacro %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "10875072", + "type": "ingress", + "mode": "dynamic", + "xoff": "4194112" + }, + "egress_lossy_pool": { + "size": "9243812", + "type": "egress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "15982720", + "type": "egress", + "mode": "static" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "dynamic_th":"3" + }, + "egress_lossless_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"1518", + "static_th":"15982720" + }, + "egress_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"1518", + "dynamic_th":"3" + } + }, +{%- endmacro %} diff --git a/device/arista/x86_64-arista_7050sx3_48yc8/Arista-7050SX3-48YC8/pg_profile_lookup.ini b/device/arista/x86_64-arista_7050sx3_48yc8/Arista-7050SX3-48YC8/pg_profile_lookup.ini new file mode 100644 index 000000000000..0b5d680edda7 --- /dev/null +++ b/device/arista/x86_64-arista_7050sx3_48yc8/Arista-7050SX3-48YC8/pg_profile_lookup.ini @@ -0,0 +1,17 @@ +# PG lossless profiles. +# speed cable size xon xoff threshold xon_offset + 10000 5m 1248 2288 35776 0 2288 + 25000 5m 1248 2288 53248 0 2288 + 40000 5m 1248 2288 66560 0 2288 + 50000 5m 1248 2288 79872 0 2288 + 100000 5m 1248 2288 165568 0 2288 + 10000 40m 1248 2288 37024 0 2288 + 25000 40m 1248 2288 56160 0 2288 + 40000 40m 1248 2288 71552 0 2288 + 50000 40m 1248 2288 85696 0 2288 + 100000 40m 1248 2288 177632 0 2288 + 10000 300m 1248 2288 46176 0 2288 + 25000 300m 1248 2288 79040 0 2288 + 40000 300m 1248 2288 108160 0 2288 + 50000 300m 1248 2288 141856 0 2288 + 100000 300m 1248 2288 268736 0 2288 diff --git a/device/arista/x86_64-arista_7050sx3_48yc8/Arista-7050SX3-48YC8/port_config.ini b/device/arista/x86_64-arista_7050sx3_48yc8/Arista-7050SX3-48YC8/port_config.ini new file mode 100644 index 000000000000..bccaa602f203 --- /dev/null +++ b/device/arista/x86_64-arista_7050sx3_48yc8/Arista-7050SX3-48YC8/port_config.ini @@ -0,0 +1,57 @@ +# name lanes alias index speed +Ethernet0 1,2 Ethernet1/1 1 25000 +Ethernet2 3,4 Ethernet1/3 1 25000 +Ethernet4 5,6 Ethernet2/1 2 25000 +Ethernet6 7,8 Ethernet2/3 2 25000 +Ethernet8 9,10 Ethernet3/1 3 25000 +Ethernet10 11,12 Ethernet3/3 3 25000 +Ethernet12 13,14 Ethernet4/1 4 25000 +Ethernet14 15,16 Ethernet4/3 4 25000 +Ethernet16 21,22 Ethernet5/1 5 25000 +Ethernet18 23,24 Ethernet5/3 5 25000 +Ethernet20 17,18 Ethernet6/1 6 25000 +Ethernet22 19,20 Ethernet6/3 6 25000 +Ethernet24 25,26 Ethernet7/1 7 25000 +Ethernet26 27,28 Ethernet7/3 7 25000 +Ethernet28 29,30 Ethernet8/1 8 25000 +Ethernet30 31,32 Ethernet8/3 8 25000 +Ethernet32 37,38 Ethernet9/1 9 25000 +Ethernet34 39,40 Ethernet9/3 9 25000 +Ethernet36 33,34 Ethernet10/1 10 25000 +Ethernet38 35,46 Ethernet10/3 10 25000 +Ethernet40 41,42 Ethernet11/1 11 25000 +Ethernet42 43,44 Ethernet11/3 11 25000 +Ethernet44 45,46 Ethernet12/1 12 25000 +Ethernet46 47,48 Ethernet12/3 12 25000 +Ethernet48 53,54 Ethernet13/1 13 25000 +Ethernet50 55,56 Ethernet13/3 13 25000 +Ethernet52 49,50 Ethernet14/1 14 25000 +Ethernet54 51,52 Ethernet14/3 14 25000 +Ethernet56 57,58 Ethernet15/1 15 25000 +Ethernet58 59,60 Ethernet15/3 15 25000 +Ethernet60 61,62 Ethernet16/1 16 25000 +Ethernet62 63,64 Ethernet16/3 16 25000 +Ethernet64 69,70 Ethernet17/1 17 25000 +Ethernet66 71,72 Ethernet17/3 17 25000 +Ethernet68 65,66 Ethernet18/1 18 25000 +Ethernet70 67,68 Ethernet18/3 18 25000 +Ethernet72 73,74 Ethernet19/1 19 25000 +Ethernet74 75,76 Ethernet19/3 19 25000 +Ethernet76 77,78 Ethernet20/1 20 25000 +Ethernet78 79,80 Ethernet20/3 20 25000 +Ethernet80 85,86 Ethernet21/1 21 25000 +Ethernet82 87,88 Ethernet21/3 21 25000 +Ethernet84 81,82 Ethernet22/1 22 25000 +Ethernet86 83,84 Ethernet22/3 22 25000 +Ethernet88 89,90 Ethernet23/1 23 25000 +Ethernet88 91,92 Ethernet23/3 23 25000 +Ethernet92 93,94 Ethernet24/1 24 25000 +Ethernet92 95,96 Ethernet24/3 24 25000 +Ethernet96 101,102,103,104 Ethernet25/1 25 100000 +Ethernet100 97,98,99,100 Ethernet26/1 26 100000 +Ethernet104 105,106,107,108 Ethernet27/1 27 100000 +Ethernet108 109,110,111,112 Ethernet28/1 28 100000 +Ethernet112 117,118,119,120 Ethernet29/1 29 100000 +Ethernet116 113,114,115,116 Ethernet30/1 30 100000 +Ethernet120 121,122,123,124 Ethernet31/1 31 100000 +Ethernet124 125,126,127,128 Ethernet32/1 32 100000 diff --git a/device/arista/x86_64-arista_7050sx3_48yc8/Arista-7050SX3-48YC8/qos.json.j2 b/device/arista/x86_64-arista_7050sx3_48yc8/Arista-7050SX3-48YC8/qos.json.j2 new file mode 100644 index 000000000000..34002048afdb --- /dev/null +++ b/device/arista/x86_64-arista_7050sx3_48yc8/Arista-7050SX3-48YC8/qos.json.j2 @@ -0,0 +1,21 @@ +{%- macro generate_wred_profiles() %} + "WRED_PROFILE": { + "AZURE_LOSSLESS" : { + "wred_green_enable" : "true", + "wred_yellow_enable" : "true", + "wred_red_enable" : "true", + "ecn" : "ecn_all", + "green_max_threshold" : "2097152", + "green_min_threshold" : "250000", + "yellow_max_threshold" : "2097152", + "yellow_min_threshold" : "1048576", + "red_max_threshold" : "2097152", + "red_min_threshold" : "1048576", + "green_drop_probability" : "5", + "yellow_drop_probability": "5", + "red_drop_probability" : "5" + } + }, +{%- endmacro %} + +{%- include 'qos_config.j2' %} diff --git a/device/arista/x86_64-arista_7050sx3_48yc8/Arista-7050SX3-48YC8/sai.profile b/device/arista/x86_64-arista_7050sx3_48yc8/Arista-7050SX3-48YC8/sai.profile new file mode 100644 index 000000000000..7342226cd38c --- /dev/null +++ b/device/arista/x86_64-arista_7050sx3_48yc8/Arista-7050SX3-48YC8/sai.profile @@ -0,0 +1,2 @@ +SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/td3-a7050sx3_48yc8-48x25G+8x100G.config.bcm +SAI_NUM_ECMP_MEMBERS=64 diff --git a/device/arista/x86_64-arista_7050sx3_48yc8/Arista-7050SX3-48YC8/td3-a7050sx3_48yc8-48x25G+8x100G.config.bcm b/device/arista/x86_64-arista_7050sx3_48yc8/Arista-7050SX3-48YC8/td3-a7050sx3_48yc8-48x25G+8x100G.config.bcm new file mode 100644 index 000000000000..e99cc4b58ea7 --- /dev/null +++ b/device/arista/x86_64-arista_7050sx3_48yc8/Arista-7050SX3-48YC8/td3-a7050sx3_48yc8-48x25G+8x100G.config.bcm @@ -0,0 +1,422 @@ +PHY_AN_ALLOW_PLL_CHANGE=1 +arl_clean_timeout_usec=15000000 +asf_mem_profile=2 +bcm_num_cos=10 +bcm_stat_flags=1 +bcm_stat_jumbo=9236 +cdma_timeout_usec=15000000 +dma_desc_timeout_usec=15000000 +fpem_mem_entries=0 +higig2_hdr_mode=1 +ifp_inports_support_enable=1 +ipv6_lpm_128b_enable=0 +l2xmsg_mode=1 +l2_mem_entries=163840 +l3_mem_entries=147456 +max_vp_lags=0 +miim_intr_enable=0 +module_64ports=1 +multicast_l2_range=16383 +multicast_l3_range=0 +num_ipv6_lpm_128b_entries=0 +os=unix +oversubscribe_mode=1 +pbmp_xport_xe=0x1ffffffe1ffffffe +phy_an_c73_1=1 +phy_an_c73_2=1 +phy_an_c73_3=1 +phy_an_c73_4=1 +phy_an_c73_5=1 +phy_an_c73_6=1 +phy_an_c73_7=1 +phy_an_c73_8=1 +phy_an_c73_9=1 +phy_an_c73_10=1 +phy_an_c73_11=1 +phy_an_c73_12=1 +phy_an_c73_13=1 +phy_an_c73_14=1 +phy_an_c73_15=1 +phy_an_c73_16=1 +phy_an_c73_17=1 +phy_an_c73_18=1 +phy_an_c73_19=1 +phy_an_c73_20=1 +phy_an_c73_21=1 +phy_an_c73_22=1 +phy_an_c73_23=1 +phy_an_c73_24=1 +phy_an_c73_25=0 +phy_an_c73_26=0 +phy_an_c73_27=0 +phy_an_c73_28=0 +phy_an_c73_33=1 +phy_an_c73_34=1 +phy_an_c73_35=1 +phy_an_c73_36=1 +phy_an_c73_37=1 +phy_an_c73_38=1 +phy_an_c73_39=1 +phy_an_c73_40=1 +phy_an_c73_41=1 +phy_an_c73_42=1 +phy_an_c73_43=1 +phy_an_c73_44=1 +phy_an_c73_45=1 +phy_an_c73_46=1 +phy_an_c73_47=1 +phy_an_c73_48=1 +phy_an_c73_49=1 +phy_an_c73_50=1 +phy_an_c73_51=1 +phy_an_c73_52=1 +phy_an_c73_53=1 +phy_an_c73_54=1 +phy_an_c73_55=1 +phy_an_c73_56=1 +phy_an_c73_57=0 +phy_an_c73_58=0 +phy_an_c73_59=0 +phy_an_c73_60=0 +phy_chain_rx_lane_map_physical{1.0}=0x0123 +phy_chain_rx_lane_map_physical{5.0}=0x0123 +phy_chain_rx_lane_map_physical{9.0}=0x0123 +phy_chain_rx_lane_map_physical{13.0}=0x0123 +phy_chain_rx_lane_map_physical{17.0}=0x0123 +phy_chain_rx_lane_map_physical{21.0}=0x0123 +phy_chain_rx_lane_map_physical{25.0}=0x0213 +phy_chain_rx_lane_map_physical{29.0}=0x2031 +phy_chain_rx_lane_map_physical{33.0}=0x1302 +phy_chain_rx_lane_map_physical{37.0}=0x3120 +phy_chain_rx_lane_map_physical{41.0}=0x2031 +phy_chain_rx_lane_map_physical{45.0}=0x0213 +phy_chain_rx_lane_map_physical{49.0}=0x2031 +phy_chain_rx_lane_map_physical{53.0}=0x0213 +phy_chain_rx_lane_map_physical{57.0}=0x3210 +phy_chain_rx_lane_map_physical{61.0}=0x3210 +phy_chain_rx_lane_map_physical{65.0}=0x3210 +phy_chain_rx_lane_map_physical{69.0}=0x3210 +phy_chain_rx_lane_map_physical{73.0}=0x3210 +phy_chain_rx_lane_map_physical{77.0}=0x3210 +phy_chain_rx_polarity_flip_physical{1.0}=0x0 +phy_chain_rx_polarity_flip_physical{2.0}=0x1 +phy_chain_rx_polarity_flip_physical{3.0}=0x0 +phy_chain_rx_polarity_flip_physical{4.0}=0x1 +phy_chain_rx_polarity_flip_physical{5.0}=0x1 +phy_chain_rx_polarity_flip_physical{6.0}=0x0 +phy_chain_rx_polarity_flip_physical{7.0}=0x1 +phy_chain_rx_polarity_flip_physical{8.0}=0x0 +phy_chain_rx_polarity_flip_physical{9.0}=0x1 +phy_chain_rx_polarity_flip_physical{10.0}=0x0 +phy_chain_rx_polarity_flip_physical{11.0}=0x1 +phy_chain_rx_polarity_flip_physical{12.0}=0x0 +phy_chain_rx_polarity_flip_physical{13.0}=0x1 +phy_chain_rx_polarity_flip_physical{14.0}=0x0 +phy_chain_rx_polarity_flip_physical{15.0}=0x1 +phy_chain_rx_polarity_flip_physical{16.0}=0x0 +phy_chain_rx_polarity_flip_physical{17.0}=0x0 +phy_chain_rx_polarity_flip_physical{18.0}=0x1 +phy_chain_rx_polarity_flip_physical{19.0}=0x0 +phy_chain_rx_polarity_flip_physical{20.0}=0x1 +phy_chain_rx_polarity_flip_physical{21.0}=0x1 +phy_chain_rx_polarity_flip_physical{22.0}=0x0 +phy_chain_rx_polarity_flip_physical{23.0}=0x1 +phy_chain_rx_polarity_flip_physical{24.0}=0x0 +phy_chain_rx_polarity_flip_physical{25.0}=0x0 +phy_chain_rx_polarity_flip_physical{26.0}=0x0 +phy_chain_rx_polarity_flip_physical{27.0}=0x0 +phy_chain_rx_polarity_flip_physical{28.0}=0x0 +phy_chain_rx_polarity_flip_physical{29.0}=0x0 +phy_chain_rx_polarity_flip_physical{30.0}=0x0 +phy_chain_rx_polarity_flip_physical{31.0}=0x1 +phy_chain_rx_polarity_flip_physical{32.0}=0x1 +phy_chain_rx_polarity_flip_physical{33.0}=0x1 +phy_chain_rx_polarity_flip_physical{34.0}=0x1 +phy_chain_rx_polarity_flip_physical{35.0}=0x0 +phy_chain_rx_polarity_flip_physical{36.0}=0x0 +phy_chain_rx_polarity_flip_physical{37.0}=0x1 +phy_chain_rx_polarity_flip_physical{38.0}=0x0 +phy_chain_rx_polarity_flip_physical{39.0}=0x0 +phy_chain_rx_polarity_flip_physical{40.0}=0x0 +phy_chain_rx_polarity_flip_physical{41.0}=0x1 +phy_chain_rx_polarity_flip_physical{42.0}=0x0 +phy_chain_rx_polarity_flip_physical{43.0}=0x0 +phy_chain_rx_polarity_flip_physical{44.0}=0x1 +phy_chain_rx_polarity_flip_physical{45.0}=0x1 +phy_chain_rx_polarity_flip_physical{46.0}=0x0 +phy_chain_rx_polarity_flip_physical{47.0}=0x0 +phy_chain_rx_polarity_flip_physical{48.0}=0x1 +phy_chain_rx_polarity_flip_physical{49.0}=0x0 +phy_chain_rx_polarity_flip_physical{50.0}=0x0 +phy_chain_rx_polarity_flip_physical{51.0}=0x0 +phy_chain_rx_polarity_flip_physical{52.0}=0x1 +phy_chain_rx_polarity_flip_physical{53.0}=0x1 +phy_chain_rx_polarity_flip_physical{54.0}=0x0 +phy_chain_rx_polarity_flip_physical{55.0}=0x0 +phy_chain_rx_polarity_flip_physical{56.0}=0x1 +phy_chain_rx_polarity_flip_physical{57.0}=0x0 +phy_chain_rx_polarity_flip_physical{58.0}=0x1 +phy_chain_rx_polarity_flip_physical{59.0}=0x0 +phy_chain_rx_polarity_flip_physical{60.0}=0x1 +phy_chain_rx_polarity_flip_physical{61.0}=0x1 +phy_chain_rx_polarity_flip_physical{62.0}=0x0 +phy_chain_rx_polarity_flip_physical{63.0}=0x1 +phy_chain_rx_polarity_flip_physical{64.0}=0x0 +phy_chain_rx_polarity_flip_physical{65.0}=0x0 +phy_chain_rx_polarity_flip_physical{66.0}=0x1 +phy_chain_rx_polarity_flip_physical{67.0}=0x0 +phy_chain_rx_polarity_flip_physical{68.0}=0x1 +phy_chain_rx_polarity_flip_physical{69.0}=0x0 +phy_chain_rx_polarity_flip_physical{70.0}=0x1 +phy_chain_rx_polarity_flip_physical{71.0}=0x0 +phy_chain_rx_polarity_flip_physical{72.0}=0x1 +phy_chain_rx_polarity_flip_physical{73.0}=0x0 +phy_chain_rx_polarity_flip_physical{74.0}=0x1 +phy_chain_rx_polarity_flip_physical{75.0}=0x0 +phy_chain_rx_polarity_flip_physical{76.0}=0x1 +phy_chain_rx_polarity_flip_physical{77.0}=0x1 +phy_chain_rx_polarity_flip_physical{78.0}=0x0 +phy_chain_rx_polarity_flip_physical{79.0}=0x1 +phy_chain_rx_polarity_flip_physical{80.0}=0x0 +phy_chain_tx_lane_map_physical{1.0}=0x0123 +phy_chain_tx_lane_map_physical{5.0}=0x0123 +phy_chain_tx_lane_map_physical{9.0}=0x0123 +phy_chain_tx_lane_map_physical{13.0}=0x0123 +phy_chain_tx_lane_map_physical{17.0}=0x0123 +phy_chain_tx_lane_map_physical{21.0}=0x0123 +phy_chain_tx_lane_map_physical{25.0}=0x0123 +phy_chain_tx_lane_map_physical{29.0}=0x3210 +phy_chain_tx_lane_map_physical{33.0}=0x0123 +phy_chain_tx_lane_map_physical{37.0}=0x3201 +phy_chain_tx_lane_map_physical{41.0}=0x3201 +phy_chain_tx_lane_map_physical{45.0}=0x0123 +phy_chain_tx_lane_map_physical{49.0}=0x3201 +phy_chain_tx_lane_map_physical{53.0}=0x0132 +phy_chain_tx_lane_map_physical{57.0}=0x3210 +phy_chain_tx_lane_map_physical{61.0}=0x3210 +phy_chain_tx_lane_map_physical{65.0}=0x3210 +phy_chain_tx_lane_map_physical{69.0}=0x3210 +phy_chain_tx_lane_map_physical{73.0}=0x3210 +phy_chain_tx_lane_map_physical{77.0}=0x3210 +phy_chain_tx_polarity_flip_physical{1.0}=0x0 +phy_chain_tx_polarity_flip_physical{2.0}=0x0 +phy_chain_tx_polarity_flip_physical{3.0}=0x0 +phy_chain_tx_polarity_flip_physical{4.0}=0x0 +phy_chain_tx_polarity_flip_physical{5.0}=0x0 +phy_chain_tx_polarity_flip_physical{6.0}=0x0 +phy_chain_tx_polarity_flip_physical{7.0}=0x0 +phy_chain_tx_polarity_flip_physical{8.0}=0x0 +phy_chain_tx_polarity_flip_physical{9.0}=0x0 +phy_chain_tx_polarity_flip_physical{10.0}=0x0 +phy_chain_tx_polarity_flip_physical{11.0}=0x0 +phy_chain_tx_polarity_flip_physical{12.0}=0x0 +phy_chain_tx_polarity_flip_physical{13.0}=0x0 +phy_chain_tx_polarity_flip_physical{14.0}=0x0 +phy_chain_tx_polarity_flip_physical{15.0}=0x0 +phy_chain_tx_polarity_flip_physical{16.0}=0x0 +phy_chain_tx_polarity_flip_physical{17.0}=0x0 +phy_chain_tx_polarity_flip_physical{18.0}=0x0 +phy_chain_tx_polarity_flip_physical{19.0}=0x0 +phy_chain_tx_polarity_flip_physical{20.0}=0x0 +phy_chain_tx_polarity_flip_physical{21.0}=0x0 +phy_chain_tx_polarity_flip_physical{22.0}=0x0 +phy_chain_tx_polarity_flip_physical{23.0}=0x0 +phy_chain_tx_polarity_flip_physical{24.0}=0x0 +phy_chain_tx_polarity_flip_physical{25.0}=0x0 +phy_chain_tx_polarity_flip_physical{26.0}=0x0 +phy_chain_tx_polarity_flip_physical{27.0}=0x0 +phy_chain_tx_polarity_flip_physical{28.0}=0x0 +phy_chain_tx_polarity_flip_physical{29.0}=0x0 +phy_chain_tx_polarity_flip_physical{30.0}=0x0 +phy_chain_tx_polarity_flip_physical{31.0}=0x0 +phy_chain_tx_polarity_flip_physical{32.0}=0x0 +phy_chain_tx_polarity_flip_physical{33.0}=0x0 +phy_chain_tx_polarity_flip_physical{34.0}=0x0 +phy_chain_tx_polarity_flip_physical{35.0}=0x0 +phy_chain_tx_polarity_flip_physical{36.0}=0x0 +phy_chain_tx_polarity_flip_physical{37.0}=0x0 +phy_chain_tx_polarity_flip_physical{38.0}=0x0 +phy_chain_tx_polarity_flip_physical{39.0}=0x0 +phy_chain_tx_polarity_flip_physical{40.0}=0x1 +phy_chain_tx_polarity_flip_physical{41.0}=0x0 +phy_chain_tx_polarity_flip_physical{42.0}=0x0 +phy_chain_tx_polarity_flip_physical{43.0}=0x0 +phy_chain_tx_polarity_flip_physical{44.0}=0x0 +phy_chain_tx_polarity_flip_physical{45.0}=0x0 +phy_chain_tx_polarity_flip_physical{46.0}=0x0 +phy_chain_tx_polarity_flip_physical{47.0}=0x0 +phy_chain_tx_polarity_flip_physical{48.0}=0x1 +phy_chain_tx_polarity_flip_physical{49.0}=0x1 +phy_chain_tx_polarity_flip_physical{50.0}=0x0 +phy_chain_tx_polarity_flip_physical{51.0}=0x0 +phy_chain_tx_polarity_flip_physical{52.0}=0x0 +phy_chain_tx_polarity_flip_physical{53.0}=0x0 +phy_chain_tx_polarity_flip_physical{54.0}=0x0 +phy_chain_tx_polarity_flip_physical{55.0}=0x0 +phy_chain_tx_polarity_flip_physical{56.0}=0x0 +phy_chain_tx_polarity_flip_physical{57.0}=0x1 +phy_chain_tx_polarity_flip_physical{58.0}=0x1 +phy_chain_tx_polarity_flip_physical{59.0}=0x1 +phy_chain_tx_polarity_flip_physical{60.0}=0x1 +phy_chain_tx_polarity_flip_physical{61.0}=0x1 +phy_chain_tx_polarity_flip_physical{62.0}=0x1 +phy_chain_tx_polarity_flip_physical{63.0}=0x1 +phy_chain_tx_polarity_flip_physical{64.0}=0x0 +phy_chain_tx_polarity_flip_physical{65.0}=0x0 +phy_chain_tx_polarity_flip_physical{66.0}=0x0 +phy_chain_tx_polarity_flip_physical{67.0}=0x0 +phy_chain_tx_polarity_flip_physical{68.0}=0x0 +phy_chain_tx_polarity_flip_physical{69.0}=0x0 +phy_chain_tx_polarity_flip_physical{70.0}=0x0 +phy_chain_tx_polarity_flip_physical{71.0}=0x0 +phy_chain_tx_polarity_flip_physical{72.0}=0x0 +phy_chain_tx_polarity_flip_physical{73.0}=0x0 +phy_chain_tx_polarity_flip_physical{74.0}=0x0 +phy_chain_tx_polarity_flip_physical{75.0}=0x0 +phy_chain_tx_polarity_flip_physical{76.0}=0x0 +phy_chain_tx_polarity_flip_physical{77.0}=0x0 +phy_chain_tx_polarity_flip_physical{78.0}=0x0 +phy_chain_tx_polarity_flip_physical{79.0}=0x0 +phy_chain_tx_polarity_flip_physical{80.0}=0x0 +portmap_1=1:25 +portmap_2=2:25 +portmap_3=3:25 +portmap_4=4:25 +portmap_5=5:25 +portmap_6=6:25 +portmap_7=7:25 +portmap_8=8:25 +portmap_9=9:25 +portmap_10=10:25 +portmap_11=11:25 +portmap_12=12:25 +portmap_13=13:25 +portmap_14=14:25 +portmap_15=15:25 +portmap_16=16:25 +portmap_17=17:25 +portmap_18=18:25 +portmap_19=19:25 +portmap_20=20:25 +portmap_21=21:25 +portmap_22=22:25 +portmap_23=23:25 +portmap_24=24:25 +portmap_25=25:100:4 +portmap_26=29:100:4 +portmap_27=33:100:4 +portmap_28=37:100:4 +portmap_33=57:25 +portmap_34=58:25 +portmap_35=59:25 +portmap_36=60:25 +portmap_37=61:25 +portmap_38=62:25 +portmap_39=63:25 +portmap_40=64:25 +portmap_41=65:25 +portmap_42=66:25 +portmap_43=67:25 +portmap_44=68:25 +portmap_45=69:25 +portmap_46=70:25 +portmap_47=71:25 +portmap_48=72:25 +portmap_49=73:25 +portmap_50=74:25 +portmap_51=75:25 +portmap_52=76:25 +portmap_53=77:25 +portmap_54=78:25 +portmap_55=79:25 +portmap_56=80:25 +portmap_57=41:100:4 +portmap_58=45:100:4 +portmap_59=49:100:4 +portmap_60=53:100:4 +port_flex_enable=1 +port_init_autoneg_1=0 +port_init_autoneg_5=0 +port_init_autoneg_9=0 +port_init_autoneg_13=0 +port_init_autoneg_17=0 +port_init_autoneg_21=0 +port_init_autoneg_25=0 +port_init_autoneg_26=0 +port_init_autoneg_27=0 +port_init_autoneg_28=0 +port_init_autoneg_33=0 +port_init_autoneg_37=0 +port_init_autoneg_41=0 +port_init_autoneg_45=0 +port_init_autoneg_49=0 +port_init_autoneg_53=0 +port_init_autoneg_57=0 +port_init_autoneg_58=0 +port_init_autoneg_59=0 +port_init_autoneg_60=0 +port_phy_addr_1=0xff +port_phy_addr_5=0xff +port_phy_addr_9=0xff +port_phy_addr_13=0xff +port_phy_addr_17=0xff +port_phy_addr_21=0xff +port_phy_addr_25=0xff +port_phy_addr_26=0xff +port_phy_addr_27=0xff +port_phy_addr_28=0xff +port_phy_addr_33=0xff +port_phy_addr_37=0xff +port_phy_addr_41=0xff +port_phy_addr_45=0xff +port_phy_addr_49=0xff +port_phy_addr_53=0xff +port_phy_addr_57=0xff +port_phy_addr_58=0xff +port_phy_addr_59=0xff +port_phy_addr_60=0xff +robust_hash_disable_egress_vlan=1 +robust_hash_disable_mpls=1 +robust_hash_disable_vlan=1 +serdes_core_rx_polarity_flip_physical{1}=0xa +serdes_core_rx_polarity_flip_physical{5}=0x5 +serdes_core_rx_polarity_flip_physical{9}=0x5 +serdes_core_rx_polarity_flip_physical{13}=0x5 +serdes_core_rx_polarity_flip_physical{17}=0xa +serdes_core_rx_polarity_flip_physical{21}=0x5 +serdes_core_rx_polarity_flip_physical{25}=0x0 +serdes_core_rx_polarity_flip_physical{29}=0xc +serdes_core_rx_polarity_flip_physical{33}=0x3 +serdes_core_rx_polarity_flip_physical{37}=0x1 +serdes_core_rx_polarity_flip_physical{41}=0x9 +serdes_core_rx_polarity_flip_physical{45}=0x9 +serdes_core_rx_polarity_flip_physical{49}=0x8 +serdes_core_rx_polarity_flip_physical{53}=0x9 +serdes_core_rx_polarity_flip_physical{57}=0xa +serdes_core_rx_polarity_flip_physical{61}=0x5 +serdes_core_rx_polarity_flip_physical{65}=0xa +serdes_core_rx_polarity_flip_physical{69}=0xa +serdes_core_rx_polarity_flip_physical{73}=0xa +serdes_core_rx_polarity_flip_physical{77}=0x5 +serdes_core_tx_polarity_flip_physical{1}=0x0 +serdes_core_tx_polarity_flip_physical{5}=0x0 +serdes_core_tx_polarity_flip_physical{9}=0x0 +serdes_core_tx_polarity_flip_physical{13}=0x0 +serdes_core_tx_polarity_flip_physical{17}=0x0 +serdes_core_tx_polarity_flip_physical{21}=0x0 +serdes_core_tx_polarity_flip_physical{25}=0x0 +serdes_core_tx_polarity_flip_physical{29}=0x0 +serdes_core_tx_polarity_flip_physical{33}=0x0 +serdes_core_tx_polarity_flip_physical{37}=0x8 +serdes_core_tx_polarity_flip_physical{41}=0x0 +serdes_core_tx_polarity_flip_physical{45}=0x8 +serdes_core_tx_polarity_flip_physical{49}=0x1 +serdes_core_tx_polarity_flip_physical{53}=0x0 +serdes_core_tx_polarity_flip_physical{57}=0xf +serdes_core_tx_polarity_flip_physical{61}=0x7 +serdes_core_tx_polarity_flip_physical{65}=0x0 +serdes_core_tx_polarity_flip_physical{69}=0x0 +serdes_core_tx_polarity_flip_physical{73}=0x0 +serdes_core_tx_polarity_flip_physical{77}=0x0 +tdma_timeout_usec=15000000 +tslam_timeout_usec=15000000 diff --git a/device/arista/x86_64-arista_7050sx3_48yc8/default_sku b/device/arista/x86_64-arista_7050sx3_48yc8/default_sku new file mode 100644 index 000000000000..4332a11e9f75 --- /dev/null +++ b/device/arista/x86_64-arista_7050sx3_48yc8/default_sku @@ -0,0 +1 @@ +Arista-7050SX3-48YC8 t1 diff --git a/device/arista/x86_64-arista_7050sx3_48yc8/platform_reboot b/device/arista/x86_64-arista_7050sx3_48yc8/platform_reboot new file mode 120000 index 000000000000..7f94a49e38b0 --- /dev/null +++ b/device/arista/x86_64-arista_7050sx3_48yc8/platform_reboot @@ -0,0 +1 @@ +../x86_64-arista_common/platform_reboot \ No newline at end of file diff --git a/device/arista/x86_64-arista_7050sx3_48yc8/plugins/eeprom.py b/device/arista/x86_64-arista_7050sx3_48yc8/plugins/eeprom.py new file mode 120000 index 000000000000..35cfaff3de4e --- /dev/null +++ b/device/arista/x86_64-arista_7050sx3_48yc8/plugins/eeprom.py @@ -0,0 +1 @@ +../../x86_64-arista_common/plugins/eeprom.py \ No newline at end of file diff --git a/device/arista/x86_64-arista_7050sx3_48yc8/plugins/led_control.py b/device/arista/x86_64-arista_7050sx3_48yc8/plugins/led_control.py new file mode 120000 index 000000000000..8d733780117e --- /dev/null +++ b/device/arista/x86_64-arista_7050sx3_48yc8/plugins/led_control.py @@ -0,0 +1 @@ +../../x86_64-arista_common/plugins/led_control.py \ No newline at end of file diff --git a/device/arista/x86_64-arista_7050sx3_48yc8/plugins/psuutil.py b/device/arista/x86_64-arista_7050sx3_48yc8/plugins/psuutil.py new file mode 120000 index 000000000000..2b0024ade969 --- /dev/null +++ b/device/arista/x86_64-arista_7050sx3_48yc8/plugins/psuutil.py @@ -0,0 +1 @@ +../../x86_64-arista_common/plugins/psuutil.py \ No newline at end of file diff --git a/device/arista/x86_64-arista_7050sx3_48yc8/plugins/sfputil.py b/device/arista/x86_64-arista_7050sx3_48yc8/plugins/sfputil.py new file mode 120000 index 000000000000..c333e23763d7 --- /dev/null +++ b/device/arista/x86_64-arista_7050sx3_48yc8/plugins/sfputil.py @@ -0,0 +1 @@ +../../x86_64-arista_common/plugins/sfputil.py \ No newline at end of file diff --git a/device/arista/x86_64-arista_7050sx3_48yc8/pmon_daemon_control.json b/device/arista/x86_64-arista_7050sx3_48yc8/pmon_daemon_control.json new file mode 120000 index 000000000000..51d5ab7b0059 --- /dev/null +++ b/device/arista/x86_64-arista_7050sx3_48yc8/pmon_daemon_control.json @@ -0,0 +1 @@ +../x86_64-arista_common/pmon_daemon_control.json \ No newline at end of file diff --git a/device/arista/x86_64-arista_7050sx3_48yc8/sensors.conf b/device/arista/x86_64-arista_7050sx3_48yc8/sensors.conf new file mode 100644 index 000000000000..c6c60f294675 --- /dev/null +++ b/device/arista/x86_64-arista_7050sx3_48yc8/sensors.conf @@ -0,0 +1,50 @@ +# libsensors configuration file for DCS-7050SX3-48YC8 +# --------------------------------------------------- +# + +bus "i2c-8" "SCD 0000:02:00.0 SMBus master 0 bus 0" +bus "i2c-9" "SCD 0000:02:00.0 SMBus master 0 bus 1" +bus "i2c-10" "SCD 0000:02:00.0 SMBus master 0 bus 2" +bus "i2c-72" "SCD 0000:00:09.0 SMBus master 0 bus 2" + +chip "k10temp-pci-00c3" + label temp1 "Cpu temp sensor" + +chip "pmbus-i2c-8-58" + label temp1 "Power supply 1 hotspot sensor" + label temp2 "Power supply 1 inlet temp sensor" + label temp3 "Power supply 1 sensor" + +chip "pmbus-i2c-9-58" + label temp1 "Power supply 2 hotspot sensor" + label temp2 "Power supply 2 inlet temp sensor" + label temp3 "Power supply 2 sensor" + +chip "max6658-i2c-72-4c" + label temp1 "Board temp sensor" + set temp1_max 75 + set temp1_crit 85 + + label temp2 "Front panel temp sensor" + set temp2_max 75 + set temp2_crit 85 + +chip "tmp464-i2c-10-48" + label temp1 "Switch Card temp sensor" + set temp1_max 100 + set temp1_crit 110 + + label temp2 "Front-panel temp sensor" + set temp2_max 65 + set temp2_crit 75 + + label temp3 "Front PCB temp sensor" + set temp3_max 75 + set temp3_crit 80 + + ignore temp4 + ignore temp5 + ignore temp6 + ignore temp7 + ignore temp8 + ignore temp9 diff --git a/device/arista/x86_64-arista_7050sx3_48yc8/system_health_monitoring_config.json b/device/arista/x86_64-arista_7050sx3_48yc8/system_health_monitoring_config.json new file mode 120000 index 000000000000..1185f771fa8e --- /dev/null +++ b/device/arista/x86_64-arista_7050sx3_48yc8/system_health_monitoring_config.json @@ -0,0 +1 @@ +../x86_64-arista_common/system_health_monitoring_config.json \ No newline at end of file diff --git a/device/arista/x86_64-arista_7050sx3_48yc8/thermal_policy.json b/device/arista/x86_64-arista_7050sx3_48yc8/thermal_policy.json new file mode 120000 index 000000000000..0991dc7f3638 --- /dev/null +++ b/device/arista/x86_64-arista_7050sx3_48yc8/thermal_policy.json @@ -0,0 +1 @@ +../x86_64-arista_common/thermal_policy.json \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-C32/BALANCED b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-C32/BALANCED new file mode 120000 index 000000000000..87afd08ffcd8 --- /dev/null +++ b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-C32/BALANCED @@ -0,0 +1 @@ +../../../common/profiles/th/gen/BALANCED \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-C32/RDMA-CENTRIC b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-C32/RDMA-CENTRIC new file mode 120000 index 000000000000..a05581efb9ff --- /dev/null +++ b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-C32/RDMA-CENTRIC @@ -0,0 +1 @@ +../../../common/profiles/th/gen/RDMA-CENTRIC \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-C32/TCP-CENTRIC b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-C32/TCP-CENTRIC new file mode 120000 index 000000000000..dd9cf046c0f9 --- /dev/null +++ b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-C32/TCP-CENTRIC @@ -0,0 +1 @@ +../../../common/profiles/th/gen/TCP-CENTRIC \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-C32/buffer_ports_t0.j2 b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-C32/buffer_ports_t0.j2 new file mode 100644 index 000000000000..2f41924b4fcf --- /dev/null +++ b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-C32/buffer_ports_t0.j2 @@ -0,0 +1,6 @@ +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {%- for port_idx in range(0,128,4) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{%- endif %} + {%- endfor %} +{%- endmacro %} diff --git a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-C32/buffer_ports_t1.j2 b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-C32/buffer_ports_t1.j2 new file mode 100644 index 000000000000..2f41924b4fcf --- /dev/null +++ b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-C32/buffer_ports_t1.j2 @@ -0,0 +1,6 @@ +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {%- for port_idx in range(0,128,4) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{%- endif %} + {%- endfor %} +{%- endmacro %} diff --git a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-C32/buffers_defaults_t0.j2 b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-C32/buffers_defaults_t0.j2 deleted file mode 100644 index 0869e63968ac..000000000000 --- a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-C32/buffers_defaults_t0.j2 +++ /dev/null @@ -1,47 +0,0 @@ - -{%- set default_cable = '5m' %} - -{%- macro generate_port_lists(PORT_ALL) %} - {# Generate list of ports #} - {%- for port_idx in range(0,128,4) %} - {%- if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{%- endif %} - {%- endfor %} -{%- endmacro %} - -{%- macro generate_buffer_pool_and_profiles() %} - "BUFFER_POOL": { - "ingress_lossless_pool": { - "size": "10875072", - "type": "ingress", - "mode": "dynamic", - "xoff": "4194112" - }, - "egress_lossy_pool": { - "size": "9243812", - "type": "egress", - "mode": "dynamic" - }, - "egress_lossless_pool": { - "size": "15982720", - "type": "egress", - "mode": "static" - } - }, - "BUFFER_PROFILE": { - "ingress_lossy_profile": { - "pool":"[BUFFER_POOL|ingress_lossless_pool]", - "size":"0", - "dynamic_th":"3" - }, - "egress_lossless_profile": { - "pool":"[BUFFER_POOL|egress_lossless_pool]", - "size":"1518", - "static_th":"15982720" - }, - "egress_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"1518", - "dynamic_th":"3" - } - }, -{%- endmacro %} diff --git a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-C32/buffers_defaults_t0.j2 b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-C32/buffers_defaults_t0.j2 new file mode 120000 index 000000000000..9524e6a476ac --- /dev/null +++ b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-C32/buffers_defaults_t0.j2 @@ -0,0 +1 @@ +BALANCED/buffers_defaults_t0.j2 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-C32/buffers_defaults_t1.j2 b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-C32/buffers_defaults_t1.j2 deleted file mode 100644 index 80e96bdceca7..000000000000 --- a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-C32/buffers_defaults_t1.j2 +++ /dev/null @@ -1,47 +0,0 @@ - -{%- set default_cable = '40m' %} - -{%- macro generate_port_lists(PORT_ALL) %} - {# Generate list of ports #} - {%- for port_idx in range(0,128,4) %} - {%- if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{%- endif %} - {%- endfor %} -{%- endmacro %} - -{%- macro generate_buffer_pool_and_profiles() %} - "BUFFER_POOL": { - "ingress_lossless_pool": { - "size": "10875072", - "type": "ingress", - "mode": "dynamic", - "xoff": "4194112" - }, - "egress_lossy_pool": { - "size": "9243812", - "type": "egress", - "mode": "dynamic" - }, - "egress_lossless_pool": { - "size": "15982720", - "type": "egress", - "mode": "static" - } - }, - "BUFFER_PROFILE": { - "ingress_lossy_profile": { - "pool":"[BUFFER_POOL|ingress_lossless_pool]", - "size":"0", - "dynamic_th":"3" - }, - "egress_lossless_profile": { - "pool":"[BUFFER_POOL|egress_lossless_pool]", - "size":"1518", - "static_th":"15982720" - }, - "egress_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"1518", - "dynamic_th":"3" - } - }, -{%- endmacro %} diff --git a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-C32/buffers_defaults_t1.j2 b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-C32/buffers_defaults_t1.j2 new file mode 120000 index 000000000000..c25cc95d6d57 --- /dev/null +++ b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-C32/buffers_defaults_t1.j2 @@ -0,0 +1 @@ +BALANCED/buffers_defaults_t1.j2 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-C32/pg_profile_lookup.ini b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-C32/pg_profile_lookup.ini deleted file mode 100644 index 673df369a9bb..000000000000 --- a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-C32/pg_profile_lookup.ini +++ /dev/null @@ -1,17 +0,0 @@ -# PG lossless profiles. -# speed cable size xon xoff threshold xon_offset - 10000 5m 1248 2288 35776 0 2288 - 25000 5m 1248 2288 53248 0 2288 - 40000 5m 1248 2288 66560 0 2288 - 50000 5m 1248 2288 90272 0 2288 - 100000 5m 1248 2288 165568 0 2288 - 10000 40m 1248 2288 37024 0 2288 - 25000 40m 1248 2288 53248 0 2288 - 40000 40m 1248 2288 71552 0 2288 - 50000 40m 1248 2288 96096 0 2288 - 100000 40m 1248 2288 177632 0 2288 - 10000 300m 1248 2288 46176 0 2288 - 25000 300m 1248 2288 79040 0 2288 - 40000 300m 1248 2288 108160 0 2288 - 50000 300m 1248 2288 141856 0 2288 - 100000 300m 1248 2288 268736 0 2288 diff --git a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-C32/pg_profile_lookup.ini b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-C32/pg_profile_lookup.ini new file mode 120000 index 000000000000..297cddb2d223 --- /dev/null +++ b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-C32/pg_profile_lookup.ini @@ -0,0 +1 @@ +BALANCED/pg_profile_lookup.ini \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-C32/qos.json.j2 b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-C32/qos.json.j2 deleted file mode 100644 index 34002048afdb..000000000000 --- a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-C32/qos.json.j2 +++ /dev/null @@ -1,21 +0,0 @@ -{%- macro generate_wred_profiles() %} - "WRED_PROFILE": { - "AZURE_LOSSLESS" : { - "wred_green_enable" : "true", - "wred_yellow_enable" : "true", - "wred_red_enable" : "true", - "ecn" : "ecn_all", - "green_max_threshold" : "2097152", - "green_min_threshold" : "250000", - "yellow_max_threshold" : "2097152", - "yellow_min_threshold" : "1048576", - "red_max_threshold" : "2097152", - "red_min_threshold" : "1048576", - "green_drop_probability" : "5", - "yellow_drop_probability": "5", - "red_drop_probability" : "5" - } - }, -{%- endmacro %} - -{%- include 'qos_config.j2' %} diff --git a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-C32/qos.json.j2 b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-C32/qos.json.j2 new file mode 120000 index 000000000000..aef6b6765cf2 --- /dev/null +++ b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-C32/qos.json.j2 @@ -0,0 +1 @@ +BALANCED/qos.json.j2 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-C32/th-a7060-cx32s-32x100G-t1.config.bcm b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-C32/th-a7060-cx32s-32x100G-t1.config.bcm index 95a947003fbc..509e801af488 100644 --- a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-C32/th-a7060-cx32s-32x100G-t1.config.bcm +++ b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-C32/th-a7060-cx32s-32x100G-t1.config.bcm @@ -1,5 +1,11 @@ # Arista 7060CX-32S +# disables bcmALPMDH (ALPM distributed hitbit) thread. This thread is purely for debug purpose +l3_alpm_hit_skip=1 + +# Disable Counting ACL Drop towards interface RX_DRP counter +sai_adjust_acl_drop_in_rx_drop=1 + phy_an_allow_pll_change=1 arl_clean_timeout_usec=15000000 asf_mem_profile=2 @@ -444,3 +450,5 @@ serdes_driver_current_109=0xa serdes_preemphasis_109=0x284008 mmu_init_config="MSFT-TH-Tier1" + +phy_an_lt_msft=1 diff --git a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-D48C8/BALANCED b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-D48C8/BALANCED new file mode 120000 index 000000000000..87afd08ffcd8 --- /dev/null +++ b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-D48C8/BALANCED @@ -0,0 +1 @@ +../../../common/profiles/th/gen/BALANCED \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-D48C8/RDMA-CENTRIC b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-D48C8/RDMA-CENTRIC new file mode 120000 index 000000000000..a05581efb9ff --- /dev/null +++ b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-D48C8/RDMA-CENTRIC @@ -0,0 +1 @@ +../../../common/profiles/th/gen/RDMA-CENTRIC \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-D48C8/TCP-CENTRIC b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-D48C8/TCP-CENTRIC new file mode 120000 index 000000000000..dd9cf046c0f9 --- /dev/null +++ b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-D48C8/TCP-CENTRIC @@ -0,0 +1 @@ +../../../common/profiles/th/gen/TCP-CENTRIC \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-D48C8/buffer_ports_t0.j2 b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-D48C8/buffer_ports_t0.j2 new file mode 100644 index 000000000000..a3c33da63990 --- /dev/null +++ b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-D48C8/buffer_ports_t0.j2 @@ -0,0 +1,21 @@ +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {%- for port_idx in range(0,6) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{%- endif %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 2)) %}{%- endif %} + {%- endfor %} + {%- for port_idx in range(10,22) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{%- endif %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 2)) %}{%- endif %} + {%- endfor %} + {%- for port_idx in range(26,32) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{%- endif %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 2)) %}{%- endif %} + {%- endfor %} + {%- for port_idx in range(6,10) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{%- endif %} + {%- endfor %} + {%- for port_idx in range(22,26) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{%- endif %} + {%- endfor %} +{%- endmacro %} diff --git a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-D48C8/buffers_defaults_t0.j2 b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-D48C8/buffers_defaults_t0.j2 deleted file mode 100644 index 1430479d08e0..000000000000 --- a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-D48C8/buffers_defaults_t0.j2 +++ /dev/null @@ -1,61 +0,0 @@ -{%- set default_cable = '5m' %} - -{%- macro generate_port_lists(PORT_ALL) %} - {# Generate list of ports #} - {%- for port_idx in range(0,6) %} - {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{%- endif %} - {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 2)) %}{%- endif %} - {%- endfor %} - {%- for port_idx in range(10,22) %} - {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{%- endif %} - {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 2)) %}{%- endif %} - {%- endfor %} - {%- for port_idx in range(26,32) %} - {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{%- endif %} - {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 2)) %}{%- endif %} - {%- endfor %} - {%- for port_idx in range(6,10) %} - {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{%- endif %} - {%- endfor %} - {%- for port_idx in range(22,26) %} - {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{%- endif %} - {%- endfor %} -{%- endmacro %} - -{%- macro generate_buffer_pool_and_profiles() %} - "BUFFER_POOL": { - "ingress_lossless_pool": { - "size": "10875072", - "type": "ingress", - "mode": "dynamic", - "xoff": "4194112" - }, - "egress_lossy_pool": { - "size": "9243812", - "type": "egress", - "mode": "dynamic" - }, - "egress_lossless_pool": { - "size": "15982720", - "type": "egress", - "mode": "static" - } - }, - "BUFFER_PROFILE": { - "ingress_lossy_profile": { - "pool":"[BUFFER_POOL|ingress_lossless_pool]", - "size":"0", - "dynamic_th":"3" - }, - "egress_lossless_profile": { - "pool":"[BUFFER_POOL|egress_lossless_pool]", - "size":"1518", - "static_th":"15982720" - }, - "egress_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"1518", - "dynamic_th":"3" - } - }, -{%- endmacro %} diff --git a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-D48C8/buffers_defaults_t0.j2 b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-D48C8/buffers_defaults_t0.j2 new file mode 120000 index 000000000000..9524e6a476ac --- /dev/null +++ b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-D48C8/buffers_defaults_t0.j2 @@ -0,0 +1 @@ +BALANCED/buffers_defaults_t0.j2 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-D48C8/pg_profile_lookup.ini b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-D48C8/pg_profile_lookup.ini deleted file mode 100644 index 0b5d680edda7..000000000000 --- a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-D48C8/pg_profile_lookup.ini +++ /dev/null @@ -1,17 +0,0 @@ -# PG lossless profiles. -# speed cable size xon xoff threshold xon_offset - 10000 5m 1248 2288 35776 0 2288 - 25000 5m 1248 2288 53248 0 2288 - 40000 5m 1248 2288 66560 0 2288 - 50000 5m 1248 2288 79872 0 2288 - 100000 5m 1248 2288 165568 0 2288 - 10000 40m 1248 2288 37024 0 2288 - 25000 40m 1248 2288 56160 0 2288 - 40000 40m 1248 2288 71552 0 2288 - 50000 40m 1248 2288 85696 0 2288 - 100000 40m 1248 2288 177632 0 2288 - 10000 300m 1248 2288 46176 0 2288 - 25000 300m 1248 2288 79040 0 2288 - 40000 300m 1248 2288 108160 0 2288 - 50000 300m 1248 2288 141856 0 2288 - 100000 300m 1248 2288 268736 0 2288 diff --git a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-D48C8/pg_profile_lookup.ini b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-D48C8/pg_profile_lookup.ini new file mode 120000 index 000000000000..297cddb2d223 --- /dev/null +++ b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-D48C8/pg_profile_lookup.ini @@ -0,0 +1 @@ +BALANCED/pg_profile_lookup.ini \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-D48C8/qos.json.j2 b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-D48C8/qos.json.j2 deleted file mode 100644 index 34002048afdb..000000000000 --- a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-D48C8/qos.json.j2 +++ /dev/null @@ -1,21 +0,0 @@ -{%- macro generate_wred_profiles() %} - "WRED_PROFILE": { - "AZURE_LOSSLESS" : { - "wred_green_enable" : "true", - "wred_yellow_enable" : "true", - "wred_red_enable" : "true", - "ecn" : "ecn_all", - "green_max_threshold" : "2097152", - "green_min_threshold" : "250000", - "yellow_max_threshold" : "2097152", - "yellow_min_threshold" : "1048576", - "red_max_threshold" : "2097152", - "red_min_threshold" : "1048576", - "green_drop_probability" : "5", - "yellow_drop_probability": "5", - "red_drop_probability" : "5" - } - }, -{%- endmacro %} - -{%- include 'qos_config.j2' %} diff --git a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-D48C8/qos.json.j2 b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-D48C8/qos.json.j2 new file mode 120000 index 000000000000..aef6b6765cf2 --- /dev/null +++ b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-D48C8/qos.json.j2 @@ -0,0 +1 @@ +BALANCED/qos.json.j2 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-D48C8/th-a7060-cx32s-8x100G+48x50G.config.bcm b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-D48C8/th-a7060-cx32s-8x100G+48x50G.config.bcm index 5c70d324dbb3..c37f1592456d 100644 --- a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-D48C8/th-a7060-cx32s-8x100G+48x50G.config.bcm +++ b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-D48C8/th-a7060-cx32s-8x100G+48x50G.config.bcm @@ -1,5 +1,11 @@ # Arista 7060CX-32S +# disables bcmALPMDH (ALPM distributed hitbit) thread. This thread is purely for debug purpose +l3_alpm_hit_skip=1 + +# Disable Counting ACL Drop towards interface RX_DRP counter +sai_adjust_acl_drop_in_rx_drop=1 + phy_an_allow_pll_change=1 arl_clean_timeout_usec=15000000 asf_mem_profile=2 @@ -545,3 +551,5 @@ serdes_driver_current_115=0xa serdes_preemphasis_115=0x284008 mmu_init_config="MSFT-TH-Tier0" + +phy_an_lt_msft=1 diff --git a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q24C8/BALANCED b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q24C8/BALANCED new file mode 120000 index 000000000000..87afd08ffcd8 --- /dev/null +++ b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q24C8/BALANCED @@ -0,0 +1 @@ +../../../common/profiles/th/gen/BALANCED \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q24C8/RDMA-CENTRIC b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q24C8/RDMA-CENTRIC new file mode 120000 index 000000000000..0c839e1e907b --- /dev/null +++ b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q24C8/RDMA-CENTRIC @@ -0,0 +1 @@ +../../../common/profiles/th/gen/RDMA-CENTRIC/ \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q24C8/TCP-CENTRIC b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q24C8/TCP-CENTRIC new file mode 120000 index 000000000000..dd9cf046c0f9 --- /dev/null +++ b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q24C8/TCP-CENTRIC @@ -0,0 +1 @@ +../../../common/profiles/th/gen/TCP-CENTRIC \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q24C8/buffer_ports_t0.j2 b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q24C8/buffer_ports_t0.j2 new file mode 100644 index 000000000000..599db74c1da5 --- /dev/null +++ b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q24C8/buffer_ports_t0.j2 @@ -0,0 +1,7 @@ +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {%- for port_idx in range(0,32) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{%- endif %} + {%- endfor %} +{%- endmacro %} + diff --git a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q24C8/buffers_defaults_t0.j2 b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q24C8/buffers_defaults_t0.j2 deleted file mode 100644 index 4858c7a67e65..000000000000 --- a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q24C8/buffers_defaults_t0.j2 +++ /dev/null @@ -1,46 +0,0 @@ -{%- set default_cable = '5m' %} - -{%- macro generate_port_lists(PORT_ALL) %} - {# Generate list of ports #} - {%- for port_idx in range(0,32) %} - {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{%- endif %} - {%- endfor %} -{%- endmacro %} - -{%- macro generate_buffer_pool_and_profiles() %} - "BUFFER_POOL": { - "ingress_lossless_pool": { - "size": "11213696", - "type": "ingress", - "mode": "dynamic", - "xoff": "3855488" - }, - "egress_lossy_pool": { - "size": "9532224", - "type": "egress", - "mode": "dynamic" - }, - "egress_lossless_pool": { - "size": "15982720", - "type": "egress", - "mode": "static" - } - }, - "BUFFER_PROFILE": { - "ingress_lossy_profile": { - "pool":"[BUFFER_POOL|ingress_lossless_pool]", - "size":"0", - "dynamic_th":"3" - }, - "egress_lossless_profile": { - "pool":"[BUFFER_POOL|egress_lossless_pool]", - "size":"1518", - "static_th":"15982720" - }, - "egress_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"1518", - "dynamic_th":"3" - } - }, -{%- endmacro %} diff --git a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q24C8/buffers_defaults_t0.j2 b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q24C8/buffers_defaults_t0.j2 new file mode 120000 index 000000000000..9524e6a476ac --- /dev/null +++ b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q24C8/buffers_defaults_t0.j2 @@ -0,0 +1 @@ +BALANCED/buffers_defaults_t0.j2 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q24C8/pg_profile_lookup.ini b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q24C8/pg_profile_lookup.ini deleted file mode 100644 index 7222f8014925..000000000000 --- a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q24C8/pg_profile_lookup.ini +++ /dev/null @@ -1,17 +0,0 @@ -# PG lossless profiles. -# speed cable size xon xoff threshold xon_offset - 10000 5m 1248 2288 35776 -4 2288 - 25000 5m 1248 2288 53248 -4 2288 - 40000 5m 1248 2288 66560 -4 2288 - 50000 5m 1248 2288 79872 -4 2288 - 100000 5m 1248 2288 165568 -4 2288 - 10000 40m 1248 2288 37024 -4 2288 - 25000 40m 1248 2288 56160 -4 2288 - 40000 40m 1248 2288 71552 -4 2288 - 50000 40m 1248 2288 85696 -4 2288 - 100000 40m 1248 2288 177632 -4 2288 - 10000 300m 1248 2288 46176 -4 2288 - 25000 300m 1248 2288 79040 -4 2288 - 40000 300m 1248 2288 108160 -4 2288 - 50000 300m 1248 2288 131456 -4 2288 - 100000 300m 1248 2288 268736 -4 2288 diff --git a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q24C8/pg_profile_lookup.ini b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q24C8/pg_profile_lookup.ini new file mode 120000 index 000000000000..297cddb2d223 --- /dev/null +++ b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q24C8/pg_profile_lookup.ini @@ -0,0 +1 @@ +BALANCED/pg_profile_lookup.ini \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q24C8/qos.json.j2 b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q24C8/qos.json.j2 deleted file mode 100644 index 3e548325ea30..000000000000 --- a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q24C8/qos.json.j2 +++ /dev/null @@ -1 +0,0 @@ -{%- include 'qos_config.j2' %} diff --git a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q24C8/qos.json.j2 b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q24C8/qos.json.j2 new file mode 120000 index 000000000000..aef6b6765cf2 --- /dev/null +++ b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q24C8/qos.json.j2 @@ -0,0 +1 @@ +BALANCED/qos.json.j2 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q24C8/th-a7060-cx32s-8x100G+24x40G.config.bcm b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q24C8/th-a7060-cx32s-8x100G+24x40G.config.bcm index 05908a259c48..8f8b4c0fe32d 100644 --- a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q24C8/th-a7060-cx32s-8x100G+24x40G.config.bcm +++ b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q24C8/th-a7060-cx32s-8x100G+24x40G.config.bcm @@ -1,5 +1,11 @@ # Arista 7060CX-32S +# disables bcmALPMDH (ALPM distributed hitbit) thread. This thread is purely for debug purpose +l3_alpm_hit_skip=1 + +# Disable Counting ACL Drop towards interface RX_DRP counter +sai_adjust_acl_drop_in_rx_drop=1 + phy_an_allow_pll_change=1 arl_clean_timeout_usec=15000000 asf_mem_profile=2 @@ -444,3 +450,5 @@ serdes_driver_current_109=0x4 serdes_preemphasis_109=0x145c00 mmu_init_config="MSFT-TH-Tier1" + +phy_an_lt_msft=1 diff --git a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q32/BALANCED b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q32/BALANCED new file mode 120000 index 000000000000..87afd08ffcd8 --- /dev/null +++ b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q32/BALANCED @@ -0,0 +1 @@ +../../../common/profiles/th/gen/BALANCED \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q32/RDMA-CENTRIC b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q32/RDMA-CENTRIC new file mode 120000 index 000000000000..a05581efb9ff --- /dev/null +++ b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q32/RDMA-CENTRIC @@ -0,0 +1 @@ +../../../common/profiles/th/gen/RDMA-CENTRIC \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q32/TCP-CENTRIC b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q32/TCP-CENTRIC new file mode 120000 index 000000000000..dd9cf046c0f9 --- /dev/null +++ b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q32/TCP-CENTRIC @@ -0,0 +1 @@ +../../../common/profiles/th/gen/TCP-CENTRIC \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q32/buffer_ports_t0.j2 b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q32/buffer_ports_t0.j2 new file mode 100644 index 000000000000..2f41924b4fcf --- /dev/null +++ b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q32/buffer_ports_t0.j2 @@ -0,0 +1,6 @@ +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {%- for port_idx in range(0,128,4) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{%- endif %} + {%- endfor %} +{%- endmacro %} diff --git a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q32/buffer_ports_t1.j2 b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q32/buffer_ports_t1.j2 new file mode 100644 index 000000000000..2f41924b4fcf --- /dev/null +++ b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q32/buffer_ports_t1.j2 @@ -0,0 +1,6 @@ +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {%- for port_idx in range(0,128,4) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{%- endif %} + {%- endfor %} +{%- endmacro %} diff --git a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q32/buffers_defaults_t0.j2 b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q32/buffers_defaults_t0.j2 deleted file mode 100644 index 0869e63968ac..000000000000 --- a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q32/buffers_defaults_t0.j2 +++ /dev/null @@ -1,47 +0,0 @@ - -{%- set default_cable = '5m' %} - -{%- macro generate_port_lists(PORT_ALL) %} - {# Generate list of ports #} - {%- for port_idx in range(0,128,4) %} - {%- if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{%- endif %} - {%- endfor %} -{%- endmacro %} - -{%- macro generate_buffer_pool_and_profiles() %} - "BUFFER_POOL": { - "ingress_lossless_pool": { - "size": "10875072", - "type": "ingress", - "mode": "dynamic", - "xoff": "4194112" - }, - "egress_lossy_pool": { - "size": "9243812", - "type": "egress", - "mode": "dynamic" - }, - "egress_lossless_pool": { - "size": "15982720", - "type": "egress", - "mode": "static" - } - }, - "BUFFER_PROFILE": { - "ingress_lossy_profile": { - "pool":"[BUFFER_POOL|ingress_lossless_pool]", - "size":"0", - "dynamic_th":"3" - }, - "egress_lossless_profile": { - "pool":"[BUFFER_POOL|egress_lossless_pool]", - "size":"1518", - "static_th":"15982720" - }, - "egress_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"1518", - "dynamic_th":"3" - } - }, -{%- endmacro %} diff --git a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q32/buffers_defaults_t0.j2 b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q32/buffers_defaults_t0.j2 new file mode 120000 index 000000000000..9524e6a476ac --- /dev/null +++ b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q32/buffers_defaults_t0.j2 @@ -0,0 +1 @@ +BALANCED/buffers_defaults_t0.j2 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q32/buffers_defaults_t1.j2 b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q32/buffers_defaults_t1.j2 deleted file mode 100644 index 80e96bdceca7..000000000000 --- a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q32/buffers_defaults_t1.j2 +++ /dev/null @@ -1,47 +0,0 @@ - -{%- set default_cable = '40m' %} - -{%- macro generate_port_lists(PORT_ALL) %} - {# Generate list of ports #} - {%- for port_idx in range(0,128,4) %} - {%- if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{%- endif %} - {%- endfor %} -{%- endmacro %} - -{%- macro generate_buffer_pool_and_profiles() %} - "BUFFER_POOL": { - "ingress_lossless_pool": { - "size": "10875072", - "type": "ingress", - "mode": "dynamic", - "xoff": "4194112" - }, - "egress_lossy_pool": { - "size": "9243812", - "type": "egress", - "mode": "dynamic" - }, - "egress_lossless_pool": { - "size": "15982720", - "type": "egress", - "mode": "static" - } - }, - "BUFFER_PROFILE": { - "ingress_lossy_profile": { - "pool":"[BUFFER_POOL|ingress_lossless_pool]", - "size":"0", - "dynamic_th":"3" - }, - "egress_lossless_profile": { - "pool":"[BUFFER_POOL|egress_lossless_pool]", - "size":"1518", - "static_th":"15982720" - }, - "egress_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"1518", - "dynamic_th":"3" - } - }, -{%- endmacro %} diff --git a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q32/buffers_defaults_t1.j2 b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q32/buffers_defaults_t1.j2 new file mode 120000 index 000000000000..c25cc95d6d57 --- /dev/null +++ b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q32/buffers_defaults_t1.j2 @@ -0,0 +1 @@ +BALANCED/buffers_defaults_t1.j2 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q32/pg_profile_lookup.ini b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q32/pg_profile_lookup.ini deleted file mode 100644 index 673df369a9bb..000000000000 --- a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q32/pg_profile_lookup.ini +++ /dev/null @@ -1,17 +0,0 @@ -# PG lossless profiles. -# speed cable size xon xoff threshold xon_offset - 10000 5m 1248 2288 35776 0 2288 - 25000 5m 1248 2288 53248 0 2288 - 40000 5m 1248 2288 66560 0 2288 - 50000 5m 1248 2288 90272 0 2288 - 100000 5m 1248 2288 165568 0 2288 - 10000 40m 1248 2288 37024 0 2288 - 25000 40m 1248 2288 53248 0 2288 - 40000 40m 1248 2288 71552 0 2288 - 50000 40m 1248 2288 96096 0 2288 - 100000 40m 1248 2288 177632 0 2288 - 10000 300m 1248 2288 46176 0 2288 - 25000 300m 1248 2288 79040 0 2288 - 40000 300m 1248 2288 108160 0 2288 - 50000 300m 1248 2288 141856 0 2288 - 100000 300m 1248 2288 268736 0 2288 diff --git a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q32/pg_profile_lookup.ini b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q32/pg_profile_lookup.ini new file mode 120000 index 000000000000..297cddb2d223 --- /dev/null +++ b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q32/pg_profile_lookup.ini @@ -0,0 +1 @@ +BALANCED/pg_profile_lookup.ini \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q32/qos.json.j2 b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q32/qos.json.j2 deleted file mode 100644 index 34002048afdb..000000000000 --- a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q32/qos.json.j2 +++ /dev/null @@ -1,21 +0,0 @@ -{%- macro generate_wred_profiles() %} - "WRED_PROFILE": { - "AZURE_LOSSLESS" : { - "wred_green_enable" : "true", - "wred_yellow_enable" : "true", - "wred_red_enable" : "true", - "ecn" : "ecn_all", - "green_max_threshold" : "2097152", - "green_min_threshold" : "250000", - "yellow_max_threshold" : "2097152", - "yellow_min_threshold" : "1048576", - "red_max_threshold" : "2097152", - "red_min_threshold" : "1048576", - "green_drop_probability" : "5", - "yellow_drop_probability": "5", - "red_drop_probability" : "5" - } - }, -{%- endmacro %} - -{%- include 'qos_config.j2' %} diff --git a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q32/qos.json.j2 b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q32/qos.json.j2 new file mode 120000 index 000000000000..aef6b6765cf2 --- /dev/null +++ b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q32/qos.json.j2 @@ -0,0 +1 @@ +BALANCED/qos.json.j2 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q32/th-a7060-cx32s-32x40G-t0.config.bcm b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q32/th-a7060-cx32s-32x40G-t0.config.bcm index c011ad93f4d7..c2e0bdcb9c0f 100644 --- a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q32/th-a7060-cx32s-32x40G-t0.config.bcm +++ b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q32/th-a7060-cx32s-32x40G-t0.config.bcm @@ -1,5 +1,11 @@ # Arista 7060CX-32S +# disables bcmALPMDH (ALPM distributed hitbit) thread. This thread is purely for debug purpose +l3_alpm_hit_skip=1 + +# Disable Counting ACL Drop towards interface RX_DRP counter +sai_adjust_acl_drop_in_rx_drop=1 + phy_an_allow_pll_change=1 arl_clean_timeout_usec=15000000 asf_mem_profile=2 @@ -442,3 +448,5 @@ serdes_driver_current_109=0x4 serdes_preemphasis_109=0x145c00 mmu_init_config="MSFT-TH-Tier0" + +phy_an_lt_msft=1 diff --git a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q32/th-a7060-cx32s-32x40G-t1.config.bcm b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q32/th-a7060-cx32s-32x40G-t1.config.bcm index 65a7d57b5513..3d4682cc42aa 100644 --- a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q32/th-a7060-cx32s-32x40G-t1.config.bcm +++ b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-Q32/th-a7060-cx32s-32x40G-t1.config.bcm @@ -1,5 +1,11 @@ # Arista 7060CX-32S +# disables bcmALPMDH (ALPM distributed hitbit) thread. This thread is purely for debug purpose +l3_alpm_hit_skip=1 + +# Disable Counting ACL Drop towards interface RX_DRP counter +sai_adjust_acl_drop_in_rx_drop=1 + phy_an_allow_pll_change=1 arl_clean_timeout_usec=15000000 asf_mem_profile=2 @@ -442,3 +448,5 @@ serdes_driver_current_109=0x4 serdes_preemphasis_109=0x145c00 mmu_init_config="MSFT-TH-Tier1" + +phy_an_lt_msft=1 diff --git a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-T96C8/th-a7060-cx32s-8x100G+96x25G.config.bcm b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-T96C8/th-a7060-cx32s-8x100G+96x25G.config.bcm index 467d428830c9..9244c76a0ea2 100644 --- a/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-T96C8/th-a7060-cx32s-8x100G+96x25G.config.bcm +++ b/device/arista/x86_64-arista_7060_cx32s/Arista-7060CX-32S-T96C8/th-a7060-cx32s-8x100G+96x25G.config.bcm @@ -1,5 +1,11 @@ # Arista 7060CX-32S +# disables bcmALPMDH (ALPM distributed hitbit) thread. This thread is purely for debug purpose +l3_alpm_hit_skip=1 + +# Disable Counting ACL Drop towards interface RX_DRP counter +sai_adjust_acl_drop_in_rx_drop=1 + phy_an_allow_pll_change=1 arl_clean_timeout_usec=15000000 asf_mem_profile=2 @@ -778,3 +784,5 @@ serdes_driver_current_126=0xa serdes_preemphasis_126=0x284008 serdes_driver_current_127=0xa serdes_preemphasis_127=0x284008 + +phy_an_lt_msft=1 diff --git a/device/arista/x86_64-arista_7060_cx32s/plugins/pcie.yaml b/device/arista/x86_64-arista_7060_cx32s/pcie.yaml similarity index 100% rename from device/arista/x86_64-arista_7060_cx32s/plugins/pcie.yaml rename to device/arista/x86_64-arista_7060_cx32s/pcie.yaml diff --git a/device/arista/x86_64-arista_7060_cx32s/platform-init b/device/arista/x86_64-arista_7060_cx32s/platform-init new file mode 100755 index 000000000000..e31a7a0db4c7 --- /dev/null +++ b/device/arista/x86_64-arista_7060_cx32s/platform-init @@ -0,0 +1,3 @@ +# Increase PCIe timeout value to 210ms +setpci -s01:00.0 CAP_EXP+0x28.B=6 +setpci -s01:00.1 CAP_EXP+0x28.B=6 diff --git a/device/arista/x86_64-arista_7060dx4_32/Arista-7060DX4-C32 b/device/arista/x86_64-arista_7060dx4_32/Arista-7060DX4-C32 deleted file mode 120000 index 19cc64c75f13..000000000000 --- a/device/arista/x86_64-arista_7060dx4_32/Arista-7060DX4-C32 +++ /dev/null @@ -1 +0,0 @@ -../x86_64-arista_7060px4_32/Arista-7060DX4-C32 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060px4_32/Arista-7060DX4-C32/port_config.ini b/device/arista/x86_64-arista_7060dx4_32/Arista-7060DX4-C32/port_config.ini similarity index 100% rename from device/arista/x86_64-arista_7060px4_32/Arista-7060DX4-C32/port_config.ini rename to device/arista/x86_64-arista_7060dx4_32/Arista-7060DX4-C32/port_config.ini diff --git a/device/arista/x86_64-arista_7060px4_32/Arista-7060DX4-C32/sai.profile b/device/arista/x86_64-arista_7060dx4_32/Arista-7060DX4-C32/sai.profile similarity index 100% rename from device/arista/x86_64-arista_7060px4_32/Arista-7060DX4-C32/sai.profile rename to device/arista/x86_64-arista_7060dx4_32/Arista-7060DX4-C32/sai.profile diff --git a/device/arista/x86_64-arista_7060px4_32/Arista-7060DX4-C32/th3-a7060dx4-c32-32x400G.config.bcm b/device/arista/x86_64-arista_7060dx4_32/Arista-7060DX4-C32/th3-a7060dx4-c32-32x400G.config.bcm similarity index 99% rename from device/arista/x86_64-arista_7060px4_32/Arista-7060DX4-C32/th3-a7060dx4-c32-32x400G.config.bcm rename to device/arista/x86_64-arista_7060dx4_32/Arista-7060DX4-C32/th3-a7060dx4-c32-32x400G.config.bcm index 7bd96fed83b8..259bc6767419 100644 --- a/device/arista/x86_64-arista_7060px4_32/Arista-7060DX4-C32/th3-a7060dx4-c32-32x400G.config.bcm +++ b/device/arista/x86_64-arista_7060dx4_32/Arista-7060DX4-C32/th3-a7060dx4-c32-32x400G.config.bcm @@ -1,3 +1,7 @@ +# The following 2 SOC properties are needed to prevent FDB Events during Warmboot due to TH3 is SW Managed MACs +l2xmsg_shadow_hit_bits=0 +l2xmsg_no_cb_during_table_rebuild=1 + arl_clean_timeout_usec=15000000 asf_mem_profile.0=2 bcm_num_cos.0=8 diff --git a/device/arista/x86_64-arista_7060dx4_32/Arista-7060PX4-C64 b/device/arista/x86_64-arista_7060dx4_32/Arista-7060PX4-C64 deleted file mode 120000 index f0d5c7697f08..000000000000 --- a/device/arista/x86_64-arista_7060dx4_32/Arista-7060PX4-C64 +++ /dev/null @@ -1 +0,0 @@ -../x86_64-arista_7060px4_32/Arista-7060PX4-C64 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060dx4_32/Arista-7060PX4-O32 b/device/arista/x86_64-arista_7060dx4_32/Arista-7060PX4-O32 deleted file mode 120000 index 1e0685f3fb42..000000000000 --- a/device/arista/x86_64-arista_7060dx4_32/Arista-7060PX4-O32 +++ /dev/null @@ -1 +0,0 @@ -../x86_64-arista_7060px4_32/Arista-7060PX4-O32 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060dx4_32/default_sku b/device/arista/x86_64-arista_7060dx4_32/default_sku deleted file mode 120000 index ebca56647346..000000000000 --- a/device/arista/x86_64-arista_7060dx4_32/default_sku +++ /dev/null @@ -1 +0,0 @@ -../x86_64-arista_7060px4_32/default_sku \ No newline at end of file diff --git a/device/arista/x86_64-arista_7060dx4_32/default_sku b/device/arista/x86_64-arista_7060dx4_32/default_sku new file mode 100644 index 000000000000..ed73fdf88eeb --- /dev/null +++ b/device/arista/x86_64-arista_7060dx4_32/default_sku @@ -0,0 +1 @@ +Arista-7060DX4-C32 t1 diff --git a/device/arista/x86_64-arista_7060px4_32/Arista-7060PX4-C64/th3-a7060px4-32-64x100G.config.bcm b/device/arista/x86_64-arista_7060px4_32/Arista-7060PX4-C64/th3-a7060px4-32-64x100G.config.bcm index 52e3424aaf55..ca72849db767 100644 --- a/device/arista/x86_64-arista_7060px4_32/Arista-7060PX4-C64/th3-a7060px4-32-64x100G.config.bcm +++ b/device/arista/x86_64-arista_7060px4_32/Arista-7060PX4-C64/th3-a7060px4-32-64x100G.config.bcm @@ -1,3 +1,11 @@ +# The following 2 SOC properties are needed to prevent FDB Events during Warmboot due to TH3 is SW Managed MACs +l2xmsg_shadow_hit_bits=0 +l2xmsg_no_cb_during_table_rebuild=1 + +# Disable Counting ACL Drop towards interface RX_DRP counter +sai_adjust_acl_drop_in_rx_drop=1 +# disables bcmALPMDH (ALPM distributed hitbit) thread. This thread is purely for debug purpose +l3_alpm_hit_skip=1 arl_clean_timeout_usec=15000000 asf_mem_profile.0=2 bcm_num_cos.0=8 diff --git a/device/arista/x86_64-arista_7060px4_32/Arista-7060PX4-O32/th3-a7060px4-o32-32x400G.config.bcm b/device/arista/x86_64-arista_7060px4_32/Arista-7060PX4-O32/th3-a7060px4-o32-32x400G.config.bcm index 0cf9ae8f3a65..8890e3d049c2 100644 --- a/device/arista/x86_64-arista_7060px4_32/Arista-7060PX4-O32/th3-a7060px4-o32-32x400G.config.bcm +++ b/device/arista/x86_64-arista_7060px4_32/Arista-7060PX4-O32/th3-a7060px4-o32-32x400G.config.bcm @@ -1,3 +1,11 @@ +# The following 2 SOC properties are needed to prevent FDB Events during Warmboot due to TH3 is SW Managed MACs +l2xmsg_shadow_hit_bits=0 +l2xmsg_no_cb_during_table_rebuild=1 + +# Disable Counting ACL Drop towards interface RX_DRP counter +sai_adjust_acl_drop_in_rx_drop=1 +# disables bcmALPMDH (ALPM distributed hitbit) thread. This thread is purely for debug purpose +l3_alpm_hit_skip=1 arl_clean_timeout_usec=15000000 asf_mem_profile.0=2 bcm_num_cos.0=8 diff --git a/device/arista/x86_64-arista_7170_32c/Arista-7170-32C-C32/board_lane_map.json b/device/arista/x86_64-arista_7170_32c/Arista-7170-32C-C32/board_lane_map.json index 6ab72e55ab47..b78f75fbf284 100644 --- a/device/arista/x86_64-arista_7170_32c/Arista-7170-32C-C32/board_lane_map.json +++ b/device/arista/x86_64-arista_7170_32c/Arista-7170-32C-C32/board_lane_map.json @@ -5,7 +5,7 @@ { "connector": 1, "device_id": 0, - "mac_block": 14, + "mac_block": 7, "media_type": "copper", "lane0": { "mac_ch": 0, @@ -59,7 +59,7 @@ { "connector": 2, "device_id": 0, - "mac_block": 12, + "mac_block": 6, "media_type": "copper", "lane0": { "mac_ch": 0, @@ -113,7 +113,7 @@ { "connector": 3, "device_id": 0, - "mac_block": 10, + "mac_block": 5, "media_type": "copper", "lane0": { "mac_ch": 0, @@ -167,7 +167,7 @@ { "connector": 4, "device_id": 0, - "mac_block": 8, + "mac_block": 4, "media_type": "copper", "lane0": { "mac_ch": 0, @@ -221,7 +221,7 @@ { "connector": 5, "device_id": 0, - "mac_block": 6, + "mac_block": 3, "media_type": "copper", "lane0": { "mac_ch": 0, @@ -275,7 +275,7 @@ { "connector": 6, "device_id": 0, - "mac_block": 4, + "mac_block": 2, "media_type": "copper", "lane0": { "mac_ch": 0, @@ -329,7 +329,7 @@ { "connector": 7, "device_id": 0, - "mac_block": 2, + "mac_block": 1, "media_type": "copper", "lane0": { "mac_ch": 0, @@ -437,7 +437,7 @@ { "connector": 9, "device_id": 0, - "mac_block": 62, + "mac_block": 31, "media_type": "copper", "lane0": { "mac_ch": 0, @@ -491,7 +491,7 @@ { "connector": 10, "device_id": 0, - "mac_block": 60, + "mac_block": 30, "media_type": "copper", "lane0": { "mac_ch": 0, @@ -545,7 +545,7 @@ { "connector": 11, "device_id": 0, - "mac_block": 58, + "mac_block": 29, "media_type": "copper", "lane0": { "mac_ch": 0, @@ -599,7 +599,7 @@ { "connector": 12, "device_id": 0, - "mac_block": 56, + "mac_block": 28, "media_type": "copper", "lane0": { "mac_ch": 0, @@ -653,7 +653,7 @@ { "connector": 13, "device_id": 0, - "mac_block": 54, + "mac_block": 27, "media_type": "copper", "lane0": { "mac_ch": 0, @@ -707,7 +707,7 @@ { "connector": 14, "device_id": 0, - "mac_block": 52, + "mac_block": 26, "media_type": "copper", "lane0": { "mac_ch": 0, @@ -761,7 +761,7 @@ { "connector": 15, "device_id": 0, - "mac_block": 50, + "mac_block": 25, "media_type": "copper", "lane0": { "mac_ch": 0, @@ -815,7 +815,7 @@ { "connector": 16, "device_id": 0, - "mac_block": 48, + "mac_block": 24, "media_type": "copper", "lane0": { "mac_ch": 0, @@ -869,7 +869,7 @@ { "connector": 17, "device_id": 0, - "mac_block": 46, + "mac_block": 23, "media_type": "copper", "lane0": { "mac_ch": 0, @@ -923,7 +923,7 @@ { "connector": 18, "device_id": 0, - "mac_block": 44, + "mac_block": 22, "media_type": "copper", "lane0": { "mac_ch": 0, @@ -977,7 +977,7 @@ { "connector": 19, "device_id": 0, - "mac_block": 42, + "mac_block": 21, "media_type": "copper", "lane0": { "mac_ch": 0, @@ -1031,7 +1031,7 @@ { "connector": 20, "device_id": 0, - "mac_block": 40, + "mac_block": 20, "media_type": "copper", "lane0": { "mac_ch": 0, @@ -1085,7 +1085,7 @@ { "connector": 21, "device_id": 0, - "mac_block": 38, + "mac_block": 19, "media_type": "copper", "lane0": { "mac_ch": 0, @@ -1139,7 +1139,7 @@ { "connector": 22, "device_id": 0, - "mac_block": 36, + "mac_block": 18, "media_type": "copper", "lane0": { "mac_ch": 0, @@ -1193,7 +1193,7 @@ { "connector": 23, "device_id": 0, - "mac_block": 34, + "mac_block": 17, "media_type": "copper", "lane0": { "mac_ch": 0, @@ -1247,7 +1247,7 @@ { "connector": 24, "device_id": 0, - "mac_block": 32, + "mac_block": 16, "media_type": "copper", "lane0": { "mac_ch": 0, @@ -1301,7 +1301,7 @@ { "connector": 25, "device_id": 0, - "mac_block": 30, + "mac_block": 15, "media_type": "copper", "lane0": { "mac_ch": 0, @@ -1355,7 +1355,7 @@ { "connector": 26, "device_id": 0, - "mac_block": 28, + "mac_block": 14, "media_type": "copper", "lane0": { "mac_ch": 0, @@ -1409,7 +1409,7 @@ { "connector": 27, "device_id": 0, - "mac_block": 26, + "mac_block": 13, "media_type": "copper", "lane0": { "mac_ch": 0, @@ -1463,7 +1463,7 @@ { "connector": 28, "device_id": 0, - "mac_block": 24, + "mac_block": 12, "media_type": "copper", "lane0": { "mac_ch": 0, @@ -1517,7 +1517,7 @@ { "connector": 29, "device_id": 0, - "mac_block": 22, + "mac_block": 11, "media_type": "copper", "lane0": { "mac_ch": 0, @@ -1571,7 +1571,7 @@ { "connector": 30, "device_id": 0, - "mac_block": 20, + "mac_block": 10, "media_type": "copper", "lane0": { "mac_ch": 0, @@ -1625,7 +1625,7 @@ { "connector": 31, "device_id": 0, - "mac_block": 18, + "mac_block": 9, "media_type": "copper", "lane0": { "mac_ch": 0, @@ -1679,7 +1679,7 @@ { "connector": 32, "device_id": 0, - "mac_block": 16, + "mac_block": 8, "media_type": "copper", "lane0": { "mac_ch": 0, diff --git a/device/arista/x86_64-arista_7170_32c/default_sku b/device/arista/x86_64-arista_7170_32c/default_sku index 536bad44f086..e396ca3395f6 100644 --- a/device/arista/x86_64-arista_7170_32c/default_sku +++ b/device/arista/x86_64-arista_7170_32c/default_sku @@ -1 +1 @@ -Arista-7170-32CD-C32 t1 +Arista-7170-32C-C32 t1 diff --git a/device/arista/x86_64-arista_7170_32c/sensors.conf b/device/arista/x86_64-arista_7170_32c/sensors.conf deleted file mode 120000 index 1ab9e0f47704..000000000000 --- a/device/arista/x86_64-arista_7170_32c/sensors.conf +++ /dev/null @@ -1 +0,0 @@ -../x86_64-arista_7170_64c/sensors.conf \ No newline at end of file diff --git a/device/arista/x86_64-arista_7170_32c/sensors.conf b/device/arista/x86_64-arista_7170_32c/sensors.conf new file mode 100644 index 000000000000..d3de228da97a --- /dev/null +++ b/device/arista/x86_64-arista_7170_32c/sensors.conf @@ -0,0 +1,57 @@ +# libsensors configuration file for DCS-7170-32C +# ------------------------------------------------ + +bus "i2c-6" "SCD 0000:06:00.0 SMBus master 0 bus 5" +bus "i2c-7" "SCD 0000:06:00.0 SMBus master 0 bus 6" +bus "i2c-8" "SCD 0000:06:00.0 SMBus master 0 bus 7" +bus "i2c-81" "SCD 0000:ff:0b.3 SMBus master 0 bus 0" + +chip "max6658-i2c-8-4c" + label temp1 "Temp sensor near ASIC" + + set temp1_max 100 + set temp1_crit 110 + set temp1_min -55 + + set temp2_max 100 + set temp2_crit 110 + set temp2_min -55 + ignore temp2 + +chip "pmbus-i2c-6-58" + label temp1 "PSU1 primary hotspot temp" + label temp2 "PSU1 inlet temp" + label temp3 "PSU1 exhaust temp" + + # setting maximum and critical thresholds is not supported for this psu + # fault and warning limits defined internally by hardware + + ignore fan2 + ignore fan3 + +chip "pmbus-i2c-7-58" + label temp1 "PSU2 primary hotspot temp" + label temp2 "PSU2 inlet temp" + label temp3 "PSU2 exhaust temp" + + # setting maximum and critical thresholds is not supported for this psu + # fault and warning limits defined internally by hardware + + ignore fan2 + ignore fan3 + +chip "max6658-i2c-81-4c" + label temp1 "Rear air temp1" + label temp2 "Rear air temp2" + + set temp1_max 70 + set temp1_crit 80 + set temp1_min -55 + set temp2_max 70 + set temp2_crit 80 + set temp2_min -55 + +chip "lm73-i2c-8-4a" + label temp1 "Front air temp" + + set temp1_max 65 diff --git a/device/arista/x86_64-arista_7170_32cd/pcie.yaml b/device/arista/x86_64-arista_7170_32cd/pcie.yaml new file mode 100644 index 000000000000..eafae4eb1472 --- /dev/null +++ b/device/arista/x86_64-arista_7170_32cd/pcie.yaml @@ -0,0 +1,433 @@ +- bus: '00' + dev: '00' + fn: '0' + id: 6f00 + name: 'Host bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D DMI2 + (rev 03)' +- bus: '00' + dev: '01' + fn: '0' + id: 6f02 + name: 'PCI bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D PCI + Express Root Port 1 (rev 03)' +- bus: '00' + dev: '01' + fn: '1' + id: 6f03 + name: 'PCI bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D PCI + Express Root Port 1 (rev 03)' +- bus: '00' + dev: '02' + fn: '0' + id: 6f04 + name: 'PCI bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D PCI + Express Root Port 2 (rev 03)' +- bus: '00' + dev: '02' + fn: '2' + id: 6f06 + name: 'PCI bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D PCI + Express Root Port 2 (rev 03)' +- bus: '00' + dev: '03' + fn: '0' + id: 6f08 + name: 'PCI bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D PCI + Express Root Port 3 (rev 03)' +- bus: '00' + dev: '05' + fn: '0' + id: 6f28 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Map/VTd_Misc/System Management (rev 03)' +- bus: '00' + dev: '05' + fn: '1' + id: 6f29 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D IIO Hot Plug (rev 03)' +- bus: '00' + dev: '05' + fn: '2' + id: 6f2a + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D IIO RAS/Control Status/Global Errors (rev 03)' +- bus: '00' + dev: '05' + fn: '4' + id: 6f2c + name: 'PIC: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D I/O APIC (rev + 03)' +- bus: '00' + dev: '14' + fn: '0' + id: 8c31 + name: 'USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB + xHCI (rev 05)' +- bus: '00' + dev: 1a + fn: '0' + id: 8c2d + name: 'USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB + EHCI #2 (rev 05)' +- bus: '00' + dev: 1c + fn: '0' + id: 8c10 + name: 'PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express + Root Port #1 (rev d5)' +- bus: '00' + dev: 1c + fn: '4' + id: 8c18 + name: 'PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express + Root Port #5 (rev d5)' +- bus: '00' + dev: 1d + fn: '0' + id: 8c26 + name: 'USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB + EHCI #1 (rev 05)' +- bus: '00' + dev: 1f + fn: '0' + id: 8c54 + name: 'ISA bridge: Intel Corporation C224 Series Chipset Family Server Standard + SKU LPC Controller (rev 05)' +- bus: '00' + dev: 1f + fn: '2' + id: 8c02 + name: 'SATA controller: Intel Corporation 8 Series/C220 Series Chipset Family 6-port + SATA Controller 1 [AHCI mode] (rev 05)' +- bus: '00' + dev: 1f + fn: '3' + id: 8c22 + name: 'SMBus: Intel Corporation 8 Series/C220 Series Chipset Family SMBus Controller + (rev 05)' +- bus: '00' + dev: 1f + fn: '6' + id: 8c24 + name: 'Signal processing controller: Intel Corporation 8 Series Chipset Family Thermal + Management Controller (rev 05)' +- bus: '01' + dev: '00' + fn: '0' + id: '1682' + name: 'Ethernet controller: Broadcom Limited NetXtreme BCM57762 Gigabit Ethernet + PCIe (rev 20)' +- bus: '02' + dev: '00' + fn: '0' + id: '1682' + name: 'Ethernet controller: Broadcom Limited NetXtreme BCM57762 Gigabit Ethernet + PCIe (rev 20)' +- bus: '03' + dev: '00' + fn: '0' + id: 6f50 + name: 'System peripheral: Intel Corporation Xeon Processor D Family QuickData Technology + Register DMA Channel 0' +- bus: '03' + dev: '00' + fn: '1' + id: 6f51 + name: 'System peripheral: Intel Corporation Xeon Processor D Family QuickData Technology + Register DMA Channel 1' +- bus: '03' + dev: '00' + fn: '2' + id: 6f52 + name: 'System peripheral: Intel Corporation Xeon Processor D Family QuickData Technology + Register DMA Channel 2' +- bus: '03' + dev: '00' + fn: '3' + id: 6f53 + name: 'System peripheral: Intel Corporation Xeon Processor D Family QuickData Technology + Register DMA Channel 3' +- bus: '04' + dev: '00' + fn: '0' + id: 15ab + name: 'Ethernet controller: Intel Corporation Ethernet Connection X552 10 GbE Backplane' +- bus: '04' + dev: '00' + fn: '1' + id: 15ab + name: 'Ethernet controller: Intel Corporation Ethernet Connection X552 10 GbE Backplane' +- bus: '06' + dev: '00' + fn: '0' + id: '0001' + name: 'System peripheral: Arastra Inc. Device 0001' +- bus: '07' + dev: '00' + fn: '0' + id: '0010' + name: 'Unassigned class [ff00]: Device 1d1c:0010 (rev 10)' +- bus: ff + dev: 0b + fn: '0' + id: 6f81 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D R3 QPI Link 0/1 (rev 03)' +- bus: ff + dev: 0b + fn: '1' + id: 6f36 + name: 'Performance counters: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D R3 QPI Link 0/1 (rev 03)' +- bus: ff + dev: 0b + fn: '2' + id: 6f37 + name: 'Performance counters: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D R3 QPI Link 0/1 (rev 03)' +- bus: ff + dev: 0b + fn: '3' + id: '0001' + name: 'System peripheral: Arastra Inc. Device 0001 (rev 03)' +- bus: ff + dev: 0c + fn: '0' + id: 6fe0 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: ff + dev: 0c + fn: '1' + id: 6fe1 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: ff + dev: 0f + fn: '0' + id: 6ff8 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: ff + dev: 0f + fn: '4' + id: 6ffc + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: ff + dev: 0f + fn: '5' + id: 6ffd + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: ff + dev: 0f + fn: '6' + id: 6ffe + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: ff + dev: '10' + fn: '0' + id: 6f1d + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D R2PCIe Agent (rev 03)' +- bus: ff + dev: '10' + fn: '1' + id: 6f34 + name: 'Performance counters: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D R2PCIe Agent (rev 03)' +- bus: ff + dev: '10' + fn: '5' + id: 6f1e + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Ubox (rev 03)' +- bus: ff + dev: '10' + fn: '6' + id: 6f7d + name: 'Performance counters: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Ubox (rev 03)' +- bus: ff + dev: '10' + fn: '7' + id: 6f1f + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Ubox (rev 03)' +- bus: ff + dev: '12' + fn: '0' + id: 6fa0 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Home Agent 0 (rev 03)' +- bus: ff + dev: '12' + fn: '1' + id: 6f30 + name: 'Performance counters: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Home Agent 0 (rev 03)' +- bus: ff + dev: '13' + fn: '0' + id: 6fa8 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Target Address/Thermal/RAS (rev 03)' +- bus: ff + dev: '13' + fn: '1' + id: 6f71 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Target Address/Thermal/RAS (rev 03)' +- bus: ff + dev: '13' + fn: '2' + id: 6faa + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel Target Address Decoder (rev 03)' +- bus: ff + dev: '13' + fn: '3' + id: 6fab + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel Target Address Decoder (rev 03)' +- bus: ff + dev: '13' + fn: '4' + id: 6fac + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel Target Address Decoder (rev 03)' +- bus: ff + dev: '13' + fn: '5' + id: 6fad + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel Target Address Decoder (rev 03)' +- bus: ff + dev: '13' + fn: '6' + id: 6fae + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D DDRIO Channel 0/1 Broadcast (rev 03)' +- bus: ff + dev: '13' + fn: '7' + id: 6faf + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D DDRIO Global Broadcast (rev 03)' +- bus: ff + dev: '14' + fn: '0' + id: 6fb0 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 0 Thermal Control (rev 03)' +- bus: ff + dev: '14' + fn: '1' + id: 6fb1 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 1 Thermal Control (rev 03)' +- bus: ff + dev: '14' + fn: '2' + id: 6fb2 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 0 Error (rev 03)' +- bus: ff + dev: '14' + fn: '3' + id: 6fb3 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 1 Error (rev 03)' +- bus: ff + dev: '14' + fn: '4' + id: 6fbc + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D DDRIO Channel 0/1 Interface (rev 03)' +- bus: ff + dev: '14' + fn: '5' + id: 6fbd + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D DDRIO Channel 0/1 Interface (rev 03)' +- bus: ff + dev: '14' + fn: '6' + id: 6fbe + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D DDRIO Channel 0/1 Interface (rev 03)' +- bus: ff + dev: '14' + fn: '7' + id: 6fbf + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D DDRIO Channel 0/1 Interface (rev 03)' +- bus: ff + dev: '15' + fn: '0' + id: 6fb4 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 2 Thermal Control (rev 03)' +- bus: ff + dev: '15' + fn: '1' + id: 6fb5 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 3 Thermal Control (rev 03)' +- bus: ff + dev: '15' + fn: '2' + id: 6fb6 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 2 Error (rev 03)' +- bus: ff + dev: '15' + fn: '3' + id: 6fb7 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 3 Error (rev 03)' +- bus: ff + dev: 1e + fn: '0' + id: 6f98 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Power Control Unit (rev 03)' +- bus: ff + dev: 1e + fn: '1' + id: 6f99 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Power Control Unit (rev 03)' +- bus: ff + dev: 1e + fn: '2' + id: 6f9a + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Power Control Unit (rev 03)' +- bus: ff + dev: 1e + fn: '3' + id: 6fc0 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Power Control Unit (rev 03)' +- bus: ff + dev: 1e + fn: '4' + id: 6f9c + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Power Control Unit (rev 03)' +- bus: ff + dev: 1f + fn: '0' + id: 6f88 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Power Control Unit (rev 03)' +- bus: ff + dev: 1f + fn: '2' + id: 6f8a + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Power Control Unit (rev 03)' diff --git a/device/arista/x86_64-arista_7170_32cd/sensors.conf b/device/arista/x86_64-arista_7170_32cd/sensors.conf index 1ab9e0f47704..39485db7bba1 120000 --- a/device/arista/x86_64-arista_7170_32cd/sensors.conf +++ b/device/arista/x86_64-arista_7170_32cd/sensors.conf @@ -1 +1 @@ -../x86_64-arista_7170_64c/sensors.conf \ No newline at end of file +../x86_64-arista_7170_32c/sensors.conf \ No newline at end of file diff --git a/device/arista/x86_64-arista_7170_64c/pcie.yaml b/device/arista/x86_64-arista_7170_64c/pcie.yaml new file mode 100644 index 000000000000..eafae4eb1472 --- /dev/null +++ b/device/arista/x86_64-arista_7170_64c/pcie.yaml @@ -0,0 +1,433 @@ +- bus: '00' + dev: '00' + fn: '0' + id: 6f00 + name: 'Host bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D DMI2 + (rev 03)' +- bus: '00' + dev: '01' + fn: '0' + id: 6f02 + name: 'PCI bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D PCI + Express Root Port 1 (rev 03)' +- bus: '00' + dev: '01' + fn: '1' + id: 6f03 + name: 'PCI bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D PCI + Express Root Port 1 (rev 03)' +- bus: '00' + dev: '02' + fn: '0' + id: 6f04 + name: 'PCI bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D PCI + Express Root Port 2 (rev 03)' +- bus: '00' + dev: '02' + fn: '2' + id: 6f06 + name: 'PCI bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D PCI + Express Root Port 2 (rev 03)' +- bus: '00' + dev: '03' + fn: '0' + id: 6f08 + name: 'PCI bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D PCI + Express Root Port 3 (rev 03)' +- bus: '00' + dev: '05' + fn: '0' + id: 6f28 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Map/VTd_Misc/System Management (rev 03)' +- bus: '00' + dev: '05' + fn: '1' + id: 6f29 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D IIO Hot Plug (rev 03)' +- bus: '00' + dev: '05' + fn: '2' + id: 6f2a + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D IIO RAS/Control Status/Global Errors (rev 03)' +- bus: '00' + dev: '05' + fn: '4' + id: 6f2c + name: 'PIC: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D I/O APIC (rev + 03)' +- bus: '00' + dev: '14' + fn: '0' + id: 8c31 + name: 'USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB + xHCI (rev 05)' +- bus: '00' + dev: 1a + fn: '0' + id: 8c2d + name: 'USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB + EHCI #2 (rev 05)' +- bus: '00' + dev: 1c + fn: '0' + id: 8c10 + name: 'PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express + Root Port #1 (rev d5)' +- bus: '00' + dev: 1c + fn: '4' + id: 8c18 + name: 'PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express + Root Port #5 (rev d5)' +- bus: '00' + dev: 1d + fn: '0' + id: 8c26 + name: 'USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB + EHCI #1 (rev 05)' +- bus: '00' + dev: 1f + fn: '0' + id: 8c54 + name: 'ISA bridge: Intel Corporation C224 Series Chipset Family Server Standard + SKU LPC Controller (rev 05)' +- bus: '00' + dev: 1f + fn: '2' + id: 8c02 + name: 'SATA controller: Intel Corporation 8 Series/C220 Series Chipset Family 6-port + SATA Controller 1 [AHCI mode] (rev 05)' +- bus: '00' + dev: 1f + fn: '3' + id: 8c22 + name: 'SMBus: Intel Corporation 8 Series/C220 Series Chipset Family SMBus Controller + (rev 05)' +- bus: '00' + dev: 1f + fn: '6' + id: 8c24 + name: 'Signal processing controller: Intel Corporation 8 Series Chipset Family Thermal + Management Controller (rev 05)' +- bus: '01' + dev: '00' + fn: '0' + id: '1682' + name: 'Ethernet controller: Broadcom Limited NetXtreme BCM57762 Gigabit Ethernet + PCIe (rev 20)' +- bus: '02' + dev: '00' + fn: '0' + id: '1682' + name: 'Ethernet controller: Broadcom Limited NetXtreme BCM57762 Gigabit Ethernet + PCIe (rev 20)' +- bus: '03' + dev: '00' + fn: '0' + id: 6f50 + name: 'System peripheral: Intel Corporation Xeon Processor D Family QuickData Technology + Register DMA Channel 0' +- bus: '03' + dev: '00' + fn: '1' + id: 6f51 + name: 'System peripheral: Intel Corporation Xeon Processor D Family QuickData Technology + Register DMA Channel 1' +- bus: '03' + dev: '00' + fn: '2' + id: 6f52 + name: 'System peripheral: Intel Corporation Xeon Processor D Family QuickData Technology + Register DMA Channel 2' +- bus: '03' + dev: '00' + fn: '3' + id: 6f53 + name: 'System peripheral: Intel Corporation Xeon Processor D Family QuickData Technology + Register DMA Channel 3' +- bus: '04' + dev: '00' + fn: '0' + id: 15ab + name: 'Ethernet controller: Intel Corporation Ethernet Connection X552 10 GbE Backplane' +- bus: '04' + dev: '00' + fn: '1' + id: 15ab + name: 'Ethernet controller: Intel Corporation Ethernet Connection X552 10 GbE Backplane' +- bus: '06' + dev: '00' + fn: '0' + id: '0001' + name: 'System peripheral: Arastra Inc. Device 0001' +- bus: '07' + dev: '00' + fn: '0' + id: '0010' + name: 'Unassigned class [ff00]: Device 1d1c:0010 (rev 10)' +- bus: ff + dev: 0b + fn: '0' + id: 6f81 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D R3 QPI Link 0/1 (rev 03)' +- bus: ff + dev: 0b + fn: '1' + id: 6f36 + name: 'Performance counters: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D R3 QPI Link 0/1 (rev 03)' +- bus: ff + dev: 0b + fn: '2' + id: 6f37 + name: 'Performance counters: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D R3 QPI Link 0/1 (rev 03)' +- bus: ff + dev: 0b + fn: '3' + id: '0001' + name: 'System peripheral: Arastra Inc. Device 0001 (rev 03)' +- bus: ff + dev: 0c + fn: '0' + id: 6fe0 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: ff + dev: 0c + fn: '1' + id: 6fe1 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: ff + dev: 0f + fn: '0' + id: 6ff8 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: ff + dev: 0f + fn: '4' + id: 6ffc + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: ff + dev: 0f + fn: '5' + id: 6ffd + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: ff + dev: 0f + fn: '6' + id: 6ffe + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: ff + dev: '10' + fn: '0' + id: 6f1d + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D R2PCIe Agent (rev 03)' +- bus: ff + dev: '10' + fn: '1' + id: 6f34 + name: 'Performance counters: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D R2PCIe Agent (rev 03)' +- bus: ff + dev: '10' + fn: '5' + id: 6f1e + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Ubox (rev 03)' +- bus: ff + dev: '10' + fn: '6' + id: 6f7d + name: 'Performance counters: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Ubox (rev 03)' +- bus: ff + dev: '10' + fn: '7' + id: 6f1f + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Ubox (rev 03)' +- bus: ff + dev: '12' + fn: '0' + id: 6fa0 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Home Agent 0 (rev 03)' +- bus: ff + dev: '12' + fn: '1' + id: 6f30 + name: 'Performance counters: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Home Agent 0 (rev 03)' +- bus: ff + dev: '13' + fn: '0' + id: 6fa8 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Target Address/Thermal/RAS (rev 03)' +- bus: ff + dev: '13' + fn: '1' + id: 6f71 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Target Address/Thermal/RAS (rev 03)' +- bus: ff + dev: '13' + fn: '2' + id: 6faa + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel Target Address Decoder (rev 03)' +- bus: ff + dev: '13' + fn: '3' + id: 6fab + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel Target Address Decoder (rev 03)' +- bus: ff + dev: '13' + fn: '4' + id: 6fac + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel Target Address Decoder (rev 03)' +- bus: ff + dev: '13' + fn: '5' + id: 6fad + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel Target Address Decoder (rev 03)' +- bus: ff + dev: '13' + fn: '6' + id: 6fae + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D DDRIO Channel 0/1 Broadcast (rev 03)' +- bus: ff + dev: '13' + fn: '7' + id: 6faf + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D DDRIO Global Broadcast (rev 03)' +- bus: ff + dev: '14' + fn: '0' + id: 6fb0 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 0 Thermal Control (rev 03)' +- bus: ff + dev: '14' + fn: '1' + id: 6fb1 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 1 Thermal Control (rev 03)' +- bus: ff + dev: '14' + fn: '2' + id: 6fb2 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 0 Error (rev 03)' +- bus: ff + dev: '14' + fn: '3' + id: 6fb3 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 1 Error (rev 03)' +- bus: ff + dev: '14' + fn: '4' + id: 6fbc + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D DDRIO Channel 0/1 Interface (rev 03)' +- bus: ff + dev: '14' + fn: '5' + id: 6fbd + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D DDRIO Channel 0/1 Interface (rev 03)' +- bus: ff + dev: '14' + fn: '6' + id: 6fbe + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D DDRIO Channel 0/1 Interface (rev 03)' +- bus: ff + dev: '14' + fn: '7' + id: 6fbf + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D DDRIO Channel 0/1 Interface (rev 03)' +- bus: ff + dev: '15' + fn: '0' + id: 6fb4 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 2 Thermal Control (rev 03)' +- bus: ff + dev: '15' + fn: '1' + id: 6fb5 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 3 Thermal Control (rev 03)' +- bus: ff + dev: '15' + fn: '2' + id: 6fb6 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 2 Error (rev 03)' +- bus: ff + dev: '15' + fn: '3' + id: 6fb7 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 3 Error (rev 03)' +- bus: ff + dev: 1e + fn: '0' + id: 6f98 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Power Control Unit (rev 03)' +- bus: ff + dev: 1e + fn: '1' + id: 6f99 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Power Control Unit (rev 03)' +- bus: ff + dev: 1e + fn: '2' + id: 6f9a + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Power Control Unit (rev 03)' +- bus: ff + dev: 1e + fn: '3' + id: 6fc0 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Power Control Unit (rev 03)' +- bus: ff + dev: 1e + fn: '4' + id: 6f9c + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Power Control Unit (rev 03)' +- bus: ff + dev: 1f + fn: '0' + id: 6f88 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Power Control Unit (rev 03)' +- bus: ff + dev: 1f + fn: '2' + id: 6f8a + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Power Control Unit (rev 03)' diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64/BALANCED b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64/BALANCED new file mode 120000 index 000000000000..a270c70ffc36 --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64/BALANCED @@ -0,0 +1 @@ +../../../common/profiles/th2/7260/BALANCED \ No newline at end of file diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64/RDMA-CENTRIC b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64/RDMA-CENTRIC new file mode 120000 index 000000000000..8d1ec6d277a8 --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64/RDMA-CENTRIC @@ -0,0 +1 @@ +../../../common/profiles/th2/7260/RDMA-CENTRIC \ No newline at end of file diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64/TCP-CENTRIC b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64/TCP-CENTRIC new file mode 120000 index 000000000000..7ee783aac6a4 --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64/TCP-CENTRIC @@ -0,0 +1 @@ +../../../common/profiles/th2/7260/TCP-CENTRIC \ No newline at end of file diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64/buffer_ports_t0.j2 b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64/buffer_ports_t0.j2 new file mode 100644 index 000000000000..2d56c4b38f9e --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64/buffer_ports_t0.j2 @@ -0,0 +1,6 @@ +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {%- for port_idx in range(0,64) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{%- endif %} + {%- endfor %} +{%- endmacro %} diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64/buffer_ports_t1.j2 b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64/buffer_ports_t1.j2 new file mode 100644 index 000000000000..2d56c4b38f9e --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64/buffer_ports_t1.j2 @@ -0,0 +1,6 @@ +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {%- for port_idx in range(0,64) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{%- endif %} + {%- endfor %} +{%- endmacro %} diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64/buffers.json.j2 b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64/buffers.json.j2 new file mode 100644 index 000000000000..b67cf577ab75 --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64/buffers.json.j2 @@ -0,0 +1,3 @@ +{%- set default_topo = 't1' %} +{%- include 'buffers_config.j2' %} + diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64/buffers_defaults_t0.j2 b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64/buffers_defaults_t0.j2 new file mode 120000 index 000000000000..9524e6a476ac --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64/buffers_defaults_t0.j2 @@ -0,0 +1 @@ +BALANCED/buffers_defaults_t0.j2 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64/buffers_defaults_t1.j2 b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64/buffers_defaults_t1.j2 new file mode 120000 index 000000000000..c25cc95d6d57 --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64/buffers_defaults_t1.j2 @@ -0,0 +1 @@ +BALANCED/buffers_defaults_t1.j2 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64/buffers_extra_queues.j2 b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64/buffers_extra_queues.j2 new file mode 100644 index 000000000000..4c213b52d326 --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64/buffers_extra_queues.j2 @@ -0,0 +1,38 @@ +{% if DEVICE_METADATA is defined and 'type' in DEVICE_METADATA['localhost'] and +(DEVICE_METADATA['localhost']['type'] == 'LeafRouter' or DEVICE_METADATA['localhost']['subtype'] == 'DualToR') %} +{%- macro generate_queue_buffers_with_extra_lossless_queues(port_names, port_names_require_extra_buffer) %} + "BUFFER_QUEUE": { +{% for port in port_names.split(',') %} +{% if port in port_names_require_extra_buffer.split(',') %} + "{{ port }}|0-1": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "{{ port }}|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "{{ port }}|5": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "{{ port }}|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "{{ port }}|7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }{% if not loop.last %},{% endif %} + +{% else %} + "{{ port }}|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "{{ port }}|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "{{ port }}|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }{% if not loop.last %},{% endif %} + +{% endif %} +{% endfor %} + } +{% endmacro %} +{% endif %} diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64/buffers_pool_sizes_t0.j2 b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64/buffers_pool_sizes_t0.j2 new file mode 100644 index 000000000000..bd82c947e4fc --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64/buffers_pool_sizes_t0.j2 @@ -0,0 +1,8 @@ +{%- set ingress_lossless_pool_size = '33329088' %} +{%- set egress_lossy_pool_size = '26663272' %} + +{%- if ((SYSTEM_DEFAULTS is defined) and ('tunnel_qos_remap' in SYSTEM_DEFAULTS) and (SYSTEM_DEFAULTS['tunnel_qos_remap']['status'] == 'enabled')) and +((DEVICE_METADATA is defined) and ('localhost' in DEVICE_METADATA) and ('subtype' in DEVICE_METADATA['localhost']) and (DEVICE_METADATA['localhost']['subtype'] == 'DualToR')) %} + {%- set ingress_lossless_pool_size = '33169344' %} + {%- set egress_lossy_pool_size = '26535808' %} +{%- endif %} diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64/buffers_pool_sizes_t1.j2 b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64/buffers_pool_sizes_t1.j2 new file mode 100644 index 000000000000..43b31de8ad43 --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64/buffers_pool_sizes_t1.j2 @@ -0,0 +1,8 @@ +{%- set ingress_lossless_pool_size = '33582016' %} +{%- set egress_lossy_pool_size = '26866112' %} + +{%- if ((SYSTEM_DEFAULTS is defined) and ('tunnel_qos_remap' in SYSTEM_DEFAULTS) and (SYSTEM_DEFAULTS['tunnel_qos_remap']['status'] == 'enabled')) and +((DEVICE_METADATA is defined) and ('localhost' in DEVICE_METADATA) and ('type' in DEVICE_METADATA['localhost']) and (DEVICE_METADATA['localhost']['type'] == 'LeafRouter')) %} + {%- set ingress_lossless_pool_size = '33262528' %} + {%- set egress_lossy_pool_size = '26610688' %} +{%- endif %} diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64/config.bcm.j2 b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64/config.bcm.j2 new file mode 100644 index 000000000000..6c8c30e5f072 --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64/config.bcm.j2 @@ -0,0 +1,1045 @@ +{# Construct config.bcm to include additional soc properties per specific device metadata requirement #} +{%- set mmu_sock = 'mmu_init_config="MSFT-TH2-Tier1"' -%} +{%- set IPinIP_sock = '' -%} +{%- set map_prio = '' -%} +{%- if DEVICE_METADATA is defined and DEVICE_METADATA['localhost'] is defined -%} +{%- if DEVICE_METADATA['localhost']['type'] is defined -%} +{%- set switch_role = DEVICE_METADATA['localhost']['type'] -%} +{%- if 'torrouter' in switch_role.lower() or 'torswitch' in switch_role.lower() %} +{%- set mmu_sock = 'mmu_init_config="MSFT-TH2-Tier0"' -%} +{%- endif %} +{%- endif %} +{%- if DEVICE_METADATA['localhost']['subtype'] is defined -%} +{%- set switch_subtype = DEVICE_METADATA['localhost']['subtype'] -%} +{%- if 'dualtor' in switch_subtype.lower() %} +{%- set IPinIP_sock = 'sai_tunnel_support=1 + sai_tunnel_underlay_route_mode=1 + host_as_route_disable=1 + l3_ecmp_levels=2' -%} +{%- set map_prio = 'sai_remap_prio_on_tnl_egress=1' -%} +{%- endif %} +{%- endif %} +{%- endif %} +{# The following is the common soc properties that used to be named "th2-a7260cx3-64-64x100G-t1.config.bcm" #} + +l3_alpm_hit_skip=1 +sai_adjust_acl_drop_in_rx_drop=1 +{{ map_prio }} +PHY_AN_ALLOW_PLL_CHANGE=1 +arl_clean_timeout_usec=15000000 +asf_mem_profile=2 +bcm_num_cos=10 +bcm_stat_flags=1 +bcm_stat_jumbo=9236 +cdma_timeout_usec=15000000 +core_clock_frequency=1700 +dma_desc_timeout_usec=15000000 +dpp_clock_ratio=2:3 +higig2_hdr_mode=1 +ipv6_lpm_128b_enable=1 +l3_alpm_enable=2 +lpm_scaling_enable=0 +l2xmsg_mode=1 +max_vp_lags=0 +mem_scan_enable=1 +miim_intr_enable=0 +module_64ports=1 +os=unix +oversubscribe_mode=1 +pbmp_xport_xe=0x40003ffff0000ffffc0003fffe0001fffe +phy_an_allow_pll_change_hg=0 +phy_an_c73_100=1 +phy_an_c73_102=1 +phy_an_c73_103=1 +phy_an_c73_104=1 +phy_an_c73_105=1 +phy_an_c73_106=1 +phy_an_c73_107=1 +phy_an_c73_108=1 +phy_an_c73_109=1 +phy_an_c73_10=1 +phy_an_c73_110=1 +phy_an_c73_111=1 +phy_an_c73_112=1 +phy_an_c73_113=1 +phy_an_c73_114=1 +phy_an_c73_115=1 +phy_an_c73_116=1 +phy_an_c73_117=1 +phy_an_c73_11=1 +phy_an_c73_12=1 +phy_an_c73_13=1 +phy_an_c73_14=1 +phy_an_c73_15=1 +phy_an_c73_16=1 +phy_an_c73_1=1 +phy_an_c73_2=1 +phy_an_c73_34=1 +phy_an_c73_35=1 +phy_an_c73_36=1 +phy_an_c73_37=1 +phy_an_c73_38=1 +phy_an_c73_39=1 +phy_an_c73_3=1 +phy_an_c73_40=1 +phy_an_c73_41=1 +phy_an_c73_42=1 +phy_an_c73_43=1 +phy_an_c73_44=1 +phy_an_c73_45=1 +phy_an_c73_46=1 +phy_an_c73_47=1 +phy_an_c73_48=1 +phy_an_c73_49=1 +phy_an_c73_4=1 +phy_an_c73_5=1 +phy_an_c73_66=1 +phy_an_c73_68=1 +phy_an_c73_69=1 +phy_an_c73_6=1 +phy_an_c73_70=1 +phy_an_c73_71=1 +phy_an_c73_72=1 +phy_an_c73_73=1 +phy_an_c73_74=1 +phy_an_c73_75=1 +phy_an_c73_76=1 +phy_an_c73_77=1 +phy_an_c73_78=1 +phy_an_c73_79=1 +phy_an_c73_7=1 +phy_an_c73_80=1 +phy_an_c73_81=1 +phy_an_c73_82=1 +phy_an_c73_83=1 +phy_an_c73_8=1 +phy_an_c73_9=1 +phy_chain_rx_lane_map_physical{1.0}=0x3210 +phy_chain_rx_lane_map_physical{101.0}=0x0123 +phy_chain_rx_lane_map_physical{105.0}=0x0123 +phy_chain_rx_lane_map_physical{109.0}=0x0123 +phy_chain_rx_lane_map_physical{113.0}=0x2301 +phy_chain_rx_lane_map_physical{117.0}=0x3210 +phy_chain_rx_lane_map_physical{121.0}=0x3210 +phy_chain_rx_lane_map_physical{125.0}=0x1203 +phy_chain_rx_lane_map_physical{129.0}=0x3210 +phy_chain_rx_lane_map_physical{13.0}=0x0321 +phy_chain_rx_lane_map_physical{133.0}=0x1032 +phy_chain_rx_lane_map_physical{137.0}=0x3210 +phy_chain_rx_lane_map_physical{141.0}=0x0123 +phy_chain_rx_lane_map_physical{145.0}=0x3210 +phy_chain_rx_lane_map_physical{149.0}=0x2310 +phy_chain_rx_lane_map_physical{153.0}=0x0132 +phy_chain_rx_lane_map_physical{157.0}=0x1302 +phy_chain_rx_lane_map_physical{161.0}=0x3021 +phy_chain_rx_lane_map_physical{165.0}=0x2031 +phy_chain_rx_lane_map_physical{169.0}=0x2031 +phy_chain_rx_lane_map_physical{17.0}=0x3210 +phy_chain_rx_lane_map_physical{173.0}=0x1302 +phy_chain_rx_lane_map_physical{177.0}=0x2031 +phy_chain_rx_lane_map_physical{181.0}=0x0213 +phy_chain_rx_lane_map_physical{185.0}=0x0213 +phy_chain_rx_lane_map_physical{189.0}=0x1302 +phy_chain_rx_lane_map_physical{193.0}=0x3120 +phy_chain_rx_lane_map_physical{197.0}=0x0231 +phy_chain_rx_lane_map_physical{201.0}=0x2031 +phy_chain_rx_lane_map_physical{205.0}=0x0213 +phy_chain_rx_lane_map_physical{209.0}=0x2013 +phy_chain_rx_lane_map_physical{21.0}=0x3021 +phy_chain_rx_lane_map_physical{213.0}=0x3021 +phy_chain_rx_lane_map_physical{217.0}=0x0231 +phy_chain_rx_lane_map_physical{221.0}=0x2031 +phy_chain_rx_lane_map_physical{225.0}=0x1203 +phy_chain_rx_lane_map_physical{229.0}=0x1230 +phy_chain_rx_lane_map_physical{233.0}=0x3021 +phy_chain_rx_lane_map_physical{237.0}=0x1032 +phy_chain_rx_lane_map_physical{241.0}=0x2301 +phy_chain_rx_lane_map_physical{245.0}=0x0321 +phy_chain_rx_lane_map_physical{249.0}=0x2301 +phy_chain_rx_lane_map_physical{25.0}=0x2301 +phy_chain_rx_lane_map_physical{253.0}=0x2301 +phy_chain_rx_lane_map_physical{257.0}=0x3210 +phy_chain_rx_lane_map_physical{29.0}=0x3021 +phy_chain_rx_lane_map_physical{33.0}=0x1302 +phy_chain_rx_lane_map_physical{37.0}=0x2031 +phy_chain_rx_lane_map_physical{41.0}=0x3021 +phy_chain_rx_lane_map_physical{45.0}=0x1023 +phy_chain_rx_lane_map_physical{49.0}=0x0213 +phy_chain_rx_lane_map_physical{5.0}=0x3201 +phy_chain_rx_lane_map_physical{53.0}=0x3201 +phy_chain_rx_lane_map_physical{57.0}=0x2013 +phy_chain_rx_lane_map_physical{61.0}=0x0213 +phy_chain_rx_lane_map_physical{65.0}=0x1203 +phy_chain_rx_lane_map_physical{69.0}=0x0213 +phy_chain_rx_lane_map_physical{73.0}=0x0213 +phy_chain_rx_lane_map_physical{77.0}=0x3120 +phy_chain_rx_lane_map_physical{81.0}=0x0213 +phy_chain_rx_lane_map_physical{85.0}=0x2031 +phy_chain_rx_lane_map_physical{89.0}=0x2031 +phy_chain_rx_lane_map_physical{9.0}=0x0321 +phy_chain_rx_lane_map_physical{93.0}=0x3120 +phy_chain_rx_lane_map_physical{97.0}=0x1203 +phy_chain_rx_polarity_flip_physical{1.0}=0x1 +phy_chain_rx_polarity_flip_physical{10.0}=0x0 +phy_chain_rx_polarity_flip_physical{100.0}=0x1 +phy_chain_rx_polarity_flip_physical{101.0}=0x1 +phy_chain_rx_polarity_flip_physical{102.0}=0x0 +phy_chain_rx_polarity_flip_physical{103.0}=0x1 +phy_chain_rx_polarity_flip_physical{104.0}=0x0 +phy_chain_rx_polarity_flip_physical{105.0}=0x1 +phy_chain_rx_polarity_flip_physical{106.0}=0x0 +phy_chain_rx_polarity_flip_physical{107.0}=0x1 +phy_chain_rx_polarity_flip_physical{108.0}=0x0 +phy_chain_rx_polarity_flip_physical{109.0}=0x0 +phy_chain_rx_polarity_flip_physical{11.0}=0x1 +phy_chain_rx_polarity_flip_physical{110.0}=0x1 +phy_chain_rx_polarity_flip_physical{111.0}=0x0 +phy_chain_rx_polarity_flip_physical{112.0}=0x1 +phy_chain_rx_polarity_flip_physical{113.0}=0x1 +phy_chain_rx_polarity_flip_physical{114.0}=0x0 +phy_chain_rx_polarity_flip_physical{115.0}=0x1 +phy_chain_rx_polarity_flip_physical{116.0}=0x0 +phy_chain_rx_polarity_flip_physical{117.0}=0x0 +phy_chain_rx_polarity_flip_physical{118.0}=0x0 +phy_chain_rx_polarity_flip_physical{119.0}=0x1 +phy_chain_rx_polarity_flip_physical{12.0}=0x1 +phy_chain_rx_polarity_flip_physical{120.0}=0x0 +phy_chain_rx_polarity_flip_physical{121.0}=0x1 +phy_chain_rx_polarity_flip_physical{122.0}=0x0 +phy_chain_rx_polarity_flip_physical{123.0}=0x1 +phy_chain_rx_polarity_flip_physical{124.0}=0x0 +phy_chain_rx_polarity_flip_physical{125.0}=0x0 +phy_chain_rx_polarity_flip_physical{126.0}=0x1 +phy_chain_rx_polarity_flip_physical{127.0}=0x1 +phy_chain_rx_polarity_flip_physical{128.0}=0x1 +phy_chain_rx_polarity_flip_physical{129.0}=0x0 +phy_chain_rx_polarity_flip_physical{13.0}=0x1 +phy_chain_rx_polarity_flip_physical{130.0}=0x1 +phy_chain_rx_polarity_flip_physical{131.0}=0x1 +phy_chain_rx_polarity_flip_physical{132.0}=0x0 +phy_chain_rx_polarity_flip_physical{133.0}=0x1 +phy_chain_rx_polarity_flip_physical{134.0}=0x1 +phy_chain_rx_polarity_flip_physical{135.0}=0x1 +phy_chain_rx_polarity_flip_physical{136.0}=0x0 +phy_chain_rx_polarity_flip_physical{137.0}=0x0 +phy_chain_rx_polarity_flip_physical{138.0}=0x0 +phy_chain_rx_polarity_flip_physical{139.0}=0x1 +phy_chain_rx_polarity_flip_physical{14.0}=0x0 +phy_chain_rx_polarity_flip_physical{140.0}=0x0 +phy_chain_rx_polarity_flip_physical{141.0}=0x1 +phy_chain_rx_polarity_flip_physical{142.0}=0x0 +phy_chain_rx_polarity_flip_physical{143.0}=0x1 +phy_chain_rx_polarity_flip_physical{144.0}=0x0 +phy_chain_rx_polarity_flip_physical{145.0}=0x1 +phy_chain_rx_polarity_flip_physical{146.0}=0x0 +phy_chain_rx_polarity_flip_physical{147.0}=0x1 +phy_chain_rx_polarity_flip_physical{148.0}=0x0 +phy_chain_rx_polarity_flip_physical{149.0}=0x0 +phy_chain_rx_polarity_flip_physical{15.0}=0x1 +phy_chain_rx_polarity_flip_physical{150.0}=0x1 +phy_chain_rx_polarity_flip_physical{151.0}=0x1 +phy_chain_rx_polarity_flip_physical{152.0}=0x0 +phy_chain_rx_polarity_flip_physical{153.0}=0x0 +phy_chain_rx_polarity_flip_physical{154.0}=0x1 +phy_chain_rx_polarity_flip_physical{155.0}=0x1 +phy_chain_rx_polarity_flip_physical{156.0}=0x0 +phy_chain_rx_polarity_flip_physical{157.0}=0x0 +phy_chain_rx_polarity_flip_physical{158.0}=0x0 +phy_chain_rx_polarity_flip_physical{159.0}=0x1 +phy_chain_rx_polarity_flip_physical{16.0}=0x0 +phy_chain_rx_polarity_flip_physical{160.0}=0x0 +phy_chain_rx_polarity_flip_physical{161.0}=0x1 +phy_chain_rx_polarity_flip_physical{162.0}=0x1 +phy_chain_rx_polarity_flip_physical{163.0}=0x0 +phy_chain_rx_polarity_flip_physical{164.0}=0x1 +phy_chain_rx_polarity_flip_physical{165.0}=0x0 +phy_chain_rx_polarity_flip_physical{166.0}=0x0 +phy_chain_rx_polarity_flip_physical{167.0}=0x1 +phy_chain_rx_polarity_flip_physical{168.0}=0x1 +phy_chain_rx_polarity_flip_physical{169.0}=0x1 +phy_chain_rx_polarity_flip_physical{17.0}=0x1 +phy_chain_rx_polarity_flip_physical{170.0}=0x1 +phy_chain_rx_polarity_flip_physical{171.0}=0x0 +phy_chain_rx_polarity_flip_physical{172.0}=0x0 +phy_chain_rx_polarity_flip_physical{173.0}=0x0 +phy_chain_rx_polarity_flip_physical{174.0}=0x0 +phy_chain_rx_polarity_flip_physical{175.0}=0x1 +phy_chain_rx_polarity_flip_physical{176.0}=0x1 +phy_chain_rx_polarity_flip_physical{177.0}=0x1 +phy_chain_rx_polarity_flip_physical{178.0}=0x1 +phy_chain_rx_polarity_flip_physical{179.0}=0x0 +phy_chain_rx_polarity_flip_physical{18.0}=0x0 +phy_chain_rx_polarity_flip_physical{180.0}=0x0 +phy_chain_rx_polarity_flip_physical{181.0}=0x1 +phy_chain_rx_polarity_flip_physical{182.0}=0x1 +phy_chain_rx_polarity_flip_physical{183.0}=0x0 +phy_chain_rx_polarity_flip_physical{184.0}=0x0 +phy_chain_rx_polarity_flip_physical{185.0}=0x0 +phy_chain_rx_polarity_flip_physical{186.0}=0x0 +phy_chain_rx_polarity_flip_physical{187.0}=0x1 +phy_chain_rx_polarity_flip_physical{188.0}=0x1 +phy_chain_rx_polarity_flip_physical{189.0}=0x0 +phy_chain_rx_polarity_flip_physical{19.0}=0x1 +phy_chain_rx_polarity_flip_physical{190.0}=0x0 +phy_chain_rx_polarity_flip_physical{191.0}=0x1 +phy_chain_rx_polarity_flip_physical{192.0}=0x0 +phy_chain_rx_polarity_flip_physical{193.0}=0x0 +phy_chain_rx_polarity_flip_physical{194.0}=0x0 +phy_chain_rx_polarity_flip_physical{195.0}=0x1 +phy_chain_rx_polarity_flip_physical{196.0}=0x1 +phy_chain_rx_polarity_flip_physical{197.0}=0x1 +phy_chain_rx_polarity_flip_physical{198.0}=0x1 +phy_chain_rx_polarity_flip_physical{199.0}=0x0 +phy_chain_rx_polarity_flip_physical{2.0}=0x0 +phy_chain_rx_polarity_flip_physical{20.0}=0x0 +phy_chain_rx_polarity_flip_physical{200.0}=0x0 +phy_chain_rx_polarity_flip_physical{201.0}=0x0 +phy_chain_rx_polarity_flip_physical{202.0}=0x0 +phy_chain_rx_polarity_flip_physical{203.0}=0x1 +phy_chain_rx_polarity_flip_physical{204.0}=0x0 +phy_chain_rx_polarity_flip_physical{205.0}=0x1 +phy_chain_rx_polarity_flip_physical{206.0}=0x1 +phy_chain_rx_polarity_flip_physical{207.0}=0x0 +phy_chain_rx_polarity_flip_physical{208.0}=0x0 +phy_chain_rx_polarity_flip_physical{209.0}=0x1 +phy_chain_rx_polarity_flip_physical{21.0}=0x0 +phy_chain_rx_polarity_flip_physical{210.0}=0x1 +phy_chain_rx_polarity_flip_physical{211.0}=0x0 +phy_chain_rx_polarity_flip_physical{212.0}=0x0 +phy_chain_rx_polarity_flip_physical{213.0}=0x0 +phy_chain_rx_polarity_flip_physical{214.0}=0x0 +phy_chain_rx_polarity_flip_physical{215.0}=0x1 +phy_chain_rx_polarity_flip_physical{216.0}=0x0 +phy_chain_rx_polarity_flip_physical{217.0}=0x0 +phy_chain_rx_polarity_flip_physical{218.0}=0x0 +phy_chain_rx_polarity_flip_physical{219.0}=0x1 +phy_chain_rx_polarity_flip_physical{22.0}=0x0 +phy_chain_rx_polarity_flip_physical{220.0}=0x1 +phy_chain_rx_polarity_flip_physical{221.0}=0x0 +phy_chain_rx_polarity_flip_physical{222.0}=0x0 +phy_chain_rx_polarity_flip_physical{223.0}=0x1 +phy_chain_rx_polarity_flip_physical{224.0}=0x1 +phy_chain_rx_polarity_flip_physical{225.0}=0x1 +phy_chain_rx_polarity_flip_physical{226.0}=0x0 +phy_chain_rx_polarity_flip_physical{227.0}=0x0 +phy_chain_rx_polarity_flip_physical{228.0}=0x1 +phy_chain_rx_polarity_flip_physical{229.0}=0x0 +phy_chain_rx_polarity_flip_physical{23.0}=0x1 +phy_chain_rx_polarity_flip_physical{230.0}=0x0 +phy_chain_rx_polarity_flip_physical{231.0}=0x1 +phy_chain_rx_polarity_flip_physical{232.0}=0x1 +phy_chain_rx_polarity_flip_physical{233.0}=0x1 +phy_chain_rx_polarity_flip_physical{234.0}=0x0 +phy_chain_rx_polarity_flip_physical{235.0}=0x0 +phy_chain_rx_polarity_flip_physical{236.0}=0x0 +phy_chain_rx_polarity_flip_physical{237.0}=0x1 +phy_chain_rx_polarity_flip_physical{238.0}=0x0 +phy_chain_rx_polarity_flip_physical{239.0}=0x1 +phy_chain_rx_polarity_flip_physical{24.0}=0x0 +phy_chain_rx_polarity_flip_physical{240.0}=0x0 +phy_chain_rx_polarity_flip_physical{241.0}=0x1 +phy_chain_rx_polarity_flip_physical{242.0}=0x0 +phy_chain_rx_polarity_flip_physical{243.0}=0x1 +phy_chain_rx_polarity_flip_physical{244.0}=0x0 +phy_chain_rx_polarity_flip_physical{245.0}=0x1 +phy_chain_rx_polarity_flip_physical{246.0}=0x1 +phy_chain_rx_polarity_flip_physical{247.0}=0x1 +phy_chain_rx_polarity_flip_physical{248.0}=0x0 +phy_chain_rx_polarity_flip_physical{249.0}=0x0 +phy_chain_rx_polarity_flip_physical{25.0}=0x1 +phy_chain_rx_polarity_flip_physical{250.0}=0x1 +phy_chain_rx_polarity_flip_physical{251.0}=0x0 +phy_chain_rx_polarity_flip_physical{252.0}=0x1 +phy_chain_rx_polarity_flip_physical{253.0}=0x1 +phy_chain_rx_polarity_flip_physical{254.0}=0x0 +phy_chain_rx_polarity_flip_physical{255.0}=0x1 +phy_chain_rx_polarity_flip_physical{256.0}=0x0 +phy_chain_rx_polarity_flip_physical{257.0}=0x0 +phy_chain_rx_polarity_flip_physical{259.0}=0x0 +phy_chain_rx_polarity_flip_physical{26.0}=0x0 +phy_chain_rx_polarity_flip_physical{27.0}=0x1 +phy_chain_rx_polarity_flip_physical{28.0}=0x0 +phy_chain_rx_polarity_flip_physical{29.0}=0x0 +phy_chain_rx_polarity_flip_physical{3.0}=0x1 +phy_chain_rx_polarity_flip_physical{30.0}=0x0 +phy_chain_rx_polarity_flip_physical{31.0}=0x0 +phy_chain_rx_polarity_flip_physical{32.0}=0x1 +phy_chain_rx_polarity_flip_physical{33.0}=0x0 +phy_chain_rx_polarity_flip_physical{34.0}=0x0 +phy_chain_rx_polarity_flip_physical{35.0}=0x1 +phy_chain_rx_polarity_flip_physical{36.0}=0x1 +phy_chain_rx_polarity_flip_physical{37.0}=0x1 +phy_chain_rx_polarity_flip_physical{38.0}=0x1 +phy_chain_rx_polarity_flip_physical{39.0}=0x0 +phy_chain_rx_polarity_flip_physical{4.0}=0x0 +phy_chain_rx_polarity_flip_physical{40.0}=0x0 +phy_chain_rx_polarity_flip_physical{41.0}=0x0 +phy_chain_rx_polarity_flip_physical{42.0}=0x1 +phy_chain_rx_polarity_flip_physical{43.0}=0x1 +phy_chain_rx_polarity_flip_physical{44.0}=0x1 +phy_chain_rx_polarity_flip_physical{45.0}=0x1 +phy_chain_rx_polarity_flip_physical{46.0}=0x0 +phy_chain_rx_polarity_flip_physical{47.0}=0x0 +phy_chain_rx_polarity_flip_physical{48.0}=0x1 +phy_chain_rx_polarity_flip_physical{49.0}=0x1 +phy_chain_rx_polarity_flip_physical{5.0}=0x1 +phy_chain_rx_polarity_flip_physical{50.0}=0x1 +phy_chain_rx_polarity_flip_physical{51.0}=0x0 +phy_chain_rx_polarity_flip_physical{52.0}=0x0 +phy_chain_rx_polarity_flip_physical{53.0}=0x0 +phy_chain_rx_polarity_flip_physical{54.0}=0x0 +phy_chain_rx_polarity_flip_physical{55.0}=0x1 +phy_chain_rx_polarity_flip_physical{56.0}=0x0 +phy_chain_rx_polarity_flip_physical{57.0}=0x0 +phy_chain_rx_polarity_flip_physical{58.0}=0x0 +phy_chain_rx_polarity_flip_physical{59.0}=0x1 +phy_chain_rx_polarity_flip_physical{6.0}=0x0 +phy_chain_rx_polarity_flip_physical{60.0}=0x1 +phy_chain_rx_polarity_flip_physical{61.0}=0x0 +phy_chain_rx_polarity_flip_physical{62.0}=0x0 +phy_chain_rx_polarity_flip_physical{63.0}=0x1 +phy_chain_rx_polarity_flip_physical{64.0}=0x1 +phy_chain_rx_polarity_flip_physical{65.0}=0x1 +phy_chain_rx_polarity_flip_physical{66.0}=0x1 +phy_chain_rx_polarity_flip_physical{67.0}=0x0 +phy_chain_rx_polarity_flip_physical{68.0}=0x1 +phy_chain_rx_polarity_flip_physical{69.0}=0x0 +phy_chain_rx_polarity_flip_physical{7.0}=0x0 +phy_chain_rx_polarity_flip_physical{70.0}=0x0 +phy_chain_rx_polarity_flip_physical{71.0}=0x1 +phy_chain_rx_polarity_flip_physical{72.0}=0x1 +phy_chain_rx_polarity_flip_physical{73.0}=0x1 +phy_chain_rx_polarity_flip_physical{74.0}=0x1 +phy_chain_rx_polarity_flip_physical{75.0}=0x0 +phy_chain_rx_polarity_flip_physical{76.0}=0x0 +phy_chain_rx_polarity_flip_physical{77.0}=0x0 +phy_chain_rx_polarity_flip_physical{78.0}=0x0 +phy_chain_rx_polarity_flip_physical{79.0}=0x1 +phy_chain_rx_polarity_flip_physical{8.0}=0x1 +phy_chain_rx_polarity_flip_physical{80.0}=0x1 +phy_chain_rx_polarity_flip_physical{81.0}=0x1 +phy_chain_rx_polarity_flip_physical{82.0}=0x1 +phy_chain_rx_polarity_flip_physical{83.0}=0x0 +phy_chain_rx_polarity_flip_physical{84.0}=0x0 +phy_chain_rx_polarity_flip_physical{85.0}=0x1 +phy_chain_rx_polarity_flip_physical{86.0}=0x1 +phy_chain_rx_polarity_flip_physical{87.0}=0x0 +phy_chain_rx_polarity_flip_physical{88.0}=0x0 +phy_chain_rx_polarity_flip_physical{89.0}=0x0 +phy_chain_rx_polarity_flip_physical{9.0}=0x1 +phy_chain_rx_polarity_flip_physical{90.0}=0x0 +phy_chain_rx_polarity_flip_physical{91.0}=0x1 +phy_chain_rx_polarity_flip_physical{92.0}=0x1 +phy_chain_rx_polarity_flip_physical{93.0}=0x0 +phy_chain_rx_polarity_flip_physical{94.0}=0x0 +phy_chain_rx_polarity_flip_physical{95.0}=0x1 +phy_chain_rx_polarity_flip_physical{96.0}=0x0 +phy_chain_rx_polarity_flip_physical{97.0}=0x1 +phy_chain_rx_polarity_flip_physical{98.0}=0x1 +phy_chain_rx_polarity_flip_physical{99.0}=0x0 +phy_chain_tx_lane_map_physical{1.0}=0x2031 +phy_chain_tx_lane_map_physical{101.0}=0x1023 +phy_chain_tx_lane_map_physical{105.0}=0x1302 +phy_chain_tx_lane_map_physical{109.0}=0x0321 +phy_chain_tx_lane_map_physical{113.0}=0x2301 +phy_chain_tx_lane_map_physical{117.0}=0x3120 +phy_chain_tx_lane_map_physical{121.0}=0x3102 +phy_chain_tx_lane_map_physical{125.0}=0x3210 +phy_chain_tx_lane_map_physical{129.0}=0x1023 +phy_chain_tx_lane_map_physical{13.0}=0x3021 +phy_chain_tx_lane_map_physical{133.0}=0x3210 +phy_chain_tx_lane_map_physical{137.0}=0x2031 +phy_chain_tx_lane_map_physical{141.0}=0x1302 +phy_chain_tx_lane_map_physical{145.0}=0x3210 +phy_chain_tx_lane_map_physical{149.0}=0x0213 +phy_chain_tx_lane_map_physical{153.0}=0x3210 +phy_chain_tx_lane_map_physical{157.0}=0x1320 +phy_chain_tx_lane_map_physical{161.0}=0x3210 +phy_chain_tx_lane_map_physical{165.0}=0x0231 +phy_chain_tx_lane_map_physical{169.0}=0x3120 +phy_chain_tx_lane_map_physical{17.0}=0x1032 +phy_chain_tx_lane_map_physical{173.0}=0x0312 +phy_chain_tx_lane_map_physical{177.0}=0x0231 +phy_chain_tx_lane_map_physical{181.0}=0x3210 +phy_chain_tx_lane_map_physical{185.0}=0x3210 +phy_chain_tx_lane_map_physical{189.0}=0x1320 +phy_chain_tx_lane_map_physical{193.0}=0x0321 +phy_chain_tx_lane_map_physical{197.0}=0x3120 +phy_chain_tx_lane_map_physical{201.0}=0x3120 +phy_chain_tx_lane_map_physical{205.0}=0x0123 +phy_chain_tx_lane_map_physical{209.0}=0x3120 +phy_chain_tx_lane_map_physical{21.0}=0x0213 +phy_chain_tx_lane_map_physical{213.0}=0x3021 +phy_chain_tx_lane_map_physical{217.0}=0x0312 +phy_chain_tx_lane_map_physical{221.0}=0x2301 +phy_chain_tx_lane_map_physical{225.0}=0x0123 +phy_chain_tx_lane_map_physical{229.0}=0x2031 +phy_chain_tx_lane_map_physical{233.0}=0x0231 +phy_chain_tx_lane_map_physical{237.0}=0x0213 +phy_chain_tx_lane_map_physical{241.0}=0x1320 +phy_chain_tx_lane_map_physical{245.0}=0x2031 +phy_chain_tx_lane_map_physical{249.0}=0x3120 +phy_chain_tx_lane_map_physical{25.0}=0x0231 +phy_chain_tx_lane_map_physical{253.0}=0x0321 +phy_chain_tx_lane_map_physical{257.0}=0x3210 +phy_chain_tx_lane_map_physical{29.0}=0x1230 +phy_chain_tx_lane_map_physical{33.0}=0x1032 +phy_chain_tx_lane_map_physical{37.0}=0x0123 +phy_chain_tx_lane_map_physical{41.0}=0x0213 +phy_chain_tx_lane_map_physical{45.0}=0x0132 +phy_chain_tx_lane_map_physical{49.0}=0x2031 +phy_chain_tx_lane_map_physical{5.0}=0x2301 +phy_chain_tx_lane_map_physical{53.0}=0x2301 +phy_chain_tx_lane_map_physical{57.0}=0x2031 +phy_chain_tx_lane_map_physical{61.0}=0x2031 +phy_chain_tx_lane_map_physical{65.0}=0x1230 +phy_chain_tx_lane_map_physical{69.0}=0x2013 +phy_chain_tx_lane_map_physical{73.0}=0x0213 +phy_chain_tx_lane_map_physical{77.0}=0x2310 +phy_chain_tx_lane_map_physical{81.0}=0x0321 +phy_chain_tx_lane_map_physical{85.0}=0x2013 +phy_chain_tx_lane_map_physical{89.0}=0x0213 +phy_chain_tx_lane_map_physical{9.0}=0x3012 +phy_chain_tx_lane_map_physical{93.0}=0x3102 +phy_chain_tx_lane_map_physical{97.0}=0x3210 +phy_chain_tx_polarity_flip_physical{1.0}=0x0 +phy_chain_tx_polarity_flip_physical{10.0}=0x1 +phy_chain_tx_polarity_flip_physical{100.0}=0x0 +phy_chain_tx_polarity_flip_physical{101.0}=0x0 +phy_chain_tx_polarity_flip_physical{102.0}=0x1 +phy_chain_tx_polarity_flip_physical{103.0}=0x0 +phy_chain_tx_polarity_flip_physical{104.0}=0x0 +phy_chain_tx_polarity_flip_physical{105.0}=0x0 +phy_chain_tx_polarity_flip_physical{106.0}=0x1 +phy_chain_tx_polarity_flip_physical{107.0}=0x1 +phy_chain_tx_polarity_flip_physical{108.0}=0x1 +phy_chain_tx_polarity_flip_physical{109.0}=0x0 +phy_chain_tx_polarity_flip_physical{11.0}=0x1 +phy_chain_tx_polarity_flip_physical{110.0}=0x0 +phy_chain_tx_polarity_flip_physical{111.0}=0x0 +phy_chain_tx_polarity_flip_physical{112.0}=0x1 +phy_chain_tx_polarity_flip_physical{113.0}=0x1 +phy_chain_tx_polarity_flip_physical{114.0}=0x1 +phy_chain_tx_polarity_flip_physical{115.0}=0x1 +phy_chain_tx_polarity_flip_physical{116.0}=0x0 +phy_chain_tx_polarity_flip_physical{117.0}=0x1 +phy_chain_tx_polarity_flip_physical{118.0}=0x0 +phy_chain_tx_polarity_flip_physical{119.0}=0x0 +phy_chain_tx_polarity_flip_physical{12.0}=0x0 +phy_chain_tx_polarity_flip_physical{120.0}=0x0 +phy_chain_tx_polarity_flip_physical{121.0}=0x0 +phy_chain_tx_polarity_flip_physical{122.0}=0x0 +phy_chain_tx_polarity_flip_physical{123.0}=0x0 +phy_chain_tx_polarity_flip_physical{124.0}=0x1 +phy_chain_tx_polarity_flip_physical{125.0}=0x0 +phy_chain_tx_polarity_flip_physical{126.0}=0x1 +phy_chain_tx_polarity_flip_physical{127.0}=0x1 +phy_chain_tx_polarity_flip_physical{128.0}=0x1 +phy_chain_tx_polarity_flip_physical{129.0}=0x1 +phy_chain_tx_polarity_flip_physical{13.0}=0x0 +phy_chain_tx_polarity_flip_physical{130.0}=0x0 +phy_chain_tx_polarity_flip_physical{131.0}=0x1 +phy_chain_tx_polarity_flip_physical{132.0}=0x0 +phy_chain_tx_polarity_flip_physical{133.0}=0x1 +phy_chain_tx_polarity_flip_physical{134.0}=0x1 +phy_chain_tx_polarity_flip_physical{135.0}=0x1 +phy_chain_tx_polarity_flip_physical{136.0}=0x1 +phy_chain_tx_polarity_flip_physical{137.0}=0x1 +phy_chain_tx_polarity_flip_physical{138.0}=0x1 +phy_chain_tx_polarity_flip_physical{139.0}=0x1 +phy_chain_tx_polarity_flip_physical{14.0}=0x1 +phy_chain_tx_polarity_flip_physical{140.0}=0x1 +phy_chain_tx_polarity_flip_physical{141.0}=0x0 +phy_chain_tx_polarity_flip_physical{142.0}=0x1 +phy_chain_tx_polarity_flip_physical{143.0}=0x1 +phy_chain_tx_polarity_flip_physical{144.0}=0x1 +phy_chain_tx_polarity_flip_physical{145.0}=0x1 +phy_chain_tx_polarity_flip_physical{146.0}=0x1 +phy_chain_tx_polarity_flip_physical{147.0}=0x1 +phy_chain_tx_polarity_flip_physical{148.0}=0x0 +phy_chain_tx_polarity_flip_physical{149.0}=0x1 +phy_chain_tx_polarity_flip_physical{15.0}=0x0 +phy_chain_tx_polarity_flip_physical{150.0}=0x0 +phy_chain_tx_polarity_flip_physical{151.0}=0x0 +phy_chain_tx_polarity_flip_physical{152.0}=0x0 +phy_chain_tx_polarity_flip_physical{153.0}=0x1 +phy_chain_tx_polarity_flip_physical{154.0}=0x0 +phy_chain_tx_polarity_flip_physical{155.0}=0x0 +phy_chain_tx_polarity_flip_physical{156.0}=0x0 +phy_chain_tx_polarity_flip_physical{157.0}=0x0 +phy_chain_tx_polarity_flip_physical{158.0}=0x0 +phy_chain_tx_polarity_flip_physical{159.0}=0x0 +phy_chain_tx_polarity_flip_physical{16.0}=0x0 +phy_chain_tx_polarity_flip_physical{160.0}=0x0 +phy_chain_tx_polarity_flip_physical{161.0}=0x0 +phy_chain_tx_polarity_flip_physical{162.0}=0x1 +phy_chain_tx_polarity_flip_physical{163.0}=0x1 +phy_chain_tx_polarity_flip_physical{164.0}=0x0 +phy_chain_tx_polarity_flip_physical{165.0}=0x1 +phy_chain_tx_polarity_flip_physical{166.0}=0x1 +phy_chain_tx_polarity_flip_physical{167.0}=0x1 +phy_chain_tx_polarity_flip_physical{168.0}=0x0 +phy_chain_tx_polarity_flip_physical{169.0}=0x0 +phy_chain_tx_polarity_flip_physical{17.0}=0x0 +phy_chain_tx_polarity_flip_physical{170.0}=0x1 +phy_chain_tx_polarity_flip_physical{171.0}=0x1 +phy_chain_tx_polarity_flip_physical{172.0}=0x1 +phy_chain_tx_polarity_flip_physical{173.0}=0x0 +phy_chain_tx_polarity_flip_physical{174.0}=0x0 +phy_chain_tx_polarity_flip_physical{175.0}=0x1 +phy_chain_tx_polarity_flip_physical{176.0}=0x0 +phy_chain_tx_polarity_flip_physical{177.0}=0x1 +phy_chain_tx_polarity_flip_physical{178.0}=0x0 +phy_chain_tx_polarity_flip_physical{179.0}=0x0 +phy_chain_tx_polarity_flip_physical{18.0}=0x1 +phy_chain_tx_polarity_flip_physical{180.0}=0x0 +phy_chain_tx_polarity_flip_physical{181.0}=0x0 +phy_chain_tx_polarity_flip_physical{182.0}=0x0 +phy_chain_tx_polarity_flip_physical{183.0}=0x0 +phy_chain_tx_polarity_flip_physical{184.0}=0x1 +phy_chain_tx_polarity_flip_physical{185.0}=0x0 +phy_chain_tx_polarity_flip_physical{186.0}=0x1 +phy_chain_tx_polarity_flip_physical{187.0}=0x1 +phy_chain_tx_polarity_flip_physical{188.0}=0x1 +phy_chain_tx_polarity_flip_physical{189.0}=0x0 +phy_chain_tx_polarity_flip_physical{19.0}=0x1 +phy_chain_tx_polarity_flip_physical{190.0}=0x0 +phy_chain_tx_polarity_flip_physical{191.0}=0x0 +phy_chain_tx_polarity_flip_physical{192.0}=0x0 +phy_chain_tx_polarity_flip_physical{193.0}=0x1 +phy_chain_tx_polarity_flip_physical{194.0}=0x1 +phy_chain_tx_polarity_flip_physical{195.0}=0x1 +phy_chain_tx_polarity_flip_physical{196.0}=0x0 +phy_chain_tx_polarity_flip_physical{197.0}=0x0 +phy_chain_tx_polarity_flip_physical{198.0}=0x1 +phy_chain_tx_polarity_flip_physical{199.0}=0x1 +phy_chain_tx_polarity_flip_physical{2.0}=0x1 +phy_chain_tx_polarity_flip_physical{20.0}=0x1 +phy_chain_tx_polarity_flip_physical{200.0}=0x1 +phy_chain_tx_polarity_flip_physical{201.0}=0x1 +phy_chain_tx_polarity_flip_physical{202.0}=0x1 +phy_chain_tx_polarity_flip_physical{203.0}=0x1 +phy_chain_tx_polarity_flip_physical{204.0}=0x1 +phy_chain_tx_polarity_flip_physical{205.0}=0x0 +phy_chain_tx_polarity_flip_physical{206.0}=0x1 +phy_chain_tx_polarity_flip_physical{207.0}=0x1 +phy_chain_tx_polarity_flip_physical{208.0}=0x1 +phy_chain_tx_polarity_flip_physical{209.0}=0x1 +phy_chain_tx_polarity_flip_physical{21.0}=0x0 +phy_chain_tx_polarity_flip_physical{210.0}=0x1 +phy_chain_tx_polarity_flip_physical{211.0}=0x1 +phy_chain_tx_polarity_flip_physical{212.0}=0x0 +phy_chain_tx_polarity_flip_physical{213.0}=0x0 +phy_chain_tx_polarity_flip_physical{214.0}=0x1 +phy_chain_tx_polarity_flip_physical{215.0}=0x0 +phy_chain_tx_polarity_flip_physical{216.0}=0x1 +phy_chain_tx_polarity_flip_physical{217.0}=0x1 +phy_chain_tx_polarity_flip_physical{218.0}=0x1 +phy_chain_tx_polarity_flip_physical{219.0}=0x0 +phy_chain_tx_polarity_flip_physical{22.0}=0x0 +phy_chain_tx_polarity_flip_physical{220.0}=0x1 +phy_chain_tx_polarity_flip_physical{221.0}=0x0 +phy_chain_tx_polarity_flip_physical{222.0}=0x0 +phy_chain_tx_polarity_flip_physical{223.0}=0x0 +phy_chain_tx_polarity_flip_physical{224.0}=0x1 +phy_chain_tx_polarity_flip_physical{225.0}=0x1 +phy_chain_tx_polarity_flip_physical{226.0}=0x1 +phy_chain_tx_polarity_flip_physical{227.0}=0x1 +phy_chain_tx_polarity_flip_physical{228.0}=0x0 +phy_chain_tx_polarity_flip_physical{229.0}=0x0 +phy_chain_tx_polarity_flip_physical{23.0}=0x0 +phy_chain_tx_polarity_flip_physical{230.0}=0x1 +phy_chain_tx_polarity_flip_physical{231.0}=0x1 +phy_chain_tx_polarity_flip_physical{232.0}=0x1 +phy_chain_tx_polarity_flip_physical{233.0}=0x0 +phy_chain_tx_polarity_flip_physical{234.0}=0x0 +phy_chain_tx_polarity_flip_physical{235.0}=0x0 +phy_chain_tx_polarity_flip_physical{236.0}=0x0 +phy_chain_tx_polarity_flip_physical{237.0}=0x1 +phy_chain_tx_polarity_flip_physical{238.0}=0x1 +phy_chain_tx_polarity_flip_physical{239.0}=0x1 +phy_chain_tx_polarity_flip_physical{24.0}=0x0 +phy_chain_tx_polarity_flip_physical{240.0}=0x0 +phy_chain_tx_polarity_flip_physical{241.0}=0x1 +phy_chain_tx_polarity_flip_physical{242.0}=0x1 +phy_chain_tx_polarity_flip_physical{243.0}=0x1 +phy_chain_tx_polarity_flip_physical{244.0}=0x0 +phy_chain_tx_polarity_flip_physical{245.0}=0x1 +phy_chain_tx_polarity_flip_physical{246.0}=0x1 +phy_chain_tx_polarity_flip_physical{247.0}=0x1 +phy_chain_tx_polarity_flip_physical{248.0}=0x1 +phy_chain_tx_polarity_flip_physical{249.0}=0x1 +phy_chain_tx_polarity_flip_physical{25.0}=0x1 +phy_chain_tx_polarity_flip_physical{250.0}=0x0 +phy_chain_tx_polarity_flip_physical{251.0}=0x0 +phy_chain_tx_polarity_flip_physical{252.0}=0x0 +phy_chain_tx_polarity_flip_physical{253.0}=0x1 +phy_chain_tx_polarity_flip_physical{254.0}=0x1 +phy_chain_tx_polarity_flip_physical{255.0}=0x1 +phy_chain_tx_polarity_flip_physical{256.0}=0x0 +phy_chain_tx_polarity_flip_physical{257.0}=0x0 +phy_chain_tx_polarity_flip_physical{259.0}=0x0 +phy_chain_tx_polarity_flip_physical{26.0}=0x0 +phy_chain_tx_polarity_flip_physical{27.0}=0x0 +phy_chain_tx_polarity_flip_physical{28.0}=0x0 +phy_chain_tx_polarity_flip_physical{29.0}=0x1 +phy_chain_tx_polarity_flip_physical{3.0}=0x1 +phy_chain_tx_polarity_flip_physical{30.0}=0x1 +phy_chain_tx_polarity_flip_physical{31.0}=0x1 +phy_chain_tx_polarity_flip_physical{32.0}=0x0 +phy_chain_tx_polarity_flip_physical{33.0}=0x0 +phy_chain_tx_polarity_flip_physical{34.0}=0x0 +phy_chain_tx_polarity_flip_physical{35.0}=0x0 +phy_chain_tx_polarity_flip_physical{36.0}=0x1 +phy_chain_tx_polarity_flip_physical{37.0}=0x1 +phy_chain_tx_polarity_flip_physical{38.0}=0x1 +phy_chain_tx_polarity_flip_physical{39.0}=0x1 +phy_chain_tx_polarity_flip_physical{4.0}=0x1 +phy_chain_tx_polarity_flip_physical{40.0}=0x0 +phy_chain_tx_polarity_flip_physical{41.0}=0x0 +phy_chain_tx_polarity_flip_physical{42.0}=0x0 +phy_chain_tx_polarity_flip_physical{43.0}=0x0 +phy_chain_tx_polarity_flip_physical{44.0}=0x0 +phy_chain_tx_polarity_flip_physical{45.0}=0x1 +phy_chain_tx_polarity_flip_physical{46.0}=0x0 +phy_chain_tx_polarity_flip_physical{47.0}=0x1 +phy_chain_tx_polarity_flip_physical{48.0}=0x1 +phy_chain_tx_polarity_flip_physical{49.0}=0x0 +phy_chain_tx_polarity_flip_physical{5.0}=0x1 +phy_chain_tx_polarity_flip_physical{50.0}=0x0 +phy_chain_tx_polarity_flip_physical{51.0}=0x0 +phy_chain_tx_polarity_flip_physical{52.0}=0x1 +phy_chain_tx_polarity_flip_physical{53.0}=0x0 +phy_chain_tx_polarity_flip_physical{54.0}=0x1 +phy_chain_tx_polarity_flip_physical{55.0}=0x1 +phy_chain_tx_polarity_flip_physical{56.0}=0x0 +phy_chain_tx_polarity_flip_physical{57.0}=0x0 +phy_chain_tx_polarity_flip_physical{58.0}=0x1 +phy_chain_tx_polarity_flip_physical{59.0}=0x1 +phy_chain_tx_polarity_flip_physical{6.0}=0x1 +phy_chain_tx_polarity_flip_physical{60.0}=0x1 +phy_chain_tx_polarity_flip_physical{61.0}=0x0 +phy_chain_tx_polarity_flip_physical{62.0}=0x1 +phy_chain_tx_polarity_flip_physical{63.0}=0x1 +phy_chain_tx_polarity_flip_physical{64.0}=0x1 +phy_chain_tx_polarity_flip_physical{65.0}=0x0 +phy_chain_tx_polarity_flip_physical{66.0}=0x1 +phy_chain_tx_polarity_flip_physical{67.0}=0x1 +phy_chain_tx_polarity_flip_physical{68.0}=0x0 +phy_chain_tx_polarity_flip_physical{69.0}=0x1 +phy_chain_tx_polarity_flip_physical{7.0}=0x1 +phy_chain_tx_polarity_flip_physical{70.0}=0x1 +phy_chain_tx_polarity_flip_physical{71.0}=0x1 +phy_chain_tx_polarity_flip_physical{72.0}=0x0 +phy_chain_tx_polarity_flip_physical{73.0}=0x1 +phy_chain_tx_polarity_flip_physical{74.0}=0x0 +phy_chain_tx_polarity_flip_physical{75.0}=0x0 +phy_chain_tx_polarity_flip_physical{76.0}=0x0 +phy_chain_tx_polarity_flip_physical{77.0}=0x0 +phy_chain_tx_polarity_flip_physical{78.0}=0x0 +phy_chain_tx_polarity_flip_physical{79.0}=0x1 +phy_chain_tx_polarity_flip_physical{8.0}=0x0 +phy_chain_tx_polarity_flip_physical{80.0}=0x0 +phy_chain_tx_polarity_flip_physical{81.0}=0x1 +phy_chain_tx_polarity_flip_physical{82.0}=0x1 +phy_chain_tx_polarity_flip_physical{83.0}=0x1 +phy_chain_tx_polarity_flip_physical{84.0}=0x0 +phy_chain_tx_polarity_flip_physical{85.0}=0x1 +phy_chain_tx_polarity_flip_physical{86.0}=0x0 +phy_chain_tx_polarity_flip_physical{87.0}=0x0 +phy_chain_tx_polarity_flip_physical{88.0}=0x0 +phy_chain_tx_polarity_flip_physical{89.0}=0x1 +phy_chain_tx_polarity_flip_physical{9.0}=0x0 +phy_chain_tx_polarity_flip_physical{90.0}=0x1 +phy_chain_tx_polarity_flip_physical{91.0}=0x1 +phy_chain_tx_polarity_flip_physical{92.0}=0x0 +phy_chain_tx_polarity_flip_physical{93.0}=0x0 +phy_chain_tx_polarity_flip_physical{94.0}=0x0 +phy_chain_tx_polarity_flip_physical{95.0}=0x0 +phy_chain_tx_polarity_flip_physical{96.0}=0x0 +phy_chain_tx_polarity_flip_physical{97.0}=0x0 +phy_chain_tx_polarity_flip_physical{98.0}=0x1 +phy_chain_tx_polarity_flip_physical{99.0}=0x1 +port_init_autoneg_100=0 +port_init_autoneg_102=0 +port_init_autoneg_103=0 +port_init_autoneg_104=0 +port_init_autoneg_105=0 +port_init_autoneg_106=0 +port_init_autoneg_107=0 +port_init_autoneg_108=0 +port_init_autoneg_109=0 +port_init_autoneg_10=0 +port_init_autoneg_110=0 +port_init_autoneg_111=0 +port_init_autoneg_112=0 +port_init_autoneg_113=0 +port_init_autoneg_114=0 +port_init_autoneg_115=0 +port_init_autoneg_116=0 +port_init_autoneg_117=0 +port_init_autoneg_11=0 +port_init_autoneg_12=0 +port_init_autoneg_13=0 +port_init_autoneg_14=0 +port_init_autoneg_15=0 +port_init_autoneg_16=0 +port_init_autoneg_1=0 +port_init_autoneg_2=0 +port_init_autoneg_34=0 +port_init_autoneg_35=0 +port_init_autoneg_36=0 +port_init_autoneg_37=0 +port_init_autoneg_38=0 +port_init_autoneg_39=0 +port_init_autoneg_3=0 +port_init_autoneg_40=0 +port_init_autoneg_41=0 +port_init_autoneg_42=0 +port_init_autoneg_43=0 +port_init_autoneg_44=0 +port_init_autoneg_45=0 +port_init_autoneg_46=0 +port_init_autoneg_47=0 +port_init_autoneg_48=0 +port_init_autoneg_49=0 +port_init_autoneg_4=0 +port_init_autoneg_5=0 +port_init_autoneg_66=0 +port_init_autoneg_68=0 +port_init_autoneg_69=0 +port_init_autoneg_6=0 +port_init_autoneg_70=0 +port_init_autoneg_71=0 +port_init_autoneg_72=0 +port_init_autoneg_73=0 +port_init_autoneg_74=0 +port_init_autoneg_75=0 +port_init_autoneg_76=0 +port_init_autoneg_77=0 +port_init_autoneg_78=0 +port_init_autoneg_79=0 +port_init_autoneg_7=0 +port_init_autoneg_80=0 +port_init_autoneg_81=0 +port_init_autoneg_82=0 +port_init_autoneg_83=0 +port_init_autoneg_8=0 +port_init_autoneg_9=0 +port_init_cl72_hg=1 +port_phy_addr_100=0xff +port_phy_addr_102=0xff +port_phy_addr_103=0xff +port_phy_addr_104=0xff +port_phy_addr_105=0xff +port_phy_addr_106=0xff +port_phy_addr_107=0xff +port_phy_addr_108=0xff +port_phy_addr_109=0xff +port_phy_addr_10=0xff +port_phy_addr_110=0xff +port_phy_addr_111=0xff +port_phy_addr_112=0xff +port_phy_addr_113=0xff +port_phy_addr_114=0xff +port_phy_addr_115=0xff +port_phy_addr_116=0xff +port_phy_addr_117=0xff +port_phy_addr_11=0xff +port_phy_addr_12=0xff +port_phy_addr_13=0xff +port_phy_addr_14=0xff +port_phy_addr_15=0xff +port_phy_addr_16=0xff +port_phy_addr_1=0xff +port_phy_addr_2=0xff +port_phy_addr_34=0xff +port_phy_addr_35=0xff +port_phy_addr_36=0xff +port_phy_addr_37=0xff +port_phy_addr_38=0xff +port_phy_addr_39=0xff +port_phy_addr_3=0xff +port_phy_addr_40=0xff +port_phy_addr_41=0xff +port_phy_addr_42=0xff +port_phy_addr_43=0xff +port_phy_addr_44=0xff +port_phy_addr_45=0xff +port_phy_addr_46=0xff +port_phy_addr_47=0xff +port_phy_addr_48=0xff +port_phy_addr_49=0xff +port_phy_addr_4=0xff +port_phy_addr_5=0xff +port_phy_addr_66=0xff +port_phy_addr_68=0xff +port_phy_addr_69=0xff +port_phy_addr_6=0xff +port_phy_addr_70=0xff +port_phy_addr_71=0xff +port_phy_addr_72=0xff +port_phy_addr_73=0xff +port_phy_addr_74=0xff +port_phy_addr_75=0xff +port_phy_addr_76=0xff +port_phy_addr_77=0xff +port_phy_addr_78=0xff +port_phy_addr_79=0xff +port_phy_addr_7=0xff +port_phy_addr_80=0xff +port_phy_addr_81=0xff +port_phy_addr_82=0xff +port_phy_addr_83=0xff +port_phy_addr_8=0xff +port_phy_addr_9=0xff +portmap_100=259:10 +portmap_101=262:10 +portmap_102=217:100 +portmap_103=213:100 +portmap_104=229:100 +portmap_105=237:100 +portmap_106=249:100 +portmap_107=245:100 +portmap_108=209:100 +portmap_109=221:100 +portmap_10=29:100 +portmap_110=233:100 +portmap_111=225:100 +portmap_112=241:100 +portmap_113=253:100 +portmap_114=197:100 +portmap_115=205:100 +portmap_116=201:100 +portmap_117=193:100 +portmap_11=41:100 +portmap_12=33:100 +portmap_134=263:10 +portmap_13=57:100 +portmap_14=53:100 +portmap_15=49:100 +portmap_16=61:100 +portmap_1=5:100 +portmap_2=13:100 +portmap_33=260:10 +portmap_34=77:100 +portmap_35=65:100 +portmap_36=85:100 +portmap_37=89:100 +portmap_38=109:100 +portmap_39=97:100 +portmap_3=25:100 +portmap_40=69:100 +portmap_41=73:100 +portmap_42=93:100 +portmap_43=81:100 +portmap_44=101:100 +portmap_45=105:100 +portmap_46=117:100 +portmap_47=121:100 +portmap_48=125:100 +portmap_49=113:100 +portmap_4=21:100 +portmap_5=37:100 +portmap_66=257:10 +portmap_67=261:10 +portmap_68=149:100 +portmap_69=153:100 +portmap_6=45:100 +portmap_70=173:100 +portmap_71=161:100 +portmap_72=181:100 +portmap_73=185:100 +portmap_74=157:100 +portmap_75=145:100 +portmap_76=165:100 +portmap_77=169:100 +portmap_78=189:100 +portmap_79=177:100 +portmap_7=9:100 +portmap_80=141:100 +portmap_81=133:100 +portmap_82=129:100 +portmap_83=137:100 +portmap_8=1:100 +portmap_9=17:100 +robust_hash_disable_egress_vlan=1 +robust_hash_disable_mpls=1 +robust_hash_disable_vlan=1 +stable_size=0x5500000 +stable_size=0x5500000 +tdma_timeout_usec=15000000 +tslam_timeout_usec=15000000 + +# tuning parameters +serdes_preemphasis_1=0x184606 +serdes_preemphasis_2=0x164108 +serdes_preemphasis_3=0x164308 +serdes_preemphasis_4=0x144108 +serdes_preemphasis_5=0x144108 +serdes_preemphasis_6=0x164106 +serdes_preemphasis_7=0x184507 +serdes_preemphasis_8=0x184606 +serdes_preemphasis_9=0x184507 +serdes_preemphasis_10=0x194407 +serdes_preemphasis_11=0x194407 +serdes_preemphasis_12=0x184507 +serdes_preemphasis_13=0x144108 +serdes_preemphasis_14=0x144108 +serdes_preemphasis_15=0x194407 +serdes_preemphasis_16=0x194407 +serdes_preemphasis_34=0x184408 +serdes_preemphasis_35=0x184606 +serdes_preemphasis_36=0x164308 +serdes_preemphasis_37=0x184606 +serdes_preemphasis_38=0x164108 +serdes_preemphasis_39=0x184606 +serdes_preemphasis_40=0xe3206 +serdes_preemphasis_41=0xe3205 +serdes_preemphasis_42=0x103a06 +serdes_preemphasis_43=0xe3205 +serdes_preemphasis_44=0x184606 +serdes_preemphasis_45=0x184507 +serdes_preemphasis_46=0x144108 +serdes_preemphasis_47=0x103a07 +serdes_preemphasis_48=0x194407 +serdes_preemphasis_49=0x194407 +serdes_preemphasis_66=0x43004 +serdes_preemphasis_68=0x164308 +serdes_preemphasis_69=0x164408 +serdes_preemphasis_70=0xe3206 +serdes_preemphasis_71=0xe3205 +serdes_preemphasis_72=0xe3205 +serdes_preemphasis_73=0xe3206 +serdes_preemphasis_74=0x164108 +serdes_preemphasis_75=0x184606 +serdes_preemphasis_76=0x164608 +serdes_preemphasis_77=0x184507 +serdes_preemphasis_78=0x184507 +serdes_preemphasis_79=0x184606 +serdes_preemphasis_80=0x184606 +serdes_preemphasis_81=0x184407 +serdes_preemphasis_82=0x103706 +serdes_preemphasis_83=0x103706 +serdes_preemphasis_100=0x43004 +serdes_preemphasis_102=0x184408 +serdes_preemphasis_103=0x184606 +serdes_preemphasis_104=0x184606 +serdes_preemphasis_105=0x16410a +serdes_preemphasis_106=0x184408 +serdes_preemphasis_107=0x194308 +serdes_preemphasis_108=0x144108 +serdes_preemphasis_109=0x144108 +serdes_preemphasis_110=0x144108 +serdes_preemphasis_111=0x144108 +serdes_preemphasis_112=0x164608 +serdes_preemphasis_113=0x164608 +serdes_preemphasis_114=0x174507 +serdes_preemphasis_115=0x184606 +serdes_preemphasis_116=0x103706 +serdes_preemphasis_117=0x133c06 + +{{ mmu_sock }} +{{ IPinIP_sock }} + +phy_an_lt_msft=1 diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64/pg_profile_lookup.ini b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64/pg_profile_lookup.ini new file mode 120000 index 000000000000..297cddb2d223 --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64/pg_profile_lookup.ini @@ -0,0 +1 @@ +BALANCED/pg_profile_lookup.ini \ No newline at end of file diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64/qos.json.j2 b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64/qos.json.j2 new file mode 120000 index 000000000000..aef6b6765cf2 --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64/qos.json.j2 @@ -0,0 +1 @@ +BALANCED/qos.json.j2 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64/sai.profile b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64/sai.profile index 2607bef50850..5163d6140f0e 100644 --- a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64/sai.profile +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64/sai.profile @@ -1,2 +1,2 @@ -SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/th2-a7260cx3-64-64x100G.config.bcm +SAI_INIT_CONFIG_FILE=/etc/sai.d/config.bcm SAI_NUM_ECMP_MEMBERS=64 diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64/th2-a7260cx3-64-64x100G.config.bcm b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64/th2-a7260cx3-64-64x100G.config.bcm deleted file mode 100644 index 13fdd280e857..000000000000 --- a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64/th2-a7260cx3-64-64x100G.config.bcm +++ /dev/null @@ -1,1013 +0,0 @@ -PHY_AN_ALLOW_PLL_CHANGE=1 -arl_clean_timeout_usec=15000000 -asf_mem_profile=2 -bcm_num_cos=10 -bcm_stat_flags=1 -bcm_stat_jumbo=9236 -cdma_timeout_usec=15000000 -core_clock_frequency=1700 -dma_desc_timeout_usec=15000000 -dpp_clock_ratio=2:3 -higig2_hdr_mode=1 -ipv6_lpm_128b_enable=1 -l3_alpm_enable=2 -lpm_scaling_enable=0 -l2xmsg_mode=1 -max_vp_lags=0 -mem_scan_enable=1 -miim_intr_enable=0 -module_64ports=1 -os=unix -oversubscribe_mode=1 -pbmp_xport_xe=0x40003ffff0000ffffc0003fffe0001fffe -phy_an_allow_pll_change_hg=0 -phy_an_c73_100=1 -phy_an_c73_102=1 -phy_an_c73_103=1 -phy_an_c73_104=1 -phy_an_c73_105=1 -phy_an_c73_106=1 -phy_an_c73_107=1 -phy_an_c73_108=1 -phy_an_c73_109=1 -phy_an_c73_10=1 -phy_an_c73_110=1 -phy_an_c73_111=1 -phy_an_c73_112=1 -phy_an_c73_113=1 -phy_an_c73_114=1 -phy_an_c73_115=1 -phy_an_c73_116=1 -phy_an_c73_117=1 -phy_an_c73_11=1 -phy_an_c73_12=1 -phy_an_c73_13=1 -phy_an_c73_14=1 -phy_an_c73_15=1 -phy_an_c73_16=1 -phy_an_c73_1=1 -phy_an_c73_2=1 -phy_an_c73_34=1 -phy_an_c73_35=1 -phy_an_c73_36=1 -phy_an_c73_37=1 -phy_an_c73_38=1 -phy_an_c73_39=1 -phy_an_c73_3=1 -phy_an_c73_40=1 -phy_an_c73_41=1 -phy_an_c73_42=1 -phy_an_c73_43=1 -phy_an_c73_44=1 -phy_an_c73_45=1 -phy_an_c73_46=1 -phy_an_c73_47=1 -phy_an_c73_48=1 -phy_an_c73_49=1 -phy_an_c73_4=1 -phy_an_c73_5=1 -phy_an_c73_66=1 -phy_an_c73_68=1 -phy_an_c73_69=1 -phy_an_c73_6=1 -phy_an_c73_70=1 -phy_an_c73_71=1 -phy_an_c73_72=1 -phy_an_c73_73=1 -phy_an_c73_74=1 -phy_an_c73_75=1 -phy_an_c73_76=1 -phy_an_c73_77=1 -phy_an_c73_78=1 -phy_an_c73_79=1 -phy_an_c73_7=1 -phy_an_c73_80=1 -phy_an_c73_81=1 -phy_an_c73_82=1 -phy_an_c73_83=1 -phy_an_c73_8=1 -phy_an_c73_9=1 -phy_chain_rx_lane_map_physical{1.0}=0x3210 -phy_chain_rx_lane_map_physical{101.0}=0x0123 -phy_chain_rx_lane_map_physical{105.0}=0x0123 -phy_chain_rx_lane_map_physical{109.0}=0x0123 -phy_chain_rx_lane_map_physical{113.0}=0x2301 -phy_chain_rx_lane_map_physical{117.0}=0x3210 -phy_chain_rx_lane_map_physical{121.0}=0x3210 -phy_chain_rx_lane_map_physical{125.0}=0x1203 -phy_chain_rx_lane_map_physical{129.0}=0x3210 -phy_chain_rx_lane_map_physical{13.0}=0x0321 -phy_chain_rx_lane_map_physical{133.0}=0x1032 -phy_chain_rx_lane_map_physical{137.0}=0x3210 -phy_chain_rx_lane_map_physical{141.0}=0x0123 -phy_chain_rx_lane_map_physical{145.0}=0x3210 -phy_chain_rx_lane_map_physical{149.0}=0x2310 -phy_chain_rx_lane_map_physical{153.0}=0x0132 -phy_chain_rx_lane_map_physical{157.0}=0x1302 -phy_chain_rx_lane_map_physical{161.0}=0x3021 -phy_chain_rx_lane_map_physical{165.0}=0x2031 -phy_chain_rx_lane_map_physical{169.0}=0x2031 -phy_chain_rx_lane_map_physical{17.0}=0x3210 -phy_chain_rx_lane_map_physical{173.0}=0x1302 -phy_chain_rx_lane_map_physical{177.0}=0x2031 -phy_chain_rx_lane_map_physical{181.0}=0x0213 -phy_chain_rx_lane_map_physical{185.0}=0x0213 -phy_chain_rx_lane_map_physical{189.0}=0x1302 -phy_chain_rx_lane_map_physical{193.0}=0x3120 -phy_chain_rx_lane_map_physical{197.0}=0x0231 -phy_chain_rx_lane_map_physical{201.0}=0x2031 -phy_chain_rx_lane_map_physical{205.0}=0x0213 -phy_chain_rx_lane_map_physical{209.0}=0x2013 -phy_chain_rx_lane_map_physical{21.0}=0x3021 -phy_chain_rx_lane_map_physical{213.0}=0x3021 -phy_chain_rx_lane_map_physical{217.0}=0x0231 -phy_chain_rx_lane_map_physical{221.0}=0x2031 -phy_chain_rx_lane_map_physical{225.0}=0x1203 -phy_chain_rx_lane_map_physical{229.0}=0x1230 -phy_chain_rx_lane_map_physical{233.0}=0x3021 -phy_chain_rx_lane_map_physical{237.0}=0x1032 -phy_chain_rx_lane_map_physical{241.0}=0x2301 -phy_chain_rx_lane_map_physical{245.0}=0x0321 -phy_chain_rx_lane_map_physical{249.0}=0x2301 -phy_chain_rx_lane_map_physical{25.0}=0x2301 -phy_chain_rx_lane_map_physical{253.0}=0x2301 -phy_chain_rx_lane_map_physical{257.0}=0x3210 -phy_chain_rx_lane_map_physical{29.0}=0x3021 -phy_chain_rx_lane_map_physical{33.0}=0x1302 -phy_chain_rx_lane_map_physical{37.0}=0x2031 -phy_chain_rx_lane_map_physical{41.0}=0x3021 -phy_chain_rx_lane_map_physical{45.0}=0x1023 -phy_chain_rx_lane_map_physical{49.0}=0x0213 -phy_chain_rx_lane_map_physical{5.0}=0x3201 -phy_chain_rx_lane_map_physical{53.0}=0x3201 -phy_chain_rx_lane_map_physical{57.0}=0x2013 -phy_chain_rx_lane_map_physical{61.0}=0x0213 -phy_chain_rx_lane_map_physical{65.0}=0x1203 -phy_chain_rx_lane_map_physical{69.0}=0x0213 -phy_chain_rx_lane_map_physical{73.0}=0x0213 -phy_chain_rx_lane_map_physical{77.0}=0x3120 -phy_chain_rx_lane_map_physical{81.0}=0x0213 -phy_chain_rx_lane_map_physical{85.0}=0x2031 -phy_chain_rx_lane_map_physical{89.0}=0x2031 -phy_chain_rx_lane_map_physical{9.0}=0x0321 -phy_chain_rx_lane_map_physical{93.0}=0x3120 -phy_chain_rx_lane_map_physical{97.0}=0x1203 -phy_chain_rx_polarity_flip_physical{1.0}=0x1 -phy_chain_rx_polarity_flip_physical{10.0}=0x0 -phy_chain_rx_polarity_flip_physical{100.0}=0x1 -phy_chain_rx_polarity_flip_physical{101.0}=0x1 -phy_chain_rx_polarity_flip_physical{102.0}=0x0 -phy_chain_rx_polarity_flip_physical{103.0}=0x1 -phy_chain_rx_polarity_flip_physical{104.0}=0x0 -phy_chain_rx_polarity_flip_physical{105.0}=0x1 -phy_chain_rx_polarity_flip_physical{106.0}=0x0 -phy_chain_rx_polarity_flip_physical{107.0}=0x1 -phy_chain_rx_polarity_flip_physical{108.0}=0x0 -phy_chain_rx_polarity_flip_physical{109.0}=0x0 -phy_chain_rx_polarity_flip_physical{11.0}=0x1 -phy_chain_rx_polarity_flip_physical{110.0}=0x1 -phy_chain_rx_polarity_flip_physical{111.0}=0x0 -phy_chain_rx_polarity_flip_physical{112.0}=0x1 -phy_chain_rx_polarity_flip_physical{113.0}=0x1 -phy_chain_rx_polarity_flip_physical{114.0}=0x0 -phy_chain_rx_polarity_flip_physical{115.0}=0x1 -phy_chain_rx_polarity_flip_physical{116.0}=0x0 -phy_chain_rx_polarity_flip_physical{117.0}=0x0 -phy_chain_rx_polarity_flip_physical{118.0}=0x0 -phy_chain_rx_polarity_flip_physical{119.0}=0x1 -phy_chain_rx_polarity_flip_physical{12.0}=0x1 -phy_chain_rx_polarity_flip_physical{120.0}=0x0 -phy_chain_rx_polarity_flip_physical{121.0}=0x1 -phy_chain_rx_polarity_flip_physical{122.0}=0x0 -phy_chain_rx_polarity_flip_physical{123.0}=0x1 -phy_chain_rx_polarity_flip_physical{124.0}=0x0 -phy_chain_rx_polarity_flip_physical{125.0}=0x0 -phy_chain_rx_polarity_flip_physical{126.0}=0x1 -phy_chain_rx_polarity_flip_physical{127.0}=0x1 -phy_chain_rx_polarity_flip_physical{128.0}=0x1 -phy_chain_rx_polarity_flip_physical{129.0}=0x0 -phy_chain_rx_polarity_flip_physical{13.0}=0x1 -phy_chain_rx_polarity_flip_physical{130.0}=0x1 -phy_chain_rx_polarity_flip_physical{131.0}=0x1 -phy_chain_rx_polarity_flip_physical{132.0}=0x0 -phy_chain_rx_polarity_flip_physical{133.0}=0x1 -phy_chain_rx_polarity_flip_physical{134.0}=0x1 -phy_chain_rx_polarity_flip_physical{135.0}=0x1 -phy_chain_rx_polarity_flip_physical{136.0}=0x0 -phy_chain_rx_polarity_flip_physical{137.0}=0x0 -phy_chain_rx_polarity_flip_physical{138.0}=0x0 -phy_chain_rx_polarity_flip_physical{139.0}=0x1 -phy_chain_rx_polarity_flip_physical{14.0}=0x0 -phy_chain_rx_polarity_flip_physical{140.0}=0x0 -phy_chain_rx_polarity_flip_physical{141.0}=0x1 -phy_chain_rx_polarity_flip_physical{142.0}=0x0 -phy_chain_rx_polarity_flip_physical{143.0}=0x1 -phy_chain_rx_polarity_flip_physical{144.0}=0x0 -phy_chain_rx_polarity_flip_physical{145.0}=0x1 -phy_chain_rx_polarity_flip_physical{146.0}=0x0 -phy_chain_rx_polarity_flip_physical{147.0}=0x1 -phy_chain_rx_polarity_flip_physical{148.0}=0x0 -phy_chain_rx_polarity_flip_physical{149.0}=0x0 -phy_chain_rx_polarity_flip_physical{15.0}=0x1 -phy_chain_rx_polarity_flip_physical{150.0}=0x1 -phy_chain_rx_polarity_flip_physical{151.0}=0x1 -phy_chain_rx_polarity_flip_physical{152.0}=0x0 -phy_chain_rx_polarity_flip_physical{153.0}=0x0 -phy_chain_rx_polarity_flip_physical{154.0}=0x1 -phy_chain_rx_polarity_flip_physical{155.0}=0x1 -phy_chain_rx_polarity_flip_physical{156.0}=0x0 -phy_chain_rx_polarity_flip_physical{157.0}=0x0 -phy_chain_rx_polarity_flip_physical{158.0}=0x0 -phy_chain_rx_polarity_flip_physical{159.0}=0x1 -phy_chain_rx_polarity_flip_physical{16.0}=0x0 -phy_chain_rx_polarity_flip_physical{160.0}=0x0 -phy_chain_rx_polarity_flip_physical{161.0}=0x1 -phy_chain_rx_polarity_flip_physical{162.0}=0x1 -phy_chain_rx_polarity_flip_physical{163.0}=0x0 -phy_chain_rx_polarity_flip_physical{164.0}=0x1 -phy_chain_rx_polarity_flip_physical{165.0}=0x0 -phy_chain_rx_polarity_flip_physical{166.0}=0x0 -phy_chain_rx_polarity_flip_physical{167.0}=0x1 -phy_chain_rx_polarity_flip_physical{168.0}=0x1 -phy_chain_rx_polarity_flip_physical{169.0}=0x1 -phy_chain_rx_polarity_flip_physical{17.0}=0x1 -phy_chain_rx_polarity_flip_physical{170.0}=0x1 -phy_chain_rx_polarity_flip_physical{171.0}=0x0 -phy_chain_rx_polarity_flip_physical{172.0}=0x0 -phy_chain_rx_polarity_flip_physical{173.0}=0x0 -phy_chain_rx_polarity_flip_physical{174.0}=0x0 -phy_chain_rx_polarity_flip_physical{175.0}=0x1 -phy_chain_rx_polarity_flip_physical{176.0}=0x1 -phy_chain_rx_polarity_flip_physical{177.0}=0x1 -phy_chain_rx_polarity_flip_physical{178.0}=0x1 -phy_chain_rx_polarity_flip_physical{179.0}=0x0 -phy_chain_rx_polarity_flip_physical{18.0}=0x0 -phy_chain_rx_polarity_flip_physical{180.0}=0x0 -phy_chain_rx_polarity_flip_physical{181.0}=0x1 -phy_chain_rx_polarity_flip_physical{182.0}=0x1 -phy_chain_rx_polarity_flip_physical{183.0}=0x0 -phy_chain_rx_polarity_flip_physical{184.0}=0x0 -phy_chain_rx_polarity_flip_physical{185.0}=0x0 -phy_chain_rx_polarity_flip_physical{186.0}=0x0 -phy_chain_rx_polarity_flip_physical{187.0}=0x1 -phy_chain_rx_polarity_flip_physical{188.0}=0x1 -phy_chain_rx_polarity_flip_physical{189.0}=0x0 -phy_chain_rx_polarity_flip_physical{19.0}=0x1 -phy_chain_rx_polarity_flip_physical{190.0}=0x0 -phy_chain_rx_polarity_flip_physical{191.0}=0x1 -phy_chain_rx_polarity_flip_physical{192.0}=0x0 -phy_chain_rx_polarity_flip_physical{193.0}=0x0 -phy_chain_rx_polarity_flip_physical{194.0}=0x0 -phy_chain_rx_polarity_flip_physical{195.0}=0x1 -phy_chain_rx_polarity_flip_physical{196.0}=0x1 -phy_chain_rx_polarity_flip_physical{197.0}=0x1 -phy_chain_rx_polarity_flip_physical{198.0}=0x1 -phy_chain_rx_polarity_flip_physical{199.0}=0x0 -phy_chain_rx_polarity_flip_physical{2.0}=0x0 -phy_chain_rx_polarity_flip_physical{20.0}=0x0 -phy_chain_rx_polarity_flip_physical{200.0}=0x0 -phy_chain_rx_polarity_flip_physical{201.0}=0x0 -phy_chain_rx_polarity_flip_physical{202.0}=0x0 -phy_chain_rx_polarity_flip_physical{203.0}=0x1 -phy_chain_rx_polarity_flip_physical{204.0}=0x0 -phy_chain_rx_polarity_flip_physical{205.0}=0x1 -phy_chain_rx_polarity_flip_physical{206.0}=0x1 -phy_chain_rx_polarity_flip_physical{207.0}=0x0 -phy_chain_rx_polarity_flip_physical{208.0}=0x0 -phy_chain_rx_polarity_flip_physical{209.0}=0x1 -phy_chain_rx_polarity_flip_physical{21.0}=0x0 -phy_chain_rx_polarity_flip_physical{210.0}=0x1 -phy_chain_rx_polarity_flip_physical{211.0}=0x0 -phy_chain_rx_polarity_flip_physical{212.0}=0x0 -phy_chain_rx_polarity_flip_physical{213.0}=0x0 -phy_chain_rx_polarity_flip_physical{214.0}=0x0 -phy_chain_rx_polarity_flip_physical{215.0}=0x1 -phy_chain_rx_polarity_flip_physical{216.0}=0x0 -phy_chain_rx_polarity_flip_physical{217.0}=0x0 -phy_chain_rx_polarity_flip_physical{218.0}=0x0 -phy_chain_rx_polarity_flip_physical{219.0}=0x1 -phy_chain_rx_polarity_flip_physical{22.0}=0x0 -phy_chain_rx_polarity_flip_physical{220.0}=0x1 -phy_chain_rx_polarity_flip_physical{221.0}=0x0 -phy_chain_rx_polarity_flip_physical{222.0}=0x0 -phy_chain_rx_polarity_flip_physical{223.0}=0x1 -phy_chain_rx_polarity_flip_physical{224.0}=0x1 -phy_chain_rx_polarity_flip_physical{225.0}=0x1 -phy_chain_rx_polarity_flip_physical{226.0}=0x0 -phy_chain_rx_polarity_flip_physical{227.0}=0x0 -phy_chain_rx_polarity_flip_physical{228.0}=0x1 -phy_chain_rx_polarity_flip_physical{229.0}=0x0 -phy_chain_rx_polarity_flip_physical{23.0}=0x1 -phy_chain_rx_polarity_flip_physical{230.0}=0x0 -phy_chain_rx_polarity_flip_physical{231.0}=0x1 -phy_chain_rx_polarity_flip_physical{232.0}=0x1 -phy_chain_rx_polarity_flip_physical{233.0}=0x1 -phy_chain_rx_polarity_flip_physical{234.0}=0x0 -phy_chain_rx_polarity_flip_physical{235.0}=0x0 -phy_chain_rx_polarity_flip_physical{236.0}=0x0 -phy_chain_rx_polarity_flip_physical{237.0}=0x1 -phy_chain_rx_polarity_flip_physical{238.0}=0x0 -phy_chain_rx_polarity_flip_physical{239.0}=0x1 -phy_chain_rx_polarity_flip_physical{24.0}=0x0 -phy_chain_rx_polarity_flip_physical{240.0}=0x0 -phy_chain_rx_polarity_flip_physical{241.0}=0x1 -phy_chain_rx_polarity_flip_physical{242.0}=0x0 -phy_chain_rx_polarity_flip_physical{243.0}=0x1 -phy_chain_rx_polarity_flip_physical{244.0}=0x0 -phy_chain_rx_polarity_flip_physical{245.0}=0x1 -phy_chain_rx_polarity_flip_physical{246.0}=0x1 -phy_chain_rx_polarity_flip_physical{247.0}=0x1 -phy_chain_rx_polarity_flip_physical{248.0}=0x0 -phy_chain_rx_polarity_flip_physical{249.0}=0x0 -phy_chain_rx_polarity_flip_physical{25.0}=0x1 -phy_chain_rx_polarity_flip_physical{250.0}=0x1 -phy_chain_rx_polarity_flip_physical{251.0}=0x0 -phy_chain_rx_polarity_flip_physical{252.0}=0x1 -phy_chain_rx_polarity_flip_physical{253.0}=0x1 -phy_chain_rx_polarity_flip_physical{254.0}=0x0 -phy_chain_rx_polarity_flip_physical{255.0}=0x1 -phy_chain_rx_polarity_flip_physical{256.0}=0x0 -phy_chain_rx_polarity_flip_physical{257.0}=0x0 -phy_chain_rx_polarity_flip_physical{259.0}=0x0 -phy_chain_rx_polarity_flip_physical{26.0}=0x0 -phy_chain_rx_polarity_flip_physical{27.0}=0x1 -phy_chain_rx_polarity_flip_physical{28.0}=0x0 -phy_chain_rx_polarity_flip_physical{29.0}=0x0 -phy_chain_rx_polarity_flip_physical{3.0}=0x1 -phy_chain_rx_polarity_flip_physical{30.0}=0x0 -phy_chain_rx_polarity_flip_physical{31.0}=0x0 -phy_chain_rx_polarity_flip_physical{32.0}=0x1 -phy_chain_rx_polarity_flip_physical{33.0}=0x0 -phy_chain_rx_polarity_flip_physical{34.0}=0x0 -phy_chain_rx_polarity_flip_physical{35.0}=0x1 -phy_chain_rx_polarity_flip_physical{36.0}=0x1 -phy_chain_rx_polarity_flip_physical{37.0}=0x1 -phy_chain_rx_polarity_flip_physical{38.0}=0x1 -phy_chain_rx_polarity_flip_physical{39.0}=0x0 -phy_chain_rx_polarity_flip_physical{4.0}=0x0 -phy_chain_rx_polarity_flip_physical{40.0}=0x0 -phy_chain_rx_polarity_flip_physical{41.0}=0x0 -phy_chain_rx_polarity_flip_physical{42.0}=0x1 -phy_chain_rx_polarity_flip_physical{43.0}=0x1 -phy_chain_rx_polarity_flip_physical{44.0}=0x1 -phy_chain_rx_polarity_flip_physical{45.0}=0x1 -phy_chain_rx_polarity_flip_physical{46.0}=0x0 -phy_chain_rx_polarity_flip_physical{47.0}=0x0 -phy_chain_rx_polarity_flip_physical{48.0}=0x1 -phy_chain_rx_polarity_flip_physical{49.0}=0x1 -phy_chain_rx_polarity_flip_physical{5.0}=0x1 -phy_chain_rx_polarity_flip_physical{50.0}=0x1 -phy_chain_rx_polarity_flip_physical{51.0}=0x0 -phy_chain_rx_polarity_flip_physical{52.0}=0x0 -phy_chain_rx_polarity_flip_physical{53.0}=0x0 -phy_chain_rx_polarity_flip_physical{54.0}=0x0 -phy_chain_rx_polarity_flip_physical{55.0}=0x1 -phy_chain_rx_polarity_flip_physical{56.0}=0x0 -phy_chain_rx_polarity_flip_physical{57.0}=0x0 -phy_chain_rx_polarity_flip_physical{58.0}=0x0 -phy_chain_rx_polarity_flip_physical{59.0}=0x1 -phy_chain_rx_polarity_flip_physical{6.0}=0x0 -phy_chain_rx_polarity_flip_physical{60.0}=0x1 -phy_chain_rx_polarity_flip_physical{61.0}=0x0 -phy_chain_rx_polarity_flip_physical{62.0}=0x0 -phy_chain_rx_polarity_flip_physical{63.0}=0x1 -phy_chain_rx_polarity_flip_physical{64.0}=0x1 -phy_chain_rx_polarity_flip_physical{65.0}=0x1 -phy_chain_rx_polarity_flip_physical{66.0}=0x1 -phy_chain_rx_polarity_flip_physical{67.0}=0x0 -phy_chain_rx_polarity_flip_physical{68.0}=0x1 -phy_chain_rx_polarity_flip_physical{69.0}=0x0 -phy_chain_rx_polarity_flip_physical{7.0}=0x0 -phy_chain_rx_polarity_flip_physical{70.0}=0x0 -phy_chain_rx_polarity_flip_physical{71.0}=0x1 -phy_chain_rx_polarity_flip_physical{72.0}=0x1 -phy_chain_rx_polarity_flip_physical{73.0}=0x1 -phy_chain_rx_polarity_flip_physical{74.0}=0x1 -phy_chain_rx_polarity_flip_physical{75.0}=0x0 -phy_chain_rx_polarity_flip_physical{76.0}=0x0 -phy_chain_rx_polarity_flip_physical{77.0}=0x0 -phy_chain_rx_polarity_flip_physical{78.0}=0x0 -phy_chain_rx_polarity_flip_physical{79.0}=0x1 -phy_chain_rx_polarity_flip_physical{8.0}=0x1 -phy_chain_rx_polarity_flip_physical{80.0}=0x1 -phy_chain_rx_polarity_flip_physical{81.0}=0x1 -phy_chain_rx_polarity_flip_physical{82.0}=0x1 -phy_chain_rx_polarity_flip_physical{83.0}=0x0 -phy_chain_rx_polarity_flip_physical{84.0}=0x0 -phy_chain_rx_polarity_flip_physical{85.0}=0x1 -phy_chain_rx_polarity_flip_physical{86.0}=0x1 -phy_chain_rx_polarity_flip_physical{87.0}=0x0 -phy_chain_rx_polarity_flip_physical{88.0}=0x0 -phy_chain_rx_polarity_flip_physical{89.0}=0x0 -phy_chain_rx_polarity_flip_physical{9.0}=0x1 -phy_chain_rx_polarity_flip_physical{90.0}=0x0 -phy_chain_rx_polarity_flip_physical{91.0}=0x1 -phy_chain_rx_polarity_flip_physical{92.0}=0x1 -phy_chain_rx_polarity_flip_physical{93.0}=0x0 -phy_chain_rx_polarity_flip_physical{94.0}=0x0 -phy_chain_rx_polarity_flip_physical{95.0}=0x1 -phy_chain_rx_polarity_flip_physical{96.0}=0x0 -phy_chain_rx_polarity_flip_physical{97.0}=0x1 -phy_chain_rx_polarity_flip_physical{98.0}=0x1 -phy_chain_rx_polarity_flip_physical{99.0}=0x0 -phy_chain_tx_lane_map_physical{1.0}=0x2031 -phy_chain_tx_lane_map_physical{101.0}=0x1023 -phy_chain_tx_lane_map_physical{105.0}=0x1302 -phy_chain_tx_lane_map_physical{109.0}=0x0321 -phy_chain_tx_lane_map_physical{113.0}=0x2301 -phy_chain_tx_lane_map_physical{117.0}=0x3120 -phy_chain_tx_lane_map_physical{121.0}=0x3102 -phy_chain_tx_lane_map_physical{125.0}=0x3210 -phy_chain_tx_lane_map_physical{129.0}=0x1023 -phy_chain_tx_lane_map_physical{13.0}=0x3021 -phy_chain_tx_lane_map_physical{133.0}=0x3210 -phy_chain_tx_lane_map_physical{137.0}=0x2031 -phy_chain_tx_lane_map_physical{141.0}=0x1302 -phy_chain_tx_lane_map_physical{145.0}=0x3210 -phy_chain_tx_lane_map_physical{149.0}=0x0213 -phy_chain_tx_lane_map_physical{153.0}=0x3210 -phy_chain_tx_lane_map_physical{157.0}=0x1320 -phy_chain_tx_lane_map_physical{161.0}=0x3210 -phy_chain_tx_lane_map_physical{165.0}=0x0231 -phy_chain_tx_lane_map_physical{169.0}=0x3120 -phy_chain_tx_lane_map_physical{17.0}=0x1032 -phy_chain_tx_lane_map_physical{173.0}=0x0312 -phy_chain_tx_lane_map_physical{177.0}=0x0231 -phy_chain_tx_lane_map_physical{181.0}=0x3210 -phy_chain_tx_lane_map_physical{185.0}=0x3210 -phy_chain_tx_lane_map_physical{189.0}=0x1320 -phy_chain_tx_lane_map_physical{193.0}=0x0321 -phy_chain_tx_lane_map_physical{197.0}=0x3120 -phy_chain_tx_lane_map_physical{201.0}=0x3120 -phy_chain_tx_lane_map_physical{205.0}=0x0123 -phy_chain_tx_lane_map_physical{209.0}=0x3120 -phy_chain_tx_lane_map_physical{21.0}=0x0213 -phy_chain_tx_lane_map_physical{213.0}=0x3021 -phy_chain_tx_lane_map_physical{217.0}=0x0312 -phy_chain_tx_lane_map_physical{221.0}=0x2301 -phy_chain_tx_lane_map_physical{225.0}=0x0123 -phy_chain_tx_lane_map_physical{229.0}=0x2031 -phy_chain_tx_lane_map_physical{233.0}=0x0231 -phy_chain_tx_lane_map_physical{237.0}=0x0213 -phy_chain_tx_lane_map_physical{241.0}=0x1320 -phy_chain_tx_lane_map_physical{245.0}=0x2031 -phy_chain_tx_lane_map_physical{249.0}=0x3120 -phy_chain_tx_lane_map_physical{25.0}=0x0231 -phy_chain_tx_lane_map_physical{253.0}=0x0321 -phy_chain_tx_lane_map_physical{257.0}=0x3210 -phy_chain_tx_lane_map_physical{29.0}=0x1230 -phy_chain_tx_lane_map_physical{33.0}=0x1032 -phy_chain_tx_lane_map_physical{37.0}=0x0123 -phy_chain_tx_lane_map_physical{41.0}=0x0213 -phy_chain_tx_lane_map_physical{45.0}=0x0132 -phy_chain_tx_lane_map_physical{49.0}=0x2031 -phy_chain_tx_lane_map_physical{5.0}=0x2301 -phy_chain_tx_lane_map_physical{53.0}=0x2301 -phy_chain_tx_lane_map_physical{57.0}=0x2031 -phy_chain_tx_lane_map_physical{61.0}=0x2031 -phy_chain_tx_lane_map_physical{65.0}=0x1230 -phy_chain_tx_lane_map_physical{69.0}=0x2013 -phy_chain_tx_lane_map_physical{73.0}=0x0213 -phy_chain_tx_lane_map_physical{77.0}=0x2310 -phy_chain_tx_lane_map_physical{81.0}=0x0321 -phy_chain_tx_lane_map_physical{85.0}=0x2013 -phy_chain_tx_lane_map_physical{89.0}=0x0213 -phy_chain_tx_lane_map_physical{9.0}=0x3012 -phy_chain_tx_lane_map_physical{93.0}=0x3102 -phy_chain_tx_lane_map_physical{97.0}=0x3210 -phy_chain_tx_polarity_flip_physical{1.0}=0x0 -phy_chain_tx_polarity_flip_physical{10.0}=0x1 -phy_chain_tx_polarity_flip_physical{100.0}=0x0 -phy_chain_tx_polarity_flip_physical{101.0}=0x0 -phy_chain_tx_polarity_flip_physical{102.0}=0x1 -phy_chain_tx_polarity_flip_physical{103.0}=0x0 -phy_chain_tx_polarity_flip_physical{104.0}=0x0 -phy_chain_tx_polarity_flip_physical{105.0}=0x0 -phy_chain_tx_polarity_flip_physical{106.0}=0x1 -phy_chain_tx_polarity_flip_physical{107.0}=0x1 -phy_chain_tx_polarity_flip_physical{108.0}=0x1 -phy_chain_tx_polarity_flip_physical{109.0}=0x0 -phy_chain_tx_polarity_flip_physical{11.0}=0x1 -phy_chain_tx_polarity_flip_physical{110.0}=0x0 -phy_chain_tx_polarity_flip_physical{111.0}=0x0 -phy_chain_tx_polarity_flip_physical{112.0}=0x1 -phy_chain_tx_polarity_flip_physical{113.0}=0x1 -phy_chain_tx_polarity_flip_physical{114.0}=0x1 -phy_chain_tx_polarity_flip_physical{115.0}=0x1 -phy_chain_tx_polarity_flip_physical{116.0}=0x0 -phy_chain_tx_polarity_flip_physical{117.0}=0x1 -phy_chain_tx_polarity_flip_physical{118.0}=0x0 -phy_chain_tx_polarity_flip_physical{119.0}=0x0 -phy_chain_tx_polarity_flip_physical{12.0}=0x0 -phy_chain_tx_polarity_flip_physical{120.0}=0x0 -phy_chain_tx_polarity_flip_physical{121.0}=0x0 -phy_chain_tx_polarity_flip_physical{122.0}=0x0 -phy_chain_tx_polarity_flip_physical{123.0}=0x0 -phy_chain_tx_polarity_flip_physical{124.0}=0x1 -phy_chain_tx_polarity_flip_physical{125.0}=0x0 -phy_chain_tx_polarity_flip_physical{126.0}=0x1 -phy_chain_tx_polarity_flip_physical{127.0}=0x1 -phy_chain_tx_polarity_flip_physical{128.0}=0x1 -phy_chain_tx_polarity_flip_physical{129.0}=0x1 -phy_chain_tx_polarity_flip_physical{13.0}=0x0 -phy_chain_tx_polarity_flip_physical{130.0}=0x0 -phy_chain_tx_polarity_flip_physical{131.0}=0x1 -phy_chain_tx_polarity_flip_physical{132.0}=0x0 -phy_chain_tx_polarity_flip_physical{133.0}=0x1 -phy_chain_tx_polarity_flip_physical{134.0}=0x1 -phy_chain_tx_polarity_flip_physical{135.0}=0x1 -phy_chain_tx_polarity_flip_physical{136.0}=0x1 -phy_chain_tx_polarity_flip_physical{137.0}=0x1 -phy_chain_tx_polarity_flip_physical{138.0}=0x1 -phy_chain_tx_polarity_flip_physical{139.0}=0x1 -phy_chain_tx_polarity_flip_physical{14.0}=0x1 -phy_chain_tx_polarity_flip_physical{140.0}=0x1 -phy_chain_tx_polarity_flip_physical{141.0}=0x0 -phy_chain_tx_polarity_flip_physical{142.0}=0x1 -phy_chain_tx_polarity_flip_physical{143.0}=0x1 -phy_chain_tx_polarity_flip_physical{144.0}=0x1 -phy_chain_tx_polarity_flip_physical{145.0}=0x1 -phy_chain_tx_polarity_flip_physical{146.0}=0x1 -phy_chain_tx_polarity_flip_physical{147.0}=0x1 -phy_chain_tx_polarity_flip_physical{148.0}=0x0 -phy_chain_tx_polarity_flip_physical{149.0}=0x1 -phy_chain_tx_polarity_flip_physical{15.0}=0x0 -phy_chain_tx_polarity_flip_physical{150.0}=0x0 -phy_chain_tx_polarity_flip_physical{151.0}=0x0 -phy_chain_tx_polarity_flip_physical{152.0}=0x0 -phy_chain_tx_polarity_flip_physical{153.0}=0x1 -phy_chain_tx_polarity_flip_physical{154.0}=0x0 -phy_chain_tx_polarity_flip_physical{155.0}=0x0 -phy_chain_tx_polarity_flip_physical{156.0}=0x0 -phy_chain_tx_polarity_flip_physical{157.0}=0x0 -phy_chain_tx_polarity_flip_physical{158.0}=0x0 -phy_chain_tx_polarity_flip_physical{159.0}=0x0 -phy_chain_tx_polarity_flip_physical{16.0}=0x0 -phy_chain_tx_polarity_flip_physical{160.0}=0x0 -phy_chain_tx_polarity_flip_physical{161.0}=0x0 -phy_chain_tx_polarity_flip_physical{162.0}=0x1 -phy_chain_tx_polarity_flip_physical{163.0}=0x1 -phy_chain_tx_polarity_flip_physical{164.0}=0x0 -phy_chain_tx_polarity_flip_physical{165.0}=0x1 -phy_chain_tx_polarity_flip_physical{166.0}=0x1 -phy_chain_tx_polarity_flip_physical{167.0}=0x1 -phy_chain_tx_polarity_flip_physical{168.0}=0x0 -phy_chain_tx_polarity_flip_physical{169.0}=0x0 -phy_chain_tx_polarity_flip_physical{17.0}=0x0 -phy_chain_tx_polarity_flip_physical{170.0}=0x1 -phy_chain_tx_polarity_flip_physical{171.0}=0x1 -phy_chain_tx_polarity_flip_physical{172.0}=0x1 -phy_chain_tx_polarity_flip_physical{173.0}=0x0 -phy_chain_tx_polarity_flip_physical{174.0}=0x0 -phy_chain_tx_polarity_flip_physical{175.0}=0x1 -phy_chain_tx_polarity_flip_physical{176.0}=0x0 -phy_chain_tx_polarity_flip_physical{177.0}=0x1 -phy_chain_tx_polarity_flip_physical{178.0}=0x0 -phy_chain_tx_polarity_flip_physical{179.0}=0x0 -phy_chain_tx_polarity_flip_physical{18.0}=0x1 -phy_chain_tx_polarity_flip_physical{180.0}=0x0 -phy_chain_tx_polarity_flip_physical{181.0}=0x0 -phy_chain_tx_polarity_flip_physical{182.0}=0x0 -phy_chain_tx_polarity_flip_physical{183.0}=0x0 -phy_chain_tx_polarity_flip_physical{184.0}=0x1 -phy_chain_tx_polarity_flip_physical{185.0}=0x0 -phy_chain_tx_polarity_flip_physical{186.0}=0x1 -phy_chain_tx_polarity_flip_physical{187.0}=0x1 -phy_chain_tx_polarity_flip_physical{188.0}=0x1 -phy_chain_tx_polarity_flip_physical{189.0}=0x0 -phy_chain_tx_polarity_flip_physical{19.0}=0x1 -phy_chain_tx_polarity_flip_physical{190.0}=0x0 -phy_chain_tx_polarity_flip_physical{191.0}=0x0 -phy_chain_tx_polarity_flip_physical{192.0}=0x0 -phy_chain_tx_polarity_flip_physical{193.0}=0x1 -phy_chain_tx_polarity_flip_physical{194.0}=0x1 -phy_chain_tx_polarity_flip_physical{195.0}=0x1 -phy_chain_tx_polarity_flip_physical{196.0}=0x0 -phy_chain_tx_polarity_flip_physical{197.0}=0x0 -phy_chain_tx_polarity_flip_physical{198.0}=0x1 -phy_chain_tx_polarity_flip_physical{199.0}=0x1 -phy_chain_tx_polarity_flip_physical{2.0}=0x1 -phy_chain_tx_polarity_flip_physical{20.0}=0x1 -phy_chain_tx_polarity_flip_physical{200.0}=0x1 -phy_chain_tx_polarity_flip_physical{201.0}=0x1 -phy_chain_tx_polarity_flip_physical{202.0}=0x1 -phy_chain_tx_polarity_flip_physical{203.0}=0x1 -phy_chain_tx_polarity_flip_physical{204.0}=0x1 -phy_chain_tx_polarity_flip_physical{205.0}=0x0 -phy_chain_tx_polarity_flip_physical{206.0}=0x1 -phy_chain_tx_polarity_flip_physical{207.0}=0x1 -phy_chain_tx_polarity_flip_physical{208.0}=0x1 -phy_chain_tx_polarity_flip_physical{209.0}=0x1 -phy_chain_tx_polarity_flip_physical{21.0}=0x0 -phy_chain_tx_polarity_flip_physical{210.0}=0x1 -phy_chain_tx_polarity_flip_physical{211.0}=0x1 -phy_chain_tx_polarity_flip_physical{212.0}=0x0 -phy_chain_tx_polarity_flip_physical{213.0}=0x0 -phy_chain_tx_polarity_flip_physical{214.0}=0x1 -phy_chain_tx_polarity_flip_physical{215.0}=0x0 -phy_chain_tx_polarity_flip_physical{216.0}=0x1 -phy_chain_tx_polarity_flip_physical{217.0}=0x1 -phy_chain_tx_polarity_flip_physical{218.0}=0x1 -phy_chain_tx_polarity_flip_physical{219.0}=0x0 -phy_chain_tx_polarity_flip_physical{22.0}=0x0 -phy_chain_tx_polarity_flip_physical{220.0}=0x1 -phy_chain_tx_polarity_flip_physical{221.0}=0x0 -phy_chain_tx_polarity_flip_physical{222.0}=0x0 -phy_chain_tx_polarity_flip_physical{223.0}=0x0 -phy_chain_tx_polarity_flip_physical{224.0}=0x1 -phy_chain_tx_polarity_flip_physical{225.0}=0x1 -phy_chain_tx_polarity_flip_physical{226.0}=0x1 -phy_chain_tx_polarity_flip_physical{227.0}=0x1 -phy_chain_tx_polarity_flip_physical{228.0}=0x0 -phy_chain_tx_polarity_flip_physical{229.0}=0x0 -phy_chain_tx_polarity_flip_physical{23.0}=0x0 -phy_chain_tx_polarity_flip_physical{230.0}=0x1 -phy_chain_tx_polarity_flip_physical{231.0}=0x1 -phy_chain_tx_polarity_flip_physical{232.0}=0x1 -phy_chain_tx_polarity_flip_physical{233.0}=0x0 -phy_chain_tx_polarity_flip_physical{234.0}=0x0 -phy_chain_tx_polarity_flip_physical{235.0}=0x0 -phy_chain_tx_polarity_flip_physical{236.0}=0x0 -phy_chain_tx_polarity_flip_physical{237.0}=0x1 -phy_chain_tx_polarity_flip_physical{238.0}=0x1 -phy_chain_tx_polarity_flip_physical{239.0}=0x1 -phy_chain_tx_polarity_flip_physical{24.0}=0x0 -phy_chain_tx_polarity_flip_physical{240.0}=0x0 -phy_chain_tx_polarity_flip_physical{241.0}=0x1 -phy_chain_tx_polarity_flip_physical{242.0}=0x1 -phy_chain_tx_polarity_flip_physical{243.0}=0x1 -phy_chain_tx_polarity_flip_physical{244.0}=0x0 -phy_chain_tx_polarity_flip_physical{245.0}=0x1 -phy_chain_tx_polarity_flip_physical{246.0}=0x1 -phy_chain_tx_polarity_flip_physical{247.0}=0x1 -phy_chain_tx_polarity_flip_physical{248.0}=0x1 -phy_chain_tx_polarity_flip_physical{249.0}=0x1 -phy_chain_tx_polarity_flip_physical{25.0}=0x1 -phy_chain_tx_polarity_flip_physical{250.0}=0x0 -phy_chain_tx_polarity_flip_physical{251.0}=0x0 -phy_chain_tx_polarity_flip_physical{252.0}=0x0 -phy_chain_tx_polarity_flip_physical{253.0}=0x1 -phy_chain_tx_polarity_flip_physical{254.0}=0x1 -phy_chain_tx_polarity_flip_physical{255.0}=0x1 -phy_chain_tx_polarity_flip_physical{256.0}=0x0 -phy_chain_tx_polarity_flip_physical{257.0}=0x0 -phy_chain_tx_polarity_flip_physical{259.0}=0x0 -phy_chain_tx_polarity_flip_physical{26.0}=0x0 -phy_chain_tx_polarity_flip_physical{27.0}=0x0 -phy_chain_tx_polarity_flip_physical{28.0}=0x0 -phy_chain_tx_polarity_flip_physical{29.0}=0x1 -phy_chain_tx_polarity_flip_physical{3.0}=0x1 -phy_chain_tx_polarity_flip_physical{30.0}=0x1 -phy_chain_tx_polarity_flip_physical{31.0}=0x1 -phy_chain_tx_polarity_flip_physical{32.0}=0x0 -phy_chain_tx_polarity_flip_physical{33.0}=0x0 -phy_chain_tx_polarity_flip_physical{34.0}=0x0 -phy_chain_tx_polarity_flip_physical{35.0}=0x0 -phy_chain_tx_polarity_flip_physical{36.0}=0x1 -phy_chain_tx_polarity_flip_physical{37.0}=0x1 -phy_chain_tx_polarity_flip_physical{38.0}=0x1 -phy_chain_tx_polarity_flip_physical{39.0}=0x1 -phy_chain_tx_polarity_flip_physical{4.0}=0x1 -phy_chain_tx_polarity_flip_physical{40.0}=0x0 -phy_chain_tx_polarity_flip_physical{41.0}=0x0 -phy_chain_tx_polarity_flip_physical{42.0}=0x0 -phy_chain_tx_polarity_flip_physical{43.0}=0x0 -phy_chain_tx_polarity_flip_physical{44.0}=0x0 -phy_chain_tx_polarity_flip_physical{45.0}=0x1 -phy_chain_tx_polarity_flip_physical{46.0}=0x0 -phy_chain_tx_polarity_flip_physical{47.0}=0x1 -phy_chain_tx_polarity_flip_physical{48.0}=0x1 -phy_chain_tx_polarity_flip_physical{49.0}=0x0 -phy_chain_tx_polarity_flip_physical{5.0}=0x1 -phy_chain_tx_polarity_flip_physical{50.0}=0x0 -phy_chain_tx_polarity_flip_physical{51.0}=0x0 -phy_chain_tx_polarity_flip_physical{52.0}=0x1 -phy_chain_tx_polarity_flip_physical{53.0}=0x0 -phy_chain_tx_polarity_flip_physical{54.0}=0x1 -phy_chain_tx_polarity_flip_physical{55.0}=0x1 -phy_chain_tx_polarity_flip_physical{56.0}=0x0 -phy_chain_tx_polarity_flip_physical{57.0}=0x0 -phy_chain_tx_polarity_flip_physical{58.0}=0x1 -phy_chain_tx_polarity_flip_physical{59.0}=0x1 -phy_chain_tx_polarity_flip_physical{6.0}=0x1 -phy_chain_tx_polarity_flip_physical{60.0}=0x1 -phy_chain_tx_polarity_flip_physical{61.0}=0x0 -phy_chain_tx_polarity_flip_physical{62.0}=0x1 -phy_chain_tx_polarity_flip_physical{63.0}=0x1 -phy_chain_tx_polarity_flip_physical{64.0}=0x1 -phy_chain_tx_polarity_flip_physical{65.0}=0x0 -phy_chain_tx_polarity_flip_physical{66.0}=0x1 -phy_chain_tx_polarity_flip_physical{67.0}=0x1 -phy_chain_tx_polarity_flip_physical{68.0}=0x0 -phy_chain_tx_polarity_flip_physical{69.0}=0x1 -phy_chain_tx_polarity_flip_physical{7.0}=0x1 -phy_chain_tx_polarity_flip_physical{70.0}=0x1 -phy_chain_tx_polarity_flip_physical{71.0}=0x1 -phy_chain_tx_polarity_flip_physical{72.0}=0x0 -phy_chain_tx_polarity_flip_physical{73.0}=0x1 -phy_chain_tx_polarity_flip_physical{74.0}=0x0 -phy_chain_tx_polarity_flip_physical{75.0}=0x0 -phy_chain_tx_polarity_flip_physical{76.0}=0x0 -phy_chain_tx_polarity_flip_physical{77.0}=0x0 -phy_chain_tx_polarity_flip_physical{78.0}=0x0 -phy_chain_tx_polarity_flip_physical{79.0}=0x1 -phy_chain_tx_polarity_flip_physical{8.0}=0x0 -phy_chain_tx_polarity_flip_physical{80.0}=0x0 -phy_chain_tx_polarity_flip_physical{81.0}=0x1 -phy_chain_tx_polarity_flip_physical{82.0}=0x1 -phy_chain_tx_polarity_flip_physical{83.0}=0x1 -phy_chain_tx_polarity_flip_physical{84.0}=0x0 -phy_chain_tx_polarity_flip_physical{85.0}=0x1 -phy_chain_tx_polarity_flip_physical{86.0}=0x0 -phy_chain_tx_polarity_flip_physical{87.0}=0x0 -phy_chain_tx_polarity_flip_physical{88.0}=0x0 -phy_chain_tx_polarity_flip_physical{89.0}=0x1 -phy_chain_tx_polarity_flip_physical{9.0}=0x0 -phy_chain_tx_polarity_flip_physical{90.0}=0x1 -phy_chain_tx_polarity_flip_physical{91.0}=0x1 -phy_chain_tx_polarity_flip_physical{92.0}=0x0 -phy_chain_tx_polarity_flip_physical{93.0}=0x0 -phy_chain_tx_polarity_flip_physical{94.0}=0x0 -phy_chain_tx_polarity_flip_physical{95.0}=0x0 -phy_chain_tx_polarity_flip_physical{96.0}=0x0 -phy_chain_tx_polarity_flip_physical{97.0}=0x0 -phy_chain_tx_polarity_flip_physical{98.0}=0x1 -phy_chain_tx_polarity_flip_physical{99.0}=0x1 -port_init_autoneg_100=0 -port_init_autoneg_102=0 -port_init_autoneg_103=0 -port_init_autoneg_104=0 -port_init_autoneg_105=0 -port_init_autoneg_106=0 -port_init_autoneg_107=0 -port_init_autoneg_108=0 -port_init_autoneg_109=0 -port_init_autoneg_10=0 -port_init_autoneg_110=0 -port_init_autoneg_111=0 -port_init_autoneg_112=0 -port_init_autoneg_113=0 -port_init_autoneg_114=0 -port_init_autoneg_115=0 -port_init_autoneg_116=0 -port_init_autoneg_117=0 -port_init_autoneg_11=0 -port_init_autoneg_12=0 -port_init_autoneg_13=0 -port_init_autoneg_14=0 -port_init_autoneg_15=0 -port_init_autoneg_16=0 -port_init_autoneg_1=0 -port_init_autoneg_2=0 -port_init_autoneg_34=0 -port_init_autoneg_35=0 -port_init_autoneg_36=0 -port_init_autoneg_37=0 -port_init_autoneg_38=0 -port_init_autoneg_39=0 -port_init_autoneg_3=0 -port_init_autoneg_40=0 -port_init_autoneg_41=0 -port_init_autoneg_42=0 -port_init_autoneg_43=0 -port_init_autoneg_44=0 -port_init_autoneg_45=0 -port_init_autoneg_46=0 -port_init_autoneg_47=0 -port_init_autoneg_48=0 -port_init_autoneg_49=0 -port_init_autoneg_4=0 -port_init_autoneg_5=0 -port_init_autoneg_66=0 -port_init_autoneg_68=0 -port_init_autoneg_69=0 -port_init_autoneg_6=0 -port_init_autoneg_70=0 -port_init_autoneg_71=0 -port_init_autoneg_72=0 -port_init_autoneg_73=0 -port_init_autoneg_74=0 -port_init_autoneg_75=0 -port_init_autoneg_76=0 -port_init_autoneg_77=0 -port_init_autoneg_78=0 -port_init_autoneg_79=0 -port_init_autoneg_7=0 -port_init_autoneg_80=0 -port_init_autoneg_81=0 -port_init_autoneg_82=0 -port_init_autoneg_83=0 -port_init_autoneg_8=0 -port_init_autoneg_9=0 -port_init_cl72_hg=1 -port_phy_addr_100=0xff -port_phy_addr_102=0xff -port_phy_addr_103=0xff -port_phy_addr_104=0xff -port_phy_addr_105=0xff -port_phy_addr_106=0xff -port_phy_addr_107=0xff -port_phy_addr_108=0xff -port_phy_addr_109=0xff -port_phy_addr_10=0xff -port_phy_addr_110=0xff -port_phy_addr_111=0xff -port_phy_addr_112=0xff -port_phy_addr_113=0xff -port_phy_addr_114=0xff -port_phy_addr_115=0xff -port_phy_addr_116=0xff -port_phy_addr_117=0xff -port_phy_addr_11=0xff -port_phy_addr_12=0xff -port_phy_addr_13=0xff -port_phy_addr_14=0xff -port_phy_addr_15=0xff -port_phy_addr_16=0xff -port_phy_addr_1=0xff -port_phy_addr_2=0xff -port_phy_addr_34=0xff -port_phy_addr_35=0xff -port_phy_addr_36=0xff -port_phy_addr_37=0xff -port_phy_addr_38=0xff -port_phy_addr_39=0xff -port_phy_addr_3=0xff -port_phy_addr_40=0xff -port_phy_addr_41=0xff -port_phy_addr_42=0xff -port_phy_addr_43=0xff -port_phy_addr_44=0xff -port_phy_addr_45=0xff -port_phy_addr_46=0xff -port_phy_addr_47=0xff -port_phy_addr_48=0xff -port_phy_addr_49=0xff -port_phy_addr_4=0xff -port_phy_addr_5=0xff -port_phy_addr_66=0xff -port_phy_addr_68=0xff -port_phy_addr_69=0xff -port_phy_addr_6=0xff -port_phy_addr_70=0xff -port_phy_addr_71=0xff -port_phy_addr_72=0xff -port_phy_addr_73=0xff -port_phy_addr_74=0xff -port_phy_addr_75=0xff -port_phy_addr_76=0xff -port_phy_addr_77=0xff -port_phy_addr_78=0xff -port_phy_addr_79=0xff -port_phy_addr_7=0xff -port_phy_addr_80=0xff -port_phy_addr_81=0xff -port_phy_addr_82=0xff -port_phy_addr_83=0xff -port_phy_addr_8=0xff -port_phy_addr_9=0xff -portmap_100=259:10 -portmap_101=262:10 -portmap_102=217:100 -portmap_103=213:100 -portmap_104=229:100 -portmap_105=237:100 -portmap_106=249:100 -portmap_107=245:100 -portmap_108=209:100 -portmap_109=221:100 -portmap_10=29:100 -portmap_110=233:100 -portmap_111=225:100 -portmap_112=241:100 -portmap_113=253:100 -portmap_114=197:100 -portmap_115=205:100 -portmap_116=201:100 -portmap_117=193:100 -portmap_11=41:100 -portmap_12=33:100 -portmap_134=263:10 -portmap_13=57:100 -portmap_14=53:100 -portmap_15=49:100 -portmap_16=61:100 -portmap_1=5:100 -portmap_2=13:100 -portmap_33=260:10 -portmap_34=77:100 -portmap_35=65:100 -portmap_36=85:100 -portmap_37=89:100 -portmap_38=109:100 -portmap_39=97:100 -portmap_3=25:100 -portmap_40=69:100 -portmap_41=73:100 -portmap_42=93:100 -portmap_43=81:100 -portmap_44=101:100 -portmap_45=105:100 -portmap_46=117:100 -portmap_47=121:100 -portmap_48=125:100 -portmap_49=113:100 -portmap_4=21:100 -portmap_5=37:100 -portmap_66=257:10 -portmap_67=261:10 -portmap_68=149:100 -portmap_69=153:100 -portmap_6=45:100 -portmap_70=173:100 -portmap_71=161:100 -portmap_72=181:100 -portmap_73=185:100 -portmap_74=157:100 -portmap_75=145:100 -portmap_76=165:100 -portmap_77=169:100 -portmap_78=189:100 -portmap_79=177:100 -portmap_7=9:100 -portmap_80=141:100 -portmap_81=133:100 -portmap_82=129:100 -portmap_83=137:100 -portmap_8=1:100 -portmap_9=17:100 -robust_hash_disable_egress_vlan=1 -robust_hash_disable_mpls=1 -robust_hash_disable_vlan=1 -stable_size=0x5500000 -stable_size=0x5500000 -tdma_timeout_usec=15000000 -tslam_timeout_usec=15000000 - -# tuning parameters -serdes_preemphasis_1=0x184606 -serdes_preemphasis_2=0x164108 -serdes_preemphasis_3=0x164308 -serdes_preemphasis_4=0x144108 -serdes_preemphasis_5=0x144108 -serdes_preemphasis_6=0x164106 -serdes_preemphasis_7=0x184507 -serdes_preemphasis_8=0x184606 -serdes_preemphasis_9=0x184507 -serdes_preemphasis_10=0x194407 -serdes_preemphasis_11=0x194407 -serdes_preemphasis_12=0x184507 -serdes_preemphasis_13=0x144108 -serdes_preemphasis_14=0x144108 -serdes_preemphasis_15=0x194407 -serdes_preemphasis_16=0x194407 -serdes_preemphasis_34=0x184408 -serdes_preemphasis_35=0x184606 -serdes_preemphasis_36=0x164308 -serdes_preemphasis_37=0x184606 -serdes_preemphasis_38=0x164108 -serdes_preemphasis_39=0x184606 -serdes_preemphasis_40=0xe3206 -serdes_preemphasis_41=0xe3205 -serdes_preemphasis_42=0x103a06 -serdes_preemphasis_43=0xe3205 -serdes_preemphasis_44=0x184606 -serdes_preemphasis_45=0x184507 -serdes_preemphasis_46=0x144108 -serdes_preemphasis_47=0x103a07 -serdes_preemphasis_48=0x194407 -serdes_preemphasis_49=0x194407 -serdes_preemphasis_66=0x43004 -serdes_preemphasis_68=0x164308 -serdes_preemphasis_69=0x164408 -serdes_preemphasis_70=0xe3206 -serdes_preemphasis_71=0xe3205 -serdes_preemphasis_72=0xe3205 -serdes_preemphasis_73=0xe3206 -serdes_preemphasis_74=0x164108 -serdes_preemphasis_75=0x184606 -serdes_preemphasis_76=0x164608 -serdes_preemphasis_77=0x184507 -serdes_preemphasis_78=0x184507 -serdes_preemphasis_79=0x184606 -serdes_preemphasis_80=0x184606 -serdes_preemphasis_81=0x184407 -serdes_preemphasis_82=0x103706 -serdes_preemphasis_83=0x103706 -serdes_preemphasis_100=0x43004 -serdes_preemphasis_102=0x184408 -serdes_preemphasis_103=0x184606 -serdes_preemphasis_104=0x184606 -serdes_preemphasis_105=0x16410a -serdes_preemphasis_106=0x184408 -serdes_preemphasis_107=0x194308 -serdes_preemphasis_108=0x144108 -serdes_preemphasis_109=0x144108 -serdes_preemphasis_110=0x144108 -serdes_preemphasis_111=0x144108 -serdes_preemphasis_112=0x164608 -serdes_preemphasis_113=0x164608 -serdes_preemphasis_114=0x174507 -serdes_preemphasis_115=0x184606 -serdes_preemphasis_116=0x103706 -serdes_preemphasis_117=0x133c06 diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C10/BALANCED b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C10/BALANCED new file mode 120000 index 000000000000..a270c70ffc36 --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C10/BALANCED @@ -0,0 +1 @@ +../../../common/profiles/th2/7260/BALANCED \ No newline at end of file diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C10/RDMA-CENTRIC b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C10/RDMA-CENTRIC new file mode 120000 index 000000000000..8d1ec6d277a8 --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C10/RDMA-CENTRIC @@ -0,0 +1 @@ +../../../common/profiles/th2/7260/RDMA-CENTRIC \ No newline at end of file diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C10/TCP-CENTRIC b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C10/TCP-CENTRIC new file mode 120000 index 000000000000..7ee783aac6a4 --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C10/TCP-CENTRIC @@ -0,0 +1 @@ +../../../common/profiles/th2/7260/TCP-CENTRIC \ No newline at end of file diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C10/buffer_ports_t0.j2 b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C10/buffer_ports_t0.j2 new file mode 100644 index 000000000000..a6506c3c30dd --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C10/buffer_ports_t0.j2 @@ -0,0 +1,17 @@ +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {%- for port_idx in range(2,12) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{%- endif %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 2)) %}{%- endif %} + {%- endfor %} + {%- for port_idx in range(20,64) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{%- endif %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 2)) %}{%- endif %} + {%- endfor %} + {%- for port_idx in range(0,2) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{%- endif %} + {%- endfor %} + {%- for port_idx in range(12,20) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{%- endif %} + {%- endfor %} +{%- endmacro %} diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C10/buffers.json.j2 b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C10/buffers.json.j2 new file mode 100644 index 000000000000..e6e9e844469b --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C10/buffers.json.j2 @@ -0,0 +1,3 @@ +{%- set default_topo = 't0' %} +{%- include 'buffers_config.j2' %} + diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C10/buffers_defaults_t0.j2 b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C10/buffers_defaults_t0.j2 new file mode 120000 index 000000000000..9524e6a476ac --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C10/buffers_defaults_t0.j2 @@ -0,0 +1 @@ +BALANCED/buffers_defaults_t0.j2 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C10/buffers_extra_queues.j2 b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C10/buffers_extra_queues.j2 new file mode 120000 index 000000000000..92b7e9ffbee5 --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C10/buffers_extra_queues.j2 @@ -0,0 +1 @@ +../Arista-7260CX3-C64/buffers_extra_queues.j2 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C10/buffers_pool_sizes_t0.j2 b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C10/buffers_pool_sizes_t0.j2 new file mode 120000 index 000000000000..72e16a608268 --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C10/buffers_pool_sizes_t0.j2 @@ -0,0 +1 @@ +../Arista-7260CX3-C64/buffers_pool_sizes_t0.j2 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C10/config.bcm.j2 b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C10/config.bcm.j2 new file mode 100644 index 000000000000..2255d7149b6b --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C10/config.bcm.j2 @@ -0,0 +1,951 @@ +{# Construct config.bcm to include additional soc properties per specific device metadata requirement #} +{%- set IPinIP_sock = '' -%} +{%- set map_prio = '' -%} +{%- if DEVICE_METADATA is defined and DEVICE_METADATA['localhost'] is defined and DEVICE_METADATA['localhost']['subtype'] is defined -%} +{%- set switch_subtype = DEVICE_METADATA['localhost']['subtype'] -%} +{%- if 'dualtor' in switch_subtype.lower() %} +{%- set IPinIP_sock = 'sai_tunnel_support=1 + sai_tunnel_underlay_route_mode=1 + host_as_route_disable=1 + l3_ecmp_levels=2' -%} +{%- set map_prio = 'sai_remap_prio_on_tnl_egress=1' -%} +{%- endif %} +{%- endif %} +{# The following is the common soc properties that used to be named "th2-a7260cx3-64-112x50G+8x100G.config.bcm" #} +l3_alpm_hit_skip=1 +sai_adjust_acl_drop_in_rx_drop=1 +{{ map_prio }} +PHY_AN_ALLOW_PLL_CHANGE=1 +arl_clean_timeout_usec=15000000 +asf_mem_profile=2 +bcm_num_cos=10 +bcm_stat_flags=1 +bcm_stat_jumbo=9236 +cdma_timeout_usec=15000000 +core_clock_frequency=1700 +dma_desc_timeout_usec=15000000 +dpp_clock_ratio=2:3 +higig2_hdr_mode=1 +ipv6_lpm_128b_enable=1 +l3_alpm_enable=2 +lpm_scaling_enable=0 +l2xmsg_mode=1 +max_vp_lags=0 +mem_scan_enable=1 +miim_intr_enable=0 +module_64ports=1 +os=unix +oversubscribe_mode=1 +pbmp_xport_xe=0xfffffffd3fffffff4fffffffc7ffffffe +#pbmp_xport_xe=0x47fffffff1fffffffcfffffffe7ffffffe +phy_an_allow_pll_change_hg=0 +phy_an_c73=1 +phy_chain_rx_lane_map_physical{1.0}=0x3210 +phy_chain_rx_lane_map_physical{101.0}=0x0123 +phy_chain_rx_lane_map_physical{105.0}=0x0123 +phy_chain_rx_lane_map_physical{109.0}=0x0123 +phy_chain_rx_lane_map_physical{113.0}=0x2301 +phy_chain_rx_lane_map_physical{117.0}=0x3210 +phy_chain_rx_lane_map_physical{121.0}=0x3210 +phy_chain_rx_lane_map_physical{125.0}=0x1203 +phy_chain_rx_lane_map_physical{129.0}=0x3210 +phy_chain_rx_lane_map_physical{13.0}=0x0321 +phy_chain_rx_lane_map_physical{133.0}=0x1032 +phy_chain_rx_lane_map_physical{137.0}=0x3210 +phy_chain_rx_lane_map_physical{141.0}=0x0123 +phy_chain_rx_lane_map_physical{145.0}=0x3210 +phy_chain_rx_lane_map_physical{149.0}=0x2310 +phy_chain_rx_lane_map_physical{153.0}=0x0132 +phy_chain_rx_lane_map_physical{157.0}=0x1302 +phy_chain_rx_lane_map_physical{161.0}=0x3021 +phy_chain_rx_lane_map_physical{165.0}=0x2031 +phy_chain_rx_lane_map_physical{169.0}=0x2031 +phy_chain_rx_lane_map_physical{17.0}=0x3210 +phy_chain_rx_lane_map_physical{173.0}=0x1302 +phy_chain_rx_lane_map_physical{177.0}=0x2031 +phy_chain_rx_lane_map_physical{181.0}=0x0213 +phy_chain_rx_lane_map_physical{185.0}=0x0213 +phy_chain_rx_lane_map_physical{189.0}=0x1302 +phy_chain_rx_lane_map_physical{193.0}=0x3120 +phy_chain_rx_lane_map_physical{197.0}=0x0231 +phy_chain_rx_lane_map_physical{201.0}=0x2031 +phy_chain_rx_lane_map_physical{205.0}=0x0213 +phy_chain_rx_lane_map_physical{209.0}=0x2013 +phy_chain_rx_lane_map_physical{21.0}=0x3021 +phy_chain_rx_lane_map_physical{213.0}=0x3021 +phy_chain_rx_lane_map_physical{217.0}=0x0231 +phy_chain_rx_lane_map_physical{221.0}=0x2031 +phy_chain_rx_lane_map_physical{225.0}=0x1203 +phy_chain_rx_lane_map_physical{229.0}=0x1230 +phy_chain_rx_lane_map_physical{233.0}=0x3021 +phy_chain_rx_lane_map_physical{237.0}=0x1032 +phy_chain_rx_lane_map_physical{241.0}=0x2301 +phy_chain_rx_lane_map_physical{245.0}=0x0321 +phy_chain_rx_lane_map_physical{249.0}=0x2301 +phy_chain_rx_lane_map_physical{25.0}=0x2301 +phy_chain_rx_lane_map_physical{253.0}=0x2301 +phy_chain_rx_lane_map_physical{257.0}=0x3210 +phy_chain_rx_lane_map_physical{29.0}=0x3021 +phy_chain_rx_lane_map_physical{33.0}=0x1302 +phy_chain_rx_lane_map_physical{37.0}=0x2031 +phy_chain_rx_lane_map_physical{41.0}=0x3021 +phy_chain_rx_lane_map_physical{45.0}=0x1023 +phy_chain_rx_lane_map_physical{49.0}=0x0213 +phy_chain_rx_lane_map_physical{5.0}=0x3201 +phy_chain_rx_lane_map_physical{53.0}=0x3201 +phy_chain_rx_lane_map_physical{57.0}=0x2013 +phy_chain_rx_lane_map_physical{61.0}=0x0213 +phy_chain_rx_lane_map_physical{65.0}=0x1203 +phy_chain_rx_lane_map_physical{69.0}=0x0213 +phy_chain_rx_lane_map_physical{73.0}=0x0213 +phy_chain_rx_lane_map_physical{77.0}=0x3120 +phy_chain_rx_lane_map_physical{81.0}=0x0213 +phy_chain_rx_lane_map_physical{85.0}=0x2031 +phy_chain_rx_lane_map_physical{89.0}=0x2031 +phy_chain_rx_lane_map_physical{9.0}=0x0321 +phy_chain_rx_lane_map_physical{93.0}=0x3120 +phy_chain_rx_lane_map_physical{97.0}=0x1203 +phy_chain_rx_polarity_flip_physical{1.0}=0x1 +phy_chain_rx_polarity_flip_physical{10.0}=0x0 +phy_chain_rx_polarity_flip_physical{100.0}=0x1 +phy_chain_rx_polarity_flip_physical{101.0}=0x1 +phy_chain_rx_polarity_flip_physical{102.0}=0x0 +phy_chain_rx_polarity_flip_physical{103.0}=0x1 +phy_chain_rx_polarity_flip_physical{104.0}=0x0 +phy_chain_rx_polarity_flip_physical{105.0}=0x1 +phy_chain_rx_polarity_flip_physical{106.0}=0x0 +phy_chain_rx_polarity_flip_physical{107.0}=0x1 +phy_chain_rx_polarity_flip_physical{108.0}=0x0 +phy_chain_rx_polarity_flip_physical{109.0}=0x0 +phy_chain_rx_polarity_flip_physical{11.0}=0x1 +phy_chain_rx_polarity_flip_physical{110.0}=0x1 +phy_chain_rx_polarity_flip_physical{111.0}=0x0 +phy_chain_rx_polarity_flip_physical{112.0}=0x1 +phy_chain_rx_polarity_flip_physical{113.0}=0x1 +phy_chain_rx_polarity_flip_physical{114.0}=0x0 +phy_chain_rx_polarity_flip_physical{115.0}=0x1 +phy_chain_rx_polarity_flip_physical{116.0}=0x0 +phy_chain_rx_polarity_flip_physical{117.0}=0x0 +phy_chain_rx_polarity_flip_physical{118.0}=0x0 +phy_chain_rx_polarity_flip_physical{119.0}=0x1 +phy_chain_rx_polarity_flip_physical{12.0}=0x1 +phy_chain_rx_polarity_flip_physical{120.0}=0x0 +phy_chain_rx_polarity_flip_physical{121.0}=0x1 +phy_chain_rx_polarity_flip_physical{122.0}=0x0 +phy_chain_rx_polarity_flip_physical{123.0}=0x1 +phy_chain_rx_polarity_flip_physical{124.0}=0x0 +phy_chain_rx_polarity_flip_physical{125.0}=0x0 +phy_chain_rx_polarity_flip_physical{126.0}=0x1 +phy_chain_rx_polarity_flip_physical{127.0}=0x1 +phy_chain_rx_polarity_flip_physical{128.0}=0x1 +phy_chain_rx_polarity_flip_physical{129.0}=0x0 +phy_chain_rx_polarity_flip_physical{13.0}=0x1 +phy_chain_rx_polarity_flip_physical{130.0}=0x1 +phy_chain_rx_polarity_flip_physical{131.0}=0x1 +phy_chain_rx_polarity_flip_physical{132.0}=0x0 +phy_chain_rx_polarity_flip_physical{133.0}=0x1 +phy_chain_rx_polarity_flip_physical{134.0}=0x1 +phy_chain_rx_polarity_flip_physical{135.0}=0x1 +phy_chain_rx_polarity_flip_physical{136.0}=0x0 +phy_chain_rx_polarity_flip_physical{137.0}=0x0 +phy_chain_rx_polarity_flip_physical{138.0}=0x0 +phy_chain_rx_polarity_flip_physical{139.0}=0x1 +phy_chain_rx_polarity_flip_physical{14.0}=0x0 +phy_chain_rx_polarity_flip_physical{140.0}=0x0 +phy_chain_rx_polarity_flip_physical{141.0}=0x1 +phy_chain_rx_polarity_flip_physical{142.0}=0x0 +phy_chain_rx_polarity_flip_physical{143.0}=0x1 +phy_chain_rx_polarity_flip_physical{144.0}=0x0 +phy_chain_rx_polarity_flip_physical{145.0}=0x1 +phy_chain_rx_polarity_flip_physical{146.0}=0x0 +phy_chain_rx_polarity_flip_physical{147.0}=0x1 +phy_chain_rx_polarity_flip_physical{148.0}=0x0 +phy_chain_rx_polarity_flip_physical{149.0}=0x0 +phy_chain_rx_polarity_flip_physical{15.0}=0x1 +phy_chain_rx_polarity_flip_physical{150.0}=0x1 +phy_chain_rx_polarity_flip_physical{151.0}=0x1 +phy_chain_rx_polarity_flip_physical{152.0}=0x0 +phy_chain_rx_polarity_flip_physical{153.0}=0x0 +phy_chain_rx_polarity_flip_physical{154.0}=0x1 +phy_chain_rx_polarity_flip_physical{155.0}=0x1 +phy_chain_rx_polarity_flip_physical{156.0}=0x0 +phy_chain_rx_polarity_flip_physical{157.0}=0x0 +phy_chain_rx_polarity_flip_physical{158.0}=0x0 +phy_chain_rx_polarity_flip_physical{159.0}=0x1 +phy_chain_rx_polarity_flip_physical{16.0}=0x0 +phy_chain_rx_polarity_flip_physical{160.0}=0x0 +phy_chain_rx_polarity_flip_physical{161.0}=0x1 +phy_chain_rx_polarity_flip_physical{162.0}=0x1 +phy_chain_rx_polarity_flip_physical{163.0}=0x0 +phy_chain_rx_polarity_flip_physical{164.0}=0x1 +phy_chain_rx_polarity_flip_physical{165.0}=0x0 +phy_chain_rx_polarity_flip_physical{166.0}=0x0 +phy_chain_rx_polarity_flip_physical{167.0}=0x1 +phy_chain_rx_polarity_flip_physical{168.0}=0x1 +phy_chain_rx_polarity_flip_physical{169.0}=0x1 +phy_chain_rx_polarity_flip_physical{17.0}=0x1 +phy_chain_rx_polarity_flip_physical{170.0}=0x1 +phy_chain_rx_polarity_flip_physical{171.0}=0x0 +phy_chain_rx_polarity_flip_physical{172.0}=0x0 +phy_chain_rx_polarity_flip_physical{173.0}=0x0 +phy_chain_rx_polarity_flip_physical{174.0}=0x0 +phy_chain_rx_polarity_flip_physical{175.0}=0x1 +phy_chain_rx_polarity_flip_physical{176.0}=0x1 +phy_chain_rx_polarity_flip_physical{177.0}=0x1 +phy_chain_rx_polarity_flip_physical{178.0}=0x1 +phy_chain_rx_polarity_flip_physical{179.0}=0x0 +phy_chain_rx_polarity_flip_physical{18.0}=0x0 +phy_chain_rx_polarity_flip_physical{180.0}=0x0 +phy_chain_rx_polarity_flip_physical{181.0}=0x1 +phy_chain_rx_polarity_flip_physical{182.0}=0x1 +phy_chain_rx_polarity_flip_physical{183.0}=0x0 +phy_chain_rx_polarity_flip_physical{184.0}=0x0 +phy_chain_rx_polarity_flip_physical{185.0}=0x0 +phy_chain_rx_polarity_flip_physical{186.0}=0x0 +phy_chain_rx_polarity_flip_physical{187.0}=0x1 +phy_chain_rx_polarity_flip_physical{188.0}=0x1 +phy_chain_rx_polarity_flip_physical{189.0}=0x0 +phy_chain_rx_polarity_flip_physical{19.0}=0x1 +phy_chain_rx_polarity_flip_physical{190.0}=0x0 +phy_chain_rx_polarity_flip_physical{191.0}=0x1 +phy_chain_rx_polarity_flip_physical{192.0}=0x0 +phy_chain_rx_polarity_flip_physical{193.0}=0x0 +phy_chain_rx_polarity_flip_physical{194.0}=0x0 +phy_chain_rx_polarity_flip_physical{195.0}=0x1 +phy_chain_rx_polarity_flip_physical{196.0}=0x1 +phy_chain_rx_polarity_flip_physical{197.0}=0x1 +phy_chain_rx_polarity_flip_physical{198.0}=0x1 +phy_chain_rx_polarity_flip_physical{199.0}=0x0 +phy_chain_rx_polarity_flip_physical{2.0}=0x0 +phy_chain_rx_polarity_flip_physical{20.0}=0x0 +phy_chain_rx_polarity_flip_physical{200.0}=0x0 +phy_chain_rx_polarity_flip_physical{201.0}=0x0 +phy_chain_rx_polarity_flip_physical{202.0}=0x0 +phy_chain_rx_polarity_flip_physical{203.0}=0x1 +phy_chain_rx_polarity_flip_physical{204.0}=0x0 +phy_chain_rx_polarity_flip_physical{205.0}=0x1 +phy_chain_rx_polarity_flip_physical{206.0}=0x1 +phy_chain_rx_polarity_flip_physical{207.0}=0x0 +phy_chain_rx_polarity_flip_physical{208.0}=0x0 +phy_chain_rx_polarity_flip_physical{209.0}=0x1 +phy_chain_rx_polarity_flip_physical{21.0}=0x0 +phy_chain_rx_polarity_flip_physical{210.0}=0x1 +phy_chain_rx_polarity_flip_physical{211.0}=0x0 +phy_chain_rx_polarity_flip_physical{212.0}=0x0 +phy_chain_rx_polarity_flip_physical{213.0}=0x0 +phy_chain_rx_polarity_flip_physical{214.0}=0x0 +phy_chain_rx_polarity_flip_physical{215.0}=0x1 +phy_chain_rx_polarity_flip_physical{216.0}=0x0 +phy_chain_rx_polarity_flip_physical{217.0}=0x0 +phy_chain_rx_polarity_flip_physical{218.0}=0x0 +phy_chain_rx_polarity_flip_physical{219.0}=0x1 +phy_chain_rx_polarity_flip_physical{22.0}=0x0 +phy_chain_rx_polarity_flip_physical{220.0}=0x1 +phy_chain_rx_polarity_flip_physical{221.0}=0x0 +phy_chain_rx_polarity_flip_physical{222.0}=0x0 +phy_chain_rx_polarity_flip_physical{223.0}=0x1 +phy_chain_rx_polarity_flip_physical{224.0}=0x1 +phy_chain_rx_polarity_flip_physical{225.0}=0x1 +phy_chain_rx_polarity_flip_physical{226.0}=0x0 +phy_chain_rx_polarity_flip_physical{227.0}=0x0 +phy_chain_rx_polarity_flip_physical{228.0}=0x1 +phy_chain_rx_polarity_flip_physical{229.0}=0x0 +phy_chain_rx_polarity_flip_physical{23.0}=0x1 +phy_chain_rx_polarity_flip_physical{230.0}=0x0 +phy_chain_rx_polarity_flip_physical{231.0}=0x1 +phy_chain_rx_polarity_flip_physical{232.0}=0x1 +phy_chain_rx_polarity_flip_physical{233.0}=0x1 +phy_chain_rx_polarity_flip_physical{234.0}=0x0 +phy_chain_rx_polarity_flip_physical{235.0}=0x0 +phy_chain_rx_polarity_flip_physical{236.0}=0x0 +phy_chain_rx_polarity_flip_physical{237.0}=0x1 +phy_chain_rx_polarity_flip_physical{238.0}=0x0 +phy_chain_rx_polarity_flip_physical{239.0}=0x1 +phy_chain_rx_polarity_flip_physical{24.0}=0x0 +phy_chain_rx_polarity_flip_physical{240.0}=0x0 +phy_chain_rx_polarity_flip_physical{241.0}=0x1 +phy_chain_rx_polarity_flip_physical{242.0}=0x0 +phy_chain_rx_polarity_flip_physical{243.0}=0x1 +phy_chain_rx_polarity_flip_physical{244.0}=0x0 +phy_chain_rx_polarity_flip_physical{245.0}=0x1 +phy_chain_rx_polarity_flip_physical{246.0}=0x1 +phy_chain_rx_polarity_flip_physical{247.0}=0x1 +phy_chain_rx_polarity_flip_physical{248.0}=0x0 +phy_chain_rx_polarity_flip_physical{249.0}=0x0 +phy_chain_rx_polarity_flip_physical{25.0}=0x1 +phy_chain_rx_polarity_flip_physical{250.0}=0x1 +phy_chain_rx_polarity_flip_physical{251.0}=0x0 +phy_chain_rx_polarity_flip_physical{252.0}=0x1 +phy_chain_rx_polarity_flip_physical{253.0}=0x1 +phy_chain_rx_polarity_flip_physical{254.0}=0x0 +phy_chain_rx_polarity_flip_physical{255.0}=0x1 +phy_chain_rx_polarity_flip_physical{256.0}=0x0 +phy_chain_rx_polarity_flip_physical{257.0}=0x0 +phy_chain_rx_polarity_flip_physical{259.0}=0x0 +phy_chain_rx_polarity_flip_physical{26.0}=0x0 +phy_chain_rx_polarity_flip_physical{27.0}=0x1 +phy_chain_rx_polarity_flip_physical{28.0}=0x0 +phy_chain_rx_polarity_flip_physical{29.0}=0x0 +phy_chain_rx_polarity_flip_physical{3.0}=0x1 +phy_chain_rx_polarity_flip_physical{30.0}=0x0 +phy_chain_rx_polarity_flip_physical{31.0}=0x0 +phy_chain_rx_polarity_flip_physical{32.0}=0x1 +phy_chain_rx_polarity_flip_physical{33.0}=0x0 +phy_chain_rx_polarity_flip_physical{34.0}=0x0 +phy_chain_rx_polarity_flip_physical{35.0}=0x1 +phy_chain_rx_polarity_flip_physical{36.0}=0x1 +phy_chain_rx_polarity_flip_physical{37.0}=0x1 +phy_chain_rx_polarity_flip_physical{38.0}=0x1 +phy_chain_rx_polarity_flip_physical{39.0}=0x0 +phy_chain_rx_polarity_flip_physical{4.0}=0x0 +phy_chain_rx_polarity_flip_physical{40.0}=0x0 +phy_chain_rx_polarity_flip_physical{41.0}=0x0 +phy_chain_rx_polarity_flip_physical{42.0}=0x1 +phy_chain_rx_polarity_flip_physical{43.0}=0x1 +phy_chain_rx_polarity_flip_physical{44.0}=0x1 +phy_chain_rx_polarity_flip_physical{45.0}=0x1 +phy_chain_rx_polarity_flip_physical{46.0}=0x0 +phy_chain_rx_polarity_flip_physical{47.0}=0x0 +phy_chain_rx_polarity_flip_physical{48.0}=0x1 +phy_chain_rx_polarity_flip_physical{49.0}=0x1 +phy_chain_rx_polarity_flip_physical{5.0}=0x1 +phy_chain_rx_polarity_flip_physical{50.0}=0x1 +phy_chain_rx_polarity_flip_physical{51.0}=0x0 +phy_chain_rx_polarity_flip_physical{52.0}=0x0 +phy_chain_rx_polarity_flip_physical{53.0}=0x0 +phy_chain_rx_polarity_flip_physical{54.0}=0x0 +phy_chain_rx_polarity_flip_physical{55.0}=0x1 +phy_chain_rx_polarity_flip_physical{56.0}=0x0 +phy_chain_rx_polarity_flip_physical{57.0}=0x0 +phy_chain_rx_polarity_flip_physical{58.0}=0x0 +phy_chain_rx_polarity_flip_physical{59.0}=0x1 +phy_chain_rx_polarity_flip_physical{6.0}=0x0 +phy_chain_rx_polarity_flip_physical{60.0}=0x1 +phy_chain_rx_polarity_flip_physical{61.0}=0x0 +phy_chain_rx_polarity_flip_physical{62.0}=0x0 +phy_chain_rx_polarity_flip_physical{63.0}=0x1 +phy_chain_rx_polarity_flip_physical{64.0}=0x1 +phy_chain_rx_polarity_flip_physical{65.0}=0x1 +phy_chain_rx_polarity_flip_physical{66.0}=0x1 +phy_chain_rx_polarity_flip_physical{67.0}=0x0 +phy_chain_rx_polarity_flip_physical{68.0}=0x1 +phy_chain_rx_polarity_flip_physical{69.0}=0x0 +phy_chain_rx_polarity_flip_physical{7.0}=0x0 +phy_chain_rx_polarity_flip_physical{70.0}=0x0 +phy_chain_rx_polarity_flip_physical{71.0}=0x1 +phy_chain_rx_polarity_flip_physical{72.0}=0x1 +phy_chain_rx_polarity_flip_physical{73.0}=0x1 +phy_chain_rx_polarity_flip_physical{74.0}=0x1 +phy_chain_rx_polarity_flip_physical{75.0}=0x0 +phy_chain_rx_polarity_flip_physical{76.0}=0x0 +phy_chain_rx_polarity_flip_physical{77.0}=0x0 +phy_chain_rx_polarity_flip_physical{78.0}=0x0 +phy_chain_rx_polarity_flip_physical{79.0}=0x1 +phy_chain_rx_polarity_flip_physical{8.0}=0x1 +phy_chain_rx_polarity_flip_physical{80.0}=0x1 +phy_chain_rx_polarity_flip_physical{81.0}=0x1 +phy_chain_rx_polarity_flip_physical{82.0}=0x1 +phy_chain_rx_polarity_flip_physical{83.0}=0x0 +phy_chain_rx_polarity_flip_physical{84.0}=0x0 +phy_chain_rx_polarity_flip_physical{85.0}=0x1 +phy_chain_rx_polarity_flip_physical{86.0}=0x1 +phy_chain_rx_polarity_flip_physical{87.0}=0x0 +phy_chain_rx_polarity_flip_physical{88.0}=0x0 +phy_chain_rx_polarity_flip_physical{89.0}=0x0 +phy_chain_rx_polarity_flip_physical{9.0}=0x1 +phy_chain_rx_polarity_flip_physical{90.0}=0x0 +phy_chain_rx_polarity_flip_physical{91.0}=0x1 +phy_chain_rx_polarity_flip_physical{92.0}=0x1 +phy_chain_rx_polarity_flip_physical{93.0}=0x0 +phy_chain_rx_polarity_flip_physical{94.0}=0x0 +phy_chain_rx_polarity_flip_physical{95.0}=0x1 +phy_chain_rx_polarity_flip_physical{96.0}=0x0 +phy_chain_rx_polarity_flip_physical{97.0}=0x1 +phy_chain_rx_polarity_flip_physical{98.0}=0x1 +phy_chain_rx_polarity_flip_physical{99.0}=0x0 +phy_chain_tx_lane_map_physical{1.0}=0x2031 +phy_chain_tx_lane_map_physical{101.0}=0x1023 +phy_chain_tx_lane_map_physical{105.0}=0x1302 +phy_chain_tx_lane_map_physical{109.0}=0x0321 +phy_chain_tx_lane_map_physical{113.0}=0x2301 +phy_chain_tx_lane_map_physical{117.0}=0x3120 +phy_chain_tx_lane_map_physical{121.0}=0x3102 +phy_chain_tx_lane_map_physical{125.0}=0x3210 +phy_chain_tx_lane_map_physical{129.0}=0x1023 +phy_chain_tx_lane_map_physical{13.0}=0x3021 +phy_chain_tx_lane_map_physical{133.0}=0x3210 +phy_chain_tx_lane_map_physical{137.0}=0x2031 +phy_chain_tx_lane_map_physical{141.0}=0x1302 +phy_chain_tx_lane_map_physical{145.0}=0x3210 +phy_chain_tx_lane_map_physical{149.0}=0x0213 +phy_chain_tx_lane_map_physical{153.0}=0x3210 +phy_chain_tx_lane_map_physical{157.0}=0x1320 +phy_chain_tx_lane_map_physical{161.0}=0x3210 +phy_chain_tx_lane_map_physical{165.0}=0x0231 +phy_chain_tx_lane_map_physical{169.0}=0x3120 +phy_chain_tx_lane_map_physical{17.0}=0x1032 +phy_chain_tx_lane_map_physical{173.0}=0x0312 +phy_chain_tx_lane_map_physical{177.0}=0x0231 +phy_chain_tx_lane_map_physical{181.0}=0x3210 +phy_chain_tx_lane_map_physical{185.0}=0x3210 +phy_chain_tx_lane_map_physical{189.0}=0x1320 +phy_chain_tx_lane_map_physical{193.0}=0x0321 +phy_chain_tx_lane_map_physical{197.0}=0x3120 +phy_chain_tx_lane_map_physical{201.0}=0x3120 +phy_chain_tx_lane_map_physical{205.0}=0x0123 +phy_chain_tx_lane_map_physical{209.0}=0x3120 +phy_chain_tx_lane_map_physical{21.0}=0x0213 +phy_chain_tx_lane_map_physical{213.0}=0x3021 +phy_chain_tx_lane_map_physical{217.0}=0x0312 +phy_chain_tx_lane_map_physical{221.0}=0x2301 +phy_chain_tx_lane_map_physical{225.0}=0x0123 +phy_chain_tx_lane_map_physical{229.0}=0x2031 +phy_chain_tx_lane_map_physical{233.0}=0x0231 +phy_chain_tx_lane_map_physical{237.0}=0x0213 +phy_chain_tx_lane_map_physical{241.0}=0x1320 +phy_chain_tx_lane_map_physical{245.0}=0x2031 +phy_chain_tx_lane_map_physical{249.0}=0x3120 +phy_chain_tx_lane_map_physical{25.0}=0x0231 +phy_chain_tx_lane_map_physical{253.0}=0x0321 +phy_chain_tx_lane_map_physical{257.0}=0x3210 +phy_chain_tx_lane_map_physical{29.0}=0x1230 +phy_chain_tx_lane_map_physical{33.0}=0x1032 +phy_chain_tx_lane_map_physical{37.0}=0x0123 +phy_chain_tx_lane_map_physical{41.0}=0x0213 +phy_chain_tx_lane_map_physical{45.0}=0x0132 +phy_chain_tx_lane_map_physical{49.0}=0x2031 +phy_chain_tx_lane_map_physical{5.0}=0x2301 +phy_chain_tx_lane_map_physical{53.0}=0x2301 +phy_chain_tx_lane_map_physical{57.0}=0x2031 +phy_chain_tx_lane_map_physical{61.0}=0x2031 +phy_chain_tx_lane_map_physical{65.0}=0x1230 +phy_chain_tx_lane_map_physical{69.0}=0x2013 +phy_chain_tx_lane_map_physical{73.0}=0x0213 +phy_chain_tx_lane_map_physical{77.0}=0x2310 +phy_chain_tx_lane_map_physical{81.0}=0x0321 +phy_chain_tx_lane_map_physical{85.0}=0x2013 +phy_chain_tx_lane_map_physical{89.0}=0x0213 +phy_chain_tx_lane_map_physical{9.0}=0x3012 +phy_chain_tx_lane_map_physical{93.0}=0x3102 +phy_chain_tx_lane_map_physical{97.0}=0x3210 +phy_chain_tx_polarity_flip_physical{1.0}=0x0 +phy_chain_tx_polarity_flip_physical{10.0}=0x1 +phy_chain_tx_polarity_flip_physical{100.0}=0x0 +phy_chain_tx_polarity_flip_physical{101.0}=0x0 +phy_chain_tx_polarity_flip_physical{102.0}=0x1 +phy_chain_tx_polarity_flip_physical{103.0}=0x0 +phy_chain_tx_polarity_flip_physical{104.0}=0x0 +phy_chain_tx_polarity_flip_physical{105.0}=0x0 +phy_chain_tx_polarity_flip_physical{106.0}=0x1 +phy_chain_tx_polarity_flip_physical{107.0}=0x1 +phy_chain_tx_polarity_flip_physical{108.0}=0x1 +phy_chain_tx_polarity_flip_physical{109.0}=0x0 +phy_chain_tx_polarity_flip_physical{11.0}=0x1 +phy_chain_tx_polarity_flip_physical{110.0}=0x0 +phy_chain_tx_polarity_flip_physical{111.0}=0x0 +phy_chain_tx_polarity_flip_physical{112.0}=0x1 +phy_chain_tx_polarity_flip_physical{113.0}=0x1 +phy_chain_tx_polarity_flip_physical{114.0}=0x1 +phy_chain_tx_polarity_flip_physical{115.0}=0x1 +phy_chain_tx_polarity_flip_physical{116.0}=0x0 +phy_chain_tx_polarity_flip_physical{117.0}=0x1 +phy_chain_tx_polarity_flip_physical{118.0}=0x0 +phy_chain_tx_polarity_flip_physical{119.0}=0x0 +phy_chain_tx_polarity_flip_physical{12.0}=0x0 +phy_chain_tx_polarity_flip_physical{120.0}=0x0 +phy_chain_tx_polarity_flip_physical{121.0}=0x0 +phy_chain_tx_polarity_flip_physical{122.0}=0x0 +phy_chain_tx_polarity_flip_physical{123.0}=0x0 +phy_chain_tx_polarity_flip_physical{124.0}=0x1 +phy_chain_tx_polarity_flip_physical{125.0}=0x0 +phy_chain_tx_polarity_flip_physical{126.0}=0x1 +phy_chain_tx_polarity_flip_physical{127.0}=0x1 +phy_chain_tx_polarity_flip_physical{128.0}=0x1 +phy_chain_tx_polarity_flip_physical{129.0}=0x1 +phy_chain_tx_polarity_flip_physical{13.0}=0x0 +phy_chain_tx_polarity_flip_physical{130.0}=0x0 +phy_chain_tx_polarity_flip_physical{131.0}=0x1 +phy_chain_tx_polarity_flip_physical{132.0}=0x0 +phy_chain_tx_polarity_flip_physical{133.0}=0x1 +phy_chain_tx_polarity_flip_physical{134.0}=0x1 +phy_chain_tx_polarity_flip_physical{135.0}=0x1 +phy_chain_tx_polarity_flip_physical{136.0}=0x1 +phy_chain_tx_polarity_flip_physical{137.0}=0x1 +phy_chain_tx_polarity_flip_physical{138.0}=0x1 +phy_chain_tx_polarity_flip_physical{139.0}=0x1 +phy_chain_tx_polarity_flip_physical{14.0}=0x1 +phy_chain_tx_polarity_flip_physical{140.0}=0x1 +phy_chain_tx_polarity_flip_physical{141.0}=0x0 +phy_chain_tx_polarity_flip_physical{142.0}=0x1 +phy_chain_tx_polarity_flip_physical{143.0}=0x1 +phy_chain_tx_polarity_flip_physical{144.0}=0x1 +phy_chain_tx_polarity_flip_physical{145.0}=0x1 +phy_chain_tx_polarity_flip_physical{146.0}=0x1 +phy_chain_tx_polarity_flip_physical{147.0}=0x1 +phy_chain_tx_polarity_flip_physical{148.0}=0x0 +phy_chain_tx_polarity_flip_physical{149.0}=0x1 +phy_chain_tx_polarity_flip_physical{15.0}=0x0 +phy_chain_tx_polarity_flip_physical{150.0}=0x0 +phy_chain_tx_polarity_flip_physical{151.0}=0x0 +phy_chain_tx_polarity_flip_physical{152.0}=0x0 +phy_chain_tx_polarity_flip_physical{153.0}=0x1 +phy_chain_tx_polarity_flip_physical{154.0}=0x0 +phy_chain_tx_polarity_flip_physical{155.0}=0x0 +phy_chain_tx_polarity_flip_physical{156.0}=0x0 +phy_chain_tx_polarity_flip_physical{157.0}=0x0 +phy_chain_tx_polarity_flip_physical{158.0}=0x0 +phy_chain_tx_polarity_flip_physical{159.0}=0x0 +phy_chain_tx_polarity_flip_physical{16.0}=0x0 +phy_chain_tx_polarity_flip_physical{160.0}=0x0 +phy_chain_tx_polarity_flip_physical{161.0}=0x0 +phy_chain_tx_polarity_flip_physical{162.0}=0x1 +phy_chain_tx_polarity_flip_physical{163.0}=0x1 +phy_chain_tx_polarity_flip_physical{164.0}=0x0 +phy_chain_tx_polarity_flip_physical{165.0}=0x1 +phy_chain_tx_polarity_flip_physical{166.0}=0x1 +phy_chain_tx_polarity_flip_physical{167.0}=0x1 +phy_chain_tx_polarity_flip_physical{168.0}=0x0 +phy_chain_tx_polarity_flip_physical{169.0}=0x0 +phy_chain_tx_polarity_flip_physical{17.0}=0x0 +phy_chain_tx_polarity_flip_physical{170.0}=0x1 +phy_chain_tx_polarity_flip_physical{171.0}=0x1 +phy_chain_tx_polarity_flip_physical{172.0}=0x1 +phy_chain_tx_polarity_flip_physical{173.0}=0x0 +phy_chain_tx_polarity_flip_physical{174.0}=0x0 +phy_chain_tx_polarity_flip_physical{175.0}=0x1 +phy_chain_tx_polarity_flip_physical{176.0}=0x0 +phy_chain_tx_polarity_flip_physical{177.0}=0x1 +phy_chain_tx_polarity_flip_physical{178.0}=0x0 +phy_chain_tx_polarity_flip_physical{179.0}=0x0 +phy_chain_tx_polarity_flip_physical{18.0}=0x1 +phy_chain_tx_polarity_flip_physical{180.0}=0x0 +phy_chain_tx_polarity_flip_physical{181.0}=0x0 +phy_chain_tx_polarity_flip_physical{182.0}=0x0 +phy_chain_tx_polarity_flip_physical{183.0}=0x0 +phy_chain_tx_polarity_flip_physical{184.0}=0x1 +phy_chain_tx_polarity_flip_physical{185.0}=0x0 +phy_chain_tx_polarity_flip_physical{186.0}=0x1 +phy_chain_tx_polarity_flip_physical{187.0}=0x1 +phy_chain_tx_polarity_flip_physical{188.0}=0x1 +phy_chain_tx_polarity_flip_physical{189.0}=0x0 +phy_chain_tx_polarity_flip_physical{19.0}=0x1 +phy_chain_tx_polarity_flip_physical{190.0}=0x0 +phy_chain_tx_polarity_flip_physical{191.0}=0x0 +phy_chain_tx_polarity_flip_physical{192.0}=0x0 +phy_chain_tx_polarity_flip_physical{193.0}=0x1 +phy_chain_tx_polarity_flip_physical{194.0}=0x1 +phy_chain_tx_polarity_flip_physical{195.0}=0x1 +phy_chain_tx_polarity_flip_physical{196.0}=0x0 +phy_chain_tx_polarity_flip_physical{197.0}=0x0 +phy_chain_tx_polarity_flip_physical{198.0}=0x1 +phy_chain_tx_polarity_flip_physical{199.0}=0x1 +phy_chain_tx_polarity_flip_physical{2.0}=0x1 +phy_chain_tx_polarity_flip_physical{20.0}=0x1 +phy_chain_tx_polarity_flip_physical{200.0}=0x1 +phy_chain_tx_polarity_flip_physical{201.0}=0x1 +phy_chain_tx_polarity_flip_physical{202.0}=0x1 +phy_chain_tx_polarity_flip_physical{203.0}=0x1 +phy_chain_tx_polarity_flip_physical{204.0}=0x1 +phy_chain_tx_polarity_flip_physical{205.0}=0x0 +phy_chain_tx_polarity_flip_physical{206.0}=0x1 +phy_chain_tx_polarity_flip_physical{207.0}=0x1 +phy_chain_tx_polarity_flip_physical{208.0}=0x1 +phy_chain_tx_polarity_flip_physical{209.0}=0x1 +phy_chain_tx_polarity_flip_physical{21.0}=0x0 +phy_chain_tx_polarity_flip_physical{210.0}=0x1 +phy_chain_tx_polarity_flip_physical{211.0}=0x1 +phy_chain_tx_polarity_flip_physical{212.0}=0x0 +phy_chain_tx_polarity_flip_physical{213.0}=0x0 +phy_chain_tx_polarity_flip_physical{214.0}=0x1 +phy_chain_tx_polarity_flip_physical{215.0}=0x0 +phy_chain_tx_polarity_flip_physical{216.0}=0x1 +phy_chain_tx_polarity_flip_physical{217.0}=0x1 +phy_chain_tx_polarity_flip_physical{218.0}=0x1 +phy_chain_tx_polarity_flip_physical{219.0}=0x0 +phy_chain_tx_polarity_flip_physical{22.0}=0x0 +phy_chain_tx_polarity_flip_physical{220.0}=0x1 +phy_chain_tx_polarity_flip_physical{221.0}=0x0 +phy_chain_tx_polarity_flip_physical{222.0}=0x0 +phy_chain_tx_polarity_flip_physical{223.0}=0x0 +phy_chain_tx_polarity_flip_physical{224.0}=0x1 +phy_chain_tx_polarity_flip_physical{225.0}=0x1 +phy_chain_tx_polarity_flip_physical{226.0}=0x1 +phy_chain_tx_polarity_flip_physical{227.0}=0x1 +phy_chain_tx_polarity_flip_physical{228.0}=0x0 +phy_chain_tx_polarity_flip_physical{229.0}=0x0 +phy_chain_tx_polarity_flip_physical{23.0}=0x0 +phy_chain_tx_polarity_flip_physical{230.0}=0x1 +phy_chain_tx_polarity_flip_physical{231.0}=0x1 +phy_chain_tx_polarity_flip_physical{232.0}=0x1 +phy_chain_tx_polarity_flip_physical{233.0}=0x0 +phy_chain_tx_polarity_flip_physical{234.0}=0x0 +phy_chain_tx_polarity_flip_physical{235.0}=0x0 +phy_chain_tx_polarity_flip_physical{236.0}=0x0 +phy_chain_tx_polarity_flip_physical{237.0}=0x1 +phy_chain_tx_polarity_flip_physical{238.0}=0x1 +phy_chain_tx_polarity_flip_physical{239.0}=0x1 +phy_chain_tx_polarity_flip_physical{24.0}=0x0 +phy_chain_tx_polarity_flip_physical{240.0}=0x0 +phy_chain_tx_polarity_flip_physical{241.0}=0x1 +phy_chain_tx_polarity_flip_physical{242.0}=0x1 +phy_chain_tx_polarity_flip_physical{243.0}=0x1 +phy_chain_tx_polarity_flip_physical{244.0}=0x0 +phy_chain_tx_polarity_flip_physical{245.0}=0x1 +phy_chain_tx_polarity_flip_physical{246.0}=0x1 +phy_chain_tx_polarity_flip_physical{247.0}=0x1 +phy_chain_tx_polarity_flip_physical{248.0}=0x1 +phy_chain_tx_polarity_flip_physical{249.0}=0x1 +phy_chain_tx_polarity_flip_physical{25.0}=0x1 +phy_chain_tx_polarity_flip_physical{250.0}=0x0 +phy_chain_tx_polarity_flip_physical{251.0}=0x0 +phy_chain_tx_polarity_flip_physical{252.0}=0x0 +phy_chain_tx_polarity_flip_physical{253.0}=0x1 +phy_chain_tx_polarity_flip_physical{254.0}=0x1 +phy_chain_tx_polarity_flip_physical{255.0}=0x1 +phy_chain_tx_polarity_flip_physical{256.0}=0x0 +phy_chain_tx_polarity_flip_physical{257.0}=0x0 +phy_chain_tx_polarity_flip_physical{259.0}=0x0 +phy_chain_tx_polarity_flip_physical{26.0}=0x0 +phy_chain_tx_polarity_flip_physical{27.0}=0x0 +phy_chain_tx_polarity_flip_physical{28.0}=0x0 +phy_chain_tx_polarity_flip_physical{29.0}=0x1 +phy_chain_tx_polarity_flip_physical{3.0}=0x1 +phy_chain_tx_polarity_flip_physical{30.0}=0x1 +phy_chain_tx_polarity_flip_physical{31.0}=0x1 +phy_chain_tx_polarity_flip_physical{32.0}=0x0 +phy_chain_tx_polarity_flip_physical{33.0}=0x0 +phy_chain_tx_polarity_flip_physical{34.0}=0x0 +phy_chain_tx_polarity_flip_physical{35.0}=0x0 +phy_chain_tx_polarity_flip_physical{36.0}=0x1 +phy_chain_tx_polarity_flip_physical{37.0}=0x1 +phy_chain_tx_polarity_flip_physical{38.0}=0x1 +phy_chain_tx_polarity_flip_physical{39.0}=0x1 +phy_chain_tx_polarity_flip_physical{4.0}=0x1 +phy_chain_tx_polarity_flip_physical{40.0}=0x0 +phy_chain_tx_polarity_flip_physical{41.0}=0x0 +phy_chain_tx_polarity_flip_physical{42.0}=0x0 +phy_chain_tx_polarity_flip_physical{43.0}=0x0 +phy_chain_tx_polarity_flip_physical{44.0}=0x0 +phy_chain_tx_polarity_flip_physical{45.0}=0x1 +phy_chain_tx_polarity_flip_physical{46.0}=0x0 +phy_chain_tx_polarity_flip_physical{47.0}=0x1 +phy_chain_tx_polarity_flip_physical{48.0}=0x1 +phy_chain_tx_polarity_flip_physical{49.0}=0x0 +phy_chain_tx_polarity_flip_physical{5.0}=0x1 +phy_chain_tx_polarity_flip_physical{50.0}=0x0 +phy_chain_tx_polarity_flip_physical{51.0}=0x0 +phy_chain_tx_polarity_flip_physical{52.0}=0x1 +phy_chain_tx_polarity_flip_physical{53.0}=0x0 +phy_chain_tx_polarity_flip_physical{54.0}=0x1 +phy_chain_tx_polarity_flip_physical{55.0}=0x1 +phy_chain_tx_polarity_flip_physical{56.0}=0x0 +phy_chain_tx_polarity_flip_physical{57.0}=0x0 +phy_chain_tx_polarity_flip_physical{58.0}=0x1 +phy_chain_tx_polarity_flip_physical{59.0}=0x1 +phy_chain_tx_polarity_flip_physical{6.0}=0x1 +phy_chain_tx_polarity_flip_physical{60.0}=0x1 +phy_chain_tx_polarity_flip_physical{61.0}=0x0 +phy_chain_tx_polarity_flip_physical{62.0}=0x1 +phy_chain_tx_polarity_flip_physical{63.0}=0x1 +phy_chain_tx_polarity_flip_physical{64.0}=0x1 +phy_chain_tx_polarity_flip_physical{65.0}=0x0 +phy_chain_tx_polarity_flip_physical{66.0}=0x1 +phy_chain_tx_polarity_flip_physical{67.0}=0x1 +phy_chain_tx_polarity_flip_physical{68.0}=0x0 +phy_chain_tx_polarity_flip_physical{69.0}=0x1 +phy_chain_tx_polarity_flip_physical{7.0}=0x1 +phy_chain_tx_polarity_flip_physical{70.0}=0x1 +phy_chain_tx_polarity_flip_physical{71.0}=0x1 +phy_chain_tx_polarity_flip_physical{72.0}=0x0 +phy_chain_tx_polarity_flip_physical{73.0}=0x1 +phy_chain_tx_polarity_flip_physical{74.0}=0x0 +phy_chain_tx_polarity_flip_physical{75.0}=0x0 +phy_chain_tx_polarity_flip_physical{76.0}=0x0 +phy_chain_tx_polarity_flip_physical{77.0}=0x0 +phy_chain_tx_polarity_flip_physical{78.0}=0x0 +phy_chain_tx_polarity_flip_physical{79.0}=0x1 +phy_chain_tx_polarity_flip_physical{8.0}=0x0 +phy_chain_tx_polarity_flip_physical{80.0}=0x0 +phy_chain_tx_polarity_flip_physical{81.0}=0x1 +phy_chain_tx_polarity_flip_physical{82.0}=0x1 +phy_chain_tx_polarity_flip_physical{83.0}=0x1 +phy_chain_tx_polarity_flip_physical{84.0}=0x0 +phy_chain_tx_polarity_flip_physical{85.0}=0x1 +phy_chain_tx_polarity_flip_physical{86.0}=0x0 +phy_chain_tx_polarity_flip_physical{87.0}=0x0 +phy_chain_tx_polarity_flip_physical{88.0}=0x0 +phy_chain_tx_polarity_flip_physical{89.0}=0x1 +phy_chain_tx_polarity_flip_physical{9.0}=0x0 +phy_chain_tx_polarity_flip_physical{90.0}=0x1 +phy_chain_tx_polarity_flip_physical{91.0}=0x1 +phy_chain_tx_polarity_flip_physical{92.0}=0x0 +phy_chain_tx_polarity_flip_physical{93.0}=0x0 +phy_chain_tx_polarity_flip_physical{94.0}=0x0 +phy_chain_tx_polarity_flip_physical{95.0}=0x0 +phy_chain_tx_polarity_flip_physical{96.0}=0x0 +phy_chain_tx_polarity_flip_physical{97.0}=0x0 +phy_chain_tx_polarity_flip_physical{98.0}=0x1 +phy_chain_tx_polarity_flip_physical{99.0}=0x1 + +port_init_cl72_hg=1 + + + + + + + +robust_hash_disable_egress_vlan=1 +robust_hash_disable_mpls=1 +robust_hash_disable_vlan=1 +stable_size=0x5500000 +stable_size=0x5500000 +tdma_timeout_usec=15000000 +tslam_timeout_usec=15000000 +dport_map_direct=1 +portmap_1=5:50 +portmap_2=7:50 +portmap_3=13:50 +portmap_4=15:50 +portmap_5=25:50 +portmap_6=27:50 +portmap_7=21:50 +portmap_8=23:50 +portmap_9=37:50 +portmap_10=39:50 +portmap_11=45:50 +portmap_12=47:50 +portmap_13=57:100 +portmap_14=53:100 +portmap_15=9:50 +portmap_16=11:50 +portmap_17=1:50 +portmap_18=3:50 +portmap_19=17:50 +portmap_20=19:50 +portmap_21=29:50 +portmap_22=31:50 +portmap_23=41:50 +portmap_24=43:50 +portmap_25=33:50 +portmap_26=35:50 +portmap_27=49:50 +portmap_28=51:50 +portmap_29=61:50 +portmap_30=63:50 +portmap_34=77:100 +portmap_35=65:100 +portmap_38=85:50 +portmap_39=87:50 +portmap_40=89:50 +portmap_41=91:50 +portmap_42=109:50 +portmap_43=111:50 +portmap_44=97:50 +portmap_45=99:50 +portmap_46=117:100 +portmap_47=121:100 +portmap_48=69:50 +portmap_49=71:50 +portmap_50=73:50 +portmap_51=75:50 +portmap_52=93:50 +portmap_53=95:50 +portmap_54=81:50 +portmap_55=83:50 +portmap_56=101:50 +portmap_57=103:50 +portmap_58=105:50 +portmap_59=107:50 +portmap_60=125:50 +portmap_61=127:50 +portmap_62=113:50 +portmap_63=115:50 +portmap_66=257:10 +portmap_68=141:100 +portmap_69=133:100 +portmap_70=149:50 +portmap_71=151:50 +portmap_72=153:50 +portmap_73=155:50 +portmap_74=173:50 +portmap_75=175:50 +portmap_76=161:50 +portmap_77=163:50 +portmap_78=181:50 +portmap_79=183:50 +portmap_80=185:50 +portmap_81=187:50 +portmap_82=129:50 +portmap_83=131:50 +portmap_84=137:50 +portmap_85=139:50 +portmap_86=157:50 +portmap_87=159:50 +portmap_88=145:50 +portmap_89=147:50 +portmap_90=165:50 +portmap_91=167:50 +portmap_92=169:50 +portmap_93=171:50 +portmap_94=189:50 +portmap_95=191:50 +portmap_96=177:50 +portmap_97=179:50 +portmap_100=259:10 +portmap_102=197:100 +portmap_103=205:100 +portmap_104=217:50 +portmap_105=219:50 +portmap_106=213:50 +portmap_107=215:50 +portmap_108=229:50 +portmap_109=231:50 +portmap_110=237:50 +portmap_111=239:50 +portmap_112=249:50 +portmap_113=251:50 +portmap_114=245:50 +portmap_115=247:50 +portmap_116=201:50 +portmap_117=203:50 +portmap_118=193:50 +portmap_119=195:50 +portmap_120=209:50 +portmap_121=211:50 +portmap_122=221:50 +portmap_123=223:50 +portmap_124=233:50 +portmap_125=235:50 +portmap_126=225:50 +portmap_127=227:50 +portmap_128=241:50 +portmap_129=243:50 +portmap_130=253:50 +portmap_131=255:50 + +# tuning parameters +serdes_preemphasis_1=0x580c +serdes_preemphasis_2=0x580c +serdes_preemphasis_3=0x580c +serdes_preemphasis_4=0x580c +serdes_preemphasis_5=0x580c +serdes_preemphasis_6=0x580c +serdes_preemphasis_7=0x580c +serdes_preemphasis_8=0x580c +serdes_preemphasis_9=0x580c +serdes_preemphasis_10=0x580c +serdes_preemphasis_11=0x580c +serdes_preemphasis_12=0x580c +serdes_preemphasis_13=0x83404 +serdes_preemphasis_14=0x83404 +serdes_preemphasis_15=0x580c +serdes_preemphasis_16=0x580c +serdes_preemphasis_17=0x580c +serdes_preemphasis_18=0x580c +serdes_preemphasis_19=0x580c +serdes_preemphasis_20=0x580c +serdes_preemphasis_21=0x580c +serdes_preemphasis_22=0x580c +serdes_preemphasis_23=0x580c +serdes_preemphasis_24=0x580c +serdes_preemphasis_25=0x580c +serdes_preemphasis_26=0x580c +serdes_preemphasis_27=0x580c +serdes_preemphasis_28=0x580c +serdes_preemphasis_29=0x580c +serdes_preemphasis_30=0x580c +serdes_preemphasis_34=0xf3d05 +serdes_preemphasis_35=0xd3804 +serdes_preemphasis_38=0x580c +serdes_preemphasis_39=0x580c +serdes_preemphasis_40=0x580c +serdes_preemphasis_41=0x580c +serdes_preemphasis_42=0x580c +serdes_preemphasis_43=0x580c +serdes_preemphasis_44=0x580c +serdes_preemphasis_45=0x580c +serdes_preemphasis_46=0xb3604 +serdes_preemphasis_47=0x72b03 +serdes_preemphasis_48=0x580c +serdes_preemphasis_49=0x580c +serdes_preemphasis_50=0x580c +serdes_preemphasis_51=0x580c +serdes_preemphasis_52=0x580c +serdes_preemphasis_53=0x580c +serdes_preemphasis_54=0x580c +serdes_preemphasis_55=0x580c +serdes_preemphasis_56=0x580c +serdes_preemphasis_57=0x580c +serdes_preemphasis_58=0x580c +serdes_preemphasis_59=0x580c +serdes_preemphasis_60=0x580c +serdes_preemphasis_61=0x580c +serdes_preemphasis_62=0x580c +serdes_preemphasis_63=0x580c +serdes_preemphasis_66=0x43004 +serdes_preemphasis_68=0xf4006 +serdes_preemphasis_69=0xf4006 +serdes_preemphasis_70=0x580c +serdes_preemphasis_71=0x580c +serdes_preemphasis_72=0x580c +serdes_preemphasis_73=0x580c +serdes_preemphasis_74=0x580c +serdes_preemphasis_75=0x580c +serdes_preemphasis_76=0x580c +serdes_preemphasis_77=0x580c +serdes_preemphasis_78=0x580c +serdes_preemphasis_79=0x580c +serdes_preemphasis_80=0x580c +serdes_preemphasis_81=0x580c +serdes_preemphasis_82=0x580c +serdes_preemphasis_83=0x580c +serdes_preemphasis_84=0x580c +serdes_preemphasis_85=0x580c +serdes_preemphasis_86=0x580c +serdes_preemphasis_87=0x580c +serdes_preemphasis_88=0x580c +serdes_preemphasis_89=0x580c +serdes_preemphasis_90=0x580c +serdes_preemphasis_91=0x580c +serdes_preemphasis_92=0x580c +serdes_preemphasis_93=0x580c +serdes_preemphasis_94=0x580c +serdes_preemphasis_95=0x580c +serdes_preemphasis_96=0x580c +serdes_preemphasis_97=0x580c +serdes_preemphasis_100=0x43004 +serdes_preemphasis_102=0xf3c05 +serdes_preemphasis_103=0xf3c05 +serdes_preemphasis_104=0x580c +serdes_preemphasis_105=0x580c +serdes_preemphasis_106=0x580c +serdes_preemphasis_107=0x580c +serdes_preemphasis_108=0x580c +serdes_preemphasis_109=0x580c +serdes_preemphasis_110=0x580c +serdes_preemphasis_111=0x580c +serdes_preemphasis_112=0x580c +serdes_preemphasis_113=0x580c +serdes_preemphasis_114=0x580c +serdes_preemphasis_115=0x580c +serdes_preemphasis_116=0x580c +serdes_preemphasis_117=0x580c +serdes_preemphasis_118=0x580c +serdes_preemphasis_119=0x580c +serdes_preemphasis_120=0x580c +serdes_preemphasis_121=0x580c +serdes_preemphasis_122=0x580c +serdes_preemphasis_123=0x580c +serdes_preemphasis_124=0x580c +serdes_preemphasis_125=0x580c +serdes_preemphasis_126=0x580c +serdes_preemphasis_127=0x580c +serdes_preemphasis_128=0x580c +serdes_preemphasis_129=0x580c +serdes_preemphasis_130=0x580c +serdes_preemphasis_131=0x580c + +mmu_init_config="MSFT-TH2-Tier0" +{{ IPinIP_sock }} +phy_an_lt_msft=1 diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C10/pg_profile_lookup.ini b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C10/pg_profile_lookup.ini new file mode 120000 index 000000000000..297cddb2d223 --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C10/pg_profile_lookup.ini @@ -0,0 +1 @@ +BALANCED/pg_profile_lookup.ini \ No newline at end of file diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C10/port_config.ini b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C10/port_config.ini new file mode 100644 index 000000000000..1ea0f1d505a9 --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C10/port_config.ini @@ -0,0 +1,121 @@ +# name lanes alias index speed +Ethernet0 77,78,79,80 Ethernet1/1 1 100000 +Ethernet4 65,66,67,68 Ethernet2/1 2 100000 +Ethernet8 85,86 Ethernet3/1 3 50000 +Ethernet10 87,88 Ethernet3/3 3 50000 +Ethernet12 89,90 Ethernet4/1 4 50000 +Ethernet14 91,92 Ethernet4/3 4 50000 +Ethernet16 109,110 Ethernet5/1 5 50000 +Ethernet18 111,112 Ethernet5/3 5 50000 +Ethernet20 97,98 Ethernet6/1 6 50000 +Ethernet22 99,100 Ethernet6/3 6 50000 +Ethernet24 5,6 Ethernet7/1 7 50000 +Ethernet26 7,8 Ethernet7/3 7 50000 +Ethernet28 13,14 Ethernet8/1 8 50000 +Ethernet30 15,16 Ethernet8/3 8 50000 +Ethernet32 25,26 Ethernet9/1 9 50000 +Ethernet34 27,28 Ethernet9/3 9 50000 +Ethernet36 21,22 Ethernet10/1 10 50000 +Ethernet38 23,24 Ethernet10/3 10 50000 +Ethernet40 37,38 Ethernet11/1 11 50000 +Ethernet42 39,40 Ethernet11/3 11 50000 +Ethernet44 45,46 Ethernet12/1 12 50000 +Ethernet46 47,48 Ethernet12/3 12 50000 +Ethernet48 57,58,59,60 Ethernet13/1 13 100000 +Ethernet52 53,54,55,56 Ethernet14/1 14 100000 +Ethernet56 117,118,119,120 Ethernet15/1 15 100000 +Ethernet60 121,122,123,124 Ethernet16/1 16 100000 +Ethernet64 141,142,143,144 Ethernet17/1 17 100000 +Ethernet68 133,134,135,136 Ethernet18/1 18 100000 +Ethernet72 197,198,199,200 Ethernet19/1 19 100000 +Ethernet76 205,206,207,208 Ethernet20/1 20 100000 +Ethernet80 217,218 Ethernet21/1 21 50000 +Ethernet82 219,220 Ethernet21/3 21 50000 +Ethernet84 213,214 Ethernet22/1 22 50000 +Ethernet86 215,216 Ethernet22/3 22 50000 +Ethernet88 229,230 Ethernet23/1 23 50000 +Ethernet90 231,232 Ethernet23/3 23 50000 +Ethernet92 237,238 Ethernet24/1 24 50000 +Ethernet94 239,240 Ethernet24/3 24 50000 +Ethernet96 249,250 Ethernet25/1 25 50000 +Ethernet98 251,252 Ethernet25/3 25 50000 +Ethernet100 245,246 Ethernet26/1 26 50000 +Ethernet102 247,248 Ethernet26/3 26 50000 +Ethernet104 149,150 Ethernet27/1 27 50000 +Ethernet106 151,152 Ethernet27/3 27 50000 +Ethernet108 153,154 Ethernet28/1 28 50000 +Ethernet110 155,156 Ethernet28/3 28 50000 +Ethernet112 173,174 Ethernet29/1 29 50000 +Ethernet114 175,176 Ethernet29/3 29 50000 +Ethernet116 161,162 Ethernet30/1 30 50000 +Ethernet118 163,164 Ethernet30/3 30 50000 +Ethernet120 181,182 Ethernet31/1 31 50000 +Ethernet122 183,184 Ethernet31/3 31 50000 +Ethernet124 185,186 Ethernet32/1 32 50000 +Ethernet126 187,188 Ethernet32/3 32 50000 +Ethernet128 69,70 Ethernet33/1 33 50000 +Ethernet130 71,72 Ethernet33/3 33 50000 +Ethernet132 73,74 Ethernet34/1 34 50000 +Ethernet134 75,76 Ethernet34/3 34 50000 +Ethernet136 93,94 Ethernet35/1 35 50000 +Ethernet138 95,96 Ethernet35/3 35 50000 +Ethernet140 81,82 Ethernet36/1 36 50000 +Ethernet142 83,84 Ethernet36/3 36 50000 +Ethernet144 101,102 Ethernet37/1 37 50000 +Ethernet146 103,104 Ethernet37/3 37 50000 +Ethernet148 105,106 Ethernet38/1 38 50000 +Ethernet150 107,108 Ethernet38/3 38 50000 +Ethernet152 9,10 Ethernet39/1 39 50000 +Ethernet154 11,12 Ethernet39/3 39 50000 +Ethernet156 1,2 Ethernet40/1 40 50000 +Ethernet158 3,4 Ethernet40/3 40 50000 +Ethernet160 17,18 Ethernet41/1 41 50000 +Ethernet162 19,20 Ethernet41/3 41 50000 +Ethernet164 29,30 Ethernet42/1 42 50000 +Ethernet166 31,32 Ethernet42/3 42 50000 +Ethernet168 41,42 Ethernet43/1 43 50000 +Ethernet170 43,44 Ethernet43/3 43 50000 +Ethernet172 33,34 Ethernet44/1 44 50000 +Ethernet174 35,36 Ethernet44/3 44 50000 +Ethernet176 49,50 Ethernet45/1 45 50000 +Ethernet178 51,52 Ethernet45/3 45 50000 +Ethernet180 61,62 Ethernet46/1 46 50000 +Ethernet182 63,64 Ethernet46/3 46 50000 +Ethernet184 125,126 Ethernet47/1 47 50000 +Ethernet186 127,128 Ethernet47/3 47 50000 +Ethernet188 113,114 Ethernet48/1 48 50000 +Ethernet190 115,116 Ethernet48/3 48 50000 +Ethernet192 129,130 Ethernet49/1 49 50000 +Ethernet194 131,132 Ethernet49/3 49 50000 +Ethernet196 137,138 Ethernet50/1 50 50000 +Ethernet198 139,140 Ethernet50/3 50 50000 +Ethernet200 201,202 Ethernet51/1 51 50000 +Ethernet202 203,204 Ethernet51/3 51 50000 +Ethernet204 193,194 Ethernet52/1 52 50000 +Ethernet206 195,196 Ethernet52/3 52 50000 +Ethernet208 209,210 Ethernet53/1 53 50000 +Ethernet210 211,212 Ethernet53/3 53 50000 +Ethernet212 221,222 Ethernet54/1 54 50000 +Ethernet214 223,224 Ethernet54/3 54 50000 +Ethernet216 233,234 Ethernet55/1 55 50000 +Ethernet218 235,236 Ethernet55/3 55 50000 +Ethernet220 225,226 Ethernet56/1 56 50000 +Ethernet222 227,228 Ethernet56/3 56 50000 +Ethernet224 241,242 Ethernet57/1 57 50000 +Ethernet226 243,244 Ethernet57/3 57 50000 +Ethernet228 253,254 Ethernet58/1 58 50000 +Ethernet230 255,256 Ethernet58/3 58 50000 +Ethernet232 157,158 Ethernet59/1 59 50000 +Ethernet234 159,160 Ethernet59/3 59 50000 +Ethernet236 145,146 Ethernet60/1 60 50000 +Ethernet238 147,148 Ethernet60/3 60 50000 +Ethernet240 165,166 Ethernet61/1 61 50000 +Ethernet242 167,168 Ethernet61/3 61 50000 +Ethernet244 169,170 Ethernet62/1 62 50000 +Ethernet246 171,172 Ethernet62/3 62 50000 +Ethernet248 189,190 Ethernet63/1 63 50000 +Ethernet250 191,192 Ethernet63/3 63 50000 +Ethernet252 177,178 Ethernet64/1 64 50000 +Ethernet254 179,180 Ethernet64/3 64 50000 +Ethernet256 257 Ethernet65 65 10000 +Ethernet260 259 Ethernet66 66 10000 diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C10/qos.json.j2 b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C10/qos.json.j2 new file mode 120000 index 000000000000..aef6b6765cf2 --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C10/qos.json.j2 @@ -0,0 +1 @@ +BALANCED/qos.json.j2 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C10/sai.profile b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C10/sai.profile new file mode 100644 index 000000000000..5163d6140f0e --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C10/sai.profile @@ -0,0 +1,2 @@ +SAI_INIT_CONFIG_FILE=/etc/sai.d/config.bcm +SAI_NUM_ECMP_MEMBERS=64 diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8/BALANCED b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8/BALANCED new file mode 120000 index 000000000000..a270c70ffc36 --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8/BALANCED @@ -0,0 +1 @@ +../../../common/profiles/th2/7260/BALANCED \ No newline at end of file diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8/RDMA-CENTRIC b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8/RDMA-CENTRIC new file mode 120000 index 000000000000..8d1ec6d277a8 --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8/RDMA-CENTRIC @@ -0,0 +1 @@ +../../../common/profiles/th2/7260/RDMA-CENTRIC \ No newline at end of file diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8/TCP-CENTRIC b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8/TCP-CENTRIC new file mode 120000 index 000000000000..7ee783aac6a4 --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8/TCP-CENTRIC @@ -0,0 +1 @@ +../../../common/profiles/th2/7260/TCP-CENTRIC \ No newline at end of file diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8/buffer_ports_t0.j2 b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8/buffer_ports_t0.j2 new file mode 100644 index 000000000000..3e209865c308 --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8/buffer_ports_t0.j2 @@ -0,0 +1,14 @@ +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {%- for port_idx in range(0,12) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{%- endif %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 2)) %}{%- endif %} + {%- endfor %} + {%- for port_idx in range(20,64) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{%- endif %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 2)) %}{%- endif %} + {%- endfor %} + {%- for port_idx in range(12,20) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{%- endif %} + {%- endfor %} +{%- endmacro %} diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8/buffers_defaults_t0.j2 b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8/buffers_defaults_t0.j2 deleted file mode 100644 index 74579a022dcb..000000000000 --- a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8/buffers_defaults_t0.j2 +++ /dev/null @@ -1,54 +0,0 @@ -{%- set default_cable = '5m' %} - -{%- macro generate_port_lists(PORT_ALL) %} - {# Generate list of ports #} - {%- for port_idx in range(0,12) %} - {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{%- endif %} - {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 2)) %}{%- endif %} - {%- endfor %} - {%- for port_idx in range(20,64) %} - {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{%- endif %} - {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 2)) %}{%- endif %} - {%- endfor %} - {%- for port_idx in range(12,20) %} - {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{%- endif %} - {%- endfor %} -{%- endmacro %} - -{%- macro generate_buffer_pool_and_profiles() %} - "BUFFER_POOL": { - "ingress_lossless_pool": { - "size": "33329088", - "type": "ingress", - "mode": "dynamic", - "xoff": "7827456" - }, - "egress_lossy_pool": { - "size": "26663272", - "type": "egress", - "mode": "dynamic" - }, - "egress_lossless_pool": { - "size": "42349632", - "type": "egress", - "mode": "static" - } - }, - "BUFFER_PROFILE": { - "ingress_lossy_profile": { - "pool":"[BUFFER_POOL|ingress_lossless_pool]", - "size":"0", - "static_th":"44302336" - }, - "egress_lossless_profile": { - "pool":"[BUFFER_POOL|egress_lossless_pool]", - "size":"0", - "static_th":"42349632" - }, - "egress_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"1664", - "dynamic_th":"-1" - } - }, -{%- endmacro %} diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8/buffers_defaults_t0.j2 b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8/buffers_defaults_t0.j2 new file mode 120000 index 000000000000..9524e6a476ac --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8/buffers_defaults_t0.j2 @@ -0,0 +1 @@ +BALANCED/buffers_defaults_t0.j2 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8/buffers_extra_queues.j2 b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8/buffers_extra_queues.j2 new file mode 120000 index 000000000000..92b7e9ffbee5 --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8/buffers_extra_queues.j2 @@ -0,0 +1 @@ +../Arista-7260CX3-C64/buffers_extra_queues.j2 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8/buffers_pool_sizes_t0.j2 b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8/buffers_pool_sizes_t0.j2 new file mode 120000 index 000000000000..72e16a608268 --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8/buffers_pool_sizes_t0.j2 @@ -0,0 +1 @@ +../Arista-7260CX3-C64/buffers_pool_sizes_t0.j2 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8/config.bcm.j2 b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8/config.bcm.j2 new file mode 100644 index 000000000000..6259ffb8ce08 --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8/config.bcm.j2 @@ -0,0 +1,956 @@ +{# Construct config.bcm to include additional soc properties per specific device metadata requirement #} +{%- set IPinIP_sock = '' -%} +{%- set map_prio = '' -%} +{%- if DEVICE_METADATA is defined and DEVICE_METADATA['localhost'] is defined and DEVICE_METADATA['localhost']['subtype'] is defined -%} +{%- set switch_subtype = DEVICE_METADATA['localhost']['subtype'] -%} +{%- if 'dualtor' in switch_subtype.lower() %} +{%- set IPinIP_sock = 'sai_tunnel_support=1 + sai_tunnel_underlay_route_mode=1 + host_as_route_disable=1 + l3_ecmp_levels=2' -%} +{%- set map_prio = 'sai_remap_prio_on_tnl_egress=1' -%} +{%- endif %} +{%- endif %} +{# The following is the common soc properties that used to be named "th2-a7260cx3-64-112x50G+8x100G.config.bcm" #} +l3_alpm_hit_skip=1 +sai_adjust_acl_drop_in_rx_drop=1 +{{ map_prio }} +PHY_AN_ALLOW_PLL_CHANGE=1 +arl_clean_timeout_usec=15000000 +asf_mem_profile=2 +bcm_num_cos=10 +bcm_stat_flags=1 +bcm_stat_jumbo=9236 +cdma_timeout_usec=15000000 +core_clock_frequency=1700 +dma_desc_timeout_usec=15000000 +dpp_clock_ratio=2:3 +higig2_hdr_mode=1 +ipv6_lpm_128b_enable=1 +l3_alpm_enable=2 +lpm_scaling_enable=0 +l2xmsg_mode=1 +max_vp_lags=0 +mem_scan_enable=1 +miim_intr_enable=0 +module_64ports=1 +os=unix +oversubscribe_mode=1 +pbmp_xport_xe=0xfffffffd3fffffff4fffffffc7ffffffe +#pbmp_xport_xe=0x47fffffff1fffffffcfffffffe7ffffffe +phy_an_allow_pll_change_hg=0 +phy_an_c73=1 +phy_chain_rx_lane_map_physical{1.0}=0x3210 +phy_chain_rx_lane_map_physical{101.0}=0x0123 +phy_chain_rx_lane_map_physical{105.0}=0x0123 +phy_chain_rx_lane_map_physical{109.0}=0x0123 +phy_chain_rx_lane_map_physical{113.0}=0x2301 +phy_chain_rx_lane_map_physical{117.0}=0x3210 +phy_chain_rx_lane_map_physical{121.0}=0x3210 +phy_chain_rx_lane_map_physical{125.0}=0x1203 +phy_chain_rx_lane_map_physical{129.0}=0x3210 +phy_chain_rx_lane_map_physical{13.0}=0x0321 +phy_chain_rx_lane_map_physical{133.0}=0x1032 +phy_chain_rx_lane_map_physical{137.0}=0x3210 +phy_chain_rx_lane_map_physical{141.0}=0x0123 +phy_chain_rx_lane_map_physical{145.0}=0x3210 +phy_chain_rx_lane_map_physical{149.0}=0x2310 +phy_chain_rx_lane_map_physical{153.0}=0x0132 +phy_chain_rx_lane_map_physical{157.0}=0x1302 +phy_chain_rx_lane_map_physical{161.0}=0x3021 +phy_chain_rx_lane_map_physical{165.0}=0x2031 +phy_chain_rx_lane_map_physical{169.0}=0x2031 +phy_chain_rx_lane_map_physical{17.0}=0x3210 +phy_chain_rx_lane_map_physical{173.0}=0x1302 +phy_chain_rx_lane_map_physical{177.0}=0x2031 +phy_chain_rx_lane_map_physical{181.0}=0x0213 +phy_chain_rx_lane_map_physical{185.0}=0x0213 +phy_chain_rx_lane_map_physical{189.0}=0x1302 +phy_chain_rx_lane_map_physical{193.0}=0x3120 +phy_chain_rx_lane_map_physical{197.0}=0x0231 +phy_chain_rx_lane_map_physical{201.0}=0x2031 +phy_chain_rx_lane_map_physical{205.0}=0x0213 +phy_chain_rx_lane_map_physical{209.0}=0x2013 +phy_chain_rx_lane_map_physical{21.0}=0x3021 +phy_chain_rx_lane_map_physical{213.0}=0x3021 +phy_chain_rx_lane_map_physical{217.0}=0x0231 +phy_chain_rx_lane_map_physical{221.0}=0x2031 +phy_chain_rx_lane_map_physical{225.0}=0x1203 +phy_chain_rx_lane_map_physical{229.0}=0x1230 +phy_chain_rx_lane_map_physical{233.0}=0x3021 +phy_chain_rx_lane_map_physical{237.0}=0x1032 +phy_chain_rx_lane_map_physical{241.0}=0x2301 +phy_chain_rx_lane_map_physical{245.0}=0x0321 +phy_chain_rx_lane_map_physical{249.0}=0x2301 +phy_chain_rx_lane_map_physical{25.0}=0x2301 +phy_chain_rx_lane_map_physical{253.0}=0x2301 +phy_chain_rx_lane_map_physical{257.0}=0x3210 +phy_chain_rx_lane_map_physical{29.0}=0x3021 +phy_chain_rx_lane_map_physical{33.0}=0x1302 +phy_chain_rx_lane_map_physical{37.0}=0x2031 +phy_chain_rx_lane_map_physical{41.0}=0x3021 +phy_chain_rx_lane_map_physical{45.0}=0x1023 +phy_chain_rx_lane_map_physical{49.0}=0x0213 +phy_chain_rx_lane_map_physical{5.0}=0x3201 +phy_chain_rx_lane_map_physical{53.0}=0x3201 +phy_chain_rx_lane_map_physical{57.0}=0x2013 +phy_chain_rx_lane_map_physical{61.0}=0x0213 +phy_chain_rx_lane_map_physical{65.0}=0x1203 +phy_chain_rx_lane_map_physical{69.0}=0x0213 +phy_chain_rx_lane_map_physical{73.0}=0x0213 +phy_chain_rx_lane_map_physical{77.0}=0x3120 +phy_chain_rx_lane_map_physical{81.0}=0x0213 +phy_chain_rx_lane_map_physical{85.0}=0x2031 +phy_chain_rx_lane_map_physical{89.0}=0x2031 +phy_chain_rx_lane_map_physical{9.0}=0x0321 +phy_chain_rx_lane_map_physical{93.0}=0x3120 +phy_chain_rx_lane_map_physical{97.0}=0x1203 +phy_chain_rx_polarity_flip_physical{1.0}=0x1 +phy_chain_rx_polarity_flip_physical{10.0}=0x0 +phy_chain_rx_polarity_flip_physical{100.0}=0x1 +phy_chain_rx_polarity_flip_physical{101.0}=0x1 +phy_chain_rx_polarity_flip_physical{102.0}=0x0 +phy_chain_rx_polarity_flip_physical{103.0}=0x1 +phy_chain_rx_polarity_flip_physical{104.0}=0x0 +phy_chain_rx_polarity_flip_physical{105.0}=0x1 +phy_chain_rx_polarity_flip_physical{106.0}=0x0 +phy_chain_rx_polarity_flip_physical{107.0}=0x1 +phy_chain_rx_polarity_flip_physical{108.0}=0x0 +phy_chain_rx_polarity_flip_physical{109.0}=0x0 +phy_chain_rx_polarity_flip_physical{11.0}=0x1 +phy_chain_rx_polarity_flip_physical{110.0}=0x1 +phy_chain_rx_polarity_flip_physical{111.0}=0x0 +phy_chain_rx_polarity_flip_physical{112.0}=0x1 +phy_chain_rx_polarity_flip_physical{113.0}=0x1 +phy_chain_rx_polarity_flip_physical{114.0}=0x0 +phy_chain_rx_polarity_flip_physical{115.0}=0x1 +phy_chain_rx_polarity_flip_physical{116.0}=0x0 +phy_chain_rx_polarity_flip_physical{117.0}=0x0 +phy_chain_rx_polarity_flip_physical{118.0}=0x0 +phy_chain_rx_polarity_flip_physical{119.0}=0x1 +phy_chain_rx_polarity_flip_physical{12.0}=0x1 +phy_chain_rx_polarity_flip_physical{120.0}=0x0 +phy_chain_rx_polarity_flip_physical{121.0}=0x1 +phy_chain_rx_polarity_flip_physical{122.0}=0x0 +phy_chain_rx_polarity_flip_physical{123.0}=0x1 +phy_chain_rx_polarity_flip_physical{124.0}=0x0 +phy_chain_rx_polarity_flip_physical{125.0}=0x0 +phy_chain_rx_polarity_flip_physical{126.0}=0x1 +phy_chain_rx_polarity_flip_physical{127.0}=0x1 +phy_chain_rx_polarity_flip_physical{128.0}=0x1 +phy_chain_rx_polarity_flip_physical{129.0}=0x0 +phy_chain_rx_polarity_flip_physical{13.0}=0x1 +phy_chain_rx_polarity_flip_physical{130.0}=0x1 +phy_chain_rx_polarity_flip_physical{131.0}=0x1 +phy_chain_rx_polarity_flip_physical{132.0}=0x0 +phy_chain_rx_polarity_flip_physical{133.0}=0x1 +phy_chain_rx_polarity_flip_physical{134.0}=0x1 +phy_chain_rx_polarity_flip_physical{135.0}=0x1 +phy_chain_rx_polarity_flip_physical{136.0}=0x0 +phy_chain_rx_polarity_flip_physical{137.0}=0x0 +phy_chain_rx_polarity_flip_physical{138.0}=0x0 +phy_chain_rx_polarity_flip_physical{139.0}=0x1 +phy_chain_rx_polarity_flip_physical{14.0}=0x0 +phy_chain_rx_polarity_flip_physical{140.0}=0x0 +phy_chain_rx_polarity_flip_physical{141.0}=0x1 +phy_chain_rx_polarity_flip_physical{142.0}=0x0 +phy_chain_rx_polarity_flip_physical{143.0}=0x1 +phy_chain_rx_polarity_flip_physical{144.0}=0x0 +phy_chain_rx_polarity_flip_physical{145.0}=0x1 +phy_chain_rx_polarity_flip_physical{146.0}=0x0 +phy_chain_rx_polarity_flip_physical{147.0}=0x1 +phy_chain_rx_polarity_flip_physical{148.0}=0x0 +phy_chain_rx_polarity_flip_physical{149.0}=0x0 +phy_chain_rx_polarity_flip_physical{15.0}=0x1 +phy_chain_rx_polarity_flip_physical{150.0}=0x1 +phy_chain_rx_polarity_flip_physical{151.0}=0x1 +phy_chain_rx_polarity_flip_physical{152.0}=0x0 +phy_chain_rx_polarity_flip_physical{153.0}=0x0 +phy_chain_rx_polarity_flip_physical{154.0}=0x1 +phy_chain_rx_polarity_flip_physical{155.0}=0x1 +phy_chain_rx_polarity_flip_physical{156.0}=0x0 +phy_chain_rx_polarity_flip_physical{157.0}=0x0 +phy_chain_rx_polarity_flip_physical{158.0}=0x0 +phy_chain_rx_polarity_flip_physical{159.0}=0x1 +phy_chain_rx_polarity_flip_physical{16.0}=0x0 +phy_chain_rx_polarity_flip_physical{160.0}=0x0 +phy_chain_rx_polarity_flip_physical{161.0}=0x1 +phy_chain_rx_polarity_flip_physical{162.0}=0x1 +phy_chain_rx_polarity_flip_physical{163.0}=0x0 +phy_chain_rx_polarity_flip_physical{164.0}=0x1 +phy_chain_rx_polarity_flip_physical{165.0}=0x0 +phy_chain_rx_polarity_flip_physical{166.0}=0x0 +phy_chain_rx_polarity_flip_physical{167.0}=0x1 +phy_chain_rx_polarity_flip_physical{168.0}=0x1 +phy_chain_rx_polarity_flip_physical{169.0}=0x1 +phy_chain_rx_polarity_flip_physical{17.0}=0x1 +phy_chain_rx_polarity_flip_physical{170.0}=0x1 +phy_chain_rx_polarity_flip_physical{171.0}=0x0 +phy_chain_rx_polarity_flip_physical{172.0}=0x0 +phy_chain_rx_polarity_flip_physical{173.0}=0x0 +phy_chain_rx_polarity_flip_physical{174.0}=0x0 +phy_chain_rx_polarity_flip_physical{175.0}=0x1 +phy_chain_rx_polarity_flip_physical{176.0}=0x1 +phy_chain_rx_polarity_flip_physical{177.0}=0x1 +phy_chain_rx_polarity_flip_physical{178.0}=0x1 +phy_chain_rx_polarity_flip_physical{179.0}=0x0 +phy_chain_rx_polarity_flip_physical{18.0}=0x0 +phy_chain_rx_polarity_flip_physical{180.0}=0x0 +phy_chain_rx_polarity_flip_physical{181.0}=0x1 +phy_chain_rx_polarity_flip_physical{182.0}=0x1 +phy_chain_rx_polarity_flip_physical{183.0}=0x0 +phy_chain_rx_polarity_flip_physical{184.0}=0x0 +phy_chain_rx_polarity_flip_physical{185.0}=0x0 +phy_chain_rx_polarity_flip_physical{186.0}=0x0 +phy_chain_rx_polarity_flip_physical{187.0}=0x1 +phy_chain_rx_polarity_flip_physical{188.0}=0x1 +phy_chain_rx_polarity_flip_physical{189.0}=0x0 +phy_chain_rx_polarity_flip_physical{19.0}=0x1 +phy_chain_rx_polarity_flip_physical{190.0}=0x0 +phy_chain_rx_polarity_flip_physical{191.0}=0x1 +phy_chain_rx_polarity_flip_physical{192.0}=0x0 +phy_chain_rx_polarity_flip_physical{193.0}=0x0 +phy_chain_rx_polarity_flip_physical{194.0}=0x0 +phy_chain_rx_polarity_flip_physical{195.0}=0x1 +phy_chain_rx_polarity_flip_physical{196.0}=0x1 +phy_chain_rx_polarity_flip_physical{197.0}=0x1 +phy_chain_rx_polarity_flip_physical{198.0}=0x1 +phy_chain_rx_polarity_flip_physical{199.0}=0x0 +phy_chain_rx_polarity_flip_physical{2.0}=0x0 +phy_chain_rx_polarity_flip_physical{20.0}=0x0 +phy_chain_rx_polarity_flip_physical{200.0}=0x0 +phy_chain_rx_polarity_flip_physical{201.0}=0x0 +phy_chain_rx_polarity_flip_physical{202.0}=0x0 +phy_chain_rx_polarity_flip_physical{203.0}=0x1 +phy_chain_rx_polarity_flip_physical{204.0}=0x0 +phy_chain_rx_polarity_flip_physical{205.0}=0x1 +phy_chain_rx_polarity_flip_physical{206.0}=0x1 +phy_chain_rx_polarity_flip_physical{207.0}=0x0 +phy_chain_rx_polarity_flip_physical{208.0}=0x0 +phy_chain_rx_polarity_flip_physical{209.0}=0x1 +phy_chain_rx_polarity_flip_physical{21.0}=0x0 +phy_chain_rx_polarity_flip_physical{210.0}=0x1 +phy_chain_rx_polarity_flip_physical{211.0}=0x0 +phy_chain_rx_polarity_flip_physical{212.0}=0x0 +phy_chain_rx_polarity_flip_physical{213.0}=0x0 +phy_chain_rx_polarity_flip_physical{214.0}=0x0 +phy_chain_rx_polarity_flip_physical{215.0}=0x1 +phy_chain_rx_polarity_flip_physical{216.0}=0x0 +phy_chain_rx_polarity_flip_physical{217.0}=0x0 +phy_chain_rx_polarity_flip_physical{218.0}=0x0 +phy_chain_rx_polarity_flip_physical{219.0}=0x1 +phy_chain_rx_polarity_flip_physical{22.0}=0x0 +phy_chain_rx_polarity_flip_physical{220.0}=0x1 +phy_chain_rx_polarity_flip_physical{221.0}=0x0 +phy_chain_rx_polarity_flip_physical{222.0}=0x0 +phy_chain_rx_polarity_flip_physical{223.0}=0x1 +phy_chain_rx_polarity_flip_physical{224.0}=0x1 +phy_chain_rx_polarity_flip_physical{225.0}=0x1 +phy_chain_rx_polarity_flip_physical{226.0}=0x0 +phy_chain_rx_polarity_flip_physical{227.0}=0x0 +phy_chain_rx_polarity_flip_physical{228.0}=0x1 +phy_chain_rx_polarity_flip_physical{229.0}=0x0 +phy_chain_rx_polarity_flip_physical{23.0}=0x1 +phy_chain_rx_polarity_flip_physical{230.0}=0x0 +phy_chain_rx_polarity_flip_physical{231.0}=0x1 +phy_chain_rx_polarity_flip_physical{232.0}=0x1 +phy_chain_rx_polarity_flip_physical{233.0}=0x1 +phy_chain_rx_polarity_flip_physical{234.0}=0x0 +phy_chain_rx_polarity_flip_physical{235.0}=0x0 +phy_chain_rx_polarity_flip_physical{236.0}=0x0 +phy_chain_rx_polarity_flip_physical{237.0}=0x1 +phy_chain_rx_polarity_flip_physical{238.0}=0x0 +phy_chain_rx_polarity_flip_physical{239.0}=0x1 +phy_chain_rx_polarity_flip_physical{24.0}=0x0 +phy_chain_rx_polarity_flip_physical{240.0}=0x0 +phy_chain_rx_polarity_flip_physical{241.0}=0x1 +phy_chain_rx_polarity_flip_physical{242.0}=0x0 +phy_chain_rx_polarity_flip_physical{243.0}=0x1 +phy_chain_rx_polarity_flip_physical{244.0}=0x0 +phy_chain_rx_polarity_flip_physical{245.0}=0x1 +phy_chain_rx_polarity_flip_physical{246.0}=0x1 +phy_chain_rx_polarity_flip_physical{247.0}=0x1 +phy_chain_rx_polarity_flip_physical{248.0}=0x0 +phy_chain_rx_polarity_flip_physical{249.0}=0x0 +phy_chain_rx_polarity_flip_physical{25.0}=0x1 +phy_chain_rx_polarity_flip_physical{250.0}=0x1 +phy_chain_rx_polarity_flip_physical{251.0}=0x0 +phy_chain_rx_polarity_flip_physical{252.0}=0x1 +phy_chain_rx_polarity_flip_physical{253.0}=0x1 +phy_chain_rx_polarity_flip_physical{254.0}=0x0 +phy_chain_rx_polarity_flip_physical{255.0}=0x1 +phy_chain_rx_polarity_flip_physical{256.0}=0x0 +phy_chain_rx_polarity_flip_physical{257.0}=0x0 +phy_chain_rx_polarity_flip_physical{259.0}=0x0 +phy_chain_rx_polarity_flip_physical{26.0}=0x0 +phy_chain_rx_polarity_flip_physical{27.0}=0x1 +phy_chain_rx_polarity_flip_physical{28.0}=0x0 +phy_chain_rx_polarity_flip_physical{29.0}=0x0 +phy_chain_rx_polarity_flip_physical{3.0}=0x1 +phy_chain_rx_polarity_flip_physical{30.0}=0x0 +phy_chain_rx_polarity_flip_physical{31.0}=0x0 +phy_chain_rx_polarity_flip_physical{32.0}=0x1 +phy_chain_rx_polarity_flip_physical{33.0}=0x0 +phy_chain_rx_polarity_flip_physical{34.0}=0x0 +phy_chain_rx_polarity_flip_physical{35.0}=0x1 +phy_chain_rx_polarity_flip_physical{36.0}=0x1 +phy_chain_rx_polarity_flip_physical{37.0}=0x1 +phy_chain_rx_polarity_flip_physical{38.0}=0x1 +phy_chain_rx_polarity_flip_physical{39.0}=0x0 +phy_chain_rx_polarity_flip_physical{4.0}=0x0 +phy_chain_rx_polarity_flip_physical{40.0}=0x0 +phy_chain_rx_polarity_flip_physical{41.0}=0x0 +phy_chain_rx_polarity_flip_physical{42.0}=0x1 +phy_chain_rx_polarity_flip_physical{43.0}=0x1 +phy_chain_rx_polarity_flip_physical{44.0}=0x1 +phy_chain_rx_polarity_flip_physical{45.0}=0x1 +phy_chain_rx_polarity_flip_physical{46.0}=0x0 +phy_chain_rx_polarity_flip_physical{47.0}=0x0 +phy_chain_rx_polarity_flip_physical{48.0}=0x1 +phy_chain_rx_polarity_flip_physical{49.0}=0x1 +phy_chain_rx_polarity_flip_physical{5.0}=0x1 +phy_chain_rx_polarity_flip_physical{50.0}=0x1 +phy_chain_rx_polarity_flip_physical{51.0}=0x0 +phy_chain_rx_polarity_flip_physical{52.0}=0x0 +phy_chain_rx_polarity_flip_physical{53.0}=0x0 +phy_chain_rx_polarity_flip_physical{54.0}=0x0 +phy_chain_rx_polarity_flip_physical{55.0}=0x1 +phy_chain_rx_polarity_flip_physical{56.0}=0x0 +phy_chain_rx_polarity_flip_physical{57.0}=0x0 +phy_chain_rx_polarity_flip_physical{58.0}=0x0 +phy_chain_rx_polarity_flip_physical{59.0}=0x1 +phy_chain_rx_polarity_flip_physical{6.0}=0x0 +phy_chain_rx_polarity_flip_physical{60.0}=0x1 +phy_chain_rx_polarity_flip_physical{61.0}=0x0 +phy_chain_rx_polarity_flip_physical{62.0}=0x0 +phy_chain_rx_polarity_flip_physical{63.0}=0x1 +phy_chain_rx_polarity_flip_physical{64.0}=0x1 +phy_chain_rx_polarity_flip_physical{65.0}=0x1 +phy_chain_rx_polarity_flip_physical{66.0}=0x1 +phy_chain_rx_polarity_flip_physical{67.0}=0x0 +phy_chain_rx_polarity_flip_physical{68.0}=0x1 +phy_chain_rx_polarity_flip_physical{69.0}=0x0 +phy_chain_rx_polarity_flip_physical{7.0}=0x0 +phy_chain_rx_polarity_flip_physical{70.0}=0x0 +phy_chain_rx_polarity_flip_physical{71.0}=0x1 +phy_chain_rx_polarity_flip_physical{72.0}=0x1 +phy_chain_rx_polarity_flip_physical{73.0}=0x1 +phy_chain_rx_polarity_flip_physical{74.0}=0x1 +phy_chain_rx_polarity_flip_physical{75.0}=0x0 +phy_chain_rx_polarity_flip_physical{76.0}=0x0 +phy_chain_rx_polarity_flip_physical{77.0}=0x0 +phy_chain_rx_polarity_flip_physical{78.0}=0x0 +phy_chain_rx_polarity_flip_physical{79.0}=0x1 +phy_chain_rx_polarity_flip_physical{8.0}=0x1 +phy_chain_rx_polarity_flip_physical{80.0}=0x1 +phy_chain_rx_polarity_flip_physical{81.0}=0x1 +phy_chain_rx_polarity_flip_physical{82.0}=0x1 +phy_chain_rx_polarity_flip_physical{83.0}=0x0 +phy_chain_rx_polarity_flip_physical{84.0}=0x0 +phy_chain_rx_polarity_flip_physical{85.0}=0x1 +phy_chain_rx_polarity_flip_physical{86.0}=0x1 +phy_chain_rx_polarity_flip_physical{87.0}=0x0 +phy_chain_rx_polarity_flip_physical{88.0}=0x0 +phy_chain_rx_polarity_flip_physical{89.0}=0x0 +phy_chain_rx_polarity_flip_physical{9.0}=0x1 +phy_chain_rx_polarity_flip_physical{90.0}=0x0 +phy_chain_rx_polarity_flip_physical{91.0}=0x1 +phy_chain_rx_polarity_flip_physical{92.0}=0x1 +phy_chain_rx_polarity_flip_physical{93.0}=0x0 +phy_chain_rx_polarity_flip_physical{94.0}=0x0 +phy_chain_rx_polarity_flip_physical{95.0}=0x1 +phy_chain_rx_polarity_flip_physical{96.0}=0x0 +phy_chain_rx_polarity_flip_physical{97.0}=0x1 +phy_chain_rx_polarity_flip_physical{98.0}=0x1 +phy_chain_rx_polarity_flip_physical{99.0}=0x0 +phy_chain_tx_lane_map_physical{1.0}=0x2031 +phy_chain_tx_lane_map_physical{101.0}=0x1023 +phy_chain_tx_lane_map_physical{105.0}=0x1302 +phy_chain_tx_lane_map_physical{109.0}=0x0321 +phy_chain_tx_lane_map_physical{113.0}=0x2301 +phy_chain_tx_lane_map_physical{117.0}=0x3120 +phy_chain_tx_lane_map_physical{121.0}=0x3102 +phy_chain_tx_lane_map_physical{125.0}=0x3210 +phy_chain_tx_lane_map_physical{129.0}=0x1023 +phy_chain_tx_lane_map_physical{13.0}=0x3021 +phy_chain_tx_lane_map_physical{133.0}=0x3210 +phy_chain_tx_lane_map_physical{137.0}=0x2031 +phy_chain_tx_lane_map_physical{141.0}=0x1302 +phy_chain_tx_lane_map_physical{145.0}=0x3210 +phy_chain_tx_lane_map_physical{149.0}=0x0213 +phy_chain_tx_lane_map_physical{153.0}=0x3210 +phy_chain_tx_lane_map_physical{157.0}=0x1320 +phy_chain_tx_lane_map_physical{161.0}=0x3210 +phy_chain_tx_lane_map_physical{165.0}=0x0231 +phy_chain_tx_lane_map_physical{169.0}=0x3120 +phy_chain_tx_lane_map_physical{17.0}=0x1032 +phy_chain_tx_lane_map_physical{173.0}=0x0312 +phy_chain_tx_lane_map_physical{177.0}=0x0231 +phy_chain_tx_lane_map_physical{181.0}=0x3210 +phy_chain_tx_lane_map_physical{185.0}=0x3210 +phy_chain_tx_lane_map_physical{189.0}=0x1320 +phy_chain_tx_lane_map_physical{193.0}=0x0321 +phy_chain_tx_lane_map_physical{197.0}=0x3120 +phy_chain_tx_lane_map_physical{201.0}=0x3120 +phy_chain_tx_lane_map_physical{205.0}=0x0123 +phy_chain_tx_lane_map_physical{209.0}=0x3120 +phy_chain_tx_lane_map_physical{21.0}=0x0213 +phy_chain_tx_lane_map_physical{213.0}=0x3021 +phy_chain_tx_lane_map_physical{217.0}=0x0312 +phy_chain_tx_lane_map_physical{221.0}=0x2301 +phy_chain_tx_lane_map_physical{225.0}=0x0123 +phy_chain_tx_lane_map_physical{229.0}=0x2031 +phy_chain_tx_lane_map_physical{233.0}=0x0231 +phy_chain_tx_lane_map_physical{237.0}=0x0213 +phy_chain_tx_lane_map_physical{241.0}=0x1320 +phy_chain_tx_lane_map_physical{245.0}=0x2031 +phy_chain_tx_lane_map_physical{249.0}=0x3120 +phy_chain_tx_lane_map_physical{25.0}=0x0231 +phy_chain_tx_lane_map_physical{253.0}=0x0321 +phy_chain_tx_lane_map_physical{257.0}=0x3210 +phy_chain_tx_lane_map_physical{29.0}=0x1230 +phy_chain_tx_lane_map_physical{33.0}=0x1032 +phy_chain_tx_lane_map_physical{37.0}=0x0123 +phy_chain_tx_lane_map_physical{41.0}=0x0213 +phy_chain_tx_lane_map_physical{45.0}=0x0132 +phy_chain_tx_lane_map_physical{49.0}=0x2031 +phy_chain_tx_lane_map_physical{5.0}=0x2301 +phy_chain_tx_lane_map_physical{53.0}=0x2301 +phy_chain_tx_lane_map_physical{57.0}=0x2031 +phy_chain_tx_lane_map_physical{61.0}=0x2031 +phy_chain_tx_lane_map_physical{65.0}=0x1230 +phy_chain_tx_lane_map_physical{69.0}=0x2013 +phy_chain_tx_lane_map_physical{73.0}=0x0213 +phy_chain_tx_lane_map_physical{77.0}=0x2310 +phy_chain_tx_lane_map_physical{81.0}=0x0321 +phy_chain_tx_lane_map_physical{85.0}=0x2013 +phy_chain_tx_lane_map_physical{89.0}=0x0213 +phy_chain_tx_lane_map_physical{9.0}=0x3012 +phy_chain_tx_lane_map_physical{93.0}=0x3102 +phy_chain_tx_lane_map_physical{97.0}=0x3210 +phy_chain_tx_polarity_flip_physical{1.0}=0x0 +phy_chain_tx_polarity_flip_physical{10.0}=0x1 +phy_chain_tx_polarity_flip_physical{100.0}=0x0 +phy_chain_tx_polarity_flip_physical{101.0}=0x0 +phy_chain_tx_polarity_flip_physical{102.0}=0x1 +phy_chain_tx_polarity_flip_physical{103.0}=0x0 +phy_chain_tx_polarity_flip_physical{104.0}=0x0 +phy_chain_tx_polarity_flip_physical{105.0}=0x0 +phy_chain_tx_polarity_flip_physical{106.0}=0x1 +phy_chain_tx_polarity_flip_physical{107.0}=0x1 +phy_chain_tx_polarity_flip_physical{108.0}=0x1 +phy_chain_tx_polarity_flip_physical{109.0}=0x0 +phy_chain_tx_polarity_flip_physical{11.0}=0x1 +phy_chain_tx_polarity_flip_physical{110.0}=0x0 +phy_chain_tx_polarity_flip_physical{111.0}=0x0 +phy_chain_tx_polarity_flip_physical{112.0}=0x1 +phy_chain_tx_polarity_flip_physical{113.0}=0x1 +phy_chain_tx_polarity_flip_physical{114.0}=0x1 +phy_chain_tx_polarity_flip_physical{115.0}=0x1 +phy_chain_tx_polarity_flip_physical{116.0}=0x0 +phy_chain_tx_polarity_flip_physical{117.0}=0x1 +phy_chain_tx_polarity_flip_physical{118.0}=0x0 +phy_chain_tx_polarity_flip_physical{119.0}=0x0 +phy_chain_tx_polarity_flip_physical{12.0}=0x0 +phy_chain_tx_polarity_flip_physical{120.0}=0x0 +phy_chain_tx_polarity_flip_physical{121.0}=0x0 +phy_chain_tx_polarity_flip_physical{122.0}=0x0 +phy_chain_tx_polarity_flip_physical{123.0}=0x0 +phy_chain_tx_polarity_flip_physical{124.0}=0x1 +phy_chain_tx_polarity_flip_physical{125.0}=0x0 +phy_chain_tx_polarity_flip_physical{126.0}=0x1 +phy_chain_tx_polarity_flip_physical{127.0}=0x1 +phy_chain_tx_polarity_flip_physical{128.0}=0x1 +phy_chain_tx_polarity_flip_physical{129.0}=0x1 +phy_chain_tx_polarity_flip_physical{13.0}=0x0 +phy_chain_tx_polarity_flip_physical{130.0}=0x0 +phy_chain_tx_polarity_flip_physical{131.0}=0x1 +phy_chain_tx_polarity_flip_physical{132.0}=0x0 +phy_chain_tx_polarity_flip_physical{133.0}=0x1 +phy_chain_tx_polarity_flip_physical{134.0}=0x1 +phy_chain_tx_polarity_flip_physical{135.0}=0x1 +phy_chain_tx_polarity_flip_physical{136.0}=0x1 +phy_chain_tx_polarity_flip_physical{137.0}=0x1 +phy_chain_tx_polarity_flip_physical{138.0}=0x1 +phy_chain_tx_polarity_flip_physical{139.0}=0x1 +phy_chain_tx_polarity_flip_physical{14.0}=0x1 +phy_chain_tx_polarity_flip_physical{140.0}=0x1 +phy_chain_tx_polarity_flip_physical{141.0}=0x0 +phy_chain_tx_polarity_flip_physical{142.0}=0x1 +phy_chain_tx_polarity_flip_physical{143.0}=0x1 +phy_chain_tx_polarity_flip_physical{144.0}=0x1 +phy_chain_tx_polarity_flip_physical{145.0}=0x1 +phy_chain_tx_polarity_flip_physical{146.0}=0x1 +phy_chain_tx_polarity_flip_physical{147.0}=0x1 +phy_chain_tx_polarity_flip_physical{148.0}=0x0 +phy_chain_tx_polarity_flip_physical{149.0}=0x1 +phy_chain_tx_polarity_flip_physical{15.0}=0x0 +phy_chain_tx_polarity_flip_physical{150.0}=0x0 +phy_chain_tx_polarity_flip_physical{151.0}=0x0 +phy_chain_tx_polarity_flip_physical{152.0}=0x0 +phy_chain_tx_polarity_flip_physical{153.0}=0x1 +phy_chain_tx_polarity_flip_physical{154.0}=0x0 +phy_chain_tx_polarity_flip_physical{155.0}=0x0 +phy_chain_tx_polarity_flip_physical{156.0}=0x0 +phy_chain_tx_polarity_flip_physical{157.0}=0x0 +phy_chain_tx_polarity_flip_physical{158.0}=0x0 +phy_chain_tx_polarity_flip_physical{159.0}=0x0 +phy_chain_tx_polarity_flip_physical{16.0}=0x0 +phy_chain_tx_polarity_flip_physical{160.0}=0x0 +phy_chain_tx_polarity_flip_physical{161.0}=0x0 +phy_chain_tx_polarity_flip_physical{162.0}=0x1 +phy_chain_tx_polarity_flip_physical{163.0}=0x1 +phy_chain_tx_polarity_flip_physical{164.0}=0x0 +phy_chain_tx_polarity_flip_physical{165.0}=0x1 +phy_chain_tx_polarity_flip_physical{166.0}=0x1 +phy_chain_tx_polarity_flip_physical{167.0}=0x1 +phy_chain_tx_polarity_flip_physical{168.0}=0x0 +phy_chain_tx_polarity_flip_physical{169.0}=0x0 +phy_chain_tx_polarity_flip_physical{17.0}=0x0 +phy_chain_tx_polarity_flip_physical{170.0}=0x1 +phy_chain_tx_polarity_flip_physical{171.0}=0x1 +phy_chain_tx_polarity_flip_physical{172.0}=0x1 +phy_chain_tx_polarity_flip_physical{173.0}=0x0 +phy_chain_tx_polarity_flip_physical{174.0}=0x0 +phy_chain_tx_polarity_flip_physical{175.0}=0x1 +phy_chain_tx_polarity_flip_physical{176.0}=0x0 +phy_chain_tx_polarity_flip_physical{177.0}=0x1 +phy_chain_tx_polarity_flip_physical{178.0}=0x0 +phy_chain_tx_polarity_flip_physical{179.0}=0x0 +phy_chain_tx_polarity_flip_physical{18.0}=0x1 +phy_chain_tx_polarity_flip_physical{180.0}=0x0 +phy_chain_tx_polarity_flip_physical{181.0}=0x0 +phy_chain_tx_polarity_flip_physical{182.0}=0x0 +phy_chain_tx_polarity_flip_physical{183.0}=0x0 +phy_chain_tx_polarity_flip_physical{184.0}=0x1 +phy_chain_tx_polarity_flip_physical{185.0}=0x0 +phy_chain_tx_polarity_flip_physical{186.0}=0x1 +phy_chain_tx_polarity_flip_physical{187.0}=0x1 +phy_chain_tx_polarity_flip_physical{188.0}=0x1 +phy_chain_tx_polarity_flip_physical{189.0}=0x0 +phy_chain_tx_polarity_flip_physical{19.0}=0x1 +phy_chain_tx_polarity_flip_physical{190.0}=0x0 +phy_chain_tx_polarity_flip_physical{191.0}=0x0 +phy_chain_tx_polarity_flip_physical{192.0}=0x0 +phy_chain_tx_polarity_flip_physical{193.0}=0x1 +phy_chain_tx_polarity_flip_physical{194.0}=0x1 +phy_chain_tx_polarity_flip_physical{195.0}=0x1 +phy_chain_tx_polarity_flip_physical{196.0}=0x0 +phy_chain_tx_polarity_flip_physical{197.0}=0x0 +phy_chain_tx_polarity_flip_physical{198.0}=0x1 +phy_chain_tx_polarity_flip_physical{199.0}=0x1 +phy_chain_tx_polarity_flip_physical{2.0}=0x1 +phy_chain_tx_polarity_flip_physical{20.0}=0x1 +phy_chain_tx_polarity_flip_physical{200.0}=0x1 +phy_chain_tx_polarity_flip_physical{201.0}=0x1 +phy_chain_tx_polarity_flip_physical{202.0}=0x1 +phy_chain_tx_polarity_flip_physical{203.0}=0x1 +phy_chain_tx_polarity_flip_physical{204.0}=0x1 +phy_chain_tx_polarity_flip_physical{205.0}=0x0 +phy_chain_tx_polarity_flip_physical{206.0}=0x1 +phy_chain_tx_polarity_flip_physical{207.0}=0x1 +phy_chain_tx_polarity_flip_physical{208.0}=0x1 +phy_chain_tx_polarity_flip_physical{209.0}=0x1 +phy_chain_tx_polarity_flip_physical{21.0}=0x0 +phy_chain_tx_polarity_flip_physical{210.0}=0x1 +phy_chain_tx_polarity_flip_physical{211.0}=0x1 +phy_chain_tx_polarity_flip_physical{212.0}=0x0 +phy_chain_tx_polarity_flip_physical{213.0}=0x0 +phy_chain_tx_polarity_flip_physical{214.0}=0x1 +phy_chain_tx_polarity_flip_physical{215.0}=0x0 +phy_chain_tx_polarity_flip_physical{216.0}=0x1 +phy_chain_tx_polarity_flip_physical{217.0}=0x1 +phy_chain_tx_polarity_flip_physical{218.0}=0x1 +phy_chain_tx_polarity_flip_physical{219.0}=0x0 +phy_chain_tx_polarity_flip_physical{22.0}=0x0 +phy_chain_tx_polarity_flip_physical{220.0}=0x1 +phy_chain_tx_polarity_flip_physical{221.0}=0x0 +phy_chain_tx_polarity_flip_physical{222.0}=0x0 +phy_chain_tx_polarity_flip_physical{223.0}=0x0 +phy_chain_tx_polarity_flip_physical{224.0}=0x1 +phy_chain_tx_polarity_flip_physical{225.0}=0x1 +phy_chain_tx_polarity_flip_physical{226.0}=0x1 +phy_chain_tx_polarity_flip_physical{227.0}=0x1 +phy_chain_tx_polarity_flip_physical{228.0}=0x0 +phy_chain_tx_polarity_flip_physical{229.0}=0x0 +phy_chain_tx_polarity_flip_physical{23.0}=0x0 +phy_chain_tx_polarity_flip_physical{230.0}=0x1 +phy_chain_tx_polarity_flip_physical{231.0}=0x1 +phy_chain_tx_polarity_flip_physical{232.0}=0x1 +phy_chain_tx_polarity_flip_physical{233.0}=0x0 +phy_chain_tx_polarity_flip_physical{234.0}=0x0 +phy_chain_tx_polarity_flip_physical{235.0}=0x0 +phy_chain_tx_polarity_flip_physical{236.0}=0x0 +phy_chain_tx_polarity_flip_physical{237.0}=0x1 +phy_chain_tx_polarity_flip_physical{238.0}=0x1 +phy_chain_tx_polarity_flip_physical{239.0}=0x1 +phy_chain_tx_polarity_flip_physical{24.0}=0x0 +phy_chain_tx_polarity_flip_physical{240.0}=0x0 +phy_chain_tx_polarity_flip_physical{241.0}=0x1 +phy_chain_tx_polarity_flip_physical{242.0}=0x1 +phy_chain_tx_polarity_flip_physical{243.0}=0x1 +phy_chain_tx_polarity_flip_physical{244.0}=0x0 +phy_chain_tx_polarity_flip_physical{245.0}=0x1 +phy_chain_tx_polarity_flip_physical{246.0}=0x1 +phy_chain_tx_polarity_flip_physical{247.0}=0x1 +phy_chain_tx_polarity_flip_physical{248.0}=0x1 +phy_chain_tx_polarity_flip_physical{249.0}=0x1 +phy_chain_tx_polarity_flip_physical{25.0}=0x1 +phy_chain_tx_polarity_flip_physical{250.0}=0x0 +phy_chain_tx_polarity_flip_physical{251.0}=0x0 +phy_chain_tx_polarity_flip_physical{252.0}=0x0 +phy_chain_tx_polarity_flip_physical{253.0}=0x1 +phy_chain_tx_polarity_flip_physical{254.0}=0x1 +phy_chain_tx_polarity_flip_physical{255.0}=0x1 +phy_chain_tx_polarity_flip_physical{256.0}=0x0 +phy_chain_tx_polarity_flip_physical{257.0}=0x0 +phy_chain_tx_polarity_flip_physical{259.0}=0x0 +phy_chain_tx_polarity_flip_physical{26.0}=0x0 +phy_chain_tx_polarity_flip_physical{27.0}=0x0 +phy_chain_tx_polarity_flip_physical{28.0}=0x0 +phy_chain_tx_polarity_flip_physical{29.0}=0x1 +phy_chain_tx_polarity_flip_physical{3.0}=0x1 +phy_chain_tx_polarity_flip_physical{30.0}=0x1 +phy_chain_tx_polarity_flip_physical{31.0}=0x1 +phy_chain_tx_polarity_flip_physical{32.0}=0x0 +phy_chain_tx_polarity_flip_physical{33.0}=0x0 +phy_chain_tx_polarity_flip_physical{34.0}=0x0 +phy_chain_tx_polarity_flip_physical{35.0}=0x0 +phy_chain_tx_polarity_flip_physical{36.0}=0x1 +phy_chain_tx_polarity_flip_physical{37.0}=0x1 +phy_chain_tx_polarity_flip_physical{38.0}=0x1 +phy_chain_tx_polarity_flip_physical{39.0}=0x1 +phy_chain_tx_polarity_flip_physical{4.0}=0x1 +phy_chain_tx_polarity_flip_physical{40.0}=0x0 +phy_chain_tx_polarity_flip_physical{41.0}=0x0 +phy_chain_tx_polarity_flip_physical{42.0}=0x0 +phy_chain_tx_polarity_flip_physical{43.0}=0x0 +phy_chain_tx_polarity_flip_physical{44.0}=0x0 +phy_chain_tx_polarity_flip_physical{45.0}=0x1 +phy_chain_tx_polarity_flip_physical{46.0}=0x0 +phy_chain_tx_polarity_flip_physical{47.0}=0x1 +phy_chain_tx_polarity_flip_physical{48.0}=0x1 +phy_chain_tx_polarity_flip_physical{49.0}=0x0 +phy_chain_tx_polarity_flip_physical{5.0}=0x1 +phy_chain_tx_polarity_flip_physical{50.0}=0x0 +phy_chain_tx_polarity_flip_physical{51.0}=0x0 +phy_chain_tx_polarity_flip_physical{52.0}=0x1 +phy_chain_tx_polarity_flip_physical{53.0}=0x0 +phy_chain_tx_polarity_flip_physical{54.0}=0x1 +phy_chain_tx_polarity_flip_physical{55.0}=0x1 +phy_chain_tx_polarity_flip_physical{56.0}=0x0 +phy_chain_tx_polarity_flip_physical{57.0}=0x0 +phy_chain_tx_polarity_flip_physical{58.0}=0x1 +phy_chain_tx_polarity_flip_physical{59.0}=0x1 +phy_chain_tx_polarity_flip_physical{6.0}=0x1 +phy_chain_tx_polarity_flip_physical{60.0}=0x1 +phy_chain_tx_polarity_flip_physical{61.0}=0x0 +phy_chain_tx_polarity_flip_physical{62.0}=0x1 +phy_chain_tx_polarity_flip_physical{63.0}=0x1 +phy_chain_tx_polarity_flip_physical{64.0}=0x1 +phy_chain_tx_polarity_flip_physical{65.0}=0x0 +phy_chain_tx_polarity_flip_physical{66.0}=0x1 +phy_chain_tx_polarity_flip_physical{67.0}=0x1 +phy_chain_tx_polarity_flip_physical{68.0}=0x0 +phy_chain_tx_polarity_flip_physical{69.0}=0x1 +phy_chain_tx_polarity_flip_physical{7.0}=0x1 +phy_chain_tx_polarity_flip_physical{70.0}=0x1 +phy_chain_tx_polarity_flip_physical{71.0}=0x1 +phy_chain_tx_polarity_flip_physical{72.0}=0x0 +phy_chain_tx_polarity_flip_physical{73.0}=0x1 +phy_chain_tx_polarity_flip_physical{74.0}=0x0 +phy_chain_tx_polarity_flip_physical{75.0}=0x0 +phy_chain_tx_polarity_flip_physical{76.0}=0x0 +phy_chain_tx_polarity_flip_physical{77.0}=0x0 +phy_chain_tx_polarity_flip_physical{78.0}=0x0 +phy_chain_tx_polarity_flip_physical{79.0}=0x1 +phy_chain_tx_polarity_flip_physical{8.0}=0x0 +phy_chain_tx_polarity_flip_physical{80.0}=0x0 +phy_chain_tx_polarity_flip_physical{81.0}=0x1 +phy_chain_tx_polarity_flip_physical{82.0}=0x1 +phy_chain_tx_polarity_flip_physical{83.0}=0x1 +phy_chain_tx_polarity_flip_physical{84.0}=0x0 +phy_chain_tx_polarity_flip_physical{85.0}=0x1 +phy_chain_tx_polarity_flip_physical{86.0}=0x0 +phy_chain_tx_polarity_flip_physical{87.0}=0x0 +phy_chain_tx_polarity_flip_physical{88.0}=0x0 +phy_chain_tx_polarity_flip_physical{89.0}=0x1 +phy_chain_tx_polarity_flip_physical{9.0}=0x0 +phy_chain_tx_polarity_flip_physical{90.0}=0x1 +phy_chain_tx_polarity_flip_physical{91.0}=0x1 +phy_chain_tx_polarity_flip_physical{92.0}=0x0 +phy_chain_tx_polarity_flip_physical{93.0}=0x0 +phy_chain_tx_polarity_flip_physical{94.0}=0x0 +phy_chain_tx_polarity_flip_physical{95.0}=0x0 +phy_chain_tx_polarity_flip_physical{96.0}=0x0 +phy_chain_tx_polarity_flip_physical{97.0}=0x0 +phy_chain_tx_polarity_flip_physical{98.0}=0x1 +phy_chain_tx_polarity_flip_physical{99.0}=0x1 + +port_init_cl72_hg=1 + + + + + + + +robust_hash_disable_egress_vlan=1 +robust_hash_disable_mpls=1 +robust_hash_disable_vlan=1 +stable_size=0x5500000 +stable_size=0x5500000 +tdma_timeout_usec=15000000 +tslam_timeout_usec=15000000 +dport_map_direct=1 +portmap_1=5:50 +portmap_2=7:50 +portmap_3=13:50 +portmap_4=15:50 +portmap_5=25:50 +portmap_6=27:50 +portmap_7=21:50 +portmap_8=23:50 +portmap_9=37:50 +portmap_10=39:50 +portmap_11=45:50 +portmap_12=47:50 +portmap_13=57:100 +portmap_14=53:100 +portmap_15=9:50 +portmap_16=11:50 +portmap_17=1:50 +portmap_18=3:50 +portmap_19=17:50 +portmap_20=19:50 +portmap_21=29:50 +portmap_22=31:50 +portmap_23=41:50 +portmap_24=43:50 +portmap_25=33:50 +portmap_26=35:50 +portmap_27=49:50 +portmap_28=51:50 +portmap_29=61:50 +portmap_30=63:50 +portmap_34=77:50 +portmap_35=79:50 +portmap_36=65:50 +portmap_37=67:50 +portmap_38=85:50 +portmap_39=87:50 +portmap_40=89:50 +portmap_41=91:50 +portmap_42=109:50 +portmap_43=111:50 +portmap_44=97:50 +portmap_45=99:50 +portmap_46=117:100 +portmap_47=121:100 +portmap_48=69:50 +portmap_49=71:50 +portmap_50=73:50 +portmap_51=75:50 +portmap_52=93:50 +portmap_53=95:50 +portmap_54=81:50 +portmap_55=83:50 +portmap_56=101:50 +portmap_57=103:50 +portmap_58=105:50 +portmap_59=107:50 +portmap_60=125:50 +portmap_61=127:50 +portmap_62=113:50 +portmap_63=115:50 +portmap_66=257:10 +portmap_68=141:100 +portmap_69=133:100 +portmap_70=149:50 +portmap_71=151:50 +portmap_72=153:50 +portmap_73=155:50 +portmap_74=173:50 +portmap_75=175:50 +portmap_76=161:50 +portmap_77=163:50 +portmap_78=181:50 +portmap_79=183:50 +portmap_80=185:50 +portmap_81=187:50 +portmap_82=129:50 +portmap_83=131:50 +portmap_84=137:50 +portmap_85=139:50 +portmap_86=157:50 +portmap_87=159:50 +portmap_88=145:50 +portmap_89=147:50 +portmap_90=165:50 +portmap_91=167:50 +portmap_92=169:50 +portmap_93=171:50 +portmap_94=189:50 +portmap_95=191:50 +portmap_96=177:50 +portmap_97=179:50 +portmap_100=259:10 +portmap_102=197:100 +portmap_103=205:100 +portmap_104=217:50 +portmap_105=219:50 +portmap_106=213:50 +portmap_107=215:50 +portmap_108=229:50 +portmap_109=231:50 +portmap_110=237:50 +portmap_111=239:50 +portmap_112=249:50 +portmap_113=251:50 +portmap_114=245:50 +portmap_115=247:50 +portmap_116=201:50 +portmap_117=203:50 +portmap_118=193:50 +portmap_119=195:50 +portmap_120=209:50 +portmap_121=211:50 +portmap_122=221:50 +portmap_123=223:50 +portmap_124=233:50 +portmap_125=235:50 +portmap_126=225:50 +portmap_127=227:50 +portmap_128=241:50 +portmap_129=243:50 +portmap_130=253:50 +portmap_131=255:50 + +# tuning parameters +serdes_preemphasis_1=0x580c +serdes_preemphasis_2=0x580c +serdes_preemphasis_3=0x580c +serdes_preemphasis_4=0x580c +serdes_preemphasis_5=0x580c +serdes_preemphasis_6=0x580c +serdes_preemphasis_7=0x580c +serdes_preemphasis_8=0x580c +serdes_preemphasis_9=0x580c +serdes_preemphasis_10=0x580c +serdes_preemphasis_11=0x580c +serdes_preemphasis_12=0x580c +serdes_preemphasis_13=0x144108 +serdes_preemphasis_14=0x144108 +serdes_preemphasis_15=0x580c +serdes_preemphasis_16=0x580c +serdes_preemphasis_17=0x580c +serdes_preemphasis_18=0x580c +serdes_preemphasis_19=0x580c +serdes_preemphasis_20=0x580c +serdes_preemphasis_21=0x580c +serdes_preemphasis_22=0x580c +serdes_preemphasis_23=0x580c +serdes_preemphasis_24=0x580c +serdes_preemphasis_25=0x580c +serdes_preemphasis_26=0x580c +serdes_preemphasis_27=0x580c +serdes_preemphasis_28=0x580c +serdes_preemphasis_29=0x580c +serdes_preemphasis_30=0x580c +serdes_preemphasis_34=0x580c +serdes_preemphasis_35=0x580c +serdes_preemphasis_36=0x580c +serdes_preemphasis_37=0x580c +serdes_preemphasis_38=0x580c +serdes_preemphasis_39=0x580c +serdes_preemphasis_40=0x580c +serdes_preemphasis_41=0x580c +serdes_preemphasis_42=0x580c +serdes_preemphasis_43=0x580c +serdes_preemphasis_44=0x580c +serdes_preemphasis_45=0x580c +serdes_preemphasis_46=0x144108 +serdes_preemphasis_47=0x103a07 +serdes_preemphasis_48=0x580c +serdes_preemphasis_49=0x580c +serdes_preemphasis_50=0x580c +serdes_preemphasis_51=0x580c +serdes_preemphasis_52=0x580c +serdes_preemphasis_53=0x580c +serdes_preemphasis_54=0x580c +serdes_preemphasis_55=0x580c +serdes_preemphasis_56=0x580c +serdes_preemphasis_57=0x580c +serdes_preemphasis_58=0x580c +serdes_preemphasis_59=0x580c +serdes_preemphasis_60=0x580c +serdes_preemphasis_61=0x580c +serdes_preemphasis_62=0x580c +serdes_preemphasis_63=0x580c +serdes_preemphasis_66=0x43004 +serdes_preemphasis_68=0x184606 +serdes_preemphasis_69=0x184407 +serdes_preemphasis_70=0x580c +serdes_preemphasis_71=0x580c +serdes_preemphasis_72=0x580c +serdes_preemphasis_73=0x580c +serdes_preemphasis_74=0x580c +serdes_preemphasis_75=0x580c +serdes_preemphasis_76=0x580c +serdes_preemphasis_77=0x580c +serdes_preemphasis_78=0x580c +serdes_preemphasis_79=0x580c +serdes_preemphasis_80=0x580c +serdes_preemphasis_81=0x580c +serdes_preemphasis_82=0x580c +serdes_preemphasis_83=0x580c +serdes_preemphasis_84=0x580c +serdes_preemphasis_85=0x580c +serdes_preemphasis_86=0x580c +serdes_preemphasis_87=0x580c +serdes_preemphasis_88=0x580c +serdes_preemphasis_89=0x580c +serdes_preemphasis_90=0x580c +serdes_preemphasis_91=0x580c +serdes_preemphasis_92=0x580c +serdes_preemphasis_93=0x580c +serdes_preemphasis_94=0x580c +serdes_preemphasis_95=0x580c +serdes_preemphasis_96=0x580c +serdes_preemphasis_97=0x580c +serdes_preemphasis_100=0x43004 +serdes_preemphasis_102=0x174507 +serdes_preemphasis_103=0x184606 +serdes_preemphasis_104=0x580c +serdes_preemphasis_105=0x580c +serdes_preemphasis_106=0x580c +serdes_preemphasis_107=0x580c +serdes_preemphasis_108=0x580c +serdes_preemphasis_109=0x580c +serdes_preemphasis_110=0x580c +serdes_preemphasis_111=0x580c +serdes_preemphasis_112=0x580c +serdes_preemphasis_113=0x580c +serdes_preemphasis_114=0x580c +serdes_preemphasis_115=0x580c +serdes_preemphasis_116=0x580c +serdes_preemphasis_117=0x580c +serdes_preemphasis_118=0x580c +serdes_preemphasis_119=0x580c +serdes_preemphasis_120=0x580c +serdes_preemphasis_121=0x580c +serdes_preemphasis_122=0x580c +serdes_preemphasis_123=0x580c +serdes_preemphasis_124=0x580c +serdes_preemphasis_125=0x580c +serdes_preemphasis_126=0x580c +serdes_preemphasis_127=0x580c +serdes_preemphasis_128=0x580c +serdes_preemphasis_129=0x580c +serdes_preemphasis_130=0x580c +serdes_preemphasis_131=0x580c + +mmu_init_config="MSFT-TH2-Tier0" +{{ IPinIP_sock }} + +phy_an_lt_msft=1 diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8/pg_profile_lookup.ini b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8/pg_profile_lookup.ini deleted file mode 100644 index ed0005610b71..000000000000 --- a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8/pg_profile_lookup.ini +++ /dev/null @@ -1,8 +0,0 @@ -# PG lossless profiles. -# speed cable size xon xoff threshold xon_offset - 50000 5m 1248 1248 56160 -3 2496 - 100000 5m 1248 1248 96928 -3 2496 - 50000 40m 1248 1248 96096 -3 2496 - 100000 40m 1248 1248 177632 -3 2496 - 50000 300m 1248 1248 141856 -3 2496 - 100000 300m 1248 1248 268736 -3 2496 diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8/pg_profile_lookup.ini b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8/pg_profile_lookup.ini new file mode 120000 index 000000000000..297cddb2d223 --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8/pg_profile_lookup.ini @@ -0,0 +1 @@ +BALANCED/pg_profile_lookup.ini \ No newline at end of file diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8/qos.json.j2 b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8/qos.json.j2 deleted file mode 100644 index 3e548325ea30..000000000000 --- a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8/qos.json.j2 +++ /dev/null @@ -1 +0,0 @@ -{%- include 'qos_config.j2' %} diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8/qos.json.j2 b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8/qos.json.j2 new file mode 120000 index 000000000000..aef6b6765cf2 --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8/qos.json.j2 @@ -0,0 +1 @@ +BALANCED/qos.json.j2 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8/sai.profile b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8/sai.profile index 166f5c5b6e1a..5163d6140f0e 100644 --- a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8/sai.profile +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8/sai.profile @@ -1,2 +1,2 @@ -SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/th2-a7260cx3-64-112x50G+8x100G.config.bcm +SAI_INIT_CONFIG_FILE=/etc/sai.d/config.bcm SAI_NUM_ECMP_MEMBERS=64 diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8/th2-a7260cx3-64-112x50G+8x100G.config.bcm b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8/th2-a7260cx3-64-112x50G+8x100G.config.bcm deleted file mode 100644 index 6e4c266b1db4..000000000000 --- a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8/th2-a7260cx3-64-112x50G+8x100G.config.bcm +++ /dev/null @@ -1,936 +0,0 @@ -PHY_AN_ALLOW_PLL_CHANGE=1 -arl_clean_timeout_usec=15000000 -asf_mem_profile=2 -bcm_num_cos=10 -bcm_stat_flags=1 -bcm_stat_jumbo=9236 -cdma_timeout_usec=15000000 -core_clock_frequency=1700 -dma_desc_timeout_usec=15000000 -dpp_clock_ratio=2:3 -higig2_hdr_mode=1 -ipv6_lpm_128b_enable=1 -l3_alpm_enable=2 -lpm_scaling_enable=0 -l2xmsg_mode=1 -max_vp_lags=0 -mem_scan_enable=1 -miim_intr_enable=0 -module_64ports=1 -os=unix -oversubscribe_mode=1 -pbmp_xport_xe=0xfffffffd3fffffff4fffffffc7ffffffe -#pbmp_xport_xe=0x47fffffff1fffffffcfffffffe7ffffffe -phy_an_allow_pll_change_hg=0 -phy_an_c73=1 -phy_chain_rx_lane_map_physical{1.0}=0x3210 -phy_chain_rx_lane_map_physical{101.0}=0x0123 -phy_chain_rx_lane_map_physical{105.0}=0x0123 -phy_chain_rx_lane_map_physical{109.0}=0x0123 -phy_chain_rx_lane_map_physical{113.0}=0x2301 -phy_chain_rx_lane_map_physical{117.0}=0x3210 -phy_chain_rx_lane_map_physical{121.0}=0x3210 -phy_chain_rx_lane_map_physical{125.0}=0x1203 -phy_chain_rx_lane_map_physical{129.0}=0x3210 -phy_chain_rx_lane_map_physical{13.0}=0x0321 -phy_chain_rx_lane_map_physical{133.0}=0x1032 -phy_chain_rx_lane_map_physical{137.0}=0x3210 -phy_chain_rx_lane_map_physical{141.0}=0x0123 -phy_chain_rx_lane_map_physical{145.0}=0x3210 -phy_chain_rx_lane_map_physical{149.0}=0x2310 -phy_chain_rx_lane_map_physical{153.0}=0x0132 -phy_chain_rx_lane_map_physical{157.0}=0x1302 -phy_chain_rx_lane_map_physical{161.0}=0x3021 -phy_chain_rx_lane_map_physical{165.0}=0x2031 -phy_chain_rx_lane_map_physical{169.0}=0x2031 -phy_chain_rx_lane_map_physical{17.0}=0x3210 -phy_chain_rx_lane_map_physical{173.0}=0x1302 -phy_chain_rx_lane_map_physical{177.0}=0x2031 -phy_chain_rx_lane_map_physical{181.0}=0x0213 -phy_chain_rx_lane_map_physical{185.0}=0x0213 -phy_chain_rx_lane_map_physical{189.0}=0x1302 -phy_chain_rx_lane_map_physical{193.0}=0x3120 -phy_chain_rx_lane_map_physical{197.0}=0x0231 -phy_chain_rx_lane_map_physical{201.0}=0x2031 -phy_chain_rx_lane_map_physical{205.0}=0x0213 -phy_chain_rx_lane_map_physical{209.0}=0x2013 -phy_chain_rx_lane_map_physical{21.0}=0x3021 -phy_chain_rx_lane_map_physical{213.0}=0x3021 -phy_chain_rx_lane_map_physical{217.0}=0x0231 -phy_chain_rx_lane_map_physical{221.0}=0x2031 -phy_chain_rx_lane_map_physical{225.0}=0x1203 -phy_chain_rx_lane_map_physical{229.0}=0x1230 -phy_chain_rx_lane_map_physical{233.0}=0x3021 -phy_chain_rx_lane_map_physical{237.0}=0x1032 -phy_chain_rx_lane_map_physical{241.0}=0x2301 -phy_chain_rx_lane_map_physical{245.0}=0x0321 -phy_chain_rx_lane_map_physical{249.0}=0x2301 -phy_chain_rx_lane_map_physical{25.0}=0x2301 -phy_chain_rx_lane_map_physical{253.0}=0x2301 -phy_chain_rx_lane_map_physical{257.0}=0x3210 -phy_chain_rx_lane_map_physical{29.0}=0x3021 -phy_chain_rx_lane_map_physical{33.0}=0x1302 -phy_chain_rx_lane_map_physical{37.0}=0x2031 -phy_chain_rx_lane_map_physical{41.0}=0x3021 -phy_chain_rx_lane_map_physical{45.0}=0x1023 -phy_chain_rx_lane_map_physical{49.0}=0x0213 -phy_chain_rx_lane_map_physical{5.0}=0x3201 -phy_chain_rx_lane_map_physical{53.0}=0x3201 -phy_chain_rx_lane_map_physical{57.0}=0x2013 -phy_chain_rx_lane_map_physical{61.0}=0x0213 -phy_chain_rx_lane_map_physical{65.0}=0x1203 -phy_chain_rx_lane_map_physical{69.0}=0x0213 -phy_chain_rx_lane_map_physical{73.0}=0x0213 -phy_chain_rx_lane_map_physical{77.0}=0x3120 -phy_chain_rx_lane_map_physical{81.0}=0x0213 -phy_chain_rx_lane_map_physical{85.0}=0x2031 -phy_chain_rx_lane_map_physical{89.0}=0x2031 -phy_chain_rx_lane_map_physical{9.0}=0x0321 -phy_chain_rx_lane_map_physical{93.0}=0x3120 -phy_chain_rx_lane_map_physical{97.0}=0x1203 -phy_chain_rx_polarity_flip_physical{1.0}=0x1 -phy_chain_rx_polarity_flip_physical{10.0}=0x0 -phy_chain_rx_polarity_flip_physical{100.0}=0x1 -phy_chain_rx_polarity_flip_physical{101.0}=0x1 -phy_chain_rx_polarity_flip_physical{102.0}=0x0 -phy_chain_rx_polarity_flip_physical{103.0}=0x1 -phy_chain_rx_polarity_flip_physical{104.0}=0x0 -phy_chain_rx_polarity_flip_physical{105.0}=0x1 -phy_chain_rx_polarity_flip_physical{106.0}=0x0 -phy_chain_rx_polarity_flip_physical{107.0}=0x1 -phy_chain_rx_polarity_flip_physical{108.0}=0x0 -phy_chain_rx_polarity_flip_physical{109.0}=0x0 -phy_chain_rx_polarity_flip_physical{11.0}=0x1 -phy_chain_rx_polarity_flip_physical{110.0}=0x1 -phy_chain_rx_polarity_flip_physical{111.0}=0x0 -phy_chain_rx_polarity_flip_physical{112.0}=0x1 -phy_chain_rx_polarity_flip_physical{113.0}=0x1 -phy_chain_rx_polarity_flip_physical{114.0}=0x0 -phy_chain_rx_polarity_flip_physical{115.0}=0x1 -phy_chain_rx_polarity_flip_physical{116.0}=0x0 -phy_chain_rx_polarity_flip_physical{117.0}=0x0 -phy_chain_rx_polarity_flip_physical{118.0}=0x0 -phy_chain_rx_polarity_flip_physical{119.0}=0x1 -phy_chain_rx_polarity_flip_physical{12.0}=0x1 -phy_chain_rx_polarity_flip_physical{120.0}=0x0 -phy_chain_rx_polarity_flip_physical{121.0}=0x1 -phy_chain_rx_polarity_flip_physical{122.0}=0x0 -phy_chain_rx_polarity_flip_physical{123.0}=0x1 -phy_chain_rx_polarity_flip_physical{124.0}=0x0 -phy_chain_rx_polarity_flip_physical{125.0}=0x0 -phy_chain_rx_polarity_flip_physical{126.0}=0x1 -phy_chain_rx_polarity_flip_physical{127.0}=0x1 -phy_chain_rx_polarity_flip_physical{128.0}=0x1 -phy_chain_rx_polarity_flip_physical{129.0}=0x0 -phy_chain_rx_polarity_flip_physical{13.0}=0x1 -phy_chain_rx_polarity_flip_physical{130.0}=0x1 -phy_chain_rx_polarity_flip_physical{131.0}=0x1 -phy_chain_rx_polarity_flip_physical{132.0}=0x0 -phy_chain_rx_polarity_flip_physical{133.0}=0x1 -phy_chain_rx_polarity_flip_physical{134.0}=0x1 -phy_chain_rx_polarity_flip_physical{135.0}=0x1 -phy_chain_rx_polarity_flip_physical{136.0}=0x0 -phy_chain_rx_polarity_flip_physical{137.0}=0x0 -phy_chain_rx_polarity_flip_physical{138.0}=0x0 -phy_chain_rx_polarity_flip_physical{139.0}=0x1 -phy_chain_rx_polarity_flip_physical{14.0}=0x0 -phy_chain_rx_polarity_flip_physical{140.0}=0x0 -phy_chain_rx_polarity_flip_physical{141.0}=0x1 -phy_chain_rx_polarity_flip_physical{142.0}=0x0 -phy_chain_rx_polarity_flip_physical{143.0}=0x1 -phy_chain_rx_polarity_flip_physical{144.0}=0x0 -phy_chain_rx_polarity_flip_physical{145.0}=0x1 -phy_chain_rx_polarity_flip_physical{146.0}=0x0 -phy_chain_rx_polarity_flip_physical{147.0}=0x1 -phy_chain_rx_polarity_flip_physical{148.0}=0x0 -phy_chain_rx_polarity_flip_physical{149.0}=0x0 -phy_chain_rx_polarity_flip_physical{15.0}=0x1 -phy_chain_rx_polarity_flip_physical{150.0}=0x1 -phy_chain_rx_polarity_flip_physical{151.0}=0x1 -phy_chain_rx_polarity_flip_physical{152.0}=0x0 -phy_chain_rx_polarity_flip_physical{153.0}=0x0 -phy_chain_rx_polarity_flip_physical{154.0}=0x1 -phy_chain_rx_polarity_flip_physical{155.0}=0x1 -phy_chain_rx_polarity_flip_physical{156.0}=0x0 -phy_chain_rx_polarity_flip_physical{157.0}=0x0 -phy_chain_rx_polarity_flip_physical{158.0}=0x0 -phy_chain_rx_polarity_flip_physical{159.0}=0x1 -phy_chain_rx_polarity_flip_physical{16.0}=0x0 -phy_chain_rx_polarity_flip_physical{160.0}=0x0 -phy_chain_rx_polarity_flip_physical{161.0}=0x1 -phy_chain_rx_polarity_flip_physical{162.0}=0x1 -phy_chain_rx_polarity_flip_physical{163.0}=0x0 -phy_chain_rx_polarity_flip_physical{164.0}=0x1 -phy_chain_rx_polarity_flip_physical{165.0}=0x0 -phy_chain_rx_polarity_flip_physical{166.0}=0x0 -phy_chain_rx_polarity_flip_physical{167.0}=0x1 -phy_chain_rx_polarity_flip_physical{168.0}=0x1 -phy_chain_rx_polarity_flip_physical{169.0}=0x1 -phy_chain_rx_polarity_flip_physical{17.0}=0x1 -phy_chain_rx_polarity_flip_physical{170.0}=0x1 -phy_chain_rx_polarity_flip_physical{171.0}=0x0 -phy_chain_rx_polarity_flip_physical{172.0}=0x0 -phy_chain_rx_polarity_flip_physical{173.0}=0x0 -phy_chain_rx_polarity_flip_physical{174.0}=0x0 -phy_chain_rx_polarity_flip_physical{175.0}=0x1 -phy_chain_rx_polarity_flip_physical{176.0}=0x1 -phy_chain_rx_polarity_flip_physical{177.0}=0x1 -phy_chain_rx_polarity_flip_physical{178.0}=0x1 -phy_chain_rx_polarity_flip_physical{179.0}=0x0 -phy_chain_rx_polarity_flip_physical{18.0}=0x0 -phy_chain_rx_polarity_flip_physical{180.0}=0x0 -phy_chain_rx_polarity_flip_physical{181.0}=0x1 -phy_chain_rx_polarity_flip_physical{182.0}=0x1 -phy_chain_rx_polarity_flip_physical{183.0}=0x0 -phy_chain_rx_polarity_flip_physical{184.0}=0x0 -phy_chain_rx_polarity_flip_physical{185.0}=0x0 -phy_chain_rx_polarity_flip_physical{186.0}=0x0 -phy_chain_rx_polarity_flip_physical{187.0}=0x1 -phy_chain_rx_polarity_flip_physical{188.0}=0x1 -phy_chain_rx_polarity_flip_physical{189.0}=0x0 -phy_chain_rx_polarity_flip_physical{19.0}=0x1 -phy_chain_rx_polarity_flip_physical{190.0}=0x0 -phy_chain_rx_polarity_flip_physical{191.0}=0x1 -phy_chain_rx_polarity_flip_physical{192.0}=0x0 -phy_chain_rx_polarity_flip_physical{193.0}=0x0 -phy_chain_rx_polarity_flip_physical{194.0}=0x0 -phy_chain_rx_polarity_flip_physical{195.0}=0x1 -phy_chain_rx_polarity_flip_physical{196.0}=0x1 -phy_chain_rx_polarity_flip_physical{197.0}=0x1 -phy_chain_rx_polarity_flip_physical{198.0}=0x1 -phy_chain_rx_polarity_flip_physical{199.0}=0x0 -phy_chain_rx_polarity_flip_physical{2.0}=0x0 -phy_chain_rx_polarity_flip_physical{20.0}=0x0 -phy_chain_rx_polarity_flip_physical{200.0}=0x0 -phy_chain_rx_polarity_flip_physical{201.0}=0x0 -phy_chain_rx_polarity_flip_physical{202.0}=0x0 -phy_chain_rx_polarity_flip_physical{203.0}=0x1 -phy_chain_rx_polarity_flip_physical{204.0}=0x0 -phy_chain_rx_polarity_flip_physical{205.0}=0x1 -phy_chain_rx_polarity_flip_physical{206.0}=0x1 -phy_chain_rx_polarity_flip_physical{207.0}=0x0 -phy_chain_rx_polarity_flip_physical{208.0}=0x0 -phy_chain_rx_polarity_flip_physical{209.0}=0x1 -phy_chain_rx_polarity_flip_physical{21.0}=0x0 -phy_chain_rx_polarity_flip_physical{210.0}=0x1 -phy_chain_rx_polarity_flip_physical{211.0}=0x0 -phy_chain_rx_polarity_flip_physical{212.0}=0x0 -phy_chain_rx_polarity_flip_physical{213.0}=0x0 -phy_chain_rx_polarity_flip_physical{214.0}=0x0 -phy_chain_rx_polarity_flip_physical{215.0}=0x1 -phy_chain_rx_polarity_flip_physical{216.0}=0x0 -phy_chain_rx_polarity_flip_physical{217.0}=0x0 -phy_chain_rx_polarity_flip_physical{218.0}=0x0 -phy_chain_rx_polarity_flip_physical{219.0}=0x1 -phy_chain_rx_polarity_flip_physical{22.0}=0x0 -phy_chain_rx_polarity_flip_physical{220.0}=0x1 -phy_chain_rx_polarity_flip_physical{221.0}=0x0 -phy_chain_rx_polarity_flip_physical{222.0}=0x0 -phy_chain_rx_polarity_flip_physical{223.0}=0x1 -phy_chain_rx_polarity_flip_physical{224.0}=0x1 -phy_chain_rx_polarity_flip_physical{225.0}=0x1 -phy_chain_rx_polarity_flip_physical{226.0}=0x0 -phy_chain_rx_polarity_flip_physical{227.0}=0x0 -phy_chain_rx_polarity_flip_physical{228.0}=0x1 -phy_chain_rx_polarity_flip_physical{229.0}=0x0 -phy_chain_rx_polarity_flip_physical{23.0}=0x1 -phy_chain_rx_polarity_flip_physical{230.0}=0x0 -phy_chain_rx_polarity_flip_physical{231.0}=0x1 -phy_chain_rx_polarity_flip_physical{232.0}=0x1 -phy_chain_rx_polarity_flip_physical{233.0}=0x1 -phy_chain_rx_polarity_flip_physical{234.0}=0x0 -phy_chain_rx_polarity_flip_physical{235.0}=0x0 -phy_chain_rx_polarity_flip_physical{236.0}=0x0 -phy_chain_rx_polarity_flip_physical{237.0}=0x1 -phy_chain_rx_polarity_flip_physical{238.0}=0x0 -phy_chain_rx_polarity_flip_physical{239.0}=0x1 -phy_chain_rx_polarity_flip_physical{24.0}=0x0 -phy_chain_rx_polarity_flip_physical{240.0}=0x0 -phy_chain_rx_polarity_flip_physical{241.0}=0x1 -phy_chain_rx_polarity_flip_physical{242.0}=0x0 -phy_chain_rx_polarity_flip_physical{243.0}=0x1 -phy_chain_rx_polarity_flip_physical{244.0}=0x0 -phy_chain_rx_polarity_flip_physical{245.0}=0x1 -phy_chain_rx_polarity_flip_physical{246.0}=0x1 -phy_chain_rx_polarity_flip_physical{247.0}=0x1 -phy_chain_rx_polarity_flip_physical{248.0}=0x0 -phy_chain_rx_polarity_flip_physical{249.0}=0x0 -phy_chain_rx_polarity_flip_physical{25.0}=0x1 -phy_chain_rx_polarity_flip_physical{250.0}=0x1 -phy_chain_rx_polarity_flip_physical{251.0}=0x0 -phy_chain_rx_polarity_flip_physical{252.0}=0x1 -phy_chain_rx_polarity_flip_physical{253.0}=0x1 -phy_chain_rx_polarity_flip_physical{254.0}=0x0 -phy_chain_rx_polarity_flip_physical{255.0}=0x1 -phy_chain_rx_polarity_flip_physical{256.0}=0x0 -phy_chain_rx_polarity_flip_physical{257.0}=0x0 -phy_chain_rx_polarity_flip_physical{259.0}=0x0 -phy_chain_rx_polarity_flip_physical{26.0}=0x0 -phy_chain_rx_polarity_flip_physical{27.0}=0x1 -phy_chain_rx_polarity_flip_physical{28.0}=0x0 -phy_chain_rx_polarity_flip_physical{29.0}=0x0 -phy_chain_rx_polarity_flip_physical{3.0}=0x1 -phy_chain_rx_polarity_flip_physical{30.0}=0x0 -phy_chain_rx_polarity_flip_physical{31.0}=0x0 -phy_chain_rx_polarity_flip_physical{32.0}=0x1 -phy_chain_rx_polarity_flip_physical{33.0}=0x0 -phy_chain_rx_polarity_flip_physical{34.0}=0x0 -phy_chain_rx_polarity_flip_physical{35.0}=0x1 -phy_chain_rx_polarity_flip_physical{36.0}=0x1 -phy_chain_rx_polarity_flip_physical{37.0}=0x1 -phy_chain_rx_polarity_flip_physical{38.0}=0x1 -phy_chain_rx_polarity_flip_physical{39.0}=0x0 -phy_chain_rx_polarity_flip_physical{4.0}=0x0 -phy_chain_rx_polarity_flip_physical{40.0}=0x0 -phy_chain_rx_polarity_flip_physical{41.0}=0x0 -phy_chain_rx_polarity_flip_physical{42.0}=0x1 -phy_chain_rx_polarity_flip_physical{43.0}=0x1 -phy_chain_rx_polarity_flip_physical{44.0}=0x1 -phy_chain_rx_polarity_flip_physical{45.0}=0x1 -phy_chain_rx_polarity_flip_physical{46.0}=0x0 -phy_chain_rx_polarity_flip_physical{47.0}=0x0 -phy_chain_rx_polarity_flip_physical{48.0}=0x1 -phy_chain_rx_polarity_flip_physical{49.0}=0x1 -phy_chain_rx_polarity_flip_physical{5.0}=0x1 -phy_chain_rx_polarity_flip_physical{50.0}=0x1 -phy_chain_rx_polarity_flip_physical{51.0}=0x0 -phy_chain_rx_polarity_flip_physical{52.0}=0x0 -phy_chain_rx_polarity_flip_physical{53.0}=0x0 -phy_chain_rx_polarity_flip_physical{54.0}=0x0 -phy_chain_rx_polarity_flip_physical{55.0}=0x1 -phy_chain_rx_polarity_flip_physical{56.0}=0x0 -phy_chain_rx_polarity_flip_physical{57.0}=0x0 -phy_chain_rx_polarity_flip_physical{58.0}=0x0 -phy_chain_rx_polarity_flip_physical{59.0}=0x1 -phy_chain_rx_polarity_flip_physical{6.0}=0x0 -phy_chain_rx_polarity_flip_physical{60.0}=0x1 -phy_chain_rx_polarity_flip_physical{61.0}=0x0 -phy_chain_rx_polarity_flip_physical{62.0}=0x0 -phy_chain_rx_polarity_flip_physical{63.0}=0x1 -phy_chain_rx_polarity_flip_physical{64.0}=0x1 -phy_chain_rx_polarity_flip_physical{65.0}=0x1 -phy_chain_rx_polarity_flip_physical{66.0}=0x1 -phy_chain_rx_polarity_flip_physical{67.0}=0x0 -phy_chain_rx_polarity_flip_physical{68.0}=0x1 -phy_chain_rx_polarity_flip_physical{69.0}=0x0 -phy_chain_rx_polarity_flip_physical{7.0}=0x0 -phy_chain_rx_polarity_flip_physical{70.0}=0x0 -phy_chain_rx_polarity_flip_physical{71.0}=0x1 -phy_chain_rx_polarity_flip_physical{72.0}=0x1 -phy_chain_rx_polarity_flip_physical{73.0}=0x1 -phy_chain_rx_polarity_flip_physical{74.0}=0x1 -phy_chain_rx_polarity_flip_physical{75.0}=0x0 -phy_chain_rx_polarity_flip_physical{76.0}=0x0 -phy_chain_rx_polarity_flip_physical{77.0}=0x0 -phy_chain_rx_polarity_flip_physical{78.0}=0x0 -phy_chain_rx_polarity_flip_physical{79.0}=0x1 -phy_chain_rx_polarity_flip_physical{8.0}=0x1 -phy_chain_rx_polarity_flip_physical{80.0}=0x1 -phy_chain_rx_polarity_flip_physical{81.0}=0x1 -phy_chain_rx_polarity_flip_physical{82.0}=0x1 -phy_chain_rx_polarity_flip_physical{83.0}=0x0 -phy_chain_rx_polarity_flip_physical{84.0}=0x0 -phy_chain_rx_polarity_flip_physical{85.0}=0x1 -phy_chain_rx_polarity_flip_physical{86.0}=0x1 -phy_chain_rx_polarity_flip_physical{87.0}=0x0 -phy_chain_rx_polarity_flip_physical{88.0}=0x0 -phy_chain_rx_polarity_flip_physical{89.0}=0x0 -phy_chain_rx_polarity_flip_physical{9.0}=0x1 -phy_chain_rx_polarity_flip_physical{90.0}=0x0 -phy_chain_rx_polarity_flip_physical{91.0}=0x1 -phy_chain_rx_polarity_flip_physical{92.0}=0x1 -phy_chain_rx_polarity_flip_physical{93.0}=0x0 -phy_chain_rx_polarity_flip_physical{94.0}=0x0 -phy_chain_rx_polarity_flip_physical{95.0}=0x1 -phy_chain_rx_polarity_flip_physical{96.0}=0x0 -phy_chain_rx_polarity_flip_physical{97.0}=0x1 -phy_chain_rx_polarity_flip_physical{98.0}=0x1 -phy_chain_rx_polarity_flip_physical{99.0}=0x0 -phy_chain_tx_lane_map_physical{1.0}=0x2031 -phy_chain_tx_lane_map_physical{101.0}=0x1023 -phy_chain_tx_lane_map_physical{105.0}=0x1302 -phy_chain_tx_lane_map_physical{109.0}=0x0321 -phy_chain_tx_lane_map_physical{113.0}=0x2301 -phy_chain_tx_lane_map_physical{117.0}=0x3120 -phy_chain_tx_lane_map_physical{121.0}=0x3102 -phy_chain_tx_lane_map_physical{125.0}=0x3210 -phy_chain_tx_lane_map_physical{129.0}=0x1023 -phy_chain_tx_lane_map_physical{13.0}=0x3021 -phy_chain_tx_lane_map_physical{133.0}=0x3210 -phy_chain_tx_lane_map_physical{137.0}=0x2031 -phy_chain_tx_lane_map_physical{141.0}=0x1302 -phy_chain_tx_lane_map_physical{145.0}=0x3210 -phy_chain_tx_lane_map_physical{149.0}=0x0213 -phy_chain_tx_lane_map_physical{153.0}=0x3210 -phy_chain_tx_lane_map_physical{157.0}=0x1320 -phy_chain_tx_lane_map_physical{161.0}=0x3210 -phy_chain_tx_lane_map_physical{165.0}=0x0231 -phy_chain_tx_lane_map_physical{169.0}=0x3120 -phy_chain_tx_lane_map_physical{17.0}=0x1032 -phy_chain_tx_lane_map_physical{173.0}=0x0312 -phy_chain_tx_lane_map_physical{177.0}=0x0231 -phy_chain_tx_lane_map_physical{181.0}=0x3210 -phy_chain_tx_lane_map_physical{185.0}=0x3210 -phy_chain_tx_lane_map_physical{189.0}=0x1320 -phy_chain_tx_lane_map_physical{193.0}=0x0321 -phy_chain_tx_lane_map_physical{197.0}=0x3120 -phy_chain_tx_lane_map_physical{201.0}=0x3120 -phy_chain_tx_lane_map_physical{205.0}=0x0123 -phy_chain_tx_lane_map_physical{209.0}=0x3120 -phy_chain_tx_lane_map_physical{21.0}=0x0213 -phy_chain_tx_lane_map_physical{213.0}=0x3021 -phy_chain_tx_lane_map_physical{217.0}=0x0312 -phy_chain_tx_lane_map_physical{221.0}=0x2301 -phy_chain_tx_lane_map_physical{225.0}=0x0123 -phy_chain_tx_lane_map_physical{229.0}=0x2031 -phy_chain_tx_lane_map_physical{233.0}=0x0231 -phy_chain_tx_lane_map_physical{237.0}=0x0213 -phy_chain_tx_lane_map_physical{241.0}=0x1320 -phy_chain_tx_lane_map_physical{245.0}=0x2031 -phy_chain_tx_lane_map_physical{249.0}=0x3120 -phy_chain_tx_lane_map_physical{25.0}=0x0231 -phy_chain_tx_lane_map_physical{253.0}=0x0321 -phy_chain_tx_lane_map_physical{257.0}=0x3210 -phy_chain_tx_lane_map_physical{29.0}=0x1230 -phy_chain_tx_lane_map_physical{33.0}=0x1032 -phy_chain_tx_lane_map_physical{37.0}=0x0123 -phy_chain_tx_lane_map_physical{41.0}=0x0213 -phy_chain_tx_lane_map_physical{45.0}=0x0132 -phy_chain_tx_lane_map_physical{49.0}=0x2031 -phy_chain_tx_lane_map_physical{5.0}=0x2301 -phy_chain_tx_lane_map_physical{53.0}=0x2301 -phy_chain_tx_lane_map_physical{57.0}=0x2031 -phy_chain_tx_lane_map_physical{61.0}=0x2031 -phy_chain_tx_lane_map_physical{65.0}=0x1230 -phy_chain_tx_lane_map_physical{69.0}=0x2013 -phy_chain_tx_lane_map_physical{73.0}=0x0213 -phy_chain_tx_lane_map_physical{77.0}=0x2310 -phy_chain_tx_lane_map_physical{81.0}=0x0321 -phy_chain_tx_lane_map_physical{85.0}=0x2013 -phy_chain_tx_lane_map_physical{89.0}=0x0213 -phy_chain_tx_lane_map_physical{9.0}=0x3012 -phy_chain_tx_lane_map_physical{93.0}=0x3102 -phy_chain_tx_lane_map_physical{97.0}=0x3210 -phy_chain_tx_polarity_flip_physical{1.0}=0x0 -phy_chain_tx_polarity_flip_physical{10.0}=0x1 -phy_chain_tx_polarity_flip_physical{100.0}=0x0 -phy_chain_tx_polarity_flip_physical{101.0}=0x0 -phy_chain_tx_polarity_flip_physical{102.0}=0x1 -phy_chain_tx_polarity_flip_physical{103.0}=0x0 -phy_chain_tx_polarity_flip_physical{104.0}=0x0 -phy_chain_tx_polarity_flip_physical{105.0}=0x0 -phy_chain_tx_polarity_flip_physical{106.0}=0x1 -phy_chain_tx_polarity_flip_physical{107.0}=0x1 -phy_chain_tx_polarity_flip_physical{108.0}=0x1 -phy_chain_tx_polarity_flip_physical{109.0}=0x0 -phy_chain_tx_polarity_flip_physical{11.0}=0x1 -phy_chain_tx_polarity_flip_physical{110.0}=0x0 -phy_chain_tx_polarity_flip_physical{111.0}=0x0 -phy_chain_tx_polarity_flip_physical{112.0}=0x1 -phy_chain_tx_polarity_flip_physical{113.0}=0x1 -phy_chain_tx_polarity_flip_physical{114.0}=0x1 -phy_chain_tx_polarity_flip_physical{115.0}=0x1 -phy_chain_tx_polarity_flip_physical{116.0}=0x0 -phy_chain_tx_polarity_flip_physical{117.0}=0x1 -phy_chain_tx_polarity_flip_physical{118.0}=0x0 -phy_chain_tx_polarity_flip_physical{119.0}=0x0 -phy_chain_tx_polarity_flip_physical{12.0}=0x0 -phy_chain_tx_polarity_flip_physical{120.0}=0x0 -phy_chain_tx_polarity_flip_physical{121.0}=0x0 -phy_chain_tx_polarity_flip_physical{122.0}=0x0 -phy_chain_tx_polarity_flip_physical{123.0}=0x0 -phy_chain_tx_polarity_flip_physical{124.0}=0x1 -phy_chain_tx_polarity_flip_physical{125.0}=0x0 -phy_chain_tx_polarity_flip_physical{126.0}=0x1 -phy_chain_tx_polarity_flip_physical{127.0}=0x1 -phy_chain_tx_polarity_flip_physical{128.0}=0x1 -phy_chain_tx_polarity_flip_physical{129.0}=0x1 -phy_chain_tx_polarity_flip_physical{13.0}=0x0 -phy_chain_tx_polarity_flip_physical{130.0}=0x0 -phy_chain_tx_polarity_flip_physical{131.0}=0x1 -phy_chain_tx_polarity_flip_physical{132.0}=0x0 -phy_chain_tx_polarity_flip_physical{133.0}=0x1 -phy_chain_tx_polarity_flip_physical{134.0}=0x1 -phy_chain_tx_polarity_flip_physical{135.0}=0x1 -phy_chain_tx_polarity_flip_physical{136.0}=0x1 -phy_chain_tx_polarity_flip_physical{137.0}=0x1 -phy_chain_tx_polarity_flip_physical{138.0}=0x1 -phy_chain_tx_polarity_flip_physical{139.0}=0x1 -phy_chain_tx_polarity_flip_physical{14.0}=0x1 -phy_chain_tx_polarity_flip_physical{140.0}=0x1 -phy_chain_tx_polarity_flip_physical{141.0}=0x0 -phy_chain_tx_polarity_flip_physical{142.0}=0x1 -phy_chain_tx_polarity_flip_physical{143.0}=0x1 -phy_chain_tx_polarity_flip_physical{144.0}=0x1 -phy_chain_tx_polarity_flip_physical{145.0}=0x1 -phy_chain_tx_polarity_flip_physical{146.0}=0x1 -phy_chain_tx_polarity_flip_physical{147.0}=0x1 -phy_chain_tx_polarity_flip_physical{148.0}=0x0 -phy_chain_tx_polarity_flip_physical{149.0}=0x1 -phy_chain_tx_polarity_flip_physical{15.0}=0x0 -phy_chain_tx_polarity_flip_physical{150.0}=0x0 -phy_chain_tx_polarity_flip_physical{151.0}=0x0 -phy_chain_tx_polarity_flip_physical{152.0}=0x0 -phy_chain_tx_polarity_flip_physical{153.0}=0x1 -phy_chain_tx_polarity_flip_physical{154.0}=0x0 -phy_chain_tx_polarity_flip_physical{155.0}=0x0 -phy_chain_tx_polarity_flip_physical{156.0}=0x0 -phy_chain_tx_polarity_flip_physical{157.0}=0x0 -phy_chain_tx_polarity_flip_physical{158.0}=0x0 -phy_chain_tx_polarity_flip_physical{159.0}=0x0 -phy_chain_tx_polarity_flip_physical{16.0}=0x0 -phy_chain_tx_polarity_flip_physical{160.0}=0x0 -phy_chain_tx_polarity_flip_physical{161.0}=0x0 -phy_chain_tx_polarity_flip_physical{162.0}=0x1 -phy_chain_tx_polarity_flip_physical{163.0}=0x1 -phy_chain_tx_polarity_flip_physical{164.0}=0x0 -phy_chain_tx_polarity_flip_physical{165.0}=0x1 -phy_chain_tx_polarity_flip_physical{166.0}=0x1 -phy_chain_tx_polarity_flip_physical{167.0}=0x1 -phy_chain_tx_polarity_flip_physical{168.0}=0x0 -phy_chain_tx_polarity_flip_physical{169.0}=0x0 -phy_chain_tx_polarity_flip_physical{17.0}=0x0 -phy_chain_tx_polarity_flip_physical{170.0}=0x1 -phy_chain_tx_polarity_flip_physical{171.0}=0x1 -phy_chain_tx_polarity_flip_physical{172.0}=0x1 -phy_chain_tx_polarity_flip_physical{173.0}=0x0 -phy_chain_tx_polarity_flip_physical{174.0}=0x0 -phy_chain_tx_polarity_flip_physical{175.0}=0x1 -phy_chain_tx_polarity_flip_physical{176.0}=0x0 -phy_chain_tx_polarity_flip_physical{177.0}=0x1 -phy_chain_tx_polarity_flip_physical{178.0}=0x0 -phy_chain_tx_polarity_flip_physical{179.0}=0x0 -phy_chain_tx_polarity_flip_physical{18.0}=0x1 -phy_chain_tx_polarity_flip_physical{180.0}=0x0 -phy_chain_tx_polarity_flip_physical{181.0}=0x0 -phy_chain_tx_polarity_flip_physical{182.0}=0x0 -phy_chain_tx_polarity_flip_physical{183.0}=0x0 -phy_chain_tx_polarity_flip_physical{184.0}=0x1 -phy_chain_tx_polarity_flip_physical{185.0}=0x0 -phy_chain_tx_polarity_flip_physical{186.0}=0x1 -phy_chain_tx_polarity_flip_physical{187.0}=0x1 -phy_chain_tx_polarity_flip_physical{188.0}=0x1 -phy_chain_tx_polarity_flip_physical{189.0}=0x0 -phy_chain_tx_polarity_flip_physical{19.0}=0x1 -phy_chain_tx_polarity_flip_physical{190.0}=0x0 -phy_chain_tx_polarity_flip_physical{191.0}=0x0 -phy_chain_tx_polarity_flip_physical{192.0}=0x0 -phy_chain_tx_polarity_flip_physical{193.0}=0x1 -phy_chain_tx_polarity_flip_physical{194.0}=0x1 -phy_chain_tx_polarity_flip_physical{195.0}=0x1 -phy_chain_tx_polarity_flip_physical{196.0}=0x0 -phy_chain_tx_polarity_flip_physical{197.0}=0x0 -phy_chain_tx_polarity_flip_physical{198.0}=0x1 -phy_chain_tx_polarity_flip_physical{199.0}=0x1 -phy_chain_tx_polarity_flip_physical{2.0}=0x1 -phy_chain_tx_polarity_flip_physical{20.0}=0x1 -phy_chain_tx_polarity_flip_physical{200.0}=0x1 -phy_chain_tx_polarity_flip_physical{201.0}=0x1 -phy_chain_tx_polarity_flip_physical{202.0}=0x1 -phy_chain_tx_polarity_flip_physical{203.0}=0x1 -phy_chain_tx_polarity_flip_physical{204.0}=0x1 -phy_chain_tx_polarity_flip_physical{205.0}=0x0 -phy_chain_tx_polarity_flip_physical{206.0}=0x1 -phy_chain_tx_polarity_flip_physical{207.0}=0x1 -phy_chain_tx_polarity_flip_physical{208.0}=0x1 -phy_chain_tx_polarity_flip_physical{209.0}=0x1 -phy_chain_tx_polarity_flip_physical{21.0}=0x0 -phy_chain_tx_polarity_flip_physical{210.0}=0x1 -phy_chain_tx_polarity_flip_physical{211.0}=0x1 -phy_chain_tx_polarity_flip_physical{212.0}=0x0 -phy_chain_tx_polarity_flip_physical{213.0}=0x0 -phy_chain_tx_polarity_flip_physical{214.0}=0x1 -phy_chain_tx_polarity_flip_physical{215.0}=0x0 -phy_chain_tx_polarity_flip_physical{216.0}=0x1 -phy_chain_tx_polarity_flip_physical{217.0}=0x1 -phy_chain_tx_polarity_flip_physical{218.0}=0x1 -phy_chain_tx_polarity_flip_physical{219.0}=0x0 -phy_chain_tx_polarity_flip_physical{22.0}=0x0 -phy_chain_tx_polarity_flip_physical{220.0}=0x1 -phy_chain_tx_polarity_flip_physical{221.0}=0x0 -phy_chain_tx_polarity_flip_physical{222.0}=0x0 -phy_chain_tx_polarity_flip_physical{223.0}=0x0 -phy_chain_tx_polarity_flip_physical{224.0}=0x1 -phy_chain_tx_polarity_flip_physical{225.0}=0x1 -phy_chain_tx_polarity_flip_physical{226.0}=0x1 -phy_chain_tx_polarity_flip_physical{227.0}=0x1 -phy_chain_tx_polarity_flip_physical{228.0}=0x0 -phy_chain_tx_polarity_flip_physical{229.0}=0x0 -phy_chain_tx_polarity_flip_physical{23.0}=0x0 -phy_chain_tx_polarity_flip_physical{230.0}=0x1 -phy_chain_tx_polarity_flip_physical{231.0}=0x1 -phy_chain_tx_polarity_flip_physical{232.0}=0x1 -phy_chain_tx_polarity_flip_physical{233.0}=0x0 -phy_chain_tx_polarity_flip_physical{234.0}=0x0 -phy_chain_tx_polarity_flip_physical{235.0}=0x0 -phy_chain_tx_polarity_flip_physical{236.0}=0x0 -phy_chain_tx_polarity_flip_physical{237.0}=0x1 -phy_chain_tx_polarity_flip_physical{238.0}=0x1 -phy_chain_tx_polarity_flip_physical{239.0}=0x1 -phy_chain_tx_polarity_flip_physical{24.0}=0x0 -phy_chain_tx_polarity_flip_physical{240.0}=0x0 -phy_chain_tx_polarity_flip_physical{241.0}=0x1 -phy_chain_tx_polarity_flip_physical{242.0}=0x1 -phy_chain_tx_polarity_flip_physical{243.0}=0x1 -phy_chain_tx_polarity_flip_physical{244.0}=0x0 -phy_chain_tx_polarity_flip_physical{245.0}=0x1 -phy_chain_tx_polarity_flip_physical{246.0}=0x1 -phy_chain_tx_polarity_flip_physical{247.0}=0x1 -phy_chain_tx_polarity_flip_physical{248.0}=0x1 -phy_chain_tx_polarity_flip_physical{249.0}=0x1 -phy_chain_tx_polarity_flip_physical{25.0}=0x1 -phy_chain_tx_polarity_flip_physical{250.0}=0x0 -phy_chain_tx_polarity_flip_physical{251.0}=0x0 -phy_chain_tx_polarity_flip_physical{252.0}=0x0 -phy_chain_tx_polarity_flip_physical{253.0}=0x1 -phy_chain_tx_polarity_flip_physical{254.0}=0x1 -phy_chain_tx_polarity_flip_physical{255.0}=0x1 -phy_chain_tx_polarity_flip_physical{256.0}=0x0 -phy_chain_tx_polarity_flip_physical{257.0}=0x0 -phy_chain_tx_polarity_flip_physical{259.0}=0x0 -phy_chain_tx_polarity_flip_physical{26.0}=0x0 -phy_chain_tx_polarity_flip_physical{27.0}=0x0 -phy_chain_tx_polarity_flip_physical{28.0}=0x0 -phy_chain_tx_polarity_flip_physical{29.0}=0x1 -phy_chain_tx_polarity_flip_physical{3.0}=0x1 -phy_chain_tx_polarity_flip_physical{30.0}=0x1 -phy_chain_tx_polarity_flip_physical{31.0}=0x1 -phy_chain_tx_polarity_flip_physical{32.0}=0x0 -phy_chain_tx_polarity_flip_physical{33.0}=0x0 -phy_chain_tx_polarity_flip_physical{34.0}=0x0 -phy_chain_tx_polarity_flip_physical{35.0}=0x0 -phy_chain_tx_polarity_flip_physical{36.0}=0x1 -phy_chain_tx_polarity_flip_physical{37.0}=0x1 -phy_chain_tx_polarity_flip_physical{38.0}=0x1 -phy_chain_tx_polarity_flip_physical{39.0}=0x1 -phy_chain_tx_polarity_flip_physical{4.0}=0x1 -phy_chain_tx_polarity_flip_physical{40.0}=0x0 -phy_chain_tx_polarity_flip_physical{41.0}=0x0 -phy_chain_tx_polarity_flip_physical{42.0}=0x0 -phy_chain_tx_polarity_flip_physical{43.0}=0x0 -phy_chain_tx_polarity_flip_physical{44.0}=0x0 -phy_chain_tx_polarity_flip_physical{45.0}=0x1 -phy_chain_tx_polarity_flip_physical{46.0}=0x0 -phy_chain_tx_polarity_flip_physical{47.0}=0x1 -phy_chain_tx_polarity_flip_physical{48.0}=0x1 -phy_chain_tx_polarity_flip_physical{49.0}=0x0 -phy_chain_tx_polarity_flip_physical{5.0}=0x1 -phy_chain_tx_polarity_flip_physical{50.0}=0x0 -phy_chain_tx_polarity_flip_physical{51.0}=0x0 -phy_chain_tx_polarity_flip_physical{52.0}=0x1 -phy_chain_tx_polarity_flip_physical{53.0}=0x0 -phy_chain_tx_polarity_flip_physical{54.0}=0x1 -phy_chain_tx_polarity_flip_physical{55.0}=0x1 -phy_chain_tx_polarity_flip_physical{56.0}=0x0 -phy_chain_tx_polarity_flip_physical{57.0}=0x0 -phy_chain_tx_polarity_flip_physical{58.0}=0x1 -phy_chain_tx_polarity_flip_physical{59.0}=0x1 -phy_chain_tx_polarity_flip_physical{6.0}=0x1 -phy_chain_tx_polarity_flip_physical{60.0}=0x1 -phy_chain_tx_polarity_flip_physical{61.0}=0x0 -phy_chain_tx_polarity_flip_physical{62.0}=0x1 -phy_chain_tx_polarity_flip_physical{63.0}=0x1 -phy_chain_tx_polarity_flip_physical{64.0}=0x1 -phy_chain_tx_polarity_flip_physical{65.0}=0x0 -phy_chain_tx_polarity_flip_physical{66.0}=0x1 -phy_chain_tx_polarity_flip_physical{67.0}=0x1 -phy_chain_tx_polarity_flip_physical{68.0}=0x0 -phy_chain_tx_polarity_flip_physical{69.0}=0x1 -phy_chain_tx_polarity_flip_physical{7.0}=0x1 -phy_chain_tx_polarity_flip_physical{70.0}=0x1 -phy_chain_tx_polarity_flip_physical{71.0}=0x1 -phy_chain_tx_polarity_flip_physical{72.0}=0x0 -phy_chain_tx_polarity_flip_physical{73.0}=0x1 -phy_chain_tx_polarity_flip_physical{74.0}=0x0 -phy_chain_tx_polarity_flip_physical{75.0}=0x0 -phy_chain_tx_polarity_flip_physical{76.0}=0x0 -phy_chain_tx_polarity_flip_physical{77.0}=0x0 -phy_chain_tx_polarity_flip_physical{78.0}=0x0 -phy_chain_tx_polarity_flip_physical{79.0}=0x1 -phy_chain_tx_polarity_flip_physical{8.0}=0x0 -phy_chain_tx_polarity_flip_physical{80.0}=0x0 -phy_chain_tx_polarity_flip_physical{81.0}=0x1 -phy_chain_tx_polarity_flip_physical{82.0}=0x1 -phy_chain_tx_polarity_flip_physical{83.0}=0x1 -phy_chain_tx_polarity_flip_physical{84.0}=0x0 -phy_chain_tx_polarity_flip_physical{85.0}=0x1 -phy_chain_tx_polarity_flip_physical{86.0}=0x0 -phy_chain_tx_polarity_flip_physical{87.0}=0x0 -phy_chain_tx_polarity_flip_physical{88.0}=0x0 -phy_chain_tx_polarity_flip_physical{89.0}=0x1 -phy_chain_tx_polarity_flip_physical{9.0}=0x0 -phy_chain_tx_polarity_flip_physical{90.0}=0x1 -phy_chain_tx_polarity_flip_physical{91.0}=0x1 -phy_chain_tx_polarity_flip_physical{92.0}=0x0 -phy_chain_tx_polarity_flip_physical{93.0}=0x0 -phy_chain_tx_polarity_flip_physical{94.0}=0x0 -phy_chain_tx_polarity_flip_physical{95.0}=0x0 -phy_chain_tx_polarity_flip_physical{96.0}=0x0 -phy_chain_tx_polarity_flip_physical{97.0}=0x0 -phy_chain_tx_polarity_flip_physical{98.0}=0x1 -phy_chain_tx_polarity_flip_physical{99.0}=0x1 - -port_init_cl72_hg=1 - - - - - - - -robust_hash_disable_egress_vlan=1 -robust_hash_disable_mpls=1 -robust_hash_disable_vlan=1 -stable_size=0x5500000 -stable_size=0x5500000 -tdma_timeout_usec=15000000 -tslam_timeout_usec=15000000 -dport_map_direct=1 -portmap_1=5:50 -portmap_2=7:50 -portmap_3=13:50 -portmap_4=15:50 -portmap_5=25:50 -portmap_6=27:50 -portmap_7=21:50 -portmap_8=23:50 -portmap_9=37:50 -portmap_10=39:50 -portmap_11=45:50 -portmap_12=47:50 -portmap_13=57:100 -portmap_14=53:100 -portmap_15=9:50 -portmap_16=11:50 -portmap_17=1:50 -portmap_18=3:50 -portmap_19=17:50 -portmap_20=19:50 -portmap_21=29:50 -portmap_22=31:50 -portmap_23=41:50 -portmap_24=43:50 -portmap_25=33:50 -portmap_26=35:50 -portmap_27=49:50 -portmap_28=51:50 -portmap_29=61:50 -portmap_30=63:50 -portmap_34=77:50 -portmap_35=79:50 -portmap_36=65:50 -portmap_37=67:50 -portmap_38=85:50 -portmap_39=87:50 -portmap_40=89:50 -portmap_41=91:50 -portmap_42=109:50 -portmap_43=111:50 -portmap_44=97:50 -portmap_45=99:50 -portmap_46=117:100 -portmap_47=121:100 -portmap_48=69:50 -portmap_49=71:50 -portmap_50=73:50 -portmap_51=75:50 -portmap_52=93:50 -portmap_53=95:50 -portmap_54=81:50 -portmap_55=83:50 -portmap_56=101:50 -portmap_57=103:50 -portmap_58=105:50 -portmap_59=107:50 -portmap_60=125:50 -portmap_61=127:50 -portmap_62=113:50 -portmap_63=115:50 -portmap_66=257:10 -portmap_68=141:100 -portmap_69=133:100 -portmap_70=149:50 -portmap_71=151:50 -portmap_72=153:50 -portmap_73=155:50 -portmap_74=173:50 -portmap_75=175:50 -portmap_76=161:50 -portmap_77=163:50 -portmap_78=181:50 -portmap_79=183:50 -portmap_80=185:50 -portmap_81=187:50 -portmap_82=129:50 -portmap_83=131:50 -portmap_84=137:50 -portmap_85=139:50 -portmap_86=157:50 -portmap_87=159:50 -portmap_88=145:50 -portmap_89=147:50 -portmap_90=165:50 -portmap_91=167:50 -portmap_92=169:50 -portmap_93=171:50 -portmap_94=189:50 -portmap_95=191:50 -portmap_96=177:50 -portmap_97=179:50 -portmap_100=259:10 -portmap_102=197:100 -portmap_103=205:100 -portmap_104=217:50 -portmap_105=219:50 -portmap_106=213:50 -portmap_107=215:50 -portmap_108=229:50 -portmap_109=231:50 -portmap_110=237:50 -portmap_111=239:50 -portmap_112=249:50 -portmap_113=251:50 -portmap_114=245:50 -portmap_115=247:50 -portmap_116=201:50 -portmap_117=203:50 -portmap_118=193:50 -portmap_119=195:50 -portmap_120=209:50 -portmap_121=211:50 -portmap_122=221:50 -portmap_123=223:50 -portmap_124=233:50 -portmap_125=235:50 -portmap_126=225:50 -portmap_127=227:50 -portmap_128=241:50 -portmap_129=243:50 -portmap_130=253:50 -portmap_131=255:50 - -# tuning parameters -serdes_preemphasis_1=0x580c -serdes_preemphasis_2=0x580c -serdes_preemphasis_3=0x580c -serdes_preemphasis_4=0x580c -serdes_preemphasis_5=0x580c -serdes_preemphasis_6=0x580c -serdes_preemphasis_7=0x580c -serdes_preemphasis_8=0x580c -serdes_preemphasis_9=0x580c -serdes_preemphasis_10=0x580c -serdes_preemphasis_11=0x580c -serdes_preemphasis_12=0x580c -serdes_preemphasis_13=0x144108 -serdes_preemphasis_14=0x144108 -serdes_preemphasis_15=0x580c -serdes_preemphasis_16=0x580c -serdes_preemphasis_17=0x580c -serdes_preemphasis_18=0x580c -serdes_preemphasis_19=0x580c -serdes_preemphasis_20=0x580c -serdes_preemphasis_21=0x580c -serdes_preemphasis_22=0x580c -serdes_preemphasis_23=0x580c -serdes_preemphasis_24=0x580c -serdes_preemphasis_25=0x580c -serdes_preemphasis_26=0x580c -serdes_preemphasis_27=0x580c -serdes_preemphasis_28=0x580c -serdes_preemphasis_29=0x580c -serdes_preemphasis_30=0x580c -serdes_preemphasis_34=0x580c -serdes_preemphasis_35=0x580c -serdes_preemphasis_36=0x580c -serdes_preemphasis_37=0x580c -serdes_preemphasis_38=0x580c -serdes_preemphasis_39=0x580c -serdes_preemphasis_40=0x580c -serdes_preemphasis_41=0x580c -serdes_preemphasis_42=0x580c -serdes_preemphasis_43=0x580c -serdes_preemphasis_44=0x580c -serdes_preemphasis_45=0x580c -serdes_preemphasis_46=0x144108 -serdes_preemphasis_47=0x103a07 -serdes_preemphasis_48=0x580c -serdes_preemphasis_49=0x580c -serdes_preemphasis_50=0x580c -serdes_preemphasis_51=0x580c -serdes_preemphasis_52=0x580c -serdes_preemphasis_53=0x580c -serdes_preemphasis_54=0x580c -serdes_preemphasis_55=0x580c -serdes_preemphasis_56=0x580c -serdes_preemphasis_57=0x580c -serdes_preemphasis_58=0x580c -serdes_preemphasis_59=0x580c -serdes_preemphasis_60=0x580c -serdes_preemphasis_61=0x580c -serdes_preemphasis_62=0x580c -serdes_preemphasis_63=0x580c -serdes_preemphasis_66=0x43004 -serdes_preemphasis_68=0x184606 -serdes_preemphasis_69=0x184407 -serdes_preemphasis_70=0x580c -serdes_preemphasis_71=0x580c -serdes_preemphasis_72=0x580c -serdes_preemphasis_73=0x580c -serdes_preemphasis_74=0x580c -serdes_preemphasis_75=0x580c -serdes_preemphasis_76=0x580c -serdes_preemphasis_77=0x580c -serdes_preemphasis_78=0x580c -serdes_preemphasis_79=0x580c -serdes_preemphasis_80=0x580c -serdes_preemphasis_81=0x580c -serdes_preemphasis_82=0x580c -serdes_preemphasis_83=0x580c -serdes_preemphasis_84=0x580c -serdes_preemphasis_85=0x580c -serdes_preemphasis_86=0x580c -serdes_preemphasis_87=0x580c -serdes_preemphasis_88=0x580c -serdes_preemphasis_89=0x580c -serdes_preemphasis_90=0x580c -serdes_preemphasis_91=0x580c -serdes_preemphasis_92=0x580c -serdes_preemphasis_93=0x580c -serdes_preemphasis_94=0x580c -serdes_preemphasis_95=0x580c -serdes_preemphasis_96=0x580c -serdes_preemphasis_97=0x580c -serdes_preemphasis_100=0x43004 -serdes_preemphasis_102=0x174507 -serdes_preemphasis_103=0x184606 -serdes_preemphasis_104=0x580c -serdes_preemphasis_105=0x580c -serdes_preemphasis_106=0x580c -serdes_preemphasis_107=0x580c -serdes_preemphasis_108=0x580c -serdes_preemphasis_109=0x580c -serdes_preemphasis_110=0x580c -serdes_preemphasis_111=0x580c -serdes_preemphasis_112=0x580c -serdes_preemphasis_113=0x580c -serdes_preemphasis_114=0x580c -serdes_preemphasis_115=0x580c -serdes_preemphasis_116=0x580c -serdes_preemphasis_117=0x580c -serdes_preemphasis_118=0x580c -serdes_preemphasis_119=0x580c -serdes_preemphasis_120=0x580c -serdes_preemphasis_121=0x580c -serdes_preemphasis_122=0x580c -serdes_preemphasis_123=0x580c -serdes_preemphasis_124=0x580c -serdes_preemphasis_125=0x580c -serdes_preemphasis_126=0x580c -serdes_preemphasis_127=0x580c -serdes_preemphasis_128=0x580c -serdes_preemphasis_129=0x580c -serdes_preemphasis_130=0x580c -serdes_preemphasis_131=0x580c - -mmu_init_config="MSFT-TH2-Tier0" diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D92C16 b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D92C16 new file mode 120000 index 000000000000..fd5bbe75f37c --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D92C16 @@ -0,0 +1 @@ +Arista-7260CX3-D96C16 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D96C16/buffers.json.j2 b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D96C16/buffers.json.j2 new file mode 100644 index 000000000000..e6e9e844469b --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D96C16/buffers.json.j2 @@ -0,0 +1,3 @@ +{%- set default_topo = 't0' %} +{%- include 'buffers_config.j2' %} + diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D96C16/buffers_defaults_t0.j2 b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D96C16/buffers_defaults_t0.j2 new file mode 100644 index 000000000000..178502e287ae --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D96C16/buffers_defaults_t0.j2 @@ -0,0 +1,61 @@ +{%- set default_cable = '5m' %} + +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {%- for port_idx in range(0,12) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{%- endif %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 2)) %}{%- endif %} + {%- endfor %} + {%- for port_idx in range(12,20) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{%- endif %} + {%- endfor %} + {%- for port_idx in range(20,44) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{%- endif %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 2)) %}{%- endif %} + {%- endfor %} + {%- for port_idx in range(44,52) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{%- endif %} + {%- endfor %} + {%- for port_idx in range(52,64) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{%- endif %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 2)) %}{%- endif %} + {%- endfor %} +{%- endmacro %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "33329088", + "type": "ingress", + "mode": "dynamic", + "xoff": "7827456" + }, + "egress_lossy_pool": { + "size": "26663272", + "type": "egress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "42349632", + "type": "egress", + "mode": "static" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "static_th":"44302336" + }, + "egress_lossless_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"0", + "static_th":"42349632" + }, + "egress_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"1664", + "dynamic_th":"-1" + } + }, +{%- endmacro %} diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D96C16/config.bcm.j2 b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D96C16/config.bcm.j2 new file mode 100644 index 000000000000..9ad0dbf5fe1a --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D96C16/config.bcm.j2 @@ -0,0 +1,937 @@ +{# Construct config.bcm to include additional soc properties per specific device metadata requirement #} +{%- set IPinIP_sock = '' -%} +{%- if DEVICE_METADATA is defined and DEVICE_METADATA['localhost'] is defined and DEVICE_METADATA['localhost']['subtype'] is defined -%} +{%- set switch_subtype = DEVICE_METADATA['localhost']['subtype'] -%} +{%- if 'dualtor' in switch_subtype.lower() %} +{%- set IPinIP_sock = 'sai_tunnel_support=1 + sai_tunnel_underlay_route_mode=1 + host_as_route_disable=1 + l3_ecmp_levels=2' -%} +{%- endif %} +{%- endif %} +{# The following is the common soc properties that used to be named "th2-a7260cx3-64-112x50G+8x100G.config.bcm" #} +l3_alpm_hit_skip=1 +sai_adjust_acl_drop_in_rx_drop=1 +PHY_AN_ALLOW_PLL_CHANGE=1 +arl_clean_timeout_usec=15000000 +asf_mem_profile=2 +bcm_num_cos=10 +bcm_stat_flags=1 +bcm_stat_jumbo=9236 +cdma_timeout_usec=15000000 +core_clock_frequency=1700 +dma_desc_timeout_usec=15000000 +dpp_clock_ratio=2:3 +higig2_hdr_mode=1 +ipv6_lpm_128b_enable=1 +l3_alpm_enable=2 +lpm_scaling_enable=0 +l2xmsg_mode=1 +max_vp_lags=0 +mem_scan_enable=1 +miim_intr_enable=0 +module_64ports=1 +os=unix +oversubscribe_mode=1 +pbmp_xport_xe=0xfffffffd3fffffff4fffffffc7ffffffe +#pbmp_xport_xe=0x47fffffff1fffffffcfffffffe7ffffffe +phy_an_allow_pll_change_hg=0 +phy_an_c73=1 +phy_chain_rx_lane_map_physical{1.0}=0x3210 +phy_chain_rx_lane_map_physical{101.0}=0x0123 +phy_chain_rx_lane_map_physical{105.0}=0x0123 +phy_chain_rx_lane_map_physical{109.0}=0x0123 +phy_chain_rx_lane_map_physical{113.0}=0x2301 +phy_chain_rx_lane_map_physical{117.0}=0x3210 +phy_chain_rx_lane_map_physical{121.0}=0x3210 +phy_chain_rx_lane_map_physical{125.0}=0x1203 +phy_chain_rx_lane_map_physical{129.0}=0x3210 +phy_chain_rx_lane_map_physical{13.0}=0x0321 +phy_chain_rx_lane_map_physical{133.0}=0x1032 +phy_chain_rx_lane_map_physical{137.0}=0x3210 +phy_chain_rx_lane_map_physical{141.0}=0x0123 +phy_chain_rx_lane_map_physical{145.0}=0x3210 +phy_chain_rx_lane_map_physical{149.0}=0x2310 +phy_chain_rx_lane_map_physical{153.0}=0x0132 +phy_chain_rx_lane_map_physical{157.0}=0x1302 +phy_chain_rx_lane_map_physical{161.0}=0x3021 +phy_chain_rx_lane_map_physical{165.0}=0x2031 +phy_chain_rx_lane_map_physical{169.0}=0x2031 +phy_chain_rx_lane_map_physical{17.0}=0x3210 +phy_chain_rx_lane_map_physical{173.0}=0x1302 +phy_chain_rx_lane_map_physical{177.0}=0x2031 +phy_chain_rx_lane_map_physical{181.0}=0x0213 +phy_chain_rx_lane_map_physical{185.0}=0x0213 +phy_chain_rx_lane_map_physical{189.0}=0x1302 +phy_chain_rx_lane_map_physical{193.0}=0x3120 +phy_chain_rx_lane_map_physical{197.0}=0x0231 +phy_chain_rx_lane_map_physical{201.0}=0x2031 +phy_chain_rx_lane_map_physical{205.0}=0x0213 +phy_chain_rx_lane_map_physical{209.0}=0x2013 +phy_chain_rx_lane_map_physical{21.0}=0x3021 +phy_chain_rx_lane_map_physical{213.0}=0x3021 +phy_chain_rx_lane_map_physical{217.0}=0x0231 +phy_chain_rx_lane_map_physical{221.0}=0x2031 +phy_chain_rx_lane_map_physical{225.0}=0x1203 +phy_chain_rx_lane_map_physical{229.0}=0x1230 +phy_chain_rx_lane_map_physical{233.0}=0x3021 +phy_chain_rx_lane_map_physical{237.0}=0x1032 +phy_chain_rx_lane_map_physical{241.0}=0x2301 +phy_chain_rx_lane_map_physical{245.0}=0x0321 +phy_chain_rx_lane_map_physical{249.0}=0x2301 +phy_chain_rx_lane_map_physical{25.0}=0x2301 +phy_chain_rx_lane_map_physical{253.0}=0x2301 +phy_chain_rx_lane_map_physical{257.0}=0x3210 +phy_chain_rx_lane_map_physical{29.0}=0x3021 +phy_chain_rx_lane_map_physical{33.0}=0x1302 +phy_chain_rx_lane_map_physical{37.0}=0x2031 +phy_chain_rx_lane_map_physical{41.0}=0x3021 +phy_chain_rx_lane_map_physical{45.0}=0x1023 +phy_chain_rx_lane_map_physical{49.0}=0x0213 +phy_chain_rx_lane_map_physical{5.0}=0x3201 +phy_chain_rx_lane_map_physical{53.0}=0x3201 +phy_chain_rx_lane_map_physical{57.0}=0x2013 +phy_chain_rx_lane_map_physical{61.0}=0x0213 +phy_chain_rx_lane_map_physical{65.0}=0x1203 +phy_chain_rx_lane_map_physical{69.0}=0x0213 +phy_chain_rx_lane_map_physical{73.0}=0x0213 +phy_chain_rx_lane_map_physical{77.0}=0x3120 +phy_chain_rx_lane_map_physical{81.0}=0x0213 +phy_chain_rx_lane_map_physical{85.0}=0x2031 +phy_chain_rx_lane_map_physical{89.0}=0x2031 +phy_chain_rx_lane_map_physical{9.0}=0x0321 +phy_chain_rx_lane_map_physical{93.0}=0x3120 +phy_chain_rx_lane_map_physical{97.0}=0x1203 +phy_chain_rx_polarity_flip_physical{1.0}=0x1 +phy_chain_rx_polarity_flip_physical{10.0}=0x0 +phy_chain_rx_polarity_flip_physical{100.0}=0x1 +phy_chain_rx_polarity_flip_physical{101.0}=0x1 +phy_chain_rx_polarity_flip_physical{102.0}=0x0 +phy_chain_rx_polarity_flip_physical{103.0}=0x1 +phy_chain_rx_polarity_flip_physical{104.0}=0x0 +phy_chain_rx_polarity_flip_physical{105.0}=0x1 +phy_chain_rx_polarity_flip_physical{106.0}=0x0 +phy_chain_rx_polarity_flip_physical{107.0}=0x1 +phy_chain_rx_polarity_flip_physical{108.0}=0x0 +phy_chain_rx_polarity_flip_physical{109.0}=0x0 +phy_chain_rx_polarity_flip_physical{11.0}=0x1 +phy_chain_rx_polarity_flip_physical{110.0}=0x1 +phy_chain_rx_polarity_flip_physical{111.0}=0x0 +phy_chain_rx_polarity_flip_physical{112.0}=0x1 +phy_chain_rx_polarity_flip_physical{113.0}=0x1 +phy_chain_rx_polarity_flip_physical{114.0}=0x0 +phy_chain_rx_polarity_flip_physical{115.0}=0x1 +phy_chain_rx_polarity_flip_physical{116.0}=0x0 +phy_chain_rx_polarity_flip_physical{117.0}=0x0 +phy_chain_rx_polarity_flip_physical{118.0}=0x0 +phy_chain_rx_polarity_flip_physical{119.0}=0x1 +phy_chain_rx_polarity_flip_physical{12.0}=0x1 +phy_chain_rx_polarity_flip_physical{120.0}=0x0 +phy_chain_rx_polarity_flip_physical{121.0}=0x1 +phy_chain_rx_polarity_flip_physical{122.0}=0x0 +phy_chain_rx_polarity_flip_physical{123.0}=0x1 +phy_chain_rx_polarity_flip_physical{124.0}=0x0 +phy_chain_rx_polarity_flip_physical{125.0}=0x0 +phy_chain_rx_polarity_flip_physical{126.0}=0x1 +phy_chain_rx_polarity_flip_physical{127.0}=0x1 +phy_chain_rx_polarity_flip_physical{128.0}=0x1 +phy_chain_rx_polarity_flip_physical{129.0}=0x0 +phy_chain_rx_polarity_flip_physical{13.0}=0x1 +phy_chain_rx_polarity_flip_physical{130.0}=0x1 +phy_chain_rx_polarity_flip_physical{131.0}=0x1 +phy_chain_rx_polarity_flip_physical{132.0}=0x0 +phy_chain_rx_polarity_flip_physical{133.0}=0x1 +phy_chain_rx_polarity_flip_physical{134.0}=0x1 +phy_chain_rx_polarity_flip_physical{135.0}=0x1 +phy_chain_rx_polarity_flip_physical{136.0}=0x0 +phy_chain_rx_polarity_flip_physical{137.0}=0x0 +phy_chain_rx_polarity_flip_physical{138.0}=0x0 +phy_chain_rx_polarity_flip_physical{139.0}=0x1 +phy_chain_rx_polarity_flip_physical{14.0}=0x0 +phy_chain_rx_polarity_flip_physical{140.0}=0x0 +phy_chain_rx_polarity_flip_physical{141.0}=0x1 +phy_chain_rx_polarity_flip_physical{142.0}=0x0 +phy_chain_rx_polarity_flip_physical{143.0}=0x1 +phy_chain_rx_polarity_flip_physical{144.0}=0x0 +phy_chain_rx_polarity_flip_physical{145.0}=0x1 +phy_chain_rx_polarity_flip_physical{146.0}=0x0 +phy_chain_rx_polarity_flip_physical{147.0}=0x1 +phy_chain_rx_polarity_flip_physical{148.0}=0x0 +phy_chain_rx_polarity_flip_physical{149.0}=0x0 +phy_chain_rx_polarity_flip_physical{15.0}=0x1 +phy_chain_rx_polarity_flip_physical{150.0}=0x1 +phy_chain_rx_polarity_flip_physical{151.0}=0x1 +phy_chain_rx_polarity_flip_physical{152.0}=0x0 +phy_chain_rx_polarity_flip_physical{153.0}=0x0 +phy_chain_rx_polarity_flip_physical{154.0}=0x1 +phy_chain_rx_polarity_flip_physical{155.0}=0x1 +phy_chain_rx_polarity_flip_physical{156.0}=0x0 +phy_chain_rx_polarity_flip_physical{157.0}=0x0 +phy_chain_rx_polarity_flip_physical{158.0}=0x0 +phy_chain_rx_polarity_flip_physical{159.0}=0x1 +phy_chain_rx_polarity_flip_physical{16.0}=0x0 +phy_chain_rx_polarity_flip_physical{160.0}=0x0 +phy_chain_rx_polarity_flip_physical{161.0}=0x1 +phy_chain_rx_polarity_flip_physical{162.0}=0x1 +phy_chain_rx_polarity_flip_physical{163.0}=0x0 +phy_chain_rx_polarity_flip_physical{164.0}=0x1 +phy_chain_rx_polarity_flip_physical{165.0}=0x0 +phy_chain_rx_polarity_flip_physical{166.0}=0x0 +phy_chain_rx_polarity_flip_physical{167.0}=0x1 +phy_chain_rx_polarity_flip_physical{168.0}=0x1 +phy_chain_rx_polarity_flip_physical{169.0}=0x1 +phy_chain_rx_polarity_flip_physical{17.0}=0x1 +phy_chain_rx_polarity_flip_physical{170.0}=0x1 +phy_chain_rx_polarity_flip_physical{171.0}=0x0 +phy_chain_rx_polarity_flip_physical{172.0}=0x0 +phy_chain_rx_polarity_flip_physical{173.0}=0x0 +phy_chain_rx_polarity_flip_physical{174.0}=0x0 +phy_chain_rx_polarity_flip_physical{175.0}=0x1 +phy_chain_rx_polarity_flip_physical{176.0}=0x1 +phy_chain_rx_polarity_flip_physical{177.0}=0x1 +phy_chain_rx_polarity_flip_physical{178.0}=0x1 +phy_chain_rx_polarity_flip_physical{179.0}=0x0 +phy_chain_rx_polarity_flip_physical{18.0}=0x0 +phy_chain_rx_polarity_flip_physical{180.0}=0x0 +phy_chain_rx_polarity_flip_physical{181.0}=0x1 +phy_chain_rx_polarity_flip_physical{182.0}=0x1 +phy_chain_rx_polarity_flip_physical{183.0}=0x0 +phy_chain_rx_polarity_flip_physical{184.0}=0x0 +phy_chain_rx_polarity_flip_physical{185.0}=0x0 +phy_chain_rx_polarity_flip_physical{186.0}=0x0 +phy_chain_rx_polarity_flip_physical{187.0}=0x1 +phy_chain_rx_polarity_flip_physical{188.0}=0x1 +phy_chain_rx_polarity_flip_physical{189.0}=0x0 +phy_chain_rx_polarity_flip_physical{19.0}=0x1 +phy_chain_rx_polarity_flip_physical{190.0}=0x0 +phy_chain_rx_polarity_flip_physical{191.0}=0x1 +phy_chain_rx_polarity_flip_physical{192.0}=0x0 +phy_chain_rx_polarity_flip_physical{193.0}=0x0 +phy_chain_rx_polarity_flip_physical{194.0}=0x0 +phy_chain_rx_polarity_flip_physical{195.0}=0x1 +phy_chain_rx_polarity_flip_physical{196.0}=0x1 +phy_chain_rx_polarity_flip_physical{197.0}=0x1 +phy_chain_rx_polarity_flip_physical{198.0}=0x1 +phy_chain_rx_polarity_flip_physical{199.0}=0x0 +phy_chain_rx_polarity_flip_physical{2.0}=0x0 +phy_chain_rx_polarity_flip_physical{20.0}=0x0 +phy_chain_rx_polarity_flip_physical{200.0}=0x0 +phy_chain_rx_polarity_flip_physical{201.0}=0x0 +phy_chain_rx_polarity_flip_physical{202.0}=0x0 +phy_chain_rx_polarity_flip_physical{203.0}=0x1 +phy_chain_rx_polarity_flip_physical{204.0}=0x0 +phy_chain_rx_polarity_flip_physical{205.0}=0x1 +phy_chain_rx_polarity_flip_physical{206.0}=0x1 +phy_chain_rx_polarity_flip_physical{207.0}=0x0 +phy_chain_rx_polarity_flip_physical{208.0}=0x0 +phy_chain_rx_polarity_flip_physical{209.0}=0x1 +phy_chain_rx_polarity_flip_physical{21.0}=0x0 +phy_chain_rx_polarity_flip_physical{210.0}=0x1 +phy_chain_rx_polarity_flip_physical{211.0}=0x0 +phy_chain_rx_polarity_flip_physical{212.0}=0x0 +phy_chain_rx_polarity_flip_physical{213.0}=0x0 +phy_chain_rx_polarity_flip_physical{214.0}=0x0 +phy_chain_rx_polarity_flip_physical{215.0}=0x1 +phy_chain_rx_polarity_flip_physical{216.0}=0x0 +phy_chain_rx_polarity_flip_physical{217.0}=0x0 +phy_chain_rx_polarity_flip_physical{218.0}=0x0 +phy_chain_rx_polarity_flip_physical{219.0}=0x1 +phy_chain_rx_polarity_flip_physical{22.0}=0x0 +phy_chain_rx_polarity_flip_physical{220.0}=0x1 +phy_chain_rx_polarity_flip_physical{221.0}=0x0 +phy_chain_rx_polarity_flip_physical{222.0}=0x0 +phy_chain_rx_polarity_flip_physical{223.0}=0x1 +phy_chain_rx_polarity_flip_physical{224.0}=0x1 +phy_chain_rx_polarity_flip_physical{225.0}=0x1 +phy_chain_rx_polarity_flip_physical{226.0}=0x0 +phy_chain_rx_polarity_flip_physical{227.0}=0x0 +phy_chain_rx_polarity_flip_physical{228.0}=0x1 +phy_chain_rx_polarity_flip_physical{229.0}=0x0 +phy_chain_rx_polarity_flip_physical{23.0}=0x1 +phy_chain_rx_polarity_flip_physical{230.0}=0x0 +phy_chain_rx_polarity_flip_physical{231.0}=0x1 +phy_chain_rx_polarity_flip_physical{232.0}=0x1 +phy_chain_rx_polarity_flip_physical{233.0}=0x1 +phy_chain_rx_polarity_flip_physical{234.0}=0x0 +phy_chain_rx_polarity_flip_physical{235.0}=0x0 +phy_chain_rx_polarity_flip_physical{236.0}=0x0 +phy_chain_rx_polarity_flip_physical{237.0}=0x1 +phy_chain_rx_polarity_flip_physical{238.0}=0x0 +phy_chain_rx_polarity_flip_physical{239.0}=0x1 +phy_chain_rx_polarity_flip_physical{24.0}=0x0 +phy_chain_rx_polarity_flip_physical{240.0}=0x0 +phy_chain_rx_polarity_flip_physical{241.0}=0x1 +phy_chain_rx_polarity_flip_physical{242.0}=0x0 +phy_chain_rx_polarity_flip_physical{243.0}=0x1 +phy_chain_rx_polarity_flip_physical{244.0}=0x0 +phy_chain_rx_polarity_flip_physical{245.0}=0x1 +phy_chain_rx_polarity_flip_physical{246.0}=0x1 +phy_chain_rx_polarity_flip_physical{247.0}=0x1 +phy_chain_rx_polarity_flip_physical{248.0}=0x0 +phy_chain_rx_polarity_flip_physical{249.0}=0x0 +phy_chain_rx_polarity_flip_physical{25.0}=0x1 +phy_chain_rx_polarity_flip_physical{250.0}=0x1 +phy_chain_rx_polarity_flip_physical{251.0}=0x0 +phy_chain_rx_polarity_flip_physical{252.0}=0x1 +phy_chain_rx_polarity_flip_physical{253.0}=0x1 +phy_chain_rx_polarity_flip_physical{254.0}=0x0 +phy_chain_rx_polarity_flip_physical{255.0}=0x1 +phy_chain_rx_polarity_flip_physical{256.0}=0x0 +phy_chain_rx_polarity_flip_physical{257.0}=0x0 +phy_chain_rx_polarity_flip_physical{259.0}=0x0 +phy_chain_rx_polarity_flip_physical{26.0}=0x0 +phy_chain_rx_polarity_flip_physical{27.0}=0x1 +phy_chain_rx_polarity_flip_physical{28.0}=0x0 +phy_chain_rx_polarity_flip_physical{29.0}=0x0 +phy_chain_rx_polarity_flip_physical{3.0}=0x1 +phy_chain_rx_polarity_flip_physical{30.0}=0x0 +phy_chain_rx_polarity_flip_physical{31.0}=0x0 +phy_chain_rx_polarity_flip_physical{32.0}=0x1 +phy_chain_rx_polarity_flip_physical{33.0}=0x0 +phy_chain_rx_polarity_flip_physical{34.0}=0x0 +phy_chain_rx_polarity_flip_physical{35.0}=0x1 +phy_chain_rx_polarity_flip_physical{36.0}=0x1 +phy_chain_rx_polarity_flip_physical{37.0}=0x1 +phy_chain_rx_polarity_flip_physical{38.0}=0x1 +phy_chain_rx_polarity_flip_physical{39.0}=0x0 +phy_chain_rx_polarity_flip_physical{4.0}=0x0 +phy_chain_rx_polarity_flip_physical{40.0}=0x0 +phy_chain_rx_polarity_flip_physical{41.0}=0x0 +phy_chain_rx_polarity_flip_physical{42.0}=0x1 +phy_chain_rx_polarity_flip_physical{43.0}=0x1 +phy_chain_rx_polarity_flip_physical{44.0}=0x1 +phy_chain_rx_polarity_flip_physical{45.0}=0x1 +phy_chain_rx_polarity_flip_physical{46.0}=0x0 +phy_chain_rx_polarity_flip_physical{47.0}=0x0 +phy_chain_rx_polarity_flip_physical{48.0}=0x1 +phy_chain_rx_polarity_flip_physical{49.0}=0x1 +phy_chain_rx_polarity_flip_physical{5.0}=0x1 +phy_chain_rx_polarity_flip_physical{50.0}=0x1 +phy_chain_rx_polarity_flip_physical{51.0}=0x0 +phy_chain_rx_polarity_flip_physical{52.0}=0x0 +phy_chain_rx_polarity_flip_physical{53.0}=0x0 +phy_chain_rx_polarity_flip_physical{54.0}=0x0 +phy_chain_rx_polarity_flip_physical{55.0}=0x1 +phy_chain_rx_polarity_flip_physical{56.0}=0x0 +phy_chain_rx_polarity_flip_physical{57.0}=0x0 +phy_chain_rx_polarity_flip_physical{58.0}=0x0 +phy_chain_rx_polarity_flip_physical{59.0}=0x1 +phy_chain_rx_polarity_flip_physical{6.0}=0x0 +phy_chain_rx_polarity_flip_physical{60.0}=0x1 +phy_chain_rx_polarity_flip_physical{61.0}=0x0 +phy_chain_rx_polarity_flip_physical{62.0}=0x0 +phy_chain_rx_polarity_flip_physical{63.0}=0x1 +phy_chain_rx_polarity_flip_physical{64.0}=0x1 +phy_chain_rx_polarity_flip_physical{65.0}=0x1 +phy_chain_rx_polarity_flip_physical{66.0}=0x1 +phy_chain_rx_polarity_flip_physical{67.0}=0x0 +phy_chain_rx_polarity_flip_physical{68.0}=0x1 +phy_chain_rx_polarity_flip_physical{69.0}=0x0 +phy_chain_rx_polarity_flip_physical{7.0}=0x0 +phy_chain_rx_polarity_flip_physical{70.0}=0x0 +phy_chain_rx_polarity_flip_physical{71.0}=0x1 +phy_chain_rx_polarity_flip_physical{72.0}=0x1 +phy_chain_rx_polarity_flip_physical{73.0}=0x1 +phy_chain_rx_polarity_flip_physical{74.0}=0x1 +phy_chain_rx_polarity_flip_physical{75.0}=0x0 +phy_chain_rx_polarity_flip_physical{76.0}=0x0 +phy_chain_rx_polarity_flip_physical{77.0}=0x0 +phy_chain_rx_polarity_flip_physical{78.0}=0x0 +phy_chain_rx_polarity_flip_physical{79.0}=0x1 +phy_chain_rx_polarity_flip_physical{8.0}=0x1 +phy_chain_rx_polarity_flip_physical{80.0}=0x1 +phy_chain_rx_polarity_flip_physical{81.0}=0x1 +phy_chain_rx_polarity_flip_physical{82.0}=0x1 +phy_chain_rx_polarity_flip_physical{83.0}=0x0 +phy_chain_rx_polarity_flip_physical{84.0}=0x0 +phy_chain_rx_polarity_flip_physical{85.0}=0x1 +phy_chain_rx_polarity_flip_physical{86.0}=0x1 +phy_chain_rx_polarity_flip_physical{87.0}=0x0 +phy_chain_rx_polarity_flip_physical{88.0}=0x0 +phy_chain_rx_polarity_flip_physical{89.0}=0x0 +phy_chain_rx_polarity_flip_physical{9.0}=0x1 +phy_chain_rx_polarity_flip_physical{90.0}=0x0 +phy_chain_rx_polarity_flip_physical{91.0}=0x1 +phy_chain_rx_polarity_flip_physical{92.0}=0x1 +phy_chain_rx_polarity_flip_physical{93.0}=0x0 +phy_chain_rx_polarity_flip_physical{94.0}=0x0 +phy_chain_rx_polarity_flip_physical{95.0}=0x1 +phy_chain_rx_polarity_flip_physical{96.0}=0x0 +phy_chain_rx_polarity_flip_physical{97.0}=0x1 +phy_chain_rx_polarity_flip_physical{98.0}=0x1 +phy_chain_rx_polarity_flip_physical{99.0}=0x0 +phy_chain_tx_lane_map_physical{1.0}=0x2031 +phy_chain_tx_lane_map_physical{101.0}=0x1023 +phy_chain_tx_lane_map_physical{105.0}=0x1302 +phy_chain_tx_lane_map_physical{109.0}=0x0321 +phy_chain_tx_lane_map_physical{113.0}=0x2301 +phy_chain_tx_lane_map_physical{117.0}=0x3120 +phy_chain_tx_lane_map_physical{121.0}=0x3102 +phy_chain_tx_lane_map_physical{125.0}=0x3210 +phy_chain_tx_lane_map_physical{129.0}=0x1023 +phy_chain_tx_lane_map_physical{13.0}=0x3021 +phy_chain_tx_lane_map_physical{133.0}=0x3210 +phy_chain_tx_lane_map_physical{137.0}=0x2031 +phy_chain_tx_lane_map_physical{141.0}=0x1302 +phy_chain_tx_lane_map_physical{145.0}=0x3210 +phy_chain_tx_lane_map_physical{149.0}=0x0213 +phy_chain_tx_lane_map_physical{153.0}=0x3210 +phy_chain_tx_lane_map_physical{157.0}=0x1320 +phy_chain_tx_lane_map_physical{161.0}=0x3210 +phy_chain_tx_lane_map_physical{165.0}=0x0231 +phy_chain_tx_lane_map_physical{169.0}=0x3120 +phy_chain_tx_lane_map_physical{17.0}=0x1032 +phy_chain_tx_lane_map_physical{173.0}=0x0312 +phy_chain_tx_lane_map_physical{177.0}=0x0231 +phy_chain_tx_lane_map_physical{181.0}=0x3210 +phy_chain_tx_lane_map_physical{185.0}=0x3210 +phy_chain_tx_lane_map_physical{189.0}=0x1320 +phy_chain_tx_lane_map_physical{193.0}=0x0321 +phy_chain_tx_lane_map_physical{197.0}=0x3120 +phy_chain_tx_lane_map_physical{201.0}=0x3120 +phy_chain_tx_lane_map_physical{205.0}=0x0123 +phy_chain_tx_lane_map_physical{209.0}=0x3120 +phy_chain_tx_lane_map_physical{21.0}=0x0213 +phy_chain_tx_lane_map_physical{213.0}=0x3021 +phy_chain_tx_lane_map_physical{217.0}=0x0312 +phy_chain_tx_lane_map_physical{221.0}=0x2301 +phy_chain_tx_lane_map_physical{225.0}=0x0123 +phy_chain_tx_lane_map_physical{229.0}=0x2031 +phy_chain_tx_lane_map_physical{233.0}=0x0231 +phy_chain_tx_lane_map_physical{237.0}=0x0213 +phy_chain_tx_lane_map_physical{241.0}=0x1320 +phy_chain_tx_lane_map_physical{245.0}=0x2031 +phy_chain_tx_lane_map_physical{249.0}=0x3120 +phy_chain_tx_lane_map_physical{25.0}=0x0231 +phy_chain_tx_lane_map_physical{253.0}=0x0321 +phy_chain_tx_lane_map_physical{257.0}=0x3210 +phy_chain_tx_lane_map_physical{29.0}=0x1230 +phy_chain_tx_lane_map_physical{33.0}=0x1032 +phy_chain_tx_lane_map_physical{37.0}=0x0123 +phy_chain_tx_lane_map_physical{41.0}=0x0213 +phy_chain_tx_lane_map_physical{45.0}=0x0132 +phy_chain_tx_lane_map_physical{49.0}=0x2031 +phy_chain_tx_lane_map_physical{5.0}=0x2301 +phy_chain_tx_lane_map_physical{53.0}=0x2301 +phy_chain_tx_lane_map_physical{57.0}=0x2031 +phy_chain_tx_lane_map_physical{61.0}=0x2031 +phy_chain_tx_lane_map_physical{65.0}=0x1230 +phy_chain_tx_lane_map_physical{69.0}=0x2013 +phy_chain_tx_lane_map_physical{73.0}=0x0213 +phy_chain_tx_lane_map_physical{77.0}=0x2310 +phy_chain_tx_lane_map_physical{81.0}=0x0321 +phy_chain_tx_lane_map_physical{85.0}=0x2013 +phy_chain_tx_lane_map_physical{89.0}=0x0213 +phy_chain_tx_lane_map_physical{9.0}=0x3012 +phy_chain_tx_lane_map_physical{93.0}=0x3102 +phy_chain_tx_lane_map_physical{97.0}=0x3210 +phy_chain_tx_polarity_flip_physical{1.0}=0x0 +phy_chain_tx_polarity_flip_physical{10.0}=0x1 +phy_chain_tx_polarity_flip_physical{100.0}=0x0 +phy_chain_tx_polarity_flip_physical{101.0}=0x0 +phy_chain_tx_polarity_flip_physical{102.0}=0x1 +phy_chain_tx_polarity_flip_physical{103.0}=0x0 +phy_chain_tx_polarity_flip_physical{104.0}=0x0 +phy_chain_tx_polarity_flip_physical{105.0}=0x0 +phy_chain_tx_polarity_flip_physical{106.0}=0x1 +phy_chain_tx_polarity_flip_physical{107.0}=0x1 +phy_chain_tx_polarity_flip_physical{108.0}=0x1 +phy_chain_tx_polarity_flip_physical{109.0}=0x0 +phy_chain_tx_polarity_flip_physical{11.0}=0x1 +phy_chain_tx_polarity_flip_physical{110.0}=0x0 +phy_chain_tx_polarity_flip_physical{111.0}=0x0 +phy_chain_tx_polarity_flip_physical{112.0}=0x1 +phy_chain_tx_polarity_flip_physical{113.0}=0x1 +phy_chain_tx_polarity_flip_physical{114.0}=0x1 +phy_chain_tx_polarity_flip_physical{115.0}=0x1 +phy_chain_tx_polarity_flip_physical{116.0}=0x0 +phy_chain_tx_polarity_flip_physical{117.0}=0x1 +phy_chain_tx_polarity_flip_physical{118.0}=0x0 +phy_chain_tx_polarity_flip_physical{119.0}=0x0 +phy_chain_tx_polarity_flip_physical{12.0}=0x0 +phy_chain_tx_polarity_flip_physical{120.0}=0x0 +phy_chain_tx_polarity_flip_physical{121.0}=0x0 +phy_chain_tx_polarity_flip_physical{122.0}=0x0 +phy_chain_tx_polarity_flip_physical{123.0}=0x0 +phy_chain_tx_polarity_flip_physical{124.0}=0x1 +phy_chain_tx_polarity_flip_physical{125.0}=0x0 +phy_chain_tx_polarity_flip_physical{126.0}=0x1 +phy_chain_tx_polarity_flip_physical{127.0}=0x1 +phy_chain_tx_polarity_flip_physical{128.0}=0x1 +phy_chain_tx_polarity_flip_physical{129.0}=0x1 +phy_chain_tx_polarity_flip_physical{13.0}=0x0 +phy_chain_tx_polarity_flip_physical{130.0}=0x0 +phy_chain_tx_polarity_flip_physical{131.0}=0x1 +phy_chain_tx_polarity_flip_physical{132.0}=0x0 +phy_chain_tx_polarity_flip_physical{133.0}=0x1 +phy_chain_tx_polarity_flip_physical{134.0}=0x1 +phy_chain_tx_polarity_flip_physical{135.0}=0x1 +phy_chain_tx_polarity_flip_physical{136.0}=0x1 +phy_chain_tx_polarity_flip_physical{137.0}=0x1 +phy_chain_tx_polarity_flip_physical{138.0}=0x1 +phy_chain_tx_polarity_flip_physical{139.0}=0x1 +phy_chain_tx_polarity_flip_physical{14.0}=0x1 +phy_chain_tx_polarity_flip_physical{140.0}=0x1 +phy_chain_tx_polarity_flip_physical{141.0}=0x0 +phy_chain_tx_polarity_flip_physical{142.0}=0x1 +phy_chain_tx_polarity_flip_physical{143.0}=0x1 +phy_chain_tx_polarity_flip_physical{144.0}=0x1 +phy_chain_tx_polarity_flip_physical{145.0}=0x1 +phy_chain_tx_polarity_flip_physical{146.0}=0x1 +phy_chain_tx_polarity_flip_physical{147.0}=0x1 +phy_chain_tx_polarity_flip_physical{148.0}=0x0 +phy_chain_tx_polarity_flip_physical{149.0}=0x1 +phy_chain_tx_polarity_flip_physical{15.0}=0x0 +phy_chain_tx_polarity_flip_physical{150.0}=0x0 +phy_chain_tx_polarity_flip_physical{151.0}=0x0 +phy_chain_tx_polarity_flip_physical{152.0}=0x0 +phy_chain_tx_polarity_flip_physical{153.0}=0x1 +phy_chain_tx_polarity_flip_physical{154.0}=0x0 +phy_chain_tx_polarity_flip_physical{155.0}=0x0 +phy_chain_tx_polarity_flip_physical{156.0}=0x0 +phy_chain_tx_polarity_flip_physical{157.0}=0x0 +phy_chain_tx_polarity_flip_physical{158.0}=0x0 +phy_chain_tx_polarity_flip_physical{159.0}=0x0 +phy_chain_tx_polarity_flip_physical{16.0}=0x0 +phy_chain_tx_polarity_flip_physical{160.0}=0x0 +phy_chain_tx_polarity_flip_physical{161.0}=0x0 +phy_chain_tx_polarity_flip_physical{162.0}=0x1 +phy_chain_tx_polarity_flip_physical{163.0}=0x1 +phy_chain_tx_polarity_flip_physical{164.0}=0x0 +phy_chain_tx_polarity_flip_physical{165.0}=0x1 +phy_chain_tx_polarity_flip_physical{166.0}=0x1 +phy_chain_tx_polarity_flip_physical{167.0}=0x1 +phy_chain_tx_polarity_flip_physical{168.0}=0x0 +phy_chain_tx_polarity_flip_physical{169.0}=0x0 +phy_chain_tx_polarity_flip_physical{17.0}=0x0 +phy_chain_tx_polarity_flip_physical{170.0}=0x1 +phy_chain_tx_polarity_flip_physical{171.0}=0x1 +phy_chain_tx_polarity_flip_physical{172.0}=0x1 +phy_chain_tx_polarity_flip_physical{173.0}=0x0 +phy_chain_tx_polarity_flip_physical{174.0}=0x0 +phy_chain_tx_polarity_flip_physical{175.0}=0x1 +phy_chain_tx_polarity_flip_physical{176.0}=0x0 +phy_chain_tx_polarity_flip_physical{177.0}=0x1 +phy_chain_tx_polarity_flip_physical{178.0}=0x0 +phy_chain_tx_polarity_flip_physical{179.0}=0x0 +phy_chain_tx_polarity_flip_physical{18.0}=0x1 +phy_chain_tx_polarity_flip_physical{180.0}=0x0 +phy_chain_tx_polarity_flip_physical{181.0}=0x0 +phy_chain_tx_polarity_flip_physical{182.0}=0x0 +phy_chain_tx_polarity_flip_physical{183.0}=0x0 +phy_chain_tx_polarity_flip_physical{184.0}=0x1 +phy_chain_tx_polarity_flip_physical{185.0}=0x0 +phy_chain_tx_polarity_flip_physical{186.0}=0x1 +phy_chain_tx_polarity_flip_physical{187.0}=0x1 +phy_chain_tx_polarity_flip_physical{188.0}=0x1 +phy_chain_tx_polarity_flip_physical{189.0}=0x0 +phy_chain_tx_polarity_flip_physical{19.0}=0x1 +phy_chain_tx_polarity_flip_physical{190.0}=0x0 +phy_chain_tx_polarity_flip_physical{191.0}=0x0 +phy_chain_tx_polarity_flip_physical{192.0}=0x0 +phy_chain_tx_polarity_flip_physical{193.0}=0x1 +phy_chain_tx_polarity_flip_physical{194.0}=0x1 +phy_chain_tx_polarity_flip_physical{195.0}=0x1 +phy_chain_tx_polarity_flip_physical{196.0}=0x0 +phy_chain_tx_polarity_flip_physical{197.0}=0x0 +phy_chain_tx_polarity_flip_physical{198.0}=0x1 +phy_chain_tx_polarity_flip_physical{199.0}=0x1 +phy_chain_tx_polarity_flip_physical{2.0}=0x1 +phy_chain_tx_polarity_flip_physical{20.0}=0x1 +phy_chain_tx_polarity_flip_physical{200.0}=0x1 +phy_chain_tx_polarity_flip_physical{201.0}=0x1 +phy_chain_tx_polarity_flip_physical{202.0}=0x1 +phy_chain_tx_polarity_flip_physical{203.0}=0x1 +phy_chain_tx_polarity_flip_physical{204.0}=0x1 +phy_chain_tx_polarity_flip_physical{205.0}=0x0 +phy_chain_tx_polarity_flip_physical{206.0}=0x1 +phy_chain_tx_polarity_flip_physical{207.0}=0x1 +phy_chain_tx_polarity_flip_physical{208.0}=0x1 +phy_chain_tx_polarity_flip_physical{209.0}=0x1 +phy_chain_tx_polarity_flip_physical{21.0}=0x0 +phy_chain_tx_polarity_flip_physical{210.0}=0x1 +phy_chain_tx_polarity_flip_physical{211.0}=0x1 +phy_chain_tx_polarity_flip_physical{212.0}=0x0 +phy_chain_tx_polarity_flip_physical{213.0}=0x0 +phy_chain_tx_polarity_flip_physical{214.0}=0x1 +phy_chain_tx_polarity_flip_physical{215.0}=0x0 +phy_chain_tx_polarity_flip_physical{216.0}=0x1 +phy_chain_tx_polarity_flip_physical{217.0}=0x1 +phy_chain_tx_polarity_flip_physical{218.0}=0x1 +phy_chain_tx_polarity_flip_physical{219.0}=0x0 +phy_chain_tx_polarity_flip_physical{22.0}=0x0 +phy_chain_tx_polarity_flip_physical{220.0}=0x1 +phy_chain_tx_polarity_flip_physical{221.0}=0x0 +phy_chain_tx_polarity_flip_physical{222.0}=0x0 +phy_chain_tx_polarity_flip_physical{223.0}=0x0 +phy_chain_tx_polarity_flip_physical{224.0}=0x1 +phy_chain_tx_polarity_flip_physical{225.0}=0x1 +phy_chain_tx_polarity_flip_physical{226.0}=0x1 +phy_chain_tx_polarity_flip_physical{227.0}=0x1 +phy_chain_tx_polarity_flip_physical{228.0}=0x0 +phy_chain_tx_polarity_flip_physical{229.0}=0x0 +phy_chain_tx_polarity_flip_physical{23.0}=0x0 +phy_chain_tx_polarity_flip_physical{230.0}=0x1 +phy_chain_tx_polarity_flip_physical{231.0}=0x1 +phy_chain_tx_polarity_flip_physical{232.0}=0x1 +phy_chain_tx_polarity_flip_physical{233.0}=0x0 +phy_chain_tx_polarity_flip_physical{234.0}=0x0 +phy_chain_tx_polarity_flip_physical{235.0}=0x0 +phy_chain_tx_polarity_flip_physical{236.0}=0x0 +phy_chain_tx_polarity_flip_physical{237.0}=0x1 +phy_chain_tx_polarity_flip_physical{238.0}=0x1 +phy_chain_tx_polarity_flip_physical{239.0}=0x1 +phy_chain_tx_polarity_flip_physical{24.0}=0x0 +phy_chain_tx_polarity_flip_physical{240.0}=0x0 +phy_chain_tx_polarity_flip_physical{241.0}=0x1 +phy_chain_tx_polarity_flip_physical{242.0}=0x1 +phy_chain_tx_polarity_flip_physical{243.0}=0x1 +phy_chain_tx_polarity_flip_physical{244.0}=0x0 +phy_chain_tx_polarity_flip_physical{245.0}=0x1 +phy_chain_tx_polarity_flip_physical{246.0}=0x1 +phy_chain_tx_polarity_flip_physical{247.0}=0x1 +phy_chain_tx_polarity_flip_physical{248.0}=0x1 +phy_chain_tx_polarity_flip_physical{249.0}=0x1 +phy_chain_tx_polarity_flip_physical{25.0}=0x1 +phy_chain_tx_polarity_flip_physical{250.0}=0x0 +phy_chain_tx_polarity_flip_physical{251.0}=0x0 +phy_chain_tx_polarity_flip_physical{252.0}=0x0 +phy_chain_tx_polarity_flip_physical{253.0}=0x1 +phy_chain_tx_polarity_flip_physical{254.0}=0x1 +phy_chain_tx_polarity_flip_physical{255.0}=0x1 +phy_chain_tx_polarity_flip_physical{256.0}=0x0 +phy_chain_tx_polarity_flip_physical{257.0}=0x0 +phy_chain_tx_polarity_flip_physical{259.0}=0x0 +phy_chain_tx_polarity_flip_physical{26.0}=0x0 +phy_chain_tx_polarity_flip_physical{27.0}=0x0 +phy_chain_tx_polarity_flip_physical{28.0}=0x0 +phy_chain_tx_polarity_flip_physical{29.0}=0x1 +phy_chain_tx_polarity_flip_physical{3.0}=0x1 +phy_chain_tx_polarity_flip_physical{30.0}=0x1 +phy_chain_tx_polarity_flip_physical{31.0}=0x1 +phy_chain_tx_polarity_flip_physical{32.0}=0x0 +phy_chain_tx_polarity_flip_physical{33.0}=0x0 +phy_chain_tx_polarity_flip_physical{34.0}=0x0 +phy_chain_tx_polarity_flip_physical{35.0}=0x0 +phy_chain_tx_polarity_flip_physical{36.0}=0x1 +phy_chain_tx_polarity_flip_physical{37.0}=0x1 +phy_chain_tx_polarity_flip_physical{38.0}=0x1 +phy_chain_tx_polarity_flip_physical{39.0}=0x1 +phy_chain_tx_polarity_flip_physical{4.0}=0x1 +phy_chain_tx_polarity_flip_physical{40.0}=0x0 +phy_chain_tx_polarity_flip_physical{41.0}=0x0 +phy_chain_tx_polarity_flip_physical{42.0}=0x0 +phy_chain_tx_polarity_flip_physical{43.0}=0x0 +phy_chain_tx_polarity_flip_physical{44.0}=0x0 +phy_chain_tx_polarity_flip_physical{45.0}=0x1 +phy_chain_tx_polarity_flip_physical{46.0}=0x0 +phy_chain_tx_polarity_flip_physical{47.0}=0x1 +phy_chain_tx_polarity_flip_physical{48.0}=0x1 +phy_chain_tx_polarity_flip_physical{49.0}=0x0 +phy_chain_tx_polarity_flip_physical{5.0}=0x1 +phy_chain_tx_polarity_flip_physical{50.0}=0x0 +phy_chain_tx_polarity_flip_physical{51.0}=0x0 +phy_chain_tx_polarity_flip_physical{52.0}=0x1 +phy_chain_tx_polarity_flip_physical{53.0}=0x0 +phy_chain_tx_polarity_flip_physical{54.0}=0x1 +phy_chain_tx_polarity_flip_physical{55.0}=0x1 +phy_chain_tx_polarity_flip_physical{56.0}=0x0 +phy_chain_tx_polarity_flip_physical{57.0}=0x0 +phy_chain_tx_polarity_flip_physical{58.0}=0x1 +phy_chain_tx_polarity_flip_physical{59.0}=0x1 +phy_chain_tx_polarity_flip_physical{6.0}=0x1 +phy_chain_tx_polarity_flip_physical{60.0}=0x1 +phy_chain_tx_polarity_flip_physical{61.0}=0x0 +phy_chain_tx_polarity_flip_physical{62.0}=0x1 +phy_chain_tx_polarity_flip_physical{63.0}=0x1 +phy_chain_tx_polarity_flip_physical{64.0}=0x1 +phy_chain_tx_polarity_flip_physical{65.0}=0x0 +phy_chain_tx_polarity_flip_physical{66.0}=0x1 +phy_chain_tx_polarity_flip_physical{67.0}=0x1 +phy_chain_tx_polarity_flip_physical{68.0}=0x0 +phy_chain_tx_polarity_flip_physical{69.0}=0x1 +phy_chain_tx_polarity_flip_physical{7.0}=0x1 +phy_chain_tx_polarity_flip_physical{70.0}=0x1 +phy_chain_tx_polarity_flip_physical{71.0}=0x1 +phy_chain_tx_polarity_flip_physical{72.0}=0x0 +phy_chain_tx_polarity_flip_physical{73.0}=0x1 +phy_chain_tx_polarity_flip_physical{74.0}=0x0 +phy_chain_tx_polarity_flip_physical{75.0}=0x0 +phy_chain_tx_polarity_flip_physical{76.0}=0x0 +phy_chain_tx_polarity_flip_physical{77.0}=0x0 +phy_chain_tx_polarity_flip_physical{78.0}=0x0 +phy_chain_tx_polarity_flip_physical{79.0}=0x1 +phy_chain_tx_polarity_flip_physical{8.0}=0x0 +phy_chain_tx_polarity_flip_physical{80.0}=0x0 +phy_chain_tx_polarity_flip_physical{81.0}=0x1 +phy_chain_tx_polarity_flip_physical{82.0}=0x1 +phy_chain_tx_polarity_flip_physical{83.0}=0x1 +phy_chain_tx_polarity_flip_physical{84.0}=0x0 +phy_chain_tx_polarity_flip_physical{85.0}=0x1 +phy_chain_tx_polarity_flip_physical{86.0}=0x0 +phy_chain_tx_polarity_flip_physical{87.0}=0x0 +phy_chain_tx_polarity_flip_physical{88.0}=0x0 +phy_chain_tx_polarity_flip_physical{89.0}=0x1 +phy_chain_tx_polarity_flip_physical{9.0}=0x0 +phy_chain_tx_polarity_flip_physical{90.0}=0x1 +phy_chain_tx_polarity_flip_physical{91.0}=0x1 +phy_chain_tx_polarity_flip_physical{92.0}=0x0 +phy_chain_tx_polarity_flip_physical{93.0}=0x0 +phy_chain_tx_polarity_flip_physical{94.0}=0x0 +phy_chain_tx_polarity_flip_physical{95.0}=0x0 +phy_chain_tx_polarity_flip_physical{96.0}=0x0 +phy_chain_tx_polarity_flip_physical{97.0}=0x0 +phy_chain_tx_polarity_flip_physical{98.0}=0x1 +phy_chain_tx_polarity_flip_physical{99.0}=0x1 + +port_init_cl72_hg=1 + + + + + + + +robust_hash_disable_egress_vlan=1 +robust_hash_disable_mpls=1 +robust_hash_disable_vlan=1 +stable_size=0x5500000 +stable_size=0x5500000 +tdma_timeout_usec=15000000 +tslam_timeout_usec=15000000 +dport_map_direct=1 +portmap_1=5:50 +portmap_2=7:50 +portmap_3=13:50 +portmap_4=15:50 +portmap_5=25:50 +portmap_6=27:50 +portmap_7=21:50 +portmap_8=23:50 +portmap_9=37:50 +portmap_10=39:50 +portmap_11=45:50 +portmap_12=47:50 +portmap_13=57:100 +portmap_14=53:100 +portmap_15=9:50 +portmap_16=11:50 +portmap_17=1:50 +portmap_18=3:50 +portmap_19=17:50 +portmap_20=19:50 +portmap_21=29:50 +portmap_22=31:50 +portmap_23=41:50 +portmap_24=43:50 +portmap_25=33:50 +portmap_26=35:50 +portmap_27=49:100 +portmap_28=61:100 +portmap_34=77:50 +portmap_35=79:50 +portmap_36=65:50 +portmap_37=67:50 +portmap_38=85:50 +portmap_39=87:50 +portmap_40=89:50 +portmap_41=91:50 +portmap_42=109:50 +portmap_43=111:50 +portmap_44=97:50 +portmap_45=99:50 +portmap_46=117:100 +portmap_47=121:100 +portmap_48=69:50 +portmap_49=71:50 +portmap_50=73:50 +portmap_51=75:50 +portmap_52=93:50 +portmap_53=95:50 +portmap_54=81:50 +portmap_55=83:50 +portmap_56=101:50 +portmap_57=103:50 +portmap_58=105:50 +portmap_59=107:50 +portmap_60=125:100 +portmap_61=113:100 +portmap_66=257:10 +portmap_68=141:100 +portmap_69=133:100 +portmap_70=149:50 +portmap_71=151:50 +portmap_72=153:50 +portmap_73=155:50 +portmap_74=173:50 +portmap_75=175:50 +portmap_76=161:50 +portmap_77=163:50 +portmap_78=181:50 +portmap_79=183:50 +portmap_80=185:50 +portmap_81=187:50 +portmap_82=129:100 +portmap_83=137:100 +portmap_84=157:50 +portmap_85=159:50 +portmap_86=145:50 +portmap_87=147:50 +portmap_88=165:50 +portmap_89=167:50 +portmap_90=169:50 +portmap_91=171:50 +portmap_92=189:50 +portmap_93=191:50 +portmap_94=177:50 +portmap_95=179:50 +portmap_100=259:10 +portmap_102=197:100 +portmap_103=205:100 +portmap_104=217:50 +portmap_105=219:50 +portmap_106=213:50 +portmap_107=215:50 +portmap_108=229:50 +portmap_109=231:50 +portmap_110=237:50 +portmap_111=239:50 +portmap_112=249:50 +portmap_113=251:50 +portmap_114=245:50 +portmap_115=247:50 +portmap_116=201:100 +portmap_117=193:100 +portmap_118=209:50 +portmap_119=211:50 +portmap_120=221:50 +portmap_121=223:50 +portmap_122=233:50 +portmap_123=235:50 +portmap_124=225:50 +portmap_125=227:50 +portmap_126=241:50 +portmap_127=243:50 +portmap_128=253:50 +portmap_129=255:50 + +# tuning parameters +serdes_preemphasis_1=0x580c +serdes_preemphasis_2=0x580c +serdes_preemphasis_3=0x580c +serdes_preemphasis_4=0x580c +serdes_preemphasis_5=0x580c +serdes_preemphasis_6=0x580c +serdes_preemphasis_7=0x580c +serdes_preemphasis_8=0x580c +serdes_preemphasis_9=0x580c +serdes_preemphasis_10=0x580c +serdes_preemphasis_11=0x580c +serdes_preemphasis_12=0x580c +serdes_preemphasis_13=0x83404 +serdes_preemphasis_14=0x83404 +serdes_preemphasis_15=0x580c +serdes_preemphasis_16=0x580c +serdes_preemphasis_17=0x580c +serdes_preemphasis_18=0x580c +serdes_preemphasis_19=0x580c +serdes_preemphasis_20=0x580c +serdes_preemphasis_21=0x580c +serdes_preemphasis_22=0x580c +serdes_preemphasis_23=0x580c +serdes_preemphasis_24=0x580c +serdes_preemphasis_25=0x580c +serdes_preemphasis_26=0x580c +serdes_preemphasis_27=0xf3c05 +serdes_preemphasis_28=0xf3d05 +serdes_preemphasis_34=0x580c +serdes_preemphasis_35=0x580c +serdes_preemphasis_36=0x580c +serdes_preemphasis_37=0x580c +serdes_preemphasis_38=0x580c +serdes_preemphasis_39=0x580c +serdes_preemphasis_40=0x580c +serdes_preemphasis_41=0x580c +serdes_preemphasis_42=0x580c +serdes_preemphasis_43=0x580c +serdes_preemphasis_44=0x580c +serdes_preemphasis_45=0x580c +serdes_preemphasis_46=0xb3604 +serdes_preemphasis_47=0x72b03 +serdes_preemphasis_48=0x580c +serdes_preemphasis_49=0x580c +serdes_preemphasis_50=0x580c +serdes_preemphasis_51=0x580c +serdes_preemphasis_52=0x580c +serdes_preemphasis_53=0x580c +serdes_preemphasis_54=0x580c +serdes_preemphasis_55=0x580c +serdes_preemphasis_56=0x580c +serdes_preemphasis_57=0x580c +serdes_preemphasis_58=0x580c +serdes_preemphasis_59=0x580c +serdes_preemphasis_60=0xf3c05 +serdes_preemphasis_61=0x103f06 +serdes_preemphasis_66=0x43004 +serdes_preemphasis_68=0xf4006 +serdes_preemphasis_69=0xf4006 +serdes_preemphasis_70=0x580c +serdes_preemphasis_71=0x580c +serdes_preemphasis_72=0x580c +serdes_preemphasis_73=0x580c +serdes_preemphasis_74=0x580c +serdes_preemphasis_75=0x580c +serdes_preemphasis_76=0x580c +serdes_preemphasis_77=0x580c +serdes_preemphasis_78=0x580c +serdes_preemphasis_79=0x580c +serdes_preemphasis_80=0x580c +serdes_preemphasis_81=0x580c +serdes_preemphasis_82=0x73103 +serdes_preemphasis_83=0x73103 +serdes_preemphasis_84=0x580c +serdes_preemphasis_85=0x580c +serdes_preemphasis_86=0x580c +serdes_preemphasis_87=0x580c +serdes_preemphasis_88=0x580c +serdes_preemphasis_89=0x580c +serdes_preemphasis_90=0x580c +serdes_preemphasis_91=0x580c +serdes_preemphasis_92=0x580c +serdes_preemphasis_93=0x580c +serdes_preemphasis_94=0x580c +serdes_preemphasis_95=0x580c +serdes_preemphasis_100=0x43004 +serdes_preemphasis_102=0xf3c05 +serdes_preemphasis_103=0xf3c05 +serdes_preemphasis_104=0x580c +serdes_preemphasis_105=0x580c +serdes_preemphasis_106=0x580c +serdes_preemphasis_107=0x580c +serdes_preemphasis_108=0x580c +serdes_preemphasis_109=0x580c +serdes_preemphasis_110=0x580c +serdes_preemphasis_111=0x580c +serdes_preemphasis_112=0x580c +serdes_preemphasis_113=0x580c +serdes_preemphasis_114=0x580c +serdes_preemphasis_115=0x580c +serdes_preemphasis_116=0x83404 +serdes_preemphasis_117=0x83404 +serdes_preemphasis_118=0x580c +serdes_preemphasis_119=0x580c +serdes_preemphasis_120=0x580c +serdes_preemphasis_121=0x580c +serdes_preemphasis_122=0x580c +serdes_preemphasis_123=0x580c +serdes_preemphasis_124=0x580c +serdes_preemphasis_125=0x580c +serdes_preemphasis_126=0x580c +serdes_preemphasis_127=0x580c +serdes_preemphasis_128=0x580c +serdes_preemphasis_129=0x580c + +mmu_init_config="MSFT-TH2-Tier0" +{{ IPinIP_sock }} + +phy_an_lt_msft=1 diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D96C16/pg_profile_lookup.ini b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D96C16/pg_profile_lookup.ini new file mode 100644 index 000000000000..a12e306278cc --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D96C16/pg_profile_lookup.ini @@ -0,0 +1,8 @@ +# PG lossless profiles. +# speed cable size xon xoff threshold xon_offset + 50000 5m 1248 1248 56160 0 2496 + 100000 5m 1248 1248 96928 0 2496 + 50000 40m 1248 1248 96096 0 2496 + 100000 40m 1248 1248 177632 0 2496 + 50000 300m 1248 1248 141856 0 2496 + 100000 300m 1248 1248 268736 0 2496 diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D96C16/port_config.ini b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D96C16/port_config.ini new file mode 100644 index 000000000000..49bd6fd68856 --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D96C16/port_config.ini @@ -0,0 +1,115 @@ +# name lanes alias index speed +Ethernet0 77,78 Ethernet1/1 1 50000 +Ethernet2 79,80 Ethernet1/3 1 50000 +Ethernet4 65,66 Ethernet2/1 2 50000 +Ethernet6 67,68 Ethernet2/3 2 50000 +Ethernet8 85,86 Ethernet3/1 3 50000 +Ethernet10 87,88 Ethernet3/3 3 50000 +Ethernet12 89,90 Ethernet4/1 4 50000 +Ethernet14 91,92 Ethernet4/3 4 50000 +Ethernet16 109,110 Ethernet5/1 5 50000 +Ethernet18 111,112 Ethernet5/3 5 50000 +Ethernet20 97,98 Ethernet6/1 6 50000 +Ethernet22 99,100 Ethernet6/3 6 50000 +Ethernet24 5,6 Ethernet7/1 7 50000 +Ethernet26 7,8 Ethernet7/3 7 50000 +Ethernet28 13,14 Ethernet8/1 8 50000 +Ethernet30 15,16 Ethernet8/3 8 50000 +Ethernet32 25,26 Ethernet9/1 9 50000 +Ethernet34 27,28 Ethernet9/3 9 50000 +Ethernet36 21,22 Ethernet10/1 10 50000 +Ethernet38 23,24 Ethernet10/3 10 50000 +Ethernet40 37,38 Ethernet11/1 11 50000 +Ethernet42 39,40 Ethernet11/3 11 50000 +Ethernet44 45,46 Ethernet12/1 12 50000 +Ethernet46 47,48 Ethernet12/3 12 50000 +Ethernet48 57,58,59,60 Ethernet13/1 13 100000 +Ethernet52 53,54,55,56 Ethernet14/1 14 100000 +Ethernet56 117,118,119,120 Ethernet15/1 15 100000 +Ethernet60 121,122,123,124 Ethernet16/1 16 100000 +Ethernet64 141,142,143,144 Ethernet17/1 17 100000 +Ethernet68 133,134,135,136 Ethernet18/1 18 100000 +Ethernet72 197,198,199,200 Ethernet19/1 19 100000 +Ethernet76 205,206,207,208 Ethernet20/1 20 100000 +Ethernet80 217,218 Ethernet21/1 21 50000 +Ethernet82 219,220 Ethernet21/3 21 50000 +Ethernet84 213,214 Ethernet22/1 22 50000 +Ethernet86 215,216 Ethernet22/3 22 50000 +Ethernet88 229,230 Ethernet23/1 23 50000 +Ethernet90 231,232 Ethernet23/3 23 50000 +Ethernet92 237,238 Ethernet24/1 24 50000 +Ethernet94 239,240 Ethernet24/3 24 50000 +Ethernet96 249,250 Ethernet25/1 25 50000 +Ethernet98 251,252 Ethernet25/3 25 50000 +Ethernet100 245,246 Ethernet26/1 26 50000 +Ethernet102 247,248 Ethernet26/3 26 50000 +Ethernet104 149,150 Ethernet27/1 27 50000 +Ethernet106 151,152 Ethernet27/3 27 50000 +Ethernet108 153,154 Ethernet28/1 28 50000 +Ethernet110 155,156 Ethernet28/3 28 50000 +Ethernet112 173,174 Ethernet29/1 29 50000 +Ethernet114 175,176 Ethernet29/3 29 50000 +Ethernet116 161,162 Ethernet30/1 30 50000 +Ethernet118 163,164 Ethernet30/3 30 50000 +Ethernet120 181,182 Ethernet31/1 31 50000 +Ethernet122 183,184 Ethernet31/3 31 50000 +Ethernet124 185,186 Ethernet32/1 32 50000 +Ethernet126 187,188 Ethernet32/3 32 50000 +Ethernet128 69,70 Ethernet33/1 33 50000 +Ethernet130 71,72 Ethernet33/3 33 50000 +Ethernet132 73,74 Ethernet34/1 34 50000 +Ethernet134 75,76 Ethernet34/3 34 50000 +Ethernet136 93,94 Ethernet35/1 35 50000 +Ethernet138 95,96 Ethernet35/3 35 50000 +Ethernet140 81,82 Ethernet36/1 36 50000 +Ethernet142 83,84 Ethernet36/3 36 50000 +Ethernet144 101,102 Ethernet37/1 37 50000 +Ethernet146 103,104 Ethernet37/3 37 50000 +Ethernet148 105,106 Ethernet38/1 38 50000 +Ethernet150 107,108 Ethernet38/3 38 50000 +Ethernet152 9,10 Ethernet39/1 39 50000 +Ethernet154 11,12 Ethernet39/3 39 50000 +Ethernet156 1,2 Ethernet40/1 40 50000 +Ethernet158 3,4 Ethernet40/3 40 50000 +Ethernet160 17,18 Ethernet41/1 41 50000 +Ethernet162 19,20 Ethernet41/3 41 50000 +Ethernet164 29,30 Ethernet42/1 42 50000 +Ethernet166 31,32 Ethernet42/3 42 50000 +Ethernet168 41,42 Ethernet43/1 43 50000 +Ethernet170 43,44 Ethernet43/3 43 50000 +Ethernet172 33,34 Ethernet44/1 44 50000 +Ethernet174 35,36 Ethernet44/3 44 50000 +Ethernet176 49,50,51,52 Ethernet45/1 45 100000 +Ethernet180 61,62,63,64 Ethernet46/1 46 100000 +Ethernet184 125,126,127,128 Ethernet47/1 47 100000 +Ethernet188 113,114,115,116 Ethernet48/1 48 100000 +Ethernet192 129,130,131,132 Ethernet49/1 49 100000 +Ethernet196 137,138,139,140 Ethernet50/1 50 100000 +Ethernet200 201,202,203,204 Ethernet51/1 51 100000 +Ethernet204 193,194,195,196 Ethernet52/1 52 100000 +Ethernet208 209,210 Ethernet53/1 53 50000 +Ethernet210 211,212 Ethernet53/3 53 50000 +Ethernet212 221,222 Ethernet54/1 54 50000 +Ethernet214 223,224 Ethernet54/3 54 50000 +Ethernet216 233,234 Ethernet55/1 55 50000 +Ethernet218 235,236 Ethernet55/3 55 50000 +Ethernet220 225,226 Ethernet56/1 56 50000 +Ethernet222 227,228 Ethernet56/3 56 50000 +Ethernet224 241,242 Ethernet57/1 57 50000 +Ethernet226 243,244 Ethernet57/3 57 50000 +Ethernet228 253,254 Ethernet58/1 58 50000 +Ethernet230 255,256 Ethernet58/3 58 50000 +Ethernet232 157,158 Ethernet59/1 59 50000 +Ethernet234 159,160 Ethernet59/3 59 50000 +Ethernet236 145,146 Ethernet60/1 60 50000 +Ethernet238 147,148 Ethernet60/3 60 50000 +Ethernet240 165,166 Ethernet61/1 61 50000 +Ethernet242 167,168 Ethernet61/3 61 50000 +Ethernet244 169,170 Ethernet62/1 62 50000 +Ethernet246 171,172 Ethernet62/3 62 50000 +Ethernet248 189,190 Ethernet63/1 63 50000 +Ethernet250 191,192 Ethernet63/3 63 50000 +Ethernet252 177,178 Ethernet64/1 64 50000 +Ethernet254 179,180 Ethernet64/3 64 50000 +Ethernet256 257 Ethernet65 65 10000 +Ethernet260 259 Ethernet66 66 10000 diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D96C16/qos.json.j2 b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D96C16/qos.json.j2 new file mode 100644 index 000000000000..3e1d8df928c9 --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D96C16/qos.json.j2 @@ -0,0 +1,21 @@ +{%- macro generate_wred_profiles() %} + "WRED_PROFILE": { + "AZURE_LOSSLESS" : { + "wred_green_enable" : "true", + "wred_yellow_enable" : "true", + "wred_red_enable" : "true", + "ecn" : "ecn_all", + "green_max_threshold" : "10000000", + "green_min_threshold" : "2000000", + "yellow_max_threshold" : "2097152", + "yellow_min_threshold" : "1048576", + "red_max_threshold" : "2097152", + "red_min_threshold" : "1048576", + "green_drop_probability" : "5", + "yellow_drop_probability": "5", + "red_drop_probability" : "5" + } + }, +{%- endmacro %} + +{%- include 'qos_config.j2' %} diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D96C16/sai.profile b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D96C16/sai.profile new file mode 100644 index 000000000000..5163d6140f0e --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D96C16/sai.profile @@ -0,0 +1,2 @@ +SAI_INIT_CONFIG_FILE=/etc/sai.d/config.bcm +SAI_NUM_ECMP_MEMBERS=64 diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-Q64/BALANCED b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-Q64/BALANCED new file mode 120000 index 000000000000..a270c70ffc36 --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-Q64/BALANCED @@ -0,0 +1 @@ +../../../common/profiles/th2/7260/BALANCED \ No newline at end of file diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-Q64/RDMA-CENTRIC b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-Q64/RDMA-CENTRIC new file mode 120000 index 000000000000..8d1ec6d277a8 --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-Q64/RDMA-CENTRIC @@ -0,0 +1 @@ +../../../common/profiles/th2/7260/RDMA-CENTRIC \ No newline at end of file diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-Q64/TCP-CENTRIC b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-Q64/TCP-CENTRIC new file mode 120000 index 000000000000..7ee783aac6a4 --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-Q64/TCP-CENTRIC @@ -0,0 +1 @@ +../../../common/profiles/th2/7260/TCP-CENTRIC \ No newline at end of file diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-Q64/buffer_ports_t0.j2 b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-Q64/buffer_ports_t0.j2 new file mode 100644 index 000000000000..2d56c4b38f9e --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-Q64/buffer_ports_t0.j2 @@ -0,0 +1,6 @@ +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {%- for port_idx in range(0,64) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{%- endif %} + {%- endfor %} +{%- endmacro %} diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-Q64/buffer_ports_t1.j2 b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-Q64/buffer_ports_t1.j2 new file mode 100644 index 000000000000..2d56c4b38f9e --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-Q64/buffer_ports_t1.j2 @@ -0,0 +1,6 @@ +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {%- for port_idx in range(0,64) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{%- endif %} + {%- endfor %} +{%- endmacro %} diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-Q64/buffers.json.j2 b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-Q64/buffers.json.j2 index e6e9e844469b..b67cf577ab75 100644 --- a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-Q64/buffers.json.j2 +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-Q64/buffers.json.j2 @@ -1,3 +1,3 @@ -{%- set default_topo = 't0' %} +{%- set default_topo = 't1' %} {%- include 'buffers_config.j2' %} diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-Q64/buffers_defaults_t0.j2 b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-Q64/buffers_defaults_t0.j2 deleted file mode 100644 index 3442612f70b2..000000000000 --- a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-Q64/buffers_defaults_t0.j2 +++ /dev/null @@ -1,46 +0,0 @@ -{%- set default_cable = '5m' %} - -{%- macro generate_port_lists(PORT_ALL) %} - {# Generate list of ports #} - {%- for port_idx in range(0,64) %} - {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{%- endif %} - {%- endfor %} -{%- endmacro %} - -{%- macro generate_buffer_pool_and_profiles() %} - "BUFFER_POOL": { - "ingress_lossless_pool": { - "size": "33329088", - "type": "ingress", - "mode": "dynamic", - "xoff": "7827456" - }, - "egress_lossy_pool": { - "size": "26663272", - "type": "egress", - "mode": "dynamic" - }, - "egress_lossless_pool": { - "size": "42349632", - "type": "egress", - "mode": "static" - } - }, - "BUFFER_PROFILE": { - "ingress_lossy_profile": { - "pool":"[BUFFER_POOL|ingress_lossless_pool]", - "size":"0", - "static_th":"44302336" - }, - "egress_lossless_profile": { - "pool":"[BUFFER_POOL|egress_lossless_pool]", - "size":"0", - "static_th":"42349632" - }, - "egress_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"1664", - "dynamic_th":"-1" - } - }, -{%- endmacro %} diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-Q64/buffers_defaults_t0.j2 b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-Q64/buffers_defaults_t0.j2 new file mode 120000 index 000000000000..9524e6a476ac --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-Q64/buffers_defaults_t0.j2 @@ -0,0 +1 @@ +BALANCED/buffers_defaults_t0.j2 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-Q64/buffers_defaults_t1.j2 b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-Q64/buffers_defaults_t1.j2 new file mode 120000 index 000000000000..c25cc95d6d57 --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-Q64/buffers_defaults_t1.j2 @@ -0,0 +1 @@ +BALANCED/buffers_defaults_t1.j2 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-Q64/buffers_extra_queues.j2 b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-Q64/buffers_extra_queues.j2 new file mode 120000 index 000000000000..92b7e9ffbee5 --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-Q64/buffers_extra_queues.j2 @@ -0,0 +1 @@ +../Arista-7260CX3-C64/buffers_extra_queues.j2 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-Q64/buffers_pool_sizes_t0.j2 b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-Q64/buffers_pool_sizes_t0.j2 new file mode 120000 index 000000000000..72e16a608268 --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-Q64/buffers_pool_sizes_t0.j2 @@ -0,0 +1 @@ +../Arista-7260CX3-C64/buffers_pool_sizes_t0.j2 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-Q64/buffers_pool_sizes_t1.j2 b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-Q64/buffers_pool_sizes_t1.j2 new file mode 120000 index 000000000000..138e7f373e74 --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-Q64/buffers_pool_sizes_t1.j2 @@ -0,0 +1 @@ +../Arista-7260CX3-C64/buffers_pool_sizes_t1.j2 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-Q64/config.bcm.j2 b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-Q64/config.bcm.j2 new file mode 100644 index 000000000000..09cc7988b56d --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-Q64/config.bcm.j2 @@ -0,0 +1,1044 @@ +{# Construct config.bcm to include additional soc properties per specific device metadata requirement #} +{%- set mmu_sock = 'mmu_init_config="MSFT-TH2-Tier1"' -%} +{%- set IPinIP_sock = '' -%} +{%- set map_prio = '' -%} +{%- if DEVICE_METADATA is defined and DEVICE_METADATA['localhost'] is defined -%} +{%- if DEVICE_METADATA['localhost']['type'] is defined -%} +{%- set switch_role = DEVICE_METADATA['localhost']['type'] -%} +{%- if 'torrouter' in switch_role.lower() or 'torswitch' in switch_role.lower() %} +{%- set mmu_sock = 'mmu_init_config="MSFT-TH2-Tier0"' -%} +{%- endif %} +{%- endif %} +{%- if DEVICE_METADATA['localhost']['subtype'] is defined -%} +{%- set switch_subtype = DEVICE_METADATA['localhost']['subtype'] -%} +{%- if 'dualtor' in switch_subtype.lower() %} +{%- set IPinIP_sock = 'sai_tunnel_support=1 + sai_tunnel_underlay_route_mode=1 + host_as_route_disable=1 + l3_ecmp_levels=2' -%} +{%- set map_prio = 'sai_remap_prio_on_tnl_egress=1' -%} +{%- endif %} +{%- endif %} +{%- endif %} +{# The following is the common soc properties that used to be named "th2-a7260cx3-64-64x40G.config.bcm" #} +l3_alpm_hit_skip=1 +sai_adjust_acl_drop_in_rx_drop=1 +{{ map_prio }} +PHY_AN_ALLOW_PLL_CHANGE=1 +arl_clean_timeout_usec=15000000 +asf_mem_profile=2 +bcm_num_cos=10 +bcm_stat_flags=1 +bcm_stat_jumbo=9236 +cdma_timeout_usec=15000000 +core_clock_frequency=1700 +dma_desc_timeout_usec=15000000 +dpp_clock_ratio=2:3 +higig2_hdr_mode=1 +ipv6_lpm_128b_enable=1 +l3_alpm_enable=2 +lpm_scaling_enable=0 +l2xmsg_mode=1 +max_vp_lags=0 +mem_scan_enable=1 +miim_intr_enable=0 +module_64ports=1 +os=unix +oversubscribe_mode=1 +pbmp_xport_xe=0x40003ffff0000ffffc0003fffe0001fffe +phy_an_allow_pll_change_hg=0 +phy_an_c73_100=1 +phy_an_c73_102=1 +phy_an_c73_103=1 +phy_an_c73_104=1 +phy_an_c73_105=1 +phy_an_c73_106=1 +phy_an_c73_107=1 +phy_an_c73_108=1 +phy_an_c73_109=1 +phy_an_c73_10=1 +phy_an_c73_110=1 +phy_an_c73_111=1 +phy_an_c73_112=1 +phy_an_c73_113=1 +phy_an_c73_114=1 +phy_an_c73_115=1 +phy_an_c73_116=1 +phy_an_c73_117=1 +phy_an_c73_11=1 +phy_an_c73_12=1 +phy_an_c73_13=1 +phy_an_c73_14=1 +phy_an_c73_15=1 +phy_an_c73_16=1 +phy_an_c73_1=1 +phy_an_c73_2=1 +phy_an_c73_34=1 +phy_an_c73_35=1 +phy_an_c73_36=1 +phy_an_c73_37=1 +phy_an_c73_38=1 +phy_an_c73_39=1 +phy_an_c73_3=1 +phy_an_c73_40=1 +phy_an_c73_41=1 +phy_an_c73_42=1 +phy_an_c73_43=1 +phy_an_c73_44=1 +phy_an_c73_45=1 +phy_an_c73_46=1 +phy_an_c73_47=1 +phy_an_c73_48=1 +phy_an_c73_49=1 +phy_an_c73_4=1 +phy_an_c73_5=1 +phy_an_c73_66=1 +phy_an_c73_68=1 +phy_an_c73_69=1 +phy_an_c73_6=1 +phy_an_c73_70=1 +phy_an_c73_71=1 +phy_an_c73_72=1 +phy_an_c73_73=1 +phy_an_c73_74=1 +phy_an_c73_75=1 +phy_an_c73_76=1 +phy_an_c73_77=1 +phy_an_c73_78=1 +phy_an_c73_79=1 +phy_an_c73_7=1 +phy_an_c73_80=1 +phy_an_c73_81=1 +phy_an_c73_82=1 +phy_an_c73_83=1 +phy_an_c73_8=1 +phy_an_c73_9=1 +phy_chain_rx_lane_map_physical{1.0}=0x3210 +phy_chain_rx_lane_map_physical{101.0}=0x0123 +phy_chain_rx_lane_map_physical{105.0}=0x0123 +phy_chain_rx_lane_map_physical{109.0}=0x0123 +phy_chain_rx_lane_map_physical{113.0}=0x2301 +phy_chain_rx_lane_map_physical{117.0}=0x3210 +phy_chain_rx_lane_map_physical{121.0}=0x3210 +phy_chain_rx_lane_map_physical{125.0}=0x1203 +phy_chain_rx_lane_map_physical{129.0}=0x3210 +phy_chain_rx_lane_map_physical{13.0}=0x0321 +phy_chain_rx_lane_map_physical{133.0}=0x1032 +phy_chain_rx_lane_map_physical{137.0}=0x3210 +phy_chain_rx_lane_map_physical{141.0}=0x0123 +phy_chain_rx_lane_map_physical{145.0}=0x3210 +phy_chain_rx_lane_map_physical{149.0}=0x2310 +phy_chain_rx_lane_map_physical{153.0}=0x0132 +phy_chain_rx_lane_map_physical{157.0}=0x1302 +phy_chain_rx_lane_map_physical{161.0}=0x3021 +phy_chain_rx_lane_map_physical{165.0}=0x2031 +phy_chain_rx_lane_map_physical{169.0}=0x2031 +phy_chain_rx_lane_map_physical{17.0}=0x3210 +phy_chain_rx_lane_map_physical{173.0}=0x1302 +phy_chain_rx_lane_map_physical{177.0}=0x2031 +phy_chain_rx_lane_map_physical{181.0}=0x0213 +phy_chain_rx_lane_map_physical{185.0}=0x0213 +phy_chain_rx_lane_map_physical{189.0}=0x1302 +phy_chain_rx_lane_map_physical{193.0}=0x3120 +phy_chain_rx_lane_map_physical{197.0}=0x0231 +phy_chain_rx_lane_map_physical{201.0}=0x2031 +phy_chain_rx_lane_map_physical{205.0}=0x0213 +phy_chain_rx_lane_map_physical{209.0}=0x2013 +phy_chain_rx_lane_map_physical{21.0}=0x3021 +phy_chain_rx_lane_map_physical{213.0}=0x3021 +phy_chain_rx_lane_map_physical{217.0}=0x0231 +phy_chain_rx_lane_map_physical{221.0}=0x2031 +phy_chain_rx_lane_map_physical{225.0}=0x1203 +phy_chain_rx_lane_map_physical{229.0}=0x1230 +phy_chain_rx_lane_map_physical{233.0}=0x3021 +phy_chain_rx_lane_map_physical{237.0}=0x1032 +phy_chain_rx_lane_map_physical{241.0}=0x2301 +phy_chain_rx_lane_map_physical{245.0}=0x0321 +phy_chain_rx_lane_map_physical{249.0}=0x2301 +phy_chain_rx_lane_map_physical{25.0}=0x2301 +phy_chain_rx_lane_map_physical{253.0}=0x2301 +phy_chain_rx_lane_map_physical{257.0}=0x3210 +phy_chain_rx_lane_map_physical{29.0}=0x3021 +phy_chain_rx_lane_map_physical{33.0}=0x1302 +phy_chain_rx_lane_map_physical{37.0}=0x2031 +phy_chain_rx_lane_map_physical{41.0}=0x3021 +phy_chain_rx_lane_map_physical{45.0}=0x1023 +phy_chain_rx_lane_map_physical{49.0}=0x0213 +phy_chain_rx_lane_map_physical{5.0}=0x3201 +phy_chain_rx_lane_map_physical{53.0}=0x3201 +phy_chain_rx_lane_map_physical{57.0}=0x2013 +phy_chain_rx_lane_map_physical{61.0}=0x0213 +phy_chain_rx_lane_map_physical{65.0}=0x1203 +phy_chain_rx_lane_map_physical{69.0}=0x0213 +phy_chain_rx_lane_map_physical{73.0}=0x0213 +phy_chain_rx_lane_map_physical{77.0}=0x3120 +phy_chain_rx_lane_map_physical{81.0}=0x0213 +phy_chain_rx_lane_map_physical{85.0}=0x2031 +phy_chain_rx_lane_map_physical{89.0}=0x2031 +phy_chain_rx_lane_map_physical{9.0}=0x0321 +phy_chain_rx_lane_map_physical{93.0}=0x3120 +phy_chain_rx_lane_map_physical{97.0}=0x1203 +phy_chain_rx_polarity_flip_physical{1.0}=0x1 +phy_chain_rx_polarity_flip_physical{10.0}=0x0 +phy_chain_rx_polarity_flip_physical{100.0}=0x1 +phy_chain_rx_polarity_flip_physical{101.0}=0x1 +phy_chain_rx_polarity_flip_physical{102.0}=0x0 +phy_chain_rx_polarity_flip_physical{103.0}=0x1 +phy_chain_rx_polarity_flip_physical{104.0}=0x0 +phy_chain_rx_polarity_flip_physical{105.0}=0x1 +phy_chain_rx_polarity_flip_physical{106.0}=0x0 +phy_chain_rx_polarity_flip_physical{107.0}=0x1 +phy_chain_rx_polarity_flip_physical{108.0}=0x0 +phy_chain_rx_polarity_flip_physical{109.0}=0x0 +phy_chain_rx_polarity_flip_physical{11.0}=0x1 +phy_chain_rx_polarity_flip_physical{110.0}=0x1 +phy_chain_rx_polarity_flip_physical{111.0}=0x0 +phy_chain_rx_polarity_flip_physical{112.0}=0x1 +phy_chain_rx_polarity_flip_physical{113.0}=0x1 +phy_chain_rx_polarity_flip_physical{114.0}=0x0 +phy_chain_rx_polarity_flip_physical{115.0}=0x1 +phy_chain_rx_polarity_flip_physical{116.0}=0x0 +phy_chain_rx_polarity_flip_physical{117.0}=0x0 +phy_chain_rx_polarity_flip_physical{118.0}=0x0 +phy_chain_rx_polarity_flip_physical{119.0}=0x1 +phy_chain_rx_polarity_flip_physical{12.0}=0x1 +phy_chain_rx_polarity_flip_physical{120.0}=0x0 +phy_chain_rx_polarity_flip_physical{121.0}=0x1 +phy_chain_rx_polarity_flip_physical{122.0}=0x0 +phy_chain_rx_polarity_flip_physical{123.0}=0x1 +phy_chain_rx_polarity_flip_physical{124.0}=0x0 +phy_chain_rx_polarity_flip_physical{125.0}=0x0 +phy_chain_rx_polarity_flip_physical{126.0}=0x1 +phy_chain_rx_polarity_flip_physical{127.0}=0x1 +phy_chain_rx_polarity_flip_physical{128.0}=0x1 +phy_chain_rx_polarity_flip_physical{129.0}=0x0 +phy_chain_rx_polarity_flip_physical{13.0}=0x1 +phy_chain_rx_polarity_flip_physical{130.0}=0x1 +phy_chain_rx_polarity_flip_physical{131.0}=0x1 +phy_chain_rx_polarity_flip_physical{132.0}=0x0 +phy_chain_rx_polarity_flip_physical{133.0}=0x1 +phy_chain_rx_polarity_flip_physical{134.0}=0x1 +phy_chain_rx_polarity_flip_physical{135.0}=0x1 +phy_chain_rx_polarity_flip_physical{136.0}=0x0 +phy_chain_rx_polarity_flip_physical{137.0}=0x0 +phy_chain_rx_polarity_flip_physical{138.0}=0x0 +phy_chain_rx_polarity_flip_physical{139.0}=0x1 +phy_chain_rx_polarity_flip_physical{14.0}=0x0 +phy_chain_rx_polarity_flip_physical{140.0}=0x0 +phy_chain_rx_polarity_flip_physical{141.0}=0x1 +phy_chain_rx_polarity_flip_physical{142.0}=0x0 +phy_chain_rx_polarity_flip_physical{143.0}=0x1 +phy_chain_rx_polarity_flip_physical{144.0}=0x0 +phy_chain_rx_polarity_flip_physical{145.0}=0x1 +phy_chain_rx_polarity_flip_physical{146.0}=0x0 +phy_chain_rx_polarity_flip_physical{147.0}=0x1 +phy_chain_rx_polarity_flip_physical{148.0}=0x0 +phy_chain_rx_polarity_flip_physical{149.0}=0x0 +phy_chain_rx_polarity_flip_physical{15.0}=0x1 +phy_chain_rx_polarity_flip_physical{150.0}=0x1 +phy_chain_rx_polarity_flip_physical{151.0}=0x1 +phy_chain_rx_polarity_flip_physical{152.0}=0x0 +phy_chain_rx_polarity_flip_physical{153.0}=0x0 +phy_chain_rx_polarity_flip_physical{154.0}=0x1 +phy_chain_rx_polarity_flip_physical{155.0}=0x1 +phy_chain_rx_polarity_flip_physical{156.0}=0x0 +phy_chain_rx_polarity_flip_physical{157.0}=0x0 +phy_chain_rx_polarity_flip_physical{158.0}=0x0 +phy_chain_rx_polarity_flip_physical{159.0}=0x1 +phy_chain_rx_polarity_flip_physical{16.0}=0x0 +phy_chain_rx_polarity_flip_physical{160.0}=0x0 +phy_chain_rx_polarity_flip_physical{161.0}=0x1 +phy_chain_rx_polarity_flip_physical{162.0}=0x1 +phy_chain_rx_polarity_flip_physical{163.0}=0x0 +phy_chain_rx_polarity_flip_physical{164.0}=0x1 +phy_chain_rx_polarity_flip_physical{165.0}=0x0 +phy_chain_rx_polarity_flip_physical{166.0}=0x0 +phy_chain_rx_polarity_flip_physical{167.0}=0x1 +phy_chain_rx_polarity_flip_physical{168.0}=0x1 +phy_chain_rx_polarity_flip_physical{169.0}=0x1 +phy_chain_rx_polarity_flip_physical{17.0}=0x1 +phy_chain_rx_polarity_flip_physical{170.0}=0x1 +phy_chain_rx_polarity_flip_physical{171.0}=0x0 +phy_chain_rx_polarity_flip_physical{172.0}=0x0 +phy_chain_rx_polarity_flip_physical{173.0}=0x0 +phy_chain_rx_polarity_flip_physical{174.0}=0x0 +phy_chain_rx_polarity_flip_physical{175.0}=0x1 +phy_chain_rx_polarity_flip_physical{176.0}=0x1 +phy_chain_rx_polarity_flip_physical{177.0}=0x1 +phy_chain_rx_polarity_flip_physical{178.0}=0x1 +phy_chain_rx_polarity_flip_physical{179.0}=0x0 +phy_chain_rx_polarity_flip_physical{18.0}=0x0 +phy_chain_rx_polarity_flip_physical{180.0}=0x0 +phy_chain_rx_polarity_flip_physical{181.0}=0x1 +phy_chain_rx_polarity_flip_physical{182.0}=0x1 +phy_chain_rx_polarity_flip_physical{183.0}=0x0 +phy_chain_rx_polarity_flip_physical{184.0}=0x0 +phy_chain_rx_polarity_flip_physical{185.0}=0x0 +phy_chain_rx_polarity_flip_physical{186.0}=0x0 +phy_chain_rx_polarity_flip_physical{187.0}=0x1 +phy_chain_rx_polarity_flip_physical{188.0}=0x1 +phy_chain_rx_polarity_flip_physical{189.0}=0x0 +phy_chain_rx_polarity_flip_physical{19.0}=0x1 +phy_chain_rx_polarity_flip_physical{190.0}=0x0 +phy_chain_rx_polarity_flip_physical{191.0}=0x1 +phy_chain_rx_polarity_flip_physical{192.0}=0x0 +phy_chain_rx_polarity_flip_physical{193.0}=0x0 +phy_chain_rx_polarity_flip_physical{194.0}=0x0 +phy_chain_rx_polarity_flip_physical{195.0}=0x1 +phy_chain_rx_polarity_flip_physical{196.0}=0x1 +phy_chain_rx_polarity_flip_physical{197.0}=0x1 +phy_chain_rx_polarity_flip_physical{198.0}=0x1 +phy_chain_rx_polarity_flip_physical{199.0}=0x0 +phy_chain_rx_polarity_flip_physical{2.0}=0x0 +phy_chain_rx_polarity_flip_physical{20.0}=0x0 +phy_chain_rx_polarity_flip_physical{200.0}=0x0 +phy_chain_rx_polarity_flip_physical{201.0}=0x0 +phy_chain_rx_polarity_flip_physical{202.0}=0x0 +phy_chain_rx_polarity_flip_physical{203.0}=0x1 +phy_chain_rx_polarity_flip_physical{204.0}=0x0 +phy_chain_rx_polarity_flip_physical{205.0}=0x1 +phy_chain_rx_polarity_flip_physical{206.0}=0x1 +phy_chain_rx_polarity_flip_physical{207.0}=0x0 +phy_chain_rx_polarity_flip_physical{208.0}=0x0 +phy_chain_rx_polarity_flip_physical{209.0}=0x1 +phy_chain_rx_polarity_flip_physical{21.0}=0x0 +phy_chain_rx_polarity_flip_physical{210.0}=0x1 +phy_chain_rx_polarity_flip_physical{211.0}=0x0 +phy_chain_rx_polarity_flip_physical{212.0}=0x0 +phy_chain_rx_polarity_flip_physical{213.0}=0x0 +phy_chain_rx_polarity_flip_physical{214.0}=0x0 +phy_chain_rx_polarity_flip_physical{215.0}=0x1 +phy_chain_rx_polarity_flip_physical{216.0}=0x0 +phy_chain_rx_polarity_flip_physical{217.0}=0x0 +phy_chain_rx_polarity_flip_physical{218.0}=0x0 +phy_chain_rx_polarity_flip_physical{219.0}=0x1 +phy_chain_rx_polarity_flip_physical{22.0}=0x0 +phy_chain_rx_polarity_flip_physical{220.0}=0x1 +phy_chain_rx_polarity_flip_physical{221.0}=0x0 +phy_chain_rx_polarity_flip_physical{222.0}=0x0 +phy_chain_rx_polarity_flip_physical{223.0}=0x1 +phy_chain_rx_polarity_flip_physical{224.0}=0x1 +phy_chain_rx_polarity_flip_physical{225.0}=0x1 +phy_chain_rx_polarity_flip_physical{226.0}=0x0 +phy_chain_rx_polarity_flip_physical{227.0}=0x0 +phy_chain_rx_polarity_flip_physical{228.0}=0x1 +phy_chain_rx_polarity_flip_physical{229.0}=0x0 +phy_chain_rx_polarity_flip_physical{23.0}=0x1 +phy_chain_rx_polarity_flip_physical{230.0}=0x0 +phy_chain_rx_polarity_flip_physical{231.0}=0x1 +phy_chain_rx_polarity_flip_physical{232.0}=0x1 +phy_chain_rx_polarity_flip_physical{233.0}=0x1 +phy_chain_rx_polarity_flip_physical{234.0}=0x0 +phy_chain_rx_polarity_flip_physical{235.0}=0x0 +phy_chain_rx_polarity_flip_physical{236.0}=0x0 +phy_chain_rx_polarity_flip_physical{237.0}=0x1 +phy_chain_rx_polarity_flip_physical{238.0}=0x0 +phy_chain_rx_polarity_flip_physical{239.0}=0x1 +phy_chain_rx_polarity_flip_physical{24.0}=0x0 +phy_chain_rx_polarity_flip_physical{240.0}=0x0 +phy_chain_rx_polarity_flip_physical{241.0}=0x1 +phy_chain_rx_polarity_flip_physical{242.0}=0x0 +phy_chain_rx_polarity_flip_physical{243.0}=0x1 +phy_chain_rx_polarity_flip_physical{244.0}=0x0 +phy_chain_rx_polarity_flip_physical{245.0}=0x1 +phy_chain_rx_polarity_flip_physical{246.0}=0x1 +phy_chain_rx_polarity_flip_physical{247.0}=0x1 +phy_chain_rx_polarity_flip_physical{248.0}=0x0 +phy_chain_rx_polarity_flip_physical{249.0}=0x0 +phy_chain_rx_polarity_flip_physical{25.0}=0x1 +phy_chain_rx_polarity_flip_physical{250.0}=0x1 +phy_chain_rx_polarity_flip_physical{251.0}=0x0 +phy_chain_rx_polarity_flip_physical{252.0}=0x1 +phy_chain_rx_polarity_flip_physical{253.0}=0x1 +phy_chain_rx_polarity_flip_physical{254.0}=0x0 +phy_chain_rx_polarity_flip_physical{255.0}=0x1 +phy_chain_rx_polarity_flip_physical{256.0}=0x0 +phy_chain_rx_polarity_flip_physical{257.0}=0x0 +phy_chain_rx_polarity_flip_physical{259.0}=0x0 +phy_chain_rx_polarity_flip_physical{26.0}=0x0 +phy_chain_rx_polarity_flip_physical{27.0}=0x1 +phy_chain_rx_polarity_flip_physical{28.0}=0x0 +phy_chain_rx_polarity_flip_physical{29.0}=0x0 +phy_chain_rx_polarity_flip_physical{3.0}=0x1 +phy_chain_rx_polarity_flip_physical{30.0}=0x0 +phy_chain_rx_polarity_flip_physical{31.0}=0x0 +phy_chain_rx_polarity_flip_physical{32.0}=0x1 +phy_chain_rx_polarity_flip_physical{33.0}=0x0 +phy_chain_rx_polarity_flip_physical{34.0}=0x0 +phy_chain_rx_polarity_flip_physical{35.0}=0x1 +phy_chain_rx_polarity_flip_physical{36.0}=0x1 +phy_chain_rx_polarity_flip_physical{37.0}=0x1 +phy_chain_rx_polarity_flip_physical{38.0}=0x1 +phy_chain_rx_polarity_flip_physical{39.0}=0x0 +phy_chain_rx_polarity_flip_physical{4.0}=0x0 +phy_chain_rx_polarity_flip_physical{40.0}=0x0 +phy_chain_rx_polarity_flip_physical{41.0}=0x0 +phy_chain_rx_polarity_flip_physical{42.0}=0x1 +phy_chain_rx_polarity_flip_physical{43.0}=0x1 +phy_chain_rx_polarity_flip_physical{44.0}=0x1 +phy_chain_rx_polarity_flip_physical{45.0}=0x1 +phy_chain_rx_polarity_flip_physical{46.0}=0x0 +phy_chain_rx_polarity_flip_physical{47.0}=0x0 +phy_chain_rx_polarity_flip_physical{48.0}=0x1 +phy_chain_rx_polarity_flip_physical{49.0}=0x1 +phy_chain_rx_polarity_flip_physical{5.0}=0x1 +phy_chain_rx_polarity_flip_physical{50.0}=0x1 +phy_chain_rx_polarity_flip_physical{51.0}=0x0 +phy_chain_rx_polarity_flip_physical{52.0}=0x0 +phy_chain_rx_polarity_flip_physical{53.0}=0x0 +phy_chain_rx_polarity_flip_physical{54.0}=0x0 +phy_chain_rx_polarity_flip_physical{55.0}=0x1 +phy_chain_rx_polarity_flip_physical{56.0}=0x0 +phy_chain_rx_polarity_flip_physical{57.0}=0x0 +phy_chain_rx_polarity_flip_physical{58.0}=0x0 +phy_chain_rx_polarity_flip_physical{59.0}=0x1 +phy_chain_rx_polarity_flip_physical{6.0}=0x0 +phy_chain_rx_polarity_flip_physical{60.0}=0x1 +phy_chain_rx_polarity_flip_physical{61.0}=0x0 +phy_chain_rx_polarity_flip_physical{62.0}=0x0 +phy_chain_rx_polarity_flip_physical{63.0}=0x1 +phy_chain_rx_polarity_flip_physical{64.0}=0x1 +phy_chain_rx_polarity_flip_physical{65.0}=0x1 +phy_chain_rx_polarity_flip_physical{66.0}=0x1 +phy_chain_rx_polarity_flip_physical{67.0}=0x0 +phy_chain_rx_polarity_flip_physical{68.0}=0x1 +phy_chain_rx_polarity_flip_physical{69.0}=0x0 +phy_chain_rx_polarity_flip_physical{7.0}=0x0 +phy_chain_rx_polarity_flip_physical{70.0}=0x0 +phy_chain_rx_polarity_flip_physical{71.0}=0x1 +phy_chain_rx_polarity_flip_physical{72.0}=0x1 +phy_chain_rx_polarity_flip_physical{73.0}=0x1 +phy_chain_rx_polarity_flip_physical{74.0}=0x1 +phy_chain_rx_polarity_flip_physical{75.0}=0x0 +phy_chain_rx_polarity_flip_physical{76.0}=0x0 +phy_chain_rx_polarity_flip_physical{77.0}=0x0 +phy_chain_rx_polarity_flip_physical{78.0}=0x0 +phy_chain_rx_polarity_flip_physical{79.0}=0x1 +phy_chain_rx_polarity_flip_physical{8.0}=0x1 +phy_chain_rx_polarity_flip_physical{80.0}=0x1 +phy_chain_rx_polarity_flip_physical{81.0}=0x1 +phy_chain_rx_polarity_flip_physical{82.0}=0x1 +phy_chain_rx_polarity_flip_physical{83.0}=0x0 +phy_chain_rx_polarity_flip_physical{84.0}=0x0 +phy_chain_rx_polarity_flip_physical{85.0}=0x1 +phy_chain_rx_polarity_flip_physical{86.0}=0x1 +phy_chain_rx_polarity_flip_physical{87.0}=0x0 +phy_chain_rx_polarity_flip_physical{88.0}=0x0 +phy_chain_rx_polarity_flip_physical{89.0}=0x0 +phy_chain_rx_polarity_flip_physical{9.0}=0x1 +phy_chain_rx_polarity_flip_physical{90.0}=0x0 +phy_chain_rx_polarity_flip_physical{91.0}=0x1 +phy_chain_rx_polarity_flip_physical{92.0}=0x1 +phy_chain_rx_polarity_flip_physical{93.0}=0x0 +phy_chain_rx_polarity_flip_physical{94.0}=0x0 +phy_chain_rx_polarity_flip_physical{95.0}=0x1 +phy_chain_rx_polarity_flip_physical{96.0}=0x0 +phy_chain_rx_polarity_flip_physical{97.0}=0x1 +phy_chain_rx_polarity_flip_physical{98.0}=0x1 +phy_chain_rx_polarity_flip_physical{99.0}=0x0 +phy_chain_tx_lane_map_physical{1.0}=0x2031 +phy_chain_tx_lane_map_physical{101.0}=0x1023 +phy_chain_tx_lane_map_physical{105.0}=0x1302 +phy_chain_tx_lane_map_physical{109.0}=0x0321 +phy_chain_tx_lane_map_physical{113.0}=0x2301 +phy_chain_tx_lane_map_physical{117.0}=0x3120 +phy_chain_tx_lane_map_physical{121.0}=0x3102 +phy_chain_tx_lane_map_physical{125.0}=0x3210 +phy_chain_tx_lane_map_physical{129.0}=0x1023 +phy_chain_tx_lane_map_physical{13.0}=0x3021 +phy_chain_tx_lane_map_physical{133.0}=0x3210 +phy_chain_tx_lane_map_physical{137.0}=0x2031 +phy_chain_tx_lane_map_physical{141.0}=0x1302 +phy_chain_tx_lane_map_physical{145.0}=0x3210 +phy_chain_tx_lane_map_physical{149.0}=0x0213 +phy_chain_tx_lane_map_physical{153.0}=0x3210 +phy_chain_tx_lane_map_physical{157.0}=0x1320 +phy_chain_tx_lane_map_physical{161.0}=0x3210 +phy_chain_tx_lane_map_physical{165.0}=0x0231 +phy_chain_tx_lane_map_physical{169.0}=0x3120 +phy_chain_tx_lane_map_physical{17.0}=0x1032 +phy_chain_tx_lane_map_physical{173.0}=0x0312 +phy_chain_tx_lane_map_physical{177.0}=0x0231 +phy_chain_tx_lane_map_physical{181.0}=0x3210 +phy_chain_tx_lane_map_physical{185.0}=0x3210 +phy_chain_tx_lane_map_physical{189.0}=0x1320 +phy_chain_tx_lane_map_physical{193.0}=0x0321 +phy_chain_tx_lane_map_physical{197.0}=0x3120 +phy_chain_tx_lane_map_physical{201.0}=0x3120 +phy_chain_tx_lane_map_physical{205.0}=0x0123 +phy_chain_tx_lane_map_physical{209.0}=0x3120 +phy_chain_tx_lane_map_physical{21.0}=0x0213 +phy_chain_tx_lane_map_physical{213.0}=0x3021 +phy_chain_tx_lane_map_physical{217.0}=0x0312 +phy_chain_tx_lane_map_physical{221.0}=0x2301 +phy_chain_tx_lane_map_physical{225.0}=0x0123 +phy_chain_tx_lane_map_physical{229.0}=0x2031 +phy_chain_tx_lane_map_physical{233.0}=0x0231 +phy_chain_tx_lane_map_physical{237.0}=0x0213 +phy_chain_tx_lane_map_physical{241.0}=0x1320 +phy_chain_tx_lane_map_physical{245.0}=0x2031 +phy_chain_tx_lane_map_physical{249.0}=0x3120 +phy_chain_tx_lane_map_physical{25.0}=0x0231 +phy_chain_tx_lane_map_physical{253.0}=0x0321 +phy_chain_tx_lane_map_physical{257.0}=0x3210 +phy_chain_tx_lane_map_physical{29.0}=0x1230 +phy_chain_tx_lane_map_physical{33.0}=0x1032 +phy_chain_tx_lane_map_physical{37.0}=0x0123 +phy_chain_tx_lane_map_physical{41.0}=0x0213 +phy_chain_tx_lane_map_physical{45.0}=0x0132 +phy_chain_tx_lane_map_physical{49.0}=0x2031 +phy_chain_tx_lane_map_physical{5.0}=0x2301 +phy_chain_tx_lane_map_physical{53.0}=0x2301 +phy_chain_tx_lane_map_physical{57.0}=0x2031 +phy_chain_tx_lane_map_physical{61.0}=0x2031 +phy_chain_tx_lane_map_physical{65.0}=0x1230 +phy_chain_tx_lane_map_physical{69.0}=0x2013 +phy_chain_tx_lane_map_physical{73.0}=0x0213 +phy_chain_tx_lane_map_physical{77.0}=0x2310 +phy_chain_tx_lane_map_physical{81.0}=0x0321 +phy_chain_tx_lane_map_physical{85.0}=0x2013 +phy_chain_tx_lane_map_physical{89.0}=0x0213 +phy_chain_tx_lane_map_physical{9.0}=0x3012 +phy_chain_tx_lane_map_physical{93.0}=0x3102 +phy_chain_tx_lane_map_physical{97.0}=0x3210 +phy_chain_tx_polarity_flip_physical{1.0}=0x0 +phy_chain_tx_polarity_flip_physical{10.0}=0x1 +phy_chain_tx_polarity_flip_physical{100.0}=0x0 +phy_chain_tx_polarity_flip_physical{101.0}=0x0 +phy_chain_tx_polarity_flip_physical{102.0}=0x1 +phy_chain_tx_polarity_flip_physical{103.0}=0x0 +phy_chain_tx_polarity_flip_physical{104.0}=0x0 +phy_chain_tx_polarity_flip_physical{105.0}=0x0 +phy_chain_tx_polarity_flip_physical{106.0}=0x1 +phy_chain_tx_polarity_flip_physical{107.0}=0x1 +phy_chain_tx_polarity_flip_physical{108.0}=0x1 +phy_chain_tx_polarity_flip_physical{109.0}=0x0 +phy_chain_tx_polarity_flip_physical{11.0}=0x1 +phy_chain_tx_polarity_flip_physical{110.0}=0x0 +phy_chain_tx_polarity_flip_physical{111.0}=0x0 +phy_chain_tx_polarity_flip_physical{112.0}=0x1 +phy_chain_tx_polarity_flip_physical{113.0}=0x1 +phy_chain_tx_polarity_flip_physical{114.0}=0x1 +phy_chain_tx_polarity_flip_physical{115.0}=0x1 +phy_chain_tx_polarity_flip_physical{116.0}=0x0 +phy_chain_tx_polarity_flip_physical{117.0}=0x1 +phy_chain_tx_polarity_flip_physical{118.0}=0x0 +phy_chain_tx_polarity_flip_physical{119.0}=0x0 +phy_chain_tx_polarity_flip_physical{12.0}=0x0 +phy_chain_tx_polarity_flip_physical{120.0}=0x0 +phy_chain_tx_polarity_flip_physical{121.0}=0x0 +phy_chain_tx_polarity_flip_physical{122.0}=0x0 +phy_chain_tx_polarity_flip_physical{123.0}=0x0 +phy_chain_tx_polarity_flip_physical{124.0}=0x1 +phy_chain_tx_polarity_flip_physical{125.0}=0x0 +phy_chain_tx_polarity_flip_physical{126.0}=0x1 +phy_chain_tx_polarity_flip_physical{127.0}=0x1 +phy_chain_tx_polarity_flip_physical{128.0}=0x1 +phy_chain_tx_polarity_flip_physical{129.0}=0x1 +phy_chain_tx_polarity_flip_physical{13.0}=0x0 +phy_chain_tx_polarity_flip_physical{130.0}=0x0 +phy_chain_tx_polarity_flip_physical{131.0}=0x1 +phy_chain_tx_polarity_flip_physical{132.0}=0x0 +phy_chain_tx_polarity_flip_physical{133.0}=0x1 +phy_chain_tx_polarity_flip_physical{134.0}=0x1 +phy_chain_tx_polarity_flip_physical{135.0}=0x1 +phy_chain_tx_polarity_flip_physical{136.0}=0x1 +phy_chain_tx_polarity_flip_physical{137.0}=0x1 +phy_chain_tx_polarity_flip_physical{138.0}=0x1 +phy_chain_tx_polarity_flip_physical{139.0}=0x1 +phy_chain_tx_polarity_flip_physical{14.0}=0x1 +phy_chain_tx_polarity_flip_physical{140.0}=0x1 +phy_chain_tx_polarity_flip_physical{141.0}=0x0 +phy_chain_tx_polarity_flip_physical{142.0}=0x1 +phy_chain_tx_polarity_flip_physical{143.0}=0x1 +phy_chain_tx_polarity_flip_physical{144.0}=0x1 +phy_chain_tx_polarity_flip_physical{145.0}=0x1 +phy_chain_tx_polarity_flip_physical{146.0}=0x1 +phy_chain_tx_polarity_flip_physical{147.0}=0x1 +phy_chain_tx_polarity_flip_physical{148.0}=0x0 +phy_chain_tx_polarity_flip_physical{149.0}=0x1 +phy_chain_tx_polarity_flip_physical{15.0}=0x0 +phy_chain_tx_polarity_flip_physical{150.0}=0x0 +phy_chain_tx_polarity_flip_physical{151.0}=0x0 +phy_chain_tx_polarity_flip_physical{152.0}=0x0 +phy_chain_tx_polarity_flip_physical{153.0}=0x1 +phy_chain_tx_polarity_flip_physical{154.0}=0x0 +phy_chain_tx_polarity_flip_physical{155.0}=0x0 +phy_chain_tx_polarity_flip_physical{156.0}=0x0 +phy_chain_tx_polarity_flip_physical{157.0}=0x0 +phy_chain_tx_polarity_flip_physical{158.0}=0x0 +phy_chain_tx_polarity_flip_physical{159.0}=0x0 +phy_chain_tx_polarity_flip_physical{16.0}=0x0 +phy_chain_tx_polarity_flip_physical{160.0}=0x0 +phy_chain_tx_polarity_flip_physical{161.0}=0x0 +phy_chain_tx_polarity_flip_physical{162.0}=0x1 +phy_chain_tx_polarity_flip_physical{163.0}=0x1 +phy_chain_tx_polarity_flip_physical{164.0}=0x0 +phy_chain_tx_polarity_flip_physical{165.0}=0x1 +phy_chain_tx_polarity_flip_physical{166.0}=0x1 +phy_chain_tx_polarity_flip_physical{167.0}=0x1 +phy_chain_tx_polarity_flip_physical{168.0}=0x0 +phy_chain_tx_polarity_flip_physical{169.0}=0x0 +phy_chain_tx_polarity_flip_physical{17.0}=0x0 +phy_chain_tx_polarity_flip_physical{170.0}=0x1 +phy_chain_tx_polarity_flip_physical{171.0}=0x1 +phy_chain_tx_polarity_flip_physical{172.0}=0x1 +phy_chain_tx_polarity_flip_physical{173.0}=0x0 +phy_chain_tx_polarity_flip_physical{174.0}=0x0 +phy_chain_tx_polarity_flip_physical{175.0}=0x1 +phy_chain_tx_polarity_flip_physical{176.0}=0x0 +phy_chain_tx_polarity_flip_physical{177.0}=0x1 +phy_chain_tx_polarity_flip_physical{178.0}=0x0 +phy_chain_tx_polarity_flip_physical{179.0}=0x0 +phy_chain_tx_polarity_flip_physical{18.0}=0x1 +phy_chain_tx_polarity_flip_physical{180.0}=0x0 +phy_chain_tx_polarity_flip_physical{181.0}=0x0 +phy_chain_tx_polarity_flip_physical{182.0}=0x0 +phy_chain_tx_polarity_flip_physical{183.0}=0x0 +phy_chain_tx_polarity_flip_physical{184.0}=0x1 +phy_chain_tx_polarity_flip_physical{185.0}=0x0 +phy_chain_tx_polarity_flip_physical{186.0}=0x1 +phy_chain_tx_polarity_flip_physical{187.0}=0x1 +phy_chain_tx_polarity_flip_physical{188.0}=0x1 +phy_chain_tx_polarity_flip_physical{189.0}=0x0 +phy_chain_tx_polarity_flip_physical{19.0}=0x1 +phy_chain_tx_polarity_flip_physical{190.0}=0x0 +phy_chain_tx_polarity_flip_physical{191.0}=0x0 +phy_chain_tx_polarity_flip_physical{192.0}=0x0 +phy_chain_tx_polarity_flip_physical{193.0}=0x1 +phy_chain_tx_polarity_flip_physical{194.0}=0x1 +phy_chain_tx_polarity_flip_physical{195.0}=0x1 +phy_chain_tx_polarity_flip_physical{196.0}=0x0 +phy_chain_tx_polarity_flip_physical{197.0}=0x0 +phy_chain_tx_polarity_flip_physical{198.0}=0x1 +phy_chain_tx_polarity_flip_physical{199.0}=0x1 +phy_chain_tx_polarity_flip_physical{2.0}=0x1 +phy_chain_tx_polarity_flip_physical{20.0}=0x1 +phy_chain_tx_polarity_flip_physical{200.0}=0x1 +phy_chain_tx_polarity_flip_physical{201.0}=0x1 +phy_chain_tx_polarity_flip_physical{202.0}=0x1 +phy_chain_tx_polarity_flip_physical{203.0}=0x1 +phy_chain_tx_polarity_flip_physical{204.0}=0x1 +phy_chain_tx_polarity_flip_physical{205.0}=0x0 +phy_chain_tx_polarity_flip_physical{206.0}=0x1 +phy_chain_tx_polarity_flip_physical{207.0}=0x1 +phy_chain_tx_polarity_flip_physical{208.0}=0x1 +phy_chain_tx_polarity_flip_physical{209.0}=0x1 +phy_chain_tx_polarity_flip_physical{21.0}=0x0 +phy_chain_tx_polarity_flip_physical{210.0}=0x1 +phy_chain_tx_polarity_flip_physical{211.0}=0x1 +phy_chain_tx_polarity_flip_physical{212.0}=0x0 +phy_chain_tx_polarity_flip_physical{213.0}=0x0 +phy_chain_tx_polarity_flip_physical{214.0}=0x1 +phy_chain_tx_polarity_flip_physical{215.0}=0x0 +phy_chain_tx_polarity_flip_physical{216.0}=0x1 +phy_chain_tx_polarity_flip_physical{217.0}=0x1 +phy_chain_tx_polarity_flip_physical{218.0}=0x1 +phy_chain_tx_polarity_flip_physical{219.0}=0x0 +phy_chain_tx_polarity_flip_physical{22.0}=0x0 +phy_chain_tx_polarity_flip_physical{220.0}=0x1 +phy_chain_tx_polarity_flip_physical{221.0}=0x0 +phy_chain_tx_polarity_flip_physical{222.0}=0x0 +phy_chain_tx_polarity_flip_physical{223.0}=0x0 +phy_chain_tx_polarity_flip_physical{224.0}=0x1 +phy_chain_tx_polarity_flip_physical{225.0}=0x1 +phy_chain_tx_polarity_flip_physical{226.0}=0x1 +phy_chain_tx_polarity_flip_physical{227.0}=0x1 +phy_chain_tx_polarity_flip_physical{228.0}=0x0 +phy_chain_tx_polarity_flip_physical{229.0}=0x0 +phy_chain_tx_polarity_flip_physical{23.0}=0x0 +phy_chain_tx_polarity_flip_physical{230.0}=0x1 +phy_chain_tx_polarity_flip_physical{231.0}=0x1 +phy_chain_tx_polarity_flip_physical{232.0}=0x1 +phy_chain_tx_polarity_flip_physical{233.0}=0x0 +phy_chain_tx_polarity_flip_physical{234.0}=0x0 +phy_chain_tx_polarity_flip_physical{235.0}=0x0 +phy_chain_tx_polarity_flip_physical{236.0}=0x0 +phy_chain_tx_polarity_flip_physical{237.0}=0x1 +phy_chain_tx_polarity_flip_physical{238.0}=0x1 +phy_chain_tx_polarity_flip_physical{239.0}=0x1 +phy_chain_tx_polarity_flip_physical{24.0}=0x0 +phy_chain_tx_polarity_flip_physical{240.0}=0x0 +phy_chain_tx_polarity_flip_physical{241.0}=0x1 +phy_chain_tx_polarity_flip_physical{242.0}=0x1 +phy_chain_tx_polarity_flip_physical{243.0}=0x1 +phy_chain_tx_polarity_flip_physical{244.0}=0x0 +phy_chain_tx_polarity_flip_physical{245.0}=0x1 +phy_chain_tx_polarity_flip_physical{246.0}=0x1 +phy_chain_tx_polarity_flip_physical{247.0}=0x1 +phy_chain_tx_polarity_flip_physical{248.0}=0x1 +phy_chain_tx_polarity_flip_physical{249.0}=0x1 +phy_chain_tx_polarity_flip_physical{25.0}=0x1 +phy_chain_tx_polarity_flip_physical{250.0}=0x0 +phy_chain_tx_polarity_flip_physical{251.0}=0x0 +phy_chain_tx_polarity_flip_physical{252.0}=0x0 +phy_chain_tx_polarity_flip_physical{253.0}=0x1 +phy_chain_tx_polarity_flip_physical{254.0}=0x1 +phy_chain_tx_polarity_flip_physical{255.0}=0x1 +phy_chain_tx_polarity_flip_physical{256.0}=0x0 +phy_chain_tx_polarity_flip_physical{257.0}=0x0 +phy_chain_tx_polarity_flip_physical{259.0}=0x0 +phy_chain_tx_polarity_flip_physical{26.0}=0x0 +phy_chain_tx_polarity_flip_physical{27.0}=0x0 +phy_chain_tx_polarity_flip_physical{28.0}=0x0 +phy_chain_tx_polarity_flip_physical{29.0}=0x1 +phy_chain_tx_polarity_flip_physical{3.0}=0x1 +phy_chain_tx_polarity_flip_physical{30.0}=0x1 +phy_chain_tx_polarity_flip_physical{31.0}=0x1 +phy_chain_tx_polarity_flip_physical{32.0}=0x0 +phy_chain_tx_polarity_flip_physical{33.0}=0x0 +phy_chain_tx_polarity_flip_physical{34.0}=0x0 +phy_chain_tx_polarity_flip_physical{35.0}=0x0 +phy_chain_tx_polarity_flip_physical{36.0}=0x1 +phy_chain_tx_polarity_flip_physical{37.0}=0x1 +phy_chain_tx_polarity_flip_physical{38.0}=0x1 +phy_chain_tx_polarity_flip_physical{39.0}=0x1 +phy_chain_tx_polarity_flip_physical{4.0}=0x1 +phy_chain_tx_polarity_flip_physical{40.0}=0x0 +phy_chain_tx_polarity_flip_physical{41.0}=0x0 +phy_chain_tx_polarity_flip_physical{42.0}=0x0 +phy_chain_tx_polarity_flip_physical{43.0}=0x0 +phy_chain_tx_polarity_flip_physical{44.0}=0x0 +phy_chain_tx_polarity_flip_physical{45.0}=0x1 +phy_chain_tx_polarity_flip_physical{46.0}=0x0 +phy_chain_tx_polarity_flip_physical{47.0}=0x1 +phy_chain_tx_polarity_flip_physical{48.0}=0x1 +phy_chain_tx_polarity_flip_physical{49.0}=0x0 +phy_chain_tx_polarity_flip_physical{5.0}=0x1 +phy_chain_tx_polarity_flip_physical{50.0}=0x0 +phy_chain_tx_polarity_flip_physical{51.0}=0x0 +phy_chain_tx_polarity_flip_physical{52.0}=0x1 +phy_chain_tx_polarity_flip_physical{53.0}=0x0 +phy_chain_tx_polarity_flip_physical{54.0}=0x1 +phy_chain_tx_polarity_flip_physical{55.0}=0x1 +phy_chain_tx_polarity_flip_physical{56.0}=0x0 +phy_chain_tx_polarity_flip_physical{57.0}=0x0 +phy_chain_tx_polarity_flip_physical{58.0}=0x1 +phy_chain_tx_polarity_flip_physical{59.0}=0x1 +phy_chain_tx_polarity_flip_physical{6.0}=0x1 +phy_chain_tx_polarity_flip_physical{60.0}=0x1 +phy_chain_tx_polarity_flip_physical{61.0}=0x0 +phy_chain_tx_polarity_flip_physical{62.0}=0x1 +phy_chain_tx_polarity_flip_physical{63.0}=0x1 +phy_chain_tx_polarity_flip_physical{64.0}=0x1 +phy_chain_tx_polarity_flip_physical{65.0}=0x0 +phy_chain_tx_polarity_flip_physical{66.0}=0x1 +phy_chain_tx_polarity_flip_physical{67.0}=0x1 +phy_chain_tx_polarity_flip_physical{68.0}=0x0 +phy_chain_tx_polarity_flip_physical{69.0}=0x1 +phy_chain_tx_polarity_flip_physical{7.0}=0x1 +phy_chain_tx_polarity_flip_physical{70.0}=0x1 +phy_chain_tx_polarity_flip_physical{71.0}=0x1 +phy_chain_tx_polarity_flip_physical{72.0}=0x0 +phy_chain_tx_polarity_flip_physical{73.0}=0x1 +phy_chain_tx_polarity_flip_physical{74.0}=0x0 +phy_chain_tx_polarity_flip_physical{75.0}=0x0 +phy_chain_tx_polarity_flip_physical{76.0}=0x0 +phy_chain_tx_polarity_flip_physical{77.0}=0x0 +phy_chain_tx_polarity_flip_physical{78.0}=0x0 +phy_chain_tx_polarity_flip_physical{79.0}=0x1 +phy_chain_tx_polarity_flip_physical{8.0}=0x0 +phy_chain_tx_polarity_flip_physical{80.0}=0x0 +phy_chain_tx_polarity_flip_physical{81.0}=0x1 +phy_chain_tx_polarity_flip_physical{82.0}=0x1 +phy_chain_tx_polarity_flip_physical{83.0}=0x1 +phy_chain_tx_polarity_flip_physical{84.0}=0x0 +phy_chain_tx_polarity_flip_physical{85.0}=0x1 +phy_chain_tx_polarity_flip_physical{86.0}=0x0 +phy_chain_tx_polarity_flip_physical{87.0}=0x0 +phy_chain_tx_polarity_flip_physical{88.0}=0x0 +phy_chain_tx_polarity_flip_physical{89.0}=0x1 +phy_chain_tx_polarity_flip_physical{9.0}=0x0 +phy_chain_tx_polarity_flip_physical{90.0}=0x1 +phy_chain_tx_polarity_flip_physical{91.0}=0x1 +phy_chain_tx_polarity_flip_physical{92.0}=0x0 +phy_chain_tx_polarity_flip_physical{93.0}=0x0 +phy_chain_tx_polarity_flip_physical{94.0}=0x0 +phy_chain_tx_polarity_flip_physical{95.0}=0x0 +phy_chain_tx_polarity_flip_physical{96.0}=0x0 +phy_chain_tx_polarity_flip_physical{97.0}=0x0 +phy_chain_tx_polarity_flip_physical{98.0}=0x1 +phy_chain_tx_polarity_flip_physical{99.0}=0x1 +port_init_autoneg_100=0 +port_init_autoneg_102=0 +port_init_autoneg_103=0 +port_init_autoneg_104=0 +port_init_autoneg_105=0 +port_init_autoneg_106=0 +port_init_autoneg_107=0 +port_init_autoneg_108=0 +port_init_autoneg_109=0 +port_init_autoneg_10=0 +port_init_autoneg_110=0 +port_init_autoneg_111=0 +port_init_autoneg_112=0 +port_init_autoneg_113=0 +port_init_autoneg_114=0 +port_init_autoneg_115=0 +port_init_autoneg_116=0 +port_init_autoneg_117=0 +port_init_autoneg_11=0 +port_init_autoneg_12=0 +port_init_autoneg_13=0 +port_init_autoneg_14=0 +port_init_autoneg_15=0 +port_init_autoneg_16=0 +port_init_autoneg_1=0 +port_init_autoneg_2=0 +port_init_autoneg_34=0 +port_init_autoneg_35=0 +port_init_autoneg_36=0 +port_init_autoneg_37=0 +port_init_autoneg_38=0 +port_init_autoneg_39=0 +port_init_autoneg_3=0 +port_init_autoneg_40=0 +port_init_autoneg_41=0 +port_init_autoneg_42=0 +port_init_autoneg_43=0 +port_init_autoneg_44=0 +port_init_autoneg_45=0 +port_init_autoneg_46=0 +port_init_autoneg_47=0 +port_init_autoneg_48=0 +port_init_autoneg_49=0 +port_init_autoneg_4=0 +port_init_autoneg_5=0 +port_init_autoneg_66=0 +port_init_autoneg_68=0 +port_init_autoneg_69=0 +port_init_autoneg_6=0 +port_init_autoneg_70=0 +port_init_autoneg_71=0 +port_init_autoneg_72=0 +port_init_autoneg_73=0 +port_init_autoneg_74=0 +port_init_autoneg_75=0 +port_init_autoneg_76=0 +port_init_autoneg_77=0 +port_init_autoneg_78=0 +port_init_autoneg_79=0 +port_init_autoneg_7=0 +port_init_autoneg_80=0 +port_init_autoneg_81=0 +port_init_autoneg_82=0 +port_init_autoneg_83=0 +port_init_autoneg_8=0 +port_init_autoneg_9=0 +port_init_cl72_hg=1 +port_phy_addr_100=0xff +port_phy_addr_102=0xff +port_phy_addr_103=0xff +port_phy_addr_104=0xff +port_phy_addr_105=0xff +port_phy_addr_106=0xff +port_phy_addr_107=0xff +port_phy_addr_108=0xff +port_phy_addr_109=0xff +port_phy_addr_10=0xff +port_phy_addr_110=0xff +port_phy_addr_111=0xff +port_phy_addr_112=0xff +port_phy_addr_113=0xff +port_phy_addr_114=0xff +port_phy_addr_115=0xff +port_phy_addr_116=0xff +port_phy_addr_117=0xff +port_phy_addr_11=0xff +port_phy_addr_12=0xff +port_phy_addr_13=0xff +port_phy_addr_14=0xff +port_phy_addr_15=0xff +port_phy_addr_16=0xff +port_phy_addr_1=0xff +port_phy_addr_2=0xff +port_phy_addr_34=0xff +port_phy_addr_35=0xff +port_phy_addr_36=0xff +port_phy_addr_37=0xff +port_phy_addr_38=0xff +port_phy_addr_39=0xff +port_phy_addr_3=0xff +port_phy_addr_40=0xff +port_phy_addr_41=0xff +port_phy_addr_42=0xff +port_phy_addr_43=0xff +port_phy_addr_44=0xff +port_phy_addr_45=0xff +port_phy_addr_46=0xff +port_phy_addr_47=0xff +port_phy_addr_48=0xff +port_phy_addr_49=0xff +port_phy_addr_4=0xff +port_phy_addr_5=0xff +port_phy_addr_66=0xff +port_phy_addr_68=0xff +port_phy_addr_69=0xff +port_phy_addr_6=0xff +port_phy_addr_70=0xff +port_phy_addr_71=0xff +port_phy_addr_72=0xff +port_phy_addr_73=0xff +port_phy_addr_74=0xff +port_phy_addr_75=0xff +port_phy_addr_76=0xff +port_phy_addr_77=0xff +port_phy_addr_78=0xff +port_phy_addr_79=0xff +port_phy_addr_7=0xff +port_phy_addr_80=0xff +port_phy_addr_81=0xff +port_phy_addr_82=0xff +port_phy_addr_83=0xff +port_phy_addr_8=0xff +port_phy_addr_9=0xff +portmap_100=259:10 +portmap_101=262:10 +portmap_102=217:40 +portmap_103=213:40 +portmap_104=229:40 +portmap_105=237:40 +portmap_106=249:40 +portmap_107=245:40 +portmap_108=209:40 +portmap_109=221:40 +portmap_10=29:40 +portmap_110=233:40 +portmap_111=225:40 +portmap_112=241:40 +portmap_113=253:40 +portmap_114=197:40 +portmap_115=205:40 +portmap_116=201:40 +portmap_117=193:40 +portmap_11=41:40 +portmap_12=33:40 +portmap_134=263:10 +portmap_13=57:40 +portmap_14=53:40 +portmap_15=49:40 +portmap_16=61:40 +portmap_1=5:40 +portmap_2=13:40 +portmap_33=260:10 +portmap_34=77:40 +portmap_35=65:40 +portmap_36=85:40 +portmap_37=89:40 +portmap_38=109:40 +portmap_39=97:40 +portmap_3=25:40 +portmap_40=69:40 +portmap_41=73:40 +portmap_42=93:40 +portmap_43=81:40 +portmap_44=101:40 +portmap_45=105:40 +portmap_46=117:40 +portmap_47=121:40 +portmap_48=125:40 +portmap_49=113:40 +portmap_4=21:40 +portmap_5=37:40 +portmap_66=257:10 +portmap_67=261:10 +portmap_68=149:40 +portmap_69=153:40 +portmap_6=45:40 +portmap_70=173:40 +portmap_71=161:40 +portmap_72=181:40 +portmap_73=185:40 +portmap_74=157:40 +portmap_75=145:40 +portmap_76=165:40 +portmap_77=169:40 +portmap_78=189:40 +portmap_79=177:40 +portmap_7=9:40 +portmap_80=141:40 +portmap_81=133:40 +portmap_82=129:40 +portmap_83=137:40 +portmap_8=1:40 +portmap_9=17:40 +robust_hash_disable_egress_vlan=1 +robust_hash_disable_mpls=1 +robust_hash_disable_vlan=1 +stable_size=0x5500000 +stable_size=0x5500000 +tdma_timeout_usec=15000000 +tslam_timeout_usec=15000000 + +# tuning parameters +serdes_preemphasis_1=0x105004 +serdes_preemphasis_2=0x105004 +serdes_preemphasis_3=0x105004 +serdes_preemphasis_4=0x105004 +serdes_preemphasis_5=0x105004 +serdes_preemphasis_6=0x105004 +serdes_preemphasis_7=0x105004 +serdes_preemphasis_8=0x105004 +serdes_preemphasis_9=0x105004 +serdes_preemphasis_10=0x105004 +serdes_preemphasis_11=0x105004 +serdes_preemphasis_12=0x105004 +serdes_preemphasis_13=0x71f01 +serdes_preemphasis_14=0x72101 +serdes_preemphasis_15=0x105004 +serdes_preemphasis_16=0x105004 +serdes_preemphasis_34=0x105004 +serdes_preemphasis_35=0x105004 +serdes_preemphasis_36=0x105004 +serdes_preemphasis_37=0x105004 +serdes_preemphasis_38=0x105004 +serdes_preemphasis_39=0x105004 +serdes_preemphasis_40=0x105004 +serdes_preemphasis_41=0x105004 +serdes_preemphasis_42=0x105004 +serdes_preemphasis_43=0x105004 +serdes_preemphasis_44=0x105004 +serdes_preemphasis_45=0x105004 +serdes_preemphasis_46=0x61d01 +serdes_preemphasis_47=0x51a01 +serdes_preemphasis_48=0x105004 +serdes_preemphasis_49=0x105004 +serdes_preemphasis_66=0x43004 +serdes_preemphasis_68=0x105004 +serdes_preemphasis_69=0x105004 +serdes_preemphasis_70=0x105004 +serdes_preemphasis_71=0x105004 +serdes_preemphasis_72=0x105004 +serdes_preemphasis_73=0x105004 +serdes_preemphasis_74=0x105004 +serdes_preemphasis_75=0x105004 +serdes_preemphasis_76=0x105004 +serdes_preemphasis_77=0x105004 +serdes_preemphasis_78=0x105004 +serdes_preemphasis_79=0x105004 +serdes_preemphasis_80=0x61d01 +serdes_preemphasis_81=0x51b01 +serdes_preemphasis_82=0x105004 +serdes_preemphasis_83=0x105004 +serdes_preemphasis_100=0x43004 +serdes_preemphasis_102=0x105004 +serdes_preemphasis_103=0x105004 +serdes_preemphasis_104=0x105004 +serdes_preemphasis_105=0x105004 +serdes_preemphasis_106=0x105004 +serdes_preemphasis_107=0x105004 +serdes_preemphasis_108=0x105004 +serdes_preemphasis_109=0x105004 +serdes_preemphasis_110=0x105004 +serdes_preemphasis_111=0x105004 +serdes_preemphasis_112=0x105004 +serdes_preemphasis_113=0x105004 +serdes_preemphasis_114=0x61c01 +serdes_preemphasis_115=0x61c01 +serdes_preemphasis_116=0x105004 +serdes_preemphasis_117=0x105004 + +{{ mmu_sock }} +{{ IPinIP_sock }} + +phy_an_lt_msft=1 diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-Q64/pg_profile_lookup.ini b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-Q64/pg_profile_lookup.ini deleted file mode 100644 index ac33b4f961fb..000000000000 --- a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-Q64/pg_profile_lookup.ini +++ /dev/null @@ -1,11 +0,0 @@ -# PG lossless profiles. -# speed cable size xon xoff threshold xon_offset - 40000 5m 1248 1248 56160 -3 2496 - 50000 5m 1248 1248 56160 -3 2496 - 100000 5m 1248 1248 96928 -3 2496 - 40000 40m 1248 1248 71552 -3 2496 - 50000 40m 1248 1248 96096 -3 2496 - 100000 40m 1248 1248 177632 -3 2496 - 40000 300m 1248 1248 108160 -3 2496 - 50000 300m 1248 1248 141856 -3 2496 - 100000 300m 1248 1248 268736 -3 2496 diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-Q64/pg_profile_lookup.ini b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-Q64/pg_profile_lookup.ini new file mode 120000 index 000000000000..297cddb2d223 --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-Q64/pg_profile_lookup.ini @@ -0,0 +1 @@ +BALANCED/pg_profile_lookup.ini \ No newline at end of file diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-Q64/qos.json.j2 b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-Q64/qos.json.j2 deleted file mode 100644 index 3e548325ea30..000000000000 --- a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-Q64/qos.json.j2 +++ /dev/null @@ -1 +0,0 @@ -{%- include 'qos_config.j2' %} diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-Q64/qos.json.j2 b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-Q64/qos.json.j2 new file mode 120000 index 000000000000..aef6b6765cf2 --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-Q64/qos.json.j2 @@ -0,0 +1 @@ +BALANCED/qos.json.j2 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-Q64/sai.profile b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-Q64/sai.profile index a89cba46c3d1..5163d6140f0e 100644 --- a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-Q64/sai.profile +++ b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-Q64/sai.profile @@ -1,2 +1,2 @@ -SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/th2-a7260cx3-64-64x40G.config.bcm +SAI_INIT_CONFIG_FILE=/etc/sai.d/config.bcm SAI_NUM_ECMP_MEMBERS=64 diff --git a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-Q64/th2-a7260cx3-64-64x40G.config.bcm b/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-Q64/th2-a7260cx3-64-64x40G.config.bcm deleted file mode 100644 index e26a8131efdb..000000000000 --- a/device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-Q64/th2-a7260cx3-64-64x40G.config.bcm +++ /dev/null @@ -1,1015 +0,0 @@ -PHY_AN_ALLOW_PLL_CHANGE=1 -arl_clean_timeout_usec=15000000 -asf_mem_profile=2 -bcm_num_cos=10 -bcm_stat_flags=1 -bcm_stat_jumbo=9236 -cdma_timeout_usec=15000000 -core_clock_frequency=1700 -dma_desc_timeout_usec=15000000 -dpp_clock_ratio=2:3 -higig2_hdr_mode=1 -ipv6_lpm_128b_enable=1 -l3_alpm_enable=2 -lpm_scaling_enable=0 -l2xmsg_mode=1 -max_vp_lags=0 -mem_scan_enable=1 -miim_intr_enable=0 -module_64ports=1 -os=unix -oversubscribe_mode=1 -pbmp_xport_xe=0x40003ffff0000ffffc0003fffe0001fffe -phy_an_allow_pll_change_hg=0 -phy_an_c73_100=1 -phy_an_c73_102=1 -phy_an_c73_103=1 -phy_an_c73_104=1 -phy_an_c73_105=1 -phy_an_c73_106=1 -phy_an_c73_107=1 -phy_an_c73_108=1 -phy_an_c73_109=1 -phy_an_c73_10=1 -phy_an_c73_110=1 -phy_an_c73_111=1 -phy_an_c73_112=1 -phy_an_c73_113=1 -phy_an_c73_114=1 -phy_an_c73_115=1 -phy_an_c73_116=1 -phy_an_c73_117=1 -phy_an_c73_11=1 -phy_an_c73_12=1 -phy_an_c73_13=1 -phy_an_c73_14=1 -phy_an_c73_15=1 -phy_an_c73_16=1 -phy_an_c73_1=1 -phy_an_c73_2=1 -phy_an_c73_34=1 -phy_an_c73_35=1 -phy_an_c73_36=1 -phy_an_c73_37=1 -phy_an_c73_38=1 -phy_an_c73_39=1 -phy_an_c73_3=1 -phy_an_c73_40=1 -phy_an_c73_41=1 -phy_an_c73_42=1 -phy_an_c73_43=1 -phy_an_c73_44=1 -phy_an_c73_45=1 -phy_an_c73_46=1 -phy_an_c73_47=1 -phy_an_c73_48=1 -phy_an_c73_49=1 -phy_an_c73_4=1 -phy_an_c73_5=1 -phy_an_c73_66=1 -phy_an_c73_68=1 -phy_an_c73_69=1 -phy_an_c73_6=1 -phy_an_c73_70=1 -phy_an_c73_71=1 -phy_an_c73_72=1 -phy_an_c73_73=1 -phy_an_c73_74=1 -phy_an_c73_75=1 -phy_an_c73_76=1 -phy_an_c73_77=1 -phy_an_c73_78=1 -phy_an_c73_79=1 -phy_an_c73_7=1 -phy_an_c73_80=1 -phy_an_c73_81=1 -phy_an_c73_82=1 -phy_an_c73_83=1 -phy_an_c73_8=1 -phy_an_c73_9=1 -phy_chain_rx_lane_map_physical{1.0}=0x3210 -phy_chain_rx_lane_map_physical{101.0}=0x0123 -phy_chain_rx_lane_map_physical{105.0}=0x0123 -phy_chain_rx_lane_map_physical{109.0}=0x0123 -phy_chain_rx_lane_map_physical{113.0}=0x2301 -phy_chain_rx_lane_map_physical{117.0}=0x3210 -phy_chain_rx_lane_map_physical{121.0}=0x3210 -phy_chain_rx_lane_map_physical{125.0}=0x1203 -phy_chain_rx_lane_map_physical{129.0}=0x3210 -phy_chain_rx_lane_map_physical{13.0}=0x0321 -phy_chain_rx_lane_map_physical{133.0}=0x1032 -phy_chain_rx_lane_map_physical{137.0}=0x3210 -phy_chain_rx_lane_map_physical{141.0}=0x0123 -phy_chain_rx_lane_map_physical{145.0}=0x3210 -phy_chain_rx_lane_map_physical{149.0}=0x2310 -phy_chain_rx_lane_map_physical{153.0}=0x0132 -phy_chain_rx_lane_map_physical{157.0}=0x1302 -phy_chain_rx_lane_map_physical{161.0}=0x3021 -phy_chain_rx_lane_map_physical{165.0}=0x2031 -phy_chain_rx_lane_map_physical{169.0}=0x2031 -phy_chain_rx_lane_map_physical{17.0}=0x3210 -phy_chain_rx_lane_map_physical{173.0}=0x1302 -phy_chain_rx_lane_map_physical{177.0}=0x2031 -phy_chain_rx_lane_map_physical{181.0}=0x0213 -phy_chain_rx_lane_map_physical{185.0}=0x0213 -phy_chain_rx_lane_map_physical{189.0}=0x1302 -phy_chain_rx_lane_map_physical{193.0}=0x3120 -phy_chain_rx_lane_map_physical{197.0}=0x0231 -phy_chain_rx_lane_map_physical{201.0}=0x2031 -phy_chain_rx_lane_map_physical{205.0}=0x0213 -phy_chain_rx_lane_map_physical{209.0}=0x2013 -phy_chain_rx_lane_map_physical{21.0}=0x3021 -phy_chain_rx_lane_map_physical{213.0}=0x3021 -phy_chain_rx_lane_map_physical{217.0}=0x0231 -phy_chain_rx_lane_map_physical{221.0}=0x2031 -phy_chain_rx_lane_map_physical{225.0}=0x1203 -phy_chain_rx_lane_map_physical{229.0}=0x1230 -phy_chain_rx_lane_map_physical{233.0}=0x3021 -phy_chain_rx_lane_map_physical{237.0}=0x1032 -phy_chain_rx_lane_map_physical{241.0}=0x2301 -phy_chain_rx_lane_map_physical{245.0}=0x0321 -phy_chain_rx_lane_map_physical{249.0}=0x2301 -phy_chain_rx_lane_map_physical{25.0}=0x2301 -phy_chain_rx_lane_map_physical{253.0}=0x2301 -phy_chain_rx_lane_map_physical{257.0}=0x3210 -phy_chain_rx_lane_map_physical{29.0}=0x3021 -phy_chain_rx_lane_map_physical{33.0}=0x1302 -phy_chain_rx_lane_map_physical{37.0}=0x2031 -phy_chain_rx_lane_map_physical{41.0}=0x3021 -phy_chain_rx_lane_map_physical{45.0}=0x1023 -phy_chain_rx_lane_map_physical{49.0}=0x0213 -phy_chain_rx_lane_map_physical{5.0}=0x3201 -phy_chain_rx_lane_map_physical{53.0}=0x3201 -phy_chain_rx_lane_map_physical{57.0}=0x2013 -phy_chain_rx_lane_map_physical{61.0}=0x0213 -phy_chain_rx_lane_map_physical{65.0}=0x1203 -phy_chain_rx_lane_map_physical{69.0}=0x0213 -phy_chain_rx_lane_map_physical{73.0}=0x0213 -phy_chain_rx_lane_map_physical{77.0}=0x3120 -phy_chain_rx_lane_map_physical{81.0}=0x0213 -phy_chain_rx_lane_map_physical{85.0}=0x2031 -phy_chain_rx_lane_map_physical{89.0}=0x2031 -phy_chain_rx_lane_map_physical{9.0}=0x0321 -phy_chain_rx_lane_map_physical{93.0}=0x3120 -phy_chain_rx_lane_map_physical{97.0}=0x1203 -phy_chain_rx_polarity_flip_physical{1.0}=0x1 -phy_chain_rx_polarity_flip_physical{10.0}=0x0 -phy_chain_rx_polarity_flip_physical{100.0}=0x1 -phy_chain_rx_polarity_flip_physical{101.0}=0x1 -phy_chain_rx_polarity_flip_physical{102.0}=0x0 -phy_chain_rx_polarity_flip_physical{103.0}=0x1 -phy_chain_rx_polarity_flip_physical{104.0}=0x0 -phy_chain_rx_polarity_flip_physical{105.0}=0x1 -phy_chain_rx_polarity_flip_physical{106.0}=0x0 -phy_chain_rx_polarity_flip_physical{107.0}=0x1 -phy_chain_rx_polarity_flip_physical{108.0}=0x0 -phy_chain_rx_polarity_flip_physical{109.0}=0x0 -phy_chain_rx_polarity_flip_physical{11.0}=0x1 -phy_chain_rx_polarity_flip_physical{110.0}=0x1 -phy_chain_rx_polarity_flip_physical{111.0}=0x0 -phy_chain_rx_polarity_flip_physical{112.0}=0x1 -phy_chain_rx_polarity_flip_physical{113.0}=0x1 -phy_chain_rx_polarity_flip_physical{114.0}=0x0 -phy_chain_rx_polarity_flip_physical{115.0}=0x1 -phy_chain_rx_polarity_flip_physical{116.0}=0x0 -phy_chain_rx_polarity_flip_physical{117.0}=0x0 -phy_chain_rx_polarity_flip_physical{118.0}=0x0 -phy_chain_rx_polarity_flip_physical{119.0}=0x1 -phy_chain_rx_polarity_flip_physical{12.0}=0x1 -phy_chain_rx_polarity_flip_physical{120.0}=0x0 -phy_chain_rx_polarity_flip_physical{121.0}=0x1 -phy_chain_rx_polarity_flip_physical{122.0}=0x0 -phy_chain_rx_polarity_flip_physical{123.0}=0x1 -phy_chain_rx_polarity_flip_physical{124.0}=0x0 -phy_chain_rx_polarity_flip_physical{125.0}=0x0 -phy_chain_rx_polarity_flip_physical{126.0}=0x1 -phy_chain_rx_polarity_flip_physical{127.0}=0x1 -phy_chain_rx_polarity_flip_physical{128.0}=0x1 -phy_chain_rx_polarity_flip_physical{129.0}=0x0 -phy_chain_rx_polarity_flip_physical{13.0}=0x1 -phy_chain_rx_polarity_flip_physical{130.0}=0x1 -phy_chain_rx_polarity_flip_physical{131.0}=0x1 -phy_chain_rx_polarity_flip_physical{132.0}=0x0 -phy_chain_rx_polarity_flip_physical{133.0}=0x1 -phy_chain_rx_polarity_flip_physical{134.0}=0x1 -phy_chain_rx_polarity_flip_physical{135.0}=0x1 -phy_chain_rx_polarity_flip_physical{136.0}=0x0 -phy_chain_rx_polarity_flip_physical{137.0}=0x0 -phy_chain_rx_polarity_flip_physical{138.0}=0x0 -phy_chain_rx_polarity_flip_physical{139.0}=0x1 -phy_chain_rx_polarity_flip_physical{14.0}=0x0 -phy_chain_rx_polarity_flip_physical{140.0}=0x0 -phy_chain_rx_polarity_flip_physical{141.0}=0x1 -phy_chain_rx_polarity_flip_physical{142.0}=0x0 -phy_chain_rx_polarity_flip_physical{143.0}=0x1 -phy_chain_rx_polarity_flip_physical{144.0}=0x0 -phy_chain_rx_polarity_flip_physical{145.0}=0x1 -phy_chain_rx_polarity_flip_physical{146.0}=0x0 -phy_chain_rx_polarity_flip_physical{147.0}=0x1 -phy_chain_rx_polarity_flip_physical{148.0}=0x0 -phy_chain_rx_polarity_flip_physical{149.0}=0x0 -phy_chain_rx_polarity_flip_physical{15.0}=0x1 -phy_chain_rx_polarity_flip_physical{150.0}=0x1 -phy_chain_rx_polarity_flip_physical{151.0}=0x1 -phy_chain_rx_polarity_flip_physical{152.0}=0x0 -phy_chain_rx_polarity_flip_physical{153.0}=0x0 -phy_chain_rx_polarity_flip_physical{154.0}=0x1 -phy_chain_rx_polarity_flip_physical{155.0}=0x1 -phy_chain_rx_polarity_flip_physical{156.0}=0x0 -phy_chain_rx_polarity_flip_physical{157.0}=0x0 -phy_chain_rx_polarity_flip_physical{158.0}=0x0 -phy_chain_rx_polarity_flip_physical{159.0}=0x1 -phy_chain_rx_polarity_flip_physical{16.0}=0x0 -phy_chain_rx_polarity_flip_physical{160.0}=0x0 -phy_chain_rx_polarity_flip_physical{161.0}=0x1 -phy_chain_rx_polarity_flip_physical{162.0}=0x1 -phy_chain_rx_polarity_flip_physical{163.0}=0x0 -phy_chain_rx_polarity_flip_physical{164.0}=0x1 -phy_chain_rx_polarity_flip_physical{165.0}=0x0 -phy_chain_rx_polarity_flip_physical{166.0}=0x0 -phy_chain_rx_polarity_flip_physical{167.0}=0x1 -phy_chain_rx_polarity_flip_physical{168.0}=0x1 -phy_chain_rx_polarity_flip_physical{169.0}=0x1 -phy_chain_rx_polarity_flip_physical{17.0}=0x1 -phy_chain_rx_polarity_flip_physical{170.0}=0x1 -phy_chain_rx_polarity_flip_physical{171.0}=0x0 -phy_chain_rx_polarity_flip_physical{172.0}=0x0 -phy_chain_rx_polarity_flip_physical{173.0}=0x0 -phy_chain_rx_polarity_flip_physical{174.0}=0x0 -phy_chain_rx_polarity_flip_physical{175.0}=0x1 -phy_chain_rx_polarity_flip_physical{176.0}=0x1 -phy_chain_rx_polarity_flip_physical{177.0}=0x1 -phy_chain_rx_polarity_flip_physical{178.0}=0x1 -phy_chain_rx_polarity_flip_physical{179.0}=0x0 -phy_chain_rx_polarity_flip_physical{18.0}=0x0 -phy_chain_rx_polarity_flip_physical{180.0}=0x0 -phy_chain_rx_polarity_flip_physical{181.0}=0x1 -phy_chain_rx_polarity_flip_physical{182.0}=0x1 -phy_chain_rx_polarity_flip_physical{183.0}=0x0 -phy_chain_rx_polarity_flip_physical{184.0}=0x0 -phy_chain_rx_polarity_flip_physical{185.0}=0x0 -phy_chain_rx_polarity_flip_physical{186.0}=0x0 -phy_chain_rx_polarity_flip_physical{187.0}=0x1 -phy_chain_rx_polarity_flip_physical{188.0}=0x1 -phy_chain_rx_polarity_flip_physical{189.0}=0x0 -phy_chain_rx_polarity_flip_physical{19.0}=0x1 -phy_chain_rx_polarity_flip_physical{190.0}=0x0 -phy_chain_rx_polarity_flip_physical{191.0}=0x1 -phy_chain_rx_polarity_flip_physical{192.0}=0x0 -phy_chain_rx_polarity_flip_physical{193.0}=0x0 -phy_chain_rx_polarity_flip_physical{194.0}=0x0 -phy_chain_rx_polarity_flip_physical{195.0}=0x1 -phy_chain_rx_polarity_flip_physical{196.0}=0x1 -phy_chain_rx_polarity_flip_physical{197.0}=0x1 -phy_chain_rx_polarity_flip_physical{198.0}=0x1 -phy_chain_rx_polarity_flip_physical{199.0}=0x0 -phy_chain_rx_polarity_flip_physical{2.0}=0x0 -phy_chain_rx_polarity_flip_physical{20.0}=0x0 -phy_chain_rx_polarity_flip_physical{200.0}=0x0 -phy_chain_rx_polarity_flip_physical{201.0}=0x0 -phy_chain_rx_polarity_flip_physical{202.0}=0x0 -phy_chain_rx_polarity_flip_physical{203.0}=0x1 -phy_chain_rx_polarity_flip_physical{204.0}=0x0 -phy_chain_rx_polarity_flip_physical{205.0}=0x1 -phy_chain_rx_polarity_flip_physical{206.0}=0x1 -phy_chain_rx_polarity_flip_physical{207.0}=0x0 -phy_chain_rx_polarity_flip_physical{208.0}=0x0 -phy_chain_rx_polarity_flip_physical{209.0}=0x1 -phy_chain_rx_polarity_flip_physical{21.0}=0x0 -phy_chain_rx_polarity_flip_physical{210.0}=0x1 -phy_chain_rx_polarity_flip_physical{211.0}=0x0 -phy_chain_rx_polarity_flip_physical{212.0}=0x0 -phy_chain_rx_polarity_flip_physical{213.0}=0x0 -phy_chain_rx_polarity_flip_physical{214.0}=0x0 -phy_chain_rx_polarity_flip_physical{215.0}=0x1 -phy_chain_rx_polarity_flip_physical{216.0}=0x0 -phy_chain_rx_polarity_flip_physical{217.0}=0x0 -phy_chain_rx_polarity_flip_physical{218.0}=0x0 -phy_chain_rx_polarity_flip_physical{219.0}=0x1 -phy_chain_rx_polarity_flip_physical{22.0}=0x0 -phy_chain_rx_polarity_flip_physical{220.0}=0x1 -phy_chain_rx_polarity_flip_physical{221.0}=0x0 -phy_chain_rx_polarity_flip_physical{222.0}=0x0 -phy_chain_rx_polarity_flip_physical{223.0}=0x1 -phy_chain_rx_polarity_flip_physical{224.0}=0x1 -phy_chain_rx_polarity_flip_physical{225.0}=0x1 -phy_chain_rx_polarity_flip_physical{226.0}=0x0 -phy_chain_rx_polarity_flip_physical{227.0}=0x0 -phy_chain_rx_polarity_flip_physical{228.0}=0x1 -phy_chain_rx_polarity_flip_physical{229.0}=0x0 -phy_chain_rx_polarity_flip_physical{23.0}=0x1 -phy_chain_rx_polarity_flip_physical{230.0}=0x0 -phy_chain_rx_polarity_flip_physical{231.0}=0x1 -phy_chain_rx_polarity_flip_physical{232.0}=0x1 -phy_chain_rx_polarity_flip_physical{233.0}=0x1 -phy_chain_rx_polarity_flip_physical{234.0}=0x0 -phy_chain_rx_polarity_flip_physical{235.0}=0x0 -phy_chain_rx_polarity_flip_physical{236.0}=0x0 -phy_chain_rx_polarity_flip_physical{237.0}=0x1 -phy_chain_rx_polarity_flip_physical{238.0}=0x0 -phy_chain_rx_polarity_flip_physical{239.0}=0x1 -phy_chain_rx_polarity_flip_physical{24.0}=0x0 -phy_chain_rx_polarity_flip_physical{240.0}=0x0 -phy_chain_rx_polarity_flip_physical{241.0}=0x1 -phy_chain_rx_polarity_flip_physical{242.0}=0x0 -phy_chain_rx_polarity_flip_physical{243.0}=0x1 -phy_chain_rx_polarity_flip_physical{244.0}=0x0 -phy_chain_rx_polarity_flip_physical{245.0}=0x1 -phy_chain_rx_polarity_flip_physical{246.0}=0x1 -phy_chain_rx_polarity_flip_physical{247.0}=0x1 -phy_chain_rx_polarity_flip_physical{248.0}=0x0 -phy_chain_rx_polarity_flip_physical{249.0}=0x0 -phy_chain_rx_polarity_flip_physical{25.0}=0x1 -phy_chain_rx_polarity_flip_physical{250.0}=0x1 -phy_chain_rx_polarity_flip_physical{251.0}=0x0 -phy_chain_rx_polarity_flip_physical{252.0}=0x1 -phy_chain_rx_polarity_flip_physical{253.0}=0x1 -phy_chain_rx_polarity_flip_physical{254.0}=0x0 -phy_chain_rx_polarity_flip_physical{255.0}=0x1 -phy_chain_rx_polarity_flip_physical{256.0}=0x0 -phy_chain_rx_polarity_flip_physical{257.0}=0x0 -phy_chain_rx_polarity_flip_physical{259.0}=0x0 -phy_chain_rx_polarity_flip_physical{26.0}=0x0 -phy_chain_rx_polarity_flip_physical{27.0}=0x1 -phy_chain_rx_polarity_flip_physical{28.0}=0x0 -phy_chain_rx_polarity_flip_physical{29.0}=0x0 -phy_chain_rx_polarity_flip_physical{3.0}=0x1 -phy_chain_rx_polarity_flip_physical{30.0}=0x0 -phy_chain_rx_polarity_flip_physical{31.0}=0x0 -phy_chain_rx_polarity_flip_physical{32.0}=0x1 -phy_chain_rx_polarity_flip_physical{33.0}=0x0 -phy_chain_rx_polarity_flip_physical{34.0}=0x0 -phy_chain_rx_polarity_flip_physical{35.0}=0x1 -phy_chain_rx_polarity_flip_physical{36.0}=0x1 -phy_chain_rx_polarity_flip_physical{37.0}=0x1 -phy_chain_rx_polarity_flip_physical{38.0}=0x1 -phy_chain_rx_polarity_flip_physical{39.0}=0x0 -phy_chain_rx_polarity_flip_physical{4.0}=0x0 -phy_chain_rx_polarity_flip_physical{40.0}=0x0 -phy_chain_rx_polarity_flip_physical{41.0}=0x0 -phy_chain_rx_polarity_flip_physical{42.0}=0x1 -phy_chain_rx_polarity_flip_physical{43.0}=0x1 -phy_chain_rx_polarity_flip_physical{44.0}=0x1 -phy_chain_rx_polarity_flip_physical{45.0}=0x1 -phy_chain_rx_polarity_flip_physical{46.0}=0x0 -phy_chain_rx_polarity_flip_physical{47.0}=0x0 -phy_chain_rx_polarity_flip_physical{48.0}=0x1 -phy_chain_rx_polarity_flip_physical{49.0}=0x1 -phy_chain_rx_polarity_flip_physical{5.0}=0x1 -phy_chain_rx_polarity_flip_physical{50.0}=0x1 -phy_chain_rx_polarity_flip_physical{51.0}=0x0 -phy_chain_rx_polarity_flip_physical{52.0}=0x0 -phy_chain_rx_polarity_flip_physical{53.0}=0x0 -phy_chain_rx_polarity_flip_physical{54.0}=0x0 -phy_chain_rx_polarity_flip_physical{55.0}=0x1 -phy_chain_rx_polarity_flip_physical{56.0}=0x0 -phy_chain_rx_polarity_flip_physical{57.0}=0x0 -phy_chain_rx_polarity_flip_physical{58.0}=0x0 -phy_chain_rx_polarity_flip_physical{59.0}=0x1 -phy_chain_rx_polarity_flip_physical{6.0}=0x0 -phy_chain_rx_polarity_flip_physical{60.0}=0x1 -phy_chain_rx_polarity_flip_physical{61.0}=0x0 -phy_chain_rx_polarity_flip_physical{62.0}=0x0 -phy_chain_rx_polarity_flip_physical{63.0}=0x1 -phy_chain_rx_polarity_flip_physical{64.0}=0x1 -phy_chain_rx_polarity_flip_physical{65.0}=0x1 -phy_chain_rx_polarity_flip_physical{66.0}=0x1 -phy_chain_rx_polarity_flip_physical{67.0}=0x0 -phy_chain_rx_polarity_flip_physical{68.0}=0x1 -phy_chain_rx_polarity_flip_physical{69.0}=0x0 -phy_chain_rx_polarity_flip_physical{7.0}=0x0 -phy_chain_rx_polarity_flip_physical{70.0}=0x0 -phy_chain_rx_polarity_flip_physical{71.0}=0x1 -phy_chain_rx_polarity_flip_physical{72.0}=0x1 -phy_chain_rx_polarity_flip_physical{73.0}=0x1 -phy_chain_rx_polarity_flip_physical{74.0}=0x1 -phy_chain_rx_polarity_flip_physical{75.0}=0x0 -phy_chain_rx_polarity_flip_physical{76.0}=0x0 -phy_chain_rx_polarity_flip_physical{77.0}=0x0 -phy_chain_rx_polarity_flip_physical{78.0}=0x0 -phy_chain_rx_polarity_flip_physical{79.0}=0x1 -phy_chain_rx_polarity_flip_physical{8.0}=0x1 -phy_chain_rx_polarity_flip_physical{80.0}=0x1 -phy_chain_rx_polarity_flip_physical{81.0}=0x1 -phy_chain_rx_polarity_flip_physical{82.0}=0x1 -phy_chain_rx_polarity_flip_physical{83.0}=0x0 -phy_chain_rx_polarity_flip_physical{84.0}=0x0 -phy_chain_rx_polarity_flip_physical{85.0}=0x1 -phy_chain_rx_polarity_flip_physical{86.0}=0x1 -phy_chain_rx_polarity_flip_physical{87.0}=0x0 -phy_chain_rx_polarity_flip_physical{88.0}=0x0 -phy_chain_rx_polarity_flip_physical{89.0}=0x0 -phy_chain_rx_polarity_flip_physical{9.0}=0x1 -phy_chain_rx_polarity_flip_physical{90.0}=0x0 -phy_chain_rx_polarity_flip_physical{91.0}=0x1 -phy_chain_rx_polarity_flip_physical{92.0}=0x1 -phy_chain_rx_polarity_flip_physical{93.0}=0x0 -phy_chain_rx_polarity_flip_physical{94.0}=0x0 -phy_chain_rx_polarity_flip_physical{95.0}=0x1 -phy_chain_rx_polarity_flip_physical{96.0}=0x0 -phy_chain_rx_polarity_flip_physical{97.0}=0x1 -phy_chain_rx_polarity_flip_physical{98.0}=0x1 -phy_chain_rx_polarity_flip_physical{99.0}=0x0 -phy_chain_tx_lane_map_physical{1.0}=0x2031 -phy_chain_tx_lane_map_physical{101.0}=0x1023 -phy_chain_tx_lane_map_physical{105.0}=0x1302 -phy_chain_tx_lane_map_physical{109.0}=0x0321 -phy_chain_tx_lane_map_physical{113.0}=0x2301 -phy_chain_tx_lane_map_physical{117.0}=0x3120 -phy_chain_tx_lane_map_physical{121.0}=0x3102 -phy_chain_tx_lane_map_physical{125.0}=0x3210 -phy_chain_tx_lane_map_physical{129.0}=0x1023 -phy_chain_tx_lane_map_physical{13.0}=0x3021 -phy_chain_tx_lane_map_physical{133.0}=0x3210 -phy_chain_tx_lane_map_physical{137.0}=0x2031 -phy_chain_tx_lane_map_physical{141.0}=0x1302 -phy_chain_tx_lane_map_physical{145.0}=0x3210 -phy_chain_tx_lane_map_physical{149.0}=0x0213 -phy_chain_tx_lane_map_physical{153.0}=0x3210 -phy_chain_tx_lane_map_physical{157.0}=0x1320 -phy_chain_tx_lane_map_physical{161.0}=0x3210 -phy_chain_tx_lane_map_physical{165.0}=0x0231 -phy_chain_tx_lane_map_physical{169.0}=0x3120 -phy_chain_tx_lane_map_physical{17.0}=0x1032 -phy_chain_tx_lane_map_physical{173.0}=0x0312 -phy_chain_tx_lane_map_physical{177.0}=0x0231 -phy_chain_tx_lane_map_physical{181.0}=0x3210 -phy_chain_tx_lane_map_physical{185.0}=0x3210 -phy_chain_tx_lane_map_physical{189.0}=0x1320 -phy_chain_tx_lane_map_physical{193.0}=0x0321 -phy_chain_tx_lane_map_physical{197.0}=0x3120 -phy_chain_tx_lane_map_physical{201.0}=0x3120 -phy_chain_tx_lane_map_physical{205.0}=0x0123 -phy_chain_tx_lane_map_physical{209.0}=0x3120 -phy_chain_tx_lane_map_physical{21.0}=0x0213 -phy_chain_tx_lane_map_physical{213.0}=0x3021 -phy_chain_tx_lane_map_physical{217.0}=0x0312 -phy_chain_tx_lane_map_physical{221.0}=0x2301 -phy_chain_tx_lane_map_physical{225.0}=0x0123 -phy_chain_tx_lane_map_physical{229.0}=0x2031 -phy_chain_tx_lane_map_physical{233.0}=0x0231 -phy_chain_tx_lane_map_physical{237.0}=0x0213 -phy_chain_tx_lane_map_physical{241.0}=0x1320 -phy_chain_tx_lane_map_physical{245.0}=0x2031 -phy_chain_tx_lane_map_physical{249.0}=0x3120 -phy_chain_tx_lane_map_physical{25.0}=0x0231 -phy_chain_tx_lane_map_physical{253.0}=0x0321 -phy_chain_tx_lane_map_physical{257.0}=0x3210 -phy_chain_tx_lane_map_physical{29.0}=0x1230 -phy_chain_tx_lane_map_physical{33.0}=0x1032 -phy_chain_tx_lane_map_physical{37.0}=0x0123 -phy_chain_tx_lane_map_physical{41.0}=0x0213 -phy_chain_tx_lane_map_physical{45.0}=0x0132 -phy_chain_tx_lane_map_physical{49.0}=0x2031 -phy_chain_tx_lane_map_physical{5.0}=0x2301 -phy_chain_tx_lane_map_physical{53.0}=0x2301 -phy_chain_tx_lane_map_physical{57.0}=0x2031 -phy_chain_tx_lane_map_physical{61.0}=0x2031 -phy_chain_tx_lane_map_physical{65.0}=0x1230 -phy_chain_tx_lane_map_physical{69.0}=0x2013 -phy_chain_tx_lane_map_physical{73.0}=0x0213 -phy_chain_tx_lane_map_physical{77.0}=0x2310 -phy_chain_tx_lane_map_physical{81.0}=0x0321 -phy_chain_tx_lane_map_physical{85.0}=0x2013 -phy_chain_tx_lane_map_physical{89.0}=0x0213 -phy_chain_tx_lane_map_physical{9.0}=0x3012 -phy_chain_tx_lane_map_physical{93.0}=0x3102 -phy_chain_tx_lane_map_physical{97.0}=0x3210 -phy_chain_tx_polarity_flip_physical{1.0}=0x0 -phy_chain_tx_polarity_flip_physical{10.0}=0x1 -phy_chain_tx_polarity_flip_physical{100.0}=0x0 -phy_chain_tx_polarity_flip_physical{101.0}=0x0 -phy_chain_tx_polarity_flip_physical{102.0}=0x1 -phy_chain_tx_polarity_flip_physical{103.0}=0x0 -phy_chain_tx_polarity_flip_physical{104.0}=0x0 -phy_chain_tx_polarity_flip_physical{105.0}=0x0 -phy_chain_tx_polarity_flip_physical{106.0}=0x1 -phy_chain_tx_polarity_flip_physical{107.0}=0x1 -phy_chain_tx_polarity_flip_physical{108.0}=0x1 -phy_chain_tx_polarity_flip_physical{109.0}=0x0 -phy_chain_tx_polarity_flip_physical{11.0}=0x1 -phy_chain_tx_polarity_flip_physical{110.0}=0x0 -phy_chain_tx_polarity_flip_physical{111.0}=0x0 -phy_chain_tx_polarity_flip_physical{112.0}=0x1 -phy_chain_tx_polarity_flip_physical{113.0}=0x1 -phy_chain_tx_polarity_flip_physical{114.0}=0x1 -phy_chain_tx_polarity_flip_physical{115.0}=0x1 -phy_chain_tx_polarity_flip_physical{116.0}=0x0 -phy_chain_tx_polarity_flip_physical{117.0}=0x1 -phy_chain_tx_polarity_flip_physical{118.0}=0x0 -phy_chain_tx_polarity_flip_physical{119.0}=0x0 -phy_chain_tx_polarity_flip_physical{12.0}=0x0 -phy_chain_tx_polarity_flip_physical{120.0}=0x0 -phy_chain_tx_polarity_flip_physical{121.0}=0x0 -phy_chain_tx_polarity_flip_physical{122.0}=0x0 -phy_chain_tx_polarity_flip_physical{123.0}=0x0 -phy_chain_tx_polarity_flip_physical{124.0}=0x1 -phy_chain_tx_polarity_flip_physical{125.0}=0x0 -phy_chain_tx_polarity_flip_physical{126.0}=0x1 -phy_chain_tx_polarity_flip_physical{127.0}=0x1 -phy_chain_tx_polarity_flip_physical{128.0}=0x1 -phy_chain_tx_polarity_flip_physical{129.0}=0x1 -phy_chain_tx_polarity_flip_physical{13.0}=0x0 -phy_chain_tx_polarity_flip_physical{130.0}=0x0 -phy_chain_tx_polarity_flip_physical{131.0}=0x1 -phy_chain_tx_polarity_flip_physical{132.0}=0x0 -phy_chain_tx_polarity_flip_physical{133.0}=0x1 -phy_chain_tx_polarity_flip_physical{134.0}=0x1 -phy_chain_tx_polarity_flip_physical{135.0}=0x1 -phy_chain_tx_polarity_flip_physical{136.0}=0x1 -phy_chain_tx_polarity_flip_physical{137.0}=0x1 -phy_chain_tx_polarity_flip_physical{138.0}=0x1 -phy_chain_tx_polarity_flip_physical{139.0}=0x1 -phy_chain_tx_polarity_flip_physical{14.0}=0x1 -phy_chain_tx_polarity_flip_physical{140.0}=0x1 -phy_chain_tx_polarity_flip_physical{141.0}=0x0 -phy_chain_tx_polarity_flip_physical{142.0}=0x1 -phy_chain_tx_polarity_flip_physical{143.0}=0x1 -phy_chain_tx_polarity_flip_physical{144.0}=0x1 -phy_chain_tx_polarity_flip_physical{145.0}=0x1 -phy_chain_tx_polarity_flip_physical{146.0}=0x1 -phy_chain_tx_polarity_flip_physical{147.0}=0x1 -phy_chain_tx_polarity_flip_physical{148.0}=0x0 -phy_chain_tx_polarity_flip_physical{149.0}=0x1 -phy_chain_tx_polarity_flip_physical{15.0}=0x0 -phy_chain_tx_polarity_flip_physical{150.0}=0x0 -phy_chain_tx_polarity_flip_physical{151.0}=0x0 -phy_chain_tx_polarity_flip_physical{152.0}=0x0 -phy_chain_tx_polarity_flip_physical{153.0}=0x1 -phy_chain_tx_polarity_flip_physical{154.0}=0x0 -phy_chain_tx_polarity_flip_physical{155.0}=0x0 -phy_chain_tx_polarity_flip_physical{156.0}=0x0 -phy_chain_tx_polarity_flip_physical{157.0}=0x0 -phy_chain_tx_polarity_flip_physical{158.0}=0x0 -phy_chain_tx_polarity_flip_physical{159.0}=0x0 -phy_chain_tx_polarity_flip_physical{16.0}=0x0 -phy_chain_tx_polarity_flip_physical{160.0}=0x0 -phy_chain_tx_polarity_flip_physical{161.0}=0x0 -phy_chain_tx_polarity_flip_physical{162.0}=0x1 -phy_chain_tx_polarity_flip_physical{163.0}=0x1 -phy_chain_tx_polarity_flip_physical{164.0}=0x0 -phy_chain_tx_polarity_flip_physical{165.0}=0x1 -phy_chain_tx_polarity_flip_physical{166.0}=0x1 -phy_chain_tx_polarity_flip_physical{167.0}=0x1 -phy_chain_tx_polarity_flip_physical{168.0}=0x0 -phy_chain_tx_polarity_flip_physical{169.0}=0x0 -phy_chain_tx_polarity_flip_physical{17.0}=0x0 -phy_chain_tx_polarity_flip_physical{170.0}=0x1 -phy_chain_tx_polarity_flip_physical{171.0}=0x1 -phy_chain_tx_polarity_flip_physical{172.0}=0x1 -phy_chain_tx_polarity_flip_physical{173.0}=0x0 -phy_chain_tx_polarity_flip_physical{174.0}=0x0 -phy_chain_tx_polarity_flip_physical{175.0}=0x1 -phy_chain_tx_polarity_flip_physical{176.0}=0x0 -phy_chain_tx_polarity_flip_physical{177.0}=0x1 -phy_chain_tx_polarity_flip_physical{178.0}=0x0 -phy_chain_tx_polarity_flip_physical{179.0}=0x0 -phy_chain_tx_polarity_flip_physical{18.0}=0x1 -phy_chain_tx_polarity_flip_physical{180.0}=0x0 -phy_chain_tx_polarity_flip_physical{181.0}=0x0 -phy_chain_tx_polarity_flip_physical{182.0}=0x0 -phy_chain_tx_polarity_flip_physical{183.0}=0x0 -phy_chain_tx_polarity_flip_physical{184.0}=0x1 -phy_chain_tx_polarity_flip_physical{185.0}=0x0 -phy_chain_tx_polarity_flip_physical{186.0}=0x1 -phy_chain_tx_polarity_flip_physical{187.0}=0x1 -phy_chain_tx_polarity_flip_physical{188.0}=0x1 -phy_chain_tx_polarity_flip_physical{189.0}=0x0 -phy_chain_tx_polarity_flip_physical{19.0}=0x1 -phy_chain_tx_polarity_flip_physical{190.0}=0x0 -phy_chain_tx_polarity_flip_physical{191.0}=0x0 -phy_chain_tx_polarity_flip_physical{192.0}=0x0 -phy_chain_tx_polarity_flip_physical{193.0}=0x1 -phy_chain_tx_polarity_flip_physical{194.0}=0x1 -phy_chain_tx_polarity_flip_physical{195.0}=0x1 -phy_chain_tx_polarity_flip_physical{196.0}=0x0 -phy_chain_tx_polarity_flip_physical{197.0}=0x0 -phy_chain_tx_polarity_flip_physical{198.0}=0x1 -phy_chain_tx_polarity_flip_physical{199.0}=0x1 -phy_chain_tx_polarity_flip_physical{2.0}=0x1 -phy_chain_tx_polarity_flip_physical{20.0}=0x1 -phy_chain_tx_polarity_flip_physical{200.0}=0x1 -phy_chain_tx_polarity_flip_physical{201.0}=0x1 -phy_chain_tx_polarity_flip_physical{202.0}=0x1 -phy_chain_tx_polarity_flip_physical{203.0}=0x1 -phy_chain_tx_polarity_flip_physical{204.0}=0x1 -phy_chain_tx_polarity_flip_physical{205.0}=0x0 -phy_chain_tx_polarity_flip_physical{206.0}=0x1 -phy_chain_tx_polarity_flip_physical{207.0}=0x1 -phy_chain_tx_polarity_flip_physical{208.0}=0x1 -phy_chain_tx_polarity_flip_physical{209.0}=0x1 -phy_chain_tx_polarity_flip_physical{21.0}=0x0 -phy_chain_tx_polarity_flip_physical{210.0}=0x1 -phy_chain_tx_polarity_flip_physical{211.0}=0x1 -phy_chain_tx_polarity_flip_physical{212.0}=0x0 -phy_chain_tx_polarity_flip_physical{213.0}=0x0 -phy_chain_tx_polarity_flip_physical{214.0}=0x1 -phy_chain_tx_polarity_flip_physical{215.0}=0x0 -phy_chain_tx_polarity_flip_physical{216.0}=0x1 -phy_chain_tx_polarity_flip_physical{217.0}=0x1 -phy_chain_tx_polarity_flip_physical{218.0}=0x1 -phy_chain_tx_polarity_flip_physical{219.0}=0x0 -phy_chain_tx_polarity_flip_physical{22.0}=0x0 -phy_chain_tx_polarity_flip_physical{220.0}=0x1 -phy_chain_tx_polarity_flip_physical{221.0}=0x0 -phy_chain_tx_polarity_flip_physical{222.0}=0x0 -phy_chain_tx_polarity_flip_physical{223.0}=0x0 -phy_chain_tx_polarity_flip_physical{224.0}=0x1 -phy_chain_tx_polarity_flip_physical{225.0}=0x1 -phy_chain_tx_polarity_flip_physical{226.0}=0x1 -phy_chain_tx_polarity_flip_physical{227.0}=0x1 -phy_chain_tx_polarity_flip_physical{228.0}=0x0 -phy_chain_tx_polarity_flip_physical{229.0}=0x0 -phy_chain_tx_polarity_flip_physical{23.0}=0x0 -phy_chain_tx_polarity_flip_physical{230.0}=0x1 -phy_chain_tx_polarity_flip_physical{231.0}=0x1 -phy_chain_tx_polarity_flip_physical{232.0}=0x1 -phy_chain_tx_polarity_flip_physical{233.0}=0x0 -phy_chain_tx_polarity_flip_physical{234.0}=0x0 -phy_chain_tx_polarity_flip_physical{235.0}=0x0 -phy_chain_tx_polarity_flip_physical{236.0}=0x0 -phy_chain_tx_polarity_flip_physical{237.0}=0x1 -phy_chain_tx_polarity_flip_physical{238.0}=0x1 -phy_chain_tx_polarity_flip_physical{239.0}=0x1 -phy_chain_tx_polarity_flip_physical{24.0}=0x0 -phy_chain_tx_polarity_flip_physical{240.0}=0x0 -phy_chain_tx_polarity_flip_physical{241.0}=0x1 -phy_chain_tx_polarity_flip_physical{242.0}=0x1 -phy_chain_tx_polarity_flip_physical{243.0}=0x1 -phy_chain_tx_polarity_flip_physical{244.0}=0x0 -phy_chain_tx_polarity_flip_physical{245.0}=0x1 -phy_chain_tx_polarity_flip_physical{246.0}=0x1 -phy_chain_tx_polarity_flip_physical{247.0}=0x1 -phy_chain_tx_polarity_flip_physical{248.0}=0x1 -phy_chain_tx_polarity_flip_physical{249.0}=0x1 -phy_chain_tx_polarity_flip_physical{25.0}=0x1 -phy_chain_tx_polarity_flip_physical{250.0}=0x0 -phy_chain_tx_polarity_flip_physical{251.0}=0x0 -phy_chain_tx_polarity_flip_physical{252.0}=0x0 -phy_chain_tx_polarity_flip_physical{253.0}=0x1 -phy_chain_tx_polarity_flip_physical{254.0}=0x1 -phy_chain_tx_polarity_flip_physical{255.0}=0x1 -phy_chain_tx_polarity_flip_physical{256.0}=0x0 -phy_chain_tx_polarity_flip_physical{257.0}=0x0 -phy_chain_tx_polarity_flip_physical{259.0}=0x0 -phy_chain_tx_polarity_flip_physical{26.0}=0x0 -phy_chain_tx_polarity_flip_physical{27.0}=0x0 -phy_chain_tx_polarity_flip_physical{28.0}=0x0 -phy_chain_tx_polarity_flip_physical{29.0}=0x1 -phy_chain_tx_polarity_flip_physical{3.0}=0x1 -phy_chain_tx_polarity_flip_physical{30.0}=0x1 -phy_chain_tx_polarity_flip_physical{31.0}=0x1 -phy_chain_tx_polarity_flip_physical{32.0}=0x0 -phy_chain_tx_polarity_flip_physical{33.0}=0x0 -phy_chain_tx_polarity_flip_physical{34.0}=0x0 -phy_chain_tx_polarity_flip_physical{35.0}=0x0 -phy_chain_tx_polarity_flip_physical{36.0}=0x1 -phy_chain_tx_polarity_flip_physical{37.0}=0x1 -phy_chain_tx_polarity_flip_physical{38.0}=0x1 -phy_chain_tx_polarity_flip_physical{39.0}=0x1 -phy_chain_tx_polarity_flip_physical{4.0}=0x1 -phy_chain_tx_polarity_flip_physical{40.0}=0x0 -phy_chain_tx_polarity_flip_physical{41.0}=0x0 -phy_chain_tx_polarity_flip_physical{42.0}=0x0 -phy_chain_tx_polarity_flip_physical{43.0}=0x0 -phy_chain_tx_polarity_flip_physical{44.0}=0x0 -phy_chain_tx_polarity_flip_physical{45.0}=0x1 -phy_chain_tx_polarity_flip_physical{46.0}=0x0 -phy_chain_tx_polarity_flip_physical{47.0}=0x1 -phy_chain_tx_polarity_flip_physical{48.0}=0x1 -phy_chain_tx_polarity_flip_physical{49.0}=0x0 -phy_chain_tx_polarity_flip_physical{5.0}=0x1 -phy_chain_tx_polarity_flip_physical{50.0}=0x0 -phy_chain_tx_polarity_flip_physical{51.0}=0x0 -phy_chain_tx_polarity_flip_physical{52.0}=0x1 -phy_chain_tx_polarity_flip_physical{53.0}=0x0 -phy_chain_tx_polarity_flip_physical{54.0}=0x1 -phy_chain_tx_polarity_flip_physical{55.0}=0x1 -phy_chain_tx_polarity_flip_physical{56.0}=0x0 -phy_chain_tx_polarity_flip_physical{57.0}=0x0 -phy_chain_tx_polarity_flip_physical{58.0}=0x1 -phy_chain_tx_polarity_flip_physical{59.0}=0x1 -phy_chain_tx_polarity_flip_physical{6.0}=0x1 -phy_chain_tx_polarity_flip_physical{60.0}=0x1 -phy_chain_tx_polarity_flip_physical{61.0}=0x0 -phy_chain_tx_polarity_flip_physical{62.0}=0x1 -phy_chain_tx_polarity_flip_physical{63.0}=0x1 -phy_chain_tx_polarity_flip_physical{64.0}=0x1 -phy_chain_tx_polarity_flip_physical{65.0}=0x0 -phy_chain_tx_polarity_flip_physical{66.0}=0x1 -phy_chain_tx_polarity_flip_physical{67.0}=0x1 -phy_chain_tx_polarity_flip_physical{68.0}=0x0 -phy_chain_tx_polarity_flip_physical{69.0}=0x1 -phy_chain_tx_polarity_flip_physical{7.0}=0x1 -phy_chain_tx_polarity_flip_physical{70.0}=0x1 -phy_chain_tx_polarity_flip_physical{71.0}=0x1 -phy_chain_tx_polarity_flip_physical{72.0}=0x0 -phy_chain_tx_polarity_flip_physical{73.0}=0x1 -phy_chain_tx_polarity_flip_physical{74.0}=0x0 -phy_chain_tx_polarity_flip_physical{75.0}=0x0 -phy_chain_tx_polarity_flip_physical{76.0}=0x0 -phy_chain_tx_polarity_flip_physical{77.0}=0x0 -phy_chain_tx_polarity_flip_physical{78.0}=0x0 -phy_chain_tx_polarity_flip_physical{79.0}=0x1 -phy_chain_tx_polarity_flip_physical{8.0}=0x0 -phy_chain_tx_polarity_flip_physical{80.0}=0x0 -phy_chain_tx_polarity_flip_physical{81.0}=0x1 -phy_chain_tx_polarity_flip_physical{82.0}=0x1 -phy_chain_tx_polarity_flip_physical{83.0}=0x1 -phy_chain_tx_polarity_flip_physical{84.0}=0x0 -phy_chain_tx_polarity_flip_physical{85.0}=0x1 -phy_chain_tx_polarity_flip_physical{86.0}=0x0 -phy_chain_tx_polarity_flip_physical{87.0}=0x0 -phy_chain_tx_polarity_flip_physical{88.0}=0x0 -phy_chain_tx_polarity_flip_physical{89.0}=0x1 -phy_chain_tx_polarity_flip_physical{9.0}=0x0 -phy_chain_tx_polarity_flip_physical{90.0}=0x1 -phy_chain_tx_polarity_flip_physical{91.0}=0x1 -phy_chain_tx_polarity_flip_physical{92.0}=0x0 -phy_chain_tx_polarity_flip_physical{93.0}=0x0 -phy_chain_tx_polarity_flip_physical{94.0}=0x0 -phy_chain_tx_polarity_flip_physical{95.0}=0x0 -phy_chain_tx_polarity_flip_physical{96.0}=0x0 -phy_chain_tx_polarity_flip_physical{97.0}=0x0 -phy_chain_tx_polarity_flip_physical{98.0}=0x1 -phy_chain_tx_polarity_flip_physical{99.0}=0x1 -port_init_autoneg_100=0 -port_init_autoneg_102=0 -port_init_autoneg_103=0 -port_init_autoneg_104=0 -port_init_autoneg_105=0 -port_init_autoneg_106=0 -port_init_autoneg_107=0 -port_init_autoneg_108=0 -port_init_autoneg_109=0 -port_init_autoneg_10=0 -port_init_autoneg_110=0 -port_init_autoneg_111=0 -port_init_autoneg_112=0 -port_init_autoneg_113=0 -port_init_autoneg_114=0 -port_init_autoneg_115=0 -port_init_autoneg_116=0 -port_init_autoneg_117=0 -port_init_autoneg_11=0 -port_init_autoneg_12=0 -port_init_autoneg_13=0 -port_init_autoneg_14=0 -port_init_autoneg_15=0 -port_init_autoneg_16=0 -port_init_autoneg_1=0 -port_init_autoneg_2=0 -port_init_autoneg_34=0 -port_init_autoneg_35=0 -port_init_autoneg_36=0 -port_init_autoneg_37=0 -port_init_autoneg_38=0 -port_init_autoneg_39=0 -port_init_autoneg_3=0 -port_init_autoneg_40=0 -port_init_autoneg_41=0 -port_init_autoneg_42=0 -port_init_autoneg_43=0 -port_init_autoneg_44=0 -port_init_autoneg_45=0 -port_init_autoneg_46=0 -port_init_autoneg_47=0 -port_init_autoneg_48=0 -port_init_autoneg_49=0 -port_init_autoneg_4=0 -port_init_autoneg_5=0 -port_init_autoneg_66=0 -port_init_autoneg_68=0 -port_init_autoneg_69=0 -port_init_autoneg_6=0 -port_init_autoneg_70=0 -port_init_autoneg_71=0 -port_init_autoneg_72=0 -port_init_autoneg_73=0 -port_init_autoneg_74=0 -port_init_autoneg_75=0 -port_init_autoneg_76=0 -port_init_autoneg_77=0 -port_init_autoneg_78=0 -port_init_autoneg_79=0 -port_init_autoneg_7=0 -port_init_autoneg_80=0 -port_init_autoneg_81=0 -port_init_autoneg_82=0 -port_init_autoneg_83=0 -port_init_autoneg_8=0 -port_init_autoneg_9=0 -port_init_cl72_hg=1 -port_phy_addr_100=0xff -port_phy_addr_102=0xff -port_phy_addr_103=0xff -port_phy_addr_104=0xff -port_phy_addr_105=0xff -port_phy_addr_106=0xff -port_phy_addr_107=0xff -port_phy_addr_108=0xff -port_phy_addr_109=0xff -port_phy_addr_10=0xff -port_phy_addr_110=0xff -port_phy_addr_111=0xff -port_phy_addr_112=0xff -port_phy_addr_113=0xff -port_phy_addr_114=0xff -port_phy_addr_115=0xff -port_phy_addr_116=0xff -port_phy_addr_117=0xff -port_phy_addr_11=0xff -port_phy_addr_12=0xff -port_phy_addr_13=0xff -port_phy_addr_14=0xff -port_phy_addr_15=0xff -port_phy_addr_16=0xff -port_phy_addr_1=0xff -port_phy_addr_2=0xff -port_phy_addr_34=0xff -port_phy_addr_35=0xff -port_phy_addr_36=0xff -port_phy_addr_37=0xff -port_phy_addr_38=0xff -port_phy_addr_39=0xff -port_phy_addr_3=0xff -port_phy_addr_40=0xff -port_phy_addr_41=0xff -port_phy_addr_42=0xff -port_phy_addr_43=0xff -port_phy_addr_44=0xff -port_phy_addr_45=0xff -port_phy_addr_46=0xff -port_phy_addr_47=0xff -port_phy_addr_48=0xff -port_phy_addr_49=0xff -port_phy_addr_4=0xff -port_phy_addr_5=0xff -port_phy_addr_66=0xff -port_phy_addr_68=0xff -port_phy_addr_69=0xff -port_phy_addr_6=0xff -port_phy_addr_70=0xff -port_phy_addr_71=0xff -port_phy_addr_72=0xff -port_phy_addr_73=0xff -port_phy_addr_74=0xff -port_phy_addr_75=0xff -port_phy_addr_76=0xff -port_phy_addr_77=0xff -port_phy_addr_78=0xff -port_phy_addr_79=0xff -port_phy_addr_7=0xff -port_phy_addr_80=0xff -port_phy_addr_81=0xff -port_phy_addr_82=0xff -port_phy_addr_83=0xff -port_phy_addr_8=0xff -port_phy_addr_9=0xff -portmap_100=259:10 -portmap_101=262:10 -portmap_102=217:40 -portmap_103=213:40 -portmap_104=229:40 -portmap_105=237:40 -portmap_106=249:40 -portmap_107=245:40 -portmap_108=209:40 -portmap_109=221:40 -portmap_10=29:40 -portmap_110=233:40 -portmap_111=225:40 -portmap_112=241:40 -portmap_113=253:40 -portmap_114=197:40 -portmap_115=205:40 -portmap_116=201:40 -portmap_117=193:40 -portmap_11=41:40 -portmap_12=33:40 -portmap_134=263:10 -portmap_13=57:40 -portmap_14=53:40 -portmap_15=49:40 -portmap_16=61:40 -portmap_1=5:40 -portmap_2=13:40 -portmap_33=260:10 -portmap_34=77:40 -portmap_35=65:40 -portmap_36=85:40 -portmap_37=89:40 -portmap_38=109:40 -portmap_39=97:40 -portmap_3=25:40 -portmap_40=69:40 -portmap_41=73:40 -portmap_42=93:40 -portmap_43=81:40 -portmap_44=101:40 -portmap_45=105:40 -portmap_46=117:40 -portmap_47=121:40 -portmap_48=125:40 -portmap_49=113:40 -portmap_4=21:40 -portmap_5=37:40 -portmap_66=257:10 -portmap_67=261:10 -portmap_68=149:40 -portmap_69=153:40 -portmap_6=45:40 -portmap_70=173:40 -portmap_71=161:40 -portmap_72=181:40 -portmap_73=185:40 -portmap_74=157:40 -portmap_75=145:40 -portmap_76=165:40 -portmap_77=169:40 -portmap_78=189:40 -portmap_79=177:40 -portmap_7=9:40 -portmap_80=141:40 -portmap_81=133:40 -portmap_82=129:40 -portmap_83=137:40 -portmap_8=1:40 -portmap_9=17:40 -robust_hash_disable_egress_vlan=1 -robust_hash_disable_mpls=1 -robust_hash_disable_vlan=1 -stable_size=0x5500000 -stable_size=0x5500000 -tdma_timeout_usec=15000000 -tslam_timeout_usec=15000000 - -# tuning parameters -serdes_preemphasis_1=0x105004 -serdes_preemphasis_2=0x105004 -serdes_preemphasis_3=0x105004 -serdes_preemphasis_4=0x105004 -serdes_preemphasis_5=0x105004 -serdes_preemphasis_6=0x105004 -serdes_preemphasis_7=0x105004 -serdes_preemphasis_8=0x105004 -serdes_preemphasis_9=0x105004 -serdes_preemphasis_10=0x105004 -serdes_preemphasis_11=0x105004 -serdes_preemphasis_12=0x105004 -serdes_preemphasis_13=0x71f01 -serdes_preemphasis_14=0x72101 -serdes_preemphasis_15=0x105004 -serdes_preemphasis_16=0x105004 -serdes_preemphasis_34=0x105004 -serdes_preemphasis_35=0x105004 -serdes_preemphasis_36=0x105004 -serdes_preemphasis_37=0x105004 -serdes_preemphasis_38=0x105004 -serdes_preemphasis_39=0x105004 -serdes_preemphasis_40=0x105004 -serdes_preemphasis_41=0x105004 -serdes_preemphasis_42=0x105004 -serdes_preemphasis_43=0x105004 -serdes_preemphasis_44=0x105004 -serdes_preemphasis_45=0x105004 -serdes_preemphasis_46=0x61d01 -serdes_preemphasis_47=0x51a01 -serdes_preemphasis_48=0x105004 -serdes_preemphasis_49=0x105004 -serdes_preemphasis_66=0x43004 -serdes_preemphasis_68=0x105004 -serdes_preemphasis_69=0x105004 -serdes_preemphasis_70=0x105004 -serdes_preemphasis_71=0x105004 -serdes_preemphasis_72=0x105004 -serdes_preemphasis_73=0x105004 -serdes_preemphasis_74=0x105004 -serdes_preemphasis_75=0x105004 -serdes_preemphasis_76=0x105004 -serdes_preemphasis_77=0x105004 -serdes_preemphasis_78=0x105004 -serdes_preemphasis_79=0x105004 -serdes_preemphasis_80=0x61d01 -serdes_preemphasis_81=0x51b01 -serdes_preemphasis_82=0x105004 -serdes_preemphasis_83=0x105004 -serdes_preemphasis_100=0x43004 -serdes_preemphasis_102=0x105004 -serdes_preemphasis_103=0x105004 -serdes_preemphasis_104=0x105004 -serdes_preemphasis_105=0x105004 -serdes_preemphasis_106=0x105004 -serdes_preemphasis_107=0x105004 -serdes_preemphasis_108=0x105004 -serdes_preemphasis_109=0x105004 -serdes_preemphasis_110=0x105004 -serdes_preemphasis_111=0x105004 -serdes_preemphasis_112=0x105004 -serdes_preemphasis_113=0x105004 -serdes_preemphasis_114=0x61c01 -serdes_preemphasis_115=0x61c01 -serdes_preemphasis_116=0x105004 -serdes_preemphasis_117=0x105004 - -mmu_init_config="MSFT-TH2-Tier0" diff --git a/device/arista/x86_64-arista_7260cx3_64/pcie.yaml b/device/arista/x86_64-arista_7260cx3_64/pcie.yaml new file mode 100644 index 000000000000..1889a4f1eef6 --- /dev/null +++ b/device/arista/x86_64-arista_7260cx3_64/pcie.yaml @@ -0,0 +1,420 @@ +- bus: '00' + dev: '00' + fn: '0' + id: 6f00 + name: 'Host bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D DMI2 + (rev 03)' +- bus: '00' + dev: '01' + fn: '0' + id: 6f02 + name: 'PCI bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D PCI + Express Root Port 1 (rev 03)' +- bus: '00' + dev: '01' + fn: '1' + id: 6f03 + name: 'PCI bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D PCI + Express Root Port 1 (rev 03)' +- bus: '00' + dev: '02' + fn: '0' + id: 6f04 + name: 'PCI bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D PCI + Express Root Port 2 (rev 03)' +- bus: '00' + dev: '02' + fn: '2' + id: 6f06 + name: 'PCI bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D PCI + Express Root Port 2 (rev 03)' +- bus: '00' + dev: '03' + fn: '0' + id: 6f08 + name: 'PCI bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D PCI + Express Root Port 3 (rev 03)' +- bus: '00' + dev: '05' + fn: '0' + id: 6f28 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Map/VTd_Misc/System Management (rev 03)' +- bus: '00' + dev: '05' + fn: '1' + id: 6f29 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D IIO Hot Plug (rev 03)' +- bus: '00' + dev: '05' + fn: '2' + id: 6f2a + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D IIO RAS/Control Status/Global Errors (rev 03)' +- bus: '00' + dev: '05' + fn: '4' + id: 6f2c + name: 'PIC: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D I/O APIC (rev + 03)' +- bus: '00' + dev: '14' + fn: '0' + id: 8c31 + name: 'USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB + xHCI (rev 05)' +- bus: '00' + dev: 1c + fn: '0' + id: 8c10 + name: 'PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express + Root Port #1 (rev d5)' +- bus: '00' + dev: 1c + fn: '4' + id: 8c18 + name: 'PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express + Root Port #5 (rev d5)' +- bus: '00' + dev: 1f + fn: '0' + id: 8c54 + name: 'ISA bridge: Intel Corporation C224 Series Chipset Family Server Standard + SKU LPC Controller (rev 05)' +- bus: '00' + dev: 1f + fn: '2' + id: 8c02 + name: 'SATA controller: Intel Corporation 8 Series/C220 Series Chipset Family 6-port + SATA Controller 1 [AHCI mode] (rev 05)' +- bus: '00' + dev: 1f + fn: '3' + id: 8c22 + name: 'SMBus: Intel Corporation 8 Series/C220 Series Chipset Family SMBus Controller + (rev 05)' +- bus: '00' + dev: 1f + fn: '6' + id: 8c24 + name: 'Signal processing controller: Intel Corporation 8 Series Chipset Family Thermal + Management Controller (rev 05)' +- bus: '02' + dev: '00' + fn: '0' + id: '1682' + name: 'Ethernet controller: Broadcom Limited NetXtreme BCM57762 Gigabit Ethernet + PCIe (rev 20)' +- bus: '03' + dev: '00' + fn: '0' + id: 6f50 + name: 'System peripheral: Intel Corporation Xeon Processor D Family QuickData Technology + Register DMA Channel 0' +- bus: '03' + dev: '00' + fn: '1' + id: 6f51 + name: 'System peripheral: Intel Corporation Xeon Processor D Family QuickData Technology + Register DMA Channel 1' +- bus: '03' + dev: '00' + fn: '2' + id: 6f52 + name: 'System peripheral: Intel Corporation Xeon Processor D Family QuickData Technology + Register DMA Channel 2' +- bus: '03' + dev: '00' + fn: '3' + id: 6f53 + name: 'System peripheral: Intel Corporation Xeon Processor D Family QuickData Technology + Register DMA Channel 3' +- bus: '04' + dev: '00' + fn: '0' + id: 15a7 + name: 'Ethernet controller: Intel Corporation Device 15a7' +- bus: '04' + dev: '00' + fn: '1' + id: 15a7 + name: 'Ethernet controller: Intel Corporation Device 15a7' +- bus: '06' + dev: '00' + fn: '0' + id: '0001' + name: 'System peripheral: Arastra Inc. Device 0001 (rev 01)' +- bus: '07' + dev: '00' + fn: '0' + id: b971 + name: 'Ethernet controller: Broadcom Limited Device b971 (rev 11)' +- bus: '07' + dev: '00' + fn: '1' + id: b971 + name: 'Ethernet controller: Broadcom Limited Device b971 (rev 11)' +- bus: ff + dev: 0b + fn: '0' + id: 6f81 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D R3 QPI Link 0/1 (rev 03)' +- bus: ff + dev: 0b + fn: '1' + id: 6f36 + name: 'Performance counters: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D R3 QPI Link 0/1 (rev 03)' +- bus: ff + dev: 0b + fn: '2' + id: 6f37 + name: 'Performance counters: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D R3 QPI Link 0/1 (rev 03)' +- bus: ff + dev: 0b + fn: '3' + id: '0001' + name: 'System peripheral: Arastra Inc. Device 0001 (rev 03)' +- bus: ff + dev: 0c + fn: '0' + id: 6fe0 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: ff + dev: 0c + fn: '1' + id: 6fe1 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: ff + dev: 0f + fn: '0' + id: 6ff8 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: ff + dev: 0f + fn: '4' + id: 6ffc + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: ff + dev: 0f + fn: '5' + id: 6ffd + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: ff + dev: 0f + fn: '6' + id: 6ffe + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: ff + dev: '10' + fn: '0' + id: 6f1d + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D R2PCIe Agent (rev 03)' +- bus: ff + dev: '10' + fn: '1' + id: 6f34 + name: 'Performance counters: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D R2PCIe Agent (rev 03)' +- bus: ff + dev: '10' + fn: '5' + id: 6f1e + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Ubox (rev 03)' +- bus: ff + dev: '10' + fn: '6' + id: 6f7d + name: 'Performance counters: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Ubox (rev 03)' +- bus: ff + dev: '10' + fn: '7' + id: 6f1f + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Ubox (rev 03)' +- bus: ff + dev: '12' + fn: '0' + id: 6fa0 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Home Agent 0 (rev 03)' +- bus: ff + dev: '12' + fn: '1' + id: 6f30 + name: 'Performance counters: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Home Agent 0 (rev 03)' +- bus: ff + dev: '13' + fn: '0' + id: 6fa8 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Target Address/Thermal/RAS (rev 03)' +- bus: ff + dev: '13' + fn: '1' + id: 6f71 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Target Address/Thermal/RAS (rev 03)' +- bus: ff + dev: '13' + fn: '2' + id: 6faa + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel Target Address Decoder (rev 03)' +- bus: ff + dev: '13' + fn: '3' + id: 6fab + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel Target Address Decoder (rev 03)' +- bus: ff + dev: '13' + fn: '4' + id: 6fac + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel Target Address Decoder (rev 03)' +- bus: ff + dev: '13' + fn: '5' + id: 6fad + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel Target Address Decoder (rev 03)' +- bus: ff + dev: '13' + fn: '6' + id: 6fae + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D DDRIO Channel 0/1 Broadcast (rev 03)' +- bus: ff + dev: '13' + fn: '7' + id: 6faf + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D DDRIO Global Broadcast (rev 03)' +- bus: ff + dev: '14' + fn: '0' + id: 6fb0 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 0 Thermal Control (rev 03)' +- bus: ff + dev: '14' + fn: '1' + id: 6fb1 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 1 Thermal Control (rev 03)' +- bus: ff + dev: '14' + fn: '2' + id: 6fb2 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 0 Error (rev 03)' +- bus: ff + dev: '14' + fn: '3' + id: 6fb3 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 1 Error (rev 03)' +- bus: ff + dev: '14' + fn: '4' + id: 6fbc + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D DDRIO Channel 0/1 Interface (rev 03)' +- bus: ff + dev: '14' + fn: '5' + id: 6fbd + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D DDRIO Channel 0/1 Interface (rev 03)' +- bus: ff + dev: '14' + fn: '6' + id: 6fbe + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D DDRIO Channel 0/1 Interface (rev 03)' +- bus: ff + dev: '14' + fn: '7' + id: 6fbf + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D DDRIO Channel 0/1 Interface (rev 03)' +- bus: ff + dev: '15' + fn: '0' + id: 6fb4 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 2 Thermal Control (rev 03)' +- bus: ff + dev: '15' + fn: '1' + id: 6fb5 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 3 Thermal Control (rev 03)' +- bus: ff + dev: '15' + fn: '2' + id: 6fb6 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 2 Error (rev 03)' +- bus: ff + dev: '15' + fn: '3' + id: 6fb7 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 3 Error (rev 03)' +- bus: ff + dev: 1e + fn: '0' + id: 6f98 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Power Control Unit (rev 03)' +- bus: ff + dev: 1e + fn: '1' + id: 6f99 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Power Control Unit (rev 03)' +- bus: ff + dev: 1e + fn: '2' + id: 6f9a + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Power Control Unit (rev 03)' +- bus: ff + dev: 1e + fn: '3' + id: 6fc0 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Power Control Unit (rev 03)' +- bus: ff + dev: 1e + fn: '4' + id: 6f9c + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Power Control Unit (rev 03)' +- bus: ff + dev: 1f + fn: '0' + id: 6f88 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Power Control Unit (rev 03)' +- bus: ff + dev: 1f + fn: '2' + id: 6f8a + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Power Control Unit (rev 03)' diff --git a/device/arista/x86_64-arista_7260cx3_64/plugins/pcie.yaml b/device/arista/x86_64-arista_7260cx3_64/plugins/pcie.yaml deleted file mode 100644 index a2540013703e..000000000000 --- a/device/arista/x86_64-arista_7260cx3_64/plugins/pcie.yaml +++ /dev/null @@ -1,426 +0,0 @@ -- bus: '00' - dev: '00' - fn: '0' - id: 6f00 - name: 'Host bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D DMI2 - (rev 03)' -- bus: '00' - dev: '01' - fn: '0' - id: 6f02 - name: 'PCI bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D PCI - Express Root Port 1 (rev 03)' -- bus: '00' - dev: '01' - fn: '1' - id: 6f03 - name: 'PCI bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D PCI - Express Root Port 1 (rev 03)' -- bus: '00' - dev: '02' - fn: '0' - id: 6f04 - name: 'PCI bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D PCI - Express Root Port 2 (rev 03)' -- bus: '00' - dev: '02' - fn: '2' - id: 6f06 - name: 'PCI bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D PCI - Express Root Port 2 (rev 03)' -- bus: '00' - dev: '03' - fn: '0' - id: 6f08 - name: 'PCI bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D PCI - Express Root Port 3 (rev 03)' -- bus: '00' - dev: '05' - fn: '0' - id: 6f28 - name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon - D Map/VTd_Misc/System Management (rev 03)' -- bus: '00' - dev: '05' - fn: '1' - id: 6f29 - name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon - D IIO Hot Plug (rev 03)' -- bus: '00' - dev: '05' - fn: '2' - id: 6f2a - name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon - D IIO RAS/Control Status/Global Errors (rev 03)' -- bus: '00' - dev: '05' - fn: '4' - id: 6f2c - name: 'PIC: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D I/O APIC (rev - 03)' -- bus: '00' - dev: '14' - fn: '0' - id: 8c31 - name: 'USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB - xHCI (rev 05)' -- bus: '00' - dev: 1c - fn: '0' - id: 8c10 - name: 'PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express - Root Port #1 (rev d5)' -- bus: '00' - dev: 1c - fn: '4' - id: 8c18 - name: 'PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express - Root Port #5 (rev d5)' -- bus: '00' - dev: 1f - fn: '0' - id: 8c54 - name: 'ISA bridge: Intel Corporation C224 Series Chipset Family Server Standard - SKU LPC Controller (rev 05)' -- bus: '00' - dev: 1f - fn: '2' - id: 8c02 - name: 'SATA controller: Intel Corporation 8 Series/C220 Series Chipset Family 6-port - SATA Controller 1 [AHCI mode] (rev 05)' -- bus: '00' - dev: 1f - fn: '3' - id: 8c22 - name: 'SMBus: Intel Corporation 8 Series/C220 Series Chipset Family SMBus Controller - (rev 05)' -- bus: '00' - dev: 1f - fn: '6' - id: 8c24 - name: 'Signal processing controller: Intel Corporation 8 Series Chipset Family Thermal - Management Controller (rev 05)' -- bus: '01' - dev: '00' - fn: '0' - id: '1682' - name: 'Ethernet controller: Broadcom Limited NetXtreme BCM57762 Gigabit Ethernet - PCIe (rev 20)' -- bus: '02' - dev: '00' - fn: '0' - id: '1682' - name: 'Ethernet controller: Broadcom Limited NetXtreme BCM57762 Gigabit Ethernet - PCIe (rev 20)' -- bus: '03' - dev: '00' - fn: '0' - id: 6f50 - name: 'System peripheral: Intel Corporation Xeon Processor D Family QuickData Technology - Register DMA Channel 0' -- bus: '03' - dev: '00' - fn: '1' - id: 6f51 - name: 'System peripheral: Intel Corporation Xeon Processor D Family QuickData Technology - Register DMA Channel 1' -- bus: '03' - dev: '00' - fn: '2' - id: 6f52 - name: 'System peripheral: Intel Corporation Xeon Processor D Family QuickData Technology - Register DMA Channel 2' -- bus: '03' - dev: '00' - fn: '3' - id: 6f53 - name: 'System peripheral: Intel Corporation Xeon Processor D Family QuickData Technology - Register DMA Channel 3' -- bus: '04' - dev: '00' - fn: '0' - id: 15a7 - name: 'Ethernet controller: Intel Corporation Device 15a7' -- bus: '04' - dev: '00' - fn: '1' - id: 15a7 - name: 'Ethernet controller: Intel Corporation Device 15a7' -- bus: '06' - dev: '00' - fn: '0' - id: '0001' - name: 'System peripheral: Arastra Inc. Device 0001 (rev 01)' -- bus: '07' - dev: '00' - fn: '0' - id: b971 - name: 'Ethernet controller: Broadcom Limited Device b971 (rev 11)' -- bus: '07' - dev: '00' - fn: '1' - id: b971 - name: 'Ethernet controller: Broadcom Limited Device b971 (rev 11)' -- bus: ff - dev: 0b - fn: '0' - id: 6f81 - name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon - D R3 QPI Link 0/1 (rev 03)' -- bus: ff - dev: 0b - fn: '1' - id: 6f36 - name: 'Performance counters: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon - D R3 QPI Link 0/1 (rev 03)' -- bus: ff - dev: 0b - fn: '2' - id: 6f37 - name: 'Performance counters: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon - D R3 QPI Link 0/1 (rev 03)' -- bus: ff - dev: 0b - fn: '3' - id: '0001' - name: 'System peripheral: Arastra Inc. Device 0001 (rev 03)' -- bus: ff - dev: 0c - fn: '0' - id: 6fe0 - name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon - D Caching Agent (rev 03)' -- bus: ff - dev: 0c - fn: '1' - id: 6fe1 - name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon - D Caching Agent (rev 03)' -- bus: ff - dev: 0f - fn: '0' - id: 6ff8 - name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon - D Caching Agent (rev 03)' -- bus: ff - dev: 0f - fn: '4' - id: 6ffc - name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon - D Caching Agent (rev 03)' -- bus: ff - dev: 0f - fn: '5' - id: 6ffd - name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon - D Caching Agent (rev 03)' -- bus: ff - dev: 0f - fn: '6' - id: 6ffe - name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon - D Caching Agent (rev 03)' -- bus: ff - dev: '10' - fn: '0' - id: 6f1d - name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon - D R2PCIe Agent (rev 03)' -- bus: ff - dev: '10' - fn: '1' - id: 6f34 - name: 'Performance counters: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon - D R2PCIe Agent (rev 03)' -- bus: ff - dev: '10' - fn: '5' - id: 6f1e - name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon - D Ubox (rev 03)' -- bus: ff - dev: '10' - fn: '6' - id: 6f7d - name: 'Performance counters: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon - D Ubox (rev 03)' -- bus: ff - dev: '10' - fn: '7' - id: 6f1f - name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon - D Ubox (rev 03)' -- bus: ff - dev: '12' - fn: '0' - id: 6fa0 - name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon - D Home Agent 0 (rev 03)' -- bus: ff - dev: '12' - fn: '1' - id: 6f30 - name: 'Performance counters: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon - D Home Agent 0 (rev 03)' -- bus: ff - dev: '13' - fn: '0' - id: 6fa8 - name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon - D Memory Controller 0 - Target Address/Thermal/RAS (rev 03)' -- bus: ff - dev: '13' - fn: '1' - id: 6f71 - name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon - D Memory Controller 0 - Target Address/Thermal/RAS (rev 03)' -- bus: ff - dev: '13' - fn: '2' - id: 6faa - name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon - D Memory Controller 0 - Channel Target Address Decoder (rev 03)' -- bus: ff - dev: '13' - fn: '3' - id: 6fab - name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon - D Memory Controller 0 - Channel Target Address Decoder (rev 03)' -- bus: ff - dev: '13' - fn: '4' - id: 6fac - name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon - D Memory Controller 0 - Channel Target Address Decoder (rev 03)' -- bus: ff - dev: '13' - fn: '5' - id: 6fad - name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon - D Memory Controller 0 - Channel Target Address Decoder (rev 03)' -- bus: ff - dev: '13' - fn: '6' - id: 6fae - name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon - D DDRIO Channel 0/1 Broadcast (rev 03)' -- bus: ff - dev: '13' - fn: '7' - id: 6faf - name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon - D DDRIO Global Broadcast (rev 03)' -- bus: ff - dev: '14' - fn: '0' - id: 6fb0 - name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon - D Memory Controller 0 - Channel 0 Thermal Control (rev 03)' -- bus: ff - dev: '14' - fn: '1' - id: 6fb1 - name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon - D Memory Controller 0 - Channel 1 Thermal Control (rev 03)' -- bus: ff - dev: '14' - fn: '2' - id: 6fb2 - name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon - D Memory Controller 0 - Channel 0 Error (rev 03)' -- bus: ff - dev: '14' - fn: '3' - id: 6fb3 - name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon - D Memory Controller 0 - Channel 1 Error (rev 03)' -- bus: ff - dev: '14' - fn: '4' - id: 6fbc - name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon - D DDRIO Channel 0/1 Interface (rev 03)' -- bus: ff - dev: '14' - fn: '5' - id: 6fbd - name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon - D DDRIO Channel 0/1 Interface (rev 03)' -- bus: ff - dev: '14' - fn: '6' - id: 6fbe - name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon - D DDRIO Channel 0/1 Interface (rev 03)' -- bus: ff - dev: '14' - fn: '7' - id: 6fbf - name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon - D DDRIO Channel 0/1 Interface (rev 03)' -- bus: ff - dev: '15' - fn: '0' - id: 6fb4 - name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon - D Memory Controller 0 - Channel 2 Thermal Control (rev 03)' -- bus: ff - dev: '15' - fn: '1' - id: 6fb5 - name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon - D Memory Controller 0 - Channel 3 Thermal Control (rev 03)' -- bus: ff - dev: '15' - fn: '2' - id: 6fb6 - name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon - D Memory Controller 0 - Channel 2 Error (rev 03)' -- bus: ff - dev: '15' - fn: '3' - id: 6fb7 - name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon - D Memory Controller 0 - Channel 3 Error (rev 03)' -- bus: ff - dev: 1e - fn: '0' - id: 6f98 - name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon - D Power Control Unit (rev 03)' -- bus: ff - dev: 1e - fn: '1' - id: 6f99 - name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon - D Power Control Unit (rev 03)' -- bus: ff - dev: 1e - fn: '2' - id: 6f9a - name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon - D Power Control Unit (rev 03)' -- bus: ff - dev: 1e - fn: '3' - id: 6fc0 - name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon - D Power Control Unit (rev 03)' -- bus: ff - dev: 1e - fn: '4' - id: 6f9c - name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon - D Power Control Unit (rev 03)' -- bus: ff - dev: 1f - fn: '0' - id: 6f88 - name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon - D Power Control Unit (rev 03)' -- bus: ff - dev: 1f - fn: '2' - id: 6f8a - name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon - D Power Control Unit (rev 03)' diff --git a/device/arista/x86_64-arista_7280cr3_32d4/Arista-7280CR3-C40/jr2-a7280cr3-32d4-40x100G.config.bcm b/device/arista/x86_64-arista_7280cr3_32d4/Arista-7280CR3-C40/jr2-a7280cr3-32d4-40x100G.config.bcm index 4467d5d033ce..4e9d02fdc821 100644 --- a/device/arista/x86_64-arista_7280cr3_32d4/Arista-7280CR3-C40/jr2-a7280cr3-32d4-40x100G.config.bcm +++ b/device/arista/x86_64-arista_7280cr3_32d4/Arista-7280CR3-C40/jr2-a7280cr3-32d4-40x100G.config.bcm @@ -135,13 +135,13 @@ tm_port_header_type_in_203.BCM8869X=INJECTED_2_PP tm_port_header_type_out_203.BCM8869X=ETH sat_enable.BCM8869X=1 -tm_port_header_type_out_218.BCM8869X=CPU -tm_port_header_type_in_218.BCM8869X=INJECTED_2 +tm_port_header_type_out_210.BCM8869X=CPU +tm_port_header_type_in_210.BCM8869X=INJECTED_2 -tm_port_header_type_in_232.BCM8869X=INJECTED_2 -tm_port_header_type_out_232.BCM8869X=CPU -tm_port_header_type_in_233.BCM8869X=INJECTED_2 -tm_port_header_type_out_233.BCM8869X=CPU +tm_port_header_type_in_211.BCM8869X=INJECTED_2 +tm_port_header_type_out_211.BCM8869X=CPU +tm_port_header_type_in_212.BCM8869X=INJECTED_2 +tm_port_header_type_out_212.BCM8869X=CPU tm_port_header_type_in_240.BCM8869X=INJECTED_2 tm_port_header_type_out_240.BCM8869X=RAW diff --git a/device/arista/x86_64-arista_7280cr3_32p4/Arista-7280CR3-C28S8/jr2-a7280cr3-32p4-28x100G-8x10G.config.bcm b/device/arista/x86_64-arista_7280cr3_32p4/Arista-7280CR3-C28S8/jr2-a7280cr3-32p4-28x100G-8x10G.config.bcm index 3d89e2b41b4a..541e26302dc0 100644 --- a/device/arista/x86_64-arista_7280cr3_32p4/Arista-7280CR3-C28S8/jr2-a7280cr3-32p4-28x100G-8x10G.config.bcm +++ b/device/arista/x86_64-arista_7280cr3_32p4/Arista-7280CR3-C28S8/jr2-a7280cr3-32p4-28x100G-8x10G.config.bcm @@ -131,13 +131,13 @@ tm_port_header_type_in_203.BCM8869X=INJECTED_2_PP tm_port_header_type_out_203.BCM8869X=ETH sat_enable.BCM8869X=1 -tm_port_header_type_out_218.BCM8869X=CPU -tm_port_header_type_in_218.BCM8869X=INJECTED_2 +tm_port_header_type_out_210.BCM8869X=CPU +tm_port_header_type_in_210.BCM8869X=INJECTED_2 -tm_port_header_type_in_232.BCM8869X=INJECTED_2 -tm_port_header_type_out_232.BCM8869X=CPU -tm_port_header_type_in_233.BCM8869X=INJECTED_2 -tm_port_header_type_out_233.BCM8869X=CPU +tm_port_header_type_in_211.BCM8869X=INJECTED_2 +tm_port_header_type_out_211.BCM8869X=CPU +tm_port_header_type_in_212.BCM8869X=INJECTED_2 +tm_port_header_type_out_212.BCM8869X=CPU tm_port_header_type_in_240.BCM8869X=INJECTED_2 tm_port_header_type_out_240.BCM8869X=RAW diff --git a/device/arista/x86_64-arista_7280cr3_32p4/Arista-7280CR3-C40/jr2-a7280cr3-32p4-40x100G.config.bcm b/device/arista/x86_64-arista_7280cr3_32p4/Arista-7280CR3-C40/jr2-a7280cr3-32p4-40x100G.config.bcm index 654a4d8f158f..ca3c266eadfc 100644 --- a/device/arista/x86_64-arista_7280cr3_32p4/Arista-7280CR3-C40/jr2-a7280cr3-32p4-40x100G.config.bcm +++ b/device/arista/x86_64-arista_7280cr3_32p4/Arista-7280CR3-C40/jr2-a7280cr3-32p4-40x100G.config.bcm @@ -108,7 +108,7 @@ ucode_port_139.BCM8869X=RCY_MIRROR.19:core_1.139 port_priorities.BCM8869X=8 -ucode_port_240.BCM8869X=OLP:core_0.240 +ucode_port_213.BCM8869X=OLP:core_0.213 sw_state_max_size.BCM8869X=750000000 @@ -135,16 +135,16 @@ tm_port_header_type_in_203.BCM8869X=INJECTED_2_PP tm_port_header_type_out_203.BCM8869X=ETH sat_enable.BCM8869X=1 -tm_port_header_type_out_218.BCM8869X=CPU -tm_port_header_type_in_218.BCM8869X=INJECTED_2 +tm_port_header_type_out_210.BCM8869X=CPU +tm_port_header_type_in_210.BCM8869X=INJECTED_2 -tm_port_header_type_in_232.BCM8869X=INJECTED_2 -tm_port_header_type_out_232.BCM8869X=CPU -tm_port_header_type_in_233.BCM8869X=INJECTED_2 -tm_port_header_type_out_233.BCM8869X=CPU +tm_port_header_type_in_211.BCM8869X=INJECTED_2 +tm_port_header_type_out_211.BCM8869X=CPU +tm_port_header_type_in_212.BCM8869X=INJECTED_2 +tm_port_header_type_out_212.BCM8869X=CPU -tm_port_header_type_in_240.BCM8869X=INJECTED_2 -tm_port_header_type_out_240.BCM8869X=RAW +tm_port_header_type_in_213.BCM8869X=INJECTED_2 +tm_port_header_type_out_213.BCM8869X=RAW dtm_flow_mapping_mode_region_64.BCM8869X=3 dtm_flow_mapping_mode_region_65.BCM8869X=3 diff --git a/device/arista/x86_64-arista_7280cr3mk_32d4 b/device/arista/x86_64-arista_7280cr3mk_32d4 new file mode 120000 index 000000000000..50478132d933 --- /dev/null +++ b/device/arista/x86_64-arista_7280cr3mk_32d4 @@ -0,0 +1 @@ +x86_64-arista_7280cr3_32d4 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7280cr3mk_32p4 b/device/arista/x86_64-arista_7280cr3mk_32p4 new file mode 120000 index 000000000000..d6e2ddbb64bd --- /dev/null +++ b/device/arista/x86_64-arista_7280cr3mk_32p4 @@ -0,0 +1 @@ +x86_64-arista_7280cr3_32p4 \ No newline at end of file diff --git a/device/arista/x86_64-arista_7800_sup/plugins b/device/arista/x86_64-arista_7800_sup/plugins deleted file mode 120000 index 789a45fcace9..000000000000 --- a/device/arista/x86_64-arista_7800_sup/plugins +++ /dev/null @@ -1 +0,0 @@ -../x86_64-arista_common/plugins \ No newline at end of file diff --git a/device/arista/x86_64-arista_7800_sup/plugins/eeprom.py b/device/arista/x86_64-arista_7800_sup/plugins/eeprom.py new file mode 120000 index 000000000000..35cfaff3de4e --- /dev/null +++ b/device/arista/x86_64-arista_7800_sup/plugins/eeprom.py @@ -0,0 +1 @@ +../../x86_64-arista_common/plugins/eeprom.py \ No newline at end of file diff --git a/device/arista/x86_64-arista_7800_sup/plugins/led_control.py b/device/arista/x86_64-arista_7800_sup/plugins/led_control.py new file mode 120000 index 000000000000..8d733780117e --- /dev/null +++ b/device/arista/x86_64-arista_7800_sup/plugins/led_control.py @@ -0,0 +1 @@ +../../x86_64-arista_common/plugins/led_control.py \ No newline at end of file diff --git a/device/arista/x86_64-arista_7800_sup/plugins/psuutil.py b/device/arista/x86_64-arista_7800_sup/plugins/psuutil.py new file mode 120000 index 000000000000..2b0024ade969 --- /dev/null +++ b/device/arista/x86_64-arista_7800_sup/plugins/psuutil.py @@ -0,0 +1 @@ +../../x86_64-arista_common/plugins/psuutil.py \ No newline at end of file diff --git a/device/arista/x86_64-arista_7800_sup/plugins/sfputil.py b/device/arista/x86_64-arista_7800_sup/plugins/sfputil.py new file mode 120000 index 000000000000..c333e23763d7 --- /dev/null +++ b/device/arista/x86_64-arista_7800_sup/plugins/sfputil.py @@ -0,0 +1 @@ +../../x86_64-arista_common/plugins/sfputil.py \ No newline at end of file diff --git a/device/arista/x86_64-arista_7800_sup/plugins/udevprefix.conf b/device/arista/x86_64-arista_7800_sup/plugins/udevprefix.conf new file mode 100644 index 000000000000..e2f2966c864d --- /dev/null +++ b/device/arista/x86_64-arista_7800_sup/plugins/udevprefix.conf @@ -0,0 +1 @@ +ttySCD \ No newline at end of file diff --git a/device/arista/x86_64-arista_common/system_health_monitoring_config.json b/device/arista/x86_64-arista_common/system_health_monitoring_config.json index 1733fcffdba3..5ceec23fd26f 100644 --- a/device/arista/x86_64-arista_common/system_health_monitoring_config.json +++ b/device/arista/x86_64-arista_common/system_health_monitoring_config.json @@ -9,8 +9,8 @@ "user_defined_checkers": [], "polling_interval": 60, "led_color": { - "fault": "orange", + "fault": "amber", "normal": "green", - "booting": "orange_blink" + "booting": "amber_blink" } } diff --git a/platform/barefoot/sonic-platform-modules-bfn-newport/plugins/pcie.yaml b/device/barefoot/x86_64-accton_as9516_32d-r0/pcie.yaml similarity index 100% rename from platform/barefoot/sonic-platform-modules-bfn-newport/plugins/pcie.yaml rename to device/barefoot/x86_64-accton_as9516_32d-r0/pcie.yaml diff --git a/device/barefoot/x86_64-accton_as9516_32d-r0/platform_components.json b/device/barefoot/x86_64-accton_as9516_32d-r0/platform_components.json new file mode 100644 index 000000000000..43874566a3ad --- /dev/null +++ b/device/barefoot/x86_64-accton_as9516_32d-r0/platform_components.json @@ -0,0 +1,8 @@ +{ + "chassis": { + "Newport": { + "component": { + } + } + } +} \ No newline at end of file diff --git a/device/barefoot/x86_64-accton_as9516_32d-r0/pmon_daemon_control.json b/device/barefoot/x86_64-accton_as9516_32d-r0/pmon_daemon_control.json index c4573af5e93d..1059cddb4fa2 100644 --- a/device/barefoot/x86_64-accton_as9516_32d-r0/pmon_daemon_control.json +++ b/device/barefoot/x86_64-accton_as9516_32d-r0/pmon_daemon_control.json @@ -1,9 +1,9 @@ { "skip_pcied": false, "skip_fancontrol": true, - "skip_thermalctld": true, + "skip_thermalctld": false, "skip_ledd": true, "skip_xcvrd": false, - "skip_psud": false, + "skip_psud": true, "skip_syseepromd": false } diff --git a/device/barefoot/x86_64-accton_wedge100bf_32x-r0/montara/hwsku.json b/device/barefoot/x86_64-accton_wedge100bf_32x-r0/montara/hwsku.json new file mode 100644 index 000000000000..a253fa3bd480 --- /dev/null +++ b/device/barefoot/x86_64-accton_wedge100bf_32x-r0/montara/hwsku.json @@ -0,0 +1,164 @@ +{ + "interfaces": { + "Ethernet0": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet4": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet8": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet12": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet16": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet20": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet24": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet28": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet32": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet36": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet40": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet44": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet48": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet52": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet56": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet60": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet64": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet68": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet72": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet76": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet80": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet84": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet88": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet92": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet96": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet100": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet104": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet108": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet112": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet116": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet120": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet124": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + } + } +} diff --git a/platform/barefoot/sonic-platform-modules-bfn-montara/plugins/pcie.yaml b/device/barefoot/x86_64-accton_wedge100bf_32x-r0/pcie.yaml similarity index 100% rename from platform/barefoot/sonic-platform-modules-bfn-montara/plugins/pcie.yaml rename to device/barefoot/x86_64-accton_wedge100bf_32x-r0/pcie.yaml diff --git a/device/barefoot/x86_64-accton_wedge100bf_32x-r0/platform.json b/device/barefoot/x86_64-accton_wedge100bf_32x-r0/platform.json new file mode 100644 index 000000000000..6a9779b120ed --- /dev/null +++ b/device/barefoot/x86_64-accton_wedge100bf_32x-r0/platform.json @@ -0,0 +1,401 @@ +{ + "chassis": { + "name": "Wedge100BF-32X-O-AC-F-BF", + "fans": [ + { + "name": "counter-rotating-fan-1" + }, + { + "name": "counter-rotating-fan-2" + }, + { + "name": "counter-rotating-fan-3" + }, + { + "name": "counter-rotating-fan-4" + }, + { + "name": "counter-rotating-fan-5" + } + ], + "fan_drawers":[ + { + "name": "fantray", + "num_fans" : 5, + "fans": [ + { + "name": "counter-rotating-fan-1" + }, + { + "name": "counter-rotating-fan-2" + }, + { + "name": "counter-rotating-fan-3" + }, + { + "name": "counter-rotating-fan-4" + }, + { + "name": "counter-rotating-fan-5" + } + ] + } + ], + "psus": [ + { + "name": "PSU 1" + }, + { + "name": "PSU 2" + } + ], + "thermals": [ + { + "name": "com_e_driver-i2c-4-33:memory-temp" + }, + { + "name": "com_e_driver-i2c-4-33:cpu-temp" + }, + { + "name": "pfe1100-i2c-7-59:temp1" + }, + { + "name": "pfe1100-i2c-7-59:temp2" + }, + { + "name": "pfe1100-i2c-7-5a:temp1" + }, + { + "name": "pfe1100-i2c-7-5a:temp2" + }, + { + "name": "tmp75-i2c-3-48:outlet-middle-temp" + }, + { + "name": "tmp75-i2c-3-49:inlet-middle-temp" + }, + { + "name": "tmp75-i2c-3-4a:inlet-left-temp" + }, + { + "name": "tmp75-i2c-3-4b:switch-temp" + }, + { + "name": "tmp75-i2c-3-4c:inlet-right-temp" + }, + { + "name": "tmp75-i2c-8-48:outlet-right-temp" + }, + { + "name": "tmp75-i2c-8-49:outlet-left-temp" + }, + { + "name": "coretemp-isa-0000:package-id-0" + }, + { + "name": "coretemp-isa-0000:core-0" + }, + { + "name": "coretemp-isa-0000:core-1" + }, + { + "name": "coretemp-isa-0000:core-2" + }, + { + "name": "coretemp-isa-0000:core-3" + } + ], + "sfps": [ + { + "name": "Ethernet0" + }, + { + "name": "Ethernet4" + }, + { + "name": "Ethernet8" + }, + { + "name": "Ethernet12" + }, + { + "name": "Ethernet16" + }, + { + "name": "Ethernet20" + }, + { + "name": "Ethernet24" + }, + { + "name": "Ethernet28" + }, + { + "name": "Ethernet32" + }, + { + "name": "Ethernet36" + }, + { + "name": "Ethernet40" + }, + { + "name": "Ethernet44" + }, + { + "name": "Ethernet48" + }, + { + "name": "Ethernet52" + }, + { + "name": "Ethernet56" + }, + { + "name": "Ethernet60" + }, + { + "name": "Ethernet64" + }, + { + "name": "Ethernet68" + }, + { + "name": "Ethernet72" + }, + { + "name": "Ethernet76" + }, + { + "name": "Ethernet80" + }, + { + "name": "Ethernet84" + }, + { + "name": "Ethernet88" + }, + { + "name": "Ethernet92" + }, + { + "name": "Ethernet96" + }, + { + "name": "Ethernet100" + }, + { + "name": "Ethernet104" + }, + { + "name": "Ethernet108" + }, + { + "name": "Ethernet112" + }, + { + "name": "Ethernet116" + }, + { + "name": "Ethernet120" + }, + { + "name": "Ethernet124" + } + ] + }, + "interfaces": { + "Ethernet0": { + "index": "1,1,1,1", + "lanes": "0,1,2,3", + "alias_at_lanes": "Ethernet0,Ethernet1,Ethernet2,Ethernet3", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet4": { + "index": "2,2,2,2", + "lanes": "4,5,6,7", + "alias_at_lanes": "Ethernet4,Ethernet5,Ethernet6,Ethernet7", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet8": { + "index": "3,3,3,3", + "lanes": "8,9,10,11", + "alias_at_lanes": "Ethernet8,Ethernet9,Ethernet10,Ethernet11", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet12": { + "index": "4,4,4,4", + "lanes": "12,13,14,15", + "alias_at_lanes": "Ethernet12,Ethernet13,Ethernet14,Ethernet15", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet16": { + "index": "5,5,5,5", + "lanes": "16,17,18,19", + "alias_at_lanes": "Ethernet16,Ethernet17,Ethernet18,Ethernet19", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet20": { + "index": "6,6,6,6", + "lanes": "20,21,22,23", + "alias_at_lanes": "Ethernet20,Ethernet21,Ethernet22,Ethernet23", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet24": { + "index": "7,7,7,7", + "lanes": "24,25,26,27", + "alias_at_lanes": "Ethernet24,Ethernet25,Ethernet26,Ethernet27", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet28": { + "index": "8,8,8,8", + "lanes": "28,29,30,31", + "alias_at_lanes": "Ethernet28,Ethernet29,Ethernet30,Ethernet31", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet32": { + "index": "9,9,9,9", + "lanes": "32,33,34,35", + "alias_at_lanes": "Ethernet32,Ethernet33,Ethernet34,Ethernet35", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet36": { + "index": "10,10,10,10", + "lanes": "36,37,38,39", + "alias_at_lanes": "Ethernet36,Ethernet37,Ethernet38,Ethernet39", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet40": { + "index": "11,11,11,11", + "lanes": "40,41,42,43", + "alias_at_lanes": "Ethernet40,Ethernet41,Ethernet42,Ethernet43", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet44": { + "index": "12,12,12,12", + "lanes": "44,45,46,47", + "alias_at_lanes": "Ethernet44,Ethernet45,Ethernet46,Ethernet47", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet48": { + "index": "13,13,13,13", + "lanes": "48,49,50,51", + "alias_at_lanes": "Ethernet48,Ethernet49,Ethernet50,Ethernet51", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet52": { + "index": "14,14,14,14", + "lanes": "52,53,54,55", + "alias_at_lanes": "Ethernet52,Ethernet53,Ethernet54,Ethernet55", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet56": { + "index": "15,15,15,15", + "lanes": "56,57,58,59", + "alias_at_lanes": "Ethernet56,Ethernet57,Ethernet58,Ethernet59", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet60": { + "index": "16,16,16,16", + "lanes": "60,61,62,63", + "alias_at_lanes": "Ethernet60,Ethernet61,Ethernet62,Ethernet63", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet64": { + "index": "17,17,17,17", + "lanes": "64,65,66,67", + "alias_at_lanes": "Ethernet64,Ethernet65,Ethernet66,Ethernet67", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet68": { + "index": "18,18,18,18", + "lanes": "68,69,70,71", + "alias_at_lanes": "Ethernet68,Ethernet69,Ethernet70,Ethernet71", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet72": { + "index": "19,19,19,19", + "lanes": "72,73,74,75", + "alias_at_lanes": "Ethernet72,Ethernet73,Ethernet74,Ethernet75", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet76": { + "index": "20,20,20,20", + "lanes": "76,77,78,79", + "alias_at_lanes": "Ethernet76,Ethernet77,Ethernet78,Ethernet79", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet80": { + "index": "21,21,21,21", + "lanes": "80,81,82,83", + "alias_at_lanes": "Ethernet80,Ethernet81,Ethernet82,Ethernet83", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet84": { + "index": "22,22,22,22", + "lanes": "84,85,86,87", + "alias_at_lanes": "Ethernet84,Ethernet85,Ethernet86,Ethernet87", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet88": { + "index": "23,23,23,23", + "lanes": "88,89,90,91", + "alias_at_lanes": "Ethernet88,Ethernet89,Ethernet90,Ethernet91", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet92": { + "index": "24,24,24,24", + "lanes": "92,93,94,95", + "alias_at_lanes": "Ethernet92,Ethernet93,Ethernet94,Ethernet95", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet96": { + "index": "25,25,25,25", + "lanes": "96,97,98,99", + "alias_at_lanes": "Ethernet96,Ethernet97,Ethernet98,Ethernet99", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet100": { + "index": "26,26,26,26", + "lanes": "100,101,102,103", + "alias_at_lanes": "Ethernet100,Ethernet101,Ethernet102,Ethernet103", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet104": { + "index": "27,27,27,27", + "lanes": "104,105,106,107", + "alias_at_lanes": "Ethernet104,Ethernet105,Ethernet106,Ethernet107", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet108": { + "index": "28,28,28,28", + "lanes": "108,109,110,111", + "alias_at_lanes": "Ethernet108,Ethernet109,Ethernet110,Ethernet111", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet112": { + "index": "29,29,29,29", + "lanes": "112,113,114,115", + "alias_at_lanes": "Ethernet112,Ethernet113,Ethernet114,Ethernet115", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet116": { + "index": "30,30,30,30", + "lanes": "116,117,118,119", + "alias_at_lanes": "Ethernet116,Ethernet117,Ethernet118,Ethernet119", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet120": { + "index": "31,31,31,31", + "lanes": "120,121,122,123", + "alias_at_lanes": "Ethernet120,Ethernet121,Ethernet122,Ethernet123", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet124": { + "index": "32,32,32,32", + "lanes": "124,125,126,127", + "alias_at_lanes": "Ethernet124,Ethernet125,Ethernet126,Ethernet127", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + } + } +} diff --git a/device/barefoot/x86_64-accton_wedge100bf_32x-r0/platform_components.json b/device/barefoot/x86_64-accton_wedge100bf_32x-r0/platform_components.json new file mode 100644 index 000000000000..df77fa3e1bf9 --- /dev/null +++ b/device/barefoot/x86_64-accton_wedge100bf_32x-r0/platform_components.json @@ -0,0 +1,8 @@ +{ + "chassis": { + "Wedge100BF-32X-O-AC-F-BF": { + "component": { + } + } + } +} \ No newline at end of file diff --git a/device/barefoot/x86_64-accton_wedge100bf_32x-r0/plugins/sfputil.py b/device/barefoot/x86_64-accton_wedge100bf_32x-r0/plugins/sfputil.py index 47d875432cc5..41d75501f491 100644 --- a/device/barefoot/x86_64-accton_wedge100bf_32x-r0/plugins/sfputil.py +++ b/device/barefoot/x86_64-accton_wedge100bf_32x-r0/plugins/sfputil.py @@ -160,7 +160,7 @@ def reset(self, port_num): status = pltfm_mgr.pltfm_mgr_qsfp_reset(port_num, True) status = pltfm_mgr.pltfm_mgr_qsfp_reset(port_num, False) self.thrift_teardown() - return status + return (status == 0) def check_transceiver_change(self): if not self.ready: diff --git a/device/barefoot/x86_64-accton_wedge100bf_32x-r0/pmon_daemon_control.json b/device/barefoot/x86_64-accton_wedge100bf_32x-r0/pmon_daemon_control.json index 70bce43bbf67..b58e59ba000c 100644 --- a/device/barefoot/x86_64-accton_wedge100bf_32x-r0/pmon_daemon_control.json +++ b/device/barefoot/x86_64-accton_wedge100bf_32x-r0/pmon_daemon_control.json @@ -1,7 +1,7 @@ { "skip_pcied": false, "skip_fancontrol": true, - "skip_thermalctld": true, + "skip_thermalctld": false, "skip_ledd": true, "skip_xcvrd": false, "skip_psud": false, diff --git a/device/barefoot/x86_64-accton_wedge100bf_65x-r0/mavericks/hwsku.json b/device/barefoot/x86_64-accton_wedge100bf_65x-r0/mavericks/hwsku.json new file mode 100644 index 000000000000..857b00852c0b --- /dev/null +++ b/device/barefoot/x86_64-accton_wedge100bf_65x-r0/mavericks/hwsku.json @@ -0,0 +1,329 @@ +{ + "interfaces": { + "Ethernet0": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet4": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet8": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet12": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet16": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet20": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet24": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet28": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet32": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet36": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet40": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet44": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet48": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet52": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet56": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet60": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet64": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet68": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet72": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet76": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet80": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet84": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet88": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet92": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet96": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet100": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet104": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet108": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet112": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet116": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet120": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet124": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet128": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet132": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet136": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet140": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet144": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet148": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet152": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet156": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet160": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet164": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet168": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet172": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet176": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet180": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet184": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet188": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet192": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet196": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet200": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet204": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet208": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet212": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet216": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet220": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet224": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet228": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet232": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet236": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet240": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet244": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet248": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet252": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "rs" + }, + "Ethernet256": { + "default_brkout_mode": "1x100G[40G]", + "autoneg": "0", + "fec": "none" + } + } +} diff --git a/device/barefoot/x86_64-accton_wedge100bf_65x-r0/pcie.yaml b/device/barefoot/x86_64-accton_wedge100bf_65x-r0/pcie.yaml new file mode 100644 index 000000000000..52035fa8df81 --- /dev/null +++ b/device/barefoot/x86_64-accton_wedge100bf_65x-r0/pcie.yaml @@ -0,0 +1,412 @@ +- bus: '00' + dev: '00' + fn: '0' + id: 6f00 + name: 'Host bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D DMI2 + (rev 03)' +- bus: '00' + dev: '01' + fn: '0' + id: 6f02 + name: 'PCI bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D PCI + Express Root Port 1 (rev 03)' +- bus: '00' + dev: '01' + fn: '1' + id: 6f03 + name: 'PCI bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D PCI + Express Root Port 1 (rev 03)' +- bus: '00' + dev: '02' + fn: '0' + id: 6f04 + name: 'PCI bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D PCI + Express Root Port 2 (rev 03)' +- bus: '00' + dev: '02' + fn: '2' + id: 6f06 + name: 'PCI bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D PCI + Express Root Port 2 (rev 03)' +- bus: '00' + dev: '03' + fn: '0' + id: 6f08 + name: 'PCI bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D PCI + Express Root Port 3 (rev 03)' +- bus: '00' + dev: '05' + fn: '0' + id: 6f28 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Map/VTd_Misc/System Management (rev 03)' +- bus: '00' + dev: '05' + fn: '1' + id: 6f29 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D IIO Hot Plug (rev 03)' +- bus: '00' + dev: '05' + fn: '2' + id: 6f2a + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D IIO RAS/Control Status/Global Errors (rev 03)' +- bus: '00' + dev: '05' + fn: '4' + id: 6f2c + name: 'PIC: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D I/O APIC (rev + 03)' +- bus: '00' + dev: '16' + fn: '0' + id: 8c3a + name: 'Communication controller: Intel Corporation 8 Series/C220 Series Chipset + Family MEI Controller #1 (rev 04)' +- bus: '00' + dev: '16' + fn: '1' + id: 8c3b + name: 'Communication controller: Intel Corporation 8 Series/C220 Series Chipset + Family MEI Controller #2 (rev 04)' +- bus: '00' + dev: 1d + fn: '0' + id: 8c26 + name: 'USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB + EHCI #1 (rev 05)' +- bus: '00' + dev: 1f + fn: '0' + id: 8c54 + name: 'ISA bridge: Intel Corporation C224 Series Chipset Family Server Standard + SKU LPC Controller (rev 05)' +- bus: '00' + dev: 1f + fn: '2' + id: 8c02 + name: 'SATA controller: Intel Corporation 8 Series/C220 Series Chipset Family 6-port + SATA Controller 1 [AHCI mode] (rev 05)' +- bus: '00' + dev: 1f + fn: '3' + id: 8c22 + name: 'SMBus: Intel Corporation 8 Series/C220 Series Chipset Family SMBus Controller + (rev 05)' +- bus: '02' + dev: '00' + fn: '0' + id: '1533' + name: 'Ethernet controller: Intel Corporation I210 Gigabit Network Connection (rev + 03)' +- bus: '03' + dev: '00' + fn: '0' + id: 6f50 + name: 'System peripheral: Intel Corporation Xeon Processor D Family QuickData Technology + Register DMA Channel 0' +- bus: '03' + dev: '00' + fn: '1' + id: 6f51 + name: 'System peripheral: Intel Corporation Xeon Processor D Family QuickData Technology + Register DMA Channel 1' +- bus: '03' + dev: '00' + fn: '2' + id: 6f52 + name: 'System peripheral: Intel Corporation Xeon Processor D Family QuickData Technology + Register DMA Channel 2' +- bus: '03' + dev: '00' + fn: '3' + id: 6f53 + name: 'System peripheral: Intel Corporation Xeon Processor D Family QuickData Technology + Register DMA Channel 3' +- bus: '04' + dev: '00' + fn: '0' + id: 10a6 + name: 'Unassigned class [ff00]: Intel Corporation 82599EB 10-Gigabit Dummy Function' +- bus: '05' + dev: '00' + fn: '0' + id: '0010' + name: 'Unassigned class [ff00]: Device 1d1c:0010 (rev 10)' +- bus: ff + dev: 0b + fn: '0' + id: 6f81 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D R3 QPI Link 0/1 (rev 03)' +- bus: ff + dev: 0b + fn: '1' + id: 6f36 + name: 'Performance counters: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D R3 QPI Link 0/1 (rev 03)' +- bus: ff + dev: 0b + fn: '2' + id: 6f37 + name: 'Performance counters: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D R3 QPI Link 0/1 (rev 03)' +- bus: ff + dev: 0b + fn: '3' + id: 6f76 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D R3 QPI Link Debug (rev 03)' +- bus: ff + dev: 0c + fn: '0' + id: 6fe0 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: ff + dev: 0c + fn: '1' + id: 6fe1 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: ff + dev: 0c + fn: '2' + id: 6fe2 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: ff + dev: 0c + fn: '3' + id: 6fe3 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: ff + dev: 0f + fn: '0' + id: 6ff8 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: ff + dev: 0f + fn: '4' + id: 6ffc + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: ff + dev: 0f + fn: '5' + id: 6ffd + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: ff + dev: 0f + fn: '6' + id: 6ffe + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: ff + dev: '10' + fn: '0' + id: 6f1d + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D R2PCIe Agent (rev 03)' +- bus: ff + dev: '10' + fn: '1' + id: 6f34 + name: 'Performance counters: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D R2PCIe Agent (rev 03)' +- bus: ff + dev: '10' + fn: '5' + id: 6f1e + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Ubox (rev 03)' +- bus: ff + dev: '10' + fn: '6' + id: 6f7d + name: 'Performance counters: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Ubox (rev 03)' +- bus: ff + dev: '10' + fn: '7' + id: 6f1f + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Ubox (rev 03)' +- bus: ff + dev: '12' + fn: '0' + id: 6fa0 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Home Agent 0 (rev 03)' +- bus: ff + dev: '12' + fn: '1' + id: 6f30 + name: 'Performance counters: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Home Agent 0 (rev 03)' +- bus: ff + dev: '13' + fn: '0' + id: 6fa8 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Target Address/Thermal/RAS (rev 03)' +- bus: ff + dev: '13' + fn: '1' + id: 6f71 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Target Address/Thermal/RAS (rev 03)' +- bus: ff + dev: '13' + fn: '2' + id: 6faa + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel Target Address Decoder (rev 03)' +- bus: ff + dev: '13' + fn: '3' + id: 6fab + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel Target Address Decoder (rev 03)' +- bus: ff + dev: '13' + fn: '4' + id: 6fac + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel Target Address Decoder (rev 03)' +- bus: ff + dev: '13' + fn: '5' + id: 6fad + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel Target Address Decoder (rev 03)' +- bus: ff + dev: '13' + fn: '6' + id: 6fae + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D DDRIO Channel 0/1 Broadcast (rev 03)' +- bus: ff + dev: '13' + fn: '7' + id: 6faf + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D DDRIO Global Broadcast (rev 03)' +- bus: ff + dev: '14' + fn: '0' + id: 6fb0 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 0 Thermal Control (rev 03)' +- bus: ff + dev: '14' + fn: '1' + id: 6fb1 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 1 Thermal Control (rev 03)' +- bus: ff + dev: '14' + fn: '2' + id: 6fb2 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 0 Error (rev 03)' +- bus: ff + dev: '14' + fn: '3' + id: 6fb3 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 1 Error (rev 03)' +- bus: ff + dev: '14' + fn: '4' + id: 6fbc + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D DDRIO Channel 0/1 Interface (rev 03)' +- bus: ff + dev: '14' + fn: '5' + id: 6fbd + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D DDRIO Channel 0/1 Interface (rev 03)' +- bus: ff + dev: '14' + fn: '6' + id: 6fbe + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D DDRIO Channel 0/1 Interface (rev 03)' +- bus: ff + dev: '14' + fn: '7' + id: 6fbf + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D DDRIO Channel 0/1 Interface (rev 03)' +- bus: ff + dev: '15' + fn: '0' + id: 6fb4 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 2 Thermal Control (rev 03)' +- bus: ff + dev: '15' + fn: '1' + id: 6fb5 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 3 Thermal Control (rev 03)' +- bus: ff + dev: '15' + fn: '2' + id: 6fb6 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 2 Error (rev 03)' +- bus: ff + dev: '15' + fn: '3' + id: 6fb7 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 3 Error (rev 03)' +- bus: ff + dev: 1e + fn: '0' + id: 6f98 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Power Control Unit (rev 03)' +- bus: ff + dev: 1e + fn: '1' + id: 6f99 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Power Control Unit (rev 03)' +- bus: ff + dev: 1e + fn: '2' + id: 6f9a + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Power Control Unit (rev 03)' +- bus: ff + dev: 1e + fn: '3' + id: 6fc0 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Power Control Unit (rev 03)' +- bus: ff + dev: 1e + fn: '4' + id: 6f9c + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Power Control Unit (rev 03)' +- bus: ff + dev: 1f + fn: '0' + id: 6f88 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Power Control Unit (rev 03)' +- bus: ff + dev: 1f + fn: '2' + id: 6f8a + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Power Control Unit (rev 03)' diff --git a/device/barefoot/x86_64-accton_wedge100bf_65x-r0/platform.json b/device/barefoot/x86_64-accton_wedge100bf_65x-r0/platform.json new file mode 100644 index 000000000000..866706a28357 --- /dev/null +++ b/device/barefoot/x86_64-accton_wedge100bf_65x-r0/platform.json @@ -0,0 +1,394 @@ +{ + "interfaces": { + "Ethernet0": { + "index": "1,1,1,1", + "lanes": "0,1,2,3", + "alias_at_lanes": "Ethernet0,Ethernet1,Ethernet2,Ethernet3", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet4": { + "index": "2,2,2,2", + "lanes": "4,5,6,7", + "alias_at_lanes": "Ethernet4,Ethernet5,Ethernet6,Ethernet7", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet8": { + "index": "3,3,3,3", + "lanes": "8,9,10,11", + "alias_at_lanes": "Ethernet8,Ethernet9,Ethernet10,Ethernet11", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet12": { + "index": "4,4,4,4", + "lanes": "12,13,14,15", + "alias_at_lanes": "Ethernet12,Ethernet13,Ethernet14,Ethernet15", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet16": { + "index": "5,5,5,5", + "lanes": "16,17,18,19", + "alias_at_lanes": "Ethernet16,Ethernet17,Ethernet18,Ethernet19", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet20": { + "index": "6,6,6,6", + "lanes": "20,21,22,23", + "alias_at_lanes": "Ethernet20,Ethernet21,Ethernet22,Ethernet23", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet24": { + "index": "7,7,7,7", + "lanes": "24,25,26,27", + "alias_at_lanes": "Ethernet24,Ethernet25,Ethernet26,Ethernet27", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet28": { + "index": "8,8,8,8", + "lanes": "28,29,30,31", + "alias_at_lanes": "Ethernet28,Ethernet29,Ethernet30,Ethernet31", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet32": { + "index": "9,9,9,9", + "lanes": "32,33,34,35", + "alias_at_lanes": "Ethernet32,Ethernet33,Ethernet34,Ethernet35", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet36": { + "index": "10,10,10,10", + "lanes": "36,37,38,39", + "alias_at_lanes": "Ethernet36,Ethernet37,Ethernet38,Ethernet39", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet40": { + "index": "11,11,11,11", + "lanes": "40,41,42,43", + "alias_at_lanes": "Ethernet40,Ethernet41,Ethernet42,Ethernet43", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet44": { + "index": "12,12,12,12", + "lanes": "44,45,46,47", + "alias_at_lanes": "Ethernet44,Ethernet45,Ethernet46,Ethernet47", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet48": { + "index": "13,13,13,13", + "lanes": "48,49,50,51", + "alias_at_lanes": "Ethernet48,Ethernet49,Ethernet50,Ethernet51", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet52": { + "index": "14,14,14,14", + "lanes": "52,53,54,55", + "alias_at_lanes": "Ethernet52,Ethernet53,Ethernet54,Ethernet55", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet56": { + "index": "15,15,15,15", + "lanes": "56,57,58,59", + "alias_at_lanes": "Ethernet56,Ethernet57,Ethernet58,Ethernet59", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet60": { + "index": "16,16,16,16", + "lanes": "60,61,62,63", + "alias_at_lanes": "Ethernet60,Ethernet61,Ethernet62,Ethernet63", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet64": { + "index": "17,17,17,17", + "lanes": "64,65,66,67", + "alias_at_lanes": "Ethernet64,Ethernet65,Ethernet66,Ethernet67", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet68": { + "index": "18,18,18,18", + "lanes": "68,69,70,71", + "alias_at_lanes": "Ethernet68,Ethernet69,Ethernet70,Ethernet71", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet72": { + "index": "19,19,19,19", + "lanes": "72,73,74,75", + "alias_at_lanes": "Ethernet72,Ethernet73,Ethernet74,Ethernet75", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet76": { + "index": "20,20,20,20", + "lanes": "76,77,78,79", + "alias_at_lanes": "Ethernet76,Ethernet77,Ethernet78,Ethernet79", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet80": { + "index": "21,21,21,21", + "lanes": "80,81,82,83", + "alias_at_lanes": "Ethernet80,Ethernet81,Ethernet82,Ethernet83", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet84": { + "index": "22,22,22,22", + "lanes": "84,85,86,87", + "alias_at_lanes": "Ethernet84,Ethernet85,Ethernet86,Ethernet87", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet88": { + "index": "23,23,23,23", + "lanes": "88,89,90,91", + "alias_at_lanes": "Ethernet88,Ethernet89,Ethernet90,Ethernet91", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet92": { + "index": "24,24,24,24", + "lanes": "92,93,94,95", + "alias_at_lanes": "Ethernet92,Ethernet93,Ethernet94,Ethernet95", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet96": { + "index": "25,25,25,25", + "lanes": "96,97,98,99", + "alias_at_lanes": "Ethernet96,Ethernet97,Ethernet98,Ethernet99", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet100": { + "index": "26,26,26,26", + "lanes": "100,101,102,103", + "alias_at_lanes": "Ethernet100,Ethernet101,Ethernet102,Ethernet103", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet104": { + "index": "27,27,27,27", + "lanes": "104,105,106,107", + "alias_at_lanes": "Ethernet104,Ethernet105,Ethernet106,Ethernet107", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet108": { + "index": "28,28,28,28", + "lanes": "108,109,110,111", + "alias_at_lanes": "Ethernet108,Ethernet109,Ethernet110,Ethernet111", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet112": { + "index": "29,29,29,29", + "lanes": "112,113,114,115", + "alias_at_lanes": "Ethernet112,Ethernet113,Ethernet114,Ethernet115", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet116": { + "index": "30,30,30,30", + "lanes": "116,117,118,119", + "alias_at_lanes": "Ethernet116,Ethernet117,Ethernet118,Ethernet119", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet120": { + "index": "31,31,31,31", + "lanes": "120,121,122,123", + "alias_at_lanes": "Ethernet120,Ethernet121,Ethernet122,Ethernet123", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet124": { + "index": "32,32,32,32", + "lanes": "124,125,126,127", + "alias_at_lanes": "Ethernet124,Ethernet125,Ethernet126,Ethernet127", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet128": { + "index": "33,33,33,33", + "lanes": "128,129,130,131", + "alias_at_lanes": "Ethernet128,Ethernet129,Ethernet130,Ethernet131", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet132": { + "index": "34,34,34,34", + "lanes": "132,133,134,135", + "alias_at_lanes": "Ethernet132,Ethernet133,Ethernet134,Ethernet135", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet136": { + "index": "35,35,35,35", + "lanes": "136,137,138,139", + "alias_at_lanes": "Ethernet136,Ethernet137,Ethernet138,Ethernet139", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet140": { + "index": "36,36,36,36", + "lanes": "140,141,142,143", + "alias_at_lanes": "Ethernet140,Ethernet141,Ethernet142,Ethernet143", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet144": { + "index": "37,37,37,37", + "lanes": "144,145,146,147", + "alias_at_lanes": "Ethernet144,Ethernet145,Ethernet146,Ethernet147", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet148": { + "index": "38,38,38,38", + "lanes": "148,149,150,151", + "alias_at_lanes": "Ethernet148,Ethernet149,Ethernet150,Ethernet151", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet152": { + "index": "39,39,39,39", + "lanes": "152,153,154,155", + "alias_at_lanes": "Ethernet152,Ethernet153,Ethernet154,Ethernet155", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet156": { + "index": "40,40,40,40", + "lanes": "156,157,158,159", + "alias_at_lanes": "Ethernet156,Ethernet157,Ethernet158,Ethernet159", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet160": { + "index": "41,41,41,41", + "lanes": "160,161,162,163", + "alias_at_lanes": "Ethernet160,Ethernet161,Ethernet162,Ethernet163", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet164": { + "index": "42,42,42,42", + "lanes": "164,165,166,167", + "alias_at_lanes": "Ethernet164,Ethernet165,Ethernet166,Ethernet167", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet168": { + "index": "43,43,43,43", + "lanes": "168,169,170,171", + "alias_at_lanes": "Ethernet168,Ethernet169,Ethernet170,Ethernet171", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet172": { + "index": "44,44,44,44", + "lanes": "172,173,174,175", + "alias_at_lanes": "Ethernet172,Ethernet173,Ethernet174,Ethernet175", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet176": { + "index": "45,45,45,45", + "lanes": "176,177,178,179", + "alias_at_lanes": "Ethernet176,Ethernet177,Ethernet178,Ethernet179", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet180": { + "index": "46,46,46,46", + "lanes": "180,181,182,183", + "alias_at_lanes": "Ethernet180,Ethernet181,Ethernet182,Ethernet183", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet184": { + "index": "47,47,47,47", + "lanes": "184,185,186,187", + "alias_at_lanes": "Ethernet184,Ethernet185,Ethernet186,Ethernet187", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet188": { + "index": "48,48,48,48", + "lanes": "188,189,190,191", + "alias_at_lanes": "Ethernet188,Ethernet189,Ethernet190,Ethernet191", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet192": { + "index": "49,49,49,49", + "lanes": "192,193,194,195", + "alias_at_lanes": "Ethernet192,Ethernet193,Ethernet194,Ethernet195", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet196": { + "index": "50,50,50,50", + "lanes": "196,197,198,199", + "alias_at_lanes": "Ethernet196,Ethernet197,Ethernet198,Ethernet199", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet200": { + "index": "51,51,51,51", + "lanes": "200,201,202,203", + "alias_at_lanes": "Ethernet200,Ethernet201,Ethernet202,Ethernet203", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet204": { + "index": "52,52,52,52", + "lanes": "204,205,206,207", + "alias_at_lanes": "Ethernet204,Ethernet205,Ethernet206,Ethernet207", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet208": { + "index": "53,53,53,53", + "lanes": "208,209,210,211", + "alias_at_lanes": "Ethernet208,Ethernet209,Ethernet210,Ethernet211", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet212": { + "index": "54,54,54,54", + "lanes": "212,213,214,215", + "alias_at_lanes": "Ethernet212,Ethernet213,Ethernet214,Ethernet215", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet216": { + "index": "55,55,55,55", + "lanes": "216,217,218,219", + "alias_at_lanes": "Ethernet216,Ethernet217,Ethernet218,Ethernet219", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet220": { + "index": "56,56,56,56", + "lanes": "220,221,222,223", + "alias_at_lanes": "Ethernet220,Ethernet221,Ethernet222,Ethernet223", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet224": { + "index": "57,57,57,57", + "lanes": "224,225,226,227", + "alias_at_lanes": "Ethernet224,Ethernet225,Ethernet226,Ethernet227", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet228": { + "index": "58,58,58,58", + "lanes": "228,229,230,231", + "alias_at_lanes": "Ethernet228,Ethernet229,Ethernet230,Ethernet231", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet232": { + "index": "59,59,59,59", + "lanes": "232,233,234,235", + "alias_at_lanes": "Ethernet232,Ethernet233,Ethernet234,Ethernet235", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet236": { + "index": "60,60,60,60", + "lanes": "236,237,238,239", + "alias_at_lanes": "Ethernet236,Ethernet237,Ethernet238,Ethernet239", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet240": { + "index": "61,61,61,61", + "lanes": "240,241,242,243", + "alias_at_lanes": "Ethernet240,Ethernet241,Ethernet242,Ethernet243", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet244": { + "index": "62,62,62,62", + "lanes": "244,245,246,247", + "alias_at_lanes": "Ethernet244,Ethernet245,Ethernet246,Ethernet247", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet248": { + "index": "63,63,63,63", + "lanes": "248,249,250,251", + "alias_at_lanes": "Ethernet248,Ethernet249,Ethernet250,Ethernet251", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet252": { + "index": "64,64,64,64", + "lanes": "252,253,254,255", + "alias_at_lanes": "Ethernet252,Ethernet253,Ethernet254,Ethernet255", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + }, + "Ethernet256": { + "index": "65,65,65,65", + "lanes": "256,257,258,259", + "alias_at_lanes": "Ethernet256,Ethernet257,Ethernet258,Ethernet259", + "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" + } + } +} diff --git a/device/barefoot/x86_64-accton_wedge100bf_65x-r0/platform_components.json b/device/barefoot/x86_64-accton_wedge100bf_65x-r0/platform_components.json new file mode 100644 index 000000000000..74e851a7c4b6 --- /dev/null +++ b/device/barefoot/x86_64-accton_wedge100bf_65x-r0/platform_components.json @@ -0,0 +1,8 @@ +{ + "chassis": { + "Wedge100BF-65X-O-AC-F-BF": { + "component": { + } + } + } +} \ No newline at end of file diff --git a/device/barefoot/x86_64-accton_wedge100bf_65x-r0/pmon_daemon_control.json b/device/barefoot/x86_64-accton_wedge100bf_65x-r0/pmon_daemon_control.json index f94fa8370273..b58e59ba000c 100644 --- a/device/barefoot/x86_64-accton_wedge100bf_65x-r0/pmon_daemon_control.json +++ b/device/barefoot/x86_64-accton_wedge100bf_65x-r0/pmon_daemon_control.json @@ -1,7 +1,7 @@ { - "skip_pcied": true, + "skip_pcied": false, "skip_fancontrol": true, - "skip_thermalctld": true, + "skip_thermalctld": false, "skip_ledd": true, "skip_xcvrd": false, "skip_psud": false, diff --git a/device/broadcom/x86_64-bcm_xlr-r0/BCM956960K/th_32x100.config.bcm b/device/broadcom/x86_64-bcm_xlr-r0/BCM956960K/th_32x100.config.bcm index 16f18dcd2fd0..c394602bda19 100644 --- a/device/broadcom/x86_64-bcm_xlr-r0/BCM956960K/th_32x100.config.bcm +++ b/device/broadcom/x86_64-bcm_xlr-r0/BCM956960K/th_32x100.config.bcm @@ -1,3 +1,9 @@ +# Disable Counting ACL Drop towards interface RX_DRP counter +sai_adjust_acl_drop_in_rx_drop=1 + +# disables bcmALPMDH (ALPM distributed hitbit) thread. This thread is purely for debug purpose +l3_alpm_hit_skip=1 + portmap_1=1:100 portmap_2=5:100 portmap_3=9:100 diff --git a/device/celestica/x86_64-cel_e1031-r0/Celestica-E1031-T48S4/helix4-e1031-48x1G+4x10G.config.bcm b/device/celestica/x86_64-cel_e1031-r0/Celestica-E1031-T48S4/helix4-e1031-48x1G+4x10G.config.bcm index c7942d6fc0b8..3da3ff365e21 100644 --- a/device/celestica/x86_64-cel_e1031-r0/Celestica-E1031-T48S4/helix4-e1031-48x1G+4x10G.config.bcm +++ b/device/celestica/x86_64-cel_e1031-r0/Celestica-E1031-T48S4/helix4-e1031-48x1G+4x10G.config.bcm @@ -1,3 +1,13 @@ +sai_postinit_cmd_file=/usr/share/sonic/hwsku/sai_postinit_cmd.soc + +ipv6_lpm_128b_enable=1 + +# disables bcmALPMDH (ALPM distributed hitbit) thread. This thread is purely for debug purpose +l3_alpm_hit_skip=1 + +# Disable Counting ACL Drop towards interface RX_DRP counter +sai_adjust_acl_drop_in_rx_drop=1 + bcm56340_4x10=1 bcm56340_config=1 dport_map_direct=0 diff --git a/device/celestica/x86_64-cel_e1031-r0/Celestica-E1031-T48S4/hwsku.json b/device/celestica/x86_64-cel_e1031-r0/Celestica-E1031-T48S4/hwsku.json new file mode 100644 index 000000000000..e4afe9bc5d52 --- /dev/null +++ b/device/celestica/x86_64-cel_e1031-r0/Celestica-E1031-T48S4/hwsku.json @@ -0,0 +1,224 @@ +{ + "interfaces": { + "Ethernet0": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet1": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet2": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet3": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet4": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet5": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet6": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet7": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet8": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet9": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet10": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet11": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet12": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet13": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet14": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet15": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet16": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet17": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet18": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet19": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet20": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet21": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet22": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet23": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet24": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet25": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet26": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet27": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet28": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet29": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet30": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet31": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet32": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet33": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet34": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet35": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet36": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet37": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet38": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet39": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet40": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet41": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet42": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet43": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet44": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet45": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet46": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet47": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet48": { + "default_brkout_mode": "1x10G", + "port_type": "SFP+" + }, + "Ethernet49": { + "default_brkout_mode": "1x10G", + "port_type": "SFP+" + }, + "Ethernet50": { + "default_brkout_mode": "1x10G", + "port_type": "SFP+" + }, + "Ethernet51": { + "default_brkout_mode": "1x10G", + "port_type": "SFP+" + }, + "Ethernet52": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet53": { + "default_brkout_mode": "1x21G", + "port_type": "RJ45" + }, + "Ethernet54": { + "default_brkout_mode": "1x21G", + "port_type": "RJ45" + } + } +} diff --git a/device/celestica/x86_64-cel_e1031-r0/Celestica-E1031-T48S4/port_config.ini b/device/celestica/x86_64-cel_e1031-r0/Celestica-E1031-T48S4/port_config.ini old mode 100644 new mode 100755 index a2b64ea155df..6ca1d2c4e80f --- a/device/celestica/x86_64-cel_e1031-r0/Celestica-E1031-T48S4/port_config.ini +++ b/device/celestica/x86_64-cel_e1031-r0/Celestica-E1031-T48S4/port_config.ini @@ -1,53 +1,56 @@ -# name lanes index speed alias autoneg -Ethernet0 2 1 1000 etp1 1 -Ethernet1 1 2 1000 etp2 1 -Ethernet2 4 3 1000 etp3 1 -Ethernet3 3 4 1000 etp4 1 -Ethernet4 6 5 1000 etp5 1 -Ethernet5 5 6 1000 etp6 1 -Ethernet6 8 7 1000 etp7 1 -Ethernet7 7 8 1000 etp8 1 -Ethernet8 10 9 1000 etp9 1 -Ethernet9 9 10 1000 etp10 1 -Ethernet10 12 11 1000 etp11 1 -Ethernet11 11 12 1000 etp12 1 -Ethernet12 14 13 1000 etp13 1 -Ethernet13 13 14 1000 etp14 1 -Ethernet14 16 15 1000 etp15 1 -Ethernet15 15 16 1000 etp16 1 -Ethernet16 18 17 1000 etp17 1 -Ethernet17 17 18 1000 etp18 1 -Ethernet18 20 19 1000 etp19 1 -Ethernet19 19 20 1000 etp20 1 -Ethernet20 22 21 1000 etp21 1 -Ethernet21 21 22 1000 etp22 1 -Ethernet22 24 23 1000 etp23 1 -Ethernet23 23 24 1000 etp24 1 -Ethernet24 26 25 1000 etp25 1 -Ethernet25 25 26 1000 etp26 1 -Ethernet26 28 27 1000 etp27 1 -Ethernet27 27 28 1000 etp28 1 -Ethernet28 30 29 1000 etp29 1 -Ethernet29 29 30 1000 etp30 1 -Ethernet30 32 31 1000 etp31 1 -Ethernet31 31 32 1000 etp32 1 -Ethernet32 34 33 1000 etp33 1 -Ethernet33 33 34 1000 etp34 1 -Ethernet34 36 35 1000 etp35 1 -Ethernet35 35 36 1000 etp36 1 -Ethernet36 38 37 1000 etp37 1 -Ethernet37 37 38 1000 etp38 1 -Ethernet38 40 39 1000 etp39 1 -Ethernet39 39 40 1000 etp40 1 -Ethernet40 42 41 1000 etp41 1 -Ethernet41 41 42 1000 etp42 1 -Ethernet42 44 43 1000 etp43 1 -Ethernet43 43 44 1000 etp44 1 -Ethernet44 46 45 1000 etp45 1 -Ethernet45 45 46 1000 etp46 1 -Ethernet46 48 47 1000 etp47 1 -Ethernet47 47 48 1000 etp48 1 -Ethernet48 54 49 10000 etp49 0 -Ethernet49 53 50 10000 etp50 0 -Ethernet50 56 51 10000 etp51 0 -Ethernet51 55 52 10000 etp52 0 +# name lanes index speed alias autoneg +Ethernet0 2 1 1000 etp1 1 +Ethernet1 1 2 1000 etp2 1 +Ethernet2 4 3 1000 etp3 1 +Ethernet3 3 4 1000 etp4 1 +Ethernet4 6 5 1000 etp5 1 +Ethernet5 5 6 1000 etp6 1 +Ethernet6 8 7 1000 etp7 1 +Ethernet7 7 8 1000 etp8 1 +Ethernet8 10 9 1000 etp9 1 +Ethernet9 9 10 1000 etp10 1 +Ethernet10 12 11 1000 etp11 1 +Ethernet11 11 12 1000 etp12 1 +Ethernet12 14 13 1000 etp13 1 +Ethernet13 13 14 1000 etp14 1 +Ethernet14 16 15 1000 etp15 1 +Ethernet15 15 16 1000 etp16 1 +Ethernet16 18 17 1000 etp17 1 +Ethernet17 17 18 1000 etp18 1 +Ethernet18 20 19 1000 etp19 1 +Ethernet19 19 20 1000 etp20 1 +Ethernet20 22 21 1000 etp21 1 +Ethernet21 21 22 1000 etp22 1 +Ethernet22 24 23 1000 etp23 1 +Ethernet23 23 24 1000 etp24 1 +Ethernet24 26 25 1000 etp25 1 +Ethernet25 25 26 1000 etp26 1 +Ethernet26 28 27 1000 etp27 1 +Ethernet27 27 28 1000 etp28 1 +Ethernet28 30 29 1000 etp29 1 +Ethernet29 29 30 1000 etp30 1 +Ethernet30 32 31 1000 etp31 1 +Ethernet31 31 32 1000 etp32 1 +Ethernet32 34 33 1000 etp33 1 +Ethernet33 33 34 1000 etp34 1 +Ethernet34 36 35 1000 etp35 1 +Ethernet35 35 36 1000 etp36 1 +Ethernet36 38 37 1000 etp37 1 +Ethernet37 37 38 1000 etp38 1 +Ethernet38 40 39 1000 etp39 1 +Ethernet39 39 40 1000 etp40 1 +Ethernet40 42 41 1000 etp41 1 +Ethernet41 41 42 1000 etp42 1 +Ethernet42 44 43 1000 etp43 1 +Ethernet43 43 44 1000 etp44 1 +Ethernet44 46 45 1000 etp45 1 +Ethernet45 45 46 1000 etp46 1 +Ethernet46 48 47 1000 etp47 1 +Ethernet47 47 48 1000 etp48 1 +Ethernet48 54 49 10000 etp49 0 +Ethernet49 53 50 10000 etp50 0 +Ethernet50 56 51 10000 etp51 0 +Ethernet51 55 52 10000 etp52 0 +Ethernet52 49 53 1000 etp53 0 +Ethernet53 57,58,59,60 54 21000 etp54 0 +Ethernet54 61,62,63,64 55 21000 etp55 0 diff --git a/device/celestica/x86_64-cel_e1031-r0/Celestica-E1031-T48S4/sai_postinit_cmd.soc b/device/celestica/x86_64-cel_e1031-r0/Celestica-E1031-T48S4/sai_postinit_cmd.soc new file mode 100644 index 000000000000..573706e302bd --- /dev/null +++ b/device/celestica/x86_64-cel_e1031-r0/Celestica-E1031-T48S4/sai_postinit_cmd.soc @@ -0,0 +1 @@ +setreg RTAG7_IPV4_TCP_UDP_HASH_FIELD_BMAP_2 IPV4_TCP_UDP_FIELD_BITMAP_A=0xf70 diff --git a/device/celestica/x86_64-cel_e1031-r0/fancontrol-B2F b/device/celestica/x86_64-cel_e1031-r0/fancontrol-B2F index 883f3c0c899d..7c16892835d5 100644 --- a/device/celestica/x86_64-cel_e1031-r0/fancontrol-B2F +++ b/device/celestica/x86_64-cel_e1031-r0/fancontrol-B2F @@ -1,13 +1,11 @@ # Configuration file generated by pwmconfig, changes will be lost INTERVAL=2 -DEVPATH=hwmon3=devices/pci0000:00/0000:00:13.0/i2c-0/i2c-8/i2c-23/23-004d hwmon2=devices/pci0000:00/0000:00:13.0/i2c-0/i2c-8/i2c-11/11-001a -DEVNAME=hwmon3=emc2305 hwmon2=max6699 -FCTEMPS=hwmon3/device/pwm1=hwmon2/temp1_input hwmon3/device/pwm2=hwmon2/temp1_input hwmon3/device/pwm4=hwmon2/temp1_input -FCFANS=hwmon3/device/pwm1=hwmon3/device/fan1_input hwmon3/device/pwm2=hwmon3/device/fan2_input hwmon3/device/pwm4=hwmon3/device/fan4_input -MINTEMP=hwmon3/device/pwm1=27 hwmon3/device/pwm2=27 hwmon3/device/pwm4=27 -MAXTEMP=hwmon3/device/pwm1=46 hwmon3/device/pwm2=46 hwmon3/device/pwm4=46 -MINSTART=hwmon3/device/pwm1=102 hwmon3/device/pwm2=102 hwmon3/device/pwm4=102 -MINSTOP=hwmon3/device/pwm1=102 hwmon3/device/pwm2=102 hwmon3/device/pwm4=102 -MINPWM=hwmon3/device/pwm1=102 hwmon3/device/pwm2=102 hwmon3/device/pwm4=102 -MAXPWM=hwmon3/device/pwm1=255 hwmon3/device/pwm2=255 hwmon3/device/pwm4=255 -THYST=hwmon3/device/pwm1=2 hwmon3/device/pwm2=2 hwmon3/device/pwm4=2 +FCTEMPS=23-004d/pwm1=/sys/bus/i2c/devices/11-001a/hwmon/hwmon*/temp1_input 23-004d/pwm2=/sys/bus/i2c/devices/11-001a/hwmon/hwmon*/temp1_input 23-004d/pwm4=/sys/bus/i2c/devices/11-001a/hwmon/hwmon*/temp1_input +FCFANS=23-004d/pwm1=23-004d/fan1_input 23-004d/pwm2=23-004d/fan2_input 23-004d/pwm4=23-004d/fan4_input +MINTEMP=23-004d/pwm1=27 23-004d/pwm2=27 23-004d/pwm4=27 +MAXTEMP=23-004d/pwm1=46 23-004d/pwm2=46 23-004d/pwm4=46 +MINSTART=23-004d/pwm1=102 23-004d/pwm2=102 23-004d/pwm4=102 +MINSTOP=23-004d/pwm1=102 23-004d/pwm2=102 23-004d/pwm4=102 +MINPWM=23-004d/pwm1=102 23-004d/pwm2=102 23-004d/pwm4=102 +MAXPWM=23-004d/pwm1=255 23-004d/pwm2=255 23-004d/pwm4=255 +THYST=23-004d/pwm1=2 23-004d/pwm2=2 23-004d/pwm4=2 diff --git a/device/celestica/x86_64-cel_e1031-r0/fancontrol-F2B b/device/celestica/x86_64-cel_e1031-r0/fancontrol-F2B index 3be1f7e339ca..a19d510b185d 100644 --- a/device/celestica/x86_64-cel_e1031-r0/fancontrol-F2B +++ b/device/celestica/x86_64-cel_e1031-r0/fancontrol-F2B @@ -1,13 +1,11 @@ # Configuration file generated by pwmconfig, changes will be lost INTERVAL=2 -DEVPATH=hwmon3=devices/pci0000:00/0000:00:13.0/i2c-0/i2c-8/i2c-23/23-004d hwmon2=devices/pci0000:00/0000:00:13.0/i2c-0/i2c-8/i2c-11/11-001a -DEVNAME=hwmon3=emc2305 hwmon2=max6697 -FCTEMPS=hwmon3/device/pwm1=hwmon2/temp3_input hwmon3/device/pwm2=hwmon2/temp3_input hwmon3/device/pwm4=hwmon2/temp3_input -FCFANS=hwmon3/device/pwm1=hwmon3/device/fan1_input hwmon3/device/pwm2=hwmon3/device/fan2_input hwmon3/device/pwm4=hwmon3/device/fan4_input -MINTEMP=hwmon3/device/pwm1=29 hwmon3/device/pwm2=29 hwmon3/device/pwm4=29 -MAXTEMP=hwmon3/device/pwm1=46 hwmon3/device/pwm2=46 hwmon3/device/pwm4=46 -MINSTART=hwmon3/device/pwm1=102 hwmon3/device/pwm2=102 hwmon3/device/pwm4=102 -MINSTOP=hwmon3/device/pwm1=102 hwmon3/device/pwm2=102 hwmon3/device/pwm4=102 -MINPWM=hwmon3/device/pwm1=102 hwmon3/device/pwm2=102 hwmon3/device/pwm4=102 -MAXPWM=hwmon3/device/pwm1=255 hwmon3/device/pwm2=255 hwmon3/device/pwm4=255 -THYST=hwmon3/device/pwm1=2 hwmon3/device/pwm2=2 hwmon3/device/pwm4=2 +FCTEMPS=23-004d/pwm1=/sys/bus/i2c/devices/11-001a/hwmon/hwmon*/temp3_input 23-004d/pwm2=/sys/bus/i2c/devices/11-001a/hwmon/hwmon*/temp3_input 23-004d/pwm4=/sys/bus/i2c/devices/11-001a/hwmon/hwmon*/temp3_input +FCFANS=23-004d/pwm1=23-004d/fan1_input 23-004d/pwm2=23-004d/fan2_input 23-004d/pwm4=23-004d/fan4_input +MINTEMP=23-004d/pwm1=29 23-004d/pwm2=29 23-004d/pwm4=29 +MAXTEMP=23-004d/pwm1=46 23-004d/pwm2=46 23-004d/pwm4=46 +MINSTART=23-004d/pwm1=102 23-004d/pwm2=102 23-004d/pwm4=102 +MINSTOP=23-004d/pwm1=102 23-004d/pwm2=102 23-004d/pwm4=102 +MINPWM=23-004d/pwm1=102 23-004d/pwm2=102 23-004d/pwm4=102 +MAXPWM=23-004d/pwm1=255 23-004d/pwm2=255 23-004d/pwm4=255 +THYST=23-004d/pwm1=2 23-004d/pwm2=2 23-004d/pwm4=2 diff --git a/device/celestica/x86_64-cel_e1031-r0/plugins/pcie.yaml b/device/celestica/x86_64-cel_e1031-r0/pcie.yaml similarity index 100% rename from device/celestica/x86_64-cel_e1031-r0/plugins/pcie.yaml rename to device/celestica/x86_64-cel_e1031-r0/pcie.yaml diff --git a/device/celestica/x86_64-cel_e1031-r0/platform.json b/device/celestica/x86_64-cel_e1031-r0/platform.json new file mode 100644 index 000000000000..a0a174c66a80 --- /dev/null +++ b/device/celestica/x86_64-cel_e1031-r0/platform.json @@ -0,0 +1,368 @@ +{ + "chassis": { + "name": "Celestica-E1031-T48S4", + "status_led": { + "controllable": true, + "colors": ["green", "amber","off"] + }, + "components": [ + { + "name": "SMC_CPLD" + }, + { + "name": "MMC_CPLD" + }, + { + "name": "BIOS" + } + ], + "fans": [ + { + "name": "FAN-1", + "speed": { + "controllable": false + }, + "status_led": { + "controllable": true, + "colors": ["green", "amber","off"] + } + }, + { + "name": "FAN-2", + "speed": { + "controllable": false + }, + "status_led": { + "controllable": true, + "colors": ["green", "amber","off"] + } + }, + { + "name": "FAN-3", + "speed": { + "controllable": false + }, + "status_led": { + "controllable": true, + "colors": ["green", "amber","off"] + } + } + ], + "fan_drawers": [ + { + "name": "Drawer1", + "speed": { + "controllable": false + }, + "status_led": { + "controllable": true, + "colors": ["green", "amber","off"] + }, + "fans": [ + { + "name": "FAN-1", + "speed": { + "controllable": false + }, + "status_led": { + "controllable": true, + "colors": ["green", "amber","off"] + } + } + ] + }, + { + "name": "Drawer2", + "speed": { + "controllable": false + }, + "status_led": { + "controllable": true, + "colors": ["green", "amber","off"] + }, + "fans": [ + { + "name": "FAN-2", + "speed": { + "controllable": false + }, + "status_led": { + "controllable": true, + "colors": ["green", "amber","off"] + } + } + ] + }, + { + "name": "Drawer3", + "speed": { + "controllable": false + }, + "status_led": { + "controllable": true, + "colors": ["green", "amber","off"] + }, + "fans": [ + { + "name": "FAN-3", + "speed": { + "controllable": false + }, + "status_led": { + "controllable": true, + "colors": ["green", "amber","off"] + } + } + ] + } + ], + "psus": [ + { + "name": "PSU-R", + "fans": [ + { + "name": "PSU-1 FAN-1", + "speed": { + "controllable": false + }, + "status_led": { + "controllable": false + } + } + ], + "status_led": { + "controllable": false + } + }, + { + "name": "PSU-L", + "fans": [ + { + "name": "PSU-2 FAN-1", + "speed": { + "controllable": false + }, + "status_led": { + "controllable": false + } + } + ], + "status_led": { + "controllable": false + } + } + ], + "thermals": [ + { + "name": "Inlet ambient sensor (Rear to Front)", + "controllable": false, + "low-threshold": false, + "low-crit-threshold": false + }, + { + "name": "Helix shutdown sensor (Rear to Front)", + "controllable": false, + "low-threshold": false, + "low-crit-threshold": false + }, + { + "name": "Inlet ambient sensor (Front to Rear, right)", + "controllable": false, + "low-threshold": false, + "low-crit-threshold": false + }, + { + "name": "Helix shutdown sensor (Front to Rear)", + "controllable": false, + "low-threshold": false, + "low-crit-threshold": false + }, + { + "name": "Inlet ambient sensor (Front to Rear, left)", + "controllable": false, + "low-threshold": false, + "low-crit-threshold": false + }, + { + "name": "CPU errata sensor (Front to Rear)", + "controllable": false, + "low-threshold": false, + "low-crit-threshold": false + }, + { + "name": "CPU errata sensor (Rear to Front)", + "controllable": false, + "low-threshold": false, + "low-crit-threshold": false + } + ], + "sfps": [ + { + "name": "Ethernet0" + }, + { + "name": "Ethernet1" + }, + { + "name": "Ethernet2" + }, + { + "name": "Ethernet3" + }, + { + "name": "Ethernet4" + }, + { + "name": "Ethernet5" + }, + { + "name": "Ethernet6" + }, + { + "name": "Ethernet7" + }, + { + "name": "Ethernet8" + }, + { + "name": "Ethernet9" + }, + { + "name": "Ethernet10" + }, + { + "name": "Ethernet11" + }, + { + "name": "Ethernet12" + }, + { + "name": "Ethernet13" + }, + { + "name": "Ethernet14" + }, + { + "name": "Ethernet15" + }, + { + "name": "Ethernet16" + }, + { + "name": "Ethernet17" + }, + { + "name": "Ethernet18" + }, + { + "name": "Ethernet19" + }, + { + "name": "Ethernet20" + }, + { + "name": "Ethernet21" + }, + { + "name": "Ethernet22" + }, + { + "name": "Ethernet23" + }, + { + "name": "Ethernet24" + }, + { + "name": "Ethernet25" + }, + { + "name": "Ethernet26" + }, + { + "name": "Ethernet27" + }, + { + "name": "Ethernet28" + }, + { + "name": "Ethernet29" + }, + { + "name": "Ethernet30" + }, + { + "name": "Ethernet31" + }, + { + "name": "Ethernet32" + }, + { + "name": "Ethernet33" + }, + { + "name": "Ethernet34" + }, + { + "name": "Ethernet35" + }, + { + "name": "Ethernet36" + }, + { + "name": "Ethernet37" + }, + { + "name": "Ethernet38" + }, + { + "name": "Ethernet39" + }, + { + "name": "Ethernet40" + }, + { + "name": "Ethernet41" + }, + { + "name": "Ethernet42" + }, + { + "name": "Ethernet43" + }, + { + "name": "Ethernet44" + }, + { + "name": "Ethernet45" + }, + { + "name": "Ethernet46" + }, + { + "name": "Ethernet47" + }, + { + "name": "Ethernet48" + }, + { + "name": "Ethernet49" + }, + { + "name": "Ethernet50" + }, + { + "name": "Ethernet51" + }, + { + "name": "Ethernet52" + }, + { + "name": "Ethernet53" + }, + { + "name": "Ethernet54" + } + ] + }, + "interfaces": {} +} \ No newline at end of file diff --git a/device/celestica/x86_64-cel_e1031-r0/platform_components.json b/device/celestica/x86_64-cel_e1031-r0/platform_components.json new file mode 100644 index 000000000000..97e691f90084 --- /dev/null +++ b/device/celestica/x86_64-cel_e1031-r0/platform_components.json @@ -0,0 +1,11 @@ +{ + "chassis": { + "Celestica-E1031-T48S4": { + "component": { + "BIOS": {}, + "SMC_CPLD": {}, + "MMC_CPLD": {} + } + } + } +} \ No newline at end of file diff --git a/device/celestica/x86_64-cel_e1031-r0/plugins/sfputil.py b/device/celestica/x86_64-cel_e1031-r0/plugins/sfputil.py index d65f2cf3f54f..033d4668211f 100644 --- a/device/celestica/x86_64-cel_e1031-r0/plugins/sfputil.py +++ b/device/celestica/x86_64-cel_e1031-r0/plugins/sfputil.py @@ -11,63 +11,17 @@ class SfpUtil(SfpUtilBase): """Platform-specific SfpUtil class""" PORT_START = 1 - PORT_END = 52 + PORT_END = 55 + SFP_PORT_START = 49 + SFP_PORT_END = 52 port_to_i2c_mapping = { - 1: None, - 2: None, - 3: None, - 4: None, - 5: None, - 6: None, - 7: None, - 8: None, - 9: None, - 10: None, - 11: None, - 12: None, - 13: None, - 14: None, - 15: None, - 16: None, - 17: None, - 18: None, - 19: None, - 20: None, - 21: None, - 22: None, - 23: None, - 24: None, - 25: None, - 26: None, - 27: None, - 28: None, - 29: None, - 30: None, - 31: None, - 32: None, - 33: None, - 34: None, - 35: None, - 36: None, - 37: None, - 38: None, - 39: None, - 40: None, - 41: None, - 42: None, - 43: None, - 44: None, - 45: None, - 46: None, - 47: None, - 48: None, 49: 15, 50: 14, 51: 17, 52: 16 } _port_to_eeprom_mapping = {} - _sfp_port = list(range(49, PORT_END + 1)) + _sfp_port = list(range(SFP_PORT_START, SFP_PORT_END + 1)) @property def port_start(self): @@ -89,7 +43,7 @@ def __init__(self): # Override port_to_eeprom_mapping for class initialization eeprom_path = '/sys/bus/i2c/devices/i2c-{0}/{0}-0050/eeprom' for x in range(self.PORT_START, self.PORT_END + 1): - port_eeprom_path = eeprom_path.format(self.port_to_i2c_mapping[x]) + port_eeprom_path = eeprom_path.format(self.port_to_i2c_mapping[x]) if x in self._sfp_port else None self.port_to_eeprom_mapping[x] = port_eeprom_path SfpUtilBase.__init__(self) @@ -103,7 +57,7 @@ def get_presence(self, port_num): try: with open(sfp_modabs_path, 'r') as port_status: status = int(port_status.read(), 16) - status = (status >> (port_num - 49)) & 1 + status = (status >> (port_num - self.SFP_PORT_START)) & 1 except IOError: return False @@ -138,7 +92,8 @@ def get_transceiver_change_event(self, timeout=0): for port_num in self._sfp_port: change = (changes >> (port_num - 49)) & 1 if change == 1: - port_dict[str(port_num)] = str(int(self.get_presence(port_num))) + port_dict[str(port_num)] = str( + int(self.get_presence(port_num))) found_flag = 1 if not found_flag: diff --git a/device/celestica/x86_64-cel_e1031-r0/sonic_platform/__init__.py b/device/celestica/x86_64-cel_e1031-r0/sonic_platform/__init__.py index d82f3749319c..db1748e44d2c 100644 --- a/device/celestica/x86_64-cel_e1031-r0/sonic_platform/__init__.py +++ b/device/celestica/x86_64-cel_e1031-r0/sonic_platform/__init__.py @@ -1,2 +1,2 @@ -__all__ = ["platform", "chassis"] -from sonic_platform import * +from . import chassis +from . import platform diff --git a/device/celestica/x86_64-cel_e1031-r0/sonic_platform/chassis.py b/device/celestica/x86_64-cel_e1031-r0/sonic_platform/chassis.py index 40c4bb4ef73b..4b081f4e3ceb 100644 --- a/device/celestica/x86_64-cel_e1031-r0/sonic_platform/chassis.py +++ b/device/celestica/x86_64-cel_e1031-r0/sonic_platform/chassis.py @@ -6,33 +6,26 @@ # ############################################################################# -import sys -import re -import os -import subprocess -import json try: + from sonic_platform_base.sonic_sfp.sfputilhelper import SfpUtilHelper from sonic_platform_base.chassis_base import ChassisBase - from sonic_platform.fan import Fan - from sonic_platform.psu import Psu - from sonic_platform.component import Component - from sonic_platform.thermal import Thermal - from sonic_platform.sfp import Sfp - from sonic_platform.eeprom import Tlv + from sonic_py_common import device_info + from .common import Common + from .event import SfpEvent except ImportError as e: raise ImportError(str(e) + "- required module not found") NUM_FAN_TRAY = 3 -NUM_FAN = 1 NUM_PSU = 2 NUM_THERMAL = 7 -NUM_SFP = 52 +NUM_SFP = 55 NUM_COMPONENT = 3 RESET_REGISTER = "0x112" HOST_REBOOT_CAUSE_PATH = "/host/reboot-cause/previous-reboot-cause.txt" PMON_REBOOT_CAUSE_PATH = "/usr/share/sonic/platform/api_files/reboot-cause/previous-reboot-cause.txt" HOST_CHK_CMD = "docker > /dev/null 2>&1" +STATUS_LED_PATH = "/sys/devices/platform/e1031.smc/master_led" class Chassis(ChassisBase): @@ -40,41 +33,65 @@ class Chassis(ChassisBase): def __init__(self): ChassisBase.__init__(self) - self.config_data = {} - for fant_index in range(0, NUM_FAN_TRAY): - for fan_index in range(0, NUM_FAN): - fan = Fan(fant_index, fan_index) - self._fan_list.append(fan) + + self._api_common = Common() + self._is_host = self._api_common.is_host() + + self.__initialize_eeprom() + self.__initialize_fan() + self.__initialize_psu() + self.__initialize_thermals() + self.__initialize_components() + + self.sfp_module_initialized = False + self._reboot_cause_path = HOST_REBOOT_CAUSE_PATH if self._is_host else PMON_REBOOT_CAUSE_PATH + + def __initialize_sfp(self): + sfputil_helper = SfpUtilHelper() + port_config_file_path = device_info.get_path_to_port_config_file() + sfputil_helper.read_porttab_mappings(port_config_file_path, 0) + + from .sfp import Sfp + for index in range(0, NUM_SFP): + sfp = Sfp(index, sfputil_helper.logical[index]) + self._sfp_list.append(sfp) + self.sfp_module_initialized = True + + def __initialize_psu(self): + from .psu import Psu for index in range(0, NUM_PSU): psu = Psu(index) self._psu_list.append(psu) + + def __initialize_fan(self): + from .fan_drawer import FanDrawer + for i in range(NUM_FAN_TRAY): + fandrawer = FanDrawer(i) + self._fan_drawer_list.append(fandrawer) + self._fan_list += fandrawer.get_all_fans() + + def __initialize_thermals(self): + from .thermal import Thermal + airflow = self.__get_air_flow() for index in range(0, NUM_THERMAL): - thermal = Thermal(index) + thermal = Thermal(index, airflow) self._thermal_list.append(thermal) - # sfp index start from 1 - self._sfp_list.append(None) - for index in range(1, NUM_SFP+1): - sfp = Sfp(index) - self._sfp_list.append(sfp) - for index in range(0, NUM_COMPONENT): - component = Component(index) - self._component_list.append(component) - self._reboot_cause_path = HOST_REBOOT_CAUSE_PATH if self.__is_host( - ) else PMON_REBOOT_CAUSE_PATH + def __initialize_eeprom(self): + from .eeprom import Tlv self._eeprom = Tlv() - def __is_host(self): - return os.system(HOST_CHK_CMD) == 0 + def __initialize_components(self): + from .component import Component + for index in range(0, NUM_COMPONENT): + component = Component(index) + self._component_list.append(component) - def __read_txt_file(self, file_path): - try: - with open(file_path, 'r') as fd: - data = fd.read() - return data.strip() - except IOError: - pass - return None + def __get_air_flow(self): + air_flow_path = '/usr/share/sonic/device/{}/fan_airflow'.format( + self._api_common.get_platform()) if self._is_host else '/usr/share/sonic/platform/fan_airflow' + air_flow = self._api_common.read_txt_file(air_flow_path) + return air_flow or 'B2F' def get_base_mac(self): """ @@ -85,7 +102,7 @@ def get_base_mac(self): """ return self._eeprom.get_mac() - def get_serial(self): + def get_serial_number(self): """ Retrieves the hardware serial number for the chassis Returns: @@ -116,8 +133,9 @@ def get_reboot_cause(self): """ description = 'None' reboot_cause = self.REBOOT_CAUSE_HARDWARE_OTHER - hw_reboot_cause = self._component_list[0].get_register_value(RESET_REGISTER) - sw_reboot_cause = self.__read_txt_file( + hw_reboot_cause = self._component_list[0].get_register_value( + RESET_REGISTER) + sw_reboot_cause = self._api_common.read_txt_file( self._reboot_cause_path) or "Unknown" if hw_reboot_cause == "0x55": @@ -127,10 +145,13 @@ def get_reboot_cause(self): reboot_cause = self.REBOOT_CAUSE_POWER_LOSS elif hw_reboot_cause == "0x33": reboot_cause = self.REBOOT_CAUSE_WATCHDOG + elif hw_reboot_cause == "0x88": + reboot_cause = self.REBOOT_CAUSE_THERMAL_OVERLOAD_CPU + elif hw_reboot_cause == "0x99": + reboot_cause = self.REBOOT_CAUSE_THERMAL_OVERLOAD_ASIC else: - reboot_cause = self.REBOOT_CAUSE_HARDWARE_OTHER + reboot_cause = self.REBOOT_CAUSE_NON_HARDWARE description = 'Unknown reason' - return (reboot_cause, description) def get_watchdog(self): @@ -145,3 +166,179 @@ def get_watchdog(self): self._watchdog = Watchdog() return self._watchdog + + def get_change_event(self, timeout=0): + """ + Returns a nested dictionary containing all devices which have + experienced a change at chassis level + Args: + timeout: Timeout in milliseconds (optional). If timeout == 0, + this method will block until a change is detected. + Returns: + (bool, dict): + - True if call successful, False if not; + - A nested dictionary where key is a device type, + value is a dictionary with key:value pairs in the format of + {'device_id':'device_event'}, + where device_id is the device ID for this device and + device_event, + status='1' represents device inserted, + status='0' represents device removed. + Ex. {'fan':{'0':'0', '2':'1'}, 'sfp':{'11':'0'}} + indicates that fan 0 has been removed, fan 2 + has been inserted and sfp 11 has been removed. + """ + # SFP event + if not self.sfp_module_initialized: + self.__initialize_sfp() + + sfp_event = SfpEvent(self._sfp_list).get_sfp_event(timeout) + if sfp_event: + return True, {'sfp': sfp_event} + + return False, {'sfp': {}} + + ############################################################## + ######################## SFP methods ######################### + ############################################################## + + def get_num_sfps(self): + """ + Retrieves the number of sfps available on this chassis + Returns: + An integer, the number of sfps available on this chassis + """ + if not self.sfp_module_initialized: + self.__initialize_sfp() + + return len(self._sfp_list) + + def get_all_sfps(self): + """ + Retrieves all sfps available on this chassis + Returns: + A list of objects derived from SfpBase representing all sfps + available on this chassis + """ + if not self.sfp_module_initialized: + self.__initialize_sfp() + + return self._sfp_list + + def get_sfp(self, index): + """ + Retrieves sfp represented by (1-based) index + Args: + index: An integer, the index (1-based) of the sfp to retrieve. + The index should be the sequence of a physical port in a chassis, + starting from 1. + For example, 1 for Ethernet0, 2 for Ethernet4 and so on. + Returns: + An object dervied from SfpBase representing the specified sfp + """ + if not self.sfp_module_initialized: + self.__initialize_sfp() + + return super(Chassis, self).get_sfp(index - 1) + + ############################################################## + ################## ThermalManager methods #################### + ############################################################## + + def get_thermal_manager(self): + from .thermal_manager import ThermalManager + return ThermalManager + + ############################################################## + ###################### Device methods ######################## + ############################################################## + + def get_name(self): + """ + Retrieves the name of the device + Returns: + string: The name of the device + """ + return self._api_common.get_hwsku() + + def get_presence(self): + """ + Retrieves the presence of the Chassis + Returns: + bool: True if Chassis is present, False if not + """ + return True + + def get_model(self): + """ + Retrieves the model number (or part number) of the device + Returns: + string: Model/part number of device + """ + return self._eeprom.get_pn() + + def get_serial(self): + """ + Retrieves the serial number of the device + Returns: + string: Serial number of device + """ + return self.get_serial_number() + + def get_status(self): + """ + Retrieves the operational status of the device + Returns: + A boolean value, True if device is operating properly, False if not + """ + return True + + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device. If the agent cannot determine the parent-relative position + for some reason, or if the associated value of entPhysicalContainedIn is '0', then the value '-1' is returned + Returns: + integer: The 1-based relative physical position in parent device or -1 if cannot determine the position + """ + return -1 + + def is_replaceable(self): + """ + Indicate whether this device is replaceable. + Returns: + bool: True if it is replaceable. + """ + return False + + def set_status_led(self, color): + """ + Sets the state of the PSU status LED + Args: + color: A string representing the color with which to set the PSU status LED + Note: Only support green and off + Returns: + bool: True if status LED state is set successfully, False if not + """ + + status_str = { + self.STATUS_LED_COLOR_GREEN: 'green', + self.STATUS_LED_COLOR_AMBER: 'amber', + self.STATUS_LED_COLOR_OFF: 'off' + }.get(color, 'off') + + return self._api_common.write_txt_file(STATUS_LED_PATH, status_str) + + def get_status_led(self): + """ + Gets the state of the PSU status LED + Returns: + A string, one of the predefined STATUS_LED_COLOR_* strings above + """ + status = self._api_common.read_txt_file(STATUS_LED_PATH) + status_str = { + 'on': self.STATUS_LED_COLOR_GREEN, + 'amber': self.STATUS_LED_COLOR_AMBER, + 'off': self.STATUS_LED_COLOR_OFF + }.get(status, None) + + return status_str diff --git a/device/celestica/x86_64-cel_e1031-r0/sonic_platform/common.py b/device/celestica/x86_64-cel_e1031-r0/sonic_platform/common.py new file mode 100644 index 000000000000..08e8fc41475c --- /dev/null +++ b/device/celestica/x86_64-cel_e1031-r0/sonic_platform/common.py @@ -0,0 +1,312 @@ +import os +import imp +import yaml +import subprocess + +from sonic_py_common import device_info + + +class Common: + + DEVICE_PATH = '/usr/share/sonic/device/' + PMON_PLATFORM_PATH = '/usr/share/sonic/platform/' + CONFIG_DIR = 'sonic_platform_config' + + OUTPUT_SOURCE_IPMI = 'ipmitool' + OUTPUT_SOURCE_GIVEN_LIST = 'value_list' + OUTPUT_SOURCE_GIVEN_VALUE = 'value' + OUTPUT_SOURCE_GIVEN_CLASS = 'class' + OUTPUT_SOURCE_SYSFS = 'sysfs_value' + OUTPUT_SOURCE_FUNC = 'function' + OUTPUT_SOURCE_GIVEN_TXT_FILE = 'txt_file' + OUTPUT_SOURCE_GIVEN_VER_HEX_FILE = 'hex_version_file' + OUTPUT_SOURCE_GIVEN_VER_HEX_ADDR = 'hex_version_getreg' + + SET_METHOD_IPMI = 'ipmitool' + NULL_VAL = 'N/A' + HOST_CHK_CMD = "docker > /dev/null 2>&1" + REF_KEY = '$ref:' + + def __init__(self, conf=None): + self._main_conf = conf + self.platform = None + self.hwsku = None + + def get_platform(self): + (self.platform, self.hwsku) = device_info.get_platform_and_hwsku( + ) if not self.platform else (self.platform, self.hwsku) + return self.platform + + def get_hwsku(self): + (self.platform, self.hwsku) = device_info.get_platform_and_hwsku( + ) if not self.hwsku else (self.platform, self.hwsku) + return self.hwsku + + def run_command(self, command): + status = False + output = "" + try: + p = subprocess.Popen( + command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + raw_data, err = p.communicate() + if p.returncode == 0: + status, output = True, raw_data.strip() + except Exception: + pass + return status, output + + def _clean_input(self, input, config): + cleaned_input = input + + ai = config.get('avaliable_input') + if ai and input not in ai: + return None + + input_translator = config.get('input_translator') + if type(input_translator) is dict: + cleaned_input = input_translator.get(input) + + elif type(input_translator) is str: + cleaned_input = eval(input_translator.format(input)) + + return cleaned_input + + def _clean_output(self, index, output, config): + output_translator = config.get('output_translator') + + if type(output_translator) is dict: + output = output_translator.get(output) + elif type(output_translator) is str: + output = eval(output_translator.format(output)) + elif type(output_translator) is list: + output = eval(output_translator[index].format(output)) + + return output + + def _ipmi_get(self, index, config): + argument = config.get('argument') + cmd = config['command'].format( + config['argument'][index]) if argument else config['command'] + status, output = self.run_command(cmd) + return output if status else None + + def _sysfs_read(self, index, config): + sysfs_path = config.get('sysfs_path') + argument = config.get('argument', '') + + if self.REF_KEY in argument: + argument = self._main_conf[argument.split(":")[1]] + + if type(argument) is list: + sysfs_path = sysfs_path.format(argument[index]) + + content = "" + try: + content = open(sysfs_path) + content = content.readline().rstrip() + except IOError as e: + print("Error: unable to open file: %s" % str(e)) + return False + + return content + + def _sysfs_write(self, index, config, input): + sysfs_path = config.get('sysfs_path') + argument = config.get('argument', '') + + if self.REF_KEY in argument: + argument = self._main_conf[argument.split(":")[1]] + + if type(argument) is list: + sysfs_path = sysfs_path.format(argument[index]) + + write_offset = int(config.get('write_offset', 0)) + output = "" + try: + open_file = open(sysfs_path, "r+") + open_file.seek(write_offset) + open_file.write(input) + open_file.close() + except IOError as e: + print("Error: unable to open file: %s" % str(e)) + return False, output + return True, output + + def _ipmi_set(self, index, config, input): + arg = config['argument'][index].format(input) + return self.run_command(config['command'].format(arg)) + + def _hex_ver_decode(self, hver, num_of_bits, num_of_points): + ver_list = [] + c_bit = 0 + bin_val = bin(int(hver, 16))[2:].zfill(num_of_bits) + bit_split = num_of_bits / (num_of_points + 1) + for x in range(0, num_of_points+1): + split_bin = bin_val[c_bit:c_bit+bit_split] + ver_list.append(str(int(split_bin, 2))) + c_bit += bit_split + return '.'.join(ver_list) + + def _get_class(self, config): + """ + Retreives value of expected attribute + Returns: + A value of the attribute of object + """ + path = config['host_path'] if self.is_host() else config['pmon_path'] + module = imp.load_source(config['class'], path) + class_ = getattr(module, config['class']) + return class_ + + def get_reg(self, path, reg_addr): + cmd = "echo {1} > {0}; cat {0}".format(path, reg_addr) + status, output = self.run_command(cmd) + return output if status else None + + def set_reg(self, path, reg_addr, value): + cmd = "echo {0} {1} > {2}".format(reg_addr, value, path) + status, output = self.run_command(cmd) + return output if status else None + + def read_txt_file(self, path): + try: + with open(path, 'r') as f: + output = f.readline() + return output.strip('\n') + except Exception: + pass + return '' + + def read_one_line_file(self, file_path): + try: + with open(file_path, 'r') as fd: + data = fd.readline() + return data.strip() + except IOError: + pass + return '' + + def write_txt_file(self, file_path, value): + try: + with open(file_path, 'w') as fd: + fd.write(str(value)) + except Exception: + return False + return True + + def is_host(self): + return os.system(self.HOST_CHK_CMD) == 0 + + def load_json_file(self, path): + """ + Retrieves the json object from json file path + + Returns: + A json object + """ + with open(path, 'r') as f: + json_data = yaml.safe_load(f) + + return json_data + + def get_config_path(self, config_name): + """ + Retrieves the path to platform api config directory + + Args: + config_name: A string containing the name of config file. + + Returns: + A string containing the path to json file + """ + return os.path.join(self.DEVICE_PATH, self.platform, self.CONFIG_DIR, config_name) if self.is_host() else os.path.join(self.PMON_PLATFORM_PATH, self.CONFIG_DIR, config_name) + + def get_output(self, index, config, default): + """ + Retrieves the output for each function base on config + + Args: + index: An integer containing the index of device. + config: A dict object containing the configuration of specified function. + default: A string containing the default output of specified function. + + Returns: + A string containing the output of specified function in config + """ + output_source = config.get('output_source') + + if output_source == self.OUTPUT_SOURCE_IPMI: + output = self._ipmi_get(index, config) + + elif output_source == self.OUTPUT_SOURCE_GIVEN_VALUE: + output = config["value"] + + elif output_source == self.OUTPUT_SOURCE_GIVEN_CLASS: + output = self._get_class(config) + + elif output_source == self.OUTPUT_SOURCE_GIVEN_LIST: + output = config["value_list"][index] + + elif output_source == self.OUTPUT_SOURCE_SYSFS: + output = self._sysfs_read(index, config) + + elif output_source == self.OUTPUT_SOURCE_FUNC: + func_conf = self._main_conf[config['function'][index]] + output = self.get_output(index, func_conf, default) + + elif output_source == self.OUTPUT_SOURCE_GIVEN_TXT_FILE: + path = config.get('path') + output = self.read_txt_file(path) + + elif output_source == self.OUTPUT_SOURCE_GIVEN_VER_HEX_FILE: + path = config.get('path') + hex_ver = self.read_txt_file(path) + output = self._hex_ver_decode( + hex_ver, config['num_of_bits'], config['num_of_points']) + + elif output_source == self.OUTPUT_SOURCE_GIVEN_VER_HEX_ADDR: + path = config.get('path') + addr = config.get('reg_addr') + hex_ver = self.get_reg(path, addr) + output = self._hex_ver_decode( + hex_ver, config['num_of_bits'], config['num_of_points']) + + else: + output = default + + return self._clean_output(index, output, config) or default + + def set_output(self, index, input, config): + """ + Sets the output of specified function on config + + Args: + config: A dict object containing the configuration of specified function. + index: An integer containing the index of device. + input: A string containing the input of specified function. + + Returns: + bool: True if set function is successfully, False if not + """ + cleaned_input = self._clean_input(input, config) + if not cleaned_input: + return False + + set_method = config.get('set_method') + if set_method == self.SET_METHOD_IPMI: + output = self._ipmi_set(index, config, cleaned_input)[0] + elif set_method == self.OUTPUT_SOURCE_SYSFS: + output = self._sysfs_write(index, config, cleaned_input)[0] + else: + output = False + + return output + + def get_event(self, timeout, config, sfp_list): + """ + Returns a nested dictionary containing all devices which have + experienced a change at chassis level + + """ + event_class = self._get_class(config) + return event_class(sfp_list).get_event(timeout) diff --git a/device/celestica/x86_64-cel_e1031-r0/sonic_platform/component.py b/device/celestica/x86_64-cel_e1031-r0/sonic_platform/component.py index 7fdfc8756a4d..56fae35914ab 100644 --- a/device/celestica/x86_64-cel_e1031-r0/sonic_platform/component.py +++ b/device/celestica/x86_64-cel_e1031-r0/sonic_platform/component.py @@ -6,13 +6,12 @@ # ############################################################################# -import json -import os.path -import shutil -import shlex -import subprocess try: + import os.path + import shutil + import shlex + import subprocess from sonic_platform_base.component_base import ComponentBase except ImportError as e: raise ImportError(str(e) + "- required module not found") @@ -49,7 +48,7 @@ def __run_command(self, command): rc = process.poll() if rc != 0: return False - except: + except Exception: return False return True @@ -120,6 +119,29 @@ def get_firmware_version(self): return fw_version + def get_available_firmware_version(self, image_path): + """ + Retrieves the available firmware version of the component + Note: the firmware version will be read from image + Args: + image_path: A string, path to firmware image + Returns: + A string containing the available firmware version of the component + """ + return "N/A" + + def get_firmware_update_notification(self, image_path): + """ + Retrieves a notification on what should be done in order to complete + the component firmware update + Args: + image_path: A string, path to firmware image + Returns: + A string containing the component firmware update notification if required. + By default 'None' value will be used, which indicates that no actions are required + """ + return "None" + def install_firmware(self, image_path): """ Install firmware to module @@ -140,5 +162,73 @@ def install_firmware(self, image_path): install_command = "ispvm %s" % new_image_path # elif self.name == "BIOS": # install_command = "afulnx_64 %s /p /b /n /x /r" % image_path - return self.__run_command(install_command) + + def update_firmware(self, image_path): + """ + Updates firmware of the component + This API performs firmware update: it assumes firmware installation and loading in a single call. + In case platform component requires some extra steps (apart from calling Low Level Utility) + to load the installed firmware (e.g, reboot, power cycle, etc.) - this will be done automatically by API + Args: + image_path: A string, path to firmware image + Raises: + RuntimeError: update failed + """ + return False + + ############################################################## + ###################### Device methods ######################## + ############################################################## + + def get_presence(self): + """ + Retrieves the presence of the FAN + Returns: + bool: True if FAN is present, False if not + """ + return True + + def get_model(self): + """ + Retrieves the model number (or part number) of the device + Returns: + string: Model/part number of device + """ + return 'N/A' + + def get_serial(self): + """ + Retrieves the serial number of the device + Returns: + string: Serial number of device + """ + return 'N/A' + + def get_status(self): + """ + Retrieves the operational status of the device + Returns: + A boolean value, True if device is operating properly, False if not + """ + return True + + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device. + If the agent cannot determine the parent-relative position + for some reason, or if the associated value of + entPhysicalContainedIn is'0', then the value '-1' is returned + Returns: + integer: The 1-based relative physical position in parent device + or -1 if cannot determine the position + """ + return -1 + + def is_replaceable(self): + """ + Indicate whether this device is replaceable. + Returns: + bool: True if it is replaceable. + """ + return False diff --git a/device/celestica/x86_64-cel_e1031-r0/sonic_platform/eeprom.py b/device/celestica/x86_64-cel_e1031-r0/sonic_platform/eeprom.py index 0058fccfa0ca..48643b403071 100644 --- a/device/celestica/x86_64-cel_e1031-r0/sonic_platform/eeprom.py +++ b/device/celestica/x86_64-cel_e1031-r0/sonic_platform/eeprom.py @@ -8,24 +8,23 @@ ############################################################################# try: - import glob import os import sys import re - from array import array if sys.version_info.major == 3: from io import StringIO else: from cStringIO import StringIO - from sonic_platform_base.sonic_eeprom import eeprom_dts from sonic_platform_base.sonic_eeprom import eeprom_tlvinfo + from sonic_platform_base.sonic_eeprom.eeprom_base import EepromDecoder except ImportError as e: raise ImportError(str(e) + "- required module not found") CACHE_ROOT = '/var/cache/sonic/decode-syseeprom' CACHE_FILE = 'syseeprom_cache' +NULL = 'N/A' class Tlv(eeprom_tlvinfo.TlvInfoDecoder): @@ -34,8 +33,8 @@ class Tlv(eeprom_tlvinfo.TlvInfoDecoder): def __init__(self): self._eeprom_path = "/sys/class/i2c-adapter/i2c-2/2-0050/eeprom" + self._eeprom = None super(Tlv, self).__init__(self._eeprom_path, 0, '', True) - self._eeprom = self._load_eeprom() def __parse_output(self, decode_output): decode_output.replace('\0', '') @@ -46,13 +45,13 @@ def __parse_output(self, decode_output): for line in lines: try: match = re.search( - '(0x[0-9a-fA-F]{2})([\s]+[\S]+[\s]+)([\S]+)', line) + '(0x[0-9a-fA-F]{2})([\s]+[\S]+[\s]+)(.*$)', line) if match is not None: idx = match.group(1) value = match.group(3).rstrip('\0') _eeprom_info_dict[idx] = value - except: + except BaseException: pass return _eeprom_info_dict @@ -61,7 +60,7 @@ def _load_eeprom(self): sys.stdout = StringIO() try: self.read_eeprom_db() - except: + except BaseException: decode_output = sys.stdout.getvalue() sys.stdout = original_stdout return self.__parse_output(decode_output) @@ -73,7 +72,7 @@ def _load_eeprom(self): if not os.path.exists(CACHE_ROOT): try: os.makedirs(CACHE_ROOT) - except: + except BaseException: pass # @@ -82,7 +81,7 @@ def _load_eeprom(self): # try: self.set_cache_name(os.path.join(CACHE_ROOT, CACHE_FILE)) - except: + except BaseException: pass e = self.read_eeprom() @@ -91,7 +90,7 @@ def _load_eeprom(self): try: self.update_cache(e) - except: + except BaseException: pass self.decode_eeprom(e) @@ -104,11 +103,98 @@ def _load_eeprom(self): return self.__parse_output(decode_output) + def _valid_tlv(self, eeprom_data): + tlvinfo_type_codes_list = [ + self._TLV_CODE_PRODUCT_NAME, + self._TLV_CODE_PART_NUMBER, + self._TLV_CODE_SERIAL_NUMBER, + self._TLV_CODE_MAC_BASE, + self._TLV_CODE_MANUF_DATE, + self._TLV_CODE_DEVICE_VERSION, + self._TLV_CODE_LABEL_REVISION, + self._TLV_CODE_PLATFORM_NAME, + self._TLV_CODE_ONIE_VERSION, + self._TLV_CODE_MAC_SIZE, + self._TLV_CODE_MANUF_NAME, + self._TLV_CODE_MANUF_COUNTRY, + self._TLV_CODE_VENDOR_NAME, + self._TLV_CODE_DIAG_VERSION, + self._TLV_CODE_SERVICE_TAG, + self._TLV_CODE_VENDOR_EXT, + self._TLV_CODE_CRC_32 + ] + + for code in tlvinfo_type_codes_list: + code_str = "0x{:X}".format(code) + eeprom_data[code_str] = eeprom_data.get(code_str, NULL) + return eeprom_data + def get_eeprom(self): - return self._eeprom + self._eeprom = self._load_eeprom() if not self._eeprom else self._eeprom + return self._valid_tlv(self._eeprom) + + def get_pn(self): + return self.get_eeprom()['0x22'] def get_serial(self): - return self._eeprom.get('0x23', "Undefined.") + return self.get_eeprom()['0x23'] def get_mac(self): - return self._eeprom.get('0x24', "Undefined.") + return self.get_eeprom()['0x24'] + + +class DeviceEEPROM(eeprom_tlvinfo.TlvInfoDecoder): + + def __init__(self, eeprom_path, device_format, start_offset): + # Decode device eeprom as per specified format + self.format = device_format + self.start_offset = start_offset + + EepromDecoder.__init__(self, eeprom_path, self.format, + self.start_offset, '', True) + self._load_device_eeprom() + + def _load_device_eeprom(self): + """ + Reads the Fan/PSU EEPROM and interprets as per the specified format + """ + self.serial_number = 'NA' + self.model_str = 'NA' + + # device eeproms use proprietary format + try: + # Read Fan/PSU EEPROM as per the specified format. + self.eeprom_data = EepromDecoder.read_eeprom(self) + except Exception as e: + return + + if self.eeprom_data[0] == 255: + return + + (valid, data) = self._get_eeprom_field("Model") + if valid: + self.model_str = data.decode() + + try: + (valid, data) = self._get_eeprom_field("Serial Number") + if valid: + self.serial_number = data.decode() + except Exception as e: + return + + def _get_eeprom_field(self, field_name, decode=False): + """ + For a field name specified in the EEPROM format, returns the + presence of the field and the value for the same. + """ + field_start = 0 + for field in self.format: + field_end = field_start + field[2] + if field[0] == field_name: + if decode: + return (True, self.eeprom_data[field_start:field_end].decode('ascii')) + else: + return (True, self.eeprom_data[field_start:field_end]) + field_start = field_end + + return (False, None) diff --git a/device/celestica/x86_64-cel_e1031-r0/sonic_platform/event.py b/device/celestica/x86_64-cel_e1031-r0/sonic_platform/event.py new file mode 100644 index 000000000000..332751386c7f --- /dev/null +++ b/device/celestica/x86_64-cel_e1031-r0/sonic_platform/event.py @@ -0,0 +1,63 @@ +try: + import time + import select + from .common import Common + from sonic_py_common.logger import Logger +except ImportError as e: + raise ImportError(repr(e) + " - required module not found") + + +class SfpEvent: + ''' Listen to insert/remove sfp events ''' + + SFP_NUM_START = 49 + DELAY = 0.05 + INT_PATH = '/sys/devices/platform/e1031.smc/SFP/modabs_int' + GPIO_SUS7 = '/sys/devices/platform/hlx-ich.0/sci_int_gpio_sus7' + + def __init__(self, sfp_list): + self._api_common = Common() + self._sfp_list = sfp_list + self._logger = Logger() + + # clear interrupt + self._api_common.read_one_line_file(self.INT_PATH) + + def get_sfp_event(self, timeout): + epoll = select.epoll() + port_dict = {} + timeout_sec = timeout/1000 + + try: + # We get notified when there is an SCI interrupt from GPIO SUS7 + fd = open(self.GPIO_SUS7, "r") + fd.read() + + epoll.register(fd.fileno(), select.EPOLLIN & select.EPOLLET) + events = epoll.poll(timeout=timeout_sec if timeout != 0 else -1) + if events: + # Read the QSFP ABS interrupt & status registers + port_changes = self._api_common.read_one_line_file( + self.INT_PATH) + changes = int(port_changes, 16) + for sfp in self._sfp_list: + if sfp.port_num < self.SFP_NUM_START: + continue + + change = (changes >> sfp.port_num-self.SFP_NUM_START) & 1 + if change == 1: + time.sleep(self.DELAY) + port_status = sfp.get_presence() + port_dict[str(sfp.port_num) + ] = '1' if port_status else '0' + + return port_dict + except Exception as e: + self._logger.log_error("Failed to detect SfpEvent - " + repr(e)) + return False + + finally: + fd.close() + epoll.close() + + return False diff --git a/device/celestica/x86_64-cel_e1031-r0/sonic_platform/fan.py b/device/celestica/x86_64-cel_e1031-r0/sonic_platform/fan.py index 18cf513800aa..a652fa546ed0 100644 --- a/device/celestica/x86_64-cel_e1031-r0/sonic_platform/fan.py +++ b/device/celestica/x86_64-cel_e1031-r0/sonic_platform/fan.py @@ -6,12 +6,13 @@ # ############################################################################# -import json +from __future__ import division import math import os.path try: from sonic_platform_base.fan_base import FanBase + from .common import Common except ImportError as e: raise ImportError(str(e) + "- required module not found") @@ -20,8 +21,10 @@ EMC2305_MAX_PWM = 255 EMC2305_FAN_PWM = "pwm{}" EMC2305_FAN_TARGET = "fan{}_target" +EMC2305_FAN_PWM_MODE = "pwm{}_enable" EMC2305_FAN_INPUT = "pwm{}" FAN_NAME_LIST = ["FAN-1", "FAN-2", "FAN-3"] +FAN_SPEED_TOLERANCE = 10 PSU_FAN_MAX_RPM = 11000 PSU_HWMON_PATH = "/sys/bus/i2c/devices/i2c-{0}/{0}-00{1}/hwmon" PSU_I2C_MAPPING = { @@ -34,12 +37,16 @@ "addr": "5a" }, } +NULL_VAL = 'N/A' class Fan(FanBase): """Platform-specific Fan class""" def __init__(self, fan_tray_index, fan_index=0, is_psu_fan=False, psu_index=0): + FanBase.__init__(self) + + self._api_common = Common() self.fan_index = fan_index self.fan_tray_index = fan_tray_index self.is_psu_fan = is_psu_fan @@ -64,27 +71,9 @@ def __init__(self, fan_tray_index, fan_index=0, is_psu_fan=False, psu_index=0): self.fan_e1031_led = "fan{}_led" self.fan_e1031_led_col_map = { self.STATUS_LED_COLOR_GREEN: "green", - self.STATUS_LED_COLOR_RED: "amber", + self.STATUS_LED_COLOR_AMBER: "amber", self.STATUS_LED_COLOR_OFF: "off" } - FanBase.__init__(self) - - def __read_txt_file(self, file_path): - try: - with open(file_path, 'r') as fd: - data = fd.read() - return data.strip() - except IOError: - pass - return "" - - def __write_txt_file(self, file_path, value): - try: - with open(file_path, 'w') as fd: - fd.write(str(value)) - except: - return False - return True def __search_file_by_name(self, directory, file_name): for dirpath, dirnames, files in os.walk(directory): @@ -105,7 +94,8 @@ def get_direction(self): if not self.is_psu_fan: fan_direction_file = (FAN_PATH + self.fan_e1031_direction.format(self.fan_tray_index+1)) - raw = self.__read_txt_file(fan_direction_file).strip('\r\n') + raw = self._api_common.read_txt_file( + fan_direction_file).strip('\r\n') direction = self.FAN_DIRECTION_INTAKE if str( raw).upper() == "F2B" else self.FAN_DIRECTION_EXHAUST @@ -126,8 +116,8 @@ def get_speed(self): fan_speed_sysfs_name = "fan{}_input".format(self.fan_index+1) fan_speed_sysfs_path = self.__search_file_by_name( self.psu_hwmon_path, fan_speed_sysfs_name) - fan_speed_rpm = self.__read_txt_file(fan_speed_sysfs_path) or 0 - fan_speed_raw = float(fan_speed_rpm)/PSU_FAN_MAX_RPM * 100 + fan_speed_rpm = self._api_common.read_txt_file( + fan_speed_sysfs_path) or 0 speed = math.ceil(float(fan_speed_rpm) * 100 / PSU_FAN_MAX_RPM) elif self.get_presence(): chip = self.emc2305_chip_mapping[self.fan_index] @@ -136,7 +126,7 @@ def get_speed(self): sysfs_path = "%s%s/%s" % ( EMC2305_PATH, device, EMC2305_FAN_INPUT) sysfs_path = sysfs_path.format(fan_index[self.fan_tray_index]) - raw = self.__read_txt_file(sysfs_path).strip('\r\n') + raw = self._api_common.read_txt_file(sysfs_path).strip('\r\n') pwm = int(raw, 10) if raw else 0 speed = math.ceil(float(pwm * 100 / EMC2305_MAX_PWM)) @@ -160,14 +150,21 @@ def get_target_speed(self): chip = self.emc2305_chip_mapping[self.fan_index] device = chip['device'] fan_index = chip['index_map'] - sysfs_path = "%s%s/%s" % ( - EMC2305_PATH, device, EMC2305_FAN_TARGET) - sysfs_path = sysfs_path.format(fan_index[self.fan_tray_index]) - raw = self.__read_txt_file(sysfs_path).strip('\r\n') + + enable_path = "%s%s/%s" % ( + EMC2305_PATH, device, EMC2305_FAN_PWM_MODE) + enable = self._api_common.read_txt_file( + enable_path.format(fan_index[self.fan_tray_index])) + + target_mode = EMC2305_FAN_TARGET if enable != "0" else EMC2305_FAN_PWM + target_path = "%s%s/%s" % (EMC2305_PATH, device, + target_mode.format(fan_index[self.fan_tray_index])) + + raw = self._api_common.read_txt_file(target_path) pwm = int(raw, 10) if raw else 0 target = math.ceil(float(pwm) * 100 / EMC2305_MAX_PWM) - return target + return int(target) def get_speed_tolerance(self): """ @@ -176,7 +173,7 @@ def get_speed_tolerance(self): An integer, the percentage of variance from target speed which is considered tolerable """ - return 10 + return FAN_SPEED_TOLERANCE def set_speed(self, speed): """ @@ -202,7 +199,7 @@ def set_speed(self, speed): sysfs_path = "%s%s/%s" % ( EMC2305_PATH, device, EMC2305_FAN_PWM) sysfs_path = sysfs_path.format(fan_index[self.fan_tray_index]) - return self.__write_txt_file(sysfs_path, int(pwm)) + return self._api_common.write_txt_file(sysfs_path, int(pwm)) return False @@ -220,11 +217,33 @@ def set_status_led(self, color): fan_led_file = (FAN_PATH + self.fan_e1031_led.format(self.fan_tray_index+1)) - set_status_led = self.__write_txt_file( + set_status_led = self._api_common.write_txt_file( fan_led_file, self.fan_e1031_led_col_map[color]) if self.get_presence() else False return set_status_led + def get_status_led(self): + """ + Gets the state of the fan status LED + Returns: + A string, one of the predefined STATUS_LED_COLOR_* strings above + """ + led = self.STATUS_LED_COLOR_GREEN + if not self.is_psu_fan: + fan_led_file = (FAN_PATH + + self.fan_e1031_led.format(self.fan_tray_index+1)) + + led = self._api_common.read_txt_file(fan_led_file) + return { + 'green': self.STATUS_LED_COLOR_GREEN, + 'off': self.STATUS_LED_COLOR_OFF, + 'amber': self.STATUS_LED_COLOR_AMBER + }.get(led, self.STATUS_LED_COLOR_OFF) + + ############################################################## + ###################### Device methods ######################## + ############################################################## + def get_name(self): """ Retrieves the name of the device @@ -244,6 +263,67 @@ def get_presence(self): """ fan_direction_file = (FAN_PATH + self.fan_e1031_presence.format(self.fan_tray_index+1)) - present_str = self.__read_txt_file(fan_direction_file) or '1' + present_str = self._api_common.read_txt_file(fan_direction_file) or '1' return int(present_str) == 0 if not self.is_psu_fan else True + + def get_model(self): + """ + Retrieves the model number (or part number) of the device + Returns: + string: Model/part number of device + """ + return NULL_VAL + + def get_serial(self): + """ + Retrieves the serial number of the device + Returns: + string: Serial number of device + """ + return NULL_VAL + + def get_status(self): + """ + Retrieves the operational status of the device + Returns: + A boolean value, True if device is operating properly, False if not + """ + status = 1 + if self.is_psu_fan: + fan_fault_sysfs_name = "fan1_fault" + fan_fault_sysfs_path = self.__search_file_by_name( + self.psu_hwmon_path, fan_fault_sysfs_name) + status = self._api_common.read_one_line_file(fan_fault_sysfs_path) + + elif self.get_presence(): + chip = self.emc2305_chip_mapping[self.fan_index] + device = chip['device'] + fan_index = chip['index_map'] + sysfs_path = "%s%s/%s" % ( + EMC2305_PATH, device, 'fan{}_fault') + sysfs_path = sysfs_path.format(fan_index[self.fan_tray_index]) + status = self._api_common.read_one_line_file(sysfs_path) + + return False if int(status) != 0 else True + + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device. + If the agent cannot determine the parent-relative position + for some reason, or if the associated value of + entPhysicalContainedIn is'0', then the value '-1' is returned + Returns: + integer: The 1-based relative physical position in parent device + or -1 if cannot determine the position + """ + return (self.fan_tray_index*2 + self.fan_index + 1) \ + if not self.is_psu_fan else (self.fan_index+1) + + def is_replaceable(self): + """ + Indicate whether this device is replaceable. + Returns: + bool: True if it is replaceable. + """ + return True if not self.is_psu_fan else False diff --git a/device/celestica/x86_64-cel_e1031-r0/sonic_platform/fan_drawer.py b/device/celestica/x86_64-cel_e1031-r0/sonic_platform/fan_drawer.py new file mode 100644 index 000000000000..9b912a52c444 --- /dev/null +++ b/device/celestica/x86_64-cel_e1031-r0/sonic_platform/fan_drawer.py @@ -0,0 +1,118 @@ +#!/usr/bin/env python + +############################################################################# +# Celestica +# +# Module contains an implementation of SONiC Platform Base API and +# provides the the Fan-Drawers' information available in the platform +# +############################################################################# + +try: + from sonic_platform_base.fan_drawer_base import FanDrawerBase +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +NUM_FAN = 1 +MAX_FAN_WATT = 10.0 + + +class FanDrawer(FanDrawerBase): + def __init__(self, fantray_index): + FanDrawerBase.__init__(self) + self._index = fantray_index + 1 + self._init_fan(fantray_index) + + def _init_fan(self, fantray_index): + from sonic_platform.fan import Fan + for index in range(NUM_FAN): + fan = Fan(fantray_index, index) + self._fan_list.append(fan) + + def set_status_led(self, color): + """ + Sets the state of the fan drawer status LED + Args: + color: A string representing the color with which to set the + fan drawer status LED + Returns: + bool: True if status LED state is set successfully, False if not + """ + return self._fan_list[0].set_status_led(color) + + def get_status_led(self, color=None): + """ + Gets the state of the fan drawer LED + Returns: + A string, one of the predefined STATUS_LED_COLOR_* strings above + """ + return self._fan_list[0].get_status_led() + + def get_maximum_consumed_power(self): + """ + Retrives the maximum power drawn by Fan Drawer + Returns: + A float, with value of the maximum consumable power of the + component. + """ + return MAX_FAN_WATT + + ############################################################## + ###################### Device methods ######################## + ############################################################## + + def get_name(self): + """ + Retrieves the name of the device + Returns: + string: The name of the device + """ + return "Drawer{}".format(self._index) + + def get_presence(self): + """ + Retrieves the presence of the device + Returns: + bool: True if device is present, False if not + """ + return self._fan_list[0].get_presence() + + def get_model(self): + """ + Retrieves the model number (or part number) of the device + Returns: + string: Model/part number of device + """ + return self._fan_list[0].get_model() + + def get_serial(self): + """ + Retrieves the serial number of the device + Returns: + string: Serial number of device + """ + return self._fan_list[0].get_serial() + + def get_status(self): + """ + Retrieves the operational status of the device + Returns: + A boolean value, True if device is operating properly, False if not + """ + return self._fan_list[0].get_status() + + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device + Returns: + integer: The 1-based relative physical position in parent device + """ + return self._index + + def is_replaceable(self): + """ + Indicate whether this device is replaceable. + Returns: + bool: True if it is replaceable. + """ + return True diff --git a/device/celestica/x86_64-cel_e1031-r0/sonic_platform/psu.py b/device/celestica/x86_64-cel_e1031-r0/sonic_platform/psu.py index 27d70f123c59..0ea4aceeba7b 100644 --- a/device/celestica/x86_64-cel_e1031-r0/sonic_platform/psu.py +++ b/device/celestica/x86_64-cel_e1031-r0/sonic_platform/psu.py @@ -7,15 +7,17 @@ ############################################################################# import os.path -import sonic_platform try: from sonic_platform_base.psu_base import PsuBase from sonic_platform.fan import Fan + from .common import Common + from .eeprom import DeviceEEPROM except ImportError as e: raise ImportError(str(e) + "- required module not found") FAN_E1031_SPEED_PATH = "/sys/class/hwmon/hwmon{}/fan1_input" +PSU_E1031_STAT_PATH = "/sys/devices/platform/e1031.smc/" HWMON_PATH = "/sys/bus/i2c/devices/i2c-{0}/{0}-00{1}/hwmon" FAN_MAX_RPM = 11000 PSU_NAME_LIST = ["PSU-R", "PSU-L"] @@ -23,13 +25,22 @@ PSU_I2C_MAPPING = { 0: { "num": 13, - "addr": "5b" + "addr": "5b", + "eeprom_addr": "53" }, 1: { "num": 12, - "addr": "5a" + "addr": "5a", + "eeprom_addr": "52" }, } +PSU_EEPROM_PATH = "/sys/bus/i2c/devices/{}-00{}/eeprom" +PSU_EEPROM_FORMAT = [ + ('Serial Number', 's', 16), ('burn', 'x', 16), + ('Model', 's', 16), + ('Part Number', 's', 16), +] +PSU_EEPROM_START_OFFSET = 48 class Psu(PsuBase): @@ -37,32 +48,26 @@ class Psu(PsuBase): def __init__(self, psu_index): PsuBase.__init__(self) + + self._api_common = Common() self.index = psu_index - self.psu_path = "/sys/devices/platform/e1031.smc/" self.psu_presence = "psu{}_prs" self.psu_oper_status = "psu{}_status" self.i2c_num = PSU_I2C_MAPPING[self.index]["num"] self.i2c_addr = PSU_I2C_MAPPING[self.index]["addr"] self.hwmon_path = HWMON_PATH.format(self.i2c_num, self.i2c_addr) + self.eeprom_addr = PSU_EEPROM_PATH.format( + self.i2c_num, PSU_I2C_MAPPING[self.index]["eeprom_addr"]) + for fan_index in range(0, PSU_NUM_FAN[self.index]): fan = Fan(fan_index, 0, is_psu_fan=True, psu_index=self.index) self._fan_list.append(fan) - PsuBase.__init__(self) - def __read_txt_file(self, file_path): - try: - with open(file_path, 'r') as fd: - data = fd.read() - return data.strip() - except IOError: - pass - return "" - - def __search_file_by_contain(self, directory, search_str, file_start): + def _search_file_by_contain(self, directory, search_str, file_start): for dirpath, dirnames, files in os.walk(directory): for name in files: file_path = os.path.join(dirpath, name) - if name.startswith(file_start) and search_str in self.__read_txt_file(file_path): + if name.startswith(file_start) and search_str in self._api_common.read_txt_file(file_path): return file_path return None @@ -77,7 +82,7 @@ def get_voltage(self): voltage_name = "in{}_input" voltage_label = "vout1" - vout_label_path = self.__search_file_by_contain( + vout_label_path = self._search_file_by_contain( self.hwmon_path, voltage_label, "in") if vout_label_path: dir_name = os.path.dirname(vout_label_path) @@ -85,7 +90,7 @@ def get_voltage(self): in_num = ''.join(list(filter(str.isdigit, basename))) vout_path = os.path.join( dir_name, voltage_name.format(in_num)) - vout_val = self.__read_txt_file(vout_path) + vout_val = self._api_common.read_txt_file(vout_path) psu_voltage = float(vout_val) / 1000 return psu_voltage @@ -100,7 +105,7 @@ def get_current(self): current_name = "curr{}_input" current_label = "iout1" - curr_label_path = self.__search_file_by_contain( + curr_label_path = self._search_file_by_contain( self.hwmon_path, current_label, "cur") if curr_label_path: dir_name = os.path.dirname(curr_label_path) @@ -108,7 +113,7 @@ def get_current(self): cur_num = ''.join(list(filter(str.isdigit, basename))) cur_path = os.path.join( dir_name, current_name.format(cur_num)) - cur_val = self.__read_txt_file(cur_path) + cur_val = self._api_common.read_txt_file(cur_path) psu_current = float(cur_val) / 1000 return psu_current @@ -123,7 +128,7 @@ def get_power(self): current_name = "power{}_input" current_label = "pout1" - pw_label_path = self.__search_file_by_contain( + pw_label_path = self._search_file_by_contain( self.hwmon_path, current_label, "power") if pw_label_path: dir_name = os.path.dirname(pw_label_path) @@ -131,7 +136,7 @@ def get_power(self): pw_num = ''.join(list(filter(str.isdigit, basename))) pw_path = os.path.join( dir_name, current_name.format(pw_num)) - pw_val = self.__read_txt_file(pw_path) + pw_val = self._api_common.read_txt_file(pw_path) psu_power = float(pw_val) / 1000000 return psu_power @@ -166,6 +171,10 @@ def get_status_led(self): # Hardware not supported return self.STATUS_LED_COLOR_OFF + ############################################################## + ###################### Device methods ######################## + ############################################################## + def get_name(self): """ Retrieves the name of the device @@ -181,8 +190,8 @@ def get_presence(self): bool: True if PSU is present, False if not """ psu_location = ["R", "L"] - presences_status = self.__read_txt_file( - self.psu_path + self.psu_presence.format(psu_location[self.index])) or 0 + presences_status = self._api_common.read_txt_file( + PSU_E1031_STAT_PATH + self.psu_presence.format(psu_location[self.index])) or 0 return int(presences_status) == 1 @@ -193,7 +202,153 @@ def get_status(self): A boolean value, True if device is operating properly, False if not """ psu_location = ["R", "L"] - power_status = self.__read_txt_file( - self.psu_path + self.psu_oper_status.format(psu_location[self.index])) or 0 + power_status = self._api_common.read_txt_file( + PSU_E1031_STAT_PATH + self.psu_oper_status.format(psu_location[self.index])) or 0 return int(power_status) == 1 + + def get_model(self): + """ + Retrieves the model number (or part number) of the device + Returns: + string: Model/part number of device + """ + self._eeprom = DeviceEEPROM( + self.eeprom_addr, PSU_EEPROM_FORMAT, PSU_EEPROM_START_OFFSET) + return self._eeprom.model_str + + def get_serial(self): + """ + Retrieves the serial number of the device + Returns: + string: Serial number of device + """ + self._eeprom = DeviceEEPROM( + self.eeprom_addr, PSU_EEPROM_FORMAT, PSU_EEPROM_START_OFFSET) + return self._eeprom.serial_number + + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device. If the agent cannot determine the parent-relative position + for some reason, or if the associated value of entPhysicalContainedIn is '0', then the value '-1' is returned + Returns: + integer: The 1-based relative physical position in parent device or -1 if cannot determine the position + """ + return self.index + 1 + + def is_replaceable(self): + """ + Indicate whether this device is replaceable. + Returns: + bool: True if it is replaceable. + """ + return True + + def get_temperature(self): + """ + Retrieves current temperature reading from PSU + Returns: + A float number of current temperature in Celsius up to nearest thousandth + of one degree Celsius, e.g. 30.125 + there are three temp sensors , we choose one of them + """ + psu_temperature = None + temperature_name = "temp{}_input" + temperature_label = "vout1" + + vout_label_path = self._search_file_by_contain( + self.hwmon_path, temperature_label, "in") + if vout_label_path: + dir_name = os.path.dirname(vout_label_path) + basename = os.path.basename(vout_label_path) + in_num = ''.join(list(filter(str.isdigit, basename))) + temp_path = os.path.join( + dir_name, temperature_name.format(in_num)) + vout_val = self._api_common.read_txt_file(temp_path) + psu_temperature = float(vout_val) / 1000 + + return psu_temperature + + def get_temperature_high_threshold(self): + """ + Retrieves the high threshold temperature of PSU + Returns: + A float number, the high threshold temperature of PSU in Celsius + up to nearest thousandth of one degree Celsius, e.g. 30.125 + there are three temp sensors , we choose one of them + """ + psu_temperature = None + temperature_name = "temp{}_max" + temperature_label = "vout1" + + vout_label_path = self._search_file_by_contain( + self.hwmon_path, temperature_label, "in") + if vout_label_path: + dir_name = os.path.dirname(vout_label_path) + basename = os.path.basename(vout_label_path) + in_num = ''.join(list(filter(str.isdigit, basename))) + temp_path = os.path.join( + dir_name, temperature_name.format(in_num)) + vout_val = self._api_common.read_txt_file(temp_path) + psu_temperature = float(vout_val) / 1000 + + return psu_temperature + + def get_voltage_high_threshold(self): + """ + Retrieves the high threshold PSU voltage output + Returns: + A float number, the high threshold output voltage in volts, + e.g. 12.1 + """ + psu_voltage = 12.6 + voltage_name = "in{}_crit" + voltage_label = "vout1" + + vout_label_path = self._search_file_by_contain( + self.hwmon_path, voltage_label, "in") + if vout_label_path: + dir_name = os.path.dirname(vout_label_path) + basename = os.path.basename(vout_label_path) + in_num = ''.join(list(filter(str.isdigit, basename))) + vout_path = os.path.join( + dir_name, voltage_name.format(in_num)) + if os.path.exists(vout_path): + vout_val = self._api_common.read_txt_file(vout_path) + psu_voltage = float(vout_val) / 1000 + + return psu_voltage + + def get_voltage_low_threshold(self): + """ + Retrieves the low threshold PSU voltage output + Returns: + A float number, the low threshold output voltage in volts, + e.g. 12.1 + """ + psu_voltage = 11.4 + voltage_name = "in{}_lcrit" + voltage_label = "vout1" + + vout_label_path = self._search_file_by_contain( + self.hwmon_path, voltage_label, "in") + if vout_label_path: + dir_name = os.path.dirname(vout_label_path) + basename = os.path.basename(vout_label_path) + in_num = ''.join(list(filter(str.isdigit, basename))) + vout_path = os.path.join( + dir_name, voltage_name.format(in_num)) + if os.path.exists(vout_path): + vout_val = self._api_common.read_txt_file(vout_path) + psu_voltage = float(vout_val) / 1000 + + return psu_voltage + + def get_maximum_supplied_power(self): + """ + Retrieves the maximum supplied power by PSU + Returns: + A float number, the maximum power output in Watts. + e.g. 1200.1 + """ + return 200.0 diff --git a/device/celestica/x86_64-cel_e1031-r0/sonic_platform/sfp.py b/device/celestica/x86_64-cel_e1031-r0/sonic_platform/sfp.py index 608111d7e2fd..0d1d02bf0159 100644 --- a/device/celestica/x86_64-cel_e1031-r0/sonic_platform/sfp.py +++ b/device/celestica/x86_64-cel_e1031-r0/sonic_platform/sfp.py @@ -6,25 +6,43 @@ # ############################################################################# -import os -import time -import subprocess -from ctypes import create_string_buffer - try: + import time + from ctypes import c_char from sonic_platform_base.sfp_base import SfpBase - from sonic_platform_base.sonic_sfp.sff8472 import sff8472Dom from sonic_platform_base.sonic_sfp.sff8472 import sff8472InterfaceId - from sonic_platform_base.sonic_sfp.sff8472 import sffbase - from sonic_platform_base.sonic_sfp.sfputilhelper import SfpUtilHelper + from sonic_platform_base.sonic_sfp.sff8472 import sff8472Dom + from sonic_platform_base.sonic_sfp.sff8436 import sff8436InterfaceId + from sonic_platform_base.sonic_sfp.sff8436 import sff8436Dom + from sonic_platform_base.sonic_sfp.inf8628 import inf8628InterfaceId + from .common import Common except ImportError as e: raise ImportError(str(e) + "- required module not found") -INFO_OFFSET = 0 -DOM_OFFSET = 256 +INFO_OFFSET = 128 +DOM_OFFSET = 0 +# definitions of the offset and width for values in XCVR info eeprom XCVR_INTFACE_BULK_OFFSET = 0 +XCVR_INTFACE_BULK_WIDTH_QSFP = 20 XCVR_INTFACE_BULK_WIDTH_SFP = 21 +XCVR_TYPE_OFFSET = 0 +XCVR_TYPE_WIDTH = 1 +XCVR_EXT_TYPE_OFFSET = 1 +XCVR_EXT_TYPE_WIDTH = 1 +XCVR_CONNECTOR_OFFSET = 2 +XCVR_CONNECTOR_WIDTH = 1 +XCVR_COMPLIANCE_CODE_OFFSET = 3 +XCVR_COMPLIANCE_CODE_WIDTH = 8 +XCVR_ENCODING_OFFSET = 11 +XCVR_ENCODING_WIDTH = 1 +XCVR_NBR_OFFSET = 12 +XCVR_NBR_WIDTH = 1 +XCVR_EXT_RATE_SEL_OFFSET = 13 +XCVR_EXT_RATE_SEL_WIDTH = 1 +XCVR_CABLE_LENGTH_OFFSET = 14 +XCVR_CABLE_LENGTH_WIDTH_QSFP = 5 +XCVR_CABLE_LENGTH_WIDTH_SFP = 6 XCVR_VENDOR_NAME_OFFSET = 20 XCVR_VENDOR_NAME_WIDTH = 16 XCVR_VENDOR_OUI_OFFSET = 37 @@ -32,30 +50,86 @@ XCVR_VENDOR_PN_OFFSET = 40 XCVR_VENDOR_PN_WIDTH = 16 XCVR_HW_REV_OFFSET = 56 +XCVR_HW_REV_WIDTH_OSFP = 2 +XCVR_HW_REV_WIDTH_QSFP = 2 XCVR_HW_REV_WIDTH_SFP = 4 XCVR_VENDOR_SN_OFFSET = 68 XCVR_VENDOR_SN_WIDTH = 16 XCVR_VENDOR_DATE_OFFSET = 84 XCVR_VENDOR_DATE_WIDTH = 8 XCVR_DOM_CAPABILITY_OFFSET = 92 -XCVR_DOM_CAPABILITY_WIDTH = 1 +XCVR_DOM_CAPABILITY_WIDTH = 2 + +XCVR_INTERFACE_DATA_START = 0 +XCVR_INTERFACE_DATA_SIZE = 92 + +QSFP_DOM_BULK_DATA_START = 22 +QSFP_DOM_BULK_DATA_SIZE = 36 +SFP_DOM_BULK_DATA_START = 96 +SFP_DOM_BULK_DATA_SIZE = 10 + +# definitions of the offset for values in OSFP info eeprom +OSFP_TYPE_OFFSET = 0 +OSFP_VENDOR_NAME_OFFSET = 129 +OSFP_VENDOR_PN_OFFSET = 148 +OSFP_HW_REV_OFFSET = 164 +OSFP_VENDOR_SN_OFFSET = 166 + +# Offset for values in QSFP eeprom +QSFP_DOM_REV_OFFSET = 1 +QSFP_DOM_REV_WIDTH = 1 +QSFP_TEMPE_OFFSET = 22 +QSFP_TEMPE_WIDTH = 2 +QSFP_VOLT_OFFSET = 26 +QSFP_VOLT_WIDTH = 2 +QSFP_VERSION_COMPLIANCE_OFFSET = 1 +QSFP_VERSION_COMPLIANCE_WIDTH = 2 +QSFP_CHANNL_MON_OFFSET = 34 +QSFP_CHANNL_MON_WIDTH = 16 +QSFP_CHANNL_MON_WITH_TX_POWER_WIDTH = 24 +QSFP_CHANNL_DISABLE_STATUS_OFFSET = 86 +QSFP_CHANNL_DISABLE_STATUS_WIDTH = 1 +QSFP_CHANNL_RX_LOS_STATUS_OFFSET = 3 +QSFP_CHANNL_RX_LOS_STATUS_WIDTH = 1 +QSFP_CHANNL_TX_FAULT_STATUS_OFFSET = 4 +QSFP_CHANNL_TX_FAULT_STATUS_WIDTH = 1 +QSFP_CONTROL_OFFSET = 86 +QSFP_CONTROL_WIDTH = 8 +QSFP_MODULE_MONITOR_OFFSET = 0 +QSFP_MODULE_MONITOR_WIDTH = 9 +QSFP_POWEROVERRIDE_OFFSET = 93 +QSFP_POWEROVERRIDE_WIDTH = 1 +QSFP_POWEROVERRIDE_BIT = 0 +QSFP_POWERSET_BIT = 1 +QSFP_OPTION_VALUE_OFFSET = 192 +QSFP_OPTION_VALUE_WIDTH = 4 +QSFP_MODULE_UPPER_PAGE3_START = 384 +QSFP_MODULE_THRESHOLD_OFFSET = 128 +QSFP_MODULE_THRESHOLD_WIDTH = 24 +QSFP_CHANNL_THRESHOLD_OFFSET = 176 +QSFP_CHANNL_THRESHOLD_WIDTH = 24 + +SFP_MODULE_ADDRA2_OFFSET = 256 +SFP_MODULE_THRESHOLD_OFFSET = 0 +SFP_MODULE_THRESHOLD_WIDTH = 56 +SFP_CHANNL_THRESHOLD_OFFSET = 112 +SFP_CHANNL_THRESHOLD_WIDTH = 2 -# Offset for values in SFP eeprom SFP_TEMPE_OFFSET = 96 SFP_TEMPE_WIDTH = 2 SFP_VOLT_OFFSET = 98 SFP_VOLT_WIDTH = 2 SFP_CHANNL_MON_OFFSET = 100 SFP_CHANNL_MON_WIDTH = 6 -SFP_MODULE_THRESHOLD_OFFSET = 0 -SFP_MODULE_THRESHOLD_WIDTH = 40 -SFP_CHANNL_THRESHOLD_OFFSET = 112 -SFP_CHANNL_THRESHOLD_WIDTH = 2 SFP_STATUS_CONTROL_OFFSET = 110 SFP_STATUS_CONTROL_WIDTH = 1 SFP_TX_DISABLE_HARD_BIT = 7 SFP_TX_DISABLE_SOFT_BIT = 6 +qsfp_cable_length_tup = ('Length(km)', 'Length OM3(2m)', + 'Length OM2(m)', 'Length OM1(m)', + 'Length Cable Assembly(m)') + sfp_cable_length_tup = ('LengthSMFkm-UnitsOfKm', 'LengthSMF(UnitsOf100m)', 'Length50um(UnitsOf10m)', 'Length62.5um(UnitsOfm)', 'LengthCable(UnitsOfm)', 'LengthOM3(UnitsOf10m)') @@ -66,44 +140,63 @@ 'FibreChannelTechnology', 'SFP+CableTechnology', 'FibreChannelTransmissionMedia', 'FibreChannelSpeed') +qsfp_compliance_code_tup = ('10/40G Ethernet Compliance Code', 'SONET Compliance codes', + 'SAS/SATA compliance codes', 'Gigabit Ethernet Compliant codes', + 'Fibre Channel link length/Transmitter Technology', + 'Fibre Channel transmission media', 'Fibre Channel Speed') + +SFP_TYPE = "SFP" +QSFP_TYPE = "QSFP" +OSFP_TYPE = "OSFP" +ETP_TYPE = "ETP" + +SFP_PORT_START = 49 +SFP_PORT_END = 52 + +PORT_START = 1 +PORT_END = 55 + class Sfp(SfpBase): """Platform-specific Sfp class""" - # Port number - PORT_START = 1 - PORT_END = 52 + # Port I2C number port_to_i2c_mapping = { 49: 15, 50: 14, 51: 17, 52: 16 } - _sfp_port = list(range(49, PORT_END + 1)) + _sfp_port = list(range(SFP_PORT_START, SFP_PORT_END + 1)) + PRS_PATH = "/sys/devices/platform/e1031.smc/SFP/sfp_modabs" - PLATFORM_ROOT_PATH = '/usr/share/sonic/device' - PMON_HWSKU_PATH = '/usr/share/sonic/hwsku' - HOST_CHK_CMD = "docker > /dev/null 2>&1" - PLATFORM = "x86_64-cel_e1031-r0" - HWSKU = "Celestica-E1031-T48S4" + def __init__(self, sfp_index, sfp_name): + SfpBase.__init__(self) + + # Init common function + self._api_common = Common() - def __init__(self, sfp_index): # Init index self.index = sfp_index - self.port_num = self.index + self.port_num = self.index + 1 + + # Init sfp data + self.sfp_type = self.__get_sfp_type() + self.name = sfp_name # Init eeprom path eeprom_path = '/sys/bus/i2c/devices/i2c-{0}/{0}-0050/eeprom' self.port_to_eeprom_mapping = {} - for x in range(self.PORT_START, self.PORT_END + 1): + for x in range(PORT_START, PORT_END + 1): if x not in self._sfp_port: self.port_to_i2c_mapping[x] = None self.port_to_eeprom_mapping[x] = eeprom_path.format( self.port_to_i2c_mapping[x]) self.info_dict_keys = ['type', 'hardware_rev', 'serial', 'manufacturer', 'model', 'connector', 'encoding', 'ext_identifier', - 'ext_rateselect_compliance', 'cable_type', 'cable_length', 'nominal_bit_rate', 'specification_compliance', 'vendor_date', 'vendor_oui'] + 'ext_rateselect_compliance', 'cable_type', 'cable_length', 'nominal_bit_rate', 'specification_compliance', + 'vendor_date', 'vendor_oui', "application_advertisement", "type_abbrv_name"] self.dom_dict_keys = ['rx_los', 'tx_fault', 'reset_status', 'power_lpmode', 'tx_disable', 'tx_disable_channel', 'temperature', 'voltage', 'rx1power', 'rx2power', 'rx3power', 'rx4power', 'tx1bias', 'tx2bias', 'tx3bias', 'tx4bias', 'tx1power', 'tx2power', 'tx3power', 'tx4power'] @@ -111,11 +204,14 @@ def __init__(self, sfp_index): self.threshold_dict_keys = ['temphighalarm', 'temphighwarning', 'templowalarm', 'templowwarning', 'vcchighalarm', 'vcchighwarning', 'vcclowalarm', 'vcclowwarning', 'rxpowerhighalarm', 'rxpowerhighwarning', 'rxpowerlowalarm', 'rxpowerlowwarning', 'txpowerhighalarm', 'txpowerhighwarning', 'txpowerlowalarm', 'txpowerlowwarning', 'txbiashighalarm', 'txbiashighwarning', 'txbiaslowalarm', 'txbiaslowwarning'] - SfpBase.__init__(self) + self._dom_capability_detect() + + def __get_sfp_type(self): + return SFP_TYPE if self.port_num in self._sfp_port else ETP_TYPE def _convert_string_to_num(self, value_str): if "-inf" in value_str: - return 'N/A' + return float("-inf") elif "Unknown" in value_str: return 'N/A' elif 'dBm' in value_str: @@ -133,25 +229,7 @@ def _convert_string_to_num(self, value_str): else: return 'N/A' - def __read_txt_file(self, file_path): - try: - with open(file_path, 'r') as fd: - data = fd.read() - return data.strip() - except IOError: - pass - return "" - - def __is_host(self): - return os.system(self.HOST_CHK_CMD) == 0 - - def __get_path_to_port_config_file(self): - platform_path = "/".join([self.PLATFORM_ROOT_PATH, self.PLATFORM]) - hwsku_path = "/".join([platform_path, self.HWSKU] - ) if self.__is_host() else self.PMON_HWSKU_PATH - return "/".join([hwsku_path, "port_config.ini"]) - - def __read_eeprom_specific_bytes(self, offset, num_bytes): + def _read_eeprom_specific_bytes(self, offset, num_bytes): sysfsfile_eeprom = None eeprom_raw = [] for i in range(0, num_bytes): @@ -163,9 +241,13 @@ def __read_eeprom_specific_bytes(self, offset, num_bytes): sysfs_sfp_i2c_client_eeprom_path, mode="rb", buffering=0) sysfsfile_eeprom.seek(offset) raw = sysfsfile_eeprom.read(num_bytes) - for n in range(0, num_bytes): - eeprom_raw[n] = hex(ord(raw[n]))[2:].zfill(2) - except: + if isinstance(raw, str): + for n in range(0, num_bytes): + eeprom_raw[n] = hex(ord(raw[n]))[2:].zfill(2) + else: + for n in range(0, num_bytes): + eeprom_raw[n] = hex(raw[n])[2:].zfill(2) + except BaseException: pass finally: if sysfsfile_eeprom: @@ -173,6 +255,106 @@ def __read_eeprom_specific_bytes(self, offset, num_bytes): return eeprom_raw + def _dom_capability_detect(self): + if not self.get_presence(): + self.dom_supported = False + self.dom_temp_supported = False + self.dom_volt_supported = False + self.dom_rx_power_supported = False + self.dom_tx_power_supported = False + self.calibration = 0 + return + + if self.sfp_type == "QSFP": + self.calibration = 1 + sfpi_obj = sff8436InterfaceId() + if sfpi_obj is None: + self.dom_supported = False + offset = 128 + + # QSFP capability byte parse, through this byte can know whether it support tx_power or not. + # TODO: in the future when decided to migrate to support SFF-8636 instead of SFF-8436, + # need to add more code for determining the capability and version compliance + # in SFF-8636 dom capability definitions evolving with the versions. + qsfp_dom_capability_raw = self._read_eeprom_specific_bytes( + (offset + XCVR_DOM_CAPABILITY_OFFSET), XCVR_DOM_CAPABILITY_WIDTH) + if qsfp_dom_capability_raw is not None: + qsfp_version_compliance_raw = self._read_eeprom_specific_bytes( + QSFP_VERSION_COMPLIANCE_OFFSET, QSFP_VERSION_COMPLIANCE_WIDTH) + qsfp_version_compliance = int( + qsfp_version_compliance_raw[0], 16) + dom_capability = sfpi_obj.parse_dom_capability( + qsfp_dom_capability_raw, 0) + if qsfp_version_compliance >= 0x08: + self.dom_temp_supported = dom_capability['data']['Temp_support']['value'] == 'On' + self.dom_volt_supported = dom_capability['data']['Voltage_support']['value'] == 'On' + self.dom_rx_power_supported = dom_capability['data']['Rx_power_support']['value'] == 'On' + self.dom_tx_power_supported = dom_capability['data']['Tx_power_support']['value'] == 'On' + else: + self.dom_temp_supported = True + self.dom_volt_supported = True + self.dom_rx_power_supported = dom_capability['data']['Rx_power_support']['value'] == 'On' + self.dom_tx_power_supported = True + + self.dom_supported = True + self.calibration = 1 + sfpd_obj = sff8436Dom() + if sfpd_obj is None: + return None + qsfp_option_value_raw = self._read_eeprom_specific_bytes( + QSFP_OPTION_VALUE_OFFSET, QSFP_OPTION_VALUE_WIDTH) + if qsfp_option_value_raw is not None: + optional_capability = sfpd_obj.parse_option_params( + qsfp_option_value_raw, 0) + self.dom_tx_disable_supported = optional_capability[ + 'data']['TxDisable']['value'] == 'On' + dom_status_indicator = sfpd_obj.parse_dom_status_indicator( + qsfp_version_compliance_raw, 1) + self.qsfp_page3_available = dom_status_indicator['data']['FlatMem']['value'] == 'Off' + else: + self.dom_supported = False + self.dom_temp_supported = False + self.dom_volt_supported = False + self.dom_rx_power_supported = False + self.dom_tx_power_supported = False + self.calibration = 0 + self.qsfp_page3_available = False + + elif self.sfp_type == "SFP": + sfpi_obj = sff8472InterfaceId() + if sfpi_obj is None: + return None + sfp_dom_capability_raw = self._read_eeprom_specific_bytes( + XCVR_DOM_CAPABILITY_OFFSET, XCVR_DOM_CAPABILITY_WIDTH) + if sfp_dom_capability_raw is not None: + sfp_dom_capability = int(sfp_dom_capability_raw[0], 16) + self.dom_supported = (sfp_dom_capability & 0x40 != 0) + if self.dom_supported: + self.dom_temp_supported = True + self.dom_volt_supported = True + self.dom_rx_power_supported = True + self.dom_tx_power_supported = True + if sfp_dom_capability & 0x20 != 0: + self.calibration = 1 + elif sfp_dom_capability & 0x10 != 0: + self.calibration = 2 + else: + self.calibration = 0 + else: + self.dom_temp_supported = False + self.dom_volt_supported = False + self.dom_rx_power_supported = False + self.dom_tx_power_supported = False + self.calibration = 0 + self.dom_tx_disable_supported = ( + int(sfp_dom_capability_raw[1], 16) & 0x40 != 0) + else: + self.dom_supported = False + self.dom_temp_supported = False + self.dom_volt_supported = False + self.dom_rx_power_supported = False + self.dom_tx_power_supported = False + def get_transceiver_info(self): """ Retrieves transceiver info of this SFP @@ -196,85 +378,184 @@ def get_transceiver_info(self): vendor_date |1*255VCHAR |vendor date vendor_oui |1*255VCHAR |vendor OUI ======================================================================== - """ - # check present status - sfpi_obj = sff8472InterfaceId() - if not self.get_presence() or not sfpi_obj: - return {} - - offset = INFO_OFFSET - - sfp_interface_bulk_raw = self.__read_eeprom_specific_bytes( - (offset + XCVR_INTFACE_BULK_OFFSET), XCVR_INTFACE_BULK_WIDTH_SFP) - sfp_interface_bulk_data = sfpi_obj.parse_sfp_info_bulk( - sfp_interface_bulk_raw, 0) - - sfp_vendor_name_raw = self.__read_eeprom_specific_bytes( - (offset + XCVR_VENDOR_NAME_OFFSET), XCVR_VENDOR_NAME_WIDTH) - sfp_vendor_name_data = sfpi_obj.parse_vendor_name( - sfp_vendor_name_raw, 0) - - sfp_vendor_pn_raw = self.__read_eeprom_specific_bytes( - (offset + XCVR_VENDOR_PN_OFFSET), XCVR_VENDOR_PN_WIDTH) - sfp_vendor_pn_data = sfpi_obj.parse_vendor_pn( - sfp_vendor_pn_raw, 0) - - sfp_vendor_rev_raw = self.__read_eeprom_specific_bytes( - (offset + XCVR_HW_REV_OFFSET), XCVR_HW_REV_WIDTH_SFP) - sfp_vendor_rev_data = sfpi_obj.parse_vendor_rev( - sfp_vendor_rev_raw, 0) - - sfp_vendor_sn_raw = self.__read_eeprom_specific_bytes( - (offset + XCVR_VENDOR_SN_OFFSET), XCVR_VENDOR_SN_WIDTH) - sfp_vendor_sn_data = sfpi_obj.parse_vendor_sn( - sfp_vendor_sn_raw, 0) - - sfp_vendor_oui_raw = self.__read_eeprom_specific_bytes( - (offset + XCVR_VENDOR_OUI_OFFSET), XCVR_VENDOR_OUI_WIDTH) - if sfp_vendor_oui_raw is not None: - sfp_vendor_oui_data = sfpi_obj.parse_vendor_oui( - sfp_vendor_oui_raw, 0) - - sfp_vendor_date_raw = self.__read_eeprom_specific_bytes( - (offset + XCVR_VENDOR_DATE_OFFSET), XCVR_VENDOR_DATE_WIDTH) - sfp_vendor_date_data = sfpi_obj.parse_vendor_date( - sfp_vendor_date_raw, 0) - + """ + compliance_code_dict = {} transceiver_info_dict = dict.fromkeys(self.info_dict_keys, 'N/A') - compliance_code_dict = dict() + transceiver_info_dict['specification_compliance'] = '{}' + if not self.get_presence(): + return transceiver_info_dict + + # ToDo: OSFP tranceiver info parsing not fully supported. + # in inf8628.py lack of some memory map definition + # will be implemented when the inf8628 memory map ready + if self.sfp_type == OSFP_TYPE: + offset = 0 + vendor_rev_width = XCVR_HW_REV_WIDTH_OSFP + + sfpi_obj = inf8628InterfaceId() + if sfpi_obj is None: + return None + + sfp_type_raw = self._read_eeprom_specific_bytes( + (offset + OSFP_TYPE_OFFSET), XCVR_TYPE_WIDTH) + if sfp_type_raw is not None: + sfp_type_data = sfpi_obj.parse_sfp_type(sfp_type_raw, 0) + else: + return None + + sfp_vendor_name_raw = self._read_eeprom_specific_bytes( + (offset + OSFP_VENDOR_NAME_OFFSET), XCVR_VENDOR_NAME_WIDTH) + if sfp_vendor_name_raw is not None: + sfp_vendor_name_data = sfpi_obj.parse_vendor_name( + sfp_vendor_name_raw, 0) + else: + return None + + sfp_vendor_pn_raw = self._read_eeprom_specific_bytes( + (offset + OSFP_VENDOR_PN_OFFSET), XCVR_VENDOR_PN_WIDTH) + if sfp_vendor_pn_raw is not None: + sfp_vendor_pn_data = sfpi_obj.parse_vendor_pn( + sfp_vendor_pn_raw, 0) + else: + return None + + sfp_vendor_rev_raw = self._read_eeprom_specific_bytes( + (offset + OSFP_HW_REV_OFFSET), vendor_rev_width) + if sfp_vendor_rev_raw is not None: + sfp_vendor_rev_data = sfpi_obj.parse_vendor_rev( + sfp_vendor_rev_raw, 0) + else: + return None + + sfp_vendor_sn_raw = self._read_eeprom_specific_bytes( + (offset + OSFP_VENDOR_SN_OFFSET), XCVR_VENDOR_SN_WIDTH) + if sfp_vendor_sn_raw is not None: + sfp_vendor_sn_data = sfpi_obj.parse_vendor_sn( + sfp_vendor_sn_raw, 0) + else: + return None + + transceiver_info_dict['type'] = sfp_type_data['data']['type']['value'] + transceiver_info_dict['manufacturer'] = sfp_vendor_name_data['data']['Vendor Name']['value'] + transceiver_info_dict['model'] = sfp_vendor_pn_data['data']['Vendor PN']['value'] + transceiver_info_dict['hardware_rev'] = sfp_vendor_rev_data['data']['Vendor Rev']['value'] + transceiver_info_dict['serial'] = sfp_vendor_sn_data['data']['Vendor SN']['value'] + transceiver_info_dict['vendor_oui'] = 'N/A' + transceiver_info_dict['vendor_date'] = 'N/A' + transceiver_info_dict['connector'] = 'N/A' + transceiver_info_dict['encoding'] = 'N/A' + transceiver_info_dict['ext_identifier'] = 'N/A' + transceiver_info_dict['ext_rateselect_compliance'] = 'N/A' + transceiver_info_dict['cable_type'] = 'N/A' + transceiver_info_dict['cable_length'] = 'N/A' + transceiver_info_dict['specification_compliance'] = '{}' + transceiver_info_dict['nominal_bit_rate'] = 'N/A' - if sfp_interface_bulk_data: + else: + if self.sfp_type == QSFP_TYPE: + offset = 128 + vendor_rev_width = XCVR_HW_REV_WIDTH_QSFP + # cable_length_width = XCVR_CABLE_LENGTH_WIDTH_QSFP + interface_info_bulk_width = XCVR_INTFACE_BULK_WIDTH_QSFP + + sfpi_obj = sff8436InterfaceId() + if sfpi_obj is None: + print("Error: sfp_object open failed") + return None + + else: + offset = 0 + vendor_rev_width = XCVR_HW_REV_WIDTH_SFP + # cable_length_width = XCVR_CABLE_LENGTH_WIDTH_SFP + interface_info_bulk_width = XCVR_INTFACE_BULK_WIDTH_SFP + + sfpi_obj = sff8472InterfaceId() + if sfpi_obj is None: + print("Error: sfp_object open failed") + return None + sfp_interface_bulk_raw = self._read_eeprom_specific_bytes( + offset + XCVR_INTERFACE_DATA_START, XCVR_INTERFACE_DATA_SIZE) + if sfp_interface_bulk_raw is None: + return None + + start = XCVR_INTFACE_BULK_OFFSET - XCVR_INTERFACE_DATA_START + end = start + interface_info_bulk_width + sfp_interface_bulk_data = sfpi_obj.parse_sfp_info_bulk( + sfp_interface_bulk_raw[start: end], 0) + + start = XCVR_VENDOR_NAME_OFFSET - XCVR_INTERFACE_DATA_START + end = start + XCVR_VENDOR_NAME_WIDTH + sfp_vendor_name_data = sfpi_obj.parse_vendor_name( + sfp_interface_bulk_raw[start: end], 0) + + start = XCVR_VENDOR_PN_OFFSET - XCVR_INTERFACE_DATA_START + end = start + XCVR_VENDOR_PN_WIDTH + sfp_vendor_pn_data = sfpi_obj.parse_vendor_pn( + sfp_interface_bulk_raw[start: end], 0) + + start = XCVR_HW_REV_OFFSET - XCVR_INTERFACE_DATA_START + end = start + vendor_rev_width + sfp_vendor_rev_data = sfpi_obj.parse_vendor_rev( + sfp_interface_bulk_raw[start: end], 0) + + start = XCVR_VENDOR_SN_OFFSET - XCVR_INTERFACE_DATA_START + end = start + XCVR_VENDOR_SN_WIDTH + sfp_vendor_sn_data = sfpi_obj.parse_vendor_sn( + sfp_interface_bulk_raw[start: end], 0) + + start = XCVR_VENDOR_OUI_OFFSET - XCVR_INTERFACE_DATA_START + end = start + XCVR_VENDOR_OUI_WIDTH + sfp_vendor_oui_data = sfpi_obj.parse_vendor_oui( + sfp_interface_bulk_raw[start: end], 0) + + start = XCVR_VENDOR_DATE_OFFSET - XCVR_INTERFACE_DATA_START + end = start + XCVR_VENDOR_DATE_WIDTH + sfp_vendor_date_data = sfpi_obj.parse_vendor_date( + sfp_interface_bulk_raw[start: end], 0) transceiver_info_dict['type'] = sfp_interface_bulk_data['data']['type']['value'] + transceiver_info_dict['manufacturer'] = sfp_vendor_name_data['data']['Vendor Name']['value'] + transceiver_info_dict['model'] = sfp_vendor_pn_data['data']['Vendor PN']['value'] + transceiver_info_dict['hardware_rev'] = sfp_vendor_rev_data['data']['Vendor Rev']['value'] + transceiver_info_dict['serial'] = sfp_vendor_sn_data['data']['Vendor SN']['value'] + transceiver_info_dict['vendor_oui'] = sfp_vendor_oui_data['data']['Vendor OUI']['value'] + transceiver_info_dict['vendor_date'] = sfp_vendor_date_data[ + 'data']['VendorDataCode(YYYY-MM-DD Lot)']['value'] transceiver_info_dict['connector'] = sfp_interface_bulk_data['data']['Connector']['value'] transceiver_info_dict['encoding'] = sfp_interface_bulk_data['data']['EncodingCodes']['value'] transceiver_info_dict['ext_identifier'] = sfp_interface_bulk_data['data']['Extended Identifier']['value'] transceiver_info_dict['ext_rateselect_compliance'] = sfp_interface_bulk_data['data']['RateIdentifier']['value'] transceiver_info_dict['type_abbrv_name'] = sfp_interface_bulk_data['data']['type_abbrv_name']['value'] - transceiver_info_dict['manufacturer'] = sfp_vendor_name_data[ - 'data']['Vendor Name']['value'] if sfp_vendor_name_data else 'N/A' - transceiver_info_dict['model'] = sfp_vendor_pn_data['data']['Vendor PN']['value'] if sfp_vendor_pn_data else 'N/A' - transceiver_info_dict['hardware_rev'] = sfp_vendor_rev_data['data']['Vendor Rev']['value'] if sfp_vendor_rev_data else 'N/A' - transceiver_info_dict['serial'] = sfp_vendor_sn_data['data']['Vendor SN']['value'] if sfp_vendor_sn_data else 'N/A' - transceiver_info_dict['vendor_oui'] = sfp_vendor_oui_data['data']['Vendor OUI']['value'] if sfp_vendor_oui_data else 'N/A' - transceiver_info_dict['vendor_date'] = sfp_vendor_date_data[ - 'data']['VendorDataCode(YYYY-MM-DD Lot)']['value'] if sfp_vendor_date_data else 'N/A' - transceiver_info_dict['cable_type'] = "Unknown" - transceiver_info_dict['cable_length'] = "Unknown" - - for key in sfp_cable_length_tup: - if key in sfp_interface_bulk_data['data']: - transceiver_info_dict['cable_type'] = key - transceiver_info_dict['cable_length'] = str( - sfp_interface_bulk_data['data'][key]['value']) - - for key in sfp_compliance_code_tup: - if key in sfp_interface_bulk_data['data']['Specification compliance']['value']: - compliance_code_dict[key] = sfp_interface_bulk_data['data']['Specification compliance']['value'][key]['value'] - transceiver_info_dict['specification_compliance'] = str( - compliance_code_dict) - transceiver_info_dict['nominal_bit_rate'] = str( - sfp_interface_bulk_data['data']['NominalSignallingRate(UnitsOf100Mbd)']['value']) + if self.sfp_type == QSFP_TYPE: + for key in qsfp_cable_length_tup: + if key in sfp_interface_bulk_data['data']: + transceiver_info_dict['cable_type'] = key + transceiver_info_dict['cable_length'] = str( + sfp_interface_bulk_data['data'][key]['value']) + + for key in qsfp_compliance_code_tup: + if key in sfp_interface_bulk_data['data']['Specification compliance']['value']: + compliance_code_dict[key] = sfp_interface_bulk_data['data']['Specification compliance']['value'][key]['value'] + transceiver_info_dict['specification_compliance'] = str( + compliance_code_dict) + + transceiver_info_dict['nominal_bit_rate'] = str( + sfp_interface_bulk_data['data']['Nominal Bit Rate(100Mbs)']['value']) + else: + for key in sfp_cable_length_tup: + if key in sfp_interface_bulk_data['data']: + transceiver_info_dict['cable_type'] = key + transceiver_info_dict['cable_length'] = str( + sfp_interface_bulk_data['data'][key]['value']) + + for key in sfp_compliance_code_tup: + if key in sfp_interface_bulk_data['data']['Specification compliance']['value']: + compliance_code_dict[key] = sfp_interface_bulk_data['data']['Specification compliance']['value'][key]['value'] + transceiver_info_dict['specification_compliance'] = str( + compliance_code_dict) + + transceiver_info_dict['nominal_bit_rate'] = str( + sfp_interface_bulk_data['data']['NominalSignallingRate(UnitsOf100Mbd)']['value']) return transceiver_info_dict @@ -303,44 +584,117 @@ def get_transceiver_bulk_status(self): | |for example, tx2power stands for tx power of channel 2. ======================================================================== """ - # check present status - sfpd_obj = sff8472Dom() - if not self.get_presence() or not sfpd_obj: - return {} + transceiver_dom_info_dict = dict.fromkeys(self.dom_dict_keys, 'N/A') - eeprom_ifraw = self.__read_eeprom_specific_bytes(0, DOM_OFFSET) - sfpi_obj = sff8472InterfaceId(eeprom_ifraw) - cal_type = sfpi_obj.get_calibration_type() - sfpd_obj._calibration_type = cal_type + if self.sfp_type == OSFP_TYPE: + pass - offset = DOM_OFFSET - transceiver_dom_info_dict = dict.fromkeys(self.dom_dict_keys, 'N/A') - dom_temperature_raw = self.__read_eeprom_specific_bytes( - (offset + SFP_TEMPE_OFFSET), SFP_TEMPE_WIDTH) + elif self.sfp_type == QSFP_TYPE: + if not self.dom_supported: + return transceiver_dom_info_dict + + offset = 0 + sfpd_obj = sff8436Dom() + if sfpd_obj is None: + return transceiver_dom_info_dict + + dom_data_raw = self._read_eeprom_specific_bytes( + (offset + QSFP_DOM_BULK_DATA_START), QSFP_DOM_BULK_DATA_SIZE) + if dom_data_raw is None: + return transceiver_dom_info_dict + + if self.dom_temp_supported: + start = QSFP_TEMPE_OFFSET - QSFP_DOM_BULK_DATA_START + end = start + QSFP_TEMPE_WIDTH + dom_temperature_data = sfpd_obj.parse_temperature( + dom_data_raw[start: end], 0) + temp = self._convert_string_to_num( + dom_temperature_data['data']['Temperature']['value']) + if temp is not None: + transceiver_dom_info_dict['temperature'] = temp + + if self.dom_volt_supported: + start = QSFP_VOLT_OFFSET - QSFP_DOM_BULK_DATA_START + end = start + QSFP_VOLT_WIDTH + dom_voltage_data = sfpd_obj.parse_voltage( + dom_data_raw[start: end], 0) + volt = self._convert_string_to_num( + dom_voltage_data['data']['Vcc']['value']) + if volt is not None: + transceiver_dom_info_dict['voltage'] = volt + + start = QSFP_CHANNL_MON_OFFSET - QSFP_DOM_BULK_DATA_START + end = start + QSFP_CHANNL_MON_WITH_TX_POWER_WIDTH + dom_channel_monitor_data = sfpd_obj.parse_channel_monitor_params_with_tx_power( + dom_data_raw[start: end], 0) + + if self.dom_tx_power_supported: + transceiver_dom_info_dict['tx1power'] = self._convert_string_to_num( + dom_channel_monitor_data['data']['TX1Power']['value']) + transceiver_dom_info_dict['tx2power'] = self._convert_string_to_num( + dom_channel_monitor_data['data']['TX2Power']['value']) + transceiver_dom_info_dict['tx3power'] = self._convert_string_to_num( + dom_channel_monitor_data['data']['TX3Power']['value']) + transceiver_dom_info_dict['tx4power'] = self._convert_string_to_num( + dom_channel_monitor_data['data']['TX4Power']['value']) + + if self.dom_rx_power_supported: + transceiver_dom_info_dict['rx1power'] = self._convert_string_to_num( + dom_channel_monitor_data['data']['RX1Power']['value']) + transceiver_dom_info_dict['rx2power'] = self._convert_string_to_num( + dom_channel_monitor_data['data']['RX2Power']['value']) + transceiver_dom_info_dict['rx3power'] = self._convert_string_to_num( + dom_channel_monitor_data['data']['RX3Power']['value']) + transceiver_dom_info_dict['rx4power'] = self._convert_string_to_num( + dom_channel_monitor_data['data']['RX4Power']['value']) + + transceiver_dom_info_dict['tx1bias'] = self._convert_string_to_num( + dom_channel_monitor_data['data']['TX1Bias']['value']) + transceiver_dom_info_dict['tx2bias'] = self._convert_string_to_num( + dom_channel_monitor_data['data']['TX2Bias']['value']) + transceiver_dom_info_dict['tx3bias'] = self._convert_string_to_num( + dom_channel_monitor_data['data']['TX3Bias']['value']) + transceiver_dom_info_dict['tx4bias'] = self._convert_string_to_num( + dom_channel_monitor_data['data']['TX4Bias']['value']) + + else: + if not self.dom_supported: + return transceiver_dom_info_dict + + offset = 256 + sfpd_obj = sff8472Dom() + if sfpd_obj is None: + return transceiver_dom_info_dict + sfpd_obj._calibration_type = self.calibration - if dom_temperature_raw is not None: + dom_data_raw = self._read_eeprom_specific_bytes( + (offset + SFP_DOM_BULK_DATA_START), SFP_DOM_BULK_DATA_SIZE) + + start = SFP_TEMPE_OFFSET - SFP_DOM_BULK_DATA_START + end = start + SFP_TEMPE_WIDTH dom_temperature_data = sfpd_obj.parse_temperature( - dom_temperature_raw, 0) - transceiver_dom_info_dict['temperature'] = dom_temperature_data['data']['Temperature']['value'] - - dom_voltage_raw = self.__read_eeprom_specific_bytes( - (offset + SFP_VOLT_OFFSET), SFP_VOLT_WIDTH) - if dom_voltage_raw is not None: - dom_voltage_data = sfpd_obj.parse_voltage(dom_voltage_raw, 0) - transceiver_dom_info_dict['voltage'] = dom_voltage_data['data']['Vcc']['value'] - - dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( - (offset + SFP_CHANNL_MON_OFFSET), SFP_CHANNL_MON_WIDTH) - if dom_channel_monitor_raw is not None: - dom_voltage_data = sfpd_obj.parse_channel_monitor_params( - dom_channel_monitor_raw, 0) - transceiver_dom_info_dict['tx1power'] = dom_voltage_data['data']['TXPower']['value'] - transceiver_dom_info_dict['rx1power'] = dom_voltage_data['data']['RXPower']['value'] - transceiver_dom_info_dict['tx1bias'] = dom_voltage_data['data']['TXBias']['value'] - - for key in transceiver_dom_info_dict: - transceiver_dom_info_dict[key] = self._convert_string_to_num( - transceiver_dom_info_dict[key]) + dom_data_raw[start: end], 0) + + start = SFP_VOLT_OFFSET - SFP_DOM_BULK_DATA_START + end = start + SFP_VOLT_WIDTH + dom_voltage_data = sfpd_obj.parse_voltage( + dom_data_raw[start: end], 0) + + start = SFP_CHANNL_MON_OFFSET - SFP_DOM_BULK_DATA_START + end = start + SFP_CHANNL_MON_WIDTH + dom_channel_monitor_data = sfpd_obj.parse_channel_monitor_params( + dom_data_raw[start: end], 0) + + transceiver_dom_info_dict['temperature'] = self._convert_string_to_num( + dom_temperature_data['data']['Temperature']['value']) + transceiver_dom_info_dict['voltage'] = self._convert_string_to_num( + dom_voltage_data['data']['Vcc']['value']) + transceiver_dom_info_dict['rx1power'] = self._convert_string_to_num( + dom_channel_monitor_data['data']['RXPower']['value']) + transceiver_dom_info_dict['tx1bias'] = self._convert_string_to_num( + dom_channel_monitor_data['data']['TXBias']['value']) + transceiver_dom_info_dict['tx1power'] = self._convert_string_to_num( + dom_channel_monitor_data['data']['TXPower']['value']) transceiver_dom_info_dict['rx_los'] = self.get_rx_los() transceiver_dom_info_dict['tx_fault'] = self.get_tx_fault() @@ -379,26 +733,79 @@ def get_transceiver_threshold_info(self): txbiaslowwarning |FLOAT |Low Warning Threshold value of tx Bias Current in mA. ======================================================================== """ - # check present status - sfpd_obj = sff8472Dom() + transceiver_dom_threshold_info_dict = dict.fromkeys( + self.threshold_dict_keys, 'N/A') - if not self.get_presence() and not sfpd_obj: - return {} + if self.sfp_type == OSFP_TYPE: + pass - eeprom_ifraw = self.__read_eeprom_specific_bytes(0, DOM_OFFSET) - sfpi_obj = sff8472InterfaceId(eeprom_ifraw) - cal_type = sfpi_obj.get_calibration_type() - sfpd_obj._calibration_type = cal_type + elif self.sfp_type == QSFP_TYPE: + if not self.dom_supported or not self.qsfp_page3_available: + return transceiver_dom_threshold_info_dict - offset = DOM_OFFSET - transceiver_dom_threshold_info_dict = dict.fromkeys( - self.threshold_dict_keys, 'N/A') - dom_module_threshold_raw = self.__read_eeprom_specific_bytes( - (offset + SFP_MODULE_THRESHOLD_OFFSET), SFP_MODULE_THRESHOLD_WIDTH) - if dom_module_threshold_raw is not None: - dom_module_threshold_data = sfpd_obj.parse_alarm_warning_threshold( + # Dom Threshold data starts from offset 384 + # Revert offset back to 0 once data is retrieved + offset = QSFP_MODULE_UPPER_PAGE3_START + sfpd_obj = sff8436Dom() + if sfpd_obj is None: + return transceiver_dom_threshold_info_dict + + dom_module_threshold_raw = self._read_eeprom_specific_bytes( + (offset + QSFP_MODULE_THRESHOLD_OFFSET), QSFP_MODULE_THRESHOLD_WIDTH) + if dom_module_threshold_raw is None: + return transceiver_dom_threshold_info_dict + + dom_module_threshold_data = sfpd_obj.parse_module_threshold_values( dom_module_threshold_raw, 0) + dom_channel_threshold_raw = self._read_eeprom_specific_bytes((offset + QSFP_CHANNL_THRESHOLD_OFFSET), + QSFP_CHANNL_THRESHOLD_WIDTH) + if dom_channel_threshold_raw is None: + return transceiver_dom_threshold_info_dict + dom_channel_threshold_data = sfpd_obj.parse_channel_threshold_values( + dom_channel_threshold_raw, 0) + + # Threshold Data + transceiver_dom_threshold_info_dict['temphighalarm'] = dom_module_threshold_data['data']['TempHighAlarm']['value'] + transceiver_dom_threshold_info_dict['temphighwarning'] = dom_module_threshold_data['data']['TempHighWarning']['value'] + transceiver_dom_threshold_info_dict['templowalarm'] = dom_module_threshold_data['data']['TempLowAlarm']['value'] + transceiver_dom_threshold_info_dict['templowwarning'] = dom_module_threshold_data['data']['TempLowWarning']['value'] + transceiver_dom_threshold_info_dict['vcchighalarm'] = dom_module_threshold_data['data']['VccHighAlarm']['value'] + transceiver_dom_threshold_info_dict['vcchighwarning'] = dom_module_threshold_data['data']['VccHighWarning']['value'] + transceiver_dom_threshold_info_dict['vcclowalarm'] = dom_module_threshold_data['data']['VccLowAlarm']['value'] + transceiver_dom_threshold_info_dict['vcclowwarning'] = dom_module_threshold_data['data']['VccLowWarning']['value'] + transceiver_dom_threshold_info_dict['rxpowerhighalarm'] = dom_channel_threshold_data['data']['RxPowerHighAlarm']['value'] + transceiver_dom_threshold_info_dict['rxpowerhighwarning'] = dom_channel_threshold_data['data']['RxPowerHighWarning']['value'] + transceiver_dom_threshold_info_dict['rxpowerlowalarm'] = dom_channel_threshold_data['data']['RxPowerLowAlarm']['value'] + transceiver_dom_threshold_info_dict['rxpowerlowwarning'] = dom_channel_threshold_data['data']['RxPowerLowWarning']['value'] + transceiver_dom_threshold_info_dict['txbiashighalarm'] = dom_channel_threshold_data['data']['TxBiasHighAlarm']['value'] + transceiver_dom_threshold_info_dict['txbiashighwarning'] = dom_channel_threshold_data['data']['TxBiasHighWarning']['value'] + transceiver_dom_threshold_info_dict['txbiaslowalarm'] = dom_channel_threshold_data['data']['TxBiasLowAlarm']['value'] + transceiver_dom_threshold_info_dict['txbiaslowwarning'] = dom_channel_threshold_data['data']['TxBiasLowWarning']['value'] + transceiver_dom_threshold_info_dict['txpowerhighalarm'] = dom_channel_threshold_data['data']['TxPowerHighAlarm']['value'] + transceiver_dom_threshold_info_dict['txpowerhighwarning'] = dom_channel_threshold_data['data']['TxPowerHighWarning']['value'] + transceiver_dom_threshold_info_dict['txpowerlowalarm'] = dom_channel_threshold_data['data']['TxPowerLowAlarm']['value'] + transceiver_dom_threshold_info_dict['txpowerlowwarning'] = dom_channel_threshold_data['data']['TxPowerLowWarning']['value'] + + else: + offset = SFP_MODULE_ADDRA2_OFFSET + + if not self.dom_supported: + return transceiver_dom_threshold_info_dict + + sfpd_obj = sff8472Dom(None, self.calibration) + if sfpd_obj is None: + return transceiver_dom_threshold_info_dict + + dom_module_threshold_raw = self._read_eeprom_specific_bytes((offset + SFP_MODULE_THRESHOLD_OFFSET), + SFP_MODULE_THRESHOLD_WIDTH) + if dom_module_threshold_raw is not None: + dom_module_threshold_data = sfpd_obj.parse_alarm_warning_threshold( + dom_module_threshold_raw, 0) + else: + return transceiver_dom_threshold_info_dict + + # Threshold Data transceiver_dom_threshold_info_dict['temphighalarm'] = dom_module_threshold_data['data']['TempHighAlarm']['value'] transceiver_dom_threshold_info_dict['templowalarm'] = dom_module_threshold_data['data']['TempLowAlarm']['value'] transceiver_dom_threshold_info_dict['temphighwarning'] = dom_module_threshold_data['data']['TempHighWarning']['value'] @@ -438,19 +845,36 @@ def get_reset_status(self): def get_rx_los(self): """ - Retrieves the RX LOS (lost-of-signal) status of SFP + Retrieves the RX LOS (loss-of-signal) status of SFP Returns: - A Boolean, True if SFP has RX LOS, False if not. + A list of boolean values, representing the RX LOS status + of each available channel, value is True if SFP channel + has RX LOS, False if not. + E.g., for a tranceiver with four channels: [False, False, True, False] Note : RX LOS status is latched until a call to get_rx_los or a reset. """ - rx_los = False - status_control_raw = self.__read_eeprom_specific_bytes( - SFP_STATUS_CONTROL_OFFSET, SFP_STATUS_CONTROL_WIDTH) - if status_control_raw: - data = int(status_control_raw[0], 16) - rx_los = (sffbase().test_bit(data, 1) != 0) - - return rx_los + rx_los_list = [] + + if self.sfp_type == QSFP_TYPE: + offset = 0 + dom_channel_monitor_raw = self._read_eeprom_specific_bytes( + (offset + QSFP_CHANNL_RX_LOS_STATUS_OFFSET), QSFP_CHANNL_RX_LOS_STATUS_WIDTH) + if dom_channel_monitor_raw is not None: + rx_los_data = int(dom_channel_monitor_raw[0], 16) + rx_los_list.append(rx_los_data & 0x01 != 0) + rx_los_list.append(rx_los_data & 0x02 != 0) + rx_los_list.append(rx_los_data & 0x04 != 0) + rx_los_list.append(rx_los_data & 0x08 != 0) + + elif self.sfp_type == SFP_TYPE: + offset = 256 + dom_channel_monitor_raw = self._read_eeprom_specific_bytes( + (offset + SFP_STATUS_CONTROL_OFFSET), SFP_STATUS_CONTROL_WIDTH) + if dom_channel_monitor_raw is not None: + rx_los_data = int(dom_channel_monitor_raw[0], 16) + rx_los_list.append(rx_los_data & 0x02 != 0) + + return rx_los_list def get_tx_fault(self): """ @@ -459,34 +883,66 @@ def get_tx_fault(self): A Boolean, True if SFP has TX fault, False if not Note : TX fault status is lached until a call to get_tx_fault or a reset. """ - tx_fault = False - status_control_raw = self.__read_eeprom_specific_bytes( - SFP_STATUS_CONTROL_OFFSET, SFP_STATUS_CONTROL_WIDTH) - if status_control_raw: - data = int(status_control_raw[0], 16) - tx_fault = (sffbase().test_bit(data, 2) != 0) - - return tx_fault + tx_fault_list = [] + if not self.dom_supported: + return tx_fault_list + + if self.sfp_type == QSFP_TYPE: + offset = 0 + dom_channel_monitor_raw = self._read_eeprom_specific_bytes( + (offset + QSFP_CHANNL_TX_FAULT_STATUS_OFFSET), QSFP_CHANNL_TX_FAULT_STATUS_WIDTH) + if dom_channel_monitor_raw is not None: + tx_fault_data = int(dom_channel_monitor_raw[0], 16) + tx_fault_list.append(tx_fault_data & 0x01 != 0) + tx_fault_list.append(tx_fault_data & 0x02 != 0) + tx_fault_list.append(tx_fault_data & 0x04 != 0) + tx_fault_list.append(tx_fault_data & 0x08 != 0) + + elif self.sfp_type == SFP_TYPE: + offset = 256 + dom_channel_monitor_raw = self._read_eeprom_specific_bytes( + (offset + SFP_STATUS_CONTROL_OFFSET), SFP_STATUS_CONTROL_WIDTH) + if dom_channel_monitor_raw is not None: + tx_fault_data = int(dom_channel_monitor_raw[0], 16) + tx_fault_list.append(tx_fault_data & 0x04 != 0) + + return tx_fault_list def get_tx_disable(self): """ Retrieves the tx_disable status of this SFP Returns: - A Boolean, True if tx_disable is enabled, False if disabled - """ - tx_disable = False - tx_fault = False - status_control_raw = self.__read_eeprom_specific_bytes( - SFP_STATUS_CONTROL_OFFSET, SFP_STATUS_CONTROL_WIDTH) - if status_control_raw: - data = int(status_control_raw[0], 16) - tx_disable_hard = (sffbase().test_bit( - data, SFP_TX_DISABLE_HARD_BIT) != 0) - tx_disable_soft = (sffbase().test_bit( - data, SFP_TX_DISABLE_SOFT_BIT) != 0) - tx_disable = tx_disable_hard | tx_disable_soft - - return tx_disable + A list of boolean values, representing the TX disable status + of each available channel, value is True if SFP channel + is TX disabled, False if not. + E.g., for a tranceiver with four channels: [False, False, True, False] + """ + + tx_disable_list = [] + if not self.dom_supported: + return tx_disable_list + + if self.sfp_type == QSFP_TYPE: + offset = 0 + dom_channel_monitor_raw = self._read_eeprom_specific_bytes( + (offset + QSFP_CHANNL_DISABLE_STATUS_OFFSET), QSFP_CHANNL_DISABLE_STATUS_WIDTH) + if dom_channel_monitor_raw is not None: + tx_disable_data = int(dom_channel_monitor_raw[0], 16) + tx_disable_list.append(tx_disable_data & 0x01 != 0) + tx_disable_list.append(tx_disable_data & 0x02 != 0) + tx_disable_list.append(tx_disable_data & 0x04 != 0) + tx_disable_list.append(tx_disable_data & 0x08 != 0) + + elif self.sfp_type == SFP_TYPE: + offset = 256 + dom_channel_monitor_raw = self._read_eeprom_specific_bytes( + (offset + SFP_STATUS_CONTROL_OFFSET), SFP_STATUS_CONTROL_WIDTH) + if dom_channel_monitor_raw is not None: + tx_disable_data = int(dom_channel_monitor_raw[0], 16) + tx_disable_list.append(tx_disable_data & 0xC0 != 0) + else: + return None + return tx_disable_list def get_tx_disable_channel(self): """ @@ -497,8 +953,14 @@ def get_tx_disable_channel(self): As an example, a returned value of 0x5 indicates that channel 0 and channel 2 have been disabled. """ - # SFP doesn't support this feature - return 0 + tx_disable_list = self.get_tx_disable() + if tx_disable_list is None: + return 0 + tx_disabled = 0 + for i in range(len(tx_disable_list)): + if tx_disable_list[i]: + tx_disabled |= 1 << i + return tx_disabled def get_lpmode(self): """ @@ -524,8 +986,8 @@ def get_temperature(self): Returns: An integer number of current temperature in Celsius """ - transceiver_dom_info_dict = self.get_transceiver_bulk_status() - return transceiver_dom_info_dict.get("temperature", "N/A") + transceiver_bulk_status = self.get_transceiver_bulk_status() + return transceiver_bulk_status.get("temperature", 0.0) def get_voltage(self): """ @@ -533,8 +995,8 @@ def get_voltage(self): Returns: An integer number of supply voltage in mV """ - transceiver_dom_info_dict = self.get_transceiver_bulk_status() - return transceiver_dom_info_dict.get("voltage", "N/A") + transceiver_bulk_status = self.get_transceiver_bulk_status() + return transceiver_bulk_status.get("voltage", 0.0) def get_tx_bias(self): """ @@ -544,9 +1006,49 @@ def get_tx_bias(self): for channel 0 to channel 4. Ex. ['110.09', '111.12', '108.21', '112.09'] """ - transceiver_dom_info_dict = self.get_transceiver_bulk_status() - tx1_bs = transceiver_dom_info_dict.get("tx1bias", "N/A") - return [tx1_bs, "N/A", "N/A", "N/A"] if transceiver_dom_info_dict else [] + tx_bias_list = [] + if not self.dom_supported: + return tx_bias_list + + if self.sfp_type == QSFP_TYPE: + offset = 0 + + sfpd_obj = sff8436Dom() + if sfpd_obj is None: + return tx_bias_list + + dom_channel_monitor_raw = self._read_eeprom_specific_bytes( + (offset + QSFP_CHANNL_MON_OFFSET), QSFP_CHANNL_MON_WITH_TX_POWER_WIDTH) + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = sfpd_obj.parse_channel_monitor_params_with_tx_power( + dom_channel_monitor_raw, 0) + tx_bias_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TX1Bias']['value'])) + tx_bias_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TX2Bias']['value'])) + tx_bias_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TX3Bias']['value'])) + tx_bias_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TX4Bias']['value'])) + + elif self.sfp_type == SFP_TYPE: + offset = 256 + + sfpd_obj = sff8472Dom() + if sfpd_obj is None: + return tx_bias_list + sfpd_obj._calibration_type = self.calibration + + if self.dom_supported: + dom_channel_monitor_raw = self._read_eeprom_specific_bytes( + (offset + SFP_CHANNL_MON_OFFSET), SFP_CHANNL_MON_WIDTH) + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = sfpd_obj.parse_channel_monitor_params( + dom_channel_monitor_raw, 0) + tx_bias_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TXBias']['value'])) + + return tx_bias_list def get_rx_power(self): """ @@ -556,9 +1058,48 @@ def get_rx_power(self): power in mW for channel 0 to channel 4. Ex. ['1.77', '1.71', '1.68', '1.70'] """ - transceiver_dom_info_dict = self.get_transceiver_bulk_status() - rx1_pw = transceiver_dom_info_dict.get("rx1power", "N/A") - return [rx1_pw, "N/A", "N/A", "N/A"] if transceiver_dom_info_dict else [] + rx_power_list = [] + if self.sfp_type == QSFP_TYPE: + offset = 0 + + sfpd_obj = sff8436Dom() + if sfpd_obj is None: + return rx_power_list + + if self.dom_rx_power_supported: + dom_channel_monitor_raw = self._read_eeprom_specific_bytes( + (offset + QSFP_CHANNL_MON_OFFSET), QSFP_CHANNL_MON_WITH_TX_POWER_WIDTH) + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = sfpd_obj.parse_channel_monitor_params_with_tx_power( + dom_channel_monitor_raw, 0) + rx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['RX1Power']['value'])) + rx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['RX2Power']['value'])) + rx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['RX3Power']['value'])) + rx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['RX4Power']['value'])) + + elif self.sfp_type == SFP_TYPE: + offset = 256 + + sfpd_obj = sff8472Dom() + if sfpd_obj is None: + return None + + if self.dom_supported: + sfpd_obj._calibration_type = self.calibration + + dom_channel_monitor_raw = self._read_eeprom_specific_bytes( + (offset + SFP_CHANNL_MON_OFFSET), SFP_CHANNL_MON_WIDTH) + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = sfpd_obj.parse_channel_monitor_params( + dom_channel_monitor_raw, 0) + rx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['RXPower']['value'])) + + return rx_power_list def get_tx_power(self): """ @@ -568,9 +1109,48 @@ def get_tx_power(self): for channel 0 to channel 4. Ex. ['1.86', '1.86', '1.86', '1.86'] """ - transceiver_dom_info_dict = self.get_transceiver_bulk_status() - tx1_pw = transceiver_dom_info_dict.get("tx1power", "N/A") - return [tx1_pw, "N/A", "N/A", "N/A"] if transceiver_dom_info_dict else [] + tx_power_list = [] + if self.sfp_type == QSFP_TYPE: + offset = 0 + + sfpd_obj = sff8436Dom() + if sfpd_obj is None: + return tx_power_list + + if self.dom_tx_power_supported: + dom_channel_monitor_raw = self._read_eeprom_specific_bytes( + (offset + QSFP_CHANNL_MON_OFFSET), QSFP_CHANNL_MON_WITH_TX_POWER_WIDTH) + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = sfpd_obj.parse_channel_monitor_params_with_tx_power( + dom_channel_monitor_raw, 0) + tx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TX1Power']['value'])) + tx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TX2Power']['value'])) + tx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TX3Power']['value'])) + tx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TX4Power']['value'])) + + elif self.sfp_type == SFP_TYPE: + + offset = 256 + sfpd_obj = sff8472Dom() + if sfpd_obj is None: + return None + + if self.dom_supported: + sfpd_obj._calibration_type = self.calibration + + dom_channel_monitor_raw = self._read_eeprom_specific_bytes( + (offset + SFP_CHANNL_MON_OFFSET), SFP_CHANNL_MON_WIDTH) + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = sfpd_obj.parse_channel_monitor_params( + dom_channel_monitor_raw, 0) + tx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TXPower']['value'])) + + return tx_power_list def reset(self): """ @@ -590,32 +1170,36 @@ def tx_disable(self, tx_disable): Returns: A boolean, True if tx_disable is set successfully, False if not """ - sysfs_sfp_i2c_client_eeprom_path = self.port_to_eeprom_mapping[self.port_num] - status_control_raw = self.__read_eeprom_specific_bytes( - SFP_STATUS_CONTROL_OFFSET, SFP_STATUS_CONTROL_WIDTH) - if status_control_raw is not None: - # Set bit 6 for Soft TX Disable Select - # 01000000 = 64 and 10111111 = 191 - tx_disable_bit = 64 if tx_disable else 191 - status_control = int(status_control_raw[0], 16) - tx_disable_ctl = (status_control | tx_disable_bit) if tx_disable else ( - status_control & tx_disable_bit) - try: - sysfsfile_eeprom = open( - sysfs_sfp_i2c_client_eeprom_path, mode="r+b", buffering=0) - buffer = create_string_buffer(1) - buffer[0] = chr(tx_disable_ctl) - # Write to eeprom - sysfsfile_eeprom.seek(SFP_STATUS_CONTROL_OFFSET) - sysfsfile_eeprom.write(buffer[0]) - except: - #print("Error: unable to open file: %s" % str(e)) - return False - finally: - if sysfsfile_eeprom: - sysfsfile_eeprom.close() - time.sleep(0.01) - return True + if not self.get_presence(): + return False + + if self.dom_tx_disable_supported: + # SFP status/control register at address A2h, byte 110 + offset = 256 + sysfs_sfp_i2c_client_eeprom_path = self.port_to_eeprom_mapping[self.port_num] + status_control_raw = self._read_eeprom_specific_bytes( + (offset + SFP_STATUS_CONTROL_OFFSET), SFP_STATUS_CONTROL_WIDTH) + if status_control_raw is not None: + # Set bit 6 for Soft TX Disable Select + # 01000000 = 64 and 10111111 = 191 + tx_disable_bit = 64 if tx_disable else 191 + status_control = int(status_control_raw[0], 16) + tx_disable_ctl = (status_control | tx_disable_bit) if tx_disable else ( + status_control & tx_disable_bit) + try: + sysfsfile_eeprom = open( + sysfs_sfp_i2c_client_eeprom_path, mode="r+b", buffering=0) + tx_disable_data = c_char(tx_disable_ctl) + # Write to eeprom + sysfsfile_eeprom.seek(offset + SFP_STATUS_CONTROL_OFFSET) + sysfsfile_eeprom.write(tx_disable_data) + except Exception: + return False + finally: + if sysfsfile_eeprom: + sysfsfile_eeprom.close() + time.sleep(0.01) + return True return False def tx_disable_channel(self, channel, disable): @@ -664,17 +1248,17 @@ def set_power_override(self, power_override, power_set): # SFP doesn't support this feature return False + ############################################################## + ###################### Device methods ######################## + ############################################################## + def get_name(self): """ Retrieves the name of the device Returns: string: The name of the device """ - sfputil_helper = SfpUtilHelper() - sfputil_helper.read_porttab_mappings( - self.__get_path_to_port_config_file()) - name = sfputil_helper.logical[self.index] or "Unknown" - return name + return self.name def get_presence(self): """ @@ -712,3 +1296,26 @@ def get_serial(self): """ transceiver_dom_info_dict = self.get_transceiver_info() return transceiver_dom_info_dict.get("serial", "N/A") + + def get_status(self): + """ + Retrieves the operational status of the device + Returns: + A boolean value, True if device is operating properly, False if not + """ + return self.get_presence() and not self.get_reset_status() + + def get_position_in_parent(self): + """ + Returns: + Temp return 0 + """ + return 0 + + def is_replaceable(self): + """ + Retrieves if replaceable + Returns: + A boolean value, True if replaceable + """ + return True diff --git a/device/celestica/x86_64-cel_e1031-r0/sonic_platform/thermal.py b/device/celestica/x86_64-cel_e1031-r0/sonic_platform/thermal.py index 157f49a7c3e2..ab702d02d095 100644 --- a/device/celestica/x86_64-cel_e1031-r0/sonic_platform/thermal.py +++ b/device/celestica/x86_64-cel_e1031-r0/sonic_platform/thermal.py @@ -6,73 +6,138 @@ # ############################################################################# -import os -import re -import os.path - try: + import os from sonic_platform_base.thermal_base import ThermalBase + from .common import Common except ImportError as e: raise ImportError(str(e) + "- required module not found") +THERMAL_INFO = { + 0: { + "F2B_max": 55.000, + "F2B_max_crit": 58.000, + "B2F_max": 55.000, + "B2F_max_crit": 58.000, + "postion": "asic", + "name": "Inlet ambient sensor (Rear to Front)", + "ss_index": 1, + "i2c_path": "i2c-11/11-001a/hwmon", # U7273 + }, + 1: { + "F2B_max": 85.000, + "F2B_max_crit": 90.000, + "B2F_max": 85.000, + "B2F_max_crit": 90.000, + "postion": "asic", + "name": "Helix shutdown sensor (Rear to Front)", + "ss_index": 2, + "i2c_path": "i2c-11/11-001a/hwmon", # Q7000 + }, + 2: { + "F2B_max": 55.000, + "F2B_max_crit": 58.000, + "B2F_max": 55.000, + "B2F_max_crit": 58.000, + "postion": "asic", + "name": "Inlet ambient sensor (Front to Rear, right)", + "ss_index": 3, + "i2c_path": "i2c-11/11-001a/hwmon", # Q7001 + }, + 3: { + "F2B_max": 85.000, + "F2B_max_crit": 90.000, + "B2F_max": 85.000, + "B2F_max_crit": 90.000, + "postion": "asic", + "name": "Helix shutdown sensor (Front to Rear)", + "ss_index": 4, + "i2c_path": "i2c-11/11-001a/hwmon", # Q7751 + }, + 4: { + "F2B_max": 55.000, + "F2B_max_crit": 58.000, + "B2F_max": 55.000, + "B2F_max_crit": 58.000, + "postion": "cpu", + "name": "Inlet ambient sensor (Front to Rear, left)", + "ss_index": 5, + "i2c_path": "i2c-11/11-001a/hwmon" # Q7752 + }, + 5: { + "F2B_max": 90.000, + "F2B_max_crit": 95.000, + "B2F_max": 90.000, + "B2F_max_crit": 95.000, + "postion": "cpu", + "name": "CPU errata sensor (Front to Rear)", + "ss_index": 2, + "i2c_path": "i2c-3/3-001a/hwmon" # Q5 + }, + 6: { + "F2B_max": 90.000, + "F2B_max_crit": 95.000, + "B2F_max": 90.000, + "B2F_max_crit": 95.000, + "postion": "cpu", + "name": "CPU errata sensor (Rear to Front)", + "ss_index": 3, + "i2c_path": "i2c-3/3-001a/hwmon" # Q6 + } +} +NULL_VAL = "N/A" +I2C_ADAPTER_PATH = "/sys/class/i2c-adapter" + + class Thermal(ThermalBase): """Platform-specific Thermal class""" - THERMAL_NAME_LIST = [] MAINBOARD_SS_PATH = "/sys/class/i2c-adapter/i2c-11/11-001a/hwmon/hwmon2" CPUBOARD_SS_PATH = "/sys/class/i2c-adapter/i2c-3/3-001a/hwmon/hwmon1" SS_CONFIG_PATH = "/usr/share/sonic/device/x86_64-cel_e1031-r0/sensors.conf" - def __init__(self, thermal_index): + def __init__(self, thermal_index, airflow): + ThermalBase.__init__(self) self.index = thermal_index + self._api_common = Common() + + self._airflow = airflow + self._thermal_info = THERMAL_INFO[self.index] + self._hwmon_path = self._get_hwmon_path() + self._ss_index = self._thermal_info["ss_index"] - # Add thermal name - self.THERMAL_NAME_LIST.append("Rear panel-Inlet ambient sensor") - self.THERMAL_NAME_LIST.append("Rear panel-Helix shutdown sensor") - self.THERMAL_NAME_LIST.append( - "Front panel-Inlet ambient sensor (right)") - self.THERMAL_NAME_LIST.append("Front panel-Helix shutdown sensor") - self.THERMAL_NAME_LIST.append( - "Front panel-Inlet ambient sensor (left)") - self.THERMAL_NAME_LIST.append("CPU board temperature sensor : 1") - self.THERMAL_NAME_LIST.append("CPU board temperature sensor : 2") - - # Set hwmon path - self.ss_index, self.hwmon_path = self.__get_ss_info(self.index) - self.ss_key = self.THERMAL_NAME_LIST[self.index] - - def __get_ss_info(self, index): - if self.index <= 4: - ss_path = self.MAINBOARD_SS_PATH - ss_index = index+1 - else: - ss_path = self.CPUBOARD_SS_PATH - ss_index = index-3 - return ss_index, ss_path - - def __read_txt_file(self, file_path): - try: - with open(file_path, 'r') as fd: - data = fd.read() - return data.strip() - except IOError: - raise IOError("Unable to open %s file !" % file_path) - - def __get_temp(self, temp_file): - temp_file_path = os.path.join(self.hwmon_path, temp_file) - raw_temp = self.__read_txt_file(temp_file_path) + self.name = self.get_name() + self.postion = self._thermal_info["postion"] + self.minimum_thermal = self.get_temperature() + self.maximum_thermal = self.get_temperature() + + def _get_hwmon_path(self): + hwmon_path = os.path.join( + I2C_ADAPTER_PATH, self._thermal_info["i2c_path"]) + hwmon_dir = os.listdir(hwmon_path)[0] + return os.path.join(hwmon_path, hwmon_dir) + + def _get_temp(self, temp_file): + temp_file_path = os.path.join(self._hwmon_path, temp_file) + raw_temp = self._api_common.read_txt_file(temp_file_path) temp = float(raw_temp)/1000 - return "{:.3f}".format(temp) + return float("{:.3f}".format(temp)) - def __set_threshold(self, file_name, temperature): - temp_file_path = os.path.join(self.hwmon_path, file_name) - try: - with open(temp_file_path, 'w') as fd: - fd.write(str(temperature)) - return True - except IOError: - return False + def _set_threshold(self, file_name, temperature): + temp_file_path = os.path.join(self._hwmon_path, file_name) + return self._api_common.write_txt_file(temp_file_path, str(temperature)) + + def _get_threshold(self, file_name): + temp_file_path = os.path.join(self._hwmon_path, file_name) + data = self._api_common.read_txt_file(temp_file_path) + if data: + try: + threshold = float(data) + return round(threshold/1000, 3) + except Exception: + pass + return None def get_temperature(self): """ @@ -81,8 +146,8 @@ def get_temperature(self): A float number of current temperature in Celsius up to nearest thousandth of one degree Celsius, e.g. 30.125 """ - temp_file = "temp{}_input".format(self.ss_index) - return self.__get_temp(temp_file) + temp_file = "temp{}_input".format(self._ss_index) + return self._get_temp(temp_file) def get_high_threshold(self): """ @@ -91,8 +156,18 @@ def get_high_threshold(self): A float number, the high threshold temperature of thermal in Celsius up to nearest thousandth of one degree Celsius, e.g. 30.125 """ - temp_file = "temp{}_max".format(self.ss_index) - return self.__get_temp(temp_file) + max_crit_key = '{}_max'.format(self._airflow) + high_threshold_file = "temp{}_max".format(self._ss_index) + return self._get_threshold(high_threshold_file) or self._thermal_info.get(max_crit_key, None) + + def get_low_threshold(self): + """ + Retrieves the low threshold temperature of thermal + Returns: + A float number, the low threshold temperature of thermal in Celsius + up to nearest thousandth of one degree Celsius, e.g. 30.125 + """ + return 0.001 def set_high_threshold(self, temperature): """ @@ -103,17 +178,17 @@ def set_high_threshold(self, temperature): Returns: A boolean, True if threshold is set successfully, False if not """ - temp_file = "temp{}_max".format(self.ss_index) - is_set = self.__set_threshold(temp_file, int(temperature*1000)) - file_set = False - if is_set: + temp_file = "temp{}_max".format(self._ss_index) + is_set = self._set_threshold(temp_file, int(temperature*1000)) + file_set = True + if is_set and self._api_common.is_host(): try: with open(self.SS_CONFIG_PATH, 'r+') as f: content = f.readlines() f.seek(0) ss_found = False for idx, val in enumerate(content): - if self.ss_key in val: + if self.name in val: ss_found = True elif ss_found and temp_file in val: content[idx] = " set {} {}\n".format( @@ -126,13 +201,71 @@ def set_high_threshold(self, temperature): return is_set & file_set + def set_low_threshold(self, temperature): + """ + Sets the low threshold temperature of thermal + Args : + temperature: A float number up to nearest thousandth of one degree Celsius, + e.g. 30.125 + Returns: + A boolean, True if threshold is set successfully, False if not + """ + return False + + def get_high_critical_threshold(self): + """ + Retrieves the high critical threshold temperature of thermal + Returns: + A float number, the high critical threshold temperature of thermal in Celsius + up to nearest thousandth of one degree Celsius, e.g. 30.125 + """ + max_crit_key = '{}_max_crit'.format(self._airflow) + return self._thermal_info.get(max_crit_key, None) + + def get_low_critical_threshold(self): + """ + Retrieves the low critical threshold temperature of thermal + Returns: + A float number, the low critical threshold temperature of thermal in Celsius + up to nearest thousandth of one degree Celsius, e.g. 30.125 + """ + return 0.001 + + def get_minimum_recorded(self): + """ + Retrieves the minimum recorded temperature of thermal + Returns: + A float number, the minimum recorded temperature of thermal in Celsius + up to nearest thousandth of one degree Celsius, e.g. 30.125 + """ + tmp = self.get_temperature() + if tmp < self.minimum_thermal: + self.minimum_thermal = tmp + return self.minimum_thermal + + def get_maximum_recorded(self): + """ + Retrieves the maximum recorded temperature of thermal + Returns: + A float number, the maximum recorded temperature of thermal in Celsius + up to nearest thousandth of one degree Celsius, e.g. 30.125 + """ + tmp = self.get_temperature() + if tmp > self.maximum_thermal: + self.maximum_thermal = tmp + return self.maximum_thermal + + ############################################################## + ###################### Device methods ######################## + ############################################################## + def get_name(self): """ Retrieves the name of the thermal device Returns: string: The name of the thermal device """ - return self.THERMAL_NAME_LIST[self.index] + return self._thermal_info["name"] def get_presence(self): """ @@ -140,10 +273,26 @@ def get_presence(self): Returns: bool: True if PSU is present, False if not """ - temp_file = "temp{}_input".format(self.ss_index) - temp_file_path = os.path.join(self.hwmon_path, temp_file) + temp_file = "temp{}_input".format(self._ss_index) + temp_file_path = os.path.join(self._hwmon_path, temp_file) return os.path.isfile(temp_file_path) + def get_model(self): + """ + Retrieves the model number (or part number) of the device + Returns: + string: Model/part number of device + """ + return NULL_VAL + + def get_serial(self): + """ + Retrieves the serial number of the device + Returns: + string: Serial number of device + """ + return NULL_VAL + def get_status(self): """ Retrieves the operational status of the device @@ -153,10 +302,27 @@ def get_status(self): if not self.get_presence(): return False - fault_file = "temp{}_fault".format(self.ss_index) - fault_file_path = os.path.join(self.hwmon_path, fault_file) + fault_file = "temp{}_fault".format(self._ss_index) + fault_file_path = os.path.join(self._hwmon_path, fault_file) if not os.path.isfile(fault_file_path): return True - raw_txt = self.__read_txt_file(fault_file_path) + raw_txt = self._api_common.read_txt_file(fault_file_path) return int(raw_txt) == 0 + + def is_replaceable(self): + """ + Retrieves whether thermal module is replaceable + Returns: + A boolean value, True if replaceable, False if not + """ + return False + + def get_position_in_parent(self): + """ + Retrieves the thermal position information + Returns: + A int value, 0 represent ASIC thermal, 1 represent CPU thermal info + """ + + return self.index + 1 diff --git a/device/celestica/x86_64-cel_e1031-r0/sonic_platform/thermal_actions.py b/device/celestica/x86_64-cel_e1031-r0/sonic_platform/thermal_actions.py new file mode 100644 index 000000000000..75307d291496 --- /dev/null +++ b/device/celestica/x86_64-cel_e1031-r0/sonic_platform/thermal_actions.py @@ -0,0 +1,78 @@ +from sonic_platform_base.sonic_thermal_control.thermal_action_base import ThermalPolicyActionBase +from sonic_platform_base.sonic_thermal_control.thermal_json_object import thermal_json_object +from .thermal_infos import ChassisInfo +from .common import Common + + +@thermal_json_object('thermal_control.control') +class ControlThermalAlgoAction(ThermalPolicyActionBase): + """ + Action to control the thermal control algorithm + """ + # JSON field definition + JSON_FIELD_STATUS = 'status' + + def __init__(self): + self.status = True + + def load_from_json(self, json_obj): + """ + Construct ControlThermalAlgoAction via JSON. JSON example: + { + "type": "thermal_control.control" + "status": "true" + } + :param json_obj: A JSON object representing a ControlThermalAlgoAction action. + :return: + """ + if ControlThermalAlgoAction.JSON_FIELD_STATUS in json_obj: + status_str = json_obj[ControlThermalAlgoAction.JSON_FIELD_STATUS].lower( + ) + if status_str == 'true': + self.status = True + elif status_str == 'false': + self.status = False + else: + raise ValueError('Invalid {} field value, please specify true of false'. + format(ControlThermalAlgoAction.JSON_FIELD_STATUS)) + else: + raise ValueError('ControlThermalAlgoAction ' + 'missing mandatory field {} in JSON policy file'. + format(ControlThermalAlgoAction.JSON_FIELD_STATUS)) + + def execute(self, thermal_info_dict): + """ + Disable thermal control algorithm + :param thermal_info_dict: A dictionary stores all thermal information. + :return: + """ + if ChassisInfo.INFO_NAME in thermal_info_dict: + chassis_info_obj = thermal_info_dict[ChassisInfo.INFO_NAME] + chassis = chassis_info_obj.get_chassis() + thermal_manager = chassis.get_thermal_manager() + if self.status: + thermal_manager.start_thermal_control_algorithm() + else: + thermal_manager.stop_thermal_control_algorithm() + + +@thermal_json_object('switch.power_cycling') +class SwitchPolicyAction(ThermalPolicyActionBase): + """ + Base class for thermal action. Once all thermal conditions in a thermal policy are matched, + all predefined thermal action will be executed. + """ + + def execute(self, thermal_info_dict): + """ + Take action when thermal condition matches. For example, power cycle the switch. + :param thermal_info_dict: A dictionary stores all thermal information. + :return: + """ + thermal_overload_position_path = '/tmp/thermal_overload_position' + thermal_overload_position = Common().read_txt_file( + thermal_overload_position_path) + + cmd = 'bash /usr/share/sonic/platform/thermal_overload_control.sh {}'.format( + thermal_overload_position) + Common().run_command(cmd) diff --git a/device/celestica/x86_64-cel_e1031-r0/sonic_platform/thermal_conditions.py b/device/celestica/x86_64-cel_e1031-r0/sonic_platform/thermal_conditions.py new file mode 100644 index 000000000000..ea7b759211fb --- /dev/null +++ b/device/celestica/x86_64-cel_e1031-r0/sonic_platform/thermal_conditions.py @@ -0,0 +1,78 @@ +from sonic_platform_base.sonic_thermal_control.thermal_condition_base import ThermalPolicyConditionBase +from sonic_platform_base.sonic_thermal_control.thermal_json_object import thermal_json_object + + +class FanCondition(ThermalPolicyConditionBase): + def get_fan_info(self, thermal_info_dict): + from .thermal_infos import FanInfo + if FanInfo.INFO_NAME in thermal_info_dict and isinstance(thermal_info_dict[FanInfo.INFO_NAME], FanInfo): + return thermal_info_dict[FanInfo.INFO_NAME] + else: + return None + + +@thermal_json_object('fan.any.absence') +class AnyFanAbsenceCondition(FanCondition): + def is_match(self, thermal_info_dict): + fan_info_obj = self.get_fan_info(thermal_info_dict) + return len(fan_info_obj.get_absence_fans()) > 0 if fan_info_obj else False + + +@thermal_json_object('fan.any.fault') +class AnyFanFaultCondition(FanCondition): + def is_match(self, thermal_info_dict): + fan_info_obj = self.get_fan_info(thermal_info_dict) + return len(fan_info_obj.get_fault_fans()) > 0 if fan_info_obj else False + + +@thermal_json_object('fan.all.presence') +class AllFanPresenceCondition(FanCondition): + def is_match(self, thermal_info_dict): + fan_info_obj = self.get_fan_info(thermal_info_dict) + return len(fan_info_obj.get_absence_fans()) == 0 if fan_info_obj else False + + +@thermal_json_object('fan.all.good') +class AllFanGoodCondition(FanCondition): + def is_match(self, thermal_info_dict): + fan_info_obj = self.get_fan_info(thermal_info_dict) + return len(fan_info_obj.get_fault_fans()) == 0 if fan_info_obj else False + + +class ThermalCondition(ThermalPolicyConditionBase): + def get_thermal_info(self, thermal_info_dict): + from .thermal_infos import ThermalInfo + if ThermalInfo.INFO_NAME in thermal_info_dict and isinstance(thermal_info_dict[ThermalInfo.INFO_NAME], ThermalInfo): + return thermal_info_dict[ThermalInfo.INFO_NAME] + else: + return None + + +@thermal_json_object('thermal.over.high_threshold') +class ThermalOverHighCriticalCondition(ThermalCondition): + def is_match(self, thermal_info_dict): + thermal_info_obj = self.get_thermal_info(thermal_info_dict) + if thermal_info_obj: + return thermal_info_obj.is_over_high_threshold() + else: + return False + + +@thermal_json_object('thermal.over.high_critical_threshold') +class ThermalOverHighCriticalCondition(ThermalCondition): + def is_match(self, thermal_info_dict): + thermal_info_obj = self.get_thermal_info(thermal_info_dict) + if thermal_info_obj: + return thermal_info_obj.is_over_high_critical_threshold() + else: + return False + + +@thermal_json_object('thermal.all.good') +class ThermalGoodCondition(ThermalCondition): + def is_match(self, thermal_info_dict): + thermal_info_obj = self.get_thermal_info(thermal_info_dict) + if thermal_info_obj: + return not thermal_info_obj.is_over_threshold() + else: + return False diff --git a/device/celestica/x86_64-cel_e1031-r0/sonic_platform/thermal_infos.py b/device/celestica/x86_64-cel_e1031-r0/sonic_platform/thermal_infos.py new file mode 100644 index 000000000000..c493ceb655bc --- /dev/null +++ b/device/celestica/x86_64-cel_e1031-r0/sonic_platform/thermal_infos.py @@ -0,0 +1,165 @@ +from sonic_platform_base.sonic_thermal_control.thermal_info_base import ThermalPolicyInfoBase +from sonic_platform_base.sonic_thermal_control.thermal_json_object import thermal_json_object +from .common import Common +import time + + +@thermal_json_object('fan_info') +class FanInfo(ThermalPolicyInfoBase): + """ + Fan information needed by thermal policy + """ + + # Fan information name + INFO_NAME = 'fan_info' + + def __init__(self): + self._absence_fans = set() + self._presence_fans = set() + self._fault_fans = set() + self._status_changed = False + + def collect(self, chassis): + """ + Collect absence and presence fans. + :param chassis: The chassis object + :return: + """ + self._status_changed = False + for fan in chassis.get_all_fans(): + presence = fan.get_presence() + status = fan.get_status() + if presence and fan not in self._presence_fans: + self._presence_fans.add(fan) + self._status_changed = True + if fan in self._absence_fans: + self._absence_fans.remove(fan) + elif not presence and fan not in self._absence_fans: + self._absence_fans.add(fan) + self._status_changed = True + if fan in self._presence_fans: + self._presence_fans.remove(fan) + + if not status and fan not in self._fault_fans: + self._fault_fans.add(fan) + self._status_changed = True + + elif status and fan in self._fault_fans: + self._fault_fans.remove(fan) + self._status_changed = True + + def get_absence_fans(self): + """ + Retrieves absence fans + :return: A set of absence fans + """ + return self._absence_fans + + def get_presence_fans(self): + """ + Retrieves presence fans + :return: A set of presence fans + """ + return self._presence_fans + + def get_fault_fans(self): + """ + Retrieves fault fans + :return: A set of fault fans + """ + return self._fault_fans + + def is_status_changed(self): + """ + Retrieves if the status of fan information changed + :return: True if status changed else False + """ + return self._status_changed + + +@thermal_json_object('thermal_info') +class ThermalInfo(ThermalPolicyInfoBase): + """ + Thermal information needed by thermal policy + """ + + # Fan information name + INFO_NAME = 'thermal_info' + + def collect(self, chassis): + """ + Collect thermal sensor temperature change status + :param chassis: The chassis object + :return: + """ + self._over_high_threshold = False + self._over_high_critical_threshold = False + self._thermal_overload_position = 'cpu' + + # Calculate average temp within the device + temp = 0 + num_of_thermals = chassis.get_num_thermals() + for index in range(num_of_thermals): + thermal = chassis.get_thermal(index) + temp = thermal.get_temperature() + high_threshold = thermal.get_high_threshold() + high_critical_threshold = thermal.get_high_critical_threshold() + + if high_threshold and temp > high_threshold: + self._over_high_threshold = True + + if high_critical_threshold and temp > high_critical_threshold: + self._thermal_overload_position = thermal.postion + self._over_high_critical_threshold = True + + def is_over_threshold(self): + """ + Retrieves if the temperature is over any threshold + :return: True if the temperature is over any threshold else False + """ + return self._over_high_threshold or self._over_high_critical_threshold + + def is_over_high_critical_threshold(self): + """ + Retrieves if the temperature is over high critical threshold + :return: True if the temperature is over high critical threshold else False + """ + thermal_overload_position_path = '/tmp/thermal_overload_position' + if self._over_high_critical_threshold: + Common().write_txt_file(thermal_overload_position_path, + self._thermal_overload_position) + time.sleep(1) + return self._over_high_critical_threshold + + def is_over_high_threshold(self): + """ + Retrieves if the temperature is over high threshold + :return: True if the temperature is over high threshold else False + """ + return self._over_high_threshold + + +@thermal_json_object('chassis_info') +class ChassisInfo(ThermalPolicyInfoBase): + """ + Chassis information needed by thermal policy + """ + INFO_NAME = 'chassis_info' + + def __init__(self): + self._chassis = None + + def collect(self, chassis): + """ + Collect platform chassis. + :param chassis: The chassis object + :return: + """ + self._chassis = chassis + + def get_chassis(self): + """ + Retrieves platform chassis object + :return: A platform chassis object. + """ + return self._chassis diff --git a/device/celestica/x86_64-cel_e1031-r0/sonic_platform/thermal_manager.py b/device/celestica/x86_64-cel_e1031-r0/sonic_platform/thermal_manager.py new file mode 100644 index 000000000000..2e379f8c2a2d --- /dev/null +++ b/device/celestica/x86_64-cel_e1031-r0/sonic_platform/thermal_manager.py @@ -0,0 +1,47 @@ +from sonic_platform_base.sonic_thermal_control.thermal_manager_base import ThermalManagerBase +from .common import Common +from .thermal_actions import * +from .thermal_conditions import * +from .thermal_infos import * + + +class ThermalManager(ThermalManagerBase): + FSC_ALGORITHM_CMD = ' supervisorctl {} fancontrol' + + @classmethod + def start_thermal_control_algorithm(cls): + """ + Start vendor specific thermal control algorithm. The default behavior of this function is a no-op. + :return: + """ + return cls._enable_fancontrol_service(True) + + @classmethod + def stop_thermal_control_algorithm(cls): + """ + Stop thermal control algorithm + Returns: + bool: True if set success, False if fail. + """ + return cls._enable_fancontrol_service(False) + + @classmethod + def deinitialize(cls): + """ + Destroy thermal manager, including any vendor specific cleanup. The default behavior of this function + is a no-op. + :return: + """ + return cls._enable_fancontrol_service(True) + + @classmethod + def _enable_fancontrol_service(cls, enable): + """ + Control thermal by fcs algorithm + Args: + enable: Bool, indicate enable the algorithm or not + Returns: + bool: True if set success, False if fail. + """ + cmd = 'start' if enable else 'stop' + return Common().run_command(cls.FSC_ALGORITHM_CMD.format(cmd)) diff --git a/device/celestica/x86_64-cel_e1031-r0/sonic_platform/watchdog.py b/device/celestica/x86_64-cel_e1031-r0/sonic_platform/watchdog.py index 882285251784..93898bd646a4 100644 --- a/device/celestica/x86_64-cel_e1031-r0/sonic_platform/watchdog.py +++ b/device/celestica/x86_64-cel_e1031-r0/sonic_platform/watchdog.py @@ -4,116 +4,107 @@ # Watchdog contains an implementation of SONiC Platform Base API # ############################################################################# -import ctypes -import fcntl -import os -import subprocess -import time -import array try: + import os + import time from sonic_platform_base.watchdog_base import WatchdogBase + from .common import Common except ImportError as e: raise ImportError(str(e) + "- required module not found") -""" ioctl constants """ -IO_WRITE = 0x40000000 -IO_READ = 0x80000000 -IO_READ_WRITE = 0xC0000000 -IO_SIZE_INT = 0x00040000 -IO_SIZE_40 = 0x00280000 -IO_TYPE_WATCHDOG = ord('W') << 8 - -WDR_INT = IO_READ | IO_SIZE_INT | IO_TYPE_WATCHDOG -WDR_40 = IO_READ | IO_SIZE_40 | IO_TYPE_WATCHDOG -WDWR_INT = IO_READ_WRITE | IO_SIZE_INT | IO_TYPE_WATCHDOG - -""" Watchdog ioctl commands """ -WDIOC_GETSUPPORT = 0 | WDR_40 -WDIOC_GETSTATUS = 1 | WDR_INT -WDIOC_GETBOOTSTATUS = 2 | WDR_INT -WDIOC_GETTEMP = 3 | WDR_INT -WDIOC_SETOPTIONS = 4 | WDR_INT -WDIOC_KEEPALIVE = 5 | WDR_INT -WDIOC_SETTIMEOUT = 6 | WDWR_INT -WDIOC_GETTIMEOUT = 7 | WDR_INT -WDIOC_SETPRETIMEOUT = 8 | WDWR_INT -WDIOC_GETPRETIMEOUT = 9 | WDR_INT -WDIOC_GETTIMELEFT = 10 | WDR_INT - -""" Watchdog status constants """ -WDIOS_DISABLECARD = 0x0001 -WDIOS_ENABLECARD = 0x0002 +PLATFORM_CPLD_PATH = '/sys/devices/platform/e1031.smc/' +SETREG_FILE = 'setreg' +GETREG_FILE = 'getreg' WDT_COMMON_ERROR = -1 -WD_MAIN_IDENTITY = "iTCO_wdt" -WDT_SYSFS_PATH = "/sys/class/watchdog/" +MMC_VERSION_REG = "0x100" + +# watchdog infomation for cpld v06 +V06_MMC_VERSION = 0x05 +V06_WDT_WIDTH = '0x110' +V06_WDT_WIDTH_SELECTOR = { + 30: '0x1', + 60: '0x2', + 180: '0x3' +} + +V06_CPLD_WDT_INFO = { + 'wdt_en_reg': '0x111', + 'wdt_en_cmd': '0x0', + 'wdt_dis_cmd': '0x1' +} + +# watchdog infomation +WDT_TIMER_L_BIT_REG = '0x117' +WDT_TIMER_M_BIT_REG = '0x118' +WDT_TIMER_H_BIT_REG = '0x119' +WDT_KEEP_ALVIVE_REG = '0x11a' + +CPLD_WDT_INFO = { + 'wdt_en_reg': '0x116', + 'wdt_en_cmd': '0x1', + 'wdt_dis_cmd': '0x0' +} class Watchdog(WatchdogBase): def __init__(self): + # Init api_common + self._api_common = Common() + + # Init cpld reg path + self.setreg_path = os.path.join(PLATFORM_CPLD_PATH, SETREG_FILE) + self.getreg_path = os.path.join(PLATFORM_CPLD_PATH, GETREG_FILE) + + self.mmc_v = self._get_mmc_version() + self.cpld_info = V06_CPLD_WDT_INFO if self.mmc_v <= V06_MMC_VERSION else CPLD_WDT_INFO - self.watchdog, self.wdt_main_dev_name = self._get_wdt() - self.status_path = "/sys/class/watchdog/%s/status" % self.wdt_main_dev_name - self.state_path = "/sys/class/watchdog/%s/state" % self.wdt_main_dev_name - self.timeout_path = "/sys/class/watchdog/%s/timeout" % self.wdt_main_dev_name # Set default value self._disable() self.armed = False - self.timeout = self._gettimeout(self.timeout_path) + self.timeout = 0 - def _is_wd_main(self, dev): - """ - Checks watchdog identity - """ - identity = self._read_file( - "{}/{}/identity".format(WDT_SYSFS_PATH, dev)) - return identity == WD_MAIN_IDENTITY + def _get_mmc_version(self): + hex_str_v = self._api_common.get_reg(self.getreg_path, MMC_VERSION_REG) + return int(hex_str_v, 16) - def _get_wdt(self): - """ - Retrieves watchdog device - """ - wdt_main_dev_list = [dev for dev in os.listdir( - "/dev/") if dev.startswith("watchdog") and self._is_wd_main(dev)] - if not wdt_main_dev_list: - return None - wdt_main_dev_name = wdt_main_dev_list[0] - watchdog_device_path = "/dev/{}".format(wdt_main_dev_name) - watchdog = os.open(watchdog_device_path, os.O_RDWR) - return watchdog, wdt_main_dev_name + def _get_level_hex(self, sub_hex): + sub_hex_str = sub_hex.replace("x", "0") + return hex(int(sub_hex_str, 16)) - def _read_file(self, file_path): - """ - Read text file - """ - try: - with open(file_path, "r") as fd: - txt = fd.read() - except IOError: - return WDT_COMMON_ERROR - return txt.strip() + def _seconds_to_lmh_hex(self, seconds): + ms = seconds*1000 # calculate timeout in ms format + hex_str = hex(ms) + l = self._get_level_hex(hex_str[-2:]) + m = self._get_level_hex(hex_str[-4:-2]) + h = self._get_level_hex(hex_str[-6:-4]) + return (l, m, h) def _enable(self): """ Turn on the watchdog timer """ - req = array.array('h', [WDIOS_ENABLECARD]) - fcntl.ioctl(self.watchdog, WDIOC_SETOPTIONS, req, False) + return self._api_common.set_reg(self.setreg_path, self.cpld_info['wdt_en_reg'], self.cpld_info['wdt_en_cmd']) def _disable(self): """ Turn off the watchdog timer """ - req = array.array('h', [WDIOS_DISABLECARD]) - fcntl.ioctl(self.watchdog, WDIOC_SETOPTIONS, req, False) + return self._api_common.set_reg(self.setreg_path, self.cpld_info['wdt_en_reg'], self.cpld_info['wdt_dis_cmd']) def _keepalive(self): """ Keep alive watchdog timer """ - fcntl.ioctl(self.watchdog, WDIOC_KEEPALIVE) + if self.mmc_v <= V06_MMC_VERSION: + self._disable() + self._enable() + + else: + self._api_common.set_reg( + self.setreg_path, WDT_KEEP_ALVIVE_REG, self.cpld_info['wdt_en_cmd']) def _settimeout(self, seconds): """ @@ -121,29 +112,23 @@ def _settimeout(self, seconds): @param seconds - timeout in seconds @return is the actual set timeout """ - req = array.array('I', [seconds]) - fcntl.ioctl(self.watchdog, WDIOC_SETTIMEOUT, req, True) - return int(req[0]) - def _gettimeout(self, timeout_path): - """ - Get watchdog timeout - @return watchdog timeout - """ - req = array.array('I', [0]) - fcntl.ioctl(self.watchdog, WDIOC_GETTIMEOUT, req, True) + if self.mmc_v <= V06_MMC_VERSION: + timeout_hex = V06_WDT_WIDTH_SELECTOR.get(seconds, '0x2') + seconds = 60 if timeout_hex == '0x2' else seconds + self._api_common.set_reg( + self.setreg_path, V06_WDT_WIDTH, timeout_hex) - return int(req[0]) + else: + (l, m, h) = self._seconds_to_lmh_hex(seconds) + self._api_common.set_reg( + self.setreg_path, WDT_TIMER_H_BIT_REG, h) # set high bit + self._api_common.set_reg( + self.setreg_path, WDT_TIMER_M_BIT_REG, m) # set med bit + self._api_common.set_reg( + self.setreg_path, WDT_TIMER_L_BIT_REG, l) # set low bit - def _gettimeleft(self): - """ - Get time left before watchdog timer expires - @return time left in seconds - """ - req = array.array('I', [0]) - fcntl.ioctl(self.watchdog, WDIOC_GETTIMELEFT, req, True) - - return int(req[0]) + return seconds ################################################################# @@ -159,22 +144,25 @@ def arm(self, seconds): An integer specifying the *actual* number of seconds the watchdog was armed with. On failure returns -1. """ - ret = WDT_COMMON_ERROR - if seconds < 0: + + if seconds < 0 or seconds > 180: return ret try: if self.timeout != seconds: self.timeout = self._settimeout(seconds) + if self.armed: self._keepalive() else: self._enable() self.armed = True + ret = self.timeout + self.arm_timestamp = time.time() except IOError as e: - pass + print("Error: unable to enable wdt due to : {}".format(e)) return ret @@ -185,14 +173,12 @@ def disarm(self): A boolean, True if watchdog is disarmed successfully, False if not """ disarmed = False - if self.is_armed(): - try: - self._disable() - self.armed = False - disarmed = True - except IOError: - pass - + try: + self._disable() + self.armed = False + disarmed = True + except IOError as e: + print("Error: unable to disable wdt due to : {}".format(e)) return disarmed def is_armed(self): @@ -201,7 +187,6 @@ def is_armed(self): Returns: A boolean, True if watchdog is armed, False if not """ - return self.armed def get_remaining_time(self): @@ -216,16 +201,6 @@ def get_remaining_time(self): timeleft = WDT_COMMON_ERROR if self.armed: - try: - timeleft = self._gettimeleft() - except IOError: - pass + timeleft = int(self.timeout - (time.time() - self.arm_timestamp)) return timeleft - - def __del__(self): - """ - Close watchdog - """ - - os.close(self.watchdog) diff --git a/device/celestica/x86_64-cel_e1031-r0/system_health_monitoring_config.json b/device/celestica/x86_64-cel_e1031-r0/system_health_monitoring_config.json new file mode 100644 index 000000000000..1733fcffdba3 --- /dev/null +++ b/device/celestica/x86_64-cel_e1031-r0/system_health_monitoring_config.json @@ -0,0 +1,16 @@ +{ + "services_to_ignore": [], + "devices_to_ignore": [ + "asic", + "psu.temperature", + "PSU2 Fan", + "PSU1 Fan" + ], + "user_defined_checkers": [], + "polling_interval": 60, + "led_color": { + "fault": "orange", + "normal": "green", + "booting": "orange_blink" + } +} diff --git a/device/celestica/x86_64-cel_e1031-r0/thermal_overload_control.sh b/device/celestica/x86_64-cel_e1031-r0/thermal_overload_control.sh new file mode 100755 index 000000000000..67ca9b9a2e66 --- /dev/null +++ b/device/celestica/x86_64-cel_e1031-r0/thermal_overload_control.sh @@ -0,0 +1,75 @@ +#!/bin/bash +# +# Copyright 2020-present Celestica. All Rights Reserved. +# +# This program file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. +# +# + +PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin +SETREG_FILE=/sys/devices/platform/e1031.smc/setreg +TOVERREG=0x115 +CPUOVER=0xa1 +ASICOVER=0xa2 + +prog="$0" +command="$1" + +if [[ $EUID -ne 0 ]]; then + echo "This script must be run as root" + exit 1 +fi + +usage() { + echo "Usage: thermal_overload_control.sh [option] " + echo + echo "Options:" + echo " -h, --help : to print this message." + echo + echo "Commands:" + echo + echo " cpu: To enabling CPU thermal overload handler" + echo + echo " asic : To enabling ASIC thermal overload handler" + echo +} + +cpu_overload() { + logger "Enable CPU thermal overload control" + set_reg=`echo ${TOVERREG} ${CPUOVER} > ${SETREG_FILE}` +} + +asic_overload() { + logger "Enable ASIC thermal overload control" + set_reg=`echo ${TOVERREG} ${ASICOVER} > ${SETREG_FILE}` +} + +if [ $# -lt 1 ]; then + usage + exit -1 +fi + +case "$command" in +-h | --help) + usage + ;; +cpu) + cpu_overload + ;; +asic) + asic_overload + ;; +*) + usage + exit -1 + ;; +esac + +exit $? diff --git a/device/celestica/x86_64-cel_e1031-r0/thermal_policy.json b/device/celestica/x86_64-cel_e1031-r0/thermal_policy.json new file mode 100644 index 000000000000..276fede0b044 --- /dev/null +++ b/device/celestica/x86_64-cel_e1031-r0/thermal_policy.json @@ -0,0 +1,93 @@ +{ + "thermal_control_algorithm": { + "run_at_boot_up": "true" + }, + "info_types": [ + { + "type": "chassis_info" + }, + { + "type": "fan_info" + }, + { + "type": "thermal_info" + } + ], + "policies": [ + { + "name": "any fan absence", + "conditions": [ + { + "type": "fan.any.absence" + } + ], + "actions": [ + { + "type": "thermal_control.control", + "status": "false" + } + ] + }, + { + "name": "any fan broken", + "conditions": [ + { + "type": "fan.any.fault" + } + ], + "actions": [ + { + "type": "thermal_control.control", + "status": "false" + } + ] + }, + { + "name": "any thermal over threshold", + "conditions": [ + { + "type": "thermal.over.high_threshold" + } + ], + "actions": [ + { + "type": "thermal_control.control", + "status": "false" + } + ] + }, + { + "name": "temp over high critical threshold", + "conditions": [ + { + "type": "thermal.over.high_critical_threshold" + } + ], + "actions": [ + { + "type": "switch.power_cycling" + } + ] + }, + { + "name": "all fan presence / thermal no warning", + "conditions": [ + { + "type": "fan.all.presence" + }, + { + "type": "fan.all.good" + }, + { + "type": "thermal.all.good" + } + ], + "actions": [ + { + "type": "thermal_control.control", + "status": "true" + } + ] + } + ] +} \ No newline at end of file diff --git a/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-C32/BALANCED b/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-C32/BALANCED new file mode 120000 index 000000000000..87afd08ffcd8 --- /dev/null +++ b/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-C32/BALANCED @@ -0,0 +1 @@ +../../../common/profiles/th/gen/BALANCED \ No newline at end of file diff --git a/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-C32/RDMA-CENTRIC b/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-C32/RDMA-CENTRIC new file mode 120000 index 000000000000..a05581efb9ff --- /dev/null +++ b/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-C32/RDMA-CENTRIC @@ -0,0 +1 @@ +../../../common/profiles/th/gen/RDMA-CENTRIC \ No newline at end of file diff --git a/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-C32/TCP-CENTRIC b/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-C32/TCP-CENTRIC new file mode 120000 index 000000000000..dd9cf046c0f9 --- /dev/null +++ b/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-C32/TCP-CENTRIC @@ -0,0 +1 @@ +../../../common/profiles/th/gen/TCP-CENTRIC \ No newline at end of file diff --git a/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-C32/buffer_ports_t0.j2 b/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-C32/buffer_ports_t0.j2 new file mode 100644 index 000000000000..c33d873068a4 --- /dev/null +++ b/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-C32/buffer_ports_t0.j2 @@ -0,0 +1,13 @@ +{%- set ports2cable = { + 'torrouter_server' : '300m', + 'leafrouter_torrouter' : '300m', + 'spinerouter_leafrouter' : '300m' + } +-%} + +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {%- for port_idx in range(0,32) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{%- endif %} + {%- endfor %} +{%- endmacro %} diff --git a/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-C32/buffer_ports_t1.j2 b/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-C32/buffer_ports_t1.j2 new file mode 100644 index 000000000000..c33d873068a4 --- /dev/null +++ b/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-C32/buffer_ports_t1.j2 @@ -0,0 +1,13 @@ +{%- set ports2cable = { + 'torrouter_server' : '300m', + 'leafrouter_torrouter' : '300m', + 'spinerouter_leafrouter' : '300m' + } +-%} + +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {%- for port_idx in range(0,32) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{%- endif %} + {%- endfor %} +{%- endmacro %} diff --git a/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-C32/buffers_defaults_t0.j2 b/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-C32/buffers_defaults_t0.j2 deleted file mode 100644 index 4dd6bd96ad96..000000000000 --- a/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-C32/buffers_defaults_t0.j2 +++ /dev/null @@ -1,54 +0,0 @@ - -{%- set default_cable = '5m' %} - -{%- set ports2cable = { - 'torrouter_server' : '300m', - 'leafrouter_torrouter' : '300m', - 'spinerouter_leafrouter' : '300m' - } --%} - -{%- macro generate_port_lists(PORT_ALL) %} - {# Generate list of ports #} - {%- for port_idx in range(0,32) %} - {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{%- endif %} - {%- endfor %} -{%- endmacro %} - -{%- macro generate_buffer_pool_and_profiles() %} - "BUFFER_POOL": { - "ingress_lossless_pool": { - "size": "10875072", - "type": "ingress", - "mode": "dynamic", - "xoff": "4194112" - }, - "egress_lossy_pool": { - "size": "9243812", - "type": "egress", - "mode": "dynamic" - }, - "egress_lossless_pool": { - "size": "15982720", - "type": "egress", - "mode": "static" - } - }, - "BUFFER_PROFILE": { - "ingress_lossy_profile": { - "pool":"[BUFFER_POOL|ingress_lossless_pool]", - "size":"0", - "dynamic_th":"3" - }, - "egress_lossless_profile": { - "pool":"[BUFFER_POOL|egress_lossless_pool]", - "size":"1518", - "static_th":"15982720" - }, - "egress_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"1518", - "dynamic_th":"3" - } - }, -{%- endmacro %} diff --git a/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-C32/buffers_defaults_t0.j2 b/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-C32/buffers_defaults_t0.j2 new file mode 120000 index 000000000000..9524e6a476ac --- /dev/null +++ b/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-C32/buffers_defaults_t0.j2 @@ -0,0 +1 @@ +BALANCED/buffers_defaults_t0.j2 \ No newline at end of file diff --git a/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-C32/buffers_defaults_t1.j2 b/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-C32/buffers_defaults_t1.j2 deleted file mode 100644 index 3c93fb8fe2e3..000000000000 --- a/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-C32/buffers_defaults_t1.j2 +++ /dev/null @@ -1,54 +0,0 @@ - -{%- set default_cable = '40m' %} - -{%- set ports2cable = { - 'torrouter_server' : '300m', - 'leafrouter_torrouter' : '300m', - 'spinerouter_leafrouter' : '300m' - } --%} - -{%- macro generate_port_lists(PORT_ALL) %} - {# Generate list of ports #} - {%- for port_idx in range(0,32) %} - {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{%- endif %} - {%- endfor %} -{%- endmacro %} - -{%- macro generate_buffer_pool_and_profiles() %} - "BUFFER_POOL": { - "ingress_lossless_pool": { - "size": "10875072", - "type": "ingress", - "mode": "dynamic", - "xoff": "4194112" - }, - "egress_lossy_pool": { - "size": "9243812", - "type": "egress", - "mode": "dynamic" - }, - "egress_lossless_pool": { - "size": "15982720", - "type": "egress", - "mode": "static" - } - }, - "BUFFER_PROFILE": { - "ingress_lossy_profile": { - "pool":"[BUFFER_POOL|ingress_lossless_pool]", - "size":"0", - "dynamic_th":"3" - }, - "egress_lossless_profile": { - "pool":"[BUFFER_POOL|egress_lossless_pool]", - "size":"1518", - "static_th":"15982720" - }, - "egress_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"1518", - "dynamic_th":"3" - } - }, -{%- endmacro %} diff --git a/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-C32/buffers_defaults_t1.j2 b/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-C32/buffers_defaults_t1.j2 new file mode 120000 index 000000000000..c25cc95d6d57 --- /dev/null +++ b/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-C32/buffers_defaults_t1.j2 @@ -0,0 +1 @@ +BALANCED/buffers_defaults_t1.j2 \ No newline at end of file diff --git a/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-C32/pg_profile_lookup.ini b/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-C32/pg_profile_lookup.ini deleted file mode 100644 index 673df369a9bb..000000000000 --- a/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-C32/pg_profile_lookup.ini +++ /dev/null @@ -1,17 +0,0 @@ -# PG lossless profiles. -# speed cable size xon xoff threshold xon_offset - 10000 5m 1248 2288 35776 0 2288 - 25000 5m 1248 2288 53248 0 2288 - 40000 5m 1248 2288 66560 0 2288 - 50000 5m 1248 2288 90272 0 2288 - 100000 5m 1248 2288 165568 0 2288 - 10000 40m 1248 2288 37024 0 2288 - 25000 40m 1248 2288 53248 0 2288 - 40000 40m 1248 2288 71552 0 2288 - 50000 40m 1248 2288 96096 0 2288 - 100000 40m 1248 2288 177632 0 2288 - 10000 300m 1248 2288 46176 0 2288 - 25000 300m 1248 2288 79040 0 2288 - 40000 300m 1248 2288 108160 0 2288 - 50000 300m 1248 2288 141856 0 2288 - 100000 300m 1248 2288 268736 0 2288 diff --git a/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-C32/pg_profile_lookup.ini b/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-C32/pg_profile_lookup.ini new file mode 120000 index 000000000000..297cddb2d223 --- /dev/null +++ b/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-C32/pg_profile_lookup.ini @@ -0,0 +1 @@ +BALANCED/pg_profile_lookup.ini \ No newline at end of file diff --git a/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-C32/qos.json.j2 b/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-C32/qos.json.j2 deleted file mode 100644 index 34002048afdb..000000000000 --- a/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-C32/qos.json.j2 +++ /dev/null @@ -1,21 +0,0 @@ -{%- macro generate_wred_profiles() %} - "WRED_PROFILE": { - "AZURE_LOSSLESS" : { - "wred_green_enable" : "true", - "wred_yellow_enable" : "true", - "wred_red_enable" : "true", - "ecn" : "ecn_all", - "green_max_threshold" : "2097152", - "green_min_threshold" : "250000", - "yellow_max_threshold" : "2097152", - "yellow_min_threshold" : "1048576", - "red_max_threshold" : "2097152", - "red_min_threshold" : "1048576", - "green_drop_probability" : "5", - "yellow_drop_probability": "5", - "red_drop_probability" : "5" - } - }, -{%- endmacro %} - -{%- include 'qos_config.j2' %} diff --git a/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-C32/qos.json.j2 b/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-C32/qos.json.j2 new file mode 120000 index 000000000000..aef6b6765cf2 --- /dev/null +++ b/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-C32/qos.json.j2 @@ -0,0 +1 @@ +BALANCED/qos.json.j2 \ No newline at end of file diff --git a/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-C32/th-seastone-dx010-32x100G-t0.config.bcm b/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-C32/th-seastone-dx010-32x100G-t0.config.bcm index 7c315460dc8e..d1e484b697c2 100644 --- a/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-C32/th-seastone-dx010-32x100G-t0.config.bcm +++ b/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-C32/th-seastone-dx010-32x100G-t0.config.bcm @@ -14,9 +14,16 @@ l2xmsg_mode=1 l2_mem_entries=8192 l3_mem_entries=8192 l3_alpm_enable=2 +lpm_scaling_enable=0 ipv6_lpm_128b_enable=1 mmu_lossless=0 +# disables bcmALPMDH (ALPM distributed hitbit) thread. This thread is purely for debug purpose +l3_alpm_hit_skip=1 + +# Disable Counting ACL Drop towards interface RX_DRP counter +sai_adjust_acl_drop_in_rx_drop=1 + ################################################################################### # Celestica Customize for SeaStone ################################################################################### @@ -374,3 +381,5 @@ phy_xaui_tx_polarity_flip_130=0x0006 phy_xaui_rx_polarity_flip_130=0x0000 mmu_init_config="MSFT-TH-Tier0" + +phy_an_lt_msft=1 diff --git a/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-C32/th-seastone-dx010-32x100G-t1.config.bcm b/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-C32/th-seastone-dx010-32x100G-t1.config.bcm index effdfb5d7570..5c97546a989c 100644 --- a/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-C32/th-seastone-dx010-32x100G-t1.config.bcm +++ b/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-C32/th-seastone-dx010-32x100G-t1.config.bcm @@ -14,9 +14,16 @@ l2xmsg_mode=1 l2_mem_entries=8192 l3_mem_entries=8192 l3_alpm_enable=2 +lpm_scaling_enable=0 ipv6_lpm_128b_enable=1 mmu_lossless=0 +# Disable bcmALPMDH (ALPM distributed hitbit) thread that is used for debug only +l3_alpm_hit_skip=1 + +# Disable Counting ACL Drop towards interface RX_DRP counter +sai_adjust_acl_drop_in_rx_drop=1 + ################################################################################### # Celestica Customize for SeaStone ################################################################################### @@ -694,3 +701,5 @@ serdes_preemphasis_lane2_130=0x2b4104 serdes_preemphasis_lane3_130=0x2b4104 mmu_init_config="MSFT-TH-Tier1" + +phy_an_lt_msft=1 diff --git a/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-D48C8/BALANCED b/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-D48C8/BALANCED new file mode 120000 index 000000000000..87afd08ffcd8 --- /dev/null +++ b/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-D48C8/BALANCED @@ -0,0 +1 @@ +../../../common/profiles/th/gen/BALANCED \ No newline at end of file diff --git a/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-D48C8/RDMA-CENTRIC b/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-D48C8/RDMA-CENTRIC new file mode 120000 index 000000000000..a05581efb9ff --- /dev/null +++ b/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-D48C8/RDMA-CENTRIC @@ -0,0 +1 @@ +../../../common/profiles/th/gen/RDMA-CENTRIC \ No newline at end of file diff --git a/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-D48C8/TCP-CENTRIC b/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-D48C8/TCP-CENTRIC new file mode 120000 index 000000000000..dd9cf046c0f9 --- /dev/null +++ b/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-D48C8/TCP-CENTRIC @@ -0,0 +1 @@ +../../../common/profiles/th/gen/TCP-CENTRIC \ No newline at end of file diff --git a/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-D48C8/buffer_ports_t0.j2 b/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-D48C8/buffer_ports_t0.j2 new file mode 100644 index 000000000000..b4f4f7bab3f3 --- /dev/null +++ b/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-D48C8/buffer_ports_t0.j2 @@ -0,0 +1,28 @@ +{%- set ports2cable = { + 'torrouter_server' : '300m', + 'leafrouter_torrouter' : '300m', + 'spinerouter_leafrouter' : '300m' + } +-%} + +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {%- for port_idx in range(0,9) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{%- endif %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 2)) %}{%- endif %} + {%- endfor %} + {%- for port_idx in range(14,17) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{%- endif %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 2)) %}{%- endif %} + {%- endfor %} + {%- for port_idx in range(22,31) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{%- endif %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 2)) %}{%- endif %} + {%- endfor %} + {%- for port_idx in range(10,13) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{%- endif %} + {%- endfor %} + {%- for port_idx in range(18,21) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{%- endif %} + {%- endfor %} +{%- endmacro %} \ No newline at end of file diff --git a/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-D48C8/buffers_defaults_t0.j2 b/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-D48C8/buffers_defaults_t0.j2 deleted file mode 100644 index 4e4489f84a87..000000000000 --- a/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-D48C8/buffers_defaults_t0.j2 +++ /dev/null @@ -1,69 +0,0 @@ - -{%- set default_cable = '5m' %} - -{%- set ports2cable = { - 'torrouter_server' : '300m', - 'leafrouter_torrouter' : '300m', - 'spinerouter_leafrouter' : '300m' - } --%} - -{%- macro generate_port_lists(PORT_ALL) %} - {# Generate list of ports #} - {%- for port_idx in range(0,9) %} - {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{%- endif %} - {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 2)) %}{%- endif %} - {%- endfor %} - {%- for port_idx in range(14,17) %} - {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{%- endif %} - {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 2)) %}{%- endif %} - {%- endfor %} - {%- for port_idx in range(22,31) %} - {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{%- endif %} - {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 2)) %}{%- endif %} - {%- endfor %} - {%- for port_idx in range(10,13) %} - {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{%- endif %} - {%- endfor %} - {%- for port_idx in range(18,21) %} - {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{%- endif %} - {%- endfor %} -{%- endmacro %} - -{%- macro generate_buffer_pool_and_profiles() %} - "BUFFER_POOL": { - "ingress_lossless_pool": { - "size": "10875072", - "type": "ingress", - "mode": "dynamic", - "xoff": "4194112" - }, - "egress_lossy_pool": { - "size": "9243812", - "type": "egress", - "mode": "dynamic" - }, - "egress_lossless_pool": { - "size": "15982720", - "type": "egress", - "mode": "static" - } - }, - "BUFFER_PROFILE": { - "ingress_lossy_profile": { - "pool":"[BUFFER_POOL|ingress_lossless_pool]", - "size":"0", - "dynamic_th":"3" - }, - "egress_lossless_profile": { - "pool":"[BUFFER_POOL|egress_lossless_pool]", - "size":"1518", - "static_th":"15982720" - }, - "egress_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"1518", - "dynamic_th":"3" - } - }, -{%- endmacro %} diff --git a/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-D48C8/buffers_defaults_t0.j2 b/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-D48C8/buffers_defaults_t0.j2 new file mode 120000 index 000000000000..9524e6a476ac --- /dev/null +++ b/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-D48C8/buffers_defaults_t0.j2 @@ -0,0 +1 @@ +BALANCED/buffers_defaults_t0.j2 \ No newline at end of file diff --git a/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-D48C8/pg_profile_lookup.ini b/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-D48C8/pg_profile_lookup.ini deleted file mode 100644 index 673df369a9bb..000000000000 --- a/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-D48C8/pg_profile_lookup.ini +++ /dev/null @@ -1,17 +0,0 @@ -# PG lossless profiles. -# speed cable size xon xoff threshold xon_offset - 10000 5m 1248 2288 35776 0 2288 - 25000 5m 1248 2288 53248 0 2288 - 40000 5m 1248 2288 66560 0 2288 - 50000 5m 1248 2288 90272 0 2288 - 100000 5m 1248 2288 165568 0 2288 - 10000 40m 1248 2288 37024 0 2288 - 25000 40m 1248 2288 53248 0 2288 - 40000 40m 1248 2288 71552 0 2288 - 50000 40m 1248 2288 96096 0 2288 - 100000 40m 1248 2288 177632 0 2288 - 10000 300m 1248 2288 46176 0 2288 - 25000 300m 1248 2288 79040 0 2288 - 40000 300m 1248 2288 108160 0 2288 - 50000 300m 1248 2288 141856 0 2288 - 100000 300m 1248 2288 268736 0 2288 diff --git a/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-D48C8/pg_profile_lookup.ini b/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-D48C8/pg_profile_lookup.ini new file mode 120000 index 000000000000..297cddb2d223 --- /dev/null +++ b/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-D48C8/pg_profile_lookup.ini @@ -0,0 +1 @@ +BALANCED/pg_profile_lookup.ini \ No newline at end of file diff --git a/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-D48C8/qos.json.j2 b/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-D48C8/qos.json.j2 deleted file mode 100644 index 34002048afdb..000000000000 --- a/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-D48C8/qos.json.j2 +++ /dev/null @@ -1,21 +0,0 @@ -{%- macro generate_wred_profiles() %} - "WRED_PROFILE": { - "AZURE_LOSSLESS" : { - "wred_green_enable" : "true", - "wred_yellow_enable" : "true", - "wred_red_enable" : "true", - "ecn" : "ecn_all", - "green_max_threshold" : "2097152", - "green_min_threshold" : "250000", - "yellow_max_threshold" : "2097152", - "yellow_min_threshold" : "1048576", - "red_max_threshold" : "2097152", - "red_min_threshold" : "1048576", - "green_drop_probability" : "5", - "yellow_drop_probability": "5", - "red_drop_probability" : "5" - } - }, -{%- endmacro %} - -{%- include 'qos_config.j2' %} diff --git a/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-D48C8/qos.json.j2 b/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-D48C8/qos.json.j2 new file mode 120000 index 000000000000..aef6b6765cf2 --- /dev/null +++ b/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-D48C8/qos.json.j2 @@ -0,0 +1 @@ +BALANCED/qos.json.j2 \ No newline at end of file diff --git a/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-D48C8/th-seastone-dx010-48x50G+8x100G.config.bcm b/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-D48C8/th-seastone-dx010-48x50G+8x100G.config.bcm index 6707aa71df09..4ded347e408c 100644 --- a/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-D48C8/th-seastone-dx010-48x50G+8x100G.config.bcm +++ b/device/celestica/x86_64-cel_seastone-r0/Celestica-DX010-D48C8/th-seastone-dx010-48x50G+8x100G.config.bcm @@ -1,648 +1,658 @@ -os=unix -l2xmsg_mode=1 -parity_enable=0 -rate_ext_mdio_divisor=0x80 -phy_ext_rom_boot=0 -fpem_mem_entries=32768 -l2xmsg_mode=1 -oversubscribe_mode=1 -pbmp_xport_xe=0xcccc44cc33113333044cccccc66666622 - - -dport_map_enable=1 -dport_map_port_68=1 -dport_map_port_69=2 - -dport_map_port_72=5 -dport_map_port_73=6 - -dport_map_port_76=9 -dport_map_port_77=10 - -dport_map_port_80=13 -dport_map_port_81=14 - -dport_map_port_34=17 -dport_map_port_35=18 - -dport_map_port_38=21 -dport_map_port_39=22 - -dport_map_port_42=25 -dport_map_port_43=26 - -dport_map_port_46=29 -dport_map_port_47=30 - -dport_map_port_50=33 -dport_map_port_51=34 - -dport_map_port_54=37 -dport_map_port_55=38 - -dport_map_port_58=41 - -dport_map_port_62=45 - -dport_map_port_84=49 - -dport_map_port_88=53 - -dport_map_port_92=57 -dport_map_port_93=58 - -dport_map_port_96=61 -dport_map_port_97=62 - -dport_map_port_102=65 -dport_map_port_103=66 - -dport_map_port_106=69 -dport_map_port_107=70 - -dport_map_port_110=73 - -dport_map_port_114=77 - -dport_map_port_1=81 - -dport_map_port_5=85 - -dport_map_port_9=89 -dport_map_port_10=90 - -dport_map_port_13=93 -dport_map_port_14=94 - -dport_map_port_17=97 -dport_map_port_18=98 - -dport_map_port_21=101 -dport_map_port_22=102 - -dport_map_port_25=105 -dport_map_port_26=106 - -dport_map_port_29=109 -dport_map_port_30=110 - -dport_map_port_118=113 -dport_map_port_119=114 - -dport_map_port_122=117 -dport_map_port_123=118 - -dport_map_port_126=121 -dport_map_port_127=122 - -dport_map_port_130=125 -dport_map_port_131=126 - - -# port mapping -portmap_68=65:50:2 -portmap_69=67:50:2 - -portmap_72=69:50:2 -portmap_73=71:50:2 - -portmap_76=73:50:2 -portmap_77=75:50:2 - -portmap_80=77:50:2 -portmap_81=79:50:2 - -portmap_34=33:50:2 -portmap_35=35:50:2 - -portmap_38=37:50:2 -portmap_39=39:50:2 - -portmap_42=41:50:2 -portmap_43=43:50:2 - -portmap_46=45:50:2 -portmap_47=47:50:2 - -portmap_50=49:50:2 -portmap_51=51:50:2 - -portmap_54=53:50:2 -portmap_55=55:50:2 - -portmap_58=57:100:4 - -portmap_62=61:100:4 - -portmap_84=81:100:4 - -portmap_88=85:100:4 - -portmap_92=89:50:2 -portmap_93=91:50:2 - -portmap_96=93:50:2 -portmap_97=95:50:2 - -portmap_102=97:50:2 -portmap_103=99:50:2 - -portmap_106=101:50:2 -portmap_107=103:50:2 - -portmap_110=105:100:4 - -portmap_114=109:100:4 - -portmap_1=1:100:4 - -portmap_5=5:100:4 - -portmap_9=9:50:2 -portmap_10=11:50:2 - -portmap_13=13:50:2 -portmap_14=15:50:2 - -portmap_17=17:50:2 -portmap_18=19:50:2 - -portmap_21=21:50:2 -portmap_22=23:50:2 - -portmap_25=25:50:2 -portmap_26=27:50:2 - -portmap_29=29:50:2 -portmap_30=31:50:2 - -portmap_118=113:50:2 -portmap_119=115:50:2 - -portmap_122=117:50:2 -portmap_123=119:50:2 - -portmap_126=121:50:2 -portmap_127=123:50:2 - -portmap_130=125:50:2 -portmap_131=127:50:2 - - -#WC16 -xgxs_tx_lane_map_68=0x1023 -xgxs_rx_lane_map_68=0x0132 -xgxs_tx_lane_map_69=0x1023 -xgxs_rx_lane_map_69=0x0132 - - -#WC17 -xgxs_tx_lane_map_72=0x1023 -xgxs_rx_lane_map_72=0x1032 -xgxs_tx_lane_map_73=0x1023 -xgxs_rx_lane_map_73=0x1032 - -#WC18 -xgxs_tx_lane_map_76=0x2310 -xgxs_rx_lane_map_76=0x3210 -xgxs_tx_lane_map_77=0x2310 -xgxs_rx_lane_map_77=0x3210 - -#WC19 -xgxs_tx_lane_map_80=0x1302 -xgxs_rx_lane_map_80=0x0231 -xgxs_tx_lane_map_81=0x1302 -xgxs_rx_lane_map_81=0x0231 -#WC8 -xgxs_tx_lane_map_34=0x1203 -xgxs_rx_lane_map_34=0x3120 -xgxs_tx_lane_map_35=0x1203 -xgxs_rx_lane_map_35=0x3120 - -#WC9 -xgxs_tx_lane_map_38=0x0123 -xgxs_rx_lane_map_38=0x3201 -xgxs_tx_lane_map_39=0x0123 -xgxs_rx_lane_map_39=0x3201 - -#WC10 -xgxs_tx_lane_map_42=0x0132 -xgxs_rx_lane_map_42=0x0123 -xgxs_tx_lane_map_43=0x0132 -xgxs_rx_lane_map_43=0x0123 - -#WC11 -xgxs_tx_lane_map_46=0x2301 -xgxs_rx_lane_map_46=0x2031 -xgxs_tx_lane_map_47=0x2301 -xgxs_rx_lane_map_47=0x2031 - -#WC12 -xgxs_tx_lane_map_50=0x1032 -xgxs_rx_lane_map_50=0x3120 -xgxs_tx_lane_map_51=0x1032 -xgxs_rx_lane_map_51=0x3120 - - -#WC13 -xgxs_tx_lane_map_54=0x1032 -xgxs_rx_lane_map_54=0x0132 -xgxs_tx_lane_map_55=0x1032 -xgxs_rx_lane_map_55=0x0132 - -#WC14 - xgxs_tx_lane_map_58=0x1032 - xgxs_rx_lane_map_58=0x3120 - -#WC15 -xgxs_tx_lane_map_62=0x2031 -xgxs_rx_lane_map_62=0x0132 - -#WC20 - xgxs_tx_lane_map_84=0x3120 - xgxs_rx_lane_map_84=0x1032 - -#WC21 -xgxs_tx_lane_map_88=0x2310 -xgxs_rx_lane_map_88=0x0123 - -#WC22 -xgxs_tx_lane_map_92=0x2310 -xgxs_rx_lane_map_92=0x1302 -xgxs_tx_lane_map_93=0x2310 -xgxs_rx_lane_map_93=0x1302 - -#WC23 -xgxs_tx_lane_map_96=0x1302 -xgxs_rx_lane_map_96=0x1023 -xgxs_tx_lane_map_97=0x1302 -xgxs_rx_lane_map_97=0x1023 - -#WC24 -xgxs_tx_lane_map_102=0x2310 -xgxs_rx_lane_map_102=0x1032 -xgxs_tx_lane_map_103=0x2310 -xgxs_rx_lane_map_103=0x1032 - -#WC25 -xgxs_tx_lane_map_106=0x2310 -xgxs_rx_lane_map_106=0x1023 -xgxs_tx_lane_map_107=0x2310 -xgxs_rx_lane_map_107=0x1023 - -#WC26 -xgxs_tx_lane_map_110=0x2310 -xgxs_rx_lane_map_110=0x1302 - -#WC27 -xgxs_tx_lane_map_114=0x1302 -xgxs_rx_lane_map_114=0x1032 - -#WC0 -xgxs_tx_lane_map_1=0x0123 -xgxs_rx_lane_map_1=0x0213 - -#WC1 -xgxs_tx_lane_map_5=0x2310 -xgxs_rx_lane_map_5=0x3201 - -#WC2 -xgxs_tx_lane_map_9=0x1023 -xgxs_rx_lane_map_9=0x0213 -xgxs_tx_lane_map_10=0x1023 -xgxs_rx_lane_map_10=0x0213 - -#WC3 -xgxs_tx_lane_map_13=0x1302 -xgxs_rx_lane_map_13=0x3201 -xgxs_tx_lane_map_14=0x1302 -xgxs_rx_lane_map_14=0x3201 - -#WC4 -xgxs_tx_lane_map_17=0x0132 -xgxs_rx_lane_map_17=0x0123 -xgxs_tx_lane_map_18=0x0132 -xgxs_rx_lane_map_18=0x0123 - -#WC5 -xgxs_tx_lane_map_21=0x1032 -xgxs_rx_lane_map_21=0x0213 -xgxs_tx_lane_map_22=0x1032 -xgxs_rx_lane_map_22=0x0213 - -#WC6 -xgxs_tx_lane_map_25=0x1023 -xgxs_rx_lane_map_25=0x3120 -xgxs_tx_lane_map_26=0x1023 -xgxs_rx_lane_map_26=0x3120 - -#WC7 -xgxs_tx_lane_map_29=0x2031 -xgxs_rx_lane_map_29=0x3201 -xgxs_tx_lane_map_30=0x2031 -xgxs_rx_lane_map_30=0x3201 - -#WC28 -xgxs_tx_lane_map_118=0x0231 -xgxs_rx_lane_map_118=0x2031 -xgxs_tx_lane_map_119=0x0231 -xgxs_rx_lane_map_119=0x2031 - -#WC29 -xgxs_tx_lane_map_122=0x3201 -xgxs_rx_lane_map_122=0x2301 -xgxs_tx_lane_map_123=0x3201 -xgxs_rx_lane_map_123=0x2301 - -#WC30 -xgxs_tx_lane_map_126=0x0213 -xgxs_rx_lane_map_126=0x0213 -xgxs_tx_lane_map_127=0x0213 -xgxs_rx_lane_map_127=0x0213 - -#WC31 -xgxs_tx_lane_map_130=0x2031 -xgxs_rx_lane_map_130=0x1032 -xgxs_tx_lane_map_131=0x2031 -xgxs_rx_lane_map_131=0x1032 - -#PN - -#WC16 -phy_xaui_tx_polarity_flip_68=0x0000 -phy_xaui_rx_polarity_flip_68=0x0000 -phy_xaui_tx_polarity_flip_69=0x0000 -phy_xaui_rx_polarity_flip_69=0x0000 - -#WC17 -phy_xaui_tx_polarity_flip_72=0x0003 -phy_xaui_rx_polarity_flip_72=0x0000 -phy_xaui_tx_polarity_flip_73=0x0002 -phy_xaui_rx_polarity_flip_73=0x0001 - - - -#WC18 -phy_xaui_tx_polarity_flip_76=0x0003 -phy_xaui_rx_polarity_flip_76=0x0000 -phy_xaui_tx_polarity_flip_77=0x0003 -phy_xaui_rx_polarity_flip_77=0x0000 - - -#WC19 -phy_xaui_tx_polarity_flip_80=0x0003 -phy_xaui_rx_polarity_flip_80=0x0003 -phy_xaui_tx_polarity_flip_81=0x0003 -phy_xaui_rx_polarity_flip_81=0x0003 - - -#WC8 -phy_xaui_tx_polarity_flip_34=0x0003 -phy_xaui_rx_polarity_flip_34=0x0000 -phy_xaui_tx_polarity_flip_35=0x0001 -phy_xaui_rx_polarity_flip_35=0x0000 - - -#WC9 -phy_xaui_tx_polarity_flip_38=0x0001 -phy_xaui_rx_polarity_flip_38=0x0000 -phy_xaui_tx_polarity_flip_39=0x0000 -phy_xaui_rx_polarity_flip_39=0x0000 - - -#WC10 -phy_xaui_tx_polarity_flip_42=0x0003 -phy_xaui_rx_polarity_flip_42=0x0000 -phy_xaui_tx_polarity_flip_43=0x0002 -phy_xaui_rx_polarity_flip_43=0x0000 - - -#WC11 -phy_xaui_tx_polarity_flip_46=0x0000 -phy_xaui_rx_polarity_flip_46=0x0000 -phy_xaui_tx_polarity_flip_47=0x0000 -phy_xaui_rx_polarity_flip_47=0x0000 - - -#WC12 -phy_xaui_tx_polarity_flip_50=0x0000 -phy_xaui_rx_polarity_flip_50=0x0000 -phy_xaui_tx_polarity_flip_51=0x0001 -phy_xaui_rx_polarity_flip_51=0x0000 - -#WC13 -phy_xaui_tx_polarity_flip_54=0x0000 -phy_xaui_rx_polarity_flip_54=0x0000 -phy_xaui_tx_polarity_flip_55=0x0001 -phy_xaui_rx_polarity_flip_55=0x0000 - -#WC14 -phy_xaui_tx_polarity_flip_58=0x0000 -phy_xaui_rx_polarity_flip_58=0x0000 - -#WC15 -phy_xaui_tx_polarity_flip_62=0x0005 -phy_xaui_rx_polarity_flip_62=0x000F - -#WC20 - phy_xaui_tx_polarity_flip_84=0x000E - phy_xaui_rx_polarity_flip_84=0x0007 - -#WC21 -phy_xaui_tx_polarity_flip_88=0x000B -phy_xaui_rx_polarity_flip_88=0x000B - -#WC22 -phy_xaui_tx_polarity_flip_92=0x0003 -phy_xaui_rx_polarity_flip_92=0x0001 -phy_xaui_tx_polarity_flip_93=0x0003 -phy_xaui_rx_polarity_flip_93=0x0000 - - -#WC23 -phy_xaui_tx_polarity_flip_96=0x0002 -phy_xaui_rx_polarity_flip_96=0x0000 -phy_xaui_tx_polarity_flip_97=0x0002 -phy_xaui_rx_polarity_flip_97=0x0000 - -#WC24 -phy_xaui_tx_polarity_flip_102=0x0000 -phy_xaui_rx_polarity_flip_102=0x0003 -phy_xaui_tx_polarity_flip_103=0x0000 -phy_xaui_rx_polarity_flip_103=0x0003 - - -#WC25 -phy_xaui_tx_polarity_flip_106=0x0003 -phy_xaui_rx_polarity_flip_106=0x0000 -phy_xaui_tx_polarity_flip_107=0x0003 -phy_xaui_rx_polarity_flip_107=0x0000 - -#WC26 -phy_xaui_tx_polarity_flip_110=0x000F -phy_xaui_rx_polarity_flip_110=0x000F - -#WC27 -phy_xaui_tx_polarity_flip_114=0x000F -phy_xaui_rx_polarity_flip_114=0x000E - -#WC0 -phy_xaui_tx_polarity_flip_1=0x000C -phy_xaui_rx_polarity_flip_1=0x000F - -#WC1 -phy_xaui_tx_polarity_flip_5=0x000E -phy_xaui_rx_polarity_flip_5=0x0000 - -#WC2 -phy_xaui_tx_polarity_flip_9=0x0000 -phy_xaui_rx_polarity_flip_9=0x0001 -phy_xaui_tx_polarity_flip_10=0x0001 -phy_xaui_rx_polarity_flip_10=0x0000 - - -#WC3 -phy_xaui_tx_polarity_flip_13=0x0003 -phy_xaui_rx_polarity_flip_13=0x0000 -phy_xaui_tx_polarity_flip_14=0x0003 -phy_xaui_rx_polarity_flip_14=0x0000 - -#WC4 -phy_xaui_tx_polarity_flip_17=0x0002 -phy_xaui_rx_polarity_flip_17=0x0000 -phy_xaui_tx_polarity_flip_18=0x0003 -phy_xaui_rx_polarity_flip_18=0x0000 - - -#WC5 -phy_xaui_tx_polarity_flip_21=0x0000 -phy_xaui_rx_polarity_flip_21=0x0000 -phy_xaui_tx_polarity_flip_22=0x0000 -phy_xaui_rx_polarity_flip_22=0x0000 - - -#WC6 -phy_xaui_tx_polarity_flip_25=0x0000 -phy_xaui_rx_polarity_flip_25=0x0002 -phy_xaui_tx_polarity_flip_26=0x0001 -phy_xaui_rx_polarity_flip_26=0x0002 - - -#WC7 -phy_xaui_tx_polarity_flip_29=0x0000 -phy_xaui_rx_polarity_flip_29=0x0000 -phy_xaui_tx_polarity_flip_30=0x0001 -phy_xaui_rx_polarity_flip_30=0x0000 - - -#WC28 -phy_xaui_tx_polarity_flip_118=0x0003 -phy_xaui_rx_polarity_flip_118=0x0003 -phy_xaui_tx_polarity_flip_119=0x0003 -phy_xaui_rx_polarity_flip_119=0x0003 - - -#WC29 -phy_xaui_tx_polarity_flip_122=0x0002 -phy_xaui_rx_polarity_flip_122=0x0000 -phy_xaui_tx_polarity_flip_123=0x0000 -phy_xaui_rx_polarity_flip_123=0x0000 - - -#WC30 -phy_xaui_tx_polarity_flip_126=0x0003 -phy_xaui_rx_polarity_flip_126=0x0000 -phy_xaui_tx_polarity_flip_127=0x0003 -phy_xaui_rx_polarity_flip_127=0x0000 - - -#WC31 -phy_xaui_tx_polarity_flip_130=0x0002 -phy_xaui_rx_polarity_flip_130=0x0000 -phy_xaui_tx_polarity_flip_131=0x0001 -phy_xaui_rx_polarity_flip_131=0x0000 - -#xe -serdes_driver_current=0x0a -serdes_preemphasis=0x1a5402 - -#ce0 -serdes_driver_current_lane0_58=0x0a -serdes_driver_current_lane1_58=0x09 -serdes_driver_current_lane2_58=0x09 -serdes_driver_current_lane3_58=0x0a -serdes_preemphasis_lane0_58=0x254902 -serdes_preemphasis_lane1_58=0x244a02 -serdes_preemphasis_lane2_58=0x244a02 -serdes_preemphasis_lane3_58=0x254902 - -#ce1 -serdes_driver_current_lane0_62=0x09 -serdes_driver_current_lane1_62=0x0a -serdes_driver_current_lane2_62=0x09 -serdes_driver_current_lane3_62=0x09 -serdes_preemphasis_lane0_62=0x244a02 -serdes_preemphasis_lane1_62=0x254902 -serdes_preemphasis_lane2_62=0x244a02 -serdes_preemphasis_lane3_62=0x244a02 - -#ce2 -serdes_driver_current_lane0_84=0x09 -serdes_driver_current_lane1_84=0x09 -serdes_driver_current_lane2_84=0x09 -serdes_driver_current_lane3_84=0x09 -serdes_preemphasis_lane0_84=0x204e02 -serdes_preemphasis_lane1_84=0x204e02 -serdes_preemphasis_lane2_84=0x204e02 -serdes_preemphasis_lane3_84=0x204e02 - -#ce3 -serdes_driver_current_lane0_88=0x09 -serdes_driver_current_lane1_88=0x08 -serdes_driver_current_lane2_88=0x08 -serdes_driver_current_lane3_88=0x09 -serdes_preemphasis_lane0_88=0x204e02 -serdes_preemphasis_lane1_88=0x1d5102 -serdes_preemphasis_lane2_88=0x1d5102 -serdes_preemphasis_lane3_88=0x204e02 - -#ce4 -serdes_driver_current_lane0_110=0x09 -serdes_driver_current_lane1_110=0x08 -serdes_driver_current_lane2_110=0x08 -serdes_driver_current_lane3_110=0x09 -serdes_preemphasis_lane0_110=0x204e02 -serdes_preemphasis_lane1_110=0x1d5102 -serdes_preemphasis_lane2_110=0x1d5102 -serdes_preemphasis_lane3_110=0x204e02 - -#ce5 -serdes_driver_current_lane0_114=0x09 -serdes_driver_current_lane1_114=0x08 -serdes_driver_current_lane2_114=0x09 -serdes_driver_current_lane3_114=0x09 -serdes_preemphasis_lane0_114=0x204e02 -serdes_preemphasis_lane1_114=0x1d5102 -serdes_preemphasis_lane2_114=0x224c02 -serdes_preemphasis_lane3_114=0x224c02 - -#ce6 -serdes_driver_current_lane0_1=0x09 -serdes_driver_current_lane1_1=0x0a -serdes_driver_current_lane2_1=0x09 -serdes_driver_current_lane3_1=0x0a -serdes_preemphasis_lane0_1=0x244a02 -serdes_preemphasis_lane1_1=0x254902 -serdes_preemphasis_lane2_1=0x244a02 -serdes_preemphasis_lane3_1=0x254902 - -#ce7 -serdes_driver_current_lane0_5=0x09 -serdes_driver_current_lane1_5=0x09 -serdes_driver_current_lane2_5=0x09 -serdes_driver_current_lane3_5=0x0a -serdes_preemphasis_lane0_5=0x244a02 -serdes_preemphasis_lane1_5=0x244a02 -serdes_preemphasis_lane2_5=0x244a02 -serdes_preemphasis_lane3_5=0x254902 - +# disables bcmALPMDH (ALPM distributed hitbit) thread. This thread is purely for debug purpose +l3_alpm_hit_skip=1 + +# Disable Counting ACL Drop towards interface RX_DRP counter +sai_adjust_acl_drop_in_rx_drop=1 + +os=unix +l2xmsg_mode=1 +parity_enable=0 +rate_ext_mdio_divisor=0x80 +phy_ext_rom_boot=0 +fpem_mem_entries=32768 +l2xmsg_mode=1 +oversubscribe_mode=1 +l3_alpm_enable=2 +lpm_scaling_enable=0 +ipv6_lpm_128b_enable=1 +pbmp_xport_xe=0xcccc44cc33113333044cccccc66666622 + + +dport_map_enable=1 +dport_map_port_68=1 +dport_map_port_69=2 + +dport_map_port_72=5 +dport_map_port_73=6 + +dport_map_port_76=9 +dport_map_port_77=10 + +dport_map_port_80=13 +dport_map_port_81=14 + +dport_map_port_34=17 +dport_map_port_35=18 + +dport_map_port_38=21 +dport_map_port_39=22 + +dport_map_port_42=25 +dport_map_port_43=26 + +dport_map_port_46=29 +dport_map_port_47=30 + +dport_map_port_50=33 +dport_map_port_51=34 + +dport_map_port_54=37 +dport_map_port_55=38 + +dport_map_port_58=41 + +dport_map_port_62=45 + +dport_map_port_84=49 + +dport_map_port_88=53 + +dport_map_port_92=57 +dport_map_port_93=58 + +dport_map_port_96=61 +dport_map_port_97=62 + +dport_map_port_102=65 +dport_map_port_103=66 + +dport_map_port_106=69 +dport_map_port_107=70 + +dport_map_port_110=73 + +dport_map_port_114=77 + +dport_map_port_1=81 + +dport_map_port_5=85 + +dport_map_port_9=89 +dport_map_port_10=90 + +dport_map_port_13=93 +dport_map_port_14=94 + +dport_map_port_17=97 +dport_map_port_18=98 + +dport_map_port_21=101 +dport_map_port_22=102 + +dport_map_port_25=105 +dport_map_port_26=106 + +dport_map_port_29=109 +dport_map_port_30=110 + +dport_map_port_118=113 +dport_map_port_119=114 + +dport_map_port_122=117 +dport_map_port_123=118 + +dport_map_port_126=121 +dport_map_port_127=122 + +dport_map_port_130=125 +dport_map_port_131=126 + + +# port mapping +portmap_68=65:50:2 +portmap_69=67:50:2 + +portmap_72=69:50:2 +portmap_73=71:50:2 + +portmap_76=73:50:2 +portmap_77=75:50:2 + +portmap_80=77:50:2 +portmap_81=79:50:2 + +portmap_34=33:50:2 +portmap_35=35:50:2 + +portmap_38=37:50:2 +portmap_39=39:50:2 + +portmap_42=41:50:2 +portmap_43=43:50:2 + +portmap_46=45:50:2 +portmap_47=47:50:2 + +portmap_50=49:50:2 +portmap_51=51:50:2 + +portmap_54=53:50:2 +portmap_55=55:50:2 + +portmap_58=57:100:4 + +portmap_62=61:100:4 + +portmap_84=81:100:4 + +portmap_88=85:100:4 + +portmap_92=89:50:2 +portmap_93=91:50:2 + +portmap_96=93:50:2 +portmap_97=95:50:2 + +portmap_102=97:50:2 +portmap_103=99:50:2 + +portmap_106=101:50:2 +portmap_107=103:50:2 + +portmap_110=105:100:4 + +portmap_114=109:100:4 + +portmap_1=1:100:4 + +portmap_5=5:100:4 + +portmap_9=9:50:2 +portmap_10=11:50:2 + +portmap_13=13:50:2 +portmap_14=15:50:2 + +portmap_17=17:50:2 +portmap_18=19:50:2 + +portmap_21=21:50:2 +portmap_22=23:50:2 + +portmap_25=25:50:2 +portmap_26=27:50:2 + +portmap_29=29:50:2 +portmap_30=31:50:2 + +portmap_118=113:50:2 +portmap_119=115:50:2 + +portmap_122=117:50:2 +portmap_123=119:50:2 + +portmap_126=121:50:2 +portmap_127=123:50:2 + +portmap_130=125:50:2 +portmap_131=127:50:2 + + +#WC16 +xgxs_tx_lane_map_68=0x1023 +xgxs_rx_lane_map_68=0x0132 +xgxs_tx_lane_map_69=0x1023 +xgxs_rx_lane_map_69=0x0132 + + +#WC17 +xgxs_tx_lane_map_72=0x1023 +xgxs_rx_lane_map_72=0x1032 +xgxs_tx_lane_map_73=0x1023 +xgxs_rx_lane_map_73=0x1032 + +#WC18 +xgxs_tx_lane_map_76=0x2310 +xgxs_rx_lane_map_76=0x3210 +xgxs_tx_lane_map_77=0x2310 +xgxs_rx_lane_map_77=0x3210 + +#WC19 +xgxs_tx_lane_map_80=0x1302 +xgxs_rx_lane_map_80=0x0231 +xgxs_tx_lane_map_81=0x1302 +xgxs_rx_lane_map_81=0x0231 +#WC8 +xgxs_tx_lane_map_34=0x1203 +xgxs_rx_lane_map_34=0x3120 +xgxs_tx_lane_map_35=0x1203 +xgxs_rx_lane_map_35=0x3120 + +#WC9 +xgxs_tx_lane_map_38=0x0123 +xgxs_rx_lane_map_38=0x3201 +xgxs_tx_lane_map_39=0x0123 +xgxs_rx_lane_map_39=0x3201 + +#WC10 +xgxs_tx_lane_map_42=0x0132 +xgxs_rx_lane_map_42=0x0123 +xgxs_tx_lane_map_43=0x0132 +xgxs_rx_lane_map_43=0x0123 + +#WC11 +xgxs_tx_lane_map_46=0x2301 +xgxs_rx_lane_map_46=0x2031 +xgxs_tx_lane_map_47=0x2301 +xgxs_rx_lane_map_47=0x2031 + +#WC12 +xgxs_tx_lane_map_50=0x1032 +xgxs_rx_lane_map_50=0x3120 +xgxs_tx_lane_map_51=0x1032 +xgxs_rx_lane_map_51=0x3120 + + +#WC13 +xgxs_tx_lane_map_54=0x1032 +xgxs_rx_lane_map_54=0x0132 +xgxs_tx_lane_map_55=0x1032 +xgxs_rx_lane_map_55=0x0132 + +#WC14 + xgxs_tx_lane_map_58=0x1032 + xgxs_rx_lane_map_58=0x3120 + +#WC15 +xgxs_tx_lane_map_62=0x2031 +xgxs_rx_lane_map_62=0x0132 + +#WC20 + xgxs_tx_lane_map_84=0x3120 + xgxs_rx_lane_map_84=0x1032 + +#WC21 +xgxs_tx_lane_map_88=0x2310 +xgxs_rx_lane_map_88=0x0123 + +#WC22 +xgxs_tx_lane_map_92=0x2310 +xgxs_rx_lane_map_92=0x1302 +xgxs_tx_lane_map_93=0x2310 +xgxs_rx_lane_map_93=0x1302 + +#WC23 +xgxs_tx_lane_map_96=0x1302 +xgxs_rx_lane_map_96=0x1023 +xgxs_tx_lane_map_97=0x1302 +xgxs_rx_lane_map_97=0x1023 + +#WC24 +xgxs_tx_lane_map_102=0x2310 +xgxs_rx_lane_map_102=0x1032 +xgxs_tx_lane_map_103=0x2310 +xgxs_rx_lane_map_103=0x1032 + +#WC25 +xgxs_tx_lane_map_106=0x2310 +xgxs_rx_lane_map_106=0x1023 +xgxs_tx_lane_map_107=0x2310 +xgxs_rx_lane_map_107=0x1023 + +#WC26 +xgxs_tx_lane_map_110=0x2310 +xgxs_rx_lane_map_110=0x1302 + +#WC27 +xgxs_tx_lane_map_114=0x1302 +xgxs_rx_lane_map_114=0x1032 + +#WC0 +xgxs_tx_lane_map_1=0x0123 +xgxs_rx_lane_map_1=0x0213 + +#WC1 +xgxs_tx_lane_map_5=0x2310 +xgxs_rx_lane_map_5=0x3201 + +#WC2 +xgxs_tx_lane_map_9=0x1023 +xgxs_rx_lane_map_9=0x0213 +xgxs_tx_lane_map_10=0x1023 +xgxs_rx_lane_map_10=0x0213 + +#WC3 +xgxs_tx_lane_map_13=0x1302 +xgxs_rx_lane_map_13=0x3201 +xgxs_tx_lane_map_14=0x1302 +xgxs_rx_lane_map_14=0x3201 + +#WC4 +xgxs_tx_lane_map_17=0x0132 +xgxs_rx_lane_map_17=0x0123 +xgxs_tx_lane_map_18=0x0132 +xgxs_rx_lane_map_18=0x0123 + +#WC5 +xgxs_tx_lane_map_21=0x1032 +xgxs_rx_lane_map_21=0x0213 +xgxs_tx_lane_map_22=0x1032 +xgxs_rx_lane_map_22=0x0213 + +#WC6 +xgxs_tx_lane_map_25=0x1023 +xgxs_rx_lane_map_25=0x3120 +xgxs_tx_lane_map_26=0x1023 +xgxs_rx_lane_map_26=0x3120 + +#WC7 +xgxs_tx_lane_map_29=0x2031 +xgxs_rx_lane_map_29=0x3201 +xgxs_tx_lane_map_30=0x2031 +xgxs_rx_lane_map_30=0x3201 + +#WC28 +xgxs_tx_lane_map_118=0x0231 +xgxs_rx_lane_map_118=0x2031 +xgxs_tx_lane_map_119=0x0231 +xgxs_rx_lane_map_119=0x2031 + +#WC29 +xgxs_tx_lane_map_122=0x3201 +xgxs_rx_lane_map_122=0x2301 +xgxs_tx_lane_map_123=0x3201 +xgxs_rx_lane_map_123=0x2301 + +#WC30 +xgxs_tx_lane_map_126=0x0213 +xgxs_rx_lane_map_126=0x0213 +xgxs_tx_lane_map_127=0x0213 +xgxs_rx_lane_map_127=0x0213 + +#WC31 +xgxs_tx_lane_map_130=0x2031 +xgxs_rx_lane_map_130=0x1032 +xgxs_tx_lane_map_131=0x2031 +xgxs_rx_lane_map_131=0x1032 + +#PN + +#WC16 +phy_xaui_tx_polarity_flip_68=0x0000 +phy_xaui_rx_polarity_flip_68=0x0000 +phy_xaui_tx_polarity_flip_69=0x0000 +phy_xaui_rx_polarity_flip_69=0x0000 + +#WC17 +phy_xaui_tx_polarity_flip_72=0x0003 +phy_xaui_rx_polarity_flip_72=0x0000 +phy_xaui_tx_polarity_flip_73=0x0002 +phy_xaui_rx_polarity_flip_73=0x0001 + + + +#WC18 +phy_xaui_tx_polarity_flip_76=0x0003 +phy_xaui_rx_polarity_flip_76=0x0000 +phy_xaui_tx_polarity_flip_77=0x0003 +phy_xaui_rx_polarity_flip_77=0x0000 + + +#WC19 +phy_xaui_tx_polarity_flip_80=0x0003 +phy_xaui_rx_polarity_flip_80=0x0003 +phy_xaui_tx_polarity_flip_81=0x0003 +phy_xaui_rx_polarity_flip_81=0x0003 + + +#WC8 +phy_xaui_tx_polarity_flip_34=0x0003 +phy_xaui_rx_polarity_flip_34=0x0000 +phy_xaui_tx_polarity_flip_35=0x0001 +phy_xaui_rx_polarity_flip_35=0x0000 + + +#WC9 +phy_xaui_tx_polarity_flip_38=0x0001 +phy_xaui_rx_polarity_flip_38=0x0000 +phy_xaui_tx_polarity_flip_39=0x0000 +phy_xaui_rx_polarity_flip_39=0x0000 + + +#WC10 +phy_xaui_tx_polarity_flip_42=0x0003 +phy_xaui_rx_polarity_flip_42=0x0000 +phy_xaui_tx_polarity_flip_43=0x0002 +phy_xaui_rx_polarity_flip_43=0x0000 + + +#WC11 +phy_xaui_tx_polarity_flip_46=0x0000 +phy_xaui_rx_polarity_flip_46=0x0000 +phy_xaui_tx_polarity_flip_47=0x0000 +phy_xaui_rx_polarity_flip_47=0x0000 + + +#WC12 +phy_xaui_tx_polarity_flip_50=0x0000 +phy_xaui_rx_polarity_flip_50=0x0000 +phy_xaui_tx_polarity_flip_51=0x0001 +phy_xaui_rx_polarity_flip_51=0x0000 + +#WC13 +phy_xaui_tx_polarity_flip_54=0x0000 +phy_xaui_rx_polarity_flip_54=0x0000 +phy_xaui_tx_polarity_flip_55=0x0001 +phy_xaui_rx_polarity_flip_55=0x0000 + +#WC14 +phy_xaui_tx_polarity_flip_58=0x0000 +phy_xaui_rx_polarity_flip_58=0x0000 + +#WC15 +phy_xaui_tx_polarity_flip_62=0x0005 +phy_xaui_rx_polarity_flip_62=0x000F + +#WC20 + phy_xaui_tx_polarity_flip_84=0x000E + phy_xaui_rx_polarity_flip_84=0x0007 + +#WC21 +phy_xaui_tx_polarity_flip_88=0x000B +phy_xaui_rx_polarity_flip_88=0x000B + +#WC22 +phy_xaui_tx_polarity_flip_92=0x0003 +phy_xaui_rx_polarity_flip_92=0x0001 +phy_xaui_tx_polarity_flip_93=0x0003 +phy_xaui_rx_polarity_flip_93=0x0000 + + +#WC23 +phy_xaui_tx_polarity_flip_96=0x0002 +phy_xaui_rx_polarity_flip_96=0x0000 +phy_xaui_tx_polarity_flip_97=0x0002 +phy_xaui_rx_polarity_flip_97=0x0000 + +#WC24 +phy_xaui_tx_polarity_flip_102=0x0000 +phy_xaui_rx_polarity_flip_102=0x0003 +phy_xaui_tx_polarity_flip_103=0x0000 +phy_xaui_rx_polarity_flip_103=0x0003 + + +#WC25 +phy_xaui_tx_polarity_flip_106=0x0003 +phy_xaui_rx_polarity_flip_106=0x0000 +phy_xaui_tx_polarity_flip_107=0x0003 +phy_xaui_rx_polarity_flip_107=0x0000 + +#WC26 +phy_xaui_tx_polarity_flip_110=0x000F +phy_xaui_rx_polarity_flip_110=0x000F + +#WC27 +phy_xaui_tx_polarity_flip_114=0x000F +phy_xaui_rx_polarity_flip_114=0x000E + +#WC0 +phy_xaui_tx_polarity_flip_1=0x000C +phy_xaui_rx_polarity_flip_1=0x000F + +#WC1 +phy_xaui_tx_polarity_flip_5=0x000E +phy_xaui_rx_polarity_flip_5=0x0000 + +#WC2 +phy_xaui_tx_polarity_flip_9=0x0000 +phy_xaui_rx_polarity_flip_9=0x0001 +phy_xaui_tx_polarity_flip_10=0x0001 +phy_xaui_rx_polarity_flip_10=0x0000 + + +#WC3 +phy_xaui_tx_polarity_flip_13=0x0003 +phy_xaui_rx_polarity_flip_13=0x0000 +phy_xaui_tx_polarity_flip_14=0x0003 +phy_xaui_rx_polarity_flip_14=0x0000 + +#WC4 +phy_xaui_tx_polarity_flip_17=0x0002 +phy_xaui_rx_polarity_flip_17=0x0000 +phy_xaui_tx_polarity_flip_18=0x0003 +phy_xaui_rx_polarity_flip_18=0x0000 + + +#WC5 +phy_xaui_tx_polarity_flip_21=0x0000 +phy_xaui_rx_polarity_flip_21=0x0000 +phy_xaui_tx_polarity_flip_22=0x0000 +phy_xaui_rx_polarity_flip_22=0x0000 + + +#WC6 +phy_xaui_tx_polarity_flip_25=0x0000 +phy_xaui_rx_polarity_flip_25=0x0002 +phy_xaui_tx_polarity_flip_26=0x0001 +phy_xaui_rx_polarity_flip_26=0x0002 + + +#WC7 +phy_xaui_tx_polarity_flip_29=0x0000 +phy_xaui_rx_polarity_flip_29=0x0000 +phy_xaui_tx_polarity_flip_30=0x0001 +phy_xaui_rx_polarity_flip_30=0x0000 + + +#WC28 +phy_xaui_tx_polarity_flip_118=0x0003 +phy_xaui_rx_polarity_flip_118=0x0003 +phy_xaui_tx_polarity_flip_119=0x0003 +phy_xaui_rx_polarity_flip_119=0x0003 + + +#WC29 +phy_xaui_tx_polarity_flip_122=0x0002 +phy_xaui_rx_polarity_flip_122=0x0000 +phy_xaui_tx_polarity_flip_123=0x0000 +phy_xaui_rx_polarity_flip_123=0x0000 + + +#WC30 +phy_xaui_tx_polarity_flip_126=0x0003 +phy_xaui_rx_polarity_flip_126=0x0000 +phy_xaui_tx_polarity_flip_127=0x0003 +phy_xaui_rx_polarity_flip_127=0x0000 + + +#WC31 +phy_xaui_tx_polarity_flip_130=0x0002 +phy_xaui_rx_polarity_flip_130=0x0000 +phy_xaui_tx_polarity_flip_131=0x0001 +phy_xaui_rx_polarity_flip_131=0x0000 + +#xe +serdes_driver_current=0x0a +serdes_preemphasis=0x1a5402 + +#ce0 +serdes_driver_current_lane0_58=0x0a +serdes_driver_current_lane1_58=0x09 +serdes_driver_current_lane2_58=0x09 +serdes_driver_current_lane3_58=0x0a +serdes_preemphasis_lane0_58=0x254902 +serdes_preemphasis_lane1_58=0x244a02 +serdes_preemphasis_lane2_58=0x244a02 +serdes_preemphasis_lane3_58=0x254902 + +#ce1 +serdes_driver_current_lane0_62=0x09 +serdes_driver_current_lane1_62=0x0a +serdes_driver_current_lane2_62=0x09 +serdes_driver_current_lane3_62=0x09 +serdes_preemphasis_lane0_62=0x244a02 +serdes_preemphasis_lane1_62=0x254902 +serdes_preemphasis_lane2_62=0x244a02 +serdes_preemphasis_lane3_62=0x244a02 + +#ce2 +serdes_driver_current_lane0_84=0x09 +serdes_driver_current_lane1_84=0x09 +serdes_driver_current_lane2_84=0x09 +serdes_driver_current_lane3_84=0x09 +serdes_preemphasis_lane0_84=0x204e02 +serdes_preemphasis_lane1_84=0x204e02 +serdes_preemphasis_lane2_84=0x204e02 +serdes_preemphasis_lane3_84=0x204e02 + +#ce3 +serdes_driver_current_lane0_88=0x09 +serdes_driver_current_lane1_88=0x08 +serdes_driver_current_lane2_88=0x08 +serdes_driver_current_lane3_88=0x09 +serdes_preemphasis_lane0_88=0x204e02 +serdes_preemphasis_lane1_88=0x1d5102 +serdes_preemphasis_lane2_88=0x1d5102 +serdes_preemphasis_lane3_88=0x204e02 + +#ce4 +serdes_driver_current_lane0_110=0x09 +serdes_driver_current_lane1_110=0x08 +serdes_driver_current_lane2_110=0x08 +serdes_driver_current_lane3_110=0x09 +serdes_preemphasis_lane0_110=0x204e02 +serdes_preemphasis_lane1_110=0x1d5102 +serdes_preemphasis_lane2_110=0x1d5102 +serdes_preemphasis_lane3_110=0x204e02 + +#ce5 +serdes_driver_current_lane0_114=0x09 +serdes_driver_current_lane1_114=0x08 +serdes_driver_current_lane2_114=0x09 +serdes_driver_current_lane3_114=0x09 +serdes_preemphasis_lane0_114=0x204e02 +serdes_preemphasis_lane1_114=0x1d5102 +serdes_preemphasis_lane2_114=0x224c02 +serdes_preemphasis_lane3_114=0x224c02 + +#ce6 +serdes_driver_current_lane0_1=0x09 +serdes_driver_current_lane1_1=0x0a +serdes_driver_current_lane2_1=0x09 +serdes_driver_current_lane3_1=0x0a +serdes_preemphasis_lane0_1=0x244a02 +serdes_preemphasis_lane1_1=0x254902 +serdes_preemphasis_lane2_1=0x244a02 +serdes_preemphasis_lane3_1=0x254902 + +#ce7 +serdes_driver_current_lane0_5=0x09 +serdes_driver_current_lane1_5=0x09 +serdes_driver_current_lane2_5=0x09 +serdes_driver_current_lane3_5=0x0a +serdes_preemphasis_lane0_5=0x244a02 +serdes_preemphasis_lane1_5=0x244a02 +serdes_preemphasis_lane2_5=0x244a02 +serdes_preemphasis_lane3_5=0x254902 + +phy_an_lt_msft=1 diff --git a/device/celestica/x86_64-cel_seastone-r0/fancontrol-B2F b/device/celestica/x86_64-cel_seastone-r0/fancontrol-B2F index 61b1c386f3d8..f3277db14df2 100644 --- a/device/celestica/x86_64-cel_seastone-r0/fancontrol-B2F +++ b/device/celestica/x86_64-cel_seastone-r0/fancontrol-B2F @@ -9,5 +9,4 @@ MINSTOP=13-002e/pwm1=89 13-002e/pwm2=89 13-002e/pwm3=89 13-002e/pwm4=89 13-002e/ MINPWM=13-002e/pwm1=89 13-002e/pwm2=89 13-002e/pwm3=89 13-002e/pwm4=89 13-002e/pwm5=89 13-004d/pwm1=89 13-004d/pwm2=89 13-004d/pwm3=89 13-004d/pwm4=89 13-004d/pwm5=89 MAXPWM=13-002e/pwm1=255 13-002e/pwm2=255 13-002e/pwm3=255 13-002e/pwm4=255 13-002e/pwm5=255 13-004d/pwm1=255 13-004d/pwm2=255 13-004d/pwm3=255 13-004d/pwm4=255 13-004d/pwm5=255 THYST=13-002e/pwm1=3 13-002e/pwm2=3 13-002e/pwm3=3 13-002e/pwm4=3 13-002e/pwm5=3 13-004d/pwm1=3 13-004d/pwm2=3 13-004d/pwm3=3 13-004d/pwm4=3 13-004d/pwm5=3 -MAXTEMPCRIT=/sys/bus/i2c/devices/7-004a/hwmon/hwmon*/temp1_input=65 /sys/bus/i2c/devices/14-0048/hwmon/hwmon*/temp1_input=75 -MAXTEMPTYPE=/sys/bus/i2c/devices/7-004a/hwmon/hwmon*/temp1_input=ASIC /sys/bus/i2c/devices/14-0048/hwmon/hwmon*/temp1_input=CPU + diff --git a/device/celestica/x86_64-cel_seastone-r0/fancontrol-F2B b/device/celestica/x86_64-cel_seastone-r0/fancontrol-F2B index b851d0a6d6ca..dc67e2623cc2 100644 --- a/device/celestica/x86_64-cel_seastone-r0/fancontrol-F2B +++ b/device/celestica/x86_64-cel_seastone-r0/fancontrol-F2B @@ -9,5 +9,4 @@ MINSTOP=13-002e/pwm1=89 13-002e/pwm2=89 13-002e/pwm3=89 13-002e/pwm4=89 13-002e/ MINPWM=13-002e/pwm1=89 13-002e/pwm2=89 13-002e/pwm3=89 13-002e/pwm4=89 13-002e/pwm5=89 13-004d/pwm1=89 13-004d/pwm2=89 13-004d/pwm3=89 13-004d/pwm4=89 13-004d/pwm5=89 MAXPWM=13-002e/pwm1=255 13-002e/pwm2=255 13-002e/pwm3=255 13-002e/pwm4=255 13-002e/pwm5=255 13-004d/pwm1=255 13-004d/pwm2=255 13-004d/pwm3=255 13-004d/pwm4=255 13-004d/pwm5=255 THYST=13-002e/pwm1=3 13-002e/pwm2=3 13-002e/pwm3=3 13-002e/pwm4=3 13-002e/pwm5=3 13-004d/pwm1=3 13-004d/pwm2=3 13-004d/pwm3=3 13-004d/pwm4=3 13-004d/pwm5=3 -MAXTEMPCRIT=/sys/bus/i2c/devices/7-004a/hwmon/hwmon*/temp1_input=75 /sys/bus/i2c/devices/14-0048/hwmon/hwmon*/temp1_input=75 -MAXTEMPTYPE=/sys/bus/i2c/devices/7-004a/hwmon/hwmon*/temp1_input=ASIC /sys/bus/i2c/devices/14-0048/hwmon/hwmon*/temp1_input=CPU + diff --git a/device/celestica/x86_64-cel_seastone-r0/plugins/pcie.yaml b/device/celestica/x86_64-cel_seastone-r0/pcie.yaml similarity index 100% rename from device/celestica/x86_64-cel_seastone-r0/plugins/pcie.yaml rename to device/celestica/x86_64-cel_seastone-r0/pcie.yaml diff --git a/device/celestica/x86_64-cel_seastone-r0/platform.json b/device/celestica/x86_64-cel_seastone-r0/platform.json index 66ed83ef2060..b1161e22d6fd 100644 --- a/device/celestica/x86_64-cel_seastone-r0/platform.json +++ b/device/celestica/x86_64-cel_seastone-r0/platform.json @@ -1,4 +1,423 @@ { + "chassis": { + "name": "DX010", + "status_led": { + "controllable": true, + "colors": ["green", "off"] + }, + "components": [ + { + "name": "CPLD1" + }, + { + "name": "CPLD2" + }, + { + "name": "CPLD3" + }, + { + "name": "CPLD4" + }, + { + "name": "CPLD5" + }, + { + "name": "BIOS" + } + ], + "fans": [ + { + "name": "FAN-1F", + "status_led": { + "controllable": false + }, + "speed": { + "controllable": false + } + }, + { + "name": "FAN-1R", + "status_led": { + "controllable": false + }, + "speed": { + "controllable": false + } + }, + { + "name": "FAN-2F", + "status_led": { + "controllable": false + }, + "speed": { + "controllable": false + } + }, + { + "name": "FAN-2R", + "status_led": { + "controllable": false + }, + "speed": { + "controllable": false + } + }, + { + "name": "FAN-3F", + "status_led": { + "controllable": false + }, + "speed": { + "controllable": false + } + }, + { + "name": "FAN-3R", + "status_led": { + "controllable": false + }, + "speed": { + "controllable": false + } + }, + { + "name": "FAN-4F", + "status_led": { + "controllable": false + }, + "speed": { + "controllable": false + } + }, + { + "name": "FAN-4R", + "status_led": { + "controllable": false + }, + "speed": { + "controllable": false + } + }, + { + "name": "FAN-5F", + "status_led": { + "controllable": false + }, + "speed": { + "controllable": false + } + }, + { + "name": "FAN-5R", + "status_led": { + "controllable": false + }, + "speed": { + "controllable": false + } + } + ], + "fan_drawers": [ + { + "name": "Drawer1", + "status_led": { + "controllable": true, + "colors": ["red", "green", "amber", "off"] + }, + "fans": [ + { + "name": "FAN-1F", + "status_led": { + "controllable": false + }, + "speed": { + "controllable": false + } + }, + { + "name": "FAN-1R", + "status_led": { + "controllable": false + }, + "speed": { + "controllable": false + } + } + ] + }, + { + "name": "Drawer2", + "status_led": { + "controllable": true, + "colors": ["red", "green", "amber", "off"] + }, + "fans": [ + { + "name": "FAN-2F", + "status_led": { + "controllable": false + }, + "speed": { + "controllable": false + } + }, + { + "name": "FAN-2R", + "status_led": { + "controllable": false + }, + "speed": { + "controllable": false + } + } + ] + }, + { + "name": "Drawer3", + "status_led": { + "controllable": true, + "colors": ["red", "green", "amber", "off"] + }, + "fans": [ + { + "name": "FAN-3F", + "status_led": { + "controllable": false + }, + "speed": { + "controllable": false + } + }, + { + "name": "FAN-3R", + "status_led": { + "controllable": false + }, + "speed": { + "controllable": false + } + } + ] + }, + { + "name": "Drawer4", + "status_led": { + "controllable": true, + "colors": ["red", "green", "amber", "off"] + }, + "fans": [ + { + "name": "FAN-4F", + "status_led": { + "controllable": false + }, + "speed": { + "controllable": false + } + }, + { + "name": "FAN-4R", + "status_led": { + "controllable": false + }, + "speed": { + "controllable": false + } + } + ] + }, + { + "name": "Drawer5", + "status_led": { + "controllable": true, + "colors": ["red", "green", "amber", "off"] + }, + "fans": [ + { + "name": "FAN-5F", + "status_led": { + "controllable": false + }, + "speed": { + "controllable": false + } + }, + { + "name": "FAN-5R", + "status_led": { + "controllable": false + }, + "speed": { + "controllable": false + } + } + ] + } + ], + "psus": [ + { + "name": "PSU-1", + "status_led": { + "controllable": true, + "colors": ["green", "off"] + }, + "fans": [ + { + "name": "PSU-1 FAN-1", + "speed": { + "controllable": false + }, + "status_led": { + "available": false + } + } + ] + }, + { + "name": "PSU-2", + "status_led": { + "controllable": true, + "colors": ["green", "off"] + }, + "fans": [ + { + "name": "PSU-2 FAN-1", + "speed": { + "controllable": false + }, + "status_led": { + "available": false + } + } + ] + } + ], + "thermals": [ + { + "name": "Front-panel temp sensor 1", + "controllable": false, + "low-crit-threshold": false + }, + { + "name": "Front-panel temp sensor 2", + "controllable": false, + "low-crit-threshold": false + }, + { + "name": "ASIC temp sensor", + "controllable": false, + "low-crit-threshold": false + }, + { + "name": "Rear-panel temp sensor 1", + "controllable": false, + "low-crit-threshold": false + }, + { + "name": "Rear-panel temp sensor 2", + "controllable": false, + "low-crit-threshold": false + } + ], + "sfps": [ + { + "name": "Ethernet124" + }, + { + "name": "Ethernet0" + }, + { + "name": "Ethernet4" + }, + { + "name": "Ethernet8" + }, + { + "name": "Ethernet12" + }, + { + "name": "Ethernet16" + }, + { + "name": "Ethernet20" + }, + { + "name": "Ethernet24" + }, + { + "name": "Ethernet28" + }, + { + "name": "Ethernet32" + }, + { + "name": "Ethernet36" + }, + { + "name": "Ethernet40" + }, + { + "name": "Ethernet44" + }, + { + "name": "Ethernet48" + }, + { + "name": "Ethernet52" + }, + { + "name": "Ethernet56" + }, + { + "name": "Ethernet60" + }, + { + "name": "Ethernet64" + }, + { + "name": "Ethernet68" + }, + { + "name": "Ethernet72" + }, + { + "name": "Ethernet76" + }, + { + "name": "Ethernet80" + }, + { + "name": "Ethernet84" + }, + { + "name": "Ethernet88" + }, + { + "name": "Ethernet92" + }, + { + "name": "Ethernet96" + }, + { + "name": "Ethernet100" + }, + { + "name": "Ethernet104" + }, + { + "name": "Ethernet108" + }, + { + "name": "Ethernet112" + }, + { + "name": "Ethernet116" + }, + { + "name": "Ethernet120" + } + ] + }, "interfaces": { "Ethernet0": { "index": "1,1,1,1", diff --git a/device/celestica/x86_64-cel_seastone-r0/platform_components.json b/device/celestica/x86_64-cel_seastone-r0/platform_components.json new file mode 100644 index 000000000000..1574e1bd2c38 --- /dev/null +++ b/device/celestica/x86_64-cel_seastone-r0/platform_components.json @@ -0,0 +1,14 @@ +{ + "chassis": { + "DX010": { + "component": { + "CPLD1": {}, + "CPLD2": {}, + "CPLD3": {}, + "CPLD4": {}, + "CPLD5": {}, + "BIOS": {} + } + } + } +} diff --git a/device/celestica/x86_64-cel_seastone-r0/sonic_platform/chassis.py b/device/celestica/x86_64-cel_seastone-r0/sonic_platform/chassis.py index 49c79263815d..51da9c2353fb 100644 --- a/device/celestica/x86_64-cel_seastone-r0/sonic_platform/chassis.py +++ b/device/celestica/x86_64-cel_seastone-r0/sonic_platform/chassis.py @@ -17,17 +17,17 @@ raise ImportError(str(e) + "- required module not found") NUM_FAN_TRAY = 5 -NUM_FAN = 2 NUM_PSU = 2 NUM_THERMAL = 5 NUM_SFP = 32 -NUM_COMPONENT = 5 +NUM_COMPONENT = 6 RESET_REGISTER = "0x103" HOST_REBOOT_CAUSE_PATH = "/host/reboot-cause/" REBOOT_CAUSE_FILE = "reboot-cause.txt" PREV_REBOOT_CAUSE_FILE = "previous-reboot-cause.txt" GETREG_PATH = "/sys/devices/platform/dx010_cpld/getreg" HOST_CHK_CMD = "docker > /dev/null 2>&1" +STATUS_LED_PATH = "/sys/devices/platform/leds_dx010/leds/dx010:green:stat/brightness" class Chassis(ChassisBase): @@ -40,12 +40,11 @@ def __init__(self): self.__initialize_eeprom() self.is_host = self._api_helper.is_host() - if not self.is_host: - self.__initialize_fan() - self.__initialize_psu() - self.__initialize_thermals() - else: - self.__initialize_components() + self.__initialize_fan() + self.__initialize_psu() + self.__initialize_thermals() + self.__initialize_components() + self.__initialize_system_led() def __initialize_sfp(self): sfputil_helper = SfpUtilHelper() @@ -54,8 +53,7 @@ def __initialize_sfp(self): from sonic_platform.sfp import Sfp for index in range(0, NUM_SFP): - name_idx = 0 if index+1 == NUM_SFP else index+1 - sfp = Sfp(index, sfputil_helper.logical[name_idx]) + sfp = Sfp(index, sfputil_helper.logical[index]) self._sfp_list.append(sfp) self.sfp_module_initialized = True @@ -66,16 +64,17 @@ def __initialize_psu(self): self._psu_list.append(psu) def __initialize_fan(self): - from sonic_platform.fan import Fan - for fant_index in range(0, NUM_FAN_TRAY): - for fan_index in range(0, NUM_FAN): - fan = Fan(fant_index, fan_index) - self._fan_list.append(fan) + from sonic_platform.fan_drawer import FanDrawer + for i in range(NUM_FAN_TRAY): + fandrawer = FanDrawer(i) + self._fan_drawer_list.append(fandrawer) + self._fan_list.extend(fandrawer._fan_list) def __initialize_thermals(self): from sonic_platform.thermal import Thermal + airflow = self.__get_air_flow() for index in range(0, NUM_THERMAL): - thermal = Thermal(index) + thermal = Thermal(index, airflow) self._thermal_list.append(thermal) def __initialize_eeprom(self): @@ -88,6 +87,16 @@ def __initialize_components(self): component = Component(index) self._component_list.append(component) + def __initialize_system_led(self): + self.set_status_led(self.STATUS_LED_COLOR_GREEN) + + def __get_air_flow(self): + air_flow_path = '/usr/share/sonic/device/{}/fan_airflow'.format( + self._api_helper.platform) \ + if self.is_host else '/usr/share/sonic/platform/fan_airflow' + air_flow = self._api_helper.read_one_line_file(air_flow_path) + return air_flow or 'B2F' + def get_base_mac(self): """ Retrieves the base MAC address for the chassis @@ -149,7 +158,6 @@ def get_reboot_cause(self): return prev_reboot_cause - def get_change_event(self, timeout=0): """ Returns a nested dictionary containing all devices which have @@ -225,7 +233,7 @@ def get_sfp(self, index): try: # The index will start from 1 - sfp = self._sfp_list[index-1] + sfp = self._sfp_list[index - 1] except IndexError: sys.stderr.write("SFP index {} out of range (1-{})\n".format( index, len(self._sfp_list))) @@ -248,6 +256,10 @@ def get_watchdog(self): return self._watchdog + def get_thermal_manager(self): + from .thermal_manager import ThermalManager + return ThermalManager + ############################################################## ###################### Device methods ######################## ############################################################## @@ -258,7 +270,7 @@ def get_name(self): Returns: string: The name of the device """ - return self._api_helper.hwsku + return self._eeprom.get_product_name() def get_presence(self): """ @@ -291,3 +303,62 @@ def get_status(self): A boolean value, True if device is operating properly, False if not """ return True + + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device. If the agent cannot determine the parent-relative position + for some reason, or if the associated value of entPhysicalContainedIn is '0', then the value '-1' is returned + Returns: + integer: The 1-based relative physical position in parent device or -1 if cannot determine the position + """ + return -1 + + def is_replaceable(self): + """ + Indicate whether this device is replaceable. + Returns: + bool: True if it is replaceable. + """ + return False + + def initizalize_system_led(self): + """ + This function is not defined in chassis base class, + system-health command would invoke chassis.initizalize_system_led(), + add this stub function just to let the command sucessfully execute + """ + pass + + def set_status_led(self, color): + """ + Sets the state of the PSU status LED + Args: + color: A string representing the color with which to set the PSU status LED + Note: Only support green and off + Returns: + bool: True if status LED state is set successfully, False if not + """ + + set_status_str = { + self.STATUS_LED_COLOR_GREEN: '1', + self.STATUS_LED_COLOR_OFF: '0' + }.get(color, None) + + if not set_status_str: + return False + + return self._api_helper.write_txt_file(STATUS_LED_PATH, set_status_str) + + def get_status_led(self): + """ + Gets the state of the PSU status LED + Returns: + A string, one of the predefined STATUS_LED_COLOR_* strings above + """ + status = self._api_helper.read_txt_file(STATUS_LED_PATH) + status_str = { + '1': self.STATUS_LED_COLOR_GREEN, + '0': self.STATUS_LED_COLOR_OFF + }.get(status, None) + + return status_str diff --git a/device/celestica/x86_64-cel_seastone-r0/sonic_platform/component.py b/device/celestica/x86_64-cel_seastone-r0/sonic_platform/component.py index 2833bf4d1cc5..5b71c0a38a11 100644 --- a/device/celestica/x86_64-cel_seastone-r0/sonic_platform/component.py +++ b/device/celestica/x86_64-cel_seastone-r0/sonic_platform/component.py @@ -25,9 +25,11 @@ } GETREG_PATH = "/sys/devices/platform/dx010_cpld/getreg" BIOS_VERSION_PATH = "/sys/class/dmi/id/bios_version" -COMPONENT_NAME_LIST = ["CPLD1", "CPLD2", "CPLD3", "CPLD4", "BIOS"] +COMPONENT_NAME_LIST = ["CPLD1", "CPLD2", "CPLD3", "CPLD4", "CPLD5", "BIOS"] COMPONENT_DES_LIST = ["Used for managing the CPU", - "Used for managing QSFP+ ports (1-10)", "Used for managing QSFP+ ports (11-20)", "Used for managing QSFP+ ports (22-32)", "Basic Input/Output System"] + "Used for managing QSFP+ ports (1-10)", "Used for managing QSFP+ ports (11-21)", + "Used for misc status and control", "Used for managing QSFP+ ports (22-32)", + "Basic Input/Output System"] class Component(ComponentBase): @@ -52,7 +54,7 @@ def __get_bios_version(self): def get_register_value(self, register): # Retrieves the cpld register value - cmd = "echo {1} > {0}; cat {0}".format(GETREG_PATH, register) + cmd = "flock {0} -c 'echo {1} > {0}; cat {0}'".format(GETREG_PATH, register) p = subprocess.Popen( cmd, shell=True, universal_newlines=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) raw_data, err = p.communicate() @@ -106,6 +108,29 @@ def get_firmware_version(self): return fw_version + def get_available_firmware_version(self, image_path): + """ + Retrieves the available firmware version of the component + Note: the firmware version will be read from image + Args: + image_path: A string, path to firmware image + Returns: + A string containing the available firmware version of the component + """ + return "N/A" + + def get_firmware_update_notification(self, image_path): + """ + Retrieves a notification on what should be done in order to complete + the component firmware update + Args: + image_path: A string, path to firmware image + Returns: + A string containing the component firmware update notification if required. + By default 'None' value will be used, which indicates that no actions are required + """ + return "None" + def install_firmware(self, image_path): """ Install firmware to module @@ -128,3 +153,75 @@ def install_firmware(self, image_path): # install_command = "afulnx_64 %s /p /b /n /x /r" % image_path return self.__run_command(install_command) + + + def update_firmware(self, image_path): + """ + Updates firmware of the component + This API performs firmware update: it assumes firmware installation and loading in a single call. + In case platform component requires some extra steps (apart from calling Low Level Utility) + to load the installed firmware (e.g, reboot, power cycle, etc.) - this will be done automatically by API + Args: + image_path: A string, path to firmware image + Raises: + RuntimeError: update failed + """ + return False + + + ############################################################## + ###################### Device methods ######################## + ############################################################## + + + def get_presence(self): + """ + Retrieves the presence of the FAN + Returns: + bool: True if FAN is present, False if not + """ + return True + + def get_model(self): + """ + Retrieves the model number (or part number) of the device + Returns: + string: Model/part number of device + """ + return 'N/A' + + def get_serial(self): + """ + Retrieves the serial number of the device + Returns: + string: Serial number of device + """ + return 'N/A' + + def get_status(self): + """ + Retrieves the operational status of the device + Returns: + A boolean value, True if device is operating properly, False if not + """ + return True + + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device. + If the agent cannot determine the parent-relative position + for some reason, or if the associated value of + entPhysicalContainedIn is'0', then the value '-1' is returned + Returns: + integer: The 1-based relative physical position in parent device + or -1 if cannot determine the position + """ + return -1 + + def is_replaceable(self): + """ + Indicate whether this device is replaceable. + Returns: + bool: True if it is replaceable. + """ + return False diff --git a/device/celestica/x86_64-cel_seastone-r0/sonic_platform/eeprom.py b/device/celestica/x86_64-cel_seastone-r0/sonic_platform/eeprom.py index b2b4a8122590..9652ae8c3b75 100644 --- a/device/celestica/x86_64-cel_seastone-r0/sonic_platform/eeprom.py +++ b/device/celestica/x86_64-cel_seastone-r0/sonic_platform/eeprom.py @@ -8,24 +8,22 @@ ############################################################################# try: - import glob import os import sys import re - from array import array if sys.version_info.major == 3: from io import StringIO else: from cStringIO import StringIO - from sonic_platform_base.sonic_eeprom import eeprom_dts from sonic_platform_base.sonic_eeprom import eeprom_tlvinfo except ImportError as e: raise ImportError(str(e) + "- required module not found") CACHE_ROOT = '/var/cache/sonic/decode-syseeprom' CACHE_FILE = 'syseeprom_cache' +NULL = 'N/A' class Tlv(eeprom_tlvinfo.TlvInfoDecoder): @@ -46,13 +44,13 @@ def __parse_output(self, decode_output): for line in lines: try: match = re.search( - '(0x[0-9a-fA-F]{2})([\s]+[\S]+[\s]+)([\S]+)', line) + '(0x[0-9a-fA-F]{2})([\s]+[\S]+[\s]+)(.*$)', line) if match is not None: idx = match.group(1) value = match.group(3).rstrip('\0') _eeprom_info_dict[idx] = value - except: + except BaseException: pass return _eeprom_info_dict @@ -61,7 +59,7 @@ def _load_eeprom(self): sys.stdout = StringIO() try: self.read_eeprom_db() - except: + except BaseException: decode_output = sys.stdout.getvalue() sys.stdout = original_stdout return self.__parse_output(decode_output) @@ -73,7 +71,7 @@ def _load_eeprom(self): if not os.path.exists(CACHE_ROOT): try: os.makedirs(CACHE_ROOT) - except: + except BaseException: pass # @@ -82,7 +80,7 @@ def _load_eeprom(self): # try: self.set_cache_name(os.path.join(CACHE_ROOT, CACHE_FILE)) - except: + except BaseException: pass e = self.read_eeprom() @@ -91,7 +89,7 @@ def _load_eeprom(self): try: self.update_cache(e) - except: + except BaseException: pass self.decode_eeprom(e) @@ -104,11 +102,43 @@ def _load_eeprom(self): return self.__parse_output(decode_output) + def _valid_tlv(self, eeprom_data): + tlvinfo_type_codes_list = [ + self._TLV_CODE_PRODUCT_NAME, + self._TLV_CODE_PART_NUMBER, + self._TLV_CODE_SERIAL_NUMBER, + self._TLV_CODE_MAC_BASE, + self._TLV_CODE_MANUF_DATE, + self._TLV_CODE_DEVICE_VERSION, + self._TLV_CODE_LABEL_REVISION, + self._TLV_CODE_PLATFORM_NAME, + self._TLV_CODE_ONIE_VERSION, + self._TLV_CODE_MAC_SIZE, + self._TLV_CODE_MANUF_NAME, + self._TLV_CODE_MANUF_COUNTRY, + self._TLV_CODE_VENDOR_NAME, + self._TLV_CODE_DIAG_VERSION, + self._TLV_CODE_SERVICE_TAG, + self._TLV_CODE_VENDOR_EXT, + self._TLV_CODE_CRC_32 + ] + + for code in tlvinfo_type_codes_list: + code_str = "0x{:X}".format(code) + eeprom_data[code_str] = eeprom_data.get(code_str, NULL) + return eeprom_data + def get_eeprom(self): - return self._eeprom + return self._valid_tlv(self._eeprom) + + def get_product_name(self): + return self._eeprom.get('0x21', NULL) + + def get_pn(self): + return self._eeprom.get('0x22', NULL) def get_serial(self): - return self._eeprom.get('0x23', "Undefined.") + return self._eeprom.get('0x23', NULL) def get_mac(self): - return self._eeprom.get('0x24', "Undefined.") + return self._eeprom.get('0x24', NULL) diff --git a/device/celestica/x86_64-cel_seastone-r0/sonic_platform/fan.py b/device/celestica/x86_64-cel_seastone-r0/sonic_platform/fan.py index 10875ee30753..586efbfbb1f5 100644 --- a/device/celestica/x86_64-cel_seastone-r0/sonic_platform/fan.py +++ b/device/celestica/x86_64-cel_seastone-r0/sonic_platform/fan.py @@ -6,7 +6,7 @@ # ############################################################################# -import json +from __future__ import division import math import os.path @@ -25,6 +25,7 @@ EMC2305_FAN_INPUT = "pwm{}" FAN_NAME_LIST = ["FAN-1F", "FAN-1R", "FAN-2F", "FAN-2R", "FAN-3F", "FAN-3R", "FAN-4F", "FAN-4R", "FAN-5F", "FAN-5R"] +FAN_SPEED_TOLERANCE = 10 PSU_FAN_MAX_RPM = 11000 PSU_HWMON_PATH = "/sys/bus/i2c/devices/i2c-{0}/{0}-00{1}/hwmon" PSU_I2C_MAPPING = { @@ -82,7 +83,7 @@ def __write_txt_file(self, file_path, value): try: with open(file_path, 'w') as fd: fd.write(str(value)) - except: + except Exception: return False return True @@ -97,7 +98,8 @@ def __search_file_by_name(self, directory, file_name): def __get_gpio_base(self): for r in os.listdir(GPIO_DIR): label_path = os.path.join(GPIO_DIR, r, "label") - if "gpiochip" in r and GPIO_LABEL in self._api_helper.read_txt_file(label_path): + if "gpiochip" in r and GPIO_LABEL in \ + self._api_helper.read_txt_file(label_path): return int(r[8:], 10) return 216 # Reserve @@ -148,7 +150,6 @@ def get_speed(self): self.psu_hwmon_path, fan_speed_sysfs_name) fan_speed_rpm = self._api_helper.read_txt_file( fan_speed_sysfs_path) or 0 - fan_speed_raw = float(fan_speed_rpm)/PSU_FAN_MAX_RPM * 100 speed = math.ceil(float(fan_speed_rpm) * 100 / PSU_FAN_MAX_RPM) elif self.get_presence(): chip = self.emc2305_chip_mapping[self.fan_index] @@ -176,7 +177,19 @@ def get_target_speed(self): 0 : when PWM mode is use pwm : when pwm mode is not use """ - return 'N/A' + target = NULL_VAL + + if not self.is_psu_fan: + chip = self.emc2305_chip_mapping[self.fan_index] + device = chip['device'] + fan_index = chip['index_map'] + sysfs_path = "%s%s/%s" % ( + EMC2305_PATH, device, EMC2305_FAN_PWM) + sysfs_path = sysfs_path.format(fan_index[self.fan_tray_index]) + pwm = self._api_helper.read_txt_file(sysfs_path) + target = round(int(pwm) / 255 * 100.0) + + return target def get_speed_tolerance(self): """ @@ -185,7 +198,7 @@ def get_speed_tolerance(self): An integer, the percentage of variance from target speed which is considered tolerable """ - return 10 + return FAN_SPEED_TOLERANCE def set_speed(self, speed): """ @@ -225,41 +238,67 @@ def set_status_led(self, color): bool: True if status LED state is set successfully, False if not """ set_status_led = False + + s1_gpio = self.dx010_fan_gpio[self.fan_tray_index+1]['color']['red'] + s2_gpio = self.dx010_fan_gpio[self.fan_tray_index+1]['color']['green'] + if not self.is_psu_fan: - s1, s2 = False, False try: if color == self.STATUS_LED_COLOR_GREEN: - s1 = self.__set_gpio_value( - self.dx010_fan_gpio[self.fan_tray_index+1]['color']['red'], 1) - s2 = self.__set_gpio_value( - self.dx010_fan_gpio[self.fan_tray_index+1]['color']['green'], 0) + s1 = self.__set_gpio_value(s1_gpio, 1) + s2 = self.__set_gpio_value(s2_gpio, 0) elif color == self.STATUS_LED_COLOR_RED: - s1 = self.__set_gpio_value( - self.dx010_fan_gpio[self.fan_tray_index+1]['color']['red'], 0) - s2 = self.__set_gpio_value( - self.dx010_fan_gpio[self.fan_tray_index+1]['color']['green'], 1) + s1 = self.__set_gpio_value(s1_gpio, 0) + s2 = self.__set_gpio_value(s2_gpio, 1) elif color == self.STATUS_LED_COLOR_OFF: - s1 = self.__set_gpio_value( - self.dx010_fan_gpio[self.fan_tray_index+1]['color']['red'], 1) - s2 = self.__set_gpio_value( - self.dx010_fan_gpio[self.fan_tray_index+1]['color']['green'], 1) + s1 = self.__set_gpio_value(s1_gpio, 1) + s2 = self.__set_gpio_value(s2_gpio, 1) + + elif color == self.STATUS_LED_COLOR_AMBER: + s1 = self.__set_gpio_value(s1_gpio, 0) + s2 = self.__set_gpio_value(s2_gpio, 0) + else: + s1, s2 = True, True + set_status_led = s1 and s2 - return set_status_led + except IOError: return False return set_status_led + def get_status_led(self): + """ + Gets the state of the fan status LED + Returns: + A string, one of the predefined STATUS_LED_COLOR_* strings above + """ + s1 = self.__get_gpio_value( + self.dx010_fan_gpio[self.fan_tray_index+1]['color']['red']) + s2 = self.__get_gpio_value( + self.dx010_fan_gpio[self.fan_tray_index+1]['color']['green']) + + return { + '10': self.STATUS_LED_COLOR_GREEN, + '01': self.STATUS_LED_COLOR_RED, + '00': self.STATUS_LED_COLOR_AMBER + }.get(s1+s2, self.STATUS_LED_COLOR_OFF) + + ############################################################## + ###################### Device methods ######################## + ############################################################## + def get_name(self): """ Retrieves the name of the device Returns: string: The name of the device """ - fan_name = FAN_NAME_LIST[self.fan_tray_index*2 + self.fan_index] if not self.is_psu_fan else "PSU-{} FAN-{}".format( - self.psu_index+1, self.fan_index+1) + fan_name = FAN_NAME_LIST[self.fan_tray_index*2 + self.fan_index] \ + if not self.is_psu_fan \ + else "PSU-{} FAN-{}".format(self.psu_index+1, self.fan_index+1) return fan_name @@ -304,4 +343,41 @@ def get_status(self): Returns: A boolean value, True if device is operating properly, False if not """ - return self.get_presence() and self.get_speed() > 0 + status = 1 + if self.is_psu_fan: + fan_fault_sysfs_name = "fan1_fault" + fan_fault_sysfs_path = self.__search_file_by_name( + self.psu_hwmon_path, fan_fault_sysfs_name) + status = self._api_helper.read_one_line_file(fan_fault_sysfs_path) + + elif self.get_presence(): + chip = self.emc2305_chip_mapping[self.fan_index] + device = chip['device'] + fan_index = chip['index_map'] + sysfs_path = "%s%s/%s" % ( + EMC2305_PATH, device, 'fan{}_fault') + sysfs_path = sysfs_path.format(fan_index[self.fan_tray_index]) + status = self._api_helper.read_one_line_file(sysfs_path) + + return False if int(status) != 0 else True + + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device. + If the agent cannot determine the parent-relative position + for some reason, or if the associated value of + entPhysicalContainedIn is'0', then the value '-1' is returned + Returns: + integer: The 1-based relative physical position in parent device + or -1 if cannot determine the position + """ + return (self.fan_tray_index*2 + self.fan_index + 1) \ + if not self.is_psu_fan else (self.fan_index+1) + + def is_replaceable(self): + """ + Indicate whether this device is replaceable. + Returns: + bool: True if it is replaceable. + """ + return True if not self.is_psu_fan else False diff --git a/device/celestica/x86_64-cel_seastone-r0/sonic_platform/fan_drawer.py b/device/celestica/x86_64-cel_seastone-r0/sonic_platform/fan_drawer.py new file mode 100644 index 000000000000..0fa37fba86ce --- /dev/null +++ b/device/celestica/x86_64-cel_seastone-r0/sonic_platform/fan_drawer.py @@ -0,0 +1,118 @@ +#!/usr/bin/env python + +############################################################################# +# Celestica +# +# Module contains an implementation of SONiC Platform Base API and +# provides the the Fan-Drawers' information available in the platform +# +############################################################################# + +try: + from sonic_platform_base.fan_drawer_base import FanDrawerBase +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +NUM_FAN = 2 + + +class FanDrawer(FanDrawerBase): + def __init__(self, fantray_index): + FanDrawerBase.__init__(self) + self._index = fantray_index + 1 + self._init_fan(fantray_index) + + def _init_fan(self, fantray_index): + from sonic_platform.fan import Fan + for index in range(NUM_FAN): + fan = Fan(fantray_index, index) + self._fan_list.append(fan) + + def set_status_led(self, color): + """ + Sets the state of the fan drawer status LED + Args: + color: A string representing the color with which to set the + fan drawer status LED + Returns: + bool: True if status LED state is set successfully, False if not + """ + return self._fan_list[0].set_status_led(color) + + def get_status_led(self, color=None): + """ + Gets the state of the fan drawer LED + Returns: + A string, one of the predefined STATUS_LED_COLOR_* strings above + """ + return self._fan_list[0].get_status_led() + + ############################################################## + ###################### Device methods ######################## + ############################################################## + + def get_name(self): + """ + Retrieves the name of the device + Returns: + string: The name of the device + """ + return "Drawer{}".format(self._index) + + def get_presence(self): + """ + Retrieves the presence of the device + Returns: + bool: True if device is present, False if not + """ + return self._fan_list[0].get_presence() + + def get_model(self): + """ + Retrieves the model number (or part number) of the device + Returns: + string: Model/part number of device + """ + return self._fan_list[0].get_model() + + def get_serial(self): + """ + Retrieves the serial number of the device + Returns: + string: Serial number of device + """ + return self._fan_list[0].get_serial() + + def get_status(self): + """ + Retrieves the operational status of the device + Returns: + A boolean value, True if device is operating properly, False if not + """ + return self._fan_list[0].get_status() + + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device + Returns: + integer: The 1-based relative physical position in parent device + """ + return self._index + + def is_replaceable(self): + """ + Indicate whether this device is replaceable. + Returns: + bool: True if it is replaceable. + """ + return True + + def get_maximum_consumed_power(self): + """ + Retrives the maximum power drawn by Fan Drawer + + Returns: + A float, with value of the maximum consumable power of the + component. + """ + return 33.60 diff --git a/device/celestica/x86_64-cel_seastone-r0/sonic_platform/helper.py b/device/celestica/x86_64-cel_seastone-r0/sonic_platform/helper.py index 140c62c08666..61bc676540db 100644 --- a/device/celestica/x86_64-cel_seastone-r0/sonic_platform/helper.py +++ b/device/celestica/x86_64-cel_seastone-r0/sonic_platform/helper.py @@ -77,7 +77,7 @@ def write_txt_file(self, file_path, value): return True def get_cpld_reg_value(self, getreg_path, register): - cmd = "echo {1} > {0}; cat {0}".format(getreg_path, register) + cmd = "flock {0} -c 'echo {1} > {0}; cat {0}'".format(getreg_path, register) status, result = self.run_command(cmd) return result if status else None diff --git a/device/celestica/x86_64-cel_seastone-r0/sonic_platform/psu.py b/device/celestica/x86_64-cel_seastone-r0/sonic_platform/psu.py index f9a342953aeb..8f3b561fd18e 100644 --- a/device/celestica/x86_64-cel_seastone-r0/sonic_platform/psu.py +++ b/device/celestica/x86_64-cel_seastone-r0/sonic_platform/psu.py @@ -7,7 +7,6 @@ ############################################################################# import os -import sonic_platform try: from sonic_platform_base.psu_base import PsuBase @@ -16,6 +15,9 @@ except ImportError as e: raise ImportError(str(e) + "- required module not found") +TLV_ATTR_TYPE_MODEL = 2 +TLV_ATTR_TYPE_SERIAL = 5 +PSU_EEPROM_PATH = "/sys/bus/i2c/devices/{}-00{}/eeprom" GREEN_LED_PATH = "/sys/devices/platform/leds_dx010/leds/dx010:green:p-{}/brightness" HWMON_PATH = "/sys/bus/i2c/devices/i2c-{0}/{0}-00{1}/hwmon" GPIO_DIR = "/sys/class/gpio" @@ -25,11 +27,13 @@ PSU_I2C_MAPPING = { 0: { "num": 10, - "addr": "5a" + "addr": "5a", + "eeprom_addr": "52" }, 1: { "num": 11, - "addr": "5b" + "addr": "5b", + "eeprom_addr": "53" }, } @@ -41,7 +45,7 @@ def __init__(self, psu_index): PsuBase.__init__(self) self.index = psu_index self._api_helper = APIHelper() - self.green_led_path = GREEN_LED_PATH.format(self.index+1) + self.green_led_path = GREEN_LED_PATH.format(self.index + 1) self.dx010_psu_gpio = [ {'base': self.__get_gpio_base()}, {'prs': 27, 'status': 22}, @@ -50,6 +54,7 @@ def __init__(self, psu_index): self.i2c_num = PSU_I2C_MAPPING[self.index]["num"] self.i2c_addr = PSU_I2C_MAPPING[self.index]["addr"] self.hwmon_path = HWMON_PATH.format(self.i2c_num, self.i2c_addr) + self.eeprom_addr = PSU_EEPROM_PATH.format(self.i2c_num, PSU_I2C_MAPPING[self.index]["eeprom_addr"]) for fan_index in range(0, PSU_NUM_FAN[self.index]): fan = Fan(fan_index, 0, is_psu_fan=True, psu_index=self.index) self._fan_list.append(fan) @@ -71,11 +76,37 @@ def __get_gpio_base(self): def __get_gpio_value(self, pinnum): gpio_base = self.dx010_psu_gpio[0]['base'] - gpio_dir = GPIO_DIR + '/gpio' + str(gpio_base+pinnum) + gpio_dir = GPIO_DIR + '/gpio' + str(gpio_base + pinnum) gpio_file = gpio_dir + "/value" retval = self._api_helper.read_txt_file(gpio_file) return retval.rstrip('\r\n') + def read_fru(self, path, attr_type): + content = [] + attr_idx = 0 + attr_length = 0 + + if(os.path.exists(path)): + with open(path, 'r', encoding='unicode_escape') as f: + content = f.read() + target_offset = ord(content[4]) + target_offset *= 8 # spec defined: offset are in multiples of 8 bytes + + attr_idx = target_offset + 3 + for i in range(1, attr_type): + if attr_idx > len(content): + raise SyntaxError + attr_length = (ord(content[attr_idx])) & (0x3f) + attr_idx += (attr_length + 1) + + attr_length = (ord(content[attr_idx])) & (0x3f) + attr_idx += 1 + else: + print("[PSU] Can't find path to eeprom : %s" % path) + return SyntaxError + + return content[attr_idx:attr_idx + attr_length] + def get_voltage(self): """ Retrieves current PSU voltage output @@ -166,7 +197,7 @@ def set_status_led(self, color): """ set_status_str = { - self.STATUS_LED_COLOR_GREEN: '1', + self.STATUS_LED_COLOR_GREEN: '255', self.STATUS_LED_COLOR_OFF: '0' }.get(color, None) @@ -195,6 +226,132 @@ def get_status_led(self): return status_str + def get_temperature(self): + """ + Retrieves current temperature reading from PSU + Returns: + A float number of current temperature in Celsius up to nearest thousandth + of one degree Celsius, e.g. 30.125 + there are three temp sensors , we choose one of them + """ + psu_temperature = None + temperature_name = "temp{}_input" + temperature_label = "vout1" + + vout_label_path = self.__search_file_by_contain( + self.hwmon_path, temperature_label, "in") + if vout_label_path: + dir_name = os.path.dirname(vout_label_path) + basename = os.path.basename(vout_label_path) + in_num = ''.join(list(filter(str.isdigit, basename))) + temp_path = os.path.join( + dir_name, temperature_name.format(in_num)) + vout_val = self._api_helper.read_txt_file(temp_path) + psu_temperature = float(vout_val) / 1000 + + return psu_temperature + + def get_temperature_high_threshold(self): + """ + Retrieves the high threshold temperature of PSU + Returns: + A float number, the high threshold temperature of PSU in Celsius + up to nearest thousandth of one degree Celsius, e.g. 30.125 + there are three temp sensors , we choose one of them + """ + psu_temperature = None + temperature_name = "temp{}_max" + temperature_label = "vout1" + + vout_label_path = self.__search_file_by_contain( + self.hwmon_path, temperature_label, "in") + if vout_label_path: + dir_name = os.path.dirname(vout_label_path) + basename = os.path.basename(vout_label_path) + in_num = ''.join(list(filter(str.isdigit, basename))) + temp_path = os.path.join( + dir_name, temperature_name.format(in_num)) + vout_val = self._api_helper.read_txt_file(temp_path) + psu_temperature = float(vout_val) / 1000 + + return psu_temperature + + def get_voltage_high_threshold(self): + """ + Retrieves the high threshold PSU voltage output + Returns: + A float number, the high threshold output voltage in volts, + e.g. 12.1 + """ + psu_voltage = 0.0 + voltage_name = "in{}_crit" + voltage_label = "vout1" + + vout_label_path = self.__search_file_by_contain( + self.hwmon_path, voltage_label, "in") + if vout_label_path: + dir_name = os.path.dirname(vout_label_path) + basename = os.path.basename(vout_label_path) + in_num = ''.join(list(filter(str.isdigit, basename))) + vout_path = os.path.join( + dir_name, voltage_name.format(in_num)) + vout_val = self._api_helper.read_txt_file(vout_path) + psu_voltage = float(vout_val) / 1000 + + return psu_voltage + + def get_voltage_low_threshold(self): + """ + Retrieves the low threshold PSU voltage output + Returns: + A float number, the low threshold output voltage in volts, + e.g. 12.1 + """ + psu_voltage = 0.0 + voltage_name = "in{}_lcrit" + voltage_label = "vout1" + + vout_label_path = self.__search_file_by_contain( + self.hwmon_path, voltage_label, "in") + if vout_label_path: + dir_name = os.path.dirname(vout_label_path) + basename = os.path.basename(vout_label_path) + in_num = ''.join(list(filter(str.isdigit, basename))) + vout_path = os.path.join( + dir_name, voltage_name.format(in_num)) + vout_val = self._api_helper.read_txt_file(vout_path) + psu_voltage = float(vout_val) / 1000 + + return psu_voltage + + def get_maximum_supplied_power(self): + """ + Retrieves the maximum supplied power by PSU + Returns: + A float number, the maximum power output in Watts. + e.g. 1200.1 + """ + psu_power = 0.0 + current_name = "power{}_max" + current_label = "pout1" + + pw_label_path = self.__search_file_by_contain( + self.hwmon_path, current_label, "power") + if pw_label_path: + dir_name = os.path.dirname(pw_label_path) + basename = os.path.basename(pw_label_path) + pw_num = ''.join(list(filter(str.isdigit, basename))) + pw_path = os.path.join( + dir_name, current_name.format(pw_num)) + pw_val = self._api_helper.read_txt_file(pw_path) + psu_power = float(pw_val) / 1000000 + + return psu_power + + ############################################################## + ###################### Device methods ######################## + ############################################################## + def get_name(self): """ Retrieves the name of the device @@ -209,7 +366,7 @@ def get_presence(self): Returns: bool: True if PSU is present, False if not """ - raw = self.__get_gpio_value(self.dx010_psu_gpio[self.index+1]['prs']) + raw = self.__get_gpio_value(self.dx010_psu_gpio[self.index + 1]['prs']) return int(raw, 10) == 0 def get_status(self): @@ -219,5 +376,44 @@ def get_status(self): A boolean value, True if device is operating properly, False if not """ raw = self.__get_gpio_value( - self.dx010_psu_gpio[self.index+1]['status']) + self.dx010_psu_gpio[self.index + 1]['status']) return int(raw, 10) == 1 + + def get_model(self): + """ + Retrieves the model number (or part number) of the device + Returns: + string: Model/part number of device + """ + model = self.read_fru(self.eeprom_addr, TLV_ATTR_TYPE_MODEL) + if not model: + return "N/A" + return model + + def get_serial(self): + """ + Retrieves the serial number of the device + Returns: + string: Serial number of device + """ + serial = self.read_fru(self.eeprom_addr, TLV_ATTR_TYPE_SERIAL) + if not serial: + return "N/A" + return serial + + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device. If the agent cannot determine the parent-relative position + for some reason, or if the associated value of entPhysicalContainedIn is '0', then the value '-1' is returned + Returns: + integer: The 1-based relative physical position in parent device or -1 if cannot determine the position + """ + return self.index + 1 + + def is_replaceable(self): + """ + Indicate whether this device is replaceable. + Returns: + bool: True if it is replaceable. + """ + return True diff --git a/device/celestica/x86_64-cel_seastone-r0/sonic_platform/sfp.py b/device/celestica/x86_64-cel_seastone-r0/sonic_platform/sfp.py index 9daa005cd2bf..ff222d5599f8 100644 --- a/device/celestica/x86_64-cel_seastone-r0/sonic_platform/sfp.py +++ b/device/celestica/x86_64-cel_seastone-r0/sonic_platform/sfp.py @@ -1,14 +1,15 @@ +#!/usr/bin/env python + ############################################################################# # Celestica # # Sfp contains an implementation of SONiC Platform Base API and -# provides the sfp device status which are available in the platform +# provides the sfp status which are available in the platform # ############################################################################# import time -import subprocess -from ctypes import create_string_buffer +import struct try: from sonic_platform_base.sfp_base import SfpBase @@ -17,13 +18,13 @@ from sonic_platform_base.sonic_sfp.sff8436 import sff8436InterfaceId from sonic_platform_base.sonic_sfp.sff8436 import sff8436Dom from sonic_platform_base.sonic_sfp.inf8628 import inf8628InterfaceId + from sonic_platform_base.sonic_sfp.qsfp_dd import qsfp_dd_InterfaceId + from sonic_platform_base.sonic_sfp.qsfp_dd import qsfp_dd_Dom + from sonic_platform_base.sonic_sfp.sfputilhelper import SfpUtilHelper from .helper import APIHelper except ImportError as e: raise ImportError(str(e) + "- required module not found") -INFO_OFFSET = 128 -DOM_OFFSET = 0 - # definitions of the offset and width for values in XCVR info eeprom XCVR_INTFACE_BULK_OFFSET = 0 XCVR_INTFACE_BULK_WIDTH_QSFP = 20 @@ -55,6 +56,8 @@ XCVR_HW_REV_WIDTH_OSFP = 2 XCVR_HW_REV_WIDTH_QSFP = 2 XCVR_HW_REV_WIDTH_SFP = 4 +XCVR_EXT_SPECIFICATION_COMPLIANCE_OFFSET = 64 +XCVR_EXT_SPECIFICATION_COMPLIANCE_WIDTH = 1 XCVR_VENDOR_SN_OFFSET = 68 XCVR_VENDOR_SN_WIDTH = 16 XCVR_VENDOR_DATE_OFFSET = 84 @@ -69,6 +72,8 @@ QSFP_DOM_BULK_DATA_SIZE = 36 SFP_DOM_BULK_DATA_START = 96 SFP_DOM_BULK_DATA_SIZE = 10 +QSFP_DD_DOM_BULK_DATA_START = 14 +QSFP_DD_DOM_BULK_DATA_SIZE = 4 # definitions of the offset for values in OSFP info eeprom OSFP_TYPE_OFFSET = 0 @@ -77,6 +82,33 @@ OSFP_HW_REV_OFFSET = 164 OSFP_VENDOR_SN_OFFSET = 166 +# definitions of the offset for values in QSFP_DD info eeprom +QSFP_DD_TYPE_OFFSET = 0 +QSFP_DD_VENDOR_NAME_OFFSET = 1 +QSFP_DD_VENDOR_PN_OFFSET = 20 +QSFP_DD_VENDOR_SN_OFFSET = 38 +QSFP_DD_VENDOR_OUI_OFFSET = 17 + +# definitions of the offset and width for values in XCVR_QSFP_DD info eeprom +XCVR_EXT_TYPE_OFFSET_QSFP_DD = 72 +XCVR_EXT_TYPE_WIDTH_QSFP_DD = 2 +XCVR_CONNECTOR_OFFSET_QSFP_DD = 75 +XCVR_CONNECTOR_WIDTH_QSFP_DD = 1 +XCVR_CABLE_LENGTH_OFFSET_QSFP_DD = 74 +XCVR_CABLE_LENGTH_WIDTH_QSFP_DD = 1 +XCVR_HW_REV_OFFSET_QSFP_DD = 36 +XCVR_HW_REV_WIDTH_QSFP_DD = 2 +XCVR_VENDOR_DATE_OFFSET_QSFP_DD = 54 +XCVR_VENDOR_DATE_WIDTH_QSFP_DD = 8 +XCVR_DOM_CAPABILITY_OFFSET_QSFP_DD = 2 +XCVR_DOM_CAPABILITY_WIDTH_QSFP_DD = 1 +XCVR_MEDIA_TYPE_OFFSET_QSFP_DD = 85 +XCVR_MEDIA_TYPE_WIDTH_QSFP_DD = 1 +XCVR_FIRST_APPLICATION_LIST_OFFSET_QSFP_DD = 86 +XCVR_FIRST_APPLICATION_LIST_WIDTH_QSFP_DD = 32 +XCVR_SECOND_APPLICATION_LIST_OFFSET_QSFP_DD = 351 +XCVR_SECOND_APPLICATION_LIST_WIDTH_QSFP_DD = 28 + # Offset for values in QSFP eeprom QSFP_DOM_REV_OFFSET = 1 QSFP_DOM_REV_WIDTH = 1 @@ -126,29 +158,102 @@ SFP_CHANNL_STATUS_OFFSET = 110 SFP_CHANNL_STATUS_WIDTH = 1 +QSFP_DD_TEMPE_OFFSET = 14 +QSFP_DD_TEMPE_WIDTH = 2 +QSFP_DD_VOLT_OFFSET = 16 +QSFP_DD_VOLT_WIDTH = 2 +QSFP_DD_TX_BIAS_OFFSET = 42 +QSFP_DD_TX_BIAS_WIDTH = 16 +QSFP_DD_RX_POWER_OFFSET = 58 +QSFP_DD_RX_POWER_WIDTH = 16 +QSFP_DD_TX_POWER_OFFSET = 26 +QSFP_DD_TX_POWER_WIDTH = 16 +QSFP_DD_CHANNL_MON_OFFSET = 154 +QSFP_DD_CHANNL_MON_WIDTH = 48 +QSFP_DD_CHANNL_DISABLE_STATUS_OFFSET = 86 +QSFP_DD_CHANNL_DISABLE_STATUS_WIDTH = 1 +QSFP_DD_CHANNL_RX_LOS_STATUS_OFFSET = 19 +QSFP_DD_CHANNL_RX_LOS_STATUS_WIDTH = 1 +QSFP_DD_CHANNL_TX_FAULT_STATUS_OFFSET = 7 +QSFP_DD_CHANNL_TX_FAULT_STATUS_WIDTH = 1 +QSFP_DD_MODULE_THRESHOLD_OFFSET = 0 +QSFP_DD_MODULE_THRESHOLD_WIDTH = 72 +QSFP_DD_CHANNL_STATUS_OFFSET = 26 +QSFP_DD_CHANNL_STATUS_WIDTH = 1 + + +sfp_cable_length_tup = ( + 'LengthSMFkm-UnitsOfKm', 'LengthSMF(UnitsOf100m)', + 'Length50um(UnitsOf10m)', 'Length62.5um(UnitsOfm)', + 'LengthCable(UnitsOfm)', 'LengthOM3(UnitsOf10m)' +) + +sfp_compliance_code_tup = ( + '10GEthernetComplianceCode', 'InfinibandComplianceCode', + 'ESCONComplianceCodes', 'SONETComplianceCodes', + 'EthernetComplianceCodes', 'FibreChannelLinkLength', + 'FibreChannelTechnology', 'SFP+CableTechnology', + 'FibreChannelTransmissionMedia', 'FibreChannelSpeed' +) + +qsfp_compliance_code_tup = ( + '10/40G Ethernet Compliance Code', 'SONET Compliance codes', + 'SAS/SATA compliance codes', 'Gigabit Ethernet Compliant codes', + 'Fibre Channel link length/Transmitter Technology', + 'Fibre Channel transmission media', 'Fibre Channel Speed' +) + +info_dict_keys = [ + 'type', 'hardware_rev', 'serial', 'manufacturer', + 'model', 'connector', 'encoding', 'ext_identifier', + 'ext_rateselect_compliance', 'cable_type', 'cable_length', + 'nominal_bit_rate', 'specification_compliance', 'vendor_date', + 'vendor_oui', 'application_advertisement', 'type_abbrv_name' +] qsfp_cable_length_tup = ('Length(km)', 'Length OM3(2m)', 'Length OM2(m)', 'Length OM1(m)', 'Length Cable Assembly(m)') -sfp_cable_length_tup = ('LengthSMFkm-UnitsOfKm', 'LengthSMF(UnitsOf100m)', - 'Length50um(UnitsOf10m)', 'Length62.5um(UnitsOfm)', - 'LengthCable(UnitsOfm)', 'LengthOM3(UnitsOf10m)') - -sfp_compliance_code_tup = ('10GEthernetComplianceCode', 'InfinibandComplianceCode', - 'ESCONComplianceCodes', 'SONETComplianceCodes', - 'EthernetComplianceCodes', 'FibreChannelLinkLength', - 'FibreChannelTechnology', 'SFP+CableTechnology', - 'FibreChannelTransmissionMedia', 'FibreChannelSpeed') - -qsfp_compliance_code_tup = ('10/40G Ethernet Compliance Code', 'SONET Compliance codes', - 'SAS/SATA compliance codes', 'Gigabit Ethernet Compliant codes', - 'Fibre Channel link length/Transmitter Technology', - 'Fibre Channel transmission media', 'Fibre Channel Speed') +dom_info_dict_keys = [ + 'rx_los', 'tx_fault', 'reset_status', 'lp_mode', + 'tx_disable', 'tx_disable_channel', 'temperature', 'voltage', + 'rx1power', 'rx2power', 'rx3power', 'rx4power', + 'rx5power', 'rx6power', 'rx7power', 'rx8power', + 'tx1bias', 'tx2bias', 'tx3bias', 'tx4bias', + 'tx5bias', 'tx6bias', 'tx7bias', 'tx8bias', + 'tx1power', 'tx2power', 'tx3power', 'tx4power', + 'tx5power', 'tx6power', 'tx7power', 'tx8power'] + +threshold_dict_keys = [ + 'temphighalarm', 'temphighwarning', + 'templowalarm', 'templowwarning', + 'vcchighalarm', 'vcchighwarning', + 'vcclowalarm', 'vcclowwarning', + 'rxpowerhighalarm', 'rxpowerhighwarning', + 'rxpowerlowalarm', 'rxpowerlowwarning', + 'txpowerhighalarm', 'txpowerhighwarning', + 'txpowerlowalarm', 'txpowerlowwarning', + 'txbiashighalarm', 'txbiashighwarning', + 'txbiaslowalarm', 'txbiaslowwarning'] + +SFP_TYPE_CODE_LIST = [ + '03' # SFP/SFP+/SFP28 +] +QSFP_TYPE_CODE_LIST = [ + '0d', # QSFP+ or later + '11' # QSFP28 or later +] +QSFP_DD_TYPE_CODE_LIST = [ + '18' # QSFP-DD Double Density 8X Pluggable Transceiver +] SFP_TYPE = "SFP" QSFP_TYPE = "QSFP" OSFP_TYPE = "OSFP" +QSFP_DD_TYPE = "QSFP_DD" + +NULL_VAL = 'N/A' PORT_START = 1 PORT_END = 56 @@ -156,60 +261,45 @@ QSFP_PORT_END = 32 SFP_I2C_START = 26 +I2C_EEPROM_PATH = '/sys/bus/i2c/devices/i2c-{0}/{0}-0050/eeprom' class Sfp(SfpBase): """Platform-specific Sfp class""" - # Path to QSFP sysfs RESET_PATH = "/sys/devices/platform/dx010_cpld/qsfp_reset" LP_PATH = "/sys/devices/platform/dx010_cpld/qsfp_lpmode" PRS_PATH = "/sys/devices/platform/dx010_cpld/qsfp_modprs" - def __init__(self, sfp_index, sfp_name): + def __init__(self, sfp_index=0, sfp_name=None): SfpBase.__init__(self) - # Init index - self.index = sfp_index - self.port_num = self.index + 1 - self.dom_supported = False - self.sfp_type, self.port_name = self.__get_sfp_info() - self._api_helper = APIHelper() - self.name = sfp_name - - # Init eeprom path - eeprom_path = '/sys/bus/i2c/devices/i2c-{0}/{0}-0050/eeprom' - self.port_to_eeprom_mapping = {} - self.port_to_i2c_mapping = {} - - for x in range(PORT_START, PORT_END + 1): - self.port_to_i2c_mapping[x] = (SFP_I2C_START + x) - 1 - port_eeprom_path = eeprom_path.format(self.port_to_i2c_mapping[x]) - self.port_to_eeprom_mapping[x] = port_eeprom_path - self.info_dict_keys = ['type', 'hardware_rev', 'serial', 'manufacturer', 'model', 'connector', 'encoding', 'ext_identifier', - 'ext_rateselect_compliance', 'cable_type', 'cable_length', 'nominal_bit_rate', 'specification_compliance', 'vendor_date', 'vendor_oui'] + self._index = sfp_index + self._port_num = self._index + 1 + self._api_helper = APIHelper() + self._name = sfp_name - self.dom_dict_keys = ['rx_los', 'tx_fault', 'reset_status', 'power_lpmode', 'tx_disable', 'tx_disable_channel', 'temperature', 'voltage', - 'rx1power', 'rx2power', 'rx3power', 'rx4power', 'tx1bias', 'tx2bias', 'tx3bias', 'tx4bias', 'tx1power', 'tx2power', 'tx3power', 'tx4power'] + self._read_porttab_mappings() + self._dom_capability_detect() + self._eeprom_path = self._get_eeprom_path() - self.threshold_dict_keys = ['temphighalarm', 'temphighwarning', 'templowalarm', 'templowwarning', 'vcchighalarm', 'vcchighwarning', 'vcclowalarm', 'vcclowwarning', 'rxpowerhighalarm', 'rxpowerhighwarning', - 'rxpowerlowalarm', 'rxpowerlowwarning', 'txpowerhighalarm', 'txpowerhighwarning', 'txpowerlowalarm', 'txpowerlowwarning', 'txbiashighalarm', 'txbiashighwarning', 'txbiaslowalarm', 'txbiaslowwarning'] + def _read_porttab_mappings(self): + self._sfputil_helper = SfpUtilHelper() + self._sfputil_helper.read_porttab_mappings( + self._get_path_to_port_config_file()) - self._dom_capability_detect() + def _get_path_to_port_config_file(self): + host_platform_root_path = '/usr/share/sonic/device' + docker_hwsku_path = '/usr/share/sonic/hwsku' - def __get_sfp_info(self): - port_name = "Unknown" - sfp_type = "Unknown" + host_platform_path = "/".join([host_platform_root_path, + self._api_helper.platform]) + hwsku_path = "/".join([host_platform_path, self._api_helper.hwsku]) \ + if self._api_helper.is_host() else docker_hwsku_path - if self.port_num >= QSFP_PORT_START and self.port_num <= QSFP_TYPE: - sfp_type = QSFP_TYPE - port_name = "QSFP" + str(self.port_num - QSFP_PORT_START + 1) - elif self.port_num >= SFP_PORT_START and self.port_num <= SFP_PORT_END: - sfp_type = SFP_TYPE - port_name = "SFP" + str(self.port_num - SFP_PORT_START + 1) - return sfp_type, port_name + return "/".join([hwsku_path, "port_config.ini"]) - def __convert_string_to_num(self, value_str): + def _convert_string_to_num(self, value_str): if "-inf" in value_str: return 'N/A' elif "Unknown" in value_str: @@ -229,28 +319,63 @@ def __convert_string_to_num(self, value_str): else: return 'N/A' - def __read_eeprom_specific_bytes(self, offset, num_bytes): - sysfsfile_eeprom = None + def _read_eeprom_specific_bytes(self, offset, num_bytes): + sysfs_sfp_i2c_client_eeprom_path = self._get_eeprom_path() eeprom_raw = [] + try: + eeprom = open( + sysfs_sfp_i2c_client_eeprom_path, + mode="rb", buffering=0) + except IOError: + return None + for i in range(0, num_bytes): eeprom_raw.append("0x00") - sysfs_sfp_i2c_client_eeprom_path = self.port_to_eeprom_mapping[self.port_num] try: - sysfsfile_eeprom = open( - sysfs_sfp_i2c_client_eeprom_path, mode="rb", buffering=0) - sysfsfile_eeprom.seek(offset) - raw = sysfsfile_eeprom.read(num_bytes) - for n in range(0, num_bytes): - eeprom_raw[n] = hex(ord(raw[n]))[2:].zfill(2) - except: - pass - finally: - if sysfsfile_eeprom: - sysfsfile_eeprom.close() + eeprom.seek(offset) + raw = eeprom.read(num_bytes) + except IOError: + eeprom.close() + return None + try: + if isinstance(raw, str): + for n in range(0, num_bytes): + eeprom_raw[n] = hex(ord(raw[n]))[2:].zfill(2) + else: + for n in range(0, num_bytes): + eeprom_raw[n] = hex(raw[n])[2:].zfill(2) + + except BaseException: + eeprom.close() + return None + + eeprom.close() return eeprom_raw + def _detect_sfp_type(self): + sfp_type = QSFP_TYPE + eeprom_raw = [] + eeprom_raw = self._read_eeprom_specific_bytes( + XCVR_TYPE_OFFSET, XCVR_TYPE_WIDTH) + if eeprom_raw: + if eeprom_raw[0] in SFP_TYPE_CODE_LIST: + self.sfp_type = SFP_TYPE + elif eeprom_raw[0] in QSFP_TYPE_CODE_LIST: + self.sfp_type = QSFP_TYPE + elif eeprom_raw[0] in QSFP_DD_TYPE_CODE_LIST: + self.sfp_type = QSFP_DD_TYPE + else: + self.sfp_type = sfp_type + else: + self.sfp_type = sfp_type + + def _get_eeprom_path(self): + port_to_i2c_mapping = SFP_I2C_START + self._index + port_eeprom_path = I2C_EEPROM_PATH.format(port_to_i2c_mapping) + return port_eeprom_path + def _dom_capability_detect(self): if not self.get_presence(): self.dom_supported = False @@ -261,25 +386,31 @@ def _dom_capability_detect(self): self.calibration = 0 return - if self.sfp_type == "QSFP": + self._detect_sfp_type() + + if self.sfp_type == QSFP_TYPE: self.calibration = 1 sfpi_obj = sff8436InterfaceId() if sfpi_obj is None: self.dom_supported = False offset = 128 - # QSFP capability byte parse, through this byte can know whether it support tx_power or not. + # QSFP capability byte parse, + # through this byte can know whether it support tx_power or not. # TODO: in the future when decided to migrate to support SFF-8636 instead of SFF-8436, # need to add more code for determining the capability and version compliance # in SFF-8636 dom capability definitions evolving with the versions. - qsfp_dom_capability_raw = self.__read_eeprom_specific_bytes( - (offset + XCVR_DOM_CAPABILITY_OFFSET), XCVR_DOM_CAPABILITY_WIDTH) + + qsfp_dom_capability_raw = self._read_eeprom_specific_bytes( + (offset + XCVR_DOM_CAPABILITY_OFFSET), + XCVR_DOM_CAPABILITY_WIDTH) if qsfp_dom_capability_raw is not None: - qsfp_version_compliance_raw = self.__read_eeprom_specific_bytes( - QSFP_VERSION_COMPLIANCE_OFFSET, QSFP_VERSION_COMPLIANCE_WIDTH) + qsfp_version_compliance_raw = self._read_eeprom_specific_bytes( + QSFP_VERSION_COMPLIANCE_OFFSET, + QSFP_VERSION_COMPLIANCE_WIDTH) qsfp_version_compliance = int( qsfp_version_compliance_raw[0], 16) - dom_capability = sfpi_obj.parse_qsfp_dom_capability( + dom_capability = sfpi_obj.parse_dom_capability( qsfp_dom_capability_raw, 0) if qsfp_version_compliance >= 0x08: self.dom_temp_supported = dom_capability['data']['Temp_support']['value'] == 'On' @@ -297,7 +428,7 @@ def _dom_capability_detect(self): sfpd_obj = sff8436Dom() if sfpd_obj is None: return None - qsfp_option_value_raw = self.__read_eeprom_specific_bytes( + qsfp_option_value_raw = self._read_eeprom_specific_bytes( QSFP_OPTION_VALUE_OFFSET, QSFP_OPTION_VALUE_WIDTH) if qsfp_option_value_raw is not None: optional_capability = sfpd_obj.parse_option_params( @@ -316,11 +447,52 @@ def _dom_capability_detect(self): self.calibration = 0 self.qsfp_page3_available = False - elif self.sfp_type == "SFP": + elif self.sfp_type == QSFP_DD_TYPE: + sfpi_obj = qsfp_dd_InterfaceId() + if sfpi_obj is None: + self.dom_supported = False + + offset = 0 + # two types of QSFP-DD cable types supported: Copper and Optical. + qsfp_dom_capability_raw = self._read_eeprom_specific_bytes( + (offset + XCVR_DOM_CAPABILITY_OFFSET_QSFP_DD), XCVR_DOM_CAPABILITY_WIDTH_QSFP_DD) + if qsfp_dom_capability_raw is not None: + self.dom_temp_supported = True + self.dom_volt_supported = True + dom_capability = sfpi_obj.parse_dom_capability( + qsfp_dom_capability_raw, 0) + if dom_capability['data']['Flat_MEM']['value'] == 'Off': + self.dom_supported = True + self.second_application_list = True + self.dom_rx_power_supported = True + self.dom_tx_power_supported = True + self.dom_tx_bias_power_supported = True + self.dom_thresholds_supported = True + # currently set to False becasue Page 11h is not supported by FW + self.dom_rx_tx_power_bias_supported = False + else: + self.dom_supported = False + self.second_application_list = False + self.dom_rx_power_supported = False + self.dom_tx_power_supported = False + self.dom_tx_bias_power_supported = False + self.dom_thresholds_supported = False + self.dom_rx_tx_power_bias_supported = False + else: + self.dom_supported = False + self.dom_temp_supported = False + self.dom_volt_supported = False + self.dom_rx_power_supported = False + self.dom_tx_power_supported = False + self.dom_tx_bias_power_supported = False + self.dom_thresholds_supported = False + self.dom_rx_tx_power_bias_supported = False + + elif self.sfp_type == SFP_TYPE: sfpi_obj = sff8472InterfaceId() if sfpi_obj is None: return None - sfp_dom_capability_raw = self.__read_eeprom_specific_bytes( + sfp_dom_capability_raw = self._read_eeprom_specific_bytes( XCVR_DOM_CAPABILITY_OFFSET, XCVR_DOM_CAPABILITY_WIDTH) if sfp_dom_capability_raw is not None: sfp_dom_capability = int(sfp_dom_capability_raw[0], 16) @@ -356,7 +528,7 @@ def get_transceiver_info(self): Retrieves transceiver info of this SFP Returns: A dict which contains following keys/values : - ======================================================================== + ================================================================================ keys |Value Format |Information ---------------------------|---------------|---------------------------- type |1*255VCHAR |type of SFP @@ -373,12 +545,15 @@ def get_transceiver_info(self): specification_compliance |1*255VCHAR |specification compliance vendor_date |1*255VCHAR |vendor date vendor_oui |1*255VCHAR |vendor OUI - ======================================================================== - """ + application_advertisement |1*255VCHAR |supported applications advertisement + ================================================================================ + """ + + transceiver_info_dict = {} compliance_code_dict = {} - transceiver_info_dict = dict.fromkeys(self.info_dict_keys, 'N/A') - if not self.get_presence(): - return transceiver_info_dict + transceiver_info_dict = dict.fromkeys( + info_dict_keys, NULL_VAL) + transceiver_info_dict["specification_compliance"] = '{}' # ToDo: OSFP tranceiver info parsing not fully supported. # in inf8628.py lack of some memory map definition @@ -389,89 +564,229 @@ def get_transceiver_info(self): sfpi_obj = inf8628InterfaceId() if sfpi_obj is None: - return None + return transceiver_info_dict - sfp_type_raw = self.__read_eeprom_specific_bytes( + sfp_type_raw = self._read_eeprom_specific_bytes( (offset + OSFP_TYPE_OFFSET), XCVR_TYPE_WIDTH) if sfp_type_raw is not None: sfp_type_data = sfpi_obj.parse_sfp_type(sfp_type_raw, 0) else: - return None + return transceiver_info_dict - sfp_vendor_name_raw = self.__read_eeprom_specific_bytes( + sfp_vendor_name_raw = self._read_eeprom_specific_bytes( (offset + OSFP_VENDOR_NAME_OFFSET), XCVR_VENDOR_NAME_WIDTH) if sfp_vendor_name_raw is not None: sfp_vendor_name_data = sfpi_obj.parse_vendor_name( sfp_vendor_name_raw, 0) else: - return None + return transceiver_info_dict - sfp_vendor_pn_raw = self.__read_eeprom_specific_bytes( + sfp_vendor_pn_raw = self._read_eeprom_specific_bytes( (offset + OSFP_VENDOR_PN_OFFSET), XCVR_VENDOR_PN_WIDTH) if sfp_vendor_pn_raw is not None: sfp_vendor_pn_data = sfpi_obj.parse_vendor_pn( sfp_vendor_pn_raw, 0) else: - return None + return transceiver_info_dict - sfp_vendor_rev_raw = self.__read_eeprom_specific_bytes( + sfp_vendor_rev_raw = self._read_eeprom_specific_bytes( (offset + OSFP_HW_REV_OFFSET), vendor_rev_width) if sfp_vendor_rev_raw is not None: sfp_vendor_rev_data = sfpi_obj.parse_vendor_rev( sfp_vendor_rev_raw, 0) else: - return None + return transceiver_info_dict - sfp_vendor_sn_raw = self.__read_eeprom_specific_bytes( + sfp_vendor_sn_raw = self._read_eeprom_specific_bytes( (offset + OSFP_VENDOR_SN_OFFSET), XCVR_VENDOR_SN_WIDTH) if sfp_vendor_sn_raw is not None: sfp_vendor_sn_data = sfpi_obj.parse_vendor_sn( sfp_vendor_sn_raw, 0) else: - return None + return transceiver_info_dict transceiver_info_dict['type'] = sfp_type_data['data']['type']['value'] transceiver_info_dict['manufacturer'] = sfp_vendor_name_data['data']['Vendor Name']['value'] transceiver_info_dict['model'] = sfp_vendor_pn_data['data']['Vendor PN']['value'] transceiver_info_dict['hardware_rev'] = sfp_vendor_rev_data['data']['Vendor Rev']['value'] transceiver_info_dict['serial'] = sfp_vendor_sn_data['data']['Vendor SN']['value'] - transceiver_info_dict['vendor_oui'] = 'N/A' - transceiver_info_dict['vendor_date'] = 'N/A' - transceiver_info_dict['connector'] = 'N/A' - transceiver_info_dict['encoding'] = 'N/A' - transceiver_info_dict['ext_identifier'] = 'N/A' - transceiver_info_dict['ext_rateselect_compliance'] = 'N/A' - transceiver_info_dict['cable_type'] = 'N/A' - transceiver_info_dict['cable_length'] = 'N/A' - transceiver_info_dict['specification_compliance'] = '{}' - transceiver_info_dict['nominal_bit_rate'] = 'N/A' - else: - if self.sfp_type == QSFP_TYPE: - offset = 128 - vendor_rev_width = XCVR_HW_REV_WIDTH_QSFP - # cable_length_width = XCVR_CABLE_LENGTH_WIDTH_QSFP - interface_info_bulk_width = XCVR_INTFACE_BULK_WIDTH_QSFP + elif self.sfp_type == QSFP_TYPE: + offset = 128 + vendor_rev_width = XCVR_HW_REV_WIDTH_QSFP + interface_info_bulk_width = XCVR_INTFACE_BULK_WIDTH_QSFP - sfpi_obj = sff8436InterfaceId() - if sfpi_obj is None: - print("Error: sfp_object open failed") - return None + sfpi_obj = sff8436InterfaceId() + if sfpi_obj is None: + print("Error: sfp_object open failed") + return transceiver_info_dict + + elif self.sfp_type == QSFP_DD_TYPE: + offset = 128 + + sfpi_obj = qsfp_dd_InterfaceId() + if sfpi_obj is None: + print("Error: sfp_object open failed") + return transceiver_info_dict + sfp_type_raw = self._read_eeprom_specific_bytes( + (offset + QSFP_DD_TYPE_OFFSET), XCVR_TYPE_WIDTH) + if sfp_type_raw is not None: + sfp_type_data = sfpi_obj.parse_sfp_type(sfp_type_raw, 0) else: - offset = 0 - vendor_rev_width = XCVR_HW_REV_WIDTH_SFP - # cable_length_width = XCVR_CABLE_LENGTH_WIDTH_SFP - interface_info_bulk_width = XCVR_INTFACE_BULK_WIDTH_SFP - - sfpi_obj = sff8472InterfaceId() - if sfpi_obj is None: - print("Error: sfp_object open failed") - return None - sfp_interface_bulk_raw = self.__read_eeprom_specific_bytes( + return transceiver_info_dict + + sfp_vendor_name_raw = self._read_eeprom_specific_bytes( + (offset + QSFP_DD_VENDOR_NAME_OFFSET), XCVR_VENDOR_NAME_WIDTH) + if sfp_vendor_name_raw is not None: + sfp_vendor_name_data = sfpi_obj.parse_vendor_name( + sfp_vendor_name_raw, 0) + else: + return transceiver_info_dict + + sfp_vendor_pn_raw = self._read_eeprom_specific_bytes( + (offset + QSFP_DD_VENDOR_PN_OFFSET), XCVR_VENDOR_PN_WIDTH) + if sfp_vendor_pn_raw is not None: + sfp_vendor_pn_data = sfpi_obj.parse_vendor_pn( + sfp_vendor_pn_raw, 0) + else: + return transceiver_info_dict + + sfp_vendor_rev_raw = self._read_eeprom_specific_bytes( + (offset + XCVR_HW_REV_OFFSET_QSFP_DD), XCVR_HW_REV_WIDTH_QSFP_DD) + if sfp_vendor_rev_raw is not None: + sfp_vendor_rev_data = sfpi_obj.parse_vendor_rev( + sfp_vendor_rev_raw, 0) + else: + return transceiver_info_dict + + sfp_vendor_sn_raw = self._read_eeprom_specific_bytes( + (offset + QSFP_DD_VENDOR_SN_OFFSET), XCVR_VENDOR_SN_WIDTH) + if sfp_vendor_sn_raw is not None: + sfp_vendor_sn_data = sfpi_obj.parse_vendor_sn( + sfp_vendor_sn_raw, 0) + else: + return transceiver_info_dict + + sfp_vendor_oui_raw = self._read_eeprom_specific_bytes( + (offset + QSFP_DD_VENDOR_OUI_OFFSET), XCVR_VENDOR_OUI_WIDTH) + if sfp_vendor_oui_raw is not None: + sfp_vendor_oui_data = sfpi_obj.parse_vendor_oui( + sfp_vendor_oui_raw, 0) + else: + return transceiver_info_dict + + sfp_vendor_date_raw = self._read_eeprom_specific_bytes( + (offset + XCVR_VENDOR_DATE_OFFSET_QSFP_DD), XCVR_VENDOR_DATE_WIDTH_QSFP_DD) + if sfp_vendor_date_raw is not None: + sfp_vendor_date_data = sfpi_obj.parse_vendor_date( + sfp_vendor_date_raw, 0) + else: + return transceiver_info_dict + + sfp_connector_raw = self._read_eeprom_specific_bytes( + (offset + XCVR_CONNECTOR_OFFSET_QSFP_DD), XCVR_CONNECTOR_WIDTH_QSFP_DD) + if sfp_connector_raw is not None: + sfp_connector_data = sfpi_obj.parse_connector( + sfp_connector_raw, 0) + else: + return transceiver_info_dict + + sfp_ext_identifier_raw = self._read_eeprom_specific_bytes( + (offset + XCVR_EXT_TYPE_OFFSET_QSFP_DD), XCVR_EXT_TYPE_WIDTH_QSFP_DD) + if sfp_ext_identifier_raw is not None: + sfp_ext_identifier_data = sfpi_obj.parse_ext_iden( + sfp_ext_identifier_raw, 0) + else: + return transceiver_info_dict + + sfp_cable_len_raw = self._read_eeprom_specific_bytes( + (offset + XCVR_CABLE_LENGTH_OFFSET_QSFP_DD), XCVR_CABLE_LENGTH_WIDTH_QSFP_DD) + if sfp_cable_len_raw is not None: + sfp_cable_len_data = sfpi_obj.parse_cable_len( + sfp_cable_len_raw, 0) + else: + return transceiver_info_dict + + sfp_media_type_raw = self._read_eeprom_specific_bytes( + XCVR_MEDIA_TYPE_OFFSET_QSFP_DD, XCVR_MEDIA_TYPE_WIDTH_QSFP_DD) + if sfp_media_type_raw is not None: + sfp_media_type_dict = sfpi_obj.parse_media_type( + sfp_media_type_raw, 0) + if sfp_media_type_dict is None: + return transceiver_info_dict + + host_media_list = "" + sfp_application_type_first_list = self._read_eeprom_specific_bytes( + (XCVR_FIRST_APPLICATION_LIST_OFFSET_QSFP_DD), XCVR_FIRST_APPLICATION_LIST_WIDTH_QSFP_DD) + if self.second_application_list: + possible_application_count = 15 + sfp_application_type_second_list = self._read_eeprom_specific_bytes( + (XCVR_SECOND_APPLICATION_LIST_OFFSET_QSFP_DD), XCVR_SECOND_APPLICATION_LIST_WIDTH_QSFP_DD) + if sfp_application_type_first_list is not None and sfp_application_type_second_list is not None: + sfp_application_type_list = sfp_application_type_first_list + \ + sfp_application_type_second_list + else: + return transceiver_info_dict + else: + possible_application_count = 8 + if sfp_application_type_first_list is not None: + sfp_application_type_list = sfp_application_type_first_list + else: + return transceiver_info_dict + + for i in range(0, possible_application_count): + if sfp_application_type_list[i * 4] == 'ff': + break + host_electrical, media_interface = sfpi_obj.parse_application( + sfp_media_type_dict, sfp_application_type_list[i * 4], sfp_application_type_list[i * 4 + 1]) + host_media_list = host_media_list + host_electrical + \ + ' - ' + media_interface + '\n\t\t\t\t ' + else: + return transceiver_info_dict + + transceiver_info_dict['type'] = str( + sfp_type_data['data']['type']['value']) + transceiver_info_dict['manufacturer'] = str( + sfp_vendor_name_data['data']['Vendor Name']['value']) + transceiver_info_dict['model'] = str( + sfp_vendor_pn_data['data']['Vendor PN']['value']) + transceiver_info_dict['hardware_rev'] = str( + sfp_vendor_rev_data['data']['Vendor Rev']['value']) + transceiver_info_dict['serial'] = str( + sfp_vendor_sn_data['data']['Vendor SN']['value']) + transceiver_info_dict['vendor_oui'] = str( + sfp_vendor_oui_data['data']['Vendor OUI']['value']) + transceiver_info_dict['vendor_date'] = str( + sfp_vendor_date_data['data']['VendorDataCode(YYYY-MM-DD Lot)']['value']) + transceiver_info_dict['connector'] = str( + sfp_connector_data['data']['Connector']['value']) + transceiver_info_dict['encoding'] = "Not supported for CMIS cables" + transceiver_info_dict['ext_identifier'] = str( + sfp_ext_identifier_data['data']['Extended Identifier']['value']) + transceiver_info_dict['ext_rateselect_compliance'] = "Not supported for CMIS cables" + transceiver_info_dict['specification_compliance'] = "Not supported for CMIS cables" + transceiver_info_dict['cable_type'] = "Length Cable Assembly(m)" + transceiver_info_dict['cable_length'] = str( + sfp_cable_len_data['data']['Length Cable Assembly(m)']['value']) + transceiver_info_dict['nominal_bit_rate'] = "Not supported for CMIS cables" + transceiver_info_dict['application_advertisement'] = host_media_list + + else: + offset = 0 + vendor_rev_width = XCVR_HW_REV_WIDTH_SFP + interface_info_bulk_width = XCVR_INTFACE_BULK_WIDTH_SFP + + sfpi_obj = sff8472InterfaceId() + if sfpi_obj is None: + print("Error: sfp_object open failed") + return transceiver_info_dict + + if self.sfp_type != QSFP_DD_TYPE: + sfp_interface_bulk_raw = self._read_eeprom_specific_bytes( offset + XCVR_INTERFACE_DATA_START, XCVR_INTERFACE_DATA_SIZE) if sfp_interface_bulk_raw is None: - return None + return transceiver_info_dict start = XCVR_INTFACE_BULK_OFFSET - XCVR_INTERFACE_DATA_START end = start + interface_info_bulk_width @@ -507,6 +822,7 @@ def get_transceiver_info(self): end = start + XCVR_VENDOR_DATE_WIDTH sfp_vendor_date_data = sfpi_obj.parse_vendor_date( sfp_interface_bulk_raw[start: end], 0) + transceiver_info_dict['type'] = sfp_interface_bulk_data['data']['type']['value'] transceiver_info_dict['manufacturer'] = sfp_vendor_name_data['data']['Vendor Name']['value'] transceiver_info_dict['model'] = sfp_vendor_pn_data['data']['Vendor PN']['value'] @@ -530,9 +846,16 @@ def get_transceiver_info(self): for key in qsfp_compliance_code_tup: if key in sfp_interface_bulk_data['data']['Specification compliance']['value']: compliance_code_dict[key] = sfp_interface_bulk_data['data']['Specification compliance']['value'][key]['value'] + sfp_ext_specification_compliance_raw = self._read_eeprom_specific_bytes( + offset + XCVR_EXT_SPECIFICATION_COMPLIANCE_OFFSET, XCVR_EXT_SPECIFICATION_COMPLIANCE_WIDTH) + if sfp_ext_specification_compliance_raw is not None: + sfp_ext_specification_compliance_data = sfpi_obj.parse_ext_specification_compliance( + sfp_ext_specification_compliance_raw[0: 1], 0) + if sfp_ext_specification_compliance_data['data']['Extended Specification compliance']['value'] != "Unspecified": + compliance_code_dict['Extended Specification compliance'] = sfp_ext_specification_compliance_data[ + 'data']['Extended Specification compliance']['value'] transceiver_info_dict['specification_compliance'] = str( compliance_code_dict) - transceiver_info_dict['nominal_bit_rate'] = str( sfp_interface_bulk_data['data']['Nominal Bit Rate(100Mbs)']['value']) else: @@ -578,7 +901,8 @@ def get_transceiver_bulk_status(self): | |for example, tx2power stands for tx power of channel 2. ======================================================================== """ - transceiver_dom_info_dict = dict.fromkeys(self.dom_dict_keys, 'N/A') + transceiver_dom_info_dict = dict.fromkeys( + dom_info_dict_keys, NULL_VAL) if self.sfp_type == OSFP_TYPE: pass @@ -592,7 +916,7 @@ def get_transceiver_bulk_status(self): if sfpd_obj is None: return transceiver_dom_info_dict - dom_data_raw = self.__read_eeprom_specific_bytes( + dom_data_raw = self._read_eeprom_specific_bytes( (offset + QSFP_DOM_BULK_DATA_START), QSFP_DOM_BULK_DATA_SIZE) if dom_data_raw is None: return transceiver_dom_info_dict @@ -602,8 +926,7 @@ def get_transceiver_bulk_status(self): end = start + QSFP_TEMPE_WIDTH dom_temperature_data = sfpd_obj.parse_temperature( dom_data_raw[start: end], 0) - temp = self.__convert_string_to_num( - dom_temperature_data['data']['Temperature']['value']) + temp = dom_temperature_data['data']['Temperature']['value'] if temp is not None: transceiver_dom_info_dict['temperature'] = temp @@ -612,8 +935,7 @@ def get_transceiver_bulk_status(self): end = start + QSFP_VOLT_WIDTH dom_voltage_data = sfpd_obj.parse_voltage( dom_data_raw[start: end], 0) - volt = self.__convert_string_to_num( - dom_voltage_data['data']['Vcc']['value']) + volt = dom_voltage_data['data']['Vcc']['value'] if volt is not None: transceiver_dom_info_dict['voltage'] = volt @@ -623,33 +945,116 @@ def get_transceiver_bulk_status(self): dom_data_raw[start: end], 0) if self.dom_tx_power_supported: - transceiver_dom_info_dict['tx1power'] = self.__convert_string_to_num( - dom_channel_monitor_data['data']['TX1Power']['value']) - transceiver_dom_info_dict['tx2power'] = self.__convert_string_to_num( - dom_channel_monitor_data['data']['TX2Power']['value']) - transceiver_dom_info_dict['tx3power'] = self.__convert_string_to_num( - dom_channel_monitor_data['data']['TX3Power']['value']) - transceiver_dom_info_dict['tx4power'] = self.__convert_string_to_num( - dom_channel_monitor_data['data']['TX4Power']['value']) + transceiver_dom_info_dict['tx1power'] = dom_channel_monitor_data['data']['TX1Power']['value'] + transceiver_dom_info_dict['tx2power'] = dom_channel_monitor_data['data']['TX2Power']['value'] + transceiver_dom_info_dict['tx3power'] = dom_channel_monitor_data['data']['TX3Power']['value'] + transceiver_dom_info_dict['tx4power'] = dom_channel_monitor_data['data']['TX4Power']['value'] if self.dom_rx_power_supported: - transceiver_dom_info_dict['rx1power'] = self.__convert_string_to_num( - dom_channel_monitor_data['data']['RX1Power']['value']) - transceiver_dom_info_dict['rx2power'] = self.__convert_string_to_num( - dom_channel_monitor_data['data']['RX2Power']['value']) - transceiver_dom_info_dict['rx3power'] = self.__convert_string_to_num( - dom_channel_monitor_data['data']['RX3Power']['value']) - transceiver_dom_info_dict['rx4power'] = self.__convert_string_to_num( - dom_channel_monitor_data['data']['RX4Power']['value']) - - transceiver_dom_info_dict['tx1bias'] = self.__convert_string_to_num( - dom_channel_monitor_data['data']['TX1Bias']['value']) - transceiver_dom_info_dict['tx2bias'] = self.__convert_string_to_num( - dom_channel_monitor_data['data']['TX2Bias']['value']) - transceiver_dom_info_dict['tx3bias'] = self.__convert_string_to_num( - dom_channel_monitor_data['data']['TX3Bias']['value']) - transceiver_dom_info_dict['tx4bias'] = self.__convert_string_to_num( - dom_channel_monitor_data['data']['TX4Bias']['value']) + transceiver_dom_info_dict['rx1power'] = dom_channel_monitor_data['data']['RX1Power']['value'] + transceiver_dom_info_dict['rx2power'] = dom_channel_monitor_data['data']['RX2Power']['value'] + transceiver_dom_info_dict['rx3power'] = dom_channel_monitor_data['data']['RX3Power']['value'] + transceiver_dom_info_dict['rx4power'] = dom_channel_monitor_data['data']['RX4Power']['value'] + + transceiver_dom_info_dict['tx1bias'] = dom_channel_monitor_data['data']['TX1Bias']['value'] + transceiver_dom_info_dict['tx2bias'] = dom_channel_monitor_data['data']['TX2Bias']['value'] + transceiver_dom_info_dict['tx3bias'] = dom_channel_monitor_data['data']['TX3Bias']['value'] + transceiver_dom_info_dict['tx4bias'] = dom_channel_monitor_data['data']['TX4Bias']['value'] + + elif self.sfp_type == QSFP_DD_TYPE: + + offset = 0 + sfpd_obj = qsfp_dd_Dom() + if sfpd_obj is None: + return transceiver_dom_info_dict + + dom_data_raw = self._read_eeprom_specific_bytes( + (offset + QSFP_DD_DOM_BULK_DATA_START), QSFP_DD_DOM_BULK_DATA_SIZE) + if dom_data_raw is None: + return transceiver_dom_info_dict + + if self.dom_temp_supported: + start = QSFP_DD_TEMPE_OFFSET - QSFP_DD_DOM_BULK_DATA_START + end = start + QSFP_DD_TEMPE_WIDTH + dom_temperature_data = sfpd_obj.parse_temperature( + dom_data_raw[start: end], 0) + temp = dom_temperature_data['data']['Temperature']['value'] + if temp is not None: + transceiver_dom_info_dict['temperature'] = temp + + if self.dom_volt_supported: + start = QSFP_DD_VOLT_OFFSET - QSFP_DD_DOM_BULK_DATA_START + end = start + QSFP_DD_VOLT_WIDTH + dom_voltage_data = sfpd_obj.parse_voltage( + dom_data_raw[start: end], 0) + volt = dom_voltage_data['data']['Vcc']['value'] + if volt is not None: + transceiver_dom_info_dict['voltage'] = volt + + if self.dom_rx_tx_power_bias_supported: + # page 11h + dom_data_raw = self._read_eeprom_specific_bytes( + (QSFP_DD_CHANNL_MON_OFFSET), QSFP_DD_CHANNL_MON_WIDTH) + if dom_data_raw is None: + return transceiver_dom_info_dict + dom_channel_monitor_data = sfpd_obj.parse_channel_monitor_params( + dom_data_raw, 0) + + if self.dom_tx_power_supported: + transceiver_dom_info_dict['tx1power'] = str( + dom_channel_monitor_data['data']['TX1Power']['value']) + transceiver_dom_info_dict['tx2power'] = str( + dom_channel_monitor_data['data']['TX2Power']['value']) + transceiver_dom_info_dict['tx3power'] = str( + dom_channel_monitor_data['data']['TX3Power']['value']) + transceiver_dom_info_dict['tx4power'] = str( + dom_channel_monitor_data['data']['TX4Power']['value']) + transceiver_dom_info_dict['tx5power'] = str( + dom_channel_monitor_data['data']['TX5Power']['value']) + transceiver_dom_info_dict['tx6power'] = str( + dom_channel_monitor_data['data']['TX6Power']['value']) + transceiver_dom_info_dict['tx7power'] = str( + dom_channel_monitor_data['data']['TX7Power']['value']) + transceiver_dom_info_dict['tx8power'] = str( + dom_channel_monitor_data['data']['TX8Power']['value']) + + if self.dom_rx_power_supported: + transceiver_dom_info_dict['rx1power'] = str( + dom_channel_monitor_data['data']['RX1Power']['value']) + transceiver_dom_info_dict['rx2power'] = str( + dom_channel_monitor_data['data']['RX2Power']['value']) + transceiver_dom_info_dict['rx3power'] = str( + dom_channel_monitor_data['data']['RX3Power']['value']) + transceiver_dom_info_dict['rx4power'] = str( + dom_channel_monitor_data['data']['RX4Power']['value']) + transceiver_dom_info_dict['rx5power'] = str( + dom_channel_monitor_data['data']['RX5Power']['value']) + transceiver_dom_info_dict['rx6power'] = str( + dom_channel_monitor_data['data']['RX6Power']['value']) + transceiver_dom_info_dict['rx7power'] = str( + dom_channel_monitor_data['data']['RX7Power']['value']) + transceiver_dom_info_dict['rx8power'] = str( + dom_channel_monitor_data['data']['RX8Power']['value']) + + if self.dom_tx_bias_power_supported: + transceiver_dom_info_dict['tx1bias'] = str( + dom_channel_monitor_data['data']['TX1Bias']['value']) + transceiver_dom_info_dict['tx2bias'] = str( + dom_channel_monitor_data['data']['TX2Bias']['value']) + transceiver_dom_info_dict['tx3bias'] = str( + dom_channel_monitor_data['data']['TX3Bias']['value']) + transceiver_dom_info_dict['tx4bias'] = str( + dom_channel_monitor_data['data']['TX4Bias']['value']) + transceiver_dom_info_dict['tx5bias'] = str( + dom_channel_monitor_data['data']['TX5Bias']['value']) + transceiver_dom_info_dict['tx6bias'] = str( + dom_channel_monitor_data['data']['TX6Bias']['value']) + transceiver_dom_info_dict['tx7bias'] = str( + dom_channel_monitor_data['data']['TX7Bias']['value']) + transceiver_dom_info_dict['tx8bias'] = str( + dom_channel_monitor_data['data']['TX8Bias']['value']) + + return transceiver_dom_info_dict else: if not self.dom_supported: @@ -661,7 +1066,7 @@ def get_transceiver_bulk_status(self): return transceiver_dom_info_dict sfpd_obj._calibration_type = self.calibration - dom_data_raw = self.__read_eeprom_specific_bytes( + dom_data_raw = self._read_eeprom_specific_bytes( (offset + SFP_DOM_BULK_DATA_START), SFP_DOM_BULK_DATA_SIZE) start = SFP_TEMPE_OFFSET - SFP_DOM_BULK_DATA_START @@ -679,27 +1084,29 @@ def get_transceiver_bulk_status(self): dom_channel_monitor_data = sfpd_obj.parse_channel_monitor_params( dom_data_raw[start: end], 0) - transceiver_dom_info_dict['temperature'] = self.__convert_string_to_num( - dom_temperature_data['data']['Temperature']['value']) - transceiver_dom_info_dict['voltage'] = self.__convert_string_to_num( - dom_voltage_data['data']['Vcc']['value']) - transceiver_dom_info_dict['rx1power'] = self.__convert_string_to_num( - dom_channel_monitor_data['data']['RXPower']['value']) - transceiver_dom_info_dict['tx1bias'] = self.__convert_string_to_num( - dom_channel_monitor_data['data']['TXBias']['value']) - transceiver_dom_info_dict['tx1power'] = self.__convert_string_to_num( - dom_channel_monitor_data['data']['TXPower']['value']) - - transceiver_dom_info_dict['rx_los'] = self.get_rx_los() - transceiver_dom_info_dict['tx_fault'] = self.get_tx_fault() - transceiver_dom_info_dict['reset_status'] = self.get_reset_status() + transceiver_dom_info_dict['temperature'] = dom_temperature_data['data']['Temperature']['value'] + transceiver_dom_info_dict['voltage'] = dom_voltage_data['data']['Vcc']['value'] + transceiver_dom_info_dict['rx1power'] = dom_channel_monitor_data['data']['RXPower']['value'] + transceiver_dom_info_dict['tx1bias'] = dom_channel_monitor_data['data']['TXBias']['value'] + transceiver_dom_info_dict['tx1power'] = dom_channel_monitor_data['data']['TXPower']['value'] + transceiver_dom_info_dict['lp_mode'] = self.get_lpmode() + transceiver_dom_info_dict['reset_status'] = self.get_reset_status() + transceiver_dom_info_dict['tx_disable'] = self.get_tx_disable() + transceiver_dom_info_dict['tx_disabled_channel'] = self.get_tx_disable_channel( + ) + + for key in transceiver_dom_info_dict: + val = transceiver_dom_info_dict[key] + transceiver_dom_info_dict[key] = self._convert_string_to_num( + val) if type(val) is str else val return transceiver_dom_info_dict def get_transceiver_threshold_info(self): """ Retrieves transceiver threshold info of this SFP + Returns: A dict which contains following keys/values : ======================================================================== @@ -728,7 +1135,7 @@ def get_transceiver_threshold_info(self): ======================================================================== """ transceiver_dom_threshold_info_dict = dict.fromkeys( - self.threshold_dict_keys, 'N/A') + threshold_dict_keys, NULL_VAL) if self.sfp_type == OSFP_TYPE: pass @@ -744,7 +1151,7 @@ def get_transceiver_threshold_info(self): if sfpd_obj is None: return transceiver_dom_threshold_info_dict - dom_module_threshold_raw = self.__read_eeprom_specific_bytes( + dom_module_threshold_raw = self._read_eeprom_specific_bytes( (offset + QSFP_MODULE_THRESHOLD_OFFSET), QSFP_MODULE_THRESHOLD_WIDTH) if dom_module_threshold_raw is None: return transceiver_dom_threshold_info_dict @@ -752,8 +1159,8 @@ def get_transceiver_threshold_info(self): dom_module_threshold_data = sfpd_obj.parse_module_threshold_values( dom_module_threshold_raw, 0) - dom_channel_threshold_raw = self.__read_eeprom_specific_bytes((offset + QSFP_CHANNL_THRESHOLD_OFFSET), - QSFP_CHANNL_THRESHOLD_WIDTH) + dom_channel_threshold_raw = self._read_eeprom_specific_bytes((offset + QSFP_CHANNL_THRESHOLD_OFFSET), + QSFP_CHANNL_THRESHOLD_WIDTH) if dom_channel_threshold_raw is None: return transceiver_dom_threshold_info_dict dom_channel_threshold_data = sfpd_obj.parse_channel_threshold_values( @@ -781,6 +1188,49 @@ def get_transceiver_threshold_info(self): transceiver_dom_threshold_info_dict['txpowerlowalarm'] = dom_channel_threshold_data['data']['TxPowerLowAlarm']['value'] transceiver_dom_threshold_info_dict['txpowerlowwarning'] = dom_channel_threshold_data['data']['TxPowerLowWarning']['value'] + elif self.sfp_type == QSFP_DD_TYPE: + if not self.dom_supported: + return transceiver_dom_threshold_info_dict + + if not self.dom_thresholds_supported: + return transceiver_dom_threshold_info_dict + + sfpd_obj = qsfp_dd_Dom() + if sfpd_obj is None: + return transceiver_dom_threshold_info_dict + + # page 02 + offset = 384 + dom_module_threshold_raw = self._read_eeprom_specific_bytes( + (offset + QSFP_DD_MODULE_THRESHOLD_OFFSET), QSFP_DD_MODULE_THRESHOLD_WIDTH) + if dom_module_threshold_raw is None: + return transceiver_dom_threshold_info_dict + + dom_module_threshold_data = sfpd_obj.parse_module_threshold_values( + dom_module_threshold_raw, 0) + + # Threshold Data + transceiver_dom_threshold_info_dict['temphighalarm'] = dom_module_threshold_data['data']['TempHighAlarm']['value'] + transceiver_dom_threshold_info_dict['temphighwarning'] = dom_module_threshold_data['data']['TempHighWarning']['value'] + transceiver_dom_threshold_info_dict['templowalarm'] = dom_module_threshold_data['data']['TempLowAlarm']['value'] + transceiver_dom_threshold_info_dict['templowwarning'] = dom_module_threshold_data['data']['TempLowWarning']['value'] + transceiver_dom_threshold_info_dict['vcchighalarm'] = dom_module_threshold_data['data']['VccHighAlarm']['value'] + transceiver_dom_threshold_info_dict['vcchighwarning'] = dom_module_threshold_data['data']['VccHighWarning']['value'] + transceiver_dom_threshold_info_dict['vcclowalarm'] = dom_module_threshold_data['data']['VccLowAlarm']['value'] + transceiver_dom_threshold_info_dict['vcclowwarning'] = dom_module_threshold_data['data']['VccLowWarning']['value'] + transceiver_dom_threshold_info_dict['rxpowerhighalarm'] = dom_module_threshold_data['data']['RxPowerHighAlarm']['value'] + transceiver_dom_threshold_info_dict['rxpowerhighwarning'] = dom_module_threshold_data['data']['RxPowerHighWarning']['value'] + transceiver_dom_threshold_info_dict['rxpowerlowalarm'] = dom_module_threshold_data['data']['RxPowerLowAlarm']['value'] + transceiver_dom_threshold_info_dict['rxpowerlowwarning'] = dom_module_threshold_data['data']['RxPowerLowWarning']['value'] + transceiver_dom_threshold_info_dict['txbiashighalarm'] = dom_module_threshold_data['data']['TxBiasHighAlarm']['value'] + transceiver_dom_threshold_info_dict['txbiashighwarning'] = dom_module_threshold_data['data']['TxBiasHighWarning']['value'] + transceiver_dom_threshold_info_dict['txbiaslowalarm'] = dom_module_threshold_data['data']['TxBiasLowAlarm']['value'] + transceiver_dom_threshold_info_dict['txbiaslowwarning'] = dom_module_threshold_data['data']['TxBiasLowWarning']['value'] + transceiver_dom_threshold_info_dict['txpowerhighalarm'] = dom_module_threshold_data['data']['TxPowerHighAlarm']['value'] + transceiver_dom_threshold_info_dict['txpowerhighwarning'] = dom_module_threshold_data['data']['TxPowerHighWarning']['value'] + transceiver_dom_threshold_info_dict['txpowerlowalarm'] = dom_module_threshold_data['data']['TxPowerLowAlarm']['value'] + transceiver_dom_threshold_info_dict['txpowerlowwarning'] = dom_module_threshold_data['data']['TxPowerLowWarning']['value'] + else: offset = SFP_MODULE_ADDRA2_OFFSET @@ -791,8 +1241,8 @@ def get_transceiver_threshold_info(self): if sfpd_obj is None: return transceiver_dom_threshold_info_dict - dom_module_threshold_raw = self.__read_eeprom_specific_bytes((offset + SFP_MODULE_THRESHOLD_OFFSET), - SFP_MODULE_THRESHOLD_WIDTH) + dom_module_threshold_raw = self._read_eeprom_specific_bytes((offset + SFP_MODULE_THRESHOLD_OFFSET), + SFP_MODULE_THRESHOLD_WIDTH) if dom_module_threshold_raw is not None: dom_module_threshold_data = sfpd_obj.parse_alarm_warning_threshold( dom_module_threshold_raw, 0) @@ -823,7 +1273,7 @@ def get_transceiver_threshold_info(self): transceiver_dom_threshold_info_dict['rxpowerlowwarning'] = dom_module_threshold_data['data']['RXPowerLowWarning']['value'] for key in transceiver_dom_threshold_info_dict: - transceiver_dom_threshold_info_dict[key] = self.__convert_string_to_num( + transceiver_dom_threshold_info_dict[key] = self._convert_string_to_num( transceiver_dom_threshold_info_dict[key]) return transceiver_dom_threshold_info_dict @@ -834,13 +1284,14 @@ def get_reset_status(self): Returns: A Boolean, True if reset enabled, False if disabled """ - reset_status_raw = self._api_helper.read_txt_file(self.RESET_PATH).rstrip() + reset_status_raw = self._api_helper.read_txt_file( + self.RESET_PATH).rstrip() if not reset_status_raw: return False reg_value = int(reset_status_raw, 16) bin_format = bin(reg_value)[2:].zfill(32) - return bin_format[::-1][self.index] == '0' + return bin_format[::-1][self._index] == '0' def get_rx_los(self): """ @@ -849,30 +1300,53 @@ def get_rx_los(self): A Boolean, True if SFP has RX LOS, False if not. Note : RX LOS status is latched until a call to get_rx_los or a reset. """ - rx_los = False - if self.sfp_type == OSFP_TYPE: - return False + rx_los_list = [] + if self.sfp_type == OSFP_TYPE: + return None elif self.sfp_type == QSFP_TYPE: offset = 0 - dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( - (offset + QSFP_CHANNL_RX_LOS_STATUS_OFFSET), QSFP_CHANNL_RX_LOS_STATUS_WIDTH) + dom_channel_monitor_raw = self._read_eeprom_specific_bytes( + (offset + QSFP_CHANNL_RX_LOS_STATUS_OFFSET), + QSFP_CHANNL_RX_LOS_STATUS_WIDTH) if dom_channel_monitor_raw is not None: rx_los_data = int(dom_channel_monitor_raw[0], 16) - rx1_los = (rx_los_data & 0x01 != 0) - rx2_los = (rx_los_data & 0x02 != 0) - rx3_los = (rx_los_data & 0x04 != 0) - rx4_los = (rx_los_data & 0x08 != 0) - rx_los = (rx1_los and rx2_los and rx3_los and rx4_los) + rx_los_list.append(rx_los_data & 0x01 != 0) + rx_los_list.append(rx_los_data & 0x02 != 0) + rx_los_list.append(rx_los_data & 0x04 != 0) + rx_los_list.append(rx_los_data & 0x08 != 0) + else: + return [False] * 4 + + elif self.sfp_type == QSFP_DD_TYPE: + # page 11h + if self.dom_rx_tx_power_bias_supported: + offset = 128 + dom_channel_monitor_raw = self._read_eeprom_specific_bytes( + (offset + QSFP_DD_CHANNL_RX_LOS_STATUS_OFFSET), + QSFP_DD_CHANNL_RX_LOS_STATUS_WIDTH) + if dom_channel_monitor_raw is not None: + rx_los_data = int(dom_channel_monitor_raw[0], 8) + rx_los_list.append(rx_los_data & 0x01 != 0) + rx_los_list.append(rx_los_data & 0x02 != 0) + rx_los_list.append(rx_los_data & 0x04 != 0) + rx_los_list.append(rx_los_data & 0x08 != 0) + rx_los_list.append(rx_los_data & 0x10 != 0) + rx_los_list.append(rx_los_data & 0x20 != 0) + rx_los_list.append(rx_los_data & 0x40 != 0) + rx_los_list.append(rx_los_data & 0x80 != 0) + else: + return [False] * 8 else: offset = 256 - dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + dom_channel_monitor_raw = self._read_eeprom_specific_bytes( (offset + SFP_CHANNL_STATUS_OFFSET), SFP_CHANNL_STATUS_WIDTH) if dom_channel_monitor_raw is not None: rx_los_data = int(dom_channel_monitor_raw[0], 16) - rx_los = (rx_los_data & 0x02 != 0) - - return rx_los + rx_los_list.append(rx_los_data & 0x02 != 0) + else: + return [False] + return rx_los_list def get_tx_fault(self): """ @@ -881,66 +1355,107 @@ def get_tx_fault(self): A Boolean, True if SFP has TX fault, False if not Note : TX fault status is lached until a call to get_tx_fault or a reset. """ - tx4_fault = False - - if self.sfp_type == OSFP_TYPE or not self.dom_supported: - return False + tx_fault_list = [] + if self.sfp_type == OSFP_TYPE: + return None elif self.sfp_type == QSFP_TYPE: offset = 0 - dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( - (offset + QSFP_CHANNL_TX_FAULT_STATUS_OFFSET), QSFP_CHANNL_TX_FAULT_STATUS_WIDTH) + dom_channel_monitor_raw = self._read_eeprom_specific_bytes( + (offset + QSFP_CHANNL_TX_FAULT_STATUS_OFFSET), + QSFP_CHANNL_TX_FAULT_STATUS_WIDTH) if dom_channel_monitor_raw is not None: tx_fault_data = int(dom_channel_monitor_raw[0], 16) - tx1_fault = (tx_fault_data & 0x01 != 0) - tx2_fault = (tx_fault_data & 0x02 != 0) - tx3_fault = (tx_fault_data & 0x04 != 0) - tx4_fault = (tx_fault_data & 0x08 != 0) - tx4_fault = ( - tx1_fault and tx2_fault and tx3_fault and tx4_fault) + tx_fault_list.append(tx_fault_data & 0x01 != 0) + tx_fault_list.append(tx_fault_data & 0x02 != 0) + tx_fault_list.append(tx_fault_data & 0x04 != 0) + tx_fault_list.append(tx_fault_data & 0x08 != 0) + else: + return [False] * 4 + elif self.sfp_type == QSFP_DD_TYPE: + # page 11h + if self.dom_rx_tx_power_bias_supported: + offset = 128 + dom_channel_monitor_raw = self._read_eeprom_specific_bytes( + (offset + QSFP_DD_CHANNL_TX_FAULT_STATUS_OFFSET), + QSFP_DD_CHANNL_TX_FAULT_STATUS_WIDTH) + if dom_channel_monitor_raw is not None: + tx_fault_data = int(dom_channel_monitor_raw[0], 8) + tx_fault_list.append(tx_fault_data & 0x01 != 0) + tx_fault_list.append(tx_fault_data & 0x02 != 0) + tx_fault_list.append(tx_fault_data & 0x04 != 0) + tx_fault_list.append(tx_fault_data & 0x08 != 0) + tx_fault_list.append(tx_fault_data & 0x10 != 0) + tx_fault_list.append(tx_fault_data & 0x20 != 0) + tx_fault_list.append(tx_fault_data & 0x40 != 0) + tx_fault_list.append(tx_fault_data & 0x80 != 0) + else: + return [False] * 8 else: offset = 256 - dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + dom_channel_monitor_raw = self._read_eeprom_specific_bytes( (offset + SFP_CHANNL_STATUS_OFFSET), SFP_CHANNL_STATUS_WIDTH) if dom_channel_monitor_raw is not None: tx_fault_data = int(dom_channel_monitor_raw[0], 16) - tx4_fault = (tx_fault_data & 0x04 != 0) - - return tx4_fault + tx_fault_list.append(tx_fault_data & 0x04 != 0) + else: + return None + return tx_fault_list def get_tx_disable(self): """ Retrieves the tx_disable status of this SFP Returns: - A Boolean, True if tx_disable is enabled, False if disabled + A list of boolean values, representing the TX disable status + of each available channel, value is True if SFP channel + is TX disabled, False if not. + E.g., for a tranceiver with four channels: [False, False, True, False] """ - - tx_disable = False - - if self.sfp_type == OSFP_TYPE and not self.dom_supported: - return False - + tx_disable_list = [] + if self.sfp_type == OSFP_TYPE: + return None elif self.sfp_type == QSFP_TYPE: offset = 0 - dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( - (offset + QSFP_CHANNL_DISABLE_STATUS_OFFSET), QSFP_CHANNL_DISABLE_STATUS_WIDTH) + dom_channel_monitor_raw = self._read_eeprom_specific_bytes( + (offset + QSFP_CHANNL_DISABLE_STATUS_OFFSET), + QSFP_CHANNL_DISABLE_STATUS_WIDTH) if dom_channel_monitor_raw is not None: tx_disable_data = int(dom_channel_monitor_raw[0], 16) - tx1_disable = (tx_disable_data & 0x01 != 0) - tx2_disable = (tx_disable_data & 0x02 != 0) - tx3_disable = (tx_disable_data & 0x04 != 0) - tx4_disable = (tx_disable_data & 0x08 != 0) - tx_disable = ( - tx1_disable and tx2_disable and tx3_disable and tx4_disable) + tx_disable_list.append(tx_disable_data & 0x01 != 0) + tx_disable_list.append(tx_disable_data & 0x02 != 0) + tx_disable_list.append(tx_disable_data & 0x04 != 0) + tx_disable_list.append(tx_disable_data & 0x08 != 0) + else: + return [False] * 4 + + elif self.sfp_type == QSFP_DD_TYPE: + if self.dom_rx_tx_power_bias_supported: + offset = 128 + dom_channel_monitor_raw = self._read_eeprom_specific_bytes( + (offset + QSFP_DD_CHANNL_DISABLE_STATUS_OFFSET), + QSFP_DD_CHANNL_DISABLE_STATUS_WIDTH) + if dom_channel_monitor_raw is not None: + tx_disable_data = int(dom_channel_monitor_raw[0], 16) + tx_disable_list.append(tx_disable_data & 0x01 != 0) + tx_disable_list.append(tx_disable_data & 0x02 != 0) + tx_disable_list.append(tx_disable_data & 0x04 != 0) + tx_disable_list.append(tx_disable_data & 0x08 != 0) + tx_disable_list.append(tx_disable_data & 0x10 != 0) + tx_disable_list.append(tx_disable_data & 0x20 != 0) + tx_disable_list.append(tx_disable_data & 0x40 != 0) + tx_disable_list.append(tx_disable_data & 0x80 != 0) + else: + return [False] * 8 else: offset = 256 - dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + dom_channel_monitor_raw = self._read_eeprom_specific_bytes( (offset + SFP_CHANNL_STATUS_OFFSET), SFP_CHANNL_STATUS_WIDTH) if dom_channel_monitor_raw is not None: tx_disable_data = int(dom_channel_monitor_raw[0], 16) - tx_disable = (tx_disable_data & 0xC0 != 0) - - return tx_disable + tx_disable_list.append(tx_disable_data & 0xC0 != 0) + else: + return [False] + return tx_disable_list def get_tx_disable_channel(self): """ @@ -948,32 +1463,12 @@ def get_tx_disable_channel(self): Returns: A hex of 4 bits (bit 0 to bit 3 as channel 0 to channel 3) to represent TX channels which have been disabled in this SFP. - As an example, a returned value of 0x5 indicates that channel 0 + As an example, a returned value of 0x5 indicates that channel 0 and channel 2 have been disabled. """ - tx_disable_list = [False, False, False, False] - - if self.sfp_type == OSFP_TYPE: - pass - - elif self.sfp_type == QSFP_TYPE: - offset = 0 - dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( - (offset + QSFP_CHANNL_DISABLE_STATUS_OFFSET), QSFP_CHANNL_DISABLE_STATUS_WIDTH) - if dom_channel_monitor_raw is not None: - tx_disable_data = int(dom_channel_monitor_raw[0], 16) - tx_disable_list[0] = (tx_disable_data & 0x01 != 0) - tx_disable_list[1] = (tx_disable_data & 0x02 != 0) - tx_disable_list[2] = (tx_disable_data & 0x04 != 0) - tx_disable_list[3] = (tx_disable_data & 0x08 != 0) - else: - offset = 256 - dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( - (offset + SFP_CHANNL_STATUS_OFFSET), SFP_CHANNL_STATUS_WIDTH) - if dom_channel_monitor_raw is not None: - tx_disable_data = int(dom_channel_monitor_raw[0], 16) - tx_disable_list[0] = (tx_disable_data & 0xC0 != 0) - + tx_disable_list = self.get_tx_disable() + if tx_disable_list is None: + return 0 tx_disabled = 0 for i in range(len(tx_disable_list)): if tx_disable_list[i]: @@ -997,7 +1492,7 @@ def get_lpmode(self): reg_value = int(content, 16) # Determind if port_num start from 1 or 0 - bit_index = self.index + bit_index = self._index # Mask off the bit corresponding to our port mask = (1 << bit_index) @@ -1020,16 +1515,16 @@ def get_power_override(self): if sfpd_obj is None: return False - dom_control_raw = self.__read_eeprom_specific_bytes( - QSFP_CONTROL_OFFSET, QSFP_CONTROL_WIDTH) if self.get_presence() else None + dom_control_raw = self._read_eeprom_specific_bytes( + (offset + QSFP_CONTROL_OFFSET), QSFP_CONTROL_WIDTH) if dom_control_raw is not None: dom_control_data = sfpd_obj.parse_control_bytes( dom_control_raw, 0) - power_override = ( - 'On' == dom_control_data['data']['PowerOverride']['value']) - return power_override + return ('On' == dom_control_data['data']['PowerOverride']['value']) + else: + return False else: - return False + return NotImplementedError def get_temperature(self): """ @@ -1037,8 +1532,61 @@ def get_temperature(self): Returns: An integer number of current temperature in Celsius """ - transceiver_bulk_status = self.get_transceiver_bulk_status() - return transceiver_bulk_status.get("temperature", "N/A") + default = 0.0 + if not self.dom_supported: + return default + + if self.sfp_type == QSFP_TYPE: + offset = 0 + + sfpd_obj = sff8436Dom() + if sfpd_obj is None: + return default + + if self.dom_temp_supported: + dom_temperature_raw = self._read_eeprom_specific_bytes( + (offset + QSFP_TEMPE_OFFSET), QSFP_TEMPE_WIDTH) + if dom_temperature_raw is not None: + dom_temperature_data = sfpd_obj.parse_temperature( + dom_temperature_raw, 0) + temp = self._convert_string_to_num( + dom_temperature_data['data']['Temperature']['value']) + return temp + + elif self.sfp_type == QSFP_DD_TYPE: + offset = 0 + + sfpd_obj = qsfp_dd_Dom() + if sfpd_obj is None: + return default + + if self.dom_temp_supported: + dom_temperature_raw = self._read_eeprom_specific_bytes( + (offset + QSFP_DD_TEMPE_OFFSET), QSFP_DD_TEMPE_WIDTH) + if dom_temperature_raw is not None: + dom_temperature_data = sfpd_obj.parse_temperature( + dom_temperature_raw, 0) + temp = self._convert_string_to_num( + dom_temperature_data['data']['Temperature']['value']) + return temp + + else: + offset = 256 + sfpd_obj = sff8472Dom() + if sfpd_obj is None: + return default + sfpd_obj._calibration_type = 1 + + dom_temperature_raw = self._read_eeprom_specific_bytes( + (offset + SFP_TEMPE_OFFSET), SFP_TEMPE_WIDTH) + if dom_temperature_raw is not None: + dom_temperature_data = sfpd_obj.parse_temperature( + dom_temperature_raw, 0) + temp = self._convert_string_to_num( + dom_temperature_data['data']['Temperature']['value']) + return temp + + return default def get_voltage(self): """ @@ -1046,8 +1594,62 @@ def get_voltage(self): Returns: An integer number of supply voltage in mV """ - transceiver_bulk_status = self.get_transceiver_bulk_status() - return transceiver_bulk_status.get("voltage", "N/A") + default = 0.0 + + if not self.dom_supported: + return default + + if self.sfp_type == QSFP_TYPE: + offset = 0 + sfpd_obj = sff8436Dom() + if sfpd_obj is None: + return default + + if self.dom_volt_supported: + dom_voltage_raw = self._read_eeprom_specific_bytes( + (offset + QSFP_VOLT_OFFSET), QSFP_VOLT_WIDTH) + if dom_voltage_raw is not None: + dom_voltage_data = sfpd_obj.parse_voltage( + dom_voltage_raw, 0) + voltage = self._convert_string_to_num( + dom_voltage_data['data']['Vcc']['value']) + return voltage + + if self.sfp_type == QSFP_DD_TYPE: + offset = 128 + + sfpd_obj = qsfp_dd_Dom() + if sfpd_obj is None: + return default + + if self.dom_volt_supported: + dom_voltage_raw = self._read_eeprom_specific_bytes( + (offset + QSFP_DD_VOLT_OFFSET), QSFP_DD_VOLT_WIDTH) + if dom_voltage_raw is not None: + dom_voltage_data = sfpd_obj.parse_voltage( + dom_voltage_raw, 0) + voltage = self._convert_string_to_num( + dom_voltage_data['data']['Vcc']['value']) + return voltage + + else: + offset = 256 + + sfpd_obj = sff8472Dom() + if sfpd_obj is None: + return default + + sfpd_obj._calibration_type = self.calibration + + dom_voltage_raw = self._read_eeprom_specific_bytes( + (offset + SFP_VOLT_OFFSET), SFP_VOLT_WIDTH) + if dom_voltage_raw is not None: + dom_voltage_data = sfpd_obj.parse_voltage(dom_voltage_raw, 0) + voltage = self._convert_string_to_num( + dom_voltage_data['data']['Vcc']['value']) + return voltage + + return default def get_tx_bias(self): """ @@ -1057,12 +1659,87 @@ def get_tx_bias(self): for channel 0 to channel 4. Ex. ['110.09', '111.12', '108.21', '112.09'] """ - transceiver_bulk_status = self.get_transceiver_bulk_status() - tx1_bs = transceiver_bulk_status.get("tx1bias", "N/A") - tx2_bs = transceiver_bulk_status.get("tx2bias", "N/A") - tx3_bs = transceiver_bulk_status.get("tx3bias", "N/A") - tx4_bs = transceiver_bulk_status.get("tx4bias", "N/A") - tx_bias_list = [tx1_bs, tx2_bs, tx3_bs, tx4_bs] + tx_bias_list = [] + if self.sfp_type == QSFP_TYPE: + offset = 0 + default = [0.0] * 4 + sfpd_obj = sff8436Dom() + if sfpd_obj is None: + return default + + dom_channel_monitor_raw = self._read_eeprom_specific_bytes( + (offset + QSFP_CHANNL_MON_OFFSET), QSFP_CHANNL_MON_WITH_TX_POWER_WIDTH) + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = sfpd_obj.parse_channel_monitor_params_with_tx_power( + dom_channel_monitor_raw, 0) + tx_bias_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TX1Bias']['value'])) + tx_bias_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TX2Bias']['value'])) + tx_bias_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TX3Bias']['value'])) + tx_bias_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TX4Bias']['value'])) + else: + return default + + elif self.sfp_type == QSFP_DD_TYPE: + default = [0.0] * 8 + # page 11h + if self.dom_rx_tx_power_bias_supported: + offset = 128 + sfpd_obj = qsfp_dd_Dom() + if sfpd_obj is None: + return default + + if dom_tx_bias_power_supported: + dom_tx_bias_raw = self._read_eeprom_specific_bytes( + (offset + QSFP_DD_TX_BIAS_OFFSET), QSFP_DD_TX_BIAS_WIDTH) + if dom_tx_bias_raw is not None: + dom_tx_bias_data = sfpd_obj.parse_dom_tx_bias( + dom_tx_bias_raw, 0) + tx_bias_list.append(self._convert_string_to_num( + dom_tx_bias_data['data']['TX1Bias']['value'])) + tx_bias_list.append(self._convert_string_to_num( + dom_tx_bias_data['data']['TX2Bias']['value'])) + tx_bias_list.append(self._convert_string_to_num( + dom_tx_bias_data['data']['TX3Bias']['value'])) + tx_bias_list.append(self._convert_string_to_num( + dom_tx_bias_data['data']['TX4Bias']['value'])) + tx_bias_list.append(self._convert_string_to_num( + dom_tx_bias_data['data']['TX5Bias']['value'])) + tx_bias_list.append(self._convert_string_to_num( + dom_tx_bias_data['data']['TX6Bias']['value'])) + tx_bias_list.append(self._convert_string_to_num( + dom_tx_bias_data['data']['TX7Bias']['value'])) + tx_bias_list.append(self._convert_string_to_num( + dom_tx_bias_data['data']['TX8Bias']['value'])) + else: + return default + else: + return default + + else: + offset = 256 + default = [0.0] + sfpd_obj = sff8472Dom() + if sfpd_obj is None: + return default + sfpd_obj._calibration_type = self.calibration + + if self.dom_supported: + dom_channel_monitor_raw = self._read_eeprom_specific_bytes( + (offset + SFP_CHANNL_MON_OFFSET), SFP_CHANNL_MON_WIDTH) + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = sfpd_obj.parse_channel_monitor_params( + dom_channel_monitor_raw, 0) + tx_bias_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TXBias']['value'])) + else: + return default + else: + return default + return tx_bias_list def get_rx_power(self): @@ -1074,12 +1751,93 @@ def get_rx_power(self): Ex. ['1.77', '1.71', '1.68', '1.70'] """ rx_power_list = [] - transceiver_bulk_status = self.get_transceiver_bulk_status() - rx1_p = transceiver_bulk_status.get("rx1power", "N/A") - rx2_p = transceiver_bulk_status.get("rx2power", "N/A") - rx3_p = transceiver_bulk_status.get("rx3power", "N/A") - rx4_p = transceiver_bulk_status.get("rx4power", "N/A") - rx_power_list = [rx1_p, rx2_p, rx3_p, rx4_p] + if self.sfp_type == OSFP_TYPE: + # OSFP not supported on our platform yet. + return None + + elif self.sfp_type == QSFP_TYPE: + offset = 0 + default = [0.0] * 4 + sfpd_obj = sff8436Dom() + if sfpd_obj is None: + return default + + if self.dom_rx_power_supported: + dom_channel_monitor_raw = self._read_eeprom_specific_bytes( + (offset + QSFP_CHANNL_MON_OFFSET), QSFP_CHANNL_MON_WITH_TX_POWER_WIDTH) + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = sfpd_obj.parse_channel_monitor_params_with_tx_power( + dom_channel_monitor_raw, 0) + rx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['RX1Power']['value'])) + rx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['RX2Power']['value'])) + rx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['RX3Power']['value'])) + rx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['RX4Power']['value'])) + else: + return default + else: + return default + + elif self.sfp_type == QSFP_DD_TYPE: + default = [0.0] * 8 + # page 11 + if self.dom_rx_tx_power_bias_supported: + offset = 128 + sfpd_obj = qsfp_dd_Dom() + if sfpd_obj is None: + return default + + if self.dom_rx_power_supported: + dom_rx_power_raw = self._read_eeprom_specific_bytes( + (offset + QSFP_DD_RX_POWER_OFFSET), QSFP_DD_RX_POWER_WIDTH) + if dom_rx_power_raw is not None: + dom_rx_power_data = sfpd_obj.parse_dom_rx_power( + dom_rx_power_raw, 0) + rx_power_list.append(self._convert_string_to_num( + dom_rx_power_data['data']['RX1Power']['value'])) + rx_power_list.append(self._convert_string_to_num( + dom_rx_power_data['data']['RX2Power']['value'])) + rx_power_list.append(self._convert_string_to_num( + dom_rx_power_data['data']['RX3Power']['value'])) + rx_power_list.append(self._convert_string_to_num( + dom_rx_power_data['data']['RX4Power']['value'])) + rx_power_list.append(self._convert_string_to_num( + dom_rx_power_data['data']['RX5Power']['value'])) + rx_power_list.append(self._convert_string_to_num( + dom_rx_power_data['data']['RX6Power']['value'])) + rx_power_list.append(self._convert_string_to_num( + dom_rx_power_data['data']['RX7Power']['value'])) + rx_power_list.append(self._convert_string_to_num( + dom_rx_power_data['data']['RX8Power']['value'])) + else: + return default + else: + return default + + else: + offset = 256 + default = [0.0] + sfpd_obj = sff8472Dom() + if sfpd_obj is None: + return default + + if self.dom_supported: + sfpd_obj._calibration_type = self.calibration + + dom_channel_monitor_raw = self._read_eeprom_specific_bytes( + (offset + SFP_CHANNL_MON_OFFSET), SFP_CHANNL_MON_WIDTH) + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = sfpd_obj.parse_channel_monitor_params( + dom_channel_monitor_raw, 0) + rx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['RXPower']['value'])) + else: + return default + else: + return default return rx_power_list def get_tx_power(self): @@ -1091,12 +1849,97 @@ def get_tx_power(self): Ex. ['1.86', '1.86', '1.86', '1.86'] """ tx_power_list = [] - transceiver_bulk_status = self.get_transceiver_bulk_status() - tx1_p = transceiver_bulk_status.get("tx1power", "N/A") - tx2_p = transceiver_bulk_status.get("tx2power", "N/A") - tx3_p = transceiver_bulk_status.get("tx3power", "N/A") - tx4_p = transceiver_bulk_status.get("tx4power", "N/A") - tx_power_list = [tx1_p, tx2_p, tx3_p, tx4_p] + if self.sfp_type == OSFP_TYPE: + # OSFP not supported on our platform yet. + return tx_power_list + + elif self.sfp_type == QSFP_TYPE: + offset = 0 + default = [0.0] * 4 + + sfpd_obj = sff8436Dom() + if sfpd_obj is None: + return tx_power_list + + if self.dom_tx_power_supported: + dom_channel_monitor_raw = self._read_eeprom_specific_bytes( + (offset + QSFP_CHANNL_MON_OFFSET), + QSFP_CHANNL_MON_WITH_TX_POWER_WIDTH) + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = sfpd_obj.parse_channel_monitor_params_with_tx_power( + dom_channel_monitor_raw, 0) + tx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TX1Power']['value'])) + tx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TX2Power']['value'])) + tx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TX3Power']['value'])) + tx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TX4Power']['value'])) + else: + return default + else: + return default + + elif self.sfp_type == QSFP_DD_TYPE: + default = [0.0] * 8 + + # page 11 + if self.dom_rx_tx_power_bias_supported: + offset = 128 + sfpd_obj = qsfp_dd_Dom() + if sfpd_obj is None: + return default + + if self.dom_tx_power_supported: + dom_tx_power_raw = self._read_eeprom_specific_bytes( + (offset + QSFP_DD_TX_POWER_OFFSET), + QSFP_DD_TX_POWER_WIDTH) + if dom_tx_power_raw is not None: + dom_tx_power_data = sfpd_obj.parse_dom_tx_power( + dom_tx_power_raw, 0) + tx_power_list.append(self._convert_string_to_num( + dom_tx_power_data['data']['TX1Power']['value'])) + tx_power_list.append(self._convert_string_to_num( + dom_tx_power_data['data']['TX2Power']['value'])) + tx_power_list.append(self._convert_string_to_num( + dom_tx_power_data['data']['TX3Power']['value'])) + tx_power_list.append(self._convert_string_to_num( + dom_tx_power_data['data']['TX4Power']['value'])) + tx_power_list.append(self._convert_string_to_num( + dom_tx_power_data['data']['TX5Power']['value'])) + tx_power_list.append(self._convert_string_to_num( + dom_tx_power_data['data']['TX6Power']['value'])) + tx_power_list.append(self._convert_string_to_num( + dom_tx_power_data['data']['TX7Power']['value'])) + tx_power_list.append(self._convert_string_to_num( + dom_tx_power_data['data']['TX8Power']['value'])) + else: + return default + else: + return default + + else: + offset = 256 + default = [0.0] + sfpd_obj = sff8472Dom() + if sfpd_obj is None: + return default + + if self.dom_supported: + sfpd_obj._calibration_type = self.calibration + + dom_channel_monitor_raw = self._read_eeprom_specific_bytes( + (offset + SFP_CHANNL_MON_OFFSET), SFP_CHANNL_MON_WIDTH) + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = sfpd_obj.parse_channel_monitor_params( + dom_channel_monitor_raw, 0) + tx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TXPower']['value'])) + else: + return default + else: + return default return tx_power_list def reset(self): @@ -1120,7 +1963,7 @@ def reset(self): reg_value = int(content, 16) # Determind if port_num start from 1 or 0 - bit_index = self.index + bit_index = self._index # Mask off the bit corresponding to our port mask = (1 << bit_index) @@ -1162,16 +2005,12 @@ def tx_disable(self, tx_disable): if self.sfp_type == QSFP_TYPE: sysfsfile_eeprom = None try: - tx_disable_ctl = 0xf if tx_disable else 0x0 - buffer = create_string_buffer(1) - buffer[0] = chr(tx_disable_ctl) + tx_disable_value = 0xf if tx_disable else 0x0 # Write to eeprom - sysfsfile_eeprom = open( - self.port_to_eeprom_mapping[self.port_num], "r+b") + sysfsfile_eeprom = open(self._eeprom_path, "r+b") sysfsfile_eeprom.seek(QSFP_CONTROL_OFFSET) - sysfsfile_eeprom.write(buffer[0]) - except IOError as e: - #print("Error: unable to open file: %s" % str(e)) + sysfsfile_eeprom.write(struct.pack('B', tx_disable_value)) + except IOError: return False finally: if sysfsfile_eeprom is not None: @@ -1194,20 +2033,15 @@ def tx_disable_channel(self, channel, disable): if self.sfp_type == QSFP_TYPE: sysfsfile_eeprom = None try: - channel_state = self.get_tx_disable_channel() - tx_enable_mask = [0xe, 0xd, 0xb, 0x7] - tx_disable_mask = [0x1, 0x3, 0x7, 0xf] - tx_disable_ctl = channel_state | tx_disable_mask[ - channel] if disable else channel_state & tx_enable_mask[channel] - buffer = create_string_buffer(1) - buffer[0] = chr(tx_disable_ctl) + current_state = self.get_tx_disable_channel() + tx_disable_value = (current_state | channel) if \ + disable else (current_state & (~channel)) + # Write to eeprom - sysfsfile_eeprom = open( - self.port_to_eeprom_mapping[self.port_num], "r+b") + sysfsfile_eeprom = open(self._eeprom_path, "r+b") sysfsfile_eeprom.seek(QSFP_CONTROL_OFFSET) - sysfsfile_eeprom.write(buffer[0]) - except IOError as e: - #print("Error: unable to open file: %s" % str(e)) + sysfsfile_eeprom.write(struct.pack('B', tx_disable_value)) + except IOError: return False finally: if sysfsfile_eeprom is not None: @@ -1237,7 +2071,7 @@ def set_lpmode(self, lpmode): reg_value = int(content, 16) # Determind if port_num start from 1 or 0 - bit_index = self.index + bit_index = self._index # Mask off the bit corresponding to our port mask = (1 << bit_index) @@ -1270,31 +2104,24 @@ def set_power_override(self, power_override, power_set): A boolean, True if power-override and power_set are set successfully, False if not """ - if self.sfp_type == QSFP_TYPE: + sysfsfile_eeprom = None + if self.sfp_type == QSFP_TYPE and self.get_presence(): try: - power_override_bit = 0 - if power_override: - power_override_bit |= 1 << 0 - - power_set_bit = 0 - if power_set: - power_set_bit |= 1 << 1 + power_override_bit = 0x1 if power_override else 0 + power_set_bit = 0x2 if power_set else 0 + value = power_override_bit | power_set_bit - buffer = create_string_buffer(1) - buffer[0] = chr(power_override_bit | power_set_bit) # Write to eeprom - sysfsfile_eeprom = open( - self.port_to_eeprom_mapping[self.port_num], "r+b") + sysfsfile_eeprom = open(self._eeprom_path, "r+b") sysfsfile_eeprom.seek(QSFP_POWEROVERRIDE_OFFSET) - sysfsfile_eeprom.write(buffer[0]) + sysfsfile_eeprom.write(struct.pack('B', value)) except IOError as e: - #print("Error: unable to open file: %s" % str(e)) - return False + print("Error: unable to open file: %s" % str(e)) finally: if sysfsfile_eeprom is not None: sysfsfile_eeprom.close() time.sleep(0.01) - return True + return True return False ############################################################## @@ -1307,7 +2134,7 @@ def get_name(self): Returns: string: The name of the device """ - return self.name + return self._name def get_presence(self): """ @@ -1315,7 +2142,8 @@ def get_presence(self): Returns: bool: True if PSU is present, False if not """ - presence_status_raw = self._api_helper.read_txt_file(self.PRS_PATH).rstrip() + presence_status_raw = self._api_helper.read_txt_file( + self.PRS_PATH).rstrip() if not presence_status_raw: return False @@ -1323,7 +2151,7 @@ def get_presence(self): reg_value = int(content, 16) # Determind if port_num start from 1 or 0 - bit_index = self.index + bit_index = self._index # Mask off the bit corresponding to our port mask = (1 << bit_index) @@ -1359,3 +2187,31 @@ def get_status(self): A boolean value, True if device is operating properly, False if not """ return self.get_presence() and not self.get_reset_status() + + def get_position_in_parent(self): + """ + Returns: + Temp return 0 + """ + return 0 + + def is_replaceable(self): + """ + Retrieves if replaceable + Returns: + A boolean value, True if replaceable + """ + return True + + def get_error_description(self): + """ + Retrives the error descriptions of the SFP module + Returns: + String that represents the current error descriptions of vendor specific errors + In case there are multiple errors, they should be joined by '|', + like: "Bad EEPROM|Unsupported cable" + """ + if not self.get_presence(): + return self.SFP_STATUS_UNPLUGGED + + return self.SFP_STATUS_OK diff --git a/device/celestica/x86_64-cel_seastone-r0/sonic_platform/thermal.py b/device/celestica/x86_64-cel_seastone-r0/sonic_platform/thermal.py index 9e891b65e405..4b584a6db97f 100644 --- a/device/celestica/x86_64-cel_seastone-r0/sonic_platform/thermal.py +++ b/device/celestica/x86_64-cel_seastone-r0/sonic_platform/thermal.py @@ -7,7 +7,6 @@ ############################################################################# import os -import re import os.path try: @@ -16,46 +15,102 @@ except ImportError as e: raise ImportError(str(e) + "- required module not found") +THERMAL_INFO = { + 0: { + "F2B_max": 50, + "F2B_max_crit": 75, + "B2F_max": 55, + "B2F_max_crit": 75, + "postion": "asic", + "name": "Front-panel temp sensor 1", + "i2c_path": "i2c-5/5-0048/hwmon", # u4 system-inlet + }, + 1: { + "F2B_max": 50, + "F2B_max_crit": 75, + "B2F_max": 55, + "B2F_max_crit": 75, + "postion": "asic", + "name": "Front-panel temp sensor 2", + "i2c_path": "i2c-6/6-0049/hwmon", # u2 system-inlet + }, + 2: { + "F2B_max": 70, + "F2B_max_crit": 75, + "B2F_max": 60, + "B2F_max_crit": 65, + "postion": "asic", + "name": "ASIC temp sensor", + "i2c_path": "i2c-7/7-004a/hwmon", # u44 bmc56960-on-board + }, + 3: { + "F2B_max": 70, + "F2B_max_crit": 75, + "B2F_max": 70, + "B2F_max_crit": 75, + "postion": "cpu", + "name": "Rear-panel temp sensor 1", + "i2c_path": "i2c-14/14-0048/hwmon", # u9200 cpu-on-board + }, + 4: { + "F2B_max": 70, + "F2B_max_crit": 75, + "B2F_max": 55, + "B2F_max_crit": 75, + "postion": "cpu", + "name": "Rear-panel temp sensor 2", + "i2c_path": "i2c-15/15-004e/hwmon" # u9201 system-outlet + } +} +NULL_VAL = "N/A" +I2C_ADAPTER_PATH = "/sys/class/i2c-adapter" + class Thermal(ThermalBase): """Platform-specific Thermal class""" - THERMAL_NAME_LIST = [] - I2C_ADAPTER_PATH = "/sys/class/i2c-adapter" SS_CONFIG_PATH = "/usr/share/sonic/device/x86_64-cel_seastone-r0/sensors.conf" - def __init__(self, thermal_index): + def __init__(self, thermal_index, airflow): + ThermalBase.__init__(self) self.index = thermal_index self._api_helper = APIHelper() + self._airflow = airflow + self._thermal_info = THERMAL_INFO[self.index] - # Add thermal name - self.THERMAL_NAME_LIST.append("Front-panel temp sensor 1") - self.THERMAL_NAME_LIST.append("Front-panel temp sensor 2") - self.THERMAL_NAME_LIST.append("ASIC temp sensor") - self.THERMAL_NAME_LIST.append("Rear-panel temp sensor 1") - self.THERMAL_NAME_LIST.append("Rear-panel temp sensor 2") - - # Set hwmon path - i2c_path = { - 0: "i2c-5/5-0048/hwmon/hwmon1", # u4 system-inlet - 1: "i2c-6/6-0049/hwmon/hwmon2", # u2 system-inlet - 2: "i2c-7/7-004a/hwmon/hwmon3", # u44 bmc56960-on-board - 3: "i2c-14/14-0048/hwmon/hwmon4", # u9200 cpu-on-board - 4: "i2c-15/15-004e/hwmon/hwmon5" # u9201 system-outlet - }.get(self.index, None) - - self.hwmon_path = "{}/{}".format(self.I2C_ADAPTER_PATH, i2c_path) - self.ss_key = self.THERMAL_NAME_LIST[self.index] + self._i2c_hwmon_path = "{}/{}".format( + I2C_ADAPTER_PATH, self._thermal_info["i2c_path"]) + self._hwmon_path = os.path.join( + self._i2c_hwmon_path, self.__get_hwmon_name(self._i2c_hwmon_path)) + self.name = self.get_name() + self.postion = self._thermal_info["postion"] self.ss_index = 1 + self.minimum_thermal = self.get_temperature() + self.maximum_thermal = self.get_temperature() + + def __get_hwmon_name(self, path): + return os.listdir(path)[0] + def __get_temp(self, temp_file): - temp_file_path = os.path.join(self.hwmon_path, temp_file) + temp_file_path = os.path.join(self._hwmon_path, temp_file) raw_temp = self._api_helper.read_txt_file(temp_file_path) temp = float(raw_temp)/1000 return float("{:.3f}".format(temp)) + def __get_threshold(self, file_name): + temp_file_path = os.path.join(self._hwmon_path, file_name) + data = self._api_helper.read_txt_file(temp_file_path) + if data: + try: + threshold = float(data) + return round(threshold/1000, 3) + except Exception: + pass + return None + def __set_threshold(self, file_name, temperature): - temp_file_path = os.path.join(self.hwmon_path, file_name) + temp_file_path = os.path.join(self._hwmon_path, file_name) try: with open(temp_file_path, 'w') as fd: fd.write(str(temperature)) @@ -80,8 +135,19 @@ def get_high_threshold(self): A float number, the high threshold temperature of thermal in Celsius up to nearest thousandth of one degree Celsius, e.g. 30.125 """ - temp_file = "temp{}_max".format(self.ss_index) - return self.__get_temp(temp_file) + max_crit_key = '{}_max'.format(self._airflow) + high_threshold_file = "temp{}_max".format(self.ss_index) + return self.__get_threshold(high_threshold_file) or self._thermal_info.get(max_crit_key, None) + + + def get_low_threshold(self): + """ + Retrieves the low threshold temperature of thermal + Returns: + A float number, the low threshold temperature of thermal in Celsius + up to nearest thousandth of one degree Celsius, e.g. 30.125 + """ + return 0.001 def set_high_threshold(self, temperature): """ @@ -94,34 +160,97 @@ def set_high_threshold(self, temperature): """ temp_file = "temp{}_max".format(self.ss_index) is_set = self.__set_threshold(temp_file, int(temperature*1000)) - file_set = False - if is_set: - try: - with open(self.SS_CONFIG_PATH, 'r+') as f: - content = f.readlines() - f.seek(0) - ss_found = False - for idx, val in enumerate(content): - if self.ss_key in val: - ss_found = True - elif ss_found and temp_file in val: - content[idx] = " set {} {}\n".format( - temp_file, temperature) - f.writelines(content) - file_set = True - break - except IOError: - file_set = False + file_set = True + if self._api_helper.is_host(): + file_set = False + if is_set: + try: + with open(self.SS_CONFIG_PATH, 'r+') as f: + content = f.readlines() + f.seek(0) + ss_found = False + for idx, val in enumerate(content): + if self.name in val: + ss_found = True + elif ss_found and temp_file in val: + content[idx] = " set {} {}\n".format( + temp_file, temperature) + f.writelines(content) + file_set = True + break + except IOError as err: + file_set = False return is_set & file_set + def set_low_threshold(self, temperature): + """ + Sets the low threshold temperature of thermal + Args : + temperature: A float number up to nearest thousandth of one degree Celsius, + e.g. 30.125 + Returns: + A boolean, True if threshold is set successfully, False if not + """ + return False + + def get_high_critical_threshold(self): + """ + Retrieves the high critical threshold temperature of thermal + Returns: + A float number, the high critical threshold temperature of thermal in Celsius + up to nearest thousandth of one degree Celsius, e.g. 30.125 + """ + max_crit_key = '{}_max_crit'.format(self._airflow) + max_crit_threshold = self._thermal_info.get(max_crit_key, None) + if max_crit_threshold is not None: + max_crit_threshold = float(max_crit_threshold) + return max_crit_threshold + + def get_low_critical_threshold(self): + """ + Retrieves the low critical threshold temperature of thermal + Returns: + A float number, the low critical threshold temperature of thermal in Celsius + up to nearest thousandth of one degree Celsius, e.g. 30.125 + """ + return 0.001 + + def get_minimum_recorded(self): + """ + Retrieves the minimum recorded temperature of thermal + Returns: + A float number, the minimum recorded temperature of thermal in Celsius + up to nearest thousandth of one degree Celsius, e.g. 30.125 + """ + tmp = self.get_temperature() + if tmp < self.minimum_thermal: + self.minimum_thermal = tmp + return self.minimum_thermal + + def get_maximum_recorded(self): + """ + Retrieves the maximum recorded temperature of thermal + Returns: + A float number, the maximum recorded temperature of thermal in Celsius + up to nearest thousandth of one degree Celsius, e.g. 30.125 + """ + tmp = self.get_temperature() + if tmp > self.maximum_thermal: + self.maximum_thermal = tmp + return self.maximum_thermal + + ############################################################## + ###################### Device methods ######################## + ############################################################## + def get_name(self): """ Retrieves the name of the thermal device Returns: string: The name of the thermal device """ - return self.THERMAL_NAME_LIST[self.index] + return self._thermal_info["name"] def get_presence(self): """ @@ -130,9 +259,25 @@ def get_presence(self): bool: True if PSU is present, False if not """ temp_file = "temp{}_input".format(self.ss_index) - temp_file_path = os.path.join(self.hwmon_path, temp_file) + temp_file_path = os.path.join(self._hwmon_path, temp_file) return os.path.isfile(temp_file_path) + def get_model(self): + """ + Retrieves the model number (or part number) of the device + Returns: + string: Model/part number of device + """ + return NULL_VAL + + def get_serial(self): + """ + Retrieves the serial number of the device + Returns: + string: Serial number of device + """ + return NULL_VAL + def get_status(self): """ Retrieves the operational status of the device @@ -143,9 +288,25 @@ def get_status(self): return False fault_file = "temp{}_fault".format(self.ss_index) - fault_file_path = os.path.join(self.hwmon_path, fault_file) + fault_file_path = os.path.join(self._hwmon_path, fault_file) if not os.path.isfile(fault_file_path): return True raw_txt = self.__read_txt_file(fault_file_path) return int(raw_txt) == 0 + + def is_replaceable(self): + """ + Retrieves whether thermal module is replaceable + Returns: + A boolean value, True if replaceable, False if not + """ + return False + + def get_position_in_parent(self): + """ + Retrieves the thermal position information + Returns: + A int value, index of thermal + """ + return self.index + 1 diff --git a/device/celestica/x86_64-cel_seastone-r0/sonic_platform/thermal_actions.py b/device/celestica/x86_64-cel_seastone-r0/sonic_platform/thermal_actions.py new file mode 100644 index 000000000000..545db861f683 --- /dev/null +++ b/device/celestica/x86_64-cel_seastone-r0/sonic_platform/thermal_actions.py @@ -0,0 +1,78 @@ + +from sonic_platform_base.sonic_thermal_control.thermal_action_base import ThermalPolicyActionBase +from sonic_platform_base.sonic_thermal_control.thermal_json_object import thermal_json_object +from .thermal_infos import ChassisInfo +from .helper import APIHelper + + +@thermal_json_object('thermal_control.control') +class ControlThermalAlgoAction(ThermalPolicyActionBase): + """ + Action to control the thermal control algorithm + """ + # JSON field definition + JSON_FIELD_STATUS = 'status' + + def __init__(self): + self.status = True + + def load_from_json(self, json_obj): + """ + Construct ControlThermalAlgoAction via JSON. JSON example: + { + "type": "thermal_control.control" + "status": "true" + } + :param json_obj: A JSON object representing a ControlThermalAlgoAction action. + :return: + """ + if ControlThermalAlgoAction.JSON_FIELD_STATUS in json_obj: + status_str = json_obj[ControlThermalAlgoAction.JSON_FIELD_STATUS].lower() + if status_str == 'true': + self.status = True + elif status_str == 'false': + self.status = False + else: + raise ValueError('Invalid {} field value, please specify true of false'. + format(ControlThermalAlgoAction.JSON_FIELD_STATUS)) + else: + raise ValueError('ControlThermalAlgoAction ' + 'missing mandatory field {} in JSON policy file'. + format(ControlThermalAlgoAction.JSON_FIELD_STATUS)) + + def execute(self, thermal_info_dict): + """ + Disable thermal control algorithm + :param thermal_info_dict: A dictionary stores all thermal information. + :return: + """ + if ChassisInfo.INFO_NAME in thermal_info_dict: + chassis_info_obj = thermal_info_dict[ChassisInfo.INFO_NAME] + chassis = chassis_info_obj.get_chassis() + thermal_manager = chassis.get_thermal_manager() + if self.status: + thermal_manager.start_thermal_control_algorithm() + else: + thermal_manager.stop_thermal_control_algorithm() + + +@thermal_json_object('switch.power_cycling') +class SwitchPolicyAction(ThermalPolicyActionBase): + """ + Base class for thermal action. Once all thermal conditions in a thermal policy are matched, + all predefined thermal action will be executed. + """ + + def execute(self, thermal_info_dict): + """ + Take action when thermal condition matches. For example, power cycle the switch. + :param thermal_info_dict: A dictionary stores all thermal information. + :return: + """ + thermal_overload_position_path = '/tmp/thermal_overload_position' + thermal_overload_position = APIHelper().read_one_line_file( + thermal_overload_position_path) + + cmd = 'bash /usr/share/sonic/platform/thermal_overload_control.sh {}'.format( + thermal_overload_position) + APIHelper().run_command(cmd) diff --git a/device/celestica/x86_64-cel_seastone-r0/sonic_platform/thermal_conditions.py b/device/celestica/x86_64-cel_seastone-r0/sonic_platform/thermal_conditions.py new file mode 100644 index 000000000000..1eee8ea91ab5 --- /dev/null +++ b/device/celestica/x86_64-cel_seastone-r0/sonic_platform/thermal_conditions.py @@ -0,0 +1,77 @@ +from sonic_platform_base.sonic_thermal_control.thermal_condition_base import ThermalPolicyConditionBase +from sonic_platform_base.sonic_thermal_control.thermal_json_object import thermal_json_object + + +class FanCondition(ThermalPolicyConditionBase): + def get_fan_info(self, thermal_info_dict): + from .thermal_infos import FanInfo + if FanInfo.INFO_NAME in thermal_info_dict and isinstance(thermal_info_dict[FanInfo.INFO_NAME], FanInfo): + return thermal_info_dict[FanInfo.INFO_NAME] + else: + return None + + +@thermal_json_object('fan.any.absence') +class AnyFanAbsenceCondition(FanCondition): + def is_match(self, thermal_info_dict): + fan_info_obj = self.get_fan_info(thermal_info_dict) + return len(fan_info_obj.get_absence_fans()) > 0 if fan_info_obj else False + + +@thermal_json_object('fan.any.fault') +class AnyFanFaultCondition(FanCondition): + def is_match(self, thermal_info_dict): + fan_info_obj = self.get_fan_info(thermal_info_dict) + return len(fan_info_obj.get_fault_fans()) > 0 if fan_info_obj else False + + +@thermal_json_object('fan.all.presence') +class AllFanPresenceCondition(FanCondition): + def is_match(self, thermal_info_dict): + fan_info_obj = self.get_fan_info(thermal_info_dict) + return len(fan_info_obj.get_absence_fans()) == 0 if fan_info_obj else False + + +@thermal_json_object('fan.all.good') +class AllFanGoodCondition(FanCondition): + def is_match(self, thermal_info_dict): + fan_info_obj = self.get_fan_info(thermal_info_dict) + return len(fan_info_obj.get_fault_fans()) == 0 if fan_info_obj else False + + +class ThermalCondition(ThermalPolicyConditionBase): + def get_thermal_info(self, thermal_info_dict): + from .thermal_infos import ThermalInfo + if ThermalInfo.INFO_NAME in thermal_info_dict and isinstance(thermal_info_dict[ThermalInfo.INFO_NAME], ThermalInfo): + return thermal_info_dict[ThermalInfo.INFO_NAME] + else: + return None + + +@thermal_json_object('thermal.over.high_threshold') +class ThermalOverHighCriticalCondition(ThermalCondition): + def is_match(self, thermal_info_dict): + thermal_info_obj = self.get_thermal_info(thermal_info_dict) + if thermal_info_obj: + return thermal_info_obj.is_over_high_threshold() + else: + return False + + +@thermal_json_object('thermal.over.high_critical_threshold') +class ThermalOverHighCriticalCondition(ThermalCondition): + def is_match(self, thermal_info_dict): + thermal_info_obj = self.get_thermal_info(thermal_info_dict) + if thermal_info_obj: + return thermal_info_obj.is_over_high_critical_threshold() + else: + return False + +@thermal_json_object('thermal.all.good') +class ThermalGoodCondition(ThermalCondition): + def is_match(self, thermal_info_dict): + thermal_info_obj = self.get_thermal_info(thermal_info_dict) + if thermal_info_obj: + return not thermal_info_obj.is_over_threshold() + else: + return False diff --git a/device/celestica/x86_64-cel_seastone-r0/sonic_platform/thermal_infos.py b/device/celestica/x86_64-cel_seastone-r0/sonic_platform/thermal_infos.py new file mode 100644 index 000000000000..a680b31b634f --- /dev/null +++ b/device/celestica/x86_64-cel_seastone-r0/sonic_platform/thermal_infos.py @@ -0,0 +1,165 @@ +from sonic_platform_base.sonic_thermal_control.thermal_info_base import ThermalPolicyInfoBase +from sonic_platform_base.sonic_thermal_control.thermal_json_object import thermal_json_object +from .helper import APIHelper +import time + + +@thermal_json_object('fan_info') +class FanInfo(ThermalPolicyInfoBase): + """ + Fan information needed by thermal policy + """ + + # Fan information name + INFO_NAME = 'fan_info' + + def __init__(self): + self._absence_fans = set() + self._presence_fans = set() + self._fault_fans = set() + self._status_changed = False + + def collect(self, chassis): + """ + Collect absence and presence fans. + :param chassis: The chassis object + :return: + """ + self._status_changed = False + for fan in chassis.get_all_fans(): + presence = fan.get_presence() + status = fan.get_status() + if presence and fan not in self._presence_fans: + self._presence_fans.add(fan) + self._status_changed = True + if fan in self._absence_fans: + self._absence_fans.remove(fan) + elif not presence and fan not in self._absence_fans: + self._absence_fans.add(fan) + self._status_changed = True + if fan in self._presence_fans: + self._presence_fans.remove(fan) + + if not status and fan not in self._fault_fans: + self._fault_fans.add(fan) + self._status_changed = True + + elif status and fan in self._fault_fans: + self._fault_fans.remove(fan) + self._status_changed = True + + def get_absence_fans(self): + """ + Retrieves absence fans + :return: A set of absence fans + """ + return self._absence_fans + + def get_presence_fans(self): + """ + Retrieves presence fans + :return: A set of presence fans + """ + return self._presence_fans + + def get_fault_fans(self): + """ + Retrieves fault fans + :return: A set of fault fans + """ + return self._fault_fans + + def is_status_changed(self): + """ + Retrieves if the status of fan information changed + :return: True if status changed else False + """ + return self._status_changed + + +@thermal_json_object('thermal_info') +class ThermalInfo(ThermalPolicyInfoBase): + """ + Thermal information needed by thermal policy + """ + + # Fan information name + INFO_NAME = 'thermal_info' + + def collect(self, chassis): + """ + Collect thermal sensor temperature change status + :param chassis: The chassis object + :return: + """ + self._over_high_threshold = False + self._over_high_critical_threshold = False + self._thermal_overload_position = 'cpu' + + # Calculate average temp within the device + temp = 0 + num_of_thermals = chassis.get_num_thermals() + for index in range(num_of_thermals): + thermal = chassis.get_thermal(index) + temp = thermal.get_temperature() + high_threshold = thermal.get_high_threshold() + high_critical_threshold = thermal.get_high_critical_threshold() + + if high_threshold and temp > high_threshold: + self._over_high_threshold = True + + if high_critical_threshold and temp > high_critical_threshold: + self._thermal_overload_position = thermal.postion + self._over_high_critical_threshold = True + + def is_over_threshold(self): + """ + Retrieves if the temperature is over any threshold + :return: True if the temperature is over any threshold else False + """ + return self._over_high_threshold or self._over_high_critical_threshold + + def is_over_high_critical_threshold(self): + """ + Retrieves if the temperature is over high critical threshold + :return: True if the temperature is over high critical threshold else False + """ + thermal_overload_position_path = '/tmp/thermal_overload_position' + if self._over_high_critical_threshold: + APIHelper().write_txt_file(thermal_overload_position_path, + self._thermal_overload_position) + time.sleep(1) + return self._over_high_critical_threshold + + def is_over_high_threshold(self): + """ + Retrieves if the temperature is over high threshold + :return: True if the temperature is over high threshold else False + """ + return self._over_high_threshold + + +@thermal_json_object('chassis_info') +class ChassisInfo(ThermalPolicyInfoBase): + """ + Chassis information needed by thermal policy + """ + INFO_NAME = 'chassis_info' + + def __init__(self): + self._chassis = None + + def collect(self, chassis): + """ + Collect platform chassis. + :param chassis: The chassis object + :return: + """ + self._chassis = chassis + + def get_chassis(self): + """ + Retrieves platform chassis object + :return: A platform chassis object. + """ + return self._chassis diff --git a/device/celestica/x86_64-cel_seastone-r0/sonic_platform/thermal_manager.py b/device/celestica/x86_64-cel_seastone-r0/sonic_platform/thermal_manager.py new file mode 100644 index 000000000000..9f057cf1f37f --- /dev/null +++ b/device/celestica/x86_64-cel_seastone-r0/sonic_platform/thermal_manager.py @@ -0,0 +1,46 @@ +from sonic_platform_base.sonic_thermal_control.thermal_manager_base import ThermalManagerBase +from .helper import APIHelper +from .thermal_actions import * +from .thermal_conditions import * +from .thermal_infos import * + +class ThermalManager(ThermalManagerBase): + FSC_ALGORITHM_CMD = 'service fancontrol {}' + + @classmethod + def start_thermal_control_algorithm(cls): + """ + Start vendor specific thermal control algorithm. The default behavior of this function is a no-op. + :return: + """ + return cls._enable_fancontrol_service(True) + + @classmethod + def stop_thermal_control_algorithm(cls): + """ + Stop thermal control algorithm + Returns: + bool: True if set success, False if fail. + """ + return cls._enable_fancontrol_service(False) + + @classmethod + def deinitialize(cls): + """ + Destroy thermal manager, including any vendor specific cleanup. The default behavior of this function + is a no-op. + :return: + """ + return cls._enable_fancontrol_service(True) + + @classmethod + def _enable_fancontrol_service(cls, enable): + """ + Control thermal by fcs algorithm + Args: + enable: Bool, indicate enable the algorithm or not + Returns: + bool: True if set success, False if fail. + """ + cmd = 'start' if enable else 'stop' + return APIHelper().run_command(cls.FSC_ALGORITHM_CMD.format(cmd)) diff --git a/device/celestica/x86_64-cel_seastone-r0/sonic_platform/watchdog.py b/device/celestica/x86_64-cel_seastone-r0/sonic_platform/watchdog.py index 31bb911d2401..2bb8f2d57aa3 100644 --- a/device/celestica/x86_64-cel_seastone-r0/sonic_platform/watchdog.py +++ b/device/celestica/x86_64-cel_seastone-r0/sonic_platform/watchdog.py @@ -31,6 +31,8 @@ class Watchdog(WatchdogBase): def __init__(self): + WatchdogBase.__init__(self) + # Init helper self._api_helper = APIHelper() @@ -133,6 +135,9 @@ def arm(self, seconds): ret = WDT_COMMON_ERROR if seconds < 0: return ret + if seconds > 16777: + return ret + try: if self.timeout != seconds: diff --git a/device/celestica/x86_64-cel_seastone-r0/system_health_monitoring_config.json b/device/celestica/x86_64-cel_seastone-r0/system_health_monitoring_config.json new file mode 100644 index 000000000000..c18399188153 --- /dev/null +++ b/device/celestica/x86_64-cel_seastone-r0/system_health_monitoring_config.json @@ -0,0 +1,14 @@ +{ + "services_to_ignore": [], + "devices_to_ignore": [ + "PSU-1 FAN-1", + "PSU-2 FAN-1" + ], + "user_defined_checkers": [], + "polling_interval": 60, + "led_color": { + "fault": "orange", + "normal": "green", + "booting": "orange_blink" + } +} diff --git a/device/celestica/x86_64-cel_seastone-r0/th-seastone-dx010-config-flex-all.bcm b/device/celestica/x86_64-cel_seastone-r0/th-seastone-dx010-config-flex-all.bcm index dc2cdf1c200d..00af55358fbd 100644 --- a/device/celestica/x86_64-cel_seastone-r0/th-seastone-dx010-config-flex-all.bcm +++ b/device/celestica/x86_64-cel_seastone-r0/th-seastone-dx010-config-flex-all.bcm @@ -19,6 +19,12 @@ ipv6_lpm_128b_enable=1 #Use MMU lossy configuration mmu_lossless=0 +# disables bcmALPMDH (ALPM distributed hitbit) thread. This thread is purely for debug purpose +l3_alpm_hit_skip=1 + +# Disable Counting ACL Drop towards interface RX_DRP counter +sai_adjust_acl_drop_in_rx_drop=1 + ################################################################################### # SeaStone customized configuration ################################################################################### diff --git a/platform/broadcom/sonic-platform-modules-cel/dx010/scripts/thermal_overload_control.sh b/device/celestica/x86_64-cel_seastone-r0/thermal_overload_control.sh similarity index 100% rename from platform/broadcom/sonic-platform-modules-cel/dx010/scripts/thermal_overload_control.sh rename to device/celestica/x86_64-cel_seastone-r0/thermal_overload_control.sh diff --git a/device/celestica/x86_64-cel_seastone-r0/thermal_policy.json b/device/celestica/x86_64-cel_seastone-r0/thermal_policy.json new file mode 100644 index 000000000000..f937b6bd4456 --- /dev/null +++ b/device/celestica/x86_64-cel_seastone-r0/thermal_policy.json @@ -0,0 +1,93 @@ +{ + "thermal_control_algorithm": { + "run_at_boot_up": "true" + }, + "info_types": [ + { + "type": "chassis_info" + }, + { + "type": "fan_info" + }, + { + "type": "thermal_info" + } + ], + "policies": [ + { + "name": "any fan absence", + "conditions": [ + { + "type": "fan.any.absence" + } + ], + "actions": [ + { + "type": "thermal_control.control", + "status": "false" + } + ] + }, + { + "name": "any fan broken", + "conditions": [ + { + "type": "fan.any.fault" + } + ], + "actions": [ + { + "type": "thermal_control.control", + "status": "false" + } + ] + }, + { + "name": "any thermal over threshold", + "conditions": [ + { + "type": "thermal.over.high_threshold" + } + ], + "actions": [ + { + "type": "thermal_control.control", + "status": "false" + } + ] + }, + { + "name": "temp over high critical threshold", + "conditions": [ + { + "type": "thermal.over.high_critical_threshold" + } + ], + "actions": [ + { + "type": "switch.power_cycling" + } + ] + }, + { + "name": "all fan presence / thermal no warning", + "conditions": [ + { + "type": "fan.all.presence" + }, + { + "type": "fan.all.good" + }, + { + "type": "thermal.all.good" + } + ], + "actions": [ + { + "type": "thermal_control.control", + "status": "true" + } + ] + } + ] +} \ No newline at end of file diff --git a/device/celestica/x86_64-cel_seastone_2-r0/Seastone_2/td3-seastone_2-32x100G.config.bcm b/device/celestica/x86_64-cel_seastone_2-r0/Seastone_2/td3-seastone_2-32x100G.config.bcm index 2c23d0da2f22..62bcdbc58840 100644 --- a/device/celestica/x86_64-cel_seastone_2-r0/Seastone_2/td3-seastone_2-32x100G.config.bcm +++ b/device/celestica/x86_64-cel_seastone_2-r0/Seastone_2/td3-seastone_2-32x100G.config.bcm @@ -1,3 +1,4 @@ +sai_load_hw_config=/etc/bcm/flex/bcm56870_a0_issu/b870.6.4.1/ help_cli_enable=1 ifp_inports_support_enable=1 ipv6_lpm_128b_enable=0x1 diff --git a/device/celestica/x86_64-cel_seastone_2-r0/led_proc_init.soc b/device/celestica/x86_64-cel_seastone_2-r0/led_proc_init.soc index a47644c032e1..b6b474bd53d6 100644 --- a/device/celestica/x86_64-cel_seastone_2-r0/led_proc_init.soc +++ b/device/celestica/x86_64-cel_seastone_2-r0/led_proc_init.soc @@ -1,9 +1,5 @@ -#Enable all ports -port all en=1 -sleep 6 -#linkscan 250000; port xe,ce linkscan=on - -#Load LED +linkscan off +m0 load 0 0x3800 /usr/share/sonic/platform/custom.bin +sleep 10 led auto on; led start - - +linkscan on diff --git a/device/celestica/x86_64-cel_seastone_2-r0/sonic_platform_config/watchdog.py b/device/celestica/x86_64-cel_seastone_2-r0/sonic_platform_config/watchdog.py index cc87c3d6b32a..fac5c40e134f 100644 --- a/device/celestica/x86_64-cel_seastone_2-r0/sonic_platform_config/watchdog.py +++ b/device/celestica/x86_64-cel_seastone_2-r0/sonic_platform_config/watchdog.py @@ -29,6 +29,8 @@ class Watchdog(WatchdogBase): def __init__(self): + WatchdogBase.__init__(self) + self._api_common = Common() # Init cpld reg path diff --git a/device/celestica/x86_64-cel_silverstone-r0/Silverstone-128x100/th3-128x100G.config.bcm b/device/celestica/x86_64-cel_silverstone-r0/Silverstone-128x100/th3-128x100G.config.bcm index 0b66c8b53814..0b105aeccbad 100644 --- a/device/celestica/x86_64-cel_silverstone-r0/Silverstone-128x100/th3-128x100G.config.bcm +++ b/device/celestica/x86_64-cel_silverstone-r0/Silverstone-128x100/th3-128x100G.config.bcm @@ -1,3 +1,7 @@ +# The following 2 SOC properties are needed to prevent FDB Events during Warmboot due to TH3 is SW Managed MACs +l2xmsg_shadow_hit_bits=0 +l2xmsg_no_cb_during_table_rebuild=1 + pbmp_xport_xe.0=0x8ffff8ffffcffff8ffff8ffff8ffffcffff9fffe ccm_dma_enable=0 ccmdma_intr_enable=0 diff --git a/device/celestica/x86_64-cel_silverstone-r0/Silverstone/th3-32x400G.config.bcm b/device/celestica/x86_64-cel_silverstone-r0/Silverstone/th3-32x400G.config.bcm index 5e5fc82aeace..22e8d9ee9657 100644 --- a/device/celestica/x86_64-cel_silverstone-r0/Silverstone/th3-32x400G.config.bcm +++ b/device/celestica/x86_64-cel_silverstone-r0/Silverstone/th3-32x400G.config.bcm @@ -1,3 +1,6 @@ +# The following 2 SOC properties are needed to prevent FDB Events during Warmboot due to TH3 is SW Managed MACs +l2xmsg_shadow_hit_bits=0 +l2xmsg_no_cb_during_table_rebuild=1 pbmp_xport_xe.0=0x8111181111c1111811118111181111c111182222 ccm_dma_enable=0 diff --git a/device/celestica/x86_64-cel_silverstone-r0/sonic_platform/fan.py b/device/celestica/x86_64-cel_silverstone-r0/sonic_platform/fan.py index 1055aee68fc7..1a18eed9c8d5 100644 --- a/device/celestica/x86_64-cel_silverstone-r0/sonic_platform/fan.py +++ b/device/celestica/x86_64-cel_silverstone-r0/sonic_platform/fan.py @@ -54,6 +54,7 @@ class Fan(FanBase): """Platform-specific Fan class""" def __init__(self, fan_tray_index, fan_index=0, is_psu_fan=False, psu_index=0): + FanBase.__init__(self) self.fan_index = fan_index self.fan_tray_index = fan_tray_index self.is_psu_fan = is_psu_fan diff --git a/device/celestica/x86_64-cel_silverstone-r0/sonic_platform/sfp.py b/device/celestica/x86_64-cel_silverstone-r0/sonic_platform/sfp.py index b04b49ca4382..e909416e9081 100644 --- a/device/celestica/x86_64-cel_silverstone-r0/sonic_platform/sfp.py +++ b/device/celestica/x86_64-cel_silverstone-r0/sonic_platform/sfp.py @@ -328,7 +328,7 @@ def _dom_capability_detect(self): QSFP_VERSION_COMPLIANCE_OFFSET, QSFP_VERSION_COMPLIANCE_WIDTH) qsfp_version_compliance = int( qsfp_version_compliance_raw[0], 16) - dom_capability = sfpi_obj.parse_qsfp_dom_capability( + dom_capability = sfpi_obj.parse_dom_capability( qsfp_dom_capability_raw, 0) if qsfp_version_compliance >= 0x08: self.dom_temp_supported = dom_capability['data']['Temp_support']['value'] == 'On' diff --git a/device/common/profiles/td2/6000/BALANCED/buffers_defaults_t0.j2 b/device/common/profiles/td2/6000/BALANCED/buffers_defaults_t0.j2 new file mode 100644 index 000000000000..9dbcc8eb2076 --- /dev/null +++ b/device/common/profiles/td2/6000/BALANCED/buffers_defaults_t0.j2 @@ -0,0 +1,40 @@ +{%- set default_cable = '0m' %} + +{%- include 'buffer_ports_t0.j2' %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "12766208", + "type": "ingress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "12766208", + "type": "egress", + "mode": "static" + }, + "egress_lossy_pool": { + "size": "7326924", + "type": "egress", + "mode": "dynamic" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "dynamic_th":"3" + }, + "egress_lossless_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"0", + "static_th":"12766208" + }, + "egress_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"1518", + "dynamic_th":"3" + } + }, +{%- endmacro %} diff --git a/device/common/profiles/td2/6000/BALANCED/buffers_defaults_t1.j2 b/device/common/profiles/td2/6000/BALANCED/buffers_defaults_t1.j2 new file mode 100644 index 000000000000..6661031f9aea --- /dev/null +++ b/device/common/profiles/td2/6000/BALANCED/buffers_defaults_t1.j2 @@ -0,0 +1,40 @@ +{%- set default_cable = '0m' %} + +{%- include 'buffer_ports_t1.j2' %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "12766208", + "type": "ingress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "12766208", + "type": "egress", + "mode": "static" + }, + "egress_lossy_pool": { + "size": "7326924", + "type": "egress", + "mode": "dynamic" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "dynamic_th":"3" + }, + "egress_lossless_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"0", + "static_th":"12766208" + }, + "egress_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"1518", + "dynamic_th":"3" + } + }, +{%- endmacro %} diff --git a/device/common/profiles/td2/6000/BALANCED/pg_profile_lookup.ini b/device/common/profiles/td2/6000/BALANCED/pg_profile_lookup.ini new file mode 100644 index 000000000000..9f2eacb6fc42 --- /dev/null +++ b/device/common/profiles/td2/6000/BALANCED/pg_profile_lookup.ini @@ -0,0 +1,17 @@ +# PG lossless profiles. +# speed cable size xon xoff threshold xon_offset + 10000 5m 56368 18432 55120 -3 2496 + 25000 5m 56368 18432 55120 -3 2496 + 40000 5m 56368 18432 55120 -3 2496 + 50000 5m 56368 18432 55120 -3 2496 + 100000 5m 56368 18432 55120 -3 2496 + 10000 40m 56368 18432 55120 -3 2496 + 25000 40m 56368 18432 55120 -3 2496 + 40000 40m 56368 18432 55120 -3 2496 + 50000 40m 56368 18432 55120 -3 2496 + 100000 40m 56368 18432 55120 -3 2496 + 10000 300m 56368 18432 55120 -3 2496 + 25000 300m 56368 18432 55120 -3 2496 + 40000 300m 56368 18432 55120 -3 2496 + 50000 300m 56368 18432 55120 -3 2496 + 100000 300m 56368 18432 55120 -3 2496 diff --git a/device/arista/x86_64-arista_7050_qx32s/Arista-7050-QX-32S/qos.json.j2 b/device/common/profiles/td2/6000/BALANCED/qos.json.j2 similarity index 100% rename from device/arista/x86_64-arista_7050_qx32s/Arista-7050-QX-32S/qos.json.j2 rename to device/common/profiles/td2/6000/BALANCED/qos.json.j2 diff --git a/device/common/profiles/td2/6000/RDMA-CENTRIC/buffers_defaults_t0.j2 b/device/common/profiles/td2/6000/RDMA-CENTRIC/buffers_defaults_t0.j2 new file mode 100644 index 000000000000..9dbcc8eb2076 --- /dev/null +++ b/device/common/profiles/td2/6000/RDMA-CENTRIC/buffers_defaults_t0.j2 @@ -0,0 +1,40 @@ +{%- set default_cable = '0m' %} + +{%- include 'buffer_ports_t0.j2' %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "12766208", + "type": "ingress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "12766208", + "type": "egress", + "mode": "static" + }, + "egress_lossy_pool": { + "size": "7326924", + "type": "egress", + "mode": "dynamic" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "dynamic_th":"3" + }, + "egress_lossless_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"0", + "static_th":"12766208" + }, + "egress_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"1518", + "dynamic_th":"3" + } + }, +{%- endmacro %} diff --git a/device/common/profiles/td2/6000/RDMA-CENTRIC/buffers_defaults_t1.j2 b/device/common/profiles/td2/6000/RDMA-CENTRIC/buffers_defaults_t1.j2 new file mode 100644 index 000000000000..6661031f9aea --- /dev/null +++ b/device/common/profiles/td2/6000/RDMA-CENTRIC/buffers_defaults_t1.j2 @@ -0,0 +1,40 @@ +{%- set default_cable = '0m' %} + +{%- include 'buffer_ports_t1.j2' %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "12766208", + "type": "ingress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "12766208", + "type": "egress", + "mode": "static" + }, + "egress_lossy_pool": { + "size": "7326924", + "type": "egress", + "mode": "dynamic" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "dynamic_th":"3" + }, + "egress_lossless_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"0", + "static_th":"12766208" + }, + "egress_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"1518", + "dynamic_th":"3" + } + }, +{%- endmacro %} diff --git a/device/common/profiles/td2/6000/RDMA-CENTRIC/pg_profile_lookup.ini b/device/common/profiles/td2/6000/RDMA-CENTRIC/pg_profile_lookup.ini new file mode 100644 index 000000000000..9f2eacb6fc42 --- /dev/null +++ b/device/common/profiles/td2/6000/RDMA-CENTRIC/pg_profile_lookup.ini @@ -0,0 +1,17 @@ +# PG lossless profiles. +# speed cable size xon xoff threshold xon_offset + 10000 5m 56368 18432 55120 -3 2496 + 25000 5m 56368 18432 55120 -3 2496 + 40000 5m 56368 18432 55120 -3 2496 + 50000 5m 56368 18432 55120 -3 2496 + 100000 5m 56368 18432 55120 -3 2496 + 10000 40m 56368 18432 55120 -3 2496 + 25000 40m 56368 18432 55120 -3 2496 + 40000 40m 56368 18432 55120 -3 2496 + 50000 40m 56368 18432 55120 -3 2496 + 100000 40m 56368 18432 55120 -3 2496 + 10000 300m 56368 18432 55120 -3 2496 + 25000 300m 56368 18432 55120 -3 2496 + 40000 300m 56368 18432 55120 -3 2496 + 50000 300m 56368 18432 55120 -3 2496 + 100000 300m 56368 18432 55120 -3 2496 diff --git a/device/common/profiles/td2/6000/RDMA-CENTRIC/qos.json.j2 b/device/common/profiles/td2/6000/RDMA-CENTRIC/qos.json.j2 new file mode 100644 index 000000000000..3e548325ea30 --- /dev/null +++ b/device/common/profiles/td2/6000/RDMA-CENTRIC/qos.json.j2 @@ -0,0 +1 @@ +{%- include 'qos_config.j2' %} diff --git a/device/common/profiles/td2/6000/TCP-CENTRIC b/device/common/profiles/td2/6000/TCP-CENTRIC new file mode 120000 index 000000000000..d6f7127aa748 --- /dev/null +++ b/device/common/profiles/td2/6000/TCP-CENTRIC @@ -0,0 +1 @@ +BALANCED \ No newline at end of file diff --git a/device/common/profiles/td2/gen/BALANCED/buffers_defaults_t0.j2 b/device/common/profiles/td2/gen/BALANCED/buffers_defaults_t0.j2 new file mode 100644 index 000000000000..9dbcc8eb2076 --- /dev/null +++ b/device/common/profiles/td2/gen/BALANCED/buffers_defaults_t0.j2 @@ -0,0 +1,40 @@ +{%- set default_cable = '0m' %} + +{%- include 'buffer_ports_t0.j2' %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "12766208", + "type": "ingress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "12766208", + "type": "egress", + "mode": "static" + }, + "egress_lossy_pool": { + "size": "7326924", + "type": "egress", + "mode": "dynamic" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "dynamic_th":"3" + }, + "egress_lossless_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"0", + "static_th":"12766208" + }, + "egress_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"1518", + "dynamic_th":"3" + } + }, +{%- endmacro %} diff --git a/device/common/profiles/td2/gen/BALANCED/buffers_defaults_t1.j2 b/device/common/profiles/td2/gen/BALANCED/buffers_defaults_t1.j2 new file mode 100644 index 000000000000..6661031f9aea --- /dev/null +++ b/device/common/profiles/td2/gen/BALANCED/buffers_defaults_t1.j2 @@ -0,0 +1,40 @@ +{%- set default_cable = '0m' %} + +{%- include 'buffer_ports_t1.j2' %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "12766208", + "type": "ingress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "12766208", + "type": "egress", + "mode": "static" + }, + "egress_lossy_pool": { + "size": "7326924", + "type": "egress", + "mode": "dynamic" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "dynamic_th":"3" + }, + "egress_lossless_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"0", + "static_th":"12766208" + }, + "egress_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"1518", + "dynamic_th":"3" + } + }, +{%- endmacro %} diff --git a/device/common/profiles/td2/gen/BALANCED/pg_profile_lookup.ini b/device/common/profiles/td2/gen/BALANCED/pg_profile_lookup.ini new file mode 100644 index 000000000000..b4cd51281bae --- /dev/null +++ b/device/common/profiles/td2/gen/BALANCED/pg_profile_lookup.ini @@ -0,0 +1,17 @@ +# PG lossless profiles. +# speed cable size xon xoff threshold xon_offset + 1000 5m 41808 18432 40560 -1 2496 + 10000 5m 41808 18432 40560 -1 2496 + 40000 5m 46384 18432 45136 -1 2496 + 50000 5m 46592 18432 45344 -1 2496 + 100000 5m 48464 18432 47216 -1 2496 + 1000 40m 41808 18432 40560 -1 2496 + 10000 40m 41808 18432 40560 -1 2496 + 40000 40m 48464 18432 47216 -1 2496 + 50000 40m 49296 18432 48048 -1 2496 + 100000 40m 53872 18432 52624 -1 2496 + 1000 300m 41808 18432 40560 -1 2496 + 10000 300m 41808 18432 40560 -1 2496 + 40000 300m 64064 18432 62816 -1 2496 + 50000 300m 68848 18432 67600 -1 2496 + 100000 300m 92976 18432 91728 -1 2496 diff --git a/device/common/profiles/td2/gen/BALANCED/qos.json.j2 b/device/common/profiles/td2/gen/BALANCED/qos.json.j2 new file mode 100644 index 000000000000..853a6f812b1d --- /dev/null +++ b/device/common/profiles/td2/gen/BALANCED/qos.json.j2 @@ -0,0 +1,23 @@ +{% if ('type' in DEVICE_METADATA['localhost'] and 'BackEnd' in DEVICE_METADATA['localhost']['type'] and 'storage_device' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['storage_device'] == 'true') %} +{%- macro generate_wred_profiles() %} + "WRED_PROFILE": { + "AZURE_LOSSLESS" : { + "wred_green_enable" : "true", + "wred_yellow_enable" : "true", + "wred_red_enable" : "true", + "ecn" : "ecn_all", + "green_max_threshold" : "12000144", + "green_min_threshold" : "1048576", + "yellow_max_threshold" : "2097152", + "yellow_min_threshold" : "1048576", + "red_max_threshold" : "2097152", + "red_min_threshold" : "1048576", + "green_drop_probability" : "5", + "yellow_drop_probability": "5", + "red_drop_probability" : "5" + } + }, +{%- endmacro %} +{% endif %} + +{%- include 'qos_config.j2' %} diff --git a/device/common/profiles/td2/gen/RDMA-CENTRIC/buffers_defaults_t0.j2 b/device/common/profiles/td2/gen/RDMA-CENTRIC/buffers_defaults_t0.j2 new file mode 100644 index 000000000000..9dbcc8eb2076 --- /dev/null +++ b/device/common/profiles/td2/gen/RDMA-CENTRIC/buffers_defaults_t0.j2 @@ -0,0 +1,40 @@ +{%- set default_cable = '0m' %} + +{%- include 'buffer_ports_t0.j2' %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "12766208", + "type": "ingress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "12766208", + "type": "egress", + "mode": "static" + }, + "egress_lossy_pool": { + "size": "7326924", + "type": "egress", + "mode": "dynamic" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "dynamic_th":"3" + }, + "egress_lossless_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"0", + "static_th":"12766208" + }, + "egress_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"1518", + "dynamic_th":"3" + } + }, +{%- endmacro %} diff --git a/device/common/profiles/td2/gen/RDMA-CENTRIC/buffers_defaults_t1.j2 b/device/common/profiles/td2/gen/RDMA-CENTRIC/buffers_defaults_t1.j2 new file mode 100644 index 000000000000..6661031f9aea --- /dev/null +++ b/device/common/profiles/td2/gen/RDMA-CENTRIC/buffers_defaults_t1.j2 @@ -0,0 +1,40 @@ +{%- set default_cable = '0m' %} + +{%- include 'buffer_ports_t1.j2' %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "12766208", + "type": "ingress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "12766208", + "type": "egress", + "mode": "static" + }, + "egress_lossy_pool": { + "size": "7326924", + "type": "egress", + "mode": "dynamic" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "dynamic_th":"3" + }, + "egress_lossless_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"0", + "static_th":"12766208" + }, + "egress_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"1518", + "dynamic_th":"3" + } + }, +{%- endmacro %} diff --git a/device/common/profiles/td2/gen/RDMA-CENTRIC/pg_profile_lookup.ini b/device/common/profiles/td2/gen/RDMA-CENTRIC/pg_profile_lookup.ini new file mode 100644 index 000000000000..b4cd51281bae --- /dev/null +++ b/device/common/profiles/td2/gen/RDMA-CENTRIC/pg_profile_lookup.ini @@ -0,0 +1,17 @@ +# PG lossless profiles. +# speed cable size xon xoff threshold xon_offset + 1000 5m 41808 18432 40560 -1 2496 + 10000 5m 41808 18432 40560 -1 2496 + 40000 5m 46384 18432 45136 -1 2496 + 50000 5m 46592 18432 45344 -1 2496 + 100000 5m 48464 18432 47216 -1 2496 + 1000 40m 41808 18432 40560 -1 2496 + 10000 40m 41808 18432 40560 -1 2496 + 40000 40m 48464 18432 47216 -1 2496 + 50000 40m 49296 18432 48048 -1 2496 + 100000 40m 53872 18432 52624 -1 2496 + 1000 300m 41808 18432 40560 -1 2496 + 10000 300m 41808 18432 40560 -1 2496 + 40000 300m 64064 18432 62816 -1 2496 + 50000 300m 68848 18432 67600 -1 2496 + 100000 300m 92976 18432 91728 -1 2496 diff --git a/device/common/profiles/td2/gen/RDMA-CENTRIC/qos.json.j2 b/device/common/profiles/td2/gen/RDMA-CENTRIC/qos.json.j2 new file mode 100644 index 000000000000..853a6f812b1d --- /dev/null +++ b/device/common/profiles/td2/gen/RDMA-CENTRIC/qos.json.j2 @@ -0,0 +1,23 @@ +{% if ('type' in DEVICE_METADATA['localhost'] and 'BackEnd' in DEVICE_METADATA['localhost']['type'] and 'storage_device' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['storage_device'] == 'true') %} +{%- macro generate_wred_profiles() %} + "WRED_PROFILE": { + "AZURE_LOSSLESS" : { + "wred_green_enable" : "true", + "wred_yellow_enable" : "true", + "wred_red_enable" : "true", + "ecn" : "ecn_all", + "green_max_threshold" : "12000144", + "green_min_threshold" : "1048576", + "yellow_max_threshold" : "2097152", + "yellow_min_threshold" : "1048576", + "red_max_threshold" : "2097152", + "red_min_threshold" : "1048576", + "green_drop_probability" : "5", + "yellow_drop_probability": "5", + "red_drop_probability" : "5" + } + }, +{%- endmacro %} +{% endif %} + +{%- include 'qos_config.j2' %} diff --git a/device/common/profiles/td2/gen/TCP-CENTRIC b/device/common/profiles/td2/gen/TCP-CENTRIC new file mode 120000 index 000000000000..c1162371df69 --- /dev/null +++ b/device/common/profiles/td2/gen/TCP-CENTRIC @@ -0,0 +1 @@ +BALANCED/ \ No newline at end of file diff --git a/device/common/profiles/th/6100/BALANCED/buffers_defaults_t0.j2 b/device/common/profiles/th/6100/BALANCED/buffers_defaults_t0.j2 new file mode 100644 index 000000000000..ed5c9deac0c1 --- /dev/null +++ b/device/common/profiles/th/6100/BALANCED/buffers_defaults_t0.j2 @@ -0,0 +1,42 @@ + +{%- set default_cable = '5m' %} + +{%- include 'buffer_ports_t0.j2' %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "10875072", + "type": "ingress", + "mode": "dynamic", + "xoff": "4194112" + }, + "egress_lossy_pool": { + "size": "9243812", + "type": "egress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "15982720", + "type": "egress", + "mode": "static" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "dynamic_th":"3" + }, + "egress_lossless_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"1518", + "static_th":"15982720" + }, + "egress_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"1518", + "dynamic_th":"3" + } + }, +{%- endmacro %} diff --git a/device/common/profiles/th/6100/BALANCED/buffers_defaults_t1.j2 b/device/common/profiles/th/6100/BALANCED/buffers_defaults_t1.j2 new file mode 100644 index 000000000000..f1a4c9c2e2fe --- /dev/null +++ b/device/common/profiles/th/6100/BALANCED/buffers_defaults_t1.j2 @@ -0,0 +1,42 @@ + +{%- set default_cable = '40m' %} + +{%- include 'buffer_ports_t1.j2' %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "10875072", + "type": "ingress", + "mode": "dynamic", + "xoff": "4194112" + }, + "egress_lossy_pool": { + "size": "9243812", + "type": "egress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "15982720", + "type": "egress", + "mode": "static" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "dynamic_th":"3" + }, + "egress_lossless_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"1518", + "static_th":"15982720" + }, + "egress_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"1518", + "dynamic_th":"3" + } + }, +{%- endmacro %} diff --git a/device/common/profiles/th/6100/BALANCED/pg_profile_lookup.ini b/device/common/profiles/th/6100/BALANCED/pg_profile_lookup.ini new file mode 100644 index 000000000000..0b5d680edda7 --- /dev/null +++ b/device/common/profiles/th/6100/BALANCED/pg_profile_lookup.ini @@ -0,0 +1,17 @@ +# PG lossless profiles. +# speed cable size xon xoff threshold xon_offset + 10000 5m 1248 2288 35776 0 2288 + 25000 5m 1248 2288 53248 0 2288 + 40000 5m 1248 2288 66560 0 2288 + 50000 5m 1248 2288 79872 0 2288 + 100000 5m 1248 2288 165568 0 2288 + 10000 40m 1248 2288 37024 0 2288 + 25000 40m 1248 2288 56160 0 2288 + 40000 40m 1248 2288 71552 0 2288 + 50000 40m 1248 2288 85696 0 2288 + 100000 40m 1248 2288 177632 0 2288 + 10000 300m 1248 2288 46176 0 2288 + 25000 300m 1248 2288 79040 0 2288 + 40000 300m 1248 2288 108160 0 2288 + 50000 300m 1248 2288 141856 0 2288 + 100000 300m 1248 2288 268736 0 2288 diff --git a/device/common/profiles/th/6100/BALANCED/qos.json.j2 b/device/common/profiles/th/6100/BALANCED/qos.json.j2 new file mode 100644 index 000000000000..34002048afdb --- /dev/null +++ b/device/common/profiles/th/6100/BALANCED/qos.json.j2 @@ -0,0 +1,21 @@ +{%- macro generate_wred_profiles() %} + "WRED_PROFILE": { + "AZURE_LOSSLESS" : { + "wred_green_enable" : "true", + "wred_yellow_enable" : "true", + "wred_red_enable" : "true", + "ecn" : "ecn_all", + "green_max_threshold" : "2097152", + "green_min_threshold" : "250000", + "yellow_max_threshold" : "2097152", + "yellow_min_threshold" : "1048576", + "red_max_threshold" : "2097152", + "red_min_threshold" : "1048576", + "green_drop_probability" : "5", + "yellow_drop_probability": "5", + "red_drop_probability" : "5" + } + }, +{%- endmacro %} + +{%- include 'qos_config.j2' %} diff --git a/device/common/profiles/th/6100/RDMA-CENTRIC/buffers_defaults_t0.j2 b/device/common/profiles/th/6100/RDMA-CENTRIC/buffers_defaults_t0.j2 new file mode 100644 index 000000000000..813ee0f48c48 --- /dev/null +++ b/device/common/profiles/th/6100/RDMA-CENTRIC/buffers_defaults_t0.j2 @@ -0,0 +1,42 @@ + +{%- set default_cable = '5m' %} + +{%- include 'buffer_ports_t0.j2' %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "10875072", + "type": "ingress", + "mode": "dynamic", + "xoff": "4194112" + }, + "egress_lossy_pool": { + "size": "9243812", + "type": "egress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "15982720", + "type": "egress", + "mode": "static" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "static_th":"10875072" + }, + "egress_lossless_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"1518", + "static_th":"15982720" + }, + "egress_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"1518", + "dynamic_th":"3" + } + }, +{%- endmacro %} diff --git a/device/common/profiles/th/6100/RDMA-CENTRIC/buffers_defaults_t1.j2 b/device/common/profiles/th/6100/RDMA-CENTRIC/buffers_defaults_t1.j2 new file mode 100644 index 000000000000..14ef68e3ecfc --- /dev/null +++ b/device/common/profiles/th/6100/RDMA-CENTRIC/buffers_defaults_t1.j2 @@ -0,0 +1,42 @@ + +{%- set default_cable = '40m' %} + +{%- include 'buffer_ports_t1.j2' %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "10875072", + "type": "ingress", + "mode": "dynamic", + "xoff": "4194112" + }, + "egress_lossy_pool": { + "size": "9243812", + "type": "egress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "15982720", + "type": "egress", + "mode": "static" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "static_th":"10875072" + }, + "egress_lossless_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"1518", + "static_th":"15982720" + }, + "egress_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"1518", + "dynamic_th":"3" + } + }, +{%- endmacro %} diff --git a/device/common/profiles/th/6100/RDMA-CENTRIC/pg_profile_lookup.ini b/device/common/profiles/th/6100/RDMA-CENTRIC/pg_profile_lookup.ini new file mode 100644 index 000000000000..0b5d680edda7 --- /dev/null +++ b/device/common/profiles/th/6100/RDMA-CENTRIC/pg_profile_lookup.ini @@ -0,0 +1,17 @@ +# PG lossless profiles. +# speed cable size xon xoff threshold xon_offset + 10000 5m 1248 2288 35776 0 2288 + 25000 5m 1248 2288 53248 0 2288 + 40000 5m 1248 2288 66560 0 2288 + 50000 5m 1248 2288 79872 0 2288 + 100000 5m 1248 2288 165568 0 2288 + 10000 40m 1248 2288 37024 0 2288 + 25000 40m 1248 2288 56160 0 2288 + 40000 40m 1248 2288 71552 0 2288 + 50000 40m 1248 2288 85696 0 2288 + 100000 40m 1248 2288 177632 0 2288 + 10000 300m 1248 2288 46176 0 2288 + 25000 300m 1248 2288 79040 0 2288 + 40000 300m 1248 2288 108160 0 2288 + 50000 300m 1248 2288 141856 0 2288 + 100000 300m 1248 2288 268736 0 2288 diff --git a/device/common/profiles/th/6100/RDMA-CENTRIC/qos.json.j2 b/device/common/profiles/th/6100/RDMA-CENTRIC/qos.json.j2 new file mode 100644 index 000000000000..34002048afdb --- /dev/null +++ b/device/common/profiles/th/6100/RDMA-CENTRIC/qos.json.j2 @@ -0,0 +1,21 @@ +{%- macro generate_wred_profiles() %} + "WRED_PROFILE": { + "AZURE_LOSSLESS" : { + "wred_green_enable" : "true", + "wred_yellow_enable" : "true", + "wred_red_enable" : "true", + "ecn" : "ecn_all", + "green_max_threshold" : "2097152", + "green_min_threshold" : "250000", + "yellow_max_threshold" : "2097152", + "yellow_min_threshold" : "1048576", + "red_max_threshold" : "2097152", + "red_min_threshold" : "1048576", + "green_drop_probability" : "5", + "yellow_drop_probability": "5", + "red_drop_probability" : "5" + } + }, +{%- endmacro %} + +{%- include 'qos_config.j2' %} diff --git a/device/common/profiles/th/6100/TCP-CENTRIC b/device/common/profiles/th/6100/TCP-CENTRIC new file mode 120000 index 000000000000..d6f7127aa748 --- /dev/null +++ b/device/common/profiles/th/6100/TCP-CENTRIC @@ -0,0 +1 @@ +BALANCED \ No newline at end of file diff --git a/device/common/profiles/th/gen/BALANCED/buffers_defaults_t0.j2 b/device/common/profiles/th/gen/BALANCED/buffers_defaults_t0.j2 new file mode 100644 index 000000000000..c671233a02f5 --- /dev/null +++ b/device/common/profiles/th/gen/BALANCED/buffers_defaults_t0.j2 @@ -0,0 +1,41 @@ +{%- set default_cable = '5m' %} + +{%- include 'buffer_ports_t0.j2' %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "10875072", + "type": "ingress", + "mode": "dynamic", + "xoff": "4194112" + }, + "egress_lossy_pool": { + "size": "9243812", + "type": "egress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "15982720", + "type": "egress", + "mode": "static" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "dynamic_th":"3" + }, + "egress_lossless_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"1518", + "static_th":"15982720" + }, + "egress_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"1518", + "dynamic_th":"3" + } + }, +{%- endmacro %} diff --git a/device/common/profiles/th/gen/BALANCED/buffers_defaults_t1.j2 b/device/common/profiles/th/gen/BALANCED/buffers_defaults_t1.j2 new file mode 100644 index 000000000000..11aab2cabd45 --- /dev/null +++ b/device/common/profiles/th/gen/BALANCED/buffers_defaults_t1.j2 @@ -0,0 +1,41 @@ +{%- set default_cable = '40m' %} + +{%- include 'buffer_ports_t1.j2' %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "10875072", + "type": "ingress", + "mode": "dynamic", + "xoff": "4194112" + }, + "egress_lossy_pool": { + "size": "9243812", + "type": "egress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "15982720", + "type": "egress", + "mode": "static" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "dynamic_th":"3" + }, + "egress_lossless_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"1518", + "static_th":"15982720" + }, + "egress_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"1518", + "dynamic_th":"3" + } + }, +{%- endmacro %} diff --git a/device/common/profiles/th/gen/BALANCED/pg_profile_lookup.ini b/device/common/profiles/th/gen/BALANCED/pg_profile_lookup.ini new file mode 100644 index 000000000000..673df369a9bb --- /dev/null +++ b/device/common/profiles/th/gen/BALANCED/pg_profile_lookup.ini @@ -0,0 +1,17 @@ +# PG lossless profiles. +# speed cable size xon xoff threshold xon_offset + 10000 5m 1248 2288 35776 0 2288 + 25000 5m 1248 2288 53248 0 2288 + 40000 5m 1248 2288 66560 0 2288 + 50000 5m 1248 2288 90272 0 2288 + 100000 5m 1248 2288 165568 0 2288 + 10000 40m 1248 2288 37024 0 2288 + 25000 40m 1248 2288 53248 0 2288 + 40000 40m 1248 2288 71552 0 2288 + 50000 40m 1248 2288 96096 0 2288 + 100000 40m 1248 2288 177632 0 2288 + 10000 300m 1248 2288 46176 0 2288 + 25000 300m 1248 2288 79040 0 2288 + 40000 300m 1248 2288 108160 0 2288 + 50000 300m 1248 2288 141856 0 2288 + 100000 300m 1248 2288 268736 0 2288 diff --git a/device/common/profiles/th/gen/BALANCED/qos.json.j2 b/device/common/profiles/th/gen/BALANCED/qos.json.j2 new file mode 100644 index 000000000000..34002048afdb --- /dev/null +++ b/device/common/profiles/th/gen/BALANCED/qos.json.j2 @@ -0,0 +1,21 @@ +{%- macro generate_wred_profiles() %} + "WRED_PROFILE": { + "AZURE_LOSSLESS" : { + "wred_green_enable" : "true", + "wred_yellow_enable" : "true", + "wred_red_enable" : "true", + "ecn" : "ecn_all", + "green_max_threshold" : "2097152", + "green_min_threshold" : "250000", + "yellow_max_threshold" : "2097152", + "yellow_min_threshold" : "1048576", + "red_max_threshold" : "2097152", + "red_min_threshold" : "1048576", + "green_drop_probability" : "5", + "yellow_drop_probability": "5", + "red_drop_probability" : "5" + } + }, +{%- endmacro %} + +{%- include 'qos_config.j2' %} diff --git a/device/common/profiles/th/gen/RDMA-CENTRIC/buffers_defaults_t0.j2 b/device/common/profiles/th/gen/RDMA-CENTRIC/buffers_defaults_t0.j2 new file mode 100644 index 000000000000..3be881c5b495 --- /dev/null +++ b/device/common/profiles/th/gen/RDMA-CENTRIC/buffers_defaults_t0.j2 @@ -0,0 +1,41 @@ +{%- set default_cable = '5m' %} + +{%- include 'buffer_ports_t0.j2' %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "10875072", + "type": "ingress", + "mode": "dynamic", + "xoff": "4194112" + }, + "egress_lossy_pool": { + "size": "9243812", + "type": "egress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "15982720", + "type": "egress", + "mode": "static" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "static_th":"10875072" + }, + "egress_lossless_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"1518", + "static_th":"15982720" + }, + "egress_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"1518", + "dynamic_th":"3" + } + }, +{%- endmacro %} diff --git a/device/common/profiles/th/gen/RDMA-CENTRIC/buffers_defaults_t1.j2 b/device/common/profiles/th/gen/RDMA-CENTRIC/buffers_defaults_t1.j2 new file mode 100644 index 000000000000..8c9550c48d20 --- /dev/null +++ b/device/common/profiles/th/gen/RDMA-CENTRIC/buffers_defaults_t1.j2 @@ -0,0 +1,41 @@ +{%- set default_cable = '40m' %} + +{%- include 'buffer_ports_t1.j2' %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "10875072", + "type": "ingress", + "mode": "dynamic", + "xoff": "4194112" + }, + "egress_lossy_pool": { + "size": "9243812", + "type": "egress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "15982720", + "type": "egress", + "mode": "static" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "static_th":"10875072" + }, + "egress_lossless_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"1518", + "static_th":"15982720" + }, + "egress_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"1518", + "dynamic_th":"3" + } + }, +{%- endmacro %} diff --git a/device/common/profiles/th/gen/RDMA-CENTRIC/pg_profile_lookup.ini b/device/common/profiles/th/gen/RDMA-CENTRIC/pg_profile_lookup.ini new file mode 100644 index 000000000000..673df369a9bb --- /dev/null +++ b/device/common/profiles/th/gen/RDMA-CENTRIC/pg_profile_lookup.ini @@ -0,0 +1,17 @@ +# PG lossless profiles. +# speed cable size xon xoff threshold xon_offset + 10000 5m 1248 2288 35776 0 2288 + 25000 5m 1248 2288 53248 0 2288 + 40000 5m 1248 2288 66560 0 2288 + 50000 5m 1248 2288 90272 0 2288 + 100000 5m 1248 2288 165568 0 2288 + 10000 40m 1248 2288 37024 0 2288 + 25000 40m 1248 2288 53248 0 2288 + 40000 40m 1248 2288 71552 0 2288 + 50000 40m 1248 2288 96096 0 2288 + 100000 40m 1248 2288 177632 0 2288 + 10000 300m 1248 2288 46176 0 2288 + 25000 300m 1248 2288 79040 0 2288 + 40000 300m 1248 2288 108160 0 2288 + 50000 300m 1248 2288 141856 0 2288 + 100000 300m 1248 2288 268736 0 2288 diff --git a/device/common/profiles/th/gen/RDMA-CENTRIC/qos.json.j2 b/device/common/profiles/th/gen/RDMA-CENTRIC/qos.json.j2 new file mode 100644 index 000000000000..34002048afdb --- /dev/null +++ b/device/common/profiles/th/gen/RDMA-CENTRIC/qos.json.j2 @@ -0,0 +1,21 @@ +{%- macro generate_wred_profiles() %} + "WRED_PROFILE": { + "AZURE_LOSSLESS" : { + "wred_green_enable" : "true", + "wred_yellow_enable" : "true", + "wred_red_enable" : "true", + "ecn" : "ecn_all", + "green_max_threshold" : "2097152", + "green_min_threshold" : "250000", + "yellow_max_threshold" : "2097152", + "yellow_min_threshold" : "1048576", + "red_max_threshold" : "2097152", + "red_min_threshold" : "1048576", + "green_drop_probability" : "5", + "yellow_drop_probability": "5", + "red_drop_probability" : "5" + } + }, +{%- endmacro %} + +{%- include 'qos_config.j2' %} diff --git a/device/common/profiles/th/gen/TCP-CENTRIC b/device/common/profiles/th/gen/TCP-CENTRIC new file mode 120000 index 000000000000..d6f7127aa748 --- /dev/null +++ b/device/common/profiles/th/gen/TCP-CENTRIC @@ -0,0 +1 @@ +BALANCED \ No newline at end of file diff --git a/device/common/profiles/th2/7260/BALANCED/buffers_defaults_t0.j2 b/device/common/profiles/th2/7260/BALANCED/buffers_defaults_t0.j2 new file mode 100644 index 000000000000..415db3749fe4 --- /dev/null +++ b/device/common/profiles/th2/7260/BALANCED/buffers_defaults_t0.j2 @@ -0,0 +1,51 @@ +{%- set default_cable = '5m' %} + +{%- include 'buffer_ports_t0.j2' %} + +{%- import 'buffers_pool_sizes_t0.j2' as defs with context %} +{%- set ingress_lossless_pool_size = defs.ingress_lossless_pool_size %} +{%- set egress_lossy_pool_size = defs.egress_lossy_pool_size %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "{{ ingress_lossless_pool_size }}", + "type": "ingress", + "mode": "dynamic", + "xoff": "7827456" + }, + "egress_lossy_pool": { + "size": "{{ egress_lossy_pool_size }}", + "type": "egress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "42349632", + "type": "egress", + "mode": "static" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "static_th":"44302336" + }, + "egress_lossless_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"0", + "static_th":"42349632" + }, + "egress_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"1664", + "dynamic_th":"-1" + } + }, +{%- endmacro %} + +{% import 'buffers_extra_queues.j2' as defs with context %} + +{%- macro generate_queue_buffers_with_extra_lossless_queues(port_names, port_names_require_extra_buffer) %} +{{ defs.generate_queue_buffers_with_extra_lossless_queues(port_names, port_names_require_extra_buffer) }} +{%- endmacro %} diff --git a/device/common/profiles/th2/7260/BALANCED/buffers_defaults_t1.j2 b/device/common/profiles/th2/7260/BALANCED/buffers_defaults_t1.j2 new file mode 100644 index 000000000000..c2e4292dbd8a --- /dev/null +++ b/device/common/profiles/th2/7260/BALANCED/buffers_defaults_t1.j2 @@ -0,0 +1,57 @@ +{%- set default_cable = '300m' %} + +{%- include 'buffer_ports_t1.j2' %} + +{%- import 'buffers_pool_sizes_t1.j2' as defs with context %} +{%- set ingress_lossless_pool_size = defs.ingress_lossless_pool_size %} +{%- set egress_lossy_pool_size = defs.egress_lossy_pool_size %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + {# SS Tab2 Row 71 #} + "size": "{{ ingress_lossless_pool_size }}", + "type": "ingress", + "mode": "dynamic", + {# SS Tab2 Row 68 #} + "xoff": "8965632" + }, + "egress_lossy_pool": { + {# SS Tab2 Row 60 #} + "size": "{{ egress_lossy_pool_size }}", + "type": "egress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + {# SS Tab2 Row 56 #} + "size": "43481152", + "type": "egress", + "mode": "static" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + {# SS Tab1 Row 9 #} + "static_th":"44302336" + }, + "egress_lossless_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"0", + {# SS Tab2 Row 56 #} + "static_th":"43481152" + }, + "egress_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"1664", + "dynamic_th":"-1" + } + }, +{%- endmacro %} + +{% import 'buffers_extra_queues.j2' as defs1 with context %} + +{%- macro generate_queue_buffers_with_extra_lossless_queues(port_names, port_names_require_extra_buffer) %} +{{ defs1.generate_queue_buffers_with_extra_lossless_queues(port_names, port_names_require_extra_buffer) }} +{%- endmacro %} diff --git a/device/common/profiles/th2/7260/BALANCED/pg_profile_lookup.ini b/device/common/profiles/th2/7260/BALANCED/pg_profile_lookup.ini new file mode 100644 index 000000000000..0ff01d9aa52a --- /dev/null +++ b/device/common/profiles/th2/7260/BALANCED/pg_profile_lookup.ini @@ -0,0 +1,11 @@ +# PG lossless profiles. +# speed cable size xon xoff threshold xon_offset + 100000 5m 1248 1248 54080 0 2496 + 100000 40m 1248 1248 59696 0 2496 + 100000 300m 1248 1248 101088 0 2496 + 50000 5m 1248 1248 54080 0 2496 + 50000 40m 1248 1248 59696 0 2496 + 50000 300m 1248 1248 101088 0 2496 + 40000 5m 1248 1248 29536 0 2496 + 40000 40m 1248 1248 31616 0 2496 + 40000 300m 1248 1248 48256 0 2496 diff --git a/device/common/profiles/th2/7260/BALANCED/qos.json.j2 b/device/common/profiles/th2/7260/BALANCED/qos.json.j2 new file mode 100644 index 000000000000..743002c4f022 --- /dev/null +++ b/device/common/profiles/th2/7260/BALANCED/qos.json.j2 @@ -0,0 +1,458 @@ +{% if ('type' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['type'] == 'LeafRouter') %} +{% set different_dscp_to_tc_map = true %} +{%- macro generate_dscp_to_tc_map() %} + "DSCP_TO_TC_MAP": { + "AZURE": { + "0" : "1", + "1" : "1", + "2" : "2", + "3" : "3", + "4" : "4", + "5" : "1", + "6" : "6", + "7" : "1", + "8" : "0", + "9" : "1", + "10": "1", + "11": "1", + "12": "1", + "13": "1", + "14": "1", + "15": "1", + "16": "1", + "17": "1", + "18": "1", + "19": "1", + "20": "1", + "21": "1", + "22": "1", + "23": "1", + "24": "1", + "25": "1", + "26": "1", + "27": "1", + "28": "1", + "29": "1", + "30": "1", + "31": "1", + "32": "1", + "33": "1", + "34": "1", + "35": "1", + "36": "1", + "37": "1", + "38": "1", + "39": "1", + "40": "1", + "41": "1", + "42": "1", + "43": "1", + "44": "1", + "45": "1", + "46": "5", + "47": "1", + "48": "7", + "49": "1", + "50": "1", + "51": "1", + "52": "1", + "53": "1", + "54": "1", + "55": "1", + "56": "1", + "57": "1", + "58": "1", + "59": "1", + "60": "1", + "61": "1", + "62": "1", + "63": "1" + }, + "AZURE_UPLINK": { + "0" : "1", + "1" : "1", + "2" : "1", + "3" : "3", + "4" : "4", + "5" : "1", + "6" : "1", + "7" : "1", + "8" : "0", + "9" : "1", + "10": "1", + "11": "1", + "12": "1", + "13": "1", + "14": "1", + "15": "1", + "16": "1", + "17": "1", + "18": "1", + "19": "1", + "20": "1", + "21": "1", + "22": "1", + "23": "1", + "24": "1", + "25": "1", + "26": "1", + "27": "1", + "28": "1", + "29": "1", + "30": "1", + "31": "1", + "32": "1", + "33": "1", + "34": "1", + "35": "1", + "36": "1", + "37": "1", + "38": "1", + "39": "1", + "40": "1", + "41": "1", + "42": "1", + "43": "1", + "44": "1", + "45": "1", + "46": "5", + "47": "1", + "48": "7", + "49": "1", + "50": "1", + "51": "1", + "52": "1", + "53": "1", + "54": "1", + "55": "1", + "56": "1", + "57": "1", + "58": "1", + "59": "1", + "60": "1", + "61": "1", + "62": "1", + "63": "1" + } + }, +{%- endmacro %} +{%- macro generate_tc_to_pg_map() %} + "TC_TO_PRIORITY_GROUP_MAP": { + "AZURE": { + "0": "0", + "1": "0", + "2": "2", + "3": "3", + "4": "4", + "5": "0", + "6": "6", + "7": "0" + } + }, +{%- endmacro %} +{% elif ('subtype' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['subtype'] == 'DualToR') %} +{% set different_dscp_to_tc_map = true %} +{% set different_tc_to_queue_map = true %} +{%- macro generate_dscp_to_tc_map() %} + "DSCP_TO_TC_MAP": { + "AZURE": { + "0" : "1", + "1" : "1", + "2" : "1", + "3" : "3", + "4" : "4", + "5" : "1", + "6" : "1", + "7" : "1", + "8" : "0", + "9" : "1", + "10": "1", + "11": "1", + "12": "1", + "13": "1", + "14": "1", + "15": "1", + "16": "1", + "17": "1", + "18": "1", + "19": "1", + "20": "1", + "21": "1", + "22": "1", + "23": "1", + "24": "1", + "25": "1", + "26": "1", + "27": "1", + "28": "1", + "29": "1", + "30": "1", + "31": "1", + "32": "1", + "33": "8", + "34": "1", + "35": "1", + "36": "1", + "37": "1", + "38": "1", + "39": "1", + "40": "1", + "41": "1", + "42": "1", + "43": "1", + "44": "1", + "45": "1", + "46": "5", + "47": "1", + "48": "7", + "49": "1", + "50": "1", + "51": "1", + "52": "1", + "53": "1", + "54": "1", + "55": "1", + "56": "1", + "57": "1", + "58": "1", + "59": "1", + "60": "1", + "61": "1", + "62": "1", + "63": "1" + }, + "AZURE_UPLINK": { + "0" : "1", + "1" : "1", + "2" : "2", + "3" : "3", + "4" : "4", + "5" : "1", + "6" : "6", + "7" : "1", + "8" : "0", + "9" : "1", + "10": "1", + "11": "1", + "12": "1", + "13": "1", + "14": "1", + "15": "1", + "16": "1", + "17": "1", + "18": "1", + "19": "1", + "20": "1", + "21": "1", + "22": "1", + "23": "1", + "24": "1", + "25": "1", + "26": "1", + "27": "1", + "28": "1", + "29": "1", + "30": "1", + "31": "1", + "32": "1", + "33": "8", + "34": "1", + "35": "1", + "36": "1", + "37": "1", + "38": "1", + "39": "1", + "40": "1", + "41": "1", + "42": "1", + "43": "1", + "44": "1", + "45": "1", + "46": "5", + "47": "1", + "48": "7", + "49": "1", + "50": "1", + "51": "1", + "52": "1", + "53": "1", + "54": "1", + "55": "1", + "56": "1", + "57": "1", + "58": "1", + "59": "1", + "60": "1", + "61": "1", + "62": "1", + "63": "1" + }, + "AZURE_TUNNEL": { + "0" : "1", + "1" : "1", + "2" : "1", + "3" : "3", + "4" : "4", + "5" : "1", + "6" : "1", + "7" : "1", + "8" : "0", + "9" : "1", + "10": "1", + "11": "1", + "12": "1", + "13": "1", + "14": "1", + "15": "1", + "16": "1", + "17": "1", + "18": "1", + "19": "1", + "20": "1", + "21": "1", + "22": "1", + "23": "1", + "24": "1", + "25": "1", + "26": "1", + "27": "1", + "28": "1", + "29": "1", + "30": "1", + "31": "1", + "32": "1", + "33": "8", + "34": "1", + "35": "1", + "36": "1", + "37": "1", + "38": "1", + "39": "1", + "40": "1", + "41": "1", + "42": "1", + "43": "1", + "44": "1", + "45": "1", + "46": "5", + "47": "1", + "48": "7", + "49": "1", + "50": "1", + "51": "1", + "52": "1", + "53": "1", + "54": "1", + "55": "1", + "56": "1", + "57": "1", + "58": "1", + "59": "1", + "60": "1", + "61": "1", + "62": "1", + "63": "1" + } + }, +{%- endmacro %} +{%- macro generate_tc_to_pg_map() %} + "TC_TO_PRIORITY_GROUP_MAP": { + "AZURE": { + "0": "0", + "1": "0", + "2": "2", + "3": "3", + "4": "4", + "5": "0", + "6": "6", + "7": "0", + "8": "0" + }, + "AZURE_TUNNEL": { + "0": "0", + "1": "0", + "2": "0", + "3": "2", + "4": "6", + "5": "0", + "6": "0", + "7": "0", + "8": "0" + } + }, +{%- endmacro %} +{%- macro generate_tc_to_queue_map() %} + "TC_TO_QUEUE_MAP": { + "AZURE": { + "0": "0", + "1": "1", + "2": "1", + "3": "3", + "4": "4", + "5": "5", + "6": "1", + "7": "7", + "8": "1" + }, + "AZURE_UPLINK": { + "0": "0", + "1": "1", + "2": "2", + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7", + "8": "1" + }, + "AZURE_TUNNEL": { + "0": "0", + "1": "1", + "2": "1", + "3": "2", + "4": "6", + "5": "5", + "6": "1", + "7": "7", + "8": "1" + } + }, +{%- endmacro %} +{%- macro generate_tc_to_dscp_map() %} + "TC_TO_DSCP_MAP": { + "AZURE_TUNNEL": { + "0": "8", + "1": "0", + "2": "0", + "3": "2", + "4": "6", + "5": "46", + "6": "0", + "7": "48", + "8": "33" + } + }, +{%- endmacro %} +{% endif %} + +{%- macro generate_wred_profiles() %} + "WRED_PROFILE": { + "AZURE_LOSSLESS" : { + "wred_green_enable" : "true", + "wred_yellow_enable" : "true", + "wred_red_enable" : "true", + "ecn" : "ecn_all", + "green_max_threshold" : "10000000", + "green_min_threshold" : "2000000", + "yellow_max_threshold" : "2097152", + "yellow_min_threshold" : "1048576", + "red_max_threshold" : "2097152", + "red_min_threshold" : "1048576", + "green_drop_probability" : "5", + "yellow_drop_probability": "5", + "red_drop_probability" : "5" + } + }, +{%- endmacro %} + +{%- include 'qos_config.j2' %} diff --git a/device/common/profiles/th2/7260/RDMA-CENTRIC/buffers_defaults_t0.j2 b/device/common/profiles/th2/7260/RDMA-CENTRIC/buffers_defaults_t0.j2 new file mode 100644 index 000000000000..415db3749fe4 --- /dev/null +++ b/device/common/profiles/th2/7260/RDMA-CENTRIC/buffers_defaults_t0.j2 @@ -0,0 +1,51 @@ +{%- set default_cable = '5m' %} + +{%- include 'buffer_ports_t0.j2' %} + +{%- import 'buffers_pool_sizes_t0.j2' as defs with context %} +{%- set ingress_lossless_pool_size = defs.ingress_lossless_pool_size %} +{%- set egress_lossy_pool_size = defs.egress_lossy_pool_size %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "{{ ingress_lossless_pool_size }}", + "type": "ingress", + "mode": "dynamic", + "xoff": "7827456" + }, + "egress_lossy_pool": { + "size": "{{ egress_lossy_pool_size }}", + "type": "egress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "42349632", + "type": "egress", + "mode": "static" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "static_th":"44302336" + }, + "egress_lossless_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"0", + "static_th":"42349632" + }, + "egress_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"1664", + "dynamic_th":"-1" + } + }, +{%- endmacro %} + +{% import 'buffers_extra_queues.j2' as defs with context %} + +{%- macro generate_queue_buffers_with_extra_lossless_queues(port_names, port_names_require_extra_buffer) %} +{{ defs.generate_queue_buffers_with_extra_lossless_queues(port_names, port_names_require_extra_buffer) }} +{%- endmacro %} diff --git a/device/common/profiles/th2/7260/RDMA-CENTRIC/buffers_defaults_t1.j2 b/device/common/profiles/th2/7260/RDMA-CENTRIC/buffers_defaults_t1.j2 new file mode 100644 index 000000000000..0867c03b2497 --- /dev/null +++ b/device/common/profiles/th2/7260/RDMA-CENTRIC/buffers_defaults_t1.j2 @@ -0,0 +1,58 @@ +{%- set default_cable = '300m' %} + +{%- include 'buffer_ports_t1.j2' %} + +{%- import 'buffers_pool_sizes_t1.j2' as defs with context %} +{%- set ingress_lossless_pool_size = defs.ingress_lossless_pool_size %} +{%- set egress_lossy_pool_size = defs.egress_lossy_pool_size %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + {# SS Tab2 Row 71 #} + "size": "{{ ingress_lossless_pool_size }}", + "type": "ingress", + "mode": "dynamic", + {# SS Tab2 Row 68 #} + "xoff": "8965632" + }, + "egress_lossy_pool": { + {# SS Tab2 Row 60 #} + "size": "{{ egress_lossy_pool_size }}", + "type": "egress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + {# SS Tab2 Row 56 #} + "size": "43481152", + "type": "egress", + "mode": "static" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + {# SS Tab1 Row 9 #} + "static_th":"44302336" + }, + "egress_lossless_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"0", + {# SS Tab2 Row 56 #} + "static_th":"43481152" + }, + "egress_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"1664", + "dynamic_th":"-1" + } + }, +{%- endmacro %} + +{% import 'buffers_extra_queues.j2' as defs1 with context %} + +{%- macro generate_queue_buffers_with_extra_lossless_queues(port_names, port_names_require_extra_buffer) %} +{{ defs1.generate_queue_buffers_with_extra_lossless_queues(port_names, port_names_require_extra_buffer) }} +{%- endmacro %} + diff --git a/device/common/profiles/th2/7260/RDMA-CENTRIC/pg_profile_lookup.ini b/device/common/profiles/th2/7260/RDMA-CENTRIC/pg_profile_lookup.ini new file mode 100644 index 000000000000..0ff01d9aa52a --- /dev/null +++ b/device/common/profiles/th2/7260/RDMA-CENTRIC/pg_profile_lookup.ini @@ -0,0 +1,11 @@ +# PG lossless profiles. +# speed cable size xon xoff threshold xon_offset + 100000 5m 1248 1248 54080 0 2496 + 100000 40m 1248 1248 59696 0 2496 + 100000 300m 1248 1248 101088 0 2496 + 50000 5m 1248 1248 54080 0 2496 + 50000 40m 1248 1248 59696 0 2496 + 50000 300m 1248 1248 101088 0 2496 + 40000 5m 1248 1248 29536 0 2496 + 40000 40m 1248 1248 31616 0 2496 + 40000 300m 1248 1248 48256 0 2496 diff --git a/device/common/profiles/th2/7260/RDMA-CENTRIC/qos.json.j2 b/device/common/profiles/th2/7260/RDMA-CENTRIC/qos.json.j2 new file mode 100644 index 000000000000..743002c4f022 --- /dev/null +++ b/device/common/profiles/th2/7260/RDMA-CENTRIC/qos.json.j2 @@ -0,0 +1,458 @@ +{% if ('type' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['type'] == 'LeafRouter') %} +{% set different_dscp_to_tc_map = true %} +{%- macro generate_dscp_to_tc_map() %} + "DSCP_TO_TC_MAP": { + "AZURE": { + "0" : "1", + "1" : "1", + "2" : "2", + "3" : "3", + "4" : "4", + "5" : "1", + "6" : "6", + "7" : "1", + "8" : "0", + "9" : "1", + "10": "1", + "11": "1", + "12": "1", + "13": "1", + "14": "1", + "15": "1", + "16": "1", + "17": "1", + "18": "1", + "19": "1", + "20": "1", + "21": "1", + "22": "1", + "23": "1", + "24": "1", + "25": "1", + "26": "1", + "27": "1", + "28": "1", + "29": "1", + "30": "1", + "31": "1", + "32": "1", + "33": "1", + "34": "1", + "35": "1", + "36": "1", + "37": "1", + "38": "1", + "39": "1", + "40": "1", + "41": "1", + "42": "1", + "43": "1", + "44": "1", + "45": "1", + "46": "5", + "47": "1", + "48": "7", + "49": "1", + "50": "1", + "51": "1", + "52": "1", + "53": "1", + "54": "1", + "55": "1", + "56": "1", + "57": "1", + "58": "1", + "59": "1", + "60": "1", + "61": "1", + "62": "1", + "63": "1" + }, + "AZURE_UPLINK": { + "0" : "1", + "1" : "1", + "2" : "1", + "3" : "3", + "4" : "4", + "5" : "1", + "6" : "1", + "7" : "1", + "8" : "0", + "9" : "1", + "10": "1", + "11": "1", + "12": "1", + "13": "1", + "14": "1", + "15": "1", + "16": "1", + "17": "1", + "18": "1", + "19": "1", + "20": "1", + "21": "1", + "22": "1", + "23": "1", + "24": "1", + "25": "1", + "26": "1", + "27": "1", + "28": "1", + "29": "1", + "30": "1", + "31": "1", + "32": "1", + "33": "1", + "34": "1", + "35": "1", + "36": "1", + "37": "1", + "38": "1", + "39": "1", + "40": "1", + "41": "1", + "42": "1", + "43": "1", + "44": "1", + "45": "1", + "46": "5", + "47": "1", + "48": "7", + "49": "1", + "50": "1", + "51": "1", + "52": "1", + "53": "1", + "54": "1", + "55": "1", + "56": "1", + "57": "1", + "58": "1", + "59": "1", + "60": "1", + "61": "1", + "62": "1", + "63": "1" + } + }, +{%- endmacro %} +{%- macro generate_tc_to_pg_map() %} + "TC_TO_PRIORITY_GROUP_MAP": { + "AZURE": { + "0": "0", + "1": "0", + "2": "2", + "3": "3", + "4": "4", + "5": "0", + "6": "6", + "7": "0" + } + }, +{%- endmacro %} +{% elif ('subtype' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['subtype'] == 'DualToR') %} +{% set different_dscp_to_tc_map = true %} +{% set different_tc_to_queue_map = true %} +{%- macro generate_dscp_to_tc_map() %} + "DSCP_TO_TC_MAP": { + "AZURE": { + "0" : "1", + "1" : "1", + "2" : "1", + "3" : "3", + "4" : "4", + "5" : "1", + "6" : "1", + "7" : "1", + "8" : "0", + "9" : "1", + "10": "1", + "11": "1", + "12": "1", + "13": "1", + "14": "1", + "15": "1", + "16": "1", + "17": "1", + "18": "1", + "19": "1", + "20": "1", + "21": "1", + "22": "1", + "23": "1", + "24": "1", + "25": "1", + "26": "1", + "27": "1", + "28": "1", + "29": "1", + "30": "1", + "31": "1", + "32": "1", + "33": "8", + "34": "1", + "35": "1", + "36": "1", + "37": "1", + "38": "1", + "39": "1", + "40": "1", + "41": "1", + "42": "1", + "43": "1", + "44": "1", + "45": "1", + "46": "5", + "47": "1", + "48": "7", + "49": "1", + "50": "1", + "51": "1", + "52": "1", + "53": "1", + "54": "1", + "55": "1", + "56": "1", + "57": "1", + "58": "1", + "59": "1", + "60": "1", + "61": "1", + "62": "1", + "63": "1" + }, + "AZURE_UPLINK": { + "0" : "1", + "1" : "1", + "2" : "2", + "3" : "3", + "4" : "4", + "5" : "1", + "6" : "6", + "7" : "1", + "8" : "0", + "9" : "1", + "10": "1", + "11": "1", + "12": "1", + "13": "1", + "14": "1", + "15": "1", + "16": "1", + "17": "1", + "18": "1", + "19": "1", + "20": "1", + "21": "1", + "22": "1", + "23": "1", + "24": "1", + "25": "1", + "26": "1", + "27": "1", + "28": "1", + "29": "1", + "30": "1", + "31": "1", + "32": "1", + "33": "8", + "34": "1", + "35": "1", + "36": "1", + "37": "1", + "38": "1", + "39": "1", + "40": "1", + "41": "1", + "42": "1", + "43": "1", + "44": "1", + "45": "1", + "46": "5", + "47": "1", + "48": "7", + "49": "1", + "50": "1", + "51": "1", + "52": "1", + "53": "1", + "54": "1", + "55": "1", + "56": "1", + "57": "1", + "58": "1", + "59": "1", + "60": "1", + "61": "1", + "62": "1", + "63": "1" + }, + "AZURE_TUNNEL": { + "0" : "1", + "1" : "1", + "2" : "1", + "3" : "3", + "4" : "4", + "5" : "1", + "6" : "1", + "7" : "1", + "8" : "0", + "9" : "1", + "10": "1", + "11": "1", + "12": "1", + "13": "1", + "14": "1", + "15": "1", + "16": "1", + "17": "1", + "18": "1", + "19": "1", + "20": "1", + "21": "1", + "22": "1", + "23": "1", + "24": "1", + "25": "1", + "26": "1", + "27": "1", + "28": "1", + "29": "1", + "30": "1", + "31": "1", + "32": "1", + "33": "8", + "34": "1", + "35": "1", + "36": "1", + "37": "1", + "38": "1", + "39": "1", + "40": "1", + "41": "1", + "42": "1", + "43": "1", + "44": "1", + "45": "1", + "46": "5", + "47": "1", + "48": "7", + "49": "1", + "50": "1", + "51": "1", + "52": "1", + "53": "1", + "54": "1", + "55": "1", + "56": "1", + "57": "1", + "58": "1", + "59": "1", + "60": "1", + "61": "1", + "62": "1", + "63": "1" + } + }, +{%- endmacro %} +{%- macro generate_tc_to_pg_map() %} + "TC_TO_PRIORITY_GROUP_MAP": { + "AZURE": { + "0": "0", + "1": "0", + "2": "2", + "3": "3", + "4": "4", + "5": "0", + "6": "6", + "7": "0", + "8": "0" + }, + "AZURE_TUNNEL": { + "0": "0", + "1": "0", + "2": "0", + "3": "2", + "4": "6", + "5": "0", + "6": "0", + "7": "0", + "8": "0" + } + }, +{%- endmacro %} +{%- macro generate_tc_to_queue_map() %} + "TC_TO_QUEUE_MAP": { + "AZURE": { + "0": "0", + "1": "1", + "2": "1", + "3": "3", + "4": "4", + "5": "5", + "6": "1", + "7": "7", + "8": "1" + }, + "AZURE_UPLINK": { + "0": "0", + "1": "1", + "2": "2", + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7", + "8": "1" + }, + "AZURE_TUNNEL": { + "0": "0", + "1": "1", + "2": "1", + "3": "2", + "4": "6", + "5": "5", + "6": "1", + "7": "7", + "8": "1" + } + }, +{%- endmacro %} +{%- macro generate_tc_to_dscp_map() %} + "TC_TO_DSCP_MAP": { + "AZURE_TUNNEL": { + "0": "8", + "1": "0", + "2": "0", + "3": "2", + "4": "6", + "5": "46", + "6": "0", + "7": "48", + "8": "33" + } + }, +{%- endmacro %} +{% endif %} + +{%- macro generate_wred_profiles() %} + "WRED_PROFILE": { + "AZURE_LOSSLESS" : { + "wred_green_enable" : "true", + "wred_yellow_enable" : "true", + "wred_red_enable" : "true", + "ecn" : "ecn_all", + "green_max_threshold" : "10000000", + "green_min_threshold" : "2000000", + "yellow_max_threshold" : "2097152", + "yellow_min_threshold" : "1048576", + "red_max_threshold" : "2097152", + "red_min_threshold" : "1048576", + "green_drop_probability" : "5", + "yellow_drop_probability": "5", + "red_drop_probability" : "5" + } + }, +{%- endmacro %} + +{%- include 'qos_config.j2' %} diff --git a/device/common/profiles/th2/7260/TCP-CENTRIC b/device/common/profiles/th2/7260/TCP-CENTRIC new file mode 120000 index 000000000000..d6f7127aa748 --- /dev/null +++ b/device/common/profiles/th2/7260/TCP-CENTRIC @@ -0,0 +1 @@ +BALANCED \ No newline at end of file diff --git a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q20S48/BALANCED b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q20S48/BALANCED new file mode 120000 index 000000000000..af1545f14b74 --- /dev/null +++ b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q20S48/BALANCED @@ -0,0 +1 @@ +../../../common/profiles/td2/6000/BALANCED \ No newline at end of file diff --git a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q20S48/RDMA-CENTRIC b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q20S48/RDMA-CENTRIC new file mode 120000 index 000000000000..f65c31fb2e59 --- /dev/null +++ b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q20S48/RDMA-CENTRIC @@ -0,0 +1 @@ +../../../common/profiles/td2/6000/RDMA-CENTRIC \ No newline at end of file diff --git a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q20S48/TCP-CENTRIC b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q20S48/TCP-CENTRIC new file mode 120000 index 000000000000..46569c641476 --- /dev/null +++ b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q20S48/TCP-CENTRIC @@ -0,0 +1 @@ +../../../common/profiles/td2/6000/TCP-CENTRIC \ No newline at end of file diff --git a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q20S48/buffer_ports_t0.j2 b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q20S48/buffer_ports_t0.j2 new file mode 100644 index 000000000000..eb2755f69f9b --- /dev/null +++ b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q20S48/buffer_ports_t0.j2 @@ -0,0 +1,24 @@ +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {% for port_idx in range(0,8) %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} + {% endfor %} + {% for port_idx in range(8,14) %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 1)) %}{% endif %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 2)) %}{% endif %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 3)) %}{% endif %} + {% endfor %} + {% for port_idx in range(14,18) %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} + {% endfor %} + {% for port_idx in range(18,24) %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 1)) %}{% endif %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 2)) %}{% endif %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 3)) %}{% endif %} + {% endfor %} + {% for port_idx in range(24,32) %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} + {% endfor %} +{%- endmacro %} diff --git a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q20S48/buffer_ports_t1.j2 b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q20S48/buffer_ports_t1.j2 new file mode 100644 index 000000000000..eb2755f69f9b --- /dev/null +++ b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q20S48/buffer_ports_t1.j2 @@ -0,0 +1,24 @@ +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {% for port_idx in range(0,8) %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} + {% endfor %} + {% for port_idx in range(8,14) %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 1)) %}{% endif %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 2)) %}{% endif %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 3)) %}{% endif %} + {% endfor %} + {% for port_idx in range(14,18) %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} + {% endfor %} + {% for port_idx in range(18,24) %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 1)) %}{% endif %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 2)) %}{% endif %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 3)) %}{% endif %} + {% endfor %} + {% for port_idx in range(24,32) %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} + {% endfor %} +{%- endmacro %} diff --git a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q20S48/buffers_defaults_t0.j2 b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q20S48/buffers_defaults_t0.j2 deleted file mode 100755 index 8243498dd31c..000000000000 --- a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q20S48/buffers_defaults_t0.j2 +++ /dev/null @@ -1,63 +0,0 @@ -{%- set default_cable = '300m' %} - -{%- macro generate_port_lists(PORT_ALL) %} - {# Generate list of ports #} - {% for port_idx in range(0,8) %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} - {% endfor %} - {% for port_idx in range(8,14) %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 1)) %}{% endif %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 2)) %}{% endif %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 3)) %}{% endif %} - {% endfor %} - {% for port_idx in range(14,18) %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} - {% endfor %} - {% for port_idx in range(18,24) %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 1)) %}{% endif %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 2)) %}{% endif %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 3)) %}{% endif %} - {% endfor %} - {% for port_idx in range(24,32) %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} - {% endfor %} -{%- endmacro %} - -{%- macro generate_buffer_pool_and_profiles() %} - "BUFFER_POOL": { - "ingress_lossless_pool": { - "size": "12766208", - "type": "ingress", - "mode": "dynamic" - }, - "egress_lossless_pool": { - "size": "12766208", - "type": "egress", - "mode": "static" - }, - "egress_lossy_pool": { - "size": "7326924", - "type": "egress", - "mode": "dynamic" - } - }, - "BUFFER_PROFILE": { - "ingress_lossy_profile": { - "pool":"[BUFFER_POOL|ingress_lossless_pool]", - "size":"0", - "dynamic_th":"3" - }, - "egress_lossless_profile": { - "pool":"[BUFFER_POOL|egress_lossless_pool]", - "size":"0", - "static_th":"12766208" - }, - "egress_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"1518", - "dynamic_th":"3" - } - }, -{%- endmacro %} diff --git a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q20S48/buffers_defaults_t0.j2 b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q20S48/buffers_defaults_t0.j2 new file mode 120000 index 000000000000..9524e6a476ac --- /dev/null +++ b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q20S48/buffers_defaults_t0.j2 @@ -0,0 +1 @@ +BALANCED/buffers_defaults_t0.j2 \ No newline at end of file diff --git a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q20S48/buffers_defaults_t1.j2 b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q20S48/buffers_defaults_t1.j2 deleted file mode 100755 index 8243498dd31c..000000000000 --- a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q20S48/buffers_defaults_t1.j2 +++ /dev/null @@ -1,63 +0,0 @@ -{%- set default_cable = '300m' %} - -{%- macro generate_port_lists(PORT_ALL) %} - {# Generate list of ports #} - {% for port_idx in range(0,8) %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} - {% endfor %} - {% for port_idx in range(8,14) %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 1)) %}{% endif %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 2)) %}{% endif %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 3)) %}{% endif %} - {% endfor %} - {% for port_idx in range(14,18) %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} - {% endfor %} - {% for port_idx in range(18,24) %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 1)) %}{% endif %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 2)) %}{% endif %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 3)) %}{% endif %} - {% endfor %} - {% for port_idx in range(24,32) %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} - {% endfor %} -{%- endmacro %} - -{%- macro generate_buffer_pool_and_profiles() %} - "BUFFER_POOL": { - "ingress_lossless_pool": { - "size": "12766208", - "type": "ingress", - "mode": "dynamic" - }, - "egress_lossless_pool": { - "size": "12766208", - "type": "egress", - "mode": "static" - }, - "egress_lossy_pool": { - "size": "7326924", - "type": "egress", - "mode": "dynamic" - } - }, - "BUFFER_PROFILE": { - "ingress_lossy_profile": { - "pool":"[BUFFER_POOL|ingress_lossless_pool]", - "size":"0", - "dynamic_th":"3" - }, - "egress_lossless_profile": { - "pool":"[BUFFER_POOL|egress_lossless_pool]", - "size":"0", - "static_th":"12766208" - }, - "egress_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"1518", - "dynamic_th":"3" - } - }, -{%- endmacro %} diff --git a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q20S48/buffers_defaults_t1.j2 b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q20S48/buffers_defaults_t1.j2 new file mode 120000 index 000000000000..c25cc95d6d57 --- /dev/null +++ b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q20S48/buffers_defaults_t1.j2 @@ -0,0 +1 @@ +BALANCED/buffers_defaults_t1.j2 \ No newline at end of file diff --git a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q20S48/pg_profile_lookup.ini b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q20S48/pg_profile_lookup.ini deleted file mode 100755 index 9f2eacb6fc42..000000000000 --- a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q20S48/pg_profile_lookup.ini +++ /dev/null @@ -1,17 +0,0 @@ -# PG lossless profiles. -# speed cable size xon xoff threshold xon_offset - 10000 5m 56368 18432 55120 -3 2496 - 25000 5m 56368 18432 55120 -3 2496 - 40000 5m 56368 18432 55120 -3 2496 - 50000 5m 56368 18432 55120 -3 2496 - 100000 5m 56368 18432 55120 -3 2496 - 10000 40m 56368 18432 55120 -3 2496 - 25000 40m 56368 18432 55120 -3 2496 - 40000 40m 56368 18432 55120 -3 2496 - 50000 40m 56368 18432 55120 -3 2496 - 100000 40m 56368 18432 55120 -3 2496 - 10000 300m 56368 18432 55120 -3 2496 - 25000 300m 56368 18432 55120 -3 2496 - 40000 300m 56368 18432 55120 -3 2496 - 50000 300m 56368 18432 55120 -3 2496 - 100000 300m 56368 18432 55120 -3 2496 diff --git a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q20S48/pg_profile_lookup.ini b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q20S48/pg_profile_lookup.ini new file mode 120000 index 000000000000..297cddb2d223 --- /dev/null +++ b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q20S48/pg_profile_lookup.ini @@ -0,0 +1 @@ +BALANCED/pg_profile_lookup.ini \ No newline at end of file diff --git a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q20S48/qos.json.j2 b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q20S48/qos.json.j2 deleted file mode 100755 index 3e548325ea30..000000000000 --- a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q20S48/qos.json.j2 +++ /dev/null @@ -1 +0,0 @@ -{%- include 'qos_config.j2' %} diff --git a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q20S48/qos.json.j2 b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q20S48/qos.json.j2 new file mode 120000 index 000000000000..aef6b6765cf2 --- /dev/null +++ b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q20S48/qos.json.j2 @@ -0,0 +1 @@ +BALANCED/qos.json.j2 \ No newline at end of file diff --git a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q20S48/td2-s6000-20x40G-48x10G.config.bcm b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q20S48/td2-s6000-20x40G-48x10G.config.bcm index d63f589d4fc9..55b5782d40ed 100755 --- a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q20S48/td2-s6000-20x40G-48x10G.config.bcm +++ b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q20S48/td2-s6000-20x40G-48x10G.config.bcm @@ -10,6 +10,12 @@ ipv6_lpm_128b_enable=1 l2_mem_entries=32768 l3_mem_entries=16384 +# disables bcmALPMDH (ALPM distributed hitbit) thread. This thread is purely for debug purpose +l3_alpm_hit_skip=1 + +# Disable Counting ACL Drop towards interface RX_DRP counter +sai_adjust_acl_drop_in_rx_drop=1 + # From old config file os=unix higig2_hdr_mode=1 diff --git a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q24S32/BALANCED b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q24S32/BALANCED new file mode 120000 index 000000000000..af1545f14b74 --- /dev/null +++ b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q24S32/BALANCED @@ -0,0 +1 @@ +../../../common/profiles/td2/6000/BALANCED \ No newline at end of file diff --git a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q24S32/RDMA-CENTRIC b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q24S32/RDMA-CENTRIC new file mode 120000 index 000000000000..f65c31fb2e59 --- /dev/null +++ b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q24S32/RDMA-CENTRIC @@ -0,0 +1 @@ +../../../common/profiles/td2/6000/RDMA-CENTRIC \ No newline at end of file diff --git a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q24S32/TCP-CENTRIC b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q24S32/TCP-CENTRIC new file mode 120000 index 000000000000..46569c641476 --- /dev/null +++ b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q24S32/TCP-CENTRIC @@ -0,0 +1 @@ +../../../common/profiles/td2/6000/TCP-CENTRIC \ No newline at end of file diff --git a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q24S32/buffer_ports_t0.j2 b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q24S32/buffer_ports_t0.j2 new file mode 100644 index 000000000000..8022ef6ac62f --- /dev/null +++ b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q24S32/buffer_ports_t0.j2 @@ -0,0 +1,15 @@ +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {% for port_idx in range(0,16) %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} + {% endfor %} + {% for port_idx in range(16,25) %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 1)) %}{% endif %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 2)) %}{% endif %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 3)) %}{% endif %} + {% endfor %} + {% for port_idx in range(25,32) %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} + {% endfor %} +{%- endmacro %} diff --git a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q24S32/buffer_ports_t1.j2 b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q24S32/buffer_ports_t1.j2 new file mode 100644 index 000000000000..f68696528a51 --- /dev/null +++ b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q24S32/buffer_ports_t1.j2 @@ -0,0 +1,16 @@ +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {% for port_idx in range(0,16) %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} + {% endfor %} + {% for port_idx in range(16,25) %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 1)) %}{% endif %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 2)) %}{% endif %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 3)) %}{% endif %} + + {% endfor %} + {% for port_idx in range(25,32) %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} + {% endfor %} +{%- endmacro %} diff --git a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q24S32/buffers_defaults_t0.j2 b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q24S32/buffers_defaults_t0.j2 deleted file mode 100755 index 9d37f8a579db..000000000000 --- a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q24S32/buffers_defaults_t0.j2 +++ /dev/null @@ -1,55 +0,0 @@ -{%- set default_cable = '300m' %} - -{%- macro generate_port_lists(PORT_ALL) %} - {# Generate list of ports #} - {% for port_idx in range(0,16) %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} - {% endfor %} - {% for port_idx in range(16,25) %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 1)) %}{% endif %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 2)) %}{% endif %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 3)) %}{% endif %} - - {% endfor %} - {% for port_idx in range(25,32) %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} - {% endfor %} -{%- endmacro %} - -{%- macro generate_buffer_pool_and_profiles() %} - "BUFFER_POOL": { - "ingress_lossless_pool": { - "size": "12766208", - "type": "ingress", - "mode": "dynamic" - }, - "egress_lossless_pool": { - "size": "12766208", - "type": "egress", - "mode": "static" - }, - "egress_lossy_pool": { - "size": "7326924", - "type": "egress", - "mode": "dynamic" - } - }, - "BUFFER_PROFILE": { - "ingress_lossy_profile": { - "pool":"[BUFFER_POOL|ingress_lossless_pool]", - "size":"0", - "dynamic_th":"3" - }, - "egress_lossless_profile": { - "pool":"[BUFFER_POOL|egress_lossless_pool]", - "size":"0", - "static_th":"12766208" - }, - "egress_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"1518", - "dynamic_th":"3" - } - }, -{%- endmacro %} diff --git a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q24S32/buffers_defaults_t0.j2 b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q24S32/buffers_defaults_t0.j2 new file mode 120000 index 000000000000..9524e6a476ac --- /dev/null +++ b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q24S32/buffers_defaults_t0.j2 @@ -0,0 +1 @@ +BALANCED/buffers_defaults_t0.j2 \ No newline at end of file diff --git a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q24S32/buffers_defaults_t1.j2 b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q24S32/buffers_defaults_t1.j2 deleted file mode 100755 index 9d37f8a579db..000000000000 --- a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q24S32/buffers_defaults_t1.j2 +++ /dev/null @@ -1,55 +0,0 @@ -{%- set default_cable = '300m' %} - -{%- macro generate_port_lists(PORT_ALL) %} - {# Generate list of ports #} - {% for port_idx in range(0,16) %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} - {% endfor %} - {% for port_idx in range(16,25) %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 1)) %}{% endif %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 2)) %}{% endif %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 3)) %}{% endif %} - - {% endfor %} - {% for port_idx in range(25,32) %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} - {% endfor %} -{%- endmacro %} - -{%- macro generate_buffer_pool_and_profiles() %} - "BUFFER_POOL": { - "ingress_lossless_pool": { - "size": "12766208", - "type": "ingress", - "mode": "dynamic" - }, - "egress_lossless_pool": { - "size": "12766208", - "type": "egress", - "mode": "static" - }, - "egress_lossy_pool": { - "size": "7326924", - "type": "egress", - "mode": "dynamic" - } - }, - "BUFFER_PROFILE": { - "ingress_lossy_profile": { - "pool":"[BUFFER_POOL|ingress_lossless_pool]", - "size":"0", - "dynamic_th":"3" - }, - "egress_lossless_profile": { - "pool":"[BUFFER_POOL|egress_lossless_pool]", - "size":"0", - "static_th":"12766208" - }, - "egress_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"1518", - "dynamic_th":"3" - } - }, -{%- endmacro %} diff --git a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q24S32/buffers_defaults_t1.j2 b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q24S32/buffers_defaults_t1.j2 new file mode 120000 index 000000000000..c25cc95d6d57 --- /dev/null +++ b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q24S32/buffers_defaults_t1.j2 @@ -0,0 +1 @@ +BALANCED/buffers_defaults_t1.j2 \ No newline at end of file diff --git a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q24S32/pg_profile_lookup.ini b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q24S32/pg_profile_lookup.ini deleted file mode 100755 index 9f2eacb6fc42..000000000000 --- a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q24S32/pg_profile_lookup.ini +++ /dev/null @@ -1,17 +0,0 @@ -# PG lossless profiles. -# speed cable size xon xoff threshold xon_offset - 10000 5m 56368 18432 55120 -3 2496 - 25000 5m 56368 18432 55120 -3 2496 - 40000 5m 56368 18432 55120 -3 2496 - 50000 5m 56368 18432 55120 -3 2496 - 100000 5m 56368 18432 55120 -3 2496 - 10000 40m 56368 18432 55120 -3 2496 - 25000 40m 56368 18432 55120 -3 2496 - 40000 40m 56368 18432 55120 -3 2496 - 50000 40m 56368 18432 55120 -3 2496 - 100000 40m 56368 18432 55120 -3 2496 - 10000 300m 56368 18432 55120 -3 2496 - 25000 300m 56368 18432 55120 -3 2496 - 40000 300m 56368 18432 55120 -3 2496 - 50000 300m 56368 18432 55120 -3 2496 - 100000 300m 56368 18432 55120 -3 2496 diff --git a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q24S32/pg_profile_lookup.ini b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q24S32/pg_profile_lookup.ini new file mode 120000 index 000000000000..297cddb2d223 --- /dev/null +++ b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q24S32/pg_profile_lookup.ini @@ -0,0 +1 @@ +BALANCED/pg_profile_lookup.ini \ No newline at end of file diff --git a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q24S32/qos.json.j2 b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q24S32/qos.json.j2 deleted file mode 100755 index 3e548325ea30..000000000000 --- a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q24S32/qos.json.j2 +++ /dev/null @@ -1 +0,0 @@ -{%- include 'qos_config.j2' %} diff --git a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q24S32/qos.json.j2 b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q24S32/qos.json.j2 new file mode 120000 index 000000000000..aef6b6765cf2 --- /dev/null +++ b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q24S32/qos.json.j2 @@ -0,0 +1 @@ +BALANCED/qos.json.j2 \ No newline at end of file diff --git a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q24S32/td2-s6000-24x40G-32x10G.config.bcm b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q24S32/td2-s6000-24x40G-32x10G.config.bcm index 5734e9ee5b1d..ab5222bda7b7 100755 --- a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q24S32/td2-s6000-24x40G-32x10G.config.bcm +++ b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q24S32/td2-s6000-24x40G-32x10G.config.bcm @@ -10,6 +10,12 @@ ipv6_lpm_128b_enable=1 l2_mem_entries=32768 l3_mem_entries=16384 +# disables bcmALPMDH (ALPM distributed hitbit) thread. This thread is purely for debug purpose +l3_alpm_hit_skip=1 + +# Disable Counting ACL Drop towards interface RX_DRP counter +sai_adjust_acl_drop_in_rx_drop=1 + # From old config file os=unix higig2_hdr_mode=1 diff --git a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q28S16/BALANCED b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q28S16/BALANCED new file mode 120000 index 000000000000..af1545f14b74 --- /dev/null +++ b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q28S16/BALANCED @@ -0,0 +1 @@ +../../../common/profiles/td2/6000/BALANCED \ No newline at end of file diff --git a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q28S16/RDMA-CENTRIC b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q28S16/RDMA-CENTRIC new file mode 120000 index 000000000000..f65c31fb2e59 --- /dev/null +++ b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q28S16/RDMA-CENTRIC @@ -0,0 +1 @@ +../../../common/profiles/td2/6000/RDMA-CENTRIC \ No newline at end of file diff --git a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q28S16/TCP-CENTRIC b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q28S16/TCP-CENTRIC new file mode 120000 index 000000000000..46569c641476 --- /dev/null +++ b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q28S16/TCP-CENTRIC @@ -0,0 +1 @@ +../../../common/profiles/td2/6000/TCP-CENTRIC \ No newline at end of file diff --git a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q28S16/buffer_ports_t0.j2 b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q28S16/buffer_ports_t0.j2 new file mode 100644 index 000000000000..520c2cb112a6 --- /dev/null +++ b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q28S16/buffer_ports_t0.j2 @@ -0,0 +1,39 @@ +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {% for port_idx in range(0,1) %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 1)) %}{% endif %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 2)) %}{% endif %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 3)) %}{% endif %} + {% endfor %} + {% for port_idx in range(1,2) %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} + {% endfor %} + {% for port_idx in range(2,3) %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 1)) %}{% endif %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 2)) %}{% endif %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 3)) %}{% endif %} + {% endfor %} + {% for port_idx in range(3,4) %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} + {% endfor %} + {% for port_idx in range(4,5) %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 1)) %}{% endif %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 2)) %}{% endif %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 3)) %}{% endif %} + {% endfor %} + {% for port_idx in range(5,6) %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} + {% endfor %} + {% for port_idx in range(6,7) %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 1)) %}{% endif %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 2)) %}{% endif %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 3)) %}{% endif %} + {% endfor %} + {% for port_idx in range(7,32) %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} + {% endfor %} +{%- endmacro %} diff --git a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q28S16/buffer_ports_t1.j2 b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q28S16/buffer_ports_t1.j2 new file mode 100644 index 000000000000..520c2cb112a6 --- /dev/null +++ b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q28S16/buffer_ports_t1.j2 @@ -0,0 +1,39 @@ +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {% for port_idx in range(0,1) %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 1)) %}{% endif %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 2)) %}{% endif %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 3)) %}{% endif %} + {% endfor %} + {% for port_idx in range(1,2) %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} + {% endfor %} + {% for port_idx in range(2,3) %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 1)) %}{% endif %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 2)) %}{% endif %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 3)) %}{% endif %} + {% endfor %} + {% for port_idx in range(3,4) %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} + {% endfor %} + {% for port_idx in range(4,5) %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 1)) %}{% endif %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 2)) %}{% endif %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 3)) %}{% endif %} + {% endfor %} + {% for port_idx in range(5,6) %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} + {% endfor %} + {% for port_idx in range(6,7) %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 1)) %}{% endif %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 2)) %}{% endif %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 3)) %}{% endif %} + {% endfor %} + {% for port_idx in range(7,32) %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} + {% endfor %} +{%- endmacro %} diff --git a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q28S16/buffers_defaults_t0.j2 b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q28S16/buffers_defaults_t0.j2 deleted file mode 100755 index b5a7336e0511..000000000000 --- a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q28S16/buffers_defaults_t0.j2 +++ /dev/null @@ -1,78 +0,0 @@ -{%- set default_cable = '300m' %} - -{%- macro generate_port_lists(PORT_ALL) %} - {# Generate list of ports #} - {% for port_idx in range(0,1) %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 1)) %}{% endif %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 2)) %}{% endif %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 3)) %}{% endif %} - {% endfor %} - {% for port_idx in range(1,2) %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} - {% endfor %} - {% for port_idx in range(2,3) %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 1)) %}{% endif %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 2)) %}{% endif %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 3)) %}{% endif %} - {% endfor %} - {% for port_idx in range(3,4) %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} - {% endfor %} - {% for port_idx in range(4,5) %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 1)) %}{% endif %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 2)) %}{% endif %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 3)) %}{% endif %} - {% endfor %} - {% for port_idx in range(5,6) %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} - {% endfor %} - {% for port_idx in range(6,7) %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 1)) %}{% endif %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 2)) %}{% endif %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 3)) %}{% endif %} - {% endfor %} - {% for port_idx in range(7,32) %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} - {% endfor %} -{%- endmacro %} - -{%- macro generate_buffer_pool_and_profiles() %} - "BUFFER_POOL": { - "ingress_lossless_pool": { - "size": "12766208", - "type": "ingress", - "mode": "dynamic" - }, - "egress_lossless_pool": { - "size": "12766208", - "type": "egress", - "mode": "static" - }, - "egress_lossy_pool": { - "size": "7326924", - "type": "egress", - "mode": "dynamic" - } - }, - "BUFFER_PROFILE": { - "ingress_lossy_profile": { - "pool":"[BUFFER_POOL|ingress_lossless_pool]", - "size":"0", - "dynamic_th":"3" - }, - "egress_lossless_profile": { - "pool":"[BUFFER_POOL|egress_lossless_pool]", - "size":"0", - "static_th":"12766208" - }, - "egress_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"1518", - "dynamic_th":"3" - } - }, -{%- endmacro %} diff --git a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q28S16/buffers_defaults_t0.j2 b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q28S16/buffers_defaults_t0.j2 new file mode 120000 index 000000000000..9524e6a476ac --- /dev/null +++ b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q28S16/buffers_defaults_t0.j2 @@ -0,0 +1 @@ +BALANCED/buffers_defaults_t0.j2 \ No newline at end of file diff --git a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q28S16/buffers_defaults_t1.j2 b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q28S16/buffers_defaults_t1.j2 deleted file mode 100755 index b5a7336e0511..000000000000 --- a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q28S16/buffers_defaults_t1.j2 +++ /dev/null @@ -1,78 +0,0 @@ -{%- set default_cable = '300m' %} - -{%- macro generate_port_lists(PORT_ALL) %} - {# Generate list of ports #} - {% for port_idx in range(0,1) %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 1)) %}{% endif %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 2)) %}{% endif %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 3)) %}{% endif %} - {% endfor %} - {% for port_idx in range(1,2) %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} - {% endfor %} - {% for port_idx in range(2,3) %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 1)) %}{% endif %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 2)) %}{% endif %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 3)) %}{% endif %} - {% endfor %} - {% for port_idx in range(3,4) %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} - {% endfor %} - {% for port_idx in range(4,5) %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 1)) %}{% endif %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 2)) %}{% endif %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 3)) %}{% endif %} - {% endfor %} - {% for port_idx in range(5,6) %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} - {% endfor %} - {% for port_idx in range(6,7) %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 1)) %}{% endif %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 2)) %}{% endif %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4 + 3)) %}{% endif %} - {% endfor %} - {% for port_idx in range(7,32) %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} - {% endfor %} -{%- endmacro %} - -{%- macro generate_buffer_pool_and_profiles() %} - "BUFFER_POOL": { - "ingress_lossless_pool": { - "size": "12766208", - "type": "ingress", - "mode": "dynamic" - }, - "egress_lossless_pool": { - "size": "12766208", - "type": "egress", - "mode": "static" - }, - "egress_lossy_pool": { - "size": "7326924", - "type": "egress", - "mode": "dynamic" - } - }, - "BUFFER_PROFILE": { - "ingress_lossy_profile": { - "pool":"[BUFFER_POOL|ingress_lossless_pool]", - "size":"0", - "dynamic_th":"3" - }, - "egress_lossless_profile": { - "pool":"[BUFFER_POOL|egress_lossless_pool]", - "size":"0", - "static_th":"12766208" - }, - "egress_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"1518", - "dynamic_th":"3" - } - }, -{%- endmacro %} diff --git a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q28S16/buffers_defaults_t1.j2 b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q28S16/buffers_defaults_t1.j2 new file mode 120000 index 000000000000..c25cc95d6d57 --- /dev/null +++ b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q28S16/buffers_defaults_t1.j2 @@ -0,0 +1 @@ +BALANCED/buffers_defaults_t1.j2 \ No newline at end of file diff --git a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q28S16/pg_profile_lookup.ini b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q28S16/pg_profile_lookup.ini deleted file mode 100755 index 9f2eacb6fc42..000000000000 --- a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q28S16/pg_profile_lookup.ini +++ /dev/null @@ -1,17 +0,0 @@ -# PG lossless profiles. -# speed cable size xon xoff threshold xon_offset - 10000 5m 56368 18432 55120 -3 2496 - 25000 5m 56368 18432 55120 -3 2496 - 40000 5m 56368 18432 55120 -3 2496 - 50000 5m 56368 18432 55120 -3 2496 - 100000 5m 56368 18432 55120 -3 2496 - 10000 40m 56368 18432 55120 -3 2496 - 25000 40m 56368 18432 55120 -3 2496 - 40000 40m 56368 18432 55120 -3 2496 - 50000 40m 56368 18432 55120 -3 2496 - 100000 40m 56368 18432 55120 -3 2496 - 10000 300m 56368 18432 55120 -3 2496 - 25000 300m 56368 18432 55120 -3 2496 - 40000 300m 56368 18432 55120 -3 2496 - 50000 300m 56368 18432 55120 -3 2496 - 100000 300m 56368 18432 55120 -3 2496 diff --git a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q28S16/pg_profile_lookup.ini b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q28S16/pg_profile_lookup.ini new file mode 120000 index 000000000000..297cddb2d223 --- /dev/null +++ b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q28S16/pg_profile_lookup.ini @@ -0,0 +1 @@ +BALANCED/pg_profile_lookup.ini \ No newline at end of file diff --git a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q28S16/qos.json.j2 b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q28S16/qos.json.j2 deleted file mode 100755 index 3e548325ea30..000000000000 --- a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q28S16/qos.json.j2 +++ /dev/null @@ -1 +0,0 @@ -{%- include 'qos_config.j2' %} diff --git a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q28S16/qos.json.j2 b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q28S16/qos.json.j2 new file mode 120000 index 000000000000..aef6b6765cf2 --- /dev/null +++ b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q28S16/qos.json.j2 @@ -0,0 +1 @@ +BALANCED/qos.json.j2 \ No newline at end of file diff --git a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q28S16/td2-s6000-28x40G-16x10G.config.bcm b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q28S16/td2-s6000-28x40G-16x10G.config.bcm index e0ebfd96f00b..ad97f97f94bf 100755 --- a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q28S16/td2-s6000-28x40G-16x10G.config.bcm +++ b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000-Q28S16/td2-s6000-28x40G-16x10G.config.bcm @@ -10,6 +10,12 @@ ipv6_lpm_128b_enable=1 l2_mem_entries=32768 l3_mem_entries=16384 +# disables bcmALPMDH (ALPM distributed hitbit) thread. This thread is purely for debug purpose +l3_alpm_hit_skip=1 + +# Disable Counting ACL Drop towards interface RX_DRP counter +sai_adjust_acl_drop_in_rx_drop=1 + # From old config file os=unix higig2_hdr_mode=1 diff --git a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000/BALANCED b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000/BALANCED new file mode 120000 index 000000000000..af1545f14b74 --- /dev/null +++ b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000/BALANCED @@ -0,0 +1 @@ +../../../common/profiles/td2/6000/BALANCED \ No newline at end of file diff --git a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000/RDMA-CENTRIC b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000/RDMA-CENTRIC new file mode 120000 index 000000000000..f65c31fb2e59 --- /dev/null +++ b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000/RDMA-CENTRIC @@ -0,0 +1 @@ +../../../common/profiles/td2/6000/RDMA-CENTRIC \ No newline at end of file diff --git a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000/TCP-CENTRIC b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000/TCP-CENTRIC new file mode 120000 index 000000000000..46569c641476 --- /dev/null +++ b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000/TCP-CENTRIC @@ -0,0 +1 @@ +../../../common/profiles/td2/6000/TCP-CENTRIC \ No newline at end of file diff --git a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000/buffer_ports_t0.j2 b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000/buffer_ports_t0.j2 new file mode 100644 index 000000000000..fb4c13c5c794 --- /dev/null +++ b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000/buffer_ports_t0.j2 @@ -0,0 +1,7 @@ +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {% for port_idx in range(0,32) %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} + {% endfor %} +{%- endmacro %} + diff --git a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000/buffer_ports_t1.j2 b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000/buffer_ports_t1.j2 new file mode 100644 index 000000000000..48bbf2fc121e --- /dev/null +++ b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000/buffer_ports_t1.j2 @@ -0,0 +1,6 @@ +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {% for port_idx in range(0,32) %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} + {% endfor %} +{%- endmacro %} diff --git a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000/buffers_defaults_def.j2 b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000/buffers_defaults_def.j2 index 38e34eb571e8..dc04b2265f33 100644 --- a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000/buffers_defaults_def.j2 +++ b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000/buffers_defaults_def.j2 @@ -1,4 +1,4 @@ -{%- set default_cable = '300m' %} +{%- set default_cable = '0m' %} {%- macro generate_port_lists(PORT_ALL) %} {# Generate list of ports #} diff --git a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000/buffers_defaults_t0.j2 b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000/buffers_defaults_t0.j2 deleted file mode 100644 index 38e34eb571e8..000000000000 --- a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000/buffers_defaults_t0.j2 +++ /dev/null @@ -1,45 +0,0 @@ -{%- set default_cable = '300m' %} - -{%- macro generate_port_lists(PORT_ALL) %} - {# Generate list of ports #} - {% for port_idx in range(0,32) %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} - {% endfor %} -{%- endmacro %} - -{%- macro generate_buffer_pool_and_profiles() %} - "BUFFER_POOL": { - "ingress_lossless_pool": { - "size": "12766208", - "type": "ingress", - "mode": "dynamic" - }, - "egress_lossless_pool": { - "size": "12766208", - "type": "egress", - "mode": "static" - }, - "egress_lossy_pool": { - "size": "7326924", - "type": "egress", - "mode": "dynamic" - } - }, - "BUFFER_PROFILE": { - "ingress_lossy_profile": { - "pool":"[BUFFER_POOL|ingress_lossless_pool]", - "size":"0", - "dynamic_th":"3" - }, - "egress_lossless_profile": { - "pool":"[BUFFER_POOL|egress_lossless_pool]", - "size":"0", - "static_th":"12766208" - }, - "egress_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"1518", - "dynamic_th":"3" - } - }, -{%- endmacro %} diff --git a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000/buffers_defaults_t0.j2 b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000/buffers_defaults_t0.j2 new file mode 120000 index 000000000000..9524e6a476ac --- /dev/null +++ b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000/buffers_defaults_t0.j2 @@ -0,0 +1 @@ +BALANCED/buffers_defaults_t0.j2 \ No newline at end of file diff --git a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000/buffers_defaults_t1.j2 b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000/buffers_defaults_t1.j2 deleted file mode 100644 index 38e34eb571e8..000000000000 --- a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000/buffers_defaults_t1.j2 +++ /dev/null @@ -1,45 +0,0 @@ -{%- set default_cable = '300m' %} - -{%- macro generate_port_lists(PORT_ALL) %} - {# Generate list of ports #} - {% for port_idx in range(0,32) %} - {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} - {% endfor %} -{%- endmacro %} - -{%- macro generate_buffer_pool_and_profiles() %} - "BUFFER_POOL": { - "ingress_lossless_pool": { - "size": "12766208", - "type": "ingress", - "mode": "dynamic" - }, - "egress_lossless_pool": { - "size": "12766208", - "type": "egress", - "mode": "static" - }, - "egress_lossy_pool": { - "size": "7326924", - "type": "egress", - "mode": "dynamic" - } - }, - "BUFFER_PROFILE": { - "ingress_lossy_profile": { - "pool":"[BUFFER_POOL|ingress_lossless_pool]", - "size":"0", - "dynamic_th":"3" - }, - "egress_lossless_profile": { - "pool":"[BUFFER_POOL|egress_lossless_pool]", - "size":"0", - "static_th":"12766208" - }, - "egress_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"1518", - "dynamic_th":"3" - } - }, -{%- endmacro %} diff --git a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000/buffers_defaults_t1.j2 b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000/buffers_defaults_t1.j2 new file mode 120000 index 000000000000..c25cc95d6d57 --- /dev/null +++ b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000/buffers_defaults_t1.j2 @@ -0,0 +1 @@ +BALANCED/buffers_defaults_t1.j2 \ No newline at end of file diff --git a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000/pg_profile_lookup.ini b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000/pg_profile_lookup.ini deleted file mode 100644 index 9f2eacb6fc42..000000000000 --- a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000/pg_profile_lookup.ini +++ /dev/null @@ -1,17 +0,0 @@ -# PG lossless profiles. -# speed cable size xon xoff threshold xon_offset - 10000 5m 56368 18432 55120 -3 2496 - 25000 5m 56368 18432 55120 -3 2496 - 40000 5m 56368 18432 55120 -3 2496 - 50000 5m 56368 18432 55120 -3 2496 - 100000 5m 56368 18432 55120 -3 2496 - 10000 40m 56368 18432 55120 -3 2496 - 25000 40m 56368 18432 55120 -3 2496 - 40000 40m 56368 18432 55120 -3 2496 - 50000 40m 56368 18432 55120 -3 2496 - 100000 40m 56368 18432 55120 -3 2496 - 10000 300m 56368 18432 55120 -3 2496 - 25000 300m 56368 18432 55120 -3 2496 - 40000 300m 56368 18432 55120 -3 2496 - 50000 300m 56368 18432 55120 -3 2496 - 100000 300m 56368 18432 55120 -3 2496 diff --git a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000/pg_profile_lookup.ini b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000/pg_profile_lookup.ini new file mode 120000 index 000000000000..297cddb2d223 --- /dev/null +++ b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000/pg_profile_lookup.ini @@ -0,0 +1 @@ +BALANCED/pg_profile_lookup.ini \ No newline at end of file diff --git a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000/qos.json.j2 b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000/qos.json.j2 deleted file mode 100644 index 3e548325ea30..000000000000 --- a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000/qos.json.j2 +++ /dev/null @@ -1 +0,0 @@ -{%- include 'qos_config.j2' %} diff --git a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000/qos.json.j2 b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000/qos.json.j2 new file mode 120000 index 000000000000..aef6b6765cf2 --- /dev/null +++ b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000/qos.json.j2 @@ -0,0 +1 @@ +BALANCED/qos.json.j2 \ No newline at end of file diff --git a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000/td2-s6000-32x40G.config.bcm b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000/td2-s6000-32x40G.config.bcm index 0e25b4d4232d..4f68aa896dd8 100644 --- a/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000/td2-s6000-32x40G.config.bcm +++ b/device/dell/x86_64-dell_s6000_s1220-r0/Force10-S6000/td2-s6000-32x40G.config.bcm @@ -10,6 +10,12 @@ ipv6_lpm_128b_enable=1 l2_mem_entries=32768 l3_mem_entries=16384 +# disables bcmALPMDH (ALPM distributed hitbit) thread. This thread is purely for debug purpose +l3_alpm_hit_skip=1 + +# Disable Counting ACL Drop towards interface RX_DRP counter +sai_adjust_acl_drop_in_rx_drop=1 + # From old config file os=unix higig2_hdr_mode=1 diff --git a/device/dell/x86_64-dell_s6000_s1220-r0/plugins/pcie.yaml b/device/dell/x86_64-dell_s6000_s1220-r0/pcie.yaml similarity index 100% rename from device/dell/x86_64-dell_s6000_s1220-r0/plugins/pcie.yaml rename to device/dell/x86_64-dell_s6000_s1220-r0/pcie.yaml diff --git a/device/dell/x86_64-dell_s6000_s1220-r0/platform.json b/device/dell/x86_64-dell_s6000_s1220-r0/platform.json new file mode 100644 index 000000000000..283906c407e0 --- /dev/null +++ b/device/dell/x86_64-dell_s6000_s1220-r0/platform.json @@ -0,0 +1,398 @@ +{ + "chassis": { + "name": "S6000", + "status_led": { + "controllable": true, + "colors": ["amber", "blinking amber", "green", "blinking green"] + }, + "components": [ + { + "name": "BIOS" + }, + { + "name": "System-CPLD" + }, + { + "name": "Master-CPLD" + }, + { + "name": "Slave-CPLD" + } + ], + "fans": [ + { + "name": "FanTray1-Fan1", + "speed": { + "controllable": true, + "minimum": 40 + }, + "status_led": { + "available": false + } + }, + { + "name": "FanTray1-Fan2", + "speed": { + "controllable": true, + "minimum": 40 + }, + "status_led": { + "available": false + } + }, + { + "name": "FanTray2-Fan1", + "speed": { + "controllable": true, + "minimum": 40 + }, + "status_led": { + "available": false + } + }, + { + "name": "FanTray2-Fan2", + "speed": { + "controllable": true, + "minimum": 40 + }, + "status_led": { + "available": false + } + }, + { + "name": "FanTray3-Fan1", + "speed": { + "controllable": true, + "minimum": 40 + }, + "status_led": { + "available": false + } + }, + { + "name": "FanTray3-Fan2", + "speed": { + "controllable": true, + "minimum": 40 + }, + "status_led": { + "available": false + } + } + ], + "fan_drawers":[ + { + "name": "FanTray1", + "status_led": { + "controllable": true, + "colors": ["amber", "green", "off"] + }, + "fans": [ + { + "name": "FanTray1-Fan1", + "speed": { + "controllable": true, + "minimum": 40 + }, + "status_led": { + "available": false + } + }, + { + "name": "FanTray1-Fan2", + "speed": { + "controllable": true, + "minimum": 40 + }, + "status_led": { + "available": false + } + } + ] + }, + { + "name": "FanTray2", + "status_led": { + "controllable": true, + "colors": ["amber", "green", "off"] + }, + "fans": [ + { + "name": "FanTray2-Fan1", + "speed": { + "controllable": true, + "minimum": 40 + }, + "status_led": { + "available": false + } + }, + { + "name": "FanTray2-Fan2", + "speed": { + "controllable": true, + "minimum": 40 + }, + "status_led": { + "available": false + } + } + ] + }, + { + "name": "FanTray3", + "status_led": { + "controllable": true, + "colors": ["amber", "green", "off"] + }, + "fans": [ + { + "name": "FanTray3-Fan1", + "speed": { + "controllable": true, + "minimum": 40 + }, + "status_led": { + "available": false + } + }, + { + "name": "FanTray3-Fan2", + "speed": { + "controllable": true, + "minimum": 40 + }, + "status_led": { + "available": false + } + } + ] + } + ], + "psus": [ + { + "name": "PSU1", + "status_led": { + "controllable": false + }, + "fans": [ + { + "name": "PSU1 Fan", + "speed": { + "controllable": true, + "minimum": 40 + }, + "status_led": { + "available": false + } + } + ], + "thermals": [ + { + "name": "PSU1-Sensor 1", + "controllable": false, + "low-crit-threshold": false, + "high-crit-threshold": false, + "minimum-recorded": false, + "maximum-recorded": false + }, + { + "name": "PSU1-Sensor 2", + "controllable": false, + "low-crit-threshold": false, + "high-crit-threshold": false, + "minimum-recorded": false, + "maximum-recorded": false + } + ] + }, + { + "name": "PSU2", + "status_led": { + "controllable": false + }, + "fans": [ + { + "name": "PSU2 Fan", + "speed": { + "controllable": true, + "minimum": 40 + }, + "status_led": { + "available": false + } + } + ], + "thermals": [ + { + "name": "PSU2-Sensor 1", + "controllable": false, + "low-crit-threshold": false, + "high-crit-threshold": false, + "minimum-recorded": false, + "maximum-recorded": false + }, + { + "name": "PSU2-Sensor 2", + "controllable": false, + "low-crit-threshold": false, + "high-crit-threshold": false, + "minimum-recorded": false, + "maximum-recorded": false + } + ] + } + ], + "thermals": [ + { + "name": "ASIC On-board", + "controllable": false, + "low-crit-threshold": false, + "high-crit-threshold": false, + "minimum-recorded": false, + "maximum-recorded": false + }, + { + "name": "NIC", + "controllable": false, + "low-crit-threshold": false, + "high-crit-threshold": false, + "minimum-recorded": false, + "maximum-recorded": false + }, + { + "name": "System Front", + "controllable": false, + "low-crit-threshold": false, + "high-crit-threshold": false, + "minimum-recorded": false, + "maximum-recorded": false + }, + { + "name": "DIMM", + "controllable": false, + "low-crit-threshold": false, + "high-crit-threshold": false, + "minimum-recorded": false, + "maximum-recorded": false + }, + { + "name": "CPU Core 0", + "controllable": false, + "low-crit-threshold": false, + "high-crit-threshold": false, + "minimum-recorded": false, + "maximum-recorded": false + }, + { + "name": "CPU Core 1", + "controllable": false, + "low-crit-threshold": false, + "high-crit-threshold": false, + "minimum-recorded": false, + "maximum-recorded": false + } + ], + "modules": [], + "sfps": [ + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + } + ] + }, + "interfaces": {} +} diff --git a/device/dell/x86_64-dell_s6000_s1220-r0/platform_reboot b/device/dell/x86_64-dell_s6000_s1220-r0/platform_reboot deleted file mode 100755 index d973f4f810e1..000000000000 --- a/device/dell/x86_64-dell_s6000_s1220-r0/platform_reboot +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/python3 - -import sys -import os -import struct - -NVRAM_RES = '/dev/nvram' -COLD_RESET = 0xE # Cold Reset -WARM_RESET = 0x6 # Warm Reset - - -def io_reg_write(resource, offset, val): - fd = os.open(resource, os.O_RDWR) - if(fd < 0): - print('file open failed %s" % resource') - return - if(os.lseek(fd, offset, os.SEEK_SET) != offset): - print('lseek failed on %s' % resource) - return - ret = os.write(fd, struct.pack('B', val)) - if(ret != 1): - print('write failed %d' % ret) - return - os.close(fd) - - -def power_reset(val): - with open('/sys/devices/platform/dell-s6000-cpld.0/power_reset', 'w') as p: - p.write(str(int(val)) + '\n') - p.flush() - - -def gpio_direction(pin, direction): - kernpath = '/sys/class/gpio/gpio'+str(pin)+'/direction' - with open(('kernpath'), 'w') as p: - p.write(str(direction) + '\n') - p.flush() - - -def gpio_set(pin, value): - kernpath = '/sys/class/gpio/gpio'+str(pin)+'/value' - with open(('kernpath'), 'w') as p: - p.write(str(int(value)) + '\n') - p.flush() - - -def gpio_export(value): - with open('/sys/class/gpio/export', 'w') as p: - p.write(str(int(value)) + '\n') - p.flush() - - -if __name__ == "__main__": - io_reg_write(NVRAM_RES, 0x49, COLD_RESET) - if not os.path.isdir("/sys/class/gpio/gpio10"): - gpio_export(10) - gpio_direction("10", "out") - # Toggle GPIO10 pin (to reset MUX) - gpio_set("10", 1) - gpio_set("10", 0) - power_reset(1) diff --git a/device/dell/x86_64-dell_s6000_s1220-r0/plugins/sfputil.py b/device/dell/x86_64-dell_s6000_s1220-r0/plugins/sfputil.py index f03415cbc7ea..8d8892fdce70 100644 --- a/device/dell/x86_64-dell_s6000_s1220-r0/plugins/sfputil.py +++ b/device/dell/x86_64-dell_s6000_s1220-r0/plugins/sfputil.py @@ -6,6 +6,7 @@ try: import time import datetime + import fcntl from sonic_sfp.sfputilbase import SfpUtilBase except ImportError as e: raise ImportError("%s - required module not found" % str(e)) @@ -19,6 +20,7 @@ class SfpUtil(SfpUtilBase): PORTS_IN_BLOCK = 32 EEPROM_OFFSET = 20 + SFP_LOCK_FILE="/etc/sonic/sfp_lock" _port_to_eeprom_mapping = {} port_dict = {} @@ -72,10 +74,19 @@ def get_presence(self, port_num): if port_num < self.port_start or port_num > self.port_end: return False + try: + fd = open(self.SFP_LOCK_FILE, "r") + except IOError as e: + print("Error: unable to open file: "+ str(e)) + return False + fcntl.flock(fd, fcntl.LOCK_EX) + self.set_modsel(port_num) + try: reg_file = open("/sys/devices/platform/dell-s6000-cpld.0/qsfp_modprs") except IOError as e: print("Error: unable to open file: %s" % str(e)) + fcntl.flock(fd, fcntl.LOCK_UN) return False content = reg_file.readline().rstrip() @@ -85,13 +96,102 @@ def get_presence(self, port_num): # Mask off the bit corresponding to our port mask = (1 << port_num) - + fcntl.flock(fd, fcntl.LOCK_UN) # ModPrsL is active low if reg_value & mask == 0: return True return False + def get_modsel(self, port_num): + # Check for invalid port_num + if port_num < self.port_start or port_num > self.port_end: + return False + + try: + reg_file = open("/sys/devices/platform/dell-s6000-cpld.0/qsfp_modsel") + except IOError as e: + print("Error: unable to open file: %s" % str(e)) + return False + + content = reg_file.readline().rstrip() + + # content is a string containing the hex representation of the register + reg_value = int(content, 16) + + # Mask off the bit corresponding to our port + mask = (1 << port_num) + + if reg_value & mask == 1: + return False + + return True + + def set_modsel(self, port_num): + # Check for invalid port_num + if port_num < self.port_start or port_num > self.port_end: + return False + + try: + reg_file = open("/sys/devices/platform/dell-s6000-cpld.0/qsfp_modsel", "r+") + except IOError as e: + print("Error: unable to open file: %s" % str(e)) + return False + + content = reg_file.readline().rstrip() + + # content is a string containing the hex representation of the register + reg_value = int(content, 16) + + # Mask off the bit corresponding to our port + mask = (1 << port_num) + reg_value = reg_value | int("0xffffffff", 16) + reg_value = reg_value & ~mask + + # Convert our register value back to a hex string and write back + content = hex(reg_value) + + reg_file.seek(0) + reg_file.write(content) + reg_file.close() + + return True + + def get_eeprom_raw(self, port_num, num_bytes=256): + # Read interface id EEPROM at addr 0x50 + try: + fd = open(self.SFP_LOCK_FILE, "r") + except IOError as e: + print("Error: unable to open file: %s" % str(e)) + return None + fcntl.flock(fd, fcntl.LOCK_EX) + self.set_modsel(port_num) + eeprom_bytes = self._read_eeprom_devid(port_num, self.IDENTITY_EEPROM_ADDR, 0, num_bytes) + fcntl.flock(fd, fcntl.LOCK_UN) + return eeprom_bytes + + def get_eeprom_dom_raw(self, port_num): + if port_num in self.osfp_ports: + return None + if port_num in self.qsfp_ports: + # QSFP DOM EEPROM is also at addr 0x50 and thus also stored in eeprom_ifraw + return None + else: + # Read dom eeprom at addr 0x51 + if not self.get_modsel(port_num): + try: + fd = open(self.SFP_LOCK_FILE, "r") + except IOError as e: + print("Error: unable to open file: %s" % str(e)) + return None + fcntl.flock(fd, fcntl.LOCK_EX) + self.set_modsel(port_num) + eeprom_bytes = self._read_eeprom_devid(port_num, self.DOM_EEPROM_ADDR, 0) + fcntl.flock(fd, fcntl.LOCK_UN) + return eeprom_bytes + else: + return self._read_eeprom_devid(port_num, self.DOM_EEPROM_ADDR, 0) + def get_low_power_mode(self, port_num): # Check for invalid port_num if port_num < self.port_start or port_num > self.port_end: diff --git a/device/dell/x86_64-dell_s6000_s1220-r0/pmon_daemon_control.json b/device/dell/x86_64-dell_s6000_s1220-r0/pmon_daemon_control.json index 44871c057e82..94592fa8cebc 100644 --- a/device/dell/x86_64-dell_s6000_s1220-r0/pmon_daemon_control.json +++ b/device/dell/x86_64-dell_s6000_s1220-r0/pmon_daemon_control.json @@ -1,4 +1,3 @@ { - "skip_ledd": true, - "skip_thermalctld": true + "skip_ledd": true } diff --git a/device/dell/x86_64-dell_s6000_s1220-r0/system_health_monitoring_config.json b/device/dell/x86_64-dell_s6000_s1220-r0/system_health_monitoring_config.json new file mode 100644 index 000000000000..bb8ffbcd2172 --- /dev/null +++ b/device/dell/x86_64-dell_s6000_s1220-r0/system_health_monitoring_config.json @@ -0,0 +1,11 @@ +{ + "services_to_ignore": [], + "devices_to_ignore": [], + "user_defined_checkers": [], + "polling_interval": 60, + "led_color": { + "fault": "amber", + "normal": "green", + "booting": "blinking green" + } +} diff --git a/device/dell/x86_64-dell_s6100_c2538-r0/Force10-S6100/BALANCED b/device/dell/x86_64-dell_s6100_c2538-r0/Force10-S6100/BALANCED new file mode 120000 index 000000000000..6f064064664a --- /dev/null +++ b/device/dell/x86_64-dell_s6100_c2538-r0/Force10-S6100/BALANCED @@ -0,0 +1 @@ +../../../common/profiles/th/6100/BALANCED \ No newline at end of file diff --git a/device/dell/x86_64-dell_s6100_c2538-r0/Force10-S6100/RDMA-CENTRIC b/device/dell/x86_64-dell_s6100_c2538-r0/Force10-S6100/RDMA-CENTRIC new file mode 120000 index 000000000000..4ab30f5ff42f --- /dev/null +++ b/device/dell/x86_64-dell_s6100_c2538-r0/Force10-S6100/RDMA-CENTRIC @@ -0,0 +1 @@ +../../../common/profiles/th/6100/RDMA-CENTRIC \ No newline at end of file diff --git a/device/dell/x86_64-dell_s6100_c2538-r0/Force10-S6100/TCP-CENTRIC b/device/dell/x86_64-dell_s6100_c2538-r0/Force10-S6100/TCP-CENTRIC new file mode 120000 index 000000000000..d5d3a5b671b5 --- /dev/null +++ b/device/dell/x86_64-dell_s6100_c2538-r0/Force10-S6100/TCP-CENTRIC @@ -0,0 +1 @@ +../../../common/profiles/th/6100/TCP-CENTRIC \ No newline at end of file diff --git a/device/dell/x86_64-dell_s6100_c2538-r0/Force10-S6100/buffer_ports_t0.j2 b/device/dell/x86_64-dell_s6100_c2538-r0/Force10-S6100/buffer_ports_t0.j2 new file mode 100644 index 000000000000..ae201eb2593a --- /dev/null +++ b/device/dell/x86_64-dell_s6100_c2538-r0/Force10-S6100/buffer_ports_t0.j2 @@ -0,0 +1,6 @@ +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {%- for port_idx in range(0,64) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{%- endif %} + {%- endfor %} +{%- endmacro %} \ No newline at end of file diff --git a/device/dell/x86_64-dell_s6100_c2538-r0/Force10-S6100/buffer_ports_t1.j2 b/device/dell/x86_64-dell_s6100_c2538-r0/Force10-S6100/buffer_ports_t1.j2 new file mode 100644 index 000000000000..ae201eb2593a --- /dev/null +++ b/device/dell/x86_64-dell_s6100_c2538-r0/Force10-S6100/buffer_ports_t1.j2 @@ -0,0 +1,6 @@ +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {%- for port_idx in range(0,64) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{%- endif %} + {%- endfor %} +{%- endmacro %} \ No newline at end of file diff --git a/device/dell/x86_64-dell_s6100_c2538-r0/Force10-S6100/buffers_defaults_t0.j2 b/device/dell/x86_64-dell_s6100_c2538-r0/Force10-S6100/buffers_defaults_t0.j2 deleted file mode 100644 index 8f55022973fb..000000000000 --- a/device/dell/x86_64-dell_s6100_c2538-r0/Force10-S6100/buffers_defaults_t0.j2 +++ /dev/null @@ -1,47 +0,0 @@ - -{%- set default_cable = '5m' %} - -{%- macro generate_port_lists(PORT_ALL) %} - {# Generate list of ports #} - {%- for port_idx in range(0,64) %} - {%- if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{%- endif %} - {%- endfor %} -{%- endmacro %} - -{%- macro generate_buffer_pool_and_profiles() %} - "BUFFER_POOL": { - "ingress_lossless_pool": { - "size": "10875072", - "type": "ingress", - "mode": "dynamic", - "xoff": "4194112" - }, - "egress_lossy_pool": { - "size": "9243812", - "type": "egress", - "mode": "dynamic" - }, - "egress_lossless_pool": { - "size": "15982720", - "type": "egress", - "mode": "static" - } - }, - "BUFFER_PROFILE": { - "ingress_lossy_profile": { - "pool":"[BUFFER_POOL|ingress_lossless_pool]", - "size":"0", - "dynamic_th":"3" - }, - "egress_lossless_profile": { - "pool":"[BUFFER_POOL|egress_lossless_pool]", - "size":"1518", - "static_th":"15982720" - }, - "egress_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"1518", - "dynamic_th":"3" - } - }, -{%- endmacro %} diff --git a/device/dell/x86_64-dell_s6100_c2538-r0/Force10-S6100/buffers_defaults_t0.j2 b/device/dell/x86_64-dell_s6100_c2538-r0/Force10-S6100/buffers_defaults_t0.j2 new file mode 120000 index 000000000000..9524e6a476ac --- /dev/null +++ b/device/dell/x86_64-dell_s6100_c2538-r0/Force10-S6100/buffers_defaults_t0.j2 @@ -0,0 +1 @@ +BALANCED/buffers_defaults_t0.j2 \ No newline at end of file diff --git a/device/dell/x86_64-dell_s6100_c2538-r0/Force10-S6100/buffers_defaults_t1.j2 b/device/dell/x86_64-dell_s6100_c2538-r0/Force10-S6100/buffers_defaults_t1.j2 deleted file mode 100644 index 47a9c81f0796..000000000000 --- a/device/dell/x86_64-dell_s6100_c2538-r0/Force10-S6100/buffers_defaults_t1.j2 +++ /dev/null @@ -1,47 +0,0 @@ - -{%- set default_cable = '40m' %} - -{%- macro generate_port_lists(PORT_ALL) %} - {# Generate list of ports #} - {%- for port_idx in range(0,64) %} - {%- if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{%- endif %} - {%- endfor %} -{%- endmacro %} - -{%- macro generate_buffer_pool_and_profiles() %} - "BUFFER_POOL": { - "ingress_lossless_pool": { - "size": "10875072", - "type": "ingress", - "mode": "dynamic", - "xoff": "4194112" - }, - "egress_lossy_pool": { - "size": "9243812", - "type": "egress", - "mode": "dynamic" - }, - "egress_lossless_pool": { - "size": "15982720", - "type": "egress", - "mode": "static" - } - }, - "BUFFER_PROFILE": { - "ingress_lossy_profile": { - "pool":"[BUFFER_POOL|ingress_lossless_pool]", - "size":"0", - "dynamic_th":"3" - }, - "egress_lossless_profile": { - "pool":"[BUFFER_POOL|egress_lossless_pool]", - "size":"1518", - "static_th":"15982720" - }, - "egress_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"1518", - "dynamic_th":"3" - } - }, -{%- endmacro %} diff --git a/device/dell/x86_64-dell_s6100_c2538-r0/Force10-S6100/buffers_defaults_t1.j2 b/device/dell/x86_64-dell_s6100_c2538-r0/Force10-S6100/buffers_defaults_t1.j2 new file mode 120000 index 000000000000..c25cc95d6d57 --- /dev/null +++ b/device/dell/x86_64-dell_s6100_c2538-r0/Force10-S6100/buffers_defaults_t1.j2 @@ -0,0 +1 @@ +BALANCED/buffers_defaults_t1.j2 \ No newline at end of file diff --git a/device/dell/x86_64-dell_s6100_c2538-r0/Force10-S6100/pg_profile_lookup.ini b/device/dell/x86_64-dell_s6100_c2538-r0/Force10-S6100/pg_profile_lookup.ini deleted file mode 100644 index 0b5d680edda7..000000000000 --- a/device/dell/x86_64-dell_s6100_c2538-r0/Force10-S6100/pg_profile_lookup.ini +++ /dev/null @@ -1,17 +0,0 @@ -# PG lossless profiles. -# speed cable size xon xoff threshold xon_offset - 10000 5m 1248 2288 35776 0 2288 - 25000 5m 1248 2288 53248 0 2288 - 40000 5m 1248 2288 66560 0 2288 - 50000 5m 1248 2288 79872 0 2288 - 100000 5m 1248 2288 165568 0 2288 - 10000 40m 1248 2288 37024 0 2288 - 25000 40m 1248 2288 56160 0 2288 - 40000 40m 1248 2288 71552 0 2288 - 50000 40m 1248 2288 85696 0 2288 - 100000 40m 1248 2288 177632 0 2288 - 10000 300m 1248 2288 46176 0 2288 - 25000 300m 1248 2288 79040 0 2288 - 40000 300m 1248 2288 108160 0 2288 - 50000 300m 1248 2288 141856 0 2288 - 100000 300m 1248 2288 268736 0 2288 diff --git a/device/dell/x86_64-dell_s6100_c2538-r0/Force10-S6100/pg_profile_lookup.ini b/device/dell/x86_64-dell_s6100_c2538-r0/Force10-S6100/pg_profile_lookup.ini new file mode 120000 index 000000000000..297cddb2d223 --- /dev/null +++ b/device/dell/x86_64-dell_s6100_c2538-r0/Force10-S6100/pg_profile_lookup.ini @@ -0,0 +1 @@ +BALANCED/pg_profile_lookup.ini \ No newline at end of file diff --git a/device/dell/x86_64-dell_s6100_c2538-r0/Force10-S6100/port_config.ini b/device/dell/x86_64-dell_s6100_c2538-r0/Force10-S6100/port_config.ini index 1922a3e04b5a..54809b2c957a 100644 --- a/device/dell/x86_64-dell_s6100_c2538-r0/Force10-S6100/port_config.ini +++ b/device/dell/x86_64-dell_s6100_c2538-r0/Force10-S6100/port_config.ini @@ -63,3 +63,5 @@ Ethernet60 81,82 fortyGigE1/4/13 60 40000 Ethernet61 83,84 fortyGigE1/4/14 61 40000 Ethernet62 85,86 fortyGigE1/4/15 62 40000 Ethernet63 87,88 fortyGigE1/4/16 63 40000 +Ethernet64 129 tenGigE1/1 64 10000 +Ethernet65 131 tenGigE1/2 65 10000 diff --git a/device/dell/x86_64-dell_s6100_c2538-r0/Force10-S6100/qos.json.j2 b/device/dell/x86_64-dell_s6100_c2538-r0/Force10-S6100/qos.json.j2 deleted file mode 100644 index 34002048afdb..000000000000 --- a/device/dell/x86_64-dell_s6100_c2538-r0/Force10-S6100/qos.json.j2 +++ /dev/null @@ -1,21 +0,0 @@ -{%- macro generate_wred_profiles() %} - "WRED_PROFILE": { - "AZURE_LOSSLESS" : { - "wred_green_enable" : "true", - "wred_yellow_enable" : "true", - "wred_red_enable" : "true", - "ecn" : "ecn_all", - "green_max_threshold" : "2097152", - "green_min_threshold" : "250000", - "yellow_max_threshold" : "2097152", - "yellow_min_threshold" : "1048576", - "red_max_threshold" : "2097152", - "red_min_threshold" : "1048576", - "green_drop_probability" : "5", - "yellow_drop_probability": "5", - "red_drop_probability" : "5" - } - }, -{%- endmacro %} - -{%- include 'qos_config.j2' %} diff --git a/device/dell/x86_64-dell_s6100_c2538-r0/Force10-S6100/qos.json.j2 b/device/dell/x86_64-dell_s6100_c2538-r0/Force10-S6100/qos.json.j2 new file mode 120000 index 000000000000..aef6b6765cf2 --- /dev/null +++ b/device/dell/x86_64-dell_s6100_c2538-r0/Force10-S6100/qos.json.j2 @@ -0,0 +1 @@ +BALANCED/qos.json.j2 \ No newline at end of file diff --git a/device/dell/x86_64-dell_s6100_c2538-r0/Force10-S6100/th-s6100-64x40G-t0.config.bcm b/device/dell/x86_64-dell_s6100_c2538-r0/Force10-S6100/th-s6100-64x40G-t0.config.bcm index 7fa577052635..e1eb6968df68 100644 --- a/device/dell/x86_64-dell_s6100_c2538-r0/Force10-S6100/th-s6100-64x40G-t0.config.bcm +++ b/device/dell/x86_64-dell_s6100_c2538-r0/Force10-S6100/th-s6100-64x40G-t0.config.bcm @@ -1,4 +1,11 @@ #TH S6100 64x40 + +# disables bcmALPMDH (ALPM distributed hitbit) thread. This thread is purely for debug purpose +l3_alpm_hit_skip=1 + +# Disable Counting ACL Drop towards interface RX_DRP counter +sai_adjust_acl_drop_in_rx_drop=1 + l3_alpm_enable=2 pfc_deadlock_seq_control=1 bcm_stat_interval=2000000 @@ -27,6 +34,8 @@ os=unix parity_correction=1 parity_enable=1 +port_phy_addr_66=0x176 +port_phy_addr_100=0x177 xgxs_tx_lane_map_104=0x3210 xgxs_rx_lane_map_104=0x0312 phy_xaui_tx_polarity_flip_104=0x0 @@ -338,6 +347,9 @@ phy_xaui_rx_polarity_flip_79=0x3 dport_map_port_78=63 dport_map_port_79=64 pbmp_xport_xe=0x3fffd0000ffff40003fffc0001fffe + +portmap_66=129:10 +portmap_100=131:10 portmap_33=132:10 portmap_67=133:10 portmap_101=134:10 @@ -406,5 +418,7 @@ portmap_114=121:40:2 portmap_115=123:40:2 portmap_116=125:40:2 portmap_117=127:40:2 +dport_map_port_66=65 +dport_map_port_100=66 mmu_init_config="MSFT-TH-Tier0" diff --git a/device/dell/x86_64-dell_s6100_c2538-r0/Force10-S6100/th-s6100-64x40G-t1.config.bcm b/device/dell/x86_64-dell_s6100_c2538-r0/Force10-S6100/th-s6100-64x40G-t1.config.bcm index f55fb9d3ab51..87c90323d5b1 100644 --- a/device/dell/x86_64-dell_s6100_c2538-r0/Force10-S6100/th-s6100-64x40G-t1.config.bcm +++ b/device/dell/x86_64-dell_s6100_c2538-r0/Force10-S6100/th-s6100-64x40G-t1.config.bcm @@ -1,4 +1,11 @@ #TH S6100 64x40 + +# disables bcmALPMDH (ALPM distributed hitbit) thread. This thread is purely for debug purpose +l3_alpm_hit_skip=1 + +# Disable Counting ACL Drop towards interface RX_DRP counter +sai_adjust_acl_drop_in_rx_drop=1 + l3_alpm_enable=2 pfc_deadlock_seq_control=1 bcm_stat_interval=2000000 @@ -27,6 +34,8 @@ os=unix parity_correction=1 parity_enable=1 +port_phy_addr_66=0x176 +port_phy_addr_100=0x177 xgxs_tx_lane_map_104=0x3210 xgxs_rx_lane_map_104=0x0312 phy_xaui_tx_polarity_flip_104=0x0 @@ -338,6 +347,9 @@ phy_xaui_rx_polarity_flip_79=0x3 dport_map_port_78=63 dport_map_port_79=64 pbmp_xport_xe=0x3fffd0000ffff40003fffc0001fffe + +portmap_66=129:10 +portmap_100=131:10 portmap_33=132:10 portmap_67=133:10 portmap_101=134:10 @@ -406,5 +418,7 @@ portmap_114=121:40:2 portmap_115=123:40:2 portmap_116=125:40:2 portmap_117=127:40:2 +dport_map_port_66=65 +dport_map_port_100=66 mmu_init_config="MSFT-TH-Tier1" diff --git a/device/dell/x86_64-dell_s6100_c2538-r0/plugins/pcie.yaml b/device/dell/x86_64-dell_s6100_c2538-r0/pcie_1.yaml similarity index 100% rename from device/dell/x86_64-dell_s6100_c2538-r0/plugins/pcie.yaml rename to device/dell/x86_64-dell_s6100_c2538-r0/pcie_1.yaml diff --git a/device/dell/x86_64-dell_s6100_c2538-r0/pcie_2.yaml b/device/dell/x86_64-dell_s6100_c2538-r0/pcie_2.yaml new file mode 100644 index 000000000000..2591c5900452 --- /dev/null +++ b/device/dell/x86_64-dell_s6100_c2538-r0/pcie_2.yaml @@ -0,0 +1,50 @@ +- bus: '00' + dev: '01' + fn: '0' + id: 1f10 + name: 'PCI bridge: Intel Corporation Atom processor C2000 PCIe Root Port 1' +- bus: '00' + dev: '03' + fn: '0' + id: 1f12 + name: 'PCI bridge: Intel Corporation Atom processor C2000 PCIe Root Port 3' +- bus: '00' + dev: '04' + fn: '0' + id: 1f13 + name: 'PCI bridge: Intel Corporation Atom processor C2000 PCIe Root Port 4' +- bus: '00' + dev: 0f + fn: '0' + id: 1f16 + name: 'IOMMU: Intel Corporation Atom processor C2000 RCEC' +- bus: '00' + dev: '13' + fn: '0' + id: 1f15 + name: 'System peripheral: Intel Corporation Atom processor C2000 SMBus 2.0' +- bus: '00' + dev: '14' + fn: '0' + id: 1f41 + name: 'Ethernet controller: Intel Corporation Ethernet Connection I354' +- bus: '00' + dev: '14' + fn: '1' + id: 1f41 + name: 'Ethernet controller: Intel Corporation Ethernet Connection I354' +- bus: '00' + dev: '14' + fn: '2' + id: 1f41 + name: 'Ethernet controller: Intel Corporation Ethernet Connection I354' +- bus: '01' + dev: '00' + fn: '0' + id: b960 + name: 'Ethernet controller: Broadcom Limited Broadcom BCM56960 Switch ASIC' +- bus: '01' + dev: '00' + fn: '1' + id: b960 + name: 'Ethernet controller: Broadcom Limited Broadcom BCM56960 Switch ASIC' diff --git a/device/dell/x86_64-dell_s6100_c2538-r0/platform.json b/device/dell/x86_64-dell_s6100_c2538-r0/platform.json new file mode 100644 index 000000000000..8e9a0f17db16 --- /dev/null +++ b/device/dell/x86_64-dell_s6100_c2538-r0/platform.json @@ -0,0 +1,470 @@ +{ + "chassis": { + "name": "S6100-ON", + "status_led": { + "controllable": true, + "colors": ["amber", "blinking amber", "green", "blinking green"] + }, + "thermal_manager" : false, + "components": [ + { + "name": "BIOS" + }, + { + "name": "CPLD" + }, + { + "name": "FPGA" + } + ], + "fans": [ + { + "name": "FanTray1-Fan1", + "speed": { + "controllable": false + }, + "status_led": { + "available": false + } + }, + { + "name": "FanTray2-Fan1", + "speed": { + "controllable": false + }, + "status_led": { + "available": false + } + }, + { + "name": "FanTray3-Fan1", + "speed": { + "controllable": false + }, + "status_led": { + "available": false + } + }, + { + "name": "FanTray4-Fan1", + "speed": { + "controllable": false + }, + "status_led": { + "available": false + } + } + ], + "fan_drawers":[ + { + "name": "FanTray1", + "status_led": { + "controllable": false + }, + "fans": [ + { + "name": "FanTray1-Fan1", + "speed": { + "controllable": false + }, + "status_led": { + "available": false + } + } + ] + }, + { + "name": "FanTray2", + "status_led": { + "controllable": false + }, + "fans": [ + { + "name": "FanTray2-Fan1", + "speed": { + "controllable": false + }, + "status_led": { + "available": false + } + } + ] + }, + { + "name": "FanTray3", + "status_led": { + "controllable": false + }, + "fans": [ + { + "name": "FanTray3-Fan1", + "speed": { + "controllable": false + }, + "status_led": { + "available": false + } + } + ] + }, + { + "name": "FanTray4", + "status_led": { + "controllable": false + }, + "fans": [ + { + "name": "FanTray4-Fan1", + "speed": { + "controllable": false + }, + "status_led": { + "available": false + } + } + ] + } + ], + "psus": [ + { + "name": "PSU1", + "status_led": { + "controllable": false + }, + "fans": [ + { + "name": "PSU1 Fan", + "speed": { + "controllable": false + }, + "status_led": { + "available": false + } + } + ] + }, + { + "name": "PSU2", + "status_led": { + "controllable": false + }, + "fans": [ + { + "name": "PSU2 Fan", + "speed": { + "controllable": false + }, + "status_led": { + "available": false + } + } + ] + } + ], + "thermals": [ + { + "name": "CPU On-board", + "controllable": false, + "low-crit-threshold": false, + "minimum-recorded": false, + "maximum-recorded": false + }, + { + "name": "ASIC On-board Front", + "controllable": false, + "low-crit-threshold": false, + "minimum-recorded": false, + "maximum-recorded": false + }, + { + "name": "System Front", + "controllable": false, + "low-crit-threshold": false, + "minimum-recorded": false, + "maximum-recorded": false + }, + { + "name": "ASIC On-board Rear", + "controllable": false, + "low-crit-threshold": false, + "minimum-recorded": false, + "maximum-recorded": false + }, + { + "name": "Front GE board", + "controllable": false, + "low-crit-threshold": false, + "minimum-recorded": false, + "maximum-recorded": false + }, + { + "name": "Front SFP+ board", + "controllable": false, + "low-crit-threshold": false, + "minimum-recorded": false, + "maximum-recorded": false + }, + { + "name": "CPU Core 0", + "controllable": false, + "low-crit-threshold": false, + "high-crit-threshold": false, + "minimum-recorded": false, + "maximum-recorded": false + }, + { + "name": "CPU Core 1", + "controllable": false, + "low-crit-threshold": false, + "high-crit-threshold": false, + "minimum-recorded": false, + "maximum-recorded": false + }, + { + "name": "CPU Core 2", + "controllable": false, + "low-crit-threshold": false, + "high-crit-threshold": false, + "minimum-recorded": false, + "maximum-recorded": false + }, + { + "name": "CPU Core 3", + "controllable": false, + "low-crit-threshold": false, + "high-crit-threshold": false, + "minimum-recorded": false, + "maximum-recorded": false + } + ], + "modules": [ + { + "name": "IOM1: 16x40G QSFP+ Module", + "components": [ + { + "name": "IOM1-CPLD" + } + ] + }, + { + "name": "IOM2: 16x40G QSFP+ Module", + "components": [ + { + "name": "IOM2-CPLD" + } + ] + }, + { + "name": "IOM3: 16x40G QSFP+ Module", + "components": [ + { + "name": "IOM3-CPLD" + } + ] + }, + { + "name": "IOM4: 16x40G QSFP+ Module", + "components": [ + { + "name": "IOM4-CPLD" + } + ] + } + ], + "sfps": [ + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + }, + { + "name": "QSFP+ or later" + } + ] + }, + "interfaces": {} +} diff --git a/device/dell/x86_64-dell_s6100_c2538-r0/plugins/sfputil.py b/device/dell/x86_64-dell_s6100_c2538-r0/plugins/sfputil.py index a6a7cce72f56..6e8f024c7bbc 100644 --- a/device/dell/x86_64-dell_s6100_c2538-r0/plugins/sfputil.py +++ b/device/dell/x86_64-dell_s6100_c2538-r0/plugins/sfputil.py @@ -16,7 +16,6 @@ import time import os import logging - import select from sonic_sfp.sfputilbase import SfpUtilBase except ImportError as e: raise ImportError("%s - required module not found" % str(e)) @@ -28,7 +27,7 @@ class SfpUtil(SfpUtilBase): PORT_START = 0 PORT_END = 63 PORTS_IN_BLOCK = 64 - + POLL_INTERVAL = 1 _port_to_eeprom_mapping = {} _port_to_i2c_mapping = { 0: [6, 18, 34, 50, 66], @@ -110,7 +109,6 @@ class SfpUtil(SfpUtilBase): IOM_4_PORT_END = 63 BASE_VAL_PATH = "/sys/class/i2c-adapter/i2c-{0}/{0}-003e/" - OIR_FD_PATH = "/sys/devices/platform/dell_ich.0/sci_int_gpio_sus6" oir_fd = -1 epoll = -1 @@ -235,8 +233,8 @@ def __init__(self): elif (not assigned): self.port_to_eeprom_mapping[port_num] =\ "No IOM" - SfpUtilBase.__init__(self) + self._transceiver_presence = self._get_transceiver_presence() def __del__(self): if self.oir_fd != -1: @@ -482,7 +480,7 @@ def reset(self, port_num): def get_register(self, reg_file): retval = 'ERR' - if (not os.path.isfile(reg_file)): + if not os.path.isfile(reg_file): print(reg_file + ' not found !') return retval @@ -496,141 +494,88 @@ def get_register(self, reg_file): retval = retval.lstrip(" ") return retval - def check_interrupts(self, port_dict): - retval = 0 - is_port_dict_updated = False - - # Read the QSFP ABS interrupt & status registers - cpld2_abs_int = self.get_register( - "/sys/class/i2c-adapter/i2c-14/14-003e/qsfp_abs_int") - cpld2_abs_sta = self.get_register( - "/sys/class/i2c-adapter/i2c-14/14-003e/qsfp_abs_sta") - cpld3_abs_int = self.get_register( - "/sys/class/i2c-adapter/i2c-15/15-003e/qsfp_abs_int") - cpld3_abs_sta = self.get_register( - "/sys/class/i2c-adapter/i2c-15/15-003e/qsfp_abs_sta") - cpld4_abs_int = self.get_register( - "/sys/class/i2c-adapter/i2c-16/16-003e/qsfp_abs_int") - cpld4_abs_sta = self.get_register( - "/sys/class/i2c-adapter/i2c-16/16-003e/qsfp_abs_sta") - cpld5_abs_int = self.get_register( - "/sys/class/i2c-adapter/i2c-17/17-003e/qsfp_abs_int") - cpld5_abs_sta = self.get_register( - "/sys/class/i2c-adapter/i2c-17/17-003e/qsfp_abs_sta") - - if (cpld2_abs_int == 'ERR' or cpld2_abs_sta == 'ERR' or - cpld3_abs_int == 'ERR' or cpld3_abs_sta == 'ERR' or - cpld4_abs_int == 'ERR' or cpld4_abs_sta == 'ERR' or - cpld5_abs_int == 'ERR' or cpld5_abs_sta == 'ERR'): - return -1 - - # If IOM is not present, interrupt will return 'read error' + def _get_transceiver_presence(self): + + cpld2_modprs = self.get_register( + "/sys/class/i2c-adapter/i2c-14/14-003e/qsfp_modprs") + cpld3_modprs = self.get_register( + "/sys/class/i2c-adapter/i2c-15/15-003e/qsfp_modprs") + cpld4_modprs = self.get_register( + "/sys/class/i2c-adapter/i2c-16/16-003e/qsfp_modprs") + cpld5_modprs = self.get_register( + "/sys/class/i2c-adapter/i2c-17/17-003e/qsfp_modprs") + + # If IOM is not present, register read will fail. # Handle the scenario gracefully - if (cpld2_abs_int == 'read error'): - cpld2_abs_int = "0x0" - cpld2_abs_sta = "0x0" - if (cpld3_abs_int == 'read error'): - cpld3_abs_int = "0x0" - cpld3_abs_sta = "0x0" - if (cpld4_abs_int == 'read error'): - cpld4_abs_int = "0x0" - cpld4_abs_sta = "0x0" - if (cpld5_abs_int == 'read error'): - cpld5_abs_int = "0x0" - cpld5_abs_sta = "0x0" - - cpld2_abs_int = int(cpld2_abs_int, 16) - cpld2_abs_sta = int(cpld2_abs_sta, 16) - cpld3_abs_int = int(cpld3_abs_int, 16) - cpld3_abs_sta = int(cpld3_abs_sta, 16) - cpld4_abs_int = int(cpld4_abs_int, 16) - cpld4_abs_sta = int(cpld4_abs_sta, 16) - cpld5_abs_int = int(cpld5_abs_int, 16) - cpld5_abs_sta = int(cpld5_abs_sta, 16) + if cpld2_modprs == 'read error' or cpld2_modprs == 'ERR': + cpld2_modprs = '0x0' + if cpld3_modprs == 'read error' or cpld3_modprs == 'ERR': + cpld3_modprs = '0x0' + if cpld4_modprs == 'read error' or cpld4_modprs == 'ERR': + cpld4_modprs = '0x0' + if cpld5_modprs == 'read error' or cpld5_modprs == 'ERR': + cpld5_modprs = '0x0' # Make it contiguous - interrupt_reg = (cpld2_abs_int & 0xffff) | \ - ((cpld4_abs_int & 0xffff) << 16) | \ - ((cpld3_abs_int & 0xffff) << 32) | \ - ((cpld5_abs_int & 0xffff) << 48) - status_reg = (cpld2_abs_sta & 0xffff) | \ - ((cpld4_abs_sta & 0xffff) << 16) | \ - ((cpld3_abs_sta & 0xffff) << 32) | \ - ((cpld5_abs_sta & 0xffff) << 48) - - port = self.port_start - while port <= self.port_end: - if interrupt_reg & (1 << port): - # update only if atleast one port has generated - # interrupt - is_port_dict_updated = True - if status_reg & (1 << port): - # status reg 1 => optics is removed - port_dict[port] = '0' - else: - # status reg 0 => optics is inserted - port_dict[port] = '1' - port += 1 - return retval, is_port_dict_updated + transceiver_presence = (int(cpld2_modprs, 16) & 0xffff) |\ + ((int(cpld4_modprs, 16) & 0xffff) << 16) |\ + ((int(cpld3_modprs, 16) & 0xffff) << 32) |\ + ((int(cpld5_modprs, 16) & 0xffff) << 48) + + return transceiver_presence def get_transceiver_change_event(self, timeout=0): + """ + Returns a dictionary containing optics insertion/removal status. + Args: + timeout: Timeout in milliseconds (optional). If timeout == 0, + this method will block until a change is detected. + Returns: + (bool, dict): + - True if call successful, False if not; + """ port_dict = {} - try: - # We get notified when there is an SCI interrupt from GPIO SUS6 - # Open the sysfs file and register the epoll object - self.oir_fd = open(self.OIR_FD_PATH, "r") - if self.oir_fd != -1: - # Do a dummy read before epoll register - self.oir_fd.read() - self.epoll = select.epoll() - self.epoll.register(self.oir_fd.fileno(), - select.EPOLLIN & select.EPOLLET) - else: - print("get_transceiver_change_event : unable to create fd") - return False, {} + forever = False - # Check for missed interrupts by invoking self.check_interrupts - # which will update the port_dict. - while True: - interrupt_count_start = self.get_register(self.OIR_FD_PATH) - - retval, is_port_dict_updated = \ - self.check_interrupts(port_dict) - if ((retval == 0) and (is_port_dict_updated is True)): - return True, port_dict - - interrupt_count_end = self.get_register(self.OIR_FD_PATH) - - if (interrupt_count_start == 'ERR' or - interrupt_count_end == 'ERR'): - print("get_transceiver_change_event : \ - unable to retrive interrupt count") - break + if timeout == 0: + forever = True + elif timeout > 0: + timeout = timeout / float(1000) # Convert to secs + else: + return False, port_dict # Incorrect timeout - # check_interrupts() itself may take upto 100s of msecs. - # We detect a missed interrupt based on the count - if interrupt_count_start == interrupt_count_end: + while True: + if forever: + timer = self.POLL_INTERVAL + else: + timer = min(timeout, self.POLL_INTERVAL) + start_time = time.time() + + time.sleep(timer) + cur_presence = self._get_transceiver_presence() + + # Update dict only if a change has been detected + if cur_presence != self._transceiver_presence: + changed_ports = self._transceiver_presence ^ cur_presence + for port in range(self.port_end): + # Mask off the bit corresponding to particular port + mask = 1 << port + if changed_ports & mask: + # qsfp_modprs 1 => optics is removed + if cur_presence & mask: + port_dict[port] = '0' + # qsfp_modprs 0 => optics is inserted + else: + port_dict[port] = '1' + + # Update current presence + self._transceiver_presence = cur_presence + break + + if not forever: + elapsed_time = time.time() - start_time + timeout = round(timeout - elapsed_time, 3) + if timeout <= 0: break - # Block until an xcvr is inserted or removed with timeout = -1 - events = self.epoll.poll( - timeout=timeout if timeout != 0 else -1) - if events: - # check interrupts and return the port_dict - retval, is_port_dict_updated = \ - self.check_interrupts(port_dict) - if (retval != 0): - return False, {} - - return True, port_dict - except: - return False, {} - finally: - if self.oir_fd != -1: - self.epoll.unregister(self.oir_fd.fileno()) - self.epoll.close() - self.oir_fd.close() - self.oir_fd = -1 - self.epoll = -1 - - return False, {} + return True, port_dict diff --git a/device/dell/x86_64-dell_s6100_c2538-r0/pmon_daemon_control.json b/device/dell/x86_64-dell_s6100_c2538-r0/pmon_daemon_control.json index 44871c057e82..94592fa8cebc 100644 --- a/device/dell/x86_64-dell_s6100_c2538-r0/pmon_daemon_control.json +++ b/device/dell/x86_64-dell_s6100_c2538-r0/pmon_daemon_control.json @@ -1,4 +1,3 @@ { - "skip_ledd": true, - "skip_thermalctld": true + "skip_ledd": true } diff --git a/device/dell/x86_64-dell_s6100_c2538-r0/system_health_monitoring_config.json b/device/dell/x86_64-dell_s6100_c2538-r0/system_health_monitoring_config.json new file mode 100644 index 000000000000..bb8ffbcd2172 --- /dev/null +++ b/device/dell/x86_64-dell_s6100_c2538-r0/system_health_monitoring_config.json @@ -0,0 +1,11 @@ +{ + "services_to_ignore": [], + "devices_to_ignore": [], + "user_defined_checkers": [], + "polling_interval": 60, + "led_color": { + "fault": "amber", + "normal": "green", + "booting": "blinking green" + } +} diff --git a/device/dell/x86_64-dellemc_s5232f_c3538-r0/DellEMC-S5232f-C32/td3-s5232f-32x100G.config.bcm b/device/dell/x86_64-dellemc_s5232f_c3538-r0/DellEMC-S5232f-C32/td3-s5232f-32x100G.config.bcm index 3f50f39db8e5..bf15510bf49b 100644 --- a/device/dell/x86_64-dellemc_s5232f_c3538-r0/DellEMC-S5232f-C32/td3-s5232f-32x100G.config.bcm +++ b/device/dell/x86_64-dellemc_s5232f_c3538-r0/DellEMC-S5232f-C32/td3-s5232f-32x100G.config.bcm @@ -1,3 +1,4 @@ +sai_load_hw_config=/etc/bcm/flex/bcm56870_a0_issu/b870.6.4.1/ os=unix core_clock_frequency=1525 diff --git a/device/dell/x86_64-dellemc_s5232f_c3538-r0/DellEMC-S5232f-C8D48/td3-s5232f-8x100G+48x50G.config.bcm b/device/dell/x86_64-dellemc_s5232f_c3538-r0/DellEMC-S5232f-C8D48/td3-s5232f-8x100G+48x50G.config.bcm index 4f3121387dea..68fb77a4219f 100644 --- a/device/dell/x86_64-dellemc_s5232f_c3538-r0/DellEMC-S5232f-C8D48/td3-s5232f-8x100G+48x50G.config.bcm +++ b/device/dell/x86_64-dellemc_s5232f_c3538-r0/DellEMC-S5232f-C8D48/td3-s5232f-8x100G+48x50G.config.bcm @@ -1,3 +1,4 @@ +sai_load_hw_config=/etc/bcm/flex/bcm56870_a0_issu/b870.6.4.1/ os=unix core_clock_frequency=1525 diff --git a/device/dell/x86_64-dellemc_s5232f_c3538-r0/DellEMC-S5232f-P-100G/port_config.ini b/device/dell/x86_64-dellemc_s5232f_c3538-r0/DellEMC-S5232f-P-100G/port_config.ini index 55c8fb3dcf64..2b24bea93107 100644 --- a/device/dell/x86_64-dellemc_s5232f_c3538-r0/DellEMC-S5232f-P-100G/port_config.ini +++ b/device/dell/x86_64-dellemc_s5232f_c3538-r0/DellEMC-S5232f-P-100G/port_config.ini @@ -31,5 +31,5 @@ Ethernet112 113,114,115,116 hundredGigE1/29 29 100000 Ethernet116 117,118,119,120 hundredGigE1/30 30 100000 Ethernet120 121,122,123,124 hundredGigE1/31 31 100000 Ethernet124 125,126,127,128 hundredGigE1/32 32 100000 -Ethernet128 128 tenGigE1/33 33 10000 -Ethernet129 129 tenGigE1/34 34 10000 +Ethernet128 129 tenGigE1/33 33 10000 +Ethernet129 128 tenGigE1/34 34 10000 diff --git a/device/dell/x86_64-dellemc_s5232f_c3538-r0/DellEMC-S5232f-P-100G/td3-s5232f-32x100G.config.bcm b/device/dell/x86_64-dellemc_s5232f_c3538-r0/DellEMC-S5232f-P-100G/td3-s5232f-32x100G.config.bcm index 099d1270443e..c44e4805c62a 100644 --- a/device/dell/x86_64-dellemc_s5232f_c3538-r0/DellEMC-S5232f-P-100G/td3-s5232f-32x100G.config.bcm +++ b/device/dell/x86_64-dellemc_s5232f_c3538-r0/DellEMC-S5232f-P-100G/td3-s5232f-32x100G.config.bcm @@ -1,3 +1,4 @@ +sai_load_hw_config=/etc/bcm/flex/bcm56870_a0_issu/b870.6.4.1/ os=unix core_clock_frequency=1525 diff --git a/device/dell/x86_64-dellemc_s5232f_c3538-r0/DellEMC-S5232f-P-10G/port_config.ini b/device/dell/x86_64-dellemc_s5232f_c3538-r0/DellEMC-S5232f-P-10G/port_config.ini index 726427759c08..c38b0e9b6f84 100644 --- a/device/dell/x86_64-dellemc_s5232f_c3538-r0/DellEMC-S5232f-P-10G/port_config.ini +++ b/device/dell/x86_64-dellemc_s5232f_c3538-r0/DellEMC-S5232f-P-10G/port_config.ini @@ -103,5 +103,5 @@ Ethernet112 113,114,115,116 hundredGigE1/29 29 100000 Ethernet116 117,118,119,120 hundredGigE1/30 30 100000 Ethernet120 121,122,123,124 hundredGigE1/31 31 100000 Ethernet124 125,126,127,128 hundredGigE1/32 32 100000 -Ethernet128 128 tenGigE1/33 33 10000 -Ethernet129 129 tenGigE1/34 34 10000 +Ethernet128 129 tenGigE1/33 33 10000 +Ethernet129 128 tenGigE1/34 34 10000 diff --git a/device/dell/x86_64-dellemc_s5232f_c3538-r0/DellEMC-S5232f-P-10G/td3-s5232f-96x10G+8x100G.config.bcm b/device/dell/x86_64-dellemc_s5232f_c3538-r0/DellEMC-S5232f-P-10G/td3-s5232f-96x10G+8x100G.config.bcm index caf255d892e8..6f62b7209198 100644 --- a/device/dell/x86_64-dellemc_s5232f_c3538-r0/DellEMC-S5232f-P-10G/td3-s5232f-96x10G+8x100G.config.bcm +++ b/device/dell/x86_64-dellemc_s5232f_c3538-r0/DellEMC-S5232f-P-10G/td3-s5232f-96x10G+8x100G.config.bcm @@ -1,3 +1,4 @@ +sai_load_hw_config=/etc/bcm/flex/bcm56870_a0_issu/b870.6.4.1/ os=unix core_clock_frequency=1525 diff --git a/device/dell/x86_64-dellemc_s5232f_c3538-r0/DellEMC-S5232f-P-25G/port_config.ini b/device/dell/x86_64-dellemc_s5232f_c3538-r0/DellEMC-S5232f-P-25G/port_config.ini index 7366a95cf8b8..e78fafdc24e0 100644 --- a/device/dell/x86_64-dellemc_s5232f_c3538-r0/DellEMC-S5232f-P-25G/port_config.ini +++ b/device/dell/x86_64-dellemc_s5232f_c3538-r0/DellEMC-S5232f-P-25G/port_config.ini @@ -103,5 +103,5 @@ Ethernet112 113,114,115,116 hundredGigE1/29 29 100000 Ethernet116 117,118,119,120 hundredGigE1/30 30 100000 Ethernet120 121,122,123,124 hundredGigE1/31 31 100000 Ethernet124 125,126,127,128 hundredGigE1/32 32 100000 -Ethernet128 128 tenGigE1/33 33 10000 -Ethernet129 129 tenGigE1/34 34 10000 +Ethernet128 129 tenGigE1/33 33 10000 +Ethernet129 128 tenGigE1/34 34 10000 diff --git a/device/dell/x86_64-dellemc_s5232f_c3538-r0/DellEMC-S5232f-P-25G/td3-s5232f-96x25G+8x100G.config.bcm b/device/dell/x86_64-dellemc_s5232f_c3538-r0/DellEMC-S5232f-P-25G/td3-s5232f-96x25G+8x100G.config.bcm index 84bd873acc4b..a4fccde19686 100644 --- a/device/dell/x86_64-dellemc_s5232f_c3538-r0/DellEMC-S5232f-P-25G/td3-s5232f-96x25G+8x100G.config.bcm +++ b/device/dell/x86_64-dellemc_s5232f_c3538-r0/DellEMC-S5232f-P-25G/td3-s5232f-96x25G+8x100G.config.bcm @@ -1,3 +1,4 @@ +sai_load_hw_config=/etc/bcm/flex/bcm56870_a0_issu/b870.6.4.1/ os=unix core_clock_frequency=1525 diff --git a/device/dell/x86_64-dellemc_s5232f_c3538-r0/plugins/sfputil.py b/device/dell/x86_64-dellemc_s5232f_c3538-r0/plugins/sfputil.py index f53e8e944d1e..b56fcc5aafd0 100644 --- a/device/dell/x86_64-dellemc_s5232f_c3538-r0/plugins/sfputil.py +++ b/device/dell/x86_64-dellemc_s5232f_c3538-r0/plugins/sfputil.py @@ -311,7 +311,7 @@ def get_transceiver_dom_info_dict(self, port_num): qsfp_dom_capability_raw = self._read_eeprom_specific_bytes( sysfsfile_eeprom, (offset_xcvr + XCVR_DOM_CAPABILITY_OFFSET), XCVR_DOM_CAPABILITY_WIDTH) if qsfp_dom_capability_raw is not None: - qspf_dom_capability_data = sfpi_obj.parse_qsfp_dom_capability( + qspf_dom_capability_data = sfpi_obj.parse_dom_capability( qsfp_dom_capability_raw, 0) else: return transceiver_dom_info_dict diff --git a/device/dell/x86_64-dellemc_s5248f_c3538-r0/DellEMC-S5248f-P-10G/td3-s5248f-10g.config.bcm b/device/dell/x86_64-dellemc_s5248f_c3538-r0/DellEMC-S5248f-P-10G/td3-s5248f-10g.config.bcm index 2369f4590795..021f94dc32f7 100644 --- a/device/dell/x86_64-dellemc_s5248f_c3538-r0/DellEMC-S5248f-P-10G/td3-s5248f-10g.config.bcm +++ b/device/dell/x86_64-dellemc_s5248f_c3538-r0/DellEMC-S5248f-P-10G/td3-s5248f-10g.config.bcm @@ -1,3 +1,4 @@ +sai_load_hw_config=/etc/bcm/flex/bcm56870_a0_issu/b870.6.4.1/ os=unix dpp_clock_ratio=2:3 oversubscribe_mode=1 diff --git a/device/dell/x86_64-dellemc_s5248f_c3538-r0/DellEMC-S5248f-P-25G/td3-s5248f-25g.config.bcm b/device/dell/x86_64-dellemc_s5248f_c3538-r0/DellEMC-S5248f-P-25G/td3-s5248f-25g.config.bcm index 4095c2d0a4f4..2630512df0ca 100644 --- a/device/dell/x86_64-dellemc_s5248f_c3538-r0/DellEMC-S5248f-P-25G/td3-s5248f-25g.config.bcm +++ b/device/dell/x86_64-dellemc_s5248f_c3538-r0/DellEMC-S5248f-P-25G/td3-s5248f-25g.config.bcm @@ -1,3 +1,4 @@ +sai_load_hw_config=/etc/bcm/flex/bcm56870_a0_issu/b870.6.4.1/ os=unix dpp_clock_ratio=2:3 diff --git a/device/dell/x86_64-dellemc_s5248f_c3538-r0/plugins/sfputil.py b/device/dell/x86_64-dellemc_s5248f_c3538-r0/plugins/sfputil.py index 2b941d028968..dba21ed11bdb 100644 --- a/device/dell/x86_64-dellemc_s5248f_c3538-r0/plugins/sfputil.py +++ b/device/dell/x86_64-dellemc_s5248f_c3538-r0/plugins/sfputil.py @@ -358,7 +358,7 @@ def get_transceiver_dom_info_dict(self, port_num): qsfp_dom_capability_raw = self._read_eeprom_specific_bytes( sysfsfile_eeprom, (offset_xcvr + XCVR_DOM_CAPABILITY_OFFSET), XCVR_DOM_CAPABILITY_WIDTH) if qsfp_dom_capability_raw is not None: - qspf_dom_capability_data = sfpi_obj.parse_qsfp_dom_capability( + qspf_dom_capability_data = sfpi_obj.parse_dom_capability( qsfp_dom_capability_raw, 0) else: return transceiver_dom_info_dict diff --git a/device/dell/x86_64-dellemc_s5296f_c3538-r0/DellEMC-S5296f-P-10G/td3-s5296f-10g.config.bcm b/device/dell/x86_64-dellemc_s5296f_c3538-r0/DellEMC-S5296f-P-10G/td3-s5296f-10g.config.bcm index 7351e6908e78..ddc14d9363d3 100644 --- a/device/dell/x86_64-dellemc_s5296f_c3538-r0/DellEMC-S5296f-P-10G/td3-s5296f-10g.config.bcm +++ b/device/dell/x86_64-dellemc_s5296f_c3538-r0/DellEMC-S5296f-P-10G/td3-s5296f-10g.config.bcm @@ -1,3 +1,4 @@ +sai_load_hw_config=/etc/bcm/flex/bcm56870_a0_issu/b870.6.4.1/ os=unix portmap_5.0=5:10 portmap_6.0=6:10 diff --git a/device/dell/x86_64-dellemc_s5296f_c3538-r0/DellEMC-S5296f-P-25G/td3-s5296f-25g.config.bcm b/device/dell/x86_64-dellemc_s5296f_c3538-r0/DellEMC-S5296f-P-25G/td3-s5296f-25g.config.bcm index 81a42406e75f..dd0901f5d01f 100644 --- a/device/dell/x86_64-dellemc_s5296f_c3538-r0/DellEMC-S5296f-P-25G/td3-s5296f-25g.config.bcm +++ b/device/dell/x86_64-dellemc_s5296f_c3538-r0/DellEMC-S5296f-P-25G/td3-s5296f-25g.config.bcm @@ -1,3 +1,4 @@ +sai_load_hw_config=/etc/bcm/flex/bcm56870_a0_issu/b870.6.4.1/ os=unix portmap_5.0=5:25 portmap_6.0=6:25 diff --git a/device/dell/x86_64-dellemc_s5296f_c3538-r0/plugins/sfputil.py b/device/dell/x86_64-dellemc_s5296f_c3538-r0/plugins/sfputil.py index 8b4ab0dcae1a..c270ef47f1e0 100644 --- a/device/dell/x86_64-dellemc_s5296f_c3538-r0/plugins/sfputil.py +++ b/device/dell/x86_64-dellemc_s5296f_c3538-r0/plugins/sfputil.py @@ -305,7 +305,7 @@ def get_transceiver_dom_info_dict(self, port_num): qsfp_dom_capability_raw = self._read_eeprom_specific_bytes( sysfsfile_eeprom, (offset_xcvr + XCVR_DOM_CAPABILITY_OFFSET), XCVR_DOM_CAPABILITY_WIDTH) if qsfp_dom_capability_raw is not None: - qspf_dom_capability_data = sfpi_obj.parse_qsfp_dom_capability(qsfp_dom_capability_raw, 0) + qspf_dom_capability_data = sfpi_obj.parse_dom_capability(qsfp_dom_capability_raw, 0) else: return transceiver_dom_info_dict diff --git a/device/dell/x86_64-dellemc_z9264f_c3538-r0/plugins/sfputil.py b/device/dell/x86_64-dellemc_z9264f_c3538-r0/plugins/sfputil.py index 5b01882762af..48f722a5d964 100644 --- a/device/dell/x86_64-dellemc_z9264f_c3538-r0/plugins/sfputil.py +++ b/device/dell/x86_64-dellemc_z9264f_c3538-r0/plugins/sfputil.py @@ -378,7 +378,7 @@ def get_transceiver_dom_info_dict(self, port_num): qsfp_dom_capability_raw = self._read_eeprom_specific_bytes( sysfsfile_eeprom, (offset_xcvr + XCVR_DOM_CAPABILITY_OFFSET), XCVR_DOM_CAPABILITY_WIDTH) if qsfp_dom_capability_raw is not None: - qspf_dom_capability_data = sfpi_obj.parse_qsfp_dom_capability(qsfp_dom_capability_raw, 0) + qspf_dom_capability_data = sfpi_obj.parse_dom_capability(qsfp_dom_capability_raw, 0) else: return transceiver_dom_info_dict diff --git a/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-C32/port_config.ini b/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-C32/port_config.ini index d7d83ae21e76..62482e72564e 100644 --- a/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-C32/port_config.ini +++ b/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-C32/port_config.ini @@ -1,35 +1,35 @@ -# name lanes alias index speed -Ethernet0 33,34,35,36 hundredGigE1/1 1 100000 -Ethernet8 41,42,43,44 hundredGigE1/2 2 100000 -Ethernet16 49,50,51,52 hundredGigE1/3 3 100000 -Ethernet24 57,58,59,60 hundredGigE1/4 4 100000 -Ethernet32 65,66,67,68 hundredGigE1/5 5 100000 -Ethernet40 73,74,75,76 hundredGigE1/6 6 100000 -Ethernet48 81,82,83,84 hundredGigE1/7 7 100000 -Ethernet56 89,90,91,92 hundredGigE1/8 8 100000 -Ethernet64 1,2,3,4 hundredGigE1/9 9 100000 -Ethernet72 9,10,11,12 hundredGigE1/10 10 100000 -Ethernet80 17,18,19,20 hundredGigE1/11 11 100000 -Ethernet88 25,26,27,28 hundredGigE1/12 12 100000 -Ethernet96 97,98,99,100 hundredGigE1/13 13 100000 -Ethernet104 105,106,107,108 hundredGigE1/14 14 100000 -Ethernet112 113,114,115,116 hundredGigE1/15 15 100000 -Ethernet120 121,122,123,124 hundredGigE1/16 16 100000 -Ethernet128 129,130,131,132 hundredGigE1/17 17 100000 -Ethernet136 137,138,139,140 hundredGigE1/18 18 100000 -Ethernet144 145,146,147,148 hundredGigE1/19 19 100000 -Ethernet152 153,154,155,156 hundredGigE1/20 20 100000 -Ethernet160 225,226,227,228 hundredGigE1/21 21 100000 -Ethernet168 233,234,235,236 hundredGigE1/22 22 100000 -Ethernet176 241,242,243,244 hundredGigE1/23 23 100000 -Ethernet184 249,250,251,252 hundredGigE1/24 24 100000 -Ethernet192 161,162,163,164 hundredGigE1/25 25 100000 -Ethernet200 169,170,171,172 hundredGigE1/26 26 100000 -Ethernet208 177,178,179,180 hundredGigE1/27 27 100000 -Ethernet216 185,186,187,188 hundredGigE1/28 28 100000 -Ethernet224 193,194,195,196 hundredGigE1/29 29 100000 -Ethernet232 201,202,203,204 hundredGigE1/30 30 100000 -Ethernet240 209,210,211,212 hundredGigE1/31 31 100000 -Ethernet248 217,218,219,220 hundredGigE1/32 32 100000 -Ethernet256 257 tenGigE1/33 33 10000 -Ethernet257 258 tenGigE1/34 34 10000 +# name lanes alias index speed +Ethernet0 33,34,35,36 etp1 1 100000 +Ethernet8 41,42,43,44 etp2 2 100000 +Ethernet16 49,50,51,52 etp3 3 100000 +Ethernet24 57,58,59,60 etp4 4 100000 +Ethernet32 65,66,67,68 etp5 5 100000 +Ethernet40 73,74,75,76 etp6 6 100000 +Ethernet48 81,82,83,84 etp7 7 100000 +Ethernet56 89,90,91,92 etp8 8 100000 +Ethernet64 1,2,3,4 etp9 9 100000 +Ethernet72 9,10,11,12 etp10 10 100000 +Ethernet80 17,18,19,20 etp11 11 100000 +Ethernet88 25,26,27,28 etp12 12 100000 +Ethernet96 97,98,99,100 etp13 13 100000 +Ethernet104 105,106,107,108 etp14 14 100000 +Ethernet112 113,114,115,116 etp15 15 100000 +Ethernet120 121,122,123,124 etp16 16 100000 +Ethernet128 129,130,131,132 etp17 17 100000 +Ethernet136 137,138,139,140 etp18 18 100000 +Ethernet144 145,146,147,148 etp19 19 100000 +Ethernet152 153,154,155,156 etp20 20 100000 +Ethernet160 225,226,227,228 etp21 21 100000 +Ethernet168 233,234,235,236 etp22 22 100000 +Ethernet176 241,242,243,244 etp23 23 100000 +Ethernet184 249,250,251,252 etp24 24 100000 +Ethernet192 161,162,163,164 etp25 25 100000 +Ethernet200 169,170,171,172 etp26 26 100000 +Ethernet208 177,178,179,180 etp27 27 100000 +Ethernet216 185,186,187,188 etp28 28 100000 +Ethernet224 193,194,195,196 etp29 29 100000 +Ethernet232 201,202,203,204 etp30 30 100000 +Ethernet240 209,210,211,212 etp31 31 100000 +Ethernet248 217,218,219,220 etp32 32 100000 +Ethernet256 257 etp33 33 10000 +Ethernet257 258 etp34 34 10000 diff --git a/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-C32/sai_preinit_cmd.soc b/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-C32/sai_preinit_cmd.soc index 920cd33016b4..4d62900f898f 100644 --- a/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-C32/sai_preinit_cmd.soc +++ b/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-C32/sai_preinit_cmd.soc @@ -1,3 +1,2 @@ -#Not supported in current SAI version m0 load 0 0x0 /usr/share/sonic/hwsku/linkscan_led_fw.bin m0 load 0 0x3800 /usr/share/sonic/hwsku/custom_led.bin diff --git a/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-C32/th3-z9332f-32x100G.config.bcm b/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-C32/th3-z9332f-32x100G.config.bcm index 00e6887b4b49..207680ec374a 100644 --- a/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-C32/th3-z9332f-32x100G.config.bcm +++ b/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-C32/th3-z9332f-32x100G.config.bcm @@ -1,14 +1,25 @@ +# The following 2 SOC properties are needed to prevent FDB Events during Warmboot due to TH3 is SW Managed MACs +l2xmsg_shadow_hit_bits=0 +l2xmsg_no_cb_during_table_rebuild=1 + +sai_tunnel_global_sip_mask_enable=1 core_clock_frequency=1325 dpr_clock_frequency=1000 device_clock_frequency=1325 port_flex_enable=1 +# disables bcmALPMDH (ALPM distributed hitbit) thread. This thread is purely for debug purpose +l3_alpm_hit_skip=1 + +# Disable Counting ACL Drop towards interface RX_DRP counter +sai_adjust_acl_drop_in_rx_drop=1 + #firmware load method, use fast load load_firmware=0x2 ccm_dma_enable=0 ccmdma_intr_enable=0 -mem_cache_enable=0 +mem_cache_enable=1 phy_enable=0 phy_null=1 @@ -514,6 +525,6 @@ serdes_lane_config_media_type_27=copper serdes_lane_config_media_type_28=copper serdes_lane_config_media_type_24=copper -#sai_preinit_cmd_file=/usr/share/sonic/hwsku/sai_preinit_cmd.soc +sai_preinit_cmd_file=/usr/share/sonic/hwsku/sai_preinit_cmd.soc sai_postinit_cmd_file=/usr/share/sonic/hwsku/sai_postinit_cmd.soc - +led_fw_path=/usr/share/sonic/hwsku/ diff --git a/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-M-O16C64/buffers.json.j2 b/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-M-O16C64/buffers.json.j2 index 0b1cb2c541b6..03cd094bc938 100644 --- a/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-M-O16C64/buffers.json.j2 +++ b/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-M-O16C64/buffers.json.j2 @@ -1,2 +1,2 @@ -{%- set default_topo = 't1' %} -{%- include 'buffers_config.j2' %} +{%- set default_topo = 't0' %} +{%- include 'buffers_config.j2' %} diff --git a/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-M-O16C64/buffers_defaults_t0.j2 b/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-M-O16C64/buffers_defaults_t0.j2 index 77747f6403c8..33aaea75935d 100644 --- a/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-M-O16C64/buffers_defaults_t0.j2 +++ b/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-M-O16C64/buffers_defaults_t0.j2 @@ -1,20 +1,57 @@ - -{%- set default_cable = '40m' %} - -{%- macro generate_buffer_pool_and_profiles() %} - "BUFFER_POOL": { - }, - "BUFFER_PROFILE": { - }, -{%- endmacro %} - -{%- macro generate_pg_profils(port_names_active) %} - "BUFFER_PG": { - }, -{%- endmacro %} - -{% macro generate_queue_buffers(port_names_active) %} - "BUFFER_QUEUE": { - } -{% endmacro %} - +{%- set default_cable = '300m' %} + +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {%- for port_idx in range(0,12) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 8)) %}{%- endif %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 8) + 2) %}{%- endif %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 8) + 4) %}{%- endif %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 8) + 6) %}{%- endif %} + {%- endfor %} + {%- for port_idx in range(12,16) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 8)) %}{%- endif %} + {%- endfor %} + {%- for port_idx in range(16,20) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 8)) %}{%- endif %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 8) + 2) %}{%- endif %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 8) + 4) %}{%- endif %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 8) + 6) %}{%- endif %} + {%- endfor %} + {%- for port_idx in range(20,32) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 8)) %}{%- endif %} + {%- endfor %} +{%- endmacro %} + + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "66394076", + "type": "ingress", + "mode": "dynamic", + "xoff": "8644128" + }, + "egress_lossless_pool": { + "size": "55921148", + "type": "egress", + "mode": "static" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "static_th":"66394076" + }, + "egress_lossless_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"0", + "static_th":"67117468" + }, + "egress_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"1778", + "dynamic_th":"1" + } + }, +{%- endmacro %} diff --git a/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-M-O16C64/buffers_defaults_t1.j2 b/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-M-O16C64/buffers_defaults_t1.j2 index 77747f6403c8..33aaea75935d 100644 --- a/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-M-O16C64/buffers_defaults_t1.j2 +++ b/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-M-O16C64/buffers_defaults_t1.j2 @@ -1,20 +1,57 @@ - -{%- set default_cable = '40m' %} - -{%- macro generate_buffer_pool_and_profiles() %} - "BUFFER_POOL": { - }, - "BUFFER_PROFILE": { - }, -{%- endmacro %} - -{%- macro generate_pg_profils(port_names_active) %} - "BUFFER_PG": { - }, -{%- endmacro %} - -{% macro generate_queue_buffers(port_names_active) %} - "BUFFER_QUEUE": { - } -{% endmacro %} - +{%- set default_cable = '300m' %} + +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {%- for port_idx in range(0,12) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 8)) %}{%- endif %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 8) + 2) %}{%- endif %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 8) + 4) %}{%- endif %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 8) + 6) %}{%- endif %} + {%- endfor %} + {%- for port_idx in range(12,16) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 8)) %}{%- endif %} + {%- endfor %} + {%- for port_idx in range(16,20) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 8)) %}{%- endif %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 8) + 2) %}{%- endif %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 8) + 4) %}{%- endif %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 8) + 6) %}{%- endif %} + {%- endfor %} + {%- for port_idx in range(20,32) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 8)) %}{%- endif %} + {%- endfor %} +{%- endmacro %} + + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "66394076", + "type": "ingress", + "mode": "dynamic", + "xoff": "8644128" + }, + "egress_lossless_pool": { + "size": "55921148", + "type": "egress", + "mode": "static" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "static_th":"66394076" + }, + "egress_lossless_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"0", + "static_th":"67117468" + }, + "egress_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"1778", + "dynamic_th":"1" + } + }, +{%- endmacro %} diff --git a/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-M-O16C64/pg_profile_lookup.ini b/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-M-O16C64/pg_profile_lookup.ini index a5f3286beef8..06d19555c746 100644 --- a/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-M-O16C64/pg_profile_lookup.ini +++ b/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-M-O16C64/pg_profile_lookup.ini @@ -1,23 +1,12 @@ -# PG lossless profiles. -# speed cable size xon xoff threshold xon_offset - 10000 5m 1270 0 190500 -2 2540 - 25000 5m 1270 0 190500 -2 2540 - 40000 5m 1270 0 190500 -2 2540 - 50000 5m 1270 0 190500 -2 2540 - 100000 5m 1270 0 190500 -2 2540 - 200000 5m 1270 0 190500 -2 2540 - 400000 5m 1270 0 190500 -2 2540 - 10000 40m 1270 0 190500 -2 2540 - 25000 40m 1270 0 190500 -2 2540 - 40000 40m 1270 0 190500 -2 2540 - 50000 40m 1270 0 190500 -2 2540 - 100000 40m 1270 0 190500 -2 2540 - 200000 40m 1270 0 190500 -2 2540 - 400000 40m 1270 0 190500 -2 2540 - 10000 300m 1270 0 190500 -2 2540 - 25000 300m 1270 0 190500 -2 2540 - 40000 300m 1270 0 190500 -2 2540 - 50000 300m 1270 0 190500 -2 2540 - 100000 300m 1270 0 190500 -2 2540 - 200000 300m 1270 0 190500 -2 2540 - 400000 300m 1270 0 190500 -2 2540 +# PG lossless profiles. +# speed cable size xon xoff threshold xon_offset + 100000 5m 2540 2540 68580 -2 2540 + 100000 40m 2540 2540 74422 -2 2540 + 100000 300m 2540 2540 117348 -2 2540 + 100000 1000m 2540 2540 233172 -2 2540 + 100000 2000m 2540 2540 398526 -2 2540 + 400000 5m 2540 2540 178562 -2 2540 + 400000 40m 2540 2540 201930 -2 2540 + 400000 300m 2540 2540 373888 -2 2540 + 400000 1000m 2540 2540 836676 -2 2540 + 400000 2000m 2540 2540 1498092 -2 2540 diff --git a/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-M-O16C64/port_config.ini b/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-M-O16C64/port_config.ini index 542992d761a6..b191e0a41a1d 100644 --- a/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-M-O16C64/port_config.ini +++ b/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-M-O16C64/port_config.ini @@ -1,83 +1,83 @@ -# name lanes alias index speed -Ethernet0 33,34 hundredGigE1/1/1 1 100000 -Ethernet2 35,36 hundredGigE1/1/2 1 100000 -Ethernet4 37,38 hundredGigE1/1/3 1 100000 -Ethernet6 39,40 hundredGigE1/1/4 1 100000 -Ethernet8 41,42 hundredGigE1/2/1 2 100000 -Ethernet10 43,44 hundredGigE1/2/2 2 100000 -Ethernet12 45,46 hundredGigE1/2/3 2 100000 -Ethernet14 47,48 hundredGigE1/2/4 2 100000 -Ethernet16 49,50 hundredGigE1/3/1 3 100000 -Ethernet18 51,52 hundredGigE1/3/2 3 100000 -Ethernet20 53,54 hundredGigE1/3/3 3 100000 -Ethernet22 55,56 hundredGigE1/3/4 3 100000 -Ethernet24 57,58 hundredGigE1/4/1 4 100000 -Ethernet26 59,60 hundredGigE1/4/2 4 100000 -Ethernet28 61,62 hundredGigE1/4/3 4 100000 -Ethernet30 63,64 hundredGigE1/4/4 4 100000 -Ethernet32 65,66,67,68,69,70,71,72 fourhundredGigE1/5 5 400000 -Ethernet40 73,74,75,76,77,78,79,80 fourhundredGigE1/6 6 400000 -Ethernet48 81,82,83,84,85,86,87,88 fourhundredGigE1/7 7 400000 -Ethernet56 89,90,91,92,93,94,95,96 fourhundredGigE1/8 8 400000 -Ethernet64 1,2 hundredGigE1/9/1 9 100000 -Ethernet66 3,4 hundredGigE1/9/2 9 100000 -Ethernet68 5,6 hundredGigE1/9/3 9 100000 -Ethernet70 7,8 hundredGigE1/9/4 9 100000 -Ethernet72 9,10 hundredGigE1/10/1 10 100000 -Ethernet74 11,12 hundredGigE1/10/2 10 100000 -Ethernet76 13,14 hundredGigE1/10/3 10 100000 -Ethernet78 15,16 hundredGigE1/10/4 10 100000 -Ethernet80 17,18 hundredGigE1/11/1 11 100000 -Ethernet82 19,20 hundredGigE1/11/2 11 100000 -Ethernet84 21,22 hundredGigE1/11/3 11 100000 -Ethernet86 23,24 hundredGigE1/11/4 11 100000 -Ethernet88 25,26 hundredGigE1/12/1 12 100000 -Ethernet90 27,28 hundredGigE1/12/2 12 100000 -Ethernet92 29,30 hundredGigE1/12/3 12 100000 -Ethernet94 31,32 hundredGigE1/12/4 12 100000 -Ethernet96 97,98,99,100,101,102,103,104 fourhundredGigE1/13 13 400000 -Ethernet104 105,106,107,108,109,110,111,112 fourhundredGigE1/14 14 400000 -Ethernet112 113,114,115,116,117,118,119,120 fourhundredGigE1/15 15 400000 -Ethernet120 121,122,123,124,125,126,127,128 fourhundredGigE1/16 16 400000 -Ethernet128 129,130,131,132,133,134,135,136 fourhundredGigE1/17 17 400000 -Ethernet136 137,138,139,140,141,142,143,144 fourhundredGigE1/18 18 400000 -Ethernet144 145,146,147,148,149,150,151,152 fourhundredGigE1/19 19 400000 -Ethernet152 153,154,155,156,157,158,159,160 fourhundredGigE1/20 20 400000 -Ethernet160 225,226 hundredGigE1/21/1 21 100000 -Ethernet162 227,228 hundredGigE1/21/2 21 100000 -Ethernet164 229,230 hundredGigE1/21/3 21 100000 -Ethernet166 231,232 hundredGigE1/21/4 21 100000 -Ethernet168 233,234 hundredGigE1/22/1 22 100000 -Ethernet170 235,236 hundredGigE1/22/2 22 100000 -Ethernet172 237,238 hundredGigE1/22/3 22 100000 -Ethernet174 239,240 hundredGigE1/22/4 22 100000 -Ethernet176 241,242 hundredGigE1/23/1 23 100000 -Ethernet178 243,244 hundredGigE1/23/2 23 100000 -Ethernet180 245,246 hundredGigE1/23/3 23 100000 -Ethernet182 247,248 hundredGigE1/23/4 23 100000 -Ethernet184 249,250 hundredGigE1/24/1 24 100000 -Ethernet186 251,252 hundredGigE1/24/2 24 100000 -Ethernet188 253,254 hundredGigE1/24/3 24 100000 -Ethernet190 255,256 hundredGigE1/24/4 24 100000 -Ethernet192 161,162,163,164,165,166,167,168 fourhundredGigE1/25 25 400000 -Ethernet200 169,170,171,172,173,174,175,176 fourhundredGigE1/26 26 400000 -Ethernet208 177,178,179,180,181,182,183,184 fourhundredGigE1/27 27 400000 -Ethernet216 185,186,187,188,189,190,191,192 fourhundredGigE1/28 28 400000 -Ethernet224 193,194 hundredGigE1/29/1 29 100000 -Ethernet226 195,196 hundredGigE1/29/2 29 100000 -Ethernet228 197,198 hundredGigE1/29/3 29 100000 -Ethernet230 199,200 hundredGigE1/29/4 29 100000 -Ethernet232 201,202 hundredGigE1/30/1 30 100000 -Ethernet234 203,204 hundredGigE1/30/2 30 100000 -Ethernet236 205,206 hundredGigE1/30/3 30 100000 -Ethernet238 207,208 hundredGigE1/30/4 30 100000 -Ethernet240 209,210 hundredGigE1/31/1 31 100000 -Ethernet242 211,212 hundredGigE1/31/2 31 100000 -Ethernet244 213,214 hundredGigE1/31/3 31 100000 -Ethernet246 215,216 hundredGigE1/31/4 31 100000 -Ethernet248 217,218 hundredGigE1/32/1 32 100000 -Ethernet250 219,220 hundredGigE1/32/2 32 100000 -Ethernet252 221,222 hundredGigE1/32/3 32 100000 -Ethernet254 223,224 hundredGigE1/32/4 32 100000 -Ethernet256 257 tenGigE1/33 33 10000 -Ethernet257 258 tenGigE1/34 34 10000 +# name lanes alias index speed +Ethernet0 33,34 etp1a 1 100000 +Ethernet2 35,36 etp1b 1 100000 +Ethernet4 37,38 etp1c 1 100000 +Ethernet6 39,40 etp1d 1 100000 +Ethernet8 41,42 etp2a 2 100000 +Ethernet10 43,44 etp2b 2 100000 +Ethernet12 45,46 etp2c 2 100000 +Ethernet14 47,48 etp2d 2 100000 +Ethernet16 49,50 etp3a 3 100000 +Ethernet18 51,52 etp3b 3 100000 +Ethernet20 53,54 etp3c 3 100000 +Ethernet22 55,56 etp3d 3 100000 +Ethernet24 57,58 etp4a 4 100000 +Ethernet26 59,60 etp4b 4 100000 +Ethernet28 61,62 etp4c 4 100000 +Ethernet30 63,64 etp4d 4 100000 +Ethernet32 65,66 etp5a 5 100000 +Ethernet34 67,68 etp5b 5 100000 +Ethernet36 69,70 etp5c 5 100000 +Ethernet38 71,72 etp5d 5 100000 +Ethernet40 73,74 etp6a 6 100000 +Ethernet42 75,76 etp6b 6 100000 +Ethernet44 77,78 etp6c 6 100000 +Ethernet46 79,80 etp6d 6 100000 +Ethernet48 81,82 etp7a 7 100000 +Ethernet50 83,84 etp7b 7 100000 +Ethernet52 85,86 etp7c 7 100000 +Ethernet54 87,88 etp7d 7 100000 +Ethernet56 89,90 etp8a 8 100000 +Ethernet58 91,92 etp8b 8 100000 +Ethernet60 93,94 etp8c 8 100000 +Ethernet62 95,96 etp8d 8 100000 +Ethernet64 1,2 etp9a 9 100000 +Ethernet66 3,4 etp9b 9 100000 +Ethernet68 5,6 etp9c 9 100000 +Ethernet70 7,8 etp9d 9 100000 +Ethernet72 9,10 etp10a 10 100000 +Ethernet74 11,12 etp10b 10 100000 +Ethernet76 13,14 etp10c 10 100000 +Ethernet78 15,16 etp10d 10 100000 +Ethernet80 17,18 etp11a 11 100000 +Ethernet82 19,20 etp11b 11 100000 +Ethernet84 21,22 etp11c 11 100000 +Ethernet86 23,24 etp11d 11 100000 +Ethernet88 25,26 etp12a 12 100000 +Ethernet90 27,28 etp12b 12 100000 +Ethernet92 29,30 etp12c 12 100000 +Ethernet94 31,32 etp12d 12 100000 +Ethernet96 97,98,99,100,101,102,103,104 etp13 13 400000 +Ethernet104 105,106,107,108,109,110,111,112 etp14 14 400000 +Ethernet112 113,114,115,116,117,118,119,120 etp15 15 400000 +Ethernet120 121,122,123,124,125,126,127,128 etp16 16 400000 +Ethernet128 129,130 etp17a 17 100000 +Ethernet130 131,132 etp17b 17 100000 +Ethernet132 133,134 etp17c 17 100000 +Ethernet134 135,136 etp17d 17 100000 +Ethernet136 137,138 etp18a 18 100000 +Ethernet138 139,140 etp18b 18 100000 +Ethernet140 141,142 etp18c 18 100000 +Ethernet142 143,144 etp18d 18 100000 +Ethernet144 145,146 etp19a 19 100000 +Ethernet146 147,148 etp19b 19 100000 +Ethernet148 149,150 etp19c 19 100000 +Ethernet150 151,152 etp19d 19 100000 +Ethernet152 153,154 etp20a 20 100000 +Ethernet154 155,156 etp20b 20 100000 +Ethernet156 157,158 etp20c 20 100000 +Ethernet158 159,160 etp20d 20 100000 +Ethernet160 225,226,227,228,229,230,231,232 etp21 21 400000 +Ethernet168 233,234,235,236,237,238,239,240 etp22 22 400000 +Ethernet176 241,242,243,244,245,246,247,248 etp23 23 400000 +Ethernet184 249,250,251,252,253,254,255,256 etp24 24 400000 +Ethernet192 161,162,163,164,165,166,167,168 etp25 25 400000 +Ethernet200 169,170,171,172,173,174,175,176 etp26 26 400000 +Ethernet208 177,178,179,180,181,182,183,184 etp27 27 400000 +Ethernet216 185,186,187,188,189,190,191,192 etp28 28 400000 +Ethernet224 193,194,195,196,197,198,199,200 etp29 29 400000 +Ethernet232 201,202,203,204,205,206,207,208 etp30 30 400000 +Ethernet240 209,210,211,212,213,214,215,216 etp31 31 400000 +Ethernet248 217,218,219,220,221,222,223,224 etp32 32 400000 +Ethernet256 257 etp33 33 10000 +Ethernet257 258 etp34 34 10000 diff --git a/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-M-O16C64/qos.json.j2 b/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-M-O16C64/qos.json.j2 index a48e1b56621c..3e548325ea30 100644 --- a/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-M-O16C64/qos.json.j2 +++ b/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-M-O16C64/qos.json.j2 @@ -1,226 +1 @@ -{%- set PORT_ALL = [] %} -{%- for port in PORT %} - {%- if PORT_ALL.append(port) %}{% endif %} -{%- endfor %} -{%- if PORT_ALL | sort_by_port_index %}{% endif %} - -{%- set port_names_list_all = [] %} -{%- for port in PORT_ALL %} - {%- if port_names_list_all.append(port) %}{% endif %} -{%- endfor %} -{%- set port_names_all = port_names_list_all | join(',') -%} - - -{%- set PORT_ACTIVE = [] %} -{%- if DEVICE_NEIGHBOR is not defined %} - {%- set PORT_ACTIVE = PORT_ALL %} -{%- else %} - {%- for port in DEVICE_NEIGHBOR.keys() %} - {%- if PORT_ACTIVE.append(port) %}{%- endif %} - {%- endfor %} -{%- endif %} -{%- if PORT_ACTIVE | sort_by_port_index %}{% endif %} - -{%- set port_names_list_active = [] %} -{%- for port in PORT_ACTIVE %} - {%- if port_names_list_active.append(port) %}{%- endif %} -{%- endfor %} -{%- set port_names_active = port_names_list_active | join(',') -%} - - -{%- set pfc_to_pg_map_supported_asics = ['mellanox', 'barefoot', 'marvell'] -%} - - -{ -{% if generate_tc_to_pg_map is defined %} - {{- generate_tc_to_pg_map() }} -{% else %} - "TC_TO_PRIORITY_GROUP_MAP": { - "DEFAULT": { - "0": "0", - "1": "0", - "2": "0", - "3": "3", - "4": "4", - "5": "0", - "6": "0", - "7": "7" - } - }, -{% endif %} - "MAP_PFC_PRIORITY_TO_QUEUE": { - "DEFAULT": { - "0": "0", - "1": "1", - "2": "2", - "3": "3", - "4": "4", - "5": "5", - "6": "6", - "7": "7" - } - }, - "TC_TO_QUEUE_MAP": { - "DEFAULT": { - "0": "0", - "1": "1", - "2": "2", - "3": "3", - "4": "4", - "5": "5", - "6": "6", - "7": "7" - } - }, - "DSCP_TO_TC_MAP": { - "DEFAULT": { - "0" : "0", - "1" : "0", - "2" : "0", - "3" : "0", - "4" : "0", - "5" : "0", - "6" : "0", - "7" : "0", - "8" : "0", - "9" : "0", - "10": "0", - "11": "0", - "12": "0", - "13": "0", - "14": "0", - "15": "0", - "16": "0", - "17": "0", - "18": "0", - "19": "0", - "20": "0", - "21": "0", - "22": "0", - "23": "0", - "24": "0", - "25": "0", - "26": "0", - "27": "0", - "28": "0", - "29": "0", - "30": "0", - "31": "0", - "32": "0", - "33": "0", - "34": "0", - "35": "0", - "36": "0", - "37": "0", - "38": "0", - "39": "0", - "40": "0", - "41": "0", - "42": "0", - "43": "0", - "44": "0", - "45": "0", - "46": "0", - "47": "0", - "48": "0", - "49": "0", - "50": "0", - "51": "0", - "52": "0", - "53": "0", - "54": "0", - "55": "0", - "56": "0", - "57": "0", - "58": "0", - "59": "0", - "60": "0", - "61": "0", - "62": "0", - "63": "0" - } - }, - "SCHEDULER": { - "scheduler.0": { - "type" : "DWRR", - "weight": "1" - }, - "scheduler.1": { - "type" : "DWRR", - "weight": "2" - }, - "scheduler.2": { - "type" : "DWRR", - "weight": "3" - }, - "scheduler.3": { - "type" : "DWRR", - "weight": "4" - }, - "scheduler.4": { - "type" : "DWRR", - "weight": "5" - }, - "scheduler.5": { - "type" : "DWRR", - "weight": "10" - }, - "scheduler.6": { - "type" : "DWRR", - "weight": "25" - }, - "scheduler.7": { - "type" : "STRICT" - } - }, - "PORT_QOS_MAP": { - "{{ port_names_active }}": { - "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|DEFAULT]", - "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|DEFAULT]", - "pfc_enable" : "3,4", - "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|DEFAULT]" - } - }, - "QUEUE": { -{% for port in PORT_ACTIVE %} - "{{ port }}|0": { - "scheduler" : "[SCHEDULER|scheduler.0]" - }, -{% endfor %} -{% for port in PORT_ACTIVE %} - "{{ port }}|1": { - "scheduler" : "[SCHEDULER|scheduler.1]" - }, -{% endfor %} -{% for port in PORT_ACTIVE %} - "{{ port }}|2": { - "scheduler": "[SCHEDULER|scheduler.2]" - }, -{% endfor %} -{% for port in PORT_ACTIVE %} - "{{ port }}|3": { - "scheduler": "[SCHEDULER|scheduler.3]" - }, -{% endfor %} -{% for port in PORT_ACTIVE %} - "{{ port }}|4": { - "scheduler": "[SCHEDULER|scheduler.4]" - }, -{% endfor %} -{% for port in PORT_ACTIVE %} - "{{ port }}|5": { - "scheduler": "[SCHEDULER|scheduler.5]" - }, -{% endfor %} -{% for port in PORT_ACTIVE %} - "{{ port }}|6": { - "scheduler": "[SCHEDULER|scheduler.6]" - }, -{% endfor %} -{% for port in PORT_ACTIVE %} - "{{ port }}|7": { - "scheduler": "[SCHEDULER|scheduler.7]" - }{% if not loop.last %},{% endif %} -{% endfor %} - } -} +{%- include 'qos_config.j2' %} diff --git a/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-M-O16C64/sai.profile b/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-M-O16C64/sai.profile index 26867a291b00..6c38b0ff1966 100644 --- a/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-M-O16C64/sai.profile +++ b/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-M-O16C64/sai.profile @@ -1,2 +1,2 @@ -SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/th3-z9332f-32x400G.config.bcm +SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/th3-z9332f-16x400G-64x100G.config.bcm SAI_NUM_ECMP_MEMBERS=64 diff --git a/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-M-O16C64/sai_postinit_cmd.soc b/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-M-O16C64/sai_postinit_cmd.soc index 9550e9c822c8..3222a4906bdf 100644 --- a/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-M-O16C64/sai_postinit_cmd.soc +++ b/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-M-O16C64/sai_postinit_cmd.soc @@ -3,10 +3,10 @@ link off counter off #*** -#*** Port CD0 Preemphasis setting *** +#*** Port CE0-CE3 Preemphasis setting *** #*** -local port cd0 +local port ce0 #*** lane 0 *** phy $port TXFIR_TAP_CTL0r.0 TXFIR_TAP0_COEFF=4 phy $port TXFIR_TAP_CTL1r.0 TXFIR_TAP1_COEFF=0x1E4 @@ -25,6 +25,7 @@ phy $port TXFIR_TAP_CTL4r.1 TXFIR_TAP4_COEFF=0 phy $port TXFIR_TAP_CTL5r.1 TXFIR_TAP5_COEFF=0 phy $port TXFIR_TAP_CTL0r.1 TXFIR_TAP_LOAD=0x1 +local port ce1 #*** lane 2 *** phy $port TXFIR_TAP_CTL0r.2 TXFIR_TAP0_COEFF=0 phy $port TXFIR_TAP_CTL1r.2 TXFIR_TAP1_COEFF=0x1E8 @@ -43,6 +44,7 @@ phy $port TXFIR_TAP_CTL4r.3 TXFIR_TAP4_COEFF=0 phy $port TXFIR_TAP_CTL5r.3 TXFIR_TAP5_COEFF=0 phy $port TXFIR_TAP_CTL0r.3 TXFIR_TAP_LOAD=0x1 +local port ce2 #*** lane 4 *** phy $port TXFIR_TAP_CTL0r.4 TXFIR_TAP0_COEFF=4 phy $port TXFIR_TAP_CTL1r.4 TXFIR_TAP1_COEFF=0x1E4 @@ -61,6 +63,7 @@ phy $port TXFIR_TAP_CTL4r.5 TXFIR_TAP4_COEFF=0 phy $port TXFIR_TAP_CTL5r.5 TXFIR_TAP5_COEFF=0 phy $port TXFIR_TAP_CTL0r.5 TXFIR_TAP_LOAD=0x1 +local port ce3 #*** lane 6 *** phy $port TXFIR_TAP_CTL0r.6 TXFIR_TAP0_COEFF=4 phy $port TXFIR_TAP_CTL1r.6 TXFIR_TAP1_COEFF=0x1E4 @@ -82,10 +85,10 @@ phy $port TXFIR_TAP_CTL0r.7 TXFIR_TAP_LOAD=0x1 delay 10 #*** -#*** Port CD1 Preemphasis setting *** +#*** Port CE4-CE7 Preemphasis setting *** #*** -local port cd1 +local port ce4 #*** lane 0 *** phy $port TXFIR_TAP_CTL0r.0 TXFIR_TAP0_COEFF=0 phy $port TXFIR_TAP_CTL1r.0 TXFIR_TAP1_COEFF=0x1E8 @@ -104,6 +107,7 @@ phy $port TXFIR_TAP_CTL4r.1 TXFIR_TAP4_COEFF=0 phy $port TXFIR_TAP_CTL5r.1 TXFIR_TAP5_COEFF=0 phy $port TXFIR_TAP_CTL0r.1 TXFIR_TAP_LOAD=0x1 +local port ce5 #*** lane 2 *** phy $port TXFIR_TAP_CTL0r.2 TXFIR_TAP0_COEFF=0 phy $port TXFIR_TAP_CTL1r.2 TXFIR_TAP1_COEFF=0x1E8 @@ -122,6 +126,7 @@ phy $port TXFIR_TAP_CTL4r.3 TXFIR_TAP4_COEFF=0 phy $port TXFIR_TAP_CTL5r.3 TXFIR_TAP5_COEFF=0 phy $port TXFIR_TAP_CTL0r.3 TXFIR_TAP_LOAD=0x1 +local port ce6 #*** lane 4 *** phy $port TXFIR_TAP_CTL0r.4 TXFIR_TAP0_COEFF=0 phy $port TXFIR_TAP_CTL1r.4 TXFIR_TAP1_COEFF=0x1E8 @@ -140,6 +145,7 @@ phy $port TXFIR_TAP_CTL4r.5 TXFIR_TAP4_COEFF=0 phy $port TXFIR_TAP_CTL5r.5 TXFIR_TAP5_COEFF=0 phy $port TXFIR_TAP_CTL0r.5 TXFIR_TAP_LOAD=0x1 +local port ce7 #*** lane 6 *** phy $port TXFIR_TAP_CTL0r.6 TXFIR_TAP0_COEFF=4 phy $port TXFIR_TAP_CTL1r.6 TXFIR_TAP1_COEFF=0x1E4 @@ -161,10 +167,10 @@ phy $port TXFIR_TAP_CTL0r.7 TXFIR_TAP_LOAD=0x1 delay 10 #*** -#*** Port CD2 Preemphasis setting *** +#*** Port CE8-CE11 Preemphasis setting *** #*** -local port cd2 +local port ce8 #*** lane 0 *** phy $port TXFIR_TAP_CTL0r.0 TXFIR_TAP0_COEFF=4 phy $port TXFIR_TAP_CTL1r.0 TXFIR_TAP1_COEFF=0x1E4 @@ -183,6 +189,7 @@ phy $port TXFIR_TAP_CTL4r.1 TXFIR_TAP4_COEFF=0 phy $port TXFIR_TAP_CTL5r.1 TXFIR_TAP5_COEFF=0 phy $port TXFIR_TAP_CTL0r.1 TXFIR_TAP_LOAD=0x1 +local port ce9 #*** lane 2 *** phy $port TXFIR_TAP_CTL0r.2 TXFIR_TAP0_COEFF=0 phy $port TXFIR_TAP_CTL1r.2 TXFIR_TAP1_COEFF=0x1E8 @@ -201,6 +208,7 @@ phy $port TXFIR_TAP_CTL4r.3 TXFIR_TAP4_COEFF=0 phy $port TXFIR_TAP_CTL5r.3 TXFIR_TAP5_COEFF=0 phy $port TXFIR_TAP_CTL0r.3 TXFIR_TAP_LOAD=0x1 +local port ce10 #*** lane 4 *** phy $port TXFIR_TAP_CTL0r.4 TXFIR_TAP0_COEFF=0 phy $port TXFIR_TAP_CTL1r.4 TXFIR_TAP1_COEFF=0x1E8 @@ -219,6 +227,7 @@ phy $port TXFIR_TAP_CTL4r.5 TXFIR_TAP4_COEFF=0 phy $port TXFIR_TAP_CTL5r.5 TXFIR_TAP5_COEFF=0 phy $port TXFIR_TAP_CTL0r.5 TXFIR_TAP_LOAD=0x1 +local port ce11 #*** lane 6 *** phy $port TXFIR_TAP_CTL0r.6 TXFIR_TAP0_COEFF=0 phy $port TXFIR_TAP_CTL1r.6 TXFIR_TAP1_COEFF=0x1E8 @@ -240,10 +249,10 @@ phy $port TXFIR_TAP_CTL0r.7 TXFIR_TAP_LOAD=0x1 delay 10 #*** -#*** Port CD3 Preemphasis setting *** +#*** Port CE12-CE15 Preemphasis setting *** #*** -local port cd3 +local port ce12 #*** lane 0 *** phy $port TXFIR_TAP_CTL0r.0 TXFIR_TAP0_COEFF=0 phy $port TXFIR_TAP_CTL1r.0 TXFIR_TAP1_COEFF=0x1E8 @@ -262,6 +271,7 @@ phy $port TXFIR_TAP_CTL4r.1 TXFIR_TAP4_COEFF=0 phy $port TXFIR_TAP_CTL5r.1 TXFIR_TAP5_COEFF=0 phy $port TXFIR_TAP_CTL0r.1 TXFIR_TAP_LOAD=0x1 +local port ce13 #*** lane 2 *** phy $port TXFIR_TAP_CTL0r.2 TXFIR_TAP0_COEFF=0 phy $port TXFIR_TAP_CTL1r.2 TXFIR_TAP1_COEFF=0x1E8 @@ -280,6 +290,7 @@ phy $port TXFIR_TAP_CTL4r.3 TXFIR_TAP4_COEFF=0 phy $port TXFIR_TAP_CTL5r.3 TXFIR_TAP5_COEFF=0 phy $port TXFIR_TAP_CTL0r.3 TXFIR_TAP_LOAD=0x1 +local port ce14 #*** lane 4 *** phy $port TXFIR_TAP_CTL0r.4 TXFIR_TAP0_COEFF=0 phy $port TXFIR_TAP_CTL1r.4 TXFIR_TAP1_COEFF=0x1E8 @@ -298,6 +309,7 @@ phy $port TXFIR_TAP_CTL4r.5 TXFIR_TAP4_COEFF=0 phy $port TXFIR_TAP_CTL5r.5 TXFIR_TAP5_COEFF=0 phy $port TXFIR_TAP_CTL0r.5 TXFIR_TAP_LOAD=0x1 +local port ce15 #*** lane 6 *** phy $port TXFIR_TAP_CTL0r.6 TXFIR_TAP0_COEFF=0 phy $port TXFIR_TAP_CTL1r.6 TXFIR_TAP1_COEFF=0x1E8 @@ -319,10 +331,10 @@ phy $port TXFIR_TAP_CTL0r.7 TXFIR_TAP_LOAD=0x1 delay 10 #*** -#*** Port CD4 Preemphasis setting *** +#*** Port CE16-CE19 Preemphasis setting *** #*** -local port cd4 +local port ce16 #*** lane 0 *** phy $port TXFIR_TAP_CTL0r.0 TXFIR_TAP0_COEFF=4 phy $port TXFIR_TAP_CTL1r.0 TXFIR_TAP1_COEFF=0x1E4 @@ -341,6 +353,8 @@ phy $port TXFIR_TAP_CTL4r.1 TXFIR_TAP4_COEFF=0 phy $port TXFIR_TAP_CTL5r.1 TXFIR_TAP5_COEFF=0 phy $port TXFIR_TAP_CTL0r.1 TXFIR_TAP_LOAD=0x1 + +local port ce17 #*** lane 2 *** phy $port TXFIR_TAP_CTL0r.2 TXFIR_TAP0_COEFF=4 phy $port TXFIR_TAP_CTL1r.2 TXFIR_TAP1_COEFF=0x1E4 @@ -359,6 +373,7 @@ phy $port TXFIR_TAP_CTL4r.3 TXFIR_TAP4_COEFF=0 phy $port TXFIR_TAP_CTL5r.3 TXFIR_TAP5_COEFF=0 phy $port TXFIR_TAP_CTL0r.3 TXFIR_TAP_LOAD=0x1 +local port ce18 #*** lane 4 *** phy $port TXFIR_TAP_CTL0r.4 TXFIR_TAP0_COEFF=0 phy $port TXFIR_TAP_CTL1r.4 TXFIR_TAP1_COEFF=0x1E8 @@ -377,6 +392,7 @@ phy $port TXFIR_TAP_CTL4r.5 TXFIR_TAP4_COEFF=0 phy $port TXFIR_TAP_CTL5r.5 TXFIR_TAP5_COEFF=0 phy $port TXFIR_TAP_CTL0r.5 TXFIR_TAP_LOAD=0x1 +local port ce19 #*** lane 6 *** phy $port TXFIR_TAP_CTL0r.6 TXFIR_TAP0_COEFF=0 phy $port TXFIR_TAP_CTL1r.6 TXFIR_TAP1_COEFF=0x1E8 @@ -397,11 +413,12 @@ phy $port TXFIR_TAP_CTL0r.7 TXFIR_TAP_LOAD=0x1 delay 10 + #*** -#*** Port CD5 Preemphasis setting *** +#*** Port CE20-CE23 Preemphasis setting *** #*** -local port cd5 +local port ce20 #*** lane 0 *** phy $port TXFIR_TAP_CTL0r.0 TXFIR_TAP0_COEFF=0 phy $port TXFIR_TAP_CTL1r.0 TXFIR_TAP1_COEFF=0x1E8 @@ -420,6 +437,8 @@ phy $port TXFIR_TAP_CTL4r.1 TXFIR_TAP4_COEFF=0 phy $port TXFIR_TAP_CTL5r.1 TXFIR_TAP5_COEFF=0 phy $port TXFIR_TAP_CTL0r.1 TXFIR_TAP_LOAD=0x1 + +local port ce21 #*** lane 2 *** phy $port TXFIR_TAP_CTL0r.2 TXFIR_TAP0_COEFF=4 phy $port TXFIR_TAP_CTL1r.2 TXFIR_TAP1_COEFF=0x1E4 @@ -438,6 +457,8 @@ phy $port TXFIR_TAP_CTL4r.3 TXFIR_TAP4_COEFF=0 phy $port TXFIR_TAP_CTL5r.3 TXFIR_TAP5_COEFF=0 phy $port TXFIR_TAP_CTL0r.3 TXFIR_TAP_LOAD=0x1 + +local port ce22 #*** lane 4 *** phy $port TXFIR_TAP_CTL0r.4 TXFIR_TAP0_COEFF=0 phy $port TXFIR_TAP_CTL1r.4 TXFIR_TAP1_COEFF=0x1E8 @@ -456,6 +477,8 @@ phy $port TXFIR_TAP_CTL4r.5 TXFIR_TAP4_COEFF=0 phy $port TXFIR_TAP_CTL5r.5 TXFIR_TAP5_COEFF=0 phy $port TXFIR_TAP_CTL0r.5 TXFIR_TAP_LOAD=0x1 + +local port ce23 #*** lane 6 *** phy $port TXFIR_TAP_CTL0r.6 TXFIR_TAP0_COEFF=0 phy $port TXFIR_TAP_CTL1r.6 TXFIR_TAP1_COEFF=0x1E8 @@ -476,11 +499,12 @@ phy $port TXFIR_TAP_CTL0r.7 TXFIR_TAP_LOAD=0x1 delay 10 + #*** -#*** Port CD6 Preemphasis setting *** +#*** Port CD24-27 Preemphasis setting *** #*** -local port cd6 +local port ce24 #*** lane 0 *** phy $port TXFIR_TAP_CTL0r.0 TXFIR_TAP0_COEFF=0 phy $port TXFIR_TAP_CTL1r.0 TXFIR_TAP1_COEFF=0x1E8 @@ -499,6 +523,8 @@ phy $port TXFIR_TAP_CTL4r.1 TXFIR_TAP4_COEFF=0 phy $port TXFIR_TAP_CTL5r.1 TXFIR_TAP5_COEFF=0 phy $port TXFIR_TAP_CTL0r.1 TXFIR_TAP_LOAD=0x1 + +local port ce25 #*** lane 2 *** phy $port TXFIR_TAP_CTL0r.2 TXFIR_TAP0_COEFF=0 phy $port TXFIR_TAP_CTL1r.2 TXFIR_TAP1_COEFF=0x1E8 @@ -517,6 +543,7 @@ phy $port TXFIR_TAP_CTL4r.3 TXFIR_TAP4_COEFF=0 phy $port TXFIR_TAP_CTL5r.3 TXFIR_TAP5_COEFF=0 phy $port TXFIR_TAP_CTL0r.3 TXFIR_TAP_LOAD=0x1 +local port ce26 #*** lane 4 *** phy $port TXFIR_TAP_CTL0r.4 TXFIR_TAP0_COEFF=4 phy $port TXFIR_TAP_CTL1r.4 TXFIR_TAP1_COEFF=0x1E4 @@ -535,6 +562,7 @@ phy $port TXFIR_TAP_CTL4r.5 TXFIR_TAP4_COEFF=0 phy $port TXFIR_TAP_CTL5r.5 TXFIR_TAP5_COEFF=0 phy $port TXFIR_TAP_CTL0r.5 TXFIR_TAP_LOAD=0x1 +local port ce27 #*** lane 6 *** phy $port TXFIR_TAP_CTL0r.6 TXFIR_TAP0_COEFF=4 phy $port TXFIR_TAP_CTL1r.6 TXFIR_TAP1_COEFF=0x1E4 @@ -555,11 +583,12 @@ phy $port TXFIR_TAP_CTL0r.7 TXFIR_TAP_LOAD=0x1 delay 10 + +local port ce28 #*** -#*** Port CD7 Preemphasis setting *** +#*** Port CE28-CE31 Preemphasis setting *** #*** -local port cd7 #*** lane 0 *** phy $port TXFIR_TAP_CTL0r.0 TXFIR_TAP0_COEFF=0 phy $port TXFIR_TAP_CTL1r.0 TXFIR_TAP1_COEFF=0x1E8 @@ -578,6 +607,7 @@ phy $port TXFIR_TAP_CTL4r.1 TXFIR_TAP4_COEFF=0 phy $port TXFIR_TAP_CTL5r.1 TXFIR_TAP5_COEFF=0 phy $port TXFIR_TAP_CTL0r.1 TXFIR_TAP_LOAD=0x1 +local port ce29 #*** lane 2 *** phy $port TXFIR_TAP_CTL0r.2 TXFIR_TAP0_COEFF=0 phy $port TXFIR_TAP_CTL1r.2 TXFIR_TAP1_COEFF=0x1E8 @@ -596,6 +626,7 @@ phy $port TXFIR_TAP_CTL4r.3 TXFIR_TAP4_COEFF=0 phy $port TXFIR_TAP_CTL5r.3 TXFIR_TAP5_COEFF=0 phy $port TXFIR_TAP_CTL0r.3 TXFIR_TAP_LOAD=0x1 +local port ce30 #*** lane 4 *** phy $port TXFIR_TAP_CTL0r.4 TXFIR_TAP0_COEFF=0 phy $port TXFIR_TAP_CTL1r.4 TXFIR_TAP1_COEFF=0x1E8 @@ -614,6 +645,7 @@ phy $port TXFIR_TAP_CTL4r.5 TXFIR_TAP4_COEFF=0 phy $port TXFIR_TAP_CTL5r.5 TXFIR_TAP5_COEFF=0 phy $port TXFIR_TAP_CTL0r.5 TXFIR_TAP_LOAD=0x1 +local port ce31 #*** lane 6 *** phy $port TXFIR_TAP_CTL0r.6 TXFIR_TAP0_COEFF=0 phy $port TXFIR_TAP_CTL1r.6 TXFIR_TAP1_COEFF=0x1E8 @@ -635,10 +667,10 @@ phy $port TXFIR_TAP_CTL0r.7 TXFIR_TAP_LOAD=0x1 delay 10 #*** -#*** Port CD8 Preemphasis setting *** +#*** Port CE32-CE35 Preemphasis setting *** #*** -local port cd8 +local port ce32 #*** lane 0 *** phy $port TXFIR_TAP_CTL0r.0 TXFIR_TAP0_COEFF=4 phy $port TXFIR_TAP_CTL1r.0 TXFIR_TAP1_COEFF=0x1E4 @@ -657,6 +689,7 @@ phy $port TXFIR_TAP_CTL4r.1 TXFIR_TAP4_COEFF=0 phy $port TXFIR_TAP_CTL5r.1 TXFIR_TAP5_COEFF=0 phy $port TXFIR_TAP_CTL0r.1 TXFIR_TAP_LOAD=0x1 +local port ce33 #*** lane 2 *** phy $port TXFIR_TAP_CTL0r.2 TXFIR_TAP0_COEFF=4 phy $port TXFIR_TAP_CTL1r.2 TXFIR_TAP1_COEFF=0x1E4 @@ -675,6 +708,7 @@ phy $port TXFIR_TAP_CTL4r.3 TXFIR_TAP4_COEFF=0 phy $port TXFIR_TAP_CTL5r.3 TXFIR_TAP5_COEFF=0 phy $port TXFIR_TAP_CTL0r.3 TXFIR_TAP_LOAD=0x1 +local port ce34 #*** lane 4 *** phy $port TXFIR_TAP_CTL0r.4 TXFIR_TAP0_COEFF=4 phy $port TXFIR_TAP_CTL1r.4 TXFIR_TAP1_COEFF=0x1E4 @@ -693,6 +727,7 @@ phy $port TXFIR_TAP_CTL4r.5 TXFIR_TAP4_COEFF=0 phy $port TXFIR_TAP_CTL5r.5 TXFIR_TAP5_COEFF=0 phy $port TXFIR_TAP_CTL0r.5 TXFIR_TAP_LOAD=0x1 +local port ce35 #*** lane 6 *** phy $port TXFIR_TAP_CTL0r.6 TXFIR_TAP0_COEFF=0 phy $port TXFIR_TAP_CTL1r.6 TXFIR_TAP1_COEFF=0x1E8 @@ -714,10 +749,10 @@ phy $port TXFIR_TAP_CTL0r.7 TXFIR_TAP_LOAD=0x1 delay 10 #*** -#*** Port CD9 Preemphasis setting *** +#*** Port CD36-39 Preemphasis setting *** #*** -local port cd9 +local port ce36 #*** lane 0 *** phy $port TXFIR_TAP_CTL0r.0 TXFIR_TAP0_COEFF=0 phy $port TXFIR_TAP_CTL1r.0 TXFIR_TAP1_COEFF=0x1E8 @@ -736,6 +771,7 @@ phy $port TXFIR_TAP_CTL4r.1 TXFIR_TAP4_COEFF=0 phy $port TXFIR_TAP_CTL5r.1 TXFIR_TAP5_COEFF=0 phy $port TXFIR_TAP_CTL0r.1 TXFIR_TAP_LOAD=0x1 +local port ce37 #*** lane 2 *** phy $port TXFIR_TAP_CTL0r.2 TXFIR_TAP0_COEFF=0 phy $port TXFIR_TAP_CTL1r.2 TXFIR_TAP1_COEFF=0x1E8 @@ -754,6 +790,7 @@ phy $port TXFIR_TAP_CTL4r.3 TXFIR_TAP4_COEFF=0 phy $port TXFIR_TAP_CTL5r.3 TXFIR_TAP5_COEFF=0 phy $port TXFIR_TAP_CTL0r.3 TXFIR_TAP_LOAD=0x1 +local port ce38 #*** lane 4 *** phy $port TXFIR_TAP_CTL0r.4 TXFIR_TAP0_COEFF=4 phy $port TXFIR_TAP_CTL1r.4 TXFIR_TAP1_COEFF=0x1E4 @@ -772,6 +809,7 @@ phy $port TXFIR_TAP_CTL4r.5 TXFIR_TAP4_COEFF=0 phy $port TXFIR_TAP_CTL5r.5 TXFIR_TAP5_COEFF=0 phy $port TXFIR_TAP_CTL0r.5 TXFIR_TAP_LOAD=0x1 +local port ce39 #*** lane 6 *** phy $port TXFIR_TAP_CTL0r.6 TXFIR_TAP0_COEFF=4 phy $port TXFIR_TAP_CTL1r.6 TXFIR_TAP1_COEFF=0x1E4 @@ -793,10 +831,10 @@ phy $port TXFIR_TAP_CTL0r.7 TXFIR_TAP_LOAD=0x1 delay 10 #*** -#*** Port CD10 Preemphasis setting *** +#*** Port CE40-CE43 Preemphasis setting *** #*** -local port cd10 +local port ce40 #*** lane 0 *** phy $port TXFIR_TAP_CTL0r.0 TXFIR_TAP0_COEFF=4 phy $port TXFIR_TAP_CTL1r.0 TXFIR_TAP1_COEFF=0x1E4 @@ -815,6 +853,7 @@ phy $port TXFIR_TAP_CTL4r.1 TXFIR_TAP4_COEFF=0 phy $port TXFIR_TAP_CTL5r.1 TXFIR_TAP5_COEFF=0 phy $port TXFIR_TAP_CTL0r.1 TXFIR_TAP_LOAD=0x1 +local port ce41 #*** lane 2 *** phy $port TXFIR_TAP_CTL0r.2 TXFIR_TAP0_COEFF=0 phy $port TXFIR_TAP_CTL1r.2 TXFIR_TAP1_COEFF=0x1E8 @@ -833,6 +872,7 @@ phy $port TXFIR_TAP_CTL4r.3 TXFIR_TAP4_COEFF=0 phy $port TXFIR_TAP_CTL5r.3 TXFIR_TAP5_COEFF=0 phy $port TXFIR_TAP_CTL0r.3 TXFIR_TAP_LOAD=0x1 +local port ce42 #*** lane 4 *** phy $port TXFIR_TAP_CTL0r.4 TXFIR_TAP0_COEFF=4 phy $port TXFIR_TAP_CTL1r.4 TXFIR_TAP1_COEFF=0x1E4 @@ -851,6 +891,7 @@ phy $port TXFIR_TAP_CTL4r.5 TXFIR_TAP4_COEFF=0 phy $port TXFIR_TAP_CTL5r.5 TXFIR_TAP5_COEFF=0 phy $port TXFIR_TAP_CTL0r.5 TXFIR_TAP_LOAD=0x1 +local port ce43 #*** lane 6 *** phy $port TXFIR_TAP_CTL0r.6 TXFIR_TAP0_COEFF=4 phy $port TXFIR_TAP_CTL1r.6 TXFIR_TAP1_COEFF=0x1E4 @@ -872,10 +913,10 @@ phy $port TXFIR_TAP_CTL0r.7 TXFIR_TAP_LOAD=0x1 delay 10 #*** -#*** Port CD11 Preemphasis setting *** +#*** Port CE44-CE47 Preemphasis setting *** #*** -local port cd11 +local port ce44 #*** lane 0 *** phy $port TXFIR_TAP_CTL0r.0 TXFIR_TAP0_COEFF=0 phy $port TXFIR_TAP_CTL1r.0 TXFIR_TAP1_COEFF=0x1E8 @@ -894,6 +935,7 @@ phy $port TXFIR_TAP_CTL4r.1 TXFIR_TAP4_COEFF=0 phy $port TXFIR_TAP_CTL5r.1 TXFIR_TAP5_COEFF=0 phy $port TXFIR_TAP_CTL0r.1 TXFIR_TAP_LOAD=0x1 +local port ce45 #*** lane 2 *** phy $port TXFIR_TAP_CTL0r.2 TXFIR_TAP0_COEFF=4 phy $port TXFIR_TAP_CTL1r.2 TXFIR_TAP1_COEFF=0x1E4 @@ -912,6 +954,7 @@ phy $port TXFIR_TAP_CTL4r.3 TXFIR_TAP4_COEFF=0 phy $port TXFIR_TAP_CTL5r.3 TXFIR_TAP5_COEFF=0 phy $port TXFIR_TAP_CTL0r.3 TXFIR_TAP_LOAD=0x1 +local port ce46 #*** lane 4 *** phy $port TXFIR_TAP_CTL0r.4 TXFIR_TAP0_COEFF=4 phy $port TXFIR_TAP_CTL1r.4 TXFIR_TAP1_COEFF=0x1E4 @@ -930,6 +973,7 @@ phy $port TXFIR_TAP_CTL4r.5 TXFIR_TAP4_COEFF=0 phy $port TXFIR_TAP_CTL5r.5 TXFIR_TAP5_COEFF=0 phy $port TXFIR_TAP_CTL0r.5 TXFIR_TAP_LOAD=0x1 +local port ce47 #*** lane 6 *** phy $port TXFIR_TAP_CTL0r.6 TXFIR_TAP0_COEFF=0 phy $port TXFIR_TAP_CTL1r.6 TXFIR_TAP1_COEFF=0x1E8 @@ -951,10 +995,10 @@ phy $port TXFIR_TAP_CTL0r.7 TXFIR_TAP_LOAD=0x1 delay 10 #*** -#*** Port CD12 Preemphasis setting *** +#*** Port CD0 Preemphasis setting *** #*** -local port cd12 +local port cd0 #*** lane 0 *** phy $port TXFIR_TAP_CTL0r.0 TXFIR_TAP0_COEFF=0 phy $port TXFIR_TAP_CTL1r.0 TXFIR_TAP1_COEFF=0x1E8 @@ -1030,10 +1074,10 @@ phy $port TXFIR_TAP_CTL0r.7 TXFIR_TAP_LOAD=0x1 delay 10 #*** -#*** Port CD13 Preemphasis setting *** +#*** Port CD1 Preemphasis setting *** #*** -local port cd13 +local port cd1 #*** lane 0 *** phy $port TXFIR_TAP_CTL0r.0 TXFIR_TAP0_COEFF=0 phy $port TXFIR_TAP_CTL1r.0 TXFIR_TAP1_COEFF=0x1E8 @@ -1108,10 +1152,10 @@ phy $port TXFIR_TAP_CTL0r.7 TXFIR_TAP_LOAD=0x1 delay 10 #*** -#*** Port CD14 Preemphasis setting *** +#*** Port CD2 Preemphasis setting *** #*** -local port cd14 +local port cd2 #*** lane 0 *** phy $port TXFIR_TAP_CTL0r.0 TXFIR_TAP0_COEFF=0 phy $port TXFIR_TAP_CTL1r.0 TXFIR_TAP1_COEFF=0x1E8 @@ -1187,10 +1231,10 @@ phy $port TXFIR_TAP_CTL0r.7 TXFIR_TAP_LOAD=0x1 delay 10 #*** -#*** Port CD15 Preemphasis setting *** +#*** Port CD3 Preemphasis setting *** #*** -local port cd15 +local port cd3 #*** lane 0 *** phy $port TXFIR_TAP_CTL0r.0 TXFIR_TAP0_COEFF=0 phy $port TXFIR_TAP_CTL1r.0 TXFIR_TAP1_COEFF=0x1E8 @@ -1266,10 +1310,10 @@ phy $port TXFIR_TAP_CTL0r.7 TXFIR_TAP_LOAD=0x1 delay 10 #*** -#*** Port CD16 Preemphasis setting *** +#*** Port CE48-CE51 Preemphasis setting *** #*** -local port cd16 +local port ce48 #*** lane 0 *** phy $port TXFIR_TAP_CTL0r.0 TXFIR_TAP0_COEFF=0 phy $port TXFIR_TAP_CTL1r.0 TXFIR_TAP1_COEFF=0x1E8 @@ -1288,6 +1332,7 @@ phy $port TXFIR_TAP_CTL4r.1 TXFIR_TAP4_COEFF=0 phy $port TXFIR_TAP_CTL5r.1 TXFIR_TAP5_COEFF=0 phy $port TXFIR_TAP_CTL0r.1 TXFIR_TAP_LOAD=0x1 +local port ce49 #*** lane 2 *** phy $port TXFIR_TAP_CTL0r.2 TXFIR_TAP0_COEFF=0 phy $port TXFIR_TAP_CTL1r.2 TXFIR_TAP1_COEFF=0x1E8 @@ -1306,6 +1351,7 @@ phy $port TXFIR_TAP_CTL4r.3 TXFIR_TAP4_COEFF=0 phy $port TXFIR_TAP_CTL5r.3 TXFIR_TAP5_COEFF=0 phy $port TXFIR_TAP_CTL0r.3 TXFIR_TAP_LOAD=0x1 +local port ce50 #*** lane 4 *** phy $port TXFIR_TAP_CTL0r.4 TXFIR_TAP0_COEFF=0 phy $port TXFIR_TAP_CTL1r.4 TXFIR_TAP1_COEFF=0x1E8 @@ -1324,6 +1370,7 @@ phy $port TXFIR_TAP_CTL4r.5 TXFIR_TAP4_COEFF=0 phy $port TXFIR_TAP_CTL5r.5 TXFIR_TAP5_COEFF=0 phy $port TXFIR_TAP_CTL0r.5 TXFIR_TAP_LOAD=0x1 +local port ce51 #*** lane 6 *** phy $port TXFIR_TAP_CTL0r.6 TXFIR_TAP0_COEFF=0 phy $port TXFIR_TAP_CTL1r.6 TXFIR_TAP1_COEFF=0x1E8 @@ -1345,10 +1392,10 @@ phy $port TXFIR_TAP_CTL0r.7 TXFIR_TAP_LOAD=0x1 delay 10 #*** -#*** Port CD17 Preemphasis setting *** +#*** Port CE52-CE55 Preemphasis setting *** #*** -local port cd17 +local port ce52 #*** lane 0 *** phy $port TXFIR_TAP_CTL0r.0 TXFIR_TAP0_COEFF=0 phy $port TXFIR_TAP_CTL1r.0 TXFIR_TAP1_COEFF=0x1E8 @@ -1367,6 +1414,7 @@ phy $port TXFIR_TAP_CTL4r.1 TXFIR_TAP4_COEFF=0 phy $port TXFIR_TAP_CTL5r.1 TXFIR_TAP5_COEFF=0 phy $port TXFIR_TAP_CTL0r.1 TXFIR_TAP_LOAD=0x1 +local port ce53 #*** lane 2 *** phy $port TXFIR_TAP_CTL0r.2 TXFIR_TAP0_COEFF=0 phy $port TXFIR_TAP_CTL1r.2 TXFIR_TAP1_COEFF=0x1E8 @@ -1385,6 +1433,7 @@ phy $port TXFIR_TAP_CTL4r.3 TXFIR_TAP4_COEFF=0 phy $port TXFIR_TAP_CTL5r.3 TXFIR_TAP5_COEFF=0 phy $port TXFIR_TAP_CTL0r.3 TXFIR_TAP_LOAD=0x1 +local port ce54 #*** lane 4 *** phy $port TXFIR_TAP_CTL0r.4 TXFIR_TAP0_COEFF=0 phy $port TXFIR_TAP_CTL1r.4 TXFIR_TAP1_COEFF=0x1E8 @@ -1403,6 +1452,7 @@ phy $port TXFIR_TAP_CTL4r.5 TXFIR_TAP4_COEFF=0 phy $port TXFIR_TAP_CTL5r.5 TXFIR_TAP5_COEFF=0 phy $port TXFIR_TAP_CTL0r.5 TXFIR_TAP_LOAD=0x1 +local port ce55 #*** lane 6 *** phy $port TXFIR_TAP_CTL0r.6 TXFIR_TAP0_COEFF=0 phy $port TXFIR_TAP_CTL1r.6 TXFIR_TAP1_COEFF=0x1E8 @@ -1424,10 +1474,10 @@ phy $port TXFIR_TAP_CTL0r.7 TXFIR_TAP_LOAD=0x1 delay 10 #*** -#*** Port CD18 Preemphasis setting *** +#*** Port CD56-59 Preemphasis setting *** #*** -local port cd18 +local port ce56 #*** lane 0 *** phy $port TXFIR_TAP_CTL0r.0 TXFIR_TAP0_COEFF=0 phy $port TXFIR_TAP_CTL1r.0 TXFIR_TAP1_COEFF=0x1E8 @@ -1446,6 +1496,7 @@ phy $port TXFIR_TAP_CTL4r.1 TXFIR_TAP4_COEFF=0 phy $port TXFIR_TAP_CTL5r.1 TXFIR_TAP5_COEFF=0 phy $port TXFIR_TAP_CTL0r.1 TXFIR_TAP_LOAD=0x1 +local port ce57 #*** lane 2 *** phy $port TXFIR_TAP_CTL0r.2 TXFIR_TAP0_COEFF=0 phy $port TXFIR_TAP_CTL1r.2 TXFIR_TAP1_COEFF=0x1E8 @@ -1464,6 +1515,7 @@ phy $port TXFIR_TAP_CTL4r.3 TXFIR_TAP4_COEFF=0 phy $port TXFIR_TAP_CTL5r.3 TXFIR_TAP5_COEFF=0 phy $port TXFIR_TAP_CTL0r.3 TXFIR_TAP_LOAD=0x1 +local port ce58 #*** lane 4 *** phy $port TXFIR_TAP_CTL0r.4 TXFIR_TAP0_COEFF=0 phy $port TXFIR_TAP_CTL1r.4 TXFIR_TAP1_COEFF=0x1E8 @@ -1482,6 +1534,7 @@ phy $port TXFIR_TAP_CTL4r.5 TXFIR_TAP4_COEFF=0 phy $port TXFIR_TAP_CTL5r.5 TXFIR_TAP5_COEFF=0 phy $port TXFIR_TAP_CTL0r.5 TXFIR_TAP_LOAD=0x1 +local port ce59 #*** lane 6 *** phy $port TXFIR_TAP_CTL0r.6 TXFIR_TAP0_COEFF=0 phy $port TXFIR_TAP_CTL1r.6 TXFIR_TAP1_COEFF=0x1E8 @@ -1503,10 +1556,10 @@ phy $port TXFIR_TAP_CTL0r.7 TXFIR_TAP_LOAD=0x1 delay 10 #*** -#*** Port CD19 Preemphasis setting *** +#*** Port CE60-CE63 Preemphasis setting *** #*** -local port cd19 +local port ce60 #*** lane 0 *** phy $port TXFIR_TAP_CTL0r.0 TXFIR_TAP0_COEFF=0 phy $port TXFIR_TAP_CTL1r.0 TXFIR_TAP1_COEFF=0x1E8 @@ -1525,6 +1578,7 @@ phy $port TXFIR_TAP_CTL4r.1 TXFIR_TAP4_COEFF=0 phy $port TXFIR_TAP_CTL5r.1 TXFIR_TAP5_COEFF=0 phy $port TXFIR_TAP_CTL0r.1 TXFIR_TAP_LOAD=0x1 +local port ce61 #*** lane 2 *** phy $port TXFIR_TAP_CTL0r.2 TXFIR_TAP0_COEFF=4 phy $port TXFIR_TAP_CTL1r.2 TXFIR_TAP1_COEFF=0x1E4 @@ -1543,6 +1597,7 @@ phy $port TXFIR_TAP_CTL4r.3 TXFIR_TAP4_COEFF=0 phy $port TXFIR_TAP_CTL5r.3 TXFIR_TAP5_COEFF=0 phy $port TXFIR_TAP_CTL0r.3 TXFIR_TAP_LOAD=0x1 +local port ce62 #*** lane 4 *** phy $port TXFIR_TAP_CTL0r.4 TXFIR_TAP0_COEFF=0 phy $port TXFIR_TAP_CTL1r.4 TXFIR_TAP1_COEFF=0x1E8 @@ -1561,6 +1616,7 @@ phy $port TXFIR_TAP_CTL4r.5 TXFIR_TAP4_COEFF=0 phy $port TXFIR_TAP_CTL5r.5 TXFIR_TAP5_COEFF=0 phy $port TXFIR_TAP_CTL0r.5 TXFIR_TAP_LOAD=0x1 +local port ce63 #*** lane 6 *** phy $port TXFIR_TAP_CTL0r.6 TXFIR_TAP0_COEFF=0 phy $port TXFIR_TAP_CTL1r.6 TXFIR_TAP1_COEFF=0x1E8 @@ -1582,10 +1638,10 @@ phy $port TXFIR_TAP_CTL0r.7 TXFIR_TAP_LOAD=0x1 delay 10 #*** -#*** Port CD20 Preemphasis setting *** +#*** Port CD4 Preemphasis setting *** #*** -local port cd20 +local port cd4 #*** lane 0 *** phy $port TXFIR_TAP_CTL0r.0 TXFIR_TAP0_COEFF=0 phy $port TXFIR_TAP_CTL1r.0 TXFIR_TAP1_COEFF=0x1E8 @@ -1661,10 +1717,10 @@ phy $port TXFIR_TAP_CTL0r.7 TXFIR_TAP_LOAD=0x1 delay 10 #*** -#*** Port CD21 Preemphasis setting *** +#*** Port CD5 Preemphasis setting *** #*** -local port cd21 +local port cd5 #*** lane 0 *** phy $port TXFIR_TAP_CTL0r.0 TXFIR_TAP0_COEFF=4 phy $port TXFIR_TAP_CTL1r.0 TXFIR_TAP1_COEFF=0x1E4 @@ -1740,10 +1796,10 @@ phy $port TXFIR_TAP_CTL0r.7 TXFIR_TAP_LOAD=0x1 delay 10 #*** -#*** Port CD22 Preemphasis setting *** +#*** Port CD6 Preemphasis setting *** #*** -local port cd22 +local port cd6 #*** lane 0 *** phy $port TXFIR_TAP_CTL0r.0 TXFIR_TAP0_COEFF=0 phy $port TXFIR_TAP_CTL1r.0 TXFIR_TAP1_COEFF=0x1E8 @@ -1819,10 +1875,10 @@ phy $port TXFIR_TAP_CTL0r.7 TXFIR_TAP_LOAD=0x1 delay 10 #*** -#*** Port CD23 Preemphasis setting *** +#*** Port CD7 Preemphasis setting *** #*** -local port cd23 +local port cd7 #*** lane 0 *** phy $port TXFIR_TAP_CTL0r.0 TXFIR_TAP0_COEFF=4 phy $port TXFIR_TAP_CTL1r.0 TXFIR_TAP1_COEFF=0x1E4 @@ -1898,10 +1954,10 @@ phy $port TXFIR_TAP_CTL0r.7 TXFIR_TAP_LOAD=0x1 delay 10 #*** -#*** Port CD24 Preemphasis setting *** +#*** Port CD8 Preemphasis setting *** #*** -local port cd24 +local port cd8 #*** lane 0 *** phy $port TXFIR_TAP_CTL0r.0 TXFIR_TAP0_COEFF=0 phy $port TXFIR_TAP_CTL1r.0 TXFIR_TAP1_COEFF=0x1E8 @@ -1977,10 +2033,10 @@ phy $port TXFIR_TAP_CTL0r.7 TXFIR_TAP_LOAD=0x1 delay 10 #*** -#*** Port CD25 Preemphasis setting *** +#*** Port CD9 Preemphasis setting *** #*** -local port cd25 +local port cd9 #*** lane 0 *** phy $port TXFIR_TAP_CTL0r.0 TXFIR_TAP0_COEFF=0 phy $port TXFIR_TAP_CTL1r.0 TXFIR_TAP1_COEFF=0x1E8 @@ -2055,10 +2111,10 @@ phy $port TXFIR_TAP_CTL0r.7 TXFIR_TAP_LOAD=0x1 delay 10 #*** -#*** Port CD26 Preemphasis setting *** +#*** Port CD10 Preemphasis setting *** #*** -local port cd26 +local port cd10 #*** lane 0 *** phy $port TXFIR_TAP_CTL0r.0 TXFIR_TAP0_COEFF=0 phy $port TXFIR_TAP_CTL1r.0 TXFIR_TAP1_COEFF=0x1E8 @@ -2134,10 +2190,10 @@ phy $port TXFIR_TAP_CTL0r.7 TXFIR_TAP_LOAD=0x1 delay 10 #*** -#*** Port CD27 Preemphasis setting *** +#*** Port CD11 Preemphasis setting *** #*** -local port cd27 +local port cd11 #*** lane 0 *** phy $port TXFIR_TAP_CTL0r.0 TXFIR_TAP0_COEFF=4 phy $port TXFIR_TAP_CTL1r.0 TXFIR_TAP1_COEFF=0x1E4 @@ -2213,10 +2269,10 @@ phy $port TXFIR_TAP_CTL0r.7 TXFIR_TAP_LOAD=0x1 delay 10 #*** -#*** Port CD28 Preemphasis setting *** +#*** Port CD12 Preemphasis setting *** #*** -local port cd28 +local port cd12 #*** lane 0 *** phy $port TXFIR_TAP_CTL0r.0 TXFIR_TAP0_COEFF=0 phy $port TXFIR_TAP_CTL1r.0 TXFIR_TAP1_COEFF=0x1E8 @@ -2292,10 +2348,10 @@ phy $port TXFIR_TAP_CTL0r.7 TXFIR_TAP_LOAD=0x1 delay 10 #*** -#*** Port CD29 Preemphasis setting *** +#*** Port CD13 Preemphasis setting *** #*** -local port cd29 +local port cd13 #*** lane 0 *** phy $port TXFIR_TAP_CTL0r.0 TXFIR_TAP0_COEFF=4 phy $port TXFIR_TAP_CTL1r.0 TXFIR_TAP1_COEFF=0x1E4 @@ -2371,10 +2427,10 @@ phy $port TXFIR_TAP_CTL0r.7 TXFIR_TAP_LOAD=0x1 delay 10 #*** -#*** Port CD30 Preemphasis setting *** +#*** Port CD14 Preemphasis setting *** #*** -local port cd30 +local port cd14 #*** lane 0 *** phy $port TXFIR_TAP_CTL0r.0 TXFIR_TAP0_COEFF=0 phy $port TXFIR_TAP_CTL1r.0 TXFIR_TAP1_COEFF=0x1E8 @@ -2450,10 +2506,10 @@ phy $port TXFIR_TAP_CTL0r.7 TXFIR_TAP_LOAD=0x1 delay 10 #*** -#*** Port CD31 Preemphasis setting *** +#*** Port CD15 Preemphasis setting *** #*** -local port cd31 +local port cd15 #*** lane 0 *** phy $port TXFIR_TAP_CTL0r.0 TXFIR_TAP0_COEFF=4 phy $port TXFIR_TAP_CTL1r.0 TXFIR_TAP1_COEFF=0x1E4 diff --git a/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-M-O16C64/sai_preinit_cmd.soc b/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-M-O16C64/sai_preinit_cmd.soc index e48c05b9f664..4d62900f898f 100644 --- a/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-M-O16C64/sai_preinit_cmd.soc +++ b/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-M-O16C64/sai_preinit_cmd.soc @@ -1,3 +1,2 @@ -#Not supported Until SAI 3.6 -#m0 load 0 0x0 /usr/share/sonic/hwsku/linkscan_led_fw.bin -#m0 load 0 0x3800 /usr/share/sonic/hwsku/custom_led.bin +m0 load 0 0x0 /usr/share/sonic/hwsku/linkscan_led_fw.bin +m0 load 0 0x3800 /usr/share/sonic/hwsku/custom_led.bin diff --git a/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-M-O16C64/th3-z9332f-16x400G-64x100G.config.bcm b/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-M-O16C64/th3-z9332f-16x400G-64x100G.config.bcm new file mode 100644 index 000000000000..5ce4bda28535 --- /dev/null +++ b/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-M-O16C64/th3-z9332f-16x400G-64x100G.config.bcm @@ -0,0 +1,592 @@ +# The following 2 SOC properties are needed to prevent FDB Events during Warmboot due to TH3 is SW Managed MACs +l2xmsg_shadow_hit_bits=0 +l2xmsg_no_cb_during_table_rebuild=1 + +sai_tunnel_global_sip_mask_enable=1 +core_clock_frequency=1325 +dpr_clock_frequency=1000 +device_clock_frequency=1325 +port_flex_enable=1 + +# disables bcmALPMDH (ALPM distributed hitbit) thread. This thread is purely for debug purpose +l3_alpm_hit_skip=1 + +# Disable Counting ACL Drop towards interface RX_DRP counter +sai_adjust_acl_drop_in_rx_drop=1 + +#firmware load method, use fast load +load_firmware=0x2 + +ccm_dma_enable=0 +ccmdma_intr_enable=0 +mem_cache_enable=1 +phy_enable=0 +phy_null=1 + +dport_map_enable=1 + +module_64ports.0=0 +tdma_intr_enable.0=1 +ipv6_lpm_128b_enable.0=1 +stat_if_parity_enable.0=1 +oversubscribe_mode=0 +bcm_tunnel_term_compatible_mode.0=1 +table_dma_enable.0=1 +schan_intr_enable.0=0 +parity_enable.0=1 +tdma_timeout_usec=1000000 +lls_num_l2uc.0=10 +miim_intr_enable.0=0 +table_dma_enable=1 +max_vp_lags.0=0 +tdma_intr_enable=1 +tdma_timeout_usec.0=5000000 +parity_correction.0=1 +bcm_num_cos=10 +default_cpu_tx_queue=7 +pktdma_poll_mode_channel_bitmap=1 +l3_max_ecmp_mode.0=1 +l3_alpm_enable=2 +l3_alpm_ipv6_128b_bkt_rsvd=1 +l2_mem_entries=40960 +l3_mem_entries=40960 + +l2xlrn_thread_interval=50000 +l2xlrn_intr_en=0 + +sai_optimized_mmu=1 +mmu_init_config="TH3-MSFT-T0" + +pbmp_xport_xe=0xffffffFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE +phy_an_c73=3 + +portmap_20.0=33:100:2 +portmap_21.0=35:100:2 +portmap_22.0=37:100:2 +portmap_23.0=39:100:2 + +portmap_24.0=41:100:2 +portmap_25.0=43:100:2 +portmap_26.0=45:100:2 +portmap_27.0=47:100:2 + +portmap_28.0=49:100:2 +portmap_29.0=51:100:2 +portmap_30.0=53:100:2 +portmap_31.0=55:100:2 + +portmap_33.0=57:100:2 +portmap_34.0=59:100:2 +portmap_35.0=61:100:2 +portmap_36.0=63:100:2 + +portmap_40.0=65:100:2 +portmap_41.0=67:100:2 +portmap_42.0=69:100:2 +portmap_43.0=71:100:2 + +portmap_44.0=73:100:2 +portmap_45.0=75:100:2 +portmap_46.0=77:100:2 +portmap_47.0=79:100:2 + +portmap_49.0=81:100:2 +portmap_50.0=83:100:2 +portmap_51.0=85:100:2 +portmap_52.0=87:100:2 + +portmap_53.0=89:100:2 +portmap_54.0=91:100:2 +portmap_55.0=93:100:2 +portmap_56.0=95:100:2 + +portmap_1.0=1:100:2 +portmap_2.0=3:100:2 +portmap_3.0=5:100:2 +portmap_4.0=7:100:2 + +portmap_5.0=9:100:2 +portmap_6.0=11:100:2 +portmap_7.0=13:100:2 +portmap_8.0=15:100:2 + +portmap_10.0=17:100:2 +portmap_11.0=19:100:2 +portmap_12.0=21:100:2 +portmap_13.0=23:100:2 + +portmap_14.0=25:100:2 +portmap_15.0=27:100:2 +portmap_16.0=29:100:2 +portmap_17.0=31:100:2 + +portmap_80.0=129:100:2 +portmap_81.0=131:100:2 +portmap_82.0=133:100:2 +portmap_83.0=135:100:2 + +portmap_84.0=137:100:2 +portmap_85.0=139:100:2 +portmap_86.0=141:100:2 +portmap_87.0=143:100:2 + +portmap_89.0=145:100:2 +portmap_90.0=147:100:2 +portmap_91.0=149:100:2 +portmap_92.0=151:100:2 + +portmap_93.0=153:100:2 +portmap_94.0=155:100:2 +portmap_95.0=157:100:2 +portmap_96.0=159:100:2 + + +portmap_60.0=97:400 +portmap_64.0=105:400 +portmap_69.0=113:400 +portmap_73.0=121:400 + +portmap_100.0=161:400 +portmap_104.0=169:400 +portmap_109.0=177:400 +portmap_113.0=185:400 + +portmap_120.0=193:400 +portmap_124.0=201:400 +portmap_129.0=209:400 +portmap_133.0=217:400 + +portmap_140.0=225:400 +portmap_144.0=233:400 +portmap_149.0=241:400 +portmap_153.0=249:400 + +portmap_38.0=257:10:1 +portmap_118.0=258:10:1 + +dport_map_port_20=1 +dport_map_port_21=2 +dport_map_port_22=3 +dport_map_port_23=4 +dport_map_port_24=5 +dport_map_port_25=6 +dport_map_port_26=7 +dport_map_port_27=8 +dport_map_port_28=9 +dport_map_port_29=10 +dport_map_port_30=11 +dport_map_port_31=12 +dport_map_port_32=13 +dport_map_port_33=14 +dport_map_port_34=15 +dport_map_port_35=16 +dport_map_port_36=17 +dport_map_port_37=18 +dport_map_port_40=19 +dport_map_port_41=20 +dport_map_port_42=21 +dport_map_port_43=22 +dport_map_port_44=23 +dport_map_port_45=24 +dport_map_port_46=25 +dport_map_port_47=26 +dport_map_port_48=27 +dport_map_port_49=28 +dport_map_port_50=29 +dport_map_port_51=30 +dport_map_port_52=31 +dport_map_port_53=32 +dport_map_port_54=33 +dport_map_port_55=34 +dport_map_port_56=35 +dport_map_port_57=36 +dport_map_port_1=37 +dport_map_port_2=38 +dport_map_port_3=39 +dport_map_port_4=40 +dport_map_port_5=41 +dport_map_port_6=42 +dport_map_port_7=43 +dport_map_port_8=44 +dport_map_port_9=45 +dport_map_port_10=46 +dport_map_port_11=47 +dport_map_port_12=48 +dport_map_port_13=49 +dport_map_port_14=50 +dport_map_port_15=51 +dport_map_port_16=52 +dport_map_port_17=53 +dport_map_port_18=54 +dport_map_port_60=55 +dport_map_port_61=56 +dport_map_port_62=57 +dport_map_port_63=58 +dport_map_port_64=59 +dport_map_port_65=60 +dport_map_port_66=61 +dport_map_port_67=62 +dport_map_port_68=63 +dport_map_port_69=64 +dport_map_port_70=65 +dport_map_port_71=66 +dport_map_port_72=67 +dport_map_port_73=68 +dport_map_port_74=69 +dport_map_port_75=70 +dport_map_port_76=71 +dport_map_port_77=72 +dport_map_port_80=73 +dport_map_port_81=74 +dport_map_port_82=75 +dport_map_port_83=76 +dport_map_port_84=77 +dport_map_port_85=78 +dport_map_port_86=79 +dport_map_port_87=80 +dport_map_port_88=81 +dport_map_port_89=82 +dport_map_port_90=83 +dport_map_port_91=84 +dport_map_port_92=85 +dport_map_port_93=86 +dport_map_port_94=87 +dport_map_port_95=88 +dport_map_port_96=89 +dport_map_port_97=90 +dport_map_port_140=91 +dport_map_port_141=92 +dport_map_port_142=93 +dport_map_port_143=94 +dport_map_port_144=95 +dport_map_port_145=96 +dport_map_port_146=97 +dport_map_port_147=98 +dport_map_port_148=99 +dport_map_port_149=100 +dport_map_port_150=101 +dport_map_port_151=102 +dport_map_port_152=103 +dport_map_port_153=104 +dport_map_port_154=105 +dport_map_port_155=106 +dport_map_port_156=107 +dport_map_port_157=108 +dport_map_port_100=109 +dport_map_port_101=110 +dport_map_port_102=111 +dport_map_port_103=112 +dport_map_port_104=113 +dport_map_port_105=114 +dport_map_port_106=115 +dport_map_port_107=116 +dport_map_port_108=117 +dport_map_port_109=118 +dport_map_port_110=119 +dport_map_port_111=120 +dport_map_port_112=121 +dport_map_port_113=122 +dport_map_port_114=123 +dport_map_port_115=124 +dport_map_port_116=125 +dport_map_port_117=126 +dport_map_port_120=127 +dport_map_port_121=128 +dport_map_port_122=129 +dport_map_port_123=130 +dport_map_port_124=131 +dport_map_port_125=132 +dport_map_port_126=133 +dport_map_port_127=134 +dport_map_port_128=135 +dport_map_port_129=136 +dport_map_port_130=137 +dport_map_port_131=138 +dport_map_port_132=139 +dport_map_port_133=140 +dport_map_port_134=141 +dport_map_port_135=142 +dport_map_port_136=143 +dport_map_port_137=144 +dport_map_port_38=145 +dport_map_port_118=146 + +phy_chain_rx_lane_map_physical{33.0}=0x65732041 +phy_chain_tx_lane_map_physical{33.0}=0x47206531 +phy_chain_rx_lane_map_physical{41.0}=0x07561243 +phy_chain_tx_lane_map_physical{41.0}=0x36207514 +phy_chain_rx_lane_map_physical{49.0}=0x54632071 +phy_chain_tx_lane_map_physical{49.0}=0x06241735 +phy_chain_rx_lane_map_physical{57.0}=0x07561243 +phy_chain_tx_lane_map_physical{57.0}=0x35207614 +phy_chain_rx_lane_map_physical{65.0}=0x45623170 +phy_chain_tx_lane_map_physical{65.0}=0x51260734 +phy_chain_rx_lane_map_physical{73.0}=0x07561243 +phy_chain_tx_lane_map_physical{73.0}=0x37245610 +phy_chain_rx_lane_map_physical{81.0}=0x45632071 +phy_chain_tx_lane_map_physical{81.0}=0x51260734 +phy_chain_rx_lane_map_physical{89.0}=0x07561243 +phy_chain_tx_lane_map_physical{89.0}=0x26437510 +phy_chain_rx_lane_map_physical{1.0}=0x30176524 +phy_chain_tx_lane_map_physical{1.0}=0x20615374 +phy_chain_rx_lane_map_physical{9.0}=0x37562041 +phy_chain_tx_lane_map_physical{9.0}=0x05176432 +phy_chain_rx_lane_map_physical{17.0}=0x43607251 +phy_chain_tx_lane_map_physical{17.0}=0x70261435 +phy_chain_rx_lane_map_physical{25.0}=0x60347125 +phy_chain_tx_lane_map_physical{25.0}=0x46357120 +phy_chain_rx_lane_map_physical{97.0}=0x47601352 +phy_chain_tx_lane_map_physical{97.0}=0x04265137 +phy_chain_rx_lane_map_physical{105.0}=0x73206415 +phy_chain_tx_lane_map_physical{105.0}=0x26374150 +phy_chain_rx_lane_map_physical{113.0}=0x47632051 +phy_chain_tx_lane_map_physical{113.0}=0x03254617 +phy_chain_rx_lane_map_physical{121.0}=0x63027415 +phy_chain_tx_lane_map_physical{121.0}=0x63721045 +phy_chain_rx_lane_map_physical{129.0}=0x30154627 +phy_chain_tx_lane_map_physical{129.0}=0x04735261 +phy_chain_rx_lane_map_physical{137.0}=0x24753061 +phy_chain_tx_lane_map_physical{137.0}=0x37614520 +phy_chain_rx_lane_map_physical{145.0}=0x47601352 +phy_chain_tx_lane_map_physical{145.0}=0x63274510 +phy_chain_rx_lane_map_physical{153.0}=0x07361524 +phy_chain_tx_lane_map_physical{153.0}=0x36527104 +phy_chain_rx_lane_map_physical{225.0}=0x56410273 +phy_chain_tx_lane_map_physical{225.0}=0x10274635 +phy_chain_rx_lane_map_physical{233.0}=0x15740263 +phy_chain_tx_lane_map_physical{233.0}=0x24351607 +phy_chain_rx_lane_map_physical{241.0}=0x74015263 +phy_chain_tx_lane_map_physical{241.0}=0x04152637 +phy_chain_rx_lane_map_physical{249.0}=0x62037514 +phy_chain_tx_lane_map_physical{249.0}=0x72453160 +phy_chain_rx_lane_map_physical{161.0}=0x46510273 +phy_chain_tx_lane_map_physical{161.0}=0x01653724 +phy_chain_rx_lane_map_physical{169.0}=0x25743160 +phy_chain_tx_lane_map_physical{169.0}=0x07216435 +phy_chain_rx_lane_map_physical{177.0}=0x46510273 +phy_chain_tx_lane_map_physical{177.0}=0x01652734 +phy_chain_rx_lane_map_physical{185.0}=0x25743160 +phy_chain_tx_lane_map_physical{185.0}=0x37016425 +phy_chain_rx_lane_map_physical{193.0}=0x46510372 +phy_chain_tx_lane_map_physical{193.0}=0x06153724 +phy_chain_rx_lane_map_physical{201.0}=0x25743160 +phy_chain_tx_lane_map_physical{201.0}=0x36017524 +phy_chain_rx_lane_map_physical{209.0}=0x47601352 +phy_chain_tx_lane_map_physical{209.0}=0x04152736 +phy_chain_rx_lane_map_physical{217.0}=0x26453170 +phy_chain_tx_lane_map_physical{217.0}=0x36027415 + +serdes_core_rx_polarity_flip_physical{33}=0x29 +serdes_core_tx_polarity_flip_physical{33}=0xfe +serdes_core_rx_polarity_flip_physical{41}=0xb1 +serdes_core_tx_polarity_flip_physical{41}=0xe8 +serdes_core_rx_polarity_flip_physical{49}=0xca +serdes_core_tx_polarity_flip_physical{49}=0xb6 +serdes_core_rx_polarity_flip_physical{57}=0x9b +serdes_core_tx_polarity_flip_physical{57}=0xdc +serdes_core_rx_polarity_flip_physical{65}=0x17 +serdes_core_tx_polarity_flip_physical{65}=0x86 +serdes_core_rx_polarity_flip_physical{73}=0x9b +serdes_core_tx_polarity_flip_physical{73}=0x55 +serdes_core_rx_polarity_flip_physical{81}=0xa +serdes_core_tx_polarity_flip_physical{81}=0x6 +serdes_core_rx_polarity_flip_physical{89}=0x9b +serdes_core_tx_polarity_flip_physical{89}=0x48 +serdes_core_rx_polarity_flip_physical{1}=0xec +serdes_core_tx_polarity_flip_physical{1}=0x56 +serdes_core_rx_polarity_flip_physical{9}=0x13 +serdes_core_tx_polarity_flip_physical{9}=0xa6 +serdes_core_rx_polarity_flip_physical{17}=0x5a +serdes_core_tx_polarity_flip_physical{17}=0xc6 +serdes_core_rx_polarity_flip_physical{25}=0xf +serdes_core_tx_polarity_flip_physical{25}=0x4e +serdes_core_rx_polarity_flip_physical{97}=0x17 +serdes_core_tx_polarity_flip_physical{97}=0x2e +serdes_core_rx_polarity_flip_physical{105}=0xce +serdes_core_tx_polarity_flip_physical{105}=0x7c +serdes_core_rx_polarity_flip_physical{113}=0xa +serdes_core_tx_polarity_flip_physical{113}=0x35 + +serdes_core_rx_polarity_flip_physical{121}=0xb9 +serdes_core_tx_polarity_flip_physical{121}=0xef +serdes_core_rx_polarity_flip_physical{129}=0xe8 +serdes_core_tx_polarity_flip_physical{129}=0xac +serdes_core_rx_polarity_flip_physical{137}=0xcb +serdes_core_tx_polarity_flip_physical{137}=0x9c +serdes_core_rx_polarity_flip_physical{145}=0x17 +serdes_core_tx_polarity_flip_physical{145}=0x32 +serdes_core_rx_polarity_flip_physical{153}=0xb9 +serdes_core_tx_polarity_flip_physical{153}=0xaf +serdes_core_rx_polarity_flip_physical{225}=0xaa +serdes_core_tx_polarity_flip_physical{225}=0x7 +serdes_core_rx_polarity_flip_physical{233}=0x31 +serdes_core_tx_polarity_flip_physical{233}=0x47 +serdes_core_rx_polarity_flip_physical{241}=0xe8 +serdes_core_tx_polarity_flip_physical{241}=0x9e +serdes_core_rx_polarity_flip_physical{249}=0xec +serdes_core_tx_polarity_flip_physical{249}=0x1f +serdes_core_rx_polarity_flip_physical{161}=0x6a +serdes_core_tx_polarity_flip_physical{161}=0xd4 +serdes_core_rx_polarity_flip_physical{169}=0x9e +serdes_core_tx_polarity_flip_physical{169}=0x7b +serdes_core_rx_polarity_flip_physical{177}=0x6a +serdes_core_tx_polarity_flip_physical{177}=0xcc +serdes_core_rx_polarity_flip_physical{185}=0x9e +serdes_core_tx_polarity_flip_physical{185}=0x58 +serdes_core_rx_polarity_flip_physical{193}=0x6f +serdes_core_tx_polarity_flip_physical{193}=0x24 +serdes_core_rx_polarity_flip_physical{201}=0x9e +serdes_core_tx_polarity_flip_physical{201}=0xdf +serdes_core_rx_polarity_flip_physical{209}=0x17 +serdes_core_tx_polarity_flip_physical{209}=0xe9 +serdes_core_rx_polarity_flip_physical{217}=0xec +serdes_core_tx_polarity_flip_physical{217}=0x68 + +serdes_lane_config_media_type_49=copper +serdes_lane_config_media_type_50=copper +serdes_lane_config_media_type_51=copper +serdes_lane_config_media_type_52=copper +serdes_lane_config_media_type_54=copper +serdes_lane_config_media_type_55=copper +serdes_lane_config_media_type_56=copper +serdes_lane_config_media_type_57=copper +serdes_lane_config_media_type_53=copper +serdes_lane_config_media_type_60=copper +serdes_lane_config_media_type_61=copper +serdes_lane_config_media_type_62=copper +serdes_lane_config_media_type_63=copper +serdes_lane_config_media_type_65=copper +serdes_lane_config_media_type_66=copper +serdes_lane_config_media_type_67=copper +serdes_lane_config_media_type_68=copper +serdes_lane_config_media_type_64=copper +serdes_lane_config_media_type_80=copper +serdes_lane_config_media_type_81=copper +serdes_lane_config_media_type_82=copper +serdes_lane_config_media_type_83=copper +serdes_lane_config_media_type_85=copper +serdes_lane_config_media_type_86=copper +serdes_lane_config_media_type_87=copper +serdes_lane_config_media_type_88=copper +serdes_lane_config_media_type_84=copper +serdes_lane_config_media_type_100=copper +serdes_lane_config_media_type_101=copper +serdes_lane_config_media_type_102=copper +serdes_lane_config_media_type_103=copper +serdes_lane_config_media_type_105=copper +serdes_lane_config_media_type_106=copper +serdes_lane_config_media_type_107=copper +serdes_lane_config_media_type_108=copper +serdes_lane_config_media_type_104=copper +serdes_lane_config_media_type_120=copper +serdes_lane_config_media_type_121=copper +serdes_lane_config_media_type_122=copper +serdes_lane_config_media_type_123=copper +serdes_lane_config_media_type_125=copper +serdes_lane_config_media_type_126=copper +serdes_lane_config_media_type_127=copper +serdes_lane_config_media_type_128=copper +serdes_lane_config_media_type_124=copper +serdes_lane_config_media_type_140=copper +serdes_lane_config_media_type_141=copper +serdes_lane_config_media_type_142=copper +serdes_lane_config_media_type_143=copper +serdes_lane_config_media_type_145=copper +serdes_lane_config_media_type_146=copper +serdes_lane_config_media_type_147=copper +serdes_lane_config_media_type_148=copper +serdes_lane_config_media_type_144=copper +serdes_lane_config_media_type_40=copper +serdes_lane_config_media_type_41=copper +serdes_lane_config_media_type_42=copper +serdes_lane_config_media_type_43=copper +serdes_lane_config_media_type_45=copper +serdes_lane_config_media_type_46=copper +serdes_lane_config_media_type_47=copper +serdes_lane_config_media_type_48=copper +serdes_lane_config_media_type_44=copper +serdes_lane_config_media_type_69=copper +serdes_lane_config_media_type_70=copper +serdes_lane_config_media_type_71=copper +serdes_lane_config_media_type_72=copper +serdes_lane_config_media_type_74=copper +serdes_lane_config_media_type_75=copper +serdes_lane_config_media_type_76=copper +serdes_lane_config_media_type_77=copper +serdes_lane_config_media_type_73=copper +serdes_lane_config_media_type_1=copper +serdes_lane_config_media_type_2=copper +serdes_lane_config_media_type_3=copper +serdes_lane_config_media_type_4=copper +serdes_lane_config_media_type_6=copper +serdes_lane_config_media_type_7=copper +serdes_lane_config_media_type_8=copper +serdes_lane_config_media_type_9=copper +serdes_lane_config_media_type_5=copper +serdes_lane_config_media_type_29=copper +serdes_lane_config_media_type_30=copper +serdes_lane_config_media_type_31=copper +serdes_lane_config_media_type_32=copper +serdes_lane_config_media_type_34=copper +serdes_lane_config_media_type_35=copper +serdes_lane_config_media_type_36=copper +serdes_lane_config_media_type_37=copper +serdes_lane_config_media_type_33=copper +serdes_lane_config_media_type_89=copper +serdes_lane_config_media_type_90=copper +serdes_lane_config_media_type_91=copper +serdes_lane_config_media_type_92=copper +serdes_lane_config_media_type_94=copper +serdes_lane_config_media_type_95=copper +serdes_lane_config_media_type_96=copper +serdes_lane_config_media_type_97=copper +serdes_lane_config_media_type_93=copper +serdes_lane_config_media_type_109=copper +serdes_lane_config_media_type_110=copper +serdes_lane_config_media_type_111=copper +serdes_lane_config_media_type_112=copper +serdes_lane_config_media_type_114=copper +serdes_lane_config_media_type_115=copper +serdes_lane_config_media_type_116=copper +serdes_lane_config_media_type_117=copper +serdes_lane_config_media_type_113=copper +serdes_lane_config_media_type_129=copper +serdes_lane_config_media_type_130=copper +serdes_lane_config_media_type_131=copper +serdes_lane_config_media_type_132=copper +serdes_lane_config_media_type_134=copper +serdes_lane_config_media_type_135=copper +serdes_lane_config_media_type_136=copper +serdes_lane_config_media_type_137=copper +serdes_lane_config_media_type_133=copper +serdes_lane_config_media_type_149=copper +serdes_lane_config_media_type_150=copper +serdes_lane_config_media_type_151=copper +serdes_lane_config_media_type_152=copper +serdes_lane_config_media_type_154=copper +serdes_lane_config_media_type_155=copper +serdes_lane_config_media_type_156=copper +serdes_lane_config_media_type_157=copper +serdes_lane_config_media_type_153=copper +serdes_lane_config_media_type_10=copper +serdes_lane_config_media_type_11=copper +serdes_lane_config_media_type_12=copper +serdes_lane_config_media_type_13=copper +serdes_lane_config_media_type_15=copper +serdes_lane_config_media_type_16=copper +serdes_lane_config_media_type_17=copper +serdes_lane_config_media_type_18=copper +serdes_lane_config_media_type_14=copper +serdes_lane_config_media_type_20=copper +serdes_lane_config_media_type_21=copper +serdes_lane_config_media_type_22=copper +serdes_lane_config_media_type_23=copper +serdes_lane_config_media_type_25=copper +serdes_lane_config_media_type_26=copper +serdes_lane_config_media_type_27=copper +serdes_lane_config_media_type_28=copper +serdes_lane_config_media_type_24=copper + +sai_preinit_cmd_file=/usr/share/sonic/hwsku/sai_preinit_cmd.soc +sai_postinit_cmd_file=/usr/share/sonic/hwsku/sai_postinit_cmd.soc +led_fw_path=/usr/share/sonic/hwsku/ diff --git a/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-M-O16C64/th3-z9332f-32x400G.config.bcm b/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-M-O16C64/th3-z9332f-32x400G.config.bcm deleted file mode 100644 index 38296d61c1b7..000000000000 --- a/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-M-O16C64/th3-z9332f-32x400G.config.bcm +++ /dev/null @@ -1,519 +0,0 @@ -core_clock_frequency=1325 -dpr_clock_frequency=1000 -device_clock_frequency=1325 -port_flex_enable=1 - -#firmware load method, use fast load -load_firmware=0x2 - -ccm_dma_enable=0 -ccmdma_intr_enable=0 -mem_cache_enable=0 -phy_enable=0 -phy_null=1 - -dport_map_enable=1 - -module_64ports.0=0 -tdma_intr_enable.0=1 -ipv6_lpm_128b_enable.0=1 -stat_if_parity_enable.0=1 -oversubscribe_mode=0 -bcm_tunnel_term_compatible_mode.0=1 -table_dma_enable.0=1 -schan_intr_enable.0=0 -parity_enable.0=1 -tdma_timeout_usec=1000000 -lls_num_l2uc.0=10 -miim_intr_enable.0=0 -table_dma_enable=1 -max_vp_lags.0=0 -tdma_intr_enable=1 -tdma_timeout_usec.0=5000000 -parity_correction.0=1 -mmu_lossless.0=0 -bcm_num_cos=10 -default_cpu_tx_queue=7 -pktdma_poll_mode_channel_bitmap=1 -l3_max_ecmp_mode.0=1 -l3_alpm_enable=2 -l3_alpm_ipv6_128b_bkt_rsvd=1 -l2_mem_entries=40960 -l3_mem_entries=40960 - -l2xlrn_thread_interval=50000 -l2xlrn_intr_en=0 - -pbmp_xport_xe=0xffffffFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE - -phy_an_c73=3 - -portmap_1.0=1:400 -portmap_5.0=9:400 -portmap_10.0=17:400 -portmap_14.0=25:400 - -portmap_20.0=33:400 -portmap_24.0=41:400 -portmap_29.0=49:400 -portmap_33.0=57:400 - -portmap_40.0=65:400 -portmap_44.0=73:400 -portmap_49.0=81:400 -portmap_53.0=89:400 - -portmap_60.0=97:400 -portmap_64.0=105:400 -portmap_69.0=113:400 -portmap_73.0=121:400 - -portmap_80.0=129:400 -portmap_84.0=137:400 -portmap_89.0=145:400 -portmap_93.0=153:400 - -portmap_100.0=161:400 -portmap_104.0=169:400 -portmap_109.0=177:400 -portmap_113.0=185:400 - -portmap_120.0=193:400 -portmap_124.0=201:400 -portmap_129.0=209:400 -portmap_133.0=217:400 - -portmap_140.0=225:400 -portmap_144.0=233:400 -portmap_149.0=241:400 -portmap_153.0=249:400 - -portmap_38.0=257:10:1 -portmap_118.0=258:10:1 - -dport_map_port_20=1 -dport_map_port_21=2 -dport_map_port_22=3 -dport_map_port_23=4 -dport_map_port_24=5 -dport_map_port_25=6 -dport_map_port_26=7 -dport_map_port_27=8 -dport_map_port_28=9 -dport_map_port_29=10 -dport_map_port_30=11 -dport_map_port_31=12 -dport_map_port_32=13 -dport_map_port_33=14 -dport_map_port_34=15 -dport_map_port_35=16 -dport_map_port_36=17 -dport_map_port_37=18 -dport_map_port_40=19 -dport_map_port_41=20 -dport_map_port_42=21 -dport_map_port_43=22 -dport_map_port_44=23 -dport_map_port_45=24 -dport_map_port_46=25 -dport_map_port_47=26 -dport_map_port_48=27 -dport_map_port_49=28 -dport_map_port_50=29 -dport_map_port_51=30 -dport_map_port_52=31 -dport_map_port_53=32 -dport_map_port_54=33 -dport_map_port_55=34 -dport_map_port_56=35 -dport_map_port_57=36 -dport_map_port_1=37 -dport_map_port_2=38 -dport_map_port_3=39 -dport_map_port_4=40 -dport_map_port_5=41 -dport_map_port_6=42 -dport_map_port_7=43 -dport_map_port_8=44 -dport_map_port_9=45 -dport_map_port_10=46 -dport_map_port_11=47 -dport_map_port_12=48 -dport_map_port_13=49 -dport_map_port_14=50 -dport_map_port_15=51 -dport_map_port_16=52 -dport_map_port_17=53 -dport_map_port_18=54 -dport_map_port_60=55 -dport_map_port_61=56 -dport_map_port_62=57 -dport_map_port_63=58 -dport_map_port_64=59 -dport_map_port_65=60 -dport_map_port_66=61 -dport_map_port_67=62 -dport_map_port_68=63 -dport_map_port_69=64 -dport_map_port_70=65 -dport_map_port_71=66 -dport_map_port_72=67 -dport_map_port_73=68 -dport_map_port_74=69 -dport_map_port_75=70 -dport_map_port_76=71 -dport_map_port_77=72 -dport_map_port_80=73 -dport_map_port_81=74 -dport_map_port_82=75 -dport_map_port_83=76 -dport_map_port_84=77 -dport_map_port_85=78 -dport_map_port_86=79 -dport_map_port_87=80 -dport_map_port_88=81 -dport_map_port_89=82 -dport_map_port_90=83 -dport_map_port_91=84 -dport_map_port_92=85 -dport_map_port_93=86 -dport_map_port_94=87 -dport_map_port_95=88 -dport_map_port_96=89 -dport_map_port_97=90 -dport_map_port_140=91 -dport_map_port_141=92 -dport_map_port_142=93 -dport_map_port_143=94 -dport_map_port_144=95 -dport_map_port_145=96 -dport_map_port_146=97 -dport_map_port_147=98 -dport_map_port_148=99 -dport_map_port_149=100 -dport_map_port_150=101 -dport_map_port_151=102 -dport_map_port_152=103 -dport_map_port_153=104 -dport_map_port_154=105 -dport_map_port_155=106 -dport_map_port_156=107 -dport_map_port_157=108 -dport_map_port_100=109 -dport_map_port_101=110 -dport_map_port_102=111 -dport_map_port_103=112 -dport_map_port_104=113 -dport_map_port_105=114 -dport_map_port_106=115 -dport_map_port_107=116 -dport_map_port_108=117 -dport_map_port_109=118 -dport_map_port_110=119 -dport_map_port_111=120 -dport_map_port_112=121 -dport_map_port_113=122 -dport_map_port_114=123 -dport_map_port_115=124 -dport_map_port_116=125 -dport_map_port_117=126 -dport_map_port_120=127 -dport_map_port_121=128 -dport_map_port_122=129 -dport_map_port_123=130 -dport_map_port_124=131 -dport_map_port_125=132 -dport_map_port_126=133 -dport_map_port_127=134 -dport_map_port_128=135 -dport_map_port_129=136 -dport_map_port_130=137 -dport_map_port_131=138 -dport_map_port_132=139 -dport_map_port_133=140 -dport_map_port_134=141 -dport_map_port_135=142 -dport_map_port_136=143 -dport_map_port_137=144 -dport_map_port_38=145 -dport_map_port_118=146 - -phy_chain_rx_lane_map_physical{33.0}=0x65732041 -phy_chain_tx_lane_map_physical{33.0}=0x47206531 -phy_chain_rx_lane_map_physical{41.0}=0x07561243 -phy_chain_tx_lane_map_physical{41.0}=0x36207514 -phy_chain_rx_lane_map_physical{49.0}=0x54632071 -phy_chain_tx_lane_map_physical{49.0}=0x06241735 -phy_chain_rx_lane_map_physical{57.0}=0x07561243 -phy_chain_tx_lane_map_physical{57.0}=0x35207614 -phy_chain_rx_lane_map_physical{65.0}=0x45623170 -phy_chain_tx_lane_map_physical{65.0}=0x51260734 -phy_chain_rx_lane_map_physical{73.0}=0x07561243 -phy_chain_tx_lane_map_physical{73.0}=0x37245610 -phy_chain_rx_lane_map_physical{81.0}=0x45632071 -phy_chain_tx_lane_map_physical{81.0}=0x51260734 -phy_chain_rx_lane_map_physical{89.0}=0x07561243 -phy_chain_tx_lane_map_physical{89.0}=0x26437510 -phy_chain_rx_lane_map_physical{1.0}=0x30176524 -phy_chain_tx_lane_map_physical{1.0}=0x20615374 -phy_chain_rx_lane_map_physical{9.0}=0x37562041 -phy_chain_tx_lane_map_physical{9.0}=0x05176432 -phy_chain_rx_lane_map_physical{17.0}=0x43607251 -phy_chain_tx_lane_map_physical{17.0}=0x70261435 -phy_chain_rx_lane_map_physical{25.0}=0x60347125 -phy_chain_tx_lane_map_physical{25.0}=0x46357120 -phy_chain_rx_lane_map_physical{97.0}=0x47601352 -phy_chain_tx_lane_map_physical{97.0}=0x04265137 -phy_chain_rx_lane_map_physical{105.0}=0x73206415 -phy_chain_tx_lane_map_physical{105.0}=0x26374150 -phy_chain_rx_lane_map_physical{113.0}=0x47632051 -phy_chain_tx_lane_map_physical{113.0}=0x03254617 -phy_chain_rx_lane_map_physical{121.0}=0x63027415 -phy_chain_tx_lane_map_physical{121.0}=0x63721045 -phy_chain_rx_lane_map_physical{129.0}=0x30154627 -phy_chain_tx_lane_map_physical{129.0}=0x04735261 -phy_chain_rx_lane_map_physical{137.0}=0x24753061 -phy_chain_tx_lane_map_physical{137.0}=0x37614520 -phy_chain_rx_lane_map_physical{145.0}=0x47601352 -phy_chain_tx_lane_map_physical{145.0}=0x63274510 -phy_chain_rx_lane_map_physical{153.0}=0x07361524 -phy_chain_tx_lane_map_physical{153.0}=0x36527104 -phy_chain_rx_lane_map_physical{225.0}=0x56410273 -phy_chain_tx_lane_map_physical{225.0}=0x10274635 -phy_chain_rx_lane_map_physical{233.0}=0x15740263 -phy_chain_tx_lane_map_physical{233.0}=0x24351607 -phy_chain_rx_lane_map_physical{241.0}=0x74015263 -phy_chain_tx_lane_map_physical{241.0}=0x04152637 -phy_chain_rx_lane_map_physical{249.0}=0x62037514 -phy_chain_tx_lane_map_physical{249.0}=0x72453160 -phy_chain_rx_lane_map_physical{161.0}=0x46510273 -phy_chain_tx_lane_map_physical{161.0}=0x01653724 -phy_chain_rx_lane_map_physical{169.0}=0x25743160 -phy_chain_tx_lane_map_physical{169.0}=0x07216435 -phy_chain_rx_lane_map_physical{177.0}=0x46510273 -phy_chain_tx_lane_map_physical{177.0}=0x01652734 -phy_chain_rx_lane_map_physical{185.0}=0x25743160 -phy_chain_tx_lane_map_physical{185.0}=0x37016425 -phy_chain_rx_lane_map_physical{193.0}=0x46510372 -phy_chain_tx_lane_map_physical{193.0}=0x06153724 -phy_chain_rx_lane_map_physical{201.0}=0x25743160 -phy_chain_tx_lane_map_physical{201.0}=0x36017524 -phy_chain_rx_lane_map_physical{209.0}=0x47601352 -phy_chain_tx_lane_map_physical{209.0}=0x04152736 -phy_chain_rx_lane_map_physical{217.0}=0x26453170 -phy_chain_tx_lane_map_physical{217.0}=0x36027415 - -serdes_core_rx_polarity_flip_physical{33}=0x29 -serdes_core_tx_polarity_flip_physical{33}=0xfe -serdes_core_rx_polarity_flip_physical{41}=0xb1 -serdes_core_tx_polarity_flip_physical{41}=0xe8 -serdes_core_rx_polarity_flip_physical{49}=0xca -serdes_core_tx_polarity_flip_physical{49}=0xb6 -serdes_core_rx_polarity_flip_physical{57}=0x9b -serdes_core_tx_polarity_flip_physical{57}=0xdc -serdes_core_rx_polarity_flip_physical{65}=0x17 -serdes_core_tx_polarity_flip_physical{65}=0x86 -serdes_core_rx_polarity_flip_physical{73}=0x9b -serdes_core_tx_polarity_flip_physical{73}=0x55 -serdes_core_rx_polarity_flip_physical{81}=0xa -serdes_core_tx_polarity_flip_physical{81}=0x6 -serdes_core_rx_polarity_flip_physical{89}=0x9b -serdes_core_tx_polarity_flip_physical{89}=0x48 -serdes_core_rx_polarity_flip_physical{1}=0xec -serdes_core_tx_polarity_flip_physical{1}=0x56 -serdes_core_rx_polarity_flip_physical{9}=0x13 -serdes_core_tx_polarity_flip_physical{9}=0xa6 -serdes_core_rx_polarity_flip_physical{17}=0x5a -serdes_core_tx_polarity_flip_physical{17}=0xc6 -serdes_core_rx_polarity_flip_physical{25}=0xf -serdes_core_tx_polarity_flip_physical{25}=0x4e -serdes_core_rx_polarity_flip_physical{97}=0x17 -serdes_core_tx_polarity_flip_physical{97}=0x2e -serdes_core_rx_polarity_flip_physical{105}=0xce -serdes_core_tx_polarity_flip_physical{105}=0x7c -serdes_core_rx_polarity_flip_physical{113}=0xa -serdes_core_tx_polarity_flip_physical{113}=0x35 - -serdes_core_rx_polarity_flip_physical{121}=0xb9 -serdes_core_tx_polarity_flip_physical{121}=0xef -serdes_core_rx_polarity_flip_physical{129}=0xe8 -serdes_core_tx_polarity_flip_physical{129}=0xac -serdes_core_rx_polarity_flip_physical{137}=0xcb -serdes_core_tx_polarity_flip_physical{137}=0x9c -serdes_core_rx_polarity_flip_physical{145}=0x17 -serdes_core_tx_polarity_flip_physical{145}=0x32 -serdes_core_rx_polarity_flip_physical{153}=0xb9 -serdes_core_tx_polarity_flip_physical{153}=0xaf -serdes_core_rx_polarity_flip_physical{225}=0xaa -serdes_core_tx_polarity_flip_physical{225}=0x7 -serdes_core_rx_polarity_flip_physical{233}=0x31 -serdes_core_tx_polarity_flip_physical{233}=0x47 -serdes_core_rx_polarity_flip_physical{241}=0xe8 -serdes_core_tx_polarity_flip_physical{241}=0x9e -serdes_core_rx_polarity_flip_physical{249}=0xec -serdes_core_tx_polarity_flip_physical{249}=0x1f -serdes_core_rx_polarity_flip_physical{161}=0x6a -serdes_core_tx_polarity_flip_physical{161}=0xd4 -serdes_core_rx_polarity_flip_physical{169}=0x9e -serdes_core_tx_polarity_flip_physical{169}=0x7b -serdes_core_rx_polarity_flip_physical{177}=0x6a -serdes_core_tx_polarity_flip_physical{177}=0xcc -serdes_core_rx_polarity_flip_physical{185}=0x9e -serdes_core_tx_polarity_flip_physical{185}=0x58 -serdes_core_rx_polarity_flip_physical{193}=0x6f -serdes_core_tx_polarity_flip_physical{193}=0x24 -serdes_core_rx_polarity_flip_physical{201}=0x9e -serdes_core_tx_polarity_flip_physical{201}=0xdf -serdes_core_rx_polarity_flip_physical{209}=0x17 -serdes_core_tx_polarity_flip_physical{209}=0xe9 -serdes_core_rx_polarity_flip_physical{217}=0xec -serdes_core_tx_polarity_flip_physical{217}=0x68 - -serdes_lane_config_media_type_49=copper -serdes_lane_config_media_type_50=copper -serdes_lane_config_media_type_51=copper -serdes_lane_config_media_type_52=copper -serdes_lane_config_media_type_54=copper -serdes_lane_config_media_type_55=copper -serdes_lane_config_media_type_56=copper -serdes_lane_config_media_type_57=copper -serdes_lane_config_media_type_53=copper -serdes_lane_config_media_type_60=copper -serdes_lane_config_media_type_61=copper -serdes_lane_config_media_type_62=copper -serdes_lane_config_media_type_63=copper -serdes_lane_config_media_type_65=copper -serdes_lane_config_media_type_66=copper -serdes_lane_config_media_type_67=copper -serdes_lane_config_media_type_68=copper -serdes_lane_config_media_type_64=copper -serdes_lane_config_media_type_80=copper -serdes_lane_config_media_type_81=copper -serdes_lane_config_media_type_82=copper -serdes_lane_config_media_type_83=copper -serdes_lane_config_media_type_85=copper -serdes_lane_config_media_type_86=copper -serdes_lane_config_media_type_87=copper -serdes_lane_config_media_type_88=copper -serdes_lane_config_media_type_84=copper -serdes_lane_config_media_type_100=copper -serdes_lane_config_media_type_101=copper -serdes_lane_config_media_type_102=copper -serdes_lane_config_media_type_103=copper -serdes_lane_config_media_type_105=copper -serdes_lane_config_media_type_106=copper -serdes_lane_config_media_type_107=copper -serdes_lane_config_media_type_108=copper -serdes_lane_config_media_type_104=copper -serdes_lane_config_media_type_120=copper -serdes_lane_config_media_type_121=copper -serdes_lane_config_media_type_122=copper -serdes_lane_config_media_type_123=copper -serdes_lane_config_media_type_125=copper -serdes_lane_config_media_type_126=copper -serdes_lane_config_media_type_127=copper -serdes_lane_config_media_type_128=copper -serdes_lane_config_media_type_124=copper -serdes_lane_config_media_type_140=copper -serdes_lane_config_media_type_141=copper -serdes_lane_config_media_type_142=copper -serdes_lane_config_media_type_143=copper -serdes_lane_config_media_type_145=copper -serdes_lane_config_media_type_146=copper -serdes_lane_config_media_type_147=copper -serdes_lane_config_media_type_148=copper -serdes_lane_config_media_type_144=copper -serdes_lane_config_media_type_40=copper -serdes_lane_config_media_type_41=copper -serdes_lane_config_media_type_42=copper -serdes_lane_config_media_type_43=copper -serdes_lane_config_media_type_45=copper -serdes_lane_config_media_type_46=copper -serdes_lane_config_media_type_47=copper -serdes_lane_config_media_type_48=copper -serdes_lane_config_media_type_44=copper -serdes_lane_config_media_type_69=copper -serdes_lane_config_media_type_70=copper -serdes_lane_config_media_type_71=copper -serdes_lane_config_media_type_72=copper -serdes_lane_config_media_type_74=copper -serdes_lane_config_media_type_75=copper -serdes_lane_config_media_type_76=copper -serdes_lane_config_media_type_77=copper -serdes_lane_config_media_type_73=copper -serdes_lane_config_media_type_1=copper -serdes_lane_config_media_type_2=copper -serdes_lane_config_media_type_3=copper -serdes_lane_config_media_type_4=copper -serdes_lane_config_media_type_6=copper -serdes_lane_config_media_type_7=copper -serdes_lane_config_media_type_8=copper -serdes_lane_config_media_type_9=copper -serdes_lane_config_media_type_5=copper -serdes_lane_config_media_type_29=copper -serdes_lane_config_media_type_30=copper -serdes_lane_config_media_type_31=copper -serdes_lane_config_media_type_32=copper -serdes_lane_config_media_type_34=copper -serdes_lane_config_media_type_35=copper -serdes_lane_config_media_type_36=copper -serdes_lane_config_media_type_37=copper -serdes_lane_config_media_type_33=copper -serdes_lane_config_media_type_89=copper -serdes_lane_config_media_type_90=copper -serdes_lane_config_media_type_91=copper -serdes_lane_config_media_type_92=copper -serdes_lane_config_media_type_94=copper -serdes_lane_config_media_type_95=copper -serdes_lane_config_media_type_96=copper -serdes_lane_config_media_type_97=copper -serdes_lane_config_media_type_93=copper -serdes_lane_config_media_type_109=copper -serdes_lane_config_media_type_110=copper -serdes_lane_config_media_type_111=copper -serdes_lane_config_media_type_112=copper -serdes_lane_config_media_type_114=copper -serdes_lane_config_media_type_115=copper -serdes_lane_config_media_type_116=copper -serdes_lane_config_media_type_117=copper -serdes_lane_config_media_type_113=copper -serdes_lane_config_media_type_129=copper -serdes_lane_config_media_type_130=copper -serdes_lane_config_media_type_131=copper -serdes_lane_config_media_type_132=copper -serdes_lane_config_media_type_134=copper -serdes_lane_config_media_type_135=copper -serdes_lane_config_media_type_136=copper -serdes_lane_config_media_type_137=copper -serdes_lane_config_media_type_133=copper -serdes_lane_config_media_type_149=copper -serdes_lane_config_media_type_150=copper -serdes_lane_config_media_type_151=copper -serdes_lane_config_media_type_152=copper -serdes_lane_config_media_type_154=copper -serdes_lane_config_media_type_155=copper -serdes_lane_config_media_type_156=copper -serdes_lane_config_media_type_157=copper -serdes_lane_config_media_type_153=copper -serdes_lane_config_media_type_10=copper -serdes_lane_config_media_type_11=copper -serdes_lane_config_media_type_12=copper -serdes_lane_config_media_type_13=copper -serdes_lane_config_media_type_15=copper -serdes_lane_config_media_type_16=copper -serdes_lane_config_media_type_17=copper -serdes_lane_config_media_type_18=copper -serdes_lane_config_media_type_14=copper -serdes_lane_config_media_type_20=copper -serdes_lane_config_media_type_21=copper -serdes_lane_config_media_type_22=copper -serdes_lane_config_media_type_23=copper -serdes_lane_config_media_type_25=copper -serdes_lane_config_media_type_26=copper -serdes_lane_config_media_type_27=copper -serdes_lane_config_media_type_28=copper -serdes_lane_config_media_type_24=copper - -#sai_preinit_cmd_file=/usr/share/sonic/hwsku/sai_preinit_cmd.soc -sai_postinit_cmd_file=/usr/share/sonic/hwsku/sai_postinit_cmd.soc - diff --git a/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-O32/buffers.json.j2 b/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-O32/buffers.json.j2 index 0b1cb2c541b6..dadf74d555c5 100644 --- a/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-O32/buffers.json.j2 +++ b/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-O32/buffers.json.j2 @@ -1,2 +1,2 @@ -{%- set default_topo = 't1' %} -{%- include 'buffers_config.j2' %} +{%- set default_topo = 't1' %} +{%- include 'buffers_config.j2' %} diff --git a/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-O32/buffers_defaults_t0.j2 b/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-O32/buffers_defaults_t0.j2 index 77747f6403c8..7254e841d8b4 100644 --- a/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-O32/buffers_defaults_t0.j2 +++ b/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-O32/buffers_defaults_t0.j2 @@ -1,20 +1,41 @@ - -{%- set default_cable = '40m' %} - -{%- macro generate_buffer_pool_and_profiles() %} - "BUFFER_POOL": { - }, - "BUFFER_PROFILE": { - }, -{%- endmacro %} - -{%- macro generate_pg_profils(port_names_active) %} - "BUFFER_PG": { - }, -{%- endmacro %} - -{% macro generate_queue_buffers(port_names_active) %} - "BUFFER_QUEUE": { - } -{% endmacro %} - +{%- set default_cable = '300m' %} + +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {%- for port_idx in range(0,32) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 8)) %}{%- endif %} + {%- endfor %} +{%- endmacro %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "66394076", + "type": "ingress", + "mode": "dynamic", + "xoff": "27200352" + }, + "egress_lossless_pool": { + "size": "38462204", + "type": "egress", + "mode": "static" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "static_th":"66394076" + }, + "egress_lossless_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"0", + "static_th":"67117468" + }, + "egress_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"1778", + "dynamic_th":"1" + } + }, +{%- endmacro %} diff --git a/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-O32/buffers_defaults_t1.j2 b/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-O32/buffers_defaults_t1.j2 index 77747f6403c8..7254e841d8b4 100644 --- a/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-O32/buffers_defaults_t1.j2 +++ b/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-O32/buffers_defaults_t1.j2 @@ -1,20 +1,41 @@ - -{%- set default_cable = '40m' %} - -{%- macro generate_buffer_pool_and_profiles() %} - "BUFFER_POOL": { - }, - "BUFFER_PROFILE": { - }, -{%- endmacro %} - -{%- macro generate_pg_profils(port_names_active) %} - "BUFFER_PG": { - }, -{%- endmacro %} - -{% macro generate_queue_buffers(port_names_active) %} - "BUFFER_QUEUE": { - } -{% endmacro %} - +{%- set default_cable = '300m' %} + +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {%- for port_idx in range(0,32) %} + {%- if PORT_ALL.append("Ethernet%d" % (port_idx * 8)) %}{%- endif %} + {%- endfor %} +{%- endmacro %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "66394076", + "type": "ingress", + "mode": "dynamic", + "xoff": "27200352" + }, + "egress_lossless_pool": { + "size": "38462204", + "type": "egress", + "mode": "static" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "static_th":"66394076" + }, + "egress_lossless_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"0", + "static_th":"67117468" + }, + "egress_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"1778", + "dynamic_th":"1" + } + }, +{%- endmacro %} diff --git a/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-O32/pg_profile_lookup.ini b/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-O32/pg_profile_lookup.ini index a5f3286beef8..06d19555c746 100644 --- a/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-O32/pg_profile_lookup.ini +++ b/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-O32/pg_profile_lookup.ini @@ -1,23 +1,12 @@ -# PG lossless profiles. -# speed cable size xon xoff threshold xon_offset - 10000 5m 1270 0 190500 -2 2540 - 25000 5m 1270 0 190500 -2 2540 - 40000 5m 1270 0 190500 -2 2540 - 50000 5m 1270 0 190500 -2 2540 - 100000 5m 1270 0 190500 -2 2540 - 200000 5m 1270 0 190500 -2 2540 - 400000 5m 1270 0 190500 -2 2540 - 10000 40m 1270 0 190500 -2 2540 - 25000 40m 1270 0 190500 -2 2540 - 40000 40m 1270 0 190500 -2 2540 - 50000 40m 1270 0 190500 -2 2540 - 100000 40m 1270 0 190500 -2 2540 - 200000 40m 1270 0 190500 -2 2540 - 400000 40m 1270 0 190500 -2 2540 - 10000 300m 1270 0 190500 -2 2540 - 25000 300m 1270 0 190500 -2 2540 - 40000 300m 1270 0 190500 -2 2540 - 50000 300m 1270 0 190500 -2 2540 - 100000 300m 1270 0 190500 -2 2540 - 200000 300m 1270 0 190500 -2 2540 - 400000 300m 1270 0 190500 -2 2540 +# PG lossless profiles. +# speed cable size xon xoff threshold xon_offset + 100000 5m 2540 2540 68580 -2 2540 + 100000 40m 2540 2540 74422 -2 2540 + 100000 300m 2540 2540 117348 -2 2540 + 100000 1000m 2540 2540 233172 -2 2540 + 100000 2000m 2540 2540 398526 -2 2540 + 400000 5m 2540 2540 178562 -2 2540 + 400000 40m 2540 2540 201930 -2 2540 + 400000 300m 2540 2540 373888 -2 2540 + 400000 1000m 2540 2540 836676 -2 2540 + 400000 2000m 2540 2540 1498092 -2 2540 diff --git a/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-O32/port_config.ini b/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-O32/port_config.ini index 790fb490cfe6..ea214699e06a 100644 --- a/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-O32/port_config.ini +++ b/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-O32/port_config.ini @@ -1,35 +1,35 @@ -# name lanes alias index speed -Ethernet0 33,34,35,36,37,38,39,40 fourhundredGigE1/1 1 400000 -Ethernet8 41,42,43,44,45,46,47,48 fourhundredGigE1/2 2 400000 -Ethernet16 49,50,51,52,53,54,55,56 fourhundredGigE1/3 3 400000 -Ethernet24 57,58,59,60,61,62,63,64 fourhundredGigE1/4 4 400000 -Ethernet32 65,66,67,68,69,70,71,72 fourhundredGigE1/5 5 400000 -Ethernet40 73,74,75,76,77,78,79,80 fourhundredGigE1/6 6 400000 -Ethernet48 81,82,83,84,85,86,87,88 fourhundredGigE1/7 7 400000 -Ethernet56 89,90,91,92,93,94,95,96 fourhundredGigE1/8 8 400000 -Ethernet64 1,2,3,4,5,6,7,8 fourhundredGigE1/9 9 400000 -Ethernet72 9,10,11,12,13,14,15,16 fourhundredGigE1/10 10 400000 -Ethernet80 17,18,19,20,21,22,23,24 fourhundredGigE1/11 11 400000 -Ethernet88 25,26,27,28,29,30,31,32 fourhundredGigE1/12 12 400000 -Ethernet96 97,98,99,100,101,102,103,104 fourhundredGigE1/13 13 400000 -Ethernet104 105,106,107,108,109,110,111,112 fourhundredGigE1/14 14 400000 -Ethernet112 113,114,115,116,117,118,119,120 fourhundredGigE1/15 15 400000 -Ethernet120 121,122,123,124,125,126,127,128 fourhundredGigE1/16 16 400000 -Ethernet128 129,130,131,132,133,134,135,136 fourhundredGigE1/17 17 400000 -Ethernet136 137,138,139,140,141,142,143,144 fourhundredGigE1/18 18 400000 -Ethernet144 145,146,147,148,149,150,151,152 fourhundredGigE1/19 19 400000 -Ethernet152 153,154,155,156,157,158,159,160 fourhundredGigE1/20 20 400000 -Ethernet160 225,226,227,228,229,230,231,232 fourhundredGigE1/21 21 400000 -Ethernet168 233,234,235,236,237,238,239,240 fourhundredGigE1/22 22 400000 -Ethernet176 241,242,243,244,245,246,247,248 fourhundredGigE1/23 23 400000 -Ethernet184 249,250,251,252,253,254,255,256 fourhundredGigE1/24 24 400000 -Ethernet192 161,162,163,164,165,166,167,168 fourhundredGigE1/25 25 400000 -Ethernet200 169,170,171,172,173,174,175,176 fourhundredGigE1/26 26 400000 -Ethernet208 177,178,179,180,181,182,183,184 fourhundredGigE1/27 27 400000 -Ethernet216 185,186,187,188,189,190,191,192 fourhundredGigE1/28 28 400000 -Ethernet224 193,194,195,196,197,198,199,200 fourhundredGigE1/29 29 400000 -Ethernet232 201,202,203,204,205,206,207,208 fourhundredGigE1/30 30 400000 -Ethernet240 209,210,211,212,213,214,215,216 fourhundredGigE1/31 31 400000 -Ethernet248 217,218,219,220,221,222,223,224 fourhundredGigE1/32 32 400000 -Ethernet256 257 tenGigE1/33 33 10000 -Ethernet257 258 tenGigE1/34 34 10000 +# name lanes alias index speed +Ethernet0 33,34,35,36,37,38,39,40 etp1 1 400000 +Ethernet8 41,42,43,44,45,46,47,48 etp2 2 400000 +Ethernet16 49,50,51,52,53,54,55,56 etp3 3 400000 +Ethernet24 57,58,59,60,61,62,63,64 etp4 4 400000 +Ethernet32 65,66,67,68,69,70,71,72 etp5 5 400000 +Ethernet40 73,74,75,76,77,78,79,80 etp6 6 400000 +Ethernet48 81,82,83,84,85,86,87,88 etp7 7 400000 +Ethernet56 89,90,91,92,93,94,95,96 etp8 8 400000 +Ethernet64 1,2,3,4,5,6,7,8 etp9 9 400000 +Ethernet72 9,10,11,12,13,14,15,16 etp10 10 400000 +Ethernet80 17,18,19,20,21,22,23,24 etp11 11 400000 +Ethernet88 25,26,27,28,29,30,31,32 etp12 12 400000 +Ethernet96 97,98,99,100,101,102,103,104 etp13 13 400000 +Ethernet104 105,106,107,108,109,110,111,112 etp14 14 400000 +Ethernet112 113,114,115,116,117,118,119,120 etp15 15 400000 +Ethernet120 121,122,123,124,125,126,127,128 etp16 16 400000 +Ethernet128 129,130,131,132,133,134,135,136 etp17 17 400000 +Ethernet136 137,138,139,140,141,142,143,144 etp18 18 400000 +Ethernet144 145,146,147,148,149,150,151,152 etp19 19 400000 +Ethernet152 153,154,155,156,157,158,159,160 etp20 20 400000 +Ethernet160 225,226,227,228,229,230,231,232 etp21 21 400000 +Ethernet168 233,234,235,236,237,238,239,240 etp22 22 400000 +Ethernet176 241,242,243,244,245,246,247,248 etp23 23 400000 +Ethernet184 249,250,251,252,253,254,255,256 etp24 24 400000 +Ethernet192 161,162,163,164,165,166,167,168 etp25 25 400000 +Ethernet200 169,170,171,172,173,174,175,176 etp26 26 400000 +Ethernet208 177,178,179,180,181,182,183,184 etp27 27 400000 +Ethernet216 185,186,187,188,189,190,191,192 etp28 28 400000 +Ethernet224 193,194,195,196,197,198,199,200 etp29 29 400000 +Ethernet232 201,202,203,204,205,206,207,208 etp30 30 400000 +Ethernet240 209,210,211,212,213,214,215,216 etp31 31 400000 +Ethernet248 217,218,219,220,221,222,223,224 etp32 32 400000 +Ethernet256 257 etp33 33 10000 +Ethernet257 258 etp34 34 10000 diff --git a/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-O32/qos.json.j2 b/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-O32/qos.json.j2 index a48e1b56621c..3e548325ea30 100644 --- a/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-O32/qos.json.j2 +++ b/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-O32/qos.json.j2 @@ -1,226 +1 @@ -{%- set PORT_ALL = [] %} -{%- for port in PORT %} - {%- if PORT_ALL.append(port) %}{% endif %} -{%- endfor %} -{%- if PORT_ALL | sort_by_port_index %}{% endif %} - -{%- set port_names_list_all = [] %} -{%- for port in PORT_ALL %} - {%- if port_names_list_all.append(port) %}{% endif %} -{%- endfor %} -{%- set port_names_all = port_names_list_all | join(',') -%} - - -{%- set PORT_ACTIVE = [] %} -{%- if DEVICE_NEIGHBOR is not defined %} - {%- set PORT_ACTIVE = PORT_ALL %} -{%- else %} - {%- for port in DEVICE_NEIGHBOR.keys() %} - {%- if PORT_ACTIVE.append(port) %}{%- endif %} - {%- endfor %} -{%- endif %} -{%- if PORT_ACTIVE | sort_by_port_index %}{% endif %} - -{%- set port_names_list_active = [] %} -{%- for port in PORT_ACTIVE %} - {%- if port_names_list_active.append(port) %}{%- endif %} -{%- endfor %} -{%- set port_names_active = port_names_list_active | join(',') -%} - - -{%- set pfc_to_pg_map_supported_asics = ['mellanox', 'barefoot', 'marvell'] -%} - - -{ -{% if generate_tc_to_pg_map is defined %} - {{- generate_tc_to_pg_map() }} -{% else %} - "TC_TO_PRIORITY_GROUP_MAP": { - "DEFAULT": { - "0": "0", - "1": "0", - "2": "0", - "3": "3", - "4": "4", - "5": "0", - "6": "0", - "7": "7" - } - }, -{% endif %} - "MAP_PFC_PRIORITY_TO_QUEUE": { - "DEFAULT": { - "0": "0", - "1": "1", - "2": "2", - "3": "3", - "4": "4", - "5": "5", - "6": "6", - "7": "7" - } - }, - "TC_TO_QUEUE_MAP": { - "DEFAULT": { - "0": "0", - "1": "1", - "2": "2", - "3": "3", - "4": "4", - "5": "5", - "6": "6", - "7": "7" - } - }, - "DSCP_TO_TC_MAP": { - "DEFAULT": { - "0" : "0", - "1" : "0", - "2" : "0", - "3" : "0", - "4" : "0", - "5" : "0", - "6" : "0", - "7" : "0", - "8" : "0", - "9" : "0", - "10": "0", - "11": "0", - "12": "0", - "13": "0", - "14": "0", - "15": "0", - "16": "0", - "17": "0", - "18": "0", - "19": "0", - "20": "0", - "21": "0", - "22": "0", - "23": "0", - "24": "0", - "25": "0", - "26": "0", - "27": "0", - "28": "0", - "29": "0", - "30": "0", - "31": "0", - "32": "0", - "33": "0", - "34": "0", - "35": "0", - "36": "0", - "37": "0", - "38": "0", - "39": "0", - "40": "0", - "41": "0", - "42": "0", - "43": "0", - "44": "0", - "45": "0", - "46": "0", - "47": "0", - "48": "0", - "49": "0", - "50": "0", - "51": "0", - "52": "0", - "53": "0", - "54": "0", - "55": "0", - "56": "0", - "57": "0", - "58": "0", - "59": "0", - "60": "0", - "61": "0", - "62": "0", - "63": "0" - } - }, - "SCHEDULER": { - "scheduler.0": { - "type" : "DWRR", - "weight": "1" - }, - "scheduler.1": { - "type" : "DWRR", - "weight": "2" - }, - "scheduler.2": { - "type" : "DWRR", - "weight": "3" - }, - "scheduler.3": { - "type" : "DWRR", - "weight": "4" - }, - "scheduler.4": { - "type" : "DWRR", - "weight": "5" - }, - "scheduler.5": { - "type" : "DWRR", - "weight": "10" - }, - "scheduler.6": { - "type" : "DWRR", - "weight": "25" - }, - "scheduler.7": { - "type" : "STRICT" - } - }, - "PORT_QOS_MAP": { - "{{ port_names_active }}": { - "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|DEFAULT]", - "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|DEFAULT]", - "pfc_enable" : "3,4", - "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|DEFAULT]" - } - }, - "QUEUE": { -{% for port in PORT_ACTIVE %} - "{{ port }}|0": { - "scheduler" : "[SCHEDULER|scheduler.0]" - }, -{% endfor %} -{% for port in PORT_ACTIVE %} - "{{ port }}|1": { - "scheduler" : "[SCHEDULER|scheduler.1]" - }, -{% endfor %} -{% for port in PORT_ACTIVE %} - "{{ port }}|2": { - "scheduler": "[SCHEDULER|scheduler.2]" - }, -{% endfor %} -{% for port in PORT_ACTIVE %} - "{{ port }}|3": { - "scheduler": "[SCHEDULER|scheduler.3]" - }, -{% endfor %} -{% for port in PORT_ACTIVE %} - "{{ port }}|4": { - "scheduler": "[SCHEDULER|scheduler.4]" - }, -{% endfor %} -{% for port in PORT_ACTIVE %} - "{{ port }}|5": { - "scheduler": "[SCHEDULER|scheduler.5]" - }, -{% endfor %} -{% for port in PORT_ACTIVE %} - "{{ port }}|6": { - "scheduler": "[SCHEDULER|scheduler.6]" - }, -{% endfor %} -{% for port in PORT_ACTIVE %} - "{{ port }}|7": { - "scheduler": "[SCHEDULER|scheduler.7]" - }{% if not loop.last %},{% endif %} -{% endfor %} - } -} +{%- include 'qos_config.j2' %} diff --git a/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-O32/sai_preinit_cmd.soc b/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-O32/sai_preinit_cmd.soc index e48c05b9f664..4d62900f898f 100644 --- a/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-O32/sai_preinit_cmd.soc +++ b/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-O32/sai_preinit_cmd.soc @@ -1,3 +1,2 @@ -#Not supported Until SAI 3.6 -#m0 load 0 0x0 /usr/share/sonic/hwsku/linkscan_led_fw.bin -#m0 load 0 0x3800 /usr/share/sonic/hwsku/custom_led.bin +m0 load 0 0x0 /usr/share/sonic/hwsku/linkscan_led_fw.bin +m0 load 0 0x3800 /usr/share/sonic/hwsku/custom_led.bin diff --git a/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-O32/th3-z9332f-32x400G.config.bcm b/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-O32/th3-z9332f-32x400G.config.bcm index 38296d61c1b7..5871d8750f5e 100644 --- a/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-O32/th3-z9332f-32x400G.config.bcm +++ b/device/dell/x86_64-dellemc_z9332f_d1508-r0/DellEMC-Z9332f-O32/th3-z9332f-32x400G.config.bcm @@ -1,14 +1,25 @@ +# The following 2 SOC properties are needed to prevent FDB Events during Warmboot due to TH3 is SW Managed MACs +l2xmsg_shadow_hit_bits=0 +l2xmsg_no_cb_during_table_rebuild=1 + +sai_tunnel_global_sip_mask_enable=1 core_clock_frequency=1325 dpr_clock_frequency=1000 device_clock_frequency=1325 port_flex_enable=1 +# disables bcmALPMDH (ALPM distributed hitbit) thread. This thread is purely for debug purpose +l3_alpm_hit_skip=1 + +# Disable Counting ACL Drop towards interface RX_DRP counter +sai_adjust_acl_drop_in_rx_drop=1 + #firmware load method, use fast load load_firmware=0x2 ccm_dma_enable=0 ccmdma_intr_enable=0 -mem_cache_enable=0 +mem_cache_enable=1 phy_enable=0 phy_null=1 @@ -31,7 +42,6 @@ max_vp_lags.0=0 tdma_intr_enable=1 tdma_timeout_usec.0=5000000 parity_correction.0=1 -mmu_lossless.0=0 bcm_num_cos=10 default_cpu_tx_queue=7 pktdma_poll_mode_channel_bitmap=1 @@ -44,6 +54,9 @@ l3_mem_entries=40960 l2xlrn_thread_interval=50000 l2xlrn_intr_en=0 +sai_optimized_mmu=1 +mmu_init_config="TH3-MSFT-T1" + pbmp_xport_xe=0xffffffFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE phy_an_c73=3 @@ -514,6 +527,6 @@ serdes_lane_config_media_type_27=copper serdes_lane_config_media_type_28=copper serdes_lane_config_media_type_24=copper -#sai_preinit_cmd_file=/usr/share/sonic/hwsku/sai_preinit_cmd.soc +sai_preinit_cmd_file=/usr/share/sonic/hwsku/sai_preinit_cmd.soc sai_postinit_cmd_file=/usr/share/sonic/hwsku/sai_postinit_cmd.soc - +led_fw_path=/usr/share/sonic/hwsku/ diff --git a/device/dell/x86_64-dellemc_z9332f_d1508-r0/led_proc_init.soc b/device/dell/x86_64-dellemc_z9332f_d1508-r0/led_proc_init.soc index 0c116f35f80b..5bea525f9494 100644 --- a/device/dell/x86_64-dellemc_z9332f_d1508-r0/led_proc_init.soc +++ b/device/dell/x86_64-dellemc_z9332f_d1508-r0/led_proc_init.soc @@ -4,4 +4,4 @@ #Led0 #Support only after SAI 3.6 #led auto on -#led start +led start diff --git a/device/dell/x86_64-dellemc_z9332f_d1508-r0/media_settings.json b/device/dell/x86_64-dellemc_z9332f_d1508-r0/media_settings.json new file mode 100644 index 000000000000..130427ae99cb --- /dev/null +++ b/device/dell/x86_64-dellemc_z9332f_d1508-r0/media_settings.json @@ -0,0 +1,24196 @@ +{ + "PORT_MEDIA_SETTINGS":{ + "1":{ + "QSFP-DD-passive_copper_media_interface-1.0M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-1.5M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-0.5M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-2.0M":{ + "main":{ + "lane0": "0x00000070", + "lane1": "0x0000008c", + "lane2": "0x00000080", + "lane3": "0x00000070", + "lane4": "0x00000070", + "lane5": "0x00000070", + "lane6": "0x00000070", + "lane7": "0x00000084" + }, + "post1":{ + "lane0": "0xffffffe8", + "lane1": "0xfffffffc", + "lane2": "0xfffffff0", + "lane3": "0xffffffe8", + "lane4": "0xffffffe8", + "lane5": "0xffffffe8", + "lane6": "0xffffffe8", + "lane7": "0xfffffff4" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe8", + "lane2": "0xffffffe8", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe8" + }, + "pre2":{ + "lane0": "0x00000004", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000000" + } + }, + "QSFP-DD-sm_media_interface":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x00000088", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + }, + "pre1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + } + }, + "QSFP-DD-active_cable_media_interface":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x00000088", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + }, + "pre1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + } + }, + "QSFP28-40GBASE-CR4-1.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-2.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-3.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-5.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-*":{ + "main":{ + "lane0": "0x00000046", + "lane1": "0x00000048", + "lane2": "0x00000044", + "lane3": "0x00000044", + "lane4": "0x00000046", + "lane5": "0x00000048", + "lane6": "0x00000044", + "lane7": "0x00000044" + }, + "post1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + }, + "pre1":{ + "lane0": "0xfffffffc", + "lane1": "0xfffffffc", + "lane2": "0xfffffffc", + "lane3": "0xfffffffc", + "lane4": "0xfffffffc", + "lane5": "0xfffffffc", + "lane6": "0xfffffffc", + "lane7": "0xfffffffc" + } + }, + "QSFP+-40GBASE-CR4-1.0M":{ + "main":{ + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-2.0M":{ + "main":{ + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-3.0M":{ + "main":{ + "lane0": "0x0000003c", + "lane1": "0x0000003c", + "lane2": "0x0000003c", + "lane3": "0x0000003c", + "lane4": "0x0000003c", + "lane5": "0x0000003c", + "lane6": "0x0000003c", + "lane7": "0x0000003c" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-5.0M":{ + "main":{ + "lane0": "0x00000057", + "lane1": "0x00000057", + "lane2": "0x00000057", + "lane3": "0x00000057", + "lane4": "0x00000057", + "lane5": "0x00000057", + "lane6": "0x00000057", + "lane7": "0x00000057" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0xfffffffa", + "lane1": "0xfffffffa", + "lane2": "0xfffffffa", + "lane3": "0xfffffffa", + "lane4": "0xfffffffa", + "lane5": "0xfffffffa", + "lane6": "0xfffffffa", + "lane7": "0xfffffffa" + } + }, + "QSFP+-40GBASE-CR4-7.0M":{ + "main":{ + "lane0": "0x00000057", + "lane1": "0x00000057", + "lane2": "0x00000057", + "lane3": "0x00000057", + "lane4": "0x00000057", + "lane5": "0x00000057", + "lane6": "0x00000057", + "lane7": "0x00000057" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0xfffffffa", + "lane1": "0xfffffffa", + "lane2": "0xfffffffa", + "lane3": "0xfffffffa", + "lane4": "0xfffffffa", + "lane5": "0xfffffffa", + "lane6": "0xfffffffa", + "lane7": "0xfffffffa" + } + }, + "QSFP+-*":{ + "main":{ + "lane0": "0x0000004a", + "lane1": "0x0000004a", + "lane2": "0x0000004a", + "lane3": "0x0000004a", + "lane4": "0x0000004a", + "lane5": "0x0000004a", + "lane6": "0x0000004a", + "lane7": "0x0000004a" + }, + "post1":{ + "lane0": "0xfffffff2", + "lane1": "0xfffffff2", + "lane2": "0xfffffff2", + "lane3": "0xfffffff2", + "lane4": "0xfffffff2", + "lane5": "0xfffffff2", + "lane6": "0xfffffff2", + "lane7": "0xfffffff2" + }, + "pre1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + } + } + }, + "2":{ + "QSFP-DD-passive_copper_media_interface-1.0M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-1.5M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-0.5M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-2.0M":{ + "main":{ + "lane0": "0x00000070", + "lane1": "0x0000008c", + "lane2": "0x00000080", + "lane3": "0x00000070", + "lane4": "0x00000070", + "lane5": "0x00000070", + "lane6": "0x00000070", + "lane7": "0x00000084" + }, + "post1":{ + "lane0": "0xffffffe8", + "lane1": "0xfffffffc", + "lane2": "0xfffffff0", + "lane3": "0xffffffe8", + "lane4": "0xffffffe8", + "lane5": "0xffffffe8", + "lane6": "0xffffffe8", + "lane7": "0xfffffff4" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe8", + "lane2": "0xffffffe8", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe8" + }, + "pre2":{ + "lane0": "0x00000004", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000000" + } + }, + "QSFP-DD-sm_media_interface":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x00000088", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + }, + "pre1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + } + }, + "QSFP-DD-active_cable_media_interface":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x00000088", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + }, + "pre1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + } + }, + "QSFP28-40GBASE-CR4-1.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-2.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-3.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-5.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-*":{ + "main":{ + "lane0": "0x0000003c", + "lane1": "0x00000044", + "lane2": "0x00000046", + "lane3": "0x00000044", + "lane4": "0x0000003c", + "lane5": "0x00000044", + "lane6": "0x00000046", + "lane7": "0x00000044" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff4", + "lane2": "0xfffffff4", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff4", + "lane6": "0xfffffff4", + "lane7": "0xfffffff0" + }, + "pre1":{ + "lane0": "0xfffffffc", + "lane1": "0xfffffffc", + "lane2": "0xfffffffc", + "lane3": "0xfffffffc", + "lane4": "0xfffffffc", + "lane5": "0xfffffffc", + "lane6": "0xfffffffc", + "lane7": "0xfffffffc" + } + }, + "QSFP+-40GBASE-CR4-1.0M":{ + "main":{ + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-2.0M":{ + "main":{ + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-3.0M":{ + "main":{ + "lane0": "0x0000003c", + "lane1": "0x0000003c", + "lane2": "0x0000003c", + "lane3": "0x0000003c", + "lane4": "0x0000003c", + "lane5": "0x0000003c", + "lane6": "0x0000003c", + "lane7": "0x0000003c" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-5.0M":{ + "main":{ + "lane0": "0x00000057", + "lane1": "0x00000057", + "lane2": "0x00000057", + "lane3": "0x00000057", + "lane4": "0x00000057", + "lane5": "0x00000057", + "lane6": "0x00000057", + "lane7": "0x00000057" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0xfffffffa", + "lane1": "0xfffffffa", + "lane2": "0xfffffffa", + "lane3": "0xfffffffa", + "lane4": "0xfffffffa", + "lane5": "0xfffffffa", + "lane6": "0xfffffffa", + "lane7": "0xfffffffa" + } + }, + "QSFP+-40GBASE-CR4-7.0M":{ + "main":{ + "lane0": "0x00000057", + "lane1": "0x00000057", + "lane2": "0x00000057", + "lane3": "0x00000057", + "lane4": "0x00000057", + "lane5": "0x00000057", + "lane6": "0x00000057", + "lane7": "0x00000057" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0xfffffffa", + "lane1": "0xfffffffa", + "lane2": "0xfffffffa", + "lane3": "0xfffffffa", + "lane4": "0xfffffffa", + "lane5": "0xfffffffa", + "lane6": "0xfffffffa", + "lane7": "0xfffffffa" + } + }, + "QSFP+-*":{ + "main":{ + "lane0": "0x0000004a", + "lane1": "0x0000004a", + "lane2": "0x0000004a", + "lane3": "0x0000004a", + "lane4": "0x0000004a", + "lane5": "0x0000004a", + "lane6": "0x0000004a", + "lane7": "0x0000004a" + }, + "post1":{ + "lane0": "0xfffffff2", + "lane1": "0xfffffff2", + "lane2": "0xfffffff2", + "lane3": "0xfffffff2", + "lane4": "0xfffffff2", + "lane5": "0xfffffff2", + "lane6": "0xfffffff2", + "lane7": "0xfffffff2" + }, + "pre1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + } + } + }, + "3":{ + "QSFP-DD-passive_copper_media_interface-1.0M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-1.5M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-0.5M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-2.0M":{ + "main":{ + "lane0": "0x00000070", + "lane1": "0x0000008c", + "lane2": "0x00000080", + "lane3": "0x00000070", + "lane4": "0x00000070", + "lane5": "0x00000070", + "lane6": "0x00000070", + "lane7": "0x00000084" + }, + "post1":{ + "lane0": "0xffffffe8", + "lane1": "0xfffffffc", + "lane2": "0xfffffff0", + "lane3": "0xffffffe8", + "lane4": "0xffffffe8", + "lane5": "0xffffffe8", + "lane6": "0xffffffe8", + "lane7": "0xfffffff4" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe8", + "lane2": "0xffffffe8", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe8" + }, + "pre2":{ + "lane0": "0x00000004", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000000" + } + }, + "QSFP-DD-sm_media_interface":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x00000088", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + }, + "pre1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + } + }, + "QSFP-DD-active_cable_media_interface":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x00000088", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + }, + "pre1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + } + }, + "QSFP28-40GBASE-CR4-1.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-2.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-3.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-5.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-*":{ + "main":{ + "lane0": "0x0000003c", + "lane1": "0x00000048", + "lane2": "0x00000044", + "lane3": "0x00000044", + "lane4": "0x0000003c", + "lane5": "0x00000048", + "lane6": "0x00000044", + "lane7": "0x00000044" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff4", + "lane2": "0xfffffff6", + "lane3": "0xfffffff4", + "lane4": "0xfffffff0", + "lane5": "0xfffffff4", + "lane6": "0xfffffff6", + "lane7": "0xfffffff4" + }, + "pre1":{ + "lane0": "0xfffffffc", + "lane1": "0xfffffffc", + "lane2": "0xfffffffc", + "lane3": "0xfffffffc", + "lane4": "0xfffffffc", + "lane5": "0xfffffffc", + "lane6": "0xfffffffc", + "lane7": "0xfffffffc" + } + }, + "QSFP+-40GBASE-CR4-1.0M":{ + "main":{ + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-2.0M":{ + "main":{ + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-3.0M":{ + "main":{ + "lane0": "0x0000003c", + "lane1": "0x0000003c", + "lane2": "0x0000003c", + "lane3": "0x0000003c", + "lane4": "0x0000003c", + "lane5": "0x0000003c", + "lane6": "0x0000003c", + "lane7": "0x0000003c" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-5.0M":{ + "main":{ + "lane0": "0x00000057", + "lane1": "0x00000057", + "lane2": "0x00000057", + "lane3": "0x00000057", + "lane4": "0x00000057", + "lane5": "0x00000057", + "lane6": "0x00000057", + "lane7": "0x00000057" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0xfffffffa", + "lane1": "0xfffffffa", + "lane2": "0xfffffffa", + "lane3": "0xfffffffa", + "lane4": "0xfffffffa", + "lane5": "0xfffffffa", + "lane6": "0xfffffffa", + "lane7": "0xfffffffa" + } + }, + "QSFP+-40GBASE-CR4-7.0M":{ + "main":{ + "lane0": "0x00000057", + "lane1": "0x00000057", + "lane2": "0x00000057", + "lane3": "0x00000057", + "lane4": "0x00000057", + "lane5": "0x00000057", + "lane6": "0x00000057", + "lane7": "0x00000057" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0xfffffffa", + "lane1": "0xfffffffa", + "lane2": "0xfffffffa", + "lane3": "0xfffffffa", + "lane4": "0xfffffffa", + "lane5": "0xfffffffa", + "lane6": "0xfffffffa", + "lane7": "0xfffffffa" + } + }, + "QSFP+-*":{ + "main":{ + "lane0": "0x00000046", + "lane1": "0x00000046", + "lane2": "0x00000046", + "lane3": "0x00000046", + "lane4": "0x00000046", + "lane5": "0x00000046", + "lane6": "0x00000046", + "lane7": "0x00000046" + }, + "post1":{ + "lane0": "0xfffffff4", + "lane1": "0xfffffff4", + "lane2": "0xfffffff4", + "lane3": "0xfffffff4", + "lane4": "0xfffffff4", + "lane5": "0xfffffff4", + "lane6": "0xfffffff4", + "lane7": "0xfffffff4" + }, + "pre1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + } + } + }, + "4":{ + "QSFP-DD-passive_copper_media_interface-1.0M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-1.5M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-0.5M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-2.0M":{ + "main":{ + "lane0": "0x00000070", + "lane1": "0x0000008c", + "lane2": "0x00000080", + "lane3": "0x00000070", + "lane4": "0x00000070", + "lane5": "0x00000070", + "lane6": "0x00000070", + "lane7": "0x00000084" + }, + "post1":{ + "lane0": "0xffffffe8", + "lane1": "0xfffffffc", + "lane2": "0xfffffff0", + "lane3": "0xffffffe8", + "lane4": "0xffffffe8", + "lane5": "0xffffffe8", + "lane6": "0xffffffe8", + "lane7": "0xfffffff4" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe8", + "lane2": "0xffffffe8", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe8" + }, + "pre2":{ + "lane0": "0x00000004", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000000" + } + }, + "QSFP-DD-sm_media_interface":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x00000088", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + }, + "pre1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + } + }, + "QSFP-DD-active_cable_media_interface":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x00000088", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + }, + "pre1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + } + }, + "QSFP28-40GBASE-CR4-1.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-2.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-3.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-5.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-*":{ + "main":{ + "lane0": "0x00000036", + "lane1": "0x00000044", + "lane2": "0x00000044", + "lane3": "0x00000040", + "lane4": "0x00000036", + "lane5": "0x00000044", + "lane6": "0x00000044", + "lane7": "0x00000040" + }, + "post1":{ + "lane0": "0xfffffff4", + "lane1": "0xfffffff8", + "lane2": "0xfffffff8", + "lane3": "0xfffffff4", + "lane4": "0xfffffff4", + "lane5": "0xfffffff8", + "lane6": "0xfffffff8", + "lane7": "0xfffffff4" + }, + "pre1":{ + "lane0": "0xfffffffc", + "lane1": "0xfffffffc", + "lane2": "0xfffffffc", + "lane3": "0xfffffffc", + "lane4": "0xfffffffc", + "lane5": "0xfffffffc", + "lane6": "0xfffffffc", + "lane7": "0xfffffffc" + } + }, + "QSFP+-40GBASE-CR4-1.0M":{ + "main":{ + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-2.0M":{ + "main":{ + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-3.0M":{ + "main":{ + "lane0": "0x0000003c", + "lane1": "0x0000003c", + "lane2": "0x0000003c", + "lane3": "0x0000003c", + "lane4": "0x0000003c", + "lane5": "0x0000003c", + "lane6": "0x0000003c", + "lane7": "0x0000003c" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-5.0M":{ + "main":{ + "lane0": "0x00000057", + "lane1": "0x00000057", + "lane2": "0x00000057", + "lane3": "0x00000057", + "lane4": "0x00000057", + "lane5": "0x00000057", + "lane6": "0x00000057", + "lane7": "0x00000057" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0xfffffffa", + "lane1": "0xfffffffa", + "lane2": "0xfffffffa", + "lane3": "0xfffffffa", + "lane4": "0xfffffffa", + "lane5": "0xfffffffa", + "lane6": "0xfffffffa", + "lane7": "0xfffffffa" + } + }, + "QSFP+-40GBASE-CR4-7.0M":{ + "main":{ + "lane0": "0x00000057", + "lane1": "0x00000057", + "lane2": "0x00000057", + "lane3": "0x00000057", + "lane4": "0x00000057", + "lane5": "0x00000057", + "lane6": "0x00000057", + "lane7": "0x00000057" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0xfffffffa", + "lane1": "0xfffffffa", + "lane2": "0xfffffffa", + "lane3": "0xfffffffa", + "lane4": "0xfffffffa", + "lane5": "0xfffffffa", + "lane6": "0xfffffffa", + "lane7": "0xfffffffa" + } + }, + "QSFP+-*":{ + "main":{ + "lane0": "0x00000046", + "lane1": "0x00000046", + "lane2": "0x00000046", + "lane3": "0x00000046", + "lane4": "0x00000046", + "lane5": "0x00000046", + "lane6": "0x00000046", + "lane7": "0x00000046" + }, + "post1":{ + "lane0": "0xfffffff4", + "lane1": "0xfffffff4", + "lane2": "0xfffffff4", + "lane3": "0xfffffff4", + "lane4": "0xfffffff4", + "lane5": "0xfffffff4", + "lane6": "0xfffffff4", + "lane7": "0xfffffff4" + }, + "pre1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + } + } + }, + "5":{ + "QSFP-DD-passive_copper_media_interface-1.0M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-1.5M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-0.5M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-2.0M":{ + "main":{ + "lane0": "0x00000070", + "lane1": "0x0000008c", + "lane2": "0x00000080", + "lane3": "0x00000070", + "lane4": "0x00000070", + "lane5": "0x00000070", + "lane6": "0x00000070", + "lane7": "0x00000084" + }, + "post1":{ + "lane0": "0xffffffe8", + "lane1": "0xfffffffc", + "lane2": "0xfffffff0", + "lane3": "0xffffffe8", + "lane4": "0xffffffe8", + "lane5": "0xffffffe8", + "lane6": "0xffffffe8", + "lane7": "0xfffffff4" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe8", + "lane2": "0xffffffe8", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe8" + }, + "pre2":{ + "lane0": "0x00000004", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000000" + } + }, + "QSFP-DD-sm_media_interface":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x00000088", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + }, + "pre1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + } + }, + "QSFP-DD-active_cable_media_interface":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x00000088", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + }, + "pre1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + } + }, + "QSFP28-40GBASE-CR4-1.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-2.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-3.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-5.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-*":{ + "main":{ + "lane0": "0x0000003c", + "lane1": "0x00000040", + "lane2": "0x0000003c", + "lane3": "0x00000040", + "lane4": "0x0000003c", + "lane5": "0x00000040", + "lane6": "0x0000003c", + "lane7": "0x00000040" + }, + "post1":{ + "lane0": "0xfffffff6", + "lane1": "0xfffffff0", + "lane2": "0xfffffff6", + "lane3": "0xfffffff8", + "lane4": "0xfffffff6", + "lane5": "0xfffffff0", + "lane6": "0xfffffff6", + "lane7": "0xfffffff8" + }, + "pre1":{ + "lane0": "0xfffffffc", + "lane1": "0xfffffffc", + "lane2": "0xfffffffc", + "lane3": "0xfffffffc", + "lane4": "0xfffffffc", + "lane5": "0xfffffffc", + "lane6": "0xfffffffc", + "lane7": "0xfffffffc" + } + }, + "QSFP+-40GBASE-CR4-1.0M":{ + "main":{ + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-2.0M":{ + "main":{ + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-3.0M":{ + "main":{ + "lane0": "0x0000003c", + "lane1": "0x0000003c", + "lane2": "0x0000003c", + "lane3": "0x0000003c", + "lane4": "0x0000003c", + "lane5": "0x0000003c", + "lane6": "0x0000003c", + "lane7": "0x0000003c" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-5.0M":{ + "main":{ + "lane0": "0x00000057", + "lane1": "0x00000057", + "lane2": "0x00000057", + "lane3": "0x00000057", + "lane4": "0x00000057", + "lane5": "0x00000057", + "lane6": "0x00000057", + "lane7": "0x00000057" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0xfffffffa", + "lane1": "0xfffffffa", + "lane2": "0xfffffffa", + "lane3": "0xfffffffa", + "lane4": "0xfffffffa", + "lane5": "0xfffffffa", + "lane6": "0xfffffffa", + "lane7": "0xfffffffa" + } + }, + "QSFP+-40GBASE-CR4-7.0M":{ + "main":{ + "lane0": "0x00000057", + "lane1": "0x00000057", + "lane2": "0x00000057", + "lane3": "0x00000057", + "lane4": "0x00000057", + "lane5": "0x00000057", + "lane6": "0x00000057", + "lane7": "0x00000057" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0xfffffffa", + "lane1": "0xfffffffa", + "lane2": "0xfffffffa", + "lane3": "0xfffffffa", + "lane4": "0xfffffffa", + "lane5": "0xfffffffa", + "lane6": "0xfffffffa", + "lane7": "0xfffffffa" + } + }, + "QSFP+-*":{ + "main":{ + "lane0": "0x00000046", + "lane1": "0x00000046", + "lane2": "0x00000046", + "lane3": "0x00000046", + "lane4": "0x00000046", + "lane5": "0x00000046", + "lane6": "0x00000046", + "lane7": "0x00000046" + }, + "post1":{ + "lane0": "0xfffffff4", + "lane1": "0xfffffff4", + "lane2": "0xfffffff4", + "lane3": "0xfffffff4", + "lane4": "0xfffffff4", + "lane5": "0xfffffff4", + "lane6": "0xfffffff4", + "lane7": "0xfffffff4" + }, + "pre1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + } + } + }, + "6":{ + "QSFP-DD-passive_copper_media_interface-1.0M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-1.5M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-0.5M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-2.0M":{ + "main":{ + "lane0": "0x00000070", + "lane1": "0x0000008c", + "lane2": "0x00000080", + "lane3": "0x00000070", + "lane4": "0x00000070", + "lane5": "0x00000070", + "lane6": "0x00000070", + "lane7": "0x00000084" + }, + "post1":{ + "lane0": "0xffffffe8", + "lane1": "0xfffffffc", + "lane2": "0xfffffff0", + "lane3": "0xffffffe8", + "lane4": "0xffffffe8", + "lane5": "0xffffffe8", + "lane6": "0xffffffe8", + "lane7": "0xfffffff4" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe8", + "lane2": "0xffffffe8", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe8" + }, + "pre2":{ + "lane0": "0x00000004", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000000" + } + }, + "QSFP-DD-sm_media_interface":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x00000088", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + }, + "pre1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + } + }, + "QSFP-DD-active_cable_media_interface":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x00000088", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + }, + "pre1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + } + }, + "QSFP28-40GBASE-CR4-1.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-2.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-3.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-5.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-*":{ + "main":{ + "lane0": "0x00000036", + "lane1": "0x00000044", + "lane2": "0x0000003c", + "lane3": "0x00000040", + "lane4": "0x00000036", + "lane5": "0x00000044", + "lane6": "0x0000003c", + "lane7": "0x00000040" + }, + "post1":{ + "lane0": "0xfffffff6", + "lane1": "0xfffffff0", + "lane2": "0xfffffff6", + "lane3": "0xfffffff8", + "lane4": "0xfffffff6", + "lane5": "0xfffffff0", + "lane6": "0xfffffff6", + "lane7": "0xfffffff8" + }, + "pre1":{ + "lane0": "0xfffffffc", + "lane1": "0xfffffffc", + "lane2": "0xfffffffc", + "lane3": "0xfffffffc", + "lane4": "0xfffffffc", + "lane5": "0xfffffffc", + "lane6": "0xfffffffc", + "lane7": "0xfffffffc" + } + }, + "QSFP+-40GBASE-CR4-1.0M":{ + "main":{ + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-2.0M":{ + "main":{ + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-3.0M":{ + "main":{ + "lane0": "0x0000003c", + "lane1": "0x0000003c", + "lane2": "0x0000003c", + "lane3": "0x0000003c", + "lane4": "0x0000003c", + "lane5": "0x0000003c", + "lane6": "0x0000003c", + "lane7": "0x0000003c" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-5.0M":{ + "main":{ + "lane0": "0x00000057", + "lane1": "0x00000057", + "lane2": "0x00000057", + "lane3": "0x00000057", + "lane4": "0x00000057", + "lane5": "0x00000057", + "lane6": "0x00000057", + "lane7": "0x00000057" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0xfffffffa", + "lane1": "0xfffffffa", + "lane2": "0xfffffffa", + "lane3": "0xfffffffa", + "lane4": "0xfffffffa", + "lane5": "0xfffffffa", + "lane6": "0xfffffffa", + "lane7": "0xfffffffa" + } + }, + "QSFP+-40GBASE-CR4-7.0M":{ + "main":{ + "lane0": "0x00000057", + "lane1": "0x00000057", + "lane2": "0x00000057", + "lane3": "0x00000057", + "lane4": "0x00000057", + "lane5": "0x00000057", + "lane6": "0x00000057", + "lane7": "0x00000057" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0xfffffffa", + "lane1": "0xfffffffa", + "lane2": "0xfffffffa", + "lane3": "0xfffffffa", + "lane4": "0xfffffffa", + "lane5": "0xfffffffa", + "lane6": "0xfffffffa", + "lane7": "0xfffffffa" + } + }, + "QSFP+-*":{ + "main":{ + "lane0": "0x00000046", + "lane1": "0x00000046", + "lane2": "0x00000046", + "lane3": "0x00000046", + "lane4": "0x00000046", + "lane5": "0x00000046", + "lane6": "0x00000046", + "lane7": "0x00000046" + }, + "post1":{ + "lane0": "0xfffffff4", + "lane1": "0xfffffff4", + "lane2": "0xfffffff4", + "lane3": "0xfffffff4", + "lane4": "0xfffffff4", + "lane5": "0xfffffff4", + "lane6": "0xfffffff4", + "lane7": "0xfffffff4" + }, + "pre1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + } + } + }, + "7":{ + "QSFP-DD-passive_copper_media_interface-1.0M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-1.5M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-0.5M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-2.0M":{ + "main":{ + "lane0": "0x00000070", + "lane1": "0x0000008c", + "lane2": "0x00000080", + "lane3": "0x00000070", + "lane4": "0x00000070", + "lane5": "0x00000070", + "lane6": "0x00000070", + "lane7": "0x00000084" + }, + "post1":{ + "lane0": "0xffffffe8", + "lane1": "0xfffffffc", + "lane2": "0xfffffff0", + "lane3": "0xffffffe8", + "lane4": "0xffffffe8", + "lane5": "0xffffffe8", + "lane6": "0xffffffe8", + "lane7": "0xfffffff4" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe8", + "lane2": "0xffffffe8", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe8" + }, + "pre2":{ + "lane0": "0x00000004", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000000" + } + }, + "QSFP-DD-sm_media_interface":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x00000088", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + }, + "pre1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + } + }, + "QSFP-DD-active_cable_media_interface":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x00000088", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + }, + "pre1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + } + }, + "QSFP28-40GBASE-CR4-1.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-2.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-3.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-5.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-*":{ + "main":{ + "lane0": "0x0000003c", + "lane1": "0x0000003c", + "lane2": "0x0000003c", + "lane3": "0x00000038", + "lane4": "0x0000003c", + "lane5": "0x0000003c", + "lane6": "0x0000003c", + "lane7": "0x00000038" + }, + "post1":{ + "lane0": "0xfffffff4", + "lane1": "0xfffffff6", + "lane2": "0xfffffff6", + "lane3": "0xfffffff6", + "lane4": "0xfffffff4", + "lane5": "0xfffffff6", + "lane6": "0xfffffff6", + "lane7": "0xfffffff6" + }, + "pre1":{ + "lane0": "0xfffffffc", + "lane1": "0xfffffffc", + "lane2": "0xfffffffc", + "lane3": "0xfffffffc", + "lane4": "0xfffffffc", + "lane5": "0xfffffffc", + "lane6": "0xfffffffc", + "lane7": "0xfffffffc" + } + }, + "QSFP+-40GBASE-CR4-1.0M":{ + "main":{ + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-2.0M":{ + "main":{ + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-3.0M":{ + "main":{ + "lane0": "0x0000003c", + "lane1": "0x0000003c", + "lane2": "0x0000003c", + "lane3": "0x0000003c", + "lane4": "0x0000003c", + "lane5": "0x0000003c", + "lane6": "0x0000003c", + "lane7": "0x0000003c" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-5.0M":{ + "main":{ + "lane0": "0x00000057", + "lane1": "0x00000057", + "lane2": "0x00000057", + "lane3": "0x00000057", + "lane4": "0x00000057", + "lane5": "0x00000057", + "lane6": "0x00000057", + "lane7": "0x00000057" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0xfffffffa", + "lane1": "0xfffffffa", + "lane2": "0xfffffffa", + "lane3": "0xfffffffa", + "lane4": "0xfffffffa", + "lane5": "0xfffffffa", + "lane6": "0xfffffffa", + "lane7": "0xfffffffa" + } + }, + "QSFP+-40GBASE-CR4-7.0M":{ + "main":{ + "lane0": "0x00000057", + "lane1": "0x00000057", + "lane2": "0x00000057", + "lane3": "0x00000057", + "lane4": "0x00000057", + "lane5": "0x00000057", + "lane6": "0x00000057", + "lane7": "0x00000057" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0xfffffffa", + "lane1": "0xfffffffa", + "lane2": "0xfffffffa", + "lane3": "0xfffffffa", + "lane4": "0xfffffffa", + "lane5": "0xfffffffa", + "lane6": "0xfffffffa", + "lane7": "0xfffffffa" + } + }, + "QSFP+-*":{ + "main":{ + "lane0": "0x00000046", + "lane1": "0x00000046", + "lane2": "0x00000046", + "lane3": "0x00000046", + "lane4": "0x00000046", + "lane5": "0x00000046", + "lane6": "0x00000046", + "lane7": "0x00000046" + }, + "post1":{ + "lane0": "0xfffffff4", + "lane1": "0xfffffff4", + "lane2": "0xfffffff4", + "lane3": "0xfffffff4", + "lane4": "0xfffffff4", + "lane5": "0xfffffff4", + "lane6": "0xfffffff4", + "lane7": "0xfffffff4" + }, + "pre1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + } + } + }, + "8":{ + "QSFP-DD-passive_copper_media_interface-1.0M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-1.5M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-0.5M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-2.0M":{ + "main":{ + "lane0": "0x00000070", + "lane1": "0x0000008c", + "lane2": "0x00000080", + "lane3": "0x00000070", + "lane4": "0x00000070", + "lane5": "0x00000070", + "lane6": "0x00000070", + "lane7": "0x00000084" + }, + "post1":{ + "lane0": "0xffffffe8", + "lane1": "0xfffffffc", + "lane2": "0xfffffff0", + "lane3": "0xffffffe8", + "lane4": "0xffffffe8", + "lane5": "0xffffffe8", + "lane6": "0xffffffe8", + "lane7": "0xfffffff4" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe8", + "lane2": "0xffffffe8", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe8" + }, + "pre2":{ + "lane0": "0x00000004", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000000" + } + }, + "QSFP-DD-sm_media_interface":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x00000088", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + }, + "pre1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + } + }, + "QSFP-DD-active_cable_media_interface":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x00000088", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + }, + "pre1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + } + }, + "QSFP28-40GBASE-CR4-1.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-2.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-3.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-5.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-*":{ + "main":{ + "lane0": "0x00000036", + "lane1": "0x00000042", + "lane2": "0x0000003c", + "lane3": "0x0000003c", + "lane4": "0x00000036", + "lane5": "0x00000042", + "lane6": "0x0000003c", + "lane7": "0x0000003c" + }, + "post1":{ + "lane0": "0xfffffff4", + "lane1": "0xfffffff4", + "lane2": "0xfffffff6", + "lane3": "0xfffffff6", + "lane4": "0xfffffff4", + "lane5": "0xfffffff4", + "lane6": "0xfffffff6", + "lane7": "0xfffffff6" + }, + "pre1":{ + "lane0": "0xfffffffc", + "lane1": "0xfffffffc", + "lane2": "0xfffffffc", + "lane3": "0xfffffffc", + "lane4": "0xfffffffc", + "lane5": "0xfffffffc", + "lane6": "0xfffffffc", + "lane7": "0xfffffffc" + } + }, + "QSFP+-40GBASE-CR4-1.0M":{ + "main":{ + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-2.0M":{ + "main":{ + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-3.0M":{ + "main":{ + "lane0": "0x0000003c", + "lane1": "0x0000003c", + "lane2": "0x0000003c", + "lane3": "0x0000003c", + "lane4": "0x0000003c", + "lane5": "0x0000003c", + "lane6": "0x0000003c", + "lane7": "0x0000003c" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-5.0M":{ + "main":{ + "lane0": "0x00000057", + "lane1": "0x00000057", + "lane2": "0x00000057", + "lane3": "0x00000057", + "lane4": "0x00000057", + "lane5": "0x00000057", + "lane6": "0x00000057", + "lane7": "0x00000057" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0xfffffffa", + "lane1": "0xfffffffa", + "lane2": "0xfffffffa", + "lane3": "0xfffffffa", + "lane4": "0xfffffffa", + "lane5": "0xfffffffa", + "lane6": "0xfffffffa", + "lane7": "0xfffffffa" + } + }, + "QSFP+-40GBASE-CR4-7.0M":{ + "main":{ + "lane0": "0x00000057", + "lane1": "0x00000057", + "lane2": "0x00000057", + "lane3": "0x00000057", + "lane4": "0x00000057", + "lane5": "0x00000057", + "lane6": "0x00000057", + "lane7": "0x00000057" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0xfffffffa", + "lane1": "0xfffffffa", + "lane2": "0xfffffffa", + "lane3": "0xfffffffa", + "lane4": "0xfffffffa", + "lane5": "0xfffffffa", + "lane6": "0xfffffffa", + "lane7": "0xfffffffa" + } + }, + "QSFP+-*":{ + "main":{ + "lane0": "0x00000046", + "lane1": "0x00000046", + "lane2": "0x00000046", + "lane3": "0x00000046", + "lane4": "0x00000046", + "lane5": "0x00000046", + "lane6": "0x00000046", + "lane7": "0x00000046" + }, + "post1":{ + "lane0": "0xfffffff4", + "lane1": "0xfffffff4", + "lane2": "0xfffffff4", + "lane3": "0xfffffff4", + "lane4": "0xfffffff4", + "lane5": "0xfffffff4", + "lane6": "0xfffffff4", + "lane7": "0xfffffff4" + }, + "pre1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + } + } + }, + "9":{ + "QSFP-DD-passive_copper_media_interface-1.0M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-1.5M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-0.5M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-2.0M":{ + "main":{ + "lane0": "0x00000070", + "lane1": "0x0000008c", + "lane2": "0x00000080", + "lane3": "0x00000070", + "lane4": "0x00000070", + "lane5": "0x00000070", + "lane6": "0x00000070", + "lane7": "0x00000084" + }, + "post1":{ + "lane0": "0xffffffe8", + "lane1": "0xfffffffc", + "lane2": "0xfffffff0", + "lane3": "0xffffffe8", + "lane4": "0xffffffe8", + "lane5": "0xffffffe8", + "lane6": "0xffffffe8", + "lane7": "0xfffffff4" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe8", + "lane2": "0xffffffe8", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe8" + }, + "pre2":{ + "lane0": "0x00000004", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000000" + } + }, + "QSFP-DD-sm_media_interface":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x00000088", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + }, + "pre1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + } + }, + "QSFP-DD-active_cable_media_interface":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x00000088", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + }, + "pre1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + } + }, + "QSFP28-40GBASE-CR4-1.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-2.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-3.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-5.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-*":{ + "main":{ + "lane0": "0x00000040", + "lane1": "0x00000048", + "lane2": "0x00000040", + "lane3": "0x00000044", + "lane4": "0x00000040", + "lane5": "0x00000048", + "lane6": "0x00000040", + "lane7": "0x00000044" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff4", + "lane2": "0xfffffff4", + "lane3": "0xfffffff4", + "lane4": "0xfffffff0", + "lane5": "0xfffffff4", + "lane6": "0xfffffff4", + "lane7": "0xfffffff4" + }, + "pre1":{ + "lane0": "0xfffffffc", + "lane1": "0xfffffffc", + "lane2": "0xfffffffc", + "lane3": "0xfffffffc", + "lane4": "0xfffffffc", + "lane5": "0xfffffffc", + "lane6": "0xfffffffc", + "lane7": "0xfffffffc" + } + }, + "QSFP+-40GBASE-CR4-1.0M":{ + "main":{ + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-2.0M":{ + "main":{ + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-3.0M":{ + "main":{ + "lane0": "0x0000003c", + "lane1": "0x0000003c", + "lane2": "0x0000003c", + "lane3": "0x0000003c", + "lane4": "0x0000003c", + "lane5": "0x0000003c", + "lane6": "0x0000003c", + "lane7": "0x0000003c" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-5.0M":{ + "main":{ + "lane0": "0x00000057", + "lane1": "0x00000057", + "lane2": "0x00000057", + "lane3": "0x00000057", + "lane4": "0x00000057", + "lane5": "0x00000057", + "lane6": "0x00000057", + "lane7": "0x00000057" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0xfffffffa", + "lane1": "0xfffffffa", + "lane2": "0xfffffffa", + "lane3": "0xfffffffa", + "lane4": "0xfffffffa", + "lane5": "0xfffffffa", + "lane6": "0xfffffffa", + "lane7": "0xfffffffa" + } + }, + "QSFP+-40GBASE-CR4-7.0M":{ + "main":{ + "lane0": "0x00000057", + "lane1": "0x00000057", + "lane2": "0x00000057", + "lane3": "0x00000057", + "lane4": "0x00000057", + "lane5": "0x00000057", + "lane6": "0x00000057", + "lane7": "0x00000057" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0xfffffffa", + "lane1": "0xfffffffa", + "lane2": "0xfffffffa", + "lane3": "0xfffffffa", + "lane4": "0xfffffffa", + "lane5": "0xfffffffa", + "lane6": "0xfffffffa", + "lane7": "0xfffffffa" + } + }, + "QSFP+-*":{ + "main":{ + "lane0": "0x0000004a", + "lane1": "0x0000004a", + "lane2": "0x0000004a", + "lane3": "0x0000004a", + "lane4": "0x0000004a", + "lane5": "0x0000004a", + "lane6": "0x0000004a", + "lane7": "0x0000004a" + }, + "post1":{ + "lane0": "0xfffffff2", + "lane1": "0xfffffff2", + "lane2": "0xfffffff2", + "lane3": "0xfffffff2", + "lane4": "0xfffffff2", + "lane5": "0xfffffff2", + "lane6": "0xfffffff2", + "lane7": "0xfffffff2" + }, + "pre1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + } + } + }, + "10":{ + "QSFP-DD-passive_copper_media_interface-1.0M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-1.5M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-0.5M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-2.0M":{ + "main":{ + "lane0": "0x00000070", + "lane1": "0x0000008c", + "lane2": "0x00000080", + "lane3": "0x00000070", + "lane4": "0x00000070", + "lane5": "0x00000070", + "lane6": "0x00000070", + "lane7": "0x00000084" + }, + "post1":{ + "lane0": "0xffffffe8", + "lane1": "0xfffffffc", + "lane2": "0xfffffff0", + "lane3": "0xffffffe8", + "lane4": "0xffffffe8", + "lane5": "0xffffffe8", + "lane6": "0xffffffe8", + "lane7": "0xfffffff4" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe8", + "lane2": "0xffffffe8", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe8" + }, + "pre2":{ + "lane0": "0x00000004", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000000" + } + }, + "QSFP-DD-sm_media_interface":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x00000088", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + }, + "pre1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + } + }, + "QSFP-DD-active_cable_media_interface":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x00000088", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + }, + "pre1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + } + }, + "QSFP28-40GBASE-CR4-1.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-2.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-3.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-5.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-*":{ + "main":{ + "lane0": "0x00000040", + "lane1": "0x00000044", + "lane2": "0x00000044", + "lane3": "0x00000046", + "lane4": "0x00000040", + "lane5": "0x00000044", + "lane6": "0x00000044", + "lane7": "0x00000046" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff4", + "lane2": "0xfffffff4", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff4", + "lane6": "0xfffffff4", + "lane7": "0xfffffff0" + }, + "pre1":{ + "lane0": "0xfffffffc", + "lane1": "0xfffffffc", + "lane2": "0xfffffffc", + "lane3": "0xfffffffc", + "lane4": "0xfffffffc", + "lane5": "0xfffffffc", + "lane6": "0xfffffffc", + "lane7": "0xfffffffc" + } + }, + "QSFP+-40GBASE-CR4-1.0M":{ + "main":{ + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-2.0M":{ + "main":{ + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-3.0M":{ + "main":{ + "lane0": "0x0000003c", + "lane1": "0x0000003c", + "lane2": "0x0000003c", + "lane3": "0x0000003c", + "lane4": "0x0000003c", + "lane5": "0x0000003c", + "lane6": "0x0000003c", + "lane7": "0x0000003c" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-5.0M":{ + "main":{ + "lane0": "0x00000057", + "lane1": "0x00000057", + "lane2": "0x00000057", + "lane3": "0x00000057", + "lane4": "0x00000057", + "lane5": "0x00000057", + "lane6": "0x00000057", + "lane7": "0x00000057" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0xfffffffa", + "lane1": "0xfffffffa", + "lane2": "0xfffffffa", + "lane3": "0xfffffffa", + "lane4": "0xfffffffa", + "lane5": "0xfffffffa", + "lane6": "0xfffffffa", + "lane7": "0xfffffffa" + } + }, + "QSFP+-40GBASE-CR4-7.0M":{ + "main":{ + "lane0": "0x00000057", + "lane1": "0x00000057", + "lane2": "0x00000057", + "lane3": "0x00000057", + "lane4": "0x00000057", + "lane5": "0x00000057", + "lane6": "0x00000057", + "lane7": "0x00000057" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0xfffffffa", + "lane1": "0xfffffffa", + "lane2": "0xfffffffa", + "lane3": "0xfffffffa", + "lane4": "0xfffffffa", + "lane5": "0xfffffffa", + "lane6": "0xfffffffa", + "lane7": "0xfffffffa" + } + }, + "QSFP+-*":{ + "main":{ + "lane0": "0x0000004a", + "lane1": "0x0000004a", + "lane2": "0x0000004a", + "lane3": "0x0000004a", + "lane4": "0x0000004a", + "lane5": "0x0000004a", + "lane6": "0x0000004a", + "lane7": "0x0000004a" + }, + "post1":{ + "lane0": "0xfffffff2", + "lane1": "0xfffffff2", + "lane2": "0xfffffff2", + "lane3": "0xfffffff2", + "lane4": "0xfffffff2", + "lane5": "0xfffffff2", + "lane6": "0xfffffff2", + "lane7": "0xfffffff2" + }, + "pre1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + } + } + }, + "11":{ + "QSFP-DD-passive_copper_media_interface-1.0M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-1.5M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-0.5M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-2.0M":{ + "main":{ + "lane0": "0x00000070", + "lane1": "0x0000008c", + "lane2": "0x00000080", + "lane3": "0x00000070", + "lane4": "0x00000070", + "lane5": "0x00000070", + "lane6": "0x00000070", + "lane7": "0x00000084" + }, + "post1":{ + "lane0": "0xffffffe8", + "lane1": "0xfffffffc", + "lane2": "0xfffffff0", + "lane3": "0xffffffe8", + "lane4": "0xffffffe8", + "lane5": "0xffffffe8", + "lane6": "0xffffffe8", + "lane7": "0xfffffff4" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe8", + "lane2": "0xffffffe8", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe8" + }, + "pre2":{ + "lane0": "0x00000004", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000000" + } + }, + "QSFP-DD-sm_media_interface":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x00000088", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + }, + "pre1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + } + }, + "QSFP-DD-active_cable_media_interface":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x00000088", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + }, + "pre1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + } + }, + "QSFP28-40GBASE-CR4-1.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-2.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-3.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-5.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-*":{ + "main":{ + "lane0": "0x00000044", + "lane1": "0x00000044", + "lane2": "0x00000046", + "lane3": "0x00000040", + "lane4": "0x00000044", + "lane5": "0x00000044", + "lane6": "0x00000046", + "lane7": "0x00000040" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff4", + "lane2": "0xfffffff0", + "lane3": "0xfffffff4", + "lane4": "0xfffffff0", + "lane5": "0xfffffff4", + "lane6": "0xfffffff0", + "lane7": "0xfffffff4" + }, + "pre1":{ + "lane0": "0xfffffffc", + "lane1": "0xfffffffc", + "lane2": "0xfffffffc", + "lane3": "0xfffffffc", + "lane4": "0xfffffffc", + "lane5": "0xfffffffc", + "lane6": "0xfffffffc", + "lane7": "0xfffffffc" + } + }, + "QSFP+-40GBASE-CR4-1.0M":{ + "main":{ + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-2.0M":{ + "main":{ + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-3.0M":{ + "main":{ + "lane0": "0x0000003c", + "lane1": "0x0000003c", + "lane2": "0x0000003c", + "lane3": "0x0000003c", + "lane4": "0x0000003c", + "lane5": "0x0000003c", + "lane6": "0x0000003c", + "lane7": "0x0000003c" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-5.0M":{ + "main":{ + "lane0": "0x00000057", + "lane1": "0x00000057", + "lane2": "0x00000057", + "lane3": "0x00000057", + "lane4": "0x00000057", + "lane5": "0x00000057", + "lane6": "0x00000057", + "lane7": "0x00000057" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0xfffffffa", + "lane1": "0xfffffffa", + "lane2": "0xfffffffa", + "lane3": "0xfffffffa", + "lane4": "0xfffffffa", + "lane5": "0xfffffffa", + "lane6": "0xfffffffa", + "lane7": "0xfffffffa" + } + }, + "QSFP+-40GBASE-CR4-7.0M":{ + "main":{ + "lane0": "0x00000057", + "lane1": "0x00000057", + "lane2": "0x00000057", + "lane3": "0x00000057", + "lane4": "0x00000057", + "lane5": "0x00000057", + "lane6": "0x00000057", + "lane7": "0x00000057" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0xfffffffa", + "lane1": "0xfffffffa", + "lane2": "0xfffffffa", + "lane3": "0xfffffffa", + "lane4": "0xfffffffa", + "lane5": "0xfffffffa", + "lane6": "0xfffffffa", + "lane7": "0xfffffffa" + } + }, + "QSFP+-*":{ + "main":{ + "lane0": "0x00000046", + "lane1": "0x00000046", + "lane2": "0x00000046", + "lane3": "0x00000046", + "lane4": "0x00000046", + "lane5": "0x00000046", + "lane6": "0x00000046", + "lane7": "0x00000046" + }, + "post1":{ + "lane0": "0xfffffff4", + "lane1": "0xfffffff4", + "lane2": "0xfffffff4", + "lane3": "0xfffffff4", + "lane4": "0xfffffff4", + "lane5": "0xfffffff4", + "lane6": "0xfffffff4", + "lane7": "0xfffffff4" + }, + "pre1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + } + } + }, + "12":{ + "QSFP-DD-passive_copper_media_interface-1.0M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-1.5M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-0.5M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-2.0M":{ + "main":{ + "lane0": "0x00000070", + "lane1": "0x0000008c", + "lane2": "0x00000080", + "lane3": "0x00000070", + "lane4": "0x00000070", + "lane5": "0x00000070", + "lane6": "0x00000070", + "lane7": "0x00000084" + }, + "post1":{ + "lane0": "0xffffffe8", + "lane1": "0xfffffffc", + "lane2": "0xfffffff0", + "lane3": "0xffffffe8", + "lane4": "0xffffffe8", + "lane5": "0xffffffe8", + "lane6": "0xffffffe8", + "lane7": "0xfffffff4" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe8", + "lane2": "0xffffffe8", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe8" + }, + "pre2":{ + "lane0": "0x00000004", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000000" + } + }, + "QSFP-DD-sm_media_interface":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x00000088", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + }, + "pre1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + } + }, + "QSFP-DD-active_cable_media_interface":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x00000088", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + }, + "pre1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + } + }, + "QSFP28-40GBASE-CR4-1.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-2.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-3.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-5.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-*":{ + "main":{ + "lane0": "0x00000040", + "lane1": "0x00000044", + "lane2": "0x0000003a", + "lane3": "0x0000003c", + "lane4": "0x00000040", + "lane5": "0x00000044", + "lane6": "0x0000003a", + "lane7": "0x0000003c" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff6", + "lane3": "0xfffffff4", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff6", + "lane7": "0xfffffff4" + }, + "pre1":{ + "lane0": "0xfffffffc", + "lane1": "0xfffffffc", + "lane2": "0xfffffffc", + "lane3": "0xfffffffc", + "lane4": "0xfffffffc", + "lane5": "0xfffffffc", + "lane6": "0xfffffffc", + "lane7": "0xfffffffc" + } + }, + "QSFP+-40GBASE-CR4-1.0M":{ + "main":{ + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-2.0M":{ + "main":{ + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-3.0M":{ + "main":{ + "lane0": "0x0000003c", + "lane1": "0x0000003c", + "lane2": "0x0000003c", + "lane3": "0x0000003c", + "lane4": "0x0000003c", + "lane5": "0x0000003c", + "lane6": "0x0000003c", + "lane7": "0x0000003c" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-5.0M":{ + "main":{ + "lane0": "0x00000057", + "lane1": "0x00000057", + "lane2": "0x00000057", + "lane3": "0x00000057", + "lane4": "0x00000057", + "lane5": "0x00000057", + "lane6": "0x00000057", + "lane7": "0x00000057" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0xfffffffa", + "lane1": "0xfffffffa", + "lane2": "0xfffffffa", + "lane3": "0xfffffffa", + "lane4": "0xfffffffa", + "lane5": "0xfffffffa", + "lane6": "0xfffffffa", + "lane7": "0xfffffffa" + } + }, + "QSFP+-40GBASE-CR4-7.0M":{ + "main":{ + "lane0": "0x00000057", + "lane1": "0x00000057", + "lane2": "0x00000057", + "lane3": "0x00000057", + "lane4": "0x00000057", + "lane5": "0x00000057", + "lane6": "0x00000057", + "lane7": "0x00000057" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0xfffffffa", + "lane1": "0xfffffffa", + "lane2": "0xfffffffa", + "lane3": "0xfffffffa", + "lane4": "0xfffffffa", + "lane5": "0xfffffffa", + "lane6": "0xfffffffa", + "lane7": "0xfffffffa" + } + }, + "QSFP+-*":{ + "main":{ + "lane0": "0x00000046", + "lane1": "0x00000046", + "lane2": "0x00000046", + "lane3": "0x00000046", + "lane4": "0x00000046", + "lane5": "0x00000046", + "lane6": "0x00000046", + "lane7": "0x00000046" + }, + "post1":{ + "lane0": "0xfffffff4", + "lane1": "0xfffffff4", + "lane2": "0xfffffff4", + "lane3": "0xfffffff4", + "lane4": "0xfffffff4", + "lane5": "0xfffffff4", + "lane6": "0xfffffff4", + "lane7": "0xfffffff4" + }, + "pre1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + } + } + }, + "13":{ + "QSFP-DD-passive_copper_media_interface-1.0M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-1.5M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-0.5M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-2.0M":{ + "main":{ + "lane0": "0x00000070", + "lane1": "0x0000008c", + "lane2": "0x00000080", + "lane3": "0x00000070", + "lane4": "0x00000070", + "lane5": "0x00000070", + "lane6": "0x00000070", + "lane7": "0x00000084" + }, + "post1":{ + "lane0": "0xffffffe8", + "lane1": "0xfffffffc", + "lane2": "0xfffffff0", + "lane3": "0xffffffe8", + "lane4": "0xffffffe8", + "lane5": "0xffffffe8", + "lane6": "0xffffffe8", + "lane7": "0xfffffff4" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe8", + "lane2": "0xffffffe8", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe8" + }, + "pre2":{ + "lane0": "0x00000004", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000000" + } + }, + "QSFP-DD-sm_media_interface":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x00000088", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + }, + "pre1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + } + }, + "QSFP-DD-active_cable_media_interface":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x00000088", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + }, + "pre1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + } + }, + "QSFP28-40GBASE-CR4-1.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-2.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-3.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-5.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-*":{ + "main":{ + "lane0": "0x0000003c", + "lane1": "0x0000003a", + "lane2": "0x00000036", + "lane3": "0x0000003a", + "lane4": "0x0000003c", + "lane5": "0x0000003a", + "lane6": "0x00000036", + "lane7": "0x0000003a" + }, + "post1":{ + "lane0": "0xfffffff8", + "lane1": "0xfffffff6", + "lane2": "0xfffffff8", + "lane3": "0xfffffff6", + "lane4": "0xfffffff8", + "lane5": "0xfffffff6", + "lane6": "0xfffffff8", + "lane7": "0xfffffff6" + }, + "pre1":{ + "lane0": "0xfffffffc", + "lane1": "0xfffffffc", + "lane2": "0xfffffffc", + "lane3": "0xfffffffc", + "lane4": "0xfffffffc", + "lane5": "0xfffffffc", + "lane6": "0xfffffffc", + "lane7": "0xfffffffc" + } + }, + "QSFP+-40GBASE-CR4-1.0M":{ + "main":{ + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-2.0M":{ + "main":{ + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-3.0M":{ + "main":{ + "lane0": "0x0000003c", + "lane1": "0x0000003c", + "lane2": "0x0000003c", + "lane3": "0x0000003c", + "lane4": "0x0000003c", + "lane5": "0x0000003c", + "lane6": "0x0000003c", + "lane7": "0x0000003c" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-5.0M":{ + "main":{ + "lane0": "0x00000057", + "lane1": "0x00000057", + "lane2": "0x00000057", + "lane3": "0x00000057", + "lane4": "0x00000057", + "lane5": "0x00000057", + "lane6": "0x00000057", + "lane7": "0x00000057" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0xfffffffa", + "lane1": "0xfffffffa", + "lane2": "0xfffffffa", + "lane3": "0xfffffffa", + "lane4": "0xfffffffa", + "lane5": "0xfffffffa", + "lane6": "0xfffffffa", + "lane7": "0xfffffffa" + } + }, + "QSFP+-40GBASE-CR4-7.0M":{ + "main":{ + "lane0": "0x00000057", + "lane1": "0x00000057", + "lane2": "0x00000057", + "lane3": "0x00000057", + "lane4": "0x00000057", + "lane5": "0x00000057", + "lane6": "0x00000057", + "lane7": "0x00000057" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0xfffffffa", + "lane1": "0xfffffffa", + "lane2": "0xfffffffa", + "lane3": "0xfffffffa", + "lane4": "0xfffffffa", + "lane5": "0xfffffffa", + "lane6": "0xfffffffa", + "lane7": "0xfffffffa" + } + }, + "QSFP+-*":{ + "main":{ + "lane0": "0x00000044", + "lane1": "0x00000044", + "lane2": "0x00000044", + "lane3": "0x00000044", + "lane4": "0x00000044", + "lane5": "0x00000044", + "lane6": "0x00000044", + "lane7": "0x00000044" + }, + "post1":{ + "lane0": "0xfffffff8", + "lane1": "0xfffffff8", + "lane2": "0xfffffff8", + "lane3": "0xfffffff8", + "lane4": "0xfffffff8", + "lane5": "0xfffffff8", + "lane6": "0xfffffff8", + "lane7": "0xfffffff8" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + } + }, + "14":{ + "QSFP-DD-passive_copper_media_interface-1.0M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-1.5M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-0.5M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-2.0M":{ + "main":{ + "lane0": "0x00000070", + "lane1": "0x0000008c", + "lane2": "0x00000080", + "lane3": "0x00000070", + "lane4": "0x00000070", + "lane5": "0x00000070", + "lane6": "0x00000070", + "lane7": "0x00000084" + }, + "post1":{ + "lane0": "0xffffffe8", + "lane1": "0xfffffffc", + "lane2": "0xfffffff0", + "lane3": "0xffffffe8", + "lane4": "0xffffffe8", + "lane5": "0xffffffe8", + "lane6": "0xffffffe8", + "lane7": "0xfffffff4" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe8", + "lane2": "0xffffffe8", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe8" + }, + "pre2":{ + "lane0": "0x00000004", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000000" + } + }, + "QSFP-DD-sm_media_interface":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x00000088", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + }, + "pre1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + } + }, + "QSFP-DD-active_cable_media_interface":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x00000088", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + }, + "pre1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + } + }, + "QSFP28-40GBASE-CR4-1.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-2.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-3.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-5.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-*":{ + "main":{ + "lane0": "0x00000032", + "lane1": "0x00000040", + "lane2": "0x00000034", + "lane3": "0x00000032", + "lane4": "0x00000032", + "lane5": "0x00000040", + "lane6": "0x00000034", + "lane7": "0x00000032" + }, + "post1":{ + "lane0": "0xfffffffc", + "lane1": "0xfffffff8", + "lane2": "0xfffffff8", + "lane3": "0xfffffffc", + "lane4": "0xfffffffc", + "lane5": "0xfffffff8", + "lane6": "0xfffffff8", + "lane7": "0xfffffffc" + }, + "pre1":{ + "lane0": "0xfffffffc", + "lane1": "0xfffffffc", + "lane2": "0xfffffffc", + "lane3": "0xfffffffc", + "lane4": "0xfffffffc", + "lane5": "0xfffffffc", + "lane6": "0xfffffffc", + "lane7": "0xfffffffc" + } + }, + "QSFP+-40GBASE-CR4-1.0M":{ + "main":{ + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-2.0M":{ + "main":{ + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-3.0M":{ + "main":{ + "lane0": "0x0000003c", + "lane1": "0x0000003c", + "lane2": "0x0000003c", + "lane3": "0x0000003c", + "lane4": "0x0000003c", + "lane5": "0x0000003c", + "lane6": "0x0000003c", + "lane7": "0x0000003c" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-5.0M":{ + "main":{ + "lane0": "0x00000057", + "lane1": "0x00000057", + "lane2": "0x00000057", + "lane3": "0x00000057", + "lane4": "0x00000057", + "lane5": "0x00000057", + "lane6": "0x00000057", + "lane7": "0x00000057" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0xfffffffa", + "lane1": "0xfffffffa", + "lane2": "0xfffffffa", + "lane3": "0xfffffffa", + "lane4": "0xfffffffa", + "lane5": "0xfffffffa", + "lane6": "0xfffffffa", + "lane7": "0xfffffffa" + } + }, + "QSFP+-40GBASE-CR4-7.0M":{ + "main":{ + "lane0": "0x00000057", + "lane1": "0x00000057", + "lane2": "0x00000057", + "lane3": "0x00000057", + "lane4": "0x00000057", + "lane5": "0x00000057", + "lane6": "0x00000057", + "lane7": "0x00000057" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0xfffffffa", + "lane1": "0xfffffffa", + "lane2": "0xfffffffa", + "lane3": "0xfffffffa", + "lane4": "0xfffffffa", + "lane5": "0xfffffffa", + "lane6": "0xfffffffa", + "lane7": "0xfffffffa" + } + }, + "QSFP+-*":{ + "main":{ + "lane0": "0x00000044", + "lane1": "0x00000044", + "lane2": "0x00000044", + "lane3": "0x00000044", + "lane4": "0x00000044", + "lane5": "0x00000044", + "lane6": "0x00000044", + "lane7": "0x00000044" + }, + "post1":{ + "lane0": "0xfffffff8", + "lane1": "0xfffffff8", + "lane2": "0xfffffff8", + "lane3": "0xfffffff8", + "lane4": "0xfffffff8", + "lane5": "0xfffffff8", + "lane6": "0xfffffff8", + "lane7": "0xfffffff8" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + } + }, + "15":{ + "QSFP-DD-passive_copper_media_interface-1.0M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-1.5M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-0.5M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-2.0M":{ + "main":{ + "lane0": "0x00000070", + "lane1": "0x0000008c", + "lane2": "0x00000080", + "lane3": "0x00000070", + "lane4": "0x00000070", + "lane5": "0x00000070", + "lane6": "0x00000070", + "lane7": "0x00000084" + }, + "post1":{ + "lane0": "0xffffffe8", + "lane1": "0xfffffffc", + "lane2": "0xfffffff0", + "lane3": "0xffffffe8", + "lane4": "0xffffffe8", + "lane5": "0xffffffe8", + "lane6": "0xffffffe8", + "lane7": "0xfffffff4" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe8", + "lane2": "0xffffffe8", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe8" + }, + "pre2":{ + "lane0": "0x00000004", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000000" + } + }, + "QSFP-DD-sm_media_interface":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x00000088", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + }, + "pre1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + } + }, + "QSFP-DD-active_cable_media_interface":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x00000088", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + }, + "pre1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + } + }, + "QSFP28-40GBASE-CR4-1.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-2.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-3.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-5.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-*":{ + "main":{ + "lane0": "0x00000032", + "lane1": "0x00000034", + "lane2": "0x00000030", + "lane3": "0x00000032", + "lane4": "0x00000032", + "lane5": "0x00000034", + "lane6": "0x00000030", + "lane7": "0x00000032" + }, + "post1":{ + "lane0": "0xfffffffc", + "lane1": "0xfffffffc", + "lane2": "0xfffffffc", + "lane3": "0xfffffffc", + "lane4": "0xfffffffc", + "lane5": "0xfffffffc", + "lane6": "0xfffffffc", + "lane7": "0xfffffffc" + }, + "pre1":{ + "lane0": "0xfffffffc", + "lane1": "0xfffffffc", + "lane2": "0xfffffffc", + "lane3": "0xfffffffc", + "lane4": "0xfffffffc", + "lane5": "0xfffffffc", + "lane6": "0xfffffffc", + "lane7": "0xfffffffc" + } + }, + "QSFP+-40GBASE-CR4-1.0M":{ + "main":{ + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-2.0M":{ + "main":{ + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-3.0M":{ + "main":{ + "lane0": "0x0000003c", + "lane1": "0x0000003c", + "lane2": "0x0000003c", + "lane3": "0x0000003c", + "lane4": "0x0000003c", + "lane5": "0x0000003c", + "lane6": "0x0000003c", + "lane7": "0x0000003c" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-5.0M":{ + "main":{ + "lane0": "0x00000057", + "lane1": "0x00000057", + "lane2": "0x00000057", + "lane3": "0x00000057", + "lane4": "0x00000057", + "lane5": "0x00000057", + "lane6": "0x00000057", + "lane7": "0x00000057" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0xfffffffa", + "lane1": "0xfffffffa", + "lane2": "0xfffffffa", + "lane3": "0xfffffffa", + "lane4": "0xfffffffa", + "lane5": "0xfffffffa", + "lane6": "0xfffffffa", + "lane7": "0xfffffffa" + } + }, + "QSFP+-40GBASE-CR4-7.0M":{ + "main":{ + "lane0": "0x00000057", + "lane1": "0x00000057", + "lane2": "0x00000057", + "lane3": "0x00000057", + "lane4": "0x00000057", + "lane5": "0x00000057", + "lane6": "0x00000057", + "lane7": "0x00000057" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0xfffffffa", + "lane1": "0xfffffffa", + "lane2": "0xfffffffa", + "lane3": "0xfffffffa", + "lane4": "0xfffffffa", + "lane5": "0xfffffffa", + "lane6": "0xfffffffa", + "lane7": "0xfffffffa" + } + }, + "QSFP+-*":{ + "main":{ + "lane0": "0x00000044", + "lane1": "0x00000044", + "lane2": "0x00000044", + "lane3": "0x00000044", + "lane4": "0x00000044", + "lane5": "0x00000044", + "lane6": "0x00000044", + "lane7": "0x00000044" + }, + "post1":{ + "lane0": "0xfffffff8", + "lane1": "0xfffffff8", + "lane2": "0xfffffff8", + "lane3": "0xfffffff8", + "lane4": "0xfffffff8", + "lane5": "0xfffffff8", + "lane6": "0xfffffff8", + "lane7": "0xfffffff8" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + } + }, + "16":{ + "QSFP-DD-passive_copper_media_interface-1.0M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-1.5M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-0.5M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-2.0M":{ + "main":{ + "lane0": "0x00000070", + "lane1": "0x0000008c", + "lane2": "0x00000080", + "lane3": "0x00000070", + "lane4": "0x00000070", + "lane5": "0x00000070", + "lane6": "0x00000070", + "lane7": "0x00000084" + }, + "post1":{ + "lane0": "0xffffffe8", + "lane1": "0xfffffffc", + "lane2": "0xfffffff0", + "lane3": "0xffffffe8", + "lane4": "0xffffffe8", + "lane5": "0xffffffe8", + "lane6": "0xffffffe8", + "lane7": "0xfffffff4" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe8", + "lane2": "0xffffffe8", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe8" + }, + "pre2":{ + "lane0": "0x00000004", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000000" + } + }, + "QSFP-DD-sm_media_interface":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x00000088", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + }, + "pre1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + } + }, + "QSFP-DD-active_cable_media_interface":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x00000088", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + }, + "pre1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + } + }, + "QSFP28-40GBASE-CR4-1.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-2.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-3.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-5.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-*":{ + "main":{ + "lane0": "0x00000030", + "lane1": "0x00000032", + "lane2": "0x0000002c", + "lane3": "0x0000002c", + "lane4": "0x00000030", + "lane5": "0x00000032", + "lane6": "0x0000002c", + "lane7": "0x0000002c" + }, + "post1":{ + "lane0": "0xfffffffc", + "lane1": "0xfffffffc", + "lane2": "0xfffffffc", + "lane3": "0xfffffffc", + "lane4": "0xfffffffc", + "lane5": "0xfffffffc", + "lane6": "0xfffffffc", + "lane7": "0xfffffffc" + }, + "pre1":{ + "lane0": "0xfffffffc", + "lane1": "0xfffffffc", + "lane2": "0xfffffffc", + "lane3": "0xfffffffc", + "lane4": "0xfffffffc", + "lane5": "0xfffffffc", + "lane6": "0xfffffffc", + "lane7": "0xfffffffc" + } + }, + "QSFP+-40GBASE-CR4-1.0M":{ + "main":{ + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-2.0M":{ + "main":{ + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-3.0M":{ + "main":{ + "lane0": "0x0000003c", + "lane1": "0x0000003c", + "lane2": "0x0000003c", + "lane3": "0x0000003c", + "lane4": "0x0000003c", + "lane5": "0x0000003c", + "lane6": "0x0000003c", + "lane7": "0x0000003c" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-5.0M":{ + "main":{ + "lane0": "0x00000057", + "lane1": "0x00000057", + "lane2": "0x00000057", + "lane3": "0x00000057", + "lane4": "0x00000057", + "lane5": "0x00000057", + "lane6": "0x00000057", + "lane7": "0x00000057" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0xfffffffa", + "lane1": "0xfffffffa", + "lane2": "0xfffffffa", + "lane3": "0xfffffffa", + "lane4": "0xfffffffa", + "lane5": "0xfffffffa", + "lane6": "0xfffffffa", + "lane7": "0xfffffffa" + } + }, + "QSFP+-40GBASE-CR4-7.0M":{ + "main":{ + "lane0": "0x00000057", + "lane1": "0x00000057", + "lane2": "0x00000057", + "lane3": "0x00000057", + "lane4": "0x00000057", + "lane5": "0x00000057", + "lane6": "0x00000057", + "lane7": "0x00000057" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0xfffffffa", + "lane1": "0xfffffffa", + "lane2": "0xfffffffa", + "lane3": "0xfffffffa", + "lane4": "0xfffffffa", + "lane5": "0xfffffffa", + "lane6": "0xfffffffa", + "lane7": "0xfffffffa" + } + }, + "QSFP+-*":{ + "main":{ + "lane0": "0x00000044", + "lane1": "0x00000044", + "lane2": "0x00000044", + "lane3": "0x00000044", + "lane4": "0x00000044", + "lane5": "0x00000044", + "lane6": "0x00000044", + "lane7": "0x00000044" + }, + "post1":{ + "lane0": "0xfffffff8", + "lane1": "0xfffffff8", + "lane2": "0xfffffff8", + "lane3": "0xfffffff8", + "lane4": "0xfffffff8", + "lane5": "0xfffffff8", + "lane6": "0xfffffff8", + "lane7": "0xfffffff8" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + } + }, + "17":{ + "QSFP-DD-passive_copper_media_interface-1.0M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-1.5M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-0.5M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-2.0M":{ + "main":{ + "lane0": "0x00000070", + "lane1": "0x0000008c", + "lane2": "0x00000080", + "lane3": "0x00000070", + "lane4": "0x00000070", + "lane5": "0x00000070", + "lane6": "0x00000070", + "lane7": "0x00000084" + }, + "post1":{ + "lane0": "0xffffffe8", + "lane1": "0xfffffffc", + "lane2": "0xfffffff0", + "lane3": "0xffffffe8", + "lane4": "0xffffffe8", + "lane5": "0xffffffe8", + "lane6": "0xffffffe8", + "lane7": "0xfffffff4" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe8", + "lane2": "0xffffffe8", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe8" + }, + "pre2":{ + "lane0": "0x00000004", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000000" + } + }, + "QSFP-DD-sm_media_interface":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x00000088", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + }, + "pre1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + } + }, + "QSFP-DD-active_cable_media_interface":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x00000088", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + }, + "pre1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + } + }, + "QSFP28-40GBASE-CR4-1.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-2.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-3.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-5.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-*":{ + "main":{ + "lane0": "0x00000036", + "lane1": "0x00000032", + "lane2": "0x00000030", + "lane3": "0x00000030", + "lane4": "0x00000036", + "lane5": "0x00000032", + "lane6": "0x00000030", + "lane7": "0x00000030" + }, + "post1":{ + "lane0": "0xfffffffc", + "lane1": "0xfffffffc", + "lane2": "0xfffffffc", + "lane3": "0xfffffffc", + "lane4": "0xfffffffc", + "lane5": "0xfffffffc", + "lane6": "0xfffffffc", + "lane7": "0xfffffffc" + }, + "pre1":{ + "lane0": "0xfffffffc", + "lane1": "0xfffffffc", + "lane2": "0xfffffffc", + "lane3": "0xfffffffc", + "lane4": "0xfffffffc", + "lane5": "0xfffffffc", + "lane6": "0xfffffffc", + "lane7": "0xfffffffc" + } + }, + "QSFP+-40GBASE-CR4-1.0M":{ + "main":{ + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-2.0M":{ + "main":{ + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-3.0M":{ + "main":{ + "lane0": "0x0000003c", + "lane1": "0x0000003c", + "lane2": "0x0000003c", + "lane3": "0x0000003c", + "lane4": "0x0000003c", + "lane5": "0x0000003c", + "lane6": "0x0000003c", + "lane7": "0x0000003c" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-5.0M":{ + "main":{ + "lane0": "0x00000057", + "lane1": "0x00000057", + "lane2": "0x00000057", + "lane3": "0x00000057", + "lane4": "0x00000057", + "lane5": "0x00000057", + "lane6": "0x00000057", + "lane7": "0x00000057" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0xfffffffa", + "lane1": "0xfffffffa", + "lane2": "0xfffffffa", + "lane3": "0xfffffffa", + "lane4": "0xfffffffa", + "lane5": "0xfffffffa", + "lane6": "0xfffffffa", + "lane7": "0xfffffffa" + } + }, + "QSFP+-40GBASE-CR4-7.0M":{ + "main":{ + "lane0": "0x00000057", + "lane1": "0x00000057", + "lane2": "0x00000057", + "lane3": "0x00000057", + "lane4": "0x00000057", + "lane5": "0x00000057", + "lane6": "0x00000057", + "lane7": "0x00000057" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0xfffffffa", + "lane1": "0xfffffffa", + "lane2": "0xfffffffa", + "lane3": "0xfffffffa", + "lane4": "0xfffffffa", + "lane5": "0xfffffffa", + "lane6": "0xfffffffa", + "lane7": "0xfffffffa" + } + }, + "QSFP+-*":{ + "main":{ + "lane0": "0x00000044", + "lane1": "0x00000044", + "lane2": "0x00000044", + "lane3": "0x00000044", + "lane4": "0x00000044", + "lane5": "0x00000044", + "lane6": "0x00000044", + "lane7": "0x00000044" + }, + "post1":{ + "lane0": "0xfffffff8", + "lane1": "0xfffffff8", + "lane2": "0xfffffff8", + "lane3": "0xfffffff8", + "lane4": "0xfffffff8", + "lane5": "0xfffffff8", + "lane6": "0xfffffff8", + "lane7": "0xfffffff8" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + } + }, + "18":{ + "QSFP-DD-passive_copper_media_interface-1.0M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-1.5M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-0.5M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-2.0M":{ + "main":{ + "lane0": "0x00000070", + "lane1": "0x0000008c", + "lane2": "0x00000080", + "lane3": "0x00000070", + "lane4": "0x00000070", + "lane5": "0x00000070", + "lane6": "0x00000070", + "lane7": "0x00000084" + }, + "post1":{ + "lane0": "0xffffffe8", + "lane1": "0xfffffffc", + "lane2": "0xfffffff0", + "lane3": "0xffffffe8", + "lane4": "0xffffffe8", + "lane5": "0xffffffe8", + "lane6": "0xffffffe8", + "lane7": "0xfffffff4" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe8", + "lane2": "0xffffffe8", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe8" + }, + "pre2":{ + "lane0": "0x00000004", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000000" + } + }, + "QSFP-DD-sm_media_interface":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x00000088", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + }, + "pre1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + } + }, + "QSFP-DD-active_cable_media_interface":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x00000088", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + }, + "pre1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + } + }, + "QSFP28-40GBASE-CR4-1.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-2.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-3.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-5.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-*":{ + "main":{ + "lane0": "0x00000030", + "lane1": "0x00000036", + "lane2": "0x00000032", + "lane3": "0x00000032", + "lane4": "0x00000030", + "lane5": "0x00000036", + "lane6": "0x00000032", + "lane7": "0x00000032" + }, + "post1":{ + "lane0": "0xfffffffc", + "lane1": "0xfffffffc", + "lane2": "0xfffffffc", + "lane3": "0xfffffffc", + "lane4": "0xfffffffc", + "lane5": "0xfffffffc", + "lane6": "0xfffffffc", + "lane7": "0xfffffffc" + }, + "pre1":{ + "lane0": "0xfffffffc", + "lane1": "0xfffffffc", + "lane2": "0xfffffffc", + "lane3": "0xfffffffc", + "lane4": "0xfffffffc", + "lane5": "0xfffffffc", + "lane6": "0xfffffffc", + "lane7": "0xfffffffc" + } + }, + "QSFP+-40GBASE-CR4-1.0M":{ + "main":{ + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-2.0M":{ + "main":{ + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-3.0M":{ + "main":{ + "lane0": "0x0000003c", + "lane1": "0x0000003c", + "lane2": "0x0000003c", + "lane3": "0x0000003c", + "lane4": "0x0000003c", + "lane5": "0x0000003c", + "lane6": "0x0000003c", + "lane7": "0x0000003c" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-5.0M":{ + "main":{ + "lane0": "0x00000057", + "lane1": "0x00000057", + "lane2": "0x00000057", + "lane3": "0x00000057", + "lane4": "0x00000057", + "lane5": "0x00000057", + "lane6": "0x00000057", + "lane7": "0x00000057" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0xfffffffa", + "lane1": "0xfffffffa", + "lane2": "0xfffffffa", + "lane3": "0xfffffffa", + "lane4": "0xfffffffa", + "lane5": "0xfffffffa", + "lane6": "0xfffffffa", + "lane7": "0xfffffffa" + } + }, + "QSFP+-40GBASE-CR4-7.0M":{ + "main":{ + "lane0": "0x00000057", + "lane1": "0x00000057", + "lane2": "0x00000057", + "lane3": "0x00000057", + "lane4": "0x00000057", + "lane5": "0x00000057", + "lane6": "0x00000057", + "lane7": "0x00000057" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0xfffffffa", + "lane1": "0xfffffffa", + "lane2": "0xfffffffa", + "lane3": "0xfffffffa", + "lane4": "0xfffffffa", + "lane5": "0xfffffffa", + "lane6": "0xfffffffa", + "lane7": "0xfffffffa" + } + }, + "QSFP+-*":{ + "main":{ + "lane0": "0x00000044", + "lane1": "0x00000044", + "lane2": "0x00000044", + "lane3": "0x00000044", + "lane4": "0x00000044", + "lane5": "0x00000044", + "lane6": "0x00000044", + "lane7": "0x00000044" + }, + "post1":{ + "lane0": "0xfffffff8", + "lane1": "0xfffffff8", + "lane2": "0xfffffff8", + "lane3": "0xfffffff8", + "lane4": "0xfffffff8", + "lane5": "0xfffffff8", + "lane6": "0xfffffff8", + "lane7": "0xfffffff8" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + } + }, + "19":{ + "QSFP-DD-passive_copper_media_interface-1.0M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-1.5M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-0.5M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-2.0M":{ + "main":{ + "lane0": "0x00000070", + "lane1": "0x0000008c", + "lane2": "0x00000080", + "lane3": "0x00000070", + "lane4": "0x00000070", + "lane5": "0x00000070", + "lane6": "0x00000070", + "lane7": "0x00000084" + }, + "post1":{ + "lane0": "0xffffffe8", + "lane1": "0xfffffffc", + "lane2": "0xfffffff0", + "lane3": "0xffffffe8", + "lane4": "0xffffffe8", + "lane5": "0xffffffe8", + "lane6": "0xffffffe8", + "lane7": "0xfffffff4" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe8", + "lane2": "0xffffffe8", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe8" + }, + "pre2":{ + "lane0": "0x00000004", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000000" + } + }, + "QSFP-DD-sm_media_interface":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x00000088", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + }, + "pre1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + } + }, + "QSFP-DD-active_cable_media_interface":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x00000088", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + }, + "pre1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + } + }, + "QSFP28-40GBASE-CR4-1.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-2.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-3.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-5.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-*":{ + "main":{ + "lane0": "0x00000036", + "lane1": "0x00000038", + "lane2": "0x00000032", + "lane3": "0x00000032", + "lane4": "0x00000036", + "lane5": "0x00000038", + "lane6": "0x00000032", + "lane7": "0x00000032" + }, + "post1":{ + "lane0": "0xfffffffc", + "lane1": "0xfffffffc", + "lane2": "0xfffffffc", + "lane3": "0xfffffffc", + "lane4": "0xfffffffc", + "lane5": "0xfffffffc", + "lane6": "0xfffffffc", + "lane7": "0xfffffffc" + }, + "pre1":{ + "lane0": "0xfffffffc", + "lane1": "0xfffffffc", + "lane2": "0xfffffffc", + "lane3": "0xfffffffc", + "lane4": "0xfffffffc", + "lane5": "0xfffffffc", + "lane6": "0xfffffffc", + "lane7": "0xfffffffc" + } + }, + "QSFP+-40GBASE-CR4-1.0M":{ + "main":{ + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-2.0M":{ + "main":{ + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-3.0M":{ + "main":{ + "lane0": "0x0000003c", + "lane1": "0x0000003c", + "lane2": "0x0000003c", + "lane3": "0x0000003c", + "lane4": "0x0000003c", + "lane5": "0x0000003c", + "lane6": "0x0000003c", + "lane7": "0x0000003c" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-5.0M":{ + "main":{ + "lane0": "0x00000057", + "lane1": "0x00000057", + "lane2": "0x00000057", + "lane3": "0x00000057", + "lane4": "0x00000057", + "lane5": "0x00000057", + "lane6": "0x00000057", + "lane7": "0x00000057" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0xfffffffa", + "lane1": "0xfffffffa", + "lane2": "0xfffffffa", + "lane3": "0xfffffffa", + "lane4": "0xfffffffa", + "lane5": "0xfffffffa", + "lane6": "0xfffffffa", + "lane7": "0xfffffffa" + } + }, + "QSFP+-40GBASE-CR4-7.0M":{ + "main":{ + "lane0": "0x00000057", + "lane1": "0x00000057", + "lane2": "0x00000057", + "lane3": "0x00000057", + "lane4": "0x00000057", + "lane5": "0x00000057", + "lane6": "0x00000057", + "lane7": "0x00000057" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0xfffffffa", + "lane1": "0xfffffffa", + "lane2": "0xfffffffa", + "lane3": "0xfffffffa", + "lane4": "0xfffffffa", + "lane5": "0xfffffffa", + "lane6": "0xfffffffa", + "lane7": "0xfffffffa" + } + }, + "QSFP+-*":{ + "main":{ + "lane0": "0x00000044", + "lane1": "0x00000044", + "lane2": "0x00000044", + "lane3": "0x00000044", + "lane4": "0x00000044", + "lane5": "0x00000044", + "lane6": "0x00000044", + "lane7": "0x00000044" + }, + "post1":{ + "lane0": "0xfffffff8", + "lane1": "0xfffffff8", + "lane2": "0xfffffff8", + "lane3": "0xfffffff8", + "lane4": "0xfffffff8", + "lane5": "0xfffffff8", + "lane6": "0xfffffff8", + "lane7": "0xfffffff8" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + } + }, + "20":{ + "QSFP-DD-passive_copper_media_interface-1.0M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-1.5M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-0.5M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-2.0M":{ + "main":{ + "lane0": "0x00000070", + "lane1": "0x0000008c", + "lane2": "0x00000080", + "lane3": "0x00000070", + "lane4": "0x00000070", + "lane5": "0x00000070", + "lane6": "0x00000070", + "lane7": "0x00000084" + }, + "post1":{ + "lane0": "0xffffffe8", + "lane1": "0xfffffffc", + "lane2": "0xfffffff0", + "lane3": "0xffffffe8", + "lane4": "0xffffffe8", + "lane5": "0xffffffe8", + "lane6": "0xffffffe8", + "lane7": "0xfffffff4" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe8", + "lane2": "0xffffffe8", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe8" + }, + "pre2":{ + "lane0": "0x00000004", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000000" + } + }, + "QSFP-DD-sm_media_interface":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x00000088", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + }, + "pre1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + } + }, + "QSFP-DD-active_cable_media_interface":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x00000088", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + }, + "pre1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + } + }, + "QSFP28-40GBASE-CR4-1.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-2.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-3.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-5.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-*":{ + "main":{ + "lane0": "0x0000003a", + "lane1": "0x0000003a", + "lane2": "0x00000034", + "lane3": "0x00000036", + "lane4": "0x0000003a", + "lane5": "0x0000003a", + "lane6": "0x00000034", + "lane7": "0x00000036" + }, + "post1":{ + "lane0": "0xfffffff6", + "lane1": "0xfffffff6", + "lane2": "0xfffffff8", + "lane3": "0xfffffffc", + "lane4": "0xfffffff6", + "lane5": "0xfffffff6", + "lane6": "0xfffffff8", + "lane7": "0xfffffffc" + }, + "pre1":{ + "lane0": "0xfffffffc", + "lane1": "0xfffffffc", + "lane2": "0xfffffffc", + "lane3": "0xfffffffc", + "lane4": "0xfffffffc", + "lane5": "0xfffffffc", + "lane6": "0xfffffffc", + "lane7": "0xfffffffc" + } + }, + "QSFP+-40GBASE-CR4-1.0M":{ + "main":{ + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-2.0M":{ + "main":{ + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-3.0M":{ + "main":{ + "lane0": "0x0000003c", + "lane1": "0x0000003c", + "lane2": "0x0000003c", + "lane3": "0x0000003c", + "lane4": "0x0000003c", + "lane5": "0x0000003c", + "lane6": "0x0000003c", + "lane7": "0x0000003c" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-5.0M":{ + "main":{ + "lane0": "0x00000057", + "lane1": "0x00000057", + "lane2": "0x00000057", + "lane3": "0x00000057", + "lane4": "0x00000057", + "lane5": "0x00000057", + "lane6": "0x00000057", + "lane7": "0x00000057" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0xfffffffa", + "lane1": "0xfffffffa", + "lane2": "0xfffffffa", + "lane3": "0xfffffffa", + "lane4": "0xfffffffa", + "lane5": "0xfffffffa", + "lane6": "0xfffffffa", + "lane7": "0xfffffffa" + } + }, + "QSFP+-40GBASE-CR4-7.0M":{ + "main":{ + "lane0": "0x00000057", + "lane1": "0x00000057", + "lane2": "0x00000057", + "lane3": "0x00000057", + "lane4": "0x00000057", + "lane5": "0x00000057", + "lane6": "0x00000057", + "lane7": "0x00000057" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0xfffffffa", + "lane1": "0xfffffffa", + "lane2": "0xfffffffa", + "lane3": "0xfffffffa", + "lane4": "0xfffffffa", + "lane5": "0xfffffffa", + "lane6": "0xfffffffa", + "lane7": "0xfffffffa" + } + }, + "QSFP+-*":{ + "main":{ + "lane0": "0x00000044", + "lane1": "0x00000044", + "lane2": "0x00000044", + "lane3": "0x00000044", + "lane4": "0x00000044", + "lane5": "0x00000044", + "lane6": "0x00000044", + "lane7": "0x00000044" + }, + "post1":{ + "lane0": "0xfffffff8", + "lane1": "0xfffffff8", + "lane2": "0xfffffff8", + "lane3": "0xfffffff8", + "lane4": "0xfffffff8", + "lane5": "0xfffffff8", + "lane6": "0xfffffff8", + "lane7": "0xfffffff8" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + } + }, + "21":{ + "QSFP-DD-passive_copper_media_interface-1.0M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-1.5M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-0.5M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-2.0M":{ + "main":{ + "lane0": "0x00000070", + "lane1": "0x0000008c", + "lane2": "0x00000080", + "lane3": "0x00000070", + "lane4": "0x00000070", + "lane5": "0x00000070", + "lane6": "0x00000070", + "lane7": "0x00000084" + }, + "post1":{ + "lane0": "0xffffffe8", + "lane1": "0xfffffffc", + "lane2": "0xfffffff0", + "lane3": "0xffffffe8", + "lane4": "0xffffffe8", + "lane5": "0xffffffe8", + "lane6": "0xffffffe8", + "lane7": "0xfffffff4" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe8", + "lane2": "0xffffffe8", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe8" + }, + "pre2":{ + "lane0": "0x00000004", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000000" + } + }, + "QSFP-DD-sm_media_interface":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x00000088", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + }, + "pre1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + } + }, + "QSFP-DD-active_cable_media_interface":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x00000088", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + }, + "pre1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + } + }, + "QSFP28-40GBASE-CR4-1.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-2.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-3.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-5.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-*":{ + "main":{ + "lane0": "0x00000048", + "lane1": "0x00000044", + "lane2": "0x00000044", + "lane3": "0x00000040", + "lane4": "0x00000048", + "lane5": "0x00000044", + "lane6": "0x00000044", + "lane7": "0x00000040" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff4", + "lane3": "0xfffffff6", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff4", + "lane7": "0xfffffff6" + }, + "pre1":{ + "lane0": "0xfffffffc", + "lane1": "0xfffffffc", + "lane2": "0xfffffffc", + "lane3": "0xfffffffc", + "lane4": "0xfffffffc", + "lane5": "0xfffffffc", + "lane6": "0xfffffffc", + "lane7": "0xfffffffc" + } + }, + "QSFP+-40GBASE-CR4-1.0M":{ + "main":{ + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-2.0M":{ + "main":{ + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-3.0M":{ + "main":{ + "lane0": "0x0000003c", + "lane1": "0x0000003c", + "lane2": "0x0000003c", + "lane3": "0x0000003c", + "lane4": "0x0000003c", + "lane5": "0x0000003c", + "lane6": "0x0000003c", + "lane7": "0x0000003c" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-5.0M":{ + "main":{ + "lane0": "0x00000057", + "lane1": "0x00000057", + "lane2": "0x00000057", + "lane3": "0x00000057", + "lane4": "0x00000057", + "lane5": "0x00000057", + "lane6": "0x00000057", + "lane7": "0x00000057" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0xfffffffa", + "lane1": "0xfffffffa", + "lane2": "0xfffffffa", + "lane3": "0xfffffffa", + "lane4": "0xfffffffa", + "lane5": "0xfffffffa", + "lane6": "0xfffffffa", + "lane7": "0xfffffffa" + } + }, + "QSFP+-40GBASE-CR4-7.0M":{ + "main":{ + "lane0": "0x00000057", + "lane1": "0x00000057", + "lane2": "0x00000057", + "lane3": "0x00000057", + "lane4": "0x00000057", + "lane5": "0x00000057", + "lane6": "0x00000057", + "lane7": "0x00000057" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0xfffffffa", + "lane1": "0xfffffffa", + "lane2": "0xfffffffa", + "lane3": "0xfffffffa", + "lane4": "0xfffffffa", + "lane5": "0xfffffffa", + "lane6": "0xfffffffa", + "lane7": "0xfffffffa" + } + }, + "QSFP+-*":{ + "main":{ + "lane0": "0x00000046", + "lane1": "0x00000046", + "lane2": "0x00000046", + "lane3": "0x00000046", + "lane4": "0x00000046", + "lane5": "0x00000046", + "lane6": "0x00000046", + "lane7": "0x00000046" + }, + "post1":{ + "lane0": "0xfffffff4", + "lane1": "0xfffffff4", + "lane2": "0xfffffff4", + "lane3": "0xfffffff4", + "lane4": "0xfffffff4", + "lane5": "0xfffffff4", + "lane6": "0xfffffff4", + "lane7": "0xfffffff4" + }, + "pre1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + } + } + }, + "22":{ + "QSFP-DD-passive_copper_media_interface-1.0M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-1.5M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-0.5M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-2.0M":{ + "main":{ + "lane0": "0x00000070", + "lane1": "0x0000008c", + "lane2": "0x00000080", + "lane3": "0x00000070", + "lane4": "0x00000070", + "lane5": "0x00000070", + "lane6": "0x00000070", + "lane7": "0x00000084" + }, + "post1":{ + "lane0": "0xffffffe8", + "lane1": "0xfffffffc", + "lane2": "0xfffffff0", + "lane3": "0xffffffe8", + "lane4": "0xffffffe8", + "lane5": "0xffffffe8", + "lane6": "0xffffffe8", + "lane7": "0xfffffff4" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe8", + "lane2": "0xffffffe8", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe8" + }, + "pre2":{ + "lane0": "0x00000004", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000000" + } + }, + "QSFP-DD-sm_media_interface":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x00000088", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + }, + "pre1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + } + }, + "QSFP-DD-active_cable_media_interface":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x00000088", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + }, + "pre1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + } + }, + "QSFP28-40GBASE-CR4-1.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-2.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-3.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-5.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-*":{ + "main":{ + "lane0": "0x00000044", + "lane1": "0x00000044", + "lane2": "0x00000042", + "lane3": "0x00000044", + "lane4": "0x00000044", + "lane5": "0x00000044", + "lane6": "0x00000042", + "lane7": "0x00000044" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + }, + "pre1":{ + "lane0": "0xfffffffc", + "lane1": "0xfffffffc", + "lane2": "0xfffffffc", + "lane3": "0xfffffffc", + "lane4": "0xfffffffc", + "lane5": "0xfffffffc", + "lane6": "0xfffffffc", + "lane7": "0xfffffffc" + } + }, + "QSFP+-40GBASE-CR4-1.0M":{ + "main":{ + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-2.0M":{ + "main":{ + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-3.0M":{ + "main":{ + "lane0": "0x0000003c", + "lane1": "0x0000003c", + "lane2": "0x0000003c", + "lane3": "0x0000003c", + "lane4": "0x0000003c", + "lane5": "0x0000003c", + "lane6": "0x0000003c", + "lane7": "0x0000003c" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-5.0M":{ + "main":{ + "lane0": "0x00000057", + "lane1": "0x00000057", + "lane2": "0x00000057", + "lane3": "0x00000057", + "lane4": "0x00000057", + "lane5": "0x00000057", + "lane6": "0x00000057", + "lane7": "0x00000057" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0xfffffffa", + "lane1": "0xfffffffa", + "lane2": "0xfffffffa", + "lane3": "0xfffffffa", + "lane4": "0xfffffffa", + "lane5": "0xfffffffa", + "lane6": "0xfffffffa", + "lane7": "0xfffffffa" + } + }, + "QSFP+-40GBASE-CR4-7.0M":{ + "main":{ + "lane0": "0x00000057", + "lane1": "0x00000057", + "lane2": "0x00000057", + "lane3": "0x00000057", + "lane4": "0x00000057", + "lane5": "0x00000057", + "lane6": "0x00000057", + "lane7": "0x00000057" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0xfffffffa", + "lane1": "0xfffffffa", + "lane2": "0xfffffffa", + "lane3": "0xfffffffa", + "lane4": "0xfffffffa", + "lane5": "0xfffffffa", + "lane6": "0xfffffffa", + "lane7": "0xfffffffa" + } + }, + "QSFP+-*":{ + "main":{ + "lane0": "0x00000046", + "lane1": "0x00000046", + "lane2": "0x00000046", + "lane3": "0x00000046", + "lane4": "0x00000046", + "lane5": "0x00000046", + "lane6": "0x00000046", + "lane7": "0x00000046" + }, + "post1":{ + "lane0": "0xfffffff4", + "lane1": "0xfffffff4", + "lane2": "0xfffffff4", + "lane3": "0xfffffff4", + "lane4": "0xfffffff4", + "lane5": "0xfffffff4", + "lane6": "0xfffffff4", + "lane7": "0xfffffff4" + }, + "pre1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + } + } + }, + "23":{ + "QSFP-DD-passive_copper_media_interface-1.0M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-1.5M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-0.5M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-2.0M":{ + "main":{ + "lane0": "0x00000070", + "lane1": "0x0000008c", + "lane2": "0x00000080", + "lane3": "0x00000070", + "lane4": "0x00000070", + "lane5": "0x00000070", + "lane6": "0x00000070", + "lane7": "0x00000084" + }, + "post1":{ + "lane0": "0xffffffe8", + "lane1": "0xfffffffc", + "lane2": "0xfffffff0", + "lane3": "0xffffffe8", + "lane4": "0xffffffe8", + "lane5": "0xffffffe8", + "lane6": "0xffffffe8", + "lane7": "0xfffffff4" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe8", + "lane2": "0xffffffe8", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe8" + }, + "pre2":{ + "lane0": "0x00000004", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000000" + } + }, + "QSFP-DD-sm_media_interface":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x00000088", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + }, + "pre1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + } + }, + "QSFP-DD-active_cable_media_interface":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x00000088", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + }, + "pre1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + } + }, + "QSFP28-40GBASE-CR4-1.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-2.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-3.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-5.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-*":{ + "main":{ + "lane0": "0x00000048", + "lane1": "0x00000042", + "lane2": "0x00000044", + "lane3": "0x00000044", + "lane4": "0x00000048", + "lane5": "0x00000042", + "lane6": "0x00000044", + "lane7": "0x00000044" + }, + "post1":{ + "lane0": "0xffffffec", + "lane1": "0xfffffff6", + "lane2": "0xfffffff4", + "lane3": "0xfffffff6", + "lane4": "0xffffffec", + "lane5": "0xfffffff6", + "lane6": "0xfffffff4", + "lane7": "0xfffffff6" + }, + "pre1":{ + "lane0": "0xfffffffc", + "lane1": "0xfffffffc", + "lane2": "0xfffffffc", + "lane3": "0xfffffffc", + "lane4": "0xfffffffc", + "lane5": "0xfffffffc", + "lane6": "0xfffffffc", + "lane7": "0xfffffffc" + } + }, + "QSFP+-40GBASE-CR4-1.0M":{ + "main":{ + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-2.0M":{ + "main":{ + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-3.0M":{ + "main":{ + "lane0": "0x0000003c", + "lane1": "0x0000003c", + "lane2": "0x0000003c", + "lane3": "0x0000003c", + "lane4": "0x0000003c", + "lane5": "0x0000003c", + "lane6": "0x0000003c", + "lane7": "0x0000003c" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-5.0M":{ + "main":{ + "lane0": "0x00000057", + "lane1": "0x00000057", + "lane2": "0x00000057", + "lane3": "0x00000057", + "lane4": "0x00000057", + "lane5": "0x00000057", + "lane6": "0x00000057", + "lane7": "0x00000057" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0xfffffffa", + "lane1": "0xfffffffa", + "lane2": "0xfffffffa", + "lane3": "0xfffffffa", + "lane4": "0xfffffffa", + "lane5": "0xfffffffa", + "lane6": "0xfffffffa", + "lane7": "0xfffffffa" + } + }, + "QSFP+-40GBASE-CR4-7.0M":{ + "main":{ + "lane0": "0x00000057", + "lane1": "0x00000057", + "lane2": "0x00000057", + "lane3": "0x00000057", + "lane4": "0x00000057", + "lane5": "0x00000057", + "lane6": "0x00000057", + "lane7": "0x00000057" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0xfffffffa", + "lane1": "0xfffffffa", + "lane2": "0xfffffffa", + "lane3": "0xfffffffa", + "lane4": "0xfffffffa", + "lane5": "0xfffffffa", + "lane6": "0xfffffffa", + "lane7": "0xfffffffa" + } + }, + "QSFP+-*":{ + "main":{ + "lane0": "0x0000004a", + "lane1": "0x0000004a", + "lane2": "0x0000004a", + "lane3": "0x0000004a", + "lane4": "0x0000004a", + "lane5": "0x0000004a", + "lane6": "0x0000004a", + "lane7": "0x0000004a" + }, + "post1":{ + "lane0": "0xfffffff2", + "lane1": "0xfffffff2", + "lane2": "0xfffffff2", + "lane3": "0xfffffff2", + "lane4": "0xfffffff2", + "lane5": "0xfffffff2", + "lane6": "0xfffffff2", + "lane7": "0xfffffff2" + }, + "pre1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + } + } + }, + "24":{ + "QSFP-DD-passive_copper_media_interface-1.0M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-1.5M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-0.5M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-2.0M":{ + "main":{ + "lane0": "0x00000070", + "lane1": "0x0000008c", + "lane2": "0x00000080", + "lane3": "0x00000070", + "lane4": "0x00000070", + "lane5": "0x00000070", + "lane6": "0x00000070", + "lane7": "0x00000084" + }, + "post1":{ + "lane0": "0xffffffe8", + "lane1": "0xfffffffc", + "lane2": "0xfffffff0", + "lane3": "0xffffffe8", + "lane4": "0xffffffe8", + "lane5": "0xffffffe8", + "lane6": "0xffffffe8", + "lane7": "0xfffffff4" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe8", + "lane2": "0xffffffe8", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe8" + }, + "pre2":{ + "lane0": "0x00000004", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000000" + } + }, + "QSFP-DD-sm_media_interface":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x00000088", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + }, + "pre1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + } + }, + "QSFP-DD-active_cable_media_interface":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x00000088", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + }, + "pre1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + } + }, + "QSFP28-40GBASE-CR4-1.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-2.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-3.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-5.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-*":{ + "main":{ + "lane0": "0x00000040", + "lane1": "0x00000048", + "lane2": "0x00000040", + "lane3": "0x00000044", + "lane4": "0x00000040", + "lane5": "0x00000048", + "lane6": "0x00000040", + "lane7": "0x00000044" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff4", + "lane2": "0xfffffff6", + "lane3": "0xfffffff4", + "lane4": "0xfffffff0", + "lane5": "0xfffffff4", + "lane6": "0xfffffff6", + "lane7": "0xfffffff4" + }, + "pre1":{ + "lane0": "0xfffffffc", + "lane1": "0xfffffffc", + "lane2": "0xfffffffc", + "lane3": "0xfffffffc", + "lane4": "0xfffffffc", + "lane5": "0xfffffffc", + "lane6": "0xfffffffc", + "lane7": "0xfffffffc" + } + }, + "QSFP+-40GBASE-CR4-1.0M":{ + "main":{ + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-2.0M":{ + "main":{ + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-3.0M":{ + "main":{ + "lane0": "0x0000003c", + "lane1": "0x0000003c", + "lane2": "0x0000003c", + "lane3": "0x0000003c", + "lane4": "0x0000003c", + "lane5": "0x0000003c", + "lane6": "0x0000003c", + "lane7": "0x0000003c" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-5.0M":{ + "main":{ + "lane0": "0x00000057", + "lane1": "0x00000057", + "lane2": "0x00000057", + "lane3": "0x00000057", + "lane4": "0x00000057", + "lane5": "0x00000057", + "lane6": "0x00000057", + "lane7": "0x00000057" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0xfffffffa", + "lane1": "0xfffffffa", + "lane2": "0xfffffffa", + "lane3": "0xfffffffa", + "lane4": "0xfffffffa", + "lane5": "0xfffffffa", + "lane6": "0xfffffffa", + "lane7": "0xfffffffa" + } + }, + "QSFP+-40GBASE-CR4-7.0M":{ + "main":{ + "lane0": "0x00000057", + "lane1": "0x00000057", + "lane2": "0x00000057", + "lane3": "0x00000057", + "lane4": "0x00000057", + "lane5": "0x00000057", + "lane6": "0x00000057", + "lane7": "0x00000057" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0xfffffffa", + "lane1": "0xfffffffa", + "lane2": "0xfffffffa", + "lane3": "0xfffffffa", + "lane4": "0xfffffffa", + "lane5": "0xfffffffa", + "lane6": "0xfffffffa", + "lane7": "0xfffffffa" + } + }, + "QSFP+-*":{ + "main":{ + "lane0": "0x0000004a", + "lane1": "0x0000004a", + "lane2": "0x0000004a", + "lane3": "0x0000004a", + "lane4": "0x0000004a", + "lane5": "0x0000004a", + "lane6": "0x0000004a", + "lane7": "0x0000004a" + }, + "post1":{ + "lane0": "0xfffffff2", + "lane1": "0xfffffff2", + "lane2": "0xfffffff2", + "lane3": "0xfffffff2", + "lane4": "0xfffffff2", + "lane5": "0xfffffff2", + "lane6": "0xfffffff2", + "lane7": "0xfffffff2" + }, + "pre1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + } + } + }, + "25":{ + "QSFP-DD-passive_copper_media_interface-1.0M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-1.5M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-0.5M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-2.0M":{ + "main":{ + "lane0": "0x00000070", + "lane1": "0x0000008c", + "lane2": "0x00000080", + "lane3": "0x00000070", + "lane4": "0x00000070", + "lane5": "0x00000070", + "lane6": "0x00000070", + "lane7": "0x00000084" + }, + "post1":{ + "lane0": "0xffffffe8", + "lane1": "0xfffffffc", + "lane2": "0xfffffff0", + "lane3": "0xffffffe8", + "lane4": "0xffffffe8", + "lane5": "0xffffffe8", + "lane6": "0xffffffe8", + "lane7": "0xfffffff4" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe8", + "lane2": "0xffffffe8", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe8" + }, + "pre2":{ + "lane0": "0x00000004", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000000" + } + }, + "QSFP-DD-sm_media_interface":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x00000088", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + }, + "pre1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + } + }, + "QSFP-DD-active_cable_media_interface":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x00000088", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + }, + "pre1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + } + }, + "QSFP28-40GBASE-CR4-1.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-2.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-3.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-5.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-*":{ + "main":{ + "lane0": "0x00000042", + "lane1": "0x0000003c", + "lane2": "0x00000042", + "lane3": "0x0000003a", + "lane4": "0x00000042", + "lane5": "0x0000003c", + "lane6": "0x00000042", + "lane7": "0x0000003a" + }, + "post1":{ + "lane0": "0xfffffff4", + "lane1": "0xfffffff4", + "lane2": "0xfffffff8", + "lane3": "0xfffffff6", + "lane4": "0xfffffff4", + "lane5": "0xfffffff4", + "lane6": "0xfffffff8", + "lane7": "0xfffffff6" + }, + "pre1":{ + "lane0": "0xfffffffc", + "lane1": "0xfffffffc", + "lane2": "0xfffffffc", + "lane3": "0xfffffffc", + "lane4": "0xfffffffc", + "lane5": "0xfffffffc", + "lane6": "0xfffffffc", + "lane7": "0xfffffffc" + } + }, + "QSFP+-40GBASE-CR4-1.0M":{ + "main":{ + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-2.0M":{ + "main":{ + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-3.0M":{ + "main":{ + "lane0": "0x0000003c", + "lane1": "0x0000003c", + "lane2": "0x0000003c", + "lane3": "0x0000003c", + "lane4": "0x0000003c", + "lane5": "0x0000003c", + "lane6": "0x0000003c", + "lane7": "0x0000003c" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-5.0M":{ + "main":{ + "lane0": "0x00000057", + "lane1": "0x00000057", + "lane2": "0x00000057", + "lane3": "0x00000057", + "lane4": "0x00000057", + "lane5": "0x00000057", + "lane6": "0x00000057", + "lane7": "0x00000057" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0xfffffffa", + "lane1": "0xfffffffa", + "lane2": "0xfffffffa", + "lane3": "0xfffffffa", + "lane4": "0xfffffffa", + "lane5": "0xfffffffa", + "lane6": "0xfffffffa", + "lane7": "0xfffffffa" + } + }, + "QSFP+-40GBASE-CR4-7.0M":{ + "main":{ + "lane0": "0x00000057", + "lane1": "0x00000057", + "lane2": "0x00000057", + "lane3": "0x00000057", + "lane4": "0x00000057", + "lane5": "0x00000057", + "lane6": "0x00000057", + "lane7": "0x00000057" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0xfffffffa", + "lane1": "0xfffffffa", + "lane2": "0xfffffffa", + "lane3": "0xfffffffa", + "lane4": "0xfffffffa", + "lane5": "0xfffffffa", + "lane6": "0xfffffffa", + "lane7": "0xfffffffa" + } + }, + "QSFP+-*":{ + "main":{ + "lane0": "0x00000046", + "lane1": "0x00000046", + "lane2": "0x00000046", + "lane3": "0x00000046", + "lane4": "0x00000046", + "lane5": "0x00000046", + "lane6": "0x00000046", + "lane7": "0x00000046" + }, + "post1":{ + "lane0": "0xfffffff4", + "lane1": "0xfffffff4", + "lane2": "0xfffffff4", + "lane3": "0xfffffff4", + "lane4": "0xfffffff4", + "lane5": "0xfffffff4", + "lane6": "0xfffffff4", + "lane7": "0xfffffff4" + }, + "pre1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + } + } + }, + "26":{ + "QSFP-DD-passive_copper_media_interface-1.0M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-1.5M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-0.5M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-2.0M":{ + "main":{ + "lane0": "0x00000070", + "lane1": "0x0000008c", + "lane2": "0x00000080", + "lane3": "0x00000070", + "lane4": "0x00000070", + "lane5": "0x00000070", + "lane6": "0x00000070", + "lane7": "0x00000084" + }, + "post1":{ + "lane0": "0xffffffe8", + "lane1": "0xfffffffc", + "lane2": "0xfffffff0", + "lane3": "0xffffffe8", + "lane4": "0xffffffe8", + "lane5": "0xffffffe8", + "lane6": "0xffffffe8", + "lane7": "0xfffffff4" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe8", + "lane2": "0xffffffe8", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe8" + }, + "pre2":{ + "lane0": "0x00000004", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000000" + } + }, + "QSFP-DD-sm_media_interface":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x00000088", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + }, + "pre1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + } + }, + "QSFP-DD-active_cable_media_interface":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x00000088", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + }, + "pre1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + } + }, + "QSFP28-40GBASE-CR4-1.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-2.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-3.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-5.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-*":{ + "main":{ + "lane0": "0x00000044", + "lane1": "0x00000042", + "lane2": "0x00000038", + "lane3": "0x0000003c", + "lane4": "0x00000044", + "lane5": "0x00000042", + "lane6": "0x00000038", + "lane7": "0x0000003c" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff6", + "lane2": "0xfffffff6", + "lane3": "0xfffffff8", + "lane4": "0xfffffff0", + "lane5": "0xfffffff6", + "lane6": "0xfffffff6", + "lane7": "0xfffffff8" + }, + "pre1":{ + "lane0": "0xfffffffc", + "lane1": "0xfffffffc", + "lane2": "0xfffffffc", + "lane3": "0xfffffffc", + "lane4": "0xfffffffc", + "lane5": "0xfffffffc", + "lane6": "0xfffffffc", + "lane7": "0xfffffffc" + } + }, + "QSFP+-40GBASE-CR4-1.0M":{ + "main":{ + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-2.0M":{ + "main":{ + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-3.0M":{ + "main":{ + "lane0": "0x0000003c", + "lane1": "0x0000003c", + "lane2": "0x0000003c", + "lane3": "0x0000003c", + "lane4": "0x0000003c", + "lane5": "0x0000003c", + "lane6": "0x0000003c", + "lane7": "0x0000003c" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-5.0M":{ + "main":{ + "lane0": "0x00000057", + "lane1": "0x00000057", + "lane2": "0x00000057", + "lane3": "0x00000057", + "lane4": "0x00000057", + "lane5": "0x00000057", + "lane6": "0x00000057", + "lane7": "0x00000057" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0xfffffffa", + "lane1": "0xfffffffa", + "lane2": "0xfffffffa", + "lane3": "0xfffffffa", + "lane4": "0xfffffffa", + "lane5": "0xfffffffa", + "lane6": "0xfffffffa", + "lane7": "0xfffffffa" + } + }, + "QSFP+-40GBASE-CR4-7.0M":{ + "main":{ + "lane0": "0x00000057", + "lane1": "0x00000057", + "lane2": "0x00000057", + "lane3": "0x00000057", + "lane4": "0x00000057", + "lane5": "0x00000057", + "lane6": "0x00000057", + "lane7": "0x00000057" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0xfffffffa", + "lane1": "0xfffffffa", + "lane2": "0xfffffffa", + "lane3": "0xfffffffa", + "lane4": "0xfffffffa", + "lane5": "0xfffffffa", + "lane6": "0xfffffffa", + "lane7": "0xfffffffa" + } + }, + "QSFP+-*":{ + "main":{ + "lane0": "0x00000046", + "lane1": "0x00000046", + "lane2": "0x00000046", + "lane3": "0x00000046", + "lane4": "0x00000046", + "lane5": "0x00000046", + "lane6": "0x00000046", + "lane7": "0x00000046" + }, + "post1":{ + "lane0": "0xfffffff4", + "lane1": "0xfffffff4", + "lane2": "0xfffffff4", + "lane3": "0xfffffff4", + "lane4": "0xfffffff4", + "lane5": "0xfffffff4", + "lane6": "0xfffffff4", + "lane7": "0xfffffff4" + }, + "pre1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + } + } + }, + "27":{ + "QSFP-DD-passive_copper_media_interface-1.0M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-1.5M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-0.5M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-2.0M":{ + "main":{ + "lane0": "0x00000070", + "lane1": "0x0000008c", + "lane2": "0x00000080", + "lane3": "0x00000070", + "lane4": "0x00000070", + "lane5": "0x00000070", + "lane6": "0x00000070", + "lane7": "0x00000084" + }, + "post1":{ + "lane0": "0xffffffe8", + "lane1": "0xfffffffc", + "lane2": "0xfffffff0", + "lane3": "0xffffffe8", + "lane4": "0xffffffe8", + "lane5": "0xffffffe8", + "lane6": "0xffffffe8", + "lane7": "0xfffffff4" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe8", + "lane2": "0xffffffe8", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe8" + }, + "pre2":{ + "lane0": "0x00000004", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000000" + } + }, + "QSFP-DD-sm_media_interface":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x00000088", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + }, + "pre1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + } + }, + "QSFP-DD-active_cable_media_interface":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x00000088", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + }, + "pre1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + } + }, + "QSFP28-40GBASE-CR4-1.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-2.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-3.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-5.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-*":{ + "main":{ + "lane0": "0x00000040", + "lane1": "0x00000044", + "lane2": "0x00000040", + "lane3": "0x00000040", + "lane4": "0x00000040", + "lane5": "0x00000044", + "lane6": "0x00000040", + "lane7": "0x00000040" + }, + "post1":{ + "lane0": "0xfffffff4", + "lane1": "0xfffffff0", + "lane2": "0xfffffff8", + "lane3": "0xfffffff8", + "lane4": "0xfffffff4", + "lane5": "0xfffffff0", + "lane6": "0xfffffff8", + "lane7": "0xfffffff8" + }, + "pre1":{ + "lane0": "0xfffffffc", + "lane1": "0xfffffffc", + "lane2": "0xfffffffc", + "lane3": "0xfffffffc", + "lane4": "0xfffffffc", + "lane5": "0xfffffffc", + "lane6": "0xfffffffc", + "lane7": "0xfffffffc" + } + }, + "QSFP+-40GBASE-CR4-1.0M":{ + "main":{ + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-2.0M":{ + "main":{ + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-3.0M":{ + "main":{ + "lane0": "0x0000003c", + "lane1": "0x0000003c", + "lane2": "0x0000003c", + "lane3": "0x0000003c", + "lane4": "0x0000003c", + "lane5": "0x0000003c", + "lane6": "0x0000003c", + "lane7": "0x0000003c" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-5.0M":{ + "main":{ + "lane0": "0x00000057", + "lane1": "0x00000057", + "lane2": "0x00000057", + "lane3": "0x00000057", + "lane4": "0x00000057", + "lane5": "0x00000057", + "lane6": "0x00000057", + "lane7": "0x00000057" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0xfffffffa", + "lane1": "0xfffffffa", + "lane2": "0xfffffffa", + "lane3": "0xfffffffa", + "lane4": "0xfffffffa", + "lane5": "0xfffffffa", + "lane6": "0xfffffffa", + "lane7": "0xfffffffa" + } + }, + "QSFP+-40GBASE-CR4-7.0M":{ + "main":{ + "lane0": "0x00000057", + "lane1": "0x00000057", + "lane2": "0x00000057", + "lane3": "0x00000057", + "lane4": "0x00000057", + "lane5": "0x00000057", + "lane6": "0x00000057", + "lane7": "0x00000057" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0xfffffffa", + "lane1": "0xfffffffa", + "lane2": "0xfffffffa", + "lane3": "0xfffffffa", + "lane4": "0xfffffffa", + "lane5": "0xfffffffa", + "lane6": "0xfffffffa", + "lane7": "0xfffffffa" + } + }, + "QSFP+-*":{ + "main":{ + "lane0": "0x00000046", + "lane1": "0x00000046", + "lane2": "0x00000046", + "lane3": "0x00000046", + "lane4": "0x00000046", + "lane5": "0x00000046", + "lane6": "0x00000046", + "lane7": "0x00000046" + }, + "post1":{ + "lane0": "0xfffffff4", + "lane1": "0xfffffff4", + "lane2": "0xfffffff4", + "lane3": "0xfffffff4", + "lane4": "0xfffffff4", + "lane5": "0xfffffff4", + "lane6": "0xfffffff4", + "lane7": "0xfffffff4" + }, + "pre1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + } + } + }, + "28":{ + "QSFP-DD-passive_copper_media_interface-1.0M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-1.5M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-0.5M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-2.0M":{ + "main":{ + "lane0": "0x00000070", + "lane1": "0x0000008c", + "lane2": "0x00000080", + "lane3": "0x00000070", + "lane4": "0x00000070", + "lane5": "0x00000070", + "lane6": "0x00000070", + "lane7": "0x00000084" + }, + "post1":{ + "lane0": "0xffffffe8", + "lane1": "0xfffffffc", + "lane2": "0xfffffff0", + "lane3": "0xffffffe8", + "lane4": "0xffffffe8", + "lane5": "0xffffffe8", + "lane6": "0xffffffe8", + "lane7": "0xfffffff4" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe8", + "lane2": "0xffffffe8", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe8" + }, + "pre2":{ + "lane0": "0x00000004", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000000" + } + }, + "QSFP-DD-sm_media_interface":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x00000088", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + }, + "pre1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + } + }, + "QSFP-DD-active_cable_media_interface":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x00000088", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + }, + "pre1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + } + }, + "QSFP28-40GBASE-CR4-1.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-2.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-3.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-5.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-*":{ + "main":{ + "lane0": "0x0000003e", + "lane1": "0x00000044", + "lane2": "0x00000040", + "lane3": "0x0000003c", + "lane4": "0x0000003e", + "lane5": "0x00000044", + "lane6": "0x00000040", + "lane7": "0x0000003c" + }, + "post1":{ + "lane0": "0xfffffff6", + "lane1": "0xfffffff8", + "lane2": "0xfffffff8", + "lane3": "0xfffffff8", + "lane4": "0xfffffff6", + "lane5": "0xfffffff8", + "lane6": "0xfffffff8", + "lane7": "0xfffffff8" + }, + "pre1":{ + "lane0": "0xfffffffc", + "lane1": "0xfffffffc", + "lane2": "0xfffffffc", + "lane3": "0xfffffffc", + "lane4": "0xfffffffc", + "lane5": "0xfffffffc", + "lane6": "0xfffffffc", + "lane7": "0xfffffffc" + } + }, + "QSFP+-40GBASE-CR4-1.0M":{ + "main":{ + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-2.0M":{ + "main":{ + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-3.0M":{ + "main":{ + "lane0": "0x0000003c", + "lane1": "0x0000003c", + "lane2": "0x0000003c", + "lane3": "0x0000003c", + "lane4": "0x0000003c", + "lane5": "0x0000003c", + "lane6": "0x0000003c", + "lane7": "0x0000003c" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-5.0M":{ + "main":{ + "lane0": "0x00000057", + "lane1": "0x00000057", + "lane2": "0x00000057", + "lane3": "0x00000057", + "lane4": "0x00000057", + "lane5": "0x00000057", + "lane6": "0x00000057", + "lane7": "0x00000057" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0xfffffffa", + "lane1": "0xfffffffa", + "lane2": "0xfffffffa", + "lane3": "0xfffffffa", + "lane4": "0xfffffffa", + "lane5": "0xfffffffa", + "lane6": "0xfffffffa", + "lane7": "0xfffffffa" + } + }, + "QSFP+-40GBASE-CR4-7.0M":{ + "main":{ + "lane0": "0x00000057", + "lane1": "0x00000057", + "lane2": "0x00000057", + "lane3": "0x00000057", + "lane4": "0x00000057", + "lane5": "0x00000057", + "lane6": "0x00000057", + "lane7": "0x00000057" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0xfffffffa", + "lane1": "0xfffffffa", + "lane2": "0xfffffffa", + "lane3": "0xfffffffa", + "lane4": "0xfffffffa", + "lane5": "0xfffffffa", + "lane6": "0xfffffffa", + "lane7": "0xfffffffa" + } + }, + "QSFP+-*":{ + "main":{ + "lane0": "0x00000046", + "lane1": "0x00000046", + "lane2": "0x00000046", + "lane3": "0x00000046", + "lane4": "0x00000046", + "lane5": "0x00000046", + "lane6": "0x00000046", + "lane7": "0x00000046" + }, + "post1":{ + "lane0": "0xfffffff4", + "lane1": "0xfffffff4", + "lane2": "0xfffffff4", + "lane3": "0xfffffff4", + "lane4": "0xfffffff4", + "lane5": "0xfffffff4", + "lane6": "0xfffffff4", + "lane7": "0xfffffff4" + }, + "pre1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + } + } + }, + "29":{ + "QSFP-DD-passive_copper_media_interface-1.0M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-1.5M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-0.5M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-2.0M":{ + "main":{ + "lane0": "0x00000070", + "lane1": "0x0000008c", + "lane2": "0x00000080", + "lane3": "0x00000070", + "lane4": "0x00000070", + "lane5": "0x00000070", + "lane6": "0x00000070", + "lane7": "0x00000084" + }, + "post1":{ + "lane0": "0xffffffe8", + "lane1": "0xfffffffc", + "lane2": "0xfffffff0", + "lane3": "0xffffffe8", + "lane4": "0xffffffe8", + "lane5": "0xffffffe8", + "lane6": "0xffffffe8", + "lane7": "0xfffffff4" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe8", + "lane2": "0xffffffe8", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe8" + }, + "pre2":{ + "lane0": "0x00000004", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000000" + } + }, + "QSFP-DD-sm_media_interface":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x00000088", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + }, + "pre1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + } + }, + "QSFP-DD-active_cable_media_interface":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x00000088", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + }, + "pre1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + } + }, + "QSFP28-40GBASE-CR4-1.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-2.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-3.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-5.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-*":{ + "main":{ + "lane0": "0x00000044", + "lane1": "0x00000040", + "lane2": "0x0000003c", + "lane3": "0x00000040", + "lane4": "0x00000044", + "lane5": "0x00000040", + "lane6": "0x0000003c", + "lane7": "0x00000040" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff8", + "lane2": "0xfffffff4", + "lane3": "0xfffffff8", + "lane4": "0xfffffff0", + "lane5": "0xfffffff8", + "lane6": "0xfffffff4", + "lane7": "0xfffffff8" + }, + "pre1":{ + "lane0": "0xfffffffc", + "lane1": "0xfffffffc", + "lane2": "0xfffffffc", + "lane3": "0xfffffffc", + "lane4": "0xfffffffc", + "lane5": "0xfffffffc", + "lane6": "0xfffffffc", + "lane7": "0xfffffffc" + } + }, + "QSFP+-40GBASE-CR4-1.0M":{ + "main":{ + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-2.0M":{ + "main":{ + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-3.0M":{ + "main":{ + "lane0": "0x0000003c", + "lane1": "0x0000003c", + "lane2": "0x0000003c", + "lane3": "0x0000003c", + "lane4": "0x0000003c", + "lane5": "0x0000003c", + "lane6": "0x0000003c", + "lane7": "0x0000003c" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-5.0M":{ + "main":{ + "lane0": "0x00000057", + "lane1": "0x00000057", + "lane2": "0x00000057", + "lane3": "0x00000057", + "lane4": "0x00000057", + "lane5": "0x00000057", + "lane6": "0x00000057", + "lane7": "0x00000057" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0xfffffffa", + "lane1": "0xfffffffa", + "lane2": "0xfffffffa", + "lane3": "0xfffffffa", + "lane4": "0xfffffffa", + "lane5": "0xfffffffa", + "lane6": "0xfffffffa", + "lane7": "0xfffffffa" + } + }, + "QSFP+-40GBASE-CR4-7.0M":{ + "main":{ + "lane0": "0x00000057", + "lane1": "0x00000057", + "lane2": "0x00000057", + "lane3": "0x00000057", + "lane4": "0x00000057", + "lane5": "0x00000057", + "lane6": "0x00000057", + "lane7": "0x00000057" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0xfffffffa", + "lane1": "0xfffffffa", + "lane2": "0xfffffffa", + "lane3": "0xfffffffa", + "lane4": "0xfffffffa", + "lane5": "0xfffffffa", + "lane6": "0xfffffffa", + "lane7": "0xfffffffa" + } + }, + "QSFP+-*":{ + "main":{ + "lane0": "0x00000046", + "lane1": "0x00000046", + "lane2": "0x00000046", + "lane3": "0x00000046", + "lane4": "0x00000046", + "lane5": "0x00000046", + "lane6": "0x00000046", + "lane7": "0x00000046" + }, + "post1":{ + "lane0": "0xfffffff4", + "lane1": "0xfffffff4", + "lane2": "0xfffffff4", + "lane3": "0xfffffff4", + "lane4": "0xfffffff4", + "lane5": "0xfffffff4", + "lane6": "0xfffffff4", + "lane7": "0xfffffff4" + }, + "pre1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + } + } + }, + "30":{ + "QSFP-DD-passive_copper_media_interface-1.0M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-1.5M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-0.5M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-2.0M":{ + "main":{ + "lane0": "0x00000070", + "lane1": "0x0000008c", + "lane2": "0x00000080", + "lane3": "0x00000070", + "lane4": "0x00000070", + "lane5": "0x00000070", + "lane6": "0x00000070", + "lane7": "0x00000084" + }, + "post1":{ + "lane0": "0xffffffe8", + "lane1": "0xfffffffc", + "lane2": "0xfffffff0", + "lane3": "0xffffffe8", + "lane4": "0xffffffe8", + "lane5": "0xffffffe8", + "lane6": "0xffffffe8", + "lane7": "0xfffffff4" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe8", + "lane2": "0xffffffe8", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe8" + }, + "pre2":{ + "lane0": "0x00000004", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000000" + } + }, + "QSFP-DD-sm_media_interface":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x00000088", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + }, + "pre1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + } + }, + "QSFP-DD-active_cable_media_interface":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x00000088", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + }, + "pre1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + } + }, + "QSFP28-40GBASE-CR4-1.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-2.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-3.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-5.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-*":{ + "main":{ + "lane0": "0x00000040", + "lane1": "0x00000044", + "lane2": "0x00000040", + "lane3": "0x00000044", + "lane4": "0x00000040", + "lane5": "0x00000044", + "lane6": "0x00000040", + "lane7": "0x00000044" + }, + "post1":{ + "lane0": "0xfffffff4", + "lane1": "0xfffffff4", + "lane2": "0xfffffff4", + "lane3": "0xfffffff4", + "lane4": "0xfffffff4", + "lane5": "0xfffffff4", + "lane6": "0xfffffff4", + "lane7": "0xfffffff4" + }, + "pre1":{ + "lane0": "0xfffffffc", + "lane1": "0xfffffffc", + "lane2": "0xfffffffc", + "lane3": "0xfffffffc", + "lane4": "0xfffffffc", + "lane5": "0xfffffffc", + "lane6": "0xfffffffc", + "lane7": "0xfffffffc" + } + }, + "QSFP+-40GBASE-CR4-1.0M":{ + "main":{ + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-2.0M":{ + "main":{ + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-3.0M":{ + "main":{ + "lane0": "0x0000003c", + "lane1": "0x0000003c", + "lane2": "0x0000003c", + "lane3": "0x0000003c", + "lane4": "0x0000003c", + "lane5": "0x0000003c", + "lane6": "0x0000003c", + "lane7": "0x0000003c" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-5.0M":{ + "main":{ + "lane0": "0x00000057", + "lane1": "0x00000057", + "lane2": "0x00000057", + "lane3": "0x00000057", + "lane4": "0x00000057", + "lane5": "0x00000057", + "lane6": "0x00000057", + "lane7": "0x00000057" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0xfffffffa", + "lane1": "0xfffffffa", + "lane2": "0xfffffffa", + "lane3": "0xfffffffa", + "lane4": "0xfffffffa", + "lane5": "0xfffffffa", + "lane6": "0xfffffffa", + "lane7": "0xfffffffa" + } + }, + "QSFP+-40GBASE-CR4-7.0M":{ + "main":{ + "lane0": "0x00000057", + "lane1": "0x00000057", + "lane2": "0x00000057", + "lane3": "0x00000057", + "lane4": "0x00000057", + "lane5": "0x00000057", + "lane6": "0x00000057", + "lane7": "0x00000057" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0xfffffffa", + "lane1": "0xfffffffa", + "lane2": "0xfffffffa", + "lane3": "0xfffffffa", + "lane4": "0xfffffffa", + "lane5": "0xfffffffa", + "lane6": "0xfffffffa", + "lane7": "0xfffffffa" + } + }, + "QSFP+-*":{ + "main":{ + "lane0": "0x00000046", + "lane1": "0x00000046", + "lane2": "0x00000046", + "lane3": "0x00000046", + "lane4": "0x00000046", + "lane5": "0x00000046", + "lane6": "0x00000046", + "lane7": "0x00000046" + }, + "post1":{ + "lane0": "0xfffffff4", + "lane1": "0xfffffff4", + "lane2": "0xfffffff4", + "lane3": "0xfffffff4", + "lane4": "0xfffffff4", + "lane5": "0xfffffff4", + "lane6": "0xfffffff4", + "lane7": "0xfffffff4" + }, + "pre1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + } + } + }, + "31":{ + "QSFP-DD-passive_copper_media_interface-1.0M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-1.5M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-0.5M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-2.0M":{ + "main":{ + "lane0": "0x00000070", + "lane1": "0x0000008c", + "lane2": "0x00000080", + "lane3": "0x00000070", + "lane4": "0x00000070", + "lane5": "0x00000070", + "lane6": "0x00000070", + "lane7": "0x00000084" + }, + "post1":{ + "lane0": "0xffffffe8", + "lane1": "0xfffffffc", + "lane2": "0xfffffff0", + "lane3": "0xffffffe8", + "lane4": "0xffffffe8", + "lane5": "0xffffffe8", + "lane6": "0xffffffe8", + "lane7": "0xfffffff4" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe8", + "lane2": "0xffffffe8", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe8" + }, + "pre2":{ + "lane0": "0x00000004", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000000" + } + }, + "QSFP-DD-sm_media_interface":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x00000088", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + }, + "pre1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + } + }, + "QSFP-DD-active_cable_media_interface":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x00000088", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + }, + "pre1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + } + }, + "QSFP28-40GBASE-CR4-1.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-2.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-3.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-5.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-*":{ + "main":{ + "lane0": "0x00000048", + "lane1": "0x00000046", + "lane2": "0x00000040", + "lane3": "0x00000044", + "lane4": "0x00000048", + "lane5": "0x00000046", + "lane6": "0x00000040", + "lane7": "0x00000044" + }, + "post1":{ + "lane0": "0xffffffec", + "lane1": "0xfffffff4", + "lane2": "0xfffffff0", + "lane3": "0xfffffff6", + "lane4": "0xffffffec", + "lane5": "0xfffffff4", + "lane6": "0xfffffff0", + "lane7": "0xfffffff6" + }, + "pre1":{ + "lane0": "0xfffffffc", + "lane1": "0xfffffffc", + "lane2": "0xfffffffc", + "lane3": "0xfffffffc", + "lane4": "0xfffffffc", + "lane5": "0xfffffffc", + "lane6": "0xfffffffc", + "lane7": "0xfffffffc" + } + }, + "QSFP+-40GBASE-CR4-1.0M":{ + "main":{ + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-2.0M":{ + "main":{ + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-3.0M":{ + "main":{ + "lane0": "0x0000003c", + "lane1": "0x0000003c", + "lane2": "0x0000003c", + "lane3": "0x0000003c", + "lane4": "0x0000003c", + "lane5": "0x0000003c", + "lane6": "0x0000003c", + "lane7": "0x0000003c" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-5.0M":{ + "main":{ + "lane0": "0x00000057", + "lane1": "0x00000057", + "lane2": "0x00000057", + "lane3": "0x00000057", + "lane4": "0x00000057", + "lane5": "0x00000057", + "lane6": "0x00000057", + "lane7": "0x00000057" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0xfffffffa", + "lane1": "0xfffffffa", + "lane2": "0xfffffffa", + "lane3": "0xfffffffa", + "lane4": "0xfffffffa", + "lane5": "0xfffffffa", + "lane6": "0xfffffffa", + "lane7": "0xfffffffa" + } + }, + "QSFP+-40GBASE-CR4-7.0M":{ + "main":{ + "lane0": "0x00000057", + "lane1": "0x00000057", + "lane2": "0x00000057", + "lane3": "0x00000057", + "lane4": "0x00000057", + "lane5": "0x00000057", + "lane6": "0x00000057", + "lane7": "0x00000057" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0xfffffffa", + "lane1": "0xfffffffa", + "lane2": "0xfffffffa", + "lane3": "0xfffffffa", + "lane4": "0xfffffffa", + "lane5": "0xfffffffa", + "lane6": "0xfffffffa", + "lane7": "0xfffffffa" + } + }, + "QSFP+-*":{ + "main":{ + "lane0": "0x0000004a", + "lane1": "0x0000004a", + "lane2": "0x0000004a", + "lane3": "0x0000004a", + "lane4": "0x0000004a", + "lane5": "0x0000004a", + "lane6": "0x0000004a", + "lane7": "0x0000004a" + }, + "post1":{ + "lane0": "0xfffffff2", + "lane1": "0xfffffff2", + "lane2": "0xfffffff2", + "lane3": "0xfffffff2", + "lane4": "0xfffffff2", + "lane5": "0xfffffff2", + "lane6": "0xfffffff2", + "lane7": "0xfffffff2" + }, + "pre1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + } + } + }, + "32":{ + "QSFP-DD-passive_copper_media_interface-1.0M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-1.5M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-0.5M":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x0000008c", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe4", + "lane2": "0xffffffe4", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe4" + }, + "pre2":{ + "lane0": "0x00000002", + "lane1": "0x00000004", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000004" + } + }, + "QSFP-DD-passive_copper_media_interface-2.0M":{ + "main":{ + "lane0": "0x00000070", + "lane1": "0x0000008c", + "lane2": "0x00000080", + "lane3": "0x00000070", + "lane4": "0x00000070", + "lane5": "0x00000070", + "lane6": "0x00000070", + "lane7": "0x00000084" + }, + "post1":{ + "lane0": "0xffffffe8", + "lane1": "0xfffffffc", + "lane2": "0xfffffff0", + "lane3": "0xffffffe8", + "lane4": "0xffffffe8", + "lane5": "0xffffffe8", + "lane6": "0xffffffe8", + "lane7": "0xfffffff4" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffe4", + "lane1": "0xffffffe8", + "lane2": "0xffffffe8", + "lane3": "0xffffffe4", + "lane4": "0xffffffe4", + "lane5": "0xffffffe4", + "lane6": "0xffffffe4", + "lane7": "0xffffffe8" + }, + "pre2":{ + "lane0": "0x00000004", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000004", + "lane4": "0x00000004", + "lane5": "0x00000004", + "lane6": "0x00000004", + "lane7": "0x00000000" + } + }, + "QSFP-DD-sm_media_interface":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x00000088", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + }, + "pre1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + } + }, + "QSFP-DD-active_cable_media_interface":{ + "main":{ + "lane0": "0x00000088", + "lane1": "0x00000088", + "lane2": "0x00000088", + "lane3": "0x00000088", + "lane4": "0x00000088", + "lane5": "0x00000088", + "lane6": "0x00000088", + "lane7": "0x00000088" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + }, + "pre1":{ + "lane0": "0xfffffff0", + "lane1": "0xfffffff0", + "lane2": "0xfffffff0", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xfffffff0", + "lane6": "0xfffffff0", + "lane7": "0xfffffff0" + } + }, + "QSFP28-40GBASE-CR4-1.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-2.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-3.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-40GBASE-CR4-5.0M":{ + "main":{ + "lane0": "0x00000069", + "lane1": "0x00000069", + "lane2": "0x00000069", + "lane3": "0x00000069", + "lane4": "0x00000069", + "lane5": "0x00000069", + "lane6": "0x00000069", + "lane7": "0x00000069" + }, + "post2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post3":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre2":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0xffffffec", + "lane1": "0xffffffec", + "lane2": "0xffffffec", + "lane3": "0xffffffec", + "lane4": "0xffffffec", + "lane5": "0xffffffec", + "lane6": "0xffffffec", + "lane7": "0xffffffec" + } + }, + "QSFP28-*":{ + "main":{ + "lane0": "0x00000040", + "lane1": "0x0000004e", + "lane2": "0x00000044", + "lane3": "0x00000046", + "lane4": "0x00000040", + "lane5": "0x0000004e", + "lane6": "0x00000044", + "lane7": "0x00000046" + }, + "post1":{ + "lane0": "0xfffffff0", + "lane1": "0xffffffec", + "lane2": "0xfffffff4", + "lane3": "0xfffffff0", + "lane4": "0xfffffff0", + "lane5": "0xffffffec", + "lane6": "0xfffffff4", + "lane7": "0xfffffff0" + }, + "pre1":{ + "lane0": "0xfffffffc", + "lane1": "0xfffffffc", + "lane2": "0xfffffffc", + "lane3": "0xfffffffc", + "lane4": "0xfffffffc", + "lane5": "0xfffffffc", + "lane6": "0xfffffffc", + "lane7": "0xfffffffc" + } + }, + "QSFP+-40GBASE-CR4-1.0M":{ + "main":{ + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-2.0M":{ + "main":{ + "lane0": "0x0000001e", + "lane1": "0x0000001e", + "lane2": "0x0000001e", + "lane3": "0x0000001e", + "lane4": "0x0000001e", + "lane5": "0x0000001e", + "lane6": "0x0000001e", + "lane7": "0x0000001e" + }, + "post1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-3.0M":{ + "main":{ + "lane0": "0x0000003c", + "lane1": "0x0000003c", + "lane2": "0x0000003c", + "lane3": "0x0000003c", + "lane4": "0x0000003c", + "lane5": "0x0000003c", + "lane6": "0x0000003c", + "lane7": "0x0000003c" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0x00000000", + "lane1": "0x00000000", + "lane2": "0x00000000", + "lane3": "0x00000000", + "lane4": "0x00000000", + "lane5": "0x00000000", + "lane6": "0x00000000", + "lane7": "0x00000000" + } + }, + "QSFP+-40GBASE-CR4-5.0M":{ + "main":{ + "lane0": "0x00000057", + "lane1": "0x00000057", + "lane2": "0x00000057", + "lane3": "0x00000057", + "lane4": "0x00000057", + "lane5": "0x00000057", + "lane6": "0x00000057", + "lane7": "0x00000057" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0xfffffffa", + "lane1": "0xfffffffa", + "lane2": "0xfffffffa", + "lane3": "0xfffffffa", + "lane4": "0xfffffffa", + "lane5": "0xfffffffa", + "lane6": "0xfffffffa", + "lane7": "0xfffffffa" + } + }, + "QSFP+-40GBASE-CR4-7.0M":{ + "main":{ + "lane0": "0x00000057", + "lane1": "0x00000057", + "lane2": "0x00000057", + "lane3": "0x00000057", + "lane4": "0x00000057", + "lane5": "0x00000057", + "lane6": "0x00000057", + "lane7": "0x00000057" + }, + "post1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + }, + "pre1":{ + "lane0": "0xfffffffa", + "lane1": "0xfffffffa", + "lane2": "0xfffffffa", + "lane3": "0xfffffffa", + "lane4": "0xfffffffa", + "lane5": "0xfffffffa", + "lane6": "0xfffffffa", + "lane7": "0xfffffffa" + } + }, + "QSFP-+*":{ + "main":{ + "lane0": "0x0000004a", + "lane1": "0x0000004a", + "lane2": "0x0000004a", + "lane3": "0x0000004a", + "lane4": "0x0000004a", + "lane5": "0x0000004a", + "lane6": "0x0000004a", + "lane7": "0x0000004a" + }, + "post1":{ + "lane0": "0xfffffff2", + "lane1": "0xfffffff2", + "lane2": "0xfffffff2", + "lane3": "0xfffffff2", + "lane4": "0xfffffff2", + "lane5": "0xfffffff2", + "lane6": "0xfffffff2", + "lane7": "0xfffffff2" + }, + "pre1":{ + "lane0": "0xfffffffe", + "lane1": "0xfffffffe", + "lane2": "0xfffffffe", + "lane3": "0xfffffffe", + "lane4": "0xfffffffe", + "lane5": "0xfffffffe", + "lane6": "0xfffffffe", + "lane7": "0xfffffffe" + } + } + } + } +} diff --git a/device/dell/x86_64-dellemc_z9332f_d1508-r0/pcie.yaml b/device/dell/x86_64-dellemc_z9332f_d1508-r0/pcie.yaml new file mode 100644 index 000000000000..fbd2549082a6 --- /dev/null +++ b/device/dell/x86_64-dellemc_z9332f_d1508-r0/pcie.yaml @@ -0,0 +1,28 @@ +- bus: '00' + dev: '03' + fn: '0' + id: 6f08 + name: 'PCI bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D PCI + Express Root Port 3 (rev 03)' +- bus: '00' + dev: 1c + fn: '0' + id: 8c10 + name: 'PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express + Root Port #1 (rev d5)' +- bus: '00' + dev: 1f + fn: '2' + id: 8c02 + name: 'SATA controller: Intel Corporation 8 Series/C220 Series Chipset Family 6-port + SATA Controller 1 [AHCI mode] (rev 05)' +- bus: '05' + dev: '00' + fn: '0' + id: b980 + name: 'Ethernet controller: Broadcom Limited Device b980 (rev 11)' +- bus: 09 + dev: '00' + fn: '0' + id: '7021' + name: 'Memory controller: Xilinx Corporation Device 7021' diff --git a/device/dell/x86_64-dellemc_z9332f_d1508-r0/platform.json b/device/dell/x86_64-dellemc_z9332f_d1508-r0/platform.json new file mode 100644 index 000000000000..98a3322bf334 --- /dev/null +++ b/device/dell/x86_64-dellemc_z9332f_d1508-r0/platform.json @@ -0,0 +1,612 @@ +{ + "chassis": { + "name": "Z9332F-ON", + "status_led": { + "controllable": true, + "colors": ["green", "flashing green", "yellow", "flashing yellow"] + }, + "thermal_manager" : false, + "components": [ + { + "name": "BIOS" + }, + { + "name": "FPGA" + }, + { + "name": "BMC" + }, + { + "name": "Baseboard CPLD" + }, + { + "name": "Switch CPLD 1" + }, + { + "name": "Switch CPLD 2" + }, + { + "name": "SSD" + }, + { + "name": "PCIe" + } + ], + "fans": [ + { + "name": "FanTray1-Fan1", + "speed": { + "controllable": false + }, + "status_led": { + "available": false + } + }, + { + "name": "FanTray1-Fan2", + "speed": { + "controllable": false + }, + "status_led": { + "available": false + } + }, + { + "name": "FanTray2-Fan1", + "speed": { + "controllable": false + }, + "status_led": { + "available": false + } + }, + { + "name": "FanTray2-Fan2", + "speed": { + "controllable": false + }, + "status_led": { + "available": false + } + }, + { + "name": "FanTray3-Fan1", + "speed": { + "controllable": false + }, + "status_led": { + "available": false + } + }, + { + "name": "FanTray3-Fan2", + "speed": { + "controllable": false + }, + "status_led": { + "available": false + } + }, + { + "name": "FanTray4-Fan1", + "speed": { + "controllable": false + }, + "status_led": { + "available": false + } + }, + { + "name": "FanTray4-Fan2", + "speed": { + "controllable": false + }, + "status_led": { + "available": false + } + }, + { + "name": "FanTray5-Fan1", + "speed": { + "controllable": false + }, + "status_led": { + "available": false + } + }, + { + "name": "FanTray5-Fan2", + "speed": { + "controllable": false + }, + "status_led": { + "available": false + } + }, + { + "name": "FanTray6-Fan1", + "speed": { + "controllable": false + }, + "status_led": { + "available": false + } + }, + { + "name": "FanTray6-Fan2", + "speed": { + "controllable": false + }, + "status_led": { + "available": false + } + }, + { + "name": "FanTray7-Fan1", + "speed": { + "controllable": false + }, + "status_led": { + "available": false + } + }, + { + "name": "FanTray7-Fan2", + "speed": { + "controllable": false + }, + "status_led": { + "available": false + } + } + ], + "fan_drawers":[ + { + "name": "FanTray1", + "status_led": { + "controllable": false + }, + "fans": [ + { + "name": "FanTray1-Fan1", + "speed": { + "controllable": false + }, + "status_led": { + "available": false + } + }, + { + "name": "FanTray1-Fan2", + "speed": { + "controllable": false + }, + "status_led": { + "available": false + } + } + ] + }, + { + "name": "FanTray2", + "status_led": { + "controllable": false + }, + "fans": [ + { + "name": "FanTray2-Fan1", + "speed": { + "controllable": false + }, + "status_led": { + "available": false + } + }, + { + "name": "FanTray2-Fan2", + "speed": { + "controllable": false + }, + "status_led": { + "available": false + } + } + ] + }, + { + "name": "FanTray3", + "status_led": { + "controllable": false + }, + "fans": [ + { + "name": "FanTray3-Fan1", + "speed": { + "controllable": false + }, + "status_led": { + "available": false + } + }, + { + "name": "FanTray3-Fan2", + "speed": { + "controllable": false + }, + "status_led": { + "available": false + } + } + ] + }, + { + "name": "FanTray4", + "status_led": { + "controllable": false + }, + "fans": [ + { + "name": "FanTray4-Fan1", + "speed": { + "controllable": false + }, + "status_led": { + "available": false + } + }, + { + "name": "FanTray4-Fan2", + "speed": { + "controllable": false + }, + "status_led": { + "available": false + } + } + ] + }, + { + "name": "FanTray5", + "status_led": { + "controllable": false + }, + "fans": [ + { + "name": "FanTray5-Fan1", + "speed": { + "controllable": false + }, + "status_led": { + "available": false + } + }, + { + "name": "FanTray5-Fan2", + "speed": { + "controllable": false + }, + "status_led": { + "available": false + } + } + ] + }, + { + "name": "FanTray6", + "status_led": { + "controllable": false + }, + "fans": [ + { + "name": "FanTray6-Fan1", + "speed": { + "controllable": false + }, + "status_led": { + "available": false + } + }, + { + "name": "FanTray6-Fan2", + "speed": { + "controllable": false + }, + "status_led": { + "available": false + } + } + ] + }, + { + "name": "FanTray7", + "status_led": { + "controllable": false + }, + "fans": [ + { + "name": "FanTray7-Fan1", + "speed": { + "controllable": false + }, + "status_led": { + "available": false + } + }, + { + "name": "FanTray7-Fan2", + "speed": { + "controllable": false + }, + "status_led": { + "available": false + } + } + ] + } + ], + "psus": [ + { + "name": "PSU1", + "status_led": { + "controllable": false + }, + "fans": [ + { + "name": "PSU1 Fan", + "speed": { + "controllable": false + }, + "status_led": { + "available": false + } + } + ] + }, + { + "name": "PSU2", + "status_led": { + "controllable": false + }, + "fans": [ + { + "name": "PSU2 Fan", + "speed": { + "controllable": false + }, + "status_led": { + "available": false + } + } + ] + } + ], + "thermals": [ + { + "name": "CPU On-board", + "controllable": false, + "low-crit-threshold": false, + "high-threshold": false, + "minimum-recorded": false, + "maximum-recorded": false + }, + { + "name": "Baseboard U3", + "controllable": false, + "low-crit-threshold": false, + "high-threshold": false, + "high-crit-threshold": false, + "minimum-recorded": false, + "maximum-recorded": false + }, + { + "name": "SW Internal", + "controllable": false, + "low-crit-threshold": false, + "minimum-recorded": false, + "maximum-recorded": false + }, + { + "name": "Fan U52", + "controllable": false, + "low-crit-threshold": false, + "minimum-recorded": false, + "maximum-recorded": false + }, + { + "name": "Fan U17", + "controllable": false, + "low-crit-threshold": false, + "high-threshold": false, + "high-crit-threshold": false, + "minimum-recorded": false, + "maximum-recorded": false + }, + { + "name": "SW U52", + "controllable": false, + "low-crit-threshold": false, + "high-threshold": false, + "high-crit-threshold": false, + "minimum-recorded": false, + "maximum-recorded": false + }, + { + "name": "SW U16", + "controllable": false, + "low-crit-threshold": false, + "minimum-recorded": false, + "maximum-recorded": false + }, + { + "name": "PSU1 Inlet", + "controllable": false, + "low-crit-threshold": false, + "high-threshold": false, + "high-crit-threshold": false, + "minimum-recorded": false, + "maximum-recorded": false + }, + { + "name": "PSU1 Hotspot", + "controllable": false, + "low-crit-threshold": false, + "high-threshold": false, + "high-crit-threshold": false, + "minimum-recorded": false, + "maximum-recorded": false + }, + { + "name": "PSU2 Inlet", + "controllable": false, + "low-crit-threshold": false, + "high-threshold": false, + "high-crit-threshold": false, + "minimum-recorded": false, + "maximum-recorded": false + }, + { + "name": "PSU2 Hotspot", + "controllable": false, + "low-crit-threshold": false, + "high-threshold": false, + "high-crit-threshold": false, + "minimum-recorded": false, + "maximum-recorded": false + }, + { + "name": "SW U04", + "controllable": false, + "low-crit-threshold": false, + "high-threshold": false, + "high-crit-threshold": false, + "minimum-recorded": false, + "maximum-recorded": false + }, + { + "name": "SW U14", + "controllable": false, + "low-crit-threshold": false, + "high-threshold": false, + "high-crit-threshold": false, + "minimum-recorded": false, + "maximum-recorded": false + }, + { + "name": "SW U4403", + "controllable": false, + "low-crit-threshold": false, + "high-threshold": false, + "high-crit-threshold": false, + "minimum-recorded": false, + "maximum-recorded": false + } + ], + "modules": [], + "sfps": [ + { + "name": "QSFP-DD Double Density 8X Pluggable Transceiver" + }, + { + "name": "QSFP-DD Double Density 8X Pluggable Transceiver" + }, + { + "name": "QSFP-DD Double Density 8X Pluggable Transceiver" + }, + { + "name": "QSFP-DD Double Density 8X Pluggable Transceiver" + }, + { + "name": "QSFP-DD Double Density 8X Pluggable Transceiver" + }, + { + "name": "QSFP-DD Double Density 8X Pluggable Transceiver" + }, + { + "name": "QSFP-DD Double Density 8X Pluggable Transceiver" + }, + { + "name": "QSFP-DD Double Density 8X Pluggable Transceiver" + }, + { + "name": "QSFP-DD Double Density 8X Pluggable Transceiver" + }, + { + "name": "QSFP-DD Double Density 8X Pluggable Transceiver" + }, + { + "name": "QSFP-DD Double Density 8X Pluggable Transceiver" + }, + { + "name": "QSFP-DD Double Density 8X Pluggable Transceiver" + }, + { + "name": "QSFP-DD Double Density 8X Pluggable Transceiver" + }, + { + "name": "QSFP-DD Double Density 8X Pluggable Transceiver" + }, + { + "name": "QSFP-DD Double Density 8X Pluggable Transceiver" + }, + { + "name": "QSFP-DD Double Density 8X Pluggable Transceiver" + }, + { + "name": "QSFP-DD Double Density 8X Pluggable Transceiver" + }, + { + "name": "QSFP-DD Double Density 8X Pluggable Transceiver" + }, + { + "name": "QSFP-DD Double Density 8X Pluggable Transceiver" + }, + { + "name": "QSFP-DD Double Density 8X Pluggable Transceiver" + }, + { + "name": "QSFP-DD Double Density 8X Pluggable Transceiver" + }, + { + "name": "QSFP-DD Double Density 8X Pluggable Transceiver" + }, + { + "name": "QSFP-DD Double Density 8X Pluggable Transceiver" + }, + { + "name": "QSFP-DD Double Density 8X Pluggable Transceiver" + }, + { + "name": "QSFP-DD Double Density 8X Pluggable Transceiver" + }, + { + "name": "QSFP-DD Double Density 8X Pluggable Transceiver" + }, + { + "name": "QSFP-DD Double Density 8X Pluggable Transceiver" + }, + { + "name": "QSFP-DD Double Density 8X Pluggable Transceiver" + }, + { + "name": "QSFP-DD Double Density 8X Pluggable Transceiver" + }, + { + "name": "QSFP-DD Double Density 8X Pluggable Transceiver" + }, + { + "name": "QSFP-DD Double Density 8X Pluggable Transceiver" + }, + { + "name": "QSFP-DD Double Density 8X Pluggable Transceiver" + }, + { + "name": "SFP/SFP+/SFP28" + }, + { + "name": "SFP/SFP+/SFP28" + } + + ] + }, + "interfaces": {} +} diff --git a/device/dell/x86_64-dellemc_z9332f_d1508-r0/plugins/sfputil.py b/device/dell/x86_64-dellemc_z9332f_d1508-r0/plugins/sfputil.py index d037fd9273dd..f3108ff12f85 100644 --- a/device/dell/x86_64-dellemc_z9332f_d1508-r0/plugins/sfputil.py +++ b/device/dell/x86_64-dellemc_z9332f_d1508-r0/plugins/sfputil.py @@ -2,13 +2,12 @@ # # Platform-specific SFP transceiver interface for SONiC # - try: - import struct import sys import getopt import time import select + import io from sonic_sfp.sfputilbase import SfpUtilBase from os import * from mmap import * @@ -19,6 +18,25 @@ # from xcvrd SFP_STATUS_REMOVED = '0' SFP_STATUS_INSERTED = '1' +MEDIA_TYPE_OFFSET = 0 +MEDIA_TYPE_WIDTH = 1 +QSFP_DD_MODULE_ENC_OFFSET = 3 +QSFP_DD_MODULE_ENC_WIDTH = 1 + +SFP_TYPE_LIST = [ + '03' # SFP/SFP+/SFP28 and later +] +QSFP_TYPE_LIST = [ + '0c', # QSFP + '0d', # QSFP+ or later + '11' # QSFP28 or later +] +QSFP_DD_TYPE_LIST = [ + '18' #QSFP_DD Type +] +OSFP_TYPE_LIST=[ + '19' # OSFP 8X Type +] class SfpUtil(SfpUtilBase): @@ -87,18 +105,77 @@ def qsfp_ports(self): def port_to_eeprom_mapping(self): return self._port_to_eeprom_mapping + def _read_eeprom_bytes(self, eeprom_path, offset, num_bytes): + eeprom_raw = [] + try: + eeprom = io.open(eeprom_path, mode="rb", buffering=0) + except IOError: + return None + + for i in range(0, num_bytes): + eeprom_raw.append("0x00") + + try: + eeprom.seek(offset) + raw = eeprom.read(num_bytes) + except IOError: + eeprom.close() + return None + + try: + if isinstance(raw , str): + for n in range(0, num_bytes): + eeprom_raw[n] = hex(ord(raw[n]))[2:].zfill(2) + else: + for n in range(0, num_bytes): + eeprom_raw[n] = hex(raw[n])[2:].zfill(2) + + except (OSError, IOError): + eeprom.close() + return None + + eeprom.close() + return eeprom_raw + + def _write_eeprom_bytes(self, eeprom_path, offset, num_bytes, value): + try: + with io.open(eeprom_path, mode='r+b', buffering=0) as f: + f.seek(offset) + f.write(value[0:num_bytes]) + except (OSError, IOError): + return False + return True + + + def get_media_type(self, port_num): + """ + Reads optic eeprom byte to determine media type inserted + """ + eeprom_raw = [] + eeprom_raw = self._read_eeprom_bytes(self.port_to_eeprom_mapping[port_num], MEDIA_TYPE_OFFSET, + MEDIA_TYPE_WIDTH) + if eeprom_raw is not None: + if eeprom_raw[0] in SFP_TYPE_LIST: + sfp_type = 'SFP' + elif eeprom_raw[0] in QSFP_TYPE_LIST: + sfp_type = 'QSFP' + elif eeprom_raw[0] in QSFP_DD_TYPE_LIST: + sfp_type = 'QSFP_DD' + else: + #Set native port type if EEPROM type is not recognized/readable + sfp_type = 'QSFP_DD' + else: + sfp_type = 'QSFP_DD' + + return sfp_type + def pci_mem_read(self, mm, offset): mm.seek(offset) - read_data_stream = mm.read(4) - reg_val = struct.unpack('I', read_data_stream) - mem_val = str(reg_val)[1:-2] - # print "reg_val read:%x"%reg_val - return mem_val + return mm.read_byte() def pci_mem_write(self, mm, offset, data): mm.seek(offset) - # print "data to write:%x"%data - mm.write(struct.pack('I', data)) + mm.write_byte(data) def pci_set_value(self, resource, val, offset): fd = open(resource, O_RDWR) @@ -181,54 +258,70 @@ def get_low_power_mode(self, port_num): # Check for invalid port_num if port_num < self.port_start or port_num > self.port_end: return False - - # Port offset starts with 0x4000 - port_offset = 16384 + ((port_num-1) * 16) - - status = self.pci_get_value(self.BASE_RES_PATH, port_offset) - reg_value = int(status) - - # Absence of status throws error - if (reg_value == ""): + if port_num > self.PORTS_IN_BLOCK: + return False + if self.get_media_type(port_num) == 'QSFP_DD': + lpmode = self._read_eeprom_bytes(self.port_to_eeprom_mapping[port_num], QSFP_DD_MODULE_ENC_OFFSET, + QSFP_DD_MODULE_ENC_WIDTH) + if lpmode is not None: + if int(lpmode[0])>>1 == 1: + return True return False + else: + # Port offset starts with 0x4000 + port_offset = 16384 + ((port_num-1) * 16) - # Mask off 4th bit for presence - mask = (1 << 6) + status = self.pci_get_value(self.BASE_RES_PATH, port_offset) + # Absence of status throws error + if (status == ""): + return False - # LPMode is active high - if reg_value & mask == 0: - return False + reg_value = int(status) - return True + # Mask off 4th bit for presence + mask = (1 << 6) + + # LPMode is active high + if reg_value & mask == 0: + return False + return True def set_low_power_mode(self, port_num, lpmode): # Check for invalid port_num if port_num < self.port_start or port_num > self.port_end: return False - - # Port offset starts with 0x4000 - port_offset = 16384 + ((port_num-1) * 16) - - status = self.pci_get_value(self.BASE_RES_PATH, port_offset) - reg_value = int(status) - - # Absence of status throws error - if (reg_value == ""): + if port_num > self.PORTS_IN_BLOCK: return False - # Mask off 4th bit for presence - mask = (1 << 6) + if self.get_media_type(port_num) == 'QSFP_DD': + if lpmode is True: + write_val = 0x10 + else: + write_val = 0x0 - # LPMode is active high; set or clear the bit accordingly - if lpmode is True: - reg_value = reg_value | mask + self._write_eeprom_bytes(self.port_to_eeprom_mapping[port_num], 26, 1, bytearray([write_val])) else: - reg_value = reg_value & ~mask + # Port offset starts with 0x4000 + port_offset = 16384 + ((port_num-1) * 16) + status = self.pci_get_value(self.BASE_RES_PATH, port_offset) + reg_value = int(status) - # Convert our register value back to a hex string and write back - status = self.pci_set_value(self.BASE_RES_PATH, reg_value, port_offset) + # Absence of status throws error + if (reg_value == ""): + return False + + # Mask off 4th bit for presence + mask = (1 << 6) + + # LPMode is active high; set or clear the bit accordingly + if lpmode is True: + reg_value = reg_value | mask + else: + reg_value = reg_value & ~mask + # Convert our register value back to a hex string and write back + status = self.pci_set_value(self.BASE_RES_PATH, reg_value, port_offset) return True def reset(self, port_num): diff --git a/device/dell/x86_64-dellemc_z9332f_d1508-r0/system_health_monitoring_config.json b/device/dell/x86_64-dellemc_z9332f_d1508-r0/system_health_monitoring_config.json new file mode 100644 index 000000000000..4f82136007a3 --- /dev/null +++ b/device/dell/x86_64-dellemc_z9332f_d1508-r0/system_health_monitoring_config.json @@ -0,0 +1,11 @@ +{ + "services_to_ignore": [], + "devices_to_ignore": ["asic","fan.speed"], + "user_defined_checkers": [], + "polling_interval": 60, + "led_color": { + "fault": "yellow", + "normal": "green", + "booting": "flashing green" + } +} diff --git a/device/delta/x86_64-delta_ag9032v2a-r0/Delta-ag9032v2a/td3-ag9032v2a-32x100G+1x10G.config.bcm b/device/delta/x86_64-delta_ag9032v2a-r0/Delta-ag9032v2a/td3-ag9032v2a-32x100G+1x10G.config.bcm index 2cef2f4261a3..07600e0b8a65 100755 --- a/device/delta/x86_64-delta_ag9032v2a-r0/Delta-ag9032v2a/td3-ag9032v2a-32x100G+1x10G.config.bcm +++ b/device/delta/x86_64-delta_ag9032v2a-r0/Delta-ag9032v2a/td3-ag9032v2a-32x100G+1x10G.config.bcm @@ -1,3 +1,4 @@ +sai_load_hw_config=/etc/bcm/flex/bcm56870_a0_issu/b870.6.4.1/ pbmp_oversubscribe=0x00003fc000000ff0000003fc000001fe pbmp_xport_xe=0xffffffffffffffffffffffffffffffffffff core_clock_frequency=1525 diff --git a/device/delta/x86_64-delta_agc032-r0/Delta-agc032/th3-agc032-32x400G.config.bcm b/device/delta/x86_64-delta_agc032-r0/Delta-agc032/th3-agc032-32x400G.config.bcm index d3dfd269ff1b..6e5a8c9483c0 100644 --- a/device/delta/x86_64-delta_agc032-r0/Delta-agc032/th3-agc032-32x400G.config.bcm +++ b/device/delta/x86_64-delta_agc032-r0/Delta-agc032/th3-agc032-32x400G.config.bcm @@ -1,3 +1,7 @@ +# The following 2 SOC properties are needed to prevent FDB Events during Warmboot due to TH3 is SW Managed MACs +l2xmsg_shadow_hit_bits=0 +l2xmsg_no_cb_during_table_rebuild=1 + ######################################### ## cfg for AGC032 ######################################### diff --git a/device/inventec/x86_64-inventec_d6332-r0/INVENTEC-D6332/td3-d6332-32x100G-SR4.config.bcm b/device/inventec/x86_64-inventec_d6332-r0/INVENTEC-D6332/td3-d6332-32x100G-SR4.config.bcm index 27670075cf99..8fe7622f4b8f 100644 --- a/device/inventec/x86_64-inventec_d6332-r0/INVENTEC-D6332/td3-d6332-32x100G-SR4.config.bcm +++ b/device/inventec/x86_64-inventec_d6332-r0/INVENTEC-D6332/td3-d6332-32x100G-SR4.config.bcm @@ -1,3 +1,4 @@ +sai_load_hw_config=/etc/bcm/flex/bcm56870_a0_issu/b870.6.4.1/ ### fix for sonic ptp_ts_pll_fref=50000000 ptp_bs_fref_0=50000000 diff --git a/device/inventec/x86_64-inventec_d6356-r0/INVENTEC-D6356/td3-d6356-48x25G-8x100G.config.bcm b/device/inventec/x86_64-inventec_d6356-r0/INVENTEC-D6356/td3-d6356-48x25G-8x100G.config.bcm index 57fd5cd57164..089207abd136 100644 --- a/device/inventec/x86_64-inventec_d6356-r0/INVENTEC-D6356/td3-d6356-48x25G-8x100G.config.bcm +++ b/device/inventec/x86_64-inventec_d6356-r0/INVENTEC-D6356/td3-d6356-48x25G-8x100G.config.bcm @@ -1,3 +1,4 @@ +sai_load_hw_config=/etc/bcm/flex/bcm56870_a0_issu/b870.6.4.1/ ### fix for sonic ptp_ts_pll_fref=50000000 ptp_bs_fref_0=50000000 diff --git a/device/juniper/x86_64-juniper_qfx5200-r0/plugins/sfputil.py b/device/juniper/x86_64-juniper_qfx5200-r0/plugins/sfputil.py index 54dbdacc1c21..db85347be3f4 100644 --- a/device/juniper/x86_64-juniper_qfx5200-r0/plugins/sfputil.py +++ b/device/juniper/x86_64-juniper_qfx5200-r0/plugins/sfputil.py @@ -870,7 +870,7 @@ def get_transceiver_dom_info_dict(self, port_num): qsfp_dom_capability_raw = self._read_eeprom_specific_bytes( sysfsfile_eeprom, (offset_xcvr + XCVR_DOM_CAPABILITY_OFFSET), XCVR_DOM_CAPABILITY_WIDTH) if qsfp_dom_capability_raw is not None: - qspf_dom_capability_data = sfpi_obj.parse_qsfp_dom_capability(qsfp_dom_capability_raw, 0) + qspf_dom_capability_data = sfpi_obj.parse_dom_capability(qsfp_dom_capability_raw, 0) else: return None diff --git a/device/juniper/x86_64-juniper_qfx5210-r0/plugins/sfputil.py b/device/juniper/x86_64-juniper_qfx5210-r0/plugins/sfputil.py index a854f8fa2915..673bb05ed107 100644 --- a/device/juniper/x86_64-juniper_qfx5210-r0/plugins/sfputil.py +++ b/device/juniper/x86_64-juniper_qfx5210-r0/plugins/sfputil.py @@ -583,7 +583,7 @@ def get_transceiver_dom_info_dict(self, port_num): qsfp_dom_capability_raw = self._read_eeprom_specific_bytes( sysfsfile_eeprom, (offset_xcvr + XCVR_DOM_CAPABILITY_OFFSET), XCVR_DOM_CAPABILITY_WIDTH) if qsfp_dom_capability_raw is not None: - qspf_dom_capability_data = sfpi_obj.parse_qsfp_dom_capability(qsfp_dom_capability_raw, 0) + qspf_dom_capability_data = sfpi_obj.parse_dom_capability(qsfp_dom_capability_raw, 0) else: return None diff --git a/device/mellanox/x86_64-mlnx_msn2010-r0/ACS-MSN2010/buffers_defaults_objects.j2 b/device/mellanox/x86_64-mlnx_msn2010-r0/ACS-MSN2010/buffers_defaults_objects.j2 new file mode 120000 index 000000000000..33b6704f9902 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn2010-r0/ACS-MSN2010/buffers_defaults_objects.j2 @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/ACS-MSN2700/buffers_defaults_objects.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn2010-r0/ACS-MSN2010/sai.profile b/device/mellanox/x86_64-mlnx_msn2010-r0/ACS-MSN2010/sai.profile index c13ca373750d..fa261ec655c2 100644 --- a/device/mellanox/x86_64-mlnx_msn2010-r0/ACS-MSN2010/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn2010-r0/ACS-MSN2010/sai.profile @@ -1 +1,3 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_2010.xml +SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps +SAI_DUMP_STORE_AMOUNT=10 diff --git a/device/mellanox/x86_64-mlnx_msn2010-r0/ACS-MSN2010/sai_2010.xml b/device/mellanox/x86_64-mlnx_msn2010-r0/ACS-MSN2010/sai_2010.xml index 34151a434a23..3383a5f406ef 100644 --- a/device/mellanox/x86_64-mlnx_msn2010-r0/ACS-MSN2010/sai_2010.xml +++ b/device/mellanox/x86_64-mlnx_msn2010-r0/ACS-MSN2010/sai_2010.xml @@ -21,7 +21,7 @@ 0 - + 939524096 diff --git a/device/mellanox/x86_64-mlnx_msn2010-r0/platform.json b/device/mellanox/x86_64-mlnx_msn2010-r0/platform.json new file mode 100644 index 000000000000..290a1b780390 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn2010-r0/platform.json @@ -0,0 +1,252 @@ +{ + "chassis": { + "name": "MSN2010", + "components": [ + { + "name": "ONIE" + }, + { + "name": "SSD" + }, + { + "name": "BIOS" + }, + { + "name": "CPLD1" + }, + { + "name": "CPLD2" + } + ], + "fans": [], + "fan_drawers": [ + { + "name": "N/A", + "fans": [ + { + "name": "fan1" + }, + { + "name": "fan2" + }, + { + "name": "fan3" + }, + { + "name": "fan4" + } + ] + } + ], + "psus": [ + { + "name": "PSU 1" + }, + { + "name": "PSU 2" + } + ], + "thermals": [ + { + "name": "ASIC" + }, + { + "name": "Ambient Fan Side Temp" + }, + { + "name": "Ambient Port Side Temp" + }, + { + "name": "CPU Core 0 Temp" + }, + { + "name": "CPU Core 1 Temp" + }, + { + "name": "CPU Core 2 Temp" + }, + { + "name": "CPU Core 3 Temp" + } + ], + "sfps": [ + { + "name": "sfp1", + "thermals": [ + { + "name": "xSFP module 1 Temp" + } + ] + }, + { + "name": "sfp2", + "thermals": [ + { + "name": "xSFP module 2 Temp" + } + ] + }, + { + "name": "sfp3", + "thermals": [ + { + "name": "xSFP module 3 Temp" + } + ] + }, + { + "name": "sfp4", + "thermals": [ + { + "name": "xSFP module 4 Temp" + } + ] + }, + { + "name": "sfp5", + "thermals": [ + { + "name": "xSFP module 5 Temp" + } + ] + }, + { + "name": "sfp6", + "thermals": [ + { + "name": "xSFP module 6 Temp" + } + ] + }, + { + "name": "sfp7", + "thermals": [ + { + "name": "xSFP module 7 Temp" + } + ] + }, + { + "name": "sfp8", + "thermals": [ + { + "name": "xSFP module 8 Temp" + } + ] + }, + { + "name": "sfp9", + "thermals": [ + { + "name": "xSFP module 9 Temp" + } + ] + }, + { + "name": "sfp10", + "thermals": [ + { + "name": "xSFP module 10 Temp" + } + ] + }, + { + "name": "sfp11", + "thermals": [ + { + "name": "xSFP module 11 Temp" + } + ] + }, + { + "name": "sfp12", + "thermals": [ + { + "name": "xSFP module 12 Temp" + } + ] + }, + { + "name": "sfp13", + "thermals": [ + { + "name": "xSFP module 13 Temp" + } + ] + }, + { + "name": "sfp14", + "thermals": [ + { + "name": "xSFP module 14 Temp" + } + ] + }, + { + "name": "sfp15", + "thermals": [ + { + "name": "xSFP module 15 Temp" + } + ] + }, + { + "name": "sfp16", + "thermals": [ + { + "name": "xSFP module 16 Temp" + } + ] + }, + { + "name": "sfp17", + "thermals": [ + { + "name": "xSFP module 17 Temp" + } + ] + }, + { + "name": "sfp18", + "thermals": [ + { + "name": "xSFP module 18 Temp" + } + ] + }, + { + "name": "sfp19", + "thermals": [ + { + "name": "xSFP module 19 Temp" + } + ] + }, + { + "name": "sfp20", + "thermals": [ + { + "name": "xSFP module 20 Temp" + } + ] + }, + { + "name": "sfp21", + "thermals": [ + { + "name": "xSFP module 21 Temp" + } + ] + }, + { + "name": "sfp22", + "thermals": [ + { + "name": "xSFP module 22 Temp" + } + ] + } + ] + }, + "interfaces": {} +} diff --git a/device/mellanox/x86_64-mlnx_msn2100-r0/ACS-MSN2100/buffers_defaults_objects.j2 b/device/mellanox/x86_64-mlnx_msn2100-r0/ACS-MSN2100/buffers_defaults_objects.j2 new file mode 120000 index 000000000000..33b6704f9902 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn2100-r0/ACS-MSN2100/buffers_defaults_objects.j2 @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/ACS-MSN2700/buffers_defaults_objects.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn2100-r0/ACS-MSN2100/sai.profile b/device/mellanox/x86_64-mlnx_msn2100-r0/ACS-MSN2100/sai.profile index 5a381e4666ee..25f879a531d4 100644 --- a/device/mellanox/x86_64-mlnx_msn2100-r0/ACS-MSN2100/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn2100-r0/ACS-MSN2100/sai.profile @@ -1 +1,3 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_2100.xml +SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps +SAI_DUMP_STORE_AMOUNT=10 diff --git a/device/mellanox/x86_64-mlnx_msn2100-r0/ACS-MSN2100/sai_2100.xml b/device/mellanox/x86_64-mlnx_msn2100-r0/ACS-MSN2100/sai_2100.xml index 92150596df64..efa0ccd2721f 100644 --- a/device/mellanox/x86_64-mlnx_msn2100-r0/ACS-MSN2100/sai_2100.xml +++ b/device/mellanox/x86_64-mlnx_msn2100-r0/ACS-MSN2100/sai_2100.xml @@ -21,7 +21,7 @@ 3 - + 98368 diff --git a/device/mellanox/x86_64-mlnx_msn2100-r0/platform.json b/device/mellanox/x86_64-mlnx_msn2100-r0/platform.json new file mode 100644 index 000000000000..21ad5796519e --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn2100-r0/platform.json @@ -0,0 +1,204 @@ +{ + "chassis": { + "name": "MSN2100", + "components": [ + { + "name": "ONIE" + }, + { + "name": "SSD" + }, + { + "name": "BIOS" + }, + { + "name": "CPLD1" + }, + { + "name": "CPLD2" + } + ], + "fans": [], + "fan_drawers": [ + { + "name": "N/A", + "fans": [ + { + "name": "fan1" + }, + { + "name": "fan2" + }, + { + "name": "fan3" + }, + { + "name": "fan4" + } + ] + } + ], + "psus": [ + { + "name": "PSU 1" + }, + { + "name": "PSU 2" + } + ], + "thermals": [ + { + "name": "ASIC" + }, + { + "name": "Ambient Fan Side Temp" + }, + { + "name": "Ambient Port Side Temp" + }, + { + "name": "CPU Core 0 Temp" + }, + { + "name": "CPU Core 1 Temp" + }, + { + "name": "CPU Core 2 Temp" + }, + { + "name": "CPU Core 3 Temp" + } + ], + "sfps": [ + { + "name": "sfp1", + "thermals": [ + { + "name": "xSFP module 1 Temp" + } + ] + }, + { + "name": "sfp2", + "thermals": [ + { + "name": "xSFP module 2 Temp" + } + ] + }, + { + "name": "sfp3", + "thermals": [ + { + "name": "xSFP module 3 Temp" + } + ] + }, + { + "name": "sfp4", + "thermals": [ + { + "name": "xSFP module 4 Temp" + } + ] + }, + { + "name": "sfp5", + "thermals": [ + { + "name": "xSFP module 5 Temp" + } + ] + }, + { + "name": "sfp6", + "thermals": [ + { + "name": "xSFP module 6 Temp" + } + ] + }, + { + "name": "sfp7", + "thermals": [ + { + "name": "xSFP module 7 Temp" + } + ] + }, + { + "name": "sfp8", + "thermals": [ + { + "name": "xSFP module 8 Temp" + } + ] + }, + { + "name": "sfp9", + "thermals": [ + { + "name": "xSFP module 9 Temp" + } + ] + }, + { + "name": "sfp10", + "thermals": [ + { + "name": "xSFP module 10 Temp" + } + ] + }, + { + "name": "sfp11", + "thermals": [ + { + "name": "xSFP module 11 Temp" + } + ] + }, + { + "name": "sfp12", + "thermals": [ + { + "name": "xSFP module 12 Temp" + } + ] + }, + { + "name": "sfp13", + "thermals": [ + { + "name": "xSFP module 13 Temp" + } + ] + }, + { + "name": "sfp14", + "thermals": [ + { + "name": "xSFP module 14 Temp" + } + ] + }, + { + "name": "sfp15", + "thermals": [ + { + "name": "xSFP module 15 Temp" + } + ] + }, + { + "name": "sfp16", + "thermals": [ + { + "name": "xSFP module 16 Temp" + } + ] + } + ] + }, + "interfaces": {} +} diff --git a/device/mellanox/x86_64-mlnx_msn2410-r0/ACS-MSN2410/buffers_defaults_objects.j2 b/device/mellanox/x86_64-mlnx_msn2410-r0/ACS-MSN2410/buffers_defaults_objects.j2 new file mode 120000 index 000000000000..33b6704f9902 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn2410-r0/ACS-MSN2410/buffers_defaults_objects.j2 @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/ACS-MSN2700/buffers_defaults_objects.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn2410-r0/ACS-MSN2410/sai.profile b/device/mellanox/x86_64-mlnx_msn2410-r0/ACS-MSN2410/sai.profile index f7cb264c2287..b707c2692102 100644 --- a/device/mellanox/x86_64-mlnx_msn2410-r0/ACS-MSN2410/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn2410-r0/ACS-MSN2410/sai.profile @@ -1 +1,3 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_2410.xml +SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps +SAI_DUMP_STORE_AMOUNT=10 diff --git a/device/mellanox/x86_64-mlnx_msn2410-r0/ACS-MSN2410/sai_2410.xml b/device/mellanox/x86_64-mlnx_msn2410-r0/ACS-MSN2410/sai_2410.xml index 4884cd754a30..03d694c97723 100644 --- a/device/mellanox/x86_64-mlnx_msn2410-r0/ACS-MSN2410/sai_2410.xml +++ b/device/mellanox/x86_64-mlnx_msn2410-r0/ACS-MSN2410/sai_2410.xml @@ -21,7 +21,7 @@ 0 - + 939524096 diff --git a/device/mellanox/x86_64-mlnx_msn2410-r0/platform.json b/device/mellanox/x86_64-mlnx_msn2410-r0/platform.json new file mode 100644 index 000000000000..b0ee5d19863a --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn2410-r0/platform.json @@ -0,0 +1,571 @@ +{ + "chassis": { + "name": "MSN2410", + "components": [ + { + "name": "ONIE" + }, + { + "name": "SSD" + }, + { + "name": "BIOS" + }, + { + "name": "CPLD1" + }, + { + "name": "CPLD2" + }, + { + "name": "CPLD3" + } + ], + "fans": [], + "fan_drawers": [ + { + "name": "drawer1", + "fans": [ + { + "name": "fan1" + }, + { + "name": "fan2" + } + ] + }, + { + "name": "drawer2", + "fans": [ + { + "name": "fan3" + }, + { + "name": "fan4" + } + ] + }, + { + "name": "drawer3", + "fans": [ + { + "name": "fan5" + }, + { + "name": "fan6" + } + ] + }, + { + "name": "drawer4", + "fans": [ + { + "name": "fan7" + }, + { + "name": "fan8" + } + ] + } + ], + "psus": [ + { + "name": "PSU 1", + "fans": [ + { + "name": "psu1_fan1" + } + ], + "thermals": [ + { + "name": "PSU-1 Temp" + } + ] + }, + { + "name": "PSU 2", + "fans": [ + { + "name": "psu2_fan1" + } + ], + "thermals": [ + { + "name": "PSU-2 Temp" + } + ] + } + ], + "thermals": [ + { + "name": "ASIC" + }, + { + "name": "Ambient Fan Side Temp" + }, + { + "name": "Ambient Port Side Temp" + }, + { + "name": "CPU Core 0 Temp" + }, + { + "name": "CPU Core 1 Temp" + }, + { + "name": "CPU Pack Temp" + } + ], + "sfps": [ + { + "name": "sfp1", + "thermals": [ + { + "name": "xSFP module 1 Temp" + } + ] + }, + { + "name": "sfp2", + "thermals": [ + { + "name": "xSFP module 2 Temp" + } + ] + }, + { + "name": "sfp3", + "thermals": [ + { + "name": "xSFP module 3 Temp" + } + ] + }, + { + "name": "sfp4", + "thermals": [ + { + "name": "xSFP module 4 Temp" + } + ] + }, + { + "name": "sfp5", + "thermals": [ + { + "name": "xSFP module 5 Temp" + } + ] + }, + { + "name": "sfp6", + "thermals": [ + { + "name": "xSFP module 6 Temp" + } + ] + }, + { + "name": "sfp7", + "thermals": [ + { + "name": "xSFP module 7 Temp" + } + ] + }, + { + "name": "sfp8", + "thermals": [ + { + "name": "xSFP module 8 Temp" + } + ] + }, + { + "name": "sfp9", + "thermals": [ + { + "name": "xSFP module 9 Temp" + } + ] + }, + { + "name": "sfp10", + "thermals": [ + { + "name": "xSFP module 10 Temp" + } + ] + }, + { + "name": "sfp11", + "thermals": [ + { + "name": "xSFP module 11 Temp" + } + ] + }, + { + "name": "sfp12", + "thermals": [ + { + "name": "xSFP module 12 Temp" + } + ] + }, + { + "name": "sfp13", + "thermals": [ + { + "name": "xSFP module 13 Temp" + } + ] + }, + { + "name": "sfp14", + "thermals": [ + { + "name": "xSFP module 14 Temp" + } + ] + }, + { + "name": "sfp15", + "thermals": [ + { + "name": "xSFP module 15 Temp" + } + ] + }, + { + "name": "sfp16", + "thermals": [ + { + "name": "xSFP module 16 Temp" + } + ] + }, + { + "name": "sfp17", + "thermals": [ + { + "name": "xSFP module 17 Temp" + } + ] + }, + { + "name": "sfp18", + "thermals": [ + { + "name": "xSFP module 18 Temp" + } + ] + }, + { + "name": "sfp19", + "thermals": [ + { + "name": "xSFP module 19 Temp" + } + ] + }, + { + "name": "sfp20", + "thermals": [ + { + "name": "xSFP module 20 Temp" + } + ] + }, + { + "name": "sfp21", + "thermals": [ + { + "name": "xSFP module 21 Temp" + } + ] + }, + { + "name": "sfp22", + "thermals": [ + { + "name": "xSFP module 22 Temp" + } + ] + }, + { + "name": "sfp23", + "thermals": [ + { + "name": "xSFP module 23 Temp" + } + ] + }, + { + "name": "sfp24", + "thermals": [ + { + "name": "xSFP module 24 Temp" + } + ] + }, + { + "name": "sfp25", + "thermals": [ + { + "name": "xSFP module 25 Temp" + } + ] + }, + { + "name": "sfp26", + "thermals": [ + { + "name": "xSFP module 26 Temp" + } + ] + }, + { + "name": "sfp27", + "thermals": [ + { + "name": "xSFP module 27 Temp" + } + ] + }, + { + "name": "sfp28", + "thermals": [ + { + "name": "xSFP module 28 Temp" + } + ] + }, + { + "name": "sfp29", + "thermals": [ + { + "name": "xSFP module 29 Temp" + } + ] + }, + { + "name": "sfp30", + "thermals": [ + { + "name": "xSFP module 30 Temp" + } + ] + }, + { + "name": "sfp31", + "thermals": [ + { + "name": "xSFP module 31 Temp" + } + ] + }, + { + "name": "sfp32", + "thermals": [ + { + "name": "xSFP module 32 Temp" + } + ] + }, + { + "name": "sfp33", + "thermals": [ + { + "name": "xSFP module 33 Temp" + } + ] + }, + { + "name": "sfp34", + "thermals": [ + { + "name": "xSFP module 34 Temp" + } + ] + }, + { + "name": "sfp35", + "thermals": [ + { + "name": "xSFP module 35 Temp" + } + ] + }, + { + "name": "sfp36", + "thermals": [ + { + "name": "xSFP module 36 Temp" + } + ] + }, + { + "name": "sfp37", + "thermals": [ + { + "name": "xSFP module 37 Temp" + } + ] + }, + { + "name": "sfp38", + "thermals": [ + { + "name": "xSFP module 38 Temp" + } + ] + }, + { + "name": "sfp39", + "thermals": [ + { + "name": "xSFP module 39 Temp" + } + ] + }, + { + "name": "sfp40", + "thermals": [ + { + "name": "xSFP module 40 Temp" + } + ] + }, + { + "name": "sfp41", + "thermals": [ + { + "name": "xSFP module 41 Temp" + } + ] + }, + { + "name": "sfp42", + "thermals": [ + { + "name": "xSFP module 42 Temp" + } + ] + }, + { + "name": "sfp43", + "thermals": [ + { + "name": "xSFP module 43 Temp" + } + ] + }, + { + "name": "sfp44", + "thermals": [ + { + "name": "xSFP module 44 Temp" + } + ] + }, + { + "name": "sfp45", + "thermals": [ + { + "name": "xSFP module 45 Temp" + } + ] + }, + { + "name": "sfp46", + "thermals": [ + { + "name": "xSFP module 46 Temp" + } + ] + }, + { + "name": "sfp47", + "thermals": [ + { + "name": "xSFP module 47 Temp" + } + ] + }, + { + "name": "sfp48", + "thermals": [ + { + "name": "xSFP module 48 Temp" + } + ] + }, + { + "name": "sfp49", + "thermals": [ + { + "name": "xSFP module 49 Temp" + } + ] + }, + { + "name": "sfp50", + "thermals": [ + { + "name": "xSFP module 50 Temp" + } + ] + }, + { + "name": "sfp51", + "thermals": [ + { + "name": "xSFP module 51 Temp" + } + ] + }, + { + "name": "sfp52", + "thermals": [ + { + "name": "xSFP module 52 Temp" + } + ] + }, + { + "name": "sfp53", + "thermals": [ + { + "name": "xSFP module 53 Temp" + } + ] + }, + { + "name": "sfp54", + "thermals": [ + { + "name": "xSFP module 54 Temp" + } + ] + }, + { + "name": "sfp55", + "thermals": [ + { + "name": "xSFP module 55 Temp" + } + ] + }, + { + "name": "sfp56", + "thermals": [ + { + "name": "xSFP module 56 Temp" + } + ] + } + ] + }, + "interfaces": {} +} diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/ACS-MSN2700/buffers_defaults_objects.j2 b/device/mellanox/x86_64-mlnx_msn2700-r0/ACS-MSN2700/buffers_defaults_objects.j2 new file mode 100644 index 000000000000..52baa1899e68 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/ACS-MSN2700/buffers_defaults_objects.j2 @@ -0,0 +1,229 @@ +{%- macro generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) %} + "BUFFER_POOL": { + {% if dynamic_mode is not defined and port_names_inactive|length > 0 -%} + "ingress_zero_pool" : { + "mode": "static", + "type": "ingress", + "size": "0" + }, + {% endif -%} + "ingress_lossless_pool": { + {% if dynamic_mode is not defined -%} + "size": "{{ ingress_lossless_pool_size }}", + {% endif -%} + "type": "ingress", + "mode": "dynamic" + }, + "ingress_lossy_pool": { + {% if dynamic_mode is not defined -%} + "size": "{{ ingress_lossy_pool_size }}", + {% endif -%} + "type": "ingress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "{{ egress_lossless_pool_size }}", + "type": "egress", + "mode": "dynamic" + }, + "egress_lossy_pool": { + {% if dynamic_mode is not defined -%} + "size": "{{ egress_lossy_pool_size }}", + {% endif -%} + "type": "egress", + "mode": "dynamic" + } + }, + "BUFFER_PROFILE": { + {% if dynamic_mode is not defined and port_names_inactive|length > 0 -%} + "ingress_lossy_pg_zero_profile" : { + "pool":"[BUFFER_POOL|ingress_zero_pool]", + "size":"0", + "static_th":"0" + }, + "ingress_lossless_zero_profile" : { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "dynamic_th":"-8" + }, + "ingress_lossy_zero_profile" : { + "pool":"[BUFFER_POOL|ingress_lossy_pool]", + "size":"0", + "dynamic_th":"-8" + }, + "egress_lossless_zero_profile" : { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"0", + "dynamic_th":"-8" + }, + "egress_lossy_zero_profile" : { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"0", + "dynamic_th":"-8" + }, + {% endif -%} + "ingress_lossless_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "dynamic_th":"7" + }, + "ingress_lossy_profile": { + "pool":"[BUFFER_POOL|ingress_lossy_pool]", + "size":"0", + "dynamic_th":"3" + }, + "egress_lossless_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"0", + "dynamic_th":"7" + }, + "egress_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"9216", + "dynamic_th":"7" + }, + "q_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"0", + "dynamic_th":"3" + } + }, +{%- endmacro %} + +{%- macro generate_profile_lists(port_names_active, port_names_inactive) %} + "BUFFER_PORT_INGRESS_PROFILE_LIST": { +{% for port in port_names_active.split(',') %} + "{{ port }}": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" + }{% if not loop.last %},{% endif %} + +{% endfor %} +{% if port_names_inactive|length > 0 %} +, +{% for port in port_names_inactive.split(',') %} + "{{ port }}": { +{% if dynamic_mode is defined %} + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" +{% else %} + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile],[BUFFER_PROFILE|ingress_lossy_zero_profile]" +{% endif %} + }{% if not loop.last %},{% endif %} + +{% endfor %} +{% endif %} + }, + "BUFFER_PORT_EGRESS_PROFILE_LIST": { +{% for port in port_names_active.split(',') %} + "{{ port }}": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }{% if not loop.last %},{% endif %} + +{% endfor %} +{% if port_names_inactive|length > 0 %} +, +{% for port in port_names_inactive.split(',') %} + "{{ port }}": { +{% if dynamic_mode is defined %} + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" +{% else %} + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" +{% endif %} + }{% if not loop.last %},{% endif %} + +{% endfor %} +{% endif %} + } +{%- endmacro %} + +{%- macro generate_queue_buffers(port_names_active, port_names_inactive) %} + "BUFFER_QUEUE": { +{% for port in port_names_active.split(',') %} + "{{ port }}|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, +{% endfor %} +{% for port in port_names_active.split(',') %} + "{{ port }}|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, +{% endfor %} +{% for port in port_names_active.split(',') %} + "{{ port }}|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }{% if not loop.last %},{% endif %} + +{% endfor %} +{% if port_names_inactive|length > 0 %} +, +{% if dynamic_mode is defined %} +{% for port in port_names_inactive.split(',') %} + "{{ port }}|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, +{% endfor %} +{% for port in port_names_inactive.split(',') %} + "{{ port }}|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, +{% endfor %} +{% for port in port_names_inactive.split(',') %} + "{{ port }}|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }{% if not loop.last %},{% endif %} + +{% endfor %} +{% else %} +{% for port in port_names_inactive.split(',') %} + "{{ port }}|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, +{% endfor %} +{% for port in port_names_inactive.split(',') %} + "{{ port }}|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, +{% endfor %} +{% for port in port_names_inactive.split(',') %} + "{{ port }}|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }{% if not loop.last %},{% endif %} + +{% endfor %} +{% endif %} +{% endif %} + } +{%- endmacro %} + +{%- macro generate_pg_profiles(port_names_active, port_names_inactive) %} + "BUFFER_PG": { +{% for port in port_names_active.split(',') %} +{% if dynamic_mode is defined %} + "{{ port }}|3-4": { + "profile" : "NULL" + }, +{% endif %} + "{{ port }}|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }{% if not loop.last %},{% endif %} + +{% endfor %} +{% if port_names_inactive|length > 0 %} +{%- for port in port_names_inactive.split(',') %} + {%- if loop.first -%},{%- endif -%} +{% if dynamic_mode is defined %} + "{{ port }}|3-4": { + "profile" : "NULL" + }, +{% endif %} + "{{ port }}|0": { +{% if dynamic_mode is defined %} + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" +{% else %} + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" +{% endif %} + }{% if not loop.last %},{% endif %} + +{% endfor %} +{% endif %} + } +{%- endmacro %} diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/ACS-MSN2700/buffers_defaults_t0.j2 b/device/mellanox/x86_64-mlnx_msn2700-r0/ACS-MSN2700/buffers_defaults_t0.j2 index d0bce94ba51d..515761c89f8a 100644 --- a/device/mellanox/x86_64-mlnx_msn2700-r0/ACS-MSN2700/buffers_defaults_t0.j2 +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/ACS-MSN2700/buffers_defaults_t0.j2 @@ -4,109 +4,20 @@ {% set egress_lossless_pool_size = '13945824' %} {% set egress_lossy_pool_size = '4580864' %} -{%- macro generate_port_lists(PORT_ALL) %} - {# Generate list of ports #} - {%- for port_idx in range(0, 32) %} - {%- if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{%- endif %} - {%- endfor %} -{%- endmacro %} +{% import 'buffers_defaults_objects.j2' as defs with context %} -{%- macro generate_buffer_pool_and_profiles() %} - "BUFFER_POOL": { - "ingress_lossless_pool": { - {%- if dynamic_mode is not defined %} - "size": "{{ ingress_lossless_pool_size }}", - {%- endif %} - "type": "ingress", - "mode": "dynamic" - }, - "ingress_lossy_pool": { - {%- if dynamic_mode is not defined %} - "size": "{{ ingress_lossy_pool_size }}", - {%- endif %} - "type": "ingress", - "mode": "dynamic" - }, - "egress_lossless_pool": { - "size": "{{ egress_lossless_pool_size }}", - "type": "egress", - "mode": "dynamic" - }, - "egress_lossy_pool": { - {%- if dynamic_mode is not defined %} - "size": "{{ egress_lossy_pool_size }}", - {%- endif %} - "type": "egress", - "mode": "dynamic" - } - }, - "BUFFER_PROFILE": { - "ingress_lossless_profile": { - "pool":"[BUFFER_POOL|ingress_lossless_pool]", - "size":"0", - "dynamic_th":"7" - }, - "ingress_lossy_profile": { - "pool":"[BUFFER_POOL|ingress_lossy_pool]", - "size":"0", - "dynamic_th":"3" - }, - "egress_lossless_profile": { - "pool":"[BUFFER_POOL|egress_lossless_pool]", - "size":"0", - "dynamic_th":"7" - }, - "egress_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"9216", - "dynamic_th":"7" - }, - "q_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"0", - "dynamic_th":"3" - } - }, +{%- macro generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) %} +{{ defs.generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) }} {%- endmacro %} -{%- macro generate_profile_lists(port_names) %} - "BUFFER_PORT_INGRESS_PROFILE_LIST": { -{% for port in port_names.split(',') %} - "{{ port }}": { - "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" - }{% if not loop.last %},{% endif %} - -{% endfor %} - }, - "BUFFER_PORT_EGRESS_PROFILE_LIST": { -{% for port in port_names.split(',') %} - "{{ port }}": { - "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" - }{% if not loop.last %},{% endif %} - -{% endfor %} - } +{%- macro generate_profile_lists_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_profile_lists(port_names_active, port_names_inactive) }} {%- endmacro %} -{%- macro generate_queue_buffers(port_names) %} - "BUFFER_QUEUE": { -{% for port in port_names.split(',') %} - "{{ port }}|3-4": { - "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" - }, -{% endfor %} -{% for port in port_names.split(',') %} - "{{ port }}|0-2": { - "profile" : "[BUFFER_PROFILE|q_lossy_profile]" - }, -{% endfor %} -{% for port in port_names.split(',') %} - "{{ port }}|5-6": { - "profile" : "[BUFFER_PROFILE|q_lossy_profile]" - }{% if not loop.last %},{% endif %} - -{% endfor %} - } +{%- macro generate_queue_buffers_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_queue_buffers(port_names_active, port_names_inactive) }} {%- endmacro %} - +{%- macro generate_pg_profiles_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_pg_profiles(port_names_active, port_names_inactive) }} +{%- endmacro %} diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/ACS-MSN2700/buffers_defaults_t1.j2 b/device/mellanox/x86_64-mlnx_msn2700-r0/ACS-MSN2700/buffers_defaults_t1.j2 index 5514c47a4090..1f6132da6380 100644 --- a/device/mellanox/x86_64-mlnx_msn2700-r0/ACS-MSN2700/buffers_defaults_t1.j2 +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/ACS-MSN2700/buffers_defaults_t1.j2 @@ -4,109 +4,20 @@ {% set egress_lossless_pool_size = '13945824' %} {% set egress_lossy_pool_size = '3302912' %} -{%- macro generate_port_lists(PORT_ALL) %} - {# Generate list of ports #} - {%- for port_idx in range(0, 32) %} - {%- if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{%- endif %} - {%- endfor %} -{%- endmacro %} +{% import 'buffers_defaults_objects.j2' as defs with context %} -{%- macro generate_buffer_pool_and_profiles() %} - "BUFFER_POOL": { - "ingress_lossless_pool": { - {%- if dynamic_mode is not defined %} - "size": "{{ ingress_lossless_pool_size }}", - {%- endif %} - "type": "ingress", - "mode": "dynamic" - }, - "ingress_lossy_pool": { - {%- if dynamic_mode is not defined %} - "size": "{{ ingress_lossy_pool_size }}", - {%- endif %} - "type": "ingress", - "mode": "dynamic" - }, - "egress_lossless_pool": { - "size": "{{ egress_lossless_pool_size }}", - "type": "egress", - "mode": "dynamic" - }, - "egress_lossy_pool": { - {%- if dynamic_mode is not defined %} - "size": "{{ egress_lossy_pool_size }}", - {%- endif %} - "type": "egress", - "mode": "dynamic" - } - }, - "BUFFER_PROFILE": { - "ingress_lossless_profile": { - "pool":"[BUFFER_POOL|ingress_lossless_pool]", - "size":"0", - "dynamic_th":"7" - }, - "ingress_lossy_profile": { - "pool":"[BUFFER_POOL|ingress_lossy_pool]", - "size":"0", - "dynamic_th":"3" - }, - "egress_lossless_profile": { - "pool":"[BUFFER_POOL|egress_lossless_pool]", - "size":"0", - "dynamic_th":"7" - }, - "egress_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"9216", - "dynamic_th":"7" - }, - "q_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"0", - "dynamic_th":"3" - } - }, +{%- macro generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) %} +{{ defs.generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) }} {%- endmacro %} -{%- macro generate_profile_lists(port_names) %} - "BUFFER_PORT_INGRESS_PROFILE_LIST": { -{% for port in port_names.split(',') %} - "{{ port }}": { - "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" - }{% if not loop.last %},{% endif %} - -{% endfor %} - }, - "BUFFER_PORT_EGRESS_PROFILE_LIST": { -{% for port in port_names.split(',') %} - "{{ port }}": { - "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" - }{% if not loop.last %},{% endif %} - -{% endfor %} - } +{%- macro generate_profile_lists_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_profile_lists(port_names_active, port_names_inactive) }} {%- endmacro %} -{%- macro generate_queue_buffers(port_names) %} - "BUFFER_QUEUE": { -{% for port in port_names.split(',') %} - "{{ port }}|3-4": { - "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" - }, -{% endfor %} -{% for port in port_names.split(',') %} - "{{ port }}|0-2": { - "profile" : "[BUFFER_PROFILE|q_lossy_profile]" - }, -{% endfor %} -{% for port in port_names.split(',') %} - "{{ port }}|5-6": { - "profile" : "[BUFFER_PROFILE|q_lossy_profile]" - }{% if not loop.last %},{% endif %} - -{% endfor %} - } +{%- macro generate_queue_buffers_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_queue_buffers(port_names_active, port_names_inactive) }} {%- endmacro %} - +{%- macro generate_pg_profiles_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_pg_profiles(port_names_active, port_names_inactive) }} +{%- endmacro %} diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/ACS-MSN2700/sai.profile b/device/mellanox/x86_64-mlnx_msn2700-r0/ACS-MSN2700/sai.profile index 696f3d8182f9..2b855ccb2d8e 100644 --- a/device/mellanox/x86_64-mlnx_msn2700-r0/ACS-MSN2700/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/ACS-MSN2700/sai.profile @@ -1 +1,3 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_2700.xml +SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps +SAI_DUMP_STORE_AMOUNT=10 diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/ACS-MSN2700/sai_2700.xml b/device/mellanox/x86_64-mlnx_msn2700-r0/ACS-MSN2700/sai_2700.xml index eedf359fb889..f025df1d3ef0 100644 --- a/device/mellanox/x86_64-mlnx_msn2700-r0/ACS-MSN2700/sai_2700.xml +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/ACS-MSN2700/sai_2700.xml @@ -21,7 +21,7 @@ 3 - + 98368 diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-C28D8/buffers_defaults_objects.j2 b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-C28D8/buffers_defaults_objects.j2 new file mode 120000 index 000000000000..c01aebb7ae12 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-C28D8/buffers_defaults_objects.j2 @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/buffers_defaults_objects.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-C28D8/sai.profile b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-C28D8/sai.profile index cfeb4a5fa4ba..68e245a2ce1b 100644 --- a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-C28D8/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-C28D8/sai.profile @@ -1 +1,3 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_2700_8x50g_28x100g.xml +SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps +SAI_DUMP_STORE_AMOUNT=10 diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-C28D8/sai_2700_8x50g_28x100g.xml b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-C28D8/sai_2700_8x50g_28x100g.xml index ee20db3e5dde..3127518b21a9 100644 --- a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-C28D8/sai_2700_8x50g_28x100g.xml +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-C28D8/sai_2700_8x50g_28x100g.xml @@ -21,7 +21,7 @@ 3 - + 11534336 @@ -106,7 +106,7 @@ 4 28 3 - 3221225472 + 3221487616 2 @@ -114,7 +114,7 @@ 4 29 1 - 3221225472 + 3221487616 2 @@ -122,7 +122,7 @@ 4 30 3 - 3221225472 + 3221487616 2 @@ -130,7 +130,7 @@ 4 31 1 - 3221225472 + 3221487616 2 diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D40C8S8/buffers.json.j2 b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D40C8S8/buffers.json.j2 new file mode 120000 index 000000000000..30c4e1d5bfdd --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D40C8S8/buffers.json.j2 @@ -0,0 +1 @@ +../ACS-MSN2700/buffers.json.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D40C8S8/buffers_defaults_objects.j2 b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D40C8S8/buffers_defaults_objects.j2 new file mode 120000 index 000000000000..c01aebb7ae12 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D40C8S8/buffers_defaults_objects.j2 @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/buffers_defaults_objects.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D40C8S8/buffers_defaults_t0.j2 b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D40C8S8/buffers_defaults_t0.j2 new file mode 120000 index 000000000000..a1d24c418b3e --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D40C8S8/buffers_defaults_t0.j2 @@ -0,0 +1 @@ +../Mellanox-SN2700-D48C8/buffers_defaults_t0.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D40C8S8/buffers_defaults_t1.j2 b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D40C8S8/buffers_defaults_t1.j2 new file mode 120000 index 000000000000..bef0c9d9531c --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D40C8S8/buffers_defaults_t1.j2 @@ -0,0 +1 @@ +../Mellanox-SN2700-D48C8/buffers_defaults_t1.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D40C8S8/pg_profile_lookup.ini b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D40C8S8/pg_profile_lookup.ini new file mode 100644 index 000000000000..cdd674e4e715 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D40C8S8/pg_profile_lookup.ini @@ -0,0 +1,17 @@ +# PG lossless profiles. +# speed cable size xon xoff threshold + 10000 5m 19456 19456 22528 0 + 25000 5m 19456 19456 22528 0 + 40000 5m 19456 19456 22528 0 + 50000 5m 19456 19456 22528 0 + 100000 5m 19456 19456 23552 0 + 10000 40m 19456 19456 22528 0 + 25000 40m 19456 19456 24576 0 + 40000 40m 19456 19456 25600 0 + 50000 40m 19456 19456 25600 0 + 100000 40m 19456 19456 29696 0 + 10000 300m 19456 19456 27648 0 + 25000 300m 19456 19456 36864 0 + 40000 300m 19456 19456 45056 0 + 50000 300m 19456 19456 50176 0 + 100000 300m 19456 19456 78848 0 diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D40C8S8/port_config.ini b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D40C8S8/port_config.ini new file mode 100644 index 000000000000..b4072ceb32a1 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D40C8S8/port_config.ini @@ -0,0 +1,57 @@ +# name lanes alias index speed +Ethernet0 0 etp1a 1 10000 +Ethernet1 1 etp1b 1 10000 +Ethernet2 2 etp1c 1 10000 +Ethernet3 3 etp1d 1 10000 +Ethernet8 8 etp3a 3 10000 +Ethernet9 9 etp3b 3 10000 +Ethernet10 10 etp3c 3 10000 +Ethernet11 11 etp3d 3 10000 +Ethernet16 16,17 etp5a 5 50000 +Ethernet18 18,19 etp5b 5 50000 +Ethernet20 20,21 etp6a 6 50000 +Ethernet22 22,23 etp6b 6 50000 +Ethernet24 24,25,26,27 etp7 7 100000 +Ethernet28 28,29,30,31 etp8 8 100000 +Ethernet32 32,33,34,35 etp9 9 100000 +Ethernet36 36,37,38,39 etp10 10 100000 +Ethernet40 40,41 etp11a 11 50000 +Ethernet42 42,43 etp11b 11 50000 +Ethernet44 44,45 etp12a 12 50000 +Ethernet46 46,47 etp12b 12 50000 +Ethernet48 48,49 etp13a 13 50000 +Ethernet50 50,51 etp13b 13 50000 +Ethernet52 52,53 etp14a 14 50000 +Ethernet54 54,55 etp14b 14 50000 +Ethernet56 56,57 etp15a 15 50000 +Ethernet58 58,59 etp15b 15 50000 +Ethernet60 60,61 etp16a 16 50000 +Ethernet62 62,63 etp16b 16 50000 +Ethernet64 64,65 etp17a 17 50000 +Ethernet66 66,67 etp17b 17 50000 +Ethernet68 68,69 etp18a 18 50000 +Ethernet70 70,71 etp18b 18 50000 +Ethernet72 72,73 etp19a 19 50000 +Ethernet74 74,75 etp19b 19 50000 +Ethernet76 76,77 etp20a 20 50000 +Ethernet78 78,79 etp20b 20 50000 +Ethernet80 80,81 etp21a 21 50000 +Ethernet82 82,83 etp21b 21 50000 +Ethernet84 84,85 etp22a 22 50000 +Ethernet86 86,87 etp22b 22 50000 +Ethernet88 88,89,90,91 etp23 23 100000 +Ethernet92 92,93,94,95 etp24 24 100000 +Ethernet96 96,97,98,99 etp25 25 100000 +Ethernet100 100,101,102,103 etp26 26 100000 +Ethernet104 104,105 etp27a 27 50000 +Ethernet106 106,107 etp27b 27 50000 +Ethernet108 108,109 etp28a 28 50000 +Ethernet110 110,111 etp28b 28 50000 +Ethernet112 112,113 etp29a 29 50000 +Ethernet114 114,115 etp29b 29 50000 +Ethernet116 116,117 etp30a 30 50000 +Ethernet118 118,119 etp30b 30 50000 +Ethernet120 120,121 etp31a 31 50000 +Ethernet122 122,123 etp31b 31 50000 +Ethernet124 124,125 etp32a 32 50000 +Ethernet126 126,127 etp32b 32 50000 diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D40C8S8/qos.json.j2 b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D40C8S8/qos.json.j2 new file mode 100644 index 000000000000..3e548325ea30 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D40C8S8/qos.json.j2 @@ -0,0 +1 @@ +{%- include 'qos_config.j2' %} diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D40C8S8/sai.profile b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D40C8S8/sai.profile new file mode 100644 index 000000000000..4cfa685a0ab2 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D40C8S8/sai.profile @@ -0,0 +1,3 @@ +SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_2700_8x100g_40x50g_8x10g.xml +SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps +SAI_DUMP_STORE_AMOUNT=10 diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D40C8S8/sai_2700_8x100g_40x50g_8x10g.xml b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D40C8S8/sai_2700_8x100g_40x50g_8x10g.xml new file mode 100644 index 000000000000..bc2d1509fd36 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D40C8S8/sai_2700_8x100g_40x50g_8x10g.xml @@ -0,0 +1,269 @@ + + + + + + 00:02:03:04:05:00 + + + 1 + + + 32 + + + + + 1 + 2 + 4 + 16 + + + 3 + + + 3221487616 + + + 3 + 2 + 4 + 17 + 1 + 3221487616 + + + 5 + 2 + 4 + 18 + 3 + 3221487616 + + + 7 + 2 + 4 + 19 + 1 + 3221487616 + + + 9 + 2 + 4 + 20 + 3 + 3221487616 + + + 11 + 2 + 4 + 21 + 1 + 3221487616 + + + 13 + 4 + 22 + 3 + 11534336 + + + 15 + 4 + 23 + 1 + 11534336 + + + 17 + 4 + 24 + 3 + 11534336 + + + 19 + 4 + 25 + 1 + 11534336 + + + 21 + 2 + 4 + 26 + 3 + 3221487616 + + + 23 + 2 + 4 + 27 + 1 + 3221487616 + + + 25 + 4 + 28 + 3 + 3221487616 + 2 + + + 27 + 2 + 4 + 29 + 1 + 3221487616 + + + 29 + 2 + 4 + 30 + 3 + 3221487616 + + + 31 + 2 + 4 + 31 + 1 + 3221487616 + + + 33 + 2 + 4 + 14 + 3 + 3221487616 + + + 35 + 2 + 4 + 15 + 1 + 3221487616 + + + 37 + 2 + 4 + 12 + 3 + 3221487616 + + + 39 + 2 + 4 + 13 + 1 + 3221487616 + + + 41 + 2 + 4 + 10 + 3 + 3221487616 + + + 43 + 2 + 4 + 11 + 1 + 3221487616 + + + 45 + 4 + 8 + 3 + 11534336 + + + 47 + 4 + 9 + 1 + 11534336 + + + 49 + 2 + 4 + 6 + 3 + 3221487616 + + + 51 + 4 + 7 + 1 + 11534336 + + + 53 + 2 + 4 + 4 + 3 + 3221487616 + + + 55 + 2 + 4 + 5 + 1 + 3221487616 + + + 57 + 4 + 4 + 2 + 3 + 28700 + + + 59 + 4 + 3 + 1 + 11534336 + + + 61 + 4 + 4 + 0 + 3 + 28700 + + + 63 + 4 + 1 + 1 + 11534336 + + + + diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/buffers_defaults_objects.j2 b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/buffers_defaults_objects.j2 new file mode 100644 index 000000000000..7760bfc6189a --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/buffers_defaults_objects.j2 @@ -0,0 +1,292 @@ +{%- macro generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) %} + "BUFFER_POOL": { + {% if dynamic_mode is not defined and port_names_inactive|length > 0 -%} + "ingress_zero_pool" : { + "mode": "static", + "type": "ingress", + "size": "0" + }, + {% endif -%} + "ingress_lossless_pool": { + {% if dynamic_mode is not defined -%} + "size": "{{ ingress_lossless_pool_size }}", + "xoff": "{{ ingress_lossless_pool_xoff }}", + {% endif -%} + "type": "ingress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "{{ egress_lossless_pool_size }}", + "type": "egress", + "mode": "dynamic" + }, + "egress_lossy_pool": { + {% if dynamic_mode is not defined -%} + "size": "{{ egress_lossy_pool_size }}", + {% endif -%} + "type": "egress", + "mode": "dynamic" + } + }, + "BUFFER_PROFILE": { + {% if dynamic_mode is not defined and port_names_inactive|length > 0 -%} + "ingress_lossy_pg_zero_profile" : { + "pool":"[BUFFER_POOL|ingress_zero_pool]", + "size":"0", + "static_th":"0" + }, + "ingress_lossless_zero_profile" : { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "dynamic_th":"-8" + }, + "egress_lossless_zero_profile" : { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"0", + "dynamic_th":"-8" + }, + "egress_lossy_zero_profile" : { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"0", + "dynamic_th":"-8" + }, + {% endif -%} + "ingress_lossless_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "dynamic_th":"7" + }, + "ingress_lossy_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "dynamic_th":"3" + }, + "egress_lossless_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"0", + "dynamic_th":"7" + }, + "egress_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"9216", + "dynamic_th":"7" + }, + "q_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"0", + "dynamic_th":"3" + } + }, +{%- endmacro %} + +{%- macro generate_profile_lists(port_names_active, port_names_inactive) %} + "BUFFER_PORT_INGRESS_PROFILE_LIST": { +{% for port in port_names_active.split(',') %} + "{{ port }}": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }{% if not loop.last %},{% endif %} + +{% endfor %} +{% if port_names_inactive|length > 0 %} +, +{% for port in port_names_inactive.split(',') %} + "{{ port }}": { +{% if dynamic_mode is defined %} + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" +{% else %} + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" +{% endif %} + }{% if not loop.last %},{% endif %} + +{% endfor %} +{% endif %} + }, + "BUFFER_PORT_EGRESS_PROFILE_LIST": { +{% for port in port_names_active.split(',') %} + "{{ port }}": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }{% if not loop.last %},{% endif %} + +{% endfor %} +{% if port_names_inactive|length > 0 %} +, +{% for port in port_names_inactive.split(',') %} + "{{ port }}": { +{% if dynamic_mode is defined %} + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" +{% else %} + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" +{% endif %} + }{% if not loop.last %},{% endif %} + +{% endfor %} +{% endif %} + } +{%- endmacro %} + +{%- macro generate_queue_buffers_with_extra_lossless_queues(port_names_active, port_names_extra_queues, port_names_inactive) %} + "BUFFER_QUEUE": { +{% set q_loop = namespace(last_valid=false) %} +{% for port in port_names_active.split(',') %} +{% if port not in port_names_extra_queues.split(',') %} + "{{ port }}|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, +{% endif %} +{% endfor %} +{% for port in port_names_active.split(',') %} +{% if port not in port_names_extra_queues.split(',') %} + "{{ port }}|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, +{% endif %} +{% endfor %} +{% for port in port_names_active.split(',') %} +{% if port not in port_names_extra_queues.split(',') %} +{% if port_names_extra_queues|length > 0 %} + "{{ port }}|5-7": { +{% else %} + "{{ port }}|5-6": { +{% endif %} + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }{% if not loop.last %},{% endif %} + +{% set q_loop.last_valid = true %} +{% else %} +{% set q_loop.last_valid = false %} +{% endif %} +{% endfor %} +{% if port_names_extra_queues|length > 0 %} +{% if q_loop.last_valid %},{% endif %} +{% for port in port_names_extra_queues.split(',') %} + "{{ port }}|0-1": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "{{ port }}|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "{{ port }}|5": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "{{ port }}|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "{{ port }}|7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }{% if not loop.last %},{% endif %} + +{% endfor %} +{% endif %} +{% if port_names_inactive|length > 0 %} +, +{% if dynamic_mode is defined %} +{% for port in port_names_inactive.split(',') %} + "{{ port }}|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, +{% endfor %} +{% for port in port_names_inactive.split(',') %} + "{{ port }}|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, +{% endfor %} +{% for port in port_names_inactive.split(',') %} +{% if port_names_extra_queues|length > 0 %} + "{{ port }}|5-7": { +{% else %} + "{{ port }}|5-6": { +{% endif %} + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }{% if not loop.last %},{% endif %} + +{% endfor %} +{% else %} +{% for port in port_names_inactive.split(',') %} + "{{ port }}|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, +{% endfor %} +{% for port in port_names_inactive.split(',') %} + "{{ port }}|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, +{% endfor %} +{% for port in port_names_inactive.split(',') %} +{% if port_names_extra_queues|length > 0 %} + "{{ port }}|5-7": { +{% else %} + "{{ port }}|5-6": { +{% endif %} + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }{% if not loop.last %},{% endif %} + +{% endfor %} +{% endif %} +{% endif %} + } +{%- endmacro %} + +{%- macro generate_queue_buffers(port_names_active, port_names_inactive) %} +{{ generate_queue_buffers_with_extra_lossless_queues(port_names_active, "", port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_pg_profiles_with_extra_lossless_pgs(port_names_active, port_names_extra_pgs, port_names_inactive) %} + "BUFFER_PG": { +{% set pg_loop = namespace(last_valid=false) %} +{% for port in port_names_active.split(',') %} +{% if port not in port_names_extra_pgs.split(',') %} +{% if dynamic_mode is defined %} + "{{ port }}|3-4": { + "profile" : "NULL" + }, +{% endif %} + "{{ port }}|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }{% if not loop.last %},{% endif %} + +{% set pg_loop.last_valid = true %} +{% else %} +{% set pg_loop.last_valid = false %} +{% endif %} +{% endfor %} +{% if port_names_extra_pgs|length > 0 %} +{% if pg_loop.last_valid %},{% endif %} +{% for port in port_names_extra_pgs.split(',') %} +{% if dynamic_mode is defined %} + "{{ port }}|2-4": { + "profile" : "NULL" + }, + "{{ port }}|6": { + "profile" : "NULL" + }, +{% endif %} + "{{ port }}|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }{% if not loop.last %},{% endif %} + +{% endfor %} +{% endif %} +{% if port_names_inactive|length > 0 %} +{%- for port in port_names_inactive.split(',') %} + {%- if loop.first -%},{%- endif -%} +{% if dynamic_mode is defined %} + "{{ port }}|3-4": { + "profile" : "NULL" + }, +{% endif %} + "{{ port }}|0": { +{% if dynamic_mode is defined %} + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" +{% else %} + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" +{% endif %} + }{% if not loop.last %},{% endif %} + +{% endfor %} +{% endif %} + } +{%- endmacro %} + +{%- macro generate_pg_profiles(port_names_active, port_names_inactive) %} +{{ generate_pg_profiles_with_extra_lossless_pgs(port_names_active, "", port_names_inactive) }} +{%- endmacro %} diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/buffers_defaults_t0.j2 b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/buffers_defaults_t0.j2 index 0ad78e08c6b5..eb536086ef4a 100644 --- a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/buffers_defaults_t0.j2 +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/buffers_defaults_t0.j2 @@ -1,104 +1,23 @@ {% set default_cable = '5m' %} -{% set ingress_lossless_pool_size = '6687744' %} +{% set ingress_lossless_pool_size = '7719936' %} +{% set ingress_lossless_pool_xoff = '1032192' %} {% set egress_lossless_pool_size = '13945824' %} -{% set egress_lossy_pool_size = '6687744' %} +{% set egress_lossy_pool_size = '7719936' %} -{%- macro generate_port_lists(PORT_ALL) %} - {# Generate list of ports #} - {%- for port_idx in range(0, 32) %} - {%- if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{%- endif %} - {%- endfor %} -{%- endmacro %} +{% import 'buffers_defaults_objects.j2' as defs with context %} -{%- macro generate_buffer_pool_and_profiles() %} - "BUFFER_POOL": { - "ingress_lossless_pool": { - {%- if dynamic_mode is not defined %} - "size": "{{ ingress_lossless_pool_size }}", - {%- endif %} - "type": "ingress", - "mode": "dynamic" - }, - "egress_lossless_pool": { - "size": "{{ egress_lossless_pool_size }}", - "type": "egress", - "mode": "dynamic" - }, - "egress_lossy_pool": { - {%- if dynamic_mode is not defined %} - "size": "{{ egress_lossy_pool_size }}", - {%- endif %} - "type": "egress", - "mode": "dynamic" - } - }, - "BUFFER_PROFILE": { - "ingress_lossless_profile": { - "pool":"[BUFFER_POOL|ingress_lossless_pool]", - "size":"0", - "dynamic_th":"7" - }, - "ingress_lossy_profile": { - "pool":"[BUFFER_POOL|ingress_lossless_pool]", - "size":"0", - "dynamic_th":"3" - }, - "egress_lossless_profile": { - "pool":"[BUFFER_POOL|egress_lossless_pool]", - "size":"0", - "dynamic_th":"7" - }, - "egress_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"9216", - "dynamic_th":"7" - }, - "q_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"0", - "dynamic_th":"3" - } - }, +{%- macro generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) %} +{{ defs.generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) }} {%- endmacro %} -{%- macro generate_profile_lists(port_names) %} - "BUFFER_PORT_INGRESS_PROFILE_LIST": { -{% for port in port_names.split(',') %} - "{{ port }}": { - "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" - }{% if not loop.last %},{% endif %} - -{% endfor %} - }, - "BUFFER_PORT_EGRESS_PROFILE_LIST": { -{% for port in port_names.split(',') %} - "{{ port }}": { - "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" - }{% if not loop.last %},{% endif %} - -{% endfor %} - } +{%- macro generate_profile_lists_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_profile_lists(port_names_active, port_names_inactive) }} {%- endmacro %} -{%- macro generate_queue_buffers(port_names) %} - "BUFFER_QUEUE": { -{% for port in port_names.split(',') %} - "{{ port }}|3-4": { - "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" - }, -{% endfor %} -{% for port in port_names.split(',') %} - "{{ port }}|0-2": { - "profile" : "[BUFFER_PROFILE|q_lossy_profile]" - }, -{% endfor %} -{% for port in port_names.split(',') %} - "{{ port }}|5-6": { - "profile" : "[BUFFER_PROFILE|q_lossy_profile]" - }{% if not loop.last %},{% endif %} - -{% endfor %} - } +{%- macro generate_queue_buffers_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_queue_buffers(port_names_active, port_names_inactive) }} {%- endmacro %} - +{%- macro generate_pg_profiles_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_pg_profiles(port_names_active, port_names_inactive) }} +{%- endmacro %} diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/buffers_defaults_t1.j2 b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/buffers_defaults_t1.j2 index 82f6a15b33c8..11986ab5a95a 100644 --- a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/buffers_defaults_t1.j2 +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/buffers_defaults_t1.j2 @@ -1,104 +1,23 @@ {% set default_cable = '5m' %} -{% set ingress_lossless_pool_size = '8506368' %} +{% set ingress_lossless_pool_size = '9686016' %} +{% set ingress_lossless_pool_xoff = '1179648' %} {% set egress_lossless_pool_size = '13945824' %} -{% set egress_lossy_pool_size = '8506368' %} +{% set egress_lossy_pool_size = '9686016' %} -{%- macro generate_port_lists(PORT_ALL) %} - {# Generate list of ports #} - {%- for port_idx in range(0, 32) %} - {%- if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{%- endif %} - {%- endfor %} -{%- endmacro %} +{% import 'buffers_defaults_objects.j2' as defs with context %} -{%- macro generate_buffer_pool_and_profiles() %} - "BUFFER_POOL": { - "ingress_lossless_pool": { - {%- if dynamic_mode is not defined %} - "size": "{{ ingress_lossless_pool_size }}", - {%- endif %} - "type": "ingress", - "mode": "dynamic" - }, - "egress_lossless_pool": { - "size": "{{ egress_lossless_pool_size }}", - "type": "egress", - "mode": "dynamic" - }, - "egress_lossy_pool": { - {%- if dynamic_mode is not defined %} - "size": "{{ egress_lossy_pool_size }}", - {%- endif %} - "type": "egress", - "mode": "dynamic" - } - }, - "BUFFER_PROFILE": { - "ingress_lossless_profile": { - "pool":"[BUFFER_POOL|ingress_lossless_pool]", - "size":"0", - "dynamic_th":"7" - }, - "ingress_lossy_profile": { - "pool":"[BUFFER_POOL|ingress_lossless_pool]", - "size":"0", - "dynamic_th":"3" - }, - "egress_lossless_profile": { - "pool":"[BUFFER_POOL|egress_lossless_pool]", - "size":"0", - "dynamic_th":"7" - }, - "egress_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"9216", - "dynamic_th":"7" - }, - "q_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"0", - "dynamic_th":"3" - } - }, +{%- macro generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) %} +{{ defs.generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) }} {%- endmacro %} -{%- macro generate_profile_lists(port_names) %} - "BUFFER_PORT_INGRESS_PROFILE_LIST": { -{% for port in port_names.split(',') %} - "{{ port }}": { - "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" - }{% if not loop.last %},{% endif %} - -{% endfor %} - }, - "BUFFER_PORT_EGRESS_PROFILE_LIST": { -{% for port in port_names.split(',') %} - "{{ port }}": { - "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" - }{% if not loop.last %},{% endif %} - -{% endfor %} - } +{%- macro generate_profile_lists_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_profile_lists(port_names_active, port_names_inactive) }} {%- endmacro %} -{%- macro generate_queue_buffers(port_names) %} - "BUFFER_QUEUE": { -{% for port in port_names.split(',') %} - "{{ port }}|3-4": { - "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" - }, -{% endfor %} -{% for port in port_names.split(',') %} - "{{ port }}|0-2": { - "profile" : "[BUFFER_PROFILE|q_lossy_profile]" - }, -{% endfor %} -{% for port in port_names.split(',') %} - "{{ port }}|5-6": { - "profile" : "[BUFFER_PROFILE|q_lossy_profile]" - }{% if not loop.last %},{% endif %} - -{% endfor %} - } +{%- macro generate_queue_buffers_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_queue_buffers(port_names_active, port_names_inactive) }} {%- endmacro %} - +{%- macro generate_pg_profiles_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_pg_profiles(port_names_active, port_names_inactive) }} +{%- endmacro %} diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/pg_profile_lookup.ini b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/pg_profile_lookup.ini index 15c12c1637e6..b4bb2aaadb92 100644 --- a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/pg_profile_lookup.ini +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/pg_profile_lookup.ini @@ -1,17 +1,22 @@ # PG lossless profiles. # speed cable size xon xoff threshold - 10000 5m 41984 19456 22528 0 - 25000 5m 41984 19456 22528 0 - 40000 5m 41984 19456 22528 0 - 50000 5m 41984 19456 22528 0 - 100000 5m 43008 19456 23552 0 - 10000 40m 41984 19456 22528 0 - 25000 40m 44032 19456 24576 0 - 40000 40m 45056 19456 25600 0 - 50000 40m 45056 19456 25600 0 - 100000 40m 49152 19456 29696 0 - 10000 300m 47104 19456 27648 0 - 25000 300m 56320 19456 36864 0 - 40000 300m 64512 19456 45056 0 - 50000 300m 69632 19456 50176 0 - 100000 300m 98304 19456 78848 0 + 10000 5m 19456 19456 22528 0 + 25000 5m 19456 19456 22528 0 + 40000 5m 19456 19456 22528 0 + 50000 5m 19456 19456 22528 0 + 100000 5m 19456 19456 23552 0 + 10000 40m 19456 19456 22528 0 + 25000 40m 19456 19456 24576 0 + 40000 40m 19456 19456 25600 0 + 50000 40m 19456 19456 25600 0 + 100000 40m 19456 19456 29696 0 + 10000 300m 19456 19456 27648 0 + 25000 300m 19456 19456 36864 0 + 40000 300m 19456 19456 45056 0 + 50000 300m 19456 19456 50176 0 + 100000 300m 19456 19456 78848 0 + 10000 2000m 19456 19456 29696 0 + 25000 2000m 19456 19456 58368 0 + 40000 2000m 19456 19456 87040 0 + 50000 2000m 19456 19456 105472 0 + 100000 2000m 19456 19456 199680 0 diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/sai.profile b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/sai.profile index bfbcb1e78f47..aa93654b5406 100644 --- a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/sai.profile @@ -1 +1,4 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_2700_48x50g_8x100g.xml +SAI_VXLAN_SRCPORT_RANGE_ENABLE=1 +SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps +SAI_DUMP_STORE_AMOUNT=10 diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/sai_2700_48x50g_8x100g.xml b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/sai_2700_48x50g_8x100g.xml index dccb606f7435..5d92ffd45e91 100644 --- a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/sai_2700_48x50g_8x100g.xml +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/sai_2700_48x50g_8x100g.xml @@ -21,8 +21,8 @@ 3 - - 3221225472 + + 3221487616 2 @@ -30,7 +30,7 @@ 4 17 1 - 3221225472 + 3221487616 2 @@ -38,7 +38,7 @@ 4 18 3 - 3221225472 + 3221487616 2 @@ -46,7 +46,7 @@ 4 19 1 - 3221225472 + 3221487616 2 @@ -54,7 +54,7 @@ 4 20 3 - 3221225472 + 3221487616 2 @@ -62,7 +62,7 @@ 4 21 1 - 3221225472 + 3221487616 2 @@ -98,7 +98,7 @@ 4 26 3 - 3221225472 + 3221487616 2 @@ -106,7 +106,7 @@ 4 27 1 - 3221225472 + 3221487616 2> @@ -114,7 +114,7 @@ 4 28 3 - 3221225472 + 3221487616 2 @@ -122,7 +122,7 @@ 4 29 1 - 3221225472 + 3221487616 2 @@ -130,7 +130,7 @@ 4 30 3 - 3221225472 + 3221487616 2 @@ -138,7 +138,7 @@ 4 31 1 - 3221225472 + 3221487616 2 @@ -146,7 +146,7 @@ 4 14 3 - 3221225472 + 3221487616 2 @@ -154,7 +154,7 @@ 4 15 1 - 3221225472 + 3221487616 2 @@ -162,7 +162,7 @@ 4 12 3 - 3221225472 + 3221487616 2 @@ -170,7 +170,7 @@ 4 13 1 - 3221225472 + 3221487616 2 @@ -178,7 +178,7 @@ 4 10 3 - 3221225472 + 3221487616 2 @@ -186,7 +186,7 @@ 4 11 1 - 3221225472 + 3221487616 2 @@ -222,7 +222,7 @@ 4 4 3 - 3221225472 + 3221487616 2 @@ -230,7 +230,7 @@ 4 5 1 - 3221225472 + 3221487616 2 @@ -238,7 +238,7 @@ 4 2 3 - 3221225472 + 3221487616 2 @@ -246,7 +246,7 @@ 4 3 1 - 3221225472 + 3221487616 2 @@ -254,7 +254,7 @@ 4 0 3 - 3221225472 + 3221487616 2 @@ -262,7 +262,7 @@ 4 1 1 - 3221225472 + 3221487616 2 diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700/buffers_defaults_objects.j2 b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700/buffers_defaults_objects.j2 new file mode 120000 index 000000000000..c01aebb7ae12 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700/buffers_defaults_objects.j2 @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/buffers_defaults_objects.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700/buffers_defaults_t0.j2 b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700/buffers_defaults_t0.j2 index 41afd1f22444..0e6a110fff6e 100644 --- a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700/buffers_defaults_t0.j2 +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700/buffers_defaults_t0.j2 @@ -1,104 +1,23 @@ {% set default_cable = '5m' %} -{% set ingress_lossless_pool_size = '9489408' %} +{% set ingress_lossless_pool_size = '10177536' %} +{% set ingress_lossless_pool_xoff = '688128' %} {% set egress_lossless_pool_size = '13945824' %} -{% set egress_lossy_pool_size = '9489408' %} +{% set egress_lossy_pool_size = '10177536' %} -{%- macro generate_port_lists(PORT_ALL) %} - {# Generate list of ports #} - {%- for port_idx in range(0, 32) %} - {%- if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{%- endif %} - {%- endfor %} -{%- endmacro %} +{% import 'buffers_defaults_objects.j2' as defs with context %} -{%- macro generate_buffer_pool_and_profiles() %} - "BUFFER_POOL": { - "ingress_lossless_pool": { - {%- if dynamic_mode is not defined %} - "size": "{{ ingress_lossless_pool_size }}", - {%- endif %} - "type": "ingress", - "mode": "dynamic" - }, - "egress_lossless_pool": { - "size": "{{ egress_lossless_pool_size }}", - "type": "egress", - "mode": "dynamic" - }, - "egress_lossy_pool": { - {%- if dynamic_mode is not defined %} - "size": "{{ egress_lossy_pool_size }}", - {%- endif %} - "type": "egress", - "mode": "dynamic" - } - }, - "BUFFER_PROFILE": { - "ingress_lossless_profile": { - "pool":"[BUFFER_POOL|ingress_lossless_pool]", - "size":"0", - "dynamic_th":"7" - }, - "ingress_lossy_profile": { - "pool":"[BUFFER_POOL|ingress_lossless_pool]", - "size":"0", - "dynamic_th":"3" - }, - "egress_lossless_profile": { - "pool":"[BUFFER_POOL|egress_lossless_pool]", - "size":"0", - "dynamic_th":"7" - }, - "egress_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"9216", - "dynamic_th":"7" - }, - "q_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"0", - "dynamic_th":"3" - } - }, +{%- macro generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) %} +{{ defs.generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) }} {%- endmacro %} -{%- macro generate_profile_lists(port_names) %} - "BUFFER_PORT_INGRESS_PROFILE_LIST": { -{% for port in port_names.split(',') %} - "{{ port }}": { - "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" - }{% if not loop.last %},{% endif %} - -{% endfor %} - }, - "BUFFER_PORT_EGRESS_PROFILE_LIST": { -{% for port in port_names.split(',') %} - "{{ port }}": { - "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" - }{% if not loop.last %},{% endif %} - -{% endfor %} - } +{%- macro generate_profile_lists_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_profile_lists(port_names_active, port_names_inactive) }} {%- endmacro %} -{%- macro generate_queue_buffers(port_names) %} - "BUFFER_QUEUE": { -{% for port in port_names.split(',') %} - "{{ port }}|3-4": { - "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" - }, -{% endfor %} -{% for port in port_names.split(',') %} - "{{ port }}|0-2": { - "profile" : "[BUFFER_PROFILE|q_lossy_profile]" - }, -{% endfor %} -{% for port in port_names.split(',') %} - "{{ port }}|5-6": { - "profile" : "[BUFFER_PROFILE|q_lossy_profile]" - }{% if not loop.last %},{% endif %} - -{% endfor %} - } +{%- macro generate_queue_buffers_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_queue_buffers(port_names_active, port_names_inactive) }} {%- endmacro %} - +{%- macro generate_pg_profiles_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_pg_profiles(port_names_active, port_names_inactive) }} +{%- endmacro %} diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700/buffers_defaults_t1.j2 b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700/buffers_defaults_t1.j2 index 08e21ba05f75..ec8040e79763 100644 --- a/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700/buffers_defaults_t1.j2 +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/Mellanox-SN2700/buffers_defaults_t1.j2 @@ -1,104 +1,23 @@ {% set default_cable = '5m' %} -{% set ingress_lossless_pool_size = '7719936' %} +{% set ingress_lossless_pool_size = '8719360' %} +{% set ingress_lossless_pool_xoff = '2146304' %} {% set egress_lossless_pool_size = '13945824' %} -{% set egress_lossy_pool_size = '7719936' %} +{% set egress_lossy_pool_size = '8719360' %} -{%- macro generate_port_lists(PORT_ALL) %} - {# Generate list of ports #} - {%- for port_idx in range(0, 32) %} - {%- if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{%- endif %} - {%- endfor %} -{%- endmacro %} +{% import 'buffers_defaults_objects.j2' as defs with context %} -{%- macro generate_buffer_pool_and_profiles() %} - "BUFFER_POOL": { - "ingress_lossless_pool": { - {%- if dynamic_mode is not defined %} - "size": "{{ ingress_lossless_pool_size }}", - {%- endif %} - "type": "ingress", - "mode": "dynamic" - }, - "egress_lossless_pool": { - "size": "{{ egress_lossless_pool_size }}", - "type": "egress", - "mode": "dynamic" - }, - "egress_lossy_pool": { - {%- if dynamic_mode is not defined %} - "size": "{{ egress_lossy_pool_size }}", - {%- endif %} - "type": "egress", - "mode": "dynamic" - } - }, - "BUFFER_PROFILE": { - "ingress_lossless_profile": { - "pool":"[BUFFER_POOL|ingress_lossless_pool]", - "size":"0", - "dynamic_th":"7" - }, - "ingress_lossy_profile": { - "pool":"[BUFFER_POOL|ingress_lossless_pool]", - "size":"0", - "dynamic_th":"3" - }, - "egress_lossless_profile": { - "pool":"[BUFFER_POOL|egress_lossless_pool]", - "size":"0", - "dynamic_th":"7" - }, - "egress_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"9216", - "dynamic_th":"7" - }, - "q_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"0", - "dynamic_th":"3" - } - }, +{%- macro generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) %} +{{ defs.generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) }} {%- endmacro %} -{%- macro generate_profile_lists(port_names) %} - "BUFFER_PORT_INGRESS_PROFILE_LIST": { -{% for port in port_names.split(',') %} - "{{ port }}": { - "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" - }{% if not loop.last %},{% endif %} - -{% endfor %} - }, - "BUFFER_PORT_EGRESS_PROFILE_LIST": { -{% for port in port_names.split(',') %} - "{{ port }}": { - "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" - }{% if not loop.last %},{% endif %} - -{% endfor %} - } +{%- macro generate_profile_lists_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_profile_lists(port_names_active, port_names_inactive) }} {%- endmacro %} -{%- macro generate_queue_buffers(port_names) %} - "BUFFER_QUEUE": { -{% for port in port_names.split(',') %} - "{{ port }}|3-4": { - "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" - }, -{% endfor %} -{% for port in port_names.split(',') %} - "{{ port }}|0-2": { - "profile" : "[BUFFER_PROFILE|q_lossy_profile]" - }, -{% endfor %} -{% for port in port_names.split(',') %} - "{{ port }}|5-6": { - "profile" : "[BUFFER_PROFILE|q_lossy_profile]" - }{% if not loop.last %},{% endif %} - -{% endfor %} - } +{%- macro generate_queue_buffers_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_queue_buffers(port_names_active, port_names_inactive) }} {%- endmacro %} - +{%- macro generate_pg_profiles_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_pg_profiles(port_names_active, port_names_inactive) }} +{%- endmacro %} diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/platform.json b/device/mellanox/x86_64-mlnx_msn2700-r0/platform.json index cdb3e52fd682..68d299aff76b 100644 --- a/device/mellanox/x86_64-mlnx_msn2700-r0/platform.json +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/platform.json @@ -73,7 +73,12 @@ "name": "PSU 1", "fans": [ { - "name": "psu_1_fan_1" + "name": "psu1_fan1" + } + ], + "thermals": [ + { + "name": "PSU-1 Temp" } ] }, @@ -81,7 +86,12 @@ "name": "PSU 2", "fans": [ { - "name": "psu_2_fan_1" + "name": "psu2_fan1" + } + ], + "thermals": [ + { + "name": "PSU-2 Temp" } ] } @@ -104,206 +114,264 @@ }, { "name": "CPU Pack Temp" - }, - { - "name": "PSU-1 Temp" - }, - { - "name": "PSU-2 Temp" - }, - { - "name": "xSFP module 1 Temp" - }, - { - "name": "xSFP module 2 Temp" - }, - { - "name": "xSFP module 3 Temp" - }, - { - "name": "xSFP module 4 Temp" - }, - { - "name": "xSFP module 5 Temp" - }, - { - "name": "xSFP module 6 Temp" - }, - { - "name": "xSFP module 7 Temp" - }, - { - "name": "xSFP module 8 Temp" - }, - { - "name": "xSFP module 9 Temp" - }, - { - "name": "xSFP module 10 Temp" - }, - { - "name": "xSFP module 11 Temp" - }, - { - "name": "xSFP module 12 Temp" - }, - { - "name": "xSFP module 13 Temp" - }, - { - "name": "xSFP module 14 Temp" - }, - { - "name": "xSFP module 15 Temp" - }, - { - "name": "xSFP module 16 Temp" - }, - { - "name": "xSFP module 17 Temp" - }, - { - "name": "xSFP module 18 Temp" - }, - { - "name": "xSFP module 19 Temp" - }, - { - "name": "xSFP module 20 Temp" - }, - { - "name": "xSFP module 21 Temp" - }, - { - "name": "xSFP module 22 Temp" - }, - { - "name": "xSFP module 23 Temp" - }, - { - "name": "xSFP module 24 Temp" - }, - { - "name": "xSFP module 25 Temp" - }, - { - "name": "xSFP module 26 Temp" - }, - { - "name": "xSFP module 27 Temp" - }, - { - "name": "xSFP module 28 Temp" - }, - { - "name": "xSFP module 29 Temp" - }, - { - "name": "xSFP module 30 Temp" - }, - { - "name": "xSFP module 31 Temp" - }, - { - "name": "xSFP module 32 Temp" } ], "sfps": [ { - "name": "sfp1" + "name": "sfp1", + "thermals": [ + { + "name": "xSFP module 1 Temp" + } + ] }, { - "name": "sfp2" + "name": "sfp2", + "thermals": [ + { + "name": "xSFP module 2 Temp" + } + ] }, { - "name": "sfp3" + "name": "sfp3", + "thermals": [ + { + "name": "xSFP module 3 Temp" + } + ] }, { - "name": "sfp4" + "name": "sfp4", + "thermals": [ + { + "name": "xSFP module 4 Temp" + } + ] }, { - "name": "sfp5" + "name": "sfp5", + "thermals": [ + { + "name": "xSFP module 5 Temp" + } + ] }, { - "name": "sfp6" + "name": "sfp6", + "thermals": [ + { + "name": "xSFP module 6 Temp" + } + ] }, { - "name": "sfp7" + "name": "sfp7", + "thermals": [ + { + "name": "xSFP module 7 Temp" + } + ] }, { - "name": "sfp8" + "name": "sfp8", + "thermals": [ + { + "name": "xSFP module 8 Temp" + } + ] }, { - "name": "sfp9" + "name": "sfp9", + "thermals": [ + { + "name": "xSFP module 9 Temp" + } + ] }, { - "name": "sfp10" + "name": "sfp10", + "thermals": [ + { + "name": "xSFP module 10 Temp" + } + ] }, { - "name": "sfp11" + "name": "sfp11", + "thermals": [ + { + "name": "xSFP module 11 Temp" + } + ] }, { - "name": "sfp12" + "name": "sfp12", + "thermals": [ + { + "name": "xSFP module 12 Temp" + } + ] }, { - "name": "sfp13" + "name": "sfp13", + "thermals": [ + { + "name": "xSFP module 13 Temp" + } + ] }, { - "name": "sfp14" + "name": "sfp14", + "thermals": [ + { + "name": "xSFP module 14 Temp" + } + ] }, { - "name": "sfp15" + "name": "sfp15", + "thermals": [ + { + "name": "xSFP module 15 Temp" + } + ] }, { - "name": "sfp16" + "name": "sfp16", + "thermals": [ + { + "name": "xSFP module 16 Temp" + } + ] }, { - "name": "sfp17" + "name": "sfp17", + "thermals": [ + { + "name": "xSFP module 17 Temp" + } + ] }, { - "name": "sfp18" + "name": "sfp18", + "thermals": [ + { + "name": "xSFP module 18 Temp" + } + ] }, { - "name": "sfp19" + "name": "sfp19", + "thermals": [ + { + "name": "xSFP module 19 Temp" + } + ] }, { - "name": "sfp20" + "name": "sfp20", + "thermals": [ + { + "name": "xSFP module 20 Temp" + } + ] }, { - "name": "sfp21" + "name": "sfp21", + "thermals": [ + { + "name": "xSFP module 21 Temp" + } + ] }, { - "name": "sfp22" + "name": "sfp22", + "thermals": [ + { + "name": "xSFP module 22 Temp" + } + ] }, { - "name": "sfp23" + "name": "sfp23", + "thermals": [ + { + "name": "xSFP module 23 Temp" + } + ] }, { - "name": "sfp24" + "name": "sfp24", + "thermals": [ + { + "name": "xSFP module 24 Temp" + } + ] }, { - "name": "sfp25" + "name": "sfp25", + "thermals": [ + { + "name": "xSFP module 25 Temp" + } + ] }, { - "name": "sfp26" + "name": "sfp26", + "thermals": [ + { + "name": "xSFP module 26 Temp" + } + ] }, { - "name": "sfp27" + "name": "sfp27", + "thermals": [ + { + "name": "xSFP module 27 Temp" + } + ] }, { - "name": "sfp28" + "name": "sfp28", + "thermals": [ + { + "name": "xSFP module 28 Temp" + } + ] }, { - "name": "sfp29" + "name": "sfp29", + "thermals": [ + { + "name": "xSFP module 29 Temp" + } + ] }, { - "name": "sfp30" + "name": "sfp30", + "thermals": [ + { + "name": "xSFP module 30 Temp" + } + ] }, { - "name": "sfp31" + "name": "sfp31", + "thermals": [ + { + "name": "xSFP module 31 Temp" + } + ] }, { - "name": "sfp32" + "name": "sfp32", + "thermals": [ + { + "name": "xSFP module 32 Temp" + } + ] } ] }, diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/plugins/sfplpmset.py b/device/mellanox/x86_64-mlnx_msn2700-r0/plugins/sfplpmset.py index 61423880ac71..b0b2d5a2c9c4 100644 --- a/device/mellanox/x86_64-mlnx_msn2700-r0/plugins/sfplpmset.py +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/plugins/sfplpmset.py @@ -11,7 +11,6 @@ DEVICE_ID = 1 SWITCH_ID = 0 -SX_PORT_ATTR_ARR_SIZE = 64 PORT_TYPE_CPU = 4 PORT_TYPE_NVE = 8 @@ -51,9 +50,13 @@ def set_port_admin_status_by_log_port(handle, log_port, admin_status): def get_log_ports(handle, sfp_module): - port_attributes_list = new_sx_port_attributes_t_arr(SX_PORT_ATTR_ARR_SIZE) port_cnt_p = new_uint32_t_p() - uint32_t_p_assign(port_cnt_p, SX_PORT_ATTR_ARR_SIZE) + uint32_t_p_assign(port_cnt_p, 0) + rc = sx_api_port_device_get(handle, DEVICE_ID, SWITCH_ID, None, port_cnt_p) + + assert rc == SX_STATUS_SUCCESS, "sx_api_port_device_get failed, rc = %d" % rc + port_cnt = uint32_t_p_value(port_cnt_p) + port_attributes_list = new_sx_port_attributes_t_arr(port_cnt) rc = sx_api_port_device_get(handle, DEVICE_ID, SWITCH_ID, port_attributes_list, port_cnt_p) assert rc == SX_STATUS_SUCCESS, "sx_api_port_device_get failed, rc = %d" % rc diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/plugins/sfputil.py b/device/mellanox/x86_64-mlnx_msn2700-r0/plugins/sfputil.py index 954ed23d8eac..952620dc22f8 100644 --- a/device/mellanox/x86_64-mlnx_msn2700-r0/plugins/sfputil.py +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/plugins/sfputil.py @@ -4,7 +4,6 @@ # try: - import time import subprocess from sonic_sfp.sfputilbase import * import syslog @@ -41,8 +40,11 @@ # magic code defnition for port number, qsfp port position of each platform # port_position_tuple = (PORT_START, QSFP_PORT_START, PORT_END, PORT_IN_BLOCK, EEPROM_OFFSET) -platform_dict = {'x86_64-mlnx_msn2700-r0': 0, 'x86_64-mlnx_msn2740-r0': 0, 'x86_64-mlnx_msn2100-r0': 1, 'x86_64-mlnx_msn2410-r0': 2, 'x86_64-mlnx_msn2010-r0': 3, - 'x86_64-mlnx_msn3420-r0': 5, 'x86_64-mlnx_msn3700-r0': 0, 'x86_64-mlnx_msn3700c-r0': 0, 'x86_64-mlnx_msn3800-r0': 4, 'x86_64-mlnx_msn4600c': 4, 'x86_64-mlnx_msn4700-r0': 0} +platform_dict = {'x86_64-mlnx_msn2700-r0': 0, 'x86_64-mlnx_msn2740-r0': 0, 'x86_64-mlnx_msn2100-r0': 1, + 'x86_64-mlnx_msn2410-r0': 2, 'x86_64-mlnx_msn2010-r0': 3, 'x86_64-mlnx_msn3420-r0': 5, + 'x86_64-mlnx_msn3700-r0': 0, 'x86_64-mlnx_msn3700c-r0': 0, 'x86_64-mlnx_msn3800-r0': 4, + 'x86_64-mlnx_msn4410-r0': 0, 'x86_64-mlnx_msn4600-r0': 4, 'x86_64-mlnx_msn4600c-r0': 4, + 'x86_64-mlnx_msn4700-r0': 0} port_position_tuple_list = [(0, 0, 31, 32, 1), (0, 0, 15, 16, 1), (0, 48, 55, 56, 1), (0, 18, 21, 22, 1), (0, 0, 63, 64, 1), (0, 48, 59, 60, 1)] @@ -185,8 +187,7 @@ def reset(self, port_num): print("Error! Unable to set LPM for {}, rc = {}, err msg: {}".format(port_num, e.returncode, e.output)) return False - return False - + def get_transceiver_change_event(self, timeout=0): phy_port_dict = {} status = True @@ -350,7 +351,6 @@ def get_transceiver_info_dict(self, port_num): if port_num in self.qsfp_ports: offset = 128 vendor_rev_width = XCVR_HW_REV_WIDTH_QSFP - cable_length_width = XCVR_CABLE_LENGTH_WIDTH_QSFP interface_info_bulk_width = XCVR_INTFACE_BULK_WIDTH_QSFP sfp_type = 'QSFP' @@ -362,7 +362,6 @@ def get_transceiver_info_dict(self, port_num): else: offset = 0 vendor_rev_width = XCVR_HW_REV_WIDTH_SFP - cable_length_width = XCVR_CABLE_LENGTH_WIDTH_SFP interface_info_bulk_width = XCVR_INTFACE_BULK_WIDTH_SFP sfp_type = 'SFP' @@ -513,7 +512,7 @@ def get_transceiver_dom_info_dict(self, port_num): qsfp_dom_capability_raw = self._read_eeprom_specific_bytes_via_ethtool( port_num, (offset_xcvr + XCVR_DOM_CAPABILITY_OFFSET), XCVR_DOM_CAPABILITY_WIDTH) if qsfp_dom_capability_raw is not None: - qspf_dom_capability_data = sfpi_obj.parse_qsfp_dom_capability(qsfp_dom_capability_raw, 0) + qspf_dom_capability_data = sfpi_obj.parse_dom_capability(qsfp_dom_capability_raw, 0) else: return transceiver_dom_info_dict diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/pmon_daemon_control.json b/device/mellanox/x86_64-mlnx_msn2700-r0/pmon_daemon_control.json index dec2ba6d7826..86910af29e89 100644 --- a/device/mellanox/x86_64-mlnx_msn2700-r0/pmon_daemon_control.json +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/pmon_daemon_control.json @@ -1,7 +1,6 @@ { "skip_ledd": true, "skip_fancontrol": true, - "delay_xcvrd": true, - "python2_daemons": ["xcvrd"] + "delay_xcvrd": true } diff --git a/device/mellanox/x86_64-mlnx_msn2700_simx-r0/platform_reboot b/device/mellanox/x86_64-mlnx_msn2700_simx-r0/platform_reboot deleted file mode 100755 index 5b9809e10423..000000000000 --- a/device/mellanox/x86_64-mlnx_msn2700_simx-r0/platform_reboot +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -declare -r EXIT_SUCCESS="0" -declare -r EXIT_ERROR="1" - -FORCE_REBOOT="no" - -function ParseArguments() { - while [ $# -ge 1 ]; do - case "$1" in - -f|--force) - FORCE_REBOOT="yes" - ;; - esac - shift - done -} - -ParseArguments "$@" - -exec /sbin/reboot $@ diff --git a/device/mellanox/x86_64-mlnx_msn2740-r0/ACS-MSN2740/buffers_defaults_objects.j2 b/device/mellanox/x86_64-mlnx_msn2740-r0/ACS-MSN2740/buffers_defaults_objects.j2 new file mode 120000 index 000000000000..33b6704f9902 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn2740-r0/ACS-MSN2740/buffers_defaults_objects.j2 @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/ACS-MSN2700/buffers_defaults_objects.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn2740-r0/ACS-MSN2740/sai.profile b/device/mellanox/x86_64-mlnx_msn2740-r0/ACS-MSN2740/sai.profile index adaa280e6cd5..e212df2e5ea1 100644 --- a/device/mellanox/x86_64-mlnx_msn2740-r0/ACS-MSN2740/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn2740-r0/ACS-MSN2740/sai.profile @@ -1 +1,3 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_2740.xml +SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps +SAI_DUMP_STORE_AMOUNT=10 diff --git a/device/mellanox/x86_64-mlnx_msn2740-r0/ACS-MSN2740/sai_2740.xml b/device/mellanox/x86_64-mlnx_msn2740-r0/ACS-MSN2740/sai_2740.xml index 955ea3f8b1b6..a21dc696ddd9 100644 --- a/device/mellanox/x86_64-mlnx_msn2740-r0/ACS-MSN2740/sai_2740.xml +++ b/device/mellanox/x86_64-mlnx_msn2740-r0/ACS-MSN2740/sai_2740.xml @@ -21,7 +21,7 @@ 3 - + 98368 diff --git a/device/mellanox/x86_64-mlnx_msn2740-r0/platform.json b/device/mellanox/x86_64-mlnx_msn2740-r0/platform.json new file mode 100644 index 000000000000..ebd3bfa8ed99 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn2740-r0/platform.json @@ -0,0 +1,367 @@ +{ + "chassis": { + "name": "MSN2740", + "components": [ + { + "name": "ONIE" + }, + { + "name": "SSD" + }, + { + "name": "BIOS" + }, + { + "name": "CPLD1" + }, + { + "name": "CPLD2" + } + ], + "fans": [], + "fan_drawers": [ + { + "name": "drawer1", + "fans": [ + { + "name": "fan1" + } + ] + }, + { + "name": "drawer2", + "fans": [ + { + "name": "fan2" + } + ] + }, + { + "name": "drawer3", + "fans": [ + { + "name": "fan3" + } + ] + }, + { + "name": "drawer4", + "fans": [ + { + "name": "fan4" + } + ] + } + ], + "psus": [ + { + "name": "PSU 1", + "fans": [ + { + "name": "psu1_fan1" + } + ], + "thermals": [ + { + "name": "PSU-1 Temp" + } + ] + }, + { + "name": "PSU 2", + "fans": [ + { + "name": "psu2_fan1" + } + ], + "thermals": [ + { + "name": "PSU-2 Temp" + } + ] + } + ], + "thermals": [ + { + "name": "ASIC" + }, + { + "name": "Ambient Fan Side Temp" + }, + { + "name": "Ambient Port Side Temp" + }, + { + "name": "CPU Core 0 Temp" + }, + { + "name": "CPU Core 1 Temp" + }, + { + "name": "CPU Core 3 Temp" + }, + { + "name": "CPU Core 4 Temp" + } + ], + "sfps": [ + { + "name": "sfp1", + "thermals": [ + { + "name": "xSFP module 1 Temp" + } + ] + }, + { + "name": "sfp2", + "thermals": [ + { + "name": "xSFP module 2 Temp" + } + ] + }, + { + "name": "sfp3", + "thermals": [ + { + "name": "xSFP module 3 Temp" + } + ] + }, + { + "name": "sfp4", + "thermals": [ + { + "name": "xSFP module 4 Temp" + } + ] + }, + { + "name": "sfp5", + "thermals": [ + { + "name": "xSFP module 5 Temp" + } + ] + }, + { + "name": "sfp6", + "thermals": [ + { + "name": "xSFP module 6 Temp" + } + ] + }, + { + "name": "sfp7", + "thermals": [ + { + "name": "xSFP module 7 Temp" + } + ] + }, + { + "name": "sfp8", + "thermals": [ + { + "name": "xSFP module 8 Temp" + } + ] + }, + { + "name": "sfp9", + "thermals": [ + { + "name": "xSFP module 9 Temp" + } + ] + }, + { + "name": "sfp10", + "thermals": [ + { + "name": "xSFP module 10 Temp" + } + ] + }, + { + "name": "sfp11", + "thermals": [ + { + "name": "xSFP module 11 Temp" + } + ] + }, + { + "name": "sfp12", + "thermals": [ + { + "name": "xSFP module 12 Temp" + } + ] + }, + { + "name": "sfp13", + "thermals": [ + { + "name": "xSFP module 13 Temp" + } + ] + }, + { + "name": "sfp14", + "thermals": [ + { + "name": "xSFP module 14 Temp" + } + ] + }, + { + "name": "sfp15", + "thermals": [ + { + "name": "xSFP module 15 Temp" + } + ] + }, + { + "name": "sfp16", + "thermals": [ + { + "name": "xSFP module 16 Temp" + } + ] + }, + { + "name": "sfp17", + "thermals": [ + { + "name": "xSFP module 17 Temp" + } + ] + }, + { + "name": "sfp18", + "thermals": [ + { + "name": "xSFP module 18 Temp" + } + ] + }, + { + "name": "sfp19", + "thermals": [ + { + "name": "xSFP module 19 Temp" + } + ] + }, + { + "name": "sfp20", + "thermals": [ + { + "name": "xSFP module 20 Temp" + } + ] + }, + { + "name": "sfp21", + "thermals": [ + { + "name": "xSFP module 21 Temp" + } + ] + }, + { + "name": "sfp22", + "thermals": [ + { + "name": "xSFP module 22 Temp" + } + ] + }, + { + "name": "sfp23", + "thermals": [ + { + "name": "xSFP module 23 Temp" + } + ] + }, + { + "name": "sfp24", + "thermals": [ + { + "name": "xSFP module 24 Temp" + } + ] + }, + { + "name": "sfp25", + "thermals": [ + { + "name": "xSFP module 25 Temp" + } + ] + }, + { + "name": "sfp26", + "thermals": [ + { + "name": "xSFP module 26 Temp" + } + ] + }, + { + "name": "sfp27", + "thermals": [ + { + "name": "xSFP module 27 Temp" + } + ] + }, + { + "name": "sfp28", + "thermals": [ + { + "name": "xSFP module 28 Temp" + } + ] + }, + { + "name": "sfp29", + "thermals": [ + { + "name": "xSFP module 29 Temp" + } + ] + }, + { + "name": "sfp30", + "thermals": [ + { + "name": "xSFP module 30 Temp" + } + ] + }, + { + "name": "sfp31", + "thermals": [ + { + "name": "xSFP module 31 Temp" + } + ] + }, + { + "name": "sfp32", + "thermals": [ + { + "name": "xSFP module 32 Temp" + } + ] + } + ] + }, + "interfaces": {} +} diff --git a/device/mellanox/x86_64-mlnx_msn3420-r0/ACS-MSN3420/buffers_defaults_objects.j2 b/device/mellanox/x86_64-mlnx_msn3420-r0/ACS-MSN3420/buffers_defaults_objects.j2 new file mode 120000 index 000000000000..33b6704f9902 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3420-r0/ACS-MSN3420/buffers_defaults_objects.j2 @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/ACS-MSN2700/buffers_defaults_objects.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3420-r0/ACS-MSN3420/sai.profile b/device/mellanox/x86_64-mlnx_msn3420-r0/ACS-MSN3420/sai.profile index a30106c8674d..74228eb6446c 100644 --- a/device/mellanox/x86_64-mlnx_msn3420-r0/ACS-MSN3420/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn3420-r0/ACS-MSN3420/sai.profile @@ -1 +1,3 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_3420.xml +SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps +SAI_DUMP_STORE_AMOUNT=10 diff --git a/device/mellanox/x86_64-mlnx_msn3420-r0/platform.json b/device/mellanox/x86_64-mlnx_msn3420-r0/platform.json new file mode 100644 index 000000000000..7d8dec685a5e --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3420-r0/platform.json @@ -0,0 +1,617 @@ +{ + "chassis": { + "name": "MSN3420", + "components": [ + { + "name": "ONIE" + }, + { + "name": "SSD" + }, + { + "name": "BIOS" + }, + { + "name": "CPLD1" + }, + { + "name": "CPLD2" + }, + { + "name": "CPLD3" + } + ], + "fans": [], + "fan_drawers": [ + { + "name": "drawer1", + "fans": [ + { + "name": "fan1" + }, + { + "name": "fan2" + } + ] + }, + { + "name": "drawer2", + "fans": [ + { + "name": "fan3" + }, + { + "name": "fan4" + } + ] + }, + { + "name": "drawer3", + "fans": [ + { + "name": "fan5" + }, + { + "name": "fan6" + } + ] + }, + { + "name": "drawer4", + "fans": [ + { + "name": "fan7" + }, + { + "name": "fan8" + } + ] + }, + { + "name": "drawer5", + "fans": [ + { + "name": "fan9" + }, + { + "name": "fan10" + } + ] + } + ], + "psus": [ + { + "name": "PSU 1", + "fans": [ + { + "name": "psu1_fan1" + } + ], + "thermals": [ + { + "name": "PSU-1 Temp" + } + ] + }, + { + "name": "PSU 2", + "fans": [ + { + "name": "psu2_fan1" + } + ], + "thermals": [ + { + "name": "PSU-2 Temp" + } + ] + } + ], + "thermals": [ + { + "name": "ASIC" + }, + { + "name": "Ambient Fan Side Temp" + }, + { + "name": "Ambient Port Side Temp" + }, + { + "name": "Ambient COMEX Temp" + }, + { + "name": "CPU Core 0 Temp" + }, + { + "name": "CPU Core 1 Temp" + }, + { + "name": "CPU Pack Temp" + } + ], + "sfps": [ + { + "name": "sfp1", + "thermals": [ + { + "name": "xSFP module 1 Temp" + } + ] + }, + { + "name": "sfp2", + "thermals": [ + { + "name": "xSFP module 2 Temp" + } + ] + }, + { + "name": "sfp3", + "thermals": [ + { + "name": "xSFP module 3 Temp" + } + ] + }, + { + "name": "sfp4", + "thermals": [ + { + "name": "xSFP module 4 Temp" + } + ] + }, + { + "name": "sfp5", + "thermals": [ + { + "name": "xSFP module 5 Temp" + } + ] + }, + { + "name": "sfp6", + "thermals": [ + { + "name": "xSFP module 6 Temp" + } + ] + }, + { + "name": "sfp7", + "thermals": [ + { + "name": "xSFP module 7 Temp" + } + ] + }, + { + "name": "sfp8", + "thermals": [ + { + "name": "xSFP module 8 Temp" + } + ] + }, + { + "name": "sfp9", + "thermals": [ + { + "name": "xSFP module 9 Temp" + } + ] + }, + { + "name": "sfp10", + "thermals": [ + { + "name": "xSFP module 10 Temp" + } + ] + }, + { + "name": "sfp11", + "thermals": [ + { + "name": "xSFP module 11 Temp" + } + ] + }, + { + "name": "sfp12", + "thermals": [ + { + "name": "xSFP module 12 Temp" + } + ] + }, + { + "name": "sfp13", + "thermals": [ + { + "name": "xSFP module 13 Temp" + } + ] + }, + { + "name": "sfp14", + "thermals": [ + { + "name": "xSFP module 14 Temp" + } + ] + }, + { + "name": "sfp15", + "thermals": [ + { + "name": "xSFP module 15 Temp" + } + ] + }, + { + "name": "sfp16", + "thermals": [ + { + "name": "xSFP module 16 Temp" + } + ] + }, + { + "name": "sfp17", + "thermals": [ + { + "name": "xSFP module 17 Temp" + } + ] + }, + { + "name": "sfp18", + "thermals": [ + { + "name": "xSFP module 18 Temp" + } + ] + }, + { + "name": "sfp19", + "thermals": [ + { + "name": "xSFP module 19 Temp" + } + ] + }, + { + "name": "sfp20", + "thermals": [ + { + "name": "xSFP module 20 Temp" + } + ] + }, + { + "name": "sfp21", + "thermals": [ + { + "name": "xSFP module 21 Temp" + } + ] + }, + { + "name": "sfp22", + "thermals": [ + { + "name": "xSFP module 22 Temp" + } + ] + }, + { + "name": "sfp23", + "thermals": [ + { + "name": "xSFP module 23 Temp" + } + ] + }, + { + "name": "sfp24", + "thermals": [ + { + "name": "xSFP module 24 Temp" + } + ] + }, + { + "name": "sfp25", + "thermals": [ + { + "name": "xSFP module 25 Temp" + } + ] + }, + { + "name": "sfp26", + "thermals": [ + { + "name": "xSFP module 26 Temp" + } + ] + }, + { + "name": "sfp27", + "thermals": [ + { + "name": "xSFP module 27 Temp" + } + ] + }, + { + "name": "sfp28", + "thermals": [ + { + "name": "xSFP module 28 Temp" + } + ] + }, + { + "name": "sfp29", + "thermals": [ + { + "name": "xSFP module 29 Temp" + } + ] + }, + { + "name": "sfp30", + "thermals": [ + { + "name": "xSFP module 30 Temp" + } + ] + }, + { + "name": "sfp31", + "thermals": [ + { + "name": "xSFP module 31 Temp" + } + ] + }, + { + "name": "sfp32", + "thermals": [ + { + "name": "xSFP module 32 Temp" + } + ] + }, + { + "name": "sfp33", + "thermals": [ + { + "name": "xSFP module 33 Temp" + } + ] + }, + { + "name": "sfp34", + "thermals": [ + { + "name": "xSFP module 34 Temp" + } + ] + }, + { + "name": "sfp35", + "thermals": [ + { + "name": "xSFP module 35 Temp" + } + ] + }, + { + "name": "sfp36", + "thermals": [ + { + "name": "xSFP module 36 Temp" + } + ] + }, + { + "name": "sfp37", + "thermals": [ + { + "name": "xSFP module 37 Temp" + } + ] + }, + { + "name": "sfp38", + "thermals": [ + { + "name": "xSFP module 38 Temp" + } + ] + }, + { + "name": "sfp39", + "thermals": [ + { + "name": "xSFP module 39 Temp" + } + ] + }, + { + "name": "sfp40", + "thermals": [ + { + "name": "xSFP module 40 Temp" + } + ] + }, + { + "name": "sfp41", + "thermals": [ + { + "name": "xSFP module 41 Temp" + } + ] + }, + { + "name": "sfp42", + "thermals": [ + { + "name": "xSFP module 42 Temp" + } + ] + }, + { + "name": "sfp43", + "thermals": [ + { + "name": "xSFP module 43 Temp" + } + ] + }, + { + "name": "sfp44", + "thermals": [ + { + "name": "xSFP module 44 Temp" + } + ] + }, + { + "name": "sfp45", + "thermals": [ + { + "name": "xSFP module 45 Temp" + } + ] + }, + { + "name": "sfp46", + "thermals": [ + { + "name": "xSFP module 46 Temp" + } + ] + }, + { + "name": "sfp47", + "thermals": [ + { + "name": "xSFP module 47 Temp" + } + ] + }, + { + "name": "sfp48", + "thermals": [ + { + "name": "xSFP module 48 Temp" + } + ] + }, + { + "name": "sfp49", + "thermals": [ + { + "name": "xSFP module 49 Temp" + } + ] + }, + { + "name": "sfp50", + "thermals": [ + { + "name": "xSFP module 50 Temp" + } + ] + }, + { + "name": "sfp51", + "thermals": [ + { + "name": "xSFP module 51 Temp" + } + ] + }, + { + "name": "sfp52", + "thermals": [ + { + "name": "xSFP module 52 Temp" + } + ] + }, + { + "name": "sfp53", + "thermals": [ + { + "name": "xSFP module 53 Temp" + } + ] + }, + { + "name": "sfp54", + "thermals": [ + { + "name": "xSFP module 54 Temp" + } + ] + }, + { + "name": "sfp55", + "thermals": [ + { + "name": "xSFP module 55 Temp" + } + ] + }, + { + "name": "sfp56", + "thermals": [ + { + "name": "xSFP module 56 Temp" + } + ] + }, + { + "name": "sfp57", + "thermals": [ + { + "name": "xSFP module 57 Temp" + } + ] + }, + { + "name": "sfp58", + "thermals": [ + { + "name": "xSFP module 58 Temp" + } + ] + }, + { + "name": "sfp59", + "thermals": [ + { + "name": "xSFP module 59 Temp" + } + ] + }, + { + "name": "sfp60", + "thermals": [ + { + "name": "xSFP module 60 Temp" + } + ] + } + ] + }, + "interfaces": {} +} diff --git a/device/mellanox/x86_64-mlnx_msn3420-r0/sensors.conf b/device/mellanox/x86_64-mlnx_msn3420-r0/sensors.conf index f31cbe7adbc7..b0e4901eccca 100644 --- a/device/mellanox/x86_64-mlnx_msn3420-r0/sensors.conf +++ b/device/mellanox/x86_64-mlnx_msn3420-r0/sensors.conf @@ -79,17 +79,6 @@ bus "i2c-15" "i2c-1-mux (chan_id 6)" # Power supplies bus "i2c-4" "i2c-1-mux (chan_id 3)" chip "dps460-i2c-*-58" - label in1 "PSU-1 220V Rail (in)" - label in2 "PSU-1 12V Rail (out)" - label fan1 "PSU-1 Fan 1" - label temp1 "PSU-1 Temp 1" - label temp2 "PSU-1 Temp 2" - label temp3 "PSU-1 Temp 3" - label power1 "PSU-1 220V Rail Pwr (in)" - label power2 "PSU-1 12V Rail Pwr (out)" - label curr1 "PSU-1 220V Rail Curr (in)" - label curr2 "PSU-1 12V Rail Curr (out)" - chip "dps460-i2c-*-59" label in1 "PSU-2 220V Rail (in)" label in2 "PSU-2 12V Rail (out)" label fan1 "PSU-2 Fan 1" @@ -100,6 +89,17 @@ bus "i2c-4" "i2c-1-mux (chan_id 3)" label power2 "PSU-2 12V Rail Pwr (out)" label curr1 "PSU-2 220V Rail Curr (in)" label curr2 "PSU-2 12V Rail Curr (out)" + chip "dps460-i2c-*-59" + label in1 "PSU-1 220V Rail (in)" + label in2 "PSU-1 12V Rail (out)" + label fan1 "PSU-1 Fan 1" + label temp1 "PSU-1 Temp 1" + label temp2 "PSU-1 Temp 2" + label temp3 "PSU-1 Temp 3" + label power1 "PSU-1 220V Rail Pwr (in)" + label power2 "PSU-1 12V Rail Pwr (out)" + label curr1 "PSU-1 220V Rail Curr (in)" + label curr2 "PSU-1 12V Rail Curr (out)" # Chassis fans chip "mlxreg_fan-isa-*" diff --git a/device/mellanox/x86_64-mlnx_msn3700-r0/ACS-MSN3700/buffers_defaults_objects.j2 b/device/mellanox/x86_64-mlnx_msn3700-r0/ACS-MSN3700/buffers_defaults_objects.j2 new file mode 120000 index 000000000000..33b6704f9902 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3700-r0/ACS-MSN3700/buffers_defaults_objects.j2 @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/ACS-MSN2700/buffers_defaults_objects.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3700-r0/ACS-MSN3700/buffers_defaults_t0.j2 b/device/mellanox/x86_64-mlnx_msn3700-r0/ACS-MSN3700/buffers_defaults_t0.j2 index 035a14177705..59afa7c1bb80 100644 --- a/device/mellanox/x86_64-mlnx_msn3700-r0/ACS-MSN3700/buffers_defaults_t0.j2 +++ b/device/mellanox/x86_64-mlnx_msn3700-r0/ACS-MSN3700/buffers_defaults_t0.j2 @@ -4,107 +4,20 @@ {% set egress_lossless_pool_size = '34287552' %} {% set egress_lossy_pool_size = '14542848' %} -{%- macro generate_port_lists(PORT_ALL) %} - {# Generate list of ports #} - {%- for port_idx in range(0, 32) %} - {%- if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{%- endif %} - {%- endfor %} -{%- endmacro %} +{% import 'buffers_defaults_objects.j2' as defs with context %} -{%- macro generate_buffer_pool_and_profiles() %} - "BUFFER_POOL": { - "ingress_lossless_pool": { - {%- if dynamic_mode is not defined %} - "size": "{{ ingress_lossless_pool_size }}", - {%- endif %} - "type": "ingress", - "mode": "dynamic" - }, - "ingress_lossy_pool": { - {%- if dynamic_mode is not defined %} - "size": "{{ ingress_lossy_pool_size }}", - {%- endif %} - "type": "ingress", - "mode": "dynamic" - }, - "egress_lossless_pool": { - "size": "{{ egress_lossless_pool_size }}", - "type": "egress", - "mode": "dynamic" - }, - "egress_lossy_pool": { - {%- if dynamic_mode is not defined %} - "size": "{{ egress_lossy_pool_size }}", - {%- endif %} - "type": "egress", - "mode": "dynamic" - } - }, - "BUFFER_PROFILE": { - "ingress_lossless_profile": { - "pool":"[BUFFER_POOL|ingress_lossless_pool]", - "size":"0", - "dynamic_th":"7" - }, - "ingress_lossy_profile": { - "pool":"[BUFFER_POOL|ingress_lossy_pool]", - "size":"0", - "dynamic_th":"3" - }, - "egress_lossless_profile": { - "pool":"[BUFFER_POOL|egress_lossless_pool]", - "size":"0", - "dynamic_th":"7" - }, - "egress_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"9216", - "dynamic_th":"7" - }, - "q_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"0", - "dynamic_th":"3" - } - }, +{%- macro generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) %} +{{ defs.generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) }} {%- endmacro %} -{%- macro generate_profile_lists(port_names) %} - "BUFFER_PORT_INGRESS_PROFILE_LIST": { -{% for port in port_names.split(',') %} - "{{ port }}": { - "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" - }{% if not loop.last %},{% endif %} - -{% endfor %} - }, - "BUFFER_PORT_EGRESS_PROFILE_LIST": { -{% for port in port_names.split(',') %} - "{{ port }}": { - "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" - }{% if not loop.last %},{% endif %} - -{% endfor %} - } +{%- macro generate_profile_lists_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_profile_lists(port_names_active, port_names_inactive) }} {%- endmacro %} -{%- macro generate_queue_buffers(port_names) %} - "BUFFER_QUEUE": { -{% for port in port_names.split(',') %} - "{{ port }}|3-4": { - "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" - }, -{% endfor %} -{% for port in port_names.split(',') %} - "{{ port }}|0-2": { - "profile" : "[BUFFER_PROFILE|q_lossy_profile]" - }, -{% endfor %} -{% for port in port_names.split(',') %} - "{{ port }}|5-6": { - "profile" : "[BUFFER_PROFILE|q_lossy_profile]" - }{% if not loop.last %},{% endif %} +{%- macro generate_queue_buffers_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_queue_buffers(port_names_active, port_names_inactive) }} +{%- endmacro %} -{% endfor %} - } +{%- macro generate_pg_profiles_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_pg_profiles(port_names_active, port_names_inactive) }} {%- endmacro %} diff --git a/device/mellanox/x86_64-mlnx_msn3700-r0/ACS-MSN3700/buffers_defaults_t1.j2 b/device/mellanox/x86_64-mlnx_msn3700-r0/ACS-MSN3700/buffers_defaults_t1.j2 index 1032b455b8f1..d8478d18d2db 100644 --- a/device/mellanox/x86_64-mlnx_msn3700-r0/ACS-MSN3700/buffers_defaults_t1.j2 +++ b/device/mellanox/x86_64-mlnx_msn3700-r0/ACS-MSN3700/buffers_defaults_t1.j2 @@ -4,107 +4,20 @@ {% set egress_lossless_pool_size = '34287552' %} {% set egress_lossy_pool_size = '11622400' %} -{%- macro generate_port_lists(PORT_ALL) %} - {# Generate list of ports #} - {%- for port_idx in range(0, 32) %} - {%- if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{%- endif %} - {%- endfor %} -{%- endmacro %} +{% import 'buffers_defaults_objects.j2' as defs with context %} -{%- macro generate_buffer_pool_and_profiles() %} - "BUFFER_POOL": { - "ingress_lossless_pool": { - {%- if dynamic_mode is not defined %} - "size": "{{ ingress_lossless_pool_size }}", - {%- endif %} - "type": "ingress", - "mode": "dynamic" - }, - "ingress_lossy_pool": { - {%- if dynamic_mode is not defined %} - "size": "{{ ingress_lossy_pool_size }}", - {%- endif %} - "type": "ingress", - "mode": "dynamic" - }, - "egress_lossless_pool": { - "size": "{{ egress_lossless_pool_size }}", - "type": "egress", - "mode": "dynamic" - }, - "egress_lossy_pool": { - {%- if dynamic_mode is not defined %} - "size": "{{ egress_lossy_pool_size }}", - {%- endif %} - "type": "egress", - "mode": "dynamic" - } - }, - "BUFFER_PROFILE": { - "ingress_lossless_profile": { - "pool":"[BUFFER_POOL|ingress_lossless_pool]", - "size":"0", - "dynamic_th":"7" - }, - "ingress_lossy_profile": { - "pool":"[BUFFER_POOL|ingress_lossy_pool]", - "size":"0", - "dynamic_th":"3" - }, - "egress_lossless_profile": { - "pool":"[BUFFER_POOL|egress_lossless_pool]", - "size":"0", - "dynamic_th":"7" - }, - "egress_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"9216", - "dynamic_th":"7" - }, - "q_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"0", - "dynamic_th":"3" - } - }, +{%- macro generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) %} +{{ defs.generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) }} {%- endmacro %} -{%- macro generate_profile_lists(port_names) %} - "BUFFER_PORT_INGRESS_PROFILE_LIST": { -{% for port in port_names.split(',') %} - "{{ port }}": { - "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" - }{% if not loop.last %},{% endif %} - -{% endfor %} - }, - "BUFFER_PORT_EGRESS_PROFILE_LIST": { -{% for port in port_names.split(',') %} - "{{ port }}": { - "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" - }{% if not loop.last %},{% endif %} - -{% endfor %} - } +{%- macro generate_profile_lists_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_profile_lists(port_names_active, port_names_inactive) }} {%- endmacro %} -{%- macro generate_queue_buffers(port_names) %} - "BUFFER_QUEUE": { -{% for port in port_names.split(',') %} - "{{ port }}|3-4": { - "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" - }, -{% endfor %} -{% for port in port_names.split(',') %} - "{{ port }}|0-2": { - "profile" : "[BUFFER_PROFILE|q_lossy_profile]" - }, -{% endfor %} -{% for port in port_names.split(',') %} - "{{ port }}|5-6": { - "profile" : "[BUFFER_PROFILE|q_lossy_profile]" - }{% if not loop.last %},{% endif %} +{%- macro generate_queue_buffers_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_queue_buffers(port_names_active, port_names_inactive) }} +{%- endmacro %} -{% endfor %} - } +{%- macro generate_pg_profiles_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_pg_profiles(port_names_active, port_names_inactive) }} {%- endmacro %} diff --git a/device/mellanox/x86_64-mlnx_msn3700-r0/ACS-MSN3700/sai.profile b/device/mellanox/x86_64-mlnx_msn3700-r0/ACS-MSN3700/sai.profile index 4907e971a2dd..a2f615568e59 100644 --- a/device/mellanox/x86_64-mlnx_msn3700-r0/ACS-MSN3700/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn3700-r0/ACS-MSN3700/sai.profile @@ -1 +1,3 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_3700.xml +SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps +SAI_DUMP_STORE_AMOUNT=10 diff --git a/device/mellanox/x86_64-mlnx_msn3700-r0/get_sensors_conf_path b/device/mellanox/x86_64-mlnx_msn3700-r0/get_sensors_conf_path new file mode 100755 index 000000000000..62e91e8d43d2 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3700-r0/get_sensors_conf_path @@ -0,0 +1,21 @@ +#!/bin/bash + +HW_RESPIN_VERSION="/var/run/hw-management/system/config3" +SENSORS_CONF_FILE="/usr/share/sonic/platform/sensors.conf" +SENSORS_RESPIN_CONF_FILE="/usr/share/sonic/platform/sensors_respin.conf" + +function get_sensor_conf_path() { + local _HW_RESPIN_VERSION="0" + if [[ -e $HW_RESPIN_VERSION ]]; then + _HW_RESPIN_VERSION=$(cat $HW_RESPIN_VERSION 2>&1) + if [[ "$_HW_RESPIN_VERSION" == "1" ]]; then + if [[ -e $SENSORS_RESPIN_CONF_FILE ]]; then + echo $SENSORS_RESPIN_CONF_FILE + return + fi + fi + fi + echo $SENSORS_CONF_FILE +} + +get_sensor_conf_path diff --git a/device/mellanox/x86_64-mlnx_msn3700-r0/pcie.yaml b/device/mellanox/x86_64-mlnx_msn3700-r0/pcie.yaml index 947e9f43f8b3..f9c4a2573153 100644 --- a/device/mellanox/x86_64-mlnx_msn3700-r0/pcie.yaml +++ b/device/mellanox/x86_64-mlnx_msn3700-r0/pcie.yaml @@ -130,13 +130,13 @@ id: 6f53 name: 'System peripheral: Intel Corporation Xeon Processor D Family QuickData Technology Register DMA Channel 3' -- bus: '06' +- bus: '07' dev: '00' fn: '0' id: cf6c name: 'Ethernet controller: Mellanox Technologies MT53100 [Spectrum-2, 64 x 100GbE switch]' -- bus: 08 +- bus: 09 dev: '00' fn: '0' id: '1533' diff --git a/device/mellanox/x86_64-mlnx_msn3700-r0/platform.json b/device/mellanox/x86_64-mlnx_msn3700-r0/platform.json new file mode 100644 index 000000000000..4bc8fe5991d0 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3700-r0/platform.json @@ -0,0 +1,410 @@ +{ + "chassis": { + "name": "MSN3700", + "components": [ + { + "name": "ONIE" + }, + { + "name": "SSD" + }, + { + "name": "BIOS" + }, + { + "name": "CPLD1" + }, + { + "name": "CPLD2" + }, + { + "name": "CPLD3" + } + ], + "fans": [], + "fan_drawers": [ + { + "name": "drawer1", + "fans": [ + { + "name": "fan1" + }, + { + "name": "fan2" + } + ] + }, + { + "name": "drawer2", + "fans": [ + { + "name": "fan3" + }, + { + "name": "fan4" + } + ] + }, + { + "name": "drawer3", + "fans": [ + { + "name": "fan5" + }, + { + "name": "fan6" + } + ] + }, + { + "name": "drawer4", + "fans": [ + { + "name": "fan7" + }, + { + "name": "fan8" + } + ] + }, + { + "name": "drawer5", + "fans": [ + { + "name": "fan9" + }, + { + "name": "fan10" + } + ] + }, + { + "name": "drawer6", + "fans": [ + { + "name": "fan11" + }, + { + "name": "fan12" + } + ] + } + ], + "psus": [ + { + "name": "PSU 1", + "fans": [ + { + "name": "psu1_fan1" + } + ], + "thermals": [ + { + "name": "PSU-1 Temp" + } + ] + }, + { + "name": "PSU 2", + "fans": [ + { + "name": "psu2_fan1" + } + ], + "thermals": [ + { + "name": "PSU-2 Temp" + } + ] + } + ], + "thermals": [ + { + "name": "ASIC" + }, + { + "name": "Ambient COMEX Temp" + }, + { + "name": "Ambient Fan Side Temp" + }, + { + "name": "Ambient Port Side Temp" + }, + { + "name": "CPU Core 0 Temp" + }, + { + "name": "CPU Core 1 Temp" + }, + { + "name": "CPU Core 2 Temp" + }, + { + "name": "CPU Core 3 Temp" + }, + { + "name": "CPU Pack Temp" + } + ], + "sfps": [ + { + "name": "sfp1", + "thermals": [ + { + "name": "xSFP module 1 Temp" + } + ] + }, + { + "name": "sfp2", + "thermals": [ + { + "name": "xSFP module 2 Temp" + } + ] + }, + { + "name": "sfp3", + "thermals": [ + { + "name": "xSFP module 3 Temp" + } + ] + }, + { + "name": "sfp4", + "thermals": [ + { + "name": "xSFP module 4 Temp" + } + ] + }, + { + "name": "sfp5", + "thermals": [ + { + "name": "xSFP module 5 Temp" + } + ] + }, + { + "name": "sfp6", + "thermals": [ + { + "name": "xSFP module 6 Temp" + } + ] + }, + { + "name": "sfp7", + "thermals": [ + { + "name": "xSFP module 7 Temp" + } + ] + }, + { + "name": "sfp8", + "thermals": [ + { + "name": "xSFP module 8 Temp" + } + ] + }, + { + "name": "sfp9", + "thermals": [ + { + "name": "xSFP module 9 Temp" + } + ] + }, + { + "name": "sfp10", + "thermals": [ + { + "name": "xSFP module 10 Temp" + } + ] + }, + { + "name": "sfp11", + "thermals": [ + { + "name": "xSFP module 11 Temp" + } + ] + }, + { + "name": "sfp12", + "thermals": [ + { + "name": "xSFP module 12 Temp" + } + ] + }, + { + "name": "sfp13", + "thermals": [ + { + "name": "xSFP module 13 Temp" + } + ] + }, + { + "name": "sfp14", + "thermals": [ + { + "name": "xSFP module 14 Temp" + } + ] + }, + { + "name": "sfp15", + "thermals": [ + { + "name": "xSFP module 15 Temp" + } + ] + }, + { + "name": "sfp16", + "thermals": [ + { + "name": "xSFP module 16 Temp" + } + ] + }, + { + "name": "sfp17", + "thermals": [ + { + "name": "xSFP module 17 Temp" + } + ] + }, + { + "name": "sfp18", + "thermals": [ + { + "name": "xSFP module 18 Temp" + } + ] + }, + { + "name": "sfp19", + "thermals": [ + { + "name": "xSFP module 19 Temp" + } + ] + }, + { + "name": "sfp20", + "thermals": [ + { + "name": "xSFP module 20 Temp" + } + ] + }, + { + "name": "sfp21", + "thermals": [ + { + "name": "xSFP module 21 Temp" + } + ] + }, + { + "name": "sfp22", + "thermals": [ + { + "name": "xSFP module 22 Temp" + } + ] + }, + { + "name": "sfp23", + "thermals": [ + { + "name": "xSFP module 23 Temp" + } + ] + }, + { + "name": "sfp24", + "thermals": [ + { + "name": "xSFP module 24 Temp" + } + ] + }, + { + "name": "sfp25", + "thermals": [ + { + "name": "xSFP module 25 Temp" + } + ] + }, + { + "name": "sfp26", + "thermals": [ + { + "name": "xSFP module 26 Temp" + } + ] + }, + { + "name": "sfp27", + "thermals": [ + { + "name": "xSFP module 27 Temp" + } + ] + }, + { + "name": "sfp28", + "thermals": [ + { + "name": "xSFP module 28 Temp" + } + ] + }, + { + "name": "sfp29", + "thermals": [ + { + "name": "xSFP module 29 Temp" + } + ] + }, + { + "name": "sfp30", + "thermals": [ + { + "name": "xSFP module 30 Temp" + } + ] + }, + { + "name": "sfp31", + "thermals": [ + { + "name": "xSFP module 31 Temp" + } + ] + }, + { + "name": "sfp32", + "thermals": [ + { + "name": "xSFP module 32 Temp" + } + ] + } + ] + }, + "interfaces": {} +} diff --git a/device/mellanox/x86_64-mlnx_msn3700-r0/sensors.conf b/device/mellanox/x86_64-mlnx_msn3700-r0/sensors.conf index 28a889aa27d2..281f0a54dfa3 100644 --- a/device/mellanox/x86_64-mlnx_msn3700-r0/sensors.conf +++ b/device/mellanox/x86_64-mlnx_msn3700-r0/sensors.conf @@ -72,20 +72,6 @@ bus "i2c-15" "i2c-1-mux (chan_id 6)" # Power supplies bus "i2c-4" "i2c-1-mux (chan_id 3)" chip "dps460-i2c-*-58" - label in1 "PSU-1 220V Rail (in)" - ignore in2 - label in3 "PSU-1 12V Rail (out)" - label fan1 "PSU-1 Fan 1" - ignore fan2 - ignore fan3 - label temp1 "PSU-1 Temp 1" - label temp2 "PSU-1 Temp 2" - label temp3 "PSU-1 Temp 3" - label power1 "PSU-1 220V Rail Pwr (in)" - label power2 "PSU-1 12V Rail Pwr (out)" - label curr1 "PSU-1 220V Rail Curr (in)" - label curr2 "PSU-1 12V Rail Curr (out)" - chip "dps460-i2c-*-59" label in1 "PSU-2 220V Rail (in)" ignore in2 label in3 "PSU-2 12V Rail (out)" @@ -99,6 +85,20 @@ bus "i2c-4" "i2c-1-mux (chan_id 3)" label power2 "PSU-2 12V Rail Pwr (out)" label curr1 "PSU-2 220V Rail Curr (in)" label curr2 "PSU-2 12V Rail Curr (out)" + chip "dps460-i2c-*-59" + label in1 "PSU-1 220V Rail (in)" + ignore in2 + label in3 "PSU-1 12V Rail (out)" + label fan1 "PSU-1 Fan 1" + ignore fan2 + ignore fan3 + label temp1 "PSU-1 Temp 1" + label temp2 "PSU-1 Temp 2" + label temp3 "PSU-1 Temp 3" + label power1 "PSU-1 220V Rail Pwr (in)" + label power2 "PSU-1 12V Rail Pwr (out)" + label curr1 "PSU-1 220V Rail Curr (in)" + label curr2 "PSU-1 12V Rail Curr (out)" # Chassis fans chip "mlxreg_fan-isa-*" diff --git a/device/mellanox/x86_64-mlnx_msn3700-r0/sensors_respin.conf b/device/mellanox/x86_64-mlnx_msn3700-r0/sensors_respin.conf new file mode 100644 index 000000000000..d3cd3091faa8 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3700-r0/sensors_respin.conf @@ -0,0 +1,187 @@ +## +## Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. +## Apache-2.0 +## +## Licensed under the Apache License, Version 2.0 (the "License"); +## you may not use this file except in compliance with the License. +## You may obtain a copy of the License at +## +## http://www.apache.org/licenses/LICENSE-2.0 +## +## Unless required by applicable law or agreed to in writing, software +## distributed under the License is distributed on an "AS IS" BASIS, +## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +## See the License for the specific language governing permissions and +## limitations under the License. +## + +# Temperature sensors +bus "i2c-2" "i2c-1-mux (chan_id 1)" + chip "mlxsw-i2c-*-48" + label temp1 "Ambient ASIC Temp" + +bus "i2c-7" "i2c-1-mux (chan_id 6)" + chip "tmp102-i2c-*-49" + label temp1 "Ambient Fan Side Temp (air intake)" + chip "tmp102-i2c-*-4a" + label temp1 "Ambient Port Side Temp (air exhaust)" + +bus "i2c-15" "i2c-1-mux (chan_id 6)" + chip "tmp102-i2c-15-49" + label temp1 "Ambient COMEX Temp" + +# Power controllers +bus "i2c-5" "i2c-1-mux (chan_id 4)" + chip "tps53679-i2c-*-70" + label in1 "PMIC-1 PSU 12V Rail (in1)" + label in2 "PMIC-1 PSU 12V Rail (in2)" + label in3 "PMIC-1 ASIC 0.8V VCORE Rail (out)" + label in4 "PMIC-1 ASIC 1.2V Rail (out)" + label temp1 "PMIC-1 Temp 1" + label temp2 "PMIC-1 Temp 2" + label power1 "PMIC-1 ASIC 0.8V VCORE Rail Pwr (out)" + label power2 "PMIC-1 ASIC 1.2V Rail Pwr (out)" + label curr1 "PMIC-1 ASIC 0.8V VCORE Rail Curr (out)" + label curr2 "PMIC-1 ASIC 1.2V Rail Curr (out)" + chip "tps53679-i2c-*-71" + label in1 "PMIC-2 PSU 12V Rail (in1)" + label in2 "PMIC-2 PSU 12V Rail (in2)" + label in3 "PMIC-2 ASIC 3.3V Rail (out)" + compute in3 (1.5)*@, @/(1.5) + label in4 "PMIC-2 ASIC 1.8V Rail (out)" + label temp1 "PMIC-2 Temp 1" + label temp2 "PMIC-2 Temp 2" + label power1 "PMIC-2 ASIC 3.3V Rail Pwr (out)" + label power2 "PMIC-2 ASIC 1.8V Rail Pwr (out)" + label curr1 "PMIC-2 ASIC 3.3V Rail Curr (out)" + label curr2 "PMIC-2 ASIC 1.8V Rail Curr (out)" + + chip "mp2975-i2c-*-62" + label in1 "PMIC-1 PSU 12V Rail (in)" + label in2 "PMIC-1 ASIC 0.8V VCORE Rail (out)" + label in3 "PMIC-1 ASIC 1.2V Rail (out)" + ignore in4 + label temp1 "PMIC-1 Temp 1" + label temp2 "PMIC-1 Temp 2" + label power1 "PMIC-1 ASIC 0.8V VCORE Rail Pwr (out)" + label power2 "PMIC-1 ASIC 1.2V Rail Pwr (out)" + label curr1 "PMIC-1 ASIC 0.8V VCORE Rail Curr (out)" + label curr2 "PMIC-1 ASIC 1.2V Rail Curr (out)" + chip "mp2975-i2c-*-66" + label in1 "PMIC-2 PSU 12V Rail (in)" + label in2 "PMIC-2 ASIC 3.3V Rail (out)" + compute in2 (2)*@, @/(2) + label in3 "PMIC-2 ASIC 1.8V Rail (out)" + ignore in4 + label temp1 "PMIC-2 Temp 1" + label temp2 "PMIC-2 Temp 2" + label power1 "PMIC-2 ASIC 3.3V Rail Pwr (out)" + label power2 "PMIC-2 ASIC 1.8V Rail Pwr (out)" + label curr1 "PMIC-2 ASIC 3.3V Rail Curr (out)" + label curr2 "PMIC-2 ASIC 1.8V Rail Curr (out)" + +bus "i2c-15" "i2c-1-mux (chan_id 6)" + chip "tps53679-i2c-*-58" + label in1 "PMIC-3 PSU 12V Rail (in1)" + label in2 "PMIC-3 PSU 12V Rail (in2)" + label in3 "PMIC-3 COMEX 1.8V Rail (out)" + label in4 "PMIC-3 COMEX 1.05V Rail (out)" + label temp1 "PMIC-3 Temp 1" + label temp2 "PMIC-3 Temp 2" + label power1 "PMIC-3 COMEX 1.8V Rail Pwr (out)" + label power2 "PMIC-3 COMEX 1.05V Rail Pwr (out)" + label curr1 "PMIC-3 COMEX 1.8V Rail Curr (out)" + label curr2 "PMIC-3 COMEX 1.05V Rail Curr (out)" + chip "tps53679-i2c-*-61" + label in1 "PMIC-4 PSU 12V Rail (in1)" + label in2 "PMIC-4 PSU 12V Rail (in2)" + label in3 "PMIC-4 COMEX 1.2V Rail (out)" + ignore in4 + label temp1 "PMIC-4 Temp 1" + label temp2 "PMIC-4 Temp 2" + label power1 "PMIC-4 COMEX 1.2V Rail Pwr (out)" + ignore power2 + label curr1 "PMIC-4 COMEX 1.2V Rail Curr (out)" + ignore curr2 + + chip "mp2975-i2c-*-6a" + label in1 "PMIC-3 PSU 12V Rail (in1)" + label in2 "PMIC-3 COMEX 1.8V Rail (out)" + label in3 "PMIC-3 COMEX 1.05V Rail (out)" + label temp1 "PMIC-3 Temp 1" + label power1 "PMIC-3 COMEX 12V Rail Pwr (in)" + label power2 "PMIC-3 COMEX 1.8V Rail Pwr (out)" + label power3 "PMIC-3 COMEX 1.05V Rail Pwr (out)" + label curr1 "PMIC-3 COMEX 12V Rail Curr (in)" + label curr2 "PMIC-3 COMEX 1.8V Rail Curr (out)" + ignore curr3 + ignore curr4 + label curr5 "PMIC-3 COMEX 1.05V Rail Curr (out)" + ignore curr6 + + chip "mp2975-i2c-*-61" + label in1 "PMIC-4 PSU 12V Rail (in1)" + label in2 "PMIC-4 COMEX 1.2V Rail (out)" + label temp1 "PMIC-4 Temp 1" + label temp2 "PMIC-4 Temp 2" + label power1 "PMIC-4 COMEX 12V Rail Pwr (in)" + label power2 "PMIC-4 COMEX 1.2V Rail Pwr (out)" + label curr1 "PMIC-4 COMEX 12V Rail Curr (in)" + label curr2 "PMIC-4 COMEX 1.2V Rail Curr (out)" + ignore curr3 + +# Power supplies +bus "i2c-4" "i2c-1-mux (chan_id 3)" + chip "dps460-i2c-*-58" + label in1 "PSU-1 220V Rail (in)" + ignore in2 + label in3 "PSU-1 12V Rail (out)" + label fan1 "PSU-1 Fan 1" + ignore fan2 + ignore fan3 + label temp1 "PSU-1 Temp 1" + label temp2 "PSU-1 Temp 2" + label temp3 "PSU-1 Temp 3" + label power1 "PSU-1 220V Rail Pwr (in)" + label power2 "PSU-1 12V Rail Pwr (out)" + label curr1 "PSU-1 220V Rail Curr (in)" + label curr2 "PSU-1 12V Rail Curr (out)" + set in3_lcrit in3_crit * 0.662 + set in3_min in3_crit * 0.745 + set in3_max in3_crit * 0.952 + chip "dps460-i2c-*-59" + label in1 "PSU-2 220V Rail (in)" + ignore in2 + label in3 "PSU-2 12V Rail (out)" + label fan1 "PSU-2 Fan 1" + ignore fan2 + ignore fan3 + label temp1 "PSU-2 Temp 1" + label temp2 "PSU-2 Temp 2" + label temp3 "PSU-2 Temp 3" + label power1 "PSU-2 220V Rail Pwr (in)" + label power2 "PSU-2 12V Rail Pwr (out)" + label curr1 "PSU-2 220V Rail Curr (in)" + label curr2 "PSU-2 12V Rail Curr (out)" + set in3_lcrit in3_crit * 0.662 + set in3_min in3_crit * 0.745 + set in3_max in3_crit * 0.952 + +# Chassis fans +chip "mlxreg_fan-isa-*" + label fan1 "Chassis Fan Drawer-1 Tach 1" + label fan2 "Chassis Fan Drawer-1 Tach 2" + label fan3 "Chassis Fan Drawer-2 Tach 1" + label fan4 "Chassis Fan Drawer-2 Tach 2" + label fan5 "Chassis Fan Drawer-3 Tach 1" + label fan6 "Chassis Fan Drawer-3 Tach 2" + label fan7 "Chassis Fan Drawer-4 Tach 1" + label fan8 "Chassis Fan Drawer-4 Tach 2" + label fan9 "Chassis Fan Drawer-5 Tach 1" + label fan10 "Chassis Fan Drawer-5 Tach 2" + label fan11 "Chassis Fan Drawer-6 Tach 1" + label fan12 "Chassis Fan Drawer-6 Tach 2" + +# Miscellaneous +chip "*-virtual-*" + ignore temp1 diff --git a/device/mellanox/x86_64-mlnx_msn3700_simx-r0/platform_reboot b/device/mellanox/x86_64-mlnx_msn3700_simx-r0/platform_reboot deleted file mode 120000 index dfaf53417665..000000000000 --- a/device/mellanox/x86_64-mlnx_msn3700_simx-r0/platform_reboot +++ /dev/null @@ -1 +0,0 @@ -../x86_64-mlnx_msn2700_simx-r0/platform_reboot \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3700c-r0/ACS-MSN3700C/buffers_defaults_objects.j2 b/device/mellanox/x86_64-mlnx_msn3700c-r0/ACS-MSN3700C/buffers_defaults_objects.j2 new file mode 120000 index 000000000000..33b6704f9902 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3700c-r0/ACS-MSN3700C/buffers_defaults_objects.j2 @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/ACS-MSN2700/buffers_defaults_objects.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3700c-r0/ACS-MSN3700C/hwsku.json b/device/mellanox/x86_64-mlnx_msn3700c-r0/ACS-MSN3700C/hwsku.json deleted file mode 100644 index 7c5a8c1d95d2..000000000000 --- a/device/mellanox/x86_64-mlnx_msn3700c-r0/ACS-MSN3700C/hwsku.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "interfaces": { - "Ethernet0": { - "default_brkout_mode": "1x100G[40G]" - }, - "Ethernet4": { - "default_brkout_mode": "1x100G[40G]" - }, - "Ethernet8": { - "default_brkout_mode": "1x100G[40G]" - }, - "Ethernet12": { - "default_brkout_mode": "1x100G[40G]" - }, - "Ethernet16": { - "default_brkout_mode": "1x100G[40G]" - }, - "Ethernet20": { - "default_brkout_mode": "1x100G[40G]" - }, - "Ethernet24": { - "default_brkout_mode": "1x100G[40G]" - }, - "Ethernet28": { - "default_brkout_mode": "1x100G[40G]" - }, - "Ethernet32": { - "default_brkout_mode": "1x100G[40G]" - }, - "Ethernet36": { - "default_brkout_mode": "1x100G[40G]" - }, - "Ethernet40": { - "default_brkout_mode": "1x100G[40G]" - }, - "Ethernet44": { - "default_brkout_mode": "1x100G[40G]" - }, - "Ethernet48": { - "default_brkout_mode": "1x100G[40G]" - }, - "Ethernet52": { - "default_brkout_mode": "1x100G[40G]" - }, - "Ethernet56": { - "default_brkout_mode": "1x100G[40G]" - }, - "Ethernet60": { - "default_brkout_mode": "1x100G[40G]" - }, - "Ethernet64": { - "default_brkout_mode": "1x100G[40G]" - }, - "Ethernet68": { - "default_brkout_mode": "1x100G[40G]" - }, - "Ethernet72": { - "default_brkout_mode": "1x100G[40G]" - }, - "Ethernet76": { - "default_brkout_mode": "1x100G[40G]" - }, - "Ethernet80": { - "default_brkout_mode": "1x100G[40G]" - }, - "Ethernet84": { - "default_brkout_mode": "1x100G[40G]" - }, - "Ethernet88": { - "default_brkout_mode": "1x100G[40G]" - }, - "Ethernet92": { - "default_brkout_mode": "1x100G[40G]" - }, - "Ethernet96": { - "default_brkout_mode": "1x100G[40G]" - }, - "Ethernet100": { - "default_brkout_mode": "1x100G[40G]" - }, - "Ethernet104": { - "default_brkout_mode": "1x100G[40G]" - }, - "Ethernet108": { - "default_brkout_mode": "1x100G[40G]" - }, - "Ethernet112": { - "default_brkout_mode": "1x100G[40G]" - }, - "Ethernet116": { - "default_brkout_mode": "1x100G[40G]" - }, - "Ethernet120": { - "default_brkout_mode": "1x100G[40G]" - }, - "Ethernet124": { - "default_brkout_mode": "1x100G[40G]" - } - } -} diff --git a/device/mellanox/x86_64-mlnx_msn3700c-r0/ACS-MSN3700C/sai.profile b/device/mellanox/x86_64-mlnx_msn3700c-r0/ACS-MSN3700C/sai.profile index 46750fb2e07b..21afbfe5c6d3 100644 --- a/device/mellanox/x86_64-mlnx_msn3700c-r0/ACS-MSN3700C/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn3700c-r0/ACS-MSN3700C/sai.profile @@ -1 +1,3 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_3700c.xml +SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps +SAI_DUMP_STORE_AMOUNT=10 diff --git a/device/mellanox/x86_64-mlnx_msn3700c-r0/get_sensors_conf_path b/device/mellanox/x86_64-mlnx_msn3700c-r0/get_sensors_conf_path new file mode 120000 index 000000000000..fb7b1d6feda0 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3700c-r0/get_sensors_conf_path @@ -0,0 +1 @@ +../x86_64-mlnx_msn3700-r0/get_sensors_conf_path \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3700c-r0/pcie.yaml b/device/mellanox/x86_64-mlnx_msn3700c-r0/pcie.yaml index 21c48fe64008..6daf5eefa130 100644 --- a/device/mellanox/x86_64-mlnx_msn3700c-r0/pcie.yaml +++ b/device/mellanox/x86_64-mlnx_msn3700c-r0/pcie.yaml @@ -130,13 +130,13 @@ id: 6f53 name: 'System peripheral: Intel Corporation Xeon Processor D Family QuickData Technology Register DMA Channel 3' -- bus: '06' +- bus: '07' dev: '00' fn: '0' id: cf6c name: 'Ethernet controller: Mellanox Technologies MT53100 [Spectrum-2, 64 x 100GbE switch]' -- bus: 08 +- bus: 09 dev: '00' fn: '0' id: '1533' diff --git a/device/mellanox/x86_64-mlnx_msn3700c-r0/platform.json b/device/mellanox/x86_64-mlnx_msn3700c-r0/platform.json index 26eb952ab525..105c5c207d7e 100644 --- a/device/mellanox/x86_64-mlnx_msn3700c-r0/platform.json +++ b/device/mellanox/x86_64-mlnx_msn3700c-r0/platform.json @@ -1,196 +1,382 @@ { - "interfaces": { - "Ethernet0": { - "index": "1,1,1,1", - "lanes": "0,1,2,3", - "alias_at_lanes": "etp1a, etp1b, etp1c, etp1d", - "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" - }, - "Ethernet4": { - "index": "2,2,2,2", - "lanes": "4,5,6,7", - "alias_at_lanes": "etp2a, etp2b, etp2c, etp2d", - "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" - }, - "Ethernet8": { - "index": "3,3,3,3", - "lanes": "8,9,10,11", - "alias_at_lanes": "etp3a, etp3b, etp3c, etp3d", - "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" - }, - "Ethernet12": { - "index": "4,4,4,4", - "lanes": "12,13,14,15", - "alias_at_lanes": "etp4a, etp4b, etp4c, etp4d", - "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" - }, - "Ethernet16": { - "index": "5,5,5,5", - "lanes": "16,17,18,19", - "alias_at_lanes": "etp5a, etp5b, etp5c, etp5d", - "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" - }, - "Ethernet20": { - "index": "6,6,6,6", - "lanes": "20,21,22,23", - "alias_at_lanes": "etp6a, etp6b, etp6c, etp6d", - "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" - }, - "Ethernet24": { - "index": "7,7,7,7", - "lanes": "24,25,26,27", - "alias_at_lanes": "etp7a, etp7b, etp7c, etp7d", - "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" - }, - "Ethernet28": { - "index": "8,8,8,8", - "lanes": "28,29,30,31", - "alias_at_lanes": "etp8a, etp8b, etp8c, etp8d", - "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" - }, - "Ethernet32": { - "index": "9,9,9,9", - "lanes": "32,33,34,35", - "alias_at_lanes": "etp9a, etp9b, etp9c, etp9d", - "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" - }, - "Ethernet36": { - "index": "10,10,10,10", - "lanes": "36,37,38,39", - "alias_at_lanes": "etp10a, etp10b, etp10c, etp10d", - "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" - }, - "Ethernet40": { - "index": "11,11,11,11", - "lanes": "40,41,42,43", - "alias_at_lanes": "etp11a, etp11b, etp11c, etp11d", - "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" - }, - "Ethernet44": { - "index": "12,12,12,12", - "lanes": "44,45,46,47", - "alias_at_lanes": "etp12a, etp12b, etp12c, etp12d", - "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" - }, - "Ethernet48": { - "index": "13,13,13,13", - "lanes": "48,49,50,51", - "alias_at_lanes": "etp13a, etp13b, etp13c, etp13d", - "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" - }, - "Ethernet52": { - "index": "14,14,14,14", - "lanes": "52,53,54,55", - "alias_at_lanes": "etp14a, etp14b, etp14c, etp14d", - "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" - }, - "Ethernet56": { - "index": "15,15,15,15", - "lanes": "56,57,58,59", - "alias_at_lanes": "etp15a, etp15b, etp15c, etp15d", - "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" - }, - "Ethernet60": { - "index": "16,16,16,16", - "lanes": "60,61,62,63", - "alias_at_lanes": "etp16a, etp16b, etp16c, etp16d", - "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" - }, - "Ethernet64": { - "index": "17,17,17,17", - "lanes": "64,65,66,67", - "alias_at_lanes": "etp17a, etp17b, etp17c, etp17d", - "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" - }, - "Ethernet68": { - "index": "18,18,18,18", - "lanes": "68,69,70,71", - "alias_at_lanes": "etp18a, etp18b, etp18c, etp18d", - "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" - }, - "Ethernet72": { - "index": "19,19,19,19", - "lanes": "72,73,74,75", - "alias_at_lanes": "etp19a, etp19b, etp19c, etp19d", - "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" - }, - "Ethernet76": { - "index": "20,20,20,20", - "lanes": "76,77,78,79", - "alias_at_lanes": "etp20a, etp20b, etp20c, etp20d", - "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" - }, - "Ethernet80": { - "index": "21,21,21,21", - "lanes": "80,81,82,83", - "alias_at_lanes": "etp21a, etp21b, etp21c, etp21d", - "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" - }, - "Ethernet84": { - "index": "22,22,22,22", - "lanes": "84,85,86,87", - "alias_at_lanes": "etp22a, etp22b, etp22c, etp22d", - "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" - }, - "Ethernet88": { - "index": "23,23,23,23", - "lanes": "88,89,90,91", - "alias_at_lanes": "etp23a, etp23b, etp23c, etp23d", - "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" - }, - "Ethernet92": { - "index": "24,24,24,24", - "lanes": "92,93,94,95", - "alias_at_lanes": "etp24a, etp24b, etp24c, etp24d", - "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" - }, - "Ethernet96": { - "index": "25,25,25,25", - "lanes": "96,97,98,99", - "alias_at_lanes": "etp25a, etp25b, etp25c, etp25d", - "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" - }, - "Ethernet100": { - "index": "26,26,26,26", - "lanes": "100,101,102,103", - "alias_at_lanes": "etp26a, etp26b, etp26c, etp26d", - "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" - }, - "Ethernet104": { - "index": "27,27,27,27", - "lanes": "104,105,106,107", - "alias_at_lanes": "etp27a, etp27b, etp27c, etp27d", - "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" - }, - "Ethernet108": { - "index": "28,28,28,28", - "lanes": "108,109,110,111", - "alias_at_lanes": "etp28a, etp28b, etp28c, etp28d", - "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" - }, - "Ethernet112": { - "index": "29,29,29,29", - "lanes": "112,113,114,115", - "alias_at_lanes": "etp29a, etp29b, etp29c, etp29d", - "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" - }, - "Ethernet116": { - "index": "30,30,30,30", - "lanes": "116,117,118,119", - "alias_at_lanes": "etp30a, etp30b, etp30c, etp30d", - "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" - }, - "Ethernet120": { - "index": "31,31,31,31", - "lanes": "120,121,122,123", - "alias_at_lanes": "etp31a, etp31b, etp31c, etp31d", - "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" - }, - "Ethernet124": { - "index": "32,32,32,32", - "lanes": "124,125,126,127", - "alias_at_lanes": "etp32a, etp32b, etp32c, etp32d", - "breakout_modes": "1x100G[40G],2x50G,4x25G[10G]" - } - } + "chassis": { + "name": "MSN3700C", + "components": [ + { + "name": "ONIE" + }, + { + "name": "SSD" + }, + { + "name": "BIOS" + }, + { + "name": "CPLD1" + }, + { + "name": "CPLD2" + }, + { + "name": "CPLD3" + } + ], + "fans": [], + "fan_drawers": [ + { + "name": "drawer1", + "fans": [ + { + "name": "fan1" + }, + { + "name": "fan2" + } + ] + }, + { + "name": "drawer2", + "fans": [ + { + "name": "fan3" + }, + { + "name": "fan4" + } + ] + }, + { + "name": "drawer3", + "fans": [ + { + "name": "fan5" + }, + { + "name": "fan6" + } + ] + }, + { + "name": "drawer4", + "fans": [ + { + "name": "fan7" + }, + { + "name": "fan8" + } + ] + } + ], + "psus": [ + { + "name": "PSU 1", + "fans": [ + { + "name": "psu1_fan1" + } + ], + "thermals": [ + { + "name": "PSU-1 Temp" + } + ] + }, + { + "name": "PSU 2", + "fans": [ + { + "name": "psu2_fan1" + } + ], + "thermals": [ + { + "name": "PSU-2 Temp" + } + ] + } + ], + "thermals": [ + { + "name": "ASIC" + }, + { + "name": "Ambient COMEX Temp" + }, + { + "name": "Ambient Fan Side Temp" + }, + { + "name": "Ambient Port Side Temp" + }, + { + "name": "CPU Core 0 Temp" + }, + { + "name": "CPU Core 1 Temp" + }, + { + "name": "CPU Pack Temp" + } + ], + "sfps": [ + { + "name": "sfp1", + "thermals": [ + { + "name": "xSFP module 1 Temp" + } + ] + }, + { + "name": "sfp2", + "thermals": [ + { + "name": "xSFP module 2 Temp" + } + ] + }, + { + "name": "sfp3", + "thermals": [ + { + "name": "xSFP module 3 Temp" + } + ] + }, + { + "name": "sfp4", + "thermals": [ + { + "name": "xSFP module 4 Temp" + } + ] + }, + { + "name": "sfp5", + "thermals": [ + { + "name": "xSFP module 5 Temp" + } + ] + }, + { + "name": "sfp6", + "thermals": [ + { + "name": "xSFP module 6 Temp" + } + ] + }, + { + "name": "sfp7", + "thermals": [ + { + "name": "xSFP module 7 Temp" + } + ] + }, + { + "name": "sfp8", + "thermals": [ + { + "name": "xSFP module 8 Temp" + } + ] + }, + { + "name": "sfp9", + "thermals": [ + { + "name": "xSFP module 9 Temp" + } + ] + }, + { + "name": "sfp10", + "thermals": [ + { + "name": "xSFP module 10 Temp" + } + ] + }, + { + "name": "sfp11", + "thermals": [ + { + "name": "xSFP module 11 Temp" + } + ] + }, + { + "name": "sfp12", + "thermals": [ + { + "name": "xSFP module 12 Temp" + } + ] + }, + { + "name": "sfp13", + "thermals": [ + { + "name": "xSFP module 13 Temp" + } + ] + }, + { + "name": "sfp14", + "thermals": [ + { + "name": "xSFP module 14 Temp" + } + ] + }, + { + "name": "sfp15", + "thermals": [ + { + "name": "xSFP module 15 Temp" + } + ] + }, + { + "name": "sfp16", + "thermals": [ + { + "name": "xSFP module 16 Temp" + } + ] + }, + { + "name": "sfp17", + "thermals": [ + { + "name": "xSFP module 17 Temp" + } + ] + }, + { + "name": "sfp18", + "thermals": [ + { + "name": "xSFP module 18 Temp" + } + ] + }, + { + "name": "sfp19", + "thermals": [ + { + "name": "xSFP module 19 Temp" + } + ] + }, + { + "name": "sfp20", + "thermals": [ + { + "name": "xSFP module 20 Temp" + } + ] + }, + { + "name": "sfp21", + "thermals": [ + { + "name": "xSFP module 21 Temp" + } + ] + }, + { + "name": "sfp22", + "thermals": [ + { + "name": "xSFP module 22 Temp" + } + ] + }, + { + "name": "sfp23", + "thermals": [ + { + "name": "xSFP module 23 Temp" + } + ] + }, + { + "name": "sfp24", + "thermals": [ + { + "name": "xSFP module 24 Temp" + } + ] + }, + { + "name": "sfp25", + "thermals": [ + { + "name": "xSFP module 25 Temp" + } + ] + }, + { + "name": "sfp26", + "thermals": [ + { + "name": "xSFP module 26 Temp" + } + ] + }, + { + "name": "sfp27", + "thermals": [ + { + "name": "xSFP module 27 Temp" + } + ] + }, + { + "name": "sfp28", + "thermals": [ + { + "name": "xSFP module 28 Temp" + } + ] + }, + { + "name": "sfp29", + "thermals": [ + { + "name": "xSFP module 29 Temp" + } + ] + }, + { + "name": "sfp30", + "thermals": [ + { + "name": "xSFP module 30 Temp" + } + ] + }, + { + "name": "sfp31", + "thermals": [ + { + "name": "xSFP module 31 Temp" + } + ] + }, + { + "name": "sfp32", + "thermals": [ + { + "name": "xSFP module 32 Temp" + } + ] + } + ] + }, + "interfaces": {} } diff --git a/device/mellanox/x86_64-mlnx_msn3700c-r0/sensors.conf b/device/mellanox/x86_64-mlnx_msn3700c-r0/sensors.conf index 3c58e27f3e68..094cd78cde57 100644 --- a/device/mellanox/x86_64-mlnx_msn3700c-r0/sensors.conf +++ b/device/mellanox/x86_64-mlnx_msn3700c-r0/sensors.conf @@ -72,20 +72,6 @@ bus "i2c-15" "i2c-1-mux (chan_id 6)" # Power supplies bus "i2c-4" "i2c-1-mux (chan_id 3)" chip "dps460-i2c-*-58" - label in1 "PSU-1 220V Rail (in)" - ignore in2 - label in3 "PSU-1 12V Rail (out)" - label fan1 "PSU-1 Fan 1" - ignore fan2 - ignore fan3 - label temp1 "PSU-1 Temp 1" - label temp2 "PSU-1 Temp 2" - label temp3 "PSU-1 Temp 3" - label power1 "PSU-1 220V Rail Pwr (in)" - label power2 "PSU-1 12V Rail Pwr (out)" - label curr1 "PSU-1 220V Rail Curr (in)" - label curr2 "PSU-1 12V Rail Curr (out)" - chip "dps460-i2c-*-59" label in1 "PSU-2 220V Rail (in)" ignore in2 label in3 "PSU-2 12V Rail (out)" @@ -99,6 +85,20 @@ bus "i2c-4" "i2c-1-mux (chan_id 3)" label power2 "PSU-2 12V Rail Pwr (out)" label curr1 "PSU-2 220V Rail Curr (in)" label curr2 "PSU-2 12V Rail Curr (out)" + chip "dps460-i2c-*-59" + label in1 "PSU-1 220V Rail (in)" + ignore in2 + label in3 "PSU-1 12V Rail (out)" + label fan1 "PSU-1 Fan 1" + ignore fan2 + ignore fan3 + label temp1 "PSU-1 Temp 1" + label temp2 "PSU-1 Temp 2" + label temp3 "PSU-1 Temp 3" + label power1 "PSU-1 220V Rail Pwr (in)" + label power2 "PSU-1 12V Rail Pwr (out)" + label curr1 "PSU-1 220V Rail Curr (in)" + label curr2 "PSU-1 12V Rail Curr (out)" # Chassis fans chip "mlxreg_fan-isa-*" diff --git a/device/mellanox/x86_64-mlnx_msn3700c-r0/sensors_respin.conf b/device/mellanox/x86_64-mlnx_msn3700c-r0/sensors_respin.conf new file mode 100644 index 000000000000..740f9ae968fe --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3700c-r0/sensors_respin.conf @@ -0,0 +1,183 @@ +## +## Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. +## Apache-2.0 +## +## Licensed under the Apache License, Version 2.0 (the "License"); +## you may not use this file except in compliance with the License. +## You may obtain a copy of the License at +## +## http://www.apache.org/licenses/LICENSE-2.0 +## +## Unless required by applicable law or agreed to in writing, software +## distributed under the License is distributed on an "AS IS" BASIS, +## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +## See the License for the specific language governing permissions and +## limitations under the License. +## + +# Temperature sensors +bus "i2c-2" "i2c-1-mux (chan_id 1)" + chip "mlxsw-i2c-*-48" + label temp1 "Ambient ASIC Temp" + +bus "i2c-7" "i2c-1-mux (chan_id 6)" + chip "tmp102-i2c-*-49" + label temp1 "Ambient Fan Side Temp (air intake)" + chip "tmp102-i2c-*-4a" + label temp1 "Ambient Port Side Temp (air exhaust)" + +bus "i2c-15" "i2c-1-mux (chan_id 6)" + chip "tmp102-i2c-15-49" + label temp1 "Ambient COMEX Temp" + +# Power controllers +bus "i2c-5" "i2c-1-mux (chan_id 4)" + chip "tps53679-i2c-*-70" + label in1 "PMIC-1 PSU 12V Rail (in1)" + label in2 "PMIC-1 PSU 12V Rail (in2)" + label in3 "PMIC-1 ASIC 0.8V VCORE Rail (out)" + label in4 "PMIC-1 ASIC 1.2V Rail (out)" + label temp1 "PMIC-1 Temp 1" + label temp2 "PMIC-1 Temp 2" + label power1 "PMIC-1 ASIC 0.8V VCORE Rail Pwr (out)" + label power2 "PMIC-1 ASIC 1.2V Rail Pwr (out)" + label curr1 "PMIC-1 ASIC 0.8V VCORE Rail Curr (out)" + label curr2 "PMIC-1 ASIC 1.2V Rail Curr (out)" + chip "tps53679-i2c-*-71" + label in1 "PMIC-2 PSU 12V Rail (in1)" + label in2 "PMIC-2 PSU 12V Rail (in2)" + label in3 "PMIC-2 ASIC 3.3V Rail (out)" + compute in3 (1.5)*@, @/(1.5) + label in4 "PMIC-2 ASIC 1.8V Rail (out)" + label temp1 "PMIC-2 Temp 1" + label temp2 "PMIC-2 Temp 2" + label power1 "PMIC-2 ASIC 3.3V Rail Pwr (out)" + label power2 "PMIC-2 ASIC 1.8V Rail Pwr (out)" + label curr1 "PMIC-2 ASIC 3.3V Rail Curr (out)" + label curr2 "PMIC-2 ASIC 1.8V Rail Curr (out)" + + chip "mp2975-i2c-*-62" + label in1 "PMIC-1 PSU 12V Rail (in)" + label in2 "PMIC-1 ASIC 0.8V VCORE Rail (out)" + label in3 "PMIC-1 ASIC 1.2V Rail (out)" + ignore in4 + label temp1 "PMIC-1 Temp 1" + label temp2 "PMIC-1 Temp 2" + label power1 "PMIC-1 ASIC 0.8V VCORE Rail Pwr (out)" + label power2 "PMIC-1 ASIC 1.2V Rail Pwr (out)" + label curr1 "PMIC-1 ASIC 0.8V VCORE Rail Curr (out)" + label curr2 "PMIC-1 ASIC 1.2V Rail Curr (out)" + chip "mp2975-i2c-*-66" + label in1 "PMIC-2 PSU 12V Rail (in)" + label in2 "PMIC-2 ASIC 3.3V Rail (out)" + compute in2 (2)*@, @/(2) + label in3 "PMIC-2 ASIC 1.8V Rail (out)" + ignore in4 + label temp1 "PMIC-2 Temp 1" + label temp2 "PMIC-2 Temp 2" + label power1 "PMIC-2 ASIC 3.3V Rail Pwr (out)" + label power2 "PMIC-2 ASIC 1.8V Rail Pwr (out)" + label curr1 "PMIC-2 ASIC 3.3V Rail Curr (out)" + label curr2 "PMIC-2 ASIC 1.8V Rail Curr (out)" + +bus "i2c-15" "i2c-1-mux (chan_id 6)" + chip "tps53679-i2c-*-58" + label in1 "PMIC-3 PSU 12V Rail (in1)" + label in2 "PMIC-3 PSU 12V Rail (in2)" + label in3 "PMIC-3 COMEX 1.8V Rail (out)" + label in4 "PMIC-3 COMEX 1.05V Rail (out)" + label temp1 "PMIC-3 Temp 1" + label temp2 "PMIC-3 Temp 2" + label power1 "PMIC-3 COMEX 1.8V Rail Pwr (out)" + label power2 "PMIC-3 COMEX 1.05V Rail Pwr (out)" + label curr1 "PMIC-3 COMEX 1.8V Rail Curr (out)" + label curr2 "PMIC-3 COMEX 1.05V Rail Curr (out)" + chip "tps53679-i2c-*-61" + label in1 "PMIC-4 PSU 12V Rail (in1)" + label in2 "PMIC-4 PSU 12V Rail (in2)" + label in3 "PMIC-4 COMEX 1.2V Rail (out)" + ignore in4 + label temp1 "PMIC-4 Temp 1" + label temp2 "PMIC-4 Temp 2" + label power1 "PMIC-4 COMEX 1.2V Rail Pwr (out)" + ignore power2 + label curr1 "PMIC-4 COMEX 1.2V Rail Curr (out)" + ignore curr2 + + chip "mp2975-i2c-*-6a" + label in1 "PMIC-3 PSU 12V Rail (in1)" + label in2 "PMIC-3 COMEX 1.8V Rail (out)" + label in3 "PMIC-3 COMEX 1.05V Rail (out)" + label temp1 "PMIC-3 Temp 1" + label power1 "PMIC-3 COMEX 12V Rail Pwr (in)" + label power2 "PMIC-3 COMEX 1.8V Rail Pwr (out)" + label power3 "PMIC-3 COMEX 1.05V Rail Pwr (out)" + label curr1 "PMIC-3 COMEX 12V Rail Curr (in)" + label curr2 "PMIC-3 COMEX 1.8V Rail Curr (out)" + ignore curr3 + ignore curr4 + label curr5 "PMIC-3 COMEX 1.05V Rail Curr (out)" + ignore curr6 + + chip "mp2975-i2c-*-61" + label in1 "PMIC-4 PSU 12V Rail (in1)" + label in2 "PMIC-4 COMEX 1.2V Rail (out)" + label temp1 "PMIC-4 Temp 1" + label temp2 "PMIC-4 Temp 2" + label power1 "PMIC-4 COMEX 12V Rail Pwr (in)" + label power2 "PMIC-4 COMEX 1.2V Rail Pwr (out)" + label curr1 "PMIC-4 COMEX 12V Rail Curr (in)" + label curr2 "PMIC-4 COMEX 1.2V Rail Curr (out)" + ignore curr3 + +# Power supplies +bus "i2c-4" "i2c-1-mux (chan_id 3)" + chip "dps460-i2c-*-58" + label in1 "PSU-1 220V Rail (in)" + ignore in2 + label in3 "PSU-1 12V Rail (out)" + label fan1 "PSU-1 Fan 1" + ignore fan2 + ignore fan3 + label temp1 "PSU-1 Temp 1" + label temp2 "PSU-1 Temp 2" + label temp3 "PSU-1 Temp 3" + label power1 "PSU-1 220V Rail Pwr (in)" + label power2 "PSU-1 12V Rail Pwr (out)" + label curr1 "PSU-1 220V Rail Curr (in)" + label curr2 "PSU-1 12V Rail Curr (out)" + set in3_lcrit in3_crit * 0.662 + set in3_min in3_crit * 0.745 + set in3_max in3_crit * 0.952 + chip "dps460-i2c-*-59" + label in1 "PSU-2 220V Rail (in)" + ignore in2 + label in3 "PSU-2 12V Rail (out)" + label fan1 "PSU-2 Fan 1" + ignore fan2 + ignore fan3 + label temp1 "PSU-2 Temp 1" + label temp2 "PSU-2 Temp 2" + label temp3 "PSU-2 Temp 3" + label power1 "PSU-2 220V Rail Pwr (in)" + label power2 "PSU-2 12V Rail Pwr (out)" + label curr1 "PSU-2 220V Rail Curr (in)" + label curr2 "PSU-2 12V Rail Curr (out)" + set in3_lcrit in3_crit * 0.662 + set in3_min in3_crit * 0.745 + set in3_max in3_crit * 0.952 + +# Chassis fans +chip "mlxreg_fan-isa-*" + label fan1 "Chassis Fan Drawer-1 Tach 1" + label fan2 "Chassis Fan Drawer-1 Tach 2" + label fan3 "Chassis Fan Drawer-2 Tach 1" + label fan4 "Chassis Fan Drawer-2 Tach 2" + label fan5 "Chassis Fan Drawer-3 Tach 1" + label fan6 "Chassis Fan Drawer-3 Tach 2" + label fan7 "Chassis Fan Drawer-4 Tach 1" + label fan8 "Chassis Fan Drawer-4 Tach 2" + +# Miscellaneous +chip "*-virtual-*" + ignore temp1 diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/ACS-MSN3800/buffers_defaults_objects.j2 b/device/mellanox/x86_64-mlnx_msn3800-r0/ACS-MSN3800/buffers_defaults_objects.j2 new file mode 120000 index 000000000000..33b6704f9902 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/ACS-MSN3800/buffers_defaults_objects.j2 @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/ACS-MSN2700/buffers_defaults_objects.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/ACS-MSN3800/buffers_defaults_t0.j2 b/device/mellanox/x86_64-mlnx_msn3800-r0/ACS-MSN3800/buffers_defaults_t0.j2 index b83e142448d6..0bb568b1a00e 100644 --- a/device/mellanox/x86_64-mlnx_msn3800-r0/ACS-MSN3800/buffers_defaults_t0.j2 +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/ACS-MSN3800/buffers_defaults_t0.j2 @@ -4,107 +4,20 @@ {% set egress_lossless_pool_size = '34287552' %} {% set egress_lossy_pool_size = '13924352' %} -{%- macro generate_port_lists(PORT_ALL) %} - {# Generate list of ports #} - {%- for port_idx in range(0, 32) %} - {%- if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{%- endif %} - {%- endfor %} -{%- endmacro %} +{% import 'buffers_defaults_objects.j2' as defs with context %} -{%- macro generate_buffer_pool_and_profiles() %} - "BUFFER_POOL": { - "ingress_lossless_pool": { - {%- if dynamic_mode is not defined %} - "size": "{{ ingress_lossless_pool_size }}", - {%- endif %} - "type": "ingress", - "mode": "dynamic" - }, - "ingress_lossy_pool": { - {%- if dynamic_mode is not defined %} - "size": "{{ ingress_lossy_pool_size }}", - {%- endif %} - "type": "ingress", - "mode": "dynamic" - }, - "egress_lossless_pool": { - "size": "{{ egress_lossless_pool_size }}", - "type": "egress", - "mode": "dynamic" - }, - "egress_lossy_pool": { - {%- if dynamic_mode is not defined %} - "size": "{{ egress_lossy_pool_size }}", - {%- endif %} - "type": "egress", - "mode": "dynamic" - } - }, - "BUFFER_PROFILE": { - "ingress_lossless_profile": { - "pool":"[BUFFER_POOL|ingress_lossless_pool]", - "size":"0", - "dynamic_th":"7" - }, - "ingress_lossy_profile": { - "pool":"[BUFFER_POOL|ingress_lossy_pool]", - "size":"0", - "dynamic_th":"3" - }, - "egress_lossless_profile": { - "pool":"[BUFFER_POOL|egress_lossless_pool]", - "size":"0", - "dynamic_th":"7" - }, - "egress_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"9216", - "dynamic_th":"7" - }, - "q_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"0", - "dynamic_th":"3" - } - }, +{%- macro generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) %} +{{ defs.generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) }} {%- endmacro %} -{%- macro generate_profile_lists(port_names) %} - "BUFFER_PORT_INGRESS_PROFILE_LIST": { -{% for port in port_names.split(',') %} - "{{ port }}": { - "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" - }{% if not loop.last %},{% endif %} - -{% endfor %} - }, - "BUFFER_PORT_EGRESS_PROFILE_LIST": { -{% for port in port_names.split(',') %} - "{{ port }}": { - "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" - }{% if not loop.last %},{% endif %} - -{% endfor %} - } +{%- macro generate_profile_lists_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_profile_lists(port_names_active, port_names_inactive) }} {%- endmacro %} -{%- macro generate_queue_buffers(port_names) %} - "BUFFER_QUEUE": { -{% for port in port_names.split(',') %} - "{{ port }}|3-4": { - "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" - }, -{% endfor %} -{% for port in port_names.split(',') %} - "{{ port }}|0-2": { - "profile" : "[BUFFER_PROFILE|q_lossy_profile]" - }, -{% endfor %} -{% for port in port_names.split(',') %} - "{{ port }}|5-6": { - "profile" : "[BUFFER_PROFILE|q_lossy_profile]" - }{% if not loop.last %},{% endif %} +{%- macro generate_queue_buffers_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_queue_buffers(port_names_active, port_names_inactive) }} +{%- endmacro %} -{% endfor %} - } +{%- macro generate_pg_profiles_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_pg_profiles(port_names_active, port_names_inactive) }} {%- endmacro %} diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/ACS-MSN3800/buffers_defaults_t1.j2 b/device/mellanox/x86_64-mlnx_msn3800-r0/ACS-MSN3800/buffers_defaults_t1.j2 index abcab930c63e..0d95f59b5eef 100644 --- a/device/mellanox/x86_64-mlnx_msn3800-r0/ACS-MSN3800/buffers_defaults_t1.j2 +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/ACS-MSN3800/buffers_defaults_t1.j2 @@ -4,107 +4,20 @@ {% set egress_lossless_pool_size = '34287552' %} {% set egress_lossy_pool_size = '12457984' %} -{%- macro generate_port_lists(PORT_ALL) %} - {# Generate list of ports #} - {%- for port_idx in range(0, 32) %} - {%- if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{%- endif %} - {%- endfor %} -{%- endmacro %} +{% import 'buffers_defaults_objects.j2' as defs with context %} -{%- macro generate_buffer_pool_and_profiles() %} - "BUFFER_POOL": { - "ingress_lossless_pool": { - {%- if dynamic_mode is not defined %} - "size": "{{ ingress_lossless_pool_size }}", - {%- endif %} - "type": "ingress", - "mode": "dynamic" - }, - "ingress_lossy_pool": { - {%- if dynamic_mode is not defined %} - "size": "{{ ingress_lossy_pool_size }}", - {%- endif %} - "type": "ingress", - "mode": "dynamic" - }, - "egress_lossless_pool": { - "size": "{{ egress_lossless_pool_size }}", - "type": "egress", - "mode": "dynamic" - }, - "egress_lossy_pool": { - {%- if dynamic_mode is not defined %} - "size": "{{ egress_lossy_pool_size }}", - {%- endif %} - "type": "egress", - "mode": "dynamic" - } - }, - "BUFFER_PROFILE": { - "ingress_lossless_profile": { - "pool":"[BUFFER_POOL|ingress_lossless_pool]", - "size":"0", - "dynamic_th":"7" - }, - "ingress_lossy_profile": { - "pool":"[BUFFER_POOL|ingress_lossy_pool]", - "size":"0", - "dynamic_th":"3" - }, - "egress_lossless_profile": { - "pool":"[BUFFER_POOL|egress_lossless_pool]", - "size":"0", - "dynamic_th":"7" - }, - "egress_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"9216", - "dynamic_th":"7" - }, - "q_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"0", - "dynamic_th":"3" - } - }, +{%- macro generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) %} +{{ defs.generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) }} {%- endmacro %} -{%- macro generate_profile_lists(port_names) %} - "BUFFER_PORT_INGRESS_PROFILE_LIST": { -{% for port in port_names.split(',') %} - "{{ port }}": { - "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" - }{% if not loop.last %},{% endif %} - -{% endfor %} - }, - "BUFFER_PORT_EGRESS_PROFILE_LIST": { -{% for port in port_names.split(',') %} - "{{ port }}": { - "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" - }{% if not loop.last %},{% endif %} - -{% endfor %} - } +{%- macro generate_profile_lists_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_profile_lists(port_names_active, port_names_inactive) }} {%- endmacro %} -{%- macro generate_queue_buffers(port_names) %} - "BUFFER_QUEUE": { -{% for port in port_names.split(',') %} - "{{ port }}|3-4": { - "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" - }, -{% endfor %} -{% for port in port_names.split(',') %} - "{{ port }}|0-2": { - "profile" : "[BUFFER_PROFILE|q_lossy_profile]" - }, -{% endfor %} -{% for port in port_names.split(',') %} - "{{ port }}|5-6": { - "profile" : "[BUFFER_PROFILE|q_lossy_profile]" - }{% if not loop.last %},{% endif %} +{%- macro generate_queue_buffers_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_queue_buffers(port_names_active, port_names_inactive) }} +{%- endmacro %} -{% endfor %} - } +{%- macro generate_pg_profiles_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_pg_profiles(port_names_active, port_names_inactive) }} {%- endmacro %} diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/ACS-MSN3800/sai.profile b/device/mellanox/x86_64-mlnx_msn3800-r0/ACS-MSN3800/sai.profile index 367f6c4e99c0..9c74ce166084 100644 --- a/device/mellanox/x86_64-mlnx_msn3800-r0/ACS-MSN3800/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/ACS-MSN3800/sai.profile @@ -1 +1,3 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_3800.xml +SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps +SAI_DUMP_STORE_AMOUNT=10 diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-C64/buffers_defaults_objects.j2 b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-C64/buffers_defaults_objects.j2 new file mode 120000 index 000000000000..c01aebb7ae12 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-C64/buffers_defaults_objects.j2 @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/buffers_defaults_objects.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-C64/buffers_defaults_t0.j2 b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-C64/buffers_defaults_t0.j2 index 2bc09d9ccc83..8c653b1049f4 100644 --- a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-C64/buffers_defaults_t0.j2 +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-C64/buffers_defaults_t0.j2 @@ -1,102 +1,23 @@ {% set default_cable = '5m' %} -{% set ingress_lossless_pool_size = '23343104' %} +{% set ingress_lossless_pool_size = '25866240' %} +{% set ingress_lossless_pool_xoff = '2523136' %} {% set egress_lossless_pool_size = '34287552' %} -{% set egress_lossy_pool_size = '23343104' %} +{% set egress_lossy_pool_size = '25866240' %} -{%- macro generate_port_lists(PORT_ALL) %} - {# Generate list of ports #} - {%- for port_idx in range(0, 32) %} - {%- if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{%- endif %} - {%- endfor %} -{%- endmacro %} +{% import 'buffers_defaults_objects.j2' as defs with context %} -{%- macro generate_buffer_pool_and_profiles() %} - "BUFFER_POOL": { - "ingress_lossless_pool": { - {%- if dynamic_mode is not defined %} - "size": "{{ ingress_lossless_pool_size }}", - {%- endif %} - "type": "ingress", - "mode": "dynamic" - }, - "egress_lossless_pool": { - "size": "{{ egress_lossless_pool_size }}", - "type": "egress", - "mode": "dynamic" - }, - "egress_lossy_pool": { - {%- if dynamic_mode is not defined %} - "size": "{{ egress_lossy_pool_size }}", - {%- endif %} - "type": "egress", - "mode": "dynamic" - } - }, - "BUFFER_PROFILE": { - "ingress_lossless_profile": { - "pool":"[BUFFER_POOL|ingress_lossless_pool]", - "size":"0", - "dynamic_th":"7" - }, - "ingress_lossy_profile": { - "pool":"[BUFFER_POOL|ingress_lossless_pool]", - "size":"0", - "dynamic_th":"3" - }, - "egress_lossless_profile": { - "pool":"[BUFFER_POOL|egress_lossless_pool]", - "size":"0", - "dynamic_th":"7" - }, - "egress_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"9216", - "dynamic_th":"7" - }, - "q_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"0", - "dynamic_th":"3" - } - }, +{%- macro generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) %} +{{ defs.generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) }} {%- endmacro %} -{%- macro generate_profile_lists(port_names) %} - "BUFFER_PORT_INGRESS_PROFILE_LIST": { -{% for port in port_names.split(',') %} - "{{ port }}": { - "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" - }{% if not loop.last %},{% endif %} - -{% endfor %} - }, - "BUFFER_PORT_EGRESS_PROFILE_LIST": { -{% for port in port_names.split(',') %} - "{{ port }}": { - "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" - }{% if not loop.last %},{% endif %} - -{% endfor %} - } +{%- macro generate_profile_lists_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_profile_lists(port_names_active, port_names_inactive) }} {%- endmacro %} -{%- macro generate_queue_buffers(port_names) %} - "BUFFER_QUEUE": { -{% for port in port_names.split(',') %} - "{{ port }}|3-4": { - "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" - }, -{% endfor %} -{% for port in port_names.split(',') %} - "{{ port }}|0-2": { - "profile" : "[BUFFER_PROFILE|q_lossy_profile]" - }, -{% endfor %} -{% for port in port_names.split(',') %} - "{{ port }}|5-6": { - "profile" : "[BUFFER_PROFILE|q_lossy_profile]" - }{% if not loop.last %},{% endif %} +{%- macro generate_queue_buffers_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_queue_buffers(port_names_active, port_names_inactive) }} +{%- endmacro %} -{% endfor %} - } +{%- macro generate_pg_profiles_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_pg_profiles(port_names_active, port_names_inactive) }} {%- endmacro %} diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-C64/buffers_defaults_t1.j2 b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-C64/buffers_defaults_t1.j2 index 531f1587ba7a..23785ac7be18 100644 --- a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-C64/buffers_defaults_t1.j2 +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-C64/buffers_defaults_t1.j2 @@ -1,102 +1,23 @@ {% set default_cable = '5m' %} -{% set ingress_lossless_pool_size = '19410944' %} +{% set ingress_lossless_pool_size = '24219648' %} +{% set ingress_lossless_pool_xoff = '4169728' %} {% set egress_lossless_pool_size = '34287552' %} -{% set egress_lossy_pool_size = '19410944' %} +{% set egress_lossy_pool_size = '24219648' %} -{%- macro generate_port_lists(PORT_ALL) %} - {# Generate list of ports #} - {%- for port_idx in range(0, 32) %} - {%- if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{%- endif %} - {%- endfor %} -{%- endmacro %} +{% import 'buffers_defaults_objects.j2' as defs with context %} -{%- macro generate_buffer_pool_and_profiles() %} - "BUFFER_POOL": { - "ingress_lossless_pool": { - {%- if dynamic_mode is not defined %} - "size": "{{ ingress_lossless_pool_size }}", - {%- endif %} - "type": "ingress", - "mode": "dynamic" - }, - "egress_lossless_pool": { - "size": "{{ egress_lossless_pool_size }}", - "type": "egress", - "mode": "dynamic" - }, - "egress_lossy_pool": { - {%- if dynamic_mode is not defined %} - "size": "{{ egress_lossy_pool_size }}", - {%- endif %} - "type": "egress", - "mode": "dynamic" - } - }, - "BUFFER_PROFILE": { - "ingress_lossless_profile": { - "pool":"[BUFFER_POOL|ingress_lossless_pool]", - "size":"0", - "dynamic_th":"7" - }, - "ingress_lossy_profile": { - "pool":"[BUFFER_POOL|ingress_lossless_pool]", - "size":"0", - "dynamic_th":"3" - }, - "egress_lossless_profile": { - "pool":"[BUFFER_POOL|egress_lossless_pool]", - "size":"0", - "dynamic_th":"7" - }, - "egress_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"9216", - "dynamic_th":"7" - }, - "q_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"0", - "dynamic_th":"3" - } - }, +{%- macro generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) %} +{{ defs.generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) }} {%- endmacro %} -{%- macro generate_profile_lists(port_names) %} - "BUFFER_PORT_INGRESS_PROFILE_LIST": { -{% for port in port_names.split(',') %} - "{{ port }}": { - "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" - }{% if not loop.last %},{% endif %} - -{% endfor %} - }, - "BUFFER_PORT_EGRESS_PROFILE_LIST": { -{% for port in port_names.split(',') %} - "{{ port }}": { - "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" - }{% if not loop.last %},{% endif %} - -{% endfor %} - } +{%- macro generate_profile_lists_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_profile_lists(port_names_active, port_names_inactive) }} {%- endmacro %} -{%- macro generate_queue_buffers(port_names) %} - "BUFFER_QUEUE": { -{% for port in port_names.split(',') %} - "{{ port }}|3-4": { - "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" - }, -{% endfor %} -{% for port in port_names.split(',') %} - "{{ port }}|0-2": { - "profile" : "[BUFFER_PROFILE|q_lossy_profile]" - }, -{% endfor %} -{% for port in port_names.split(',') %} - "{{ port }}|5-6": { - "profile" : "[BUFFER_PROFILE|q_lossy_profile]" - }{% if not loop.last %},{% endif %} +{%- macro generate_queue_buffers_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_queue_buffers(port_names_active, port_names_inactive) }} +{%- endmacro %} -{% endfor %} - } +{%- macro generate_pg_profiles_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_pg_profiles(port_names_active, port_names_inactive) }} {%- endmacro %} diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-C64/sai.profile b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-C64/sai.profile deleted file mode 120000 index f6fb0ccbfc97..000000000000 --- a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-C64/sai.profile +++ /dev/null @@ -1 +0,0 @@ -../ACS-MSN3800/sai.profile \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-C64/sai.profile b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-C64/sai.profile new file mode 100644 index 000000000000..35d3ce25a43a --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-C64/sai.profile @@ -0,0 +1,4 @@ +SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_3800.xml +SAI_VXLAN_SRCPORT_RANGE_ENABLE=1 +SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps +SAI_DUMP_STORE_AMOUNT=10 diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D100C12S2/buffers.json.j2 b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D100C12S2/buffers.json.j2 new file mode 120000 index 000000000000..add8bf8bb7c2 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D100C12S2/buffers.json.j2 @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/ACS-MSN2700/buffers.json.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D100C12S2/buffers_defaults_objects.j2 b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D100C12S2/buffers_defaults_objects.j2 new file mode 120000 index 000000000000..c01aebb7ae12 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D100C12S2/buffers_defaults_objects.j2 @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/buffers_defaults_objects.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D100C12S2/buffers_defaults_t0.j2 b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D100C12S2/buffers_defaults_t0.j2 new file mode 100644 index 000000000000..4a518e23c549 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D100C12S2/buffers_defaults_t0.j2 @@ -0,0 +1,23 @@ +{% set default_cable = '5m' %} +{% set ingress_lossless_pool_size = '20664320' %} +{% set ingress_lossless_pool_xoff = '3321856' %} +{% set egress_lossless_pool_size = '34287552' %} +{% set egress_lossy_pool_size = '20664320' %} + +{% import 'buffers_defaults_objects.j2' as defs with context %} + +{%- macro generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) %} +{{ defs.generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_profile_lists_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_profile_lists(port_names_active, port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_queue_buffers_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_queue_buffers(port_names_active, port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_pg_profiles_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_pg_profiles(port_names_active, port_names_inactive) }} +{%- endmacro %} diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D100C12S2/buffers_defaults_t1.j2 b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D100C12S2/buffers_defaults_t1.j2 new file mode 100644 index 000000000000..75ee727ed400 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D100C12S2/buffers_defaults_t1.j2 @@ -0,0 +1,23 @@ +{% set default_cable = '5m' %} +{% set ingress_lossless_pool_size = '19601408' %} +{% set ingress_lossless_pool_xoff = '4384768' %} +{% set egress_lossless_pool_size = '34287552' %} +{% set egress_lossy_pool_size = '19601408' %} + +{% import 'buffers_defaults_objects.j2' as defs with context %} + +{%- macro generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) %} +{{ defs.generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_profile_lists_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_profile_lists(port_names_active, port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_queue_buffers_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_queue_buffers(port_names_active, port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_pg_profiles_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_pg_profiles(port_names_active, port_names_inactive) }} +{%- endmacro %} diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D100C12S2/buffers_dynamic.json.j2 b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D100C12S2/buffers_dynamic.json.j2 new file mode 120000 index 000000000000..8c4117c66214 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D100C12S2/buffers_dynamic.json.j2 @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/ACS-MSN2700/buffers_dynamic.json.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D100C12S2/pg_profile_lookup.ini b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D100C12S2/pg_profile_lookup.ini new file mode 120000 index 000000000000..ccbbfa44cd9c --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D100C12S2/pg_profile_lookup.ini @@ -0,0 +1 @@ +../Mellanox-SN3800-D112C8/pg_profile_lookup.ini \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D100C12S2/port_config.ini b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D100C12S2/port_config.ini new file mode 100644 index 000000000000..535556ebfb3b --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D100C12S2/port_config.ini @@ -0,0 +1,115 @@ +# name lanes alias index speed +Ethernet0 0,1 etp1a 1 50000 +Ethernet2 2,3 etp1b 1 50000 +Ethernet4 4,5 etp2a 2 50000 +Ethernet6 6,7 etp2b 2 50000 +Ethernet8 8,9 etp3a 3 50000 +Ethernet10 10,11 etp3b 3 50000 +Ethernet12 12,13 etp4a 4 50000 +Ethernet14 14,15 etp4b 4 50000 +Ethernet16 16,17 etp5a 5 50000 +Ethernet18 18,19 etp5b 5 50000 +Ethernet20 20,21 etp6a 6 50000 +Ethernet22 22,23 etp6b 6 50000 +Ethernet24 24,25 etp7a 7 50000 +Ethernet26 26,27 etp7b 7 50000 +Ethernet28 28,29 etp8a 8 50000 +Ethernet30 30,31 etp8b 8 50000 +Ethernet32 32,33 etp9a 9 50000 +Ethernet34 34,35 etp9b 9 50000 +Ethernet36 36,37 etp10a 10 50000 +Ethernet38 38,39 etp10b 10 50000 +Ethernet40 40,41 etp11a 11 50000 +Ethernet42 42,43 etp11b 11 50000 +Ethernet44 44,45 etp12a 12 50000 +Ethernet46 46,47 etp12b 12 50000 +Ethernet48 48,49 etp13a 13 50000 +Ethernet50 50,51 etp13b 13 50000 +Ethernet52 52,53 etp14a 14 50000 +Ethernet54 54,55 etp14b 14 50000 +Ethernet56 56,57 etp15a 15 50000 +Ethernet58 58,59 etp15b 15 50000 +Ethernet60 60,61 etp16a 16 50000 +Ethernet62 62,63 etp16b 16 50000 +Ethernet64 64,65 etp17a 17 50000 +Ethernet66 66,67 etp17b 17 50000 +Ethernet68 68,69 etp18a 18 50000 +Ethernet70 70,71 etp18b 18 50000 +Ethernet72 72,73 etp19a 19 50000 +Ethernet74 74,75 etp19b 19 50000 +Ethernet76 76,77 etp20a 20 50000 +Ethernet78 78,79 etp20b 20 50000 +Ethernet80 80,81 etp21a 21 50000 +Ethernet82 82,83 etp21b 21 50000 +Ethernet84 84,85 etp22a 22 50000 +Ethernet86 86,87 etp22b 22 50000 +Ethernet88 88,89 etp23a 23 50000 +Ethernet90 90,91 etp23b 23 50000 +Ethernet92 92,93 etp24a 24 50000 +Ethernet94 94,95 etp24b 24 50000 +Ethernet96 96,97 etp25a 25 50000 +Ethernet98 98,99 etp25b 25 50000 +Ethernet100 100,101 etp26a 26 50000 +Ethernet102 102,103 etp26b 26 50000 +Ethernet104 104,105 etp27a 27 50000 +Ethernet106 106,107 etp27b 27 50000 +Ethernet108 108,109 etp28a 28 50000 +Ethernet110 110,111 etp28b 28 50000 +Ethernet112 112,113 etp29a 29 50000 +Ethernet114 114,115 etp29b 29 50000 +Ethernet116 116,117 etp30a 30 50000 +Ethernet118 118,119 etp30b 30 50000 +Ethernet120 120,121 etp31a 31 50000 +Ethernet122 122,123 etp31b 31 50000 +Ethernet124 124,125 etp32a 32 50000 +Ethernet126 126,127 etp32b 32 50000 +Ethernet128 128,129 etp33a 33 50000 +Ethernet130 130,131 etp33b 33 50000 +Ethernet132 132,133 etp34a 34 50000 +Ethernet134 134,135 etp34b 34 50000 +Ethernet136 136,137 etp35a 35 50000 +Ethernet138 138,139 etp35b 35 50000 +Ethernet140 140,141 etp36a 36 50000 +Ethernet142 142,143 etp36b 36 50000 +Ethernet144 144,145 etp37a 37 50000 +Ethernet146 146,147 etp37b 37 50000 +Ethernet148 148,149,150,151 etp38 38 10000 +Ethernet152 152,153 etp39a 39 50000 +Ethernet154 154,155 etp39b 39 50000 +Ethernet156 156,157,158,159 etp40 40 10000 +Ethernet160 160,161 etp41a 41 50000 +Ethernet162 162,163 etp41b 41 50000 +Ethernet164 164,165 etp42a 42 50000 +Ethernet166 166,167 etp42b 42 50000 +Ethernet168 168,169 etp43a 43 50000 +Ethernet170 170,171 etp43b 43 50000 +Ethernet172 172,173 etp44a 44 50000 +Ethernet174 174,175 etp44b 44 50000 +Ethernet176 176,177 etp45a 45 50000 +Ethernet178 178,179 etp45b 45 50000 +Ethernet180 180,181 etp46a 46 50000 +Ethernet182 182,183 etp46b 46 50000 +Ethernet184 184,185 etp47a 47 50000 +Ethernet186 186,187 etp47b 47 50000 +Ethernet188 188,189 etp48a 48 50000 +Ethernet190 190,191 etp48b 48 50000 +Ethernet192 192,193 etp49a 49 50000 +Ethernet194 194,195 etp49b 49 50000 +Ethernet196 196,197 etp50a 50 50000 +Ethernet198 198,199 etp50b 50 50000 +Ethernet200 200,201 etp51a 51 50000 +Ethernet202 202,203 etp51b 51 50000 +Ethernet204 204,205 etp52a 52 50000 +Ethernet206 206,207 etp52b 52 50000 +Ethernet208 208,209,210,211 etp53 53 100000 +Ethernet212 212,213,214,215 etp54 54 100000 +Ethernet216 216,217,218,219 etp55 55 100000 +Ethernet220 220,221,222,223 etp56 56 100000 +Ethernet224 224,225,226,227 etp57 57 100000 +Ethernet228 228,229,230,231 etp58 58 100000 +Ethernet232 232,233,234,235 etp59 59 100000 +Ethernet236 236,237,238,239 etp60 60 100000 +Ethernet240 240,241,242,243 etp61 61 100000 +Ethernet244 244,245,246,247 etp62 62 100000 +Ethernet248 248,249,250,251 etp63 63 100000 +Ethernet252 252,253,254,255 etp64 64 100000 diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D100C12S2/qos.json.j2 b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D100C12S2/qos.json.j2 new file mode 120000 index 000000000000..eccf286dc879 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D100C12S2/qos.json.j2 @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/ACS-MSN2700/qos.json.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D100C12S2/sai.profile b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D100C12S2/sai.profile new file mode 100644 index 000000000000..5543225b55f5 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D100C12S2/sai.profile @@ -0,0 +1,2 @@ +SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_3800_2x10g_100x50g_12x100g.xml +SAI_VXLAN_SRCPORT_RANGE_ENABLE=1 diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D100C12S2/sai_3800_2x10g_100x50g_12x100g.xml b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D100C12S2/sai_3800_2x10g_100x50g_12x100g.xml new file mode 100644 index 000000000000..bf0fa4ca6909 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D100C12S2/sai_3800_2x10g_100x50g_12x100g.xml @@ -0,0 +1,521 @@ + + + + + + 00:02:03:04:05:00 + + + 1 + + + 64 + + + + + 1 + 4 + 48 + + + 3 + + + 384 + 2 + + + 3 + 4 + 49 + 1 + 384 + 2 + + + 5 + 4 + 50 + 3 + 384 + 2 + + + 7 + 4 + 51 + 1 + 384 + 2 + + + 9 + 4 + 52 + 3 + 384 + 2 + + + 11 + 4 + 53 + 1 + 384 + 2 + + + 13 + 4 + 54 + 3 + 384 + 2 + + + 15 + 4 + 55 + 1 + 384 + 2 + + + 17 + 4 + 56 + 3 + 384 + 2 + + + 19 + 4 + 57 + 1 + 384 + 2 + + + 21 + 4 + 58 + 3 + 384 + 2 + + + 23 + 4 + 59 + 1 + 384 + 2 + + + 25 + 4 + 60 + 3 + 384 + 2 + + + 27 + 4 + 61 + 1 + 384 + 2 + + + 29 + 4 + 62 + 3 + 384 + 2 + + + 31 + 4 + 63 + 1 + 384 + 2 + + + 33 + 4 + 12 + 3 + 384 + 2 + + + 35 + 4 + 13 + 1 + 384 + 2 + + + 37 + 4 + 14 + 3 + 384 + 2 + + + 39 + 4 + 15 + 1 + 384 + 2 + + + 41 + 4 + 8 + 3 + 384 + 2 + + + 43 + 4 + 9 + 1 + 384 + 2 + + + 45 + 4 + 10 + 3 + 384 + 2 + + + 47 + 4 + 11 + 1 + 384 + 2 + + + 49 + 4 + 4 + 3 + 384 + 2 + + + 51 + 4 + 5 + 1 + 384 + 2 + + + 53 + 4 + 6 + 3 + 384 + 2 + + + 55 + 4 + 7 + 1 + 384 + 2 + + + 57 + 4 + 0 + 3 + 384 + 2 + + + 59 + 4 + 1 + 1 + 384 + 2 + + + 61 + 4 + 2 + 3 + 384 + 2 + + + 63 + 4 + 3 + 1 + 384 + 2 + + + 65 + 4 + 44 + 3 + 384 + 2 + + + 67 + 4 + 45 + 1 + 384 + 2 + + + 69 + 4 + 46 + 3 + 384 + 2 + + + 71 + 4 + 47 + 1 + 384 + 2 + + + 73 + 4 + 40 + 3 + 384 + 2 + + + 75 + 4 + 41 + 1 + 16 + + + 77 + 4 + 42 + 3 + 384 + 2 + + + 79 + 4 + 43 + 1 + 16 + + + 81 + 4 + 36 + 3 + 384 + 2 + + + 83 + 4 + 37 + 1 + 384 + 2 + + + 85 + 4 + 38 + 3 + 384 + 2 + + + 87 + 4 + 39 + 1 + 384 + 2 + + + 89 + 4 + 32 + 3 + 384 + 2 + + + 91 + 4 + 33 + 1 + 384 + 2 + + + 93 + 4 + 34 + 3 + 384 + 2 + + + 95 + 4 + 35 + 1 + 384 + 2 + + + 97 + 4 + 16 + 3 + 384 + 2 + + + 99 + 4 + 17 + 1 + 384 + 2 + + + 101 + 4 + 18 + 3 + 384 + 2 + + + 103 + 4 + 19 + 1 + 384 + 2 + + + 105 + 4 + 20 + 3 + 1536 + + + 107 + 4 + 21 + 1 + 1536 + + + 109 + 4 + 22 + 3 + 1536 + + + 111 + 4 + 23 + 1 + 1536 + + + 113 + 4 + 24 + 3 + 1536 + + + 115 + 4 + 25 + 1 + 1536 + + + 117 + 4 + 26 + 3 + 1536 + + + 119 + 4 + 27 + 1 + 1536 + + + 121 + 4 + 28 + 3 + 1536 + + + 123 + 4 + 29 + 1 + 1536 + + + 125 + 4 + 30 + 3 + 1536 + + + 127 + 4 + 31 + 1 + 1536 + + + + + diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D112C8/buffers_defaults_objects.j2 b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D112C8/buffers_defaults_objects.j2 new file mode 120000 index 000000000000..c01aebb7ae12 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D112C8/buffers_defaults_objects.j2 @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/buffers_defaults_objects.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D112C8/buffers_defaults_t0.j2 b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D112C8/buffers_defaults_t0.j2 index 26e89cf269ff..afc9abab17c4 100644 --- a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D112C8/buffers_defaults_t0.j2 +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D112C8/buffers_defaults_t0.j2 @@ -1,102 +1,23 @@ {% set default_cable = '5m' %} -{% set ingress_lossless_pool_size = '16576512' %} +{% set ingress_lossless_pool_size = '20017152' %} +{% set ingress_lossless_pool_xoff = '3440640' %} {% set egress_lossless_pool_size = '34287552' %} -{% set egress_lossy_pool_size = '16576512' %} +{% set egress_lossy_pool_size = '20017152' %} -{%- macro generate_port_lists(PORT_ALL) %} - {# Generate list of ports #} - {%- for port_idx in range(0, 32) %} - {%- if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{%- endif %} - {%- endfor %} -{%- endmacro %} +{% import 'buffers_defaults_objects.j2' as defs with context %} -{%- macro generate_buffer_pool_and_profiles() %} - "BUFFER_POOL": { - "ingress_lossless_pool": { - {%- if dynamic_mode is not defined %} - "size": "{{ ingress_lossless_pool_size }}", - {%- endif %} - "type": "ingress", - "mode": "dynamic" - }, - "egress_lossless_pool": { - "size": "{{ egress_lossless_pool_size }}", - "type": "egress", - "mode": "dynamic" - }, - "egress_lossy_pool": { - {%- if dynamic_mode is not defined %} - "size": "{{ egress_lossy_pool_size }}", - {%- endif %} - "type": "egress", - "mode": "dynamic" - } - }, - "BUFFER_PROFILE": { - "ingress_lossless_profile": { - "pool":"[BUFFER_POOL|ingress_lossless_pool]", - "size":"0", - "dynamic_th":"7" - }, - "ingress_lossy_profile": { - "pool":"[BUFFER_POOL|ingress_lossless_pool]", - "size":"0", - "dynamic_th":"3" - }, - "egress_lossless_profile": { - "pool":"[BUFFER_POOL|egress_lossless_pool]", - "size":"0", - "dynamic_th":"7" - }, - "egress_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"9216", - "dynamic_th":"7" - }, - "q_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"0", - "dynamic_th":"3" - } - }, +{%- macro generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) %} +{{ defs.generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) }} {%- endmacro %} -{%- macro generate_profile_lists(port_names) %} - "BUFFER_PORT_INGRESS_PROFILE_LIST": { -{% for port in port_names.split(',') %} - "{{ port }}": { - "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" - }{% if not loop.last %},{% endif %} - -{% endfor %} - }, - "BUFFER_PORT_EGRESS_PROFILE_LIST": { -{% for port in port_names.split(',') %} - "{{ port }}": { - "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" - }{% if not loop.last %},{% endif %} - -{% endfor %} - } +{%- macro generate_profile_lists_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_profile_lists(port_names_active, port_names_inactive) }} {%- endmacro %} -{%- macro generate_queue_buffers(port_names) %} - "BUFFER_QUEUE": { -{% for port in port_names.split(',') %} - "{{ port }}|3-4": { - "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" - }, -{% endfor %} -{% for port in port_names.split(',') %} - "{{ port }}|0-2": { - "profile" : "[BUFFER_PROFILE|q_lossy_profile]" - }, -{% endfor %} -{% for port in port_names.split(',') %} - "{{ port }}|5-6": { - "profile" : "[BUFFER_PROFILE|q_lossy_profile]" - }{% if not loop.last %},{% endif %} +{%- macro generate_queue_buffers_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_queue_buffers(port_names_active, port_names_inactive) }} +{%- endmacro %} -{% endfor %} - } +{%- macro generate_pg_profiles_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_pg_profiles(port_names_active, port_names_inactive) }} {%- endmacro %} diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D112C8/buffers_defaults_t1.j2 b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D112C8/buffers_defaults_t1.j2 index 31fd4c7692dd..6549b5532280 100644 --- a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D112C8/buffers_defaults_t1.j2 +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D112C8/buffers_defaults_t1.j2 @@ -1,102 +1,23 @@ {% set default_cable = '5m' %} -{% set ingress_lossless_pool_size = '14790656' %} +{% set ingress_lossless_pool_size = '19124224' %} +{% set ingress_lossless_pool_xoff = '4333568' %} {% set egress_lossless_pool_size = '34287552' %} -{% set egress_lossy_pool_size = '14790656' %} +{% set egress_lossy_pool_size = '19124224' %} -{%- macro generate_port_lists(PORT_ALL) %} - {# Generate list of ports #} - {%- for port_idx in range(0, 32) %} - {%- if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{%- endif %} - {%- endfor %} -{%- endmacro %} +{% import 'buffers_defaults_objects.j2' as defs with context %} -{%- macro generate_buffer_pool_and_profiles() %} - "BUFFER_POOL": { - "ingress_lossless_pool": { - {%- if dynamic_mode is not defined %} - "size": "{{ ingress_lossless_pool_size }}", - {%- endif %} - "type": "ingress", - "mode": "dynamic" - }, - "egress_lossless_pool": { - "size": "{{ egress_lossless_pool_size }}", - "type": "egress", - "mode": "dynamic" - }, - "egress_lossy_pool": { - {%- if dynamic_mode is not defined %} - "size": "{{ egress_lossy_pool_size }}", - {%- endif %} - "type": "egress", - "mode": "dynamic" - } - }, - "BUFFER_PROFILE": { - "ingress_lossless_profile": { - "pool":"[BUFFER_POOL|ingress_lossless_pool]", - "size":"0", - "dynamic_th":"7" - }, - "ingress_lossy_profile": { - "pool":"[BUFFER_POOL|ingress_lossless_pool]", - "size":"0", - "dynamic_th":"3" - }, - "egress_lossless_profile": { - "pool":"[BUFFER_POOL|egress_lossless_pool]", - "size":"0", - "dynamic_th":"7" - }, - "egress_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"9216", - "dynamic_th":"7" - }, - "q_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"0", - "dynamic_th":"3" - } - }, +{%- macro generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) %} +{{ defs.generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) }} {%- endmacro %} -{%- macro generate_profile_lists(port_names) %} - "BUFFER_PORT_INGRESS_PROFILE_LIST": { -{% for port in port_names.split(',') %} - "{{ port }}": { - "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" - }{% if not loop.last %},{% endif %} - -{% endfor %} - }, - "BUFFER_PORT_EGRESS_PROFILE_LIST": { -{% for port in port_names.split(',') %} - "{{ port }}": { - "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" - }{% if not loop.last %},{% endif %} - -{% endfor %} - } +{%- macro generate_profile_lists_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_profile_lists(port_names_active, port_names_inactive) }} {%- endmacro %} -{%- macro generate_queue_buffers(port_names) %} - "BUFFER_QUEUE": { -{% for port in port_names.split(',') %} - "{{ port }}|3-4": { - "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" - }, -{% endfor %} -{% for port in port_names.split(',') %} - "{{ port }}|0-2": { - "profile" : "[BUFFER_PROFILE|q_lossy_profile]" - }, -{% endfor %} -{% for port in port_names.split(',') %} - "{{ port }}|5-6": { - "profile" : "[BUFFER_PROFILE|q_lossy_profile]" - }{% if not loop.last %},{% endif %} +{%- macro generate_queue_buffers_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_queue_buffers(port_names_active, port_names_inactive) }} +{%- endmacro %} -{% endfor %} - } +{%- macro generate_pg_profiles_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_pg_profiles(port_names_active, port_names_inactive) }} {%- endmacro %} diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D112C8/pg_profile_lookup.ini b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D112C8/pg_profile_lookup.ini index ea772d0823a1..fd98cbe468bc 100644 --- a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D112C8/pg_profile_lookup.ini +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D112C8/pg_profile_lookup.ini @@ -1,17 +1,22 @@ # PG lossless profiles. # speed cable size xon xoff threshold - 10000 5m 45056 19456 25600 0 - 25000 5m 48128 19456 28672 0 - 40000 5m 50176 19456 30720 0 - 50000 5m 52224 19456 32768 0 - 100000 5m 60416 19456 40960 0 - 10000 40m 46080 19456 26624 0 - 25000 40m 50176 19456 30720 0 - 40000 40m 53248 19456 33792 0 - 50000 40m 56320 19456 36864 0 - 100000 40m 67584 19456 48128 0 - 10000 300m 51200 19456 31744 0 - 25000 300m 63488 19456 44032 0 - 40000 300m 74752 19456 55296 0 - 50000 300m 82944 19456 63488 0 - 100000 300m 121856 19456 102400 0 + 10000 5m 19456 19456 25600 0 + 25000 5m 19456 19456 28672 0 + 40000 5m 19456 19456 30720 0 + 50000 5m 19456 19456 32768 0 + 100000 5m 19456 19456 40960 0 + 10000 40m 19456 19456 26624 0 + 25000 40m 19456 19456 30720 0 + 40000 40m 19456 19456 33792 0 + 50000 40m 19456 19456 36864 0 + 100000 40m 19456 19456 48128 0 + 10000 300m 19456 19456 31744 0 + 25000 300m 19456 19456 44032 0 + 40000 300m 19456 19456 55296 0 + 50000 300m 19456 19456 63488 0 + 100000 300m 19456 19456 102400 0 + 10000 2000m 19456 19456 33792 0 + 25000 2000m 19456 19456 65536 0 + 40000 2000m 19456 19456 97280 0 + 50000 2000m 19456 19456 118784 0 + 100000 2000m 19456 19456 225280 0 diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D112C8/sai.profile b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D112C8/sai.profile index c5bb0c90f3d7..8e672b95e232 100644 --- a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D112C8/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D112C8/sai.profile @@ -1 +1,4 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_3800_112x50g_8x100g.xml +SAI_VXLAN_SRCPORT_RANGE_ENABLE=1 +SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps +SAI_DUMP_STORE_AMOUNT=10 diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D112C8/sai_3800_112x50g_8x100g.xml b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D112C8/sai_3800_112x50g_8x100g.xml index a72edb85633d..5bf9be0751b7 100644 --- a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D112C8/sai_3800_112x50g_8x100g.xml +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D112C8/sai_3800_112x50g_8x100g.xml @@ -46,6 +46,7 @@ 4 51 3 + 2 384 @@ -77,6 +78,7 @@ 4 55 3 + 2 384 @@ -108,6 +110,7 @@ 4 59 3 + 2 384 @@ -139,6 +142,7 @@ 4 63 3 + 2 384 @@ -170,6 +174,7 @@ 4 15 3 + 2 384 @@ -201,6 +206,7 @@ 4 11 3 + 2 384 @@ -232,6 +238,7 @@ 4 7 3 + 2 384 @@ -263,6 +270,7 @@ 4 3 3 + 2 384 @@ -294,6 +302,7 @@ 4 47 3 + 2 384 @@ -325,6 +334,7 @@ 4 43 3 + 2 384 @@ -354,6 +364,7 @@ 4 39 3 + 2 384 @@ -383,6 +394,7 @@ 4 35 3 + 2 384 @@ -414,6 +426,7 @@ 4 19 3 + 2 384 @@ -445,6 +458,7 @@ 4 23 3 + 2 384 @@ -474,6 +488,7 @@ 4 27 3 + 2 384 @@ -503,8 +518,9 @@ 4 31 3 + 2 384 - + \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D24C52/buffers_defaults_objects.j2 b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D24C52/buffers_defaults_objects.j2 new file mode 120000 index 000000000000..c01aebb7ae12 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D24C52/buffers_defaults_objects.j2 @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/buffers_defaults_objects.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D24C52/buffers_defaults_t0.j2 b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D24C52/buffers_defaults_t0.j2 index edccf5e652bc..92f65d0459c4 100644 --- a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D24C52/buffers_defaults_t0.j2 +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D24C52/buffers_defaults_t0.j2 @@ -1,102 +1,23 @@ {% set default_cable = '5m' %} -{% set ingress_lossless_pool_size = '21819392' %} +{% set ingress_lossless_pool_size = '24576000' %} +{% set ingress_lossless_pool_xoff = '2756608' %} {% set egress_lossless_pool_size = '34287552' %} -{% set egress_lossy_pool_size = '21819392' %} +{% set egress_lossy_pool_size = '24576000' %} -{%- macro generate_port_lists(PORT_ALL) %} - {# Generate list of ports #} - {%- for port_idx in range(0, 32) %} - {%- if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{%- endif %} - {%- endfor %} -{%- endmacro %} +{% import 'buffers_defaults_objects.j2' as defs with context %} -{%- macro generate_buffer_pool_and_profiles() %} - "BUFFER_POOL": { - "ingress_lossless_pool": { - {%- if dynamic_mode is not defined %} - "size": "{{ ingress_lossless_pool_size }}", - {%- endif %} - "type": "ingress", - "mode": "dynamic" - }, - "egress_lossless_pool": { - "size": "{{ egress_lossless_pool_size }}", - "type": "egress", - "mode": "dynamic" - }, - "egress_lossy_pool": { - {%- if dynamic_mode is not defined %} - "size": "{{ egress_lossy_pool_size }}", - {%- endif %} - "type": "egress", - "mode": "dynamic" - } - }, - "BUFFER_PROFILE": { - "ingress_lossless_profile": { - "pool":"[BUFFER_POOL|ingress_lossless_pool]", - "size":"0", - "dynamic_th":"7" - }, - "ingress_lossy_profile": { - "pool":"[BUFFER_POOL|ingress_lossless_pool]", - "size":"0", - "dynamic_th":"3" - }, - "egress_lossless_profile": { - "pool":"[BUFFER_POOL|egress_lossless_pool]", - "size":"0", - "dynamic_th":"7" - }, - "egress_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"9216", - "dynamic_th":"7" - }, - "q_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"0", - "dynamic_th":"3" - } - }, +{%- macro generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) %} +{{ defs.generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) }} {%- endmacro %} -{%- macro generate_profile_lists(port_names) %} - "BUFFER_PORT_INGRESS_PROFILE_LIST": { -{% for port in port_names.split(',') %} - "{{ port }}": { - "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" - }{% if not loop.last %},{% endif %} - -{% endfor %} - }, - "BUFFER_PORT_EGRESS_PROFILE_LIST": { -{% for port in port_names.split(',') %} - "{{ port }}": { - "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" - }{% if not loop.last %},{% endif %} - -{% endfor %} - } +{%- macro generate_profile_lists_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_profile_lists(port_names_active, port_names_inactive) }} {%- endmacro %} -{%- macro generate_queue_buffers(port_names) %} - "BUFFER_QUEUE": { -{% for port in port_names.split(',') %} - "{{ port }}|3-4": { - "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" - }, -{% endfor %} -{% for port in port_names.split(',') %} - "{{ port }}|0-2": { - "profile" : "[BUFFER_PROFILE|q_lossy_profile]" - }, -{% endfor %} -{% for port in port_names.split(',') %} - "{{ port }}|5-6": { - "profile" : "[BUFFER_PROFILE|q_lossy_profile]" - }{% if not loop.last %},{% endif %} +{%- macro generate_queue_buffers_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_queue_buffers(port_names_active, port_names_inactive) }} +{%- endmacro %} -{% endfor %} - } +{%- macro generate_pg_profiles_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_pg_profiles(port_names_active, port_names_inactive) }} {%- endmacro %} diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D24C52/buffers_defaults_t1.j2 b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D24C52/buffers_defaults_t1.j2 index 90f626db6a52..acd7f12824e1 100644 --- a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D24C52/buffers_defaults_t1.j2 +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D24C52/buffers_defaults_t1.j2 @@ -1,102 +1,23 @@ {% set default_cable = '5m' %} -{% set ingress_lossless_pool_size = '17862656' %} +{% set ingress_lossless_pool_size = '22597632' %} +{% set ingress_lossless_pool_xoff = '4734976' %} {% set egress_lossless_pool_size = '34287552' %} -{% set egress_lossy_pool_size = '17862656' %} +{% set egress_lossy_pool_size = '22597632' %} -{%- macro generate_port_lists(PORT_ALL) %} - {# Generate list of ports #} - {%- for port_idx in range(0, 32) %} - {%- if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{%- endif %} - {%- endfor %} -{%- endmacro %} +{% import 'buffers_defaults_objects.j2' as defs with context %} -{%- macro generate_buffer_pool_and_profiles() %} - "BUFFER_POOL": { - "ingress_lossless_pool": { - {%- if dynamic_mode is not defined %} - "size": "{{ ingress_lossless_pool_size }}", - {%- endif %} - "type": "ingress", - "mode": "dynamic" - }, - "egress_lossless_pool": { - "size": "{{ egress_lossless_pool_size }}", - "type": "egress", - "mode": "dynamic" - }, - "egress_lossy_pool": { - {%- if dynamic_mode is not defined %} - "size": "{{ egress_lossy_pool_size }}", - {%- endif %} - "type": "egress", - "mode": "dynamic" - } - }, - "BUFFER_PROFILE": { - "ingress_lossless_profile": { - "pool":"[BUFFER_POOL|ingress_lossless_pool]", - "size":"0", - "dynamic_th":"7" - }, - "ingress_lossy_profile": { - "pool":"[BUFFER_POOL|ingress_lossless_pool]", - "size":"0", - "dynamic_th":"3" - }, - "egress_lossless_profile": { - "pool":"[BUFFER_POOL|egress_lossless_pool]", - "size":"0", - "dynamic_th":"7" - }, - "egress_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"9216", - "dynamic_th":"7" - }, - "q_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"0", - "dynamic_th":"3" - } - }, +{%- macro generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) %} +{{ defs.generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) }} {%- endmacro %} -{%- macro generate_profile_lists(port_names) %} - "BUFFER_PORT_INGRESS_PROFILE_LIST": { -{% for port in port_names.split(',') %} - "{{ port }}": { - "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" - }{% if not loop.last %},{% endif %} - -{% endfor %} - }, - "BUFFER_PORT_EGRESS_PROFILE_LIST": { -{% for port in port_names.split(',') %} - "{{ port }}": { - "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" - }{% if not loop.last %},{% endif %} - -{% endfor %} - } +{%- macro generate_profile_lists_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_profile_lists(port_names_active, port_names_inactive) }} {%- endmacro %} -{%- macro generate_queue_buffers(port_names) %} - "BUFFER_QUEUE": { -{% for port in port_names.split(',') %} - "{{ port }}|3-4": { - "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" - }, -{% endfor %} -{% for port in port_names.split(',') %} - "{{ port }}|0-2": { - "profile" : "[BUFFER_PROFILE|q_lossy_profile]" - }, -{% endfor %} -{% for port in port_names.split(',') %} - "{{ port }}|5-6": { - "profile" : "[BUFFER_PROFILE|q_lossy_profile]" - }{% if not loop.last %},{% endif %} +{%- macro generate_queue_buffers_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_queue_buffers(port_names_active, port_names_inactive) }} +{%- endmacro %} -{% endfor %} - } +{%- macro generate_pg_profiles_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_pg_profiles(port_names_active, port_names_inactive) }} {%- endmacro %} diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D24C52/sai.profile b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D24C52/sai.profile index 7c632389b58c..6580208c68de 100644 --- a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D24C52/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D24C52/sai.profile @@ -1 +1,3 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_3800_24x50g_52x100g.xml +SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps +SAI_DUMP_STORE_AMOUNT=10 diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C49S1/buffers.json.j2 b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C49S1/buffers.json.j2 new file mode 120000 index 000000000000..dc17caa0aa32 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C49S1/buffers.json.j2 @@ -0,0 +1 @@ +../ACS-MSN3800/buffers.json.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C49S1/buffers_defaults_objects.j2 b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C49S1/buffers_defaults_objects.j2 new file mode 120000 index 000000000000..c01aebb7ae12 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C49S1/buffers_defaults_objects.j2 @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/buffers_defaults_objects.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C49S1/buffers_defaults_t0.j2 b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C49S1/buffers_defaults_t0.j2 new file mode 100644 index 000000000000..2c39cf1b059d --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C49S1/buffers_defaults_t0.j2 @@ -0,0 +1,23 @@ +{% set default_cable = '5m' %} +{% set ingress_lossless_pool_size = '24360960' %} +{% set ingress_lossless_pool_xoff = '2795520' %} +{% set egress_lossless_pool_size = '34287552' %} +{% set egress_lossy_pool_size = '24360960' %} + +{% import 'buffers_defaults_objects.j2' as defs with context %} + +{%- macro generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) %} +{{ defs.generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_profile_lists_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_profile_lists(port_names_active, port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_queue_buffers_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_queue_buffers(port_names_active, port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_pg_profiles_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_pg_profiles(port_names_active, port_names_inactive) }} +{%- endmacro %} diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C49S1/buffers_defaults_t1.j2 b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C49S1/buffers_defaults_t1.j2 new file mode 100644 index 000000000000..dae6bf287b4c --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C49S1/buffers_defaults_t1.j2 @@ -0,0 +1,23 @@ +{% set default_cable = '5m' %} +{% set ingress_lossless_pool_size = '22380544' %} +{% set ingress_lossless_pool_xoff = '4775936' %} +{% set egress_lossless_pool_size = '34287552' %} +{% set egress_lossy_pool_size = '22380544' %} + +{% import 'buffers_defaults_objects.j2' as defs with context %} + +{%- macro generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) %} +{{ defs.generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_profile_lists_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_profile_lists(port_names_active, port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_queue_buffers_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_queue_buffers(port_names_active, port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_pg_profiles_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_pg_profiles(port_names_active, port_names_inactive) }} +{%- endmacro %} diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C49S1/buffers_dynamic.json.j2 b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C49S1/buffers_dynamic.json.j2 new file mode 120000 index 000000000000..8c4117c66214 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C49S1/buffers_dynamic.json.j2 @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/ACS-MSN2700/buffers_dynamic.json.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C49S1/pg_profile_lookup.ini b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C49S1/pg_profile_lookup.ini new file mode 120000 index 000000000000..ccbbfa44cd9c --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C49S1/pg_profile_lookup.ini @@ -0,0 +1 @@ +../Mellanox-SN3800-D112C8/pg_profile_lookup.ini \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C49S1/port_config.ini b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C49S1/port_config.ini new file mode 100644 index 000000000000..5f9a4de25b96 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C49S1/port_config.ini @@ -0,0 +1,79 @@ +# name lanes alias index speed +Ethernet0 0,1,2,3 etp1 1 100000 +Ethernet4 4,5,6,7 etp2 2 100000 +Ethernet8 8,9,10,11 etp3 3 100000 +Ethernet12 12,13,14,15 etp4 4 100000 +Ethernet16 16,17,18,19 etp5 5 100000 +Ethernet20 20,21,22,23 etp6 6 100000 +Ethernet24 24,25,26,27 etp7 7 100000 +Ethernet28 28,29,30,31 etp8 8 100000 +Ethernet32 32,33 etp9a 9 50000 +Ethernet34 34,35 etp9b 9 50000 +Ethernet36 36,37 etp10a 10 50000 +Ethernet38 38,39 etp10b 10 50000 +Ethernet40 40,41 etp11a 11 50000 +Ethernet42 42,43 etp11b 11 50000 +Ethernet44 44,45 etp12a 12 50000 +Ethernet46 46,47 etp12b 12 50000 +Ethernet48 48,49,50,51 etp13 13 100000 +Ethernet52 52,53,54,55 etp14 14 100000 +Ethernet56 56,57,58,59 etp15 15 100000 +Ethernet60 60,61,62,63 etp16 16 100000 +Ethernet64 64,65,66,67 etp17 17 100000 +Ethernet68 68,69,70,71 etp18 18 100000 +Ethernet72 72,73,74,75 etp19 19 100000 +Ethernet76 76,77,78,79 etp20 20 100000 +Ethernet80 80,81,82,83 etp21 21 100000 +Ethernet84 84,85,86,87 etp22 22 100000 +Ethernet88 88,89,90,91 etp23 23 100000 +Ethernet92 92,93,94,95 etp24 24 100000 +Ethernet96 96,97,98,99 etp25 25 100000 +Ethernet100 100,101,102,103 etp26 26 100000 +Ethernet104 104,105 etp27a 27 50000 +Ethernet106 106,107 etp27b 27 50000 +Ethernet108 108,109 etp28a 28 50000 +Ethernet110 110,111 etp28b 28 50000 +Ethernet112 112,113,114,115 etp29 29 100000 +Ethernet116 116,117,118,119 etp30 30 100000 +Ethernet120 120,121,122,123 etp31 31 100000 +Ethernet124 124,125,126,127 etp32 32 100000 +Ethernet128 128,129,130,131 etp33 33 100000 +Ethernet132 132,133,134,135 etp34 34 100000 +Ethernet136 136,137,138,139 etp35 35 100000 +Ethernet140 140,141,142,143 etp36 36 100000 +Ethernet144 144,145,146,147 etp37 37 100000 +Ethernet148 148,149,150,151 etp38 38 100000 +Ethernet152 152,153,154,155 etp39 38 100000 +Ethernet156 156,157,158,159 etp40 40 100000 +Ethernet160 160,161,162,163 etp41 41 100000 +Ethernet164 164,165 etp42a 42 50000 +Ethernet166 166,167 etp42b 42 50000 +Ethernet168 168,169,170,171 etp43 43 100000 +Ethernet172 172,173,174,175 etp44 44 100000 +Ethernet176 176,177 etp45a 45 50000 +Ethernet178 178,179 etp45b 45 50000 +Ethernet180 180,181 etp46a 46 50000 +Ethernet182 182,183 etp46b 46 50000 +Ethernet184 184,185 etp47a 47 50000 +Ethernet186 186,187 etp47b 47 50000 +Ethernet188 188,189 etp48a 48 50000 +Ethernet190 190,191 etp48b 48 50000 +Ethernet192 192,193,194,195 etp49 49 100000 +Ethernet196 196,197,198,199 etp50 50 100000 +Ethernet200 200,201,202,203 etp51 51 100000 +Ethernet204 204,205,206,207 etp52 52 100000 +Ethernet208 208,209,210,211 etp53 53 100000 +Ethernet212 212,213,214,215 etp54 54 100000 +Ethernet216 216,217,218,219 etp55 55 100000 +Ethernet220 220,221,222,223 etp56 56 100000 +Ethernet224 224,225,226,227 etp57 57 100000 +Ethernet228 228,229,230,231 etp58 58 100000 +Ethernet232 232,233,234,235 etp59 59 100000 +Ethernet236 236,237,238,239 etp60 60 100000 +Ethernet240 240,241 etp61a 61 50000 +Ethernet242 242,243 etp61b 61 50000 +Ethernet244 244,245 etp62a 62 50000 +Ethernet246 246,247 etp62b 62 50000 +Ethernet248 248,249 etp63a 63 50000 +Ethernet250 250,251 etp63b 63 50000 +Ethernet252 252,253,254,255 etp64 64 10000 diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C49S1/qos.json.j2 b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C49S1/qos.json.j2 new file mode 120000 index 000000000000..26b0dac51846 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C49S1/qos.json.j2 @@ -0,0 +1 @@ +../ACS-MSN3800/qos.json.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C49S1/sai.profile b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C49S1/sai.profile new file mode 100644 index 000000000000..4846e323ae99 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C49S1/sai.profile @@ -0,0 +1,4 @@ +SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_3800_1x10g_28x50g_49x100g.xml +SAI_VXLAN_SRCPORT_RANGE_ENABLE=1 +SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps +SAI_DUMP_STORE_AMOUNT=10 diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C49S1/sai_3800_1x10g_28x50g_49x100g.xml b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C49S1/sai_3800_1x10g_28x50g_49x100g.xml new file mode 100644 index 000000000000..5844f53f4c0a --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C49S1/sai_3800_1x10g_28x50g_49x100g.xml @@ -0,0 +1,484 @@ + + + + + + 00:02:03:04:05:00 + + + 1 + + + 64 + + + + + 1 + 4 + 48 + + + 3 + + + 1536 + + + 3 + 4 + 49 + 1 + 1536 + + + 5 + 4 + 50 + 3 + 1536 + + + 7 + 4 + 51 + 1 + 1536 + + + 9 + 4 + 52 + 3 + 1536 + + + 11 + 4 + 53 + 1 + 1536 + + + 13 + 4 + 54 + 3 + 1536 + + + 15 + 4 + 55 + 1 + 1536 + + + 17 + 4 + 56 + 3 + 384 + 2 + + + 19 + 4 + 57 + 1 + 384 + 2 + + + 21 + 4 + 58 + 3 + 384 + 2 + + + 23 + 4 + 59 + 1 + 384 + 2 + + + 25 + 4 + 60 + 3 + 1536 + + + 27 + 4 + 61 + 1 + 1536 + + + 29 + 4 + 62 + 3 + 1536 + + + 31 + 4 + 63 + 1 + 1536 + + + 33 + 4 + 12 + 3 + 1536 + + + 35 + 4 + 13 + 1 + 1536 + + + 37 + 4 + 14 + 3 + 1536 + + + 39 + 4 + 15 + 1 + 1536 + + + 41 + 4 + 8 + 3 + 1536 + + + 43 + 4 + 9 + 1 + 1536 + + + 45 + 4 + 10 + 3 + 1536 + + + 47 + 4 + 11 + 1 + 1536 + + + 49 + 4 + 4 + 3 + 1536 + + + 51 + 4 + 5 + 1 + 1536 + + + 53 + 4 + 6 + 3 + 384 + 2 + + + 55 + 4 + 7 + 1 + 384 + 2 + + + 57 + 4 + 0 + 3 + 1536 + + + 59 + 4 + 1 + 1 + 1536 + + + 61 + 4 + 2 + 3 + 1536 + + + 63 + 4 + 3 + 1 + 1536 + + + 65 + 4 + 44 + 3 + 1536 + + + 67 + 4 + 45 + 1 + 1536 + + + 69 + 4 + 46 + 3 + 1536 + + + 71 + 4 + 47 + 1 + 1536 + + + 73 + 4 + 40 + 3 + 1536 + + + 75 + 4 + 41 + 1 + 1536 + + + 77 + 4 + 42 + 3 + 1536 + + + 79 + 4 + 43 + 1 + 1536 + + + 81 + 4 + 36 + 3 + 1536 + + + 83 + 4 + 37 + 1 + 384 + 2 + + + 85 + 4 + 38 + 3 + 1536 + + + 87 + 4 + 39 + 1 + 1536 + + + 89 + 4 + 32 + 3 + 384 + 2 + + + 91 + 4 + 33 + 1 + 384 + 2 + + + 93 + 4 + 34 + 3 + 384 + 2 + + + 95 + 4 + 35 + 1 + 384 + 2 + + + 97 + 4 + 16 + 3 + 1536 + + + 99 + 4 + 17 + 1 + 1536 + + + 101 + 4 + 18 + 3 + 1536 + + + 103 + 4 + 19 + 1 + 1536 + + + 105 + 4 + 20 + 3 + 1536 + + + 107 + 4 + 21 + 1 + 1536 + + + 109 + 4 + 22 + 3 + 1536 + + + 111 + 4 + 23 + 1 + 1536 + + + 113 + 4 + 24 + 3 + 1536 + + + 115 + 4 + 25 + 1 + 1536 + + + 117 + 4 + 26 + 3 + 1536 + + + 119 + 4 + 27 + 1 + 1536 + + + 121 + 4 + 28 + 3 + 384 + 2 + + + 123 + 4 + 29 + 1 + 384 + 2 + + + 125 + 4 + 30 + 3 + 384 + 2 + + + 127 + 4 + 31 + 1 + 16 + + + + diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C50/buffers_defaults_objects.j2 b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C50/buffers_defaults_objects.j2 new file mode 120000 index 000000000000..c01aebb7ae12 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C50/buffers_defaults_objects.j2 @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/buffers_defaults_objects.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C50/buffers_defaults_t0.j2 b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C50/buffers_defaults_t0.j2 index e732ff1a3d65..2c39cf1b059d 100644 --- a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C50/buffers_defaults_t0.j2 +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C50/buffers_defaults_t0.j2 @@ -1,102 +1,23 @@ {% set default_cable = '5m' %} -{% set ingress_lossless_pool_size = '21565440' %} +{% set ingress_lossless_pool_size = '24360960' %} +{% set ingress_lossless_pool_xoff = '2795520' %} {% set egress_lossless_pool_size = '34287552' %} -{% set egress_lossy_pool_size = '21565440' %} +{% set egress_lossy_pool_size = '24360960' %} -{%- macro generate_port_lists(PORT_ALL) %} - {# Generate list of ports #} - {%- for port_idx in range(0, 32) %} - {%- if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{%- endif %} - {%- endfor %} -{%- endmacro %} +{% import 'buffers_defaults_objects.j2' as defs with context %} -{%- macro generate_buffer_pool_and_profiles() %} - "BUFFER_POOL": { - "ingress_lossless_pool": { - {%- if dynamic_mode is not defined %} - "size": "{{ ingress_lossless_pool_size }}", - {%- endif %} - "type": "ingress", - "mode": "dynamic" - }, - "egress_lossless_pool": { - "size": "{{ egress_lossless_pool_size }}", - "type": "egress", - "mode": "dynamic" - }, - "egress_lossy_pool": { - {%- if dynamic_mode is not defined %} - "size": "{{ egress_lossy_pool_size }}", - {%- endif %} - "type": "egress", - "mode": "dynamic" - } - }, - "BUFFER_PROFILE": { - "ingress_lossless_profile": { - "pool":"[BUFFER_POOL|ingress_lossless_pool]", - "size":"0", - "dynamic_th":"7" - }, - "ingress_lossy_profile": { - "pool":"[BUFFER_POOL|ingress_lossless_pool]", - "size":"0", - "dynamic_th":"3" - }, - "egress_lossless_profile": { - "pool":"[BUFFER_POOL|egress_lossless_pool]", - "size":"0", - "dynamic_th":"7" - }, - "egress_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"9216", - "dynamic_th":"7" - }, - "q_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"0", - "dynamic_th":"3" - } - }, +{%- macro generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) %} +{{ defs.generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) }} {%- endmacro %} -{%- macro generate_profile_lists(port_names) %} - "BUFFER_PORT_INGRESS_PROFILE_LIST": { -{% for port in port_names.split(',') %} - "{{ port }}": { - "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" - }{% if not loop.last %},{% endif %} - -{% endfor %} - }, - "BUFFER_PORT_EGRESS_PROFILE_LIST": { -{% for port in port_names.split(',') %} - "{{ port }}": { - "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" - }{% if not loop.last %},{% endif %} - -{% endfor %} - } +{%- macro generate_profile_lists_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_profile_lists(port_names_active, port_names_inactive) }} {%- endmacro %} -{%- macro generate_queue_buffers(port_names) %} - "BUFFER_QUEUE": { -{% for port in port_names.split(',') %} - "{{ port }}|3-4": { - "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" - }, -{% endfor %} -{% for port in port_names.split(',') %} - "{{ port }}|0-2": { - "profile" : "[BUFFER_PROFILE|q_lossy_profile]" - }, -{% endfor %} -{% for port in port_names.split(',') %} - "{{ port }}|5-6": { - "profile" : "[BUFFER_PROFILE|q_lossy_profile]" - }{% if not loop.last %},{% endif %} +{%- macro generate_queue_buffers_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_queue_buffers(port_names_active, port_names_inactive) }} +{%- endmacro %} -{% endfor %} - } +{%- macro generate_pg_profiles_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_pg_profiles(port_names_active, port_names_inactive) }} {%- endmacro %} diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C50/buffers_defaults_t1.j2 b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C50/buffers_defaults_t1.j2 index a6556db59587..dae6bf287b4c 100644 --- a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C50/buffers_defaults_t1.j2 +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C50/buffers_defaults_t1.j2 @@ -1,102 +1,23 @@ {% set default_cable = '5m' %} -{% set ingress_lossless_pool_size = '17604608' %} +{% set ingress_lossless_pool_size = '22380544' %} +{% set ingress_lossless_pool_xoff = '4775936' %} {% set egress_lossless_pool_size = '34287552' %} -{% set egress_lossy_pool_size = '17604608' %} +{% set egress_lossy_pool_size = '22380544' %} -{%- macro generate_port_lists(PORT_ALL) %} - {# Generate list of ports #} - {%- for port_idx in range(0, 32) %} - {%- if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{%- endif %} - {%- endfor %} -{%- endmacro %} +{% import 'buffers_defaults_objects.j2' as defs with context %} -{%- macro generate_buffer_pool_and_profiles() %} - "BUFFER_POOL": { - "ingress_lossless_pool": { - {%- if dynamic_mode is not defined %} - "size": "{{ ingress_lossless_pool_size }}", - {%- endif %} - "type": "ingress", - "mode": "dynamic" - }, - "egress_lossless_pool": { - "size": "{{ egress_lossless_pool_size }}", - "type": "egress", - "mode": "dynamic" - }, - "egress_lossy_pool": { - {%- if dynamic_mode is not defined %} - "size": "{{ egress_lossy_pool_size }}", - {%- endif %} - "type": "egress", - "mode": "dynamic" - } - }, - "BUFFER_PROFILE": { - "ingress_lossless_profile": { - "pool":"[BUFFER_POOL|ingress_lossless_pool]", - "size":"0", - "dynamic_th":"7" - }, - "ingress_lossy_profile": { - "pool":"[BUFFER_POOL|ingress_lossless_pool]", - "size":"0", - "dynamic_th":"3" - }, - "egress_lossless_profile": { - "pool":"[BUFFER_POOL|egress_lossless_pool]", - "size":"0", - "dynamic_th":"7" - }, - "egress_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"9216", - "dynamic_th":"7" - }, - "q_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"0", - "dynamic_th":"3" - } - }, +{%- macro generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) %} +{{ defs.generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) }} {%- endmacro %} -{%- macro generate_profile_lists(port_names) %} - "BUFFER_PORT_INGRESS_PROFILE_LIST": { -{% for port in port_names.split(',') %} - "{{ port }}": { - "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" - }{% if not loop.last %},{% endif %} - -{% endfor %} - }, - "BUFFER_PORT_EGRESS_PROFILE_LIST": { -{% for port in port_names.split(',') %} - "{{ port }}": { - "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" - }{% if not loop.last %},{% endif %} - -{% endfor %} - } +{%- macro generate_profile_lists_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_profile_lists(port_names_active, port_names_inactive) }} {%- endmacro %} -{%- macro generate_queue_buffers(port_names) %} - "BUFFER_QUEUE": { -{% for port in port_names.split(',') %} - "{{ port }}|3-4": { - "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" - }, -{% endfor %} -{% for port in port_names.split(',') %} - "{{ port }}|0-2": { - "profile" : "[BUFFER_PROFILE|q_lossy_profile]" - }, -{% endfor %} -{% for port in port_names.split(',') %} - "{{ port }}|5-6": { - "profile" : "[BUFFER_PROFILE|q_lossy_profile]" - }{% if not loop.last %},{% endif %} +{%- macro generate_queue_buffers_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_queue_buffers(port_names_active, port_names_inactive) }} +{%- endmacro %} -{% endfor %} - } +{%- macro generate_pg_profiles_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_pg_profiles(port_names_active, port_names_inactive) }} {%- endmacro %} diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C50/sai.profile b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C50/sai.profile index aa37fb30dbd0..ea9a7997fc04 100644 --- a/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C50/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/Mellanox-SN3800-D28C50/sai.profile @@ -1 +1,4 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_3800_28x50g_52x100g.xml +SAI_VXLAN_SRCPORT_RANGE_ENABLE=1 +SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps +SAI_DUMP_STORE_AMOUNT=10 diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/pcie.yaml b/device/mellanox/x86_64-mlnx_msn3800-r0/pcie.yaml index d4a25d40bd54..3dc31739f7d9 120000 --- a/device/mellanox/x86_64-mlnx_msn3800-r0/pcie.yaml +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/pcie.yaml @@ -1 +1 @@ -../x86_64-mlnx_msn3700-r0/pcie.yaml \ No newline at end of file +../x86_64-mlnx_msn3700c-r0/pcie.yaml \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/platform.json b/device/mellanox/x86_64-mlnx_msn3800-r0/platform.json new file mode 100644 index 000000000000..6de5df957572 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/platform.json @@ -0,0 +1,723 @@ +{ + "chassis": { + "name": "MSN3800", + "components": [ + { + "name": "ONIE" + }, + { + "name": "SSD" + }, + { + "name": "BIOS" + }, + { + "name": "CPLD1" + }, + { + "name": "CPLD2" + }, + { + "name": "CPLD3" + }, + { + "name": "CPLD4" + } + ], + "fans": [], + "fan_drawers": [ + { + "name": "drawer1", + "fans": [ + { + "name": "fan1" + } + ] + }, + { + "name": "drawer2", + "fans": [ + { + "name": "fan2" + } + ] + }, + { + "name": "drawer3", + "fans": [ + { + "name": "fan3" + } + ] + } + ], + "psus": [ + { + "name": "PSU 1", + "fans": [ + { + "name": "psu1_fan1" + } + ], + "thermals": [ + { + "name": "PSU-1 Temp" + } + ] + }, + { + "name": "PSU 2", + "fans": [ + { + "name": "psu2_fan1" + } + ], + "thermals": [ + { + "name": "PSU-2 Temp" + } + ] + } + ], + "thermals": [ + { + "name": "ASIC" + }, + { + "name": "Ambient COMEX Temp" + }, + { + "name": "Ambient Fan Side Temp" + }, + { + "name": "Ambient Port Side Temp" + }, + { + "name": "CPU Core 0 Temp" + }, + { + "name": "CPU Core 1 Temp" + }, + { + "name": "CPU Core 2 Temp" + }, + { + "name": "CPU Core 3 Temp" + }, + { + "name": "CPU Pack Temp" + }, + { + "name": "Gearbox 1 Temp" + }, + { + "name": "Gearbox 2 Temp" + }, + { + "name": "Gearbox 3 Temp" + }, + { + "name": "Gearbox 4 Temp" + }, + { + "name": "Gearbox 5 Temp" + }, + { + "name": "Gearbox 6 Temp" + }, + { + "name": "Gearbox 7 Temp" + }, + { + "name": "Gearbox 8 Temp" + }, + { + "name": "Gearbox 9 Temp" + }, + { + "name": "Gearbox 10 Temp" + }, + { + "name": "Gearbox 11 Temp" + }, + { + "name": "Gearbox 12 Temp" + }, + { + "name": "Gearbox 13 Temp" + }, + { + "name": "Gearbox 14 Temp" + }, + { + "name": "Gearbox 15 Temp" + }, + { + "name": "Gearbox 16 Temp" + }, + { + "name": "Gearbox 17 Temp" + }, + { + "name": "Gearbox 18 Temp" + }, + { + "name": "Gearbox 19 Temp" + }, + { + "name": "Gearbox 20 Temp" + }, + { + "name": "Gearbox 21 Temp" + }, + { + "name": "Gearbox 22 Temp" + }, + { + "name": "Gearbox 23 Temp" + }, + { + "name": "Gearbox 24 Temp" + }, + { + "name": "Gearbox 25 Temp" + }, + { + "name": "Gearbox 26 Temp" + }, + { + "name": "Gearbox 27 Temp" + }, + { + "name": "Gearbox 28 Temp" + }, + { + "name": "Gearbox 29 Temp" + }, + { + "name": "Gearbox 30 Temp" + }, + { + "name": "Gearbox 31 Temp" + }, + { + "name": "Gearbox 32 Temp" + } + ], + "sfps": [ + { + "name": "sfp1", + "thermals": [ + { + "name": "xSFP module 1 Temp" + } + ] + }, + { + "name": "sfp2", + "thermals": [ + { + "name": "xSFP module 2 Temp" + } + ] + }, + { + "name": "sfp3", + "thermals": [ + { + "name": "xSFP module 3 Temp" + } + ] + }, + { + "name": "sfp4", + "thermals": [ + { + "name": "xSFP module 4 Temp" + } + ] + }, + { + "name": "sfp5", + "thermals": [ + { + "name": "xSFP module 5 Temp" + } + ] + }, + { + "name": "sfp6", + "thermals": [ + { + "name": "xSFP module 6 Temp" + } + ] + }, + { + "name": "sfp7", + "thermals": [ + { + "name": "xSFP module 7 Temp" + } + ] + }, + { + "name": "sfp8", + "thermals": [ + { + "name": "xSFP module 8 Temp" + } + ] + }, + { + "name": "sfp9", + "thermals": [ + { + "name": "xSFP module 9 Temp" + } + ] + }, + { + "name": "sfp10", + "thermals": [ + { + "name": "xSFP module 10 Temp" + } + ] + }, + { + "name": "sfp11", + "thermals": [ + { + "name": "xSFP module 11 Temp" + } + ] + }, + { + "name": "sfp12", + "thermals": [ + { + "name": "xSFP module 12 Temp" + } + ] + }, + { + "name": "sfp13", + "thermals": [ + { + "name": "xSFP module 13 Temp" + } + ] + }, + { + "name": "sfp14", + "thermals": [ + { + "name": "xSFP module 14 Temp" + } + ] + }, + { + "name": "sfp15", + "thermals": [ + { + "name": "xSFP module 15 Temp" + } + ] + }, + { + "name": "sfp16", + "thermals": [ + { + "name": "xSFP module 16 Temp" + } + ] + }, + { + "name": "sfp17", + "thermals": [ + { + "name": "xSFP module 17 Temp" + } + ] + }, + { + "name": "sfp18", + "thermals": [ + { + "name": "xSFP module 18 Temp" + } + ] + }, + { + "name": "sfp19", + "thermals": [ + { + "name": "xSFP module 19 Temp" + } + ] + }, + { + "name": "sfp20", + "thermals": [ + { + "name": "xSFP module 20 Temp" + } + ] + }, + { + "name": "sfp21", + "thermals": [ + { + "name": "xSFP module 21 Temp" + } + ] + }, + { + "name": "sfp22", + "thermals": [ + { + "name": "xSFP module 22 Temp" + } + ] + }, + { + "name": "sfp23", + "thermals": [ + { + "name": "xSFP module 23 Temp" + } + ] + }, + { + "name": "sfp24", + "thermals": [ + { + "name": "xSFP module 24 Temp" + } + ] + }, + { + "name": "sfp25", + "thermals": [ + { + "name": "xSFP module 25 Temp" + } + ] + }, + { + "name": "sfp26", + "thermals": [ + { + "name": "xSFP module 26 Temp" + } + ] + }, + { + "name": "sfp27", + "thermals": [ + { + "name": "xSFP module 27 Temp" + } + ] + }, + { + "name": "sfp28", + "thermals": [ + { + "name": "xSFP module 28 Temp" + } + ] + }, + { + "name": "sfp29", + "thermals": [ + { + "name": "xSFP module 29 Temp" + } + ] + }, + { + "name": "sfp30", + "thermals": [ + { + "name": "xSFP module 30 Temp" + } + ] + }, + { + "name": "sfp31", + "thermals": [ + { + "name": "xSFP module 31 Temp" + } + ] + }, + { + "name": "sfp32", + "thermals": [ + { + "name": "xSFP module 32 Temp" + } + ] + }, + { + "name": "sfp33", + "thermals": [ + { + "name": "xSFP module 33 Temp" + } + ] + }, + { + "name": "sfp34", + "thermals": [ + { + "name": "xSFP module 34 Temp" + } + ] + }, + { + "name": "sfp35", + "thermals": [ + { + "name": "xSFP module 35 Temp" + } + ] + }, + { + "name": "sfp36", + "thermals": [ + { + "name": "xSFP module 36 Temp" + } + ] + }, + { + "name": "sfp37", + "thermals": [ + { + "name": "xSFP module 37 Temp" + } + ] + }, + { + "name": "sfp38", + "thermals": [ + { + "name": "xSFP module 38 Temp" + } + ] + }, + { + "name": "sfp39", + "thermals": [ + { + "name": "xSFP module 39 Temp" + } + ] + }, + { + "name": "sfp40", + "thermals": [ + { + "name": "xSFP module 40 Temp" + } + ] + }, + { + "name": "sfp41", + "thermals": [ + { + "name": "xSFP module 41 Temp" + } + ] + }, + { + "name": "sfp42", + "thermals": [ + { + "name": "xSFP module 42 Temp" + } + ] + }, + { + "name": "sfp43", + "thermals": [ + { + "name": "xSFP module 43 Temp" + } + ] + }, + { + "name": "sfp44", + "thermals": [ + { + "name": "xSFP module 44 Temp" + } + ] + }, + { + "name": "sfp45", + "thermals": [ + { + "name": "xSFP module 45 Temp" + } + ] + }, + { + "name": "sfp46", + "thermals": [ + { + "name": "xSFP module 46 Temp" + } + ] + }, + { + "name": "sfp47", + "thermals": [ + { + "name": "xSFP module 47 Temp" + } + ] + }, + { + "name": "sfp48", + "thermals": [ + { + "name": "xSFP module 48 Temp" + } + ] + }, + { + "name": "sfp49", + "thermals": [ + { + "name": "xSFP module 49 Temp" + } + ] + }, + { + "name": "sfp50", + "thermals": [ + { + "name": "xSFP module 50 Temp" + } + ] + }, + { + "name": "sfp51", + "thermals": [ + { + "name": "xSFP module 51 Temp" + } + ] + }, + { + "name": "sfp52", + "thermals": [ + { + "name": "xSFP module 52 Temp" + } + ] + }, + { + "name": "sfp53", + "thermals": [ + { + "name": "xSFP module 53 Temp" + } + ] + }, + { + "name": "sfp54", + "thermals": [ + { + "name": "xSFP module 54 Temp" + } + ] + }, + { + "name": "sfp55", + "thermals": [ + { + "name": "xSFP module 55 Temp" + } + ] + }, + { + "name": "sfp56", + "thermals": [ + { + "name": "xSFP module 56 Temp" + } + ] + }, + { + "name": "sfp57", + "thermals": [ + { + "name": "xSFP module 57 Temp" + } + ] + }, + { + "name": "sfp58", + "thermals": [ + { + "name": "xSFP module 58 Temp" + } + ] + }, + { + "name": "sfp59", + "thermals": [ + { + "name": "xSFP module 59 Temp" + } + ] + }, + { + "name": "sfp60", + "thermals": [ + { + "name": "xSFP module 60 Temp" + } + ] + }, + { + "name": "sfp61", + "thermals": [ + { + "name": "xSFP module 61 Temp" + } + ] + }, + { + "name": "sfp62", + "thermals": [ + { + "name": "xSFP module 62 Temp" + } + ] + }, + { + "name": "sfp63", + "thermals": [ + { + "name": "xSFP module 63 Temp" + } + ] + }, + { + "name": "sfp64", + "thermals": [ + { + "name": "xSFP module 64 Temp" + } + ] + } + ] + }, + "interfaces": {} +} diff --git a/device/mellanox/x86_64-mlnx_msn3800-r0/sensors.conf b/device/mellanox/x86_64-mlnx_msn3800-r0/sensors.conf index 9777c5e84398..7ba5f9c8c050 100644 --- a/device/mellanox/x86_64-mlnx_msn3800-r0/sensors.conf +++ b/device/mellanox/x86_64-mlnx_msn3800-r0/sensors.conf @@ -93,20 +93,6 @@ bus "i2c-15" "i2c-1-mux (chan_id 6)" # Power supplies bus "i2c-4" "i2c-1-mux (chan_id 3)" chip "dps460-i2c-*-58" - label in1 "PSU-1 220V Rail (in)" - ignore in2 - label in3 "PSU-1 12V Rail (out)" - label fan1 "PSU-1 Fan 1" - ignore fan2 - ignore fan3 - label temp1 "PSU-1 Temp 1" - label temp2 "PSU-1 Temp 2" - label temp3 "PSU-1 Temp 3" - label power1 "PSU-1 220V Rail Pwr (in)" - label power2 "PSU-1 12V Rail Pwr (out)" - label curr1 "PSU-1 220V Rail Curr (in)" - label curr2 "PSU-1 12V Rail Curr (out)" - chip "dps460-i2c-*-59" label in1 "PSU-2 220V Rail (in)" ignore in2 label in3 "PSU-2 12V Rail (out)" @@ -120,6 +106,20 @@ bus "i2c-4" "i2c-1-mux (chan_id 3)" label power2 "PSU-2 12V Rail Pwr (out)" label curr1 "PSU-2 220V Rail Curr (in)" label curr2 "PSU-2 12V Rail Curr (out)" + chip "dps460-i2c-*-59" + label in1 "PSU-1 220V Rail (in)" + ignore in2 + label in3 "PSU-1 12V Rail (out)" + label fan1 "PSU-1 Fan 1" + ignore fan2 + ignore fan3 + label temp1 "PSU-1 Temp 1" + label temp2 "PSU-1 Temp 2" + label temp3 "PSU-1 Temp 3" + label power1 "PSU-1 220V Rail Pwr (in)" + label power2 "PSU-1 12V Rail Pwr (out)" + label curr1 "PSU-1 220V Rail Curr (in)" + label curr2 "PSU-1 12V Rail Curr (out)" # Chassis fans chip "mlxreg_fan-isa-*" diff --git a/device/mellanox/x86_64-mlnx_msn4410-r0/ACS-MSN4410/buffers_defaults_objects.j2 b/device/mellanox/x86_64-mlnx_msn4410-r0/ACS-MSN4410/buffers_defaults_objects.j2 new file mode 120000 index 000000000000..33b6704f9902 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4410-r0/ACS-MSN4410/buffers_defaults_objects.j2 @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/ACS-MSN2700/buffers_defaults_objects.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4410-r0/ACS-MSN4410/buffers_dynamic.json.j2 b/device/mellanox/x86_64-mlnx_msn4410-r0/ACS-MSN4410/buffers_dynamic.json.j2 new file mode 120000 index 000000000000..8c4117c66214 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4410-r0/ACS-MSN4410/buffers_dynamic.json.j2 @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/ACS-MSN2700/buffers_dynamic.json.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4410-r0/ACS-MSN4410/port_config.ini b/device/mellanox/x86_64-mlnx_msn4410-r0/ACS-MSN4410/port_config.ini deleted file mode 120000 index 606b074c20e8..000000000000 --- a/device/mellanox/x86_64-mlnx_msn4410-r0/ACS-MSN4410/port_config.ini +++ /dev/null @@ -1 +0,0 @@ -../../x86_64-mlnx_msn4700-r0/ACS-MSN4700/port_config.ini \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4410-r0/ACS-MSN4410/port_config.ini b/device/mellanox/x86_64-mlnx_msn4410-r0/ACS-MSN4410/port_config.ini new file mode 100644 index 000000000000..53c86ecb055e --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4410-r0/ACS-MSN4410/port_config.ini @@ -0,0 +1,57 @@ +# name lanes alias index speed +Ethernet0 0,1,2,3 etp1a 1 100000 +Ethernet4 4,5,6,7 etp1b 1 100000 +Ethernet8 8,9,10,11 etp2a 2 100000 +Ethernet12 12,13,14,15 etp2b 2 100000 +Ethernet16 16,17,18,19 etp3a 3 100000 +Ethernet20 20,21,22,23 etp3b 3 100000 +Ethernet24 24,25,26,27 etp4a 4 100000 +Ethernet28 28,29,30,31 etp4b 4 100000 +Ethernet32 32,33,34,35 etp5a 5 100000 +Ethernet36 36,37,38,39 etp5b 5 100000 +Ethernet40 40,41,42,43 etp6a 6 100000 +Ethernet44 44,45,46,47 etp6b 6 100000 +Ethernet48 48,49,50,51 etp7a 7 100000 +Ethernet52 52,53,54,55 etp7b 7 100000 +Ethernet56 56,57,58,59 etp8a 8 100000 +Ethernet60 60,61,62,63 etp8b 8 100000 +Ethernet64 64,65,66,67 etp9a 9 100000 +Ethernet68 68,69,70,71 etp9b 9 100000 +Ethernet72 72,73,74,75 etp10a 10 100000 +Ethernet76 76,77,78,79 etp10b 10 100000 +Ethernet80 80,81,82,83 etp11a 11 100000 +Ethernet84 84,85,86,87 etp11b 11 100000 +Ethernet88 88,89,90,91 etp12a 12 100000 +Ethernet92 92,93,94,95 etp12b 12 100000 +Ethernet96 96,97,98,99 etp13a 13 100000 +Ethernet100 100,101,102,103 etp13b 13 100000 +Ethernet104 104,105,106,107 etp14a 14 100000 +Ethernet108 108,109,110,111 etp14b 14 100000 +Ethernet112 112,113,114,115 etp15a 15 100000 +Ethernet116 116,117,118,119 etp15b 15 100000 +Ethernet120 120,121,122,123 etp16a 16 100000 +Ethernet124 124,125,126,127 etp16b 16 100000 +Ethernet128 128,129,130,131 etp17a 17 100000 +Ethernet132 132,133,134,135 etp17b 17 100000 +Ethernet136 136,137,138,139 etp18a 18 100000 +Ethernet140 140,141,142,143 etp18b 18 100000 +Ethernet144 144,145,146,147 etp19a 19 100000 +Ethernet148 148,149,150,151 etp19b 19 100000 +Ethernet152 152,153,154,155 etp20a 20 100000 +Ethernet156 156,157,158,159 etp20b 20 100000 +Ethernet160 160,161,162,163 etp21a 21 100000 +Ethernet164 164,165,166,167 etp21b 21 100000 +Ethernet168 168,169,170,171 etp22a 22 100000 +Ethernet172 172,173,174,175 etp22b 22 100000 +Ethernet176 176,177,178,179 etp23a 23 100000 +Ethernet180 180,181,182,183 etp23b 23 100000 +Ethernet184 184,185,186,187 etp24a 24 100000 +Ethernet188 188,189,190,191 etp24b 24 100000 +Ethernet192 192,193,194,195,196,197,198,199 etp25 25 400000 +Ethernet200 200,201,202,203,204,205,206,207 etp26 26 400000 +Ethernet208 208,209,210,211,212,213,214,215 etp27 27 400000 +Ethernet216 216,217,218,219,220,221,222,223 etp28 28 400000 +Ethernet224 224,225,226,227,228,229,230,231 etp29 29 400000 +Ethernet232 232,233,234,235,236,237,238,239 etp30 30 400000 +Ethernet240 240,241,242,243,244,245,246,247 etp31 31 400000 +Ethernet248 248,249,250,251,252,253,254,255 etp32 32 400000 diff --git a/device/mellanox/x86_64-mlnx_msn4410-r0/ACS-MSN4410/sai.profile b/device/mellanox/x86_64-mlnx_msn4410-r0/ACS-MSN4410/sai.profile index be729cb4e06a..1fd5ba39f3af 100644 --- a/device/mellanox/x86_64-mlnx_msn4410-r0/ACS-MSN4410/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn4410-r0/ACS-MSN4410/sai.profile @@ -1 +1,3 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_4410.xml +SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps +SAI_DUMP_STORE_AMOUNT=10 diff --git a/device/mellanox/x86_64-mlnx_msn4410-r0/get_sensors_conf_path b/device/mellanox/x86_64-mlnx_msn4410-r0/get_sensors_conf_path new file mode 120000 index 000000000000..f1509a1e1d3d --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4410-r0/get_sensors_conf_path @@ -0,0 +1 @@ +../x86_64-mlnx_msn4700-r0/get_sensors_conf_path \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4410-r0/platform.json b/device/mellanox/x86_64-mlnx_msn4410-r0/platform.json new file mode 100644 index 000000000000..7d1c23974bf1 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4410-r0/platform.json @@ -0,0 +1,410 @@ +{ + "chassis": { + "name": "MSN4410", + "components": [ + { + "name": "ONIE" + }, + { + "name": "SSD" + }, + { + "name": "BIOS" + }, + { + "name": "CPLD1" + }, + { + "name": "CPLD2" + }, + { + "name": "CPLD3" + } + ], + "fans": [], + "fan_drawers": [ + { + "name": "drawer1", + "fans": [ + { + "name": "fan1" + }, + { + "name": "fan2" + } + ] + }, + { + "name": "drawer2", + "fans": [ + { + "name": "fan3" + }, + { + "name": "fan4" + } + ] + }, + { + "name": "drawer3", + "fans": [ + { + "name": "fan5" + }, + { + "name": "fan6" + } + ] + }, + { + "name": "drawer4", + "fans": [ + { + "name": "fan7" + }, + { + "name": "fan8" + } + ] + }, + { + "name": "drawer5", + "fans": [ + { + "name": "fan9" + }, + { + "name": "fan10" + } + ] + }, + { + "name": "drawer6", + "fans": [ + { + "name": "fan11" + }, + { + "name": "fan12" + } + ] + } + ], + "psus": [ + { + "name": "PSU 1", + "fans": [ + { + "name": "psu1_fan1" + } + ], + "thermals": [ + { + "name": "PSU-1 Temp" + } + ] + }, + { + "name": "PSU 2", + "fans": [ + { + "name": "psu2_fan1" + } + ], + "thermals": [ + { + "name": "PSU-2 Temp" + } + ] + } + ], + "thermals": [ + { + "name": "ASIC" + }, + { + "name": "Ambient COMEX Temp" + }, + { + "name": "Ambient Fan Side Temp" + }, + { + "name": "Ambient Port Side Temp" + }, + { + "name": "CPU Core 0 Temp" + }, + { + "name": "CPU Core 1 Temp" + }, + { + "name": "CPU Core 2 Temp" + }, + { + "name": "CPU Core 3 Temp" + }, + { + "name": "CPU Pack Temp" + } + ], + "sfps": [ + { + "name": "sfp1", + "thermals": [ + { + "name": "xSFP module 1 Temp" + } + ] + }, + { + "name": "sfp2", + "thermals": [ + { + "name": "xSFP module 2 Temp" + } + ] + }, + { + "name": "sfp3", + "thermals": [ + { + "name": "xSFP module 3 Temp" + } + ] + }, + { + "name": "sfp4", + "thermals": [ + { + "name": "xSFP module 4 Temp" + } + ] + }, + { + "name": "sfp5", + "thermals": [ + { + "name": "xSFP module 5 Temp" + } + ] + }, + { + "name": "sfp6", + "thermals": [ + { + "name": "xSFP module 6 Temp" + } + ] + }, + { + "name": "sfp7", + "thermals": [ + { + "name": "xSFP module 7 Temp" + } + ] + }, + { + "name": "sfp8", + "thermals": [ + { + "name": "xSFP module 8 Temp" + } + ] + }, + { + "name": "sfp9", + "thermals": [ + { + "name": "xSFP module 9 Temp" + } + ] + }, + { + "name": "sfp10", + "thermals": [ + { + "name": "xSFP module 10 Temp" + } + ] + }, + { + "name": "sfp11", + "thermals": [ + { + "name": "xSFP module 11 Temp" + } + ] + }, + { + "name": "sfp12", + "thermals": [ + { + "name": "xSFP module 12 Temp" + } + ] + }, + { + "name": "sfp13", + "thermals": [ + { + "name": "xSFP module 13 Temp" + } + ] + }, + { + "name": "sfp14", + "thermals": [ + { + "name": "xSFP module 14 Temp" + } + ] + }, + { + "name": "sfp15", + "thermals": [ + { + "name": "xSFP module 15 Temp" + } + ] + }, + { + "name": "sfp16", + "thermals": [ + { + "name": "xSFP module 16 Temp" + } + ] + }, + { + "name": "sfp17", + "thermals": [ + { + "name": "xSFP module 17 Temp" + } + ] + }, + { + "name": "sfp18", + "thermals": [ + { + "name": "xSFP module 18 Temp" + } + ] + }, + { + "name": "sfp19", + "thermals": [ + { + "name": "xSFP module 19 Temp" + } + ] + }, + { + "name": "sfp20", + "thermals": [ + { + "name": "xSFP module 20 Temp" + } + ] + }, + { + "name": "sfp21", + "thermals": [ + { + "name": "xSFP module 21 Temp" + } + ] + }, + { + "name": "sfp22", + "thermals": [ + { + "name": "xSFP module 22 Temp" + } + ] + }, + { + "name": "sfp23", + "thermals": [ + { + "name": "xSFP module 23 Temp" + } + ] + }, + { + "name": "sfp24", + "thermals": [ + { + "name": "xSFP module 24 Temp" + } + ] + }, + { + "name": "sfp25", + "thermals": [ + { + "name": "xSFP module 25 Temp" + } + ] + }, + { + "name": "sfp26", + "thermals": [ + { + "name": "xSFP module 26 Temp" + } + ] + }, + { + "name": "sfp27", + "thermals": [ + { + "name": "xSFP module 27 Temp" + } + ] + }, + { + "name": "sfp28", + "thermals": [ + { + "name": "xSFP module 28 Temp" + } + ] + }, + { + "name": "sfp29", + "thermals": [ + { + "name": "xSFP module 29 Temp" + } + ] + }, + { + "name": "sfp30", + "thermals": [ + { + "name": "xSFP module 30 Temp" + } + ] + }, + { + "name": "sfp31", + "thermals": [ + { + "name": "xSFP module 31 Temp" + } + ] + }, + { + "name": "sfp32", + "thermals": [ + { + "name": "xSFP module 32 Temp" + } + ] + } + ] + }, + "interfaces": {} +} diff --git a/device/mellanox/x86_64-mlnx_msn4410-r0/platform_components.json b/device/mellanox/x86_64-mlnx_msn4410-r0/platform_components.json index bb1afce80161..dac126d0b697 100644 --- a/device/mellanox/x86_64-mlnx_msn4410-r0/platform_components.json +++ b/device/mellanox/x86_64-mlnx_msn4410-r0/platform_components.json @@ -1,6 +1,6 @@ { "chassis": { - "x86_64-mlnx_msn4410-r0": { + "MSN4410": { "component": { "ONIE": { }, "SSD": { }, diff --git a/device/mellanox/x86_64-mlnx_msn4410-r0/plugins/sfputil.py b/device/mellanox/x86_64-mlnx_msn4410-r0/plugins/sfputil.py deleted file mode 100644 index 336d729e95a6..000000000000 --- a/device/mellanox/x86_64-mlnx_msn4410-r0/plugins/sfputil.py +++ /dev/null @@ -1,655 +0,0 @@ -# sfputil.py -# -# Platform-specific SFP transceiver interface for SONiC -# - -try: - import subprocess - from sonic_sfp.sfputilbase import * - import syslog -except ImportError as e: - raise ImportError("%s - required module not found" % str(e)) - -# sfp supports dom -XCVR_DOM_CAPABILITY_DOM_SUPPORT_BIT = 0x40 - -# sfp module threshold offset and width -SFP_MODULE_THRESHOLD_OFFSET = 0 -SFP_MODULE_THRESHOLD_WIDTH = 56 - -# I2C page size for sfp -SFP_I2C_PAGE_SIZE = 256 - -# parameters for DB connection -REDIS_TIMEOUT_USECS = 0 - -# parameters for SFP presence -SFP_STATUS_INSERTED = '1' - -# system level event/error -EVENT_ON_ALL_SFP = '-1' -SYSTEM_NOT_READY = 'system_not_ready' -SYSTEM_READY = 'system_become_ready' -SYSTEM_FAIL = 'system_fail' - -GET_PLATFORM_CMD = "sonic-cfggen -d -v DEVICE_METADATA.localhost.platform" - -# Ethernet <=> sfp -SFP_PORT_NAME_OFFSET = 0 -SFP_PORT_NAME_CONVENTION = "sfp{}" - -# magic code defnition for port number, qsfp port position of each platform -# port_position_tuple = (PORT_START, QSFP_PORT_START, PORT_END, PORT_IN_BLOCK, EEPROM_OFFSET) -platform_dict = {'x86_64-mlnx_msn2700-r0': 0, 'x86_64-mlnx_msn2740-r0': 0, 'x86_64-mlnx_msn2100-r0': 1, 'x86_64-mlnx_msn2410-r0': 2, 'x86_64-mlnx_msn2010-r0': 3, 'x86_64-mlnx_msn3420-r0':5, 'x86_64-mlnx_msn3700-r0': 0, 'x86_64-mlnx_msn3700c-r0': 0, 'x86_64-mlnx_msn3800-r0': 4, 'x86_64-mlnx_msn4410-r0': 0, 'x86_64-mlnx_msn4600c':4, 'x86_64-mlnx_msn4700-r0': 0} -port_position_tuple_list = [(0, 0, 31, 32, 1), (0, 0, 15, 16, 1), (0, 48, 55, 56, 1), (0, 18, 21, 22, 1), (0, 0, 63, 64, 1), (0, 48, 59, 60, 1)] - -def log_info(msg, also_print_to_console=False): - syslog.openlog("sfputil") - syslog.syslog(syslog.LOG_INFO, msg) - syslog.closelog() - -def log_err(msg, also_print_to_console=False): - syslog.openlog("sfputil") - syslog.syslog(syslog.LOG_ERR, msg) - syslog.closelog() - -class SfpUtil(SfpUtilBase): - """Platform-specific SfpUtil class""" - PORT_START = 0 - QSFP_PORT_START = 0 - PORT_END = 0 - PORTS_IN_BLOCK = 0 - EEPROM_OFFSET = 0 - - db_sel = None - db_sel_timeout = None - db_sel_object = None - db_sel_tbl = None - state_db = None - sfpd_status_tbl = None - - @property - def port_start(self): - return self.PORT_START - - @property - def port_end(self): - return self.PORT_END - - @property - def qsfp_ports(self): - return range(self.QSFP_PORT_START, self.PORTS_IN_BLOCK + 1) - - @property - def port_to_eeprom_mapping(self): - print "dependency on sysfs has been removed" - raise Exception() - - def get_port_position_tuple_by_platform_name(self): - p = subprocess.Popen(GET_PLATFORM_CMD, shell=True, stdout=subprocess.PIPE) - out, err = p.communicate() - position_tuple = port_position_tuple_list[platform_dict[out.rstrip('\n')]] - return position_tuple - - def __init__(self): - port_position_tuple = self.get_port_position_tuple_by_platform_name() - self.PORT_START = port_position_tuple[0] + 1 - self.QSFP_PORT_START = port_position_tuple[1] + 1 - self.PORT_END = port_position_tuple[2] + 1 - self.PORTS_IN_BLOCK = port_position_tuple[3] - self.EEPROM_OFFSET = port_position_tuple[4] - self.mlnx_sfpd_started = False - - SfpUtilBase.__init__(self) - - def get_presence(self, port_num): - presence = False - - # Check for invalid port_num - if port_num < self.port_start or port_num > self.port_end: - return presence - - port_num += SFP_PORT_NAME_OFFSET - sfpname = SFP_PORT_NAME_CONVENTION.format(port_num) - - ethtool_cmd = "ethtool -m {} 2>/dev/null".format(sfpname) - try: - proc = subprocess.Popen(ethtool_cmd, stdout=subprocess.PIPE, shell=True, stderr=subprocess.STDOUT) - stdout = proc.communicate()[0] - proc.wait() - result = stdout.rstrip('\n') - if result != '': - presence = True - - except OSError, e: - return presence - - return presence - - def get_low_power_mode(self, port_num): - # Check for invalid port_num - if port_num < self.port_start or port_num > self.port_end: - return False - - lpm_cmd = "docker exec syncd python /usr/share/sonic/platform/plugins/sfplpmget.py {}".format(port_num) - - try: - output = subprocess.check_output(lpm_cmd, shell=True) - if 'LPM ON' in output: - return True - except subprocess.CalledProcessError as e: - print "Error! Unable to get LPM for {}, rc = {}, err msg: {}".format(port_num, e.returncode, e.output) - return False - - return False - - def set_low_power_mode(self, port_num, lpmode): - # Check for invalid port_num - if port_num < self.port_start or port_num > self.port_end: - return False - - curr_lpmode = self.get_low_power_mode(port_num) - if curr_lpmode == lpmode: - return True - - # Compose LPM command - lpm = 'on' if lpmode else 'off' - lpm_cmd = "docker exec syncd python /usr/share/sonic/platform/plugins/sfplpmset.py {} {}".format(port_num, lpm) - - # Set LPM - try: - subprocess.check_output(lpm_cmd, shell=True) - except subprocess.CalledProcessError as e: - print "Error! Unable to set LPM for {}, rc = {}, err msg: {}".format(port_num, e.returncode, e.output) - return False - - return True - - def reset(self, port_num): - # Check for invalid port_num - if port_num < self.port_start or port_num > self.port_end: - return False - - lpm_cmd = "docker exec syncd python /usr/share/sonic/platform/plugins/sfpreset.py {}".format(port_num) - - try: - subprocess.check_output(lpm_cmd, shell=True) - return True - except subprocess.CalledProcessError as e: - print "Error! Unable to set LPM for {}, rc = {}, err msg: {}".format(port_num, e.returncode, e.output) - return False - - def get_transceiver_change_event(self, timeout=0): - phy_port_dict = {} - status = True - - if self.db_sel is None: - from swsscommon import swsscommon - self.state_db = swsscommon.DBConnector("STATE_DB", - REDIS_TIMEOUT_USECS, - True) - - # Subscribe to state table for SFP change notifications - self.db_sel = swsscommon.Select() - self.db_sel_tbl = swsscommon.NotificationConsumer(self.state_db, 'TRANSCEIVER_NOTIFY') - self.db_sel.addSelectable(self.db_sel_tbl) - self.db_sel_timeout = swsscommon.Select.TIMEOUT - self.db_sel_object = swsscommon.Select.OBJECT - self.sfpd_status_tbl = swsscommon.Table(self.state_db, 'MLNX_SFPD_TASK') - - # Check the liveness of mlnx-sfpd, if it failed, return system_fail event - # If mlnx-sfpd not started, return system_not_ready event - keys = self.sfpd_status_tbl.getKeys() - if 'LIVENESS' not in keys: - if self.mlnx_sfpd_started: - log_err("mlnx-sfpd exited, return false to notify xcvrd.") - phy_port_dict[EVENT_ON_ALL_SFP] = SYSTEM_FAIL - return False, phy_port_dict - else: - log_info("mlnx-sfpd not ready, return false to notify xcvrd.") - phy_port_dict[EVENT_ON_ALL_SFP] = SYSTEM_NOT_READY - return False, phy_port_dict - else: - if not self.mlnx_sfpd_started: - self.mlnx_sfpd_started = True - log_info("mlnx-sfpd is running") - phy_port_dict[EVENT_ON_ALL_SFP] = SYSTEM_READY - return False, phy_port_dict - - if timeout: - (state, c) = self.db_sel.select(timeout) - else: - (state, c) = self.db_sel.select() - - if state == self.db_sel_timeout: - status = True - elif state != self.db_sel_object: - status = False - else: - (key, op, fvp) = self.db_sel_tbl.pop() - phy_port_dict[key] = op - - return status, phy_port_dict - - def _read_eeprom_specific_bytes(self, sysfsfile_eeprom, offset, num_bytes): - print("_read_eeprom_specific_bytes should not be called since the sysfs it dependents on will no longer exist.") - print("_read_eeprom_specific_bytes_via_ethtool should be called instead") - raise Exception() - - # Read out any bytes from any offset - def _read_eeprom_specific_bytes_via_ethtool(self, port_num, offset, num_bytes): - port_num += SFP_PORT_NAME_OFFSET - sfpname = SFP_PORT_NAME_CONVENTION.format(port_num) - - eeprom_raw = [] - ethtool_cmd = "ethtool -m {} hex on offset {} length {}".format(sfpname, offset, num_bytes) - try: - output = subprocess.check_output(ethtool_cmd, shell=True) - output_lines = output.splitlines() - first_line_raw = output_lines[0] - if "Offset" in first_line_raw: - for line in output_lines[2:]: - line_split = line.split() - eeprom_raw = eeprom_raw + line_split[1:] - except subprocess.CalledProcessError as e: - return None - - return eeprom_raw - - # Read eeprom - def _read_eeprom_devid(self, port_num, devid, offset, num_bytes = 512): - if port_num in self.osfp_ports: - pass - elif port_num in self.qsfp_ports: - pass - elif (self.DOM_EEPROM_ADDR == devid): - offset += 256 - - eeprom_raw = self._read_eeprom_specific_bytes_via_ethtool(port_num, offset, num_bytes) - - return eeprom_raw - - # Read out SFP type, vendor name, PN, REV, SN from eeprom. - def get_transceiver_info_dict(self, port_num): - transceiver_info_dict = {} - compliance_code_dict = {} - - # ToDo: OSFP tranceiver info parsing not fully supported. - # in inf8628.py lack of some memory map definition - # will be implemented when the inf8628 memory map ready - if port_num in self.osfp_ports: - offset = 0 - vendor_rev_width = XCVR_HW_REV_WIDTH_OSFP - - sfpi_obj = inf8628InterfaceId() - if sfpi_obj is None: - print("Error: sfp_object open failed") - return None - - sfp_type_raw = self._read_eeprom_specific_bytes_via_ethtool(port_num, (offset + OSFP_TYPE_OFFSET), XCVR_TYPE_WIDTH) - if sfp_type_raw is not None: - sfp_type_data = sfpi_obj.parse_sfp_type(sfp_type_raw, 0) - else: - return None - - sfp_vendor_name_raw = self._read_eeprom_specific_bytes_via_ethtool(port_num, (offset + OSFP_VENDOR_NAME_OFFSET), XCVR_VENDOR_NAME_WIDTH) - if sfp_vendor_name_raw is not None: - sfp_vendor_name_data = sfpi_obj.parse_vendor_name(sfp_vendor_name_raw, 0) - else: - return None - - sfp_vendor_pn_raw = self._read_eeprom_specific_bytes_via_ethtool(port_num, (offset + OSFP_VENDOR_PN_OFFSET), XCVR_VENDOR_PN_WIDTH) - if sfp_vendor_pn_raw is not None: - sfp_vendor_pn_data = sfpi_obj.parse_vendor_pn(sfp_vendor_pn_raw, 0) - else: - return None - - sfp_vendor_rev_raw = self._read_eeprom_specific_bytes_via_ethtool(port_num, (offset + OSFP_HW_REV_OFFSET), vendor_rev_width) - if sfp_vendor_rev_raw is not None: - sfp_vendor_rev_data = sfpi_obj.parse_vendor_rev(sfp_vendor_rev_raw, 0) - else: - return None - - sfp_vendor_sn_raw = self._read_eeprom_specific_bytes_via_ethtool(port_num, (offset + OSFP_VENDOR_SN_OFFSET), XCVR_VENDOR_SN_WIDTH) - if sfp_vendor_sn_raw is not None: - sfp_vendor_sn_data = sfpi_obj.parse_vendor_sn(sfp_vendor_sn_raw, 0) - else: - return None - - transceiver_info_dict['type'] = sfp_type_data['data']['type']['value'] - transceiver_info_dict['manufacturer'] = sfp_vendor_name_data['data']['Vendor Name']['value'] - transceiver_info_dict['model'] = sfp_vendor_pn_data['data']['Vendor PN']['value'] - transceiver_info_dict['hardware_rev'] = sfp_vendor_rev_data['data']['Vendor Rev']['value'] - transceiver_info_dict['serial'] = sfp_vendor_sn_data['data']['Vendor SN']['value'] - # Below part is added to avoid fail the xcvrd, shall be implemented later - transceiver_info_dict['vendor_oui'] = 'N/A' - transceiver_info_dict['vendor_date'] = 'N/A' - transceiver_info_dict['connector'] = 'N/A' - transceiver_info_dict['encoding'] = 'N/A' - transceiver_info_dict['ext_identifier'] = 'N/A' - transceiver_info_dict['ext_rateselect_compliance'] = 'N/A' - transceiver_info_dict['cable_type'] = 'N/A' - transceiver_info_dict['cable_length'] = 'N/A' - transceiver_info_dict['specification_compliance'] = 'N/A' - transceiver_info_dict['nominal_bit_rate'] = 'N/A' - - else: - if port_num in self.qsfp_ports: - offset = 128 - vendor_rev_width = XCVR_HW_REV_WIDTH_QSFP - interface_info_bulk_width = XCVR_INTFACE_BULK_WIDTH_QSFP - sfp_type = 'QSFP' - - sfpi_obj = sff8436InterfaceId() - if sfpi_obj is None: - print("Error: sfp_object open failed") - return None - - else: - offset = 0 - vendor_rev_width = XCVR_HW_REV_WIDTH_SFP - interface_info_bulk_width = XCVR_INTFACE_BULK_WIDTH_SFP - sfp_type = 'SFP' - - sfpi_obj = sff8472InterfaceId() - if sfpi_obj is None: - print("Error: sfp_object open failed") - return None - - sfp_interface_bulk_raw = self._read_eeprom_specific_bytes_via_ethtool(port_num, (offset + XCVR_INTFACE_BULK_OFFSET), interface_info_bulk_width) - if sfp_interface_bulk_raw is not None: - sfp_interface_bulk_data = sfpi_obj.parse_sfp_info_bulk(sfp_interface_bulk_raw, 0) - else: - return None - - sfp_vendor_name_raw = self._read_eeprom_specific_bytes_via_ethtool(port_num, (offset + XCVR_VENDOR_NAME_OFFSET), XCVR_VENDOR_NAME_WIDTH) - if sfp_vendor_name_raw is not None: - sfp_vendor_name_data = sfpi_obj.parse_vendor_name(sfp_vendor_name_raw, 0) - else: - return None - - sfp_vendor_pn_raw = self._read_eeprom_specific_bytes_via_ethtool(port_num, (offset + XCVR_VENDOR_PN_OFFSET), XCVR_VENDOR_PN_WIDTH) - if sfp_vendor_pn_raw is not None: - sfp_vendor_pn_data = sfpi_obj.parse_vendor_pn(sfp_vendor_pn_raw, 0) - else: - return None - - sfp_vendor_rev_raw = self._read_eeprom_specific_bytes_via_ethtool(port_num, (offset + XCVR_HW_REV_OFFSET), vendor_rev_width) - if sfp_vendor_rev_raw is not None: - sfp_vendor_rev_data = sfpi_obj.parse_vendor_rev(sfp_vendor_rev_raw, 0) - else: - return None - - sfp_vendor_sn_raw = self._read_eeprom_specific_bytes_via_ethtool(port_num, (offset + XCVR_VENDOR_SN_OFFSET), XCVR_VENDOR_SN_WIDTH) - if sfp_vendor_sn_raw is not None: - sfp_vendor_sn_data = sfpi_obj.parse_vendor_sn(sfp_vendor_sn_raw, 0) - else: - return None - - sfp_vendor_oui_raw = self._read_eeprom_specific_bytes_via_ethtool(port_num, (offset + XCVR_VENDOR_OUI_OFFSET), XCVR_VENDOR_OUI_WIDTH) - if sfp_vendor_oui_raw is not None: - sfp_vendor_oui_data = sfpi_obj.parse_vendor_oui(sfp_vendor_oui_raw, 0) - else: - return None - - sfp_vendor_date_raw = self._read_eeprom_specific_bytes_via_ethtool(port_num, (offset + XCVR_VENDOR_DATE_OFFSET), XCVR_VENDOR_DATE_WIDTH) - if sfp_vendor_date_raw is not None: - sfp_vendor_date_data = sfpi_obj.parse_vendor_date(sfp_vendor_date_raw, 0) - else: - return None - - transceiver_info_dict['type'] = sfp_interface_bulk_data['data']['type']['value'] - transceiver_info_dict['manufacturer'] = sfp_vendor_name_data['data']['Vendor Name']['value'] - transceiver_info_dict['model'] = sfp_vendor_pn_data['data']['Vendor PN']['value'] - transceiver_info_dict['hardware_rev'] = sfp_vendor_rev_data['data']['Vendor Rev']['value'] - transceiver_info_dict['serial'] = sfp_vendor_sn_data['data']['Vendor SN']['value'] - transceiver_info_dict['vendor_oui'] = sfp_vendor_oui_data['data']['Vendor OUI']['value'] - transceiver_info_dict['vendor_date'] = sfp_vendor_date_data['data']['VendorDataCode(YYYY-MM-DD Lot)']['value'] - transceiver_info_dict['connector'] = sfp_interface_bulk_data['data']['Connector']['value'] - transceiver_info_dict['encoding'] = sfp_interface_bulk_data['data']['EncodingCodes']['value'] - transceiver_info_dict['ext_identifier'] = sfp_interface_bulk_data['data']['Extended Identifier']['value'] - transceiver_info_dict['ext_rateselect_compliance'] = sfp_interface_bulk_data['data']['RateIdentifier']['value'] - if sfp_type == 'QSFP': - for key in qsfp_cable_length_tup: - if key in sfp_interface_bulk_data['data']: - transceiver_info_dict['cable_type'] = key - transceiver_info_dict['cable_length'] = str(sfp_interface_bulk_data['data'][key]['value']) - - for key in qsfp_compliance_code_tup: - if key in sfp_interface_bulk_data['data']['Specification compliance']['value']: - compliance_code_dict[key] = sfp_interface_bulk_data['data']['Specification compliance']['value'][key]['value'] - transceiver_info_dict['specification_compliance'] = str(compliance_code_dict) - - transceiver_info_dict['nominal_bit_rate'] = str(sfp_interface_bulk_data['data']['Nominal Bit Rate(100Mbs)']['value']) - else: - for key in sfp_cable_length_tup: - if key in sfp_interface_bulk_data['data']: - transceiver_info_dict['cable_type'] = key - transceiver_info_dict['cable_length'] = str(sfp_interface_bulk_data['data'][key]['value']) - - for key in sfp_compliance_code_tup: - if key in sfp_interface_bulk_data['data']['Specification compliance']['value']: - compliance_code_dict[key] = sfp_interface_bulk_data['data']['Specification compliance']['value'][key]['value'] - transceiver_info_dict['specification_compliance'] = str(compliance_code_dict) - - transceiver_info_dict['nominal_bit_rate'] = str(sfp_interface_bulk_data['data']['NominalSignallingRate(UnitsOf100Mbd)']['value']) - - return transceiver_info_dict - - def get_transceiver_dom_info_dict(self, port_num): - transceiver_dom_info_dict = {} - - # Below part is added to avoid failing xcvrd - # Currently, the way in which dom data is read has been changed from - # using sysfs to using ethtool. - # The ethtool returns None for ports without dom support, resulting in - # None being returned. However, this fails xcvrd to add the - # TRANSCEIVER_DOM_SENSOR table entry of associated port to CONFIG_DB - # and then causes SNMP fail. - # To address this issue a default dict is initialized with all data set to - # 'N/A' and is returned is the above case. - # BTW, in the original implementation which sysfs is used to read dom data, - # even though non-None data is returned for ports without dom support, - # it does not contain valid data. This can result in wrong data in - # TRANSCEIVER_DOM_SENSOR table. - transceiver_dom_info_dict['temperature'] = 'N/A' - transceiver_dom_info_dict['voltage'] = 'N/A' - transceiver_dom_info_dict['rx1power'] = 'N/A' - transceiver_dom_info_dict['rx2power'] = 'N/A' - transceiver_dom_info_dict['rx3power'] = 'N/A' - transceiver_dom_info_dict['rx4power'] = 'N/A' - transceiver_dom_info_dict['tx1bias'] = 'N/A' - transceiver_dom_info_dict['tx2bias'] = 'N/A' - transceiver_dom_info_dict['tx3bias'] = 'N/A' - transceiver_dom_info_dict['tx4bias'] = 'N/A' - transceiver_dom_info_dict['tx1power'] = 'N/A' - transceiver_dom_info_dict['tx2power'] = 'N/A' - transceiver_dom_info_dict['tx3power'] = 'N/A' - transceiver_dom_info_dict['tx4power'] = 'N/A' - - if port_num in self.osfp_ports: - pass - elif port_num in self.qsfp_ports: - offset = 0 - offset_xcvr = 128 - - sfpd_obj = sff8436Dom() - if sfpd_obj is None: - return None - - sfpi_obj = sff8436InterfaceId() - if sfpi_obj is None: - return None - - - # QSFP capability byte parse, through this byte can know whether it support tx_power or not. - # TODO: in the future when decided to migrate to support SFF-8636 instead of SFF-8436, - # need to add more code for determining the capability and version compliance - # in SFF-8636 dom capability definitions evolving with the versions. - qsfp_dom_capability_raw = self._read_eeprom_specific_bytes_via_ethtool(port_num, (offset_xcvr + XCVR_DOM_CAPABILITY_OFFSET), XCVR_DOM_CAPABILITY_WIDTH) - if qsfp_dom_capability_raw is not None: - qspf_dom_capability_data = sfpi_obj.parse_qsfp_dom_capability(qsfp_dom_capability_raw, 0) - else: - return transceiver_dom_info_dict - - dom_temperature_raw = self._read_eeprom_specific_bytes_via_ethtool(port_num, (offset + QSFP_TEMPE_OFFSET), QSFP_TEMPE_WIDTH) - if dom_temperature_raw is not None: - dom_temperature_data = sfpd_obj.parse_temperature(dom_temperature_raw, 0) - else: - return transceiver_dom_info_dict - - dom_voltage_raw = self._read_eeprom_specific_bytes_via_ethtool(port_num, (offset + QSFP_VOLT_OFFSET), QSFP_VOLT_WIDTH) - if dom_voltage_raw is not None: - dom_voltage_data = sfpd_obj.parse_voltage(dom_voltage_raw, 0) - else: - return transceiver_dom_info_dict - - qsfp_dom_rev_raw = self._read_eeprom_specific_bytes_via_ethtool(port_num, (offset + QSFP_DOM_REV_OFFSET), QSFP_DOM_REV_WIDTH) - if qsfp_dom_rev_raw is not None: - qsfp_dom_rev_data = sfpd_obj.parse_sfp_dom_rev(qsfp_dom_rev_raw, 0) - else: - return transceiver_dom_info_dict - - transceiver_dom_info_dict['temperature'] = dom_temperature_data['data']['Temperature']['value'] - transceiver_dom_info_dict['voltage'] = dom_voltage_data['data']['Vcc']['value'] - - # The tx_power monitoring is only available on QSFP which compliant with SFF-8636 - # and claimed that it support tx_power with one indicator bit. - dom_channel_monitor_data = {} - qsfp_dom_rev = qsfp_dom_rev_data['data']['dom_rev']['value'] - qsfp_tx_power_support = qspf_dom_capability_data['data']['Tx_power_support']['value'] - if (qsfp_dom_rev[0:8] != 'SFF-8636' or (qsfp_dom_rev[0:8] == 'SFF-8636' and qsfp_tx_power_support != 'on')): - dom_channel_monitor_raw = self._read_eeprom_specific_bytes_via_ethtool(port_num, (offset + QSFP_CHANNL_MON_OFFSET), QSFP_CHANNL_MON_WIDTH) - if dom_channel_monitor_raw is not None: - dom_channel_monitor_data = sfpd_obj.parse_channel_monitor_params(dom_channel_monitor_raw, 0) - else: - return transceiver_dom_info_dict - else: - dom_channel_monitor_raw = self._read_eeprom_specific_bytes_via_ethtool(port_num, (offset + QSFP_CHANNL_MON_OFFSET), QSFP_CHANNL_MON_WITH_TX_POWER_WIDTH) - if dom_channel_monitor_raw is not None: - dom_channel_monitor_data = sfpd_obj.parse_channel_monitor_params_with_tx_power(dom_channel_monitor_raw, 0) - else: - return transceiver_dom_info_dict - - transceiver_dom_info_dict['tx1power'] = dom_channel_monitor_data['data']['TX1Power']['value'] - transceiver_dom_info_dict['tx2power'] = dom_channel_monitor_data['data']['TX2Power']['value'] - transceiver_dom_info_dict['tx3power'] = dom_channel_monitor_data['data']['TX3Power']['value'] - transceiver_dom_info_dict['tx4power'] = dom_channel_monitor_data['data']['TX4Power']['value'] - - transceiver_dom_info_dict['temperature'] = dom_temperature_data['data']['Temperature']['value'] - transceiver_dom_info_dict['voltage'] = dom_voltage_data['data']['Vcc']['value'] - transceiver_dom_info_dict['rx1power'] = dom_channel_monitor_data['data']['RX1Power']['value'] - transceiver_dom_info_dict['rx2power'] = dom_channel_monitor_data['data']['RX2Power']['value'] - transceiver_dom_info_dict['rx3power'] = dom_channel_monitor_data['data']['RX3Power']['value'] - transceiver_dom_info_dict['rx4power'] = dom_channel_monitor_data['data']['RX4Power']['value'] - transceiver_dom_info_dict['tx1bias'] = dom_channel_monitor_data['data']['TX1Bias']['value'] - transceiver_dom_info_dict['tx2bias'] = dom_channel_monitor_data['data']['TX2Bias']['value'] - transceiver_dom_info_dict['tx3bias'] = dom_channel_monitor_data['data']['TX3Bias']['value'] - transceiver_dom_info_dict['tx4bias'] = dom_channel_monitor_data['data']['TX4Bias']['value'] - - else: - offset = SFP_I2C_PAGE_SIZE - - eeprom_raw = ['0'] * SFP_I2C_PAGE_SIZE - eeprom_raw[XCVR_DOM_CAPABILITY_OFFSET : XCVR_DOM_CAPABILITY_OFFSET + XCVR_DOM_CAPABILITY_WIDTH] = \ - self._read_eeprom_specific_bytes_via_ethtool(port_num, XCVR_DOM_CAPABILITY_OFFSET, XCVR_DOM_CAPABILITY_WIDTH) - sfp_obj = sff8472InterfaceId() - calibration_type = sfp_obj._get_calibration_type(eeprom_raw) - - dom_supported = (int(eeprom_raw[XCVR_DOM_CAPABILITY_OFFSET], 16) & XCVR_DOM_CAPABILITY_DOM_SUPPORT_BIT != 0) - if not dom_supported: - return transceiver_dom_info_dict - - eeprom_domraw = self._read_eeprom_specific_bytes_via_ethtool(port_num, offset, SFP_I2C_PAGE_SIZE) - if eeprom_domraw is None: - return transceiver_dom_info_dict - - sfpd_obj = sff8472Dom(None, calibration_type) - if sfpd_obj is None: - print "no sff8472Dom" - return None - - dom_temperature_raw = eeprom_domraw[SFP_TEMPE_OFFSET:SFP_TEMPE_OFFSET+SFP_TEMPE_WIDTH] - dom_temperature_data = sfpd_obj.parse_temperature(dom_temperature_raw, 0) - - dom_voltage_raw = eeprom_domraw[SFP_VOLT_OFFSET:SFP_VOLT_OFFSET+SFP_VOLT_WIDTH] - dom_voltage_data = sfpd_obj.parse_voltage(dom_voltage_raw, 0) - - dom_channel_monitor_raw = eeprom_domraw[SFP_CHANNL_MON_OFFSET:SFP_CHANNL_MON_OFFSET+SFP_CHANNL_MON_WIDTH] - dom_channel_monitor_data = sfpd_obj.parse_channel_monitor_params(dom_channel_monitor_raw, 0) - - transceiver_dom_info_dict['temperature'] = dom_temperature_data['data']['Temperature']['value'] - transceiver_dom_info_dict['voltage'] = dom_voltage_data['data']['Vcc']['value'] - transceiver_dom_info_dict['rx1power'] = dom_channel_monitor_data['data']['RXPower']['value'] - transceiver_dom_info_dict['tx1bias'] = dom_channel_monitor_data['data']['TXBias']['value'] - transceiver_dom_info_dict['tx1power'] = dom_channel_monitor_data['data']['TXPower']['value'] - - return transceiver_dom_info_dict - - def get_transceiver_dom_threshold_info_dict(self, port_num): - transceiver_dom_threshold_info_dict = {} - - dom_info_dict_keys = ['temphighalarm', 'temphighwarning', - 'templowalarm', 'templowwarning', - 'vcchighalarm', 'vcchighwarning', - 'vcclowalarm', 'vcclowwarning', - 'rxpowerhighalarm', 'rxpowerhighwarning', - 'rxpowerlowalarm', 'rxpowerlowwarning', - 'txpowerhighalarm', 'txpowerhighwarning', - 'txpowerlowalarm', 'txpowerlowwarning', - 'txbiashighalarm', 'txbiashighwarning', - 'txbiaslowalarm', 'txbiaslowwarning' - ] - transceiver_dom_threshold_info_dict = dict.fromkeys(dom_info_dict_keys, 'N/A') - - if port_num in self.qsfp_ports: - # current we don't support qsfp since threshold data is on page 3 and the way to read this page is under discussion. - return transceiver_dom_threshold_info_dict - else: - offset = SFP_I2C_PAGE_SIZE - - eeprom_raw = ['0'] * SFP_I2C_PAGE_SIZE - eeprom_raw[XCVR_DOM_CAPABILITY_OFFSET : XCVR_DOM_CAPABILITY_OFFSET + XCVR_DOM_CAPABILITY_WIDTH] = \ - self._read_eeprom_specific_bytes_via_ethtool(port_num, XCVR_DOM_CAPABILITY_OFFSET, XCVR_DOM_CAPABILITY_WIDTH) - sfp_obj = sff8472InterfaceId() - calibration_type = sfp_obj._get_calibration_type(eeprom_raw) - - dom_supported = (int(eeprom_raw[XCVR_DOM_CAPABILITY_OFFSET], 16) & XCVR_DOM_CAPABILITY_DOM_SUPPORT_BIT != 0) - if not dom_supported: - return transceiver_dom_threshold_info_dict - - sfpd_obj = sff8472Dom(None, calibration_type) - if sfpd_obj is None: - return transceiver_dom_threshold_info_dict - - dom_module_threshold_raw = self._read_eeprom_specific_bytes_via_ethtool(port_num, - (offset + SFP_MODULE_THRESHOLD_OFFSET), - SFP_MODULE_THRESHOLD_WIDTH) - if dom_module_threshold_raw is not None: - dom_module_threshold_data = sfpd_obj.parse_alarm_warning_threshold(dom_module_threshold_raw, 0) - else: - return transceiver_dom_threshold_info_dict - - # Threshold Data - transceiver_dom_threshold_info_dict['temphighalarm'] = dom_module_threshold_data['data']['TempHighAlarm']['value'] - transceiver_dom_threshold_info_dict['templowalarm'] = dom_module_threshold_data['data']['TempLowAlarm']['value'] - transceiver_dom_threshold_info_dict['temphighwarning'] = dom_module_threshold_data['data']['TempHighWarning']['value'] - transceiver_dom_threshold_info_dict['templowwarning'] = dom_module_threshold_data['data']['TempLowWarning']['value'] - transceiver_dom_threshold_info_dict['vcchighalarm'] = dom_module_threshold_data['data']['VoltageHighAlarm']['value'] - transceiver_dom_threshold_info_dict['vcclowalarm'] = dom_module_threshold_data['data']['VoltageLowAlarm']['value'] - transceiver_dom_threshold_info_dict['vcchighwarning'] = dom_module_threshold_data['data']['VoltageHighWarning']['value'] - transceiver_dom_threshold_info_dict['vcclowwarning'] = dom_module_threshold_data['data']['VoltageLowWarning']['value'] - transceiver_dom_threshold_info_dict['txbiashighalarm'] = dom_module_threshold_data['data']['BiasHighAlarm']['value'] - transceiver_dom_threshold_info_dict['txbiaslowalarm'] = dom_module_threshold_data['data']['BiasLowAlarm']['value'] - transceiver_dom_threshold_info_dict['txbiashighwarning'] = dom_module_threshold_data['data']['BiasHighWarning']['value'] - transceiver_dom_threshold_info_dict['txbiaslowwarning'] = dom_module_threshold_data['data']['BiasLowWarning']['value'] - transceiver_dom_threshold_info_dict['txpowerhighalarm'] = dom_module_threshold_data['data']['TXPowerHighAlarm']['value'] - transceiver_dom_threshold_info_dict['txpowerlowalarm'] = dom_module_threshold_data['data']['TXPowerLowAlarm']['value'] - transceiver_dom_threshold_info_dict['txpowerhighwarning'] = dom_module_threshold_data['data']['TXPowerHighWarning']['value'] - transceiver_dom_threshold_info_dict['txpowerlowwarning'] = dom_module_threshold_data['data']['TXPowerLowWarning']['value'] - transceiver_dom_threshold_info_dict['rxpowerhighalarm'] = dom_module_threshold_data['data']['RXPowerHighAlarm']['value'] - transceiver_dom_threshold_info_dict['rxpowerlowalarm'] = dom_module_threshold_data['data']['RXPowerLowAlarm']['value'] - transceiver_dom_threshold_info_dict['rxpowerhighwarning'] = dom_module_threshold_data['data']['RXPowerHighWarning']['value'] - transceiver_dom_threshold_info_dict['rxpowerlowwarning'] = dom_module_threshold_data['data']['RXPowerLowWarning']['value'] - - return transceiver_dom_threshold_info_dict diff --git a/device/mellanox/x86_64-mlnx_msn4410-r0/plugins/sfputil.py b/device/mellanox/x86_64-mlnx_msn4410-r0/plugins/sfputil.py new file mode 120000 index 000000000000..45909b880fc9 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4410-r0/plugins/sfputil.py @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/plugins/sfputil.py \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4410-r0/sensors.conf.a1 b/device/mellanox/x86_64-mlnx_msn4410-r0/sensors.conf.a1 new file mode 120000 index 000000000000..4605d556f315 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4410-r0/sensors.conf.a1 @@ -0,0 +1 @@ +../x86_64-mlnx_msn4700-r0/sensors.conf.a1 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4600-r0/ACS-MSN4600/buffers.json.j2 b/device/mellanox/x86_64-mlnx_msn4600-r0/ACS-MSN4600/buffers.json.j2 new file mode 120000 index 000000000000..f46e9600153b --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600-r0/ACS-MSN4600/buffers.json.j2 @@ -0,0 +1 @@ +../../x86_64-mlnx_msn4700-r0/ACS-MSN4700/buffers.json.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4600-r0/ACS-MSN4600/buffers_defaults_objects.j2 b/device/mellanox/x86_64-mlnx_msn4600-r0/ACS-MSN4600/buffers_defaults_objects.j2 new file mode 120000 index 000000000000..33b6704f9902 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600-r0/ACS-MSN4600/buffers_defaults_objects.j2 @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/ACS-MSN2700/buffers_defaults_objects.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4600-r0/ACS-MSN4600/buffers_defaults_t0.j2 b/device/mellanox/x86_64-mlnx_msn4600-r0/ACS-MSN4600/buffers_defaults_t0.j2 new file mode 120000 index 000000000000..ddb883a1daa4 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600-r0/ACS-MSN4600/buffers_defaults_t0.j2 @@ -0,0 +1 @@ +../../x86_64-mlnx_msn4700-r0/ACS-MSN4700/buffers_defaults_t0.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4600-r0/ACS-MSN4600/buffers_defaults_t1.j2 b/device/mellanox/x86_64-mlnx_msn4600-r0/ACS-MSN4600/buffers_defaults_t1.j2 new file mode 120000 index 000000000000..f8bbb6e631e7 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600-r0/ACS-MSN4600/buffers_defaults_t1.j2 @@ -0,0 +1 @@ +../../x86_64-mlnx_msn4700-r0/ACS-MSN4700/buffers_defaults_t1.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4600-r0/ACS-MSN4600/buffers_dynamic.json.j2 b/device/mellanox/x86_64-mlnx_msn4600-r0/ACS-MSN4600/buffers_dynamic.json.j2 new file mode 120000 index 000000000000..8c4117c66214 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600-r0/ACS-MSN4600/buffers_dynamic.json.j2 @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/ACS-MSN2700/buffers_dynamic.json.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4600-r0/ACS-MSN4600/pg_profile_lookup.ini b/device/mellanox/x86_64-mlnx_msn4600-r0/ACS-MSN4600/pg_profile_lookup.ini new file mode 120000 index 000000000000..88e51ceae044 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600-r0/ACS-MSN4600/pg_profile_lookup.ini @@ -0,0 +1 @@ +../../x86_64-mlnx_msn4700-r0/ACS-MSN4700/pg_profile_lookup.ini \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4600-r0/ACS-MSN4600/port_config.ini b/device/mellanox/x86_64-mlnx_msn4600-r0/ACS-MSN4600/port_config.ini new file mode 100644 index 000000000000..2e6212ef692c --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600-r0/ACS-MSN4600/port_config.ini @@ -0,0 +1,65 @@ +# name lanes alias index +Ethernet0 0,1,2,3 etp1 1 +Ethernet4 8,9,10,11 etp2 2 +Ethernet8 16,17,18,19 etp3 3 +Ethernet12 24,25,26,27 etp4 4 +Ethernet16 32,33,34,35 etp5 5 +Ethernet20 40,41,42,43 etp6 6 +Ethernet24 48,49,50,51 etp7 7 +Ethernet28 56,57,58,59 etp8 8 +Ethernet32 64,65,66,67 etp9 9 +Ethernet36 72,73,74,75 etp10 10 +Ethernet40 80,81,82,83 etp11 11 +Ethernet44 88,89,90,91 etp12 12 +Ethernet48 96,97,98,99 etp13 13 +Ethernet52 104,105,106,107 etp14 14 +Ethernet56 112,113,114,115 etp15 15 +Ethernet60 120,121,122,123 etp16 16 +Ethernet64 128,129,130,131 etp17 17 +Ethernet68 136,137,138,139 etp18 18 +Ethernet72 144,145,146,147 etp19 19 +Ethernet76 152,153,154,155 etp20 20 +Ethernet80 160,161,162,163 etp21 21 +Ethernet84 168,169,170,171 etp22 22 +Ethernet88 176,177,178,179 etp23 23 +Ethernet92 184,185,186,187 etp24 24 +Ethernet96 192,193,194,195 etp25 25 +Ethernet100 200,201,202,203 etp26 26 +Ethernet104 208,209,210,211 etp27 27 +Ethernet108 216,217,218,219 etp28 28 +Ethernet112 224,225,226,227 etp29 29 +Ethernet116 232,233,234,235 etp30 30 +Ethernet120 240,241,242,243 etp31 31 +Ethernet124 248,249,250,251 etp32 32 +Ethernet128 256,257,258,259 etp33 33 +Ethernet132 264,265,266,267 etp34 34 +Ethernet136 272,273,274,275 etp35 35 +Ethernet140 280,281,282,283 etp36 36 +Ethernet144 288,289,290,291 etp37 37 +Ethernet148 296,297,298,299 etp38 38 +Ethernet152 304,305,306,307 etp39 39 +Ethernet156 312,313,314,315 etp40 40 +Ethernet160 320,321,322,323 etp41 41 +Ethernet164 328,329,330,331 etp42 42 +Ethernet168 336,337,338,339 etp43 43 +Ethernet172 344,345,346,347 etp44 44 +Ethernet176 352,353,354,355 etp45 45 +Ethernet180 360,361,362,363 etp46 46 +Ethernet184 368,369,370,371 etp47 47 +Ethernet188 376,377,378,379 etp48 48 +Ethernet192 384,385,386,387 etp49 49 +Ethernet196 392,393,394,395 etp50 50 +Ethernet200 400,401,402,403 etp51 51 +Ethernet204 408,409,410,411 etp52 52 +Ethernet208 416,417,418,419 etp53 53 +Ethernet212 424,425,426,427 etp54 54 +Ethernet216 432,433,434,435 etp55 55 +Ethernet220 440,441,442,443 etp56 56 +Ethernet224 448,449,450,451 etp57 57 +Ethernet228 456,457,458,459 etp58 58 +Ethernet232 464,465,466,467 etp59 59 +Ethernet236 472,473,474,475 etp60 60 +Ethernet240 480,481,482,483 etp61 61 +Ethernet244 488,489,490,491 etp62 62 +Ethernet248 496,497,498,499 etp63 63 +Ethernet252 504,505,506,507 etp64 64 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4600-r0/ACS-MSN4600/qos.json.j2 b/device/mellanox/x86_64-mlnx_msn4600-r0/ACS-MSN4600/qos.json.j2 new file mode 120000 index 000000000000..8633303ece77 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600-r0/ACS-MSN4600/qos.json.j2 @@ -0,0 +1 @@ +../../x86_64-mlnx_msn4700-r0/ACS-MSN4700/qos.json.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4600-r0/ACS-MSN4600/sai.profile b/device/mellanox/x86_64-mlnx_msn4600-r0/ACS-MSN4600/sai.profile new file mode 100644 index 000000000000..8dc29d810f8e --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600-r0/ACS-MSN4600/sai.profile @@ -0,0 +1,3 @@ +SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_4600.xml +SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps +SAI_DUMP_STORE_AMOUNT=10 diff --git a/device/mellanox/x86_64-mlnx_msn4600-r0/ACS-MSN4600/sai_4600.xml b/device/mellanox/x86_64-mlnx_msn4600-r0/ACS-MSN4600/sai_4600.xml new file mode 100644 index 000000000000..96e09ce694f5 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600-r0/ACS-MSN4600/sai_4600.xml @@ -0,0 +1,471 @@ + + + + + + 00:02:03:04:05:80 + + + 1 + + + 64 + + + + + 105 + 4 + 0 + + + 3 + + + 4096 + + + 107 + 4 + 1 + 3 + 4096 + + + 109 + 4 + 2 + 3 + 4096 + + + 111 + 4 + 3 + 3 + 4096 + + + 97 + 4 + 4 + 3 + 4096 + + + 99 + 4 + 5 + 3 + 4096 + + + 101 + 4 + 6 + 3 + 4096 + + + 103 + 4 + 7 + 3 + 4096 + + + 121 + 4 + 8 + 3 + 4096 + + + 123 + 4 + 9 + 3 + 4096 + + + 125 + 4 + 10 + 3 + 4096 + + + 127 + 4 + 11 + 3 + 4096 + + + 113 + 4 + 12 + 3 + 4096 + + + 115 + 4 + 13 + 3 + 4096 + + + 117 + 4 + 14 + 3 + 4096 + + + 119 + 4 + 15 + 3 + 4096 + + + 89 + 4 + 16 + 3 + 4096 + + + 91 + 4 + 17 + 3 + 4096 + + + 93 + 4 + 18 + 3 + 4096 + + + 95 + 4 + 19 + 3 + 4096 + + + 81 + 4 + 20 + 3 + 4096 + + + 83 + 4 + 21 + 3 + 4096 + + + 85 + 4 + 22 + 3 + 4096 + + + 87 + 4 + 23 + 3 + 4096 + + + 73 + 4 + 24 + 3 + 4096 + + + 75 + 4 + 25 + 3 + 4096 + + + 77 + 4 + 26 + 3 + 4096 + + + 79 + 4 + 27 + 3 + 4096 + + + 65 + 4 + 28 + 3 + 4096 + + + 67 + 4 + 29 + 3 + 4096 + + + 69 + 4 + 30 + 3 + 4096 + + + 71 + 4 + 31 + 3 + 4096 + + + 5 + 4 + 32 + 3 + 4096 + + + 7 + 4 + 33 + 3 + 4096 + + + 1 + 4 + 34 + 3 + 4096 + + + 3 + 4 + 35 + 3 + 4096 + + + 13 + 4 + 36 + 3 + 4096 + + + 15 + 4 + 37 + 3 + 4096 + + + 9 + 4 + 38 + 3 + 4096 + + + 11 + 4 + 39 + 3 + 4096 + + + 21 + 4 + 40 + 3 + 4096 + + + 23 + 4 + 41 + 3 + 4096 + + + 17 + 4 + 42 + 3 + 4096 + + + 19 + 4 + 43 + 3 + 4096 + + + 29 + 4 + 44 + 3 + 4096 + + + 31 + 4 + 45 + 3 + 4096 + + + 25 + 4 + 46 + 3 + 4096 + + + 27 + 4 + 47 + 3 + 4096 + + + 53 + 4 + 48 + 3 + 4096 + + + 55 + 4 + 49 + 3 + 4096 + + + 49 + 4 + 50 + 3 + 4096 + + + 51 + 4 + 51 + 3 + 4096 + + + 61 + 4 + 52 + 3 + 4096 + + + 63 + 4 + 53 + 3 + 4096 + + + 57 + 4 + 54 + 3 + 4096 + + + 59 + 4 + 55 + 3 + 4096 + + + 37 + 4 + 56 + 3 + 4096 + + + 39 + 4 + 57 + 3 + 4096 + + + 33 + 4 + 58 + 3 + 4096 + + + 35 + 4 + 59 + 3 + 4096 + + + 45 + 4 + 60 + 3 + 4096 + + + 47 + 4 + 61 + 3 + 4096 + + + 41 + 4 + 62 + 3 + 4096 + + + 43 + 4 + 63 + 3 + 4096 + + + + + diff --git a/device/mellanox/x86_64-mlnx_msn4600-r0/default_sku b/device/mellanox/x86_64-mlnx_msn4600-r0/default_sku new file mode 100644 index 000000000000..08921eaa2578 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600-r0/default_sku @@ -0,0 +1 @@ +ACS-MSN4600 t1 diff --git a/device/mellanox/x86_64-mlnx_msn4600-r0/get_sensors_conf_path b/device/mellanox/x86_64-mlnx_msn4600-r0/get_sensors_conf_path new file mode 120000 index 000000000000..f1509a1e1d3d --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600-r0/get_sensors_conf_path @@ -0,0 +1 @@ +../x86_64-mlnx_msn4700-r0/get_sensors_conf_path \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4600-r0/pcie.yaml b/device/mellanox/x86_64-mlnx_msn4600-r0/pcie.yaml new file mode 100644 index 000000000000..d110ef7c79cb --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600-r0/pcie.yaml @@ -0,0 +1,419 @@ +- bus: '00' + dev: '00' + fn: '0' + id: 6f00 + name: 'Host bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D DMI2 + (rev 03)' +- bus: '00' + dev: '01' + fn: '0' + id: 6f02 + name: 'PCI bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D PCI + Express Root Port 1 (rev 03)' +- bus: '00' + dev: '01' + fn: '1' + id: 6f03 + name: 'PCI bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D PCI + Express Root Port 1 (rev 03)' +- bus: '00' + dev: '02' + fn: '0' + id: 6f04 + name: 'PCI bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D PCI + Express Root Port 2 (rev 03)' +- bus: '00' + dev: '02' + fn: '2' + id: 6f06 + name: 'PCI bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D PCI + Express Root Port 2 (rev 03)' +- bus: '00' + dev: '03' + fn: '0' + id: 6f08 + name: 'PCI bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D PCI + Express Root Port 3 (rev 03)' +- bus: '00' + dev: '03' + fn: '2' + id: 6f0a + name: 'PCI bridge: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D PCI + Express Root Port 3 (rev 03)' +- bus: '00' + dev: '05' + fn: '0' + id: 6f28 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Map/VTd_Misc/System Management (rev 03)' +- bus: '00' + dev: '05' + fn: '1' + id: 6f29 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D IIO Hot Plug (rev 03)' +- bus: '00' + dev: '05' + fn: '2' + id: 6f2a + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D IIO RAS/Control Status/Global Errors (rev 03)' +- bus: '00' + dev: '05' + fn: '4' + id: 6f2c + name: 'PIC: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D I/O APIC (rev + 03)' +- bus: '00' + dev: '14' + fn: '0' + id: 8c31 + name: 'USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB + xHCI (rev 05)' +- bus: '00' + dev: '1c' + fn: '0' + id: 8c10 + name: 'PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express + Root Port #1 (rev d5)' +- bus: '00' + dev: '1c' + fn: '7' + id: 8c1e + name: 'PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express + Root Port #8 (rev d5)' +- bus: '00' + dev: '1d' + fn: '0' + id: 8c26 + name: 'USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB + EHCI #1 (rev 05)' +- bus: '00' + dev: '1f' + fn: '0' + id: 8c54 + name: 'ISA bridge: Intel Corporation C224 Series Chipset Family Server Standard + SKU LPC Controller (rev 05)' +- bus: '00' + dev: '1f' + fn: '2' + id: 8c02 + name: 'SATA controller: Intel Corporation 8 Series/C220 Series Chipset Family 6-port + SATA Controller 1 [AHCI mode] (rev 05)' +- bus: '00' + dev: '1f' + fn: '3' + id: 8c22 + name: 'SMBus: Intel Corporation 8 Series/C220 Series Chipset Family SMBus Controller + (rev 05)' +- bus: '03' + dev: '00' + fn: '0' + id: 6f50 + name: 'System peripheral: Intel Corporation Xeon Processor D Family QuickData Technology + Register DMA Channel 0' +- bus: '03' + dev: '00' + fn: '1' + id: 6f51 + name: 'System peripheral: Intel Corporation Xeon Processor D Family QuickData Technology + Register DMA Channel 1' +- bus: '03' + dev: '00' + fn: '2' + id: 6f52 + name: 'System peripheral: Intel Corporation Xeon Processor D Family QuickData Technology + Register DMA Channel 2' +- bus: '03' + dev: '00' + fn: '3' + id: 6f53 + name: 'System peripheral: Intel Corporation Xeon Processor D Family QuickData Technology + Register DMA Channel 3' +- bus: '07' + dev: '00' + fn: '0' + id: cf70 + name: 'Ethernet controller: Mellanox Technologies Device cf70' +- bus: '09' + dev: '00' + fn: '0' + id: 1533 + name: 'Ethernet controller: Intel Corporation I210 Gigabit Network Connection (rev + 03)' +- bus: 'ff' + dev: '0b' + fn: '0' + id: 6f81 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D R3 QPI Link 0/1 (rev 03)' +- bus: 'ff' + dev: '0b' + fn: '1' + id: 6f36 + name: 'Performance counters: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D R3 QPI Link 0/1 (rev 03)' +- bus: 'ff' + dev: '0b' + fn: '2' + id: 6f37 + name: 'Performance counters: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D R3 QPI Link 0/1 (rev 03)' +- bus: 'ff' + dev: '0b' + fn: '3' + id: 6f76 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D R3 QPI Link Debug (rev 03)' +- bus: 'ff' + dev: '0c' + fn: '0' + id: 6fe0 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: 'ff' + dev: '0c' + fn: '1' + id: 6fe1 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: 'ff' + dev: '0c' + fn: '2' + id: 6fe2 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: 'ff' + dev: '0c' + fn: '3' + id: 6fe3 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: 'ff' + dev: '0f' + fn: '0' + id: 6ff8 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: 'ff' + dev: '0f' + fn: '4' + id: 6ffc + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: 'ff' + dev: '0f' + fn: '5' + id: 6ffd + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: 'ff' + dev: '0f' + fn: '6' + id: 6ffe + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Caching Agent (rev 03)' +- bus: 'ff' + dev: '10' + fn: '0' + id: 6f1d + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D R2PCIe Agent (rev 03)' +- bus: 'ff' + dev: '10' + fn: '1' + id: 6f34 + name: 'Performance counters: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D R2PCIe Agent (rev 03)' +- bus: 'ff' + dev: '10' + fn: '5' + id: 6f1e + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Ubox (rev 03)' +- bus: 'ff' + dev: '10' + fn: '6' + id: 6f7d + name: 'Performance counters: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Ubox (rev 03)' +- bus: 'ff' + dev: '10' + fn: '7' + id: 6f1f + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Ubox (rev 03)' +- bus: 'ff' + dev: '12' + fn: '0' + id: 6fa0 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Home Agent 0 (rev 03)' +- bus: 'ff' + dev: '12' + fn: '1' + id: 6f30 + name: 'Performance counters: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Home Agent 0 (rev 03)' +- bus: 'ff' + dev: '13' + fn: '0' + id: 6fa8 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Target Address/Thermal/RAS (rev 03)' +- bus: 'ff' + dev: '13' + fn: '1' + id: 6f71 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Target Address/Thermal/RAS (rev 03)' +- bus: 'ff' + dev: '13' + fn: '2' + id: 6faa + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel Target Address Decoder (rev 03)' +- bus: 'ff' + dev: '13' + fn: '3' + id: 6fab + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel Target Address Decoder (rev 03)' +- bus: 'ff' + dev: '13' + fn: '4' + id: 6fac + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel Target Address Decoder (rev 03)' +- bus: 'ff' + dev: '13' + fn: '5' + id: 6fad + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel Target Address Decoder (rev 03)' +- bus: 'ff' + dev: '13' + fn: '6' + id: 6fae + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D DDRIO Channel 0/1 Broadcast (rev 03)' +- bus: 'ff' + dev: '13' + fn: '7' + id: 6faf + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D DDRIO Global Broadcast (rev 03)' +- bus: 'ff' + dev: '14' + fn: '0' + id: 6fb0 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 0 Thermal Control (rev 03)' +- bus: 'ff' + dev: '14' + fn: '1' + id: 6fb1 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 1 Thermal Control (rev 03)' +- bus: 'ff' + dev: '14' + fn: '2' + id: 6fb2 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 0 Error (rev 03)' +- bus: 'ff' + dev: '14' + fn: '3' + id: 6fb3 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 1 Error (rev 03)' +- bus: 'ff' + dev: '14' + fn: '4' + id: 6fbc + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D DDRIO Channel 0/1 Interface (rev 03)' +- bus: 'ff' + dev: '14' + fn: '5' + id: 6fbd + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D DDRIO Channel 0/1 Interface (rev 03)' +- bus: 'ff' + dev: '14' + fn: '6' + id: 6fbe + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D DDRIO Channel 0/1 Interface (rev 03)' +- bus: 'ff' + dev: '14' + fn: '7' + id: 6fbf + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D DDRIO Channel 0/1 Interface (rev 03)' +- bus: 'ff' + dev: '15' + fn: '0' + id: 6fb4 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 2 Thermal Control (rev 03)' +- bus: 'ff' + dev: '15' + fn: '1' + id: 6fb5 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 3 Thermal Control (rev 03)' +- bus: 'ff' + dev: '15' + fn: '2' + id: 6fb6 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 2 Error (rev 03)' +- bus: 'ff' + dev: '15' + fn: '3' + id: 6fb7 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Memory Controller 0 - Channel 3 Error (rev 03)' +- bus: 'ff' + dev: '1e' + fn: '0' + id: 6f98 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Power Control Unit (rev 03)' +- bus: 'ff' + dev: '1e' + fn: '1' + id: 6f99 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Power Control Unit (rev 03)' +- bus: 'ff' + dev: '1e' + fn: '2' + id: 6f9a + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Power Control Unit (rev 03)' +- bus: 'ff' + dev: '1e' + fn: '3' + id: 6fc0 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Power Control Unit (rev 03)' +- bus: 'ff' + dev: '1e' + fn: '4' + id: 6f9c + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Power Control Unit (rev 03)' +- bus: 'ff' + dev: '1f' + fn: '0' + id: 6f88 + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Power Control Unit (rev 03)' +- bus: 'ff' + dev: '1f' + fn: '2' + id: 6f8a + name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon + D Power Control Unit (rev 03)' diff --git a/device/mellanox/x86_64-mlnx_msn4600-r0/platform.json b/device/mellanox/x86_64-mlnx_msn4600-r0/platform.json new file mode 100644 index 000000000000..fa31d5509c45 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600-r0/platform.json @@ -0,0 +1,624 @@ +{ + "chassis": { + "name": "MSN4600", + "components": [ + { + "name": "ONIE" + }, + { + "name": "SSD" + }, + { + "name": "BIOS" + }, + { + "name": "CPLD1" + }, + { + "name": "CPLD2" + }, + { + "name": "CPLD3" + } + ], + "fans": [], + "fan_drawers": [ + { + "name": "drawer1", + "fans": [ + { + "name": "fan1" + } + ] + }, + { + "name": "drawer2", + "fans": [ + { + "name": "fan2" + } + ] + }, + { + "name": "drawer3", + "fans": [ + { + "name": "fan3" + } + ] + } + ], + "psus": [ + { + "name": "PSU 1", + "fans": [ + { + "name": "psu1_fan1" + } + ], + "thermals": [ + { + "name": "PSU-1 Temp" + } + ] + }, + { + "name": "PSU 2", + "fans": [ + { + "name": "psu2_fan1" + } + ], + "thermals": [ + { + "name": "PSU-2 Temp" + } + ] + } + ], + "thermals": [ + { + "name": "ASIC" + }, + { + "name": "Ambient COMEX Temp" + }, + { + "name": "Ambient Fan Side Temp" + }, + { + "name": "Ambient Port Side Temp" + }, + { + "name": "CPU Core 0 Temp" + }, + { + "name": "CPU Core 1 Temp" + }, + { + "name": "CPU Core 2 Temp" + }, + { + "name": "CPU Core 3 Temp" + }, + { + "name": "CPU Pack Temp" + } + ], + "sfps": [ + { + "name": "sfp1", + "thermals": [ + { + "name": "xSFP module 1 Temp" + } + ] + }, + { + "name": "sfp2", + "thermals": [ + { + "name": "xSFP module 2 Temp" + } + ] + }, + { + "name": "sfp3", + "thermals": [ + { + "name": "xSFP module 3 Temp" + } + ] + }, + { + "name": "sfp4", + "thermals": [ + { + "name": "xSFP module 4 Temp" + } + ] + }, + { + "name": "sfp5", + "thermals": [ + { + "name": "xSFP module 5 Temp" + } + ] + }, + { + "name": "sfp6", + "thermals": [ + { + "name": "xSFP module 6 Temp" + } + ] + }, + { + "name": "sfp7", + "thermals": [ + { + "name": "xSFP module 7 Temp" + } + ] + }, + { + "name": "sfp8", + "thermals": [ + { + "name": "xSFP module 8 Temp" + } + ] + }, + { + "name": "sfp9", + "thermals": [ + { + "name": "xSFP module 9 Temp" + } + ] + }, + { + "name": "sfp10", + "thermals": [ + { + "name": "xSFP module 10 Temp" + } + ] + }, + { + "name": "sfp11", + "thermals": [ + { + "name": "xSFP module 11 Temp" + } + ] + }, + { + "name": "sfp12", + "thermals": [ + { + "name": "xSFP module 12 Temp" + } + ] + }, + { + "name": "sfp13", + "thermals": [ + { + "name": "xSFP module 13 Temp" + } + ] + }, + { + "name": "sfp14", + "thermals": [ + { + "name": "xSFP module 14 Temp" + } + ] + }, + { + "name": "sfp15", + "thermals": [ + { + "name": "xSFP module 15 Temp" + } + ] + }, + { + "name": "sfp16", + "thermals": [ + { + "name": "xSFP module 16 Temp" + } + ] + }, + { + "name": "sfp17", + "thermals": [ + { + "name": "xSFP module 17 Temp" + } + ] + }, + { + "name": "sfp18", + "thermals": [ + { + "name": "xSFP module 18 Temp" + } + ] + }, + { + "name": "sfp19", + "thermals": [ + { + "name": "xSFP module 19 Temp" + } + ] + }, + { + "name": "sfp20", + "thermals": [ + { + "name": "xSFP module 20 Temp" + } + ] + }, + { + "name": "sfp21", + "thermals": [ + { + "name": "xSFP module 21 Temp" + } + ] + }, + { + "name": "sfp22", + "thermals": [ + { + "name": "xSFP module 22 Temp" + } + ] + }, + { + "name": "sfp23", + "thermals": [ + { + "name": "xSFP module 23 Temp" + } + ] + }, + { + "name": "sfp24", + "thermals": [ + { + "name": "xSFP module 24 Temp" + } + ] + }, + { + "name": "sfp25", + "thermals": [ + { + "name": "xSFP module 25 Temp" + } + ] + }, + { + "name": "sfp26", + "thermals": [ + { + "name": "xSFP module 26 Temp" + } + ] + }, + { + "name": "sfp27", + "thermals": [ + { + "name": "xSFP module 27 Temp" + } + ] + }, + { + "name": "sfp28", + "thermals": [ + { + "name": "xSFP module 28 Temp" + } + ] + }, + { + "name": "sfp29", + "thermals": [ + { + "name": "xSFP module 29 Temp" + } + ] + }, + { + "name": "sfp30", + "thermals": [ + { + "name": "xSFP module 30 Temp" + } + ] + }, + { + "name": "sfp31", + "thermals": [ + { + "name": "xSFP module 31 Temp" + } + ] + }, + { + "name": "sfp32", + "thermals": [ + { + "name": "xSFP module 32 Temp" + } + ] + }, + { + "name": "sfp33", + "thermals": [ + { + "name": "xSFP module 33 Temp" + } + ] + }, + { + "name": "sfp34", + "thermals": [ + { + "name": "xSFP module 34 Temp" + } + ] + }, + { + "name": "sfp35", + "thermals": [ + { + "name": "xSFP module 35 Temp" + } + ] + }, + { + "name": "sfp36", + "thermals": [ + { + "name": "xSFP module 36 Temp" + } + ] + }, + { + "name": "sfp37", + "thermals": [ + { + "name": "xSFP module 37 Temp" + } + ] + }, + { + "name": "sfp38", + "thermals": [ + { + "name": "xSFP module 38 Temp" + } + ] + }, + { + "name": "sfp39", + "thermals": [ + { + "name": "xSFP module 39 Temp" + } + ] + }, + { + "name": "sfp40", + "thermals": [ + { + "name": "xSFP module 40 Temp" + } + ] + }, + { + "name": "sfp41", + "thermals": [ + { + "name": "xSFP module 41 Temp" + } + ] + }, + { + "name": "sfp42", + "thermals": [ + { + "name": "xSFP module 42 Temp" + } + ] + }, + { + "name": "sfp43", + "thermals": [ + { + "name": "xSFP module 43 Temp" + } + ] + }, + { + "name": "sfp44", + "thermals": [ + { + "name": "xSFP module 44 Temp" + } + ] + }, + { + "name": "sfp45", + "thermals": [ + { + "name": "xSFP module 45 Temp" + } + ] + }, + { + "name": "sfp46", + "thermals": [ + { + "name": "xSFP module 46 Temp" + } + ] + }, + { + "name": "sfp47", + "thermals": [ + { + "name": "xSFP module 47 Temp" + } + ] + }, + { + "name": "sfp48", + "thermals": [ + { + "name": "xSFP module 48 Temp" + } + ] + }, + { + "name": "sfp49", + "thermals": [ + { + "name": "xSFP module 49 Temp" + } + ] + }, + { + "name": "sfp50", + "thermals": [ + { + "name": "xSFP module 50 Temp" + } + ] + }, + { + "name": "sfp51", + "thermals": [ + { + "name": "xSFP module 51 Temp" + } + ] + }, + { + "name": "sfp52", + "thermals": [ + { + "name": "xSFP module 52 Temp" + } + ] + }, + { + "name": "sfp53", + "thermals": [ + { + "name": "xSFP module 53 Temp" + } + ] + }, + { + "name": "sfp54", + "thermals": [ + { + "name": "xSFP module 54 Temp" + } + ] + }, + { + "name": "sfp55", + "thermals": [ + { + "name": "xSFP module 55 Temp" + } + ] + }, + { + "name": "sfp56", + "thermals": [ + { + "name": "xSFP module 56 Temp" + } + ] + }, + { + "name": "sfp57", + "thermals": [ + { + "name": "xSFP module 57 Temp" + } + ] + }, + { + "name": "sfp58", + "thermals": [ + { + "name": "xSFP module 58 Temp" + } + ] + }, + { + "name": "sfp59", + "thermals": [ + { + "name": "xSFP module 59 Temp" + } + ] + }, + { + "name": "sfp60", + "thermals": [ + { + "name": "xSFP module 60 Temp" + } + ] + }, + { + "name": "sfp61", + "thermals": [ + { + "name": "xSFP module 61 Temp" + } + ] + }, + { + "name": "sfp62", + "thermals": [ + { + "name": "xSFP module 62 Temp" + } + ] + }, + { + "name": "sfp63", + "thermals": [ + { + "name": "xSFP module 63 Temp" + } + ] + }, + { + "name": "sfp64", + "thermals": [ + { + "name": "xSFP module 64 Temp" + } + ] + } + ] + }, + "interfaces": {} +} diff --git a/device/mellanox/x86_64-mlnx_msn4600-r0/platform_components.json b/device/mellanox/x86_64-mlnx_msn4600-r0/platform_components.json new file mode 100644 index 000000000000..35ebe3943dac --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600-r0/platform_components.json @@ -0,0 +1,14 @@ +{ + "chassis": { + "MSN4600": { + "component": { + "ONIE": { }, + "SSD": { }, + "BIOS": { }, + "CPLD1": { }, + "CPLD2": { }, + "CPLD3": { } + } + } + } +} diff --git a/device/mellanox/x86_64-mlnx_msn4600-r0/platform_reboot b/device/mellanox/x86_64-mlnx_msn4600-r0/platform_reboot new file mode 120000 index 000000000000..43c8ea567493 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600-r0/platform_reboot @@ -0,0 +1 @@ +../x86_64-mlnx_msn2700-r0/platform_reboot \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4600-r0/platform_wait b/device/mellanox/x86_64-mlnx_msn4600-r0/platform_wait new file mode 120000 index 000000000000..4b30bd429854 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600-r0/platform_wait @@ -0,0 +1 @@ +../x86_64-mlnx_msn2700-r0/platform_wait \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4600-r0/plugins/eeprom.py b/device/mellanox/x86_64-mlnx_msn4600-r0/plugins/eeprom.py new file mode 120000 index 000000000000..b4e2a6a61671 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600-r0/plugins/eeprom.py @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/plugins/eeprom.py \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4600-r0/plugins/psuutil.py b/device/mellanox/x86_64-mlnx_msn4600-r0/plugins/psuutil.py new file mode 120000 index 000000000000..9f724238a8d5 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600-r0/plugins/psuutil.py @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/plugins/psuutil.py \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4600-r0/plugins/sfplpmget.py b/device/mellanox/x86_64-mlnx_msn4600-r0/plugins/sfplpmget.py new file mode 120000 index 000000000000..2e84f435abd9 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600-r0/plugins/sfplpmget.py @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/plugins/sfplpmget.py \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4600-r0/plugins/sfplpmset.py b/device/mellanox/x86_64-mlnx_msn4600-r0/plugins/sfplpmset.py new file mode 120000 index 000000000000..6a88bac30467 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600-r0/plugins/sfplpmset.py @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/plugins/sfplpmset.py \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4600-r0/plugins/sfpreset.py b/device/mellanox/x86_64-mlnx_msn4600-r0/plugins/sfpreset.py new file mode 120000 index 000000000000..fef2063e3496 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600-r0/plugins/sfpreset.py @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/plugins/sfpreset.py \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4600-r0/plugins/sfputil.py b/device/mellanox/x86_64-mlnx_msn4600-r0/plugins/sfputil.py new file mode 120000 index 000000000000..45909b880fc9 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600-r0/plugins/sfputil.py @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/plugins/sfputil.py \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4600-r0/pmon_daemon_control.json b/device/mellanox/x86_64-mlnx_msn4600-r0/pmon_daemon_control.json new file mode 120000 index 000000000000..435a2ce7c0ba --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600-r0/pmon_daemon_control.json @@ -0,0 +1 @@ +../x86_64-mlnx_msn2700-r0/pmon_daemon_control.json \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4600-r0/sensors.conf b/device/mellanox/x86_64-mlnx_msn4600-r0/sensors.conf new file mode 100644 index 000000000000..da05cd94bf9f --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600-r0/sensors.conf @@ -0,0 +1,189 @@ +################################################################################ +# Copyright (c) 2021 Mellanox Technologies +# +# Platform specific sensors config for SN4600 +################################################################################ + +# Temperature sensors +bus "i2c-2" "i2c-1-mux (chan_id 1)" + chip "mlxsw-i2c-*-48" + label temp1 "Ambient ASIC Temp" + +bus "i2c-7" "i2c-1-mux (chan_id 6)" + chip "tmp102-i2c-*-49" + label temp1 "Ambient Fan Side Temp (air intake)" + chip "tmp102-i2c-*-4a" + label temp1 "Ambient Port Side Temp (air exhaust)" + +bus "i2c-15" "i2c-1-mux (chan_id 6)" + chip "tmp102-i2c-15-49" + label temp1 "Ambient COMEX Temp" + +# Power controllers +bus "i2c-5" "i2c-1-mux (chan_id 4)" + chip "xdpe12284-i2c-*-62" + label in1 "PMIC-1 PSU 12V Rail (in)" + ignore in2 + label in3 "PMIC-1 ASIC 0.8V VCORE_MAIN Rail (out)" + ignore in4 + label temp1 "PMIC-1 Temp 1" + label temp2 "PMIC-1 Temp 2" + label power1 "PMIC-1 ASIC 12V VCORE_MAIN Rail Pwr (in)" + ignore power2 + label power3 "PMIC-1 ASIC 0.8V VCORE_MAIN Rail Pwr (out)" + ignore power4 + label curr1 "PMIC-1 ASIC 12V VCORE_MAIN Rail Curr (in)" + ignore curr2 + label curr3 "PMIC-1 ASIC 0.8V VCORE_MAIN Rail Curr (out)" + ignore curr4 + chip "xdpe12284-i2c-*-64" + label in1 "PMIC-2 PSU 12V Rail_1 (in)" + label in2 "PMIC-2 PSU 12V Rail_2 (in)" + label in3 "PMIC-2 ASIC 1.8V Rail_1 (out)" + label in4 "PMIC-2 ASIC 1.2V Rail_2 (out)" + label temp1 "PMIC-2 Temp 1" + label temp2 "PMIC-2 Temp 2" + label power1 "PMIC-2 ASIC 12V Rail_1 Pwr (in)" + label power2 "PMIC-2 ASIC 12V Rail_2 Pwr (in)" + label power3 "PMIC-2 ASIC 1.8V Rail_1 Pwr (out)" + label power4 "PMIC-2 ASIC 1.2V Rail_2 Pwr (out)" + label curr1 "PMIC-2 ASIC 12V Rail_1 Curr (in)" + label curr2 "PMIC-2 ASIC 12V Rail_2 Curr (in)" + label curr3 "PMIC-2 ASIC 1.8V Rail_1 Curr (out)" + label curr4 "PMIC-2 ASIC 1.2V Rail_2 Curr (out)" + chip "xdpe12284-i2c-*-66" + label in1 "PMIC-3 PSU 12V Rail_1 (in)" + label in2 "PMIC-3 PSU 12V Rail_2 (in)" + label in3 "PMIC-3 ASIC 0.85V Rail_1 T0_1 (out)" + label in4 "PMIC-3 ASIC 1.8V Rail_2 T0_1 (out)" + label temp1 "PMIC-3 Temp 1" + label temp2 "PMIC-3 Temp 2" + label power1 "PMIC-3 ASIC 12V Rail_1 Pwr (in)" + label power2 "PMIC-3 ASIC 12V Rail_2 Pwr (in)" + label power3 "PMIC-3 ASIC 0.85V Rail_1 T0_1 Pwr (out)" + label power4 "PMIC-3 ASIC 1.8V Rail_2 T0_1 Pwr (out)" + label curr1 "PMIC-3 ASIC 12V Rail_1 Curr (in)" + label curr2 "PMIC-3 ASIC 12V Rail_2 Curr (in)" + label curr3 "PMIC-3 ASIC 0.85V Rail_1 T0_1 Curr (out)" + label curr4 "PMIC-3 ASIC 1.8V Rail_2 T0_1 Curr (out)" + chip "xdpe12284-i2c-*-68" + label in1 "PMIC-4 PSU 12V Rail_1 (in)" + label in2 "PMIC-4 PSU 12V Rail_2 (in)" + label in3 "PMIC-4 ASIC 0.85V Rail_1 T2_3 (out)" + label in4 "PMIC-4 ASIC 1.8V Rail_2 T2_3 (out)" + label temp1 "PMIC-4 Temp 1" + label temp2 "PMIC-4 Temp 2" + label power1 "PMIC-4 ASIC 12V Rail_1 Pwr (in)" + label power2 "PMIC-4 ASIC 12V Rail_2 Pwr (in)" + label power3 "PMIC-4 ASIC 0.85V Rail_1 T2_3 Pwr (out)" + label power4 "PMIC-4 ASIC 1.8V Rail_2 T2_3 Pwr (out)" + label curr1 "PMIC-4 ASIC 12V Rail_1 Curr (in)" + label curr2 "PMIC-4 ASIC 12V Rail_2 Curr (in)" + label curr3 "PMIC-4 ASIC 0.85V Rail_1 T2_3 Curr (out)" + label curr4 "PMIC-4 ASIC 1.8V Rail_2 T2_3 Curr (out)" + chip "xdpe12284-i2c-*-6a" + label in1 "PMIC-5 PSU 12V Rail_1 (in)" + label in2 "PMIC-5 PSU 12V Rail_2 (in)" + label in3 "PMIC-5 ASIC 0.85V Rail_1 T4_5 (out)" + label in4 "PMIC-5 ASIC 1.8V Rail_2 T4_5 (out)" + label temp1 "PMIC-5 Temp 1" + label temp2 "PMIC-5 Temp 2" + label power1 "PMIC-5 ASIC 12V Rail_1 Pwr (in)" + label power2 "PMIC-5 ASIC 12V Rail_2 Pwr (in)" + label power3 "PMIC-5 ASIC 0.85V Rail_1 T4_5 Pwr (out)" + label power4 "PMIC-5 ASIC 1.8V Rail_2 T4_5 Pwr (out)" + label curr1 "PMIC-5 ASIC 12V Rail_1 Curr (in)" + label curr2 "PMIC-5 ASIC 12V Rail_2 Curr (in)" + label curr3 "PMIC-5 ASIC 0.85V Rail_1 T4_5 Curr (out)" + label curr4 "PMIC-5 ASIC 1.8V Rail_2 T4_5 Curr (out)" + chip "xdpe12284-i2c-*-6c" + label in1 "PMIC-6 PSU 12V Rail_1 (in)" + label in2 "PMIC-6 PSU 12V Rail_2 (in)" + label in3 "PMIC-6 ASIC 0.85V Rail_1 T6_7 (out)" + label in4 "PMIC-6 ASIC 1.8V Rail_2 T6_7 (out)" + label temp1 "PMIC-6 Temp 1" + label temp2 "PMIC-6 Temp 2" + label power1 "PMIC-6 ASIC 12V Rail_1 Pwr (in)" + label power2 "PMIC-6 ASIC 12V Rail_2 Pwr (in)" + label power3 "PMIC-6 ASIC 0.85V Rail_1 T6_7 Pwr (out)" + label power4 "PMIC-6 ASIC 1.8V Rail_2 T6_7 Pwr (out)" + label curr1 "PMIC-6 ASIC 12V Rail_1 Curr (in)" + label curr2 "PMIC-6 ASIC 12V Rail_2 Curr (in)" + label curr3 "PMIC-6 ASIC 0.85V Rail_1 T6_7 Curr (out)" + label curr4 "PMIC-6 ASIC 1.8V Rail_2 T6_7 Curr (out)" + chip "xdpe12284-i2c-*-6e" + label in1 "PMIC-7 PSU 12V Rail_1 (in)" + label in2 "PMIC-7 PSU 12V Rail_2 (in)" + label in3 "PMIC-7 ASIC 1.2V Rail_1 T0_3 (out)" + label in4 "PMIC-7 ASIC 1.2V Rail_2 T4_7 (out)" + label temp1 "PMIC-7 Temp 1" + label temp2 "PMIC-7 Temp 2" + label power1 "PMIC-7 ASIC 12V Rail_1 Pwr (in)" + label power2 "PMIC-7 ASIC 12V Rail_2 Pwr (in)" + label power3 "PMIC-7 ASIC 1.2V Rail_1 T0_3 Pwr (out)" + label power4 "PMIC-7 ASIC 1.2V Rail_2 T4_7 Pwr (out)" + label curr1 "PMIC-7 ASIC 12V Rail_1 Curr (in)" + label curr2 "PMIC-7 ASIC 12V Rail_2 Curr (in)" + label curr3 "PMIC-7 ASIC 1.2V Rail_1 T0_3 Curr (out)" + label curr4 "PMIC-7 ASIC 1.2V Rail_2 T4_7 Curr (out)" + +bus "i2c-15" "i2c-1-mux (chan_id 6)" + chip "tps53679-i2c-*-58" + label in1 "PMIC-8 PSU 12V Rail (in1)" + label in2 "PMIC-8 PSU 12V Rail (in2)" + label in3 "PMIC-8 COMEX 1.8V Rail (out)" + label in4 "PMIC-8 COMEX 1.05V Rail (out)" + label temp1 "PMIC-8 Temp 1" + label temp2 "PMIC-8 Temp 2" + label power1 "PMIC-8 COMEX 1.8V Rail Pwr (out)" + label power2 "PMIC-8 COMEX 1.05V Rail Pwr (out)" + label curr1 "PMIC-8 COMEX 1.8V Rail Curr (out)" + label curr2 "PMIC-8 COMEX 1.05V Rail Curr (out)" + chip "tps53679-i2c-*-61" + label in1 "PMIC-9 PSU 12V Rail (in1)" + label in2 "PMIC-9 PSU 12V Rail (in2)" + label in3 "PMIC-9 COMEX 1.2V Rail (out)" + ignore in4 + label temp1 "PMIC-9 Temp 1" + label temp2 "PMIC-9 Temp 2" + label power1 "PMIC-9 COMEX 1.2V Rail Pwr (out)" + ignore power2 + label curr1 "PMIC-9 COMEX 1.2V Rail Curr (out)" + ignore curr2 + +# Power supplies +bus "i2c-4" "i2c-1-mux (chan_id 3)" + chip "dps460-i2c-*-58" + label in1 "PSU-1(L) 220V Rail (in)" + ignore in2 + label in3 "PSU-1(L) 12V Rail (out)" + label fan1 "PSU-1(L) Fan 1" + ignore fan2 + ignore fan3 + label temp1 "PSU-1(L) Temp 1" + label temp2 "PSU-1(L) Temp 2" + label temp3 "PSU-1(L) Temp 3" + label power1 "PSU-1(L) 220V Rail Pwr (in)" + label power2 "PSU-1(L) 12V Rail Pwr (out)" + label curr1 "PSU-1(L) 220V Rail Curr (in)" + label curr2 "PSU-1(L) 12V Rail Curr (out)" + chip "dps460-i2c-*-59" + label in1 "PSU-2(R) 220V Rail (in)" + ignore in2 + label in3 "PSU-2(R) 12V Rail (out)" + label fan1 "PSU-2(R) Fan 1" + ignore fan2 + ignore fan3 + label temp1 "PSU-2(R) Temp 1" + label temp2 "PSU-2(R) Temp 2" + label temp3 "PSU-2(R) Temp 3" + label power1 "PSU-2(R) 220V Rail Pwr (in)" + label power2 "PSU-2(R) 12V Rail Pwr (out)" + label curr1 "PSU-2(R) 220V Rail Curr (in)" + label curr2 "PSU-2(R) 12V Rail Curr (out)" + +# Chassis fans +chip "mlxreg_fan-isa-*" + label fan1 "Chassis Fan Drawer-1" + label fan2 "Chassis Fan Drawer-2" + label fan3 "Chassis Fan Drawer-3" diff --git a/device/mellanox/x86_64-mlnx_msn4600-r0/sensors.conf.a1 b/device/mellanox/x86_64-mlnx_msn4600-r0/sensors.conf.a1 new file mode 100644 index 000000000000..dfe848ca8aa4 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600-r0/sensors.conf.a1 @@ -0,0 +1,133 @@ +################################################################################ +# Copyright (c) 2021 Mellanox Technologies +# +# Platform specific sensors config for SN4600 +################################################################################ + +# Temperature sensors +bus "i2c-2" "i2c-1-mux (chan_id 1)" + chip "mlxsw-i2c-*-48" + label temp1 "Ambient ASIC Temp" + +bus "i2c-7" "i2c-1-mux (chan_id 6)" + chip "tmp102-i2c-*-49" + label temp1 "Ambient Fan Side Temp (air intake)" + chip "tmp102-i2c-*-4a" + label temp1 "Ambient Port Side Temp (air exhaust)" + +bus "i2c-15" "i2c-1-mux (chan_id 6)" + chip "tmp102-i2c-15-49" + label temp1 "Ambient COMEX Temp" + +# Power controllers +bus "i2c-5" "i2c-1-mux (chan_id 4)" + chip "mp2975-i2c-*-62" + label in1 "PMIC-1 PSU 12V Rail (in1)" + label in2 "PMIC-1 ASIC 0.8V VCORE MAIN Rail (out)" + label temp1 "PMIC-1 Temp 1" + label power1 "PMIC-1 PSU 12V Rail Pwr (in1)" + label power2 "PMIC-1 ASIC 0.8V VCORE MAIN Rail Pwr (out)" + label curr1 "PMIC-1 PSU 12V Rail Curr (in1)" + label curr2 "PMIC-1 ASIC 0.8V VCORE MAIN Rail Curr (out)" + chip "mp2975-i2c-*-64" + label in1 "PMIC-2 PSU 12V Rail (in1)" + label in2 "PMIC-2 ASIC 1.8V VCORE MAIN Rail (out)" + label in3 "PMIC-2 ASIC 1.2V VCORE MAIN Rail (out)" + label temp1 "PMIC-2 Temp 1" + label power1 "PMIC-2 PSU 12V Rail Pwr (in1)" + label power2 "PMIC-2 ASIC 1.8V VCORE MAIN Rail Pwr (out)" + label curr1 "PMIC-2 PSU 12V Rail Curr (in1)" + label curr2 "PMIC-2 ASIC 1.8V VCORE MAIN Rail Curr (out)" + label curr3 "PMIC-2 ASIC 1.2V VCORE MAIN Rail Curr (out)" + chip "mp2975-i2c-*-66" + label in1 "PMIC-3 PSU 12V Rail (in1)" + label in2 "PMIC-3 ASIC 0.85V T0_1 Rail (out)" + label in3 "PMIC-3 ASIC 1.8V T0_1 Rail (out)" + label temp1 "PMIC-3 Temp 1" + label power1 "PMIC-3 PSU 12V Rail Pwr (in1)" + label power2 "PMIC-3 ASIC 0.85V T0_1 Rail Pwr (out)" + label curr1 "PMIC-3 PSU 12V Rail Curr (in1)" + label curr2 "PMIC-3 ASIC 0.85V T0_1 Rail Curr (out)" + label curr3 "PMIC-3 ASIC 1.8V T0_1 Rail Curr (out)" + chip "mp2975-i2c-*-6a" + label in1 "PMIC-4 PSU 12V Rail (in1)" + label in2 "PMIC-4 ASIC 0.85V T2_3 Rail (out)" + label in3 "PMIC-4 ASIC 1.8V T2_3 Rail (out)" + label temp1 "PMIC-4 Temp 1" + label power1 "PMIC-4 PSU 12V Rail Pwr (in1)" + label power2 "PMIC-4 ASIC 0.85V T2_3 Rail Pwr (out)" + label curr1 "PMIC-4 PSU 12V Rail Curr (in1)" + label curr2 "PMIC-4 ASIC 0.85V T2_3 Rail Curr (out)" + label curr3 "PMIC-4 ASIC 1.8V T2_3 Rail Curr (out)" + chip "mp2975-i2c-*-6e" + label in1 "PMIC-5 PSU 12V Rail (in1)" + label in2 "PMIC-5 ASIC 1.2V T0_3 Rail_1 (out)" + label in3 "PMIC-5 ASIC 1.2V T4_7 Rail_2 (out)" + label temp1 "PMIC-5 Temp 1" + label power1 "PMIC-5 PSU 12V Rail Pwr (in1)" + label power2 "PMIC-5 ASIC 1.2V T0_3 Rail_1 Pwr (out)" + label power3 "PMIC-5 ASIC 1.2V T4_7 Rail_2 Pwr (out)" + label curr1 "PMIC-5 PSU 12V Rail Curr (in1)" + label curr2 "PMIC-5 ASIC 1.2V T0_3 Rail_1 Curr (out)" + label curr3 "PMIC-5 ASIC 1.2V T4_7 Rail_2 Curr (out)" + +bus "i2c-15" "i2c-1-mux (chan_id 6)" + chip "tps53679-i2c-*-58" + label in1 "PMIC-6 PSU 12V Rail (in1)" + label in2 "PMIC-6 PSU 12V Rail (in2)" + label in3 "PMIC-6 COMEX 1.8V Rail (out)" + label in4 "PMIC-6 COMEX 1.05V Rail (out)" + label temp1 "PMIC-6 Temp 1" + label temp2 "PMIC-6 Temp 2" + label power1 "PMIC-6 COMEX 1.8V Rail Pwr (out)" + label power2 "PMIC-6 COMEX 1.05V Rail Pwr (out)" + label curr1 "PMIC-6 COMEX 1.8V Rail Curr (out)" + label curr2 "PMIC-6 COMEX 1.05V Rail Curr (out)" + chip "tps53679-i2c-*-61" + label in1 "PMIC-7 PSU 12V Rail (in1)" + label in2 "PMIC-7 PSU 12V Rail (in2)" + label in3 "PMIC-7 COMEX 1.2V Rail (out)" + ignore in4 + label temp1 "PMIC-7 Temp 1" + label temp2 "PMIC-7 Temp 2" + label power1 "PMIC-7 COMEX 1.2V Rail Pwr (out)" + ignore power2 + label curr1 "PMIC-7 COMEX 1.2V Rail Curr (out)" + ignore curr2 + +# Power supplies +bus "i2c-4" "i2c-1-mux (chan_id 3)" + chip "dps460-i2c-*-58" + label in1 "PSU-1(L) 220V Rail (in)" + ignore in2 + label in3 "PSU-1(L) 12V Rail (out)" + label fan1 "PSU-1(L) Fan 1" + ignore fan2 + ignore fan3 + label temp1 "PSU-1(L) Temp 1" + label temp2 "PSU-1(L) Temp 2" + label temp3 "PSU-1(L) Temp 3" + label power1 "PSU-1(L) 220V Rail Pwr (in)" + label power2 "PSU-1(L) 12V Rail Pwr (out)" + label curr1 "PSU-1(L) 220V Rail Curr (in)" + label curr2 "PSU-1(L) 12V Rail Curr (out)" + chip "dps460-i2c-*-59" + label in1 "PSU-2(R) 220V Rail (in)" + ignore in2 + label in3 "PSU-2(R) 12V Rail (out)" + label fan1 "PSU-2(R) Fan 1" + ignore fan2 + ignore fan3 + label temp1 "PSU-2(R) Temp 1" + label temp2 "PSU-2(R) Temp 2" + label temp3 "PSU-2(R) Temp 3" + label power1 "PSU-2(R) 220V Rail Pwr (in)" + label power2 "PSU-2(R) 12V Rail Pwr (out)" + label curr1 "PSU-2(R) 220V Rail Curr (in)" + label curr2 "PSU-2(R) 12V Rail Curr (out)" + +# Chassis fans +chip "mlxreg_fan-isa-*" + label fan1 "Chassis Fan Drawer-1" + label fan2 "Chassis Fan Drawer-2" + label fan3 "Chassis Fan Drawer-3" diff --git a/device/mellanox/x86_64-mlnx_msn4600-r0/system_health_monitoring_config.json b/device/mellanox/x86_64-mlnx_msn4600-r0/system_health_monitoring_config.json new file mode 120000 index 000000000000..98df66c27ca5 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600-r0/system_health_monitoring_config.json @@ -0,0 +1 @@ +../x86_64-mlnx_msn2700-r0/system_health_monitoring_config.json \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4600-r0/thermal_policy.json b/device/mellanox/x86_64-mlnx_msn4600-r0/thermal_policy.json new file mode 120000 index 000000000000..5a25cd87f70c --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600-r0/thermal_policy.json @@ -0,0 +1 @@ +../x86_64-mlnx_msn2700-r0/thermal_policy.json \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/ACS-MSN4600C/buffers_defaults_objects.j2 b/device/mellanox/x86_64-mlnx_msn4600c-r0/ACS-MSN4600C/buffers_defaults_objects.j2 new file mode 120000 index 000000000000..33b6704f9902 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/ACS-MSN4600C/buffers_defaults_objects.j2 @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/ACS-MSN2700/buffers_defaults_objects.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/ACS-MSN4600C/port_config.ini b/device/mellanox/x86_64-mlnx_msn4600c-r0/ACS-MSN4600C/port_config.ini index a1ecf9aa3266..2e6212ef692c 100644 --- a/device/mellanox/x86_64-mlnx_msn4600c-r0/ACS-MSN4600C/port_config.ini +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/ACS-MSN4600C/port_config.ini @@ -1,65 +1,65 @@ # name lanes alias index Ethernet0 0,1,2,3 etp1 1 -Ethernet8 8,9,10,11 etp2 2 -Ethernet16 16,17,18,19 etp3 3 -Ethernet24 24,25,26,27 etp4 4 -Ethernet32 32,33,34,35 etp5 5 -Ethernet40 40,41,42,43 etp6 6 -Ethernet48 48,49,50,51 etp7 7 -Ethernet56 56,57,58,59 etp8 8 -Ethernet64 64,65,66,67 etp9 9 -Ethernet72 72,73,74,75 etp10 10 -Ethernet80 80,81,82,83 etp11 11 -Ethernet88 88,89,90,91 etp12 12 -Ethernet96 96,97,98,99 etp13 13 -Ethernet104 104,105,106,107 etp14 14 -Ethernet112 112,113,114,115 etp15 15 -Ethernet120 120,121,122,123 etp16 16 -Ethernet128 128,129,130,131 etp17 17 -Ethernet136 136,137,138,139 etp18 18 -Ethernet144 144,145,146,147 etp19 19 -Ethernet152 152,153,154,155 etp20 20 -Ethernet160 160,161,162,163 etp21 21 -Ethernet168 168,169,170,171 etp22 22 -Ethernet176 176,177,178,179 etp23 23 -Ethernet184 184,185,186,187 etp24 24 -Ethernet192 192,193,194,195 etp25 25 -Ethernet200 200,201,202,203 etp26 26 -Ethernet208 208,209,210,211 etp27 27 -Ethernet216 216,217,218,219 etp28 28 -Ethernet224 224,225,226,227 etp29 29 -Ethernet232 232,233,234,235 etp30 30 -Ethernet240 240,241,242,243 etp31 31 -Ethernet248 248,249,250,251 etp32 32 -Ethernet256 256,257,258,259 etp33 33 -Ethernet264 264,265,266,267 etp34 34 -Ethernet272 272,273,274,275 etp35 35 -Ethernet280 280,281,282,283 etp36 36 -Ethernet288 288,289,290,291 etp37 37 -Ethernet296 296,297,298,299 etp38 38 -Ethernet304 304,305,306,307 etp39 39 -Ethernet312 312,313,314,315 etp40 40 -Ethernet320 320,321,322,323 etp41 41 -Ethernet328 328,329,330,331 etp42 42 -Ethernet336 336,337,338,339 etp43 43 -Ethernet344 344,345,346,347 etp44 44 -Ethernet352 352,353,354,355 etp45 45 -Ethernet360 360,361,362,363 etp46 46 -Ethernet368 368,369,370,371 etp47 47 -Ethernet376 376,377,378,379 etp48 48 -Ethernet384 384,385,386,387 etp49 49 -Ethernet392 392,393,394,395 etp50 50 -Ethernet400 400,401,402,403 etp51 51 -Ethernet408 408,409,410,411 etp52 52 -Ethernet416 416,417,418,419 etp53 53 -Ethernet424 424,425,426,427 etp54 54 -Ethernet432 432,433,434,435 etp55 55 -Ethernet440 440,441,442,443 etp56 56 -Ethernet448 448,449,450,451 etp57 57 -Ethernet456 456,457,458,459 etp58 58 -Ethernet464 464,465,466,467 etp59 59 -Ethernet472 472,473,474,475 etp60 60 -Ethernet480 480,481,482,483 etp61 61 -Ethernet488 488,489,490,491 etp62 62 -Ethernet496 496,497,498,499 etp63 63 -Ethernet504 504,505,506,507 etp64 64 +Ethernet4 8,9,10,11 etp2 2 +Ethernet8 16,17,18,19 etp3 3 +Ethernet12 24,25,26,27 etp4 4 +Ethernet16 32,33,34,35 etp5 5 +Ethernet20 40,41,42,43 etp6 6 +Ethernet24 48,49,50,51 etp7 7 +Ethernet28 56,57,58,59 etp8 8 +Ethernet32 64,65,66,67 etp9 9 +Ethernet36 72,73,74,75 etp10 10 +Ethernet40 80,81,82,83 etp11 11 +Ethernet44 88,89,90,91 etp12 12 +Ethernet48 96,97,98,99 etp13 13 +Ethernet52 104,105,106,107 etp14 14 +Ethernet56 112,113,114,115 etp15 15 +Ethernet60 120,121,122,123 etp16 16 +Ethernet64 128,129,130,131 etp17 17 +Ethernet68 136,137,138,139 etp18 18 +Ethernet72 144,145,146,147 etp19 19 +Ethernet76 152,153,154,155 etp20 20 +Ethernet80 160,161,162,163 etp21 21 +Ethernet84 168,169,170,171 etp22 22 +Ethernet88 176,177,178,179 etp23 23 +Ethernet92 184,185,186,187 etp24 24 +Ethernet96 192,193,194,195 etp25 25 +Ethernet100 200,201,202,203 etp26 26 +Ethernet104 208,209,210,211 etp27 27 +Ethernet108 216,217,218,219 etp28 28 +Ethernet112 224,225,226,227 etp29 29 +Ethernet116 232,233,234,235 etp30 30 +Ethernet120 240,241,242,243 etp31 31 +Ethernet124 248,249,250,251 etp32 32 +Ethernet128 256,257,258,259 etp33 33 +Ethernet132 264,265,266,267 etp34 34 +Ethernet136 272,273,274,275 etp35 35 +Ethernet140 280,281,282,283 etp36 36 +Ethernet144 288,289,290,291 etp37 37 +Ethernet148 296,297,298,299 etp38 38 +Ethernet152 304,305,306,307 etp39 39 +Ethernet156 312,313,314,315 etp40 40 +Ethernet160 320,321,322,323 etp41 41 +Ethernet164 328,329,330,331 etp42 42 +Ethernet168 336,337,338,339 etp43 43 +Ethernet172 344,345,346,347 etp44 44 +Ethernet176 352,353,354,355 etp45 45 +Ethernet180 360,361,362,363 etp46 46 +Ethernet184 368,369,370,371 etp47 47 +Ethernet188 376,377,378,379 etp48 48 +Ethernet192 384,385,386,387 etp49 49 +Ethernet196 392,393,394,395 etp50 50 +Ethernet200 400,401,402,403 etp51 51 +Ethernet204 408,409,410,411 etp52 52 +Ethernet208 416,417,418,419 etp53 53 +Ethernet212 424,425,426,427 etp54 54 +Ethernet216 432,433,434,435 etp55 55 +Ethernet220 440,441,442,443 etp56 56 +Ethernet224 448,449,450,451 etp57 57 +Ethernet228 456,457,458,459 etp58 58 +Ethernet232 464,465,466,467 etp59 59 +Ethernet236 472,473,474,475 etp60 60 +Ethernet240 480,481,482,483 etp61 61 +Ethernet244 488,489,490,491 etp62 62 +Ethernet248 496,497,498,499 etp63 63 +Ethernet252 504,505,506,507 etp64 64 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/ACS-MSN4600C/sai.profile b/device/mellanox/x86_64-mlnx_msn4600c-r0/ACS-MSN4600C/sai.profile index e9d1e3e5f591..33f195e4a17f 100644 --- a/device/mellanox/x86_64-mlnx_msn4600c-r0/ACS-MSN4600C/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/ACS-MSN4600C/sai.profile @@ -1 +1,3 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_4600C.xml +SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps +SAI_DUMP_STORE_AMOUNT=10 diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-C64/buffers.json.j2 b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-C64/buffers.json.j2 new file mode 120000 index 000000000000..add8bf8bb7c2 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-C64/buffers.json.j2 @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/ACS-MSN2700/buffers.json.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-C64/buffers_defaults_objects.j2 b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-C64/buffers_defaults_objects.j2 new file mode 120000 index 000000000000..c01aebb7ae12 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-C64/buffers_defaults_objects.j2 @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/buffers_defaults_objects.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-C64/buffers_defaults_t0.j2 b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-C64/buffers_defaults_t0.j2 new file mode 100644 index 000000000000..e22fc68b2de4 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-C64/buffers_defaults_t0.j2 @@ -0,0 +1,23 @@ +{% set default_cable = '5m' %} +{% set ingress_lossless_pool_size = '49905664' %} +{% set ingress_lossless_pool_xoff = '3702784' %} +{% set egress_lossless_pool_size = '60817392' %} +{% set egress_lossy_pool_size = '49905664' %} + +{% import 'buffers_defaults_objects.j2' as defs with context %} + +{%- macro generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) %} +{{ defs.generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_profile_lists_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_profile_lists(port_names_active, port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_queue_buffers_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_queue_buffers(port_names_active, port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_pg_profiles_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_pg_profiles(port_names_active, port_names_inactive) }} +{%- endmacro %} diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-C64/buffers_defaults_t1.j2 b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-C64/buffers_defaults_t1.j2 new file mode 100644 index 000000000000..fec39f817352 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-C64/buffers_defaults_t1.j2 @@ -0,0 +1,38 @@ +{% set default_cable = '5m' %} +{%- if ((SYSTEM_DEFAULTS is defined) and ('tunnel_qos_remap' in SYSTEM_DEFAULTS) and (SYSTEM_DEFAULTS['tunnel_qos_remap']['status'] == 'enabled')) -%} +{% set ingress_lossless_pool_size = '44130304' %} +{% set ingress_lossless_pool_xoff = '8790016' %} +{% set egress_lossless_pool_size = '60817392' %} +{% set egress_lossy_pool_size = '44130304' %} +{%- else -%} +{% set ingress_lossless_pool_size = '48332800' %} +{% set ingress_lossless_pool_xoff = '5275648' %} +{% set egress_lossless_pool_size = '60817392' %} +{% set egress_lossy_pool_size = '48332800' %} +{%- endif -%} + +{% import 'buffers_defaults_objects.j2' as defs with context %} + +{%- macro generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) %} +{{ defs.generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_profile_lists_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_profile_lists(port_names_active, port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_queue_buffers_with_extra_lossless_queues_with_inactive_ports(port_names_active, port_names_extra_queues, port_names_inactive) %} +{{ defs.generate_queue_buffers_with_extra_lossless_queues(port_names_active, port_names_extra_queues, port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_queue_buffers_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_queue_buffers(port_names_active, port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_pg_profiles_with_extra_lossless_pgs_with_inactive_ports(port_names_active, port_names_extra_pgs, port_names_inactive) %} +{{ defs.generate_pg_profiles_with_extra_lossless_pgs(port_names_active, port_names_extra_pgs, port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_pg_profiles_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_pg_profiles(port_names_active, port_names_inactive) }} +{%- endmacro %} diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-C64/buffers_dynamic.json.j2 b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-C64/buffers_dynamic.json.j2 new file mode 120000 index 000000000000..8c4117c66214 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-C64/buffers_dynamic.json.j2 @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/ACS-MSN2700/buffers_dynamic.json.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-C64/pg_profile_lookup.ini b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-C64/pg_profile_lookup.ini new file mode 120000 index 000000000000..49745268908f --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-C64/pg_profile_lookup.ini @@ -0,0 +1 @@ +../Mellanox-SN4600C-D112C8/pg_profile_lookup.ini \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-C64/port_config.ini b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-C64/port_config.ini new file mode 120000 index 000000000000..ff6597161314 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-C64/port_config.ini @@ -0,0 +1 @@ +../ACS-MSN4600C/port_config.ini \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-C64/qos.json.j2 b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-C64/qos.json.j2 new file mode 100644 index 000000000000..123d9ed11a96 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-C64/qos.json.j2 @@ -0,0 +1,159 @@ +{% if ('type' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['type'] == 'LeafRouter') %} +{% set different_dscp_to_tc_map = true %} +{%- macro generate_dscp_to_tc_map() %} + "DSCP_TO_TC_MAP": { + "AZURE": { + "0" : "1", + "1" : "1", + "2" : "2", + "3" : "3", + "4" : "4", + "5" : "1", + "6" : "6", + "7" : "1", + "8" : "0", + "9" : "1", + "10": "1", + "11": "1", + "12": "1", + "13": "1", + "14": "1", + "15": "1", + "16": "1", + "17": "1", + "18": "1", + "19": "1", + "20": "1", + "21": "1", + "22": "1", + "23": "1", + "24": "1", + "25": "1", + "26": "1", + "27": "1", + "28": "1", + "29": "1", + "30": "1", + "31": "1", + "32": "1", + "33": "1", + "34": "1", + "35": "1", + "36": "1", + "37": "1", + "38": "1", + "39": "1", + "40": "1", + "41": "1", + "42": "1", + "43": "1", + "44": "1", + "45": "1", + "46": "5", + "47": "1", + "48": "7", + "49": "1", + "50": "1", + "51": "1", + "52": "1", + "53": "1", + "54": "1", + "55": "1", + "56": "1", + "57": "1", + "58": "1", + "59": "1", + "60": "1", + "61": "1", + "62": "1", + "63": "1" + }, + "AZURE_UPLINK": { + "0" : "1", + "1" : "1", + "2" : "1", + "3" : "3", + "4" : "4", + "5" : "1", + "6" : "1", + "7" : "1", + "8" : "0", + "9" : "1", + "10": "1", + "11": "1", + "12": "1", + "13": "1", + "14": "1", + "15": "1", + "16": "1", + "17": "1", + "18": "1", + "19": "1", + "20": "1", + "21": "1", + "22": "1", + "23": "1", + "24": "1", + "25": "1", + "26": "1", + "27": "1", + "28": "1", + "29": "1", + "30": "1", + "31": "1", + "32": "1", + "33": "1", + "34": "1", + "35": "1", + "36": "1", + "37": "1", + "38": "1", + "39": "1", + "40": "1", + "41": "1", + "42": "1", + "43": "1", + "44": "1", + "45": "1", + "46": "5", + "47": "1", + "48": "7", + "49": "1", + "50": "1", + "51": "1", + "52": "1", + "53": "1", + "54": "1", + "55": "1", + "56": "1", + "57": "1", + "58": "1", + "59": "1", + "60": "1", + "61": "1", + "62": "1", + "63": "1" + } + }, +{%- endmacro %} +{%- macro generate_tc_to_pg_map() %} + "TC_TO_PRIORITY_GROUP_MAP": { + "AZURE": { + "0": "0", + "1": "0", + "2": "2", + "3": "3", + "4": "4", + "5": "0", + "6": "6", + "7": "0" + } + }, +{%- endmacro %} +{%- macro generate_global_dscp_to_tc_map() %} +{# This is an empty macro since the global DSCP_TO_TC map is not required #} +{%- endmacro %} + +{% endif %} + +{%- include 'qos_config.j2' %} diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-C64/sai.profile b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-C64/sai.profile new file mode 100644 index 000000000000..a9835c51dc3f --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-C64/sai.profile @@ -0,0 +1,4 @@ +SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_4600C.xml +SAI_VXLAN_SRCPORT_RANGE_ENABLE=1 +SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps +SAI_DUMP_STORE_AMOUNT=10 diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-C64/sai_4600C.xml b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-C64/sai_4600C.xml new file mode 120000 index 000000000000..26aa2d41010e --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-C64/sai_4600C.xml @@ -0,0 +1 @@ +../ACS-MSN4600C/sai_4600C.xml \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D100C12S2/buffers.json.j2 b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D100C12S2/buffers.json.j2 new file mode 120000 index 000000000000..117d740b0f5b --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D100C12S2/buffers.json.j2 @@ -0,0 +1 @@ +../ACS-MSN4600C/buffers.json.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D100C12S2/buffers_default_objects.j2 b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D100C12S2/buffers_default_objects.j2 new file mode 120000 index 000000000000..c01aebb7ae12 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D100C12S2/buffers_default_objects.j2 @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/buffers_defaults_objects.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D100C12S2/buffers_defaults_t0.j2 b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D100C12S2/buffers_defaults_t0.j2 new file mode 100644 index 000000000000..883e67729fa5 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D100C12S2/buffers_defaults_t0.j2 @@ -0,0 +1,21 @@ +{% set default_cable = '5m' %} +{% set ingress_lossless_pool_size = '44566528' %} +{% set ingress_lossless_pool_xoff = '3614720' %} +{% set egress_lossless_pool_size = '60817392' %} +{% set egress_lossy_pool_size = '44566528' %} + +{%- macro generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) %} +{{ defs.generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_profile_lists_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_profile_lists(port_names_active, port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_queue_buffers_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_queue_buffers(port_names_active, port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_pg_profiles_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_pg_profiles(port_names_active, port_names_inactive) }} +{%- endmacro %} diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D100C12S2/buffers_defaults_t1.j2 b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D100C12S2/buffers_defaults_t1.j2 new file mode 100644 index 000000000000..22be04c463ee --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D100C12S2/buffers_defaults_t1.j2 @@ -0,0 +1,23 @@ +{% set default_cable = '5m' %} +{% set ingress_lossless_pool_size = '43794432' %} +{% set ingress_lossless_pool_xoff = '4386816' %} +{% set egress_lossless_pool_size = '60817392' %} +{% set egress_lossy_pool_size = '43794432' %} + +{% import 'buffers_defaults_objects.j2' as defs with context %} + +{%- macro generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) %} +{{ defs.generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_profile_lists_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_profile_lists(port_names_active, port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_queue_buffers_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_queue_buffers(port_names_active, port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_pg_profiles_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_pg_profiles(port_names_active, port_names_inactive) }} +{%- endmacro %} diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D100C12S2/buffers_dynamic.json.j2 b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D100C12S2/buffers_dynamic.json.j2 new file mode 120000 index 000000000000..8c4117c66214 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D100C12S2/buffers_dynamic.json.j2 @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/ACS-MSN2700/buffers_dynamic.json.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D100C12S2/pg_profile_lookup.ini b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D100C12S2/pg_profile_lookup.ini new file mode 120000 index 000000000000..49745268908f --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D100C12S2/pg_profile_lookup.ini @@ -0,0 +1 @@ +../Mellanox-SN4600C-D112C8/pg_profile_lookup.ini \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D100C12S2/port_config.ini b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D100C12S2/port_config.ini new file mode 100644 index 000000000000..48f92f311a94 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D100C12S2/port_config.ini @@ -0,0 +1,115 @@ +# name lanes alias index speed +Ethernet0 0,1 etp1a 1 50000 +Ethernet2 2,3 etp1b 1 50000 +Ethernet4 8,9 etp2a 2 50000 +Ethernet6 10,11 etp2b 2 50000 +Ethernet8 16,17 etp3a 3 50000 +Ethernet10 18,19 etp3b 3 50000 +Ethernet12 24,25 etp4a 4 50000 +Ethernet14 26,27 etp4b 4 50000 +Ethernet16 32,33 etp5a 5 50000 +Ethernet18 34,35 etp5b 5 50000 +Ethernet20 40,41 etp6a 6 50000 +Ethernet22 42,43 etp6b 6 50000 +Ethernet24 48,49 etp7a 7 50000 +Ethernet26 50,51 etp7b 7 50000 +Ethernet28 56,57 etp8a 8 50000 +Ethernet30 58,59 etp8b 8 50000 +Ethernet32 64,65 etp9a 9 50000 +Ethernet34 66,67 etp9b 9 50000 +Ethernet36 72,73 etp10a 10 50000 +Ethernet38 74,75 etp10b 10 50000 +Ethernet40 80,81 etp11a 11 50000 +Ethernet42 82,83 etp11b 11 50000 +Ethernet44 88,89 etp12a 12 50000 +Ethernet46 90,91 etp12b 12 50000 +Ethernet48 96,97,98,99 etp13 13 100000 +Ethernet52 104,105 etp14a 14 50000 +Ethernet54 106,107 etp14b 14 50000 +Ethernet56 112,113 etp15a 15 50000 +Ethernet58 114,115 etp15b 15 50000 +Ethernet60 120,121,122,123 etp16 16 100000 +Ethernet64 128,129 etp17a 17 50000 +Ethernet66 130,131 etp17b 17 50000 +Ethernet68 136,137 etp18a 18 50000 +Ethernet70 138,139 etp18b 18 50000 +Ethernet72 144,145 etp19a 19 50000 +Ethernet74 146,147 etp19b 19 50000 +Ethernet76 152,153 etp20a 20 50000 +Ethernet78 154,155 etp20b 20 50000 +Ethernet80 160,161 etp21a 21 50000 +Ethernet82 162,163 etp21b 21 50000 +Ethernet84 168,169 etp22a 22 50000 +Ethernet86 170,171 etp22b 22 50000 +Ethernet88 176,177 etp23a 23 50000 +Ethernet90 178,179 etp23b 23 50000 +Ethernet92 184,185 etp24a 24 50000 +Ethernet94 186,187 etp24b 24 50000 +Ethernet96 192,193 etp25a 25 50000 +Ethernet98 194,195 etp25b 25 50000 +Ethernet100 200,201 etp26a 26 50000 +Ethernet102 202,203 etp26b 26 50000 +Ethernet104 208,209 etp27a 27 50000 +Ethernet106 210,211 etp27b 27 50000 +Ethernet108 216,217 etp28a 28 50000 +Ethernet110 218,219 etp28b 28 50000 +Ethernet112 224,225 etp29a 29 50000 +Ethernet114 226,227 etp29b 29 50000 +Ethernet116 232,233 etp30a 30 50000 +Ethernet118 234,235 etp30b 30 50000 +Ethernet120 240,241 etp31a 31 50000 +Ethernet122 242,243 etp31b 31 50000 +Ethernet124 248,249 etp32a 32 50000 +Ethernet126 250,251 etp32b 32 50000 +Ethernet128 256,257,258,259 etp33 33 100000 +Ethernet132 264,265 etp34a 34 50000 +Ethernet134 266,267 etp34b 34 50000 +Ethernet136 272,273 etp35a 35 50000 +Ethernet138 274,275 etp35b 35 50000 +Ethernet140 280,281,282,283 etp36 36 100000 +Ethernet144 288,289 etp37a 37 50000 +Ethernet146 290,291 etp37b 37 50000 +Ethernet148 296,297,298,299 etp38 38 10000 +Ethernet152 304,305 etp39a 39 50000 +Ethernet154 306,307 etp39b 39 50000 +Ethernet156 312,313,314,315 etp40 40 10000 +Ethernet160 320,321 etp41a 41 50000 +Ethernet162 322,323 etp41b 41 50000 +Ethernet164 328,329 etp42a 42 50000 +Ethernet166 330,331 etp42b 42 50000 +Ethernet168 336,337 etp43a 43 50000 +Ethernet170 338,339 etp43b 43 50000 +Ethernet172 344,345 etp44a 44 50000 +Ethernet174 346,347 etp44b 44 50000 +Ethernet176 352,353 etp45a 45 50000 +Ethernet178 354,355 etp45b 45 50000 +Ethernet180 360,361 etp46a 46 50000 +Ethernet182 362,363 etp46b 46 50000 +Ethernet184 368,369 etp47a 47 50000 +Ethernet186 370,371 etp47b 47 50000 +Ethernet188 376,377 etp48a 48 50000 +Ethernet190 378,379 etp48b 48 50000 +Ethernet192 384,385 etp49a 49 50000 +Ethernet194 386,387 etp49b 49 50000 +Ethernet196 392,393 etp50a 50 50000 +Ethernet198 394,395 etp50b 50 50000 +Ethernet200 400,401 etp51a 51 50000 +Ethernet202 402,403 etp51b 51 50000 +Ethernet204 408,409 etp52a 52 50000 +Ethernet206 410,411 etp52b 52 50000 +Ethernet208 416,417,418,419 etp53 53 100000 +Ethernet212 424,425,426,427 etp54 54 100000 +Ethernet216 432,433,434,435 etp55 55 100000 +Ethernet220 440,441,442,443 etp56 56 100000 +Ethernet224 448,449,450,451 etp57 57 100000 +Ethernet228 456,457,458,459 etp58 58 100000 +Ethernet232 464,465,466,467 etp59 59 100000 +Ethernet236 472,473,474,475 etp60 60 100000 +Ethernet240 480,481 etp61a 61 50000 +Ethernet242 482,483 etp61b 61 50000 +Ethernet244 488,489 etp62a 62 50000 +Ethernet246 490,491 etp62b 62 50000 +Ethernet248 496,497 etp63a 63 50000 +Ethernet250 498,499 etp63b 63 50000 +Ethernet252 504,505 etp64a 64 50000 +Ethernet254 506,507 etp64b 64 50000 diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D100C12S2/qos.json.j2 b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D100C12S2/qos.json.j2 new file mode 120000 index 000000000000..05394016a129 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D100C12S2/qos.json.j2 @@ -0,0 +1 @@ +../ACS-MSN4600C/qos.json.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D100C12S2/sai.profile b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D100C12S2/sai.profile new file mode 100644 index 000000000000..c05c9ac6a1d1 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D100C12S2/sai.profile @@ -0,0 +1,4 @@ +SAI_VXLAN_SRCPORT_RANGE_ENABLE=1 +SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_4600c_100x50g_12x100g_2x10g.xml +SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps +SAI_DUMP_STORE_AMOUNT=10 diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D100C12S2/sai_4600c_100x50g_12x100g_2x10g.xml b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D100C12S2/sai_4600c_100x50g_12x100g_2x10g.xml new file mode 100644 index 000000000000..bcf792d6337c --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D100C12S2/sai_4600c_100x50g_12x100g_2x10g.xml @@ -0,0 +1,525 @@ + + + + + 00:02:03:04:05:80 + + + 1 + + + 64 + + + + + 105 + 2 + 4 + 0 + + + 1 + + + 384 + + + 107 + 2 + 4 + 1 + 1 + 384 + + + 109 + 2 + 4 + 2 + 1 + 384 + + + 111 + 2 + 4 + 3 + 1 + 384 + + + 97 + 2 + 4 + 4 + 1 + 384 + + + 99 + 2 + 4 + 5 + 1 + 384 + + + 101 + 2 + 4 + 6 + 1 + 384 + + + 103 + 2 + 4 + 7 + 1 + 384 + + + 121 + 2 + 4 + 8 + 1 + 384 + + + 123 + 2 + 4 + 9 + 1 + 384 + + + 125 + 2 + 4 + 10 + 1 + 384 + + + 127 + 2 + 4 + 11 + 1 + 384 + + + 113 + 1 + 4 + 12 + 0 + 1536 + + + 115 + 2 + 4 + 13 + 1 + 384 + + + 117 + 2 + 4 + 14 + 1 + 384 + + + 119 + 1 + 4 + 15 + 0 + 1536 + + + 89 + 2 + 4 + 16 + 1 + 384 + + + 91 + 2 + 4 + 17 + 1 + 384 + + + 93 + 2 + 4 + 18 + 1 + 384 + + + 95 + 2 + 4 + 19 + 1 + 384 + + + 81 + 2 + 4 + 20 + 1 + 384 + + + 83 + 2 + 4 + 21 + 1 + 384 + + + 85 + 2 + 4 + 22 + 1 + 384 + + + 87 + 2 + 4 + 23 + 1 + 384 + + + 73 + 4 + 24 + 1 + 384 + 2 + + 75 + 4 + 25 + 1 + 384 + 2 + + 77 + 2 + 4 + 26 + 1 + 384 + + + 79 + 2 + 4 + 27 + 1 + 384 + + + 65 + 4 + 28 + 1 + 384 + 2 + + 67 + 4 + 29 + 1 + 384 + 2 + + 69 + 2 + 4 + 30 + 1 + 384 + + + 71 + 2 + 4 + 31 + 1 + 384 + + + 5 + 4 + 32 + 0 + 1536 + 1 + + 7 + 4 + 33 + 1 + 384 + 2 + + 1 + 2 + 4 + 34 + 1 + 384 + + + 3 + 1 + 4 + 35 + 0 + 1536 + + + 13 + 4 + 36 + 1 + 384 + 2 + + 15 + 4 + 37 + 0 + 16 + 1 + + 9 + 2 + 4 + 38 + 1 + 384 + + + 11 + 1 + 4 + 39 + 0 + 16 + + + 21 + 2 + 4 + 40 + 1 + 384 + + + 23 + 2 + 4 + 41 + 1 + 384 + + + 17 + 2 + 4 + 42 + 1 + 384 + + + 19 + 2 + 4 + 43 + 1 + 384 + + + 29 + 2 + 4 + 44 + 1 + 384 + + + 31 + 2 + 4 + 45 + 1 + 384 + + + 25 + 2 + 4 + 46 + 1 + 384 + + + 27 + 2 + 4 + 47 + 1 + 384 + + + 53 + 2 + 4 + 48 + 1 + 384 + + + 55 + 2 + 4 + 49 + 1 + 384 + + + 49 + 2 + 4 + 50 + 1 + 384 + + + 51 + 2 + 4 + 51 + 1 + 384 + + + 61 + 1 + 4 + 52 + 0 + 1536 + + + 63 + 1 + 4 + 53 + 0 + 1536 + + + 57 + 1 + 4 + 54 + 0 + 1536 + + + 59 + 1 + 4 + 55 + 0 + 1536 + + + 37 + 1 + 4 + 56 + 0 + 1536 + + + 39 + 1 + 4 + 57 + 0 + 1536 + + + 33 + 1 + 4 + 58 + 0 + 1536 + + + 35 + 1 + 4 + 59 + 0 + 1536 + + + 45 + 2 + 4 + 60 + 1 + 384 + + + 47 + 2 + 4 + 61 + 1 + 384 + + + 41 + 2 + 4 + 62 + 1 + 384 + + + 43 + 2 + 4 + 63 + 1 + 384 + + + + diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/buffers_defaults_objects.j2 b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/buffers_defaults_objects.j2 new file mode 120000 index 000000000000..c01aebb7ae12 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/buffers_defaults_objects.j2 @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/buffers_defaults_objects.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/buffers_defaults_t0.j2 b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/buffers_defaults_t0.j2 index 33df493e117e..6fb737ce74b6 100644 --- a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/buffers_defaults_t0.j2 +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/buffers_defaults_t0.j2 @@ -1,102 +1,23 @@ {% set default_cable = '5m' %} -{% set ingress_lossless_pool_size = '56369152' %} +{% set ingress_lossless_pool_size = '43827200' %} +{% set ingress_lossless_pool_xoff = '3702784' %} {% set egress_lossless_pool_size = '60817392' %} -{% set egress_lossy_pool_size = '56369152' %} +{% set egress_lossy_pool_size = '43827200' %} -{%- macro generate_port_lists(PORT_ALL) %} - {# Generate list of ports #} - {%- for port_idx in range(0, 32) %} - {%- if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{%- endif %} - {%- endfor %} -{%- endmacro %} +{% import 'buffers_defaults_objects.j2' as defs with context %} -{%- macro generate_buffer_pool_and_profiles() %} - "BUFFER_POOL": { - "ingress_lossless_pool": { - {%- if dynamic_mode is not defined %} - "size": "{{ ingress_lossless_pool_size }}", - {%- endif %} - "type": "ingress", - "mode": "dynamic" - }, - "egress_lossless_pool": { - "size": "{{ egress_lossless_pool_size }}", - "type": "egress", - "mode": "dynamic" - }, - "egress_lossy_pool": { - {%- if dynamic_mode is not defined %} - "size": "{{ egress_lossy_pool_size }}", - {%- endif %} - "type": "egress", - "mode": "dynamic" - } - }, - "BUFFER_PROFILE": { - "ingress_lossless_profile": { - "pool":"[BUFFER_POOL|ingress_lossless_pool]", - "size":"0", - "dynamic_th":"7" - }, - "ingress_lossy_profile": { - "pool":"[BUFFER_POOL|ingress_lossy_pool]", - "size":"0", - "dynamic_th":"3" - }, - "egress_lossless_profile": { - "pool":"[BUFFER_POOL|egress_lossless_pool]", - "size":"0", - "dynamic_th":"7" - }, - "egress_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"4096", - "dynamic_th":"7" - }, - "q_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"0", - "dynamic_th":"3" - } - }, +{%- macro generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) %} +{{ defs.generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) }} {%- endmacro %} -{%- macro generate_profile_lists(port_names) %} - "BUFFER_PORT_INGRESS_PROFILE_LIST": { -{% for port in port_names.split(',') %} - "{{ port }}": { - "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" - }{% if not loop.last %},{% endif %} - -{% endfor %} - }, - "BUFFER_PORT_EGRESS_PROFILE_LIST": { -{% for port in port_names.split(',') %} - "{{ port }}": { - "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" - }{% if not loop.last %},{% endif %} - -{% endfor %} - } +{%- macro generate_profile_lists_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_profile_lists(port_names_active, port_names_inactive) }} {%- endmacro %} -{%- macro generate_queue_buffers(port_names) %} - "BUFFER_QUEUE": { -{% for port in port_names.split(',') %} - "{{ port }}|3-4": { - "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" - }, -{% endfor %} -{% for port in port_names.split(',') %} - "{{ port }}|0-2": { - "profile" : "[BUFFER_PROFILE|q_lossy_profile]" - }, -{% endfor %} -{% for port in port_names.split(',') %} - "{{ port }}|5-6": { - "profile" : "[BUFFER_PROFILE|q_lossy_profile]" - }{% if not loop.last %},{% endif %} +{%- macro generate_queue_buffers_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_queue_buffers(port_names_active, port_names_inactive) }} +{%- endmacro %} -{% endfor %} - } +{%- macro generate_pg_profiles_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_pg_profiles(port_names_active, port_names_inactive) }} {%- endmacro %} diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/buffers_defaults_t1.j2 b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/buffers_defaults_t1.j2 index 7b6e6fdf3883..da83ea7444a6 100644 --- a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/buffers_defaults_t1.j2 +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/buffers_defaults_t1.j2 @@ -1,102 +1,23 @@ {% set default_cable = '5m' %} -{% set ingress_lossless_pool_size = '55115776' %} +{% set ingress_lossless_pool_size = '43048960' %} +{% set ingress_lossless_pool_xoff = '4481024' %} {% set egress_lossless_pool_size = '60817392' %} -{% set egress_lossy_pool_size = '55115776' %} +{% set egress_lossy_pool_size = '43048960' %} -{%- macro generate_port_lists(PORT_ALL) %} - {# Generate list of ports #} - {%- for port_idx in range(0, 32) %} - {%- if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{%- endif %} - {%- endfor %} -{%- endmacro %} +{% import 'buffers_defaults_objects.j2' as defs with context %} -{%- macro generate_buffer_pool_and_profiles() %} - "BUFFER_POOL": { - "ingress_lossless_pool": { - {%- if dynamic_mode is not defined %} - "size": "{{ ingress_lossless_pool_size }}", - {%- endif %} - "type": "ingress", - "mode": "dynamic" - }, - "egress_lossless_pool": { - "size": "{{ egress_lossless_pool_size }}", - "type": "egress", - "mode": "dynamic" - }, - "egress_lossy_pool": { - {%- if dynamic_mode is not defined %} - "size": "{{ egress_lossy_pool_size }}", - {%- endif %} - "type": "egress", - "mode": "dynamic" - } - }, - "BUFFER_PROFILE": { - "ingress_lossless_profile": { - "pool":"[BUFFER_POOL|ingress_lossless_pool]", - "size":"0", - "dynamic_th":"7" - }, - "ingress_lossy_profile": { - "pool":"[BUFFER_POOL|ingress_lossy_pool]", - "size":"0", - "dynamic_th":"3" - }, - "egress_lossless_profile": { - "pool":"[BUFFER_POOL|egress_lossless_pool]", - "size":"0", - "dynamic_th":"7" - }, - "egress_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"4096", - "dynamic_th":"7" - }, - "q_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"0", - "dynamic_th":"3" - } - }, +{%- macro generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) %} +{{ defs.generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) }} {%- endmacro %} -{%- macro generate_profile_lists(port_names) %} - "BUFFER_PORT_INGRESS_PROFILE_LIST": { -{% for port in port_names.split(',') %} - "{{ port }}": { - "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" - }{% if not loop.last %},{% endif %} - -{% endfor %} - }, - "BUFFER_PORT_EGRESS_PROFILE_LIST": { -{% for port in port_names.split(',') %} - "{{ port }}": { - "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" - }{% if not loop.last %},{% endif %} - -{% endfor %} - } +{%- macro generate_profile_lists_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_profile_lists(port_names_active, port_names_inactive) }} {%- endmacro %} -{%- macro generate_queue_buffers(port_names) %} - "BUFFER_QUEUE": { -{% for port in port_names.split(',') %} - "{{ port }}|3-4": { - "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" - }, -{% endfor %} -{% for port in port_names.split(',') %} - "{{ port }}|0-2": { - "profile" : "[BUFFER_PROFILE|q_lossy_profile]" - }, -{% endfor %} -{% for port in port_names.split(',') %} - "{{ port }}|5-6": { - "profile" : "[BUFFER_PROFILE|q_lossy_profile]" - }{% if not loop.last %},{% endif %} +{%- macro generate_queue_buffers_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_queue_buffers(port_names_active, port_names_inactive) }} +{%- endmacro %} -{% endfor %} - } +{%- macro generate_pg_profiles_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_pg_profiles(port_names_active, port_names_inactive) }} {%- endmacro %} diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/pg_profile_lookup.ini b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/pg_profile_lookup.ini index ab397d98de54..d2b8e16d96b2 100644 --- a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/pg_profile_lookup.ini +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/pg_profile_lookup.ini @@ -1,17 +1,22 @@ # PG lossless profiles. # speed cable size xon xoff threshold - 10000 5m 44032 19456 24576 0 - 25000 5m 44032 19456 24576 0 - 40000 5m 44032 19456 24576 0 - 50000 5m 44032 19456 24576 0 - 100000 5m 45056 19456 25600 0 - 10000 40m 44032 19456 24576 0 - 25000 40m 46080 19456 26624 0 - 40000 40m 47104 19456 27648 0 - 50000 40m 48128 19456 28672 0 - 100000 40m 52224 19456 32768 0 - 10000 300m 50176 19456 30720 0 - 25000 300m 59392 19456 39936 0 - 40000 300m 68608 19456 49152 0 - 50000 300m 74752 19456 55296 0 - 100000 300m 105472 19456 86016 0 + 10000 5m 19456 19456 24576 0 + 25000 5m 19456 19456 26624 0 + 40000 5m 19456 19456 30720 0 + 50000 5m 19456 19456 33792 0 + 100000 5m 19456 19456 59392 0 + 10000 40m 19456 19456 25600 0 + 25000 40m 19456 19456 28672 0 + 40000 40m 19456 19456 33792 0 + 50000 40m 19456 19456 36864 0 + 100000 40m 19456 19456 66560 0 + 10000 300m 19456 19456 30720 0 + 25000 300m 19456 19456 41984 0 + 40000 300m 19456 19456 54272 0 + 50000 300m 19456 19456 63488 0 + 100000 300m 19456 19456 120832 0 + 10000 2000m 19456 19456 32768 0 + 25000 2000m 19456 19456 64512 0 + 40000 2000m 19456 19456 97280 0 + 50000 2000m 19456 19456 119808 0 + 100000 2000m 19456 19456 234496 0 diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/port_config.ini b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/port_config.ini index eb4cdc35637b..be2c7d9255ca 100644 --- a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/port_config.ini +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/port_config.ini @@ -1,105 +1,121 @@ # name lanes alias index speed fec Ethernet0 0,1 etp1a 1 50000 none Ethernet2 2,3 etp1b 1 50000 none -Ethernet8 8,9 etp2a 2 50000 none -Ethernet10 10,11 etp2b 2 50000 none -Ethernet16 16,17 etp3a 3 50000 none -Ethernet18 18,19 etp3b 3 50000 none -Ethernet24 24,25,26,27 etp4 4 100000 rs -Ethernet32 32,33 etp5a 5 50000 none -Ethernet34 34,35 etp5b 5 50000 none -Ethernet40 40,41 etp6a 6 50000 none -Ethernet42 42,43 etp6b 6 50000 none -Ethernet48 48,49 etp7a 7 50000 none -Ethernet50 50,51 etp7b 7 50000 none -Ethernet56 56,57,58,59 etp8 8 100000 rs -Ethernet64 64,65 etp9a 9 50000 none -Ethernet66 66,67 etp9b 9 50000 none -Ethernet72 72,73 etp10a 10 50000 none -Ethernet74 74,75 etp10b 10 50000 none -Ethernet80 80,81 etp11a 11 50000 none -Ethernet82 82,83 etp11b 11 50000 none -Ethernet88 88,89,90,91 etp12 12 100000 rs -Ethernet96 96,97 etp13a 13 50000 none -Ethernet98 98,99 etp13b 13 50000 none -Ethernet104 104,105 etp14a 14 50000 none -Ethernet106 106,107 etp14b 14 50000 none -Ethernet112 112,113 etp15a 15 50000 none -Ethernet114 114,115 etp15b 15 50000 none -Ethernet120 120,121,122,123 etp16 16 100000 rs -Ethernet128 128,129 etp17a 17 50000 none -Ethernet130 130,131 etp17b 17 50000 none -Ethernet136 136,137 etp18a 18 50000 none -Ethernet138 138,139 etp18b 18 50000 none -Ethernet144 144,145 etp19a 19 50000 none -Ethernet146 146,147 etp19b 19 50000 none -Ethernet152 152,153,154,155 etp20 20 100000 rs -Ethernet160 160,161 etp21a 21 50000 none -Ethernet162 162,163 etp21b 21 50000 none -Ethernet168 168,169 etp22a 22 50000 none -Ethernet170 170,171 etp22b 22 50000 none -Ethernet176 176,177 etp23a 23 50000 none -Ethernet178 178,179 etp23b 23 50000 none -Ethernet184 184,185,186,187 etp24 24 100000 rs -Ethernet192 192,193,194,195 etp25 25 100000 rs -Ethernet200 200,201,202,203 etp26 26 100000 rs -Ethernet208 208,209 etp27a 27 50000 none -Ethernet210 210,211 etp27b 27 50000 none -Ethernet216 216,217,218,219 etp28 28 100000 rs -Ethernet224 224,225,226,227 etp29 29 100000 rs -Ethernet232 232,233,234,235 etp30 30 100000 rs -Ethernet240 240,241 etp31a 31 50000 none -Ethernet242 242,243 etp31b 31 50000 none -Ethernet248 248,249,250,251 etp32 32 100000 rs -Ethernet256 256,257,258,259 etp33 33 100000 rs -Ethernet264 264,265,266,267 etp34 34 100000 rs -Ethernet272 272,273 etp35a 35 50000 none -Ethernet274 274,275 etp35b 35 50000 none -Ethernet280 280,281,282,283 etp36 36 100000 rs -Ethernet288 288,289,290,291 etp37 37 100000 rs -Ethernet296 296,297,298,299 etp38 38 100000 rs -Ethernet304 304,305 etp39a 39 50000 none -Ethernet306 306,307 etp39b 39 50000 none -Ethernet312 312,313,314,315 etp40 40 100000 rs -Ethernet320 320,321 etp41a 41 50000 none -Ethernet322 322,323 etp41b 41 50000 none -Ethernet328 328,329 etp42a 42 50000 none -Ethernet330 330,331 etp42b 42 50000 none -Ethernet336 336,337 etp43a 43 50000 none -Ethernet338 338,339 etp43b 43 50000 none -Ethernet344 344,345,346,347 etp44 44 100000 rs -Ethernet352 352,353 etp45a 45 50000 none -Ethernet354 354,355 etp45b 45 50000 none -Ethernet360 360,361 etp46a 46 50000 none -Ethernet362 362,363 etp46b 46 50000 none -Ethernet368 368,369 etp47a 47 50000 none -Ethernet370 370,371 etp47b 47 50000 none -Ethernet376 376,377,378,379 etp48 48 100000 rs -Ethernet384 384,385 etp49a 49 50000 none -Ethernet386 386,387 etp49b 49 50000 none -Ethernet392 392,393 etp50a 50 50000 none -Ethernet394 394,395 etp50b 50 50000 none -Ethernet400 400,401 etp51a 51 50000 none -Ethernet402 402,403 etp51b 51 50000 none -Ethernet408 408,409,410,411 etp52 52 100000 rs -Ethernet416 416,417 etp53a 53 50000 none -Ethernet418 418,419 etp53b 53 50000 none -Ethernet424 424,425 etp54a 54 50000 none -Ethernet426 426,427 etp54b 54 50000 none -Ethernet432 432,433 etp55a 55 50000 none -Ethernet434 434,435 etp55b 55 50000 none -Ethernet440 440,441,442,443 etp56 56 100000 rs -Ethernet448 448,449 etp57a 57 50000 none -Ethernet450 450,451 etp57b 57 50000 none -Ethernet456 456,457 etp58a 58 50000 none -Ethernet458 458,459 etp58b 58 50000 none -Ethernet464 464,465 etp59a 59 50000 none -Ethernet466 466,467 etp59b 59 50000 none -Ethernet472 472,473,474,475 etp60 60 100000 rs -Ethernet480 480,481 etp61a 61 50000 none -Ethernet482 482,483 etp61b 61 50000 none -Ethernet488 488,489 etp62a 62 50000 none -Ethernet490 490,491 etp62b 62 50000 none -Ethernet496 496,497 etp63a 63 50000 none -Ethernet498 498,499 etp63b 63 50000 none -Ethernet504 504,505,506,507 etp64 64 100000 rs +Ethernet4 8,9 etp2a 2 50000 none +Ethernet6 10,11 etp2b 2 50000 none +Ethernet8 16,17 etp3a 3 50000 none +Ethernet10 18,19 etp3b 3 50000 none +Ethernet12 24,25 etp4a 4 50000 none +Ethernet14 26,27 etp4b 4 50000 none +Ethernet16 32,33 etp5a 5 50000 none +Ethernet18 34,35 etp5b 5 50000 none +Ethernet20 40,41 etp6a 6 50000 none +Ethernet22 42,43 etp6b 6 50000 none +Ethernet24 48,49 etp7a 7 50000 none +Ethernet26 50,51 etp7b 7 50000 none +Ethernet28 56,57 etp8a 8 50000 none +Ethernet30 58,59 etp8b 8 50000 none +Ethernet32 64,65 etp9a 9 50000 none +Ethernet34 66,67 etp9b 9 50000 none +Ethernet36 72,73 etp10a 10 50000 none +Ethernet38 74,75 etp10b 10 50000 none +Ethernet40 80,81 etp11a 11 50000 none +Ethernet42 82,83 etp11b 11 50000 none +Ethernet44 88,89 etp12a 12 50000 none +Ethernet46 90,91 etp12b 12 50000 none +Ethernet48 96,97 etp13a 13 50000 none +Ethernet50 98,99 etp13b 13 50000 none +Ethernet52 104,105 etp14a 14 50000 none +Ethernet54 106,107 etp14b 14 50000 none +Ethernet56 112,113 etp15a 15 50000 none +Ethernet58 114,115 etp15b 15 50000 none +Ethernet60 120,121 etp16a 16 50000 none +Ethernet62 122,123 etp16b 16 50000 none +Ethernet64 128,129 etp17a 17 50000 none +Ethernet66 130,131 etp17b 17 50000 none +Ethernet68 136,137 etp18a 18 50000 none +Ethernet70 138,139 etp18b 18 50000 none +Ethernet72 144,145 etp19a 19 50000 none +Ethernet74 146,147 etp19b 19 50000 none +Ethernet76 152,153 etp20a 20 50000 none +Ethernet78 154,155 etp20b 20 50000 none +Ethernet80 160,161 etp21a 21 50000 none +Ethernet82 162,163 etp21b 21 50000 none +Ethernet84 168,169 etp22a 22 50000 none +Ethernet86 170,171 etp22b 22 50000 none +Ethernet88 176,177 etp23a 23 50000 none +Ethernet90 178,179 etp23b 23 50000 none +Ethernet92 184,185 etp24a 24 50000 none +Ethernet94 186,187 etp24b 24 50000 none +Ethernet96 192,193,194,195 etp25 25 100000 rs +Ethernet100 200,201,202,203 etp26 26 100000 rs +Ethernet104 208,209 etp27a 27 50000 none +Ethernet106 210,211 etp27b 27 50000 none +Ethernet108 216,217 etp28a 28 50000 none +Ethernet110 218,219 etp28b 28 50000 none +Ethernet112 224,225,226,227 etp29 29 100000 rs +Ethernet116 232,233,234,235 etp30 30 100000 rs +Ethernet120 240,241 etp31a 31 50000 none +Ethernet122 242,243 etp31b 31 50000 none +Ethernet124 248,249 etp32a 32 50000 none +Ethernet126 250,251 etp32b 32 50000 none +Ethernet128 256,257,258,259 etp33 33 100000 rs +Ethernet132 264,265,266,267 etp34 34 100000 rs +Ethernet136 272,273 etp35a 35 50000 none +Ethernet138 274,275 etp35b 35 50000 none +Ethernet140 280,281 etp36a 36 50000 none +Ethernet142 282,283 etp36b 36 50000 none +Ethernet144 288,289,290,291 etp37 37 100000 rs +Ethernet148 296,297,298,299 etp38 38 100000 rs +Ethernet152 304,305 etp39a 39 50000 none +Ethernet154 306,307 etp39b 39 50000 none +Ethernet156 312,313 etp40a 40 50000 none +Ethernet158 314,315 etp40b 40 50000 none +Ethernet160 320,321 etp41a 41 50000 none +Ethernet162 322,323 etp41b 41 50000 none +Ethernet164 328,329 etp42a 42 50000 none +Ethernet166 330,331 etp42b 42 50000 none +Ethernet168 336,337 etp43a 43 50000 none +Ethernet170 338,339 etp43b 43 50000 none +Ethernet172 344,345 etp44a 44 50000 none +Ethernet174 346,347 etp44b 44 50000 none +Ethernet176 352,353 etp45a 45 50000 none +Ethernet178 354,355 etp45b 45 50000 none +Ethernet180 360,361 etp46a 46 50000 none +Ethernet182 362,363 etp46b 46 50000 none +Ethernet184 368,369 etp47a 47 50000 none +Ethernet186 370,371 etp47b 47 50000 none +Ethernet188 376,377 etp48a 48 50000 none +Ethernet190 378,379 etp48b 48 50000 none +Ethernet192 384,385 etp49a 49 50000 none +Ethernet194 386,387 etp49b 49 50000 none +Ethernet196 392,393 etp50a 50 50000 none +Ethernet198 394,395 etp50b 50 50000 none +Ethernet200 400,401 etp51a 51 50000 none +Ethernet202 402,403 etp51b 51 50000 none +Ethernet204 408,409 etp52a 52 50000 none +Ethernet206 410,411 etp52b 52 50000 none +Ethernet208 416,417 etp53a 53 50000 none +Ethernet210 418,419 etp53b 53 50000 none +Ethernet212 424,425 etp54a 54 50000 none +Ethernet214 426,427 etp54b 54 50000 none +Ethernet216 432,433 etp55a 55 50000 none +Ethernet218 434,435 etp55b 55 50000 none +Ethernet220 440,441 etp56a 56 50000 none +Ethernet222 442,443 etp56b 56 50000 none +Ethernet224 448,449 etp57a 57 50000 none +Ethernet226 450,451 etp57b 57 50000 none +Ethernet228 456,457 etp58a 58 50000 none +Ethernet230 458,459 etp58b 58 50000 none +Ethernet232 464,465 etp59a 59 50000 none +Ethernet234 466,467 etp59b 59 50000 none +Ethernet236 472,473 etp60a 60 50000 none +Ethernet238 474,475 etp60b 60 50000 none +Ethernet240 480,481 etp61a 61 50000 none +Ethernet242 482,483 etp61b 61 50000 none +Ethernet244 488,489 etp62a 62 50000 none +Ethernet246 490,491 etp62b 62 50000 none +Ethernet248 496,497 etp63a 63 50000 none +Ethernet250 498,499 etp63b 63 50000 none +Ethernet252 504,505 etp64a 64 50000 none +Ethernet254 506,507 etp64b 64 50000 none \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/sai.profile b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/sai.profile index 15fccb416efd..eef447eba2f4 100644 --- a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/sai.profile @@ -1 +1,3 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_4600c_112x50g_8x100g.xml +SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps +SAI_DUMP_STORE_AMOUNT=10 diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/sai_4600c_112x50g_8x100g.xml b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/sai_4600c_112x50g_8x100g.xml index 199c251fbee2..34e85b726957 100644 --- a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/sai_4600c_112x50g_8x100g.xml +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D112C8/sai_4600c_112x50g_8x100g.xml @@ -7,7 +7,7 @@ 1 - + 64 @@ -43,10 +43,11 @@ 111 + 2 4 3 3 - 1536 + 384 97 @@ -74,10 +75,11 @@ 103 + 2 4 7 3 - 1536 + 384 121 @@ -105,10 +107,11 @@ 127 + 2 4 11 3 - 1536 + 384 113 @@ -136,10 +139,11 @@ 119 + 2 4 15 3 - 1536 + 384 89 @@ -167,10 +171,11 @@ 95 + 2 4 19 3 - 1536 + 384 81 @@ -198,10 +203,11 @@ 87 + 2 4 23 3 - 1536 + 384 73 @@ -227,10 +233,11 @@ 79 + 2 4 27 3 - 1536 + 384 65 @@ -256,10 +263,11 @@ 71 + 2 4 31 3 - 1536 + 384 5 @@ -285,10 +293,11 @@ 3 + 2 4 35 3 - 1536 + 384 13 @@ -314,10 +323,11 @@ 11 + 2 4 39 3 - 1536 + 384 21 @@ -345,10 +355,11 @@ 19 + 2 4 43 3 - 1536 + 384 29 @@ -376,10 +387,11 @@ 27 + 2 4 47 3 - 1536 + 384 53 @@ -407,10 +419,11 @@ 51 + 2 4 51 3 - 1536 + 384 61 @@ -438,10 +451,11 @@ 59 + 2 4 55 3 - 1536 + 384 37 @@ -469,10 +483,11 @@ 35 + 2 4 59 3 - 1536 + 384 45 @@ -500,10 +515,11 @@ 43 + 2 4 63 3 - 1536 + 384 diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D48C40/buffers.json.j2 b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D48C40/buffers.json.j2 new file mode 120000 index 000000000000..117d740b0f5b --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D48C40/buffers.json.j2 @@ -0,0 +1 @@ +../ACS-MSN4600C/buffers.json.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D48C40/buffers_defaults_objects.j2 b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D48C40/buffers_defaults_objects.j2 new file mode 120000 index 000000000000..c01aebb7ae12 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D48C40/buffers_defaults_objects.j2 @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/buffers_defaults_objects.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D48C40/buffers_defaults_t0.j2 b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D48C40/buffers_defaults_t0.j2 new file mode 100644 index 000000000000..2c461a823b1f --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D48C40/buffers_defaults_t0.j2 @@ -0,0 +1,23 @@ +{% set default_cable = '5m' %} +{% set ingress_lossless_pool_size = '47398912' %} +{% set ingress_lossless_pool_xoff = '3604480' %} +{% set egress_lossless_pool_size = '60817392' %} +{% set egress_lossy_pool_size = '47398912' %} + +{% import 'buffers_defaults_objects.j2' as defs with context %} + +{%- macro generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) %} +{{ defs.generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_profile_lists_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_profile_lists(port_names_active, port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_queue_buffers_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_queue_buffers(port_names_active, port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_pg_profiles_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_pg_profiles(port_names_active, port_names_inactive) }} +{%- endmacro %} diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D48C40/buffers_defaults_t1.j2 b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D48C40/buffers_defaults_t1.j2 new file mode 100644 index 000000000000..86cb72c9fd31 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D48C40/buffers_defaults_t1.j2 @@ -0,0 +1,23 @@ +{% set default_cable = '5m' %} +{% set ingress_lossless_pool_size = '46587904' %} +{% set ingress_lossless_pool_xoff = '4415488' %} +{% set egress_lossless_pool_size = '60817392' %} +{% set egress_lossy_pool_size = '46587904' %} + +{% import 'buffers_defaults_objects.j2' as defs with context %} + +{%- macro generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) %} +{{ defs.generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_profile_lists_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_profile_lists(port_names_active, port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_queue_buffers_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_queue_buffers(port_names_active, port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_pg_profiles_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_pg_profiles(port_names_active, port_names_inactive) }} +{%- endmacro %} diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D48C40/buffers_dynamic.json.j2 b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D48C40/buffers_dynamic.json.j2 new file mode 120000 index 000000000000..8c4117c66214 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D48C40/buffers_dynamic.json.j2 @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/ACS-MSN2700/buffers_dynamic.json.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D48C40/pg_profile_lookup.ini b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D48C40/pg_profile_lookup.ini new file mode 120000 index 000000000000..49745268908f --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D48C40/pg_profile_lookup.ini @@ -0,0 +1 @@ +../Mellanox-SN4600C-D112C8/pg_profile_lookup.ini \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D48C40/port_config.ini b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D48C40/port_config.ini new file mode 100644 index 000000000000..f98cd3b232fa --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D48C40/port_config.ini @@ -0,0 +1,89 @@ +# name lanes alias index speed +Ethernet0 0,1 etp1a 1 50000 +Ethernet2 2,3 etp1b 1 50000 +Ethernet4 8,9 etp2a 2 50000 +Ethernet6 10,11 etp2b 2 50000 +Ethernet8 16,17 etp3a 3 50000 +Ethernet10 18,19 etp3b 3 50000 +Ethernet12 24,25 etp4a 4 50000 +Ethernet14 26,27 etp4b 4 50000 +Ethernet16 32,33 etp5a 5 50000 +Ethernet18 34,35 etp5b 5 50000 +Ethernet20 40,41 etp6a 6 50000 +Ethernet22 42,43 etp6b 6 50000 +Ethernet24 48,49 etp7a 7 50000 +Ethernet26 50,51 etp7b 7 50000 +Ethernet28 56,57 etp8a 8 50000 +Ethernet30 58,59 etp8b 8 50000 +Ethernet32 64,65 etp9a 9 50000 +Ethernet34 66,67 etp9b 9 50000 +Ethernet36 72,73 etp10a 10 50000 +Ethernet38 74,75 etp10b 10 50000 +Ethernet40 80,81,82,83 etp11 11 100000 +Ethernet44 88,89,90,91 etp12 12 100000 +Ethernet48 96,97 etp13a 13 50000 +Ethernet50 98,99 etp13b 13 50000 +Ethernet52 104,105 etp14a 14 50000 +Ethernet54 106,107 etp14b 14 50000 +Ethernet56 112,113,114,115 etp15 15 100000 +Ethernet60 120,121,122,123 etp16 16 100000 +Ethernet64 128,129,130,131 etp17 17 100000 +Ethernet68 136,137,138,139 etp18 18 100000 +Ethernet72 144,145,146,147 etp19 19 100000 +Ethernet76 152,153,154,155 etp20 20 100000 +Ethernet80 160,161,162,163 etp21 21 100000 +Ethernet84 168,169,170,171 etp22 22 100000 +Ethernet88 176,177,178,179 etp23 23 100000 +Ethernet92 184,185,186,187 etp24 24 100000 +Ethernet96 192,193,194,195 etp25 25 100000 +Ethernet100 200,201,202,203 etp26 26 100000 +Ethernet104 208,209,210,211 etp27 27 100000 +Ethernet108 216,217,218,219 etp28 28 100000 +Ethernet112 224,225,226,227 etp29 29 100000 +Ethernet116 232,233,234,235 etp30 30 100000 +Ethernet120 240,241,242,243 etp31 31 100000 +Ethernet124 248,249,250,251 etp32 32 100000 +Ethernet128 256,257,258,259 etp33 33 100000 +Ethernet132 264,265,266,267 etp34 34 100000 +Ethernet136 272,273,274,275 etp35 35 100000 +Ethernet140 280,281,282,283 etp36 36 100000 +Ethernet144 288,289,290,291 etp37 37 100000 +Ethernet148 296,297,298,299 etp38 38 100000 +Ethernet152 304,305,306,307 etp39 39 100000 +Ethernet156 312,313,314,315 etp40 40 100000 +Ethernet160 320,321,322,323 etp41 41 100000 +Ethernet164 328,329,330,331 etp42 42 100000 +Ethernet168 336,337,338,339 etp43 43 100000 +Ethernet172 344,345,346,347 etp44 44 100000 +Ethernet176 352,353,354,355 etp45 45 100000 +Ethernet180 360,361,362,363 etp46 46 100000 +Ethernet184 368,369,370,371 etp47 47 100000 +Ethernet188 376,377,378,379 etp48 48 100000 +Ethernet192 384,385 etp49a 49 50000 +Ethernet194 386,387 etp49b 49 50000 +Ethernet196 392,393 etp50a 50 50000 +Ethernet198 394,395 etp50b 50 50000 +Ethernet200 400,401,402,403 etp51 51 100000 +Ethernet204 408,409,410,411 etp52 52 100000 +Ethernet208 416,417 etp53a 53 50000 +Ethernet210 418,419 etp53b 53 50000 +Ethernet212 424,425 etp54a 54 50000 +Ethernet214 426,427 etp54b 54 50000 +Ethernet216 432,433,434,435 etp55 55 100000 +Ethernet220 440,441,442,443 etp56 56 100000 +Ethernet224 448,449 etp57a 57 50000 +Ethernet226 450,451 etp57b 57 50000 +Ethernet228 456,457 etp58a 58 50000 +Ethernet230 458,459 etp58b 58 50000 +Ethernet232 464,465 etp59a 59 50000 +Ethernet234 466,467 etp59b 59 50000 +Ethernet236 472,473 etp60a 60 50000 +Ethernet238 474,475 etp60b 60 50000 +Ethernet240 480,481 etp61a 61 50000 +Ethernet242 482,483 etp61b 61 50000 +Ethernet244 488,489 etp62a 62 50000 +Ethernet246 490,491 etp62b 62 50000 +Ethernet248 496,497 etp63a 63 50000 +Ethernet250 498,499 etp63b 63 50000 +Ethernet252 504,505 etp64a 64 50000 +Ethernet254 506,507 etp64b 64 50000 diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D48C40/qos.json.j2 b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D48C40/qos.json.j2 new file mode 120000 index 000000000000..05394016a129 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D48C40/qos.json.j2 @@ -0,0 +1 @@ +../ACS-MSN4600C/qos.json.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D48C40/sai.profile b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D48C40/sai.profile new file mode 100644 index 000000000000..8719655c1ccc --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D48C40/sai.profile @@ -0,0 +1,4 @@ +SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_4600c_48x50g_40x100g.xml +SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps +SAI_DUMP_STORE_AMOUNT=10 +SAI_VXLAN_SRCPORT_RANGE_ENABLE=1 diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D48C40/sai_4600c_48x50g_40x100g.xml b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D48C40/sai_4600c_48x50g_40x100g.xml new file mode 100644 index 000000000000..bc26a518c08a --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-D48C40/sai_4600c_48x50g_40x100g.xml @@ -0,0 +1,494 @@ + + + + + + 00:02:03:04:05:80 + + + 1 + + + 64 + + + + + 105 + 2 + 4 + 0 + + + 1 + + + 384 + + + 107 + 2 + 4 + 1 + 1 + 384 + + + 109 + 2 + 4 + 2 + 1 + 384 + + + 111 + 2 + 4 + 3 + 1 + 384 + + + 97 + 2 + 4 + 4 + 1 + 384 + + + 99 + 2 + 4 + 5 + 1 + 384 + + + 101 + 2 + 4 + 6 + 1 + 384 + + + 103 + 2 + 4 + 7 + 1 + 384 + + + 121 + 2 + 4 + 8 + 1 + 384 + + + 123 + 2 + 4 + 9 + 1 + 384 + + + 125 + 4 + 10 + 0 + 1536 + + + 127 + 4 + 11 + 0 + 1536 + + + 113 + 2 + 4 + 12 + 1 + 384 + + + 115 + 2 + 4 + 13 + 1 + 384 + + + 117 + 4 + 14 + 0 + 1536 + + + 119 + 4 + 15 + 0 + 1536 + + + 89 + 4 + 16 + 0 + 1536 + + + 91 + 4 + 17 + 0 + 1536 + + + 93 + 4 + 18 + 0 + 1536 + + + 95 + 4 + 19 + 0 + 1536 + + + 81 + 4 + 20 + 0 + 1536 + + + 83 + 4 + 21 + 0 + 1536 + + + 85 + 4 + 22 + 0 + 1536 + + + 87 + 4 + 23 + 0 + 1536 + + + 73 + 4 + 24 + 0 + 1536 + + + 75 + 4 + 25 + 0 + 1536 + + + 77 + 4 + 26 + 0 + 1536 + + + 79 + 4 + 27 + 0 + 1536 + + + 65 + 4 + 28 + 0 + 1536 + + + 67 + 4 + 29 + 0 + 1536 + + + 69 + 4 + 30 + 0 + 1536 + + + 71 + 4 + 31 + 0 + 1536 + + + 5 + 4 + 32 + 0 + 1536 + + + 7 + 4 + 33 + 0 + 1536 + + + 1 + 4 + 34 + 0 + 1536 + + + 3 + 4 + 35 + 0 + 1536 + + + 13 + 4 + 36 + 0 + 1536 + + + 15 + 4 + 37 + 0 + 1536 + + + 9 + 4 + 38 + 0 + 1536 + + + 11 + 4 + 39 + 0 + 1536 + + + 21 + 4 + 40 + 0 + 1536 + + + 23 + 4 + 41 + 0 + 1536 + + + 17 + 4 + 42 + 0 + 1536 + + + 19 + 4 + 43 + 0 + 1536 + + + 29 + 4 + 44 + 0 + 1536 + + + 31 + 4 + 45 + 0 + 1536 + + + 25 + 4 + 46 + 0 + 1536 + + + 27 + 4 + 47 + 0 + 1536 + + + 53 + 2 + 4 + 48 + 1 + 384 + + + 55 + 2 + 4 + 49 + 1 + 384 + + + 49 + 4 + 50 + 0 + 1536 + + + 51 + 4 + 51 + 0 + 1536 + + + 61 + 2 + 4 + 52 + 1 + 384 + + + 63 + 2 + 4 + 53 + 1 + 384 + + + 57 + 4 + 54 + 0 + 1536 + + + 59 + 4 + 55 + 0 + 1536 + + + 37 + 2 + 4 + 56 + 1 + 384 + + + 39 + 2 + 4 + 57 + 1 + 384 + + + 33 + 2 + 4 + 58 + 1 + 384 + + + 35 + 2 + 4 + 59 + 1 + 384 + + + 45 + 2 + 4 + 60 + 1 + 384 + + + 47 + 2 + 4 + 61 + 1 + 384 + + + 41 + 2 + 4 + 62 + 1 + 384 + + + 43 + 2 + 4 + 63 + 1 + 384 + + + + diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/get_sensors_conf_path b/device/mellanox/x86_64-mlnx_msn4600c-r0/get_sensors_conf_path new file mode 100755 index 000000000000..07f1cb1e06f2 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/get_sensors_conf_path @@ -0,0 +1,50 @@ +#!/bin/bash + +HW_VERSION="/var/run/hw-management/system/config1" +HW_RESPIN_VERSION="/var/run/hw-management/system/config3" +SENSORS_CONF_FILE="/usr/share/sonic/platform/sensors.conf" +SENSORS_RESPIN_CONF_FILE="/usr/share/sonic/platform/sensors_respin.conf" +SENSORS_CONF_FILE_A1="/usr/share/sonic/platform/sensors.conf.a1" +SENSORS_RESPIN_CONF_FILE_A1="/usr/share/sonic/platform/sensors_respin.conf.a1" + +function get_sensor_conf_path() { + local _HW_VERSION="0" + local _HW_RESPIN_VERSION="0" + if [[ -e $HW_VERSION ]]; then + _HW_VERSION=$(cat $HW_VERSION 2>&1) + if [[ "$_HW_VERSION" == "1" ]]; then + if [[ -e $HW_RESPIN_VERSION ]]; then + _HW_RESPIN_VERSION=$(cat $HW_RESPIN_VERSION 2>&1) + if [[ "$_HW_RESPIN_VERSION" == "1" ]]; then + if [[ -e $SENSORS_RESPIN_CONF_FILE_A1 ]]; then + echo $SENSORS_RESPIN_CONF_FILE_A1 + return + fi + else + if [[ -e $SENSORS_CONF_FILE_A1 ]]; then + echo $SENSORS_CONF_FILE_A1 + return + fi + fi + else + if [[ -e $SENSORS_CONF_FILE_A1 ]]; then + echo $SENSORS_CONF_FILE_A1 + return + fi + fi + else + if [[ -e $HW_RESPIN_VERSION ]]; then + _HW_RESPIN_VERSION=$(cat $HW_RESPIN_VERSION 2>&1) + if [[ "$_HW_RESPIN_VERSION" == "1" ]]; then + if [[ -e $SENSORS_RESPIN_CONF_FILE ]]; then + echo $SENSORS_RESPIN_CONF_FILE + return + fi + fi + fi + fi + fi + echo $SENSORS_CONF_FILE +} + +get_sensor_conf_path diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/pcie.yaml b/device/mellanox/x86_64-mlnx_msn4600c-r0/pcie.yaml index dcfdf1c9a59c..d110ef7c79cb 100644 --- a/device/mellanox/x86_64-mlnx_msn4600c-r0/pcie.yaml +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/pcie.yaml @@ -71,37 +71,37 @@ name: 'USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB xHCI (rev 05)' - bus: '00' - dev: 1c + dev: '1c' fn: '0' id: 8c10 name: 'PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #1 (rev d5)' - bus: '00' - dev: 1c + dev: '1c' fn: '7' id: 8c1e name: 'PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #8 (rev d5)' - bus: '00' - dev: 1d + dev: '1d' fn: '0' id: 8c26 name: 'USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB EHCI #1 (rev 05)' - bus: '00' - dev: 1f + dev: '1f' fn: '0' id: 8c54 name: 'ISA bridge: Intel Corporation C224 Series Chipset Family Server Standard SKU LPC Controller (rev 05)' - bus: '00' - dev: 1f + dev: '1f' fn: '2' id: 8c02 name: 'SATA controller: Intel Corporation 8 Series/C220 Series Chipset Family 6-port SATA Controller 1 [AHCI mode] (rev 05)' - bus: '00' - dev: 1f + dev: '1f' fn: '3' id: 8c22 name: 'SMBus: Intel Corporation 8 Series/C220 Series Chipset Family SMBus Controller @@ -130,289 +130,289 @@ id: 6f53 name: 'System peripheral: Intel Corporation Xeon Processor D Family QuickData Technology Register DMA Channel 3' -- bus: '06' +- bus: '07' dev: '00' fn: '0' id: cf70 name: 'Ethernet controller: Mellanox Technologies Device cf70' -- bus: 08 +- bus: '09' dev: '00' fn: '0' - id: '1533' + id: 1533 name: 'Ethernet controller: Intel Corporation I210 Gigabit Network Connection (rev 03)' -- bus: ff - dev: 0b +- bus: 'ff' + dev: '0b' fn: '0' id: 6f81 name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D R3 QPI Link 0/1 (rev 03)' -- bus: ff - dev: 0b +- bus: 'ff' + dev: '0b' fn: '1' id: 6f36 name: 'Performance counters: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D R3 QPI Link 0/1 (rev 03)' -- bus: ff - dev: 0b +- bus: 'ff' + dev: '0b' fn: '2' id: 6f37 name: 'Performance counters: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D R3 QPI Link 0/1 (rev 03)' -- bus: ff - dev: 0b +- bus: 'ff' + dev: '0b' fn: '3' id: 6f76 name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D R3 QPI Link Debug (rev 03)' -- bus: ff - dev: 0c +- bus: 'ff' + dev: '0c' fn: '0' id: 6fe0 name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D Caching Agent (rev 03)' -- bus: ff - dev: 0c +- bus: 'ff' + dev: '0c' fn: '1' id: 6fe1 name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D Caching Agent (rev 03)' -- bus: ff - dev: 0c +- bus: 'ff' + dev: '0c' fn: '2' id: 6fe2 name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D Caching Agent (rev 03)' -- bus: ff - dev: 0c +- bus: 'ff' + dev: '0c' fn: '3' id: 6fe3 name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D Caching Agent (rev 03)' -- bus: ff - dev: 0f +- bus: 'ff' + dev: '0f' fn: '0' id: 6ff8 name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D Caching Agent (rev 03)' -- bus: ff - dev: 0f +- bus: 'ff' + dev: '0f' fn: '4' id: 6ffc name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D Caching Agent (rev 03)' -- bus: ff - dev: 0f +- bus: 'ff' + dev: '0f' fn: '5' id: 6ffd name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D Caching Agent (rev 03)' -- bus: ff - dev: 0f +- bus: 'ff' + dev: '0f' fn: '6' id: 6ffe name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D Caching Agent (rev 03)' -- bus: ff +- bus: 'ff' dev: '10' fn: '0' id: 6f1d name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D R2PCIe Agent (rev 03)' -- bus: ff +- bus: 'ff' dev: '10' fn: '1' id: 6f34 name: 'Performance counters: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D R2PCIe Agent (rev 03)' -- bus: ff +- bus: 'ff' dev: '10' fn: '5' id: 6f1e name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D Ubox (rev 03)' -- bus: ff +- bus: 'ff' dev: '10' fn: '6' id: 6f7d name: 'Performance counters: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D Ubox (rev 03)' -- bus: ff +- bus: 'ff' dev: '10' fn: '7' id: 6f1f name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D Ubox (rev 03)' -- bus: ff +- bus: 'ff' dev: '12' fn: '0' id: 6fa0 name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D Home Agent 0 (rev 03)' -- bus: ff +- bus: 'ff' dev: '12' fn: '1' id: 6f30 name: 'Performance counters: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D Home Agent 0 (rev 03)' -- bus: ff +- bus: 'ff' dev: '13' fn: '0' id: 6fa8 name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D Memory Controller 0 - Target Address/Thermal/RAS (rev 03)' -- bus: ff +- bus: 'ff' dev: '13' fn: '1' id: 6f71 name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D Memory Controller 0 - Target Address/Thermal/RAS (rev 03)' -- bus: ff +- bus: 'ff' dev: '13' fn: '2' id: 6faa name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D Memory Controller 0 - Channel Target Address Decoder (rev 03)' -- bus: ff +- bus: 'ff' dev: '13' fn: '3' id: 6fab name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D Memory Controller 0 - Channel Target Address Decoder (rev 03)' -- bus: ff +- bus: 'ff' dev: '13' fn: '4' id: 6fac name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D Memory Controller 0 - Channel Target Address Decoder (rev 03)' -- bus: ff +- bus: 'ff' dev: '13' fn: '5' id: 6fad name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D Memory Controller 0 - Channel Target Address Decoder (rev 03)' -- bus: ff +- bus: 'ff' dev: '13' fn: '6' id: 6fae name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D DDRIO Channel 0/1 Broadcast (rev 03)' -- bus: ff +- bus: 'ff' dev: '13' fn: '7' id: 6faf name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D DDRIO Global Broadcast (rev 03)' -- bus: ff +- bus: 'ff' dev: '14' fn: '0' id: 6fb0 name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D Memory Controller 0 - Channel 0 Thermal Control (rev 03)' -- bus: ff +- bus: 'ff' dev: '14' fn: '1' id: 6fb1 name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D Memory Controller 0 - Channel 1 Thermal Control (rev 03)' -- bus: ff +- bus: 'ff' dev: '14' fn: '2' id: 6fb2 name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D Memory Controller 0 - Channel 0 Error (rev 03)' -- bus: ff +- bus: 'ff' dev: '14' fn: '3' id: 6fb3 name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D Memory Controller 0 - Channel 1 Error (rev 03)' -- bus: ff +- bus: 'ff' dev: '14' fn: '4' id: 6fbc name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D DDRIO Channel 0/1 Interface (rev 03)' -- bus: ff +- bus: 'ff' dev: '14' fn: '5' id: 6fbd name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D DDRIO Channel 0/1 Interface (rev 03)' -- bus: ff +- bus: 'ff' dev: '14' fn: '6' id: 6fbe name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D DDRIO Channel 0/1 Interface (rev 03)' -- bus: ff +- bus: 'ff' dev: '14' fn: '7' id: 6fbf name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D DDRIO Channel 0/1 Interface (rev 03)' -- bus: ff +- bus: 'ff' dev: '15' fn: '0' id: 6fb4 name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D Memory Controller 0 - Channel 2 Thermal Control (rev 03)' -- bus: ff +- bus: 'ff' dev: '15' fn: '1' id: 6fb5 name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D Memory Controller 0 - Channel 3 Thermal Control (rev 03)' -- bus: ff +- bus: 'ff' dev: '15' fn: '2' id: 6fb6 name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D Memory Controller 0 - Channel 2 Error (rev 03)' -- bus: ff +- bus: 'ff' dev: '15' fn: '3' id: 6fb7 name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D Memory Controller 0 - Channel 3 Error (rev 03)' -- bus: ff - dev: 1e +- bus: 'ff' + dev: '1e' fn: '0' id: 6f98 name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D Power Control Unit (rev 03)' -- bus: ff - dev: 1e +- bus: 'ff' + dev: '1e' fn: '1' id: 6f99 name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D Power Control Unit (rev 03)' -- bus: ff - dev: 1e +- bus: 'ff' + dev: '1e' fn: '2' id: 6f9a name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D Power Control Unit (rev 03)' -- bus: ff - dev: 1e +- bus: 'ff' + dev: '1e' fn: '3' id: 6fc0 name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D Power Control Unit (rev 03)' -- bus: ff - dev: 1e +- bus: 'ff' + dev: '1e' fn: '4' id: 6f9c name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D Power Control Unit (rev 03)' -- bus: ff - dev: 1f +- bus: 'ff' + dev: '1f' fn: '0' id: 6f88 name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon D Power Control Unit (rev 03)' -- bus: ff - dev: 1f +- bus: 'ff' + dev: '1f' fn: '2' id: 6f8a name: 'System peripheral: Intel Corporation Xeon E7 v4/Xeon E5 v4/Xeon E3 v4/Xeon diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/platform.json b/device/mellanox/x86_64-mlnx_msn4600c-r0/platform.json new file mode 100644 index 000000000000..7515ab05d005 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/platform.json @@ -0,0 +1,624 @@ +{ + "chassis": { + "name": "MSN4600C", + "components": [ + { + "name": "ONIE" + }, + { + "name": "SSD" + }, + { + "name": "BIOS" + }, + { + "name": "CPLD1" + }, + { + "name": "CPLD2" + }, + { + "name": "CPLD3" + } + ], + "fans": [], + "fan_drawers": [ + { + "name": "drawer1", + "fans": [ + { + "name": "fan1" + } + ] + }, + { + "name": "drawer2", + "fans": [ + { + "name": "fan2" + } + ] + }, + { + "name": "drawer3", + "fans": [ + { + "name": "fan3" + } + ] + } + ], + "psus": [ + { + "name": "PSU 1", + "fans": [ + { + "name": "psu1_fan1" + } + ], + "thermals": [ + { + "name": "PSU-1 Temp" + } + ] + }, + { + "name": "PSU 2", + "fans": [ + { + "name": "psu2_fan1" + } + ], + "thermals": [ + { + "name": "PSU-2 Temp" + } + ] + } + ], + "thermals": [ + { + "name": "ASIC" + }, + { + "name": "Ambient COMEX Temp" + }, + { + "name": "Ambient Fan Side Temp" + }, + { + "name": "Ambient Port Side Temp" + }, + { + "name": "CPU Core 0 Temp" + }, + { + "name": "CPU Core 1 Temp" + }, + { + "name": "CPU Core 2 Temp" + }, + { + "name": "CPU Core 3 Temp" + }, + { + "name": "CPU Pack Temp" + } + ], + "sfps": [ + { + "name": "sfp1", + "thermals": [ + { + "name": "xSFP module 1 Temp" + } + ] + }, + { + "name": "sfp2", + "thermals": [ + { + "name": "xSFP module 2 Temp" + } + ] + }, + { + "name": "sfp3", + "thermals": [ + { + "name": "xSFP module 3 Temp" + } + ] + }, + { + "name": "sfp4", + "thermals": [ + { + "name": "xSFP module 4 Temp" + } + ] + }, + { + "name": "sfp5", + "thermals": [ + { + "name": "xSFP module 5 Temp" + } + ] + }, + { + "name": "sfp6", + "thermals": [ + { + "name": "xSFP module 6 Temp" + } + ] + }, + { + "name": "sfp7", + "thermals": [ + { + "name": "xSFP module 7 Temp" + } + ] + }, + { + "name": "sfp8", + "thermals": [ + { + "name": "xSFP module 8 Temp" + } + ] + }, + { + "name": "sfp9", + "thermals": [ + { + "name": "xSFP module 9 Temp" + } + ] + }, + { + "name": "sfp10", + "thermals": [ + { + "name": "xSFP module 10 Temp" + } + ] + }, + { + "name": "sfp11", + "thermals": [ + { + "name": "xSFP module 11 Temp" + } + ] + }, + { + "name": "sfp12", + "thermals": [ + { + "name": "xSFP module 12 Temp" + } + ] + }, + { + "name": "sfp13", + "thermals": [ + { + "name": "xSFP module 13 Temp" + } + ] + }, + { + "name": "sfp14", + "thermals": [ + { + "name": "xSFP module 14 Temp" + } + ] + }, + { + "name": "sfp15", + "thermals": [ + { + "name": "xSFP module 15 Temp" + } + ] + }, + { + "name": "sfp16", + "thermals": [ + { + "name": "xSFP module 16 Temp" + } + ] + }, + { + "name": "sfp17", + "thermals": [ + { + "name": "xSFP module 17 Temp" + } + ] + }, + { + "name": "sfp18", + "thermals": [ + { + "name": "xSFP module 18 Temp" + } + ] + }, + { + "name": "sfp19", + "thermals": [ + { + "name": "xSFP module 19 Temp" + } + ] + }, + { + "name": "sfp20", + "thermals": [ + { + "name": "xSFP module 20 Temp" + } + ] + }, + { + "name": "sfp21", + "thermals": [ + { + "name": "xSFP module 21 Temp" + } + ] + }, + { + "name": "sfp22", + "thermals": [ + { + "name": "xSFP module 22 Temp" + } + ] + }, + { + "name": "sfp23", + "thermals": [ + { + "name": "xSFP module 23 Temp" + } + ] + }, + { + "name": "sfp24", + "thermals": [ + { + "name": "xSFP module 24 Temp" + } + ] + }, + { + "name": "sfp25", + "thermals": [ + { + "name": "xSFP module 25 Temp" + } + ] + }, + { + "name": "sfp26", + "thermals": [ + { + "name": "xSFP module 26 Temp" + } + ] + }, + { + "name": "sfp27", + "thermals": [ + { + "name": "xSFP module 27 Temp" + } + ] + }, + { + "name": "sfp28", + "thermals": [ + { + "name": "xSFP module 28 Temp" + } + ] + }, + { + "name": "sfp29", + "thermals": [ + { + "name": "xSFP module 29 Temp" + } + ] + }, + { + "name": "sfp30", + "thermals": [ + { + "name": "xSFP module 30 Temp" + } + ] + }, + { + "name": "sfp31", + "thermals": [ + { + "name": "xSFP module 31 Temp" + } + ] + }, + { + "name": "sfp32", + "thermals": [ + { + "name": "xSFP module 32 Temp" + } + ] + }, + { + "name": "sfp33", + "thermals": [ + { + "name": "xSFP module 33 Temp" + } + ] + }, + { + "name": "sfp34", + "thermals": [ + { + "name": "xSFP module 34 Temp" + } + ] + }, + { + "name": "sfp35", + "thermals": [ + { + "name": "xSFP module 35 Temp" + } + ] + }, + { + "name": "sfp36", + "thermals": [ + { + "name": "xSFP module 36 Temp" + } + ] + }, + { + "name": "sfp37", + "thermals": [ + { + "name": "xSFP module 37 Temp" + } + ] + }, + { + "name": "sfp38", + "thermals": [ + { + "name": "xSFP module 38 Temp" + } + ] + }, + { + "name": "sfp39", + "thermals": [ + { + "name": "xSFP module 39 Temp" + } + ] + }, + { + "name": "sfp40", + "thermals": [ + { + "name": "xSFP module 40 Temp" + } + ] + }, + { + "name": "sfp41", + "thermals": [ + { + "name": "xSFP module 41 Temp" + } + ] + }, + { + "name": "sfp42", + "thermals": [ + { + "name": "xSFP module 42 Temp" + } + ] + }, + { + "name": "sfp43", + "thermals": [ + { + "name": "xSFP module 43 Temp" + } + ] + }, + { + "name": "sfp44", + "thermals": [ + { + "name": "xSFP module 44 Temp" + } + ] + }, + { + "name": "sfp45", + "thermals": [ + { + "name": "xSFP module 45 Temp" + } + ] + }, + { + "name": "sfp46", + "thermals": [ + { + "name": "xSFP module 46 Temp" + } + ] + }, + { + "name": "sfp47", + "thermals": [ + { + "name": "xSFP module 47 Temp" + } + ] + }, + { + "name": "sfp48", + "thermals": [ + { + "name": "xSFP module 48 Temp" + } + ] + }, + { + "name": "sfp49", + "thermals": [ + { + "name": "xSFP module 49 Temp" + } + ] + }, + { + "name": "sfp50", + "thermals": [ + { + "name": "xSFP module 50 Temp" + } + ] + }, + { + "name": "sfp51", + "thermals": [ + { + "name": "xSFP module 51 Temp" + } + ] + }, + { + "name": "sfp52", + "thermals": [ + { + "name": "xSFP module 52 Temp" + } + ] + }, + { + "name": "sfp53", + "thermals": [ + { + "name": "xSFP module 53 Temp" + } + ] + }, + { + "name": "sfp54", + "thermals": [ + { + "name": "xSFP module 54 Temp" + } + ] + }, + { + "name": "sfp55", + "thermals": [ + { + "name": "xSFP module 55 Temp" + } + ] + }, + { + "name": "sfp56", + "thermals": [ + { + "name": "xSFP module 56 Temp" + } + ] + }, + { + "name": "sfp57", + "thermals": [ + { + "name": "xSFP module 57 Temp" + } + ] + }, + { + "name": "sfp58", + "thermals": [ + { + "name": "xSFP module 58 Temp" + } + ] + }, + { + "name": "sfp59", + "thermals": [ + { + "name": "xSFP module 59 Temp" + } + ] + }, + { + "name": "sfp60", + "thermals": [ + { + "name": "xSFP module 60 Temp" + } + ] + }, + { + "name": "sfp61", + "thermals": [ + { + "name": "xSFP module 61 Temp" + } + ] + }, + { + "name": "sfp62", + "thermals": [ + { + "name": "xSFP module 62 Temp" + } + ] + }, + { + "name": "sfp63", + "thermals": [ + { + "name": "xSFP module 63 Temp" + } + ] + }, + { + "name": "sfp64", + "thermals": [ + { + "name": "xSFP module 64 Temp" + } + ] + } + ] + }, + "interfaces": {} +} diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/sensors.conf.a1 b/device/mellanox/x86_64-mlnx_msn4600c-r0/sensors.conf.a1 new file mode 100644 index 000000000000..44fff272e544 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/sensors.conf.a1 @@ -0,0 +1,146 @@ +## +## Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. +## Apache-2.0 +## +## Licensed under the Apache License, Version 2.0 (the "License"); +## you may not use this file except in compliance with the License. +## You may obtain a copy of the License at +## +## http://www.apache.org/licenses/LICENSE-2.0 +## +## Unless required by applicable law or agreed to in writing, software +## distributed under the License is distributed on an "AS IS" BASIS, +## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +## See the License for the specific language governing permissions and +## limitations under the License. +## + + +# Temperature sensors +bus "i2c-2" "i2c-1-mux (chan_id 1)" + chip "mlxsw-i2c-*-48" + label temp1 "Ambient ASIC Temp" + +bus "i2c-7" "i2c-1-mux (chan_id 6)" + chip "tmp102-i2c-*-49" + label temp1 "Ambient Fan Side Temp (air intake)" + chip "tmp102-i2c-*-4a" + label temp1 "Ambient Port Side Temp (air exhaust)" + +bus "i2c-15" "i2c-1-mux (chan_id 6)" + chip "tmp102-i2c-15-49" + label temp1 "Ambient COMEX Temp" + +# Power controllers +bus "i2c-5" "i2c-1-mux (chan_id 4)" + chip "mp2975-i2c-*-62" + label in1 "PMIC-1 PSU 12V Rail (in1)" + label in2 "PMIC-1 ASIC 0.8V VCORE MAIN Rail (out)" + label temp1 "PMIC-1 Temp 1" + label power1 "PMIC-1 PSU 12V Rail Pwr (in1)" + label power2 "PMIC-1 ASIC 0.8V VCORE MAIN Rail Pwr (out)" + label curr1 "PMIC-1 PSU 12V Rail Curr (in1)" + label curr2 "PMIC-1 ASIC 0.8V VCORE MAIN Rail Curr (out)" + chip "mp2975-i2c-*-64" + label in1 "PMIC-2 PSU 12V Rail (in1)" + label in2 "PMIC-2 ASIC 1.8V VCORE MAIN Rail (out)" + label in3 "PMIC-2 ASIC 1.2V VCORE MAIN Rail (out)" + label temp1 "PMIC-2 Temp 1" + label power1 "PMIC-2 PSU 12V Rail Pwr (in1)" + label power2 "PMIC-2 ASIC 1.8V VCORE MAIN Rail Pwr (out)" + label curr1 "PMIC-2 PSU 12V Rail Curr (in1)" + label curr2 "PMIC-2 ASIC 1.8V VCORE MAIN Rail Curr (out)" + label curr3 "PMIC-2 ASIC 1.2V VCORE MAIN Rail Curr (out)" + chip "mp2975-i2c-*-66" + label in1 "PMIC-3 PSU 12V Rail (in1)" + label in2 "PMIC-3 ASIC 0.85V T0_1 Rail (out)" + label in3 "PMIC-3 ASIC 1.8V T0_1 Rail (out)" + label temp1 "PMIC-3 Temp 1" + label power1 "PMIC-3 PSU 12V Rail Pwr (in1)" + label power2 "PMIC-3 ASIC 0.85V T0_1 Rail Pwr (out)" + label curr1 "PMIC-3 PSU 12V Rail Curr (in1)" + label curr2 "PMIC-3 ASIC 0.85V T0_1 Rail Curr (out)" + label curr3 "PMIC-3 ASIC 1.8V T0_1 Rail Curr (out)" + chip "mp2975-i2c-*-6a" + label in1 "PMIC-4 PSU 12V Rail (in1)" + label in2 "PMIC-4 ASIC 0.85V T2_3 Rail (out)" + label in3 "PMIC-4 ASIC 1.8V T2_3 Rail (out)" + label temp1 "PMIC-4 Temp 1" + label power1 "PMIC-4 PSU 12V Rail Pwr (in1)" + label power2 "PMIC-4 ASIC 0.85V T2_3 Rail Pwr (out)" + label curr1 "PMIC-4 PSU 12V Rail Curr (in1)" + label curr2 "PMIC-4 ASIC 0.85V T2_3 Rail Curr (out)" + label curr3 "PMIC-4 ASIC 1.8V T2_3 Rail Curr (out)" + chip "mp2975-i2c-*-6e" + label in1 "PMIC-5 PSU 12V Rail (in1)" + label in2 "PMIC-5 ASIC 1.2V T0_3 Rail_1 (out)" + label in3 "PMIC-5 ASIC 1.2V T4_7 Rail_2 (out)" + label temp1 "PMIC-5 Temp 1" + label power1 "PMIC-5 PSU 12V Rail Pwr (in1)" + label power2 "PMIC-5 ASIC 1.2V T0_3 Rail_1 Pwr (out)" + label power3 "PMIC-5 ASIC 1.2V T4_7 Rail_2 Pwr (out)" + label curr1 "PMIC-5 PSU 12V Rail Curr (in1)" + label curr2 "PMIC-5 ASIC 1.2V T0_3 Rail_1 Curr (out)" + label curr3 "PMIC-5 ASIC 1.2V T4_7 Rail_2 Curr (out)" + +bus "i2c-15" "i2c-1-mux (chan_id 6)" + chip "tps53679-i2c-*-58" + label in1 "PMIC-6 PSU 12V Rail (in1)" + label in2 "PMIC-6 PSU 12V Rail (in2)" + label in3 "PMIC-6 COMEX 1.8V Rail (out)" + label in4 "PMIC-6 COMEX 1.05V Rail (out)" + label temp1 "PMIC-6 Temp 1" + label temp2 "PMIC-6 Temp 2" + label power1 "PMIC-6 COMEX 1.8V Rail Pwr (out)" + label power2 "PMIC-6 COMEX 1.05V Rail Pwr (out)" + label curr1 "PMIC-6 COMEX 1.8V Rail Curr (out)" + label curr2 "PMIC-6 COMEX 1.05V Rail Curr (out)" + chip "tps53679-i2c-*-61" + label in1 "PMIC-7 PSU 12V Rail (in1)" + label in2 "PMIC-7 PSU 12V Rail (in2)" + label in3 "PMIC-7 COMEX 1.2V Rail (out)" + ignore in4 + label temp1 "PMIC-7 Temp 1" + label temp2 "PMIC-7 Temp 2" + label power1 "PMIC-7 COMEX 1.2V Rail Pwr (out)" + ignore power2 + label curr1 "PMIC-7 COMEX 1.2V Rail Curr (out)" + ignore curr2 + +# Power supplies +bus "i2c-4" "i2c-1-mux (chan_id 3)" + chip "dps460-i2c-*-58" + label in1 "PSU-1(L) 220V Rail (in)" + ignore in2 + label in3 "PSU-1(L) 12V Rail (out)" + label fan1 "PSU-1(L) Fan 1" + ignore fan2 + ignore fan3 + label temp1 "PSU-1(L) Temp 1" + label temp2 "PSU-1(L) Temp 2" + label temp3 "PSU-1(L) Temp 3" + label power1 "PSU-1(L) 220V Rail Pwr (in)" + label power2 "PSU-1(L) 12V Rail Pwr (out)" + label curr1 "PSU-1(L) 220V Rail Curr (in)" + label curr2 "PSU-1(L) 12V Rail Curr (out)" + chip "dps460-i2c-*-59" + label in1 "PSU-2(R) 220V Rail (in)" + ignore in2 + label in3 "PSU-2(R) 12V Rail (out)" + label fan1 "PSU-2(R) Fan 1" + ignore fan2 + ignore fan3 + label temp1 "PSU-2(R) Temp 1" + label temp2 "PSU-2(R) Temp 2" + label temp3 "PSU-2(R) Temp 3" + label power1 "PSU-2(R) 220V Rail Pwr (in)" + label power2 "PSU-2(R) 12V Rail Pwr (out)" + label curr1 "PSU-2(R) 220V Rail Curr (in)" + label curr2 "PSU-2(R) 12V Rail Curr (out)" + +# Chassis fans +chip "mlxreg_fan-isa-*" + label fan1 "Chassis Fan Drawer-1" + label fan2 "Chassis Fan Drawer-2" + label fan3 "Chassis Fan Drawer-3" + diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/sensors_respin.conf b/device/mellanox/x86_64-mlnx_msn4600c-r0/sensors_respin.conf new file mode 100644 index 000000000000..73665a7372d3 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/sensors_respin.conf @@ -0,0 +1,226 @@ +## +## Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. +## Apache-2.0 +## +## Licensed under the Apache License, Version 2.0 (the "License"); +## you may not use this file except in compliance with the License. +## You may obtain a copy of the License at +## +## http://www.apache.org/licenses/LICENSE-2.0 +## +## Unless required by applicable law or agreed to in writing, software +## distributed under the License is distributed on an "AS IS" BASIS, +## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +## See the License for the specific language governing permissions and +## limitations under the License. +## + +# Temperature sensors +bus "i2c-2" "i2c-1-mux (chan_id 1)" + chip "mlxsw-i2c-*-48" + label temp1 "Ambient ASIC Temp" + +bus "i2c-7" "i2c-1-mux (chan_id 6)" + chip "tmp102-i2c-*-49" + label temp1 "Ambient Fan Side Temp (air intake)" + chip "tmp102-i2c-*-4a" + label temp1 "Ambient Port Side Temp (air exhaust)" + +bus "i2c-15" "i2c-1-mux (chan_id 6)" + chip "tmp102-i2c-15-49" + label temp1 "Ambient COMEX Temp" + +# Power controllers +bus "i2c-5" "i2c-1-mux (chan_id 4)" + chip "xdpe12284-i2c-*-62" + label in1 "PMIC-1 PSU 12V Rail (in1)" + ignore in2 + label in3 "PMIC-1 ASIC VCORE_MAIN Rail (out1)" + ignore in4 + label temp1 "PMIC-1 ASIC VCORE_MAIN Temp 1" + ignore temp2 + label power1 "PMIC-1 12V ASIC VCORE_MAIN Rail Pwr (in)" + ignore power2 + label power3 "PMIC-1 ASIC VCORE_MAIN Rail Pwr (out1)" + ignore power4 + label curr1 "PMIC-1 12V ASIC VCORE_MAIN Rail Curr (in1)" + ignore curr2 + label curr3 "PMIC-1 ASIC VCORE_MAIN Rail Curr (out1)" + ignore curr4 + chip "xdpe12284-i2c-*-64" + label in1 "PMIC-2 PSU 12V Rail (in1)" + label in2 "PMIC-2 PSU 12V Rail (in2)" + label in3 "PMIC-2 ASIC 1.8V_MAIN Rail (out1)" + label in4 "PMIC-2 ASIC 1.2V_MAIN Rail (out2)" + label temp1 "PMIC-2 ASIC 1.8V_MAIN Temp 1" + label temp2 "PMIC-2 ASIC 1.2V_MAIN Temp 2" + label power1 "PMIC-2 12V ASIC 1.8V_1.2V_MAIN Rail Pwr (in)" + ignore power2 + label power3 "PMIC-2 ASIC 1.8V_MAIN Rail Pwr (out1)" + label power4 "PMIC-2 ASIC 1.2V_MAIN Rail Pwr (out2)" + label curr1 "PMIC-2 12V ASIC 1.8V_MAIN Rail Curr (in1)" + label curr2 "PMIC-2 12V ASIC 1.2V_MAIN Rail Curr (in2)" + label curr3 "PMIC-2 ASIC 1.8V_MAIN Rail Curr (out1)" + label curr4 "PMIC-2 ASIC 1.2V_MAIN Rail Curr (out2)" + chip "xdpe12284-i2c-*-66" + label in1 "PMIC-3 PSU 12V Rail (in1)" + label in2 "PMIC-2 PSU 12V Rail (in2)" + label in3 "PMIC-3 ASIC VCORE_T0_1 Rail (out1)" + label in4 "PMIC-3 ASIC 1.8V_T0_1 Rail (out2)" + label temp1 "PMIC-3 ASIC VCORE_T0_1 Temp 1" + label temp2 "PMIC-3 ASIC 1.8V_T0_1 Temp 2" + label power1 "PMIC-3 12V ASIC VCORE_1.8V_T0_1 Rail Pwr (in) " + ignore power2 + label power3 "PMIC-2 ASIC VCORE_T0_1 Rail Pwr (out1)" + label power4 "PMIC-2 ASIC 1.8V_T0_1 Rail Pwr (out2)" + label curr1 "PMIC-2 12V ASIC VCORE_T0_1 Rail Curr (in1)" + label curr2 "PMIC-2 12V ASIC 1.8V_T0_1 Rail Curr (in2)" + label curr3 "PMIC-2 ASIC VCORE_T0_1 Rail Curr (out1)" + label curr4 "PMIC-2 ASIC 1.8V_T0_1 Rail Curr (out2)" + chip "xdpe12284-i2c-*-68" + label in1 "PMIC-3 PSU 12V Rail (in1)" + label in2 "PMIC-2 PSU 12V Rail (in2)" + label in3 "PMIC-3 ASIC VCORE_T2_3 Rail (out1)" + label in4 "PMIC-3 ASIC 1.8V_T2_3 Rail (out2)" + label temp1 "PMIC-3 ASIC VCORE_T2_3 Temp 1" + label temp2 "PMIC-3 ASIC 1.8V_T2_3 Temp 2" + label power1 "PMIC-3 12V ASIC VCORE_1.8V_T2_3 Rail Pwr (in) " + ignore power2 + label power3 "PMIC-2 ASIC VCORE_T2_3 Rail Pwr (out1)" + label power4 "PMIC-2 ASIC 1.8V_T2_3 Rail Pwr (out2)" + label curr1 "PMIC-2 12V ASIC VCORE_T2_3 Rail Curr (in1)" + label curr2 "PMIC-2 12V ASIC 1.8V_T2_3 Rail Curr (in2)" + label curr3 "PMIC-2 ASIC VCORE_T2_3 Rail Curr (out1)" + label curr4 "PMIC-2 ASIC 1.8V_T2_3 Rail Curr (out2)" + chip "xdpe12284-i2c-*-6a" + label in1 "PMIC-3 PSU 12V Rail (in1)" + label in2 "PMIC-2 PSU 12V Rail (in2)" + label in3 "PMIC-3 ASIC VCORE_T4_5 Rail (out1)" + label in4 "PMIC-3 ASIC 1.8V_T4_5 Rail (out2)" + label temp1 "PMIC-3 ASIC VCORE_T4_5 Temp 1" + label temp2 "PMIC-3 ASIC 1.8V_T4_5 Temp 2" + label power1 "PMIC-3 12V ASIC VCORE_1.8V_T4_5 Rail Pwr (in) " + ignore power2 + label power3 "PMIC-2 ASIC VCORE_T4_5 Rail Pwr (out1)" + label power4 "PMIC-2 ASIC 1.8V_T4_5 Rail Pwr (out2)" + label curr1 "PMIC-2 12V ASIC VCORE_T4_5 Rail Curr (in1)" + label curr2 "PMIC-2 12V ASIC 1.8V_T4_5 Rail Curr (in2)" + label curr3 "PMIC-2 ASIC VCORE_T4_5 Rail Curr (out1)" + label curr4 "PMIC-2 ASIC 1.8V_T4_5 Rail Curr (out2)" + chip "xdpe12284-i2c-*-6c" + label in1 "PMIC-3 PSU 12V Rail (in1)" + label in2 "PMIC-2 PSU 12V Rail (in2)" + label in3 "PMIC-3 ASIC VCORE_T6_7 Rail (out1)" + label in4 "PMIC-3 ASIC 1.8V_T6_7 Rail (out2)" + label temp1 "PMIC-3 ASIC VCORE_T6_7 Temp 1" + label temp2 "PMIC-3 ASIC 1.8V_T6_7 Temp 2" + label power1 "PMIC-3 12V ASIC VCORE_1.8V_T6_7 Rail Pwr (in) " + ignore power2 + label power3 "PMIC-2 ASIC VCORE_T6_7 Rail Pwr (out1)" + label power4 "PMIC-2 ASIC 1.8V_T6_7 Rail Pwr (out2)" + label curr1 "PMIC-2 12V ASIC VCORE_T6_7 Rail Curr (in1)" + label curr2 "PMIC-2 12V ASIC 1.8V_T6_7 Rail Curr (in2)" + label curr3 "PMIC-2 ASIC VCORE_T6_7 Rail Curr (out1)" + label curr4 "PMIC-2 ASIC 1.8V_T6_7 Rail Curr (out2)" + chip "xdpe12284-i2c-*-6e" + label in1 "PMIC-3 PSU 12V Rail (in1)" + label in2 "PMIC-2 PSU 12V Rail (in2)" + label in3 "PMIC-3 ASIC 1.2V_T0_3 Rail (out1)" + label in4 "PMIC-3 ASIC 1.2V_T4_7 Rail (out2)" + label temp1 "PMIC-3 ASIC 1.2V_T0_3 Temp 1" + label temp2 "PMIC-3 ASIC 1.2V_T4_7 Temp 2" + label power1 "PMIC-3 12V ASIC 1.2V_T0_3_T4_7 Rail Pwr (in) " + ignore power2 + label power3 "PMIC-2 ASIC 1.2V_T0_3 Rail Pwr (out1)" + label power4 "PMIC-2 ASIC 1.2V_T4_7 Rail Pwr (out2)" + label curr1 "PMIC-2 12V ASIC 1.2V_T0_3 Rail Curr (in1)" + label curr2 "PMIC-2 12V ASIC 1.2V_T4_7 Rail Curr (in2)" + label curr3 "PMIC-2 ASIC 1.2V_T0_3 Rail Curr (out1)" + label curr4 "PMIC-2 ASIC 1.2V_T4_7 Rail Curr (out2)" + +bus "i2c-15" "i2c-1-mux (chan_id 6)" + chip "tps53679-i2c-*-58" + label in1 "PMIC-8 PSU 12V Rail (in1)" + label in2 "PMIC-8 PSU 12V Rail (in2)" + label in3 "PMIC-8 COMEX 1.8V Rail (out)" + label in4 "PMIC-8 COMEX 1.05V Rail (out)" + label temp1 "PMIC-8 Temp 1" + label temp2 "PMIC-8 Temp 2" + label power1 "PMIC-8 COMEX 1.8V Rail Pwr (out)" + label power2 "PMIC-8 COMEX 1.05V Rail Pwr (out)" + label curr1 "PMIC-8 COMEX 1.8V Rail Curr (out)" + label curr2 "PMIC-8 COMEX 1.05V Rail Curr (out)" + chip "tps53679-i2c-*-61" + label in1 "PMIC-9 PSU 12V Rail (in1)" + label in2 "PMIC-9 PSU 12V Rail (in2)" + label in3 "PMIC-9 COMEX 1.2V Rail (out)" + ignore in4 + label temp1 "PMIC-9 Temp 1" + label temp2 "PMIC-9 Temp 2" + label power1 "PMIC-9 COMEX 1.2V Rail Pwr (out)" + ignore power2 + label curr1 "PMIC-9 COMEX 1.2V Rail Curr (out)" + ignore curr2 + + chip "mp2975-i2c-*-6a" + label in1 "PMIC-3 PSU 12V Rail (in1)" + label in2 "PMIC-3 COMEX 1.8V Rail (out)" + label in3 "PMIC-3 COMEX 1.05V Rail (out)" + label temp1 "PMIC-3 Temp 1" + label power1 "PMIC-3 COMEX 12V Rail Pwr (in)" + label power2 "PMIC-3 COMEX 1.8V Rail Pwr (out)" + label power3 "PMIC-3 COMEX 1.05V Rail Pwr (out)" + label curr1 "PMIC-3 COMEX 12V Rail Curr (in)" + label curr2 "PMIC-3 COMEX 1.8V Rail Curr (out)" + ignore curr3 + ignore curr4 + label curr5 "PMIC-3 COMEX 1.05V Rail Curr (out)" + ignore curr6 + + chip "mp2975-i2c-*-61" + label in1 "PMIC-4 PSU 12V Rail (in1)" + label in2 "PMIC-4 COMEX 1.2V Rail (out)" + label temp1 "PMIC-4 Temp 1" + label temp2 "PMIC-4 Temp 2" + label power1 "PMIC-4 COMEX 12V Rail Pwr (in)" + label power2 "PMIC-4 COMEX 1.2V Rail Pwr (out)" + label curr1 "PMIC-4 COMEX 12V Rail Curr (in)" + label curr2 "PMIC-4 COMEX 1.2V Rail Curr (out)" + ignore curr3 + +# Power supplies +bus "i2c-4" "i2c-1-mux (chan_id 3)" + chip "dps460-i2c-*-58" + label in1 "PSU-1(L) 220V Rail (in)" + ignore in2 + label in3 "PSU-1(L) 12V Rail (out)" + label fan1 "PSU-1(L) Fan 1" + label temp1 "PSU-1(L) Temp 1" + label temp2 "PSU-1(L) Temp 2" + label temp3 "PSU-1(L) Temp 3" + label power1 "PSU-1(L) 220V Rail Pwr (in)" + label power2 "PSU-1(L) 12V Rail Pwr (out)" + label curr1 "PSU-1(L) 220V Rail Curr (in)" + label curr2 "PSU-1(L) 12V Rail Curr (out)" + chip "dps460-i2c-*-59" + label in1 "PSU-2(R) 220V Rail (in)" + ignore in2 + label in3 "PSU-2(R) 12V Rail (out)" + label fan1 "PSU-2(R) Fan 1" + label temp1 "PSU-2(R) Temp 1" + label temp2 "PSU-2(R) Temp 2" + label temp3 "PSU-2(R) Temp 3" + label power1 "PSU-2(R) 220V Rail Pwr (in)" + label power2 "PSU-2(R) 12V Rail Pwr (out)" + label curr1 "PSU-2(R) 220V Rail Curr (in)" + label curr2 "PSU-2(R) 12V Rail Curr (out)" + +# Chassis fans +chip "mlxreg_fan-isa-*" + label fan1 "Chassis Fan Drawer-1" + label fan2 "Chassis Fan Drawer-2" + label fan3 "Chassis Fan Drawer-3" + +# Miscellaneous +chip "*-virtual-*" + ignore temp1 diff --git a/device/mellanox/x86_64-mlnx_msn4600c-r0/sensors_respin.conf.a1 b/device/mellanox/x86_64-mlnx_msn4600c-r0/sensors_respin.conf.a1 new file mode 100644 index 000000000000..3131eaf15333 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4600c-r0/sensors_respin.conf.a1 @@ -0,0 +1,185 @@ +################################################################################ +# Copyright (c) 2019 Mellanox Technologies +# +# Platform specific sensors config for SN4700 +################################################################################ + +# Temperature sensors +bus "i2c-2" "i2c-1-mux (chan_id 1)" + chip "mlxsw-i2c-*-48" + label temp1 "Ambient ASIC Temp" + +bus "i2c-7" "i2c-1-mux (chan_id 6)" + chip "tmp102-i2c-*-49" + label temp1 "Ambient Fan Side Temp (air intake)" + chip "tmp102-i2c-*-4a" + label temp1 "Ambient Port Side Temp (air exhaust)" + +bus "i2c-15" "i2c-1-mux (chan_id 6)" + chip "tmp102-i2c-15-49" + label temp1 "Ambient COMEX Temp" + +# Power controllers +bus "i2c-5" "i2c-1-mux (chan_id 4)" + chip "mp2975-i2c-*-62" + label in1 "PMIC-1 PSU 12V Rail (in)" + label in2 "PMIC-1 ASIC VCORE_MAIN Rail (out)" + ignore in3 + ignore in4 + label temp1 "PMIC-1 ASIC VCORE_MAIN Temp 1" + ignore temp2 + label power1 "PMIC-1 12V ASIC VCORE_MAIN Rail Pwr (in)" + label power2 "PMIC-1 ASIC VCORE_MAIN Rail Pwr (out)" + ignore power3 + ignore power4 + label curr1 "PMIC-1 12V ASIC VCORE_MAIN Rail Curr (in)" + label curr2 "PMIC-1 ASIC VCORE_MAIN Rail Curr (out)" + ignore curr3 + ignore curr4 + chip "mp2975-i2c-*-64" + label in1 "PMIC-2 PSU 12V Rail (in)" + label in2 "PMIC-2 ASIC 1.8V_MAIN Rail (out1)" + label in3 "PMIC-2 ASIC 1.2V_MAIN Rail (out2)" + ignore in4 + label temp1 "PMIC-2 ASIC 1.8V_1.2V_MAIN Temp 1" + ignore temp2 + label power1 "PMIC-2 12V ASIC 1.8V_1.2V_MAIN Rail Pwr (in)" + label power2 "PMIC-2 ASIC 1.8V_MAIN Rail Pwr (out)" + ignore power3 + ignore power4 + label curr1 "PMIC-2 12V ASIC 1.8V_1.2V_MAIN Rail Curr (in)" + label curr2 "PMIC-2 ASIC 1.8V_MAIN Rail Curr (out1)" + label curr3 "PMIC-2 ASIC 1.2V_MAIN Rail Curr (out2)" + ignore curr4 + chip "mp2975-i2c-*-66" + label in1 "PMIC-3 PSU 12V Rail (in)" + label in2 "PMIC-3 ASIC VCORE_T0_3 Rail (out1)" + label in3 "PMIC-3 ASIC 1.8V_T0_3 Rail (out2)" + ignore in4 + label temp1 "PMIC-3 ASIC VCORE_1.8V_T0_3 Temp 1" + ignore temp2 + label power1 "PMIC-3 12V ASIC VCORE_1.8V_T0_3 Rail Pwr (in) " + label power2 "PMIC-3 ASIC VCORE_T0_3 Rail Pwr (out)" + ignore power3 + ignore power4 + label curr1 "PMIC-3 12V ASIC VCORE_1.8V_T0_3 Rail Curr (in)" + label curr2 "PMIC-3 ASIC VCORE_T0_3 Rail Curr (out1)" + label curr3 "PMIC-3 ASIC 1.8V_T0_3 Rail Curr (out2)" + ignore curr4 + chip "mp2975-i2c-*-6a" + label in1 "PMIC-4 PSU 12V Rail (in)" + label in2 "PMIC-4 ASIC VCORE_T4_7 Rail (out1)" + label in3 "PMIC-3 ASIC 1.8V_T4_7 Rail (out2)" + ignore in4 + label temp1 "PMIC-4 ASIC VCORE_1.8V_T4_7 Temp 1" + ignore temp2 + label power1 "PMIC-4 12V ASIC VCORE_1.8V_T4_7 Rail Pwr (in) " + label power2 "PMIC-4 ASIC VCORE_T4_7 Rail Pwr (out)" + ignore power3 + ignore power4 + label curr1 "PMIC-4 12V ASIC VCORE_1.8V_T4_7 Rail Curr (in)" + label curr2 "PMIC-4 ASIC VCORE_T4_7 Rail Curr (out1)" + label curr3 "PMIC-4 ASIC 1.8V_T4_7 Rail Curr (out2)" + ignore curr4 + ignore curr4 + chip "mp2975-i2c-*-6e" + label in1 "PMIC-5 PSU 12V Rail (in)" + label in2 "PMIC-5 ASIC 1.2V_T0_3 Rail (out1)" + label in3 "PMIC-5 ASIC 1.2V_T4_7 Rail (out2)" + ignore in4 + label temp1 "PMIC-5 ASIC 1.2V_T0_3_T4_7 Temp 1" + ignore temp2 + label power1 "PMIC-5 12V ASIC 1.2V_T0_3_T4_7 Rail Pwr (in)" + label power2 "PMIC-5 ASIC 1.2V_T0_3 Rail Pwr (out)" + ignore power3 + ignore power4 + label curr1 "PMIC-5 12V ASIC 1.2V_T0_3_T4_7 Rail Curr (in)" + label curr2 "PMIC-5 ASIC 1.2V_T0_3 Rail Curr (out1)" + label curr3 "PMIC-5 ASIC 1.2V_T4_7 Rail Curr (out2)" + ignore curr4 +bus "i2c-15" "i2c-1-mux (chan_id 6)" + chip "tps53679-i2c-*-58" + label in1 "PMIC-6 PSU 12V Rail (in1)" + label in2 "PMIC-6 PSU 12V Rail (in2)" + label in3 "PMIC-6 COMEX 1.8V Rail (out1)" + label in4 "PMIC-6 COMEX 1.05V Rail (out2)" + label temp1 "PMIC-6 Temp 1" + label temp2 "PMIC-6 Temp 2" + label power1 "PMIC-6 COMEX 1.8V Rail Pwr (out1)" + label power2 "PMIC-6 COMEX 1.05V Rail Pwr (out2)" + label curr1 "PMIC-6 COMEX 1.8V Rail Curr (out1)" + label curr2 "PMIC-6 COMEX 1.05V Rail Curr (out2)" + chip "tps53679-i2c-*-61" + label in1 "PMIC-7 PSU 12V Rail (in1)" + label in2 "PMIC-7 PSU 12V Rail (in2)" + label in3 "PMIC-7 COMEX 1.2V Rail (out)" + ignore in4 + label temp1 "PMIC-7 Temp 1" + label temp2 "PMIC-7 Temp 2" + label power1 "PMIC-7 COMEX 1.2V Rail Pwr (out1)" + ignore power2 + label curr1 "PMIC-7 COMEX 1.2V Rail Curr (out1)" + ignore curr2 + + chip "mp2975-i2c-*-6a" + label in1 "PMIC-3 PSU 12V Rail (in1)" + label in2 "PMIC-3 COMEX 1.8V Rail (out)" + label in3 "PMIC-3 COMEX 1.05V Rail (out)" + label temp1 "PMIC-3 Temp 1" + label power1 "PMIC-3 COMEX 12V Rail Pwr (in)" + label power2 "PMIC-3 COMEX 1.8V Rail Pwr (out)" + label power3 "PMIC-3 COMEX 1.05V Rail Pwr (out)" + label curr1 "PMIC-3 COMEX 12V Rail Curr (in)" + label curr2 "PMIC-3 COMEX 1.8V Rail Curr (out)" + ignore curr3 + ignore curr4 + label curr5 "PMIC-3 COMEX 1.05V Rail Curr (out)" + ignore curr6 + + chip "mp2975-i2c-*-61" + label in1 "PMIC-4 PSU 12V Rail (in1)" + label in2 "PMIC-4 COMEX 1.2V Rail (out)" + label temp1 "PMIC-4 Temp 1" + label temp2 "PMIC-4 Temp 2" + label power1 "PMIC-4 COMEX 12V Rail Pwr (in)" + label power2 "PMIC-4 COMEX 1.2V Rail Pwr (out)" + label curr1 "PMIC-4 COMEX 12V Rail Curr (in)" + label curr2 "PMIC-4 COMEX 1.2V Rail Curr (out)" + ignore curr3 + +# Power supplies +bus "i2c-4" "i2c-1-mux (chan_id 3)" + chip "dps460-i2c-*-58" + label in1 "PSU-1(L) 220V Rail (in)" + ignore in2 + label in3 "PSU-1(L) 12V Rail (out)" + label fan1 "PSU-1(L) Fan 1" + label temp1 "PSU-1(L) Temp 1" + label temp2 "PSU-1(L) Temp 2" + label temp3 "PSU-1(L) Temp 3" + label power1 "PSU-1(L) 220V Rail Pwr (in)" + label power2 "PSU-1(L) 12V Rail Pwr (out)" + label curr1 "PSU-1(L) 220V Rail Curr (in)" + label curr2 "PSU-1(L) 12V Rail Curr (out)" + chip "dps460-i2c-*-59" + label in1 "PSU-2(R) 220V Rail (in)" + ignore in2 + label in3 "PSU-2(R) 12V Rail (out)" + label fan1 "PSU-2(R) Fan 1" + label temp1 "PSU-2(R) Temp 1" + label temp2 "PSU-2(R) Temp 2" + label temp3 "PSU-2(R) Temp 3" + label power1 "PSU-2(R) 220V Rail Pwr (in)" + label power2 "PSU-2(R) 12V Rail Pwr (out)" + label curr1 "PSU-2(R) 220V Rail Curr (in)" + label curr2 "PSU-2(R) 12V Rail Curr (out)" + +# Chassis fans +chip "mlxreg_fan-isa-*" + label fan1 "Chassis Fan Drawer-1" + label fan2 "Chassis Fan Drawer-2" + label fan3 "Chassis Fan Drawer-3" + +# Miscellaneous +chip "*-virtual-*" + ignore temp1 diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/ACS-MSN4700/buffers_defaults_objects.j2 b/device/mellanox/x86_64-mlnx_msn4700-r0/ACS-MSN4700/buffers_defaults_objects.j2 new file mode 120000 index 000000000000..33b6704f9902 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/ACS-MSN4700/buffers_defaults_objects.j2 @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/ACS-MSN2700/buffers_defaults_objects.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/ACS-MSN4700/buffers_defaults_t0.j2 b/device/mellanox/x86_64-mlnx_msn4700-r0/ACS-MSN4700/buffers_defaults_t0.j2 index c115d141e152..503e43045eb8 100644 --- a/device/mellanox/x86_64-mlnx_msn4700-r0/ACS-MSN4700/buffers_defaults_t0.j2 +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/ACS-MSN4700/buffers_defaults_t0.j2 @@ -4,109 +4,20 @@ {% set egress_lossless_pool_size = '60817392' %} {% set egress_lossy_pool_size = '26451968' %} -{%- macro generate_port_lists(PORT_ALL) %} - {# Generate list of ports #} - {%- for port_idx in range(0, 32) %} - {%- if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{%- endif %} - {%- endfor %} -{%- endmacro %} +{% import 'buffers_defaults_objects.j2' as defs with context %} -{%- macro generate_buffer_pool_and_profiles() %} - "BUFFER_POOL": { - "ingress_lossless_pool": { - {%- if dynamic_mode is not defined %} - "size": "{{ ingress_lossless_pool_size }}", - {%- endif %} - "type": "ingress", - "mode": "dynamic" - }, - "ingress_lossy_pool": { - {%- if dynamic_mode is not defined %} - "size": "{{ ingress_lossy_pool_size }}", - {%- endif %} - "type": "ingress", - "mode": "dynamic" - }, - "egress_lossless_pool": { - "size": "{{ egress_lossless_pool_size }}", - "type": "egress", - "mode": "dynamic" - }, - "egress_lossy_pool": { - {%- if dynamic_mode is not defined %} - "size": "{{ egress_lossy_pool_size }}", - {%- endif %} - "type": "egress", - "mode": "dynamic" - } - }, - "BUFFER_PROFILE": { - "ingress_lossless_profile": { - "pool":"[BUFFER_POOL|ingress_lossless_pool]", - "size":"0", - "dynamic_th":"7" - }, - "ingress_lossy_profile": { - "pool":"[BUFFER_POOL|ingress_lossy_pool]", - "size":"0", - "dynamic_th":"3" - }, - "egress_lossless_profile": { - "pool":"[BUFFER_POOL|egress_lossless_pool]", - "size":"0", - "dynamic_th":"7" - }, - "egress_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"9216", - "dynamic_th":"7" - }, - "q_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"0", - "dynamic_th":"3" - } - }, +{%- macro generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) %} +{{ defs.generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) }} {%- endmacro %} -{%- macro generate_profile_lists(port_names) %} - "BUFFER_PORT_INGRESS_PROFILE_LIST": { -{% for port in port_names.split(',') %} - "{{ port }}": { - "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" - }{% if not loop.last %},{% endif %} - -{% endfor %} - }, - "BUFFER_PORT_EGRESS_PROFILE_LIST": { -{% for port in port_names.split(',') %} - "{{ port }}": { - "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" - }{% if not loop.last %},{% endif %} - -{% endfor %} - } +{%- macro generate_profile_lists_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_profile_lists(port_names_active, port_names_inactive) }} {%- endmacro %} -{%- macro generate_queue_buffers(port_names) %} - "BUFFER_QUEUE": { -{% for port in port_names.split(',') %} - "{{ port }}|3-4": { - "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" - }, -{% endfor %} -{% for port in port_names.split(',') %} - "{{ port }}|0-2": { - "profile" : "[BUFFER_PROFILE|q_lossy_profile]" - }, -{% endfor %} -{% for port in port_names.split(',') %} - "{{ port }}|5-6": { - "profile" : "[BUFFER_PROFILE|q_lossy_profile]" - }{% if not loop.last %},{% endif %} - -{% endfor %} - } +{%- macro generate_queue_buffers_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_queue_buffers(port_names_active, port_names_inactive) }} {%- endmacro %} - +{%- macro generate_pg_profiles_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_pg_profiles(port_names_active, port_names_inactive) }} +{%- endmacro %} diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/ACS-MSN4700/buffers_defaults_t1.j2 b/device/mellanox/x86_64-mlnx_msn4700-r0/ACS-MSN4700/buffers_defaults_t1.j2 index 0550c6dd3103..50f5d850be79 100644 --- a/device/mellanox/x86_64-mlnx_msn4700-r0/ACS-MSN4700/buffers_defaults_t1.j2 +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/ACS-MSN4700/buffers_defaults_t1.j2 @@ -4,109 +4,20 @@ {% set egress_lossless_pool_size = '60817392' %} {% set egress_lossy_pool_size = '20627456' %} -{%- macro generate_port_lists(PORT_ALL) %} - {# Generate list of ports #} - {%- for port_idx in range(0, 32) %} - {%- if PORT_ALL.append("Ethernet%d" % (port_idx)) %}{%- endif %} - {%- endfor %} -{%- endmacro %} +{% import 'buffers_defaults_objects.j2' as defs with context %} -{%- macro generate_buffer_pool_and_profiles() %} - "BUFFER_POOL": { - "ingress_lossless_pool": { - {%- if dynamic_mode is not defined %} - "size": "{{ ingress_lossless_pool_size }}", - {%- endif %} - "type": "ingress", - "mode": "dynamic" - }, - "ingress_lossy_pool": { - {%- if dynamic_mode is not defined %} - "size": "{{ ingress_lossy_pool_size }}", - {%- endif %} - "type": "ingress", - "mode": "dynamic" - }, - "egress_lossless_pool": { - "size": "{{ egress_lossless_pool_size }}", - "type": "egress", - "mode": "dynamic" - }, - "egress_lossy_pool": { - {%- if dynamic_mode is not defined %} - "size": "{{ egress_lossy_pool_size }}", - {%- endif %} - "type": "egress", - "mode": "dynamic" - } - }, - "BUFFER_PROFILE": { - "ingress_lossless_profile": { - "pool":"[BUFFER_POOL|ingress_lossless_pool]", - "size":"0", - "dynamic_th":"7" - }, - "ingress_lossy_profile": { - "pool":"[BUFFER_POOL|ingress_lossy_pool]", - "size":"0", - "dynamic_th":"3" - }, - "egress_lossless_profile": { - "pool":"[BUFFER_POOL|egress_lossless_pool]", - "size":"0", - "dynamic_th":"7" - }, - "egress_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"9216", - "dynamic_th":"7" - }, - "q_lossy_profile": { - "pool":"[BUFFER_POOL|egress_lossy_pool]", - "size":"0", - "dynamic_th":"3" - } - }, +{%- macro generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) %} +{{ defs.generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) }} {%- endmacro %} -{%- macro generate_profile_lists(port_names) %} - "BUFFER_PORT_INGRESS_PROFILE_LIST": { -{% for port in port_names.split(',') %} - "{{ port }}": { - "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" - }{% if not loop.last %},{% endif %} - -{% endfor %} - }, - "BUFFER_PORT_EGRESS_PROFILE_LIST": { -{% for port in port_names.split(',') %} - "{{ port }}": { - "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" - }{% if not loop.last %},{% endif %} - -{% endfor %} - } +{%- macro generate_profile_lists_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_profile_lists(port_names_active, port_names_inactive) }} {%- endmacro %} -{%- macro generate_queue_buffers(port_names) %} - "BUFFER_QUEUE": { -{% for port in port_names.split(',') %} - "{{ port }}|3-4": { - "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" - }, -{% endfor %} -{% for port in port_names.split(',') %} - "{{ port }}|0-2": { - "profile" : "[BUFFER_PROFILE|q_lossy_profile]" - }, -{% endfor %} -{% for port in port_names.split(',') %} - "{{ port }}|5-6": { - "profile" : "[BUFFER_PROFILE|q_lossy_profile]" - }{% if not loop.last %},{% endif %} - -{% endfor %} - } +{%- macro generate_queue_buffers_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_queue_buffers(port_names_active, port_names_inactive) }} {%- endmacro %} - +{%- macro generate_pg_profiles_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_pg_profiles(port_names_active, port_names_inactive) }} +{%- endmacro %} diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/ACS-MSN4700/hwsku.json b/device/mellanox/x86_64-mlnx_msn4700-r0/ACS-MSN4700/hwsku.json deleted file mode 100644 index 4c3dee3d17a7..000000000000 --- a/device/mellanox/x86_64-mlnx_msn4700-r0/ACS-MSN4700/hwsku.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "interfaces": { - "Ethernet0": { - "default_brkout_mode": "1x400G[200G]" - }, - "Ethernet8": { - "default_brkout_mode": "1x400G[200G]" - }, - "Ethernet16": { - "default_brkout_mode": "1x400G[200G]" - }, - "Ethernet24": { - "default_brkout_mode": "1x400G[200G]" - }, - "Ethernet32": { - "default_brkout_mode": "1x400G[200G]" - }, - "Ethernet40": { - "default_brkout_mode": "1x400G[200G]" - }, - "Ethernet48": { - "default_brkout_mode": "1x400G[200G]" - }, - "Ethernet56": { - "default_brkout_mode": "1x400G[200G]" - }, - "Ethernet64": { - "default_brkout_mode": "1x400G[200G]" - }, - "Ethernet72": { - "default_brkout_mode": "1x400G[200G]" - }, - "Ethernet80": { - "default_brkout_mode": "1x400G[200G]" - }, - "Ethernet88": { - "default_brkout_mode": "1x400G[200G]" - }, - "Ethernet96": { - "default_brkout_mode": "1x400G[200G]" - }, - "Ethernet104": { - "default_brkout_mode": "1x400G[200G]" - }, - "Ethernet112": { - "default_brkout_mode": "1x400G[200G]" - }, - "Ethernet120": { - "default_brkout_mode": "1x400G[200G]" - }, - "Ethernet128": { - "default_brkout_mode": "1x400G[200G]" - }, - "Ethernet136": { - "default_brkout_mode": "1x400G[200G]" - }, - "Ethernet144": { - "default_brkout_mode": "1x400G[200G]" - }, - "Ethernet152": { - "default_brkout_mode": "1x400G[200G]" - }, - "Ethernet160": { - "default_brkout_mode": "1x400G[200G]" - }, - "Ethernet168": { - "default_brkout_mode": "1x400G[200G]" - }, - "Ethernet176": { - "default_brkout_mode": "1x400G[200G]" - }, - "Ethernet184": { - "default_brkout_mode": "1x400G[200G]" - }, - "Ethernet192": { - "default_brkout_mode": "1x400G[200G]" - }, - "Ethernet200": { - "default_brkout_mode": "1x400G[200G]" - }, - "Ethernet208": { - "default_brkout_mode": "1x400G[200G]" - }, - "Ethernet216": { - "default_brkout_mode": "1x400G[200G]" - }, - "Ethernet224": { - "default_brkout_mode": "1x400G[200G]" - }, - "Ethernet232": { - "default_brkout_mode": "1x400G[200G]" - }, - "Ethernet240": { - "default_brkout_mode": "1x400G[200G]" - }, - "Ethernet248": { - "default_brkout_mode": "1x400G[200G]" - } - } -} \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/ACS-MSN4700/sai.profile b/device/mellanox/x86_64-mlnx_msn4700-r0/ACS-MSN4700/sai.profile index d145093cab96..c6fb815168fe 100644 --- a/device/mellanox/x86_64-mlnx_msn4700-r0/ACS-MSN4700/sai.profile +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/ACS-MSN4700/sai.profile @@ -1 +1,3 @@ SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_4700.xml +SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps +SAI_DUMP_STORE_AMOUNT=10 diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-A96C8V8/buffers.json.j2 b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-A96C8V8/buffers.json.j2 new file mode 100644 index 000000000000..afbd130a436d --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-A96C8V8/buffers.json.j2 @@ -0,0 +1,16 @@ + +{# + Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. + Apache-2.0 + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +#} +{%- set default_topo = 't0' %} +{%- include 'buffers_config.j2' %} diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-A96C8V8/buffers_defaults_objects.j2 b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-A96C8V8/buffers_defaults_objects.j2 new file mode 120000 index 000000000000..c01aebb7ae12 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-A96C8V8/buffers_defaults_objects.j2 @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/buffers_defaults_objects.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-A96C8V8/buffers_defaults_t0.j2 b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-A96C8V8/buffers_defaults_t0.j2 new file mode 100644 index 000000000000..bdca5962fd58 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-A96C8V8/buffers_defaults_t0.j2 @@ -0,0 +1,46 @@ + +{# + Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. + Apache-2.0 + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +#} +{% set default_cable = '5m' %} +{%-set ports2cable = { + 'torrouter_server' : '5m', + 'leafrouter_torrouter' : '300m', + 'spinerouter_leafrouter' : '1500m' + } +-%} +{% set ingress_lossless_pool_size = '46415872' %} +{% set ingress_lossless_pool_xoff = '1982464' %} +{% set egress_lossless_pool_size = '60817392' %} +{% set egress_lossy_pool_size = '46415872' %} + +{% import 'buffers_defaults_objects.j2' as defs with context %} + +{%- macro generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) %} +{{ defs.generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_profile_lists_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_profile_lists(port_names_active, port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_queue_buffers_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_queue_buffers(port_names_active, port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_pg_profiles_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_pg_profiles(port_names_active, port_names_inactive) }} +{%- endmacro %} diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-A96C8V8/buffers_defaults_t1.j2 b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-A96C8V8/buffers_defaults_t1.j2 new file mode 100644 index 000000000000..444c728c5ba1 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-A96C8V8/buffers_defaults_t1.j2 @@ -0,0 +1,40 @@ + +{# + Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. + Apache-2.0 + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +#} +{% set default_cable = '300m' %} +{% set ingress_lossless_pool_size = '45432832' %} +{% set ingress_lossless_pool_xoff = '2965504' %} +{% set egress_lossless_pool_size = '60817392' %} +{% set egress_lossy_pool_size = '45432832' %} + +{% import 'buffers_defaults_objects.j2' as defs with context %} + +{%- macro generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) %} +{{ defs.generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_profile_lists_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_profile_lists(port_names_active, port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_queue_buffers_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_queue_buffers(port_names_active, port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_pg_profiles_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_pg_profiles(port_names_active, port_names_inactive) }} +{%- endmacro %} diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-A96C8V8/buffers_dynamic.json.j2 b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-A96C8V8/buffers_dynamic.json.j2 new file mode 100644 index 000000000000..ac50755abbcb --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-A96C8V8/buffers_dynamic.json.j2 @@ -0,0 +1,17 @@ + +{# + Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. + Apache-2.0 + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +#} +{%- set default_topo = 't0' %} +{%- set dynamic_mode = 'true' %} +{%- include 'buffers_config.j2' %} diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-A96C8V8/pg_profile_lookup.ini b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-A96C8V8/pg_profile_lookup.ini new file mode 120000 index 000000000000..66cab04d2c42 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-A96C8V8/pg_profile_lookup.ini @@ -0,0 +1 @@ +../Mellanox-SN4700-C128/pg_profile_lookup.ini \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-A96C8V8/port_config.ini b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-A96C8V8/port_config.ini new file mode 100644 index 000000000000..bd24d40599fe --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-A96C8V8/port_config.ini @@ -0,0 +1,113 @@ +# name lanes alias index speed +Ethernet0 0 etp1a 1 25000 +Ethernet1 1 etp1b 1 25000 +Ethernet2 2 etp1c 1 25000 +Ethernet3 3 etp1d 1 25000 +Ethernet8 8 etp2a 2 25000 +Ethernet9 9 etp2b 2 25000 +Ethernet10 10 etp2c 2 25000 +Ethernet11 11 etp2d 2 25000 +Ethernet16 16 etp3a 3 25000 +Ethernet17 17 etp3b 3 25000 +Ethernet18 18 etp3c 3 25000 +Ethernet19 19 etp3d 3 25000 +Ethernet24 24 etp4a 4 25000 +Ethernet25 25 etp4b 4 25000 +Ethernet26 26 etp4c 4 25000 +Ethernet27 27 etp4d 4 25000 +Ethernet32 32 etp5a 5 25000 +Ethernet33 33 etp5b 5 25000 +Ethernet34 34 etp5c 5 25000 +Ethernet35 35 etp5d 5 25000 +Ethernet40 40 etp6a 6 25000 +Ethernet41 41 etp6b 6 25000 +Ethernet42 42 etp6c 6 25000 +Ethernet43 43 etp6d 6 25000 +Ethernet48 48 etp7a 7 25000 +Ethernet49 49 etp7b 7 25000 +Ethernet50 50 etp7c 7 25000 +Ethernet51 51 etp7d 7 25000 +Ethernet56 56 etp8a 8 25000 +Ethernet57 57 etp8b 8 25000 +Ethernet58 58 etp8c 8 25000 +Ethernet59 59 etp8d 8 25000 +Ethernet64 64 etp9a 9 25000 +Ethernet65 65 etp9b 9 25000 +Ethernet66 66 etp9c 9 25000 +Ethernet67 67 etp9d 9 25000 +Ethernet72 72 etp10a 10 25000 +Ethernet73 73 etp10b 10 25000 +Ethernet74 74 etp10c 10 25000 +Ethernet75 75 etp10d 10 25000 +Ethernet80 80 etp11a 11 25000 +Ethernet81 81 etp11b 11 25000 +Ethernet82 82 etp11c 11 25000 +Ethernet83 83 etp11d 11 25000 +Ethernet88 88 etp12a 12 25000 +Ethernet89 89 etp12b 12 25000 +Ethernet90 90 etp12c 12 25000 +Ethernet91 91 etp12d 12 25000 +Ethernet96 96 etp13a 13 25000 +Ethernet97 97 etp13b 13 25000 +Ethernet98 98 etp13c 13 25000 +Ethernet99 99 etp13d 13 25000 +Ethernet104 104 etp14a 14 25000 +Ethernet105 105 etp14b 14 25000 +Ethernet106 106 etp14c 14 25000 +Ethernet107 107 etp14d 14 25000 +Ethernet112 112 etp15a 15 25000 +Ethernet113 113 etp15b 15 25000 +Ethernet114 114 etp15c 15 25000 +Ethernet115 115 etp15d 15 25000 +Ethernet120 120 etp16a 16 25000 +Ethernet121 121 etp16b 16 25000 +Ethernet122 122 etp16c 16 25000 +Ethernet123 123 etp16d 16 25000 +Ethernet128 128 etp17a 17 25000 +Ethernet129 129 etp17b 17 25000 +Ethernet130 130 etp17c 17 25000 +Ethernet131 131 etp17d 17 25000 +Ethernet136 136 etp18a 18 25000 +Ethernet137 137 etp18b 18 25000 +Ethernet138 138 etp18c 18 25000 +Ethernet139 139 etp18d 18 25000 +Ethernet144 144 etp19a 19 25000 +Ethernet145 145 etp19b 19 25000 +Ethernet146 146 etp19c 19 25000 +Ethernet147 147 etp19d 19 25000 +Ethernet152 152 etp20a 20 25000 +Ethernet153 153 etp20b 20 25000 +Ethernet154 154 etp20c 20 25000 +Ethernet155 155 etp20d 20 25000 +Ethernet160 160 etp21a 21 25000 +Ethernet161 161 etp21b 21 25000 +Ethernet162 162 etp21c 21 25000 +Ethernet163 163 etp21d 21 25000 +Ethernet168 168 etp22a 22 25000 +Ethernet169 169 etp22b 22 25000 +Ethernet170 170 etp22c 22 25000 +Ethernet171 171 etp22d 22 25000 +Ethernet176 176 etp23a 23 25000 +Ethernet177 177 etp23b 23 25000 +Ethernet178 178 etp23c 23 25000 +Ethernet179 179 etp23d 23 25000 +Ethernet184 184 etp24a 24 25000 +Ethernet185 185 etp24b 24 25000 +Ethernet186 186 etp24c 24 25000 +Ethernet187 187 etp24d 24 25000 +Ethernet192 192,193,194,195 etp25a 25 100000 +Ethernet196 196,197,198,199 etp25b 25 100000 +Ethernet200 200,201,202,203 etp26a 26 100000 +Ethernet204 204,205,206,207 etp26b 26 100000 +Ethernet208 208,209,210,211 etp27a 27 100000 +Ethernet212 212,213,214,215 etp27b 27 100000 +Ethernet216 216,217,218,219 etp28a 28 100000 +Ethernet220 220,221,222,223 etp28b 28 100000 +Ethernet224 224,225,226,227 etp29a 29 200000 +Ethernet228 228,229,230,231 etp29b 29 200000 +Ethernet232 232,233,234,235 etp30a 30 200000 +Ethernet236 236,237,238,239 etp30b 30 200000 +Ethernet240 240,241,242,243 etp31a 31 200000 +Ethernet244 244,245,246,247 etp31b 31 200000 +Ethernet248 248,249,250,251 etp32a 32 200000 +Ethernet252 252,253,254,255 etp32b 32 200000 diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-A96C8V8/qos.json.j2 b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-A96C8V8/qos.json.j2 new file mode 120000 index 000000000000..eccf286dc879 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-A96C8V8/qos.json.j2 @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/ACS-MSN2700/qos.json.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-A96C8V8/sai.profile b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-A96C8V8/sai.profile new file mode 100644 index 000000000000..377656b4ca8f --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-A96C8V8/sai.profile @@ -0,0 +1,3 @@ +SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_4700_8x200g_8x100g_96x25g.xml +SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps +SAI_DUMP_STORE_AMOUNT=10 diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-A96C8V8/sai_4700_8x200g_8x100g_96x25g.xml b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-A96C8V8/sai_4700_8x200g_8x100g_96x25g.xml new file mode 100644 index 000000000000..6b16851934dc --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-A96C8V8/sai_4700_8x200g_8x100g_96x25g.xml @@ -0,0 +1,277 @@ + + + + + 00:02:03:04:05:00 + + + 1 + + + 32 + + + + + 1 + 4 + 17 + 3 + 100 + 4 + + + 5 + 4 + 16 + 3 + 100 + 4 + + + 9 + 4 + 19 + 3 + 100 + 4 + + + 13 + 4 + 18 + 3 + 100 + 4 + + + 17 + 4 + 21 + 3 + 100 + 4 + + + 21 + 4 + 20 + 3 + 100 + 4 + + + 25 + 4 + 23 + 3 + 100 + 4 + + + 29 + 4 + 22 + 3 + 100 + 4 + + + 33 + 8 + 29 + 1 + 4096 + 2 + + + 37 + 8 + 28 + 1 + 4096 + 2 + + + 41 + 8 + 31 + 1 + 4096 + 2 + + + 45 + 8 + 30 + 1 + 4096 + 2 + + + 49 + 8 + 25 + 1 + 1536 + 2 + + + 53 + 8 + 24 + 1 + 1536 + 2 + + + 57 + 8 + 27 + 1 + 1536 + 2 + + + 61 + 8 + 26 + 1 + 1536 + 2 + + + 65 + 4 + 14 + 3 + 100 + 4 + + + 69 + 4 + 15 + 3 + 100 + 4 + + + 73 + 4 + 12 + 3 + 100 + 4 + + + 77 + 4 + 13 + 3 + 100 + 4 + + + 81 + 4 + 10 + 3 + 100 + 4 + + + 85 + 4 + 11 + 3 + 100 + 4 + + + 89 + 4 + 8 + 3 + 100 + 4 + + + 93 + 4 + 9 + 3 + 100 + 4 + + + 97 + 4 + 2 + 3 + 100 + 4 + + + 101 + 4 + 3 + 3 + 100 + 4 + + + 105 + 4 + 0 + + + 3 + + + 100 + 4 + + + 109 + 4 + 1 + 3 + 100 + 4 + + + 113 + 4 + 6 + 3 + 100 + 4 + + + 117 + 4 + 7 + 3 + 100 + 4 + + + 121 + 4 + 4 + 3 + 100 + 4 + + + 125 + 4 + 5 + 3 + 100 + 4 + + + + diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-C128/buffers.json.j2 b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-C128/buffers.json.j2 new file mode 100644 index 000000000000..2905747f5b04 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-C128/buffers.json.j2 @@ -0,0 +1,15 @@ +{# + Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. + Apache-2.0 + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +#} +{%- set default_topo = 't2' %} +{%- include 'buffers_config.j2' %} diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-C128/buffers_defaults_objects.j2 b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-C128/buffers_defaults_objects.j2 new file mode 120000 index 000000000000..c01aebb7ae12 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-C128/buffers_defaults_objects.j2 @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/buffers_defaults_objects.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-C128/buffers_defaults_t0.j2 b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-C128/buffers_defaults_t0.j2 new file mode 100644 index 000000000000..f22c56702af5 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-C128/buffers_defaults_t0.j2 @@ -0,0 +1,39 @@ +{# + Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. + Apache-2.0 + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +#} +{% set default_cable = '5m' %} +{% set ingress_lossless_pool_size = '44910592' %} +{% set ingress_lossless_pool_xoff = '1751040' %} +{% set egress_lossless_pool_size = '60817392' %} +{% set egress_lossy_pool_size = '44910592' %} + +{% import 'buffers_defaults_objects.j2' as defs with context %} + +{%- macro generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) %} +{{ defs.generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_profile_lists_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_profile_lists(port_names_active, port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_queue_buffers_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_queue_buffers(port_names_active, port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_pg_profiles_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_pg_profiles(port_names_active, port_names_inactive) }} +{%- endmacro %} diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-C128/buffers_defaults_t1.j2 b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-C128/buffers_defaults_t1.j2 new file mode 100644 index 000000000000..b87050280529 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-C128/buffers_defaults_t1.j2 @@ -0,0 +1,39 @@ +{# + Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. + Apache-2.0 + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +#} +{% set default_cable = '5m' %} +{% set ingress_lossless_pool_size = '44587008' %} +{% set ingress_lossless_pool_xoff = '2074624' %} +{% set egress_lossless_pool_size = '60817392' %} +{% set egress_lossy_pool_size = '44587008' %} + +{% import 'buffers_defaults_objects.j2' as defs with context %} + +{%- macro generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) %} +{{ defs.generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_profile_lists_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_profile_lists(port_names_active, port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_queue_buffers_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_queue_buffers(port_names_active, port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_pg_profiles_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_pg_profiles(port_names_active, port_names_inactive) }} +{%- endmacro %} diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-C128/buffers_defaults_t2.j2 b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-C128/buffers_defaults_t2.j2 new file mode 100644 index 000000000000..b0df4defd449 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-C128/buffers_defaults_t2.j2 @@ -0,0 +1,44 @@ +{# + Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. + Apache-2.0 + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +#} +{% set default_cable = '1500m' %} +{%-set ports2cable = { + 'spinerouter_leafrouter' : '1500m', + 'spinerouter_spinerouter' : '1500m' + } +-%} +{% set ingress_lossless_pool_size = '35094528' %} +{% set ingress_lossless_pool_xoff = '11567104' %} +{% set egress_lossless_pool_size = '60817392' %} +{% set egress_lossy_pool_size = '35094528' %} + +{% import 'buffers_defaults_objects.j2' as defs with context %} + +{%- macro generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) %} +{{ defs.generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_profile_lists_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_profile_lists(port_names_active, port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_queue_buffers_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_queue_buffers(port_names_active, port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_pg_profiles_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_pg_profiles(port_names_active, port_names_inactive) }} +{%- endmacro %} diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-C128/buffers_dynamic.json.j2 b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-C128/buffers_dynamic.json.j2 new file mode 100644 index 000000000000..4ec20f1d9e84 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-C128/buffers_dynamic.json.j2 @@ -0,0 +1,16 @@ +{# + Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. + Apache-2.0 + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +#} +{%- set default_topo = 't2' %} +{%- set dynamic_mode = 'true' %} +{%- include 'buffers_config.j2' %} diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-C128/pg_profile_lookup.ini b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-C128/pg_profile_lookup.ini new file mode 100644 index 000000000000..7b78fb98ae37 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-C128/pg_profile_lookup.ini @@ -0,0 +1,41 @@ +## +## Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. +## Apache-2.0 +## +## Licensed under the Apache License, Version 2.0 (the "License"); +## you may not use this file except in compliance with the License. +## You may obtain a copy of the License at +## +## http://www.apache.org/licenses/LICENSE-2.0 +## +## Unless required by applicable law or agreed to in writing, software +## distributed under the License is distributed on an "AS IS" BASIS, +## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +## See the License for the specific language governing permissions and +## limitations under the License. +## +# PG lossless profiles. +# speed cable size xon xoff threshold + 10000 5m 19456 19456 24576 0 + 25000 5m 19456 19456 26624 0 + 40000 5m 19456 19456 30720 0 + 50000 5m 19456 19456 33792 0 + 100000 5m 19456 19456 59392 0 + 200000 5m 19456 19456 66560 0 + 10000 40m 19456 19456 25600 0 + 25000 40m 19456 19456 28672 0 + 40000 40m 19456 19456 33792 0 + 50000 40m 19456 19456 36864 0 + 100000 40m 19456 19456 66560 0 + 200000 40m 19456 19456 80896 0 + 10000 300m 19456 19456 30720 0 + 25000 300m 19456 19456 41984 0 + 40000 300m 19456 19456 54272 0 + 50000 300m 19456 19456 63488 0 + 100000 300m 19456 19456 120832 0 + 200000 300m 19456 19456 188416 0 + 10000 1500m 19456 19456 55296 0 + 25000 1500m 19456 19456 103424 0 + 40000 1500m 19456 19456 153600 0 + 50000 1500m 19456 19456 187392 0 + 100000 1500m 19456 19456 366592 0 diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-C128/port_config.ini b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-C128/port_config.ini new file mode 100644 index 000000000000..d64b66b0b691 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-C128/port_config.ini @@ -0,0 +1,129 @@ +# name lanes alias index speed +Ethernet0 0,1 etp1a 1 100000 +Ethernet2 2,3 etp1b 1 100000 +Ethernet4 4,5 etp1c 1 100000 +Ethernet6 6,7 etp1d 1 100000 +Ethernet8 8,9 etp2a 2 100000 +Ethernet10 10,11 etp2b 2 100000 +Ethernet12 12,13 etp2c 2 100000 +Ethernet14 14,15 etp2d 2 100000 +Ethernet16 16,17 etp3a 3 100000 +Ethernet18 18,19 etp3b 3 100000 +Ethernet20 20,21 etp3c 3 100000 +Ethernet22 22,23 etp3d 3 100000 +Ethernet24 24,25 etp4a 4 100000 +Ethernet26 26,27 etp4b 4 100000 +Ethernet28 28,29 etp4c 4 100000 +Ethernet30 30,31 etp4d 4 100000 +Ethernet32 32,33 etp5a 5 100000 +Ethernet34 34,35 etp5b 5 100000 +Ethernet36 36,37 etp5c 5 100000 +Ethernet38 38,39 etp5d 5 100000 +Ethernet40 40,41 etp6a 6 100000 +Ethernet42 42,43 etp6b 6 100000 +Ethernet44 44,45 etp6c 6 100000 +Ethernet46 46,47 etp6d 6 100000 +Ethernet48 48,49 etp7a 7 100000 +Ethernet50 50,51 etp7b 7 100000 +Ethernet52 52,53 etp7c 7 100000 +Ethernet54 54,55 etp7d 7 100000 +Ethernet56 56,57 etp8a 8 100000 +Ethernet58 58,59 etp8b 8 100000 +Ethernet60 60,61 etp8c 8 100000 +Ethernet62 62,63 etp8d 8 100000 +Ethernet64 64,65 etp9a 9 100000 +Ethernet66 66,67 etp9b 9 100000 +Ethernet68 68,69 etp9c 9 100000 +Ethernet70 70,71 etp9d 9 100000 +Ethernet72 72,73 etp10a 10 100000 +Ethernet74 74,75 etp10b 10 100000 +Ethernet76 76,77 etp10c 10 100000 +Ethernet78 78,79 etp10d 10 100000 +Ethernet80 80,81 etp11a 11 100000 +Ethernet82 82,83 etp11b 11 100000 +Ethernet84 84,85 etp11c 11 100000 +Ethernet86 86,87 etp11d 11 100000 +Ethernet88 88,89 etp12a 12 100000 +Ethernet90 90,91 etp12b 12 100000 +Ethernet92 92,93 etp12c 12 100000 +Ethernet94 94,95 etp12d 12 100000 +Ethernet96 96,97 etp13a 13 100000 +Ethernet98 98,99 etp13b 13 100000 +Ethernet100 100,101 etp13c 13 100000 +Ethernet102 102,103 etp13d 13 100000 +Ethernet104 104,105 etp14a 14 100000 +Ethernet106 106,107 etp14b 14 100000 +Ethernet108 108,109 etp14c 14 100000 +Ethernet110 110,111 etp14d 14 100000 +Ethernet112 112,113 etp15a 15 100000 +Ethernet114 114,115 etp15b 15 100000 +Ethernet116 116,117 etp15c 15 100000 +Ethernet118 118,119 etp15d 15 100000 +Ethernet120 120,121 etp16a 16 100000 +Ethernet122 122,123 etp16b 16 100000 +Ethernet124 124,125 etp16c 16 100000 +Ethernet126 126,127 etp16d 16 100000 +Ethernet128 128,129 etp17a 17 100000 +Ethernet130 130,131 etp17b 17 100000 +Ethernet132 132,133 etp17c 17 100000 +Ethernet134 134,135 etp17d 17 100000 +Ethernet136 136,137 etp18a 18 100000 +Ethernet138 138,139 etp18b 18 100000 +Ethernet140 140,141 etp18c 18 100000 +Ethernet142 142,143 etp18d 18 100000 +Ethernet144 144,145 etp19a 19 100000 +Ethernet146 146,147 etp19b 19 100000 +Ethernet148 148,149 etp19c 19 100000 +Ethernet150 150,151 etp19d 19 100000 +Ethernet152 152,153 etp20a 20 100000 +Ethernet154 154,155 etp20b 20 100000 +Ethernet156 156,157 etp20c 20 100000 +Ethernet158 158,159 etp20d 20 100000 +Ethernet160 160,161 etp21a 21 100000 +Ethernet162 162,163 etp21b 21 100000 +Ethernet164 164,165 etp21c 21 100000 +Ethernet166 166,167 etp21d 21 100000 +Ethernet168 168,169 etp22a 22 100000 +Ethernet170 170,171 etp22b 22 100000 +Ethernet172 172,173 etp22c 22 100000 +Ethernet174 174,175 etp22d 22 100000 +Ethernet176 176,177 etp23a 23 100000 +Ethernet178 178,179 etp23b 23 100000 +Ethernet180 180,181 etp23c 23 100000 +Ethernet182 182,183 etp23d 23 100000 +Ethernet184 184,185 etp24a 24 100000 +Ethernet186 186,187 etp24b 24 100000 +Ethernet188 188,189 etp24c 24 100000 +Ethernet190 190,191 etp24d 24 100000 +Ethernet192 192,193 etp25a 25 100000 +Ethernet194 194,195 etp25b 25 100000 +Ethernet196 196,197 etp25c 25 100000 +Ethernet198 198,199 etp25d 25 100000 +Ethernet200 200,201 etp26a 26 100000 +Ethernet202 202,203 etp26b 26 100000 +Ethernet204 204,205 etp26c 26 100000 +Ethernet206 206,207 etp26d 26 100000 +Ethernet208 208,209 etp27a 27 100000 +Ethernet210 210,211 etp27b 27 100000 +Ethernet212 212,213 etp27c 27 100000 +Ethernet214 214,215 etp27d 27 100000 +Ethernet216 216,217 etp28a 28 100000 +Ethernet218 218,219 etp28b 28 100000 +Ethernet220 220,221 etp28c 28 100000 +Ethernet222 222,223 etp28d 28 100000 +Ethernet224 224,225 etp29a 29 100000 +Ethernet226 226,227 etp29b 29 100000 +Ethernet228 228,229 etp29c 29 100000 +Ethernet230 230,231 etp29d 29 100000 +Ethernet232 232,233 etp30a 30 100000 +Ethernet234 234,235 etp30b 30 100000 +Ethernet236 236,237 etp30c 30 100000 +Ethernet238 238,239 etp30d 30 100000 +Ethernet240 240,241 etp31a 31 100000 +Ethernet242 242,243 etp31b 31 100000 +Ethernet244 244,245 etp31c 31 100000 +Ethernet246 246,247 etp31d 31 100000 +Ethernet248 248,249 etp32a 32 100000 +Ethernet250 250,251 etp32b 32 100000 +Ethernet252 252,253 etp32c 32 100000 +Ethernet254 254,255 etp32d 32 100000 diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-C128/qos.json.j2 b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-C128/qos.json.j2 new file mode 120000 index 000000000000..eccf286dc879 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-C128/qos.json.j2 @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/ACS-MSN2700/qos.json.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-C128/sai.profile b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-C128/sai.profile new file mode 100644 index 000000000000..d20b5e46b843 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-C128/sai.profile @@ -0,0 +1,3 @@ +SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_4700_128x100g.xml +SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps +SAI_DUMP_STORE_AMOUNT=10 diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-C128/sai_4700_128x100g.xml b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-C128/sai_4700_128x100g.xml new file mode 100644 index 000000000000..f5d49f8b86ab --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-C128/sai_4700_128x100g.xml @@ -0,0 +1,277 @@ + + + + + 00:02:03:04:05:00 + + + 1 + + + 32 + + + + + 1 + 8 + 17 + 3 + 1536 + 4 + + + 5 + 8 + 16 + 3 + 1536 + 4 + + + 9 + 8 + 19 + 3 + 1536 + 4 + + + 13 + 8 + 18 + 3 + 1536 + 4 + + + 17 + 8 + 21 + 3 + 1536 + 4 + + + 21 + 8 + 20 + 3 + 1536 + 4 + + + 25 + 8 + 23 + 3 + 1536 + 4 + + + 29 + 8 + 22 + 3 + 1536 + 4 + + + 33 + 8 + 29 + 3 + 1536 + 4 + + + 37 + 8 + 28 + 3 + 1536 + 4 + + + 41 + 8 + 31 + 3 + 1536 + 4 + + + 45 + 8 + 30 + 3 + 1536 + 4 + + + 49 + 8 + 25 + 3 + 1536 + 4 + + + 53 + 8 + 24 + 3 + 1536 + 4 + + + 57 + 8 + 27 + 3 + 1536 + 4 + + + 61 + 8 + 26 + 3 + 1536 + 4 + + + 65 + 8 + 14 + 3 + 1536 + 4 + + + 69 + 8 + 15 + 3 + 1536 + 4 + + + 73 + 8 + 12 + 3 + 1536 + 4 + + + 77 + 8 + 13 + 3 + 1536 + 4 + + + 81 + 8 + 10 + 3 + 1536 + 4 + + + 85 + 8 + 11 + 3 + 1536 + 4 + + + 89 + 8 + 8 + 3 + 1536 + 4 + + + 93 + 8 + 9 + 3 + 1536 + 4 + + + 97 + 8 + 2 + 3 + 1536 + 4 + + + 101 + 8 + 3 + 3 + 1536 + 4 + + + 105 + 8 + 0 + + + 3 + + + 1536 + 4 + + + 109 + 8 + 1 + 3 + 1536 + 4 + + + 113 + 8 + 6 + 3 + 1536 + 4 + + + 117 + 8 + 7 + 3 + 1536 + 4 + + + 121 + 8 + 4 + 3 + 1536 + 4 + + + 125 + 8 + 5 + 3 + 1536 + 4 + + + + diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-V48C32/buffers.json.j2 b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-V48C32/buffers.json.j2 new file mode 100644 index 000000000000..44f0d97ce37d --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-V48C32/buffers.json.j2 @@ -0,0 +1,16 @@ + +{# + Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. + Apache-2.0 + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +#} +{%- set default_topo = 't1' %} +{%- include 'buffers_config.j2' %} diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-V48C32/buffers_defaults_objects.j2 b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-V48C32/buffers_defaults_objects.j2 new file mode 120000 index 000000000000..c01aebb7ae12 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-V48C32/buffers_defaults_objects.j2 @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/Mellanox-SN2700-D48C8/buffers_defaults_objects.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-V48C32/buffers_defaults_t0.j2 b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-V48C32/buffers_defaults_t0.j2 new file mode 100644 index 000000000000..841444e9aa94 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-V48C32/buffers_defaults_t0.j2 @@ -0,0 +1,40 @@ + +{# + Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. + Apache-2.0 + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +#} +{% set default_cable = '5m' %} +{% set ingress_lossless_pool_size = '50208768' %} +{% set ingress_lossless_pool_xoff = '1662976' %} +{% set egress_lossless_pool_size = '60817392' %} +{% set egress_lossy_pool_size = '50208768' %} + +{% import 'buffers_defaults_objects.j2' as defs with context %} + +{%- macro generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) %} +{{ defs.generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_profile_lists_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_profile_lists(port_names_active, port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_queue_buffers_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_queue_buffers(port_names_active, port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_pg_profiles_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_pg_profiles(port_names_active, port_names_inactive) }} +{%- endmacro %} diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-V48C32/buffers_defaults_t1.j2 b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-V48C32/buffers_defaults_t1.j2 new file mode 100644 index 000000000000..03f41430d73b --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-V48C32/buffers_defaults_t1.j2 @@ -0,0 +1,46 @@ + +{# + Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. + Apache-2.0 + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +#} +{% set default_cable = '300m' %} +{%-set ports2cable = { + 'torrouter_server' : '5m', + 'leafrouter_torrouter' : '300m', + 'spinerouter_leafrouter' : '1500m' + } +-%} +{% set ingress_lossless_pool_size = '46780416' %} +{% set ingress_lossless_pool_xoff = '5091328' %} +{% set egress_lossless_pool_size = '60817392' %} +{% set egress_lossy_pool_size = '46780416' %} + +{% import 'buffers_defaults_objects.j2' as defs with context %} + +{%- macro generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) %} +{{ defs.generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_profile_lists_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_profile_lists(port_names_active, port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_queue_buffers_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_queue_buffers(port_names_active, port_names_inactive) }} +{%- endmacro %} + +{%- macro generate_pg_profiles_with_inactive_ports(port_names_active, port_names_inactive) %} +{{ defs.generate_pg_profiles(port_names_active, port_names_inactive) }} +{%- endmacro %} diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-V48C32/buffers_dynamic.json.j2 b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-V48C32/buffers_dynamic.json.j2 new file mode 100644 index 000000000000..0829b960de18 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-V48C32/buffers_dynamic.json.j2 @@ -0,0 +1,17 @@ + +{# + Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. + Apache-2.0 + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +#} +{%- set default_topo = 't1' %} +{%- set dynamic_mode = 'true' %} +{%- include 'buffers_config.j2' %} diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-V48C32/pg_profile_lookup.ini b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-V48C32/pg_profile_lookup.ini new file mode 120000 index 000000000000..66cab04d2c42 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-V48C32/pg_profile_lookup.ini @@ -0,0 +1 @@ +../Mellanox-SN4700-C128/pg_profile_lookup.ini \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-V48C32/port_config.ini b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-V48C32/port_config.ini new file mode 100644 index 000000000000..8fdb867ef848 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-V48C32/port_config.ini @@ -0,0 +1,81 @@ +# name lanes alias index speed +Ethernet0 0,1,2,3 etp1a 1 200000 +Ethernet4 4,5,6,7 etp1b 1 200000 +Ethernet8 8,9,10,11 etp2a 2 200000 +Ethernet12 12,13,14,15 etp2b 2 200000 +Ethernet16 16,17,18,19 etp3a 3 200000 +Ethernet20 20,21,22,23 etp3b 3 200000 +Ethernet24 24,25,26,27 etp4a 4 200000 +Ethernet28 28,29,30,31 etp4b 4 200000 +Ethernet32 32,33,34,35 etp5a 5 200000 +Ethernet36 36,37,38,39 etp5b 5 200000 +Ethernet40 40,41,42,43 etp6a 6 200000 +Ethernet44 44,45,46,47 etp6b 6 200000 +Ethernet48 48,49,50,51 etp7a 7 200000 +Ethernet52 52,53,54,55 etp7b 7 200000 +Ethernet56 56,57,58,59 etp8a 8 200000 +Ethernet60 60,61,62,63 etp8b 8 200000 +Ethernet64 64,65,66,67 etp9a 9 200000 +Ethernet68 68,69,70,71 etp9b 9 200000 +Ethernet72 72,73,74,75 etp10a 10 200000 +Ethernet76 76,77,78,79 etp10b 10 200000 +Ethernet80 80,81,82,83 etp11a 11 200000 +Ethernet84 84,85,86,87 etp11b 11 200000 +Ethernet88 88,89,90,91 etp12a 12 200000 +Ethernet92 92,93,94,95 etp12b 12 200000 +Ethernet96 96,97,98,99 etp13a 13 200000 +Ethernet100 100,101,102,103 etp13b 13 200000 +Ethernet104 104,105,106,107 etp14a 14 200000 +Ethernet108 108,109,110,111 etp14b 14 200000 +Ethernet112 112,113,114,115 etp15a 15 200000 +Ethernet116 116,117,118,119 etp15b 15 200000 +Ethernet120 120,121,122,123 etp16a 16 200000 +Ethernet124 124,125,126,127 etp16b 16 200000 +Ethernet128 128,129,130,131 etp17a 17 200000 +Ethernet132 132,133,134,135 etp17b 17 200000 +Ethernet136 136,137,138,139 etp18a 18 200000 +Ethernet140 140,141,142,143 etp18b 18 200000 +Ethernet144 144,145,146,147 etp19a 19 200000 +Ethernet148 148,149,150,151 etp19b 19 200000 +Ethernet152 152,153,154,155 etp20a 20 200000 +Ethernet156 156,157,158,159 etp20b 20 200000 +Ethernet160 160,161,162,163 etp21a 21 200000 +Ethernet164 164,165,166,167 etp21b 21 200000 +Ethernet168 168,169,170,171 etp22a 22 200000 +Ethernet172 172,173,174,175 etp22b 22 200000 +Ethernet176 176,177,178,179 etp23a 23 200000 +Ethernet180 180,181,182,183 etp23b 23 200000 +Ethernet184 184,185,186,187 etp24a 24 200000 +Ethernet188 188,189,190,191 etp24b 24 200000 +Ethernet192 192,193 etp25a 25 100000 +Ethernet194 194,195 etp25b 25 100000 +Ethernet196 196,197 etp25c 25 100000 +Ethernet198 198,199 etp25d 25 100000 +Ethernet200 200,201 etp26a 26 100000 +Ethernet202 202,203 etp26b 26 100000 +Ethernet204 204,205 etp26c 26 100000 +Ethernet206 206,207 etp26d 26 100000 +Ethernet208 208,209 etp27a 27 100000 +Ethernet210 210,211 etp27b 27 100000 +Ethernet212 212,213 etp27c 27 100000 +Ethernet214 214,215 etp27d 27 100000 +Ethernet216 216,217 etp28a 28 100000 +Ethernet218 218,219 etp28b 28 100000 +Ethernet220 220,221 etp28c 28 100000 +Ethernet222 222,223 etp28d 28 100000 +Ethernet224 224,225 etp29a 29 100000 +Ethernet226 226,227 etp29b 29 100000 +Ethernet228 228,229 etp29c 29 100000 +Ethernet230 230,231 etp29d 29 100000 +Ethernet232 232,233 etp30a 30 100000 +Ethernet234 234,235 etp30b 30 100000 +Ethernet236 236,237 etp30c 30 100000 +Ethernet238 238,239 etp30d 30 100000 +Ethernet240 240,241 etp31a 31 100000 +Ethernet242 242,243 etp31b 31 100000 +Ethernet244 244,245 etp31c 31 100000 +Ethernet246 246,247 etp31d 31 100000 +Ethernet248 248,249 etp32a 32 100000 +Ethernet250 250,251 etp32b 32 100000 +Ethernet252 252,253 etp32c 32 100000 +Ethernet254 254,255 etp32d 32 100000 diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-V48C32/qos.json.j2 b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-V48C32/qos.json.j2 new file mode 120000 index 000000000000..eccf286dc879 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-V48C32/qos.json.j2 @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/ACS-MSN2700/qos.json.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-V48C32/sai.profile b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-V48C32/sai.profile new file mode 100644 index 000000000000..42518df9d9e2 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-V48C32/sai.profile @@ -0,0 +1,3 @@ +SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_4700_32x100g_48x200g.xml +SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps +SAI_DUMP_STORE_AMOUNT=10 diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-V48C32/sai_4700_32x100g_48x200g.xml b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-V48C32/sai_4700_32x100g_48x200g.xml new file mode 100644 index 000000000000..fd382f8bd93e --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/Mellanox-SN4700-V48C32/sai_4700_32x100g_48x200g.xml @@ -0,0 +1,277 @@ + + + + + 00:02:03:04:05:00 + + + 1 + + + 32 + + + + + 1 + 8 + 17 + 1 + 4096 + 2 + + + 5 + 8 + 16 + 1 + 4096 + 2 + + + 9 + 8 + 19 + 1 + 4096 + 2 + + + 13 + 8 + 18 + 1 + 4096 + 2 + + + 17 + 8 + 21 + 1 + 4096 + 2 + + + 21 + 8 + 20 + 1 + 4096 + 2 + + + 25 + 8 + 23 + 1 + 4096 + 2 + + + 29 + 8 + 22 + 1 + 4096 + 2 + + + 33 + 8 + 29 + 3 + 1536 + 4 + + + 37 + 8 + 28 + 3 + 1536 + 4 + + + 41 + 8 + 31 + 3 + 1536 + 4 + + + 45 + 8 + 30 + 3 + 1536 + 4 + + + 49 + 8 + 25 + 3 + 1536 + 4 + + + 53 + 8 + 24 + 3 + 1536 + 4 + + + 57 + 8 + 27 + 3 + 1536 + 4 + + + 61 + 8 + 26 + 3 + 1536 + 4 + + + 65 + 8 + 14 + 1 + 4096 + 2 + + + 69 + 8 + 15 + 1 + 4096 + 2 + + + 73 + 8 + 12 + 1 + 4096 + 2 + + + 77 + 8 + 13 + 1 + 4096 + 2 + + + 81 + 8 + 10 + 1 + 4096 + 2 + + + 85 + 8 + 11 + 1 + 4096 + 2 + + + 89 + 8 + 8 + 1 + 4096 + 2 + + + 93 + 8 + 9 + 1 + 4096 + 2 + + + 97 + 8 + 2 + 1 + 4096 + 2 + + + 101 + 8 + 3 + 1 + 4096 + 2 + + + 105 + 8 + 0 + + + 1 + + + 4096 + 2 + + + 109 + 8 + 1 + 1 + 4096 + 2 + + + 113 + 8 + 6 + 1 + 4096 + 2 + + + 117 + 8 + 7 + 1 + 4096 + 2 + + + 121 + 8 + 4 + 1 + 4096 + 2 + + + 125 + 8 + 5 + 1 + 4096 + 2 + + + + diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/get_sensors_conf_path b/device/mellanox/x86_64-mlnx_msn4700-r0/get_sensors_conf_path new file mode 100755 index 000000000000..c347d7435416 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/get_sensors_conf_path @@ -0,0 +1,21 @@ +#!/bin/bash + +HW_VERSION="/var/run/hw-management/system/config1" +SENSORS_CONF_FILE="/usr/share/sonic/platform/sensors.conf" +SENSORS_CONF_FILE_A1="/usr/share/sonic/platform/sensors.conf.a1" + +function get_sensor_conf_path() { + local _HW_VERSION="0" + if [[ -e $HW_VERSION ]]; then + _HW_VERSION=$(cat $HW_VERSION 2>&1) + if [[ "$_HW_VERSION" == "1" ]]; then + if [[ -e $SENSORS_CONF_FILE_A1 ]]; then + echo $SENSORS_CONF_FILE_A1 + return + fi + fi + fi + echo $SENSORS_CONF_FILE +} + +get_sensor_conf_path diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/platform.json b/device/mellanox/x86_64-mlnx_msn4700-r0/platform.json index 7a3d3d1048b9..afa6aee14ef0 100644 --- a/device/mellanox/x86_64-mlnx_msn4700-r0/platform.json +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/platform.json @@ -1,196 +1,410 @@ { - "interfaces": { - "Ethernet0": { - "index": "1,1,1,1,1,1,1,1", - "lanes": "0,1,2,3,4,5,6,7", - "alias_at_lanes": "etp1a, etp1b, etp1c, etp1d, etp1e, etp1f, etp1g, etp1h", - "breakout_modes": "1x400G[200G],2x200G[100G,40G],4x100G" - }, - "Ethernet8": { - "index": "2,2,2,2,2,2,2,2", - "lanes": "8,9,10,11,12,13,14,15", - "alias_at_lanes": "etp2a, etp2b, etp2c, etp2d, etp2e, etp2f, etp2g, etp2h", - "breakout_modes": "1x400G[200G],2x200G[100G,40G],4x100G" - }, - "Ethernet16": { - "index": "3,3,3,3,3,3,3,3", - "lanes": "16,17,18,19,20,21,22,23", - "alias_at_lanes": "etp3a, etp3b, etp3c, etp3d, etp3e, etp3f, etp3g, etp3h", - "breakout_modes": "1x400G[200G],2x200G[100G,40G],4x100G" - }, - "Ethernet24": { - "index": "4,4,4,4,4,4,4,4", - "lanes": "24,25,26,27,28,29,30,31", - "alias_at_lanes": "etp4a, etp4b, etp4c, etp4d, etp4e, etp4f, etp4g, etp4h", - "breakout_modes": "1x400G[200G],2x200G[100G,40G],4x100G" - }, - "Ethernet32": { - "index": "5,5,5,5,5,5,5,5", - "lanes": "32,33,34,35,36,37,38,39", - "alias_at_lanes": "etp5a, etp5b, etp5c, etp5d, etp5e, etp5f, etp5g, etp5h", - "breakout_modes": "1x400G[200G],2x200G[100G,40G],4x100G" - }, - "Ethernet40": { - "index": "6,6,6,6,6,6,6,6", - "lanes": "40,41,42,43,44,45,46,47", - "alias_at_lanes": "etp6a, etp6b, etp6c, etp6d, etp6e, etp6f, etp6g, etp6h", - "breakout_modes": "1x400G[200G],2x200G[100G,40G],4x100G" - }, - "Ethernet48": { - "index": "7,7,7,7,7,7,7,7", - "lanes": "48,49,50,51,52,53,54,55", - "alias_at_lanes": "etp7a, etp7b, etp7c, etp7d, etp7e, etp7f, etp7g, etp7h", - "breakout_modes": "1x400G[200G],2x200G[100G,40G],4x100G" - }, - "Ethernet56": { - "index": "8,8,8,8,8,8,8,8", - "lanes": "56,57,58,59,60,61,62,63", - "alias_at_lanes": "etp8a, etp8b, etp8c, etp8d, etp8e, etp8f, etp8g, etp8h", - "breakout_modes": "1x400G[200G],2x200G[100G,40G],4x100G" - }, - "Ethernet64": { - "index": "9,9,9,9,9,9,9,9", - "lanes": "64,65,66,67,68,69,70,71", - "alias_at_lanes": "etp9a, etp9b, etp9c, etp9d, etp9e, etp9f, etp9g, etp9h", - "breakout_modes": "1x400G[200G],2x200G[100G,40G],4x100G" - }, - "Ethernet72": { - "index": "10,10,10,10,10,10,10,10", - "lanes": "72,73,74,75,76,77,78,79", - "alias_at_lanes": "etp10a, etp10b, etp10c, etp10d, etp10e, etp10f, etp10g, etp10h", - "breakout_modes": "1x400G[200G],2x200G[100G,40G],4x100G" - }, - "Ethernet80": { - "index": "11,11,11,11,11,11,11,11", - "lanes": "80,81,82,83,84,85,86,87", - "alias_at_lanes": "etp11a, etp11b, etp11c, etp11d, etp11e, etp11f, etp11g, etp11h", - "breakout_modes": "1x400G[200G],2x200G[100G,40G],4x100G" - }, - "Ethernet88": { - "index": "12,12,12,12,12,12,12,12", - "lanes": "88,89,90,91,92,93,94,95", - "alias_at_lanes": "etp12a, etp12b, etp12c, etp12d, etp12e, etp12f, etp12g, etp12h", - "breakout_modes": "1x400G[200G],2x200G[100G,40G],4x100G" - }, - "Ethernet96": { - "index": "13,13,13,13,13,13,13,13", - "lanes": "96,97,98,99,100,101,102,103", - "alias_at_lanes": "etp13a, etp13b, etp13c, etp13d, etp13e, etp13f, etp13g, etp13h", - "breakout_modes": "1x400G[200G],2x200G[100G,40G],4x100G" - }, - "Ethernet104": { - "index": "14,14,14,14,14,14,14,14", - "lanes": "104,105,106,107,108,109,110,111", - "alias_at_lanes": "etp14a, etp14b, etp14c, etp14d, etp14e, etp14f, etp14g, etp14h", - "breakout_modes": "1x400G[200G],2x200G[100G,40G],4x100G" - }, - "Ethernet112": { - "index": "15,15,15,15,15,15,15,15", - "lanes": "112,113,114,115,116,117,118,119", - "alias_at_lanes": "etp15a, etp15b, etp15c, etp15d, etp15e, etp15f, etp15g, etp15h", - "breakout_modes": "1x400G[200G],2x200G[100G,40G],4x100G" - }, - "Ethernet120": { - "index": "16,16,16,16,16,16,16,16", - "lanes": "120,121,122,123,124,125,126,127", - "alias_at_lanes": "etp16a, etp16b, etp16c, etp16d, etp16e, etp16f, etp16g, etp16h", - "breakout_modes": "1x400G[200G],2x200G[100G,40G],4x100G" - }, - "Ethernet128": { - "index": "17,17,17,17,17,17,17,17", - "lanes": "128,129,130,131,132,133,134,135", - "alias_at_lanes": "etp17a, etp17b, etp17c, etp17d, etp17e, etp17f, etp17g, etp17h", - "breakout_modes": "1x400G[200G],2x200G[100G,40G],4x100G" - }, - "Ethernet136": { - "index": "18,18,18,18,18,18,18,18", - "lanes": "136,137,138,139,140,141,142,143", - "alias_at_lanes": "etp18a, etp18b, etp18c, etp18d, etp18e, etp18f, etp18g, etp18h", - "breakout_modes": "1x400G[200G],2x200G[100G,40G],4x100G" - }, - "Ethernet144": { - "index": "19,19,19,19,19,19,19,19", - "lanes": "144,145,146,147,148,149,150,151", - "alias_at_lanes": "etp19a, etp19b, etp19c, etp19d, etp19e, etp19f, etp19g, etp19h", - "breakout_modes": "1x400G[200G],2x200G[100G,40G],4x100G" - }, - "Ethernet152": { - "index": "20,20,20,20,20,20,20,20", - "lanes": "152,153,154,155,156,157,158,159", - "alias_at_lanes": "etp20a, etp20b, etp20c, etp20d, etp20e, etp20f, etp20g, etp20h", - "breakout_modes": "1x400G[200G],2x200G[100G,40G],4x100G" - }, - "Ethernet160": { - "index": "21,21,21,21,21,21,21,21", - "lanes": "160,161,162,163,164,165,166,167", - "alias_at_lanes": "etp21a, etp21b, etp21c, etp21d, etp21e, etp21f, etp21g, etp21h", - "breakout_modes": "1x400G[200G],2x200G[100G,40G],4x100G" - }, - "Ethernet168": { - "index": "22,22,22,22,22,22,22,22", - "lanes": "168,169,170,171,172,173,174,175", - "alias_at_lanes": "etp22a, etp22b, etp22c, etp22d, etp22e, etp22f, etp22g, etp22h", - "breakout_modes": "1x400G[200G],2x200G[100G,40G],4x100G" - }, - "Ethernet176": { - "index": "23,23,23,23,23,23,23,23", - "lanes": "176,177,178,179,180,181,182,183", - "alias_at_lanes": "etp23a, etp23b, etp23c, etp23d, etp23e, etp23f, etp23g, etp23h", - "breakout_modes": "1x400G[200G],2x200G[100G,40G],4x100G" - }, - "Ethernet184": { - "index": "24,24,24,24,24,24,24,24", - "lanes": "184,185,186,187,188,189,190,191", - "alias_at_lanes": "etp24a, etp24b, etp24c, etp24d, etp24e, etp24f, etp24g, etp24h", - "breakout_modes": "1x400G[200G],2x200G[100G,40G],4x100G" - }, - "Ethernet192": { - "index": "25,25,25,25,25,25,25,25", - "lanes": "192,193,194,195,196,197,198,199", - "alias_at_lanes": "etp25a, etp25b, etp25c, etp25d, etp25e, etp25f, etp25g, etp25h", - "breakout_modes": "1x400G[200G],2x200G[100G,40G],4x100G" - }, - "Ethernet200": { - "index": "26,26,26,26,26,26,26,26", - "lanes": "200,201,202,203,204,205,206,207", - "alias_at_lanes": "etp26a, etp26b, etp26c, etp26d, etp26e, etp26f, etp26g, etp26h", - "breakout_modes": "1x400G[200G],2x200G[100G,40G],4x100G" - }, - "Ethernet208": { - "index": "27,27,27,27,27,27,27,27", - "lanes": "208,209,210,211,212,213,214,215", - "alias_at_lanes": "etp27a, etp27b, etp27c, etp27d, etp27e, etp27f, etp27g, etp27h", - "breakout_modes": "1x400G[200G],2x200G[100G,40G],4x100G" - }, - "Ethernet216": { - "index": "28,28,28,28,28,28,28,28", - "lanes": "216,217,218,219,220,221,222,223", - "alias_at_lanes": "etp28a, etp28b, etp28c, etp28d, etp28e, etp28f, etp28g, etp28h", - "breakout_modes": "1x400G[200G],2x200G[100G,40G],4x100G" - }, - "Ethernet224": { - "index": "29,29,29,29,29,29,29,29", - "lanes": "224,225,226,227,228,229,230,231", - "alias_at_lanes": "etp29a, etp29b, etp29c, etp29d, etp29e, etp29f, etp29g, etp29h", - "breakout_modes": "1x400G[200G],2x200G[100G,40G],4x100G" - }, - "Ethernet232": { - "index": "30,30,30,30,30,30,30,30", - "lanes": "232,233,234,235,236,237,238,239", - "alias_at_lanes": "etp30a, etp30b, etp30c, etp30d, etp30e, etp30f, etp30g, etp30h", - "breakout_modes": "1x400G[200G],2x200G[100G,40G],4x100G" - }, - "Ethernet240": { - "index": "31,31,31,31,31,31,31,31", - "lanes": "240,241,242,243,244,245,246,247", - "alias_at_lanes": "etp31a, etp31b, etp31c, etp31d, etp31e, etp31f, etp31g, etp31h", - "breakout_modes": "1x400G[200G],2x200G[100G,40G],4x100G" - }, - "Ethernet248": { - "index": "32,32,32,32,32,32,32,32", - "lanes": "248,249,250,251,252,253,254,255", - "alias_at_lanes": "etp32a, etp32b, etp32c, etp32d, etp32e, etp32f, etp32g, etp32h", - "breakout_modes": "1x400G[200G],2x200G[100G,40G],4x100G" - } - } -} \ No newline at end of file + "chassis": { + "name": "MSN4700", + "components": [ + { + "name": "ONIE" + }, + { + "name": "SSD" + }, + { + "name": "BIOS" + }, + { + "name": "CPLD1" + }, + { + "name": "CPLD2" + }, + { + "name": "CPLD3" + } + ], + "fans": [], + "fan_drawers": [ + { + "name": "drawer1", + "fans": [ + { + "name": "fan1" + }, + { + "name": "fan2" + } + ] + }, + { + "name": "drawer2", + "fans": [ + { + "name": "fan3" + }, + { + "name": "fan4" + } + ] + }, + { + "name": "drawer3", + "fans": [ + { + "name": "fan5" + }, + { + "name": "fan6" + } + ] + }, + { + "name": "drawer4", + "fans": [ + { + "name": "fan7" + }, + { + "name": "fan8" + } + ] + }, + { + "name": "drawer5", + "fans": [ + { + "name": "fan9" + }, + { + "name": "fan10" + } + ] + }, + { + "name": "drawer6", + "fans": [ + { + "name": "fan11" + }, + { + "name": "fan12" + } + ] + } + ], + "psus": [ + { + "name": "PSU 1", + "fans": [ + { + "name": "psu1_fan1" + } + ], + "thermals": [ + { + "name": "PSU-1 Temp" + } + ] + }, + { + "name": "PSU 2", + "fans": [ + { + "name": "psu2_fan1" + } + ], + "thermals": [ + { + "name": "PSU-2 Temp" + } + ] + } + ], + "thermals": [ + { + "name": "ASIC" + }, + { + "name": "Ambient COMEX Temp" + }, + { + "name": "Ambient Fan Side Temp" + }, + { + "name": "Ambient Port Side Temp" + }, + { + "name": "CPU Core 0 Temp" + }, + { + "name": "CPU Core 1 Temp" + }, + { + "name": "CPU Core 2 Temp" + }, + { + "name": "CPU Core 3 Temp" + }, + { + "name": "CPU Pack Temp" + } + ], + "sfps": [ + { + "name": "sfp1", + "thermals": [ + { + "name": "xSFP module 1 Temp" + } + ] + }, + { + "name": "sfp2", + "thermals": [ + { + "name": "xSFP module 2 Temp" + } + ] + }, + { + "name": "sfp3", + "thermals": [ + { + "name": "xSFP module 3 Temp" + } + ] + }, + { + "name": "sfp4", + "thermals": [ + { + "name": "xSFP module 4 Temp" + } + ] + }, + { + "name": "sfp5", + "thermals": [ + { + "name": "xSFP module 5 Temp" + } + ] + }, + { + "name": "sfp6", + "thermals": [ + { + "name": "xSFP module 6 Temp" + } + ] + }, + { + "name": "sfp7", + "thermals": [ + { + "name": "xSFP module 7 Temp" + } + ] + }, + { + "name": "sfp8", + "thermals": [ + { + "name": "xSFP module 8 Temp" + } + ] + }, + { + "name": "sfp9", + "thermals": [ + { + "name": "xSFP module 9 Temp" + } + ] + }, + { + "name": "sfp10", + "thermals": [ + { + "name": "xSFP module 10 Temp" + } + ] + }, + { + "name": "sfp11", + "thermals": [ + { + "name": "xSFP module 11 Temp" + } + ] + }, + { + "name": "sfp12", + "thermals": [ + { + "name": "xSFP module 12 Temp" + } + ] + }, + { + "name": "sfp13", + "thermals": [ + { + "name": "xSFP module 13 Temp" + } + ] + }, + { + "name": "sfp14", + "thermals": [ + { + "name": "xSFP module 14 Temp" + } + ] + }, + { + "name": "sfp15", + "thermals": [ + { + "name": "xSFP module 15 Temp" + } + ] + }, + { + "name": "sfp16", + "thermals": [ + { + "name": "xSFP module 16 Temp" + } + ] + }, + { + "name": "sfp17", + "thermals": [ + { + "name": "xSFP module 17 Temp" + } + ] + }, + { + "name": "sfp18", + "thermals": [ + { + "name": "xSFP module 18 Temp" + } + ] + }, + { + "name": "sfp19", + "thermals": [ + { + "name": "xSFP module 19 Temp" + } + ] + }, + { + "name": "sfp20", + "thermals": [ + { + "name": "xSFP module 20 Temp" + } + ] + }, + { + "name": "sfp21", + "thermals": [ + { + "name": "xSFP module 21 Temp" + } + ] + }, + { + "name": "sfp22", + "thermals": [ + { + "name": "xSFP module 22 Temp" + } + ] + }, + { + "name": "sfp23", + "thermals": [ + { + "name": "xSFP module 23 Temp" + } + ] + }, + { + "name": "sfp24", + "thermals": [ + { + "name": "xSFP module 24 Temp" + } + ] + }, + { + "name": "sfp25", + "thermals": [ + { + "name": "xSFP module 25 Temp" + } + ] + }, + { + "name": "sfp26", + "thermals": [ + { + "name": "xSFP module 26 Temp" + } + ] + }, + { + "name": "sfp27", + "thermals": [ + { + "name": "xSFP module 27 Temp" + } + ] + }, + { + "name": "sfp28", + "thermals": [ + { + "name": "xSFP module 28 Temp" + } + ] + }, + { + "name": "sfp29", + "thermals": [ + { + "name": "xSFP module 29 Temp" + } + ] + }, + { + "name": "sfp30", + "thermals": [ + { + "name": "xSFP module 30 Temp" + } + ] + }, + { + "name": "sfp31", + "thermals": [ + { + "name": "xSFP module 31 Temp" + } + ] + }, + { + "name": "sfp32", + "thermals": [ + { + "name": "xSFP module 32 Temp" + } + ] + } + ] + }, + "interfaces": {} +} diff --git a/device/mellanox/x86_64-mlnx_msn4700-r0/sensors.conf.a1 b/device/mellanox/x86_64-mlnx_msn4700-r0/sensors.conf.a1 new file mode 100644 index 000000000000..9511fac1278e --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4700-r0/sensors.conf.a1 @@ -0,0 +1,142 @@ +################################################################################ +# Copyright (C) 20xx-2021 Mellanox Technologies, Ltd. ALL RIGHTS RESERVED. +# +# Platform specific sensors config for SN4700 A0/A1 +################################################################################ + +# Temperature sensors +bus "i2c-2" "i2c-1-mux (chan_id 1)" + chip "mlxsw-i2c-*-48" + label temp1 "Ambient ASIC Temp" + +bus "i2c-7" "i2c-1-mux (chan_id 6)" + chip "tmp102-i2c-*-49" + label temp1 "Ambient Fan Side Temp (air intake)" + chip "tmp102-i2c-*-4a" + label temp1 "Ambient Port Side Temp (air exhaust)" + +bus "i2c-15" "i2c-1-mux (chan_id 6)" + chip "tmp102-i2c-15-49" + label temp1 "Ambient COMEX Temp" + +# Power controllers +bus "i2c-5" "i2c-1-mux (chan_id 4)" + chip "mp2975-i2c-*-62" + label in1 "PMIC-1 PSU 12V Rail (in1)" + label in2 "PMIC-1 ASIC 0.8V VCORE MAIN Rail (out)" + label temp1 "PMIC-1 Temp 1" + label power1 "PMIC-1 PSU 12V Rail Pwr (in1)" + label power2 "PMIC-1 ASIC 0.8V VCORE MAIN Rail Pwr (out)" + label curr1 "PMIC-1 PSU 12V Rail Curr (in1)" + label curr2 "PMIC-1 ASIC 0.8V VCORE MAIN Rail Curr (out)" + chip "mp2975-i2c-*-64" + label in1 "PMIC-2 PSU 12V Rail (in1)" + label in2 "PMIC-2 ASIC 1.8V VCORE MAIN Rail (out)" + label in3 "PMIC-2 ASIC 1.2V VCORE MAIN Rail (out)" + label temp1 "PMIC-2 Temp 1" + label power1 "PMIC-2 PSU 12V Rail Pwr (in1)" + label power2 "PMIC-2 ASIC 1.8V VCORE MAIN Rail Pwr (out)" + label curr1 "PMIC-2 PSU 12V Rail Curr (in1)" + label curr2 "PMIC-2 ASIC 1.8V VCORE MAIN Rail Curr (out)" + label curr3 "PMIC-2 ASIC 1.2V VCORE MAIN Rail Curr (out)" + chip "mp2975-i2c-*-66" + label in1 "PMIC-3 PSU 12V Rail (in1)" + label in2 "PMIC-3 ASIC 0.85V T0_1 Rail (out)" + label in3 "PMIC-3 ASIC 1.8V T0_1 Rail (out)" + label temp1 "PMIC-3 Temp 1" + label power1 "PMIC-3 PSU 12V Rail Pwr (in1)" + label power2 "PMIC-3 ASIC 0.85V T0_1 Rail Pwr (out)" + label curr1 "PMIC-3 PSU 12V Rail Curr (in1)" + label curr2 "PMIC-3 ASIC 0.85V T0_1 Rail Curr (out)" + label curr3 "PMIC-3 ASIC 1.8V T0_1 Rail Curr (out)" + chip "mp2975-i2c-*-6a" + label in1 "PMIC-4 PSU 12V Rail (in1)" + label in2 "PMIC-4 ASIC 0.85V T2_3 Rail (out)" + label in3 "PMIC-4 ASIC 1.8V T2_3 Rail (out)" + label temp1 "PMIC-4 Temp 1" + label power1 "PMIC-4 PSU 12V Rail Pwr (in1)" + label power2 "PMIC-4 ASIC 0.85V T2_3 Rail Pwr (out)" + label curr1 "PMIC-4 PSU 12V Rail Curr (in1)" + label curr2 "PMIC-4 ASIC 0.85V T2_3 Rail Curr (out)" + label curr3 "PMIC-4 ASIC 1.8V T2_3 Rail Curr (out)" + chip "mp2975-i2c-*-6e" + label in1 "PMIC-5 PSU 12V Rail (in1)" + label in2 "PMIC-5 ASIC 1.2V T0_3 Rail_1 (out)" + label in3 "PMIC-5 ASIC 1.2V T4_7 Rail_2 (out)" + label temp1 "PMIC-5 Temp 1" + label power1 "PMIC-5 PSU 12V Rail Pwr (in1)" + label power2 "PMIC-5 ASIC 1.2V T0_3 Rail_1 Pwr (out)" + label power3 "PMIC-5 ASIC 1.2V T4_7 Rail_2 Pwr (out)" + label curr1 "PMIC-5 PSU 12V Rail Curr (in1)" + label curr2 "PMIC-5 ASIC 1.2V T0_3 Rail_1 Curr (out)" + label curr3 "PMIC-5 ASIC 1.2V T4_7 Rail_2 Curr (out)" + +bus "i2c-15" "i2c-1-mux (chan_id 6)" + chip "tps53679-i2c-*-58" + label in1 "PMIC-8 PSU 12V Rail (in1)" + label in2 "PMIC-8 PSU 12V Rail (in2)" + label in3 "PMIC-8 COMEX 1.8V Rail (out)" + label in4 "PMIC-8 COMEX 1.05V Rail (out)" + label temp1 "PMIC-8 Temp 1" + label temp2 "PMIC-8 Temp 2" + label power1 "PMIC-8 COMEX 1.8V Rail Pwr (out)" + label power2 "PMIC-8 COMEX 1.05V Rail Pwr (out)" + label curr1 "PMIC-8 COMEX 1.8V Rail Curr (out)" + label curr2 "PMIC-8 COMEX 1.05V Rail Curr (out)" + chip "tps53679-i2c-*-61" + label in1 "PMIC-9 PSU 12V Rail (in1)" + label in2 "PMIC-9 PSU 12V Rail (in2)" + label in3 "PMIC-9 COMEX 1.2V Rail (out)" + ignore in4 + label temp1 "PMIC-9 Temp 1" + label temp2 "PMIC-9 Temp 2" + label power1 "PMIC-9 COMEX 1.2V Rail Pwr (out)" + ignore power2 + label curr1 "PMIC-9 COMEX 1.2V Rail Curr (out)" + ignore curr2 + +# Power supplies +bus "i2c-4" "i2c-1-mux (chan_id 3)" + chip "dps460-i2c-*-58" + label in1 "PSU-1(L) 220V Rail (in)" + ignore in2 + label in3 "PSU-1(L) 12V Rail (out)" + label fan1 "PSU-1(L) Fan 1" + label temp1 "PSU-1(L) Temp 1" + label temp2 "PSU-1(L) Temp 2" + label temp3 "PSU-1(L) Temp 3" + label power1 "PSU-1(L) 220V Rail Pwr (in)" + label power2 "PSU-1(L) 12V Rail Pwr (out)" + label curr1 "PSU-1(L) 220V Rail Curr (in)" + label curr2 "PSU-1(L) 12V Rail Curr (out)" + chip "dps460-i2c-*-59" + label in1 "PSU-2(R) 220V Rail (in)" + ignore in2 + label in3 "PSU-2(R) 12V Rail (out)" + label fan1 "PSU-2(R) Fan 1" + label temp1 "PSU-2(R) Temp 1" + label temp2 "PSU-2(R) Temp 2" + label temp3 "PSU-2(R) Temp 3" + label power1 "PSU-2(R) 220V Rail Pwr (in)" + label power2 "PSU-2(R) 12V Rail Pwr (out)" + label curr1 "PSU-2(R) 220V Rail Curr (in)" + label curr2 "PSU-2(R) 12V Rail Curr (out)" + +# Chassis fans +chip "mlxreg_fan-isa-*" + label fan1 "Chassis Fan Drawer-1 Tach 1" + label fan2 "Chassis Fan Drawer-1 Tach 2" + label fan3 "Chassis Fan Drawer-2 Tach 1" + label fan4 "Chassis Fan Drawer-2 Tach 2" + label fan5 "Chassis Fan Drawer-3 Tach 1" + label fan6 "Chassis Fan Drawer-3 Tach 2" + label fan7 "Chassis Fan Drawer-4 Tach 1" + label fan8 "Chassis Fan Drawer-4 Tach 2" + label fan9 "Chassis Fan Drawer-5 Tach 1" + label fan10 "Chassis Fan Drawer-5 Tach 2" + label fan11 "Chassis Fan Drawer-6 Tach 1" + label fan12 "Chassis Fan Drawer-6 Tach 2" + +# Miscellaneous +chip "*-virtual-*" + ignore temp1 diff --git a/device/mellanox/x86_64-mlnx_msn4700_simx-r0/platform_reboot b/device/mellanox/x86_64-mlnx_msn4700_simx-r0/platform_reboot deleted file mode 120000 index dfaf53417665..000000000000 --- a/device/mellanox/x86_64-mlnx_msn4700_simx-r0/platform_reboot +++ /dev/null @@ -1 +0,0 @@ -../x86_64-mlnx_msn2700_simx-r0/platform_reboot \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4800-r0/ACS-MSN4800/buffers_defaults_objects.j2 b/device/mellanox/x86_64-mlnx_msn4800-r0/ACS-MSN4800/buffers_defaults_objects.j2 new file mode 120000 index 000000000000..33b6704f9902 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4800-r0/ACS-MSN4800/buffers_defaults_objects.j2 @@ -0,0 +1 @@ +../../x86_64-mlnx_msn2700-r0/ACS-MSN2700/buffers_defaults_objects.j2 \ No newline at end of file diff --git a/device/mellanox/x86_64-mlnx_msn4800-r0/ACS-MSN4800/sai.profile b/device/mellanox/x86_64-mlnx_msn4800-r0/ACS-MSN4800/sai.profile new file mode 100644 index 000000000000..c00fc21f89c5 --- /dev/null +++ b/device/mellanox/x86_64-mlnx_msn4800-r0/ACS-MSN4800/sai.profile @@ -0,0 +1,3 @@ +SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/sai_4800.xml +SAI_DUMP_STORE_PATH=/var/log/mellanox/sdk-dumps +SAI_DUMP_STORE_AMOUNT=10 diff --git a/device/nokia/armhf-nokia_ixs7215_52x-r0/Nokia-7215/buffers.json.j2 b/device/nokia/armhf-nokia_ixs7215_52x-r0/Nokia-7215/buffers.json.j2 new file mode 100644 index 000000000000..a38350a982bc --- /dev/null +++ b/device/nokia/armhf-nokia_ixs7215_52x-r0/Nokia-7215/buffers.json.j2 @@ -0,0 +1,10 @@ +{# Default values placeholder M0- Marvell SAI TBD buffers configuration #} + +{% set default_cable = '40m' %} +{% set default_ports_num = 54 -%} + +{# Port configuration to cable length look-up table #} +{# Each record describes mapping of DUT (DUT port) role and neighbor role to cable length #} +{# Roles described in the minigraph #} +{} + diff --git a/device/nokia/armhf-nokia_ixs7215_52x-r0/Nokia-7215/hwsku.json b/device/nokia/armhf-nokia_ixs7215_52x-r0/Nokia-7215/hwsku.json new file mode 100644 index 000000000000..4ae62e8d4b01 --- /dev/null +++ b/device/nokia/armhf-nokia_ixs7215_52x-r0/Nokia-7215/hwsku.json @@ -0,0 +1,212 @@ +{ + "interfaces": { + "Ethernet0": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet1": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet2": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet3": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet4": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet5": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet6": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet7": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet8": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet9": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet10": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet11": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet12": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet13": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet14": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet15": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet16": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet17": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet18": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet19": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet20": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet21": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet22": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet23": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet24": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet25": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet26": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet27": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet28": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet29": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet30": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet31": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet32": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet33": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet34": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet35": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet36": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet37": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet38": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet39": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet40": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet41": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet42": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet43": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet44": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet45": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet46": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet47": { + "default_brkout_mode": "1x1G", + "port_type": "RJ45" + }, + "Ethernet48": { + "default_brkout_mode": "1x10G", + "port_type": "SFP+" + }, + "Ethernet49": { + "default_brkout_mode": "1x10G", + "port_type": "SFP+" + }, + "Ethernet50": { + "default_brkout_mode": "1x10G", + "port_type": "SFP+" + }, + "Ethernet51": { + "default_brkout_mode": "1x10G", + "port_type": "SFP+" + } + } +} diff --git a/device/nokia/armhf-nokia_ixs7215_52x-r0/Nokia-7215/port_config.ini b/device/nokia/armhf-nokia_ixs7215_52x-r0/Nokia-7215/port_config.ini index 062c252ce195..ce285a14df7e 100644 --- a/device/nokia/armhf-nokia_ixs7215_52x-r0/Nokia-7215/port_config.ini +++ b/device/nokia/armhf-nokia_ixs7215_52x-r0/Nokia-7215/port_config.ini @@ -1,53 +1,53 @@ -# name lanes alias index speed -Ethernet0 1 Ethernet0 1 1000 -Ethernet1 2 Ethernet1 2 1000 -Ethernet2 3 Ethernet2 3 1000 -Ethernet3 4 Ethernet3 4 1000 -Ethernet4 5 Ethernet4 5 1000 -Ethernet5 6 Ethernet5 6 1000 -Ethernet6 7 Ethernet6 7 1000 -Ethernet7 8 Ethernet7 8 1000 -Ethernet8 9 Ethernet8 9 1000 -Ethernet9 10 Ethernet9 10 1000 -Ethernet10 11 Ethernet10 11 1000 -Ethernet11 12 Ethernet11 12 1000 -Ethernet12 13 Ethernet12 13 1000 -Ethernet13 14 Ethernet13 14 1000 -Ethernet14 15 Ethernet14 15 1000 -Ethernet15 16 Ethernet15 16 1000 -Ethernet16 17 Ethernet16 17 1000 -Ethernet17 18 Ethernet17 18 1000 -Ethernet18 19 Ethernet18 19 1000 -Ethernet19 20 Ethernet19 20 1000 -Ethernet20 21 Ethernet20 21 1000 -Ethernet21 22 Ethernet21 22 1000 -Ethernet22 23 Ethernet22 23 1000 -Ethernet23 24 Ethernet23 24 1000 -Ethernet24 25 Ethernet24 25 1000 -Ethernet25 26 Ethernet25 26 1000 -Ethernet26 27 Ethernet26 27 1000 -Ethernet27 28 Ethernet27 28 1000 -Ethernet28 29 Ethernet28 29 1000 -Ethernet29 30 Ethernet29 30 1000 -Ethernet30 31 Ethernet30 31 1000 -Ethernet31 32 Ethernet31 32 1000 -Ethernet32 33 Ethernet32 33 1000 -Ethernet33 34 Ethernet33 34 1000 -Ethernet34 35 Ethernet34 35 1000 -Ethernet35 36 Ethernet35 36 1000 -Ethernet36 37 Ethernet36 37 1000 -Ethernet37 38 Ethernet37 38 1000 -Ethernet38 39 Ethernet38 39 1000 -Ethernet39 40 Ethernet39 40 1000 -Ethernet40 41 Ethernet40 41 1000 -Ethernet41 42 Ethernet41 42 1000 -Ethernet42 43 Ethernet42 43 1000 -Ethernet43 44 Ethernet43 44 1000 -Ethernet44 45 Ethernet44 45 1000 -Ethernet45 46 Ethernet45 46 1000 -Ethernet46 47 Ethernet46 47 1000 -Ethernet47 48 Ethernet47 48 1000 -Ethernet48 49 Ethernet48 49 10000 -Ethernet49 50 Ethernet49 50 10000 -Ethernet50 51 Ethernet50 51 10000 -Ethernet51 52 Ethernet51 52 10000 +# name lanes alias index speed +Ethernet0 1 etp1 1 1000 +Ethernet1 2 etp2 2 1000 +Ethernet2 3 etp3 3 1000 +Ethernet3 4 etp4 4 1000 +Ethernet4 5 etp5 5 1000 +Ethernet5 6 etp6 6 1000 +Ethernet6 7 etp7 7 1000 +Ethernet7 8 etp8 8 1000 +Ethernet8 9 etp9 9 1000 +Ethernet9 10 etp10 10 1000 +Ethernet10 11 etp11 11 1000 +Ethernet11 12 etp12 12 1000 +Ethernet12 13 etp13 13 1000 +Ethernet13 14 etp14 14 1000 +Ethernet14 15 etp15 15 1000 +Ethernet15 16 etp16 16 1000 +Ethernet16 17 etp17 17 1000 +Ethernet17 18 etp18 18 1000 +Ethernet18 19 etp19 19 1000 +Ethernet19 20 etp20 20 1000 +Ethernet20 21 etp21 21 1000 +Ethernet21 22 etp22 22 1000 +Ethernet22 23 etp23 23 1000 +Ethernet23 24 etp24 24 1000 +Ethernet24 25 etp25 25 1000 +Ethernet25 26 etp26 26 1000 +Ethernet26 27 etp27 27 1000 +Ethernet27 28 etp28 28 1000 +Ethernet28 29 etp29 29 1000 +Ethernet29 30 etp30 30 1000 +Ethernet30 31 etp31 31 1000 +Ethernet31 32 etp32 32 1000 +Ethernet32 33 etp33 33 1000 +Ethernet33 34 etp34 34 1000 +Ethernet34 35 etp35 35 1000 +Ethernet35 36 etp36 36 1000 +Ethernet36 37 etp37 37 1000 +Ethernet37 38 etp38 38 1000 +Ethernet38 39 etp39 39 1000 +Ethernet39 40 etp40 40 1000 +Ethernet40 41 etp41 41 1000 +Ethernet41 42 etp42 42 1000 +Ethernet42 43 etp43 43 1000 +Ethernet43 44 etp44 44 1000 +Ethernet44 45 etp45 45 1000 +Ethernet45 46 etp46 46 1000 +Ethernet46 47 etp47 47 1000 +Ethernet47 48 etp48 48 1000 +Ethernet48 49 etp49 49 10000 +Ethernet49 50 etp50 50 10000 +Ethernet50 51 etp51 51 10000 +Ethernet51 52 etp52 52 10000 diff --git a/device/nokia/armhf-nokia_ixs7215_52x-r0/Nokia-7215/qos.json.j2 b/device/nokia/armhf-nokia_ixs7215_52x-r0/Nokia-7215/qos.json.j2 new file mode 100644 index 000000000000..c28e2e13e974 --- /dev/null +++ b/device/nokia/armhf-nokia_ixs7215_52x-r0/Nokia-7215/qos.json.j2 @@ -0,0 +1,2 @@ +{# this file empty temporarily until qos supported SAI Marvell #} +{} diff --git a/device/nokia/armhf-nokia_ixs7215_52x-r0/Nokia-M0-7215 b/device/nokia/armhf-nokia_ixs7215_52x-r0/Nokia-M0-7215 new file mode 120000 index 000000000000..886130efb87c --- /dev/null +++ b/device/nokia/armhf-nokia_ixs7215_52x-r0/Nokia-M0-7215 @@ -0,0 +1 @@ +Nokia-7215 \ No newline at end of file diff --git a/device/nokia/armhf-nokia_ixs7215_52x-r0/installer.conf b/device/nokia/armhf-nokia_ixs7215_52x-r0/installer.conf new file mode 100644 index 000000000000..b138f294e1ea --- /dev/null +++ b/device/nokia/armhf-nokia_ixs7215_52x-r0/installer.conf @@ -0,0 +1 @@ +VAR_LOG_SIZE=4096 diff --git a/device/nokia/armhf-nokia_ixs7215_52x-r0/pcie.yaml b/device/nokia/armhf-nokia_ixs7215_52x-r0/pcie.yaml new file mode 100644 index 000000000000..f24086a2228b --- /dev/null +++ b/device/nokia/armhf-nokia_ixs7215_52x-r0/pcie.yaml @@ -0,0 +1,20 @@ +- bus: '00' + dev: '01' + fn: '0' + id: '6820' + name: 'PCI bridge: Marvell Technology Group Ltd. Device 6820 (rev 0a)' +- bus: '00' + dev: '02' + fn: '0' + id: '6820' + name: 'PCI bridge: Marvell Technology Group Ltd. Device 6820 (rev 0a)' +- bus: '01' + dev: '00' + fn: '0' + id: c804 + name: 'Ethernet controller: Marvell Technology Group Ltd. Device c804' +- bus: '02' + dev: '00' + fn: '0' + id: c804 + name: 'Ethernet controller: Marvell Technology Group Ltd. Device c804' diff --git a/device/nokia/armhf-nokia_ixs7215_52x-r0/platform.json b/device/nokia/armhf-nokia_ixs7215_52x-r0/platform.json new file mode 100644 index 000000000000..4f4585b1e4de --- /dev/null +++ b/device/nokia/armhf-nokia_ixs7215_52x-r0/platform.json @@ -0,0 +1,284 @@ +{ + "chassis": { + "name": "7215 IXS-T1", + "components": [ + { + "name": "System-CPLD" + }, + { + "name": "U-Boot" + } + ], + "fans": [ + { + "name": "Fan1", + "status_led": { + "controllable": true, + "colors": ["red", "green"] + } + }, + { + "name": "Fan2", + "status_led": { + "controllable": true, + "colors": ["red", "green"] + } + } + ], + "fan_drawers": [ + { + "name": "drawer1", + "status_led": { + "controllable": true, + "colors": ["red", "green"] + }, + "max_consumed_power": false, + "fans": [ + { + "name": "Fan1" + } + ] + }, + { + "name": "drawer2", + "status_led": { + "controllable": true, + "colors": ["red", "green"] + }, + "max_consumed_power": false, + "fans": [ + { + "name": "Fan2" + } + ] + } + ], + "psus": [ + { + "name": "PSU1", + "status_led": { + "controllable": false + }, + "current": false, + "power": false, + "max_power": false, + "voltage_high_threshold": false, + "voltage_low_threshold": false, + "temperature": false + }, + { + "name": "PSU2", + "status_led": { + "controllable": false + }, + "current": false, + "power": false, + "max_power": false, + "voltage_high_threshold": false, + "voltage_low_threshold": false, + "temperature": false + } + ], + "thermals": [ + { + "name": "PCB PHY", + "controllable": false, + "low-threshold": false, + "low-crit-threshold": false, + "high-crit-threshold": false + }, + { + "name": "PCB MAC", + "controllable": false, + "low-threshold": false, + "low-crit-threshold": false, + "high-crit-threshold": false + }, + { + "name": "ADT7473-CPU", + "controllable": false, + "low-threshold": false, + "low-crit-threshold": false + }, + { + "name": "ADT7473-LOC", + "controllable": false, + "low-threshold": false, + "low-crit-threshold": false + }, + { + "name": "ADT7473-MAC", + "controllable": false, + "low-threshold": false, + "low-crit-threshold": false + }, + { + "name": "CPU Core", + "controllable": false, + "low-threshold": false, + "high-threshold": false, + "low-crit-threshold": false, + "high-crit-threshold": false + } + ], + "sfps": [ + { + "name": "Ethernet0" + }, + { + "name": "Ethernet1" + }, + { + "name": "Ethernet2" + }, + { + "name": "Ethernet3" + }, + { + "name": "Ethernet4" + }, + { + "name": "Ethernet5" + }, + { + "name": "Ethernet6" + }, + { + "name": "Ethernet7" + }, + { + "name": "Ethernet8" + }, + { + "name": "Ethernet9" + }, + { + "name": "Ethernet10" + }, + { + "name": "Ethernet11" + }, + { + "name": "Ethernet12" + }, + { + "name": "Ethernet13" + }, + { + "name": "Ethernet14" + }, + { + "name": "Ethernet15" + }, + { + "name": "Ethernet16" + }, + { + "name": "Ethernet17" + }, + { + "name": "Ethernet18" + }, + { + "name": "Ethernet19" + }, + { + "name": "Ethernet20" + }, + { + "name": "Ethernet21" + }, + { + "name": "Ethernet22" + }, + { + "name": "Ethernet23" + }, + { + "name": "Ethernet24" + }, + { + "name": "Ethernet25" + }, + { + "name": "Ethernet26" + }, + { + "name": "Ethernet27" + }, + { + "name": "Ethernet28" + }, + { + "name": "Ethernet29" + }, + { + "name": "Ethernet30" + }, + { + "name": "Ethernet31" + }, + { + "name": "Ethernet32" + }, + { + "name": "Ethernet33" + }, + { + "name": "Ethernet34" + }, + { + "name": "Ethernet35" + }, + { + "name": "Ethernet36" + }, + { + "name": "Ethernet37" + }, + { + "name": "Ethernet38" + }, + { + "name": "Ethernet39" + }, + { + "name": "Ethernet40" + }, + { + "name": "Ethernet41" + }, + { + "name": "Ethernet42" + }, + { + "name": "Ethernet43" + }, + { + "name": "Ethernet44" + }, + { + "name": "Ethernet45" + }, + { + "name": "Ethernet46" + }, + { + "name": "Ethernet47" + }, + { + "name": "Ethernet48" + }, + { + "name": "Ethernet49" + }, + { + "name": "Ethernet50" + }, + { + "name": "Ethernet51" + } + ] + }, + "interfaces": {} +} diff --git a/device/nokia/armhf-nokia_ixs7215_52x-r0/platform_reboot b/device/nokia/armhf-nokia_ixs7215_52x-r0/platform_reboot new file mode 100644 index 000000000000..83fc5d8028f2 --- /dev/null +++ b/device/nokia/armhf-nokia_ixs7215_52x-r0/platform_reboot @@ -0,0 +1,11 @@ +#!/bin/bash + +function SafePwrCycle() { + sync ; sync + umount -fa > /dev/null 2&>1 + + # Write CPLD register to initiate cold reboot + sudo i2cset -f -y 0 0x41 0x10 0x00 +} + +SafePwrCycle diff --git a/device/nokia/armhf-nokia_ixs7215_52x-r0/plugins/sfputil.py b/device/nokia/armhf-nokia_ixs7215_52x-r0/plugins/sfputil.py index 1ca3b9ec6f2d..3280ffdc92b9 100755 --- a/device/nokia/armhf-nokia_ixs7215_52x-r0/plugins/sfputil.py +++ b/device/nokia/armhf-nokia_ixs7215_52x-r0/plugins/sfputil.py @@ -1,4 +1,5 @@ try: + import glob import sonic_platform.platform import sonic_platform.chassis from sonic_sfp.sfputilbase import SfpUtilBase @@ -14,6 +15,12 @@ class SfpUtil(SfpUtilBase): ports_in_block = 4 _port_to_eeprom_mapping = {} + port_to_i2c_mapping = { + 49: 2, + 50: 3, + 51: 4, + 52: 5 + } _changed_ports = [0, 0, 0, 0] @property @@ -33,10 +40,21 @@ def port_to_eeprom_mapping(self): return self._port_to_eeprom_mapping def __init__(self): - # print " SfpUtil(SfpUtilBase) re-directed to chassis PMON 2.0 " + # Mux Ordering + mux_dev = sorted(glob.glob("/sys/class/i2c-adapter/i2c-0/i2c-[0-9]")) + eeprom_path = "/sys/class/i2c-adapter/i2c-{0}/{0}-0050/eeprom" + y = 0 + for x in range(self.port_start, self.port_end + 1): + mux_dev_num = mux_dev[y] + self.port_to_i2c_mapping[x] = mux_dev_num[-1] + y = y + 1 + port_eeprom_path = eeprom_path.format(self.port_to_i2c_mapping[x]) + self.port_to_eeprom_mapping[x] = port_eeprom_path + self._port_to_eeprom_mapping[x] = port_eeprom_path SfpUtilBase.__init__(self) - self.chassis = sonic_platform.platform.Platform().get_chassis() + self.chassis = sonic_platform.platform.Platform().get_chassis() + def reset(self, port_num): # print " SfpUtil(SfpUtilBase) re-directed to chassis PMON 2.0 " if self.chassis is not None: diff --git a/device/nokia/armhf-nokia_ixs7215_52x-r0/system_health_monitoring_config.json b/device/nokia/armhf-nokia_ixs7215_52x-r0/system_health_monitoring_config.json new file mode 100644 index 000000000000..fb16658c840c --- /dev/null +++ b/device/nokia/armhf-nokia_ixs7215_52x-r0/system_health_monitoring_config.json @@ -0,0 +1,14 @@ +{ + "services_to_ignore": [], + "devices_to_ignore": [ + "asic", + "psu" + ], + "user_defined_checkers": [], + "polling_interval": 60, + "led_color": { + "fault": "amber", + "normal": "green", + "booting": "blinking green" + } +} diff --git a/device/quanta/x86_64-quanta_ix7_bwde-r0/Quanta-IX7-BWDE-32X/buffers.json.j2 b/device/quanta/x86_64-quanta_ix7_bwde-r0/Quanta-IX7-BWDE-32X/buffers.json.j2 new file mode 100644 index 000000000000..b67cf577ab75 --- /dev/null +++ b/device/quanta/x86_64-quanta_ix7_bwde-r0/Quanta-IX7-BWDE-32X/buffers.json.j2 @@ -0,0 +1,3 @@ +{%- set default_topo = 't1' %} +{%- include 'buffers_config.j2' %} + diff --git a/device/quanta/x86_64-quanta_ix7_bwde-r0/Quanta-IX7-BWDE-32X/buffers_defaults_def.j2 b/device/quanta/x86_64-quanta_ix7_bwde-r0/Quanta-IX7-BWDE-32X/buffers_defaults_def.j2 new file mode 100644 index 000000000000..740cfdf79e96 --- /dev/null +++ b/device/quanta/x86_64-quanta_ix7_bwde-r0/Quanta-IX7-BWDE-32X/buffers_defaults_def.j2 @@ -0,0 +1,46 @@ +{%- set default_cable = '300m' %} + +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {% for port_idx in range(0,32) %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} + {% endfor %} +{%- endmacro %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + "xoff": "4625920", + "size": "12766208", + "type": "ingress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "12766208", + "type": "egress", + "mode": "static" + }, + "egress_lossy_pool": { + "size": "7326924", + "type": "egress", + "mode": "dynamic" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "dynamic_th":"3" + }, + "egress_lossless_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"0", + "static_th":"12766208" + }, + "egress_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"1518", + "dynamic_th":"3" + } + }, +{%- endmacro %} diff --git a/device/quanta/x86_64-quanta_ix7_bwde-r0/Quanta-IX7-BWDE-32X/buffers_defaults_t0.j2 b/device/quanta/x86_64-quanta_ix7_bwde-r0/Quanta-IX7-BWDE-32X/buffers_defaults_t0.j2 new file mode 100644 index 000000000000..44fcf21887a6 --- /dev/null +++ b/device/quanta/x86_64-quanta_ix7_bwde-r0/Quanta-IX7-BWDE-32X/buffers_defaults_t0.j2 @@ -0,0 +1,45 @@ +{%- set default_cable = '300m' %} + +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {% for port_idx in range(0,32) %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} + {% endfor %} +{%- endmacro %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "12766208", + "type": "ingress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "12766208", + "type": "egress", + "mode": "static" + }, + "egress_lossy_pool": { + "size": "7326924", + "type": "egress", + "mode": "dynamic" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "dynamic_th":"3" + }, + "egress_lossless_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"0", + "static_th":"12766208" + }, + "egress_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"1518", + "dynamic_th":"3" + } + }, +{%- endmacro %} diff --git a/device/quanta/x86_64-quanta_ix7_bwde-r0/Quanta-IX7-BWDE-32X/buffers_defaults_t1.j2 b/device/quanta/x86_64-quanta_ix7_bwde-r0/Quanta-IX7-BWDE-32X/buffers_defaults_t1.j2 new file mode 100644 index 000000000000..5fe9cabcfd34 --- /dev/null +++ b/device/quanta/x86_64-quanta_ix7_bwde-r0/Quanta-IX7-BWDE-32X/buffers_defaults_t1.j2 @@ -0,0 +1,46 @@ +{%- set default_cable = '300m' %} + +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {% for port_idx in range(0,32) %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} + {% endfor %} +{%- endmacro %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + "xoff": "196608", + "size": "12766208", + "type": "ingress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "33004032", + "type": "egress", + "mode": "static" + }, + "egress_lossy_pool": { + "size": "12766208", + "type": "egress", + "mode": "dynamic" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "dynamic_th":"3" + }, + "egress_lossless_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"0", + "static_th":"33004032" + }, + "egress_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"1518", + "dynamic_th":"3" + } + }, +{%- endmacro %} diff --git a/device/quanta/x86_64-quanta_ix7_bwde-r0/Quanta-IX7-BWDE-32X/l2/config b/device/quanta/x86_64-quanta_ix7_bwde-r0/Quanta-IX7-BWDE-32X/l2/config new file mode 100644 index 000000000000..b2d4a1e80592 --- /dev/null +++ b/device/quanta/x86_64-quanta_ix7_bwde-r0/Quanta-IX7-BWDE-32X/l2/config @@ -0,0 +1,3 @@ +l2_mem_entries=294912 +l3_mem_entries=16384 +l3_alpm_enable=0 diff --git a/device/quanta/x86_64-quanta_ix7_bwde-r0/Quanta-IX7-BWDE-32X/l3/config b/device/quanta/x86_64-quanta_ix7_bwde-r0/Quanta-IX7-BWDE-32X/l3/config new file mode 100644 index 000000000000..fff0cf54b08a --- /dev/null +++ b/device/quanta/x86_64-quanta_ix7_bwde-r0/Quanta-IX7-BWDE-32X/l3/config @@ -0,0 +1,5 @@ +l2_mem_entries=40960 +l3_mem_entries=40960 +l3_alpm_enable=2 +use_all_splithorizon_groups=1 +sai_tunnel_support=1 diff --git a/device/quanta/x86_64-quanta_ix7_bwde-r0/Quanta-IX7-BWDE-32X/pg_profile_lookup.ini b/device/quanta/x86_64-quanta_ix7_bwde-r0/Quanta-IX7-BWDE-32X/pg_profile_lookup.ini new file mode 100644 index 000000000000..6d91d03ae684 --- /dev/null +++ b/device/quanta/x86_64-quanta_ix7_bwde-r0/Quanta-IX7-BWDE-32X/pg_profile_lookup.ini @@ -0,0 +1,17 @@ +# PG lossless profiles. +# speed cable size xon xoff threshold xon_offset + 10000 5m 9427 0 50176 1 3584 + 25000 5m 9427 0 50176 1 3584 + 40000 5m 9427 0 50176 1 3584 + 50000 5m 9427 0 50176 1 3584 + 100000 5m 9427 0 50176 1 3584 + 10000 40m 9427 0 50176 1 3584 + 25000 40m 9427 0 50176 1 3584 + 40000 40m 9427 0 50176 1 3584 + 50000 40m 9427 0 50176 1 3584 + 100000 40m 9427 0 50176 1 3584 + 10000 300m 9427 0 50176 1 3584 + 25000 300m 9427 0 50176 1 3584 + 40000 300m 9427 0 50176 1 3584 + 50000 300m 9427 0 50176 1 3584 + 100000 300m 9427 0 50176 1 3584 diff --git a/device/quanta/x86_64-quanta_ix7_bwde-r0/Quanta-IX7-BWDE-32X/platform-def.json b/device/quanta/x86_64-quanta_ix7_bwde-r0/Quanta-IX7-BWDE-32X/platform-def.json new file mode 100644 index 000000000000..ed3f9fcbf2bf --- /dev/null +++ b/device/quanta/x86_64-quanta_ix7_bwde-r0/Quanta-IX7-BWDE-32X/platform-def.json @@ -0,0 +1,32 @@ +{ + "fec-mode": { + "Ethernet0-127": { + "1": { + "10000": [ "none", "fc" ], + "25000": [ "none", "rs" ] + }, + "2": { + "20000": [ "none", "fc" ], + "50000": [ "none", "rs" ] + }, + "4": { + "40000": [ "none", "fc" ], + "100000": [ "none", "rs" ] + } + } + }, + "default-fec-mode": { + "Ethernet0-127": { + "4": { + "40000": "none", + "100000": "rs" + } + } + }, + "native-port-supported-speeds": { + "Ethernet0-127": { + "4": ["100000","40000"] + } + } +} + diff --git a/device/quanta/x86_64-quanta_ix7_bwde-r0/Quanta-IX7-BWDE-32X/port_config.ini b/device/quanta/x86_64-quanta_ix7_bwde-r0/Quanta-IX7-BWDE-32X/port_config.ini new file mode 100644 index 000000000000..14f4716d9091 --- /dev/null +++ b/device/quanta/x86_64-quanta_ix7_bwde-r0/Quanta-IX7-BWDE-32X/port_config.ini @@ -0,0 +1,33 @@ +# name lanes alias index speed +Ethernet0 29,30,31,32 hundredGigE1 1 100000 +Ethernet4 33,34,35,36 hundredGigE2 2 100000 +Ethernet8 41,42,43,44 hundredGigE3 3 100000 +Ethernet12 45,46,47,48 hundredGigE4 4 100000 +Ethernet16 1,2,3,4 hundredGigE5 5 100000 +Ethernet20 5,6,7,8 hundredGigE6 6 100000 +Ethernet24 9,10,11,12 hundredGigE7 7 100000 +Ethernet28 13,14,15,16 hundredGigE8 8 100000 +Ethernet32 17,18,19,20 hundredGigE9 9 100000 +Ethernet36 21,22,23,24 hundredGigE10 10 100000 +Ethernet40 25,26,27,28 hundredGigE11 11 100000 +Ethernet44 37,38,39,40 hundredGigE12 12 100000 +Ethernet48 49,50,51,52 hundredGigE13 13 100000 +Ethernet52 53,54,55,56 hundredGigE14 14 100000 +Ethernet56 57,58,59,60 hundredGigE15 15 100000 +Ethernet60 61,62,63,64 hundredGigE16 16 100000 +Ethernet64 65,66,67,68 hundredGigE17 17 100000 +Ethernet68 69,70,71,72 hundredGigE18 18 100000 +Ethernet72 73,74,75,76 hundredGigE19 19 100000 +Ethernet76 77,78,79,80 hundredGigE20 20 100000 +Ethernet80 93,94,95,96 hundredGigE21 21 100000 +Ethernet84 101,102,103,104 hundredGigE22 22 100000 +Ethernet88 105,106,107,108 hundredGigE23 23 100000 +Ethernet92 109,110,111,112 hundredGigE24 24 100000 +Ethernet96 113,114,115,116 hundredGigE25 25 100000 +Ethernet100 117,118,119,120 hundredGigE26 26 100000 +Ethernet104 121,122,123,124 hundredGigE27 27 100000 +Ethernet108 125,126,127,128 hundredGigE28 28 100000 +Ethernet112 81,82,83,84 hundredGigE29 29 100000 +Ethernet116 85,86,87,88 hundredGigE30 30 100000 +Ethernet120 89,90,91,92 hundredGigE31 31 100000 +Ethernet124 97,98,99,100 hundredGigE32 32 100000 diff --git a/device/quanta/x86_64-quanta_ix7_bwde-r0/Quanta-IX7-BWDE-32X/qos.json.j2 b/device/quanta/x86_64-quanta_ix7_bwde-r0/Quanta-IX7-BWDE-32X/qos.json.j2 new file mode 100644 index 000000000000..ee67c6e26221 --- /dev/null +++ b/device/quanta/x86_64-quanta_ix7_bwde-r0/Quanta-IX7-BWDE-32X/qos.json.j2 @@ -0,0 +1 @@ +{%- include 'qos_config_t1.j2' %} diff --git a/device/quanta/x86_64-quanta_ix7_bwde-r0/Quanta-IX7-BWDE-32X/qos_config_t1.j2 b/device/quanta/x86_64-quanta_ix7_bwde-r0/Quanta-IX7-BWDE-32X/qos_config_t1.j2 new file mode 100644 index 000000000000..5fe5324a85c1 --- /dev/null +++ b/device/quanta/x86_64-quanta_ix7_bwde-r0/Quanta-IX7-BWDE-32X/qos_config_t1.j2 @@ -0,0 +1,175 @@ +{%- set PORT_ALL = [] %} +{%- for port in PORT %} + {%- if PORT_ALL.append(port) %}{% endif %} +{%- endfor %} +{%- if PORT_ALL | sort_by_port_index %}{% endif %} + +{%- set port_names_list_all = [] %} +{%- for port in PORT_ALL %} + {%- if port_names_list_all.append(port) %}{% endif %} +{%- endfor %} +{%- set port_names_all = port_names_list_all | join(',') -%} + + +{%- set PORT_ACTIVE = [] %} +{%- if DEVICE_NEIGHBOR is not defined %} + {%- set PORT_ACTIVE = PORT_ALL %} +{%- else %} + {%- for port in DEVICE_NEIGHBOR.keys() %} + {%- if PORT_ACTIVE.append(port) %}{%- endif %} + {%- endfor %} +{%- endif %} +{%- if PORT_ACTIVE | sort_by_port_index %}{% endif %} + +{%- set port_names_list_active = [] %} +{%- for port in PORT_ACTIVE %} + {%- if port_names_list_active.append(port) %}{%- endif %} +{%- endfor %} +{%- set port_names_active = port_names_list_active | join(',') -%} + + +{%- set pfc_to_pg_map_supported_asics = ['mellanox', 'barefoot', 'marvell'] -%} + + +{ +{% if generate_tc_to_pg_map is defined %} + {{- generate_tc_to_pg_map() }} +{% else %} + "TC_TO_PRIORITY_GROUP_MAP": { + "AZURE": { + "0": "0", + "1": "0", + "2": "0", + "3": "3", + "4": "4", + "5": "0", + "6": "0", + "7": "7" + } + }, +{% endif %} + "MAP_PFC_PRIORITY_TO_QUEUE": { + "AZURE": { + "0": "0", + "1": "1", + "2": "2", + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7" + } + }, + "TC_TO_QUEUE_MAP": { + "AZURE": { + "0": "0", + "1": "1", + "2": "2", + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7" + } + }, + "DSCP_TO_TC_MAP": { + "AZURE": { + "0" : "1", + "1" : "1", + "2" : "1", + "3" : "3", + "4" : "4", + "5" : "2", + "6" : "1", + "7" : "1", + "8" : "0", + "9" : "1", + "10": "1", + "11": "1", + "12": "1", + "13": "1", + "14": "1", + "15": "1", + "16": "1", + "17": "1", + "18": "1", + "19": "1", + "20": "1", + "21": "1", + "22": "1", + "23": "1", + "24": "1", + "25": "1", + "26": "1", + "27": "1", + "28": "1", + "29": "1", + "30": "1", + "31": "1", + "32": "1", + "33": "1", + "34": "1", + "35": "1", + "36": "1", + "37": "1", + "38": "1", + "39": "1", + "40": "1", + "41": "1", + "42": "1", + "43": "1", + "44": "1", + "45": "1", + "46": "5", + "47": "1", + "48": "6", + "49": "1", + "50": "1", + "51": "1", + "52": "1", + "53": "1", + "54": "1", + "55": "1", + "56": "1", + "57": "1", + "58": "1", + "59": "1", + "60": "1", + "61": "1", + "62": "1", + "63": "1" + } + }, + "SCHEDULER": { + "scheduler.0": { + "type" : "DWRR", + "weight": "14" + }, + "scheduler.1": { + "type" : "DWRR", + "weight": "15" + } + }, +{% if asic_type in pfc_to_pg_map_supported_asics %} + "PFC_PRIORITY_TO_PRIORITY_GROUP_MAP": { + "AZURE": { + "3": "3", + "4": "4" + } + }, +{% endif %} + "PORT_QOS_MAP": { +{% for port in PORT_ACTIVE %} + "{{ port }}": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", +{% if asic_type in pfc_to_pg_map_supported_asics %} + "pfc_to_pg_map" : "[PFC_PRIORITY_TO_PRIORITY_GROUP_MAP|AZURE]", +{% endif %} + "pfc_enable" : "3,4" + }{% if not loop.last %},{% endif %} +{% endfor %} + } +} diff --git a/device/quanta/x86_64-quanta_ix7_bwde-r0/Quanta-IX7-BWDE-32X/sai.profile b/device/quanta/x86_64-quanta_ix7_bwde-r0/Quanta-IX7-BWDE-32X/sai.profile new file mode 100644 index 000000000000..5f6bb039153c --- /dev/null +++ b/device/quanta/x86_64-quanta_ix7_bwde-r0/Quanta-IX7-BWDE-32X/sai.profile @@ -0,0 +1,2 @@ +SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/td3-ix7-bwde-32x100G.config.bcm +SAI_NUM_ECMP_MEMBERS=64 diff --git a/device/quanta/x86_64-quanta_ix7_bwde-r0/Quanta-IX7-BWDE-32X/td3-ix7-bwde-32x100G.config.bcm b/device/quanta/x86_64-quanta_ix7_bwde-r0/Quanta-IX7-BWDE-32X/td3-ix7-bwde-32x100G.config.bcm new file mode 100644 index 000000000000..0f64dfeed2c9 --- /dev/null +++ b/device/quanta/x86_64-quanta_ix7_bwde-r0/Quanta-IX7-BWDE-32X/td3-ix7-bwde-32x100G.config.bcm @@ -0,0 +1,612 @@ +#polarity/lanemap is using TH2 style. +core_clock_frequency=1525 +dpp_clock_ratio=2:3 + +oversubscribe_mode=1 + +#RIOT Enable +riot_enable=1 +riot_overlay_l3_intf_mem_size=4096 +riot_overlay_l3_egress_mem_size=32768 +l3_ecmp_levels=2 +riot_overlay_ecmp_resilient_hash_size=16384 + +pbmp_xport_xe=0x3ffffffffffffffffffffffffffffffffe + +port_flex_enable=1 +mem_cache_enable=0 + +l3_alpm_ipv6_128b_bkt_rsvd=1 +fpem_mem_entries=0 +ifp_inports_support_enable=1 +l2xmsg_mode=1 + +# Platform specfic +bcm_num_cos=10 +default_cpu_tx_queue=9 +bcm_stat_interval=2000000 +cdma_timeout_usec=3000000 +ipv6_lpm_128b_enable=0x1 +l3_max_ecmp_mode=1 +lpm_scaling_enable=0 +max_vp_lags=0 +miim_intr_enable=0 +module_64ports=1 +schan_intr_enable=0 +stable_size=0x5500000 +tdma_timeout_usec=3000000 +skip_L2_USER_ENTRY=0 +bcm_tunnel_term_compatible_mode=1 + +phy_an_c73=1 +# portmap settings + +portmap_1=1:100 +portmap_5=5:100 +portmap_9=9:100 +portmap_13=13:100 +portmap_17=17:100 +portmap_21=21:100 +portmap_25=25:100 +portmap_29=29:100 + +portmap_33=33:100 +portmap_37=37:100 +portmap_41=41:100 +portmap_45=45:100 +portmap_49=49:100 +portmap_53=53:100 +portmap_57=57:100 +portmap_61=61:100 + +portmap_67=65:100 +portmap_71=69:100 +portmap_75=73:100 +portmap_79=77:100 +portmap_83=81:100 +portmap_87=85:100 +portmap_91=89:100 +portmap_95=93:100 + +portmap_99=97:100 +portmap_103=101:100 +portmap_107=105:100 +portmap_111=109:100 +portmap_115=113:100 +portmap_119=117:100 +portmap_123=121:100 +portmap_127=125:100 + +# datapath port -- MerlinCore +#Hide these to prevent SAI from initializing them...they are physically not on system +#front panel +#portmap_66=129:10:m +#portmap_130=128:10:m + +# loopback port +portmap_65=130:10 +portmap_131=131:10 + +# port order remap +dport_map_port_29=1 +dport_map_port_30=2 +dport_map_port_31=3 +dport_map_port_32=4 + +dport_map_port_33=5 +dport_map_port_34=6 +dport_map_port_35=7 +dport_map_port_36=8 + +dport_map_port_41=9 +dport_map_port_42=10 +dport_map_port_43=11 +dport_map_port_44=12 + +dport_map_port_45=13 +dport_map_port_46=14 +dport_map_port_47=15 +dport_map_port_48=16 + +dport_map_port_1=17 +dport_map_port_2=18 +dport_map_port_3=19 +dport_map_port_4=20 + +dport_map_port_5=21 +dport_map_port_6=22 +dport_map_port_7=23 +dport_map_port_8=24 + +dport_map_port_9=25 +dport_map_port_10=26 +dport_map_port_11=27 +dport_map_port_12=28 + +dport_map_port_13=29 +dport_map_port_14=30 +dport_map_port_15=31 +dport_map_port_16=32 + +dport_map_port_17=33 +dport_map_port_18=34 +dport_map_port_19=35 +dport_map_port_20=36 + +dport_map_port_21=37 +dport_map_port_22=38 +dport_map_port_23=39 +dport_map_port_24=40 + +dport_map_port_25=41 +dport_map_port_26=42 +dport_map_port_27=43 +dport_map_port_28=44 + +dport_map_port_37=45 +dport_map_port_38=46 +dport_map_port_39=47 +dport_map_port_40=48 + +dport_map_port_49=49 +dport_map_port_50=50 +dport_map_port_51=51 +dport_map_port_52=52 + +dport_map_port_53=53 +dport_map_port_54=54 +dport_map_port_55=55 +dport_map_port_56=56 + +dport_map_port_57=57 +dport_map_port_58=58 +dport_map_port_59=59 +dport_map_port_60=60 + +dport_map_port_61=61 +dport_map_port_62=62 +dport_map_port_63=63 +dport_map_port_64=64 + +dport_map_port_67=65 +dport_map_port_68=66 +dport_map_port_69=67 +dport_map_port_70=68 + +dport_map_port_71=69 +dport_map_port_72=70 +dport_map_port_73=71 +dport_map_port_74=72 + +dport_map_port_75=73 +dport_map_port_76=74 +dport_map_port_77=75 +dport_map_port_78=76 + +dport_map_port_79=77 +dport_map_port_80=78 +dport_map_port_81=79 +dport_map_port_82=80 + +dport_map_port_95=81 +dport_map_port_96=82 +dport_map_port_97=83 +dport_map_port_98=84 + +dport_map_port_103=85 +dport_map_port_104=86 +dport_map_port_105=87 +dport_map_port_106=88 + +dport_map_port_107=89 +dport_map_port_108=90 +dport_map_port_109=91 +dport_map_port_110=92 + +dport_map_port_111=93 +dport_map_port_112=94 +dport_map_port_113=95 +dport_map_port_114=96 + +dport_map_port_115=97 +dport_map_port_116=98 +dport_map_port_117=99 +dport_map_port_118=100 + +dport_map_port_119=101 +dport_map_port_120=102 +dport_map_port_121=103 +dport_map_port_122=104 + +dport_map_port_123=105 +dport_map_port_124=106 +dport_map_port_125=107 +dport_map_port_126=108 + +dport_map_port_127=109 +dport_map_port_128=110 +dport_map_port_129=111 +dport_map_port_130=112 + +dport_map_port_83=113 +dport_map_port_84=114 +dport_map_port_85=115 +dport_map_port_86=116 + +dport_map_port_87=117 +dport_map_port_88=118 +dport_map_port_89=119 +dport_map_port_90=120 + +dport_map_port_91=121 +dport_map_port_92=122 +dport_map_port_93=123 +dport_map_port_94=124 + +dport_map_port_99=125 +dport_map_port_100=126 +dport_map_port_101=127 +dport_map_port_102=128 + +dport_map_port_66=129 +dport_map_port_130=130 + + +### lane swap and polarity follow physical port +phy_chain_tx_lane_map_physical{29.0}=0x1230 +phy_chain_tx_polarity_flip_physical{29.0}=0x1 +phy_chain_tx_polarity_flip_physical{30.0}=0x0 +phy_chain_tx_polarity_flip_physical{31.0}=0x1 +phy_chain_tx_polarity_flip_physical{32.0}=0x1 +phy_chain_rx_lane_map_physical{29.0}=0x1302 +phy_chain_rx_polarity_flip_physical{29.0}=0x0 +phy_chain_rx_polarity_flip_physical{30.0}=0x0 +phy_chain_rx_polarity_flip_physical{31.0}=0x1 +phy_chain_rx_polarity_flip_physical{32.0}=0x1 + +phy_chain_tx_lane_map_physical{33.0}=0x3210 +phy_chain_tx_polarity_flip_physical{33.0}=0x1 +phy_chain_tx_polarity_flip_physical{34.0}=0x1 +phy_chain_tx_polarity_flip_physical{35.0}=0x1 +phy_chain_tx_polarity_flip_physical{36.0}=0x1 +phy_chain_rx_lane_map_physical{33.0}=0x0123 +phy_chain_rx_polarity_flip_physical{33.0}=0x0 +phy_chain_rx_polarity_flip_physical{34.0}=0x1 +phy_chain_rx_polarity_flip_physical{35.0}=0x0 +phy_chain_rx_polarity_flip_physical{36.0}=0x1 + +phy_chain_tx_lane_map_physical{41.0}=0x0213 +phy_chain_tx_polarity_flip_physical{41.0}=0x0 +phy_chain_tx_polarity_flip_physical{42.0}=0x1 +phy_chain_tx_polarity_flip_physical{43.0}=0x1 +phy_chain_tx_polarity_flip_physical{44.0}=0x0 +phy_chain_rx_lane_map_physical{41.0}=0x1302 +phy_chain_rx_polarity_flip_physical{41.0}=0x1 +phy_chain_rx_polarity_flip_physical{42.0}=0x1 +phy_chain_rx_polarity_flip_physical{43.0}=0x0 +phy_chain_rx_polarity_flip_physical{44.0}=0x0 + +phy_chain_tx_lane_map_physical{45.0}=0x3210 +phy_chain_tx_polarity_flip_physical{45.0}=0x1 +phy_chain_tx_polarity_flip_physical{46.0}=0x1 +phy_chain_tx_polarity_flip_physical{47.0}=0x1 +phy_chain_tx_polarity_flip_physical{48.0}=0x1 +phy_chain_rx_lane_map_physical{45.0}=0x2103 +phy_chain_rx_polarity_flip_physical{45.0}=0x0 +phy_chain_rx_polarity_flip_physical{46.0}=0x0 +phy_chain_rx_polarity_flip_physical{47.0}=0x1 +phy_chain_rx_polarity_flip_physical{48.0}=0x0 + +phy_chain_tx_lane_map_physical{1.0}=0x0213 +phy_chain_tx_polarity_flip_physical{1.0}=0x0 +phy_chain_tx_polarity_flip_physical{2.0}=0x1 +phy_chain_tx_polarity_flip_physical{3.0}=0x1 +phy_chain_tx_polarity_flip_physical{4.0}=0x0 +phy_chain_rx_lane_map_physical{1.0}=0x1302 +phy_chain_rx_polarity_flip_physical{1.0}=0x0 +phy_chain_rx_polarity_flip_physical{2.0}=0x0 +phy_chain_rx_polarity_flip_physical{3.0}=0x1 +phy_chain_rx_polarity_flip_physical{4.0}=0x1 + +phy_chain_tx_lane_map_physical{5.0}=0x3210 +phy_chain_tx_polarity_flip_physical{5.0}=0x1 +phy_chain_tx_polarity_flip_physical{6.0}=0x1 +phy_chain_tx_polarity_flip_physical{7.0}=0x1 +phy_chain_tx_polarity_flip_physical{8.0}=0x1 +phy_chain_rx_lane_map_physical{5.0}=0x2103 +phy_chain_rx_polarity_flip_physical{5.0}=0x1 +phy_chain_rx_polarity_flip_physical{6.0}=0x1 +phy_chain_rx_polarity_flip_physical{7.0}=0x0 +phy_chain_rx_polarity_flip_physical{8.0}=0x1 + +phy_chain_tx_lane_map_physical{9.0}=0x0213 +phy_chain_tx_polarity_flip_physical{9.0}=0x0 +phy_chain_tx_polarity_flip_physical{10.0}=0x1 +phy_chain_tx_polarity_flip_physical{11.0}=0x1 +phy_chain_tx_polarity_flip_physical{12.0}=0x0 +phy_chain_rx_lane_map_physical{9.0}=0x1302 +phy_chain_rx_polarity_flip_physical{9.0}=0x0 +phy_chain_rx_polarity_flip_physical{10.0}=0x1 +phy_chain_rx_polarity_flip_physical{11.0}=0x1 +phy_chain_rx_polarity_flip_physical{12.0}=0x1 + +phy_chain_tx_lane_map_physical{13.0}=0x3210 +phy_chain_tx_polarity_flip_physical{13.0}=0x1 +phy_chain_tx_polarity_flip_physical{14.0}=0x1 +phy_chain_tx_polarity_flip_physical{15.0}=0x1 +phy_chain_tx_polarity_flip_physical{16.0}=0x1 +phy_chain_rx_lane_map_physical{13.0}=0x2031 +phy_chain_rx_polarity_flip_physical{13.0}=0x1 +phy_chain_rx_polarity_flip_physical{14.0}=0x0 +phy_chain_rx_polarity_flip_physical{15.0}=0x1 +phy_chain_rx_polarity_flip_physical{16.0}=0x1 + +phy_chain_tx_lane_map_physical{17.0}=0x0123 +phy_chain_tx_polarity_flip_physical{17.0}=0x0 +phy_chain_tx_polarity_flip_physical{18.0}=0x0 +phy_chain_tx_polarity_flip_physical{19.0}=0x1 +phy_chain_tx_polarity_flip_physical{20.0}=0x1 +phy_chain_rx_lane_map_physical{17.0}=0x1302 +phy_chain_rx_polarity_flip_physical{17.0}=0x0 +phy_chain_rx_polarity_flip_physical{18.0}=0x0 +phy_chain_rx_polarity_flip_physical{19.0}=0x1 +phy_chain_rx_polarity_flip_physical{20.0}=0x1 + +phy_chain_tx_lane_map_physical{21.0}=0x3210 +phy_chain_tx_polarity_flip_physical{21.0}=0x1 +phy_chain_tx_polarity_flip_physical{22.0}=0x1 +phy_chain_tx_polarity_flip_physical{23.0}=0x1 +phy_chain_tx_polarity_flip_physical{24.0}=0x1 +phy_chain_rx_lane_map_physical{21.0}=0x1032 +phy_chain_rx_polarity_flip_physical{21.0}=0x0 +phy_chain_rx_polarity_flip_physical{22.0}=0x1 +phy_chain_rx_polarity_flip_physical{23.0}=0x1 +phy_chain_rx_polarity_flip_physical{24.0}=0x0 + +phy_chain_tx_lane_map_physical{25.0}=0x0213 +phy_chain_tx_polarity_flip_physical{25.0}=0x1 +phy_chain_tx_polarity_flip_physical{26.0}=0x0 +phy_chain_tx_polarity_flip_physical{27.0}=0x0 +phy_chain_tx_polarity_flip_physical{28.0}=0x1 +phy_chain_rx_lane_map_physical{25.0}=0x1302 +phy_chain_rx_polarity_flip_physical{25.0}=0x1 +phy_chain_rx_polarity_flip_physical{26.0}=0x1 +phy_chain_rx_polarity_flip_physical{27.0}=0x0 +phy_chain_rx_polarity_flip_physical{28.0}=0x0 + +phy_chain_tx_lane_map_physical{37.0}=0x3210 +phy_chain_tx_polarity_flip_physical{37.0}=0x1 +phy_chain_tx_polarity_flip_physical{38.0}=0x1 +phy_chain_tx_polarity_flip_physical{39.0}=0x1 +phy_chain_tx_polarity_flip_physical{40.0}=0x1 +phy_chain_rx_lane_map_physical{37.0}=0x2103 +phy_chain_rx_polarity_flip_physical{37.0}=0x0 +phy_chain_rx_polarity_flip_physical{38.0}=0x0 +phy_chain_rx_polarity_flip_physical{39.0}=0x1 +phy_chain_rx_polarity_flip_physical{40.0}=0x0 + +phy_chain_tx_lane_map_physical{49.0}=0x0213 +phy_chain_tx_polarity_flip_physical{49.0}=0x1 +phy_chain_tx_polarity_flip_physical{50.0}=0x0 +phy_chain_tx_polarity_flip_physical{51.0}=0x0 +phy_chain_tx_polarity_flip_physical{52.0}=0x1 +phy_chain_rx_lane_map_physical{49.0}=0x1302 +phy_chain_rx_polarity_flip_physical{49.0}=0x1 +phy_chain_rx_polarity_flip_physical{50.0}=0x1 +phy_chain_rx_polarity_flip_physical{51.0}=0x0 +phy_chain_rx_polarity_flip_physical{52.0}=0x0 + +phy_chain_tx_lane_map_physical{53.0}=0x3210 +phy_chain_tx_polarity_flip_physical{53.0}=0x0 +phy_chain_tx_polarity_flip_physical{54.0}=0x0 +phy_chain_tx_polarity_flip_physical{55.0}=0x0 +phy_chain_tx_polarity_flip_physical{56.0}=0x0 +phy_chain_rx_lane_map_physical{53.0}=0x2103 +phy_chain_rx_polarity_flip_physical{53.0}=0x0 +phy_chain_rx_polarity_flip_physical{54.0}=0x0 +phy_chain_rx_polarity_flip_physical{55.0}=0x1 +phy_chain_rx_polarity_flip_physical{56.0}=0x0 + +phy_chain_tx_lane_map_physical{57.0}=0x0213 +phy_chain_tx_polarity_flip_physical{57.0}=0x0 +phy_chain_tx_polarity_flip_physical{58.0}=0x1 +phy_chain_tx_polarity_flip_physical{59.0}=0x1 +phy_chain_tx_polarity_flip_physical{60.0}=0x0 +phy_chain_rx_lane_map_physical{57.0}=0x1302 +phy_chain_rx_polarity_flip_physical{57.0}=0x1 +phy_chain_rx_polarity_flip_physical{58.0}=0x1 +phy_chain_rx_polarity_flip_physical{59.0}=0x0 +phy_chain_rx_polarity_flip_physical{60.0}=0x0 + +phy_chain_tx_lane_map_physical{61.0}=0x3210 +phy_chain_tx_polarity_flip_physical{61.0}=0x1 +phy_chain_tx_polarity_flip_physical{62.0}=0x1 +phy_chain_tx_polarity_flip_physical{63.0}=0x1 +phy_chain_tx_polarity_flip_physical{64.0}=0x1 +phy_chain_rx_lane_map_physical{61.0}=0x2103 +phy_chain_rx_polarity_flip_physical{61.0}=0x0 +phy_chain_rx_polarity_flip_physical{62.0}=0x0 +phy_chain_rx_polarity_flip_physical{63.0}=0x1 +phy_chain_rx_polarity_flip_physical{64.0}=0x0 + +phy_chain_tx_lane_map_physical{65.0}=0x3210 +phy_chain_tx_polarity_flip_physical{65.0}=0x0 +phy_chain_tx_polarity_flip_physical{66.0}=0x0 +phy_chain_tx_polarity_flip_physical{67.0}=0x1 +phy_chain_tx_polarity_flip_physical{68.0}=0x1 +phy_chain_rx_lane_map_physical{65.0}=0x3120 +phy_chain_rx_polarity_flip_physical{65.0}=0x0 +phy_chain_rx_polarity_flip_physical{66.0}=0x0 +phy_chain_rx_polarity_flip_physical{67.0}=0x1 +phy_chain_rx_polarity_flip_physical{68.0}=0x1 + +phy_chain_tx_lane_map_physical{69.0}=0x0123 +phy_chain_tx_polarity_flip_physical{69.0}=0x0 +phy_chain_tx_polarity_flip_physical{70.0}=0x0 +phy_chain_tx_polarity_flip_physical{71.0}=0x0 +phy_chain_tx_polarity_flip_physical{72.0}=0x0 +phy_chain_rx_lane_map_physical{69.0}=0x2301 +phy_chain_rx_polarity_flip_physical{69.0}=0x1 +phy_chain_rx_polarity_flip_physical{70.0}=0x0 +phy_chain_rx_polarity_flip_physical{71.0}=0x0 +phy_chain_rx_polarity_flip_physical{72.0}=0x0 + +phy_chain_tx_lane_map_physical{73.0}=0x3120 +phy_chain_tx_polarity_flip_physical{73.0}=0x1 +phy_chain_tx_polarity_flip_physical{74.0}=0x0 +phy_chain_tx_polarity_flip_physical{75.0}=0x0 +phy_chain_tx_polarity_flip_physical{76.0}=0x1 +phy_chain_rx_lane_map_physical{73.0}=0x3120 +phy_chain_rx_polarity_flip_physical{73.0}=0x0 +phy_chain_rx_polarity_flip_physical{74.0}=0x0 +phy_chain_rx_polarity_flip_physical{75.0}=0x1 +phy_chain_rx_polarity_flip_physical{76.0}=0x1 + +phy_chain_tx_lane_map_physical{77.0}=0x0213 +phy_chain_tx_polarity_flip_physical{77.0}=0x1 +phy_chain_tx_polarity_flip_physical{78.0}=0x0 +phy_chain_tx_polarity_flip_physical{79.0}=0x0 +phy_chain_tx_polarity_flip_physical{80.0}=0x1 +phy_chain_rx_lane_map_physical{77.0}=0x0321 +phy_chain_rx_polarity_flip_physical{77.0}=0x1 +phy_chain_rx_polarity_flip_physical{78.0}=0x1 +phy_chain_rx_polarity_flip_physical{79.0}=0x0 +phy_chain_rx_polarity_flip_physical{80.0}=0x1 + +phy_chain_tx_lane_map_physical{93.0}=0x3120 +phy_chain_tx_polarity_flip_physical{93.0}=0x1 +phy_chain_tx_polarity_flip_physical{94.0}=0x0 +phy_chain_tx_polarity_flip_physical{95.0}=0x0 +phy_chain_tx_polarity_flip_physical{96.0}=0x1 +phy_chain_rx_lane_map_physical{93.0}=0x3120 +phy_chain_rx_polarity_flip_physical{93.0}=0x1 +phy_chain_rx_polarity_flip_physical{94.0}=0x1 +phy_chain_rx_polarity_flip_physical{95.0}=0x0 +phy_chain_rx_polarity_flip_physical{96.0}=0x0 + +phy_chain_tx_lane_map_physical{101.0}=0x0321 +phy_chain_tx_polarity_flip_physical{101.0}=0x0 +phy_chain_tx_polarity_flip_physical{102.0}=0x1 +phy_chain_tx_polarity_flip_physical{103.0}=0x1 +phy_chain_tx_polarity_flip_physical{104.0}=0x1 +phy_chain_rx_lane_map_physical{101.0}=0x0321 +phy_chain_rx_polarity_flip_physical{101.0}=0x1 +phy_chain_rx_polarity_flip_physical{102.0}=0x1 +phy_chain_rx_polarity_flip_physical{103.0}=0x0 +phy_chain_rx_polarity_flip_physical{104.0}=0x1 + +phy_chain_tx_lane_map_physical{105.0}=0x3120 +phy_chain_tx_polarity_flip_physical{105.0}=0x1 +phy_chain_tx_polarity_flip_physical{106.0}=0x0 +phy_chain_tx_polarity_flip_physical{107.0}=0x0 +phy_chain_tx_polarity_flip_physical{108.0}=0x1 +phy_chain_rx_lane_map_physical{105.0}=0x3120 +phy_chain_rx_polarity_flip_physical{105.0}=0x1 +phy_chain_rx_polarity_flip_physical{106.0}=0x1 +phy_chain_rx_polarity_flip_physical{107.0}=0x0 +phy_chain_rx_polarity_flip_physical{108.0}=0x0 + +phy_chain_tx_lane_map_physical{109.0}=0x0123 +phy_chain_tx_polarity_flip_physical{109.0}=0x1 +phy_chain_tx_polarity_flip_physical{110.0}=0x1 +phy_chain_tx_polarity_flip_physical{111.0}=0x1 +phy_chain_tx_polarity_flip_physical{112.0}=0x1 +phy_chain_rx_lane_map_physical{109.0}=0x0321 +phy_chain_rx_polarity_flip_physical{109.0}=0x0 +phy_chain_rx_polarity_flip_physical{110.0}=0x0 +phy_chain_rx_polarity_flip_physical{111.0}=0x1 +phy_chain_rx_polarity_flip_physical{112.0}=0x0 + +phy_chain_tx_lane_map_physical{113.0}=0x0312 +phy_chain_tx_polarity_flip_physical{113.0}=0x0 +phy_chain_tx_polarity_flip_physical{114.0}=0x0 +phy_chain_tx_polarity_flip_physical{115.0}=0x1 +phy_chain_tx_polarity_flip_physical{116.0}=0x0 +phy_chain_rx_lane_map_physical{113.0}=0x3120 +phy_chain_rx_polarity_flip_physical{113.0}=0x1 +phy_chain_rx_polarity_flip_physical{114.0}=0x1 +phy_chain_rx_polarity_flip_physical{115.0}=0x0 +phy_chain_rx_polarity_flip_physical{116.0}=0x1 + +phy_chain_tx_lane_map_physical{117.0}=0x0123 +phy_chain_tx_polarity_flip_physical{117.0}=0x1 +phy_chain_tx_polarity_flip_physical{118.0}=0x1 +phy_chain_tx_polarity_flip_physical{119.0}=0x1 +phy_chain_tx_polarity_flip_physical{120.0}=0x1 +phy_chain_rx_lane_map_physical{117.0}=0x1320 +phy_chain_rx_polarity_flip_physical{117.0}=0x1 +phy_chain_rx_polarity_flip_physical{118.0}=0x1 +phy_chain_rx_polarity_flip_physical{119.0}=0x1 +phy_chain_rx_polarity_flip_physical{120.0}=0x0 + +phy_chain_tx_lane_map_physical{121.0}=0x3120 +phy_chain_tx_polarity_flip_physical{121.0}=0x1 +phy_chain_tx_polarity_flip_physical{122.0}=0x0 +phy_chain_tx_polarity_flip_physical{123.0}=0x0 +phy_chain_tx_polarity_flip_physical{124.0}=0x1 +phy_chain_rx_lane_map_physical{121.0}=0x0123 +phy_chain_rx_polarity_flip_physical{121.0}=0x0 +phy_chain_rx_polarity_flip_physical{122.0}=0x1 +phy_chain_rx_polarity_flip_physical{123.0}=0x0 +phy_chain_rx_polarity_flip_physical{124.0}=0x1 + +phy_chain_tx_lane_map_physical{125.0}=0x0123 +phy_chain_tx_polarity_flip_physical{125.0}=0x0 +phy_chain_tx_polarity_flip_physical{126.0}=0x0 +phy_chain_tx_polarity_flip_physical{127.0}=0x0 +phy_chain_tx_polarity_flip_physical{128.0}=0x0 +phy_chain_rx_lane_map_physical{125.0}=0x0321 +phy_chain_rx_polarity_flip_physical{125.0}=0x0 +phy_chain_rx_polarity_flip_physical{126.0}=0x0 +phy_chain_rx_polarity_flip_physical{127.0}=0x1 +phy_chain_rx_polarity_flip_physical{128.0}=0x0 + +phy_chain_tx_lane_map_physical{81.0}=0x3201 +phy_chain_tx_polarity_flip_physical{81.0}=0x0 +phy_chain_tx_polarity_flip_physical{82.0}=0x1 +phy_chain_tx_polarity_flip_physical{83.0}=0x1 +phy_chain_tx_polarity_flip_physical{84.0}=0x1 +phy_chain_rx_lane_map_physical{81.0}=0x3120 +phy_chain_rx_polarity_flip_physical{81.0}=0x0 +phy_chain_rx_polarity_flip_physical{82.0}=0x0 +phy_chain_rx_polarity_flip_physical{83.0}=0x1 +phy_chain_rx_polarity_flip_physical{84.0}=0x0 + +phy_chain_tx_lane_map_physical{85.0}=0x0123 +phy_chain_tx_polarity_flip_physical{85.0}=0x1 +phy_chain_tx_polarity_flip_physical{86.0}=0x1 +phy_chain_tx_polarity_flip_physical{87.0}=0x1 +phy_chain_tx_polarity_flip_physical{88.0}=0x1 +phy_chain_rx_lane_map_physical{85.0}=0x0321 +phy_chain_rx_polarity_flip_physical{85.0}=0x1 +phy_chain_rx_polarity_flip_physical{86.0}=0x1 +phy_chain_rx_polarity_flip_physical{87.0}=0x0 +phy_chain_rx_polarity_flip_physical{88.0}=0x1 + +phy_chain_tx_lane_map_physical{89.0}=0x3210 +phy_chain_tx_polarity_flip_physical{89.0}=0x1 +phy_chain_tx_polarity_flip_physical{90.0}=0x1 +phy_chain_tx_polarity_flip_physical{91.0}=0x1 +phy_chain_tx_polarity_flip_physical{92.0}=0x1 +phy_chain_rx_lane_map_physical{89.0}=0x0123 +phy_chain_rx_polarity_flip_physical{89.0}=0x1 +phy_chain_rx_polarity_flip_physical{90.0}=0x0 +phy_chain_rx_polarity_flip_physical{91.0}=0x1 +phy_chain_rx_polarity_flip_physical{92.0}=0x0 + +phy_chain_tx_lane_map_physical{97.0}=0x0312 +phy_chain_tx_polarity_flip_physical{97.0}=0x0 +phy_chain_tx_polarity_flip_physical{98.0}=0x0 +phy_chain_tx_polarity_flip_physical{99.0}=0x1 +phy_chain_tx_polarity_flip_physical{100.0}=0x1 +phy_chain_rx_lane_map_physical{97.0}=0x0321 +phy_chain_rx_polarity_flip_physical{97.0}=0x1 +phy_chain_rx_polarity_flip_physical{98.0}=0x0 +phy_chain_rx_polarity_flip_physical{99.0}=0x1 +phy_chain_rx_polarity_flip_physical{100.0}=0x0 + + +l2_mem_entries=40960 +l3_mem_entries=40960 +l3_alpm_enable=2 +use_all_splithorizon_groups=1 diff --git a/device/quanta/x86_64-quanta_ix7_bwde-r0/custom_led.bin b/device/quanta/x86_64-quanta_ix7_bwde-r0/custom_led.bin new file mode 100644 index 000000000000..813addd1ac06 Binary files /dev/null and b/device/quanta/x86_64-quanta_ix7_bwde-r0/custom_led.bin differ diff --git a/device/quanta/x86_64-quanta_ix7_bwde-r0/default_sku b/device/quanta/x86_64-quanta_ix7_bwde-r0/default_sku new file mode 100644 index 000000000000..bd318bb8fc69 --- /dev/null +++ b/device/quanta/x86_64-quanta_ix7_bwde-r0/default_sku @@ -0,0 +1 @@ +Quanta-IX7-BWDE-32X t1 diff --git a/device/quanta/x86_64-quanta_ix7_bwde-r0/installer.conf b/device/quanta/x86_64-quanta_ix7_bwde-r0/installer.conf new file mode 100644 index 000000000000..90f773149c41 --- /dev/null +++ b/device/quanta/x86_64-quanta_ix7_bwde-r0/installer.conf @@ -0,0 +1,4 @@ +CONSOLE_PORT=0x3f8 +CONSOLE_DEV=0 +CONSOLE_SPEED=115200 + diff --git a/device/quanta/x86_64-quanta_ix7_bwde-r0/led_proc_init.soc b/device/quanta/x86_64-quanta_ix7_bwde-r0/led_proc_init.soc new file mode 100644 index 000000000000..7b049da0eab0 --- /dev/null +++ b/device/quanta/x86_64-quanta_ix7_bwde-r0/led_proc_init.soc @@ -0,0 +1,4 @@ +m0 load 0 0x3800 /usr/share/sonic/platform/custom_led.bin +led start + +rcload /usr/share/sonic/platform/preemphasis-32x100G.soc \ No newline at end of file diff --git a/device/quanta/x86_64-quanta_ix7_bwde-r0/plugins/eeprom.py b/device/quanta/x86_64-quanta_ix7_bwde-r0/plugins/eeprom.py new file mode 100644 index 000000000000..0a6121c3cd92 --- /dev/null +++ b/device/quanta/x86_64-quanta_ix7_bwde-r0/plugins/eeprom.py @@ -0,0 +1,12 @@ +try: + from sonic_eeprom import eeprom_tlvinfo +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class board(eeprom_tlvinfo.TlvInfoDecoder): + _TLV_INFO_MAX_LEN = 256 + + def __init__(self, name, path, cpld_root, ro): + self.eeprom_path = "/sys/bus/i2c/devices/3-0054/eeprom" + super(board, self).__init__(self.eeprom_path, 0, '', True) diff --git a/device/quanta/x86_64-quanta_ix7_bwde-r0/plugins/fanutil.py b/device/quanta/x86_64-quanta_ix7_bwde-r0/plugins/fanutil.py new file mode 100644 index 000000000000..2cf72ddf7e5b --- /dev/null +++ b/device/quanta/x86_64-quanta_ix7_bwde-r0/plugins/fanutil.py @@ -0,0 +1,110 @@ +# +# fanutil.py +# Platform-specific Fan status interface for SONiC +# + +import logging +import os.path + +try: + from sonic_fan.fan_base import FanBase +except ImportError as e: + raise ImportError (str(e) + "- required module not found") + +class FanUtil(FanBase): + """Platform-specific FANutil class""" + + SYS_FAN_NUM = 6 + NUM_FANS_PERTRAY = 2 + HWMON_PATH = '/sys/class/hwmon/hwmon2/' + FAN_INDEX_START = 18 + + logger = logging.getLogger(__name__) + + def __init__(self, log_level=logging.DEBUG): + FanBase.__init__(self) + self.num_fans = (self.SYS_FAN_NUM * self.NUM_FANS_PERTRAY) + + # Get sysfs attribute + def get_attr_value(self, attr_path): + + retval = 'ERR' + if (not os.path.isfile(attr_path)): + return retval + + try: + with open(attr_path, 'r') as fd: + retval = fd.read() + except Exception: + logging.error("Unable to open ", attr_path, " file !") + + retval = retval.rstrip('\r\n') + return retval + + def check_fan_index(self, index): + if index is None: + return False + + if index < 1 or index > self.num_fans: + logging.error("Invalid Fan index:", index) + return False + + return True + + def get_num_fans(self): + return self.num_fans + + def get_status(self, index): + if self.check_fan_index(index) == False: + return False + + fantray_speed_file = 'fan' + str(self.FAN_INDEX_START+(index-1)) + '_input' + fantray_speed = self.get_attr_value(self.HWMON_PATH + fantray_speed_file) + + if fantray_speed == '0.0' : + return False + + return True + + def get_presence(self, index): + if self.check_fan_index(index) == False: + return False + + fantray_present_file = 'fan' + str(self.FAN_INDEX_START+(index-1)) + '_present' + fantray_present = self.get_attr_value(self.HWMON_PATH + fantray_present_file) + + if fantray_present == '1' : + return True + + return False + + def get_direction(self, index): + if self.check_fan_index(index) == False: + return None + + fantray_direction_file = 'fan' + str(self.FAN_INDEX_START+(index-1)) + '_direction' + fantray_direction = self.get_attr_value(self.HWMON_PATH + fantray_direction_file) + + """ + 1: FB 2: BF + Since the fan is at rear of the switch, FB means Exhaust; BF means Intake + """ + if fantray_direction == '2': + return "INTAKE" + else: + return "EXHAUST" + + def get_speed(self, index): + if self.check_fan_index(index) == False: + return 0 + + fantray_speed_file = 'fan' + str(self.FAN_INDEX_START+(index-1)) + '_input' + fantray_speed = self.get_attr_value(self.HWMON_PATH + fantray_speed_file) + + return int(float(fantray_speed)) + + + def set_speed(self, val): + logging.error("Not allowed to set fan speed!") + + return False diff --git a/device/quanta/x86_64-quanta_ix7_bwde-r0/plugins/psuutil.py b/device/quanta/x86_64-quanta_ix7_bwde-r0/plugins/psuutil.py new file mode 100644 index 000000000000..1761fcd3d30e --- /dev/null +++ b/device/quanta/x86_64-quanta_ix7_bwde-r0/plugins/psuutil.py @@ -0,0 +1,251 @@ +# +# psuutil.py +# Platform-specific PSU status interface for SONiC +# + +import logging +import os.path + +try: + from sonic_psu.psu_base import PsuBase +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class PsuUtil(PsuBase): + """Platform-specific PSUutil class""" + + HWMON_PATH = '/sys/class/hwmon/hwmon2/' + PSU1_PREFIX = 'power39_' + PSU2_PREFIX = 'power49_' + MAX_PSUS = 2 + def __init__(self): + PsuBase.__init__(self) + + # Get sysfs attribute + def get_attr_value(self, attr_path): + + retval = 'ERR' + if (not os.path.isfile(attr_path)): + return retval + + try: + with open(attr_path, 'r') as fd: + retval = fd.read() + except Exception: + logging.error("Unable to open ", attr_path, " file !") + + retval = retval.rstrip('\r\n') + return retval + + def get_attr_filename(self, index, attr): + if (index == 1): + attr_file = self.PSU1_PREFIX + attr + elif (index == 2): + attr_file = self.PSU2_PREFIX + attr + else: + logging.error("Invalid PSU number:", index) + return '' + + return attr_file + + def get_num_psus(self): + """ + Retrieves the number of PSUs available on the device + :return: An integer, the number of PSUs available on the device + """ + + return self.MAX_PSUS + + def get_psu_status(self, index): + """ + Retrieves the oprational status of power supply unit (PSU) defined + by index + :param index: An integer, index of the PSU of which to query status + :return: Boolean, True if PSU is operating properly, False if PSU is\ + faulty + """ + status = False + + attr_filename = self.get_attr_filename(index, 'input') + if attr_filename == '': + return status + + attr_path = self.HWMON_PATH + attr_filename + attr_value = self.get_attr_value(attr_path) + + if (attr_value != 'ERR'): + attr_value = float(attr_value) + + # Check PSU status + if (attr_value != 0.0): + status = True + + return status + + def get_psu_presence(self, index): + """ + Retrieves the presence status of power supply unit (PSU) defined + by index + :param index: An integer, index of the PSU of which to query status + :return: Boolean, True if PSU is plugged, False if not + """ + status = False + + attr_filename = self.get_attr_filename(index, 'present') + if attr_filename == '': + return status + + attr_path = self.HWMON_PATH + attr_filename + attr_value = self.get_attr_value(attr_path) + + if (attr_value != 'ERR'): + attr_value = int(attr_value, 16) + # Check PSU status + if (attr_value == 1): + status = True + return status + + def get_powergood_status(self, index): + status = False + + attr_filename = self.get_attr_filename(index, 'input') + if attr_filename == '': + return status + + attr_path = self.HWMON_PATH + attr_filename + attr_value = self.get_attr_value(attr_path) + + if (attr_value != 'ERR'): + attr_value = float(attr_value) + + # Check PSU status + if (attr_value != 0.0): + status = True + + return status + + def get_model(self, index): + attr_filename = self.get_attr_filename(index, 'model') + if attr_filename == '': + return None + + attr_path = self.HWMON_PATH + attr_filename + attr_value = self.get_attr_value(attr_path) + + if (attr_value != 'ERR'): + return attr_value.rstrip() + + def get_mfr_id(self, index): + attr_filename = self.get_attr_filename(index, 'mfrid') + if attr_filename == '': + return None + + attr_path = self.HWMON_PATH + attr_filename + attr_value = self.get_attr_value(attr_path) + + if (attr_value != 'ERR'): + return attr_value.rstrip() + + def get_serial(self, index): + attr_filename = self.get_attr_filename(index, 'sn') + if attr_filename == '': + return None + + attr_path = self.HWMON_PATH + attr_filename + attr_value = self.get_attr_value(attr_path) + + if (attr_value != 'ERR'): + return attr_value.rstrip() + + def get_direction(self, index): + if (index == 1): + direction_file = 'fan37_direction' + elif (index == 2): + direction_file = 'fan47_direction' + else: + logging.error("Invalid PSU number:", index) + return None + + direction = self.get_attr_value(self.HWMON_PATH + direction_file) + direction = direction.rstrip() + + """ + 1: FB 2: BF + Since the fan is at rear of the switch, FB means Exhaust; BF means Intake + """ + if direction == '2': + return "INTAKE" + else: + return "EXHAUST" + + def get_output_voltage(self, index): + if (index == 1): + attr_file = 'in44_input' + elif (index == 2): + attr_file = 'in54_input' + else: + logging.error("Invalid PSU number:", index) + return 0.0 + + voltage = self.get_attr_value(self.HWMON_PATH + attr_file) + voltage = voltage.rstrip() + + if (voltage != 'ERR'): + voltage, dummy = voltage.split('.', 1) + else: + return 0.0 + + return float(voltage)/1000 + + def get_output_current(self, index): + if (index == 1): + attr_file = 'curr36_input' + elif (index == 2): + attr_file = 'curr46_input' + else: + logging.error("Invalid PSU number:", index) + return 0.0 + + current = self.get_attr_value(self.HWMON_PATH + attr_file) + current = current.rstrip() + + if (current != 'ERR'): + current, dummy = current.split('.',1) + else: + return 0.0 + + return float(current)/1000 + + def get_output_power(self, index): + attr_filename = self.get_attr_filename(index, 'input') + if attr_filename == '': + return 0.0 + + attr_path = self.HWMON_PATH + attr_filename + attr_value = self.get_attr_value(attr_path) + + if (attr_value != 'ERR'): + attr_value = float(attr_value) + else: + return 0.0 + + return float(attr_value/1000) + + def get_fan_rpm(self, index, fan_idx): + if (index == 1): + rpm_file = 'fan37_input' + elif (index == 2): + rpm_file = 'fan47_input' + else: + logging.error("Invalid PSU number:", index) + return 0 + + rpm = self.get_attr_value(self.HWMON_PATH + rpm_file) + rpm = rpm.rstrip() + if (rpm != 'ERR'): + rpm = float(rpm) + else: + return 0 + + return int(rpm) diff --git a/device/quanta/x86_64-quanta_ix7_bwde-r0/plugins/sfputil.py b/device/quanta/x86_64-quanta_ix7_bwde-r0/plugins/sfputil.py new file mode 100644 index 000000000000..1cc3a12b372c --- /dev/null +++ b/device/quanta/x86_64-quanta_ix7_bwde-r0/plugins/sfputil.py @@ -0,0 +1,172 @@ +# sfputil.py +# +# Platform-specific SFP transceiver interface for SONiC +# + +try: + import time + from sonic_sfp.sfputilbase import SfpUtilBase +except ImportError as e: + raise ImportError("%s - required module not found" % str(e)) + + +class SfpUtil(SfpUtilBase): + """Platform-specific SfpUtil class""" + + PORT_START = 1 + PORT_END = 32 + PORTS_IN_BLOCK = 32 + + _port_to_eeprom_mapping = {} + _port_to_i2c_mapping = { + 1 : 13, + 2 : 14, + 3 : 15, + 4 : 16, + 5 : 17, + 6 : 18, + 7 : 19, + 8 : 20, + 9 : 21, + 10 : 22, + 11 : 23, + 12 : 24, + 13 : 25, + 14 : 26, + 15 : 27, + 16 : 28, + 17 : 29, + 18 : 30, + 19 : 31, + 20 : 32, + 21 : 33, + 22 : 34, + 23 : 35, + 24 : 36, + 25 : 37, + 26 : 38, + 27 : 39, + 28 : 40, + 29 : 41, + 30 : 42, + 31 : 43, + 32 : 44 + } + + @property + def port_start(self): + return self.PORT_START + + @property + def port_end(self): + return self.PORT_END + + @property + def qsfp_ports(self): + return list(range(self.PORT_START, self.PORTS_IN_BLOCK + 1)) + + @property + def port_to_eeprom_mapping(self): + return self._port_to_eeprom_mapping + + def __init__(self): + eeprom_path = '/sys/bus/i2c/devices/{0}-0050/eeprom' + for x in range(self.port_start, self.port_end+1): + self.port_to_eeprom_mapping[x] = eeprom_path.format(self._port_to_i2c_mapping[x]) + SfpUtilBase.__init__(self) + + def get_presence(self, port_num): + # Check for invalid port_num + if port_num < self.port_start or port_num > self.port_end: + return False + + try: + reg_file = open("/sys/class/cpld-qsfp28/port-"+str(port_num)+"/module_present") + except IOError as e: + print("Error: unable to open file: %s" % str(e)) + return False + + reg_value = reg_file.readline().rstrip() + if reg_value == '1': + return True + + return False + + def get_low_power_mode(self, port_num): + # Check for invalid port_num + if port_num < self.port_start or port_num > self.port_end: + return False + + try: + reg_file = open("/sys/class/cpld-qsfp28/port-"+str(port_num)+"/lpmode") + except IOError as e: + print("Error: unable to open file: %s" % str(e)) + return False + + reg_value = int(reg_file.readline().rstrip()) + + if reg_value == 0: + return False + + return True + + def set_low_power_mode(self, port_num, lpmode): + # Check for invalid port_num + if port_num < self.port_start or port_num > self.port_end: + return False + + try: + reg_file = open("/sys/class/cpld-qsfp28/port-"+str(port_num)+"/lpmode", "r+") + except IOError as e: + print("Error: unable to open file: %s" % str(e)) + return False + + # LPMode is active high; set or clear the bit accordingly + if lpmode is True: + reg_value = 1 + else: + reg_value = 0 + + reg_file.write(hex(reg_value)) + reg_file.close() + + return True + + def reset(self, port_num): + # Check for invalid port_num + if port_num < self.port_start or port_num > self.port_end: + return False + + try: + reg_file = open("/sys/class/cpld-qsfp28/port-"+str(port_num)+"/reset", "r+") + except IOError as e: + print("Error: unable to open file: %s" % str(e)) + return False + + reg_value = 0 + reg_file.write(hex(reg_value)) + reg_file.close() + + # Sleep 2 second to allow it to settle + time.sleep(2) + + # Flip the value back write back to the register to take port out of reset + try: + reg_file = open("/sys/class/cpld-qsfp28/port-"+str(port_num)+"/reset", "r+") + except IOError as e: + print("Error: unable to open file: %s" % str(e)) + return False + + reg_value = 1 + reg_file.write(hex(reg_value)) + reg_file.close() + + return True + + def get_transceiver_change_event(self): + """ + TODO: This function need to be implemented + when decide to support monitoring SFP(Xcvrd) + on this platform. + """ + raise NotImplementedError diff --git a/device/quanta/x86_64-quanta_ix7_bwde-r0/pmon_daemon_control.json b/device/quanta/x86_64-quanta_ix7_bwde-r0/pmon_daemon_control.json new file mode 100644 index 000000000000..94592fa8cebc --- /dev/null +++ b/device/quanta/x86_64-quanta_ix7_bwde-r0/pmon_daemon_control.json @@ -0,0 +1,3 @@ +{ + "skip_ledd": true +} diff --git a/device/quanta/x86_64-quanta_ix7_bwde-r0/preemphasis-32x100G.soc b/device/quanta/x86_64-quanta_ix7_bwde-r0/preemphasis-32x100G.soc new file mode 100644 index 000000000000..986bb271ca1b --- /dev/null +++ b/device/quanta/x86_64-quanta_ix7_bwde-r0/preemphasis-32x100G.soc @@ -0,0 +1,546 @@ +# Pre-emphasis + +phy raw c45 0xa5 0x1 0xffde 0 +phy raw c45 0xa5 0x1 0xd130 0x4d +phy raw c45 0xa5 0x1 0xd131 0x0611 +phy raw c45 0xa5 0x1 0xd134 1 +phy raw c45 0xa5 0x1 0xffde 1 +phy raw c45 0xa5 0x1 0xd130 0x4d +phy raw c45 0xa5 0x1 0xd131 0x0611 +phy raw c45 0xa5 0x1 0xd134 1 +phy raw c45 0xa5 0x1 0xffde 2 +phy raw c45 0xa5 0x1 0xd130 0x4e +phy raw c45 0xa5 0x1 0xd131 0x0610 +phy raw c45 0xa5 0x1 0xd134 1 +phy raw c45 0xa5 0x1 0xffde 3 +phy raw c45 0xa5 0x1 0xd130 0x4e +phy raw c45 0xa5 0x1 0xd131 0x0610 +phy raw c45 0xa5 0x1 0xd134 1 + +phy raw c45 0xa9 0x1 0xffde 0 +phy raw c45 0xa9 0x1 0xd130 0x4e +phy raw c45 0xa9 0x1 0xd131 0x0610 +phy raw c45 0xa9 0x1 0xd134 1 +phy raw c45 0xa9 0x1 0xffde 1 +phy raw c45 0xa9 0x1 0xd130 0x4e +phy raw c45 0xa9 0x1 0xd131 0x0610 +phy raw c45 0xa9 0x1 0xd134 1 +phy raw c45 0xa9 0x1 0xffde 2 +phy raw c45 0xa9 0x1 0xd130 0x4e +phy raw c45 0xa9 0x1 0xd131 0x0610 +phy raw c45 0xa9 0x1 0xd134 1 +phy raw c45 0xa9 0x1 0xffde 3 +phy raw c45 0xa9 0x1 0xd130 0x4e +phy raw c45 0xa9 0x1 0xd131 0x0610 +phy raw c45 0xa9 0x1 0xd134 1 + +phy raw c45 0xc1 0x1 0xffde 0 +phy raw c45 0xc1 0x1 0xd130 0x4e +phy raw c45 0xc1 0x1 0xd131 0x0610 +phy raw c45 0xc1 0x1 0xd134 1 +phy raw c45 0xc1 0x1 0xffde 1 +phy raw c45 0xc1 0x1 0xd130 0x4d +phy raw c45 0xc1 0x1 0xd131 0x0611 +phy raw c45 0xc1 0x1 0xd134 1 +phy raw c45 0xc1 0x1 0xffde 2 +phy raw c45 0xc1 0x1 0xd130 0x4e +phy raw c45 0xc1 0x1 0xd131 0x0610 +phy raw c45 0xc1 0x1 0xd134 1 +phy raw c45 0xc1 0x1 0xffde 3 +phy raw c45 0xc1 0x1 0xd130 0x4e +phy raw c45 0xc1 0x1 0xd131 0x0610 +phy raw c45 0xc1 0x1 0xd134 1 + +phy raw c45 0xc5 0x1 0xffde 0 +phy raw c45 0xc5 0x1 0xd130 0x4e +phy raw c45 0xc5 0x1 0xd131 0x0610 +phy raw c45 0xc5 0x1 0xd134 1 +phy raw c45 0xc5 0x1 0xffde 1 +phy raw c45 0xc5 0x1 0xd130 0x4e +phy raw c45 0xc5 0x1 0xd131 0x0610 +phy raw c45 0xc5 0x1 0xd134 1 +phy raw c45 0xc5 0x1 0xffde 2 +phy raw c45 0xc5 0x1 0xd130 0x4d +phy raw c45 0xc5 0x1 0xd131 0x0611 +phy raw c45 0xc5 0x1 0xd134 1 +phy raw c45 0xc5 0x1 0xffde 3 +phy raw c45 0xc5 0x1 0xd130 0x4e +phy raw c45 0xc5 0x1 0xd131 0x0610 +phy raw c45 0xc5 0x1 0xd134 1 + +phy raw c45 0x81 0x1 0xffde 0 +phy raw c45 0x81 0x1 0xd130 0x4e +phy raw c45 0x81 0x1 0xd131 0x0610 +phy raw c45 0x81 0x1 0xd134 1 +phy raw c45 0x81 0x1 0xffde 1 +phy raw c45 0x81 0x1 0xd130 0x4d +phy raw c45 0x81 0x1 0xd131 0x0611 +phy raw c45 0x81 0x1 0xd134 1 +phy raw c45 0x81 0x1 0xffde 2 +phy raw c45 0x81 0x1 0xd130 0x4e +phy raw c45 0x81 0x1 0xd131 0x0610 +phy raw c45 0x81 0x1 0xd134 1 +phy raw c45 0x81 0x1 0xffde 3 +phy raw c45 0x81 0x1 0xd130 0x4e +phy raw c45 0x81 0x1 0xd131 0x0610 +phy raw c45 0x81 0x1 0xd134 1 + +phy raw c45 0x85 0x1 0xffde 0 +phy raw c45 0x85 0x1 0xd130 0x4e +phy raw c45 0x85 0x1 0xd131 0x0610 +phy raw c45 0x85 0x1 0xd134 1 +phy raw c45 0x85 0x1 0xffde 1 +phy raw c45 0x85 0x1 0xd130 0x4e +phy raw c45 0x85 0x1 0xd131 0x0610 +phy raw c45 0x85 0x1 0xd134 1 +phy raw c45 0x85 0x1 0xffde 2 +phy raw c45 0x85 0x1 0xd130 0x4e +phy raw c45 0x85 0x1 0xd131 0x0610 +phy raw c45 0x85 0x1 0xd134 1 +phy raw c45 0x85 0x1 0xffde 3 +phy raw c45 0x85 0x1 0xd130 0x4d +phy raw c45 0x85 0x1 0xd131 0x0611 +phy raw c45 0x85 0x1 0xd134 1 + +phy raw c45 0x89 0x1 0xffde 0 +phy raw c45 0x89 0x1 0xd130 0x50 +phy raw c45 0x89 0x1 0xd131 0x060e +phy raw c45 0x89 0x1 0xd134 1 +phy raw c45 0x89 0x1 0xffde 1 +phy raw c45 0x89 0x1 0xd130 0x50 +phy raw c45 0x89 0x1 0xd131 0x060e +phy raw c45 0x89 0x1 0xd134 1 +phy raw c45 0x89 0x1 0xffde 2 +phy raw c45 0x89 0x1 0xd130 0x50 +phy raw c45 0x89 0x1 0xd131 0x060e +phy raw c45 0x89 0x1 0xd134 1 +phy raw c45 0x89 0x1 0xffde 3 +phy raw c45 0x89 0x1 0xd130 0x50 +phy raw c45 0x89 0x1 0xd131 0x060e +phy raw c45 0x89 0x1 0xd134 1 + +phy raw c45 0x8d 0x1 0xffde 0 +phy raw c45 0x8d 0x1 0xd130 0x4f +phy raw c45 0x8d 0x1 0xd131 0x060f +phy raw c45 0x8d 0x1 0xd134 1 +phy raw c45 0x8d 0x1 0xffde 1 +phy raw c45 0x8d 0x1 0xd130 0x4f +phy raw c45 0x8d 0x1 0xd131 0x060f +phy raw c45 0x8d 0x1 0xd134 1 +phy raw c45 0x8d 0x1 0xffde 2 +phy raw c45 0x8d 0x1 0xd130 0x4f +phy raw c45 0x8d 0x1 0xd131 0x060f +phy raw c45 0x8d 0x1 0xd134 1 +phy raw c45 0x8d 0x1 0xffde 3 +phy raw c45 0x8d 0x1 0xd130 0x4f +phy raw c45 0x8d 0x1 0xd131 0x060f +phy raw c45 0x8d 0x1 0xd134 1 + +phy raw c45 0x91 0x1 0xffde 0 +phy raw c45 0x91 0x1 0xd130 0x50 +phy raw c45 0x91 0x1 0xd131 0x060e +phy raw c45 0x91 0x1 0xd134 1 +phy raw c45 0x91 0x1 0xffde 1 +phy raw c45 0x91 0x1 0xd130 0x50 +phy raw c45 0x91 0x1 0xd131 0x060e +phy raw c45 0x91 0x1 0xd134 1 +phy raw c45 0x91 0x1 0xffde 2 +phy raw c45 0x91 0x1 0xd130 0x50 +phy raw c45 0x91 0x1 0xd131 0x060e +phy raw c45 0x91 0x1 0xd134 1 +phy raw c45 0x91 0x1 0xffde 3 +phy raw c45 0x91 0x1 0xd130 0x50 +phy raw c45 0x91 0x1 0xd131 0x060e +phy raw c45 0x91 0x1 0xd134 1 + +phy raw c45 0x95 0x1 0xffde 0 +phy raw c45 0x95 0x1 0xd130 0x52 +phy raw c45 0x95 0x1 0xd131 0x060c +phy raw c45 0x95 0x1 0xd134 1 +phy raw c45 0x95 0x1 0xffde 1 +phy raw c45 0x95 0x1 0xd130 0x52 +phy raw c45 0x95 0x1 0xd131 0x060c +phy raw c45 0x95 0x1 0xd134 1 +phy raw c45 0x95 0x1 0xffde 2 +phy raw c45 0x95 0x1 0xd130 0x52 +phy raw c45 0x95 0x1 0xd131 0x060c +phy raw c45 0x95 0x1 0xd134 1 +phy raw c45 0x95 0x1 0xffde 3 +phy raw c45 0x95 0x1 0xd130 0x52 +phy raw c45 0x95 0x1 0xd131 0x060c +phy raw c45 0x95 0x1 0xd134 1 + +phy raw c45 0xa1 0x1 0xffde 0 +phy raw c45 0xa1 0x1 0xd130 0x52 +phy raw c45 0xa1 0x1 0xd131 0x060c +phy raw c45 0xa1 0x1 0xd134 1 +phy raw c45 0xa1 0x1 0xffde 1 +phy raw c45 0xa1 0x1 0xd130 0x52 +phy raw c45 0xa1 0x1 0xd131 0x060c +phy raw c45 0xa1 0x1 0xd134 1 +phy raw c45 0xa1 0x1 0xffde 2 +phy raw c45 0xa1 0x1 0xd130 0x52 +phy raw c45 0xa1 0x1 0xd131 0x060c +phy raw c45 0xa1 0x1 0xd134 1 +phy raw c45 0xa1 0x1 0xffde 3 +phy raw c45 0xa1 0x1 0xd130 0x52 +phy raw c45 0xa1 0x1 0xd131 0x060c +phy raw c45 0xa1 0x1 0xd134 1 + +phy raw c45 0xad 0x1 0xffde 0 +phy raw c45 0xad 0x1 0xd130 0x53 +phy raw c45 0xad 0x1 0xd131 0x060b +phy raw c45 0xad 0x1 0xd134 1 +phy raw c45 0xad 0x1 0xffde 1 +phy raw c45 0xad 0x1 0xd130 0x53 +phy raw c45 0xad 0x1 0xd131 0x060b +phy raw c45 0xad 0x1 0xd134 1 +phy raw c45 0xad 0x1 0xffde 2 +phy raw c45 0xad 0x1 0xd130 0x53 +phy raw c45 0xad 0x1 0xd131 0x060b +phy raw c45 0xad 0x1 0xd134 1 +phy raw c45 0xad 0x1 0xffde 3 +phy raw c45 0xad 0x1 0xd130 0x53 +phy raw c45 0xad 0x1 0xd131 0x060b +phy raw c45 0xad 0x1 0xd134 1 + +phy raw c45 0xc9 0x1 0xffde 0 +phy raw c45 0xc9 0x1 0xd130 0x53 +phy raw c45 0xc9 0x1 0xd131 0x060b +phy raw c45 0xc9 0x1 0xd134 1 +phy raw c45 0xc9 0x1 0xffde 1 +phy raw c45 0xc9 0x1 0xd130 0x53 +phy raw c45 0xc9 0x1 0xd131 0x060b +phy raw c45 0xc9 0x1 0xd134 1 +phy raw c45 0xc9 0x1 0xffde 2 +phy raw c45 0xc9 0x1 0xd130 0x53 +phy raw c45 0xc9 0x1 0xd131 0x060b +phy raw c45 0xc9 0x1 0xd134 1 +phy raw c45 0xc9 0x1 0xffde 3 +phy raw c45 0xc9 0x1 0xd130 0x53 +phy raw c45 0xc9 0x1 0xd131 0x060b +phy raw c45 0xc9 0x1 0xd134 1 + +phy raw c45 0xcd 0x1 0xffde 0 +phy raw c45 0xcd 0x1 0xd130 0x54 +phy raw c45 0xcd 0x1 0xd131 0x060a +phy raw c45 0xcd 0x1 0xd134 1 +phy raw c45 0xcd 0x1 0xffde 1 +phy raw c45 0xcd 0x1 0xd130 0x54 +phy raw c45 0xcd 0x1 0xd131 0x060a +phy raw c45 0xcd 0x1 0xd134 1 +phy raw c45 0xcd 0x1 0xffde 2 +phy raw c45 0xcd 0x1 0xd130 0x54 +phy raw c45 0xcd 0x1 0xd131 0x060a +phy raw c45 0xcd 0x1 0xd134 1 +phy raw c45 0xcd 0x1 0xffde 3 +phy raw c45 0xcd 0x1 0xd130 0x54 +phy raw c45 0xcd 0x1 0xd131 0x060a +phy raw c45 0xcd 0x1 0xd134 1 + +phy raw c45 0xd1 0x1 0xffde 0 +phy raw c45 0xd1 0x1 0xd130 0x56 +phy raw c45 0xd1 0x1 0xd131 0x0608 +phy raw c45 0xd1 0x1 0xd134 1 +phy raw c45 0xd1 0x1 0xffde 1 +phy raw c45 0xd1 0x1 0xd130 0x56 +phy raw c45 0xd1 0x1 0xd131 0x0608 +phy raw c45 0xd1 0x1 0xd134 1 +phy raw c45 0xd1 0x1 0xffde 2 +phy raw c45 0xd1 0x1 0xd130 0x56 +phy raw c45 0xd1 0x1 0xd131 0x0608 +phy raw c45 0xd1 0x1 0xd134 1 +phy raw c45 0xd1 0x1 0xffde 3 +phy raw c45 0xd1 0x1 0xd130 0x56 +phy raw c45 0xd1 0x1 0xd131 0x0608 +phy raw c45 0xd1 0x1 0xd134 1 + +phy raw c45 0xd5 0x1 0xffde 0 +phy raw c45 0xd5 0x1 0xd130 0x55 +phy raw c45 0xd5 0x1 0xd131 0x0609 +phy raw c45 0xd5 0x1 0xd134 1 +phy raw c45 0xd5 0x1 0xffde 1 +phy raw c45 0xd5 0x1 0xd130 0x55 +phy raw c45 0xd5 0x1 0xd131 0x0609 +phy raw c45 0xd5 0x1 0xd134 1 +phy raw c45 0xd5 0x1 0xffde 2 +phy raw c45 0xd5 0x1 0xd130 0x55 +phy raw c45 0xd5 0x1 0xd131 0x0609 +phy raw c45 0xd5 0x1 0xd134 1 +phy raw c45 0xd5 0x1 0xffde 3 +phy raw c45 0xd5 0x1 0xd130 0x55 +phy raw c45 0xd5 0x1 0xd131 0x0609 +phy raw c45 0xd5 0x1 0xd134 1 + +phy raw c45 0xe1 0x1 0xffde 0 +phy raw c45 0xe1 0x1 0xd130 0x56 +phy raw c45 0xe1 0x1 0xd131 0x0608 +phy raw c45 0xe1 0x1 0xd134 1 +phy raw c45 0xe1 0x1 0xffde 1 +phy raw c45 0xe1 0x1 0xd130 0x56 +phy raw c45 0xe1 0x1 0xd131 0x0608 +phy raw c45 0xe1 0x1 0xd134 1 +phy raw c45 0xe1 0x1 0xffde 2 +phy raw c45 0xe1 0x1 0xd130 0x56 +phy raw c45 0xe1 0x1 0xd131 0x0608 +phy raw c45 0xe1 0x1 0xd134 1 +phy raw c45 0xe1 0x1 0xffde 3 +phy raw c45 0xe1 0x1 0xd130 0x56 +phy raw c45 0xe1 0x1 0xd131 0x0608 +phy raw c45 0xe1 0x1 0xd134 1 + +phy raw c45 0xe5 0x1 0xffde 0 +phy raw c45 0xe5 0x1 0xd130 0x55 +phy raw c45 0xe5 0x1 0xd131 0x0609 +phy raw c45 0xe5 0x1 0xd134 1 +phy raw c45 0xe5 0x1 0xffde 1 +phy raw c45 0xe5 0x1 0xd130 0x55 +phy raw c45 0xe5 0x1 0xd131 0x0609 +phy raw c45 0xe5 0x1 0xd134 1 +phy raw c45 0xe5 0x1 0xffde 2 +phy raw c45 0xe5 0x1 0xd130 0x55 +phy raw c45 0xe5 0x1 0xd131 0x0609 +phy raw c45 0xe5 0x1 0xd134 1 +phy raw c45 0xe5 0x1 0xffde 3 +phy raw c45 0xe5 0x1 0xd130 0x55 +phy raw c45 0xe5 0x1 0xd131 0x0609 +phy raw c45 0xe5 0x1 0xd134 1 + +phy raw c45 0xe9 0x1 0xffde 0 +phy raw c45 0xe9 0x1 0xd130 0x56 +phy raw c45 0xe9 0x1 0xd131 0x0608 +phy raw c45 0xe9 0x1 0xd134 1 +phy raw c45 0xe9 0x1 0xffde 1 +phy raw c45 0xe9 0x1 0xd130 0x56 +phy raw c45 0xe9 0x1 0xd131 0x0608 +phy raw c45 0xe9 0x1 0xd134 1 +phy raw c45 0xe9 0x1 0xffde 2 +phy raw c45 0xe9 0x1 0xd130 0x56 +phy raw c45 0xe9 0x1 0xd131 0x0608 +phy raw c45 0xe9 0x1 0xd134 1 +phy raw c45 0xe9 0x1 0xffde 3 +phy raw c45 0xe9 0x1 0xd130 0x56 +phy raw c45 0xe9 0x1 0xd131 0x0608 +phy raw c45 0xe9 0x1 0xd134 1 + +phy raw c45 0xed 0x1 0xffde 0 +phy raw c45 0xed 0x1 0xd130 0x55 +phy raw c45 0xed 0x1 0xd131 0x0609 +phy raw c45 0xed 0x1 0xd134 1 +phy raw c45 0xed 0x1 0xffde 1 +phy raw c45 0xed 0x1 0xd130 0x53 +phy raw c45 0xed 0x1 0xd131 0x060b +phy raw c45 0xed 0x1 0xd134 1 +phy raw c45 0xed 0x1 0xffde 2 +phy raw c45 0xed 0x1 0xd130 0x54 +phy raw c45 0xed 0x1 0xd131 0x060a +phy raw c45 0xed 0x1 0xd134 1 +phy raw c45 0xed 0x1 0xffde 3 +phy raw c45 0xed 0x1 0xd130 0x54 +phy raw c45 0xed 0x1 0xd131 0x060a +phy raw c45 0xed 0x1 0xd134 1 + +phy raw c45 0x185 0x1 0xffde 0 +phy raw c45 0x185 0x1 0xd130 0x55 +phy raw c45 0x185 0x1 0xd131 0x0609 +phy raw c45 0x185 0x1 0xd134 1 +phy raw c45 0x185 0x1 0xffde 1 +phy raw c45 0x185 0x1 0xd130 0x55 +phy raw c45 0x185 0x1 0xd131 0x0609 +phy raw c45 0x185 0x1 0xd134 1 +phy raw c45 0x185 0x1 0xffde 2 +phy raw c45 0x185 0x1 0xd130 0x55 +phy raw c45 0x185 0x1 0xd131 0x0609 +phy raw c45 0x185 0x1 0xd134 1 +phy raw c45 0x185 0x1 0xffde 3 +phy raw c45 0x185 0x1 0xd130 0x55 +phy raw c45 0x185 0x1 0xd131 0x0609 +phy raw c45 0x185 0x1 0xd134 1 + +phy raw c45 0x18d 0x1 0xffde 0 +phy raw c45 0x18d 0x1 0xd130 0x54 +phy raw c45 0x18d 0x1 0xd131 0x060a +phy raw c45 0x18d 0x1 0xd134 1 +phy raw c45 0x18d 0x1 0xffde 1 +phy raw c45 0x18d 0x1 0xd130 0x53 +phy raw c45 0x18d 0x1 0xd131 0x060b +phy raw c45 0x18d 0x1 0xd134 1 +phy raw c45 0x18d 0x1 0xffde 2 +phy raw c45 0x18d 0x1 0xd130 0x53 +phy raw c45 0x18d 0x1 0xd131 0x060b +phy raw c45 0x18d 0x1 0xd134 1 +phy raw c45 0x18d 0x1 0xffde 3 +phy raw c45 0x18d 0x1 0xd130 0x53 +phy raw c45 0x18d 0x1 0xd131 0x060b +phy raw c45 0x18d 0x1 0xd134 1 + +phy raw c45 0x1a1 0x1 0xffde 0 +phy raw c45 0x1a1 0x1 0xd130 0x55 +phy raw c45 0x1a1 0x1 0xd131 0x0609 +phy raw c45 0x1a1 0x1 0xd134 1 +phy raw c45 0x1a1 0x1 0xffde 1 +phy raw c45 0x1a1 0x1 0xd130 0x54 +phy raw c45 0x1a1 0x1 0xd131 0x060a +phy raw c45 0x1a1 0x1 0xd134 1 +phy raw c45 0x1a1 0x1 0xffde 2 +phy raw c45 0x1a1 0x1 0xd130 0x55 +phy raw c45 0x1a1 0x1 0xd131 0x0609 +phy raw c45 0x1a1 0x1 0xd134 1 +phy raw c45 0x1a1 0x1 0xffde 3 +phy raw c45 0x1a1 0x1 0xd130 0x53 +phy raw c45 0x1a1 0x1 0xd131 0x060b +phy raw c45 0x1a1 0x1 0xd134 1 + +phy raw c45 0x1a5 0x1 0xffde 0 +phy raw c45 0x1a5 0x1 0xd130 0x54 +phy raw c45 0x1a5 0x1 0xd131 0x060a +phy raw c45 0x1a5 0x1 0xd134 1 +phy raw c45 0x1a5 0x1 0xffde 1 +phy raw c45 0x1a5 0x1 0xd130 0x53 +phy raw c45 0x1a5 0x1 0xd131 0x060b +phy raw c45 0x1a5 0x1 0xd134 1 +phy raw c45 0x1a5 0x1 0xffde 2 +phy raw c45 0x1a5 0x1 0xd130 0x53 +phy raw c45 0x1a5 0x1 0xd131 0x060b +phy raw c45 0x1a5 0x1 0xd134 1 +phy raw c45 0x1a5 0x1 0xffde 3 +phy raw c45 0x1a5 0x1 0xd130 0x53 +phy raw c45 0x1a5 0x1 0xd131 0x060b +phy raw c45 0x1a5 0x1 0xd134 1 + +phy raw c45 0x1a9 0x1 0xffde 0 +phy raw c45 0x1a9 0x1 0xd130 0x54 +phy raw c45 0x1a9 0x1 0xd131 0x060a +phy raw c45 0x1a9 0x1 0xd134 1 +phy raw c45 0x1a9 0x1 0xffde 1 +phy raw c45 0x1a9 0x1 0xd130 0x51 +phy raw c45 0x1a9 0x1 0xd131 0x060d +phy raw c45 0x1a9 0x1 0xd134 1 +phy raw c45 0x1a9 0x1 0xffde 2 +phy raw c45 0x1a9 0x1 0xd130 0x52 +phy raw c45 0x1a9 0x1 0xd131 0x060c +phy raw c45 0x1a9 0x1 0xd134 1 +phy raw c45 0x1a9 0x1 0xffde 3 +phy raw c45 0x1a9 0x1 0xd130 0x52 +phy raw c45 0x1a9 0x1 0xd131 0x060c +phy raw c45 0x1a9 0x1 0xd134 1 + +phy raw c45 0x1ad 0x1 0xffde 0 +phy raw c45 0x1ad 0x1 0xd130 0x51 +phy raw c45 0x1ad 0x1 0xd131 0x060d +phy raw c45 0x1ad 0x1 0xd134 1 +phy raw c45 0x1ad 0x1 0xffde 1 +phy raw c45 0x1ad 0x1 0xd130 0x4f +phy raw c45 0x1ad 0x1 0xd131 0x060f +phy raw c45 0x1ad 0x1 0xd134 1 +phy raw c45 0x1ad 0x1 0xffde 2 +phy raw c45 0x1ad 0x1 0xd130 0x4f +phy raw c45 0x1ad 0x1 0xd131 0x060f +phy raw c45 0x1ad 0x1 0xd134 1 +phy raw c45 0x1ad 0x1 0xffde 3 +phy raw c45 0x1ad 0x1 0xd130 0x4f +phy raw c45 0x1ad 0x1 0xd131 0x060f +phy raw c45 0x1ad 0x1 0xd134 1 + +phy raw c45 0x1b1 0x1 0xffde 0 +phy raw c45 0x1b1 0x1 0xd130 0x4f +phy raw c45 0x1b1 0x1 0xd131 0x060f +phy raw c45 0x1b1 0x1 0xd134 1 +phy raw c45 0x1b1 0x1 0xffde 1 +phy raw c45 0x1b1 0x1 0xd130 0x4f +phy raw c45 0x1b1 0x1 0xd131 0x060f +phy raw c45 0x1b1 0x1 0xd134 1 +phy raw c45 0x1b1 0x1 0xffde 2 +phy raw c45 0x1b1 0x1 0xd130 0x4f +phy raw c45 0x1b1 0x1 0xd131 0x060f +phy raw c45 0x1b1 0x1 0xd134 1 +phy raw c45 0x1b1 0x1 0xffde 3 +phy raw c45 0x1b1 0x1 0xd130 0x4f +phy raw c45 0x1b1 0x1 0xd131 0x060f +phy raw c45 0x1b1 0x1 0xd134 1 + +phy raw c45 0x1b5 0x1 0xffde 0 +phy raw c45 0x1b5 0x1 0xd130 0x4e +phy raw c45 0x1b5 0x1 0xd131 0x0610 +phy raw c45 0x1b5 0x1 0xd134 1 +phy raw c45 0x1b5 0x1 0xffde 1 +phy raw c45 0x1b5 0x1 0xd130 0x4d +phy raw c45 0x1b5 0x1 0xd131 0x0611 +phy raw c45 0x1b5 0x1 0xd134 1 +phy raw c45 0x1b5 0x1 0xffde 2 +phy raw c45 0x1b5 0x1 0xd130 0x4d +phy raw c45 0x1b5 0x1 0xd131 0x0611 +phy raw c45 0x1b5 0x1 0xd134 1 +phy raw c45 0x1b5 0x1 0xffde 3 +phy raw c45 0x1b5 0x1 0xd130 0x4d +phy raw c45 0x1b5 0x1 0xd131 0x0611 +phy raw c45 0x1b5 0x1 0xd134 1 + +phy raw c45 0xf1 0x1 0xffde 0 +phy raw c45 0xf1 0x1 0xd130 0x4f +phy raw c45 0xf1 0x1 0xd131 0x060f +phy raw c45 0xf1 0x1 0xd134 1 +phy raw c45 0xf1 0x1 0xffde 1 +phy raw c45 0xf1 0x1 0xd130 0x4f +phy raw c45 0xf1 0x1 0xd131 0x060f +phy raw c45 0xf1 0x1 0xd134 1 +phy raw c45 0xf1 0x1 0xffde 2 +phy raw c45 0xf1 0x1 0xd130 0x4f +phy raw c45 0xf1 0x1 0xd131 0x060f +phy raw c45 0xf1 0x1 0xd134 1 +phy raw c45 0xf1 0x1 0xffde 3 +phy raw c45 0xf1 0x1 0xd130 0x4f +phy raw c45 0xf1 0x1 0xd131 0x060f +phy raw c45 0xf1 0x1 0xd134 1 + +phy raw c45 0xf5 0x1 0xffde 0 +phy raw c45 0xf5 0x1 0xd130 0x4d +phy raw c45 0xf5 0x1 0xd131 0x0611 +phy raw c45 0xf5 0x1 0xd134 1 +phy raw c45 0xf5 0x1 0xffde 1 +phy raw c45 0xf5 0x1 0xd130 0x4d +phy raw c45 0xf5 0x1 0xd131 0x0611 +phy raw c45 0xf5 0x1 0xd134 1 +phy raw c45 0xf5 0x1 0xffde 2 +phy raw c45 0xf5 0x1 0xd130 0x4d +phy raw c45 0xf5 0x1 0xd131 0x0611 +phy raw c45 0xf5 0x1 0xd134 1 +phy raw c45 0xf5 0x1 0xffde 3 +phy raw c45 0xf5 0x1 0xd130 0x4d +phy raw c45 0xf5 0x1 0xd131 0x0611 +phy raw c45 0xf5 0x1 0xd134 1 + +phy raw c45 0x181 0x1 0xffde 0 +phy raw c45 0x181 0x1 0xd130 0x4e +phy raw c45 0x181 0x1 0xd131 0x0610 +phy raw c45 0x181 0x1 0xd134 1 +phy raw c45 0x181 0x1 0xffde 1 +phy raw c45 0x181 0x1 0xd130 0x4e +phy raw c45 0x181 0x1 0xd131 0x0610 +phy raw c45 0x181 0x1 0xd134 1 +phy raw c45 0x181 0x1 0xffde 2 +phy raw c45 0x181 0x1 0xd130 0x4e +phy raw c45 0x181 0x1 0xd131 0x0610 +phy raw c45 0x181 0x1 0xd134 1 +phy raw c45 0x181 0x1 0xffde 3 +phy raw c45 0x181 0x1 0xd130 0x4e +phy raw c45 0x181 0x1 0xd131 0x0610 +phy raw c45 0x181 0x1 0xd134 1 + +phy raw c45 0x189 0x1 0xffde 0 +phy raw c45 0x189 0x1 0xd130 0x4d +phy raw c45 0x189 0x1 0xd131 0x0611 +phy raw c45 0x189 0x1 0xd134 1 +phy raw c45 0x189 0x1 0xffde 1 +phy raw c45 0x189 0x1 0xd130 0x4d +phy raw c45 0x189 0x1 0xd131 0x0611 +phy raw c45 0x189 0x1 0xd134 1 +phy raw c45 0x189 0x1 0xffde 2 +phy raw c45 0x189 0x1 0xd130 0x4d +phy raw c45 0x189 0x1 0xd131 0x0611 +phy raw c45 0x189 0x1 0xd134 1 +phy raw c45 0x189 0x1 0xffde 3 +phy raw c45 0x189 0x1 0xd130 0x4d +phy raw c45 0x189 0x1 0xd131 0x0611 +phy raw c45 0x189 0x1 0xd134 1 + diff --git a/device/quanta/x86_64-quanta_ix7_rglbmc-r0/Quanta-IX7-32X/buffers.json.j2 b/device/quanta/x86_64-quanta_ix7_rglbmc-r0/Quanta-IX7-32X/buffers.json.j2 new file mode 100644 index 000000000000..b67cf577ab75 --- /dev/null +++ b/device/quanta/x86_64-quanta_ix7_rglbmc-r0/Quanta-IX7-32X/buffers.json.j2 @@ -0,0 +1,3 @@ +{%- set default_topo = 't1' %} +{%- include 'buffers_config.j2' %} + diff --git a/device/quanta/x86_64-quanta_ix7_rglbmc-r0/Quanta-IX7-32X/buffers_defaults_def.j2 b/device/quanta/x86_64-quanta_ix7_rglbmc-r0/Quanta-IX7-32X/buffers_defaults_def.j2 new file mode 100644 index 000000000000..740cfdf79e96 --- /dev/null +++ b/device/quanta/x86_64-quanta_ix7_rglbmc-r0/Quanta-IX7-32X/buffers_defaults_def.j2 @@ -0,0 +1,46 @@ +{%- set default_cable = '300m' %} + +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {% for port_idx in range(0,32) %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} + {% endfor %} +{%- endmacro %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + "xoff": "4625920", + "size": "12766208", + "type": "ingress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "12766208", + "type": "egress", + "mode": "static" + }, + "egress_lossy_pool": { + "size": "7326924", + "type": "egress", + "mode": "dynamic" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "dynamic_th":"3" + }, + "egress_lossless_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"0", + "static_th":"12766208" + }, + "egress_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"1518", + "dynamic_th":"3" + } + }, +{%- endmacro %} diff --git a/device/quanta/x86_64-quanta_ix7_rglbmc-r0/Quanta-IX7-32X/buffers_defaults_t0.j2 b/device/quanta/x86_64-quanta_ix7_rglbmc-r0/Quanta-IX7-32X/buffers_defaults_t0.j2 new file mode 100644 index 000000000000..44fcf21887a6 --- /dev/null +++ b/device/quanta/x86_64-quanta_ix7_rglbmc-r0/Quanta-IX7-32X/buffers_defaults_t0.j2 @@ -0,0 +1,45 @@ +{%- set default_cable = '300m' %} + +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {% for port_idx in range(0,32) %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} + {% endfor %} +{%- endmacro %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "12766208", + "type": "ingress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "12766208", + "type": "egress", + "mode": "static" + }, + "egress_lossy_pool": { + "size": "7326924", + "type": "egress", + "mode": "dynamic" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "dynamic_th":"3" + }, + "egress_lossless_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"0", + "static_th":"12766208" + }, + "egress_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"1518", + "dynamic_th":"3" + } + }, +{%- endmacro %} diff --git a/device/quanta/x86_64-quanta_ix7_rglbmc-r0/Quanta-IX7-32X/buffers_defaults_t1.j2 b/device/quanta/x86_64-quanta_ix7_rglbmc-r0/Quanta-IX7-32X/buffers_defaults_t1.j2 new file mode 100644 index 000000000000..5fe9cabcfd34 --- /dev/null +++ b/device/quanta/x86_64-quanta_ix7_rglbmc-r0/Quanta-IX7-32X/buffers_defaults_t1.j2 @@ -0,0 +1,46 @@ +{%- set default_cable = '300m' %} + +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {% for port_idx in range(0,32) %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} + {% endfor %} +{%- endmacro %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + "xoff": "196608", + "size": "12766208", + "type": "ingress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "33004032", + "type": "egress", + "mode": "static" + }, + "egress_lossy_pool": { + "size": "12766208", + "type": "egress", + "mode": "dynamic" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "dynamic_th":"3" + }, + "egress_lossless_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"0", + "static_th":"33004032" + }, + "egress_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"1518", + "dynamic_th":"3" + } + }, +{%- endmacro %} diff --git a/device/quanta/x86_64-quanta_ix7_rglbmc-r0/Quanta-IX7-32X/l2/config b/device/quanta/x86_64-quanta_ix7_rglbmc-r0/Quanta-IX7-32X/l2/config new file mode 100644 index 000000000000..b2d4a1e80592 --- /dev/null +++ b/device/quanta/x86_64-quanta_ix7_rglbmc-r0/Quanta-IX7-32X/l2/config @@ -0,0 +1,3 @@ +l2_mem_entries=294912 +l3_mem_entries=16384 +l3_alpm_enable=0 diff --git a/device/quanta/x86_64-quanta_ix7_rglbmc-r0/Quanta-IX7-32X/l3/config b/device/quanta/x86_64-quanta_ix7_rglbmc-r0/Quanta-IX7-32X/l3/config new file mode 100644 index 000000000000..fff0cf54b08a --- /dev/null +++ b/device/quanta/x86_64-quanta_ix7_rglbmc-r0/Quanta-IX7-32X/l3/config @@ -0,0 +1,5 @@ +l2_mem_entries=40960 +l3_mem_entries=40960 +l3_alpm_enable=2 +use_all_splithorizon_groups=1 +sai_tunnel_support=1 diff --git a/device/quanta/x86_64-quanta_ix7_rglbmc-r0/Quanta-IX7-32X/pg_profile_lookup.ini b/device/quanta/x86_64-quanta_ix7_rglbmc-r0/Quanta-IX7-32X/pg_profile_lookup.ini new file mode 100644 index 000000000000..6d91d03ae684 --- /dev/null +++ b/device/quanta/x86_64-quanta_ix7_rglbmc-r0/Quanta-IX7-32X/pg_profile_lookup.ini @@ -0,0 +1,17 @@ +# PG lossless profiles. +# speed cable size xon xoff threshold xon_offset + 10000 5m 9427 0 50176 1 3584 + 25000 5m 9427 0 50176 1 3584 + 40000 5m 9427 0 50176 1 3584 + 50000 5m 9427 0 50176 1 3584 + 100000 5m 9427 0 50176 1 3584 + 10000 40m 9427 0 50176 1 3584 + 25000 40m 9427 0 50176 1 3584 + 40000 40m 9427 0 50176 1 3584 + 50000 40m 9427 0 50176 1 3584 + 100000 40m 9427 0 50176 1 3584 + 10000 300m 9427 0 50176 1 3584 + 25000 300m 9427 0 50176 1 3584 + 40000 300m 9427 0 50176 1 3584 + 50000 300m 9427 0 50176 1 3584 + 100000 300m 9427 0 50176 1 3584 diff --git a/device/quanta/x86_64-quanta_ix7_rglbmc-r0/Quanta-IX7-32X/platform-def.json b/device/quanta/x86_64-quanta_ix7_rglbmc-r0/Quanta-IX7-32X/platform-def.json new file mode 100644 index 000000000000..ed3f9fcbf2bf --- /dev/null +++ b/device/quanta/x86_64-quanta_ix7_rglbmc-r0/Quanta-IX7-32X/platform-def.json @@ -0,0 +1,32 @@ +{ + "fec-mode": { + "Ethernet0-127": { + "1": { + "10000": [ "none", "fc" ], + "25000": [ "none", "rs" ] + }, + "2": { + "20000": [ "none", "fc" ], + "50000": [ "none", "rs" ] + }, + "4": { + "40000": [ "none", "fc" ], + "100000": [ "none", "rs" ] + } + } + }, + "default-fec-mode": { + "Ethernet0-127": { + "4": { + "40000": "none", + "100000": "rs" + } + } + }, + "native-port-supported-speeds": { + "Ethernet0-127": { + "4": ["100000","40000"] + } + } +} + diff --git a/device/quanta/x86_64-quanta_ix7_rglbmc-r0/Quanta-IX7-32X/qos.json.j2 b/device/quanta/x86_64-quanta_ix7_rglbmc-r0/Quanta-IX7-32X/qos.json.j2 new file mode 100644 index 000000000000..ee67c6e26221 --- /dev/null +++ b/device/quanta/x86_64-quanta_ix7_rglbmc-r0/Quanta-IX7-32X/qos.json.j2 @@ -0,0 +1 @@ +{%- include 'qos_config_t1.j2' %} diff --git a/device/quanta/x86_64-quanta_ix7_rglbmc-r0/Quanta-IX7-32X/qos_config_t1.j2 b/device/quanta/x86_64-quanta_ix7_rglbmc-r0/Quanta-IX7-32X/qos_config_t1.j2 new file mode 100644 index 000000000000..5fe5324a85c1 --- /dev/null +++ b/device/quanta/x86_64-quanta_ix7_rglbmc-r0/Quanta-IX7-32X/qos_config_t1.j2 @@ -0,0 +1,175 @@ +{%- set PORT_ALL = [] %} +{%- for port in PORT %} + {%- if PORT_ALL.append(port) %}{% endif %} +{%- endfor %} +{%- if PORT_ALL | sort_by_port_index %}{% endif %} + +{%- set port_names_list_all = [] %} +{%- for port in PORT_ALL %} + {%- if port_names_list_all.append(port) %}{% endif %} +{%- endfor %} +{%- set port_names_all = port_names_list_all | join(',') -%} + + +{%- set PORT_ACTIVE = [] %} +{%- if DEVICE_NEIGHBOR is not defined %} + {%- set PORT_ACTIVE = PORT_ALL %} +{%- else %} + {%- for port in DEVICE_NEIGHBOR.keys() %} + {%- if PORT_ACTIVE.append(port) %}{%- endif %} + {%- endfor %} +{%- endif %} +{%- if PORT_ACTIVE | sort_by_port_index %}{% endif %} + +{%- set port_names_list_active = [] %} +{%- for port in PORT_ACTIVE %} + {%- if port_names_list_active.append(port) %}{%- endif %} +{%- endfor %} +{%- set port_names_active = port_names_list_active | join(',') -%} + + +{%- set pfc_to_pg_map_supported_asics = ['mellanox', 'barefoot', 'marvell'] -%} + + +{ +{% if generate_tc_to_pg_map is defined %} + {{- generate_tc_to_pg_map() }} +{% else %} + "TC_TO_PRIORITY_GROUP_MAP": { + "AZURE": { + "0": "0", + "1": "0", + "2": "0", + "3": "3", + "4": "4", + "5": "0", + "6": "0", + "7": "7" + } + }, +{% endif %} + "MAP_PFC_PRIORITY_TO_QUEUE": { + "AZURE": { + "0": "0", + "1": "1", + "2": "2", + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7" + } + }, + "TC_TO_QUEUE_MAP": { + "AZURE": { + "0": "0", + "1": "1", + "2": "2", + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7" + } + }, + "DSCP_TO_TC_MAP": { + "AZURE": { + "0" : "1", + "1" : "1", + "2" : "1", + "3" : "3", + "4" : "4", + "5" : "2", + "6" : "1", + "7" : "1", + "8" : "0", + "9" : "1", + "10": "1", + "11": "1", + "12": "1", + "13": "1", + "14": "1", + "15": "1", + "16": "1", + "17": "1", + "18": "1", + "19": "1", + "20": "1", + "21": "1", + "22": "1", + "23": "1", + "24": "1", + "25": "1", + "26": "1", + "27": "1", + "28": "1", + "29": "1", + "30": "1", + "31": "1", + "32": "1", + "33": "1", + "34": "1", + "35": "1", + "36": "1", + "37": "1", + "38": "1", + "39": "1", + "40": "1", + "41": "1", + "42": "1", + "43": "1", + "44": "1", + "45": "1", + "46": "5", + "47": "1", + "48": "6", + "49": "1", + "50": "1", + "51": "1", + "52": "1", + "53": "1", + "54": "1", + "55": "1", + "56": "1", + "57": "1", + "58": "1", + "59": "1", + "60": "1", + "61": "1", + "62": "1", + "63": "1" + } + }, + "SCHEDULER": { + "scheduler.0": { + "type" : "DWRR", + "weight": "14" + }, + "scheduler.1": { + "type" : "DWRR", + "weight": "15" + } + }, +{% if asic_type in pfc_to_pg_map_supported_asics %} + "PFC_PRIORITY_TO_PRIORITY_GROUP_MAP": { + "AZURE": { + "3": "3", + "4": "4" + } + }, +{% endif %} + "PORT_QOS_MAP": { +{% for port in PORT_ACTIVE %} + "{{ port }}": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", +{% if asic_type in pfc_to_pg_map_supported_asics %} + "pfc_to_pg_map" : "[PFC_PRIORITY_TO_PRIORITY_GROUP_MAP|AZURE]", +{% endif %} + "pfc_enable" : "3,4" + }{% if not loop.last %},{% endif %} +{% endfor %} + } +} diff --git a/device/quanta/x86_64-quanta_ix7_rglbmc-r0/Quanta-IX7-32X/td3-ix7-32x100G.config.bcm b/device/quanta/x86_64-quanta_ix7_rglbmc-r0/Quanta-IX7-32X/td3-ix7-32x100G.config.bcm index aaea0380e50b..43ccba2a4956 100644 --- a/device/quanta/x86_64-quanta_ix7_rglbmc-r0/Quanta-IX7-32X/td3-ix7-32x100G.config.bcm +++ b/device/quanta/x86_64-quanta_ix7_rglbmc-r0/Quanta-IX7-32X/td3-ix7-32x100G.config.bcm @@ -1,36 +1,45 @@ -bcm_tunnel_term_compatible_mode=1 +sai_load_hw_config=/etc/bcm/flex/bcm56870_a0_issu/b870.6.4.1/ +#polarity/lanemap is using TH2 style. core_clock_frequency=1525 dpp_clock_ratio=2:3 -parity_enable=0 + +oversubscribe_mode=1 + +#RIOT Enable +riot_enable=1 +riot_overlay_l3_intf_mem_size=4096 +riot_overlay_l3_egress_mem_size=32768 +l3_ecmp_levels=2 +riot_overlay_ecmp_resilient_hash_size=16384 + +pbmp_xport_xe=0x3ffffffffffffffffffffffffffffffffe + +port_flex_enable=1 mem_cache_enable=0 -l2_mem_entries=40960 -l3_mem_entries=40960 -fpem_mem_entries=16384 + +l3_alpm_ipv6_128b_bkt_rsvd=1 +fpem_mem_entries=0 +ifp_inports_support_enable=1 l2xmsg_mode=1 +# Platform specfic bcm_num_cos=10 +default_cpu_tx_queue=9 bcm_stat_interval=2000000 cdma_timeout_usec=3000000 - -ifp_inports_support_enable=1 ipv6_lpm_128b_enable=0x1 l3_max_ecmp_mode=1 -l3_alpm_enable=2 lpm_scaling_enable=0 - +max_vp_lags=0 miim_intr_enable=0 module_64ports=1 - schan_intr_enable=0 -skip_L2_USER_ENTRY=0 stable_size=0x5500000 tdma_timeout_usec=3000000 - +skip_L2_USER_ENTRY=0 +bcm_tunnel_term_compatible_mode=1 +phy_an_c73=1 # portmap settings -oversubscribe_mode=1 -pbmp_xport_xe=0x4888888888888888c2222222222222222 - -port_flex_enable=1 portmap_1=1:100 portmap_5=5:100 @@ -68,9 +77,11 @@ portmap_119=117:100 portmap_123=121:100 portmap_127=125:100 -# datapath port -- merlin core -portmap_66=129:10:m -portmap_130=128:10:m +# datapath port -- MerlinCore +#Hide these to prevent SAI from initializing them...they are physically not on system +#front panel +#portmap_66=129:10:m +#portmap_130=128:10:m # loopback port portmap_65=130:10 @@ -78,41 +89,167 @@ portmap_131=131:10 # port order remap dport_map_port_29=1 -dport_map_port_33=2 -dport_map_port_41=3 -dport_map_port_45=4 -dport_map_port_1=5 -dport_map_port_5=6 -dport_map_port_9=7 -dport_map_port_13=8 -dport_map_port_17=9 -dport_map_port_21=10 -dport_map_port_25=11 -dport_map_port_37=12 -dport_map_port_49=13 -dport_map_port_53=14 -dport_map_port_57=15 -dport_map_port_61=16 - -dport_map_port_67=17 -dport_map_port_71=18 -dport_map_port_75=19 -dport_map_port_79=20 -dport_map_port_95=21 -dport_map_port_103=22 -dport_map_port_107=23 -dport_map_port_111=24 -dport_map_port_115=25 -dport_map_port_119=26 -dport_map_port_123=27 -dport_map_port_127=28 -dport_map_port_83=29 -dport_map_port_87=30 -dport_map_port_91=31 -dport_map_port_99=32 - -dport_map_port_66=33 -dport_map_port_130=34 +dport_map_port_30=2 +dport_map_port_31=3 +dport_map_port_32=4 + +dport_map_port_33=5 +dport_map_port_34=6 +dport_map_port_35=7 +dport_map_port_36=8 + +dport_map_port_41=9 +dport_map_port_42=10 +dport_map_port_43=11 +dport_map_port_44=12 + +dport_map_port_45=13 +dport_map_port_46=14 +dport_map_port_47=15 +dport_map_port_48=16 + +dport_map_port_1=17 +dport_map_port_2=18 +dport_map_port_3=19 +dport_map_port_4=20 + +dport_map_port_5=21 +dport_map_port_6=22 +dport_map_port_7=23 +dport_map_port_8=24 + +dport_map_port_9=25 +dport_map_port_10=26 +dport_map_port_11=27 +dport_map_port_12=28 + +dport_map_port_13=29 +dport_map_port_14=30 +dport_map_port_15=31 +dport_map_port_16=32 + +dport_map_port_17=33 +dport_map_port_18=34 +dport_map_port_19=35 +dport_map_port_20=36 + +dport_map_port_21=37 +dport_map_port_22=38 +dport_map_port_23=39 +dport_map_port_24=40 + +dport_map_port_25=41 +dport_map_port_26=42 +dport_map_port_27=43 +dport_map_port_28=44 + +dport_map_port_37=45 +dport_map_port_38=46 +dport_map_port_39=47 +dport_map_port_40=48 + +dport_map_port_49=49 +dport_map_port_50=50 +dport_map_port_51=51 +dport_map_port_52=52 + +dport_map_port_53=53 +dport_map_port_54=54 +dport_map_port_55=55 +dport_map_port_56=56 + +dport_map_port_57=57 +dport_map_port_58=58 +dport_map_port_59=59 +dport_map_port_60=60 + +dport_map_port_61=61 +dport_map_port_62=62 +dport_map_port_63=63 +dport_map_port_64=64 + +dport_map_port_67=65 +dport_map_port_68=66 +dport_map_port_69=67 +dport_map_port_70=68 + +dport_map_port_71=69 +dport_map_port_72=70 +dport_map_port_73=71 +dport_map_port_74=72 + +dport_map_port_75=73 +dport_map_port_76=74 +dport_map_port_77=75 +dport_map_port_78=76 + +dport_map_port_79=77 +dport_map_port_80=78 +dport_map_port_81=79 +dport_map_port_82=80 + +dport_map_port_95=81 +dport_map_port_96=82 +dport_map_port_97=83 +dport_map_port_98=84 + +dport_map_port_103=85 +dport_map_port_104=86 +dport_map_port_105=87 +dport_map_port_106=88 + +dport_map_port_107=89 +dport_map_port_108=90 +dport_map_port_109=91 +dport_map_port_110=92 + +dport_map_port_111=93 +dport_map_port_112=94 +dport_map_port_113=95 +dport_map_port_114=96 + +dport_map_port_115=97 +dport_map_port_116=98 +dport_map_port_117=99 +dport_map_port_118=100 + +dport_map_port_119=101 +dport_map_port_120=102 +dport_map_port_121=103 +dport_map_port_122=104 + +dport_map_port_123=105 +dport_map_port_124=106 +dport_map_port_125=107 +dport_map_port_126=108 + +dport_map_port_127=109 +dport_map_port_128=110 +dport_map_port_129=111 +dport_map_port_130=112 + +dport_map_port_83=113 +dport_map_port_84=114 +dport_map_port_85=115 +dport_map_port_86=116 + +dport_map_port_87=117 +dport_map_port_88=118 +dport_map_port_89=119 +dport_map_port_90=120 + +dport_map_port_91=121 +dport_map_port_92=122 +dport_map_port_93=123 +dport_map_port_94=124 + +dport_map_port_99=125 +dport_map_port_100=126 +dport_map_port_101=127 +dport_map_port_102=128 + +dport_map_port_66=129 +dport_map_port_130=130 ### interface setting # TSCF / TSCE interface definition @@ -532,3 +669,8 @@ phy_chain_rx_polarity_flip_physical{98.0}=0x0 phy_chain_rx_polarity_flip_physical{99.0}=0x1 phy_chain_rx_polarity_flip_physical{100.0}=0x0 + +l2_mem_entries=40960 +l3_mem_entries=40960 +l3_alpm_enable=2 +use_all_splithorizon_groups=1 diff --git a/device/quanta/x86_64-quanta_ix7_rglbmc-r0/custom_led.bin b/device/quanta/x86_64-quanta_ix7_rglbmc-r0/custom_led.bin new file mode 100644 index 000000000000..813addd1ac06 Binary files /dev/null and b/device/quanta/x86_64-quanta_ix7_rglbmc-r0/custom_led.bin differ diff --git a/device/quanta/x86_64-quanta_ix7_rglbmc-r0/led_proc_init.soc b/device/quanta/x86_64-quanta_ix7_rglbmc-r0/led_proc_init.soc old mode 100755 new mode 100644 index 0861486660c3..f82bbc8e335b --- a/device/quanta/x86_64-quanta_ix7_rglbmc-r0/led_proc_init.soc +++ b/device/quanta/x86_64-quanta_ix7_rglbmc-r0/led_proc_init.soc @@ -1,6 +1,4 @@ -sleep 10 -led stop -sleep 3 +m0 load 0 0x3800 /usr/share/sonic/platform/custom_led.bin led start -sleep 3 -led auto on \ No newline at end of file + +rcload /usr/share/sonic/platform/preemphasis-32x100G.soc diff --git a/device/quanta/x86_64-quanta_ix7_rglbmc-r0/plugins/eeprom.py b/device/quanta/x86_64-quanta_ix7_rglbmc-r0/plugins/eeprom.py index fa34110c04ea..3752a919cba4 100644 --- a/device/quanta/x86_64-quanta_ix7_rglbmc-r0/plugins/eeprom.py +++ b/device/quanta/x86_64-quanta_ix7_rglbmc-r0/plugins/eeprom.py @@ -16,5 +16,5 @@ class board(eeprom_tlvinfo.TlvInfoDecoder): _TLV_INFO_MAX_LEN = 256 def __init__(self, name, path, cpld_root, ro): - self.eeprom_path = "/sys/bus/i2c/devices/18-0054/eeprom" + self.eeprom_path = "/sys/bus/i2c/devices/3-0054/eeprom" super(board, self).__init__(self.eeprom_path, 0, '', True) diff --git a/device/quanta/x86_64-quanta_ix7_rglbmc-r0/plugins/fanutil.py b/device/quanta/x86_64-quanta_ix7_rglbmc-r0/plugins/fanutil.py new file mode 100644 index 000000000000..dad8dcfedd7b --- /dev/null +++ b/device/quanta/x86_64-quanta_ix7_rglbmc-r0/plugins/fanutil.py @@ -0,0 +1,110 @@ +# +# fanutil.py +# Platform-specific Fan status interface for SONiC +# + +import logging +import os.path + +try: + from sonic_fan.fan_base import FanBase +except ImportError as e: + raise ImportError (str(e) + "- required module not found") + +class FanUtil(FanBase): + """Platform-specific FANutil class""" + + SYS_FAN_NUM = 6 + NUM_FANS_PERTRAY = 2 + HWMON_PATH = '/sys/class/hwmon/hwmon1/' + FAN_INDEX_START = 21 + + logger = logging.getLogger(__name__) + + def __init__(self, log_level=logging.DEBUG): + FanBase.__init__(self) + self.num_fans = (self.SYS_FAN_NUM * self.NUM_FANS_PERTRAY) + + # Get sysfs attribute + def get_attr_value(self, attr_path): + + retval = 'ERR' + if (not os.path.isfile(attr_path)): + return retval + + try: + with open(attr_path, 'r') as fd: + retval = fd.read() + except Exception: + logging.error("Unable to open ", attr_path, " file !") + + retval = retval.rstrip('\r\n') + return retval + + def check_fan_index(self, index): + if index is None: + return False + + if index < 1 or index > self.num_fans: + logging.error("Invalid Fan index:", index) + return False + + return True + + def get_num_fans(self): + return self.num_fans + + def get_status(self, index): + if self.check_fan_index(index) == False: + return False + + fantray_speed_file = 'fan' + str(self.FAN_INDEX_START+(index-1)) + '_input' + fantray_speed = self.get_attr_value(self.HWMON_PATH + fantray_speed_file) + + if fantray_speed == '0.0' : + return False + + return True + + def get_presence(self, index): + if self.check_fan_index(index) == False: + return False + + fantray_present_file = 'fan' + str(self.FAN_INDEX_START+(index-1)) + '_present' + fantray_present = self.get_attr_value(self.HWMON_PATH + fantray_present_file) + + if fantray_present == '1' : + return True + + return False + + def get_direction(self, index): + if self.check_fan_index(index) == False: + return None + + fantray_direction_file = 'fan' + str(self.FAN_INDEX_START+(index-1)) + '_direction' + fantray_direction = self.get_attr_value(self.HWMON_PATH + fantray_direction_file) + + """ + 1: FB 2: BF + Since the fan is at rear of the switch, FB means Exhaust; BF means Intake + """ + if fantray_direction == '2': + return "INTAKE" + else: + return "EXHAUST" + + def get_speed(self, index): + if self.check_fan_index(index) == False: + return 0 + + fantray_speed_file = 'fan' + str(self.FAN_INDEX_START+(index-1)) + '_input' + fantray_speed = self.get_attr_value(self.HWMON_PATH + fantray_speed_file) + + return int(float(fantray_speed)) + + + def set_speed(self, val): + logging.error("Not allowed to set fan speed!") + + return False diff --git a/device/quanta/x86_64-quanta_ix7_rglbmc-r0/plugins/psuutil.py b/device/quanta/x86_64-quanta_ix7_rglbmc-r0/plugins/psuutil.py index 5cf06fb5d66a..3b07edcda0b3 100644 --- a/device/quanta/x86_64-quanta_ix7_rglbmc-r0/plugins/psuutil.py +++ b/device/quanta/x86_64-quanta_ix7_rglbmc-r0/plugins/psuutil.py @@ -1,50 +1,251 @@ -# -# psuutil.py -# Platform-specific PSU status interface for SONiC -# - -import os.path - -try: - from sonic_psu.psu_base import PsuBase -except ImportError as e: - raise ImportError(str(e) + "- required module not found") - - -class PsuUtil(PsuBase): - """Platform-specific PSUutil class""" - - def __init__(self): - PsuBase.__init__(self) - - def get_num_psus(self): - """ - Retrieves the number of PSUs available on the device - :return: An integer, the number of PSUs available on the device - """ - MAX_PSUS = 2 - - return MAX_PSUS - - def get_psu_status(self, index): - """ - Retrieves the oprational status of power supply unit (PSU) defined - by index - :param index: An integer, index of the PSU of which to query status - :return: Boolean, True if PSU is operating properly, False if PSU is\ - faulty - """ - status = 1 - - return status - - def get_psu_presence(self, index): - """ - Retrieves the presence status of power supply unit (PSU) defined - by index - :param index: An integer, index of the PSU of which to query status - :return: Boolean, True if PSU is plugged, False if not - """ - status = 1 - - return status +# +# psuutil.py +# Platform-specific PSU status interface for SONiC +# + +import logging +import os.path + +try: + from sonic_psu.psu_base import PsuBase +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class PsuUtil(PsuBase): + """Platform-specific PSUutil class""" + + HWMON_PATH = '/sys/class/hwmon/hwmon1/' + PSU1_PREFIX = 'power42_' + PSU2_PREFIX = 'power52_' + MAX_PSUS = 2 + def __init__(self): + PsuBase.__init__(self) + + # Get sysfs attribute + def get_attr_value(self, attr_path): + + retval = 'ERR' + if (not os.path.isfile(attr_path)): + return retval + + try: + with open(attr_path, 'r') as fd: + retval = fd.read() + except Exception: + logging.error("Unable to open ", attr_path, " file !") + + retval = retval.rstrip('\r\n') + return retval + + def get_attr_filename(self, index, attr): + if (index == 1): + attr_file = self.PSU1_PREFIX + attr + elif (index == 2): + attr_file = self.PSU2_PREFIX + attr + else: + logging.error("Invalid PSU number:", index) + return '' + + return attr_file + + def get_num_psus(self): + """ + Retrieves the number of PSUs available on the device + :return: An integer, the number of PSUs available on the device + """ + + return self.MAX_PSUS + + def get_psu_status(self, index): + """ + Retrieves the oprational status of power supply unit (PSU) defined + by index + :param index: An integer, index of the PSU of which to query status + :return: Boolean, True if PSU is operating properly, False if PSU is\ + faulty + """ + status = False + + attr_filename = self.get_attr_filename(index, 'input') + if attr_filename == '': + return status + + attr_path = self.HWMON_PATH + attr_filename + attr_value = self.get_attr_value(attr_path) + + if (attr_value != 'ERR'): + attr_value = float(attr_value) + + # Check PSU status + if (attr_value != 0.0): + status = True + + return status + + def get_psu_presence(self, index): + """ + Retrieves the presence status of power supply unit (PSU) defined + by index + :param index: An integer, index of the PSU of which to query status + :return: Boolean, True if PSU is plugged, False if not + """ + status = False + + attr_filename = self.get_attr_filename(index, 'present') + if attr_filename == '': + return status + + attr_path = self.HWMON_PATH + attr_filename + attr_value = self.get_attr_value(attr_path) + + if (attr_value != 'ERR'): + attr_value = int(attr_value, 16) + # Check PSU status + if (attr_value == 1): + status = True + return status + + def get_powergood_status(self, index): + status = False + + attr_filename = self.get_attr_filename(index, 'input') + if attr_filename == '': + return status + + attr_path = self.HWMON_PATH + attr_filename + attr_value = self.get_attr_value(attr_path) + + if (attr_value != 'ERR'): + attr_value = float(attr_value) + + # Check PSU status + if (attr_value != 0.0): + status = True + + return status + + def get_model(self, index): + attr_filename = self.get_attr_filename(index, 'model') + if attr_filename == '': + return None + + attr_path = self.HWMON_PATH + attr_filename + attr_value = self.get_attr_value(attr_path) + + if (attr_value != 'ERR'): + return attr_value.rstrip() + + def get_mfr_id(self, index): + attr_filename = self.get_attr_filename(index, 'mfrid') + if attr_filename == '': + return None + + attr_path = self.HWMON_PATH + attr_filename + attr_value = self.get_attr_value(attr_path) + + if (attr_value != 'ERR'): + return attr_value.rstrip() + + def get_serial(self, index): + attr_filename = self.get_attr_filename(index, 'sn') + if attr_filename == '': + return None + + attr_path = self.HWMON_PATH + attr_filename + attr_value = self.get_attr_value(attr_path) + + if (attr_value != 'ERR'): + return attr_value.rstrip() + + def get_direction(self, index): + if (index == 1): + direction_file = 'fan40_direction' + elif (index == 2): + direction_file = 'fan50_direction' + else: + logging.error("Invalid PSU number:", index) + return None + + direction = self.get_attr_value(self.HWMON_PATH + direction_file) + direction = direction.rstrip() + + """ + 1: FB 2: BF + Since the fan is at rear of the switch, FB means Exhaust; BF means Intake + """ + if direction == '2': + return "INTAKE" + else: + return "EXHAUST" + + def get_output_voltage(self, index): + if (index == 1): + attr_file = 'in47_input' + elif (index == 2): + attr_file = 'in57_input' + else: + logging.error("Invalid PSU number:", index) + return 0.0 + + voltage = self.get_attr_value(self.HWMON_PATH + attr_file) + voltage = voltage.rstrip() + + if (voltage != 'ERR'): + voltage, dummy = voltage.split('.', 1) + else: + return 0.0 + + return float(voltage)/1000 + + def get_output_current(self, index): + if (index == 1): + attr_file = 'curr39_input' + elif (index == 2): + attr_file = 'curr49_input' + else: + logging.error("Invalid PSU number:", index) + return 0.0 + + current = self.get_attr_value(self.HWMON_PATH + attr_file) + current = current.rstrip() + + if (current != 'ERR'): + current, dummy = current.split('.',1) + else: + return 0.0 + + return float(current)/1000 + + def get_output_power(self, index): + attr_filename = self.get_attr_filename(index, 'input') + if attr_filename == '': + return 0.0 + + attr_path = self.HWMON_PATH + attr_filename + attr_value = self.get_attr_value(attr_path) + + if (attr_value != 'ERR'): + attr_value = float(attr_value) + else: + return 0.0 + + return float(attr_value/1000) + + def get_fan_rpm(self, index, fan_idx): + if (index == 1): + rpm_file = 'fan40_input' + elif (index == 2): + rpm_file = 'fan50_input' + else: + logging.error("Invalid PSU number:", index) + return 0 + + rpm = self.get_attr_value(self.HWMON_PATH + rpm_file) + rpm = rpm.rstrip() + if (rpm != 'ERR'): + rpm = float(rpm) + else: + return 0 + + return int(rpm) diff --git a/device/quanta/x86_64-quanta_ix7_rglbmc-r0/plugins/sfputil.py b/device/quanta/x86_64-quanta_ix7_rglbmc-r0/plugins/sfputil.py index 14b0ef6674be..e0302e620f47 100644 --- a/device/quanta/x86_64-quanta_ix7_rglbmc-r0/plugins/sfputil.py +++ b/device/quanta/x86_64-quanta_ix7_rglbmc-r0/plugins/sfputil.py @@ -21,38 +21,38 @@ class SfpUtil(SfpUtilBase): _port_to_eeprom_mapping = {} _port_to_i2c_mapping = { - 1: 32, - 2: 33, - 3: 34, - 4: 35, - 5: 36, - 6: 37, - 7: 38, - 8: 39, - 9: 40, - 10: 41, - 11: 42, - 12: 43, - 13: 44, - 14: 45, - 15: 46, - 16: 47, - 17: 48, - 18: 49, - 19: 50, - 20: 51, - 21: 52, - 22: 53, - 23: 54, - 24: 55, - 25: 56, - 26: 57, - 27: 58, - 28: 59, - 29: 60, - 30: 61, - 31: 62, - 32: 63, + 1 : 17, + 2 : 18, + 3 : 19, + 4 : 20, + 5 : 21, + 6 : 22, + 7 : 23, + 8 : 24, + 9 : 25, + 10 : 26, + 11 : 27, + 12 : 28, + 13 : 29, + 14 : 30, + 15 : 31, + 16 : 32, + 17 : 33, + 18 : 34, + 19 : 35, + 20 : 36, + 21 : 37, + 22 : 38, + 23 : 39, + 24 : 40, + 25 : 41, + 26 : 42, + 27 : 43, + 28 : 44, + 29 : 45, + 30 : 46, + 31 : 47, + 32 : 48 } @property diff --git a/device/quanta/x86_64-quanta_ix7_rglbmc-r0/pmon_daemon_control.json b/device/quanta/x86_64-quanta_ix7_rglbmc-r0/pmon_daemon_control.json new file mode 100644 index 000000000000..94592fa8cebc --- /dev/null +++ b/device/quanta/x86_64-quanta_ix7_rglbmc-r0/pmon_daemon_control.json @@ -0,0 +1,3 @@ +{ + "skip_ledd": true +} diff --git a/device/quanta/x86_64-quanta_ix7_rglbmc-r0/preemphasis-32x100G.soc b/device/quanta/x86_64-quanta_ix7_rglbmc-r0/preemphasis-32x100G.soc new file mode 100644 index 000000000000..5837a6fdce87 --- /dev/null +++ b/device/quanta/x86_64-quanta_ix7_rglbmc-r0/preemphasis-32x100G.soc @@ -0,0 +1,546 @@ +# Pre-emphasis + +phy raw c45 0xa5 0x1 0xffde 0 +phy raw c45 0xa5 0x1 0xd130 0x41 +phy raw c45 0xa5 0x1 0xd131 0xd +phy raw c45 0xa5 0x1 0xd134 1 +phy raw c45 0xa5 0x1 0xffde 1 +phy raw c45 0xa5 0x1 0xd130 0x41 +phy raw c45 0xa5 0x1 0xd131 0xd +phy raw c45 0xa5 0x1 0xd134 1 +phy raw c45 0xa5 0x1 0xffde 2 +phy raw c45 0xa5 0x1 0xd130 0x41 +phy raw c45 0xa5 0x1 0xd131 0xd +phy raw c45 0xa5 0x1 0xd134 1 +phy raw c45 0xa5 0x1 0xffde 3 +phy raw c45 0xa5 0x1 0xd130 0x41 +phy raw c45 0xa5 0x1 0xd131 0xd +phy raw c45 0xa5 0x1 0xd134 1 + +phy raw c45 0xa9 0x1 0xffde 0 +phy raw c45 0xa9 0x1 0xd130 0x41 +phy raw c45 0xa9 0x1 0xd131 0xd +phy raw c45 0xa9 0x1 0xd134 1 +phy raw c45 0xa9 0x1 0xffde 1 +phy raw c45 0xa9 0x1 0xd130 0x41 +phy raw c45 0xa9 0x1 0xd131 0xd +phy raw c45 0xa9 0x1 0xd134 1 +phy raw c45 0xa9 0x1 0xffde 2 +phy raw c45 0xa9 0x1 0xd130 0x41 +phy raw c45 0xa9 0x1 0xd131 0xd +phy raw c45 0xa9 0x1 0xd134 1 +phy raw c45 0xa9 0x1 0xffde 3 +phy raw c45 0xa9 0x1 0xd130 0x41 +phy raw c45 0xa9 0x1 0xd131 0xd +phy raw c45 0xa9 0x1 0xd134 1 + +phy raw c45 0xc1 0x1 0xffde 0 +phy raw c45 0xc1 0x1 0xd130 0x41 +phy raw c45 0xc1 0x1 0xd131 0xd +phy raw c45 0xc1 0x1 0xd134 1 +phy raw c45 0xc1 0x1 0xffde 1 +phy raw c45 0xc1 0x1 0xd130 0x41 +phy raw c45 0xc1 0x1 0xd131 0xd +phy raw c45 0xc1 0x1 0xd134 1 +phy raw c45 0xc1 0x1 0xffde 2 +phy raw c45 0xc1 0x1 0xd130 0x41 +phy raw c45 0xc1 0x1 0xd131 0xd +phy raw c45 0xc1 0x1 0xd134 1 +phy raw c45 0xc1 0x1 0xffde 3 +phy raw c45 0xc1 0x1 0xd130 0x41 +phy raw c45 0xc1 0x1 0xd131 0xd +phy raw c45 0xc1 0x1 0xd134 1 + +phy raw c45 0xc5 0x1 0xffde 0 +phy raw c45 0xc5 0x1 0xd130 0x41 +phy raw c45 0xc5 0x1 0xd131 0xd +phy raw c45 0xc5 0x1 0xd134 1 +phy raw c45 0xc5 0x1 0xffde 1 +phy raw c45 0xc5 0x1 0xd130 0x41 +phy raw c45 0xc5 0x1 0xd131 0xd +phy raw c45 0xc5 0x1 0xd134 1 +phy raw c45 0xc5 0x1 0xffde 2 +phy raw c45 0xc5 0x1 0xd130 0x41 +phy raw c45 0xc5 0x1 0xd131 0xd +phy raw c45 0xc5 0x1 0xd134 1 +phy raw c45 0xc5 0x1 0xffde 3 +phy raw c45 0xc5 0x1 0xd130 0x41 +phy raw c45 0xc5 0x1 0xd131 0xd +phy raw c45 0xc5 0x1 0xd134 1 + +phy raw c45 0x81 0x1 0xffde 0 +phy raw c45 0x81 0x1 0xd130 0x41 +phy raw c45 0x81 0x1 0xd131 0xd +phy raw c45 0x81 0x1 0xd134 1 +phy raw c45 0x81 0x1 0xffde 1 +phy raw c45 0x81 0x1 0xd130 0x41 +phy raw c45 0x81 0x1 0xd131 0xd +phy raw c45 0x81 0x1 0xd134 1 +phy raw c45 0x81 0x1 0xffde 2 +phy raw c45 0x81 0x1 0xd130 0x41 +phy raw c45 0x81 0x1 0xd131 0xd +phy raw c45 0x81 0x1 0xd134 1 +phy raw c45 0x81 0x1 0xffde 3 +phy raw c45 0x81 0x1 0xd130 0x41 +phy raw c45 0x81 0x1 0xd131 0xd +phy raw c45 0x81 0x1 0xd134 1 + +phy raw c45 0x85 0x1 0xffde 0 +phy raw c45 0x85 0x1 0xd130 0x41 +phy raw c45 0x85 0x1 0xd131 0xd +phy raw c45 0x85 0x1 0xd134 1 +phy raw c45 0x85 0x1 0xffde 1 +phy raw c45 0x85 0x1 0xd130 0x41 +phy raw c45 0x85 0x1 0xd131 0xd +phy raw c45 0x85 0x1 0xd134 1 +phy raw c45 0x85 0x1 0xffde 2 +phy raw c45 0x85 0x1 0xd130 0x41 +phy raw c45 0x85 0x1 0xd131 0xd +phy raw c45 0x85 0x1 0xd134 1 +phy raw c45 0x85 0x1 0xffde 3 +phy raw c45 0x85 0x1 0xd130 0x41 +phy raw c45 0x85 0x1 0xd131 0xd +phy raw c45 0x85 0x1 0xd134 1 + +phy raw c45 0x89 0x1 0xffde 0 +phy raw c45 0x89 0x1 0xd130 0x41 +phy raw c45 0x89 0x1 0xd131 0xd +phy raw c45 0x89 0x1 0xd134 1 +phy raw c45 0x89 0x1 0xffde 1 +phy raw c45 0x89 0x1 0xd130 0x41 +phy raw c45 0x89 0x1 0xd131 0xd +phy raw c45 0x89 0x1 0xd134 1 +phy raw c45 0x89 0x1 0xffde 2 +phy raw c45 0x89 0x1 0xd130 0x41 +phy raw c45 0x89 0x1 0xd131 0xd +phy raw c45 0x89 0x1 0xd134 1 +phy raw c45 0x89 0x1 0xffde 3 +phy raw c45 0x89 0x1 0xd130 0x41 +phy raw c45 0x89 0x1 0xd131 0xd +phy raw c45 0x89 0x1 0xd134 1 + +phy raw c45 0x8d 0x1 0xffde 0 +phy raw c45 0x8d 0x1 0xd130 0x41 +phy raw c45 0x8d 0x1 0xd131 0xd +phy raw c45 0x8d 0x1 0xd134 1 +phy raw c45 0x8d 0x1 0xffde 1 +phy raw c45 0x8d 0x1 0xd130 0x41 +phy raw c45 0x8d 0x1 0xd131 0xd +phy raw c45 0x8d 0x1 0xd134 1 +phy raw c45 0x8d 0x1 0xffde 2 +phy raw c45 0x8d 0x1 0xd130 0x41 +phy raw c45 0x8d 0x1 0xd131 0xd +phy raw c45 0x8d 0x1 0xd134 1 +phy raw c45 0x8d 0x1 0xffde 3 +phy raw c45 0x8d 0x1 0xd130 0x41 +phy raw c45 0x8d 0x1 0xd131 0xd +phy raw c45 0x8d 0x1 0xd134 1 + +phy raw c45 0x91 0x1 0xffde 0 +phy raw c45 0x91 0x1 0xd130 0x41 +phy raw c45 0x91 0x1 0xd131 0x0408 +phy raw c45 0x91 0x1 0xd134 1 +phy raw c45 0x91 0x1 0xffde 1 +phy raw c45 0x91 0x1 0xd130 0x41 +phy raw c45 0x91 0x1 0xd131 0x0408 +phy raw c45 0x91 0x1 0xd134 1 +phy raw c45 0x91 0x1 0xffde 2 +phy raw c45 0x91 0x1 0xd130 0x41 +phy raw c45 0x91 0x1 0xd131 0x0408 +phy raw c45 0x91 0x1 0xd134 1 +phy raw c45 0x91 0x1 0xffde 3 +phy raw c45 0x91 0x1 0xd130 0x41 +phy raw c45 0x91 0x1 0xd131 0x0408 +phy raw c45 0x91 0x1 0xd134 1 + +phy raw c45 0x95 0x1 0xffde 0 +phy raw c45 0x95 0x1 0xd130 0x41 +phy raw c45 0x95 0x1 0xd131 0x0307 +phy raw c45 0x95 0x1 0xd134 1 +phy raw c45 0x95 0x1 0xffde 1 +phy raw c45 0x95 0x1 0xd130 0x41 +phy raw c45 0x95 0x1 0xd131 0x0307 +phy raw c45 0x95 0x1 0xd134 1 +phy raw c45 0x95 0x1 0xffde 2 +phy raw c45 0x95 0x1 0xd130 0x41 +phy raw c45 0x95 0x1 0xd131 0x0307 +phy raw c45 0x95 0x1 0xd134 1 +phy raw c45 0x95 0x1 0xffde 3 +phy raw c45 0x95 0x1 0xd130 0x41 +phy raw c45 0x95 0x1 0xd131 0x0307 +phy raw c45 0x95 0x1 0xd134 1 + +phy raw c45 0xa1 0x1 0xffde 0 +phy raw c45 0xa1 0x1 0xd130 0x41 +phy raw c45 0xa1 0x1 0xd131 0x0307 +phy raw c45 0xa1 0x1 0xd134 1 +phy raw c45 0xa1 0x1 0xffde 1 +phy raw c45 0xa1 0x1 0xd130 0x41 +phy raw c45 0xa1 0x1 0xd131 0x0307 +phy raw c45 0xa1 0x1 0xd134 1 +phy raw c45 0xa1 0x1 0xffde 2 +phy raw c45 0xa1 0x1 0xd130 0x41 +phy raw c45 0xa1 0x1 0xd131 0x0307 +phy raw c45 0xa1 0x1 0xd134 1 +phy raw c45 0xa1 0x1 0xffde 3 +phy raw c45 0xa1 0x1 0xd130 0x41 +phy raw c45 0xa1 0x1 0xd131 0x0307 +phy raw c45 0xa1 0x1 0xd134 1 + +phy raw c45 0xad 0x1 0xffde 0 +phy raw c45 0xad 0x1 0xd130 0x41 +phy raw c45 0xad 0x1 0xd131 0x0307 +phy raw c45 0xad 0x1 0xd134 1 +phy raw c45 0xad 0x1 0xffde 1 +phy raw c45 0xad 0x1 0xd130 0x41 +phy raw c45 0xad 0x1 0xd131 0x0307 +phy raw c45 0xad 0x1 0xd134 1 +phy raw c45 0xad 0x1 0xffde 2 +phy raw c45 0xad 0x1 0xd130 0x41 +phy raw c45 0xad 0x1 0xd131 0x0307 +phy raw c45 0xad 0x1 0xd134 1 +phy raw c45 0xad 0x1 0xffde 3 +phy raw c45 0xad 0x1 0xd130 0x41 +phy raw c45 0xad 0x1 0xd131 0x0307 +phy raw c45 0xad 0x1 0xd134 1 + +phy raw c45 0xc9 0x1 0xffde 0 +phy raw c45 0xc9 0x1 0xd130 0x41 +phy raw c45 0xc9 0x1 0xd131 0x0307 +phy raw c45 0xc9 0x1 0xd134 1 +phy raw c45 0xc9 0x1 0xffde 1 +phy raw c45 0xc9 0x1 0xd130 0x41 +phy raw c45 0xc9 0x1 0xd131 0x0307 +phy raw c45 0xc9 0x1 0xd134 1 +phy raw c45 0xc9 0x1 0xffde 2 +phy raw c45 0xc9 0x1 0xd130 0x41 +phy raw c45 0xc9 0x1 0xd131 0x0307 +phy raw c45 0xc9 0x1 0xd134 1 +phy raw c45 0xc9 0x1 0xffde 3 +phy raw c45 0xc9 0x1 0xd130 0x41 +phy raw c45 0xc9 0x1 0xd131 0x0307 +phy raw c45 0xc9 0x1 0xd134 1 + +phy raw c45 0xcd 0x1 0xffde 0 +phy raw c45 0xcd 0x1 0xd130 0x41 +phy raw c45 0xcd 0x1 0xd131 0x0307 +phy raw c45 0xcd 0x1 0xd134 1 +phy raw c45 0xcd 0x1 0xffde 1 +phy raw c45 0xcd 0x1 0xd130 0x41 +phy raw c45 0xcd 0x1 0xd131 0x0307 +phy raw c45 0xcd 0x1 0xd134 1 +phy raw c45 0xcd 0x1 0xffde 2 +phy raw c45 0xcd 0x1 0xd130 0x41 +phy raw c45 0xcd 0x1 0xd131 0x0307 +phy raw c45 0xcd 0x1 0xd134 1 +phy raw c45 0xcd 0x1 0xffde 3 +phy raw c45 0xcd 0x1 0xd130 0x41 +phy raw c45 0xcd 0x1 0xd131 0x0307 +phy raw c45 0xcd 0x1 0xd134 1 + +phy raw c45 0xd1 0x1 0xffde 0 +phy raw c45 0xd1 0x1 0xd130 0x41 +phy raw c45 0xd1 0x1 0xd131 0x0307 +phy raw c45 0xd1 0x1 0xd134 1 +phy raw c45 0xd1 0x1 0xffde 1 +phy raw c45 0xd1 0x1 0xd130 0x41 +phy raw c45 0xd1 0x1 0xd131 0x0307 +phy raw c45 0xd1 0x1 0xd134 1 +phy raw c45 0xd1 0x1 0xffde 2 +phy raw c45 0xd1 0x1 0xd130 0x41 +phy raw c45 0xd1 0x1 0xd131 0x0307 +phy raw c45 0xd1 0x1 0xd134 1 +phy raw c45 0xd1 0x1 0xffde 3 +phy raw c45 0xd1 0x1 0xd130 0x41 +phy raw c45 0xd1 0x1 0xd131 0x0307 +phy raw c45 0xd1 0x1 0xd134 1 + +phy raw c45 0xd5 0x1 0xffde 0 +phy raw c45 0xd5 0x1 0xd130 0x41 +phy raw c45 0xd5 0x1 0xd131 0x0307 +phy raw c45 0xd5 0x1 0xd134 1 +phy raw c45 0xd5 0x1 0xffde 1 +phy raw c45 0xd5 0x1 0xd130 0x41 +phy raw c45 0xd5 0x1 0xd131 0x0307 +phy raw c45 0xd5 0x1 0xd134 1 +phy raw c45 0xd5 0x1 0xffde 2 +phy raw c45 0xd5 0x1 0xd130 0x41 +phy raw c45 0xd5 0x1 0xd131 0x0307 +phy raw c45 0xd5 0x1 0xd134 1 +phy raw c45 0xd5 0x1 0xffde 3 +phy raw c45 0xd5 0x1 0xd130 0x41 +phy raw c45 0xd5 0x1 0xd131 0x0307 +phy raw c45 0xd5 0x1 0xd134 1 + +phy raw c45 0xe1 0x1 0xffde 0 +phy raw c45 0xe1 0x1 0xd130 0x41 +phy raw c45 0xe1 0x1 0xd131 0x0307 +phy raw c45 0xe1 0x1 0xd134 1 +phy raw c45 0xe1 0x1 0xffde 1 +phy raw c45 0xe1 0x1 0xd130 0x41 +phy raw c45 0xe1 0x1 0xd131 0x0307 +phy raw c45 0xe1 0x1 0xd134 1 +phy raw c45 0xe1 0x1 0xffde 2 +phy raw c45 0xe1 0x1 0xd130 0x41 +phy raw c45 0xe1 0x1 0xd131 0x0307 +phy raw c45 0xe1 0x1 0xd134 1 +phy raw c45 0xe1 0x1 0xffde 3 +phy raw c45 0xe1 0x1 0xd130 0x41 +phy raw c45 0xe1 0x1 0xd131 0x0307 +phy raw c45 0xe1 0x1 0xd134 1 + +phy raw c45 0xe5 0x1 0xffde 0 +phy raw c45 0xe5 0x1 0xd130 0x41 +phy raw c45 0xe5 0x1 0xd131 0x0307 +phy raw c45 0xe5 0x1 0xd134 1 +phy raw c45 0xe5 0x1 0xffde 1 +phy raw c45 0xe5 0x1 0xd130 0x41 +phy raw c45 0xe5 0x1 0xd131 0x0307 +phy raw c45 0xe5 0x1 0xd134 1 +phy raw c45 0xe5 0x1 0xffde 2 +phy raw c45 0xe5 0x1 0xd130 0x41 +phy raw c45 0xe5 0x1 0xd131 0x0307 +phy raw c45 0xe5 0x1 0xd134 1 +phy raw c45 0xe5 0x1 0xffde 3 +phy raw c45 0xe5 0x1 0xd130 0x41 +phy raw c45 0xe5 0x1 0xd131 0x0307 +phy raw c45 0xe5 0x1 0xd134 1 + +phy raw c45 0xe9 0x1 0xffde 0 +phy raw c45 0xe9 0x1 0xd130 0x41 +phy raw c45 0xe9 0x1 0xd131 0x0307 +phy raw c45 0xe9 0x1 0xd134 1 +phy raw c45 0xe9 0x1 0xffde 1 +phy raw c45 0xe9 0x1 0xd130 0x41 +phy raw c45 0xe9 0x1 0xd131 0x0307 +phy raw c45 0xe9 0x1 0xd134 1 +phy raw c45 0xe9 0x1 0xffde 2 +phy raw c45 0xe9 0x1 0xd130 0x41 +phy raw c45 0xe9 0x1 0xd131 0x0307 +phy raw c45 0xe9 0x1 0xd134 1 +phy raw c45 0xe9 0x1 0xffde 3 +phy raw c45 0xe9 0x1 0xd130 0x41 +phy raw c45 0xe9 0x1 0xd131 0x0307 +phy raw c45 0xe9 0x1 0xd134 1 + +phy raw c45 0xed 0x1 0xffde 0 +phy raw c45 0xed 0x1 0xd130 0x41 +phy raw c45 0xed 0x1 0xd131 0xb +phy raw c45 0xed 0x1 0xd134 1 +phy raw c45 0xed 0x1 0xffde 1 +phy raw c45 0xed 0x1 0xd130 0x41 +phy raw c45 0xed 0x1 0xd131 0xb +phy raw c45 0xed 0x1 0xd134 1 +phy raw c45 0xed 0x1 0xffde 2 +phy raw c45 0xed 0x1 0xd130 0x41 +phy raw c45 0xed 0x1 0xd131 0xb +phy raw c45 0xed 0x1 0xd134 1 +phy raw c45 0xed 0x1 0xffde 3 +phy raw c45 0xed 0x1 0xd130 0x41 +phy raw c45 0xed 0x1 0xd131 0xb +phy raw c45 0xed 0x1 0xd134 1 + +phy raw c45 0x185 0x1 0xffde 0 +phy raw c45 0x185 0x1 0xd130 0x41 +phy raw c45 0x185 0x1 0xd131 0x0307 +phy raw c45 0x185 0x1 0xd134 1 +phy raw c45 0x185 0x1 0xffde 1 +phy raw c45 0x185 0x1 0xd130 0x41 +phy raw c45 0x185 0x1 0xd131 0x0307 +phy raw c45 0x185 0x1 0xd134 1 +phy raw c45 0x185 0x1 0xffde 2 +phy raw c45 0x185 0x1 0xd130 0x41 +phy raw c45 0x185 0x1 0xd131 0x0307 +phy raw c45 0x185 0x1 0xd134 1 +phy raw c45 0x185 0x1 0xffde 3 +phy raw c45 0x185 0x1 0xd130 0x41 +phy raw c45 0x185 0x1 0xd131 0x0307 +phy raw c45 0x185 0x1 0xd134 1 + +phy raw c45 0x18d 0x1 0xffde 0 +phy raw c45 0x18d 0x1 0xd130 0x41 +phy raw c45 0x18d 0x1 0xd131 0x0307 +phy raw c45 0x18d 0x1 0xd134 1 +phy raw c45 0x18d 0x1 0xffde 1 +phy raw c45 0x18d 0x1 0xd130 0x41 +phy raw c45 0x18d 0x1 0xd131 0x0307 +phy raw c45 0x18d 0x1 0xd134 1 +phy raw c45 0x18d 0x1 0xffde 2 +phy raw c45 0x18d 0x1 0xd130 0x41 +phy raw c45 0x18d 0x1 0xd131 0x0307 +phy raw c45 0x18d 0x1 0xd134 1 +phy raw c45 0x18d 0x1 0xffde 3 +phy raw c45 0x18d 0x1 0xd130 0x41 +phy raw c45 0x18d 0x1 0xd131 0x0307 +phy raw c45 0x18d 0x1 0xd134 1 + +phy raw c45 0x1a1 0x1 0xffde 0 +phy raw c45 0x1a1 0x1 0xd130 0x41 +phy raw c45 0x1a1 0x1 0xd131 0x0408 +phy raw c45 0x1a1 0x1 0xd134 1 +phy raw c45 0x1a1 0x1 0xffde 1 +phy raw c45 0x1a1 0x1 0xd130 0x41 +phy raw c45 0x1a1 0x1 0xd131 0x0408 +phy raw c45 0x1a1 0x1 0xd134 1 +phy raw c45 0x1a1 0x1 0xffde 2 +phy raw c45 0x1a1 0x1 0xd130 0x41 +phy raw c45 0x1a1 0x1 0xd131 0x0408 +phy raw c45 0x1a1 0x1 0xd134 1 +phy raw c45 0x1a1 0x1 0xffde 3 +phy raw c45 0x1a1 0x1 0xd130 0x41 +phy raw c45 0x1a1 0x1 0xd131 0x0408 +phy raw c45 0x1a1 0x1 0xd134 1 + +phy raw c45 0x1a5 0x1 0xffde 0 +phy raw c45 0x1a5 0x1 0xd130 0x41 +phy raw c45 0x1a5 0x1 0xd131 0x0408 +phy raw c45 0x1a5 0x1 0xd134 1 +phy raw c45 0x1a5 0x1 0xffde 1 +phy raw c45 0x1a5 0x1 0xd130 0x41 +phy raw c45 0x1a5 0x1 0xd131 0x0408 +phy raw c45 0x1a5 0x1 0xd134 1 +phy raw c45 0x1a5 0x1 0xffde 2 +phy raw c45 0x1a5 0x1 0xd130 0x41 +phy raw c45 0x1a5 0x1 0xd131 0x0408 +phy raw c45 0x1a5 0x1 0xd134 1 +phy raw c45 0x1a5 0x1 0xffde 3 +phy raw c45 0x1a5 0x1 0xd130 0x41 +phy raw c45 0x1a5 0x1 0xd131 0x0408 +phy raw c45 0x1a5 0x1 0xd134 1 + +phy raw c45 0x1a9 0x1 0xffde 0 +phy raw c45 0x1a9 0x1 0xd130 0x41 +phy raw c45 0x1a9 0x1 0xd131 0xb +phy raw c45 0x1a9 0x1 0xd134 1 +phy raw c45 0x1a9 0x1 0xffde 1 +phy raw c45 0x1a9 0x1 0xd130 0x41 +phy raw c45 0x1a9 0x1 0xd131 0xb +phy raw c45 0x1a9 0x1 0xd134 1 +phy raw c45 0x1a9 0x1 0xffde 2 +phy raw c45 0x1a9 0x1 0xd130 0x41 +phy raw c45 0x1a9 0x1 0xd131 0xb +phy raw c45 0x1a9 0x1 0xd134 1 +phy raw c45 0x1a9 0x1 0xffde 3 +phy raw c45 0x1a9 0x1 0xd130 0x41 +phy raw c45 0x1a9 0x1 0xd131 0xb +phy raw c45 0x1a9 0x1 0xd134 1 + +phy raw c45 0x1ad 0x1 0xffde 0 +phy raw c45 0x1ad 0x1 0xd130 0x41 +phy raw c45 0x1ad 0x1 0xd131 0xc +phy raw c45 0x1ad 0x1 0xd134 1 +phy raw c45 0x1ad 0x1 0xffde 1 +phy raw c45 0x1ad 0x1 0xd130 0x41 +phy raw c45 0x1ad 0x1 0xd131 0xc +phy raw c45 0x1ad 0x1 0xd134 1 +phy raw c45 0x1ad 0x1 0xffde 2 +phy raw c45 0x1ad 0x1 0xd130 0x41 +phy raw c45 0x1ad 0x1 0xd131 0xc +phy raw c45 0x1ad 0x1 0xd134 1 +phy raw c45 0x1ad 0x1 0xffde 3 +phy raw c45 0x1ad 0x1 0xd130 0x41 +phy raw c45 0x1ad 0x1 0xd131 0xc +phy raw c45 0x1ad 0x1 0xd134 1 + +phy raw c45 0x1b1 0x1 0xffde 0 +phy raw c45 0x1b1 0x1 0xd130 0x41 +phy raw c45 0x1b1 0x1 0xd131 0xd +phy raw c45 0x1b1 0x1 0xd134 1 +phy raw c45 0x1b1 0x1 0xffde 1 +phy raw c45 0x1b1 0x1 0xd130 0x41 +phy raw c45 0x1b1 0x1 0xd131 0xd +phy raw c45 0x1b1 0x1 0xd134 1 +phy raw c45 0x1b1 0x1 0xffde 2 +phy raw c45 0x1b1 0x1 0xd130 0x41 +phy raw c45 0x1b1 0x1 0xd131 0xd +phy raw c45 0x1b1 0x1 0xd134 1 +phy raw c45 0x1b1 0x1 0xffde 3 +phy raw c45 0x1b1 0x1 0xd130 0x41 +phy raw c45 0x1b1 0x1 0xd131 0xd +phy raw c45 0x1b1 0x1 0xd134 1 + +phy raw c45 0x1b5 0x1 0xffde 0 +phy raw c45 0x1b5 0x1 0xd130 0x41 +phy raw c45 0x1b5 0x1 0xd131 0xf +phy raw c45 0x1b5 0x1 0xd134 1 +phy raw c45 0x1b5 0x1 0xffde 1 +phy raw c45 0x1b5 0x1 0xd130 0x41 +phy raw c45 0x1b5 0x1 0xd131 0xf +phy raw c45 0x1b5 0x1 0xd134 1 +phy raw c45 0x1b5 0x1 0xffde 2 +phy raw c45 0x1b5 0x1 0xd130 0x41 +phy raw c45 0x1b5 0x1 0xd131 0xf +phy raw c45 0x1b5 0x1 0xd134 1 +phy raw c45 0x1b5 0x1 0xffde 3 +phy raw c45 0x1b5 0x1 0xd130 0x41 +phy raw c45 0x1b5 0x1 0xd131 0xf +phy raw c45 0x1b5 0x1 0xd134 1 + +phy raw c45 0xf1 0x1 0xffde 0 +phy raw c45 0xf1 0x1 0xd130 0x41 +phy raw c45 0xf1 0x1 0xd131 0xd +phy raw c45 0xf1 0x1 0xd134 1 +phy raw c45 0xf1 0x1 0xffde 1 +phy raw c45 0xf1 0x1 0xd130 0x41 +phy raw c45 0xf1 0x1 0xd131 0xd +phy raw c45 0xf1 0x1 0xd134 1 +phy raw c45 0xf1 0x1 0xffde 2 +phy raw c45 0xf1 0x1 0xd130 0x41 +phy raw c45 0xf1 0x1 0xd131 0xd +phy raw c45 0xf1 0x1 0xd134 1 +phy raw c45 0xf1 0x1 0xffde 3 +phy raw c45 0xf1 0x1 0xd130 0x41 +phy raw c45 0xf1 0x1 0xd131 0xd +phy raw c45 0xf1 0x1 0xd134 1 + +phy raw c45 0xf5 0x1 0xffde 0 +phy raw c45 0xf5 0x1 0xd130 0x41 +phy raw c45 0xf5 0x1 0xd131 0xf +phy raw c45 0xf5 0x1 0xd134 1 +phy raw c45 0xf5 0x1 0xffde 1 +phy raw c45 0xf5 0x1 0xd130 0x41 +phy raw c45 0xf5 0x1 0xd131 0xf +phy raw c45 0xf5 0x1 0xd134 1 +phy raw c45 0xf5 0x1 0xffde 2 +phy raw c45 0xf5 0x1 0xd130 0x41 +phy raw c45 0xf5 0x1 0xd131 0xf +phy raw c45 0xf5 0x1 0xd134 1 +phy raw c45 0xf5 0x1 0xffde 3 +phy raw c45 0xf5 0x1 0xd130 0x41 +phy raw c45 0xf5 0x1 0xd131 0xf +phy raw c45 0xf5 0x1 0xd134 1 + +phy raw c45 0x181 0x1 0xffde 0 +phy raw c45 0x181 0x1 0xd130 0x41 +phy raw c45 0x181 0x1 0xd131 0xd +phy raw c45 0x181 0x1 0xd134 1 +phy raw c45 0x181 0x1 0xffde 1 +phy raw c45 0x181 0x1 0xd130 0x41 +phy raw c45 0x181 0x1 0xd131 0xd +phy raw c45 0x181 0x1 0xd134 1 +phy raw c45 0x181 0x1 0xffde 2 +phy raw c45 0x181 0x1 0xd130 0x41 +phy raw c45 0x181 0x1 0xd131 0xd +phy raw c45 0x181 0x1 0xd134 1 +phy raw c45 0x181 0x1 0xffde 3 +phy raw c45 0x181 0x1 0xd130 0x41 +phy raw c45 0x181 0x1 0xd131 0xd +phy raw c45 0x181 0x1 0xd134 1 + +phy raw c45 0x189 0x1 0xffde 0 +phy raw c45 0x189 0x1 0xd130 0x41 +phy raw c45 0x189 0x1 0xd131 0xe +phy raw c45 0x189 0x1 0xd134 1 +phy raw c45 0x189 0x1 0xffde 1 +phy raw c45 0x189 0x1 0xd130 0x41 +phy raw c45 0x189 0x1 0xd131 0xe +phy raw c45 0x189 0x1 0xd134 1 +phy raw c45 0x189 0x1 0xffde 2 +phy raw c45 0x189 0x1 0xd130 0x41 +phy raw c45 0x189 0x1 0xd131 0xe +phy raw c45 0x189 0x1 0xd134 1 +phy raw c45 0x189 0x1 0xffde 3 +phy raw c45 0x189 0x1 0xd130 0x41 +phy raw c45 0x189 0x1 0xd131 0xe +phy raw c45 0x189 0x1 0xd134 1 + diff --git a/device/quanta/x86_64-quanta_ix8_rglbmc-r0/Quanta-IX8-56X/buffers.json.j2 b/device/quanta/x86_64-quanta_ix8_rglbmc-r0/Quanta-IX8-56X/buffers.json.j2 new file mode 100644 index 000000000000..b67cf577ab75 --- /dev/null +++ b/device/quanta/x86_64-quanta_ix8_rglbmc-r0/Quanta-IX8-56X/buffers.json.j2 @@ -0,0 +1,3 @@ +{%- set default_topo = 't1' %} +{%- include 'buffers_config.j2' %} + diff --git a/device/quanta/x86_64-quanta_ix8_rglbmc-r0/Quanta-IX8-56X/buffers_defaults_def.j2 b/device/quanta/x86_64-quanta_ix8_rglbmc-r0/Quanta-IX8-56X/buffers_defaults_def.j2 new file mode 100644 index 000000000000..740cfdf79e96 --- /dev/null +++ b/device/quanta/x86_64-quanta_ix8_rglbmc-r0/Quanta-IX8-56X/buffers_defaults_def.j2 @@ -0,0 +1,46 @@ +{%- set default_cable = '300m' %} + +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {% for port_idx in range(0,32) %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} + {% endfor %} +{%- endmacro %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + "xoff": "4625920", + "size": "12766208", + "type": "ingress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "12766208", + "type": "egress", + "mode": "static" + }, + "egress_lossy_pool": { + "size": "7326924", + "type": "egress", + "mode": "dynamic" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "dynamic_th":"3" + }, + "egress_lossless_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"0", + "static_th":"12766208" + }, + "egress_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"1518", + "dynamic_th":"3" + } + }, +{%- endmacro %} diff --git a/device/quanta/x86_64-quanta_ix8_rglbmc-r0/Quanta-IX8-56X/buffers_defaults_t0.j2 b/device/quanta/x86_64-quanta_ix8_rglbmc-r0/Quanta-IX8-56X/buffers_defaults_t0.j2 new file mode 100644 index 000000000000..44fcf21887a6 --- /dev/null +++ b/device/quanta/x86_64-quanta_ix8_rglbmc-r0/Quanta-IX8-56X/buffers_defaults_t0.j2 @@ -0,0 +1,45 @@ +{%- set default_cable = '300m' %} + +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {% for port_idx in range(0,32) %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} + {% endfor %} +{%- endmacro %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "12766208", + "type": "ingress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "12766208", + "type": "egress", + "mode": "static" + }, + "egress_lossy_pool": { + "size": "7326924", + "type": "egress", + "mode": "dynamic" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "dynamic_th":"3" + }, + "egress_lossless_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"0", + "static_th":"12766208" + }, + "egress_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"1518", + "dynamic_th":"3" + } + }, +{%- endmacro %} diff --git a/device/quanta/x86_64-quanta_ix8_rglbmc-r0/Quanta-IX8-56X/buffers_defaults_t1.j2 b/device/quanta/x86_64-quanta_ix8_rglbmc-r0/Quanta-IX8-56X/buffers_defaults_t1.j2 new file mode 100644 index 000000000000..5fe9cabcfd34 --- /dev/null +++ b/device/quanta/x86_64-quanta_ix8_rglbmc-r0/Quanta-IX8-56X/buffers_defaults_t1.j2 @@ -0,0 +1,46 @@ +{%- set default_cable = '300m' %} + +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {% for port_idx in range(0,32) %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} + {% endfor %} +{%- endmacro %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + "xoff": "196608", + "size": "12766208", + "type": "ingress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "33004032", + "type": "egress", + "mode": "static" + }, + "egress_lossy_pool": { + "size": "12766208", + "type": "egress", + "mode": "dynamic" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "dynamic_th":"3" + }, + "egress_lossless_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"0", + "static_th":"33004032" + }, + "egress_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"1518", + "dynamic_th":"3" + } + }, +{%- endmacro %} diff --git a/device/quanta/x86_64-quanta_ix8_rglbmc-r0/Quanta-IX8-56X/l2/config b/device/quanta/x86_64-quanta_ix8_rglbmc-r0/Quanta-IX8-56X/l2/config new file mode 100644 index 000000000000..b2d4a1e80592 --- /dev/null +++ b/device/quanta/x86_64-quanta_ix8_rglbmc-r0/Quanta-IX8-56X/l2/config @@ -0,0 +1,3 @@ +l2_mem_entries=294912 +l3_mem_entries=16384 +l3_alpm_enable=0 diff --git a/device/quanta/x86_64-quanta_ix8_rglbmc-r0/Quanta-IX8-56X/l3/config b/device/quanta/x86_64-quanta_ix8_rglbmc-r0/Quanta-IX8-56X/l3/config new file mode 100644 index 000000000000..fff0cf54b08a --- /dev/null +++ b/device/quanta/x86_64-quanta_ix8_rglbmc-r0/Quanta-IX8-56X/l3/config @@ -0,0 +1,5 @@ +l2_mem_entries=40960 +l3_mem_entries=40960 +l3_alpm_enable=2 +use_all_splithorizon_groups=1 +sai_tunnel_support=1 diff --git a/device/quanta/x86_64-quanta_ix8_rglbmc-r0/Quanta-IX8-56X/pg_profile_lookup.ini b/device/quanta/x86_64-quanta_ix8_rglbmc-r0/Quanta-IX8-56X/pg_profile_lookup.ini new file mode 100644 index 000000000000..6d91d03ae684 --- /dev/null +++ b/device/quanta/x86_64-quanta_ix8_rglbmc-r0/Quanta-IX8-56X/pg_profile_lookup.ini @@ -0,0 +1,17 @@ +# PG lossless profiles. +# speed cable size xon xoff threshold xon_offset + 10000 5m 9427 0 50176 1 3584 + 25000 5m 9427 0 50176 1 3584 + 40000 5m 9427 0 50176 1 3584 + 50000 5m 9427 0 50176 1 3584 + 100000 5m 9427 0 50176 1 3584 + 10000 40m 9427 0 50176 1 3584 + 25000 40m 9427 0 50176 1 3584 + 40000 40m 9427 0 50176 1 3584 + 50000 40m 9427 0 50176 1 3584 + 100000 40m 9427 0 50176 1 3584 + 10000 300m 9427 0 50176 1 3584 + 25000 300m 9427 0 50176 1 3584 + 40000 300m 9427 0 50176 1 3584 + 50000 300m 9427 0 50176 1 3584 + 100000 300m 9427 0 50176 1 3584 diff --git a/device/quanta/x86_64-quanta_ix8_rglbmc-r0/Quanta-IX8-56X/platform-def.json b/device/quanta/x86_64-quanta_ix8_rglbmc-r0/Quanta-IX8-56X/platform-def.json new file mode 100644 index 000000000000..f052663135eb --- /dev/null +++ b/device/quanta/x86_64-quanta_ix8_rglbmc-r0/Quanta-IX8-56X/platform-def.json @@ -0,0 +1,84 @@ +{ + "port-group": { + "1": { + "members": "Ethernet0-3", + "valid_speeds": ["25000",["10000","1000"]] + }, + "2": { + "members": "Ethernet4-7", + "valid_speeds": ["25000",["10000","1000"]] + }, + "3": { + "members": "Ethernet8-11", + "valid_speeds": ["25000",["10000","1000"]] + }, + "4": { + "members": "Ethernet12-15", + "valid_speeds": ["25000",["10000","1000"]] + }, + "5": { + "members": "Ethernet16-19", + "valid_speeds": ["25000",["10000","1000"]] + }, + "6": { + "members": "Ethernet20-23", + "valid_speeds": ["25000",["10000","1000"]] + }, + "7": { + "members": "Ethernet24-27", + "valid_speeds": ["25000",["10000","1000"]] + }, + "8": { + "members": "Ethernet28-31", + "valid_speeds": ["25000",["10000","1000"]] + }, + "9": { + "members": "Ethernet32-35", + "valid_speeds": ["25000",["10000","1000"]] + }, + "10": { + "members": "Ethernet36-39", + "valid_speeds": ["25000",["10000","1000"]] + }, + "11": { + "members": "Ethernet40-43", + "valid_speeds": ["25000",["10000","1000"]] + }, + "12": { + "members": "Ethernet44-47", + "valid_speeds": ["25000",["10000","1000"]] + } + }, + "fec-mode": { + "Ethernet0-47": { + "1": { + "1000": [ "none" ], + "10000": [ "none", "fc" ], + "25000": [ "none", "rs" ] + } + }, + "Ethernet48-79": { + "1": { + "10000": [ "none", "fc" ], + "25000": [ "none", "rs" ] + }, + "2": { + "20000": [ "none", "fc" ], + "50000": [ "none", "rs" ] + }, + "4": { + "40000": [ "none", "fc" ], + "100000": [ "none", "rs" ] + } + } + }, + "native-port-supported-speeds": { + "Ethernet0-47": { + "1": ["25000","10000","1000"] + }, + "Ethernet48-79": { + "4": ["100000","40000"] + } + } +} + diff --git a/device/quanta/x86_64-quanta_ix8_rglbmc-r0/Quanta-IX8-56X/port_config.ini b/device/quanta/x86_64-quanta_ix8_rglbmc-r0/Quanta-IX8-56X/port_config.ini index c9dd2fb999f9..c2808b2a5e98 100644 --- a/device/quanta/x86_64-quanta_ix8_rglbmc-r0/Quanta-IX8-56X/port_config.ini +++ b/device/quanta/x86_64-quanta_ix8_rglbmc-r0/Quanta-IX8-56X/port_config.ini @@ -1,57 +1,57 @@ -# name lanes alias index speed -Ethernet0 60 twentyfiveGigE1 1 25000 -Ethernet1 59 twentyfiveGigE2 2 25000 -Ethernet2 58 twentyfiveGigE3 3 25000 -Ethernet3 57 twentyfiveGigE4 4 25000 -Ethernet4 64 twentyfiveGigE5 5 25000 -Ethernet5 63 twentyfiveGigE6 6 25000 -Ethernet6 62 twentyfiveGigE7 7 25000 -Ethernet7 61 twentyfiveGigE8 8 25000 -Ethernet8 49 twentyfiveGigE9 9 25000 -Ethernet9 50 twentyfiveGigE10 10 25000 -Ethernet10 51 twentyfiveGigE11 11 25000 -Ethernet11 52 twentyfiveGigE12 12 25000 -Ethernet12 4 twentyfiveGigE13 13 25000 -Ethernet13 3 twentyfiveGigE14 14 25000 -Ethernet14 2 twentyfiveGigE15 15 25000 -Ethernet15 1 twentyfiveGigE16 16 25000 -Ethernet16 8 twentyfiveGigE17 17 25000 -Ethernet17 7 twentyfiveGigE18 18 25000 -Ethernet18 6 twentyfiveGigE19 19 25000 -Ethernet19 5 twentyfiveGigE20 20 25000 -Ethernet20 16 twentyfiveGigE21 21 25000 -Ethernet21 15 twentyfiveGigE22 22 25000 -Ethernet22 14 twentyfiveGigE23 23 25000 -Ethernet23 13 twentyfiveGigE24 24 25000 -Ethernet24 24 twentyfiveGigE25 25 25000 -Ethernet25 23 twentyfiveGigE26 26 25000 -Ethernet26 22 twentyfiveGigE27 27 25000 -Ethernet27 21 twentyfiveGigE28 28 25000 -Ethernet28 32 twentyfiveGigE29 29 25000 -Ethernet29 31 twentyfiveGigE30 30 25000 -Ethernet30 30 twentyfiveGigE31 31 25000 -Ethernet31 29 twentyfiveGigE32 32 25000 -Ethernet32 36 twentyfiveGigE33 33 25000 -Ethernet33 35 twentyfiveGigE34 34 25000 -Ethernet34 34 twentyfiveGigE35 35 25000 -Ethernet35 33 twentyfiveGigE36 36 25000 -Ethernet36 44 twentyfiveGigE37 37 25000 -Ethernet37 43 twentyfiveGigE38 38 25000 -Ethernet38 42 twentyfiveGigE39 39 25000 -Ethernet39 41 twentyfiveGigE40 40 25000 -Ethernet40 86 twentyfiveGigE41 41 25000 -Ethernet41 85 twentyfiveGigE42 42 25000 -Ethernet42 88 twentyfiveGigE43 43 25000 -Ethernet43 87 twentyfiveGigE44 44 25000 -Ethernet44 94 twentyfiveGigE45 45 25000 -Ethernet45 93 twentyfiveGigE46 46 25000 -Ethernet46 96 twentyfiveGigE47 47 25000 -Ethernet47 95 twentyfiveGigE48 48 25000 -Ethernet48 97,98,99,100 hundredGigE49 49 100000 -Ethernet52 105,106,107,108 hundredGigE50 50 100000 -Ethernet56 113,114,115,116 hundredGigE51 51 100000 -Ethernet60 121,122,123,124 hundredGigE52 52 100000 -Ethernet64 77,78,79,80 hundredGigE53 53 100000 -Ethernet68 65,66,67,68 hundredGigE54 54 100000 -Ethernet72 69,70,71,72 hundredGigE55 55 100000 -Ethernet76 125,126,127,128 hundredGigE56 56 100000 +# name lanes alias index speed +Ethernet0 60 twentyfiveGigE1 1 25000 +Ethernet1 59 twentyfiveGigE2 2 25000 +Ethernet2 58 twentyfiveGigE3 3 25000 +Ethernet3 57 twentyfiveGigE4 4 25000 +Ethernet4 64 twentyfiveGigE5 5 25000 +Ethernet5 63 twentyfiveGigE6 6 25000 +Ethernet6 62 twentyfiveGigE7 7 25000 +Ethernet7 61 twentyfiveGigE8 8 25000 +Ethernet8 49 twentyfiveGigE9 9 25000 +Ethernet9 50 twentyfiveGigE10 10 25000 +Ethernet10 51 twentyfiveGigE11 11 25000 +Ethernet11 52 twentyfiveGigE12 12 25000 +Ethernet12 4 twentyfiveGigE13 13 25000 +Ethernet13 3 twentyfiveGigE14 14 25000 +Ethernet14 2 twentyfiveGigE15 15 25000 +Ethernet15 1 twentyfiveGigE16 16 25000 +Ethernet16 8 twentyfiveGigE17 17 25000 +Ethernet17 7 twentyfiveGigE18 18 25000 +Ethernet18 6 twentyfiveGigE19 19 25000 +Ethernet19 5 twentyfiveGigE20 20 25000 +Ethernet20 16 twentyfiveGigE21 21 25000 +Ethernet21 15 twentyfiveGigE22 22 25000 +Ethernet22 14 twentyfiveGigE23 23 25000 +Ethernet23 13 twentyfiveGigE24 24 25000 +Ethernet24 24 twentyfiveGigE25 25 25000 +Ethernet25 23 twentyfiveGigE26 26 25000 +Ethernet26 22 twentyfiveGigE27 27 25000 +Ethernet27 21 twentyfiveGigE28 28 25000 +Ethernet28 32 twentyfiveGigE29 29 25000 +Ethernet29 31 twentyfiveGigE30 30 25000 +Ethernet30 30 twentyfiveGigE31 31 25000 +Ethernet31 29 twentyfiveGigE32 32 25000 +Ethernet32 36 twentyfiveGigE33 33 25000 +Ethernet33 35 twentyfiveGigE34 34 25000 +Ethernet34 34 twentyfiveGigE35 35 25000 +Ethernet35 33 twentyfiveGigE36 36 25000 +Ethernet36 44 twentyfiveGigE37 37 25000 +Ethernet37 43 twentyfiveGigE38 38 25000 +Ethernet38 42 twentyfiveGigE39 39 25000 +Ethernet39 41 twentyfiveGigE40 40 25000 +Ethernet40 86 twentyfiveGigE41 41 25000 +Ethernet41 85 twentyfiveGigE42 42 25000 +Ethernet42 88 twentyfiveGigE43 43 25000 +Ethernet43 87 twentyfiveGigE44 44 25000 +Ethernet44 94 twentyfiveGigE45 45 25000 +Ethernet45 93 twentyfiveGigE46 46 25000 +Ethernet46 96 twentyfiveGigE47 47 25000 +Ethernet47 95 twentyfiveGigE48 48 25000 +Ethernet48 97,98,99,100 hundredGigE49 49 100000 +Ethernet52 105,106,107,108 hundredGigE50 50 100000 +Ethernet56 113,114,115,116 hundredGigE51 51 100000 +Ethernet60 121,122,123,124 hundredGigE52 52 100000 +Ethernet64 77,78,79,80 hundredGigE53 53 100000 +Ethernet68 65,66,67,68 hundredGigE54 54 100000 +Ethernet72 69,70,71,72 hundredGigE55 55 100000 +Ethernet76 125,126,127,128 hundredGigE56 56 100000 diff --git a/device/quanta/x86_64-quanta_ix8_rglbmc-r0/Quanta-IX8-56X/qos.json.j2 b/device/quanta/x86_64-quanta_ix8_rglbmc-r0/Quanta-IX8-56X/qos.json.j2 new file mode 100644 index 000000000000..ee67c6e26221 --- /dev/null +++ b/device/quanta/x86_64-quanta_ix8_rglbmc-r0/Quanta-IX8-56X/qos.json.j2 @@ -0,0 +1 @@ +{%- include 'qos_config_t1.j2' %} diff --git a/device/quanta/x86_64-quanta_ix8_rglbmc-r0/Quanta-IX8-56X/qos_config_t1.j2 b/device/quanta/x86_64-quanta_ix8_rglbmc-r0/Quanta-IX8-56X/qos_config_t1.j2 new file mode 100644 index 000000000000..5fe5324a85c1 --- /dev/null +++ b/device/quanta/x86_64-quanta_ix8_rglbmc-r0/Quanta-IX8-56X/qos_config_t1.j2 @@ -0,0 +1,175 @@ +{%- set PORT_ALL = [] %} +{%- for port in PORT %} + {%- if PORT_ALL.append(port) %}{% endif %} +{%- endfor %} +{%- if PORT_ALL | sort_by_port_index %}{% endif %} + +{%- set port_names_list_all = [] %} +{%- for port in PORT_ALL %} + {%- if port_names_list_all.append(port) %}{% endif %} +{%- endfor %} +{%- set port_names_all = port_names_list_all | join(',') -%} + + +{%- set PORT_ACTIVE = [] %} +{%- if DEVICE_NEIGHBOR is not defined %} + {%- set PORT_ACTIVE = PORT_ALL %} +{%- else %} + {%- for port in DEVICE_NEIGHBOR.keys() %} + {%- if PORT_ACTIVE.append(port) %}{%- endif %} + {%- endfor %} +{%- endif %} +{%- if PORT_ACTIVE | sort_by_port_index %}{% endif %} + +{%- set port_names_list_active = [] %} +{%- for port in PORT_ACTIVE %} + {%- if port_names_list_active.append(port) %}{%- endif %} +{%- endfor %} +{%- set port_names_active = port_names_list_active | join(',') -%} + + +{%- set pfc_to_pg_map_supported_asics = ['mellanox', 'barefoot', 'marvell'] -%} + + +{ +{% if generate_tc_to_pg_map is defined %} + {{- generate_tc_to_pg_map() }} +{% else %} + "TC_TO_PRIORITY_GROUP_MAP": { + "AZURE": { + "0": "0", + "1": "0", + "2": "0", + "3": "3", + "4": "4", + "5": "0", + "6": "0", + "7": "7" + } + }, +{% endif %} + "MAP_PFC_PRIORITY_TO_QUEUE": { + "AZURE": { + "0": "0", + "1": "1", + "2": "2", + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7" + } + }, + "TC_TO_QUEUE_MAP": { + "AZURE": { + "0": "0", + "1": "1", + "2": "2", + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7" + } + }, + "DSCP_TO_TC_MAP": { + "AZURE": { + "0" : "1", + "1" : "1", + "2" : "1", + "3" : "3", + "4" : "4", + "5" : "2", + "6" : "1", + "7" : "1", + "8" : "0", + "9" : "1", + "10": "1", + "11": "1", + "12": "1", + "13": "1", + "14": "1", + "15": "1", + "16": "1", + "17": "1", + "18": "1", + "19": "1", + "20": "1", + "21": "1", + "22": "1", + "23": "1", + "24": "1", + "25": "1", + "26": "1", + "27": "1", + "28": "1", + "29": "1", + "30": "1", + "31": "1", + "32": "1", + "33": "1", + "34": "1", + "35": "1", + "36": "1", + "37": "1", + "38": "1", + "39": "1", + "40": "1", + "41": "1", + "42": "1", + "43": "1", + "44": "1", + "45": "1", + "46": "5", + "47": "1", + "48": "6", + "49": "1", + "50": "1", + "51": "1", + "52": "1", + "53": "1", + "54": "1", + "55": "1", + "56": "1", + "57": "1", + "58": "1", + "59": "1", + "60": "1", + "61": "1", + "62": "1", + "63": "1" + } + }, + "SCHEDULER": { + "scheduler.0": { + "type" : "DWRR", + "weight": "14" + }, + "scheduler.1": { + "type" : "DWRR", + "weight": "15" + } + }, +{% if asic_type in pfc_to_pg_map_supported_asics %} + "PFC_PRIORITY_TO_PRIORITY_GROUP_MAP": { + "AZURE": { + "3": "3", + "4": "4" + } + }, +{% endif %} + "PORT_QOS_MAP": { +{% for port in PORT_ACTIVE %} + "{{ port }}": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", +{% if asic_type in pfc_to_pg_map_supported_asics %} + "pfc_to_pg_map" : "[PFC_PRIORITY_TO_PRIORITY_GROUP_MAP|AZURE]", +{% endif %} + "pfc_enable" : "3,4" + }{% if not loop.last %},{% endif %} +{% endfor %} + } +} diff --git a/device/quanta/x86_64-quanta_ix8_rglbmc-r0/Quanta-IX8-56X/td3-ix8-48x25G+8x100G.config.bcm b/device/quanta/x86_64-quanta_ix8_rglbmc-r0/Quanta-IX8-56X/td3-ix8-48x25G+8x100G.config.bcm index 407105d0ca0a..06ff6dc80037 100644 --- a/device/quanta/x86_64-quanta_ix8_rglbmc-r0/Quanta-IX8-56X/td3-ix8-48x25G+8x100G.config.bcm +++ b/device/quanta/x86_64-quanta_ix8_rglbmc-r0/Quanta-IX8-56X/td3-ix8-48x25G+8x100G.config.bcm @@ -1,14 +1,22 @@ -bcm_tunnel_term_compatible_mode=1 +sai_load_hw_config=/etc/bcm/flex/bcm56870_a0_issu/b870.6.4.1/ core_clock_frequency=1525 dpp_clock_ratio=2:3 -parity_enable=0 mem_cache_enable=0 l2_mem_entries=40960 l3_mem_entries=40960 -fpem_mem_entries=16384 +fpem_mem_entries=0 l2xmsg_mode=1 +l3_alpm_ipv6_128b_bkt_rsvd=1 + +#RIOT Enable +riot_enable=1 +riot_overlay_l3_intf_mem_size=4096 +riot_overlay_l3_egress_mem_size=32768 +l3_ecmp_levels=2 +riot_overlay_ecmp_resilient_hash_size=16384 bcm_num_cos=10 +default_cpu_tx_queue=9 bcm_stat_interval=2000000 cdma_timeout_usec=3000000 @@ -28,7 +36,8 @@ tdma_timeout_usec=3000000 # portmap settings oversubscribe_mode=1 -pbmp_xport_xe=0x48808080f8780808dfe1e1e1fe1e1e1fe +#pbmp_xport_xe=0x48808080f8780808dfe1e1e1fe1e1e1fe +pbmp_xport_xe=0x7F878787F878787FDFE1E1E1FE1E1E1FE port_flex_enable=1 @@ -72,9 +81,6 @@ portmap_61=61:25 portmap_62=62:25 portmap_63=63:25 portmap_64=64:25 -portmap_67=65:100 -portmap_71=69:100 -portmap_79=77:100 portmap_87=85:25 portmap_88=86:25 portmap_89=87:25 @@ -83,6 +89,10 @@ portmap_95=93:25 portmap_96=94:25 portmap_97=95:25 portmap_98=96:25 + +portmap_67=65:100 +portmap_71=69:100 +portmap_79=77:100 portmap_99=97:100 portmap_107=105:100 portmap_115=113:100 @@ -90,8 +100,10 @@ portmap_123=121:100 portmap_127=125:100 # datapath port -- MerlinCore -portmap_66=129:10:m -portmap_130=128:10:m +#Hide these to prevent SAI from initializing them...they are physically not on system +#front panel +#portmap_66=129:10:m +#portmap_130=128:10:m # loopback port portmap_65=130:10 @@ -165,9 +177,6 @@ serdes_if_type_61=13 serdes_if_type_62=13 serdes_if_type_63=13 serdes_if_type_64=13 -serdes_if_type_67=14 -serdes_if_type_71=14 -serdes_if_type_79=14 serdes_if_type_87=13 serdes_if_type_88=13 serdes_if_type_89=13 @@ -176,11 +185,16 @@ serdes_if_type_95=13 serdes_if_type_96=13 serdes_if_type_97=13 serdes_if_type_98=13 + +serdes_if_type_67=14 +serdes_if_type_71=14 +serdes_if_type_79=14 serdes_if_type_99=14 serdes_if_type_107=14 serdes_if_type_115=14 serdes_if_type_123=14 serdes_if_type_127=14 + serdes_if_type_66=11 serdes_if_type_130=11 @@ -233,17 +247,48 @@ dport_map_port_96=45 dport_map_port_95=46 dport_map_port_98=47 dport_map_port_97=48 -dport_map_port_99=49 -dport_map_port_107=50 -dport_map_port_115=51 -dport_map_port_123=52 -dport_map_port_79=53 -dport_map_port_67=54 -dport_map_port_71=55 -dport_map_port_127=56 -dport_map_port_66=57 -dport_map_port_130=58 +dport_map_port_67=49 +dport_map_port_68=50 +dport_map_port_69=51 +dport_map_port_70=52 + +dport_map_port_71=53 +dport_map_port_72=54 +dport_map_port_73=55 +dport_map_port_74=56 + +dport_map_port_79=57 +dport_map_port_80=58 +dport_map_port_81=59 +dport_map_port_82=60 + +dport_map_port_99=61 +dport_map_port_100=62 +dport_map_port_101=63 +dport_map_port_102=64 + +dport_map_port_107=65 +dport_map_port_108=66 +dport_map_port_109=67 +dport_map_port_110=68 + +dport_map_port_115=69 +dport_map_port_116=70 +dport_map_port_117=71 +dport_map_port_118=72 + +dport_map_port_123=73 +dport_map_port_124=74 +dport_map_port_125=75 +dport_map_port_126=76 + +# Not able to breakout, Since overlap with mgmt port +dport_map_port_127=77 + +# mgmt ports +dport_map_port_66=81 +dport_map_port_130=82 phy_chain_tx_lane_map_physical{1.0}=0x3210 @@ -478,3 +523,8 @@ phy_chain_rx_polarity_flip_physical{130.0}=0x0 phy_chain_rx_polarity_flip_physical{131.0}=0x0 phy_chain_rx_polarity_flip_physical{132.0}=0x0 +l2_mem_entries=40960 +l3_mem_entries=40960 +l3_alpm_enable=2 +use_all_splithorizon_groups=1 + diff --git a/device/quanta/x86_64-quanta_ix8_rglbmc-r0/custom_led.bin b/device/quanta/x86_64-quanta_ix8_rglbmc-r0/custom_led.bin new file mode 100644 index 000000000000..7f3ff6a684df Binary files /dev/null and b/device/quanta/x86_64-quanta_ix8_rglbmc-r0/custom_led.bin differ diff --git a/device/quanta/x86_64-quanta_ix8_rglbmc-r0/installer.conf b/device/quanta/x86_64-quanta_ix8_rglbmc-r0/installer.conf index 14404194ef53..8b2b94dfebea 100644 --- a/device/quanta/x86_64-quanta_ix8_rglbmc-r0/installer.conf +++ b/device/quanta/x86_64-quanta_ix8_rglbmc-r0/installer.conf @@ -1,3 +1,4 @@ CONSOLE_PORT=0x2f8 CONSOLE_DEV=1 CONSOLE_SPEED=115200 +ONIE_PLATFORM_EXTRA_CMDLINE_LINUX="modprobe.blacklist=i2c-ismt,i2c_ismt,ixgbe" diff --git a/device/quanta/x86_64-quanta_ix8_rglbmc-r0/led_proc_init.soc b/device/quanta/x86_64-quanta_ix8_rglbmc-r0/led_proc_init.soc old mode 100755 new mode 100644 index 0861486660c3..bf9f29924dab --- a/device/quanta/x86_64-quanta_ix8_rglbmc-r0/led_proc_init.soc +++ b/device/quanta/x86_64-quanta_ix8_rglbmc-r0/led_proc_init.soc @@ -1,6 +1,4 @@ -sleep 10 -led stop -sleep 3 +m0 load 0 0x3800 /usr/share/sonic/platform/custom_led.bin led start -sleep 3 -led auto on \ No newline at end of file +rcload /usr/share/sonic/platform/preemphasis-48x25_8x100.soc + diff --git a/device/quanta/x86_64-quanta_ix8_rglbmc-r0/plugins/eeprom.py b/device/quanta/x86_64-quanta_ix8_rglbmc-r0/plugins/eeprom.py index fa34110c04ea..3752a919cba4 100644 --- a/device/quanta/x86_64-quanta_ix8_rglbmc-r0/plugins/eeprom.py +++ b/device/quanta/x86_64-quanta_ix8_rglbmc-r0/plugins/eeprom.py @@ -16,5 +16,5 @@ class board(eeprom_tlvinfo.TlvInfoDecoder): _TLV_INFO_MAX_LEN = 256 def __init__(self, name, path, cpld_root, ro): - self.eeprom_path = "/sys/bus/i2c/devices/18-0054/eeprom" + self.eeprom_path = "/sys/bus/i2c/devices/3-0054/eeprom" super(board, self).__init__(self.eeprom_path, 0, '', True) diff --git a/device/quanta/x86_64-quanta_ix8_rglbmc-r0/plugins/fanutil.py b/device/quanta/x86_64-quanta_ix8_rglbmc-r0/plugins/fanutil.py new file mode 100644 index 000000000000..dad8dcfedd7b --- /dev/null +++ b/device/quanta/x86_64-quanta_ix8_rglbmc-r0/plugins/fanutil.py @@ -0,0 +1,110 @@ +# +# fanutil.py +# Platform-specific Fan status interface for SONiC +# + +import logging +import os.path + +try: + from sonic_fan.fan_base import FanBase +except ImportError as e: + raise ImportError (str(e) + "- required module not found") + +class FanUtil(FanBase): + """Platform-specific FANutil class""" + + SYS_FAN_NUM = 6 + NUM_FANS_PERTRAY = 2 + HWMON_PATH = '/sys/class/hwmon/hwmon1/' + FAN_INDEX_START = 21 + + logger = logging.getLogger(__name__) + + def __init__(self, log_level=logging.DEBUG): + FanBase.__init__(self) + self.num_fans = (self.SYS_FAN_NUM * self.NUM_FANS_PERTRAY) + + # Get sysfs attribute + def get_attr_value(self, attr_path): + + retval = 'ERR' + if (not os.path.isfile(attr_path)): + return retval + + try: + with open(attr_path, 'r') as fd: + retval = fd.read() + except Exception: + logging.error("Unable to open ", attr_path, " file !") + + retval = retval.rstrip('\r\n') + return retval + + def check_fan_index(self, index): + if index is None: + return False + + if index < 1 or index > self.num_fans: + logging.error("Invalid Fan index:", index) + return False + + return True + + def get_num_fans(self): + return self.num_fans + + def get_status(self, index): + if self.check_fan_index(index) == False: + return False + + fantray_speed_file = 'fan' + str(self.FAN_INDEX_START+(index-1)) + '_input' + fantray_speed = self.get_attr_value(self.HWMON_PATH + fantray_speed_file) + + if fantray_speed == '0.0' : + return False + + return True + + def get_presence(self, index): + if self.check_fan_index(index) == False: + return False + + fantray_present_file = 'fan' + str(self.FAN_INDEX_START+(index-1)) + '_present' + fantray_present = self.get_attr_value(self.HWMON_PATH + fantray_present_file) + + if fantray_present == '1' : + return True + + return False + + def get_direction(self, index): + if self.check_fan_index(index) == False: + return None + + fantray_direction_file = 'fan' + str(self.FAN_INDEX_START+(index-1)) + '_direction' + fantray_direction = self.get_attr_value(self.HWMON_PATH + fantray_direction_file) + + """ + 1: FB 2: BF + Since the fan is at rear of the switch, FB means Exhaust; BF means Intake + """ + if fantray_direction == '2': + return "INTAKE" + else: + return "EXHAUST" + + def get_speed(self, index): + if self.check_fan_index(index) == False: + return 0 + + fantray_speed_file = 'fan' + str(self.FAN_INDEX_START+(index-1)) + '_input' + fantray_speed = self.get_attr_value(self.HWMON_PATH + fantray_speed_file) + + return int(float(fantray_speed)) + + + def set_speed(self, val): + logging.error("Not allowed to set fan speed!") + + return False diff --git a/device/quanta/x86_64-quanta_ix8_rglbmc-r0/plugins/psuutil.py b/device/quanta/x86_64-quanta_ix8_rglbmc-r0/plugins/psuutil.py index 5cf06fb5d66a..b2753d1759e4 100644 --- a/device/quanta/x86_64-quanta_ix8_rglbmc-r0/plugins/psuutil.py +++ b/device/quanta/x86_64-quanta_ix8_rglbmc-r0/plugins/psuutil.py @@ -1,50 +1,251 @@ -# -# psuutil.py -# Platform-specific PSU status interface for SONiC -# - -import os.path - -try: - from sonic_psu.psu_base import PsuBase -except ImportError as e: - raise ImportError(str(e) + "- required module not found") - - -class PsuUtil(PsuBase): - """Platform-specific PSUutil class""" - - def __init__(self): - PsuBase.__init__(self) - - def get_num_psus(self): - """ - Retrieves the number of PSUs available on the device - :return: An integer, the number of PSUs available on the device - """ - MAX_PSUS = 2 - - return MAX_PSUS - - def get_psu_status(self, index): - """ - Retrieves the oprational status of power supply unit (PSU) defined - by index - :param index: An integer, index of the PSU of which to query status - :return: Boolean, True if PSU is operating properly, False if PSU is\ - faulty - """ - status = 1 - - return status - - def get_psu_presence(self, index): - """ - Retrieves the presence status of power supply unit (PSU) defined - by index - :param index: An integer, index of the PSU of which to query status - :return: Boolean, True if PSU is plugged, False if not - """ - status = 1 - - return status +# +# psuutil.py +# Platform-specific PSU status interface for SONiC +# + +import logging +import os.path + +try: + from sonic_psu.psu_base import PsuBase +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class PsuUtil(PsuBase): + """Platform-specific PSUutil class""" + + HWMON_PATH = '/sys/class/hwmon/hwmon1/' + PSU1_PREFIX = 'power43_' + PSU2_PREFIX = 'power54_' + MAX_PSUS = 2 + def __init__(self): + PsuBase.__init__(self) + + # Get sysfs attribute + def get_attr_value(self, attr_path): + + retval = 'ERR' + if (not os.path.isfile(attr_path)): + return retval + + try: + with open(attr_path, 'r') as fd: + retval = fd.read() + except Exception: + logging.error("Unable to open ", attr_path, " file !") + + retval = retval.rstrip('\r\n') + return retval + + def get_attr_filename(self, index, attr): + if (index == 1): + attr_file = self.PSU1_PREFIX + attr + elif (index == 2): + attr_file = self.PSU2_PREFIX + attr + else: + logging.error("Invalid PSU number:", index) + return '' + + return attr_file + + def get_num_psus(self): + """ + Retrieves the number of PSUs available on the device + :return: An integer, the number of PSUs available on the device + """ + + return self.MAX_PSUS + + def get_psu_status(self, index): + """ + Retrieves the oprational status of power supply unit (PSU) defined + by index + :param index: An integer, index of the PSU of which to query status + :return: Boolean, True if PSU is operating properly, False if PSU is\ + faulty + """ + status = False + + attr_filename = self.get_attr_filename(index, 'input') + if attr_filename == '': + return status + + attr_path = self.HWMON_PATH + attr_filename + attr_value = self.get_attr_value(attr_path) + + if (attr_value != 'ERR'): + attr_value = float(attr_value) + + # Check PSU status + if (attr_value != 0.0): + status = True + + return status + + def get_psu_presence(self, index): + """ + Retrieves the presence status of power supply unit (PSU) defined + by index + :param index: An integer, index of the PSU of which to query status + :return: Boolean, True if PSU is plugged, False if not + """ + status = False + + attr_filename = self.get_attr_filename(index, 'present') + if attr_filename == '': + return status + + attr_path = self.HWMON_PATH + attr_filename + attr_value = self.get_attr_value(attr_path) + + if (attr_value != 'ERR'): + attr_value = int(attr_value, 16) + # Check PSU status + if (attr_value == 1): + status = True + return status + + def get_powergood_status(self, index): + status = False + + attr_filename = self.get_attr_filename(index, 'input') + if attr_filename == '': + return status + + attr_path = self.HWMON_PATH + attr_filename + attr_value = self.get_attr_value(attr_path) + + if (attr_value != 'ERR'): + attr_value = float(attr_value) + + # Check PSU status + if (attr_value != 0.0): + status = True + + return status + + def get_model(self, index): + attr_filename = self.get_attr_filename(index, 'model') + if attr_filename == '': + return None + + attr_path = self.HWMON_PATH + attr_filename + attr_value = self.get_attr_value(attr_path) + + if (attr_value != 'ERR'): + return attr_value.rstrip() + + def get_mfr_id(self, index): + attr_filename = self.get_attr_filename(index, 'mfrid') + if attr_filename == '': + return None + + attr_path = self.HWMON_PATH + attr_filename + attr_value = self.get_attr_value(attr_path) + + if (attr_value != 'ERR'): + return attr_value.rstrip() + + def get_serial(self, index): + attr_filename = self.get_attr_filename(index, 'sn') + if attr_filename == '': + return None + + attr_path = self.HWMON_PATH + attr_filename + attr_value = self.get_attr_value(attr_path) + + if (attr_value != 'ERR'): + return attr_value.rstrip() + + def get_direction(self, index): + if (index == 1): + direction_file = 'fan41_direction' + elif (index == 2): + direction_file = 'fan52_direction' + else: + logging.error("Invalid PSU number:", index) + return None + + direction = self.get_attr_value(self.HWMON_PATH + direction_file) + direction = direction.rstrip() + + """ + 1: FB 2: BF + Since the fan is at rear of the switch, FB means Exhaust; BF means Intake + """ + if direction == '2': + return "INTAKE" + else: + return "EXHAUST" + + def get_output_voltage(self, index): + if (index == 1): + attr_file = 'in48_input' + elif (index == 2): + attr_file = 'in59_input' + else: + logging.error("Invalid PSU number:", index) + return 0.0 + + voltage = self.get_attr_value(self.HWMON_PATH + attr_file) + voltage = voltage.rstrip() + + if (voltage != 'ERR'): + voltage, dummy = voltage.split('.', 1) + else: + return 0.0 + + return float(voltage)/1000 + + def get_output_current(self, index): + if (index == 1): + attr_file = 'curr40_input' + elif (index == 2): + attr_file = 'curr51_input' + else: + logging.error("Invalid PSU number:", index) + return 0.0 + + current = self.get_attr_value(self.HWMON_PATH + attr_file) + current = current.rstrip() + + if (current != 'ERR'): + current, dummy = current.split('.',1) + else: + return 0.0 + + return float(current)/1000 + + def get_output_power(self, index): + attr_filename = self.get_attr_filename(index, 'input') + if attr_filename == '': + return 0.0 + + attr_path = self.HWMON_PATH + attr_filename + attr_value = self.get_attr_value(attr_path) + + if (attr_value != 'ERR'): + attr_value = float(attr_value) + else: + return 0.0 + + return float(attr_value/1000) + + def get_fan_rpm(self, index, fan_idx): + if (index == 1): + rpm_file = 'fan41_input' + elif (index == 2): + rpm_file = 'fan52_input' + else: + logging.error("Invalid PSU number:", index) + return 0 + + rpm = self.get_attr_value(self.HWMON_PATH + rpm_file) + rpm = rpm.rstrip() + if (rpm != 'ERR'): + rpm = float(rpm) + else: + return 0 + + return int(rpm) diff --git a/device/quanta/x86_64-quanta_ix8_rglbmc-r0/plugins/sfputil.py b/device/quanta/x86_64-quanta_ix8_rglbmc-r0/plugins/sfputil.py index 3067919795d5..4dc269829c0a 100644 --- a/device/quanta/x86_64-quanta_ix8_rglbmc-r0/plugins/sfputil.py +++ b/device/quanta/x86_64-quanta_ix8_rglbmc-r0/plugins/sfputil.py @@ -23,62 +23,62 @@ class SfpUtil(SfpUtilBase): _port_to_eeprom_mapping = {} _port_to_i2c_mapping = { - 1: 32, - 2: 33, - 3: 34, - 4: 35, - 5: 36, - 6: 37, - 7: 38, - 8: 39, - 9: 40, - 10: 41, - 11: 42, - 12: 43, - 13: 44, - 14: 45, - 15: 46, - 16: 47, - 17: 48, - 18: 49, - 19: 50, - 20: 51, - 21: 52, - 22: 53, - 23: 54, - 24: 55, - 25: 56, - 26: 57, - 27: 58, - 28: 59, - 29: 60, - 30: 61, - 31: 62, - 32: 63, - 33: 64, - 34: 65, - 35: 66, - 36: 67, - 37: 68, - 38: 69, - 39: 70, - 40: 71, - 41: 72, - 42: 73, - 43: 74, - 44: 75, - 45: 76, - 46: 77, - 47: 78, - 48: 79, - 49: 80, # QSFP49 - 50: 81, # QSFP50 - 51: 82, # QSFP51 - 52: 83, # QSFP52 - 53: 84, # QSFP53 - 54: 85, # QSFP54 - 55: 86, # QSFP55 - 56: 87, # QSFP56 + 1 : 17, + 2 : 18, + 3 : 19, + 4 : 20, + 5 : 21, + 6 : 22, + 7 : 23, + 8 : 24, + 9 : 25, + 10 : 26, + 11 : 27, + 12 : 28, + 13 : 29, + 14 : 30, + 15 : 31, + 16 : 32, + 17 : 33, + 18 : 34, + 19 : 35, + 20 : 36, + 21 : 37, + 22 : 38, + 23 : 39, + 24 : 40, + 25 : 41, + 26 : 42, + 27 : 43, + 28 : 44, + 29 : 45, + 30 : 46, + 31 : 47, + 32 : 48, + 33 : 49, + 34 : 50, + 35 : 51, + 36 : 52, + 37 : 53, + 38 : 54, + 39 : 55, + 40 : 56, + 41 : 57, + 42 : 58, + 43 : 59, + 44 : 60, + 45 : 61, + 46 : 62, + 47 : 63, + 48 : 64, + 49 : 65,#QSFP49 + 50 : 66,#QSFP50 + 51 : 67,#QSFP51 + 52 : 68,#QSFP52 + 53 : 69,#QSFP53 + 54 : 70,#QSFP54 + 55 : 71,#QSFP55 + 56 : 72,#QSFP56 } @property diff --git a/device/quanta/x86_64-quanta_ix8_rglbmc-r0/pmon_daemon_control.json b/device/quanta/x86_64-quanta_ix8_rglbmc-r0/pmon_daemon_control.json new file mode 100644 index 000000000000..98506b46146d --- /dev/null +++ b/device/quanta/x86_64-quanta_ix8_rglbmc-r0/pmon_daemon_control.json @@ -0,0 +1,3 @@ +{ + "skip_ledd": true +} \ No newline at end of file diff --git a/device/quanta/x86_64-quanta_ix8_rglbmc-r0/preemphasis-48x25_8x100.soc b/device/quanta/x86_64-quanta_ix8_rglbmc-r0/preemphasis-48x25_8x100.soc new file mode 100644 index 000000000000..3a0193b73da5 --- /dev/null +++ b/device/quanta/x86_64-quanta_ix8_rglbmc-r0/preemphasis-48x25_8x100.soc @@ -0,0 +1,325 @@ +# 48x25G 8x100G pre-emphasis setting for Quanta IX8 +echo "Set tx pre-emphasis and idriver values" +linkscan off + +# Start of 48x25G + +phy raw c45 0xd1 0x1 0xffde 0 +phy raw c45 0xd1 0x1 0xd130 0x55 +phy raw c45 0xd1 0x1 0xd131 0x303 +phy raw c45 0xd1 0x1 0xd134 0x1 +phy raw c45 0xd1 0x1 0xffde 1 +phy raw c45 0xd1 0x1 0xd130 0x55 +phy raw c45 0xd1 0x1 0xd131 0x303 +phy raw c45 0xd1 0x1 0xd134 0x1 +phy raw c45 0xd1 0x1 0xffde 2 +phy raw c45 0xd1 0x1 0xd130 0x55 +phy raw c45 0xd1 0x1 0xd131 0x303 +phy raw c45 0xd1 0x1 0xd134 0x1 +phy raw c45 0xd1 0x1 0xffde 3 +phy raw c45 0xd1 0x1 0xd130 0x55 +phy raw c45 0xd1 0x1 0xd131 0x303 +phy raw c45 0xd1 0x1 0xd134 0x1 + +phy raw c45 0xd5 0x1 0xffde 0 +phy raw c45 0xd5 0x1 0xd130 0x55 +phy raw c45 0xd5 0x1 0xd131 0x303 +phy raw c45 0xd5 0x1 0xd134 0x1 +phy raw c45 0xd5 0x1 0xffde 1 +phy raw c45 0xd5 0x1 0xd130 0x55 +phy raw c45 0xd5 0x1 0xd131 0x303 +phy raw c45 0xd5 0x1 0xd134 0x1 +phy raw c45 0xd5 0x1 0xffde 2 +phy raw c45 0xd5 0x1 0xd130 0x55 +phy raw c45 0xd5 0x1 0xd131 0x303 +phy raw c45 0xd5 0x1 0xd134 0x1 +phy raw c45 0xd5 0x1 0xffde 3 +phy raw c45 0xd5 0x1 0xd130 0x55 +phy raw c45 0xd5 0x1 0xd131 0x303 +phy raw c45 0xd5 0x1 0xd134 0x1 + +phy raw c45 0xc9 0x1 0xffde 0 +phy raw c45 0xc9 0x1 0xd130 0x55 +phy raw c45 0xc9 0x1 0xd131 0x303 +phy raw c45 0xc9 0x1 0xd134 0x1 +phy raw c45 0xc9 0x1 0xffde 1 +phy raw c45 0xc9 0x1 0xd130 0x55 +phy raw c45 0xc9 0x1 0xd131 0x303 +phy raw c45 0xc9 0x1 0xd134 0x1 +phy raw c45 0xc9 0x1 0xffde 2 +phy raw c45 0xc9 0x1 0xd130 0x55 +phy raw c45 0xc9 0x1 0xd131 0x303 +phy raw c45 0xc9 0x1 0xd134 0x1 +phy raw c45 0xc9 0x1 0xffde 3 +phy raw c45 0xc9 0x1 0xd130 0x55 +phy raw c45 0xc9 0x1 0xd131 0x303 +phy raw c45 0xc9 0x1 0xd134 0x1 + +phy raw c45 0x81 0x1 0xffde 0 +phy raw c45 0x81 0x1 0xd130 0x55 +phy raw c45 0x81 0x1 0xd131 0x303 +phy raw c45 0x81 0x1 0xd134 0x1 +phy raw c45 0x81 0x1 0xffde 1 +phy raw c45 0x81 0x1 0xd130 0x55 +phy raw c45 0x81 0x1 0xd131 0x303 +phy raw c45 0x81 0x1 0xd134 0x1 +phy raw c45 0x81 0x1 0xffde 2 +phy raw c45 0x81 0x1 0xd130 0x55 +phy raw c45 0x81 0x1 0xd131 0x303 +phy raw c45 0x81 0x1 0xd134 0x1 +phy raw c45 0x81 0x1 0xffde 3 +phy raw c45 0x81 0x1 0xd130 0x55 +phy raw c45 0x81 0x1 0xd131 0x303 +phy raw c45 0x81 0x1 0xd134 0x1 + +phy raw c45 0x85 0x1 0xffde 0 +phy raw c45 0x85 0x1 0xd130 0x55 +phy raw c45 0x85 0x1 0xd131 0x303 +phy raw c45 0x85 0x1 0xd134 0x1 +phy raw c45 0x85 0x1 0xffde 1 +phy raw c45 0x85 0x1 0xd130 0x55 +phy raw c45 0x85 0x1 0xd131 0x303 +phy raw c45 0x85 0x1 0xd134 0x1 +phy raw c45 0x85 0x1 0xffde 2 +phy raw c45 0x85 0x1 0xd130 0x55 +phy raw c45 0x85 0x1 0xd131 0x303 +phy raw c45 0x85 0x1 0xd134 0x1 +phy raw c45 0x85 0x1 0xffde 3 +phy raw c45 0x85 0x1 0xd130 0x55 +phy raw c45 0x85 0x1 0xd131 0x303 +phy raw c45 0x85 0x1 0xd134 0x1 + +phy raw c45 0x8d 0x1 0xffde 0 +phy raw c45 0x8d 0x1 0xd130 0x55 +phy raw c45 0x8d 0x1 0xd131 0x303 +phy raw c45 0x8d 0x1 0xd134 0x1 +phy raw c45 0x8d 0x1 0xffde 1 +phy raw c45 0x8d 0x1 0xd130 0x55 +phy raw c45 0x8d 0x1 0xd131 0x303 +phy raw c45 0x8d 0x1 0xd134 0x1 +phy raw c45 0x8d 0x1 0xffde 2 +phy raw c45 0x8d 0x1 0xd130 0x55 +phy raw c45 0x8d 0x1 0xd131 0x303 +phy raw c45 0x8d 0x1 0xd134 0x1 +phy raw c45 0x8d 0x1 0xffde 3 +phy raw c45 0x8d 0x1 0xd130 0x55 +phy raw c45 0x8d 0x1 0xd131 0x303 +phy raw c45 0x8d 0x1 0xd134 0x1 + +phy raw c45 0x95 0x1 0xffde 0 +phy raw c45 0x95 0x1 0xd130 0x55 +phy raw c45 0x95 0x1 0xd131 0x303 +phy raw c45 0x95 0x1 0xd134 0x1 +phy raw c45 0x95 0x1 0xffde 1 +phy raw c45 0x95 0x1 0xd130 0x55 +phy raw c45 0x95 0x1 0xd131 0x303 +phy raw c45 0x95 0x1 0xd134 0x1 +phy raw c45 0x95 0x1 0xffde 2 +phy raw c45 0x95 0x1 0xd130 0x55 +phy raw c45 0x95 0x1 0xd131 0x303 +phy raw c45 0x95 0x1 0xd134 0x1 +phy raw c45 0x95 0x1 0xffde 3 +phy raw c45 0x95 0x1 0xd130 0x55 +phy raw c45 0x95 0x1 0xd131 0x303 +phy raw c45 0x95 0x1 0xd134 0x1 + +phy raw c45 0xa5 0x1 0xffde 0 +phy raw c45 0xa5 0x1 0xd130 0x55 +phy raw c45 0xa5 0x1 0xd131 0x303 +phy raw c45 0xa5 0x1 0xd134 0x1 +phy raw c45 0xa5 0x1 0xffde 1 +phy raw c45 0xa5 0x1 0xd130 0x55 +phy raw c45 0xa5 0x1 0xd131 0x303 +phy raw c45 0xa5 0x1 0xd134 0x1 +phy raw c45 0xa5 0x1 0xffde 2 +phy raw c45 0xa5 0x1 0xd130 0x55 +phy raw c45 0xa5 0x1 0xd131 0x303 +phy raw c45 0xa5 0x1 0xd134 0x1 +phy raw c45 0xa5 0x1 0xffde 3 +phy raw c45 0xa5 0x1 0xd130 0x55 +phy raw c45 0xa5 0x1 0xd131 0x303 +phy raw c45 0xa5 0x1 0xd134 0x1 + +phy raw c45 0xa9 0x1 0xffde 0 +phy raw c45 0xa9 0x1 0xd130 0x55 +phy raw c45 0xa9 0x1 0xd131 0x303 +phy raw c45 0xa9 0x1 0xd134 0x1 +phy raw c45 0xa9 0x1 0xffde 1 +phy raw c45 0xa9 0x1 0xd130 0x55 +phy raw c45 0xa9 0x1 0xd131 0x303 +phy raw c45 0xa9 0x1 0xd134 0x1 +phy raw c45 0xa9 0x1 0xffde 2 +phy raw c45 0xa9 0x1 0xd130 0x55 +phy raw c45 0xa9 0x1 0xd131 0x303 +phy raw c45 0xa9 0x1 0xd134 0x1 +phy raw c45 0xa9 0x1 0xffde 3 +phy raw c45 0xa9 0x1 0xd130 0x55 +phy raw c45 0xa9 0x1 0xd131 0x303 +phy raw c45 0xa9 0x1 0xd134 0x1 + +phy raw c45 0xc1 0x1 0xffde 0 +phy raw c45 0xc1 0x1 0xd130 0x55 +phy raw c45 0xc1 0x1 0xd131 0x303 +phy raw c45 0xc1 0x1 0xd134 0x1 +phy raw c45 0xc1 0x1 0xffde 1 +phy raw c45 0xc1 0x1 0xd130 0x55 +phy raw c45 0xc1 0x1 0xd131 0x303 +phy raw c45 0xc1 0x1 0xd134 0x1 +phy raw c45 0xc1 0x1 0xffde 2 +phy raw c45 0xc1 0x1 0xd130 0x55 +phy raw c45 0xc1 0x1 0xd131 0x303 +phy raw c45 0xc1 0x1 0xd134 0x1 +phy raw c45 0xc1 0x1 0xffde 3 +phy raw c45 0xc1 0x1 0xd130 0x55 +phy raw c45 0xc1 0x1 0xd131 0x303 +phy raw c45 0xc1 0x1 0xd134 0x1 + +phy raw c45 0xf5 0x1 0xffde 0 +phy raw c45 0xf5 0x1 0xd130 0x55 +phy raw c45 0xf5 0x1 0xd131 0x303 +phy raw c45 0xf5 0x1 0xd134 0x1 +phy raw c45 0xf5 0x1 0xffde 1 +phy raw c45 0xf5 0x1 0xd130 0x55 +phy raw c45 0xf5 0x1 0xd131 0x303 +phy raw c45 0xf5 0x1 0xd134 0x1 +phy raw c45 0xf5 0x1 0xffde 2 +phy raw c45 0xf5 0x1 0xd130 0x55 +phy raw c45 0xf5 0x1 0xd131 0x303 +phy raw c45 0xf5 0x1 0xd134 0x1 +phy raw c45 0xf5 0x1 0xffde 3 +phy raw c45 0xf5 0x1 0xd130 0x55 +phy raw c45 0xf5 0x1 0xd131 0x303 +phy raw c45 0xf5 0x1 0xd134 0x1 + +phy raw c45 0x185 0x1 0xffde 0 +phy raw c45 0x185 0x1 0xd130 0x55 +phy raw c45 0x185 0x1 0xd131 0x303 +phy raw c45 0x185 0x1 0xd134 0x1 +phy raw c45 0x185 0x1 0xffde 1 +phy raw c45 0x185 0x1 0xd130 0x55 +phy raw c45 0x185 0x1 0xd131 0x303 +phy raw c45 0x185 0x1 0xd134 0x1 +phy raw c45 0x185 0x1 0xffde 2 +phy raw c45 0x185 0x1 0xd130 0x55 +phy raw c45 0x185 0x1 0xd131 0x303 +phy raw c45 0x185 0x1 0xd134 0x1 +phy raw c45 0x185 0x1 0xffde 3 +phy raw c45 0x185 0x1 0xd130 0x55 +phy raw c45 0x185 0x1 0xd131 0x303 +phy raw c45 0x185 0x1 0xd134 0x1 + +# Start of 8x100G + +phy raw c45 0xe1 0x1 0xffde 0 +phy raw c45 0xe1 0x1 0xd130 0x55 +phy raw c45 0xe1 0x1 0xd131 0x303 +phy raw c45 0xe1 0x1 0xffde 1 +phy raw c45 0xe1 0x1 0xd130 0x55 +phy raw c45 0xe1 0x1 0xd131 0x303 +phy raw c45 0xe1 0x1 0xffde 2 +phy raw c45 0xe1 0x1 0xd130 0x55 +phy raw c45 0xe1 0x1 0xd131 0x303 +phy raw c45 0xe1 0x1 0xffde 3 +phy raw c45 0xe1 0x1 0xd130 0x59 +phy raw c45 0xe1 0x1 0xd131 0x505 +phy raw c45 0xe1 0x1 0xd134 0x1 + +phy raw c45 0xe5 0x1 0xffde 0 +phy raw c45 0xe5 0x1 0xd130 0x59 +phy raw c45 0xe5 0x1 0xd131 0x502 +phy raw c45 0xe5 0x1 0xffde 1 +phy raw c45 0xe5 0x1 0xd130 0x59 +phy raw c45 0xe5 0x1 0xd131 0x502 +phy raw c45 0xe5 0x1 0xffde 2 +phy raw c45 0xe5 0x1 0xd130 0x59 +phy raw c45 0xe5 0x1 0xd131 0x502 +phy raw c45 0xe5 0x1 0xffde 3 +phy raw c45 0xe5 0x1 0xd130 0x59 +phy raw c45 0xe5 0x1 0xd131 0x502 +phy raw c45 0xe5 0x1 0xd134 0x1 + +phy raw c45 0xed 0x1 0xffde 0 +phy raw c45 0xed 0x1 0xd130 0x59 +phy raw c45 0xed 0x1 0xd131 0x502 +phy raw c45 0xed 0x1 0xffde 1 +phy raw c45 0xed 0x1 0xd130 0x59 +phy raw c45 0xed 0x1 0xd131 0x502 +phy raw c45 0xed 0x1 0xffde 2 +phy raw c45 0xed 0x1 0xd130 0x59 +phy raw c45 0xed 0x1 0xd131 0x502 +phy raw c45 0xed 0x1 0xffde 3 +phy raw c45 0xed 0x1 0xd130 0x59 +phy raw c45 0xed 0x1 0xd131 0x502 +phy raw c45 0xed 0x1 0xd134 0x1 + +phy raw c45 0x189 0x1 0xffde 0 +phy raw c45 0x189 0x1 0xd130 0x59 +phy raw c45 0x189 0x1 0xd131 0x502 +phy raw c45 0x189 0x1 0xffde 1 +phy raw c45 0x189 0x1 0xd130 0x59 +phy raw c45 0x189 0x1 0xd131 0x502 +phy raw c45 0x189 0x1 0xffde 2 +phy raw c45 0x189 0x1 0xd130 0x59 +phy raw c45 0x189 0x1 0xd131 0x502 +phy raw c45 0x189 0x1 0xffde 3 +phy raw c45 0x189 0x1 0xd130 0x59 +phy raw c45 0x189 0x1 0xd131 0x502 +phy raw c45 0x189 0x1 0xd134 0x1 + +phy raw c45 0x1a1 0x1 0xffde 0 +phy raw c45 0x1a1 0x1 0xd130 0x59 +phy raw c45 0x1a1 0x1 0xd131 0x502 +phy raw c45 0x1a1 0x1 0xffde 1 +phy raw c45 0x1a1 0x1 0xd130 0x59 +phy raw c45 0x1a1 0x1 0xd131 0x502 +phy raw c45 0x1a1 0x1 0xffde 2 +phy raw c45 0x1a1 0x1 0xd130 0x59 +phy raw c45 0x1a1 0x1 0xd131 0x502 +phy raw c45 0x1a1 0x1 0xffde 3 +phy raw c45 0x1a1 0x1 0xd130 0x59 +phy raw c45 0x1a1 0x1 0xd131 0x502 +phy raw c45 0x1a1 0x1 0xd134 0x1 + +phy raw c45 0x1a9 0x1 0xffde 0 +phy raw c45 0x1a9 0x1 0xd130 0x59 +phy raw c45 0x1a9 0x1 0xd131 0x502 +phy raw c45 0x1a9 0x1 0xffde 1 +phy raw c45 0x1a9 0x1 0xd130 0x59 +phy raw c45 0x1a9 0x1 0xd131 0x502 +phy raw c45 0x1a9 0x1 0xffde 2 +phy raw c45 0x1a9 0x1 0xd130 0x59 +phy raw c45 0x1a9 0x1 0xd131 0x502 +phy raw c45 0x1a9 0x1 0xffde 3 +phy raw c45 0x1a9 0x1 0xd130 0x59 +phy raw c45 0x1a9 0x1 0xd131 0x502 +phy raw c45 0x1a9 0x1 0xd134 0x1 + +phy raw c45 0x1b1 0x1 0xffde 0 +phy raw c45 0x1b1 0x1 0xd130 0x59 +phy raw c45 0x1b1 0x1 0xd131 0x502 +phy raw c45 0x1b1 0x1 0xffde 1 +phy raw c45 0x1b1 0x1 0xd130 0x59 +phy raw c45 0x1b1 0x1 0xd131 0x502 +phy raw c45 0x1b1 0x1 0xffde 2 +phy raw c45 0x1b1 0x1 0xd130 0x59 +phy raw c45 0x1b1 0x1 0xd131 0x502 +phy raw c45 0x1b1 0x1 0xffde 3 +phy raw c45 0x1b1 0x1 0xd130 0x59 +phy raw c45 0x1b1 0x1 0xd131 0x502 +phy raw c45 0x1b1 0x1 0xd134 0x1 + +phy raw c45 0x1b5 0x1 0xffde 0 +phy raw c45 0x1b5 0x1 0xd130 0x59 +phy raw c45 0x1b5 0x1 0xd131 0x502 +phy raw c45 0x1b5 0x1 0xffde 1 +phy raw c45 0x1b5 0x1 0xd130 0x59 +phy raw c45 0x1b5 0x1 0xd131 0x502 +phy raw c45 0x1b5 0x1 0xffde 2 +phy raw c45 0x1b5 0x1 0xd130 0x59 +phy raw c45 0x1b5 0x1 0xd131 0x502 +phy raw c45 0x1b5 0x1 0xffde 3 +phy raw c45 0x1b5 0x1 0xd130 0x59 +phy raw c45 0x1b5 0x1 0xd131 0x502 +phy raw c45 0x1b5 0x1 0xd134 0x1 + +linkscan on \ No newline at end of file diff --git a/device/quanta/x86_64-quanta_ix8a_bwde-r0/Quanta-IX8A-BWDE-56X/buffers.json.j2 b/device/quanta/x86_64-quanta_ix8a_bwde-r0/Quanta-IX8A-BWDE-56X/buffers.json.j2 new file mode 100644 index 000000000000..b67cf577ab75 --- /dev/null +++ b/device/quanta/x86_64-quanta_ix8a_bwde-r0/Quanta-IX8A-BWDE-56X/buffers.json.j2 @@ -0,0 +1,3 @@ +{%- set default_topo = 't1' %} +{%- include 'buffers_config.j2' %} + diff --git a/device/quanta/x86_64-quanta_ix8a_bwde-r0/Quanta-IX8A-BWDE-56X/buffers_defaults_def.j2 b/device/quanta/x86_64-quanta_ix8a_bwde-r0/Quanta-IX8A-BWDE-56X/buffers_defaults_def.j2 new file mode 100644 index 000000000000..740cfdf79e96 --- /dev/null +++ b/device/quanta/x86_64-quanta_ix8a_bwde-r0/Quanta-IX8A-BWDE-56X/buffers_defaults_def.j2 @@ -0,0 +1,46 @@ +{%- set default_cable = '300m' %} + +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {% for port_idx in range(0,32) %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} + {% endfor %} +{%- endmacro %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + "xoff": "4625920", + "size": "12766208", + "type": "ingress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "12766208", + "type": "egress", + "mode": "static" + }, + "egress_lossy_pool": { + "size": "7326924", + "type": "egress", + "mode": "dynamic" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "dynamic_th":"3" + }, + "egress_lossless_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"0", + "static_th":"12766208" + }, + "egress_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"1518", + "dynamic_th":"3" + } + }, +{%- endmacro %} diff --git a/device/quanta/x86_64-quanta_ix8a_bwde-r0/Quanta-IX8A-BWDE-56X/buffers_defaults_t0.j2 b/device/quanta/x86_64-quanta_ix8a_bwde-r0/Quanta-IX8A-BWDE-56X/buffers_defaults_t0.j2 new file mode 100644 index 000000000000..44fcf21887a6 --- /dev/null +++ b/device/quanta/x86_64-quanta_ix8a_bwde-r0/Quanta-IX8A-BWDE-56X/buffers_defaults_t0.j2 @@ -0,0 +1,45 @@ +{%- set default_cable = '300m' %} + +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {% for port_idx in range(0,32) %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} + {% endfor %} +{%- endmacro %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "12766208", + "type": "ingress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "12766208", + "type": "egress", + "mode": "static" + }, + "egress_lossy_pool": { + "size": "7326924", + "type": "egress", + "mode": "dynamic" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "dynamic_th":"3" + }, + "egress_lossless_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"0", + "static_th":"12766208" + }, + "egress_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"1518", + "dynamic_th":"3" + } + }, +{%- endmacro %} diff --git a/device/quanta/x86_64-quanta_ix8a_bwde-r0/Quanta-IX8A-BWDE-56X/buffers_defaults_t1.j2 b/device/quanta/x86_64-quanta_ix8a_bwde-r0/Quanta-IX8A-BWDE-56X/buffers_defaults_t1.j2 new file mode 100644 index 000000000000..5fe9cabcfd34 --- /dev/null +++ b/device/quanta/x86_64-quanta_ix8a_bwde-r0/Quanta-IX8A-BWDE-56X/buffers_defaults_t1.j2 @@ -0,0 +1,46 @@ +{%- set default_cable = '300m' %} + +{%- macro generate_port_lists(PORT_ALL) %} + {# Generate list of ports #} + {% for port_idx in range(0,32) %} + {% if PORT_ALL.append("Ethernet%d" % (port_idx * 4)) %}{% endif %} + {% endfor %} +{%- endmacro %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "ingress_lossless_pool": { + "xoff": "196608", + "size": "12766208", + "type": "ingress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "33004032", + "type": "egress", + "mode": "static" + }, + "egress_lossy_pool": { + "size": "12766208", + "type": "egress", + "mode": "dynamic" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "dynamic_th":"3" + }, + "egress_lossless_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"0", + "static_th":"33004032" + }, + "egress_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"1518", + "dynamic_th":"3" + } + }, +{%- endmacro %} diff --git a/device/quanta/x86_64-quanta_ix8a_bwde-r0/Quanta-IX8A-BWDE-56X/l2/config b/device/quanta/x86_64-quanta_ix8a_bwde-r0/Quanta-IX8A-BWDE-56X/l2/config new file mode 100644 index 000000000000..b2d4a1e80592 --- /dev/null +++ b/device/quanta/x86_64-quanta_ix8a_bwde-r0/Quanta-IX8A-BWDE-56X/l2/config @@ -0,0 +1,3 @@ +l2_mem_entries=294912 +l3_mem_entries=16384 +l3_alpm_enable=0 diff --git a/device/quanta/x86_64-quanta_ix8a_bwde-r0/Quanta-IX8A-BWDE-56X/l3/config b/device/quanta/x86_64-quanta_ix8a_bwde-r0/Quanta-IX8A-BWDE-56X/l3/config new file mode 100644 index 000000000000..fff0cf54b08a --- /dev/null +++ b/device/quanta/x86_64-quanta_ix8a_bwde-r0/Quanta-IX8A-BWDE-56X/l3/config @@ -0,0 +1,5 @@ +l2_mem_entries=40960 +l3_mem_entries=40960 +l3_alpm_enable=2 +use_all_splithorizon_groups=1 +sai_tunnel_support=1 diff --git a/device/quanta/x86_64-quanta_ix8a_bwde-r0/Quanta-IX8A-BWDE-56X/pg_profile_lookup.ini b/device/quanta/x86_64-quanta_ix8a_bwde-r0/Quanta-IX8A-BWDE-56X/pg_profile_lookup.ini new file mode 100644 index 000000000000..6d91d03ae684 --- /dev/null +++ b/device/quanta/x86_64-quanta_ix8a_bwde-r0/Quanta-IX8A-BWDE-56X/pg_profile_lookup.ini @@ -0,0 +1,17 @@ +# PG lossless profiles. +# speed cable size xon xoff threshold xon_offset + 10000 5m 9427 0 50176 1 3584 + 25000 5m 9427 0 50176 1 3584 + 40000 5m 9427 0 50176 1 3584 + 50000 5m 9427 0 50176 1 3584 + 100000 5m 9427 0 50176 1 3584 + 10000 40m 9427 0 50176 1 3584 + 25000 40m 9427 0 50176 1 3584 + 40000 40m 9427 0 50176 1 3584 + 50000 40m 9427 0 50176 1 3584 + 100000 40m 9427 0 50176 1 3584 + 10000 300m 9427 0 50176 1 3584 + 25000 300m 9427 0 50176 1 3584 + 40000 300m 9427 0 50176 1 3584 + 50000 300m 9427 0 50176 1 3584 + 100000 300m 9427 0 50176 1 3584 diff --git a/device/quanta/x86_64-quanta_ix8a_bwde-r0/Quanta-IX8A-BWDE-56X/platform-def.json b/device/quanta/x86_64-quanta_ix8a_bwde-r0/Quanta-IX8A-BWDE-56X/platform-def.json new file mode 100644 index 000000000000..4758d031e641 --- /dev/null +++ b/device/quanta/x86_64-quanta_ix8a_bwde-r0/Quanta-IX8A-BWDE-56X/platform-def.json @@ -0,0 +1,48 @@ +{ + "fec-mode": { + "Ethernet0-47": { + "1": { + "1000": [ "none" ], + "10000": [ "none", "fc" ], + "25000": [ "none", "rs" ] + } + }, + "Ethernet48-79": { + "1": { + "10000": [ "none", "fc" ], + "25000": [ "none", "rs" ] + }, + "2": { + "20000": [ "none", "fc" ], + "50000": [ "none", "rs" ] + }, + "4": { + "40000": [ "none", "fc" ], + "100000": [ "none", "rs" ] + } + } + }, + "default-fec-mode": { + "Ethernet0-47": { + "1": { + "1000": "none", + "10000": "none", + "25000": "rs" + } + }, + "Ethernet48-79": { + "4": { + "40000": "none", + "100000": "rs" + } + } + }, + "native-port-supported-speeds": { + "Ethernet0-47": { + "1": ["25000","10000","1000"] + }, + "Ethernet48-79": { + "4": ["100000","40000"] + } + } +} diff --git a/device/quanta/x86_64-quanta_ix8a_bwde-r0/Quanta-IX8A-BWDE-56X/port_config.ini b/device/quanta/x86_64-quanta_ix8a_bwde-r0/Quanta-IX8A-BWDE-56X/port_config.ini new file mode 100644 index 000000000000..d499031feef7 --- /dev/null +++ b/device/quanta/x86_64-quanta_ix8a_bwde-r0/Quanta-IX8A-BWDE-56X/port_config.ini @@ -0,0 +1,57 @@ +# name lanes alias index speed +Ethernet0 1 twentyfiveGigE1 1 25000 +Ethernet1 2 twentyfiveGigE2 2 25000 +Ethernet2 3 twentyfiveGigE3 3 25000 +Ethernet3 4 twentyfiveGigE4 4 25000 +Ethernet4 5 twentyfiveGigE5 5 25000 +Ethernet5 6 twentyfiveGigE6 6 25000 +Ethernet6 7 twentyfiveGigE7 7 25000 +Ethernet7 8 twentyfiveGigE8 8 25000 +Ethernet8 9 twentyfiveGigE9 9 25000 +Ethernet9 10 twentyfiveGigE10 10 25000 +Ethernet10 11 twentyfiveGigE11 11 25000 +Ethernet11 12 twentyfiveGigE12 12 25000 +Ethernet12 13 twentyfiveGigE13 13 25000 +Ethernet13 14 twentyfiveGigE14 14 25000 +Ethernet14 15 twentyfiveGigE15 15 25000 +Ethernet15 16 twentyfiveGigE16 16 25000 +Ethernet16 17 twentyfiveGigE17 17 25000 +Ethernet17 18 twentyfiveGigE18 18 25000 +Ethernet18 19 twentyfiveGigE19 19 25000 +Ethernet19 20 twentyfiveGigE20 20 25000 +Ethernet20 21 twentyfiveGigE21 21 25000 +Ethernet21 22 twentyfiveGigE22 22 25000 +Ethernet22 23 twentyfiveGigE23 23 25000 +Ethernet23 24 twentyfiveGigE24 24 25000 +Ethernet24 57 twentyfiveGigE25 25 25000 +Ethernet25 58 twentyfiveGigE26 26 25000 +Ethernet26 59 twentyfiveGigE27 27 25000 +Ethernet27 60 twentyfiveGigE28 28 25000 +Ethernet28 61 twentyfiveGigE29 29 25000 +Ethernet29 62 twentyfiveGigE30 30 25000 +Ethernet30 63 twentyfiveGigE31 31 25000 +Ethernet31 64 twentyfiveGigE32 32 25000 +Ethernet32 65 twentyfiveGigE33 33 25000 +Ethernet33 66 twentyfiveGigE34 34 25000 +Ethernet34 67 twentyfiveGigE35 35 25000 +Ethernet35 68 twentyfiveGigE36 36 25000 +Ethernet36 69 twentyfiveGigE37 37 25000 +Ethernet37 70 twentyfiveGigE38 38 25000 +Ethernet38 71 twentyfiveGigE39 39 25000 +Ethernet39 72 twentyfiveGigE40 40 25000 +Ethernet40 73 twentyfiveGigE41 41 25000 +Ethernet41 74 twentyfiveGigE42 42 25000 +Ethernet42 75 twentyfiveGigE43 43 25000 +Ethernet43 76 twentyfiveGigE44 44 25000 +Ethernet44 77 twentyfiveGigE45 45 25000 +Ethernet45 78 twentyfiveGigE46 46 25000 +Ethernet46 79 twentyfiveGigE47 47 25000 +Ethernet47 80 twentyfiveGigE48 48 25000 +Ethernet48 41,42,43,44 hundredGigE49 49 100000 +Ethernet52 45,46,47,48 hundredGigE50 50 100000 +Ethernet56 49,50,51,52 hundredGigE51 51 100000 +Ethernet60 53,54,55,56 hundredGigE52 52 100000 +Ethernet64 33,34,35,36 hundredGigE53 53 100000 +Ethernet68 37,38,39,40 hundredGigE54 54 100000 +Ethernet72 25,26,27,28 hundredGigE55 55 100000 +Ethernet76 29,30,31,32 hundredGigE56 56 100000 diff --git a/device/quanta/x86_64-quanta_ix8a_bwde-r0/Quanta-IX8A-BWDE-56X/qos.json.j2 b/device/quanta/x86_64-quanta_ix8a_bwde-r0/Quanta-IX8A-BWDE-56X/qos.json.j2 new file mode 100644 index 000000000000..ee67c6e26221 --- /dev/null +++ b/device/quanta/x86_64-quanta_ix8a_bwde-r0/Quanta-IX8A-BWDE-56X/qos.json.j2 @@ -0,0 +1 @@ +{%- include 'qos_config_t1.j2' %} diff --git a/device/quanta/x86_64-quanta_ix8a_bwde-r0/Quanta-IX8A-BWDE-56X/qos_config_t1.j2 b/device/quanta/x86_64-quanta_ix8a_bwde-r0/Quanta-IX8A-BWDE-56X/qos_config_t1.j2 new file mode 100644 index 000000000000..5fe5324a85c1 --- /dev/null +++ b/device/quanta/x86_64-quanta_ix8a_bwde-r0/Quanta-IX8A-BWDE-56X/qos_config_t1.j2 @@ -0,0 +1,175 @@ +{%- set PORT_ALL = [] %} +{%- for port in PORT %} + {%- if PORT_ALL.append(port) %}{% endif %} +{%- endfor %} +{%- if PORT_ALL | sort_by_port_index %}{% endif %} + +{%- set port_names_list_all = [] %} +{%- for port in PORT_ALL %} + {%- if port_names_list_all.append(port) %}{% endif %} +{%- endfor %} +{%- set port_names_all = port_names_list_all | join(',') -%} + + +{%- set PORT_ACTIVE = [] %} +{%- if DEVICE_NEIGHBOR is not defined %} + {%- set PORT_ACTIVE = PORT_ALL %} +{%- else %} + {%- for port in DEVICE_NEIGHBOR.keys() %} + {%- if PORT_ACTIVE.append(port) %}{%- endif %} + {%- endfor %} +{%- endif %} +{%- if PORT_ACTIVE | sort_by_port_index %}{% endif %} + +{%- set port_names_list_active = [] %} +{%- for port in PORT_ACTIVE %} + {%- if port_names_list_active.append(port) %}{%- endif %} +{%- endfor %} +{%- set port_names_active = port_names_list_active | join(',') -%} + + +{%- set pfc_to_pg_map_supported_asics = ['mellanox', 'barefoot', 'marvell'] -%} + + +{ +{% if generate_tc_to_pg_map is defined %} + {{- generate_tc_to_pg_map() }} +{% else %} + "TC_TO_PRIORITY_GROUP_MAP": { + "AZURE": { + "0": "0", + "1": "0", + "2": "0", + "3": "3", + "4": "4", + "5": "0", + "6": "0", + "7": "7" + } + }, +{% endif %} + "MAP_PFC_PRIORITY_TO_QUEUE": { + "AZURE": { + "0": "0", + "1": "1", + "2": "2", + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7" + } + }, + "TC_TO_QUEUE_MAP": { + "AZURE": { + "0": "0", + "1": "1", + "2": "2", + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7" + } + }, + "DSCP_TO_TC_MAP": { + "AZURE": { + "0" : "1", + "1" : "1", + "2" : "1", + "3" : "3", + "4" : "4", + "5" : "2", + "6" : "1", + "7" : "1", + "8" : "0", + "9" : "1", + "10": "1", + "11": "1", + "12": "1", + "13": "1", + "14": "1", + "15": "1", + "16": "1", + "17": "1", + "18": "1", + "19": "1", + "20": "1", + "21": "1", + "22": "1", + "23": "1", + "24": "1", + "25": "1", + "26": "1", + "27": "1", + "28": "1", + "29": "1", + "30": "1", + "31": "1", + "32": "1", + "33": "1", + "34": "1", + "35": "1", + "36": "1", + "37": "1", + "38": "1", + "39": "1", + "40": "1", + "41": "1", + "42": "1", + "43": "1", + "44": "1", + "45": "1", + "46": "5", + "47": "1", + "48": "6", + "49": "1", + "50": "1", + "51": "1", + "52": "1", + "53": "1", + "54": "1", + "55": "1", + "56": "1", + "57": "1", + "58": "1", + "59": "1", + "60": "1", + "61": "1", + "62": "1", + "63": "1" + } + }, + "SCHEDULER": { + "scheduler.0": { + "type" : "DWRR", + "weight": "14" + }, + "scheduler.1": { + "type" : "DWRR", + "weight": "15" + } + }, +{% if asic_type in pfc_to_pg_map_supported_asics %} + "PFC_PRIORITY_TO_PRIORITY_GROUP_MAP": { + "AZURE": { + "3": "3", + "4": "4" + } + }, +{% endif %} + "PORT_QOS_MAP": { +{% for port in PORT_ACTIVE %} + "{{ port }}": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", +{% if asic_type in pfc_to_pg_map_supported_asics %} + "pfc_to_pg_map" : "[PFC_PRIORITY_TO_PRIORITY_GROUP_MAP|AZURE]", +{% endif %} + "pfc_enable" : "3,4" + }{% if not loop.last %},{% endif %} +{% endfor %} + } +} diff --git a/device/quanta/x86_64-quanta_ix8a_bwde-r0/Quanta-IX8A-BWDE-56X/sai.profile b/device/quanta/x86_64-quanta_ix8a_bwde-r0/Quanta-IX8A-BWDE-56X/sai.profile new file mode 100644 index 000000000000..fc6a62e31fa7 --- /dev/null +++ b/device/quanta/x86_64-quanta_ix8a_bwde-r0/Quanta-IX8A-BWDE-56X/sai.profile @@ -0,0 +1,2 @@ +SAI_INIT_CONFIG_FILE=/usr/share/sonic/hwsku/td3-ix8a-bwde-48x25G+8x100G.config.bcm +SAI_NUM_ECMP_MEMBERS=64 diff --git a/device/quanta/x86_64-quanta_ix8a_bwde-r0/Quanta-IX8A-BWDE-56X/td3-ix8a-bwde-48x25G+8x100G.config.bcm b/device/quanta/x86_64-quanta_ix8a_bwde-r0/Quanta-IX8A-BWDE-56X/td3-ix8a-bwde-48x25G+8x100G.config.bcm new file mode 100644 index 000000000000..6baa313b2542 --- /dev/null +++ b/device/quanta/x86_64-quanta_ix8a_bwde-r0/Quanta-IX8A-BWDE-56X/td3-ix8a-bwde-48x25G+8x100G.config.bcm @@ -0,0 +1,475 @@ +core_clock_frequency=1525 +dpp_clock_ratio=2:3 +parity_enable=1 +mem_cache_enable=0 +l2_mem_entries=40960 +l3_mem_entries=40960 +fpem_mem_entries=0 +l2xmsg_mode=1 +bcm_stat_flags=0 +l3_alpm_ipv6_128b_bkt_rsvd=1 + +#RIOT Enable +riot_enable=1 +riot_overlay_l3_intf_mem_size=4096 +riot_overlay_l3_egress_mem_size=32768 +l3_ecmp_levels=2 +riot_overlay_ecmp_resilient_hash_size=16384 + +bcm_num_cos=10 +default_cpu_tx_queue=9 +bcm_stat_interval=2000000 +cdma_timeout_usec=3000000 + +ifp_inports_support_enable=1 +ipv6_lpm_128b_enable=0x1 +l3_max_ecmp_mode=1 +l3_alpm_enable=2 +lpm_scaling_enable=0 + +miim_intr_enable=0 +module_64ports=1 + +schan_intr_enable=0 +skip_L2_USER_ENTRY=0 +stable_size=0x5500000 +tdma_timeout_usec=3000000 + +# portmap settings +oversubscribe_mode=1 +pbmp_xport_xe=0x3ffffffffffffffffffffffffffffffffe +port_flex_enable=1 +stable_size=0x5500000 + +#falcon core 0 flex [1:32] +portmap_1=1:25 +portmap_2=2:25 +portmap_3=3:25 +portmap_4=4:25 + +#falcon core 1 +portmap_5=5:25 +portmap_6=6:25 +portmap_7=7:25 +portmap_8=8:25 + +#falcon core 2 +portmap_9=9:25 +portmap_10=10:25 +portmap_11=11:25 +portmap_12=12:25 + +#falcon core 3 +portmap_13=13:25 +portmap_14=14:25 +portmap_15=15:25 +portmap_16=16:25 + +#falcon core 4 +portmap_17=17:25 +portmap_18=18:25 +portmap_19=19:25 +portmap_20=20:25 + +#falcon core 5 +portmap_21=21:25 +portmap_22=22:25 +portmap_23=23:25 +portmap_24=24:25 + +#falcon core 6 +portmap_25=25:100 + +#falcon core 7, port 56 supports breakout +portmap_26=29:100 + +#falcon core 8 +portmap_30=33:100 + +#falcon core 9 +portmap_31=37:100 + +#falcon core 10 flex [33:64], port 49 supports breakout +portmap_33=41:100 + +#falcon core 11 +portmap_37=45:100 + +#falcon core 12 +portmap_38=49:100 + +#falcon core 13 +portmap_39=53:100 + +#falcon core 14 +portmap_40=57:25 +portmap_41=58:25 +portmap_42=59:25 +portmap_43=60:25 + +#falcon core 15 +portmap_44=61:25 +portmap_45=62:25 +portmap_46=63:25 +portmap_47=64:25 + +#falcon core 16 +portmap_48=65:25 +portmap_49=66:25 +portmap_50=67:25 +portmap_51=68:25 + +#falcon core 17 +portmap_52=69:25 +portmap_53=70:25 +portmap_54=71:25 +portmap_55=72:25 + +#falcon core 18 +portmap_56=73:25 +portmap_57=74:25 +portmap_58=75:25 +portmap_59=76:25 + +#falcon core 19 +portmap_60=77:25 +portmap_61=78:25 +portmap_62=79:25 +portmap_63=80:25 + +# datapath port -- MerlinCore +#Hide these to prevent SAI from initializing them...they are physically not on system +#portmap_64=81:10:m + +### port remap + +dport_map_port_1=1 +dport_map_port_2=2 +dport_map_port_3=3 +dport_map_port_4=4 + +dport_map_port_5=5 +dport_map_port_6=6 +dport_map_port_7=7 +dport_map_port_8=8 + +dport_map_port_9=9 +dport_map_port_10=10 +dport_map_port_11=11 +dport_map_port_12=12 + +dport_map_port_13=13 +dport_map_port_14=14 +dport_map_port_15=15 +dport_map_port_16=16 + +dport_map_port_17=17 +dport_map_port_18=18 +dport_map_port_19=19 +dport_map_port_20=20 + +dport_map_port_21=21 +dport_map_port_22=22 +dport_map_port_23=23 +dport_map_port_24=24 + +dport_map_port_40=25 +dport_map_port_41=26 +dport_map_port_42=27 +dport_map_port_43=28 + +dport_map_port_44=29 +dport_map_port_45=30 +dport_map_port_46=31 +dport_map_port_47=32 + +dport_map_port_48=33 +dport_map_port_49=34 +dport_map_port_50=35 +dport_map_port_51=36 + +dport_map_port_52=37 +dport_map_port_53=38 +dport_map_port_54=39 +dport_map_port_55=40 + +dport_map_port_56=41 +dport_map_port_57=42 +dport_map_port_58=43 +dport_map_port_59=44 + +dport_map_port_60=45 +dport_map_port_61=46 +dport_map_port_62=47 +dport_map_port_63=48 + +dport_map_port_33=49 +dport_map_port_34=50 +dport_map_port_35=51 +dport_map_port_36=52 +dport_map_port_37=53 +dport_map_port_38=54 +dport_map_port_39=55 + +dport_map_port_30=56 +dport_map_port_31=57 +dport_map_port_25=58 +dport_map_port_26=59 +dport_map_port_27=60 +dport_map_port_28=61 +dport_map_port_29=62 + +#dport_map_port_64=63 + +### lane swap and polarity follow physical port + +### FC0 +phy_chain_tx_lane_map_physical{1.0}=0x3210 +phy_chain_tx_polarity_flip_physical{1.0}=0x0 +phy_chain_tx_polarity_flip_physical{2.0}=0x0 +phy_chain_tx_polarity_flip_physical{3.0}=0x0 +phy_chain_tx_polarity_flip_physical{4.0}=0x0 +phy_chain_rx_lane_map_physical{1.0}=0x1320 +phy_chain_rx_polarity_flip_physical{1.0}=0x0 +phy_chain_rx_polarity_flip_physical{2.0}=0x1 +phy_chain_rx_polarity_flip_physical{3.0}=0x1 +phy_chain_rx_polarity_flip_physical{4.0}=0x0 + +### FC1 +phy_chain_tx_lane_map_physical{5.0}=0x0132 +phy_chain_tx_polarity_flip_physical{5.0}=0x0 +phy_chain_tx_polarity_flip_physical{6.0}=0x0 +phy_chain_tx_polarity_flip_physical{7.0}=0x1 +phy_chain_tx_polarity_flip_physical{8.0}=0x1 +phy_chain_rx_lane_map_physical{5.0}=0x1032 +phy_chain_rx_polarity_flip_physical{5.0}=0x1 +phy_chain_rx_polarity_flip_physical{6.0}=0x1 +phy_chain_rx_polarity_flip_physical{7.0}=0x1 +phy_chain_rx_polarity_flip_physical{8.0}=0x1 + +### FC2 +phy_chain_tx_lane_map_physical{9.0}=0x0123 +phy_chain_tx_polarity_flip_physical{9.0}=0x1 +phy_chain_tx_polarity_flip_physical{10.0}=0x1 +phy_chain_tx_polarity_flip_physical{11.0}=0x1 +phy_chain_tx_polarity_flip_physical{12.0}=0x1 +phy_chain_rx_lane_map_physical{9.0}=0x1032 +phy_chain_rx_polarity_flip_physical{9.0}=0x1 +phy_chain_rx_polarity_flip_physical{10.0}=0x1 +phy_chain_rx_polarity_flip_physical{11.0}=0x1 +phy_chain_rx_polarity_flip_physical{12.0}=0x1 + +### FC3 +phy_chain_tx_lane_map_physical{13.0}=0x0123 +phy_chain_tx_polarity_flip_physical{13.0}=0x1 +phy_chain_tx_polarity_flip_physical{14.0}=0x1 +phy_chain_tx_polarity_flip_physical{15.0}=0x1 +phy_chain_tx_polarity_flip_physical{16.0}=0x1 +phy_chain_rx_lane_map_physical{13.0}=0x1032 +phy_chain_rx_polarity_flip_physical{13.0}=0x1 +phy_chain_rx_polarity_flip_physical{14.0}=0x1 +phy_chain_rx_polarity_flip_physical{15.0}=0x1 +phy_chain_rx_polarity_flip_physical{16.0}=0x1 + +### FC4 +phy_chain_tx_lane_map_physical{17.0}=0x0123 +phy_chain_tx_polarity_flip_physical{17.0}=0x1 +phy_chain_tx_polarity_flip_physical{18.0}=0x0 +phy_chain_tx_polarity_flip_physical{19.0}=0x0 +phy_chain_tx_polarity_flip_physical{20.0}=0x0 +phy_chain_rx_lane_map_physical{17.0}=0x1032 +phy_chain_rx_polarity_flip_physical{17.0}=0x1 +phy_chain_rx_polarity_flip_physical{18.0}=0x0 +phy_chain_rx_polarity_flip_physical{19.0}=0x1 +phy_chain_rx_polarity_flip_physical{20.0}=0x1 + +### FC5 +phy_chain_tx_lane_map_physical{21.0}=0x0123 +phy_chain_tx_polarity_flip_physical{21.0}=0x0 +phy_chain_tx_polarity_flip_physical{22.0}=0x0 +phy_chain_tx_polarity_flip_physical{23.0}=0x0 +phy_chain_tx_polarity_flip_physical{24.0}=0x0 +phy_chain_rx_lane_map_physical{21.0}=0x1032 +phy_chain_rx_polarity_flip_physical{21.0}=0x0 +phy_chain_rx_polarity_flip_physical{22.0}=0x0 +phy_chain_rx_polarity_flip_physical{23.0}=0x0 +phy_chain_rx_polarity_flip_physical{24.0}=0x0 + +### FC6 +phy_chain_tx_lane_map_physical{25.0}=0x3021 +phy_chain_tx_polarity_flip_physical{25.0}=0x1 +phy_chain_tx_polarity_flip_physical{26.0}=0x1 +phy_chain_tx_polarity_flip_physical{27.0}=0x0 +phy_chain_tx_polarity_flip_physical{28.0}=0x0 +phy_chain_rx_lane_map_physical{25.0}=0x1032 +phy_chain_rx_polarity_flip_physical{25.0}=0x0 +phy_chain_rx_polarity_flip_physical{26.0}=0x0 +phy_chain_rx_polarity_flip_physical{27.0}=0x1 +phy_chain_rx_polarity_flip_physical{28.0}=0x0 + +### FC7 +phy_chain_tx_lane_map_physical{29.0}=0x0213 +phy_chain_tx_polarity_flip_physical{29.0}=0x1 +phy_chain_tx_polarity_flip_physical{30.0}=0x0 +phy_chain_tx_polarity_flip_physical{31.0}=0x0 +phy_chain_tx_polarity_flip_physical{32.0}=0x1 +phy_chain_rx_lane_map_physical{29.0}=0x1203 +phy_chain_rx_polarity_flip_physical{29.0}=0x0 +phy_chain_rx_polarity_flip_physical{30.0}=0x0 +phy_chain_rx_polarity_flip_physical{31.0}=0x0 +phy_chain_rx_polarity_flip_physical{32.0}=0x1 + +### FC8 +phy_chain_tx_lane_map_physical{33.0}=0x0213 +phy_chain_tx_polarity_flip_physical{33.0}=0x1 +phy_chain_tx_polarity_flip_physical{34.0}=0x0 +phy_chain_tx_polarity_flip_physical{35.0}=0x0 +phy_chain_tx_polarity_flip_physical{36.0}=0x0 +phy_chain_rx_lane_map_physical{33.0}=0x1302 +phy_chain_rx_polarity_flip_physical{33.0}=0x0 +phy_chain_rx_polarity_flip_physical{34.0}=0x1 +phy_chain_rx_polarity_flip_physical{35.0}=0x0 +phy_chain_rx_polarity_flip_physical{36.0}=0x0 + +### FC9 +phy_chain_tx_lane_map_physical{37.0}=0x3120 +phy_chain_tx_polarity_flip_physical{37.0}=0x1 +phy_chain_tx_polarity_flip_physical{38.0}=0x0 +phy_chain_tx_polarity_flip_physical{39.0}=0x0 +phy_chain_tx_polarity_flip_physical{40.0}=0x1 +phy_chain_rx_lane_map_physical{37.0}=0x2031 +phy_chain_rx_polarity_flip_physical{37.0}=0x0 +phy_chain_rx_polarity_flip_physical{38.0}=0x1 +phy_chain_rx_polarity_flip_physical{39.0}=0x0 +phy_chain_rx_polarity_flip_physical{40.0}=0x0 + +### FC10 +phy_chain_tx_lane_map_physical{41.0}=0x0213 +phy_chain_tx_polarity_flip_physical{41.0}=0x0 +phy_chain_tx_polarity_flip_physical{42.0}=0x0 +phy_chain_tx_polarity_flip_physical{43.0}=0x0 +phy_chain_tx_polarity_flip_physical{44.0}=0x1 +phy_chain_rx_lane_map_physical{41.0}=0x2013 +phy_chain_rx_polarity_flip_physical{41.0}=0x1 +phy_chain_rx_polarity_flip_physical{42.0}=0x0 +phy_chain_rx_polarity_flip_physical{43.0}=0x1 +phy_chain_rx_polarity_flip_physical{44.0}=0x1 + +### FC11 +phy_chain_tx_lane_map_physical{45.0}=0x2031 +phy_chain_tx_polarity_flip_physical{45.0}=0x1 +phy_chain_tx_polarity_flip_physical{46.0}=0x0 +phy_chain_tx_polarity_flip_physical{47.0}=0x0 +phy_chain_tx_polarity_flip_physical{48.0}=0x1 +phy_chain_rx_lane_map_physical{45.0}=0x2031 +phy_chain_rx_polarity_flip_physical{45.0}=0x1 +phy_chain_rx_polarity_flip_physical{46.0}=0x1 +phy_chain_rx_polarity_flip_physical{47.0}=0x0 +phy_chain_rx_polarity_flip_physical{48.0}=0x1 + +### FC12 +phy_chain_tx_lane_map_physical{49.0}=0x3120 +phy_chain_tx_polarity_flip_physical{49.0}=0x1 +phy_chain_tx_polarity_flip_physical{50.0}=0x0 +phy_chain_tx_polarity_flip_physical{51.0}=0x0 +phy_chain_tx_polarity_flip_physical{52.0}=0x1 +phy_chain_rx_lane_map_physical{49.0}=0x0123 +phy_chain_rx_polarity_flip_physical{49.0}=0x1 +phy_chain_rx_polarity_flip_physical{50.0}=0x1 +phy_chain_rx_polarity_flip_physical{51.0}=0x1 +phy_chain_rx_polarity_flip_physical{52.0}=0x0 + +### FC13 +phy_chain_tx_lane_map_physical{53.0}=0x0123 +phy_chain_tx_polarity_flip_physical{53.0}=0x1 +phy_chain_tx_polarity_flip_physical{54.0}=0x1 +phy_chain_tx_polarity_flip_physical{55.0}=0x1 +phy_chain_tx_polarity_flip_physical{56.0}=0x1 +phy_chain_rx_lane_map_physical{53.0}=0x0312 +phy_chain_rx_polarity_flip_physical{53.0}=0x1 +phy_chain_rx_polarity_flip_physical{54.0}=0x0 +phy_chain_rx_polarity_flip_physical{55.0}=0x0 +## This polarity filp is due to the reverse RX connection in HW +phy_chain_rx_polarity_flip_physical{56.0}=0x1 + +### FC14 +phy_chain_tx_lane_map_physical{57.0}=0x3210 +phy_chain_tx_polarity_flip_physical{57.0}=0x0 +phy_chain_tx_polarity_flip_physical{58.0}=0x0 +phy_chain_tx_polarity_flip_physical{59.0}=0x0 +phy_chain_tx_polarity_flip_physical{60.0}=0x0 +phy_chain_rx_lane_map_physical{57.0}=0x2301 +phy_chain_rx_polarity_flip_physical{57.0}=0x0 +phy_chain_rx_polarity_flip_physical{58.0}=0x0 +phy_chain_rx_polarity_flip_physical{59.0}=0x0 +phy_chain_rx_polarity_flip_physical{60.0}=0x0 + +### FC15 +phy_chain_tx_lane_map_physical{61.0}=0x3210 +phy_chain_tx_polarity_flip_physical{61.0}=0x0 +phy_chain_tx_polarity_flip_physical{62.0}=0x0 +phy_chain_tx_polarity_flip_physical{63.0}=0x0 +phy_chain_tx_polarity_flip_physical{64.0}=0x1 +phy_chain_rx_lane_map_physical{61.0}=0x2301 +phy_chain_rx_polarity_flip_physical{61.0}=0x1 +phy_chain_rx_polarity_flip_physical{62.0}=0x1 +phy_chain_rx_polarity_flip_physical{63.0}=0x0 +phy_chain_rx_polarity_flip_physical{64.0}=0x1 + +### FC16 +phy_chain_tx_lane_map_physical{65.0}=0x3210 +phy_chain_tx_polarity_flip_physical{65.0}=0x1 +phy_chain_tx_polarity_flip_physical{66.0}=0x1 +phy_chain_tx_polarity_flip_physical{67.0}=0x1 +phy_chain_tx_polarity_flip_physical{68.0}=0x1 +phy_chain_rx_lane_map_physical{65.0}=0x2301 +phy_chain_rx_polarity_flip_physical{65.0}=0x1 +phy_chain_rx_polarity_flip_physical{66.0}=0x1 +phy_chain_rx_polarity_flip_physical{67.0}=0x1 +phy_chain_rx_polarity_flip_physical{68.0}=0x1 + +### FC17 +phy_chain_tx_lane_map_physical{69.0}=0x3210 +phy_chain_tx_polarity_flip_physical{69.0}=0x1 +phy_chain_tx_polarity_flip_physical{70.0}=0x1 +phy_chain_tx_polarity_flip_physical{71.0}=0x1 +phy_chain_tx_polarity_flip_physical{72.0}=0x1 +phy_chain_rx_lane_map_physical{69.0}=0x2301 +phy_chain_rx_polarity_flip_physical{69.0}=0x1 +phy_chain_rx_polarity_flip_physical{70.0}=0x1 +phy_chain_rx_polarity_flip_physical{71.0}=0x1 +phy_chain_rx_polarity_flip_physical{72.0}=0x1 + +### FC18 +phy_chain_tx_lane_map_physical{73.0}=0x3210 +phy_chain_tx_polarity_flip_physical{73.0}=0x1 +phy_chain_tx_polarity_flip_physical{74.0}=0x1 +phy_chain_tx_polarity_flip_physical{75.0}=0x1 +phy_chain_tx_polarity_flip_physical{76.0}=0x1 +phy_chain_rx_lane_map_physical{73.0}=0x2301 +phy_chain_rx_polarity_flip_physical{73.0}=0x1 +phy_chain_rx_polarity_flip_physical{74.0}=0x1 +phy_chain_rx_polarity_flip_physical{75.0}=0x1 +phy_chain_rx_polarity_flip_physical{76.0}=0x1 + +### FC19 +phy_chain_tx_lane_map_physical{77.0}=0x0213 +phy_chain_tx_polarity_flip_physical{77.0}=0x0 +phy_chain_tx_polarity_flip_physical{78.0}=0x1 +phy_chain_tx_polarity_flip_physical{79.0}=0x1 +phy_chain_tx_polarity_flip_physical{80.0}=0x0 +phy_chain_rx_lane_map_physical{77.0}=0x0213 +phy_chain_rx_polarity_flip_physical{77.0}=0x0 +phy_chain_rx_polarity_flip_physical{78.0}=0x1 +phy_chain_rx_polarity_flip_physical{79.0}=0x1 +phy_chain_rx_polarity_flip_physical{80.0}=0x0 + +### MerlinCore +#phy_chain_tx_polarity_flip_physical{81.0}=0x0 +#phy_chain_rx_polarity_flip_physical{81.0}=0x0 + +l2_mem_entries=40960 +l3_mem_entries=40960 +l3_alpm_enable=2 +use_all_splithorizon_groups=1 + diff --git a/device/quanta/x86_64-quanta_ix8a_bwde-r0/custom_led.bin b/device/quanta/x86_64-quanta_ix8a_bwde-r0/custom_led.bin new file mode 100644 index 000000000000..4902628c7fec Binary files /dev/null and b/device/quanta/x86_64-quanta_ix8a_bwde-r0/custom_led.bin differ diff --git a/device/quanta/x86_64-quanta_ix8a_bwde-r0/default_sku b/device/quanta/x86_64-quanta_ix8a_bwde-r0/default_sku new file mode 100644 index 000000000000..377de21e65fa --- /dev/null +++ b/device/quanta/x86_64-quanta_ix8a_bwde-r0/default_sku @@ -0,0 +1 @@ +Quanta-IX8A-BWDE-56X t1 diff --git a/device/quanta/x86_64-quanta_ix8a_bwde-r0/installer.conf b/device/quanta/x86_64-quanta_ix8a_bwde-r0/installer.conf new file mode 100644 index 000000000000..925a32fc0c3a --- /dev/null +++ b/device/quanta/x86_64-quanta_ix8a_bwde-r0/installer.conf @@ -0,0 +1,3 @@ +CONSOLE_PORT=0x3f8 +CONSOLE_DEV=0 +CONSOLE_SPEED=115200 diff --git a/device/quanta/x86_64-quanta_ix8a_bwde-r0/led_proc_init.soc b/device/quanta/x86_64-quanta_ix8a_bwde-r0/led_proc_init.soc new file mode 100644 index 000000000000..dac21e51e485 --- /dev/null +++ b/device/quanta/x86_64-quanta_ix8a_bwde-r0/led_proc_init.soc @@ -0,0 +1,3 @@ +m0 load 0 0x3800 /usr/share/sonic/platform/custom_led.bin +led start +rcload /usr/share/sonic/platform/preemphasis-48x25_8x100.soc diff --git a/device/quanta/x86_64-quanta_ix8a_bwde-r0/plugins/eeprom.py b/device/quanta/x86_64-quanta_ix8a_bwde-r0/plugins/eeprom.py new file mode 100644 index 000000000000..0a6121c3cd92 --- /dev/null +++ b/device/quanta/x86_64-quanta_ix8a_bwde-r0/plugins/eeprom.py @@ -0,0 +1,12 @@ +try: + from sonic_eeprom import eeprom_tlvinfo +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class board(eeprom_tlvinfo.TlvInfoDecoder): + _TLV_INFO_MAX_LEN = 256 + + def __init__(self, name, path, cpld_root, ro): + self.eeprom_path = "/sys/bus/i2c/devices/3-0054/eeprom" + super(board, self).__init__(self.eeprom_path, 0, '', True) diff --git a/device/quanta/x86_64-quanta_ix8a_bwde-r0/plugins/fanutil.py b/device/quanta/x86_64-quanta_ix8a_bwde-r0/plugins/fanutil.py new file mode 100644 index 000000000000..2cf72ddf7e5b --- /dev/null +++ b/device/quanta/x86_64-quanta_ix8a_bwde-r0/plugins/fanutil.py @@ -0,0 +1,110 @@ +# +# fanutil.py +# Platform-specific Fan status interface for SONiC +# + +import logging +import os.path + +try: + from sonic_fan.fan_base import FanBase +except ImportError as e: + raise ImportError (str(e) + "- required module not found") + +class FanUtil(FanBase): + """Platform-specific FANutil class""" + + SYS_FAN_NUM = 6 + NUM_FANS_PERTRAY = 2 + HWMON_PATH = '/sys/class/hwmon/hwmon2/' + FAN_INDEX_START = 18 + + logger = logging.getLogger(__name__) + + def __init__(self, log_level=logging.DEBUG): + FanBase.__init__(self) + self.num_fans = (self.SYS_FAN_NUM * self.NUM_FANS_PERTRAY) + + # Get sysfs attribute + def get_attr_value(self, attr_path): + + retval = 'ERR' + if (not os.path.isfile(attr_path)): + return retval + + try: + with open(attr_path, 'r') as fd: + retval = fd.read() + except Exception: + logging.error("Unable to open ", attr_path, " file !") + + retval = retval.rstrip('\r\n') + return retval + + def check_fan_index(self, index): + if index is None: + return False + + if index < 1 or index > self.num_fans: + logging.error("Invalid Fan index:", index) + return False + + return True + + def get_num_fans(self): + return self.num_fans + + def get_status(self, index): + if self.check_fan_index(index) == False: + return False + + fantray_speed_file = 'fan' + str(self.FAN_INDEX_START+(index-1)) + '_input' + fantray_speed = self.get_attr_value(self.HWMON_PATH + fantray_speed_file) + + if fantray_speed == '0.0' : + return False + + return True + + def get_presence(self, index): + if self.check_fan_index(index) == False: + return False + + fantray_present_file = 'fan' + str(self.FAN_INDEX_START+(index-1)) + '_present' + fantray_present = self.get_attr_value(self.HWMON_PATH + fantray_present_file) + + if fantray_present == '1' : + return True + + return False + + def get_direction(self, index): + if self.check_fan_index(index) == False: + return None + + fantray_direction_file = 'fan' + str(self.FAN_INDEX_START+(index-1)) + '_direction' + fantray_direction = self.get_attr_value(self.HWMON_PATH + fantray_direction_file) + + """ + 1: FB 2: BF + Since the fan is at rear of the switch, FB means Exhaust; BF means Intake + """ + if fantray_direction == '2': + return "INTAKE" + else: + return "EXHAUST" + + def get_speed(self, index): + if self.check_fan_index(index) == False: + return 0 + + fantray_speed_file = 'fan' + str(self.FAN_INDEX_START+(index-1)) + '_input' + fantray_speed = self.get_attr_value(self.HWMON_PATH + fantray_speed_file) + + return int(float(fantray_speed)) + + + def set_speed(self, val): + logging.error("Not allowed to set fan speed!") + + return False diff --git a/device/quanta/x86_64-quanta_ix8a_bwde-r0/plugins/psuutil.py b/device/quanta/x86_64-quanta_ix8a_bwde-r0/plugins/psuutil.py new file mode 100644 index 000000000000..2394ad0ea044 --- /dev/null +++ b/device/quanta/x86_64-quanta_ix8a_bwde-r0/plugins/psuutil.py @@ -0,0 +1,250 @@ +# +# psuutil.py +# Platform-specific PSU status interface for SONiC +# + +import logging +import os.path + +try: + from sonic_psu.psu_base import PsuBase +except ImportError as e: + raise ImportError (str(e) + "- required module not found") + +class PsuUtil(PsuBase): + """Platform-specific PSUutil class""" + + HWMON_PATH = '/sys/class/hwmon/hwmon1/' + PSU1_PREFIX = 'power114_' + PSU2_PREFIX = 'power126_' + MAX_PSUS = 2 + def __init__(self): + PsuBase.__init__(self) + + # Get sysfs attribute + def get_attr_value(self, attr_path): + + retval = 'ERR' + if (not os.path.isfile(attr_path)): + return retval + + try: + with open(attr_path, 'r') as fd: + retval = fd.read() + except Exception: + logging.error("Unable to open ", attr_path, " file !") + + retval = retval.rstrip('\r\n') + return retval + + def get_attr_filename(self, index, attr): + if (index == 1): + attr_file = self.PSU1_PREFIX + attr + elif (index == 2): + attr_file = self.PSU2_PREFIX + attr + else: + logging.error("Invalid PSU number:", index) + return '' + + return attr_file + + def get_num_psus(self): + """ + Retrieves the number of PSUs available on the device + :return: An integer, the number of PSUs available on the device + """ + + return self.MAX_PSUS + + def get_psu_status(self, index): + """ + Retrieves the oprational status of power supply unit (PSU) defined + by index + :param index: An integer, index of the PSU of which to query status + :return: Boolean, True if PSU is operating properly, False if PSU is\ + faulty + """ + status = False + + attr_filename = self.get_attr_filename(index, 'input') + if attr_filename == '': + return status + + attr_path = self.HWMON_PATH + attr_filename + attr_value = self.get_attr_value(attr_path) + + if (attr_value != 'ERR'): + attr_value = float(attr_value) + + # Check PSU status + if (attr_value != 0.0): + status = True + + return status + + def get_psu_presence(self, index): + """ + Retrieves the presence status of power supply unit (PSU) defined + by index + :param index: An integer, index of the PSU of which to query status + :return: Boolean, True if PSU is plugged, False if not + """ + status = False + + attr_filename = self.get_attr_filename(index, 'present') + if attr_filename == '': + return status + + attr_path = self.HWMON_PATH + attr_filename + attr_value = self.get_attr_value(attr_path) + + if (attr_value != 'ERR'): + attr_value = int(attr_value, 16) + # Check PSU status + if (attr_value == 1): + status = True + return status + + def get_powergood_status(self, index): + status = False + + attr_filename = self.get_attr_filename(index, 'input') + if attr_filename == '': + return status + + attr_path = self.HWMON_PATH + attr_filename + attr_value = self.get_attr_value(attr_path) + + if (attr_value != 'ERR'): + attr_value = float(attr_value) + + # Check PSU status + if (attr_value != 0.0): + status = True + + return status + + def get_model(self, index): + attr_filename = self.get_attr_filename(index, 'model') + if attr_filename == '': + return None + + attr_path = self.HWMON_PATH + attr_filename + attr_value = self.get_attr_value(attr_path) + + if (attr_value != 'ERR'): + return attr_value.rstrip() + + def get_mfr_id(self, index): + attr_filename = self.get_attr_filename(index, 'mfrid') + if attr_filename == '': + return None + + attr_path = self.HWMON_PATH + attr_filename + attr_value = self.get_attr_value(attr_path) + + if (attr_value != 'ERR'): + return attr_value.rstrip() + + def get_serial(self, index): + attr_filename = self.get_attr_filename(index, 'sn') + if attr_filename == '': + return None + + attr_path = self.HWMON_PATH + attr_filename + attr_value = self.get_attr_value(attr_path) + + if (attr_value != 'ERR'): + return attr_value.rstrip() + + def get_direction(self, index): + if (index == 1): + direction_file = 'fan120_direction' + elif (index == 2): + direction_file = 'fan132_direction' + else: + logging.error("Invalid PSU number:", index) + return None + + direction = self.get_attr_value(self.HWMON_PATH + direction_file) + direction = direction.rstrip() + + """ + 1: FB 2: BF + Since the fan is at rear of the switch, FB means Exhaust; BF means Intake + """ + if direction == '"\"': + return "INTAKE" + else: + return "EXHAUST" + + def get_output_voltage(self, index): + if (index == 1): + attr_file = 'in129_input' + elif (index == 2): + attr_file = 'in124_input' + else: + logging.error("Invalid PSU number:", index) + return 0.0 + + voltage = self.get_attr_value(self.HWMON_PATH + attr_file) + voltage = voltage.rstrip() + + if (voltage != 'ERR'): + voltage, dummy = voltage.split('.', 1) + else: + return 0.0 + + return float(voltage)/1000 + + def get_output_current(self, index): + if (index == 1): + attr_file = 'curr130_input' + elif (index == 2): + attr_file = 'curr115_input' + else: + logging.error("Invalid PSU number:", index) + return 0.0 + + current = self.get_attr_value(self.HWMON_PATH + attr_file) + current = current.rstrip() + + if (current != 'ERR'): + current, dummy = current.split('.',1) + else: + return 0.0 + + return float(current)/1000 + + def get_output_power(self, index): + attr_filename = self.get_attr_filename(index, 'input') + if attr_filename == '': + return 0.0 + + attr_path = self.HWMON_PATH + attr_filename + attr_value = self.get_attr_value(attr_path) + + if (attr_value != 'ERR'): + attr_value = float(attr_value) + else: + return 0.0 + + return float(attr_value/1000) + + def get_fan_rpm(self, index, fan_idx): + if (index == 1): + rpm_file = 'fan120_input' + elif (index == 2): + rpm_file = 'fan132_input' + else: + logging.error("Invalid PSU number:", index) + return 0 + + rpm = self.get_attr_value(self.HWMON_PATH + rpm_file) + rpm = rpm.rstrip() + if (rpm != 'ERR'): + rpm = float(rpm) + else: + return 0 + + return int(rpm) diff --git a/device/quanta/x86_64-quanta_ix8a_bwde-r0/plugins/sfputil.py b/device/quanta/x86_64-quanta_ix8a_bwde-r0/plugins/sfputil.py new file mode 100644 index 000000000000..3479e46f1f68 --- /dev/null +++ b/device/quanta/x86_64-quanta_ix8a_bwde-r0/plugins/sfputil.py @@ -0,0 +1,213 @@ +# sfputil.py +# +# Platform-specific SFP transceiver interface for SONiC +# + +try: + import time + from sonic_sfp.sfputilbase import SfpUtilBase +except ImportError as e: + raise ImportError("%s - required module not found" % str(e)) + + +class SfpUtil(SfpUtilBase): + """Platform-specific SfpUtil class""" + + PORT_START = 1 + PORT_END = 56 + PORTS_IN_BLOCK = 56 + QSFP_PORT_START = 49 + QSFP_PORT_END = 56 + + _port_to_eeprom_mapping = {} + _port_to_i2c_mapping = { + 1 : 13, + 2 : 14, + 3 : 15, + 4 : 16, + 5 : 17, + 6 : 18, + 7 : 19, + 8 : 20, + 9 : 21, + 10 : 22, + 11 : 23, + 12 : 24, + 13 : 25, + 14 : 26, + 15 : 27, + 16 : 28, + 17 : 29, + 18 : 30, + 19 : 31, + 20 : 32, + 21 : 33, + 22 : 34, + 23 : 35, + 24 : 36, + 25 : 37, + 26 : 38, + 27 : 39, + 28 : 40, + 29 : 41, + 30 : 42, + 31 : 43, + 32 : 44, + 33 : 45, + 34 : 46, + 35 : 47, + 36 : 48, + 37 : 49, + 38 : 50, + 39 : 51, + 40 : 52, + 41 : 53, + 42 : 54, + 43 : 55, + 44 : 56, + 45 : 57, + 46 : 58, + 47 : 59, + 48 : 60, + 49 : 61,#QSFP49 + 50 : 62,#QSFP50 + 51 : 63,#QSFP51 + 52 : 64,#QSFP52 + 53 : 65,#QSFP53 + 54 : 66,#QSFP54 + 55 : 67,#QSFP55 + 56 : 68,#QSFP56 + } + + @property + def port_start(self): + return self.PORT_START + + @property + def port_end(self): + return self.PORT_END + + @property + def qsfp_port_start(self): + return self.QSFP_PORT_START + + @property + def qsfp_port_end(self): + return self.QSFP_PORT_END + + @property + def qsfp_ports(self): + return range(self.QSFP_PORT_START, self.PORTS_IN_BLOCK + 1) + + @property + def port_to_eeprom_mapping(self): + return self._port_to_eeprom_mapping + + def __init__(self): + eeprom_path = '/sys/bus/i2c/devices/{0}-0050/eeprom' + for x in range(self.port_start, self.port_end+1): + self.port_to_eeprom_mapping[x] = eeprom_path.format(self._port_to_i2c_mapping[x]) + SfpUtilBase.__init__(self) + + def get_presence(self, port_num): + # Check for invalid port_num + if port_num < self.port_start or port_num > self.port_end: + return False + + try: + if port_num < self.qsfp_port_start: + reg_file = open("/sys/class/cpld-sfp28/port-"+str(port_num)+"/pre_n") + else: + reg_file = open("/sys/class/gpio/gpio"+str((port_num-self.qsfp_port_start)*4+34)+"/value") + except IOError as e: + print("Error: unable to open file: %s" % str(e)) + return False + + reg_value = reg_file.readline().rstrip() + if port_num < self.qsfp_port_start: + if reg_value == '1': + return True + else: + if reg_value == '0': + return True + + return False + + def get_low_power_mode(self, port_num): + # Check for invalid port_num + if port_num < self.qsfp_port_start or port_num > self.qsfp_port_end: + return False + + try: + reg_file = open("/sys/class/gpio/gpio"+str((port_num-self.qsfp_port_start)*4+35)+"/value") + except IOError as e: + print("Error: unable to open file: %s" % str(e)) + return False + + reg_value = int(reg_file.readline().rstrip()) + + if reg_value == 0: + return False + + return True + + def set_low_power_mode(self, port_num, lpmode): + # Check for invalid port_num + if port_num < self.qsfp_port_start or port_num > self.qsfp_port_end: + return False + + try: + reg_file = open("/sys/class/gpio/gpio"+str((port_num-self.qsfp_port_start)*4+35)+"/value", "r+") + except IOError as e: + print("Error: unable to open file: %s" % str(e)) + return False + + # LPMode is active high; set or clear the bit accordingly + if lpmode is True: + reg_value = 1 + else: + reg_value = 0 + + reg_file.write(hex(reg_value)) + reg_file.close() + + return True + + def reset(self, port_num): + # Check for invalid port_num + if port_num < self.qsfp_port_start or port_num > self.port_end: + return False + + try: + reg_file = open("/sys/class/gpio/gpio"+str((port_num-self.qsfp_port_start)*4+32)+"/value", "r+") + except IOError as e: + print("Error: unable to open file: %s" % str(e)) + return False + + reg_value = 0 + reg_file.write(hex(reg_value)) + reg_file.close() + + # Sleep 2 second to allow it to settle + time.sleep(2) + + # Flip the value back write back to the register to take port out of reset + try: + reg_file = open("/sys/class/gpio/gpio"+str((port_num-self.qsfp_port_start)*4+32)+"/value", "r+") + except IOError as e: + print("Error: unable to open file: %s" % str(e)) + return False + + reg_value = 1 + reg_file.write(hex(reg_value)) + reg_file.close() + + return True + + def get_transceiver_change_event(self): + """ + TODO: This function need to be implemented + when decide to support monitoring SFP(Xcvrd) + on this platform. + """ + raise NotImplementedError diff --git a/device/quanta/x86_64-quanta_ix8a_bwde-r0/pmon_daemon_control.json b/device/quanta/x86_64-quanta_ix8a_bwde-r0/pmon_daemon_control.json new file mode 100644 index 000000000000..94592fa8cebc --- /dev/null +++ b/device/quanta/x86_64-quanta_ix8a_bwde-r0/pmon_daemon_control.json @@ -0,0 +1,3 @@ +{ + "skip_ledd": true +} diff --git a/device/quanta/x86_64-quanta_ix8a_bwde-r0/preemphasis-48x25_8x100.soc b/device/quanta/x86_64-quanta_ix8a_bwde-r0/preemphasis-48x25_8x100.soc new file mode 100644 index 000000000000..00192697ffbc --- /dev/null +++ b/device/quanta/x86_64-quanta_ix8a_bwde-r0/preemphasis-48x25_8x100.soc @@ -0,0 +1,349 @@ +# 48x25G 8x100G pre-emphasis setting for Quanta IX8A-BWDE +echo "Set tx pre-emphasis and idriver values" +linkscan off + +# Start of 48x25G + +phy raw c45 0x81 0x1 0xffde 0 +phy raw c45 0x81 0x1 0xd130 0x32 +phy raw c45 0x81 0x1 0xd131 0x306 +phy raw c45 0x81 0x1 0xd134 0x1 +phy raw c45 0x81 0x1 0xffde 1 +phy raw c45 0x81 0x1 0xd130 0x32 +phy raw c45 0x81 0x1 0xd131 0x306 +phy raw c45 0x81 0x1 0xd134 0x1 +phy raw c45 0x81 0x1 0xffde 2 +phy raw c45 0x81 0x1 0xd130 0x32 +phy raw c45 0x81 0x1 0xd131 0x306 +phy raw c45 0x81 0x1 0xd134 0x1 +phy raw c45 0x81 0x1 0xffde 3 +phy raw c45 0x81 0x1 0xd130 0x32 +phy raw c45 0x81 0x1 0xd131 0x306 +phy raw c45 0x81 0x1 0xd134 0x1 + +phy raw c45 0x85 0x1 0xffde 0 +phy raw c45 0x85 0x1 0xd130 0x32 +phy raw c45 0x85 0x1 0xd131 0x306 +phy raw c45 0x85 0x1 0xd134 0x1 +phy raw c45 0x85 0x1 0xffde 1 +phy raw c45 0x85 0x1 0xd130 0x32 +phy raw c45 0x85 0x1 0xd131 0x306 +phy raw c45 0x85 0x1 0xd134 0x1 +phy raw c45 0x85 0x1 0xffde 2 +phy raw c45 0x85 0x1 0xd130 0x32 +phy raw c45 0x85 0x1 0xd131 0x306 +phy raw c45 0x85 0x1 0xd134 0x1 +phy raw c45 0x85 0x1 0xffde 3 +phy raw c45 0x85 0x1 0xd130 0x32 +phy raw c45 0x85 0x1 0xd131 0x306 +phy raw c45 0x85 0x1 0xd134 0x1 + +phy raw c45 0x89 0x1 0xffde 0 +phy raw c45 0x89 0x1 0xd130 0x32 +phy raw c45 0x89 0x1 0xd131 0x306 +phy raw c45 0x89 0x1 0xd134 0x1 +phy raw c45 0x89 0x1 0xffde 1 +phy raw c45 0x89 0x1 0xd130 0x32 +phy raw c45 0x89 0x1 0xd131 0x306 +phy raw c45 0x89 0x1 0xd134 0x1 +phy raw c45 0x89 0x1 0xffde 2 +phy raw c45 0x89 0x1 0xd130 0x32 +phy raw c45 0x89 0x1 0xd131 0x306 +phy raw c45 0x89 0x1 0xd134 0x1 +phy raw c45 0x89 0x1 0xffde 3 +phy raw c45 0x89 0x1 0xd130 0x32 +phy raw c45 0x89 0x1 0xd131 0x306 +phy raw c45 0x89 0x1 0xd134 0x1 + +phy raw c45 0x8d 0x1 0xffde 0 +phy raw c45 0x8d 0x1 0xd130 0x32 +phy raw c45 0x8d 0x1 0xd131 0x306 +phy raw c45 0x8d 0x1 0xd134 0x1 +phy raw c45 0x8d 0x1 0xffde 1 +phy raw c45 0x8d 0x1 0xd130 0x32 +phy raw c45 0x8d 0x1 0xd131 0x306 +phy raw c45 0x8d 0x1 0xd134 0x1 +phy raw c45 0x8d 0x1 0xffde 2 +phy raw c45 0x8d 0x1 0xd130 0x32 +phy raw c45 0x8d 0x1 0xd131 0x306 +phy raw c45 0x8d 0x1 0xd134 0x1 +phy raw c45 0x8d 0x1 0xffde 3 +phy raw c45 0x8d 0x1 0xd130 0x32 +phy raw c45 0x8d 0x1 0xd131 0x306 +phy raw c45 0x8d 0x1 0xd134 0x1 + +phy raw c45 0x91 0x1 0xffde 0 +phy raw c45 0x91 0x1 0xd130 0x32 +phy raw c45 0x91 0x1 0xd131 0x306 +phy raw c45 0x91 0x1 0xd134 0x1 +phy raw c45 0x91 0x1 0xffde 1 +phy raw c45 0x91 0x1 0xd130 0x32 +phy raw c45 0x91 0x1 0xd131 0x306 +phy raw c45 0x91 0x1 0xd134 0x1 +phy raw c45 0x91 0x1 0xffde 2 +phy raw c45 0x91 0x1 0xd130 0x32 +phy raw c45 0x91 0x1 0xd131 0x306 +phy raw c45 0x91 0x1 0xd134 0x1 +phy raw c45 0x91 0x1 0xffde 3 +phy raw c45 0x91 0x1 0xd130 0x32 +phy raw c45 0x91 0x1 0xd131 0x306 +phy raw c45 0x91 0x1 0xd134 0x1 + +phy raw c45 0xa1 0x1 0xffde 0 +phy raw c45 0xa1 0x1 0xd130 0x32 +phy raw c45 0xa1 0x1 0xd131 0x306 +phy raw c45 0xa1 0x1 0xd134 0x1 +phy raw c45 0xa1 0x1 0xffde 1 +phy raw c45 0xa1 0x1 0xd130 0x32 +phy raw c45 0xa1 0x1 0xd131 0x306 +phy raw c45 0xa1 0x1 0xd134 0x1 +phy raw c45 0xa1 0x1 0xffde 2 +phy raw c45 0xa1 0x1 0xd130 0x32 +phy raw c45 0xa1 0x1 0xd131 0x306 +phy raw c45 0xa1 0x1 0xd134 0x1 +phy raw c45 0xa1 0x1 0xffde 3 +phy raw c45 0xa1 0x1 0xd130 0x32 +phy raw c45 0xa1 0x1 0xd131 0x306 +phy raw c45 0xa1 0x1 0xd134 0x1 + +phy raw c45 0xd1 0x1 0xffde 0 +phy raw c45 0xd1 0x1 0xd130 0x32 +phy raw c45 0xd1 0x1 0xd131 0x306 +phy raw c45 0xd1 0x1 0xd134 0x1 +phy raw c45 0xd1 0x1 0xffde 1 +phy raw c45 0xd1 0x1 0xd130 0x32 +phy raw c45 0xd1 0x1 0xd131 0x306 +phy raw c45 0xd1 0x1 0xd134 0x1 +phy raw c45 0xd1 0x1 0xffde 2 +phy raw c45 0xd1 0x1 0xd130 0x32 +phy raw c45 0xd1 0x1 0xd131 0x306 +phy raw c45 0xd1 0x1 0xd134 0x1 +phy raw c45 0xd1 0x1 0xffde 3 +phy raw c45 0xd1 0x1 0xd130 0x32 +phy raw c45 0xd1 0x1 0xd131 0x306 +phy raw c45 0xd1 0x1 0xd134 0x1 + +phy raw c45 0xe1 0x1 0xffde 0 +phy raw c45 0xe1 0x1 0xd130 0x32 +phy raw c45 0xe1 0x1 0xd131 0x306 +phy raw c45 0xe1 0x1 0xd134 0x1 +phy raw c45 0xe1 0x1 0xffde 1 +phy raw c45 0xe1 0x1 0xd130 0x32 +phy raw c45 0xe1 0x1 0xd131 0x306 +phy raw c45 0xe1 0x1 0xd134 0x1 +phy raw c45 0xe1 0x1 0xffde 2 +phy raw c45 0xe1 0x1 0xd130 0x32 +phy raw c45 0xe1 0x1 0xd131 0x306 +phy raw c45 0xe1 0x1 0xd134 0x1 +phy raw c45 0xe1 0x1 0xffde 3 +phy raw c45 0xe1 0x1 0xd130 0x32 +phy raw c45 0xe1 0x1 0xd131 0x306 +phy raw c45 0xe1 0x1 0xd134 0x1 + +phy raw c45 0xe5 0x1 0xffde 0 +phy raw c45 0xe5 0x1 0xd130 0x32 +phy raw c45 0xe5 0x1 0xd131 0x306 +phy raw c45 0xe5 0x1 0xd134 0x1 +phy raw c45 0xe5 0x1 0xffde 1 +phy raw c45 0xe5 0x1 0xd130 0x32 +phy raw c45 0xe5 0x1 0xd131 0x306 +phy raw c45 0xe5 0x1 0xd134 0x1 +phy raw c45 0xe5 0x1 0xffde 2 +phy raw c45 0xe5 0x1 0xd130 0x32 +phy raw c45 0xe5 0x1 0xd131 0x306 +phy raw c45 0xe5 0x1 0xd134 0x1 +phy raw c45 0xe5 0x1 0xffde 3 +phy raw c45 0xe5 0x1 0xd130 0x32 +phy raw c45 0xe5 0x1 0xd131 0x306 +phy raw c45 0xe5 0x1 0xd134 0x1 + +phy raw c45 0xe9 0x1 0xffde 0 +phy raw c45 0xe9 0x1 0xd130 0x32 +phy raw c45 0xe9 0x1 0xd131 0x306 +phy raw c45 0xe9 0x1 0xd134 0x1 +phy raw c45 0xe9 0x1 0xffde 1 +phy raw c45 0xe9 0x1 0xd130 0x32 +phy raw c45 0xe9 0x1 0xd131 0x306 +phy raw c45 0xe9 0x1 0xd134 0x1 +phy raw c45 0xe9 0x1 0xffde 2 +phy raw c45 0xe9 0x1 0xd130 0x32 +phy raw c45 0xe9 0x1 0xd131 0x306 +phy raw c45 0xe9 0x1 0xd134 0x1 +phy raw c45 0xe9 0x1 0xffde 3 +phy raw c45 0xe9 0x1 0xd130 0x32 +phy raw c45 0xe9 0x1 0xd131 0x306 +phy raw c45 0xe9 0x1 0xd134 0x1 + +phy raw c45 0xed 0x1 0xffde 0 +phy raw c45 0xed 0x1 0xd130 0x32 +phy raw c45 0xed 0x1 0xd131 0x306 +phy raw c45 0xed 0x1 0xd134 0x1 +phy raw c45 0xed 0x1 0xffde 1 +phy raw c45 0xed 0x1 0xd130 0x32 +phy raw c45 0xed 0x1 0xd131 0x306 +phy raw c45 0xed 0x1 0xd134 0x1 +phy raw c45 0xed 0x1 0xffde 2 +phy raw c45 0xed 0x1 0xd130 0x32 +phy raw c45 0xed 0x1 0xd131 0x306 +phy raw c45 0xed 0x1 0xd134 0x1 +phy raw c45 0xed 0x1 0xffde 3 +phy raw c45 0xed 0x1 0xd130 0x32 +phy raw c45 0xed 0x1 0xd131 0x306 +phy raw c45 0xed 0x1 0xd134 0x1 + +phy raw c45 0xf1 0x1 0xffde 0 +phy raw c45 0xf1 0x1 0xd130 0x32 +phy raw c45 0xf1 0x1 0xd131 0x306 +phy raw c45 0xf1 0x1 0xd134 0x1 +phy raw c45 0xf1 0x1 0xffde 1 +phy raw c45 0xf1 0x1 0xd130 0x32 +phy raw c45 0xf1 0x1 0xd131 0x306 +phy raw c45 0xf1 0x1 0xd134 0x1 +phy raw c45 0xf1 0x1 0xffde 2 +phy raw c45 0xf1 0x1 0xd130 0x32 +phy raw c45 0xf1 0x1 0xd131 0x306 +phy raw c45 0xf1 0x1 0xd134 0x1 +phy raw c45 0xf1 0x1 0xffde 3 +phy raw c45 0xf1 0x1 0xd130 0x32 +phy raw c45 0xf1 0x1 0xd131 0x306 +phy raw c45 0xf1 0x1 0xd134 0x1 + +# Start of 8x100G + +phy raw c45 0xc1 0x1 0xffde 0 +phy raw c45 0xc1 0x1 0xd130 0x50 +phy raw c45 0xc1 0x1 0xd131 0xa0a +phy raw c45 0xc1 0x1 0xd134 0x1 +phy raw c45 0xc1 0x1 0xffde 1 +phy raw c45 0xc1 0x1 0xd130 0x50 +phy raw c45 0xc1 0x1 0xd131 0xa0a +phy raw c45 0xc1 0x1 0xd134 0x1 +phy raw c45 0xc1 0x1 0xffde 2 +phy raw c45 0xc1 0x1 0xd130 0x50 +phy raw c45 0xc1 0x1 0xd131 0xa0a +phy raw c45 0xc1 0x1 0xd134 0x1 +phy raw c45 0xc1 0x1 0xffde 3 +phy raw c45 0xc1 0x1 0xd130 0x50 +phy raw c45 0xc1 0x1 0xd131 0xa0a +phy raw c45 0xc1 0x1 0xd134 0x1 + +phy raw c45 0xc5 0x1 0xffde 0 +phy raw c45 0xc5 0x1 0xd130 0x50 +phy raw c45 0xc5 0x1 0xd131 0xa0a +phy raw c45 0xc5 0x1 0xd134 0x1 +phy raw c45 0xc5 0x1 0xffde 1 +phy raw c45 0xc5 0x1 0xd130 0x50 +phy raw c45 0xc5 0x1 0xd131 0xa0a +phy raw c45 0xc5 0x1 0xd134 0x1 +phy raw c45 0xc5 0x1 0xffde 2 +phy raw c45 0xc5 0x1 0xd130 0x50 +phy raw c45 0xc5 0x1 0xd131 0xa0a +phy raw c45 0xc5 0x1 0xd134 0x1 +phy raw c45 0xc5 0x1 0xffde 3 +phy raw c45 0xc5 0x1 0xd130 0x50 +phy raw c45 0xc5 0x1 0xd131 0xa0a +phy raw c45 0xc5 0x1 0xd134 0x1 + +phy raw c45 0xc9 0x1 0xffde 0 +phy raw c45 0xc9 0x1 0xd130 0x50 +phy raw c45 0xc9 0x1 0xd131 0xa0a +phy raw c45 0xc9 0x1 0xd134 0x1 +phy raw c45 0xc9 0x1 0xffde 1 +phy raw c45 0xc9 0x1 0xd130 0x50 +phy raw c45 0xc9 0x1 0xd131 0xa0a +phy raw c45 0xc9 0x1 0xd134 0x1 +phy raw c45 0xc9 0x1 0xffde 2 +phy raw c45 0xc9 0x1 0xd130 0x50 +phy raw c45 0xc9 0x1 0xd131 0xa0a +phy raw c45 0xc9 0x1 0xd134 0x1 +phy raw c45 0xc9 0x1 0xffde 3 +phy raw c45 0xc9 0x1 0xd130 0x50 +phy raw c45 0xc9 0x1 0xd131 0xa0a +phy raw c45 0xc9 0x1 0xd134 0x1 + +phy raw c45 0xcd 0x1 0xffde 0 +phy raw c45 0xcd 0x1 0xd130 0x50 +phy raw c45 0xcd 0x1 0xd131 0xa0a +phy raw c45 0xcd 0x1 0xd134 0x1 +phy raw c45 0xcd 0x1 0xffde 1 +phy raw c45 0xcd 0x1 0xd130 0x50 +phy raw c45 0xcd 0x1 0xd131 0xa0a +phy raw c45 0xcd 0x1 0xd134 0x1 +phy raw c45 0xcd 0x1 0xffde 2 +phy raw c45 0xcd 0x1 0xd130 0x50 +phy raw c45 0xcd 0x1 0xd131 0xa0a +phy raw c45 0xcd 0x1 0xd134 0x1 +phy raw c45 0xcd 0x1 0xffde 3 +phy raw c45 0xcd 0x1 0xd130 0x50 +phy raw c45 0xcd 0x1 0xd131 0xa0a +phy raw c45 0xcd 0x1 0xd134 0x1 + +phy raw c45 0xad 0x1 0xffde 0 +phy raw c45 0xad 0x1 0xd130 0x50 +phy raw c45 0xad 0x1 0xd131 0xa0a +phy raw c45 0xad 0x1 0xd134 0x1 +phy raw c45 0xad 0x1 0xffde 1 +phy raw c45 0xad 0x1 0xd130 0x50 +phy raw c45 0xad 0x1 0xd131 0xa0a +phy raw c45 0xad 0x1 0xd134 0x1 +phy raw c45 0xad 0x1 0xffde 2 +phy raw c45 0xad 0x1 0xd130 0x50 +phy raw c45 0xad 0x1 0xd131 0xa0a +phy raw c45 0xad 0x1 0xd134 0x1 +phy raw c45 0xad 0x1 0xffde 3 +phy raw c45 0xad 0x1 0xd130 0x50 +phy raw c45 0xad 0x1 0xd131 0xa0a +phy raw c45 0xad 0x1 0xd134 0x1 + +phy raw c45 0xb1 0x1 0xffde 0 +phy raw c45 0xb1 0x1 0xd130 0x50 +phy raw c45 0xb1 0x1 0xd131 0xa0a +phy raw c45 0xb1 0x1 0xd134 0x1 +phy raw c45 0xb1 0x1 0xffde 1 +phy raw c45 0xb1 0x1 0xd130 0x50 +phy raw c45 0xb1 0x1 0xd131 0xa0a +phy raw c45 0xb1 0x1 0xd134 0x1 +phy raw c45 0xb1 0x1 0xffde 2 +phy raw c45 0xb1 0x1 0xd130 0x50 +phy raw c45 0xb1 0x1 0xd131 0xa0a +phy raw c45 0xb1 0x1 0xd134 0x1 +phy raw c45 0xb1 0x1 0xffde 3 +phy raw c45 0xb1 0x1 0xd130 0x50 +phy raw c45 0xb1 0x1 0xd131 0xa0a +phy raw c45 0xb1 0x1 0xd134 0x1 + +phy raw c45 0xa5 0x1 0xffde 0 +phy raw c45 0xa5 0x1 0xd130 0x50 +phy raw c45 0xa5 0x1 0xd131 0xa0a +phy raw c45 0xa5 0x1 0xd134 0x1 +phy raw c45 0xa5 0x1 0xffde 1 +phy raw c45 0xa5 0x1 0xd130 0x50 +phy raw c45 0xa5 0x1 0xd131 0xa0a +phy raw c45 0xa5 0x1 0xd134 0x1 +phy raw c45 0xa5 0x1 0xffde 2 +phy raw c45 0xa5 0x1 0xd130 0x50 +phy raw c45 0xa5 0x1 0xd131 0xa0a +phy raw c45 0xa5 0x1 0xd134 0x1 +phy raw c45 0xa5 0x1 0xffde 3 +phy raw c45 0xa5 0x1 0xd130 0x50 +phy raw c45 0xa5 0x1 0xd131 0xa0a +phy raw c45 0xa5 0x1 0xd134 0x1 + +phy raw c45 0xa9 0x1 0xffde 0 +phy raw c45 0xa9 0x1 0xd130 0x50 +phy raw c45 0xa9 0x1 0xd131 0xa0a +phy raw c45 0xa9 0x1 0xd134 0x1 +phy raw c45 0xa9 0x1 0xffde 1 +phy raw c45 0xa9 0x1 0xd130 0x50 +phy raw c45 0xa9 0x1 0xd131 0xa0a +phy raw c45 0xa9 0x1 0xd134 0x1 +phy raw c45 0xa9 0x1 0xffde 2 +phy raw c45 0xa9 0x1 0xd130 0x50 +phy raw c45 0xa9 0x1 0xd131 0xa0a +phy raw c45 0xa9 0x1 0xd134 0x1 +phy raw c45 0xa9 0x1 0xffde 3 +phy raw c45 0xa9 0x1 0xd130 0x50 +phy raw c45 0xa9 0x1 0xd131 0xa0a +phy raw c45 0xa9 0x1 0xd134 0x1 + +linkscan on \ No newline at end of file diff --git a/device/quanta/x86_64-quanta_ix8c_bwde-r0/Quanta-IX8C-56X/td3-ix8c-48x25G+8x100G.config.bcm b/device/quanta/x86_64-quanta_ix8c_bwde-r0/Quanta-IX8C-56X/td3-ix8c-48x25G+8x100G.config.bcm index 407105d0ca0a..bf2248fbe443 100644 --- a/device/quanta/x86_64-quanta_ix8c_bwde-r0/Quanta-IX8C-56X/td3-ix8c-48x25G+8x100G.config.bcm +++ b/device/quanta/x86_64-quanta_ix8c_bwde-r0/Quanta-IX8C-56X/td3-ix8c-48x25G+8x100G.config.bcm @@ -1,7 +1,7 @@ +sai_load_hw_config=/etc/bcm/flex/bcm56870_a0_issu/b870.6.4.1/ bcm_tunnel_term_compatible_mode=1 core_clock_frequency=1525 dpp_clock_ratio=2:3 -parity_enable=0 mem_cache_enable=0 l2_mem_entries=40960 l3_mem_entries=40960 @@ -90,8 +90,8 @@ portmap_123=121:100 portmap_127=125:100 # datapath port -- MerlinCore -portmap_66=129:10:m -portmap_130=128:10:m +#portmap_66=129:10:m +#portmap_130=128:10:m # loopback port portmap_65=130:10 @@ -478,3 +478,85 @@ phy_chain_rx_polarity_flip_physical{130.0}=0x0 phy_chain_rx_polarity_flip_physical{131.0}=0x0 phy_chain_rx_polarity_flip_physical{132.0}=0x0 + +serdes_preemphasis_1=0x35503 +serdes_preemphasis_2=0x35503 +serdes_preemphasis_3=0x35503 +serdes_preemphasis_4=0x35503 +serdes_preemphasis_5=0x35503 +serdes_preemphasis_6=0x35503 +serdes_preemphasis_7=0x35503 +serdes_preemphasis_8=0x35503 +serdes_preemphasis_13=0x35503 +serdes_preemphasis_14=0x35503 +serdes_preemphasis_15=0x35503 +serdes_preemphasis_16=0x35503 +serdes_preemphasis_21=0x35503 +serdes_preemphasis_22=0x35503 +serdes_preemphasis_23=0x35503 +serdes_preemphasis_24=0x35503 +serdes_preemphasis_29=0x35503 +serdes_preemphasis_30=0x35503 +serdes_preemphasis_31=0x35503 +serdes_preemphasis_32=0x35503 +serdes_preemphasis_33=0x35503 +serdes_preemphasis_34=0x35503 +serdes_preemphasis_35=0x35503 +serdes_preemphasis_36=0x35503 +serdes_preemphasis_41=0x35503 +serdes_preemphasis_42=0x35503 +serdes_preemphasis_43=0x35503 +serdes_preemphasis_44=0x35503 +serdes_preemphasis_49=0x35503 +serdes_preemphasis_50=0x35503 +serdes_preemphasis_51=0x35503 +serdes_preemphasis_52=0x35503 +serdes_preemphasis_57=0x35503 +serdes_preemphasis_58=0x35503 +serdes_preemphasis_59=0x35503 +serdes_preemphasis_60=0x35503 +serdes_preemphasis_61=0x35503 +serdes_preemphasis_62=0x35503 +serdes_preemphasis_63=0x35503 +serdes_preemphasis_64=0x35503 +serdes_preemphasis_lane0_67=0x25905 +serdes_preemphasis_lane1_67=0x25905 +serdes_preemphasis_lane2_67=0x25905 +serdes_preemphasis_lane3_67=0x25905 +serdes_preemphasis_lane0_71=0x25905 +serdes_preemphasis_lane1_71=0x25905 +serdes_preemphasis_lane2_71=0x25905 +serdes_preemphasis_lane3_71=0x25905 +serdes_preemphasis_lane0_79=0x25905 +serdes_preemphasis_lane1_79=0x25905 +serdes_preemphasis_lane2_79=0x25905 +serdes_preemphasis_lane3_79=0x25905 +serdes_preemphasis_87=0x35503 +serdes_preemphasis_88=0x35503 +serdes_preemphasis_89=0x35503 +serdes_preemphasis_90=0x35503 +serdes_preemphasis_95=0x35503 +serdes_preemphasis_96=0x35503 +serdes_preemphasis_97=0x35503 +serdes_preemphasis_98=0x35503 +serdes_preemphasis_lane0_99=0x35503 +serdes_preemphasis_lane1_99=0x35503 +serdes_preemphasis_lane2_99=0x35503 +serdes_preemphasis_lane3_99=0x55905 +serdes_preemphasis_lane0_107=0x25905 +serdes_preemphasis_lane1_107=0x25905 +serdes_preemphasis_lane2_107=0x25905 +serdes_preemphasis_lane3_107=0x25905 +serdes_preemphasis_lane0_115=0x25905 +serdes_preemphasis_lane1_115=0x25905 +serdes_preemphasis_lane2_115=0x25905 +serdes_preemphasis_lane3_115=0x25905 +serdes_preemphasis_lane0_123=0x25905 +serdes_preemphasis_lane1_123=0x25905 +serdes_preemphasis_lane2_123=0x25905 +serdes_preemphasis_lane3_123=0x25905 +serdes_preemphasis_lane0_127=0x25905 +serdes_preemphasis_lane1_127=0x25905 +serdes_preemphasis_lane2_127=0x25905 +serdes_preemphasis_lane3_127=0x25905 + diff --git a/device/quanta/x86_64-quanta_ix8c_bwde-r0/custom_led.bin b/device/quanta/x86_64-quanta_ix8c_bwde-r0/custom_led.bin new file mode 100644 index 000000000000..4b23c95ce9d4 Binary files /dev/null and b/device/quanta/x86_64-quanta_ix8c_bwde-r0/custom_led.bin differ diff --git a/device/quanta/x86_64-quanta_ix8c_bwde-r0/led_proc_init.soc b/device/quanta/x86_64-quanta_ix8c_bwde-r0/led_proc_init.soc index 0861486660c3..49f097daca34 100644 --- a/device/quanta/x86_64-quanta_ix8c_bwde-r0/led_proc_init.soc +++ b/device/quanta/x86_64-quanta_ix8c_bwde-r0/led_proc_init.soc @@ -1,6 +1,4 @@ sleep 10 -led stop -sleep 3 +m0 Load 0 0x3800 /usr/share/sonic/platform/custom_led.bin +led auto on led start -sleep 3 -led auto on \ No newline at end of file diff --git a/device/quanta/x86_64-quanta_ix8c_bwde-r0/plugins/eeprom.py b/device/quanta/x86_64-quanta_ix8c_bwde-r0/plugins/eeprom.py index fa34110c04ea..3752a919cba4 100644 --- a/device/quanta/x86_64-quanta_ix8c_bwde-r0/plugins/eeprom.py +++ b/device/quanta/x86_64-quanta_ix8c_bwde-r0/plugins/eeprom.py @@ -16,5 +16,5 @@ class board(eeprom_tlvinfo.TlvInfoDecoder): _TLV_INFO_MAX_LEN = 256 def __init__(self, name, path, cpld_root, ro): - self.eeprom_path = "/sys/bus/i2c/devices/18-0054/eeprom" + self.eeprom_path = "/sys/bus/i2c/devices/3-0054/eeprom" super(board, self).__init__(self.eeprom_path, 0, '', True) diff --git a/device/quanta/x86_64-quanta_ix8c_bwde-r0/plugins/sfputil.py b/device/quanta/x86_64-quanta_ix8c_bwde-r0/plugins/sfputil.py index 3067919795d5..aed53ca0c083 100644 --- a/device/quanta/x86_64-quanta_ix8c_bwde-r0/plugins/sfputil.py +++ b/device/quanta/x86_64-quanta_ix8c_bwde-r0/plugins/sfputil.py @@ -23,62 +23,62 @@ class SfpUtil(SfpUtilBase): _port_to_eeprom_mapping = {} _port_to_i2c_mapping = { - 1: 32, - 2: 33, - 3: 34, - 4: 35, - 5: 36, - 6: 37, - 7: 38, - 8: 39, - 9: 40, - 10: 41, - 11: 42, - 12: 43, - 13: 44, - 14: 45, - 15: 46, - 16: 47, - 17: 48, - 18: 49, - 19: 50, - 20: 51, - 21: 52, - 22: 53, - 23: 54, - 24: 55, - 25: 56, - 26: 57, - 27: 58, - 28: 59, - 29: 60, - 30: 61, - 31: 62, - 32: 63, - 33: 64, - 34: 65, - 35: 66, - 36: 67, - 37: 68, - 38: 69, - 39: 70, - 40: 71, - 41: 72, - 42: 73, - 43: 74, - 44: 75, - 45: 76, - 46: 77, - 47: 78, - 48: 79, - 49: 80, # QSFP49 - 50: 81, # QSFP50 - 51: 82, # QSFP51 - 52: 83, # QSFP52 - 53: 84, # QSFP53 - 54: 85, # QSFP54 - 55: 86, # QSFP55 - 56: 87, # QSFP56 + 1 : 13, + 2 : 14, + 3 : 15, + 4 : 16, + 5 : 17, + 6 : 18, + 7 : 19, + 8 : 20, + 9 : 21, + 10 : 22, + 11 : 23, + 12 : 24, + 13 : 25, + 14 : 26, + 15 : 27, + 16 : 28, + 17 : 29, + 18 : 30, + 19 : 31, + 20 : 32, + 21 : 33, + 22 : 34, + 23 : 35, + 24 : 36, + 25 : 37, + 26 : 38, + 27 : 39, + 28 : 40, + 29 : 41, + 30 : 42, + 31 : 43, + 32 : 44, + 33 : 45, + 34 : 46, + 35 : 47, + 36 : 48, + 37 : 49, + 38 : 50, + 39 : 51, + 40 : 52, + 41 : 53, + 42 : 54, + 43 : 55, + 44 : 56, + 45 : 57, + 46 : 58, + 47 : 59, + 48 : 60, + 49 : 61,#QSFP49 + 50 : 62,#QSFP50 + 51 : 63,#QSFP51 + 52 : 64,#QSFP52 + 53 : 65,#QSFP53 + 54 : 66,#QSFP54 + 55 : 67,#QSFP55 + 56 : 68,#QSFP56 } @property diff --git a/device/quanta/x86_64-quanta_ix8c_bwde-r0/pmon_daemon_control.json b/device/quanta/x86_64-quanta_ix8c_bwde-r0/pmon_daemon_control.json new file mode 100644 index 000000000000..44bad6494229 --- /dev/null +++ b/device/quanta/x86_64-quanta_ix8c_bwde-r0/pmon_daemon_control.json @@ -0,0 +1,4 @@ +{ + "skip_ledd": true +} + diff --git a/device/quanta/x86_64-quanta_ix9_bwde-r0/Quanta-IX9-32X/buffers.json.j2 b/device/quanta/x86_64-quanta_ix9_bwde-r0/Quanta-IX9-32X/buffers.json.j2 new file mode 100644 index 000000000000..1083a6210fc9 --- /dev/null +++ b/device/quanta/x86_64-quanta_ix9_bwde-r0/Quanta-IX9-32X/buffers.json.j2 @@ -0,0 +1,2 @@ +{%- set default_topo = 't0' %} +{%- include 'buffers_config.j2' %} diff --git a/device/quanta/x86_64-quanta_ix9_bwde-r0/Quanta-IX9-32X/buffers_defaults_t0.j2 b/device/quanta/x86_64-quanta_ix9_bwde-r0/Quanta-IX9-32X/buffers_defaults_t0.j2 new file mode 100644 index 000000000000..9a25d6fe9fd3 --- /dev/null +++ b/device/quanta/x86_64-quanta_ix9_bwde-r0/Quanta-IX9-32X/buffers_defaults_t0.j2 @@ -0,0 +1,57 @@ + +{%- set default_cable = '40m' %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "egress_lossy_pool": { + "size": "67108864", + "type": "egress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "0", + "type": "egress", + "mode": "dynamic" + }, + "ingress_lossless_pool": { + "mode": "dynamic", + "size": "59001152", + "xoff": "7428992", + "type": "ingress" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "static_th":"67108864" + }, + "egress_lossless_profile": { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"0", + "dynamic_th":"3" + }, + "egress_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"0", + "dynamic_th":"3" + } + }, +{%- endmacro %} + + "BUFFER_PG": { +{% for port in PORT_ACTIVE %} + "{{ port }}|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }{% if not loop.last %},{% endif %} +{% endfor %} + }, + + "BUFFER_QUEUE": { +{% for port in PORT_ACTIVE %} + "{{ port }}|0-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }{% if not loop.last %},{% endif %} +{% endfor %} + } + diff --git a/device/quanta/x86_64-quanta_ix9_bwde-r0/Quanta-IX9-32X/buffers_defaults_t1.j2 b/device/quanta/x86_64-quanta_ix9_bwde-r0/Quanta-IX9-32X/buffers_defaults_t1.j2 new file mode 100644 index 000000000000..9a25d6fe9fd3 --- /dev/null +++ b/device/quanta/x86_64-quanta_ix9_bwde-r0/Quanta-IX9-32X/buffers_defaults_t1.j2 @@ -0,0 +1,57 @@ + +{%- set default_cable = '40m' %} + +{%- macro generate_buffer_pool_and_profiles() %} + "BUFFER_POOL": { + "egress_lossy_pool": { + "size": "67108864", + "type": "egress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "0", + "type": "egress", + "mode": "dynamic" + }, + "ingress_lossless_pool": { + "mode": "dynamic", + "size": "59001152", + "xoff": "7428992", + "type": "ingress" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "static_th":"67108864" + }, + "egress_lossless_profile": { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"0", + "dynamic_th":"3" + }, + "egress_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"0", + "dynamic_th":"3" + } + }, +{%- endmacro %} + + "BUFFER_PG": { +{% for port in PORT_ACTIVE %} + "{{ port }}|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }{% if not loop.last %},{% endif %} +{% endfor %} + }, + + "BUFFER_QUEUE": { +{% for port in PORT_ACTIVE %} + "{{ port }}|0-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }{% if not loop.last %},{% endif %} +{% endfor %} + } + diff --git a/device/quanta/x86_64-quanta_ix9_bwde-r0/Quanta-IX9-32X/pg_profile_lookup.ini b/device/quanta/x86_64-quanta_ix9_bwde-r0/Quanta-IX9-32X/pg_profile_lookup.ini new file mode 100644 index 000000000000..a5f3286beef8 --- /dev/null +++ b/device/quanta/x86_64-quanta_ix9_bwde-r0/Quanta-IX9-32X/pg_profile_lookup.ini @@ -0,0 +1,23 @@ +# PG lossless profiles. +# speed cable size xon xoff threshold xon_offset + 10000 5m 1270 0 190500 -2 2540 + 25000 5m 1270 0 190500 -2 2540 + 40000 5m 1270 0 190500 -2 2540 + 50000 5m 1270 0 190500 -2 2540 + 100000 5m 1270 0 190500 -2 2540 + 200000 5m 1270 0 190500 -2 2540 + 400000 5m 1270 0 190500 -2 2540 + 10000 40m 1270 0 190500 -2 2540 + 25000 40m 1270 0 190500 -2 2540 + 40000 40m 1270 0 190500 -2 2540 + 50000 40m 1270 0 190500 -2 2540 + 100000 40m 1270 0 190500 -2 2540 + 200000 40m 1270 0 190500 -2 2540 + 400000 40m 1270 0 190500 -2 2540 + 10000 300m 1270 0 190500 -2 2540 + 25000 300m 1270 0 190500 -2 2540 + 40000 300m 1270 0 190500 -2 2540 + 50000 300m 1270 0 190500 -2 2540 + 100000 300m 1270 0 190500 -2 2540 + 200000 300m 1270 0 190500 -2 2540 + 400000 300m 1270 0 190500 -2 2540 diff --git a/device/quanta/x86_64-quanta_ix9_bwde-r0/Quanta-IX9-32X/platform-def.json b/device/quanta/x86_64-quanta_ix9_bwde-r0/Quanta-IX9-32X/platform-def.json new file mode 100644 index 000000000000..4885a3e17207 --- /dev/null +++ b/device/quanta/x86_64-quanta_ix9_bwde-r0/Quanta-IX9-32X/platform-def.json @@ -0,0 +1,43 @@ +{ + "fec-mode": { + "Ethernet0-255": { + "1": { + "10000": [ "none", "fc" ], + "25000": [ "none", "fc", "rs" ], + "50000": [ "none", "rs" ] + }, + "2": [ "none", "rs" ], + "4": { + "40000": [ "none", "fc" ], + "100000": [ "none", "rs" ], + "200000": [ "none", "rs" ] + }, + "8": [ "rs" ] + } + }, + "default-fec-mode": { + "Ethernet0-255": { + "1": { + "10000": "none", + "25000": "none", + "50000": "none" + }, + "2": { + "20000": "none", + "50000": "none", + "100000": "rs" + }, + "4": { + "40000": "none", + "100000": "none", + "200000": "none" + }, + "8": "rs" + } + }, + "native-port-supported-speeds": { + "Ethernet0-255": { + } + } +} + diff --git a/device/quanta/x86_64-quanta_ix9_bwde-r0/Quanta-IX9-32X/port_config.ini b/device/quanta/x86_64-quanta_ix9_bwde-r0/Quanta-IX9-32X/port_config.ini index 8f770329437f..831083b3ace1 100644 --- a/device/quanta/x86_64-quanta_ix9_bwde-r0/Quanta-IX9-32X/port_config.ini +++ b/device/quanta/x86_64-quanta_ix9_bwde-r0/Quanta-IX9-32X/port_config.ini @@ -1,33 +1,33 @@ -# name lanes alias index -Ethernet0 33,34,35,36,37,38,39,40 fourhundredGigE1 0 -Ethernet4 25,26,27,28,29,30,31,32 fourhundredGigE2 1 -Ethernet8 49,50,51,52,53,54,55,56 fourhundredGigE3 2 -Ethernet12 57,58,59,60,61,62,63,64 fourhundredGigE4 3 -Ethernet16 65,66,67,68,69,70,71,72 fourhundredGigE5 4 -Ethernet20 73,74,75,76,77,78,79,80 fourhundredGigE6 5 -Ethernet24 81,82,83,84,85,86,87,88 fourhundredGigE7 6 -Ethernet28 89,90,91,92,93,94,95,96 fourhundredGigE8 7 -Ethernet32 17,18,19,20,21,22,23,24 fourhundredGigE9 8 -Ethernet36 97,98,99,100,101,102,103,104 fourhundredGigE10 9 -Ethernet40 9,10,11,12,13,14,15,16 fourhundredGigE11 10 -Ethernet44 41,42,43,44,45,46,47,48 fourhundredGigE12 11 -Ethernet48 113,114,115,116,117,118,119,120 fourhundredGigE13 12 -Ethernet52 105,106,107,108,109,110,111,112 fourhundredGigE14 13 -Ethernet56 121,122,123,124,125,126,127,128 fourhundredGigE15 14 -Ethernet60 1,2,3,4,5,6,7,8 fourhundredGigE16 15 -Ethernet64 137,138,139,140,141,142,143,144 fourhundredGigE17 16 -Ethernet68 129,130,131,132,133,134,135,136 fourhundredGigE18 17 -Ethernet72 241,242,243,244,245,246,247,248 fourhundredGigE19 18 -Ethernet76 249,250,251,252,253,254,255,256 fourhundredGigE20 19 -Ethernet80 225,226,227,228,229,230,231,232 fourhundredGigE21 20 -Ethernet84 145,146,147,148,149,150,151,152 fourhundredGigE22 21 -Ethernet88 153,154,155,156,157,158,159,160 fourhundredGigE23 22 -Ethernet92 233,234,235,236,237,238,239,240 fourhundredGigE24 23 -Ethernet96 161,162,163,164,165,166,167,168 fourhundredGigE25 24 -Ethernet100 169,170,171,172,173,174,175,176 fourhundredGigE26 25 -Ethernet104 177,178,179,180,181,182,183,184 fourhundredGigE27 26 -Ethernet108 185,186,187,188,189,190,191,192 fourhundredGigE28 27 -Ethernet112 193,194,195,196,197,198,199,200 fourhundredGigE29 28 -Ethernet116 201,202,203,204,205,206,207,208 fourhundredGigE30 29 -Ethernet120 209,210,211,212,213,214,215,216 fourhundredGigE31 30 -Ethernet124 217,218,219,220,221,222,223,224 fourhundredGigE32 31 +# name lanes alias index speed fec +Ethernet0 33,34,35,36,37,38,39,40 fourhundredGigE1 1 400000 rs +Ethernet8 25,26,27,28,29,30,31,32 fourhundredGigE2 2 400000 rs +Ethernet16 49,50,51,52,53,54,55,56 fourhundredGigE3 3 400000 rs +Ethernet24 57,58,59,60,61,62,63,64 fourhundredGigE4 4 400000 rs +Ethernet32 65,66,67,68,69,70,71,72 fourhundredGigE5 5 400000 rs +Ethernet40 73,74,75,76,77,78,79,80 fourhundredGigE6 6 400000 rs +Ethernet48 81,82,83,84,85,86,87,88 fourhundredGigE7 7 400000 rs +Ethernet56 89,90,91,92,93,94,95,96 fourhundredGigE8 8 400000 rs +Ethernet64 17,18,19,20,21,22,23,24 fourhundredGigE9 9 400000 rs +Ethernet72 97,98,99,100,101,102,103,104 fourhundredGigE10 10 400000 rs +Ethernet80 9,10,11,12,13,14,15,16 fourhundredGigE11 11 400000 rs +Ethernet88 41,42,43,44,45,46,47,48 fourhundredGigE12 12 400000 rs +Ethernet96 113,114,115,116,117,118,119,120 fourhundredGigE13 13 400000 rs +Ethernet104 105,106,107,108,109,110,111,112 fourhundredGigE14 14 400000 rs +Ethernet112 121,122,123,124,125,126,127,128 fourhundredGigE15 15 400000 rs +Ethernet120 1,2,3,4,5,6,7,8 fourhundredGigE16 16 400000 rs +Ethernet128 137,138,139,140,141,142,143,144 fourhundredGigE17 17 400000 rs +Ethernet136 129,130,131,132,133,134,135,136 fourhundredGigE18 18 400000 rs +Ethernet144 241,242,243,244,245,246,247,248 fourhundredGigE19 19 400000 rs +Ethernet152 249,250,251,252,253,254,255,256 fourhundredGigE20 20 400000 rs +Ethernet160 225,226,227,228,229,230,231,232 fourhundredGigE21 21 400000 rs +Ethernet168 145,146,147,148,149,150,151,152 fourhundredGigE22 22 400000 rs +Ethernet176 153,154,155,156,157,158,159,160 fourhundredGigE23 23 400000 rs +Ethernet184 233,234,235,236,237,238,239,240 fourhundredGigE24 24 400000 rs +Ethernet192 161,162,163,164,165,166,167,168 fourhundredGigE25 25 400000 rs +Ethernet200 169,170,171,172,173,174,175,176 fourhundredGigE26 26 400000 rs +Ethernet208 177,178,179,180,181,182,183,184 fourhundredGigE27 27 400000 rs +Ethernet216 185,186,187,188,189,190,191,192 fourhundredGigE28 28 400000 rs +Ethernet224 193,194,195,196,197,198,199,200 fourhundredGigE29 29 400000 rs +Ethernet232 201,202,203,204,205,206,207,208 fourhundredGigE30 30 400000 rs +Ethernet240 209,210,211,212,213,214,215,216 fourhundredGigE31 31 400000 rs +Ethernet248 217,218,219,220,221,222,223,224 fourhundredGigE32 32 400000 rs diff --git a/device/quanta/x86_64-quanta_ix9_bwde-r0/Quanta-IX9-32X/qos.json.j2 b/device/quanta/x86_64-quanta_ix9_bwde-r0/Quanta-IX9-32X/qos.json.j2 new file mode 100644 index 000000000000..5f957d503971 --- /dev/null +++ b/device/quanta/x86_64-quanta_ix9_bwde-r0/Quanta-IX9-32X/qos.json.j2 @@ -0,0 +1,230 @@ +{%- set PORT_ALL = [] %} +{%- for port in PORT %} + {%- if PORT_ALL.append(port) %}{% endif %} +{%- endfor %} +{%- if PORT_ALL | sort_by_port_index %}{% endif %} + +{%- set port_names_list_all = [] %} +{%- for port in PORT_ALL %} + {%- if port_names_list_all.append(port) %}{% endif %} +{%- endfor %} +{%- set port_names_all = port_names_list_all | join(',') -%} + + +{%- set PORT_ACTIVE = [] %} +{%- if DEVICE_NEIGHBOR is not defined %} + {%- set PORT_ACTIVE = PORT_ALL %} +{%- else %} + {%- for port in DEVICE_NEIGHBOR.keys() %} + {%- if PORT_ACTIVE.append(port) %}{%- endif %} + {%- endfor %} +{%- endif %} +{%- if PORT_ACTIVE | sort_by_port_index %}{% endif %} + +{%- set port_names_list_active = [] %} +{%- for port in PORT_ACTIVE %} + {%- if port_names_list_active.append(port) %}{%- endif %} +{%- endfor %} +{%- set port_names_active = port_names_list_active | join(',') -%} + + +{%- set pfc_to_pg_map_supported_asics = ['mellanox', 'barefoot', 'marvell'] -%} + + +{ +{% if generate_tc_to_pg_map is defined %} + {{- generate_tc_to_pg_map() }} +{% else %} + "TC_TO_PRIORITY_GROUP_MAP": { + "DEFAULT": { + "0": "0", + "1": "0", + "2": "0", + "3": "3", + "4": "4", + "5": "0", + "6": "0", + "7": "7" + } + }, +{% endif %} + "MAP_PFC_PRIORITY_TO_QUEUE": { + "DEFAULT": { + "0": "0", + "1": "1", + "2": "2", + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7" + } + }, + "TC_TO_QUEUE_MAP": { + "DEFAULT": { + "0": "0", + "1": "1", + "2": "2", + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7" + } + }, + "DSCP_TO_TC_MAP": { + "DEFAULT": { + "0" : "0", + "1" : "0", + "2" : "0", + "3" : "0", + "4" : "0", + "5" : "0", + "6" : "0", + "7" : "0", + "8" : "0", + "9" : "0", + "10": "0", + "11": "0", + "12": "0", + "13": "0", + "14": "0", + "15": "0", + "16": "0", + "17": "0", + "18": "0", + "19": "0", + "20": "0", + "21": "0", + "22": "0", + "23": "0", + "24": "0", + "25": "0", + "26": "0", + "27": "0", + "28": "0", + "29": "0", + "30": "0", + "31": "0", + "32": "0", + "33": "0", + "34": "0", + "35": "0", + "36": "0", + "37": "0", + "38": "0", + "39": "0", + "40": "0", + "41": "0", + "42": "0", + "43": "0", + "44": "0", + "45": "0", + "46": "0", + "47": "0", + "48": "0", + "49": "0", + "50": "0", + "51": "0", + "52": "0", + "53": "0", + "54": "0", + "55": "0", + "56": "0", + "57": "0", + "58": "0", + "59": "0", + "60": "0", + "61": "0", + "62": "0", + "63": "0" + } + }, + "SCHEDULER": { + "scheduler.0": { + "type" : "DWRR", + "weight": "1" + }, + "scheduler.1": { + "type" : "DWRR", + "weight": "2" + }, + "scheduler.2": { + "type" : "DWRR", + "weight": "3" + }, + "scheduler.3": { + "type" : "DWRR", + "weight": "4" + }, + "scheduler.4": { + "type" : "DWRR", + "weight": "5" + }, + "scheduler.5": { + "type" : "DWRR", + "weight": "10" + }, + "scheduler.6": { + "type" : "DWRR", + "weight": "25" + }, + "scheduler.7": { + "type" : "DWRR", + "weight": "50" + } + }, + "PORT_QOS_MAP": { +{% for port in PORT_ACTIVE %} + "{{ port }}": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|DEFAULT]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|DEFAULT]", + "pfc_enable" : "3,4", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|DEFAULT]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|DEFAULT]" + }{% if not loop.last %},{% endif %} +{% endfor %} + }, + "QUEUE": { +{% for port in PORT_ACTIVE %} + "{{ port }}|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, +{% endfor %} +{% for port in PORT_ACTIVE %} + "{{ port }}|1": { + "scheduler" : "[SCHEDULER|scheduler.1]" + }, +{% endfor %} +{% for port in PORT_ACTIVE %} + "{{ port }}|2": { + "scheduler": "[SCHEDULER|scheduler.2]" + }, +{% endfor %} +{% for port in PORT_ACTIVE %} + "{{ port }}|3": { + "scheduler": "[SCHEDULER|scheduler.3]" + }, +{% endfor %} +{% for port in PORT_ACTIVE %} + "{{ port }}|4": { + "scheduler": "[SCHEDULER|scheduler.4]" + }, +{% endfor %} +{% for port in PORT_ACTIVE %} + "{{ port }}|5": { + "scheduler": "[SCHEDULER|scheduler.5]" + }, +{% endfor %} +{% for port in PORT_ACTIVE %} + "{{ port }}|6": { + "scheduler": "[SCHEDULER|scheduler.6]" + }, +{% endfor %} +{% for port in PORT_ACTIVE %} + "{{ port }}|7": { + "scheduler": "[SCHEDULER|scheduler.7]" + }{% if not loop.last %},{% endif %} +{% endfor %} + } +} diff --git a/device/quanta/x86_64-quanta_ix9_bwde-r0/Quanta-IX9-32X/th3-ix9-32x400G.config.bcm b/device/quanta/x86_64-quanta_ix9_bwde-r0/Quanta-IX9-32X/th3-ix9-32x400G.config.bcm index 704183e10924..f538c46d0b5e 100644 --- a/device/quanta/x86_64-quanta_ix9_bwde-r0/Quanta-IX9-32X/th3-ix9-32x400G.config.bcm +++ b/device/quanta/x86_64-quanta_ix9_bwde-r0/Quanta-IX9-32X/th3-ix9-32x400G.config.bcm @@ -1,23 +1,31 @@ -ccm_dma_enable=0 -ccmdma_intr_enable=0 -ctr_evict_enable=0 -mem_cache_enable=0 -parity_correction=0 -parity_enable=0 -phy_enable=0 +# The following 2 SOC properties are needed to prevent FDB Events during Warmboot due to TH3 is SW Managed MACs +l2xmsg_shadow_hit_bits=0 +l2xmsg_no_cb_during_table_rebuild=1 + phy_null=1 pll_bypass=1 -init_all_modules=0 core_clock_frequency=1325 dpr_clock_frequency=1000 device_clock_frequency=1325 - -load_firmware=0x2 port_flex_enable=1 +l2xmsg_mode.0=1 +l2_mem_entries.0=8192 +l3_alpm_enable.0=2 +l3_mem_entries.0=16384 +ipv6_lpm_128b_enable=1 +lpm_ipv6_128b_reserved=0 +l3_alpm_ipv6_128b_bkt_rsvd=0 +num_ipv6_lpm_128b_entries=768 +mmu_port_num_mc_queue.0=1 +module_64ports.0=1 +multicast_l2_range.0=511 +oversubscribe_mode=1 +led_fw_path="/usr/share/sonic/platform/" + # portmap settings -pbmp_xport_xe=0x111101111411110111101111011114111102222 +pbmp_xport_xe.0=0x3ffffffffffffffffffffffffffffffffffffffe portmap_1=1:400 portmap_5=9:400 @@ -47,17 +55,18 @@ portmap_108=177:400 portmap_112=185:400 portmap_120=193:400 -portmap_124=201:400 -portmap_128=209:400 -portmap_132=217:400 +portmap_121=201:400 +portmap_122=209:400 +portmap_130=217:400 + portmap_140=225:400 portmap_144=233:400 portmap_148=241:400 portmap_152=249:400 # datapath port -portmap_38=257:10 -portmap_118=258:10 +#portmap_38=257:10 +#portmap_118=258:10 # loopback port portmap_19=260:10 @@ -71,41 +80,165 @@ portmap_159=266:10 # port order remap dport_map_port_20=1 -dport_map_port_13=2 -dport_map_port_28=3 -dport_map_port_32=4 -dport_map_port_40=5 -dport_map_port_44=6 -dport_map_port_48=7 -dport_map_port_52=8 -dport_map_port_9=9 -dport_map_port_60=10 -dport_map_port_5=11 -dport_map_port_24=12 -dport_map_port_68=13 -dport_map_port_64=14 -dport_map_port_72=15 -dport_map_port_1=16 - -dport_map_port_84=17 -dport_map_port_80=18 -dport_map_port_148=19 -dport_map_port_152=20 -dport_map_port_140=21 -dport_map_port_88=22 -dport_map_port_92=23 -dport_map_port_144=24 -dport_map_port_100=25 -dport_map_port_104=26 -dport_map_port_108=27 -dport_map_port_112=28 -dport_map_port_120=29 -dport_map_port_124=30 -dport_map_port_128=31 -dport_map_port_132=32 - -dport_map_port_38=33 -dport_map_port_118=34 +dport_map_port_21=2 +dport_map_port_22=3 +dport_map_port_23=4 + +dport_map_port_13=5 +dport_map_port_14=6 +dport_map_port_15=7 +dport_map_port_16=8 + +dport_map_port_28=9 +dport_map_port_29=10 +dport_map_port_30=11 +dport_map_port_31=12 + +dport_map_port_32=13 +dport_map_port_33=14 +dport_map_port_34=15 +dport_map_port_35=16 + +dport_map_port_40=17 +dport_map_port_41=18 +dport_map_port_42=19 +dport_map_port_43=20 + +dport_map_port_44=21 +dport_map_port_45=22 +dport_map_port_46=23 +dport_map_port_47=24 + +dport_map_port_48=25 +dport_map_port_49=26 +dport_map_port_50=27 +dport_map_port_51=28 + +dport_map_port_52=29 +dport_map_port_53=30 +dport_map_port_54=31 +dport_map_port_55=32 + +dport_map_port_9=33 +dport_map_port_10=34 +dport_map_port_11=35 +dport_map_port_12=36 + +dport_map_port_60=37 +dport_map_port_61=38 +dport_map_port_62=39 +dport_map_port_63=40 + +dport_map_port_5=41 +dport_map_port_6=42 +dport_map_port_7=43 +dport_map_port_8=44 + +dport_map_port_24=45 +dport_map_port_25=46 +dport_map_port_26=47 +dport_map_port_27=48 + +dport_map_port_68=49 +dport_map_port_69=50 +dport_map_port_70=51 +dport_map_port_71=52 + +dport_map_port_64=53 +dport_map_port_65=54 +dport_map_port_66=55 +dport_map_port_67=56 + +dport_map_port_72=57 +dport_map_port_73=58 +dport_map_port_74=59 +dport_map_port_75=60 + +dport_map_port_1=61 +dport_map_port_2=62 +dport_map_port_3=63 +dport_map_port_4=64 + +dport_map_port_84=65 +dport_map_port_85=66 +dport_map_port_86=67 +dport_map_port_87=68 + +dport_map_port_80=69 +dport_map_port_81=70 +dport_map_port_82=71 +dport_map_port_83=72 + +dport_map_port_148=73 +dport_map_port_149=74 +dport_map_port_150=75 +dport_map_port_151=76 + +dport_map_port_152=77 +dport_map_port_153=78 +dport_map_port_154=79 +dport_map_port_155=80 + +dport_map_port_140=81 +dport_map_port_141=82 +dport_map_port_142=83 +dport_map_port_143=84 + + +dport_map_port_88=85 +dport_map_port_89=86 +dport_map_port_90=87 +dport_map_port_91=88 + +dport_map_port_92=89 +dport_map_port_93=90 +dport_map_port_94=91 +dport_map_port_95=92 + +dport_map_port_144=93 +dport_map_port_145=94 +dport_map_port_146=95 +dport_map_port_147=96 + +dport_map_port_100=97 +dport_map_port_101=98 +dport_map_port_102=99 +dport_map_port_103=100 + +dport_map_port_104=101 +dport_map_port_105=102 +dport_map_port_106=103 +dport_map_port_107=104 + +dport_map_port_108=105 +dport_map_port_109=106 +dport_map_port_110=107 +dport_map_port_111=108 + +dport_map_port_112=109 +dport_map_port_113=110 +dport_map_port_114=111 +dport_map_port_115=112 + +dport_map_port_120=113 +dport_map_port_121=114 +dport_map_port_122=115 +dport_map_port_123=116 + +dport_map_port_124=117 +dport_map_port_125=118 +dport_map_port_126=119 +dport_map_port_127=120 + +dport_map_port_128=121 +dport_map_port_129=122 +dport_map_port_130=123 +dport_map_port_131=124 + +dport_map_port_132=125 +dport_map_port_133=126 +dport_map_port_134=127 +dport_map_port_135=128 ### lane swap and polarity follow front port order ### phy_chain_tx_lane_map_physical{33.0}=0x75206431 @@ -269,73 +402,3 @@ phy_chain_rx_lane_map_physical{217.0}=0x67541203 serdes_core_rx_polarity_flip_physical{217}=0x33 -port_fec_20=9 -port_fec_13=9 -port_fec_28=9 -port_fec_32=9 -port_fec_40=9 -port_fec_44=9 -port_fec_48=9 -port_fec_52=9 -port_fec_9=9 -port_fec_60=9 -port_fec_5=9 -port_fec_24=9 -port_fec_68=9 -port_fec_64=9 -port_fec_72=9 -port_fec_1=9 - -port_fec_84=9 -port_fec_80=9 -port_fec_148=9 -port_fec_152=9 -port_fec_140=9 -port_fec_88=9 -port_fec_92=9 -port_fec_144=9 -port_fec_100=9 -port_fec_104=9 -port_fec_108=9 -port_fec_112=9 -port_fec_120=9 -port_fec_124=9 -port_fec_128=9 -port_fec_132=9 - - -port_init_cl72_20=1 -port_init_cl72_13=1 -port_init_cl72_28=1 -port_init_cl72_32=1 -port_init_cl72_40=1 -port_init_cl72_44=1 -port_init_cl72_48=1 -port_init_cl72_52=1 -port_init_cl72_9=1 -port_init_cl72_60=1 -port_init_cl72_5=1 -port_init_cl72_24=1 -port_init_cl72_68=1 -port_init_cl72_64=1 -port_init_cl72_72=1 -port_init_cl72_1=1 - -port_init_cl72_84=1 -port_init_cl72_80=1 -port_init_cl72_148=1 -port_init_cl72_152=1 -port_init_cl72_140=1 -port_init_cl72_88=1 -port_init_cl72_92=1 -port_init_cl72_144=1 -port_init_cl72_100=1 -port_init_cl72_104=1 -port_init_cl72_108=1 -port_init_cl72_112=1 -port_init_cl72_120=1 -port_init_cl72_124=1 -port_init_cl72_128=1 -port_init_cl72_132=1 - - diff --git a/device/quanta/x86_64-quanta_ix9_bwde-r0/custom_led.bin b/device/quanta/x86_64-quanta_ix9_bwde-r0/custom_led.bin new file mode 100644 index 000000000000..1f12caa4fa08 Binary files /dev/null and b/device/quanta/x86_64-quanta_ix9_bwde-r0/custom_led.bin differ diff --git a/device/quanta/x86_64-quanta_ix9_bwde-r0/led_proc_init.soc b/device/quanta/x86_64-quanta_ix9_bwde-r0/led_proc_init.soc index adff95218e4f..b6c5d5073931 100644 --- a/device/quanta/x86_64-quanta_ix9_bwde-r0/led_proc_init.soc +++ b/device/quanta/x86_64-quanta_ix9_bwde-r0/led_proc_init.soc @@ -1,2 +1,6 @@ sleep 10 +m0 Load 0 0x3800 /usr/share/sonic/platform/custom_led.bin led auto on +led start + +rcload /usr/share/sonic/platform/preemphasis-32x400G.soc diff --git a/device/quanta/x86_64-quanta_ix9_bwde-r0/plugins/eeprom.py b/device/quanta/x86_64-quanta_ix9_bwde-r0/plugins/eeprom.py index fa34110c04ea..3752a919cba4 100644 --- a/device/quanta/x86_64-quanta_ix9_bwde-r0/plugins/eeprom.py +++ b/device/quanta/x86_64-quanta_ix9_bwde-r0/plugins/eeprom.py @@ -16,5 +16,5 @@ class board(eeprom_tlvinfo.TlvInfoDecoder): _TLV_INFO_MAX_LEN = 256 def __init__(self, name, path, cpld_root, ro): - self.eeprom_path = "/sys/bus/i2c/devices/18-0054/eeprom" + self.eeprom_path = "/sys/bus/i2c/devices/3-0054/eeprom" super(board, self).__init__(self.eeprom_path, 0, '', True) diff --git a/device/quanta/x86_64-quanta_ix9_bwde-r0/plugins/sfputil.py b/device/quanta/x86_64-quanta_ix9_bwde-r0/plugins/sfputil.py index 832dac4e0570..6735a7579ad5 100644 --- a/device/quanta/x86_64-quanta_ix9_bwde-r0/plugins/sfputil.py +++ b/device/quanta/x86_64-quanta_ix9_bwde-r0/plugins/sfputil.py @@ -8,52 +8,52 @@ class SfpUtil(SfpUtilBase): """Platform specific SfpUtill class""" - _port_start = 0 - _port_end = 31 + _port_start = 1 + _port_end = 32 ports_in_block = 32 _port_to_eeprom_mapping = {} port_to_i2c_mapping = { - 1: 32, - 2: 33, - 3: 34, - 4: 35, - 5: 36, - 6: 37, - 7: 38, - 8: 39, - 9: 40, - 10: 41, - 11: 42, - 12: 43, - 13: 44, - 14: 45, - 15: 46, - 16: 47, - 17: 48, - 18: 49, - 19: 50, - 20: 51, - 21: 52, - 22: 53, - 23: 54, - 24: 55, - 25: 56, - 26: 57, - 27: 58, - 28: 59, - 29: 60, - 30: 61, - 31: 62, - 32: 63, + 1 : 13, + 2 : 14, + 3 : 15, + 4 : 16, + 5 : 17, + 6 : 18, + 7 : 19, + 8 : 20, + 9 : 21, + 10 : 22, + 11 : 23, + 12 : 24, + 13 : 25, + 14 : 26, + 15 : 27, + 16 : 28, + 17 : 29, + 18 : 30, + 19 : 31, + 20 : 32, + 21 : 33, + 22 : 34, + 23 : 35, + 24 : 36, + 25 : 37, + 26 : 38, + 27 : 39, + 28 : 40, + 29 : 41, + 30 : 42, + 31 : 43, + 32 : 44, } - _qsfp_ports = list(range(0, ports_in_block + 1)) + _qsfp_ports = range(1, ports_in_block + 1) def __init__(self): eeprom_path = '/sys/bus/i2c/devices/{0}-0050/eeprom' - for x in range(0, self._port_end + 1): - port_eeprom_path = eeprom_path.format(self.port_to_i2c_mapping[x+1]) + for x in range(self.port_start, self.port_end + 1): + port_eeprom_path = eeprom_path.format(self.port_to_i2c_mapping[x]) self._port_to_eeprom_mapping[x] = port_eeprom_path SfpUtilBase.__init__(self) @@ -63,7 +63,7 @@ def reset(self, port_num): return False try: - reg_file = open("/sys/class/cpld-qsfpdd/port-"+str(port_num+1)+"/reset", "r+") + reg_file = open("/sys/class/cpld-qsfpdd/port-"+str(port_num)+"/reset", "r+") except IOError as e: print("Error: unable to open file: %s" % str(e)) return False @@ -77,7 +77,7 @@ def reset(self, port_num): # Flip the value back write back to the register to take port out of reset try: - reg_file = open("/sys/class/cpld-qsfpdd/port-"+str(port_num+1)+"/reset", "r+") + reg_file = open("/sys/class/cpld-qsfpdd/port-"+str(port_num)+"/reset", "r+") except IOError as e: print("Error: unable to open file: %s" % str(e)) return False @@ -94,7 +94,7 @@ def set_low_power_mode(self, port_num, lpmode): return False try: - reg_file = open("/sys/class/cpld-qsfpdd/port-"+str(port_num+1)+"/lpmode", "r+") + reg_file = open("/sys/class/cpld-qsfpdd/port-"+str(port_num)+"/lpmode", "r+") except IOError as e: print("Error: unable to open file: %s" % str(e)) return False @@ -118,7 +118,7 @@ def get_low_power_mode(self, port_num): return False try: - reg_file = open("/sys/class/cpld-qsfpdd/port-"+str(port_num+1)+"/lpmode") + reg_file = open("/sys/class/cpld-qsfpdd/port-"+str(port_num)+"/lpmode") except IOError as e: print("Error: unable to open file: %s" % str(e)) return False @@ -136,7 +136,7 @@ def get_presence(self, port_num): return False try: - reg_file = open("/sys/class/cpld-qsfpdd/port-"+str(port_num+1)+"/module_present") + reg_file = open("/sys/class/cpld-qsfpdd/port-"+str(port_num)+"/module_present") except IOError as e: print("Error: unable to open file: %s" % str(e)) return False @@ -155,9 +155,13 @@ def port_start(self): def port_end(self): return self._port_end + @property + def osfp_ports(self): + return range(self.port_start, self.ports_in_block + 1) + @property def qsfp_ports(self): - return list(range(0, self.ports_in_block + 1)) + return {} @property def port_to_eeprom_mapping(self): diff --git a/device/quanta/x86_64-quanta_ix9_bwde-r0/pmon_daemon_control.json b/device/quanta/x86_64-quanta_ix9_bwde-r0/pmon_daemon_control.json new file mode 100644 index 000000000000..44bad6494229 --- /dev/null +++ b/device/quanta/x86_64-quanta_ix9_bwde-r0/pmon_daemon_control.json @@ -0,0 +1,4 @@ +{ + "skip_ledd": true +} + diff --git a/device/quanta/x86_64-quanta_ix9_bwde-r0/preemphasis-32x400G.soc b/device/quanta/x86_64-quanta_ix9_bwde-r0/preemphasis-32x400G.soc new file mode 100644 index 000000000000..f324ad96708b --- /dev/null +++ b/device/quanta/x86_64-quanta_ix9_bwde-r0/preemphasis-32x400G.soc @@ -0,0 +1,1057 @@ +# Pre-emphasis + +phy raw c45 0xa9 0x1 0xffde 0 +phy raw c45 0xa9 0x1 0xd134 0x1f0 +phy raw c45 0xa9 0x1 0xd135 0x98 +phy raw c45 0xa9 0x1 0xd136 0x0 +phy raw c45 0xa9 0x1 0xffde 1 +phy raw c45 0xa9 0x1 0xd134 0x1f0 +phy raw c45 0xa9 0x1 0xd135 0x98 +phy raw c45 0xa9 0x1 0xd136 0x0 +phy raw c45 0xa9 0x1 0xffde 2 +phy raw c45 0xa9 0x1 0xd134 0x1f0 +phy raw c45 0xa9 0x1 0xd135 0x98 +phy raw c45 0xa9 0x1 0xd136 0x0 +phy raw c45 0xa9 0x1 0xffde 3 +phy raw c45 0xa9 0x1 0xd134 0x1f0 +phy raw c45 0xa9 0x1 0xd135 0x98 +phy raw c45 0xa9 0x1 0xd136 0x0 +phy raw c45 0xa9 0x1 0xffde 4 +phy raw c45 0xa9 0x1 0xd134 0x1f0 +phy raw c45 0xa9 0x1 0xd135 0x98 +phy raw c45 0xa9 0x1 0xd136 0x0 +phy raw c45 0xa9 0x1 0xffde 5 +phy raw c45 0xa9 0x1 0xd134 0x1f0 +phy raw c45 0xa9 0x1 0xd135 0x98 +phy raw c45 0xa9 0x1 0xd136 0x0 +phy raw c45 0xa9 0x1 0xffde 6 +phy raw c45 0xa9 0x1 0xd134 0x1f0 +phy raw c45 0xa9 0x1 0xd135 0x98 +phy raw c45 0xa9 0x1 0xd136 0x0 +phy raw c45 0xa9 0x1 0xffde 7 +phy raw c45 0xa9 0x1 0xd134 0x1f0 +phy raw c45 0xa9 0x1 0xd135 0x98 +phy raw c45 0xa9 0x1 0xd136 0x0 + +phy raw c45 0xa1 0x1 0xffde 0 +phy raw c45 0xa1 0x1 0xd134 0x1f0 +phy raw c45 0xa1 0x1 0xd135 0x98 +phy raw c45 0xa1 0x1 0xd136 0x0 +phy raw c45 0xa1 0x1 0xffde 1 +phy raw c45 0xa1 0x1 0xd134 0x1f0 +phy raw c45 0xa1 0x1 0xd135 0x98 +phy raw c45 0xa1 0x1 0xd136 0x0 +phy raw c45 0xa1 0x1 0xffde 2 +phy raw c45 0xa1 0x1 0xd134 0x1f0 +phy raw c45 0xa1 0x1 0xd135 0x98 +phy raw c45 0xa1 0x1 0xd136 0x0 +phy raw c45 0xa1 0x1 0xffde 3 +phy raw c45 0xa1 0x1 0xd134 0x1f0 +phy raw c45 0xa1 0x1 0xd135 0x98 +phy raw c45 0xa1 0x1 0xd136 0x0 +phy raw c45 0xa1 0x1 0xffde 4 +phy raw c45 0xa1 0x1 0xd134 0x1f0 +phy raw c45 0xa1 0x1 0xd135 0x98 +phy raw c45 0xa1 0x1 0xd136 0x0 +phy raw c45 0xa1 0x1 0xffde 5 +phy raw c45 0xa1 0x1 0xd134 0x1f0 +phy raw c45 0xa1 0x1 0xd135 0x98 +phy raw c45 0xa1 0x1 0xd136 0x0 +phy raw c45 0xa1 0x1 0xffde 6 +phy raw c45 0xa1 0x1 0xd134 0x1f0 +phy raw c45 0xa1 0x1 0xd135 0x98 +phy raw c45 0xa1 0x1 0xd136 0x0 +phy raw c45 0xa1 0x1 0xffde 7 +phy raw c45 0xa1 0x1 0xd134 0x1ee +phy raw c45 0xa1 0x1 0xd135 0x90 +phy raw c45 0xa1 0x1 0xd136 0x1fc + +phy raw c45 0xc1 0x1 0xffde 0 +phy raw c45 0xc1 0x1 0xd134 0x1f0 +phy raw c45 0xc1 0x1 0xd135 0x98 +phy raw c45 0xc1 0x1 0xd136 0x0 +phy raw c45 0xc1 0x1 0xffde 1 +phy raw c45 0xc1 0x1 0xd134 0x1f0 +phy raw c45 0xc1 0x1 0xd135 0x98 +phy raw c45 0xc1 0x1 0xd136 0x0 +phy raw c45 0xc1 0x1 0xffde 2 +phy raw c45 0xc1 0x1 0xd134 0x1f0 +phy raw c45 0xc1 0x1 0xd135 0x98 +phy raw c45 0xc1 0x1 0xd136 0x0 +phy raw c45 0xc1 0x1 0xffde 3 +phy raw c45 0xc1 0x1 0xd134 0x1f0 +phy raw c45 0xc1 0x1 0xd135 0x98 +phy raw c45 0xc1 0x1 0xd136 0x0 +phy raw c45 0xc1 0x1 0xffde 4 +phy raw c45 0xc1 0x1 0xd134 0x1f0 +phy raw c45 0xc1 0x1 0xd135 0x98 +phy raw c45 0xc1 0x1 0xd136 0x0 +phy raw c45 0xc1 0x1 0xffde 5 +phy raw c45 0xc1 0x1 0xd134 0x1f0 +phy raw c45 0xc1 0x1 0xd135 0x98 +phy raw c45 0xc1 0x1 0xd136 0x0 +phy raw c45 0xc1 0x1 0xffde 6 +phy raw c45 0xc1 0x1 0xd134 0x1f0 +phy raw c45 0xc1 0x1 0xd135 0x98 +phy raw c45 0xc1 0x1 0xd136 0x0 +phy raw c45 0xc1 0x1 0xffde 7 +phy raw c45 0xc1 0x1 0xd134 0x1f0 +phy raw c45 0xc1 0x1 0xd135 0x98 +phy raw c45 0xc1 0x1 0xd136 0x0 + +phy raw c45 0xc9 0x1 0xffde 0 +phy raw c45 0xc9 0x1 0xd134 0x1f0 +phy raw c45 0xc9 0x1 0xd135 0x98 +phy raw c45 0xc9 0x1 0xd136 0x0 +phy raw c45 0xc9 0x1 0xffde 1 +phy raw c45 0xc9 0x1 0xd134 0x1f0 +phy raw c45 0xc9 0x1 0xd135 0x98 +phy raw c45 0xc9 0x1 0xd136 0x0 +phy raw c45 0xc9 0x1 0xffde 2 +phy raw c45 0xc9 0x1 0xd134 0x1f0 +phy raw c45 0xc9 0x1 0xd135 0x98 +phy raw c45 0xc9 0x1 0xd136 0x0 +phy raw c45 0xc9 0x1 0xffde 3 +phy raw c45 0xc9 0x1 0xd134 0x1f0 +phy raw c45 0xc9 0x1 0xd135 0x98 +phy raw c45 0xc9 0x1 0xd136 0x0 +phy raw c45 0xc9 0x1 0xffde 4 +phy raw c45 0xc9 0x1 0xd134 0x1f0 +phy raw c45 0xc9 0x1 0xd135 0x98 +phy raw c45 0xc9 0x1 0xd136 0x0 +phy raw c45 0xc9 0x1 0xffde 5 +phy raw c45 0xc9 0x1 0xd134 0x1f0 +phy raw c45 0xc9 0x1 0xd135 0x98 +phy raw c45 0xc9 0x1 0xd136 0x0 +phy raw c45 0xc9 0x1 0xffde 6 +phy raw c45 0xc9 0x1 0xd134 0x1f0 +phy raw c45 0xc9 0x1 0xd135 0x98 +phy raw c45 0xc9 0x1 0xd136 0x0 +phy raw c45 0xc9 0x1 0xffde 7 +phy raw c45 0xc9 0x1 0xd134 0x1f0 +phy raw c45 0xc9 0x1 0xd135 0x98 +phy raw c45 0xc9 0x1 0xd136 0x0 + +phy raw c45 0xd1 0x1 0xffde 0 +phy raw c45 0xd1 0x1 0xd134 0x1f0 +phy raw c45 0xd1 0x1 0xd135 0x98 +phy raw c45 0xd1 0x1 0xd136 0x0 +phy raw c45 0xd1 0x1 0xffde 1 +phy raw c45 0xd1 0x1 0xd134 0x1f0 +phy raw c45 0xd1 0x1 0xd135 0x98 +phy raw c45 0xd1 0x1 0xd136 0x0 +phy raw c45 0xd1 0x1 0xffde 2 +phy raw c45 0xd1 0x1 0xd134 0x1f0 +phy raw c45 0xd1 0x1 0xd135 0x98 +phy raw c45 0xd1 0x1 0xd136 0x0 +phy raw c45 0xd1 0x1 0xffde 3 +phy raw c45 0xd1 0x1 0xd134 0x1f0 +phy raw c45 0xd1 0x1 0xd135 0x98 +phy raw c45 0xd1 0x1 0xd136 0x0 +phy raw c45 0xd1 0x1 0xffde 4 +phy raw c45 0xd1 0x1 0xd134 0x1f0 +phy raw c45 0xd1 0x1 0xd135 0x98 +phy raw c45 0xd1 0x1 0xd136 0x0 +phy raw c45 0xd1 0x1 0xffde 5 +phy raw c45 0xd1 0x1 0xd134 0x1f0 +phy raw c45 0xd1 0x1 0xd135 0x98 +phy raw c45 0xd1 0x1 0xd136 0x0 +phy raw c45 0xd1 0x1 0xffde 6 +phy raw c45 0xd1 0x1 0xd134 0x1f0 +phy raw c45 0xd1 0x1 0xd135 0x98 +phy raw c45 0xd1 0x1 0xd136 0x0 +phy raw c45 0xd1 0x1 0xffde 7 +phy raw c45 0xd1 0x1 0xd134 0x1f0 +phy raw c45 0xd1 0x1 0xd135 0x98 +phy raw c45 0xd1 0x1 0xd136 0x0 + +phy raw c45 0xe1 0x1 0xffde 0 +phy raw c45 0xe1 0x1 0xd134 0x1f0 +phy raw c45 0xe1 0x1 0xd135 0x98 +phy raw c45 0xe1 0x1 0xd136 0x0 +phy raw c45 0xe1 0x1 0xffde 1 +phy raw c45 0xe1 0x1 0xd134 0x1f0 +phy raw c45 0xe1 0x1 0xd135 0x98 +phy raw c45 0xe1 0x1 0xd136 0x0 +phy raw c45 0xe1 0x1 0xffde 2 +phy raw c45 0xe1 0x1 0xd134 0x1f0 +phy raw c45 0xe1 0x1 0xd135 0x98 +phy raw c45 0xe1 0x1 0xd136 0x0 +phy raw c45 0xe1 0x1 0xffde 3 +phy raw c45 0xe1 0x1 0xd134 0x1f0 +phy raw c45 0xe1 0x1 0xd135 0x98 +phy raw c45 0xe1 0x1 0xd136 0x0 +phy raw c45 0xe1 0x1 0xffde 4 +phy raw c45 0xe1 0x1 0xd134 0x1f0 +phy raw c45 0xe1 0x1 0xd135 0x98 +phy raw c45 0xe1 0x1 0xd136 0x0 +phy raw c45 0xe1 0x1 0xffde 5 +phy raw c45 0xe1 0x1 0xd134 0x1f0 +phy raw c45 0xe1 0x1 0xd135 0x98 +phy raw c45 0xe1 0x1 0xd136 0x0 +phy raw c45 0xe1 0x1 0xffde 6 +phy raw c45 0xe1 0x1 0xd134 0x1f0 +phy raw c45 0xe1 0x1 0xd135 0x98 +phy raw c45 0xe1 0x1 0xd136 0x0 +phy raw c45 0xe1 0x1 0xffde 7 +phy raw c45 0xe1 0x1 0xd134 0x1f0 +phy raw c45 0xe1 0x1 0xd135 0x98 +phy raw c45 0xe1 0x1 0xd136 0x0 + +phy raw c45 0xe9 0x1 0xffde 0 +phy raw c45 0xe9 0x1 0xd134 0x1f0 +phy raw c45 0xe9 0x1 0xd135 0x98 +phy raw c45 0xe9 0x1 0xd136 0x0 +phy raw c45 0xe9 0x1 0xffde 1 +phy raw c45 0xe9 0x1 0xd134 0x1f0 +phy raw c45 0xe9 0x1 0xd135 0x98 +phy raw c45 0xe9 0x1 0xd136 0x0 +phy raw c45 0xe9 0x1 0xffde 2 +phy raw c45 0xe9 0x1 0xd134 0x1f0 +phy raw c45 0xe9 0x1 0xd135 0x98 +phy raw c45 0xe9 0x1 0xd136 0x0 +phy raw c45 0xe9 0x1 0xffde 3 +phy raw c45 0xe9 0x1 0xd134 0x1f0 +phy raw c45 0xe9 0x1 0xd135 0x98 +phy raw c45 0xe9 0x1 0xd136 0x0 +phy raw c45 0xe9 0x1 0xffde 4 +phy raw c45 0xe9 0x1 0xd134 0x1f0 +phy raw c45 0xe9 0x1 0xd135 0x98 +phy raw c45 0xe9 0x1 0xd136 0x0 +phy raw c45 0xe9 0x1 0xffde 5 +phy raw c45 0xe9 0x1 0xd134 0x1f0 +phy raw c45 0xe9 0x1 0xd135 0x98 +phy raw c45 0xe9 0x1 0xd136 0x0 +phy raw c45 0xe9 0x1 0xffde 6 +phy raw c45 0xe9 0x1 0xd134 0x1f0 +phy raw c45 0xe9 0x1 0xd135 0x98 +phy raw c45 0xe9 0x1 0xd136 0x0 +phy raw c45 0xe9 0x1 0xffde 7 +phy raw c45 0xe9 0x1 0xd134 0x1f0 +phy raw c45 0xe9 0x1 0xd135 0x98 +phy raw c45 0xe9 0x1 0xd136 0x0 + +phy raw c45 0xf1 0x1 0xffde 0 +phy raw c45 0xf1 0x1 0xd134 0x1f0 +phy raw c45 0xf1 0x1 0xd135 0x98 +phy raw c45 0xf1 0x1 0xd136 0x0 +phy raw c45 0xf1 0x1 0xffde 1 +phy raw c45 0xf1 0x1 0xd134 0x1f0 +phy raw c45 0xf1 0x1 0xd135 0x98 +phy raw c45 0xf1 0x1 0xd136 0x0 +phy raw c45 0xf1 0x1 0xffde 2 +phy raw c45 0xf1 0x1 0xd134 0x1f0 +phy raw c45 0xf1 0x1 0xd135 0x98 +phy raw c45 0xf1 0x1 0xd136 0x0 +phy raw c45 0xf1 0x1 0xffde 3 +phy raw c45 0xf1 0x1 0xd134 0x1f0 +phy raw c45 0xf1 0x1 0xd135 0x98 +phy raw c45 0xf1 0x1 0xd136 0x0 +phy raw c45 0xf1 0x1 0xffde 4 +phy raw c45 0xf1 0x1 0xd134 0x1f0 +phy raw c45 0xf1 0x1 0xd135 0x98 +phy raw c45 0xf1 0x1 0xd136 0x0 +phy raw c45 0xf1 0x1 0xffde 5 +phy raw c45 0xf1 0x1 0xd134 0x1f0 +phy raw c45 0xf1 0x1 0xd135 0x98 +phy raw c45 0xf1 0x1 0xd136 0x0 +phy raw c45 0xf1 0x1 0xffde 6 +phy raw c45 0xf1 0x1 0xd134 0x1f0 +phy raw c45 0xf1 0x1 0xd135 0x98 +phy raw c45 0xf1 0x1 0xd136 0x0 +phy raw c45 0xf1 0x1 0xffde 7 +phy raw c45 0xf1 0x1 0xd134 0x1f0 +phy raw c45 0xf1 0x1 0xd135 0x98 +phy raw c45 0xf1 0x1 0xd136 0x0 + +phy raw c45 0x91 0x1 0xffde 0 +phy raw c45 0x91 0x1 0xd134 0x1f0 +phy raw c45 0x91 0x1 0xd135 0x98 +phy raw c45 0x91 0x1 0xd136 0x0 +phy raw c45 0x91 0x1 0xffde 1 +phy raw c45 0x91 0x1 0xd134 0x1f0 +phy raw c45 0x91 0x1 0xd135 0x98 +phy raw c45 0x91 0x1 0xd136 0x0 +phy raw c45 0x91 0x1 0xffde 2 +phy raw c45 0x91 0x1 0xd134 0x1f0 +phy raw c45 0x91 0x1 0xd135 0x98 +phy raw c45 0x91 0x1 0xd136 0x0 +phy raw c45 0x91 0x1 0xffde 3 +phy raw c45 0x91 0x1 0xd134 0x1f0 +phy raw c45 0x91 0x1 0xd135 0x98 +phy raw c45 0x91 0x1 0xd136 0x0 +phy raw c45 0x91 0x1 0xffde 4 +phy raw c45 0x91 0x1 0xd134 0x1f0 +phy raw c45 0x91 0x1 0xd135 0x98 +phy raw c45 0x91 0x1 0xd136 0x0 +phy raw c45 0x91 0x1 0xffde 5 +phy raw c45 0x91 0x1 0xd134 0x1f0 +phy raw c45 0x91 0x1 0xd135 0x98 +phy raw c45 0x91 0x1 0xd136 0x0 +phy raw c45 0x91 0x1 0xffde 6 +phy raw c45 0x91 0x1 0xd134 0x1f0 +phy raw c45 0x91 0x1 0xd135 0x98 +phy raw c45 0x91 0x1 0xd136 0x0 +phy raw c45 0x91 0x1 0xffde 7 +phy raw c45 0x91 0x1 0xd134 0x1f0 +phy raw c45 0x91 0x1 0xd135 0x98 +phy raw c45 0x91 0x1 0xd136 0x0 + +phy raw c45 0x181 0x1 0xffde 0 +phy raw c45 0x181 0x1 0xd134 0x1f0 +phy raw c45 0x181 0x1 0xd135 0x98 +phy raw c45 0x181 0x1 0xd136 0x0 +phy raw c45 0x181 0x1 0xffde 1 +phy raw c45 0x181 0x1 0xd134 0x1f0 +phy raw c45 0x181 0x1 0xd135 0x98 +phy raw c45 0x181 0x1 0xd136 0x0 +phy raw c45 0x181 0x1 0xffde 2 +phy raw c45 0x181 0x1 0xd134 0x1f0 +phy raw c45 0x181 0x1 0xd135 0x98 +phy raw c45 0x181 0x1 0xd136 0x0 +phy raw c45 0x181 0x1 0xffde 3 +phy raw c45 0x181 0x1 0xd134 0x1f0 +phy raw c45 0x181 0x1 0xd135 0x98 +phy raw c45 0x181 0x1 0xd136 0x0 +phy raw c45 0x181 0x1 0xffde 4 +phy raw c45 0x181 0x1 0xd134 0x1f0 +phy raw c45 0x181 0x1 0xd135 0x98 +phy raw c45 0x181 0x1 0xd136 0x0 +phy raw c45 0x181 0x1 0xffde 5 +phy raw c45 0x181 0x1 0xd134 0x1f0 +phy raw c45 0x181 0x1 0xd135 0x98 +phy raw c45 0x181 0x1 0xd136 0x0 +phy raw c45 0x181 0x1 0xffde 6 +phy raw c45 0x181 0x1 0xd134 0x1f0 +phy raw c45 0x181 0x1 0xd135 0x98 +phy raw c45 0x181 0x1 0xd136 0x0 +phy raw c45 0x181 0x1 0xffde 7 +phy raw c45 0x181 0x1 0xd134 0x1f0 +phy raw c45 0x181 0x1 0xd135 0x98 +phy raw c45 0x181 0x1 0xd136 0x0 + +phy raw c45 0x89 0x1 0xffde 0 +phy raw c45 0x89 0x1 0xd134 0x1f0 +phy raw c45 0x89 0x1 0xd135 0x98 +phy raw c45 0x89 0x1 0xd136 0x0 +phy raw c45 0x89 0x1 0xffde 1 +phy raw c45 0x89 0x1 0xd134 0x1f0 +phy raw c45 0x89 0x1 0xd135 0x98 +phy raw c45 0x89 0x1 0xd136 0x0 +phy raw c45 0x89 0x1 0xffde 2 +phy raw c45 0x89 0x1 0xd134 0x1f0 +phy raw c45 0x89 0x1 0xd135 0x98 +phy raw c45 0x89 0x1 0xd136 0x0 +phy raw c45 0x89 0x1 0xffde 3 +phy raw c45 0x89 0x1 0xd134 0x1f0 +phy raw c45 0x89 0x1 0xd135 0x98 +phy raw c45 0x89 0x1 0xd136 0x0 +phy raw c45 0x89 0x1 0xffde 4 +phy raw c45 0x89 0x1 0xd134 0x1f0 +phy raw c45 0x89 0x1 0xd135 0x98 +phy raw c45 0x89 0x1 0xd136 0x0 +phy raw c45 0x89 0x1 0xffde 5 +phy raw c45 0x89 0x1 0xd134 0x1f0 +phy raw c45 0x89 0x1 0xd135 0x98 +phy raw c45 0x89 0x1 0xd136 0x0 +phy raw c45 0x89 0x1 0xffde 6 +phy raw c45 0x89 0x1 0xd134 0x1f0 +phy raw c45 0x89 0x1 0xd135 0x98 +phy raw c45 0x89 0x1 0xd136 0x0 +phy raw c45 0x89 0x1 0xffde 7 +phy raw c45 0x89 0x1 0xd134 0x1f0 +phy raw c45 0x89 0x1 0xd135 0x98 +phy raw c45 0x89 0x1 0xd136 0x0 + +phy raw c45 0xb1 0x1 0xffde 0 +phy raw c45 0xb1 0x1 0xd134 0x1f0 +phy raw c45 0xb1 0x1 0xd135 0x98 +phy raw c45 0xb1 0x1 0xd136 0x0 +phy raw c45 0xb1 0x1 0xffde 1 +phy raw c45 0xb1 0x1 0xd134 0x1f0 +phy raw c45 0xb1 0x1 0xd135 0x98 +phy raw c45 0xb1 0x1 0xd136 0x0 +phy raw c45 0xb1 0x1 0xffde 2 +phy raw c45 0xb1 0x1 0xd134 0x1f0 +phy raw c45 0xb1 0x1 0xd135 0x98 +phy raw c45 0xb1 0x1 0xd136 0x0 +phy raw c45 0xb1 0x1 0xffde 3 +phy raw c45 0xb1 0x1 0xd134 0x1f0 +phy raw c45 0xb1 0x1 0xd135 0x98 +phy raw c45 0xb1 0x1 0xd136 0x0 +phy raw c45 0xb1 0x1 0xffde 4 +phy raw c45 0xb1 0x1 0xd134 0x1f0 +phy raw c45 0xb1 0x1 0xd135 0x98 +phy raw c45 0xb1 0x1 0xd136 0x0 +phy raw c45 0xb1 0x1 0xffde 5 +phy raw c45 0xb1 0x1 0xd134 0x1f0 +phy raw c45 0xb1 0x1 0xd135 0x98 +phy raw c45 0xb1 0x1 0xd136 0x0 +phy raw c45 0xb1 0x1 0xffde 6 +phy raw c45 0xb1 0x1 0xd134 0x1f0 +phy raw c45 0xb1 0x1 0xd135 0x98 +phy raw c45 0xb1 0x1 0xd136 0x0 +phy raw c45 0xb1 0x1 0xffde 7 +phy raw c45 0xb1 0x1 0xd134 0x1f0 +phy raw c45 0xb1 0x1 0xd135 0x98 +phy raw c45 0xb1 0x1 0xd136 0x0 + +phy raw c45 0x191 0x1 0xffde 0 +phy raw c45 0x191 0x1 0xd134 0x1f0 +phy raw c45 0x191 0x1 0xd135 0x98 +phy raw c45 0x191 0x1 0xd136 0x0 +phy raw c45 0x191 0x1 0xffde 1 +phy raw c45 0x191 0x1 0xd134 0x1f0 +phy raw c45 0x191 0x1 0xd135 0x98 +phy raw c45 0x191 0x1 0xd136 0x0 +phy raw c45 0x191 0x1 0xffde 2 +phy raw c45 0x191 0x1 0xd134 0x1f0 +phy raw c45 0x191 0x1 0xd135 0x98 +phy raw c45 0x191 0x1 0xd136 0x0 +phy raw c45 0x191 0x1 0xffde 3 +phy raw c45 0x191 0x1 0xd134 0x1f0 +phy raw c45 0x191 0x1 0xd135 0x98 +phy raw c45 0x191 0x1 0xd136 0x0 +phy raw c45 0x191 0x1 0xffde 4 +phy raw c45 0x191 0x1 0xd134 0x1f0 +phy raw c45 0x191 0x1 0xd135 0x98 +phy raw c45 0x191 0x1 0xd136 0x0 +phy raw c45 0x191 0x1 0xffde 5 +phy raw c45 0x191 0x1 0xd134 0x1f0 +phy raw c45 0x191 0x1 0xd135 0x98 +phy raw c45 0x191 0x1 0xd136 0x0 +phy raw c45 0x191 0x1 0xffde 6 +phy raw c45 0x191 0x1 0xd134 0x1f0 +phy raw c45 0x191 0x1 0xd135 0x98 +phy raw c45 0x191 0x1 0xd136 0x0 +phy raw c45 0x191 0x1 0xffde 7 +phy raw c45 0x191 0x1 0xd134 0x1f0 +phy raw c45 0x191 0x1 0xd135 0x98 +phy raw c45 0x191 0x1 0xd136 0x0 + +phy raw c45 0x189 0x1 0xffde 0 +phy raw c45 0x189 0x1 0xd134 0x1f0 +phy raw c45 0x189 0x1 0xd135 0x98 +phy raw c45 0x189 0x1 0xd136 0x0 +phy raw c45 0x189 0x1 0xffde 1 +phy raw c45 0x189 0x1 0xd134 0x1f0 +phy raw c45 0x189 0x1 0xd135 0x98 +phy raw c45 0x189 0x1 0xd136 0x0 +phy raw c45 0x189 0x1 0xffde 2 +phy raw c45 0x189 0x1 0xd134 0x1f0 +phy raw c45 0x189 0x1 0xd135 0x98 +phy raw c45 0x189 0x1 0xd136 0x0 +phy raw c45 0x189 0x1 0xffde 3 +phy raw c45 0x189 0x1 0xd134 0x1f0 +phy raw c45 0x189 0x1 0xd135 0x98 +phy raw c45 0x189 0x1 0xd136 0x0 +phy raw c45 0x189 0x1 0xffde 4 +phy raw c45 0x189 0x1 0xd134 0x1f0 +phy raw c45 0x189 0x1 0xd135 0x98 +phy raw c45 0x189 0x1 0xd136 0x0 +phy raw c45 0x189 0x1 0xffde 5 +phy raw c45 0x189 0x1 0xd134 0x1f0 +phy raw c45 0x189 0x1 0xd135 0x98 +phy raw c45 0x189 0x1 0xd136 0x0 +phy raw c45 0x189 0x1 0xffde 6 +phy raw c45 0x189 0x1 0xd134 0x1f0 +phy raw c45 0x189 0x1 0xd135 0x98 +phy raw c45 0x189 0x1 0xd136 0x0 +phy raw c45 0x189 0x1 0xffde 7 +phy raw c45 0x189 0x1 0xd134 0x1f0 +phy raw c45 0x189 0x1 0xd135 0x98 +phy raw c45 0x189 0x1 0xd136 0x0 + +phy raw c45 0x1a1 0x1 0xffde 0 +phy raw c45 0x1a1 0x1 0xd134 0x1f0 +phy raw c45 0x1a1 0x1 0xd135 0x98 +phy raw c45 0x1a1 0x1 0xd136 0x0 +phy raw c45 0x1a1 0x1 0xffde 1 +phy raw c45 0x1a1 0x1 0xd134 0x1f0 +phy raw c45 0x1a1 0x1 0xd135 0x98 +phy raw c45 0x1a1 0x1 0xd136 0x0 +phy raw c45 0x1a1 0x1 0xffde 2 +phy raw c45 0x1a1 0x1 0xd134 0x1f0 +phy raw c45 0x1a1 0x1 0xd135 0x98 +phy raw c45 0x1a1 0x1 0xd136 0x0 +phy raw c45 0x1a1 0x1 0xffde 3 +phy raw c45 0x1a1 0x1 0xd134 0x1f0 +phy raw c45 0x1a1 0x1 0xd135 0x98 +phy raw c45 0x1a1 0x1 0xd136 0x0 +phy raw c45 0x1a1 0x1 0xffde 4 +phy raw c45 0x1a1 0x1 0xd134 0x1f0 +phy raw c45 0x1a1 0x1 0xd135 0x98 +phy raw c45 0x1a1 0x1 0xd136 0x0 +phy raw c45 0x1a1 0x1 0xffde 5 +phy raw c45 0x1a1 0x1 0xd134 0x1f0 +phy raw c45 0x1a1 0x1 0xd135 0x98 +phy raw c45 0x1a1 0x1 0xd136 0x0 +phy raw c45 0x1a1 0x1 0xffde 6 +phy raw c45 0x1a1 0x1 0xd134 0x1f0 +phy raw c45 0x1a1 0x1 0xd135 0x98 +phy raw c45 0x1a1 0x1 0xd136 0x0 +phy raw c45 0x1a1 0x1 0xffde 7 +phy raw c45 0x1a1 0x1 0xd134 0x1f0 +phy raw c45 0x1a1 0x1 0xd135 0x98 +phy raw c45 0x1a1 0x1 0xd136 0x0 + +phy raw c45 0x81 0x1 0xffde 0 +phy raw c45 0x81 0x1 0xd134 0x1f0 +phy raw c45 0x81 0x1 0xd135 0x98 +phy raw c45 0x81 0x1 0xd136 0x0 +phy raw c45 0x81 0x1 0xffde 1 +phy raw c45 0x81 0x1 0xd134 0x1f0 +phy raw c45 0x81 0x1 0xd135 0x98 +phy raw c45 0x81 0x1 0xd136 0x0 +phy raw c45 0x81 0x1 0xffde 2 +phy raw c45 0x81 0x1 0xd134 0x1f0 +phy raw c45 0x81 0x1 0xd135 0x98 +phy raw c45 0x81 0x1 0xd136 0x0 +phy raw c45 0x81 0x1 0xffde 3 +phy raw c45 0x81 0x1 0xd134 0x1f0 +phy raw c45 0x81 0x1 0xd135 0x98 +phy raw c45 0x81 0x1 0xd136 0x0 +phy raw c45 0x81 0x1 0xffde 4 +phy raw c45 0x81 0x1 0xd134 0x1f0 +phy raw c45 0x81 0x1 0xd135 0x98 +phy raw c45 0x81 0x1 0xd136 0x0 +phy raw c45 0x81 0x1 0xffde 5 +phy raw c45 0x81 0x1 0xd134 0x1f0 +phy raw c45 0x81 0x1 0xd135 0x98 +phy raw c45 0x81 0x1 0xd136 0x0 +phy raw c45 0x81 0x1 0xffde 6 +phy raw c45 0x81 0x1 0xd134 0x1f0 +phy raw c45 0x81 0x1 0xd135 0x98 +phy raw c45 0x81 0x1 0xd136 0x0 +phy raw c45 0x81 0x1 0xffde 7 +phy raw c45 0x81 0x1 0xd134 0x1f0 +phy raw c45 0x81 0x1 0xd135 0x98 +phy raw c45 0x81 0x1 0xd136 0x0 + +phy raw c45 0x1b1 0x1 0xffde 0 +phy raw c45 0x1b1 0x1 0xd134 0x1f0 +phy raw c45 0x1b1 0x1 0xd135 0x98 +phy raw c45 0x1b1 0x1 0xd136 0x0 +phy raw c45 0x1b1 0x1 0xffde 1 +phy raw c45 0x1b1 0x1 0xd134 0x1f0 +phy raw c45 0x1b1 0x1 0xd135 0x98 +phy raw c45 0x1b1 0x1 0xd136 0x0 +phy raw c45 0x1b1 0x1 0xffde 2 +phy raw c45 0x1b1 0x1 0xd134 0x1f0 +phy raw c45 0x1b1 0x1 0xd135 0x98 +phy raw c45 0x1b1 0x1 0xd136 0x0 +phy raw c45 0x1b1 0x1 0xffde 3 +phy raw c45 0x1b1 0x1 0xd134 0x1f0 +phy raw c45 0x1b1 0x1 0xd135 0x98 +phy raw c45 0x1b1 0x1 0xd136 0x0 +phy raw c45 0x1b1 0x1 0xffde 4 +phy raw c45 0x1b1 0x1 0xd134 0x1f0 +phy raw c45 0x1b1 0x1 0xd135 0x98 +phy raw c45 0x1b1 0x1 0xd136 0x0 +phy raw c45 0x1b1 0x1 0xffde 5 +phy raw c45 0x1b1 0x1 0xd134 0x1f0 +phy raw c45 0x1b1 0x1 0xd135 0x98 +phy raw c45 0x1b1 0x1 0xd136 0x0 +phy raw c45 0x1b1 0x1 0xffde 6 +phy raw c45 0x1b1 0x1 0xd134 0x1f0 +phy raw c45 0x1b1 0x1 0xd135 0x98 +phy raw c45 0x1b1 0x1 0xd136 0x0 +phy raw c45 0x1b1 0x1 0xffde 7 +phy raw c45 0x1b1 0x1 0xd134 0x1f0 +phy raw c45 0x1b1 0x1 0xd135 0x98 +phy raw c45 0x1b1 0x1 0xd136 0x0 + +phy raw c45 0x1a9 0x1 0xffde 0 +phy raw c45 0x1a9 0x1 0xd134 0x1f0 +phy raw c45 0x1a9 0x1 0xd135 0x98 +phy raw c45 0x1a9 0x1 0xd136 0x0 +phy raw c45 0x1a9 0x1 0xffde 1 +phy raw c45 0x1a9 0x1 0xd134 0x1f0 +phy raw c45 0x1a9 0x1 0xd135 0x98 +phy raw c45 0x1a9 0x1 0xd136 0x0 +phy raw c45 0x1a9 0x1 0xffde 2 +phy raw c45 0x1a9 0x1 0xd134 0x1f0 +phy raw c45 0x1a9 0x1 0xd135 0x98 +phy raw c45 0x1a9 0x1 0xd136 0x0 +phy raw c45 0x1a9 0x1 0xffde 3 +phy raw c45 0x1a9 0x1 0xd134 0x1f0 +phy raw c45 0x1a9 0x1 0xd135 0x98 +phy raw c45 0x1a9 0x1 0xd136 0x0 +phy raw c45 0x1a9 0x1 0xffde 4 +phy raw c45 0x1a9 0x1 0xd134 0x1f0 +phy raw c45 0x1a9 0x1 0xd135 0x98 +phy raw c45 0x1a9 0x1 0xd136 0x0 +phy raw c45 0x1a9 0x1 0xffde 5 +phy raw c45 0x1a9 0x1 0xd134 0x1f0 +phy raw c45 0x1a9 0x1 0xd135 0x98 +phy raw c45 0x1a9 0x1 0xd136 0x0 +phy raw c45 0x1a9 0x1 0xffde 6 +phy raw c45 0x1a9 0x1 0xd134 0x1f0 +phy raw c45 0x1a9 0x1 0xd135 0x98 +phy raw c45 0x1a9 0x1 0xd136 0x0 +phy raw c45 0x1a9 0x1 0xffde 7 +phy raw c45 0x1a9 0x1 0xd134 0x1f0 +phy raw c45 0x1a9 0x1 0xd135 0x98 +phy raw c45 0x1a9 0x1 0xd136 0x0 + +phy raw c45 0x2c1 0x1 0xffde 0 +phy raw c45 0x2c1 0x1 0xd134 0x1f0 +phy raw c45 0x2c1 0x1 0xd135 0x98 +phy raw c45 0x2c1 0x1 0xd136 0x0 +phy raw c45 0x2c1 0x1 0xffde 1 +phy raw c45 0x2c1 0x1 0xd134 0x1f0 +phy raw c45 0x2c1 0x1 0xd135 0x98 +phy raw c45 0x2c1 0x1 0xd136 0x0 +phy raw c45 0x2c1 0x1 0xffde 2 +phy raw c45 0x2c1 0x1 0xd134 0x1f0 +phy raw c45 0x2c1 0x1 0xd135 0x98 +phy raw c45 0x2c1 0x1 0xd136 0x0 +phy raw c45 0x2c1 0x1 0xffde 3 +phy raw c45 0x2c1 0x1 0xd134 0x1f0 +phy raw c45 0x2c1 0x1 0xd135 0x98 +phy raw c45 0x2c1 0x1 0xd136 0x0 +phy raw c45 0x2c1 0x1 0xffde 4 +phy raw c45 0x2c1 0x1 0xd134 0x1f0 +phy raw c45 0x2c1 0x1 0xd135 0x98 +phy raw c45 0x2c1 0x1 0xd136 0x0 +phy raw c45 0x2c1 0x1 0xffde 5 +phy raw c45 0x2c1 0x1 0xd134 0x1f0 +phy raw c45 0x2c1 0x1 0xd135 0x98 +phy raw c45 0x2c1 0x1 0xd136 0x0 +phy raw c45 0x2c1 0x1 0xffde 6 +phy raw c45 0x2c1 0x1 0xd134 0x1f0 +phy raw c45 0x2c1 0x1 0xd135 0x98 +phy raw c45 0x2c1 0x1 0xd136 0x0 +phy raw c45 0x2c1 0x1 0xffde 7 +phy raw c45 0x2c1 0x1 0xd134 0x1f0 +phy raw c45 0x2c1 0x1 0xd135 0x98 +phy raw c45 0x2c1 0x1 0xd136 0x0 + +phy raw c45 0x2c9 0x1 0xffde 0 +phy raw c45 0x2c9 0x1 0xd134 0x1f0 +phy raw c45 0x2c9 0x1 0xd135 0x98 +phy raw c45 0x2c9 0x1 0xd136 0x0 +phy raw c45 0x2c9 0x1 0xffde 1 +phy raw c45 0x2c9 0x1 0xd134 0x1f0 +phy raw c45 0x2c9 0x1 0xd135 0x98 +phy raw c45 0x2c9 0x1 0xd136 0x0 +phy raw c45 0x2c9 0x1 0xffde 2 +phy raw c45 0x2c9 0x1 0xd134 0x1f0 +phy raw c45 0x2c9 0x1 0xd135 0x98 +phy raw c45 0x2c9 0x1 0xd136 0x0 +phy raw c45 0x2c9 0x1 0xffde 3 +phy raw c45 0x2c9 0x1 0xd134 0x1f0 +phy raw c45 0x2c9 0x1 0xd135 0x98 +phy raw c45 0x2c9 0x1 0xd136 0x0 +phy raw c45 0x2c9 0x1 0xffde 4 +phy raw c45 0x2c9 0x1 0xd134 0x1f0 +phy raw c45 0x2c9 0x1 0xd135 0x98 +phy raw c45 0x2c9 0x1 0xd136 0x0 +phy raw c45 0x2c9 0x1 0xffde 5 +phy raw c45 0x2c9 0x1 0xd134 0x1f0 +phy raw c45 0x2c9 0x1 0xd135 0x98 +phy raw c45 0x2c9 0x1 0xd136 0x0 +phy raw c45 0x2c9 0x1 0xffde 6 +phy raw c45 0x2c9 0x1 0xd134 0x1f0 +phy raw c45 0x2c9 0x1 0xd135 0x98 +phy raw c45 0x2c9 0x1 0xd136 0x0 +phy raw c45 0x2c9 0x1 0xffde 7 +phy raw c45 0x2c9 0x1 0xd134 0x1f0 +phy raw c45 0x2c9 0x1 0xd135 0x98 +phy raw c45 0x2c9 0x1 0xd136 0x0 + +phy raw c45 0x2a9 0x1 0xffde 0 +phy raw c45 0x2a9 0x1 0xd134 0x1f0 +phy raw c45 0x2a9 0x1 0xd135 0x98 +phy raw c45 0x2a9 0x1 0xd136 0x0 +phy raw c45 0x2a9 0x1 0xffde 1 +phy raw c45 0x2a9 0x1 0xd134 0x1f0 +phy raw c45 0x2a9 0x1 0xd135 0x98 +phy raw c45 0x2a9 0x1 0xd136 0x0 +phy raw c45 0x2a9 0x1 0xffde 2 +phy raw c45 0x2a9 0x1 0xd134 0x1f0 +phy raw c45 0x2a9 0x1 0xd135 0x98 +phy raw c45 0x2a9 0x1 0xd136 0x0 +phy raw c45 0x2a9 0x1 0xffde 3 +phy raw c45 0x2a9 0x1 0xd134 0x1f0 +phy raw c45 0x2a9 0x1 0xd135 0x98 +phy raw c45 0x2a9 0x1 0xd136 0x0 +phy raw c45 0x2a9 0x1 0xffde 4 +phy raw c45 0x2a9 0x1 0xd134 0x1f0 +phy raw c45 0x2a9 0x1 0xd135 0x98 +phy raw c45 0x2a9 0x1 0xd136 0x0 +phy raw c45 0x2a9 0x1 0xffde 5 +phy raw c45 0x2a9 0x1 0xd134 0x1f0 +phy raw c45 0x2a9 0x1 0xd135 0x98 +phy raw c45 0x2a9 0x1 0xd136 0x0 +phy raw c45 0x2a9 0x1 0xffde 6 +phy raw c45 0x2a9 0x1 0xd134 0x1f0 +phy raw c45 0x2a9 0x1 0xd135 0x98 +phy raw c45 0x2a9 0x1 0xd136 0x0 +phy raw c45 0x2a9 0x1 0xffde 7 +phy raw c45 0x2a9 0x1 0xd134 0x1f0 +phy raw c45 0x2a9 0x1 0xd135 0x98 +phy raw c45 0x2a9 0x1 0xd136 0x0 + +phy raw c45 0x1c1 0x1 0xffde 0 +phy raw c45 0x1c1 0x1 0xd134 0x1f0 +phy raw c45 0x1c1 0x1 0xd135 0x98 +phy raw c45 0x1c1 0x1 0xd136 0x0 +phy raw c45 0x1c1 0x1 0xffde 1 +phy raw c45 0x1c1 0x1 0xd134 0x1f0 +phy raw c45 0x1c1 0x1 0xd135 0x98 +phy raw c45 0x1c1 0x1 0xd136 0x0 +phy raw c45 0x1c1 0x1 0xffde 2 +phy raw c45 0x1c1 0x1 0xd134 0x1f0 +phy raw c45 0x1c1 0x1 0xd135 0x98 +phy raw c45 0x1c1 0x1 0xd136 0x0 +phy raw c45 0x1c1 0x1 0xffde 3 +phy raw c45 0x1c1 0x1 0xd134 0x1f0 +phy raw c45 0x1c1 0x1 0xd135 0x98 +phy raw c45 0x1c1 0x1 0xd136 0x0 +phy raw c45 0x1c1 0x1 0xffde 4 +phy raw c45 0x1c1 0x1 0xd134 0x1f0 +phy raw c45 0x1c1 0x1 0xd135 0x98 +phy raw c45 0x1c1 0x1 0xd136 0x0 +phy raw c45 0x1c1 0x1 0xffde 5 +phy raw c45 0x1c1 0x1 0xd134 0x1f0 +phy raw c45 0x1c1 0x1 0xd135 0x98 +phy raw c45 0x1c1 0x1 0xd136 0x0 +phy raw c45 0x1c1 0x1 0xffde 6 +phy raw c45 0x1c1 0x1 0xd134 0x1f0 +phy raw c45 0x1c1 0x1 0xd135 0x98 +phy raw c45 0x1c1 0x1 0xd136 0x0 +phy raw c45 0x1c1 0x1 0xffde 7 +phy raw c45 0x1c1 0x1 0xd134 0x1f0 +phy raw c45 0x1c1 0x1 0xd135 0x98 +phy raw c45 0x1c1 0x1 0xd136 0x0 + +phy raw c45 0x1c9 0x1 0xffde 0 +phy raw c45 0x1c9 0x1 0xd134 0x1f0 +phy raw c45 0x1c9 0x1 0xd135 0x98 +phy raw c45 0x1c9 0x1 0xd136 0x0 +phy raw c45 0x1c9 0x1 0xffde 1 +phy raw c45 0x1c9 0x1 0xd134 0x1f0 +phy raw c45 0x1c9 0x1 0xd135 0x98 +phy raw c45 0x1c9 0x1 0xd136 0x0 +phy raw c45 0x1c9 0x1 0xffde 2 +phy raw c45 0x1c9 0x1 0xd134 0x1f0 +phy raw c45 0x1c9 0x1 0xd135 0x98 +phy raw c45 0x1c9 0x1 0xd136 0x0 +phy raw c45 0x1c9 0x1 0xffde 3 +phy raw c45 0x1c9 0x1 0xd134 0x1f0 +phy raw c45 0x1c9 0x1 0xd135 0x98 +phy raw c45 0x1c9 0x1 0xd136 0x0 +phy raw c45 0x1c9 0x1 0xffde 4 +phy raw c45 0x1c9 0x1 0xd134 0x1f0 +phy raw c45 0x1c9 0x1 0xd135 0x98 +phy raw c45 0x1c9 0x1 0xd136 0x0 +phy raw c45 0x1c9 0x1 0xffde 5 +phy raw c45 0x1c9 0x1 0xd134 0x1f0 +phy raw c45 0x1c9 0x1 0xd135 0x98 +phy raw c45 0x1c9 0x1 0xd136 0x0 +phy raw c45 0x1c9 0x1 0xffde 6 +phy raw c45 0x1c9 0x1 0xd134 0x1f0 +phy raw c45 0x1c9 0x1 0xd135 0x98 +phy raw c45 0x1c9 0x1 0xd136 0x0 +phy raw c45 0x1c9 0x1 0xffde 7 +phy raw c45 0x1c9 0x1 0xd134 0x1f0 +phy raw c45 0x1c9 0x1 0xd135 0x98 +phy raw c45 0x1c9 0x1 0xd136 0x0 + +phy raw c45 0x2b1 0x1 0xffde 0 +phy raw c45 0x2b1 0x1 0xd134 0x1f0 +phy raw c45 0x2b1 0x1 0xd135 0x98 +phy raw c45 0x2b1 0x1 0xd136 0x0 +phy raw c45 0x2b1 0x1 0xffde 1 +phy raw c45 0x2b1 0x1 0xd134 0x1f0 +phy raw c45 0x2b1 0x1 0xd135 0x98 +phy raw c45 0x2b1 0x1 0xd136 0x0 +phy raw c45 0x2b1 0x1 0xffde 2 +phy raw c45 0x2b1 0x1 0xd134 0x1f0 +phy raw c45 0x2b1 0x1 0xd135 0x98 +phy raw c45 0x2b1 0x1 0xd136 0x0 +phy raw c45 0x2b1 0x1 0xffde 3 +phy raw c45 0x2b1 0x1 0xd134 0x1f0 +phy raw c45 0x2b1 0x1 0xd135 0x98 +phy raw c45 0x2b1 0x1 0xd136 0x0 +phy raw c45 0x2b1 0x1 0xffde 4 +phy raw c45 0x2b1 0x1 0xd134 0x1f0 +phy raw c45 0x2b1 0x1 0xd135 0x98 +phy raw c45 0x2b1 0x1 0xd136 0x0 +phy raw c45 0x2b1 0x1 0xffde 5 +phy raw c45 0x2b1 0x1 0xd134 0x1f0 +phy raw c45 0x2b1 0x1 0xd135 0x98 +phy raw c45 0x2b1 0x1 0xd136 0x0 +phy raw c45 0x2b1 0x1 0xffde 6 +phy raw c45 0x2b1 0x1 0xd134 0x1f0 +phy raw c45 0x2b1 0x1 0xd135 0x98 +phy raw c45 0x2b1 0x1 0xd136 0x0 +phy raw c45 0x2b1 0x1 0xffde 7 +phy raw c45 0x2b1 0x1 0xd134 0x1f0 +phy raw c45 0x2b1 0x1 0xd135 0x98 +phy raw c45 0x2b1 0x1 0xd136 0x0 + +phy raw c45 0x1d1 0x1 0xffde 0 +phy raw c45 0x1d1 0x1 0xd134 0x1f0 +phy raw c45 0x1d1 0x1 0xd135 0x98 +phy raw c45 0x1d1 0x1 0xd136 0x0 +phy raw c45 0x1d1 0x1 0xffde 1 +phy raw c45 0x1d1 0x1 0xd134 0x1f0 +phy raw c45 0x1d1 0x1 0xd135 0x98 +phy raw c45 0x1d1 0x1 0xd136 0x0 +phy raw c45 0x1d1 0x1 0xffde 2 +phy raw c45 0x1d1 0x1 0xd134 0x1f0 +phy raw c45 0x1d1 0x1 0xd135 0x98 +phy raw c45 0x1d1 0x1 0xd136 0x0 +phy raw c45 0x1d1 0x1 0xffde 3 +phy raw c45 0x1d1 0x1 0xd134 0x1f0 +phy raw c45 0x1d1 0x1 0xd135 0x98 +phy raw c45 0x1d1 0x1 0xd136 0x0 +phy raw c45 0x1d1 0x1 0xffde 4 +phy raw c45 0x1d1 0x1 0xd134 0x1f0 +phy raw c45 0x1d1 0x1 0xd135 0x98 +phy raw c45 0x1d1 0x1 0xd136 0x0 +phy raw c45 0x1d1 0x1 0xffde 5 +phy raw c45 0x1d1 0x1 0xd134 0x1f0 +phy raw c45 0x1d1 0x1 0xd135 0x98 +phy raw c45 0x1d1 0x1 0xd136 0x0 +phy raw c45 0x1d1 0x1 0xffde 6 +phy raw c45 0x1d1 0x1 0xd134 0x1f0 +phy raw c45 0x1d1 0x1 0xd135 0x98 +phy raw c45 0x1d1 0x1 0xd136 0x0 +phy raw c45 0x1d1 0x1 0xffde 7 +phy raw c45 0x1d1 0x1 0xd134 0x1f0 +phy raw c45 0x1d1 0x1 0xd135 0x98 +phy raw c45 0x1d1 0x1 0xd136 0x0 + +phy raw c45 0x1e1 0x1 0xffde 0 +phy raw c45 0x1e1 0x1 0xd134 0x1f0 +phy raw c45 0x1e1 0x1 0xd135 0x98 +phy raw c45 0x1e1 0x1 0xd136 0x0 +phy raw c45 0x1e1 0x1 0xffde 1 +phy raw c45 0x1e1 0x1 0xd134 0x1f0 +phy raw c45 0x1e1 0x1 0xd135 0x98 +phy raw c45 0x1e1 0x1 0xd136 0x0 +phy raw c45 0x1e1 0x1 0xffde 2 +phy raw c45 0x1e1 0x1 0xd134 0x1f0 +phy raw c45 0x1e1 0x1 0xd135 0x98 +phy raw c45 0x1e1 0x1 0xd136 0x0 +phy raw c45 0x1e1 0x1 0xffde 3 +phy raw c45 0x1e1 0x1 0xd134 0x1f0 +phy raw c45 0x1e1 0x1 0xd135 0x98 +phy raw c45 0x1e1 0x1 0xd136 0x0 +phy raw c45 0x1e1 0x1 0xffde 4 +phy raw c45 0x1e1 0x1 0xd134 0x1f0 +phy raw c45 0x1e1 0x1 0xd135 0x98 +phy raw c45 0x1e1 0x1 0xd136 0x0 +phy raw c45 0x1e1 0x1 0xffde 5 +phy raw c45 0x1e1 0x1 0xd134 0x1f0 +phy raw c45 0x1e1 0x1 0xd135 0x98 +phy raw c45 0x1e1 0x1 0xd136 0x0 +phy raw c45 0x1e1 0x1 0xffde 6 +phy raw c45 0x1e1 0x1 0xd134 0x1f0 +phy raw c45 0x1e1 0x1 0xd135 0x98 +phy raw c45 0x1e1 0x1 0xd136 0x0 +phy raw c45 0x1e1 0x1 0xffde 7 +phy raw c45 0x1e1 0x1 0xd134 0x1f0 +phy raw c45 0x1e1 0x1 0xd135 0x98 +phy raw c45 0x1e1 0x1 0xd136 0x0 + +phy raw c45 0x1e9 0x1 0xffde 0 +phy raw c45 0x1e9 0x1 0xd134 0x1f0 +phy raw c45 0x1e9 0x1 0xd135 0x98 +phy raw c45 0x1e9 0x1 0xd136 0x0 +phy raw c45 0x1e9 0x1 0xffde 1 +phy raw c45 0x1e9 0x1 0xd134 0x1f0 +phy raw c45 0x1e9 0x1 0xd135 0x98 +phy raw c45 0x1e9 0x1 0xd136 0x0 +phy raw c45 0x1e9 0x1 0xffde 2 +phy raw c45 0x1e9 0x1 0xd134 0x1f0 +phy raw c45 0x1e9 0x1 0xd135 0x98 +phy raw c45 0x1e9 0x1 0xd136 0x0 +phy raw c45 0x1e9 0x1 0xffde 3 +phy raw c45 0x1e9 0x1 0xd134 0x1f0 +phy raw c45 0x1e9 0x1 0xd135 0x98 +phy raw c45 0x1e9 0x1 0xd136 0x0 +phy raw c45 0x1e9 0x1 0xffde 4 +phy raw c45 0x1e9 0x1 0xd134 0x1f0 +phy raw c45 0x1e9 0x1 0xd135 0x98 +phy raw c45 0x1e9 0x1 0xd136 0x0 +phy raw c45 0x1e9 0x1 0xffde 5 +phy raw c45 0x1e9 0x1 0xd134 0x1f0 +phy raw c45 0x1e9 0x1 0xd135 0x98 +phy raw c45 0x1e9 0x1 0xd136 0x0 +phy raw c45 0x1e9 0x1 0xffde 6 +phy raw c45 0x1e9 0x1 0xd134 0x1f0 +phy raw c45 0x1e9 0x1 0xd135 0x98 +phy raw c45 0x1e9 0x1 0xd136 0x0 +phy raw c45 0x1e9 0x1 0xffde 7 +phy raw c45 0x1e9 0x1 0xd134 0x1f0 +phy raw c45 0x1e9 0x1 0xd135 0x98 +phy raw c45 0x1e9 0x1 0xd136 0x0 + +phy raw c45 0x1f1 0x1 0xffde 0 +phy raw c45 0x1f1 0x1 0xd134 0x1f0 +phy raw c45 0x1f1 0x1 0xd135 0x98 +phy raw c45 0x1f1 0x1 0xd136 0x0 +phy raw c45 0x1f1 0x1 0xffde 1 +phy raw c45 0x1f1 0x1 0xd134 0x1f0 +phy raw c45 0x1f1 0x1 0xd135 0x98 +phy raw c45 0x1f1 0x1 0xd136 0x0 +phy raw c45 0x1f1 0x1 0xffde 2 +phy raw c45 0x1f1 0x1 0xd134 0x1f0 +phy raw c45 0x1f1 0x1 0xd135 0x98 +phy raw c45 0x1f1 0x1 0xd136 0x0 +phy raw c45 0x1f1 0x1 0xffde 3 +phy raw c45 0x1f1 0x1 0xd134 0x1f0 +phy raw c45 0x1f1 0x1 0xd135 0x98 +phy raw c45 0x1f1 0x1 0xd136 0x0 +phy raw c45 0x1f1 0x1 0xffde 4 +phy raw c45 0x1f1 0x1 0xd134 0x1f0 +phy raw c45 0x1f1 0x1 0xd135 0x98 +phy raw c45 0x1f1 0x1 0xd136 0x0 +phy raw c45 0x1f1 0x1 0xffde 5 +phy raw c45 0x1f1 0x1 0xd134 0x1f0 +phy raw c45 0x1f1 0x1 0xd135 0x98 +phy raw c45 0x1f1 0x1 0xd136 0x0 +phy raw c45 0x1f1 0x1 0xffde 6 +phy raw c45 0x1f1 0x1 0xd134 0x1f0 +phy raw c45 0x1f1 0x1 0xd135 0x98 +phy raw c45 0x1f1 0x1 0xd136 0x0 +phy raw c45 0x1f1 0x1 0xffde 7 +phy raw c45 0x1f1 0x1 0xd134 0x1f0 +phy raw c45 0x1f1 0x1 0xd135 0x98 +phy raw c45 0x1f1 0x1 0xd136 0x0 + +phy raw c45 0x281 0x1 0xffde 0 +phy raw c45 0x281 0x1 0xd134 0x1f0 +phy raw c45 0x281 0x1 0xd135 0x98 +phy raw c45 0x281 0x1 0xd136 0x0 +phy raw c45 0x281 0x1 0xffde 1 +phy raw c45 0x281 0x1 0xd134 0x1f0 +phy raw c45 0x281 0x1 0xd135 0x98 +phy raw c45 0x281 0x1 0xd136 0x0 +phy raw c45 0x281 0x1 0xffde 2 +phy raw c45 0x281 0x1 0xd134 0x1f0 +phy raw c45 0x281 0x1 0xd135 0x98 +phy raw c45 0x281 0x1 0xd136 0x0 +phy raw c45 0x281 0x1 0xffde 3 +phy raw c45 0x281 0x1 0xd134 0x1f0 +phy raw c45 0x281 0x1 0xd135 0x98 +phy raw c45 0x281 0x1 0xd136 0x0 +phy raw c45 0x281 0x1 0xffde 4 +phy raw c45 0x281 0x1 0xd134 0x1f0 +phy raw c45 0x281 0x1 0xd135 0x98 +phy raw c45 0x281 0x1 0xd136 0x0 +phy raw c45 0x281 0x1 0xffde 5 +phy raw c45 0x281 0x1 0xd134 0x1f0 +phy raw c45 0x281 0x1 0xd135 0x98 +phy raw c45 0x281 0x1 0xd136 0x0 +phy raw c45 0x281 0x1 0xffde 6 +phy raw c45 0x281 0x1 0xd134 0x1f0 +phy raw c45 0x281 0x1 0xd135 0x98 +phy raw c45 0x281 0x1 0xd136 0x0 +phy raw c45 0x281 0x1 0xffde 7 +phy raw c45 0x281 0x1 0xd134 0x1f0 +phy raw c45 0x281 0x1 0xd135 0x98 +phy raw c45 0x281 0x1 0xd136 0x0 + +phy raw c45 0x289 0x1 0xffde 0 +phy raw c45 0x289 0x1 0xd134 0x1f0 +phy raw c45 0x289 0x1 0xd135 0x98 +phy raw c45 0x289 0x1 0xd136 0x0 +phy raw c45 0x289 0x1 0xffde 1 +phy raw c45 0x289 0x1 0xd134 0x1f0 +phy raw c45 0x289 0x1 0xd135 0x98 +phy raw c45 0x289 0x1 0xd136 0x0 +phy raw c45 0x289 0x1 0xffde 2 +phy raw c45 0x289 0x1 0xd134 0x1f0 +phy raw c45 0x289 0x1 0xd135 0x98 +phy raw c45 0x289 0x1 0xd136 0x0 +phy raw c45 0x289 0x1 0xffde 3 +phy raw c45 0x289 0x1 0xd134 0x1f0 +phy raw c45 0x289 0x1 0xd135 0x98 +phy raw c45 0x289 0x1 0xd136 0x0 +phy raw c45 0x289 0x1 0xffde 4 +phy raw c45 0x289 0x1 0xd134 0x1f0 +phy raw c45 0x289 0x1 0xd135 0x98 +phy raw c45 0x289 0x1 0xd136 0x0 +phy raw c45 0x289 0x1 0xffde 5 +phy raw c45 0x289 0x1 0xd134 0x1f0 +phy raw c45 0x289 0x1 0xd135 0x98 +phy raw c45 0x289 0x1 0xd136 0x0 +phy raw c45 0x289 0x1 0xffde 6 +phy raw c45 0x289 0x1 0xd134 0x1f0 +phy raw c45 0x289 0x1 0xd135 0x98 +phy raw c45 0x289 0x1 0xd136 0x0 +phy raw c45 0x289 0x1 0xffde 7 +phy raw c45 0x289 0x1 0xd134 0x1f0 +phy raw c45 0x289 0x1 0xd135 0x98 +phy raw c45 0x289 0x1 0xd136 0x0 + +phy raw c45 0x291 0x1 0xffde 0 +phy raw c45 0x291 0x1 0xd134 0x1f0 +phy raw c45 0x291 0x1 0xd135 0x98 +phy raw c45 0x291 0x1 0xd136 0x0 +phy raw c45 0x291 0x1 0xffde 1 +phy raw c45 0x291 0x1 0xd134 0x1f0 +phy raw c45 0x291 0x1 0xd135 0x98 +phy raw c45 0x291 0x1 0xd136 0x0 +phy raw c45 0x291 0x1 0xffde 2 +phy raw c45 0x291 0x1 0xd134 0x1f0 +phy raw c45 0x291 0x1 0xd135 0x98 +phy raw c45 0x291 0x1 0xd136 0x0 +phy raw c45 0x291 0x1 0xffde 3 +phy raw c45 0x291 0x1 0xd134 0x1f0 +phy raw c45 0x291 0x1 0xd135 0x98 +phy raw c45 0x291 0x1 0xd136 0x0 +phy raw c45 0x291 0x1 0xffde 4 +phy raw c45 0x291 0x1 0xd134 0x1f0 +phy raw c45 0x291 0x1 0xd135 0x98 +phy raw c45 0x291 0x1 0xd136 0x0 +phy raw c45 0x291 0x1 0xffde 5 +phy raw c45 0x291 0x1 0xd134 0x1f0 +phy raw c45 0x291 0x1 0xd135 0x98 +phy raw c45 0x291 0x1 0xd136 0x0 +phy raw c45 0x291 0x1 0xffde 6 +phy raw c45 0x291 0x1 0xd134 0x1f0 +phy raw c45 0x291 0x1 0xd135 0x98 +phy raw c45 0x291 0x1 0xd136 0x0 +phy raw c45 0x291 0x1 0xffde 7 +phy raw c45 0x291 0x1 0xd134 0x1f0 +phy raw c45 0x291 0x1 0xd135 0x98 +phy raw c45 0x291 0x1 0xd136 0x0 + +phy raw c45 0x2a1 0x1 0xffde 0 +phy raw c45 0x2a1 0x1 0xd134 0x1f0 +phy raw c45 0x2a1 0x1 0xd135 0x98 +phy raw c45 0x2a1 0x1 0xd136 0x0 +phy raw c45 0x2a1 0x1 0xffde 1 +phy raw c45 0x2a1 0x1 0xd134 0x1f0 +phy raw c45 0x2a1 0x1 0xd135 0x98 +phy raw c45 0x2a1 0x1 0xd136 0x0 +phy raw c45 0x2a1 0x1 0xffde 2 +phy raw c45 0x2a1 0x1 0xd134 0x1f0 +phy raw c45 0x2a1 0x1 0xd135 0x98 +phy raw c45 0x2a1 0x1 0xd136 0x0 +phy raw c45 0x2a1 0x1 0xffde 3 +phy raw c45 0x2a1 0x1 0xd134 0x1f0 +phy raw c45 0x2a1 0x1 0xd135 0x98 +phy raw c45 0x2a1 0x1 0xd136 0x0 +phy raw c45 0x2a1 0x1 0xffde 4 +phy raw c45 0x2a1 0x1 0xd134 0x1f0 +phy raw c45 0x2a1 0x1 0xd135 0x98 +phy raw c45 0x2a1 0x1 0xd136 0x0 +phy raw c45 0x2a1 0x1 0xffde 5 +phy raw c45 0x2a1 0x1 0xd134 0x1f0 +phy raw c45 0x2a1 0x1 0xd135 0x98 +phy raw c45 0x2a1 0x1 0xd136 0x0 +phy raw c45 0x2a1 0x1 0xffde 6 +phy raw c45 0x2a1 0x1 0xd134 0x1f0 +phy raw c45 0x2a1 0x1 0xd135 0x98 +phy raw c45 0x2a1 0x1 0xd136 0x0 +phy raw c45 0x2a1 0x1 0xffde 7 +phy raw c45 0x2a1 0x1 0xd134 0x1f0 +phy raw c45 0x2a1 0x1 0xd135 0x98 +phy raw c45 0x2a1 0x1 0xd136 0x0 diff --git a/device/virtual/x86_64-kvm_x86_64-r0/pmon_daemon_control.json b/device/virtual/x86_64-kvm_x86_64-r0/pmon_daemon_control.json index 101db0ffea1a..35fd93caadcd 100644 --- a/device/virtual/x86_64-kvm_x86_64-r0/pmon_daemon_control.json +++ b/device/virtual/x86_64-kvm_x86_64-r0/pmon_daemon_control.json @@ -4,5 +4,6 @@ "skip_pcied": true, "skip_psud": true, "skip_syseepromd": true, - "skip_thermalctld": true + "skip_thermalctld": true, + "skip_ycabled": false } diff --git a/dockers/docker-base-buster/Dockerfile.j2 b/dockers/docker-base-buster/Dockerfile.j2 index 1f80775f11a4..77886ede4408 100644 --- a/dockers/docker-base-buster/Dockerfile.j2 +++ b/dockers/docker-base-buster/Dockerfile.j2 @@ -1,10 +1,11 @@ +{% set prefix = DEFAULT_CONTAINER_REGISTRY %} {% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %} -{% if CONFIGURED_ARCH == "armhf" %} -FROM multiarch/debian-debootstrap:armhf-buster -{% elif CONFIGURED_ARCH == "arm64" %} -FROM multiarch/debian-debootstrap:arm64-buster +{% if CONFIGURED_ARCH == "armhf" and MULTIARCH_QEMU_ENVIRON == "y" %} +FROM {{ prefix }}multiarch/debian-debootstrap:armhf-buster +{% elif CONFIGURED_ARCH == "arm64" and MULTIARCH_QEMU_ENVIRON == "y" %} +FROM {{ prefix }}multiarch/debian-debootstrap:arm64-buster {% else %} -FROM debian:buster +FROM {{ prefix }}{{DOCKER_BASE_ARCH}}/debian:buster {% endif %} # Clean documentation in FROM image @@ -26,13 +27,7 @@ ENV DEBIAN_FRONTEND=noninteractive # Configure data sources for apt/dpkg COPY ["dpkg_01_drop", "/etc/dpkg/dpkg.cfg.d/01_drop"] -{% if CONFIGURED_ARCH == "armhf" %} -COPY ["sources.list.armhf", "/etc/apt/sources.list"] -{% elif CONFIGURED_ARCH == "arm64" %} -COPY ["sources.list.arm64", "/etc/apt/sources.list"] -{% else %} -COPY ["sources.list", "/etc/apt/sources.list"] -{% endif %} +COPY ["sources.list.{{ CONFIGURED_ARCH }}", "/etc/apt/sources.list"] COPY ["no_install_recommend_suggest", "/etc/apt/apt.conf.d"] COPY ["no-check-valid-until", "/etc/apt/apt.conf.d"] @@ -120,7 +115,7 @@ RUN apt-get -y purge \ RUN apt-get clean -y && \ apt-get autoclean -y && \ apt-get autoremove -y && \ - rm -rf /var/lib/apt/lists/* /tmp/* + rm -rf /var/lib/apt/lists/* /tmp/* ~/.cache/ COPY ["etc/rsyslog.conf", "/etc/rsyslog.conf"] COPY ["etc/rsyslog.d/*", "/etc/rsyslog.d/"] diff --git a/dockers/docker-base-buster/etc/rsyslog.d/supervisor.conf b/dockers/docker-base-buster/etc/rsyslog.d/supervisor.conf index 7c7a64d7afe0..fde8d8a6c994 100644 --- a/dockers/docker-base-buster/etc/rsyslog.d/supervisor.conf +++ b/dockers/docker-base-buster/etc/rsyslog.d/supervisor.conf @@ -1,9 +1,9 @@ -$ModLoad imfile - -$InputFileName /var/log/supervisor/supervisord.log -$InputFileTag supervisord -$InputFileStateFile state-supervisor -$InputFileSeverity info -$InputFileFacility local0 -$InputFilePersistStateInterval 1 -$InputRunFileMonitor +module(load="imfile" mode="inotify") # Ensure "inotify" mode is used +$WorkDirectory /var/log/supervisor +# Start Monitoring the file +input(type="imfile" + File="/var/log/supervisor/supervisord.log" + Tag="supervisord" + Severity="info" + Facility="local0" + PersistStateInterval="1") diff --git a/dockers/docker-base-buster/sources.list b/dockers/docker-base-buster/sources.list deleted file mode 100644 index 0eef72d9fa2d..000000000000 --- a/dockers/docker-base-buster/sources.list +++ /dev/null @@ -1,13 +0,0 @@ -## Debian mirror on Microsoft Azure -## Ref: http://debian-archive.trafficmanager.net/ - -deb [arch=amd64] http://debian-archive.trafficmanager.net/debian/ buster main contrib non-free -deb-src [arch=amd64] http://debian-archive.trafficmanager.net/debian/ buster main contrib non-free -deb [arch=amd64] http://debian-archive.trafficmanager.net/debian-security/ buster/updates main contrib non-free -deb-src [arch=amd64] http://debian-archive.trafficmanager.net/debian-security/ buster/updates main contrib non-free -deb [arch=amd64] http://debian-archive.trafficmanager.net/debian/ buster-backports main contrib non-free - -# Debian mirror supports multiple versions for a package -deb [arch=amd64] http://packages.trafficmanager.net/debian/debian buster main contrib non-free -deb [arch=amd64] http://packages.trafficmanager.net/debian/debian buster-updates main contrib non-free -deb [arch=amd64] http://packages.trafficmanager.net/debian/debian buster-backports main contrib non-free diff --git a/dockers/docker-base-buster/sources.list.arm64 b/dockers/docker-base-buster/sources.list.arm64 deleted file mode 100644 index 6375734e99e6..000000000000 --- a/dockers/docker-base-buster/sources.list.arm64 +++ /dev/null @@ -1,11 +0,0 @@ -## Debian mirror for ARM repo - -# ARM repo -deb [arch=arm64] http://deb.debian.org/debian buster main contrib non-free -deb-src [arch=arm64] http://deb.debian.org/debian buster main contrib non-free -deb [arch=arm64] http://security.debian.org buster/updates main contrib non-free -deb-src [arch=arm64] http://security.debian.org buster/updates main contrib non-free -deb [arch=arm64] http://deb.debian.org/debian/ buster-backports main contrib non-free -deb [arch=arm64] http://packages.trafficmanager.net/debian/debian buster main contrib non-free -deb [arch=arm64] http://packages.trafficmanager.net/debian/debian buster-updates main contrib non-free -deb [arch=arm64] http://packages.trafficmanager.net/debian/debian buster-backports main contrib non-free diff --git a/dockers/docker-base-buster/sources.list.armhf b/dockers/docker-base-buster/sources.list.armhf deleted file mode 100644 index a03af1a33ac0..000000000000 --- a/dockers/docker-base-buster/sources.list.armhf +++ /dev/null @@ -1,11 +0,0 @@ -## Debian mirror for ARM repo - -# ARM repo -deb [arch=armhf] http://deb.debian.org/debian buster main contrib non-free -deb-src [arch=armhf] http://deb.debian.org/debian buster main contrib non-free -deb [arch=armhf] http://security.debian.org buster/updates main contrib non-free -deb-src [arch=armhf] http://security.debian.org buster/updates main contrib non-free -deb [arch=armhf] http://deb.debian.org/debian/ buster-backports main contrib non-free -deb [arch=armhf] http://packages.trafficmanager.net/debian/debian buster main contrib non-free -deb [arch=armhf] http://packages.trafficmanager.net/debian/debian buster-updates main contrib non-free -deb [arch=armhf] http://packages.trafficmanager.net/debian/debian buster-backports main contrib non-free diff --git a/dockers/docker-base-stretch/Dockerfile.j2 b/dockers/docker-base-stretch/Dockerfile.j2 index aa6eda8a955c..bfdd46275d5d 100644 --- a/dockers/docker-base-stretch/Dockerfile.j2 +++ b/dockers/docker-base-stretch/Dockerfile.j2 @@ -1,10 +1,11 @@ +{% set prefix = DEFAULT_CONTAINER_REGISTRY %} {% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %} -{% if CONFIGURED_ARCH == "armhf" %} -FROM multiarch/debian-debootstrap:armhf-stretch -{% elif CONFIGURED_ARCH == "arm64" %} -FROM multiarch/debian-debootstrap:arm64-stretch +{% if CONFIGURED_ARCH == "armhf" and MULTIARCH_QEMU_ENVIRON == "y" %} +FROM {{ prefix }}multiarch/debian-debootstrap:armhf-stretch +{% elif CONFIGURED_ARCH == "arm64" and MULTIARCH_QEMU_ENVIRON == "y" %} +FROM {{ prefix }}multiarch/debian-debootstrap:arm64-stretch {% else %} -FROM debian:stretch +FROM {{ prefix }}{{DOCKER_BASE_ARCH}}/debian:stretch {% endif %} # Clean documentation in FROM image @@ -26,13 +27,7 @@ ENV DEBIAN_FRONTEND=noninteractive # Configure data sources for apt/dpkg COPY ["dpkg_01_drop", "/etc/dpkg/dpkg.cfg.d/01_drop"] -{% if CONFIGURED_ARCH == "armhf" %} -COPY ["sources.list.armhf", "/etc/apt/sources.list"] -{% elif CONFIGURED_ARCH == "arm64" %} -COPY ["sources.list.arm64", "/etc/apt/sources.list"] -{% else %} -COPY ["sources.list", "/etc/apt/sources.list"] -{% endif %} +COPY ["sources.list.{{ CONFIGURED_ARCH }}", "/etc/apt/sources.list"] COPY ["no_install_recommend_suggest", "/etc/apt/apt.conf.d"] COPY ["no-check-valid-until", "/etc/apt/apt.conf.d"] @@ -93,7 +88,7 @@ RUN pip install j2cli RUN pip install supervisor>=3.4.0 # Add support for supervisord to handle startup dependencies -RUN pip install supervisord-dependent-startup==1.4.0 +RUN pip install supervisord-dependent-startup==1.4.0 toposort==1.7 RUN mkdir -p /etc/supervisor /var/log/supervisor diff --git a/dockers/docker-base-stretch/etc/rsyslog.d/supervisor.conf b/dockers/docker-base-stretch/etc/rsyslog.d/supervisor.conf index 7c7a64d7afe0..fde8d8a6c994 100644 --- a/dockers/docker-base-stretch/etc/rsyslog.d/supervisor.conf +++ b/dockers/docker-base-stretch/etc/rsyslog.d/supervisor.conf @@ -1,9 +1,9 @@ -$ModLoad imfile - -$InputFileName /var/log/supervisor/supervisord.log -$InputFileTag supervisord -$InputFileStateFile state-supervisor -$InputFileSeverity info -$InputFileFacility local0 -$InputFilePersistStateInterval 1 -$InputRunFileMonitor +module(load="imfile" mode="inotify") # Ensure "inotify" mode is used +$WorkDirectory /var/log/supervisor +# Start Monitoring the file +input(type="imfile" + File="/var/log/supervisor/supervisord.log" + Tag="supervisord" + Severity="info" + Facility="local0" + PersistStateInterval="1") diff --git a/dockers/docker-base-stretch/sources.list b/dockers/docker-base-stretch/sources.list deleted file mode 100644 index 0c29b339bb87..000000000000 --- a/dockers/docker-base-stretch/sources.list +++ /dev/null @@ -1,11 +0,0 @@ -## Debian mirror on Microsoft Azure -## Ref: http://debian-archive.trafficmanager.net/ - -deb [arch=amd64] http://debian-archive.trafficmanager.net/debian/ stretch main contrib non-free -deb-src [arch=amd64] http://debian-archive.trafficmanager.net/debian/ stretch main contrib non-free -deb [arch=amd64] http://debian-archive.trafficmanager.net/debian-security/ stretch/updates main contrib non-free -deb-src [arch=amd64] http://debian-archive.trafficmanager.net/debian-security/ stretch/updates main contrib non-free -deb [arch=amd64] http://debian-archive.trafficmanager.net/debian/ stretch-backports main contrib non-free -deb [arch=amd64] http://packages.trafficmanager.net/debian/debian stretch main contrib non-free -deb [arch=amd64] http://packages.trafficmanager.net/debian/debian stretch-updates main contrib non-free -deb [arch=amd64] http://packages.trafficmanager.net/debian/debian stretch-backports main contrib non-free diff --git a/dockers/docker-base-stretch/sources.list.arm64 b/dockers/docker-base-stretch/sources.list.arm64 deleted file mode 100644 index 520c46519919..000000000000 --- a/dockers/docker-base-stretch/sources.list.arm64 +++ /dev/null @@ -1,11 +0,0 @@ -## Debian mirror for ARM repo - -# ARM repo -deb [arch=arm64] http://deb.debian.org/debian stretch main contrib non-free -deb-src [arch=arm64] http://deb.debian.org/debian stretch main contrib non-free -deb [arch=arm64] http://security.debian.org stretch/updates main contrib non-free -deb-src [arch=arm64] http://security.debian.org stretch/updates main contrib non-free -deb [arch=arm64] http://deb.debian.org/debian/ stretch-backports main contrib non-free -deb [arch=arm64] http://packages.trafficmanager.net/debian/debian stretch main contrib non-free -deb [arch=arm64] http://packages.trafficmanager.net/debian/debian stretch-updates main contrib non-free -deb [arch=arm64] http://packages.trafficmanager.net/debian/debian stretch-backports main contrib non-free diff --git a/dockers/docker-base-stretch/sources.list.armhf b/dockers/docker-base-stretch/sources.list.armhf deleted file mode 100644 index 58077f310424..000000000000 --- a/dockers/docker-base-stretch/sources.list.armhf +++ /dev/null @@ -1,11 +0,0 @@ -## Debian mirror for ARM repo - -# ARM repo -deb [arch=armhf] http://deb.debian.org/debian stretch main contrib non-free -deb-src [arch=armhf] http://deb.debian.org/debian stretch main contrib non-free -deb [arch=armhf] http://security.debian.org stretch/updates main contrib non-free -deb-src [arch=armhf] http://security.debian.org stretch/updates main contrib non-free -deb [arch=armhf] http://deb.debian.org/debian/ stretch-backports main contrib non-free -deb [arch=armhf] http://packages.trafficmanager.net/debian/debian stretch main contrib non-free -deb [arch=armhf] http://packages.trafficmanager.net/debian/debian stretch-updates main contrib non-free -deb [arch=armhf] http://packages.trafficmanager.net/debian/debian stretch-backports main contrib non-free diff --git a/dockers/docker-base/Dockerfile.j2 b/dockers/docker-base/Dockerfile.j2 index fc293da9da1e..15df3fe8a754 100644 --- a/dockers/docker-base/Dockerfile.j2 +++ b/dockers/docker-base/Dockerfile.j2 @@ -1,9 +1,10 @@ -{% if CONFIGURED_ARCH == "armhf" %} -FROM multiarch/debian-debootstrap:armhf-jessie -{% elif CONFIGURED_ARCH == "arm64" %} -FROM multiarch/debian-debootstrap:arm64-jessie +{% set prefix = DEFAULT_CONTAINER_REGISTRY %} +{% if CONFIGURED_ARCH == "armhf" and MULTIARCH_QEMU_ENVIRON == "y" %} +FROM {{ prefix }}multiarch/debian-debootstrap:armhf-jessie +{% elif CONFIGURED_ARCH == "arm64" and MULTIARCH_QEMU_ENVIRON == "y" %} +FROM {{ prefix }}multiarch/debian-debootstrap:arm64-jessie {% else %} -FROM debian:jessie +FROM {{ prefix }}{{DOCKER_BASE_ARCH}}/debian:jessie {% endif %} ## Remove retired jessie-updates repo diff --git a/dockers/docker-base/etc/rsyslog.d/supervisor.conf b/dockers/docker-base/etc/rsyslog.d/supervisor.conf index ce70f10e6e73..fde8d8a6c994 100644 --- a/dockers/docker-base/etc/rsyslog.d/supervisor.conf +++ b/dockers/docker-base/etc/rsyslog.d/supervisor.conf @@ -1,4 +1,4 @@ -module(load="imfile") #By default notify mode +module(load="imfile" mode="inotify") # Ensure "inotify" mode is used $WorkDirectory /var/log/supervisor # Start Monitoring the file input(type="imfile" diff --git a/dockers/docker-config-engine-buster/Dockerfile.j2 b/dockers/docker-config-engine-buster/Dockerfile.j2 index 3022546a068c..ec85c215ad11 100644 --- a/dockers/docker-config-engine-buster/Dockerfile.j2 +++ b/dockers/docker-config-engine-buster/Dockerfile.j2 @@ -23,6 +23,10 @@ RUN apt-get install -y \ RUN pip3 install pyangbind==0.8.1 RUN pip3 uninstall -y enum34 +# Fix armhf build failure +# The option --no-build-isolation can be removed when upgrading PyYAML to 6.0.1 +RUN pip3 install PyYAML==5.4.1 --no-build-isolation + {% if docker_config_engine_buster_debs.strip() %} # Copy locally-built Debian package dependencies {{ copy_files("debs/", docker_config_engine_buster_debs.split(' '), "/debs/") }} @@ -49,4 +53,4 @@ RUN apt-get purge -y \ apt-get clean -y && \ apt-get autoclean -y && \ apt-get autoremove -y && \ - rm -rf /debs /python-wheels + rm -rf /debs /python-wheels ~/.cache diff --git a/dockers/docker-database/base_image_files/monit_database b/dockers/docker-database/base_image_files/monit_database deleted file mode 100644 index 47c9d1b2d47f..000000000000 --- a/dockers/docker-database/base_image_files/monit_database +++ /dev/null @@ -1,7 +0,0 @@ -############################################################################### -## Monit configuration for database container -## process list: -## redis_server -############################################################################### -check program database|redis_server with path "/usr/bin/process_checker database /usr/bin/redis-server" - if status != 0 for 5 times within 5 cycles then alert repeat every 1 cycles diff --git a/dockers/docker-database/flush_unused_database b/dockers/docker-database/flush_unused_database index 10cacb5e0b33..b1d4af063860 100755 --- a/dockers/docker-database/flush_unused_database +++ b/dockers/docker-database/flush_unused_database @@ -1,11 +1,11 @@ -#!/usr/bin/python +#!/usr/bin/python3 import swsssdk import redis import subprocess import time while(True): - output = subprocess.Popen(['sonic-db-cli', 'PING'], stdout=subprocess.PIPE).communicate()[0] + output = subprocess.Popen(['sonic-db-cli', 'PING'], stdout=subprocess.PIPE, text=True).communicate()[0] if 'PONG' in output: break time.sleep(1) diff --git a/dockers/docker-database/supervisord.conf.j2 b/dockers/docker-database/supervisord.conf.j2 index 65a172b3743a..b063016eb68a 100644 --- a/dockers/docker-database/supervisord.conf.j2 +++ b/dockers/docker-database/supervisord.conf.j2 @@ -5,9 +5,10 @@ nodaemon=true [eventlistener:supervisor-proc-exit-listener] command=/usr/bin/supervisor-proc-exit-listener --container-name database -events=PROCESS_STATE_EXITED +events=PROCESS_STATE_EXITED,PROCESS_STATE_RUNNING autostart=true autorestart=unexpected +buffer_size=1024 [program:rsyslogd] command=/usr/sbin/rsyslogd -n -iNONE diff --git a/dockers/docker-dhcp-relay/Dockerfile.j2 b/dockers/docker-dhcp-relay/Dockerfile.j2 index 1100aa510742..ce6eb4506f6c 100644 --- a/dockers/docker-dhcp-relay/Dockerfile.j2 +++ b/dockers/docker-dhcp-relay/Dockerfile.j2 @@ -30,6 +30,7 @@ RUN apt-get clean -y && \ COPY ["docker_init.sh", "start.sh", "/usr/bin/"] COPY ["docker-dhcp-relay.supervisord.conf.j2", "port-name-alias-map.txt.j2", "wait_for_intf.sh.j2", "/usr/share/sonic/templates/"] +COPY ["dhcp-relay.programs.j2", "dhcpv4-relay.agents.j2", "dhcpv6-relay.agents.j2", "dhcp-relay.monitors.j2", "/usr/share/sonic/templates/"] COPY ["files/supervisor-proc-exit-listener", "/usr/bin"] COPY ["critical_processes", "/etc/supervisor"] diff --git a/dockers/docker-dhcp-relay/critical_processes b/dockers/docker-dhcp-relay/critical_processes index 855851bf2d68..43bf6af2794f 100644 --- a/dockers/docker-dhcp-relay/critical_processes +++ b/dockers/docker-dhcp-relay/critical_processes @@ -1 +1 @@ -group:isc-dhcp-relay +group:dhcp-relay diff --git a/dockers/docker-dhcp-relay/dhcp-relay.monitors.j2 b/dockers/docker-dhcp-relay/dhcp-relay.monitors.j2 new file mode 100644 index 000000000000..d81573fd86f2 --- /dev/null +++ b/dockers/docker-dhcp-relay/dhcp-relay.monitors.j2 @@ -0,0 +1,76 @@ +[group:dhcpmon] +programs= +{%- set add_preceding_comma = { 'flag': False } %} +{% set monitor_instance = { 'flag': False } %} +{% for vlan_name in VLAN_INTERFACE %} +{% if VLAN and vlan_name in VLAN and 'dhcp_servers' in VLAN[vlan_name] and VLAN[vlan_name]['dhcp_servers']|length > 0 %} +{% set _dummy = monitor_instance.update({'flag': True}) %} +{%- endif %} +{% if DHCP_RELAY and vlan_name in DHCP_RELAY and DHCP_RELAY[vlan_name]['dhcpv6_servers']|length > 0 %} +{% set _dummy = monitor_instance.update({'flag': True}) %} +{%- endif %} +{% if monitor_instance.flag %} +{% if add_preceding_comma.flag %},{% endif %} +{% set _dummy = add_preceding_comma.update({'flag': True}) %} +dhcpmon-{{ vlan_name }} +{%- set _dummy = monitor_instance.update({'flag': False}) %} +{%- endif %} +{% endfor %} + + +{# Create a program entry for each DHCP MONitor instance #} +{% set relay_for_ipv4 = { 'flag': False } %} +{% set relay_for_ipv6 = { 'flag': False } %} +{% for vlan_name in VLAN_INTERFACE %} +{# Check DHCPv4 agents #} +{% if VLAN and vlan_name in VLAN and 'dhcp_servers' in VLAN[vlan_name] and VLAN[vlan_name]['dhcp_servers']|length > 0 %} +{% for dhcp_server in VLAN[vlan_name]['dhcp_servers'] %} +{% if dhcp_server | ipv4 %} +{% set _dummy = relay_for_ipv4.update({'flag': True}) %} +{% endif %} +{% endfor %} +{% endif %} +{# Check DHCPv6 agents #} +{% if DHCP_RELAY and vlan_name in DHCP_RELAY and DHCP_RELAY[vlan_name]['dhcpv6_servers']|length > 0 %} +{% for dhcpv6_server in DHCP_RELAY[vlan_name]['dhcpv6_servers'] %} +{% if dhcpv6_server | ipv6 %} +{% set _dummy = relay_for_ipv6.update({'flag': True}) %} +{% endif %} +{% endfor %} +{% endif %} +{% if relay_for_ipv4.flag or relay_for_ipv6.flag %} +[program:dhcpmon-{{ vlan_name }}] +{# We treat this VLAN as a downstream interface (-id), as we only want to listen for requests #} +command=/usr/sbin/dhcpmon -id {{ vlan_name }} +{#- Dual ToR Option #} +{% if 'subtype' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['subtype'] == 'DualToR' %} -u Loopback0{% endif -%} +{#- We treat all other interfaces as upstream interfaces (-iu), as we only want to listen for replies #} +{% for (name, prefix) in VLAN_INTERFACE|pfx_filter %} +{% if prefix | ipv4 and name != vlan_name %} -iu {{ name }}{% endif -%} +{% endfor %} +{% for (name, prefix) in INTERFACE|pfx_filter %} +{% if prefix | ipv4 %} -iu {{ name }}{% endif -%} +{% endfor %} +{% for (name, prefix) in PORTCHANNEL_INTERFACE|pfx_filter %} +{% if prefix | ipv4 %} -iu {{ name }}{% endif -%} +{% endfor %} +{% if MGMT_INTERFACE %} +{% for (name, prefix) in MGMT_INTERFACE|pfx_filter %} +{% if prefix | ipv4 %} -im {{ name }}{% endif -%} +{% endfor %} +{% endif %} + +priority=4 +autostart=false +autorestart=false +stdout_logfile=syslog +stderr_logfile=syslog +dependent_startup=true +dependent_startup_wait_for= +{%- if relay_for_ipv4.flag %}isc-dhcpv4-relay-{{ vlan_name }}:running {% endif %} + + +{% set _dummy = relay_for_ipv4.update({'flag': False}) %} +{% set _dummy = relay_for_ipv6.update({'flag': False}) %} +{% endif %} +{% endfor %} diff --git a/dockers/docker-dhcp-relay/dhcp-relay.programs.j2 b/dockers/docker-dhcp-relay/dhcp-relay.programs.j2 new file mode 100644 index 000000000000..d539d895a5bb --- /dev/null +++ b/dockers/docker-dhcp-relay/dhcp-relay.programs.j2 @@ -0,0 +1,21 @@ +[group:dhcp-relay] +programs= +{%- set relay_for_ipv6 = { 'flag': False } %} +{%- set add_preceding_comma = { 'flag': False } %} +{% for vlan_name in VLAN_INTERFACE %} +{# Append DHCPv4 agents #} +{% if VLAN and vlan_name in VLAN and 'dhcp_servers' in VLAN[vlan_name] and VLAN[vlan_name]['dhcp_servers']|length > 0 %} +{% if add_preceding_comma.flag %},{% endif %} +{% set _dummy = add_preceding_comma.update({'flag': True}) %} +isc-dhcpv4-relay-{{ vlan_name }} +{%- endif %} +{% if DHCP_RELAY and vlan_name in DHCP_RELAY and DHCP_RELAY[vlan_name]['dhcpv6_servers']|length > 0 %} +{% set _dummy = relay_for_ipv6.update({'flag': True}) %} +{%- endif %} +{% endfor %} +{# Append DHCPv6 agents #} +{% if relay_for_ipv6.flag %} +{% if add_preceding_comma.flag %},{% endif %} +{% set _dummy = add_preceding_comma.update({'flag': True}) %} +dhcp6relay +{% endif %} diff --git a/dockers/docker-dhcp-relay/dhcpv4-relay.agents.j2 b/dockers/docker-dhcp-relay/dhcpv4-relay.agents.j2 new file mode 100644 index 000000000000..bf756ff63817 --- /dev/null +++ b/dockers/docker-dhcp-relay/dhcpv4-relay.agents.j2 @@ -0,0 +1,40 @@ +{# Append DHCPv4 agents #} +{% if VLAN and vlan_name in VLAN and 'dhcp_servers' in VLAN[vlan_name] and VLAN[vlan_name]['dhcp_servers']|length > 0 %} +{% for dhcp_server in VLAN[vlan_name]['dhcp_servers'] %} +{% if dhcp_server | ipv4 %} +{% set _dummy = relay_for_ipv4.update({'flag': True}) %} +{% endif %} +{% endfor %} +{% if relay_for_ipv4.flag %} +{% set _dummy = relay_for_ipv4.update({'flag': False}) %} +[program:isc-dhcpv4-relay-{{ vlan_name }}] +{# We treat this VLAN as a downstream interface (-id), as we only want to listen for requests #} +command=/usr/sbin/dhcrelay -d -m discard -a %%h:%%p %%P --name-alias-map-file /tmp/port-name-alias-map.txt -id {{ vlan_name }} +{#- Dual ToR Option #} +{% if 'subtype' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['subtype'] == 'DualToR' %} -U Loopback0 -dt{% endif -%} +{#- si option to use intf addr in relay #} +{% if DEVICE_METADATA['localhost']['deployment_id'] == '8' %} -si{% endif -%} +{#- We treat all other interfaces as upstream interfaces (-iu), as we only want to listen for replies #} +{% for (name, prefix) in VLAN_INTERFACE|pfx_filter %} +{% if prefix | ipv4 and name != vlan_name %} -iu {{ name }}{% endif -%} +{% endfor %} +{% for (name, prefix) in INTERFACE|pfx_filter %} +{% if prefix | ipv4 %} -iu {{ name }}{% endif -%} +{% endfor %} +{% for (name, prefix) in PORTCHANNEL_INTERFACE|pfx_filter %} +{% if prefix | ipv4 %} -iu {{ name }}{% endif -%} +{% endfor %} +{% for dhcp_server in VLAN[vlan_name]['dhcp_servers'] %} +{%- if dhcp_server | ipv4 %} {{ dhcp_server }}{% endif -%} +{% endfor %} + +priority=3 +autostart=false +autorestart=false +stdout_logfile=syslog +stderr_logfile=syslog +dependent_startup=true +dependent_startup_wait_for=start:exited + +{% endif %} +{% endif %} diff --git a/dockers/docker-dhcp-relay/dhcpv6-relay.agents.j2 b/dockers/docker-dhcp-relay/dhcpv6-relay.agents.j2 new file mode 100644 index 000000000000..8f83e05efc7c --- /dev/null +++ b/dockers/docker-dhcp-relay/dhcpv6-relay.agents.j2 @@ -0,0 +1,26 @@ +{# Append DHCPv6 agents #} +{% for vlan_name in VLAN_INTERFACE %} +{% if DHCP_RELAY and vlan_name in DHCP_RELAY and DHCP_RELAY[vlan_name]['dhcpv6_servers']|length > 0 %} +{% for dhcpv6_server in DHCP_RELAY[vlan_name]['dhcpv6_servers'] %} +{% if dhcpv6_server | ipv6 %} +{% set _dummy = relay_for_ipv6.update({'flag': True}) %} +{% endif %} +{% endfor %} +{% endif %} +{% endfor %} +{% if relay_for_ipv6.flag %} +{% set _dummy = relay_for_ipv6.update({'flag': False}) %} +[program:dhcp6relay] +command=/usr/sbin/dhcp6relay +{#- Dual ToR Option #} +{% if 'subtype' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['subtype'] == 'DualToR' %} -d{% endif %} + +priority=3 +autostart=false +autorestart=false +stdout_logfile=syslog +stderr_logfile=syslog +dependent_startup=true +dependent_startup_wait_for=start:exited + +{% endif %} diff --git a/dockers/docker-dhcp-relay/docker-dhcp-relay.supervisord.conf.j2 b/dockers/docker-dhcp-relay/docker-dhcp-relay.supervisord.conf.j2 index 59d6c1f5f2c7..ddd93bb28644 100644 --- a/dockers/docker-dhcp-relay/docker-dhcp-relay.supervisord.conf.j2 +++ b/dockers/docker-dhcp-relay/docker-dhcp-relay.supervisord.conf.j2 @@ -10,13 +10,14 @@ autorestart=unexpected startretries=0 exitcodes=0,3 events=PROCESS_STATE -buffer_size=50 +buffer_size=1024 [eventlistener:supervisor-proc-exit-listener] command=/usr/bin/supervisor-proc-exit-listener --container-name dhcp_relay -events=PROCESS_STATE_EXITED +events=PROCESS_STATE_EXITED,PROCESS_STATE_RUNNING autostart=true autorestart=unexpected +buffer_size=1024 [program:rsyslogd] command=/usr/sbin/rsyslogd -n -iNONE @@ -39,123 +40,31 @@ dependent_startup=true dependent_startup_wait_for=rsyslogd:running {# If our configuration has VLANs... #} -{% if VLAN %} +{% if VLAN_INTERFACE %} {# Count how many VLANs require a DHCP relay agent... #} -{% set num_relays = { 'count': 0 } %} -{% for vlan_name in VLAN %} -{% if VLAN[vlan_name]['dhcp_servers'] %} -{% set _dummy = num_relays.update({'count': num_relays.count + 1}) %} +{% set ipv4_num_relays = { 'count': 0 } %} +{% set ipv6_num_relays = { 'count': 0 } %} +{% for vlan_name in VLAN_INTERFACE %} +{% if VLAN and vlan_name in VLAN and 'dhcp_servers' in VLAN[vlan_name] and VLAN[vlan_name]['dhcp_servers']|length > 0 %} +{% set _dummy = ipv4_num_relays.update({'count': ipv4_num_relays.count + 1}) %} +{% endif %} +{% if DHCP_RELAY and vlan_name in DHCP_RELAY and DHCP_RELAY[vlan_name]['dhcpv6_servers']|length > 0 %} +{% set _dummy = ipv6_num_relays.update({'count': ipv6_num_relays.count + 1}) %} {% endif %} {% endfor %} {# If one or more of the VLANs require a DHCP relay agent... #} -{% if num_relays.count > 0 %} -[group:isc-dhcp-relay] -programs= -{%- set add_preceding_comma = { 'flag': False } %} -{% for vlan_name in VLAN %} -{% if VLAN[vlan_name]['dhcp_servers'] %} -{% if add_preceding_comma.flag %},{% endif %} -{% set _dummy = add_preceding_comma.update({'flag': True}) %} -isc-dhcp-relay-{{ vlan_name }} -{%- endif %} -{% endfor %} +{% if ipv4_num_relays.count > 0 or ipv6_num_relays.count > 0 %} +{% include 'dhcp-relay.programs.j2' %} {# Create a program entry for each DHCP relay agent instance #} {% set relay_for_ipv4 = { 'flag': False } %} -{% for vlan_name in VLAN %} -{% if VLAN[vlan_name]['dhcp_servers'] %} -{% for dhcp_server in VLAN[vlan_name]['dhcp_servers'] %} -{% if dhcp_server | ipv4 %} -{% set _dummy = relay_for_ipv4.update({'flag': True}) %} -{% endif %} -{% endfor %} -{% if relay_for_ipv4.flag %} -{% set _dummy = relay_for_ipv4.update({'flag': False}) %} -[program:isc-dhcp-relay-{{ vlan_name }}] -{# We treat this VLAN as a downstream interface (-id), as we only want to listen for requests #} -command=/usr/sbin/dhcrelay -d -m discard -a %%h:%%p %%P --name-alias-map-file /tmp/port-name-alias-map.txt -id {{ vlan_name }} -{#- Dual ToR Option #} -{% if 'subtype' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['subtype'] == 'DualToR' %} -U Loopback0 -dt{% endif -%} -{#- We treat all other interfaces as upstream interfaces (-iu), as we only want to listen for replies #} -{% for (name, prefix) in VLAN_INTERFACE|pfx_filter %} -{% if prefix | ipv4 and name != vlan_name %} -iu {{ name }}{% endif -%} -{% endfor %} -{% for (name, prefix) in INTERFACE|pfx_filter %} -{% if prefix | ipv4 %} -iu {{ name }}{% endif -%} -{% endfor %} -{% for (name, prefix) in PORTCHANNEL_INTERFACE|pfx_filter %} -{% if prefix | ipv4 %} -iu {{ name }}{% endif -%} -{% endfor %} -{% for dhcp_server in VLAN[vlan_name]['dhcp_servers'] %} -{%- if dhcp_server | ipv4 %} {{ dhcp_server }}{% endif -%} -{% endfor %} - -priority=3 -autostart=false -autorestart=false -stdout_logfile=syslog -stderr_logfile=syslog -dependent_startup=true -dependent_startup_wait_for=start:exited - -{% endif %} -{% endif %} -{% endfor %} - -[group:dhcpmon] -programs= -{%- set add_preceding_comma = { 'flag': False } %} -{% for vlan_name in VLAN %} -{% if VLAN[vlan_name]['dhcp_servers'] %} -{% if add_preceding_comma.flag %},{% endif %} -{% set _dummy = add_preceding_comma.update({'flag': True}) %} -dhcpmon-{{ vlan_name }} -{%- endif %} -{% endfor %} - - -{# Create a program entry for each DHCP MONitor instance #} -{% set relay_for_ipv4 = { 'flag': False } %} -{% for vlan_name in VLAN %} -{% if VLAN[vlan_name]['dhcp_servers'] %} -{% for dhcp_server in VLAN[vlan_name]['dhcp_servers'] %} -{% if dhcp_server | ipv4 %} -{% set _dummy = relay_for_ipv4.update({'flag': True}) %} -{% endif %} -{% endfor %} -{% if relay_for_ipv4.flag %} -{% set _dummy = relay_for_ipv4.update({'flag': False}) %} -[program:dhcpmon-{{ vlan_name }}] -{# We treat this VLAN as a downstream interface (-id), as we only want to listen for requests #} -command=/usr/sbin/dhcpmon -id {{ vlan_name }} -{#- We treat all other interfaces as upstream interfaces (-iu), as we only want to listen for replies #} -{% for (name, prefix) in VLAN_INTERFACE|pfx_filter %} -{% if prefix | ipv4 and name != vlan_name %} -iu {{ name }}{% endif -%} -{% endfor %} -{% for (name, prefix) in INTERFACE|pfx_filter %} -{% if prefix | ipv4 %} -iu {{ name }}{% endif -%} -{% endfor %} -{% for (name, prefix) in PORTCHANNEL_INTERFACE|pfx_filter %} -{% if prefix | ipv4 %} -iu {{ name }}{% endif -%} -{% endfor %} -{% if MGMT_INTERFACE %} -{% for (name, prefix) in MGMT_INTERFACE|pfx_filter %} -{% if prefix | ipv4 %} -im {{ name }}{% endif -%} -{% endfor %} -{% endif %} - -priority=4 -autostart=false -autorestart=false -stdout_logfile=syslog -stderr_logfile=syslog -dependent_startup=true -dependent_startup_wait_for=isc-dhcp-relay-{{ vlan_name }}:running - -{% endif %} -{% endif %} +{% set relay_for_ipv6 = { 'flag': False } %} +{% for vlan_name in VLAN_INTERFACE %} +{% include 'dhcpv4-relay.agents.j2' %} {% endfor %} +{% include 'dhcpv6-relay.agents.j2' %} +{% include 'dhcp-relay.monitors.j2' %} {% endif %} {% endif %} diff --git a/dockers/docker-dhcp-relay/start.sh b/dockers/docker-dhcp-relay/start.sh index cb563eb003c3..87a9e5711f2f 100755 --- a/dockers/docker-dhcp-relay/start.sh +++ b/dockers/docker-dhcp-relay/start.sh @@ -10,8 +10,8 @@ then ${CTR_SCRIPT} -f dhcp_relay -o ${RUNTIME_OWNER} -v ${IMAGE_VERSION} fi -# If our supervisor config has entries in the "isc-dhcp-relay" group... -if [ $(supervisorctl status | grep -c "^isc-dhcp-relay:") -gt 0 ]; then +# If our supervisor config has entries in the "dhcp-relay" group... +if [ $(supervisorctl status | grep -c "^dhcp-relay:") -gt 0 ]; then # Wait for all interfaces to come up and be assigned IPv4 addresses before # starting the DHCP relay agent(s). If an interface the relay should listen # on is down, the relay agent will not start. If an interface the relay diff --git a/dockers/docker-dhcp-relay/wait_for_intf.sh.j2 b/dockers/docker-dhcp-relay/wait_for_intf.sh.j2 index 568f128b3772..13499a6e6c54 100644 --- a/dockers/docker-dhcp-relay/wait_for_intf.sh.j2 +++ b/dockers/docker-dhcp-relay/wait_for_intf.sh.j2 @@ -21,8 +21,28 @@ function wait_until_iface_ready echo "Interface ${IFACE_NAME} is ready!" } +function check_for_ipv6_link_local +{ + IFACE_NAME=$1 + echo "Waiting until interface ${IFACE_NAME} has a link-local ipv6 address configured...." + + # Status of link local address is not populated in STATE_DB + while true; do + HAS_LL=$(ip -6 addr show ${IFACE_NAME} scope link 2> /dev/null) + RC=$? + if [[ ${RC} == "0" ]] && [[ ! -z ${HAS_LL} ]]; then + break + fi + + sleep 1 + done + + echo "Link-Local address is configured on ${IFACE_NAME}" +} # Wait for all interfaces with IPv4 addresses to be up and ready +# dhcp6relay binds to ipv6 addresses configured on these vlan ifaces +# Thus check if they are ready before launching dhcp6relay {% for (name, prefix) in INTERFACE|pfx_filter %} {% if prefix | ipv4 %} wait_until_iface_ready {{ name }} {{ prefix }} @@ -32,9 +52,20 @@ wait_until_iface_ready {{ name }} {{ prefix }} {% if prefix | ipv4 %} wait_until_iface_ready {{ name }} {{ prefix }} {% endif %} +{% if prefix | ipv6 %} +{% if DHCP_RELAY and name in DHCP_RELAY %} +wait_until_iface_ready {{ name }} {{ prefix }} +check_for_ipv6_link_local {{ name }} +{% endif %} +{% endif %} {% endfor %} {% for (name, prefix) in PORTCHANNEL_INTERFACE|pfx_filter %} {% if prefix | ipv4 %} wait_until_iface_ready {{ name }} {{ prefix }} {% endif %} {% endfor %} + +# Wait 10 seconds for the rest of interfaces to get added/populated. +# dhcrelay listens on each of the interfaces (in addition to the port +# channels and vlan interfaces) +sleep 10 diff --git a/dockers/docker-fpm-frr/Dockerfile.j2 b/dockers/docker-fpm-frr/Dockerfile.j2 index ab8b585899f9..f392d4d3a7a6 100644 --- a/dockers/docker-fpm-frr/Dockerfile.j2 +++ b/dockers/docker-fpm-frr/Dockerfile.j2 @@ -1,5 +1,5 @@ {% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %} -FROM docker-config-engine-buster +FROM docker-swss-layer-buster ARG docker_container_name ARG frr_user_uid @@ -53,10 +53,12 @@ COPY ["snmp.conf", "/etc/snmp/frr.conf"] COPY ["TSA", "/usr/bin/TSA"] COPY ["TSB", "/usr/bin/TSB"] COPY ["TSC", "/usr/bin/TSC"] +COPY ["TS", "/usr/bin/TS"] COPY ["files/supervisor-proc-exit-listener", "/usr/bin"] -COPY ["critical_processes", "/etc/supervisor"] +COPY ["zsocket.sh", "/usr/bin/"] RUN chmod a+x /usr/bin/TSA && \ chmod a+x /usr/bin/TSB && \ - chmod a+x /usr/bin/TSC + chmod a+x /usr/bin/TSC && \ + chmod a+x /usr/bin/zsocket.sh ENTRYPOINT ["/usr/bin/docker_init.sh"] diff --git a/dockers/docker-fpm-frr/TS b/dockers/docker-fpm-frr/TS new file mode 100755 index 000000000000..5057802c7661 --- /dev/null +++ b/dockers/docker-fpm-frr/TS @@ -0,0 +1,52 @@ +#!/bin/bash + +# Check whether the routemap is for internal BGP sessions. +function is_internal_route_map() +{ + [[ "$1" =~ .*"_INTERNAL_".* ]] +} + +function check_not_installed() +{ + c=0 + config=$(vtysh -c "show run") + for route_map_name in $(echo "$config" | sed -ne 's/ neighbor \S* route-map \(\S*\) out/\1/p' | egrep 'V4|V6' | uniq); + do + is_internal_route_map $route_map_name && continue + echo "$config" | egrep -q "^route-map $route_map_name permit 20$" + c=$((c+$?)) + echo "$config" | egrep -q "^route-map $route_map_name deny 30$" + c=$((c+$?)) + done + return $c +} + +function check_installed() +{ + c=0 + e=0 + config=$(vtysh -c "show run") + for route_map_name in $(echo "$config" | sed -ne 's/ neighbor \S* route-map \(\S*\) out/\1/p' | egrep 'V4|V6' | uniq); + do + is_internal_route_map $route_map_name && continue + echo "$config" | egrep -q "^route-map $route_map_name permit 20$" + c=$((c+$?)) + e=$((e+1)) + echo "$config" | egrep -q "^route-map $route_map_name deny 30$" + c=$((c+$?)) + e=$((e+1)) + done + return $((e-c)) +} + +function find_num_routemap() +{ + c=0 + config=$(vtysh -c "show run") + for route_map_name in $(echo "$config" | sed -ne 's/ neighbor \S* route-map \(\S*\) out/\1/p' | egrep 'V4|V6' | uniq); + do + is_internal_route_map $route_map_name && continue + c=$((c+1)) + done + return $c +} diff --git a/dockers/docker-fpm-frr/TSA b/dockers/docker-fpm-frr/TSA index dc96d32c4582..f45d3bf0bcb3 100755 --- a/dockers/docker-fpm-frr/TSA +++ b/dockers/docker-fpm-frr/TSA @@ -1,26 +1,22 @@ #!/bin/bash -function check_not_installed() -{ - c=0 - config=$(vtysh -c "show run") - for route_map_name in $(echo "$config" | sed -ne 's/ neighbor \S* route-map \(\S*\) out/\1/p'); - do - echo "$config" | grep -q "route-map $route_map_name permit 2" - c=$((c+$?)) - echo "$config" | grep -q "route-map $route_map_name deny 3" - c=$((c+$?)) - done - return $c -} +# Load the common functions +source /usr/bin/TS +find_num_routemap +routemap_count=$? check_not_installed not_installed=$? -if [[ $not_installed -ne 0 ]]; + +if [[ $routemap_count -eq 0 ]]; +then + echo "System Mode: No external neighbors" +elif [[ $not_installed -ne 0 ]]; then TSA_FILE=$(mktemp) - for route_map_name in $(echo "$config" | sed -ne 's/ neighbor \S* route-map \(\S*\) out/\1/p'); + for route_map_name in $(echo "$config" | sed -ne 's/ neighbor \S* route-map \(\S*\) out/\1/p' | uniq); do + is_internal_route_map $route_map_name && continue case "$route_map_name" in *V4*) ip_version=V4 diff --git a/dockers/docker-fpm-frr/TSB b/dockers/docker-fpm-frr/TSB index 68eee9c2faff..50f1ebc3ce8b 100755 --- a/dockers/docker-fpm-frr/TSB +++ b/dockers/docker-fpm-frr/TSB @@ -1,29 +1,22 @@ #!/bin/bash -function check_installed() -{ - c=0 - e=0 - config=$(vtysh -c "show run") - for route_map_name in $(echo "$config" | sed -ne 's/ neighbor \S* route-map \(\S*\) out/\1/p'); - do - echo "$config" | grep -q "route-map $route_map_name permit 2" - c=$((c+$?)) - e=$((e+1)) - echo "$config" | grep -q "route-map $route_map_name deny 3" - c=$((c+$?)) - e=$((e+1)) - done - return $((e-c)) -} +# Load the common functions +source /usr/bin/TS +find_num_routemap +routemap_count=$? check_installed installed=$? -if [[ $installed -ne 0 ]]; + +if [[ $routemap_count -eq 0 ]]; +then + echo "System Mode: No external neighbors" +elif [[ $installed -ne 0 ]]; then TSB_FILE=$(mktemp) - for route_map_name in $(echo "$config" | sed -ne 's/ neighbor \S* route-map \(\S*\) out/\1/p'); + for route_map_name in $(echo "$config" | sed -ne 's/ neighbor \S* route-map \(\S*\) out/\1/p' | uniq); do + is_internal_route_map $route_map_name && continue case "$route_map_name" in *V4*) ;; diff --git a/dockers/docker-fpm-frr/TSC b/dockers/docker-fpm-frr/TSC index 8c17cea7eea7..45d22bdf55c1 100755 --- a/dockers/docker-fpm-frr/TSC +++ b/dockers/docker-fpm-frr/TSC @@ -1,45 +1,20 @@ #!/bin/bash -function check_not_installed() -{ - c=0 - config=$(vtysh -c "show run") - for route_map_name in $(echo "$config" | sed -ne 's/ neighbor \S* route-map \(\S*\) out/\1/p' | egrep 'V4|V6'); - do - echo "$config" | grep -q "route-map $route_map_name permit 2" - c=$((c+$?)) - echo "$config" | grep -q "route-map $route_map_name deny 3" - c=$((c+$?)) - done - return $c -} - -function check_installed() -{ - c=0 - e=0 - config=$(vtysh -c "show run") - for route_map_name in $(echo "$config" | sed -ne 's/ neighbor \S* route-map \(\S*\) out/\1/p' | egrep 'V4|V6'); - do - echo "$config" | grep -q "route-map $route_map_name permit 2" - c=$((c+$?)) - e=$((e+1)) - echo "$config" | grep -q "route-map $route_map_name deny 3" - c=$((c+$?)) - e=$((e+1)) - done - return $((e-c)) -} - -echo "Traffic Shift Check:" +# Load the common functions +source /usr/bin/TS +find_num_routemap +routemap_count=$? check_not_installed not_installed=$? check_installed installed=$? -if [[ $installed -eq 0 ]]; +if [[ $routemap_count -eq 0 ]]; +then + echo "System Mode: No external neighbors" +elif [[ $installed -eq 0 ]]; then echo "System Mode: Normal" elif [[ $not_installed -eq 0 ]]; @@ -48,5 +23,3 @@ then else echo "System Mode: Not consistent" fi - -echo diff --git a/dockers/docker-fpm-frr/base_image_files/TS b/dockers/docker-fpm-frr/base_image_files/TS new file mode 100755 index 000000000000..de1e50b7a306 --- /dev/null +++ b/dockers/docker-fpm-frr/base_image_files/TS @@ -0,0 +1,29 @@ +#!/bin/bash + +# read SONiC immutable variables +[ -f /etc/sonic/sonic-environment ] && . /etc/sonic/sonic-environment + +PLATFORM=${PLATFORM:-`sonic-cfggen -H -v DEVICE_METADATA.localhost.platform`} + +# Parse the device specific asic conf file, if it exists +ASIC_CONF=/usr/share/sonic/device/$PLATFORM/asic.conf +[ -f $ASIC_CONF ] && . $ASIC_CONF + +if [[ ($NUM_ASIC -gt 1) ]]; then + asic=0 + NAMESPACE_PREFIX='asic' + + while [ $asic -lt $NUM_ASIC ] + do + # Run TSA/TSB/TSC scripts in BGP instance for frontend ASICs. + sub_role=`sonic-cfggen -d -v "DEVICE_METADATA['localhost']['sub_role']" -n $NAMESPACE_PREFIX$asic` + if [ $sub_role == 'FrontEnd' ] + then + echo -e "BGP"$asic" : \c" + docker exec -i bgp$asic /usr/bin/$1 + fi + asic=$[$asic+1] + done +else + docker exec -i bgp /usr/bin/$1 +fi diff --git a/dockers/docker-fpm-frr/base_image_files/TSA b/dockers/docker-fpm-frr/base_image_files/TSA index 95c7957f7dc1..6b2ddb264834 100755 --- a/dockers/docker-fpm-frr/base_image_files/TSA +++ b/dockers/docker-fpm-frr/base_image_files/TSA @@ -1,3 +1,12 @@ #!/bin/bash -docker exec -i bgp /usr/bin/TSA +# toggle the mux to standby if dualtor and any mux active +if +[[ "$(sonic-cfggen -d -v DEVICE_METADATA.localhost.subtype | tr [:upper:] [:lower:])" == *"dualtor"* ]] && +[[ $(show mux status | grep active | wc -l) > 0 ]]; +then + logger -t TSA -p user.info "Toggle all mux mode to standby" + sudo config mux mode standby all +fi + +/usr/bin/TS TSA diff --git a/dockers/docker-fpm-frr/base_image_files/TSB b/dockers/docker-fpm-frr/base_image_files/TSB index f292d2031db3..3fed7bb644f5 100755 --- a/dockers/docker-fpm-frr/base_image_files/TSB +++ b/dockers/docker-fpm-frr/base_image_files/TSB @@ -1,3 +1,10 @@ #!/bin/bash -docker exec -i bgp /usr/bin/TSB +# toggle the mux to auto if dualtor +if [[ "$(sonic-cfggen -d -v DEVICE_METADATA.localhost.subtype | tr [:upper:] [:lower:])" == *"dualtor"* ]]; +then + logger -t TSB -p user.info "Toggle all mux mode to auto" + sudo config mux mode auto all +fi + +/usr/bin/TS TSB diff --git a/dockers/docker-fpm-frr/base_image_files/TSC b/dockers/docker-fpm-frr/base_image_files/TSC index b8136ae4f4c3..12af5d621af7 100755 --- a/dockers/docker-fpm-frr/base_image_files/TSC +++ b/dockers/docker-fpm-frr/base_image_files/TSC @@ -1,5 +1,11 @@ #!/bin/bash -docker exec -i bgp /usr/bin/TSC +/usr/bin/TS TSC portstat -p 5 + +if [[ "$(sonic-cfggen -d -v DEVICE_METADATA.localhost.subtype | tr [:upper:] [:lower:])" == *"dualtor"* ]] +then + echo + show mux status +fi diff --git a/dockers/docker-fpm-frr/base_image_files/monit_bgp b/dockers/docker-fpm-frr/base_image_files/monit_bgp deleted file mode 100644 index 07705e84179d..000000000000 --- a/dockers/docker-fpm-frr/base_image_files/monit_bgp +++ /dev/null @@ -1,27 +0,0 @@ -############################################################################### -## Monit configuration for BGP container -## process list: -## zebra -## fpmsyncd -## bgpd -## staticd -## bgpcfgd -## bgpmon -############################################################################### -check program bgp|zebra with path "/usr/bin/process_checker bgp /usr/lib/frr/zebra" - if status != 0 for 5 times within 5 cycles then alert repeat every 1 cycles - -check program bgp|fpmsyncd with path "/usr/bin/process_checker bgp fpmsyncd" - if status != 0 for 5 times within 5 cycles then alert repeat every 1 cycles - -check program bgp|bgpd with path "/usr/bin/process_checker bgp /usr/lib/frr/bgpd" - if status != 0 for 5 times within 5 cycles then alert repeat every 1 cycles - -check program bgp|staticd with path "/usr/bin/process_checker bgp /usr/lib/frr/staticd" - if status != 0 for 5 times within 5 cycles then alert repeat every 1 cycles - -check program bgp|bgpcfgd with path "/usr/bin/process_checker bgp /usr/bin/python3 /usr/local/bin/bgpcfgd" - if status != 0 for 5 times within 5 cycles then alert repeat every 1 cycles - -check program bgp|bgpmon with path "/usr/bin/process_checker bgp /usr/bin/python3 /usr/local/bin/bgpmon" - if status != 0 for 5 times within 5 cycles then alert repeat every 1 cycles diff --git a/dockers/docker-fpm-frr/base_image_files/rvtysh b/dockers/docker-fpm-frr/base_image_files/rvtysh new file mode 100755 index 000000000000..81fb23046a6d --- /dev/null +++ b/dockers/docker-fpm-frr/base_image_files/rvtysh @@ -0,0 +1,22 @@ +#!/bin/bash + +# The command rvtysh can be run as root priviledge by any user without password, only allow to execute readonly commands. + +# The options in the show command cannot contains any charactors to run multiple sub-commands potentially, such as "\n", "\r", "|", "&", "$" and ";". +if printf -- "$*" | grep -qPz '[\n\r|&$;]'; then + echo "Not allow to run the command, please use the comand 'sudo vtysh' instead." 1>&2 + exit 1 +fi + +# The sub commands must start with "show" +LAST_PARAM= +for param in "$@" +do + if [ "$LAST_PARAM" == "-c" ] && [[ "$param" != show* ]]; then + echo "Not allow to run the command '$param', please use the comand 'sudo vtysh' instead." 1>&2 + exit 1 + fi + LAST_PARAM=$param +done + +vtysh "$@" diff --git a/dockers/docker-fpm-frr/critical_processes b/dockers/docker-fpm-frr/critical_processes deleted file mode 100644 index 2631fee15e66..000000000000 --- a/dockers/docker-fpm-frr/critical_processes +++ /dev/null @@ -1,5 +0,0 @@ -program:zebra -program:staticd -program:bgpd -program:fpmsyncd -program:bgpcfgd diff --git a/dockers/docker-fpm-frr/docker_init.sh b/dockers/docker-fpm-frr/docker_init.sh index 94cd7fbb1322..96149de4c379 100755 --- a/dockers/docker-fpm-frr/docker_init.sh +++ b/dockers/docker-fpm-frr/docker_init.sh @@ -6,16 +6,25 @@ mkdir -p /etc/supervisor/conf.d CFGGEN_PARAMS=" \ -d \ -y /etc/sonic/constants.yml \ - -t /usr/share/sonic/templates/supervisord/frr_vars.j2 \ + -t /usr/share/sonic/templates/frr_vars.j2 \ -t /usr/share/sonic/templates/supervisord/supervisord.conf.j2,/etc/supervisor/conf.d/supervisord.conf \ - -t /usr/share/sonic/templates/bgpd/bgpd.conf.j2,/etc/frr/bgpd.conf \ + -t /usr/share/sonic/templates/bgpd/gen_bgpd.conf.j2,/etc/frr/bgpd.conf \ + -t /usr/share/sonic/templates/supervisord/critical_processes.j2,/etc/supervisor/critical_processes \ -t /usr/share/sonic/templates/zebra/zebra.conf.j2,/etc/frr/zebra.conf \ - -t /usr/share/sonic/templates/staticd/staticd.conf.j2,/etc/frr/staticd.conf \ - -t /usr/share/sonic/templates/frr.conf.j2,/etc/frr/frr.conf \ + -t /usr/share/sonic/templates/staticd/gen_staticd.conf.j2,/etc/frr/staticd.conf \ + -t /usr/share/sonic/templates/gen_frr.conf.j2,/etc/frr/frr.conf \ -t /usr/share/sonic/templates/isolate.j2,/usr/sbin/bgp-isolate \ -t /usr/share/sonic/templates/unisolate.j2,/usr/sbin/bgp-unisolate \ + -t /usr/local/sonic/frrcfgd/bfdd.conf.j2,/etc/frr/bfdd.conf \ + -t /usr/local/sonic/frrcfgd/ospfd.conf.j2,/etc/frr/ospfd.conf \ " -CONFIG_TYPE=$(sonic-cfggen $CFGGEN_PARAMS) + +FRR_VARS=$(sonic-cfggen $CFGGEN_PARAMS) +MGMT_FRAMEWORK_CONFIG=$(echo $FRR_VARS | jq -r '.frr_mgmt_framework_config') +CONFIG_TYPE=$(echo $FRR_VARS | jq -r '.docker_routing_config_mode') +if [ -z "$MGMT_FRAMEWORK_CONFIG" ] || [ "$MGMT_FRAMEWORK_CONFIG" == "false" ]; then + rm /etc/frr/bfdd.conf /etc/frr/ospfd.conf +fi update_default_gw() { @@ -52,7 +61,8 @@ if [ -z "$CONFIG_TYPE" ] || [ "$CONFIG_TYPE" == "separated" ]; then rm -f /etc/frr/frr.conf elif [ "$CONFIG_TYPE" == "unified" ]; then echo "service integrated-vtysh-config" > /etc/frr/vtysh.conf - rm -f /etc/frr/bgpd.conf /etc/frr/zebra.conf /etc/frr/staticd.conf + rm -f /etc/frr/bgpd.conf /etc/frr/zebra.conf /etc/frr/staticd.conf \ + /etc/frr/bfdd.conf /etc/frr/ospfd.conf /etc/frr/pimd.conf fi chown -R frr:frr /etc/frr/ diff --git a/dockers/docker-fpm-frr/frr/bgpd/bgpd.main.conf.j2 b/dockers/docker-fpm-frr/frr/bgpd/bgpd.main.conf.j2 index 9568d4821547..b65ac6d97398 100644 --- a/dockers/docker-fpm-frr/frr/bgpd/bgpd.main.conf.j2 +++ b/dockers/docker-fpm-frr/frr/bgpd/bgpd.main.conf.j2 @@ -32,7 +32,13 @@ ipv6 prefix-list LOCAL_VLAN_IPV6_PREFIX seq {{ loop.index * 5 }} permit {{ prefi ! {% if DEVICE_METADATA['localhost']['sub_role'] == 'FrontEnd' or DEVICE_METADATA['localhost']['sub_role'] == 'BackEnd' %} route-map HIDE_INTERNAL permit 10 - set community local-AS + set community no-export +{% if constants.bgp.peers is defined and constants.bgp.peers.internal is defined and constants.bgp.peers.internal.community is defined %} + on-match next +route-map HIDE_INTERNAL permit 20 + set community {{ constants.bgp.peers.internal.community }} additive +{% endif %} +{% set multi_asic = True %} ! {% endif %} ! @@ -42,19 +48,23 @@ router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }} bgp log-neighbor-changes no bgp default ipv4-unicast no bgp ebgp-requires-policy +{% if (DEVICE_METADATA is defined) and ('localhost' in DEVICE_METADATA) and ('subtype' in DEVICE_METADATA['localhost']) and (DEVICE_METADATA['localhost']['subtype'].lower() == 'dualtor') %} + coalesce-time 10000 +{% endif %} ! {% if constants.bgp.multipath_relax.enabled is defined and constants.bgp.multipath_relax.enabled %} bgp bestpath as-path multipath-relax {% endif %} ! -{% if constants.bgp.graceful_restart.enabled is defined and constants.bgp.graceful_restart.enabled %} +{% if constants.bgp.graceful_restart.enabled is defined and constants.bgp.graceful_restart.enabled and DEVICE_METADATA['localhost']['type'] == 'ToRRouter' %} bgp graceful-restart restart-time {{ constants.bgp.graceful_restart.restart_time | default(240) }} bgp graceful-restart bgp graceful-restart preserve-fw-state + bgp graceful-restart select-defer-time {{ constants.bgp.graceful_restart.select_defer_time | default(45) }} {% endif %} ! {# set router-id #} -{% if multi_asic() %} +{% if DEVICE_METADATA['localhost']['sub_role'] == 'BackEnd' %} bgp router-id {{ get_ipv4_loopback_address(LOOPBACK_INTERFACE, "Loopback4096") | ip }} {% else %} bgp router-id {{ get_ipv4_loopback_address(LOOPBACK_INTERFACE, "Loopback0") | ip }} @@ -62,7 +72,7 @@ router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }} ! {# advertise loopback #} network {{ get_ipv4_loopback_address(LOOPBACK_INTERFACE, "Loopback0") | ip }}/32 -{% if multi_asic() %} +{% if multi_asic is defined %} network {{ get_ipv4_loopback_address(LOOPBACK_INTERFACE, "Loopback4096") | ip }}/32 route-map HIDE_INTERNAL {% endif %} ! @@ -71,10 +81,10 @@ router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }} network {{ get_ipv6_loopback_address(LOOPBACK_INTERFACE, "Loopback0") | ip }}/64 exit-address-family {% endif %} -{% if multi_asic() %} +{% if multi_asic is defined %} {% if get_ipv6_loopback_address(LOOPBACK_INTERFACE, "Loopback4096") != 'None' %} address-family ipv6 - network {{ get_ipv6_loopback_address(LOOPBACK_INTERFACE, "Loopback4096") | ip }}/64 route-map HIDE_INTERNAL + network {{ get_ipv6_loopback_address(LOOPBACK_INTERFACE, "Loopback4096") | ip }}/128 route-map HIDE_INTERNAL exit-address-family {% endif %} {% endif %} diff --git a/dockers/docker-fpm-frr/frr/bgpd/gen_bgpd.conf.j2 b/dockers/docker-fpm-frr/frr/bgpd/gen_bgpd.conf.j2 new file mode 100644 index 000000000000..bb6d7f6a5a65 --- /dev/null +++ b/dockers/docker-fpm-frr/frr/bgpd/gen_bgpd.conf.j2 @@ -0,0 +1,5 @@ +{% if DEVICE_METADATA.localhost.frr_mgmt_framework_config is defined and DEVICE_METADATA.localhost.frr_mgmt_framework_config == "true" %} + {% include "/usr/local/sonic/frrcfgd/bgpd.conf.j2" %} +{% else %} + {% include "/usr/share/sonic/templates/bgpd/bgpd.conf.j2" %} +{% endif %} diff --git a/dockers/docker-fpm-frr/frr/bgpd/templates/general/instance.conf.j2 b/dockers/docker-fpm-frr/frr/bgpd/templates/general/instance.conf.j2 index c8c9906bc98d..836561e4263b 100644 --- a/dockers/docker-fpm-frr/frr/bgpd/templates/general/instance.conf.j2 +++ b/dockers/docker-fpm-frr/frr/bgpd/templates/general/instance.conf.j2 @@ -8,6 +8,7 @@ or (bgp_session['holdtime'] is defined and bgp_session['holdtime'] | int != 180) %} neighbor {{ neighbor_addr }} timers {{ bgp_session['keepalive'] | default("60") }} {{ bgp_session['holdtime'] | default("180") }} {% endif %} + neighbor {{ neighbor_addr }} timers connect 10 ! {% if 'admin_status' in bgp_session and bgp_session['admin_status'] == 'down' or 'admin_status' not in bgp_session and 'default_bgp_status' in CONFIG_DB__DEVICE_METADATA['localhost'] and CONFIG_DB__DEVICE_METADATA['localhost']['default_bgp_status'] == 'down' %} neighbor {{ neighbor_addr }} shutdown diff --git a/dockers/docker-fpm-frr/frr/bgpd/templates/general/policies.conf.j2 b/dockers/docker-fpm-frr/frr/bgpd/templates/general/policies.conf.j2 index 29498adcd922..7cf5e148f694 100644 --- a/dockers/docker-fpm-frr/frr/bgpd/templates/general/policies.conf.j2 +++ b/dockers/docker-fpm-frr/frr/bgpd/templates/general/policies.conf.j2 @@ -3,14 +3,22 @@ ! ! ! -{% if constants.bgp.allow_list is defined and constants.bgp.allow_list.enabled is defined and constants.bgp.allow_list.enabled %} -{% if constants.bgp.allow_list.default_action is defined and constants.bgp.allow_list.default_action.strip() == 'deny' %} +{% if constants.bgp.allow_list is defined and constants.bgp.allow_list.enabled is defined and constants.bgp.allow_list.enabled and constants.bgp.allow_list.drop_community is defined %} +! +! +! please don't remove. 65535 entries are default rules +! which works when allow_list is enabled, but new configuration +! is not applied +! +{% if allow_list_default_action == 'deny' %} +! route-map ALLOW_LIST_DEPLOYMENT_ID_0_V4 permit 65535 set community no-export additive ! route-map ALLOW_LIST_DEPLOYMENT_ID_0_V6 permit 65535 set community no-export additive {% else %} +! route-map ALLOW_LIST_DEPLOYMENT_ID_0_V4 permit 65535 set community {{ constants.bgp.allow_list.drop_community }} additive ! @@ -18,14 +26,23 @@ route-map ALLOW_LIST_DEPLOYMENT_ID_0_V6 permit 65535 set community {{ constants.bgp.allow_list.drop_community }} additive {% endif %} ! -route-map FROM_BGP_PEER_V4 permit 2 +bgp community-list standard allow_list_default_community permit no-export +bgp community-list standard allow_list_default_community permit {{ constants.bgp.allow_list.drop_community }} +! +route-map FROM_BGP_PEER_V4 permit 10 call ALLOW_LIST_DEPLOYMENT_ID_0_V4 on-match next ! -route-map FROM_BGP_PEER_V6 permit 2 +route-map FROM_BGP_PEER_V4 permit 11 + match community allow_list_default_community +! +route-map FROM_BGP_PEER_V6 permit 10 call ALLOW_LIST_DEPLOYMENT_ID_0_V6 on-match next ! +route-map FROM_BGP_PEER_V6 permit 11 + match community allow_list_default_community +! {% endif %} ! ! diff --git a/dockers/docker-fpm-frr/frr/bgpd/templates/internal/instance.conf.j2 b/dockers/docker-fpm-frr/frr/bgpd/templates/internal/instance.conf.j2 index e0e23b7f60c8..44c70f49bd67 100644 --- a/dockers/docker-fpm-frr/frr/bgpd/templates/internal/instance.conf.j2 +++ b/dockers/docker-fpm-frr/frr/bgpd/templates/internal/instance.conf.j2 @@ -4,12 +4,14 @@ neighbor {{ neighbor_addr }} remote-as {{ bgp_session['asn'] }} neighbor {{ neighbor_addr }} description {{ bgp_session['name'] }} neighbor {{ neighbor_addr }} timers 3 10 + neighbor {{ neighbor_addr }} timers connect 10 ! {% if neighbor_addr | ipv4 %} address-family ipv4 neighbor {{ neighbor_addr }} peer-group INTERNAL_PEER_V4 ! {% if CONFIG_DB__DEVICE_METADATA['localhost']['sub_role'] == 'BackEnd' %} + neighbor {{ neighbor_addr }} next-hop-self force neighbor {{ neighbor_addr }} route-map FROM_BGP_INTERNAL_PEER_V4 in {% endif %} ! @@ -18,6 +20,7 @@ neighbor {{ neighbor_addr }} peer-group INTERNAL_PEER_V6 ! {% if CONFIG_DB__DEVICE_METADATA['localhost']['sub_role'] == 'BackEnd' %} + neighbor {{ neighbor_addr }} next-hop-self force neighbor {{ neighbor_addr }} route-map FROM_BGP_INTERNAL_PEER_V6 in {% endif %} {% endif %} @@ -26,7 +29,6 @@ neighbor {{ neighbor_addr }} route-reflector-client {% endif %} ! - neighbor {{ neighbor_addr }} next-hop-self force ! neighbor {{ neighbor_addr }} activate exit-address-family diff --git a/dockers/docker-fpm-frr/frr/bgpd/templates/internal/peer-group.conf.j2 b/dockers/docker-fpm-frr/frr/bgpd/templates/internal/peer-group.conf.j2 index 323c13447ed0..c0ee4d99b796 100644 --- a/dockers/docker-fpm-frr/frr/bgpd/templates/internal/peer-group.conf.j2 +++ b/dockers/docker-fpm-frr/frr/bgpd/templates/internal/peer-group.conf.j2 @@ -8,6 +8,7 @@ neighbor INTERNAL_PEER_V4 route-reflector-client {% endif %} neighbor INTERNAL_PEER_V4 soft-reconfiguration inbound + neighbor INTERNAL_PEER_V4 allowas-in 1 neighbor INTERNAL_PEER_V4 route-map FROM_BGP_INTERNAL_PEER_V4 in neighbor INTERNAL_PEER_V4 route-map TO_BGP_INTERNAL_PEER_V4 out exit-address-family @@ -16,6 +17,7 @@ neighbor INTERNAL_PEER_V6 route-reflector-client {% endif %} neighbor INTERNAL_PEER_V6 soft-reconfiguration inbound + neighbor INTERNAL_PEER_V6 allowas-in 1 neighbor INTERNAL_PEER_V6 route-map FROM_BGP_INTERNAL_PEER_V6 in neighbor INTERNAL_PEER_V6 route-map TO_BGP_INTERNAL_PEER_V6 out exit-address-family diff --git a/dockers/docker-fpm-frr/frr/bgpd/templates/internal/policies.conf.j2 b/dockers/docker-fpm-frr/frr/bgpd/templates/internal/policies.conf.j2 index 81d3b0041179..855a68635653 100644 --- a/dockers/docker-fpm-frr/frr/bgpd/templates/internal/policies.conf.j2 +++ b/dockers/docker-fpm-frr/frr/bgpd/templates/internal/policies.conf.j2 @@ -2,6 +2,7 @@ ! template: bgpd/templates/internal/policies.conf.j2 ! ! +{% from "common/functions.conf.j2" import get_ipv4_loopback_address %} ! route-map FROM_BGP_INTERNAL_PEER_V4 permit 100 ! @@ -9,8 +10,8 @@ route-map TO_BGP_INTERNAL_PEER_V4 permit 100 ! ! route-map FROM_BGP_INTERNAL_PEER_V6 permit 1 - on-match next set ipv6 next-hop prefer-global + on-match next ! route-map FROM_BGP_INTERNAL_PEER_V6 permit 100 ! @@ -18,10 +19,10 @@ route-map TO_BGP_INTERNAL_PEER_V6 permit 100 ! {% if CONFIG_DB__DEVICE_METADATA['localhost']['sub_role'] == 'BackEnd' %} route-map FROM_BGP_INTERNAL_PEER_V4 permit 2 - set originator-id {{ loopback0_ipv4 | ip }} + set originator-id {{ get_ipv4_loopback_address(CONFIG_DB__LOOPBACK_INTERFACE, "Loopback4096") | ip }} ! route-map FROM_BGP_INTERNAL_PEER_V6 permit 2 - set originator-id {{ loopback0_ipv4 | ip }} + set originator-id {{ get_ipv4_loopback_address(CONFIG_DB__LOOPBACK_INTERFACE, "Loopback4096") | ip }} {% endif %} ! ! end of template: bgpd/templates/internal/policies.conf.j2 diff --git a/dockers/docker-fpm-frr/frr/bgpd/tsa/bgpd.tsa.isolate.conf.j2 b/dockers/docker-fpm-frr/frr/bgpd/tsa/bgpd.tsa.isolate.conf.j2 index 94287bdcd300..1256d1cd4f96 100644 --- a/dockers/docker-fpm-frr/frr/bgpd/tsa/bgpd.tsa.isolate.conf.j2 +++ b/dockers/docker-fpm-frr/frr/bgpd/tsa/bgpd.tsa.isolate.conf.j2 @@ -1,5 +1,5 @@ -route-map {{ route_map_name }} permit 2 +route-map {{ route_map_name }} permit 20 match {{ ip_protocol }} address prefix-list PL_Loopback{{ ip_version }} set community {{ constants.bgp.traffic_shift_community }} -route-map {{ route_map_name }} deny 3 +route-map {{ route_map_name }} deny 30 ! diff --git a/dockers/docker-fpm-frr/frr/bgpd/tsa/bgpd.tsa.unisolate.conf.j2 b/dockers/docker-fpm-frr/frr/bgpd/tsa/bgpd.tsa.unisolate.conf.j2 index 22244b3ac883..649f6d8e9db8 100644 --- a/dockers/docker-fpm-frr/frr/bgpd/tsa/bgpd.tsa.unisolate.conf.j2 +++ b/dockers/docker-fpm-frr/frr/bgpd/tsa/bgpd.tsa.unisolate.conf.j2 @@ -1,3 +1,3 @@ -no route-map {{ route_map_name }} permit 2 -no route-map {{ route_map_name }} deny 3 +no route-map {{ route_map_name }} permit 20 +no route-map {{ route_map_name }} deny 30 ! diff --git a/dockers/docker-fpm-frr/frr/frr.conf.j2 b/dockers/docker-fpm-frr/frr/frr.conf.j2 index 99900790366c..11878f8db9aa 100644 --- a/dockers/docker-fpm-frr/frr/frr.conf.j2 +++ b/dockers/docker-fpm-frr/frr/frr.conf.j2 @@ -13,8 +13,6 @@ agentx ! {% include "zebra/zebra.interfaces.conf.j2" %} ! -{% include "staticd/staticd.default_route.conf.j2" %} -! {% include "staticd/staticd.loopback_route.conf.j2" %} ! {% include "bgpd/bgpd.main.conf.j2" %} diff --git a/dockers/docker-fpm-frr/frr/frr_vars.j2 b/dockers/docker-fpm-frr/frr/frr_vars.j2 index 9909604e5f1c..662608a1fd8b 100644 --- a/dockers/docker-fpm-frr/frr/frr_vars.j2 +++ b/dockers/docker-fpm-frr/frr/frr_vars.j2 @@ -1 +1,14 @@ -{{ DEVICE_METADATA["localhost"]["docker_routing_config_mode"] }} +{ + "frr_mgmt_framework_config": + {% if "frr_mgmt_framework_config" in DEVICE_METADATA["localhost"].keys() %} + "{{ DEVICE_METADATA["localhost"]["frr_mgmt_framework_config"] }}" + {% else %} + "" + {% endif %}, + "docker_routing_config_mode": + {% if "docker_routing_config_mode" in DEVICE_METADATA["localhost"].keys() %} + "{{ DEVICE_METADATA["localhost"]["docker_routing_config_mode"] }}" + {% else %} + "" + {% endif %} +} diff --git a/dockers/docker-fpm-frr/frr/gen_frr.conf.j2 b/dockers/docker-fpm-frr/frr/gen_frr.conf.j2 new file mode 100644 index 000000000000..181437da07a0 --- /dev/null +++ b/dockers/docker-fpm-frr/frr/gen_frr.conf.j2 @@ -0,0 +1,5 @@ +{% if DEVICE_METADATA.localhost.frr_mgmt_framework_config is defined and DEVICE_METADATA.localhost.frr_mgmt_framework_config == "true" %} + {% include "/usr/local/sonic/frrcfgd/frr.conf.j2" %} +{% else %} + {% include "/usr/share/sonic/templates/frr.conf.j2" %} +{% endif %} diff --git a/dockers/docker-fpm-frr/frr/staticd/gen_staticd.conf.j2 b/dockers/docker-fpm-frr/frr/staticd/gen_staticd.conf.j2 new file mode 100644 index 000000000000..1346c9a4993b --- /dev/null +++ b/dockers/docker-fpm-frr/frr/staticd/gen_staticd.conf.j2 @@ -0,0 +1,5 @@ +{% if DEVICE_METADATA.localhost.frr_mgmt_framework_config is defined and DEVICE_METADATA.localhost.frr_mgmt_framework_config == "true" %} + {% include "/usr/local/sonic/frrcfgd/staticd.conf.j2" %} +{% else %} + {% include "/usr/share/sonic/templates/staticd/staticd.conf.j2" %} +{% endif %} diff --git a/dockers/docker-fpm-frr/frr/staticd/staticd.conf.j2 b/dockers/docker-fpm-frr/frr/staticd/staticd.conf.j2 index 4831325276c7..6d00ac6609c7 100644 --- a/dockers/docker-fpm-frr/frr/staticd/staticd.conf.j2 +++ b/dockers/docker-fpm-frr/frr/staticd/staticd.conf.j2 @@ -8,7 +8,5 @@ ! {% include "common/daemons.common.conf.j2" %} ! -{% include "staticd.default_route.conf.j2" %} -! {% include "staticd.loopback_route.conf.j2" %} ! diff --git a/dockers/docker-fpm-frr/frr/staticd/staticd.default_route.conf.j2 b/dockers/docker-fpm-frr/frr/staticd/staticd.default_route.conf.j2 deleted file mode 100644 index 22d61ebbd0ff..000000000000 --- a/dockers/docker-fpm-frr/frr/staticd/staticd.default_route.conf.j2 +++ /dev/null @@ -1,10 +0,0 @@ -! -{% block default_route %} -! set static default route to mgmt gateway as a backup to learned default -{% for (name, prefix) in MGMT_INTERFACE|pfx_filter %} -{% if prefix | ipv4 %} -ip route 0.0.0.0/0 {{ MGMT_INTERFACE[(name, prefix)]['gwaddr'] }} 200 -{% endif %} -{% endfor %} -{% endblock default_route %} -! diff --git a/dockers/docker-fpm-frr/frr/supervisord/critical_processes.j2 b/dockers/docker-fpm-frr/frr/supervisord/critical_processes.j2 new file mode 100644 index 000000000000..69f4e8e6931e --- /dev/null +++ b/dockers/docker-fpm-frr/frr/supervisord/critical_processes.j2 @@ -0,0 +1,12 @@ +program:zebra +program:staticd +program:bgpd +program:fpmsyncd +{% if DEVICE_METADATA.localhost.frr_mgmt_framework_config is defined and DEVICE_METADATA.localhost.frr_mgmt_framework_config == "true" %} +program:bfdd +program:ospfd +program:pimd +program:frrcfgd +{%- else %} +program:bgpcfgd +{%- endif %} diff --git a/dockers/docker-fpm-frr/frr/supervisord/supervisord.conf.j2 b/dockers/docker-fpm-frr/frr/supervisord/supervisord.conf.j2 index 205b57e5f616..fec72db761cc 100644 --- a/dockers/docker-fpm-frr/frr/supervisord/supervisord.conf.j2 +++ b/dockers/docker-fpm-frr/frr/supervisord/supervisord.conf.j2 @@ -10,13 +10,14 @@ autorestart=unexpected startretries=0 exitcodes=0,3 events=PROCESS_STATE -buffer_size=50 +buffer_size=1024 [eventlistener:supervisor-proc-exit-listener] command=/usr/bin/supervisor-proc-exit-listener --container-name bgp -events=PROCESS_STATE_EXITED +events=PROCESS_STATE_EXITED,PROCESS_STATE_RUNNING autostart=true autorestart=unexpected +buffer_size=1024 [program:rsyslogd] command=/usr/sbin/rsyslogd -n -iNONE @@ -39,6 +40,17 @@ stderr_logfile=syslog dependent_startup=true dependent_startup_wait_for=rsyslogd:running +[program:zsocket] +command=/usr/bin/zsocket.sh +priority=4 +autostart=false +autorestart=false +startsecs=0 +stdout_logfile=syslog +stderr_logfile=syslog +dependent_startup=true +dependent_startup_wait_for=zebra:running + [program:staticd] command=/usr/lib/frr/staticd -A 127.0.0.1 priority=4 @@ -48,7 +60,21 @@ startsecs=0 stdout_logfile=syslog stderr_logfile=syslog dependent_startup=true +dependent_startup_wait_for=zsocket:exited + +{% if DEVICE_METADATA.localhost.frr_mgmt_framework_config is defined and DEVICE_METADATA.localhost.frr_mgmt_framework_config == "true" %} +[program:bfdd] +command=/usr/lib/frr/bfdd -A 127.0.0.1 +priority=4 +stopsignal=KILL +autostart=false +autorestart=false +startsecs=0 +stdout_logfile=syslog +stderr_logfile=syslog +dependent_startup=true dependent_startup_wait_for=zebra:running +{% endif %} [program:bgpd] command=/usr/lib/frr/bgpd -A 127.0.0.1 -M snmp @@ -60,7 +86,33 @@ startsecs=0 stdout_logfile=syslog stderr_logfile=syslog dependent_startup=true +dependent_startup_wait_for=zsocket:exited + +{% if DEVICE_METADATA.localhost.frr_mgmt_framework_config is defined and DEVICE_METADATA.localhost.frr_mgmt_framework_config == "true" %} +[program:ospfd] +command=/usr/lib/frr/ospfd -A 127.0.0.1 -M snmp +priority=5 +stopsignal=KILL +autostart=false +autorestart=false +startsecs=0 +stdout_logfile=syslog +stderr_logfile=syslog +dependent_startup=true +dependent_startup_wait_for=zebra:running + +[program:pimd] +command=/usr/lib/frr/pimd -A 127.0.0.1 +priority=5 +stopsignal=KILL +autostart=false +autorestart=false +startsecs=0 +stdout_logfile=syslog +stderr_logfile=syslog +dependent_startup=true dependent_startup_wait_for=zebra:running +{% endif %} [program:fpmsyncd] command=fpmsyncd @@ -73,8 +125,13 @@ stderr_logfile=syslog dependent_startup=true dependent_startup_wait_for=bgpd:running +{% if DEVICE_METADATA.localhost.frr_mgmt_framework_config is defined and DEVICE_METADATA.localhost.frr_mgmt_framework_config == "true" %} +[program:frrcfgd] +command=/usr/local/bin/frrcfgd +{% else %} [program:bgpcfgd] command=/usr/local/bin/bgpcfgd +{% endif %} priority=6 autostart=false autorestart=false diff --git a/dockers/docker-fpm-frr/zsocket.sh b/dockers/docker-fpm-frr/zsocket.sh new file mode 100755 index 000000000000..111492f960ed --- /dev/null +++ b/dockers/docker-fpm-frr/zsocket.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env bash + +addr="127.0.0.1" +port=2601 + +function help() +{ + echo "This script aims to ensure zebra is ready to accept connections" + echo "Usage: $0 [options]" + echo "Options:" + echo " -a Zebra address" + echo " -o Zebra port" + exit 1 +} + +while getopts ":a:o:h" opt; do + case "${opt}" in + h) help + ;; + a) addr=${OPTARG} + ;; + o) port=${OPTARG} + ;; + esac +done + +start=$(date +%s.%N) +timeout 5s bash -c -- "until /var/sonic/config_status - -rm -f /var/run/rsyslogd.pid - -supervisorctl start bgpcfgd - -supervisorctl start rsyslogd - -# Start Quagga processes -supervisorctl start zebra -supervisorctl start bgpd - -supervisorctl start fpmsyncd diff --git a/dockers/docker-fpm-quagga/supervisord.conf b/dockers/docker-fpm-quagga/supervisord.conf deleted file mode 100644 index 7397a7428a08..000000000000 --- a/dockers/docker-fpm-quagga/supervisord.conf +++ /dev/null @@ -1,65 +0,0 @@ -[supervisord] -logfile_maxbytes=1MB -logfile_backups=2 -nodaemon=true - -[eventlistener:supervisor-proc-exit-listener] -command=/usr/bin/supervisor-proc-exit-listener --container-name bgp -events=PROCESS_STATE_EXITED -autostart=true -autorestart=unexpected - -[program:start.sh] -command=/usr/bin/start.sh -priority=1 -autostart=true -autorestart=false -startsecs=0 -stdout_logfile=syslog -stderr_logfile=syslog - -[program:bgpcfgd] -command=/usr/bin/bgpcfgd -priority=2 -autostart=false -autorestart=false -startsecs=0 -stdout_logfile=syslog -stderr_logfile=syslog - -[program:rsyslogd] -command=/usr/sbin/rsyslogd -n -priority=3 -autostart=false -autorestart=unexpected -startsecs=0 -stdout_logfile=syslog -stderr_logfile=syslog - -[program:zebra] -command=/usr/lib/quagga/zebra -A 127.0.0.1 -priority=4 -autostart=false -autorestart=false -startsecs=0 -stdout_logfile=syslog -stderr_logfile=syslog - -[program:bgpd] -command=/usr/lib/quagga/bgpd -A 127.0.0.1 -F -priority=5 -stopsignal=KILL -autostart=false -autorestart=false -startsecs=0 -stdout_logfile=syslog -stderr_logfile=syslog - -[program:fpmsyncd] -command=fpmsyncd -priority=6 -autostart=false -autorestart=false -startsecs=0 -stdout_logfile=syslog -stderr_logfile=syslog diff --git a/dockers/docker-fpm-quagga/unisolate.j2 b/dockers/docker-fpm-quagga/unisolate.j2 deleted file mode 100755 index abd6a912c0d5..000000000000 --- a/dockers/docker-fpm-quagga/unisolate.j2 +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash -## vtysh only accepts script in stdin, so cannot be directly used in shebang -## Cut the tail of this script and feed vtysh stdin -sed -n -e '9,$p' < "$0" | vtysh "$@" -## Exit with vtysh return code -exit $? - -## vtysh script start from next line, which line number MUST equal in 'sed' command above - -configure terminal - router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }} -{% for neighbor_ip in BGP_NEIGHBOR %} -{% if neighbor_ip | ipv4 %} - no neighbor {{ neighbor_ip }} route-map ISOLATE out -{% else %} - address-family ipv6 - no neighbor {{ neighbor_ip }} route-map ISOLATE out - exit-address-family -{% endif %} -{% endfor %} - exit -exit - -{% for neighbor_ip in BGP_NEIGHBOR %} -clear ip bgp {{ neighbor_ip }} soft out -{% endfor %} diff --git a/dockers/docker-fpm-quagga/zebra.conf.j2 b/dockers/docker-fpm-quagga/zebra.conf.j2 deleted file mode 100644 index c0357eaed86a..000000000000 --- a/dockers/docker-fpm-quagga/zebra.conf.j2 +++ /dev/null @@ -1,78 +0,0 @@ -! -{% block banner %} -! =========== Managed by sonic-cfggen DO NOT edit manually! ==================== -! generated by templates/quagga/zebra.conf.j2 using config DB data -! file: zebra.conf -! -{% endblock banner %} -! -{% block sys_init %} -hostname {{ DEVICE_METADATA['localhost']['hostname'] }} -password zebra -enable password zebra -{% endblock sys_init %} -! -{% block interfaces %} -! Enable link-detect (default disabled) -{% for (name, prefix) in INTERFACE|pfx_filter %} -interface {{ name }} -link-detect -! -{% endfor %} -{% for pc in PORTCHANNEL %} -interface {{ pc }} -link-detect -! -{% endfor %} -{% endblock interfaces %} -! -{% block default_route %} -! set static default route to mgmt gateway as a backup to learned default -{% for (name, prefix) in MGMT_INTERFACE|pfx_filter %} -{% if prefix | ipv4 %} -ip route 0.0.0.0/0 {{ MGMT_INTERFACE[(name, prefix)]['gwaddr'] }} 200 -{% endif %} -{% endfor %} -{% endblock default_route %} -! -{% block source_loopback %} -{% set lo_ipv4_addrs = [] %} -{% set lo_ipv6_addrs = [] %} -{% if LOOPBACK_INTERFACE %} -{% for (name, prefix) in LOOPBACK_INTERFACE|pfx_filter %} -{% if name == 'Loopback0' %} -{% if prefix | ipv6 %} -{% if lo_ipv6_addrs.append(prefix) %} -{% endif %} -{% else %} -{% if lo_ipv4_addrs.append(prefix) %} -{% endif %} -{% endif %} -{% endif %} -{% endfor %} -{% endif %} -! Set ip source to loopback for bgp learned routes -{% if lo_ipv4_addrs|length > 0 -%} -route-map RM_SET_SRC permit 10 - set src {{ lo_ipv4_addrs[0] | ip }} -! -{% endif %} -{% if lo_ipv6_addrs|length > 0 %} -route-map RM_SET_SRC6 permit 10 - set src {{ lo_ipv6_addrs[0] | ip }} -! -{% endif %} -ip protocol bgp route-map RM_SET_SRC -! -{% if lo_ipv6_addrs|length > 0 %} -ipv6 protocol bgp route-map RM_SET_SRC6 -! -{% endif %} -{% endblock source_loopback %} -! -{% block logging %} -log syslog informational -log facility local4 -{% endblock logging %} -! - diff --git a/dockers/docker-iccpd/iccpd.j2 b/dockers/docker-iccpd/iccpd.j2 index 6c6f9fab1afa..fa7543422cca 100644 --- a/dockers/docker-iccpd/iccpd.j2 +++ b/dockers/docker-iccpd/iccpd.j2 @@ -2,7 +2,7 @@ mclag_id:{{mclag_id}} local_ip:{{MC_LAG[mclag_id]['local_ip']}} peer_ip:{{MC_LAG[mclag_id]['peer_ip']}} -{% if MC_LAG[mclag_id].has_key('peer_link') %} +{% if 'peer_link' in MC_LAG[mclag_id] %} peer_link:{{MC_LAG[mclag_id]['peer_link']}} {% endif %} mclag_interface:{{MC_LAG[mclag_id]['mclag_interface']}} diff --git a/dockers/docker-iccpd/start.sh b/dockers/docker-iccpd/start.sh index f2e9807f314f..bba5e490c466 100644 --- a/dockers/docker-iccpd/start.sh +++ b/dockers/docker-iccpd/start.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash - +set -e ICCPD_CONF_PATH=/etc/iccpd diff --git a/dockers/docker-iccpd/supervisord.conf b/dockers/docker-iccpd/supervisord.conf index 716ca96b40c8..323389aca3e2 100644 --- a/dockers/docker-iccpd/supervisord.conf +++ b/dockers/docker-iccpd/supervisord.conf @@ -10,6 +10,7 @@ autorestart=unexpected startretries=0 exitcodes=0,3 events=PROCESS_STATE +buffer_size=1024 [program:rsyslogd] command=/usr/sbin/rsyslogd -n -iNONE diff --git a/dockers/docker-lldp/Dockerfile.j2 b/dockers/docker-lldp/Dockerfile.j2 index 297f7766519b..a1c7a1c1bee2 100644 --- a/dockers/docker-lldp/Dockerfile.j2 +++ b/dockers/docker-lldp/Dockerfile.j2 @@ -43,6 +43,7 @@ COPY ["start.sh", "/usr/bin/"] COPY ["waitfor_lldp_ready.sh", "/usr/bin/"] COPY ["supervisord.conf.j2", "/usr/share/sonic/templates/"] COPY ["lldpd.conf.j2", "/usr/share/sonic/templates/"] +COPY ["lldpdSysDescr.conf.j2", "/usr/share/sonic/templates/"] COPY ["lldpd", "/etc/default/"] COPY ["lldpmgrd", "/usr/bin/"] COPY ["files/supervisor-proc-exit-listener", "/usr/bin"] diff --git a/dockers/docker-lldp/base_image_files/monit_lldp b/dockers/docker-lldp/base_image_files/monit_lldp deleted file mode 100644 index d470972ace30..000000000000 --- a/dockers/docker-lldp/base_image_files/monit_lldp +++ /dev/null @@ -1,15 +0,0 @@ -############################################################################### -## Monit configuration for lldp container -## process list: -## lldpd -## lldp-syncd -## lldpmgrd -############################################################################### -check program lldp|lldpd_monitor with path "/usr/bin/process_checker lldp lldpd:" - if status != 0 for 5 times within 5 cycles then alert repeat every 1 cycles - -check program lldp|lldp_syncd with path "/usr/bin/process_checker lldp python3 -m lldp_syncd" - if status != 0 for 5 times within 5 cycles then alert repeat every 1 cycles - -check program lldp|lldpmgrd with path "/usr/bin/process_checker lldp python3 /usr/bin/lldpmgrd" - if status != 0 for 5 times within 5 cycles then alert repeat every 1 cycles diff --git a/dockers/docker-lldp/lldpdSysDescr.conf.j2 b/dockers/docker-lldp/lldpdSysDescr.conf.j2 new file mode 100644 index 000000000000..047b3c68b34f --- /dev/null +++ b/dockers/docker-lldp/lldpdSysDescr.conf.j2 @@ -0,0 +1 @@ +configure system description "SONiC Software Version: SONiC.{{ build_version }} - HwSku: {{ DEVICE_METADATA['localhost']['hwsku'] }} - Distribution: Debian {{ debian_version }} - Kernel: {{ kernel_version }}" diff --git a/dockers/docker-lldp/lldpmgrd b/dockers/docker-lldp/lldpmgrd index 61d6034faa15..af45e79762d1 100755 --- a/dockers/docker-lldp/lldpmgrd +++ b/dockers/docker-lldp/lldpmgrd @@ -50,23 +50,59 @@ class LldpManager(daemon_base.DaemonBase): # Open a handle to the Config database self.config_db = swsscommon.DBConnector("CONFIG_DB", self.REDIS_TIMEOUT_MS, - True) + False) # Open a handle to the Application database self.appl_db = swsscommon.DBConnector("APPL_DB", self.REDIS_TIMEOUT_MS, - True) + False) self.pending_cmds = {} + self.hostname = "None" + self.mgmt_ip = "None" + + self.device_table = swsscommon.Table(self.config_db, swsscommon.CFG_DEVICE_METADATA_TABLE_NAME) + self.port_table = swsscommon.Table(self.config_db, swsscommon.CFG_PORT_TABLE_NAME) + self.mgmt_table = swsscommon.Table(self.config_db, swsscommon.CFG_MGMT_INTERFACE_TABLE_NAME) + self.app_port_table = swsscommon.Table(self.appl_db, swsscommon.APP_PORT_TABLE_NAME) + + def update_hostname(self, hostname): + cmd = "lldpcli configure system hostname {0}".format(hostname) + self.log_debug("Running command: '{}'".format(cmd)) + + proc = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + (stdout, stderr) = proc.communicate() + + if proc.returncode != 0: + self.log_warning("Command failed '{}': {}".format(cmd, stderr)) + else: + self.hostname = hostname + + def update_mgmt_addr(self, ip): + if ip == "None": + cmd = "lldpcli unconfigure system ip management pattern" + self.log_info("Mgmt IP {0} deleted".format(self.mgmt_ip)) + else: + cmd = "lldpcli configure system ip management pattern {0}".format(ip) + self.log_info("Mgmt IP changed old ip {0}, new ip {1}".format(self.mgmt_ip, ip)) + + self.log_debug("Running command: '{}'".format(cmd)) + + proc = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + (stdout, stderr) = proc.communicate() + + if proc.returncode != 0: + self.log_warning("Command failed '{}': {}".format(cmd, stderr)) + else: + self.mgmt_ip = ip def is_port_up(self, port_name): """ - Determine if a port is up or down by looking into the oper-status for the port in + Determine if a port is up or down by looking into the oper-status for the port in PORT TABLE in the Application DB """ # Retrieve all entires for this port from the Port table - port_table = swsscommon.Table(self.appl_db, swsscommon.APP_PORT_TABLE_NAME) - (status, fvp) = port_table.get(port_name) + (status, fvp) = self.app_port_table.get(port_name) if status: # Convert list of tuples to a dictionary port_table_dict = dict(fvp) @@ -80,7 +116,7 @@ class LldpManager(daemon_base.DaemonBase): return False else: # Retrieve PortInitDone entry from the Port table - (init_status, init_fvp) = port_table.get("PortInitDone") + (init_status, init_fvp) = self.port_table.get("PortInitDone") # The initialization procedure is done, but don't have this port entry if init_status: self.log_error("Port '{}' not found in {} table in App DB".format( @@ -95,8 +131,7 @@ class LldpManager(daemon_base.DaemonBase): port_desc = None # Retrieve all entires for this port from the Port table - port_table = swsscommon.Table(self.config_db, swsscommon.CFG_PORT_TABLE_NAME) - (status, fvp) = port_table.get(port_name) + (status, fvp) = self.port_table.get(port_name) if status: # Convert list of tuples to a dictionary port_table_dict = dict(fvp) @@ -150,6 +185,56 @@ class LldpManager(daemon_base.DaemonBase): for port_name in to_delete: self.pending_cmds.pop(port_name, None) + def lldp_get_mgmt_ip(self): + mgmt_intf_keys = self.mgmt_table.getKeys() + ipv4_addr = "None" + ipv6_addr = "None" + for key in mgmt_intf_keys: + if '|' in key: + key = key.split('|', 1) + if '/' in key[1]: + ip = key[1].split('/', 1) + if self.mgmt_ip != ip[0]: + if '.' in ip[0]: + ipv4_addr = ip[0] + else: + ipv6_addr = ip[0] + + if ipv4_addr != "None": + return ipv4_addr + elif ipv6_addr != "None": + return ipv6_addr + else: + return "None" + + def lldp_process_mgmt_info_change(self, op, mgmt_dict, key): + if not op in ["SET", "DEL"]: + return + self.log_info("Mgmt Config Opcode: {} Dict {} Key {} Curr {}".format(op, mgmt_dict, key, self.mgmt_ip)) + if '|' in key: + key = key.split('|', 1) + if '/' in key[1]: + ip = key[1].split('/', 1) + if op == "DEL": + if self.mgmt_ip == ip[0]: + ip_addr = self.lldp_get_mgmt_ip() + self.update_mgmt_addr(ip_addr) + else: + if not self.mgmt_ip == ip[0]: + if '.' in ip[0]: + self.update_mgmt_addr(ip[0]) + elif '.' not in self.mgmt_ip: + self.update_mgmt_addr(ip[0]) + + def lldp_process_device_table_event(self, op, device_dict, key): + if not op in ["SET", "DEL"]: + return + self.log_info("Device Config Opcode: {} Dict {} Key {}".format(op, device_dict, key)) + hostname = device_dict.get("hostname") + if not self.hostname == hostname: + self.log_info("Hostname changed old {0}, new {1}".format(self.hostname, hostname)) + self.update_hostname(hostname) + def run(self): """ Subscribes to notifications of changes in the PORT table @@ -185,6 +270,14 @@ class LldpManager(daemon_base.DaemonBase): sst_appdb = swsscommon.SubscriberStateTable(self.appl_db, swsscommon.APP_PORT_TABLE_NAME) sel.addSelectable(sst_appdb) + # Subscribe to MGMT PORT table notifications in the Config DB + sst_mgmt_ip_confdb = swsscommon.SubscriberStateTable(self.config_db, swsscommon.CFG_MGMT_INTERFACE_TABLE_NAME) + sel.addSelectable(sst_mgmt_ip_confdb) + + # Subscribe to DEVICE_METADATA table notifications in the Config DB + sst_device_confdb = swsscommon.SubscriberStateTable(self.config_db, swsscommon.CFG_DEVICE_METADATA_TABLE_NAME) + sel.addSelectable(sst_device_confdb) + # Listen for changes to the PORT table in the CONFIG_DB and APP_DB while True: (state, c) = sel.select(SELECT_TIMEOUT_MS) @@ -201,6 +294,14 @@ class LldpManager(daemon_base.DaemonBase): else: self.pending_cmds.pop(key, None) + (key, op, fvp) = sst_mgmt_ip_confdb.pop() + if key: + self.lldp_process_mgmt_info_change(op, dict(fvp), key) + + (key, op, fvp) = sst_device_confdb.pop() + if key: + self.lldp_process_device_table_event(op, dict(fvp), key) + (key, op, fvp) = sst_appdb.pop() if (key != "PortInitDone") and (key != "PortConfigDone"): if fvp: diff --git a/dockers/docker-lldp/start.sh b/dockers/docker-lldp/start.sh index b2c82d6d0437..5a489884aea9 100755 --- a/dockers/docker-lldp/start.sh +++ b/dockers/docker-lldp/start.sh @@ -1,4 +1,10 @@ #!/usr/bin/env bash +CFGGEN_PARAMS=" \ + -d \ + -t /usr/share/sonic/templates/lldpd.conf.j2 \ + -y /etc/sonic/sonic_version.yml \ + -t /usr/share/sonic/templates/lldpdSysDescr.conf.j2 \ +" if [ "${RUNTIME_OWNER}" == "" ]; then RUNTIME_OWNER="kube" @@ -10,7 +16,7 @@ then ${CTR_SCRIPT} -f lldp -o ${RUNTIME_OWNER} -v ${IMAGE_VERSION} fi -sonic-cfggen -d -t /usr/share/sonic/templates/lldpd.conf.j2 > /etc/lldpd.conf +sonic-cfggen $CFGGEN_PARAMS > /etc/lldpd.conf mkdir -p /var/sonic echo "# Config files managed by sonic-config-engine" > /var/sonic/config_status diff --git a/dockers/docker-lldp/supervisord.conf.j2 b/dockers/docker-lldp/supervisord.conf.j2 index 4692f7bf2a18..48f0a6c91f64 100644 --- a/dockers/docker-lldp/supervisord.conf.j2 +++ b/dockers/docker-lldp/supervisord.conf.j2 @@ -10,13 +10,14 @@ autorestart=unexpected startretries=0 exitcodes=0,3 events=PROCESS_STATE -buffer_size=25 +buffer_size=1024 [eventlistener:supervisor-proc-exit-listener] command=/usr/bin/supervisor-proc-exit-listener --container-name lldp -events=PROCESS_STATE_EXITED +events=PROCESS_STATE_EXITED,PROCESS_STATE_RUNNING autostart=true autorestart=unexpected +buffer_size=1024 [program:rsyslogd] command=/usr/sbin/rsyslogd -n -iNONE diff --git a/dockers/docker-mux/Dockerfile.j2 b/dockers/docker-mux/Dockerfile.j2 new file mode 100755 index 000000000000..66ec315f0809 --- /dev/null +++ b/dockers/docker-mux/Dockerfile.j2 @@ -0,0 +1,36 @@ +{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %} +FROM docker-config-engine-buster + +ARG docker_container_name +RUN [ -f /etc/rsyslog.conf ] && sed -ri "s/%syslogtag%/$docker_container_name#%syslogtag%/;" /etc/rsyslog.conf + +## Make apt-get non-interactive +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt-get update && \ + apt-get install -f -y \ + libmnl0 + +{% if docker_mux_debs.strip() -%} +# Copy locally-built Debian package dependencies +{{ copy_files("debs/", docker_mux_debs.split(' '), "/debs/") }} + +# Install locally-built Debian packages and implicitly install their dependencies +{{ install_debian_packages(docker_mux_debs.split(' ')) }} +{%- endif %} + +## Clean up +RUN apt-get clean -y && \ + apt-get autoclean -y && \ + apt-get autoremove -y && \ + rm -rf /debs + +COPY ["docker-init.sh", "/usr/bin/"] +COPY ["supervisord.conf", "/etc/supervisor/conf.d/"] +COPY ["files/supervisor-proc-exit-listener", "/usr/bin"] +COPY ["critical_processes", "/etc/supervisor/"] + +## Copy all Jinja2 template files into the templates folder +COPY ["*.j2", "/usr/share/sonic/templates/"] + +ENTRYPOINT ["/usr/bin/docker-init.sh"] diff --git a/dockers/docker-mux/critical_processes b/dockers/docker-mux/critical_processes new file mode 100644 index 000000000000..eb2568f1ef2b --- /dev/null +++ b/dockers/docker-mux/critical_processes @@ -0,0 +1 @@ +program:linkmgrd diff --git a/dockers/docker-mux/docker-init.sh b/dockers/docker-mux/docker-init.sh new file mode 100755 index 000000000000..bea1686132a1 --- /dev/null +++ b/dockers/docker-mux/docker-init.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +# Generate supervisord config file +mkdir -p /etc/supervisor/conf.d/ + +# The docker container should start this script as PID 1, so now that supervisord is +# properly configured, we exec supervisord so that it runs as PID 1 for the +# duration of the container's lifetime +exec /usr/local/bin/supervisord diff --git a/dockers/docker-mux/supervisord.conf b/dockers/docker-mux/supervisord.conf new file mode 100644 index 000000000000..33eb650e85d4 --- /dev/null +++ b/dockers/docker-mux/supervisord.conf @@ -0,0 +1,40 @@ +[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=100 + +[eventlistener:supervisor-proc-exit-listener] +command=/usr/bin/supervisor-proc-exit-listener --container-name mux +events=PROCESS_STATE_EXITED,PROCESS_STATE_RUNNING +autostart=true +autorestart=unexpected + +[program:rsyslogd] +command=/usr/sbin/rsyslogd -n -iNONE +priority=1 +autostart=false +autorestart=unexpected +stdout_logfile=syslog +stderr_logfile=syslog +dependent_startup=true + +[program:linkmgrd] +command=nice -n -20 /usr/sbin/linkmgrd -v warning -d +priority=2 +autostart=false +autorestart=false +startsecs=0 +startretries=0 +stdout_logfile=syslog +stderr_logfile=syslog +dependent_startup=true +dependent_startup_wait_for=rsyslogd:running diff --git a/dockers/docker-nat/Dockerfile.j2 b/dockers/docker-nat/Dockerfile.j2 index 36a178a68af2..066de0a70ed0 100644 --- a/dockers/docker-nat/Dockerfile.j2 +++ b/dockers/docker-nat/Dockerfile.j2 @@ -1,5 +1,5 @@ {% from "dockers/dockerfile-macros.j2" import install_debian_packages, copy_files %} -FROM docker-config-engine-buster +FROM docker-swss-layer-buster ARG docker_container_name RUN [ -f /etc/rsyslog.conf ] && sed -ri "s/%syslogtag%/$docker_container_name#%syslogtag%/;" /etc/rsyslog.conf diff --git a/dockers/docker-nat/supervisord.conf b/dockers/docker-nat/supervisord.conf index 8555f2a48ae6..8d7e184efc49 100644 --- a/dockers/docker-nat/supervisord.conf +++ b/dockers/docker-nat/supervisord.conf @@ -10,13 +10,14 @@ autorestart=unexpected startretries=0 exitcodes=0,3 events=PROCESS_STATE -buffer_size=25 +buffer_size=1024 [eventlistener:supervisor-proc-exit-listener] command=/usr/bin/supervisor-proc-exit-listener --container-name nat -events=PROCESS_STATE_EXITED +events=PROCESS_STATE_EXITED,PROCESS_STATE_RUNNING autostart=true autorestart=unexpected +buffer_size=1024 [program:rsyslogd] command=/usr/sbin/rsyslogd -n -iNONE diff --git a/dockers/docker-orchagent/Dockerfile.j2 b/dockers/docker-orchagent/Dockerfile.j2 index 17c0983c58b2..007f7808239d 100755 --- a/dockers/docker-orchagent/Dockerfile.j2 +++ b/dockers/docker-orchagent/Dockerfile.j2 @@ -1,5 +1,5 @@ {% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %} -FROM docker-config-engine-buster +FROM docker-swss-layer-buster ARG docker_container_name RUN [ -f /etc/rsyslog.conf ] && sed -ri "s/%syslogtag%/$docker_container_name#%syslogtag%/;" /etc/rsyslog.conf @@ -19,14 +19,17 @@ RUN apt-get update && \ bridge-utils \ conntrack \ ndppd \ + pciutils \ # Needed for installing netifaces Python package build-essential \ python3-dev {% if ( CONFIGURED_ARCH == "armhf" or CONFIGURED_ARCH == "arm64" ) %} -# Fix for gcc/python not found in arm docker +# Fix for gcc/python/iputils-ping not found in arm docker RUN apt-get install -f -y python2.7 python2.7-dev -RUN apt-get install -y gcc-8 +RUN apt-get install -y \ + gcc-8 \ + iputils-ping {% endif %} {% if CONFIGURED_ARCH == "armhf" %} RUN ln -s -f /usr/bin/gcc-8 /usr/bin/arm-linux-gnueabihf-gcc @@ -37,7 +40,6 @@ RUN ln -s -f /usr/bin/gcc-8 /usr/bin/aarch64-linux-gnu-gcc # Dependencies of restore_neighbors.py RUN pip3 install \ - scapy==2.4.4 \ pyroute2==0.5.14 \ netifaces==0.10.9 @@ -54,6 +56,14 @@ RUN apt-get remove -y gcc-8 {{ install_debian_packages(docker_orchagent_debs.split(' ')) }} {%- endif %} +{% if docker_orchagent_whls.strip() -%} +# Copy locally-built Python wheel dependencies +{{ copy_files("python-wheels/", docker_orchagent_whls.split(' '), "/python-wheels/") }} + +# Install locally-built Python wheel dependencies +{{ install_python_wheels(docker_orchagent_whls.split(' ')) }} +{% endif %} + # Clean up RUN apt-get purge -y \ build-essential \ @@ -61,12 +71,12 @@ RUN apt-get purge -y \ apt-get clean -y && \ apt-get autoclean -y && \ apt-get autoremove -y && \ - rm -rf /debs + rm -rf /debs ~/.cache COPY ["files/arp_update", "/usr/bin"] COPY ["arp_update.conf", "files/arp_update_vars.j2", "/usr/share/sonic/templates/"] -COPY ["ndppd.conf", "/usr/share/sonic/templates/"] -COPY ["enable_counters.py", "/usr/bin"] +COPY ["ndppd.conf", "tunnel_packet_handler.conf", "/usr/share/sonic/templates/"] +COPY ["enable_counters.py", "tunnel_packet_handler.py", "/usr/bin/"] COPY ["docker-init.sh", "orchagent.sh", "swssconfig.sh", "buffermgrd.sh", "/usr/bin/"] COPY ["supervisord.conf", "/etc/supervisor/conf.d/"] COPY ["files/supervisor-proc-exit-listener", "/usr/bin"] diff --git a/dockers/docker-orchagent/base_image_files/monit_swss b/dockers/docker-orchagent/base_image_files/monit_swss deleted file mode 100644 index 1dcf4bf9b6d9..000000000000 --- a/dockers/docker-orchagent/base_image_files/monit_swss +++ /dev/null @@ -1,56 +0,0 @@ -############################################################################### -## Monit configuration for swss container -## process list: -## orchagent -## portsyncd -## neighsyncd -## fdbsyncd -## vrfmgrd -## vlanmgrd -## intfmgrd -## portmgrd -## buffermgrd -## nbrmgrd -## vxlanmgrd -## coppmgrd -## tunnelmgrd - -############################################################################## -check program swss|orchagent with path "/usr/bin/process_checker swss /usr/bin/orchagent -d /var/log/swss" - if status != 0 for 5 times within 5 cycles then alert repeat every 1 cycles - -check program swss|portsyncd with path "/usr/bin/process_checker swss /usr/bin/portsyncd" - if status != 0 for 5 times within 5 cycles then alert repeat every 1 cycles - -check program swss|neighsyncd with path "/usr/bin/process_checker swss /usr/bin/neighsyncd" - if status != 0 for 5 times within 5 cycles then alert repeat every 1 cycles - -check program swss|fdbsyncd with path "/usr/bin/process_checker swss /usr/bin/fdbsyncd" - if status != 0 for 5 times within 5 cycles then alert repeat every 1 cycles - -check program swss|vrfmgrd with path "/usr/bin/process_checker swss /usr/bin/vrfmgrd" - if status != 0 for 5 times within 5 cycles then alert repeat every 1 cycles - -check program swss|vlanmgrd with path "/usr/bin/process_checker swss /usr/bin/vlanmgrd" - if status != 0 for 5 times within 5 cycles then alert repeat every 1 cycles - -check program swss|intfmgrd with path "/usr/bin/process_checker swss /usr/bin/intfmgrd" - if status != 0 for 5 times within 5 cycles then alert repeat every 1 cycles - -check program swss|portmgrd with path "/usr/bin/process_checker swss /usr/bin/portmgrd" - if status != 0 for 5 times within 5 cycles then alert repeat every 1 cycles - -check program swss|buffermgrd with path "/usr/bin/process_checker swss /usr/bin/buffermgrd -l" - if status != 0 for 5 times within 5 cycles then alert repeat every 1 cycles - -check program swss|nbrmgrd with path "/usr/bin/process_checker swss /usr/bin/nbrmgrd" - if status != 0 for 5 times within 5 cycles then alert repeat every 1 cycles - -check program swss|vxlanmgrd with path "/usr/bin/process_checker swss /usr/bin/vxlanmgrd" - if status != 0 for 5 times within 5 cycles then alert repeat every 1 cycles - -check program swss|coppmgrd with path "/usr/bin/process_checker swss /usr/bin/coppmgrd" - if status != 0 for 5 times within 5 cycles then alert repeat every 1 cycles - -check program swss|tunnelmgrd with path "/usr/bin/process_checker swss /usr/bin/tunnelmgrd" - if status != 0 for 5 times within 5 cycles then alert repeat every 1 cycles diff --git a/dockers/docker-orchagent/buffermgrd.sh b/dockers/docker-orchagent/buffermgrd.sh index 1d09cfc7d6ee..b5ddaab7df0e 100755 --- a/dockers/docker-orchagent/buffermgrd.sh +++ b/dockers/docker-orchagent/buffermgrd.sh @@ -3,14 +3,16 @@ BUFFER_CALCULATION_MODE=$(redis-cli -n 4 hget "DEVICE_METADATA|localhost" buffer_model) if [ "$BUFFER_CALCULATION_MODE" == "dynamic" ]; then + BUFFERMGRD_ARGS="-a /etc/sonic/asic_table.json" if [ -f /etc/sonic/peripheral_table.json ]; then - BUFFERMGRD_ARGS="-a /etc/sonic/asic_table.json -p /etc/sonic/peripheral_table.json" - else - BUFFERMGRD_ARGS="-a /etc/sonic/asic_table.json" + BUFFERMGRD_PERIPHERIAL_ARGS=" -p /etc/sonic/peripheral_table.json" + fi + if [ -f /etc/sonic/zero_profiles.json ]; then + BUFFERMGRD_ZERO_PROFILE_ARGS=" -z /etc/sonic/zero_profiles.json" fi else # Should we use the fallback MAC in case it is not found in Device.Metadata BUFFERMGRD_ARGS="-l /usr/share/sonic/hwsku/pg_profile_lookup.ini" fi -exec /usr/bin/buffermgrd ${BUFFERMGRD_ARGS} +exec /usr/bin/buffermgrd ${BUFFERMGRD_ARGS} ${BUFFERMGRD_PERIPHERIAL_ARGS} ${BUFFERMGRD_ZERO_PROFILE_ARGS} diff --git a/dockers/docker-orchagent/docker-init.sh b/dockers/docker-orchagent/docker-init.sh index 5bf5bf2d06cf..7e55d40f59c2 100755 --- a/dockers/docker-orchagent/docker-init.sh +++ b/dockers/docker-orchagent/docker-init.sh @@ -10,8 +10,17 @@ CFGGEN_PARAMS=" \ -t /usr/share/sonic/templates/ports.json.j2,/etc/swss/config.d/ports.json \ -t /usr/share/sonic/templates/vlan_vars.j2 \ -t /usr/share/sonic/templates/ndppd.conf.j2,/etc/ndppd.conf \ + -t /usr/share/sonic/templates/wait_for_link.sh.j2,/usr/bin/wait_for_link.sh \ " VLAN=$(sonic-cfggen $CFGGEN_PARAMS) +SUBTYPE=$(sonic-cfggen -d -v "DEVICE_METADATA['localhost']['subtype']") + +chmod +x /usr/bin/wait_for_link.sh + +# Executed platform specific initialization tasks. +if [ -x /usr/share/sonic/platform/platform-init ]; then + /usr/share/sonic/platform/platform-init +fi # Executed HWSKU specific initialization tasks. if [ -x /usr/share/sonic/hwsku/hwsku-init ]; then @@ -24,4 +33,8 @@ if [ "$VLAN" != "" ]; then cp /usr/share/sonic/templates/ndppd.conf /etc/supervisor/conf.d/ fi +if [ "$SUBTYPE" == "DualToR" ]; then + cp /usr/share/sonic/templates/tunnel_packet_handler.conf /etc/supervisor/conf.d/ +fi + exec /usr/local/bin/supervisord diff --git a/dockers/docker-orchagent/enable_counters.py b/dockers/docker-orchagent/enable_counters.py index 6c938230d210..0c966593f5b2 100755 --- a/dockers/docker-orchagent/enable_counters.py +++ b/dockers/docker-orchagent/enable_counters.py @@ -11,10 +11,12 @@ def enable_counter_group(db, name): - info = {} - info['FLEX_COUNTER_STATUS'] = 'enable' - db.mod_entry("FLEX_COUNTER_TABLE", name, info) + entry_info = db.get_entry("FLEX_COUNTER_TABLE", name) + if not entry_info: + info = {} + info['FLEX_COUNTER_STATUS'] = 'enable' + db.mod_entry("FLEX_COUNTER_TABLE", name, info) def enable_rates(): # set the default interval for rates @@ -24,6 +26,8 @@ def enable_rates(): counters_db.set('COUNTERS_DB', 'RATES:PORT', 'PORT_ALPHA', DEFAULT_ALPHA) counters_db.set('COUNTERS_DB', 'RATES:RIF', 'RIF_SMOOTH_INTERVAL', DEFAULT_SMOOTH_INTERVAL) counters_db.set('COUNTERS_DB', 'RATES:RIF', 'RIF_ALPHA', DEFAULT_ALPHA) + counters_db.set('COUNTERS_DB', 'RATES:TUNNEL', 'TUNNEL_SMOOTH_INTERVAL', DEFAULT_SMOOTH_INTERVAL) + counters_db.set('COUNTERS_DB', 'RATES:TUNNEL', 'TUNNEL_ALPHA', DEFAULT_ALPHA) def enable_counters(): @@ -34,6 +38,7 @@ def enable_counters(): enable_counter_group(db, 'QUEUE') enable_counter_group(db, 'PFCWD') enable_counter_group(db, 'PG_WATERMARK') + enable_counter_group(db, 'PG_DROP') enable_counter_group(db, 'QUEUE_WATERMARK') enable_counter_group(db, 'BUFFER_POOL_WATERMARK') enable_counter_group(db, 'PORT_BUFFER_DROP') diff --git a/dockers/docker-orchagent/ipinip.json.j2 b/dockers/docker-orchagent/ipinip.json.j2 index cbfeb784b057..9cdf6857bddd 100644 --- a/dockers/docker-orchagent/ipinip.json.j2 +++ b/dockers/docker-orchagent/ipinip.json.j2 @@ -5,7 +5,7 @@ {% if DEVICE_METADATA['localhost']['sub_role'] == 'FrontEnd' or DEVICE_METADATA['localhost']['sub_role'] == 'BackEnd'%} {% set loopback_intf_names = ['Loopback0', 'Loopback4096'] %} {% else %} -{% set loopback_intf_names = ['Loopback0'] %} +{% set loopback_intf_names = ['Loopback0', 'Loopback2', 'Loopback3'] %} {% endif %} {% for (name, prefix) in LOOPBACK_INTERFACE|pfx_filter %} {%- if prefix | ipv4 and name in loopback_intf_names %} @@ -47,11 +47,10 @@ "TUNNEL_DECAP_TABLE:IPINIP_TUNNEL" : { "tunnel_type":"IPINIP", "dst_ip":"{% for prefix in ipv4_addresses|sort %}{{ prefix | ip }}{% if not loop.last %},{% endif %}{% endfor %}", -{% if "mlnx" in DEVICE_METADATA.localhost.platform %} "dscp_mode":"uniform", +{% if "mlnx" in DEVICE_METADATA.localhost.platform %} "ecn_mode":"standard", {% else %} - "dscp_mode":"pipe", "ecn_mode":"copy_from_outer", {% endif %} "ttl_mode":"pipe" @@ -66,11 +65,10 @@ "TUNNEL_DECAP_TABLE:IPINIP_V6_TUNNEL" : { "tunnel_type":"IPINIP", "dst_ip":"{% for prefix in ipv6_addresses|sort %}{{ prefix | ip }}{% if not loop.last %},{% endif %}{% endfor %}", -{% if "mlnx" in DEVICE_METADATA.localhost.platform %} "dscp_mode":"uniform", +{% if "mlnx" in DEVICE_METADATA.localhost.platform %} "ecn_mode":"standard", {% else %} - "dscp_mode":"pipe", "ecn_mode":"copy_from_outer", {% endif %} "ttl_mode":"pipe" diff --git a/dockers/docker-orchagent/ndppd.conf b/dockers/docker-orchagent/ndppd.conf index 1e97bf97e313..86297de94a45 100644 --- a/dockers/docker-orchagent/ndppd.conf +++ b/dockers/docker-orchagent/ndppd.conf @@ -1,9 +1,20 @@ [program:ndppd] -command=bash -c "/usr/sbin/ndppd | /usr/bin/logger" +command=/usr/sbin/ndppd priority=7 autostart=false autorestart=unexpected stdout_logfile=syslog stderr_logfile=syslog dependent_startup=true +dependent_startup_wait_for=wait_for_link:exited + +[program:wait_for_link] +command=/usr/bin/wait_for_link.sh +priority=7 +autostart=false +autorestart=false +startsecs=0 +stdout_logfile=syslog +stderr_logfile=syslog +dependent_startup=true dependent_startup_wait_for=swssconfig:exited \ No newline at end of file diff --git a/dockers/docker-orchagent/ndppd.conf.j2 b/dockers/docker-orchagent/ndppd.conf.j2 index bc375f3c4987..dbb70734680d 100644 --- a/dockers/docker-orchagent/ndppd.conf.j2 +++ b/dockers/docker-orchagent/ndppd.conf.j2 @@ -21,7 +21,7 @@ {% set _x = proxy_interfaces[intf].append(prefix) %} {% endif %} {% endfor -%} - +route-ttl 2147483647 {% for intf, prefix_list in proxy_interfaces.items() %} {% if prefix_list %} diff --git a/dockers/docker-orchagent/orchagent.sh b/dockers/docker-orchagent/orchagent.sh index 45715dc61f9c..aaa047a42036 100755 --- a/dockers/docker-orchagent/orchagent.sh +++ b/dockers/docker-orchagent/orchagent.sh @@ -41,6 +41,11 @@ then ORCHAGENT_ARGS+="-i $asic_id " fi +# for multi asic platforms add the asic name to the record file names +if [[ "$NAMESPACE_ID" ]]; then + ORCHAGENT_ARGS+="-f swss.asic$NAMESPACE_ID.rec -j sairedis.asic$NAMESPACE_ID.rec " +fi + # Add platform specific arguments if necessary if [ "$platform" == "broadcom" ]; then ORCHAGENT_ARGS+="-m $MAC_ADDRESS" diff --git a/dockers/docker-orchagent/supervisord.conf b/dockers/docker-orchagent/supervisord.conf index 37ddade2edcf..2c3d05999a9c 100644 --- a/dockers/docker-orchagent/supervisord.conf +++ b/dockers/docker-orchagent/supervisord.conf @@ -10,13 +10,14 @@ autorestart=unexpected startretries=0 exitcodes=0,3 events=PROCESS_STATE -buffer_size=100 +buffer_size=1024 [eventlistener:supervisor-proc-exit-listener] command=/usr/bin/supervisor-proc-exit-listener --container-name swss -events=PROCESS_STATE_EXITED +events=PROCESS_STATE_EXITED,PROCESS_STATE_RUNNING autostart=true autorestart=unexpected +buffer_size=1024 [program:rsyslogd] command=/usr/sbin/rsyslogd -n -iNONE @@ -87,7 +88,7 @@ dependent_startup_wait_for=swssconfig:exited command=/usr/bin/coppmgrd priority=6 autostart=false -autorestart=unexpected +autorestart=false startretries=0 startsecs=0 stdout_logfile=syslog @@ -204,4 +205,3 @@ stdout_logfile=syslog stderr_logfile=syslog dependent_startup=true dependent_startup_wait_for=swssconfig:exited - diff --git a/dockers/docker-orchagent/swssconfig.sh b/dockers/docker-orchagent/swssconfig.sh index 0081d074ad60..929e70769a69 100755 --- a/dockers/docker-orchagent/swssconfig.sh +++ b/dockers/docker-orchagent/swssconfig.sh @@ -23,6 +23,12 @@ function fast_reboot { mv -f /default_routes.json /default_routes.json.1 fi + if [[ -f /media_config.json ]]; + then + swssconfig /media_config.json + mv -f /media_config.json /media_config.json.1 + fi + ;; *) ;; diff --git a/dockers/docker-orchagent/tunnel_packet_handler.conf b/dockers/docker-orchagent/tunnel_packet_handler.conf new file mode 100644 index 000000000000..aa6f3d2f3380 --- /dev/null +++ b/dockers/docker-orchagent/tunnel_packet_handler.conf @@ -0,0 +1,9 @@ +[program:tunnel_packet_handler] +command=/usr/bin/tunnel_packet_handler.py +priority=12 +autostart=false +autorestart=unexpected +stdout_logfile=syslog +stderr_logfile=syslog +dependent_startup=true +dependent_startup_wait_for=swssconfig:exited diff --git a/dockers/docker-orchagent/tunnel_packet_handler.py b/dockers/docker-orchagent/tunnel_packet_handler.py new file mode 100755 index 000000000000..44dbb19fda65 --- /dev/null +++ b/dockers/docker-orchagent/tunnel_packet_handler.py @@ -0,0 +1,363 @@ +#! /usr/bin/env python3 +""" +Adds neighbor to kernel for undeliverable tunnel packets + +When receiving tunnel packets, if the hardware doesn't contain neighbor +information for the inner packet's destination IP, the entire encapsulated +packet is trapped to the CPU. In this case, we should ping the inner +destination IP to trigger the process of obtaining neighbor information +""" +import subprocess +import time +from datetime import datetime +from ipaddress import ip_interface + +from swsssdk import ConfigDBConnector, SonicV2Connector +from sonic_py_common import logger as log + +from pyroute2 import IPRoute +from pyroute2.netlink.exceptions import NetlinkError +from scapy.layers.inet import IP +from scapy.layers.inet6 import IPv6 +from scapy.sendrecv import AsyncSniffer + + +logger = log.Logger() + +STATE_DB = 'STATE_DB' +PORTCHANNEL_INTERFACE_TABLE = 'PORTCHANNEL_INTERFACE' +TUNNEL_TABLE = 'TUNNEL' +PEER_SWITCH_TABLE = 'PEER_SWITCH' +INTF_TABLE_TEMPLATE = 'INTERFACE_TABLE|{}|{}' +STATE_KEY = 'state' +TUNNEL_TYPE_KEY = 'tunnel_type' +DST_IP_KEY = 'dst_ip' +ADDRESS_IPV4_KEY = 'address_ipv4' +IPINIP_TUNNEL = 'ipinip' + +RTM_NEWLINK = 'RTM_NEWLINK' + + +class TunnelPacketHandler(object): + """ + This class handles unroutable tunnel packets that are trapped + to the CPU from the ASIC. + """ + + def __init__(self): + self.config_db = ConfigDBConnector() + self.config_db.connect() + self.state_db = SonicV2Connector() + self.state_db.connect(STATE_DB) + self._portchannel_intfs = None + self.up_portchannels = None + self.netlink_api = IPRoute() + self.sniffer = None + self.self_ip = '' + self.packet_filter = '' + self.sniff_intfs = [] + + @property + def portchannel_intfs(self): + """ + Gets all portchannel interfaces and IPv4 addresses in config DB + + Returns: + (list) Tuples of a portchannel interface name (str) and + associated IPv4 address (str) + """ + if self._portchannel_intfs is None: + intf_keys = self.config_db.get_keys(PORTCHANNEL_INTERFACE_TABLE) + portchannel_intfs = [] + + for key in intf_keys: + if isinstance(key, tuple) and len(key) > 1: + if ip_interface(key[1]).version == 4: + portchannel_intfs.append(key) + + self._portchannel_intfs = portchannel_intfs + + return self._portchannel_intfs + + def get_intf_name(self, msg): + """ + Gets the interface name for a netlink msg + + Returns: + (str) The interface name, or the empty string if no interface + name was found + """ + attr_list = msg.get('attrs', list()) + + for attribute, val in attr_list: + if attribute == 'IFLA_IFNAME': + return val + + return '' + + def netlink_msg_is_for_portchannel(self, msg): + """ + Determines if a netlink message is about a PortChannel interface + + Returns: + (list) integers representing kernel indices + """ + ifname = self.get_intf_name(msg) + + return ifname in [name for name, _ in self.portchannel_intfs] + + def get_up_portchannels(self): + """ + Returns the portchannels which are operationally up + + Returns: + (list) of interface names which are up, as strings + """ + portchannel_intf_names = [name for name, _ in self.portchannel_intfs] + link_statuses = [] + for intf in portchannel_intf_names: + try: + status = self.netlink_api.link("get", ifname=intf) + except NetlinkError: + # Continue if we find a non-existent interface since we don't + # need to listen on it while it's down/not created. Once it comes up, + # we will get another netlink message which will trigger this check again + logger.log_notice("Skipping non-existent interface {}".format(intf)) + continue + link_statuses.append(status[0]) + up_portchannels = [] + + for status in link_statuses: + if status['state'] == 'up': + up_portchannels.append(self.get_intf_name(status)) + + return up_portchannels + + def all_portchannels_established(self): + """ + Checks if the portchannel interfaces are established + + Note that this status does not indicate operational state + Returns: + (bool) True, if all interfaces are established + False, otherwise + """ + intfs = self.portchannel_intfs + for intf in intfs: + intf_table_name = INTF_TABLE_TEMPLATE.format(intf[0], intf[1]) + intf_state = self.state_db.get( + STATE_DB, + intf_table_name, + STATE_KEY + ) + + if intf_state and intf_state.lower() != 'ok': + return False + + return True + + def wait_for_portchannels(self, interval=5, timeout=60): + """ + Continuosly checks if all portchannel host interfaces are established + + Args: + interval: the interval (in seconds) at which to perform the check + timeout: maximum allowed duration (in seconds) to wait for + interfaces to come up + + Raises: + RuntimeError if the timeout duration is reached and interfaces are + still not up + """ + start = datetime.now() + + while (datetime.now() - start).seconds < timeout: + if self.all_portchannels_established(): + logger.log_info("All portchannel intfs are established") + return None + logger.log_info("Not all portchannel intfs are established") + time.sleep(interval) + + raise RuntimeError('Portchannel intfs were not established ' + 'within {}'.format(timeout)) + + def get_ipinip_tunnel_addrs(self): + """ + Get the IP addresses used for the IPinIP tunnel + + These should be the Loopback0 addresses for this device and the + peer device + + Returns: + ((str) self_loopback_ip, (str) peer_loopback_ip) + or + (None, None) If the tunnel type is not IPinIP + or + if an error is encountered. This most likely means + the host device is not a dual ToR device + """ + try: + peer_switch = self.config_db.get_keys(PEER_SWITCH_TABLE)[0] + tunnel = self.config_db.get_keys(TUNNEL_TABLE)[0] + except IndexError: + logger.log_warning('PEER_SWITCH or TUNNEL table ' + 'not found in config DB') + return None, None + + try: + tunnel_table = self.config_db.get_entry(TUNNEL_TABLE, tunnel) + tunnel_type = tunnel_table[TUNNEL_TYPE_KEY].lower() + self_loopback_ip = tunnel_table[DST_IP_KEY] + peer_loopback_ip = self.config_db.get_entry( + PEER_SWITCH_TABLE, peer_switch + )[ADDRESS_IPV4_KEY] + except KeyError as error: + logger.log_warning( + 'PEER_SWITCH or TUNNEL table missing data, ' + 'could not find key {}' + .format(error) + ) + return None, None + + if tunnel_type == IPINIP_TUNNEL: + return self_loopback_ip, peer_loopback_ip + + return None, None + + def get_inner_pkt_type(self, packet): + """ + Get the type of an inner encapsulated packet + + Returns: + (str) 'v4' if the inner packet is IPv4 + (str) 'v6' if the inner packet is IPv6 + (bool) False if `packet` is not an IPinIP packet + """ + if packet.haslayer(IP): + # Determine inner packet type based on IP protocol number + # The outer packet type should always be IPv4 + if packet[IP].proto == 4: + return IP + elif packet[IP].proto == 41: + return IPv6 + return False + + def wait_for_netlink_msgs(self): + """ + Gathers any RTM_NEWLINK messages + + Returns: + (list) containing any received messages + """ + msgs = [] + with IPRoute() as ipr: + ipr.bind() + for msg in ipr.get(): + if msg['event'] == RTM_NEWLINK: + msgs.append(msg) + + return msgs + + def sniffer_restart_required(self, messages): + """ + Determines if the packet sniffer needs to be restarted + + A restart is required if all of the following conditions are met: + 1. A netlink message of type RTM_NEWLINK is received + (this is checked by `wait_for_netlink_msgs`) + 2. The interface index of the message corresponds to a portchannel + interface + 3. The state of the interface in the message is 'up' + Here, we do not care about an interface going down since + the sniffer is able to continue sniffing on the other + interfaces. However, if an interface has gone down and + come back up, we need to restart the sniffer to be able + to sniff traffic on the interface that has come back up. + """ + for msg in messages: + if self.netlink_msg_is_for_portchannel(msg): + if msg['state'] == 'up': + logger.log_info('{} came back up, sniffer restart required' + .format(self.get_intf_name(msg))) + return True + return False + + def start_sniffer(self): + """ + Starts an AsyncSniffer and waits for it to inititalize fully + """ + self.sniffer = AsyncSniffer( + iface=self.sniff_intfs, + filter=self.packet_filter, + prn=self.ping_inner_dst, + store=0 + ) + self.sniffer.start() + + while not hasattr(self.sniffer, 'stop_cb'): + time.sleep(0.1) + + def ping_inner_dst(self, packet): + """ + Pings the inner destination IP for an encapsulated packet + + Args: + packet: The encapsulated packet received + """ + inner_packet_type = self.get_inner_pkt_type(packet) + if inner_packet_type and packet[IP].dst == self.self_ip: + cmds = ['timeout', '0.2', 'ping', '-c1', + '-W1', '-i0', '-n', '-q'] + if inner_packet_type == IPv6: + cmds.append('-6') + dst_ip = packet[IP].payload[inner_packet_type].dst + cmds.append(dst_ip) + logger.log_info("Running command '{}'".format(' '.join(cmds))) + subprocess.run(cmds, stdout=subprocess.DEVNULL) + + def listen_for_tunnel_pkts(self): + """ + Listens for tunnel packets that are trapped to CPU + + These packets may be trapped if there is no neighbor info for the + inner packet destination IP in the hardware. + """ + self.self_ip, peer_ip = self.get_ipinip_tunnel_addrs() + if self.self_ip is None or peer_ip is None: + logger.log_notice('Could not get tunnel addresses from ' + 'config DB, exiting...') + return None + + self.packet_filter = 'host {} and host {}'.format(self.self_ip, peer_ip) + logger.log_notice('Starting tunnel packet handler for {}' + .format(self.packet_filter)) + + self.sniff_intfs = self.get_up_portchannels() + logger.log_info("Listening on interfaces {}".format(self.sniff_intfs)) + + self.start_sniffer() + while True: + msgs = self.wait_for_netlink_msgs() + if self.sniffer_restart_required(msgs): + self.sniffer.stop() + sniff_intfs = self.get_up_portchannels() + logger.log_notice('Restarting tunnel packet handler on ' + 'interfaces {}'.format(sniff_intfs)) + self.start_sniffer() + + def run(self): + """ + Entry point for the TunnelPacketHandler class + """ + self.wait_for_portchannels() + self.listen_for_tunnel_pkts() + + +def main(): + logger.set_min_log_priority_info() + handler = TunnelPacketHandler() + handler.run() + + +if __name__ == "__main__": + main() diff --git a/dockers/docker-orchagent/wait_for_link.sh.j2 b/dockers/docker-orchagent/wait_for_link.sh.j2 new file mode 100644 index 000000000000..980b472b3e0a --- /dev/null +++ b/dockers/docker-orchagent/wait_for_link.sh.j2 @@ -0,0 +1,30 @@ +#!/usr/bin/env bash + +VLAN_TABLE_PREFIX="VLAN_TABLE" + +function wait_until_iface_ready +{ + TABLE_PREFIX=$1 + IFACE=$2 + + echo "Waiting until interface $IFACE is ready..." + + # Wait for the interface to come up + # (i.e., interface is present in STATE_DB and state is "ok") + while true; do + RESULT=$(sonic-db-cli STATE_DB HGET "${TABLE_PREFIX}|${IFACE}" "state" 2> /dev/null) + if [ x"$RESULT" == x"ok" ]; then + break + fi + + sleep 1 + done + + echo "Interface ${IFACE} is ready!" +} + + +# Wait for all interfaces to be up and ready +{% for (name, prefix) in VLAN_INTERFACE|pfx_filter %} +wait_until_iface_ready ${VLAN_TABLE_PREFIX} {{ name }} +{% endfor %} diff --git a/dockers/docker-platform-monitor/Dockerfile.j2 b/dockers/docker-platform-monitor/Dockerfile.j2 index b768a3c17e60..2c144cfc55d3 100755 --- a/dockers/docker-platform-monitor/Dockerfile.j2 +++ b/dockers/docker-platform-monitor/Dockerfile.j2 @@ -21,15 +21,19 @@ RUN apt-get update && \ librrd-dev \ rrdtool \ python-smbus \ - ethtool \ + python3-smbus \ dmidecode \ i2c-tools \ - python-jsonschema + psmisc \ + python3-jsonschema \ + libpci3 \ + pciutils # TODO: Remove these lines once we no longer need Python 2 RUN apt-get install -f -y python-dev python-pip RUN pip2 install --upgrade 'pip<21' RUN apt-get purge -y python-pip +RUN pip2 install 'setuptools==40.8.0' # On Arista devices, the sonic_platform wheel is not installed in the container. # Instead, the installation directory is mounted from the host OS. However, this method @@ -45,6 +49,10 @@ RUN pip2 install enum34 RUN pip2 install thrift==0.13.0 RUN pip3 install thrift==0.13.0 +# We install the libpci module in order to be able to do PCI transactions +RUN pip2 install libpci +RUN pip3 install libpci + {% if docker_platform_monitor_debs.strip() -%} # Copy locally-built Debian package dependencies {{ copy_files("debs/", docker_platform_monitor_debs.split(' '), "/debs/") }} @@ -84,10 +92,14 @@ RUN apt-get purge -y \ /python-wheels \ ~/.cache -COPY ["docker_init.sh", "lm-sensors.sh", "/usr/bin/"] -COPY ["docker-pmon.supervisord.conf.j2", "/usr/share/sonic/templates/"] +COPY ["lm-sensors.sh", "/usr/bin/"] +COPY ["docker-pmon.supervisord.conf.j2", "docker_init.j2", "/usr/share/sonic/templates/"] COPY ["ssd_tools/*", "/usr/bin/"] COPY ["files/supervisor-proc-exit-listener", "/usr/bin"] COPY ["critical_processes", "/etc/supervisor"] +RUN sonic-cfggen -a "{\"CONFIGURED_PLATFORM\":\"{{CONFIGURED_PLATFORM}}\"}" -t /usr/share/sonic/templates/docker_init.j2 > /usr/bin/docker_init.sh +RUN rm -f /usr/share/sonic/templates/docker_init.j2 +RUN chmod 755 /usr/bin/docker_init.sh + ENTRYPOINT ["/usr/bin/docker_init.sh"] diff --git a/dockers/docker-platform-monitor/critical_processes b/dockers/docker-platform-monitor/critical_processes index 3165d13ecdbc..e69de29bb2d1 100644 --- a/dockers/docker-platform-monitor/critical_processes +++ b/dockers/docker-platform-monitor/critical_processes @@ -1,3 +0,0 @@ -program:ledd -program:xcvrd -program:psud diff --git a/dockers/docker-platform-monitor/docker-pmon.supervisord.conf.j2 b/dockers/docker-platform-monitor/docker-pmon.supervisord.conf.j2 index 7f816d33394d..fcf295404073 100644 --- a/dockers/docker-platform-monitor/docker-pmon.supervisord.conf.j2 +++ b/dockers/docker-platform-monitor/docker-pmon.supervisord.conf.j2 @@ -10,13 +10,14 @@ autorestart=unexpected startretries=0 exitcodes=0,3 events=PROCESS_STATE -buffer_size=100 +buffer_size=1024 [eventlistener:supervisor-proc-exit-listener] command=/usr/bin/supervisor-proc-exit-listener --container-name pmon -events=PROCESS_STATE_EXITED +events=PROCESS_STATE_EXITED,PROCESS_STATE_RUNNING autostart=true autorestart=unexpected +buffer_size=1024 [program:rsyslogd] command=/usr/sbin/rsyslogd -n -iNONE @@ -32,10 +33,10 @@ dependent_startup=true command=/usr/local/bin/chassisd priority=3 autostart=false -autorestart=false +autorestart=unexpected stdout_logfile=syslog stderr_logfile=syslog -startsecs=0 +startsecs=10 dependent_startup=true dependent_startup_wait_for=rsyslogd:running {% endif %} @@ -68,13 +69,13 @@ dependent_startup_wait_for=rsyslogd:running {% if not skip_ledd %} [program:ledd] -command=/usr/local/bin/ledd +command={% if API_VERSION == 3 and 'ledd' not in python2_daemons %}python3 {% else %} python2 {% endif %}/usr/local/bin/ledd priority=5 autostart=false -autorestart=false +autorestart=unexpected stdout_logfile=syslog stderr_logfile=syslog -startsecs=0 +startsecs=10 dependent_startup=true dependent_startup_wait_for=rsyslogd:running {% endif %} @@ -88,23 +89,42 @@ command={% if API_VERSION == 3 and 'xcvrd' not in python2_daemons %}python3 {% e {% endif %} priority=6 autostart=false -autorestart=false +autorestart=unexpected stdout_logfile=syslog stderr_logfile=syslog -startsecs=0 +startsecs=10 +dependent_startup=true +dependent_startup_wait_for=rsyslogd:running +{% endif %} + +{% if 'subtype' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['subtype'] == 'DualToR' %} +{% if not skip_ycabled %} +[program:ycabled] +{% if delay_ycabled %} +command=bash -c "sleep 30 && nice -n -20 python3 /usr/local/bin/ycabled" +{% else %} +command=nice -n -20 python3 /usr/local/bin/ycabled +{% endif %} +priority=7 +autostart=false +autorestart=unexpected +stdout_logfile=syslog +stderr_logfile=syslog +startsecs=10 dependent_startup=true dependent_startup_wait_for=rsyslogd:running {% endif %} +{% endif %} {% if not skip_psud %} [program:psud] command={% if API_VERSION == 3 and 'psud' not in python2_daemons %}python3 {% else %} python2 {% endif %}/usr/local/bin/psud -priority=7 +priority=8 autostart=false -autorestart=false +autorestart=unexpected stdout_logfile=syslog stderr_logfile=syslog -startsecs=0 +startsecs=10 dependent_startup=true dependent_startup_wait_for=rsyslogd:running {% endif %} @@ -112,7 +132,7 @@ dependent_startup_wait_for=rsyslogd:running {% if not skip_syseepromd %} [program:syseepromd] command={% if API_VERSION == 3 and 'syseepromd' not in python2_daemons %}python3 {% else %} python2 {% endif %}/usr/local/bin/syseepromd -priority=8 +priority=9 autostart=false autorestart=unexpected stdout_logfile=syslog @@ -125,7 +145,7 @@ dependent_startup_wait_for=rsyslogd:running {% if not skip_thermalctld %} [program:thermalctld] command={% if API_VERSION == 3 and 'thermalctld' not in python2_daemons %}python3 {% else %} python2 {% endif %}/usr/local/bin/thermalctld -priority=9 +priority=10 autostart=false autorestart=unexpected stdout_logfile=syslog @@ -138,8 +158,8 @@ dependent_startup_wait_for=rsyslogd:running {% if not skip_pcied %} [program:pcied] -command=/usr/local/bin/pcied -priority=10 +command={% if API_VERSION == 3 and 'pcied' not in python2_daemons %}python3 {% else %} python2 {% endif %}/usr/local/bin/pcied +priority=11 autostart=false autorestart=unexpected stdout_logfile=syslog diff --git a/dockers/docker-platform-monitor/docker_init.j2 b/dockers/docker-platform-monitor/docker_init.j2 new file mode 100755 index 000000000000..c93d1790bd00 --- /dev/null +++ b/dockers/docker-platform-monitor/docker_init.j2 @@ -0,0 +1,113 @@ +#!/usr/bin/env bash + +# Generate supervisord config file and the start.sh scripts +mkdir -p /etc/supervisor/conf.d/ + +SENSORS_CONF_FILE="/usr/share/sonic/platform/sensors.conf" +FANCONTROL_CONF_FILE="/usr/share/sonic/platform/fancontrol" + +SUPERVISOR_CONF_TEMPLATE="/usr/share/sonic/templates/docker-pmon.supervisord.conf.j2" +SUPERVISOR_CONF_FILE="/etc/supervisor/conf.d/supervisord.conf" +PMON_DAEMON_CONTROL_FILE="/usr/share/sonic/platform/pmon_daemon_control.json" +MODULAR_CHASSISDB_CONF_FILE="/usr/share/sonic/platform/chassisdb.conf" + +HAVE_SENSORS_CONF=0 +HAVE_FANCONTROL_CONF=0 +IS_MODULAR_CHASSIS=0 +# Default use python2 version +SONIC_PLATFORM_API_PYTHON_VERSION=2 + +declare -r EXIT_SUCCESS="0" + +if [ "${RUNTIME_OWNER}" == "" ]; then + RUNTIME_OWNER="kube" +fi + +CTR_SCRIPT="/usr/share/sonic/scripts/container_startup.py" +if test -f ${CTR_SCRIPT} +then + ${CTR_SCRIPT} -f pmon -o ${RUNTIME_OWNER} -v ${IMAGE_VERSION} +fi + +mkdir -p /var/sonic +echo "# Config files managed by sonic-config-engine" > /var/sonic/config_status + +# If this platform has synchronization script, run it +if [ -e /usr/share/sonic/platform/platform_wait ]; then + /usr/share/sonic/platform/platform_wait + EXIT_CODE="$?" + if [ "${EXIT_CODE}" != "${EXIT_SUCCESS}" ]; then + exit "${EXIT_CODE}" + fi +fi + +# If the Python 2 sonic-platform package is not installed, try to install it +python2 -c "import sonic_platform" > /dev/null 2>&1 || pip2 show sonic-platform > /dev/null 2>&1 +if [ $? -ne 0 ]; then + SONIC_PLATFORM_WHEEL="/usr/share/sonic/platform/sonic_platform-1.0-py2-none-any.whl" + echo "sonic-platform package not installed, attempting to install..." + if [ -e ${SONIC_PLATFORM_WHEEL} ]; then + pip2 install ${SONIC_PLATFORM_WHEEL} + if [ $? -eq 0 ]; then + echo "Successfully installed ${SONIC_PLATFORM_WHEEL}" + else + echo "Error: Failed to install ${SONIC_PLATFORM_WHEEL}" + fi + else + echo "Error: Unable to locate ${SONIC_PLATFORM_WHEEL}" + fi +fi + +# If the Python 3 sonic-platform package is not installed, try to install it +python3 -c "import sonic_platform" > /dev/null 2>&1 || pip3 show sonic-platform > /dev/null 2>&1 +if [ $? -ne 0 ]; then + SONIC_PLATFORM_WHEEL="/usr/share/sonic/platform/sonic_platform-1.0-py3-none-any.whl" + echo "sonic-platform package not installed, attempting to install..." + if [ -e ${SONIC_PLATFORM_WHEEL} ]; then + pip3 install ${SONIC_PLATFORM_WHEEL} + if [ $? -eq 0 ]; then + echo "Successfully installed ${SONIC_PLATFORM_WHEEL}" + SONIC_PLATFORM_API_PYTHON_VERSION=3 + else + echo "Error: Failed to install ${SONIC_PLATFORM_WHEEL}" + fi + else + echo "Error: Unable to locate ${SONIC_PLATFORM_WHEEL}" + fi +else + SONIC_PLATFORM_API_PYTHON_VERSION=3 +fi + +{% if CONFIGURED_PLATFORM == "mellanox" %} +SENSORS_CONF_PATH_GETTER="/usr/share/sonic/platform/get_sensors_conf_path" +if [ -e $SENSORS_CONF_PATH_GETTER ]; then + SENSORS_CONF_FILE=$($SENSORS_CONF_PATH_GETTER 2>&1) +fi +{% endif %} + +if [ -e $SENSORS_CONF_FILE ]; then + HAVE_SENSORS_CONF=1 + mkdir -p /etc/sensors.d + /bin/cp -f $SENSORS_CONF_FILE /etc/sensors.d/sensors.conf +fi + +if [ -e $FANCONTROL_CONF_FILE ]; then + HAVE_FANCONTROL_CONF=1 + rm -f /var/run/fancontrol.pid + /bin/cp -f $FANCONTROL_CONF_FILE /etc/ +fi + +if [ -e $MODULAR_CHASSISDB_CONF_FILE ]; then + IS_MODULAR_CHASSIS=1 +fi + +confvar="{\"HAVE_SENSORS_CONF\":$HAVE_SENSORS_CONF, \"HAVE_FANCONTROL_CONF\":$HAVE_FANCONTROL_CONF, \"API_VERSION\":$SONIC_PLATFORM_API_PYTHON_VERSION, \"IS_MODULAR_CHASSIS\":$IS_MODULAR_CHASSIS}" + +if [ -e $PMON_DAEMON_CONTROL_FILE ]; +then + sonic-cfggen -d -j $PMON_DAEMON_CONTROL_FILE -a "$confvar" -t $SUPERVISOR_CONF_TEMPLATE > $SUPERVISOR_CONF_FILE +else + sonic-cfggen -d -a "$confvar" -t $SUPERVISOR_CONF_TEMPLATE > $SUPERVISOR_CONF_FILE +fi + +exec /usr/local/bin/supervisord diff --git a/dockers/docker-platform-monitor/docker_init.sh b/dockers/docker-platform-monitor/docker_init.sh deleted file mode 100755 index 6fc7ffeb5114..000000000000 --- a/dockers/docker-platform-monitor/docker_init.sh +++ /dev/null @@ -1,106 +0,0 @@ -#!/usr/bin/env bash - -# Generate supervisord config file and the start.sh scripts -mkdir -p /etc/supervisor/conf.d/ - -SENSORS_CONF_FILE="/usr/share/sonic/platform/sensors.conf" -FANCONTROL_CONF_FILE="/usr/share/sonic/platform/fancontrol" - -SUPERVISOR_CONF_TEMPLATE="/usr/share/sonic/templates/docker-pmon.supervisord.conf.j2" -SUPERVISOR_CONF_FILE="/etc/supervisor/conf.d/supervisord.conf" -PMON_DAEMON_CONTROL_FILE="/usr/share/sonic/platform/pmon_daemon_control.json" -MODULAR_CHASSISDB_CONF_FILE="/usr/share/sonic/platform/chassisdb.conf" - -HAVE_SENSORS_CONF=0 -HAVE_FANCONTROL_CONF=0 -IS_MODULAR_CHASSIS=0 -# Default use python2 version -SONIC_PLATFORM_API_PYTHON_VERSION=2 - -declare -r EXIT_SUCCESS="0" - -if [ "${RUNTIME_OWNER}" == "" ]; then - RUNTIME_OWNER="kube" -fi - -CTR_SCRIPT="/usr/share/sonic/scripts/container_startup.py" -if test -f ${CTR_SCRIPT} -then - ${CTR_SCRIPT} -f pmon -o ${RUNTIME_OWNER} -v ${IMAGE_VERSION} -fi - -mkdir -p /var/sonic -echo "# Config files managed by sonic-config-engine" > /var/sonic/config_status - -# If this platform has synchronization script, run it -if [ -e /usr/share/sonic/platform/platform_wait ]; then - /usr/share/sonic/platform/platform_wait - EXIT_CODE="$?" - if [ "${EXIT_CODE}" != "${EXIT_SUCCESS}" ]; then - exit "${EXIT_CODE}" - fi -fi - -# If the Python 2 sonic-platform package is not installed, try to install it -python2 -c "import sonic_platform" > /dev/null 2>&1 || pip2 show sonic-platform > /dev/null 2>&1 -if [ $? -ne 0 ]; then - SONIC_PLATFORM_WHEEL="/usr/share/sonic/platform/sonic_platform-1.0-py2-none-any.whl" - echo "sonic-platform package not installed, attempting to install..." - if [ -e ${SONIC_PLATFORM_WHEEL} ]; then - pip2 install ${SONIC_PLATFORM_WHEEL} - if [ $? -eq 0 ]; then - echo "Successfully installed ${SONIC_PLATFORM_WHEEL}" - else - echo "Error: Failed to install ${SONIC_PLATFORM_WHEEL}" - fi - else - echo "Error: Unable to locate ${SONIC_PLATFORM_WHEEL}" - fi -fi - -# If the Python 3 sonic-platform package is not installed, try to install it -python3 -c "import sonic_platform" > /dev/null 2>&1 || pip3 show sonic-platform > /dev/null 2>&1 -if [ $? -ne 0 ]; then - SONIC_PLATFORM_WHEEL="/usr/share/sonic/platform/sonic_platform-1.0-py3-none-any.whl" - echo "sonic-platform package not installed, attempting to install..." - if [ -e ${SONIC_PLATFORM_WHEEL} ]; then - pip3 install ${SONIC_PLATFORM_WHEEL} - if [ $? -eq 0 ]; then - echo "Successfully installed ${SONIC_PLATFORM_WHEEL}" - SONIC_PLATFORM_API_PYTHON_VERSION=3 - else - echo "Error: Failed to install ${SONIC_PLATFORM_WHEEL}" - fi - else - echo "Error: Unable to locate ${SONIC_PLATFORM_WHEEL}" - fi -else - SONIC_PLATFORM_API_PYTHON_VERSION=3 -fi - -if [ -e $SENSORS_CONF_FILE ]; then - HAVE_SENSORS_CONF=1 - mkdir -p /etc/sensors.d - /bin/cp -f $SENSORS_CONF_FILE /etc/sensors.d/ -fi - -if [ -e $FANCONTROL_CONF_FILE ]; then - HAVE_FANCONTROL_CONF=1 - rm -f /var/run/fancontrol.pid - /bin/cp -f $FANCONTROL_CONF_FILE /etc/ -fi - -if [ -e $MODULAR_CHASSISDB_CONF_FILE ]; then - IS_MODULAR_CHASSIS=1 -fi - -confvar="{\"HAVE_SENSORS_CONF\":$HAVE_SENSORS_CONF, \"HAVE_FANCONTROL_CONF\":$HAVE_FANCONTROL_CONF, \"API_VERSION\":$SONIC_PLATFORM_API_PYTHON_VERSION, \"IS_MODULAR_CHASSIS\":$IS_MODULAR_CHASSIS}" - -if [ -e $PMON_DAEMON_CONTROL_FILE ]; -then - sonic-cfggen -j $PMON_DAEMON_CONTROL_FILE -a "$confvar" -t $SUPERVISOR_CONF_TEMPLATE > $SUPERVISOR_CONF_FILE -else - sonic-cfggen -a "$confvar" -t $SUPERVISOR_CONF_TEMPLATE > $SUPERVISOR_CONF_FILE -fi - -exec /usr/local/bin/supervisord diff --git a/dockers/docker-ptf-sai/Dockerfile.j2 b/dockers/docker-ptf-sai/Dockerfile.j2 new file mode 100644 index 000000000000..fda64eacf5c1 --- /dev/null +++ b/dockers/docker-ptf-sai/Dockerfile.j2 @@ -0,0 +1,39 @@ +{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %} +FROM docker-ptf + +# Make apt-get non-interactive +ENV DEBIAN_FRONTEND=noninteractive + +# Set the apt source, update package cache and install necessary packages +RUN apt-get update \ + && apt-get upgrade -y \ + && apt-get dist-upgrade -y \ + && apt-get install -y \ + python3-pip + +RUN pip3 install crc16 \ + netifaces \ + getmac \ + packet_helper \ + psutil \ + scapy_helper \ + pysubnettree + +COPY \ +{% for deb in docker_ptf_sai_debs.split(' ') -%} +debs/{{ deb }}{{' '}} +{%- endfor -%} +debs/ + +RUN dpkg -i \ +{% for deb in docker_ptf_sai_debs.split(' ') -%} +debs/{{ deb }}{{' '}} +{%- endfor %} + +# Remove old ptf package +RUN dpkg -r python-ptf + +# Install new ptf package not supprt in 202012 branch +# RUN git clone https://github.com/p4lang/ptf.git \ +# && cd ptf \ +# && python3.7 setup.py install --single-version-externally-managed --record /tmp/ptf_install.txt diff --git a/dockers/docker-ptf-saithrift/Dockerfile.j2 b/dockers/docker-ptf-saithrift/Dockerfile.j2 deleted file mode 100644 index 3076de4878b6..000000000000 --- a/dockers/docker-ptf-saithrift/Dockerfile.j2 +++ /dev/null @@ -1,17 +0,0 @@ -FROM docker-ptf - -## Make apt-get non-interactive -ENV DEBIAN_FRONTEND=noninteractive - -COPY \ -{% for deb in docker_ptf_saithrift_debs.split(' ') -%} -debs/{{ deb }}{{' '}} -{%- endfor -%} -debs/ - -RUN dpkg -i \ -{% for deb in docker_ptf_saithrift_debs.split(' ') -%} -debs/{{ deb }}{{' '}} -{%- endfor %} - -COPY ["*.ini", "/etc/ptf/"] diff --git a/dockers/docker-ptf/Dockerfile.j2 b/dockers/docker-ptf/Dockerfile.j2 index faa927d9db89..873cc9428a9a 100644 --- a/dockers/docker-ptf/Dockerfile.j2 +++ b/dockers/docker-ptf/Dockerfile.j2 @@ -1,16 +1,14 @@ -{% if CONFIGURED_ARCH == "armhf" %} -FROM multiarch/debian-debootstrap:armhf-stretch -{% elif CONFIGURED_ARCH == "arm64" %} -FROM multiarch/debian-debootstrap:arm64-stretch +{% set prefix = DEFAULT_CONTAINER_REGISTRY %} +{% if CONFIGURED_ARCH == "armhf" and MULTIARCH_QEMU_ENVIRON == "y" %} +FROM {{ prefix }}multiarch/debian-debootstrap:armhf-stretch +{% elif CONFIGURED_ARCH == "arm64" and MULTIARCH_QEMU_ENVIRON == "y" %} +FROM {{ prefix }}multiarch/debian-debootstrap:arm64-stretch {% else %} -FROM debian:stretch +FROM {{ prefix }}debian:stretch {% endif %} MAINTAINER Pavel Shirshov -## Remove retired jessie-updates repo -RUN sed -i '/deb http:\/\/deb.debian.org\/debian jessie-updates main/d' /etc/apt/sources.list - ## Copy dependencies COPY \ {% for deb in docker_ptf_debs.split(' ') -%} @@ -18,13 +16,14 @@ debs/{{ deb }}{{' '}} {%- endfor -%} debs/ +COPY ["sources.list.{{ CONFIGURED_ARCH }}", "/etc/apt/sources.list"] + ## Make apt-get non-interactive ENV DEBIAN_FRONTEND=noninteractive ## Set the apt source, update package cache and install necessary packages ## TODO: Clean up this step -RUN sed --in-place 's/httpredir.debian.org/debian-archive.trafficmanager.net/' /etc/apt/sources.list \ - && apt-get update \ +RUN apt-get update \ && apt-get upgrade -y \ && apt-get dist-upgrade -y \ && apt-get install -y \ @@ -78,7 +77,7 @@ RUN rm -rf /debs \ && apt-get -y autoclean \ && apt-get -y autoremove \ && rm -rf /var/lib/apt/lists/* \ - && wget --https-only https://bootstrap.pypa.io/get-pip.py \ + && wget --https-only https://bootstrap.pypa.io/pip/2.7/get-pip.py \ && python get-pip.py \ && rm -f get-pip.py \ && pip install setuptools \ @@ -97,6 +96,14 @@ RUN rm -rf /debs \ && make install \ && cd .. \ && rm -fr sflowtool \ + && git clone https://github.com/dyninc/OpenBFDD.git \ + && cd OpenBFDD \ + && ./autogen.sh \ + && ./configure \ + && make \ + && make install \ + && cd .. \ + && rm -fr OpenBFDD \ && wget https://github.com/nanomsg/nanomsg/archive/1.0.0.tar.gz \ && tar xvfz 1.0.0.tar.gz \ && cd nanomsg-1.0.0 \ @@ -118,6 +125,7 @@ RUN rm -rf /debs \ && pip install exabgp==3.4.17\ && pip install pyaml \ && pip install pybrctl pyro4 rpyc yabgp \ + && pip install unittest-xml-reporting \ && mkdir -p /opt \ && cd /opt \ && wget https://raw.githubusercontent.com/p4lang/ptf/master/ptf_nn/ptf_nn_agent.py @@ -146,6 +154,18 @@ RUN git clone https://github.com/lguohan/gnxi.git \ && cd gnmi_cli_py \ && pip install -r requirements.txt +COPY \ +{% for deb in docker_ptf_debs.split(' ') -%} +debs/{{ deb }}{{' '}} +{%- endfor -%} +debs/ + +RUN dpkg -i \ +{% for deb in docker_ptf_debs.split(' ') -%} +debs/{{ deb }}{{' '}} +{%- endfor %} + +COPY ["*.ini", "/etc/ptf/"] EXPOSE 22 8009 ENTRYPOINT ["/usr/local/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"] diff --git a/dockers/docker-ptf-saithrift/brcm_interface_to_front_map.ini b/dockers/docker-ptf/brcm_interface_to_front_map.ini similarity index 100% rename from dockers/docker-ptf-saithrift/brcm_interface_to_front_map.ini rename to dockers/docker-ptf/brcm_interface_to_front_map.ini diff --git a/dockers/docker-ptf-saithrift/msn_2700_interface_to_front_map.ini b/dockers/docker-ptf/msn_2700_interface_to_front_map.ini similarity index 100% rename from dockers/docker-ptf-saithrift/msn_2700_interface_to_front_map.ini rename to dockers/docker-ptf/msn_2700_interface_to_front_map.ini diff --git a/dockers/docker-router-advertiser/docker-router-advertiser.supervisord.conf.j2 b/dockers/docker-router-advertiser/docker-router-advertiser.supervisord.conf.j2 index ae487922859c..22f33e412195 100644 --- a/dockers/docker-router-advertiser/docker-router-advertiser.supervisord.conf.j2 +++ b/dockers/docker-router-advertiser/docker-router-advertiser.supervisord.conf.j2 @@ -10,13 +10,14 @@ autorestart=unexpected startretries=0 exitcodes=0,3 events=PROCESS_STATE -buffer_size=25 +buffer_size=1024 [eventlistener:supervisor-proc-exit-script] command=/usr/bin/supervisor-proc-exit-listener --container-name radv -events=PROCESS_STATE_EXITED +events=PROCESS_STATE_EXITED,PROCESS_STATE_RUNNING autostart=true autorestart=unexpected +buffer_size=1024 [program:rsyslogd] command=/usr/sbin/rsyslogd -n -iNONE @@ -40,15 +41,20 @@ dependent_startup_wait_for=rsyslogd:running {# Router advertiser should only run on ToR (T0) devices which have #} {# at least one VLAN interface which has an IPv6 address asigned #} +{# But not for specific deployment_id #} {%- set vlan_v6 = namespace(count=0) -%} -{%- if "ToRRouter" in DEVICE_METADATA.localhost.type and DEVICE_METADATA.localhost.type != "MgmtToRRouter" -%} - {%- if VLAN_INTERFACE -%} - {%- for (name, prefix) in VLAN_INTERFACE|pfx_filter -%} - {# If this VLAN has an IPv6 address... #} - {%- if prefix | ipv6 -%} - {%- set vlan_v6.count = vlan_v6.count + 1 -%} +{%- if DEVICE_METADATA.localhost.deployment_id != "8" -%} + {%- if DEVICE_METADATA.localhost.type -%} + {%- if "ToRRouter" in DEVICE_METADATA.localhost.type or DEVICE_METADATA.localhost.type in ["EPMS", "MgmtTsToR"] -%} + {%- if VLAN_INTERFACE -%} + {%- for (name, prefix) in VLAN_INTERFACE|pfx_filter -%} + {# If this VLAN has an IPv6 address... #} + {%- if prefix | ipv6 -%} + {%- set vlan_v6.count = vlan_v6.count + 1 -%} + {%- endif -%} + {%- endfor -%} {%- endif -%} - {%- endfor -%} + {%- endif -%} {%- endif -%} {%- endif -%} diff --git a/dockers/docker-router-advertiser/radvd.conf.j2 b/dockers/docker-router-advertiser/radvd.conf.j2 index bc323977b134..3880ef960760 100644 --- a/dockers/docker-router-advertiser/radvd.conf.j2 +++ b/dockers/docker-router-advertiser/radvd.conf.j2 @@ -10,19 +10,32 @@ {# If our configuration has VLAN interfaces... #} {% if VLAN_INTERFACE %} -{% for (name, prefix) in VLAN_INTERFACE|pfx_filter %} -{# If this VLAN has an IPv6 address... #} +{% set vlan_list = dict() %} +{% for (name,prefix) in VLAN_INTERFACE|pfx_filter %} +{% if name is not in vlan_list and prefix | ipv6 %} +{% set prefix_list = [] %} +{% set _ = vlan_list.update({name: prefix_list}) %} +{% endif %} {% if prefix | ipv6 %} +{# If our configuration has VLAN interfaces... #} +{% set prefix_list = vlan_list.get(name) %} +{% set _ = prefix_list.append(prefix) %} +{% set _ = vlan_list.update({name: prefix_list}) %} +{% endif %} +{% endfor %} +{% endif %} +{% for name, prefixes in vlan_list.items() %} interface {{ name }} { IgnoreIfMissing on; AdvSendAdvert on; - MinRtrAdvInterval 200; - MaxRtrAdvInterval 600; + MinRtrAdvInterval 60; + MaxRtrAdvInterval 180; AdvManagedFlag on; AdvOtherConfigFlag off; AdvLinkMTU 9100; AdvHomeAgentFlag off; +{% for prefix in prefixes %} prefix {{ prefix | network }}/{{ prefix | prefixlen }} { AdvOnLink on; AdvAutonomous off; @@ -30,8 +43,7 @@ interface {{ name }} AdvValidLifetime infinity; AdvPreferredLifetime infinity; }; +{% endfor %} }; -{% endif %} {% endfor %} -{% endif %} diff --git a/dockers/docker-sflow/Dockerfile.j2 b/dockers/docker-sflow/Dockerfile.j2 index 476ff3514ace..c8d0757d5fc5 100644 --- a/dockers/docker-sflow/Dockerfile.j2 +++ b/dockers/docker-sflow/Dockerfile.j2 @@ -1,5 +1,5 @@ {% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %} -FROM docker-config-engine-buster +FROM docker-swss-layer-buster ARG docker_container_name RUN [ -f /etc/rsyslog.conf ] && sed -ri "s/%syslogtag%/$docker_container_name#%syslogtag%/;" /etc/rsyslog.conf diff --git a/dockers/docker-sflow/base_image_files/monit_sflow b/dockers/docker-sflow/base_image_files/monit_sflow deleted file mode 100644 index 84b36b18ce65..000000000000 --- a/dockers/docker-sflow/base_image_files/monit_sflow +++ /dev/null @@ -1,7 +0,0 @@ -############################################################################### -## Monit configuration for sflow container -## process list: -## sflowmgrd -############################################################################### -check program sflow|sflowmgrd with path "/usr/bin/process_checker sflow /usr/bin/sflowmgrd" - if status != 0 for 5 times within 5 cycles then alert repeat every 1 cycles diff --git a/dockers/docker-sflow/supervisord.conf b/dockers/docker-sflow/supervisord.conf index 8d1bdc5059cb..2c8b006df917 100644 --- a/dockers/docker-sflow/supervisord.conf +++ b/dockers/docker-sflow/supervisord.conf @@ -10,13 +10,14 @@ autorestart=unexpected startretries=0 exitcodes=0,3 events=PROCESS_STATE -buffer_size=25 +buffer_size=1024 [eventlistener:supervisor-proc-exit-listener] command=/usr/bin/supervisor-proc-exit-listener --container-name sflow -events=PROCESS_STATE_EXITED +events=PROCESS_STATE_EXITED,PROCESS_STATE_RUNNING autostart=true autorestart=unexpected +buffer_size=1024 [program:rsyslogd] command=/usr/sbin/rsyslogd -n -iNONE diff --git a/dockers/docker-snmp/base_image_files/monit_snmp b/dockers/docker-snmp/base_image_files/monit_snmp deleted file mode 100644 index 6a368a9b6035..000000000000 --- a/dockers/docker-snmp/base_image_files/monit_snmp +++ /dev/null @@ -1,11 +0,0 @@ -############################################################################### -## Monit configuration for snmp container -## process list: -## snmpd -## snmpd_subagent -############################################################################### -check program snmp|snmpd with path "/usr/bin/process_checker snmp /usr/sbin/snmpd" - if status != 0 for 5 times within 5 cycles then alert repeat every 1 cycles - -check program snmp|snmp_subagent with path "/usr/bin/process_checker snmp python3 -m sonic_ax_impl" - if status != 0 for 5 times within 5 cycles then alert repeat every 1 cycles diff --git a/dockers/docker-snmp/snmpd.conf.j2 b/dockers/docker-snmp/snmpd.conf.j2 index 7d4022501fbb..585fb5353e5b 100644 --- a/dockers/docker-snmp/snmpd.conf.j2 +++ b/dockers/docker-snmp/snmpd.conf.j2 @@ -34,16 +34,40 @@ view systemonly included .1.3.6.1.2.1.1 view systemonly included .1.3.6.1.2.1.25.1 # Default access to basic system info -{% if snmp_rocommunities %} -{% for community in snmp_rocommunities %} + + +{% if SNMP_COMMUNITY is defined %} +{% for community in SNMP_COMMUNITY %} +{% if SNMP_COMMUNITY[community]['TYPE'] == 'RO' %} rocommunity {{ community }} rocommunity6 {{ community }} +{% endif %} +{% endfor %} +{% endif %} + +{% if SNMP_COMMUNITY is defined %} +{% for community in SNMP_COMMUNITY %} +{% if SNMP_COMMUNITY[community]['TYPE'] == 'RW' %} +rwcommunity {{ community }} +rwcommunity6 {{ community }} +{% endif %} +{% endfor %} +{% endif %} + +{% if SNMP_USER is defined %} +{% for user in SNMP_USER %} +{% if SNMP_USER[user]['SNMP_USER_PERMISSION'] == 'RO' %} +rouser {{ user }} {{ SNMP_USER[user]['SNMP_USER_TYPE'] }} +CreateUser {{ user }} {{ SNMP_USER[user]['SNMP_USER_AUTH_TYPE'] }} {{ SNMP_USER[user]['SNMP_USER_AUTH_PASSWORD'] }} {{ SNMP_USER[user]['SNMP_USER_ENCRYPTION_TYPE'] }} {{ SNMP_USER[user]['SNMP_USER_ENCRYPTION_PASSWORD'] }} +{% elif SNMP_USER[user]['SNMP_USER_PERMISSION'] == 'RW' %} +rwuser {{ user }} {{ SNMP_USER[user]['SNMP_USER_TYPE'] }} +CreateUser {{ user }} {{ SNMP_USER[user]['SNMP_USER_AUTH_TYPE'] }} {{ SNMP_USER[user]['SNMP_USER_AUTH_PASSWORD'] }} {{ SNMP_USER[user]['SNMP_USER_ENCRYPTION_TYPE'] }} {{ SNMP_USER[user]['SNMP_USER_ENCRYPTION_PASSWORD'] }} +{% endif %} {% endfor %} {% else %} -rocommunity {{ snmp_rocommunity }} -rocommunity6 {{ snmp_rocommunity }} {% endif %} + ############################################################################### # # SYSTEM INFORMATION @@ -51,8 +75,18 @@ rocommunity6 {{ snmp_rocommunity }} # Note that setting these values here, results in the corresponding MIB objects being 'read-only' # See snmpd.conf(5) for more details -sysLocation {{ snmp_location }} + +{% if SNMP is defined and SNMP.LOCATION is defined %} +sysLocation {{ SNMP.LOCATION.Location }} +{% else %} +sysLocation public +{% endif %} +{% if SNMP is defined and SNMP.CONTACT is defined %} +sysContact {{ SNMP.CONTACT.keys() | first }} {{ SNMP.CONTACT.values() | first }} +{% else %} sysContact Azure Cloud Switch vteam +{% endif %} + # Application + End-to-End layers sysServices 72 diff --git a/dockers/docker-snmp/start.sh b/dockers/docker-snmp/start.sh index 70f139bec45e..aefd0bfc3db6 100755 --- a/dockers/docker-snmp/start.sh +++ b/dockers/docker-snmp/start.sh @@ -20,7 +20,6 @@ SONIC_CFGGEN_ARGS=" \ -d \ -y /etc/sonic/sonic_version.yml \ -t /usr/share/sonic/templates/sysDescription.j2,/etc/ssw/sysDescription \ - -y /etc/sonic/snmp.yml \ -t /usr/share/sonic/templates/snmpd.conf.j2,/etc/snmp/snmpd.conf \ " diff --git a/dockers/docker-snmp/supervisord.conf b/dockers/docker-snmp/supervisord.conf index d1e6d09a8213..3d11cc48eafd 100644 --- a/dockers/docker-snmp/supervisord.conf +++ b/dockers/docker-snmp/supervisord.conf @@ -10,13 +10,14 @@ autorestart=unexpected startretries=0 exitcodes=0,3 events=PROCESS_STATE -buffer_size=50 +buffer_size=1024 [eventlistener:supervisor-proc-exit-listener] command=/usr/bin/supervisor-proc-exit-listener --container-name snmp -events=PROCESS_STATE_EXITED +events=PROCESS_STATE_EXITED,PROCESS_STATE_RUNNING autostart=true autorestart=unexpected +buffer_size=1024 [program:rsyslogd] command=/usr/sbin/rsyslogd -n -iNONE @@ -39,7 +40,7 @@ dependent_startup=true dependent_startup_wait_for=rsyslogd:running [program:snmpd] -command=/usr/sbin/snmpd -f -LS4d -u Debian-snmp -g Debian-snmp -I -smux,mteTrigger,mteTriggerConf,ifTable,ifXTable,inetCidrRouteTable,ipCidrRouteTable,ip,disk_hw -p /run/snmpd.pid +command=/usr/sbin/snmpd -f -LS0-2d -u Debian-snmp -g Debian-snmp -I -smux,mteTrigger,mteTriggerConf,ifTable,ifXTable,inetCidrRouteTable,ipCidrRouteTable,ip,disk_hw -p /run/snmpd.pid priority=3 autostart=false autorestart=false diff --git a/dockers/docker-sonic-mgmt-framework/Dockerfile.j2 b/dockers/docker-sonic-mgmt-framework/Dockerfile.j2 index 5ee8cae84466..eea23a2d4620 100644 --- a/dockers/docker-sonic-mgmt-framework/Dockerfile.j2 +++ b/dockers/docker-sonic-mgmt-framework/Dockerfile.j2 @@ -18,6 +18,7 @@ RUN pip2 install wheel==0.35.1 RUN pip2 install connexion==1.1.15 \ setuptools==21.0.0 \ grpcio-tools==1.20.0 \ + protobuf==3.17.3 \ certifi==2017.4.17 \ python-dateutil==2.6.0 \ six==1.11.0 \ @@ -29,7 +30,7 @@ RUN pip3 install connexion==2.7.0 \ certifi==2017.4.17 \ python-dateutil==2.6.0 \ six==1.11.0 \ - urllib3==1.21.1 + urllib3==1.26.5 COPY \ {% for deb in docker_sonic_mgmt_framework_debs.split(' ') -%} @@ -51,6 +52,6 @@ RUN apt-get purge -y python-dev RUN apt-get remove -y g++ python3-dev RUN apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y -RUN rm -rf /debs +RUN rm -rf /debs ~/.cache ENTRYPOINT ["/usr/local/bin/supervisord"] diff --git a/dockers/docker-sonic-mgmt-framework/mgmt_vars.j2 b/dockers/docker-sonic-mgmt-framework/mgmt_vars.j2 index f43b11ba4199..b04446a11a5a 100644 --- a/dockers/docker-sonic-mgmt-framework/mgmt_vars.j2 +++ b/dockers/docker-sonic-mgmt-framework/mgmt_vars.j2 @@ -1,4 +1,4 @@ { - "rest_server": {% if REST_SERVER is defined and "default" in RESET_SERVER.keys() %}{{ REST_SERVER['default'] }}{% else %}""{% endif %}, + "rest_server": {% if REST_SERVER is defined and "default" in REST_SERVER.keys() %}{{ REST_SERVER['default'] }}{% else %}""{% endif %}, "x509" : {% if "x509" in DEVICE_METADATA.keys() %}{{ DEVICE_METADATA["x509"] }}{% else %}""{% endif %} } diff --git a/dockers/docker-sonic-mgmt-framework/supervisord.conf b/dockers/docker-sonic-mgmt-framework/supervisord.conf index f3060fb95d57..1fcf2a580999 100644 --- a/dockers/docker-sonic-mgmt-framework/supervisord.conf +++ b/dockers/docker-sonic-mgmt-framework/supervisord.conf @@ -10,7 +10,7 @@ autorestart=unexpected startretries=0 exitcodes=0,3 events=PROCESS_STATE -buffer_size=25 +buffer_size=1024 [program:rsyslogd] command=/usr/sbin/rsyslogd -n -iNONE diff --git a/dockers/docker-sonic-mgmt/Dockerfile.j2 b/dockers/docker-sonic-mgmt/Dockerfile.j2 index b6abdb8d9363..521cf61ff4ed 100644 --- a/dockers/docker-sonic-mgmt/Dockerfile.j2 +++ b/dockers/docker-sonic-mgmt/Dockerfile.j2 @@ -1,4 +1,5 @@ -FROM ubuntu:18.04 +{% set prefix = DEFAULT_CONTAINER_REGISTRY %} +FROM {{ prefix }}ubuntu:18.04 ENV DEBIAN_FRONTEND=noninteractive @@ -26,6 +27,7 @@ RUN apt-get update && apt-get install -y build-essential \ python3-pip \ python3-venv \ rsyslog \ + shellcheck \ snmp \ sshpass \ sudo \ @@ -35,6 +37,7 @@ RUN apt-get update && apt-get install -y build-essential \ RUN pip install cffi==1.10.0 \ "cryptography>=2.5" \ + contextlib2==0.6.0.post1 \ "future>=0.16.0" \ gitpython \ ipaddr \ @@ -44,6 +47,7 @@ RUN pip install cffi==1.10.0 \ jinja2==2.7.2 \ jsonpatch \ lxml \ + mock \ natsort \ netaddr \ netmiko==2.4.2 \ diff --git a/dockers/docker-sonic-restapi/Dockerfile.j2 b/dockers/docker-sonic-restapi/Dockerfile.j2 index 837796e66d82..0b43a0ef5d25 100644 --- a/dockers/docker-sonic-restapi/Dockerfile.j2 +++ b/dockers/docker-sonic-restapi/Dockerfile.j2 @@ -1,5 +1,5 @@ {% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %} -FROM docker-config-engine-stretch +FROM docker-config-engine-buster ARG docker_container_name RUN [ -f /etc/rsyslog.conf ] && sed -ri "s/%syslogtag%/$docker_container_name#%syslogtag%/;" /etc/rsyslog.conf diff --git a/dockers/docker-sonic-restapi/base_image_files/monit_restapi b/dockers/docker-sonic-restapi/base_image_files/monit_restapi deleted file mode 100644 index 6752100b84f2..000000000000 --- a/dockers/docker-sonic-restapi/base_image_files/monit_restapi +++ /dev/null @@ -1,7 +0,0 @@ -############################################################################### -## Monit configuration for restapi container -## process list: -## restapi -############################################################################### -check program restapi|restapi with path "/usr/bin/process_checker restapi /usr/sbin/go-server-server" - if status != 0 for 5 times within 5 cycles then alert repeat every 1 cycles diff --git a/dockers/docker-sonic-restapi/supervisord.conf b/dockers/docker-sonic-restapi/supervisord.conf index 74bbc9241576..c95b4b6b92d8 100644 --- a/dockers/docker-sonic-restapi/supervisord.conf +++ b/dockers/docker-sonic-restapi/supervisord.conf @@ -10,13 +10,14 @@ autorestart=unexpected startretries=0 exitcodes=0,3 events=PROCESS_STATE -buffer_size=25 +buffer_size=1024 [eventlistener:supervisor-proc-exit-listener] command=/usr/bin/supervisor-proc-exit-listener --container-name restapi -events=PROCESS_STATE_EXITED +events=PROCESS_STATE_EXITED,PROCESS_STATE_RUNNING autostart=true autorestart=false +buffer_size=1024 [program:rsyslogd] command=/usr/sbin/rsyslogd -n -iNONE @@ -42,7 +43,7 @@ dependent_startup_wait_for=rsyslogd:running command=/usr/bin/restapi.sh priority=1 autostart=false -autorestart=true +autorestart=false stdout_logfile=syslog stderr_logfile=syslog dependent_startup=true diff --git a/dockers/docker-sonic-telemetry/base_image_files/monit_telemetry b/dockers/docker-sonic-telemetry/base_image_files/monit_telemetry index 3680bbe6cf9a..3941aecd4b0c 100644 --- a/dockers/docker-sonic-telemetry/base_image_files/monit_telemetry +++ b/dockers/docker-sonic-telemetry/base_image_files/monit_telemetry @@ -1,11 +1,5 @@ ############################################################################### ## Monit configuration for telemetry container -## process list: -## telemetry -## dialout_client ############################################################################### -check program telemetry|telemetry with path "/usr/bin/process_checker telemetry /usr/sbin/telemetry" - if status != 0 for 5 times within 5 cycles then alert repeat every 1 cycles - -check program telemetry|dialout_client with path "/usr/bin/process_checker telemetry /usr/sbin/dialout_client_cli" - if status != 0 for 5 times within 5 cycles then alert repeat every 1 cycles +check program container_memory_telemetry with path "/usr/bin/memory_checker telemetry 419430400" + if status == 3 for 10 times within 20 cycles then exec "/usr/bin/restart_service telemetry" repeat every 2 cycles diff --git a/dockers/docker-sonic-telemetry/critical_processes b/dockers/docker-sonic-telemetry/critical_processes index 612a94d9edac..3baf6e268907 100644 --- a/dockers/docker-sonic-telemetry/critical_processes +++ b/dockers/docker-sonic-telemetry/critical_processes @@ -1,2 +1 @@ program:telemetry -program:dialout diff --git a/dockers/docker-sonic-telemetry/supervisord.conf b/dockers/docker-sonic-telemetry/supervisord.conf index df1e6fa5a354..5ab0e3ca59da 100644 --- a/dockers/docker-sonic-telemetry/supervisord.conf +++ b/dockers/docker-sonic-telemetry/supervisord.conf @@ -10,13 +10,14 @@ autorestart=unexpected startretries=0 exitcodes=0,3 events=PROCESS_STATE -buffer_size=50 +buffer_size=1024 [eventlistener:supervisor-proc-exit-listener] command=/usr/bin/supervisor-proc-exit-listener --container-name telemetry -events=PROCESS_STATE_EXITED +events=PROCESS_STATE_EXITED,PROCESS_STATE_RUNNING autostart=true autorestart=false +buffer_size=1024 [program:rsyslogd] command=/usr/sbin/rsyslogd -n -iNONE diff --git a/dockers/docker-sonic-telemetry/telemetry.sh b/dockers/docker-sonic-telemetry/telemetry.sh index 0fd80fcbfcc8..8f116134df05 100755 --- a/dockers/docker-sonic-telemetry/telemetry.sh +++ b/dockers/docker-sonic-telemetry/telemetry.sh @@ -46,13 +46,12 @@ elif [ -n "$X509" ]; then TELEMETRY_ARGS+=" --ca_crt $CA_CRT" fi else - TELEMETRY_ARGS+=" --insecure" + TELEMETRY_ARGS+=" --noTLS" fi # If no configuration entry exists for TELEMETRY, create one default port if [ -z "$GNMI" ]; then PORT=8080 - sonic-db-cli CONFIG_DB hset "TELEMETRY|gnmi" port $PORT else PORT=$(echo $GNMI | jq -r '.port') fi @@ -64,7 +63,7 @@ if [ -z $CLIENT_AUTH ] || [ $CLIENT_AUTH == "false" ]; then fi LOG_LEVEL=$(echo $GNMI | jq -r '.log_level') -if [ ! -z $LOG_LEVEL ]; then +if [[ $LOG_LEVEL =~ ^[0-9]+$ ]]; then TELEMETRY_ARGS+=" -v=$LOG_LEVEL" else TELEMETRY_ARGS+=" -v=2" diff --git a/dockers/docker-swss-layer-buster/Dockerfile.j2 b/dockers/docker-swss-layer-buster/Dockerfile.j2 new file mode 100644 index 000000000000..e8dcb9472a26 --- /dev/null +++ b/dockers/docker-swss-layer-buster/Dockerfile.j2 @@ -0,0 +1,22 @@ +{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %} +FROM docker-config-engine-buster + +## Make apt-get non-interactive +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt-get update + +{% if docker_swss_layer_buster_debs.strip() -%} +# Copy locally-built Debian package dependencies +{{ copy_files("debs/", docker_swss_layer_buster_debs.split(' '), "/debs/") }} + +# Install locally-built Debian packages and implicitly install their dependencies +{{ install_debian_packages(docker_swss_layer_buster_debs.split(' ')) }} +{%- endif %} + +RUN apt-get clean -y && \ + apt-get autoclean -y && \ + apt-get autoremove -y && \ + rm -rf /debs + +ENTRYPOINT ["/usr/local/bin/supervisord"] diff --git a/dockers/docker-teamd/Dockerfile.j2 b/dockers/docker-teamd/Dockerfile.j2 index 7f4db2936857..e02000abb1c6 100644 --- a/dockers/docker-teamd/Dockerfile.j2 +++ b/dockers/docker-teamd/Dockerfile.j2 @@ -1,5 +1,5 @@ {% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %} -FROM docker-config-engine-buster +FROM docker-swss-layer-buster ARG docker_container_name RUN [ -f /etc/rsyslog.conf ] && sed -ri "s/%syslogtag%/$docker_container_name#%syslogtag%/;" /etc/rsyslog.conf diff --git a/dockers/docker-teamd/base_image_files/monit_teamd b/dockers/docker-teamd/base_image_files/monit_teamd deleted file mode 100644 index 626a6145604e..000000000000 --- a/dockers/docker-teamd/base_image_files/monit_teamd +++ /dev/null @@ -1,11 +0,0 @@ -############################################################################### -## Monit configuration for teamd container -## process list: -## teamsyncd -## teammgrd -############################################################################### -check program teamd|teamsyncd with path "/usr/bin/process_checker teamd /usr/bin/teamsyncd" - if status != 0 for 5 times within 5 cycles then alert repeat every 1 cycles - -check program teamd|teammgrd with path "/usr/bin/process_checker teamd /usr/bin/teammgrd" - if status != 0 for 5 times within 5 cycles then alert repeat every 1 cycles diff --git a/dockers/docker-teamd/supervisord.conf b/dockers/docker-teamd/supervisord.conf index 78549a7684f2..db6a8cfb9a5a 100644 --- a/dockers/docker-teamd/supervisord.conf +++ b/dockers/docker-teamd/supervisord.conf @@ -10,13 +10,14 @@ autorestart=unexpected startretries=0 exitcodes=0,3 events=PROCESS_STATE -buffer_size=50 +buffer_size=1024 [eventlistener:supervisor-proc-exit-listener] command=/usr/bin/supervisor-proc-exit-listener --container-name teamd -events=PROCESS_STATE_EXITED +events=PROCESS_STATE_EXITED,PROCESS_STATE_RUNNING autostart=true autorestart=unexpected +buffer_size=1024 [program:rsyslogd] command=/usr/sbin/rsyslogd -n -iNONE @@ -43,6 +44,7 @@ command=/usr/bin/teammgrd priority=3 autostart=false autorestart=false +stopwaitsecs=60 stdout_logfile=syslog stderr_logfile=syslog dependent_startup=true diff --git a/files/Aboot/boot0.j2 b/files/Aboot/boot0.j2 index 2384357c7a97..383a02cfda9e 100644 --- a/files/Aboot/boot0.j2 +++ b/files/Aboot/boot0.j2 @@ -86,7 +86,7 @@ installer_image_path="$image_path/$installer_image" boot_config="$target_path/boot-config" -cmdline_allowlist='crashkernel' +cmdline_allowlist="crashkernel" # for backward compatibility with the sonic_upgrade= behavior install="${install:-${sonic_upgrade:-}}" @@ -117,7 +117,8 @@ clean_flash() { [ $f != "old_config" ] && [ $f != "minigraph.xml" ] && [ $f != "snmp.yml" ] && - [ $f != "acl.json" ] + [ $f != "acl.json" ] && + [ $f != "port_config.json" ] then rm -rf "$target_path/$f" fi @@ -347,10 +348,17 @@ extract_image() { info "Extracting swi content" ## Unzip the image except boot0 and dockerfs archive - unzip -oq "$swipath" -x boot0 "$dockerfs" -d "$image_path" + unzip -oq "$swipath" -x boot0 "$dockerfs" "platform.tar.gz" -d "$image_path" + + ## Extract the platform.tar.gz + info "Extracting platform.tar.gz" + mkdir -p "$image_path/platform" + unzip -oqp "$swipath" "platform.tar.gz" | tar xzf - -C "$image_path/platform" $TAR_EXTRA_OPTION ## detect rootfs type - rootfs_type=`grep " $target_path " /proc/mounts | cut -d' ' -f3` + local mountstr="$(grep " $target_path " /proc/mounts)" + local rootdev="$(echo $mountstr | cut -f1 -d' ')" + rootfs_type="$(echo $mountstr | cut -d' ' -f3)" info "Extracting $dockerfs from swi" ## Unpacking dockerfs delayed @@ -476,7 +484,6 @@ write_platform_specific_cmdline() { if [ "$platform" = "crow" ]; then # Assuming sid=Clearlake aboot_machine=arista_7050_qx32s - flash_size=3700 cmdline_add modprobe.blacklist=radeon,sp5100_tco fi if [ "$sid" = "Upperlake" ] || [ "$sid" = "UpperlakeES" ]; then @@ -490,6 +497,7 @@ write_platform_specific_cmdline() { if [ "$sid" = "Gardena" ] || [ "$sid" = "GardenaE" ]; then aboot_machine=arista_7260cx3_64 flash_size=28000 + cmdline_add logs_inram=on fi if [ "$sid" = "Alhambra" ]; then aboot_machine=arista_7170_64c @@ -508,7 +516,16 @@ write_platform_specific_cmdline() { fi if [ "$sid" = "Lodoga" ]; then aboot_machine=arista_7050cx3_32s - flash_size=3700 + cmdline_add logs_inram=on + cmdline_add libata.force=2.00:noncq + fi + if [ "$sid" = "Marysville" ]; then + aboot_machine=arista_7050sx3_48yc8 + flash_size=7382 + fi + if [ "$sid" = "Marysville10" ]; then + aboot_machine=arista_7050sx3_48c8 + flash_size=7382 fi if [ "$sid" = "BlackhawkO" ]; then aboot_machine=arista_7060px4_32 @@ -520,19 +537,21 @@ write_platform_specific_cmdline() { fi if [ "$sid" = "Smartsville" ]; then aboot_machine=arista_7280cr3_32p4 - flash_size=7382 fi if [ "$sid" = "SmartsvilleBK" ]; then aboot_machine=arista_7280cr3k_32p4 - flash_size=7382 + fi + if [ "$sid" = "SmartsvilleBkMs" ] || [ "$sid" = "SmartsvilleBkMsTpm" ]; then + aboot_machine=arista_7280cr3mk_32p4 fi if [ "$sid" = "SmartsvilleDD" ]; then aboot_machine=arista_7280cr3_32d4 - flash_size=7382 fi if [ "$sid" = "SmartsvilleDDBK" ]; then aboot_machine=arista_7280cr3k_32d4 - flash_size=7382 + fi + if [ "$sid" = "SmartsvilleDDBkMs" ] || [ "$sid" = "SmartsvilleDDBkMsTpm" ]; then + aboot_machine=arista_7280cr3mk_32d4 fi if [ "$sid" = "Clearwater2" ]; then aboot_machine=arista_7800r3_48cq2_lc @@ -547,6 +566,10 @@ write_platform_specific_cmdline() { flash_size=30000 sonic_mode=$supervisor_mode fi + if [ "$sid" = "SmartsvilleBkMs" ]; then + aboot_machine=arista_7280cr3mk_32p4 + flash_size=7382 + fi if in_array "$platform" "rook" "magpie" "woodpecker" "sprucefish"; then cmdline_add tsc=reliable cmdline_add pcie_ports=native @@ -560,9 +583,14 @@ write_platform_specific_cmdline() { cmdline_add intel_idle.max_cstate=0 read_system_eeprom fi + if in_array "$platform" "rook"; then + # Currently applies to Alhambra, Blackhawk, Gardena and Mineral + cmdline_add libata.force=1.00:noncq + fi if in_array "$platform" "crow" "magpie"; then cmdline_add amd_iommu=off cmdline_add modprobe.blacklist=snd_hda_intel,hdaudio + cmdline_add sdhci.append_quirks2=0x40 read_system_eeprom fi if in_array "$platform" "woodpecker"; then @@ -576,17 +604,21 @@ write_platform_specific_cmdline() { if [ $flash_size -ge 28000 ]; then varlog_size=4096 - elif [ $flash_size -ge 3700 ]; then + elif [ $flash_size -gt 4000 ]; then varlog_size=400 - elif [ $flash_size -le 2000 ]; then - # enable docker_inram for switches with less than 2G of flash - cmdline_add docker_inram=on + else + varlog_size=256 cmdline_add logs_inram=on + if [ $flash_size -le 2000 ]; then + # enable docker_inram for switches with less than 2G of flash + varlog_size=128 + cmdline_add docker_inram=on + fi fi cmdline_add "varlog_size=$varlog_size" - cmdline_add "sonic.mode=$sonic_mode" + cmdline_add log_buf_len=1M } write_image_specific_cmdline() { @@ -600,6 +632,9 @@ write_image_specific_cmdline() { # disable deterministic interface naming cmdline_add net.ifnames=0 + # disable unified cgroup hierarchy to workaround dockerd limitation + cmdline_add systemd.unified_cgroup_hierarchy=0 + # verbosity cmdline_add quiet # Start showing systemd information from the first failing unit if any. @@ -634,22 +669,56 @@ write_default_cmdline() { cmdline_clear if $in_aboot; then - # generate the default kernel parameters for the platform + # Generate the default kernel parameters for the platform cat /etc/cmdline | sed "/^\(${bootconfigvars// /\|}\|crashkernel\|loglevel\|ignore_loglevel\)\(\$\|=\)/d;/^\$/d" | cmdline_append - elif grep -q "$delimiter" /proc/cmdline; then - # we are on a recent sonic image using delimiter. extracting the part of the + elif grep -q "$delimiter" /proc/cmdline && ! grep -Eq "varlog_size=.* $delimiter" /proc/cmdline; then + # We are on a recent sonic image using delimiter. extracting the part of the # cmdline coming from aboot is trivial. + # The 2nd part of the condition ensures that the append bug is not present. + # When it is it should go through the last case of this if/else block to + # regenerate the aboot cmdline cat /proc/cmdline | sed -E "s/^(.*) $delimiter .*$/\1/" | tr ' ' '\n' | cmdline_append - else - # we are either on SONiC or EOS and the commandline doesn't have a delimiter - # for the Aboot part. Take an educated guess at a right delimiter. - # Subject to breakage if EOS or SONiC cmdline change. + elif grep -q "SWI=" /proc/cmdline; then + # We are in EOS and the cmdline doesn't have a delimiter for the aboot part cat /proc/cmdline | sed -E 's/^(.*) rw .*$/\1/' | tr ' ' '\n' | cmdline_append + else + # We are in SONiC and the cmdline doesn't have a delimiter for the aboot part. + # sid= should most of the time be the last parameter provided by Aboot + # Alternatively we are in SONiC and the cmdline-aboot-end delimiter was + # added after image specific parameters due to a BUG which is solved by the + # following statement. + cat /proc/cmdline | sed -E 's/^(.* sid=[^ ]+).*$/\1/' | tr ' ' '\n' | cmdline_append fi cmdline_add "$delimiter" } +write_cmdline() { + # use extra parameters from kernel-params hook if the file exists + if [ -f "$target_path/$kernel_params" ]; then + if $secureboot && $debug; then + warn "Unsafe: Loading extra kernel parameters from $kernel_params" + cat "$target_path/$kernel_params" | cmdline_append + elif ! $secureboot; then + info "Loading extra kernel parameters from $kernel_params" + cat "$target_path/$kernel_params" | cmdline_append + fi + fi + + # FIXME: sonic sometimes adds extra kernel parameters from user space + # this is unsafe but some will be kept as part of the regular boot + if [ -f "$image_path/kernel-cmdline" ]; then + for field in $cmdline_allowlist; do + cat "$image_path/kernel-cmdline" | tr ' ' '\n' | grep -E "$field" | tail -n 1 | cmdline_append + done + fi + + # FIXME: legacy configuration files used by fast-reboot and eos2sonic + # these should be deprecated over time. + cmdline_echo > "$image_path/kernel-cmdline" + cmdline_echo | sed 's/ cmdline-aboot-end.*$//' > "$target_path/kernel-params-base" +} + write_common_configs() { write_default_cmdline write_platform_specific_cmdline @@ -667,28 +736,14 @@ write_secureboot_configs() { cmdline_add aboot.secureboot=enabled # setting panic= has the side effect of disabling the initrd shell on error cmdline_add panic=0 + write_cmdline } write_regular_configs() { write_common_configs cmdline_add "loop=$image_name/fs.squashfs" cmdline_add loopfstype=squashfs - - # use extra parameters from kernel-params hook if the file exists - if [ -f "$target_path/$kernel_params" ]; then - cat "$target_path/$kernel_params" | cmdline_append - fi - - # FIXME: sonic sometimes adds extra kernel parameters from user space - # this is unsafe but some will be kept as part of the regular boot - if [ -f "$image_path/kernel-cmdline" ]; then - cat "$image_path/kernel-cmdline" | tr ' ' '\n' | grep -E "$cmdline_allowlist" | cmdline_append - fi - - # FIXME: legacy configuration files used by fast-reboot and eos2sonic - # these should be deprecated over time. - cmdline_echo > "$image_path/kernel-cmdline" - cmdline_echo | sed 's/ cmdline-aboot-end.*$//' > "$target_path/kernel-params-base" + write_cmdline } run_kexec() { @@ -753,8 +808,8 @@ secureboot_boot() { regular_boot() { # boot uses the image installed on the flash - run_hooks pre-kexec write_regular_configs "$image_path" + run_hooks pre-kexec update_next_boot run_kexec } diff --git a/files/apt/sources.list.amd64 b/files/apt/sources.list.amd64 deleted file mode 100644 index 4a94e3161ab1..000000000000 --- a/files/apt/sources.list.amd64 +++ /dev/null @@ -1,8 +0,0 @@ -## Debian mirror on Microsoft Azure -## Ref: http://debian-archive.trafficmanager.net/ - -deb [arch=amd64] http://debian-archive.trafficmanager.net/debian/ buster main contrib non-free -deb-src [arch=amd64] http://debian-archive.trafficmanager.net/debian/ buster main contrib non-free -deb [arch=amd64] http://debian-archive.trafficmanager.net/debian-security/ buster/updates main contrib non-free -deb-src [arch=amd64] http://debian-archive.trafficmanager.net/debian-security/ buster/updates main contrib non-free -deb [arch=amd64] http://debian-archive.trafficmanager.net/debian/ buster-backports main contrib non-free diff --git a/files/apt/sources.list.arm64 b/files/apt/sources.list.arm64 deleted file mode 100644 index dd82c744de1d..000000000000 --- a/files/apt/sources.list.arm64 +++ /dev/null @@ -1,8 +0,0 @@ -## Debian mirror for ARM -## Not the repo mirror site can change in future, and needs to be updated to be in sync - -deb [arch=arm64] http://deb.debian.org/debian buster main contrib non-free -deb-src [arch=arm64] http://deb.debian.org/debian buster main contrib non-free -deb [arch=arm64] http://deb.debian.org/debian buster-updates main contrib non-free -deb-src [arch=arm64] http://deb.debian.org/debian buster-updates main contrib non-free -deb [arch=arm64] http://ftp.debian.org/debian buster-backports main diff --git a/files/apt/sources.list.armhf b/files/apt/sources.list.armhf deleted file mode 100644 index 760906188a94..000000000000 --- a/files/apt/sources.list.armhf +++ /dev/null @@ -1,8 +0,0 @@ -## Debian mirror for ARM -## Not the repo mirror site can change in future, and needs to be updated to be in sync - -deb [arch=armhf] http://deb.debian.org/debian buster main contrib non-free -deb-src [arch=armhf] http://deb.debian.org/debian buster main contrib non-free -deb [arch=armhf] http://deb.debian.org/debian buster-updates main contrib non-free -deb-src [arch=armhf] http://deb.debian.org/debian buster-updates main contrib non-free -deb [arch=armhf] http://ftp.debian.org/debian buster-backports main diff --git a/files/apt/sources.list.j2 b/files/apt/sources.list.j2 new file mode 100644 index 000000000000..57d53b919b03 --- /dev/null +++ b/files/apt/sources.list.j2 @@ -0,0 +1,20 @@ +# The configuration is generated by template +# Please add additional sources in /etc/apt/sources.list.d + +{% for mirror_url in MIRROR_URLS.split(',') %} +deb [arch={{ ARCHITECTURE }}] {{ mirror_url }} {{ DISTRIBUTION }} main contrib non-free +deb-src [arch={{ ARCHITECTURE }}] {{ mirror_url }} {{ DISTRIBUTION }} main contrib non-free +deb [arch={{ ARCHITECTURE }}] {{ mirror_url }} {{ DISTRIBUTION }}-updates main contrib non-free +deb-src [arch={{ ARCHITECTURE }}] {{ mirror_url }} {{ DISTRIBUTION }}-updates main contrib non-free +deb [arch={{ ARCHITECTURE }}] {{ mirror_url }} {{ DISTRIBUTION }}-backports main contrib non-free +{% endfor %} +{% for mirror_url in MIRROR_SECURITY_URLS.split(',') %} +{% set dist_separator='/' %}{% if 'packages.trafficmanager.net/debian' in mirror_url %}{% set dist_separator='_' %}{% endif %} +{% if DISTRIBUTION == 'stretch' or DISTRIBUTION == 'buster' %} +deb [arch={{ ARCHITECTURE }}] {{ mirror_url }} {{ DISTRIBUTION }}{{ dist_separator }}updates main contrib non-free +deb-src [arch={{ ARCHITECTURE }}] {{ mirror_url }} {{ DISTRIBUTION }}{{ dist_separator }}updates main contrib non-free +{% else %} +deb [arch={{ ARCHITECTURE }}] {{ mirror_url }} {{ DISTRIBUTION }}-security main contrib non-free +deb-src [arch={{ ARCHITECTURE }}] {{ mirror_url }} {{ DISTRIBUTION }}-security main contrib non-free +{% endif %} +{% endfor %} diff --git a/files/build/versions/build/build-sonic-slave-buster/versions-deb-buster b/files/build/versions/build/build-sonic-slave-buster/versions-deb-buster new file mode 100644 index 000000000000..8b08a1d71df4 --- /dev/null +++ b/files/build/versions/build/build-sonic-slave-buster/versions-deb-buster @@ -0,0 +1,71 @@ +applibs==1.mlnx.4.5.3196 +applibs-dev==1.mlnx.4.5.3196 +bfnplatform==1.0.0 +iproute2-dev==1.mlnx.4.5.3196 +isc-dhcp-relay==4.4.1-2.3+deb11u1 +kernel-mft-dkms==4.21.0-100 +libhiredis-dev==0.14.0-3~bpo9+1 +libhiredis0.14==0.14.0-3~bpo9+1 +libnl-cli-3-200==3.5.0-1 +libnl-cli-3-dev==3.5.0-1 +libnl-genl-3-200==3.5.0-1 +libnl-genl-3-dev==3.5.0-1 +libnl-nf-3-200==3.5.0-1 +libnl-nf-3-dev==3.5.0-1 +libsaibcm==4.3.7.1-7 +libsaibcm-dev==4.3.7.1-7 +libsaimetadata==1.0.0 +libsaimetadata-dev==1.0.0 +libsairedis==1.0.0 +libsairedis-dev==1.0.0 +libsaithrift-dev==0.9.4 +libsaivs==1.0.0 +libswsscommon==1.0.0 +libswsscommon-dev==1.0.0 +libtac-dev==1.4.1-1 +libtac2==1.4.1-1 +libteam-dev==1.30-1 +libteam-utils==1.30-1 +libteam5==1.30-1 +libteamdctl0==1.30-1 +libthrift-0.11.0==0.11.0-4 +libthrift-0.13.0==0.13.0-6 +libthrift-dev==0.11.0-4 +libyang==1.0.73 +libyang-cpp==1.0.73 +libyang-dev==1.0.73 +linux-headers-4.19.0-12-2-amd64==4.19.152-1 +linux-headers-4.19.0-12-2-common==4.19.152-1 +lldpd==1.0.4-1 +lm-sensors==1:3.5.0-3 +mft==4.21.0-100 +python-swsscommon==1.0.0 +python-thrift==0.11.0-4 +python2-yang==1.0.73 +python3-swsscommon==1.0.0 +python3-thrift==0.13.0-6 +python3-yang==1.0.73 +sonic-dhcp6relay==1.0.0-0 +sonic-dhcpmon==1.0.0-0 +sonic-linkmgrd==1.0.0-1 +sonic-mgmt-common==1.0.0 +sonic-mgmt-common-codegen==1.0.0 +sonic-mgmt-framework==1.0-01 +swss==1.0.0 +sx-acl-helper==1.mlnx.4.5.3196 +sx-acl-helper-dev==1.mlnx.4.5.3196 +sx-complib==1.mlnx.4.5.3196 +sx-complib-dev==1.mlnx.4.5.3196 +sx-examples==1.mlnx.4.5.3196 +sx-examples-dev==1.mlnx.4.5.3196 +sx-gen-utils==1.mlnx.4.5.3196 +sx-gen-utils-dev==1.mlnx.4.5.3196 +sx-scew==1.mlnx.4.5.3196 +sx-scew-dev==1.mlnx.4.5.3196 +sxd-libs==1.mlnx.4.5.3196 +sxd-libs-dev==1.mlnx.4.5.3196 +syncd==1.0.0 +syncd-vs==1.0.0 +thrift-compiler==0.11.0-4 +wjh-libs==1.mlnx.4.5.3196 +wjh-libs-dev==1.mlnx.4.5.3196 \ No newline at end of file diff --git a/files/build/versions/build/build-sonic-slave-buster/versions-deb-buster-arm64 b/files/build/versions/build/build-sonic-slave-buster/versions-deb-buster-arm64 new file mode 100644 index 000000000000..1be11bdfd522 --- /dev/null +++ b/files/build/versions/build/build-sonic-slave-buster/versions-deb-buster-arm64 @@ -0,0 +1,5 @@ +libnl-3-200==3.5.0-1 +libnl-3-dev==3.5.0-1 +libnl-route-3-200==3.5.0-1 +libnl-route-3-dev==3.5.0-1 +linux-headers-4.19.0-12-2-arm64==4.19.152-1 \ No newline at end of file diff --git a/files/build/versions/build/build-sonic-slave-buster/versions-deb-buster-armhf b/files/build/versions/build/build-sonic-slave-buster/versions-deb-buster-armhf new file mode 100644 index 000000000000..a83790c30ddf --- /dev/null +++ b/files/build/versions/build/build-sonic-slave-buster/versions-deb-buster-armhf @@ -0,0 +1 @@ +linux-headers-4.19.0-12-2-armmp==4.19.152-1 \ No newline at end of file diff --git a/files/build/versions/build/build-sonic-slave-buster/versions-py2 b/files/build/versions/build/build-sonic-slave-buster/versions-py2 new file mode 100644 index 000000000000..babe2cbd1e55 --- /dev/null +++ b/files/build/versions/build/build-sonic-slave-buster/versions-py2 @@ -0,0 +1,14 @@ +bitarray==1.5.3 +contextlib2==0.6.0.post1 +functools32==3.2.3.post2 +future==0.18.3 +importlib-resources==3.3.1 +jsonschema==2.6.0 +natsort==6.2.1 +netaddr==0.8.0 +pyang==2.5.3 +pyangbind==0.6.0 +redis==3.5.3 +sairedis==1.0 +thrift==0.11.0 +zipp==1.2.0 \ No newline at end of file diff --git a/files/build/versions/build/build-sonic-slave-buster/versions-py2-all-arm64 b/files/build/versions/build/build-sonic-slave-buster/versions-py2-all-arm64 new file mode 100644 index 000000000000..c7b43db04ec2 --- /dev/null +++ b/files/build/versions/build/build-sonic-slave-buster/versions-py2-all-arm64 @@ -0,0 +1,2 @@ +ipaddress==1.0.23 +lxml==4.9.1 \ No newline at end of file diff --git a/files/build/versions/build/build-sonic-slave-buster/versions-py3 b/files/build/versions/build/build-sonic-slave-buster/versions-py3 new file mode 100644 index 000000000000..b794a7ff9e9b --- /dev/null +++ b/files/build/versions/build/build-sonic-slave-buster/versions-py3 @@ -0,0 +1,18 @@ +charset-normalizer==3.1.0 +click==7.0 +docker==6.1.1 +ijson==2.6.1 +ipaddress==1.0.23 +jsondiff==2.0.0 +jsonschema==2.6.0 +natsort==6.2.1 +netaddr==0.8.0 +netifaces==0.11.0 +psutil==5.9.5 +pyroute2==0.5.14 +python-arptable==0.0.2 +tabulate==0.9.0 +thrift==0.13.0 +websocket-client==1.5.1 +xmltodict==0.12.0 +zipp==1.2.0 \ No newline at end of file diff --git a/files/build/versions/build/build-sonic-slave-buster/versions-py3-all-arm64 b/files/build/versions/build/build-sonic-slave-buster/versions-py3-all-arm64 new file mode 100644 index 000000000000..693f98a4b850 --- /dev/null +++ b/files/build/versions/build/build-sonic-slave-buster/versions-py3-all-arm64 @@ -0,0 +1,3 @@ +bitarray==1.5.3 +lxml==4.9.1 +requests==2.30.0 \ No newline at end of file diff --git a/files/build/versions/build/build-sonic-slave-stretch/versions-deb-stretch b/files/build/versions/build/build-sonic-slave-stretch/versions-deb-stretch new file mode 100644 index 000000000000..af7a04c29723 --- /dev/null +++ b/files/build/versions/build/build-sonic-slave-stretch/versions-deb-stretch @@ -0,0 +1,24 @@ +libhiredis-dev==0.14.0-3~bpo9+1 +libhiredis0.14==0.14.0-3~bpo9+1 +libnl-3-dev==3.5.0-1 +libnl-cli-3-200==3.5.0-1 +libnl-cli-3-dev==3.5.0-1 +libnl-genl-3-200==3.5.0-1 +libnl-genl-3-dev==3.5.0-1 +libnl-nf-3-200==3.5.0-1 +libnl-nf-3-dev==3.5.0-1 +libnl-route-3-dev==3.5.0-1 +libsaimetadata==1.0.0 +libsaimetadata-dev==1.0.0 +libsainps==1.5.0 +libsairedis==1.0.0 +libsaivs==1.0.0 +libsaivs-dev==1.0.0 +libswsscommon==1.0.0 +libswsscommon-dev==1.0.0 +libthrift-0.11.0==0.11.0-4 +libthrift-dev==0.11.0-4 +python-swsscommon==1.0.0 +python-thrift==0.11.0-4 +syncd==1.0.0 +thrift-compiler==0.11.0-4 \ No newline at end of file diff --git a/files/build/versions/build/build-sonic-slave-stretch/versions-py2 b/files/build/versions/build/build-sonic-slave-stretch/versions-py2 new file mode 100644 index 000000000000..7a0c6a834d5e --- /dev/null +++ b/files/build/versions/build/build-sonic-slave-stretch/versions-py2 @@ -0,0 +1,15 @@ +bitarray==1.5.3 +contextlib2==0.6.0.post1 +future==0.18.3 +importlib-resources==3.3.1 +natsort==6.2.1 +netaddr==0.8.0 +pathlib2==2.3.7.post1 +pyang==2.5.3 +pyangbind==0.6.0 +redis==3.5.3 +sairedis==1.0 +scandir==1.10.0 +singledispatch==3.7.0 +thrift==0.11.0 +zipp==1.2.0 \ No newline at end of file diff --git a/files/build/versions/default/versions-docker b/files/build/versions/default/versions-docker new file mode 100644 index 000000000000..e11a8614132b --- /dev/null +++ b/files/build/versions/default/versions-docker @@ -0,0 +1,10 @@ +amd64:amd64/debian:buster==sha256:ebc58102f66492508f6d0f0c5164978afbe27f4a69bd3431ed8bb015c82a8b80 +amd64:amd64/debian:stretch==sha256:16ee3e11da473f6565ef94a715f1a38b3079e0664913be78869c336a71cb6085 +amd64:debian:buster==sha256:cca6bcced970f7634197ff1821aabb452024eb437958ab98bfc146ece96969c6 +amd64:debian:stretch==sha256:c5c5200ff1e9c73ffbf188b4a67eb1c91531b644856b4aefe86a58d2f0cb05be +arm64:arm64v8/debian:buster==sha256:4db99637cd48a7181532cbd61a0da9295ae135ac590f1948fea5cd7c9acfab0b +arm64:debian:buster==sha256:cca6bcced970f7634197ff1821aabb452024eb437958ab98bfc146ece96969c6 +arm64:debian:stretch==sha256:c5c5200ff1e9c73ffbf188b4a67eb1c91531b644856b4aefe86a58d2f0cb05be +armhf:arm32v7/debian:buster==sha256:9606bc9689ace2b3958d23babcf39a7bbcbebdc3ff99b9050014558273a95e4a +armhf:debian:buster==sha256:cca6bcced970f7634197ff1821aabb452024eb437958ab98bfc146ece96969c6 +armhf:debian:stretch==sha256:c5c5200ff1e9c73ffbf188b4a67eb1c91531b644856b4aefe86a58d2f0cb05be \ No newline at end of file diff --git a/files/build/versions/default/versions-git b/files/build/versions/default/versions-git new file mode 100644 index 000000000000..3668e197a3da --- /dev/null +++ b/files/build/versions/default/versions-git @@ -0,0 +1,20 @@ +https://chromium.googlesource.com/chromium/tools/depot_tools.git==f155639336aff1e8c3822974749ac695ec83b2b5 +https://github.com/aristanetworks/swi-tools.git==b5f087e4774168bf536360d43c9c509c8f14ad9f +https://github.com/CESNET/libyang.git==9a4e5b2ce30b9696116d6e654ee55caab5aafed8 +https://github.com/daveolson53/libnss-tacplus.git==19008ab68d9d504aa58eb34d5f564755a1613b8b +https://github.com/dyninc/OpenBFDD.git==e35f43ad8d2b3f084e96a84c392528a90d05a287 +https://github.com/jeroennijhof/pam_tacplus.git==4284d9016e64def2bb81d5f50f96dc3b59bfdc39 +https://github.com/jpirko/libteam.git==61e27812c1074a865d7e1a778c0ce442837c28d7 +https://github.com/lguohan/gnxi.git==f2b11e45b16ab13485ae14933f30c18ee6336499 +https://github.com/Marvell-switching/mrvl-prestera.git==21a100e01b2ab00229da35dd178d9b294c66303f +https://github.com/Mellanox/libpsample.git==62bb27d9a49424e45191eee81df7ce0d8c74e774 +https://github.com/p4lang/scapy-vxlan.git==85ffe83da156568ee47a0750f638227e6e1d7479 +https://github.com/sflow/host-sflow==74f819f9695975fa9746c3e61888646d58c34ded +https://github.com/sflow/sflowtool==4ce1223bb4c2cd0cbb1dd688dc0914561fcbb6c4 +https://github.com/thom311/libnl==cbafad9ddf24caef5230fef715d34f0539603be0 +https://salsa.debian.org/debian/libteam.git==48142125234a665ad5367b724af36a58fb484d3d +https://salsa.debian.org/dhcp-team/isc-dhcp.git==1a94f4dc97f1c8bcaf848117eb4477ed1a987a93 +https://salsa.debian.org/kernel-team/ethtool/==68409b09a969b49a07fbf3930409f155b953434b +https://salsa.debian.org/kernel-team/initramfs-tools.git==40e544e13611c1b2690eb99a8096fc16c1b9c74e +https://salsa.debian.org/sk-guest/monit.git==c9da7ebb1f35dfba17b50b5969a6e75e29cbec0d +https://salsa.debian.org/ssh-team/openssh.git==4cb9ac54235e8f90a590a976e1404480fb521930 \ No newline at end of file diff --git a/files/build/versions/default/versions-mirror b/files/build/versions/default/versions-mirror new file mode 100644 index 000000000000..e86f48b12ed1 --- /dev/null +++ b/files/build/versions/default/versions-mirror @@ -0,0 +1,14 @@ +deb.nodesource.com_node%5f10.x_dists_stretch==2021-04-06T21:05:39Z +deb.nodesource.com_node%5f14.x_dists_buster==2023-02-17T00:35:28Z +debian==20230509T000212Z +debian-security==20230509T000551Z +download.docker.com_linux_debian_dists_buster==2023-05-08T10:44:31Z +download.docker.com_linux_debian_dists_stretch==2021-02-01T21:46:06Z +packages.microsoft.com_repos_sonic-dev_dists_jessie==2022-10-31T19:34:29Z +packages.trafficmanager.net_snapshot_debian-security_20230509T000551Z_dists_buster_updates==2023-05-07T12:12:18Z +packages.trafficmanager.net_snapshot_debian-security_20230509T000551Z_dists_stretch_updates==2023-02-18T04:22:44Z +packages.trafficmanager.net_snapshot_debian_20230509T000212Z_dists_buster==2022-09-10T11:30:54Z +packages.trafficmanager.net_snapshot_debian_20230509T000212Z_dists_buster-backports==2023-05-08T20:10:02Z +packages.trafficmanager.net_snapshot_debian_20230509T000212Z_dists_buster-updates==2023-05-08T20:10:02Z +packages.trafficmanager.net_snapshot_debian_20230509T000212Z_dists_stretch-backports==2023-03-30T14:20:42Z +packages.trafficmanager.net_snapshot_debian_20230509T000212Z_dists_stretch-updates==2021-08-14T07:47:11Z \ No newline at end of file diff --git a/files/build/versions/default/versions-web b/files/build/versions/default/versions-web new file mode 100644 index 000000000000..d3ee9979d80c --- /dev/null +++ b/files/build/versions/default/versions-web @@ -0,0 +1,102 @@ +http://deb.debian.org/debian/pool/main/d/doxygen/doxygen_1.8.13-10.debian.tar.xz==09198160fb3dfa4c33ce143e3bf1c470 +http://deb.debian.org/debian/pool/main/d/doxygen/doxygen_1.8.13-10.dsc==f831a76f1a1f76622dcacba2af01ddcb +http://deb.debian.org/debian/pool/main/d/doxygen/doxygen_1.8.13.orig.tar.gz==0fa414975f8cd6d30e126c28327c1f7c +http://deb.debian.org/debian/pool/main/i/iptables/iptables_1.8.2-4.debian.tar.xz==c27e499611c48ba307792518d29cdcc7 +http://deb.debian.org/debian/pool/main/i/iptables/iptables_1.8.2-4.dsc==d9572a9f48c88293341681601a7b18c5 +http://deb.debian.org/debian/pool/main/i/iptables/iptables_1.8.2.orig.tar.bz2==944558e88ddcc3b9b0d9550070fa3599 +http://deb.debian.org/debian/pool/main/l/lm-sensors/lm-sensors_3.5.0-3.debian.tar.xz==c2a4cd6b79350378ca9a337b45b732c5 +http://deb.debian.org/debian/pool/main/l/lm-sensors/lm-sensors_3.5.0-3.dsc==86e28662fa00bec000f22257d212873d +http://deb.debian.org/debian/pool/main/l/lm-sensors/lm-sensors_3.5.0.orig.tar.gz==37981f5d3a0f649381529cb41c0f1ff3 +http://deb.debian.org/debian/pool/main/m/makedumpfile/makedumpfile_1.6.1-1.debian.tar.xz==a677f850ad1e4f2600cc9c3f3c872927 +http://deb.debian.org/debian/pool/main/m/makedumpfile/makedumpfile_1.6.1.orig.tar.gz==16c0ae9902ae57be4a603a6ab1e86c53 +http://deb.debian.org/debian/pool/main/n/ntp/ntp_4.2.8p12+dfsg-4.debian.tar.xz==bec40e0bda23a893e76843579c68d901 +http://deb.debian.org/debian/pool/main/n/ntp/ntp_4.2.8p12+dfsg.orig.tar.xz==71044a49f4ab09c9bc10ed9862d22939 +http://deb.debian.org/debian/pool/main/t/thrift//thrift_0.13.0-6.debian.tar.xz==4c0d6cab366b4fdb0372299ecc8a219a +http://deb.debian.org/debian/pool/main/t/thrift//thrift_0.13.0-6.dsc==278cfe25d286d1840ee366b557ed6ab0 +http://deb.debian.org/debian/pool/main/t/thrift//thrift_0.13.0.orig.tar.gz==38a27d391a2b03214b444cb13d5664f1 +http://http.debian.net/debian/pool/main/h/hiredis/hiredis_0.14.0-3~bpo9+1.debian.tar.xz==ef340aedc6fd42c549cd503bffb498b2 +http://http.debian.net/debian/pool/main/h/hiredis/hiredis_0.14.0-3~bpo9+1.dsc==be4ce11ef67268e59e4b6be587327c40 +http://http.debian.net/debian/pool/main/h/hiredis/hiredis_0.14.0.orig.tar.gz==6d565680a4af0d2e261abbc3e3431b2b +http://www.mellanox.com/downloads/MFT/mft-4.21.0-100-x86_64-deb.tgz==51efe115cbada1120fefe7e4c6958baf +https://bootstrap.pypa.io/pip/2.7/get-pip.py==60e8267eb1b7bc71dc4843eb7bd294d3 +https://deb.nodesource.com/gpgkey/nodesource.gpg.key==003b51a89a133b5db4cca98b2dea3117 +https://deb.nodesource.com/node_10.x/dists/stretch/Release==22738118af583db3bfad39d6fcb4fa5a +https://deb.nodesource.com/node_14.x/dists/buster/Release==42875141604382f0abb4d047f645dfe1 +https://deb.nodesource.com/setup_10.x==6742c0148159980e8f6e886df1f8bbe1 +https://deb.nodesource.com/setup_14.x==1c9de9348c0acd5f2ee422a6d0c333b3 +https://download.docker.com/linux/debian/gpg==1afae06b34a13c1b3d9cb61a26285a15 +https://github.com/aristanetworks/sonic-firmware/raw/6d0d1661d92a342acedb6839dba970ae5778b478/phy/phy-credo_1.0_amd64.deb==dd74acbb7bf979b01c1a89e2a628aaf3 +https://github.com/barefootnetworks/sonic-release-pkgs/raw/dev/bfnplatform_20220221_sai.1.7.1_deb10.deb==65de37f7834823ba69ab5e55acc5c5f4 +https://github.com/barefootnetworks/sonic-release-pkgs/raw/dev/bfnsdk_20220221_sai.1.7.1_deb10.deb==75df8156b85467b501dc67f1914d6ed7 +https://github.com/CentecNetworks/sonic-binaries/raw/master/amd64/libsai_1.6.3-1_amd64.deb==e7a41e5cf06b44ae3ed615d553de40d3 +https://github.com/CentecNetworks/sonic-binaries/raw/master/arm64/sai/libsai_1.6.3-1_arm64.deb==4121f09fbc5319cd488b832d72287f93 +https://github.com/CumulusNetworks/ifupdown2/archive/1.2.8-1.tar.gz==12f45e90d23178e96cf70f68dc9455e6 +https://github.com/Marvell-switching/sonic-marvell-binaries/raw/master/armhf/sai-plugin/mrvllibsai_1.7.1-9_armhf.deb==b21b91609632e813443ccb00bf2d7c61 +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/fw-2010.3196/fw-SPC-rel-13_2010_3196-EVB.mfa==3188bdd7b67e8f7f910b043a30605b2d +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/fw-2010.3196/fw-SPC2-rel-29_2010_3196-EVB.mfa==8ca33224c84c249c028ae605f0d32f00 +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/fw-2010.3196/fw-SPC3-rel-30_2010_3196-EVB.mfa==2bb7889c3037a284e6fa6d0be1b2a4ce +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.5.3196-buster-amd64/applibs-dev_1.mlnx.4.5.3196_amd64.deb==bca0bca15d7513ca5e1946b192e44c40 +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.5.3196-buster-amd64/applibs_1.mlnx.4.5.3196_amd64.deb==346c327d87bfbb215008111270e70bc7 +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.5.3196-buster-amd64/iproute2-dev_1.mlnx.4.5.3196_amd64.deb==16523e010d7da24776eddb9eebb62928 +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.5.3196-buster-amd64/iproute2_1.mlnx.4.5.3196_amd64.deb==cdac0683373430337ebf4993c0671c94 +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.5.3196-buster-amd64/python-sdk-api_1.mlnx.4.5.3196_amd64.deb==2d39c06854baccb824e4bcbb511b9893 +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.5.3196-buster-amd64/sx-acl-helper-dev_1.mlnx.4.5.3196_amd64.deb==76d1c90f31c287d28a42f889f564f985 +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.5.3196-buster-amd64/sx-acl-helper_1.mlnx.4.5.3196_amd64.deb==d01432a647031c8a59213a64ee62f9be +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.5.3196-buster-amd64/sx-complib-dev_1.mlnx.4.5.3196_amd64.deb==de4b166603e9cc64d8f345e8014bc681 +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.5.3196-buster-amd64/sx-complib_1.mlnx.4.5.3196_amd64.deb==254bdfd1c43d76df234014523eecca54 +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.5.3196-buster-amd64/sx-examples-dev_1.mlnx.4.5.3196_amd64.deb==d9e740543b849cbae5a318e5a270688d +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.5.3196-buster-amd64/sx-examples_1.mlnx.4.5.3196_amd64.deb==26c3b5d9514ace617749365b7c3d13eb +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.5.3196-buster-amd64/sx-gen-utils-dev_1.mlnx.4.5.3196_amd64.deb==487c5f6ec1b7e0843ea897d61f102e4f +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.5.3196-buster-amd64/sx-gen-utils_1.mlnx.4.5.3196_amd64.deb==78bbee23285135f278fec078ef1dd5f5 +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.5.3196-buster-amd64/sx-scew-dev_1.mlnx.4.5.3196_amd64.deb==5636861512458c74ec7cdd3193f4cada +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.5.3196-buster-amd64/sx-scew_1.mlnx.4.5.3196_amd64.deb==2d76cf5b94118fc1517931ce5dc00146 +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.5.3196-buster-amd64/sxd-libs-dev_1.mlnx.4.5.3196_amd64.deb==17808d341f45faeaa1910c139b5c9fc2 +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.5.3196-buster-amd64/sxd-libs_1.mlnx.4.5.3196_amd64.deb==af03da363f25290115f7f9c3b518845b +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.5.3196-buster-amd64/wjh-libs-dev_1.mlnx.4.5.3196_amd64.deb==53e45e4808fcbd2c2103791519a549c9 +https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins/releases/download/sdk-4.5.3196-buster-amd64/wjh-libs_1.mlnx.4.5.3196_amd64.deb==72d4fa9ea3ed41cf2aa49d543d4d8748 +https://github.com/Mellanox/Spectrum-SDK-Drivers/archive/refs/heads/4.5.3196.zip==076370f8d35af0a4b6e82ae565132801 +https://github.com/nanomsg/nanomsg/archive/1.0.0.tar.gz==6f56ef28c93cee644e8c4aaaef7cfb55 +https://github.com/NephosInc/SONiC/raw/master/sai/libsainps-dev_3.0.0_sai_1.5.0_06a67d_amd64.deb==64931041f82533e2a05e003ed9d878c8 +https://github.com/NephosInc/SONiC/raw/master/sai/libsainps_3.0.0_sai_1.5.0_06a67d_amd64.deb==385b84051259ebb2580522a990cca161 +https://github.com/NephosInc/SONiC/raw/master/sdk/npx_diag==a444c876aaf2a8b4c99238f15fbc13a0 +https://raw.githubusercontent.com/p4lang/ptf/master/ptf_nn/ptf_nn_agent.py==628956b660575965429cec84b1778816 +https://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/2.4.5/swagger-codegen-cli-2.4.5.jar==219f1453ff22482d9e080effbfa7fa81 +https://sonicstorage.blob.core.windows.net/debian-security/pool/updates/main/l/linux/linux_4.19.152-1.debian.tar.xz==875d84b0edad0210c090195a8df4eb6c +https://sonicstorage.blob.core.windows.net/debian-security/pool/updates/main/l/linux/linux_4.19.152-1.dsc==e76d5deda89795939828c3b39b31d38f +https://sonicstorage.blob.core.windows.net/debian-security/pool/updates/main/l/linux/linux_4.19.152.orig.tar.xz==e3afaa4ac1387449dec703da494dd991 +https://sonicstorage.blob.core.windows.net/debian/pool/main/l/lldpd/lldpd_1.0.4-1.debian.tar.xz==0a529cf8d1717b5c3dbe0c61b3512aa1 +https://sonicstorage.blob.core.windows.net/debian/pool/main/l/lldpd/lldpd_1.0.4-1.dsc==b88b922d96688c948e90987fcaa3a2de +https://sonicstorage.blob.core.windows.net/debian/pool/main/l/lldpd/lldpd_1.0.4.orig.tar.gz==33e8d58623f99184e4e709cbbfe45db3 +https://sonicstorage.blob.core.windows.net/debian/pool/main/liby/libyang/libyang_1.0.184-2.debian.tar.xz==f159fbedc0b69d00b2bdb08db283c0bb +https://sonicstorage.blob.core.windows.net/debian/pool/main/liby/libyang/libyang_1.0.184-2.dsc==98c68654fadc116346007be9282ae357 +https://sonicstorage.blob.core.windows.net/debian/pool/main/liby/libyang/libyang_1.0.184.orig.tar.gz==0ddfdf2dba5e73486c133c1fba1b3e8e +https://sonicstorage.blob.core.windows.net/debian/pool/main/n/net-snmp/net-snmp_5.7.3+dfsg-5.debian.tar.xz==ad957e90207d0669beb2109e4e325def +https://sonicstorage.blob.core.windows.net/debian/pool/main/n/net-snmp/net-snmp_5.7.3+dfsg-5.dsc==2443e4dffbdb020e7ab4f947a7904912 +https://sonicstorage.blob.core.windows.net/debian/pool/main/n/net-snmp/net-snmp_5.7.3+dfsg.orig.tar.xz==6391ae27eb1ae34ff5530712bb1c4209 +https://sonicstorage.blob.core.windows.net/packages/20190307/bcmcmd?sv=2015-04-05&sr=b&sig=sUdbU7oVbh5exbXXHVL5TDFBTWDDBASHeJ8Cp0B0TIc%3D&se=2038-05-06T22%3A34%3A19Z&sp=r==b8aefc751bdf93218716bca6797460ff +https://sonicstorage.blob.core.windows.net/packages/20190307/dsserve?sv=2015-04-05&sr=b&sig=lk7BH3DtW%2F5ehc0Rkqfga%2BUCABI0UzQmDamBsZH9K6w%3D&se=2038-05-06T22%3A34%3A45Z&sp=r==f9d4b815ebb9be9f755dedca8a51170d +https://sonicstorage.blob.core.windows.net/packages/cmake/cmake-data_3.13.2-1_bpo9%2B1_all.deb?st=2020-03-27T02%3A22%3A24Z&se=2100-03-26T19%3A00%3A00Z&sp=rl&sv=2018-03-28&sr=b&sig=Xby%2Bm3OZOjPB%2FSlDbHD65yDcPzAgoys%2FA3vK8RB4BzA%3D==147cf42f3a68f6d6f1e53d95a599a1af +https://sonicstorage.blob.core.windows.net/packages/cmake/cmake_3.13.2-1_bpo9%2B1_amd64.deb?st=2020-03-27T02%3A27%3A21Z&se=2100-03-26T19%3A00%3A00Z&sp=rl&sv=2018-03-28&sr=b&sig=4MvmmDBQuicFEJYakLm7xCNU19yJ8GIP4ankFSnITKY%3D==e75c741e8b6918b8f03625e456fa0275 +https://sonicstorage.blob.core.windows.net/packages/cmake/cmake_3.13.2-1_bpo9%2B1_arm64.deb?st=2020-03-27T02%3A28%3A38Z&se=2100-03-26T19%3A00%3A00Z&sp=rl&sv=2018-03-28&sr=b&sig=rrHMkLi29aI8yH6s52ILCY8VcEbNFrzYT2DmC5RwOgs%3D==9bcc989e6ed168717f67c07e79177d4a +https://sonicstorage.blob.core.windows.net/packages/cmake/cmake_3.13.2-1_bpo9%2B1_armhf.deb?st=2020-03-27T02%3A29%3A41Z&se=2100-03-26T19%3A00%3A00Z&sp=rl&sv=2018-03-28&sr=b&sig=sWt7kxrFumn020d2GeutGJ716cuQsFwmAmgU%2BJ0kqnk%3D==b5625da7ac620a2ae869653b9e5318ed +https://sonicstorage.blob.core.windows.net/packages/debian/smartmontools_6.6-1.debian.tar.xz?sv=2015-04-05&sr=b&sig=H0RFeC41MCvhTQCln85DuPLn5v2goozwz%2FB9sA9p5eQ%3D&se=2046-08-20T23%3A46%3A02Z&sp=r==47a284f4762f86ba24753ea75d85e6cb +https://sonicstorage.blob.core.windows.net/packages/debian/smartmontools_6.6-1.dsc?sv=2015-04-05&sr=b&sig=IS7FKUN%2Bvq0T55f4X2hGAViB70Y%2FgzjGgvzpUJLyUfA%3D&se=2046-08-20T23%3A46%3A57Z&sp=r==151f97b46df2dafbd5bb954bb419642c +https://sonicstorage.blob.core.windows.net/packages/debian/smartmontools_6.6.orig.tar.gz?sv=2015-04-05&sr=b&sig=JZx4qiLuO36T0rsGqk4V2RDuWjRw6NztsLK7vlBYAkg%3D&se=2046-08-20T23%3A47%3A13Z&sp=r==9ae2c6e7131cd2813edcc65cbe5f223f +https://sonicstorage.blob.core.windows.net/packages/debian/socat_1.7.3.1-2+deb9u1.debian.tar.xz?sv=2015-04-05&sr=b&sig=yv77Fr5RtZgRTPmJK3j0lZ0BzsCiGaSs2i7NqQKEy2Y%3D&se=2155-07-05T11%3A39%3A59Z&sp=r==84dc9e966e116384ac13aeca16b9437a +https://sonicstorage.blob.core.windows.net/packages/debian/socat_1.7.3.1-2+deb9u1.dsc?sv=2015-04-05&sr=b&sig=Ph7aMqb%2F%2FE%2F8qwxMXoXb5oK1YPkfVt6PV8mBBv5Wi%2F4%3D&se=2155-07-05T11%3A42%3A29Z&sp=r==b14d356861eaa916f7f19098ab7b1d4e +https://sonicstorage.blob.core.windows.net/packages/debian/socat_1.7.3.1.orig.tar.gz?sv=2015-04-05&sr=b&sig=0Ai1FM604aGsF5uBu2yN8w9O1a6zNjIDCdaiTo24DyQ%3D&se=2155-07-05T11%3A40%3A14Z&sp=r==fbab6334919cbd71433213db18dbbdf0 +https://sonicstorage.blob.core.windows.net/packages/debian/thrift_0.11.0-4.debian.tar.xz?sv=2015-04-05&sr=b&sig=dj9uJ5YjUNupcmuxSX6%2F5IS9NqaGAyM9iF2h%2F2rROZA%3D&se=2156-02-02T17%3A19%3A34Z&sp=r==52ad383b97ad051f4d1d25b54aaad569 +https://sonicstorage.blob.core.windows.net/packages/debian/thrift_0.11.0-4.dsc?sv=2015-04-05&sr=b&sig=pWfg55owvQ2jZtZ6ylHp0OP8uZyfc9sxO6H%2BP4Ez7w4%3D&se=2156-02-02T17%3A20%3A05Z&sp=r==6917fe7b3ada9313be94713dd50fee7b +https://sonicstorage.blob.core.windows.net/packages/debian/thrift_0.11.0.orig.tar.gz?sv=2015-04-05&sr=b&sig=%2BrAjWESiSNRCMN7NGqEqVGceLefpwwS%2FWPKEfJpPLSQ%3D&se=2156-02-02T17%3A17%3A20Z&sp=r==0be59730ebce071eceaf6bfdb8d3a20e +https://sonicstorage.blob.core.windows.net/packages/onie/onie-recovery-x86_64-kvm_x86_64-r0.iso?sv=2015-04-05&sr=b&sig=XMAk1cttBFM369CMbihe5oZgXwe4uaDVfwg4CTLT%2F5U%3D&se=2155-10-13T10%3A40%3A13Z&sp=r==54e11e450a461b1f4ae39c3ce3f15eff +https://sonicstorage.blob.core.windows.net/packages/redis/redis-server_6.0.6-1_bpo10+1_arm64.deb?sv=2015-04-05&sr=b&sig=622w2KzIKIjAaaA0Bz12MzU%2BUBzY2AiXFIFfuKNoKSk%3D&se=2030-10-24T04%3A21%3A44Z&sp=r==6d79c60549ce33889bfb9c4def5c532a +https://sonicstorage.blob.core.windows.net/packages/redis/redis-server_6.0.6-1_bpo10+1_armhf.deb?sv=2015-04-05&sr=b&sig=xTdayvm0RBguxi9suyv855jKRjU%2FmKQ8nHuct4WSX%2FA%3D&se=2030-10-24T04%3A22%3A05Z&sp=r==dd2c1ce3d3d789167676c35c808f4c8a +https://sonicstorage.blob.core.windows.net/packages/redis/redis-server_6.0.6-1~bpo10+1_amd64.deb?sv=2015-04-05&sr=b&sig=2Ketg7BmkZEaTxR%2FgvAFVmhjn7ywdmkc7l2T2rsL57o%3D&se=2030-09-06T19%3A45%3A20Z&sp=r==09af97c096f4c854d238f91614a3415b +https://sonicstorage.blob.core.windows.net/packages/redis/redis-tools_6.0.6-1_bpo10+1_arm64.deb?sv=2015-04-05&sr=b&sig=GbkJV2wWln3hoz27zKi5erdk3NDKrAFrQriA97bcRCY%3D&se=2030-10-24T04%3A22%3A21Z&sp=r==282b4766cc9ac7d8bb70622bd69d9f5c +https://sonicstorage.blob.core.windows.net/packages/redis/redis-tools_6.0.6-1_bpo10+1_armhf.deb?sv=2015-04-05&sr=b&sig=67vHAMxsl%2BS3X1KsqhdYhakJkGdg5FKSPgU8kUiw4as%3D&se=2030-10-24T04%3A22%3A40Z&sp=r==62f287117afab6caaec564232ebbb5de +https://sonicstorage.blob.core.windows.net/packages/redis/redis-tools_6.0.6-1~bpo10+1_amd64.deb?sv=2015-04-05&sr=b&sig=73zbmjkf3pi%2Bn0R8Hy7CWT2EUvOAyzM5aLYJWCLySGM%3D&se=2030-09-06T19%3A44%3A59Z&sp=r==2d58c3c3358290c04d5e0ba70f297f18 +https://sonicstorage.blob.core.windows.net/public/sai/bcmsai/REL_4.3_202012/4.3.7.1-7/libsaibcm-dev_4.3.7.1-7_amd64.deb==ec7a1c729dca33d18a71ac8a15f5ef0b +https://sonicstorage.blob.core.windows.net/public/sai/bcmsai/REL_4.3_202012/4.3.7.1-7/libsaibcm_4.3.7.1-7_amd64.deb==29314badd4324537d6be08acfff59d02 +https://storage.googleapis.com/golang/go1.14.2.linux-amd64.tar.gz==856d248e3ea8a287d13e5f6afd086282 +https://storage.googleapis.com/golang/go1.14.2.linux-arm64.tar.gz==e5f79b403701e00f20d13f0ea561b064 +https://storage.googleapis.com/golang/go1.14.2.linux-armv6l.tar.gz==04467414e783b18de4278e9f24baf4be \ No newline at end of file diff --git a/files/build/versions/dockers/docker-base-buster/versions-deb-buster b/files/build/versions/dockers/docker-base-buster/versions-deb-buster new file mode 100644 index 000000000000..157ce34ade2f --- /dev/null +++ b/files/build/versions/dockers/docker-base-buster/versions-deb-buster @@ -0,0 +1,71 @@ +ca-certificates==20200601~deb10u2 +curl==7.64.0-4+deb10u6 +jq==1.5+dfsg-2+b1 +less==487-0.1+b1 +libatomic1==8.3.0-6 +libcurl4==7.64.0-4+deb10u6 +libdaemon0==0.14-7 +libdbus-1-3==1.12.24-0+deb10u1 +libestr0==0.1.10-2.1 +libexpat1==2.2.6-2+deb10u6 +libfastjson4==0.99.8-2 +libgdbm-compat4==1.18.1-4 +libgdbm6==1.18.1-4 +libgssapi-krb5-2==1.17-3+deb10u5 +libjansson4==2.12-1 +libjemalloc2==5.1.0-3 +libjq1==1.5+dfsg-2+b1 +libk5crypto3==1.17-3+deb10u5 +libkeyutils1==1.6-6 +libkrb5-3==1.17-3+deb10u5 +libkrb5support0==1.17-3+deb10u5 +libldap-2.4-2==2.4.47+dfsg-3+deb10u7 +libldap-common==2.4.47+dfsg-3+deb10u7 +liblognorm5==2.0.5-1 +liblua5.1-0==5.1.5-8.1+b2 +libmpdec2==2.4.2-2 +libncurses6==6.1+20181013-2+deb10u3 +libnghttp2-14==1.36.0-2+deb10u1 +libnorm1==1.5.8+dfsg2-1 +libonig5==6.9.1-1 +libperl5.28==5.28.1-6+deb10u1 +libpgm-5.2-0==5.2.122~dfsg-3 +libprocps7==2:3.3.15-2 +libpsl5==0.20.2-2 +libpython3-stdlib==3.7.3-1 +libpython3.7-minimal==3.7.3-2+deb10u4 +libpython3.7-stdlib==3.7.3-2+deb10u4 +libreadline7==7.0-5 +librtmp1==2.4+20151223.gitfa8646d.1-2 +libsasl2-2==2.1.27+dfsg-1+deb10u2 +libsasl2-modules-db==2.1.27+dfsg-1+deb10u2 +libsodium23==1.0.17-1 +libsqlite3-0==3.27.2-3+deb10u2 +libssh2-1==1.8.0-2.1 +libssl1.1==1.1.1n-0+deb10u4 +libwrap0==7.6.q-28 +libzmq5==4.3.1-4+deb10u2 +lsb-base==10.2019051400 +lua-bitop==1.0.2-5 +lua-cjson==2.1.0+dfsg-2.1 +mime-support==3.62 +net-tools==1.60+git20180626.aebd88e-1 +openssl==1.1.1n-0+deb10u4 +perl==5.28.1-6+deb10u1 +perl-modules-5.28==5.28.1-6+deb10u1 +procps==2:3.3.15-2 +python-pip-whl==18.1-5 +python3==3.7.3-1 +python3-distutils==3.7.3-1 +python3-lib2to3==3.7.3-1 +python3-minimal==3.7.3-1 +python3-pip==18.1-5 +python3.7==3.7.3-2+deb10u4 +python3.7-minimal==3.7.3-2+deb10u4 +readline-common==7.0-5 +redis-tools==5:6.0.6-1~bpo10+1 +rsyslog==8.1901.0-1+deb10u2 +socat==1.7.3.1-2+deb9u1 +vim-common==2:8.1.0875-5+deb10u4 +vim-tiny==2:8.1.0875-5+deb10u4 +xxd==2:8.1.0875-5+deb10u4 \ No newline at end of file diff --git a/files/build/versions/dockers/docker-base-buster/versions-py3 b/files/build/versions/dockers/docker-base-buster/versions-py3 new file mode 100644 index 000000000000..cf6bd999d21e --- /dev/null +++ b/files/build/versions/dockers/docker-base-buster/versions-py3 @@ -0,0 +1,6 @@ +j2cli==0.3.10 +jinja2==3.1.2 +markupsafe==2.1.2 +supervisor==4.2.1 +supervisord-dependent-startup==1.4.0 +toposort==1.10 \ No newline at end of file diff --git a/files/build/versions/dockers/docker-base-stretch/versions-deb-stretch b/files/build/versions/dockers/docker-base-stretch/versions-deb-stretch new file mode 100644 index 000000000000..456ed031ac62 --- /dev/null +++ b/files/build/versions/dockers/docker-base-stretch/versions-deb-stretch @@ -0,0 +1,76 @@ +ca-certificates==20200601~deb9u2 +curl==7.52.1-5+deb9u16 +jq==1.5+dfsg-1.3 +less==481-2.1 +libatomic1==6.3.0-18+deb9u1 +libcurl3==7.52.1-5+deb9u16 +libdaemon0==0.14-6 +libdbus-1-3==1.10.32-0+deb9u1 +libestr0==0.1.10-2 +libexpat1==2.2.0-2+deb9u5 +libfastjson4==0.99.8-1~bpo9+1 +libffi6==3.2.1-6 +libgdbm3==1.8.3-14 +libgmp10==2:6.1.2+dfsg-1+deb9u1 +libgnutls30==3.5.8-5+deb9u6 +libgssapi-krb5-2==1.15-1+deb9u3 +libhiredis0.14==0.14.0-3~bpo9+1 +libhogweed4==3.3-1+deb9u1 +libidn2-0==0.16-1+deb9u1 +libjansson4==2.9-1 +libjemalloc1==3.6.0-9.1 +libjq1==1.5+dfsg-1.3 +libk5crypto3==1.15-1+deb9u3 +libkeyutils1==1.5.9-9 +libkrb5-3==1.15-1+deb9u3 +libkrb5support0==1.15-1+deb9u3 +libldap-2.4-2==2.4.44+dfsg-5+deb9u9 +libldap-common==2.4.44+dfsg-5+deb9u9 +liblognorm5==2.0.3-1~bpo9+1 +liblua5.1-0==5.1.5-8.1+b2 +libncurses5==6.0+20161126-1+deb9u2 +libnghttp2-14==1.18.1-1+deb9u2 +libonig4==6.1.3-2+deb9u2 +libp11-kit0==0.23.3-2+deb9u1 +libperl5.24==5.24.1-3+deb9u7 +libpgm-5.2-0==5.2.122~dfsg-2 +libprocps6==2:3.3.12-3+deb9u1 +libpsl5==0.17.0-3 +libpython-stdlib==2.7.13-2 +libpython2.7==2.7.13-2+deb9u6 +libpython2.7-minimal==2.7.13-2+deb9u6 +libpython2.7-stdlib==2.7.13-2+deb9u6 +libreadline7==7.0-3 +librtmp1==2.4+20151223.gitfa8646d.1-1+b1 +libsasl2-2==2.1.27~101-g0780600+dfsg-3+deb9u2 +libsasl2-modules-db==2.1.27~101-g0780600+dfsg-3+deb9u2 +libsodium18==1.0.11-2 +libsqlite3-0==3.16.2-5+deb9u3 +libssh2-1==1.7.0-1+deb9u2 +libssl1.0.2==1.0.2u-1~deb9u7 +libssl1.1==1.1.0l-1~deb9u6 +libtasn1-6==4.10-1.1+deb9u1 +libunistring0==0.9.6+really0.9.3-0.1 +libwrap0==7.6.q-26 +libzmq5==4.2.1-4+deb9u4 +lua-bitop==1.0.2-4 +lua-cjson==2.1.0+dfsg-2 +mime-support==3.60 +net-tools==1.60+git20161116.90da8a0-1 +openssl==1.1.0l-1~deb9u6 +perl==5.24.1-3+deb9u7 +perl-modules-5.24==5.24.1-3+deb9u7 +procps==2:3.3.12-3+deb9u1 +python==2.7.13-2 +python-minimal==2.7.13-2 +python-pip==9.0.1-2+deb9u2 +python-pip-whl==9.0.1-2+deb9u2 +python2.7==2.7.13-2+deb9u6 +python2.7-minimal==2.7.13-2+deb9u6 +readline-common==7.0-3 +redis-tools==5:6.0.6-1~bpo10+1 +rsyslog==8.1901.0-1~bpo9+1 +socat==1.7.3.1-2+deb9u1 +vim-common==2:8.0.0197-4+deb9u7 +vim-tiny==2:8.0.0197-4+deb9u7 +xxd==2:8.0.0197-4+deb9u7 \ No newline at end of file diff --git a/files/build/versions/dockers/docker-base-stretch/versions-py2 b/files/build/versions/dockers/docker-base-stretch/versions-py2 new file mode 100644 index 000000000000..888ec533991a --- /dev/null +++ b/files/build/versions/dockers/docker-base-stretch/versions-py2 @@ -0,0 +1,6 @@ +j2cli==0.3.10 +jinja2==2.11.3 +markupsafe==1.1.1 +supervisor==4.2.5 +supervisord-dependent-startup==1.4.0 +toposort==1.7 \ No newline at end of file diff --git a/files/build/versions/dockers/docker-config-engine-buster/versions-deb-buster b/files/build/versions/dockers/docker-config-engine-buster/versions-deb-buster new file mode 100644 index 000000000000..2b152acbf649 --- /dev/null +++ b/files/build/versions/dockers/docker-config-engine-buster/versions-deb-buster @@ -0,0 +1,51 @@ +apt-utils==1.8.2.3 +binutils==2.31.1-16 +binutils-common==2.31.1-16 +binutils-x86-64-linux-gnu==2.31.1-16 +build-essential==12.6 +bzip2==1.0.6-9.2~deb10u2 +cpp==4:8.3.0-1 +cpp-8==8.3.0-6 +dh-python==3.20190308 +dpkg-dev==1.19.8 +g++==4:8.3.0-1 +g++-8==8.3.0-6 +gcc==4:8.3.0-1 +gcc-8==8.3.0-6 +libapt-inst2.0==1.8.2.3 +libasan5==8.3.0-6 +libbinutils==2.31.1-16 +libc-dev-bin==2.28-10+deb10u2 +libc6-dev==2.28-10+deb10u2 +libcc1-0==8.3.0-6 +libdpkg-perl==1.19.8 +libexpat1-dev==2.2.6-2+deb10u6 +libgcc-8-dev==8.3.0-6 +libgomp1==8.3.0-6 +libhiredis0.14==0.14.0-3~bpo9+1 +libisl19==0.20-2 +libitm1==8.3.0-6 +liblsan0==8.3.0-6 +libmpc3==1.1.0-1 +libmpfr6==4.0.2-1 +libmpx2==8.3.0-6 +libnl-3-200==3.5.0-1 +libnl-cli-3-200==3.5.0-1 +libnl-genl-3-200==3.5.0-1 +libnl-nf-3-200==3.5.0-1 +libnl-route-3-200==3.5.0-1 +libpython3-dev==3.7.3-1 +libpython3.7==3.7.3-2+deb10u4 +libpython3.7-dev==3.7.3-2+deb10u4 +libquadmath0==8.3.0-6 +libstdc++-8-dev==8.3.0-6 +libswsscommon==1.0.0 +libtsan0==8.3.0-6 +libubsan1==8.3.0-6 +linux-libc-dev==4.19.282-1 +make==4.2.1-1.2 +patch==2.7.6-3+deb10u1 +python3-dev==3.7.3-1 +python3-swsscommon==1.0.0 +python3.7-dev==3.7.3-2+deb10u4 +xz-utils==5.2.4-1+deb10u1 \ No newline at end of file diff --git a/files/build/versions/dockers/docker-config-engine-buster/versions-deb-buster-arm64 b/files/build/versions/dockers/docker-config-engine-buster/versions-deb-buster-arm64 new file mode 100644 index 000000000000..97242e31d245 --- /dev/null +++ b/files/build/versions/dockers/docker-config-engine-buster/versions-deb-buster-arm64 @@ -0,0 +1,11 @@ +binutils-aarch64-linux-gnu==2.31.1-16 +icu-devtools==63.1-6+deb10u3 +libglib2.0-0==2.58.3-2+deb10u4 +libicu-dev==63.1-6+deb10u3 +libicu63==63.1-6+deb10u3 +libxml2==2.9.4+dfsg1-7+deb10u6 +libxml2-dev==2.9.4+dfsg1-7+deb10u6 +libxslt1-dev==1.1.32-2.2~deb10u2 +libxslt1.1==1.1.32-2.2~deb10u2 +pkg-config==0.29-6 +zlib1g-dev==1:1.2.11.dfsg-1+deb10u2 \ No newline at end of file diff --git a/files/build/versions/dockers/docker-config-engine-buster/versions-deb-buster-armhf b/files/build/versions/dockers/docker-config-engine-buster/versions-deb-buster-armhf new file mode 100644 index 000000000000..bf76e3ccb71b --- /dev/null +++ b/files/build/versions/dockers/docker-config-engine-buster/versions-deb-buster-armhf @@ -0,0 +1,11 @@ +binutils-arm-linux-gnueabihf==2.31.1-16 +icu-devtools==63.1-6+deb10u3 +libglib2.0-0==2.58.3-2+deb10u4 +libicu-dev==63.1-6+deb10u3 +libicu63==63.1-6+deb10u3 +libxml2==2.9.4+dfsg1-7+deb10u6 +libxml2-dev==2.9.4+dfsg1-7+deb10u6 +libxslt1-dev==1.1.32-2.2~deb10u2 +libxslt1.1==1.1.32-2.2~deb10u2 +pkg-config==0.29-6 +zlib1g-dev==1:1.2.11.dfsg-1+deb10u2 \ No newline at end of file diff --git a/files/build/versions/dockers/docker-config-engine-buster/versions-py3 b/files/build/versions/dockers/docker-config-engine-buster/versions-py3 new file mode 100644 index 000000000000..f1d548a57233 --- /dev/null +++ b/files/build/versions/dockers/docker-config-engine-buster/versions-py3 @@ -0,0 +1,12 @@ +bitarray==1.5.3 +ipaddress==1.0.23 +lxml==4.9.1 +natsort==6.2.1 +netaddr==0.8.0 +pyang==2.5.3 +pyangbind==0.8.1 +pyyaml==5.4.1 +redis==3.5.3 +redis-dump-load==1.1 +regex==2023.5.5 +six==1.16.0 \ No newline at end of file diff --git a/files/build/versions/dockers/docker-config-engine-stretch/versions-deb-stretch b/files/build/versions/dockers/docker-config-engine-stretch/versions-deb-stretch new file mode 100644 index 000000000000..31dbc0f02747 --- /dev/null +++ b/files/build/versions/dockers/docker-config-engine-stretch/versions-deb-stretch @@ -0,0 +1,46 @@ +binutils==2.28-5 +build-essential==12.3 +bzip2==1.0.6-8.1 +cpp==4:6.3.0-4 +cpp-6==6.3.0-18+deb9u1 +dpkg-dev==1.18.26 +g++==4:6.3.0-4 +g++-6==6.3.0-18+deb9u1 +gcc==4:6.3.0-4 +gcc-6==6.3.0-18+deb9u1 +libasan3==6.3.0-18+deb9u1 +libatomic1==6.3.0-18+deb9u1 +libc-dev-bin==2.24-11+deb9u4 +libc6-dev==2.24-11+deb9u4 +libcc1-0==6.3.0-18+deb9u1 +libcilkrts5==6.3.0-18+deb9u1 +libdpkg-perl==1.18.26 +libexpat1-dev==2.2.0-2+deb9u5 +libgcc-6-dev==6.3.0-18+deb9u1 +libgomp1==6.3.0-18+deb9u1 +libhiredis0.14==0.14.0-3~bpo9+1 +libisl15==0.18-1 +libitm1==6.3.0-18+deb9u1 +liblsan0==6.3.0-18+deb9u1 +libmpc3==1.0.3-1+b2 +libmpfr4==3.1.5-1 +libmpx2==6.3.0-18+deb9u1 +libnl-3-200==3.5.0-1 +libnl-cli-3-200==3.5.0-1 +libnl-genl-3-200==3.5.0-1 +libnl-nf-3-200==3.5.0-1 +libnl-route-3-200==3.5.0-1 +libpython-dev==2.7.13-2 +libpython2.7-dev==2.7.13-2+deb9u6 +libquadmath0==6.3.0-18+deb9u1 +libstdc++-6-dev==6.3.0-18+deb9u1 +libswsscommon==1.0.0 +libtsan0==6.3.0-18+deb9u1 +libubsan0==6.3.0-18+deb9u1 +linux-libc-dev==4.9.320-2 +make==4.1-9.1 +patch==2.7.5-1+deb9u2 +python-dev==2.7.13-2 +python-swsscommon==1.0.0 +python2.7-dev==2.7.13-2+deb9u6 +xz-utils==5.2.2-1.2+deb9u1 \ No newline at end of file diff --git a/files/build/versions/dockers/docker-config-engine-stretch/versions-py2 b/files/build/versions/dockers/docker-config-engine-stretch/versions-py2 new file mode 100644 index 000000000000..9092f9c71ce4 --- /dev/null +++ b/files/build/versions/dockers/docker-config-engine-stretch/versions-py2 @@ -0,0 +1,22 @@ +bitarray==1.5.3 +contextlib2==0.6.0.post1 +future==0.18.3 +importlib-resources==3.3.1 +ipaddress==1.0.23 +lxml==4.9.1 +natsort==6.2.1 +netaddr==0.8.0 +pathlib2==2.3.7.post1 +pyang==2.5.3 +pyangbind==0.6.0 +pyyaml==5.4.1 +redis==3.5.3 +redis-dump-load==1.1 +scandir==1.10.0 +singledispatch==3.7.0 +six==1.16.0 +sonic-config-engine==1.0 +sonic-py-common==1.0 +swsssdk==2.0.1 +typing==3.10.0.0 +zipp==1.2.0 \ No newline at end of file diff --git a/files/build/versions/dockers/docker-database/versions-deb-buster b/files/build/versions/dockers/docker-database/versions-deb-buster new file mode 100644 index 000000000000..c6eb97b7f7a7 --- /dev/null +++ b/files/build/versions/dockers/docker-database/versions-deb-buster @@ -0,0 +1,17 @@ +gdb==8.2.1-2+b3 +gdbserver==8.2.1-2+b3 +libbabeltrace1==1.5.6-2+deb10u1 +libbsd0==0.9.1-2+deb10u1 +libdw1==0.176-1.1 +libedit2==3.1-20181209-1 +libglib2.0-0==2.58.3-2+deb10u4 +libgpm2==1.20.7-5 +libipt2==2.0-2 +libpopt0==1.16-12 +libunwind8==1.2.1-10~deb10u1 +openssh-client==1:7.9p1-10+deb10u2 +redis-server==5:6.0.6-1~bpo10+1 +sshpass==1.06-1 +strace==4.26-0.2 +vim==2:8.1.0875-5+deb10u4 +vim-runtime==2:8.1.0875-5+deb10u4 \ No newline at end of file diff --git a/files/build/versions/dockers/docker-dhcp-relay/versions-deb-buster b/files/build/versions/dockers/docker-dhcp-relay/versions-deb-buster new file mode 100644 index 000000000000..3edd946f959a --- /dev/null +++ b/files/build/versions/dockers/docker-dhcp-relay/versions-deb-buster @@ -0,0 +1,32 @@ +gdb==8.2.1-2+b3 +gdbserver==8.2.1-2+b3 +isc-dhcp-relay==4.4.1-2.3+deb11u1 +isc-dhcp-relay-dbgsym==4.4.1-2.3+deb11u1 +libbabeltrace1==1.5.6-2+deb10u1 +libboost-atomic1.71.0==1.71.0-6~bpo10+1 +libboost-system1.71.0==1.71.0-6~bpo10+1 +libboost-thread1.71.0==1.71.0-6~bpo10+1 +libbsd0==0.9.1-2+deb10u1 +libdns-export1104==1:9.11.5.P4+dfsg-5.1+deb10u8 +libdw1==0.176-1.1 +libedit2==3.1-20181209-1 +libevent-2.1-6==2.1.8-stable-4 +libexplain51==1.4.D001-8 +libglib2.0-0==2.58.3-2+deb10u4 +libgpm2==1.20.7-5 +libipt2==2.0-2 +libirs-export161==1:9.11.5.P4+dfsg-5.1+deb10u8 +libisc-export1100==1:9.11.5.P4+dfsg-5.1+deb10u8 +libisccfg-export163==1:9.11.5.P4+dfsg-5.1+deb10u8 +libpopt0==1.16-12 +libunwind8==1.2.1-10~deb10u1 +lsof==4.91+dfsg-1 +openssh-client==1:7.9p1-10+deb10u2 +sonic-dhcp6relay==1.0.0-0 +sonic-dhcp6relay-dbgsym==1.0.0-0 +sonic-dhcpmon==1.0.0-0 +sonic-dhcpmon-dbgsym==1.0.0-0 +sshpass==1.06-1 +strace==4.26-0.2 +vim==2:8.1.0875-5+deb10u4 +vim-runtime==2:8.1.0875-5+deb10u4 \ No newline at end of file diff --git a/files/build/versions/dockers/docker-fpm-frr/versions-deb-buster b/files/build/versions/dockers/docker-fpm-frr/versions-deb-buster new file mode 100644 index 000000000000..28343d3bd99a --- /dev/null +++ b/files/build/versions/dockers/docker-fpm-frr/versions-deb-buster @@ -0,0 +1,37 @@ +cron==3.0pl1-134+deb10u1 +frr==7.5.1-sonic-0 +frr-dbgsym==7.5.1-sonic-0 +frr-snmp==7.5.1-sonic-0 +frr-snmp-dbgsym==7.5.1-sonic-0 +gdb==8.2.1-2+b3 +gdbserver==8.2.1-2+b3 +libbabeltrace1==1.5.6-2+deb10u1 +libbsd0==0.9.1-2+deb10u1 +libc-ares2==1.14.0-1+deb10u2 +libdw1==0.176-1.1 +libedit2==3.1-20181209-1 +libglib2.0-0==2.58.3-2+deb10u4 +libgpm2==1.20.7-5 +libipt2==2.0-2 +libjson-c3==0.12.1+ds-2+deb10u1 +libmariadb3==1:10.3.38-0+deb10u1 +libpci3==1:3.5.2-1 +libpopt0==1.16-12 +libsensors-config==1:3.5.0-3 +libsensors5==1:3.5.0-3 +libsnmp-base==5.7.3+dfsg-5+deb10u4 +libsnmp30==5.7.3+dfsg-5+deb10u4 +libswsscommon-dbg==1.0.0 +libunwind8==1.2.1-10~deb10u1 +libyang1==1.0.184-2 +libyang1-dbgsym==1.0.184-2 +logrotate==3.14.0-4 +mariadb-common==1:10.3.38-0+deb10u1 +mysql-common==5.8+1.0.5 +openssh-client==1:7.9p1-10+deb10u2 +sensible-utils==0.0.12 +sshpass==1.06-1 +strace==4.26-0.2 +swss-dbg==1.0.0 +vim==2:8.1.0875-5+deb10u4 +vim-runtime==2:8.1.0875-5+deb10u4 \ No newline at end of file diff --git a/files/build/versions/dockers/docker-fpm-frr/versions-py3 b/files/build/versions/dockers/docker-fpm-frr/versions-py3 new file mode 100644 index 000000000000..ff7826d683d4 --- /dev/null +++ b/files/build/versions/dockers/docker-fpm-frr/versions-py3 @@ -0,0 +1 @@ +zipp==1.2.0 \ No newline at end of file diff --git a/files/build/versions/dockers/docker-gbsyncd-vs/versions-deb-buster b/files/build/versions/dockers/docker-gbsyncd-vs/versions-deb-buster new file mode 100644 index 000000000000..6da0ec29a7b3 --- /dev/null +++ b/files/build/versions/dockers/docker-gbsyncd-vs/versions-deb-buster @@ -0,0 +1,25 @@ +gdb==8.2.1-2+b3 +gdbserver==8.2.1-2+b3 +libbabeltrace1==1.5.6-2+deb10u1 +libbsd0==0.9.1-2+deb10u1 +libdw1==0.176-1.1 +libedit2==3.1-20181209-1 +libglib2.0-0==2.58.3-2+deb10u4 +libgpm2==1.20.7-5 +libipt2==2.0-2 +libpopt0==1.16-12 +libsaimetadata==1.0.0 +libsaimetadata-dbg==1.0.0 +libsairedis==1.0.0 +libsairedis-dbg==1.0.0 +libsaivs==1.0.0 +libsaivs-dbg==1.0.0 +libswsscommon-dbg==1.0.0 +libunwind8==1.2.1-10~deb10u1 +openssh-client==1:7.9p1-10+deb10u2 +sshpass==1.06-1 +strace==4.26-0.2 +syncd-vs==1.0.0 +syncd-vs-dbg==1.0.0 +vim==2:8.1.0875-5+deb10u4 +vim-runtime==2:8.1.0875-5+deb10u4 \ No newline at end of file diff --git a/files/build/versions/dockers/docker-lldp/versions-deb-buster b/files/build/versions/dockers/docker-lldp/versions-deb-buster new file mode 100644 index 000000000000..9fb9e0e8655a --- /dev/null +++ b/files/build/versions/dockers/docker-lldp/versions-deb-buster @@ -0,0 +1,30 @@ +gdb==8.2.1-2+b3 +gdbserver==8.2.1-2+b3 +libbabeltrace1==1.5.6-2+deb10u1 +libbsd0==0.9.1-2+deb10u1 +libdw1==0.176-1.1 +libedit2==3.1-20181209-1 +libevent-2.1-6==2.1.8-stable-4 +libglib2.0-0==2.58.3-2+deb10u4 +libgpm2==1.20.7-5 +libicu63==63.1-6+deb10u3 +libipt2==2.0-2 +libmariadb3==1:10.3.38-0+deb10u1 +libpci3==1:3.5.2-1 +libpopt0==1.16-12 +libsensors-config==1:3.5.0-3 +libsensors5==1:3.5.0-3 +libsnmp-base==5.7.3+dfsg-5 +libsnmp30==5.7.3+dfsg-5 +libswsscommon-dbg==1.0.0 +libunwind8==1.2.1-10~deb10u1 +libxml2==2.9.4+dfsg1-7+deb10u6 +lldpd==1.0.4-1 +lldpd-dbgsym==1.0.4-1 +mariadb-common==1:10.3.38-0+deb10u1 +mysql-common==5.8+1.0.5 +openssh-client==1:7.9p1-10+deb10u2 +sshpass==1.06-1 +strace==4.26-0.2 +vim==2:8.1.0875-5+deb10u4 +vim-runtime==2:8.1.0875-5+deb10u4 \ No newline at end of file diff --git a/files/build/versions/dockers/docker-mux/versions-deb-buster b/files/build/versions/dockers/docker-mux/versions-deb-buster new file mode 100644 index 000000000000..75431e74e508 --- /dev/null +++ b/files/build/versions/dockers/docker-mux/versions-deb-buster @@ -0,0 +1,29 @@ +gdb==8.2.1-2+b3 +gdbserver==8.2.1-2+b3 +libbabeltrace1==1.5.6-2+deb10u1 +libboost-atomic1.71.0==1.71.0-6~bpo10+1 +libboost-chrono1.71.0==1.71.0-6~bpo10+1 +libboost-date-time1.71.0==1.71.0-6~bpo10+1 +libboost-filesystem1.71.0==1.71.0-6~bpo10+1 +libboost-log1.71.0==1.71.0-6~bpo10+1 +libboost-program-options1.71.0==1.71.0-6~bpo10+1 +libboost-regex1.71.0==1.71.0-6~bpo10+1 +libboost-thread1.71.0==1.71.0-6~bpo10+1 +libbsd0==0.9.1-2+deb10u1 +libdw1==0.176-1.1 +libedit2==3.1-20181209-1 +libglib2.0-0==2.58.3-2+deb10u4 +libgpm2==1.20.7-5 +libhiredis0.14-dbgsym==0.14.0-3~bpo9+1 +libicu63==63.1-6+deb10u3 +libipt2==2.0-2 +libpopt0==1.16-12 +libswsscommon-dbg==1.0.0 +libunwind8==1.2.1-10~deb10u1 +openssh-client==1:7.9p1-10+deb10u2 +sonic-linkmgrd==1.0.0-1 +sonic-linkmgrd-dbgsym==1.0.0-1 +sshpass==1.06-1 +strace==4.26-0.2 +vim==2:8.1.0875-5+deb10u4 +vim-runtime==2:8.1.0875-5+deb10u4 \ No newline at end of file diff --git a/files/build/versions/dockers/docker-nat/versions-deb-buster b/files/build/versions/dockers/docker-nat/versions-deb-buster new file mode 100644 index 000000000000..490654c42095 --- /dev/null +++ b/files/build/versions/dockers/docker-nat/versions-deb-buster @@ -0,0 +1,27 @@ +bridge-utils==1.6-2 +conntrack==1:1.4.5-2 +gdb==8.2.1-2+b3 +gdbserver==8.2.1-2+b3 +iptables==1.8.2-4 +libbabeltrace1==1.5.6-2+deb10u1 +libbsd0==0.9.1-2+deb10u1 +libdw1==0.176-1.1 +libedit2==3.1-20181209-1 +libglib2.0-0==2.58.3-2+deb10u4 +libgpm2==1.20.7-5 +libip4tc0==1.8.2-4 +libip6tc0==1.8.2-4 +libipt2==2.0-2 +libiptc0==1.8.2-4 +libnetfilter-conntrack3==1.0.7-1 +libnfnetlink0==1.0.1-3+b1 +libnftnl11==1.1.2-2 +libpopt0==1.16-12 +libswsscommon-dbg==1.0.0 +libunwind8==1.2.1-10~deb10u1 +openssh-client==1:7.9p1-10+deb10u2 +sshpass==1.06-1 +strace==4.26-0.2 +swss-dbg==1.0.0 +vim==2:8.1.0875-5+deb10u4 +vim-runtime==2:8.1.0875-5+deb10u4 \ No newline at end of file diff --git a/files/build/versions/dockers/docker-orchagent/versions-deb-buster b/files/build/versions/dockers/docker-orchagent/versions-deb-buster new file mode 100644 index 000000000000..ed2844fafbcc --- /dev/null +++ b/files/build/versions/dockers/docker-orchagent/versions-deb-buster @@ -0,0 +1,70 @@ +arping==2.19-6 +binutils==2.31.1-16 +binutils-common==2.31.1-16 +binutils-x86-64-linux-gnu==2.31.1-16 +bridge-utils==1.6-2 +build-essential==12.6 +conntrack==1:1.4.5-2 +cpp==4:8.3.0-1 +cpp-8==8.3.0-6 +dh-python==3.20190308 +g++==4:8.3.0-1 +g++-8==8.3.0-6 +gcc==4:8.3.0-1 +gcc-8==8.3.0-6 +gdb==8.2.1-2+b3 +gdbserver==8.2.1-2+b3 +ifupdown==0.8.35 +libasan5==8.3.0-6 +libbabeltrace1==1.5.6-2+deb10u1 +libbinutils==2.31.1-16 +libbsd0==0.9.1-2+deb10u1 +libc-dev-bin==2.28-10+deb10u2 +libc6-dev==2.28-10+deb10u2 +libcc1-0==8.3.0-6 +libdpkg-perl==1.19.8 +libdw1==0.176-1.1 +libedit2==3.1-20181209-1 +libexpat1-dev==2.2.6-2+deb10u6 +libgcc-8-dev==8.3.0-6 +libglib2.0-0==2.58.3-2+deb10u4 +libgomp1==8.3.0-6 +libgpm2==1.20.7-5 +libipt2==2.0-2 +libisl19==0.20-2 +libitm1==8.3.0-6 +libkmod2==26-1 +liblsan0==8.3.0-6 +libmpc3==1.1.0-1 +libmpfr6==4.0.2-1 +libmpx2==8.3.0-6 +libnet1==1.1.6+dfsg-3.1 +libnetfilter-conntrack3==1.0.7-1 +libnfnetlink0==1.0.1-3+b1 +libpcap0.8==1.8.1-6+deb10u1 +libpci3==1:3.5.2-1 +libpopt0==1.16-12 +libpython3-dev==3.7.3-1 +libpython3.7-dev==3.7.3-2+deb10u4 +libquadmath0==8.3.0-6 +libsairedis-dbg==1.0.0 +libstdc++-8-dev==8.3.0-6 +libswsscommon-dbg==1.0.0 +libtsan0==8.3.0-6 +libubsan1==8.3.0-6 +libunwind8==1.2.1-10~deb10u1 +linux-libc-dev==4.19.282-1 +make==4.2.1-1.2 +ndisc6==1.0.4-1 +ndppd==0.2.5-4+deb10u1 +openssh-client==1:7.9p1-10+deb10u2 +patch==2.7.6-3+deb10u1 +pciutils==1:3.5.2-1 +python3-dev==3.7.3-1 +python3.7-dev==3.7.3-2+deb10u4 +sshpass==1.06-1 +strace==4.26-0.2 +swss-dbg==1.0.0 +tcpdump==4.9.3-1~deb10u2 +vim==2:8.1.0875-5+deb10u4 +vim-runtime==2:8.1.0875-5+deb10u4 \ No newline at end of file diff --git a/files/build/versions/dockers/docker-orchagent/versions-deb-buster-arm64 b/files/build/versions/dockers/docker-orchagent/versions-deb-buster-arm64 new file mode 100644 index 000000000000..bf7e83cd9cc1 --- /dev/null +++ b/files/build/versions/dockers/docker-orchagent/versions-deb-buster-arm64 @@ -0,0 +1,8 @@ +binutils-aarch64-linux-gnu==2.31.1-16 +libpython2.7==2.7.16-2+deb10u1 +libpython2.7-dev==2.7.16-2+deb10u1 +libpython2.7-minimal==2.7.16-2+deb10u1 +libpython2.7-stdlib==2.7.16-2+deb10u1 +python2.7==2.7.16-2+deb10u1 +python2.7-dev==2.7.16-2+deb10u1 +python2.7-minimal==2.7.16-2+deb10u1 \ No newline at end of file diff --git a/files/build/versions/dockers/docker-orchagent/versions-deb-buster-armhf b/files/build/versions/dockers/docker-orchagent/versions-deb-buster-armhf new file mode 100644 index 000000000000..2948f7995529 --- /dev/null +++ b/files/build/versions/dockers/docker-orchagent/versions-deb-buster-armhf @@ -0,0 +1,8 @@ +binutils-arm-linux-gnueabihf==2.31.1-16 +libpython2.7==2.7.16-2+deb10u1 +libpython2.7-dev==2.7.16-2+deb10u1 +libpython2.7-minimal==2.7.16-2+deb10u1 +libpython2.7-stdlib==2.7.16-2+deb10u1 +python2.7==2.7.16-2+deb10u1 +python2.7-dev==2.7.16-2+deb10u1 +python2.7-minimal==2.7.16-2+deb10u1 \ No newline at end of file diff --git a/files/build/versions/dockers/docker-orchagent/versions-py3 b/files/build/versions/dockers/docker-orchagent/versions-py3 new file mode 100644 index 000000000000..aa6d42d04fba --- /dev/null +++ b/files/build/versions/dockers/docker-orchagent/versions-py3 @@ -0,0 +1,2 @@ +netifaces==0.10.9 +pyroute2==0.5.14 \ No newline at end of file diff --git a/files/build/versions/dockers/docker-platform-monitor/versions-deb-buster b/files/build/versions/dockers/docker-platform-monitor/versions-deb-buster new file mode 100644 index 000000000000..7b1d96f3c0ad --- /dev/null +++ b/files/build/versions/dockers/docker-platform-monitor/versions-deb-buster @@ -0,0 +1,142 @@ +applibs==1.mlnx.4.5.3196 +applibs-dev==1.mlnx.4.5.3196 +binutils==2.31.1-16 +binutils-common==2.31.1-16 +binutils-x86-64-linux-gnu==2.31.1-16 +build-essential==12.6 +cpp==4:8.3.0-1 +cpp-8==8.3.0-6 +dh-python==3.20190308 +dmidecode==3.2-1 +ethtool==1:5.9-1 +fancontrol==1:3.5.0-3 +fontconfig==2.13.1-2 +fontconfig-config==2.13.1-2 +fonts-dejavu-core==2.37-1 +freeipmi-common==1.6.3-1.1 +g++==4:8.3.0-1 +g++-8==8.3.0-6 +gcc==4:8.3.0-1 +gcc-8==8.3.0-6 +gdb==8.2.1-2+b3 +gdbserver==8.2.1-2+b3 +i2c-tools==4.1-1 +ipmitool==1.8.18-6+deb10u1 +libasan5==8.3.0-6 +libbabeltrace1==1.5.6-2+deb10u1 +libbinutils==2.31.1-16 +libbsd0==0.9.1-2+deb10u1 +libc-dev-bin==2.28-10+deb10u2 +libc6-dev==2.28-10+deb10u2 +libcairo2==1.16.0-4+deb10u1 +libcc1-0==8.3.0-6 +libdatrie1==0.2.12-2 +libdbi1==0.9.0-5 +libdpkg-perl==1.19.8 +libdw1==0.176-1.1 +libedit2==3.1-20181209-1 +libexpat1-dev==2.2.6-2+deb10u6 +libfontconfig1==2.13.1-2 +libfreeipmi17==1.6.3-1.1 +libfreetype6==2.9.1-3+deb10u3 +libfribidi0==1.0.5-3.1+deb10u2 +libgcc-8-dev==8.3.0-6 +libglib2.0-0==2.58.3-2+deb10u4 +libgomp1==8.3.0-6 +libgpm2==1.20.7-5 +libgraphite2-3==1.3.13-7 +libharfbuzz0b==2.3.1-1 +libi2c0==4.1-1 +libicu63==63.1-6+deb10u3 +libipt2==2.0-2 +libisl19==0.20-2 +libitm1==8.3.0-6 +libkmod2==26-1 +liblsan0==8.3.0-6 +libmpc3==1.1.0-1 +libmpfr6==4.0.2-1 +libmpx2==8.3.0-6 +libpango-1.0-0==1.42.4-8~deb10u1 +libpangocairo-1.0-0==1.42.4-8~deb10u1 +libpangoft2-1.0-0==1.42.4-8~deb10u1 +libpci3==1:3.5.2-1 +libpixman-1-0==0.36.0-1+deb10u1 +libpng16-16==1.6.36-6 +libpopt0==1.16-12 +libpython-dev==2.7.16-1 +libpython-stdlib==2.7.16-1 +libpython2-dev==2.7.16-1 +libpython2-stdlib==2.7.16-1 +libpython2.7==2.7.16-2+deb10u1 +libpython2.7-dev==2.7.16-2+deb10u1 +libpython2.7-minimal==2.7.16-2+deb10u1 +libpython2.7-stdlib==2.7.16-2+deb10u1 +libpython3-dev==3.7.3-1 +libpython3.7-dev==3.7.3-2+deb10u4 +libquadmath0==8.3.0-6 +librrd-dev==1.7.1-2 +librrd8==1.7.1-2 +libsensors-config==1:3.5.0-3 +libsensors5==1:3.5.0-3 +libsensors5-dbgsym==1:3.5.0-3 +libstdc++-8-dev==8.3.0-6 +libswsscommon-dbg==1.0.0 +libthai-data==0.1.28-2 +libthai0==0.1.28-2 +libtsan0==8.3.0-6 +libubsan1==8.3.0-6 +libunwind8==1.2.1-10~deb10u1 +libx11-6==2:1.6.7-1+deb10u2 +libx11-data==2:1.6.7-1+deb10u2 +libxau6==1:1.0.8-1+b2 +libxcb-render0==1.13.1-2 +libxcb-shm0==1.13.1-2 +libxcb1==1.13.1-2 +libxdmcp6==1:1.1.2-3 +libxext6==2:1.3.3-1+b2 +libxml2==2.9.4+dfsg1-7+deb10u6 +libxrender1==1:0.9.10-1 +linux-libc-dev==4.19.282-1 +lm-sensors==1:3.5.0-3 +lm-sensors-dbgsym==1:3.5.0-3 +make==4.2.1-1.2 +openssh-client==1:7.9p1-10+deb10u2 +patch==2.7.6-3+deb10u1 +pciutils==1:3.5.2-1 +psmisc==23.2-1+deb10u1 +python==2.7.16-1 +python-dev==2.7.16-1 +python-minimal==2.7.16-1 +python-pip==18.1-5 +python-pip-whl==18.1-5 +python-sdk-api==1.mlnx.4.5.3196 +python-smbus==4.1-1 +python-swsscommon==1.0.0 +python2==2.7.16-1 +python2-dev==2.7.16-1 +python2-minimal==2.7.16-1 +python2.7==2.7.16-2+deb10u1 +python2.7-dev==2.7.16-2+deb10u1 +python2.7-minimal==2.7.16-2+deb10u1 +python3-dev==3.7.3-1 +python3-jsonschema==2.6.0-4 +python3-pkg-resources==40.8.0-1 +python3-smbus==4.1-1 +python3.7-dev==3.7.3-2+deb10u4 +rrdtool==1.7.1-2 +sensible-utils==0.0.12 +sensord==1:3.5.0-3 +sensord-dbgsym==1:3.5.0-3 +smartmontools==6.6-1 +sshpass==1.06-1 +strace==4.26-0.2 +sx-complib==1.mlnx.4.5.3196 +sx-complib-dev==1.mlnx.4.5.3196 +sx-gen-utils==1.mlnx.4.5.3196 +sx-gen-utils-dev==1.mlnx.4.5.3196 +sxd-libs==1.mlnx.4.5.3196 +sxd-libs-dev==1.mlnx.4.5.3196 +ucf==3.0038+nmu1 +udev==241-7~deb10u9 +vim==2:8.1.0875-5+deb10u4 +vim-runtime==2:8.1.0875-5+deb10u4 \ No newline at end of file diff --git a/files/build/versions/dockers/docker-platform-monitor/versions-deb-buster-arm64 b/files/build/versions/dockers/docker-platform-monitor/versions-deb-buster-arm64 new file mode 100644 index 000000000000..76a3c3a88288 --- /dev/null +++ b/files/build/versions/dockers/docker-platform-monitor/versions-deb-buster-arm64 @@ -0,0 +1 @@ +binutils-aarch64-linux-gnu==2.31.1-16 \ No newline at end of file diff --git a/files/build/versions/dockers/docker-platform-monitor/versions-deb-buster-armhf b/files/build/versions/dockers/docker-platform-monitor/versions-deb-buster-armhf new file mode 100644 index 000000000000..568b8b43bc13 --- /dev/null +++ b/files/build/versions/dockers/docker-platform-monitor/versions-deb-buster-armhf @@ -0,0 +1 @@ +binutils-arm-linux-gnueabihf==2.31.1-16 \ No newline at end of file diff --git a/files/build/versions/dockers/docker-platform-monitor/versions-py2 b/files/build/versions/dockers/docker-platform-monitor/versions-py2 new file mode 100644 index 000000000000..ce6b78c718ae --- /dev/null +++ b/files/build/versions/dockers/docker-platform-monitor/versions-py2 @@ -0,0 +1,28 @@ +bitarray==1.5.3 +contextlib2==0.6.0.post1 +enum34==1.1.10 +functools32==3.2.3.post2 +future==0.18.3 +guacamole==0.9.2 +importlib-resources==3.3.1 +ipaddress==1.0.23 +jinja2==2.11.3 +jsonschema==2.6.0 +libpci==0.2 +lxml==4.9.1 +markupsafe==1.1.1 +natsort==6.2.1 +netaddr==0.8.0 +pathlib2==2.3.7.post1 +pyang==2.5.3 +pyangbind==0.6.0 +python-sdk-api==4.5.3196 +pyyaml==5.4.1 +redis==3.5.3 +redis-dump-load==1.1 +scandir==1.10.0 +singledispatch==3.7.0 +six==1.16.0 +thrift==0.13.0 +typing==3.10.0.0 +zipp==1.2.0 \ No newline at end of file diff --git a/files/build/versions/dockers/docker-platform-monitor/versions-py3 b/files/build/versions/dockers/docker-platform-monitor/versions-py3 new file mode 100644 index 000000000000..c36f28d012b1 --- /dev/null +++ b/files/build/versions/dockers/docker-platform-monitor/versions-py3 @@ -0,0 +1,5 @@ +guacamole==0.9.2 +jsonschema==2.6.0 +libpci==0.2 +python_sdk_api==4.5.3196 +thrift==0.13.0 \ No newline at end of file diff --git a/files/build/versions/dockers/docker-ptf/versions-deb-stretch b/files/build/versions/dockers/docker-ptf/versions-deb-stretch new file mode 100644 index 000000000000..e5d9fdde341a --- /dev/null +++ b/files/build/versions/dockers/docker-ptf/versions-deb-stretch @@ -0,0 +1,242 @@ +arping==2.14-1+b1 +autoconf==2.69-10 +automake==1:1.15-6 +autotools-dev==20161112.1 +binutils==2.28-5 +bridge-utils==1.5-13+deb9u1 +build-essential==12.3 +bzip2==1.0.6-8.1 +ca-certificates==20200601~deb9u2 +cgmanager==0.41-2 +cmake==3.7.2-1 +cmake-data==3.7.2-1 +cpp==4:6.3.0-4 +cpp-6==6.3.0-18+deb9u1 +cron==3.0pl1-128+deb9u2 +curl==7.52.1-5+deb9u16 +dbus==1.10.32-0+deb9u1 +dirmngr==2.1.18-8~deb9u4 +dmsetup==2:1.02.137-2 +dpkg-dev==1.18.26 +ethtool==1:4.8-1+b1 +exim4==4.89-2+deb9u8 +exim4-base==4.89-2+deb9u8 +exim4-config==4.89-2+deb9u8 +exim4-daemon-light==4.89-2+deb9u8 +fakeroot==1.21-3.1 +file==1:5.30-1+deb9u3 +g++==4:6.3.0-4 +g++-6==6.3.0-18+deb9u1 +gcc==4:6.3.0-4 +gcc-6==6.3.0-18+deb9u1 +git==1:2.11.0-3+deb9u7 +git-man==1:2.11.0-3+deb9u7 +gnupg==2.1.18-8~deb9u4 +gnupg-agent==2.1.18-8~deb9u4 +gnupg-l10n==2.1.18-8~deb9u4 +guile-2.0-libs==2.0.13+1-4 +hping3==3.a2.ds2-7 +krb5-locales==1.15-1+deb9u3 +less==481-2.1 +libalgorithm-diff-perl==1.19.03-1 +libalgorithm-diff-xs-perl==0.04-4+b2 +libalgorithm-merge-perl==0.08-3 +libapparmor1==2.11.0-3+deb9u2 +libarchive13==3.2.2-2+deb9u3 +libasan3==6.3.0-18+deb9u1 +libassuan0==2.4.3-2 +libatomic1==6.3.0-18+deb9u1 +libboost-atomic1.62.0==1.62.0+dfsg-4 +libbsd0==0.8.3-1+deb9u1 +libc-dev-bin==2.24-11+deb9u4 +libc6-dev==2.24-11+deb9u4 +libcc1-0==6.3.0-18+deb9u1 +libcgmanager0==0.41-2 +libcilkrts5==6.3.0-18+deb9u1 +libcryptsetup4==2:1.7.3-4 +libcurl3==7.52.1-5+deb9u16 +libcurl3-gnutls==7.52.1-5+deb9u16 +libdbus-1-3==1.10.32-0+deb9u1 +libdevmapper1.02.1==2:1.02.137-2 +libdouble-conversion1==2.0.1-4 +libdpkg-perl==1.18.26 +libedit2==3.1-20160903-3 +liberror-perl==0.17024-1 +libestr0==0.1.10-2 +libevent-2.0-5==2.0.21-stable-3 +libexpat1==2.2.0-2+deb9u5 +libexpat1-dev==2.2.0-2+deb9u5 +libfakeroot==1.21-3.1 +libfastjson4==0.99.4-1 +libffi-dev==3.2.1-6 +libffi6==3.2.1-6 +libfile-fcntllock-perl==0.22-3+b2 +libfribidi0==0.19.7-1+deb9u2 +libgc1c2==1:7.4.2-8+deb9u1 +libgcc-6-dev==6.3.0-18+deb9u1 +libgdbm3==1.8.3-14 +libglib2.0-0==2.50.3-2+deb9u3 +libglib2.0-data==2.50.3-2+deb9u3 +libgmp10==2:6.1.2+dfsg-1+deb9u1 +libgnutls30==3.5.8-5+deb9u6 +libgomp1==6.3.0-18+deb9u1 +libgpm2==1.20.4-6.2+b1 +libgsasl7==1.8.0-8+b2 +libgssapi-krb5-2==1.15-1+deb9u3 +libhogweed4==3.3-1+deb9u1 +libicu57==57.1-6+deb9u5 +libidn2-0==0.16-1+deb9u1 +libip4tc0==1.6.0+snapshot20161117-6 +libisl15==0.18-1 +libitm1==6.3.0-18+deb9u1 +libjsoncpp1==1.7.4-3 +libk5crypto3==1.15-1+deb9u3 +libkeyutils1==1.5.9-9 +libkmod2==23-2 +libkrb5-3==1.15-1+deb9u3 +libkrb5support0==1.15-1+deb9u3 +libksba8==1.3.5-2 +libkyotocabinet16v5==1.2.76-4.2+b1 +libldap-2.4-2==2.4.44+dfsg-5+deb9u9 +libldap-common==2.4.44+dfsg-5+deb9u9 +liblocale-gettext-perl==1.07-3+b1 +liblogging-stdlog0==1.0.5-2+b2 +liblognorm5==2.0.1-1.1+b1 +liblsan0==6.3.0-18+deb9u1 +libltdl7==2.4.6-2 +liblzo2-2==2.08-1.2+b2 +libmagic-mgc==1:5.30-1+deb9u3 +libmagic1==1:5.30-1+deb9u3 +libmailutils5==1:3.1.1-1 +libmariadbclient18==10.1.48-0+deb9u2 +libmpc3==1.0.3-1+b2 +libmpfr4==3.1.5-1 +libmpx2==6.3.0-18+deb9u1 +libncurses5==6.0+20161126-1+deb9u2 +libnet1==1.1.6+dfsg-3 +libnghttp2-14==1.18.1-1+deb9u2 +libnih-dbus1==1.0.3-8 +libnih1==1.0.3-8 +libnpth0==1.3-1 +libntlm0==1.4-8+deb9u1 +libopts25==1:5.18.12-3 +libp11-kit0==0.23.3-2+deb9u1 +libpam-systemd==232-25+deb9u14 +libpcap0.8==1.8.1-3+deb9u1 +libpcre16-3==2:8.39-3 +libperl5.24==5.24.1-3+deb9u7 +libpopt0==1.16-10+b2 +libprocps6==2:3.3.12-3+deb9u1 +libproxy1v5==0.4.14-2+deb9u2 +libpsl5==0.17.0-3 +libpython-dev==2.7.13-2 +libpython-stdlib==2.7.13-2 +libpython2.7==2.7.13-2+deb9u6 +libpython2.7-dev==2.7.13-2+deb9u6 +libpython2.7-minimal==2.7.13-2+deb9u6 +libpython2.7-stdlib==2.7.13-2+deb9u6 +libqt5core5a==5.7.1+dfsg-3+deb9u3 +libqt5dbus5==5.7.1+dfsg-3+deb9u3 +libqt5network5==5.7.1+dfsg-3+deb9u3 +libquadmath0==6.3.0-18+deb9u1 +libreadline7==7.0-3 +librtmp1==2.4+20151223.gitfa8646d.1-1+b1 +libsasl2-2==2.1.27~101-g0780600+dfsg-3+deb9u2 +libsasl2-modules==2.1.27~101-g0780600+dfsg-3+deb9u2 +libsasl2-modules-db==2.1.27~101-g0780600+dfsg-3+deb9u2 +libseccomp2==2.3.1-2.1+deb9u1 +libsigsegv2==2.10-5 +libsqlite3-0==3.16.2-5+deb9u3 +libssh2-1==1.7.0-1+deb9u2 +libssl-dev==1.1.0l-1~deb9u6 +libssl-doc==1.1.0l-1~deb9u6 +libssl1.0.2==1.0.2u-1~deb9u7 +libssl1.1==1.1.0l-1~deb9u6 +libstdc++-6-dev==6.3.0-18+deb9u1 +libsystemd0==232-25+deb9u14 +libtacacs+1==4.0.4.27a-3 +libtasn1-6==4.10-1.1+deb9u1 +libtcl8.6==8.6.6+dfsg-1+b1 +libthrift-0.11.0==0.11.0-4 +libtsan0==6.3.0-18+deb9u1 +libubsan0==6.3.0-18+deb9u1 +libudev1==232-25+deb9u14 +libunistring0==0.9.6+really0.9.3-0.1 +libutempter0==1.1.6-3 +libuv1==1.9.1-3 +libwrap0==7.6.q-26 +libx11-6==2:1.6.4-3+deb9u4 +libx11-data==2:1.6.4-3+deb9u4 +libxau6==1:1.0.8-1 +libxcb1==1.12-1 +libxdmcp6==1:1.1.2-3 +libxext6==2:1.3.3-1+b2 +libxml2==2.9.4+dfsg1-2.2+deb9u7 +libxmuu1==2:1.1.2-2 +linux-libc-dev==4.9.320-2 +logrotate==3.11.0-0.1 +lsof==4.89+dfsg-0.1 +m4==1.4.18-1 +mailutils==1:3.1.1-1 +mailutils-common==1:3.1.1-1 +make==4.1-9.1 +manpages==4.10-2 +manpages-dev==4.10-2 +mime-support==3.60 +mysql-common==5.8+1.0.2 +ncurses-term==6.0+20161126-1+deb9u2 +net-tools==1.60+git20161116.90da8a0-1 +netbase==5.4 +ntp==1:4.2.8p10+dfsg-3+deb9u2 +ntpdate==1:4.2.8p10+dfsg-3+deb9u2 +ntpstat==0.0.0.1-1+b1 +openssh-client==1:7.4p1-10+deb9u7 +openssh-server==1:7.4p1-10+deb9u7 +openssh-sftp-server==1:7.4p1-10+deb9u7 +openssl==1.1.0l-1~deb9u6 +patch==2.7.5-1+deb9u2 +perl==5.24.1-3+deb9u7 +perl-modules-5.24==5.24.1-3+deb9u7 +pinentry-curses==1.0.0-2 +pkg-config==0.29-4+b1 +procps==2:3.3.12-3+deb9u1 +psmisc==22.21-2.1+b2 +publicsuffix==20190415.1030-0+deb9u1 +python==2.7.13-2 +python-dev==2.7.13-2 +python-libpcap==0.6.4-1 +python-minimal==2.7.13-2 +python-ptf==0.9-1 +python-saithrift==0.9.4 +python-scapy==2.3.3-1 +python-six==1.10.0-3 +python-thrift==0.11.0-4 +python2.7==2.7.13-2+deb9u6 +python2.7-dev==2.7.13-2+deb9u6 +python2.7-minimal==2.7.13-2+deb9u6 +qttranslations5-l10n==5.7.1~20161021-1 +readline-common==7.0-3 +rename==0.20-4 +rsync==3.1.2-1+deb9u3 +rsyslog==8.24.0-1+deb9u3 +sgml-base==1.29 +shared-mime-info==1.8-1+deb9u1 +systemd==232-25+deb9u14 +systemd-shim==10-3 +tacacs+==4.0.4.27a-3 +tcpd==7.6.q-26 +tcpdump==4.9.3-1~deb9u2 +telnet==0.17-41 +tmux==2.3-4 +traceroute==1:2.1.0-2 +ucf==3.0036 +unzip==6.0-21+deb9u2 +vim==2:8.0.0197-4+deb9u7 +vim-common==2:8.0.0197-4+deb9u7 +vim-runtime==2:8.0.0197-4+deb9u7 +wget==1.18-5+deb9u3 +xauth==1:1.0.9-1+b2 +xdg-user-dirs==0.15-2+b1 +xml-core==0.17 +xxd==2:8.0.0197-4+deb9u7 +xz-utils==5.2.2-1.2+deb9u1 \ No newline at end of file diff --git a/files/build/versions/dockers/docker-ptf/versions-py2 b/files/build/versions/dockers/docker-ptf/versions-py2 new file mode 100644 index 000000000000..dc5b23ab2f49 --- /dev/null +++ b/files/build/versions/dockers/docker-ptf/versions-py2 @@ -0,0 +1,66 @@ +backports.functools-lru-cache==1.6.4 +backports.shutil-get-terminal-size==1.0.0 +bcrypt==3.1.7 +cffi==1.15.1 +click==7.1.2 +contextlib2==0.6.0.post1 +cryptography==3.3.2 +decorator==4.4.2 +dpkt==1.9.8 +enum34==1.1.6 +exabgp==3.4.17 +flask==1.0 +flask-httpauth==2.5.0 +future==0.18.3 +futures==3.2.0 +grpcio==1.18.0 +grpcio-tools==1.15.0 +importlib-resources==3.3.1 +ipaddress==1.0.23 +ipython==5.4.1 +ipython-genutils==0.2.0 +itsdangerous==1.1.0 +jinja2==2.11.3 +markupsafe==1.1.1 +netaddr==0.8.0 +nnpy==1.4.2 +oslo.config==2.1.0 +paramiko==2.12.0 +pathlib2==2.3.7.post1 +pbr==2.0.0 +pexpect==4.8.0 +pickleshare==0.7.5 +plumbum==1.7.2 +prompt-toolkit==1.0.18 +protobuf==3.6.1 +ptf==0.9.1 +ptyprocess==0.7.0 +pybrctl==0.1.4 +pycparser==2.21 +pygments==2.5.2 +pylibpcap==0.6.4 +pynacl==1.4.0 +pyro4==4.82 +pysubnettree==0.26 +rpyc==4.1.5 +saithrift==0.9 +scandir==1.10.0 +scapy==2.2.0.dev0 +selectors34==1.2 +serpent==1.28 +simplegeneric==0.8.1 +singledispatch==3.7.0 +six==1.12.0 +stevedore==1.32.0 +supervisor==4.2.5 +thrift==0.11.0 +traitlets==4.3.3 +twisted==16.0.0 +typing==3.10.0.0 +unittest-xml-reporting==2.5.2 +unknown==0.0.0 +wcwidth==0.2.6 +werkzeug==1.0.1 +yabgp==0.8.2 +zipp==1.2.0 +zope.interface==5.5.2 \ No newline at end of file diff --git a/files/build/versions/dockers/docker-router-advertiser/versions-deb-buster b/files/build/versions/dockers/docker-router-advertiser/versions-deb-buster new file mode 100644 index 000000000000..093190b13121 --- /dev/null +++ b/files/build/versions/dockers/docker-router-advertiser/versions-deb-buster @@ -0,0 +1,17 @@ +gdb==8.2.1-2+b3 +gdbserver==8.2.1-2+b3 +libbabeltrace1==1.5.6-2+deb10u1 +libbsd0==0.9.1-2+deb10u1 +libdw1==0.176-1.1 +libedit2==3.1-20181209-1 +libglib2.0-0==2.58.3-2+deb10u4 +libgpm2==1.20.7-5 +libipt2==2.0-2 +libpopt0==1.16-12 +libunwind8==1.2.1-10~deb10u1 +openssh-client==1:7.9p1-10+deb10u2 +radvd==1:2.17-2 +sshpass==1.06-1 +strace==4.26-0.2 +vim==2:8.1.0875-5+deb10u4 +vim-runtime==2:8.1.0875-5+deb10u4 \ No newline at end of file diff --git a/files/build/versions/dockers/docker-saiserverv2-brcm/versions-deb-buster b/files/build/versions/dockers/docker-saiserverv2-brcm/versions-deb-buster new file mode 100644 index 000000000000..d3a656f99415 --- /dev/null +++ b/files/build/versions/dockers/docker-saiserverv2-brcm/versions-deb-buster @@ -0,0 +1,28 @@ +gdb==8.2.1-2+b3 +kmod==26-1 +libbabeltrace1==1.5.6-2+deb10u1 +libboost-atomic1.71.0==1.71.0-6~bpo10+1 +libc-dev-bin==2.28-10+deb10u2 +libc6-dev==2.28-10+deb10u2 +libdouble-conversion1==3.1.0-3 +libdw1==0.176-1.1 +libglib2.0-0==2.58.3-2+deb10u4 +libicu63==63.1-6+deb10u3 +libipt2==2.0-2 +libkmod2==26-1 +libpcre2-16-0==10.32-5+deb10u1 +libpopt0==1.16-12 +libprotobuf-dev==3.6.1.3-2+deb10u1 +libprotobuf-lite17==3.6.1.3-2+deb10u1 +libprotobuf17==3.6.1.3-2+deb10u1 +libqt5core5a==5.11.3+dfsg1-1+deb10u5 +libqt5dbus5==5.11.3+dfsg1-1+deb10u5 +libqt5network5==5.11.3+dfsg1-1+deb10u5 +libsaibcm==4.3.7.1-7 +libsaithrift-dev==0.9.4 +libthrift-0.13.0==0.13.0-6 +libyaml-0-2==0.2.1-1 +libyaml-dev==0.2.1-1 +linux-libc-dev==4.19.282-1 +saiserver==0.9.4 +zlib1g-dev==1:1.2.11.dfsg-1+deb10u2 \ No newline at end of file diff --git a/files/build/versions/dockers/docker-sflow/versions-deb-buster b/files/build/versions/dockers/docker-sflow/versions-deb-buster new file mode 100644 index 000000000000..ce14600e6c32 --- /dev/null +++ b/files/build/versions/dockers/docker-sflow/versions-deb-buster @@ -0,0 +1,20 @@ +dmidecode==3.2-1 +gdb==8.2.1-2+b3 +gdbserver==8.2.1-2+b3 +hsflowd==2.0.32-1 +libbabeltrace1==1.5.6-2+deb10u1 +libbsd0==0.9.1-2+deb10u1 +libdw1==0.176-1.1 +libedit2==3.1-20181209-1 +libglib2.0-0==2.58.3-2+deb10u4 +libgpm2==1.20.7-5 +libipt2==2.0-2 +libpopt0==1.16-12 +libunwind8==1.2.1-10~deb10u1 +openssh-client==1:7.9p1-10+deb10u2 +psample==1.1-1 +sflowtool==5.04 +sshpass==1.06-1 +strace==4.26-0.2 +vim==2:8.1.0875-5+deb10u4 +vim-runtime==2:8.1.0875-5+deb10u4 \ No newline at end of file diff --git a/files/build/versions/dockers/docker-snmp/versions-deb-buster b/files/build/versions/dockers/docker-snmp/versions-deb-buster new file mode 100644 index 000000000000..cd2d9ec2800a --- /dev/null +++ b/files/build/versions/dockers/docker-snmp/versions-deb-buster @@ -0,0 +1,65 @@ +binutils==2.31.1-16 +binutils-common==2.31.1-16 +binutils-x86-64-linux-gnu==2.31.1-16 +cpp==4:8.3.0-1 +cpp-8==8.3.0-6 +dh-python==3.20190308 +freeipmi-common==1.6.3-1.1 +gcc==4:8.3.0-1 +gcc-8==8.3.0-6 +gdb==8.2.1-2+b3 +gdbserver==8.2.1-2+b3 +ipmitool==1.8.18-6+deb10u1 +libasan5==8.3.0-6 +libbabeltrace1==1.5.6-2+deb10u1 +libbinutils==2.31.1-16 +libbsd0==0.9.1-2+deb10u1 +libc-dev-bin==2.28-10+deb10u2 +libc-l10n==2.28-10+deb10u2 +libc6-dev==2.28-10+deb10u2 +libcc1-0==8.3.0-6 +libdw1==0.176-1.1 +libedit2==3.1-20181209-1 +libexpat1-dev==2.2.6-2+deb10u6 +libfreeipmi17==1.6.3-1.1 +libgcc-8-dev==8.3.0-6 +libglib2.0-0==2.58.3-2+deb10u4 +libgomp1==8.3.0-6 +libgpm2==1.20.7-5 +libipt2==2.0-2 +libisl19==0.20-2 +libitm1==8.3.0-6 +liblsan0==8.3.0-6 +libmariadb3==1:10.3.38-0+deb10u1 +libmpc3==1.1.0-1 +libmpfr6==4.0.2-1 +libmpx2==8.3.0-6 +libpci3==1:3.5.2-1 +libpopt0==1.16-12 +libpython3-dev==3.7.3-1 +libpython3.7-dev==3.7.3-2+deb10u4 +libquadmath0==8.3.0-6 +libsensors-config==1:3.5.0-3 +libsensors5==1:3.5.0-3 +libsnmp-base==5.7.3+dfsg-5 +libsnmp30==5.7.3+dfsg-5 +libsnmp30-dbg==5.7.3+dfsg-5 +libtsan0==8.3.0-6 +libubsan1==8.3.0-6 +libunwind8==1.2.1-10~deb10u1 +linux-libc-dev==4.19.282-1 +locales==2.28-10+deb10u2 +make==4.2.1-1.2 +mariadb-common==1:10.3.38-0+deb10u1 +mysql-common==5.8+1.0.5 +openssh-client==1:7.9p1-10+deb10u2 +python3-dev==3.7.3-1 +python3.7-dev==3.7.3-2+deb10u4 +snmp==5.7.3+dfsg-5 +snmp-dbgsym==5.7.3+dfsg-5 +snmpd==5.7.3+dfsg-5 +snmpd-dbgsym==5.7.3+dfsg-5 +sshpass==1.06-1 +strace==4.26-0.2 +vim==2:8.1.0875-5+deb10u4 +vim-runtime==2:8.1.0875-5+deb10u4 \ No newline at end of file diff --git a/files/build/versions/dockers/docker-snmp/versions-deb-buster-arm64 b/files/build/versions/dockers/docker-snmp/versions-deb-buster-arm64 new file mode 100644 index 000000000000..76a3c3a88288 --- /dev/null +++ b/files/build/versions/dockers/docker-snmp/versions-deb-buster-arm64 @@ -0,0 +1 @@ +binutils-aarch64-linux-gnu==2.31.1-16 \ No newline at end of file diff --git a/files/build/versions/dockers/docker-snmp/versions-deb-buster-armhf b/files/build/versions/dockers/docker-snmp/versions-deb-buster-armhf new file mode 100644 index 000000000000..568b8b43bc13 --- /dev/null +++ b/files/build/versions/dockers/docker-snmp/versions-deb-buster-armhf @@ -0,0 +1 @@ +binutils-arm-linux-gnueabihf==2.31.1-16 \ No newline at end of file diff --git a/files/build/versions/dockers/docker-snmp/versions-py3 b/files/build/versions/dockers/docker-snmp/versions-py3 new file mode 100644 index 000000000000..8bf91fa04763 --- /dev/null +++ b/files/build/versions/dockers/docker-snmp/versions-py3 @@ -0,0 +1,4 @@ +hiredis==2.2.3 +psutil==5.9.5 +python-arptable==0.0.2 +smbus==1.1.post2 \ No newline at end of file diff --git a/files/build/versions/dockers/docker-sonic-mgmt-framework/versions-deb-buster b/files/build/versions/dockers/docker-sonic-mgmt-framework/versions-deb-buster new file mode 100644 index 000000000000..ff39e73f980e --- /dev/null +++ b/files/build/versions/dockers/docker-sonic-mgmt-framework/versions-deb-buster @@ -0,0 +1,74 @@ +binutils==2.31.1-16 +binutils-common==2.31.1-16 +binutils-x86-64-linux-gnu==2.31.1-16 +cpp==4:8.3.0-1 +cpp-8==8.3.0-6 +dh-python==3.20190308 +g++==4:8.3.0-1 +g++-8==8.3.0-6 +gcc==4:8.3.0-1 +gcc-8==8.3.0-6 +gdb==8.2.1-2+b3 +gdbserver==8.2.1-2+b3 +libasan5==8.3.0-6 +libbabeltrace1==1.5.6-2+deb10u1 +libbinutils==2.31.1-16 +libbsd0==0.9.1-2+deb10u1 +libc-dev-bin==2.28-10+deb10u2 +libc6-dev==2.28-10+deb10u2 +libcc1-0==8.3.0-6 +libdw1==0.176-1.1 +libedit2==3.1-20181209-1 +libexpat1-dev==2.2.6-2+deb10u6 +libgcc-8-dev==8.3.0-6 +libglib2.0-0==2.58.3-2+deb10u4 +libgomp1==8.3.0-6 +libgpm2==1.20.7-5 +libicu63==63.1-6+deb10u3 +libipt2==2.0-2 +libisl19==0.20-2 +libitm1==8.3.0-6 +liblsan0==8.3.0-6 +libmpc3==1.1.0-1 +libmpfr6==4.0.2-1 +libmpx2==8.3.0-6 +libpopt0==1.16-12 +libpython-dev==2.7.16-1 +libpython-stdlib==2.7.16-1 +libpython2-dev==2.7.16-1 +libpython2-stdlib==2.7.16-1 +libpython2.7==2.7.16-2+deb10u1 +libpython2.7-dev==2.7.16-2+deb10u1 +libpython2.7-minimal==2.7.16-2+deb10u1 +libpython2.7-stdlib==2.7.16-2+deb10u1 +libpython3-dev==3.7.3-1 +libpython3.7-dev==3.7.3-2+deb10u4 +libquadmath0==8.3.0-6 +libstdc++-8-dev==8.3.0-6 +libtsan0==8.3.0-6 +libubsan1==8.3.0-6 +libunwind8==1.2.1-10~deb10u1 +libxml2==2.9.4+dfsg1-7+deb10u6 +libyang==1.0.73 +linux-libc-dev==4.19.282-1 +openssh-client==1:7.9p1-10+deb10u2 +python==2.7.16-1 +python-dev==2.7.16-1 +python-minimal==2.7.16-1 +python-pip==18.1-5 +python-pip-whl==18.1-5 +python2==2.7.16-1 +python2-dev==2.7.16-1 +python2-minimal==2.7.16-1 +python2.7==2.7.16-2+deb10u1 +python2.7-dev==2.7.16-2+deb10u1 +python2.7-minimal==2.7.16-2+deb10u1 +python3-dev==3.7.3-1 +python3.7-dev==3.7.3-2+deb10u4 +sonic-mgmt-common==1.0.0 +sonic-mgmt-framework==1.0-01 +sonic-mgmt-framework-dbg==1.0-01 +sshpass==1.06-1 +strace==4.26-0.2 +vim==2:8.1.0875-5+deb10u4 +vim-runtime==2:8.1.0875-5+deb10u4 \ No newline at end of file diff --git a/files/build/versions/dockers/docker-sonic-mgmt-framework/versions-deb-buster-arm64 b/files/build/versions/dockers/docker-sonic-mgmt-framework/versions-deb-buster-arm64 new file mode 100644 index 000000000000..76a3c3a88288 --- /dev/null +++ b/files/build/versions/dockers/docker-sonic-mgmt-framework/versions-deb-buster-arm64 @@ -0,0 +1 @@ +binutils-aarch64-linux-gnu==2.31.1-16 \ No newline at end of file diff --git a/files/build/versions/dockers/docker-sonic-mgmt-framework/versions-deb-buster-armhf b/files/build/versions/dockers/docker-sonic-mgmt-framework/versions-deb-buster-armhf new file mode 100644 index 000000000000..568b8b43bc13 --- /dev/null +++ b/files/build/versions/dockers/docker-sonic-mgmt-framework/versions-deb-buster-armhf @@ -0,0 +1 @@ +binutils-arm-linux-gnueabihf==2.31.1-16 \ No newline at end of file diff --git a/files/build/versions/dockers/docker-sonic-mgmt-framework/versions-py3 b/files/build/versions/dockers/docker-sonic-mgmt-framework/versions-py3 new file mode 100644 index 000000000000..6d98f4200523 --- /dev/null +++ b/files/build/versions/dockers/docker-sonic-mgmt-framework/versions-py3 @@ -0,0 +1,31 @@ +attrs==23.1.0 +certifi==2017.4.17 +charset-normalizer==3.1.0 +click==8.1.3 +clickclick==20.10.2 +connexion==2.7.0 +flask==2.2.5 +grpcio==1.54.0 +grpcio-tools==1.20.0 +idna==3.4 +importlib-metadata==6.6.0 +importlib-resources==5.12.0 +inflection==0.5.1 +itsdangerous==2.1.2 +jsonschema==4.17.3 +jsonschema-spec==0.1.4 +lazy-object-proxy==1.9.0 +openapi-schema-validator==0.4.4 +openapi-spec-validator==0.5.6 +pathable==0.4.3 +pkgutil_resolve_name==1.3.10 +protobuf==4.23.0 +pyrsistent==0.19.3 +python-dateutil==2.6.0 +requests==2.30.0 +rfc3339-validator==0.1.4 +six==1.11.0 +typing_extensions==4.5.0 +urllib3==1.26.5 +werkzeug==2.2.3 +zipp==3.15.0 \ No newline at end of file diff --git a/files/build/versions/dockers/docker-sonic-telemetry/versions-deb-buster b/files/build/versions/dockers/docker-sonic-telemetry/versions-deb-buster new file mode 100644 index 000000000000..88953cfb63d6 --- /dev/null +++ b/files/build/versions/dockers/docker-sonic-telemetry/versions-deb-buster @@ -0,0 +1,19 @@ +gdb==8.2.1-2+b3 +gdbserver==8.2.1-2+b3 +libbabeltrace1==1.5.6-2+deb10u1 +libbsd0==0.9.1-2+deb10u1 +libdw1==0.176-1.1 +libedit2==3.1-20181209-1 +libglib2.0-0==2.58.3-2+deb10u4 +libgpm2==1.20.7-5 +libipt2==2.0-2 +libpopt0==1.16-12 +libunwind8==1.2.1-10~deb10u1 +libyang==1.0.73 +openssh-client==1:7.9p1-10+deb10u2 +sonic-mgmt-common==1.0.0 +sonic-telemetry==0.1 +sshpass==1.06-1 +strace==4.26-0.2 +vim==2:8.1.0875-5+deb10u4 +vim-runtime==2:8.1.0875-5+deb10u4 \ No newline at end of file diff --git a/files/build/versions/dockers/docker-sonic-vs/versions-deb-buster b/files/build/versions/dockers/docker-sonic-vs/versions-deb-buster new file mode 100644 index 000000000000..94cbd68324e8 --- /dev/null +++ b/files/build/versions/dockers/docker-sonic-vs/versions-deb-buster @@ -0,0 +1,147 @@ +arping==2.19-6 +bash-completion==1:2.8-6 +binutils==2.31.1-16 +binutils-common==2.31.1-16 +binutils-x86-64-linux-gnu==2.31.1-16 +bridge-utils==1.6-2 +build-essential==12.6 +conntrack==1:1.4.5-2 +cpp==4:8.3.0-1 +cpp-8==8.3.0-6 +cron==3.0pl1-134+deb10u1 +dh-python==3.20190308 +dirmngr==2.2.12-1+deb10u2 +dmsetup==2:1.02.155-3 +ethtool==1:4.19-1 +frr==7.5.1-sonic-0 +g++==4:8.3.0-1 +g++-8==8.3.0-6 +gcc==4:8.3.0-1 +gcc-8==8.3.0-6 +gettext-base==0.19.8.1-9 +gnupg==2.2.12-1+deb10u2 +gnupg-l10n==2.2.12-1+deb10u2 +gnupg-utils==2.2.12-1+deb10u2 +gpg==2.2.12-1+deb10u2 +gpg-agent==2.2.12-1+deb10u2 +gpg-wks-client==2.2.12-1+deb10u2 +gpg-wks-server==2.2.12-1+deb10u2 +gpgconf==2.2.12-1+deb10u2 +gpgsm==2.2.12-1+deb10u2 +grub-common==2.06-3~deb10u3 +grub2-common==2.06-3~deb10u3 +ifupdown==0.8.35 +iptables==1.8.2-4 +libasan5==8.3.0-6 +libassuan0==2.5.2-1 +libbinutils==2.31.1-16 +libboost-atomic1.71.0==1.71.0-6~bpo10+1 +libboost-program-options1.71.0==1.71.0-6~bpo10+1 +libboost-system1.71.0==1.71.0-6~bpo10+1 +libboost-thread1.71.0==1.71.0-6~bpo10+1 +libbsd0==0.9.1-2+deb10u1 +libc-ares2==1.14.0-1+deb10u2 +libc-dev-bin==2.28-10+deb10u2 +libc6-dev==2.28-10+deb10u2 +libcc1-0==8.3.0-6 +libdevmapper1.02.1==2:1.02.155-3 +libdouble-conversion1==3.1.0-3 +libdpkg-perl==1.19.8 +libedit2==3.1-20181209-1 +libefiboot1==37-2+deb10u1 +libefivar1==37-2+deb10u1 +libexpat1-dev==2.2.6-2+deb10u6 +libfreetype6==2.9.1-3+deb10u3 +libfuse2==2.9.9-1+deb10u1 +libgcc-8-dev==8.3.0-6 +libglib2.0-0==2.58.3-2+deb10u4 +libgomp1==8.3.0-6 +libicu63==63.1-6+deb10u3 +libip4tc0==1.8.2-4 +libip6tc0==1.8.2-4 +libiptc0==1.8.2-4 +libisl19==0.20-2 +libitm1==8.3.0-6 +libjson-c3==0.12.1+ds-2+deb10u1 +libjudydebian1==1.0.5-5 +libksba8==1.3.5-2+deb10u2 +liblsan0==8.3.0-6 +libmpc3==1.1.0-1 +libmpfr6==4.0.2-1 +libmpx2==8.3.0-6 +libnet1==1.1.6+dfsg-3.1 +libnetfilter-conntrack3==1.0.7-1 +libnfnetlink0==1.0.1-3+b1 +libnftnl11==1.1.2-2 +libnpth0==1.6-1 +libpcap0.8==1.8.1-6+deb10u1 +libpcre2-16-0==10.32-5+deb10u1 +libpng16-16==1.6.36-6 +libpopt0==1.16-12 +libpython-dev==2.7.16-1 +libpython-stdlib==2.7.16-1 +libpython2-dev==2.7.16-1 +libpython2-stdlib==2.7.16-1 +libpython2.7==2.7.16-2+deb10u1 +libpython2.7-dev==2.7.16-2+deb10u1 +libpython2.7-minimal==2.7.16-2+deb10u1 +libpython2.7-stdlib==2.7.16-2+deb10u1 +libpython3-dev==3.7.3-1 +libpython3.7-dev==3.7.3-2+deb10u4 +libqt5core5a==5.11.3+dfsg1-1+deb10u5 +libqt5dbus5==5.11.3+dfsg1-1+deb10u5 +libqt5network5==5.11.3+dfsg1-1+deb10u5 +libquadmath0==8.3.0-6 +libsaimetadata==1.0.0 +libsairedis==1.0.0 +libsaivs==1.0.0 +libssl-dev==1.1.1n-0+deb10u4 +libstdc++-8-dev==8.3.0-6 +libteam-utils==1.30-1 +libteam5==1.30-1 +libteamdctl0==1.30-1 +libtsan0==8.3.0-6 +libubsan1==8.3.0-6 +libunwind8==1.2.1-10~deb10u1 +libyang==1.0.73 +libyang-cpp==1.0.73 +libyang1==1.0.184-2 +linux-libc-dev==4.19.282-1 +logrotate==3.14.0-4 +make==4.2.1-1.2 +ndisc6==1.0.4-1 +openssh-client==1:7.9p1-10+deb10u2 +openssh-server==1:7.9p1-10+deb10u2 +openssh-sftp-server==1:7.9p1-10+deb10u2 +patch==2.7.6-3+deb10u1 +pinentry-curses==1.1.0-2 +psmisc==23.2-1+deb10u1 +python==2.7.16-1 +python-dev==2.7.16-1 +python-minimal==2.7.16-1 +python-pip==18.1-5 +python-pip-whl==18.1-5 +python-ply==3.11-3 +python-scapy==2.4.0-2 +python-swsscommon==1.0.0 +python2==2.7.16-1 +python2-dev==2.7.16-1 +python2-minimal==2.7.16-1 +python2-yang==1.0.73 +python2.7==2.7.16-2+deb10u1 +python2.7-dev==2.7.16-2+deb10u1 +python2.7-minimal==2.7.16-2+deb10u1 +python3-dev==3.7.3-1 +python3-yang==1.0.73 +python3.7-dev==3.7.3-2+deb10u4 +redis-server==5:6.0.6-1~bpo10+1 +sensible-utils==0.0.12 +sonic-device-data==1.0-1 +sonic-host-services-data==1.0-1 +sonic-utilities-data==1.0-1 +swig==3.0.12-2 +swig3.0==3.0.12-2 +swss==1.0.0 +syncd-vs==1.0.0 +tcpdump==4.9.3-1~deb10u2 +ucf==3.0038+nmu1 \ No newline at end of file diff --git a/files/build/versions/dockers/docker-sonic-vs/versions-py2 b/files/build/versions/dockers/docker-sonic-vs/versions-py2 new file mode 100644 index 000000000000..1202ed030d5c --- /dev/null +++ b/files/build/versions/dockers/docker-sonic-vs/versions-py2 @@ -0,0 +1,13 @@ +certifi==2021.10.8 +chardet==4.0.0 +crontab==1.0.1 +idna==2.10 +monotonic==1.5 +netifaces==0.10.7 +ply==3.11 +py2-ipaddress==3.4.2 +pyroute2==0.5.3 +requests==2.27.1 +scapy==2.4.0 +six==1.16.0 +urllib3==1.26.15 \ No newline at end of file diff --git a/files/build/versions/dockers/docker-sonic-vs/versions-py3 b/files/build/versions/dockers/docker-sonic-vs/versions-py3 new file mode 100644 index 000000000000..db99010d07e7 --- /dev/null +++ b/files/build/versions/dockers/docker-sonic-vs/versions-py3 @@ -0,0 +1,16 @@ +certifi==2023.5.7 +charset-normalizer==3.1.0 +click==7.0 +idna==3.4 +ijson==2.6.1 +jsondiff==2.0.0 +m2crypto==0.38.0 +netifaces==0.10.9 +pexpect==4.8.0 +ptyprocess==0.7.0 +pyroute2==0.5.14 +requests==2.30.0 +scapy==2.4.4 +tabulate==0.9.0 +urllib3==2.0.2 +xmltodict==0.12.0 \ No newline at end of file diff --git a/files/build/versions/dockers/docker-swss-layer-buster/versions-deb-buster b/files/build/versions/dockers/docker-swss-layer-buster/versions-deb-buster new file mode 100644 index 000000000000..5690a145b7a2 --- /dev/null +++ b/files/build/versions/dockers/docker-swss-layer-buster/versions-deb-buster @@ -0,0 +1,5 @@ +libsaimetadata==1.0.0 +libsairedis==1.0.0 +libteam5==1.30-1 +libteamdctl0==1.30-1 +swss==1.0.0 \ No newline at end of file diff --git a/files/build/versions/dockers/docker-syncd-bfn-rpc/versions-deb-buster b/files/build/versions/dockers/docker-syncd-bfn-rpc/versions-deb-buster new file mode 100644 index 000000000000..9a8b06a37485 --- /dev/null +++ b/files/build/versions/dockers/docker-syncd-bfn-rpc/versions-deb-buster @@ -0,0 +1,71 @@ +binutils==2.31.1-16 +binutils-common==2.31.1-16 +binutils-x86-64-linux-gnu==2.31.1-16 +build-essential==12.6 +cmake==3.13.4-1 +cmake-data==3.13.4-1 +cpp==4:8.3.0-1 +cpp-8==8.3.0-6 +g++==4:8.3.0-1 +g++-8==8.3.0-6 +gcc==4:8.3.0-1 +gcc-8==8.3.0-6 +libarchive13==3.3.3-4+deb10u3 +libasan5==8.3.0-6 +libbinutils==2.31.1-16 +libboost-atomic1.71.0==1.71.0-6~bpo10+1 +libcc1-0==8.3.0-6 +libdouble-conversion1==3.1.0-3 +libdpkg-perl==1.19.8 +libexpat1-dev==2.2.6-2+deb10u6 +libffi-dev==3.2.1-9 +libgcc-8-dev==8.3.0-6 +libglib2.0-0==2.58.3-2+deb10u4 +libgomp1==8.3.0-6 +libisl19==0.20-2 +libitm1==8.3.0-6 +libjsoncpp1==1.7.4-3 +liblsan0==8.3.0-6 +libmpc3==1.1.0-1 +libmpfr6==4.0.2-1 +libmpx2==8.3.0-6 +libpcre2-16-0==10.32-5+deb10u1 +libpcre2-8-0==10.32-5+deb10u1 +libpython-dev==2.7.16-1 +libpython-stdlib==2.7.16-1 +libpython2-dev==2.7.16-1 +libpython2-stdlib==2.7.16-1 +libpython2.7==2.7.16-2+deb10u1 +libpython2.7-dev==2.7.16-2+deb10u1 +libpython2.7-minimal==2.7.16-2+deb10u1 +libpython2.7-stdlib==2.7.16-2+deb10u1 +libqt5core5a==5.11.3+dfsg1-1+deb10u5 +libqt5dbus5==5.11.3+dfsg1-1+deb10u5 +libqt5network5==5.11.3+dfsg1-1+deb10u5 +libquadmath0==8.3.0-6 +librhash0==1.3.8-1 +libssl-dev==1.1.1n-0+deb10u4 +libstdc++-8-dev==8.3.0-6 +libthrift-0.11.0==0.11.0-4 +libtsan0==8.3.0-6 +libubsan1==8.3.0-6 +libuv1==1.24.1-1+deb10u1 +make==4.2.1-1.2 +patch==2.7.6-3+deb10u1 +python==2.7.16-1 +python-dev==2.7.16-1 +python-minimal==2.7.16-1 +python-pip==18.1-5 +python-pip-whl==18.1-5 +python-pkg-resources==40.8.0-1 +python-ptf==0.9-1 +python-scapy==2.4.0-2 +python-setuptools==40.8.0-1 +python2==2.7.16-1 +python2-dev==2.7.16-1 +python2-minimal==2.7.16-1 +python2.7==2.7.16-2+deb10u1 +python2.7-dev==2.7.16-2+deb10u1 +python2.7-minimal==2.7.16-2+deb10u1 +syncd-rpc==1.0.0 +wget==1.20.1-1.1 \ No newline at end of file diff --git a/files/build/versions/dockers/docker-syncd-bfn-rpc/versions-py2 b/files/build/versions/dockers/docker-syncd-bfn-rpc/versions-py2 new file mode 100644 index 000000000000..60b9f31f8e4a --- /dev/null +++ b/files/build/versions/dockers/docker-syncd-bfn-rpc/versions-py2 @@ -0,0 +1,5 @@ +cffi==1.7.0 +nnpy==1.4.2 +ptf==0.9.1 +pycparser==2.21 +scapy==2.4.0 \ No newline at end of file diff --git a/files/build/versions/dockers/docker-syncd-bfn/versions-deb-buster b/files/build/versions/dockers/docker-syncd-bfn/versions-deb-buster new file mode 100644 index 000000000000..ecc15b35e609 --- /dev/null +++ b/files/build/versions/dockers/docker-syncd-bfn/versions-deb-buster @@ -0,0 +1,23 @@ +bfnplatform==1.0.0 +bfnsdk==1.0.0 +libc-ares2==1.14.0-1+deb10u2 +libc-dev-bin==2.28-10+deb10u2 +libc6-dev==2.28-10+deb10u2 +libcurl3-gnutls==7.64.0-4+deb10u6 +libcurl4-gnutls-dev==7.64.0-4+deb10u6 +libgoogle-perftools4==2.7-1 +libicu63==63.1-6+deb10u3 +liblzma-dev==5.2.4-1+deb10u1 +libpcap-dev==1.8.1-6+deb10u1 +libpcap0.8==1.8.1-6+deb10u1 +libpcap0.8-dev==1.8.1-6+deb10u1 +libsaimetadata==1.0.0 +libsairedis==1.0.0 +libtcmalloc-minimal4==2.7-1 +libunwind-dev==1.2.1-10~deb10u1 +libunwind8==1.2.1-10~deb10u1 +libusb-1.0-0==2:1.0.22-2 +libusb-1.0-0-dev==2:1.0.22-2 +libxml2==2.9.4+dfsg1-7+deb10u6 +linux-libc-dev==4.19.282-1 +syncd==1.0.0 \ No newline at end of file diff --git a/files/build/versions/dockers/docker-syncd-brcm-rpc/versions-deb-buster b/files/build/versions/dockers/docker-syncd-brcm-rpc/versions-deb-buster new file mode 100644 index 000000000000..44dcfcdb6365 --- /dev/null +++ b/files/build/versions/dockers/docker-syncd-brcm-rpc/versions-deb-buster @@ -0,0 +1,73 @@ +binutils==2.31.1-16 +binutils-common==2.31.1-16 +binutils-x86-64-linux-gnu==2.31.1-16 +build-essential==12.6 +cmake==3.13.4-1 +cmake-data==3.13.4-1 +cpp==4:8.3.0-1 +cpp-8==8.3.0-6 +g++==4:8.3.0-1 +g++-8==8.3.0-6 +gcc==4:8.3.0-1 +gcc-8==8.3.0-6 +libarchive13==3.3.3-4+deb10u3 +libasan5==8.3.0-6 +libbinutils==2.31.1-16 +libboost-atomic1.71.0==1.71.0-6~bpo10+1 +libcc1-0==8.3.0-6 +libdouble-conversion1==3.1.0-3 +libdpkg-perl==1.19.8 +libexpat1-dev==2.2.6-2+deb10u6 +libffi-dev==3.2.1-9 +libgcc-8-dev==8.3.0-6 +libglib2.0-0==2.58.3-2+deb10u4 +libgomp1==8.3.0-6 +libicu63==63.1-6+deb10u3 +libisl19==0.20-2 +libitm1==8.3.0-6 +libjsoncpp1==1.7.4-3 +liblsan0==8.3.0-6 +libmpc3==1.1.0-1 +libmpfr6==4.0.2-1 +libmpx2==8.3.0-6 +libpcre2-16-0==10.32-5+deb10u1 +libpcre2-8-0==10.32-5+deb10u1 +libpython-dev==2.7.16-1 +libpython-stdlib==2.7.16-1 +libpython2-dev==2.7.16-1 +libpython2-stdlib==2.7.16-1 +libpython2.7==2.7.16-2+deb10u1 +libpython2.7-dev==2.7.16-2+deb10u1 +libpython2.7-minimal==2.7.16-2+deb10u1 +libpython2.7-stdlib==2.7.16-2+deb10u1 +libqt5core5a==5.11.3+dfsg1-1+deb10u5 +libqt5dbus5==5.11.3+dfsg1-1+deb10u5 +libqt5network5==5.11.3+dfsg1-1+deb10u5 +libquadmath0==8.3.0-6 +librhash0==1.3.8-1 +libssl-dev==1.1.1n-0+deb10u4 +libstdc++-8-dev==8.3.0-6 +libthrift-0.11.0==0.11.0-4 +libtsan0==8.3.0-6 +libubsan1==8.3.0-6 +libuv1==1.24.1-1+deb10u1 +libxml2==2.9.4+dfsg1-7+deb10u6 +make==4.2.1-1.2 +patch==2.7.6-3+deb10u1 +python==2.7.16-1 +python-dev==2.7.16-1 +python-minimal==2.7.16-1 +python-pip==18.1-5 +python-pip-whl==18.1-5 +python-pkg-resources==40.8.0-1 +python-ptf==0.9-1 +python-scapy==2.4.0-2 +python-setuptools==40.8.0-1 +python2==2.7.16-1 +python2-dev==2.7.16-1 +python2-minimal==2.7.16-1 +python2.7==2.7.16-2+deb10u1 +python2.7-dev==2.7.16-2+deb10u1 +python2.7-minimal==2.7.16-2+deb10u1 +syncd-rpc==1.0.0 +wget==1.20.1-1.1 \ No newline at end of file diff --git a/files/build/versions/dockers/docker-syncd-brcm-rpc/versions-py2 b/files/build/versions/dockers/docker-syncd-brcm-rpc/versions-py2 new file mode 100644 index 000000000000..60b9f31f8e4a --- /dev/null +++ b/files/build/versions/dockers/docker-syncd-brcm-rpc/versions-py2 @@ -0,0 +1,5 @@ +cffi==1.7.0 +nnpy==1.4.2 +ptf==0.9.1 +pycparser==2.21 +scapy==2.4.0 \ No newline at end of file diff --git a/files/build/versions/dockers/docker-syncd-brcm/versions-deb-buster b/files/build/versions/dockers/docker-syncd-brcm/versions-deb-buster new file mode 100644 index 000000000000..01f8362afd81 --- /dev/null +++ b/files/build/versions/dockers/docker-syncd-brcm/versions-deb-buster @@ -0,0 +1,36 @@ +ethtool==1:4.19-1 +gdb==8.2.1-2+b3 +gdbserver==8.2.1-2+b3 +kmod==26-1 +libbabeltrace1==1.5.6-2+deb10u1 +libbsd0==0.9.1-2+deb10u1 +libc-dev-bin==2.28-10+deb10u2 +libc6-dev==2.28-10+deb10u2 +libdw1==0.176-1.1 +libedit2==3.1-20181209-1 +libglib2.0-0==2.58.3-2+deb10u4 +libgpm2==1.20.7-5 +libipt2==2.0-2 +libkmod2==26-1 +libpopt0==1.16-12 +libprotobuf-dev==3.6.1.3-2+deb10u1 +libprotobuf-lite17==3.6.1.3-2+deb10u1 +libprotobuf17==3.6.1.3-2+deb10u1 +libsaibcm==4.3.7.1-7 +libsaimetadata==1.0.0 +libsaimetadata-dbg==1.0.0 +libsairedis==1.0.0 +libsairedis-dbg==1.0.0 +libswsscommon-dbg==1.0.0 +libunwind8==1.2.1-10~deb10u1 +libyaml-0-2==0.2.1-1 +libyaml-dev==0.2.1-1 +linux-libc-dev==4.19.282-1 +openssh-client==1:7.9p1-10+deb10u2 +sshpass==1.06-1 +strace==4.26-0.2 +syncd==1.0.0 +syncd-dbg==1.0.0 +vim==2:8.1.0875-5+deb10u4 +vim-runtime==2:8.1.0875-5+deb10u4 +zlib1g-dev==1:1.2.11.dfsg-1+deb10u2 \ No newline at end of file diff --git a/files/build/versions/dockers/docker-syncd-centec-rpc/versions-deb-buster b/files/build/versions/dockers/docker-syncd-centec-rpc/versions-deb-buster new file mode 100644 index 000000000000..1e293a7f6a41 --- /dev/null +++ b/files/build/versions/dockers/docker-syncd-centec-rpc/versions-deb-buster @@ -0,0 +1,76 @@ +binutils==2.31.1-16 +binutils-common==2.31.1-16 +binutils-x86-64-linux-gnu==2.31.1-16 +build-essential==12.6 +cmake==3.13.4-1 +cmake-data==3.13.4-1 +cpp==4:8.3.0-1 +cpp-8==8.3.0-6 +g++==4:8.3.0-1 +g++-8==8.3.0-6 +gcc==4:8.3.0-1 +gcc-8==8.3.0-6 +libarchive13==3.3.3-4+deb10u3 +libasan5==8.3.0-6 +libbinutils==2.31.1-16 +libboost-atomic1.71.0==1.71.0-6~bpo10+1 +libc-dev-bin==2.28-10+deb10u2 +libc6-dev==2.28-10+deb10u2 +libcc1-0==8.3.0-6 +libdouble-conversion1==3.1.0-3 +libdpkg-perl==1.19.8 +libexpat1-dev==2.2.6-2+deb10u6 +libffi-dev==3.2.1-9 +libgcc-8-dev==8.3.0-6 +libglib2.0-0==2.58.3-2+deb10u4 +libgomp1==8.3.0-6 +libicu63==63.1-6+deb10u3 +libisl19==0.20-2 +libitm1==8.3.0-6 +libjsoncpp1==1.7.4-3 +liblsan0==8.3.0-6 +libmpc3==1.1.0-1 +libmpfr6==4.0.2-1 +libmpx2==8.3.0-6 +libpcre2-16-0==10.32-5+deb10u1 +libpcre2-8-0==10.32-5+deb10u1 +libpython-dev==2.7.16-1 +libpython-stdlib==2.7.16-1 +libpython2-dev==2.7.16-1 +libpython2-stdlib==2.7.16-1 +libpython2.7==2.7.16-2+deb10u1 +libpython2.7-dev==2.7.16-2+deb10u1 +libpython2.7-minimal==2.7.16-2+deb10u1 +libpython2.7-stdlib==2.7.16-2+deb10u1 +libqt5core5a==5.11.3+dfsg1-1+deb10u5 +libqt5dbus5==5.11.3+dfsg1-1+deb10u5 +libqt5network5==5.11.3+dfsg1-1+deb10u5 +libquadmath0==8.3.0-6 +librhash0==1.3.8-1 +libssl-dev==1.1.1n-0+deb10u4 +libstdc++-8-dev==8.3.0-6 +libthrift-0.11.0==0.11.0-4 +libtsan0==8.3.0-6 +libubsan1==8.3.0-6 +libuv1==1.24.1-1+deb10u1 +libxml2==2.9.4+dfsg1-7+deb10u6 +linux-libc-dev==4.19.282-1 +make==4.2.1-1.2 +patch==2.7.6-3+deb10u1 +python==2.7.16-1 +python-dev==2.7.16-1 +python-minimal==2.7.16-1 +python-pip==18.1-5 +python-pip-whl==18.1-5 +python-pkg-resources==40.8.0-1 +python-ptf==0.9-1 +python-scapy==2.4.0-2 +python-setuptools==40.8.0-1 +python2==2.7.16-1 +python2-dev==2.7.16-1 +python2-minimal==2.7.16-1 +python2.7==2.7.16-2+deb10u1 +python2.7-dev==2.7.16-2+deb10u1 +python2.7-minimal==2.7.16-2+deb10u1 +syncd-rpc==1.0.0 +wget==1.20.1-1.1 \ No newline at end of file diff --git a/files/build/versions/dockers/docker-syncd-centec-rpc/versions-py2 b/files/build/versions/dockers/docker-syncd-centec-rpc/versions-py2 new file mode 100644 index 000000000000..60b9f31f8e4a --- /dev/null +++ b/files/build/versions/dockers/docker-syncd-centec-rpc/versions-py2 @@ -0,0 +1,5 @@ +cffi==1.7.0 +nnpy==1.4.2 +ptf==0.9.1 +pycparser==2.21 +scapy==2.4.0 \ No newline at end of file diff --git a/files/build/versions/dockers/docker-syncd-centec/versions-deb-buster b/files/build/versions/dockers/docker-syncd-centec/versions-deb-buster new file mode 100644 index 000000000000..6a905c8607b8 --- /dev/null +++ b/files/build/versions/dockers/docker-syncd-centec/versions-deb-buster @@ -0,0 +1,22 @@ +gdb==8.2.1-2+b3 +gdbserver==8.2.1-2+b3 +kmod==26-1 +libbabeltrace1==1.5.6-2+deb10u1 +libbsd0==0.9.1-2+deb10u1 +libdw1==0.176-1.1 +libedit2==3.1-20181209-1 +libglib2.0-0==2.58.3-2+deb10u4 +libgpm2==1.20.7-5 +libipt2==2.0-2 +libkmod2==26-1 +libpopt0==1.16-12 +libsai==1.6.3-1 +libsaimetadata==1.0.0 +libsairedis==1.0.0 +libunwind8==1.2.1-10~deb10u1 +openssh-client==1:7.9p1-10+deb10u2 +sshpass==1.06-1 +strace==4.26-0.2 +syncd==1.0.0 +vim==2:8.1.0875-5+deb10u4 +vim-runtime==2:8.1.0875-5+deb10u4 \ No newline at end of file diff --git a/files/build/versions/dockers/docker-syncd-centec/versions-deb-buster-arm64 b/files/build/versions/dockers/docker-syncd-centec/versions-deb-buster-arm64 new file mode 100644 index 000000000000..ccab4a1c7a72 --- /dev/null +++ b/files/build/versions/dockers/docker-syncd-centec/versions-deb-buster-arm64 @@ -0,0 +1,37 @@ +dmsetup==2:1.02.155-3 +keyutils==1.6-6 +libdevmapper1.02.1==2:1.02.155-3 +libevent-2.1-6==2.1.8-stable-4 +libexpat1-dev==2.2.6-2+deb10u6 +libnfsidmap2==0.25-5.1 +libpcap-dev==1.8.1-6+deb10u1 +libpcap0.8==1.8.1-6+deb10u1 +libpcap0.8-dev==1.8.1-6+deb10u1 +libpython-dev==2.7.16-1 +libpython-stdlib==2.7.16-1 +libpython2-dev==2.7.16-1 +libpython2-stdlib==2.7.16-1 +libpython2.7==2.7.16-2+deb10u1 +libpython2.7-dev==2.7.16-2+deb10u1 +libpython2.7-minimal==2.7.16-2+deb10u1 +libpython2.7-stdlib==2.7.16-2+deb10u1 +libsensors-config==1:3.5.0-3 +libsensors4-dev==1:3.5.0-3 +libsensors5==1:3.5.0-3 +libtirpc-common==1.1.4-0.4+deb10u1 +libtirpc3==1.1.4-0.4+deb10u1 +nfs-common==1:1.3.4-2.5+deb10u1 +python==2.7.16-1 +python-dev==2.7.16-1 +python-minimal==2.7.16-1 +python2==2.7.16-1 +python2-dev==2.7.16-1 +python2-minimal==2.7.16-1 +python2.7==2.7.16-2+deb10u1 +python2.7-dev==2.7.16-2+deb10u1 +python2.7-minimal==2.7.16-2+deb10u1 +rpcbind==1.2.5-0.3+deb10u1 +sensible-utils==0.0.12 +swig==3.0.12-2 +swig3.0==3.0.12-2 +ucf==3.0038+nmu1 \ No newline at end of file diff --git a/files/build/versions/dockers/docker-syncd-mlnx-rpc/versions-deb-buster b/files/build/versions/dockers/docker-syncd-mlnx-rpc/versions-deb-buster new file mode 100644 index 000000000000..6099d3eb7528 --- /dev/null +++ b/files/build/versions/dockers/docker-syncd-mlnx-rpc/versions-deb-buster @@ -0,0 +1,51 @@ +binutils==2.31.1-16 +binutils-common==2.31.1-16 +binutils-x86-64-linux-gnu==2.31.1-16 +build-essential==12.6 +cmake==3.13.4-1 +cmake-data==3.13.4-1 +cpp==4:8.3.0-1 +cpp-8==8.3.0-6 +g++==4:8.3.0-1 +g++-8==8.3.0-6 +gcc==4:8.3.0-1 +gcc-8==8.3.0-6 +libarchive13==3.3.3-4+deb10u3 +libasan5==8.3.0-6 +libbinutils==2.31.1-16 +libboost-atomic1.71.0==1.71.0-6~bpo10+1 +libcc1-0==8.3.0-6 +libdouble-conversion1==3.1.0-3 +libdpkg-perl==1.19.8 +libffi-dev==3.2.1-9 +libgcc-8-dev==8.3.0-6 +libglib2.0-0==2.58.3-2+deb10u4 +libgomp1==8.3.0-6 +libisl19==0.20-2 +libitm1==8.3.0-6 +libjsoncpp1==1.7.4-3 +liblsan0==8.3.0-6 +libmpc3==1.1.0-1 +libmpfr6==4.0.2-1 +libmpx2==8.3.0-6 +libpcre2-16-0==10.32-5+deb10u1 +libpcre2-8-0==10.32-5+deb10u1 +libqt5core5a==5.11.3+dfsg1-1+deb10u5 +libqt5dbus5==5.11.3+dfsg1-1+deb10u5 +libqt5network5==5.11.3+dfsg1-1+deb10u5 +libquadmath0==8.3.0-6 +librhash0==1.3.8-1 +libssl-dev==1.1.1n-0+deb10u4 +libstdc++-8-dev==8.3.0-6 +libthrift-0.11.0==0.11.0-4 +libtsan0==8.3.0-6 +libubsan1==8.3.0-6 +libuv1==1.24.1-1+deb10u1 +make==4.2.1-1.2 +patch==2.7.6-3+deb10u1 +python-pip==18.1-5 +python-pip-whl==18.1-5 +python-ptf==0.9-1 +python-scapy==2.4.0-2 +syncd-rpc==1.0.0 +wget==1.20.1-1.1 \ No newline at end of file diff --git a/files/build/versions/dockers/docker-syncd-mlnx-rpc/versions-py2 b/files/build/versions/dockers/docker-syncd-mlnx-rpc/versions-py2 new file mode 100644 index 000000000000..60b9f31f8e4a --- /dev/null +++ b/files/build/versions/dockers/docker-syncd-mlnx-rpc/versions-py2 @@ -0,0 +1,5 @@ +cffi==1.7.0 +nnpy==1.4.2 +ptf==0.9.1 +pycparser==2.21 +scapy==2.4.0 \ No newline at end of file diff --git a/files/build/versions/dockers/docker-syncd-mlnx/versions-deb-buster b/files/build/versions/dockers/docker-syncd-mlnx/versions-deb-buster new file mode 100644 index 000000000000..5e9fd3d4e5f7 --- /dev/null +++ b/files/build/versions/dockers/docker-syncd-mlnx/versions-deb-buster @@ -0,0 +1,71 @@ +applibs==1.mlnx.4.5.3196 +applibs-dev==1.mlnx.4.5.3196 +gdb==8.2.1-2+b3 +gdbserver==8.2.1-2+b3 +iproute2-dev==1.mlnx.4.5.3196 +libbabeltrace1==1.5.6-2+deb10u1 +libbsd0==0.9.1-2+deb10u1 +libc-dev-bin==2.28-10+deb10u2 +libc6-dev==2.28-10+deb10u2 +libdw1==0.176-1.1 +libedit2==3.1-20181209-1 +libelf1==0.176-1.1 +libexpat1-dev==2.2.6-2+deb10u6 +libglib2.0-0==2.58.3-2+deb10u4 +libgpm2==1.20.7-5 +libicu63==63.1-6+deb10u3 +libipt2==2.0-2 +libpopt0==1.16-12 +libpython-dev==2.7.16-1 +libpython-stdlib==2.7.16-1 +libpython2-dev==2.7.16-1 +libpython2-stdlib==2.7.16-1 +libpython2.7==2.7.16-2+deb10u1 +libpython2.7-dev==2.7.16-2+deb10u1 +libpython2.7-minimal==2.7.16-2+deb10u1 +libpython2.7-stdlib==2.7.16-2+deb10u1 +libsaimetadata==1.0.0 +libsaimetadata-dbg==1.0.0 +libsairedis==1.0.0 +libsairedis-dbg==1.0.0 +libswsscommon-dbg==1.0.0 +libunwind8==1.2.1-10~deb10u1 +libxml2==2.9.4+dfsg1-7+deb10u6 +linux-libc-dev==4.19.282-1 +mft==4.21.0-100 +mlnx-sai==1.mlnx.SAIRel1.22.0.0 +openssh-client==1:7.9p1-10+deb10u2 +python==2.7.16-1 +python-dev==2.7.16-1 +python-minimal==2.7.16-1 +python-pip==18.1-5 +python-pip-whl==18.1-5 +python-pkg-resources==40.8.0-1 +python-sdk-api==1.mlnx.4.5.3196 +python-setuptools==40.8.0-1 +python2==2.7.16-1 +python2-dev==2.7.16-1 +python2-minimal==2.7.16-1 +python2.7==2.7.16-2+deb10u1 +python2.7-dev==2.7.16-2+deb10u1 +python2.7-minimal==2.7.16-2+deb10u1 +sshpass==1.06-1 +strace==4.26-0.2 +sx-acl-helper==1.mlnx.4.5.3196 +sx-acl-helper-dev==1.mlnx.4.5.3196 +sx-complib==1.mlnx.4.5.3196 +sx-complib-dev==1.mlnx.4.5.3196 +sx-examples==1.mlnx.4.5.3196 +sx-examples-dev==1.mlnx.4.5.3196 +sx-gen-utils==1.mlnx.4.5.3196 +sx-gen-utils-dev==1.mlnx.4.5.3196 +sx-scew==1.mlnx.4.5.3196 +sx-scew-dev==1.mlnx.4.5.3196 +sxd-libs==1.mlnx.4.5.3196 +sxd-libs-dev==1.mlnx.4.5.3196 +syncd==1.0.0 +syncd-dbg==1.0.0 +vim==2:8.1.0875-5+deb10u4 +vim-runtime==2:8.1.0875-5+deb10u4 +wjh-libs==1.mlnx.4.5.3196 +wjh-libs-dev==1.mlnx.4.5.3196 \ No newline at end of file diff --git a/files/build/versions/dockers/docker-syncd-mlnx/versions-py2 b/files/build/versions/dockers/docker-syncd-mlnx/versions-py2 new file mode 100644 index 000000000000..e86ef29dbed2 --- /dev/null +++ b/files/build/versions/dockers/docker-syncd-mlnx/versions-py2 @@ -0,0 +1 @@ +python-sdk-api==4.5.3196 \ No newline at end of file diff --git a/files/build/versions/dockers/docker-syncd-mlnx/versions-py3 b/files/build/versions/dockers/docker-syncd-mlnx/versions-py3 new file mode 100644 index 000000000000..ff782443e8d6 --- /dev/null +++ b/files/build/versions/dockers/docker-syncd-mlnx/versions-py3 @@ -0,0 +1 @@ +python_sdk_api==4.5.3196 \ No newline at end of file diff --git a/files/build/versions/dockers/docker-syncd-mrvl/versions-deb-buster-armhf b/files/build/versions/dockers/docker-syncd-mrvl/versions-deb-buster-armhf new file mode 100644 index 000000000000..c853ce53ca19 --- /dev/null +++ b/files/build/versions/dockers/docker-syncd-mrvl/versions-deb-buster-armhf @@ -0,0 +1,41 @@ +dmsetup==2:1.02.155-3 +keyutils==1.6-6 +libdevmapper1.02.1==2:1.02.155-3 +libevent-2.1-6==2.1.8-stable-4 +libexpat1-dev==2.2.6-2+deb10u6 +libnfsidmap2==0.25-5.1 +libpcap-dev==1.8.1-6+deb10u1 +libpcap0.8==1.8.1-6+deb10u1 +libpcap0.8-dev==1.8.1-6+deb10u1 +libpython-dev==2.7.16-1 +libpython-stdlib==2.7.16-1 +libpython2-dev==2.7.16-1 +libpython2-stdlib==2.7.16-1 +libpython2.7==2.7.16-2+deb10u1 +libpython2.7-dev==2.7.16-2+deb10u1 +libpython2.7-minimal==2.7.16-2+deb10u1 +libpython2.7-stdlib==2.7.16-2+deb10u1 +libsaimetadata==1.0.0 +libsairedis==1.0.0 +libsensors-config==1:3.5.0-3 +libsensors4-dev==1:3.5.0-3 +libsensors5==1:3.5.0-3 +libtirpc-common==1.1.4-0.4+deb10u1 +libtirpc3==1.1.4-0.4+deb10u1 +mrvllibsai==1.7.1-9 +nfs-common==1:1.3.4-2.5+deb10u1 +python==2.7.16-1 +python-dev==2.7.16-1 +python-minimal==2.7.16-1 +python2==2.7.16-1 +python2-dev==2.7.16-1 +python2-minimal==2.7.16-1 +python2.7==2.7.16-2+deb10u1 +python2.7-dev==2.7.16-2+deb10u1 +python2.7-minimal==2.7.16-2+deb10u1 +rpcbind==1.2.5-0.3+deb10u1 +sensible-utils==0.0.12 +swig==3.0.12-2 +swig3.0==3.0.12-2 +syncd==1.0.0 +ucf==3.0038+nmu1 \ No newline at end of file diff --git a/files/build/versions/dockers/docker-syncd-nephos/versions-deb-stretch b/files/build/versions/dockers/docker-syncd-nephos/versions-deb-stretch new file mode 100644 index 000000000000..73159f281269 --- /dev/null +++ b/files/build/versions/dockers/docker-syncd-nephos/versions-deb-stretch @@ -0,0 +1,29 @@ +gdb==7.12-6 +gdbserver==7.12-6 +libbabeltrace-ctf1==1.5.1-1 +libbabeltrace1==1.5.1-1 +libbsd0==0.8.3-1+deb9u1 +libdw1==0.168-1+deb9u1 +libedit2==3.1-20160903-3 +libglib2.0-0==2.50.3-2+deb9u3 +libgpm2==1.20.4-6.2+b1 +libicu57==57.1-6+deb9u5 +libmpdec2==2.4.2-1 +libpopt0==1.16-10+b2 +libpython3.5==3.5.3-1+deb9u5 +libpython3.5-minimal==3.5.3-1+deb9u5 +libpython3.5-stdlib==3.5.3-1+deb9u5 +libsaimetadata==1.0.0 +libsaimetadata-dbg==1.0.0 +libsainps==1.5.0 +libsairedis==1.0.0 +libsairedis-dbg==1.0.0 +libswsscommon-dbg==1.0.0 +libxml2==2.9.4+dfsg1-2.2+deb9u7 +openssh-client==1:7.4p1-10+deb9u7 +sshpass==1.06-1 +strace==4.15-2 +syncd==1.0.0 +syncd-dbg==1.0.0 +vim==2:8.0.0197-4+deb9u7 +vim-runtime==2:8.0.0197-4+deb9u7 \ No newline at end of file diff --git a/files/build/versions/dockers/docker-syncd-vs/versions-deb-buster b/files/build/versions/dockers/docker-syncd-vs/versions-deb-buster new file mode 100644 index 000000000000..6da0ec29a7b3 --- /dev/null +++ b/files/build/versions/dockers/docker-syncd-vs/versions-deb-buster @@ -0,0 +1,25 @@ +gdb==8.2.1-2+b3 +gdbserver==8.2.1-2+b3 +libbabeltrace1==1.5.6-2+deb10u1 +libbsd0==0.9.1-2+deb10u1 +libdw1==0.176-1.1 +libedit2==3.1-20181209-1 +libglib2.0-0==2.58.3-2+deb10u4 +libgpm2==1.20.7-5 +libipt2==2.0-2 +libpopt0==1.16-12 +libsaimetadata==1.0.0 +libsaimetadata-dbg==1.0.0 +libsairedis==1.0.0 +libsairedis-dbg==1.0.0 +libsaivs==1.0.0 +libsaivs-dbg==1.0.0 +libswsscommon-dbg==1.0.0 +libunwind8==1.2.1-10~deb10u1 +openssh-client==1:7.9p1-10+deb10u2 +sshpass==1.06-1 +strace==4.26-0.2 +syncd-vs==1.0.0 +syncd-vs-dbg==1.0.0 +vim==2:8.1.0875-5+deb10u4 +vim-runtime==2:8.1.0875-5+deb10u4 \ No newline at end of file diff --git a/files/build/versions/dockers/docker-teamd/versions-deb-buster b/files/build/versions/dockers/docker-teamd/versions-deb-buster new file mode 100644 index 000000000000..4182f6ed05a8 --- /dev/null +++ b/files/build/versions/dockers/docker-teamd/versions-deb-buster @@ -0,0 +1,21 @@ +gdb==8.2.1-2+b3 +gdbserver==8.2.1-2+b3 +libbabeltrace1==1.5.6-2+deb10u1 +libbsd0==0.9.1-2+deb10u1 +libdw1==0.176-1.1 +libedit2==3.1-20181209-1 +libglib2.0-0==2.58.3-2+deb10u4 +libgpm2==1.20.7-5 +libipt2==2.0-2 +libpopt0==1.16-12 +libswsscommon-dbg==1.0.0 +libteam-utils==1.30-1 +libteam-utils-dbgsym==1.30-1 +libteamdctl0-dbgsym==1.30-1 +libunwind8==1.2.1-10~deb10u1 +openssh-client==1:7.9p1-10+deb10u2 +sshpass==1.06-1 +strace==4.26-0.2 +swss-dbg==1.0.0 +vim==2:8.1.0875-5+deb10u4 +vim-runtime==2:8.1.0875-5+deb10u4 \ No newline at end of file diff --git a/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster b/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster new file mode 100644 index 000000000000..30f16feaeba1 --- /dev/null +++ b/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster @@ -0,0 +1,1733 @@ +adwaita-icon-theme==3.30.1-1 +ant==1.10.5-2 +ant-optional==1.10.5-2 +apt-file==3.2.2 +apt-transport-https==1.8.2.3 +apt-utils==1.8.2.3 +arch-test==0.15-2+deb10u1 +asciidoctor==1.5.8-1 +aspell==0.60.7~20110707-6+deb10u1 +aspell-en==2018.04.16-0-1 +at==3.1.23-1 +at-spi2-core==2.30.0-7 +aufs-dkms==4.19+20190211-1 +aufs-tools==1:4.14+20190211-1 +augeas-lenses==1.11.0-3 +augeas-tools==1.11.0-3 +autoconf==2.69-11 +autoconf-archive==20180313-1 +autogen==1:5.18.12-4 +autogen-doc==1:5.18.12-4 +automake==1:1.16.1-4 +automake1.11==1:1.11.6-5 +autopoint==0.19.8.1-9 +autotools-dev==20180224.1 +bash-completion==1:2.8-6 +bc==1.07.1-2+b1 +bind9-host==1:9.11.5.P4+dfsg-5.1+deb10u8 +binfmt-support==2.2.0-2 +binutils==2.31.1-16 +binutils-common==2.31.1-16 +binutils-x86-64-linux-gnu==2.31.1-16 +bison==2:3.3.2.dfsg-1 +blt==2.5.3+dfsg-4 +bsd-mailx==8.1.2-0.20180807cvs-1 +bsdmainutils==11.1.2+b1 +build-essential==12.6 +byacc==20140715-1+b1 +bzip2==1.0.6-9.2~deb10u2 +bzip2-doc==1.0.6-9.2~deb10u2 +ca-certificates==20200601~deb10u2 +ca-certificates-java==20190405 +cdbs==0.4.159 +cgroupfs-mount==1.4 +check==0.10.0-3+b3 +chrpath==0.16-2+b1 +clang==1:7.0-47 +clang-7==1:7.0.1-8+deb10u2 +cm-super-minimal==0.3.4-14 +cmake==3.13.4-1 +cmake-data==3.13.4-1 +cmocka-doc==1.1.3-1 +comerr-dev==2.1-1.44.5-1+deb10u3 +containerd.io==1.6.21-1 +cowbuilder==0.88 +cowdancer==0.88 +cpio==2.12+dfsg-9 +cpp==4:8.3.0-1 +cpp-8==8.3.0-6 +cppcheck==1.86-1 +cron==3.0pl1-134+deb10u1 +curl==7.64.0-4+deb10u6 +dbus==1.12.24-0+deb10u1 +dbus-user-session==1.12.24-0+deb10u1 +dconf-gsettings-backend==0.30.1-2 +dconf-service==0.30.1-2 +dctrl-tools==2.24-3 +debhelper==12.1.1 +debian-keyring==2019.02.25 +debootstrap==1.0.114+deb10u1 +default-jdk-headless==2:1.11-71 +default-jre==2:1.11-71 +default-jre-headless==2:1.11-71 +default-libmysqlclient-dev==1.0.5 +device-tree-compiler==1.4.7-4 +devscripts==2.19.5+deb10u1 +dh-apparmor==2.13.2-10 +dh-autoreconf==19 +dh-exec==0.23.1 +dh-make==2.201802 +dh-python==3.20190308 +dh-strip-nondeterminism==1.1.2-1 +dh-systemd==12.1.1 +dictionaries-common==1.28.1 +diffstat==1.62-1 +dirmngr==2.2.12-1+deb10u2 +distro-info-data==0.41+deb10u7 +dkms==2.6.1-4 +dmeventd==2:1.02.155-3 +dmsetup==2:1.02.155-3 +dnsutils==1:9.11.5.P4+dfsg-5.1+deb10u8 +docker-ce==5:18.09.5~3-0~debian-buster +docker-ce-cli==5:18.09.5~3-0~debian-buster +docutils-common==0.14+dfsg-4 +docutils-doc==0.14+dfsg-4 +dosfstools==4.1-2 +doxygen==1.8.13-10 +dpatch==2.0.38+nmu1 +dpkg-dev==1.19.8 +dput==1.0.3 +dvipng==1.15-1.1 +dwz==0.12-3 +eatmydata==105-7 +emacsen-common==3.0.4 +equivs==2.2.0 +exim4-base==4.92-8+deb10u7 +exim4-config==4.92-8+deb10u7 +exim4-daemon-light==4.92-8+deb10u7 +expat==2.2.6-2+deb10u6 +exuberant-ctags==1:5.9~svn20110310-12+deb10u1 +fakeroot==1.23-1 +file==1:5.35-4+deb10u2 +flex==2.6.4-6.2 +fontconfig==2.13.1-2 +fontconfig-config==2.13.1-2 +fonts-dejavu-core==2.37-1 +fonts-dejavu-extra==2.37-1 +fonts-droid-fallback==1:6.0.1r16-1.1 +fonts-font-awesome==5.0.10+really4.7.0~dfsg-1 +fonts-glyphicons-halflings==1.009~3.4.1+dfsg-1 +fonts-lato==2.0-2 +fonts-liberation==1:1.07.4-9 +fonts-lmodern==2.004.5-6 +fonts-noto-mono==20181227-1 +fonts-roboto-slab==1.100263+20170512-1 +fonts-texgyre==20180621-3 +g++==4:8.3.0-1 +g++-8==8.3.0-6 +gawk==1:4.2.1+dfsg-1 +gcc==4:8.3.0-1 +gcc-8==8.3.0-6 +gcc-8-multilib==8.3.0-6 +gcc-multilib==4:8.3.0-1 +gcovr==4.1-2 +gdb==8.2.1-2+b3 +gem2deb==0.43 +gem2deb-test-runner==0.43 +geoip-database==20181108-1 +gettext==0.19.8.1-9 +gettext-base==0.19.8.1-9 +gfortran==4:8.3.0-1 +gfortran-8==8.3.0-6 +ghostscript==9.27~dfsg-2+deb10u7 +gir1.2-atk-1.0==2.30.0-2 +gir1.2-atspi-2.0==2.30.0-7 +gir1.2-freedesktop==1.58.3-2 +gir1.2-gdkpixbuf-2.0==2.38.1+dfsg-1 +gir1.2-glib-2.0==1.58.3-2 +gir1.2-gtk-3.0==3.24.5-1 +gir1.2-harfbuzz-0.0==2.3.1-1 +gir1.2-packagekitglib-1.0==1.1.12-5 +gir1.2-pango-1.0==1.42.4-8~deb10u1 +git==1:2.20.1-2+deb10u8 +git-buildpackage==0.9.14 +git-man==1:2.20.1-2+deb10u8 +glib-networking==2.58.0-2+deb10u2 +glib-networking-common==2.58.0-2+deb10u2 +glib-networking-services==2.58.0-2+deb10u2 +gnupg==2.2.12-1+deb10u2 +gnupg-l10n==2.2.12-1+deb10u2 +gnupg-utils==2.2.12-1+deb10u2 +gnupg2==2.2.12-1+deb10u2 +googletest==1.8.1-3 +gpg==2.2.12-1+deb10u2 +gpg-agent==2.2.12-1+deb10u2 +gpg-wks-client==2.2.12-1+deb10u2 +gpg-wks-server==2.2.12-1+deb10u2 +gpgconf==2.2.12-1+deb10u2 +gpgsm==2.2.12-1+deb10u2 +graphviz==2.40.1-6+deb10u1 +groff==1.22.4-3+deb10u1 +groff-base==1.22.4-3+deb10u1 +gsettings-desktop-schemas==3.28.1-1 +gsfonts==1:8.11+urwcyr1.0.7~pre44-4.4 +gstreamer1.0-libav==1.15.0.1+git20180723+db823502-2+deb10u1 +gstreamer1.0-plugins-base==1.14.4-2+deb10u1 +gstreamer1.0-plugins-good==1.14.4-1+deb10u2 +gstreamer1.0-plugins-ugly==1.14.4-1+deb10u1 +gstreamer1.0-x==1.14.4-2+deb10u1 +gtk-update-icon-cache==3.24.5-1 +guile-2.0-libs==2.0.13+1-5.1 +hicolor-icon-theme==0.17-2 +i965-va-driver==2.3.0+dfsg1-1 +ibverbs-providers==22.1-1 +icc-profiles-free==2.0.1+dfsg-1 +icu-devtools==63.1-6+deb10u3 +imagemagick==8:6.9.10.23+dfsg-2.1+deb10u4 +imagemagick-6-common==8:6.9.10.23+dfsg-2.1+deb10u4 +imagemagick-6.q16==8:6.9.10.23+dfsg-2.1+deb10u4 +install-info==6.5.0.dfsg.1-4+b1 +intel-media-va-driver==18.4.1+dfsg1-1 +intltool-debian==0.35.0+20060710.5 +iptables==1.8.2-4 +iptables-dev==1.8.2-4 +ipxe-qemu==1.0.0+git-20190125.36a4c85-1 +iso-codes==4.2-1 +java-common==0.71 +java-wrappers==0.3 +javahelper==0.72.9 +javascript-common==11 +kernel-wedge==2.99 +kmod==26-1 +krb5-locales==1.17-3+deb10u5 +krb5-multidev==1.17-3+deb10u5 +lcov==1.13-4 +less==487-0.1+b1 +lib32asan5==8.3.0-6 +lib32atomic1==8.3.0-6 +lib32gcc-8-dev==8.3.0-6 +lib32gcc1==1:8.3.0-6 +lib32gomp1==8.3.0-6 +lib32itm1==8.3.0-6 +lib32mpx2==8.3.0-6 +lib32quadmath0==8.3.0-6 +lib32stdc++6==8.3.0-6 +lib32ubsan1==8.3.0-6 +liba52-0.7.4==0.7.4-19 +libaa1==1.4p5-46 +libaacs0==0.9.0-2 +libaio1==0.3.112-3 +libalgorithm-c3-perl==0.10-1 +libalgorithm-diff-perl==1.19.03-2 +libalgorithm-diff-xs-perl==0.04-5+b1 +libalgorithm-merge-perl==0.08-3 +libaom0==1.0.0-3 +libaopalliance-java==20070526-6 +libapache-pom-java==18-1 +libapparmor1==2.13.2-10 +libappconfig-perl==1.71-2 +libappstream4==0.12.5-1 +libapt-inst2.0==1.8.2.3 +libapt-pkg-perl==0.1.34+b1 +libarchive-cpio-perl==0.10-1 +libarchive-zip-perl==1.64-1 +libarchive13==3.3.3-4+deb10u3 +libargon2-1==0~20171227-0.2 +libasan5==8.3.0-6 +libasm-java==7.0-1 +libasound2==1.1.8-1 +libasound2-data==1.1.8-1 +libaspell15==0.60.7~20110707-6+deb10u1 +libass9==1:0.14.0-2 +libassuan0==2.5.2-1 +libasync-mergepoint-perl==0.04-2 +libasyncns0==0.8-6 +libatinject-jsr330-api-java==1.0+ds1-5 +libatk-bridge2.0-0==2.30.0-5 +libatk-bridge2.0-dev==2.30.0-5 +libatk-wrapper-java==0.33.3-22+deb10u1 +libatk-wrapper-java-jni==0.33.3-22+deb10u1 +libatk1.0-0==2.30.0-2 +libatk1.0-data==2.30.0-2 +libatk1.0-dev==2.30.0-2 +libatm1==1:2.5.1-2 +libatm1-dev==1:2.5.1-2 +libatomic1==8.3.0-6 +libatspi2.0-0==2.30.0-7 +libatspi2.0-dev==2.30.0-7 +libaudio2==1.9.4-6 +libaudit-dev==1:2.8.4-3 +libaugeas0==1.11.0-3 +libauthen-sasl-perl==2.1600-1 +libavahi-client3==0.7-4+deb10u2 +libavahi-common-data==0.7-4+deb10u2 +libavahi-common3==0.7-4+deb10u2 +libavalon-framework-java==4.2.0-10 +libavc1394-0==0.5.4-5 +libavcodec58==7:4.1.10-0+deb10u1 +libavfilter7==7:4.1.10-0+deb10u1 +libavformat58==7:4.1.10-0+deb10u1 +libavutil56==7:4.1.10-0+deb10u1 +libb-hooks-endofscope-perl==0.24-1 +libb-hooks-op-check-perl==0.22-1+b1 +libbabeltrace-dev==1.5.6-2+deb10u1 +libbabeltrace1==1.5.6-2+deb10u1 +libbatik-java==1.10-2+deb10u2 +libbdplus0==0.1.2-3 +libbind-export-dev==1:9.11.5.P4+dfsg-5.1+deb10u8 +libbind9-161==1:9.11.5.P4+dfsg-5.1+deb10u8 +libbinutils==2.31.1-16 +libbison-dev==2:3.3.2.dfsg-1 +libbit-vector-perl==7.4-1+b5 +libblkid-dev==2.33.1-0.1 +libbluetooth3==5.50-1.2~deb10u3 +libbluray2==1:1.1.0-1+deb10u1 +libboost-atomic1.71-dev==1.71.0-6~bpo10+1 +libboost-atomic1.71.0==1.71.0-6~bpo10+1 +libboost-chrono1.71-dev==1.71.0-6~bpo10+1 +libboost-chrono1.71.0==1.71.0-6~bpo10+1 +libboost-container1.71-dev==1.71.0-6~bpo10+1 +libboost-container1.71.0==1.71.0-6~bpo10+1 +libboost-context1.71-dev==1.71.0-6~bpo10+1 +libboost-context1.71.0==1.71.0-6~bpo10+1 +libboost-contract1.71-dev==1.71.0-6~bpo10+1 +libboost-contract1.71.0==1.71.0-6~bpo10+1 +libboost-coroutine1.71-dev==1.71.0-6~bpo10+1 +libboost-coroutine1.71.0==1.71.0-6~bpo10+1 +libboost-date-time1.71-dev==1.71.0-6~bpo10+1 +libboost-date-time1.71.0==1.71.0-6~bpo10+1 +libboost-fiber1.71-dev==1.71.0-6~bpo10+1 +libboost-fiber1.71.0==1.71.0-6~bpo10+1 +libboost-filesystem1.71-dev==1.71.0-6~bpo10+1 +libboost-filesystem1.71.0==1.71.0-6~bpo10+1 +libboost-graph-parallel1.71-dev==1.71.0-6~bpo10+1 +libboost-graph-parallel1.71.0==1.71.0-6~bpo10+1 +libboost-log1.71-dev==1.71.0-6~bpo10+1 +libboost-log1.71.0==1.71.0-6~bpo10+1 +libboost-mpi1.71.0==1.71.0-6~bpo10+1 +libboost-program-options1.71-dev==1.71.0-6~bpo10+1 +libboost-program-options1.71.0==1.71.0-6~bpo10+1 +libboost-regex1.71-dev==1.71.0-6~bpo10+1 +libboost-regex1.71.0==1.71.0-6~bpo10+1 +libboost-serialization1.71-dev==1.71.0-6~bpo10+1 +libboost-serialization1.71.0==1.71.0-6~bpo10+1 +libboost-system1.71-dev==1.71.0-6~bpo10+1 +libboost-system1.71.0==1.71.0-6~bpo10+1 +libboost-test1.71-dev==1.71.0-6~bpo10+1 +libboost-test1.71.0==1.71.0-6~bpo10+1 +libboost-thread1.71-dev==1.71.0-6~bpo10+1 +libboost-thread1.71.0==1.71.0-6~bpo10+1 +libboost1.71-dev==1.71.0-6~bpo10+1 +libbrlapi0.6==5.6-10+deb10u1 +libbrotli1==1.0.7-2+deb10u1 +libbs2b0==3.1.0+dfsg-2.2 +libbsd-dev==0.9.1-2+deb10u1 +libbsd0==0.9.1-2+deb10u1 +libbsh-java==2.0b4-19 +libbz2-dev==1.0.6-9.2~deb10u2 +libc-ares-dev==1.14.0-1+deb10u2 +libc-ares2==1.14.0-1+deb10u2 +libc-dev-bin==2.28-10+deb10u2 +libc6-dbg==2.28-10+deb10u2 +libc6-dev==2.28-10+deb10u2 +libc6-dev-i386==2.28-10+deb10u2 +libc6-dev-x32==2.28-10+deb10u2 +libc6-i386==2.28-10+deb10u2 +libc6-x32==2.28-10+deb10u2 +libcaca0==0.99.beta19-2.1 +libcacard0==1:2.6.1-1 +libcaf-openmpi-3==2.4.0-2 +libcairo-gobject2==1.16.0-4+deb10u1 +libcairo-script-interpreter2==1.16.0-4+deb10u1 +libcairo2==1.16.0-4+deb10u1 +libcairo2-dev==1.16.0-4+deb10u1 +libcap-dev==1:2.25-2 +libcap-ng-dev==0.7.9-2 +libcapstone3==4.0.1+really+3.0.5-1 +libcapture-tiny-perl==0.48-1 +libcarp-clan-perl==6.07-1 +libcc1-0==8.3.0-6 +libcdi-api-java==1.2-2 +libcdio18==2.0.0-2 +libcdparanoia0==3.10.2+debian-13 +libcdt5==2.40.1-6+deb10u1 +libcgi-fast-perl==1:2.13-1 +libcgi-pm-perl==4.40-1 +libcglib-java==3.2.10-1 +libcgraph6==2.40.1-6+deb10u1 +libchromaprint1==1.4.3-3 +libclang-common-7-dev==1:7.0.1-8+deb10u2 +libclang1-6.0==1:6.0.1-10 +libclang1-7==1:7.0.1-8+deb10u2 +libclass-accessor-perl==0.51-1 +libclass-c3-perl==0.34-1 +libclass-c3-xs-perl==0.14-1+b3 +libclass-inspector-perl==1.32-1 +libclass-load-perl==0.25-1 +libclass-load-xs-perl==0.10-1+b3 +libclass-method-modifiers-perl==2.12-1 +libclass-tiny-perl==1.006-1 +libclass-xsaccessor-perl==1.19-3+b2 +libclone-perl==0.41-1+b1 +libcmocka-dev==1.1.3-1 +libcmocka0==1.1.3-1 +libcoarrays-dev==2.4.0-2 +libcoarrays-openmpi-dev==2.4.0-2 +libcodec2-0.8.1==0.8.1-2 +libcolord2==1.4.3-4 +libcommon-sense-perl==3.74-2+b7 +libcommons-beanutils-java==1.9.3-1 +libcommons-cli-java==1.4-1 +libcommons-codec-java==1.11-1 +libcommons-collections3-java==3.2.2-2 +libcommons-compress-java==1.18-2+deb10u1 +libcommons-configuration-java==1.10-5 +libcommons-digester-java==1.8.1-5 +libcommons-io-java==2.6-2+deb10u1 +libcommons-lang-java==2.6-8 +libcommons-lang3-java==3.8-2 +libcommons-logging-java==1.2-2 +libcommons-parent-java==43-1 +libcommons-validator-java==1:1.6-2 +libconst-fast-perl==0.014-1 +libcontextual-return-perl==0.004014-2 +libconvert-binhex-perl==1.125-1 +libcroco3==0.6.12-3 +libcryptsetup12==2:2.1.0-5+deb10u2 +libcrystalhd3==1:0.0~git20110715.fdd2f19-13 +libcups2==2.2.10-6+deb10u6 +libcupsfilters1==1.21.6-5 +libcupsimage2==2.2.10-6+deb10u6 +libcurl3-gnutls==7.64.0-4+deb10u6 +libcurl4==7.64.0-4+deb10u6 +libcurl4-openssl-dev==7.64.0-4+deb10u6 +libdaemon-dev==0.14-7 +libdaemon0==0.14-7 +libdata-dump-perl==1.23-1 +libdata-optlist-perl==0.110-1 +libdatrie1==0.2.12-2 +libdb-dev==5.3.1+nmu1 +libdb5.3-dev==5.3.28+dfsg1-0.5 +libdbi1==0.9.0-5 +libdbus-1-3==1.12.24-0+deb10u1 +libdbus-1-dev==1.12.24-0+deb10u1 +libdconf1==0.30.1-2 +libde265-0==1.0.11-0+deb10u4 +libdevel-callchecker-perl==0.008-1 +libdevel-caller-perl==2.06-2+b1 +libdevel-globaldestruction-perl==0.14-1 +libdevel-lexalias-perl==0.05-2+b1 +libdevel-overloadinfo-perl==0.005-1 +libdevel-partialdump-perl==0.20-1 +libdevel-stacktrace-perl==2.0300-1 +libdevmapper-event1.02.1==2:1.02.155-3 +libdevmapper1.02.1==2:1.02.155-3 +libdigest-bubblebabble-perl==0.02-2 +libdigest-hmac-perl==1.03+dfsg-2 +libdist-checkconflicts-perl==0.11-1 +libdistro-info-perl==0.21 +libdjvulibre-text==3.5.27.1-10+deb10u1 +libdjvulibre21==3.5.27.1-10+deb10u1 +libdns-export1104==1:9.11.5.P4+dfsg-5.1+deb10u8 +libdns1104==1:9.11.5.P4+dfsg-5.1+deb10u8 +libdom4j-java==2.1.1-2 +libdouble-conversion1==3.1.0-3 +libdoxia-core-java==1.7-2 +libdoxia-java==1.7-2 +libdoxia-sitetools-java==1.7.5-1 +libdpkg-perl==1.19.8 +libdrm-amdgpu1==2.4.97-1 +libdrm-common==2.4.97-1 +libdrm-dev==2.4.97-1 +libdrm-intel1==2.4.97-1 +libdrm-nouveau2==2.4.97-1 +libdrm-radeon1==2.4.97-1 +libdrm2==2.4.97-1 +libdv4==1.0.0-12 +libdvdnav4==6.0.0-1 +libdvdread4==6.0.1-1 +libdw-dev==0.176-1.1 +libdw1==0.176-1.1 +libdynaloader-functions-perl==0.003-1 +libeatmydata1==105-7 +libedit-dev==3.1-20181209-1 +libedit2==3.1-20181209-1 +libegl-mesa0==18.3.6-2+deb10u1 +libegl1==1.1.0-1 +libegl1-mesa-dev==18.3.6-2+deb10u1 +libel-api-java==3.0.0-2+deb10u1 +libelf-dev==0.176-1.1 +libemail-valid-perl==1.202-1 +libencode-locale-perl==1.05-1 +libepoxy-dev==1.5.3-0.1 +libepoxy0==1.5.3-0.1 +liberror-perl==0.17027-2 +libestr0==0.1.10-2.1 +libeval-closure-perl==0.14-1 +libevdev2==1.6.0+dfsg-1 +libevent-2.1-6==2.1.8-stable-4 +libevent-core-2.1-6==2.1.8-stable-4 +libevent-dev==2.1.8-stable-4 +libevent-extra-2.1-6==2.1.8-stable-4 +libevent-openssl-2.1-6==2.1.8-stable-4 +libevent-pthreads-2.1-6==2.1.8-stable-4 +libexpat1==2.2.6-2+deb10u6 +libexpat1-dev==2.2.6-2+deb10u6 +libexplain-dev==1.4.D001-8 +libexplain51==1.4.D001-8 +libexporter-tiny-perl==1.002001-1 +libfabric1==1.6.2-3 +libfakeroot==1.23-1 +libfastjson4==0.99.8-2 +libfcgi-perl==0.78-2+b3 +libfdt1==1.4.7-4 +libffi-dev==3.2.1-9 +libfftw3-double3==3.3.8-2 +libfile-basedir-perl==0.08-1 +libfile-chdir-perl==0.1008-1 +libfile-desktopentry-perl==0.22-1 +libfile-fcntllock-perl==0.22-3+b5 +libfile-homedir-perl==1.004-1 +libfile-listing-perl==6.04-1 +libfile-mimeinfo-perl==0.29-1 +libfile-stripnondeterminism-perl==1.1.2-1 +libfile-which-perl==1.23-1 +libfl-dev==2.6.4-6.2 +libfl2==2.6.4-6.2 +libflac8==1.3.2-3+deb10u2 +libflite1==2.1-release-3 +libfont-afm-perl==1.20-2 +libfontbox2-java==2.0.13-2 +libfontconfig1==2.13.1-2 +libfontconfig1-dev==2.13.1-2 +libfontenc1==1:1.1.3-1+b2 +libfop-java==1:2.3-2 +libfreetype6==2.9.1-3+deb10u3 +libfreetype6-dev==2.9.1-3+deb10u3 +libfribidi-dev==1.0.5-3.1+deb10u2 +libfribidi0==1.0.5-3.1+deb10u2 +libfstrm0==0.4.0-1 +libfuture-perl==0.39-1 +libgail-common==2.24.32-3 +libgail18==2.24.32-3 +libgbm1==18.3.6-2+deb10u1 +libgc1c2==1:7.6.4-0.4 +libgcc-8-dev==8.3.0-6 +libgd-perl==2.71-2 +libgd3==2.2.5-5.2 +libgdbm-compat4==1.18.1-4 +libgdbm6==1.18.1-4 +libgdk-pixbuf2.0-0==2.38.1+dfsg-1 +libgdk-pixbuf2.0-bin==2.38.1+dfsg-1 +libgdk-pixbuf2.0-common==2.38.1+dfsg-1 +libgdk-pixbuf2.0-dev==2.38.1+dfsg-1 +libgeoip1==1.6.12-1 +libgeronimo-annotation-1.3-spec-java==1.0-1 +libgeronimo-interceptor-3.0-spec-java==1.0.1-4 +libgetopt-long-descriptive-perl==0.103-2 +libgfortran-8-dev==8.3.0-6 +libgfortran5==8.3.0-6 +libgif7==5.1.4-3+deb10u1 +libgirepository-1.0-1==1.58.3-2 +libgit-wrapper-perl==0.048-1 +libgitlab-api-v4-perl==0.16-1 +libgl1==1.1.0-1 +libgl1-mesa-dev==18.3.6-2+deb10u1 +libgl1-mesa-dri==18.3.6-2+deb10u1 +libglapi-mesa==18.3.6-2+deb10u1 +libgles1==1.1.0-1 +libgles2==1.1.0-1 +libglib2.0-0==2.58.3-2+deb10u4 +libglib2.0-bin==2.58.3-2+deb10u4 +libglib2.0-data==2.58.3-2+deb10u4 +libglib2.0-dev==2.58.3-2+deb10u4 +libglib2.0-dev-bin==2.58.3-2+deb10u4 +libglu1-mesa==9.0.0-2.1+b3 +libglu1-mesa-dev==9.0.0-2.1+b3 +libglvnd-core-dev==1.1.0-1 +libglvnd-dev==1.1.0-1 +libglvnd0==1.1.0-1 +libglx-mesa0==18.3.6-2+deb10u1 +libglx0==1.1.0-1 +libgme0==0.6.2-1 +libgmock-dev==1.8.1-3 +libgmp-dev==2:6.1.2+dfsg-4+deb10u1 +libgmpxx4ldbl==2:6.1.2+dfsg-4+deb10u1 +libgnutls-dane0==3.6.7-4+deb10u10 +libgnutls-openssl27==3.6.7-4+deb10u10 +libgnutls28-dev==3.6.7-4+deb10u10 +libgnutlsxx28==3.6.7-4+deb10u10 +libgomp1==8.3.0-6 +libgoogle-perftools4==2.7-1 +libgpgme11==1.12.0-6 +libgpm2==1.20.7-5 +libgraphite2-3==1.3.13-7 +libgraphite2-dev==1.3.13-7 +libgs9==9.27~dfsg-2+deb10u7 +libgs9-common==9.27~dfsg-2+deb10u7 +libgsm1==1.0.18-2 +libgssapi-krb5-2==1.17-3+deb10u5 +libgssrpc4==1.17-3+deb10u5 +libgstreamer-plugins-base1.0-0==1.14.4-2+deb10u1 +libgstreamer1.0-0==1.14.4-1 +libgtest-dev==1.8.1-3 +libgtk-3-0==3.24.5-1 +libgtk-3-bin==3.24.5-1 +libgtk-3-common==3.24.5-1 +libgtk-3-dev==3.24.5-1 +libgtk2.0-0==2.24.32-3 +libgtk2.0-bin==2.24.32-3 +libgtk2.0-common==2.24.32-3 +libgts-0.7-5==0.7.6+darcs121130-4 +libgts-bin==0.7.6+darcs121130-4 +libguava-java==19.0-1 +libgudev-1.0-0==232-2 +libguice-java==4.2.1-1 +libgvc6==2.40.1-6+deb10u1 +libgvpr2==2.40.1-6+deb10u1 +libharfbuzz-dev==2.3.1-1 +libharfbuzz-gobject0==2.3.1-1 +libharfbuzz-icu0==2.3.1-1 +libharfbuzz0b==2.3.1-1 +libhawtjni-runtime-java==1.16-1 +libheif1==1.3.2-2~deb10u1 +libhtml-form-perl==6.03-1 +libhtml-format-perl==2.12-1 +libhtml-parser-perl==3.72-3+b3 +libhtml-tagset-perl==3.20-3 +libhtml-tree-perl==5.07-2 +libhttp-cookies-perl==6.04-1 +libhttp-daemon-perl==6.01-3+deb10u1 +libhttp-date-perl==6.02-1 +libhttp-message-perl==6.18-1 +libhttp-negotiate-perl==6.01-1 +libhttp-tiny-multipart-perl==0.08-1 +libhttpclient-java==4.5.7-1+deb10u1 +libhttpcore-java==4.4.11-1 +libhwloc-dev==1.11.12-3 +libhwloc-plugins==1.11.12-3 +libhwloc5==1.11.12-3 +libiberty-dev==20190122-1 +libibverbs-dev==22.1-1 +libibverbs1==22.1-1 +libice-dev==2:1.0.9-2 +libice6==2:1.0.9-2 +libicu-dev==63.1-6+deb10u3 +libicu63==63.1-6+deb10u3 +libidn11==1.33-2.2 +libidn2-dev==2.0.5-1+deb10u1 +libiec61883-0==1.2.0-3 +libigdgmm5==18.4.1+ds1-1 +libijs-0.35==0.35-14 +libilmbase23==2.2.1-2 +libimagequant0==2.12.2-1.1 +libimport-into-perl==1.002005-1 +libinput-bin==1.12.6-2+deb10u1 +libinput10==1.12.6-2+deb10u1 +libio-async-perl==0.72-1 +libio-html-perl==1.001-1 +libio-prompter-perl==0.004015-1 +libio-pty-perl==1:1.08-1.1+b5 +libio-sessiondata-perl==1.03-1 +libio-socket-ssl-perl==2.060-3 +libio-string-perl==1.08-3 +libio-stringy-perl==2.111-3 +libip4tc-dev==1.8.2-4 +libip4tc0==1.8.2-4 +libip6tc-dev==1.8.2-4 +libip6tc0==1.8.2-4 +libipc-run-perl==20180523.0-1 +libipc-system-simple-perl==1.25-4 +libipt2==2.0-2 +libiptc-dev==1.8.2-4 +libiptc0==1.8.2-4 +libirs-export161==1:9.11.5.P4+dfsg-5.1+deb10u8 +libirs161==1:9.11.5.P4+dfsg-5.1+deb10u8 +libisc-export1100==1:9.11.5.P4+dfsg-5.1+deb10u8 +libisc1100==1:9.11.5.P4+dfsg-5.1+deb10u8 +libisccc-export161==1:9.11.5.P4+dfsg-5.1+deb10u8 +libisccc161==1:9.11.5.P4+dfsg-5.1+deb10u8 +libisccfg-export163==1:9.11.5.P4+dfsg-5.1+deb10u8 +libisccfg163==1:9.11.5.P4+dfsg-5.1+deb10u8 +libisl19==0.20-2 +libitext1-java==1.4-7 +libitm1==8.3.0-6 +libjack-jackd2-0==1.9.12~dfsg-2 +libjansi-java==1.17.1-1 +libjansi-native-java==1.8-1 +libjansson-dev==2.12-1 +libjansson4==2.12-1 +libjaxen-java==1.1.6-4 +libjaxp1.3-java==1.3.05-5 +libjbig0==2.1-3.1+b2 +libjbig2dec0==0.16-1+deb10u1 +libjemalloc-dev==5.1.0-3 +libjemalloc2==5.1.0-3 +libjetty9-java==9.4.16-0+deb10u2 +libjpeg62-turbo==1:1.5.2-2+deb10u1 +libjs-bootstrap==3.4.1+dfsg-1 +libjs-jquery==3.3.1~dfsg-3+deb10u1 +libjs-jquery-hotkeys==0~20130707+git2d51e3a9+dfsg-2 +libjs-jquery-isonscreen==1.2.0-1 +libjs-jquery-metadata==12-1.1 +libjs-jquery-tablesorter==1:2.31.1+dfsg1-1 +libjs-jquery-throttle-debounce==1.1+dfsg.1-1 +libjs-modernizr==2.6.2+ds1-3 +libjs-sphinxdoc==1.8.4-1 +libjs-underscore==1.9.1~dfsg-1+deb10u1 +libjson-c-dev==0.12.1+ds-2+deb10u1 +libjson-c3==0.12.1+ds-2+deb10u1 +libjson-glib-1.0-0==1.4.4-2 +libjson-glib-1.0-common==1.4.4-2 +libjson-perl==4.02000-1 +libjson-xs-perl==3.040-1+b1 +libjsoncpp1==1.7.4-3 +libjsp-api-java==2.3.4-2+deb10u1 +libjsr305-java==0.1~+svn49-11 +libjtidy-java==7+svn20110807-5 +libjudy-dev==1.0.5-5 +libjudydebian1==1.0.5-5 +libjxr-tools==1.1-6+b1 +libjxr0==1.1-6+b1 +libk5crypto3==1.17-3+deb10u5 +libkadm5clnt-mit11==1.17-3+deb10u5 +libkadm5srv-mit11==1.17-3+deb10u5 +libkdb5-9==1.17-3+deb10u5 +libkeyutils1==1.6-6 +libkmod2==26-1 +libkpathsea6==2018.20181218.49446-1 +libkrb5-3==1.17-3+deb10u5 +libkrb5-dev==1.17-3+deb10u5 +libkrb5support0==1.17-3+deb10u5 +libksba8==1.3.5-2+deb10u2 +liblab-gamut1==2.40.1-6+deb10u1 +liblcms2-2==2.9-3 +libldap-2.4-2==2.4.47+dfsg-3+deb10u7 +libldap-common==2.4.47+dfsg-3+deb10u7 +libldap2-dev==2.4.47+dfsg-3+deb10u7 +liblilv-0-0==0.24.2~dfsg0-2 +liblist-compare-perl==0.53-1 +liblist-moreutils-perl==0.416-1+b4 +libllvm6.0==1:6.0.1-10 +libllvm7==1:7.0.1-8+deb10u2 +liblmdb0==0.9.22-1 +liblocale-gettext-perl==1.07-3+b4 +liblockfile-bin==1.14-1.1 +liblockfile1==1.14-1.1 +liblog-any-adapter-screen-perl==0.140-1 +liblog-any-perl==1.707-1 +liblog4j1.2-java==1.2.17-8+deb10u2 +liblognorm5==2.0.5-1 +liblqr-1-0==0.4.2-2.1 +liblsan0==8.3.0-6 +libltdl-dev==2.4.6-9 +libltdl7==2.4.6-9 +liblua5.1-0==5.1.5-8.1+b2 +liblua5.1-0-dev==5.1.5-8.1+b2 +liblvm2cmd2.03==2.03.02-3 +liblwp-mediatypes-perl==6.02-1 +liblwp-protocol-https-perl==6.07-2 +liblwres161==1:9.11.5.P4+dfsg-5.1+deb10u8 +liblzma-dev==5.2.4-1+deb10u1 +liblzo2-2==2.10-0.1 +liblzo2-dev==2.10-0.1 +libmagic-mgc==1:5.35-4+deb10u2 +libmagic1==1:5.35-4+deb10u2 +libmagickcore-6.q16-6==8:6.9.10.23+dfsg-2.1+deb10u4 +libmagickcore-6.q16-6-extra==8:6.9.10.23+dfsg-2.1+deb10u4 +libmagickwand-6.q16-6==8:6.9.10.23+dfsg-2.1+deb10u4 +libmail-sendmail-perl==0.80-1 +libmailtools-perl==2.18-1 +libmariadb-dev==1:10.3.38-0+deb10u1 +libmariadb-dev-compat==1:10.3.38-0+deb10u1 +libmariadb3==1:10.3.38-0+deb10u1 +libmaven-archiver-java==3.2.0-2 +libmaven-clean-plugin-java==3.1.0-1 +libmaven-common-artifact-filters-java==3.0.1-3 +libmaven-compiler-plugin-java==3.8.0-2 +libmaven-filtering-java==3.1.1-1 +libmaven-jar-plugin-java==3.1.1-1 +libmaven-parent-java==31-2 +libmaven-plugin-tools-java==3.6.0-1 +libmaven-reporting-api-java==3.0-1 +libmaven-reporting-exec-java==1.4-2 +libmaven-reporting-impl-java==3.0.0-2 +libmaven-resolver-java==1.3.1-1 +libmaven-resources-plugin-java==3.1.0-1 +libmaven-shared-incremental-java==1.1-3 +libmaven-shared-utils-java==3.3.0-1+deb10u1 +libmaven-site-plugin-java==3.6-3 +libmaven3-core-java==3.6.0-1 +libmime-tools-perl==5.509-1 +libmng1==1.0.10+dfsg-3.1+b5 +libmnl-dev==1.0.4-2 +libmodule-implementation-perl==0.09-1 +libmodule-runtime-conflicts-perl==0.003-1 +libmodule-runtime-perl==0.016-1 +libmoo-perl==2.003004-2 +libmoose-perl==2.2011-1+b1 +libmoosex-aliases-perl==0.11-1 +libmount-dev==2.33.1-0.1 +libmp3lame0==3.100-2+b1 +libmpc3==1.1.0-1 +libmpdec2==2.4.2-2 +libmpeg2-4==0.5.1-8 +libmpfr6==4.0.2-1 +libmpg123-0==1.25.10-2 +libmpx2==8.3.0-6 +libmro-compat-perl==0.13-1 +libmtdev1==1.1.5-1+b1 +libmysofa0==0.6~dfsg0-3+deb10u1 +libnamespace-autoclean-perl==0.28-1 +libnamespace-clean-perl==0.27-1 +libnanomsg-dev==1.1.5+dfsg-1 +libnanomsg5==1.1.5+dfsg-1 +libncurses-dev==6.1+20181013-2+deb10u3 +libncurses5-dev==6.1+20181013-2+deb10u3 +libncurses6==6.1+20181013-2+deb10u3 +libnet-dbus-perl==1.1.0-5+b1 +libnet-dns-perl==1.19-1 +libnet-dns-sec-perl==1.11-1 +libnet-domain-tld-perl==1.75-1 +libnet-http-perl==6.18-1 +libnet-ip-perl==1.26-2 +libnet-libidn-perl==0.12.ds-3+b1 +libnet-smtp-ssl-perl==1.04-1 +libnet-ssleay-perl==1.85-2+deb10u1 +libnetfilter-conntrack-dev==1.0.7-1 +libnetfilter-conntrack3==1.0.7-1 +libnetpbm10==2:10.0-15.3+b2 +libnewt-dev==0.52.20-8 +libnewt0.52==0.52.20-8 +libnfnetlink-dev==1.0.1-3+b1 +libnfnetlink0==1.0.1-3+b1 +libnftables0==0.9.0-2 +libnftnl-dev==1.1.2-2 +libnftnl11==1.1.2-2 +libnghttp2-14==1.36.0-2+deb10u1 +libnl-3-200==3.4.0-1 +libnl-3-dev==3.4.0-1 +libnl-route-3-200==3.4.0-1 +libnl-route-3-dev==3.4.0-1 +libnorm-dev==1.5.8+dfsg2-1 +libnorm1==1.5.8+dfsg2-1 +libnpth0==1.6-1 +libnspr4==2:4.20-1 +libnss-systemd==241-7~deb10u9 +libnss3==2:3.42.1-1+deb10u6 +libnuma-dev==2.0.12-1 +libnuma1==2.0.12-1 +libnumber-compare-perl==0.03-1 +libnumber-range-perl==0.12-1 +libobjc-8-dev==8.3.0-6 +libobjc4==8.3.0-6 +libogg0==1.3.2-1+b1 +libomp-7-dev==1:7.0.1-8+deb10u2 +libomp5-7==1:7.0.1-8+deb10u2 +libopencore-amrnb0==0.1.3-2.1+b2 +libopencore-amrwb0==0.1.3-2.1+b2 +libopencsd-dev==0.10.1-1 +libopencsd0==0.10.1-1 +libopenexr23==2.2.1-4.1+deb10u2 +libopengl0==1.1.0-1 +libopenjp2-7==2.3.0-2+deb10u2 +libopenmpi-dev==3.1.3-11 +libopenmpi3==3.1.3-11 +libopenmpt0==0.4.3-1+deb10u1 +libopts25==1:5.18.12-4 +libopts25-dev==1:5.18.12-4 +libopus0==1.3-1 +liborc-0.4-0==1:0.4.28-3.1 +liboro-java==2.0.8a-13 +libosp5==1.5.2-13+b1 +libossp-uuid-perl==1.6.2-1.5+b7 +libossp-uuid16==1.6.2-1.5+b7 +libp11-kit-dev==0.23.15-2+deb10u1 +libpackage-deprecationmanager-perl==0.17-1 +libpackage-stash-perl==0.38-1 +libpackage-stash-xs-perl==0.29-1 +libpackagekit-glib2-18==1.1.12-5 +libpadwalker-perl==2.3-1+b1 +libpam-systemd==241-7~deb10u9 +libpam0g-dev==1.3.1-5 +libpango-1.0-0==1.42.4-8~deb10u1 +libpango1.0-dev==1.42.4-8~deb10u1 +libpangocairo-1.0-0==1.42.4-8~deb10u1 +libpangoft2-1.0-0==1.42.4-8~deb10u1 +libpangoxft-1.0-0==1.42.4-8~deb10u1 +libpaper-utils==1.1.28 +libpaper1==1.1.28 +libparams-classify-perl==0.015-1+b1 +libparams-util-perl==1.07-3+b4 +libparams-validate-perl==1.29-1+b1 +libparboiled-java==1.1.7-2 +libparse-debianchangelog-perl==1.2.0-13 +libpath-iterator-rule-perl==1.014-1 +libpath-tiny-perl==0.108-1 +libpathplan4==2.40.1-6+deb10u1 +libpcap-dev==1.8.1-6+deb10u1 +libpcap0.8==1.8.1-6+deb10u1 +libpcap0.8-dev==1.8.1-6+deb10u1 +libpci-dev==1:3.5.2-1 +libpci3==1:3.5.2-1 +libpciaccess0==0.14-1 +libpcre16-3==2:8.39-12 +libpcre2-16-0==10.32-5+deb10u1 +libpcre2-8-0==10.32-5+deb10u1 +libpcre3-dev==2:8.39-12 +libpcre32-3==2:8.39-12 +libpcrecpp0v5==2:8.39-12 +libpcsclite1==1.8.24-1 +libpegdown-java==1.6.0-1 +libperl-dev==5.28.1-6+deb10u1 +libperl5.28==5.28.1-6+deb10u1 +libperlio-gzip-perl==0.19-1+b5 +libpgm-5.2-0==5.2.122~dfsg-3 +libpgm-dev==5.2.122~dfsg-3 +libpipeline1==1.5.1-2 +libpixman-1-0==0.36.0-1+deb10u1 +libpixman-1-dev==0.36.0-1+deb10u1 +libplexus-ant-factory-java==1.0~alpha2.1-4 +libplexus-archiver-java==3.6.0-2 +libplexus-bsh-factory-java==1.0~alpha7-4 +libplexus-build-api-java==0.0.7-3 +libplexus-cipher-java==1.7-3 +libplexus-classworlds-java==2.6.0-1 +libplexus-compiler-java==2.8.5-1 +libplexus-component-annotations-java==1.7.1-7 +libplexus-container-default-java==1.7.1-7 +libplexus-container-default1.5-java==1.7.1-7 +libplexus-i18n-java==1.0-beta-10-5 +libplexus-interpolation-java==1.25-1 +libplexus-io-java==3.1.1-1 +libplexus-languages-java==0.9.10-1 +libplexus-sec-dispatcher-java==1.4-4 +libplexus-utils2-java==3.1.1-1 +libplexus-velocity-java==1.2-3 +libpmix2==3.1.2-3 +libpng-dev==1.6.36-6 +libpng16-16==1.6.36-6 +libpod-constants-perl==0.19-1 +libpolkit-agent-1-0==0.105-25+deb10u1 +libpolkit-backend-1-0==0.105-25+deb10u1 +libpolkit-gobject-1-0==0.105-25+deb10u1 +libpopt0==1.16-12 +libpostproc55==7:4.1.10-0+deb10u1 +libpotrace0==1.15-1 +libprocps7==2:3.3.15-2 +libprotobuf-c1==1.3.1-1+b1 +libprotobuf-dev==3.6.1.3-2+deb10u1 +libprotobuf-lite17==3.6.1.3-2+deb10u1 +libprotobuf17==3.6.1.3-2+deb10u1 +libprotoc17==3.6.1.3-2+deb10u1 +libproxy1v5==0.4.15-5+deb10u1 +libpsl5==0.20.2-2 +libpsm-infinipath1==3.3+20.604758e7-6 +libpsm2-2==11.2.78-1 +libptexenc1==2018.20181218.49446-1 +libpthread-stubs0-dev==0.4-1 +libpulse0==12.2-4+deb10u1 +libpython-all-dev==2.7.16-1 +libpython-dev==2.7.16-1 +libpython-stdlib==2.7.16-1 +libpython2-dev==2.7.16-1 +libpython2-stdlib==2.7.16-1 +libpython2.7==2.7.16-2+deb10u1 +libpython2.7-dev==2.7.16-2+deb10u1 +libpython2.7-minimal==2.7.16-2+deb10u1 +libpython2.7-stdlib==2.7.16-2+deb10u1 +libpython3-all-dbg==3.7.3-1 +libpython3-all-dev==3.7.3-1 +libpython3-dbg==3.7.3-1 +libpython3-dev==3.7.3-1 +libpython3-stdlib==3.7.3-1 +libpython3.7==3.7.3-2+deb10u4 +libpython3.7-dbg==3.7.3-2+deb10u4 +libpython3.7-dev==3.7.3-2+deb10u4 +libpython3.7-minimal==3.7.3-2+deb10u4 +libpython3.7-stdlib==3.7.3-2+deb10u4 +libqdox-java==1.12.1-3 +libqdox2-java==2.0~M10-1 +libqt4-dbus==4:4.8.7+dfsg-18+deb10u1 +libqt4-declarative==4:4.8.7+dfsg-18+deb10u1 +libqt4-designer==4:4.8.7+dfsg-18+deb10u1 +libqt4-dev==4:4.8.7+dfsg-18+deb10u1 +libqt4-dev-bin==4:4.8.7+dfsg-18+deb10u1 +libqt4-help==4:4.8.7+dfsg-18+deb10u1 +libqt4-network==4:4.8.7+dfsg-18+deb10u1 +libqt4-opengl==4:4.8.7+dfsg-18+deb10u1 +libqt4-opengl-dev==4:4.8.7+dfsg-18+deb10u1 +libqt4-qt3support==4:4.8.7+dfsg-18+deb10u1 +libqt4-script==4:4.8.7+dfsg-18+deb10u1 +libqt4-scripttools==4:4.8.7+dfsg-18+deb10u1 +libqt4-sql==4:4.8.7+dfsg-18+deb10u1 +libqt4-sql-mysql==4:4.8.7+dfsg-18+deb10u1 +libqt4-svg==4:4.8.7+dfsg-18+deb10u1 +libqt4-test==4:4.8.7+dfsg-18+deb10u1 +libqt4-xml==4:4.8.7+dfsg-18+deb10u1 +libqt4-xmlpatterns==4:4.8.7+dfsg-18+deb10u1 +libqt5concurrent5==5.11.3+dfsg1-1+deb10u5 +libqt5core5a==5.11.3+dfsg1-1+deb10u5 +libqt5dbus5==5.11.3+dfsg1-1+deb10u5 +libqt5gui5==5.11.3+dfsg1-1+deb10u5 +libqt5network5==5.11.3+dfsg1-1+deb10u5 +libqt5opengl5==5.11.3+dfsg1-1+deb10u5 +libqt5opengl5-dev==5.11.3+dfsg1-1+deb10u5 +libqt5printsupport5==5.11.3+dfsg1-1+deb10u5 +libqt5sql5==5.11.3+dfsg1-1+deb10u5 +libqt5sql5-sqlite==5.11.3+dfsg1-1+deb10u5 +libqt5svg5==5.11.3-2 +libqt5test5==5.11.3+dfsg1-1+deb10u5 +libqt5widgets5==5.11.3+dfsg1-1+deb10u5 +libqt5xml5==5.11.3+dfsg1-1+deb10u5 +libqtcore4==4:4.8.7+dfsg-18+deb10u1 +libqtdbus4==4:4.8.7+dfsg-18+deb10u1 +libqtgui4==4:4.8.7+dfsg-18+deb10u1 +libquadmath0==8.3.0-6 +libraw1394-11==2.1.2-1+b1 +librdmacm1==22.1-1 +libreadline-dev==7.0-5 +libreadline5==5.2+dfsg-3+b13 +libreadline7==7.0-5 +libreadonly-perl==2.050-1 +libref-util-perl==0.204-1 +libref-util-xs-perl==0.117-1+b1 +libregexp-assemble-perl==0.36-1 +libregexp-pattern-license-perl==3.0.31-4 +librest-0.7-0==0.8.1-1 +librhash0==1.3.8-1 +librole-tiny-perl==2.000006-1 +librrd-dev==1.7.1-2 +librrd8==1.7.1-2 +librsvg2-2==2.44.10-2.1+deb10u3 +librsvg2-common==2.44.10-2.1+deb10u3 +librtmp1==2.4+20151223.gitfa8646d.1-2 +librubberband2==1.8.1-7 +libruby2.5==2.5.5-3+deb10u4 +libsamplerate0==0.1.9-2 +libsasl2-2==2.1.27+dfsg-1+deb10u2 +libsasl2-modules==2.1.27+dfsg-1+deb10u2 +libsasl2-modules-db==2.1.27+dfsg-1+deb10u2 +libsaxon-java==1:6.5.5-12 +libselinux1-dev==2.8-1+b1 +libsensors-config==1:3.5.0-3 +libsensors4-dev==1:3.5.0-3 +libsensors5==1:3.5.0-3 +libsepol1-dev==2.8-1 +libserd-0-0==0.28.0~dfsg0-1 +libsereal-decoder-perl==4.005+ds-1+b1 +libsereal-encoder-perl==4.005+ds-1+b1 +libsereal-perl==4.005-1 +libservlet-api-java==4.0.1-2 +libservlet3.1-java==1:4.0.1-2 +libshine3==3.1.1-2 +libshout3==2.4.1-2 +libsidplay1v5==1.36.59-11 +libsigsegv2==2.12-2 +libsisu-guice-java==4.2.0-1 +libsisu-inject-java==0.3.3-1 +libsisu-ioc-java==2.3.0-11 +libsisu-plexus-java==0.3.3-3 +libslang2==2.3.2-2 +libslang2-dev==2.3.2-2 +libslf4j-java==1.7.25-3 +libsm-dev==2:1.2.3-1 +libsm6==2:1.2.3-1 +libsnappy-java==1.1.7.2-1 +libsnappy-jni==1.1.7.2-1 +libsnappy1v5==1.1.7-1 +libsndfile1==1.0.28-6+deb10u2 +libsnmp-base==5.7.3+dfsg-5+deb10u4 +libsnmp-dev==5.7.3+dfsg-5+deb10u4 +libsnmp30==5.7.3+dfsg-5+deb10u4 +libsoap-lite-perl==1.27-1 +libsodium-dev==1.0.17-1 +libsodium23==1.0.17-1 +libsord-0-0==0.16.0~dfsg0-1+b1 +libsort-key-perl==1.33-2+b1 +libsort-versions-perl==1.62-1 +libsoup-gnome2.4-1==2.64.2-2 +libsoup2.4-1==2.64.2-2 +libsoxr0==0.1.2-3 +libspeex1==1.2~rc1.2-1+b2 +libspice-server1==0.14.0-1.3+deb10u1 +libsqlite3-0==3.27.2-3+deb10u2 +libsratom-0-0==0.6.0~dfsg0-1 +libssh-gcrypt-4==0.8.7-1+deb10u1 +libssh2-1==1.8.0-2.1 +libssl-dev==1.1.1n-0+deb10u4 +libssl1.1==1.1.1n-0+deb10u4 +libstdc++-8-dev==8.3.0-6 +libstemmer0d==0+svn585-1+b2 +libstrictures-perl==2.000005-1 +libstring-copyright-perl==0.003006-1 +libstring-escape-perl==2010.002-2 +libstring-shellquote-perl==1.04-1 +libstruct-dumb-perl==0.09-1 +libsub-exporter-perl==0.987-1 +libsub-exporter-progressive-perl==0.001013-1 +libsub-identify-perl==0.14-1+b1 +libsub-install-perl==0.928-1 +libsub-name-perl==0.21-1+b3 +libsub-quote-perl==2.005001-1 +libsubunit-dev==1.3.0-1 +libsubunit0==1.3.0-1 +libsurefire-java==2.22.1-1 +libswitch-perl==2.17-2 +libswresample3==7:4.1.10-0+deb10u1 +libswscale5==7:4.1.10-0+deb10u1 +libsynctex2==2018.20181218.49446-1 +libsys-hostname-long-perl==1.5-1 +libsystemd-dev==241-7~deb10u9 +libtag1v5==1.11.1+dfsg.1-0.3+deb10u1 +libtag1v5-vanilla==1.11.1+dfsg.1-0.3+deb10u1 +libtask-weaken-perl==1.06-1 +libtasn1-6-dev==4.13-3+deb10u1 +libtasn1-doc==4.13-3+deb10u1 +libtcl8.6==8.6.9+dfsg-2 +libtcmalloc-minimal4==2.7-1 +libteckit0==2.5.8+ds2-5 +libtemplate-perl==2.27-1+b1 +libterm-readkey-perl==2.38-1 +libtest-fatal-perl==0.014-1 +libtest-refcount-perl==0.08-3 +libtexlua52==2018.20181218.49446-1 +libtexlua53==2018.20181218.49446-1 +libtexluajit2==2018.20181218.49446-1 +libtext-charwidth-perl==0.04-7.1+b1 +libtext-glob-perl==0.10-1 +libtext-iconv-perl==1.7-5+b7 +libtext-levenshtein-perl==0.13-1 +libtext-unidecode-perl==1.30-1 +libtext-wrapi18n-perl==0.06-7.1 +libthai-data==0.1.28-2 +libthai0==0.1.28-2 +libtheora0==1.1.1+dfsg.1-15 +libtie-ixhash-perl==1.23-2 +libtiff5==4.1.0+git191117-2~deb10u7 +libtimedate-perl==2.3000-2+deb10u1 +libtinyxml2-6a==7.0.0+dfsg-1 +libtinyxml2-dev==7.0.0+dfsg-1 +libtk8.6==8.6.9-2 +libtool==2.4.6-9 +libtool-bin==2.4.6-9 +libtry-tiny-perl==0.30-1 +libtsan0==8.3.0-6 +libtwolame0==0.3.13-4 +libtype-tiny-perl==1.004004-1 +libtype-tiny-xs-perl==0.014-1+b1 +libtypes-serialiser-perl==1.0-1 +libubsan1==8.3.0-6 +libuchardet0==0.0.6-3 +libudev-dev==241-7~deb10u9 +libunbound8==1.9.0-2+deb10u3 +libunicode-utf8-perl==0.62-1 +libunwind-dev==1.2.1-10~deb10u1 +libunwind8==1.2.1-10~deb10u1 +liburi-perl==1.76-1 +libusb-0.1-4==2:0.1.12-32 +libusb-1.0-0==2:1.0.22-2 +libusb-1.0-0-dev==2:1.0.22-2 +libusb-1.0-doc==2:1.0.22-2 +libusb-dev==2:0.1.12-32 +libusbredirparser1==0.8.0-1 +libutempter0==1.1.6-3 +libuv1==1.24.1-1+deb10u1 +libv4l-0==1.16.3-3 +libv4lconvert0==1.16.3-3 +libva-drm2==2.4.0-1 +libva-x11-2==2.4.0-1 +libva2==2.4.0-1 +libvariable-magic-perl==0.62-1+b1 +libvdeplug2==2.3.2+r586-2.2 +libvdpau-va-gl1==0.4.2-1+b1 +libvdpau1==1.1.1-10 +libvelocity-tools-java==2.0-7 +libvidstab1.1==1.1.0-2 +libvirglrenderer0==0.7.0-2+deb10u1 +libvirt-clients==5.0.0-4+deb10u1 +libvirt0==5.0.0-4+deb10u1 +libvisual-0.4-0==0.4.0-15 +libvorbis0a==1.3.6-2 +libvorbisenc2==1.3.6-2 +libvorbisfile3==1.3.6-2 +libvpx5==1.7.0-3+deb10u1 +libvte-2.91-0==0.54.2-2 +libvte-2.91-common==0.54.2-2 +libvulkan-dev==1.1.97-2 +libvulkan1==1.1.97-2 +libwacom-bin==0.32-1 +libwacom-common==0.32-1 +libwacom2==0.32-1 +libwagon-file-java==3.3.1-2 +libwagon-http-shaded-java==3.3.1-2 +libwagon-provider-api-java==3.3.1-2 +libwant-perl==0.29-1+b4 +libwavpack1==5.1.0-6+deb10u1 +libwayland-bin==1.16.0-1 +libwayland-client0==1.16.0-1 +libwayland-cursor0==1.16.0-1 +libwayland-dev==1.16.0-1 +libwayland-egl1==1.16.0-1 +libwayland-server0==1.16.0-1 +libwebp6==0.6.1-2+deb10u1 +libwebpdemux2==0.6.1-2+deb10u1 +libwebpmux3==0.6.1-2+deb10u1 +libwebsocket-api-java==1.1-1+deb10u1 +libwmf0.2-7==0.2.8.4-14 +libwoff1==1.0.2-1 +libwrap0==7.6.q-28 +libwrap0-dev==7.6.q-28 +libwww-perl==6.36-2 +libwww-robotrules-perl==6.02-1 +libx11-6==2:1.6.7-1+deb10u2 +libx11-data==2:1.6.7-1+deb10u2 +libx11-dev==2:1.6.7-1+deb10u2 +libx11-protocol-perl==0.56-7 +libx11-xcb-dev==2:1.6.7-1+deb10u2 +libx11-xcb1==2:1.6.7-1+deb10u2 +libx264-155==2:0.155.2917+git0a84d98-2 +libx265-165==2.9-4 +libx32asan5==8.3.0-6 +libx32atomic1==8.3.0-6 +libx32gcc-8-dev==8.3.0-6 +libx32gcc1==1:8.3.0-6 +libx32gomp1==8.3.0-6 +libx32itm1==8.3.0-6 +libx32quadmath0==8.3.0-6 +libx32stdc++6==8.3.0-6 +libx32ubsan1==8.3.0-6 +libxalan2-java==2.7.2-2 +libxapian30==1.4.11-1+deb10u1 +libxau-dev==1:1.0.8-1+b2 +libxau6==1:1.0.8-1+b2 +libxaw7==2:1.0.13-1+b2 +libxbean-reflect-java==4.5-8 +libxcb-dri2-0==1.13.1-2 +libxcb-dri2-0-dev==1.13.1-2 +libxcb-dri3-0==1.13.1-2 +libxcb-dri3-dev==1.13.1-2 +libxcb-glx0==1.13.1-2 +libxcb-glx0-dev==1.13.1-2 +libxcb-icccm4==0.4.1-1.1 +libxcb-image0==0.4.0-1+b2 +libxcb-keysyms1==0.4.0-1+b2 +libxcb-present-dev==1.13.1-2 +libxcb-present0==1.13.1-2 +libxcb-randr0==1.13.1-2 +libxcb-randr0-dev==1.13.1-2 +libxcb-render-util0==0.3.9-1+b1 +libxcb-render0==1.13.1-2 +libxcb-render0-dev==1.13.1-2 +libxcb-shape0==1.13.1-2 +libxcb-shape0-dev==1.13.1-2 +libxcb-shm0==1.13.1-2 +libxcb-shm0-dev==1.13.1-2 +libxcb-sync-dev==1.13.1-2 +libxcb-sync1==1.13.1-2 +libxcb-util0==0.3.8-3+b2 +libxcb-xfixes0==1.13.1-2 +libxcb-xfixes0-dev==1.13.1-2 +libxcb-xinerama0==1.13.1-2 +libxcb-xkb1==1.13.1-2 +libxcb1==1.13.1-2 +libxcb1-dev==1.13.1-2 +libxcomposite-dev==1:0.4.4-2 +libxcomposite1==1:0.4.4-2 +libxcursor-dev==1:1.1.15-2 +libxcursor1==1:1.1.15-2 +libxdamage-dev==1:1.1.4-3+b3 +libxdamage1==1:1.1.4-3+b3 +libxdelta2==1.1.3-9.2 +libxdmcp-dev==1:1.1.2-3 +libxdmcp6==1:1.1.2-3 +libxdot4==2.40.1-6+deb10u1 +libxencall1==4.11.4+107-gef32c7afa2-1 +libxendevicemodel1==4.11.4+107-gef32c7afa2-1 +libxenevtchn1==4.11.4+107-gef32c7afa2-1 +libxenforeignmemory1==4.11.4+107-gef32c7afa2-1 +libxengnttab1==4.11.4+107-gef32c7afa2-1 +libxenmisc4.11==4.11.4+107-gef32c7afa2-1 +libxenstore3.0==4.11.4+107-gef32c7afa2-1 +libxentoolcore1==4.11.4+107-gef32c7afa2-1 +libxentoollog1==4.11.4+107-gef32c7afa2-1 +libxerces2-java==2.12.0-1 +libxext-dev==2:1.3.3-1+b2 +libxext6==2:1.3.3-1+b2 +libxfixes-dev==1:5.0.3-1 +libxfixes3==1:5.0.3-1 +libxft-dev==2.3.2-2 +libxft2==2.3.2-2 +libxi-dev==2:1.7.9-1 +libxi6==2:1.7.9-1 +libxinerama-dev==2:1.1.4-2 +libxinerama1==2:1.1.4-2 +libxkbcommon-dev==0.8.2-1 +libxkbcommon-x11-0==0.8.2-1 +libxkbcommon0==0.8.2-1 +libxml-commons-external-java==1.4.01-3 +libxml-commons-resolver1.1-java==1.2-9 +libxml-libxml-perl==2.0134+dfsg-1 +libxml-namespacesupport-perl==1.12-1 +libxml-parser-perl==2.44-4 +libxml-sax-base-perl==1.09-1 +libxml-sax-expat-perl==0.51-1 +libxml-sax-perl==1.00+dfsg-1 +libxml-simple-perl==2.25-1 +libxml-twig-perl==1:3.50-1.1 +libxml-xpathengine-perl==0.14-1 +libxml2==2.9.4+dfsg1-7+deb10u6 +libxml2-dev==2.9.4+dfsg1-7+deb10u6 +libxml2-utils==2.9.4+dfsg1-7+deb10u6 +libxmlgraphics-commons-java==2.3-1+deb10u1 +libxmlrpc-lite-perl==0.717-2 +libxmu6==2:1.1.2-2+b3 +libxmuu1==2:1.1.2-2+b3 +libxpm4==1:3.5.12-1 +libxrandr-dev==2:1.5.1-1 +libxrandr2==2:1.5.1-1 +libxrender-dev==1:0.9.10-1 +libxrender1==1:0.9.10-1 +libxshmfence-dev==1.3-1 +libxshmfence1==1.3-1 +libxslt1.1==1.1.32-2.2~deb10u2 +libxss1==1:1.2.3-1 +libxt-dev==1:1.1.5-1+b3 +libxt6==1:1.1.5-1+b3 +libxtables-dev==1.8.2-4 +libxtst-dev==2:1.2.3-1 +libxtst6==2:1.2.3-1 +libxv1==2:1.0.11-1 +libxvidcore4==2:1.3.5-1 +libxxf86dga1==2:1.1.4-1+b3 +libxxf86vm-dev==1:1.1.4-1+b2 +libxxf86vm1==1:1.1.4-1+b2 +libxxhash0==0.6.5-2 +libxz-java==1.8-2 +libyajl2==2.1.0-3 +libyaml-0-2==0.2.1-1 +libyaml-dev==0.2.1-1 +libyaml-libyaml-perl==0.76+repack-1 +libzmq3-dev==4.3.1-4+deb10u2 +libzmq5==4.3.1-4+deb10u2 +libzvbi-common==0.2.35-16 +libzvbi0==0.2.35-16 +libzzip-0-13==0.13.62-3.2+deb10u1 +licensecheck==3.0.31-3 +lintian==2.15.0 +linux-compiler-gcc-8-x86==4.19.282-1 +linux-headers-4.19.0-24-amd64==4.19.282-1 +linux-headers-4.19.0-24-common==4.19.282-1 +linux-headers-amd64==4.19+105+deb10u19 +linux-kbuild-4.19==4.19.282-1 +linux-libc-dev==4.19.282-1 +linuxdoc-tools==0.9.73-2 +llvm-7==1:7.0.1-8+deb10u2 +llvm-7-dev==1:7.0.1-8+deb10u2 +llvm-7-runtime==1:7.0.1-8+deb10u2 +lmodern==2.004.5-6 +logrotate==3.14.0-4 +lsb-base==10.2019051400 +lsb-release==10.2019051400 +lsof==4.91+dfsg-1 +lua-bitop==1.0.2-5 +lua-bitop-dev==1.0.2-5 +lua-cjson==2.1.0+dfsg-2.1 +lua-cjson-dev==2.1.0+dfsg-2.1 +lvm2==2.03.02-3 +lynx==2.8.9rel.1-3+deb10u1 +lynx-common==2.8.9rel.1-3+deb10u1 +m4==1.4.18-2 +make==4.2.1-1.2 +man-db==2.8.5-2 +manpages==4.16-2 +manpages-dev==4.16-2 +mariadb-common==1:10.3.38-0+deb10u1 +maven==3.6.0-1 +maven-debian-helper==2.3.2 +maven-repo-helper==1.9.3 +mesa-common-dev==18.3.6-2+deb10u1 +mesa-va-drivers==18.3.6-2+deb10u1 +mesa-vdpau-drivers==18.3.6-2+deb10u1 +mime-support==3.62 +module-assistant==0.11.10 +mysql-common==5.8+1.0.5 +ncurses-term==6.1+20181013-2+deb10u3 +netbase==5.6 +netpbm==2:10.0-15.3+b2 +nettle-dev==3.4.1-1+deb10u1 +nftables==0.9.0-2 +ocl-icd-libopencl1==2.2.12-2 +openjdk-11-jdk==11.0.18+10-1~deb10u1 +openjdk-11-jdk-headless==11.0.18+10-1~deb10u1 +openjdk-11-jre==11.0.18+10-1~deb10u1 +openjdk-11-jre-headless==11.0.18+10-1~deb10u1 +openmpi-bin==3.1.3-11 +openmpi-common==3.1.3-11 +opensp==1.5.2-13+b1 +openssh-client==1:7.9p1-10+deb10u2 +openssh-server==1:7.9p1-10+deb10u2 +openssh-sftp-server==1:7.9p1-10+deb10u2 +openssl==1.1.1n-0+deb10u4 +ovmf==0~20181115.85588389-3+deb10u3 +packagekit==1.1.12-5 +packagekit-tools==1.1.12-5 +pango1.0-tools==1.42.4-8~deb10u1 +patch==2.7.6-3+deb10u1 +patchutils==0.3.4-2 +pbuilder==0.230.4 +pbzip2==1.1.9-1+b1 +perl==5.28.1-6+deb10u1 +perl-modules-5.28==5.28.1-6+deb10u1 +perl-openssl-defaults==3 +php-cli==2:7.3+69 +php-codecoverage==6.1.4+dfsg-1 +php-common==2:69 +php-deepcopy==1.8.1-1 +php-doctrine-instantiator==1.1.0-2 +php-file-iterator==2.0.2-1 +php-mbstring==2:7.3+69 +php-pear==1:1.10.6+submodules+notgz-1.1+deb10u2 +php-phar-io-manifest==1.0.3-1 +php-phar-io-version==2.0.1-1 +php-phpdocumentor-reflection-common==1.0.1-1 +php-phpdocumentor-reflection-docblock==4.3.0-1 +php-phpdocumentor-type-resolver==0.4.0-2 +php-phpspec-prophecy==1.8.0-1 +php-text-template==1.2.1-2 +php-timer==2.1.1-1 +php-token-stream==3.0.1-1 +php-tokenizer==1.1.0-1 +php-webmozart-assert==1.4.0-3 +php-xml==2:7.3+69 +php7.3-cli==7.3.31-1~deb10u3 +php7.3-common==7.3.31-1~deb10u3 +php7.3-json==7.3.31-1~deb10u3 +php7.3-mbstring==7.3.31-1~deb10u3 +php7.3-opcache==7.3.31-1~deb10u3 +php7.3-readline==7.3.31-1~deb10u3 +php7.3-xml==7.3.31-1~deb10u3 +phpunit==7.5.6-1 +phpunit-code-unit-reverse-lookup==1.0.1-1 +phpunit-comparator==3.0.2-1 +phpunit-diff==3.0.2-1 +phpunit-environment==4.1.0-1 +phpunit-exporter==3.1.0-2 +phpunit-global-state==2.0.0really2.0.0-2 +phpunit-object-enumerator==3.0.3-3 +phpunit-object-reflector==1.1.1-2 +phpunit-recursion-context==3.0.0-2 +phpunit-resource-operations==2.0.1-1 +phpunit-version==2.0.1-1 +pigz==2.4-1 +pinentry-curses==1.1.0-2 +pkg-config==0.29-6 +pkg-php-tools==1.37 +po-debconf==1.0.21 +policykit-1==0.105-25+deb10u1 +poppler-data==0.4.9-2 +pps-tools==1.0.2-1 +preview-latex-style==11.91-2 +pristine-tar==1.46 +procmail==3.22-26+deb10u1 +procps==2:3.3.15-2 +protobuf-compiler==3.6.1.3-2+deb10u1 +psmisc==23.2-1+deb10u1 +psutils==1.17.dfsg-4 +publicsuffix==20220811.1734-0+deb10u1 +pylint==1.9.4-1 +python==2.7.16-1 +python-alabaster==0.7.8-1 +python-all==2.7.16-1 +python-all-dev==2.7.16-1 +python-apt-common==1.8.4.3 +python-asn1crypto==0.24.0-1 +python-astroid==1.6.5-3 +python-atomicwrites==1.1.5-2 +python-attr==18.2.0-1 +python-automat==0.6.0-1 +python-babel==2.6.0+dfsg.1-1+deb10u1 +python-babel-localedata==2.6.0+dfsg.1-1+deb10u1 +python-backports.functools-lru-cache==1.5-3 +python-bs4==4.7.1-1 +python-certifi==2018.8.24-1 +python-cffi-backend==1.12.2-1 +python-chardet==3.0.4-3 +python-click==7.0-1 +python-colorama==0.3.7-1 +python-concurrent.futures==3.2.0-2 +python-configparser==3.5.0b2-1 +python-constantly==15.1.0-1 +python-cov-core==1.15.0-2 +python-coverage==4.5.2+dfsg.1-1 +python-crypto==2.6.1-9+b1 +python-cryptography==2.6.1-3+deb10u4 +python-dbus==1.2.8-3 +python-dev==2.7.16-1 +python-docutils==0.14+dfsg-4 +python-egenix-mxdatetime==3.2.9-1 +python-egenix-mxtools==3.2.9-1 +python-entrypoints==0.3-1 +python-enum34==1.1.6-2 +python-funcsigs==1.0.2-4 +python-gi==3.30.4-1 +python-html5lib==1.0.1-1 +python-hyperlink==17.3.1-2 +python-idna==2.6-1 +python-imagesize==1.0.0-1 +python-incremental==16.10.1-3 +python-ipaddr==2.2.0-2 +python-ipaddress==1.0.17-1 +python-isort==4.3.4+ds1-1.1 +python-jinja2==2.10-2 +python-keyring==17.1.1-1 +python-keyrings.alt==3.1.1-1 +python-lazy-object-proxy==1.3.1-1+b1 +python-logilab-common==1.4.2-1 +python-lxml==4.3.2-1+deb10u4 +python-markupsafe==1.1.0-1 +python-mccabe==0.6.1-2 +python-minimal==2.7.16-1 +python-mock==2.0.0-4 +python-more-itertools==4.2.0-1 +python-nose2==0.8.0-1 +python-olefile==0.46-1 +python-openssl==19.0.0-1 +python-packaging==19.0-1 +python-parse==1.6.6-0.1 +python-pathlib2==2.3.3-1 +python-pbr==4.2.0-5 +python-pil==5.4.1-2+deb10u3 +python-pip==18.1-5 +python-pip-whl==18.1-5 +python-pkg-resources==40.8.0-1 +python-pluggy==0.8.0-1 +python-py==1.7.0-2 +python-pyasn1==0.4.2-3 +python-pyasn1-modules==0.2.1-0.2 +python-pygments==2.3.1+dfsg-1+deb10u2 +python-pyparsing==2.2.0+dfsg1-2 +python-pytest==3.10.1-2 +python-pytest-cov==2.6.0-1 +python-requests==2.21.0-1 +python-roman==2.0.0-3 +python-scandir==1.9.0-2 +python-secretstorage==2.3.1-2 +python-service-identity==16.0.0-2 +python-setuptools==40.8.0-1 +python-singledispatch==3.4.0.3-2 +python-six==1.12.0-1 +python-soupsieve==1.8+dfsg-1 +python-sphinx==1.8.4-1 +python-stdeb==0.8.5-1 +python-tk==2.7.16-2 +python-twisted==18.9.0-3+deb10u2 +python-twisted-bin==18.9.0-3+deb10u2 +python-twisted-core==18.9.0-3+deb10u2 +python-typing==3.6.6-1 +python-tz==2019.1-1 +python-urllib3==1.24.1-1 +python-webencodings==0.5.1-1 +python-wheel==0.32.3-2 +python-wrapt==1.10.11-1 +python-xdg==0.25-5 +python-zope.interface==4.3.2-1+b2 +python2==2.7.16-1 +python2-dev==2.7.16-1 +python2-minimal==2.7.16-1 +python2.7==2.7.16-2+deb10u1 +python2.7-dev==2.7.16-2+deb10u1 +python2.7-minimal==2.7.16-2+deb10u1 +python3==3.7.3-1 +python3-alabaster==0.7.8-1 +python3-all==3.7.3-1 +python3-all-dbg==3.7.3-1 +python3-all-dev==3.7.3-1 +python3-apt==1.8.4.3 +python3-asn1crypto==0.24.0-1 +python3-atomicwrites==1.1.5-2 +python3-attr==18.2.0-1 +python3-babel==2.6.0+dfsg.1-1+deb10u1 +python3-certifi==2018.8.24-1 +python3-cffi-backend==1.12.2-1 +python3-chardet==3.0.4-3 +python3-cov-core==1.15.0-2 +python3-coverage==4.5.2+dfsg.1-1 +python3-crypto==2.6.1-9+b1 +python3-cryptography==2.6.1-3+deb10u4 +python3-dateutil==2.7.3-3 +python3-dbg==3.7.3-1 +python3-dbus==1.2.8-3 +python3-debian==0.1.35 +python3-dev==3.7.3-1 +python3-distro-info==0.21 +python3-distutils==3.7.3-1 +python3-docutils==0.14+dfsg-4 +python3-entrypoints==0.3-1 +python3-gi==3.30.4-1 +python3-gpg==1.12.0-6 +python3-idna==2.6-1 +python3-imagesize==1.0.0-1 +python3-jinja2==2.10-2 +python3-keyring==17.1.1-1 +python3-keyrings.alt==3.1.1-1 +python3-lib2to3==3.7.3-1 +python3-magic==2:0.4.15-2 +python3-markupsafe==1.1.0-1 +python3-minimal==3.7.3-1 +python3-mock==2.0.0-4 +python3-more-itertools==4.2.0-1 +python3-nose2==0.8.0-1 +python3-olefile==0.46-1 +python3-packaging==19.0-1 +python3-pbr==4.2.0-5 +python3-pil==5.4.1-2+deb10u3 +python3-pip==18.1-5 +python3-pkg-resources==40.8.0-1 +python3-pluggy==0.8.0-1 +python3-py==1.7.0-2 +python3-pycurl==7.43.0.2-0.1 +python3-pygments==2.3.1+dfsg-1+deb10u2 +python3-pyparsing==2.2.0+dfsg1-2 +python3-pytest==3.10.1-2 +python3-pytest-cov==2.6.0-1 +python3-requests==2.21.0-1 +python3-roman==2.0.0-3 +python3-secretstorage==2.3.1-2 +python3-setuptools==40.8.0-1 +python3-six==1.12.0-1 +python3-software-properties==0.96.20.2-2 +python3-sphinx==1.8.4-1 +python3-sphinx-rtd-theme==0.4.3+dfsg-1 +python3-tz==2019.1-1 +python3-unidiff==0.5.4-1 +python3-urllib3==1.24.1-1 +python3-wheel==0.32.3-2 +python3-xdg==0.25-5 +python3.7==3.7.3-2+deb10u4 +python3.7-dbg==3.7.3-2+deb10u4 +python3.7-dev==3.7.3-2+deb10u4 +python3.7-minimal==3.7.3-2+deb10u4 +qdbus==4:4.8.7+dfsg-18+deb10u1 +qemu-kvm==1:3.1+dfsg-8+deb10u10 +qemu-system-common==1:3.1+dfsg-8+deb10u10 +qemu-system-data==1:3.1+dfsg-8+deb10u10 +qemu-system-gui==1:3.1+dfsg-8+deb10u10 +qemu-system-x86==1:3.1+dfsg-8+deb10u10 +qemu-utils==1:3.1+dfsg-8+deb10u10 +qt-at-spi==0.4.0-9 +qt4-linguist-tools==4:4.8.7+dfsg-18+deb10u1 +qt4-qmake==4:4.8.7+dfsg-18+deb10u1 +qt5-default==5.11.3+dfsg1-1+deb10u5 +qt5-gtk-platformtheme==5.11.3+dfsg1-1+deb10u5 +qt5-qmake==5.11.3+dfsg1-1+deb10u5 +qt5-qmake-bin==5.11.3+dfsg1-1+deb10u5 +qtbase5-dev==5.11.3+dfsg1-1+deb10u5 +qtbase5-dev-tools==5.11.3+dfsg1-1+deb10u5 +qtchooser==66-2 +qtcore4-l10n==4:4.8.7+dfsg-18+deb10u1 +qttranslations5-l10n==5.11.3-2 +quilt==0.65-3 +rake==12.3.1-3+deb10u1 +readline-common==7.0-5 +rrdtool==1.7.1-2 +rsync==3.1.3-6 +rsyslog==8.1901.0-1+deb10u2 +ruby==1:2.5.1 +ruby-all-dev==1:2.5.1 +ruby-asciidoctor==1.5.8-1 +ruby-did-you-mean==1.2.1-1 +ruby-minitest==5.11.3-1 +ruby-net-telnet==0.1.1-2 +ruby-power-assert==1.1.1-1 +ruby-setup==3.4.1-9 +ruby-test-unit==3.2.8-1 +ruby-xmlrpc==0.3.0-2 +ruby2.5==2.5.5-3+deb10u4 +ruby2.5-dev==2.5.5-3+deb10u4 +ruby2.5-doc==2.5.5-3+deb10u4 +rubygems-integration==1.11+deb10u1 +seabios==1.12.0-1 +sensible-utils==0.0.12 +sgml-base==1.29 +sgml-data==2.0.11 +shared-mime-info==1.10-1 +shellcheck==0.5.0-3 +software-properties-common==0.96.20.2-2 +sphinx-common==1.8.4-1 +sphinx-rtd-theme-common==0.4.3+dfsg-1 +squashfs-tools==1:4.3-12+deb10u2 +stgit==0.18-1 +strace==4.26-0.2 +sudo==1.8.27-1+deb10u5 +swig==3.0.12-2 +swig3.0==3.0.12-2 +systemd==241-7~deb10u9 +systemd-sysv==241-7~deb10u9 +t1utils==1.41-3 +tcl==8.6.9+1 +tcl8.6==8.6.9+dfsg-2 +telnet==0.17-41.2 +tex-common==6.11 +tex-gyre==20180621-3 +texi2html==1.82+dfsg1-5 +texinfo==6.5.0.dfsg.1-4+b1 +texlive-base==2018.20190227-2 +texlive-binaries==2018.20181218.49446-1 +texlive-fonts-recommended==2018.20190227-2 +texlive-generic-recommended==2018.20190227-2 +texlive-latex-base==2018.20190227-2 +texlive-latex-extra==2018.20190227-2 +texlive-latex-recommended==2018.20190227-2 +texlive-pictures==2018.20190227-2 +texlive-plain-generic==2018.20190227-2 +thin-provisioning-tools==0.7.6-2.1 +tipa==2:1.3-20 +tk==8.6.9+1 +tk8.6==8.6.9-2 +tk8.6-blt2.5==2.5.3+dfsg-4 +ucf==3.0038+nmu1 +unattended-upgrades==1.11.2 +unzip==6.0-23+deb10u3 +uuid-dev==2.33.1-0.1 +va-driver-all==2.4.0-1 +vdpau-driver-all==1.1.1-10 +velocity==1.7-5+deb10u1 +vim==2:8.1.0875-5+deb10u4 +vim-common==2:8.1.0875-5+deb10u4 +vim-runtime==2:8.1.0875-5+deb10u4 +wayland-protocols==1.17-1 +wdiff==1.2.2-2+b1 +wget==1.20.1-1.1 +x11-common==1:7.7+19 +x11-utils==7.7+4 +x11-xserver-utils==7.7+8 +x11proto-composite-dev==1:2018.4-4 +x11proto-core-dev==2018.4-4 +x11proto-damage-dev==1:2018.4-4 +x11proto-dev==2018.4-4 +x11proto-fixes-dev==1:2018.4-4 +x11proto-input-dev==2018.4-4 +x11proto-randr-dev==2018.4-4 +x11proto-record-dev==2018.4-4 +x11proto-xext-dev==2018.4-4 +x11proto-xf86vidmode-dev==2018.4-4 +x11proto-xinerama-dev==2018.4-4 +xauth==1:1.0.10-1 +xbitmaps==1.1.1-2 +xdelta==1.1.3-9.2 +xdelta3==3.0.11-dfsg-1+b1 +xdg-user-dirs==0.17-2 +xdg-utils==1.1.3-1+deb10u1 +xfonts-encodings==1:1.0.4-2 +xfonts-utils==1:7.7+6 +xkb-data==2.26-2 +xml-core==0.18+nmu1 +xorg-sgml-doctools==1:1.11-1 +xsltproc==1.1.32-2.2~deb10u2 +xterm==344-1+deb10u2 +xtrans-dev==1.3.5-1 +xxd==2:8.1.0875-5+deb10u4 +xz-utils==5.2.4-1+deb10u1 +zip==3.0-11+b1 +zlib1g-dev==1:1.2.11.dfsg-1+deb10u2 \ No newline at end of file diff --git a/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster-arm64 b/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster-arm64 new file mode 100644 index 000000000000..a92f5c1f4cff --- /dev/null +++ b/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster-arm64 @@ -0,0 +1,7 @@ +binutils-aarch64-linux-gnu==2.31.1-16 +libdrm-etnaviv1==2.4.97-1 +libdrm-freedreno1==2.4.97-1 +libdrm-tegra0==2.4.97-1 +libtext-iconv-perl==1.7-5+b6 +libxslt1-dev==1.1.32-2.2~deb10u2 +nodejs==14.21.3-deb-1nodesource1 \ No newline at end of file diff --git a/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster-armhf b/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster-armhf new file mode 100644 index 000000000000..2ac31159da88 --- /dev/null +++ b/files/build/versions/dockers/sonic-slave-buster/versions-deb-buster-armhf @@ -0,0 +1,112 @@ +binutils-arm-linux-gnueabihf==2.31.1-16 +libclang-6.0-dev==1:6.0.1-10 +libclang-7-dev==1:7.0.1-8+deb10u2 +libclang-common-6.0-dev==1:6.0.1-10 +libclang-dev==1:7.0-47 +libclass-data-inheritable-perl==0.08-3 +libdrm-etnaviv1==2.4.97-1 +libdrm-exynos1==2.4.97-1 +libdrm-freedreno1==2.4.97-1 +libdrm-omap1==2.4.97-1 +libdrm-tegra0==2.4.97-1 +libemail-date-format-perl==1.005-1 +libexception-class-perl==1.44-1 +libgles2-mesa-dev==18.3.6-2+deb10u1 +libipc-shareable-perl==0.61-2 +libjargs-java==1.0.0-4 +liblog-dispatch-perl==2.68-1 +liblog-log4perl-perl==1.49-1 +libmime-charset-perl==1.012.2-1 +libmime-lite-perl==3.030-2 +libmime-types-perl==2.17-1 +libparams-validationcompiler-perl==0.30-1 +librust-aho-corasick-dev==0.6.9-1 +librust-ansi-term-dev==0.11.0-1 +librust-atty-dev==0.2.11-1 +librust-autocfg-dev==0.1.1-1 +librust-backtrace+default-dev==0.3.13-1 +librust-backtrace+libbacktrace-dev==0.3.13-1 +librust-backtrace-dev==0.3.13-1 +librust-backtrace-sys-dev==0.1.28-1 +librust-bindgen+logging-dev==0.47.0-1 +librust-bindgen-dev==0.47.0-1 +librust-bitflags-dev==1.0.4-1 +librust-byteorder-dev==1.3.1-1 +librust-cc-dev==1.0.28-1 +librust-cexpr-dev==0.3.3-1 +librust-cfg-if-dev==0.1.6-1 +librust-clang-sys+clang-6-0-dev==0.27.0-1 +librust-clang-sys+runtime-dev==0.27.0-1 +librust-clang-sys-dev==0.27.0-1 +librust-clap+color-dev==2.32.0-4 +librust-clap+default-dev==2.32.0-4 +librust-clap+suggestions-dev==2.32.0-4 +librust-clap-dev==2.32.0-4 +librust-env-logger+default-dev==0.6.0-1 +librust-env-logger-dev==0.6.0-1 +librust-failure+default-dev==0.1.5-1 +librust-failure+derive-dev==0.1.5-1 +librust-failure+std-dev==0.1.5-1 +librust-failure-derive-dev==0.1.5-1 +librust-failure-dev==0.1.5-1 +librust-glob-dev==0.2.11-1 +librust-hashbrown-dev==0.1.8-1 +librust-humantime-dev==1.1.1-2 +librust-lazy-static-dev==1.2.0-1 +librust-libc-dev==0.2.48-1 +librust-libloading-dev==0.5.0-1 +librust-log-dev==0.4.6-1 +librust-memchr+default-dev==2.1.3-1 +librust-memchr+use-std-dev==2.1.3-1 +librust-memchr-dev==2.1.3-1 +librust-nom+std-dev==4.0.0-1 +librust-nom-dev==4.0.0-1 +librust-peeking-take-while-dev==0.1.2-1 +librust-proc-macro2-dev==0.4.27-1 +librust-quick-error-dev==1.2.2-1 +librust-quote+proc-macro-dev==0.6.11-1 +librust-quote-dev==0.6.11-1 +librust-redox-syscall-dev==0.1.40-2 +librust-redox-termios-dev==0.1.1-2 +librust-regex-dev==1.1.0-1 +librust-regex-syntax-dev==0.6.5-1 +librust-rustc-demangle-dev==0.1.13-1 +librust-scopeguard-dev==0.3.3-1 +librust-strsim-dev==0.7.0-1 +librust-syn+default-dev==0.15.26-1 +librust-syn+printing-dev==0.15.26-1 +librust-syn+proc-macro-dev==0.15.26-1 +librust-syn-dev==0.15.26-1 +librust-synstructure-dev==0.10.1-1 +librust-termcolor-dev==1.0.4-1 +librust-termion-dev==1.5.1-1 +librust-textwrap-dev==0.11.0-1 +librust-thread-local-dev==0.3.6-1 +librust-ucd-util-dev==0.1.1-1 +librust-unicode-width-dev==0.1.5-1 +librust-unicode-xid-dev==0.1.0-1 +librust-utf8-ranges-dev==1.0.2-1 +librust-vec-map-dev==0.8.1-2 +librust-which-dev==2.0.1-1 +librust-winapi-dev==0.3.6-1 +librust-winapi-i686-pc-windows-gnu-dev==0.4.0-1 +librust-winapi-x86-64-pc-windows-gnu-dev==0.4.0-1 +librust-wincolor-dev==1.0.0-1 +libsass1==3.5.5-4 +libsombok3==2.4.0-2 +libspecio-perl==0.43-1 +libunicode-linebreak-perl==0.0.20190101-1 +libxapian-dev==1.4.11-1+deb10u1 +libxslt1-dev==1.1.32-2.2~deb10u2 +libyaml-tiny-perl==1.73-1 +linux-compiler-gcc-8-arm==4.19.282-1 +llvm-6.0==1:6.0.1-10 +llvm-6.0-dev==1:6.0.1-10 +llvm-6.0-runtime==1:6.0.1-10 +nodejs==14.21.3-deb-1nodesource1 +ps2eps==1.68+binaryfree-2 +rdfind==1.4.1-1 +sassc==3.5.0-1 +texlive-extra-utils==2018.20190227-2 +texlive-font-utils==2018.20190227-2 +yui-compressor==2.4.8-2 \ No newline at end of file diff --git a/files/build/versions/dockers/sonic-slave-buster/versions-py2 b/files/build/versions/dockers/sonic-slave-buster/versions-py2 new file mode 100644 index 000000000000..d0fec6b1186d --- /dev/null +++ b/files/build/versions/dockers/sonic-slave-buster/versions-py2 @@ -0,0 +1,92 @@ +alabaster==0.7.8 +asn1crypto==0.24.0 +astroid==1.6.5 +atomicwrites==1.1.5 +attrs==18.2.0 +automat==0.6.0 +babel==2.6.0 +backports.functools-lru-cache==1.5 +beautifulsoup4==4.7.1 +certifi==2018.8.24 +chardet==3.0.4 +click==7.0 +colorama==0.3.7 +configparser==3.5.0b2 +constantly==15.1.0 +cov-core==1.15.0 +coverage==4.5.2 +crc16==0.1.1 +cryptography==2.6.1 +ctypesgen==1.0.2 +docutils==0.14 +entrypoints==0.3 +enum34==1.1.6 +fastentrypoints==0.12 +funcsigs==1.0.2 +futures==3.2.0 +html5lib==1.0.1 +hyperlink==17.3.1 +idna==2.6 +imagesize==1.0.0 +incremental==16.10.1 +ipaddr==2.2.0 +ipaddress==1.0.17 +isort==4.3.4 +j2cli==0.3.10 +jinja2==2.10 +keyring==17.1.1 +keyrings.alt==3.1.1 +lazy-object-proxy==1.3.1 +logilab-common==1.4.2 +lxml==4.6.5 +m2crypto==0.36.0 +markupsafe==1.1.0 +mccabe==0.6.1 +mmh3==2.5.1 +mock==3.0.5 +mockredispy==2.9.3 +more-itertools==4.2.0 +nose==1.3.7 +nose2==0.8.0 +olefile==0.46 +packaging==19.0 +parse==1.6.6 +pathlib2==2.3.3 +pbr==4.2.0 +pexpect==4.6.0 +pillow==5.4.1 +pluggy==0.8.0 +ptyprocess==0.7.0 +py==1.7.0 +pyasn1==0.4.2 +pyasn1-modules==0.2.1 +pycrypto==2.6.1 +pygments==2.3.1 +pygobject==3.30.4 +pylint==1.9.4 +pympler==0.8 +pyopenssl==19.0.0 +pyparsing==2.2.0 +pytest==3.10.1 +pytest-cov==2.6.0 +pytest-runner==4.4 +pytz==2019.1 +pyxdg==0.25 +pyyaml==5.4.1 +requests==2.21.0 +roman==2.0.0 +scandir==1.9.0 +secretstorage==2.3.1 +service-identity==16.0.0 +singledispatch==3.4.0.3 +six==1.12.0 +soupsieve==1.8 +sphinx==1.8.4 +stdeb==0.8.5 +stgit==0.18 +twisted==18.9.0 +typing==3.6.6 +urllib3==1.24.1 +webencodings==0.5.1 +wrapt==1.10.11 +zope.interface==4.3.2 \ No newline at end of file diff --git a/files/build/versions/dockers/sonic-slave-buster/versions-py3 b/files/build/versions/dockers/sonic-slave-buster/versions-py3 new file mode 100644 index 000000000000..ffc14e1dc834 --- /dev/null +++ b/files/build/versions/dockers/sonic-slave-buster/versions-py3 @@ -0,0 +1,72 @@ +alabaster==0.7.8 +asn1crypto==0.24.0 +atomicwrites==1.1.5 +attrs==18.2.0 +babel==2.6.0 +bitarray==2.7.3 +certifi==2018.8.24 +chardet==3.0.4 +cov-core==1.15.0 +coverage==4.5.2 +cryptography==2.6.1 +deepdiff==6.2.2 +devscripts==2.19.5+deb10u1 +distro-info==0.21 +docutils==0.14 +entrypoints==0.3 +fastentrypoints==0.12 +gbp==0.9.14 +gcovr==4.1 +gpg==1.12.0 +idna==2.6 +imagesize==1.0.0 +jinja2==2.10 +keyring==17.1.1 +keyrings.alt==3.1.1 +lxml==4.6.5 +m2crypto==0.38.0 +markupsafe==1.1.0 +mmh3==2.5.1 +mock==2.0.0 +mockredispy==2.9.3 +more-itertools==4.2.0 +nose==1.3.7 +nose2==0.8.0 +olefile==0.46 +ordered-set==4.1.0 +packaging==19.0 +pbr==4.2.0 +pexpect==4.8.0 +pillow==5.4.1 +pluggy==0.8.0 +ptyprocess==0.7.0 +py==1.7.0 +pyang==2.4.0 +pyangbind==0.8.1 +pycrypto==2.6.1 +pycurl==7.43.0.2 +pygments==2.3.1 +pygobject==3.30.4 +pympler==0.8 +pyparsing==2.2.0 +pytest==3.10.1 +pytest-cov==2.6.0 +pytest-runner==5.2 +python-apt==1.8.4.3 +python-dateutil==2.7.3 +python-debian==0.1.35 +python-magic==0.4.16 +pytz==2019.1 +pyxdg==0.25 +pyyaml==5.4.1 +redis==3.5.3 +regex==2023.5.5 +requests==2.21.0 +roman==2.0.0 +secretstorage==2.3.1 +six==1.12.0 +sphinx==1.8.4 +sphinx-rtd-theme==0.4.3 +unattended-upgrades==0.1 +unidiff==0.5.4 +urllib3==1.24.1 \ No newline at end of file diff --git a/files/build/versions/dockers/sonic-slave-stretch/versions-deb-stretch b/files/build/versions/dockers/sonic-slave-stretch/versions-deb-stretch new file mode 100644 index 000000000000..6f3a9f27360f --- /dev/null +++ b/files/build/versions/dockers/sonic-slave-stretch/versions-deb-stretch @@ -0,0 +1,1488 @@ +adwaita-icon-theme==3.22.0-1+deb9u1 +ant==1.9.9-1+deb9u1 +ant-optional==1.9.9-1+deb9u1 +apt-file==3.1.4 +apt-transport-https==1.4.11 +apt-utils==1.4.11 +asciidoc-base==8.6.9-5 +asciidoc-common==8.6.9-5 +aspell==0.60.7~20110707-3+deb9u1 +aspell-en==2016.11.20-0-0.1 +at==3.1.20-3 +at-spi2-core==2.22.0-6+deb9u1 +aufs-dkms==4.9+20161219-1 +aufs-tools==1:4.1+20161219-1 +augeas-lenses==1.8.0-1+deb9u1 +augeas-tools==1.8.0-1+deb9u1 +autoconf==2.69-10 +autoconf-archive==20160916-1 +automake==1:1.15-6 +automake1.11==1:1.11.6-4 +autopoint==0.19.8.1-2+deb9u1 +autotools-dev==20161112.1 +bash-completion==1:2.1-4.3 +bc==1.06.95-9+b3 +bind9-host==1:9.10.3.dfsg.P4-12.3+deb9u12 +binfmt-support==2.1.6-2 +binutils==2.28-5 +bison==2:3.0.4.dfsg-1+b1 +blt==2.5.3+dfsg-3 +bsdmainutils==9.0.12+nmu1 +build-essential==12.3 +byacc==20140715-1+b1 +bzip2==1.0.6-8.1 +ca-certificates==20200601~deb9u2 +ca-certificates-java==20170929~deb9u3 +cdbs==0.4.150 +cgmanager==0.41-2 +cgroupfs-mount==1.3 +check==0.10.0-3+b3 +chrpath==0.16-2+b1 +clang==1:3.8-36 +clang-3.8==1:3.8.1-24 +cm-super-minimal==0.3.4-9 +cmake==3.13.2-1~bpo9+1 +cmake-data==3.13.2-1~bpo9+1 +cmocka-doc==1.0.1-3 +containerd.io==1.4.3-1 +cowbuilder==0.85 +cowdancer==0.85 +cpio==2.11+dfsg-6 +cpp==4:6.3.0-4 +cpp-6==6.3.0-18+deb9u1 +cppcheck==1.76.1-1 +cron==3.0pl1-128+deb9u2 +curl==7.52.1-5+deb9u16 +dbus==1.10.32-0+deb9u1 +dconf-gsettings-backend==0.26.0-2+b1 +dconf-service==0.26.0-2+b1 +dctrl-tools==2.24-2+b1 +debhelper==12.1.1~bpo9+1 +debian-keyring==2017.05.28 +debootstrap==1.0.89 +default-jdk-headless==2:1.8-58+deb9u1 +default-jre==2:1.8-58+deb9u1 +default-jre-headless==2:1.8-58+deb9u1 +default-libmysqlclient-dev==1.0.2 +devscripts==2.17.6+deb9u2 +dh-autoreconf==17~bpo9+1 +dh-exec==0.23+b1 +dh-make==2.201608 +dh-python==2.20170125 +dh-strip-nondeterminism==0.034-1 +dh-systemd==10.2.5 +dictionaries-common==1.27.2 +diffstat==1.61-1+b1 +dirmngr==2.1.18-8~deb9u4 +distro-info-data==0.36 +dkms==2.3-2 +dmeventd==2:1.02.137-2 +dmsetup==2:1.02.137-2 +dnsutils==1:9.10.3.dfsg.P4-12.3+deb9u12 +docbook-xml==4.5-8 +docbook-xsl==1.79.1+dfsg-2 +docker-ce==5:18.09.5~3-0~debian-stretch +docker-ce-cli==5:18.09.5~3-0~debian-stretch +docutils-common==0.13.1+dfsg-2 +docutils-doc==0.13.1+dfsg-2 +dosfstools==4.1-1 +doxygen==1.8.13-4+b1 +dpatch==2.0.38+nmu1~bpo9+1 +dpkg-dev==1.18.26 +dput==0.12.1 +dwz==0.12-1+b1 +eatmydata==105-5 +emacsen-common==2.0.8 +equivs==2.0.9+nmu1 +exim4==4.89-2+deb9u8 +exim4-base==4.89-2+deb9u8 +exim4-config==4.89-2+deb9u8 +exim4-daemon-light==4.89-2+deb9u8 +expat==2.2.0-2+deb9u5 +exuberant-ctags==1:5.9~svn20110310-11 +fakeroot==1.21-3.1 +file==1:5.30-1+deb9u3 +flex==2.6.1-1.3 +fontconfig==2.11.0-6.7+b1 +fontconfig-config==2.11.0-6.7 +fonts-dejavu-core==2.37-1 +fonts-dejavu-extra==2.37-1 +fonts-droid-fallback==1:6.0.1r16-1.1 +fonts-font-awesome==4.7.0~dfsg-1 +fonts-lato==2.0-1 +fonts-liberation==1:1.07.4-2 +fonts-lmodern==2.004.5-3 +fonts-noto-mono==20161116-1 +fonts-texgyre==20160520-1 +fop==1:2.1-6 +g++==4:6.3.0-4 +g++-6==6.3.0-18+deb9u1 +gawk==1:4.1.4+dfsg-1 +gcc==4:6.3.0-4 +gcc-6==6.3.0-18+deb9u1 +gcc-6-multilib==6.3.0-18+deb9u1 +gcc-multilib==4:6.3.0-4 +gcovr==3.3-1 +gdb==7.12-6 +gem2deb==0.33.1 +gem2deb-test-runner==0.33.1 +geoip-database==20170512-1 +gettext==0.19.8.1-2+deb9u1 +gettext-base==0.19.8.1-2+deb9u1 +ghostscript==9.26a~dfsg-0+deb9u9 +gir1.2-glib-2.0==1.50.0-1+b1 +gir1.2-packagekitglib-1.0==1.1.5-2+deb9u2 +git==1:2.11.0-3+deb9u7 +git-buildpackage==0.8.12.2 +git-man==1:2.11.0-3+deb9u7 +glib-networking==2.50.0-1+deb9u1 +glib-networking-common==2.50.0-1+deb9u1 +glib-networking-services==2.50.0-1+deb9u1 +gnome-icon-theme==3.12.0-2 +gnupg==2.1.18-8~deb9u4 +gnupg-agent==2.1.18-8~deb9u4 +gnupg-l10n==2.1.18-8~deb9u4 +gnupg2==2.1.18-8~deb9u4 +googletest==1.8.0-6 +graphviz==2.38.0-17+deb9u1 +groff==1.22.3-9 +groff-base==1.22.3-9 +gsettings-desktop-schemas==3.22.0-1 +gsfonts==1:8.11+urwcyr1.0.7~pre44-4.3 +gtk-update-icon-cache==3.22.11-1 +guile-2.0-libs==2.0.13+1-4 +hicolor-icon-theme==0.15-1 +icc-profiles-free==2.0.1+dfsg-1 +icu-devtools==57.1-6+deb9u5 +imagemagick==8:6.9.7.4+dfsg-11+deb9u14 +imagemagick-6-common==8:6.9.7.4+dfsg-11+deb9u14 +imagemagick-6.q16==8:6.9.7.4+dfsg-11+deb9u14 +install-info==6.3.0.dfsg.1-1+b2 +intltool-debian==0.35.0+20060710.4 +iptables==1.6.0+snapshot20161117-6 +iptables-dev==1.6.0+snapshot20161117-6 +ipxe-qemu==1.0.0+git-20161027.b991c67-1 +iso-codes==3.75-1 +java-common==0.58+deb9u1 +java-wrappers==0.1.28 +javahelper==0.59 +javascript-common==11 +junit==3.8.2-8 +junit4==4.12-4+deb9u1 +kernel-wedge==2.96 +kmod==23-2 +krb5-locales==1.15-1+deb9u3 +less==481-2.1 +lib32asan3==6.3.0-18+deb9u1 +lib32atomic1==6.3.0-18+deb9u1 +lib32cilkrts5==6.3.0-18+deb9u1 +lib32gcc-6-dev==6.3.0-18+deb9u1 +lib32gcc1==1:6.3.0-18+deb9u1 +lib32gomp1==6.3.0-18+deb9u1 +lib32itm1==6.3.0-18+deb9u1 +lib32mpx2==6.3.0-18+deb9u1 +lib32quadmath0==6.3.0-18+deb9u1 +lib32stdc++6==6.3.0-18+deb9u1 +lib32ubsan0==6.3.0-18+deb9u1 +libaio1==0.3.110-3 +libalgorithm-diff-perl==1.19.03-1 +libalgorithm-diff-xs-perl==0.04-4+b2 +libalgorithm-merge-perl==0.08-3 +libann0==1.1.2+doc-6 +libaopalliance-java==20070526-5 +libapache-pom-java==10-2 +libapparmor1==2.11.0-3+deb9u2 +libapt-inst2.0==1.4.11 +libapt-pkg-perl==0.1.32 +libarchive-zip-perl==1.59-1+deb9u1 +libarchive13==3.2.2-2+deb9u3 +libasan3==6.3.0-18+deb9u1 +libasm-java==5.2-2 +libasound2==1.1.3-5 +libasound2-data==1.1.3-5 +libaspell15==0.60.7~20110707-3+deb9u1 +libassuan0==2.4.3-2 +libasyncns0==0.8-6 +libatinject-jsr330-api-java==1.0+ds1-2 +libatk-bridge2.0-0==2.22.0-2 +libatk-wrapper-java==0.33.3-13+deb9u1 +libatk-wrapper-java-jni==0.33.3-13+deb9u1 +libatk1.0-0==2.22.0-1 +libatk1.0-data==2.22.0-1 +libatm1==1:2.5.1-2 +libatm1-dev==1:2.5.1-2 +libatomic1==6.3.0-18+deb9u1 +libatspi2.0-0==2.22.0-6+deb9u1 +libaudio2==1.9.4-5+b1 +libaudit-dev==1:2.6.7-2 +libaugeas0==1.8.0-1+deb9u1 +libauthen-sasl-perl==2.1600-1 +libavahi-client3==0.6.32-2+deb9u1 +libavahi-common-data==0.6.32-2+deb9u1 +libavahi-common3==0.6.32-2+deb9u1 +libavalon-framework-java==4.2.0-9 +libb-hooks-endofscope-perl==0.21-1 +libbabeltrace-ctf-dev==1.5.1-1 +libbabeltrace-ctf1==1.5.1-1 +libbabeltrace-dev==1.5.1-1 +libbabeltrace1==1.5.1-1 +libbatik-java==1.8-4+deb9u2 +libbind-export-dev==1:9.10.3.dfsg.P4-12.3+deb9u12 +libbind9-140==1:9.10.3.dfsg.P4-12.3+deb9u12 +libbison-dev==2:3.0.4.dfsg-1+b1 +libbit-vector-perl==7.4-1+b2 +libbluetooth3==5.43-2+deb9u5 +libboost-all-dev==1.62.0.1 +libboost-atomic-dev==1.62.0.1 +libboost-atomic1.62-dev==1.62.0+dfsg-4 +libboost-atomic1.62.0==1.62.0+dfsg-4 +libboost-chrono-dev==1.62.0.1 +libboost-chrono1.62-dev==1.62.0+dfsg-4 +libboost-chrono1.62.0==1.62.0+dfsg-4 +libboost-context-dev==1.62.0.1 +libboost-context1.62-dev==1.62.0+dfsg-4 +libboost-context1.62.0==1.62.0+dfsg-4 +libboost-coroutine-dev==1.62.0.1 +libboost-coroutine1.62-dev==1.62.0+dfsg-4 +libboost-coroutine1.62.0==1.62.0+dfsg-4 +libboost-date-time-dev==1.62.0.1 +libboost-date-time1.62-dev==1.62.0+dfsg-4 +libboost-date-time1.62.0==1.62.0+dfsg-4 +libboost-dev==1.62.0.1 +libboost-exception-dev==1.62.0.1 +libboost-exception1.62-dev==1.62.0+dfsg-4 +libboost-fiber-dev==1.62.0.1 +libboost-fiber1.62-dev==1.62.0+dfsg-4 +libboost-fiber1.62.0==1.62.0+dfsg-4 +libboost-filesystem-dev==1.62.0.1 +libboost-filesystem1.62-dev==1.62.0+dfsg-4 +libboost-filesystem1.62.0==1.62.0+dfsg-4 +libboost-graph-dev==1.62.0.1 +libboost-graph-parallel-dev==1.62.0.1 +libboost-graph-parallel1.62-dev==1.62.0+dfsg-4 +libboost-graph-parallel1.62.0==1.62.0+dfsg-4 +libboost-graph1.62-dev==1.62.0+dfsg-4 +libboost-graph1.62.0==1.62.0+dfsg-4 +libboost-iostreams-dev==1.62.0.1 +libboost-iostreams1.62-dev==1.62.0+dfsg-4 +libboost-iostreams1.62.0==1.62.0+dfsg-4 +libboost-locale-dev==1.62.0.1 +libboost-locale1.62-dev==1.62.0+dfsg-4 +libboost-locale1.62.0==1.62.0+dfsg-4 +libboost-log-dev==1.62.0.1 +libboost-log1.62-dev==1.62.0+dfsg-4 +libboost-log1.62.0==1.62.0+dfsg-4 +libboost-math-dev==1.62.0.1 +libboost-math1.62-dev==1.62.0+dfsg-4 +libboost-math1.62.0==1.62.0+dfsg-4 +libboost-mpi-dev==1.62.0.1 +libboost-mpi-python-dev==1.62.0.1 +libboost-mpi-python1.62-dev==1.62.0+dfsg-4 +libboost-mpi-python1.62.0==1.62.0+dfsg-4 +libboost-mpi1.62-dev==1.62.0+dfsg-4 +libboost-mpi1.62.0==1.62.0+dfsg-4 +libboost-program-options-dev==1.62.0.1 +libboost-program-options1.62-dev==1.62.0+dfsg-4 +libboost-program-options1.62.0==1.62.0+dfsg-4 +libboost-python-dev==1.62.0.1 +libboost-python1.62-dev==1.62.0+dfsg-4 +libboost-python1.62.0==1.62.0+dfsg-4 +libboost-random-dev==1.62.0.1 +libboost-random1.62-dev==1.62.0+dfsg-4 +libboost-random1.62.0==1.62.0+dfsg-4 +libboost-regex-dev==1.62.0.1 +libboost-regex1.62-dev==1.62.0+dfsg-4 +libboost-regex1.62.0==1.62.0+dfsg-4 +libboost-serialization-dev==1.62.0.1 +libboost-serialization1.62-dev==1.62.0+dfsg-4 +libboost-serialization1.62.0==1.62.0+dfsg-4 +libboost-signals-dev==1.62.0.1 +libboost-signals1.62-dev==1.62.0+dfsg-4 +libboost-signals1.62.0==1.62.0+dfsg-4 +libboost-system-dev==1.62.0.1 +libboost-system1.62-dev==1.62.0+dfsg-4 +libboost-system1.62.0==1.62.0+dfsg-4 +libboost-test-dev==1.62.0.1 +libboost-test1.62-dev==1.62.0+dfsg-4 +libboost-test1.62.0==1.62.0+dfsg-4 +libboost-thread-dev==1.62.0.1 +libboost-thread1.62-dev==1.62.0+dfsg-4 +libboost-thread1.62.0==1.62.0+dfsg-4 +libboost-timer-dev==1.62.0.1 +libboost-timer1.62-dev==1.62.0+dfsg-4 +libboost-timer1.62.0==1.62.0+dfsg-4 +libboost-tools-dev==1.62.0.1 +libboost-type-erasure-dev==1.62.0.1 +libboost-type-erasure1.62-dev==1.62.0+dfsg-4 +libboost-type-erasure1.62.0==1.62.0+dfsg-4 +libboost-wave-dev==1.62.0.1 +libboost-wave1.62-dev==1.62.0+dfsg-4 +libboost-wave1.62.0==1.62.0+dfsg-4 +libboost1.62-dev==1.62.0+dfsg-4 +libboost1.62-tools-dev==1.62.0+dfsg-4 +libbrlapi0.6==5.4-7+deb9u1 +libbsd-dev==0.8.3-1+deb9u1 +libbsd0==0.8.3-1+deb9u1 +libbsf-java==1:2.4.0-5 +libbsh-java==2.0b4-18 +libc-ares-dev==1.12.0-1+deb9u2 +libc-ares2==1.12.0-1+deb9u2 +libc-dev-bin==2.24-11+deb9u4 +libc6-dbg==2.24-11+deb9u4 +libc6-dev==2.24-11+deb9u4 +libc6-dev-i386==2.24-11+deb9u4 +libc6-dev-x32==2.24-11+deb9u4 +libc6-i386==2.24-11+deb9u4 +libc6-x32==2.24-11+deb9u4 +libcaca0==0.99.beta19-2.1~deb9u2 +libcacard0==1:2.5.0-3 +libcairo-gobject2==1.14.8-1+deb9u1 +libcairo2==1.14.8-1+deb9u1 +libcap-dev==1:2.25-1 +libcap-ng-dev==0.7.7-3+b1 +libcap2-bin==1:2.25-1 +libcarp-clan-perl==6.06-1 +libcc1-0==6.3.0-18+deb9u1 +libcdi-api-java==1.0-2 +libcdt5==2.38.0-17+deb9u1 +libcgi-fast-perl==1:2.12-1 +libcgi-pm-perl==4.35-1 +libcglib-java==3.2.4-1 +libcgmanager0==0.41-2 +libcgraph6==2.38.0-17+deb9u1 +libcilkrts5==6.3.0-18+deb9u1 +libclang-common-3.8-dev==1:3.8.1-24 +libclang1-3.8==1:3.8.1-24 +libclang1-3.9==1:3.9.1-9 +libclass-accessor-perl==0.34-1 +libclass-inspector-perl==1.31-1 +libclass-method-modifiers-perl==2.12-1 +libclass-xsaccessor-perl==1.19-2+b7 +libclassworlds-java==1.1-final-5 +libclone-perl==0.38-2+b1 +libcmocka-dev==1.0.1-3 +libcmocka0==1.0.1-3 +libcolord2==1.3.3-2 +libcommons-beanutils-java==1.9.3-1 +libcommons-cli-java==1.3.1-3 +libcommons-codec-java==1.10-1 +libcommons-collections3-java==3.2.2-1 +libcommons-configuration-java==1.10-4 +libcommons-digester-java==1.8.1-4 +libcommons-httpclient-java==3.1-12 +libcommons-io-java==2.5-1+deb9u1 +libcommons-lang-java==2.6-6 +libcommons-lang3-java==3.5-1 +libcommons-logging-java==1.2-1 +libcommons-net-java==3.5-1 +libcommons-parent-java==39-3 +libcommons-validator-java==1:1.5.1-1 +libconvert-binhex-perl==1.125-1 +libcroco3==0.6.11-3 +libcryptsetup4==2:1.7.3-4 +libcups2==2.2.1-8+deb9u8 +libcupsfilters1==1.11.6-3+deb9u1 +libcupsimage2==2.2.1-8+deb9u8 +libcurl3==7.52.1-5+deb9u16 +libcurl3-gnutls==7.52.1-5+deb9u16 +libcurl3-nss==7.52.1-5+deb9u16 +libcurl4-nss-dev==7.52.1-5+deb9u16 +libdaemon-dev==0.14-6 +libdaemon0==0.14-6 +libdata-optlist-perl==0.110-1 +libdatrie1==0.2.10-4+b1 +libdb-dev==5.3.1 +libdb5.3-dev==5.3.28-12+deb9u1 +libdbi1==0.9.0-4+deb9u2 +libdbus-1-3==1.10.32-0+deb9u1 +libdbus-1-dev==1.10.32-0+deb9u1 +libdbus-glib-1-2==0.108-2 +libdconf1==0.26.0-2+b1 +libdevel-globaldestruction-perl==0.14-1 +libdevmapper-event1.02.1==2:1.02.137-2 +libdevmapper1.02.1==2:1.02.137-2 +libdigest-hmac-perl==1.03+dfsg-1 +libdistro-info-perl==0.14 +libdjvulibre-text==3.5.27.1-7+deb9u2 +libdjvulibre21==3.5.27.1-7+deb9u2 +libdns-export162==1:9.10.3.dfsg.P4-12.3+deb9u12 +libdns162==1:9.10.3.dfsg.P4-12.3+deb9u12 +libdom4j-java==1.6.1+dfsg.3-2+deb9u1 +libdouble-conversion1==2.0.1-4 +libdoxia-core-java==1.1.4-6 +libdoxia-java==1.1.4-6 +libdoxia-sitetools-java==1.1.4-1.1 +libdpkg-perl==1.18.26 +libdrm-amdgpu1==2.4.74-1 +libdrm-dev==2.4.74-1 +libdrm-intel1==2.4.74-1 +libdrm-nouveau2==2.4.74-1 +libdrm-radeon1==2.4.74-1 +libdrm2==2.4.74-1 +libdw-dev==0.168-1+deb9u1 +libdw1==0.168-1+deb9u1 +libeasymock-java==3.4+ds-1 +libeatmydata1==105-5 +libeclipse-aether-java==1.0.2-1 +libedit-dev==3.1-20160903-3 +libedit2==3.1-20160903-3 +libegl1-mesa==13.0.6-1+b2 +libelf-dev==0.168-1+deb9u1 +libemail-valid-perl==1.202-1 +libencode-locale-perl==1.05-1 +libepoxy0==1.3.1-2 +liberror-perl==0.17024-1 +libestr0==0.1.10-2 +libevdev2==1.5.6+dfsg-1 +libevent-2.0-5==2.0.21-stable-3 +libevent-core-2.0-5==2.0.21-stable-3 +libevent-dev==2.0.21-stable-3 +libevent-extra-2.0-5==2.0.21-stable-3 +libevent-openssl-2.0-5==2.0.21-stable-3 +libevent-pthreads-2.0-5==2.0.21-stable-3 +libexpat1==2.2.0-2+deb9u5 +libexpat1-dev==2.2.0-2+deb9u5 +libexplain-dev==1.4.D001-6 +libexplain51==1.4.D001-6 +libexporter-tiny-perl==0.042-1 +libfabric1==1.4.0-1 +libfakeroot==1.21-3.1 +libfastjson4==0.99.4-1 +libfcgi-perl==0.78-2 +libfdt1==1.4.2-1 +libffi-dev==3.2.1-6 +libffi6==3.2.1-6 +libfftw3-double3==3.3.5-3 +libfile-basedir-perl==0.07-1 +libfile-chdir-perl==0.1008-1 +libfile-desktopentry-perl==0.22-1 +libfile-fcntllock-perl==0.22-3+b2 +libfile-homedir-perl==1.00-1 +libfile-listing-perl==6.04-1 +libfile-mimeinfo-perl==0.27-1 +libfile-stripnondeterminism-perl==0.034-1 +libfile-which-perl==1.21-1 +libfl-dev==2.6.1-1.3 +libflac8==1.3.2-2+deb9u2 +libfont-afm-perl==1.20-2 +libfontbox-java==1:1.8.12-1 +libfontconfig1==2.11.0-6.7+b1 +libfontenc1==1:1.1.3-1+b2 +libfop-java==1:2.1-6 +libfreetype6==2.6.3-3.2+deb9u2 +libfribidi0==0.19.7-1+deb9u2 +libgail-common==2.24.31-2 +libgail18==2.24.31-2 +libgbm1==13.0.6-1+b2 +libgc1c2==1:7.4.2-8+deb9u1 +libgcc-6-dev==6.3.0-18+deb9u1 +libgd3==2.2.4-2+deb9u5 +libgdbm3==1.8.3-14 +libgdk-pixbuf2.0-0==2.36.5-2+deb9u2 +libgdk-pixbuf2.0-common==2.36.5-2+deb9u2 +libgeoip1==1.6.9-4 +libgeronimo-interceptor-3.0-spec-java==1.0.1-3 +libgetopt-long-descriptive-perl==0.100-1 +libgfortran3==6.3.0-18+deb9u1 +libgif7==5.1.4-0.4 +libgirepository-1.0-1==1.50.0-1+b1 +libgit-wrapper-perl==0.047-1 +libgl1-mesa-dev==13.0.6-1+b2 +libgl1-mesa-dri==13.0.6-1+b2 +libgl1-mesa-glx==13.0.6-1+b2 +libglapi-mesa==13.0.6-1+b2 +libglew2.0==2.0.0-3+b1 +libglib2.0-0==2.50.3-2+deb9u3 +libglib2.0-bin==2.50.3-2+deb9u3 +libglib2.0-data==2.50.3-2+deb9u3 +libglib2.0-dev==2.50.3-2+deb9u3 +libglu1-mesa==9.0.0-2.1 +libglu1-mesa-dev==9.0.0-2.1 +libgmp-dev==2:6.1.2+dfsg-1+deb9u1 +libgmp10==2:6.1.2+dfsg-1+deb9u1 +libgmpxx4ldbl==2:6.1.2+dfsg-1+deb9u1 +libgnutls30==3.5.8-5+deb9u6 +libgomp1==6.3.0-18+deb9u1 +libgoogle-perftools4==2.5-2.2 +libgpgme11==1.8.0-3+b2 +libgpm2==1.20.4-6.2+b1 +libgraphite2-3==1.3.10-1 +libgs9==9.26a~dfsg-0+deb9u9 +libgs9-common==9.26a~dfsg-0+deb9u9 +libgsasl7==1.8.0-8+b2 +libgssapi-krb5-2==1.15-1+deb9u3 +libgstreamer1.0-0==1.10.4-1 +libgtest-dev==1.8.0-6 +libgtk-3-0==3.22.11-1 +libgtk-3-bin==3.22.11-1 +libgtk-3-common==3.22.11-1 +libgtk2.0-0==2.24.31-2 +libgtk2.0-bin==2.24.31-2 +libgtk2.0-common==2.24.31-2 +libgts-0.7-5==0.7.6+darcs121130-4 +libgts-bin==0.7.6+darcs121130-4 +libguava-java==19.0-1 +libgudev-1.0-0==230-3 +libguice-java==4.0-3 +libgvc6==2.38.0-17+deb9u1 +libgvpr2==2.38.0-17+deb9u1 +libhamcrest-java==1.3-6 +libharfbuzz-icu0==1.4.2-1 +libharfbuzz0b==1.4.2-1 +libhogweed4==3.3-1+deb9u1 +libhtml-form-perl==6.03-1 +libhtml-format-perl==2.12-1 +libhtml-parser-perl==3.72-3 +libhtml-tagset-perl==3.20-3 +libhtml-tree-perl==5.03-2 +libhttp-cookies-perl==6.01-1 +libhttp-daemon-perl==6.01-1 +libhttp-date-perl==6.02-1 +libhttp-message-perl==6.11-1 +libhttp-negotiate-perl==6.00-2 +libhttpclient-java==4.5.2-2+deb9u1 +libhttpcore-java==4.4.6-1 +libhwloc-dev==1.11.5-1 +libhwloc-plugins==1.11.5-1 +libhwloc5==1.11.5-1 +libiberty-dev==20161220-1 +libibverbs-dev==1.2.1-2 +libibverbs1==1.2.1-2 +libice-dev==2:1.0.9-2 +libice6==2:1.0.9-2 +libicu-dev==57.1-6+deb9u5 +libicu57==57.1-6+deb9u5 +libidn2-0==0.16-1+deb9u1 +libijs-0.35==0.35-12 +libilmbase12==2.2.0-12 +libimport-into-perl==1.002005-1 +libinput-bin==1.6.3-1 +libinput10==1.6.3-1 +libio-html-perl==1.001-1 +libio-pty-perl==1:1.08-1.1+b2 +libio-sessiondata-perl==1.03-1 +libio-socket-inet6-perl==2.72-2 +libio-socket-ssl-perl==2.044-1 +libio-string-perl==1.08-3 +libio-stringy-perl==2.111-2 +libip4tc-dev==1.6.0+snapshot20161117-6 +libip4tc0==1.6.0+snapshot20161117-6 +libip6tc-dev==1.6.0+snapshot20161117-6 +libip6tc0==1.6.0+snapshot20161117-6 +libipc-run-perl==0.94-1+deb9u1 +libipc-system-simple-perl==1.25-3 +libiptc-dev==1.6.0+snapshot20161117-6 +libiptc0==1.6.0+snapshot20161117-6 +libirs-export141==1:9.10.3.dfsg.P4-12.3+deb9u12 +libisc-export160==1:9.10.3.dfsg.P4-12.3+deb9u12 +libisc160==1:9.10.3.dfsg.P4-12.3+deb9u12 +libisccc-export140==1:9.10.3.dfsg.P4-12.3+deb9u12 +libisccc140==1:9.10.3.dfsg.P4-12.3+deb9u12 +libisccfg-export140==1:9.10.3.dfsg.P4-12.3+deb9u12 +libisccfg140==1:9.10.3.dfsg.P4-12.3+deb9u12 +libisl15==0.18-1 +libisorelax-java==20041111-9 +libitext1-java==1.4-6 +libitm1==6.3.0-18+deb9u1 +libjansson-dev==2.9-1 +libjansson4==2.9-1 +libjaxen-java==1.1.6-1+deb9u1 +libjaxp1.3-java==1.3.05-2 +libjbig0==2.1-3.1+b2 +libjbig2dec0==0.13-4.1+deb9u1 +libjdom1-java==1.1.3-1+deb9u1 +libjemalloc-dev==3.6.0-9.1 +libjemalloc1==3.6.0-9.1 +libjetty9-java==9.2.30-0+deb9u2 +libjline-java==1.0-2 +libjpeg62-turbo==1:1.5.1-2+deb9u2 +libjs-bootstrap==3.3.7+dfsg-2+deb9u2 +libjs-jquery==3.1.1-2+deb9u2 +libjs-jquery-hotkeys==0~20130707+git2d51e3a9+dfsg-2 +libjs-jquery-isonscreen==1.2.0-1 +libjs-jquery-metadata==11-3 +libjs-jquery-tablesorter==11-3 +libjs-jquery-throttle-debounce==1.1+dfsg.1-1 +libjs-modernizr==2.6.2+ds1-1 +libjs-sphinxdoc==1.4.9-2 +libjs-twitter-bootstrap==2.0.2+dfsg-10 +libjs-underscore==1.8.3~dfsg-1+deb9u1 +libjsch-java==0.1.54-1 +libjson-c-dev==0.12.1-1.1+deb9u1 +libjson-c3==0.12.1-1.1+deb9u1 +libjson-glib-1.0-0==1.2.6-1 +libjson-glib-1.0-common==1.2.6-1 +libjsoncpp1==1.7.4-3 +libjsoup-java==1.10.2-1 +libjsr305-java==0.1~+svn49-10 +libjtidy-java==7+svn20110807-4 +libjudy-dev==1.0.5-5 +libjudydebian1==1.0.5-5 +libjxr-tools==1.1-6+b1 +libjxr0==1.1-6+b1 +libjzlib-java==1.1.3-1 +libk5crypto3==1.15-1+deb9u3 +libkeyutils1==1.5.9-9 +libkmod2==23-2 +libkpathsea6==2016.20160513.41080.dfsg-2+deb9u1 +libkrb5-3==1.15-1+deb9u3 +libkrb5support0==1.15-1+deb9u3 +libksba8==1.3.5-2 +libkyotocabinet16v5==1.2.76-4.2+b1 +liblcms2-2==2.8-4+deb9u1 +libldap-2.4-2==2.4.44+dfsg-5+deb9u9 +libldap-common==2.4.44+dfsg-5+deb9u9 +libldap2-dev==2.4.44+dfsg-5+deb9u9 +liblist-compare-perl==0.53-1 +liblist-moreutils-perl==0.416-1+b1 +libllvm3.8==1:3.8.1-24 +libllvm3.9==1:3.9.1-9 +liblocale-gettext-perl==1.07-3+b1 +liblog4j1.2-java==1.2.17-7+deb9u2 +liblogging-stdlog0==1.0.5-2+b2 +liblognorm5==2.0.1-1.1+b1 +liblqr-1-0==0.4.2-2+b2 +liblsan0==6.3.0-18+deb9u1 +libltdl-dev==2.4.6-2 +libltdl7==2.4.6-2 +liblua5.1-0==5.1.5-8.1+b2 +liblua5.1-0-dev==5.1.5-8.1+b2 +liblvm2app2.2==2.02.168-2 +liblvm2cmd2.02==2.02.168-2 +liblwp-mediatypes-perl==6.02-1 +liblwp-protocol-https-perl==6.06-2 +liblwres141==1:9.10.3.dfsg.P4-12.3+deb9u12 +liblzo2-2==2.08-1.2+b2 +liblzo2-dev==2.08-1.2+b2 +libmagic-mgc==1:5.30-1+deb9u3 +libmagic1==1:5.30-1+deb9u3 +libmagickcore-6.q16-3==8:6.9.7.4+dfsg-11+deb9u14 +libmagickcore-6.q16-3-extra==8:6.9.7.4+dfsg-11+deb9u14 +libmagickwand-6.q16-3==8:6.9.7.4+dfsg-11+deb9u14 +libmail-sendmail-perl==0.79.16-2 +libmailtools-perl==2.18-1 +libmailutils5==1:3.1.1-1 +libmariadbclient-dev==10.1.48-0+deb9u2 +libmariadbclient-dev-compat==10.1.48-0+deb9u2 +libmariadbclient18==10.1.48-0+deb9u2 +libmaven-ant-tasks-java==2.1.3-4 +libmaven-archiver-java==2.6-3 +libmaven-clean-plugin-java==2.5-1 +libmaven-common-artifact-filters-java==1.4-1 +libmaven-compiler-plugin-java==3.2-5 +libmaven-doxia-tools-java==1.2.1-2 +libmaven-filtering-java==1.1-1 +libmaven-jar-plugin-java==2.4-1 +libmaven-parent-java==21-2 +libmaven-plugin-tools-java==3.3-5 +libmaven-reporting-impl-java==2.3-1 +libmaven-resources-plugin-java==2.6-1 +libmaven-shared-incremental-java==1.1-1 +libmaven-shared-utils-java==3.0.0-1+deb9u1 +libmaven-site-plugin-java==2.1-4 +libmaven2-core-java==2.2.1-26 +libmaven3-core-java==3.3.9-4 +libmime-tools-perl==5.508-1 +libmng1==1.0.10+dfsg-3.1+b5 +libmnl-dev==1.0.4-2 +libmodule-implementation-perl==0.09-1 +libmodule-runtime-perl==0.014-2 +libmoo-perl==2.002005-1 +libmpc3==1.0.3-1+b2 +libmpdec2==2.4.2-1 +libmpfr4==3.1.5-1 +libmpx2==6.3.0-18+deb9u1 +libmsv-java==2009.1+dfsg1-5 +libmtdev1==1.1.5-1+b1 +libnamespace-clean-perl==0.27-1 +libnanomsg-dev==0.8~beta+dfsg-1+b1 +libnanomsg4==0.8~beta+dfsg-1+b1 +libncurses5==6.0+20161126-1+deb9u2 +libncurses5-dev==6.0+20161126-1+deb9u2 +libnet-dbus-perl==1.1.0-4+b1 +libnet-dns-perl==1.07-1 +libnet-domain-tld-perl==1.75-1 +libnet-http-perl==6.12-1 +libnet-ip-perl==1.26-1 +libnet-smtp-ssl-perl==1.04-1 +libnet-ssleay-perl==1.80-1 +libnetfilter-conntrack-dev==1.0.6-2 +libnetfilter-conntrack3==1.0.6-2 +libnetpbm10==2:10.0-15.3+b2 +libnewt-dev==0.52.19-1+b1 +libnewt0.52==0.52.19-1+b1 +libnfnetlink-dev==1.0.1-3 +libnfnetlink0==1.0.1-3 +libnftnl-dev==1.0.7-1 +libnftnl4==1.0.7-1 +libnghttp2-14==1.18.1-1+deb9u2 +libnih-dbus1==1.0.3-8 +libnih1==1.0.3-8 +libnl-3-200==3.2.27-2 +libnl-route-3-200==3.2.27-2 +libnpth0==1.3-1 +libnspr4==2:4.12-6 +libnss3==2:3.26.2-1.1+deb9u5 +libntlm0==1.4-8+deb9u1 +libnuma-dev==2.0.11-2.1 +libnuma1==2.0.11-2.1 +libnumber-compare-perl==0.03-1 +libnumber-range-perl==0.12-1 +libobjc-6-dev==6.3.0-18+deb9u1 +libobjc4==6.3.0-18+deb9u1 +libobjenesis-java==2.5.1-1 +libogg0==1.3.2-1 +libopenexr22==2.2.0-11+deb9u4 +libopenjp2-7==2.1.2-1.1+deb9u7 +libopenmpi-dev==2.0.2-2 +libopenmpi2==2.0.2-2 +libopus0==1.2~alpha2-1 +liboro-java==2.0.8a-12 +libosp5==1.5.2-13+b1 +libossp-uuid-perl==1.6.2-1.5+b4 +libossp-uuid16==1.6.2-1.5+b4 +libp11-kit0==0.23.3-2+deb9u1 +libpackage-stash-perl==0.37-1 +libpackage-stash-xs-perl==0.28-3+b1 +libpackagekit-glib2-18==1.1.5-2+deb9u2 +libpam-cap==1:2.25-1 +libpam-systemd==232-25+deb9u14 +libpam0g-dev==1.1.8-3.6 +libpango-1.0-0==1.40.5-1 +libpangocairo-1.0-0==1.40.5-1 +libpangoft2-1.0-0==1.40.5-1 +libpaper-utils==1.1.24+nmu5 +libpaper1==1.1.24+nmu5 +libparams-classify-perl==0.013-6+b1 +libparams-util-perl==1.07-3+b1 +libparams-validate-perl==1.26-1 +libparse-debianchangelog-perl==1.2.0-12 +libpath-iterator-rule-perl==1.009-1 +libpath-tiny-perl==0.100-1 +libpathplan4==2.38.0-17+deb9u1 +libpcap-dev==1.8.1-3+deb9u1 +libpcap0.8==1.8.1-3+deb9u1 +libpcap0.8-dev==1.8.1-3+deb9u1 +libpci-dev==1:3.5.2-1 +libpci3==1:3.5.2-1 +libpciaccess0==0.13.4-1+b2 +libpcre16-3==2:8.39-3 +libpcre3-dev==2:8.39-3 +libpcre32-3==2:8.39-3 +libpcrecpp0v5==2:8.39-3 +libpcsclite1==1.8.20-1 +libperl-dev==5.24.1-3+deb9u7 +libperl5.24==5.24.1-3+deb9u7 +libperlio-gzip-perl==0.19-1+b2 +libpgm-5.2-0==5.2.122~dfsg-2 +libpipeline1==1.4.1-2 +libpixman-1-0==0.34.0-1 +libplexus-ant-factory-java==1.0~alpha2.1-3 +libplexus-archiver-java==2.2-1+deb9u1 +libplexus-bsh-factory-java==1.0~alpha7-3.1 +libplexus-build-api-java==0.0.7-1 +libplexus-cipher-java==1.7-1 +libplexus-classworlds-java==1.5.0-5 +libplexus-classworlds2-java==2.5.2-1 +libplexus-cli-java==1.2-5 +libplexus-compiler-java==2.4-3 +libplexus-component-annotations-java==1.6-3 +libplexus-component-metadata-java==1.6-3 +libplexus-container-default-java==1.0-alpha-9-stable-1-7 +libplexus-container-default1.5-java==1.6-3 +libplexus-containers-java==1.0~beta3.0.7-8 +libplexus-containers1.5-java==1.6-3 +libplexus-i18n-java==1.0-beta-10-3 +libplexus-interactivity-api-java==1.0-alpha-6-7 +libplexus-interpolation-java==1.21-1 +libplexus-io-java==1.0~alpha5-2 +libplexus-sec-dispatcher-java==1.3.1-6 +libplexus-utils-java==1:1.5.15-4+deb9u1 +libplexus-utils2-java==3.0.22-1 +libplexus-velocity-java==1.2-1 +libpng-dev==1.6.28-1+deb9u1 +libpng16-16==1.6.28-1+deb9u1 +libpod-constants-perl==0.19-1 +libpolkit-agent-1-0==0.105-18+deb9u2 +libpolkit-backend-1-0==0.105-18+deb9u2 +libpolkit-gobject-1-0==0.105-18+deb9u2 +libpoppler64==0.48.0-2+deb9u4 +libpopt0==1.16-10+b2 +libpotrace0==1.13-3 +libprocps6==2:3.3.12-3+deb9u1 +libprotobuf-dev==3.0.0-9 +libprotobuf-lite10==3.0.0-9 +libprotobuf10==3.0.0-9 +libprotoc10==3.0.0-9 +libproxy1v5==0.4.14-2+deb9u2 +libpsl5==0.17.0-3 +libpsm-infinipath1==3.3+19.g67c0807.open-3 +libptexenc1==2016.20160513.41080.dfsg-2+deb9u1 +libpthread-stubs0-dev==0.3-4 +libpulse0==10.0-1+deb9u1 +libpython-all-dev==2.7.13-2 +libpython-dev==2.7.13-2 +libpython-stdlib==2.7.13-2 +libpython2.7==2.7.13-2+deb9u6 +libpython2.7-dev==2.7.13-2+deb9u6 +libpython2.7-minimal==2.7.13-2+deb9u6 +libpython2.7-stdlib==2.7.13-2+deb9u6 +libpython3-all-dbg==3.5.3-1 +libpython3-all-dev==3.5.3-1 +libpython3-dbg==3.5.3-1 +libpython3-dev==3.5.3-1 +libpython3-stdlib==3.5.3-1 +libpython3.5==3.5.3-1+deb9u5 +libpython3.5-dbg==3.5.3-1+deb9u5 +libpython3.5-dev==3.5.3-1+deb9u5 +libpython3.5-minimal==3.5.3-1+deb9u5 +libpython3.5-stdlib==3.5.3-1+deb9u5 +libqdox-java==1.12.1-2 +libqdox2-java==2.0~M3-3 +libqt4-dbus==4:4.8.7+dfsg-11+deb9u3 +libqt4-declarative==4:4.8.7+dfsg-11+deb9u3 +libqt4-designer==4:4.8.7+dfsg-11+deb9u3 +libqt4-dev==4:4.8.7+dfsg-11+deb9u3 +libqt4-dev-bin==4:4.8.7+dfsg-11+deb9u3 +libqt4-help==4:4.8.7+dfsg-11+deb9u3 +libqt4-network==4:4.8.7+dfsg-11+deb9u3 +libqt4-opengl==4:4.8.7+dfsg-11+deb9u3 +libqt4-opengl-dev==4:4.8.7+dfsg-11+deb9u3 +libqt4-qt3support==4:4.8.7+dfsg-11+deb9u3 +libqt4-script==4:4.8.7+dfsg-11+deb9u3 +libqt4-scripttools==4:4.8.7+dfsg-11+deb9u3 +libqt4-sql==4:4.8.7+dfsg-11+deb9u3 +libqt4-sql-mysql==4:4.8.7+dfsg-11+deb9u3 +libqt4-svg==4:4.8.7+dfsg-11+deb9u3 +libqt4-test==4:4.8.7+dfsg-11+deb9u3 +libqt4-xml==4:4.8.7+dfsg-11+deb9u3 +libqt4-xmlpatterns==4:4.8.7+dfsg-11+deb9u3 +libqt5concurrent5==5.7.1+dfsg-3+deb9u3 +libqt5core5a==5.7.1+dfsg-3+deb9u3 +libqt5dbus5==5.7.1+dfsg-3+deb9u3 +libqt5gui5==5.7.1+dfsg-3+deb9u3 +libqt5network5==5.7.1+dfsg-3+deb9u3 +libqt5opengl5==5.7.1+dfsg-3+deb9u3 +libqt5opengl5-dev==5.7.1+dfsg-3+deb9u3 +libqt5printsupport5==5.7.1+dfsg-3+deb9u3 +libqt5sql5==5.7.1+dfsg-3+deb9u3 +libqt5sql5-sqlite==5.7.1+dfsg-3+deb9u3 +libqt5svg5==5.7.1~20161021-2.1+deb9u1 +libqt5test5==5.7.1+dfsg-3+deb9u3 +libqt5widgets5==5.7.1+dfsg-3+deb9u3 +libqt5xml5==5.7.1+dfsg-3+deb9u3 +libqtcore4==4:4.8.7+dfsg-11+deb9u3 +libqtdbus4==4:4.8.7+dfsg-11+deb9u3 +libqtgui4==4:4.8.7+dfsg-11+deb9u3 +libquadmath0==6.3.0-18+deb9u1 +librdmacm1==1.1.0-2 +libreadline-dev==7.0-3 +libreadline5==5.2+dfsg-3+b1 +libreadline7==7.0-3 +libregexp-assemble-perl==0.36-1 +librelaxng-datatype-java==1.0+ds1-3 +librest-0.7-0==0.8.0-2 +librhash0==1.3.3-1+b2 +librhino-java==1.7.7.1-1 +librole-tiny-perl==2.000005-1 +librrd-dev==1.6.0-1+b2 +librrd8==1.6.0-1+b2 +librsvg2-2==2.40.21-0+deb9u1 +librsvg2-common==2.40.21-0+deb9u1 +librtmp1==2.4+20151223.gitfa8646d.1-1+b1 +libruby2.3==2.3.3-1+deb9u11 +libsasl2-2==2.1.27~101-g0780600+dfsg-3+deb9u2 +libsasl2-modules==2.1.27~101-g0780600+dfsg-3+deb9u2 +libsasl2-modules-db==2.1.27~101-g0780600+dfsg-3+deb9u2 +libsaxon-java==1:6.5.5-10 +libscalar-list-utils-perl==1:1.47-1 +libsdl1.2debian==1.2.15+dfsg1-4+deb9u1 +libseccomp2==2.3.1-2.1+deb9u1 +libselinux1-dev==2.6-3+b3 +libsensors4==1:3.4.0-4 +libsensors4-dev==1:3.4.0-4 +libsepol1-dev==2.6-2 +libservlet3.1-java==8.5.54-0+deb9u8 +libsigsegv2==2.10-5 +libsisu-inject-java==0.3.2-2 +libsisu-plexus-java==0.3.2-1 +libslang2==2.3.1-5 +libslang2-dev==2.3.1-5 +libslf4j-java==1.7.22-1 +libsm-dev==2:1.2.2-1+b3 +libsm6==2:1.2.2-1+b3 +libsndfile1==1.0.27-3+deb9u3 +libsnmp-base==5.7.3+dfsg-1.7+deb9u3 +libsnmp-dev==5.7.3+dfsg-1.7+deb9u3 +libsnmp30==5.7.3+dfsg-1.7+deb9u3 +libsoap-lite-perl==1.20-1 +libsocket6-perl==0.27-1+b1 +libsodium18==1.0.11-2 +libsort-key-perl==1.33-1+b3 +libsort-versions-perl==1.62-1 +libsoup-gnome2.4-1==2.56.0-2+deb9u2 +libsoup2.4-1==2.56.0-2+deb9u2 +libspice-server1==0.12.8-2.1+deb9u4 +libsqlite3-0==3.16.2-5+deb9u3 +libssh2-1==1.7.0-1+deb9u2 +libssl-dev==1.1.0l-1~deb9u6 +libssl1.0.2==1.0.2u-1~deb9u7 +libssl1.1==1.1.0l-1~deb9u6 +libstax-java==1.2.0-3 +libstdc++-6-dev==6.3.0-18+deb9u1 +libstrictures-perl==2.000003-1 +libstring-copyright-perl==0.003005-1 +libstring-escape-perl==2010.002-1 +libsub-exporter-perl==0.986-1 +libsub-exporter-progressive-perl==0.001013-1 +libsub-identify-perl==0.12-2+b1 +libsub-install-perl==0.928-1 +libsub-name-perl==0.21-1 +libsubunit-dev==1.1.0-3 +libsubunit0==1.1.0-3 +libsurefire-java==2.17-3 +libswitch-perl==2.17-2 +libsynctex1==2016.20160513.41080.dfsg-2+deb9u1 +libsys-hostname-long-perl==1.5-1 +libsystemd-dev==232-25+deb9u14 +libsystemd0==232-25+deb9u14 +libtask-weaken-perl==1.04-1 +libtasn1-6==4.10-1.1+deb9u1 +libtcl8.6==8.6.6+dfsg-1+b1 +libtcmalloc-minimal4==2.5-2.2 +libtexlua52==2016.20160513.41080.dfsg-2+deb9u1 +libtexluajit2==2016.20160513.41080.dfsg-2+deb9u1 +libtext-charwidth-perl==0.04-7+b5 +libtext-glob-perl==0.10-1 +libtext-iconv-perl==1.7-5+b4 +libtext-levenshtein-perl==0.13-1 +libtext-unidecode-perl==1.30-1 +libtext-wrapi18n-perl==0.06-7.1 +libthai-data==0.1.26-1 +libthai0==0.1.26-1 +libtie-ixhash-perl==1.23-2 +libtiff5==4.0.8-2+deb9u8 +libtimedate-perl==2.3000-2+deb9u1 +libtinfo-dev==6.0+20161126-1+deb9u2 +libtinyxml2-4==4.0.1-1 +libtinyxml2-dev==4.0.1-1 +libtk8.6==8.6.6-1+b1 +libtool==2.4.6-2 +libtool-bin==2.4.6-2 +libtry-tiny-perl==0.28-1 +libtsan0==6.3.0-18+deb9u1 +libtxc-dxtn-s2tc==1.0+git20151227-2 +libubsan0==6.3.0-18+deb9u1 +libudev-dev==232-25+deb9u14 +libudev1==232-25+deb9u14 +libunicode-utf8-perl==0.60-1+b3 +libunistring0==0.9.6+really0.9.3-0.1 +libunwind-dev==1.1-4.1 +libunwind8==1.1-4.1 +libunwind8-dev==1.1-4.1 +liburi-perl==1.71-1 +libusb-0.1-4==2:0.1.12-30 +libusb-1.0-0==2:1.0.21-1 +libusb-1.0-0-dev==2:1.0.21-1 +libusb-1.0-doc==2:1.0.21-1 +libusb-dev==2:0.1.12-30 +libusbredirparser1==0.7.1-1+deb9u1 +libutempter0==1.1.6-3 +libuv1==1.34.2-1~bpo9+1 +libvariable-magic-perl==0.61-1 +libvdeplug2==2.3.2+r586-2.1 +libvirt-clients==3.0.0-4+deb9u5 +libvirt0==3.0.0-4+deb9u5 +libvorbis0a==1.3.5-4+deb9u3 +libvorbisenc2==1.3.5-4+deb9u3 +libwacom-bin==0.22-1+b1 +libwacom-common==0.22-1 +libwacom2==0.22-1+b1 +libwagon-java==1.0.0-9 +libwagon2-java==2.10-6 +libwayland-client0==1.12.0-1+deb9u1 +libwayland-cursor0==1.12.0-1+deb9u1 +libwayland-egl1-mesa==13.0.6-1+b2 +libwayland-server0==1.12.0-1+deb9u1 +libwebp6==0.5.2-1+deb9u1 +libwebpdemux2==0.5.2-1+deb9u1 +libwebpmux2==0.5.2-1+deb9u1 +libwmf0.2-7==0.2.8.4-10.6 +libwrap0==7.6.q-26 +libwrap0-dev==7.6.q-26 +libwww-perl==6.15-1 +libwww-robotrules-perl==6.01-1 +libx11-6==2:1.6.4-3+deb9u4 +libx11-data==2:1.6.4-3+deb9u4 +libx11-dev==2:1.6.4-3+deb9u4 +libx11-doc==2:1.6.4-3+deb9u4 +libx11-protocol-perl==0.56-7 +libx11-xcb-dev==2:1.6.4-3+deb9u4 +libx11-xcb1==2:1.6.4-3+deb9u4 +libx32asan3==6.3.0-18+deb9u1 +libx32atomic1==6.3.0-18+deb9u1 +libx32cilkrts5==6.3.0-18+deb9u1 +libx32gcc-6-dev==6.3.0-18+deb9u1 +libx32gcc1==1:6.3.0-18+deb9u1 +libx32gomp1==6.3.0-18+deb9u1 +libx32itm1==6.3.0-18+deb9u1 +libx32quadmath0==6.3.0-18+deb9u1 +libx32stdc++6==6.3.0-18+deb9u1 +libx32ubsan0==6.3.0-18+deb9u1 +libxalan2-java==2.7.1-9 +libxapian30==1.4.3-2+deb9u3 +libxau-dev==1:1.0.8-1 +libxau6==1:1.0.8-1 +libxaw7==2:1.0.13-1+b2 +libxbean-java==4.5-4 +libxcb-dri2-0==1.12-1 +libxcb-dri2-0-dev==1.12-1 +libxcb-dri3-0==1.12-1 +libxcb-dri3-dev==1.12-1 +libxcb-glx0==1.12-1 +libxcb-glx0-dev==1.12-1 +libxcb-icccm4==0.4.1-1 +libxcb-image0==0.4.0-1+b2 +libxcb-keysyms1==0.4.0-1+b2 +libxcb-present-dev==1.12-1 +libxcb-present0==1.12-1 +libxcb-randr0==1.12-1 +libxcb-randr0-dev==1.12-1 +libxcb-render-util0==0.3.9-1 +libxcb-render0==1.12-1 +libxcb-render0-dev==1.12-1 +libxcb-shape0==1.12-1 +libxcb-shape0-dev==1.12-1 +libxcb-shm0==1.12-1 +libxcb-sync-dev==1.12-1 +libxcb-sync1==1.12-1 +libxcb-util0==0.3.8-3+b2 +libxcb-xfixes0==1.12-1 +libxcb-xfixes0-dev==1.12-1 +libxcb-xinerama0==1.12-1 +libxcb-xkb1==1.12-1 +libxcb1==1.12-1 +libxcb1-dev==1.12-1 +libxcomposite1==1:0.4.4-2 +libxcursor1==1:1.1.14-1+deb9u2 +libxdamage-dev==1:1.1.4-2+b3 +libxdamage1==1:1.1.4-2+b3 +libxdelta2==1.1.3-9.1+b1 +libxdmcp-dev==1:1.1.2-3 +libxdmcp6==1:1.1.2-3 +libxdot4==2.38.0-17+deb9u1 +libxen-4.8==4.8.5.final+shim4.10.4-1+deb9u12 +libxenstore3.0==4.8.5.final+shim4.10.4-1+deb9u12 +libxerces2-java==2.11.0-7 +libxext-dev==2:1.3.3-1+b2 +libxext6==2:1.3.3-1+b2 +libxfixes-dev==1:5.0.3-1 +libxfixes3==1:5.0.3-1 +libxft2==2.3.2-1+b2 +libxi6==2:1.7.9-1 +libxinerama1==2:1.1.3-1+b3 +libxkbcommon-x11-0==0.7.1-2~deb9u1 +libxkbcommon0==0.7.1-2~deb9u1 +libxml-commons-external-java==1.4.01-2 +libxml-commons-resolver1.1-java==1.2-7 +libxml-libxml-perl==2.0128+dfsg-1+deb9u1 +libxml-namespacesupport-perl==1.11-1 +libxml-parser-perl==2.44-2+b1 +libxml-sax-base-perl==1.07-1 +libxml-sax-expat-perl==0.40-2 +libxml-sax-perl==0.99+dfsg-2 +libxml-simple-perl==2.22-1 +libxml-twig-perl==1:3.50-1 +libxml-xpathengine-perl==0.13-1 +libxml2==2.9.4+dfsg1-2.2+deb9u7 +libxml2-dev==2.9.4+dfsg1-2.2+deb9u7 +libxml2-utils==2.9.4+dfsg1-2.2+deb9u7 +libxmlgraphics-commons-java==2.1-2 +libxmlrpc-lite-perl==0.717-1 +libxmu6==2:1.1.2-2 +libxmuu1==2:1.1.2-2 +libxom-java==1.2.10-1 +libxpm4==1:3.5.12-1 +libxpp2-java==2.1.10-7 +libxpp3-java==1.1.4c-2 +libxrandr2==2:1.5.1-1 +libxrender1==1:0.9.10-1 +libxshmfence-dev==1.2-1+b2 +libxshmfence1==1.2-1+b2 +libxslt1.1==1.1.29-2.1+deb9u2 +libxss1==1:1.2.2-1 +libxt-dev==1:1.1.5-1 +libxt6==1:1.1.5-1 +libxtables-dev==1.6.0+snapshot20161117-6 +libxtables12==1.6.0+snapshot20161117-6 +libxtst6==2:1.2.3-1 +libxv1==2:1.0.11-1 +libxxf86dga1==2:1.1.4-1+b3 +libxxf86vm-dev==1:1.1.4-1+b2 +libxxf86vm1==1:1.1.4-1+b2 +libyajl2==2.1.0-2+b3 +libyaml-0-2==0.1.7-2 +libyaml-dev==0.1.7-2 +libyaml-libyaml-perl==0.63-2 +libyaml-tiny-perl==1.70-1 +libzmq3-dev==4.2.1-4+deb9u4 +libzmq5==4.2.1-4+deb9u4 +libzzip-0-13==0.13.62-3.2~deb9u2 +licensecheck==3.0.29-1 +lintian==2.5.50.4 +linux-compiler-gcc-6-x86==4.9.320-2 +linux-headers-4.9.0-19-amd64==4.9.320-2 +linux-headers-4.9.0-19-common==4.9.320-2 +linux-headers-amd64==4.9+80+deb9u17 +linux-kbuild-4.9==4.9.320-2 +linux-libc-dev==4.9.320-2 +linuxdoc-tools==0.9.72-4 +llvm-3.8==1:3.8.1-24 +llvm-3.8-dev==1:3.8.1-24 +llvm-3.8-runtime==1:3.8.1-24 +lmodern==2.004.5-3 +logrotate==3.11.0-0.1 +lsb-release==9.20161125 +lsof==4.89+dfsg-0.1 +lua-bitop==1.0.2-4 +lua-bitop-dev==1.0.2-4 +lua-cjson==2.1.0+dfsg-2 +lua-cjson-dev==2.1.0+dfsg-2 +lvm2==2.02.168-2 +lynx==2.8.9dev11-1+deb9u1 +lynx-common==2.8.9dev11-1+deb9u1 +m4==1.4.18-1 +mailutils==1:3.1.1-1 +mailutils-common==1:3.1.1-1 +make==4.1-9.1 +man-db==2.7.6.1-2 +manpages==4.10-2 +manpages-dev==4.10-2 +maven==3.3.9-4 +maven-debian-helper==2.1.3 +maven-repo-helper==1.9.2 +mesa-common-dev==13.0.6-1+b2 +mesa-utils==8.3.0-3 +mime-support==3.60 +module-assistant==0.11.9 +mpi-default-bin==1.8 +mpi-default-dev==1.8 +mysql-common==5.8+1.0.2 +ncurses-term==6.0+20161126-1+deb9u2 +netbase==5.4 +netpbm==2:10.0-15.3+b2 +ocl-icd-libopencl1==2.2.11-1 +openjdk-8-jdk==8u332-ga-1~deb9u1 +openjdk-8-jdk-headless==8u332-ga-1~deb9u1 +openjdk-8-jre==8u332-ga-1~deb9u1 +openjdk-8-jre-headless==8u332-ga-1~deb9u1 +openmpi-bin==2.0.2-2 +openmpi-common==2.0.2-2 +opensp==1.5.2-13+b1 +openssh-client==1:7.4p1-10+deb9u7 +openssh-server==1:7.4p1-10+deb9u7 +openssh-sftp-server==1:7.4p1-10+deb9u7 +openssl==1.1.0l-1~deb9u6 +packagekit==1.1.5-2+deb9u2 +packagekit-tools==1.1.5-2+deb9u2 +patch==2.7.5-1+deb9u2 +patchutils==0.3.4-2 +pbuilder==0.228.7 +pbzip2==1.1.9-1+b1 +perl==5.24.1-3+deb9u7 +perl-modules-5.24==5.24.1-3+deb9u7 +perl-openssl-defaults==3 +php-cli==1:7.0+49 +php-codecoverage==4.0.0+dfsg-1 +php-common==1:49 +php-deepcopy==1.5.5-1 +php-doctrine-instantiator==1.0.5-2 +php-file-iterator==1.4.1-2 +php-pear==1:1.10.1+submodules+notgz-9+deb9u3 +php-phpdocumentor-reflection-docblock==2.0.4-2 +php-phpspec-prophecy==1.6.2-1 +php-symfony-yaml==2.8.7+dfsg-1.3+deb9u3 +php-text-template==1.2.1-2 +php-timer==1.0.8-1 +php-token-stream==1.4.8-2 +php-xml==1:7.0+49 +php7.0-cli==7.0.33-0+deb9u12 +php7.0-common==7.0.33-0+deb9u12 +php7.0-json==7.0.33-0+deb9u12 +php7.0-opcache==7.0.33-0+deb9u12 +php7.0-readline==7.0.33-0+deb9u12 +php7.0-xml==7.0.33-0+deb9u12 +phpunit==5.4.6-2~deb9u1 +phpunit-code-unit-reverse-lookup==1.0.0-2 +phpunit-comparator==1.2.0-2 +phpunit-diff==1.4.1-2 +phpunit-environment==1.3.7-1 +phpunit-exporter==1.2.2-1 +phpunit-global-state==1.1.1-2 +phpunit-mock-object==3.2.3-1 +phpunit-object-enumerator==1.0.0-2 +phpunit-recursion-context==1.0.2-2 +phpunit-resource-operations==1.0.0-2 +phpunit-version==2.0.0-2 +pigz==2.3.4-1 +pinentry-curses==1.0.0-2 +pkg-config==0.29-4+b1 +pkg-php-tools==1.35 +po-debconf==1.0.20 +policykit-1==0.105-18+deb9u2 +poppler-data==0.4.7-8 +preview-latex-style==11.90-1 +pristine-tar==1.38 +procmail==3.22-25+deb9u1 +procps==2:3.3.12-3+deb9u1 +prosper==1.00.4+cvs.2007.05.01-4.1 +protobuf-compiler==3.0.0-9 +ps2eps==1.68+binaryfree-2 +psmisc==22.21-2.1+b2 +psutils==1.17.dfsg-4 +publicsuffix==20190415.1030-0+deb9u1 +pylint==1.6.5-1 +python==2.7.13-2 +python-alabaster==0.7.8-1 +python-all==2.7.13-2 +python-all-dev==2.7.13-2 +python-apt==1.4.3 +python-apt-common==1.4.3 +python-astroid==1.4.9-1 +python-attr==16.3.0-1 +python-babel==2.3.4+dfsg.1-2+deb9u1 +python-babel-localedata==2.3.4+dfsg.1-2+deb9u1 +python-backports.functools-lru-cache==1.3-1 +python-bs4==4.5.3-1 +python-cffi-backend==1.9.1-2 +python-chardet==2.3.0-2 +python-click==6.6-1 +python-colorama==0.3.7-1 +python-constantly==15.1.0-1 +python-cov-core==1.15.0-1 +python-coverage==4.2+dfsg.1-2 +python-crypto==2.6.1-7 +python-cryptography==1.7.1-3+deb9u2 +python-dateutil==2.5.3-2 +python-dbus==1.2.4-1+b1 +python-debian==0.1.30 +python-dev==2.7.13-2 +python-docutils==0.13.1+dfsg-2 +python-enum34==1.1.6-1 +python-gi==3.22.0-2 +python-gpg==1.8.0-3+b2 +python-html5lib==0.999999999-1 +python-idna==2.2-1 +python-imagesize==0.7.1-1 +python-incremental==16.10.1-3 +python-ipaddr==2.1.11-2 +python-ipaddress==1.0.17-1 +python-isort==4.2.5+ds1-2+deb9u1 +python-jinja2==2.8-1 +python-keyring==10.1-1 +python-keyrings.alt==1.3-1 +python-lazy-object-proxy==1.2.2-1 +python-lxml==3.7.1-1+deb9u5 +python-markupsafe==0.23-3 +python-minimal==2.7.13-2 +python-nose2==0.6.5-2 +python-openssl==16.2.0-1 +python-pam==0.4.2-13.2 +python-parse==1.6.6-0.1 +python-pil==4.0.0-4+deb9u4 +python-pip==9.0.1-2+deb9u2 +python-pip-whl==9.0.1-2+deb9u2 +python-pkg-resources==33.1.1-1 +python-py==1.4.32-3 +python-pyasn1==0.1.9-2 +python-pyasn1-modules==0.0.7-0.1 +python-pygments==2.2.0+dfsg-1+deb9u2 +python-pytest==3.0.6-1 +python-pytest-cov==2.4.0-2 +python-requests==2.12.4-1 +python-roman==2.0.0-2 +python-secretstorage==2.3.1-2 +python-serial==3.2.1-1 +python-service-identity==16.0.0-2 +python-setuptools==33.1.1-1 +python-six==1.10.0-3 +python-sphinx==1.4.9-2 +python-sphinx-rtd-theme==0.1.9-1 +python-stdeb==0.8.5-1 +python-tk==2.7.13-1 +python-twisted==16.6.0-2+deb9u3 +python-twisted-bin==16.6.0-2+deb9u3 +python-twisted-core==16.6.0-2+deb9u3 +python-tz==2016.7-0.3 +python-urllib3==1.19.1-1+deb9u1 +python-webencodings==0.5-2 +python-wheel==0.29.0-2 +python-wrapt==1.9.0-2 +python-xdg==0.25-4+deb9u1 +python-zope.interface==4.3.2-1 +python2.7==2.7.13-2+deb9u6 +python2.7-dev==2.7.13-2+deb9u6 +python2.7-minimal==2.7.13-2+deb9u6 +python3==3.5.3-1 +python3-alabaster==0.7.8-1 +python3-all==3.5.3-1 +python3-all-dbg==3.5.3-1 +python3-all-dev==3.5.3-1 +python3-apt==1.4.3 +python3-babel==2.3.4+dfsg.1-2+deb9u1 +python3-cffi-backend==1.9.1-2 +python3-chardet==2.3.0-2 +python3-crypto==2.6.1-7 +python3-cryptography==1.7.1-3+deb9u2 +python3-dbg==3.5.3-1 +python3-dbus==1.2.4-1+b1 +python3-debian==0.1.30 +python3-dev==3.5.3-1 +python3-docutils==0.13.1+dfsg-2 +python3-gi==3.22.0-2 +python3-idna==2.2-1 +python3-imagesize==0.7.1-1 +python3-jinja2==2.8-1 +python3-keyring==10.1-1 +python3-keyrings.alt==1.3-1 +python3-magic==1:5.30-1+deb9u3 +python3-markupsafe==0.23-3 +python3-minimal==3.5.3-1 +python3-pil==4.0.0-4+deb9u4 +python3-pip==9.0.1-2+deb9u2 +python3-pkg-resources==33.1.1-1 +python3-pyasn1==0.1.9-2 +python3-pycurl==7.43.0-2 +python3-pygments==2.2.0+dfsg-1+deb9u2 +python3-roman==2.0.0-2 +python3-secretstorage==2.3.1-2 +python3-setuptools==33.1.1-1 +python3-six==1.10.0-3 +python3-software-properties==0.96.20.2-1+deb9u1 +python3-sphinx==1.4.9-2 +python3-tz==2016.7-0.3 +python3-wheel==0.29.0-2 +python3-xdg==0.25-4+deb9u1 +python3.5==3.5.3-1+deb9u5 +python3.5-dbg==3.5.3-1+deb9u5 +python3.5-dev==3.5.3-1+deb9u5 +python3.5-minimal==3.5.3-1+deb9u5 +qdbus==4:4.8.7+dfsg-11+deb9u3 +qemu-kvm==1:2.8+dfsg-6+deb9u17 +qemu-system-common==1:2.8+dfsg-6+deb9u17 +qemu-system-x86==1:2.8+dfsg-6+deb9u17 +qemu-utils==1:2.8+dfsg-6+deb9u17 +qt-at-spi==0.4.0-5 +qt4-linguist-tools==4:4.8.7+dfsg-11+deb9u3 +qt4-qmake==4:4.8.7+dfsg-11+deb9u3 +qt5-default==5.7.1+dfsg-3+deb9u3 +qt5-gtk-platformtheme==5.7.1+dfsg-3+deb9u3 +qt5-qmake==5.7.1+dfsg-3+deb9u3 +qtbase5-dev==5.7.1+dfsg-3+deb9u3 +qtbase5-dev-tools==5.7.1+dfsg-3+deb9u3 +qtchooser==63-g13a3d08-1 +qtcore4-l10n==4:4.8.7+dfsg-11+deb9u3 +qttranslations5-l10n==5.7.1~20161021-1 +quilt==0.65-2~bpo9+1 +rake==10.5.0-2+deb9u1 +readline-common==7.0-3 +rename==0.20-4 +rhino==1.7.7.1-1 +rrdtool==1.6.0-1+b2 +rsync==3.1.2-1+deb9u3 +rsyslog==8.24.0-1+deb9u3 +ruby==1:2.3.3 +ruby-all-dev==1:2.3.3 +ruby-did-you-mean==1.0.0-2 +ruby-minitest==5.9.0-1 +ruby-net-telnet==0.1.1-2 +ruby-power-assert==0.3.0-1 +ruby-setup==3.4.1-9 +ruby-test-unit==3.1.7-2 +ruby2.3==2.3.3-1+deb9u11 +ruby2.3-dev==2.3.3-1+deb9u11 +rubygems-integration==1.11 +seabios==1.10.2-1 +sgml-base==1.29 +sgml-data==2.0.10 +shared-mime-info==1.8-1+deb9u1 +software-properties-common==0.96.20.2-1+deb9u1 +sphinx-common==1.4.9-2 +sphinx-rtd-theme-common==0.1.9-1 +squashfs-tools==1:4.3-3+deb9u3 +stgit==0.17.1-1 +strace==4.15-2 +sudo==1.8.19p1-2.1+deb9u3 +swig==3.0.10-1.1 +swig3.0==3.0.10-1.1 +systemd==232-25+deb9u14 +systemd-shim==10-3 +t1utils==1.39-2 +tcl==8.6.0+9 +tcl8.6==8.6.6+dfsg-1+b1 +tcpd==7.6.q-26 +telnet==0.17-41 +tex-common==6.06 +tex-gyre==20160520-1 +texi2html==1.82+dfsg1-5 +texinfo==6.3.0.dfsg.1-1+b2 +texlive-base==2016.20170123-5 +texlive-binaries==2016.20160513.41080.dfsg-2+deb9u1 +texlive-extra-utils==2016.20170123-5 +texlive-font-utils==2016.20170123-5 +texlive-fonts-recommended==2016.20170123-5 +texlive-fonts-recommended-doc==2016.20170123-5 +texlive-generic-extra==2016.20170123-5 +texlive-generic-recommended==2016.20170123-5 +texlive-latex-base==2016.20170123-5 +texlive-latex-base-doc==2016.20170123-5 +texlive-latex-extra==2016.20170123-5 +texlive-latex-extra-doc==2016.20170123-5 +texlive-latex-recommended==2016.20170123-5 +texlive-latex-recommended-doc==2016.20170123-5 +texlive-pictures==2016.20170123-5 +texlive-pictures-doc==2016.20170123-5 +texlive-pstricks==2016.20170123-5 +texlive-pstricks-doc==2016.20170123-5 +tipa==2:1.3-20 +tk==8.6.0+9 +tk8.6==8.6.6-1+b1 +tk8.6-blt2.5==2.5.3+dfsg-3 +ucf==3.0036 +unattended-upgrades==0.93.1+nmu1 +unzip==6.0-21+deb9u2 +velocity==1.7-5+deb9u1 +vim==2:8.0.0197-4+deb9u7 +vim-common==2:8.0.0197-4+deb9u7 +vim-runtime==2:8.0.0197-4+deb9u7 +wdiff==1.2.2-2 +wget==1.18-5+deb9u3 +x11-common==1:7.7+19 +x11-utils==7.7+3+b1 +x11-xserver-utils==7.7+7+b1 +x11proto-core-dev==7.0.31-1 +x11proto-damage-dev==1:1.2.1-2 +x11proto-dri2-dev==2.8-2 +x11proto-fixes-dev==1:5.0-2 +x11proto-gl-dev==1.4.17-1 +x11proto-input-dev==2.3.2-1 +x11proto-kb-dev==1.0.7-1 +x11proto-xext-dev==7.3.0-1 +x11proto-xf86vidmode-dev==2.3.1-2 +xauth==1:1.0.9-1+b2 +xbitmaps==1.1.1-2 +xdelta==1.1.3-9.1+b1 +xdelta3==3.0.11-dfsg-1+b1 +xdg-user-dirs==0.15-2+b1 +xdg-utils==1.1.1-1+deb9u2 +xkb-data==2.19-1+deb9u1 +xml-core==0.17 +xmlto==0.0.28-1 +xorg-sgml-doctools==1:1.11-1 +xsltproc==1.1.29-2.1+deb9u2 +xterm==327-2+deb9u3 +xtrans-dev==1.3.5-1 +xxd==2:8.0.0197-4+deb9u7 +xz-utils==5.2.2-1.2+deb9u1 +zip==3.0-11+b1 +zlib1g-dev==1:1.2.8.dfsg-5+deb9u1 \ No newline at end of file diff --git a/files/build/versions/dockers/sonic-slave-stretch/versions-deb-stretch-arm64 b/files/build/versions/dockers/sonic-slave-stretch/versions-deb-stretch-arm64 new file mode 100644 index 000000000000..00f894c2df08 --- /dev/null +++ b/files/build/versions/dockers/sonic-slave-stretch/versions-deb-stretch-arm64 @@ -0,0 +1,8 @@ +docker-ce==18.06.3~ce~3-0~debian +libdrm-freedreno1==2.4.74-1 +libdrm-tegra0==2.4.74-1 +libtext-charwidth-perl==0.04-7+b3 +libtext-iconv-perl==1.7-5+b3 +libunicode-utf8-perl==0.60-1+b2 +libxslt1-dev==1.1.29-2.1+deb9u2 +nodejs==10.24.1-1nodesource1 \ No newline at end of file diff --git a/files/build/versions/dockers/sonic-slave-stretch/versions-deb-stretch-armhf b/files/build/versions/dockers/sonic-slave-stretch/versions-deb-stretch-armhf new file mode 100644 index 000000000000..598d015aab3d --- /dev/null +++ b/files/build/versions/dockers/sonic-slave-stretch/versions-deb-stretch-armhf @@ -0,0 +1,14 @@ +docker-ce==18.06.3~ce~3-0~debian +libdrm-exynos1==2.4.74-1 +libdrm-freedreno1==2.4.74-1 +libdrm-omap1==2.4.74-1 +libdrm-tegra0==2.4.74-1 +libegl1-mesa-dev==13.0.6-1+b2 +libgles2-mesa==13.0.6-1+b2 +libgles2-mesa-dev==13.0.6-1+b2 +libtext-charwidth-perl==0.04-7+b6 +libwayland-bin==1.12.0-1+deb9u1 +libwayland-dev==1.12.0-1+deb9u1 +libxslt1-dev==1.1.29-2.1+deb9u2 +linux-compiler-gcc-6-arm==4.9.320-2 +nodejs==10.24.1-1nodesource1 \ No newline at end of file diff --git a/files/build/versions/dockers/sonic-slave-stretch/versions-py2 b/files/build/versions/dockers/sonic-slave-stretch/versions-py2 new file mode 100644 index 000000000000..579fff279bd0 --- /dev/null +++ b/files/build/versions/dockers/sonic-slave-stretch/versions-py2 @@ -0,0 +1,79 @@ +alabaster==0.7.8 +astroid==1.4.9 +attrs==16.3.0 +babel==2.3.4 +backports.functools-lru-cache==1.3 +beautifulsoup4==4.5.3 +chardet==2.3.0 +click==6.6 +colorama==0.3.7 +constantly==15.1.0 +cov-core==1.15.0 +coverage==4.2 +crc16==0.1.1 +cryptography==1.7.1 +ctypesgen==0.post125 +docutils==0.13.1 +enum34==1.1.6 +gbp==0.8.12.2 +gcovr==3.3 +gpg==1.8.0 +html5lib==0.999999999 +idna==2.2 +imagesize==0.7.1 +incremental==16.10.1 +ipaddr==2.1.11 +ipaddress==1.0.17 +isort==4.2.5 +j2cli==0.3.10 +jinja2==2.11.3 +keyring==10.1 +keyrings.alt==1.3 +lazy-object-proxy==1.2.2 +lxml==4.6.5 +m2crypto==0.36.0 +markupsafe==1.1.1 +mmh3==2.5.1 +mockredispy==2.9.3 +nose==1.3.7 +nose2==0.6.5 +pam==0.4.2 +parse==1.6.6 +pexpect==4.6.0 +pillow==4.0.0 +ptyprocess==0.7.0 +py==1.4.32 +pyasn1==0.1.9 +pyasn1-modules==0.0.7 +pycrypto==2.6.1 +pygments==2.2.0 +pygobject==3.22.0 +pylint==1.6.5 +pympler==0.8 +pyopenssl==16.2.0 +pyserial==3.2.1 +pyste==0.9.10 +pytest==3.0.6 +pytest-cov==2.4.0 +pytest-runner==4.4 +python-apt==1.4.3 +python-dateutil==2.5.3 +python-debian==0.1.30 +pytz==2016.7 +pyxdg==0.25 +pyyaml==5.3.1 +requests==2.12.4 +roman==2.0.0 +secretstorage==2.3.1 +service-identity==16.0.0 +six==1.10.0 +sphinx==1.4.9 +sphinx-rtd-theme==0.1.9 +stdeb==0.8.5 +stgit===0.17.1-dirty +twisted==16.6.0 +typing==3.10.0.0 +urllib3==1.19.1 +webencodings==0.5 +wrapt==1.9.0 +zope.interface==4.3.2 \ No newline at end of file diff --git a/files/build/versions/dockers/sonic-slave-stretch/versions-py3 b/files/build/versions/dockers/sonic-slave-stretch/versions-py3 new file mode 100644 index 000000000000..99398befa0cc --- /dev/null +++ b/files/build/versions/dockers/sonic-slave-stretch/versions-py3 @@ -0,0 +1,37 @@ +alabaster==0.7.8 +babel==2.3.4 +bitarray==2.7.3 +chardet==2.3.0 +cryptography==1.7.1 +devscripts==2.17.6+deb9u2 +docutils==0.13.1 +file-magic==0.3.0 +idna==2.2 +imagesize==0.7.1 +jinja2==2.8 +keyring==10.1 +keyrings.alt==1.3 +lxml==4.6.5 +markupsafe==0.23 +mockredispy==2.9.3 +nose==1.3.7 +pillow==4.0.0 +pyang==2.4.0 +pyangbind==0.8.1 +pyasn1==0.1.9 +pycrypto==2.6.1 +pycurl==7.43.0 +pygments==2.2.0 +pygobject==3.22.0 +python-apt==1.4.3 +python-debian==0.1.30 +pytz==2016.7 +pyxdg==0.25 +pyyaml==5.3.1 +redis==3.5.3 +regex==2022.1.18 +roman==2.0.0 +secretstorage==2.3.1 +six==1.10.0 +sphinx==1.4.9 +unattended-upgrades==0.1 \ No newline at end of file diff --git a/files/build/versions/host-base-image/versions-deb-buster b/files/build/versions/host-base-image/versions-deb-buster new file mode 100644 index 000000000000..44598d7dbfb3 --- /dev/null +++ b/files/build/versions/host-base-image/versions-deb-buster @@ -0,0 +1,84 @@ +adduser==3.118 +apt==1.8.2.3 +base-files==10.3+deb10u13 +base-passwd==3.5.46 +bash==5.0-4 +bsdutils==1:2.33.1-0.1 +coreutils==8.30-3 +dash==0.5.10.2-5 +debconf==1.5.71+deb10u1 +debian-archive-keyring==2019.1+deb10u1 +debianutils==4.8.6.1 +diffutils==1:3.7-3 +dpkg==1.19.8 +e2fsprogs==1.44.5-1+deb10u3 +fdisk==2.33.1-0.1 +findutils==4.6.0+git+20190209-2 +gcc-8-base==8.3.0-6 +gpgv==2.2.12-1+deb10u2 +grep==3.3-1 +gzip==1.9-3+deb10u1 +hostname==3.21 +init-system-helpers==1.56+nmu1 +libacl1==2.2.53-4 +libapt-pkg5.0==1.8.2.3 +libattr1==1:2.4.48-4 +libaudit-common==1:2.8.4-3 +libaudit1==1:2.8.4-3 +libblkid1==2.33.1-0.1 +libbz2-1.0==1.0.6-9.2~deb10u1 +libc-bin==2.28-10+deb10u1 +libc6==2.28-10+deb10u1 +libcap-ng0==0.7.9-2 +libcom-err2==1.44.5-1+deb10u3 +libdb5.3==5.3.28+dfsg1-0.5 +libdebconfclient0==0.249 +libext2fs2==1.44.5-1+deb10u3 +libfdisk1==2.33.1-0.1 +libffi6==3.2.1-9 +libgcc1==1:8.3.0-6 +libgcrypt20==1.8.4-5+deb10u1 +libgmp10==2:6.1.2+dfsg-4+deb10u1 +libgnutls30==3.6.7-4+deb10u8 +libgpg-error0==1.35-1 +libhogweed4==3.4.1-1+deb10u1 +libidn2-0==2.0.5-1+deb10u1 +liblz4-1==1.8.3-1+deb10u1 +liblzma5==5.2.4-1+deb10u1 +libmount1==2.33.1-0.1 +libncursesw6==6.1+20181013-2+deb10u2 +libnettle6==3.4.1-1+deb10u1 +libp11-kit0==0.23.15-2+deb10u1 +libpam-modules==1.3.1-5 +libpam-modules-bin==1.3.1-5 +libpam-runtime==1.3.1-5 +libpam0g==1.3.1-5 +libpcre3==2:8.39-12 +libseccomp2==2.3.3-4 +libselinux1==2.8-1+b1 +libsemanage-common==2.8-2 +libsemanage1==2.8-2 +libsepol1==2.8-1 +libsmartcols1==2.33.1-0.1 +libss2==1.44.5-1+deb10u3 +libstdc++6==8.3.0-6 +libsystemd0==241-7~deb10u8 +libtasn1-6==4.13-3 +libtinfo6==6.1+20181013-2+deb10u2 +libudev1==241-7~deb10u8 +libunistring2==0.9.10-1 +libuuid1==2.33.1-0.1 +libzstd1==1.3.8+dfsg-3+deb10u2 +login==1:4.5-1.1 +mawk==1.3.3-17+b3 +mount==2.33.1-0.1 +ncurses-base==6.1+20181013-2+deb10u2 +ncurses-bin==6.1+20181013-2+deb10u2 +passwd==1:4.5-1.1 +perl-base==5.28.1-6+deb10u1 +sed==4.7-1 +sysvinit-utils==2.93-8 +tar==1.30+dfsg-6 +tzdata==2021a-0+deb10u6 +util-linux==2.33.1-0.1 +zlib1g==1:1.2.11.dfsg-1+deb10u1 \ No newline at end of file diff --git a/files/build/versions/host-image/versions-deb-buster b/files/build/versions/host-image/versions-deb-buster new file mode 100644 index 000000000000..8b829e3e0eb7 --- /dev/null +++ b/files/build/versions/host-image/versions-deb-buster @@ -0,0 +1,339 @@ +acl==2.2.53-4 +apparmor==2.13.2-10 +apt-transport-https==1.8.2.3 +bash-completion==1:2.8-6 +bfn-modules==1.0 +binutils==2.31.1-16 +binutils-common==2.31.1-16 +binutils-x86-64-linux-gnu==2.31.1-16 +bridge-utils==1.6-2 +bsdmainutils==11.1.2+b1 +build-essential==12.6 +busybox==1:1.30.1-4 +bzip2==1.0.6-9.2~deb10u2 +ca-certificates==20200601~deb10u2 +cgroup-tools==0.41-8.1 +conntrack==1:1.4.5-2 +containerd.io==1.6.21-1 +cpio==2.12+dfsg-9 +cpp==4:8.3.0-1 +cpp-8==8.3.0-6 +cron==3.0pl1-134+deb10u1 +curl==7.64.0-4+deb10u6 +dbus==1.12.24-0+deb10u1 +device-tree-compiler==1.4.7-4 +dh-python==3.20190308 +dirmngr==2.2.12-1+deb10u2 +distro-info-data==0.41+deb10u7 +dmidecode==3.2-1 +dmsetup==2:1.02.155-3 +docker-ce==5:18.09.8~3-0~debian-buster +docker-ce-cli==5:18.09.8~3-0~debian-buster +dpkg-dev==1.19.8 +ebtables==2.0.10.4+snapshot20181205-3 +efibootmgr==15-1 +file==1:5.35-4+deb10u2 +firmware-amd-graphics==20190114+really20220913-0+deb10u1 +firmware-linux-nonfree==20190114+really20220913-0+deb10u1 +firmware-misc-nonfree==20190114+really20220913-0+deb10u1 +flashrom==1.0-1 +freeipmi-common==1.6.3-1.1 +g++==4:8.3.0-1 +g++-8==8.3.0-6 +gcc==4:8.3.0-1 +gcc-8==8.3.0-6 +gdisk==1.0.3-1.1 +gettext-base==0.19.8.1-9 +gir1.2-glib-2.0==1.58.3-2 +gir1.2-packagekitglib-1.0==1.1.12-5 +gnupg==2.2.12-1+deb10u2 +gnupg-l10n==2.2.12-1+deb10u2 +gnupg-utils==2.2.12-1+deb10u2 +gnupg2==2.2.12-1+deb10u2 +gpg==2.2.12-1+deb10u2 +gpg-agent==2.2.12-1+deb10u2 +gpg-wks-client==2.2.12-1+deb10u2 +gpg-wks-server==2.2.12-1+deb10u2 +gpgconf==2.2.12-1+deb10u2 +gpgsm==2.2.12-1+deb10u2 +grub-common==2.06-3~deb10u3 +grub2-common==2.06-3~deb10u3 +haveged==1.9.1-7 +hdparm==9.58+ds-1 +hping3==3.a2.ds2-7 +hw-management==1.mlnx.7.0010.2349 +i2c-tools==4.1-1 +ifmetric==0.3-5 +ifupdown2==1.2.8-1 +initramfs-tools==0.133 +initramfs-tools-core==0.133 +ipmitool==1.8.18-6+deb10u1 +iproute2==4.20.0-2+deb10u1 +iptables==1.8.2-4 +iptables-persistent==1.0.11+deb10u1 +iputils-ping==3:20180629-2+deb10u2 +isc-dhcp-client==4.4.1-2+deb10u3 +iso-codes==4.2-1 +jq==1.5+dfsg-2+b1 +kdump-tools==1:1.6.1-1 +kernel-mft-dkms-modules-4.19.0-12-2-amd64==4.21.0 +kexec-tools==1:2.0.18-1 +klibc-utils==2.0.6-1+deb10u1 +kmod==26-1 +less==487-0.1+b1 +libapparmor1==2.13.2-10 +libapt-inst2.0==1.8.2.3 +libargon2-1==0~20171227-0.2 +libasan5==8.3.0-6 +libassuan0==2.5.2-1 +libatomic1==8.3.0-6 +libbinutils==2.31.1-16 +libbsd0==0.9.1-2+deb10u1 +libbz2-1.0==1.0.6-9.2~deb10u2 +libc-bin==2.28-10+deb10u2 +libc-dev-bin==2.28-10+deb10u2 +libc-l10n==2.28-10+deb10u2 +libc6==2.28-10+deb10u2 +libc6-dev==2.28-10+deb10u2 +libcap2==1:2.25-2 +libcap2-bin==1:2.25-2 +libcc1-0==8.3.0-6 +libcgroup1==0.41-8.1 +libcryptsetup12==2:2.1.0-5+deb10u2 +libcurl3-gnutls==7.64.0-4+deb10u6 +libcurl4==7.64.0-4+deb10u6 +libdbd-sqlite3-perl==1.62-3 +libdbi-perl==1.642-1+deb10u2 +libdbus-1-3==1.12.24-0+deb10u1 +libdevmapper1.02.1==2:1.02.155-3 +libdns-export1104==1:9.11.5.P4+dfsg-5.1+deb10u8 +libdpkg-perl==1.19.8 +libdw1==0.176-1.1 +libedit2==3.1-20181209-1 +libefiboot1==37-2+deb10u1 +libefivar1==37-2+deb10u1 +libelf1==0.176-1.1 +libestr0==0.1.10-2.1 +libexpat1==2.2.6-2+deb10u6 +libexpat1-dev==2.2.6-2+deb10u6 +libfastjson4==0.99.8-2 +libffi-dev==3.2.1-9 +libfreeipmi17==1.6.3-1.1 +libfreetype6==2.9.1-3+deb10u3 +libftdi1-2==1.4-1+b2 +libfuse2==2.9.9-1+deb10u1 +libgcc-8-dev==8.3.0-6 +libgdbm-compat4==1.18.1-4 +libgdbm6==1.18.1-4 +libgirepository-1.0-1==1.58.3-2 +libglib2.0-0==2.58.3-2+deb10u4 +libgnutls30==3.6.7-4+deb10u10 +libgomp1==8.3.0-6 +libgpm2==1.20.7-5 +libgssapi-krb5-2==1.17-3+deb10u5 +libhavege1==1.9.1-7 +libhiredis0.14==0.14.0-3~bpo9+1 +libi2c0==4.1-1 +libidn11==1.33-2.2 +libip4tc0==1.8.2-4 +libip6tc0==1.8.2-4 +libiptc0==1.8.2-4 +libisc-export1100==1:9.11.5.P4+dfsg-5.1+deb10u8 +libisl19==0.20-2 +libitm1==8.3.0-6 +libjq1==1.5+dfsg-2+b1 +libjson-c3==0.12.1+ds-2+deb10u1 +libk5crypto3==1.17-3+deb10u5 +libkeyutils1==1.6-6 +libklibc==2.0.6-1+deb10u1 +libkmod2==26-1 +libkrb5-3==1.17-3+deb10u5 +libkrb5support0==1.17-3+deb10u5 +libksba8==1.3.5-2+deb10u2 +libldap-2.4-2==2.4.47+dfsg-3+deb10u7 +libldap-common==2.4.47+dfsg-3+deb10u7 +liblognorm5==2.0.5-1 +liblsan0==8.3.0-6 +liblzo2-2==2.10-0.1 +libmagic-mgc==1:5.35-4+deb10u2 +libmagic1==1:5.35-4+deb10u2 +libmnl0==1.0.4-2 +libmpc3==1.1.0-1 +libmpdec2==2.4.2-2 +libmpfr6==4.0.2-1 +libmpx2==8.3.0-6 +libncurses6==6.1+20181013-2+deb10u3 +libncursesw6==6.1+20181013-2+deb10u3 +libnet1==1.1.6+dfsg-3.1 +libnetfilter-conntrack3==1.0.7-1 +libnfnetlink0==1.0.1-3+b1 +libnftnl11==1.1.2-2 +libnghttp2-14==1.36.0-2+deb10u1 +libnl-3-200==3.5.0-1 +libnl-cli-3-200==3.5.0-1 +libnl-genl-3-200==3.5.0-1 +libnl-nf-3-200==3.5.0-1 +libnl-route-3-200==3.5.0-1 +libnpth0==1.6-1 +libnss-tacplus==1.0.4-1 +libonig5==6.9.1-1 +libopts25==1:5.18.12-4 +libpackagekit-glib2-18==1.1.12-5 +libpam-tacplus==1.4.1-1 +libpcap0.8==1.8.1-6+deb10u1 +libpci3==1:3.5.2-1 +libperl5.28==5.28.1-6+deb10u1 +libpng16-16==1.6.36-6 +libpopt0==1.16-12 +libprocps7==2:3.3.15-2 +libpsl5==0.20.2-2 +libpython-dev==2.7.16-1 +libpython-stdlib==2.7.16-1 +libpython2-dev==2.7.16-1 +libpython2-stdlib==2.7.16-1 +libpython2.7==2.7.16-2+deb10u1 +libpython2.7-dev==2.7.16-2+deb10u1 +libpython2.7-minimal==2.7.16-2+deb10u1 +libpython2.7-stdlib==2.7.16-2+deb10u1 +libpython3-dev==3.7.3-1 +libpython3-stdlib==3.7.3-1 +libpython3.7==3.7.3-2+deb10u4 +libpython3.7-dev==3.7.3-2+deb10u4 +libpython3.7-minimal==3.7.3-2+deb10u4 +libpython3.7-stdlib==3.7.3-2+deb10u4 +libquadmath0==8.3.0-6 +libreadline7==7.0-5 +librtmp1==2.4+20151223.gitfa8646d.1-2 +libsasl2-2==2.1.27+dfsg-1+deb10u2 +libsasl2-modules-db==2.1.27+dfsg-1+deb10u2 +libsqlite3-0==3.27.2-3+deb10u2 +libssh2-1==1.8.0-2.1 +libssl-dev==1.1.1n-0+deb10u4 +libssl1.1==1.1.1n-0+deb10u4 +libstdc++-8-dev==8.3.0-6 +libswsscommon==1.0.0 +libsysfs2==2.1.0+repack-5 +libsystemd0==247.3-6~bpo10+1 +libtac2==1.4.1-1 +libtasn1-6==4.13-3+deb10u1 +libtcl8.6==8.6.9+dfsg-2 +libtinfo6==6.1+20181013-2+deb10u3 +libtsan0==8.3.0-6 +libubsan1==8.3.0-6 +libudev1==247.3-6~bpo10+1 +libusb-0.1-4==2:0.1.12-32 +libusb-1.0-0==2:1.0.22-2 +libutempter0==1.1.6-3 +libwrap0==7.6.q-28 +libxtables12==1.8.2-4 +libyang==1.0.73 +libyang-cpp==1.0.73 +libzstd1==1.4.4+dfsg-3~bpo10+1 +linux-base==4.6 +linux-image-4.19.0-12-2-amd64-unsigned==4.19.152-1 +linux-libc-dev==4.19.282-1 +locales==2.28-10+deb10u2 +logrotate==3.14.0-4 +lsb-base==10.2019051400 +lsb-release==10.2019051400 +make==4.2.1-1.2 +makedev==2.3.1-94 +makedumpfile==1:1.6.5-1 +mft==4.21.0-100 +mft-oem==4.21.0-100 +mime-support==3.62 +monit==1:5.20.0-6 +mtd-utils==1:2.0.1-1 +mtr-tiny==0.92-2 +ncurses-base==6.1+20181013-2+deb10u3 +ncurses-bin==6.1+20181013-2+deb10u3 +ndisc6==1.0.4-1 +nephos-modules==1.0.1 +net-tools==1.60+git20180626.aebd88e-1 +netbase==5.6 +netfilter-persistent==1.0.11+deb10u1 +ntp==1:4.2.8p12+dfsg-4+deb10u2 +ntpstat==0.0.0.1-2 +opennsl-modules==4.3.0.10-2 +openssh-client==1:7.9p1-10+deb10u2 +openssh-server==1:7.9p1-10+deb10u2 +openssh-sftp-server==1:7.9p1-10+deb10u2 +openssl==1.1.1n-0+deb10u4 +patch==2.7.6-3+deb10u1 +pciutils==1:3.5.2-1 +perl==5.28.1-6+deb10u1 +perl-modules-5.28==5.28.1-6+deb10u1 +picocom==3.1-2 +pinentry-curses==1.1.0-2 +procps==2:3.3.15-2 +psmisc==23.2-1+deb10u1 +python==2.7.16-1 +python-apt==1.8.4.3 +python-apt-common==1.8.4.3 +python-argcomplete==1.8.1-1 +python-dev==2.7.16-1 +python-ipaddr==2.2.0-2 +python-minimal==2.7.16-1 +python-pip==18.1-5 +python-pip-whl==18.1-5 +python-swsscommon==1.0.0 +python2==2.7.16-1 +python2-dev==2.7.16-1 +python2-minimal==2.7.16-1 +python2-yang==1.0.73 +python2.7==2.7.16-2+deb10u1 +python2.7-dev==2.7.16-2+deb10u1 +python2.7-minimal==2.7.16-2+deb10u1 +python3==3.7.3-1 +python3-apt==1.8.4.3 +python3-dbus==1.2.8-3 +python3-dev==3.7.3-1 +python3-distutils==3.7.3-1 +python3-gi==3.30.4-1 +python3-lib2to3==3.7.3-1 +python3-minimal==3.7.3-1 +python3-pip==18.1-5 +python3-pycurl==7.43.0.2-0.1 +python3-software-properties==0.96.20.2-2 +python3-swsscommon==1.0.0 +python3-yang==1.0.73 +python3.7==3.7.3-2+deb10u4 +python3.7-dev==3.7.3-2+deb10u4 +python3.7-minimal==3.7.3-2+deb10u4 +rasdaemon==0.6.0-1.2 +readline-common==7.0-5 +rsyslog==8.1901.0-1+deb10u2 +screen==4.6.2-3+deb10u1 +sensible-utils==0.0.12 +software-properties-common==0.96.20.2-2 +sonic-device-data==1.0-1 +sonic-host-services-data==1.0-1 +sonic-platform-pddf==1.1 +sonic-utilities-data==1.0-1 +sqlite3==3.27.2-3+deb10u2 +squashfs-tools==1:4.3-12+deb10u2 +sudo==1.8.27-1+deb10u5 +swig==3.0.12-2 +swig3.0==3.0.12-2 +sx-kernel==1.mlnx.4.5.3196 +sysfsutils==2.1.0+repack-5 +systemd==247.3-6~bpo10+1 +systemd-sonic-generator==1.0.0 +systemd-sysv==247.3-6~bpo10+1 +systemd-timesyncd==247.3-6~bpo10+1 +tcpdump==4.9.3-1~deb10u2 +tcptraceroute==1.5beta7+debian-4+b2 +traceroute==1:2.1.0-2 +tzdata==2021a-0+deb10u11 +u-boot-tools==2019.01+dfsg-7 +ucf==3.0038+nmu1 +udev==247.3-6~bpo10+1 +unzip==6.0-23+deb10u3 +usb.ids==2019.07.27-0+deb10u1 +usbutils==1:010-3 +vim==2:8.1.0875-5+deb10u4 +vim-common==2:8.1.0875-5+deb10u4 +vim-runtime==2:8.1.0875-5+deb10u4 +xxd==2:8.1.0875-5+deb10u4 +xz-utils==5.2.4-1+deb10u1 +zlib1g==1:1.2.11.dfsg-1+deb10u2 \ No newline at end of file diff --git a/files/build/versions/host-image/versions-deb-buster-arm64 b/files/build/versions/host-image/versions-deb-buster-arm64 new file mode 100644 index 000000000000..8e5a96661c4d --- /dev/null +++ b/files/build/versions/host-image/versions-deb-buster-arm64 @@ -0,0 +1,13 @@ +binutils-aarch64-linux-gnu==2.31.1-16 +icu-devtools==63.1-6+deb10u3 +libcryptsetup12==2:2.3.7-1+deb11u1~bpo10+1 +libicu-dev==63.1-6+deb10u3 +libicu63==63.1-6+deb10u3 +libxml2==2.9.4+dfsg1-7+deb10u6 +libxml2-dev==2.9.4+dfsg1-7+deb10u6 +libxslt1-dev==1.1.32-2.2~deb10u2 +libxslt1.1==1.1.32-2.2~deb10u2 +linux-image-4.19.0-12-2-arm64-unsigned==4.19.152-1 +pkg-config==0.29-6 +tsingma-bsp==1.0 +zlib1g-dev==1:1.2.11.dfsg-1+deb10u2 \ No newline at end of file diff --git a/files/build/versions/host-image/versions-deb-buster-armhf b/files/build/versions/host-image/versions-deb-buster-armhf new file mode 100644 index 000000000000..7129e583512d --- /dev/null +++ b/files/build/versions/host-image/versions-deb-buster-armhf @@ -0,0 +1,13 @@ +binutils-arm-linux-gnueabihf==2.31.1-16 +icu-devtools==63.1-6+deb10u3 +libcryptsetup12==2:2.3.7-1+deb11u1~bpo10+1 +libicu-dev==63.1-6+deb10u3 +libicu63==63.1-6+deb10u3 +libxml2==2.9.4+dfsg1-7+deb10u6 +libxml2-dev==2.9.4+dfsg1-7+deb10u6 +libxslt1-dev==1.1.32-2.2~deb10u2 +libxslt1.1==1.1.32-2.2~deb10u2 +linux-image-4.19.0-12-2-armmp==4.19.152-1 +mrvlprestera==1.0 +pkg-config==0.29-6 +zlib1g-dev==1:1.2.11.dfsg-1+deb10u2 \ No newline at end of file diff --git a/files/build/versions/host-image/versions-py2 b/files/build/versions/host-image/versions-py2 new file mode 100644 index 000000000000..a57346ced325 --- /dev/null +++ b/files/build/versions/host-image/versions-py2 @@ -0,0 +1,27 @@ +argcomplete==1.8.1 +bitarray==1.5.3 +contextlib2==0.6.0.post1 +functools32==3.2.3.post2 +future==0.18.3 +importlib-resources==3.3.1 +ipaddr==2.2.0 +ipaddress==1.0.23 +jinja2==2.11.3 +jsonschema==2.6.0 +lxml==4.9.1 +markupsafe==1.1.1 +natsort==6.2.1 +netaddr==0.8.0 +pathlib2==2.3.7.post1 +pddf-platform==1.0 +pyang==2.5.3 +pyangbind==0.6.0 +python-apt==1.8.4.3 +pyyaml==5.4.1 +redis==3.5.3 +scandir==1.10.0 +singledispatch==3.7.0 +six==1.16.0 +thrift==0.13.0 +typing==3.10.0.0 +zipp==1.2.0 \ No newline at end of file diff --git a/files/build/versions/host-image/versions-py3 b/files/build/versions/host-image/versions-py3 new file mode 100644 index 000000000000..a2d1d21d7248 --- /dev/null +++ b/files/build/versions/host-image/versions-py3 @@ -0,0 +1,47 @@ +azure-common==1.1.28 +azure-nspkg==3.0.2 +azure-storage==0.36.0 +bitarray==1.5.3 +certifi==2023.5.7 +cffi==1.15.1 +charset-normalizer==3.1.0 +click==7.0 +cryptography==40.0.2 +docker==4.3.1 +idna==3.4 +ijson==2.6.1 +ipaddress==1.0.23 +j2cli==0.3.10 +jinja2==3.1.2 +jsondiff==2.0.0 +jsonschema==2.6.0 +lxml==4.9.1 +m2crypto==0.38.0 +markupsafe==2.1.2 +natsort==6.2.1 +netaddr==0.8.0 +netifaces==0.11.0 +pathtools==0.1.2 +pexpect==4.8.0 +psutil==5.9.5 +ptyprocess==0.7.0 +pyang==2.5.3 +pyangbind==0.8.1 +pycparser==2.21 +pycurl==7.43.0.2 +pygobject==3.30.4 +pyroute2==0.5.14 +python-apt==1.8.4.3 +python-dateutil==2.8.2 +pyyaml==5.4.1 +redis==3.5.3 +regex==2023.5.5 +requests==2.30.0 +scapy==2.4.4 +six==1.16.0 +tabulate==0.9.0 +thrift==0.13.0 +urllib3==2.0.2 +watchdog==0.10.3 +websocket-client==1.5.1 +xmltodict==0.12.0 \ No newline at end of file diff --git a/files/build/versions/host-image/versions-py3-all-armhf b/files/build/versions/host-image/versions-py3-all-armhf new file mode 100644 index 000000000000..431dc5a43838 --- /dev/null +++ b/files/build/versions/host-image/versions-py3-all-armhf @@ -0,0 +1 @@ +cryptography==3.3.1 \ No newline at end of file diff --git a/files/build_scripts/mask_disabled_services.py b/files/build_scripts/mask_disabled_services.py index f3a1d76bf102..5c1a3695802f 100755 --- a/files/build_scripts/mask_disabled_services.py +++ b/files/build_scripts/mask_disabled_services.py @@ -9,5 +9,5 @@ init_cfg = json.load(init_cfg_file) if 'FEATURE' in init_cfg: for feature_name, feature_props in init_cfg['FEATURE'].items(): - if 'state' in feature_props and feature_props['state'] == 'disabled': + if 'state' in feature_props and feature_props['state'] != 'enabled' and feature_props['state'] != 'always_enabled': subprocess.run(['systemctl', 'mask', '{}.service'.format(feature_name)]) diff --git a/files/build_templates/arp_update_vars.j2 b/files/build_templates/arp_update_vars.j2 index b9315b5ebe50..3cdfa8102340 100644 --- a/files/build_templates/arp_update_vars.j2 +++ b/files/build_templates/arp_update_vars.j2 @@ -1,5 +1,6 @@ { "interface": "{% for (name, prefix) in INTERFACE|pfx_filter %}{% if prefix|ipv6 %}{{ name }} {% endif %}{% endfor %}", "pc_interface" : "{% for (name, prefix) in PORTCHANNEL_INTERFACE|pfx_filter %}{% if prefix|ipv6 %}{{ name }} {% endif %}{% endfor %}", + "vlan_sub_interface": "{% for (name, prefix) in VLAN_SUB_INTERFACE|pfx_filter %}{% if prefix|ipv6 %}{{ name }} {% endif %}{% endfor %}", "vlan" : "{% if VLAN %}{{ VLAN.keys() | join(' ') }}{% endif %}" } diff --git a/files/build_templates/backend_acl.j2 b/files/build_templates/backend_acl.j2 new file mode 100644 index 000000000000..f5468e6c12cb --- /dev/null +++ b/files/build_templates/backend_acl.j2 @@ -0,0 +1,51 @@ +{%- set vlan2ports = {} %} +{%- for vlan in VLAN %} + {% set portlist = [] %} + {%- for vlan_name, port in VLAN_MEMBER %} + {%- if vlan_name == vlan %} + {%- if portlist.append(port) %}{%- endif %} + {%- endif %} + {%- endfor %} + {%- set _ = vlan2ports.update({vlan: portlist| sort | join(',')}) %} +{%- endfor %} + + +{ + "acl": { + "acl-sets": { + "acl-set": { + "DATAACL": { + "acl-entries": { + "acl-entry": { + {% for vlan, vlan_entries in VLAN.items() %} + "{{ loop.index }}": { + "config": { + "sequence-id": {{ loop.index }} + }, + "actions": { + "config": { + "forwarding-action": "ACCEPT" + } + }, + "l2": { + "config": { + "vlan_id": "{{ vlan_entries['vlanid'] }}" + } + }, + "input_interface": { + "interface_ref": { + "config": { + "interface": "{{ vlan2ports[vlan] }}" + } + } + } + + }{% if not loop.last %},{% endif %} + {% endfor -%} + } + } + } + } + } + } +} diff --git a/files/build_templates/buffers_config.j2 b/files/build_templates/buffers_config.j2 index 3b11b406c738..02ef0feac601 100644 --- a/files/build_templates/buffers_config.j2 +++ b/files/build_templates/buffers_config.j2 @@ -47,6 +47,9 @@ def {%- if DEVICE_NEIGHBOR_METADATA is defined and DEVICE_NEIGHBOR_METADATA[DEVICE_NEIGHBOR[local_port].name] %} {%- set neighbor = DEVICE_NEIGHBOR_METADATA[DEVICE_NEIGHBOR[local_port].name] %} {%- set neighbor_role = neighbor.type %} + {%- if 'edgezoneaggregator' == neighbor_role | lower %} + {%- set neighbor_role = 'LeafRouter' %} + {%- endif %} {%- if 'asic' == neighbor_role | lower %} {%- set roles1 = 'internal' %} {%- if 'internal' not in ports2cable %} @@ -96,7 +99,9 @@ def {%- set PORT_ALL = [] %} {%- if PORT is not defined %} - {%- if defs.generate_port_lists(PORT_ALL) %} {% endif %} + {%- if defs.generate_port_lists is defined %} + {%- if defs.generate_port_lists(PORT_ALL) %} {% endif %} + {%- endif %} {%- else %} {%- for port in PORT %} {%- if PORT_ALL.append(port) %}{%- endif %} @@ -104,12 +109,18 @@ def {%- endif %} {%- set PORT_ACTIVE = [] %} +{%- set PORT_INACTIVE = [] %} {%- if DEVICE_NEIGHBOR is not defined %} {%- set PORT_ACTIVE = PORT_ALL %} {%- else %} {%- for port in DEVICE_NEIGHBOR.keys() %} {%- if PORT_ACTIVE.append(port) %}{%- endif %} {%- endfor %} + {%- for port in PORT_ALL %} + {%- if port not in DEVICE_NEIGHBOR.keys() %} + {%- if PORT_INACTIVE.append(port) %}{%- endif %} + {%- endif %} + {%- endfor %} {%- endif %} {%- set port_names_list_active = [] %} @@ -118,6 +129,22 @@ def {%- endfor %} {%- set port_names_active = port_names_list_active | join(',') %} +{%- set port_names_list_extra_queues = [] %} +{%- for port in PORT_ACTIVE %} + {%- if ((SYSTEM_DEFAULTS is defined) and ('tunnel_qos_remap' in SYSTEM_DEFAULTS) and (SYSTEM_DEFAULTS['tunnel_qos_remap']['status'] == 'enabled')) and + (('type' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['type'] == 'LeafRouter' and DEVICE_NEIGHBOR_METADATA is defined and DEVICE_NEIGHBOR[port].name in DEVICE_NEIGHBOR_METADATA and DEVICE_NEIGHBOR_METADATA[DEVICE_NEIGHBOR[port].name].type == 'ToRRouter') or + ('subtype' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['subtype'] == 'DualToR' and DEVICE_NEIGHBOR_METADATA is defined and DEVICE_NEIGHBOR[port].name in DEVICE_NEIGHBOR_METADATA and DEVICE_NEIGHBOR_METADATA[DEVICE_NEIGHBOR[port].name].type == 'LeafRouter')) %} + {%- if port_names_list_extra_queues.append(port) %}{%- endif %} + {%- endif %} +{%- endfor %} +{%- set port_names_extra_queues = port_names_list_extra_queues | join(',') %} + +{%- set port_names_list_inactive = [] %} +{%- for port in PORT_INACTIVE %} + {%- if port_names_list_inactive.append(port) %}{%- endif %} +{%- endfor %} +{%- set port_names_inactive = port_names_list_inactive | join(',') %} + { "CABLE_LENGTH": { "AZURE": { @@ -131,13 +158,23 @@ def {% if defs.generate_buffer_pool_and_profiles is defined %} {{ defs.generate_buffer_pool_and_profiles() }} +{% elif defs.generate_buffer_pool_and_profiles_with_inactive_ports is defined %} +{{ defs.generate_buffer_pool_and_profiles_with_inactive_ports(port_names_inactive) }} {% endif %} + +{%- if port_names_active|length > 0 or port_names_inactive|length > 0 -%} {%- if defs.generate_profile_lists is defined %} {{ defs.generate_profile_lists(port_names_active) }}, +{% elif defs.generate_profile_lists_with_inactive_ports is defined %} +{{ defs.generate_profile_lists_with_inactive_ports(port_names_active, port_names_inactive) }}, {% endif %} -{%- if defs.generate_pg_profils is defined %} +{% if (defs.generate_pg_profiles_with_extra_lossless_pgs_with_inactive_ports is defined) and (port_names_extra_queues != '') %} +{{ defs.generate_pg_profiles_with_extra_lossless_pgs_with_inactive_ports(port_names_active, port_names_extra_queues, port_names_inactive) }}, +{% elif defs.generate_pg_profiles_with_inactive_ports is defined %} +{{ defs.generate_pg_profiles_with_inactive_ports(port_names_active, port_names_inactive) }}, +{% elif defs.generate_pg_profils is defined %} {{ defs.generate_pg_profils(port_names_active) }} {% else %} "BUFFER_PG": { @@ -155,8 +192,14 @@ def }, {% endif %} -{% if defs.generate_queue_buffers is defined %} +{% if (defs.generate_queue_buffers_with_extra_lossless_queues_with_inactive_ports is defined) and (port_names_extra_queues != '') %} +{{ defs.generate_queue_buffers_with_extra_lossless_queues_with_inactive_ports(port_names_active, port_names_extra_queues, port_names_inactive) }} +{% elif (defs.generate_queue_buffers_with_extra_lossless_queues is defined) and (port_names_extra_queues != '') %} +{{ defs.generate_queue_buffers_with_extra_lossless_queues(port_names_active, port_names_extra_queues) }} +{% elif defs.generate_queue_buffers is defined %} {{ defs.generate_queue_buffers(port_names_active) }} +{% elif defs.generate_queue_buffers_with_inactive_ports is defined %} +{{ defs.generate_queue_buffers_with_inactive_ports(port_names_active, port_names_inactive) }} {% else %} "BUFFER_QUEUE": { {% for port in PORT_ACTIVE %} @@ -177,8 +220,11 @@ def {% endfor %} } {% endif %} -{% if dynamic_mode is defined %} +{%- if dynamic_mode is defined -%} , +{%- endif -%} +{%- endif -%} +{% if dynamic_mode is defined %} "DEFAULT_LOSSLESS_BUFFER_PARAMETER": { "AZURE": { "default_dynamic_th": "0" diff --git a/files/build_templates/dhcp_relay.service.j2 b/files/build_templates/dhcp_relay.service.j2 index d501a663feba..b7b590a1036a 100644 --- a/files/build_templates/dhcp_relay.service.j2 +++ b/files/build_templates/dhcp_relay.service.j2 @@ -2,6 +2,8 @@ Description=DHCP relay container Requires=updategraph.service After=updategraph.service swss.service syncd.service teamd.service +BindsTo=sonic.target +After=sonic.target Before=ntp-config.service StartLimitIntervalSec=1200 StartLimitBurst=3 @@ -15,4 +17,4 @@ Restart=always RestartSec=30 [Install] -WantedBy=multi-user.target +WantedBy=sonic.target diff --git a/files/build_templates/docker_image_ctl.j2 b/files/build_templates/docker_image_ctl.j2 index dd37506f372f..41a419662e7d 100644 --- a/files/build_templates/docker_image_ctl.j2 +++ b/files/build_templates/docker_image_ctl.j2 @@ -31,12 +31,11 @@ function updateSyslogConf() { # On multiNPU platforms, change the syslog target ip to docker0 ip to allow logs from containers # running on the namespace to reach the rsyslog service running on the host - # Also update the container name + # Also update the container name if [[ ($NUM_ASIC -gt 1) ]]; then TARGET_IP=$(docker network inspect bridge --format={{ "'{{(index .IPAM.Config 0).Gateway}}'" }}) CONTAINER_NAME="$DOCKERNAME" TMP_FILE="/tmp/rsyslog.$CONTAINER_NAME.conf" - sonic-cfggen -t /usr/share/sonic/templates/rsyslog-container.conf.j2 -a "{\"target_ip\": \"$TARGET_IP\", \"container_name\": \"$CONTAINER_NAME\" }" > $TMP_FILE docker cp $TMP_FILE ${DOCKERNAME}:/etc/rsyslog.conf rm -rf $TMP_FILE @@ -116,7 +115,8 @@ function postStartAction() sleep 1; done if [[ ("$BOOT_TYPE" == "warm" || "$BOOT_TYPE" == "fastfast") && -f $WARM_DIR/dump.rdb ]]; then - rm -f $WARM_DIR/dump.rdb + # retain the dump file from last boot for debugging purposes + mv $WARM_DIR/dump.rdb $WARM_DIR/dump.rdb.old else # If there is a config_db.json dump file, load it. if [ -r /etc/sonic/config_db$DEV.json ]; then @@ -157,6 +157,7 @@ function postStartAction() test -e /host/fast-reboot/fdb.json && docker cp /host/fast-reboot/fdb.json swss$DEV:/ test -e /host/fast-reboot/arp.json && docker cp /host/fast-reboot/arp.json swss$DEV:/ test -e /host/fast-reboot/default_routes.json && docker cp /host/fast-reboot/default_routes.json swss$DEV:/ + test -e /host/fast-reboot/media_config.json && docker cp /host/fast-reboot/media_config.json swss$DEV:/ rm -fr /host/fast-reboot fi docker exec swss$DEV touch /ready # signal swssconfig.sh to go @@ -249,9 +250,6 @@ start() { {%- endif %} {%- if docker_container_name == "swss" %} - # Obtain the vendor name - ASIC_VENDOR=`$SONIC_CFGGEN -y /etc/sonic/sonic_version.yml -v asic_type` - # Generate the asic_table.json and peripheral_table.json if [ ! -f /etc/sonic/asic_table.json ] && [ -f /usr/share/sonic/templates/asic_table.j2 ]; then sonic-cfggen -d -t /usr/share/sonic/templates/asic_table.j2 > /etc/sonic/asic_table.json @@ -259,6 +257,9 @@ start() { if [ ! -f /etc/sonic/peripheral_table.json ] && [ -f /usr/share/sonic/device/$PLATFORM/port_peripheral_config.j2 ]; then sonic-cfggen -d -t /usr/share/sonic/device/$PLATFORM/port_peripheral_config.j2 > /etc/sonic/peripheral_table.json fi + if [ ! -f /etc/sonic/zero_profiles.json ] && [ -f /usr/share/sonic/templates/zero_profiles.j2 ]; then + sonic-cfggen -d -t /usr/share/sonic/device/$PLATFORM/zero_profiles.j2 > /etc/sonic/zero_profiles.json + fi {%- endif %} # In Multi ASIC platforms the global database config file database_global.json will exist. @@ -354,7 +355,7 @@ start() { {%- endif %} {%- if sonic_asic_platform == "mellanox" %} {%- if docker_container_name == "syncd" %} - -v /var/log/mellanox/sniffer:/var/log/mellanox/sniffer:rw \ + -v /var/log/mellanox:/var/log/mellanox:rw \ -v mlnx_sdk_socket:/var/run/sx_sdk \ -v mlnx_sdk_ready:/tmp \ -v /dev/shm:/dev/shm:rw \ @@ -374,8 +375,11 @@ start() { -v /var/run/docker-syncd$DEV:/var/run/sswsyncd \ {%- endif %} {%- endif %} +{%- if docker_container_name == "pmon" %} + -v /usr/share/sonic/firmware:/usr/share/sonic/firmware:rw \ +{%- endif %} {%- if docker_container_name == "swss" %} - -e ASIC_VENDOR=$ASIC_VENDOR \ + -e ASIC_VENDOR={{ sonic_asic_platform }} \ {%- endif -%} {%- if docker_container_name == "bgp" %} -v /etc/sonic/frr/$DEV:/etc/frr:rw \ @@ -424,11 +428,25 @@ stop() { if [ "$DEV" ]; then ip netns delete "$NET_NS" fi + {%- elif docker_container_name == "teamd" %} + # Longer timeout of 60 sec to wait for Portchannels to be cleaned. + /usr/local/bin/container stop -t 60 $DOCKERNAME {%- else %} /usr/local/bin/container stop $DOCKERNAME {%- endif %} } +kill() { + {%- if docker_container_name == "database" %} + docker kill $DOCKERNAME + if [ "$DEV" ]; then + ip netns delete "$NET_NS" + fi + {%- else %} + /usr/local/bin/container kill $DOCKERNAME + {%- endif %} +} + DOCKERNAME={{docker_container_name}} OP=$1 DEV=$2 # namespace/device number to operate on @@ -456,7 +474,7 @@ fi [ -f /etc/sonic/sonic-environment ] && . /etc/sonic/sonic-environment case "$1" in - start|wait|stop) + start|wait|stop|kill) $1 ;; *) diff --git a/files/build_templates/gbsyncd.service.j2 b/files/build_templates/gbsyncd.service.j2 index e1080ae7d526..b33dfea6b00d 100644 --- a/files/build_templates/gbsyncd.service.j2 +++ b/files/build_templates/gbsyncd.service.j2 @@ -5,6 +5,8 @@ ConditionPathExists=!/usr/share/sonic/hwsku/gearbox_config.json After=database.service updategraph.service After=interfaces-config.service After=swss.service +BindsTo=sonic.target +After=sonic.target Before=ntp-config.service [Service] @@ -15,4 +17,4 @@ ExecStart=/usr/local/bin/gbsyncd.sh wait ExecStop=/usr/local/bin/gbsyncd.sh stop [Install] -WantedBy=multi-user.target +WantedBy=sonic.target diff --git a/files/build_templates/iccpd.service.j2 b/files/build_templates/iccpd.service.j2 index 979c45de72c5..d78407a87be3 100644 --- a/files/build_templates/iccpd.service.j2 +++ b/files/build_templates/iccpd.service.j2 @@ -2,6 +2,8 @@ Description=ICCPD container Requires=updategraph.service swss.service After=updategraph.service swss.service +BindsTo=sonic.target +After=sonic.target [Service] User={{ sonicadmin_user }} @@ -10,4 +12,4 @@ ExecStart=/usr/bin/{{docker_container_name}}.sh wait ExecStop=/usr/bin/{{docker_container_name}}.sh stop [Install] -WantedBy=multi-user.target swss.service +WantedBy=sonic.target swss.service diff --git a/files/build_templates/init_cfg.json.j2 b/files/build_templates/init_cfg.json.j2 index 0cf85cd8ab06..08ae19ef2efc 100644 --- a/files/build_templates/init_cfg.json.j2 +++ b/files/build_templates/init_cfg.json.j2 @@ -21,8 +21,8 @@ {%- set features = [("bgp", "enabled", false, "enabled"), ("database", "always_enabled", false, "always_enabled"), ("dhcp_relay", "enabled", false, "enabled"), - ("lldp", "enabled", false, "enabled"), - ("pmon", "enabled", false, "enabled"), + ("lldp", "enabled", true, "enabled"), + ("pmon", "enabled", true, "enabled"), ("radv", "enabled", false, "enabled"), ("snmp", "enabled", true, "enabled"), ("swss", "enabled", false, "enabled"), @@ -31,6 +31,7 @@ {%- if sonic_asic_platform == "vs" %}{% do features.append(("gbsyncd", "enabled", false, "enabled")) %}{% endif %} {%- if include_iccpd == "y" %}{% do features.append(("iccpd", "disabled", false, "enabled")) %}{% endif %} {%- if include_mgmt_framework == "y" %}{% do features.append(("mgmt-framework", "enabled", true, "enabled")) %}{% endif %} +{%- if include_mux == "y" %}{% do features.append(("mux", "{% if 'subtype' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['subtype'] == 'DualToR' %}enabled{% else %}always_disabled{% endif %}", false, "enabled")) %}{% endif %} {%- if include_nat == "y" %}{% do features.append(("nat", "disabled", false, "enabled")) %}{% endif %} {%- if include_restapi == "y" %}{% do features.append(("restapi", "enabled", false, "enabled")) %}{% endif %} {%- if include_sflow == "y" %}{% do features.append(("sflow", "disabled", false, "enabled")) %}{% endif %} diff --git a/files/build_templates/lldp.timer.j2 b/files/build_templates/lldp.timer.j2 new file mode 120000 index 000000000000..8e6950d6f3bc --- /dev/null +++ b/files/build_templates/lldp.timer.j2 @@ -0,0 +1 @@ +per_namespace/lldp.timer.j2 \ No newline at end of file diff --git a/files/build_templates/mgmt-framework.service.j2 b/files/build_templates/mgmt-framework.service.j2 index 883711aa82eb..ff99afe62bc1 100644 --- a/files/build_templates/mgmt-framework.service.j2 +++ b/files/build_templates/mgmt-framework.service.j2 @@ -2,11 +2,12 @@ Description=Management Framework container Requires=database.service After=database.service swss.service syncd.service +BindsTo=sonic.target +After=sonic.target Before=ntp-config.service [Service] User={{ sonicadmin_user }} -ExecStartPre=/usr/bin/{{docker_container_name}}.sh start -ExecStart=/usr/bin/{{docker_container_name}}.sh wait -ExecStop=/usr/bin/{{docker_container_name}}.sh stop - +ExecStartPre=/usr/local/bin/{{docker_container_name}}.sh start +ExecStart=/usr/local/bin/{{docker_container_name}}.sh wait +ExecStop=/usr/local/bin/{{docker_container_name}}.sh stop diff --git a/files/build_templates/mgmt-framework.timer b/files/build_templates/mgmt-framework.timer index 62ab8ef1bd58..ea868bd66743 100644 --- a/files/build_templates/mgmt-framework.timer +++ b/files/build_templates/mgmt-framework.timer @@ -1,9 +1,11 @@ [Unit] Description=Delays management framework container until SONiC has started +PartOf=mgmt-framework.service [Timer] +OnUnitActiveSec=0 sec OnBootSec=3min 30 sec Unit=mgmt-framework.service [Install] -WantedBy=timers.target +WantedBy=timers.target sonic.target sonic-delayed.target diff --git a/files/build_templates/mux.service.j2 b/files/build_templates/mux.service.j2 new file mode 100644 index 000000000000..ee1f8ce75389 --- /dev/null +++ b/files/build_templates/mux.service.j2 @@ -0,0 +1,22 @@ +[Unit] +Description=MUX Cable Container +Requires=database.service updategraph.service swss.service +After=swss.service +BindsTo=sonic.target +After=sonic.target +StartLimitIntervalSec=1200 +StartLimitBurst=3 + +[Service] +User={{ sonicadmin_user }} +ExecStartPre=/usr/local/bin/write_standby.py +ExecStartPre=/usr/local/bin/mark_dhcp_packet.py +ExecStartPre=/usr/bin/{{docker_container_name}}.sh start +ExecStart=/usr/bin/{{docker_container_name}}.sh wait +ExecStop=/usr/bin/{{docker_container_name}}.sh stop +ExecStopPost=/usr/local/bin/write_standby.py --shutdown mux +Restart=always +RestartSec=30 + +[Install] +WantedBy=sonic.target diff --git a/files/build_templates/nat.service.j2 b/files/build_templates/nat.service.j2 index 1d267cfe9302..10dc7cadf18c 100644 --- a/files/build_templates/nat.service.j2 +++ b/files/build_templates/nat.service.j2 @@ -2,6 +2,8 @@ Description=NAT container Requires=updategraph.service After=updategraph.service swss.service syncd.service +BindsTo=sonic.target +After=sonic.target Before=ntp-config.service StartLimitIntervalSec=1200 StartLimitBurst=3 @@ -15,5 +17,5 @@ Restart=always RestartSec=30 [Install] -WantedBy=multi-user.target +WantedBy=sonic.target diff --git a/files/build_templates/pcie-check.timer b/files/build_templates/pcie-check.timer deleted file mode 100644 index 4ad5c6481861..000000000000 --- a/files/build_templates/pcie-check.timer +++ /dev/null @@ -1,9 +0,0 @@ -[Unit] -Description=Start the pcie-check.service 10 seconds after boot - -[Timer] -OnBootSec=10sec -Unit=pcie-check.service - -[Install] -WantedBy=timers.target diff --git a/files/build_templates/per_namespace/bgp.service.j2 b/files/build_templates/per_namespace/bgp.service.j2 index 9f3c72e20db5..5d91bb1c1b70 100644 --- a/files/build_templates/per_namespace/bgp.service.j2 +++ b/files/build_templates/per_namespace/bgp.service.j2 @@ -4,6 +4,9 @@ Requires=database{% if multi_instance == 'true' %}@%i{% endif %}.service After=database{% if multi_instance == 'true' %}@%i{% endif %}.service Requires=updategraph.service After=updategraph.service +BindsTo=sonic.target +After=sonic.target +After=swss{% if multi_instance == 'true' %}@%i{% endif %}.service Before=ntp-config.service StartLimitIntervalSec=1200 StartLimitBurst=3 @@ -13,9 +16,10 @@ User={{ sonicadmin_user }} ExecStartPre=/usr/local/bin/{{docker_container_name}}.sh start{% if multi_instance == 'true' %} %i{% endif %} ExecStart=/usr/local/bin/{{docker_container_name}}.sh wait{% if multi_instance == 'true' %} %i{% endif %} ExecStop=/usr/local/bin/{{docker_container_name}}.sh stop{% if multi_instance == 'true' %} %i{% endif %} +ExecStopPost=/usr/local/bin/write_standby.py --shutdown bgp Restart=always RestartSec=30 [Install] -WantedBy=multi-user.target +WantedBy=sonic.target diff --git a/files/build_templates/per_namespace/database.service.j2 b/files/build_templates/per_namespace/database.service.j2 index c8a59ab25bbd..4990f41fbd81 100644 --- a/files/build_templates/per_namespace/database.service.j2 +++ b/files/build_templates/per_namespace/database.service.j2 @@ -14,9 +14,9 @@ StartLimitBurst=3 [Service] User=root -ExecStartPre=/usr/bin/{{docker_container_name}}.sh start{% if multi_instance == 'true' %} %i{% endif %} -ExecStart=/usr/bin/{{docker_container_name}}.sh wait{% if multi_instance == 'true' %} %i{% endif %} -ExecStop=/usr/bin/{{docker_container_name}}.sh stop{% if multi_instance == 'true' %} %i{% endif %} +ExecStartPre=/usr/local/bin/{{docker_container_name}}.sh start{% if multi_instance == 'true' %} %i{% endif %} +ExecStart=/usr/local/bin/{{docker_container_name}}.sh wait{% if multi_instance == 'true' %} %i{% endif %} +ExecStop=/usr/local/bin/{{docker_container_name}}.sh stop{% if multi_instance == 'true' %} %i{% endif %} Restart=always RestartSec=30 diff --git a/files/build_templates/per_namespace/lldp.service.j2 b/files/build_templates/per_namespace/lldp.service.j2 index b48675b03202..080f4a825b7d 100644 --- a/files/build_templates/per_namespace/lldp.service.j2 +++ b/files/build_templates/per_namespace/lldp.service.j2 @@ -6,6 +6,10 @@ After=swss{% if multi_instance == 'true' %}@%i{% endif %}.service After=syncd{% if multi_instance == 'true' %}@%i{% endif %}.service Requires=updategraph.service After=updategraph.service +BindsTo=sonic.target +After=sonic.target +BindsTo=sonic.target +After=sonic.target Before=ntp-config.service StartLimitIntervalSec=1200 StartLimitBurst=3 @@ -17,6 +21,3 @@ ExecStart=/usr/bin/{{docker_container_name}}.sh wait{% if multi_instance == 'tru ExecStop=/usr/bin/{{docker_container_name}}.sh stop{% if multi_instance == 'true' %} %i{% endif %} Restart=always RestartSec=30 - -[Install] -WantedBy=multi-user.target diff --git a/files/build_templates/per_namespace/lldp.timer.j2 b/files/build_templates/per_namespace/lldp.timer.j2 new file mode 100644 index 000000000000..67622a32851b --- /dev/null +++ b/files/build_templates/per_namespace/lldp.timer.j2 @@ -0,0 +1,12 @@ +[Unit] +# This delay is for fast/warm reboot performance +Description=Delays LLDP docker until SONiC has started +PartOf=lldp{% if multi_instance == 'true' %}@%i{% endif %}.service + +[Timer] +OnUnitActiveSec=0 sec +OnBootSec=1min 30 sec +Unit=lldp{% if multi_instance == 'true' %}@%i{% endif %}.service + +[Install] +WantedBy=timers.target sonic.target sonic-delayed.target diff --git a/files/build_templates/per_namespace/swss.service.j2 b/files/build_templates/per_namespace/swss.service.j2 index 352d1593a60b..9dd7b42c4d9d 100644 --- a/files/build_templates/per_namespace/swss.service.j2 +++ b/files/build_templates/per_namespace/swss.service.j2 @@ -12,6 +12,8 @@ Requires=opennsl-modules.service Requires=updategraph.service After=updategraph.service After=interfaces-config.service +BindsTo=sonic.target +After=sonic.target Before=ntp-config.service StartLimitIntervalSec=1200 StartLimitBurst=3 @@ -26,4 +28,4 @@ Restart=always RestartSec=30 [Install] -WantedBy=multi-user.target +WantedBy=sonic.target diff --git a/files/build_templates/per_namespace/syncd.service.j2 b/files/build_templates/per_namespace/syncd.service.j2 index 0c9bf073e940..9acf97c29fd4 100644 --- a/files/build_templates/per_namespace/syncd.service.j2 +++ b/files/build_templates/per_namespace/syncd.service.j2 @@ -17,6 +17,8 @@ After=nps-modules.service Requires=updategraph.service After=updategraph.service After=interfaces-config.service +BindsTo=sonic.target +After=sonic.target Before=ntp-config.service [Service] @@ -26,8 +28,8 @@ ExecStartPre=/usr/local/bin/syncd.sh start{% if multi_instance == 'true' %} %i{% ExecStart=/usr/local/bin/syncd.sh wait{% if multi_instance == 'true' %} %i{% endif %} ExecStop=/usr/local/bin/syncd.sh stop{% if multi_instance == 'true' %} %i{% endif %} {% if sonic_asic_platform == 'mellanox' %} -TimeoutStartSec=150 +TimeoutStartSec=480 {% endif %} [Install] -WantedBy=multi-user.target +WantedBy=sonic.target diff --git a/files/build_templates/per_namespace/teamd.service.j2 b/files/build_templates/per_namespace/teamd.service.j2 index 322ffdc407ed..7dff23fb83e9 100644 --- a/files/build_templates/per_namespace/teamd.service.j2 +++ b/files/build_templates/per_namespace/teamd.service.j2 @@ -1,8 +1,14 @@ [Unit] Description=TEAMD container After=swss{% if multi_instance == 'true' %}@%i{% endif %}.service +{% if multi_instance == 'true' and sonic_asic_platform == 'vs' %} +Requires=topology.service +After=topology.service +{% endif %} Requires=updategraph.service After=updategraph.service +BindsTo=sonic.target +After=sonic.target Before=ntp-config.service StartLimitIntervalSec=1200 StartLimitBurst=3 @@ -16,4 +22,4 @@ Restart=always RestartSec=30 [Install] -WantedBy=multi-user.target +WantedBy=sonic.target diff --git a/files/build_templates/pmon.service.j2 b/files/build_templates/pmon.service.j2 index 9195b4d38ad6..a36324fdfe25 100644 --- a/files/build_templates/pmon.service.j2 +++ b/files/build_templates/pmon.service.j2 @@ -5,6 +5,8 @@ After=database.service updategraph.service {% if sonic_asic_platform == 'mellanox' %} After=syncd.service {% endif %} +BindsTo=sonic.target +After=sonic.target Before=ntp-config.service StartLimitIntervalSec=1200 StartLimitBurst=3 @@ -16,6 +18,3 @@ ExecStart=/usr/bin/{{docker_container_name}}.sh wait ExecStop=/usr/bin/{{docker_container_name}}.sh stop Restart=always RestartSec=30 - -[Install] -WantedBy=multi-user.target diff --git a/files/build_templates/pmon.timer b/files/build_templates/pmon.timer new file mode 100644 index 000000000000..2993051607ef --- /dev/null +++ b/files/build_templates/pmon.timer @@ -0,0 +1,12 @@ +[Unit] +# This delay is for fast/warm reboot performance +Description=Delays pmon docker until SONiC has started +PartOf=pmon.service + +[Timer] +OnUnitActiveSec=0 sec +OnBootSec=1min 30 sec +Unit=pmon.service + +[Install] +WantedBy=timers.target sonic.target sonic-delayed.target diff --git a/files/build_templates/qos_config.j2 b/files/build_templates/qos_config.j2 index a7c361d69fa5..5aeb4531328b 100644 --- a/files/build_templates/qos_config.j2 +++ b/files/build_templates/qos_config.j2 @@ -27,13 +27,28 @@ {%- endfor %} {%- set port_names_active = port_names_list_active | join(',') -%} +{%- set tunnel_qos_remap_enable = false %} +{%- if ((SYSTEM_DEFAULTS is defined) and ('tunnel_qos_remap' in SYSTEM_DEFAULTS) and (SYSTEM_DEFAULTS['tunnel_qos_remap']['status'] == 'enabled')) %} +{%- set tunnel_qos_remap_enable = true %} +{%- endif %} + +{%- set port_names_list_extra_queues = [] %} +{%- for port in PORT_ACTIVE %} +{% if ((generate_dscp_to_tc_map is defined) and tunnel_qos_remap_enable) and +(('type' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['type'] == 'LeafRouter' and DEVICE_NEIGHBOR_METADATA is defined and DEVICE_NEIGHBOR[port].name in DEVICE_NEIGHBOR_METADATA and DEVICE_NEIGHBOR_METADATA[DEVICE_NEIGHBOR[port].name].type == 'ToRRouter') or +('subtype' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['subtype'] == 'DualToR' and DEVICE_NEIGHBOR_METADATA is defined and DEVICE_NEIGHBOR[port].name in DEVICE_NEIGHBOR_METADATA and DEVICE_NEIGHBOR_METADATA[DEVICE_NEIGHBOR[port].name].type == 'LeafRouter')) %} + {%- if port_names_list_extra_queues.append(port) %}{%- endif %} + {%- endif %} +{%- endfor %} {%- set pfc_to_pg_map_supported_asics = ['mellanox', 'barefoot', 'marvell'] -%} {%- set backend_device_types = ['BackEndToRRouter', 'BackEndLeafRouter'] -%} +{%- set apollo_resource_types = ['DL-NPU-Apollo'] -%} +{%- set require_global_dscp_to_tc_map = true -%} { -{% if generate_tc_to_pg_map is defined %} +{% if (generate_tc_to_pg_map is defined) and tunnel_qos_remap_enable %} {{- generate_tc_to_pg_map() }} {% else %} "TC_TO_PRIORITY_GROUP_MAP": { @@ -61,6 +76,9 @@ "7": "7" } }, +{% if (generate_tc_to_queue_map is defined) and tunnel_qos_remap_enable %} + {{- generate_tc_to_queue_map() }} +{% else %} "TC_TO_QUEUE_MAP": { "AZURE": { "0": "0", @@ -73,11 +91,13 @@ "7": "7" } }, +{% endif %} {% if 'type' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['type'] in backend_device_types and 'storage_device' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['storage_device'] == 'true' %} +{%- set require_global_dscp_to_tc_map = false %} "DOT1P_TO_TC_MAP": { "AZURE": { - "0": "0", - "1": "1", + "0": "1", + "1": "0", "2": "2", "3": "3", "4": "4", @@ -86,6 +106,8 @@ "7": "7" } }, +{% elif (generate_dscp_to_tc_map is defined) and tunnel_qos_remap_enable %} + {{- generate_dscp_to_tc_map() }} {% else %} "DSCP_TO_TC_MAP": { "AZURE": { @@ -156,6 +178,25 @@ } }, {% endif %} +{% if (generate_tc_to_dscp_map is defined) and tunnel_qos_remap_enable %} + {{- generate_tc_to_dscp_map() }} +{% endif %} +{% if 'resource_type' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['resource_type'] in apollo_resource_types %} + "SCHEDULER": { + "scheduler.0": { + "type" : "DWRR", + "weight": "1" + }, + "scheduler.1": { + "type" : "DWRR", + "weight": "1" + }, + "scheduler.2": { + "type" : "DWRR", + "weight": "100" + } + }, +{% else %} "SCHEDULER": { "scheduler.0": { "type" : "DWRR", @@ -166,8 +207,17 @@ "weight": "15" } }, +{% endif %} {% if asic_type in pfc_to_pg_map_supported_asics %} "PFC_PRIORITY_TO_PRIORITY_GROUP_MAP": { +{% if port_names_list_extra_queues|length > 0 %} + "AZURE_DUALTOR": { + "2": "2", + "3": "3", + "4": "4", + "6": "6" + }, +{% endif %} "AZURE": { "3": "3", "4": "4" @@ -175,20 +225,53 @@ }, {% endif %} "PORT_QOS_MAP": { +{% if generate_global_dscp_to_tc_map is defined %} + {{- generate_global_dscp_to_tc_map() }} +{% elif require_global_dscp_to_tc_map %} + "global": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]" + }{% if PORT_ACTIVE %},{% endif %} + +{% endif %} {% for port in PORT_ACTIVE %} "{{ port }}": { {% if 'type' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['type'] in backend_device_types and 'storage_device' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['storage_device'] == 'true' %} "dot1p_to_tc_map" : "[DOT1P_TO_TC_MAP|AZURE]", +{% else %} +{# Apply separated DSCP_TO_TC_MAP to uplink ports on ToR and Leaf #} +{% if different_dscp_to_tc_map and tunnel_qos_remap_enable %} +{% if ('type' in DEVICE_METADATA['localhost']) and (DEVICE_METADATA['localhost']['type'] == 'LeafRouter') and (port not in port_names_list_extra_queues) %} + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE_UPLINK]", +{% elif ('subtype' in DEVICE_METADATA['localhost']) and (DEVICE_METADATA['localhost']['subtype'] == 'DualToR') and (port in port_names_list_extra_queues) %} + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE_UPLINK]", +{% else %} + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", +{% endif %} {% else %} "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", {% endif %} +{% endif %} +{# Apply separated TC_TO_QUEUE_MAP to uplink ports on ToR #} +{% if different_tc_to_queue_map and tunnel_qos_remap_enable and port in port_names_list_extra_queues %} + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE_UPLINK]", +{% else %} "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", +{% endif %} "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", {% if asic_type in pfc_to_pg_map_supported_asics %} +{% if port in port_names_list_extra_queues %} + "pfc_to_pg_map" : "[PFC_PRIORITY_TO_PRIORITY_GROUP_MAP|AZURE_DUALTOR]", +{% else %} "pfc_to_pg_map" : "[PFC_PRIORITY_TO_PRIORITY_GROUP_MAP|AZURE]", {% endif %} - "pfc_enable" : "3,4" +{% endif %} +{% if port in port_names_list_extra_queues %} + "pfc_enable" : "2,3,4,6", +{% else %} + "pfc_enable" : "3,4", +{% endif %} + "pfcwd_sw_enable" : "3,4" }{% if not loop.last %},{% endif %} {% endfor %} @@ -221,12 +304,21 @@ "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" }, {% endfor %} +{% if 'resource_type' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['resource_type'] in apollo_resource_types %} +{% for port in PORT_ACTIVE %} + "{{ port }}|4": { + "scheduler" : "[SCHEDULER|scheduler.2]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, +{% endfor %} +{% else %} {% for port in PORT_ACTIVE %} "{{ port }}|4": { "scheduler" : "[SCHEDULER|scheduler.1]", "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" }, {% endfor %} +{% endif %} {% for port in PORT_ACTIVE %} "{{ port }}|0": { "scheduler": "[SCHEDULER|scheduler.0]" @@ -239,17 +331,33 @@ {% endfor %} {% for port in PORT_ACTIVE %} "{{ port }}|2": { +{% if port in port_names_list_extra_queues %} + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" +{% else %} "scheduler": "[SCHEDULER|scheduler.0]" +{% endif %} }, {% endfor %} {% for port in PORT_ACTIVE %} "{{ port }}|5": { "scheduler": "[SCHEDULER|scheduler.0]" }, +{# DSCP 48 is mapped to QUEUE 7 in macro generate_dscp_to_tc_map #} +{% if (generate_dscp_to_tc_map is defined) and tunnel_qos_remap_enable %} + "{{ port }}|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, +{% endif %} {% endfor %} {% for port in PORT_ACTIVE %} "{{ port }}|6": { +{% if port in port_names_list_extra_queues %} + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" +{% else %} "scheduler": "[SCHEDULER|scheduler.0]" +{% endif %} }{% if not loop.last %},{% endif %} {% endfor %} diff --git a/files/build_templates/radv.service.j2 b/files/build_templates/radv.service.j2 index 5cf25a21046d..0427b7e60505 100644 --- a/files/build_templates/radv.service.j2 +++ b/files/build_templates/radv.service.j2 @@ -3,6 +3,8 @@ Description=Router advertiser container Requires=updategraph.service After=updategraph.service swss.service syncd.service Before=ntp-config.service +BindsTo=sonic.target +After=sonic.target StartLimitIntervalSec=1200 StartLimitBurst=3 @@ -15,4 +17,4 @@ Restart=always RestartSec=30 [Install] -WantedBy=multi-user.target +WantedBy=sonic.target diff --git a/files/build_templates/restapi.service.j2 b/files/build_templates/restapi.service.j2 index df1a50eb56c7..edc18167e93a 100644 --- a/files/build_templates/restapi.service.j2 +++ b/files/build_templates/restapi.service.j2 @@ -2,6 +2,8 @@ Description=RestAPI container Requires=updategraph.service After=updategraph.service +BindsTo=sonic.target +After=sonic.target Before=ntp-config.service [Service] @@ -13,4 +15,4 @@ Restart=always RestartSec=30 [Install] -WantedBy=multi-user.target \ No newline at end of file +WantedBy=sonic.target diff --git a/files/build_templates/sflow.service.j2 b/files/build_templates/sflow.service.j2 index e9d5a871432d..3d6a3c7f569d 100644 --- a/files/build_templates/sflow.service.j2 +++ b/files/build_templates/sflow.service.j2 @@ -2,6 +2,8 @@ Description=sFlow container Requisite=swss.service After=swss.service syncd.service hostcfgd.service +BindsTo=sonic.target +After=sonic.target Before=ntp-config.service StartLimitIntervalSec=1200 StartLimitBurst=3 @@ -15,4 +17,4 @@ Restart=always RestartSec=30 [Install] -WantedBy=multi-user.target +WantedBy=sonic.target diff --git a/files/build_templates/snmp.service.j2 b/files/build_templates/snmp.service.j2 index 4997ab737e37..47110c0a10f8 100644 --- a/files/build_templates/snmp.service.j2 +++ b/files/build_templates/snmp.service.j2 @@ -3,15 +3,15 @@ Description=SNMP container Requires=updategraph.service Requisite=swss.service After=updategraph.service swss.service syncd.service +BindsTo=sonic.target +After=sonic.target Before=ntp-config.service -Conflicts=snmp.timer StartLimitIntervalSec=1200 StartLimitBurst=3 [Service] -ExecStartPre=/usr/bin/{{docker_container_name}}.sh start -ExecStart=/usr/bin/{{docker_container_name}}.sh wait -ExecStop=/usr/bin/{{docker_container_name}}.sh stop +ExecStartPre=/usr/local/bin/{{docker_container_name}}.sh start +ExecStart=/usr/local/bin/{{docker_container_name}}.sh wait +ExecStop=/usr/local/bin/{{docker_container_name}}.sh stop Restart=always RestartSec=30 - diff --git a/files/build_templates/snmp.timer b/files/build_templates/snmp.timer index 1b3ccf633ce4..0d17391a73f6 100644 --- a/files/build_templates/snmp.timer +++ b/files/build_templates/snmp.timer @@ -1,6 +1,6 @@ [Unit] Description=Delays snmp container until SONiC has started -Conflicts=snmp.service +PartOf=snmp.service After=swss.service [Timer] @@ -9,4 +9,4 @@ OnBootSec=3min 30 sec Unit=snmp.service [Install] -WantedBy=timers.target swss.service +WantedBy=timers.target swss.service sonic-delayed.target diff --git a/files/build_templates/sonic-delayed.target b/files/build_templates/sonic-delayed.target new file mode 100644 index 000000000000..b3b5d760f136 --- /dev/null +++ b/files/build_templates/sonic-delayed.target @@ -0,0 +1,5 @@ +[Unit] +Description=SONiC delayed services target. + +[Install] +WantedBy=multi-user.target diff --git a/files/build_templates/sonic.target b/files/build_templates/sonic.target new file mode 100644 index 000000000000..4070e21a080e --- /dev/null +++ b/files/build_templates/sonic.target @@ -0,0 +1,5 @@ +[Unit] +Description=SONiC services target. + +[Install] +WantedBy=multi-user.target diff --git a/files/build_templates/sonic_debian_extension.j2 b/files/build_templates/sonic_debian_extension.j2 index a301bee59ebd..855018f0bedb 100644 --- a/files/build_templates/sonic_debian_extension.j2 +++ b/files/build_templates/sonic_debian_extension.j2 @@ -21,6 +21,12 @@ PLATFORM_DIR=$2 exit 1 } +IMAGE_DISTRO=$3 +[ -n "$IMAGE_DISTRO" ] || { + echo "Error: no or empty IMAGE_DISTRO argument" + exit 1 +} + ## Enable debug output for script set -x -e @@ -39,6 +45,7 @@ FILESYSTEM_ROOT_USR_SHARE="$FILESYSTEM_ROOT_USR/share" FILESYSTEM_ROOT_USR_SHARE_SONIC="$FILESYSTEM_ROOT_USR_SHARE/sonic" FILESYSTEM_ROOT_USR_SHARE_SONIC_SCRIPTS="$FILESYSTEM_ROOT_USR_SHARE_SONIC/scripts" FILESYSTEM_ROOT_USR_SHARE_SONIC_TEMPLATES="$FILESYSTEM_ROOT_USR_SHARE_SONIC/templates" +FILESYSTEM_ROOT_USR_SHARE_SONIC_FIRMWARE="$FILESYSTEM_ROOT_USR_SHARE_SONIC/firmware" FILESYSTEM_ROOT_ETC="$FILESYSTEM_ROOT/etc" FILESYSTEM_ROOT_ETC_SONIC="$FILESYSTEM_ROOT_ETC/sonic" @@ -54,22 +61,13 @@ sudo LANG=C chroot $FILESYSTEM_ROOT mount sysfs /sys -t sysfs sudo bash -c "echo \"DOCKER_OPTS=\"--storage-driver=overlay2\"\" >> $FILESYSTEM_ROOT/etc/default/docker" sudo cp files/docker/docker $FILESYSTEM_ROOT/etc/init.d/ -if [[ $CONFIGURED_ARCH == armhf || $CONFIGURED_ARCH == arm64 ]]; then +if [ $MULTIARCH_QEMU_ENVIRON == y ]; then SONIC_NATIVE_DOCKERD_FOR_DOCKERFS=" -H unix:///dockerfs/var/run/docker.sock " SONIC_NATIVE_DOCKERD_FOR_DOCKERFS_PID="cat `pwd`/dockerfs/var/run/docker.pid" else sudo chroot $FILESYSTEM_ROOT service docker start fi -# Apply apt configuration files -sudo cp $IMAGE_CONFIGS/apt/sources.list $FILESYSTEM_ROOT/etc/apt/ -sudo mkdir -p $FILESYSTEM_ROOT/etc/apt/sources.list.d/ -sudo cp -R $IMAGE_CONFIGS/apt/sources.list.d/${CONFIGURED_ARCH}/* $FILESYSTEM_ROOT/etc/apt/sources.list.d/ -cat $IMAGE_CONFIGS/apt/sonic-dev.gpg.key | sudo LANG=C chroot $FILESYSTEM_ROOT apt-key add - - -# Update apt's snapshot of its repos -sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get update - # Apply environtment configuration files sudo cp $IMAGE_CONFIGS/environment/environment $FILESYSTEM_ROOT/etc/ sudo cp $IMAGE_CONFIGS/environment/motd $FILESYSTEM_ROOT/etc/ @@ -79,6 +77,7 @@ sudo mkdir -p $FILESYSTEM_ROOT/etc/sonic/ sudo mkdir -p $FILESYSTEM_ROOT/etc/modprobe.d/ sudo mkdir -p $FILESYSTEM_ROOT/var/cache/sonic/ sudo mkdir -p $FILESYSTEM_ROOT_USR_SHARE_SONIC_TEMPLATES/ +sudo mkdir -p $FILESYSTEM_ROOT_USR_SHARE_SONIC_FIRMWARE/ # This is needed for Stretch and might not be needed for Buster where Linux create this directory by default. # Keeping it generic. It should not harm anyways. sudo mkdir -p $FILESYSTEM_ROOT_USR_LIB_SYSTEMD_SYSTEM @@ -101,6 +100,9 @@ sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y in python-dev \ python3-dev +# Install j2cli for handling jinja template +sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install "j2cli==0.3.10" + # Install Python client for Redis sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip2 install "redis==3.5.3" sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install "redis==3.5.3" @@ -193,19 +195,25 @@ sudo cp {{platform_common_py2_wheel_path}} $FILESYSTEM_ROOT/$PLATFORM_COMMON_PY2 sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip2 install $PLATFORM_COMMON_PY2_WHEEL_NAME sudo rm -rf $FILESYSTEM_ROOT/$PLATFORM_COMMON_PY2_WHEEL_NAME +# Install sonic-platform-common Python 3 package +PLATFORM_COMMON_PY3_WHEEL_NAME=$(basename {{platform_common_py3_wheel_path}}) +sudo cp {{platform_common_py3_wheel_path}} $FILESYSTEM_ROOT/$PLATFORM_COMMON_PY3_WHEEL_NAME +sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install $PLATFORM_COMMON_PY3_WHEEL_NAME +sudo rm -rf $FILESYSTEM_ROOT/$PLATFORM_COMMON_PY3_WHEEL_NAME + {% if pddf_support == "y" %} # Install pddf-platform-api-base Python 2 package PLATFORM_PDDF_COMMON_PY2_WHEEL_NAME=$(basename {{pddf_platform_api_base_py2_wheel_path}}) sudo cp {{pddf_platform_api_base_py2_wheel_path}} $FILESYSTEM_ROOT/$PLATFORM_PDDF_COMMON_PY2_WHEEL_NAME sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip2 install $PLATFORM_PDDF_COMMON_PY2_WHEEL_NAME sudo rm -rf $FILESYSTEM_ROOT/$PLATFORM_PDDF_COMMON_PY2_WHEEL_NAME -{% endif %} -# Install sonic-platform-common Python 3 package -PLATFORM_COMMON_PY3_WHEEL_NAME=$(basename {{platform_common_py3_wheel_path}}) -sudo cp {{platform_common_py3_wheel_path}} $FILESYSTEM_ROOT/$PLATFORM_COMMON_PY3_WHEEL_NAME -sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install $PLATFORM_COMMON_PY3_WHEEL_NAME -sudo rm -rf $FILESYSTEM_ROOT/$PLATFORM_COMMON_PY3_WHEEL_NAME +# Install pddf-platform-api-base Python 3 package +PLATFORM_PDDF_COMMON_PY3_WHEEL_NAME=$(basename {{pddf_platform_api_base_py3_wheel_path}}) +sudo cp {{pddf_platform_api_base_py3_wheel_path}} $FILESYSTEM_ROOT/$PLATFORM_PDDF_COMMON_PY3_WHEEL_NAME +sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install $PLATFORM_PDDF_COMMON_PY3_WHEEL_NAME +sudo rm -rf $FILESYSTEM_ROOT/$PLATFORM_PDDF_COMMON_PY3_WHEEL_NAME +{% endif %} {# Barefoot platform vendors' sonic_platform packages import the Python 'thrift' library #} {% if sonic_asic_platform == "barefoot" %} @@ -216,7 +224,7 @@ sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install thrift # Install system-health Python 3 package SYSTEM_HEALTH_PY3_WHEEL_NAME=$(basename {{system_health_py3_wheel_path}}) sudo cp {{system_health_py3_wheel_path}} $FILESYSTEM_ROOT/$SYSTEM_HEALTH_PY3_WHEEL_NAME -sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install $SYSTEM_HEALTH_PY3_WHEEL_NAME +sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install $SYSTEM_HEALTH_PY3_WHEEL_NAME docker==6.1.1 sudo rm -rf $FILESYSTEM_ROOT/$SYSTEM_HEALTH_PY3_WHEEL_NAME # Install prerequisites needed for installing the Python m2crypto package, used by sonic-utilities @@ -273,6 +281,9 @@ sudo dpkg --root=$FILESYSTEM_ROOT -i $debs_path/libpam-tacplus_*.deb || \ sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install -f sudo dpkg --root=$FILESYSTEM_ROOT -i $debs_path/libnss-tacplus_*.deb || \ sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install -f +# Install audisp-tacplus +sudo dpkg --root=$FILESYSTEM_ROOT -i $debs_path/audisp-tacplus_*.deb || \ + sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install -f # Disable tacplus by default sudo LANG=C chroot $FILESYSTEM_ROOT pam-auth-update --remove tacplus sudo sed -i -e '/^passwd/s/ tacplus//' $FILESYSTEM_ROOT/etc/nsswitch.conf @@ -298,8 +309,13 @@ sudo cp $IMAGE_CONFIGS/monit/monitrc $FILESYSTEM_ROOT/etc/monit/ sudo chmod 600 $FILESYSTEM_ROOT/etc/monit/monitrc sudo cp $IMAGE_CONFIGS/monit/conf.d/* $FILESYSTEM_ROOT/etc/monit/conf.d/ sudo chmod 600 $FILESYSTEM_ROOT/etc/monit/conf.d/* -sudo cp $IMAGE_CONFIGS/monit/process_checker $FILESYSTEM_ROOT/usr/bin/ -sudo chmod 755 $FILESYSTEM_ROOT/usr/bin/process_checker +sudo cp $IMAGE_CONFIGS/monit/container_checker $FILESYSTEM_ROOT/usr/bin/ +sudo chmod 755 $FILESYSTEM_ROOT/usr/bin/container_checker +sudo cp $IMAGE_CONFIGS/monit/memory_checker $FILESYSTEM_ROOT/usr/bin/ +sudo chmod 755 $FILESYSTEM_ROOT/usr/bin/memory_checker +sudo cp $IMAGE_CONFIGS/monit/restart_service $FILESYSTEM_ROOT/usr/bin/ +sudo chmod 755 $FILESYSTEM_ROOT/usr/bin/restart_service + # Install custom-built openssh sshd sudo dpkg --root=$FILESYSTEM_ROOT -i $debs_path/openssh-server_*.deb @@ -339,6 +355,10 @@ sudo mkdir -p $FILESYSTEM_ROOT/etc/systemd/system/syslog.socket.d sudo cp $IMAGE_CONFIGS/syslog/override.conf $FILESYSTEM_ROOT/etc/systemd/system/syslog.socket.d/override.conf sudo cp $IMAGE_CONFIGS/syslog/host_umount.sh $FILESYSTEM_ROOT/usr/bin/ +# Copy haveged override file +sudo mkdir -p $FILESYSTEM_ROOT/etc/systemd/system/ +sudo cp $IMAGE_CONFIGS/haveged/haveged.service $FILESYSTEM_ROOT_ETC/systemd/system/haveged.service + # Copy system-health files sudo LANG=C cp $IMAGE_CONFIGS/system-health/system-health.service $FILESYSTEM_ROOT_USR_LIB_SYSTEMD_SYSTEM echo "system-health.service" | sudo tee -a $GENERATED_SERVICE_FILE @@ -371,6 +391,9 @@ sudo cp files/dhcp/90-dhcp6-systcl.conf.j2 $FILESYSTEM_ROOT_USR_SHARE_SONIC_TEMP sudo cp $IMAGE_CONFIGS/interfaces/init_interfaces $FILESYSTEM_ROOT/etc/network/interfaces sudo mkdir -p $FILESYSTEM_ROOT/etc/network/interfaces.d +# System'd network udev rules +sudo cp $IMAGE_CONFIGS/systemd/network/* $FILESYSTEM_ROOT_ETC/systemd/network/ + # copy core file uploader files sudo cp $IMAGE_CONFIGS/corefile_uploader/core_uploader.service $FILESYSTEM_ROOT_USR_LIB_SYSTEMD_SYSTEM sudo LANG=C chroot $FILESYSTEM_ROOT systemctl disable core_uploader.service @@ -379,12 +402,31 @@ sudo cp $IMAGE_CONFIGS/corefile_uploader/core_analyzer.rc.json $FILESYSTEM_ROOT_ sudo chmod og-rw $FILESYSTEM_ROOT_ETC_SONIC/core_analyzer.rc.json sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install libffi-dev libssl-dev + +if [[ $CONFIGURED_ARCH == armhf ]]; then + # The azure-storage package depends on the cryptography package. Newer + # versions of cryptography require the rust compiler, the correct version + # for which is not readily available in buster. Hence we pre-install an + # older version here to satisfy the azure-storage dependency. + # Note: This is not a problem for other architectures as pre-built versions + # of cryptography are available for those. This sequence can be removed + # after upgrading to debian bullseye. + sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install cryptography==3.3.1 +fi sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install azure-storage==0.36.0 sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip3 install watchdog==0.10.3 {% if include_kubernetes == "y" %} +# Point to kubelet to /etc/resolv.conf +# +echo 'KUBELET_EXTRA_ARGS="--resolv-conf=/etc/resolv.conf --cgroup-driver=cgroupfs --node-ip=::"' | sudo tee -a $FILESYSTEM_ROOT/etc/default/kubelet + +# Copy Flannel conf file into sonic-templates +# +sudo cp $BUILD_TEMPLATES/kube_cni.10-flannel.conflist $FILESYSTEM_ROOT_USR_SHARE_SONIC_TEMPLATES/ + # Install remote Container mgmt package -# Required even if include_kubernetes != y, as it contains the +# Required even if include_kubernetes != y, as it contains the # the container wrapper for docker start/stop/wait commands. # SONIC_CTRMGMT_WHEEL_NAME=$(basename {{sonic_ctrmgmt_py3_wheel_path}}) @@ -399,6 +441,25 @@ sudo cp ${files_path}/container_startup.py ${FILESYSTEM_ROOT_USR_SHARE_SONIC_SCR sudo chmod a+x ${FILESYSTEM_ROOT_USR_SHARE_SONIC_SCRIPTS}/container_startup.py # Config file used by container mgmt scripts/service +fl="${files_path}/remote_ctr.config.json" +use_k8s_as_http_proxy=$(python3 -c 'import json +with open("'${fl}'", "r") as s: + d=json.load(s);print(d.get("use_k8s_as_http_proxy", "")) +') +if [ "${use_k8s_as_http_proxy}" == "y" ]; then + # create proxy files for docker using private IP which will + # be later directed to k8s master upon config + PROXY_INFO="${kube_docker_proxy}" + cat < /dev/null +[Service] +Environment="HTTP_PROXY=${PROXY_INFO}" +EOT + cat < /dev/null +[Service] +Environment="HTTPS_PROXY=${PROXY_INFO}" +EOT +fi + sudo cp ${files_path}/remote_ctr.config.json ${FILESYSTEM_ROOT_ETC_SONIC}/ # Remote container management service files @@ -408,7 +469,7 @@ sudo LANG=C chroot $FILESYSTEM_ROOT systemctl enable ctrmgrd.service # kubelet service is controlled by ctrmgrd daemon. sudo LANG=C chroot $FILESYSTEM_ROOT systemctl disable kubelet.service {% else %} -# container script for docker commands, which is required as +# container script for docker commands, which is required as # all docker commands are replaced with container commands. # So just copy that file only. # @@ -432,8 +493,16 @@ if [ -f platform/{{ sonic_asic_platform }}/peripheral_table.j2 ] then sudo cp platform/{{ sonic_asic_platform }}/peripheral_table.j2 $FILESYSTEM_ROOT/usr/share/sonic/templates/peripheral_table.j2 fi + +if [ -f platform/{{ sonic_asic_platform }}/zero_profiles.j2 ] +then + sudo cp platform/{{ sonic_asic_platform }}/zero_profiles.j2 $FILESYSTEM_ROOT/usr/share/sonic/templates/zero_profiles.j2 +fi {% endif %} +# Copy backend acl template +sudo cp $BUILD_TEMPLATES/backend_acl.j2 $FILESYSTEM_ROOT_USR_SHARE_SONIC_TEMPLATES/ + # Copy hostname configuration scripts sudo cp $IMAGE_CONFIGS/hostname/hostname-config.service $FILESYSTEM_ROOT_USR_LIB_SYSTEMD_SYSTEM echo "hostname-config.service" | sudo tee -a $GENERATED_SERVICE_FILE @@ -470,12 +539,24 @@ sudo cp $IMAGE_CONFIGS/config-setup/config-setup $FILESYSTEM_ROOT/usr/bin/config echo "config-setup.service" | sudo tee -a $GENERATED_SERVICE_FILE sudo LANG=C chroot $FILESYSTEM_ROOT systemctl enable config-setup.service +# Add delayed tacacs application service +sudo cp files/build_templates/tacacs-config.timer $FILESYSTEM_ROOT_USR_LIB_SYSTEMD_SYSTEM/ +echo "tacacs-config.timer" | sudo tee -a $GENERATED_SERVICE_FILE + +sudo cp files/build_templates/tacacs-config.service $FILESYSTEM_ROOT_USR_LIB_SYSTEMD_SYSTEM/ +echo "tacacs-config.service" | sudo tee -a $GENERATED_SERVICE_FILE + # Copy config-chassisdb script and service file j2 files/build_templates/config-chassisdb.service.j2 | sudo tee $FILESYSTEM_ROOT_USR_LIB_SYSTEMD_SYSTEM/config-chassisdb.service sudo cp $IMAGE_CONFIGS/config-chassisdb/config-chassisdb $FILESYSTEM_ROOT/usr/bin/config-chassisdb echo "config-chassisdb.service" | sudo tee -a $GENERATED_SERVICE_FILE sudo LANG=C chroot $FILESYSTEM_ROOT systemctl enable config-chassisdb.service +# Copy backend-acl script and service file +sudo cp $IMAGE_CONFIGS/backend_acl/backend-acl.service $FILESYSTEM_ROOT_USR_LIB_SYSTEMD_SYSTEM/backend-acl.service +sudo cp $IMAGE_CONFIGS/backend_acl/backend_acl.py $FILESYSTEM_ROOT/usr/bin/backend_acl.py +echo "backend-acl.service" | sudo tee -a $GENERATED_SERVICE_FILE + # Copy SNMP configuration files sudo cp $IMAGE_CONFIGS/snmp/snmp.yml $FILESYSTEM_ROOT/etc/sonic/ @@ -486,10 +567,6 @@ sudo cp $IMAGE_CONFIGS/constants/constants.yml $FILESYSTEM_ROOT/etc/sonic/ sudo cp $IMAGE_CONFIGS/sudoers/sudoers $FILESYSTEM_ROOT/etc/ sudo cp $IMAGE_CONFIGS/sudoers/sudoers.lecture $FILESYSTEM_ROOT/etc/ -# Copy systemd timer configuration -sudo cp $BUILD_TEMPLATES/pcie-check.timer $FILESYSTEM_ROOT_USR_LIB_SYSTEMD_SYSTEM -sudo LANG=C chroot $FILESYSTEM_ROOT systemctl enable pcie-check.timer - # Copy pcie-check service files sudo cp $IMAGE_CONFIGS/pcie-check/pcie-check.service $FILESYSTEM_ROOT_USR_LIB_SYSTEMD_SYSTEM echo "pcie-check.service" | sudo tee -a $GENERATED_SERVICE_FILE @@ -524,16 +601,30 @@ sudo LANG=C chroot $FILESYSTEM_ROOT depmod -a {{kversion}} sudo dpkg --root=$FILESYSTEM_ROOT -i {{deb}} || sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install -f --download-only sudo mkdir -p $FILESYSTEM_ROOT/$PLATFORM_DIR/{{dev}} -sudo cp {{ deb }} $FILESYSTEM_ROOT/$PLATFORM_DIR/{{dev}}/ +sudo mkdir -p $FILESYSTEM_ROOT/$PLATFORM_DIR/common +sudo cp {{ deb }} $FILESYSTEM_ROOT/$PLATFORM_DIR/common/ +sudo ln -sf "../common/{{ debfilename }}" "$FILESYSTEM_ROOT/$PLATFORM_DIR/{{dev}}/{{ debfilename }}" for f in $(find $FILESYSTEM_ROOT/var/cache/apt/archives -name "*.deb"); do - sudo mv $f $FILESYSTEM_ROOT/$PLATFORM_DIR/{{dev}}/ + sudo mv $f $FILESYSTEM_ROOT/$PLATFORM_DIR/common/ + sudo ln -sf "../common/$(basename $f)" "$FILESYSTEM_ROOT/$PLATFORM_DIR/{{dev}}/$(basename $f)" done sudo dpkg --root=$FILESYSTEM_ROOT -P {{ debname }} {% endfor %} +# create a trivial apt repo if any of the debs have dependencies, including between lazy debs +if [ $(for f in $FILESYSTEM_ROOT/$PLATFORM_DIR/common/*.deb; do \ + sudo dpkg -I $f | grep "Depends:\|Pre-Depends:"; done | wc -l) -gt 0 ]; then + (cd $FILESYSTEM_ROOT/$PLATFORM_DIR/common && sudo dpkg-scanpackages . | \ + sudo gzip | sudo tee Packages.gz > /dev/null) +fi {% endif %} +# Remove sshd host keys, and will regenerate on first sshd start. This needs to be +# done again here because our custom version of sshd is being installed, which +# will regenerate the sshd host keys. +sudo rm -f $FILESYSTEM_ROOT/etc/ssh/ssh_host_*_key* + sudo rm -f $FILESYSTEM_ROOT/usr/sbin/policy-rc.d # Copy fstrim service and timer file, enable fstrim timer @@ -555,17 +646,19 @@ EOF {% endif %} ## Bind docker path -if [[ $CONFIGURED_ARCH == armhf || $CONFIGURED_ARCH == arm64 ]]; then +if [ $MULTIARCH_QEMU_ENVIRON == y ]; then sudo mkdir -p $FILESYSTEM_ROOT/dockerfs sudo mount --bind dockerfs $FILESYSTEM_ROOT/dockerfs fi {% if installer_images.strip() -%} -clean_proc() { - sudo umount /proc || true -} -trap_push clean_proc -sudo mount proc /proc -t proc +## ensure proc is mounted +sudo mount proc /proc -t proc || true +if [[ $CONFIGURED_ARCH == armhf ]]; then + # A workaround to fix the armhf build hung issue, caused by sonic-platform-nokia-7215_1.0_armhf.deb post installation script + ps -eo pid,cmd | grep python | grep "/etc/entropy.py" | awk '{print $1}' | xargs sudo kill -9 2>/dev/null || true +fi + sudo mkdir $FILESYSTEM_ROOT/target sudo mount --bind target $FILESYSTEM_ROOT/target sudo chroot $FILESYSTEM_ROOT docker $SONIC_NATIVE_DOCKERD_FOR_DOCKERFS info @@ -584,20 +677,19 @@ sudo LANG=C chroot $FILESYSTEM_ROOT docker $SONIC_NATIVE_DOCKERD_FOR_DOCKERFS ta {% if include_kubernetes == "y" %} ## Pull in kubernetes docker images echo "pulling universal k8s images ..." -sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT docker pull k8s.gcr.io/pause:${K8s_GCR_IO_PAUSE_VERSION} +sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT docker $SONIC_NATIVE_DOCKERD_FOR_DOCKERFS pull k8s.gcr.io/pause:${K8s_GCR_IO_PAUSE_VERSION} echo "docker images pull complete" {% endif %} sudo umount $FILESYSTEM_ROOT/target sudo rm -r $FILESYSTEM_ROOT/target -if [[ $CONFIGURED_ARCH == armhf || $CONFIGURED_ARCH == arm64 ]]; then +if [ $MULTIARCH_QEMU_ENVIRON == y ]; then sudo umount $FILESYSTEM_ROOT/dockerfs sudo rm -fr $FILESYSTEM_ROOT/dockerfs sudo kill -9 `sudo $SONIC_NATIVE_DOCKERD_FOR_DOCKERFS_PID` || true else sudo chroot $FILESYSTEM_ROOT service docker stop fi -sudo umount /proc || true sudo rm $FILESYSTEM_ROOT/etc/init.d/docker sudo bash -c "echo { > $FILESYSTEM_ROOT_USR_SHARE_SONIC_TEMPLATES/ctr_image_names.json" @@ -631,6 +723,19 @@ if [ -f {{service}} ]; then echo "{{service}}" | sudo tee -a $GENERATED_SERVICE_FILE fi {% endfor %} +{% for timer in installer_timers.split(' ') -%} +if [ -f {{timer}} ]; then + sudo cp {{timer}} $FILESYSTEM_ROOT_USR_LIB_SYSTEMD_SYSTEM + + {% if "@" in timer %} + MULTI_INSTANCE="{{timer}}" + SINGLE_INSTANCE=${MULTI_INSTANCE/"@"} + sudo cp $SINGLE_INSTANCE $FILESYSTEM_ROOT_USR_LIB_SYSTEMD_SYSTEM + {% endif %} + + echo "{{timer}}" | sudo tee -a $GENERATED_SERVICE_FILE +fi +{% endfor %} if [ -f iccpd.service ]; then sudo LANG=C chroot $FILESYSTEM_ROOT systemctl disable iccpd.service fi @@ -646,10 +751,20 @@ sudo LANG=C cp $SCRIPTS_DIR/gbsyncd.sh $FILESYSTEM_ROOT/usr/local/bin/gbsyncd.sh sudo LANG=C cp $SCRIPTS_DIR/bgp.sh $FILESYSTEM_ROOT/usr/local/bin/bgp.sh sudo LANG=C cp $SCRIPTS_DIR/teamd.sh $FILESYSTEM_ROOT/usr/local/bin/teamd.sh sudo LANG=C cp $SCRIPTS_DIR/radv.sh $FILESYSTEM_ROOT/usr/local/bin/radv.sh +sudo LANG=C cp $SCRIPTS_DIR/database.sh $FILESYSTEM_ROOT/usr/local/bin/database.sh +sudo LANG=C cp $SCRIPTS_DIR/snmp.sh $FILESYSTEM_ROOT/usr/local/bin/snmp.sh +sudo LANG=C cp $SCRIPTS_DIR/telemetry.sh $FILESYSTEM_ROOT/usr/local/bin/telemetry.sh +sudo LANG=C cp $SCRIPTS_DIR/mgmt-framework.sh $FILESYSTEM_ROOT/usr/local/bin/mgmt-framework.sh # Copy sonic-netns-exec script sudo LANG=C cp $SCRIPTS_DIR/sonic-netns-exec $FILESYSTEM_ROOT/usr/bin/sonic-netns-exec +# Copy write_standby script for mux state +sudo LANG=C cp $SCRIPTS_DIR/write_standby.py $FILESYSTEM_ROOT/usr/local/bin/write_standby.py + +# Copy mark_dhcp_packet script +sudo LANG=C cp $SCRIPTS_DIR/mark_dhcp_packet.py $FILESYSTEM_ROOT/usr/local/bin/mark_dhcp_packet.py + # Copy systemd timer configuration # It implements delayed start of services sudo cp $BUILD_TEMPLATES/snmp.timer $FILESYSTEM_ROOT_USR_LIB_SYSTEMD_SYSTEM @@ -665,6 +780,15 @@ sudo cp $BUILD_TEMPLATES/mgmt-framework.timer $FILESYSTEM_ROOT_USR_LIB_SYSTEMD_S echo "mgmt-framework.timer" | sudo tee -a $GENERATED_SERVICE_FILE {% endif %} +sudo cp $BUILD_TEMPLATES/pmon.timer $FILESYSTEM_ROOT_USR_LIB_SYSTEMD_SYSTEM +echo "pmon.timer" | sudo tee -a $GENERATED_SERVICE_FILE + +sudo cp $BUILD_TEMPLATES/sonic.target $FILESYSTEM_ROOT_USR_LIB_SYSTEMD_SYSTEM +sudo LANG=C chroot $FILESYSTEM_ROOT systemctl enable sonic.target + +sudo cp $BUILD_TEMPLATES/sonic-delayed.target $FILESYSTEM_ROOT_USR_LIB_SYSTEMD_SYSTEM +sudo LANG=C chroot $FILESYSTEM_ROOT systemctl enable sonic-delayed.target + sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get purge -y python-dev python3-dev sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get purge -y build-essential libssl-dev swig sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get clean -y @@ -680,10 +804,30 @@ sudo cp {{src}} $FILESYSTEM_ROOT/{{dst}} {% if sonic_asic_platform == "mellanox" %} sudo mkdir -p $FILESYSTEM_ROOT/etc/mlnx/ -sudo cp $files_path/$MLNX_SPC_FW_FILE $FILESYSTEM_ROOT/etc/mlnx/fw-SPC.mfa -sudo cp $files_path/$MLNX_SPC2_FW_FILE $FILESYSTEM_ROOT/etc/mlnx/fw-SPC2.mfa -sudo cp $files_path/$MLNX_SPC3_FW_FILE $FILESYSTEM_ROOT/etc/mlnx/fw-SPC3.mfa -sudo cp $files_path/$ISSU_VERSION_FILE $FILESYSTEM_ROOT/etc/mlnx/issu-version + +if [ -n "$MLNX_BIOS_ARCHIVES" ]; then +sudo mkdir -p $FILESYSTEM_ROOT/etc/mlnx/bios/ +sudo mkdir -p $FILESYSTEM_ROOT/$PLATFORM_DIR/fw/bios/ +for MLNX_BIOS_ARCHIVE in $MLNX_BIOS_ARCHIVES; do + sudo cp $files_path/$MLNX_BIOS_ARCHIVE $FILESYSTEM_ROOT/$PLATFORM_DIR/fw/bios/ + # Link old BIOS location to not break existing automation/scripts + sudo ln -s /host/image-$SONIC_IMAGE_VERSION/$PLATFORM_DIR/fw/bios/$MLNX_BIOS_ARCHIVE $FILESYSTEM_ROOT/etc/mlnx/bios/$MLNX_BIOS_ARCHIVE +done +fi + +declare -rA FW_FILE_MAP=( \ + [$MLNX_SPC_FW_FILE]="fw-SPC.mfa" \ + [$MLNX_SPC2_FW_FILE]="fw-SPC2.mfa" \ + [$MLNX_SPC3_FW_FILE]="fw-SPC3.mfa" \ +) +sudo mkdir -p $FILESYSTEM_ROOT/$PLATFORM_DIR/fw/asic/ +for fw_file_name in ${!FW_FILE_MAP[@]}; do + sudo cp $files_path/$fw_file_name $FILESYSTEM_ROOT/$PLATFORM_DIR/fw/asic/${FW_FILE_MAP[$fw_file_name]} + # Link old FW location to not break existing automation/scripts + sudo ln -s /host/image-$SONIC_IMAGE_VERSION/$PLATFORM_DIR/fw/asic/${FW_FILE_MAP[$fw_file_name]} $FILESYSTEM_ROOT/etc/mlnx/${FW_FILE_MAP[$fw_file_name]} +done +sudo cp $files_path/$ISSU_VERSION_FILE $FILESYSTEM_ROOT/$PLATFORM_DIR/fw/asic/issu-version +sudo ln -s /host/image-$SONIC_IMAGE_VERSION/$PLATFORM_DIR/fw/asic/issu-version $FILESYSTEM_ROOT/etc/mlnx/issu-version sudo cp $files_path/$MLNX_FFB_SCRIPT $FILESYSTEM_ROOT/usr/bin/mlnx-ffb.sh sudo cp $files_path/$MLNX_ONIE_FW_UPDATE $FILESYSTEM_ROOT/usr/bin/$MLNX_ONIE_FW_UPDATE sudo cp $files_path/$MLNX_SSD_FW_UPDATE $FILESYSTEM_ROOT/usr/bin/$MLNX_SSD_FW_UPDATE diff --git a/files/build_templates/swss_vars.j2 b/files/build_templates/swss_vars.j2 index a9bd01565c89..d720a61e674f 100644 --- a/files/build_templates/swss_vars.j2 +++ b/files/build_templates/swss_vars.j2 @@ -2,5 +2,6 @@ "asic_type": "{{ asic_type }}", "asic_id": "{{ DEVICE_METADATA.localhost.asic_id }}", "mac": "{{ DEVICE_METADATA.localhost.mac }}", - "synchronous_mode": {% if DEVICE_METADATA.localhost.synchronous_mode == "disable" %}"disable"{% else %}"enable"{% endif %} + "synchronous_mode": {% if DEVICE_METADATA.localhost.synchronous_mode == "disable" %}"disable"{% else %}"enable"{% endif %}, + "resource_type": "{{ DEVICE_METADATA.localhost.resource_type }}" } diff --git a/files/build_templates/tacacs-config.service b/files/build_templates/tacacs-config.service new file mode 100644 index 000000000000..27e0e6891ec6 --- /dev/null +++ b/files/build_templates/tacacs-config.service @@ -0,0 +1,12 @@ +[Unit] +Description=TACACS application +Requires=updategraph.service +After=updategraph.service +BindsTo=sonic.target +After=sonic.target + +[Service] +Type=oneshot +ExecStart=/usr/bin/config-setup apply_tacacs +RemainAfterExit=yes + diff --git a/files/build_templates/tacacs-config.timer b/files/build_templates/tacacs-config.timer new file mode 100644 index 000000000000..28314e06f4cb --- /dev/null +++ b/files/build_templates/tacacs-config.timer @@ -0,0 +1,12 @@ +[Unit] +Description=Delays tacacs apply until SONiC has started +PartOf=tacacs-config.service +After=updategraph.service + +[Timer] +OnUnitActiveSec=0 sec +OnBootSec=5min 30 sec +Unit=tacacs-config.service + +[Install] +WantedBy=timers.target updategraph.service diff --git a/files/build_templates/telemetry.service.j2 b/files/build_templates/telemetry.service.j2 index 43fa039156d7..5fb9c4d6af23 100644 --- a/files/build_templates/telemetry.service.j2 +++ b/files/build_templates/telemetry.service.j2 @@ -3,14 +3,15 @@ Description=Telemetry container Requires=database.service After=database.service swss.service syncd.service Before=ntp-config.service +BindsTo=sonic.target +After=sonic.target StartLimitIntervalSec=1200 StartLimitBurst=3 [Service] User={{ sonicadmin_user }} -ExecStartPre=/usr/bin/{{docker_container_name}}.sh start -ExecStart=/usr/bin/{{docker_container_name}}.sh wait -ExecStop=/usr/bin/{{docker_container_name}}.sh stop +ExecStartPre=/usr/local/bin/{{docker_container_name}}.sh start +ExecStart=/usr/local/bin/{{docker_container_name}}.sh wait +ExecStop=/usr/local/bin/{{docker_container_name}}.sh stop Restart=always RestartSec=30 - diff --git a/files/build_templates/telemetry.timer b/files/build_templates/telemetry.timer index e08f1c09eac6..0745f5369add 100644 --- a/files/build_templates/telemetry.timer +++ b/files/build_templates/telemetry.timer @@ -1,9 +1,11 @@ [Unit] Description=Delays telemetry container until SONiC has started +PartOf=telemetry.service [Timer] +OnUnitActiveSec=0 sec OnBootSec=3min 30 sec Unit=telemetry.service [Install] -WantedBy=timers.target +WantedBy=timers.target sonic.target sonic-delayed.target diff --git a/files/image_config/apt/sonic-dev.gpg.key b/files/image_config/apt/sonic-dev.gpg.key deleted file mode 100644 index fb9a37901bc7..000000000000 --- a/files/image_config/apt/sonic-dev.gpg.key +++ /dev/null @@ -1,30 +0,0 @@ ------BEGIN PGP PUBLIC KEY BLOCK----- -Version: GnuPG v1 - -mQENBFQ1bTIBCAC7oGfkv/ck0XsLuG8cdcSB2ISqxFAcBvH9BitEtxmpW2uhykKk -xY4rVD/4Uys1s3PF1/64QfPR+hYcewueOwz0ZAcLyFXXk4McICXaPq3NrLiWYKKX -UZLnrPzcrGZoW/kHDDp4OmBiDmT1PGvZlpuimwkMCusUzIr7Cbbp2dIy8MERL5tA -LcgLu3KL6clJ+aTW2jgepI1D7sTepOeGd7eRSb5njKg2M7k/93v/7MipZxiVtyXH -B74YiK6jSbst5JpuYsLa/Dqryvx7Xq3n53oif892pv3euTduo1fYw8Hgh/OOYdeT -c9WCj03KA1jCSFURjdrug0kR8BPlfjqtRLXFABEBAAG0JE1TIE9wZW4gVGVjaCA8 -aW50ZXJvcEBtaWNyb3NvZnQuY29tPokBOAQTAQIAIgUCVDVtMgIbAwYLCQgHAwIG -FQgCCQoLBBYCAwECHgECF4AACgkQsCxG30F6CJO1uAf/cmL68bM8YgF/61hkaY56 -LqrppUTJH/w4fKq47Pf6KfgSLvxfNU6soi2KHYRjIvTRx3tV4vUM5n2plaQg2s8V -/Epg4FeIRTk75YwiHAzLhLnp5cdUaTvC4j4mwxoB6j9Ty+fXJwQ0MvpDhIZb9vM4 -GXw/fEQHCT4f3gx4nReeqE+FB2wVHleX9+Lpodu98JyJTKJRBRHYLqy6S+/lyp2W -aBlsI1LOqBcx1uRK24U7duIpbYwIyrx0cafSruqR2GjVdu+imkhHyUn52VbzYhq1 -af0rqYiZ1VOamVOG0By8+hVyNa1MLc1K2uWGs0o5fDe9F5/swbvLHVXI+M50Vs+m -J7kBDQRUNW0yAQgAu7DkTVj0ZQC4F7bFivAwrdby8gCakTXOl1kcK622hjRJ8nam -aZeW+eADfLRsTmdUmXgZu1YWS5Gn2ZVngC8SGPUBT071+oRETCz4uNB7IimB9QfP -++orI6o2vmnVVsq5wWCbEdNU+TCVv1zjrYev5lwckkKpjHt6o8MNoX2DFuQymSyR -eZKaqhdKmcji4Ke7OIYqwgPjch3wxzE1b5gNOR/iwxWyjjOffZPLr/VhIfIJRs86 -dSXrwjHtEh810SKDLghHM0VAdY34nyC5ZZ61yhts5HtQDFK+9mNpH1mkc4gDBlgG -266pVvknumK6lPNm/osF/cpjWmEw24ypcQIvOQARAQABiQEfBBgBAgAJBQJUNW0y -AhsMAAoJELAsRt9BegiTMBUH/0sZ6gZy7mCTSAYT+NSXLFtGC2zNUVL80SWvfgYm -k9XPVI22MrefZfQ6M01RylyxtWXjRM8UoN8SDKWPpXumzJf831f/7om5zwutaG7b -tjDPYqRKJSbAIFZu2mN+uLrNQ2SV6XK7FoV0dtcrEX9S7RICb6i19D+70+Oh/qgU -R04H1jqS29XBzqAlIzdBoA+sYAwbOIJsSL3YyNQcUv3B5+5yR/bo/L8pnUJt6iuL -nWW+mi7r8gWPHDSrcdYq1TmmlOM7CwZPgWRZzkQPSeZz52Tt7IP47eyGJ09U4PIf -FtMH1ElL2UgHoA/F9Q88e7LkztaTqE59uXWbIYyuSMJVvRU= -=sb3d ------END PGP PUBLIC KEY BLOCK----- diff --git a/files/image_config/apt/sources.list.d/amd64/debian_archive_trafficmanager_net_debian.list b/files/image_config/apt/sources.list.d/amd64/debian_archive_trafficmanager_net_debian.list deleted file mode 100644 index d35c618112bb..000000000000 --- a/files/image_config/apt/sources.list.d/amd64/debian_archive_trafficmanager_net_debian.list +++ /dev/null @@ -1,3 +0,0 @@ -deb [arch=amd64] http://debian-archive.trafficmanager.net/debian/ buster main contrib non-free -deb [arch=amd64] http://debian-archive.trafficmanager.net/debian-security/ buster/updates main contrib non-free -deb [arch=amd64] http://debian-archive.trafficmanager.net/debian/ buster-backports main contrib non-free diff --git a/files/image_config/apt/sources.list.d/arm64/debian_mirror_arm64.list b/files/image_config/apt/sources.list.d/arm64/debian_mirror_arm64.list deleted file mode 100644 index 9e7dec92d39e..000000000000 --- a/files/image_config/apt/sources.list.d/arm64/debian_mirror_arm64.list +++ /dev/null @@ -1,9 +0,0 @@ -deb [arch=arm64] http://deb.debian.org/debian buster main contrib non-free -deb-src [arch=arm64] http://deb.debian.org/debian buster main contrib non-free -deb [arch=arm64] http://deb.debian.org/debian buster-updates main contrib non-free -deb-src [arch=arm64] http://deb.debian.org/debian buster-updates main contrib non-free -deb [arch=arm64] http://security.debian.org buster/updates main contrib non-free -deb-src [arch=arm64] http://security.debian.org buster/updates main contrib non-free -deb [arch=arm64] https://download.docker.com/linux/debian buster stable -deb [arch=arm64] http://ftp.debian.org/debian buster-backports main - diff --git a/files/image_config/apt/sources.list.d/armhf/debian_mirror_armhf.list b/files/image_config/apt/sources.list.d/armhf/debian_mirror_armhf.list deleted file mode 100644 index a7b831ef301c..000000000000 --- a/files/image_config/apt/sources.list.d/armhf/debian_mirror_armhf.list +++ /dev/null @@ -1,9 +0,0 @@ -deb [arch=armhf] http://deb.debian.org/debian buster main contrib non-free -deb-src [arch=armhf] http://deb.debian.org/debian buster main contrib non-free -deb [arch=armhf] http://deb.debian.org/debian buster-updates main contrib non-free -deb-src [arch=armhf] http://deb.debian.org/debian buster-updates main contrib non-free -deb [arch=armhf] http://security.debian.org buster/updates main contrib non-free -deb-src [arch=armhf] http://security.debian.org buster/updates main contrib non-free -deb [arch=armhf] https://download.docker.com/linux/debian buster stable -deb [arch=armhf] http://ftp.debian.org/debian buster-backports main - diff --git a/files/image_config/backend_acl/backend-acl.service b/files/image_config/backend_acl/backend-acl.service new file mode 100644 index 000000000000..0ad24231ee4b --- /dev/null +++ b/files/image_config/backend_acl/backend-acl.service @@ -0,0 +1,12 @@ +[Unit] +Description=Enable backend acl on storage backend ToRs +After=swss.service +BindsTo=sonic.target +After=sonic.target + +[Service] +Type=oneshot +ExecStart=/usr/bin/backend_acl.py + +[Install] +WantedBy=sonic.target diff --git a/files/image_config/backend_acl/backend_acl.py b/files/image_config/backend_acl/backend_acl.py new file mode 100755 index 000000000000..bb22a60880ab --- /dev/null +++ b/files/image_config/backend_acl/backend_acl.py @@ -0,0 +1,94 @@ +#!/usr/bin/env python + +import os +import subprocess +import syslog +import time + +from swsscommon.swsscommon import SonicV2Connector + +SYSLOG_IDENTIFIER = os.path.basename(__file__) + +SONIC_CFGGEN_PATH = '/usr/local/bin/sonic-cfggen' + +def log_info(msg): + syslog.openlog(SYSLOG_IDENTIFIER) + syslog.syslog(syslog.LOG_INFO, msg) + syslog.closelog() + +def run_command(cmd, return_cmd=False): + log_info("executing cmd = {}".format(cmd)) + proc = subprocess.Popen(cmd, shell=False, stdout=subprocess.PIPE) + out, err = proc.communicate() + if return_cmd: + if err: + return "Unknown" + + if len(out) > 0: + return out.strip().decode('utf-8') + +def _get_device_type(): + """ + Get device type + """ + device_type = run_command([SONIC_CFGGEN_PATH, '-m', '-v', 'DEVICE_METADATA.localhost.type'], return_cmd=True) + return device_type + +def _is_storage_device(): + """ + Check if the device is a storage device or not + """ + storage_device = run_command([SONIC_CFGGEN_PATH, '-d', '-v', 'DEVICE_METADATA.localhost.storage_device'], return_cmd=True) + return storage_device == "true" + +def _is_acl_table_present(): + """ + Check if acl table exists + """ + acl_table = run_command([SONIC_CFGGEN_PATH, '-d', '-v', 'ACL_TABLE.DATAACL'], return_cmd=True) + return (acl_table != "Unknown" and bool(acl_table)) + +def _is_switch_table_present(): + state_db = SonicV2Connector(host='127.0.0.1') + state_db.connect(state_db.STATE_DB, False) + table_present = False + wait_time = 0 + TIMEOUT = 120 + STEP = 10 + + while wait_time < TIMEOUT: + if state_db.exists(state_db.STATE_DB, 'SWITCH_CAPABILITY|switch'): + table_present = True + break + time.sleep(STEP) + wait_time += STEP + if not table_present: + log_info("Switch table not present") + return table_present + +def load_backend_acl(device_type): + """ + Load acl on backend storage device + """ + BACKEND_ACL_TEMPLATE_FILE = os.path.join('/', "usr", "share", "sonic", "templates", "backend_acl.j2") + BACKEND_ACL_FILE = os.path.join('/', "etc", "sonic", "backend_acl.json") + + # this acl needs to be loaded only on a storage backend ToR. acl load will fail if the switch table isn't present + if _is_storage_device() and _is_acl_table_present() and _is_switch_table_present(): + if os.path.isfile(BACKEND_ACL_TEMPLATE_FILE): + run_command(['sudo', SONIC_CFGGEN_PATH, '-d', '-t', '{},{}'.format(BACKEND_ACL_TEMPLATE_FILE, BACKEND_ACL_FILE)]) + if os.path.isfile(BACKEND_ACL_FILE): + run_command(['acl-loader', 'update', 'incremental', BACKEND_ACL_FILE]) + else: + log_info("Skipping backend acl load - conditions not met") + +def main(): + device_type = _get_device_type() + if device_type != "BackEndToRRouter": + log_info("Skipping backend acl load on unsupported device type: {}".format(device_type)) + return + + load_backend_acl(device_type) + +if __name__ == "__main__": + main() diff --git a/files/image_config/bash/bash.bashrc b/files/image_config/bash/bash.bashrc index 0f19263ae04a..96f54776f945 100644 --- a/files/image_config/bash/bash.bashrc +++ b/files/image_config/bash/bash.bashrc @@ -55,7 +55,7 @@ if [ -x /usr/lib/command-not-found -o -x /usr/share/command-not-found/command-no fi # Automatically log out console ttyS* sessions after 15 minutes of inactivity -tty | grep ttyS >/dev/null && TMOUT=900 +tty | egrep -q '^/dev/ttyS[[:digit:]]+$' && TMOUT=900 # if SSH_TARGET_CONSOLE_LINE was set, attach to console line interactive cli directly if [ -n "$SSH_TARGET_CONSOLE_LINE" ]; then diff --git a/files/image_config/config-setup/config-setup b/files/image_config/config-setup/config-setup index 8db3d5c1b4eb..de39586fd4f8 100755 --- a/files/image_config/config-setup/config-setup +++ b/files/image_config/config-setup/config-setup @@ -41,6 +41,8 @@ CONFIG_SETUP_PRE_MIGRATION_FLAG=${CONFIG_SETUP_VAR_DIR}/pending_pre_migration CONFIG_SETUP_POST_MIGRATION_FLAG=${CONFIG_SETUP_VAR_DIR}/pending_post_migration CONFIG_SETUP_INITIALIZATION_FLAG=${CONFIG_SETUP_VAR_DIR}/pending_initialization +TACACS_JSON_BACKUP=tacacs.json + # Command usage and help usage() { @@ -111,11 +113,26 @@ reload_minigraph() config save -y } +# Apply tacacs config +apply_tacacs() +{ + if [ -r /etc/sonic/old_config/${TACACS_JSON_BACKUP} ]; then + sonic-cfggen -j /etc/sonic/old_config/${TACACS_JSON_BACKUP} --write-to-db + echo "Applied tacacs json to restore tacacs credentials" + config save -y + else + echo "Missing tacacs json to restore tacacs credentials" + fi +} + # Reload exisitng config db file on disk +# Usage: reload_configdb reload_configdb() { + CONFIG_FILE=${1} + echo "Reloading existing config db..." - config reload -y -n + config reload ${CONFIG_FILE} -y -n } # Restore SONiC configuration from a backup copy function copy_config_files_and_directories() @@ -148,7 +165,7 @@ updategraph_is_enabled() rv=1 if [ -e ${UPDATEGRAPH_CONF} ]; then updategraph_mode=$(grep enabled ${UPDATEGRAPH_CONF} | head -n 1 | cut -f2 -d=) - [ "${updategraph_mode}" = "true" ] && rv = 0 + [ "${updategraph_mode}" = "true" ] && rv=0 fi return $rv } @@ -171,33 +188,6 @@ ztp_is_enabled() return $rv } -# Load requested SONiC configuration into config DB and initialize it -# Usage: load_config -# -# -load_config() -{ - CONFIG_FILE=${1} - if [ "${CONFIG_FILE}" = "" ]; then - return 1 - fi - - sonic-db-cli CONFIG_DB FLUSHDB - sonic-cfggen -j ${CONFIG_FILE} --write-to-db - if [ $? -ne 0 ]; then - return $? - fi - - if [[ -x /usr/local/bin/db_migrator.py ]]; then - # Migrate the DB to the latest schema version if needed - /usr/local/bin/db_migrator.py -o migrate - fi - - sonic-db-cli CONFIG_DB SET "CONFIG_DB_INITIALIZED" "1" - return 0 -} - - # Generate requested SONiC configuration and save it as destination file # Usage: generate_config < factory | ztp > # @@ -249,14 +239,14 @@ do_config_initialization() if ! ztp_is_enabled ; then echo "No configuration detected, generating factory default configuration..." generate_config factory ${CONFIG_DB_JSON} - load_config ${CONFIG_DB_JSON} + reload_configdb ${CONFIG_DB_JSON} fi fi if ztp_is_enabled ; then echo "No configuration detected, initiating zero touch provisioning..." generate_config ztp ${TMP_ZTP_CONFIG_DB_JSON} - load_config ${TMP_ZTP_CONFIG_DB_JSON} + reload_configdb ${TMP_ZTP_CONFIG_DB_JSON} rm -f ${TMP_ZTP_CONFIG_DB_JSON} fi @@ -313,7 +303,7 @@ check_all_config_db_present() do_config_migration() { # Identify list of files to migrate - copy_list="minigraph.xml snmp.yml acl.json frr telemetry" + copy_list="minigraph.xml snmp.yml acl.json port_config.json frr telemetry" # Migrate all configuration files from old to new copy_config_files_and_directories $copy_list @@ -438,4 +428,9 @@ if [ "$CMD" = "backup" ]; then do_config_backup fi +# Apply tacacs from old configuration +if [ "$CMD" = "apply_tacacs" ]; then + apply_tacacs +fi + exit 0 diff --git a/files/image_config/copp/copp-config.service b/files/image_config/copp/copp-config.service old mode 100755 new mode 100644 index 8eed2353eddf..bd15de80bc5f --- a/files/image_config/copp/copp-config.service +++ b/files/image_config/copp/copp-config.service @@ -2,10 +2,12 @@ Description=Update CoPP configuration Requires=updategraph.service After=updategraph.service +BindsTo=sonic.target +After=sonic.target [Service] Type=oneshot ExecStart=/usr/bin/copp-config.sh [Install] -WantedBy=multi-user.target +WantedBy=sonic.target diff --git a/files/image_config/copp/copp_cfg.j2 b/files/image_config/copp/copp_cfg.j2 index 61f051f43de8..702a055522ef 100755 --- a/files/image_config/copp/copp_cfg.j2 +++ b/files/image_config/copp/copp_cfg.j2 @@ -13,7 +13,7 @@ "trap_priority":"4", "queue": "4" }, - "queue4_group2": { + "queue4_group2": { "trap_action":"copy", "trap_priority":"4", "queue": "4", @@ -69,29 +69,33 @@ }, "lacp": { "trap_ids": "lacp", - "trap_group": "queue4_group1" + "trap_group": "queue4_group1", + "always_enabled": "true" }, "arp": { "trap_ids": "arp_req,arp_resp,neigh_discovery", - "trap_group": "queue4_group2" + "trap_group": "queue4_group2", + "always_enabled": "true" }, "lldp": { "trap_ids": "lldp", "trap_group": "queue4_group3" }, -{% if not (DEVICE_METADATA is defined and DEVICE_METADATA['localhost'] is defined and DEVICE_METADATA['localhost']['type'] is defined and DEVICE_METADATA['localhost']['type'] != "ToRRouter") %} - "dhcp": { +{% if not (DEVICE_METADATA is defined and DEVICE_METADATA['localhost'] is defined and DEVICE_METADATA['localhost']['type'] is defined and DEVICE_METADATA['localhost']['type'] is not in ['ToRRouter', 'EPMS', 'MgmtTsToR', 'MgmtToRRouter', 'BmcMgmtToRRouter']) %} + "dhcp_relay": { "trap_ids": "dhcp,dhcpv6", "trap_group": "queue4_group3" }, {% endif %} "udld": { "trap_ids": "udld", - "trap_group": "queue4_group3" + "trap_group": "queue4_group3", + "always_enabled": "true" }, "ip2me": { "trap_ids": "ip2me", - "trap_group": "queue1_group1" + "trap_group": "queue1_group1", + "always_enabled": "true" }, "nat": { "trap_ids": "src_nat_miss,dest_nat_miss", diff --git a/files/image_config/environment/motd b/files/image_config/environment/motd index 8562e330fe2c..0d857e5c5f94 100644 --- a/files/image_config/environment/motd +++ b/files/image_config/environment/motd @@ -10,5 +10,5 @@ You are on Unauthorized access and/or use are prohibited. All access and/or use are subject to monitoring. -Help: http://azure.github.io/SONiC/ +Help: https://sonic-net.github.io/SONiC/ diff --git a/files/image_config/fstrim/fstrim.timer b/files/image_config/fstrim/fstrim.timer index c6142dd94826..3ffb2332b7a6 100644 --- a/files/image_config/fstrim/fstrim.timer +++ b/files/image_config/fstrim/fstrim.timer @@ -1,6 +1,7 @@ [Unit] Description=Discard unused blocks once a week Documentation=man:fstrim +After=sonic.target [Timer] OnCalendar=weekly diff --git a/files/image_config/haveged/haveged.service b/files/image_config/haveged/haveged.service new file mode 100644 index 000000000000..361b1114b11e --- /dev/null +++ b/files/image_config/haveged/haveged.service @@ -0,0 +1,23 @@ +[Unit] +Description=Entropy daemon using the HAVEGE algorithm +Documentation=man:haveged(8) http://www.issihosts.com/haveged/ +DefaultDependencies=no +ConditionVirtualization=!container +After=apparmor.service systemd-tmpfiles-setup.service +Before=sysinit.target shutdown.target systemd-random-seed.service + +[Service] +EnvironmentFile=-/etc/default/haveged +ExecStart=/usr/sbin/haveged --Foreground --verbose=1 $DAEMON_ARGS +SuccessExitStatus=143 +SecureBits=noroot-locked +NoNewPrivileges=yes +CapabilityBoundingSet=CAP_SYS_ADMIN +PrivateTmp=yes +PrivateDevices=yes +PrivateNetwork=yes +ProtectSystem=full +ProtectHome=yes + +[Install] +WantedBy=default.target diff --git a/files/image_config/hostname/hostname-config.service b/files/image_config/hostname/hostname-config.service index c23ae10227a4..c82c2d0bf54e 100644 --- a/files/image_config/hostname/hostname-config.service +++ b/files/image_config/hostname/hostname-config.service @@ -2,10 +2,13 @@ Description=Update hostname based on configdb Requires=updategraph.service After=updategraph.service +BindsTo=sonic.target +After=sonic.target [Service] Type=oneshot +RemainAfterExit=yes ExecStart=/usr/bin/hostname-config.sh [Install] -WantedBy=multi-user.target +WantedBy=sonic.target diff --git a/files/image_config/hostname/hostname-config.sh b/files/image_config/hostname/hostname-config.sh index e9f7fc122709..c2a4f1e546ce 100755 --- a/files/image_config/hostname/hostname-config.sh +++ b/files/image_config/hostname/hostname-config.sh @@ -3,6 +3,11 @@ CURRENT_HOSTNAME=`hostname` HOSTNAME=`sonic-cfggen -d -v DEVICE_METADATA[\'localhost\'][\'hostname\']` +if [ -z "$HOSTNAME" ] ; then + echo "Missing hostname in the config file, setting to default 'sonic'" + HOSTNAME='sonic' +fi + echo $HOSTNAME > /etc/hostname hostname -F /etc/hostname diff --git a/files/image_config/interfaces/interfaces-config.service b/files/image_config/interfaces/interfaces-config.service index 71178affdee8..a3f715764616 100644 --- a/files/image_config/interfaces/interfaces-config.service +++ b/files/image_config/interfaces/interfaces-config.service @@ -2,10 +2,13 @@ Description=Update interfaces configuration Requires=updategraph.service After=updategraph.service +BindsTo=sonic.target +After=sonic.target [Service] Type=oneshot +RemainAfterExit=yes ExecStart=/usr/bin/interfaces-config.sh [Install] -WantedBy=multi-user.target +WantedBy=sonic.target diff --git a/files/image_config/interfaces/interfaces-config.sh b/files/image_config/interfaces/interfaces-config.sh index 688b2f8433a5..f6aa4147a4e4 100755 --- a/files/image_config/interfaces/interfaces-config.sh +++ b/files/image_config/interfaces/interfaces-config.sh @@ -1,13 +1,39 @@ #!/bin/bash -ifdown --force eth0 +function wait_networking_service_done() { + local -i _WDOG_CNT="1" + local -ir _WDOG_MAX="30" + + local -r _TIMEOUT="1s" + + while [[ "${_WDOG_CNT}" -le "${_WDOG_MAX}" ]]; do + networking_status="$(systemctl is-active networking 2>&1)" + + if [[ "${networking_status}" == active || "${networking_status}" == inactive || "${networking_status}" == failed ]] ; then + return + fi + + echo "interfaces-config: networking service is running, wait for it done" + + let "_WDOG_CNT++" + sleep "${_TIMEOUT}" + done + + echo "interfaces-config: networking service is still running after 30 seconds, killing it" + systemctl kill networking 2>&1 +} + +if [[ $(ifquery --running eth0) ]]; then + wait_networking_service_done + ifdown --force eth0 +fi # Check if ZTP DHCP policy has been installed -if [ -e /etc/network/ifupdown2/policy.d/ztp_dhcp.json ]; then +if [[ -e /etc/network/ifupdown2/policy.d/ztp_dhcp.json ]]; then # Obtain port operational state information redis-dump -d 0 -k "PORT_TABLE:Ethernet*" -y > /tmp/ztp_port_data.json - if [ $? -ne 0 ] || [ ! -e /tmp/ztp_port_data.json ] || [ "$(cat /tmp/ztp_port_data.json)" = "" ]; then + if [[ $? -ne 0 || ! -e /tmp/ztp_port_data.json || "$(cat /tmp/ztp_port_data.json)" = "" ]]; then echo "{}" > /tmp/ztp_port_data.json fi @@ -27,11 +53,11 @@ CFGGEN_PARAMS=" \ " sonic-cfggen $CFGGEN_PARAMS -[ -f /var/run/dhclient.eth0.pid ] && kill `cat /var/run/dhclient.eth0.pid` && rm -f /var/run/dhclient.eth0.pid -[ -f /var/run/dhclient6.eth0.pid ] && kill `cat /var/run/dhclient6.eth0.pid` && rm -f /var/run/dhclient6.eth0.pid +[[ -f /var/run/dhclient.eth0.pid ]] && kill `cat /var/run/dhclient.eth0.pid` && rm -f /var/run/dhclient.eth0.pid +[[ -f /var/run/dhclient6.eth0.pid ]] && kill `cat /var/run/dhclient6.eth0.pid` && rm -f /var/run/dhclient6.eth0.pid for intf_pid in $(ls -1 /var/run/dhclient*.Ethernet*.pid 2> /dev/null); do - [ -f ${intf_pid} ] && kill `cat ${intf_pid}` && rm -f ${intf_pid} + [[ -f ${intf_pid} ]] && kill `cat ${intf_pid}` && rm -f ${intf_pid} done # Read sysctl conf files again diff --git a/files/image_config/kdump/kdump-tools b/files/image_config/kdump/kdump-tools index 61a41eb31902..83c2766524d3 100644 --- a/files/image_config/kdump/kdump-tools +++ b/files/image_config/kdump/kdump-tools @@ -10,7 +10,7 @@ KDUMP_CMDLINE_APPEND="irqpoll nr_cpus=1 nousb systemd.unit=kdump-tools.service a # Disable advanced pcie features # Disable high precision event timer as on some platforms it is interfering with the kdump operation # Pass platform identifier string as part of crash kernel command line to be used by the reboot script during kdump -KDUMP_CMDLINE_APPEND+=" panic=10 debug hpet=disable pcie_port=compat pci=nommconf sonic_platform=__PLATFORM__" +KDUMP_CMDLINE_APPEND="${KDUMP_CMDLINE_APPEND} panic=10 debug hpet=disable pcie_port=compat pci=nommconf sonic_platform=__PLATFORM__" # Use SONiC reboot wrapper script present in /usr/local/bin post kdump PATH=/usr/local/bin:$PATH diff --git a/files/image_config/kdump/vmcore-sysctl.conf b/files/image_config/kdump/vmcore-sysctl.conf index 9a4016197cbd..1eb8646683a2 100755 --- a/files/image_config/kdump/vmcore-sysctl.conf +++ b/files/image_config/kdump/vmcore-sysctl.conf @@ -4,4 +4,3 @@ kernel.panic_on_io_nmi=1 kernel.panic_on_stackoverflow=1 kernel.hung_task_panic=1 kernel.unknown_nmi_panic=1 -vm.panic_on_oom=1 diff --git a/files/image_config/logrotate/logrotate.d/btmp b/files/image_config/logrotate/logrotate.d/btmp new file mode 100644 index 000000000000..e3554d3e6773 --- /dev/null +++ b/files/image_config/logrotate/logrotate.d/btmp @@ -0,0 +1,7 @@ +# no packages own btmp -- we'll rotate it here +/var/log/btmp { + missingok + size 100k + create 0660 root utmp + rotate 1 +} diff --git a/files/image_config/logrotate/logrotate.d/rsyslog b/files/image_config/logrotate/logrotate.d/rsyslog index 792e3e9a2d57..cbf6e722eb90 100644 --- a/files/image_config/logrotate/logrotate.d/rsyslog +++ b/files/image_config/logrotate/logrotate.d/rsyslog @@ -30,8 +30,8 @@ /var/log/telemetry.log /var/log/frr/bgpd.log /var/log/frr/zebra.log -/var/log/swss/sairedis.rec -/var/log/swss/swss.rec +/var/log/swss/sairedis*.rec +/var/log/swss/swss*.rec { size 1M rotate 5000 @@ -85,7 +85,22 @@ endscript postrotate if [ $(echo $1 | grep -c "/var/log/swss/") -gt 0 ]; then - pgrep -x orchagent | xargs /bin/kill -HUP 2>/dev/null || true + # for multi asic platforms, there are multiple orchagents + # send the SIGHUP only to the orchagent the which needs log file rotation + PLATFORM=`sonic-cfggen -H -v DEVICE_METADATA.localhost.platform` + ASIC_CONF=/usr/share/sonic/device/$PLATFORM/asic.conf + if [ -f "$ASIC_CONF" ]; then + . $ASIC_CONF + fi + if [ $NUM_ASIC -gt 1 ]; then + log_file=$1 + log_file_name=${log_file#/var/log/swss/} + logger -p syslog.info -t "logrotate" "Sending SIGHUP to OA log_file_name: $log_file_name" + pgrep -xa orchagent | grep $log_file_name | awk '{ print $1; }' | xargs /bin/kill -HUP 2>/dev/null || true + else + logger -p syslog.info -t "logrotate" "Sending SIGHUP to OA log_file_name: $1" + pgrep -x orchagent | xargs /bin/kill -HUP 2>/dev/null || true + fi else /bin/kill -HUP $(cat /var/run/rsyslogd.pid) fi diff --git a/files/image_config/logrotate/logrotate.d/wtmp b/files/image_config/logrotate/logrotate.d/wtmp new file mode 100644 index 000000000000..8eb2663e6b66 --- /dev/null +++ b/files/image_config/logrotate/logrotate.d/wtmp @@ -0,0 +1,7 @@ +# no packages own wtmp -- we'll rotate it here +/var/log/wtmp { + missingok + size 100k + create 0664 root utmp + rotate 1 +} diff --git a/files/image_config/monit/conf.d/sonic-host b/files/image_config/monit/conf.d/sonic-host index 202c49f8d7b2..ceebf1003eb2 100644 --- a/files/image_config/monit/conf.d/sonic-host +++ b/files/image_config/monit/conf.d/sonic-host @@ -31,3 +31,18 @@ check program routeCheck with path "/usr/local/bin/route_check.py" every 5 cycles if status != 0 for 3 cycle then alert repeat every 1 cycles +# Check if /etc & /home are writable. If not, make them writable. +# Raise syslog error message, in case of underlying issues +# +check program diskCheck with path "/usr/local/bin/disk_check.py" + every 5 cycles + if status != 0 for 3 cycle then alert repeat every 1 cycles + +check program container_checker with path "/usr/bin/container_checker" + if status != 0 for 5 times within 5 cycles then alert repeat every 1 cycles + +# vnet_route_check.py: tool that verifies VNET routes consistancy between SONiC and vendor SDK DBs. +check program vnetRouteCheck with path "/usr/local/bin/vnet_route_check.py" + every 5 cycles + if status != 0 for 3 cycle then alert repeat every 1 cycles + diff --git a/files/image_config/monit/container_checker b/files/image_config/monit/container_checker new file mode 100755 index 000000000000..63bd7b3e182d --- /dev/null +++ b/files/image_config/monit/container_checker @@ -0,0 +1,162 @@ +#!/usr/bin/env python3 + +""" +container_checker + +This script is intended to be run by Monit. It will write an alerting message into +syslog if it found containers which were expected to run but were not running. At +the same time, if some containers were unexpected to run, it also writes an alerting +syslog message. Note that if print(...) statement in this script was executed, the +string in it will be appended to Monit syslog messages. + +The following is an example in Monit configuration file to show how Monit will run +this script: + +check program container_checker with path "/usr/bin/container_checker" + if status != 0 for 5 times within 5 cycles then alert repeat every 1 cycles +""" + +import docker +import sys + +import swsssdk +from sonic_py_common import multi_asic +from swsscommon import swsscommon + + +def get_expected_running_containers(): + """ + @summary: This function will get the expected running & always-enabled containers by following the rule: + The 'state' field of container in 'FEATURE' table should not be 'disabled' or 'always_disabled'. + If the device has Multi-ASIC, this function will get container list by determining the + value of field 'has_global_scope', the number of ASICs and the value of field + 'has_per_asic_scope'. + If the device has single ASIC, the container name was put into the list. + @return: A set which contains the expected running containers and a set that has + containers marked as "always_enabled". + """ + config_db = swsssdk.ConfigDBConnector() + config_db.connect() + feature_table = config_db.get_table("FEATURE") + + expected_running_containers = set() + always_running_containers = set() + + for container_name in feature_table.keys(): + if feature_table[container_name]["state"] not in ["disabled", "always_disabled"]: + if multi_asic.is_multi_asic(): + if feature_table[container_name]["has_global_scope"] == "True": + expected_running_containers.add(container_name) + if feature_table[container_name]["has_per_asic_scope"] == "True": + num_asics = multi_asic.get_num_asics() + for asic_id in range(num_asics): + expected_running_containers.add(container_name + str(asic_id)) + else: + expected_running_containers.add(container_name) + if feature_table[container_name]["state"] == 'always_enabled': + if multi_asic.is_multi_asic(): + if feature_table[container_name]["has_global_scope"] == "True": + always_running_containers.add(container_name) + if feature_table[container_name]["has_per_asic_scope"] == "True": + num_asics = multi_asic.get_num_asics() + for asic_id in range(num_asics): + always_running_containers.add(container_name + str(asic_id)) + else: + always_running_containers.add(container_name) + return expected_running_containers, always_running_containers + +def get_current_running_from_DB(always_running_containers): + """ + @summary: This function will get the current running container list + from FEATURE table @ STATE_DB, if this table is available. + @return: a tuple + First: Return value indicating if info can be obtained from + DB or not. + Second: A set which contains the current running containers, + if this info is available in DB. + """ + running_containers = set() + + state_db = swsscommon.DBConnector("STATE_DB", 0) + tbl = swsscommon.Table(state_db, "FEATURE") + if not tbl.getKeys(): + return False, None + + for name in tbl.getKeys(): + data = dict(tbl.get(name)[1]) + if data.get('container_id'): + running_containers.add(name) + + DOCKER_CLIENT = docker.DockerClient(base_url='unix://var/run/docker.sock') + RUNNING = 'running' + for name in always_running_containers: + try: + container = DOCKER_CLIENT.containers.get(name) + container_state = container.attrs.get('State', {}) + if container_state.get('Status', "") == RUNNING: + running_containers.add(name) + except (docker.errors.NotFound, docker.errors.APIError) as err: + print("Failed to get container '{}'. Error: '{}'".format(name, err)) + pass + + return True, running_containers + + +def get_current_running_from_dockers(): + """ + @summary: This function will get all running containers from + the list of docker containers in running state. + @return: A set which contains containers that are + in running state. + """ + DOCKER_CLIENT = docker.DockerClient(base_url='unix://var/run/docker.sock') + running_containers = set() + ctrs = DOCKER_CLIENT.containers + try: + lst = ctrs.list(filters={"status": "running"}) + for ctr in lst: + running_containers.add(ctr.name) + except docker.errors.APIError as err: + print("Failed to retrieve the running container list. Error: '{}'".format(err)) + pass + return running_containers + + +def get_current_running_containers(always_running_containers): + """ + @summary: This function will get the list of currently running containers. + If available in STATE-DB, get from DB else from list of dockers. + + @return: A set of currently running containers. + """ + + ret, current_running_containers = get_current_running_from_DB(always_running_containers) + if not ret: + current_running_containers = get_current_running_from_dockers() + return current_running_containers + + +def main(): + """ + @summary: This function will compare the difference between the current running containers + and the containers which were expected to run. If containers which were exepcted + to run were not running, then an alerting message will be written into syslog. + """ + expected_running_containers, always_running_containers = get_expected_running_containers() + current_running_containers = get_current_running_containers(always_running_containers) + + expected_running_containers |= always_running_containers + not_running_containers = expected_running_containers.difference(current_running_containers) + if not_running_containers: + print("Expected containers not running: " + ", ".join(not_running_containers)) + sys.exit(3) + + unexpected_running_containers = current_running_containers.difference(expected_running_containers) + if unexpected_running_containers: + print("Unexpected running containers: " + ", ".join(unexpected_running_containers)) + sys.exit(4) + + +if __name__ == "__main__": + main() + sys.exit(0) diff --git a/files/image_config/monit/memory_checker b/files/image_config/monit/memory_checker new file mode 100755 index 000000000000..a93bc30b3fe4 --- /dev/null +++ b/files/image_config/monit/memory_checker @@ -0,0 +1,160 @@ +#!/usr/bin/env python3 + +""" +memory_checker + +This script is part of the feature which will restart the container if memory +usage of it is larger than the threshold value. + +This script is used to check the memory usage of specified cotnainer and +is intended to be run by Monit. It will write an alerting message into +syslog if memory usage of the container is larger than the threshold value for X +times within Y cycles/minutes. Note that if print(...) statement in this script +was executed, the string in it will be appended to Monit syslog messages. + +The following is an example in Monit configuration file to show how Monit will run +this script: + +check program container_memory_ with path "/usr/bin/memory_checker " + if status == 3 for X times within Y cycles exec "/usr/bin/restart_service " +""" + +import argparse +import subprocess +import sys +import syslog +import re + +import docker + + +def get_command_result(command): + """Executes the command and return the resulting output. + + Args: + command: A string contains the command to be executed. + + Returns: + A string which contains the output of command. + """ + command_stdout = "" + + try: + proc_instance = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, + shell=True, universal_newlines=True) + command_stdout, command_stderr = proc_instance.communicate() + if proc_instance.returncode != 0: + syslog.syslog(syslog.LOG_ERR, "[memory_checker] Failed to execute the command '{}'. Return code: '{}'" + .format(command, proc_instance.returncode)) + sys.exit(1) + except (OSError, ValueError) as err: + syslog.syslog(syslog.LOG_ERR, "[memory_checker] Failed to execute the command '{}'. Error: '{}'" + .format(command, err)) + sys.exit(2) + + return command_stdout.strip() + + +def check_memory_usage(container_name, threshold_value): + """Checks the memory usage of a container and writes an alerting messages into + the syslog if the memory usage is larger than the threshold value. + + Args: + container_name: A string represtents name of a container + threshold_value: An integer indicates the threshold value (Bytes) of memory usage. + + Returns: + None. + """ + command = "docker stats --no-stream --format \{{\{{.MemUsage\}}\}} {}".format(container_name) + command_stdout = get_command_result(command) + mem_usage = command_stdout.split("/")[0].strip() + match_obj = re.match(r"\d+\.?\d*", mem_usage) + if match_obj: + mem_usage_value = float(mem_usage[match_obj.start():match_obj.end()]) + mem_usage_unit = mem_usage[match_obj.end():] + + mem_usage_bytes = 0.0 + if mem_usage_unit == "B": + mem_usage_bytes = mem_usage_value + elif mem_usage_unit == "KiB": + mem_usage_bytes = mem_usage_value * 1024 + elif mem_usage_unit == "MiB": + mem_usage_bytes = mem_usage_value * 1024 ** 2 + elif mem_usage_unit == "GiB": + mem_usage_bytes = mem_usage_value * 1024 ** 3 + + if mem_usage_bytes > threshold_value: + print("[{}]: Memory usage ({} Bytes) is larger than the threshold ({} Bytes)!" + .format(container_name, mem_usage_bytes, threshold_value)) + syslog.syslog(syslog.LOG_INFO, "[{}]: Memory usage ({} Bytes) is larger than the threshold ({} Bytes)!" + .format(container_name, mem_usage_bytes, threshold_value)) + sys.exit(3) + else: + syslog.syslog(syslog.LOG_ERR, "[memory_checker] Failed to retrieve memory value from '{}'" + .format(mem_usage)) + sys.exit(4) + + +def is_service_active(service_name): + """Test if service is running. + + Args: + service_name: A string contains the service name + + Returns: + True if service is running, False otherwise + """ + status = subprocess.run("systemctl is-active --quiet {}".format(service_name), shell=True, check=False) + return status.returncode == 0 + + +def get_running_container_names(): + """Retrieves names of running containers by talking to the docker daemon. + + Args: + None. + + Returns: + running_container_names: A list indicates names of running containers. + """ + try: + docker_client = docker.DockerClient(base_url='unix://var/run/docker.sock') + running_container_list = docker_client.containers.list(filters={"status": "running"}) + running_container_names = [ container.name for container in running_container_list ] + except (docker.errors.APIError, docker.errors.DockerException) as err: + syslog.syslog(syslog.LOG_ERR, + "Failed to retrieve the running container list from docker daemon! Error message is: '{}'" + .format(err)) + sys.exit(5) + + return running_container_names + + +def main(): + parser = argparse.ArgumentParser(description="Check memory usage of a container \ + and an alerting message will be written into syslog if memory usage \ + is larger than the threshold value", usage="/usr/bin/memory_checker ") + parser.add_argument("container_name", help="container name") + # TODO: Currently the threshold value is hard coded as a command line argument and will + # remove this in the new version since we want to read this value from 'CONFIG_DB'. + parser.add_argument("threshold_value", type=int, help="threshold value in bytes") + args = parser.parse_args() + + if not is_service_active("docker"): + syslog.syslog(syslog.LOG_INFO, + "[memory_checker] Exits without checking memory usage of container '{}' since docker daemon is not running!" + .format(args.container_name)) + sys.exit(0) + + running_container_names = get_running_container_names() + if args.container_name in running_container_names: + check_memory_usage(args.container_name, args.threshold_value) + else: + syslog.syslog(syslog.LOG_INFO, + "[memory_checker] Exits without checking memory usage since container '{}' is not running!" + .format(args.container_name)) + + +if __name__ == "__main__": + main() diff --git a/files/image_config/monit/process_checker b/files/image_config/monit/process_checker deleted file mode 100755 index 68c8f3e945fd..000000000000 --- a/files/image_config/monit/process_checker +++ /dev/null @@ -1,98 +0,0 @@ -#!/usr/bin/python3 - -import argparse -import ast -import sys -import syslog - -import psutil -from sonic_py_common import multi_asic -import swsssdk - - -def check_process_existence(container_name, process_cmdline): - """ - @summary: Check whether the process in the specified container is running or not and - an alerting message will written into syslog if it failed to run. - """ - config_db = swsssdk.ConfigDBConnector() - config_db.connect() - feature_table = config_db.get_table("FEATURE") - - if container_name in feature_table: - # We look into the 'FEATURE' table to verify whether the container is disabled or not. - # If the container is diabled, we exit. - if ("state" in feature_table[container_name] - and feature_table[container_name]["state"] == "disabled"): - sys.exit(0) - else: - # We leveraged the psutil library to help us check whether the process is running or not. - # If the process entity is found in process tree and it is also in the 'running' or 'sleeping' - # state, then it will be marked as 'running'. - - # For given feature we get the host and network namespace instances it's processes should be running - # based on it's scope and add it to expected set. - - # From psutil we get number of running instances of the processes and add it to the the actual set - - # Difference bwetween expected and actual set provides instances where the processes are not running - # and will be logged as syslog message by monit - - process_namespace_expected_set = set() - process_namespace_found_set = set() - - has_global_scope = ast.literal_eval(feature_table[container_name].get('has_global_scope', 'True')) - has_per_asic_scope = ast.literal_eval(feature_table[container_name].get('has_per_asic_scope', 'False')) - - if has_global_scope: - process_namespace_expected_set.add(multi_asic.DEFAULT_NAMESPACE) - - if has_per_asic_scope: - process_namespace_expected_set.update(multi_asic.get_namespace_list()) - - for process in psutil.process_iter(["cmdline", "status", "pid"]): - try: - if ((' '.join(process.cmdline())).startswith(process_cmdline) and process.status() in ["running", "sleeping"]): - process_namespace_found_set.add(multi_asic.get_current_namespace(process.info['pid'])) - except psutil.NoSuchProcess: - pass - - process_namespace_diff_set = process_namespace_expected_set.difference(process_namespace_found_set) - - if process_namespace_diff_set: - host_display_str = "" - namespace_display_str = "" - - for ns in process_namespace_diff_set: - if ns == multi_asic.DEFAULT_NAMESPACE: - host_display_str = " in host" - else: - if not namespace_display_str: - namespace_display_str = " in namespace " + ns - else: - namespace_display_str += ", " + ns - - join_str = " and" if host_display_str and namespace_display_str else "" - - # If this script is run by Monit, then the following output will be appended to - # Monit's syslog message. - print("'{}' is not running{}{}{}".format(process_cmdline, host_display_str, join_str, namespace_display_str)) - sys.exit(1) - else: - syslog.syslog(syslog.LOG_ERR, "container '{}' is not included in SONiC image or the given container name is invalid!" - .format(container_name)) - - -def main(): - parser = argparse.ArgumentParser(description="Check whether the process in the specified \ - container is running and an alerting message will be written into syslog if it \ - failed to run.", usage="/usr/bin/process_checker ") - parser.add_argument("container_name", help="container name") - parser.add_argument("process_cmdline", nargs=argparse.REMAINDER, help="process command line") - args = parser.parse_args() - - check_process_existence(args.container_name, ' '.join(args.process_cmdline)) - - -if __name__ == '__main__': - main() diff --git a/files/image_config/monit/restart_service b/files/image_config/monit/restart_service new file mode 100755 index 000000000000..40da147e9526 --- /dev/null +++ b/files/image_config/monit/restart_service @@ -0,0 +1,105 @@ +#!/usr/bin/env python3 + +""" +restart_service + +This script is part of the feature which will restart the container if memory +usage of it is larger than the threshold value. + +This script is intended to be run by Monit and is used to restart the specified +container if the memory usage of it is larger than the threshold value for X +times within Y cycles/minutes. + +The following is an example in Monit configuration file to show how Monit will run +this script: + +check program container_memory_ with path "/usr/bin/memory_checker " + if status == 3 for X times within Y cycles exec "/usr/bin/restart_service " +""" + +import argparse +import sys +import syslog +import subprocess + + +def get_command_result(command): + """Executes command and return the exit code, stdout and stderr. + + Args: + command: A string contains the command to be executed. + + Returns: + An integer contains the exit code. + A string contains the output of stdout. + A string contains the output of stderr. + """ + command_stdout = "" + command_stderr = "" + + try: + proc_instance = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, + shell=True, universal_newlines=True) + command_stdout, command_stderr = proc_instance.communicate() + if proc_instance.returncode != 0: + return 1, command_stdout.strip(), command_stderr.strip() + except (OSError, ValueError) as err: + return 2, command_stdout.strip(), err + + return 0, command_stdout.strip(), command_stderr.strip() + + +def reset_failed_flag(service_name): + """Reset the failed status of a service. + + Args: + service_name: Name of the service. + + Returns: + None + """ + reset_failed_command = "sudo systemctl reset-failed {}.service".format(service_name) + + syslog.syslog(syslog.LOG_INFO, "Resetting failed status of service '{}' ..." + .format(service_name)) + + exit_code, command_stdout, command_stderr = get_command_result(reset_failed_command) + if exit_code == 0: + syslog.syslog(syslog.LOG_INFO, "Succeeded to reset failed status of service '{}.service'." + .format(service_name)) + else: + syslog.syslog(syslog.LOG_ERR, "Failed to reset failed status of service '{}'. Error: {}" + .format(service_name, command_stderr)) + + +def restart_service(service_name): + """Reset the failed status of a service and then restart it. + + Args: + service_name: Name of specified service. + + Returns: + None. + """ + restart_command = "sudo systemctl restart {}.service".format(service_name) + + reset_failed_flag(service_name) + + syslog.syslog(syslog.LOG_INFO, "Restarting service '{}' ...".format(service_name)) + exit_code, command_stdout, command_stderr = get_command_result(restart_command) + if exit_code != 0: + syslog.syslog(syslog.LOG_ERR, "Failed to restart the service '{}'. Error: {}" + .format(service_name, command_stderr)) + + +def main(): + parser = argparse.ArgumentParser(description="Restart a specific service", + usage="/usr/bin/restart_service ") + parser.add_argument("service_name", help="service name") + args = parser.parse_args() + + restart_service(args.service_name) + + +if __name__ == "__main__": + main() diff --git a/files/image_config/ntp/ntp-config.service b/files/image_config/ntp/ntp-config.service index a22a0331045d..5639b04520e0 100644 --- a/files/image_config/ntp/ntp-config.service +++ b/files/image_config/ntp/ntp-config.service @@ -2,12 +2,15 @@ Description=Update NTP configuration Requires=updategraph.service After=updategraph.service +BindsTo=sonic.target +After=sonic.target Before=ntp.service StartLimitIntervalSec=0 [Service] Type=oneshot +RemainAfterExit=yes ExecStart=/usr/bin/ntp-config.sh [Install] -WantedBy=multi-user.target +WantedBy=sonic.target diff --git a/files/image_config/ntp/ntp.conf.j2 b/files/image_config/ntp/ntp.conf.j2 index 4b763219325c..280b46a426d8 100644 --- a/files/image_config/ntp/ntp.conf.j2 +++ b/files/image_config/ntp/ntp.conf.j2 @@ -41,13 +41,15 @@ interface ignore wildcard # if the source interface is configured but no ip on that interface, then listen on another # interface based on existing logic {%- macro check_ip_on_interface(interface_name, table_name) %} + {%- set ns = namespace(valid_intf = 'false') %} {%- if table_name %} {%- for (name, source_prefix) in table_name|pfx_filter %} {%- if source_prefix and name == interface_name %} -true + {%- set ns.valid_intf = 'true' %} {%- endif %} {%- endfor %} {%- endif %} +{{ ns.valid_intf }} {%- endmacro %} {% set ns = namespace(source_intf = "") %} diff --git a/files/image_config/ntp/ntp.service b/files/image_config/ntp/ntp.service index acfd7e17266a..32a55dea892e 100644 --- a/files/image_config/ntp/ntp.service +++ b/files/image_config/ntp/ntp.service @@ -3,6 +3,8 @@ Description=Network Time Service Documentation=man:ntpd(8) After=network.target Conflicts=systemd-timesyncd.service +BindsTo=sonic.target +After=sonic.target StartLimitIntervalSec=0 [Service] diff --git a/files/image_config/pcie-check/pcie-check.service b/files/image_config/pcie-check/pcie-check.service index fbf3cfd3f19d..03c57e28b537 100644 --- a/files/image_config/pcie-check/pcie-check.service +++ b/files/image_config/pcie-check/pcie-check.service @@ -1,7 +1,10 @@ [Unit] Description=Check the PCIe device presence and status -After=rc.local.service database.service +After=rc.local.service database.service config-setup.service [Service] Type=simple ExecStart=/usr/bin/pcie-check.sh + +[Install] +WantedBy=multi-user.target diff --git a/files/image_config/pcie-check/pcie-check.sh b/files/image_config/pcie-check/pcie-check.sh index 4ef2ce3047f0..3d4184c8684c 100755 --- a/files/image_config/pcie-check/pcie-check.sh +++ b/files/image_config/pcie-check/pcie-check.sh @@ -5,6 +5,7 @@ VERBOSE="no" RESULTS="PCIe Device Checking All Test" EXPECTED="PCIe Device Checking All Test ----------->>> PASSED" MAX_WAIT_SECONDS=15 +PCIE_STATUS_TABLE="PCIE_DEVICES|status" function debug() { @@ -16,11 +17,11 @@ function debug() function check_and_rescan_pcie_devices() { - PCIE_CHK_CMD='sudo pcieutil pcie-check |grep "$RESULTS"' + PCIE_CHK_CMD='sudo pcieutil check | grep "$RESULTS"' PLATFORM=$(sonic-cfggen -H -v DEVICE_METADATA.localhost.platform) - if [ ! -f /usr/share/sonic/device/$PLATFORM/plugins/pcie.yaml ]; then - debug "pcie.yaml does not exist! can't check pcie status!" + if [ ! -f /usr/share/sonic/device/$PLATFORM/pcie*.yaml ]; then + debug "pcie.yaml does not exist! Can't check PCIe status!" exit fi @@ -37,7 +38,7 @@ function check_and_rescan_pcie_devices() fi if [ "$(eval $PCIE_CHK_CMD)" = "$EXPECTED" ]; then - redis-cli -n 6 HSET "PCIE_DEVICES" "status" "PASSED" + redis-cli -n 6 HSET $PCIE_STATUS_TABLE "status" "PASSED" debug "PCIe check passed" exit else @@ -53,7 +54,7 @@ function check_and_rescan_pcie_devices() done debug "PCIe check failed" - redis-cli -n 6 HSET "PCIE_DEVICES" "status" "FAILED" + redis-cli -n 6 HSET $PCIE_STATUS_TABLE "status" "FAILED" } check_and_rescan_pcie_devices diff --git a/files/image_config/platform/rc.local b/files/image_config/platform/rc.local index 23531fb74f41..68f15df7cb91 100755 --- a/files/image_config/platform/rc.local +++ b/files/image_config/platform/rc.local @@ -120,6 +120,8 @@ migrate_nos_configuration() MG_FILE=$NOS_DIR/minigraph.xml ACL_GZFILE=$NOS_DIR/acl.json.gz.base64.txt ACL_FILE=$NOS_DIR/acl.json + PORT_CONFIG_GZFILE=$NOS_DIR/port_config.json.gz.base64.txt + PORT_CONFIG_FILE=$NOS_DIR/port_config.json SNMP_FILE=$NOS_DIR/snmp.yml mkdir -p $NOS_DIR @@ -131,11 +133,13 @@ migrate_nos_configuration() # decode & unzip minigraph.xml.gz.base64.txt [ -f $MG_GZFILE ] && /usr/bin/base64 -d $MG_GZFILE | /bin/gunzip > $MG_FILE [ -f $ACL_GZFILE ] && /usr/bin/base64 -d $ACL_GZFILE | /bin/gunzip > $ACL_FILE + [ -f $PORT_CONFIG_GZFILE ] && /usr/bin/base64 -d $PORT_CONFIG_GZFILE | /bin/gunzip > $PORT_CONFIG_FILE # Copy relevant files nos_migration_import $NOS_DIR/mgmt_interface.cfg /host/migration nos_migration_import $MG_FILE /host/migration nos_migration_import $ACL_FILE /host/migration + nos_migration_import $PORT_CONFIG_FILE /host/migration nos_migration_import $SNMP_FILE /host/migration if [ "$sonic_fast_reboot" == true ]; then @@ -182,7 +186,17 @@ program_console_speed() CONSOLE_SPEED=$speed fi - sed -i "s|\-\-keep\-baud .* %I| $CONSOLE_SPEED %I|g" /lib/systemd/system/serial-getty@.service + # Set correct baud rate in getty service + # First boot will find keep-baud argument with multiple baud rates as per Debian convention + # Subsequent boots may have new baud rate without finding keep-baud argument + grep agetty /lib/systemd/system/serial-getty@.service |grep keep-baud + if [ $? = 0 ]; then + sed -i "s|\-\-keep\-baud .* %I| $CONSOLE_SPEED %I|g" /lib/systemd/system/serial-getty@.service + else + sed -i "s|u' .* %I|u' $CONSOLE_SPEED %I|g" /lib/systemd/system/serial-getty@.service + fi + + # Reload systemd config systemctl daemon-reload } @@ -218,10 +232,9 @@ if [ ! -e /host/machine.conf ]; then fi umount /mnt/onie-boot + migrate_nos_configuration fi -migrate_nos_configuration - . /host/machine.conf program_console_speed @@ -249,12 +262,14 @@ if [ -f $FIRST_BOOT_FILE ]; then mkdir -p /etc/sonic/old_config mv /host/minigraph.xml /etc/sonic/old_config/ [ -f /host/acl.json ] && mv /host/acl.json /etc/sonic/old_config/ + [ -f /host/port_config.json ] && mv /host/port_config.json /etc/sonic/old_config/ [ -f /host/snmp.yml ] && mv /host/snmp.yml /etc/sonic/old_config/ touch /tmp/pending_config_migration elif [ -n "$migration" ] && [ -f /host/migration/minigraph.xml ]; then mkdir -p /etc/sonic/old_config mv /host/migration/minigraph.xml /etc/sonic/old_config/ [ -f /host/migration/acl.json ] && mv /host/migration/acl.json /etc/sonic/old_config/ + [ -f /host/migration/port_config.json ] && mv /host/migration/port_config.json /etc/sonic/old_config/ [ -f /host/migration/snmp.yml ] && mv /host/migration/snmp.yml /etc/sonic/old_config/ touch /tmp/pending_config_migration [ -f /etc/sonic/updategraph.conf ] && sed -i -e "s/enabled=false/enabled=true/g" /etc/sonic/updategraph.conf @@ -272,7 +287,20 @@ if [ -f $FIRST_BOOT_FILE ]; then fi if [ -d /host/image-$SONIC_VERSION/platform/$platform ]; then - dpkg -i /host/image-$SONIC_VERSION/platform/$platform/*.deb + if [ -f /host/image-$SONIC_VERSION/platform/common/Packages.gz ]; then + # Use only the trivial repo and apt to support lazy package dependencies + mv /etc/apt/sources.list /etc/apt/sources.list.rc-local + echo "deb [trusted=yes] file:///host/image-$SONIC_VERSION/platform/common /" > /etc/apt/sources.list.d/sonic_debian_extension.list + LANG=C DEBIAN_FRONTEND=noninteractive apt-get update + LANG=C DEBIAN_FRONTEND=noninteractive apt-get -o DPkg::Path=$PATH:/usr/local/bin -y install /host/image-$SONIC_VERSION/platform/$platform/*.deb + # Cleanup + rm -f /etc/apt/sources.list.d/sonic_debian_extension.list + rm -f /var/lib/apt/lists/_host_image-${SONIC_VERSION}_platform_common_Packages.lz4 + # This is first boot so there should be no package lists or indices to restore, just the sources + mv /etc/apt/sources.list.rc-local /etc/apt/sources.list + else + dpkg -i /host/image-$SONIC_VERSION/platform/$platform/*.deb + fi fi sync @@ -366,7 +394,7 @@ if [ -f $FIRST_BOOT_FILE ]; then ebtables_config # Kdump tools configuration - sed -i -e "s/__PLATFORM__/$platform/g" /etc/default/kdump-tools + [ -f /etc/default/kdump-tools ] && sed -i -e "s/__PLATFORM__/$platform/g" /etc/default/kdump-tools firsttime_exit fi diff --git a/files/image_config/apt/sources.list b/files/image_config/resolv-config/resolv.conf similarity index 100% rename from files/image_config/apt/sources.list rename to files/image_config/resolv-config/resolv.conf diff --git a/files/image_config/rsyslog/rsyslog-config.service b/files/image_config/rsyslog/rsyslog-config.service index ee62a36ccf2d..34c56fb0e00b 100644 --- a/files/image_config/rsyslog/rsyslog-config.service +++ b/files/image_config/rsyslog/rsyslog-config.service @@ -2,10 +2,13 @@ Description=Update rsyslog configuration Requires=updategraph.service After=updategraph.service +BindsTo=sonic.target +After=sonic.target [Service] Type=oneshot +RemainAfterExit=yes ExecStart=/usr/bin/rsyslog-config.sh [Install] -WantedBy=multi-user.target +WantedBy=sonic.target diff --git a/files/image_config/secureboot/allowlist_paths.conf b/files/image_config/secureboot/allowlist_paths.conf index c80b39d74bc8..e6e97dd22d16 100644 --- a/files/image_config/secureboot/allowlist_paths.conf +++ b/files/image_config/secureboot/allowlist_paths.conf @@ -24,6 +24,7 @@ etc/sonic/acl.json etc/sonic/config_db.json etc/sonic/minigraph.xml etc/sonic/old_config/.* +etc/sonic/port_config.json etc/sonic/snmp.yml etc/sonic/sonic-environment etc/sonic/updategraph.conf diff --git a/files/image_config/sonic_release b/files/image_config/sonic_release new file mode 100644 index 000000000000..5877a99dfbe2 --- /dev/null +++ b/files/image_config/sonic_release @@ -0,0 +1 @@ +202012 diff --git a/files/image_config/sudoers/sudoers b/files/image_config/sudoers/sudoers index 9e59c8854305..974276c70fa3 100644 --- a/files/image_config/sudoers/sudoers +++ b/files/image_config/sudoers/sudoers @@ -19,25 +19,32 @@ Defaults lecture_file = /etc/sudoers.lecture # Cmnd alias specification # Note: bcmcmd is dangerous for users in read only netgroups because it may operate ASIC -Cmnd_Alias READ_ONLY_CMDS = /bin/cat /var/log/syslog*, \ +Cmnd_Alias READ_ONLY_CMDS = /bin/cat /var/log/syslog, /bin/cat /var/log/syslog.1 /var/log/syslog, /bin/cat /var/log/syslog.1, \ + /bin/ip netns identify [0-9]*, \ /sbin/brctl show, \ /usr/bin/docker exec snmp cat /etc/snmp/snmpd.conf, \ /usr/bin/docker exec bgp cat /etc/quagga/bgpd.conf, \ - /usr/bin/docker exec * ps aux, \ /usr/bin/docker images *, \ - /usr/bin/docker ps*, \ + /usr/bin/docker ps *, \ + /usr/bin/docker ps, \ /usr/bin/lldpctl, \ /usr/bin/sensors, \ /usr/bin/tail -F /var/log/syslog, \ - /usr/bin/vtysh -c show *, \ - /usr/bin/vtysh -n [0-9] -c show *, \ + /usr/bin/rvtysh *, \ + /usr/bin/vtysh -c show version, \ + /usr/bin/vtysh -c show bgp ipv[46] summary json, \ + /usr/bin/vtysh -n [0-9] -c show version, \ + /usr/bin/vtysh -n [0-9] -c show bgp ipv[46] summary json, \ /usr/local/bin/decode-syseeprom, \ /usr/local/bin/generate_dump, \ + /usr/local/bin/ipintutil, \ /usr/local/bin/lldpshow, \ + /usr/local/bin/pcieutil *, \ /usr/local/bin/psuutil *, \ /usr/local/bin/sonic-installer list, \ /usr/local/bin/sfputil show * + Cmnd_Alias PASSWD_CMDS = /usr/local/bin/config tacacs passkey *, \ /usr/sbin/chpasswd * @@ -53,6 +60,9 @@ ALL ALL=NOPASSWD: READ_ONLY_CMDS # Prevent password related command into syslog Defaults!PASSWD_CMDS !syslog +# Make sure sudo password prompt times out after 5 mins +Defaults passwd_timeout=5 + # See sudoers(5) for more information on "#include" directives: #includedir /etc/sudoers.d diff --git a/files/image_config/systemd/network/99-default.link b/files/image_config/systemd/network/99-default.link new file mode 100644 index 000000000000..3ee67ecd9f50 --- /dev/null +++ b/files/image_config/systemd/network/99-default.link @@ -0,0 +1,7 @@ +[Match] +OriginalName=* + +[Link] +# Override default systemd policy +MACAddressPolicy=none + diff --git a/files/image_config/warmboot-finalizer/finalize-warmboot.sh b/files/image_config/warmboot-finalizer/finalize-warmboot.sh index 094fff2133f7..54f9bfc2aa24 100755 --- a/files/image_config/warmboot-finalizer/finalize-warmboot.sh +++ b/files/image_config/warmboot-finalizer/finalize-warmboot.sh @@ -2,8 +2,16 @@ VERBOSE=no -# Check components -COMP_LIST="orchagent neighsyncd bgp natsyncd" +# Define components that needs to reconcile during warm +# boot: +# The key is the name of the service that the components belong to. +# The value is list of component names that will reconcile. +declare -A RECONCILE_COMPONENTS=( \ + ["swss"]="orchagent neighsyncd" \ + ["bgp"]="bgp" \ + ["nat"]="natsyncd" \ + ["mux"]="linkmgrd" \ + ) EXP_STATE="reconciled" ASSISTANT_SCRIPT="/usr/local/bin/neighbor_advertiser" @@ -18,6 +26,20 @@ function debug() } +function get_component_list() +{ + SVC_LIST=${!RECONCILE_COMPONENTS[@]} + COMPONENT_LIST="" + for service in ${SVC_LIST}; do + components=${RECONCILE_COMPONENTS[${service}]} + status=$(sonic-db-cli CONFIG_DB HGET "FEATURE|${service}" state) + if [[ x"${status}" == x"enabled" || x"${status}" == x"always_enabled" ]]; then + COMPONENT_LIST="${COMPONENT_LIST} ${components}" + fi + done +} + + function check_warm_boot() { WARM_BOOT=`sonic-db-cli STATE_DB hget "WARM_RESTART_ENABLE_TABLE|system" enable` @@ -53,9 +75,9 @@ function check_list() RET_LIST='' for comp in $@; do state=`get_component_state ${comp}` - if [[ x"${state}" != x"${EXP_STATE}" ]]; then + if [[ x"${state}" != x"${EXP_STATE}" ]]; then RET_LIST="${RET_LIST} ${comp}" - fi + fi done echo ${RET_LIST} @@ -102,13 +124,17 @@ fi restore_counters_folder -list=${COMP_LIST} +get_component_list + +debug "Waiting for components: '${COMPONENT_LIST}' to reconcile ..." + +list=${COMPONENT_LIST} # Wait up to 5 minutes for i in `seq 60`; do list=`check_list ${list}` if [[ -z "${list}" ]]; then - break + break fi sleep 5 done diff --git a/files/initramfs-tools/arista-net b/files/initramfs-tools/arista-net index 8759746458d6..1d9ccf8a1824 100644 --- a/files/initramfs-tools/arista-net +++ b/files/initramfs-tools/arista-net @@ -47,7 +47,9 @@ arista_net_rename() { local new_name="$2" local from_name="$3" devname=$(arista_net_devname "$device_path" "$from_name") - [ -n "$devname" ] && ip link set "$devname" name "$new_name" + if [ -n "$devname" ]; then + ip link set "$devname" name "$new_name" + fi } # Sets the MAC address to the value passed by Aboot through /proc/cmdline diff --git a/files/initramfs-tools/mke2fs b/files/initramfs-tools/mke2fs index 1f98f20c23c4..2c6d45ea5bc9 100644 --- a/files/initramfs-tools/mke2fs +++ b/files/initramfs-tools/mke2fs @@ -21,6 +21,7 @@ copy_exec /usr/sbin/mke2fs /usr/local/sbin/ copy_exec /sbin/sfdisk copy_exec /sbin/fdisk copy_exec /sbin/resize2fs +copy_exec /sbin/tune2fs copy_exec /sbin/findfs fstypes="ext4 ext3" diff --git a/files/initramfs-tools/union-mount.j2 b/files/initramfs-tools/union-mount.j2 index a2b5a5266da6..9fa2fb481905 100644 --- a/files/initramfs-tools/union-mount.j2 +++ b/files/initramfs-tools/union-mount.j2 @@ -15,6 +15,7 @@ docker_inram=false logs_inram=false secureboot=false bootloader=generic +varlog_size=0 # Extract kernel parameters for x in $(cat /proc/cmdline); do @@ -28,6 +29,9 @@ for x in $(cat /proc/cmdline); do logs_inram=on) logs_inram=true ;; + varlog_size=*) + varlog_size="${x#varlog_size=}" + ;; secure_boot_enable=[y1]) secureboot=true docker_inram=true @@ -40,22 +44,31 @@ done set_tmpfs_log_partition_size() { - varlogsize=128 - - # set varlogsize to existing var-log.ext4 size - if [ -f ${rootmnt}/host/disk-img/var-log.ext4 ]; then - varlogsize=$(ls -l ${rootmnt}/host/disk-img/var-log.ext4 | awk '{print $5}') - varlogsize=$(($varlogsize/1024/1024)) - fi - - # make sure varlogsize is between 5% to 10% of total memory size - memkb=$(grep MemTotal /proc/meminfo | awk '{print $2}') - memmb=$(($memkb/1024)) - minsize=$(($memmb*5/100)) - maxsize=$(($memmb*10/100)) - - [ $minsize -ge $varlogsize ] && varlogsize=$minsize - [ $maxsize -le $varlogsize ] && varlogsize=$maxsize + if [ $varlog_size -gt 0 ]; then + # Use the varlog_size passed in from command line + varlogsize=$varlog_size + else + varlogsize=128 + + # set varlogsize to existing var-log.ext4 size + if [ -f ${rootmnt}/host/disk-img/var-log.ext4 ]; then + varlogsize=$(ls -l ${rootmnt}/host/disk-img/var-log.ext4 | awk '{print $5}') + varlogsize=$(($varlogsize/1024/1024)) + fi + fi + + # make sure varlogsize is between 5% to 10% of total memory size + memkb=$(grep MemTotal /proc/meminfo | awk '{print $2}') + memmb=$(($memkb/1024)) + minsize=$(($memmb*5/100)) + maxsize=$(($memmb*10/100)) + + if [ $minsize -ge $varlogsize ]; then + varlogsize=$minsize + fi + if [ $maxsize -le $varlogsize ]; then + varlogsize=$maxsize + fi } remove_not_in_allowlist_files() @@ -116,6 +129,7 @@ case "${ROOT}" in *) ## Mount the raw partition again mount ${ROOT} ${rootmnt}/host + tune2fs -m 0 -r 0 ${ROOT} ;; esac @@ -145,16 +159,25 @@ mount --bind ${rootmnt}/host/$image_dir/boot ${rootmnt}/boot ## Mount loop device or tmpfs for /var/log if $logs_inram; then - # NOTE: some platforms, when reaching initramfs stage, have a small - # limit of mounting tmpfs partition, potentially due to amount - # of RAM available in this stage. e.g. Arista 7050-qx32[s] and 7060-cx32s - set_tmpfs_log_partition_size - mount -t tmpfs -o rw,nosuid,nodev,size=${varlogsize}M tmpfs ${rootmnt}/var/log - [ -f ${rootmnt}/host/disk-img/var-log.ext4 ] && rm -rf ${rootmnt}/host/disk-img/var-log.ext4 + # NOTE: some platforms, when reaching initramfs stage, have a small + # limit of mounting tmpfs partition, potentially due to amount + # of RAM available in this stage. Therefore limiting the size + # set for tmpfs partitions. + # + # Another reason for using tmpfs /var/log partition is: + # Some platforms have a small flash and therefore the log partition takes valuable space. + # To improve the longevity of these devices storing the logs in memory will permit more + # SONiC image growth before being bottlenecked. + set_tmpfs_log_partition_size + mount -t tmpfs -o rw,nosuid,nodev,size=${varlogsize}M tmpfs ${rootmnt}/var/log + if [ -f ${rootmnt}/host/disk-img/var-log.ext4 ]; then + rm -rf ${rootmnt}/host/disk-img/var-log.ext4 + fi else - [ -f ${rootmnt}/host/disk-img/var-log.ext4 ] && fsck.ext4 -v -p ${rootmnt}/host/disk-img/var-log.ext4 2>&1 \ - | gzip -c >> /tmp/fsck.log.gz - [ -f ${rootmnt}/host/disk-img/var-log.ext4 ] && mount -t ext4 -o loop,rw ${rootmnt}/host/disk-img/var-log.ext4 ${rootmnt}/var/log + if [ -f ${rootmnt}/host/disk-img/var-log.ext4 ]; then + fsck.ext4 -v -p ${rootmnt}/host/disk-img/var-log.ext4 2>&1 | gzip -c >> /tmp/fsck.log.gz + mount -t ext4 -o loop,rw ${rootmnt}/host/disk-img/var-log.ext4 ${rootmnt}/var/log + fi fi ## fscklog file: /tmp will be lost when overlayfs is mounted diff --git a/files/initramfs-tools/varlog b/files/initramfs-tools/varlog index e8063e41a59c..980b24523452 100644 --- a/files/initramfs-tools/varlog +++ b/files/initramfs-tools/varlog @@ -11,17 +11,27 @@ case $1 in ;; esac +logs_inram=false + # Extract kernel parameters set -- $(cat /proc/cmdline) for x in "$@"; do case "$x" in varlog_size=*) varlog_size="${x#varlog_size=}" + ;; + logs_inram=on) + logs_inram=true + ;; esac done [ -z "$varlog_size" ] && exit 0 +# If logs are being stored in memory, then don't bother +# creating the log file just to have it deleted afterwards. +$logs_inram && exit 0 + # exit when the var_log.ext4 exists and the size matches if [ -e "${rootmnt}/host/disk-img/var-log.ext4" ]; then cur_varlog_size=$(ls -l ${rootmnt}/host/disk-img/var-log.ext4 | awk '{print $5}') diff --git a/files/scripts/arp_update b/files/scripts/arp_update index 2fec40c14beb..dec94b7712e0 100755 --- a/files/scripts/arp_update +++ b/files/scripts/arp_update @@ -14,8 +14,9 @@ while /bin/true; do ARP_UPDATE_VARS=$(sonic-cfggen -d -t ${ARP_UPDATE_VARS_FILE}) INTERFACE=$(echo $ARP_UPDATE_VARS | jq -r '.interface') PC_INTERFACE=$(echo $ARP_UPDATE_VARS | jq -r '.pc_interface') + VLAN_SUB_INTERFACE=$(echo $ARP_UPDATE_VARS | jq -r '.vlan_sub_interface') - ALL_INTERFACE="$INTERFACE $PC_INTERFACE" + ALL_INTERFACE="$INTERFACE $PC_INTERFACE $VLAN_SUB_INTERFACE" for intf in $ALL_INTERFACE; do ping6cmd="ping6 -I $intf -n -q -i 0 -c 1 -W 0 ff02::1 >/dev/null" intf_up=$(ip link show $intf | grep "state UP") @@ -25,6 +26,7 @@ while /bin/true; do done VLAN=$(echo $ARP_UPDATE_VARS | jq -r '.vlan') + SUBTYPE=$(sonic-db-cli CONFIG_DB hget 'DEVICE_METADATA|localhost' 'subtype' | tr '[:upper:]' '[:lower:]') for vlan in $VLAN; do # generate a list of arping commands: # arping -q -w 0 -c 1 -i ; @@ -36,7 +38,7 @@ while /bin/true; do eval `eval $ipcmd` # send ipv6 multicast pings to Vlan interfaces to get/refresh link-local addrs - ping6cmd="ping6 -I $vlan -n -q -i 0 -c 1 -W 0 ff02::1 >/dev/null" + ping6cmd="timeout 1 ping6 -I $vlan -n -q -i 0 -c 1 -W 0 ff02::1 >/dev/null" eval $ping6cmd # generate a list of ndisc6 commands (exclude link-local addrs since it is done above): @@ -46,15 +48,49 @@ while /bin/true; do ndisc6cmd="sed -e 's/^/ndisc6 -q -w 0 -1 /' -e 's/$/;/'" ip6cmd="ip -6 neigh show | grep -v fe80 | grep $vlan | cut -d ' ' -f 1,3 | $ndisc6cmd" eval `eval $ip6cmd` + + if [[ $SUBTYPE == "dualtor" ]]; then + # manually set any remaining FAILED/INCOMPLETE entries to permanently INCOMPLETE + # this prevents any remaining INCOMPLETE entries from automatically transitioning to FAILED + # once these entries are incomplete, any subsequent neighbor advertisement messages + # are able to resolve the entry + + # generates the following command for each failed or incomplete IPv6 neighbor + # ip neigh replace dev nud incomplete + neigh_replace_template="sed -e 's/^/ip neigh replace /' -e 's/,/ dev /' -e 's/$/ nud incomplete;/'" + ip_neigh_replace_cmd="ip -6 neigh show | grep -v fe80 | grep $vlan | grep -E 'FAILED|INCOMPLETE' | cut -d ' ' -f 1,3 --output-delimiter=',' | $neigh_replace_template" + eval `eval $ip_neigh_replace_cmd` + + # on dual ToR devices, try to resolve failed neighbor entries since + # these entries will have tunnel routes installed, preventing normal + # neighbor resolution (SWSS PR #2137) + + # since ndisc6 is a userland process, the above ndisc6 commands are + # insufficient to update the kernel neighbor table for failed entries + + # we don't need to do this for ipv4 neighbors since arping is able to + # update the kernel neighbor table + + # generates the following command for each failed or incomplete IPv6 neighbor + # timeout 0.2 ping -n -q -i 0 -c 1 -W 1 -I >/dev/null + ping6_template="sed -e 's/^/timeout 0.2 ping /' -e 's/,/ -n -q -i 0 -c 1 -W 1 -I /' -e 's/$/ >\/dev\/null;/'" + failed_ip6_neigh_cmd="ip -6 neigh show | grep -v fe80 | grep $vlan | grep -E 'FAILED|INCOMPLETE' | cut -d ' ' -f 1,3 --output-delimiter=',' | $ping6_template" + eval `eval $failed_ip6_neigh_cmd` + fi done + # sleep here before handling the mismatch as it is not required during startup sleep 300 # refresh neighbor entries from APP_DB in case of mismatch with kernel DBNEIGH=$(sonic-db-cli APPL_DB keys NEIGH_TABLE*) - KERNEIGH4=$(ip -4 neigh show | grep Vlan | cut -d ' ' -f 1,3 --output-delimiter=',') - KERNEIGH6=$(ip -6 neigh show | grep -v fe80 | grep Vlan | cut -d ' ' -f 1,3 --output-delimiter=',') + + # resolve neighbor entries from CONFIG_DB in case of mismatch with kernel + DBNEIGH="$DBNEIGH $(sonic-db-cli CONFIG_DB keys NEIGH* | sed -e 's/|/:/g')" + + KERNEIGH4=$(ip -4 neigh show | grep Vlan | grep -v 'FAILED\|INCOMPLETE' | cut -d ' ' -f 1,3 --output-delimiter=',') + KERNEIGH6=$(ip -6 neigh show | grep -v fe80 | grep Vlan | grep -v 'FAILED\|INCOMPLETE' | cut -d ' ' -f 1,3 --output-delimiter=',') for neigh in $DBNEIGH; do intf="$( cut -d ':' -f 2 <<< "$neigh" )" ip="$( cut -d ':' -f 3- <<< "$neigh" )" diff --git a/files/scripts/database.sh b/files/scripts/database.sh new file mode 120000 index 000000000000..ce97295f0364 --- /dev/null +++ b/files/scripts/database.sh @@ -0,0 +1 @@ +service_mgmt.sh \ No newline at end of file diff --git a/files/scripts/mark_dhcp_packet.py b/files/scripts/mark_dhcp_packet.py new file mode 100755 index 000000000000..c80810f0316b --- /dev/null +++ b/files/scripts/mark_dhcp_packet.py @@ -0,0 +1,116 @@ +#!/usr/bin/env python3 + +import subprocess + +from sonic_py_common import logger +from swsscommon import swsscommon + +log = logger.Logger('mark_dhcp_packet') + + +class MarkDhcpPacket(object): + """ + Class used to configure dhcp packet mark in ebtables + """ + + def __init__(self): + self.config_db_connector = None + self.state_db_connector = None + + @property + def config_db(self): + """ + Returns config DB connector. + Initializes the connector during the first call + """ + if self.config_db_connector is None: + self.config_db_connector = swsscommon.ConfigDBConnector() + self.config_db_connector.connect() + + return self.config_db_connector + + @property + def state_db(self): + """ + Returns the state DB connector. + Initializes the connector during the first call + """ + if self.state_db_connector is None: + self.state_db_connector = swsscommon.SonicV2Connector( + host='127.0.0.1' + ) + self.state_db_connector.connect(self.state_db_connector.STATE_DB) + + return self.state_db_connector + + @property + def is_dualtor(self): + """ + Checks if script is running on a dual ToR system + """ + localhost_key = self.config_db.get_keys('DEVICE_METADATA')[0] + metadata = self.config_db.get_entry('DEVICE_METADATA', localhost_key) + + return 'subtype' in metadata and \ + 'dualtor' in metadata['subtype'].lower() + + def get_mux_intfs(self): + """ + Returns a list of mux cable interfaces + """ + mux_cables = self.config_db.get_table('MUX_CABLE') + mux_intfs = [intf for intf in mux_cables] + + return mux_intfs + + def generate_mark_from_index(self, index): + ''' + type: string, format: hexadecimal + Example: 0x67001, 0x67002, ... + ''' + intf_mark = "0x67" + str(index).zfill(3) + + return intf_mark + + def run_command(self, cmd): + subprocess.call(cmd, shell=True) + log.log_info("run command: {}".format(cmd)) + + def clear_dhcp_packet_marks(self): + ''' + Flush the INPUT chain in ebtables upon restart + ''' + self.run_command("sudo ebtables -F INPUT") + + def apply_mark_in_ebtables(self, intf, mark): + self.run_command("sudo ebtables -A INPUT -i {} -j mark --mark-set {}" + .format(intf, mark)) + + def update_mark_in_state_db(self, intf, mark): + self.state_db.set( + self.state_db.STATE_DB, + 'DHCP_PACKET_MARK|' + intf, + 'mark', + mark + ) + + def apply_marks(self): + """ + Writes dhcp packet marks in ebtables + """ + if not self.is_dualtor: + return + + self.clear_dhcp_packet_marks() + + for (index, intf) in enumerate(self.get_mux_intfs(), 1): + mark = self.generate_mark_from_index(index) + self.apply_mark_in_ebtables(intf, mark) + self.update_mark_in_state_db(intf, mark) + + log.log_info("Finish marking dhcp packets in ebtables.") + + +if __name__ == '__main__': + mark_dhcp_packet = MarkDhcpPacket() + mark_dhcp_packet.apply_marks() diff --git a/files/scripts/mgmt-framework.sh b/files/scripts/mgmt-framework.sh new file mode 120000 index 000000000000..ce97295f0364 --- /dev/null +++ b/files/scripts/mgmt-framework.sh @@ -0,0 +1 @@ +service_mgmt.sh \ No newline at end of file diff --git a/files/scripts/radv.sh b/files/scripts/radv.sh deleted file mode 100755 index 1047808e4e44..000000000000 --- a/files/scripts/radv.sh +++ /dev/null @@ -1,84 +0,0 @@ -#!/bin/bash - -function debug() -{ - /usr/bin/logger $1 - /bin/echo `date` "- $1" >> ${DEBUGLOG} -} - -function check_warm_boot() -{ - SYSTEM_WARM_START=`$SONIC_DB_CLI STATE_DB hget "WARM_RESTART_ENABLE_TABLE|system" enable` - SERVICE_WARM_START=`$SONIC_DB_CLI STATE_DB hget "WARM_RESTART_ENABLE_TABLE|${SERVICE}" enable` - if [[ x"$SYSTEM_WARM_START" == x"true" ]] || [[ x"$SERVICE_WARM_START" == x"true" ]]; then - WARM_BOOT="true" - else - WARM_BOOT="false" - fi -} - -function check_fast_boot () -{ - if [[ $($SONIC_DB_CLI STATE_DB GET "FAST_REBOOT|system") == "1" ]]; then - FAST_BOOT="true" - else - FAST_BOOT="false" - fi -} - -start() { - debug "Starting ${SERVICE}$DEV service..." - - check_warm_boot - check_fast_boot - debug "Warm boot flag: ${SERVICE}$DEV ${WARM_BOOT}." - debug "Fast boot flag: ${SERVICE}$DEV ${FAST_BOOT}." - - # start service docker - /usr/bin/${SERVICE}.sh start $DEV - debug "Started ${SERVICE}$DEV service..." -} - -wait() { - /usr/bin/${SERVICE}.sh wait $DEV -} - -stop() { - debug "Stopping ${SERVICE}$DEV service..." - - check_warm_boot - check_fast_boot - debug "Warm boot flag: ${SERVICE}$DEV ${WARM_BOOT}." - debug "Fast boot flag: ${SERVICE}$DEV ${FAST_BOOT}." - - # For WARM/FAST boot do not perform service stop - if [[ x"$WARM_BOOT" != x"true" ]] && [[ x"$FAST_BOOT" != x"true" ]]; then - /usr/bin/${SERVICE}.sh stop $DEV - debug "Stopped ${SERVICE}$DEV service..." - else - debug "Killing Docker radv..." - /usr/bin/docker kill radv &> /dev/null || debug "Docker radv is not running ($?) ..." - fi -} - -DEV=$2 - -SERVICE="radv" -DEBUGLOG="/tmp/radv-debug$DEV.log" -NAMESPACE_PREFIX="asic" -if [ "$DEV" ]; then - NET_NS="$NAMESPACE_PREFIX$DEV" #name of the network namespace - SONIC_DB_CLI="sonic-db-cli -n $NET_NS" -else - SONIC_DB_CLI="sonic-db-cli" -fi - -case "$1" in - start|wait|stop) - $1 - ;; - *) - echo "Usage: $0 {start|wait|stop}" - exit 1 - ;; -esac diff --git a/files/scripts/radv.sh b/files/scripts/radv.sh new file mode 120000 index 000000000000..ce97295f0364 --- /dev/null +++ b/files/scripts/radv.sh @@ -0,0 +1 @@ +service_mgmt.sh \ No newline at end of file diff --git a/files/scripts/service_mgmt.sh b/files/scripts/service_mgmt.sh new file mode 100755 index 000000000000..d400c8472246 --- /dev/null +++ b/files/scripts/service_mgmt.sh @@ -0,0 +1,80 @@ +#!/bin/bash + +function debug() +{ + /usr/bin/logger $1 + /bin/echo `date` "- $1" >> ${DEBUGLOG} +} + +function check_warm_boot() +{ + SYSTEM_WARM_START=`$SONIC_DB_CLI STATE_DB hget "WARM_RESTART_ENABLE_TABLE|system" enable` + SERVICE_WARM_START=`$SONIC_DB_CLI STATE_DB hget "WARM_RESTART_ENABLE_TABLE|${SERVICE}" enable` + if [[ x"$SYSTEM_WARM_START" == x"true" ]] || [[ x"$SERVICE_WARM_START" == x"true" ]]; then + WARM_BOOT="true" + else + WARM_BOOT="false" + fi +} + +function check_fast_boot () +{ + if [[ $($SONIC_DB_CLI STATE_DB GET "FAST_REBOOT|system") == "1" ]]; then + FAST_BOOT="true" + else + FAST_BOOT="false" + fi +} + +start() { + debug "Starting ${SERVICE}$DEV service..." + + # start service docker + /usr/bin/${SERVICE}.sh start $DEV + debug "Started ${SERVICE}$DEV service..." +} + +wait() { + /usr/bin/${SERVICE}.sh wait $DEV +} + +stop() { + debug "Stopping ${SERVICE}$DEV service..." + + check_warm_boot + check_fast_boot + debug "Warm boot flag: ${SERVICE}$DEV ${WARM_BOOT}." + debug "Fast boot flag: ${SERVICE}$DEV ${FAST_BOOT}." + + # For WARM/FAST boot do not perform service stop + if [[ x"$WARM_BOOT" != x"true" ]] && [[ x"$FAST_BOOT" != x"true" ]]; then + /usr/bin/${SERVICE}.sh stop $DEV + debug "Stopped ${SERVICE}$DEV service..." + else + debug "Killing Docker ${SERVICE}${DEV}..." + /usr/bin/${SERVICE}.sh kill $DEV + fi +} + +DEV=$2 + +SCRIPT_NAME=$(basename -- "$0") +SERVICE="${SCRIPT_NAME%.*}" +DEBUGLOG="/tmp/$SERVICE-debug$DEV.log" +NAMESPACE_PREFIX="asic" +if [ "$DEV" ]; then + NET_NS="$NAMESPACE_PREFIX$DEV" #name of the network namespace + SONIC_DB_CLI="sonic-db-cli -n $NET_NS" +else + SONIC_DB_CLI="sonic-db-cli" +fi + +case "$1" in + start|wait|stop) + $1 + ;; + *) + echo "Usage: $0 {start|wait|stop}" + exit 1 + ;; +esac diff --git a/files/scripts/snmp.sh b/files/scripts/snmp.sh new file mode 120000 index 000000000000..ce97295f0364 --- /dev/null +++ b/files/scripts/snmp.sh @@ -0,0 +1 @@ +service_mgmt.sh \ No newline at end of file diff --git a/files/scripts/supervisor-proc-exit-listener b/files/scripts/supervisor-proc-exit-listener index 143e539a1689..7bf3059b5e9a 100755 --- a/files/scripts/supervisor-proc-exit-listener +++ b/files/scripts/supervisor-proc-exit-listener @@ -2,11 +2,16 @@ import getopt import os +import re +import select import signal import sys import syslog +import time +from collections import defaultdict import swsssdk + from supervisor import childutils # Each line of this file should specify either one critical process or one @@ -20,15 +25,26 @@ CRITICAL_PROCESSES_FILE = '/etc/supervisor/critical_processes' # The FEATURE table in config db contains auto-restart field FEATURE_TABLE_NAME = 'FEATURE' -# Read the critical processes/group names from CRITICAL_PROCESSES_FILE +# Value of parameter 'timeout' in select(...) method +SELECT_TIMEOUT_SECS = 1.0 + +# Alerting message will be written into syslog in the following interval +ALERTING_INTERVAL_SECS = 60 def get_critical_group_and_process_list(): + """ + @summary: Read the critical processes/group names from CRITICAL_PROCESSES_FILE. + @return: Two lists which contain critical processes and group names respectively. + """ critical_group_list = [] critical_process_list = [] with open(CRITICAL_PROCESSES_FILE, 'r') as file: for line in file: + # ignore blank lines + if re.match(r"^\s*$", line): + continue line_info = line.strip(' \n').split(':') if len(line_info) != 2: syslog.syslog(syslog.LOG_ERR, @@ -49,6 +65,48 @@ def get_critical_group_and_process_list(): return critical_group_list, critical_process_list +def generate_alerting_message(process_name, dead_minutes): + """ + @summary: If a critical process was not running, this function will determine it resides in host + or in a specific namespace. Then an alerting message will be written into syslog. + """ + namespace_prefix = os.environ.get("NAMESPACE_PREFIX") + namespace_id = os.environ.get("NAMESPACE_ID") + + if not namespace_prefix or not namespace_id: + namespace = "host" + else: + namespace = namespace_prefix + namespace_id + + syslog.syslog(syslog.LOG_ERR, "Process '{}' is not running in namespace '{}' ({} minutes)." + .format(process_name, namespace, dead_minutes)) + + +def get_autorestart_state(container_name): + """ + @summary: Read the status of auto-restart feature from Config_DB. + @return: Return the status of auto-restart feature. + """ + config_db = swsssdk.ConfigDBConnector() + config_db.connect() + features_table = config_db.get_table(FEATURE_TABLE_NAME) + if not features_table: + syslog.syslog(syslog.LOG_ERR, "Unable to retrieve features table from Config DB. Exiting...") + sys.exit(2) + + if container_name not in features_table: + syslog.syslog(syslog.LOG_ERR, "Unable to retrieve feature '{}'. Exiting...".format(container_name)) + sys.exit(3) + + is_auto_restart = features_table[container_name].get('auto_restart') + if not is_auto_restart: + syslog.syslog( + syslog.LOG_ERR, "Unable to determine auto-restart feature status for '{}'. Exiting...".format(container_name)) + sys.exit(4) + + return is_auto_restart + + def main(argv): container_name = None opts, args = getopt.getopt(argv, "c:", ["container-name="]) @@ -62,51 +120,59 @@ def main(argv): critical_group_list, critical_process_list = get_critical_group_and_process_list() + process_under_alerting = defaultdict(dict) + # Transition from ACKNOWLEDGED to READY + childutils.listener.ready() + while True: - # Transition from ACKNOWLEDGED to READY - childutils.listener.ready() - - line = sys.stdin.readline() - headers = childutils.get_headers(line) - payload = sys.stdin.read(int(headers['len'])) - - # Transition from READY to ACKNOWLEDGED - childutils.listener.ok() - - # We only care about PROCESS_STATE_EXITED events - if headers['eventname'] == 'PROCESS_STATE_EXITED': - payload_headers, payload_data = childutils.eventdata(payload + '\n') - - expected = int(payload_headers['expected']) - processname = payload_headers['processname'] - groupname = payload_headers['groupname'] - - # Read the status of auto-restart feature from Config_DB. - config_db = swsssdk.ConfigDBConnector() - config_db.connect() - features_table = config_db.get_table(FEATURE_TABLE_NAME) - if not features_table: - syslog.syslog(syslog.LOG_ERR, "Unable to retrieve features table from Config DB. Exiting...") - sys.exit(2) - - if container_name not in features_table: - syslog.syslog(syslog.LOG_ERR, "Unable to retrieve feature '{}'. Exiting...".format(container_name)) - sys.exit(3) - - restart_feature = features_table[container_name].get('auto_restart') - if not restart_feature: - syslog.syslog( - syslog.LOG_ERR, "Unable to determine auto-restart feature status for '{}'. Exiting...".format(container_name)) - sys.exit(4) - - # If auto-restart feature is not disabled and at the same time - # a critical process exited unexpectedly, terminate supervisor - if (restart_feature != 'disabled' and expected == 0 and - (processname in critical_process_list or groupname in critical_group_list)): - MSG_FORMAT_STR = "Process {} exited unxepectedly. Terminating supervisor..." - msg = MSG_FORMAT_STR.format(payload_headers['processname']) - syslog.syslog(syslog.LOG_INFO, msg) - os.kill(os.getppid(), signal.SIGTERM) + file_descriptor_list = select.select([sys.stdin], [], [], SELECT_TIMEOUT_SECS)[0] + if len(file_descriptor_list) > 0: + line = file_descriptor_list[0].readline() + headers = childutils.get_headers(line) + payload = sys.stdin.read(int(headers['len'])) + + # Handle the PROCESS_STATE_EXITED event + if headers['eventname'] == 'PROCESS_STATE_EXITED': + payload_headers, payload_data = childutils.eventdata(payload + '\n') + + expected = int(payload_headers['expected']) + process_name = payload_headers['processname'] + group_name = payload_headers['groupname'] + + if (process_name in critical_process_list or group_name in critical_group_list) and expected == 0: + is_auto_restart = get_autorestart_state(container_name) + if is_auto_restart != "disabled": + MSG_FORMAT_STR = "Process '{}' exited unexpectedly. Terminating supervisor '{}'" + msg = MSG_FORMAT_STR.format(payload_headers['processname'], container_name) + syslog.syslog(syslog.LOG_INFO, msg) + os.kill(os.getppid(), signal.SIGTERM) + else: + process_under_alerting[process_name]["last_alerted"] = time.time() + process_under_alerting[process_name]["dead_minutes"] = 0 + + # Handle the PROCESS_STATE_RUNNING event + elif headers['eventname'] == 'PROCESS_STATE_RUNNING': + payload_headers, payload_data = childutils.eventdata(payload + '\n') + process_name = payload_headers['processname'] + + if process_name in process_under_alerting: + process_under_alerting.pop(process_name) + + # Transition from BUSY to ACKNOWLEDGED + childutils.listener.ok() + + # Transition from ACKNOWLEDGED to READY + childutils.listener.ready() + + # Check whether we need write alerting messages into syslog + for process_name in process_under_alerting.keys(): + epoch_time = time.time() + elapsed_secs = epoch_time - process_under_alerting[process_name]["last_alerted"] + if elapsed_secs >= ALERTING_INTERVAL_SECS: + elapsed_mins = elapsed_secs // 60 + process_under_alerting[process_name]["last_alerted"] = epoch_time + process_under_alerting[process_name]["dead_minutes"] += elapsed_mins + generate_alerting_message(process_name, process_under_alerting[process_name]["dead_minutes"]) if __name__ == "__main__": diff --git a/files/scripts/swss.sh b/files/scripts/swss.sh index 1c54aefb0c0b..d02eece8678e 100755 --- a/files/scripts/swss.sh +++ b/files/scripts/swss.sh @@ -1,6 +1,6 @@ #!/bin/bash -DEPENDENT="radv dhcp_relay" +DEPENDENT="radv dhcp_relay bgp" MULTI_INST_DEPENDENT="teamd" function debug() @@ -15,7 +15,7 @@ function lock_service_state_change() exec {LOCKFD}>${LOCKFILE} /usr/bin/flock -x ${LOCKFD} - trap "/usr/bin/flock -u ${LOCKFD}" 0 2 3 15 + trap "/usr/bin/flock -u ${LOCKFD}" EXIT debug "Locked ${LOCKFILE} (${LOCKFD}) from ${SERVICE}$DEV service" } @@ -110,14 +110,6 @@ start_peer_and_dependent_services() { stop_peer_and_dependent_services() { # if warm/fast start enabled or peer lock exists, don't stop peer service docker if [[ x"$WARM_BOOT" != x"true" ]] && [[ x"$FAST_BOOT" != x"true" ]]; then - if [[ ! -z $DEV ]]; then - /bin/systemctl stop ${PEER}@$DEV - else - /bin/systemctl stop ${PEER} - fi - for dep in ${DEPENDENT}; do - /bin/systemctl stop ${dep} - done for dep in ${MULTI_INST_DEPENDENT}; do if [[ ! -z $DEV ]]; then /bin/systemctl stop ${dep}@$DEV @@ -125,7 +117,14 @@ stop_peer_and_dependent_services() { /bin/systemctl stop ${dep} fi done - + for dep in ${DEPENDENT}; do + /bin/systemctl stop ${dep} + done + if [[ ! -z $DEV ]]; then + /bin/systemctl stop ${PEER}@$DEV + else + /bin/systemctl stop ${PEER} + fi fi } @@ -147,7 +146,8 @@ start() { $SONIC_DB_CLI ASIC_DB FLUSHDB $SONIC_DB_CLI COUNTERS_DB FLUSHDB $SONIC_DB_CLI FLEX_COUNTER_DB FLUSHDB - clean_up_tables STATE_DB "'PORT_TABLE*', 'MGMT_PORT_TABLE*', 'VLAN_TABLE*', 'VLAN_MEMBER_TABLE*', 'LAG_TABLE*', 'LAG_MEMBER_TABLE*', 'INTERFACE_TABLE*', 'MIRROR_SESSION*', 'VRF_TABLE*', 'FDB_TABLE*', 'FG_ROUTE_TABLE*', 'BUFFER_POOL*', 'BUFFER_PROFILE*'" + $SONIC_DB_CLI RESTAPI_DB FLUSHDB + clean_up_tables STATE_DB "'PORT_TABLE*', 'MGMT_PORT_TABLE*', 'VLAN_TABLE*', 'VLAN_MEMBER_TABLE*', 'LAG_TABLE*', 'LAG_MEMBER_TABLE*', 'INTERFACE_TABLE*', 'MIRROR_SESSION*', 'VRF_TABLE*', 'FDB_TABLE*', 'FG_ROUTE_TABLE*', 'BUFFER_POOL*', 'BUFFER_PROFILE*', 'MUX_CABLE_TABLE*', 'ADVERTISE_NETWORK_TABLE*', 'VXLAN_TUNNEL_TABLE*', 'VNET_ROUTE*', 'VNET_MONITOR_TABLE*', 'BFD_SESSION_TABLE*'" fi # start service docker diff --git a/files/scripts/syncd.sh b/files/scripts/syncd.sh index 22fa992b8e80..72cbcdea8073 100755 --- a/files/scripts/syncd.sh +++ b/files/scripts/syncd.sh @@ -21,9 +21,11 @@ function startplatform() { fi fi + debug "Starting Firmware update procedure" /usr/bin/mst start --with_i2cdev /usr/bin/mlnx-fw-upgrade.sh /etc/init.d/sxdkernel start + debug "Firmware update procedure ended" fi if [[ x"$WARM_BOOT" != x"true" ]]; then @@ -34,11 +36,28 @@ function startplatform() { } function waitplatform() { - + + BOOT_TYPE=`getBootType` if [[ x"$sonic_asic_platform" == x"mellanox" ]]; then - debug "Starting pmon service..." - /bin/systemctl start pmon - debug "Started pmon service" + if [[ x"$BOOT_TYPE" = @(x"fast"|x"warm"|x"fastfast") ]]; then + PMON_TIMER_STATUS=$(systemctl is-active pmon.timer) + if [[ x"$PMON_TIMER_STATUS" = x"inactive" ]]; then + systemctl start pmon.timer + else + debug "PMON service is delayed by a timer for better fast/warm boot performance" + fi + else + debug "Starting pmon service..." + /bin/systemctl start pmon + debug "Started pmon service" + fi + fi + if [[ x"$BOOT_TYPE" = @(x"fast"|x"warm"|x"fastfast") ]]; then + debug "LLDP service is delayed by a timer for better fast/warm boot performance" + else + debug "Starting lldp service..." + /bin/systemctl start lldp + debug "Started lldp service" fi } @@ -54,7 +73,7 @@ function stopplatform1() { debug "${TYPE} shutdown syncd process ..." /usr/bin/docker exec -i syncd$DEV /usr/bin/syncd_request_shutdown --${TYPE} - # wait until syncd quits gracefully or force syncd to exit after + # wait until syncd quits gracefully or force syncd to exit after # waiting for 20 seconds start_in_secs=${SECONDS} end_in_secs=${SECONDS} @@ -66,7 +85,7 @@ function stopplatform1() { done if [[ $((end_in_secs - start_in_secs)) -gt $timer_threshold ]]; then - debug "syncd process in container syncd$DEV did not exit gracefully" + debug "syncd process in container syncd$DEV did not exit gracefully" fi /usr/bin/docker exec -i syncd$DEV /bin/sync diff --git a/files/scripts/syncd_common.sh b/files/scripts/syncd_common.sh index 0e9fc8ac2d7a..a1566d4e58bc 100755 --- a/files/scripts/syncd_common.sh +++ b/files/scripts/syncd_common.sh @@ -3,11 +3,11 @@ # # common functions used by "syncd" scipts (syncd.sh, gbsyncd.sh, etc..) # scripts using this must provide implementations of the following functions: -# +# # startplatform # waitplatform # stopplatform1 and stopplatform2 -# +# # For examples of these, see gbsyncd.sh and syncd.sh. # @@ -23,7 +23,7 @@ function lock_service_state_change() exec {LOCKFD}>${LOCKFILE} /usr/bin/flock -x ${LOCKFD} - trap "/usr/bin/flock -u ${LOCKFD}" 0 2 3 15 + trap "/usr/bin/flock -u ${LOCKFD}" EXIT debug "Locked ${LOCKFILE} (${LOCKFD}) from ${SERVICE}$DEV service" } @@ -46,6 +46,15 @@ function check_warm_boot() fi } +function check_fast_boot() +{ + if [[ $($SONIC_DB_CLI STATE_DB GET "FAST_REBOOT|system") == "1" ]]; then + FAST_BOOT="true" + else + FAST_BOOT="false" + fi +} + function wait_for_database_service() { # Wait for redis server start before database clean @@ -122,10 +131,14 @@ stop() { lock_service_state_change check_warm_boot + check_fast_boot debug "Warm boot flag: ${SERVICE}$DEV ${WARM_BOOT}." + debug "Fast boot flag: ${SERVICE}$DEV ${FAST_BOOT}." if [[ x"$WARM_BOOT" == x"true" ]]; then TYPE=warm + elif [[ x"$FAST_BOOT" == x"true" ]]; then + TYPE=fast else TYPE=cold fi diff --git a/files/scripts/teamd.sh b/files/scripts/teamd.sh index 626bb5186ca0..a5e29c1d0904 100755 --- a/files/scripts/teamd.sh +++ b/files/scripts/teamd.sh @@ -3,7 +3,7 @@ function debug() { /usr/bin/logger $1 - /bin/echo `date` "- $1" >> ${DEBUGLOG} + /bin/echo `date` "- $1" >> ${DEBUG_LOG} } function check_warm_boot() @@ -69,26 +69,31 @@ stop() { # Send USR1 signal to all teamd instances to stop them # It will prepare teamd for warm-reboot # Note: We must send USR1 signal before syncd, because it will send the last packet through CPU port - docker exec -i ${SERVICE}$DEV pkill -USR1 ${SERVICE} > /dev/null || [ $? == 1 ] + docker exec -i ${SERVICE}$DEV pkill -USR1 -f ${TEAMD_CMD} > /dev/null || [ $? == 1 ] elif [[ x"$FAST_BOOT" == x"true" ]]; then # Kill teamd processes inside of teamd container with SIGUSR2 to allow them to send last LACP frames # We call `docker kill teamd` to ensure the container stops as quickly as possible, # Note: teamd must be killed before syncd, because it will send the last packet through CPU port - docker exec -i ${SERVICE}$DEV pkill -USR2 ${SERVICE} || [ $? == 1 ] - while docker exec -i ${SERVICE}$DEV pgrep ${SERVICE} > /dev/null; do + docker exec -i ${SERVICE}$DEV pkill -USR2 -f ${TEAMD_CMD} || [ $? == 1 ] + fi + + if [[ x"$WARM_BOOT" == x"true" ]] || [[ x"$FAST_BOOT" == x"true" ]]; then + while docker exec -i ${SERVICE}$DEV pgrep -f ${TEAMD_CMD} > /dev/null; do sleep 0.05 done docker kill ${SERVICE}$DEV &> /dev/null || debug "Docker ${SERVICE}$DEV is not running ($?) ..." + else + /usr/bin/${SERVICE}.sh stop $DEV fi - /usr/bin/${SERVICE}.sh stop $DEV debug "Stopped ${SERVICE}$DEV service..." } DEV=$2 SERVICE="teamd" -DEBUGLOG="/tmp/teamd-debug$DEV.log" +TEAMD_CMD="/usr/bin/teamd" +DEBUG_LOG="/tmp/teamd-debug$DEV.log" NAMESPACE_PREFIX="asic" if [ "$DEV" ]; then NET_NS="$NAMESPACE_PREFIX$DEV" #name of the network namespace diff --git a/files/scripts/telemetry.sh b/files/scripts/telemetry.sh new file mode 120000 index 000000000000..ce97295f0364 --- /dev/null +++ b/files/scripts/telemetry.sh @@ -0,0 +1 @@ +service_mgmt.sh \ No newline at end of file diff --git a/files/scripts/write_standby.py b/files/scripts/write_standby.py new file mode 100755 index 000000000000..13c5b17ea64e --- /dev/null +++ b/files/scripts/write_standby.py @@ -0,0 +1,199 @@ +#!/usr/bin/env python3 + +import argparse +import time + +from sonic_py_common import logger as log +from swsscommon.swsscommon import ConfigDBConnector, DBConnector, FieldValuePairs, ProducerStateTable, SonicV2Connector, Table +from swsscommon.swsscommon import APPL_DB, STATE_DB + +logger = log.Logger('write_standby') + +REDIS_SOCK_PATH = '/var/run/redis/redis.sock' + + +def create_fvs(**kwargs): + return FieldValuePairs(list(kwargs.items())) + +class MuxStateWriter(object): + """ + Class used to write standby mux state to APP DB + """ + + def __init__(self, activeactive, activestandby, shutdown_module): + self.config_db_connector = None + self.appl_db_connector = None + self.state_db_connector = None + self.asic_db_connector = None + self.default_active_active_state = activeactive + self.default_active_standby_state = activestandby + self.shutdown_module = shutdown_module + self.is_shutdwon = (self.shutdown_module != None) + + @property + def config_db(self): + """ + Returns config DB connector. + Initializes the connector during the first call + """ + if self.config_db_connector is None: + self.config_db_connector = ConfigDBConnector() + self.config_db_connector.connect() + + return self.config_db_connector + + @property + def appl_db(self): + """ + Returns the app DB connector. + Initializes the connector during the first call + """ + if self.appl_db_connector is None: + self.appl_db_connector = DBConnector(APPL_DB, REDIS_SOCK_PATH, True) + return self.appl_db_connector + + @property + def state_db(self): + """ + Returns the state DB connector. + Intializes the connector during the first call + """ + if self.state_db_connector is None: + self.state_db_connector = DBConnector(STATE_DB, REDIS_SOCK_PATH, True) + return self.state_db_connector + + @property + def asic_db(self): + """ + Returns the ASIC DB connector. + Initializes the connector during the first call + """ + if self.asic_db_connector is None: + self.asic_db_connector = SonicV2Connector() + self.asic_db_connector.connect('ASIC_DB') + + return self.asic_db_connector + + @property + def tunnel_name(self): + """ + Returns the name of the IP-in-IP tunnel used for Dual ToR devices + """ + return self.config_db.get_keys('TUNNEL')[0] + + @property + def is_dualtor(self): + """ + Checks if script is running on a dual ToR system + """ + localhost_key = self.config_db.get_keys('DEVICE_METADATA')[0] + metadata = self.config_db.get_entry('DEVICE_METADATA', localhost_key) + + return 'subtype' in metadata and 'dualtor' in metadata['subtype'].lower() + + @property + def is_warmrestart(self): + """ + Checks if a warmrestart is going on + """ + tbl = Table(self.state_db, 'WARM_RESTART_ENABLE_TABLE') + (status, value) = tbl.hget('system', 'enable') + + if status and value == 'true': + return True + + if self.shutdown_module: + (status, value) = tbl.hget(self.shutdown_module, 'enable') + if status and value == 'true': + return True + + return False + + def get_all_mux_intfs_modes(self): + """ + Returns a list of all mux cable interfaces, with suggested modes + Setting mux initial modes is crucial to kick off the statemachines, + have to set the modes for all mux/gRPC ports. + """ + intf_modes = {} + all_intfs = self.config_db.get_table('MUX_CABLE') + for intf, status in all_intfs.items(): + state = status['state'].lower() + if state in ['active', 'standby']: + intf_modes[intf] = state + elif state in ['auto', 'manual']: + if ('soc_ipv4' in status or 'soc_ipv6' in status or + ('cable_type' in status and status['cable_type'] == 'active-active')): + intf_modes[intf] = self.default_active_active_state + else: + intf_modes[intf] = self.default_active_standby_state + return intf_modes + + def tunnel_exists(self): + """ + Checks if the IP-in-IP tunnel has been written to ASIC DB + """ + tunnel_key_pattern = 'ASIC_STATE:SAI_OBJECT_TYPE_TUNNEL:*' + return len(self.asic_db.keys('ASIC_DB', tunnel_key_pattern)) > 0 + + def wait_for_tunnel(self, interval=1, timeout=60): + """ + Waits until the IP-in-IP tunnel has been created + + Returns: + (bool) True if the tunnel has been created + False if the timeout period is exceeded + """ + logger.log_info("Waiting for tunnel {} with timeout {} seconds".format(self.tunnel_name, timeout)) + start = time.time() + curr_time = time.time() + + while not self.tunnel_exists() and curr_time - start < timeout: + time.sleep(interval) + curr_time = time.time() + + # If we timed out, return False else return True + return curr_time - start < timeout + + def apply_mux_config(self): + """ + Writes standby mux state to APP DB for all mux interfaces + """ + if not self.is_dualtor: + # If not running on a dual ToR system, take no action + return + + if self.is_warmrestart and self.is_shutdwon: + # If in warmrestart context, take no action + logger.log_warning("Skip setting mux state due to ongoing warmrestart.") + return + + modes = self.get_all_mux_intfs_modes() + if self.wait_for_tunnel(): + logger.log_warning("Applying state to interfaces {}".format(modes)) + producer_state_table = ProducerStateTable(self.appl_db, 'MUX_CABLE_TABLE') + + for intf, state in modes.items(): + fvs = create_fvs(state=state) + producer_state_table.set(intf, fvs) + else: + logger.log_error("Timed out waiting for tunnel {}, mux state will not be written".format(self.tunnel_name)) + + +if __name__ == '__main__': + parser = argparse.ArgumentParser(description='Write initial mux state') + parser.add_argument('-a', '--active_active', + help='state: intial state for "auto" and/or "manual" config in active-active mode, default "active"', + type=str, required=False, default='active') + parser.add_argument('-s', '--active_standby', + help='state: intial state for "auto" and/or "manual" config in active-standby mode, default "standby"', + type=str, required=False, default='standby') + parser.add_argument('--shutdown', help='write mux state after shutdown other services, supported: mux, bgp', + type=str, required=False, choices=['mux', 'bgp'], default=None) + args = parser.parse_args() + active_active_state = args.active_active + active_standby_state = args.active_standby + if args.shutdown in ['mux', 'bgp']: + active_active_state = "standby" + mux_writer = MuxStateWriter(activeactive=active_active_state, activestandby=active_standby_state, shutdown_module=args.shutdown) + mux_writer.apply_mux_config() diff --git a/files/sshd/override.conf b/files/sshd/override.conf new file mode 100644 index 000000000000..a1e63ce22b5d --- /dev/null +++ b/files/sshd/override.conf @@ -0,0 +1,4 @@ +[Service] +ExecStartPre= +ExecStartPre=/usr/local/bin/host-ssh-keygen.sh +ExecStartPre=/usr/sbin/sshd -t diff --git a/files/sshd/sshd.service b/files/sshd/sshd.service deleted file mode 100644 index 25d524171c6f..000000000000 --- a/files/sshd/sshd.service +++ /dev/null @@ -1,18 +0,0 @@ -[Unit] -Description=OpenBSD Secure Shell server -After=network.target auditd.service -ConditionPathExists=!/etc/ssh/sshd_not_to_be_run - -[Service] -EnvironmentFile=-/etc/default/ssh -ExecStartPre=-/usr/local/bin/host-ssh-keygen.sh -ExecStart=/usr/sbin/sshd -D $SSHD_OPTS -ExecReload=/bin/kill -HUP $MAINPID -KillMode=process -Restart=on-failure -RuntimeDirectory=sshd -RuntimeDirectoryMode=0755 - -[Install] -WantedBy=multi-user.target -Alias=sshd.service diff --git a/installer/arm64/install.sh b/installer/arm64/install.sh index 280d9f200af9..6e61999ada97 100755 --- a/installer/arm64/install.sh +++ b/installer/arm64/install.sh @@ -98,7 +98,13 @@ if [ "$install_env" = "onie" ]; then mount_partition elif [ "$install_env" = "sonic" ]; then demo_mnt="/host" - eval running_sonic_revision=$(cat /etc/sonic/sonic_version.yml | grep build_version | cut -f2 -d" ") + # Get current SONiC image (grub/aboot/uboot) + eval running_sonic_revision="$(cat /proc/cmdline | sed -n 's/^.*loop=\/*image-\(\S\+\)\/.*$/\1/p')" + # Verify SONiC image exists + if [ ! -d "$demo_mnt/image-$running_sonic_revision" ]; then + echo "ERROR: SONiC installation is corrupted: path $demo_mnt/image-$running_sonic_revision doesn't exist" + exit 1 + fi # Prevent installing existing SONiC if it is running if [ "$image_dir" = "image-$running_sonic_revision" ]; then echo "Not installing SONiC version $running_sonic_revision, as current running SONiC has the same version" @@ -127,9 +133,9 @@ fi # Decompress the file for the file system directly to the partition if [ x"$docker_inram" = x"on" ]; then # when disk is small, keep dockerfs.tar.gz in disk, expand it into ramfs during initrd - unzip -o $ONIE_INSTALLER_PAYLOAD -d $demo_mnt/$image_dir + unzip -o $ONIE_INSTALLER_PAYLOAD -x "platform.tar.gz" -d $demo_mnt/$image_dir else - unzip -o $ONIE_INSTALLER_PAYLOAD -x "$FILESYSTEM_DOCKERFS" -d $demo_mnt/$image_dir + unzip -o $ONIE_INSTALLER_PAYLOAD -x "$FILESYSTEM_DOCKERFS" "platform.tar.gz" -d $demo_mnt/$image_dir if [ "$install_env" = "onie" ]; then TAR_EXTRA_OPTION="--numeric-owner" @@ -140,6 +146,8 @@ else unzip -op $ONIE_INSTALLER_PAYLOAD "$FILESYSTEM_DOCKERFS" | tar xz $TAR_EXTRA_OPTION -f - -C $demo_mnt/$image_dir/$DOCKERFS_DIR fi +mkdir -p $demo_mnt/$image_dir/platform +unzip -op $ONIE_INSTALLER_PAYLOAD "platform.tar.gz" | tar xz $TAR_EXTRA_OPTION -f - -C $demo_mnt/$image_dir/platform if [ "$install_env" = "onie" ]; then # Store machine description in target file system diff --git a/installer/armhf/install.sh b/installer/armhf/install.sh index 53f2fdf99661..c0fa82ab2cc3 100755 --- a/installer/armhf/install.sh +++ b/installer/armhf/install.sh @@ -98,7 +98,13 @@ if [ "$install_env" = "onie" ]; then mount_partition elif [ "$install_env" = "sonic" ]; then demo_mnt="/host" - eval running_sonic_revision=$(cat /etc/sonic/sonic_version.yml | grep build_version | cut -f2 -d" ") + # Get current SONiC image (grub/aboot/uboot) + eval running_sonic_revision="$(cat /proc/cmdline | sed -n 's/^.*loop=\/*image-\(\S\+\)\/.*$/\1/p')" + # Verify SONiC image exists + if [ ! -d "$demo_mnt/image-$running_sonic_revision" ]; then + echo "ERROR: SONiC installation is corrupted: path $demo_mnt/image-$running_sonic_revision doesn't exist" + exit 1 + fi # Prevent installing existing SONiC if it is running if [ "$image_dir" = "image-$running_sonic_revision" ]; then echo "Not installing SONiC version $running_sonic_revision, as current running SONiC has the same version" @@ -127,9 +133,9 @@ fi # Decompress the file for the file system directly to the partition if [ x"$docker_inram" = x"on" ]; then # when disk is small, keep dockerfs.tar.gz in disk, expand it into ramfs during initrd - unzip -o $ONIE_INSTALLER_PAYLOAD -d $demo_mnt/$image_dir + unzip -o $ONIE_INSTALLER_PAYLOAD -x "platform.tar.gz" -d $demo_mnt/$image_dir else - unzip -o $ONIE_INSTALLER_PAYLOAD -x "$FILESYSTEM_DOCKERFS" -d $demo_mnt/$image_dir + unzip -o $ONIE_INSTALLER_PAYLOAD -x "$FILESYSTEM_DOCKERFS" "platform.tar.gz" -d $demo_mnt/$image_dir if [ "$install_env" = "onie" ]; then TAR_EXTRA_OPTION="--numeric-owner" @@ -140,6 +146,8 @@ else unzip -op $ONIE_INSTALLER_PAYLOAD "$FILESYSTEM_DOCKERFS" | tar xz $TAR_EXTRA_OPTION -f - -C $demo_mnt/$image_dir/$DOCKERFS_DIR fi +mkdir -p $demo_mnt/$image_dir/platform +unzip -op $ONIE_INSTALLER_PAYLOAD "platform.tar.gz" | tar xz $TAR_EXTRA_OPTION -f - -C $demo_mnt/$image_dir/platform if [ "$install_env" = "onie" ]; then # Store machine description in target file system diff --git a/installer/sharch_body.sh b/installer/sharch_body.sh index d22fe26b6998..e6289371cd58 100644 --- a/installer/sharch_body.sh +++ b/installer/sharch_body.sh @@ -25,6 +25,7 @@ fi echo " OK." +image_size_in_kb=$((($(sed -e '1,/^exit_marker$/d' "$0" | tar --to-stdout -xf - | wc -c) + 1023 ) / 1024)) # Untar and launch install script in a tmpfs cur_wd=$(pwd) export cur_wd @@ -32,6 +33,15 @@ archive_path=$(realpath "$0") tmp_dir=$(mktemp -d) if [ "$(id -u)" = "0" ] ; then mount -t tmpfs tmpfs-installer $tmp_dir || exit 1 + mount_size_in_kb=$(df $tmp_dir | tail -1 | tr -s ' ' | cut -d' ' -f4) + #checking extra 100KB space in tmp_dir, after image extraction + padding=102400 + if [ "$mount_size_in_kb" -le "$((image_size_in_kb + padding))" ]; then + image_size_in_mb=$(((image_size_in_kb + 1023) / 1024)) + #Adding extra 32MB free space for image extraction. + mount_size_in_mb=$((((image_size_in_mb + 31) / 32) * 32)) + mount -o remount,size="${mount_size_in_mb}M" -t tmpfs tmpfs-installer $tmp_dir || exit 1 + fi fi cd $tmp_dir echo -n "Preparing image archive ..." diff --git a/installer/x86_64/install.sh b/installer/x86_64/install.sh index 349880114d04..15ef85e2cf2b 100755 --- a/installer/x86_64/install.sh +++ b/installer/x86_64/install.sh @@ -447,7 +447,13 @@ if [ "$install_env" = "onie" ]; then elif [ "$install_env" = "sonic" ]; then demo_mnt="/host" - eval running_sonic_revision=$(cat /etc/sonic/sonic_version.yml | grep build_version | cut -f2 -d" ") + # Get current SONiC image (grub/aboot/uboot) + eval running_sonic_revision="$(cat /proc/cmdline | sed -n 's/^.*loop=\/*image-\(\S\+\)\/.*$/\1/p')" + # Verify SONiC image exists + if [ ! -d "$demo_mnt/image-$running_sonic_revision" ]; then + echo "ERROR: SONiC installation is corrupted: path $demo_mnt/image-$running_sonic_revision doesn't exist" + exit 1 + fi # Prevent installing existing SONiC if it is running if [ "$image_dir" = "image-$running_sonic_revision" ]; then echo "Not installing SONiC version $running_sonic_revision, as current running SONiC has the same version" @@ -487,9 +493,9 @@ fi # Decompress the file for the file system directly to the partition if [ x"$docker_inram" = x"on" ]; then # when disk is small, keep dockerfs.tar.gz in disk, expand it into ramfs during initrd - unzip -o $ONIE_INSTALLER_PAYLOAD -d $demo_mnt/$image_dir + unzip -o $ONIE_INSTALLER_PAYLOAD -x "platform.tar.gz" -d $demo_mnt/$image_dir else - unzip -o $ONIE_INSTALLER_PAYLOAD -x "$FILESYSTEM_DOCKERFS" -d $demo_mnt/$image_dir + unzip -o $ONIE_INSTALLER_PAYLOAD -x "$FILESYSTEM_DOCKERFS" "platform.tar.gz" -d $demo_mnt/$image_dir if [ "$install_env" = "onie" ]; then TAR_EXTRA_OPTION="--numeric-owner" @@ -500,6 +506,9 @@ else unzip -op $ONIE_INSTALLER_PAYLOAD "$FILESYSTEM_DOCKERFS" | tar xz $TAR_EXTRA_OPTION -f - -C $demo_mnt/$image_dir/$DOCKERFS_DIR fi +mkdir -p $demo_mnt/$image_dir/platform +unzip -op $ONIE_INSTALLER_PAYLOAD "platform.tar.gz" | tar xz $TAR_EXTRA_OPTION -f - -C $demo_mnt/$image_dir/platform + if [ "$install_env" = "onie" ]; then # Store machine description in target file system if [ -f /etc/machine-build.conf ]; then @@ -542,9 +551,10 @@ trap_push "rm $grub_cfg || true" [ -r ./platform.conf ] && . ./platform.conf # Check if the CPU vendor is 'Intel' and disable c-states if True -CPUVENDOR=$(cat /proc/cpuinfo | grep -m 1 vendor_id | awk '{print $3}') +CPUVENDOR="$(cat /proc/cpuinfo | grep -m 1 vendor_id | awk '{print $3}')" echo "Switch CPU vendor is: $CPUVENDOR" -if [[ $(echo $CPUVENDOR | grep -i "Intel") ]] ; then +if echo "$CPUVENDOR" | grep -i 'Intel' >/dev/null 2>&1; then + echo "Switch CPU cstates are: disabled" CSTATES="intel_idle.max_cstate=0" else CSTATES="" @@ -602,7 +612,7 @@ fi # Note: assume that apparmor is supported in the kernel demo_grub_entry="$demo_volume_revision_label" if [ "$install_env" = "sonic" ]; then - old_sonic_menuentry=$(cat /host/grub/grub.cfg | sed "/$running_sonic_revision/,/}/!d") + old_sonic_menuentry=$(cat /host/grub/grub.cfg | sed "/^menuentry '${demo_volume_label}-${running_sonic_revision}'/,/}/!d") grub_cfg_root=$(echo $old_sonic_menuentry | sed -e "s/.*root\=\(.*\)rw.*/\1/") onie_menuentry=$(cat /host/grub/grub.cfg | sed "/menuentry ONIE/,/}/!d") elif [ "$install_env" = "build" ]; then @@ -624,12 +634,13 @@ menuentry '$demo_grub_entry' { if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi insmod part_msdos insmod ext2 - linux /$image_dir/boot/vmlinuz-4.19.0-9-2-amd64 root=$grub_cfg_root rw $GRUB_CMDLINE_LINUX \ + linux /$image_dir/boot/vmlinuz-4.19.0-12-2-amd64 root=$grub_cfg_root rw $GRUB_CMDLINE_LINUX \ net.ifnames=0 biosdevname=0 \ loop=$image_dir/$FILESYSTEM_SQUASHFS loopfstype=squashfs \ + systemd.unified_cgroup_hierarchy=0 \ apparmor=1 security=apparmor varlog_size=$VAR_LOG_SIZE usbcore.autosuspend=-1 $ONIE_PLATFORM_EXTRA_CMDLINE_LINUX echo 'Loading $demo_volume_label $demo_type initial ramdisk ...' - initrd /$image_dir/boot/initrd.img-4.19.0-9-2-amd64 + initrd /$image_dir/boot/initrd.img-4.19.0-12-2-amd64 } EOF diff --git a/platform/barefoot/.gitignore b/platform/barefoot/.gitignore new file mode 100644 index 000000000000..f56830430d73 --- /dev/null +++ b/platform/barefoot/.gitignore @@ -0,0 +1,2 @@ +# Overwrite ignore 'platform/**/debian/*' in root directory. +!**/debian/* diff --git a/platform/barefoot/bfn-modules/configs/bfn-modules.conf b/platform/barefoot/bfn-modules/configs/bfn-modules.conf new file mode 100644 index 000000000000..c315cf5106b8 --- /dev/null +++ b/platform/barefoot/bfn-modules/configs/bfn-modules.conf @@ -0,0 +1,6 @@ +# /etc/modules: kernel modules to load at boot time. +# +# This file contains the names of kernel modules that should be loaded +# at boot time, one per line. Lines beginning with "#" are ignored. + +psample \ No newline at end of file diff --git a/platform/barefoot/bfn-modules/debian/control b/platform/barefoot/bfn-modules/debian/control index 2c3d8368bc4b..be1f6cc0443a 100644 --- a/platform/barefoot/bfn-modules/debian/control +++ b/platform/barefoot/bfn-modules/debian/control @@ -7,6 +7,6 @@ Standards-Version: 3.9.3 Package: bfn-modules Architecture: amd64 -Depends: linux-image-4.19.0-9-2-amd64-unsigned +Depends: linux-image-4.19.0-12-2-amd64-unsigned Description: kernel modules for bfn asic for mmap diff --git a/platform/barefoot/bfn-modules/debian/install b/platform/barefoot/bfn-modules/debian/install new file mode 100644 index 000000000000..648ee226cc7a --- /dev/null +++ b/platform/barefoot/bfn-modules/debian/install @@ -0,0 +1 @@ +configs/bfn-modules.conf etc/modules-load.d \ No newline at end of file diff --git a/platform/barefoot/bfn-platform.mk b/platform/barefoot/bfn-platform.mk index 1524a5be9b07..0077d42162bc 100644 --- a/platform/barefoot/bfn-platform.mk +++ b/platform/barefoot/bfn-platform.mk @@ -1,4 +1,4 @@ -BFN_PLATFORM = bfnplatform_20201224_deb9.deb +BFN_PLATFORM = bfnplatform_20220221_sai.1.7.1_deb10.deb $(BFN_PLATFORM)_URL = "https://github.com/barefootnetworks/sonic-release-pkgs/raw/dev/$(BFN_PLATFORM)" SONIC_ONLINE_DEBS += $(BFN_PLATFORM) diff --git a/platform/barefoot/bfn-sai.mk b/platform/barefoot/bfn-sai.mk index 0ef4f40258af..4d68fc3ec30a 100644 --- a/platform/barefoot/bfn-sai.mk +++ b/platform/barefoot/bfn-sai.mk @@ -1,4 +1,4 @@ -BFN_SAI = bfnsdk_20201224_deb9.deb +BFN_SAI = bfnsdk_20220221_sai.1.7.1_deb10.deb $(BFN_SAI)_URL = "https://github.com/barefootnetworks/sonic-release-pkgs/raw/dev/$(BFN_SAI)" $(BFN_SAI)_DEPENDS += $(LIBNL_GENL3_DEV) diff --git a/platform/barefoot/docker-ptf-bfn.mk b/platform/barefoot/docker-ptf-bfn.mk deleted file mode 100644 index 752e7345752a..000000000000 --- a/platform/barefoot/docker-ptf-bfn.mk +++ /dev/null @@ -1,6 +0,0 @@ -# docker image for docker-ptf - -DOCKER_PTF_BFN = docker-ptf-bfn.gz -$(DOCKER_PTF_BFN)_PATH = $(DOCKERS_PATH)/docker-ptf-saithrift -$(DOCKER_PTF_BFN)_LOAD_DOCKERS += $(DOCKER_PTF) -SONIC_STRETCH_DOCKERS += $(DOCKER_PTF_BFN) diff --git a/platform/barefoot/docker-syncd-bfn-rpc.mk b/platform/barefoot/docker-syncd-bfn-rpc.mk index 11b70a3a774f..aee465151d84 100644 --- a/platform/barefoot/docker-syncd-bfn-rpc.mk +++ b/platform/barefoot/docker-syncd-bfn-rpc.mk @@ -12,7 +12,6 @@ $(DOCKER_SYNCD_BFN_RPC)_DEPENDS += $(SYNCD_RPC_DBG) \ endif $(DOCKER_SYNCD_BFN_RPC)_LOAD_DOCKERS += $(DOCKER_SYNCD_BASE) SONIC_DOCKER_IMAGES += $(DOCKER_SYNCD_BFN_RPC) -SONIC_STRETCH_DOCKERS += $(DOCKER_SYNCD_BFN_RPC) ifeq ($(ENABLE_SYNCD_RPC),y) SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_SYNCD_BFN_RPC) endif diff --git a/platform/barefoot/docker-syncd-bfn-rpc/Dockerfile.j2 b/platform/barefoot/docker-syncd-bfn-rpc/Dockerfile.j2 index f3c9979dfa63..5e5f5f166e5e 100644 --- a/platform/barefoot/docker-syncd-bfn-rpc/Dockerfile.j2 +++ b/platform/barefoot/docker-syncd-bfn-rpc/Dockerfile.j2 @@ -11,24 +11,28 @@ debs/ RUN apt-get purge -y syncd -RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; } ; \ -{% for deb in docker_syncd_bfn_rpc_debs.split(' ') -%} -dpkg_apt debs/{{ deb }}{{'; '}} -{%- endfor %} - ## Pre-install the fundamental packages RUN apt-get update \ && apt-get -y install \ net-tools \ python-pip \ + python-setuptools \ build-essential \ libssl-dev \ libffi-dev \ python-dev \ wget \ cmake \ - libpython3.4 \ - && wget https://github.com/nanomsg/nanomsg/archive/1.0.0.tar.gz \ + libqt5core5a \ + libqt5network5 \ + libboost-atomic1.71.0 + +RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; } ; \ +{% for deb in docker_syncd_bfn_rpc_debs.split(' ') -%} +dpkg_apt debs/{{ deb }}{{'; '}} +{%- endfor %} + +RUN wget https://github.com/nanomsg/nanomsg/archive/1.0.0.tar.gz \ && tar xvfz 1.0.0.tar.gz \ && cd nanomsg-1.0.0 \ && mkdir -p build \ @@ -38,9 +42,10 @@ RUN apt-get update \ && cd .. \ && rm -fr nanomsg-1.0.0 \ && rm -f 1.0.0.tar.gz \ - && pip install cffi==1.7.0 \ - && pip install --upgrade cffi==1.7.0 \ - && pip install nnpy \ + && pip2 install cffi==1.7.0 \ + && pip2 install --upgrade cffi==1.7.0 \ + && pip2 install wheel \ + && pip2 install nnpy \ && mkdir -p /opt \ && cd /opt \ && wget https://raw.githubusercontent.com/p4lang/ptf/master/ptf_nn/ptf_nn_agent.py \ @@ -48,5 +53,5 @@ RUN apt-get update \ && rm -rf /root/deps COPY ["ptf_nn_agent.conf", "/etc/supervisor/conf.d/"] - + ENTRYPOINT ["/usr/local/bin/supervisord"] diff --git a/platform/barefoot/docker-syncd-bfn.mk b/platform/barefoot/docker-syncd-bfn.mk index ae4ca9d9f272..2ada27bed7e4 100644 --- a/platform/barefoot/docker-syncd-bfn.mk +++ b/platform/barefoot/docker-syncd-bfn.mk @@ -10,8 +10,4 @@ $(DOCKER_SYNCD_BASE)_DBG_DEPENDS += $(SYNCD_DBG) \ $(LIBSAIMETADATA_DBG) \ $(LIBSAIREDIS_DBG) -SONIC_STRETCH_DOCKERS += $(DOCKER_SYNCD_BASE) -SONIC_STRETCH_DBG_DOCKERS += $(DOCKER_SYNCD_BASE_DBG) - $(DOCKER_SYNCD_BASE)_RUN_OPT += -v /host/warmboot:/var/warmboot -$(DOCKER_SYNCD_BASE)_BASE_IMAGE_FILES += monit_syncd:/etc/monit/conf.d diff --git a/platform/barefoot/docker-syncd-bfn/Dockerfile.j2 b/platform/barefoot/docker-syncd-bfn/Dockerfile.j2 index b4bcafe5926a..b9dbad963665 100755 --- a/platform/barefoot/docker-syncd-bfn/Dockerfile.j2 +++ b/platform/barefoot/docker-syncd-bfn/Dockerfile.j2 @@ -1,4 +1,4 @@ -FROM docker-config-engine-stretch +FROM docker-config-engine-buster ## Make apt-get non-interactive ENV DEBIAN_FRONTEND=noninteractive @@ -15,7 +15,7 @@ RUN apt-get install -y \ libxml2 \ libpcap-dev \ libusb-1.0-0-dev \ - libcurl3 \ + libcurl4 \ libcurl4-gnutls-dev \ libunwind8-dev \ libpython3.4 \ diff --git a/platform/barefoot/docker-syncd-bfn/base_image_files/monit_syncd b/platform/barefoot/docker-syncd-bfn/base_image_files/monit_syncd deleted file mode 100644 index 61e290e3189e..000000000000 --- a/platform/barefoot/docker-syncd-bfn/base_image_files/monit_syncd +++ /dev/null @@ -1,7 +0,0 @@ -############################################################################### -## Monit configuration for syncd container -## process list: -## syncd -############################################################################### -check program syncd|syncd with path "/usr/bin/process_checker syncd /usr/bin/syncd" - if status != 0 for 5 times within 5 cycles then alert repeat every 1 cycles diff --git a/platform/barefoot/docker-syncd-bfn/supervisord.conf b/platform/barefoot/docker-syncd-bfn/supervisord.conf index cb54aa419484..62230f8be9d0 100644 --- a/platform/barefoot/docker-syncd-bfn/supervisord.conf +++ b/platform/barefoot/docker-syncd-bfn/supervisord.conf @@ -4,19 +4,20 @@ logfile_backups=2 nodaemon=true [eventlistener:dependent-startup] -command=python2 -m supervisord_dependent_startup +command=python3 -m supervisord_dependent_startup autostart=true autorestart=unexpected startretries=0 exitcodes=0,3 events=PROCESS_STATE -buffer_size=25 +buffer_size=1024 [eventlistener:supervisor-proc-exit-listener] -command=python2 /usr/bin/supervisor-proc-exit-listener --container-name syncd -events=PROCESS_STATE_EXITED +command=/usr/bin/supervisor-proc-exit-listener --container-name syncd +events=PROCESS_STATE_EXITED,PROCESS_STATE_RUNNING autostart=true autorestart=unexpected +buffer_size=1024 [program:rsyslogd] command=/usr/sbin/rsyslogd -n -iNONE diff --git a/platform/barefoot/rules.mk b/platform/barefoot/rules.mk index a2948b12892b..98dcef0f7b8a 100644 --- a/platform/barefoot/rules.mk +++ b/platform/barefoot/rules.mk @@ -10,7 +10,6 @@ include $(PLATFORM_PATH)/docker-syncd-bfn-rpc.mk include $(PLATFORM_PATH)/one-aboot.mk include $(PLATFORM_PATH)/one-image.mk include $(PLATFORM_PATH)/libsaithrift-dev.mk -include $(PLATFORM_PATH)/docker-ptf-bfn.mk include $(PLATFORM_PATH)/bfn-platform.mk #include $(PLATFORM_PATH)/bfn-platform-wnc.mk #include $(PLATFORM_PATH)/bfn-platform-ingrasys.mk diff --git a/platform/barefoot/sonic-platform-modules-arista b/platform/barefoot/sonic-platform-modules-arista index adf108419894..a682da369cbb 160000 --- a/platform/barefoot/sonic-platform-modules-arista +++ b/platform/barefoot/sonic-platform-modules-arista @@ -1 +1 @@ -Subproject commit adf108419894f3b58c0c69722e0be3c72613180e +Subproject commit a682da369cbbab66dd477ca573dfe12f52c74c9c diff --git a/platform/barefoot/sonic-platform-modules-bfn-montara/debian/control b/platform/barefoot/sonic-platform-modules-bfn-montara/debian/control index 7c46f1f96fa7..a3ea06992dc4 100644 --- a/platform/barefoot/sonic-platform-modules-bfn-montara/debian/control +++ b/platform/barefoot/sonic-platform-modules-bfn-montara/debian/control @@ -7,6 +7,6 @@ Standards-Version: 3.9.3 Package: sonic-platform-modules-bfn-montara Architecture: amd64 -Depends: linux-image-4.19.0-9-2-amd64-unsigned +Depends: linux-image-4.19.0-12-2-amd64-unsigned Description: kernel modules for platform devices such as fan, led, sfp diff --git a/platform/barefoot/sonic-platform-modules-bfn-montara/debian/postinst b/platform/barefoot/sonic-platform-modules-bfn-montara/debian/postinst new file mode 100755 index 000000000000..a218d59e2652 --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-bfn-montara/debian/postinst @@ -0,0 +1,10 @@ +#!/bin/sh +set -e + +PLATFORM_NAME=x86_64-accton_wedge100bf_32x-r0 +SONIC_PLATFORM_WHEEL_PY2="/usr/share/sonic/device/${PLATFORM_NAME}/sonic_platform-1.0-py2-none-any.whl" +python2 -m pip install ${SONIC_PLATFORM_WHEEL_PY2} +SONIC_PLATFORM_WHEEL_PY3="/usr/share/sonic/device/${PLATFORM_NAME}/sonic_platform-1.0-py3-none-any.whl" +python3 -m pip install ${SONIC_PLATFORM_WHEEL_PY3} + +#DEBHELPER# diff --git a/platform/barefoot/sonic-platform-modules-bfn-montara/debian/prerm b/platform/barefoot/sonic-platform-modules-bfn-montara/debian/prerm new file mode 100755 index 000000000000..ee19dbb1db98 --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-bfn-montara/debian/prerm @@ -0,0 +1,6 @@ +#!/bin/sh + +python2 -m pip uninstall -y sonic-platform +python3 -m pip uninstall -y sonic-platform + +#DEBHELPER# diff --git a/platform/barefoot/sonic-platform-modules-bfn-montara/debian/rules b/platform/barefoot/sonic-platform-modules-bfn-montara/debian/rules index b04234a0df1b..4070b66dfdac 100755 --- a/platform/barefoot/sonic-platform-modules-bfn-montara/debian/rules +++ b/platform/barefoot/sonic-platform-modules-bfn-montara/debian/rules @@ -6,7 +6,6 @@ SCRIPT_SRC := $(shell pwd)/scripts CONFIGS_SRC := $(shell pwd)/configs BUILD_DIR := $(shell pwd)/build WHEEL_BUILD_DIR := $(BUILD_DIR)/wheel -PLUGINS_DIR := $(shell pwd)/plugins %: dh $@ @@ -24,8 +23,6 @@ override_dh_auto_install: cp -r $(CONFIGS_SRC)/network/interfaces.d/* debian/$(PACKAGE_NAME)/etc/network/interfaces.d/ dh_installdirs -p$(PACKAGE_NAME) usr/share/sonic/device/$(PLATFORM_NAME)/ cp -r $(WHEEL_BUILD_DIR)/* debian/$(PACKAGE_NAME)/usr/share/sonic/device/$(PLATFORM_NAME)/ - dh_installdirs -p$(PACKAGE_NAME) usr/share/sonic/device/$(PLATFORM_NAME)/plugins - cp -r $(PLUGINS_DIR)/* debian/$(PACKAGE_NAME)/usr/share/sonic/device/$(PLATFORM_NAME)/plugins/ override_dh_usrlocal: diff --git a/platform/barefoot/sonic-platform-modules-bfn-montara/scripts/bf-fancontrol b/platform/barefoot/sonic-platform-modules-bfn-montara/scripts/bf-fancontrol new file mode 100755 index 000000000000..7407c2d7241d --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-bfn-montara/scripts/bf-fancontrol @@ -0,0 +1,3 @@ +#!/bin/bash + +python3 -m sonic_platform.bfn_extensions.platform_fancontrol "$@" diff --git a/platform/barefoot/sonic-platform-modules-bfn-montara/scripts/bf-sfputil b/platform/barefoot/sonic-platform-modules-bfn-montara/scripts/bf-sfputil deleted file mode 100755 index 3df67614e499..000000000000 --- a/platform/barefoot/sonic-platform-modules-bfn-montara/scripts/bf-sfputil +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -DOCKER_EXEC_FLAGS="i" - -# Determine whether stdout is on a terminal -if [ -t 1 ] ; then - DOCKER_EXEC_FLAGS+="t" -fi - -docker exec -$DOCKER_EXEC_FLAGS syncd sfputil "$@" diff --git a/platform/barefoot/sonic-platform-modules-bfn-montara/scripts/eeprom b/platform/barefoot/sonic-platform-modules-bfn-montara/scripts/eeprom deleted file mode 100755 index 07d98556cbbf..000000000000 --- a/platform/barefoot/sonic-platform-modules-bfn-montara/scripts/eeprom +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -DOCKER_EXEC_FLAGS="i" - -# Determine whether stdout is on a terminal -if [ -t 1 ] ; then - DOCKER_EXEC_FLAGS+="t" -fi - -docker exec -$DOCKER_EXEC_FLAGS syncd eeprom "$@" diff --git a/platform/barefoot/sonic-platform-modules-bfn-montara/scripts/fancontrol b/platform/barefoot/sonic-platform-modules-bfn-montara/scripts/fancontrol deleted file mode 100755 index 515fcbdd69da..000000000000 --- a/platform/barefoot/sonic-platform-modules-bfn-montara/scripts/fancontrol +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -DOCKER_EXEC_FLAGS="i" - -# Determine whether stdout is on a terminal -if [ -t 1 ] ; then - DOCKER_EXEC_FLAGS+="t" -fi - -docker exec -$DOCKER_EXEC_FLAGS syncd fancontrol "$@" - diff --git a/platform/barefoot/sonic-platform-modules-bfn-montara/scripts/ps_info b/platform/barefoot/sonic-platform-modules-bfn-montara/scripts/ps_info deleted file mode 100755 index 38c9d3330414..000000000000 --- a/platform/barefoot/sonic-platform-modules-bfn-montara/scripts/ps_info +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -DOCKER_EXEC_FLAGS="i" - -# Determine whether stdout is on a terminal -if [ -t 1 ] ; then - DOCKER_EXEC_FLAGS+="t" -fi - -docker exec -$DOCKER_EXEC_FLAGS syncd ps_info "$@" diff --git a/platform/barefoot/sonic-platform-modules-bfn-montara/scripts/sensors b/platform/barefoot/sonic-platform-modules-bfn-montara/scripts/sensors index 07af6955321e..5f06a9c99b05 100755 --- a/platform/barefoot/sonic-platform-modules-bfn-montara/scripts/sensors +++ b/platform/barefoot/sonic-platform-modules-bfn-montara/scripts/sensors @@ -7,6 +7,5 @@ if [ -t 1 ] ; then DOCKER_EXEC_FLAGS+="t" fi -docker exec -$DOCKER_EXEC_FLAGS syncd sensors "$@" - - +python3 -m sonic_platform.bfn_extensions.platform_sensors "$@" +docker exec -$DOCKER_EXEC_FLAGS pmon sensors "$@" diff --git a/platform/barefoot/sonic-platform-modules-bfn-montara/scripts/test b/platform/barefoot/sonic-platform-modules-bfn-montara/scripts/test deleted file mode 100755 index 38327722c91f..000000000000 --- a/platform/barefoot/sonic-platform-modules-bfn-montara/scripts/test +++ /dev/null @@ -1 +0,0 @@ -echo "test" diff --git a/platform/barefoot/sonic-platform-modules-bfn-montara/setup.py b/platform/barefoot/sonic-platform-modules-bfn-montara/setup.py index fc14c94ac4a0..14e1bb6b6c02 100755 --- a/platform/barefoot/sonic-platform-modules-bfn-montara/setup.py +++ b/platform/barefoot/sonic-platform-modules-bfn-montara/setup.py @@ -12,7 +12,8 @@ maintainer_email='', packages=[ 'sonic_platform', - 'sonic_platform/pltfm_mgr_rpc' + 'sonic_platform/pltfm_mgr_rpc', + 'sonic_platform/bfn_extensions', ], package_data = {'sonic_platform':['logging.conf']}, classifiers=[ diff --git a/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/bfn_extensions/__init__.py b/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/bfn_extensions/__init__.py new file mode 100644 index 000000000000..67517a64e886 --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/bfn_extensions/__init__.py @@ -0,0 +1,4 @@ +__all__ = [ + 'platform_sensors', + 'platform_fancontrol', +] diff --git a/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/bfn_extensions/platform_fancontrol.py b/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/bfn_extensions/platform_fancontrol.py new file mode 100644 index 000000000000..43a700c21dcb --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/bfn_extensions/platform_fancontrol.py @@ -0,0 +1,59 @@ +import sys + +from sonic_platform.platform_thrift_client import thrift_try + +_MAX_FAN = 10 + +def fan_speed_set(fan, percent): + def set_fan_speed(client): + return client.pltfm_mgr.pltfm_mgr_fan_speed_set(fan, percent) + return thrift_try(set_fan_speed) + +def fan_speed_info_get(): + for fan_num in range(1, _MAX_FAN + 1): + def get_data(client, fan_num=fan_num): + return client.pltfm_mgr.pltfm_mgr_fan_info_get(fan_num) + fan_info = thrift_try(get_data) + if fan_info.fan_num == fan_num: + yield fan_info + +if __name__ == '__main__': + def print_usage(): + print("Usage: platform_fancontrol.py ", file=sys.stderr) + print(" function: fan_speed_set ", file=sys.stderr) + print(" fan_speed_info_get ", file=sys.stderr) + + argc = len(sys.argv) + if argc == 1: + print_usage() + exit(0) + + if sys.argv[1] == "fan_speed_set": + if argc != 4: + print_usage() + exit(0) + + fan = int(sys.argv[2]) + percent = int(sys.argv[3]) + + if (fan > _MAX_FAN) | (fan < 0): + print("Invalid value for fan #.\n", file=sys.stderr) + print_usage() + exit(0) + + if (percent > 100) | (percent < 0): + print("Invalid value for precent\n", file=sys.stderr) + print_usage() + exit(0) + + fan_speed_set(fan, percent) + exit(0) + + if sys.argv[1] == "fan_speed_info_get": + for fan_info in fan_speed_info_get(): + print("fan number: %d front rpm: %d rear rpm: %d percent: %d%% " % + (fan_info.fan_num, fan_info.front_rpm, fan_info.rear_rpm, fan_info.percent)) + + exit(0) + + print_usage() diff --git a/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/bfn_extensions/platform_sensors.py b/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/bfn_extensions/platform_sensors.py new file mode 100644 index 000000000000..b2ffe2e76d6e --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/bfn_extensions/platform_sensors.py @@ -0,0 +1,26 @@ +import sys +import codecs +from urllib.parse import quote + +from sonic_platform.platform_thrift_client import thrift_try + +def platform_sensors_get(args): + options = "" + if len(args)!=0: + options = quote(" ".join(args)) + def get_data(client): + return client.pltfm_mgr.pltfm_mgr_sensor_info_get(options) + raw_out = thrift_try(get_data) + raw_list = raw_out.split('\"') + if len(raw_list) >= 2: + sensors_out = raw_list[1] + sensors_out = codecs.decode(sensors_out, "unicode_escape") + return sensors_out + return None + +if __name__ == '__main__': + data = platform_sensors_get(sys.argv[1:]) + if data: + print(data) + else: + print("No sensors info available", file=sys.stderr) diff --git a/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/chassis.py b/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/chassis.py index 7a8ed2ca9449..319d29ef1727 100644 --- a/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/chassis.py +++ b/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/chassis.py @@ -1,9 +1,12 @@ #!/usr/bin/env python try: + import sys from sonic_platform_base.chassis_base import ChassisBase - from sonic_platform.sfp import Sfp - from sonic_platform.psu import Psu + from sonic_platform.sfp import Sfp, sfp_list_get + from sonic_platform.psu import psu_list_get + from sonic_platform.fan_drawer import fan_drawer_list_get + from sonic_platform.thermal import thermal_list_get from eeprom import Eeprom except ImportError as e: raise ImportError(str(e) + "- required module not found") @@ -15,15 +18,61 @@ class Chassis(ChassisBase): def __init__(self): ChassisBase.__init__(self) - self._eeprom = Eeprom() - - for index in range(Sfp.port_start(), Sfp.port_end() + 1): - sfp_node = Sfp(index) - self._sfp_list.append(sfp_node) - - for i in range(1, Psu.get_num_psus() + 1): - psu = Psu(i) - self._psu_list.append(psu) + self.__eeprom = None + self.__fan_drawers = None + self.__thermals = None + self.__psu_list = None + self.__sfp_list = None + + @property + def _eeprom(self): + if self.__eeprom is None: + self.__eeprom = Eeprom() + return self.__eeprom + + @_eeprom.setter + def _eeprom(self, value): + pass + + @property + def _fan_drawer_list(self): + if self.__fan_drawers is None: + self.__fan_drawers = fan_drawer_list_get() + return self.__fan_drawers + + @_fan_drawer_list.setter + def _fan_drawer_list(self, value): + pass + + @property + def _thermal_list(self): + if self.__thermals is None: + self.__thermals = thermal_list_get() + return self.__thermals + + @_thermal_list.setter + def _thermal_list(self, value): + pass + + @property + def _psu_list(self): + if self.__psu_list is None: + self.__psu_list = psu_list_get() + return self.__psu_list + + @_psu_list.setter + def _psu_list(self, value): + pass + + @property + def _sfp_list(self): + if self.__sfp_list is None: + self.__sfp_list = sfp_list_get() + return self.__sfp_list + + @_sfp_list.setter + def _sfp_list(self, value): + pass def get_name(self): """ @@ -55,7 +104,7 @@ def get_serial(self): Returns: string: Serial number of chassis """ - return self._eeprom.serial_str() + return self._eeprom.serial_number_str() def get_sfp(self, index): """ @@ -112,3 +161,16 @@ def get_system_eeprom_info(self): def get_change_event(self, timeout=0): ready, event_sfp = Sfp.get_transceiver_change_event(timeout) return ready, { 'sfp': event_sfp } if ready else {} + + def get_reboot_cause(self): + """ + Retrieves the cause of the previous reboot + + Returns: + A tuple (string, string) where the first element is a string + containing the cause of the previous reboot. This string must be + one of the predefined strings in this class. If the first string + is "REBOOT_CAUSE_HARDWARE_OTHER", the second string can be used + to pass a description of the reboot cause. + """ + return self.REBOOT_CAUSE_NON_HARDWARE, '' diff --git a/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/eeprom.py b/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/eeprom.py index e25d224c1e8b..587f57826fb5 100644 --- a/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/eeprom.py +++ b/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/eeprom.py @@ -6,6 +6,7 @@ import logging import logging.config import yaml + import re sys.path.append(os.path.dirname(__file__)) @@ -14,15 +15,15 @@ else: from cStringIO import StringIO - from sonic_eeprom import eeprom_base - from sonic_eeprom import eeprom_tlvinfo + from sonic_platform_base.sonic_eeprom import eeprom_base + from sonic_platform_base.sonic_eeprom import eeprom_tlvinfo - from .platform_thrift_client import thrift_try + from platform_thrift_client import thrift_try except ImportError as e: raise ImportError (str(e) + "- required module not found") -eeprom_default_dict = { +_platform_eeprom_map = { "prod_name" : ("Product Name", "0x21", 12), "odm_pcba_part_num" : ("Part Number", "0x22", 13), "prod_ser_num" : ("Serial Number", "0x23", 12), @@ -33,83 +34,62 @@ "sys_mfger" : ("Manufacturer", "0x2B", 8) } -eeprom_dict = { "version" : ("Version", None, 0), - "pcb_mfger" : ("PCB Manufacturer", "0x01", 8), - "prod_ser_num" : ("Serial Number", "0x23", 12), - "bfn_pcba_part_num" : ("Switch PCBA Part Number", "0x02", 12), - "odm_pcba_part_num" : ("Part Number", "0x22", 13), - "bfn_pcbb_part_num" : ("Switch PCBB Part Number", "0x04", 12), - "sys_asm_part_num" : ("System Assembly Part Number", "0x05", 12), - "prod_state" : ("Product Production State", "0x06", 1), - "location" : ("EEPROM Location of Fabric", "0x07", 8), - "ext_mac_addr_size" : ("Extende MAC Address Size", "0x08", 2), - "sys_mfg_date" : ("System Manufacturing Date", "0x25", 4), - "prod_name" : ("Product Name", "0x21", 12), - "prod_ver" : ("Product Version", "0x26", 1), - "prod_part_num" : ("Product Part Number", "0x09", 8), - "sys_mfger" : ("Manufacturer", "0x2B", 8), - "assembled_at" : ("Assembled at", "0x08", 8), - "prod_ast_tag" : ("Product Asset Tag", "0x09", 12), - "loc_mac_addr" : ("Local MAC address", "0x0A", 12), - "odm_pcba_ser_num" : ("ODM PBCA Serial Number", "0x0B", 12), - "ext_mac_addr" : ("Extended MAC Address Base", "0x0C", 12), - "prod_sub_ver" : ("Product Sub Version", "0x0D", 1) - } - -product_dict = { "Montara" : "Wedge100BF-32X-O-AC-F-BF", +_product_dict = { "Montara" : "Wedge100BF-32X-O-AC-F-BF", "Lower MAV" : "Wedge100BF-65X-O-AC-F-BF", "Upper MAV" : "Wedge100BF-65X-O-AC-F-BF" } -EEPROM_SYMLINK = "/var/run/platform/eeprom/syseeprom" -EEPROM_STATUS = "/var/run/platform/eeprom/status" +_EEPROM_SYMLINK = "/var/run/platform/eeprom/syseeprom" +_EEPROM_STATUS = "/var/run/platform/eeprom/status" + +try: + _str_type = basestring +except NameError: + _str_type = str class Eeprom(eeprom_tlvinfo.TlvInfoDecoder): def __init__(self): - with open(os.path.dirname(__file__) + "/logging.conf", 'r') as f: config_dict = yaml.load(f, yaml.SafeLoader) logging.config.dictConfig(config_dict) - if not os.path.exists(os.path.dirname(EEPROM_SYMLINK)): + if not os.path.exists(os.path.dirname(_EEPROM_SYMLINK)): try: - os.makedirs(os.path.dirname(EEPROM_SYMLINK)) + os.makedirs(os.path.dirname(_EEPROM_SYMLINK)) except OSError as e: if e.errno != errno.EEXIST: raise - open(EEPROM_SYMLINK, 'a').close() - f = open(EEPROM_STATUS, 'w') - f.write("initializing..") - f.close() + open(_EEPROM_SYMLINK, 'a').close() + with open(_EEPROM_STATUS, 'w') as f: + f.write("initializing..") - self.eeprom_path = EEPROM_SYMLINK - super(Eeprom, self).__init__(self.eeprom_path, 0, EEPROM_STATUS, True) + self.eeprom_path = _EEPROM_SYMLINK + super(Eeprom, self).__init__(self.eeprom_path, 0, _EEPROM_STATUS, True) def sys_eeprom_get(client): return client.pltfm_mgr.pltfm_mgr_sys_eeprom_get() try: - self.eeprom = thrift_try(sys_eeprom_get) + platform_eeprom = thrift_try(sys_eeprom_get) except Exception: raise RuntimeError("eeprom.py: Initialization failed") - self.eeprom_parse() + self.__eeprom_init(platform_eeprom) - def eeprom_parse(self): - f = open(EEPROM_STATUS, 'w') - f.write("ok") - f.close() + def __eeprom_init(self, platform_eeprom): + with open(_EEPROM_STATUS, 'w') as f: + f.write("ok") eeprom_params = "" - for attr, val in self.eeprom.__dict__.iteritems(): + for attr, val in platform_eeprom.__dict__.items(): if val is None: continue - elem = eeprom_default_dict.get(attr) + elem = _platform_eeprom_map.get(attr) if elem is None: continue - if isinstance(val, basestring): + if isinstance(val, _str_type): value = val.replace('\0', '') else: value = str(val) @@ -117,7 +97,7 @@ def eeprom_parse(self): if attr == "sys_mfg_date": value = datetime.datetime.strptime(value, '%m-%d-%y').strftime('%m/%d/%Y 00:00:00') - product = product_dict.get(value) + product = _product_dict.get(value) if product is not None: value = product if len(eeprom_params) > 0: @@ -125,25 +105,51 @@ def eeprom_parse(self): eeprom_params += "{0:s}={1:s}".format(elem[1], value) orig_stdout = sys.stdout - sys.stdout = StringIO() try: - new_e = eeprom_tlvinfo.TlvInfoDecoder.set_eeprom(self, "", [eeprom_params]) + eeprom_data = eeprom_tlvinfo.TlvInfoDecoder.set_eeprom(self, "", [eeprom_params]) finally: + decode_output = sys.stdout.getvalue() sys.stdout = orig_stdout - eeprom_base.EepromDecoder.write_eeprom(self, new_e) + eeprom_base.EepromDecoder.write_eeprom(self, eeprom_data) + self.__eeprom_tlv_dict = self.__parse_output(decode_output) - return True + def __parse_output(self, decode_output): + EEPROM_DECODE_HEADLINES = 6 + lines = decode_output.replace('\0', '').split('\n') + lines = lines[EEPROM_DECODE_HEADLINES:] + res = dict() - def serial_number_str(self): - return self.eeprom.prod_ser_num + for line in lines: + try: + # match whitespace-separated tag hex, length and value (value is mathced with its whitespaces) + match = re.search('(0x[0-9a-fA-F]{2})([\s]+[\S]+[\s]+)([\S]+[\s]*[\S]*)', line) + if match is not None: + code = match.group(1) + value = match.group(3).rstrip('\0') + res[code] = value + except Exception: + pass + return res + + def __tlv_get(self, code): + return self.__eeprom_tlv_dict.get("0x{:X}".format(code), 'N/A') def system_eeprom_info(self): - return self.eeprom.__dict__ + return self.__eeprom_tlv_dict + + def serial_number_str(self): + return self.__tlv_get(self._TLV_CODE_SERIAL_NUMBER) - def get_base_mac(self): - return self.eeprom.ext_mac_addr + def serial_str(self): + return self.serial_number_str() + + def base_mac_addr(self): + return self.__tlv_get(self._TLV_CODE_MAC_BASE) def part_number_str(self): - return self.eeprom.prod_part_num + return self.__tlv_get(self._TLV_CODE_PART_NUMBER) + + def modelstr(self): + return self.__tlv_get(self._TLV_CODE_PRODUCT_NAME) diff --git a/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/fan_drawer.py b/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/fan_drawer.py new file mode 100644 index 000000000000..b30ea24e0e41 --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/fan_drawer.py @@ -0,0 +1,77 @@ +try: + from sonic_platform.platform_thrift_client import thrift_try + from sonic_platform_base.fan_drawer_base import FanDrawerBase + from sonic_platform_base.fan_base import FanBase +except ImportError as e: + raise ImportError (str(e) + "- required module not found") + +_MAX_FAN = 10 + +def _fan_info_get(fan_num, cb, default=None): + def get_data(client): + return client.pltfm_mgr.pltfm_mgr_fan_info_get(fan_num) + fan_info = thrift_try(get_data) + if fan_num == fan_info.fan_num: + return cb(fan_info) + if default is None: + raise LookupError + return default + +def _fan_info_get_all(): + for fan_num in range(1, _MAX_FAN + 1): + def get_data(client, fan_num=fan_num): + return client.pltfm_mgr.pltfm_mgr_fan_info_get(fan_num) + fan_info = thrift_try(get_data) + if fan_info.fan_num == fan_num: + yield fan_info + +# Fan -> FanBase -> DeviceBase +class Fan(FanBase): + def __init__(self, num): + self.__num = num + + # FanBase interface methods: + # returns speed in percents + def get_speed(self): + def cb(info): return info.percent + return _fan_info_get(self.__num, cb, 0) + + def set_speed(self, percent): + def set_fan_speed(client): + return client.pltfm_mgr.pltfm_mgr_fan_speed_set(self.__num, percent) + return thrift_try(set_fan_speed) + + # DeviceBase interface methods: + def get_name(self): + return f"counter-rotating-fan-{self.__num}" + + def get_presence(self): + return _fan_info_get(self.__num, lambda _: True, False) + + def get_position_in_parent(self): + return self.__num + + def is_replaceable(self): + return True + + def get_status(self): + return True + +# FanDrawer -> FanDrawerBase -> DeviceBase +class FanDrawer(FanDrawerBase): + def __init__(self): + # For now we return only present fans + self._fan_list = [Fan(i.fan_num) for i in _fan_info_get_all()] + + # DeviceBase interface methods: + def get_name(self): + return 'fantray' + + def get_presence(self): + return True + + def get_status(self): + return True + +def fan_drawer_list_get(): + return [FanDrawer()] diff --git a/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/psu.py b/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/psu.py index 7e7e4403ad5c..e5f245d53074 100644 --- a/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/psu.py +++ b/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/psu.py @@ -17,7 +17,21 @@ class Psu(PsuBase): def __init__(self, index): PsuBase.__init__(self) - self.index = index + self.__index = index + + ''' + Units of returned info object values: + vin - V + iout - mA + vout - V + pwr_out - mW + fspeed - RPM + ''' + def __info_get(self): + def psu_info_get(client): + return client.pltfm_mgr.pltfm_mgr_pwr_supply_info_get(self.__index) + + return thrift_try(psu_info_get) @staticmethod def get_num_psus(): @@ -34,15 +48,36 @@ def get_powergood_status(self): :param self.index: An integer, 1-based self.index of the PSU of which to query status :return: Boolean, True if PSU is operating properly, False if PSU is faulty """ - def psu_info_get(client): - return client.pltfm_mgr.pltfm_mgr_pwr_supply_info_get(self.index) + info = self.__info_get() + return info.ffault == False and info.vout != 0 + + def get_voltage(self): + """ + Retrieves current PSU voltage output - try: - psu_info = thrift_try(psu_info_get) - except Exception: - return False + Returns: + A float number, the output voltage in volts, + e.g. 12.1 + """ + return float(self.__info_get().vout) - return (psu_info.ffault == False) + def get_current(self): + """ + Retrieves present electric current supplied by PSU + + Returns: + A float number, the electric current in amperes, e.g 15.4 + """ + return self.__info_get().iout / 1000. + + def get_power(self): + """ + Retrieves current energy supplied by PSU + + Returns: + A float number, the power in watts, e.g. 302.6 + """ + return self.__info_get().pwr_out / 1000. def get_presence(self): """ @@ -52,11 +87,24 @@ def get_presence(self): :return: Boolean, True if PSU is plugged, False if not """ def psu_present_get(client): - return client.pltfm_mgr.pltfm_mgr_pwr_supply_present_get(self.index) - - try: - status = thrift_try(psu_present_get) - except Exception: - return False + return client.pltfm_mgr.pltfm_mgr_pwr_supply_present_get(self.__index) + status = thrift_try(psu_present_get) return status + + # DeviceBase iface: + def get_serial(self): + return self.__info_get().serial + + def get_model(self): + return self.__info_get().model + + def is_replaceable(self): + return True + +def psu_list_get(): + psu_list = [] + for i in range(1, Psu.get_num_psus() + 1): + psu = Psu(i) + psu_list.append(psu) + return psu_list diff --git a/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/sfp.py b/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/sfp.py index dc57dbcd9040..640b1c41948c 100644 --- a/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/sfp.py +++ b/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/sfp.py @@ -4,7 +4,10 @@ import os import sys import time - import errno + + import tempfile + from contextlib import contextmanager + from copy import copy sys.path.append(os.path.dirname(__file__)) @@ -16,8 +19,6 @@ except ImportError as e: raise ImportError (str(e) + "- required module not found") -SFP_EEPROM_CACHE = "/var/run/platform/sfp/cache" - class SfpUtil(SfpUtilBase): """Platform-specific SfpUtil class""" @@ -46,7 +47,7 @@ def qsfp_ports(self): @property def port_to_eeprom_mapping(self): - print "dependency on sysfs has been removed" + print("dependency on sysfs has been removed") raise Exception() def __init__(self): @@ -55,15 +56,6 @@ def __init__(self): self.phy_port_cur_state = {} self.qsfp_interval = self.QSFP_CHECK_INTERVAL - if not os.path.exists(os.path.dirname(SFP_EEPROM_CACHE)): - try: - os.makedirs(os.path.dirname(SFP_EEPROM_CACHE)) - except OSError as e: - if e.errno != errno.EEXIST: - raise - - open(SFP_EEPROM_CACHE, 'ab').close() - SfpUtilBase.__init__(self) def update_port_info(self): @@ -88,8 +80,8 @@ def qsfp_presence_get(client): try: presence = thrift_try(qsfp_presence_get) except Exception as e: - print e.__doc__ - print e.message + print( e.__doc__) + print(e.message) return presence @@ -126,9 +118,9 @@ def qsfp_reset(client): client.pltfm_mgr.pltfm_mgr_qsfp_reset(port_num, True) return client.pltfm_mgr.pltfm_mgr_qsfp_reset(port_num, False) - status = thrift_try(qsfp_reset) + err = thrift_try(qsfp_reset) - return status + return not err def check_transceiver_change(self): if not self.ready: @@ -167,7 +159,7 @@ def get_transceiver_change_event(self, timeout=0): elif timeout > 0: timeout = timeout / float(1000) # Convert to secs else: - print "get_transceiver_change_event:Invalid timeout value", timeout + print("get_transceiver_change_event:Invalid timeout value", timeout) return False, {} while forever or timeout > 0: @@ -200,21 +192,28 @@ def get_transceiver_change_event(self, timeout=0): return self.ready, self.phy_port_dict - def _get_port_eeprom_path(self, port_num, devid): - eeprom_path = None + @contextmanager + def eeprom_action(self): + u = copy(self) + with tempfile.NamedTemporaryFile() as f: + u.eeprom_path = f.name + yield u + + def _sfp_eeprom_present(self, client_eeprompath, offset): + return client_eeprompath and super(SfpUtil, self)._sfp_eeprom_present(client_eeprompath, offset) + def _get_port_eeprom_path(self, port_num, devid): def qsfp_info_get(client): return client.pltfm_mgr.pltfm_mgr_qsfp_info_get(port_num) if self.get_presence(port_num): eeprom_hex = thrift_try(qsfp_info_get) - eeprom_cache = open(SFP_EEPROM_CACHE, 'wb') eeprom_raw = bytearray.fromhex(eeprom_hex) - eeprom_cache.write(eeprom_raw) - eeprom_cache.close() - eeprom_path = SFP_EEPROM_CACHE + with open(self.eeprom_path, 'wb') as eeprom_cache: + eeprom_cache.write(eeprom_raw) + return self.eeprom_path - return eeprom_path + return None class Sfp(SfpBase): """Platform-specific Sfp class""" @@ -242,25 +241,38 @@ def __init__(self, port_num): SfpBase.__init__(self) def get_presence(self): - return Sfp.sfputil.get_presence(self.port_num) + with Sfp.sfputil.eeprom_action() as u: + return u.get_presence(self.port_num) def get_lpmode(self): - return Sfp.sfputil.get_low_power_mode(self.port_num) + with Sfp.sfputil.eeprom_action() as u: + return u.get_low_power_mode(self.port_num) def set_lpmode(self, lpmode): - return Sfp.sfputil.set_low_power_mode(self.port_num, lpmode) + with Sfp.sfputil.eeprom_action() as u: + return u.set_low_power_mode(self.port_num, lpmode) def reset(self): return Sfp.sfputil.reset(self.port_num) def get_transceiver_info(self): - return Sfp.sfputil.get_transceiver_info_dict(self.port_num) + with Sfp.sfputil.eeprom_action() as u: + return u.get_transceiver_info_dict(self.port_num) def get_transceiver_bulk_status(self): - return Sfp.sfputil.get_transceiver_dom_info_dict(self.port_num) + with Sfp.sfputil.eeprom_action() as u: + return u.get_transceiver_dom_info_dict(self.port_num) def get_transceiver_threshold_info(self): - return Sfp.sfputil.get_transceiver_dom_threshold_info_dict(self.port_num) + with Sfp.sfputil.eeprom_action() as u: + return u.get_transceiver_dom_threshold_info_dict(self.port_num) def get_change_event(self, timeout=0): return Sfp.get_transceiver_change_event(timeout) + +def sfp_list_get(): + sfp_list = [] + for index in range(Sfp.port_start(), Sfp.port_end() + 1): + sfp_node = Sfp(index) + sfp_list.append(sfp_node) + return sfp_list diff --git a/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/thermal.py b/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/thermal.py new file mode 100644 index 000000000000..3a39c10a1e1f --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-bfn-montara/sonic_platform/thermal.py @@ -0,0 +1,109 @@ +try: + import subprocess + + from sonic_platform.bfn_extensions.platform_sensors import platform_sensors_get + from sonic_platform_base.thermal_base import ThermalBase +except ImportError as e: + raise ImportError (str(e) + "- required module not found") + +''' +data argument is in "sensors -A -u" format, example: +coretemp-isa-0000 +Package id 0: + temp1_input: 37.000 + temp1_max: 82.000 + temp1_crit: 104.000 + temp1_crit_alarm: 0.000 +Core 0: + temp2_input: 37.000 + ... +''' +def _sensors_chip_parsed(data: str): + def kv(line): + k, v, *_ = [t.strip(': ') for t in line.split(':') if t] + [''] + return k, v + + chip, *data = data.strip().split('\n') + chip = chip.strip(': ') + + sensors = [] + for line in data: + if not line.startswith(' '): + sensor_label = line.strip(': ') + sensors.append((sensor_label, {})) + continue + + if len(sensors) == 0: + raise RuntimeError(f'invalid data to parse: {data}') + + attr, value = kv(line) + sensor_label, sensor_data = sensors[-1] + sensor_data.update({attr: value}) + + return chip, dict(sensors) + +''' +Example of returned dict: +{ + 'coretemp-isa-0000': { + 'Core 1': { "temp1_input": 40, ... }, + 'Core 2': { ... } + } +} +''' +def _sensors_get() -> dict: + data = platform_sensors_get(['-A', '-u']) or '' + data += subprocess.check_output("/usr/bin/sensors -A -u", + shell=True, text=True) + data = data.split('\n\n') + data = [_sensors_chip_parsed(chip_data) for chip_data in data if chip_data] + data = dict(data) + return data + +def _value_get(d: dict, key_prefix, key_suffix=''): + for k, v in d.items(): + if k.startswith(key_prefix) and k.endswith(key_suffix): + return v + return None + +# Thermal -> ThermalBase -> DeviceBase +class Thermal(ThermalBase): + def __init__(self, chip, label): + self.__chip = chip + self.__label = label + self.__name = f"{chip}:{label}".lower().replace(' ', '-') + + def __get(self, attr_prefix, attr_suffix): + sensor_data = _sensors_get().get(self.__chip, {}).get(self.__label, {}) + value = _value_get(sensor_data, attr_prefix, attr_suffix) + if value is not None: return value + raise NotImplementedError + + # ThermalBase interface methods: + def get_temperature(self) -> float: + return float(self.__get('temp', 'input')) + + def get_high_threshold(self) -> float: + return float(self.__get('temp', 'max')) + + def get_high_critical_threshold(self) -> float: + return float(self.__get('temp', 'crit')) + + # DeviceBase interface methods: + def get_name(self): + return self.__name + + def get_presence(self): + return True + + def get_status(self): + return True + +def thermal_list_get(): + l = [] + for chip, chip_data in _sensors_get().items(): + for sensor, sensor_data in chip_data.items(): + # add only temperature sensors + if _value_get(sensor_data, "temp") is not None: + l.append(Thermal(chip, sensor)) + return l diff --git a/platform/barefoot/sonic-platform-modules-bfn-newport/configs/network/interfaces.d/eth2 b/platform/barefoot/sonic-platform-modules-bfn-newport/configs/network/interfaces.d/eth2 index 725bc89e0ebb..aded25af63b7 100644 --- a/platform/barefoot/sonic-platform-modules-bfn-newport/configs/network/interfaces.d/eth2 +++ b/platform/barefoot/sonic-platform-modules-bfn-newport/configs/network/interfaces.d/eth2 @@ -1,4 +1,4 @@ # eth cpu port auto eth2 iface eth2 inet -up ifconfig eth2 promisc mtu 9000 +up ifconfig eth2 promisc mtu 9216 diff --git a/platform/barefoot/sonic-platform-modules-bfn-newport/debian/control b/platform/barefoot/sonic-platform-modules-bfn-newport/debian/control index 89135fda2478..d2c37fe8d2b9 100644 --- a/platform/barefoot/sonic-platform-modules-bfn-newport/debian/control +++ b/platform/barefoot/sonic-platform-modules-bfn-newport/debian/control @@ -7,11 +7,11 @@ Standards-Version: 3.9.3 Package: sonic-platform-modules-bfn-newport-as9516 Architecture: amd64 -Depends: linux-image-4.19.0-9-2-amd64-unsigned +Depends: linux-image-4.19.0-12-2-amd64-unsigned Description: kernel module for bfn platform fpga and scripts for the devices such as fan, led, sfp Package: sonic-platform-modules-bfn-newport-as9516bf Architecture: amd64 -Depends: linux-image-4.19.0-9-2-amd64-unsigned +Depends: linux-image-4.19.0-12-2-amd64-unsigned Description: kernel module for bfn platform fpga and scripts for the devices such as fan, led, sfp diff --git a/platform/barefoot/sonic-platform-modules-bfn-newport/debian/postinst b/platform/barefoot/sonic-platform-modules-bfn-newport/debian/postinst deleted file mode 100644 index a89ac4f4f5b2..000000000000 --- a/platform/barefoot/sonic-platform-modules-bfn-newport/debian/postinst +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -set -e -depmod -a -systemctl enable bfn-newport.service -systemctl start bfn-newport.service -#DEBHELPER# diff --git a/platform/barefoot/sonic-platform-modules-bfn-newport/debian/rules b/platform/barefoot/sonic-platform-modules-bfn-newport/debian/rules index 962a1de8204e..da70905cb239 100755 --- a/platform/barefoot/sonic-platform-modules-bfn-newport/debian/rules +++ b/platform/barefoot/sonic-platform-modules-bfn-newport/debian/rules @@ -10,7 +10,6 @@ SCRIPT_SRC := $(shell pwd)/scripts CONFIGS_SRC := $(shell pwd)/configs BUILD_DIR := $(shell pwd)/build WHEEL_BUILD_DIR := $(BUILD_DIR)/wheel -PLUGINS_DIR := $(shell pwd)/plugins MODULE_NAMES := as9516 as9516bf %: @@ -33,8 +32,6 @@ override_dh_auto_install: cp -r $(CONFIGS_SRC)/network/interfaces.d/* debian/$(PACKAGE_PRE_NAME)-$${mod}/etc/network/interfaces.d/; \ dh_installdirs -p$(PACKAGE_PRE_NAME)-$${mod} usr/share/sonic/device/x86_64-accton_$${mod}_32d-r0/; \ cp -r $(WHEEL_BUILD_DIR)/* debian/$(PACKAGE_PRE_NAME)-$${mod}/usr/share/sonic/device/x86_64-accton_$${mod}_32d-r0/; \ - dh_installdirs -p$(PACKAGE_PRE_NAME)-$${mod} usr/share/sonic/device/x86_64-accton_$${mod}_32d-r0/plugins; \ - cp -r $(PLUGINS_DIR)/* debian/$(PACKAGE_PRE_NAME)-$${mod}/usr/share/sonic/device/x86_64-accton_$${mod}_32d-r0/plugins/; \ done) override_dh_usrlocal: diff --git a/platform/barefoot/sonic-platform-modules-bfn-newport/debian/sonic-platform-modules-bfn-newport-as9516.postinst b/platform/barefoot/sonic-platform-modules-bfn-newport/debian/sonic-platform-modules-bfn-newport-as9516.postinst new file mode 100644 index 000000000000..94dbd584f1b2 --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-bfn-newport/debian/sonic-platform-modules-bfn-newport-as9516.postinst @@ -0,0 +1,13 @@ +#!/bin/sh +set -e +depmod -a +systemctl enable bfn-newport.service +systemctl start bfn-newport.service + +PLATFORM_NAME=x86_64-accton_as9516_32d-r0 +SONIC_PLATFORM_WHEEL_PY2="/usr/share/sonic/device/${PLATFORM_NAME}/sonic_platform-1.0-py2-none-any.whl" +python2 -m pip install ${SONIC_PLATFORM_WHEEL_PY2} +SONIC_PLATFORM_WHEEL_PY3="/usr/share/sonic/device/${PLATFORM_NAME}/sonic_platform-1.0-py3-none-any.whl" +python3 -m pip install ${SONIC_PLATFORM_WHEEL_PY3} + +#DEBHELPER# diff --git a/platform/barefoot/sonic-platform-modules-bfn-newport/debian/sonic-platform-modules-bfn-newport-as9516.prerm b/platform/barefoot/sonic-platform-modules-bfn-newport/debian/sonic-platform-modules-bfn-newport-as9516.prerm new file mode 100644 index 000000000000..ee19dbb1db98 --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-bfn-newport/debian/sonic-platform-modules-bfn-newport-as9516.prerm @@ -0,0 +1,6 @@ +#!/bin/sh + +python2 -m pip uninstall -y sonic-platform +python3 -m pip uninstall -y sonic-platform + +#DEBHELPER# diff --git a/platform/barefoot/sonic-platform-modules-bfn-newport/debian/sonic-platform-modules-bfn-newport-as9516bf.postinst b/platform/barefoot/sonic-platform-modules-bfn-newport/debian/sonic-platform-modules-bfn-newport-as9516bf.postinst new file mode 100644 index 000000000000..87ca2f5de64b --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-bfn-newport/debian/sonic-platform-modules-bfn-newport-as9516bf.postinst @@ -0,0 +1,13 @@ +#!/bin/sh +set -e +depmod -a +systemctl enable bfn-newport.service +systemctl start bfn-newport.service + +PLATFORM_NAME=x86_64-accton_as9516bf_32d-r0 +SONIC_PLATFORM_WHEEL_PY2="/usr/share/sonic/device/${PLATFORM_NAME}/sonic_platform-1.0-py2-none-any.whl" +python2 -m pip install ${SONIC_PLATFORM_WHEEL_PY2} +SONIC_PLATFORM_WHEEL_PY3="/usr/share/sonic/device/${PLATFORM_NAME}/sonic_platform-1.0-py3-none-any.whl" +python3 -m pip install ${SONIC_PLATFORM_WHEEL_PY3} + +#DEBHELPER# diff --git a/platform/barefoot/sonic-platform-modules-bfn-newport/debian/sonic-platform-modules-bfn-newport-as9516bf.prerm b/platform/barefoot/sonic-platform-modules-bfn-newport/debian/sonic-platform-modules-bfn-newport-as9516bf.prerm new file mode 100644 index 000000000000..ee19dbb1db98 --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-bfn-newport/debian/sonic-platform-modules-bfn-newport-as9516bf.prerm @@ -0,0 +1,6 @@ +#!/bin/sh + +python2 -m pip uninstall -y sonic-platform +python3 -m pip uninstall -y sonic-platform + +#DEBHELPER# diff --git a/platform/barefoot/sonic-platform-modules-bfn-newport/scripts b/platform/barefoot/sonic-platform-modules-bfn-newport/scripts new file mode 120000 index 000000000000..14008f061862 --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-bfn-newport/scripts @@ -0,0 +1 @@ +../sonic-platform-modules-bfn-montara/scripts \ No newline at end of file diff --git a/platform/barefoot/sonic-platform-modules-bfn-newport/scripts/bf-sfputil b/platform/barefoot/sonic-platform-modules-bfn-newport/scripts/bf-sfputil deleted file mode 100755 index 3df67614e499..000000000000 --- a/platform/barefoot/sonic-platform-modules-bfn-newport/scripts/bf-sfputil +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -DOCKER_EXEC_FLAGS="i" - -# Determine whether stdout is on a terminal -if [ -t 1 ] ; then - DOCKER_EXEC_FLAGS+="t" -fi - -docker exec -$DOCKER_EXEC_FLAGS syncd sfputil "$@" diff --git a/platform/barefoot/sonic-platform-modules-bfn-newport/scripts/eeprom b/platform/barefoot/sonic-platform-modules-bfn-newport/scripts/eeprom deleted file mode 100755 index 07d98556cbbf..000000000000 --- a/platform/barefoot/sonic-platform-modules-bfn-newport/scripts/eeprom +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -DOCKER_EXEC_FLAGS="i" - -# Determine whether stdout is on a terminal -if [ -t 1 ] ; then - DOCKER_EXEC_FLAGS+="t" -fi - -docker exec -$DOCKER_EXEC_FLAGS syncd eeprom "$@" diff --git a/platform/barefoot/sonic-platform-modules-bfn-newport/scripts/fancontrol b/platform/barefoot/sonic-platform-modules-bfn-newport/scripts/fancontrol deleted file mode 100755 index 515fcbdd69da..000000000000 --- a/platform/barefoot/sonic-platform-modules-bfn-newport/scripts/fancontrol +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -DOCKER_EXEC_FLAGS="i" - -# Determine whether stdout is on a terminal -if [ -t 1 ] ; then - DOCKER_EXEC_FLAGS+="t" -fi - -docker exec -$DOCKER_EXEC_FLAGS syncd fancontrol "$@" - diff --git a/platform/barefoot/sonic-platform-modules-bfn-newport/scripts/ps_info b/platform/barefoot/sonic-platform-modules-bfn-newport/scripts/ps_info deleted file mode 100755 index 38c9d3330414..000000000000 --- a/platform/barefoot/sonic-platform-modules-bfn-newport/scripts/ps_info +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -DOCKER_EXEC_FLAGS="i" - -# Determine whether stdout is on a terminal -if [ -t 1 ] ; then - DOCKER_EXEC_FLAGS+="t" -fi - -docker exec -$DOCKER_EXEC_FLAGS syncd ps_info "$@" diff --git a/platform/barefoot/sonic-platform-modules-bfn-newport/scripts/sensors b/platform/barefoot/sonic-platform-modules-bfn-newport/scripts/sensors deleted file mode 100755 index 07af6955321e..000000000000 --- a/platform/barefoot/sonic-platform-modules-bfn-newport/scripts/sensors +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -DOCKER_EXEC_FLAGS="i" - -# Determine whether stdout is on a terminal -if [ -t 1 ] ; then - DOCKER_EXEC_FLAGS+="t" -fi - -docker exec -$DOCKER_EXEC_FLAGS syncd sensors "$@" - - diff --git a/platform/barefoot/sonic-platform-modules-bfn-newport/scripts/test b/platform/barefoot/sonic-platform-modules-bfn-newport/scripts/test deleted file mode 100755 index 38327722c91f..000000000000 --- a/platform/barefoot/sonic-platform-modules-bfn-newport/scripts/test +++ /dev/null @@ -1 +0,0 @@ -echo "test" diff --git a/platform/barefoot/sonic-platform-modules-bfn/debian/control b/platform/barefoot/sonic-platform-modules-bfn/debian/control index e5ce77ba7120..89c597303a78 100644 --- a/platform/barefoot/sonic-platform-modules-bfn/debian/control +++ b/platform/barefoot/sonic-platform-modules-bfn/debian/control @@ -7,6 +7,6 @@ Standards-Version: 3.9.3 Package: sonic-platform-modules-bfn Architecture: amd64 -Depends: linux-image-4.19.0-9-2-amd64-unsigned +Depends: linux-image-4.19.0-12-2-amd64-unsigned Description: kernel modules for platform devices such as fan, led, sfp diff --git a/platform/barefoot/sonic-platform-modules-bfn/debian/postinst b/platform/barefoot/sonic-platform-modules-bfn/debian/postinst new file mode 100644 index 000000000000..bd24c078778a --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-bfn/debian/postinst @@ -0,0 +1,10 @@ +#!/bin/sh +set -e + +PLATFORM_NAME=x86_64-accton_wedge100bf_65x-r0 +SONIC_PLATFORM_WHEEL_PY2="/usr/share/sonic/device/${PLATFORM_NAME}/sonic_platform-1.0-py2-none-any.whl" +python2 -m pip install ${SONIC_PLATFORM_WHEEL_PY2} +SONIC_PLATFORM_WHEEL_PY3="/usr/share/sonic/device/${PLATFORM_NAME}/sonic_platform-1.0-py3-none-any.whl" +python3 -m pip install ${SONIC_PLATFORM_WHEEL_PY3} + +#DEBHELPER# diff --git a/platform/barefoot/sonic-platform-modules-bfn/debian/prerm b/platform/barefoot/sonic-platform-modules-bfn/debian/prerm new file mode 100755 index 000000000000..ee19dbb1db98 --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-bfn/debian/prerm @@ -0,0 +1,6 @@ +#!/bin/sh + +python2 -m pip uninstall -y sonic-platform +python3 -m pip uninstall -y sonic-platform + +#DEBHELPER# diff --git a/platform/barefoot/sonic-platform-modules-bfn/debian/rules b/platform/barefoot/sonic-platform-modules-bfn/debian/rules index 37e264ad7ed8..0ee3dcfaf0e2 100755 --- a/platform/barefoot/sonic-platform-modules-bfn/debian/rules +++ b/platform/barefoot/sonic-platform-modules-bfn/debian/rules @@ -1,5 +1,6 @@ #!/usr/bin/make -f +PLATFORM_NAME := x86_64-accton_wedge100bf_65x-r0 PACKAGE_NAME := sonic-platform-modules-bfn SCRIPT_SRC := $(shell pwd)/scripts CONFIGS_SRC := $(shell pwd)/configs @@ -20,6 +21,8 @@ override_dh_auto_install: cp -r $(SCRIPT_SRC)/* debian/$(PACKAGE_NAME)/usr/local/bin dh_installdirs -p$(PACKAGE_NAME) etc/network/interfaces.d/ cp -r $(CONFIGS_SRC)/network/interfaces.d/* debian/$(PACKAGE_NAME)/etc/network/interfaces.d/ + dh_installdirs -p$(PACKAGE_NAME) usr/share/sonic/device/$(PLATFORM_NAME)/ + cp -r $(WHEEL_BUILD_DIR)/* debian/$(PACKAGE_NAME)/usr/share/sonic/device/$(PLATFORM_NAME)/ override_dh_usrlocal: diff --git a/platform/barefoot/sonic-platform-modules-bfn/scripts b/platform/barefoot/sonic-platform-modules-bfn/scripts new file mode 120000 index 000000000000..14008f061862 --- /dev/null +++ b/platform/barefoot/sonic-platform-modules-bfn/scripts @@ -0,0 +1 @@ +../sonic-platform-modules-bfn-montara/scripts \ No newline at end of file diff --git a/platform/barefoot/sonic-platform-modules-bfn/scripts/bf-sfputil b/platform/barefoot/sonic-platform-modules-bfn/scripts/bf-sfputil deleted file mode 100755 index 3df67614e499..000000000000 --- a/platform/barefoot/sonic-platform-modules-bfn/scripts/bf-sfputil +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -DOCKER_EXEC_FLAGS="i" - -# Determine whether stdout is on a terminal -if [ -t 1 ] ; then - DOCKER_EXEC_FLAGS+="t" -fi - -docker exec -$DOCKER_EXEC_FLAGS syncd sfputil "$@" diff --git a/platform/barefoot/sonic-platform-modules-bfn/scripts/eeprom b/platform/barefoot/sonic-platform-modules-bfn/scripts/eeprom deleted file mode 100755 index 07d98556cbbf..000000000000 --- a/platform/barefoot/sonic-platform-modules-bfn/scripts/eeprom +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -DOCKER_EXEC_FLAGS="i" - -# Determine whether stdout is on a terminal -if [ -t 1 ] ; then - DOCKER_EXEC_FLAGS+="t" -fi - -docker exec -$DOCKER_EXEC_FLAGS syncd eeprom "$@" diff --git a/platform/barefoot/sonic-platform-modules-bfn/scripts/fancontrol b/platform/barefoot/sonic-platform-modules-bfn/scripts/fancontrol deleted file mode 100755 index 515fcbdd69da..000000000000 --- a/platform/barefoot/sonic-platform-modules-bfn/scripts/fancontrol +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -DOCKER_EXEC_FLAGS="i" - -# Determine whether stdout is on a terminal -if [ -t 1 ] ; then - DOCKER_EXEC_FLAGS+="t" -fi - -docker exec -$DOCKER_EXEC_FLAGS syncd fancontrol "$@" - diff --git a/platform/barefoot/sonic-platform-modules-bfn/scripts/ps_info b/platform/barefoot/sonic-platform-modules-bfn/scripts/ps_info deleted file mode 100755 index 38c9d3330414..000000000000 --- a/platform/barefoot/sonic-platform-modules-bfn/scripts/ps_info +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -DOCKER_EXEC_FLAGS="i" - -# Determine whether stdout is on a terminal -if [ -t 1 ] ; then - DOCKER_EXEC_FLAGS+="t" -fi - -docker exec -$DOCKER_EXEC_FLAGS syncd ps_info "$@" diff --git a/platform/barefoot/sonic-platform-modules-bfn/scripts/sensors b/platform/barefoot/sonic-platform-modules-bfn/scripts/sensors deleted file mode 100755 index 07af6955321e..000000000000 --- a/platform/barefoot/sonic-platform-modules-bfn/scripts/sensors +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -DOCKER_EXEC_FLAGS="i" - -# Determine whether stdout is on a terminal -if [ -t 1 ] ; then - DOCKER_EXEC_FLAGS+="t" -fi - -docker exec -$DOCKER_EXEC_FLAGS syncd sensors "$@" - - diff --git a/platform/barefoot/sonic-platform-modules-bfn/scripts/test b/platform/barefoot/sonic-platform-modules-bfn/scripts/test deleted file mode 100755 index 38327722c91f..000000000000 --- a/platform/barefoot/sonic-platform-modules-bfn/scripts/test +++ /dev/null @@ -1 +0,0 @@ -echo "test" diff --git a/platform/barefoot/sonic-platform-modules-wnc-osw1800/debian/control b/platform/barefoot/sonic-platform-modules-wnc-osw1800/debian/control index 6f7bd62ffcc2..eab1adcadecd 100644 --- a/platform/barefoot/sonic-platform-modules-wnc-osw1800/debian/control +++ b/platform/barefoot/sonic-platform-modules-wnc-osw1800/debian/control @@ -7,6 +7,6 @@ Standards-Version: 3.9.3 Package: platform-modules-wnc-osw1800 Architecture: amd64 -Depends: linux-image-4.19.0-9-2-amd64-unsigned +Depends: linux-image-4.19.0-12-2-amd64-unsigned Description: kernel modules for platform devices such as fan, led, sfp diff --git a/platform/broadcom/docker-ptf-brcm.dep b/platform/broadcom/docker-ptf-brcm.dep deleted file mode 100644 index b899d058d445..000000000000 --- a/platform/broadcom/docker-ptf-brcm.dep +++ /dev/null @@ -1,10 +0,0 @@ - -DPATH := $($(DOCKER_PTF_BRCM)_PATH) -DEP_FILES := $(SONIC_COMMON_FILES_LIST) platform/broadcom/docker-ptf-brcm.mk platform/broadcom/docker-ptf-brcm.dep -DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) -DEP_FILES += $(shell git ls-files $(DPATH)) - -$(DOCKER_PTF_BRCM)_CACHE_MODE := GIT_CONTENT_SHA -$(DOCKER_PTF_BRCM)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) -$(DOCKER_PTF_BRCM)_DEP_FILES := $(DEP_FILES) - diff --git a/platform/broadcom/docker-ptf-brcm.mk b/platform/broadcom/docker-ptf-brcm.mk deleted file mode 100644 index 35780aea76ca..000000000000 --- a/platform/broadcom/docker-ptf-brcm.mk +++ /dev/null @@ -1,8 +0,0 @@ -# docker image for docker-ptf-brcm - -DOCKER_PTF_BRCM = docker-ptf-brcm.gz -$(DOCKER_PTF_BRCM)_PATH = $(DOCKERS_PATH)/docker-ptf-saithrift -$(DOCKER_PTF_BRCM)_DEPENDS += $(PYTHON_SAITHRIFT) -$(DOCKER_PTF_BRCM)_LOAD_DOCKERS += $(DOCKER_PTF) -SONIC_DOCKER_IMAGES += $(DOCKER_PTF_BRCM) -SONIC_STRETCH_DOCKERS += $(DOCKER_PTF_BRCM) diff --git a/platform/broadcom/docker-saiserver-brcm.mk b/platform/broadcom/docker-saiserver-brcm.mk index bb8499eab1fb..92e533bf69b5 100644 --- a/platform/broadcom/docker-saiserver-brcm.mk +++ b/platform/broadcom/docker-saiserver-brcm.mk @@ -1,14 +1,23 @@ # docker image for brcm saiserver -DOCKER_SAISERVER_BRCM = docker-saiserver-brcm.gz +DOCKER_SAISERVER_BRCM = docker-saiserver$(SAITHRIFT_VER)-brcm.gz $(DOCKER_SAISERVER_BRCM)_PATH = $(PLATFORM_PATH)/docker-saiserver-brcm $(DOCKER_SAISERVER_BRCM)_DEPENDS += $(SAISERVER) -$(DOCKER_SAISERVER_BRCM)_FILES += $(DSSERVE) $(BCMCMD) + +# Use syncd_init_common.sh to init hardware platform +SYNCD_INIT_COMMON_SCRIPT = syncd_init_common.sh +$(SYNCD_INIT_COMMON_SCRIPT)_PATH = $(SRC_PATH)/sonic-sairedis/syncd/scripts +SONIC_COPY_FILES += $(SYNCD_INIT_COMMON_SCRIPT) + +$(DOCKER_SAISERVER_BRCM)_FILES += $(DSSERVE) $(BCMCMD) $(SYNCD_INIT_COMMON_SCRIPT) $(DOCKER_SAISERVER_BRCM)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_BUSTER) SONIC_DOCKER_IMAGES += $(DOCKER_SAISERVER_BRCM) +SONIC_BUSTER_DOCKERS += $(DOCKER_SAISERVER_BRCM) + +#Support two versions of saiserver +$(DOCKER_SAISERVER_BRCM)_CONTAINER_NAME = saiserver$(SAITHRIFT_VER) -$(DOCKER_SAISERVER_BRCM)_CONTAINER_NAME = saiserver -$(DOCKER_SAISERVER_BRCM)_RUN_OPT += --net=host --privileged -t +$(DOCKER_SAISERVER_BRCM)_RUN_OPT += --privileged -t $(DOCKER_SAISERVER_BRCM)_RUN_OPT += -v /host/machine.conf:/etc/machine.conf $(DOCKER_SAISERVER_BRCM)_RUN_OPT += -v /var/run/docker-saiserver:/var/run/sswsyncd $(DOCKER_SAISERVER_BRCM)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro diff --git a/platform/broadcom/docker-saiserver-brcm/Dockerfile.j2 b/platform/broadcom/docker-saiserver-brcm/Dockerfile.j2 index a4b4fedd39ad..3f1b9717fea6 100644 --- a/platform/broadcom/docker-saiserver-brcm/Dockerfile.j2 +++ b/platform/broadcom/docker-saiserver-brcm/Dockerfile.j2 @@ -1,3 +1,4 @@ +{% from "dockers/dockerfile-macros.j2" import install_debian_packages %} FROM docker-config-engine-buster ARG docker_container_name @@ -6,7 +7,11 @@ RUN [ -f /etc/rsyslog.conf ] && sed -ri "s/%syslogtag%/$docker_container_name#%s ## Make apt-get non-interactive ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update +## Pre-install the fundamental packages +RUN apt-get update \ + && apt-get -y install \ + gdb \ + libboost-atomic1.71.0 COPY \ {% for deb in docker_saiserver_brcm_debs.split(' ') -%} @@ -14,18 +19,17 @@ debs/{{ deb }}{{' '}} {%- endfor -%} debs/ -RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; } ; \ -{% for deb in docker_saiserver_brcm_debs.split(' ') -%} -dpkg_apt debs/{{ deb }}{{'; '}} -{%- endfor %} +# Install locally-built Debian packages and implicitly install their dependencies +{{ install_debian_packages(docker_saiserver_brcm_debs.split(' ')) }} ## TODO: add kmod into Depends RUN apt-get install -yf kmod COPY ["files/dsserve", "files/bcmcmd", "start.sh", "bcmsh", "/usr/bin/"] +COPY ["saiserver_start.sh", "/usr/bin/"] +COPY ["files/syncd_init_common.sh", "/usr/bin/"] RUN chmod +x /usr/bin/dsserve /usr/bin/bcmcmd - -COPY ["profile.ini", "portmap.ini", "/etc/sai/"] +RUN chmod +x /usr/bin/saiserver_start.sh /usr/bin/syncd_init_common.sh COPY ["supervisord.conf", "/etc/supervisor/conf.d/"] diff --git a/platform/broadcom/docker-saiserver-brcm/portmap.ini b/platform/broadcom/docker-saiserver-brcm/portmap.ini deleted file mode 100644 index 7161416e4d4c..000000000000 --- a/platform/broadcom/docker-saiserver-brcm/portmap.ini +++ /dev/null @@ -1,33 +0,0 @@ -# alias lanes -Ethernet0 29,30,31,32 -Ethernet4 25,26,27,28 -Ethernet8 37,38,39,40 -Ethernet12 33,34,35,36 -Ethernet16 41,42,43,44 -Ethernet20 45,46,47,48 -Ethernet24 5,6,7,8 -Ethernet28 1,2,3,4 -Ethernet32 9,10,11,12 -Ethernet36 13,14,15,16 -Ethernet40 21,22,23,24 -Ethernet44 17,18,19,20 -Ethernet48 49,50,51,52 -Ethernet52 53,54,55,56 -Ethernet56 61,62,63,64 -Ethernet60 57,58,59,60 -Ethernet64 65,66,67,68 -Ethernet68 69,70,71,72 -Ethernet72 77,78,79,80 -Ethernet76 73,74,75,76 -Ethernet80 105,106,107,108 -Ethernet84 109,110,111,112 -Ethernet88 117,118,119,120 -Ethernet92 113,114,115,116 -Ethernet96 121,122,123,124 -Ethernet100 125,126,127,128 -Ethernet104 85,86,87,88 -Ethernet108 81,82,83,84 -Ethernet112 89,90,91,92 -Ethernet116 93,94,95,96 -Ethernet120 97,98,99,100 -Ethernet124 101,102,103,104 diff --git a/platform/broadcom/docker-saiserver-brcm/profile.ini b/platform/broadcom/docker-saiserver-brcm/profile.ini deleted file mode 100644 index b64d997fb451..000000000000 --- a/platform/broadcom/docker-saiserver-brcm/profile.ini +++ /dev/null @@ -1 +0,0 @@ -SAI_INIT_CONFIG_FILE=/etc/bcm/td2-s6000-32x40G.config.bcm diff --git a/platform/broadcom/docker-saiserver-brcm/saiserver_start.sh b/platform/broadcom/docker-saiserver-brcm/saiserver_start.sh new file mode 100755 index 000000000000..06fcf6c3f3ae --- /dev/null +++ b/platform/broadcom/docker-saiserver-brcm/saiserver_start.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env bash +# Copy from src/sonic-sairedis/syncd/scripts/syncd_start.sh +# Re-use the structure for syncd setup +# Use it to start saiserver +# Script to start syncd using supervisord +# + +# Source the file that holds common code for systemd and supervisord +. /usr/bin/syncd_init_common.sh + +get_saiserver_param() +{ + IFS=' ' read -r -a array <<< "$CMD_ARGS" + for index in "${!array[@]}" + do + #echo "$index ${array[index]}" + if [[ "${array[index]}" == *"-p"* ]]; then + SAI_PROFILE="${array[index+1]}" + fi + if [[ "${array[index]}" == *"-m"* ]]; then + PORT_CONFIG="${array[index+1]}" + fi + done +} + +ENABLE_SAITHRIFT=1 +config_syncd +get_saiserver_param + +echo exec /usr/sbin/saiserver -p ${SAI_PROFILE} -f ${PORT_CONFIG} +exec /usr/sbin/saiserver -p ${SAI_PROFILE} -f ${PORT_CONFIG} +#exec ${CMD} ${CMD_ARGS} diff --git a/platform/broadcom/docker-saiserver-brcm/start.sh b/platform/broadcom/docker-saiserver-brcm/start.sh index 494c0e9126c2..6a395866c15d 100755 --- a/platform/broadcom/docker-saiserver-brcm/start.sh +++ b/platform/broadcom/docker-saiserver-brcm/start.sh @@ -1,17 +1,33 @@ #!/usr/bin/env bash +HWSKU_DIR=/usr/share/sonic/hwsku -start_bcm() +generate_profile() { - [ -e /dev/linux-bcm-knet ] || mknod /dev/linux-bcm-knet c 122 0 - [ -e /dev/linux-user-bde ] || mknod /dev/linux-user-bde c 126 0 - [ -e /dev/linux-kernel-bde ] || mknod /dev/linux-kernel-bde c 127 0 -} + # There are two ways to specify the contents of the SAI_INIT_CONFIG_FILE and they are mutually exclusive + # via current method (sai.profile.j2) or new method (config.bcm.j2) + # If delta is large, use sai.profile.j2 which basically require the user to select which config file to use + # If delta is small, use config.bcm.j2 where additional SAI INIT config properties are added + # based on specific device metadata requirement + # in this case sai.profile should have been modified to use the path /etc/sai.d/config.bcm + # There is also a possibility that both sai.profile.j2 and config.bcm.j2 are absent. in that cacse just copy + # sai.profile to the new /etc/said directory. + # Create/Copy the sai.profile to /etc/sai.d/sai.profile + mkdir -p /etc/sai.d/ -rm -f /var/run/rsyslogd.pid + if [ -f $HWSKU_DIR/sai.profile.j2 ]; then + sonic-cfggen -d -t $HWSKU_DIR/sai.profile.j2 > /etc/sai.d/sai.profile + else + if [ -f $HWSKU_DIR/config.bcm.j2 ]; then + sonic-cfggen -d -t $HWSKU_DIR/config.bcm.j2 > /etc/sai.d/config.bcm + fi + if [ -f $HWSKU_DIR/sai.profile ]; then + cp $HWSKU_DIR/sai.profile /etc/sai.d/sai.profile + fi + fi +} +rm -f /var/run/rsyslogd.pid supervisorctl start rsyslogd - -start_bcm - +generate_profile supervisorctl start saiserver diff --git a/platform/broadcom/docker-saiserver-brcm/supervisord.conf b/platform/broadcom/docker-saiserver-brcm/supervisord.conf index cb67a0fc9a47..d20dac89141b 100644 --- a/platform/broadcom/docker-saiserver-brcm/supervisord.conf +++ b/platform/broadcom/docker-saiserver-brcm/supervisord.conf @@ -20,7 +20,7 @@ stdout_logfile=syslog stderr_logfile=syslog [program:saiserver] -command=/usr/bin/saiserver -p /etc/sai/profile.ini -f /etc/sai/portmap.ini +command=/usr/bin/saiserver_start.sh priority=3 autostart=false autorestart=false diff --git a/platform/broadcom/docker-syncd-brcm-rpc/Dockerfile.j2 b/platform/broadcom/docker-syncd-brcm-rpc/Dockerfile.j2 index f68fbb661d9c..b832fd58864f 100644 --- a/platform/broadcom/docker-syncd-brcm-rpc/Dockerfile.j2 +++ b/platform/broadcom/docker-syncd-brcm-rpc/Dockerfile.j2 @@ -11,23 +11,28 @@ debs/ RUN apt-get purge -y syncd -RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; } ; \ -{% for deb in docker_syncd_brcm_rpc_debs.split(' ') -%} -dpkg_apt debs/{{ deb }}{{'; '}} -{%- endfor %} - ## Pre-install the fundamental packages RUN apt-get update \ && apt-get -y install \ net-tools \ python-pip \ + python-setuptools \ build-essential \ libssl-dev \ libffi-dev \ python-dev \ wget \ cmake \ - && wget https://github.com/nanomsg/nanomsg/archive/1.0.0.tar.gz \ + libqt5core5a \ + libqt5network5 \ + libboost-atomic1.71.0 + +RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; } ; \ +{% for deb in docker_syncd_brcm_rpc_debs.split(' ') -%} +dpkg_apt debs/{{ deb }}{{'; '}} +{%- endfor %} + +RUN wget https://github.com/nanomsg/nanomsg/archive/1.0.0.tar.gz \ && tar xvfz 1.0.0.tar.gz \ && cd nanomsg-1.0.0 \ && mkdir -p build \ @@ -37,9 +42,10 @@ RUN apt-get update \ && cd .. \ && rm -fr nanomsg-1.0.0 \ && rm -f 1.0.0.tar.gz \ - && pip install cffi==1.7.0 \ - && pip install --upgrade cffi==1.7.0 \ - && pip install nnpy \ + && pip2 install cffi==1.7.0 \ + && pip2 install --upgrade cffi==1.7.0 \ + && pip2 install wheel \ + && pip2 install nnpy \ && mkdir -p /opt \ && cd /opt \ && wget https://raw.githubusercontent.com/p4lang/ptf/master/ptf_nn/ptf_nn_agent.py \ diff --git a/platform/broadcom/docker-syncd-brcm.dep b/platform/broadcom/docker-syncd-brcm.dep index 48fa57f33479..c020a72f2a08 100644 --- a/platform/broadcom/docker-syncd-brcm.dep +++ b/platform/broadcom/docker-syncd-brcm.dep @@ -1,6 +1,6 @@ #DPKG FRK DPATH := $($(DOCKER_SYNCD_BASE)_PATH) -DEP_FILES := $(SONIC_COMMON_FILES_LIST) platform/broadcom/docker-syncd-brcm.mk platform/broadcom/docker-syncd-brcm.dep +DEP_FILES := $(SONIC_COMMON_FILES_LIST) platform/broadcom/docker-syncd-brcm.mk platform/broadcom/docker-syncd-brcm.dep platform/broadcom/sai.mk DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) DEP_FILES += $(shell git ls-files $(DPATH)) diff --git a/platform/broadcom/docker-syncd-brcm.mk b/platform/broadcom/docker-syncd-brcm.mk index d23141481915..2e66979ea2f2 100644 --- a/platform/broadcom/docker-syncd-brcm.mk +++ b/platform/broadcom/docker-syncd-brcm.mk @@ -16,4 +16,3 @@ $(DOCKER_SYNCD_BASE)_RUN_OPT += -v /host/warmboot:/var/warmboot $(DOCKER_SYNCD_BASE)_BASE_IMAGE_FILES += bcmcmd:/usr/bin/bcmcmd $(DOCKER_SYNCD_BASE)_BASE_IMAGE_FILES += bcmsh:/usr/bin/bcmsh $(DOCKER_SYNCD_BASE)_BASE_IMAGE_FILES += bcm_common:/usr/bin/bcm_common -$(DOCKER_SYNCD_BASE)_BASE_IMAGE_FILES += monit_syncd:/etc/monit/conf.d diff --git a/platform/broadcom/docker-syncd-brcm/Dockerfile.j2 b/platform/broadcom/docker-syncd-brcm/Dockerfile.j2 index cf597df680de..0ba71bb5d780 100755 --- a/platform/broadcom/docker-syncd-brcm/Dockerfile.j2 +++ b/platform/broadcom/docker-syncd-brcm/Dockerfile.j2 @@ -21,6 +21,9 @@ debs/ ## TODO: add kmod into Depends RUN apt-get install -yf kmod +## BRCM uses ethtool to set host interface speed +RUN apt-get install -y ethtool + COPY ["files/dsserve", "files/bcmcmd", "start.sh", "start_led.sh", "bcmsh", "/usr/bin/"] RUN chmod +x /usr/bin/dsserve /usr/bin/bcmcmd diff --git a/platform/broadcom/docker-syncd-brcm/base_image_files/monit_syncd b/platform/broadcom/docker-syncd-brcm/base_image_files/monit_syncd deleted file mode 100644 index d63346d9ee20..000000000000 --- a/platform/broadcom/docker-syncd-brcm/base_image_files/monit_syncd +++ /dev/null @@ -1,11 +0,0 @@ -############################################################################### -## Monit configuration for syncd container -## process list: -## syncd -## dsserve -############################################################################### -check program syncd|syncd with path "/usr/bin/process_checker syncd /usr/bin/syncd" - if status != 0 for 5 times within 5 cycles then alert repeat every 1 cycles - -check program syncd|dsserve with path "/usr/bin/process_checker syncd /usr/bin/dsserve /usr/bin/syncd" - if status != 0 for 5 times within 5 cycles then alert repeat every 1 cycles diff --git a/platform/broadcom/docker-syncd-brcm/start.sh b/platform/broadcom/docker-syncd-brcm/start.sh index 9927b877a619..e4a5b2e2c5bd 100755 --- a/platform/broadcom/docker-syncd-brcm/start.sh +++ b/platform/broadcom/docker-syncd-brcm/start.sh @@ -9,10 +9,22 @@ rm -f ${SYNCD_SOCKET_FILE} mkdir -p /etc/sai.d/ +# There are two ways to specify the contents of the SAI_INIT_CONFIG_FILE and they are mutually exclusive +# via current method (sai.profile.j2) or new method (config.bcm.j2) +# If delta is large, use sai.profile.j2 which basically require the user to select which config file to use +# If delta is small, use config.bcm.j2 where additional SAI INIT config properties are added +# based on specific device metadata requirement +# in this case sai.profile should have been modified to use the path /etc/sai.d/config.bcm +# There is also a possibility that both sai.profile.j2 and config.bcm.j2 are absent. in that cacse just copy +# sai.profile to the new /etc/said directory. + # Create/Copy the sai.profile to /etc/sai.d/sai.profile if [ -f $HWSKU_DIR/sai.profile.j2 ]; then sonic-cfggen -d -t $HWSKU_DIR/sai.profile.j2 > /etc/sai.d/sai.profile else + if [ -f $HWSKU_DIR/config.bcm.j2 ]; then + sonic-cfggen -d -t $HWSKU_DIR/config.bcm.j2 > /etc/sai.d/config.bcm + fi if [ -f $HWSKU_DIR/sai.profile ]; then cp $HWSKU_DIR/sai.profile /etc/sai.d/sai.profile fi diff --git a/platform/broadcom/docker-syncd-brcm/start_led.sh b/platform/broadcom/docker-syncd-brcm/start_led.sh index 964aa23eb04f..43a914173452 100755 --- a/platform/broadcom/docker-syncd-brcm/start_led.sh +++ b/platform/broadcom/docker-syncd-brcm/start_led.sh @@ -4,11 +4,6 @@ PLATFORM_DIR=/usr/share/sonic/platform SYNCD_SOCKET_FILE=/var/run/sswsyncd/sswsyncd.socket LED_PROC_INIT_SOC=${PLATFORM_DIR}/led_proc_init.soc -if [ ! -f "$LED_PROC_INIT_SOC" ]; then - echo "No soc led configuration found under $LED_SOC_INIT_SOC" - exit 0 -fi - # Function: wait until syncd has created the socket for bcmcmd to connect to wait_syncd() { while true; do @@ -36,8 +31,9 @@ wait_syncd() { } # If this platform has an initialization file for the Broadcom LED microprocessor, load it -if [[ -r "$LED_PROC_INIT_SOC" && ! -f /var/warmboot/warm-starting ]]; then - wait_syncd +if [ -r "$LED_PROC_INIT_SOC" ]; then + if [ ! -f /var/warmboot/warm-starting ]; then + wait_syncd + fi + /usr/bin/bcmcmd -t 60 "rcload $LED_PROC_INIT_SOC" fi - -/usr/bin/bcmcmd -t 60 "rcload $LED_PROC_INIT_SOC" diff --git a/platform/broadcom/docker-syncd-brcm/supervisord.conf b/platform/broadcom/docker-syncd-brcm/supervisord.conf index a8e594c47aeb..7f1943600a31 100644 --- a/platform/broadcom/docker-syncd-brcm/supervisord.conf +++ b/platform/broadcom/docker-syncd-brcm/supervisord.conf @@ -10,13 +10,14 @@ autorestart=unexpected startretries=0 exitcodes=0,3 events=PROCESS_STATE -buffer_size=25 +buffer_size=1024 [eventlistener:supervisor-proc-exit-listener] command=/usr/bin/supervisor-proc-exit-listener --container-name syncd -events=PROCESS_STATE_EXITED +events=PROCESS_STATE_EXITED,PROCESS_STATE_RUNNING autostart=true autorestart=unexpected +buffer_size=1024 [program:rsyslogd] command=/usr/sbin/rsyslogd -n -iNONE diff --git a/platform/broadcom/libsaithrift-dev.mk b/platform/broadcom/libsaithrift-dev.mk index 543ea63e7f4e..f98c0fb82e8a 100644 --- a/platform/broadcom/libsaithrift-dev.mk +++ b/platform/broadcom/libsaithrift-dev.mk @@ -2,19 +2,28 @@ SAI_VER = 0.9.4 -LIBSAITHRIFT_DEV = libsaithrift-dev_$(SAI_VER)_amd64.deb +LIBSAITHRIFT_DEV = libsaithrift$(SAITHRIFT_VER)-dev_$(SAI_VER)_amd64.deb $(LIBSAITHRIFT_DEV)_SRC_PATH = $(SRC_PATH)/sonic-sairedis/SAI -$(LIBSAITHRIFT_DEV)_DEPENDS += $(LIBTHRIFT) $(LIBTHRIFT_DEV) $(PYTHON_THRIFT) $(THRIFT_COMPILER) $(BRCM_SAI) $(BRCM_SAI_DEV) -$(LIBSAITHRIFT_DEV)_RDEPENDS += $(LIBTHRIFT) $(BRCM_SAI) +#Support two different versions of thrift +ifeq ($(SAITHRIFT_V2),y) +$(LIBSAITHRIFT_DEV)_DEPENDS += $(LIBTHRIFT_0_13_0) $(LIBTHRIFT_DEV_0_13_0) $(PYTHON3_THRIFT_0_13_0) $(THRIFT_COMPILER_0_13_0) +$(LIBSAITHRIFT_DEV)_RDEPENDS += $(LIBTHRIFT_0_13_0) +$(LIBSAITHRIFT_DEV)_BUILD_ENV = SAITHRIFTV2=true SAITHRIFT_VER=v2 GEN_SAIRPC_OPTS="--adapter_logger" +else +$(LIBSAITHRIFT_DEV)_DEPENDS += $(LIBTHRIFT) $(LIBTHRIFT_DEV) $(PYTHON_THRIFT) $(THRIFT_COMPILER) +$(LIBSAITHRIFT_DEV)_RDEPENDS += $(LIBTHRIFT) +endif +$(LIBSAITHRIFT_DEV)_DEPENDS += $(BRCM_SAI) $(BRCM_SAI_DEV) +$(LIBSAITHRIFT_DEV)_RDEPENDS += $(BRCM_SAI) SONIC_DPKG_DEBS += $(LIBSAITHRIFT_DEV) -PYTHON_SAITHRIFT = python-saithrift_$(SAI_VER)_amd64.deb +PYTHON_SAITHRIFT = python-saithrift$(SAITHRIFT_VER)_$(SAI_VER)_amd64.deb $(eval $(call add_extra_package,$(LIBSAITHRIFT_DEV),$(PYTHON_SAITHRIFT))) -SAISERVER = saiserver_$(SAI_VER)_amd64.deb -$(SAISERVER)_RDEPENDS += $(LIBTHRIFT) $(BRCM_SAI) +SAISERVER = saiserver$(SAITHRIFT_VER)_$(SAI_VER)_amd64.deb +$(SAISERVER)_RDEPENDS += $(LIBSAITHRIFT_DEV) $(eval $(call add_extra_package,$(LIBSAITHRIFT_DEV),$(SAISERVER))) -SAISERVER_DBG = saiserver-dbg_$(SAI_VER)_amd64.deb +SAISERVER_DBG = saiserver$(SAITHRIFT_VER)-dbg_$(SAI_VER)_amd64.deb $(SAISERVER_DBG)_RDEPENDS += $(SAISERVER) $(eval $(call add_extra_package,$(LIBSAITHRIFT_DEV),$(SAISERVER_DBG))) diff --git a/platform/broadcom/one-image.mk b/platform/broadcom/one-image.mk index f557f17c7cea..1d14d56f70ab 100644 --- a/platform/broadcom/one-image.mk +++ b/platform/broadcom/one-image.mk @@ -29,11 +29,13 @@ $(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(DELL_S6000_PLATFORM_MODULE) \ $(ACCTON_AS6712_32X_PLATFORM_MODULE) \ $(ACCTON_AS7726_32X_PLATFORM_MODULE) \ $(ACCTON_AS4630_54PE_PLATFORM_MODULE) \ + $(ACCTON_AS4630_54TE_PLATFORM_MODULE) \ $(ACCTON_MINIPACK_PLATFORM_MODULE) \ $(ACCTON_AS5812_54X_PLATFORM_MODULE) \ $(ACCTON_AS5812_54T_PLATFORM_MODULE) \ $(ACCTON_AS5835_54X_PLATFORM_MODULE) \ $(ACCTON_AS9716_32D_PLATFORM_MODULE) \ + $(ACCTON_AS9726_32D_PLATFORM_MODULE) \ $(ACCTON_AS5835_54T_PLATFORM_MODULE) \ $(ACCTON_AS7312_54XS_PLATFORM_MODULE) \ $(ACCTON_AS7315_27XB_PLATFORM_MODULE) \ @@ -51,7 +53,9 @@ $(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(DELL_S6000_PLATFORM_MODULE) \ $(DELTA_ET6248BRB_PLATFORM_MODULE) \ $(QUANTA_IX1B_32X_PLATFORM_MODULE) \ $(QUANTA_IX7_32X_PLATFORM_MODULE) \ + $(QUANTA_IX7_BWDE_32X_PLATFORM_MODULE) \ $(QUANTA_IX8_56X_PLATFORM_MODULE) \ + $(QUANTA_IX8A_BWDE_56X_PLATFORM_MODULE) \ $(QUANTA_IX8C_56X_PLATFORM_MODULE) \ $(QUANTA_IX9_32X_PLATFORM_MODULE) \ $(MITAC_LY1200_32X_PLATFORM_MODULE) \ diff --git a/platform/broadcom/platform-modules-accton.mk b/platform/broadcom/platform-modules-accton.mk index 395040d7561d..1e2bfdcf82de 100755 --- a/platform/broadcom/platform-modules-accton.mk +++ b/platform/broadcom/platform-modules-accton.mk @@ -10,11 +10,13 @@ ACCTON_AS7716_32XB_PLATFORM_MODULE_VERSION = 1.1 ACCTON_AS6712_32X_PLATFORM_MODULE_VERSION = 1.1 ACCTON_AS7726_32X_PLATFORM_MODULE_VERSION = 1.1 ACCTON_AS4630_54PE_PLATFORM_MODULE_VERSION = 1.1 +ACCTON_AS4630_54TE_PLATFORM_MODULE_VERSION = 1.1 ACCTON_MINIPACK_PLATFORM_MODULE_VERSION = 1.1 ACCTON_AS5812_54X_PLATFORM_MODULE_VERSION = 1.1 ACCTON_AS5812_54T_PLATFORM_MODULE_VERSION = 1.1 ACCTON_AS5835_54X_PLATFORM_MODULE_VERSION = 1.1 ACCTON_AS9716_32D_PLATFORM_MODULE_VERSION = 1.1 +ACCTON_AS9726_32D_PLATFORM_MODULE_VERSION = 1.1 ACCTON_AS5835_54T_PLATFORM_MODULE_VERSION = 1.1 ACCTON_AS7312_54XS_PLATFORM_MODULE_VERSION = 1.1 ACCTON_AS7315_27XB_PLATFORM_MODULE_VERSION = 1.1 @@ -29,11 +31,13 @@ export ACCTON_AS7716_32XB_PLATFORM_MODULE_VERSION export ACCTON_AS6712_32X_PLATFORM_MODULE_VERSION export ACCTON_AS7726_32X_PLATFORM_MODULE_VERSION export ACCTON_AS4630_54PE_PLATFORM_MODULE_VERSION +export ACCTON_AS4630_54TE_PLATFORM_MODULE_VERSION export ACCTON_MINIPACK_PLATFORM_MODULE_VERSION export ACCTON_AS5812_54X_PLATFORM_MODULE_VERSION export ACCTON_AS5812_54T_PLATFORM_MODULE_VERSION export ACCTON_AS5835_54X_PLATFORM_MODULE_VERSION export ACCTON_AS9716_32D_PLATFORM_MODULE_VERSION +export ACCTON_AS9726_32D_PLATFORM_MODULE_VERSION export ACCTON_AS5835_54T_PLATFORM_MODULE_VERSION export ACCTON_AS7312_54XS_PLATFORM_MODULE_VERSION export ACCTON_AS7315_27XB_PLATFORM_MODULE_VERSION @@ -84,6 +88,10 @@ ACCTON_AS4630_54PE_PLATFORM_MODULE = sonic-platform-accton-as4630-54pe_$(ACCTON_ $(ACCTON_AS4630_54PE_PLATFORM_MODULE)_PLATFORM = x86_64-accton_as4630_54pe-r0 $(eval $(call add_extra_package,$(ACCTON_AS7712_32X_PLATFORM_MODULE),$(ACCTON_AS4630_54PE_PLATFORM_MODULE))) +ACCTON_AS4630_54TE_PLATFORM_MODULE = sonic-platform-accton-as4630-54te_$(ACCTON_AS4630_54TE_PLATFORM_MODULE_VERSION)_amd64.deb +$(ACCTON_AS4630_54TE_PLATFORM_MODULE)_PLATFORM = x86_64-accton_as4630_54te-r0 +$(eval $(call add_extra_package,$(ACCTON_AS7712_32X_PLATFORM_MODULE),$(ACCTON_AS4630_54TE_PLATFORM_MODULE))) + ACCTON_MINIPACK_PLATFORM_MODULE = sonic-platform-accton-minipack_$(ACCTON_MINIPACK_PLATFORM_MODULE_VERSION)_amd64.deb $(ACCTON_MINIPACK_PLATFORM_MODULE)_PLATFORM = x86_64-accton_minipack-r0 $(eval $(call add_extra_package,$(ACCTON_AS7712_32X_PLATFORM_MODULE),$(ACCTON_MINIPACK_PLATFORM_MODULE))) @@ -104,6 +112,10 @@ ACCTON_AS9716_32D_PLATFORM_MODULE = sonic-platform-accton-as9716-32d_$(ACCTON_AS $(ACCTON_AS9716_32D_PLATFORM_MODULE)_PLATFORM = x86_64-accton_as9716_32d-r0 $(eval $(call add_extra_package,$(ACCTON_AS7712_32X_PLATFORM_MODULE),$(ACCTON_AS9716_32D_PLATFORM_MODULE))) +ACCTON_AS9726_32D_PLATFORM_MODULE = sonic-platform-accton-as9726-32d_$(ACCTON_AS9726_32D_PLATFORM_MODULE_VERSION)_amd64.deb +$(ACCTON_AS9726_32D_PLATFORM_MODULE)_PLATFORM = x86_64-accton_as9726_32d-r0 +$(eval $(call add_extra_package,$(ACCTON_AS7712_32X_PLATFORM_MODULE),$(ACCTON_AS9726_32D_PLATFORM_MODULE))) + ACCTON_AS5835_54T_PLATFORM_MODULE = sonic-platform-accton-as5835-54t_$(ACCTON_AS5835_54T_PLATFORM_MODULE_VERSION)_amd64.deb $(ACCTON_AS5835_54T_PLATFORM_MODULE)_PLATFORM = x86_64-accton_as5835_54t-r0 $(eval $(call add_extra_package,$(ACCTON_AS7712_32X_PLATFORM_MODULE),$(ACCTON_AS5835_54T_PLATFORM_MODULE))) diff --git a/platform/broadcom/platform-modules-quanta.mk b/platform/broadcom/platform-modules-quanta.mk index 267d3d9e7378..4847af29837e 100644 --- a/platform/broadcom/platform-modules-quanta.mk +++ b/platform/broadcom/platform-modules-quanta.mk @@ -2,13 +2,17 @@ QUANTA_IX1B_32X_PLATFORM_MODULE_VERSION = 1.0 QUANTA_IX7_32X_PLATFORM_MODULE_VERSION = 1.0 +QUANTA_IX7_BWDE_32X_PLATFORM_MODULE_VERSION = 1.0 QUANTA_IX8_56X_PLATFORM_MODULE_VERSION = 1.0 +QUANTA_IX8A_BWDE_56X_PLATFORM_MODULE_VERSION = 1.0 QUANTA_IX8C_56X_PLATFORM_MODULE_VERSION = 1.0 QUANTA_IX9_32X_PLATFORM_MODULE_VERSION = 1.0 export QUANTA_IX1B_32X_PLATFORM_MODULE_VERSION export QUANTA_IX7_32X_PLATFORM_MODULE_VERSION +export QUANTA_IX7_BWDE_32X_PLATFORM_MODULE_VERSION export QUANTA_IX8_56X_PLATFORM_MODULE_VERSION +export QUANTA_IX8A_BWDE_56X_PLATFORM_MODULE_VERSION export QUANTA_IX8C_56X_PLATFORM_MODULE_VERSION export QUANTA_IX9_32X_PLATFORM_MODULE_VERSION @@ -22,10 +26,18 @@ QUANTA_IX7_32X_PLATFORM_MODULE = sonic-platform-quanta-ix7-32x_$(QUANTA_IX7_32X_ $(QUANTA_IX7_32X_PLATFORM_MODULE)_PLATFORM = x86_64-quanta_ix7_rglbmc-r0 $(eval $(call add_extra_package,$(QUANTA_IX1B_32X_PLATFORM_MODULE),$(QUANTA_IX7_32X_PLATFORM_MODULE))) +QUANTA_IX7_BWDE_32X_PLATFORM_MODULE = sonic-platform-quanta-ix7-bwde-32x_$(QUANTA_IX7_BWDE_32X_PLATFORM_MODULE_VERSION)_amd64.deb +$(QUANTA_IX7_BWDE_32X_PLATFORM_MODULE)_PLATFORM = x86_64-quanta_ix7_bwde-r0 +$(eval $(call add_extra_package,$(QUANTA_IX1B_32X_PLATFORM_MODULE),$(QUANTA_IX7_BWDE_32X_PLATFORM_MODULE))) + QUANTA_IX8_56X_PLATFORM_MODULE = sonic-platform-quanta-ix8-56x_$(QUANTA_IX8_56X_PLATFORM_MODULE_VERSION)_amd64.deb $(QUANTA_IX8_56X_PLATFORM_MODULE)_PLATFORM = x86_64-quanta_ix8_rglbmc-r0 $(eval $(call add_extra_package,$(QUANTA_IX1B_32X_PLATFORM_MODULE),$(QUANTA_IX8_56X_PLATFORM_MODULE))) +QUANTA_IX8A_BWDE_56X_PLATFORM_MODULE = sonic-platform-quanta-ix8a-bwde-56x_$(QUANTA_IX8A_BWDE_56X_PLATFORM_MODULE_VERSION)_amd64.deb +$(QUANTA_IX8A_BWDE_56X_PLATFORM_MODULE)_PLATFORM = x86_64-quanta_ix8a_bwde-r0 +$(eval $(call add_extra_package,$(QUANTA_IX1B_32X_PLATFORM_MODULE),$(QUANTA_IX8A_BWDE_56X_PLATFORM_MODULE))) + QUANTA_IX8C_56X_PLATFORM_MODULE = sonic-platform-quanta-ix8c-56x_$(QUANTA_IX8C_56X_PLATFORM_MODULE_VERSION)_amd64.deb $(QUANTA_IX8C_56X_PLATFORM_MODULE)_PLATFORM = x86_64-quanta_ix8c_bwde-r0 $(eval $(call add_extra_package,$(QUANTA_IX1B_32X_PLATFORM_MODULE),$(QUANTA_IX8C_56X_PLATFORM_MODULE))) diff --git a/platform/broadcom/rules.dep b/platform/broadcom/rules.dep index d8142ae3fb76..2e2d44ed018a 100644 --- a/platform/broadcom/rules.dep +++ b/platform/broadcom/rules.dep @@ -22,4 +22,3 @@ include $(PLATFORM_PATH)/one-pde-image.dep include $(PLATFORM_PATH)/raw-image.dep include $(PLATFORM_PATH)/one-aboot.dep include $(PLATFORM_PATH)/libsaithrift-dev.dep -include $(PLATFORM_PATH)/docker-ptf-brcm.dep diff --git a/platform/broadcom/rules.mk b/platform/broadcom/rules.mk index 34edfa0d37fd..fbe0dd689a2e 100644 --- a/platform/broadcom/rules.mk +++ b/platform/broadcom/rules.mk @@ -19,7 +19,6 @@ include $(PLATFORM_PATH)/one-image.mk include $(PLATFORM_PATH)/raw-image.mk include $(PLATFORM_PATH)/one-aboot.mk include $(PLATFORM_PATH)/libsaithrift-dev.mk -include $(PLATFORM_PATH)/docker-ptf-brcm.mk BCMCMD = bcmcmd $(BCMCMD)_URL = "https://sonicstorage.blob.core.windows.net/packages/20190307/bcmcmd?sv=2015-04-05&sr=b&sig=sUdbU7oVbh5exbXXHVL5TDFBTWDDBASHeJ8Cp0B0TIc%3D&se=2038-05-06T22%3A34%3A19Z&sp=r" diff --git a/platform/broadcom/sai-modules.mk b/platform/broadcom/sai-modules.mk index 84d97c09ac88..2d4262518c68 100644 --- a/platform/broadcom/sai-modules.mk +++ b/platform/broadcom/sai-modules.mk @@ -1,6 +1,6 @@ # Broadcom SAI modules -BRCM_OPENNSL_KERNEL_VERSION = 4.2.1.3-1 +BRCM_OPENNSL_KERNEL_VERSION = 4.3.0.10-2 BRCM_OPENNSL_KERNEL = opennsl-modules_$(BRCM_OPENNSL_KERNEL_VERSION)_amd64.deb $(BRCM_OPENNSL_KERNEL)_SRC_PATH = $(PLATFORM_PATH)/saibcm-modules diff --git a/platform/broadcom/sai.mk b/platform/broadcom/sai.mk index 8690bdddcef5..fb96cf54e838 100644 --- a/platform/broadcom/sai.mk +++ b/platform/broadcom/sai.mk @@ -1,8 +1,12 @@ -BRCM_SAI = libsaibcm_4.2.1.5-8_amd64.deb -$(BRCM_SAI)_URL = "https://sonicstorage.blob.core.windows.net/packages/bcmsai/4.2/master/buster/libsaibcm_4.2.1.5-8_amd64.deb?sv=2019-12-12&st=2020-12-18T18%3A41%3A23Z&se=2030-12-19T18%3A41%3A00Z&sr=b&sp=r&sig=GFNMn0borytUTFQJf%2F5A0J452XsQ%2FqnzBw5GyjFuYHw%3D" -BRCM_SAI_DEV = libsaibcm-dev_4.2.1.5-8_amd64.deb +LIBSAIBCM_XGS_VERSION = 4.3.7.1-7 +LIBSAIBCM_BRANCH_NAME = REL_4.3_202012 +LIBSAIBCM_XGS_URL_PREFIX = "https://sonicstorage.blob.core.windows.net/public/sai/bcmsai/$(LIBSAIBCM_BRANCH_NAME)/$(LIBSAIBCM_XGS_VERSION)" + +BRCM_SAI = libsaibcm_$(LIBSAIBCM_XGS_VERSION)_amd64.deb +$(BRCM_SAI)_URL = "$(LIBSAIBCM_XGS_URL_PREFIX)/$(BRCM_SAI)" +BRCM_SAI_DEV = libsaibcm-dev_$(LIBSAIBCM_XGS_VERSION)_amd64.deb $(eval $(call add_derived_package,$(BRCM_SAI),$(BRCM_SAI_DEV))) -$(BRCM_SAI_DEV)_URL = "https://sonicstorage.blob.core.windows.net/packages/bcmsai/4.2/master/buster/libsaibcm-dev_4.2.1.5-8_amd64.deb?sv=2019-12-12&st=2020-12-18T18%3A42%3A03Z&se=2030-12-19T18%3A42%3A00Z&sr=b&sp=r&sig=J%2BbRtZVVcZTLs3uqzZs9zObLKFxRgzvJkFL5iyJ48mA%3D" +$(BRCM_SAI_DEV)_URL = "$(LIBSAIBCM_XGS_URL_PREFIX)/$(BRCM_SAI_DEV)" SONIC_ONLINE_DEBS += $(BRCM_SAI) $(BRCM_SAI_DEV)_DEPENDS += $(BRCM_SAI) diff --git a/platform/broadcom/saibcm-modules/debian/changelog b/platform/broadcom/saibcm-modules/debian/changelog index f2b0db31e662..87d659d21a61 100644 --- a/platform/broadcom/saibcm-modules/debian/changelog +++ b/platform/broadcom/saibcm-modules/debian/changelog @@ -1,3 +1,10 @@ +opennsl (4.3.0.10-2) unstable; urgency=medium + + * Update to Broadcom SAI 4.3.0.10 + * Added SDKLT modules 4.3.0.10-2 + + -- Mahesh Maddikayala Thu, 21 Jan 2021 18:36:38 +0000 + opennsl (4.2.1.3-1) unstable; urgency=medium * Update to Broadcom SAI 4.2.1.3 diff --git a/platform/broadcom/saibcm-modules/debian/control b/platform/broadcom/saibcm-modules/debian/control index d022eadb0501..60bcbafb1b1a 100644 --- a/platform/broadcom/saibcm-modules/debian/control +++ b/platform/broadcom/saibcm-modules/debian/control @@ -10,5 +10,5 @@ Standards-Version: 3.9.3 Package: opennsl-modules Architecture: amd64 Section: main -Depends: linux-image-4.19.0-9-2-amd64-unsigned +Depends: linux-image-4.19.0-12-2-amd64-unsigned Description: kernel modules for broadcom SAI diff --git a/platform/broadcom/saibcm-modules/debian/opennsl-modules.dirs b/platform/broadcom/saibcm-modules/debian/opennsl-modules.dirs index 27fae96d8a1a..140d1186059e 100644 --- a/platform/broadcom/saibcm-modules/debian/opennsl-modules.dirs +++ b/platform/broadcom/saibcm-modules/debian/opennsl-modules.dirs @@ -1 +1 @@ -lib/modules/4.19.0-9-2-amd64/extra +lib/modules/4.19.0-12-2-amd64/extra diff --git a/platform/broadcom/saibcm-modules/debian/opennsl-modules.init b/platform/broadcom/saibcm-modules/debian/opennsl-modules.init index 7def10cbff86..09112f5331ce 100755 --- a/platform/broadcom/saibcm-modules/debian/opennsl-modules.init +++ b/platform/broadcom/saibcm-modules/debian/opennsl-modules.init @@ -18,7 +18,9 @@ function create_devices() rm -f /dev/linux-bcm-knet rm -f /dev/linux-bcm-bde rm -f /dev/linux-kernel-bde + rm -f /dev/linux_ngbde + mknod /dev/linux_ngbde c 120 0 mknod /dev/linux-knet-cb c 121 0 mknod /dev/linux-bcm-knet c 122 0 mknod /dev/linux-bcm-bde c 126 0 @@ -57,8 +59,9 @@ function load_kernel_modules() # There is a different psample.ko module getting created at net/psample/psample.ko insmod /lib/modules/$(uname -r)/extra/psample.ko - modprobe linux-bcm-knet use_rx_skb=1 rx_buffer_size=9238 debug=0x5020 + modprobe linux-bcm-knet use_rx_skb=1 rx_buffer_size=9238 debug=0x5020 default_mtu=9100 modprobe linux-knet-cb + modprobe linux_ngbde } function remove_kernel_modules() @@ -68,6 +71,7 @@ function remove_kernel_modules() rmmod linux-bcm-knet rmmod linux-user-bde rmmod linux-kernel-bde + rmmod linux_ngbde } case "$1" in diff --git a/platform/broadcom/saibcm-modules/debian/opennsl-modules.install b/platform/broadcom/saibcm-modules/debian/opennsl-modules.install index 0e8051fbbca7..5e8e70bb189f 100644 --- a/platform/broadcom/saibcm-modules/debian/opennsl-modules.install +++ b/platform/broadcom/saibcm-modules/debian/opennsl-modules.install @@ -1,7 +1,8 @@ -systems/linux/user/x86-smp_generic_64-2_6/linux-bcm-knet.ko lib/modules/4.19.0-9-2-amd64/extra -systems/linux/user/x86-smp_generic_64-2_6/linux-kernel-bde.ko lib/modules/4.19.0-9-2-amd64/extra -systems/linux/user/x86-smp_generic_64-2_6/linux-user-bde.ko lib/modules/4.19.0-9-2-amd64/extra -systems/linux/user/x86-smp_generic_64-2_6/linux-knet-cb.ko lib/modules/4.19.0-9-2-amd64/extra -systems/linux/user/x86-smp_generic_64-2_6/psample.ko lib/modules/4.19.0-9-2-amd64/extra -systems/linux/user/x86-smp_generic_64-2_6/linux-bcm-ptp-clock.ko lib/modules/4.19.0-9-2-amd64/extra +systems/linux/user/x86-smp_generic_64-2_6/linux-bcm-knet.ko lib/modules/4.19.0-12-2-amd64/extra +systems/linux/user/x86-smp_generic_64-2_6/linux-kernel-bde.ko lib/modules/4.19.0-12-2-amd64/extra +systems/linux/user/x86-smp_generic_64-2_6/linux-user-bde.ko lib/modules/4.19.0-12-2-amd64/extra +systems/linux/user/x86-smp_generic_64-2_6/linux-knet-cb.ko lib/modules/4.19.0-12-2-amd64/extra +systems/linux/user/x86-smp_generic_64-2_6/psample.ko lib/modules/4.19.0-12-2-amd64/extra +systems/linux/user/x86-smp_generic_64-2_6/linux-bcm-ptp-clock.ko lib/modules/4.19.0-12-2-amd64/extra systemd/opennsl-modules.service lib/systemd/system +sdklt/linux/bde/linux_ngbde.ko lib/modules/4.19.0-12-2-amd64/extra diff --git a/platform/broadcom/saibcm-modules/debian/rules b/platform/broadcom/saibcm-modules/debian/rules index 64cc9b6c07e0..572471027c87 100755 --- a/platform/broadcom/saibcm-modules/debian/rules +++ b/platform/broadcom/saibcm-modules/debian/rules @@ -34,8 +34,8 @@ sname:=opennsl PACKAGE=opennsl-modules # modifieable for experiments or debugging m-a MA_DIR ?= /usr/share/modass -KVERSION ?= 4.19.0-9-2-amd64 -KERNVERSION ?= 4.19.0-9-2 +KVERSION ?= 4.19.0-12-2-amd64 +KERNVERSION ?= 4.19.0-12-2 # load generic variable handling -include $(MA_DIR)/include/generic.make @@ -67,6 +67,9 @@ kdist_clean: clean KERNDIR=/usr/src/linux-headers-$(KERNVERSION)-common \ KERNEL_SRC=/usr/src/linux-headers-$(KERNVERSION)-amd64 \ $(MAKE) -C systems/linux/user/x86-smp_generic_64-2_6 clean + SDK=$(realpath .) BUILD_KNET_CB=1 BUILD_PSAMPLE=1 \ + KDIR=/usr/src/linux-headers-$(KERNVERSION)-common \ + $(MAKE) -C sdklt/ clean # rm -f driver/*.o driver/*.ko # ### end KERNEL SETUP @@ -100,6 +103,10 @@ build-arch-stamp: KERNEL_SRC=/usr/src/linux-headers-$(KERNVERSION)-amd64 \ $(MAKE) -C systems/linux/user/x86-smp_generic_64-2_6 + SDK=$(realpath .) BUILD_KNET_CB=1 BUILD_PSAMPLE=1 \ + KDIR=/usr/src/linux-headers-$(KERNVERSION)-common \ + $(MAKE) -C sdklt/ kmod + touch $@ #k = $(shell echo $(KVERS) | grep -q ^2.6 && echo k) @@ -128,6 +135,10 @@ clean: KERNEL_SRC=/usr/src/linux-headers-$(KERNVERSION)-amd64 \ $(MAKE) -C systems/linux/user/x86-smp_generic_64-2_6 clean + SDK=$(realpath .) BUILD_KNET_CB=1 BUILD_PSAMPLE=1 \ + KDIR=/usr/src/linux-headers-$(KERNVERSION)-common \ + $(MAKE) -C sdklt/ clean + dh_clean install: DH_OPTIONS= diff --git a/platform/broadcom/saibcm-modules/include/ibde.h b/platform/broadcom/saibcm-modules/include/ibde.h index 5f371b2667c3..fb9d13d1d5fe 100644 --- a/platform/broadcom/saibcm-modules/include/ibde.h +++ b/platform/broadcom/saibcm-modules/include/ibde.h @@ -1,5 +1,10 @@ /* - * Copyright 2017 Broadcom + * Copyright 2007-2020 Broadcom Inc. All rights reserved. + * + * Permission is granted to use, copy, modify and/or distribute this + * software under either one of the licenses below. + * + * License Option 1: GPL * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License, version 2, as @@ -12,6 +17,12 @@ * * You should have received a copy of the GNU General Public License * version 2 (GPLv2) along with this source code. + * + * + * License Option 2: Broadcom Open Network Switch APIs (OpenNSA) license + * + * This software is governed by the Broadcom Open Network Switch APIs license: + * https://www.broadcom.com/products/ethernet-connectivity/software/opennsa */ /* * $Id: ibde.h,v 1.27 Broadcom SDK $ diff --git a/platform/broadcom/saibcm-modules/include/kcom.h b/platform/broadcom/saibcm-modules/include/kcom.h index eb41e1a5aaf2..5129400ca8cd 100644 --- a/platform/broadcom/saibcm-modules/include/kcom.h +++ b/platform/broadcom/saibcm-modules/include/kcom.h @@ -1,5 +1,10 @@ /* - * Copyright 2017 Broadcom + * Copyright 2007-2020 Broadcom Inc. All rights reserved. + * + * Permission is granted to use, copy, modify and/or distribute this + * software under either one of the licenses below. + * + * License Option 1: GPL * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License, version 2, as @@ -12,6 +17,12 @@ * * You should have received a copy of the GNU General Public License * version 2 (GPLv2) along with this source code. + * + * + * License Option 2: Broadcom Open Network Switch APIs (OpenNSA) license + * + * This software is governed by the Broadcom Open Network Switch APIs license: + * https://www.broadcom.com/products/ethernet-connectivity/software/opennsa */ /* * $Id: kcom.h,v 1.9 Broadcom SDK $ @@ -341,6 +352,8 @@ typedef struct kcom_msg_version_s { #define KSYNC_M_HW_DEINIT 1 #define KSYNC_M_VERSION 2 #define KSYNC_M_HW_TS_DISABLE 3 +#define KSYNC_M_MTP_TS_UPDATE_ENABLE 4 +#define KSYNC_M_MTP_TS_UPDATE_DISABLE 5 typedef struct kcom_clock_info_s { uint8 cmd; diff --git a/platform/broadcom/saibcm-modules/include/sal/core/sync.h b/platform/broadcom/saibcm-modules/include/sal/core/sync.h index 75dd6ce68312..03fd2facc907 100644 --- a/platform/broadcom/saibcm-modules/include/sal/core/sync.h +++ b/platform/broadcom/saibcm-modules/include/sal/core/sync.h @@ -1,5 +1,10 @@ /* - * Copyright 2017 Broadcom + * Copyright 2007-2020 Broadcom Inc. All rights reserved. + * + * Permission is granted to use, copy, modify and/or distribute this + * software under either one of the licenses below. + * + * License Option 1: GPL * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License, version 2, as @@ -12,6 +17,12 @@ * * You should have received a copy of the GNU General Public License * version 2 (GPLv2) along with this source code. + * + * + * License Option 2: Broadcom Open Network Switch APIs (OpenNSA) license + * + * This software is governed by the Broadcom Open Network Switch APIs license: + * https://www.broadcom.com/products/ethernet-connectivity/software/opennsa */ /* * $Id: sync.h,v 1.1 Broadcom SDK $ diff --git a/platform/broadcom/saibcm-modules/include/sal/core/thread.h b/platform/broadcom/saibcm-modules/include/sal/core/thread.h index b7ecb722489f..86713d1e0742 100644 --- a/platform/broadcom/saibcm-modules/include/sal/core/thread.h +++ b/platform/broadcom/saibcm-modules/include/sal/core/thread.h @@ -1,5 +1,10 @@ /* - * Copyright 2017 Broadcom + * Copyright 2007-2020 Broadcom Inc. All rights reserved. + * + * Permission is granted to use, copy, modify and/or distribute this + * software under either one of the licenses below. + * + * License Option 1: GPL * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License, version 2, as @@ -12,6 +17,12 @@ * * You should have received a copy of the GNU General Public License * version 2 (GPLv2) along with this source code. + * + * + * License Option 2: Broadcom Open Network Switch APIs (OpenNSA) license + * + * This software is governed by the Broadcom Open Network Switch APIs license: + * https://www.broadcom.com/products/ethernet-connectivity/software/opennsa */ /* * $Id: thread.h,v 1.1 Broadcom SDK $ diff --git a/platform/broadcom/saibcm-modules/include/sal/types.h b/platform/broadcom/saibcm-modules/include/sal/types.h index 7ed68f43e5e5..43d64dbcc6b9 100644 --- a/platform/broadcom/saibcm-modules/include/sal/types.h +++ b/platform/broadcom/saibcm-modules/include/sal/types.h @@ -1,5 +1,10 @@ /* - * Copyright 2017 Broadcom + * Copyright 2007-2020 Broadcom Inc. All rights reserved. + * + * Permission is granted to use, copy, modify and/or distribute this + * software under either one of the licenses below. + * + * License Option 1: GPL * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License, version 2, as @@ -12,6 +17,12 @@ * * You should have received a copy of the GNU General Public License * version 2 (GPLv2) along with this source code. + * + * + * License Option 2: Broadcom Open Network Switch APIs (OpenNSA) license + * + * This software is governed by the Broadcom Open Network Switch APIs license: + * https://www.broadcom.com/products/ethernet-connectivity/software/opennsa */ /* * $Id: types.h,v 1.3 Broadcom SDK $ diff --git a/platform/broadcom/saibcm-modules/include/sdk_config.h b/platform/broadcom/saibcm-modules/include/sdk_config.h index 9d781114bdf3..6ce7d77d52d0 100644 --- a/platform/broadcom/saibcm-modules/include/sdk_config.h +++ b/platform/broadcom/saibcm-modules/include/sdk_config.h @@ -1,5 +1,10 @@ /* - * Copyright 2017 Broadcom + * Copyright 2007-2020 Broadcom Inc. All rights reserved. + * + * Permission is granted to use, copy, modify and/or distribute this + * software under either one of the licenses below. + * + * License Option 1: GPL * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License, version 2, as @@ -12,6 +17,12 @@ * * You should have received a copy of the GNU General Public License * version 2 (GPLv2) along with this source code. + * + * + * License Option 2: Broadcom Open Network Switch APIs (OpenNSA) license + * + * This software is governed by the Broadcom Open Network Switch APIs license: + * https://www.broadcom.com/products/ethernet-connectivity/software/opennsa */ /* * $Id: sdk_config.h,v 1.5 Broadcom SDK $ diff --git a/platform/broadcom/saibcm-modules/include/soc/devids.h b/platform/broadcom/saibcm-modules/include/soc/devids.h index bb91d90be03f..89fabac44537 100644 --- a/platform/broadcom/saibcm-modules/include/soc/devids.h +++ b/platform/broadcom/saibcm-modules/include/soc/devids.h @@ -1,5 +1,10 @@ /* - * Copyright 2017 Broadcom + * Copyright 2007-2020 Broadcom Inc. All rights reserved. + * + * Permission is granted to use, copy, modify and/or distribute this + * software under either one of the licenses below. + * + * License Option 1: GPL * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License, version 2, as @@ -12,6 +17,12 @@ * * You should have received a copy of the GNU General Public License * version 2 (GPLv2) along with this source code. + * + * + * License Option 2: Broadcom Open Network Switch APIs (OpenNSA) license + * + * This software is governed by the Broadcom Open Network Switch APIs license: + * https://www.broadcom.com/products/ethernet-connectivity/software/opennsa */ /* * Copyright: (c) 2020 Broadcom. @@ -1274,6 +1285,18 @@ #define BCM56278_A0_REV_ID 1 #define BCM56278_A1_REV_ID 2 +#define BCM56279_DEVICE_ID 0xb279 +#define BCM56279_A1_REV_ID 2 + +#define BCM56575_DEVICE_ID 0xb575 +#define BCM56575_A1_REV_ID 2 + +#define BCM56175_DEVICE_ID 0xb175 +#define BCM56175_A1_REV_ID 2 + +#define BCM56176_DEVICE_ID 0xb176 +#define BCM56176_A1_REV_ID 2 + #define BCM53440_DEVICE_ID 0x8440 #define BCM53440_A0_REV_ID 1 #define BCM53440_B0_REV_ID 0x11 @@ -1404,6 +1427,8 @@ #define BCM56070_A0_REV_ID 1 #define BCM56071_DEVICE_ID 0xb071 #define BCM56071_A0_REV_ID 1 +#define BCM56072_DEVICE_ID 0xb072 +#define BCM56072_A0_REV_ID 1 #define BCM56965_DEVICE_ID 0xb965 @@ -1499,6 +1524,8 @@ #define BCM56471_A0_REV_ID 1 #define BCM56472_DEVICE_ID 0xb472 #define BCM56472_A0_REV_ID 1 +#define BCM56475_DEVICE_ID 0xb475 +#define BCM56475_A0_REV_ID 1 #define BCM53540_DEVICE_ID 0x8540 @@ -1537,19 +1564,6 @@ #define BCM88650_A0_REV_ID ARAD_A0_REV_ID #define BCM88650_B0_REV_ID ARAD_B0_REV_ID #define BCM88650_B1_REV_ID ARAD_B1_REV_ID -#define BCM88750_DEVICE_ID 0x8750 -#define BCM88750_A0_REV_ID 0x0000 -#define BCM88750_B0_REV_ID 0x0011 -#define BCM88753_DEVICE_ID 0x8753 -#define BCM88753_A0_REV_ID 0x0000 -#define BCM88753_B0_REV_ID 0x0011 -#define BCM88754_DEVICE_ID 0x8754 -#define BCM88754_A0_REV_ID 0x0000 -#define BCM88754_ORIGINAL_VENDOR_ID 0x16FC -#define BCM88754_ORIGINAL_DEVICE_ID 0x020F -#define BCM88754_A0_ORIGINAL_REV_ID 0x0001 -#define BCM88755_DEVICE_ID 0x8755 -#define BCM88755_B0_REV_ID 0x0011 #define BCM88770_DEVICE_ID 0x8770 #define BCM88770_A1_REV_ID 0x0002 #define BCM88773_DEVICE_ID 0x8773 @@ -1767,22 +1781,57 @@ #define BCM88820_DEVICE_ID J2C_2ND_DEVICE_ID #define BCM88800_A0_REV_ID J2C_A0_REV_ID #define BCM88800_A1_REV_ID J2C_A1_REV_ID -#define BCM88821_DEVICE_ID 0x8821 -#define BCM88826_DEVICE_ID 0x8826 +#define BCM88801_DEVICE_ID 0x8801 #define BCM88802_DEVICE_ID 0x8802 #define BCM88803_DEVICE_ID 0x8803 #define BCM88804_DEVICE_ID 0x8804 #define BCM88805_DEVICE_ID 0x8805 #define BCM88806_DEVICE_ID 0x8806 +#define BCM88807_DEVICE_ID 0x8807 +#define BCM88808_DEVICE_ID 0x8808 +#define BCM88809_DEVICE_ID 0x8809 +#define BCM8880A_DEVICE_ID 0x880A +#define BCM8880B_DEVICE_ID 0x880B +#define BCM8880C_DEVICE_ID 0x880C +#define BCM8880D_DEVICE_ID 0x880D +#define BCM8880E_DEVICE_ID 0x880E +#define BCM8880F_DEVICE_ID 0x880F +#define BCM88821_DEVICE_ID 0x8821 #define BCM88822_DEVICE_ID 0x8822 #define BCM88823_DEVICE_ID 0x8823 #define BCM88824_DEVICE_ID 0x8824 #define BCM88825_DEVICE_ID 0x8825 +#define BCM88826_DEVICE_ID 0x8826 +#define BCM88827_DEVICE_ID 0x8827 +#define BCM88828_DEVICE_ID 0x8828 +#define BCM88829_DEVICE_ID 0x8829 +#define BCM8882A_DEVICE_ID 0x882A +#define BCM8882B_DEVICE_ID 0x882B +#define BCM8882C_DEVICE_ID 0x882C +#define BCM8882D_DEVICE_ID 0x882D +#define BCM8882E_DEVICE_ID 0x882E +#define BCM8882F_DEVICE_ID 0x882F #define J2P_DEVICE_ID 0x8850 #define J2P_A0_REV_ID DNXC_A0_REV_ID #define BCM88850_DEVICE_ID J2P_DEVICE_ID #define BCM88850_A0_REV_ID J2P_A0_REV_ID +#define BCM88851_DEVICE_ID 0x8851 +#define BCM88852_DEVICE_ID 0x8852 +#define BCM88853_DEVICE_ID 0x8853 +#define BCM88854_DEVICE_ID 0x8854 +#define BCM88855_DEVICE_ID 0x8855 +#define BCM88856_DEVICE_ID 0x8856 +#define BCM88857_DEVICE_ID 0x8857 +#define BCM88858_DEVICE_ID 0x8858 +#define BCM88859_DEVICE_ID 0x8859 +#define BCM8885A_DEVICE_ID 0x885A +#define BCM8885B_DEVICE_ID 0x885B +#define BCM8885C_DEVICE_ID 0x885C +#define BCM8885D_DEVICE_ID 0x885D +#define BCM8885E_DEVICE_ID 0x885E +#define BCM8885F_DEVICE_ID 0x885F + #define Q2A_DEVICE_ID 0x8480 #define Q2A_A0_REV_ID DNXC_A0_REV_ID @@ -1808,6 +1857,24 @@ #define BCM8848E_DEVICE_ID 0x848E #define BCM8848F_DEVICE_ID 0x848F +#define Q2U_DEVICE_ID 0x8280 +#define BCM88280_DEVICE_ID Q2U_DEVICE_ID +#define BCM88281_DEVICE_ID 0x8281 +#define BCM88282_DEVICE_ID 0x8282 +#define BCM88283_DEVICE_ID 0x8283 +#define BCM88284_DEVICE_ID 0x8284 +#define BCM88285_DEVICE_ID 0x8285 +#define BCM88286_DEVICE_ID 0x8286 +#define BCM88287_DEVICE_ID 0x8287 +#define BCM88288_DEVICE_ID 0x8288 +#define BCM88289_DEVICE_ID 0x8289 +#define BCM8828A_DEVICE_ID 0x828A +#define BCM8828B_DEVICE_ID 0x828B +#define BCM8828C_DEVICE_ID 0x828C +#define BCM8828D_DEVICE_ID 0x828D +#define BCM8828E_DEVICE_ID 0x828E +#define BCM8828F_DEVICE_ID 0x828F + #define QAX_DEVICE_ID 0x8470 #define QAX_A0_REV_ID 0x0001 #define QAX_B0_REV_ID 0x0011 @@ -1833,9 +1900,11 @@ #define BCM88270_DEVICE_ID QUX_DEVICE_ID #define BCM88270_A0_REV_ID QUX_A0_REV_ID #define BCM88270_A1_REV_ID QUX_A1_REV_ID +#define BCM88271_DEVICE_ID 0x8271 #define BCM88272_DEVICE_ID 0x8272 #define BCM88273_DEVICE_ID 0x8273 #define BCM88274_DEVICE_ID 0x8274 +#define BCM88276_DEVICE_ID 0x8276 #define BCM88278_DEVICE_ID 0x8278 #define BCM88279_DEVICE_ID 0x8279 @@ -1844,16 +1913,6 @@ #define BCM8206_DEVICE_ID FLAIR_DEVICE_ID #define BCM8206_A0_REV_ID FLAIR_A0_REV_ID -#define ARDON_DEVICE_ID 0x8202 -#define ARDON_A0_REV_ID 0x0000 -#define BCM88202_DEVICE_ID ARDON_DEVICE_ID -#define BCM88202_A0_REV_ID ARDON_A0_REV_ID -#define ARDON_A1_REV_ID 0x0001 -#define BCM88202_A1_REV_ID ARDON_A1_REV_ID -#define ARDON_A2_REV_ID 0x0002 -#define BCM88202_A2_REV_ID ARDON_A2_REV_ID -#define BCM2801PM_DEVICE_ID 0x2801 -#define BCM2801PM_A0_REV_ID 0x0000 #define BCM88360_DEVICE_ID 0x8360 #define BCM88360_A0_REV_ID ARADPLUS_A0_REV_ID #define BCM88361_DEVICE_ID 0x8361 @@ -1901,16 +1960,6 @@ #define BCM88952_A0_REV_ID 0x0001 #define BCM88952_A1_REV_ID 0x0002 -#define BCM88752_DEVICE_ID 0x8752 -#define BCM88752_A0_REV_ID 0x0000 -#define BCM88752_B0_REV_ID 0x0011 - - -#define BCM83207_DEVICE_ID 0x3207 -#define BCM83208_DEVICE_ID 0x3208 -#define BCM83207_A0_REV_ID 0x0001 -#define BCM83208_A0_REV_ID 1 - #define PCP_PCI_VENDOR_ID 0x1172 #define PCP_PCI_DEVICE_ID 0x4 @@ -1930,7 +1979,33 @@ #define BCM56883_DEVICE_ID 0xb883 #define BCM56883_A0_REV_ID 0x0001 #define BCM56883_B0_REV_ID 0x0011 - +#define BCM56889_DEVICE_ID 0xb889 +#define BCM56889_A0_REV_ID 0x0001 +#define BCM56889_B0_REV_ID 0x0011 + +#define BCM56780_DEVICE_ID 0xb780 +#define BCM56780_A0_REV_ID 0x0001 +#define BCM56782_DEVICE_ID 0xb782 +#define BCM56782_A0_REV_ID 0x0001 +#define BCM56784_DEVICE_ID 0xb784 +#define BCM56784_A0_REV_ID 0x0001 +#define BCM56786_DEVICE_ID 0xb786 +#define BCM56786_A0_REV_ID 0x0001 +#define BCM56788_DEVICE_ID 0xb788 +#define BCM56788_A0_REV_ID 0x0001 +#define BCM56789_DEVICE_ID 0xb789 +#define BCM56789_A0_REV_ID 0x0001 + +#define BCM56990_DEVICE_ID 0xb990 +#define BCM56990_A0_REV_ID 0x0001 +#define BCM56990_B0_REV_ID 0x0011 +#define BCM56992_DEVICE_ID 0xb992 +#define BCM56992_B0_REV_ID 0x0011 + +#define BCM56996_DEVICE_ID 0xb996 +#define BCM56996_A0_REV_ID 0x0001 +#define BCM56997_DEVICE_ID 0xb997 +#define BCM56997_A0_REV_ID 0x0001 #endif #endif diff --git a/platform/broadcom/saibcm-modules/make/Make.config b/platform/broadcom/saibcm-modules/make/Make.config index 409a6a49b3f3..17c4c7f66fc3 100644 --- a/platform/broadcom/saibcm-modules/make/Make.config +++ b/platform/broadcom/saibcm-modules/make/Make.config @@ -1,5 +1,10 @@ # -# Copyright 2017 Broadcom +# Copyright 2007-2020 Broadcom Inc. All rights reserved. +# +# Permission is granted to use, copy, modify and/or distribute this +# software under either one of the licenses below. +# +# License Option 1: GPL # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License, version 2, as @@ -12,6 +17,12 @@ # # You should have received a copy of the GNU General Public License # version 2 (GPLv2) along with this source code. +# +# +# License Option 2: Broadcom Open Network Switch APIs (OpenNSA) license +# +# This software is governed by the Broadcom Open Network Switch APIs license: +# https://www.broadcom.com/products/ethernet-connectivity/software/opennsa # # $Id: Make.config,v 1.3 Broadcom SDK $ # $Copyright: (c) 2005 Broadcom Corp. @@ -163,6 +174,9 @@ CPPFLAGS += ${INCFLAGS} CFLAGS += -DSAI_FIXUP -UKCOM_FILTER_MAX -DKCOM_FILTER_MAX=1024 +# Flag to enable multi instance support +CFLAGS += -DBCM_INSTANCE_SUPPORT + # # Debug #ifdef control # diff --git a/platform/broadcom/saibcm-modules/make/Make.depend b/platform/broadcom/saibcm-modules/make/Make.depend index de7099387666..802f5f4483c2 100644 --- a/platform/broadcom/saibcm-modules/make/Make.depend +++ b/platform/broadcom/saibcm-modules/make/Make.depend @@ -1,5 +1,10 @@ # -# Copyright 2017 Broadcom +# Copyright 2007-2020 Broadcom Inc. All rights reserved. +# +# Permission is granted to use, copy, modify and/or distribute this +# software under either one of the licenses below. +# +# License Option 1: GPL # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License, version 2, as @@ -12,6 +17,12 @@ # # You should have received a copy of the GNU General Public License # version 2 (GPLv2) along with this source code. +# +# +# License Option 2: Broadcom Open Network Switch APIs (OpenNSA) license +# +# This software is governed by the Broadcom Open Network Switch APIs license: +# https://www.broadcom.com/products/ethernet-connectivity/software/opennsa # # $Id: Make.depend,v 1.14 Broadcom SDK $ # $Copyright: (c) 2005 Broadcom Corp. diff --git a/platform/broadcom/saibcm-modules/make/Make.kernlib b/platform/broadcom/saibcm-modules/make/Make.kernlib index 6ec8a1c8df77..94801acd4a69 100644 --- a/platform/broadcom/saibcm-modules/make/Make.kernlib +++ b/platform/broadcom/saibcm-modules/make/Make.kernlib @@ -1,5 +1,10 @@ # -# Copyright 2017 Broadcom +# Copyright 2007-2020 Broadcom Inc. All rights reserved. +# +# Permission is granted to use, copy, modify and/or distribute this +# software under either one of the licenses below. +# +# License Option 1: GPL # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License, version 2, as @@ -12,6 +17,12 @@ # # You should have received a copy of the GNU General Public License # version 2 (GPLv2) along with this source code. +# +# +# License Option 2: Broadcom Open Network Switch APIs (OpenNSA) license +# +# This software is governed by the Broadcom Open Network Switch APIs license: +# https://www.broadcom.com/products/ethernet-connectivity/software/opennsa # # $Id: Make.kernlib,v 1.7 Broadcom SDK $ # $Copyright: (c) 2005 Broadcom Corp. diff --git a/platform/broadcom/saibcm-modules/make/Make.lib b/platform/broadcom/saibcm-modules/make/Make.lib index d67325c5dd2f..ac81cc134f6d 100644 --- a/platform/broadcom/saibcm-modules/make/Make.lib +++ b/platform/broadcom/saibcm-modules/make/Make.lib @@ -1,5 +1,10 @@ # -# Copyright 2017 Broadcom +# Copyright 2007-2020 Broadcom Inc. All rights reserved. +# +# Permission is granted to use, copy, modify and/or distribute this +# software under either one of the licenses below. +# +# License Option 1: GPL # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License, version 2, as @@ -12,6 +17,12 @@ # # You should have received a copy of the GNU General Public License # version 2 (GPLv2) along with this source code. +# +# +# License Option 2: Broadcom Open Network Switch APIs (OpenNSA) license +# +# This software is governed by the Broadcom Open Network Switch APIs license: +# https://www.broadcom.com/products/ethernet-connectivity/software/opennsa # # $Id: Make.lib,v 1.14 Broadcom SDK $ # $Copyright: (c) 2005 Broadcom Corp. @@ -62,7 +73,7 @@ endif ifeq ($(LINUX_MAKE_SHARED_LIB),1) $(CC) -shared -Wl,-soname,${lib}.${LIBSUFFIX}${EXTRA_LIB_LDFLAGS} -o ${targetlib} ${BOBJS} -lc else - ${Q}cd $(dir $(word 1,${BOBJS}));$(AR) ${ARFLAGS} $@ $(sort $(notdir ${BOBJS})) + $(AR) ${ARFLAGS} $@ $(sort ${BOBJS}) endif endif # !Borland diff --git a/platform/broadcom/saibcm-modules/make/Make.linux b/platform/broadcom/saibcm-modules/make/Make.linux index 81e88daf16bc..ad18872a34eb 100644 --- a/platform/broadcom/saibcm-modules/make/Make.linux +++ b/platform/broadcom/saibcm-modules/make/Make.linux @@ -1,5 +1,10 @@ # -# Copyright 2017 Broadcom +# Copyright 2007-2020 Broadcom Inc. All rights reserved. +# +# Permission is granted to use, copy, modify and/or distribute this +# software under either one of the licenses below. +# +# License Option 1: GPL # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License, version 2, as @@ -12,6 +17,12 @@ # # You should have received a copy of the GNU General Public License # version 2 (GPLv2) along with this source code. +# +# +# License Option 2: Broadcom Open Network Switch APIs (OpenNSA) license +# +# This software is governed by the Broadcom Open Network Switch APIs license: +# https://www.broadcom.com/products/ethernet-connectivity/software/opennsa # # # $Id: Make.linux,v 1.18 Broadcom SDK $ @@ -85,7 +96,7 @@ endif build: $(MAKE) $(CMD) -DELIVER clean C_COMPILER CXX_COMPILER variable mod bcm user issu: +DELIVER clean C_COMPILER CXX_COMPILER variable mod bcm user issu libopennsa: $(MAKE) $(CMD) $@ clean_d: clean diff --git a/platform/broadcom/saibcm-modules/make/Make.subdirs b/platform/broadcom/saibcm-modules/make/Make.subdirs index 1033e296c0a3..374d817d212d 100644 --- a/platform/broadcom/saibcm-modules/make/Make.subdirs +++ b/platform/broadcom/saibcm-modules/make/Make.subdirs @@ -1,5 +1,10 @@ # -# Copyright 2017 Broadcom +# Copyright 2007-2020 Broadcom Inc. All rights reserved. +# +# Permission is granted to use, copy, modify and/or distribute this +# software under either one of the licenses below. +# +# License Option 1: GPL # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License, version 2, as @@ -12,6 +17,12 @@ # # You should have received a copy of the GNU General Public License # version 2 (GPLv2) along with this source code. +# +# +# License Option 2: Broadcom Open Network Switch APIs (OpenNSA) license +# +# This software is governed by the Broadcom Open Network Switch APIs license: +# https://www.broadcom.com/products/ethernet-connectivity/software/opennsa # # $Id: Make.subdirs,v 1.8 Broadcom SDK $ # $Copyright: (c) 2005 Broadcom Corp. diff --git a/platform/broadcom/saibcm-modules/make/Make.tools b/platform/broadcom/saibcm-modules/make/Make.tools index 8ed77727fef2..0d55eb2e653a 100644 --- a/platform/broadcom/saibcm-modules/make/Make.tools +++ b/platform/broadcom/saibcm-modules/make/Make.tools @@ -1,5 +1,10 @@ # -# Copyright 2017 Broadcom +# Copyright 2007-2020 Broadcom Inc. All rights reserved. +# +# Permission is granted to use, copy, modify and/or distribute this +# software under either one of the licenses below. +# +# License Option 1: GPL # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License, version 2, as @@ -12,6 +17,12 @@ # # You should have received a copy of the GNU General Public License # version 2 (GPLv2) along with this source code. +# +# +# License Option 2: Broadcom Open Network Switch APIs (OpenNSA) license +# +# This software is governed by the Broadcom Open Network Switch APIs license: +# https://www.broadcom.com/products/ethernet-connectivity/software/opennsa # # $Id: Make.tools,v 1.2 Broadcom SDK $ # $Copyright: (c) 2005 Broadcom Corp. diff --git a/platform/broadcom/saibcm-modules/make/Makefile.linux-gts b/platform/broadcom/saibcm-modules/make/Makefile.linux-gts index ddc94afa13fe..726dfdf505bd 100644 --- a/platform/broadcom/saibcm-modules/make/Makefile.linux-gts +++ b/platform/broadcom/saibcm-modules/make/Makefile.linux-gts @@ -1,5 +1,10 @@ # -# Copyright 2017 Broadcom +# Copyright 2007-2020 Broadcom Inc. All rights reserved. +# +# Permission is granted to use, copy, modify and/or distribute this +# software under either one of the licenses below. +# +# License Option 1: GPL # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License, version 2, as @@ -12,6 +17,12 @@ # # You should have received a copy of the GNU General Public License # version 2 (GPLv2) along with this source code. +# +# +# License Option 2: Broadcom Open Network Switch APIs (OpenNSA) license +# +# This software is governed by the Broadcom Open Network Switch APIs license: +# https://www.broadcom.com/products/ethernet-connectivity/software/opennsa # # $Id: Makefile.linux-xlr-4_19,v 0.1 Broadcom SDK $ # $Copyright: (c) 2015 Broadcom Corp. @@ -37,6 +48,8 @@ # some basic path variables for tools and kernel source, etc # export XLR_TOOLS_BASE = /projects/ntsw-tools/linux/xlr-419 TOOLCHAIN_DIR = $(XLR_TOOLS_BASE)/buildroot/host/usr +# Target machine for EDK-Host defconfig +TARGET_MACHINE ?= x86_64 KERNDIR = $(XLR_TOOLS_BASE)/kernel/linux # set up cross compile prefix, tools dir variables. # @@ -125,12 +138,21 @@ OPENSRC_BUILD ?= fed21-x86_64 # Hardware interface (see $SDKLT/bcma/sys/probe directory) SYSTEM_INTERFACE ?= ngbde +# Support BCMSIM in the same build +ifeq (1,$(BCM_SIM_PATH_SUPPORT)) +EXTRA_SYSTEM_INTERFACES = plisim +endif + # Turn on direct register access if running on real hardware. ifeq (ngbde,$(SYSTEM_INTERFACE)) +# Except if using multiple probe interfaces +ifeq (,$(EXTRA_SYSTEM_INTERFACES)) LTSW_ADD_CPPFLAGS += -DBCMDRD_CONFIG_MEMMAP_DIRECT=1 endif +endif export SYSTEM_INTERFACE +export EXTRA_SYSTEM_INTERFACES endif ifneq ($(targetplat),user) diff --git a/platform/broadcom/saibcm-modules/make/Makefile.linux-iproc b/platform/broadcom/saibcm-modules/make/Makefile.linux-iproc index 7d8adb98de38..fa4911185aa8 100644 --- a/platform/broadcom/saibcm-modules/make/Makefile.linux-iproc +++ b/platform/broadcom/saibcm-modules/make/Makefile.linux-iproc @@ -1,5 +1,10 @@ # -# Copyright 2017 Broadcom +# Copyright 2007-2020 Broadcom Inc. All rights reserved. +# +# Permission is granted to use, copy, modify and/or distribute this +# software under either one of the licenses below. +# +# License Option 1: GPL # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License, version 2, as @@ -12,6 +17,12 @@ # # You should have received a copy of the GNU General Public License # version 2 (GPLv2) along with this source code. +# +# +# License Option 2: Broadcom Open Network Switch APIs (OpenNSA) license +# +# This software is governed by the Broadcom Open Network Switch APIs license: +# https://www.broadcom.com/products/ethernet-connectivity/software/opennsa # # $Id: Makefile.linux-iproc Exp $ # $Copyright: (c) 2007 Broadcom Corp. diff --git a/platform/broadcom/saibcm-modules/make/Makefile.linux-iproc-3_14 b/platform/broadcom/saibcm-modules/make/Makefile.linux-iproc-3_14 index 723fea6c73cf..8d9f66aa50a0 100644 --- a/platform/broadcom/saibcm-modules/make/Makefile.linux-iproc-3_14 +++ b/platform/broadcom/saibcm-modules/make/Makefile.linux-iproc-3_14 @@ -1,5 +1,10 @@ # -# Copyright 2017 Broadcom +# Copyright 2007-2020 Broadcom Inc. All rights reserved. +# +# Permission is granted to use, copy, modify and/or distribute this +# software under either one of the licenses below. +# +# License Option 1: GPL # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License, version 2, as @@ -12,6 +17,12 @@ # # You should have received a copy of the GNU General Public License # version 2 (GPLv2) along with this source code. +# +# +# License Option 2: Broadcom Open Network Switch APIs (OpenNSA) license +# +# This software is governed by the Broadcom Open Network Switch APIs license: +# https://www.broadcom.com/products/ethernet-connectivity/software/opennsa # # $Id: Makefile.linux-iproc-3_6,v 1.1 Broadcom SDK $ # $Copyright: (c) 2007 Broadcom Corp. diff --git a/platform/broadcom/saibcm-modules/make/Makefile.linux-iproc-4_4 b/platform/broadcom/saibcm-modules/make/Makefile.linux-iproc-4_4 index df31f84e9d8f..bcef1ff69dd4 100644 --- a/platform/broadcom/saibcm-modules/make/Makefile.linux-iproc-4_4 +++ b/platform/broadcom/saibcm-modules/make/Makefile.linux-iproc-4_4 @@ -1,5 +1,10 @@ # -# Copyright 2017 Broadcom +# Copyright 2007-2020 Broadcom Inc. All rights reserved. +# +# Permission is granted to use, copy, modify and/or distribute this +# software under either one of the licenses below. +# +# License Option 1: GPL # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License, version 2, as @@ -12,6 +17,12 @@ # # You should have received a copy of the GNU General Public License # version 2 (GPLv2) along with this source code. +# +# +# License Option 2: Broadcom Open Network Switch APIs (OpenNSA) license +# +# This software is governed by the Broadcom Open Network Switch APIs license: +# https://www.broadcom.com/products/ethernet-connectivity/software/opennsa # # $Id: Makefile.linux-iproc Exp $ # $Copyright: (c) 2007 Broadcom Corp. diff --git a/platform/broadcom/saibcm-modules/make/Makefile.linux-iproc_64 b/platform/broadcom/saibcm-modules/make/Makefile.linux-iproc_64 index dbccd7e25734..247da7386370 100644 --- a/platform/broadcom/saibcm-modules/make/Makefile.linux-iproc_64 +++ b/platform/broadcom/saibcm-modules/make/Makefile.linux-iproc_64 @@ -1,5 +1,10 @@ # -# Copyright 2017 Broadcom +# Copyright 2007-2020 Broadcom Inc. All rights reserved. +# +# Permission is granted to use, copy, modify and/or distribute this +# software under either one of the licenses below. +# +# License Option 1: GPL # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License, version 2, as @@ -12,6 +17,12 @@ # # You should have received a copy of the GNU General Public License # version 2 (GPLv2) along with this source code. +# +# +# License Option 2: Broadcom Open Network Switch APIs (OpenNSA) license +# +# This software is governed by the Broadcom Open Network Switch APIs license: +# https://www.broadcom.com/products/ethernet-connectivity/software/opennsa # # $Id: Makefile.linux-iproc Exp $ # $Copyright: (c) 2007 Broadcom Corp. diff --git a/platform/broadcom/saibcm-modules/make/Makefile.linux-kernel b/platform/broadcom/saibcm-modules/make/Makefile.linux-kernel index 7cbf8451f91e..ccb0c30d2acc 100644 --- a/platform/broadcom/saibcm-modules/make/Makefile.linux-kernel +++ b/platform/broadcom/saibcm-modules/make/Makefile.linux-kernel @@ -1,5 +1,10 @@ # -# Copyright 2017 Broadcom +# Copyright 2007-2020 Broadcom Inc. All rights reserved. +# +# Permission is granted to use, copy, modify and/or distribute this +# software under either one of the licenses below. +# +# License Option 1: GPL # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License, version 2, as @@ -12,6 +17,12 @@ # # You should have received a copy of the GNU General Public License # version 2 (GPLv2) along with this source code. +# +# +# License Option 2: Broadcom Open Network Switch APIs (OpenNSA) license +# +# This software is governed by the Broadcom Open Network Switch APIs license: +# https://www.broadcom.com/products/ethernet-connectivity/software/opennsa # # $Id: Makefile.linux-kernel,v 1.27 Broadcom SDK $ # $Copyright: (c) 2005 Broadcom Corp. diff --git a/platform/broadcom/saibcm-modules/make/Makefile.linux-kernel-2_6 b/platform/broadcom/saibcm-modules/make/Makefile.linux-kernel-2_6 index 559f2ae5e5e5..08461e4c4b7c 100644 --- a/platform/broadcom/saibcm-modules/make/Makefile.linux-kernel-2_6 +++ b/platform/broadcom/saibcm-modules/make/Makefile.linux-kernel-2_6 @@ -1,5 +1,10 @@ # -# Copyright 2017 Broadcom +# Copyright 2007-2020 Broadcom Inc. All rights reserved. +# +# Permission is granted to use, copy, modify and/or distribute this +# software under either one of the licenses below. +# +# License Option 1: GPL # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License, version 2, as @@ -12,6 +17,12 @@ # # You should have received a copy of the GNU General Public License # version 2 (GPLv2) along with this source code. +# +# +# License Option 2: Broadcom Open Network Switch APIs (OpenNSA) license +# +# This software is governed by the Broadcom Open Network Switch APIs license: +# https://www.broadcom.com/products/ethernet-connectivity/software/opennsa # # $Id: Makefile.linux-kernel-2_6,v 1.40 Broadcom SDK $ # $Copyright: (c) 2005 Broadcom Corp. diff --git a/platform/broadcom/saibcm-modules/make/Makefile.linux-kernel-3_6 b/platform/broadcom/saibcm-modules/make/Makefile.linux-kernel-3_6 index 0d54c4474fc8..528522ec4bd3 100644 --- a/platform/broadcom/saibcm-modules/make/Makefile.linux-kernel-3_6 +++ b/platform/broadcom/saibcm-modules/make/Makefile.linux-kernel-3_6 @@ -1,5 +1,10 @@ # -# Copyright 2017 Broadcom +# Copyright 2007-2020 Broadcom Inc. All rights reserved. +# +# Permission is granted to use, copy, modify and/or distribute this +# software under either one of the licenses below. +# +# License Option 1: GPL # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License, version 2, as @@ -12,6 +17,12 @@ # # You should have received a copy of the GNU General Public License # version 2 (GPLv2) along with this source code. +# +# +# License Option 2: Broadcom Open Network Switch APIs (OpenNSA) license +# +# This software is governed by the Broadcom Open Network Switch APIs license: +# https://www.broadcom.com/products/ethernet-connectivity/software/opennsa # # $Id: Makefile.linux-kernel-3_6,v 1.2 Broadcom SDK $ # $Copyright: (c) 2005 Broadcom Corp. diff --git a/platform/broadcom/saibcm-modules/make/Makefile.linux-kernel-4_4 b/platform/broadcom/saibcm-modules/make/Makefile.linux-kernel-4_4 index 0e8e22e1b32d..c02fc0edd89b 100644 --- a/platform/broadcom/saibcm-modules/make/Makefile.linux-kernel-4_4 +++ b/platform/broadcom/saibcm-modules/make/Makefile.linux-kernel-4_4 @@ -1,5 +1,10 @@ # -# Copyright 2017 Broadcom +# Copyright 2007-2020 Broadcom Inc. All rights reserved. +# +# Permission is granted to use, copy, modify and/or distribute this +# software under either one of the licenses below. +# +# License Option 1: GPL # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License, version 2, as @@ -12,6 +17,12 @@ # # You should have received a copy of the GNU General Public License # version 2 (GPLv2) along with this source code. +# +# +# License Option 2: Broadcom Open Network Switch APIs (OpenNSA) license +# +# This software is governed by the Broadcom Open Network Switch APIs license: +# https://www.broadcom.com/products/ethernet-connectivity/software/opennsa # # $Id: Makefile.linux-kernel-2_6,v 1.40 Broadcom SDK $ # $Copyright: (c) 2005 Broadcom Corp. diff --git a/platform/broadcom/saibcm-modules/make/Makefile.linux-kmodule b/platform/broadcom/saibcm-modules/make/Makefile.linux-kmodule index 540c497ea258..46caf00f20b5 100644 --- a/platform/broadcom/saibcm-modules/make/Makefile.linux-kmodule +++ b/platform/broadcom/saibcm-modules/make/Makefile.linux-kmodule @@ -1,5 +1,10 @@ # -# Copyright 2017 Broadcom +# Copyright 2007-2020 Broadcom Inc. All rights reserved. +# +# Permission is granted to use, copy, modify and/or distribute this +# software under either one of the licenses below. +# +# License Option 1: GPL # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License, version 2, as @@ -12,6 +17,12 @@ # # You should have received a copy of the GNU General Public License # version 2 (GPLv2) along with this source code. +# +# +# License Option 2: Broadcom Open Network Switch APIs (OpenNSA) license +# +# This software is governed by the Broadcom Open Network Switch APIs license: +# https://www.broadcom.com/products/ethernet-connectivity/software/opennsa # # $Id: Makefile.linux-kmodule-3_6,v 1.2 Broadcom SDK $ # $Copyright: (c) 2006 Broadcom Corp. @@ -61,6 +72,13 @@ KERNBLDDIR ?= $(KERNDIR) # kernel symbols. override EXTRA_CFLAGS = -I${SDK}/include -I${SDK}/systems/linux/kernel/modules/include -I${SDK}/systems/bde/linux/include +# +# If, for any reason, the definition of LD was erased, then +# set it, again. +# +ifeq ($(LD),) +LD = $(CROSS_COMPILE)ld +endif # The precopiled object needs a dummy command file to avoid warnings # from the Kbuild scripts (modpost stage). diff --git a/platform/broadcom/saibcm-modules/make/Makefile.linux-slk b/platform/broadcom/saibcm-modules/make/Makefile.linux-slk index 00131c2f2af9..656835019a05 100644 --- a/platform/broadcom/saibcm-modules/make/Makefile.linux-slk +++ b/platform/broadcom/saibcm-modules/make/Makefile.linux-slk @@ -1,5 +1,10 @@ # -# Copyright 2017 Broadcom +# Copyright 2007-2020 Broadcom Inc. All rights reserved. +# +# Permission is granted to use, copy, modify and/or distribute this +# software under either one of the licenses below. +# +# License Option 1: GPL # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License, version 2, as @@ -12,6 +17,12 @@ # # You should have received a copy of the GNU General Public License # version 2 (GPLv2) along with this source code. +# +# +# License Option 2: Broadcom Open Network Switch APIs (OpenNSA) license +# +# This software is governed by the Broadcom Open Network Switch APIs license: +# https://www.broadcom.com/products/ethernet-connectivity/software/opennsa # # $Id: Makefile.linux-slk-3_14,v 1.2 Broadcom SDK $ # $Copyright: (c) 2013 Broadcom Corp. @@ -27,11 +38,15 @@ endif ifeq (BE,$(ENDIAN_MODE)) TOOLCHAIN_BASE_DIR ?= /projects/ntsw-tools/toolchains/slk/linaro-be TARGET_ARCHITECTURE:=aarch64_be-linux-gnu +# Target machine for EDK-Host defconfig +TARGET_MACHINE ?= slk_be KERNDIR ?= /projects/ntsw-tools/linux/iproc_ldks/slk-be/poky/brcm-released-source/git else TOOLCHAIN_BASE_DIR ?= /projects/ntsw-tools/toolchains/slk/linaro-le # Compiler for target architecture TARGET_ARCHITECTURE:= aarch64-linux-gnu +# Target machine for EDK-Host defconfig +TARGET_MACHINE ?= slk_le # Kernel directory KERNDIR ?= /projects/ntsw-tools/linux/iproc_ldks/slk/poky/brcm-released-source/git endif diff --git a/platform/broadcom/saibcm-modules/make/Makefile.linux-x86-common-2_6 b/platform/broadcom/saibcm-modules/make/Makefile.linux-x86-common-2_6 index 25e953136bc0..dbd51ee1f627 100644 --- a/platform/broadcom/saibcm-modules/make/Makefile.linux-x86-common-2_6 +++ b/platform/broadcom/saibcm-modules/make/Makefile.linux-x86-common-2_6 @@ -1,5 +1,10 @@ # -# Copyright 2017 Broadcom +# Copyright 2007-2020 Broadcom Inc. All rights reserved. +# +# Permission is granted to use, copy, modify and/or distribute this +# software under either one of the licenses below. +# +# License Option 1: GPL # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License, version 2, as @@ -12,6 +17,12 @@ # # You should have received a copy of the GNU General Public License # version 2 (GPLv2) along with this source code. +# +# +# License Option 2: Broadcom Open Network Switch APIs (OpenNSA) license +# +# This software is governed by the Broadcom Open Network Switch APIs license: +# https://www.broadcom.com/products/ethernet-connectivity/software/opennsa # # $Id: Makefile.linux-x86-common-2_6,v 1.13 Broadcom SDK $ # $Copyright: (c) 2005 Broadcom Corp. diff --git a/platform/broadcom/saibcm-modules/make/Makefile.linux-x86-generic-common-2_6 b/platform/broadcom/saibcm-modules/make/Makefile.linux-x86-generic-common-2_6 index b443a3d4733d..4b02aa53cda8 100644 --- a/platform/broadcom/saibcm-modules/make/Makefile.linux-x86-generic-common-2_6 +++ b/platform/broadcom/saibcm-modules/make/Makefile.linux-x86-generic-common-2_6 @@ -1,5 +1,10 @@ # -# Copyright 2017 Broadcom +# Copyright 2007-2020 Broadcom Inc. All rights reserved. +# +# Permission is granted to use, copy, modify and/or distribute this +# software under either one of the licenses below. +# +# License Option 1: GPL # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License, version 2, as @@ -12,6 +17,12 @@ # # You should have received a copy of the GNU General Public License # version 2 (GPLv2) along with this source code. +# +# +# License Option 2: Broadcom Open Network Switch APIs (OpenNSA) license +# +# This software is governed by the Broadcom Open Network Switch APIs license: +# https://www.broadcom.com/products/ethernet-connectivity/software/opennsa # # $Id: Makefile.linux-x86-generic-common-2_6,v 1.2 Broadcom SDK $ # $Copyright: (c) 2008 Broadcom Corp. @@ -48,5 +59,4 @@ AUTOCONF = $(KERNDIR)/include/linux/autoconf.h endif # gcc system include path -# SAI_FIXUP /* SDK-218654 */ SYSINC = $(shell $(CC) -print-search-dirs | grep install | cut -c 10-)include diff --git a/platform/broadcom/saibcm-modules/make/Makefile.linux-x86-smp_generic_64-2_6 b/platform/broadcom/saibcm-modules/make/Makefile.linux-x86-smp_generic_64-2_6 index 8a97f3954301..9df0bee5a774 100644 --- a/platform/broadcom/saibcm-modules/make/Makefile.linux-x86-smp_generic_64-2_6 +++ b/platform/broadcom/saibcm-modules/make/Makefile.linux-x86-smp_generic_64-2_6 @@ -1,5 +1,10 @@ # -# Copyright 2017 Broadcom +# Copyright 2007-2020 Broadcom Inc. All rights reserved. +# +# Permission is granted to use, copy, modify and/or distribute this +# software under either one of the licenses below. +# +# License Option 1: GPL # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License, version 2, as @@ -12,6 +17,12 @@ # # You should have received a copy of the GNU General Public License # version 2 (GPLv2) along with this source code. +# +# +# License Option 2: Broadcom Open Network Switch APIs (OpenNSA) license +# +# This software is governed by the Broadcom Open Network Switch APIs license: +# https://www.broadcom.com/products/ethernet-connectivity/software/opennsa # # $Id: Makefile.linux-x86-smp_generic_64-2_6,v 1.5 Broadcom SDK $ # $Copyright: (c) 2008 Broadcom Corp. @@ -25,7 +36,7 @@ CFGFLAGS += -DSAL_SPL_LOCK_ON_IRQ include ${SDK}/make/Makefile.linux-x86-generic-common-2_6 ifeq (,$(KFLAGS)) -KFLAGS := -nostdinc -isystem $(SYSINC) -I$(KERNDIR)/include -I$(KERNDIR)/arch/x86/include -include $(AUTOCONF) -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -Os -m64 -mtune=generic -mno-red-zone -mcmodel=kernel -funit-at-a-time -maccumulate-outgoing-args -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fno-stack-protector -fomit-frame-pointer -g -Wdeclaration-after-statement -Wno-pointer-sign +KFLAGS := -nostdinc -isystem $(SYSINC) -I$(KERNDIR)/include -I$(KERNDIR)/arch/x86/include -include $(AUTOCONF) -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -Os -m64 -mtune=generic -mno-red-zone -fno-pie -mcmodel=kernel -funit-at-a-time -maccumulate-outgoing-args -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fno-stack-protector -fomit-frame-pointer -g -Wdeclaration-after-statement -Wno-pointer-sign endif ifeq ($(LINUX_MAKE_SHARED_LIB), 1) diff --git a/platform/broadcom/saibcm-modules/make/Makefile.linux-xlr b/platform/broadcom/saibcm-modules/make/Makefile.linux-xlr index ddc94afa13fe..726dfdf505bd 100644 --- a/platform/broadcom/saibcm-modules/make/Makefile.linux-xlr +++ b/platform/broadcom/saibcm-modules/make/Makefile.linux-xlr @@ -1,5 +1,10 @@ # -# Copyright 2017 Broadcom +# Copyright 2007-2020 Broadcom Inc. All rights reserved. +# +# Permission is granted to use, copy, modify and/or distribute this +# software under either one of the licenses below. +# +# License Option 1: GPL # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License, version 2, as @@ -12,6 +17,12 @@ # # You should have received a copy of the GNU General Public License # version 2 (GPLv2) along with this source code. +# +# +# License Option 2: Broadcom Open Network Switch APIs (OpenNSA) license +# +# This software is governed by the Broadcom Open Network Switch APIs license: +# https://www.broadcom.com/products/ethernet-connectivity/software/opennsa # # $Id: Makefile.linux-xlr-4_19,v 0.1 Broadcom SDK $ # $Copyright: (c) 2015 Broadcom Corp. @@ -37,6 +48,8 @@ # some basic path variables for tools and kernel source, etc # export XLR_TOOLS_BASE = /projects/ntsw-tools/linux/xlr-419 TOOLCHAIN_DIR = $(XLR_TOOLS_BASE)/buildroot/host/usr +# Target machine for EDK-Host defconfig +TARGET_MACHINE ?= x86_64 KERNDIR = $(XLR_TOOLS_BASE)/kernel/linux # set up cross compile prefix, tools dir variables. # @@ -125,12 +138,21 @@ OPENSRC_BUILD ?= fed21-x86_64 # Hardware interface (see $SDKLT/bcma/sys/probe directory) SYSTEM_INTERFACE ?= ngbde +# Support BCMSIM in the same build +ifeq (1,$(BCM_SIM_PATH_SUPPORT)) +EXTRA_SYSTEM_INTERFACES = plisim +endif + # Turn on direct register access if running on real hardware. ifeq (ngbde,$(SYSTEM_INTERFACE)) +# Except if using multiple probe interfaces +ifeq (,$(EXTRA_SYSTEM_INTERFACES)) LTSW_ADD_CPPFLAGS += -DBCMDRD_CONFIG_MEMMAP_DIRECT=1 endif +endif export SYSTEM_INTERFACE +export EXTRA_SYSTEM_INTERFACES endif ifneq ($(targetplat),user) diff --git a/platform/broadcom/saibcm-modules/sdklt/LICENSES/gpl-2.0.txt b/platform/broadcom/saibcm-modules/sdklt/LICENSES/gpl-2.0.txt new file mode 100644 index 000000000000..d159169d1050 --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/LICENSES/gpl-2.0.txt @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/platform/broadcom/saibcm-modules/sdklt/Makefile b/platform/broadcom/saibcm-modules/sdklt/Makefile new file mode 100644 index 000000000000..d6f358c55283 --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/Makefile @@ -0,0 +1,83 @@ +# +# $Copyright: Copyright 2018-2020 Broadcom. All rights reserved. +# The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# version 2 as published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# A copy of the GNU General Public License version 2 (GPLv2) can +# be found in the LICENSES folder.$ +# + +help: + @echo '' + @echo 'Build Linux GPL kernel modules for SDKLT.' + @echo '' + @echo 'Available make targets:' + @echo 'kmod - Build kernel modules' + @echo 'clean - Remove object files' + @echo '' + @echo 'Supported make variables:' + @echo 'KDIR - Linux kernel source directory (mandatory)' + @echo 'CROSS_COPILE - Cross-compiler prefix (optional)' + @echo '' + @echo 'Examples:' + @echo 'make -s KDIR=$$KERNEL/linux kmod' + @echo 'make -s clean' + @echo '' + +ifndef KDIR +nokdir: + @echo 'Error: The $$KDIR environment variable is not set.' + @echo '$$KDIR must point to a configured Linux kernel source tree.' + exit 1 +endif + +export KDIR +export CROSS_COMPILE + +override SDK := $(CURDIR) + +ifeq ($(BUILD_PSAMPLE),1) +PSAMPLE=psample +PSAMPLE_SYMVERS=$(SDK)/linux/psample/Module.symvers +endif + +kmod: bde knet knetcb $(PSAMPLE) + +bde: + $(MAKE) -C $(SDK)/linux/bde SDK=$(SDK) \ + $(TARGET) + ln -sf $(SDK)/linux/bde/*.ko + +knet: bde + $(MAKE) -C $(SDK)/linux/knet SDK=$(SDK) \ + KBUILD_EXTRA_SYMBOLS=$(SDK)/linux/bde/Module.symvers \ + $(TARGET) + ln -sf $(SDK)/linux/knet/*.ko + +knetcb: knet $(PSAMPLE) + $(MAKE) -C $(SDK)/linux/knetcb SDK=$(SDK) \ + KBUILD_EXTRA_SYMBOLS=$(SDK)/linux/knet/Module.symvers \ + KBUILD_EXTRA_SYMBOLS+=$(PSAMPLE_SYMVERS) \ + $(TARGET) + ln -sf $(SDK)/linux/knetcb/*.ko + +ifeq ($(BUILD_PSAMPLE),1) +$(PSAMPLE): + $(MAKE) -C $(SDK)/linux/psample SDK=$(SDK) \ + $(TARGET) + ln -sf $(SDK)/linux/psample/*.ko +endif + +clean: + $(MAKE) kmod TARGET=clean + rm -f *.ko + +.PHONY: help kmod bde knet knetcb $(PSAMPLE) clean diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/chip/bcm56780_a0/bcm56780_a0_pdma_attach.c b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/chip/bcm56780_a0/bcm56780_a0_pdma_attach.c new file mode 100644 index 000000000000..e06dcb68bfc8 --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/chip/bcm56780_a0/bcm56780_a0_pdma_attach.c @@ -0,0 +1,38 @@ +/*! \file bcm56780_a0_pdma_attach.c + * + * Initialize PDMA driver resources. + * + */ +/* + * $Copyright: Copyright 2018-2020 Broadcom. All rights reserved. + * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * A copy of the GNU General Public License version 2 (GPLv2) can + * be found in the LICENSES folder.$ + */ + +#include +#include +#include + +int +bcm56780_a0_cnet_pdma_attach(struct pdma_dev *dev) +{ + return bcmcnet_cmicx_pdma_driver_attach(dev); +} + +int +bcm56780_a0_cnet_pdma_detach(struct pdma_dev *dev) +{ + return bcmcnet_cmicx_pdma_driver_detach(dev); +} + diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/chip/bcm56880_a0/bcm56880_a0_pdma_attach.c b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/chip/bcm56880_a0/bcm56880_a0_pdma_attach.c new file mode 100644 index 000000000000..9a2152e99ac0 --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/chip/bcm56880_a0/bcm56880_a0_pdma_attach.c @@ -0,0 +1,38 @@ +/*! \file bcm56880_a0_pdma_attach.c + * + * Initialize PDMA driver resources. + * + */ +/* + * $Copyright: Copyright 2018-2020 Broadcom. All rights reserved. + * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * A copy of the GNU General Public License version 2 (GPLv2) can + * be found in the LICENSES folder.$ + */ + +#include +#include +#include + +int +bcm56880_a0_cnet_pdma_attach(struct pdma_dev *dev) +{ + return bcmcnet_cmicx_pdma_driver_attach(dev); +} + +int +bcm56880_a0_cnet_pdma_detach(struct pdma_dev *dev) +{ + return bcmcnet_cmicx_pdma_driver_detach(dev); +} + diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/chip/bcm56990_a0/bcm56990_a0_pdma_attach.c b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/chip/bcm56990_a0/bcm56990_a0_pdma_attach.c new file mode 100644 index 000000000000..7827ef25de3d --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/chip/bcm56990_a0/bcm56990_a0_pdma_attach.c @@ -0,0 +1,38 @@ +/*! \file bcm56990_a0_pdma_attach.c + * + * Initialize PDMA driver resources. + * + */ +/* + * $Copyright: Copyright 2018-2020 Broadcom. All rights reserved. + * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * A copy of the GNU General Public License version 2 (GPLv2) can + * be found in the LICENSES folder.$ + */ + +#include +#include +#include + +int +bcm56990_a0_cnet_pdma_attach(struct pdma_dev *dev) +{ + return bcmcnet_cmicx_pdma_driver_attach(dev); +} + +int +bcm56990_a0_cnet_pdma_detach(struct pdma_dev *dev) +{ + return bcmcnet_cmicx_pdma_driver_detach(dev); +} + diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/chip/bcm56990_b0/bcm56990_b0_pdma_attach.c b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/chip/bcm56990_b0/bcm56990_b0_pdma_attach.c new file mode 100644 index 000000000000..e34ae1f0b45c --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/chip/bcm56990_b0/bcm56990_b0_pdma_attach.c @@ -0,0 +1,38 @@ +/*! \file bcm56990_b0_pdma_attach.c + * + * Initialize PDMA driver resources. + * + */ +/* + * $Copyright: Copyright 2018-2020 Broadcom. All rights reserved. + * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * A copy of the GNU General Public License version 2 (GPLv2) can + * be found in the LICENSES folder.$ + */ + +#include +#include +#include + +int +bcm56990_b0_cnet_pdma_attach(struct pdma_dev *dev) +{ + return bcmcnet_cmicx_pdma_driver_attach(dev); +} + +int +bcm56990_b0_cnet_pdma_detach(struct pdma_dev *dev) +{ + return bcmcnet_cmicx_pdma_driver_detach(dev); +} + diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/chip/bcm56996_a0/bcm56996_a0_pdma_attach.c b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/chip/bcm56996_a0/bcm56996_a0_pdma_attach.c new file mode 100644 index 000000000000..aab5822f68b7 --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/chip/bcm56996_a0/bcm56996_a0_pdma_attach.c @@ -0,0 +1,38 @@ +/*! \file bcm56996_a0_pdma_attach.c + * + * Initialize PDMA driver resources. + * + */ +/* + * $Copyright: Copyright 2018-2020 Broadcom. All rights reserved. + * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * A copy of the GNU General Public License version 2 (GPLv2) can + * be found in the LICENSES folder.$ + */ + +#include +#include +#include + +int +bcm56996_a0_cnet_pdma_attach(struct pdma_dev *dev) +{ + return bcmcnet_cmicx_pdma_driver_attach(dev); +} + +int +bcm56996_a0_cnet_pdma_detach(struct pdma_dev *dev) +{ + return bcmcnet_cmicx_pdma_driver_detach(dev); +} + diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/hmi/cmicd/bcmcnet_cmicd_pdma_hw.c b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/hmi/cmicd/bcmcnet_cmicd_pdma_hw.c new file mode 100644 index 000000000000..83ce4d11b97f --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/hmi/cmicd/bcmcnet_cmicd_pdma_hw.c @@ -0,0 +1,530 @@ +/*! \file bcmcnet_cmicd_pdma_hw.c + * + * Utility routines for handling BCMCNET hardware (CMICd). + * + */ +/* + * $Copyright: Copyright 2018-2020 Broadcom. All rights reserved. + * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * A copy of the GNU General Public License version 2 (GPLv2) can + * be found in the LICENSES folder.$ + */ + +#include +#include +#include +#include + +/*! + * Read 32-bit register + */ +static inline void +cmicd_pdma_reg_read32(struct pdma_hw *hw, uint32_t addr, uint32_t *data) +{ + if (hw->dev->dev_read32) { + hw->dev->dev_read32(hw->dev, addr, data); + } else { + DEV_READ32(&hw->dev->ctrl, addr, data); + } +} + +/*! + * Write 32-bit register + */ +static inline void +cmicd_pdma_reg_write32(struct pdma_hw *hw, uint32_t addr, uint32_t data) +{ + if (hw->dev->dev_write32) { + hw->dev->dev_write32(hw->dev, addr, data); + } else { + DEV_WRITE32(&hw->dev->ctrl, addr, data); + } +} + +/*! + * Enable interrupt for a channel + */ +static inline void +cmicd_pdma_intr_enable(struct pdma_hw *hw, int cmc, int chan, uint32_t mask) +{ + uint32_t reg = CMICD_IRQ_STAT(cmc); + + hw->dev->intr_unmask(hw->dev, cmc, chan, reg, mask); +} + +/*! + * Disable interrupt for a channel + */ +static inline void +cmicd_pdma_intr_disable(struct pdma_hw *hw, int cmc, int chan, uint32_t mask) +{ + uint32_t reg = CMICD_IRQ_STAT(cmc); + + hw->dev->intr_mask(hw->dev, cmc, chan, reg, mask); +} + +/*! + * Initialize HW + */ +static int +cmicd_pdma_hw_init(struct pdma_hw *hw) +{ + dev_mode_t mode = DEV_MODE_MAX; + uint32_t val; + + /* Temporarily upgrade work mode to get HW information in VNET mode. */ + if (hw->dev->mode == DEV_MODE_VNET) { + mode = DEV_MODE_VNET; + hw->dev->mode = DEV_MODE_UNET; + } + + /* Release credits to EP. Only do this once when HW is initialized. */ + hw->hdls.reg_rd32(hw, CMICD_EPINTF_RELEASE_CREDITS, &val); + if (!val) { + hw->hdls.reg_wr32(hw, CMICD_EPINTF_RELEASE_CREDITS, 1); + } + + hw->info.name = CMICD_DEV_NAME; + hw->hdls.reg_rd32(hw, CMICD_CMICM_REV_ID, &val); + hw->info.ver_no = val; + hw->hdls.reg_rd32(hw, CMICD_DEV_REV_ID, &val); + hw->info.dev_id = val & 0xffff; + hw->info.rev_id = val >> 16; + hw->info.num_cmcs = CMICD_PDMA_CMC_MAX; + hw->info.cmc_chans = CMICD_PDMA_CMC_CHAN; + hw->info.num_chans = CMICD_PDMA_CMC_MAX * CMICD_PDMA_CMC_CHAN; + hw->info.rx_dcb_size = CMICD_PDMA_DCB_SIZE; + hw->info.tx_dcb_size = CMICD_PDMA_DCB_SIZE; + hw->info.rx_ph_size = 0; + hw->info.tx_ph_size = 0; + + /* Restore work mode to VNET. */ + if (mode == DEV_MODE_VNET) { + hw->dev->mode = DEV_MODE_VNET; + } + + return SHR_E_NONE; +} + +/*! + * Configure HW + */ +static int +cmicd_pdma_hw_config(struct pdma_hw *hw) +{ + struct dev_ctrl *ctrl = &hw->dev->ctrl; + struct pdma_rx_queue *rxq = NULL; + struct pdma_tx_queue *txq = NULL; + uint32_t val, que_ctrl; + int grp, que; + uint32_t qi; + + for (qi = 0; qi < ctrl->nb_rxq; qi++) { + rxq = (struct pdma_rx_queue *)ctrl->rx_queue[qi]; + grp = rxq->group_id; + que = rxq->chan_id % CMICD_PDMA_CMC_CHAN; + que_ctrl = ctrl->grp[grp].que_ctrl[que]; + + hw->hdls.reg_wr32(hw, CMICD_PDMA_STAT_CLR(grp), CMICD_PDMA_DESC_CMPLT(que)); + hw->hdls.reg_wr32(hw, CMICD_PDMA_STAT_CLR(grp), CMICD_PDMA_DESC_CNTLD(que)); + val = 0; + if (que_ctrl & PDMA_PKT_BYTE_SWAP) { + val |= CMICD_PDMA_PKT_BIG_ENDIAN; + } + if (que_ctrl & PDMA_OTH_BYTE_SWAP) { + val |= CMICD_PDMA_DESC_BIG_ENDIAN; + } + if (!(hw->dev->flags & PDMA_CHAIN_MODE)) { + val |= CMICD_PDMA_CONTINUOUS; + } + val |= CMICD_PDMA_CNTLD_INTR; + val &= ~CMICD_PDMA_DIR; + hw->hdls.reg_wr32(hw, CMICD_PDMA_CTRL(grp, que), val); + } + + for (qi = 0; qi < ctrl->nb_txq; qi++) { + txq = (struct pdma_tx_queue *)ctrl->tx_queue[qi]; + grp = txq->group_id; + que = txq->chan_id % CMICD_PDMA_CMC_CHAN; + que_ctrl = ctrl->grp[grp].que_ctrl[que]; + + hw->hdls.reg_wr32(hw, CMICD_PDMA_STAT_CLR(grp), CMICD_PDMA_DESC_CMPLT(que)); + hw->hdls.reg_wr32(hw, CMICD_PDMA_STAT_CLR(grp), CMICD_PDMA_DESC_CNTLD(que)); + val = 0; + if (que_ctrl & PDMA_PKT_BYTE_SWAP) { + val |= CMICD_PDMA_PKT_BIG_ENDIAN; + } + if (que_ctrl & PDMA_OTH_BYTE_SWAP) { + val |= CMICD_PDMA_DESC_BIG_ENDIAN; + } + if (!(hw->dev->flags & PDMA_CHAIN_MODE)) { + val |= CMICD_PDMA_CONTINUOUS; + } + val |= CMICD_PDMA_CNTLD_INTR | CMICD_PDMA_DIR; + hw->hdls.reg_wr32(hw, CMICD_PDMA_CTRL(grp, que), val); + } + + return SHR_E_NONE; +} + +/*! + * Reset HW + */ +static int +cmicd_pdma_hw_reset(struct pdma_hw *hw) +{ + int gi, qi; + + for (gi = 0; gi < hw->dev->num_groups; gi++) { + if (!hw->dev->ctrl.grp[gi].attached) { + continue; + } + for (qi = 0; qi < CMICD_PDMA_CMC_CHAN; qi++) { + if (1 << qi & hw->dev->ctrl.grp[gi].bm_rxq || + 1 << qi & hw->dev->ctrl.grp[gi].bm_txq) { + hw->hdls.reg_wr32(hw, CMICD_PDMA_CTRL(gi, qi), 0); + } + } + } + + return SHR_E_NONE; +} + +/*! + * Start a channel + */ +static int +cmicd_pdma_chan_start(struct pdma_hw *hw, int chan) +{ + uint32_t val; + int grp, que; + + grp = chan / CMICD_PDMA_CMC_CHAN; + que = chan % CMICD_PDMA_CMC_CHAN; + + hw->hdls.reg_rd32(hw, CMICD_PDMA_CTRL(grp, que), &val); + val |= CMICD_PDMA_ENABLE; + hw->hdls.reg_wr32(hw, CMICD_PDMA_CTRL(grp, que), val); + + MEMORY_BARRIER; + + return SHR_E_NONE; +} + +/*! + * Stop a channel + */ +static int +cmicd_pdma_chan_stop(struct pdma_hw *hw, int chan) +{ + uint32_t val; + int grp, que; + int retry = CMICD_HW_RETRY_TIMES; + + grp = chan / CMICD_PDMA_CMC_CHAN; + que = chan % CMICD_PDMA_CMC_CHAN; + + hw->hdls.reg_rd32(hw, CMICD_PDMA_CTRL(grp, que), &val); + val |= CMICD_PDMA_ENABLE | CMICD_PDMA_ABORT; + hw->hdls.reg_wr32(hw, CMICD_PDMA_CTRL(grp, que), val); + + MEMORY_BARRIER; + + do { + val = ~CMICD_PDMA_ACTIVE(que); + hw->hdls.reg_rd32(hw, CMICD_PDMA_STAT(grp), &val); + } while ((val & CMICD_PDMA_ACTIVE(que)) && (--retry > 0)); + + hw->hdls.reg_rd32(hw, CMICD_PDMA_CTRL(grp, que), &val); + val &= ~(CMICD_PDMA_ENABLE | CMICD_PDMA_ABORT); + hw->hdls.reg_wr32(hw, CMICD_PDMA_CTRL(grp, que), val); + + hw->hdls.reg_wr32(hw, CMICD_PDMA_STAT_CLR(grp), CMICD_PDMA_DESC_CNTLD(que)); + + MEMORY_BARRIER; + + return SHR_E_NONE; +} + +/*! + * Setup a channel + */ +static int +cmicd_pdma_chan_setup(struct pdma_hw *hw, int chan, uint64_t addr) +{ + int grp, que; + + grp = chan / CMICD_PDMA_CMC_CHAN; + que = chan % CMICD_PDMA_CMC_CHAN; + + hw->hdls.reg_wr32(hw, CMICD_PDMA_DESC(grp, que), addr); + + MEMORY_BARRIER; + + return SHR_E_NONE; +} + +/*! + * Set halt point for a channel + */ +static int +cmicd_pdma_chan_goto(struct pdma_hw *hw, int chan, uint64_t addr) +{ + int grp, que; + + grp = chan / CMICD_PDMA_CMC_CHAN; + que = chan % CMICD_PDMA_CMC_CHAN; + + hw->hdls.reg_wr32(hw, CMICD_PDMA_DESC_HALT(grp, que), addr); + + MEMORY_BARRIER; + + return SHR_E_NONE; +} + +/*! + * Clear a channel + */ +static int +cmicd_pdma_chan_clear(struct pdma_hw *hw, int chan) +{ + int grp, que; + + grp = chan / CMICD_PDMA_CMC_CHAN; + que = chan % CMICD_PDMA_CMC_CHAN; + + hw->hdls.reg_wr32(hw, CMICD_PDMA_STAT_CLR(grp), CMICD_PDMA_DESC_CNTLD(que)); + + MEMORY_BARRIER; + + return SHR_E_NONE; +} + +/*! + * Get interrupt number for a channel + */ +static int +cmicd_pdma_chan_intr_num_get(struct pdma_hw *hw, int chan) +{ + int grp, que, start_num, mask_shift; + + grp = chan / CMICD_PDMA_CMC_CHAN; + que = chan % CMICD_PDMA_CMC_CHAN; + + mask_shift = 0; + if (grp > 0) { + mask_shift = CMICD_IRQ_MASK_SHIFT + grp * 32; + } + start_num = CMICD_IRQ_START_NUM + mask_shift; + + return start_num + (que * CMICD_IRQ_NUM_OFFSET); +} + +/*! + * Enable interrupt for a channel + */ +static int +cmicd_pdma_chan_intr_enable(struct pdma_hw *hw, int chan) +{ + int grp, que; + + grp = chan / CMICD_PDMA_CMC_CHAN; + que = chan % CMICD_PDMA_CMC_CHAN; + + cmicd_pdma_intr_enable(hw, grp, que, CMICD_IRQ_DESC_CNTLD(que)); + + return SHR_E_NONE; +} + +/*! + * Disable interrupt for a channel + */ +static int +cmicd_pdma_chan_intr_disable(struct pdma_hw *hw, int chan) +{ + int grp, que; + + grp = chan / CMICD_PDMA_CMC_CHAN; + que = chan % CMICD_PDMA_CMC_CHAN; + + cmicd_pdma_intr_disable(hw, grp, que, CMICD_IRQ_DESC_CNTLD(que)); + + return SHR_E_NONE; +} + +/*! + * Query interrupt status for a channel + * + * In group mode (interrupt processing per CMC), need to query each channel's + * interrupt status. + * + */ +static int +cmicd_pdma_chan_intr_query(struct pdma_hw *hw, int chan) +{ + uint32_t val; + int grp, que; + + grp = chan / CMICD_PDMA_CMC_CHAN; + que = chan % CMICD_PDMA_CMC_CHAN; + + hw->hdls.reg_rd32(hw, CMICD_IRQ_STAT(grp), &val); + + return val & CMICD_IRQ_DESC_CNTLD(que); +} + +/*! + * Check interrupt validity for a channel + * + * In group mode (interrupt processing per CMC), need to check each channel's + * interrupt validity based on its interrupt mask. + * + */ +static int +cmicd_pdma_chan_intr_check(struct pdma_hw *hw, int chan) +{ + int grp, que; + + grp = chan / CMICD_PDMA_CMC_CHAN; + que = chan % CMICD_PDMA_CMC_CHAN; + + if (!(hw->dev->ctrl.grp[grp].irq_mask & CMICD_IRQ_DESC_CNTLD(que))) { + return 0; + } + + return cmicd_pdma_chan_intr_query(hw, chan); +} + +/*! + * Coalesce interrupt for a channel + */ +static int +cmicd_pdma_chan_intr_coalesce(struct pdma_hw *hw, int chan, int count, int timer) +{ + uint32_t val; + int grp, que; + + grp = chan / CMICD_PDMA_CMC_CHAN; + que = chan % CMICD_PDMA_CMC_CHAN; + + val = CMICD_PDMA_INTR_COAL_ENA | + CMICD_PDMA_INTR_THRESH(count) | + CMICD_PDMA_INTR_TIMER(timer); + hw->hdls.reg_wr32(hw, CMICD_PDMA_INTR_COAL(grp, que), val); + + return SHR_E_NONE; +} + +/*! + * Dump registers for a channel + */ +static int +cmicd_pdma_chan_reg_dump(struct pdma_hw *hw, int chan) +{ + uint32_t val; + int grp, que; + + grp = chan / CMICD_PDMA_CMC_CHAN; + que = chan % CMICD_PDMA_CMC_CHAN; + + hw->hdls.reg_rd32(hw, CMICD_PDMA_CTRL(grp, que), &val); + CNET_PR("CMIC_CMC%d_CH%d_DMA_CTRL: 0x%08x\n", grp, que, val); + + hw->hdls.reg_rd32(hw, CMICD_PDMA_DESC(grp, que), &val); + CNET_PR("CMIC_CMC%d_DMA_DESC%d: 0x%08x\n", grp, que, val); + + hw->hdls.reg_rd32(hw, CMICD_PDMA_CURR_DESC(grp, que), &val); + CNET_PR("CMIC_CMC%d_CH%d_DMA_CURR_DESC: 0x%08x\n", grp, que, val); + + hw->hdls.reg_rd32(hw, CMICD_PDMA_DESC_HALT(grp, que), &val); + CNET_PR("CMIC_CMC%d_DMA_CH%d_DESC_HALT_ADDR: 0x%08x\n", grp, que, val); + + hw->hdls.reg_rd32(hw, CMICD_PDMA_COS_RX0(grp, que), &val); + CNET_PR("CMIC_CMC%d_CH%d_COS_CTRL_RX_0: 0x%08x\n", grp, que, val); + + hw->hdls.reg_rd32(hw, CMICD_PDMA_COS_RX1(grp, que), &val); + CNET_PR("CMIC_CMC%d_CH%d_COS_CTRL_RX_1: 0x%08x\n", grp, que, val); + + hw->hdls.reg_rd32(hw, CMICD_PDMA_COS_MASK0(grp), &val); + CNET_PR("CMIC_CMC%d_PROGRAMMABLE_COS_MASK0: 0x%08x\n", grp, val); + + hw->hdls.reg_rd32(hw, CMICD_PDMA_COS_MASK1(grp), &val); + CNET_PR("CMIC_CMC%d_PROGRAMMABLE_COS_MASK1: 0x%08x\n", grp, val); + + hw->hdls.reg_rd32(hw, CMICD_PDMA_INTR_COAL(grp, que), &val); + CNET_PR("CMIC_CMC%d_DMA_CH%d_INTR_COAL: 0x%08x\n", grp, que, val); + + hw->hdls.reg_rd32(hw, CMICD_PDMA_RBUF_THRE(grp, que), &val); + CNET_PR("CMIC_CMC%d_CH%d_RXBUF_THRESHOLD_CONFIG: 0x%08x\n", grp, que, val); + + hw->hdls.reg_rd32(hw, CMICD_PDMA_STAT(grp), &val); + CNET_PR("CMIC_CMC%d_DMA_STAT: 0x%08x\n", grp, val); + + hw->hdls.reg_rd32(hw, CMICD_PDMA_STAT_HI(grp), &val); + CNET_PR("CMIC_CMC%d_DMA_STAT_HI: 0x%08x\n", grp, val); + + hw->hdls.reg_rd32(hw, CMICD_PDMA_STAT_CLR(grp), &val); + CNET_PR("CMIC_CMC%d_DMA_STAT_CLR: 0x%08x\n", grp, val); + + hw->hdls.reg_rd32(hw, CMICD_PDMA_COUNT_RX(grp, que), &val); + CNET_PR("CMIC_CMC%d_PKT_COUNT_CH%d_RXPKT: 0x%08x\n", grp, que, val); + + hw->hdls.reg_rd32(hw, CMICD_PDMA_COUNT_TX(grp, que), &val); + CNET_PR("CMIC_CMC%d_PKT_COUNT_CH%d_TXPKT: 0x%08x\n", grp, que, val); + + hw->hdls.reg_rd32(hw, CMICD_IRQ_STAT(grp), &val); + CNET_PR("CMIC_CMC%d_IRQ_STAT0: 0x%08x\n", grp, val); + + hw->hdls.reg_rd32(hw, CMICD_IRQ_PCI_MASK(grp), &val); + CNET_PR("CMIC_CMC%d_PCIE_IRQ_MASK0: 0x%08x\n", grp, val); + + hw->hdls.reg_rd32(hw, CMICD_DEV_REV_ID, &val); + CNET_PR("CMIC_DEV_REV_ID: 0x%08x\n", val); + + hw->hdls.reg_rd32(hw, CMICD_CMICM_REV_ID, &val); + CNET_PR("CMIC_CMICM_REV_ID: 0x%08x\n", val); + + return SHR_E_NONE; +} + +/*! + * Initialize function pointers + */ +int +bcmcnet_cmicd_pdma_hw_hdls_init(struct pdma_hw *hw) +{ + if (!hw) { + return SHR_E_PARAM; + } + + hw->hdls.reg_rd32 = cmicd_pdma_reg_read32; + hw->hdls.reg_wr32 = cmicd_pdma_reg_write32; + hw->hdls.hw_init = cmicd_pdma_hw_init; + hw->hdls.hw_config = cmicd_pdma_hw_config; + hw->hdls.hw_reset = cmicd_pdma_hw_reset; + hw->hdls.chan_start = cmicd_pdma_chan_start; + hw->hdls.chan_stop = cmicd_pdma_chan_stop; + hw->hdls.chan_setup = cmicd_pdma_chan_setup; + hw->hdls.chan_goto = cmicd_pdma_chan_goto; + hw->hdls.chan_clear = cmicd_pdma_chan_clear; + hw->hdls.chan_intr_num_get = cmicd_pdma_chan_intr_num_get; + hw->hdls.chan_intr_enable = cmicd_pdma_chan_intr_enable; + hw->hdls.chan_intr_disable = cmicd_pdma_chan_intr_disable; + hw->hdls.chan_intr_query = cmicd_pdma_chan_intr_query; + hw->hdls.chan_intr_check = cmicd_pdma_chan_intr_check; + hw->hdls.chan_intr_coalesce = cmicd_pdma_chan_intr_coalesce; + hw->hdls.chan_reg_dump = cmicd_pdma_chan_reg_dump; + + return SHR_E_NONE; +} + diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/hmi/cmicd/bcmcnet_cmicd_pdma_rxtx.c b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/hmi/cmicd/bcmcnet_cmicd_pdma_rxtx.c new file mode 100644 index 000000000000..c4a10e160db9 --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/hmi/cmicd/bcmcnet_cmicd_pdma_rxtx.c @@ -0,0 +1,1062 @@ +/*! \file bcmcnet_cmicd_pdma_rxtx.c + * + * Utility routines for BCMCNET hardware (CMICd) specific Rx/Tx. + * + * Here are the CMIC specific Rx/Tx routines including DCBs resource allocation + * and clean up, DCBs configuration, Rx buffers allocation, Tx buffers release, + * Rx/Tx packets processing, etc. + * They are shared among all the modes (UNET, KNET, VNET, HNET) and in both of + * user space and kernel space. + * + * The driver uses a ring of DCBs per DMA channel based on Continuous DMA mode. + * The beginning is written to register pointing to the physical address of the + * start of the ring. The ring size is maintained by the driver. A HALT DCB + * physical address is written to DMA register timely to indicate how many DCBs + * can be handled by HW. + * + * When a packet is received, an interrupt is triggered. The handler will go + * through the Rx DCB ring to process the current completed DCB and every + * subsequent DCBs until no one is left. The received packet is processed and + * passed up to the high level SW. After that, a new buffer is allocated and + * the DCB is updated for receiving a new packet. A new HALT DCB is selected + * and its physical address is written to DMA register. + * + * When a packet is transmitted, the driver starts where it left off last time + * in the Tx DCB ring, updates the DCB and writes its physical address to DMA + * register so as to start DMA. Once the transmitting is finished, the handler + * is informed to clean up the buffer based on the work mode. In KNET or HNET + * mode, an interrupt will be triggered. Polling mode is used in CNET or VNET + * mode, the buffers will be cleaned up when the number of dirty DCBs reaches + * a pre-defined threshold. + * + * In VNET and HNET modes, DCB updating between virtual ring and real ring and + * a IOCTL based notification mechanism are involved. The hypervisor in kernel + * emulates the DMA HW behaviors to update DCBs in virtual network and inform + * the handler something happened. Likewise, the hypervisor updates itself real + * DCB ring from the virtual ring to start DMA for transmitting a packet once a + * notification is received from the virtual network. + * + */ +/* + * $Copyright: Copyright 2018-2020 Broadcom. All rights reserved. + * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * A copy of the GNU General Public License version 2 (GPLv2) can + * be found in the LICENSES folder.$ + */ + +#include +#include +#include +#include +#include + +/*! + * Configure Rx descriptor + */ +static inline void +cmicd_rx_desc_config(struct cmicd_rx_desc *rd, uint32_t addr, uint32_t len) +{ + rd->addr = addr; + rd->md.status = 0; + rd->ctrl = CMICD_DESC_CTRL_CNTLD_INTR | CMICD_DESC_CTRL_CHAIN | + CMICD_DESC_CTRL_LEN(len); +} + +/*! + * Configure Tx descriptor + */ +static inline void +cmicd_tx_desc_config(struct cmicd_tx_desc *td, uint32_t addr, uint32_t len, uint32_t flags) +{ + td->addr = addr; + td->md.status = 0; + td->ctrl = CMICD_DESC_CTRL_CNTLD_INTR | CMICD_DESC_CTRL_CHAIN | + CMICD_DESC_CTRL_FLAGS(flags) | CMICD_DESC_CTRL_LEN(len); +} + +/*! + * Configure Rx reload descriptor + */ +static inline void +cmicd_rx_rldesc_config(struct cmicd_rx_desc *rd, uint32_t addr) +{ + rd->addr = addr; + rd->md.status = 0; + rd->ctrl = CMICD_DESC_CTRL_CNTLD_INTR | CMICD_DESC_CTRL_CHAIN | + CMICD_DESC_CTRL_RELOAD; +} + +/*! + * Configure Tx reload descriptor + */ +static inline void +cmicd_tx_rldesc_config(struct cmicd_tx_desc *td, uint32_t addr) +{ + td->addr = addr; + td->md.status = 0; + td->ctrl = CMICD_DESC_CTRL_CNTLD_INTR | CMICD_DESC_CTRL_CHAIN | + CMICD_DESC_CTRL_RELOAD; +} + +/*! + * Chain Rx descriptor + */ +static inline void +cmicd_rx_desc_chain(struct cmicd_rx_desc *rd, int chain) +{ + if (chain) { + rd->ctrl |= CMICD_DESC_CTRL_CHAIN; + } else { + rd->ctrl &= ~CMICD_DESC_CTRL_CHAIN; + } +} + +/*! + * Chain Tx descriptor + */ +static inline void +cmicd_tx_desc_chain(struct cmicd_tx_desc *td, int chain) +{ + if (chain) { + td->ctrl |= CMICD_DESC_CTRL_CHAIN; + } else { + td->ctrl &= ~CMICD_DESC_CTRL_CHAIN; + } +} + +/*! + * Get unused descriptors in a Rx ring + */ +static inline int +cmicd_pdma_rx_ring_unused(struct pdma_rx_queue *rxq) +{ + /* Leave one descriptor unused so as not to halt */ + return rxq->curr > rxq->halt ? + rxq->curr - rxq->halt - 1 : + rxq->nb_desc + rxq->curr - rxq->halt - 1; +} + +/*! + * Get unused descriptors in a Tx ring + */ +static inline int +cmicd_pdma_tx_ring_unused(struct pdma_tx_queue *txq) +{ + /* Leave one descriptor unused so as not to halt */ + return txq->dirt > txq->curr ? + txq->dirt - txq->curr - 1 : + txq->nb_desc + txq->dirt - txq->curr - 1; +} + +/*! + * Initialize Rx descriptors + */ +static int +cmicd_pdma_rx_desc_init(struct pdma_hw *hw, struct pdma_rx_queue *rxq) +{ + struct pdma_dev *dev = hw->dev; + struct pdma_buf_mngr *bm = (struct pdma_buf_mngr *)dev->ctrl.buf_mngr; + struct cmicd_rx_desc *ring = (struct cmicd_rx_desc *)rxq->ring; + dma_addr_t addr; + uint32_t di; + int rv; + + for (di = 0; di < rxq->nb_desc; di++) { + if (!rxq->pbuf[di].dma) { + /* Allocate pktbuf for ring entry */ + rxq->pbuf[di].adj = CMICD_RX_META_RESV; + rv = bm->rx_buf_alloc(dev, rxq, &rxq->pbuf[di]); + if (SHR_FAILURE(rv)) { + goto cleanup; + } + } + /* Config receive descriptor ring */ + bm->rx_buf_dma(dev, rxq, &rxq->pbuf[di], &addr); + cmicd_rx_desc_config(&ring[di], addr, rxq->buf_size); + if (hw->dev->flags & PDMA_CHAIN_MODE && di == rxq->nb_desc - 1) { + cmicd_rx_desc_chain(&ring[di], 0); + } + } + /* Config the last descriptor in the ring as reload descriptor */ + cmicd_rx_rldesc_config(&ring[di], rxq->ring_addr); + + rxq->curr = 0; + rxq->halt = rxq->state & PDMA_RX_BATCH_REFILL ? 0 : rxq->nb_desc; + + rxq->halt_addr = rxq->ring_addr + sizeof(struct cmicd_rx_desc) * di; + hw->hdls.chan_goto(hw, rxq->chan_id, rxq->halt_addr); + hw->hdls.chan_setup(hw, rxq->chan_id, rxq->ring_addr); + + return SHR_E_NONE; + +cleanup: + for (di = 0; di < rxq->nb_desc; di++) { + if (rxq->pbuf[di].dma) { + bm->rx_buf_free(dev, rxq, &rxq->pbuf[di]); + } + cmicd_rx_desc_config(&ring[di], 0, 0); + } + + CNET_PR("RX: Failed to allocate mem\n"); + + return SHR_E_MEMORY; +} + +/*! + * Cleanup Rx descriptors + */ +static int +cmicd_pdma_rx_desc_clean(struct pdma_hw *hw, struct pdma_rx_queue *rxq) +{ + struct pdma_dev *dev = hw->dev; + struct pdma_buf_mngr *bm = (struct pdma_buf_mngr *)dev->ctrl.buf_mngr; + struct cmicd_rx_desc *ring = (struct cmicd_rx_desc *)rxq->ring; + uint32_t di; + + /* Go through all the descriptors and free pktbuf */ + for (di = 0; di < rxq->nb_desc; di++) { + if (rxq->pbuf[di].dma) { + bm->rx_buf_free(dev, rxq, &rxq->pbuf[di]); + } + cmicd_rx_desc_config(&ring[di], 0, 0); + } + + rxq->curr = 0; + rxq->halt = 0; + + return SHR_E_NONE; +} + +/*! + * Initialize Tx descriptors + */ +static int +cmicd_pdma_tx_desc_init(struct pdma_hw *hw, struct pdma_tx_queue *txq) +{ + struct pdma_dev *dev = hw->dev; + struct pdma_buf_mngr *bm = (struct pdma_buf_mngr *)dev->ctrl.buf_mngr; + struct cmicd_tx_desc *ring = (struct cmicd_tx_desc *)txq->ring; + uint32_t di; + + for (di = 0; di < txq->nb_desc; di++) { + if (txq->pbuf[di].dma) { + bm->tx_buf_free(dev, txq, &txq->pbuf[di]); + } + /* Config transmit descriptor ring */ + cmicd_tx_desc_config(&ring[di], 0, 0, 0); + if (hw->dev->flags & PDMA_CHAIN_MODE) { + cmicd_tx_desc_chain(&ring[di], 0); + } + } + /* Config the last descriptor in the ring as reload descriptor */ + cmicd_tx_rldesc_config(&ring[di], txq->ring_addr); + + txq->curr = 0; + txq->dirt = 0; + txq->halt = 0; + + txq->halt_addr = txq->ring_addr; + hw->hdls.chan_goto(hw, txq->chan_id, txq->halt_addr); + hw->hdls.chan_setup(hw, txq->chan_id, txq->ring_addr); + + return SHR_E_NONE; +} + +/*! + * Cleanup Tx descriptors + */ +static int +cmicd_pdma_tx_desc_clean(struct pdma_hw *hw, struct pdma_tx_queue *txq) +{ + struct pdma_dev *dev = hw->dev; + struct pdma_buf_mngr *bm = (struct pdma_buf_mngr *)dev->ctrl.buf_mngr; + struct cmicd_tx_desc *ring = (struct cmicd_tx_desc *)txq->ring; + uint32_t di; + + /* Go through all the descriptors and free pktbuf */ + for (di = 0; di < txq->nb_desc; di++) { + if (txq->pbuf[di].dma) { + bm->tx_buf_free(dev, txq, &txq->pbuf[di]); + } + cmicd_tx_desc_config(&ring[di], 0, 0, 0); + } + + txq->curr = 0; + txq->dirt = 0; + txq->halt = 0; + + return SHR_E_NONE; +} + +/*! + * Process Rx vring + */ +static int +cmicd_pdma_rx_vring_process(struct pdma_hw *hw, struct pdma_rx_queue *rxq, + struct pdma_rx_buf *pbuf) +{ + struct pdma_dev *dev = hw->dev; + struct cmicd_rx_desc *ring = (struct cmicd_rx_desc *)rxq->ring; + struct pdma_rx_queue *vrxq = NULL; + struct cmicd_rx_desc *vring = NULL; + struct pkt_hdr *pkh = &pbuf->pkb->pkh; + + vrxq = (struct pdma_rx_queue *)dev->ctrl.vnet_rxq[rxq->queue_id]; + vring = (struct cmicd_rx_desc *)vrxq->ring; + if (!vring) { + rxq->stats.dropped++; + return SHR_E_UNAVAIL; + } + + if (vring[vrxq->curr].md.status & CMICD_DESC_STAT_RTX_DONE) { + dev->xnet_wake(dev); + return SHR_E_BUSY; + } + + /* Copy descriptor and packet to vring */ + sal_memcpy(dev->sys_p2v(dev, (uint64_t)vring[vrxq->curr].addr), + &pbuf->pkb->data + pkh->meta_len, pkh->data_len); + sal_memcpy(&vring[vrxq->curr].md, &ring[rxq->curr].md, + sizeof(((struct rx_metadata *)0)->data)); + vring[vrxq->curr].md.status = ring[rxq->curr].md.status; + + MEMORY_BARRIER; + + /* Notify VNET to process if needed */ + if (!vring[(vrxq->curr + vrxq->nb_desc - 1) % vrxq->nb_desc].md.status) { + dev->xnet_wake(dev); + } + vrxq->curr = (vrxq->curr + 1) % vrxq->nb_desc; + + return SHR_E_NONE; +} + +/*! + * Refill Rx ring + */ +static int +cmicd_pdma_rx_ring_refill(struct pdma_hw *hw, struct pdma_rx_queue *rxq) +{ + struct pdma_dev *dev = hw->dev; + struct pdma_buf_mngr *bm = (struct pdma_buf_mngr *)dev->ctrl.buf_mngr; + struct cmicd_rx_desc *ring = (struct cmicd_rx_desc *)rxq->ring; + struct pdma_rx_buf *pbuf = NULL; + int unused = cmicd_pdma_rx_ring_unused(rxq); + dma_addr_t addr; + uint32_t halt; + int rv; + + for (halt = rxq->halt; halt < rxq->halt + unused; halt++) { + pbuf = &rxq->pbuf[halt % rxq->nb_desc]; + /* Allocate a new pktbuf */ + if (!bm->rx_buf_avail(dev, rxq, pbuf)) { + rv = bm->rx_buf_alloc(dev, rxq, pbuf); + if (SHR_FAILURE(rv)) { + rxq->halt = halt % rxq->nb_desc; + rxq->stats.nomems++; + goto fail; + } + } + /* Setup the new descriptor */ + bm->rx_buf_dma(dev, rxq, pbuf, &addr); + cmicd_rx_desc_config(&ring[halt % rxq->nb_desc], addr, rxq->buf_size); + if (dev->flags & PDMA_CHAIN_MODE && halt % rxq->nb_desc == rxq->nb_desc - 1) { + cmicd_rx_desc_chain(&ring[halt % rxq->nb_desc], 0); + } + } + + sal_spinlock_lock(rxq->lock); + rxq->halt = halt % rxq->nb_desc; + if (!(rxq->state & PDMA_RX_QUEUE_XOFF)) { + /* Descriptor cherry pick */ + rxq->halt_addr = rxq->ring_addr + sizeof(struct cmicd_rx_desc) * rxq->halt; + hw->hdls.chan_goto(hw, rxq->chan_id, rxq->halt_addr); + } + sal_spinlock_unlock(rxq->lock); + + return SHR_E_NONE; + +fail: + CNET_PR("RX: Failed to allocate mem\n"); + + return SHR_E_MEMORY; +} + +/*! + * \brief Clean Rx ring + * + * \param [in] hw HW structure point. + * \param [in] rxq Rx queue structure point. + * \param [in] budget Polling budget. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +static int +cmicd_pdma_rx_ring_clean(struct pdma_hw *hw, struct pdma_rx_queue *rxq, int budget) +{ + struct pdma_dev *dev = hw->dev; + struct pdma_buf_mngr *bm = (struct pdma_buf_mngr *)dev->ctrl.buf_mngr; + struct cmicd_rx_desc *ring = (struct cmicd_rx_desc *)rxq->ring; + struct pdma_rx_buf *pbuf = NULL; + struct pkt_hdr *pkh = NULL; + dma_addr_t addr; + uint32_t stat, curr; + int len, done = 0; + int rv; + + curr = rxq->curr; + while (CMICD_DESC_STAT_DONE(ring[curr].md.status)) { + if (dev->mode == DEV_MODE_VNET && rxq->state & PDMA_RX_QUEUE_XOFF) { + break; + } + if (!(rxq->state & PDMA_RX_BATCH_REFILL) && + !(rxq->state & PDMA_RX_QUEUE_XOFF)) { + /* Descriptor cherry pick */ + rxq->halt_addr = rxq->ring_addr + sizeof(struct cmicd_rx_desc) * curr; + hw->hdls.chan_goto(hw, rxq->chan_id, rxq->halt_addr); + rxq->halt = curr; + } + if (done == budget) { + break; + } + + /* Get the current pktbuf to process */ + pbuf = &rxq->pbuf[curr]; + stat = ring[curr].md.status; + len = CMICD_DESC_STAT_LEN(stat); + pkh = bm->rx_buf_get(dev, rxq, pbuf, len); + if (!pkh) { + rxq->stats.nomems++; + goto fail; + } + + /* Setup packet header */ + pkh->data_len = len; + pkh->meta_len = pbuf->adj; + pkh->queue_id = rxq->queue_id; + pkh->attrs = CMICD_DESC_STAT_FLAGS(stat); + sal_memcpy(&pbuf->pkb->data, &ring[curr].md, sizeof(struct rx_metadata)); + + /* Send up the packet */ + rv = dev->pkt_recv(dev, rxq->queue_id, (void *)pbuf->skb); + if (SHR_FAILURE(rv)) { + if (dev->mode == DEV_MODE_HNET && pkh->attrs & PDMA_RX_TO_VNET) { + rv = cmicd_pdma_rx_vring_process(hw, rxq, pbuf); + if (SHR_FAILURE(rv) && rv == SHR_E_BUSY) { + rxq->state |= PDMA_RX_QUEUE_BUSY; + return done; + } + } else { + rxq->stats.dropped++; + } + bm->rx_buf_put(dev, rxq, pbuf, len); + } + + /* Count the packets/bytes */ + rxq->stats.packets++; + rxq->stats.bytes += len; + + /* Count the errors if any */ + if (stat & CMICD_DESC_STAT_ERR_MASK) { + rxq->stats.errors++; + if (stat & CMICD_DESC_STAT_HEAD_ERR) { + rxq->stats.head_errors++; + } + if (stat & CMICD_DESC_STAT_DATA_ERR) { + rxq->stats.data_errors++; + } + if (stat & CMICD_DESC_STAT_CELL_ERR) { + rxq->stats.cell_errors++; + } + } + + /* Setup the new descriptor */ + if (!(rxq->state & PDMA_RX_BATCH_REFILL)) { + if (!bm->rx_buf_avail(dev, rxq, pbuf)) { + rv = bm->rx_buf_alloc(dev, rxq, pbuf); + if (SHR_FAILURE(rv)) { + rxq->stats.nomems++; + goto fail; + } + } + bm->rx_buf_dma(dev, rxq, pbuf, &addr); + cmicd_rx_desc_config(&ring[curr], addr, rxq->buf_size); + if (dev->flags & PDMA_CHAIN_MODE && curr == rxq->nb_desc - 1) { + cmicd_rx_desc_chain(&ring[curr], 0); + } + } else { + cmicd_rx_desc_config(&ring[curr], 0, 0); + } + + /* Notify HNET to process if needed */ + if (dev->mode == DEV_MODE_VNET) { + MEMORY_BARRIER; + if (ring[(curr + rxq->nb_desc - 1) % rxq->nb_desc].md.status) { + dev->xnet_wake(dev); + } + } + + /* Update the indicators */ + if (!(rxq->state & PDMA_RX_BATCH_REFILL) && rxq->halt != curr) { + sal_spinlock_lock(rxq->lock); + if (!(rxq->state & PDMA_RX_QUEUE_XOFF)) { + /* Descriptor cherry pick */ + rxq->halt_addr = rxq->ring_addr + sizeof(struct cmicd_rx_desc) * curr; + hw->hdls.chan_goto(hw, rxq->chan_id, rxq->halt_addr); + rxq->halt = curr; + } + curr = (curr + 1) % rxq->nb_desc; + sal_spinlock_unlock(rxq->lock); + } else { + curr = (curr + 1) % rxq->nb_desc; + } + rxq->curr = curr; + done++; + + /* Restart DMA if in chain mode */ + if (dev->flags & PDMA_CHAIN_MODE) { + if (curr == 0 && !(rxq->state & PDMA_RX_QUEUE_XOFF)) { + hw->hdls.chan_stop(hw, rxq->chan_id); + hw->hdls.chan_start(hw, rxq->chan_id); + } + } + } + + /* One more poll for chain done in chain mode */ + if (dev->flags & PDMA_CHAIN_MODE) { + if (curr == rxq->nb_desc - 1 && done) { + done = budget; + } + } + + /* In batching mode, replenish all the unused descriptors */ + if (rxq->state & PDMA_RX_BATCH_REFILL && + cmicd_pdma_rx_ring_unused(rxq) >= (int)rxq->free_thresh) { + cmicd_pdma_rx_ring_refill(hw, rxq); + } + + /* Notify the other side to process */ + if (dev->mode == DEV_MODE_VNET || dev->mode == DEV_MODE_HNET) { + if (done) { + dev->xnet_wake(dev); + } + } + + return done; + +fail: + CNET_PR("RX: Failed to allocate mem\n"); + + return done; +} + +/*! + * Process Tx vring + */ +static int +cmicd_pdma_tx_vring_process(struct pdma_hw *hw, struct pdma_tx_queue *txq, + struct pdma_tx_buf *pbuf) +{ + struct pdma_dev *dev = hw->dev; + struct cmicd_tx_desc *ring = (struct cmicd_tx_desc *)txq->ring; + struct pdma_tx_queue *vtxq = NULL; + struct cmicd_tx_desc *vring = NULL; + + vtxq = (struct pdma_tx_queue *)dev->ctrl.vnet_txq[txq->queue_id]; + vring = (struct cmicd_tx_desc *)vtxq->ring; + if (!vring) { + return SHR_E_UNAVAIL; + } + + /* Update vring descriptor */ + vring[vtxq->dirt].md.status = ring[txq->dirt].md.status; + pbuf->dma = 0; + + MEMORY_BARRIER; + + /* Notify VNET to process if needed */ + if (!vring[(vtxq->dirt + vtxq->nb_desc - 1) % vtxq->nb_desc].md.status) { + dev->xnet_wake(dev); + } + vtxq->dirt = (vtxq->dirt + 1) % vtxq->nb_desc; + + return SHR_E_NONE; +} + +/*! + * \brief Clean Tx ring + * + * \param [in] hw HW structure point. + * \param [in] txq Tx queue structure point. + * \param [in] budget Polling budget. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +static int +cmicd_pdma_tx_ring_clean(struct pdma_hw *hw, struct pdma_tx_queue *txq, int budget) +{ + struct pdma_dev *dev = hw->dev; + struct pdma_buf_mngr *bm = (struct pdma_buf_mngr *)dev->ctrl.buf_mngr; + struct cmicd_tx_desc *ring = (struct cmicd_tx_desc *)txq->ring; + uint32_t dirt, curr; + int done = 0; + + dirt = txq->dirt; + while (txq->pbuf[dirt].dma) { + if (!CMICD_DESC_STAT_DONE(ring[dirt].md.status)) { + break; + } + if (done == budget) { + break; + } + + if (dev->mode == DEV_MODE_HNET && !txq->pbuf[dirt].skb) { + cmicd_pdma_tx_vring_process(hw, txq, &txq->pbuf[dirt]); + } else { + /* Free the done pktbuf */ + bm->tx_buf_free(dev, txq, &txq->pbuf[dirt]); + } + + cmicd_tx_desc_config(&ring[dirt], 0, 0, 0); + + /* Update the indicators */ + dirt = (dirt + 1) % txq->nb_desc; + txq->dirt = dirt; + done++; + + /* Restart DMA if in chain mode */ + if (dev->flags & PDMA_CHAIN_MODE) { + sal_spinlock_lock(txq->lock); + curr = txq->curr; + if (dirt == txq->halt && dirt != curr) { + hw->hdls.chan_stop(hw, txq->chan_id); + cmicd_tx_desc_chain(&ring[(curr + txq->nb_desc - 1) % txq->nb_desc], 0); + hw->hdls.chan_setup(hw, txq->chan_id, + txq->ring_addr + sizeof(struct cmicd_tx_desc) * txq->halt); + hw->hdls.chan_start(hw, txq->chan_id); + txq->halt = curr; + } + sal_spinlock_unlock(txq->lock); + } + } + + /* One more poll for chain done in chain mode */ + if (dev->flags & PDMA_CHAIN_MODE) { + sal_spinlock_lock(txq->lock); + if (dirt != txq->halt) { + done = budget; + } + sal_spinlock_unlock(txq->lock); + } + + /* Resume Tx if any */ + sal_spinlock_lock(txq->lock); + if (cmicd_pdma_tx_ring_unused(txq) && txq->state & PDMA_TX_QUEUE_XOFF) { + txq->state &= ~PDMA_TX_QUEUE_XOFF; + sal_spinlock_unlock(txq->lock); + if (dev->tx_resume) { + dev->tx_resume(dev, txq->queue_id); + } else if (!(txq->state & PDMA_TX_QUEUE_POLL)) { + sal_sem_give(txq->sem); + } + return done; + } + sal_spinlock_unlock(txq->lock); + + return done; +} + +/*! + * Dump Rx ring + */ +static int +cmicd_pdma_rx_ring_dump(struct pdma_hw *hw, struct pdma_rx_queue *rxq) +{ + struct cmicd_rx_desc *ring = (struct cmicd_rx_desc *)rxq->ring; + struct cmicd_rx_desc *rd; + uint32_t di; + + CNET_PR("\nRX: queue=%d, chan=%d, curr=%d, halt=%d, halt@%p\n", + rxq->queue_id, rxq->chan_id, rxq->curr, rxq->halt, (void *)&ring[rxq->halt]); + CNET_PR("----------------------------------------------------------------\n"); + for (di = 0; di < rxq->nb_desc + 1; di++) { + rd = &ring[di]; + CNET_PR("DESC[%03d]: (%p)->%08x %08x ... %08x\n", + di, (void *)(unsigned long)(rxq->ring_addr + di * CMICD_PDMA_DCB_SIZE), + rd->addr, rd->ctrl, rd->md.status); + } + + return SHR_E_NONE; +} + +/*! + * Dump Tx ring + */ +static int +cmicd_pdma_tx_ring_dump(struct pdma_hw *hw, struct pdma_tx_queue *txq) +{ + struct cmicd_tx_desc *ring = (struct cmicd_tx_desc *)txq->ring; + struct cmicd_tx_desc *td; + uint32_t di; + + CNET_PR("\nTX: queue=%d, chan=%d, curr=%d, dirt=%d, halt@%p\n", + txq->queue_id, txq->chan_id, txq->curr, txq->dirt, (void *)&ring[txq->curr]); + CNET_PR("----------------------------------------------------------------\n"); + for (di = 0; di < txq->nb_desc + 1; di++) { + td = &ring[di]; + CNET_PR("DESC[%03d]: (%p)->%08x %08x ... %08x\n", + di, (void *)(unsigned long)(txq->ring_addr + di * CMICD_PDMA_DCB_SIZE), + td->addr, td->ctrl, td->md.status); + } + + return SHR_E_NONE; +} + +/*! + * Fetch Tx vring + */ +static int +cmicd_pdma_tx_vring_fetch(struct pdma_hw *hw, struct pdma_tx_queue *txq, + struct pdma_tx_buf *pbuf) +{ + struct pdma_dev *dev = hw->dev; + struct cmicd_tx_desc *ring = (struct cmicd_tx_desc *)txq->ring; + struct pdma_tx_queue *vtxq = NULL; + struct cmicd_tx_desc *vring = NULL; + + vtxq = (struct pdma_tx_queue *)dev->ctrl.vnet_txq[txq->queue_id]; + vring = (struct cmicd_tx_desc *)vtxq->ring; + if (!vring || !CMICD_DESC_CTRL_LEN(vring[vtxq->curr].ctrl)) { + return SHR_E_UNAVAIL; + } + + /* Fetch vring descriptor */ + sal_memcpy(&ring[txq->curr], &vring[vtxq->curr], sizeof(struct cmicd_tx_desc)); + vring[vtxq->curr].ctrl &= ~CMICD_DESC_CTRL_LEN(-1); + + MEMORY_BARRIER; + + pbuf->dma = vring[vtxq->curr].addr; + pbuf->len = CMICD_DESC_CTRL_LEN(ring[txq->curr].ctrl); + vtxq->curr = (vtxq->curr + 1) % vtxq->nb_desc; + + return SHR_E_NONE; +} + +/*! + * Check Tx ring + */ +static inline int +cmicd_pdma_tx_ring_check(struct pdma_hw *hw, struct pdma_tx_queue *txq) +{ + if (cmicd_pdma_tx_ring_unused(txq)) { + return SHR_E_NONE; + } + + sal_spinlock_lock(txq->lock); + if (!cmicd_pdma_tx_ring_unused(txq)) { + txq->state |= PDMA_TX_QUEUE_XOFF; + txq->stats.xoffs++; + sal_spinlock_unlock(txq->lock); + if (hw->dev->tx_suspend) { + hw->dev->tx_suspend(hw->dev, txq->queue_id); + } + return SHR_E_BUSY; + } + sal_spinlock_unlock(txq->lock); + + return SHR_E_NONE; +} + +/*! + * \brief Start packet transmission + * + * \param [in] hw HW structure point. + * \param [in] txq Tx queue structure point. + * \param [in] buf Tx packet buffer. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +static int +cmicd_pdma_pkt_xmit(struct pdma_hw *hw, struct pdma_tx_queue *txq, void *buf) +{ + struct pdma_dev *dev = hw->dev; + struct pdma_buf_mngr *bm = (struct pdma_buf_mngr *)dev->ctrl.buf_mngr; + struct cmicd_tx_desc *ring = (struct cmicd_tx_desc *)txq->ring; + struct pdma_tx_buf *pbuf = NULL; + struct pkt_hdr *pkh = NULL; + dma_addr_t addr; + uint32_t curr, flags = 0; + int retry = 5000000; + int rv; + + if (!(txq->state & PDMA_TX_QUEUE_ACTIVE)) { + return SHR_E_UNAVAIL; + } + + if (dev->tx_suspend) { + sal_spinlock_lock(txq->mutex); + } else { + sal_sem_take(txq->sem, SAL_SEM_FOREVER); + } + + /* Check Tx resource */ + if (dev->tx_suspend) { + /* Suspend Tx if no resource */ + rv = cmicd_pdma_tx_ring_check(hw, txq); + if (SHR_FAILURE(rv)) { + sal_spinlock_unlock(txq->mutex); + return rv; + } + } else { + /* Abort Tx if a fatal error happened */ + if (txq->state & PDMA_TX_QUEUE_XOFF) { + sal_sem_give(txq->sem); + return SHR_E_RESOURCE; + } + } + + /* Setup the new descriptor */ + curr = txq->curr; + pbuf = &txq->pbuf[curr]; + if (dev->mode == DEV_MODE_HNET && !buf) { + rv = cmicd_pdma_tx_vring_fetch(hw, txq, pbuf); + if (SHR_FAILURE(rv)) { + sal_spinlock_unlock(txq->mutex); + return SHR_E_EMPTY; + } + } else { + pbuf->adj = 0; + pkh = bm->tx_buf_get(dev, txq, pbuf, buf); + if (!pkh) { + txq->stats.dropped++; + if (dev->tx_suspend) { + sal_spinlock_unlock(txq->mutex); + } else { + sal_sem_give(txq->sem); + } + return SHR_E_NONE; + } + bm->tx_buf_dma(dev, txq, pbuf, &addr); + flags |= pkh->attrs & PDMA_TX_HIGIG_PKT ? CMICD_DESC_TX_HIGIG_PKT : 0; + flags |= pkh->attrs & PDMA_TX_PAUSE_PKT ? CMICD_DESC_TX_PAUSE_PKT : 0; + flags |= pkh->attrs & PDMA_TX_PURGE_PKT ? CMICD_DESC_TX_PURGE_PKT : 0; + cmicd_tx_desc_config(&ring[curr], addr, pbuf->len, flags); + if (pkh->meta_len) { + sal_memcpy(&ring[curr].md, &pbuf->pkb->data, sizeof(ring->md.data)); + } + } + + /* Notify HNET to process if needed */ + if (dev->mode == DEV_MODE_VNET) { + MEMORY_BARRIER; + if (!CMICD_DESC_CTRL_LEN(ring[(curr + txq->nb_desc - 1) % txq->nb_desc].ctrl)) { + dev->xnet_wake(dev); + } + } + + /* Update the indicators */ + curr = (curr + 1) % txq->nb_desc; + txq->curr = curr; + + /* Start DMA if in chain mode */ + if (dev->flags & PDMA_CHAIN_MODE) { + if (txq->state & PDMA_TX_QUEUE_POLL) { + do { + rv = cmicd_pdma_tx_ring_clean(hw, txq, txq->nb_desc - 1); + if (rv != (int)txq->nb_desc - 1) { + break; + } + sal_usleep(1); + } while (retry--); + if (retry <= 0) { + CNET_PR("Last Tx could not be done in given time\n"); + } + } + sal_spinlock_lock(txq->lock); + if (txq->dirt == txq->halt && txq->dirt != curr) { + hw->hdls.chan_stop(hw, txq->chan_id); + cmicd_tx_desc_chain(&ring[(curr + txq->nb_desc - 1) % txq->nb_desc], 0); + hw->hdls.chan_setup(hw, txq->chan_id, + txq->ring_addr + sizeof(struct cmicd_tx_desc) * txq->halt); + hw->hdls.chan_start(hw, txq->chan_id); + txq->halt = curr; + } + sal_spinlock_unlock(txq->lock); + } + + /* Kick off DMA */ + txq->halt_addr = txq->ring_addr + sizeof(struct cmicd_tx_desc) * curr; + hw->hdls.chan_goto(hw, txq->chan_id, txq->halt_addr); + + /* Count the packets/bytes */ + txq->stats.packets++; + txq->stats.bytes += pbuf->len; + + /* Clean up ring if in polling mode */ + if (txq->state & PDMA_TX_QUEUE_POLL && + cmicd_pdma_tx_ring_unused(txq) <= (int)txq->free_thresh) { + cmicd_pdma_tx_ring_clean(hw, txq, txq->nb_desc - txq->free_thresh); + } + + /* Suspend Tx if no resource */ + rv = cmicd_pdma_tx_ring_check(hw, txq); + if (SHR_FAILURE(rv)) { + if (dev->mode == DEV_MODE_VNET) { + dev->xnet_wake(dev); + } + + if (txq->state & PDMA_TX_QUEUE_POLL) { + /* In polling mode, must wait till the ring is available */ + do { + cmicd_pdma_tx_ring_clean(hw, txq, txq->free_thresh); + if (!(txq->state & PDMA_TX_QUEUE_XOFF)) { + break; + } + sal_usleep(1); + } while (retry--); + if (retry <= 0) { + CNET_PR("Fatal error: Tx ring is full, packets have not been transmitted for 5 seconds\n"); + if (!dev->tx_suspend) { + sal_sem_give(txq->sem); + return SHR_E_RESOURCE; + } + } + } else { + /* In interrupt mode, the handle thread will wake up Tx */ + if (!dev->tx_suspend) { + return SHR_E_NONE; + } + } + } + + if (dev->tx_suspend) { + sal_spinlock_unlock(txq->mutex); + } else { + sal_sem_give(txq->sem); + } + + return SHR_E_NONE; +} + +/*! + * Suspend Rx queue + */ +static int +cmicd_pdma_rx_suspend(struct pdma_hw *hw, struct pdma_rx_queue *rxq) +{ + sal_spinlock_lock(rxq->lock); + rxq->state |= PDMA_RX_QUEUE_XOFF; + if (hw->dev->flags & PDMA_CHAIN_MODE) { + hw->hdls.chan_stop(hw, rxq->chan_id); + } + sal_spinlock_unlock(rxq->lock); + + return SHR_E_NONE; +} + +/*! + * Resume Rx queue + */ +static int +cmicd_pdma_rx_resume(struct pdma_hw *hw, struct pdma_rx_queue *rxq) +{ + sal_spinlock_lock(rxq->lock); + if (!(rxq->state & PDMA_RX_QUEUE_XOFF)) { + sal_spinlock_unlock(rxq->lock); + return SHR_E_NONE; + } + if (rxq->state & PDMA_RX_BATCH_REFILL) { + rxq->halt_addr = rxq->ring_addr + sizeof(struct cmicd_rx_desc) * rxq->halt; + hw->hdls.chan_goto(hw, rxq->chan_id, rxq->halt_addr); + } else if (rxq->halt == rxq->curr || (rxq->halt == rxq->nb_desc && rxq->curr == 0)) { + rxq->halt = (rxq->curr + 1) % rxq->nb_desc; + rxq->halt_addr = rxq->ring_addr + sizeof(struct cmicd_rx_desc) * rxq->halt; + hw->hdls.chan_goto(hw, rxq->chan_id, rxq->halt_addr); + } + if (hw->dev->flags & PDMA_CHAIN_MODE) { + rxq->curr = 0; + hw->hdls.chan_start(hw, rxq->chan_id); + } + rxq->state &= ~PDMA_RX_QUEUE_XOFF; + sal_spinlock_unlock(rxq->lock); + + return SHR_E_NONE; +} + +/*! + * Initialize function pointers + */ +int +bcmcnet_cmicd_pdma_desc_ops_init(struct pdma_hw *hw) +{ + if (!hw) { + return SHR_E_PARAM; + } + + hw->dops.rx_desc_init = cmicd_pdma_rx_desc_init; + hw->dops.rx_desc_clean = cmicd_pdma_rx_desc_clean; + hw->dops.rx_ring_clean = cmicd_pdma_rx_ring_clean; + hw->dops.rx_ring_dump = cmicd_pdma_rx_ring_dump; + hw->dops.rx_suspend = cmicd_pdma_rx_suspend; + hw->dops.rx_resume = cmicd_pdma_rx_resume; + hw->dops.tx_desc_init = cmicd_pdma_tx_desc_init; + hw->dops.tx_desc_clean = cmicd_pdma_tx_desc_clean; + hw->dops.tx_ring_clean = cmicd_pdma_tx_ring_clean; + hw->dops.tx_ring_dump = cmicd_pdma_tx_ring_dump; + hw->dops.pkt_xmit = cmicd_pdma_pkt_xmit; + + return SHR_E_NONE; +} + +/*! + * Attach device driver + */ +int +bcmcnet_cmicd_pdma_driver_attach(struct pdma_dev *dev) +{ + struct pdma_hw *hw = NULL; + + /* Allocate memory for HW data */ + hw = sal_alloc(sizeof(*hw), "bcmcnetPdmaHw"); + if (!hw) { + return SHR_E_MEMORY; + } + sal_memset(hw, 0, sizeof(*hw)); + hw->unit = dev->unit; + hw->dev = dev; + dev->ctrl.hw = hw; + + bcmcnet_cmicd_pdma_hw_hdls_init(hw); + bcmcnet_cmicd_pdma_desc_ops_init(hw); + + return SHR_E_NONE; +} + +/*! + * Detach device driver + */ +int +bcmcnet_cmicd_pdma_driver_detach(struct pdma_dev *dev) +{ + if (dev->ctrl.hw) { + sal_free(dev->ctrl.hw); + } + dev->ctrl.hw = NULL; + + return SHR_E_NONE; +} + diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/hmi/cmicx/bcmcnet_cmicx_pdma_hw.c b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/hmi/cmicx/bcmcnet_cmicx_pdma_hw.c new file mode 100644 index 000000000000..6dc77c4b7c04 --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/hmi/cmicx/bcmcnet_cmicx_pdma_hw.c @@ -0,0 +1,604 @@ +/*! \file bcmcnet_cmicx_pdma_hw.c + * + * Utility routines for handling BCMCNET hardware (CMICx). + * + */ +/* + * $Copyright: Copyright 2018-2020 Broadcom. All rights reserved. + * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * A copy of the GNU General Public License version 2 (GPLv2) can + * be found in the LICENSES folder.$ + */ + +#include +#include +#include +#include + +/*! + * Read 32-bit register + */ +static inline void +cmicx_pdma_reg_read32(struct pdma_hw *hw, uint32_t addr, uint32_t *data) +{ + if (hw->dev->dev_read32) { + hw->dev->dev_read32(hw->dev, addr, data); + } else { + DEV_READ32(&hw->dev->ctrl, addr, data); + } +} + +/*! + * Write 32-bit register + */ +static inline void +cmicx_pdma_reg_write32(struct pdma_hw *hw, uint32_t addr, uint32_t data) +{ + if (hw->dev->dev_write32) { + hw->dev->dev_write32(hw->dev, addr, data); + } else { + DEV_WRITE32(&hw->dev->ctrl, addr, data); + } +} + +/*! + * Enable interrupt for a channel + */ +static inline void +cmicx_pdma_intr_enable(struct pdma_hw *hw, int cmc, int chan, uint32_t mask) +{ + uint32_t reg, irq_mask; + + hw->dev->ctrl.grp[cmc].irq_mask |= mask; + irq_mask = hw->dev->ctrl.grp[cmc].irq_mask; + if (cmc == 0) { + reg = CMICX_PDMA_IRQ_RAW_STAT0; + } else { + if (chan < 4) { + reg = CMICX_PDMA_IRQ_RAW_STAT1; + hw->dev->ctrl.grp[cmc].irq_mask <<= CMICX_IRQ_MASK_SHIFT; + } else { + reg = CMICX_PDMA_IRQ_RAW_STAT2; + hw->dev->ctrl.grp[cmc].irq_mask >>= 32 - CMICX_IRQ_MASK_SHIFT; + } + } + + hw->dev->intr_unmask(hw->dev, cmc, chan, reg & 0xfff, 0); + hw->dev->ctrl.grp[cmc].irq_mask = irq_mask; +} + +/*! + * Disable interrupt for a channel + */ +static inline void +cmicx_pdma_intr_disable(struct pdma_hw *hw, int cmc, int chan, uint32_t mask) +{ + uint32_t reg, irq_mask; + + hw->dev->ctrl.grp[cmc].irq_mask &= ~mask; + irq_mask = hw->dev->ctrl.grp[cmc].irq_mask; + if (cmc == 0) { + reg = CMICX_PDMA_IRQ_RAW_STAT0; + } else { + if (chan < 4) { + reg = CMICX_PDMA_IRQ_RAW_STAT1; + hw->dev->ctrl.grp[cmc].irq_mask <<= CMICX_IRQ_MASK_SHIFT; + } else { + reg = CMICX_PDMA_IRQ_RAW_STAT2; + hw->dev->ctrl.grp[cmc].irq_mask >>= 32 - CMICX_IRQ_MASK_SHIFT; + } + } + + hw->dev->intr_mask(hw->dev, cmc, chan, reg & 0xfff, 0); + hw->dev->ctrl.grp[cmc].irq_mask = irq_mask; +} + +/*! + * Release Packet DMA credits to EP. + */ +static int +cmicx_pdma_credits_release(struct pdma_hw *hw) +{ + int credits; + uint32_t val; + + /* + * Since only 6 bits of iproc_cmic_to_ep_credits[5:0] are being used, + * so we have to set the max credits value twice in order to release + * 64 credits to EP. + * Only do this once when HW is initialized. + */ + hw->hdls.reg_rd32(hw, CMICX_EPINTF_RELEASE_CREDITS, &val); + if (!val) { + credits = 63; + hw->hdls.reg_wr32(hw, CMICX_EPINTF_MAX_CREDITS, (0x1 << 8) | credits); + hw->hdls.reg_wr32(hw, CMICX_EPINTF_RELEASE_CREDITS, 1); + + hw->hdls.reg_wr32(hw, CMICX_EPINTF_RELEASE_CREDITS, 0); + credits = 1; + hw->hdls.reg_wr32(hw, CMICX_EPINTF_MAX_CREDITS, (0x1 << 8) | credits); + hw->hdls.reg_wr32(hw, CMICX_EPINTF_RELEASE_CREDITS, 1); + } + + return SHR_E_NONE; +} + +/*! + * Initialize HW + */ +static int +cmicx_pdma_hw_init(struct pdma_hw *hw) +{ + dev_mode_t mode = DEV_MODE_MAX; + uint32_t val; + + /* Temporarily upgrade work mode to get HW information in VNET mode. */ + if (hw->dev->mode == DEV_MODE_VNET) { + mode = DEV_MODE_VNET; + hw->dev->mode = DEV_MODE_UNET; + } + + /* Release Packet DMA credits to EP. */ + cmicx_pdma_credits_release(hw); + + hw->info.name = CMICX_DEV_NAME; + hw->info.dev_id = hw->dev->dev_id; + hw->info.num_cmcs = CMICX_PDMA_CMC_MAX; + hw->info.cmc_chans = CMICX_PDMA_CMC_CHAN; + hw->info.num_chans = CMICX_PDMA_CMC_MAX * CMICX_PDMA_CMC_CHAN; + hw->info.rx_dcb_size = CMICX_PDMA_DCB_SIZE; + hw->info.tx_dcb_size = CMICX_PDMA_DCB_SIZE; + hw->hdls.reg_rd32(hw, CMICX_EP_TO_CPU_HEADER_SIZE, &val); + hw->info.rx_ph_size = (val & 0xf) * 8; + hw->info.tx_ph_size = CMICX_TX_PKT_HDR_SIZE; + + /* Restore work mode to VNET. */ + if (mode == DEV_MODE_VNET) { + hw->dev->mode = DEV_MODE_VNET; + } + + return SHR_E_NONE; +} + +/*! + * Configure HW + */ +static int +cmicx_pdma_hw_config(struct pdma_hw *hw) +{ + struct dev_ctrl *ctrl = &hw->dev->ctrl; + struct pdma_rx_queue *rxq = NULL; + struct pdma_tx_queue *txq = NULL; + uint32_t val, que_ctrl; + int grp, que; + uint32_t qi; + int ip_if_hdr_endian = 0; + + for (qi = 0; qi < ctrl->nb_rxq; qi++) { + rxq = (struct pdma_rx_queue *)ctrl->rx_queue[qi]; + grp = rxq->group_id; + que = rxq->chan_id % CMICX_PDMA_CMC_CHAN; + que_ctrl = ctrl->grp[grp].que_ctrl[que]; + + hw->hdls.reg_wr32(hw, CMICX_PDMA_IRQ_STAT_CLR(grp), CMICX_PDMA_IRQ_MASK(que)); + val = 0; + if (que_ctrl & PDMA_PKT_BYTE_SWAP) { + val |= CMICX_PDMA_PKT_BIG_ENDIAN; + } + if (que_ctrl & PDMA_OTH_BYTE_SWAP) { + val |= CMICX_PDMA_DESC_BIG_ENDIAN; + } + if (que_ctrl & PDMA_HDR_BYTE_SWAP) { + val |= CMICX_PDMA_HDR_BIG_ENDIAN; + } + if (!(hw->dev->flags & PDMA_CHAIN_MODE)) { + val |= CMICX_PDMA_CONTINUOUS; + } + if (hw->dev->flags & PDMA_DESC_PREFETCH) { + val |= CMICX_PDMA_CONTINUOUS_DESC; + } + val |= CMICX_PDMA_INTR_ON_DESC; + hw->hdls.reg_wr32(hw, CMICX_PDMA_CTRL(grp, que), val); + } + + for (qi = 0; qi < ctrl->nb_txq; qi++) { + txq = (struct pdma_tx_queue *)ctrl->tx_queue[qi]; + grp = txq->group_id; + que = txq->chan_id % CMICX_PDMA_CMC_CHAN; + que_ctrl = ctrl->grp[grp].que_ctrl[que]; + + hw->hdls.reg_wr32(hw, CMICX_PDMA_IRQ_STAT_CLR(grp), CMICX_PDMA_IRQ_MASK(que)); + val = 0; + if (que_ctrl & PDMA_PKT_BYTE_SWAP) { + val |= CMICX_PDMA_PKT_BIG_ENDIAN; + val |= CMICX_PDMA_HDR_BIG_ENDIAN; + ip_if_hdr_endian = 1; + } + if (que_ctrl & PDMA_OTH_BYTE_SWAP) { + val |= CMICX_PDMA_DESC_BIG_ENDIAN; + } + if (que_ctrl & PDMA_HDR_BYTE_SWAP) { + ip_if_hdr_endian = 1; + } + if (!(hw->dev->flags & PDMA_CHAIN_MODE)) { + val |= CMICX_PDMA_CONTINUOUS; + } + if (hw->dev->flags & PDMA_DESC_PREFETCH) { + val |= CMICX_PDMA_CONTINUOUS_DESC; + } + val |= CMICX_PDMA_INTR_ON_DESC | CMICX_PDMA_DIR; + hw->hdls.reg_wr32(hw, CMICX_PDMA_CTRL(grp, que), val); + } + + if (ip_if_hdr_endian == 1) { + hw->hdls.reg_rd32(hw, CMICX_TOP_CONFIG, &val); + val |= 0x80; + hw->hdls.reg_wr32(hw, CMICX_TOP_CONFIG, val); + } + + return SHR_E_NONE; +} + +/*! + * Reset HW + */ +static int +cmicx_pdma_hw_reset(struct pdma_hw *hw) +{ + int gi, qi; + + for (gi = 0; gi < hw->dev->num_groups; gi++) { + if (!hw->dev->ctrl.grp[gi].attached) { + continue; + } + for (qi = 0; qi < CMICX_PDMA_CMC_CHAN; qi++) { + if (1 << qi & hw->dev->ctrl.grp[gi].bm_rxq || + 1 << qi & hw->dev->ctrl.grp[gi].bm_txq) { + hw->hdls.reg_wr32(hw, CMICX_PDMA_CTRL(gi, qi), 0); + } + } + } + + return SHR_E_NONE; +} + +/*! + * Start a channel + */ +static int +cmicx_pdma_chan_start(struct pdma_hw *hw, int chan) +{ + uint32_t val; + int grp, que; + + grp = chan / CMICX_PDMA_CMC_CHAN; + que = chan % CMICX_PDMA_CMC_CHAN; + + hw->hdls.reg_rd32(hw, CMICX_PDMA_CTRL(grp, que), &val); + val |= CMICX_PDMA_ENABLE; + hw->hdls.reg_wr32(hw, CMICX_PDMA_CTRL(grp, que), val); + + MEMORY_BARRIER; + + return SHR_E_NONE; +} + +/*! + * Stop a channel + */ +static int +cmicx_pdma_chan_stop(struct pdma_hw *hw, int chan) +{ + uint32_t val; + int grp, que; + int retry = CMICX_HW_RETRY_TIMES; + + grp = chan / CMICX_PDMA_CMC_CHAN; + que = chan % CMICX_PDMA_CMC_CHAN; + + hw->hdls.reg_rd32(hw, CMICX_PDMA_CTRL(grp, que), &val); + val |= CMICX_PDMA_ENABLE | CMICX_PDMA_ABORT; + hw->hdls.reg_wr32(hw, CMICX_PDMA_CTRL(grp, que), val); + + MEMORY_BARRIER; + + do { + val = ~CMICX_PDMA_IS_ACTIVE; + hw->hdls.reg_rd32(hw, CMICX_PDMA_STAT(grp, que), &val); + } while ((val & CMICX_PDMA_IS_ACTIVE) && (--retry > 0)); + + hw->hdls.reg_rd32(hw, CMICX_PDMA_CTRL(grp, que), &val); + val &= ~(CMICX_PDMA_ENABLE | CMICX_PDMA_ABORT); + hw->hdls.reg_wr32(hw, CMICX_PDMA_CTRL(grp, que), val); + + hw->hdls.reg_wr32(hw, CMICX_PDMA_IRQ_STAT_CLR(grp), CMICX_PDMA_IRQ_MASK(que)); + + MEMORY_BARRIER; + + return SHR_E_NONE; +} + +/*! + * Setup a channel + */ +static int +cmicx_pdma_chan_setup(struct pdma_hw *hw, int chan, uint64_t addr) +{ + int grp, que; + + grp = chan / CMICX_PDMA_CMC_CHAN; + que = chan % CMICX_PDMA_CMC_CHAN; + + hw->hdls.reg_wr32(hw, CMICX_PDMA_DESC_LO(grp, que), addr); + hw->hdls.reg_wr32(hw, CMICX_PDMA_DESC_HI(grp, que), DMA_TO_BUS_HI(addr >> 32)); + + MEMORY_BARRIER; + + return SHR_E_NONE; +} + +/*! + * Set halt point for a channel + */ +static int +cmicx_pdma_chan_goto(struct pdma_hw *hw, int chan, uint64_t addr) +{ + int grp, que; + + grp = chan / CMICX_PDMA_CMC_CHAN; + que = chan % CMICX_PDMA_CMC_CHAN; + + hw->hdls.reg_wr32(hw, CMICX_PDMA_DESC_HALT_LO(grp, que), addr); + hw->hdls.reg_wr32(hw, CMICX_PDMA_DESC_HALT_HI(grp, que), DMA_TO_BUS_HI(addr >> 32)); + + MEMORY_BARRIER; + + return SHR_E_NONE; +} + +/*! + * Clear a channel + */ +static int +cmicx_pdma_chan_clear(struct pdma_hw *hw, int chan) +{ + int grp, que; + + grp = chan / CMICX_PDMA_CMC_CHAN; + que = chan % CMICX_PDMA_CMC_CHAN; + + hw->hdls.reg_wr32(hw, CMICX_PDMA_IRQ_STAT_CLR(grp), CMICX_PDMA_IRQ_CTRLD_INTR(que)); + + MEMORY_BARRIER; + + return SHR_E_NONE; +} + +/*! + * Get interrupt number for a channel + */ +static int +cmicx_pdma_chan_intr_num_get(struct pdma_hw *hw, int chan) +{ + int grp, que, start_num, mask_shift; + + grp = chan / CMICX_PDMA_CMC_CHAN; + que = chan % CMICX_PDMA_CMC_CHAN; + + mask_shift = 0; + if (grp > 0) { + mask_shift = CMICX_IRQ_MASK_SHIFT + grp * 32; + } + start_num = CMICX_IRQ_START_NUM + mask_shift; + + return start_num + (que * CMICX_IRQ_NUM_OFFSET); +} + +/*! + * Enable interrupt for a channel + */ +static int +cmicx_pdma_chan_intr_enable(struct pdma_hw *hw, int chan) +{ + int grp, que; + + grp = chan / CMICX_PDMA_CMC_CHAN; + que = chan % CMICX_PDMA_CMC_CHAN; + + cmicx_pdma_intr_enable(hw, grp, que, CMICX_PDMA_IRQ_CTRLD_INTR(que)); + + return SHR_E_NONE; +} + +/*! + * Disable interrupt for a channel + */ +static int +cmicx_pdma_chan_intr_disable(struct pdma_hw *hw, int chan) +{ + int grp, que; + + grp = chan / CMICX_PDMA_CMC_CHAN; + que = chan % CMICX_PDMA_CMC_CHAN; + + cmicx_pdma_intr_disable(hw, grp, que, CMICX_PDMA_IRQ_CTRLD_INTR(que)); + + return SHR_E_NONE; +} + +/*! + * Query interrupt status for a channel + * + * In group mode (interrupt processing per CMC), need to query each channel's + * interrupt status. + * + */ +static int +cmicx_pdma_chan_intr_query(struct pdma_hw *hw, int chan) +{ + uint32_t val; + int grp, que; + + grp = chan / CMICX_PDMA_CMC_CHAN; + que = chan % CMICX_PDMA_CMC_CHAN; + + hw->hdls.reg_rd32(hw, CMICX_PDMA_IRQ_STAT(grp), &val); + + return val & CMICX_PDMA_IRQ_CTRLD_INTR(que); +} + +/*! + * Check interrupt validity for a channel + * + * In group mode (interrupt processing per CMC), need to check each channel's + * interrupt validity based on its interrupt mask. + * + */ +static int +cmicx_pdma_chan_intr_check(struct pdma_hw *hw, int chan) +{ + int grp, que; + + grp = chan / CMICX_PDMA_CMC_CHAN; + que = chan % CMICX_PDMA_CMC_CHAN; + + if (!(hw->dev->ctrl.grp[grp].irq_mask & CMICX_PDMA_IRQ_CTRLD_INTR(que))) { + return 0; + } + + return cmicx_pdma_chan_intr_query(hw, chan); +} + +/*! + * Coalesce interrupt for a channel + */ +static int +cmicx_pdma_chan_intr_coalesce(struct pdma_hw *hw, int chan, int count, int timer) +{ + uint32_t val; + int grp, que; + + grp = chan / CMICX_PDMA_CMC_CHAN; + que = chan % CMICX_PDMA_CMC_CHAN; + + val = CMICX_PDMA_INTR_COAL_ENA | + CMICX_PDMA_INTR_THRESH(count) | + CMICX_PDMA_INTR_TIMER(timer); + hw->hdls.reg_wr32(hw, CMICX_PDMA_INTR_COAL(grp, que), val); + + return SHR_E_NONE; +} + +/*! + * Dump registers for a channel + */ +static int +cmicx_pdma_chan_reg_dump(struct pdma_hw *hw, int chan) +{ + uint32_t val; + int grp, que; + + grp = chan / CMICX_PDMA_CMC_CHAN; + que = chan % CMICX_PDMA_CMC_CHAN; + + hw->hdls.reg_rd32(hw, CMICX_PDMA_CTRL(grp, que), &val); + CNET_PR("CMIC_CMC%d_DMA_CH%d_CTRL: 0x%08x\n", grp, que, val); + + hw->hdls.reg_rd32(hw, CMICX_PDMA_DESC_LO(grp, que), &val); + CNET_PR("CMIC_CMC%d_DMA_CH%d_DESC_LO: 0x%08x\n", grp, que, val); + + hw->hdls.reg_rd32(hw, CMICX_PDMA_DESC_HI(grp, que), &val); + CNET_PR("CMIC_CMC%d_DMA_CH%d_DESC_HI: 0x%08x\n", grp, que, val); + + hw->hdls.reg_rd32(hw, CMICX_PDMA_CURR_DESC_LO(grp, que), &val); + CNET_PR("CMIC_CMC%d_DMA_CH%d_CURR_DESC_LO: 0x%08x\n", grp, que, val); + + hw->hdls.reg_rd32(hw, CMICX_PDMA_CURR_DESC_HI(grp, que), &val); + CNET_PR("CMIC_CMC%d_DMA_CH%d_CURR_DESC_HI: 0x%08x\n", grp, que, val); + + hw->hdls.reg_rd32(hw, CMICX_PDMA_DESC_HALT_LO(grp, que), &val); + CNET_PR("CMIC_CMC%d_DMA_CH%d_DESC_HALT_ADDR_LO: 0x%08x\n", grp, que, val); + + hw->hdls.reg_rd32(hw, CMICX_PDMA_DESC_HALT_HI(grp, que), &val); + CNET_PR("CMIC_CMC%d_DMA_CH%d_DESC_HALT_ADDR_HI: 0x%08x\n", grp, que, val); + + hw->hdls.reg_rd32(hw, CMICX_PDMA_COS_CTRL_RX0(grp, que), &val); + CNET_PR("CMIC_CMC%d_DMA_CH%d_COS_CTRL_RX_0: 0x%08x\n", grp, que, val); + + hw->hdls.reg_rd32(hw, CMICX_PDMA_COS_CTRL_RX1(grp, que), &val); + CNET_PR("CMIC_CMC%d_DMA_CH%d_COS_CTRL_RX_1: 0x%08x\n", grp, que, val); + + hw->hdls.reg_rd32(hw, CMICX_PDMA_INTR_COAL(grp, que), &val); + CNET_PR("CMIC_CMC%d_DMA_CH%d_INTR_COAL: 0x%08x\n", grp, que, val); + + hw->hdls.reg_rd32(hw, CMICX_PDMA_RBUF_THRE(grp, que), &val); + CNET_PR("CMIC_CMC%d_DMA_CH%d_RXBUF_THRESHOLD_CONFIG: 0x%08x\n", grp, que, val); + + hw->hdls.reg_rd32(hw, CMICX_PDMA_STAT(grp, que), &val); + CNET_PR("CMIC_CMC%d_DMA_CH%d_STAT: 0x%08x\n", grp, que, val); + + hw->hdls.reg_rd32(hw, CMICX_PDMA_COUNT_RX(grp, que), &val); + CNET_PR("CMIC_CMC%d_DMA_CH%d_PKT_COUNT_RXPKT: 0x%08x\n", grp, que, val); + + hw->hdls.reg_rd32(hw, CMICX_PDMA_COUNT_TX(grp, que), &val); + CNET_PR("CMIC_CMC%d_DMA_CH%d_PKT_COUNT_TXPKT: 0x%08x\n", grp, que, val); + + hw->hdls.reg_rd32(hw, CMICX_PDMA_COUNT_RX_DROP(grp, que), &val); + CNET_PR("CMIC_CMC%d_DMA_CH%d_PKT_COUNT_RXPKT_DROP: 0x%08x\n", grp, que, val); + + hw->hdls.reg_rd32(hw, CMICX_PDMA_IRQ_STAT(grp), &val); + CNET_PR("CMIC_CMC%d_IRQ_STAT: 0x%08x\n", grp, val); + + hw->hdls.reg_rd32(hw, CMICX_PDMA_IRQ_STAT_CLR(grp), &val); + CNET_PR("CMIC_CMC%d_IRQ_STAT_CLR: 0x%08x\n", grp, val); + + val = hw->dev->ctrl.grp[grp].irq_mask; + CNET_PR("CMIC_CMC%d_IRQ_ENAB: 0x%08x\n", grp, val); + + hw->hdls.reg_rd32(hw, CMICX_EP_TO_CPU_HEADER_SIZE, &val); + CNET_PR("CMIC_EP_TO_CPU_HEADER_SIZE: 0x%08x\n", val); + + return SHR_E_NONE; +} + +/*! + * Initialize function pointers + */ +int +bcmcnet_cmicx_pdma_hw_hdls_init(struct pdma_hw *hw) +{ + if (!hw) { + return SHR_E_PARAM; + } + + hw->hdls.reg_rd32 = cmicx_pdma_reg_read32; + hw->hdls.reg_wr32 = cmicx_pdma_reg_write32; + hw->hdls.hw_init = cmicx_pdma_hw_init; + hw->hdls.hw_config = cmicx_pdma_hw_config; + hw->hdls.hw_reset = cmicx_pdma_hw_reset; + hw->hdls.chan_start = cmicx_pdma_chan_start; + hw->hdls.chan_stop = cmicx_pdma_chan_stop; + hw->hdls.chan_setup = cmicx_pdma_chan_setup; + hw->hdls.chan_goto = cmicx_pdma_chan_goto; + hw->hdls.chan_clear = cmicx_pdma_chan_clear; + hw->hdls.chan_intr_num_get = cmicx_pdma_chan_intr_num_get; + hw->hdls.chan_intr_enable = cmicx_pdma_chan_intr_enable; + hw->hdls.chan_intr_disable = cmicx_pdma_chan_intr_disable; + hw->hdls.chan_intr_query = cmicx_pdma_chan_intr_query; + hw->hdls.chan_intr_check = cmicx_pdma_chan_intr_check; + hw->hdls.chan_intr_coalesce = cmicx_pdma_chan_intr_coalesce; + hw->hdls.chan_reg_dump = cmicx_pdma_chan_reg_dump; + + return SHR_E_NONE; +} + diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/hmi/cmicx/bcmcnet_cmicx_pdma_rxtx.c b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/hmi/cmicx/bcmcnet_cmicx_pdma_rxtx.c new file mode 100644 index 000000000000..651728465d56 --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/hmi/cmicx/bcmcnet_cmicx_pdma_rxtx.c @@ -0,0 +1,1094 @@ +/*! \file bcmcnet_cmicx_pdma_rxtx.c + * + * Utility routines for BCMCNET hardware (CMICx) specific Rx/Tx. + * + * Here are the CMIC specific Rx/Tx routines including DCBs resource allocation + * and clean up, DCBs configuration, Rx buffers allocation, Tx buffers release, + * Rx/Tx packets processing, etc. + * They are shared among all the modes (UNET, KNET, VNET, HNET) and in both of + * user space and kernel space. + * + * The driver uses a ring of DCBs per DMA channel based on Continuous DMA mode. + * The beginning is written to register pointing to the physical address of the + * start of the ring. The ring size is maintained by the driver. A HALT DCB + * physical address is written to DMA register timely to indicate how many DCBs + * can be handled by HW. + * + * When a packet is received, an interrupt is triggered. The handler will go + * through the Rx DCB ring to process the current completed DCB and every + * subsequent DCBs until no one is left. The received packet is processed and + * passed up to the high level SW. After that, a new buffer is allocated and + * the DCB is updated for receiving a new packet. A new HALT DCB is selected + * and its physical address is written to DMA register. + * + * When a packet is transmitted, the driver starts where it left off last time + * in the Tx DCB ring, updates the DCB and writes its physical address to DMA + * register so as to start DMA. Once the transmitting is finished, the handler + * is informed to clean up the buffer based on the work mode. In KNET or HNET + * mode, an interrupt will be triggered. Polling mode is used in CNET or VNET + * mode, the buffers will be cleaned up when the number of dirty DCBs reaches + * a pre-defined threshold. + * + * In VNET and HNET modes, DCB updating between virtual ring and real ring and + * a IOCTL based notification mechanism are involved. The hypervisor in kernel + * emulates the DMA HW behaviors to update DCBs in virtual network and inform + * the handler something happened. Likewise, the hypervisor updates itself real + * DCB ring from the virtual ring to start DMA for transmitting a packet once a + * notification is received from the virtual network. + * + */ +/* + * $Copyright: Copyright 2018-2020 Broadcom. All rights reserved. + * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * A copy of the GNU General Public License version 2 (GPLv2) can + * be found in the LICENSES folder.$ + */ + +#include +#include +#include +#include +#include + +/*! + * Configure Rx descriptor + */ +static inline void +cmicx_rx_desc_config(struct cmicx_rx_desc *rd, uint64_t addr, uint32_t len) +{ + uint32_t ctrl; + + rd->addr_lo = addr; + rd->addr_hi = DMA_TO_BUS_HI(addr >> 32); + rd->status = 0; + ctrl = rd->ctrl; + ctrl &= CMICX_DESC_CTRL_REMAIN(0xf); + ctrl |= CMICX_DESC_CTRL_CNTLD_INTR | CMICX_DESC_CTRL_CHAIN | + CMICX_DESC_CTRL_LEN(len); + rd->ctrl = ctrl; +} + +/*! + * Configure Tx descriptor + */ +static inline void +cmicx_tx_desc_config(struct cmicx_tx_desc *td, uint64_t addr, uint32_t len, uint32_t flags) +{ + uint32_t ctrl; + + td->addr_lo = addr; + td->addr_hi = DMA_TO_BUS_HI(addr >> 32); + td->status = 0; + ctrl = td->ctrl; + ctrl &= CMICX_DESC_CTRL_REMAIN(0xf); + ctrl |= CMICX_DESC_CTRL_CNTLD_INTR | CMICX_DESC_CTRL_CHAIN | + CMICX_DESC_CTRL_FLAGS(flags) | CMICX_DESC_CTRL_LEN(len); + td->ctrl = ctrl; +} + +/*! + * Configure Rx reload descriptor + */ +static inline void +cmicx_rx_rldesc_config(struct cmicx_rx_desc *rd, uint64_t addr) +{ + rd->addr_lo = addr; + rd->addr_hi = DMA_TO_BUS_HI(addr >> 32); + rd->status = 0; + rd->ctrl = CMICX_DESC_CTRL_CNTLD_INTR | CMICX_DESC_CTRL_CHAIN | + CMICX_DESC_CTRL_RELOAD; +} + +/*! + * Configure Tx reload descriptor + */ +static inline void +cmicx_tx_rldesc_config(struct cmicx_tx_desc *td, uint64_t addr) +{ + td->addr_lo = addr; + td->addr_hi = DMA_TO_BUS_HI(addr >> 32); + td->status = 0; + td->ctrl = CMICX_DESC_CTRL_CNTLD_INTR | CMICX_DESC_CTRL_CHAIN | + CMICX_DESC_CTRL_RELOAD; +} + +/*! + * Chain Rx descriptor + */ +static inline void +cmicx_rx_desc_chain(struct cmicx_rx_desc *rd, int chain) +{ + if (chain) { + rd->ctrl |= CMICX_DESC_CTRL_CHAIN; + } else { + rd->ctrl &= ~CMICX_DESC_CTRL_CHAIN; + } +} + +/*! + * Chain Tx descriptor + */ +static inline void +cmicx_tx_desc_chain(struct cmicx_tx_desc *td, int chain) +{ + if (chain) { + td->ctrl |= CMICX_DESC_CTRL_CHAIN; + } else { + td->ctrl &= ~CMICX_DESC_CTRL_CHAIN; + } +} + +/*! + * Set Rx descriptor remain + */ +static inline void +cmicx_rx_desc_remain(struct cmicx_rx_desc *rd, uint32_t rm) +{ + rd->ctrl &= ~CMICX_DESC_CTRL_REMAIN(0xf); + rd->ctrl |= CMICX_DESC_CTRL_REMAIN(rm); +} + +/*! + * Set Tx descriptor remain + */ +static inline void +cmicx_tx_desc_remain(struct cmicx_tx_desc *td, uint32_t rm) +{ + td->ctrl &= ~CMICX_DESC_CTRL_REMAIN(0xf); + td->ctrl |= CMICX_DESC_CTRL_REMAIN(rm); +} + +/*! + * Get unused descriptors in a Rx ring + */ +static inline int +cmicx_pdma_rx_ring_unused(struct pdma_rx_queue *rxq) +{ + /* Leave one descriptor unused so as not to halt */ + return rxq->curr > rxq->halt ? + rxq->curr - rxq->halt - 1 : + rxq->nb_desc + rxq->curr - rxq->halt - 1; +} + +/*! + * Get unused descriptors in a Tx ring + */ +static inline int +cmicx_pdma_tx_ring_unused(struct pdma_tx_queue *txq) +{ + /* Leave one descriptor unused so as not to halt */ + return txq->dirt > txq->curr ? + txq->dirt - txq->curr - 1 : + txq->nb_desc + txq->dirt - txq->curr - 1; +} + +/*! + * Initialize Rx descriptors + */ +static int +cmicx_pdma_rx_desc_init(struct pdma_hw *hw, struct pdma_rx_queue *rxq) +{ + struct pdma_dev *dev = hw->dev; + struct pdma_buf_mngr *bm = (struct pdma_buf_mngr *)dev->ctrl.buf_mngr; + struct cmicx_rx_desc *ring = (struct cmicx_rx_desc *)rxq->ring; + dma_addr_t addr; + uint32_t di, rm; + int rv; + + for (di = 0; di < rxq->nb_desc; di++) { + if (!rxq->pbuf[di].dma) { + /* Allocate pktbuf for ring entry */ + rv = bm->rx_buf_alloc(dev, rxq, &rxq->pbuf[di]); + if (SHR_FAILURE(rv)) { + goto cleanup; + } + } + /* Config receive descriptor ring */ + bm->rx_buf_dma(dev, rxq, &rxq->pbuf[di], &addr); + cmicx_rx_desc_config(&ring[di], addr, rxq->buf_size); + rm = (rxq->nb_desc - di) >= CMICX_DESC_REMAIN_MAX ? + CMICX_DESC_REMAIN_MAX : rxq->nb_desc - di; + cmicx_rx_desc_remain(&ring[di], rm); + if (hw->dev->flags & PDMA_CHAIN_MODE && di == rxq->nb_desc - 1) { + cmicx_rx_desc_chain(&ring[di], 0); + } + } + /* Config the last descriptor in the ring as reload descriptor */ + cmicx_rx_rldesc_config(&ring[di], rxq->ring_addr); + + rxq->curr = 0; + rxq->halt = rxq->state & PDMA_RX_BATCH_REFILL ? 0 : rxq->nb_desc; + + rxq->halt_addr = rxq->ring_addr + sizeof(struct cmicx_rx_desc) * di; + hw->hdls.chan_goto(hw, rxq->chan_id, rxq->halt_addr); + hw->hdls.chan_setup(hw, rxq->chan_id, rxq->ring_addr); + + return SHR_E_NONE; + +cleanup: + for (di = 0; di < rxq->nb_desc; di++) { + if (rxq->pbuf[di].dma) { + bm->rx_buf_free(dev, rxq, &rxq->pbuf[di]); + } + cmicx_rx_desc_config(&ring[di], 0, 0); + } + + CNET_PR("RX: Failed to allocate mem\n"); + + return SHR_E_MEMORY; +} + +/*! + * Cleanup Rx descriptors + */ +static int +cmicx_pdma_rx_desc_clean(struct pdma_hw *hw, struct pdma_rx_queue *rxq) +{ + struct pdma_dev *dev = hw->dev; + struct pdma_buf_mngr *bm = (struct pdma_buf_mngr *)dev->ctrl.buf_mngr; + struct cmicx_rx_desc *ring = (struct cmicx_rx_desc *)rxq->ring; + uint32_t di; + + /* Go through all the descriptors and free pktbuf */ + for (di = 0; di < rxq->nb_desc; di++) { + if (rxq->pbuf[di].dma) { + bm->rx_buf_free(dev, rxq, &rxq->pbuf[di]); + } + cmicx_rx_desc_config(&ring[di], 0, 0); + } + + rxq->curr = 0; + rxq->halt = 0; + + return SHR_E_NONE; +} + +/*! + * Initialize Tx descriptors + */ +static int +cmicx_pdma_tx_desc_init(struct pdma_hw *hw, struct pdma_tx_queue *txq) +{ + struct pdma_dev *dev = hw->dev; + struct pdma_buf_mngr *bm = (struct pdma_buf_mngr *)dev->ctrl.buf_mngr; + struct cmicx_tx_desc *ring = (struct cmicx_tx_desc *)txq->ring; + uint32_t di, rm; + + for (di = 0; di < txq->nb_desc; di++) { + if (txq->pbuf[di].dma) { + bm->tx_buf_free(dev, txq, &txq->pbuf[di]); + } + /* Config transmit descriptor ring */ + cmicx_tx_desc_config(&ring[di], 0, 0, 0); + rm = (txq->nb_desc - di) >= CMICX_DESC_REMAIN_MAX ? + CMICX_DESC_REMAIN_MAX : txq->nb_desc - di; + cmicx_tx_desc_remain(&ring[di], rm); + if (hw->dev->flags & PDMA_CHAIN_MODE) { + cmicx_tx_desc_chain(&ring[di], 0); + } + } + /* Config the last descriptor in the ring as reload descriptor */ + cmicx_tx_rldesc_config(&ring[di], txq->ring_addr); + + txq->curr = 0; + txq->dirt = 0; + txq->halt = 0; + + txq->halt_addr = txq->ring_addr; + hw->hdls.chan_goto(hw, txq->chan_id, txq->halt_addr); + hw->hdls.chan_setup(hw, txq->chan_id, txq->ring_addr); + + return SHR_E_NONE; +} + +/*! + * Cleanup Tx descriptors + */ +static int +cmicx_pdma_tx_desc_clean(struct pdma_hw *hw, struct pdma_tx_queue *txq) +{ + struct pdma_dev *dev = hw->dev; + struct pdma_buf_mngr *bm = (struct pdma_buf_mngr *)dev->ctrl.buf_mngr; + struct cmicx_tx_desc *ring = (struct cmicx_tx_desc *)txq->ring; + uint32_t di; + + /* Go through all the descriptors and free pktbuf */ + for (di = 0; di < txq->nb_desc; di++) { + if (txq->pbuf[di].dma) { + bm->tx_buf_free(dev, txq, &txq->pbuf[di]); + } + cmicx_tx_desc_config(&ring[di], 0, 0, 0); + } + + txq->curr = 0; + txq->dirt = 0; + txq->halt = 0; + + return SHR_E_NONE; +} + +/*! + * Process Rx vring + */ +static int +cmicx_pdma_rx_vring_process(struct pdma_hw *hw, struct pdma_rx_queue *rxq, + struct pdma_rx_buf *pbuf) +{ + struct pdma_dev *dev = hw->dev; + struct cmicx_rx_desc *ring = (struct cmicx_rx_desc *)rxq->ring; + struct pdma_rx_queue *vrxq = NULL; + struct cmicx_rx_desc *vring = NULL; + struct pkt_hdr *pkh = &pbuf->pkb->pkh; + uint64_t buf_addr; + + vrxq = (struct pdma_rx_queue *)dev->ctrl.vnet_rxq[rxq->queue_id]; + vring = (struct cmicx_rx_desc *)vrxq->ring; + if (!vring) { + rxq->stats.dropped++; + return SHR_E_UNAVAIL; + } + + if (vring[vrxq->curr].status & CMICX_DESC_STAT_RTX_DONE) { + dev->xnet_wake(dev); + return SHR_E_BUSY; + } + + /* Copy descriptor and packet to vring */ + buf_addr = BUS_TO_DMA_HI(vring[vrxq->curr].addr_hi); + buf_addr = buf_addr << 32 | vring[vrxq->curr].addr_lo; + sal_memcpy(dev->sys_p2v(dev, buf_addr), &pbuf->pkb->data, + pkh->meta_len + pkh->data_len); + vring[vrxq->curr].status = ring[rxq->curr].status; + + MEMORY_BARRIER; + + /* Notify VNET to process if needed */ + if (!vring[(vrxq->curr + vrxq->nb_desc - 1) % vrxq->nb_desc].status) { + dev->xnet_wake(dev); + } + vrxq->curr = (vrxq->curr + 1) % vrxq->nb_desc; + + return SHR_E_NONE; +} + +/*! + * Refill Rx ring + */ +static int +cmicx_pdma_rx_ring_refill(struct pdma_hw *hw, struct pdma_rx_queue *rxq) +{ + struct pdma_dev *dev = hw->dev; + struct pdma_buf_mngr *bm = (struct pdma_buf_mngr *)dev->ctrl.buf_mngr; + struct cmicx_rx_desc *ring = (struct cmicx_rx_desc *)rxq->ring; + struct pdma_rx_buf *pbuf = NULL; + int unused = cmicx_pdma_rx_ring_unused(rxq); + dma_addr_t addr; + uint32_t halt; + int rv; + + for (halt = rxq->halt; halt < rxq->halt + unused; halt++) { + pbuf = &rxq->pbuf[halt % rxq->nb_desc]; + /* Allocate a new pktbuf */ + if (!bm->rx_buf_avail(dev, rxq, pbuf)) { + rv = bm->rx_buf_alloc(dev, rxq, pbuf); + if (SHR_FAILURE(rv)) { + rxq->halt = halt % rxq->nb_desc; + rxq->stats.nomems++; + goto fail; + } + } + /* Setup the new descriptor */ + bm->rx_buf_dma(dev, rxq, pbuf, &addr); + cmicx_rx_desc_config(&ring[halt % rxq->nb_desc], addr, rxq->buf_size); + if (dev->flags & PDMA_CHAIN_MODE && halt % rxq->nb_desc == rxq->nb_desc - 1) { + cmicx_rx_desc_chain(&ring[halt % rxq->nb_desc], 0); + } + } + + sal_spinlock_lock(rxq->lock); + rxq->halt = halt % rxq->nb_desc; + if (!(rxq->state & PDMA_RX_QUEUE_XOFF)) { + /* Descriptor cherry pick */ + rxq->halt_addr = rxq->ring_addr + sizeof(struct cmicx_rx_desc) * rxq->halt; + hw->hdls.chan_goto(hw, rxq->chan_id, rxq->halt_addr); + } + sal_spinlock_unlock(rxq->lock); + + return SHR_E_NONE; + +fail: + CNET_PR("RX: Failed to allocate mem\n"); + + return SHR_E_MEMORY; +} + +/*! + * \brief Clean Rx ring + * + * \param [in] hw HW structure point. + * \param [in] rxq Rx queue structure point. + * \param [in] budget Polling budget. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +static int +cmicx_pdma_rx_ring_clean(struct pdma_hw *hw, struct pdma_rx_queue *rxq, int budget) +{ + struct pdma_dev *dev = hw->dev; + struct pdma_buf_mngr *bm = (struct pdma_buf_mngr *)dev->ctrl.buf_mngr; + struct cmicx_rx_desc *ring = (struct cmicx_rx_desc *)rxq->ring; + struct pdma_rx_buf *pbuf = NULL; + struct pkt_hdr *pkh = NULL; + dma_addr_t addr; + uint32_t stat, curr; + int len, done = 0; + int rv; + + curr = rxq->curr; + while (CMICX_DESC_STAT_DONE(ring[curr].status)) { + if (dev->mode == DEV_MODE_VNET && rxq->state & PDMA_RX_QUEUE_XOFF) { + break; + } + if (!(rxq->state & PDMA_RX_BATCH_REFILL) && + !(rxq->state & PDMA_RX_QUEUE_XOFF)) { + /* Descriptor cherry pick */ + rxq->halt_addr = rxq->ring_addr + sizeof(struct cmicx_rx_desc) * curr; + hw->hdls.chan_goto(hw, rxq->chan_id, rxq->halt_addr); + rxq->halt = curr; + } + if (done == budget) { + break; + } + + /* Get the current pktbuf to process */ + pbuf = &rxq->pbuf[curr]; + stat = ring[curr].status; + len = CMICX_DESC_STAT_LEN(stat); + pkh = bm->rx_buf_get(dev, rxq, pbuf, len); + if (!pkh) { + rxq->stats.nomems++; + goto fail; + } + + /* Setup packet header */ + pkh->data_len = len - hw->info.rx_ph_size; + pkh->meta_len = hw->info.rx_ph_size; + pkh->queue_id = rxq->queue_id; + pkh->attrs = CMICX_DESC_STAT_FLAGS(stat); + + /* Send up the packet */ + rv = dev->pkt_recv(dev, rxq->queue_id, (void *)pbuf->skb); + if (SHR_FAILURE(rv)) { + if (dev->mode == DEV_MODE_HNET && pkh->attrs & PDMA_RX_TO_VNET) { + rv = cmicx_pdma_rx_vring_process(hw, rxq, pbuf); + if (SHR_FAILURE(rv) && rv == SHR_E_BUSY) { + rxq->state |= PDMA_RX_QUEUE_BUSY; + return done; + } + } else { + rxq->stats.dropped++; + } + bm->rx_buf_put(dev, rxq, pbuf, len); + } + + /* Count the packets/bytes */ + rxq->stats.packets++; + rxq->stats.bytes += len; + + /* Count the errors if any */ + if (stat & CMICX_DESC_STAT_ERR_MASK) { + rxq->stats.errors++; + if (stat & CMICX_DESC_STAT_DATA_ERR) { + rxq->stats.data_errors++; + } + if (stat & CMICX_DESC_STAT_CELL_ERR) { + rxq->stats.cell_errors++; + } + } + + /* Setup the new descriptor */ + if (!(rxq->state & PDMA_RX_BATCH_REFILL)) { + if (!bm->rx_buf_avail(dev, rxq, pbuf)) { + rv = bm->rx_buf_alloc(dev, rxq, pbuf); + if (SHR_FAILURE(rv)) { + rxq->stats.nomems++; + goto fail; + } + } + bm->rx_buf_dma(dev, rxq, pbuf, &addr); + cmicx_rx_desc_config(&ring[curr], addr, rxq->buf_size); + if (dev->flags & PDMA_CHAIN_MODE && curr == rxq->nb_desc - 1) { + cmicx_rx_desc_chain(&ring[curr], 0); + } + } else { + cmicx_rx_desc_config(&ring[curr], 0, 0); + } + + /* Notify HNET to process if needed */ + if (dev->mode == DEV_MODE_VNET) { + MEMORY_BARRIER; + if (ring[(curr + rxq->nb_desc - 1) % rxq->nb_desc].status) { + dev->xnet_wake(dev); + } + } + + /* Update the indicators */ + if (!(rxq->state & PDMA_RX_BATCH_REFILL) && rxq->halt != curr) { + sal_spinlock_lock(rxq->lock); + if (!(rxq->state & PDMA_RX_QUEUE_XOFF)) { + /* Descriptor cherry pick */ + rxq->halt_addr = rxq->ring_addr + sizeof(struct cmicx_rx_desc) * curr; + hw->hdls.chan_goto(hw, rxq->chan_id, rxq->halt_addr); + rxq->halt = curr; + } + curr = (curr + 1) % rxq->nb_desc; + sal_spinlock_unlock(rxq->lock); + } else { + curr = (curr + 1) % rxq->nb_desc; + } + rxq->curr = curr; + done++; + + /* Restart DMA if in chain mode */ + if (dev->flags & PDMA_CHAIN_MODE) { + if (curr == 0 && !(rxq->state & PDMA_RX_QUEUE_XOFF)) { + hw->hdls.chan_stop(hw, rxq->chan_id); + hw->hdls.chan_start(hw, rxq->chan_id); + } + } + } + + /* One more poll for chain done in chain mode */ + if (dev->flags & PDMA_CHAIN_MODE) { + if (curr == rxq->nb_desc - 1 && done) { + done = budget; + } + } + + /* In batching mode, replenish all the unused descriptors */ + if (rxq->state & PDMA_RX_BATCH_REFILL && + cmicx_pdma_rx_ring_unused(rxq) >= (int)rxq->free_thresh) { + cmicx_pdma_rx_ring_refill(hw, rxq); + } + + /* Notify the other side to process */ + if (dev->mode == DEV_MODE_VNET || dev->mode == DEV_MODE_HNET) { + if (done) { + dev->xnet_wake(dev); + } + } + + return done; + +fail: + CNET_PR("RX: Failed to allocate mem\n"); + + return done; +} + +/*! + * Process Tx vring + */ +static int +cmicx_pdma_tx_vring_process(struct pdma_hw *hw, struct pdma_tx_queue *txq, + struct pdma_tx_buf *pbuf) +{ + struct pdma_dev *dev = hw->dev; + struct cmicx_tx_desc *ring = (struct cmicx_tx_desc *)txq->ring; + struct pdma_tx_queue *vtxq = NULL; + struct cmicx_tx_desc *vring = NULL; + + vtxq = (struct pdma_tx_queue *)dev->ctrl.vnet_txq[txq->queue_id]; + vring = (struct cmicx_tx_desc *)vtxq->ring; + if (!vring) { + return SHR_E_UNAVAIL; + } + + /* Update vring descriptor */ + vring[vtxq->dirt].status = ring[txq->dirt].status; + pbuf->dma = 0; + + MEMORY_BARRIER; + + /* Notify VNET to process if needed */ + if (!vring[(vtxq->dirt + vtxq->nb_desc - 1) % vtxq->nb_desc].status) { + dev->xnet_wake(dev); + } + vtxq->dirt = (vtxq->dirt + 1) % vtxq->nb_desc; + + return SHR_E_NONE; +} + +/*! + * \brief Clean Tx ring + * + * \param [in] hw HW structure point. + * \param [in] txq Tx queue structure point. + * \param [in] budget Polling budget. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +static int +cmicx_pdma_tx_ring_clean(struct pdma_hw *hw, struct pdma_tx_queue *txq, int budget) +{ + struct pdma_dev *dev = hw->dev; + struct pdma_buf_mngr *bm = (struct pdma_buf_mngr *)dev->ctrl.buf_mngr; + struct cmicx_tx_desc *ring = (struct cmicx_tx_desc *)txq->ring; + uint32_t dirt, curr; + int done = 0; + + dirt = txq->dirt; + while (txq->pbuf[dirt].dma) { + if (!CMICX_DESC_STAT_DONE(ring[dirt].status)) { + break; + } + if (done == budget) { + break; + } + + if (dev->mode == DEV_MODE_HNET && !txq->pbuf[dirt].skb) { + cmicx_pdma_tx_vring_process(hw, txq, &txq->pbuf[dirt]); + } else { + /* Free the done pktbuf */ + bm->tx_buf_free(dev, txq, &txq->pbuf[dirt]); + } + + cmicx_tx_desc_config(&ring[dirt], 0, 0, 0); + + /* Update the indicators */ + dirt = (dirt + 1) % txq->nb_desc; + txq->dirt = dirt; + done++; + + /* Restart DMA if in chain mode */ + if (dev->flags & PDMA_CHAIN_MODE) { + sal_spinlock_lock(txq->lock); + curr = txq->curr; + if (dirt == txq->halt && dirt != curr) { + hw->hdls.chan_stop(hw, txq->chan_id); + cmicx_tx_desc_chain(&ring[(curr + txq->nb_desc - 1) % txq->nb_desc], 0); + hw->hdls.chan_setup(hw, txq->chan_id, + txq->ring_addr + sizeof(struct cmicx_tx_desc) * txq->halt); + hw->hdls.chan_start(hw, txq->chan_id); + txq->halt = curr; + } + sal_spinlock_unlock(txq->lock); + } + } + + /* One more poll for chain done in chain mode */ + if (dev->flags & PDMA_CHAIN_MODE) { + sal_spinlock_lock(txq->lock); + if (dirt != txq->halt) { + done = budget; + } + sal_spinlock_unlock(txq->lock); + } + + /* Resume Tx if any */ + sal_spinlock_lock(txq->lock); + if (cmicx_pdma_tx_ring_unused(txq) && txq->state & PDMA_TX_QUEUE_XOFF) { + txq->state &= ~PDMA_TX_QUEUE_XOFF; + sal_spinlock_unlock(txq->lock); + if (dev->tx_resume) { + dev->tx_resume(dev, txq->queue_id); + } else if (!(txq->state & PDMA_TX_QUEUE_POLL)) { + sal_sem_give(txq->sem); + } + return done; + } + sal_spinlock_unlock(txq->lock); + + return done; +} + +/*! + * Dump Rx ring + */ +static int +cmicx_pdma_rx_ring_dump(struct pdma_hw *hw, struct pdma_rx_queue *rxq) +{ + struct cmicx_rx_desc *ring = (struct cmicx_rx_desc *)rxq->ring; + struct cmicx_rx_desc *rd; + uint32_t di; + + CNET_PR("\nRX: queue=%d, chan=%d, curr=%d, halt=%d, halt@%p\n", + rxq->queue_id, rxq->chan_id, rxq->curr, rxq->halt, (void *)&ring[rxq->halt]); + CNET_PR("----------------------------------------------------------------\n"); + for (di = 0; di < rxq->nb_desc + 1; di++) { + rd = &ring[di]; + CNET_PR("DESC[%03d]: (%p)->%08x %08x %08x %08x\n", + di, (void *)(unsigned long)(rxq->ring_addr + di * CMICX_PDMA_DCB_SIZE), + rd->addr_lo, rd->addr_hi, rd->ctrl, rd->status); + } + + return SHR_E_NONE; +} + +/*! + * Dump Tx ring + */ +static int +cmicx_pdma_tx_ring_dump(struct pdma_hw *hw, struct pdma_tx_queue *txq) +{ + struct cmicx_tx_desc *ring = (struct cmicx_tx_desc *)txq->ring; + struct cmicx_tx_desc *td; + uint32_t di; + + CNET_PR("\nTX: queue=%d, chan=%d, curr=%d, dirt=%d, halt@%p\n", + txq->queue_id, txq->chan_id, txq->curr, txq->dirt, (void *)&ring[txq->curr]); + CNET_PR("----------------------------------------------------------------\n"); + for (di = 0; di < txq->nb_desc + 1; di++) { + td = &ring[di]; + CNET_PR("DESC[%03d]: (%p)->%08x %08x %08x %08x\n", + di, (void *)(unsigned long)(txq->ring_addr + di * CMICX_PDMA_DCB_SIZE), + td->addr_lo, td->addr_hi, td->ctrl, td->status); + } + + return SHR_E_NONE; +} + +/*! + * Fetch Tx vring + */ +static int +cmicx_pdma_tx_vring_fetch(struct pdma_hw *hw, struct pdma_tx_queue *txq, + struct pdma_tx_buf *pbuf) +{ + struct pdma_dev *dev = hw->dev; + struct cmicx_tx_desc *ring = (struct cmicx_tx_desc *)txq->ring; + struct pdma_tx_queue *vtxq = NULL; + struct cmicx_tx_desc *vring = NULL; + + vtxq = (struct pdma_tx_queue *)dev->ctrl.vnet_txq[txq->queue_id]; + vring = (struct cmicx_tx_desc *)vtxq->ring; + if (!vring || !CMICX_DESC_CTRL_LEN(vring[vtxq->curr].ctrl)) { + return SHR_E_UNAVAIL; + } + + /* Fetch vring descriptor */ + sal_memcpy(&ring[txq->curr], &vring[vtxq->curr], sizeof(struct cmicx_tx_desc)); + vring[vtxq->curr].ctrl &= ~CMICX_DESC_CTRL_LEN(-1); + + MEMORY_BARRIER; + + pbuf->dma = vring[vtxq->curr].addr_lo; + pbuf->len = CMICX_DESC_CTRL_LEN(ring[txq->curr].ctrl); + vtxq->curr = (vtxq->curr + 1) % vtxq->nb_desc; + + return SHR_E_NONE; +} + +/*! + * Check Tx ring + */ +static inline int +cmicx_pdma_tx_ring_check(struct pdma_hw *hw, struct pdma_tx_queue *txq) +{ + if (cmicx_pdma_tx_ring_unused(txq)) { + return SHR_E_NONE; + } + + sal_spinlock_lock(txq->lock); + if (!cmicx_pdma_tx_ring_unused(txq)) { + txq->state |= PDMA_TX_QUEUE_XOFF; + txq->stats.xoffs++; + sal_spinlock_unlock(txq->lock); + if (hw->dev->tx_suspend) { + hw->dev->tx_suspend(hw->dev, txq->queue_id); + } + return SHR_E_BUSY; + } + sal_spinlock_unlock(txq->lock); + + return SHR_E_NONE; +} + +/*! + * \brief Start packet transmission + * + * \param [in] hw HW structure point. + * \param [in] txq Tx queue structure point. + * \param [in] buf Tx packet buffer. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +static int +cmicx_pdma_pkt_xmit(struct pdma_hw *hw, struct pdma_tx_queue *txq, void *buf) +{ + struct pdma_dev *dev = hw->dev; + struct pdma_buf_mngr *bm = (struct pdma_buf_mngr *)dev->ctrl.buf_mngr; + struct cmicx_tx_desc *ring = (struct cmicx_tx_desc *)txq->ring; + struct pdma_tx_buf *pbuf = NULL; + struct pkt_hdr *pkh = NULL; + dma_addr_t addr; + uint32_t curr, flags = 0; + int retry = 5000000; + int rv; + + if (!(txq->state & PDMA_TX_QUEUE_ACTIVE)) { + return SHR_E_UNAVAIL; + } + + if (dev->tx_suspend) { + sal_spinlock_lock(txq->mutex); + } else { + sal_sem_take(txq->sem, SAL_SEM_FOREVER); + } + + /* Check Tx resource */ + if (dev->tx_suspend) { + /* Suspend Tx if no resource */ + rv = cmicx_pdma_tx_ring_check(hw, txq); + if (SHR_FAILURE(rv)) { + sal_spinlock_unlock(txq->mutex); + return rv; + } + } else { + /* Abort Tx if a fatal error happened */ + if (txq->state & PDMA_TX_QUEUE_XOFF) { + sal_sem_give(txq->sem); + return SHR_E_RESOURCE; + } + } + + /* Setup the new descriptor */ + curr = txq->curr; + pbuf = &txq->pbuf[curr]; + if (dev->mode == DEV_MODE_HNET && !buf) { + rv = cmicx_pdma_tx_vring_fetch(hw, txq, pbuf); + if (SHR_FAILURE(rv)) { + sal_spinlock_unlock(txq->mutex); + return SHR_E_EMPTY; + } + } else { + pbuf->adj = 1; + pkh = bm->tx_buf_get(dev, txq, pbuf, buf); + if (!pkh) { + txq->stats.dropped++; + if (dev->tx_suspend) { + sal_spinlock_unlock(txq->mutex); + } else { + sal_sem_give(txq->sem); + } + return SHR_E_NONE; + } + bm->tx_buf_dma(dev, txq, pbuf, &addr); + flags |= pkh->attrs & PDMA_TX_HIGIG_PKT ? CMICX_DESC_TX_HIGIG_PKT : 0; + flags |= pkh->attrs & PDMA_TX_PURGE_PKT ? CMICX_DESC_TX_PURGE_PKT : 0; + cmicx_tx_desc_config(&ring[curr], addr, pbuf->len, flags); + } + + /* Notify HNET to process if needed */ + if (dev->mode == DEV_MODE_VNET) { + MEMORY_BARRIER; + if (!CMICX_DESC_CTRL_LEN(ring[(curr + txq->nb_desc - 1) % txq->nb_desc].ctrl)) { + dev->xnet_wake(dev); + } + } + + /* Update the indicators */ + curr = (curr + 1) % txq->nb_desc; + txq->curr = curr; + + /* Start DMA if in chain mode */ + if (dev->flags & PDMA_CHAIN_MODE) { + if (txq->state & PDMA_TX_QUEUE_POLL) { + do { + rv = cmicx_pdma_tx_ring_clean(hw, txq, txq->nb_desc - 1); + if (rv != (int)txq->nb_desc - 1) { + break; + } + sal_usleep(1); + } while (retry--); + if (retry <= 0) { + CNET_PR("Last Tx could not be done in given time\n"); + } + } + sal_spinlock_lock(txq->lock); + if (txq->dirt == txq->halt && txq->dirt != curr) { + hw->hdls.chan_stop(hw, txq->chan_id); + cmicx_tx_desc_chain(&ring[(curr + txq->nb_desc - 1) % txq->nb_desc], 0); + hw->hdls.chan_setup(hw, txq->chan_id, + txq->ring_addr + sizeof(struct cmicx_tx_desc) * txq->halt); + hw->hdls.chan_start(hw, txq->chan_id); + txq->halt = curr; + } + sal_spinlock_unlock(txq->lock); + } + + /* Kick off DMA */ + txq->halt_addr = txq->ring_addr + sizeof(struct cmicx_tx_desc) * curr; + hw->hdls.chan_goto(hw, txq->chan_id, txq->halt_addr); + + /* Count the packets/bytes */ + txq->stats.packets++; + txq->stats.bytes += pbuf->len; + + /* Clean up ring if in polling mode */ + if (txq->state & PDMA_TX_QUEUE_POLL && + cmicx_pdma_tx_ring_unused(txq) <= (int)txq->free_thresh) { + cmicx_pdma_tx_ring_clean(hw, txq, txq->nb_desc - txq->free_thresh); + } + + /* Suspend Tx if no resource */ + rv = cmicx_pdma_tx_ring_check(hw, txq); + if (SHR_FAILURE(rv)) { + if (dev->mode == DEV_MODE_VNET) { + dev->xnet_wake(dev); + } + + if (txq->state & PDMA_TX_QUEUE_POLL) { + /* In polling mode, must wait till the ring is available */ + do { + cmicx_pdma_tx_ring_clean(hw, txq, txq->free_thresh); + if (!(txq->state & PDMA_TX_QUEUE_XOFF)) { + break; + } + sal_usleep(1); + } while (retry--); + if (retry <= 0) { + CNET_PR("Fatal error: Tx ring is full, packets have not been transmitted for 5 seconds\n"); + if (!dev->tx_suspend) { + sal_sem_give(txq->sem); + return SHR_E_RESOURCE; + } + } + } else { + /* In interrupt mode, the handle thread will wake up Tx */ + if (!dev->tx_suspend) { + return SHR_E_NONE; + } + } + } + + if (dev->tx_suspend) { + sal_spinlock_unlock(txq->mutex); + } else { + sal_sem_give(txq->sem); + } + + return SHR_E_NONE; +} + +/*! + * Suspend Rx queue + */ +static int +cmicx_pdma_rx_suspend(struct pdma_hw *hw, struct pdma_rx_queue *rxq) +{ + sal_spinlock_lock(rxq->lock); + rxq->state |= PDMA_RX_QUEUE_XOFF; + if (hw->dev->flags & PDMA_CHAIN_MODE) { + hw->hdls.chan_stop(hw, rxq->chan_id); + } + sal_spinlock_unlock(rxq->lock); + + return SHR_E_NONE; +} + +/*! + * Resume Rx queue + */ +static int +cmicx_pdma_rx_resume(struct pdma_hw *hw, struct pdma_rx_queue *rxq) +{ + sal_spinlock_lock(rxq->lock); + if (!(rxq->state & PDMA_RX_QUEUE_XOFF)) { + sal_spinlock_unlock(rxq->lock); + return SHR_E_NONE; + } + if (rxq->state & PDMA_RX_BATCH_REFILL) { + rxq->halt_addr = rxq->ring_addr + sizeof(struct cmicx_rx_desc) * rxq->halt; + hw->hdls.chan_goto(hw, rxq->chan_id, rxq->halt_addr); + } else if (rxq->halt == rxq->curr || (rxq->halt == rxq->nb_desc && rxq->curr == 0)) { + rxq->halt = (rxq->curr + 1) % rxq->nb_desc; + rxq->halt_addr = rxq->ring_addr + sizeof(struct cmicx_rx_desc) * rxq->halt; + hw->hdls.chan_goto(hw, rxq->chan_id, rxq->halt_addr); + } + if (hw->dev->flags & PDMA_CHAIN_MODE) { + rxq->curr = 0; + hw->hdls.chan_start(hw, rxq->chan_id); + } + rxq->state &= ~PDMA_RX_QUEUE_XOFF; + sal_spinlock_unlock(rxq->lock); + + return SHR_E_NONE; +} + +/*! + * Initialize function pointers + */ +int +bcmcnet_cmicx_pdma_desc_ops_init(struct pdma_hw *hw) +{ + if (!hw) { + return SHR_E_PARAM; + } + + hw->dops.rx_desc_init = cmicx_pdma_rx_desc_init; + hw->dops.rx_desc_clean = cmicx_pdma_rx_desc_clean; + hw->dops.rx_ring_clean = cmicx_pdma_rx_ring_clean; + hw->dops.rx_ring_dump = cmicx_pdma_rx_ring_dump; + hw->dops.rx_suspend = cmicx_pdma_rx_suspend; + hw->dops.rx_resume = cmicx_pdma_rx_resume; + hw->dops.tx_desc_init = cmicx_pdma_tx_desc_init; + hw->dops.tx_desc_clean = cmicx_pdma_tx_desc_clean; + hw->dops.tx_ring_clean = cmicx_pdma_tx_ring_clean; + hw->dops.tx_ring_dump = cmicx_pdma_tx_ring_dump; + hw->dops.pkt_xmit = cmicx_pdma_pkt_xmit; + + return SHR_E_NONE; +} + +/*! + * Attach device driver + */ +int +bcmcnet_cmicx_pdma_driver_attach(struct pdma_dev *dev) +{ + struct pdma_hw *hw = NULL; + + /* Allocate memory for HW data */ + hw = sal_alloc(sizeof(*hw), "bcmcnetPdmaHw"); + if (!hw) { + return SHR_E_MEMORY; + } + sal_memset(hw, 0, sizeof(*hw)); + hw->unit = dev->unit; + hw->dev = dev; + dev->ctrl.hw = hw; + + bcmcnet_cmicx_pdma_hw_hdls_init(hw); + bcmcnet_cmicx_pdma_desc_ops_init(hw); + + return SHR_E_NONE; +} + +/*! + * Detach device driver + */ +int +bcmcnet_cmicx_pdma_driver_detach(struct pdma_dev *dev) +{ + if (dev->ctrl.hw) { + sal_free(dev->ctrl.hw); + } + dev->ctrl.hw = NULL; + + return SHR_E_NONE; +} + diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/include/bcmcnet/bcmcnet_cmicd.h b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/include/bcmcnet/bcmcnet_cmicd.h new file mode 100644 index 000000000000..ef9717923e70 --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/include/bcmcnet/bcmcnet_cmicd.h @@ -0,0 +1,369 @@ +/*! \file bcmcnet_cmicd.h + * + * CMICd registers and descriptors definitions. + * + */ +/* + * $Copyright: Copyright 2018-2020 Broadcom. All rights reserved. + * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * A copy of the GNU General Public License version 2 (GPLv2) can + * be found in the LICENSES folder.$ + */ + +#ifndef BCMCNET_CMICD_H +#define BCMCNET_CMICD_H + +/*! + * \name CMICD PDMA HW definitions + */ +/*! \{ */ +/*! CMICD CMC number */ +#define CMICD_PDMA_CMC_MAX 3 +/*! CMICD CMC PDMA channels */ +#define CMICD_PDMA_CMC_CHAN 4 +/*! CMICD PDMA DCB size */ +#define CMICD_PDMA_DCB_SIZE 64 +/*! \} */ + +/*! + * \name CMICD PDMA register definitions + */ +/*! \{ */ +#define CMICD_PDMA_CTRLr 0x0140 +#define CMICD_PDMA_STATr 0x0150 +#define CMICD_PDMA_STAT_HIr 0x0130 +#define CMICD_PDMA_STAT_CLRr 0x01a4 +#define CMICD_PDMA_DESCr 0x0158 +#define CMICD_PDMA_CURR_DESCr 0x01a8 +#define CMICD_PDMA_DESC_HALTr 0x0120 +#define CMICD_PDMA_COS_RX0r 0x0168 +#define CMICD_PDMA_COS_RX1r 0x016c +#define CMICD_PDMA_COS_MASK0r 0x019c +#define CMICD_PDMA_COS_MASK1r 0x01a0 +#define CMICD_PDMA_INTR_COALr 0x0188 +#define CMICD_PDMA_RBUF_THREr 0x0110 +#define CMICD_PDMA_COUNT_RXr 0x0480 +#define CMICD_PDMA_COUNT_TXr 0x0484 +#define CMICD_PDMA_COUNT_ALL_RXr 0x04a0 +#define CMICD_PDMA_COUNT_ALL_TXr 0x04a4 +#define CMICD_IRQ_STATr 0x0400 +#define CMICD_IRQ_PCI_MASKr 0x0414 +#define CMICD_IRQ_UC0_MASKr 0x0428 +/*! \} */ + +/*! + * \name CMICD PDMA register address + */ +/*! \{ */ +/*! Base address */ +#define CMICD_GRP_BASE(g) (0x00031000 + 0x1000 * g) +/*! Control register address */ +#define CMICD_PDMA_CTRL(g, q) (CMICD_GRP_BASE(g) + CMICD_PDMA_CTRLr + q * 4) +/*! Status register address */ +#define CMICD_PDMA_STAT(g) (CMICD_GRP_BASE(g) + CMICD_PDMA_STATr) +/*! Status higher register address */ +#define CMICD_PDMA_STAT_HI(g) (CMICD_GRP_BASE(g) + CMICD_PDMA_STAT_HIr) +/*! Status clear register address */ +#define CMICD_PDMA_STAT_CLR(g) (CMICD_GRP_BASE(g) + CMICD_PDMA_STAT_CLRr) +/*! Descriptor register address */ +#define CMICD_PDMA_DESC(g, q) (CMICD_GRP_BASE(g) + CMICD_PDMA_DESCr + q * 4) +/*! Current descriptor register address */ +#define CMICD_PDMA_CURR_DESC(g, q) (CMICD_GRP_BASE(g) + CMICD_PDMA_CURR_DESCr + q * 4) +/*! Descriptor halt register address */ +#define CMICD_PDMA_DESC_HALT(g, q) (CMICD_GRP_BASE(g) + CMICD_PDMA_DESC_HALTr + q * 4) +/*! COS Rx0 register address */ +#define CMICD_PDMA_COS_RX0(g, q) (CMICD_GRP_BASE(g) + CMICD_PDMA_COS_RX0r + q * 8) +/*! COS Rx1 register address */ +#define CMICD_PDMA_COS_RX1(g, q) (CMICD_GRP_BASE(g) + CMICD_PDMA_COS_RX1r + q * 8) +/*! COS Mask0 register address */ +#define CMICD_PDMA_COS_MASK0(g) (CMICD_GRP_BASE(g) + CMICD_PDMA_COS_MASK0r) +/*! COS Mask1 register address */ +#define CMICD_PDMA_COS_MASK1(g) (CMICD_GRP_BASE(g) + CMICD_PDMA_COS_MASK1r) +/*! Interrupt coalesce register address */ +#define CMICD_PDMA_INTR_COAL(g, q) (CMICD_GRP_BASE(g) + CMICD_PDMA_INTR_COALr + q * 4) +/*! Rx buffer threshhold register address */ +#define CMICD_PDMA_RBUF_THRE(g, q) (CMICD_GRP_BASE(g) + CMICD_PDMA_RBUF_THREr + q * 4) +/*! Rx counter register address */ +#define CMICD_PDMA_COUNT_RX(g, q) (CMICD_GRP_BASE(g) + CMICD_PDMA_COUNT_RXr + q * 8) +/*! Tx counter register address */ +#define CMICD_PDMA_COUNT_TX(g, q) (CMICD_GRP_BASE(g) + CMICD_PDMA_COUNT_TXr + q * 8) +/*! Rx global counter register address */ +#define CMICD_PDMA_COUNT_ALL_RX(g) (CMICD_GRP_BASE(g) + CMICD_PDMA_COUNT_ALL_RXr) +/*! Tx gloable counter register address */ +#define CMICD_PDMA_COUNT_ALL_TX(g) (CMICD_GRP_BASE(g) + CMICD_PDMA_COUNT_ALL_TXr) +/*! Interrupt status register address */ +#define CMICD_IRQ_STAT(g) (CMICD_GRP_BASE(g) + CMICD_IRQ_STATr) +/*! Interrupt PCI mask register address */ +#define CMICD_IRQ_PCI_MASK(g) (CMICD_GRP_BASE(g) + CMICD_IRQ_PCI_MASKr) +/*! Interrupt UC0 mask register address */ +#define CMICD_IRQ_UC0_MASK(g) (CMICD_GRP_BASE(g) + CMICD_IRQ_UC0_MASKr) +/*! Credits release release register address */ +#define CMICD_EPINTF_RELEASE_CREDITS 0x0001a000 +/*! Device revision register address */ +#define CMICD_DEV_REV_ID 0x00010224 +/*! CMIC revison register address */ +#define CMICD_CMICM_REV_ID 0x00010228 +/*! \} */ + +/*! + * \name Control register definitions + */ +/*! \{ */ +/*! Continuous DMA mode */ +#define CMICD_PDMA_CONTINUOUS 0x00000200 +/*! Controlled interrupt */ +#define CMICD_PDMA_CNTLD_INTR 0x00000100 +/*! Update status on reload */ +#define CMICD_PDMA_RLD_STAT_DIS 0x00000080 +/*! Dropped on chain end */ +#define CMICD_PDMA_DROP_ON_END 0x00000040 +/*! Descriptor big endianess */ +#define CMICD_PDMA_DESC_BIG_ENDIAN 0x00000020 +/*! Packet DMA big endianess */ +#define CMICD_PDMA_PKT_BIG_ENDIAN 0x00000010 +/*! Interrupt after descriptor */ +#define CMICD_PDMA_INTR_ON_DESC 0x00000008 +/*! Abort DMA */ +#define CMICD_PDMA_ABORT 0x00000004 +/*! Enable DMA */ +#define CMICD_PDMA_ENABLE 0x00000002 +/*! DMA direction */ +#define CMICD_PDMA_DIR 0x00000001 +/*! \} */ + +/*! + * \name Status register definitions + */ +/*! \{ */ +/*! Chain done */ +#define CMICD_PDMA_CHAIN_DONE(q) (0x00000001 << (q)) +/*! Descriptor done */ +#define CMICD_PDMA_DESC_DONE(q) (0x00000010 << (q)) +/*! Active */ +#define CMICD_PDMA_ACTIVE(q) (0x00000100 << (q)) +/*! \} */ + +/*! + * \name Status clear register definitions + */ +/*! \{ */ +/*! Clear completed interrupt */ +#define CMICD_PDMA_DESC_CMPLT(q) (0x00000001 << (q)) +/*! Clear controlled interrupt */ +#define CMICD_PDMA_DESC_CNTLD(q) (0x00000100 << (q)) +/*! \} */ + +/*! + * \name Interrupt_coalesce register definitions + */ +/*! \{ */ +/*! Interrupt coalesce enable */ +#define CMICD_PDMA_INTR_COAL_ENA (1 << 31) +/*! Interrupt coalesce threshhold */ +#define CMICD_PDMA_INTR_THRESH(cnt) (((cnt) & 0x7fff) << 16) +/*! Interrupt coalesce timeout */ +#define CMICD_PDMA_INTR_TIMER(tmr) ((tmr) & 0xffff) +/*! \} */ + +/*! + * \name Interrupt status&mask register definitions + */ +/*! \{ */ +/*! Interrupt mask */ +#define CMICD_PDMA_IRQ_MASK 0x78000000 +/*! Descriptor done */ +#define CMICD_IRQ_DESC_DONE(q) (0x00004000 >> (2 * (q))) +/*! Chain done */ +#define CMICD_IRQ_CHAIN_DONE(q) (0x00008000 >> (2 * (q))) +/*! Controlled interrupt */ +#define CMICD_IRQ_DESC_CNTLD(q) (0x08000000 << (q)) +/*! Interrupt start number */ +#define CMICD_IRQ_START_NUM 27 +/*! Interrupt number offset */ +#define CMICD_IRQ_NUM_OFFSET 1 +/*! Interrupt mask shift */ +#define CMICD_IRQ_MASK_SHIFT 0 +/*! Interrupt mask zeroing */ +#define CMICD_IRQ_ACT_CHAN(mask) (((mask) & CMICD_PDMA_IRQ_MASK) >> CMICD_IRQ_START_NUM) +/*! \} */ + +/*! 32-bit register read */ +#define DEV_READ32(_c, _a, _p) \ + do { \ + if ((_c)->dev->mode != DEV_MODE_VNET) { \ + *(_p) = ((volatile uint32_t *)(_c)->hw_addr)[(_a) / 4]; \ + } \ + } while (0) + +/*! 32-bit register write */ +#define DEV_WRITE32(_c, _a, _v) \ + do { \ + if ((_c)->dev->mode != DEV_MODE_VNET) { \ + ((volatile uint32_t *)(_c)->hw_addr)[(_a) / 4] = (_v); \ + } \ + } while (0) + +/*! + * \brief Rx metadata in descriptor. + */ +struct rx_metadata { + /*! Metadata */ + volatile uint32_t data[13]; + + /*! Status */ + volatile uint32_t status; +} __attribute__((packed)); + +/*! + * \brief Rx descriptor. + */ +struct cmicd_rx_desc { + /*! Packet address */ + volatile uint32_t addr; + + /*! Packet control */ + volatile uint32_t ctrl; + + /*! Metadata fields */ + struct rx_metadata md; +} __attribute__((packed)); + +/*! Reserve Rx meta data size in packet buffer */ +#define CMICD_RX_META_RESV 64 + +/*! + * \brief Tx metadata in descriptor. + */ +struct tx_metadata { + /*! Metadata */ + volatile uint32_t data[4]; + + /*! Reserved */ + volatile uint32_t rsvd[9]; + + /*! Status */ + volatile uint32_t status; +} __attribute__((packed)); + +/*! + * \brief Tx descriptor. + */ +struct cmicd_tx_desc { + /*! Packet address */ + volatile uint32_t addr; + + /*! Packet control */ + volatile uint32_t ctrl; + + /*! Metadata fields */ + struct tx_metadata md; +} __attribute__((packed)); + +/*! Reserve Tx meta data size in packet buffer */ +#define CMICD_TX_META_RESV 16 + +/*! + * Flags related to descriptors. + */ +/*! Controlled interrupt */ +#define CMICD_DESC_CTRL_CNTLD_INTR (1 << 24) +/*! Completed interrupt */ +#define CMICD_DESC_CTRL_CMPLT_INTR (1 << 23) +/*! Reload DCB */ +#define CMICD_DESC_CTRL_RELOAD (1 << 18) +/*! Scatter DCB */ +#define CMICD_DESC_CTRL_SCATTER (1 << 17) +/*! Chained DCB */ +#define CMICD_DESC_CTRL_CHAIN (1 << 16) +/*! Control flags */ +#define CMICD_DESC_CTRL_FLAGS(f) (((f) & 0xffff) << 16) +/*! Purge packet */ +#define CMICD_DESC_TX_PURGE_PKT (1 << 6) +/*! Pause packet */ +#define CMICD_DESC_TX_PAUSE_PKT (1 << 5) +/*! Higig packet */ +#define CMICD_DESC_TX_HIGIG_PKT (1 << 3) +/*! Packet length */ +#define CMICD_DESC_CTRL_LEN(len) ((len) & 0xffff) +/*! Done */ +#define CMICD_DESC_STAT_RTX_DONE (1 << 31) +/*! Head error */ +#define CMICD_DESC_STAT_HEAD_ERR (1 << 20) +/*! Data error */ +#define CMICD_DESC_STAT_DATA_ERR (1 << 19) +/*! Cell error */ +#define CMICD_DESC_STAT_CELL_ERR (1 << 18) +/*! Error mask */ +#define CMICD_DESC_STAT_ERR_MASK (CMICD_DESC_STAT_HEAD_ERR | \ + CMICD_DESC_STAT_DATA_ERR | \ + CMICD_DESC_STAT_CELL_ERR) +/*! Packet start */ +#define CMICD_DESC_STAT_PKT_START (1 << 17) +/*! Packet end */ +#define CMICD_DESC_STAT_PKT_END (1 << 16) +/*! Get done state */ +#define CMICD_DESC_STAT_DONE(stat) ((stat) & CMICD_DESC_STAT_RTX_DONE) +/*! Get flags */ +#define CMICD_DESC_STAT_FLAGS(stat) (((stat) >> 16) & ~0x8003) +/*! Get packet length */ +#define CMICD_DESC_STAT_LEN(stat) ((stat) & 0xffff) + +/*! HW access retry times */ +#define CMICD_HW_RETRY_TIMES 100000 + +/*! + * \brief Initialize HW handles. + * + * \param [in] hw HW structure point. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +bcmcnet_cmicd_pdma_hw_hdls_init(struct pdma_hw *hw); + +/*! + * \brief Initialize descriptor operations. + * + * \param [in] hw HW structure point. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +bcmcnet_cmicd_pdma_desc_ops_init(struct pdma_hw *hw); + +/*! + * \brief Attach device driver. + * + * \param [in] dev Device structure point. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +bcmcnet_cmicd_pdma_driver_attach(struct pdma_dev *dev); + +/*! + * \brief Detach device driver. + * + * \param [in] dev Device structure point. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +bcmcnet_cmicd_pdma_driver_detach(struct pdma_dev *dev); + +#endif /* BCMCNET_CMICD_H */ + diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/include/bcmcnet/bcmcnet_cmicx.h b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/include/bcmcnet/bcmcnet_cmicx.h new file mode 100644 index 000000000000..a8657c8b46a9 --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/include/bcmcnet/bcmcnet_cmicx.h @@ -0,0 +1,379 @@ +/*! \file bcmcnet_cmicx.h + * + * CMICx registers and descriptors definitions. + * + */ +/* + * $Copyright: Copyright 2018-2020 Broadcom. All rights reserved. + * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * A copy of the GNU General Public License version 2 (GPLv2) can + * be found in the LICENSES folder.$ + */ + +#ifndef BCMCNET_CMICX_H +#define BCMCNET_CMICX_H + +/*! + * \name CMICX PDMA HW definitions + */ +/*! \{ */ +/*! CMICX CMC number */ +#define CMICX_PDMA_CMC_MAX 2 +/*! CMICX CMC PDMA channels */ +#define CMICX_PDMA_CMC_CHAN 8 +/*! CMICX PDMA DCB size */ +#define CMICX_PDMA_DCB_SIZE 16 +/*! \} */ + +/*! + * \name CMICX PCIe device address definitions + */ +/*! \{ */ +/*! CMICX PCIE offset */ +#define CMICX_PCIE_SO_OFFSET 0x10000000 +/*! Higher DMA address to bus address */ +#define DMA_TO_BUS_HI(dma) ((dma) | CMICX_PCIE_SO_OFFSET) +/*! Higher bus address to DMA address */ +#define BUS_TO_DMA_HI(bus) ((bus) & ~CMICX_PCIE_SO_OFFSET) +/*! \} */ + +/*! + * \name CMICX PDMA register definitions + */ +/*! \{ */ +#define CMICX_PDMA_CTRLr 0x2100 +#define CMICX_PDMA_STATr 0x2114 +#define CMICX_PDMA_DESC_LOr 0x2104 +#define CMICX_PDMA_DESC_HIr 0x2108 +#define CMICX_PDMA_CURR_DESC_LOr 0x2124 +#define CMICX_PDMA_CURR_DESC_HIr 0x2128 +#define CMICX_PDMA_DESC_HALT_LOr 0x210c +#define CMICX_PDMA_DESC_HALT_HIr 0x2110 +#define CMICX_PDMA_COS_CTRL_RX0r 0x2118 +#define CMICX_PDMA_COS_CTRL_RX1r 0x211c +#define CMICX_PDMA_INTR_COALr 0x2120 +#define CMICX_PDMA_RBUF_THREr 0x212c +#define CMICX_PDMA_DEBUG_CTRLr 0x2130 +#define CMICX_PDMA_DEBUG_SM_STATr 0x2134 +#define CMICX_PDMA_DEBUG_STATr 0x2138 +#define CMICX_PDMA_COUNT_RXr 0x213c +#define CMICX_PDMA_COUNT_TXr 0x2140 +#define CMICX_PDMA_COUNT_RX_DROPr 0x2144 +#define CMICX_PDMA_DESC_CNT_REQr 0x2148 +#define CMICX_PDMA_DESC_CNT_RXr 0x214c +#define CMICX_PDMA_DESC_CNT_STATr 0x2150 +#define CMICX_PDMA_IRQ_STATr 0x106c +#define CMICX_PDMA_IRQ_STAT_CLRr 0x1074 +/*! \} */ + +/*! + * \name CMICX PDMA register address + */ +/*! \{ */ +/*! Base address */ +#define CMICX_GRP_BASE(g) (0x00000000 + 0x3000 * g) +/*! Control register address */ +#define CMICX_PDMA_CTRL(g, q) (CMICX_GRP_BASE(g) + CMICX_PDMA_CTRLr + q * 0x80) +/*! Status register address */ +#define CMICX_PDMA_STAT(g, q) (CMICX_GRP_BASE(g) + CMICX_PDMA_STATr + q * 0x80) +/*! Descriptor Address Lower register address */ +#define CMICX_PDMA_DESC_LO(g, q) (CMICX_GRP_BASE(g) + CMICX_PDMA_DESC_LOr + q * 0x80) +/*! Descriptor Address Higher register address */ +#define CMICX_PDMA_DESC_HI(g, q) (CMICX_GRP_BASE(g) + CMICX_PDMA_DESC_HIr + q * 0x80) +/*! Current Descriptor Address Lower register address */ +#define CMICX_PDMA_CURR_DESC_LO(g, q) (CMICX_GRP_BASE(g) + CMICX_PDMA_CURR_DESC_LOr + q * 0x80) +/*! Current Descriptor Address Higher register address */ +#define CMICX_PDMA_CURR_DESC_HI(g, q) (CMICX_GRP_BASE(g) + CMICX_PDMA_CURR_DESC_HIr + q * 0x80) +/*! Descriptor Halt Address Lower register address */ +#define CMICX_PDMA_DESC_HALT_LO(g, q) (CMICX_GRP_BASE(g) + CMICX_PDMA_DESC_HALT_LOr + q * 0x80) +/*! Descriptor Halt Address Higher register address */ +#define CMICX_PDMA_DESC_HALT_HI(g, q) (CMICX_GRP_BASE(g) + CMICX_PDMA_DESC_HALT_HIr + q * 0x80) +/*! COS Control Rx0 register address */ +#define CMICX_PDMA_COS_CTRL_RX0(g, q) (CMICX_GRP_BASE(g) + CMICX_PDMA_COS_CTRL_RX0r + q * 0x80) +/*! COS Control Rx1 register address */ +#define CMICX_PDMA_COS_CTRL_RX1(g, q) (CMICX_GRP_BASE(g) + CMICX_PDMA_COS_CTRL_RX1r + q * 0x80) +/*! Interrupt Coalesce register address */ +#define CMICX_PDMA_INTR_COAL(g, q) (CMICX_GRP_BASE(g) + CMICX_PDMA_INTR_COALr + q * 0x80) +/*! Rx Buffer Threshhold register address */ +#define CMICX_PDMA_RBUF_THRE(g, q) (CMICX_GRP_BASE(g) + CMICX_PDMA_RBUF_THREr + q * 0x80) +/*! Debug Control register address */ +#define CMICX_PDMA_DEBUG_CTRL(g, q) (CMICX_GRP_BASE(g) + CMICX_PDMA_DEBUG_CTRLr + q * 0x80) +/*! Debug Status register address */ +#define CMICX_PDMA_DEBUG_STAT(g, q) (CMICX_GRP_BASE(g) + CMICX_PDMA_DEBUG_STATr + q * 0x80) +/*! Debug State Machine Status register address */ +#define CMICX_PDMA_DEBUG_SM_STAT(g, q) (CMICX_GRP_BASE(g) + CMICX_PDMA_DEBUG_SM_STATr + q * 0x80) +/*! Rx Packet Count register address */ +#define CMICX_PDMA_COUNT_RX(g, q) (CMICX_GRP_BASE(g) + CMICX_PDMA_COUNT_RXr + q * 0x80) +/*! Tx Packet Count register address */ +#define CMICX_PDMA_COUNT_TX(g, q) (CMICX_GRP_BASE(g) + CMICX_PDMA_COUNT_TXr + q * 0x80) +/*! Dropped Rx Packet Count register address */ +#define CMICX_PDMA_COUNT_RX_DROP(g, q) (CMICX_GRP_BASE(g) + CMICX_PDMA_COUNT_RX_DROPr + q * 0x80) +/*! Requested Descriptor Count register address */ +#define CMICX_PDMA_DESC_CNT_REQ(g, q) (CMICX_GRP_BASE(g) + CMICX_PDMA_DESC_CNT_REQr + q * 0x80) +/*! Received Descriptor Count register address */ +#define CMICX_PDMA_DESC_CNT_RX(g, q) (CMICX_GRP_BASE(g) + CMICX_PDMA_DESC_CNT_RXr + q * 0x80) +/*! Updated Descriptor Count register address */ +#define CMICX_PDMA_DESC_CNT_STAT(g, q) (CMICX_GRP_BASE(g) + CMICX_PDMA_DESC_CNT_STATr + q * 0x80) +/*! Interrupt Status register address */ +#define CMICX_PDMA_IRQ_STAT(g) (CMICX_GRP_BASE(g) + CMICX_PDMA_IRQ_STATr) +/*! Interrupt Status Clear register address */ +#define CMICX_PDMA_IRQ_STAT_CLR(g) (CMICX_GRP_BASE(g) + CMICX_PDMA_IRQ_STAT_CLRr) +/*! Interrupt Enable register address0 */ +#define CMICX_PDMA_IRQ_ENAB0 0x18013100 +/*! Interrupt Enable register address1 */ +#define CMICX_PDMA_IRQ_ENAB1 0x18013104 +/*! Interrupt Enable register address2 */ +#define CMICX_PDMA_IRQ_ENAB2 0x18013108 +/*! Interrupt raw status register address0 */ +#define CMICX_PDMA_IRQ_RAW_STAT0 0x18013150 +/*! Interrupt raw status register address1 */ +#define CMICX_PDMA_IRQ_RAW_STAT1 0x18013154 +/*! Interrupt raw status register address2 */ +#define CMICX_PDMA_IRQ_RAW_STAT2 0x18013158 +/*! EP_TO_CPU Header Size register address */ +#define CMICX_EP_TO_CPU_HEADER_SIZE 0x00000004 +/*! Top config register address */ +#define CMICX_TOP_CONFIG 0x00000008 +/*! Credits release register address */ +#define CMICX_EPINTF_RELEASE_CREDITS 0x0000006c +/*! Max credits register address */ +#define CMICX_EPINTF_MAX_CREDITS 0x00000070 +/*! \} */ + +/*! + * \name Control register definitions + */ +/*! \{ */ +/*! Disable abort on error */ +#define CMICX_PDMA_NO_ABORT_ON_ERR 0x00002000 +/*! EP_TO_CPU header big endianess */ +#define CMICX_PDMA_HDR_BIG_ENDIAN 0x00001000 +/*! Continuous descriptor mode */ +#define CMICX_PDMA_CONTINUOUS_DESC 0x00000200 +/*! Continuous DMA mode */ +#define CMICX_PDMA_CONTINUOUS 0x00000100 +/*! Interrupt after descriptor */ +#define CMICX_PDMA_INTR_ON_DESC 0x00000080 +/*! Update status on reload */ +#define CMICX_PDMA_RLD_STAT_DIS 0x00000040 +/*! Dropped on chain end */ +#define CMICX_PDMA_DROP_ON_END 0x00000020 +/*! Descriptor big endianess */ +#define CMICX_PDMA_DESC_BIG_ENDIAN 0x00000010 +/*! Packet DMA big endianess */ +#define CMICX_PDMA_PKT_BIG_ENDIAN 0x00000008 +/*! Abort DMA */ +#define CMICX_PDMA_ABORT 0x00000004 +/*! Enable DMA */ +#define CMICX_PDMA_ENABLE 0x00000002 +/*! DMA direction */ +#define CMICX_PDMA_DIR 0x00000001 +/*! EP_TO_CPU header alignment bytes */ +#define CMICX_PDMA_HDR_ALMNT(bytes) (((bytes) & 0x3) << 10) +/*! \} */ + +/*! + * \name Status register definitions + */ +/*! \{ */ +/*! Channel in halt */ +#define CMICX_PDMA_IN_HALT 0x00000040 +/*! Channel active */ +#define CMICX_PDMA_IS_ACTIVE 0x00000002 +/*! Chain done */ +#define CMICX_PDMA_CHAIN_DONE 0x00000001 +/*! \} */ + +/*! + * \name Interrupt_coalesce register definitions + */ +/*! \{ */ +/*! Interrupt coalesce enable */ +#define CMICX_PDMA_INTR_COAL_ENA (1 << 31) +/*! Interrupt coalesce threshhold */ +#define CMICX_PDMA_INTR_THRESH(cnt) (((cnt) & 0x7fff) << 16) +/*! Interrupt coalesce timeout */ +#define CMICX_PDMA_INTR_TIMER(tmr) ((tmr) & 0xffff) +/*! \} */ + +/*! + * \name Interrupt status&clear register definitions + */ +/*! \{ */ +/*! Descriptor done */ +#define CMICX_PDMA_IRQ_DESC_DONE(q) (0x00000001 << ((q) * 4)) +/*! Chain done */ +#define CMICX_PDMA_IRQ_CHAIN_DONE(q) (0x00000002 << ((q) * 4)) +/*! Coalescing interrupt */ +#define CMICX_PDMA_IRQ_COALESCE_INTR(q) (0x00000004 << ((q) * 4)) +/*! Controlled interrupt */ +#define CMICX_PDMA_IRQ_CTRLD_INTR(q) (0x00000008 << ((q) * 4)) +/*! Interrupt mask */ +#define CMICX_PDMA_IRQ_MASK(q) (0xf << ((q) * 4)) +/*! Interrupt start number */ +#define CMICX_IRQ_START_NUM (128 + 3) +/*! Interrupt number offset */ +#define CMICX_IRQ_NUM_OFFSET 4 +/*! Interrupt mask shift */ +#define CMICX_IRQ_MASK_SHIFT 16 +/*! \} */ + +/*! 32-bit register read */ +#define DEV_READ32(_c, _a, _p) \ + do { \ + if ((_c)->dev->mode != DEV_MODE_VNET) { \ + *(_p) = ((volatile uint32_t *)(_c)->hw_addr)[(_a) / 4]; \ + } \ + } while (0) + +/*! 32-bit register write */ +#define DEV_WRITE32(_c, _a, _v) \ + do { \ + if ((_c)->dev->mode != DEV_MODE_VNET) { \ + ((volatile uint32_t *)(_c)->hw_addr)[(_a) / 4] = (_v); \ + } \ + } while (0) + +/*! + * \brief Rx descriptor. + */ +struct cmicx_rx_desc { + /*! Packet address lower */ + volatile uint32_t addr_lo; + + /*! Packet address higher */ + volatile uint32_t addr_hi; + + /*! Packet control */ + volatile uint32_t ctrl; + + /*! Packet status */ + volatile uint32_t status; +} __attribute__((packed)); + +/*! + * \brief Tx descriptor. + */ +struct cmicx_tx_desc { + /*! Packet address lower */ + volatile uint32_t addr_lo; + + /*! Packet address higher */ + volatile uint32_t addr_hi; + + /*! Packet control */ + volatile uint32_t ctrl; + + /*! Packet status */ + volatile uint32_t status; +} __attribute__((packed)); + +/*! + * Flags related to descriptors. + */ +/*! Disable descriptor status write */ +#define CMICX_DESC_CTRL_STAT_WR_DIS (1 << 29) +/*! Descriptors remaining */ +#define CMICX_DESC_CTRL_REMAIN(cnt) (((cnt) & 0xf) << 25) +/*! Max remaining descriptors */ +#define CMICX_DESC_REMAIN_MAX 8 +/*! Controlled interrupt */ +#define CMICX_DESC_CTRL_CNTLD_INTR (1 << 24) +/*! Completed interrupt */ +#define CMICX_DESC_CTRL_CMPLT_INTR (1 << 23) +/*! Reload DCB */ +#define CMICX_DESC_CTRL_RELOAD (1 << 18) +/*! Scatter DCB */ +#define CMICX_DESC_CTRL_SCATTER (1 << 17) +/*! Chained DCB */ +#define CMICX_DESC_CTRL_CHAIN (1 << 16) +/*! Control flags */ +#define CMICX_DESC_CTRL_FLAGS(f) (((f) & 0xffff) << 16) +/*! Purge packet */ +#define CMICX_DESC_TX_PURGE_PKT (1 << 6) +/*! Higig packet */ +#define CMICX_DESC_TX_HIGIG_PKT (1 << 3) +/*! Packet length */ +#define CMICX_DESC_CTRL_LEN(len) ((len) & 0xffff) +/*! Done */ +#define CMICX_DESC_STAT_RTX_DONE (1 << 31) +/*! Ecc error */ +#define CMICX_DESC_STAT_DATA_ERR (1 << 19) +/*! Cell error */ +#define CMICX_DESC_STAT_CELL_ERR (1 << 18) +/*! Error mask */ +#define CMICX_DESC_STAT_ERR_MASK (CMICX_DESC_STAT_DATA_ERR | \ + CMICX_DESC_STAT_CELL_ERR) +/*! Packet start */ +#define CMICX_DESC_STAT_PKT_START (1 << 17) +/*! Packet end */ +#define CMICX_DESC_STAT_PKT_END (1 << 16) +/*! Get done state */ +#define CMICX_DESC_STAT_DONE(stat) ((stat) & CMICX_DESC_STAT_RTX_DONE) +/*! Get flags */ +#define CMICX_DESC_STAT_FLAGS(stat) (((stat) >> 16) & ~0x8003) +/*! Get packet length */ +#define CMICX_DESC_STAT_LEN(stat) ((stat) & 0xffff) + +/*! Tx packet header size */ +#define CMICX_TX_PKT_HDR_SIZE 16 + +/*! HW access retry times */ +#define CMICX_HW_RETRY_TIMES 100000 + +/*! + * \brief Initialize HW handles. + * + * \param [in] hw HW structure point. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +bcmcnet_cmicx_pdma_hw_hdls_init(struct pdma_hw *hw); + +/*! + * \brief Initialize descriptor operations. + * + * \param [in] hw HW structure point. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +bcmcnet_cmicx_pdma_desc_ops_init(struct pdma_hw *hw); + +/*! + * \brief Attach device driver. + * + * \param [in] dev Device structure point. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +bcmcnet_cmicx_pdma_driver_attach(struct pdma_dev *dev); + +/*! + * \brief Detach device driver. + * + * \param [in] dev Device structure point. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +bcmcnet_cmicx_pdma_driver_detach(struct pdma_dev *dev); + +#endif /* BCMCNET_CMICX_H */ + diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/include/bcmcnet/bcmcnet_core.h b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/include/bcmcnet/bcmcnet_core.h new file mode 100644 index 000000000000..13db809dda36 --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/include/bcmcnet/bcmcnet_core.h @@ -0,0 +1,1323 @@ +/*! \file bcmcnet_core.h + * + * Generic data structure definitions and APIs for BCMCNET driver. + * + */ +/* + * $Copyright: Copyright 2018-2020 Broadcom. All rights reserved. + * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * A copy of the GNU General Public License version 2 (GPLv2) can + * be found in the LICENSES folder.$ + */ + +#ifndef BCMCNET_CORE_H +#define BCMCNET_CORE_H + +#include +#include + +/*! + * \brief Packet header structure. + */ +struct pkt_hdr { + /*! Meta data or outer header */ + uint8_t meta_data[16]; + + /*! Reserved */ + uint16_t rsvd0; + + /*! Packet signature */ + uint16_t pkt_sig; + + /*! Reserved */ + uint32_t rsvd1; + + /*! Data length */ + uint16_t data_len; + + /*! Reserved */ + uint16_t rsvd2; + + /*! Meta length */ + uint8_t meta_len; + + /*! Queue index */ + uint8_t queue_id; + + /*! Attributes */ + uint16_t attrs; + /*! Tx higig packet */ +#define PDMA_TX_HIGIG_PKT (1 << 0) + /*! Tx pause packet */ +#define PDMA_TX_PAUSE_PKT (1 << 1) + /*! Tx purge packet */ +#define PDMA_TX_PURGE_PKT (1 << 2) + /*! Tx queue number */ +#define PDMA_TX_BIND_QUE (1 << 3) + /*! Tx cookded header */ +#define PDMA_TX_HDR_COOKED (1 << 4) + /*! Tx to HNET */ +#define PDMA_TX_TO_HNET (1 << 5) + /*! Rx to VNET */ +#define PDMA_RX_TO_VNET (1 << 10) + /*! Rx strip vlan tag */ +#define PDMA_RX_STRIP_TAG (1 << 11) + /*! Rx set protocol type */ +#define PDMA_RX_SET_PROTO (1 << 12) + /*! Rx IP checksum */ +#define PDMA_RX_IP_CSUM (1 << 13) + /*! Rx TCPUDP checksum */ +#define PDMA_RX_TU_CSUM (1 << 14) +}; + +/*! Packet header size */ +#define PKT_HDR_SIZE sizeof(struct pkt_hdr) + +/*! + * \brief Packet buffer structure. + */ +struct pkt_buf { + /*! Packet header */ + struct pkt_hdr pkh; + + /*! Packet data */ + uint8_t data; +}; + +/*! + * \brief Interrupt handle. + */ +struct intr_handle { + /*! Device number */ + int unit; + + /*! Group number */ + int group; + + /*! Channel number */ + int chan; + + /*! Queue number */ + int queue; + + /*! Direction */ + int dir; + + /*! Polling budget */ + int budget; + + /*! Device point */ + void *dev; + + /*! Private point */ + void *priv; + + /*! Interrupt number */ + int intr_num; + + /*! Interrupt flags */ + uint32_t intr_flags; +}; + +/*! + * \brief Queue group structure. + */ +struct queue_group { + /*! Pointer to the device control structure */ + struct dev_ctrl *ctrl; + + /*! Interrupt handles */ + struct intr_handle intr_hdl[NUM_Q_PER_GRP]; + + /*! Rx queue pointers */ + void *rx_queue[NUM_Q_PER_GRP]; + + /*! Tx queue pointers */ + void *tx_queue[NUM_Q_PER_GRP]; + + /*! Virtual Rx queue pointers */ + void *vnet_rxq[NUM_Q_PER_GRP]; + + /*! Virtual Tx queue pointers */ + void *vnet_txq[NUM_Q_PER_GRP]; + + /*! Bitmap for Rx queues at work */ + uint32_t bm_rxq; + + /*! Bitmap for Tx queues at work */ + uint32_t bm_txq; + + /*! Number of Rx queues at work */ + uint32_t nb_rxq; + + /*! Number of Tx queues at work */ + uint32_t nb_txq; + + /*! Number of descriptors */ + uint32_t nb_desc[NUM_Q_PER_GRP]; + + /*! Rx buffer size */ + uint32_t rx_size[NUM_Q_PER_GRP]; + + /*! Queue mode */ + uint32_t que_ctrl[NUM_Q_PER_GRP]; + /*! Packet_byte_swap */ +#define PDMA_PKT_BYTE_SWAP (1 << 0) + /*! Non packet_byte_swap */ +#define PDMA_OTH_BYTE_SWAP (1 << 1) + /*! Header_byte_swap */ +#define PDMA_HDR_BYTE_SWAP (1 << 2) + + /*! Group ID */ + int id; + + /*! Queues need to poll */ + uint32_t poll_queues; + + /*! Active IRQs for DMA control */ + uint32_t irq_mask; + + /*! Indicating the group is attached */ + int attached; +}; + +/*! + * \brief Device control structure. + */ +struct dev_ctrl { + /*! Pointer to the device structure */ + struct pdma_dev *dev; + + /*! Pointer to hardware-specific data */ + void *hw; + + /*! HW base address */ + volatile void *hw_addr; + + /*! Queue groups */ + struct queue_group grp[NUM_GRP_MAX]; + + /*! Pointers to Rx queues */ + void *rx_queue[NUM_QUE_MAX]; + + /*! Pointers to Tx queues */ + void *tx_queue[NUM_QUE_MAX]; + + /*! Pointers to virtual Rx queues */ + void *vnet_rxq[NUM_QUE_MAX]; + + /*! Pointers to virtual Tx queues */ + void *vnet_txq[NUM_QUE_MAX]; + + /*! Pointer to buffer manager */ + void *buf_mngr; + + /*! VNET sync data */ + vnet_sync_t vsync; + + /*! Bitmap of groups at work */ + uint32_t bm_grp; + + /*! Bitmap of Rx queues at work */ + uint32_t bm_rxq; + + /*! Bitmap of Tx queues at work */ + uint32_t bm_txq; + + /*! Number of groups at work */ + uint32_t nb_grp; + + /*! Number of Rx queues at work */ + uint32_t nb_rxq; + + /*! Number of Tx queues at work */ + uint32_t nb_txq; + + /*! Number of descriptors for a queue */ + uint32_t nb_desc; + + /*! Budget for once queue processing */ + uint32_t budget; + + /*! Common Rx buffer size for all queues */ + uint32_t rx_buf_size; + + /*! Rx descriptor size */ + uint32_t rx_desc_size; + + /*! Tx descriptor size */ + uint32_t tx_desc_size; +}; + +/*! + * Configure device. + * + * \param [in] dev Pointer to device structure. + * \param [in] bm_rxq Rx queue bitmap. + * \param [in] bm_txq Tx queue bitmap. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +typedef int (*pdma_dev_config_f)(struct pdma_dev *dev, uint32_t bm_rxq, uint32_t bm_txq); + +/*! + * Start device. + * + * \param [in] dev Pointer to device structure. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +typedef int (*pdma_dev_start_f)(struct pdma_dev *dev); + +/*! + * Stop device. + * + * \param [in] dev Pointer to device structure. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +typedef int (*pdma_dev_stop_f)(struct pdma_dev *dev); + +/*! + * Close device. + * + * \param [in] dev Pointer to device structure. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +typedef int (*pdma_dev_close_f)(struct pdma_dev *dev); + +/*! + * Suspend device. + * + * \param [in] dev Pointer to device structure. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +typedef int (*pdma_dev_suspend_f)(struct pdma_dev *dev); + +/*! + * Resume device. + * + * \param [in] dev Pointer to device structure. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +typedef int (*pdma_dev_resume_f)(struct pdma_dev *dev); + +/*! + * Get device information. + * + * \param [in] dev Pointer to device structure. + */ +typedef void (*pdma_dev_info_get_f)(struct pdma_dev *dev); + +/*! + * Get device statistics. + * + * \param [in] dev Pointer to device structure. + */ +typedef void (*pdma_dev_stats_get_f)(struct pdma_dev *dev); + +/*! + * Reset device statistics. + * + * \param [in] dev Pointer to device structure. + */ +typedef void (*pdma_dev_stats_reset_f)(struct pdma_dev *dev); + +/*! + * Convert logic queue to physical queue. + * + * \param [in] dev Pointer to device structure. + * \param [in] queue Logic queue number. + * \param [in] dir Transmit direction. + * \param [in] chan Channel number. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +typedef int (*pdma_dev_lq2pq_f)(struct pdma_dev *dev, int queue, int dir, int *chan); + +/*! + * Convert physical queue to logic queue. + * + * \param [in] dev Pointer to device structure. + * \param [in] chan Channel number. + * \param [in] queue Logic queue number. + * \param [in] dir Transmit direction. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +typedef int (*pdma_dev_pq2lq_f)(struct pdma_dev *dev, int chan, int *queue, int *dir); + +/*! + * Start queue. + * + * \param [in] dev Pointer to device structure. + * \param [in] queue Queue number. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +typedef int (*pdma_queue_start_f)(struct pdma_dev *dev, int queue); + +/*! + * Stop queue. + * + * \param [in] dev Pointer to device structure. + * \param [in] queue Queue number. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +typedef int (*pdma_queue_stop_f)(struct pdma_dev *dev, int queue); + +/*! + * Set up queue. + * + * \param [in] dev Pointer to device structure. + * \param [in] queue Queue number. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +typedef int (*pdma_queue_setup_f)(struct pdma_dev *dev, int queue); + +/*! + * Release queue. + * + * \param [in] dev Pointer to device structure. + * \param [in] queue Queue number. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +typedef int (*pdma_queue_release_f)(struct pdma_dev *dev, int queue); + +/*! + * Restore queue. + * + * \param [in] dev Pointer to device structure. + * \param [in] queue Queue number. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +typedef int (*pdma_queue_restore_f)(struct pdma_dev *dev, int queue); + +/*! + * Enable queue interrupt. + * + * \param [in] dev Pointer to device structure. + * \param [in] queue Queue number. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +typedef int (*pdma_intr_enable_f)(struct pdma_dev *dev, int queue); + +/*! + * Disable queue interrupt. + * + * \param [in] dev Pointer to device structure. + * \param [in] queue Queue number. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +typedef int (*pdma_intr_disable_f)(struct pdma_dev *dev, int queue); + +/*! + * Acknowledge queue interrupt. + * + * \param [in] dev Pointer to device structure. + * \param [in] queue Queue number. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +typedef int (*pdma_intr_ack_f)(struct pdma_dev *dev, int queue); + +/*! + * Query queue interrupt. + * + * \param [in] dev Pointer to device structure. + * \param [in] queue Queue number. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +typedef int (*pdma_intr_query_f)(struct pdma_dev *dev, int queue); + +/*! + * Check queue interrupt. + * + * \param [in] dev Pointer to device structure. + * \param [in] queue Queue number. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +typedef int (*pdma_intr_check_f)(struct pdma_dev *dev, int queue); + +/*! + * Suspend Rx queue. + * + * \param [in] dev Pointer to device structure. + * \param [in] queue Queue number. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +typedef int (*pdma_rx_queue_suspend_f)(struct pdma_dev *dev, int queue); + +/*! + * Resume Rx queue. + * + * \param [in] dev Pointer to device structure. + * \param [in] queue Queue number. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +typedef int (*pdma_rx_queue_resume_f)(struct pdma_dev *dev, int queue); + +/*! + * Wake up Tx queue. + * + * \param [in] dev Pointer to device structure. + * \param [in] queue Queue number. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +typedef int (*pdma_tx_queue_wakeup_f)(struct pdma_dev *dev, int queue); + +/*! + * Poll Rx queue. + * + * \param [in] dev Pointer to device structure. + * \param [in] queue Queue number. + * \param [in] budget Max number of descriptor to poll. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +typedef int (*pdma_rx_queue_poll_f)(struct pdma_dev *dev, int queue, int budget); + +/*! + * Poll Tx queue. + * + * \param [in] dev Pointer to device structure. + * \param [in] queue Queue number. + * \param [in] budget Max number of descriptor to poll. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +typedef int (*pdma_tx_queue_poll_f)(struct pdma_dev *dev, int queue, int budget); + +/*! + * Poll queue group. + * + * \param [in] dev Pointer to device structure. + * \param [in] queue Queue number. + * \param [in] budget Max number of descriptor to poll. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +typedef int (*pdma_group_poll_f)(struct pdma_dev *dev, int group, int budget); + +/*! + * \brief Exported functions structure. + */ +struct dev_ops { + /*! Configure device */ + pdma_dev_config_f dev_config; + + /*! Start device */ + pdma_dev_start_f dev_start; + + /*! Stop device */ + pdma_dev_stop_f dev_stop; + + /*! Close device */ + pdma_dev_close_f dev_close; + + /*! Suspend device */ + pdma_dev_suspend_f dev_suspend; + + /*! Resume device */ + pdma_dev_resume_f dev_resume; + + /*! Get device information */ + pdma_dev_info_get_f dev_info_get; + + /*! Get device statistics */ + pdma_dev_stats_get_f dev_stats_get; + + /*! Reset device statistics */ + pdma_dev_stats_reset_f dev_stats_reset; + + /*! Logic queue to physical queue */ + pdma_dev_lq2pq_f dev_lq_to_pq; + + /*! Physical queue to logic queue */ + pdma_dev_pq2lq_f dev_pq_to_lq; + + /*! Start Rx for a queue */ + pdma_queue_start_f rx_queue_start; + + /*! Stop Rx for a queue */ + pdma_queue_stop_f rx_queue_stop; + + /*! Start Tx for a queue */ + pdma_queue_start_f tx_queue_start; + + /*! Stop Tx for a queue */ + pdma_queue_stop_f tx_queue_stop; + + /*! Set up Rx queue */ + pdma_queue_setup_f rx_queue_setup; + + /*! Release Rx queue */ + pdma_queue_release_f rx_queue_release; + + /*! Restore stopped Rx queue */ + pdma_queue_restore_f rx_queue_restore; + + /*! Set up virtual Rx queue */ + pdma_queue_setup_f rx_vqueue_setup; + + /*! Release virtual Rx queue */ + pdma_queue_release_f rx_vqueue_release; + + /*! Set up Tx queue */ + pdma_queue_setup_f tx_queue_setup; + + /*! Release Tx queue */ + pdma_queue_release_f tx_queue_release; + + /*! Restore stopped Tx queue */ + pdma_queue_restore_f tx_queue_restore; + + /*! Set up virtual Tx queue */ + pdma_queue_setup_f tx_vqueue_setup; + + /*! Release virtual Tx queue */ + pdma_queue_release_f tx_vqueue_release; + + /*! Enable Rx queue interrupt */ + pdma_intr_enable_f rx_queue_intr_enable; + + /*! Disable Rx queue interrupt */ + pdma_intr_disable_f rx_queue_intr_disable; + + /*! Acknowledge interrupt for Rx queue */ + pdma_intr_ack_f rx_queue_intr_ack; + + /*! Query interrupt status for Rx queue */ + pdma_intr_query_f rx_queue_intr_query; + + /*! Check interrupt validity for Rx queue */ + pdma_intr_check_f rx_queue_intr_check; + + /*! Enable Tx queue interrupt */ + pdma_intr_enable_f tx_queue_intr_enable; + + /*! Disable Tx queue interrupt */ + pdma_intr_disable_f tx_queue_intr_disable; + + /*! Acknowledge interrupt for Tx queue */ + pdma_intr_ack_f tx_queue_intr_ack; + + /*! Query interrupt status for Tx queue */ + pdma_intr_query_f tx_queue_intr_query; + + /*! Check interrupt validity for Tx queue */ + pdma_intr_check_f tx_queue_intr_check; + + /*! Suspend a Rx queue */ + pdma_rx_queue_suspend_f rx_queue_suspend; + + /*! Resume a Rx queue */ + pdma_rx_queue_resume_f rx_queue_resume; + + /*! Wake up a Tx queue to transmit */ + pdma_tx_queue_wakeup_f tx_queue_wakeup; + + /*! Poll for a Rx queue */ + pdma_rx_queue_poll_f rx_queue_poll; + + /*! Poll for a Tx queue */ + pdma_tx_queue_poll_f tx_queue_poll; + + /*! Poll for a group */ + pdma_group_poll_f group_poll; +}; + +/*! + * Read 32-bit device register. + * + * \param [in] dev Pointer to device structure. + * \param [in] addr Register address. + * \param [in] data Pointer to read data. + * + * \retval SHR_E_NONE No errors. + */ +typedef int (*reg32_read_f)(struct pdma_dev *dev, uint32_t addr, uint32_t *data); + +/*! + * Write 32-bit device register. + * + * \param [in] dev Pointer to device structure. + * \param [in] addr Register address. + * \param [in] data Data to write. + * + * \retval SHR_E_NONE No errors. + */ +typedef int (*reg32_write_f)(struct pdma_dev *dev, uint32_t addr, uint32_t data); + +/*! + * Receive packet. + * + * \param [in] dev Pointer to device structure. + * \param [in] queue Rx queue number. + * \param [in] buf Pointer to packet buffer. + * + * \retval SHR_E_NONE No errors. + */ +typedef int (*pdma_rx_f)(struct pdma_dev *dev, int queue, void *buf); + +/*! + * Transmit packet. + * + * \param [in] dev Pointer to device structure. + * \param [in] queue Tx queue number. + * \param [in] buf Pointer to packet buffer. + * + * \retval SHR_E_NONE No errors. + */ +typedef int (*pdma_tx_f)(struct pdma_dev *dev, int queue, void *buf); + +/*! + * Suspend Tx queue. + * + * \param [in] dev Pointer to device structure. + * \param [in] queue Tx queue number. + */ +typedef void (*sys_tx_suspend_f)(struct pdma_dev *dev, int queue); + +/*! + * Resume Tx queue. + * + * \param [in] dev Pointer to device structure. + * \param [in] queue Tx queue number. + */ +typedef void (*sys_tx_resume_f)(struct pdma_dev *dev, int queue); + +/*! + * Enable interrupts. + * + * \param [in] dev Pointer to device structure. + * \param [in] group Channel group number. + * \param [in] chan Channel number. + * \param [in] reg Interrupt enable register. + * \param [in] mask Interrupt mask. + */ +typedef void (*sys_intr_unmask_f)(struct pdma_dev *dev, int group, int chan, + uint32_t reg, uint32_t mask); + +/*! + * Disable interrupts. + * + * \param [in] dev Pointer to device structure. + * \param [in] group Channel group number. + * \param [in] chan Channel number. + * \param [in] reg Interrupt enable register. + * \param [in] mask Interrupt mask. + */ +typedef void (*sys_intr_mask_f)(struct pdma_dev *dev, int group, int chan, + uint32_t reg, uint32_t mask); + +/*! + * Wait for notification from the other side. + * + * \param [in] dev Pointer to device structure. + * + * \retval SHR_E_NONE No errors. + */ +typedef int (*xnet_wait_f)(struct pdma_dev *dev); + +/*! + * Wake up the other side. + * + * \param [in] dev Pointer to device structure. + * + * \retval SHR_E_NONE No errors. + */ +typedef int (*xnet_wake_f)(struct pdma_dev *dev); + +/*! + * Convert physical address to virtual address. + * + * \param [in] dev Pointer to device structure. + * \param [in] paddr Physical address. + * + * \retval Virtual address. + */ +typedef void *(*sys_p2v_f)(struct pdma_dev *dev, uint64_t paddr); + +/*! + * Convert virtual address to physical address. + * + * \param [in] dev Pointer to device structure. + * \param [in] vaddr Virtual address. + * + * \retval Physical address. + */ +typedef uint64_t (*sys_v2p_f)(struct pdma_dev *dev, void *vaddr); + +/*! + * \brief Device structure. + */ +struct pdma_dev { + /*! Device name */ + char name[DEV_NAME_LEN_MAX]; + + /*! Device ID */ + uint32_t dev_id; + + /*! Device type */ + uint32_t dev_type; + + /*! Device Number */ + int unit; + + /*! Device control structure */ + struct dev_ctrl ctrl; + + /*! Pointer to the exported funtions structure */ + struct dev_ops *ops; + + /*! Device information */ + struct bcmcnet_dev_info info; + + /*! Device statistics data */ + struct bcmcnet_dev_stats stats; + + /*! Private data */ + void *priv; + + /*! Read 32-bit device register */ + reg32_read_f dev_read32; + + /*! Write 32-bit device register */ + reg32_write_f dev_write32; + + /*! Packet reception */ + pdma_rx_f pkt_recv; + + /*! Packet transmission */ + pdma_tx_f pkt_xmit; + + /*! Tx suspend */ + sys_tx_suspend_f tx_suspend; + + /*! Tx resume */ + sys_tx_resume_f tx_resume; + + /*! Enable a set of interrupts */ + sys_intr_unmask_f intr_unmask; + + /*! Disable a set of interrupts */ + sys_intr_mask_f intr_mask; + + /*! Virtual network wait for */ + xnet_wait_f xnet_wait; + + /*! Virtual network wake up */ + xnet_wake_f xnet_wake; + + /*! Physical address to virtual address */ + sys_p2v_f sys_p2v; + + /*! Virtual address to physical address */ + sys_v2p_f sys_v2p; + + /*! Maximum number of groups */ + int num_groups; + + /*! Maximum number of group queues */ + int grp_queues; + + /*! Maximum number of queues */ + int num_queues; + + /*! Rx packet header size */ + uint32_t rx_ph_size; + + /*! Tx packet header size */ + uint32_t tx_ph_size; + + /*! Flags */ + uint32_t flags; + /*! Interrupt processing per group */ +#define PDMA_GROUP_INTR (1 << 0) + /*! Tx polling mode */ +#define PDMA_TX_POLLING (1 << 1) + /*! Rx batch refilling */ +#define PDMA_RX_BATCHING (1 << 2) + /*! DMA chain mode */ +#define PDMA_CHAIN_MODE (1 << 3) + /*! Descriptor prefetch mode */ +#define PDMA_DESC_PREFETCH (1 << 4) + /*! VNET is docked */ +#define PDMA_VNET_DOCKED (1 << 5) + + /*! Device mode */ + dev_mode_t mode; + + /*! Device is started */ + int started; + + /*! Device is initialized and HMI driver is attached */ + int attached; +}; + +/*! + * \brief Initialize device. + * + * \param [in] dev Device structure point. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +bcmcnet_pdma_dev_init(struct pdma_dev *dev); + +/*! + * \brief Clean up device. + * + * \param [in] dev Device structure point. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +bcmcnet_pdma_dev_cleanup(struct pdma_dev *dev); + +/*! + * \brief Start device. + * + * \param [in] dev Device structure point. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +bcmcnet_pdma_dev_start(struct pdma_dev *dev); + +/*! + * \brief Stop device. + * + * \param [in] dev Device structure point. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +bcmcnet_pdma_dev_stop(struct pdma_dev *dev); + +/*! + * \brief Suspend device. + * + * \param [in] dev Device structure point. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +bcmcnet_pdma_dev_suspend(struct pdma_dev *dev); + +/*! + * \brief Resume device. + * + * \param [in] dev Device structure point. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +bcmcnet_pdma_dev_resume(struct pdma_dev *dev); + +/*! + * \brief Suspend device Rx. + * + * \param [in] dev Device structure point. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +bcmcnet_pdma_dev_rx_suspend(struct pdma_dev *dev); + +/*! + * \brief Resume device Rx. + * + * \param [in] dev Device structure point. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +bcmcnet_pdma_dev_rx_resume(struct pdma_dev *dev); + +/*! + * \brief Dock device. + * + * \param [in] dev Device structure point. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +bcmcnet_pdma_dev_dock(struct pdma_dev *dev); + +/*! + * \brief Undock device. + * + * \param [in] dev Device structure point. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +bcmcnet_pdma_dev_undock(struct pdma_dev *dev); + +/*! + * \brief Get device information. + * + * \param [in] dev Device structure point. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +bcmcnet_pdma_dev_info_get(struct pdma_dev *dev); + +/*! + * \brief Get device statistics. + * + * \param [in] dev Device structure point. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +bcmcnet_pdma_dev_stats_get(struct pdma_dev *dev); + +/*! + * \brief Reset device statistics. + * + * \param [in] dev Device structure point. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +bcmcnet_pdma_dev_stats_reset(struct pdma_dev *dev); + +/*! + * \brief Change queue number to channel number. + * + * \param [in] dev Device structure point. + * \param [in] queue Queue number. + * \param [in] dir Transmit direction. + * \param [out] chan Channel number. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +bcmcnet_pdma_dev_queue_to_chan(struct pdma_dev *dev, int queue, int dir, int *chan); + +/*! + * \brief Change channel number to queue number. + * + * \param [in] dev Device structure point. + * \param [in] chan Channel number. + * \param [out] queue Queue number. + * \param [out] dir Transmit direction. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +bcmcnet_pdma_dev_chan_to_queue(struct pdma_dev *dev, int chan, int *queue, int *dir); + +/*! + * \brief Enable Rx queue interrupt. + * + * \param [in] dev Device structure point. + * \param [in] queue Rx queue number. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +bcmcnet_rx_queue_intr_enable(struct pdma_dev *dev, int queue); + +/*! + * \brief Disable Rx queue interrupt. + * + * \param [in] dev Device structure point. + * \param [in] queue Rx queue number. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +bcmcnet_rx_queue_intr_disable(struct pdma_dev *dev, int queue); + +/*! + * \brief Acknowledge Rx queue interrupt. + * + * \param [in] dev Device structure point. + * \param [in] queue Rx queue number. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +bcmcnet_rx_queue_intr_ack(struct pdma_dev *dev, int queue); + +/*! + * \brief Check Rx queue interrupt. + * + * \param [in] dev Device structure point. + * \param [in] queue Rx queue number. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +bcmcnet_rx_queue_intr_check(struct pdma_dev *dev, int queue); + +/*! + * \brief Enable Tx queue interrupt. + * + * \param [in] dev Device structure point. + * \param [in] queue Tx queue number. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +bcmcnet_tx_queue_intr_enable(struct pdma_dev *dev, int queue); + +/*! + * \brief Disable Tx queue interrupt. + * + * \param [in] dev Device structure point. + * \param [in] queue Tx queue number. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +bcmcnet_tx_queue_intr_disable(struct pdma_dev *dev, int queue); + +/*! + * \brief Acknowledge Tx queue interrupt. + * + * \param [in] dev Device structure point. + * \param [in] queue Tx queue number. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +bcmcnet_tx_queue_intr_ack(struct pdma_dev *dev, int queue); + +/*! + * \brief Check Tx queue interrupt. + * + * \param [in] dev Device structure point. + * \param [in] queue Tx queue number. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +bcmcnet_tx_queue_intr_check(struct pdma_dev *dev, int queue); + +/*! + * \brief Enable queue interrupt. + * + * \param [in] dev Device structure point. + * \param [in] hdl Queue interrupt handle. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +bcmcnet_queue_intr_enable(struct pdma_dev *dev, struct intr_handle *hdl); + +/*! + * \brief Disable queue interrupt. + * + * \param [in] dev Device structure point. + * \param [in] hdl Queue interrupt handle. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +bcmcnet_queue_intr_disable(struct pdma_dev *dev, struct intr_handle *hdl); + +/*! + * \brief Acknowledge queue interrupt. + * + * \param [in] dev Device structure point. + * \param [in] hdl Queue interrupt handle. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +bcmcnet_queue_intr_ack(struct pdma_dev *dev, struct intr_handle *hdl); + +/*! + * \brief Check queue interrupt. + * + * \param [in] dev Device structure point. + * \param [in] hdl Queue interrupt handle. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +bcmcnet_queue_intr_check(struct pdma_dev *dev, struct intr_handle *hdl); + +/*! + * \brief Enable group interrupt. + * + * \param [in] dev Device structure point. + * \param [in] group Group number. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +bcmcnet_group_intr_enable(struct pdma_dev *dev, int group); + +/*! + * \brief Disable group interrupt. + * + * \param [in] dev Device structure point. + * \param [in] group Group number. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +bcmcnet_group_intr_disable(struct pdma_dev *dev, int group); + +/*! + * \brief Acknowledge group interrupt. + * + * \param [in] dev Device structure point. + * \param [in] group Group number. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +bcmcnet_group_intr_ack(struct pdma_dev *dev, int group); + +/*! + * \brief Check group interrupt. + * + * \param [in] dev Device structure point. + * \param [in] group Group number. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +bcmcnet_group_intr_check(struct pdma_dev *dev, int group); + +/*! + * \brief Poll Rx queue. + * + * \param [in] dev Device structure point. + * \param [in] queue Rx queue number. + * \param [in] budget Poll budget. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +bcmcnet_rx_queue_poll(struct pdma_dev *dev, int queue, int budget); + +/*! + * \brief Poll Tx queue. + * + * \param [in] dev Device structure point. + * \param [in] queue Tx queue number. + * \param [in] budget Poll budget. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +bcmcnet_tx_queue_poll(struct pdma_dev *dev, int queue, int budget); + +/*! + * \brief Poll queue. + * + * \param [in] dev Device structure point. + * \param [in] hdl Queue interrupt handle. + * \param [in] budget Poll budget. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +bcmcnet_queue_poll(struct pdma_dev *dev, struct intr_handle *hdl, int budget); + +/*! + * \brief Poll group. + * + * \param [in] dev Device structure point. + * \param [in] group Group number. + * \param [in] budget Poll budget. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +bcmcnet_group_poll(struct pdma_dev *dev, int group, int budget); + +#endif /* BCMCNET_CORE_H */ + diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/include/bcmcnet/bcmcnet_dev.h b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/include/bcmcnet/bcmcnet_dev.h new file mode 100644 index 000000000000..bc3367b34fae --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/include/bcmcnet/bcmcnet_dev.h @@ -0,0 +1,544 @@ +/*! \file bcmcnet_dev.h + * + * Generic data structure and macro definitions for BCMCNET device. + * + */ +/* + * $Copyright: Copyright 2018-2020 Broadcom. All rights reserved. + * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * A copy of the GNU General Public License version 2 (GPLv2) can + * be found in the LICENSES folder.$ + */ + +#ifndef BCMCNET_DEV_H +#define BCMCNET_DEV_H + +#include + +/*! + * \brief HW information. + */ +struct hw_info { + /*! HW name */ + char *name; + + /*! HW version */ + int ver_no; + + /*! Device ID */ + uint32_t dev_id; + + /*! Revision ID */ + uint32_t rev_id; + + /*! Number of CMCs */ + uint32_t num_cmcs; + + /*! Number of CMC channels */ + uint32_t cmc_chans; + + /*! Number of channels */ + uint32_t num_chans; + + /*! Rx DCB size */ + uint32_t rx_dcb_size; + + /*! Tx DCB size */ + uint32_t tx_dcb_size; + + /*! Rx packet header size */ + uint32_t rx_ph_size; + + /*! Tx packet header size */ + uint32_t tx_ph_size; + + /*! HW structure point */ + struct pdma_hw *hw; +}; + +/*! + * \brief Read 32-bit register. + * + * \param [in] hw Pointer to hardware structure. + * \param [in] addr Register address. + * \param [in] data Pointer to read data. + */ +typedef void (*reg_rd32_f)(struct pdma_hw *hw, uint32_t addr, uint32_t *data); + +/*! + * \brief Write 32-bit register. + * + * \param [in] hw Pointer to hardware structure. + * \param [in] addr Register address. + * \param [in] data Data to write. + */ +typedef void (*reg_wr32_f)(struct pdma_hw *hw, uint32_t addr, uint32_t data); + +/*! + * \brief Pre-initialize hardware. + * + * \param [in] hw Pointer to hardware structure. + * + * \retval SHR_E_NONE No errors. + */ +typedef int (*pre_init_f)(struct pdma_hw *hw); + +/*! + * \brief Initialize hardware. + * + * \param [in] hw Pointer to hardware structure. + * + * \retval SHR_E_NONE No errors. + */ +typedef int (*hw_init_f)(struct pdma_hw *hw); + +/*! + * \brief Configure hardware. + * + * \param [in] hw Pointer to hardware structure. + * + * \retval SHR_E_NONE No errors. + */ +typedef int (*hw_config_f)(struct pdma_hw *hw); + +/*! + * \brief Reset hardware. + * + * \param [in] hw Pointer to hardware structure. + * + * \retval SHR_E_NONE No errors. + */ +typedef int (*hw_reset_f)(struct pdma_hw *hw); + +/*! + * \brief Start channel. + * + * \param [in] hw Pointer to hardware structure. + * \param [in] chan Channel number. + * + * \retval SHR_E_NONE No errors. + */ +typedef int (*chan_start_f)(struct pdma_hw *hw, int chan); + +/*! + * \brief Stop channel. + * + * \param [in] hw Pointer to hardware structure. + * \param [in] chan Channel number. + * + * \retval SHR_E_NONE No errors. + */ +typedef int (*chan_stop_f)(struct pdma_hw *hw, int chan); + +/*! + * \brief Set up channel. + * + * \param [in] hw Pointer to hardware structure. + * \param [in] chan Channel number. + * \param [in] addr Start DMA address of descriptors. + * + * \retval SHR_E_NONE No errors. + */ +typedef int (*chan_setup_f)(struct pdma_hw *hw, int chan, uint64_t addr); + +/*! + * \brief Go to ohter descriptor. + * + * \param [in] hw Pointer to hardware structure. + * \param [in] chan Channel number. + * \param [in] addr Destination DMA address of descriptors. + * + * \retval SHR_E_NONE No errors. + */ +typedef int (*chan_goto_f)(struct pdma_hw *hw, int chan, uint64_t addr); + +/*! + * \brief Clear channel. + * + * \param [in] hw Pointer to hardware structure. + * \param [in] chan Channel number. + * + * \retval SHR_E_NONE No errors. + */ +typedef int (*chan_clear_f)(struct pdma_hw *hw, int chan); + +/*! + * \brief Get interrupt number. + * + * \param [in] hw Pointer to hardware structure. + * \param [in] chan Channel number. + * + * \retval Returned interrupt number, errors if negative value. + */ +typedef int (*chan_intr_num_get_f)(struct pdma_hw *hw, int chan); + +/*! + * \brief Enable interrupt. + * + * \param [in] hw Pointer to hardware structure. + * \param [in] chan Channel number. + * + * \retval SHR_E_NONE No errors. + */ +typedef int (*chan_intr_enable_f)(struct pdma_hw *hw, int chan); + +/*! + * \brief Disable interrupt. + * + * \param [in] hw Pointer to hardware structure. + * \param [in] chan Channel number. + * + * \retval SHR_E_NONE No errors. + */ +typedef int (*chan_intr_disable_f)(struct pdma_hw *hw, int chan); + +/*! + * \brief Query interrupt. + * + * \param [in] hw Pointer to hardware structure. + * \param [in] chan Channel number. + * + * \retval SHR_E_NONE No errors. + */ +typedef int (*chan_intr_query_f)(struct pdma_hw *hw, int chan); + +/*! + * \brief Check interrupt. + * + * \param [in] hw Pointer to hardware structure. + * \param [in] chan Channel number. + * + * \retval SHR_E_NONE No errors. + */ +typedef int (*chan_intr_check_f)(struct pdma_hw *hw, int chan); + +/*! + * \brief Coalesce interrupt. + * + * \param [in] hw Pointer to hardware structure. + * \param [in] chan Channel number. + * \param [in] count Count value to trigger interrupt. + * \param [in] timer Timer value to triggre interrupt. + * + * \retval SHR_E_NONE No errors. + */ +typedef int (*chan_intr_coalesce_f)(struct pdma_hw *hw, int chan, int count, int timer); + +/*! + * \brief Dump registers. + * + * \param [in] hw Pointer to hardware structure. + * \param [in] chan Channel number. + * + * \retval SHR_E_NONE No errors. + */ +typedef int (*chan_reg_dump_f)(struct pdma_hw *hw, int chan); + +/*! + * \brief HW handlers. + */ +struct hw_handlers { + /*! 32 bits register read */ + reg_rd32_f reg_rd32; + + /*! 32 bits register write */ + reg_wr32_f reg_wr32; + + /*! HW pre-initialize */ + pre_init_f pre_init; + + /*! HW initialize */ + hw_init_f hw_init; + + /*! HW configure */ + hw_config_f hw_config; + + /*! HW reset */ + hw_reset_f hw_reset; + + /*! Channel start */ + chan_start_f chan_start; + + /*! Channel stop */ + chan_stop_f chan_stop; + + /*! Channel setup */ + chan_setup_f chan_setup; + + /*! Channel goto */ + chan_goto_f chan_goto; + + /*! Channel clear */ + chan_clear_f chan_clear; + + /*! Channel interrupt number get */ + chan_intr_num_get_f chan_intr_num_get; + + /*! Channel interrupt enable */ + chan_intr_enable_f chan_intr_enable; + + /*! Channel interrupt disable */ + chan_intr_disable_f chan_intr_disable; + + /*! Channel interrupt query */ + chan_intr_query_f chan_intr_query; + + /*! Channel interrupt check */ + chan_intr_check_f chan_intr_check; + + /*! Channel interrupt coalesce */ + chan_intr_coalesce_f chan_intr_coalesce; + + /*! Channel registers dump */ + chan_reg_dump_f chan_reg_dump; +}; + +/*! + * \brief Initialize Rx descriptor. + * + * \param [in] hw Pointer to hardware structure. + * \param [in] rxq Pointer to Rx queue struture. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_MEMORY Allocation failed. + */ +typedef int (*rx_desc_init_f)(struct pdma_hw *hw, struct pdma_rx_queue *rxq); + +/*! + * \brief Clean up Rx descriptor. + * + * \param [in] hw Pointer to hardware structure. + * \param [in] rxq Pointer to Rx queue struture. + * + * \retval SHR_E_NONE No errors. + */ +typedef int (*rx_desc_clean_f)(struct pdma_hw *hw, struct pdma_rx_queue *rxq); + +/*! + * \brief Clean up Rx ring. + * + * \param [in] hw Pointer to hardware structure. + * \param [in] rxq Pointer to Rx queue struture. + * \param [in] budget Budget for each operation. + * + * \retval Number of descriptors finished. + */ +typedef int (*rx_ring_clean_f)(struct pdma_hw *hw, struct pdma_rx_queue *rxq, int budget); + +/*! + * \brief Dump Rx ring. + * + * \param [in] hw Pointer to hardware structure. + * \param [in] rxq Pointer to Rx queue struture. + * + * \retval SHR_E_NONE No errors. + */ +typedef int (*rx_ring_dump_f)(struct pdma_hw *hw, struct pdma_rx_queue *rxq); + +/*! + * \brief Suspend Rx queue. + * + * \param [in] hw Pointer to hardware structure. + * \param [in] rxq Pointer to Rx queue struture. + * + * \retval SHR_E_NONE No errors. + */ +typedef int (*rx_suspend_f)(struct pdma_hw *hw, struct pdma_rx_queue *rxq); + +/*! + * \brief Resume Rx queue. + * + * \param [in] hw Pointer to hardware structure. + * \param [in] rxq Pointer to Rx queue struture. + * + * \retval SHR_E_NONE No errors. + */ +typedef int (*rx_resume_f)(struct pdma_hw *hw, struct pdma_rx_queue *rxq); + +/*! + * \brief Initialize Tx descriptor. + * + * \param [in] hw Pointer to hardware structure. + * \param [in] txq Pointer to Tx queue struture. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_MEMORY Allocation failed. + */ +typedef int (*tx_desc_init_f)(struct pdma_hw *hw, struct pdma_tx_queue *txq); + +/*! + * \brief Clean up Tx descriptor. + * + * \param [in] hw Pointer to hardware structure. + * \param [in] txq Pointer to Tx queue struture. + * + * \retval SHR_E_NONE No errors. + */ +typedef int (*tx_desc_clean_f)(struct pdma_hw *hw, struct pdma_tx_queue *txq); + +/*! + * \brief Clean up Tx ring. + * + * \param [in] hw Pointer to hardware structure. + * \param [in] txq Pointer to Tx queue struture. + * \param [in] budget Budget for each operation. + * + * \retval Number of descriptors finished. + */ +typedef int (*tx_ring_clean_f)(struct pdma_hw *hw, struct pdma_tx_queue *txq, int budget); + +/*! + * \brief Dump Tx ring. + * + * \param [in] hw Pointer to hardware structure. + * \param [in] txq Pointer to Tx queue struture. + * + * \retval SHR_E_NONE No errors. + */ +typedef int (*tx_ring_dump_f)(struct pdma_hw *hw, struct pdma_tx_queue *txq); + +/*! + * \brief Transmit packet. + * + * \param [in] hw Pointer to hardware structure. + * \param [in] txq Pointer to Tx queue struture. + * \param [in] buf Pointer to packet buffer struture. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +typedef int (*pkt_xmit_f)(struct pdma_hw *hw, struct pdma_tx_queue *txq, void *buf); + +/*! + * \brief Descriptor operations. + */ +struct desc_operations { + /*! Rx descriptor initialize */ + rx_desc_init_f rx_desc_init; + + /*! Rx descriptor cleanup */ + rx_desc_clean_f rx_desc_clean; + + /*! Rx ring cleanup */ + rx_ring_clean_f rx_ring_clean; + + /*! Rx ring dump */ + rx_ring_dump_f rx_ring_dump; + + /*! Rx suspend */ + rx_suspend_f rx_suspend; + + /*! Rx resume */ + rx_resume_f rx_resume; + + /*! Tx descriptor initialize */ + tx_desc_init_f tx_desc_init; + + /*! Tx descriptor cleanup */ + tx_desc_clean_f tx_desc_clean; + + /*! Tx ring cleanup */ + tx_ring_clean_f tx_ring_clean; + + /*! Tx ring dump */ + tx_ring_dump_f tx_ring_dump; + + /*! Tx transmit */ + pkt_xmit_f pkt_xmit; +}; + +/*! + * \brief HW structure. + */ +struct pdma_hw { + /*! Device number */ + int unit; + + /*! Device structure point */ + struct pdma_dev *dev; + + /*! HW information */ + struct hw_info info; + + /*! HW handlers */ + struct hw_handlers hdls; + + /*! HW operations */ + struct desc_operations dops; +}; + +/*! + * \brief Open device. + * + * \param [in] dev Device structure point. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +bcmcnet_pdma_open(struct pdma_dev *dev); + +/*! + * \brief Coalesce Rx interrupt. + * + * \param [in] dev Device structure point. + * \param [in] queue Rx queue number. + * \param [in] count Interrupt threshhold. + * \param [in] timer Timer value. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +bcmcnet_pdma_rx_queue_int_coalesce(struct pdma_dev *dev, int queue, int count, int timer); + +/*! + * \brief Coalesce Tx interrupt. + * + * \param [in] dev Device structure point. + * \param [in] queue Tx queue number. + * \param [in] count Interrupt threshhold. + * \param [in] timer Timer value. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +bcmcnet_pdma_tx_queue_int_coalesce(struct pdma_dev *dev, int queue, int count, int timer); + +/*! + * \brief Dump Rx queue registers. + * + * \param [in] dev Device structure point. + * \param [in] queue Rx queue number. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +bcmcnet_pdma_rx_queue_reg_dump(struct pdma_dev *dev, int queue); + +/*! + * \brief Dump Tx queue registers. + * + * \param [in] dev Device structure point. + * \param [in] queue Tx queue number. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +bcmcnet_pdma_tx_queue_reg_dump(struct pdma_dev *dev, int queue); + +#endif /* BCMCNET_DEV_H */ + diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/include/bcmcnet/bcmcnet_internal.h b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/include/bcmcnet/bcmcnet_internal.h new file mode 100644 index 000000000000..e4b2051a34bc --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/include/bcmcnet/bcmcnet_internal.h @@ -0,0 +1,305 @@ +/*! \file bcmcnet_internal.h + * + * BCMCNET internal data structure and macro definitions. + * + */ +/* + * $Copyright: Copyright 2018-2020 Broadcom. All rights reserved. + * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * A copy of the GNU General Public License version 2 (GPLv2) can + * be found in the LICENSES folder.$ + */ + +#ifndef BCMCNET_INTERNAL_H +#define BCMCNET_INTERNAL_H + +#include + +/*! CMICD name */ +#define CMICD_DEV_NAME "cmicd" + +/*! CMICX name */ +#define CMICX_DEV_NAME "cmicx" + +/*! + * \brief Allocate descriptor ring buffer. + * + * \param [in] dev Pointer to Packet DMA device. + * \param [in] dma DMA address of ring buffer. + * + * \retval Pointer to DMA buffer or NULL if an error occurred. + */ +typedef void *(*ring_buf_alloc_f)(struct pdma_dev *dev, uint32_t, dma_addr_t *dma); + +/*! + * \brief Free descriptor ring buffer. + * + * \param [in] dev Pointer to Packet DMA device. + * \param [in] size Size of DMA buffer. + * \param [in] mem Pointer to DMA buffer. + * \param [in] dma DMA address of ring buffer. + */ +typedef void (*ring_buf_free_f)(struct pdma_dev *dev, uint32_t size, void *mem, + dma_addr_t dma); + +/*! + * \brief Allocate Rx packet buffer. + * + * \param [in] dev Pointer to Packet DMA device. + * \param [in] rxq Pointer to Rx queue struture. + * \param [in] pbuf Pointer to packet buffer structure. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_MEMORY Allocation failed. + */ +typedef int (*rx_buf_alloc_f)(struct pdma_dev *dev, struct pdma_rx_queue *rxq, + struct pdma_rx_buf *pbuf); + +/*! + * \brief Get Rx packet buffer DMA address. + * + * \param [in] dev Pointer to Packet DMA device. + * \param [in] rxq Pointer to Rx queue struture. + * \param [in] pbuf Pointer to packet buffer structure. + * \param [in] dma DMA address of packet buffer. + */ +typedef void (*rx_buf_dma_f)(struct pdma_dev *dev, struct pdma_rx_queue *rxq, + struct pdma_rx_buf *pbuf, dma_addr_t *dma); + +/*! + * \brief Check Rx packet buffer validity. + * + * \param [in] dev Pointer to Packet DMA device. + * \param [in] rxq Pointer to Rx queue struture. + * \param [in] pbuf Pointer to packet buffer structure. + * + * \retval Ture Buffer is available or FALSE. + */ +typedef int (*rx_buf_avail_f)(struct pdma_dev *dev, struct pdma_rx_queue *rxq, + struct pdma_rx_buf *pbuf); + +/*! + * \brief Get Rx packet buffer. + * + * \param [in] dev Pointer to Packet DMA device. + * \param [in] rxq Pointer to Rx queue struture. + * \param [in] pbuf Pointer to packet buffer structure. + * \param [in] len Packet length. + * + * \retval Pointer to packet header structure or NULL if failed. + */ +typedef struct pkt_hdr *(*rx_buf_get_f)(struct pdma_dev *dev, struct pdma_rx_queue *rxq, + struct pdma_rx_buf *pbuf, int len); + +/*! + * \brief Put Rx packet buffer. + * + * \param [in] dev Pointer to Packet DMA device. + * \param [in] rxq Pointer to Rx queue struture. + * \param [in] pbuf Pointer to packet buffer structure. + * \param [in] len Packet length. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_MEMORY Allocation failed. + */ +typedef int (*rx_buf_put_f)(struct pdma_dev *dev, struct pdma_rx_queue *rxq, + struct pdma_rx_buf *pbuf, int len); + +/*! + * \brief Free Rx packet buffer. + * + * \param [in] dev Pointer to Packet DMA device. + * \param [in] rxq Pointer to Rx queue struture. + * \param [in] pbuf Pointer to packet buffer structure. + */ +typedef void (*rx_buf_free_f)(struct pdma_dev *dev, struct pdma_rx_queue *rxq, + struct pdma_rx_buf *pbuf); + +/*! + * \brief Get Rx packet buffer mode. + * + * \param [in] dev Pointer to Packet DMA device. + * \param [in] rxq Pointer to Rx queue struture. + * + * \retval Buffer mode. + */ +typedef enum buf_mode (*rx_buf_mode_f)(struct pdma_dev *dev, struct pdma_rx_queue *rxq); + +/*! + * \brief Get Tx packet buffer. + * + * \param [in] dev Pointer to Packet DMA device. + * \param [in] txq Pointer to Rx queue struture. + * \param [in] pbuf Pointer to packet buffer structure. + * \param [in] buf Packet buffer. + * + * \retval Pointer to packet header structure or NULL if failed. + */ +typedef struct pkt_hdr *(*tx_buf_get_f)(struct pdma_dev *dev, struct pdma_tx_queue *txq, + struct pdma_tx_buf *pbuf, void *buf); + +/*! + * \brief Get Tx packet buffer DMA address. + * + * \param [in] dev Pointer to Packet DMA device. + * \param [in] txq Pointer to Rx queue struture. + * \param [in] pbuf Pointer to packet buffer structure. + * \param [in] dma DMA address of packet buffer. + */ +typedef void (*tx_buf_dma_f)(struct pdma_dev *dev, struct pdma_tx_queue *txq, + struct pdma_tx_buf *pbuf, dma_addr_t *dma); + +/*! + * \brief Free Tx packet buffer. + * + * \param [in] dev Pointer to Packet DMA device. + * \param [in] txq Pointer to Rx queue struture. + * \param [in] pbuf Pointer to packet buffer structure. + */ +typedef void (*tx_buf_free_f)(struct pdma_dev *dev, struct pdma_tx_queue *txq, + struct pdma_tx_buf *pbuf); + +/*! + * \brief Buffer manager. + */ +struct pdma_buf_mngr { + /*! Allocate descriptor ring buffer */ + ring_buf_alloc_f ring_buf_alloc; + + /*! Free descriptor ring buffer */ + ring_buf_free_f ring_buf_free; + + /*! Allocate Rx packet buffer */ + rx_buf_alloc_f rx_buf_alloc; + + /*! Get Rx packet buffer DMA address */ + rx_buf_dma_f rx_buf_dma; + + /*! Check Rx packet buffer validity */ + rx_buf_avail_f rx_buf_avail; + + /*! Get Rx packet buffer */ + rx_buf_get_f rx_buf_get; + + /*! Put Rx packet buffer */ + rx_buf_put_f rx_buf_put; + + /*! Free Rx packet buffer */ + rx_buf_free_f rx_buf_free; + + /*! Get Rx packet buffer mode */ + rx_buf_mode_f rx_buf_mode; + + /*! Get Tx packet buffer */ + tx_buf_get_f tx_buf_get; + + /*! Get Tx packet buffer DMA address */ + tx_buf_dma_f tx_buf_dma; + + /*! Free Tx packet buffer */ + tx_buf_free_f tx_buf_free; +}; + +/*! + * \brief Wait for the kernel networking subsystem. + * + * \param [in] unit Device number. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_FAIL Operation failed. + */ +typedef int (*bcmcnet_vnet_wait_f)(int unit); + +/*! + * \brief Wake up the kernel networking subsystem. + * + * \param [in] unit Device number. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_FAIL Operation failed. + */ +typedef int (*bcmcnet_hnet_wake_f)(int unit); + +/*! + * \brief Dock to the kernel networking subsystem. + * + * \param [in] unit Device number. + * \param [in] vsync Sync data. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_FAIL Operation failed. + */ +typedef int (*bcmcnet_vnet_dock_f)(int unit, vnet_sync_t *vsync); + +/*! + * \brief Undock from the kernel networking subsystem. + * + * \param [in] unit Device number. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_FAIL Operation failed. + */ +typedef int (*bcmcnet_vnet_undock_f)(int unit); + +/*! + * \brief VNET operations. + */ +typedef struct bcmcnet_vnet_ops_s { + /*! + * VNET wait for HNET. + * VNET calls this to wait for any notification from HNET. + */ + bcmcnet_vnet_wait_f vnet_wait; + + /*! + * VNET wake up HNET. + * VNET calls this to notify HNET that Tx/Rx is ready. + */ + bcmcnet_hnet_wake_f hnet_wake; + + /*! + * VNET dock to HNET. + * This is called to notify HNET that VNET is ready to work and synchronize + * vrings information to HNET. + */ + bcmcnet_vnet_dock_f vnet_dock; + + /*! + * VNET undock from HNET. + * This is called to notify HNET that VNET is ready to leave. + */ + bcmcnet_vnet_undock_f vnet_undock; +} bcmcnet_vnet_ops_t; + +/*! + * \brief Initialize buffer manager. + * + * \param [in] dev Device structure pointer. + */ +extern void +bcmcnet_buf_mngr_init(struct pdma_dev *dev); + +/*! + * \brief Register VNET operations. + * + * \param [in] unit Device number. + * \param [in] vnet_ops VNET operations. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_PARAM Invalid parameters. + */ +extern int +bcmcnet_vnet_ops_register(int unit, bcmcnet_vnet_ops_t *vnet_ops); + +#endif /* BCMCNET_INTERNAL_H */ + diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/include/bcmcnet/bcmcnet_rxtx.h b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/include/bcmcnet/bcmcnet_rxtx.h new file mode 100644 index 000000000000..eb5834d895b0 --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/include/bcmcnet/bcmcnet_rxtx.h @@ -0,0 +1,512 @@ +/*! \file bcmcnet_rxtx.h + * + * Generic data structure and macro definitions for BCMCNET Rx/Tx. + * + */ +/* + * $Copyright: Copyright 2018-2020 Broadcom. All rights reserved. + * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * A copy of the GNU General Public License version 2 (GPLv2) can + * be found in the LICENSES folder.$ + */ + +#ifndef BCMCNET_RXTX_H +#define BCMCNET_RXTX_H + +/*! Default descriptor number in each ring */ +#define NUM_RING_DESC 64 + +/*! Maximum number of packets to be handled in one poll call */ +#define NUM_RXTX_BUDGET 64 + +/*! + * \brief Rx buffer mode definitions. + */ +enum buf_mode { + /*! Private DMA buffer in user space */ + PDMA_BUF_MODE_PRIV, + + /*! SKB in kernel */ + PDMA_BUF_MODE_SKB, + + /*! Paged buffer in kernel */ + PDMA_BUF_MODE_PAGE, + + /*! Kernel buffer mapped to user space */ + PDMA_BUF_MODE_MAPPED, + + /*! MAX mode */ + PDMA_BUF_MODE_MAX +}; + +/*! + * \brief Rx queue statistics. + */ +struct rx_stats { + /*! Number of received packets */ + uint64_t packets; + + /*! Number of received bytes */ + uint64_t bytes; + + /*! Number of dropped packets */ + uint64_t dropped; + + /*! Number of errors */ + uint64_t errors; + + /*! Number of head errors */ + uint64_t head_errors; + + /*! Number of data errors */ + uint64_t data_errors; + + /*! Number of cell errors */ + uint64_t cell_errors; + + /*! Number of failed allocation */ + uint64_t nomems; +}; + +/*! + * Rx queue structure + */ +struct pdma_rx_queue { + /*! Group index to which this queue belongs */ + uint32_t group_id; + + /*! Global channel index */ + uint32_t chan_id; + + /*! Queue index */ + uint32_t queue_id; + + /*! Pointer to the device control structure */ + struct dev_ctrl *ctrl; + + /*! Rx packet buffer pointers */ + struct pdma_rx_buf *pbuf; + + /*! Rx ring address */ + void *ring; + + /*! Rx ring DMA address */ + dma_addr_t ring_addr; + + /*! Rx ring DMA halt address */ + dma_addr_t halt_addr; + + /*! Rx buffer size */ + uint32_t buf_size; + + /*! Total number of descriptors */ + uint32_t nb_desc; + + /*! Next free ring entry */ + uint32_t curr; + + /*! Halt ring entry */ + uint32_t halt; + + /*! Max free descriptors to hold */ + uint32_t free_thresh; + + /*! Rx interrupt coalesce value */ + uint32_t ic_val; + + /*! Rx interrupt coalescing */ + int intr_coalescing; + + /*! Queue statistics */ + struct rx_stats stats; + + /*! Rx queue spin lock */ + sal_spinlock_t lock; + + /*! Queue state */ + int state; + /*! Queue is used */ +#define PDMA_RX_QUEUE_USED (1 << 0) + /*! Queue is setup */ +#define PDMA_RX_QUEUE_SETUP (1 << 1) + /*! Queue is active */ +#define PDMA_RX_QUEUE_ACTIVE (1 << 2) + /*! Queue is busy */ +#define PDMA_RX_QUEUE_BUSY (1 << 3) + /*! Queue is suspended */ +#define PDMA_RX_QUEUE_XOFF (1 << 4) + /*! Queue is batch refilled */ +#define PDMA_RX_BATCH_REFILL (1 << 5) + + /*! DMA buffer mode */ + enum buf_mode mode; +}; + +/*! + * \brief Tx queue statistics. + */ +struct tx_stats { + /*! Number of sent packets */ + uint64_t packets; + + /*! Number of sent bytes */ + uint64_t bytes; + + /*! Number of dropped packets */ + uint64_t dropped; + + /*! Number of errors */ + uint64_t errors; + + /*! Number of suspends */ + uint64_t xoffs; +}; + +/*! + * \brief Tx queue structure. + */ +struct pdma_tx_queue { + /*! Group index to which this queue belongs */ + uint32_t group_id; + + /*! Global channel index */ + uint32_t chan_id; + + /*! Queue index */ + uint32_t queue_id; + + /*! pointer to the device control structure */ + struct dev_ctrl *ctrl; + + /*! Tx packet buffer pointers */ + struct pdma_tx_buf *pbuf; + + /*! Tx ring address */ + void *ring; + + /*! Tx ring DMA address */ + dma_addr_t ring_addr; + + /*! Tx ring DMA halt address */ + dma_addr_t halt_addr; + + /*! Total number of descriptors */ + uint32_t nb_desc; + + /*! Next free ring entry */ + uint32_t curr; + + /*! First entry to be transmitted */ + uint32_t dirt; + + /*! Halt ring entry */ + uint32_t halt; + + /*! Max free descriptors to hold in non-intr mode */ + uint32_t free_thresh; + + /*! Tx interrupt coalesce value */ + uint32_t ic_val; + + /*! Tx interrupt coalescing */ + int intr_coalescing; + + /*! Queue statistics */ + struct tx_stats stats; + + /*! Tx queue spin lock */ + sal_spinlock_t lock; + + /*! Tx mutex spin lock */ + sal_spinlock_t mutex; + + /*! Tx mutex and flow control semaphore */ + sal_sem_t sem; + + /*! Queue state */ + int state; + /*! Queue is used */ +#define PDMA_TX_QUEUE_USED (1 << 0) + /*! Queue is setup */ +#define PDMA_TX_QUEUE_SETUP (1 << 1) + /*! Queue is active */ +#define PDMA_TX_QUEUE_ACTIVE (1 << 2) + /*! Queue is setup */ +#define PDMA_TX_QUEUE_BUSY (1 << 3) + /*! Queue is suspended */ +#define PDMA_TX_QUEUE_XOFF (1 << 4) + /*! Queue is poll mode */ +#define PDMA_TX_QUEUE_POLL (1 << 5) + + /*! DMA buffer mode */ + enum buf_mode mode; +}; + +/*! + * \brief Setup Rx queue. + * + * \param [in] dev Device structure point. + * \param [in] queue Rx queue number. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +bcmcnet_pdma_rx_queue_setup(struct pdma_dev *dev, int queue); + +/*! + * \brief Release Rx queue. + * + * \param [in] dev Device structure point. + * \param [in] queue Rx queue number. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +bcmcnet_pdma_rx_queue_release(struct pdma_dev *dev, int queue); + +/*! + * \brief Restore Rx queue. + * + * \param [in] dev Device structure point. + * \param [in] queue Rx queue number. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +bcmcnet_pdma_rx_queue_restore(struct pdma_dev *dev, int queue); + +/*! + * \brief Setup virtual Rx queue. + * + * \param [in] dev Device structure point. + * \param [in] queue Rx queue number. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +bcmcnet_pdma_rx_vqueue_setup(struct pdma_dev *dev, int queue); + +/*! + * \brief Release virtual Rx queue. + * + * \param [in] dev Device structure point. + * \param [in] queue Rx queue number. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +bcmcnet_pdma_rx_vqueue_release(struct pdma_dev *dev, int queue); + +/*! + * \brief Setup Tx queue. + * + * \param [in] dev Device structure point. + * \param [in] queue Tx queue number. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +bcmcnet_pdma_tx_queue_setup(struct pdma_dev *dev, int queue); + +/*! + * \brief Release Tx queue. + * + * \param [in] dev Device structure point. + * \param [in] queue Tx queue number. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +bcmcnet_pdma_tx_queue_release(struct pdma_dev *dev, int queue); + +/*! + * \brief Restore Tx queue. + * + * \param [in] dev Device structure point. + * \param [in] queue Tx queue number. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +bcmcnet_pdma_tx_queue_restore(struct pdma_dev *dev, int queue); + +/*! + * \brief Setup virtual Tx queue. + * + * \param [in] dev Device structure point. + * \param [in] queue Rx queue number. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +bcmcnet_pdma_tx_vqueue_setup(struct pdma_dev *dev, int queue); + +/*! + * \brief Release virtual Tx queue. + * + * \param [in] dev Device structure point. + * \param [in] queue Rx queue number. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +bcmcnet_pdma_tx_vqueue_release(struct pdma_dev *dev, int queue); + +/*! + * \brief Suspend Rx queue. + * + * \param [in] dev Device structure point. + * \param [in] queue Rx queue number. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +bcmcnet_pdma_rx_queue_suspend(struct pdma_dev *dev, int queue); + +/*! + * \brief Resume Rx queue. + * + * \param [in] dev Device structure point. + * \param [in] queue Rx queue number. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +bcmcnet_pdma_rx_queue_resume(struct pdma_dev *dev, int queue); + +/*! + * \brief Suspend Tx queue. + * + * \param [in] dev Device structure point. + * \param [in] queue Tx queue number. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +bcmcnet_pdma_tx_queue_suspend(struct pdma_dev *dev, int queue); + +/*! + * \brief Resume Tx queue. + * + * \param [in] dev Device structure point. + * \param [in] queue Tx queue number. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +bcmcnet_pdma_tx_queue_resume(struct pdma_dev *dev, int queue); + +/*! + * \brief Wakeup Tx queue. + * + * \param [in] dev Device structure point. + * \param [in] queue Tx queue number. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +bcmcnet_pdma_tx_queue_wakeup(struct pdma_dev *dev, int queue); + +/*! + * \brief Start Tx queue transmission. + * + * \param [in] dev Device structure point. + * \param [in] queue Tx queue number. + * \param [in] buf Tx packet buffer. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +bcmcnet_pdma_tx_queue_xmit(struct pdma_dev *dev, int queue, void *buf); + +/*! + * \brief Poll Rx queue. + * + * \param [in] dev Device structure point. + * \param [in] queue Rx queue number. + * \param [in] budget Poll budget. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +bcmcnet_pdma_rx_queue_poll(struct pdma_dev *dev, int queue, int budget); + +/*! + * \brief Poll Tx queue. + * + * \param [in] dev Device structure point. + * \param [in] queue Tx queue number. + * \param [in] budget Poll budget. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +bcmcnet_pdma_tx_queue_poll(struct pdma_dev *dev, int queue, int budget); + +/*! + * \brief Poll queue group. + * + * \param [in] dev Device structure point. + * \param [in] group Group number. + * \param [in] budget Poll budget. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +bcmcnet_pdma_group_poll(struct pdma_dev *dev, int group, int budget); + +/*! + * \brief Dump Rx ring. + * + * \param [in] dev Device structure point. + * \param [in] queue Rx queue number. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +bcmcnet_pdma_rx_ring_dump(struct pdma_dev *dev, int queue); + +/*! + * \brief Dump Tx ring. + * + * \param [in] dev Device structure point. + * \param [in] queue Tx queue number. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +bcmcnet_pdma_tx_ring_dump(struct pdma_dev *dev, int queue); + +#endif /* BCMCNET_RXTX_H */ + diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/include/bcmcnet/bcmcnet_types.h b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/include/bcmcnet/bcmcnet_types.h new file mode 100644 index 000000000000..42bd9240828b --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/include/bcmcnet/bcmcnet_types.h @@ -0,0 +1,263 @@ +/*! \file bcmcnet_types.h + * + * BCMCNET public data structure and macro definitions. + * + */ +/* + * $Copyright: Copyright 2018-2020 Broadcom. All rights reserved. + * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * A copy of the GNU General Public License version 2 (GPLv2) can + * be found in the LICENSES folder.$ + */ + +#ifndef BCMCNET_TYPES_H +#define BCMCNET_TYPES_H + +#include + +/*! Maximum length of device name */ +#define DEV_NAME_LEN_MAX 16 + +/*! Maximum number of groups supported each device */ +#define NUM_GRP_MAX 4 + +/*! Maximum number of queues supported each group */ +#define NUM_Q_PER_GRP 8 + +/*! Maximum number of queues supported each device */ +#define NUM_QUE_MAX (NUM_GRP_MAX * NUM_Q_PER_GRP) + +/*! Maximum length of jumbo frame */ +#define JUMBO_FRAME_LEN_MAX 0xffff + +/*! Maximum Rx buffer size */ +#define RX_BUF_SIZE_MAX JUMBO_FRAME_LEN_MAX + +/*! Minimum Rx buffer size */ +#define RX_BUF_SIZE_MIN 68 + +/*! Default Rx buffer size */ +#define RX_BUF_SIZE_DFLT 9216 + +/*! + * \brief Transmission direction. + */ +enum pdma_dir { + PDMA_Q_RX = 0, + PDMA_Q_TX +}; + +/*! + * \brief Device information. + */ +typedef struct bcmcnet_dev_info { + /*! Device name */ + char dev_name[DEV_NAME_LEN_MAX]; + + /*! Device ID */ + uint32_t dev_id; + + /*! Device type */ + uint32_t dev_type; + + /*! Maximum number of groups */ + uint32_t max_groups; + + /*! Maximum number of queues */ + uint32_t max_queues; + + /*! Bitmap of groups at work */ + uint32_t bm_groups; + + /*! Bitmap of Rx queues at work */ + uint32_t bm_rx_queues; + + /*! Bitmap of Tx queues at work */ + uint32_t bm_tx_queues; + + /*! Number of groups at work */ + uint32_t nb_groups; + + /*! Number of Rx queues at work */ + uint32_t nb_rx_queues; + + /*! Number of Tx queues at work */ + uint32_t nb_tx_queues; + + /*! Rx descriptor size */ + uint32_t rx_desc_size; + + /*! Tx descriptor size */ + uint32_t tx_desc_size; + + /*! Rx packet header size */ + uint32_t rx_ph_size; + + /*! Tx packet header size */ + uint32_t tx_ph_size; + + /*! Rx buffer size */ + uint32_t rx_buf_dflt; + + /*! Number of descriptors for a queue */ + uint32_t nb_desc_dflt; + + /*! Rx buffer size per queue */ + uint32_t rx_buf_size[NUM_QUE_MAX]; + + /*! Number of Rx descriptors per queue */ + uint32_t nb_rx_desc[NUM_QUE_MAX]; + + /*! Number of Tx descriptors per queue */ + uint32_t nb_tx_desc[NUM_QUE_MAX]; +} bcmcnet_dev_info_t; + +/*! + * \brief Device statistics. + */ +typedef struct bcmcnet_dev_stats { + /*! Number of successfully received packets */ + uint64_t rx_packets; + + /*! Number of successfully received bytes */ + uint64_t rx_bytes; + + /*! Number of dropped packets */ + uint64_t rx_dropped; + + /*! Number of erroneous received packets */ + uint64_t rx_errors; + + /*! Number of error head packets */ + uint64_t rx_head_errors; + + /*! Number of error data packets */ + uint64_t rx_data_errors; + + /*! Number of error cell packets */ + uint64_t rx_cell_errors; + + /*! Number of RX pktbuf allocation failures */ + uint64_t rx_nomems; + + /*! Number of successfully transmitted packets */ + uint64_t tx_packets; + + /*! Number of successfully transmitted bytes */ + uint64_t tx_bytes; + + /*! Number of dropped packets */ + uint64_t tx_dropped; + + /*! Number of failed transmitted packets */ + uint64_t tx_errors; + + /*! Number of suspended transmission */ + uint64_t tx_xoffs; + + /*! Number of interrupts */ + uint64_t intrs; + + /*! Number of successfully received packets per queue */ + uint64_t rxq_packets[NUM_QUE_MAX]; + + /*! Number of successfully received bytes per queue */ + uint64_t rxq_bytes[NUM_QUE_MAX]; + + /*! Number of dropped packets per queue */ + uint64_t rxq_dropped[NUM_QUE_MAX]; + + /*! Number of erroneous received packets per queue */ + uint64_t rxq_errors[NUM_QUE_MAX]; + + /*! Number of error head packets per queue */ + uint64_t rxq_head_errors[NUM_QUE_MAX]; + + /*! Number of error data packets per queue */ + uint64_t rxq_data_errors[NUM_QUE_MAX]; + + /*! Number of error cell packets per queue */ + uint64_t rxq_cell_errors[NUM_QUE_MAX]; + + /*! Number of RX pktbuf allocation failures per queue */ + uint64_t rxq_nomems[NUM_QUE_MAX]; + + /*! Number of successfully transmitted bytes per queue */ + uint64_t txq_packets[NUM_QUE_MAX]; + + /*! Number of successfully transmitted bytes per queue */ + uint64_t txq_bytes[NUM_QUE_MAX]; + + /*! Number of dropped packets per queue */ + uint64_t txq_dropped[NUM_QUE_MAX]; + + /*! Number of failed transmitted packets per queue */ + uint64_t txq_errors[NUM_QUE_MAX]; + + /*! Number of suspended transmission per queue */ + uint64_t txq_xoffs[NUM_QUE_MAX]; +} bcmcnet_dev_stats_t; + +/*! + * \brief Device modes. + */ +typedef enum dev_mode_e { + /*! + * User network mode. + * The standalone CNET works in user space. + */ + DEV_MODE_UNET = 0, + + /*! + * Kernel network mode. + * Combined with KNET module, CNET works in kernel space. + */ + DEV_MODE_KNET, + + /*! + * Virtual network mode. + * CNET works in user space as a virtual network. + * The hypervisor must be deployed in KNET module. + */ + DEV_MODE_VNET, + + /*! + * Hyper network mode. + * Combined with KNET module, CNET works in kernel space as a hypervisor. + * The virtual network is not neccessary in this mode. + */ + DEV_MODE_HNET, + + /*! Maximum number of mode */ + DEV_MODE_MAX +} dev_mode_t; + +/*! + * \brief VNET sync data. + */ +typedef struct vnet_sync_s { + /*! Rx ring address */ + uint64_t rx_ring_addr[NUM_QUE_MAX]; + + /*! Rx ring size */ + uint32_t rx_ring_size[NUM_QUE_MAX]; + + /*! Tx ring address */ + uint64_t tx_ring_addr[NUM_QUE_MAX]; + + /*! Tx ring size */ + uint32_t tx_ring_size[NUM_QUE_MAX]; +} vnet_sync_t; + +#endif /* BCMCNET_TYPES_H */ + diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/main/bcmcnet_core.c b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/main/bcmcnet_core.c new file mode 100644 index 000000000000..ef4aca7da49e --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/main/bcmcnet_core.c @@ -0,0 +1,701 @@ +/*! \file bcmcnet_core.c + * + * Utility routines for BCMCNET driver. + * + */ +/* + * $Copyright: Copyright 2018-2020 Broadcom. All rights reserved. + * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * A copy of the GNU General Public License version 2 (GPLv2) can + * be found in the LICENSES folder.$ + */ + +#include +#include + +/*! + * Initialize a device + */ +int +bcmcnet_pdma_dev_init(struct pdma_dev *dev) +{ + int rv; + + /* Open the device */ + rv = bcmcnet_pdma_open(dev); + if (SHR_FAILURE(rv)) { + return rv; + } + + dev->attached = 1; + + return SHR_E_NONE; +} + +/*! + * Clean up a device + */ +int +bcmcnet_pdma_dev_cleanup(struct pdma_dev *dev) +{ + if (!dev->attached) { + return SHR_E_NONE; + } + + dev->ops->dev_close(dev); + dev->ops = NULL; + + dev->attached = 0; + + return SHR_E_NONE; +} + +/*! + * Start a device + */ +int +bcmcnet_pdma_dev_start(struct pdma_dev *dev) +{ + struct dev_ctrl *ctrl = &dev->ctrl; + uint32_t qi; + int rv; + + if (!dev->attached) { + return SHR_E_UNAVAIL; + } + + if (dev->started) { + return SHR_E_NONE; + } + + rv = dev->ops->dev_config(dev, ctrl->bm_rxq, ctrl->bm_txq); + if (SHR_FAILURE(rv)) { + return rv; + } + + /* Start all the Rx queues */ + for (qi = 0; qi < ctrl->nb_rxq; qi++) { + rv = dev->ops->rx_queue_setup(dev, qi); + if (SHR_FAILURE(rv)) { + return rv; + } + dev->ops->rx_queue_intr_enable(dev, qi); + dev->ops->rx_queue_start(dev, qi); + } + + /* Start all the Tx queues */ + for (qi = 0; qi < ctrl->nb_txq; qi++) { + dev->ops->tx_queue_setup(dev, qi); + dev->ops->tx_queue_intr_enable(dev, qi); + dev->ops->tx_queue_start(dev, qi); + dev->ops->tx_queue_wakeup(dev, qi); + } + + bcmcnet_pdma_dev_info_get(dev); + + dev->started = 1; + + return SHR_E_NONE; +} + +/*! + * Stop a device + */ +int +bcmcnet_pdma_dev_stop(struct pdma_dev *dev) +{ + struct dev_ctrl *ctrl = &dev->ctrl; + uint32_t qi; + + if (!dev->attached) { + return SHR_E_UNAVAIL; + } + + if (!dev->started) { + return SHR_E_NONE; + } + + /* Stop all the Rx queues */ + for (qi = 0; qi < ctrl->nb_rxq; qi++) { + dev->ops->rx_queue_intr_disable(dev, qi); + dev->ops->rx_queue_stop(dev, qi); + dev->ops->rx_queue_release(dev, qi); + } + + /* Stop all the Tx queues */ + for (qi = 0; qi < ctrl->nb_txq; qi++) { + dev->ops->tx_queue_intr_disable(dev, qi); + dev->ops->tx_queue_stop(dev, qi); + dev->ops->tx_queue_wakeup(dev, qi); + dev->ops->tx_queue_release(dev, qi); + } + + dev->started = 0; + + return SHR_E_NONE; +} + +/*! + * Suspend a device + */ +int +bcmcnet_pdma_dev_suspend(struct pdma_dev *dev) +{ + if (!dev->attached) { + return SHR_E_UNAVAIL; + } + + return dev->ops->dev_suspend(dev); +} + +/*! + * Resume a device + */ +int +bcmcnet_pdma_dev_resume(struct pdma_dev *dev) +{ + if (!dev->attached) { + return SHR_E_UNAVAIL; + } + + return dev->ops->dev_resume(dev); +} + +/*! + * Suspend Rx + */ +int +bcmcnet_pdma_dev_rx_suspend(struct pdma_dev *dev) +{ + struct dev_ctrl *ctrl = &dev->ctrl; + uint32_t qi; + + if (!dev->attached) { + return SHR_E_UNAVAIL; + } + + /* Suspend all the Rx queues */ + for (qi = 0; qi < ctrl->nb_rxq; qi++) { + dev->ops->rx_queue_suspend(dev, qi); + } + + return SHR_E_NONE; +} + +/*! + * Resume Rx + */ +int +bcmcnet_pdma_dev_rx_resume(struct pdma_dev *dev) +{ + struct dev_ctrl *ctrl = &dev->ctrl; + uint32_t qi; + + if (!dev->attached) { + return SHR_E_UNAVAIL; + } + + /* Resume all the Rx queues */ + for (qi = 0; qi < ctrl->nb_rxq; qi++) { + dev->ops->rx_queue_resume(dev, qi); + } + + return SHR_E_NONE; +} + +/*! + * Dock to HNET + */ +int +bcmcnet_pdma_dev_dock(struct pdma_dev *dev) +{ + struct dev_ctrl *ctrl = &dev->ctrl; + uint32_t qi; + int rv; + + if (!dev->attached) { + return SHR_E_UNAVAIL; + } + + /* Set up all the virtual Rx queues */ + for (qi = 0; qi < ctrl->nb_rxq; qi++) { + rv = dev->ops->rx_vqueue_setup(dev, qi); + if (SHR_FAILURE(rv)) { + return rv; + } + } + + /* Set up all the virtual Tx queues */ + for (qi = 0; qi < ctrl->nb_txq; qi++) { + rv = dev->ops->tx_vqueue_setup(dev, qi); + if (SHR_FAILURE(rv)) { + return rv; + } + } + + return SHR_E_NONE; +} + +/*! + * Undock from HNET + */ +int +bcmcnet_pdma_dev_undock(struct pdma_dev *dev) +{ + struct dev_ctrl *ctrl = &dev->ctrl; + uint32_t qi; + + if (!dev->attached) { + return SHR_E_UNAVAIL; + } + + /* Release all the virtual Rx queues */ + for (qi = 0; qi < ctrl->nb_rxq; qi++) { + dev->ops->rx_vqueue_release(dev, qi); + } + + /* Release all the virtual Tx queues */ + for (qi = 0; qi < ctrl->nb_txq; qi++) { + dev->ops->tx_vqueue_release(dev, qi); + } + + return SHR_E_NONE; +} + +/*! + * Get device information + */ +int +bcmcnet_pdma_dev_info_get(struct pdma_dev *dev) +{ + if (!dev->ops || !dev->ops->dev_info_get) { + return SHR_E_INTERNAL; + } + + dev->ops->dev_info_get(dev); + + return SHR_E_NONE; +} + +/*! + * Get device statistics + */ +int +bcmcnet_pdma_dev_stats_get(struct pdma_dev *dev) +{ + if (!dev->ops || !dev->ops->dev_stats_get) { + return SHR_E_INTERNAL; + } + + dev->ops->dev_stats_get(dev); + + return SHR_E_NONE; +} + +/*! + * Reset device statistics + */ +int +bcmcnet_pdma_dev_stats_reset(struct pdma_dev *dev) +{ + if (!dev->ops || !dev->ops->dev_stats_reset) { + return SHR_E_INTERNAL; + } + + dev->ops->dev_stats_reset(dev); + + return SHR_E_NONE; +} + +/*! + * Convert a queue index to channel index + */ +int +bcmcnet_pdma_dev_queue_to_chan(struct pdma_dev *dev, int queue, int dir, int *chan) +{ + struct dev_ctrl *ctrl = &dev->ctrl; + + if (dir == PDMA_Q_RX) { + if ((uint32_t)queue >= ctrl->nb_rxq || chan == NULL) { + return SHR_E_PARAM; + } + } else { + if ((uint32_t)queue >= ctrl->nb_txq || chan == NULL) { + return SHR_E_PARAM; + } + } + + if (!dev->ops || !dev->ops->dev_lq_to_pq) { + return SHR_E_INTERNAL; + } + + return dev->ops->dev_lq_to_pq(dev, queue, dir, chan); +} + +/*! + * Convert a channel index to queue index + */ +int +bcmcnet_pdma_dev_chan_to_queue(struct pdma_dev *dev, int chan, int *queue, int *dir) +{ + if (chan < 0 || chan >= dev->num_queues || queue == NULL || dir == NULL) { + return SHR_E_PARAM; + } + + if (!dev->ops || !dev->ops->dev_pq_to_lq) { + return SHR_E_INTERNAL; + } + + return dev->ops->dev_pq_to_lq(dev, chan, queue, dir); +} + +/*! + * Enable interrupt for a Rx queue + */ +int +bcmcnet_rx_queue_intr_enable(struct pdma_dev *dev, int queue) +{ + if (!dev->ops || !dev->ops->rx_queue_intr_enable) { + return SHR_E_INTERNAL; + } + + return dev->ops->rx_queue_intr_enable(dev, queue); +} + +/*! + * Disable interrupt for a Rx queue + */ +int +bcmcnet_rx_queue_intr_disable(struct pdma_dev *dev, int queue) +{ + if (!dev->ops || !dev->ops->rx_queue_intr_disable) { + return SHR_E_INTERNAL; + } + + return dev->ops->rx_queue_intr_disable(dev, queue); +} + +/*! + * Acknowledge interrupt for a Rx queue + */ +int +bcmcnet_rx_queue_intr_ack(struct pdma_dev *dev, int queue) +{ + if (!dev->ops || !dev->ops->rx_queue_intr_ack) { + return SHR_E_INTERNAL; + } + + return dev->ops->rx_queue_intr_ack(dev, queue); +} + +/*! + * Check interrupt for a Rx queue + */ +int +bcmcnet_rx_queue_intr_check(struct pdma_dev *dev, int queue) +{ + if (!dev->ops || !dev->ops->rx_queue_intr_check) { + return SHR_E_INTERNAL; + } + + return dev->ops->rx_queue_intr_check(dev, queue); +} + +/*! + * Enable interrupt for a Tx queue + */ +int +bcmcnet_tx_queue_intr_enable(struct pdma_dev *dev, int queue) +{ + if (!dev->ops || !dev->ops->tx_queue_intr_enable) { + return SHR_E_INTERNAL; + } + + return dev->ops->tx_queue_intr_enable(dev, queue); +} + +/*! + * Disable interrupt for a Tx queue + */ +int +bcmcnet_tx_queue_intr_disable(struct pdma_dev *dev, int queue) +{ + if (!dev->ops || !dev->ops->tx_queue_intr_disable) { + return SHR_E_INTERNAL; + } + + return dev->ops->tx_queue_intr_disable(dev, queue); +} + +/*! + * Acknowledge interrupt for a Tx queue + */ +int +bcmcnet_tx_queue_intr_ack(struct pdma_dev *dev, int queue) +{ + if (!dev->ops || !dev->ops->tx_queue_intr_ack) { + return SHR_E_INTERNAL; + } + + return dev->ops->tx_queue_intr_ack(dev, queue); +} + +/*! + * Check interrupt for a Tx queue + */ +int +bcmcnet_tx_queue_intr_check(struct pdma_dev *dev, int queue) +{ + if (!dev->ops || !dev->ops->tx_queue_intr_check) { + return SHR_E_INTERNAL; + } + + return dev->ops->tx_queue_intr_check(dev, queue); +} + +/*! + * Enable interrupt for a queue + */ +int +bcmcnet_queue_intr_enable(struct pdma_dev *dev, struct intr_handle *hdl) +{ + if (hdl->dir == PDMA_Q_RX) { + return bcmcnet_rx_queue_intr_enable(dev, hdl->queue); + } else { + return bcmcnet_tx_queue_intr_enable(dev, hdl->queue); + } +} + +/*! + * Disable interrupt for a queue + */ +int +bcmcnet_queue_intr_disable(struct pdma_dev *dev, struct intr_handle *hdl) +{ + if (hdl->dir == PDMA_Q_RX) { + return bcmcnet_rx_queue_intr_disable(dev, hdl->queue); + } else { + return bcmcnet_tx_queue_intr_disable(dev, hdl->queue); + } +} + +/*! + * Acknowledge interrupt for a queue + */ +int +bcmcnet_queue_intr_ack(struct pdma_dev *dev, struct intr_handle *hdl) +{ + if (hdl->dir == PDMA_Q_RX) { + return bcmcnet_rx_queue_intr_ack(dev, hdl->queue); + } else { + return bcmcnet_tx_queue_intr_ack(dev, hdl->queue); + } +} + +/*! + * Check interrupt for a queue + */ +int +bcmcnet_queue_intr_check(struct pdma_dev *dev, struct intr_handle *hdl) +{ + if (hdl->dir == PDMA_Q_RX) { + return bcmcnet_rx_queue_intr_check(dev, hdl->queue); + } else { + return bcmcnet_tx_queue_intr_check(dev, hdl->queue); + } +} + +/*! + * Enable interrupt for a queue group + */ +int +bcmcnet_group_intr_enable(struct pdma_dev *dev, int group) +{ + struct dev_ctrl *ctrl = &dev->ctrl; + struct queue_group *grp = &ctrl->grp[group]; + int queue, dir; + int i; + + if (!dev->ops) { + return SHR_E_INTERNAL; + } + + for (i = 0; i < dev->grp_queues; i++) { + if (1 << i & grp->bm_rxq) { + dev->ops->dev_pq_to_lq(dev, i + group * dev->grp_queues, &queue, &dir); + dev->ops->rx_queue_intr_enable(dev, queue); + } + } + + for (i = 0; i < dev->grp_queues; i++) { + if (1 << i & grp->bm_txq) { + dev->ops->dev_pq_to_lq(dev, i + group * dev->grp_queues, &queue, &dir); + dev->ops->tx_queue_intr_enable(dev, queue); + } + } + + return SHR_E_NONE; +} + +/*! + * Disable interrupt for a queue group + */ +int +bcmcnet_group_intr_disable(struct pdma_dev *dev, int group) +{ + struct dev_ctrl *ctrl = &dev->ctrl; + struct queue_group *grp = &ctrl->grp[group]; + int queue, dir; + int i; + + if (!dev->ops) { + return SHR_E_INTERNAL; + } + + for (i = 0; i < dev->grp_queues; i++) { + if (1 << i & grp->bm_rxq) { + dev->ops->dev_pq_to_lq(dev, i + group * dev->grp_queues, &queue, &dir); + dev->ops->rx_queue_intr_disable(dev, queue); + } + } + + for (i = 0; i < dev->grp_queues; i++) { + if (1 << i & grp->bm_txq) { + dev->ops->dev_pq_to_lq(dev, i + group * dev->grp_queues, &queue, &dir); + dev->ops->tx_queue_intr_disable(dev, queue); + } + } + + return SHR_E_NONE; +} + +/*! + * Acknowledge interrupt for a queue group + */ +int +bcmcnet_group_intr_ack(struct pdma_dev *dev, int group) +{ + struct dev_ctrl *ctrl = &dev->ctrl; + struct queue_group *grp = &ctrl->grp[group]; + int queue, dir; + int i; + + if (!dev->ops) { + return SHR_E_INTERNAL; + } + + for (i = 0; i < dev->grp_queues; i++) { + if (1 << i & grp->bm_rxq) { + dev->ops->dev_pq_to_lq(dev, i + group * dev->grp_queues, &queue, &dir); + dev->ops->rx_queue_intr_ack(dev, queue); + } + } + + for (i = 0; i < dev->grp_queues; i++) { + if (1 << i & grp->bm_txq) { + dev->ops->dev_pq_to_lq(dev, i + group * dev->grp_queues, &queue, &dir); + dev->ops->tx_queue_intr_ack(dev, queue); + } + } + + return SHR_E_NONE; +} + +/*! + * Check interrupt for a queue group + */ +int +bcmcnet_group_intr_check(struct pdma_dev *dev, int group) +{ + struct dev_ctrl *ctrl = &dev->ctrl; + struct queue_group *grp = &ctrl->grp[group]; + int queue, dir; + int i; + + if (!dev->ops) { + return SHR_E_INTERNAL; + } + + for (i = 0; i < dev->grp_queues; i++) { + if (1 << i & grp->bm_rxq) { + dev->ops->dev_pq_to_lq(dev, i + group * dev->grp_queues, &queue, &dir); + if (dev->ops->rx_queue_intr_check(dev, queue)) { + return TRUE; + } + } + } + + for (i = 0; i < dev->grp_queues; i++) { + if (1 << i & grp->bm_txq) { + dev->ops->dev_pq_to_lq(dev, i + group * dev->grp_queues, &queue, &dir); + if (dev->ops->tx_queue_intr_check(dev, queue)) { + return TRUE; + } + } + } + + return FALSE; +} + +/*! + * Poll a Rx queue + */ +int +bcmcnet_rx_queue_poll(struct pdma_dev *dev, int queue, int budget) +{ + if (!dev->ops || !dev->ops->rx_queue_poll) { + return SHR_E_INTERNAL; + } + + return dev->ops->rx_queue_poll(dev, queue, budget); +} + +/*! + * Poll a Tx queue + */ +int +bcmcnet_tx_queue_poll(struct pdma_dev *dev, int queue, int budget) +{ + if (!dev->ops || !dev->ops->tx_queue_poll) { + return SHR_E_INTERNAL; + } + + return dev->ops->tx_queue_poll(dev, queue, budget); +} + +/*! + * Poll a queue + */ +int +bcmcnet_queue_poll(struct pdma_dev *dev, struct intr_handle *hdl, int budget) +{ + if (hdl->dir == PDMA_Q_RX) { + return bcmcnet_rx_queue_poll(dev, hdl->queue, budget); + } else { + return bcmcnet_tx_queue_poll(dev, hdl->queue, budget); + } +} + +/*! + * Poll a queue group + */ +int +bcmcnet_group_poll(struct pdma_dev *dev, int group, int budget) +{ + if (!dev->ops || !dev->ops->group_poll) { + return SHR_E_INTERNAL; + } + + return dev->ops->group_poll(dev, group, budget); +} + diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/main/bcmcnet_dev.c b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/main/bcmcnet_dev.c new file mode 100644 index 000000000000..1f39515a7a62 --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/main/bcmcnet_dev.c @@ -0,0 +1,1059 @@ +/*! \file bcmcnet_dev.c + * + * Utility routines for BCMCNET device. + * + */ +/* + * $Copyright: Copyright 2018-2020 Broadcom. All rights reserved. + * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * A copy of the GNU General Public License version 2 (GPLv2) can + * be found in the LICENSES folder.$ + */ + +#include +#include +#include +#include + +/*! + * Free resource for a Rx queue + */ +static void +bcn_rx_queues_free(struct pdma_dev *dev) +{ + struct dev_ctrl *ctrl = &dev->ctrl; + struct pdma_rx_queue *rxq = NULL; + int gi, qi; + + for (gi = 0; gi < dev->num_groups; gi++) { + for (qi = 0; qi < dev->grp_queues; qi++) { + rxq = (struct pdma_rx_queue *)ctrl->grp[gi].rx_queue[qi]; + if (!rxq) { + continue; + } + sal_free(rxq); + ctrl->grp[gi].rx_queue[qi] = NULL; + if (dev->mode == DEV_MODE_HNET && ctrl->grp[gi].vnet_rxq[qi]) { + sal_free(ctrl->grp[gi].vnet_rxq[qi]); + ctrl->grp[gi].vnet_rxq[qi] = NULL; + } + } + } +} + +/*! + * Allocate resource for a Rx queue + */ +static int +bcn_rx_queues_alloc(struct pdma_dev *dev) +{ + struct dev_ctrl *ctrl = &dev->ctrl; + struct pdma_rx_queue *rxq = NULL, *vrxq = NULL; + int gi, qi; + + for (gi = 0; gi < dev->num_groups; gi++) { + for (qi = 0; qi < dev->grp_queues; qi++) { + rxq = sal_alloc(sizeof(*rxq), "bcmcnetRxQueue"); + if (!rxq) { + goto error; + } + sal_memset(rxq, 0, sizeof(*rxq)); + rxq->group_id = gi; + rxq->chan_id = qi + gi * dev->grp_queues; + rxq->ctrl = ctrl; + ctrl->grp[gi].rx_queue[qi] = rxq; + if (dev->mode == DEV_MODE_HNET) { + vrxq = sal_alloc(sizeof(*vrxq), "bcmcnetVnetRxQueue"); + if (!vrxq) { + goto error; + } + sal_memset(vrxq, 0, sizeof(*vrxq)); + vrxq->group_id = gi; + vrxq->chan_id = qi + gi * dev->grp_queues; + vrxq->ctrl = ctrl; + ctrl->grp[gi].vnet_rxq[qi] = vrxq; + } + } + } + + return SHR_E_NONE; + +error: + bcn_rx_queues_free(dev); + + return SHR_E_MEMORY; +} + +/*! + * Free resource for a Tx queue + */ +static void +bcn_tx_queues_free(struct pdma_dev *dev) +{ + struct dev_ctrl *ctrl = &dev->ctrl; + struct pdma_tx_queue *txq = NULL; + int gi, qi; + + for (gi = 0; gi < dev->num_groups; gi++) { + for (qi = 0; qi < dev->grp_queues; qi++) { + txq = (struct pdma_tx_queue *)ctrl->grp[gi].tx_queue[qi]; + if (!txq) { + continue; + } + sal_free(txq); + ctrl->grp[gi].tx_queue[qi] = NULL; + if (dev->mode == DEV_MODE_HNET && ctrl->grp[gi].vnet_txq[qi]) { + sal_free(ctrl->grp[gi].vnet_txq[qi]); + ctrl->grp[gi].vnet_txq[qi] = NULL; + } + } + } +} + +/*! + * Allocate resource for a Tx queue + */ +static int +bcn_tx_queues_alloc(struct pdma_dev *dev) +{ + struct dev_ctrl *ctrl = &dev->ctrl; + struct pdma_tx_queue *txq = NULL, *vtxq = NULL; + int gi, qi; + + for (gi = 0; gi < dev->num_groups; gi++) { + for (qi = 0; qi < dev->grp_queues; qi++) { + txq = sal_alloc(sizeof(*txq), "bcmcnetTxQueue"); + if (!txq) { + goto error; + } + sal_memset(txq, 0, sizeof(*txq)); + txq->group_id = gi; + txq->chan_id = qi + gi * dev->grp_queues; + txq->ctrl = ctrl; + ctrl->grp[gi].tx_queue[qi] = txq; + if (dev->mode == DEV_MODE_HNET) { + vtxq = sal_alloc(sizeof(*vtxq), "bcmcnetVnetTxQueue"); + if (!vtxq) { + goto error; + } + sal_memset(vtxq, 0, sizeof(*vtxq)); + vtxq->group_id = gi; + vtxq->chan_id = qi + gi * dev->grp_queues; + vtxq->ctrl = ctrl; + ctrl->grp[gi].vnet_txq[qi] = vtxq; + } + } + } + + return SHR_E_NONE; + +error: + bcn_tx_queues_free(dev); + + return SHR_E_MEMORY; +} + +/*! + * \brief Parse Rx groups + * + * \param [in] dev Device structure point. + * \param [in] qbm Rx queue bitmap. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +static int +bcn_rx_queue_group_parse(struct pdma_dev *dev, uint32_t qbm) +{ + struct dev_ctrl *ctrl = &dev->ctrl; + struct pdma_buf_mngr *bm = (struct pdma_buf_mngr *)ctrl->buf_mngr; + struct pdma_rx_queue *rxq = NULL; + struct intr_handle *hdl = NULL; + uint32_t mask; + int gi, qi, qn; + + ctrl->nb_rxq = 0; + sal_memset(ctrl->rx_queue, 0, sizeof(ctrl->rx_queue)); + + /* Figure out available groups and Rx queues */ + for (gi = 0; gi < dev->num_groups; gi++) { + if (!ctrl->grp[gi].attached) { + continue; + } + qn = 0; + mask = 0; + for (qi = 0; qi < dev->grp_queues; qi++) { + rxq = (struct pdma_rx_queue *)ctrl->grp[gi].rx_queue[qi]; + hdl = &ctrl->grp[gi].intr_hdl[qi]; + if (1 << (qi + gi * dev->grp_queues) & qbm) { + /* Set the number of descriptors */ + rxq->nb_desc = ctrl->grp[gi].nb_desc[qi]; + if (!rxq->nb_desc) { + rxq->nb_desc = ctrl->nb_desc; + ctrl->grp[gi].nb_desc[qi] = rxq->nb_desc; + } + /* Set Rx buffer size */ + rxq->buf_size = ctrl->grp[gi].rx_size[qi]; + if (rxq->buf_size < RX_BUF_SIZE_MIN) { + rxq->buf_size = RX_BUF_SIZE_MIN; + ctrl->grp[gi].rx_size[qi] = rxq->buf_size; + } else if (rxq->buf_size > RX_BUF_SIZE_MAX) { + rxq->buf_size = ctrl->rx_buf_size; + ctrl->grp[gi].rx_size[qi] = rxq->buf_size; + } + rxq->buf_size += dev->rx_ph_size; + /* Set mode and state for the queue */ + rxq->mode = bm->rx_buf_mode(dev, rxq); + rxq->state = PDMA_RX_QUEUE_USED; + if (dev->flags & PDMA_RX_BATCHING) { + rxq->free_thresh = rxq->nb_desc / 4; + rxq->state |= PDMA_RX_BATCH_REFILL; + } + /* Update queue index */ + rxq->queue_id = ctrl->nb_rxq; + ctrl->rx_queue[rxq->queue_id] = rxq; + ctrl->nb_rxq++; + qn++; + mask |= 1 << qi; + /* Set up handler for the queue */ + hdl->queue = rxq->queue_id; + hdl->dir = PDMA_Q_RX; + hdl->budget = ctrl->budget < rxq->nb_desc ? + ctrl->budget : rxq->nb_desc; + if (dev->mode == DEV_MODE_HNET) { + ctrl->vnet_rxq[rxq->queue_id] = ctrl->grp[gi].vnet_rxq[qi]; + } + } else { + rxq->state = 0; + } + } + + /* Set group metadata */ + if (qn) { + ctrl->grp[gi].bm_rxq = mask; + ctrl->grp[gi].nb_rxq = qn; + } else { + ctrl->grp[gi].bm_rxq = 0; + ctrl->grp[gi].nb_rxq = 0; + } + } + + return SHR_E_NONE; +} + +/*! + * \brief Parse Tx groups + * + * \param [in] dev Device structure point. + * \param [in] qbm Tx queue bitmap. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +static int +bcn_tx_queue_group_parse(struct pdma_dev *dev, uint32_t qbm) +{ + struct dev_ctrl *ctrl = &dev->ctrl; + struct pdma_tx_queue *txq = NULL; + struct intr_handle *hdl = NULL; + uint32_t mask; + int gi, qi, qn; + + ctrl->nb_txq = 0; + sal_memset(ctrl->tx_queue, 0, sizeof(ctrl->tx_queue)); + + /* Figure out available groups and Tx queues */ + for (gi = 0; gi < dev->num_groups; gi++) { + if (!ctrl->grp[gi].attached) { + continue; + } + qn = 0; + mask = 0; + for (qi = 0; qi < dev->grp_queues; qi++) { + txq = (struct pdma_tx_queue *)ctrl->grp[gi].tx_queue[qi]; + hdl = &ctrl->grp[gi].intr_hdl[qi]; + if (1 << (qi + gi * dev->grp_queues) & qbm) { + /* Set the number of descriptors */ + txq->nb_desc = ctrl->grp[gi].nb_desc[qi]; + if (!txq->nb_desc) { + txq->nb_desc = ctrl->nb_desc; + ctrl->grp[gi].nb_desc[qi] = txq->nb_desc; + } + /* Set mode and state for the queue */ + txq->state = PDMA_TX_QUEUE_USED; + if (dev->flags & PDMA_TX_POLLING) { + txq->free_thresh = txq->nb_desc / 4; + txq->state |= PDMA_TX_QUEUE_POLL; + } + /* Update queue index */ + txq->queue_id = ctrl->nb_txq; + ctrl->tx_queue[txq->queue_id] = txq; + ctrl->nb_txq++; + qn++; + mask |= 1 << qi; + /* Set up handler for the queue */ + hdl->queue = txq->queue_id; + hdl->dir = PDMA_Q_TX; + hdl->budget = ctrl->budget < txq->nb_desc ? + ctrl->budget : txq->nb_desc; + if (dev->mode == DEV_MODE_HNET) { + ctrl->vnet_txq[txq->queue_id] = ctrl->grp[gi].vnet_txq[qi]; + } + } else { + txq->state = 0; + } + } + + /* Set group metadata */ + if (qn) { + ctrl->grp[gi].bm_txq = mask; + ctrl->grp[gi].nb_txq = qn; + } else { + ctrl->grp[gi].bm_txq = 0; + ctrl->grp[gi].nb_txq = 0; + } + } + + return SHR_E_NONE; +} + +/*! + * \brief Configure device + * + * \param [in] dev Device structure point. + * \param [in] bm_rxq Rx queue bitmap. + * \param [in] bm_txq Tx queue bitmap. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +static int +bcmcnet_pdma_config(struct pdma_dev *dev, uint32_t bm_rxq, uint32_t bm_txq) +{ + struct dev_ctrl *ctrl = &dev->ctrl; + struct pdma_hw *hw = (struct pdma_hw *)ctrl->hw; + int gi; + + if (!bm_rxq || !bm_txq || (bm_rxq & bm_txq)) { + return SHR_E_PARAM; + } + + bcn_rx_queue_group_parse(dev, bm_rxq); + bcn_tx_queue_group_parse(dev, bm_txq); + + for (gi = 0; gi < dev->num_groups; gi++) { + if (!ctrl->grp[gi].attached) { + continue; + } + /* Update group metadata */ + if (!ctrl->grp[gi].bm_rxq && !ctrl->grp[gi].bm_txq) { + ctrl->grp[gi].attached = 0; + ctrl->bm_grp &= ~(1 << gi); + ctrl->nb_grp--; + continue; + } + ctrl->grp[gi].ctrl = ctrl; + ctrl->grp[gi].id = gi; + ctrl->grp[gi].irq_mask = 0; + } + + return hw->hdls.hw_config(hw); +} + +/*! + * Close device + */ +static int +bcmcnet_pdma_close(struct pdma_dev *dev) +{ + struct dev_ctrl *ctrl = &dev->ctrl; + struct pdma_hw *hw = (struct pdma_hw *)dev->ctrl.hw; + int gi; + + hw->hdls.hw_reset(hw); + + for (gi = 0; gi < dev->num_groups; gi++) { + if (!ctrl->grp[gi].attached) { + continue; + } + /* Reset group metadata */ + ctrl->bm_grp &= ~(1 << gi); + ctrl->nb_grp--; + ctrl->grp[gi].irq_mask = 0; + ctrl->grp[gi].poll_queues = 0; + ctrl->grp[gi].attached = 0; + } + + bcn_rx_queues_free(dev); + bcn_tx_queues_free(dev); + + return SHR_E_NONE; +} + +/*! + * Suspend device + */ +static int +bcmcnet_pdma_suspend(struct pdma_dev *dev) +{ + struct dev_ctrl *ctrl = &dev->ctrl; + uint32_t qi; + + for (qi = 0; qi < ctrl->nb_rxq; qi++) { + bcmcnet_pdma_rx_queue_suspend(dev, qi); + } + + for (qi = 0; qi < ctrl->nb_txq; qi++) { + bcmcnet_pdma_tx_queue_suspend(dev, qi); + } + + return SHR_E_NONE; +} + +/*! + * Resume device + */ +static int +bcmcnet_pdma_resume(struct pdma_dev *dev) +{ + struct dev_ctrl *ctrl = &dev->ctrl; + uint32_t qi; + + for (qi = 0; qi < ctrl->nb_rxq; qi++) { + bcmcnet_pdma_rx_queue_resume(dev, qi); + } + + for (qi = 0; qi < ctrl->nb_txq; qi++) { + bcmcnet_pdma_tx_queue_resume(dev, qi); + } + + return SHR_E_NONE; +} + +/*! + * Get device information + */ +static void +bcmcnet_pdma_info_get(struct pdma_dev *dev) +{ + struct dev_ctrl *ctrl = &dev->ctrl; + struct pdma_hw *hw = (struct pdma_hw *)ctrl->hw; + struct pdma_rx_queue *rxq = NULL; + struct pdma_tx_queue *txq = NULL; + uint32_t qi; + + sal_strncpy(dev->info.dev_name, dev->name, sizeof(dev->info.dev_name) - 1); + dev->info.dev_name[sizeof(dev->info.dev_name) - 1] = 0; + dev->info.dev_id = dev->dev_id; + dev->info.dev_type = dev->dev_type; + dev->info.max_groups = hw->info.num_cmcs; + dev->info.max_queues = hw->info.num_chans; + dev->info.bm_groups = ctrl->bm_grp; + dev->info.bm_rx_queues = ctrl->bm_rxq; + dev->info.bm_tx_queues = ctrl->bm_txq; + dev->info.nb_groups = ctrl->nb_grp; + dev->info.nb_rx_queues = ctrl->nb_rxq; + dev->info.nb_tx_queues = ctrl->nb_txq; + dev->info.rx_desc_size = hw->info.rx_dcb_size; + dev->info.tx_desc_size = hw->info.tx_dcb_size; + dev->info.rx_ph_size = hw->info.rx_ph_size; + dev->info.tx_ph_size = hw->info.tx_ph_size; + dev->info.rx_buf_dflt = ctrl->rx_buf_size; + dev->info.nb_desc_dflt = ctrl->nb_desc; + + for (qi = 0; qi < ctrl->nb_rxq; qi++) { + rxq = (struct pdma_rx_queue *)ctrl->rx_queue[qi]; + if (!rxq) { + continue; + } + dev->info.rx_buf_size[qi] = rxq->buf_size; + dev->info.nb_rx_desc[qi] = rxq->nb_desc; + } + + for (qi = 0; qi < ctrl->nb_txq; qi++) { + txq = (struct pdma_tx_queue *)ctrl->tx_queue[qi]; + if (!txq) { + continue; + } + dev->info.nb_tx_desc[qi] = txq->nb_desc; + } +} + +/*! + * Get device statistics + */ +static void +bcmcnet_pdma_stats_get(struct pdma_dev *dev) +{ + struct dev_ctrl *ctrl = &dev->ctrl; + struct pdma_rx_queue *rxq = NULL; + struct pdma_tx_queue *txq = NULL; + uint32_t packets = 0, bytes = 0, dropped = 0, errors = 0, nomems = 0, xoffs = 0; + uint32_t head_errors = 0, data_errors = 0, cell_errors = 0; + uint32_t qi; + + for (qi = 0; qi < ctrl->nb_rxq; qi++) { + rxq = (struct pdma_rx_queue *)ctrl->rx_queue[qi]; + if (!rxq) { + continue; + } + packets += rxq->stats.packets; + bytes += rxq->stats.bytes; + dropped += rxq->stats.dropped; + errors += rxq->stats.errors; + head_errors += rxq->stats.head_errors; + data_errors += rxq->stats.data_errors; + cell_errors += rxq->stats.cell_errors; + nomems += rxq->stats.nomems; + dev->stats.rxq_packets[qi] = rxq->stats.packets; + dev->stats.rxq_bytes[qi] = rxq->stats.bytes; + dev->stats.rxq_dropped[qi] = rxq->stats.dropped; + dev->stats.rxq_errors[qi] = rxq->stats.errors; + dev->stats.rxq_head_errors[qi] = rxq->stats.head_errors; + dev->stats.rxq_data_errors[qi] = rxq->stats.data_errors; + dev->stats.rxq_cell_errors[qi] = rxq->stats.cell_errors; + dev->stats.rxq_nomems[qi] = rxq->stats.nomems; + } + + dev->stats.rx_packets = packets; + dev->stats.rx_bytes = bytes; + dev->stats.rx_dropped = dropped; + dev->stats.rx_errors = errors; + dev->stats.rx_head_errors = head_errors; + dev->stats.rx_data_errors = data_errors; + dev->stats.rx_cell_errors = cell_errors; + dev->stats.rx_nomems = nomems; + + packets = bytes = dropped = errors = 0; + for (qi = 0; qi < ctrl->nb_txq; qi++) { + txq = (struct pdma_tx_queue *)ctrl->tx_queue[qi]; + if (!txq) { + continue; + } + packets += txq->stats.packets; + bytes += txq->stats.bytes; + dropped += txq->stats.dropped; + errors += txq->stats.errors; + xoffs += txq->stats.xoffs; + dev->stats.txq_packets[qi] = txq->stats.packets; + dev->stats.txq_bytes[qi] = txq->stats.bytes; + dev->stats.txq_dropped[qi] = txq->stats.dropped; + dev->stats.txq_errors[qi] = txq->stats.errors; + dev->stats.txq_xoffs[qi] = txq->stats.xoffs; + } + + dev->stats.tx_packets = packets; + dev->stats.tx_bytes = bytes; + dev->stats.tx_dropped = dropped; + dev->stats.tx_errors = errors; + dev->stats.tx_xoffs = xoffs; +} + +/*! + * Reset device statistics + */ +static void +bcmcnet_pdma_stats_reset(struct pdma_dev *dev) +{ + struct dev_ctrl *ctrl = &dev->ctrl; + struct pdma_rx_queue *rxq = NULL; + struct pdma_tx_queue *txq = NULL; + uint32_t qi; + + sal_memset(&dev->stats, 0, sizeof(struct bcmcnet_dev_stats)); + + for (qi = 0; qi < ctrl->nb_rxq; qi++) { + rxq = (struct pdma_rx_queue *)ctrl->rx_queue[qi]; + if (!rxq) { + continue; + } + rxq->stats.packets = 0; + rxq->stats.bytes = 0; + rxq->stats.dropped = 0; + rxq->stats.errors = 0; + rxq->stats.head_errors = 0; + rxq->stats.data_errors = 0; + rxq->stats.cell_errors = 0; + rxq->stats.nomems = 0; + } + + for (qi = 0; qi < ctrl->nb_txq; qi++) { + txq = (struct pdma_tx_queue *)ctrl->tx_queue[qi]; + if (!txq) { + continue; + } + txq->stats.packets = 0; + txq->stats.bytes = 0; + txq->stats.dropped = 0; + txq->stats.errors = 0; + txq->stats.xoffs = 0; + } +} + +/*! + * Convert logic queue to physical queue + */ +static int +bcmcnet_pdma_lq_to_pq(struct pdma_dev *dev, int queue, int dir, int *chan) +{ + struct dev_ctrl *ctrl = &dev->ctrl; + struct pdma_rx_queue *rxq = NULL; + struct pdma_tx_queue *txq = NULL; + + if (dir == PDMA_Q_RX) { + rxq = (struct pdma_rx_queue *)ctrl->rx_queue[queue]; + if (rxq->state & PDMA_RX_QUEUE_USED) { + *chan = rxq->chan_id; + return SHR_E_NONE; + } + } else { + txq = (struct pdma_tx_queue *)ctrl->tx_queue[queue]; + if (txq->state & PDMA_TX_QUEUE_USED) { + *chan = txq->chan_id; + return SHR_E_NONE; + } + } + + return SHR_E_UNAVAIL; +} + +/*! + * Convert physical queue to logic queue + */ +static int +bcmcnet_pdma_pq_to_lq(struct pdma_dev *dev, int chan, int *queue, int *dir) +{ + struct dev_ctrl *ctrl = &dev->ctrl; + struct pdma_rx_queue *rxq = NULL; + struct pdma_tx_queue *txq = NULL; + + rxq = ctrl->grp[chan / dev->grp_queues].rx_queue[chan % dev->grp_queues]; + if (rxq->state & PDMA_RX_QUEUE_USED) { + *queue = rxq->queue_id; + *dir = PDMA_Q_RX; + return SHR_E_NONE; + } + + txq = ctrl->grp[chan / dev->grp_queues].tx_queue[chan % dev->grp_queues]; + if (txq->state & PDMA_TX_QUEUE_USED) { + *queue = txq->queue_id; + *dir = PDMA_Q_TX; + return SHR_E_NONE; + } + + return SHR_E_UNAVAIL; +} + +/*! + * Start Rx queue + */ +static int +bcmcnet_pdma_rx_queue_start(struct pdma_dev *dev, int queue) +{ + struct dev_ctrl *ctrl = &dev->ctrl; + struct pdma_hw *hw = (struct pdma_hw *)ctrl->hw; + struct pdma_rx_queue *rxq = NULL; + + rxq = (struct pdma_rx_queue *)ctrl->rx_queue[queue]; + rxq->state |= PDMA_RX_QUEUE_ACTIVE; + + return hw->hdls.chan_start(hw, rxq->chan_id); +} + +/*! + * Stop Rx queue + */ +static int +bcmcnet_pdma_rx_queue_stop(struct pdma_dev *dev, int queue) +{ + struct dev_ctrl *ctrl = &dev->ctrl; + struct pdma_hw *hw = (struct pdma_hw *)ctrl->hw; + struct pdma_rx_queue *rxq = NULL; + + rxq = (struct pdma_rx_queue *)ctrl->rx_queue[queue]; + rxq->state &= ~PDMA_RX_QUEUE_ACTIVE; + + return hw->hdls.chan_stop(hw, rxq->chan_id); +} + +/*! + * Start Tx queue + */ +static int +bcmcnet_pdma_tx_queue_start(struct pdma_dev *dev, int queue) +{ + struct dev_ctrl *ctrl = &dev->ctrl; + struct pdma_hw *hw = (struct pdma_hw *)ctrl->hw; + struct pdma_tx_queue *txq = NULL; + + txq = (struct pdma_tx_queue *)ctrl->tx_queue[queue]; + txq->state |= PDMA_TX_QUEUE_ACTIVE; + + return dev->flags & PDMA_CHAIN_MODE ? SHR_E_NONE : + hw->hdls.chan_start(hw, txq->chan_id); +} + +/*! + * Stop Tx queue + */ +static int +bcmcnet_pdma_tx_queue_stop(struct pdma_dev *dev, int queue) +{ + struct dev_ctrl *ctrl = &dev->ctrl; + struct pdma_hw *hw = (struct pdma_hw *)ctrl->hw; + struct pdma_tx_queue *txq = NULL; + + txq = (struct pdma_tx_queue *)ctrl->tx_queue[queue]; + txq->state &= ~PDMA_TX_QUEUE_ACTIVE; + + return hw->hdls.chan_stop(hw, txq->chan_id); +} + +/*! + * Enable Rx queue interrupt + */ +static int +bcmcnet_pdma_rx_queue_intr_enable(struct pdma_dev *dev, int queue) +{ + struct dev_ctrl *ctrl = &dev->ctrl; + struct pdma_hw *hw = (struct pdma_hw *)ctrl->hw; + struct pdma_rx_queue *rxq = NULL; + + rxq = (struct pdma_rx_queue *)ctrl->rx_queue[queue]; + + return hw->hdls.chan_intr_enable(hw, rxq->chan_id); +} + +/*! + * Disable Rx queue interrupt + */ +static int +bcmcnet_pdma_rx_queue_intr_disable(struct pdma_dev *dev, int queue) +{ + struct dev_ctrl *ctrl = &dev->ctrl; + struct pdma_hw *hw = (struct pdma_hw *)ctrl->hw; + struct pdma_rx_queue *rxq = NULL; + + rxq = (struct pdma_rx_queue *)ctrl->rx_queue[queue]; + + return hw->hdls.chan_intr_disable(hw, rxq->chan_id); +} + +/*! + * Acknowledge Rx queue interrupt + */ +static int +bcmcnet_pdma_rx_queue_intr_ack(struct pdma_dev *dev, int queue) +{ + struct dev_ctrl *ctrl = &dev->ctrl; + struct pdma_hw *hw = (struct pdma_hw *)ctrl->hw; + struct pdma_rx_queue *rxq = NULL; + + rxq = (struct pdma_rx_queue *)ctrl->rx_queue[queue]; + + return hw->hdls.chan_clear(hw, rxq->chan_id); +} + +/*! + * Query Rx queue interrupt + */ +static int +bcmcnet_pdma_rx_queue_intr_query(struct pdma_dev *dev, int queue) +{ + struct dev_ctrl *ctrl = &dev->ctrl; + struct pdma_hw *hw = (struct pdma_hw *)ctrl->hw; + struct pdma_rx_queue *rxq = NULL; + + rxq = (struct pdma_rx_queue *)ctrl->rx_queue[queue]; + + return hw->hdls.chan_intr_query(hw, rxq->chan_id); +} + +/*! + * Check Rx queue interrupt + */ +static int +bcmcnet_pdma_rx_queue_intr_check(struct pdma_dev *dev, int queue) +{ + struct dev_ctrl *ctrl = &dev->ctrl; + struct pdma_hw *hw = (struct pdma_hw *)ctrl->hw; + struct pdma_rx_queue *rxq = NULL; + + rxq = (struct pdma_rx_queue *)ctrl->rx_queue[queue]; + + return hw->hdls.chan_intr_check(hw, rxq->chan_id); +} + +/*! + * Enable Tx queue interrupt + */ +static int +bcmcnet_pdma_tx_queue_intr_enable(struct pdma_dev *dev, int queue) +{ + struct dev_ctrl *ctrl = &dev->ctrl; + struct pdma_hw *hw = (struct pdma_hw *)ctrl->hw; + struct pdma_tx_queue *txq = NULL; + + txq = (struct pdma_tx_queue *)ctrl->tx_queue[queue]; + + if (txq->state & PDMA_TX_QUEUE_POLL) { + return SHR_E_NONE; + } else { + return hw->hdls.chan_intr_enable(hw, txq->chan_id); + } +} + +/*! + * Disable Tx queue interrupt + */ +static int +bcmcnet_pdma_tx_queue_intr_disable(struct pdma_dev *dev, int queue) +{ + struct dev_ctrl *ctrl = &dev->ctrl; + struct pdma_hw *hw = (struct pdma_hw *)ctrl->hw; + struct pdma_tx_queue *txq = NULL; + + txq = (struct pdma_tx_queue *)ctrl->tx_queue[queue]; + + return hw->hdls.chan_intr_disable(hw, txq->chan_id); +} + +/*! + * Acknowledge Tx queue interrupt + */ +static int +bcmcnet_pdma_tx_queue_intr_ack(struct pdma_dev *dev, int queue) +{ + struct dev_ctrl *ctrl = &dev->ctrl; + struct pdma_hw *hw = (struct pdma_hw *)ctrl->hw; + struct pdma_tx_queue *txq = NULL; + + txq = (struct pdma_tx_queue *)ctrl->tx_queue[queue]; + + return hw->hdls.chan_clear(hw, txq->chan_id); +} + +/*! + * Query Tx queue interrupt + */ +static int +bcmcnet_pdma_tx_queue_intr_query(struct pdma_dev *dev, int queue) +{ + struct dev_ctrl *ctrl = &dev->ctrl; + struct pdma_hw *hw = (struct pdma_hw *)ctrl->hw; + struct pdma_tx_queue *txq = NULL; + + txq = (struct pdma_tx_queue *)ctrl->tx_queue[queue]; + + return hw->hdls.chan_intr_query(hw, txq->chan_id); +} + +/*! + * Check Tx queue interrupt + */ +static int +bcmcnet_pdma_tx_queue_intr_check(struct pdma_dev *dev, int queue) +{ + struct dev_ctrl *ctrl = &dev->ctrl; + struct pdma_hw *hw = (struct pdma_hw *)ctrl->hw; + struct pdma_tx_queue *txq = NULL; + + txq = (struct pdma_tx_queue *)ctrl->tx_queue[queue]; + + return hw->hdls.chan_intr_check(hw, txq->chan_id); +} + +/*! + * \brief Device operation functions. + */ +static const struct dev_ops pdma_dev_ops = { + .dev_config = bcmcnet_pdma_config, + .dev_close = bcmcnet_pdma_close, + .dev_suspend = bcmcnet_pdma_suspend, + .dev_resume = bcmcnet_pdma_resume, + .dev_info_get = bcmcnet_pdma_info_get, + .dev_stats_get = bcmcnet_pdma_stats_get, + .dev_stats_reset = bcmcnet_pdma_stats_reset, + .dev_lq_to_pq = bcmcnet_pdma_lq_to_pq, + .dev_pq_to_lq = bcmcnet_pdma_pq_to_lq, + .rx_queue_start = bcmcnet_pdma_rx_queue_start, + .rx_queue_stop = bcmcnet_pdma_rx_queue_stop, + .tx_queue_start = bcmcnet_pdma_tx_queue_start, + .tx_queue_stop = bcmcnet_pdma_tx_queue_stop, + .rx_queue_setup = bcmcnet_pdma_rx_queue_setup, + .rx_queue_release = bcmcnet_pdma_rx_queue_release, + .rx_queue_restore = bcmcnet_pdma_rx_queue_restore, + .rx_vqueue_setup = bcmcnet_pdma_rx_vqueue_setup, + .rx_vqueue_release = bcmcnet_pdma_rx_vqueue_release, + .tx_queue_setup = bcmcnet_pdma_tx_queue_setup, + .tx_queue_release = bcmcnet_pdma_tx_queue_release, + .tx_queue_restore = bcmcnet_pdma_tx_queue_restore, + .tx_vqueue_setup = bcmcnet_pdma_tx_vqueue_setup, + .tx_vqueue_release = bcmcnet_pdma_tx_vqueue_release, + .rx_queue_intr_enable = bcmcnet_pdma_rx_queue_intr_enable, + .rx_queue_intr_disable = bcmcnet_pdma_rx_queue_intr_disable, + .rx_queue_intr_ack = bcmcnet_pdma_rx_queue_intr_ack, + .rx_queue_intr_query = bcmcnet_pdma_rx_queue_intr_query, + .rx_queue_intr_check = bcmcnet_pdma_rx_queue_intr_check, + .tx_queue_intr_enable = bcmcnet_pdma_tx_queue_intr_enable, + .tx_queue_intr_disable = bcmcnet_pdma_tx_queue_intr_disable, + .tx_queue_intr_ack = bcmcnet_pdma_tx_queue_intr_ack, + .tx_queue_intr_query = bcmcnet_pdma_tx_queue_intr_query, + .tx_queue_intr_check = bcmcnet_pdma_tx_queue_intr_check, + .rx_queue_suspend = bcmcnet_pdma_rx_queue_suspend, + .rx_queue_resume = bcmcnet_pdma_rx_queue_resume, + .tx_queue_wakeup = bcmcnet_pdma_tx_queue_wakeup, + .rx_queue_poll = bcmcnet_pdma_rx_queue_poll, + .tx_queue_poll = bcmcnet_pdma_tx_queue_poll, + .group_poll = bcmcnet_pdma_group_poll, +}; + +/*! + * Open a device + */ +int +bcmcnet_pdma_open(struct pdma_dev *dev) +{ + struct pdma_hw *hw = (struct pdma_hw *)dev->ctrl.hw; + struct intr_handle *hdl = NULL; + int chan, gi, qi; + + if (!hw) { + return SHR_E_INIT; + } + + /* Initialize the hardware */ + hw->hdls.hw_reset(hw); + hw->hdls.hw_init(hw); + + if ((uint32_t)dev->num_groups > hw->info.num_cmcs) { + return SHR_E_PARAM; + } + dev->grp_queues = hw->info.cmc_chans; + dev->num_queues = hw->info.num_chans; + dev->rx_ph_size = hw->info.rx_ph_size; + dev->tx_ph_size = hw->info.tx_ph_size; + dev->ctrl.nb_desc = NUM_RING_DESC; + dev->ctrl.budget = NUM_RXTX_BUDGET; + dev->ctrl.rx_desc_size = hw->info.rx_dcb_size; + dev->ctrl.tx_desc_size = hw->info.tx_dcb_size; + + /* Initialize interrupt handler */ + for (chan = 0; chan < dev->num_queues; chan++) { + gi = chan / dev->grp_queues; + qi = chan % dev->grp_queues; + hdl = &dev->ctrl.grp[gi].intr_hdl[qi]; + hdl->unit = dev->unit; + hdl->group = gi; + hdl->chan = chan; + hdl->dev = dev; + hdl->intr_num = hw->hdls.chan_intr_num_get(hw, chan); + if (hdl->intr_num < 0) { + return SHR_E_INTERNAL; + } + } + + /* Initialize buffer manager */ + bcmcnet_buf_mngr_init(dev); + + /* Allocate all the queues */ + bcn_rx_queues_alloc(dev); + bcn_tx_queues_alloc(dev); + + dev->pkt_xmit = bcmcnet_pdma_tx_queue_xmit; + + dev->ops = (struct dev_ops *)&pdma_dev_ops; + + return SHR_E_NONE; +} + +/*! + * Coalesce Rx interrupt + */ +int +bcmcnet_pdma_rx_queue_int_coalesce(struct pdma_dev *dev, int queue, int count, int timer) +{ + struct dev_ctrl *ctrl = &dev->ctrl; + struct pdma_hw *hw = (struct pdma_hw *)ctrl->hw; + struct pdma_rx_queue *rxq = NULL; + + if ((uint32_t)queue >= ctrl->nb_rxq) { + return SHR_E_PARAM; + } + + rxq = (struct pdma_rx_queue *)ctrl->rx_queue[queue]; + rxq->intr_coalescing = 1; + rxq->ic_val = (count & 0x7fff) << 16 | (timer & 0xffff); + + return hw->hdls.chan_intr_coalesce(hw, rxq->chan_id, count, timer); +} + +/*! + * Coalesce Tx interrupt + */ +int +bcmcnet_pdma_tx_queue_int_coalesce(struct pdma_dev *dev, int queue, int count, int timer) +{ + struct dev_ctrl *ctrl = &dev->ctrl; + struct pdma_hw *hw = (struct pdma_hw *)ctrl->hw; + struct pdma_tx_queue *txq = NULL; + + if ((uint32_t)queue >= ctrl->nb_txq) { + return SHR_E_PARAM; + } + + txq = (struct pdma_tx_queue *)ctrl->tx_queue[queue]; + txq->intr_coalescing = 1; + txq->ic_val = (count & 0x7fff) << 16 | (timer & 0xffff); + + return hw->hdls.chan_intr_coalesce(hw, txq->chan_id, count, timer); +} + +/*! + * Dump Rx queue registers + */ +int +bcmcnet_pdma_rx_queue_reg_dump(struct pdma_dev *dev, int queue) +{ + struct dev_ctrl *ctrl = &dev->ctrl; + struct pdma_hw *hw = (struct pdma_hw *)ctrl->hw; + struct pdma_rx_queue *rxq = NULL; + + if ((uint32_t)queue >= ctrl->nb_rxq) { + return SHR_E_PARAM; + } + + rxq = (struct pdma_rx_queue *)ctrl->rx_queue[queue]; + + return hw->hdls.chan_reg_dump(hw, rxq->chan_id); +} + +/*! + * Dump Tx queue registers + */ +int +bcmcnet_pdma_tx_queue_reg_dump(struct pdma_dev *dev, int queue) +{ + struct dev_ctrl *ctrl = &dev->ctrl; + struct pdma_hw *hw = (struct pdma_hw *)ctrl->hw; + struct pdma_tx_queue *txq = NULL; + + if ((uint32_t)queue >= ctrl->nb_txq) { + return SHR_E_PARAM; + } + + txq = (struct pdma_tx_queue *)ctrl->tx_queue[queue]; + + return hw->hdls.chan_reg_dump(hw, txq->chan_id); +} + diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmcnet/main/bcmcnet_rxtx.c b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/main/bcmcnet_rxtx.c new file mode 100644 index 000000000000..cfabe9d95d56 --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/bcmcnet/main/bcmcnet_rxtx.c @@ -0,0 +1,708 @@ +/*! \file bcmcnet_rxtx.c + * + * Utility routines for BCMCNET Rx/Tx. + * + */ +/* + * $Copyright: Copyright 2018-2020 Broadcom. All rights reserved. + * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * A copy of the GNU General Public License version 2 (GPLv2) can + * be found in the LICENSES folder.$ + */ + +#include +#include +#include +#include + +/*! + * Free a Rx ring + */ +static void +bcn_rx_ring_free(struct pdma_rx_queue *rxq) +{ + struct dev_ctrl *ctrl = rxq->ctrl; + struct pdma_buf_mngr *bm = (struct pdma_buf_mngr *)ctrl->buf_mngr; + + if (rxq->lock) { + sal_spinlock_destroy(rxq->lock); + rxq->lock = NULL; + } + + if (rxq->ring) { + bm->ring_buf_free(ctrl->dev, ctrl->rx_desc_size * (rxq->nb_desc + 1), + rxq->ring, rxq->ring_addr); + rxq->ring = NULL; + } + + if (rxq->pbuf) { + sal_free(rxq->pbuf); + rxq->pbuf = NULL; + } +} + +/*! + * Allocate a Rx ring + */ +static int +bcn_rx_ring_alloc(struct pdma_rx_queue *rxq) +{ + struct dev_ctrl *ctrl = rxq->ctrl; + struct pdma_buf_mngr *bm = (struct pdma_buf_mngr *)ctrl->buf_mngr; + + /* Setup pktbuf ring */ + rxq->pbuf = sal_alloc(sizeof(*rxq->pbuf) * rxq->nb_desc, "bcmcnetRxBufRing"); + if (!rxq->pbuf) { + goto cleanup; + } + sal_memset(rxq->pbuf, 0, sizeof(*rxq->pbuf) * rxq->nb_desc); + + /* Allocate memory for descriptors */ + rxq->ring = bm->ring_buf_alloc(ctrl->dev, ctrl->rx_desc_size * (rxq->nb_desc + 1), + &rxq->ring_addr); + if (!rxq->ring) { + goto cleanup; + } + sal_memset(rxq->ring, 0, ctrl->rx_desc_size * (rxq->nb_desc + 1)); + + rxq->lock = sal_spinlock_create("bcmcnetRxQueueLock"); + if (!rxq->lock) { + goto cleanup; + } + + return SHR_E_NONE; + +cleanup: + bcn_rx_ring_free(rxq); + + return SHR_E_MEMORY; +} + +/*! + * Free a Tx ring + */ +static void +bcn_tx_ring_free(struct pdma_tx_queue *txq) +{ + struct dev_ctrl *ctrl = txq->ctrl; + struct pdma_buf_mngr *bm = (struct pdma_buf_mngr *)ctrl->buf_mngr; + + if (txq->sem) { + sal_sem_destroy(txq->sem); + txq->sem = NULL; + } + + if (txq->mutex) { + sal_spinlock_destroy(txq->mutex); + txq->mutex = NULL; + } + + if (txq->lock) { + sal_spinlock_destroy(txq->lock); + txq->lock = NULL; + } + + if (txq->ring) { + bm->ring_buf_free(ctrl->dev, ctrl->tx_desc_size * (txq->nb_desc + 1), + txq->ring, txq->ring_addr); + txq->ring = NULL; + } + + if (txq->pbuf) { + sal_free(txq->pbuf); + txq->pbuf = NULL; + } +} + +/*! + * Allocate a Tx ring + */ +static int +bcn_tx_ring_alloc(struct pdma_tx_queue *txq) +{ + struct dev_ctrl *ctrl = txq->ctrl; + struct pdma_buf_mngr *bm = (struct pdma_buf_mngr *)ctrl->buf_mngr; + + /* Setup pktbuf ring */ + txq->pbuf = sal_alloc(sizeof(*txq->pbuf) * txq->nb_desc, "bcmcnetTxBufRing"); + if (!txq->pbuf) { + goto cleanup; + } + sal_memset(txq->pbuf, 0, sizeof(*txq->pbuf) * txq->nb_desc); + + /* Allocate memory for descriptors */ + txq->ring = bm->ring_buf_alloc(ctrl->dev, ctrl->tx_desc_size * (txq->nb_desc + 1), + &txq->ring_addr); + if (!txq->ring) { + goto cleanup; + } + sal_memset(txq->ring, 0, ctrl->tx_desc_size * (txq->nb_desc + 1)); + + txq->lock = sal_spinlock_create("bcmcnetTxQueueLock"); + if (!txq->lock) { + goto cleanup; + } + + txq->mutex = sal_spinlock_create("bcmcnetTxMutexLock"); + if (!txq->mutex) { + goto cleanup; + } + + txq->sem = sal_sem_create("bcmcnetTxMutexSem", SAL_SEM_BINARY, 0); + if (!txq->sem) { + goto cleanup; + } + + return SHR_E_NONE; + +cleanup: + bcn_tx_ring_free(txq); + + return SHR_E_MEMORY; +} + +/*! + * Rx polling + */ +static int +bcn_rx_poll(struct pdma_rx_queue *rxq, int budget) +{ + struct dev_ctrl *ctrl = rxq->ctrl; + struct pdma_hw *hw = (struct pdma_hw *)ctrl->hw; + + return hw->dops.rx_ring_clean(hw, rxq, budget); +} + +/*! + * Tx polling + */ +static int +bcn_tx_poll(struct pdma_tx_queue *txq, int budget) +{ + struct dev_ctrl *ctrl = txq->ctrl; + struct pdma_hw *hw = (struct pdma_hw *)ctrl->hw; + + return hw->dops.tx_ring_clean(hw, txq, budget); +} + +/*! + * Setup a Rx queue + */ +int +bcmcnet_pdma_rx_queue_setup(struct pdma_dev *dev, int queue) +{ + struct dev_ctrl *ctrl = &dev->ctrl; + struct pdma_hw *hw = (struct pdma_hw *)ctrl->hw; + struct pdma_rx_queue *rxq = NULL; + int rv; + + rxq = (struct pdma_rx_queue *)ctrl->rx_queue[queue]; + if (rxq->state & PDMA_RX_QUEUE_SETUP) { + return SHR_E_NONE; + } + + rv = bcn_rx_ring_alloc(rxq); + if (SHR_FAILURE(rv)) { + return rv; + } + + rv = hw->dops.rx_desc_init(hw, rxq); + if (SHR_FAILURE(rv)) { + return rv; + } + + if (dev->mode == DEV_MODE_VNET) { + ctrl->vsync.rx_ring_addr[queue] = rxq->ring_addr; + ctrl->vsync.rx_ring_size[queue] = rxq->nb_desc; + } + + rxq->state |= PDMA_RX_QUEUE_SETUP; + + return SHR_E_NONE; +} + +/*! + * Release a Rx queue + */ +int +bcmcnet_pdma_rx_queue_release(struct pdma_dev *dev, int queue) +{ + struct dev_ctrl *ctrl = &dev->ctrl; + struct pdma_hw *hw = (struct pdma_hw *)ctrl->hw; + struct pdma_rx_queue *rxq = NULL; + + rxq = (struct pdma_rx_queue *)ctrl->rx_queue[queue]; + if (rxq->state & PDMA_RX_QUEUE_SETUP) { + hw->dops.rx_desc_clean(hw, rxq); + bcn_rx_ring_free(rxq); + rxq->state &= ~PDMA_RX_QUEUE_SETUP; + } + + return SHR_E_NONE; +} + +/*! + * Restore a Rx queue + */ +int +bcmcnet_pdma_rx_queue_restore(struct pdma_dev *dev, int queue) +{ + struct dev_ctrl *ctrl = &dev->ctrl; + struct pdma_hw *hw = (struct pdma_hw *)ctrl->hw; + struct pdma_rx_queue *rxq = NULL; + + rxq = (struct pdma_rx_queue *)ctrl->rx_queue[queue]; + if (rxq->state & PDMA_RX_QUEUE_SETUP) { + hw->dops.rx_desc_init(hw, rxq); + } + + return SHR_E_NONE; +} + +/*! + * Set up a virtual Rx queue + */ +int +bcmcnet_pdma_rx_vqueue_setup(struct pdma_dev *dev, int queue) +{ + struct dev_ctrl *ctrl = &dev->ctrl; + struct pdma_rx_queue *vrxq = NULL; + + vrxq = (struct pdma_rx_queue *)ctrl->vnet_rxq[queue]; + if (vrxq->state & PDMA_RX_QUEUE_SETUP) { + return SHR_E_NONE; + } + + if (dev->ctrl.vsync.rx_ring_addr[queue]) { + vrxq->curr = 0; + vrxq->nb_desc = dev->ctrl.vsync.rx_ring_size[queue]; + vrxq->ring_addr = dev->ctrl.vsync.rx_ring_addr[queue]; + vrxq->ring = dev->sys_p2v(dev, vrxq->ring_addr); + vrxq->state |= PDMA_RX_QUEUE_SETUP; + } else { + return SHR_E_UNAVAIL; + } + + return SHR_E_NONE; +} + +/*! + * Release a virtual Rx queue + */ +int +bcmcnet_pdma_rx_vqueue_release(struct pdma_dev *dev, int queue) +{ + struct dev_ctrl *ctrl = &dev->ctrl; + struct pdma_rx_queue *vrxq = NULL; + + vrxq = (struct pdma_rx_queue *)ctrl->vnet_rxq[queue]; + if (vrxq->state & PDMA_RX_QUEUE_SETUP) { + vrxq->state &= ~PDMA_RX_QUEUE_SETUP; + vrxq->ring = NULL; + } + + return SHR_E_NONE; +} + +/*! + * Setup a Tx queue + */ +int +bcmcnet_pdma_tx_queue_setup(struct pdma_dev *dev, int queue) +{ + struct dev_ctrl *ctrl = &dev->ctrl; + struct pdma_hw *hw = (struct pdma_hw *)ctrl->hw; + struct pdma_tx_queue *txq = NULL; + int rv; + + txq = (struct pdma_tx_queue *)ctrl->tx_queue[queue]; + if (txq->state & PDMA_TX_QUEUE_SETUP) { + return SHR_E_NONE; + } + + rv = bcn_tx_ring_alloc(txq); + if (SHR_FAILURE(rv)) { + return rv; + } + + rv = hw->dops.tx_desc_init(hw, txq); + if (SHR_FAILURE(rv)) { + return rv; + } + + if (dev->mode == DEV_MODE_VNET) { + ctrl->vsync.tx_ring_addr[queue] = txq->ring_addr; + ctrl->vsync.tx_ring_size[queue] = txq->nb_desc; + } + + txq->state |= PDMA_TX_QUEUE_SETUP; + + return SHR_E_NONE; +} + +/*! + * Release a Tx queue + */ +int +bcmcnet_pdma_tx_queue_release(struct pdma_dev *dev, int queue) +{ + struct dev_ctrl *ctrl = &dev->ctrl; + struct pdma_hw *hw = (struct pdma_hw *)ctrl->hw; + struct pdma_tx_queue *txq = NULL; + + txq = (struct pdma_tx_queue *)ctrl->tx_queue[queue]; + if (txq->state & PDMA_TX_QUEUE_SETUP) { + hw->dops.tx_desc_clean(hw, txq); + bcn_tx_ring_free(txq); + txq->state &= ~PDMA_TX_QUEUE_SETUP; + } + + return SHR_E_NONE; +} + +/*! + * Restore a Tx queue + */ +int +bcmcnet_pdma_tx_queue_restore(struct pdma_dev *dev, int queue) +{ + struct dev_ctrl *ctrl = &dev->ctrl; + struct pdma_hw *hw = (struct pdma_hw *)ctrl->hw; + struct pdma_tx_queue *txq = NULL; + + txq = (struct pdma_tx_queue *)ctrl->tx_queue[queue]; + if (txq->state & PDMA_TX_QUEUE_SETUP) { + hw->dops.tx_desc_init(hw, txq); + } + + return SHR_E_NONE; +} + +/*! + * Set up a virtual Tx queue + */ +int +bcmcnet_pdma_tx_vqueue_setup(struct pdma_dev *dev, int queue) +{ + struct dev_ctrl *ctrl = &dev->ctrl; + struct pdma_tx_queue *vtxq = NULL; + + vtxq = (struct pdma_tx_queue *)ctrl->vnet_txq[queue]; + if (vtxq->state & PDMA_TX_QUEUE_SETUP) { + return SHR_E_NONE; + } + + if (dev->ctrl.vsync.tx_ring_addr[queue]) { + vtxq->curr = 0; + vtxq->dirt = 0; + vtxq->nb_desc = dev->ctrl.vsync.tx_ring_size[queue]; + vtxq->ring_addr = dev->ctrl.vsync.tx_ring_addr[queue]; + vtxq->ring = dev->sys_p2v(dev, vtxq->ring_addr); + vtxq->state |= PDMA_TX_QUEUE_SETUP; + } else { + return SHR_E_UNAVAIL; + } + + return SHR_E_NONE; +} + +/*! + * Release a virtual Tx queue + */ +int +bcmcnet_pdma_tx_vqueue_release(struct pdma_dev *dev, int queue) +{ + struct dev_ctrl *ctrl = &dev->ctrl; + struct pdma_tx_queue *vtxq = NULL; + + vtxq = (struct pdma_tx_queue *)ctrl->vnet_txq[queue]; + if (vtxq->state & PDMA_TX_QUEUE_SETUP) { + vtxq->state &= ~PDMA_TX_QUEUE_SETUP; + vtxq->ring = NULL; + } + + return SHR_E_NONE; +} + +/*! + * Suspend a Rx queue + */ +int +bcmcnet_pdma_rx_queue_suspend(struct pdma_dev *dev, int queue) +{ + struct dev_ctrl *ctrl = &dev->ctrl; + struct pdma_hw *hw = (struct pdma_hw *)ctrl->hw; + struct pdma_rx_queue *rxq = NULL; + + rxq = (struct pdma_rx_queue *)ctrl->rx_queue[queue]; + if (!rxq || !(rxq->state & PDMA_RX_QUEUE_ACTIVE)) { + return SHR_E_UNAVAIL; + } + + return hw->dops.rx_suspend(hw, rxq); +} + +/*! + * Resume a Rx queue + */ +int +bcmcnet_pdma_rx_queue_resume(struct pdma_dev *dev, int queue) +{ + struct dev_ctrl *ctrl = &dev->ctrl; + struct pdma_hw *hw = (struct pdma_hw *)ctrl->hw; + struct pdma_rx_queue *rxq = NULL; + + rxq = (struct pdma_rx_queue *)ctrl->rx_queue[queue]; + if (!rxq || !(rxq->state & PDMA_RX_QUEUE_ACTIVE)) { + return SHR_E_UNAVAIL; + } + + return hw->dops.rx_resume(hw, rxq); +} + +/*! + * Suspend a Tx queue + */ +int +bcmcnet_pdma_tx_queue_suspend(struct pdma_dev *dev, int queue) +{ + struct dev_ctrl *ctrl = &dev->ctrl; + struct pdma_tx_queue *txq = NULL; + + txq = (struct pdma_tx_queue *)ctrl->tx_queue[queue]; + if (!txq || !(txq->state & PDMA_TX_QUEUE_ACTIVE)) { + return SHR_E_UNAVAIL; + } + + if (txq->sem) { + sal_sem_take(txq->sem, SAL_SEM_FOREVER); + } + if (dev->tx_suspend) { + dev->tx_suspend(dev, txq->queue_id); + } + + return SHR_E_NONE; +} + +/*! + * Resume a Tx queue + */ +int +bcmcnet_pdma_tx_queue_resume(struct pdma_dev *dev, int queue) +{ + struct dev_ctrl *ctrl = &dev->ctrl; + struct pdma_tx_queue *txq = NULL; + + txq = (struct pdma_tx_queue *)ctrl->tx_queue[queue]; + if (!txq || !(txq->state & PDMA_TX_QUEUE_ACTIVE)) { + return SHR_E_UNAVAIL; + } + + if (txq->sem) { + sal_sem_give(txq->sem); + } + if (dev->tx_resume) { + dev->tx_resume(dev, txq->queue_id); + } + + return SHR_E_NONE; +} + +/*! + * Wake up a Tx queue + */ +int +bcmcnet_pdma_tx_queue_wakeup(struct pdma_dev *dev, int queue) +{ + struct dev_ctrl *ctrl = &dev->ctrl; + struct pdma_tx_queue *txq = NULL; + + txq = (struct pdma_tx_queue *)ctrl->tx_queue[queue]; + if (txq->sem) { + sal_sem_give(txq->sem); + } + + return SHR_E_NONE; +} + +/*! + * Transmit a outputing packet + */ +int +bcmcnet_pdma_tx_queue_xmit(struct pdma_dev *dev, int queue, void *buf) +{ + struct dev_ctrl *ctrl = &dev->ctrl; + struct pdma_hw *hw = (struct pdma_hw *)ctrl->hw; + struct pdma_tx_queue *txq = NULL; + + txq = (struct pdma_tx_queue *)ctrl->tx_queue[queue]; + if (!txq || !(txq->state & PDMA_TX_QUEUE_ACTIVE)) { + return SHR_E_UNAVAIL; + } + + return hw->dops.pkt_xmit(hw, txq, buf); +} + +/*! + * Poll a Rx queues + */ +int +bcmcnet_pdma_rx_queue_poll(struct pdma_dev *dev, int queue, int budget) +{ + struct dev_ctrl *ctrl = &dev->ctrl; + struct pdma_rx_queue *rxq = ctrl->rx_queue[queue]; + + return bcn_rx_poll(rxq, budget); +} + +/*! + * Poll a Tx queues + */ +int +bcmcnet_pdma_tx_queue_poll(struct pdma_dev *dev, int queue, int budget) +{ + struct dev_ctrl *ctrl = &dev->ctrl; + struct pdma_tx_queue *txq = ctrl->tx_queue[queue]; + + return bcn_tx_poll(txq, budget); +} + +/*! + * Poll for Rx/Tx queues in a group + */ +int +bcmcnet_pdma_group_poll(struct pdma_dev *dev, int group, int budget) +{ + struct dev_ctrl *ctrl = &dev->ctrl; + struct pdma_hw *hw = (struct pdma_hw *)ctrl->hw; + struct pdma_rx_queue *rxq = NULL; + struct pdma_tx_queue *txq = NULL; + struct queue_group *grp = &ctrl->grp[group]; + int done = 0, done_que, budget_que; + int i; + + /* Acknowledge the interrupts */ + for (i = 0; i < dev->grp_queues; i++) { + rxq = grp->rx_queue[i]; + if (rxq->state & PDMA_RX_QUEUE_ACTIVE) { + if (hw->hdls.chan_intr_query(hw, rxq->chan_id)) { + hw->hdls.chan_clear(hw, rxq->chan_id); + grp->poll_queues |= 1 << i; + } else if (rxq->state & PDMA_RX_QUEUE_BUSY) { + rxq->state &= ~PDMA_RX_QUEUE_BUSY; + grp->poll_queues |= 1 << i; + } + continue; + } + txq = grp->tx_queue[i]; + if (txq->state & PDMA_TX_QUEUE_ACTIVE) { + if (hw->hdls.chan_intr_query(hw, txq->chan_id)) { + hw->hdls.chan_clear(hw, txq->chan_id); + grp->poll_queues |= 1 << i; + } + } + } + + /* Calculate per queue budget */ + if (!grp->poll_queues) { + grp->poll_queues = grp->bm_rxq | grp->bm_txq; + budget_que = budget / grp->nb_rxq; + } else { + budget_que = 0; + for (i = 0; i < dev->grp_queues; i++) { + if (1 << i & grp->bm_rxq & grp->poll_queues) { + budget_que++; + } + } + if (budget_que) { + budget_que = budget / budget_que; + } + } + + /* Poll Rx queues */ + for (i = 0; i < dev->grp_queues; i++) { + if (1 << i & grp->bm_rxq & grp->poll_queues) { + rxq = grp->rx_queue[i]; + done_que = bcn_rx_poll(rxq, budget_que); + if (done_que < budget_que) { + grp->poll_queues &= ~(1 << i); + } + done += done_que; + } + } + + /* Poll Tx queues */ + for (i = 0; i < dev->grp_queues; i++) { + txq = grp->tx_queue[i]; + if (1 << i & grp->bm_txq & grp->poll_queues && !txq->free_thresh) { + if (bcn_tx_poll(txq, budget) < budget) { + grp->poll_queues &= ~(1 << i); + } + } + } + + return grp->poll_queues ? budget : done; +} + +/*! + * Dump a Rx ring + */ +int +bcmcnet_pdma_rx_ring_dump(struct pdma_dev *dev, int queue) +{ + struct dev_ctrl *ctrl = &dev->ctrl; + struct pdma_hw *hw = ctrl->hw; + struct pdma_rx_queue *rxq = NULL; + + if ((uint32_t)queue >= ctrl->nb_rxq) { + return SHR_E_PARAM; + } + + rxq = (struct pdma_rx_queue *)ctrl->rx_queue[queue]; + if (rxq->state & PDMA_RX_QUEUE_ACTIVE) { + hw->dops.rx_ring_dump(hw, rxq); + } + if (dev->mode == DEV_MODE_HNET) { + rxq = (struct pdma_rx_queue *)ctrl->vnet_rxq[queue]; + hw->dops.rx_ring_dump(hw, rxq); + } + + return SHR_E_NONE; +} + +/*! + * Dump a Tx ring + */ +int +bcmcnet_pdma_tx_ring_dump(struct pdma_dev *dev, int queue) +{ + struct dev_ctrl *ctrl = &dev->ctrl; + struct pdma_hw *hw = ctrl->hw; + struct pdma_tx_queue *txq = NULL; + + if ((uint32_t)queue >= ctrl->nb_txq) { + return SHR_E_PARAM; + } + + txq = (struct pdma_tx_queue *)ctrl->tx_queue[queue]; + if (txq->state & PDMA_TX_QUEUE_ACTIVE) { + hw->dops.tx_ring_dump(hw, txq); + } + if (dev->mode == DEV_MODE_HNET) { + txq = (struct pdma_tx_queue *)ctrl->vnet_txq[queue]; + hw->dops.tx_ring_dump(hw, txq); + } + + return SHR_E_NONE; +} + diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmdrd/include/bcmdrd/bcmdrd_devlist.h b/platform/broadcom/saibcm-modules/sdklt/bcmdrd/include/bcmdrd/bcmdrd_devlist.h new file mode 100644 index 000000000000..675b9426ea01 --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/bcmdrd/include/bcmdrd/bcmdrd_devlist.h @@ -0,0 +1,337 @@ +/* + * DO NOT EDIT THIS FILE! + * This file is auto-generated. + * Edits to this file will be lost when it is regenerated. + * Tool: INTERNAL/drd/instpkgs.pl + * + * $Copyright: Copyright 2018-2020 Broadcom. All rights reserved. + * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * A copy of the GNU General Public License version 2 (GPLv2) can + * be found in the LICENSES folder.$ + */ + +/* + * This file contains the complete list of supported devices. + * No other device lists should be used anywhere in the SDK. + */ + +#ifndef BCMDRD_DEVIDS_H +#define BCMDRD_DEVIDS_H + +#include + +/* + * All Supported Devices and Revisions + */ + +#define BROADCOM_VENDOR_ID 0x14e4 +#define BROADCOM_PHYID_MSB 0x0143 + +/* BCM56780 */ +#define BCM56780_VENDOR_ID 0x14e4 +#define BCM56780_DEVICE_ID 0xb780 +#define BCM56780_REV_A0 0x01 + +/* BCM56782 */ +#define BCM56782_VENDOR_ID 0x14e4 +#define BCM56782_DEVICE_ID 0xb782 +#define BCM56782_REV_A0 0x01 + +/* BCM56784 */ +#define BCM56784_VENDOR_ID 0x14e4 +#define BCM56784_DEVICE_ID 0xb784 +#define BCM56784_REV_A0 0x01 + +/* BCM56786 */ +#define BCM56786_VENDOR_ID 0x14e4 +#define BCM56786_DEVICE_ID 0xb786 +#define BCM56786_REV_A0 0x01 + +/* BCM56788 */ +#define BCM56788_VENDOR_ID 0x14e4 +#define BCM56788_DEVICE_ID 0xb788 +#define BCM56788_REV_A0 0x01 + +/* BCM56789 */ +#define BCM56789_VENDOR_ID 0x14e4 +#define BCM56789_DEVICE_ID 0xb789 +#define BCM56789_REV_A0 0x01 + +/* BCM56880 */ +#define BCM56880_VENDOR_ID 0x14e4 +#define BCM56880_DEVICE_ID 0xb880 +#define BCM56880_REV_A0 0x01 +#define BCM56880_REV_B0 0x11 + +/* BCM56881 */ +#define BCM56881_VENDOR_ID 0x14e4 +#define BCM56881_DEVICE_ID 0xb881 +#define BCM56881_REV_A0 0x01 +#define BCM56881_REV_B0 0x11 + +/* BCM56883 */ +#define BCM56883_VENDOR_ID 0x14e4 +#define BCM56883_DEVICE_ID 0xb883 +#define BCM56883_REV_A0 0x01 +#define BCM56883_REV_B0 0x11 + +/* BCM56889 */ +#define BCM56889_VENDOR_ID 0x14e4 +#define BCM56889_DEVICE_ID 0xb889 +#define BCM56889_REV_A0 0x01 +#define BCM56889_REV_B0 0x11 + +/* BCM56990 */ +#define BCM56990_VENDOR_ID 0x14e4 +#define BCM56990_DEVICE_ID 0xb990 +#define BCM56990_REV_A0 0x01 +#define BCM56990_REV_B0 0x11 + +/* BCM56992 */ +#define BCM56992_VENDOR_ID 0x14e4 +#define BCM56992_DEVICE_ID 0xb992 +#define BCM56992_REV_B0 0x11 + +/* BCM56996 */ +#define BCM56996_VENDOR_ID 0x14e4 +#define BCM56996_DEVICE_ID 0xb996 +#define BCM56996_REV_A0 0x01 + +/* BCM56997 */ +#define BCM56997_VENDOR_ID 0x14e4 +#define BCM56997_DEVICE_ID 0xb997 +#define BCM56997_REV_A0 0x01 + +/* + * End of Supported Devices and Revisions + */ + +#endif /* BCMDRD_DEVIDS_H */ + +#ifdef BCMDRD_DEVLIST_ENTRY +/* + * BCMDRD_DEVLIST_ENTRY macros. + * + * Before including this file, define BCMDRD_DEVLIST_ENTRY + * as a macro to operate on the following parameters: + * + * #define BCMDRD_DEVLIST_ENTRY(_nm,_vn,_dv,_rv,_md,_pi,_bd,_bc,_fn,_cn,_pf,_pd,_r0,_r1) + * + * _nm: Chip Name + * _vn: Chip Vendor ID + * _dv: Chip Device ID + * _rv: Chip Revision + * _md: Chip Model + * _pi: Probe Information + * _bd: SW Base Driver + * _bc: SW Base Configuration + * _fn: SW Full Name + * _cn: Code Name + * _pf: Product Family + * _pd: Product Description + * _r0: Reserved + * _r1: Reserved + * + * Note that this macro will be undefined at the end of this file. + */ + +#if BCMDRD_CONFIG_INCLUDE_BCM56780_A0 == 1 || defined(BCMDRD_DEVLIST_OVERRIDE) +BCMDRD_DEVLIST_ENTRY(BCM56780, BCM56780_VENDOR_ID, BCM56780_DEVICE_ID, BCM56780_REV_A0, \ + 0, 0, \ + bcm56780_a0, bcm56780_a0, bcm56780_a0, \ + "Trident4-X9", "BCM56780", \ + "8 Tb/s 160x50G-PAM4 Programmable Switch", 0, 0) +#endif + +#if BCMDRD_CONFIG_INCLUDE_BCM56782_A0 == 1 || defined(BCMDRD_DEVLIST_OVERRIDE) +#ifdef BCMDRD_DEVLIST_INCLUDE_ALL +BCMDRD_DEVLIST_ENTRY(BCM56782, BCM56782_VENDOR_ID, BCM56782_DEVICE_ID, BCM56782_REV_A0, \ + 0, 0, \ + bcm56780_a0, bcm56782_a0, bcm56782_a0, \ + "Trident4-X9", "BCM56780", \ + "8 Tb/s 160x50G-PAM4 Programmable Switch w/MACsec", 0, 0) +#endif +#endif + +#if BCMDRD_CONFIG_INCLUDE_BCM56784_A0 == 1 || defined(BCMDRD_DEVLIST_OVERRIDE) +#ifdef BCMDRD_DEVLIST_INCLUDE_ALL +BCMDRD_DEVLIST_ENTRY(BCM56784, BCM56784_VENDOR_ID, BCM56784_DEVICE_ID, BCM56784_REV_A0, \ + 0, 0, \ + bcm56780_a0, bcm56784_a0, bcm56784_a0, \ + "Trident4-X9", "BCM56780", \ + "5.6 Tb/s 96x50G-PAM4/32x35G-NRZ Programmable Switch", 0, 0) +#endif +#endif + +#if BCMDRD_CONFIG_INCLUDE_BCM56786_A0 == 1 || defined(BCMDRD_DEVLIST_OVERRIDE) +#ifdef BCMDRD_DEVLIST_INCLUDE_ALL +BCMDRD_DEVLIST_ENTRY(BCM56786, BCM56786_VENDOR_ID, BCM56786_DEVICE_ID, BCM56786_REV_A0, \ + 0, 0, \ + bcm56780_a0, bcm56786_a0, bcm56786_a0, \ + "Trident4-X9", "BCM56780", \ + "5.6 Tb/s 96x50G-PAM4/32x35G-NRZ Programmable Switch w/MACsec", 0, 0) +#endif +#endif + +#if BCMDRD_CONFIG_INCLUDE_BCM56788_A0 == 1 || defined(BCMDRD_DEVLIST_OVERRIDE) +#ifdef BCMDRD_DEVLIST_INCLUDE_ALL +BCMDRD_DEVLIST_ENTRY(BCM56788, BCM56788_VENDOR_ID, BCM56788_DEVICE_ID, BCM56788_REV_A0, \ + 0, 0, \ + bcm56780_a0, bcm56788_a0, bcm56788_a0, \ + "Trident4-X9", "BCM56780", \ + "8 Tb/s 160x50G-PAM4 Programmable Switch w/MACsec w/MTop", 0, 0) +#endif +#endif + +#if BCMDRD_CONFIG_INCLUDE_BCM56789_A0 == 1 || defined(BCMDRD_DEVLIST_OVERRIDE) +#ifdef BCMDRD_DEVLIST_INCLUDE_ALL +BCMDRD_DEVLIST_ENTRY(BCM56789, BCM56789_VENDOR_ID, BCM56789_DEVICE_ID, BCM56789_REV_A0, \ + 0, 0, \ + bcm56780_a0, bcm56789_a0, bcm56789_a0, \ + "Trident4-X9", "BCM56780", \ + "8 Tb/s 160x50G-PAM4 Programmable Switch w/MTop", 0, 0) +#endif +#endif + +#if BCMDRD_CONFIG_INCLUDE_BCM56880_A0 == 1 || defined(BCMDRD_DEVLIST_OVERRIDE) +BCMDRD_DEVLIST_ENTRY(BCM56880, BCM56880_VENDOR_ID, BCM56880_DEVICE_ID, BCM56880_REV_A0, \ + 0, 0, \ + bcm56880_a0, bcm56880_a0, bcm56880_a0, \ + "Trident4", "BCM56880", \ + "12.8 Tb/s Switch Fabric 128x100G/64x200G/32x400G Multilayer Switch", 0, 0) +#endif + +#if BCMDRD_CONFIG_INCLUDE_BCM56880_B0 == 1 || defined(BCMDRD_DEVLIST_OVERRIDE) +#ifdef BCMDRD_DEVLIST_INCLUDE_ALL +BCMDRD_DEVLIST_ENTRY(BCM56880, BCM56880_VENDOR_ID, BCM56880_DEVICE_ID, BCM56880_REV_B0, \ + 0, 0, \ + bcm56880_a0, bcm56880_a0, bcm56880_b0, \ + "Trident4", "BCM56880", \ + "12.8 Tb/s Switch Fabric 128x100G/64x200G/32x400G Multilayer Switch", 0, 0) +#endif +#endif + +#if BCMDRD_CONFIG_INCLUDE_BCM56881_A0 == 1 || defined(BCMDRD_DEVLIST_OVERRIDE) +#ifdef BCMDRD_DEVLIST_INCLUDE_ALL +BCMDRD_DEVLIST_ENTRY(BCM56881, BCM56881_VENDOR_ID, BCM56881_DEVICE_ID, BCM56881_REV_A0, \ + 0, 0, \ + bcm56880_a0, bcm56881_a0, bcm56881_a0, \ + "Trident4", "BCM56880", \ + "12.8 Tb/s Switch Fabric 128x100G/64x200G/32x400G Multilayer Switch", 0, 0) +#endif +#endif + +#if BCMDRD_CONFIG_INCLUDE_BCM56881_B0 == 1 || defined(BCMDRD_DEVLIST_OVERRIDE) +#ifdef BCMDRD_DEVLIST_INCLUDE_ALL +BCMDRD_DEVLIST_ENTRY(BCM56881, BCM56881_VENDOR_ID, BCM56881_DEVICE_ID, BCM56881_REV_B0, \ + 0, 0, \ + bcm56880_a0, bcm56881_a0, bcm56881_b0, \ + "Trident4", "BCM56880", \ + "12.8 Tb/s Switch Fabric 128x100G/64x200G/32x400G Multilayer Switch", 0, 0) +#endif +#endif + +#if BCMDRD_CONFIG_INCLUDE_BCM56883_A0 == 1 || defined(BCMDRD_DEVLIST_OVERRIDE) +#ifdef BCMDRD_DEVLIST_INCLUDE_ALL +BCMDRD_DEVLIST_ENTRY(BCM56883, BCM56883_VENDOR_ID, BCM56883_DEVICE_ID, BCM56883_REV_A0, \ + 0, 0, \ + bcm56880_a0, bcm56883_a0, bcm56883_a0, \ + "Trident4", "BCM56880", \ + "8.0 Tb/s Switch Fabric 80x100G/40x200G/20x400G Multilayer Switch", 0, 0) +#endif +#endif + +#if BCMDRD_CONFIG_INCLUDE_BCM56883_B0 == 1 || defined(BCMDRD_DEVLIST_OVERRIDE) +#ifdef BCMDRD_DEVLIST_INCLUDE_ALL +BCMDRD_DEVLIST_ENTRY(BCM56883, BCM56883_VENDOR_ID, BCM56883_DEVICE_ID, BCM56883_REV_B0, \ + 0, 0, \ + bcm56880_a0, bcm56883_a0, bcm56883_b0, \ + "Trident4", "BCM56880", \ + "8.0 Tb/s Switch Fabric 80x100G/40x200G/20x400G Multilayer Switch", 0, 0) +#endif +#endif + +#if BCMDRD_CONFIG_INCLUDE_BCM56889_A0 == 1 || defined(BCMDRD_DEVLIST_OVERRIDE) +#ifdef BCMDRD_DEVLIST_INCLUDE_ALL +BCMDRD_DEVLIST_ENTRY(BCM56889, BCM56889_VENDOR_ID, BCM56889_DEVICE_ID, BCM56889_REV_A0, \ + 0, 0, \ + bcm56880_a0, bcm56889_a0, bcm56889_a0, \ + "Trident4", "BCM56880", \ + "12.8 Tb/s Switch Fabric 128x100G/64x200G/32x400G Multilayer Switch", 0, 0) +#endif +#endif + +#if BCMDRD_CONFIG_INCLUDE_BCM56889_B0 == 1 || defined(BCMDRD_DEVLIST_OVERRIDE) +#ifdef BCMDRD_DEVLIST_INCLUDE_ALL +BCMDRD_DEVLIST_ENTRY(BCM56889, BCM56889_VENDOR_ID, BCM56889_DEVICE_ID, BCM56889_REV_B0, \ + 0, 0, \ + bcm56880_a0, bcm56889_a0, bcm56889_b0, \ + "Trident4", "BCM56880", \ + "12.8 Tb/s Switch Fabric 128x100G/64x200G/32x400G Multilayer Switch", 0, 0) +#endif +#endif + +#if BCMDRD_CONFIG_INCLUDE_BCM56990_A0 == 1 || defined(BCMDRD_DEVLIST_OVERRIDE) +BCMDRD_DEVLIST_ENTRY(BCM56990, BCM56990_VENDOR_ID, BCM56990_DEVICE_ID, BCM56990_REV_A0, \ + 0, 0, \ + bcm56990_a0, bcm56990_a0, bcm56990_a0, \ + "Tomahawk4", "BCM56990", \ + "25.6 Tbps Multilayer Switch", 0, 0) +#endif + +#if BCMDRD_CONFIG_INCLUDE_BCM56990_B0 == 1 || defined(BCMDRD_DEVLIST_OVERRIDE) +BCMDRD_DEVLIST_ENTRY(BCM56990, BCM56990_VENDOR_ID, BCM56990_DEVICE_ID, BCM56990_REV_B0, \ + 0, 0, \ + bcm56990_b0, bcm56990_b0, bcm56990_b0, \ + "Tomahawk4", "BCM56990", \ + "25.6 Tbps Multilayer Switch", 0, 0) +#endif + +#if BCMDRD_CONFIG_INCLUDE_BCM56992_B0 == 1 || defined(BCMDRD_DEVLIST_OVERRIDE) +#ifdef BCMDRD_DEVLIST_INCLUDE_ALL +BCMDRD_DEVLIST_ENTRY(BCM56992, BCM56992_VENDOR_ID, BCM56992_DEVICE_ID, BCM56992_REV_B0, \ + 0, 0, \ + bcm56990_b0, bcm56992_b0, bcm56992_b0, \ + "Tomahawk4", "BCM56990", \ + "25.6 Tbps Multilayer Switch", 0, 0) +#endif +#endif + +#if BCMDRD_CONFIG_INCLUDE_BCM56996_A0 == 1 || defined(BCMDRD_DEVLIST_OVERRIDE) +BCMDRD_DEVLIST_ENTRY(BCM56996, BCM56996_VENDOR_ID, BCM56996_DEVICE_ID, BCM56996_REV_A0, \ + 0, 0, \ + bcm56996_a0, bcm56996_a0, bcm56996_a0, \ + "Tomahawk4G", "BCM56996", \ + "25.6 Tbps Multilayer Switch", 0, 0) +#endif + +#if BCMDRD_CONFIG_INCLUDE_BCM56997_A0 == 1 || defined(BCMDRD_DEVLIST_OVERRIDE) +#ifdef BCMDRD_DEVLIST_INCLUDE_ALL +BCMDRD_DEVLIST_ENTRY(BCM56997, BCM56997_VENDOR_ID, BCM56997_DEVICE_ID, BCM56997_REV_A0, \ + 0, 0, \ + bcm56996_a0, bcm56997_a0, bcm56997_a0, \ + "Tomahawk4G", "BCM56996", \ + "12.8 Tbps Multilayer Switch", 0, 0) +#endif +#endif + +/* End BCMDRD_DEVLIST_ENTRY Macros */ + +#ifdef BCMDRD_DEVLIST_INCLUDE_ALL +#undef BCMDRD_DEVLIST_INCLUDE_ALL +#endif +#ifdef BCMDRD_DEVLIST_OVERRIDE +#undef BCMDRD_DEVLIST_OVERRIDE +#endif +#undef BCMDRD_DEVLIST_ENTRY +#endif /* BCMDRD_DEVLIST_ENTRY */ diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmdrd/include/bcmdrd_config.h b/platform/broadcom/saibcm-modules/sdklt/bcmdrd/include/bcmdrd_config.h new file mode 100644 index 000000000000..68e5a0891098 --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/bcmdrd/include/bcmdrd_config.h @@ -0,0 +1,166 @@ +/* + * $Copyright: Copyright 2018-2020 Broadcom. All rights reserved. + * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * A copy of the GNU General Public License version 2 (GPLv2) can + * be found in the LICENSES folder.$ + * + * DO NOT EDIT THIS FILE! + * This file will be auto-generated in the near future. + * + * This config file defines all compilation-time specifications for + * the BCMDRD. + * + * Reasonable defaults are provided for all configuration options + * where appropriate. + * + * You need not edit this file directly to change your configuration, + * nor is modifying this file advised -- so doing will require + * manually merging whenever the BCMDRD is upgraded. + * + * You should provide your own configuration options or overrides + * through a combination of: + * + * 1. The compiler command line, such as -D{OPTION}={VALUE} + * + * 2. Create your own custom configuration file: + * a) Create a file called 'bcmdrd_custom_config.h' + * b) Define all custom settings, using this file as + * the reference + * c) Add -DBCMDRD_INCLUDE_CUSTOM_CONFIG to your + * compilation + * d) Make sure the compilation include path includes + * 'bcmdrd_custom_config.h' + * + */ + +#ifndef BCMDRD_CONFIG_H +#define BCMDRD_CONFIG_H + + +/* + * Include system config file if specified: + */ +#ifdef BCMDRD_INCLUDE_CUSTOM_CONFIG +#include +#endif + + +/* + * OPTIONAL configuration and feature values. + * Defaults are provided for all non-specified values. + */ + +/* Maximum number of chips supported */ +#ifndef BCMDRD_CONFIG_MAX_UNITS +#define BCMDRD_CONFIG_MAX_UNITS 8 +#endif + +/* Maximum number of ports per chip supported */ +#ifndef BCMDRD_CONFIG_MAX_PORTS +#define BCMDRD_CONFIG_MAX_PORTS 576 +#endif + +/* Maximum number of SCHAN polls */ +#ifndef BCMDRD_CONFIG_SCHAN_MAX_POLLS +#define BCMDRD_CONFIG_SCHAN_MAX_POLLS 100000 +#endif + +/* Maximum number of MIIM polls */ +#ifndef BCMDRD_CONFIG_MIIM_MAX_POLLS +#define BCMDRD_CONFIG_MIIM_MAX_POLLS 100000 +#endif + +/* Direct access to memory-mapped registers */ +#ifndef BCMDRD_CONFIG_MEMMAP_DIRECT +#define BCMDRD_CONFIG_MEMMAP_DIRECT 0 +#endif + +/* + * Include chip symbol tables for the debug shell. + * + * No symbolic debugging (register/memory names) will be available + * without this defined. + * + * You should enable at least these symbols if you can afford the + * space. + * + * This define is required to get any symbols at all. + * + * If you only wish to include symbols for a subset of chips in the + * system (probably for code space reasons), you can define the + * following for each chip whose symbols you wish to EXCLUDE: + * + * BCMDRD_CONFIG_EXCLUDE_CHIP_SYMBOLS_ + * + */ +#ifndef BCMDRD_CONFIG_INCLUDE_CHIP_SYMBOLS +#define BCMDRD_CONFIG_INCLUDE_CHIP_SYMBOLS 1 +#endif + +/* + * Include register and memory field information for the debug shell. + * + * This provides encoding, decoding, and displaying individual field + * values for each register and memory. + * + * Requires more code space than just the chip symbols alone. + * + * The per-chip exclusion define + * (BCMDRD_CONFIG_EXCLUDE_FIELD_INFO_) also applies. + */ +#ifndef BCMDRD_CONFIG_INCLUDE_FIELD_INFO +#define BCMDRD_CONFIG_INCLUDE_FIELD_INFO 1 +#endif + +/* + * Include alternative symbol names for registers and memories. + * + * Mainly for internal Broadcom use, so you can safely leave this + * option off. + */ +#ifndef BCMDRD_CONFIG_INCLUDE_ALIAS_NAMES +#define BCMDRD_CONFIG_INCLUDE_ALIAS_NAMES 1 +#endif + +#endif /* BCMDRD_CONFIG_H */ + +#ifdef CONFIG_OPTION +#ifdef BCMDRD_INCLUDE_CUSTOM_CONFIG +CONFIG_OPTION(BCMDRD_INCLUDE_CUSTOM_CONFIG) +#endif +#ifdef BCMDRD_CONFIG_MAX_UNITS +CONFIG_OPTION(BCMDRD_CONFIG_MAX_UNITS) +#endif +#ifdef BCMDRD_CONFIG_MAX_PORTS +CONFIG_OPTION(BCMDRD_CONFIG_MAX_PORTS) +#endif +#ifdef BCMDRD_CONFIG_SCHAN_MAX_POLLS +CONFIG_OPTION(BCMDRD_CONFIG_SCHAN_MAX_POLLS) +#endif +#ifdef BCMDRD_CONFIG_MIIM_MAX_POLLS +CONFIG_OPTION(BCMDRD_CONFIG_MIIM_MAX_POLLS) +#endif +#ifdef BCMDRD_CONFIG_MEMMAP_DIRECT +CONFIG_OPTION(BCMDRD_CONFIG_MEMMAP_DIRECT) +#endif +#ifdef BCMDRD_CONFIG_INCLUDE_CHIP_SYMBOLS +CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_CHIP_SYMBOLS) +#endif +#ifdef BCMDRD_CONFIG_INCLUDE_FIELD_INFO +CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_FIELD_INFO) +#endif +#ifdef BCMDRD_CONFIG_INCLUDE_ALIAS_NAMES +CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_ALIAS_NAMES) +#endif +#endif /* CONFIG_OPTION */ +#include "bcmdrd_config_chips.h" diff --git a/platform/broadcom/saibcm-modules/sdklt/bcmdrd/include/bcmdrd_config_chips.h b/platform/broadcom/saibcm-modules/sdklt/bcmdrd/include/bcmdrd_config_chips.h new file mode 100644 index 000000000000..5b45879c90e9 --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/bcmdrd/include/bcmdrd_config_chips.h @@ -0,0 +1,545 @@ +/* + * DO NOT EDIT THIS FILE! + * This file is auto-generated. + * Edits to this file will be lost when it is regenerated. + * Tool: INTERNAL/drd/instpkgs.pl + * + * $Copyright: Copyright 2018-2020 Broadcom. All rights reserved. + * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * A copy of the GNU General Public License version 2 (GPLv2) can + * be found in the LICENSES folder.$ + */ + +/* + * Chip inclusion and exclusion support within the BCMDRD can be + * specified as a combination of the following defines: + * + * (1) #define BCMDRD_CONFIG_INCLUDE_ [1|0] + * -- Include or exclude all revisions of the given device + * Example: #define BCMDRD_CONFIG_INCLUDE_BCM56780 1 + * + * (2) #define BCMDRD_CONFIG_INCLUDE__X [1|0] + * -- Include or exclude all versions of the given revision + * Example: #define BCMDRD_CONFIG_INCLUDE_BCM56780_Ax 0 + * #define BCMDRD_CONFIG_INCLUde_BCM56780_Bx 1 + * + * (3) #define BCMDRD_CONFIG_INCLUDE_ [1|0] + * -- Include or exclude an exact device + * Example: #define BCMDRD_CONFIG_INCLUDE_BCM56780_A0 1 + * #define BCMDRD_CONFIG_INCLUDE_BCM56780_A1 0 + * + * + * The value of BCMDRD_CONFIG_INCLUDE_CHIP_DEFAULT is used for any + * chips which are left unspecified. Set this value to 1 or 0 to + * include or exclude all chips by default. + * + */ + +#ifndef BCMDRD_CONFIG_CHIPS_H +#define BCMDRD_CONFIG_CHIPS_H + +/* This determines whether a chip is included or excluded by default */ +#ifndef BCMDRD_CONFIG_INCLUDE_CHIP_DEFAULT +#define BCMDRD_CONFIG_INCLUDE_CHIP_DEFAULT 1 +#endif + +/* + * Default configuration and dependencies for all chips + */ + +/* + * BCM56780 + */ + +/* Sets the default include state if it was not given */ +#ifndef BCMDRD_CONFIG_INCLUDE_BCM56780 +#define BCMDRD_CONFIG_INCLUDE_BCM56780 BCMDRD_CONFIG_INCLUDE_CHIP_DEFAULT +#endif +/* Resolve revision dependencies */ +#ifndef BCMDRD_CONFIG_INCLUDE_BCM56780_Ax +#define BCMDRD_CONFIG_INCLUDE_BCM56780_Ax BCMDRD_CONFIG_INCLUDE_BCM56780 +#endif +#ifndef BCMDRD_CONFIG_INCLUDE_BCM56780_A0 +#define BCMDRD_CONFIG_INCLUDE_BCM56780_A0 BCMDRD_CONFIG_INCLUDE_BCM56780_Ax +#endif + + +/* + * BCM56782 + */ + +/* Sets the default include state if it was not given */ +#ifndef BCMDRD_CONFIG_INCLUDE_BCM56782 +#define BCMDRD_CONFIG_INCLUDE_BCM56782 BCMDRD_CONFIG_INCLUDE_CHIP_DEFAULT +#endif +/* Resolve revision dependencies */ +#ifndef BCMDRD_CONFIG_INCLUDE_BCM56782_Ax +#define BCMDRD_CONFIG_INCLUDE_BCM56782_Ax BCMDRD_CONFIG_INCLUDE_BCM56782 +#endif +#ifndef BCMDRD_CONFIG_INCLUDE_BCM56782_A0 +#define BCMDRD_CONFIG_INCLUDE_BCM56782_A0 BCMDRD_CONFIG_INCLUDE_BCM56782_Ax +#endif +/* Resolve all interchip dependencies */ +#if BCMDRD_CONFIG_INCLUDE_BCM56782_A0 == 1 +#ifndef BCMDRD_CONFIG_INCLUDE_BCM56780_A0 +#define BCMDRD_CONFIG_INCLUDE_BCM56780_A0 BCMDRD_CONFIG_INCLUDE_CHIP_DEFAULT +#endif +#if BCMDRD_CONFIG_INCLUDE_BCM56780_A0 != 1 +#undef BCMDRD_CONFIG_INCLUDE_BCM56780_A0 +#define BCMDRD_CONFIG_INCLUDE_BCM56780_A0 1 +#define BCMDRD_CONFIG_INCLUDE_BCM56780_A0_IMPLIED 1 +#endif +#endif + + +/* + * BCM56784 + */ + +/* Sets the default include state if it was not given */ +#ifndef BCMDRD_CONFIG_INCLUDE_BCM56784 +#define BCMDRD_CONFIG_INCLUDE_BCM56784 BCMDRD_CONFIG_INCLUDE_CHIP_DEFAULT +#endif +/* Resolve revision dependencies */ +#ifndef BCMDRD_CONFIG_INCLUDE_BCM56784_Ax +#define BCMDRD_CONFIG_INCLUDE_BCM56784_Ax BCMDRD_CONFIG_INCLUDE_BCM56784 +#endif +#ifndef BCMDRD_CONFIG_INCLUDE_BCM56784_A0 +#define BCMDRD_CONFIG_INCLUDE_BCM56784_A0 BCMDRD_CONFIG_INCLUDE_BCM56784_Ax +#endif +/* Resolve all interchip dependencies */ +#if BCMDRD_CONFIG_INCLUDE_BCM56784_A0 == 1 +#ifndef BCMDRD_CONFIG_INCLUDE_BCM56780_A0 +#define BCMDRD_CONFIG_INCLUDE_BCM56780_A0 BCMDRD_CONFIG_INCLUDE_CHIP_DEFAULT +#endif +#if BCMDRD_CONFIG_INCLUDE_BCM56780_A0 != 1 +#undef BCMDRD_CONFIG_INCLUDE_BCM56780_A0 +#define BCMDRD_CONFIG_INCLUDE_BCM56780_A0 1 +#define BCMDRD_CONFIG_INCLUDE_BCM56780_A0_IMPLIED 1 +#endif +#endif + + +/* + * BCM56786 + */ + +/* Sets the default include state if it was not given */ +#ifndef BCMDRD_CONFIG_INCLUDE_BCM56786 +#define BCMDRD_CONFIG_INCLUDE_BCM56786 BCMDRD_CONFIG_INCLUDE_CHIP_DEFAULT +#endif +/* Resolve revision dependencies */ +#ifndef BCMDRD_CONFIG_INCLUDE_BCM56786_Ax +#define BCMDRD_CONFIG_INCLUDE_BCM56786_Ax BCMDRD_CONFIG_INCLUDE_BCM56786 +#endif +#ifndef BCMDRD_CONFIG_INCLUDE_BCM56786_A0 +#define BCMDRD_CONFIG_INCLUDE_BCM56786_A0 BCMDRD_CONFIG_INCLUDE_BCM56786_Ax +#endif +/* Resolve all interchip dependencies */ +#if BCMDRD_CONFIG_INCLUDE_BCM56786_A0 == 1 +#ifndef BCMDRD_CONFIG_INCLUDE_BCM56780_A0 +#define BCMDRD_CONFIG_INCLUDE_BCM56780_A0 BCMDRD_CONFIG_INCLUDE_CHIP_DEFAULT +#endif +#if BCMDRD_CONFIG_INCLUDE_BCM56780_A0 != 1 +#undef BCMDRD_CONFIG_INCLUDE_BCM56780_A0 +#define BCMDRD_CONFIG_INCLUDE_BCM56780_A0 1 +#define BCMDRD_CONFIG_INCLUDE_BCM56780_A0_IMPLIED 1 +#endif +#endif + + +/* + * BCM56788 + */ + +/* Sets the default include state if it was not given */ +#ifndef BCMDRD_CONFIG_INCLUDE_BCM56788 +#define BCMDRD_CONFIG_INCLUDE_BCM56788 BCMDRD_CONFIG_INCLUDE_CHIP_DEFAULT +#endif +/* Resolve revision dependencies */ +#ifndef BCMDRD_CONFIG_INCLUDE_BCM56788_Ax +#define BCMDRD_CONFIG_INCLUDE_BCM56788_Ax BCMDRD_CONFIG_INCLUDE_BCM56788 +#endif +#ifndef BCMDRD_CONFIG_INCLUDE_BCM56788_A0 +#define BCMDRD_CONFIG_INCLUDE_BCM56788_A0 BCMDRD_CONFIG_INCLUDE_BCM56788_Ax +#endif +/* Resolve all interchip dependencies */ +#if BCMDRD_CONFIG_INCLUDE_BCM56788_A0 == 1 +#ifndef BCMDRD_CONFIG_INCLUDE_BCM56780_A0 +#define BCMDRD_CONFIG_INCLUDE_BCM56780_A0 BCMDRD_CONFIG_INCLUDE_CHIP_DEFAULT +#endif +#if BCMDRD_CONFIG_INCLUDE_BCM56780_A0 != 1 +#undef BCMDRD_CONFIG_INCLUDE_BCM56780_A0 +#define BCMDRD_CONFIG_INCLUDE_BCM56780_A0 1 +#define BCMDRD_CONFIG_INCLUDE_BCM56780_A0_IMPLIED 1 +#endif +#endif + + +/* + * BCM56789 + */ + +/* Sets the default include state if it was not given */ +#ifndef BCMDRD_CONFIG_INCLUDE_BCM56789 +#define BCMDRD_CONFIG_INCLUDE_BCM56789 BCMDRD_CONFIG_INCLUDE_CHIP_DEFAULT +#endif +/* Resolve revision dependencies */ +#ifndef BCMDRD_CONFIG_INCLUDE_BCM56789_Ax +#define BCMDRD_CONFIG_INCLUDE_BCM56789_Ax BCMDRD_CONFIG_INCLUDE_BCM56789 +#endif +#ifndef BCMDRD_CONFIG_INCLUDE_BCM56789_A0 +#define BCMDRD_CONFIG_INCLUDE_BCM56789_A0 BCMDRD_CONFIG_INCLUDE_BCM56789_Ax +#endif +/* Resolve all interchip dependencies */ +#if BCMDRD_CONFIG_INCLUDE_BCM56789_A0 == 1 +#ifndef BCMDRD_CONFIG_INCLUDE_BCM56780_A0 +#define BCMDRD_CONFIG_INCLUDE_BCM56780_A0 BCMDRD_CONFIG_INCLUDE_CHIP_DEFAULT +#endif +#if BCMDRD_CONFIG_INCLUDE_BCM56780_A0 != 1 +#undef BCMDRD_CONFIG_INCLUDE_BCM56780_A0 +#define BCMDRD_CONFIG_INCLUDE_BCM56780_A0 1 +#define BCMDRD_CONFIG_INCLUDE_BCM56780_A0_IMPLIED 1 +#endif +#endif + + +/* + * BCM56880 + */ + +/* Sets the default include state if it was not given */ +#ifndef BCMDRD_CONFIG_INCLUDE_BCM56880 +#define BCMDRD_CONFIG_INCLUDE_BCM56880 BCMDRD_CONFIG_INCLUDE_CHIP_DEFAULT +#endif +/* Resolve revision dependencies */ +#ifndef BCMDRD_CONFIG_INCLUDE_BCM56880_Ax +#define BCMDRD_CONFIG_INCLUDE_BCM56880_Ax BCMDRD_CONFIG_INCLUDE_BCM56880 +#endif +#ifndef BCMDRD_CONFIG_INCLUDE_BCM56880_A0 +#define BCMDRD_CONFIG_INCLUDE_BCM56880_A0 BCMDRD_CONFIG_INCLUDE_BCM56880_Ax +#endif +#ifndef BCMDRD_CONFIG_INCLUDE_BCM56880_Bx +#define BCMDRD_CONFIG_INCLUDE_BCM56880_Bx BCMDRD_CONFIG_INCLUDE_BCM56880 +#endif +#ifndef BCMDRD_CONFIG_INCLUDE_BCM56880_B0 +#define BCMDRD_CONFIG_INCLUDE_BCM56880_B0 BCMDRD_CONFIG_INCLUDE_BCM56880_Bx +#endif +/* Resolve all interchip dependencies */ +#if BCMDRD_CONFIG_INCLUDE_BCM56880_B0 == 1 +#ifndef BCMDRD_CONFIG_INCLUDE_BCM56880_A0 +#define BCMDRD_CONFIG_INCLUDE_BCM56880_A0 BCMDRD_CONFIG_INCLUDE_CHIP_DEFAULT +#endif +#if BCMDRD_CONFIG_INCLUDE_BCM56880_A0 != 1 +#undef BCMDRD_CONFIG_INCLUDE_BCM56880_A0 +#define BCMDRD_CONFIG_INCLUDE_BCM56880_A0 1 +#define BCMDRD_CONFIG_INCLUDE_BCM56880_A0_IMPLIED 1 +#endif +#endif + + +/* + * BCM56881 + */ + +/* Sets the default include state if it was not given */ +#ifndef BCMDRD_CONFIG_INCLUDE_BCM56881 +#define BCMDRD_CONFIG_INCLUDE_BCM56881 BCMDRD_CONFIG_INCLUDE_CHIP_DEFAULT +#endif +/* Resolve revision dependencies */ +#ifndef BCMDRD_CONFIG_INCLUDE_BCM56881_Ax +#define BCMDRD_CONFIG_INCLUDE_BCM56881_Ax BCMDRD_CONFIG_INCLUDE_BCM56881 +#endif +#ifndef BCMDRD_CONFIG_INCLUDE_BCM56881_A0 +#define BCMDRD_CONFIG_INCLUDE_BCM56881_A0 BCMDRD_CONFIG_INCLUDE_BCM56881_Ax +#endif +#ifndef BCMDRD_CONFIG_INCLUDE_BCM56881_Bx +#define BCMDRD_CONFIG_INCLUDE_BCM56881_Bx BCMDRD_CONFIG_INCLUDE_BCM56881 +#endif +#ifndef BCMDRD_CONFIG_INCLUDE_BCM56881_B0 +#define BCMDRD_CONFIG_INCLUDE_BCM56881_B0 BCMDRD_CONFIG_INCLUDE_BCM56881_Bx +#endif +/* Resolve all interchip dependencies */ +#if BCMDRD_CONFIG_INCLUDE_BCM56881_A0 == 1 +#ifndef BCMDRD_CONFIG_INCLUDE_BCM56880_A0 +#define BCMDRD_CONFIG_INCLUDE_BCM56880_A0 BCMDRD_CONFIG_INCLUDE_CHIP_DEFAULT +#endif +#if BCMDRD_CONFIG_INCLUDE_BCM56880_A0 != 1 +#undef BCMDRD_CONFIG_INCLUDE_BCM56880_A0 +#define BCMDRD_CONFIG_INCLUDE_BCM56880_A0 1 +#define BCMDRD_CONFIG_INCLUDE_BCM56880_A0_IMPLIED 1 +#endif +#endif +#if BCMDRD_CONFIG_INCLUDE_BCM56881_B0 == 1 +#if BCMDRD_CONFIG_INCLUDE_BCM56880_A0 != 1 +#undef BCMDRD_CONFIG_INCLUDE_BCM56880_A0 +#define BCMDRD_CONFIG_INCLUDE_BCM56880_A0 1 +#define BCMDRD_CONFIG_INCLUDE_BCM56880_A0_IMPLIED 1 +#endif +#endif + + +/* + * BCM56883 + */ + +/* Sets the default include state if it was not given */ +#ifndef BCMDRD_CONFIG_INCLUDE_BCM56883 +#define BCMDRD_CONFIG_INCLUDE_BCM56883 BCMDRD_CONFIG_INCLUDE_CHIP_DEFAULT +#endif +/* Resolve revision dependencies */ +#ifndef BCMDRD_CONFIG_INCLUDE_BCM56883_Ax +#define BCMDRD_CONFIG_INCLUDE_BCM56883_Ax BCMDRD_CONFIG_INCLUDE_BCM56883 +#endif +#ifndef BCMDRD_CONFIG_INCLUDE_BCM56883_A0 +#define BCMDRD_CONFIG_INCLUDE_BCM56883_A0 BCMDRD_CONFIG_INCLUDE_BCM56883_Ax +#endif +#ifndef BCMDRD_CONFIG_INCLUDE_BCM56883_Bx +#define BCMDRD_CONFIG_INCLUDE_BCM56883_Bx BCMDRD_CONFIG_INCLUDE_BCM56883 +#endif +#ifndef BCMDRD_CONFIG_INCLUDE_BCM56883_B0 +#define BCMDRD_CONFIG_INCLUDE_BCM56883_B0 BCMDRD_CONFIG_INCLUDE_BCM56883_Bx +#endif +/* Resolve all interchip dependencies */ +#if BCMDRD_CONFIG_INCLUDE_BCM56883_A0 == 1 +#ifndef BCMDRD_CONFIG_INCLUDE_BCM56880_A0 +#define BCMDRD_CONFIG_INCLUDE_BCM56880_A0 BCMDRD_CONFIG_INCLUDE_CHIP_DEFAULT +#endif +#if BCMDRD_CONFIG_INCLUDE_BCM56880_A0 != 1 +#undef BCMDRD_CONFIG_INCLUDE_BCM56880_A0 +#define BCMDRD_CONFIG_INCLUDE_BCM56880_A0 1 +#define BCMDRD_CONFIG_INCLUDE_BCM56880_A0_IMPLIED 1 +#endif +#endif +#if BCMDRD_CONFIG_INCLUDE_BCM56883_B0 == 1 +#if BCMDRD_CONFIG_INCLUDE_BCM56880_A0 != 1 +#undef BCMDRD_CONFIG_INCLUDE_BCM56880_A0 +#define BCMDRD_CONFIG_INCLUDE_BCM56880_A0 1 +#define BCMDRD_CONFIG_INCLUDE_BCM56880_A0_IMPLIED 1 +#endif +#endif + + +/* + * BCM56889 + */ + +/* Sets the default include state if it was not given */ +#ifndef BCMDRD_CONFIG_INCLUDE_BCM56889 +#define BCMDRD_CONFIG_INCLUDE_BCM56889 BCMDRD_CONFIG_INCLUDE_CHIP_DEFAULT +#endif +/* Resolve revision dependencies */ +#ifndef BCMDRD_CONFIG_INCLUDE_BCM56889_Ax +#define BCMDRD_CONFIG_INCLUDE_BCM56889_Ax BCMDRD_CONFIG_INCLUDE_BCM56889 +#endif +#ifndef BCMDRD_CONFIG_INCLUDE_BCM56889_A0 +#define BCMDRD_CONFIG_INCLUDE_BCM56889_A0 BCMDRD_CONFIG_INCLUDE_BCM56889_Ax +#endif +#ifndef BCMDRD_CONFIG_INCLUDE_BCM56889_Bx +#define BCMDRD_CONFIG_INCLUDE_BCM56889_Bx BCMDRD_CONFIG_INCLUDE_BCM56889 +#endif +#ifndef BCMDRD_CONFIG_INCLUDE_BCM56889_B0 +#define BCMDRD_CONFIG_INCLUDE_BCM56889_B0 BCMDRD_CONFIG_INCLUDE_BCM56889_Bx +#endif +/* Resolve all interchip dependencies */ +#if BCMDRD_CONFIG_INCLUDE_BCM56889_A0 == 1 +#ifndef BCMDRD_CONFIG_INCLUDE_BCM56880_A0 +#define BCMDRD_CONFIG_INCLUDE_BCM56880_A0 BCMDRD_CONFIG_INCLUDE_CHIP_DEFAULT +#endif +#if BCMDRD_CONFIG_INCLUDE_BCM56880_A0 != 1 +#undef BCMDRD_CONFIG_INCLUDE_BCM56880_A0 +#define BCMDRD_CONFIG_INCLUDE_BCM56880_A0 1 +#define BCMDRD_CONFIG_INCLUDE_BCM56880_A0_IMPLIED 1 +#endif +#endif +#if BCMDRD_CONFIG_INCLUDE_BCM56889_B0 == 1 +#if BCMDRD_CONFIG_INCLUDE_BCM56880_A0 != 1 +#undef BCMDRD_CONFIG_INCLUDE_BCM56880_A0 +#define BCMDRD_CONFIG_INCLUDE_BCM56880_A0 1 +#define BCMDRD_CONFIG_INCLUDE_BCM56880_A0_IMPLIED 1 +#endif +#endif + + +/* + * BCM56990 + */ + +/* Sets the default include state if it was not given */ +#ifndef BCMDRD_CONFIG_INCLUDE_BCM56990 +#define BCMDRD_CONFIG_INCLUDE_BCM56990 BCMDRD_CONFIG_INCLUDE_CHIP_DEFAULT +#endif +/* Resolve revision dependencies */ +#ifndef BCMDRD_CONFIG_INCLUDE_BCM56990_Ax +#define BCMDRD_CONFIG_INCLUDE_BCM56990_Ax BCMDRD_CONFIG_INCLUDE_BCM56990 +#endif +#ifndef BCMDRD_CONFIG_INCLUDE_BCM56990_A0 +#define BCMDRD_CONFIG_INCLUDE_BCM56990_A0 BCMDRD_CONFIG_INCLUDE_BCM56990_Ax +#endif +#ifndef BCMDRD_CONFIG_INCLUDE_BCM56990_Bx +#define BCMDRD_CONFIG_INCLUDE_BCM56990_Bx BCMDRD_CONFIG_INCLUDE_BCM56990 +#endif +#ifndef BCMDRD_CONFIG_INCLUDE_BCM56990_B0 +#define BCMDRD_CONFIG_INCLUDE_BCM56990_B0 BCMDRD_CONFIG_INCLUDE_BCM56990_Bx +#endif + + +/* + * BCM56992 + */ + +/* Sets the default include state if it was not given */ +#ifndef BCMDRD_CONFIG_INCLUDE_BCM56992 +#define BCMDRD_CONFIG_INCLUDE_BCM56992 BCMDRD_CONFIG_INCLUDE_CHIP_DEFAULT +#endif +/* Resolve revision dependencies */ +#ifndef BCMDRD_CONFIG_INCLUDE_BCM56992_Bx +#define BCMDRD_CONFIG_INCLUDE_BCM56992_Bx BCMDRD_CONFIG_INCLUDE_BCM56992 +#endif +#ifndef BCMDRD_CONFIG_INCLUDE_BCM56992_B0 +#define BCMDRD_CONFIG_INCLUDE_BCM56992_B0 BCMDRD_CONFIG_INCLUDE_BCM56992_Bx +#endif +/* Resolve all interchip dependencies */ +#if BCMDRD_CONFIG_INCLUDE_BCM56992_B0 == 1 +#ifndef BCMDRD_CONFIG_INCLUDE_BCM56990_B0 +#define BCMDRD_CONFIG_INCLUDE_BCM56990_B0 BCMDRD_CONFIG_INCLUDE_CHIP_DEFAULT +#endif +#if BCMDRD_CONFIG_INCLUDE_BCM56990_B0 != 1 +#undef BCMDRD_CONFIG_INCLUDE_BCM56990_B0 +#define BCMDRD_CONFIG_INCLUDE_BCM56990_B0 1 +#define BCMDRD_CONFIG_INCLUDE_BCM56990_B0_IMPLIED 1 +#endif +#endif + + +/* + * BCM56996 + */ + +/* Sets the default include state if it was not given */ +#ifndef BCMDRD_CONFIG_INCLUDE_BCM56996 +#define BCMDRD_CONFIG_INCLUDE_BCM56996 BCMDRD_CONFIG_INCLUDE_CHIP_DEFAULT +#endif +/* Resolve revision dependencies */ +#ifndef BCMDRD_CONFIG_INCLUDE_BCM56996_Ax +#define BCMDRD_CONFIG_INCLUDE_BCM56996_Ax BCMDRD_CONFIG_INCLUDE_BCM56996 +#endif +#ifndef BCMDRD_CONFIG_INCLUDE_BCM56996_A0 +#define BCMDRD_CONFIG_INCLUDE_BCM56996_A0 BCMDRD_CONFIG_INCLUDE_BCM56996_Ax +#endif + + +/* + * BCM56997 + */ + +/* Sets the default include state if it was not given */ +#ifndef BCMDRD_CONFIG_INCLUDE_BCM56997 +#define BCMDRD_CONFIG_INCLUDE_BCM56997 BCMDRD_CONFIG_INCLUDE_CHIP_DEFAULT +#endif +/* Resolve revision dependencies */ +#ifndef BCMDRD_CONFIG_INCLUDE_BCM56997_Ax +#define BCMDRD_CONFIG_INCLUDE_BCM56997_Ax BCMDRD_CONFIG_INCLUDE_BCM56997 +#endif +#ifndef BCMDRD_CONFIG_INCLUDE_BCM56997_A0 +#define BCMDRD_CONFIG_INCLUDE_BCM56997_A0 BCMDRD_CONFIG_INCLUDE_BCM56997_Ax +#endif +/* Resolve all interchip dependencies */ +#if BCMDRD_CONFIG_INCLUDE_BCM56997_A0 == 1 +#ifndef BCMDRD_CONFIG_INCLUDE_BCM56996_A0 +#define BCMDRD_CONFIG_INCLUDE_BCM56996_A0 BCMDRD_CONFIG_INCLUDE_CHIP_DEFAULT +#endif +#if BCMDRD_CONFIG_INCLUDE_BCM56996_A0 != 1 +#undef BCMDRD_CONFIG_INCLUDE_BCM56996_A0 +#define BCMDRD_CONFIG_INCLUDE_BCM56996_A0 1 +#define BCMDRD_CONFIG_INCLUDE_BCM56996_A0_IMPLIED 1 +#endif +#endif + + +#endif /* BCMDRD_CONFIG_CHIPS_H */ + +/* + * CONFIG_OPTION Macros. Can be used to determine the build configuration. + */ + +#ifdef CONFIG_OPTION +CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56780) +CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56780_Ax) +CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56780_A0) +#ifdef BCMDRD_CONFIG_INCLUDE_BCM56780_A0_IMPLIED +CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56780_A0_IMPLIED) +#endif +CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56782) +CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56782_Ax) +CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56782_A0) +CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56784) +CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56784_Ax) +CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56784_A0) +CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56786) +CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56786_Ax) +CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56786_A0) +CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56788) +CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56788_Ax) +CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56788_A0) +CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56789) +CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56789_Ax) +CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56789_A0) +CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56880) +CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56880_Ax) +CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56880_A0) +CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56880_Bx) +CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56880_B0) +#ifdef BCMDRD_CONFIG_INCLUDE_BCM56880_A0_IMPLIED +CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56880_A0_IMPLIED) +#endif +CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56881) +CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56881_Ax) +CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56881_A0) +CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56881_Bx) +CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56881_B0) +CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56883) +CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56883_Ax) +CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56883_A0) +CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56883_Bx) +CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56883_B0) +CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56889) +CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56889_Ax) +CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56889_A0) +CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56889_Bx) +CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56889_B0) +CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56990) +CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56990_Ax) +CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56990_A0) +CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56990_Bx) +CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56990_B0) +#ifdef BCMDRD_CONFIG_INCLUDE_BCM56990_A0_IMPLIED +CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56990_A0_IMPLIED) +#endif +#ifdef BCMDRD_CONFIG_INCLUDE_BCM56990_B0_IMPLIED +CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56990_B0_IMPLIED) +#endif +CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56992) +CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56992_Bx) +CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56992_B0) +CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56996) +CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56996_Ax) +CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56996_A0) +#ifdef BCMDRD_CONFIG_INCLUDE_BCM56996_A0_IMPLIED +CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56996_A0_IMPLIED) +#endif +CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56997) +CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56997_Ax) +CONFIG_OPTION(BCMDRD_CONFIG_INCLUDE_BCM56997_A0) +#undef CONFIG_OPTION +#endif /* #ifdef CONFIG_OPTION */ diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/bde/Kbuild b/platform/broadcom/saibcm-modules/sdklt/linux/bde/Kbuild new file mode 100644 index 000000000000..76581c02eed2 --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/linux/bde/Kbuild @@ -0,0 +1,39 @@ +# -*- Kbuild -*- +# +# Linux kernel BDE module. +# +# $Copyright: Copyright 2018-2020 Broadcom. All rights reserved. +# The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# version 2 as published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# A copy of the GNU General Public License version 2 (GPLv2) can +# be found in the LICENSES folder.$ +# + +obj-m := linux_ngbde.o + +ccflags-y := $(LKM_CFLAGS) \ + -I$(SDK)/linux/include \ + -I$(SDK)/linux/bde \ + -I$(SDK)/bcmdrd/include + +linux_ngbde-y := ngbde_main.o \ + ngbde_kapi.o \ + ngbde_ioctl.o \ + ngbde_procfs.o \ + ngbde_pio.o \ + ngbde_iio.o \ + ngbde_dma.o \ + ngbde_intr.o \ + ngbde_pgmem.o \ + ngbde_pci_probe.o \ + ngbde_iproc_probe.o \ + ngbde_swdev.o diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/bde/Makefile b/platform/broadcom/saibcm-modules/sdklt/linux/bde/Makefile new file mode 100644 index 000000000000..590f4132306f --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/linux/bde/Makefile @@ -0,0 +1,33 @@ +# -*- Makefile -*- +# +# Linux kernel BDE module. +# +# $Copyright: Copyright 2018-2020 Broadcom. All rights reserved. +# The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# version 2 as published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# A copy of the GNU General Public License version 2 (GPLv2) can +# be found in the LICENSES folder.$ +# + +include Kbuild + +ifeq ($(KERNELRELEASE),) + +MOD_NAME = linux_ngbde + +include $(SDK)/make/lkm.mk + +endif + +.PHONY: distclean + +distclean: diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde.h b/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde.h new file mode 100644 index 000000000000..56e925f7098d --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde.h @@ -0,0 +1,836 @@ +/*! \file ngbde.h + * + * Shared definitions and APIs for NGBDE kernel module. + * + */ +/* + * $Copyright: Copyright 2018-2020 Broadcom. All rights reserved. + * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * A copy of the GNU General Public License version 2 (GPLv2) can + * be found in the LICENSES folder.$ + */ + +#ifndef NGBDE_H +#define NGBDE_H + +#include +#include + +/*! Module name. */ +#define MOD_NAME "linux_ngbde" + +/*! Major number for associated charcter device file. */ +#define MOD_MAJOR 120 + +/*! Read memory-mapped device register without byte-swap. */ +#define NGBDE_IOREAD32(_a) __raw_readl(_a) + +/*! Write memory-mapped device register without byte-swap. */ +#define NGBDE_IOWRITE32(_v, _a) __raw_writel(_v, _a) + +/*! Maximum number of I/O windows supported per device. */ +#define NGBDE_NUM_IOWIN_MAX 3 + +/*! Maximum number of DMA memory pools supported per device. */ +#define NGBDE_NUM_DMAPOOL_MAX 2 + +/*! Maximum number of IRQ status registers per interrupt source. */ +#define NGBDE_NUM_IRQ_REGS_MAX 16 + +/*! Maximum number of IRQ lines (MSI vectors) per device. */ +#define NGBDE_NUM_IRQS_MAX 1 + +/*! + * Maximum number of interrupt controller registers which may be + * written from both a user mode driver and a kernel mode driver. + * + * This feature is used when the kernel mode driver owns a subset of + * bits within a register, which is also used by the user mode driver. + * + * Both drivers must access such registers through a lock-protected + * access function. + */ +#define NGBDE_NUM_INTR_SHR_REGS_MAX 1 + +/*! I/O memory window definition. */ +struct ngbde_memwin_s { + + /*! Physical address of I/O window. */ + phys_addr_t addr; + + /*! Size of I/O window (in bytes). */ + phys_addr_t size; +}; + +/*! + * \brief Shared register value. + * + * This structure contains the current value of a register where user + * mode and kernel mode owns different bits within the same + * register. In this case access must be carefully controlled to avoid + * that one context overwrites the bits owned by the other context. + * + * The structure also contains the offset of the shared register in + * order to identify the register (in case there is more than one + * shared register). + */ +typedef struct ngbde_shr_reg_s { + + /*! Offset of the shared register. */ + uint32_t reg_offs; + + /*! Current value of the shared register. */ + uint32_t cur_val; + +} ngbde_shr_reg_t; + +/*! + * \brief Shared interrupt mask register control. + * + * This defines which bits of an interrupt mask register are owned by + * user mode context, and which are owned by kernel context. + * + * The structure contains the corresponding interrupt status register + * in order to allow identification of the interrupt mask register + * irrespective of the host CPU being used. + * + * For example, if the host CPU is connected via PCI, then we use one + * mask register, but if the host CPU is an embedded ARM CPU, then we + * use a different mask register (for the same interrupt status + * register). By using the status register to identify the shared mask + * register, the kernel mode driver does not need to know which host + * CPU it is running off. + */ +typedef struct ngbde_irq_reg_s { + + /*! Interrupt status register corresponding to the mask register. */ + uint32_t status_reg; + + /*! Shared interrupt mask register. */ + uint32_t mask_reg; + + /*! Mask identifying the register bits owned by the kernel mode driver. */ + uint32_t kmask; + +} ngbde_irq_reg_t; + +/*! + * \name Interrupt ACK register access flags. + * \anchor NGBDE_INTR_ACK_F_xxx + */ + +/*! \{ */ + +/*! ACK registers resides in PCI bridge I/O window. */ +#define NGBDE_INTR_ACK_F_PAXB (1 << 0) + +/*! \} */ + +/*! + * \brief Interrupt ACK register control. + * + * The structure contains the corresponding register offset + * and value in order to acknowledge interrupt in kernel driver. + * + * For example, if the host CPU is connected via PCI, then we use one + * ACK register, but if the host CPU is an embedded ARM CPU, then we + * use a different ACK register. + */ +typedef struct ngbde_intr_ack_reg_s { + + /*! Ack register offset. */ + uint32_t ack_reg; + + /*! Ack value. */ + uint32_t ack_val; + + /*! Flags to indicate ack_reg resides in PCI bridge window. */ + uint32_t flags; + +} ngbde_intr_ack_reg_t; + +/*! + * \brief BDE interrupt handler. + * + * The BDE will use a function of this type to register an interrupt + * handler with the Linux kernel. + * + * \param [in] data Interrupt handler context. + * + * \retval 0 Interrupt not recognized. + * \retval 1 Interrupt recognized and handled. + */ +typedef int (*ngbde_isr_f)(void *data); + +/*! + * \brief Kernel interrupt control. + * + * This structure controls the sharing of interrupt processing between + * a user mode thread and a kernel mode interrupt handler. + */ +typedef struct ngbde_intr_ctrl_s { + + /*! Handle for device I/O (for writing interrupt registers). */ + uint8_t *iomem; + + /*! Kernel device number (similar to user mode unit number). */ + int kdev; + + /*! Indicates that our interrupt handler is connected to the kernel. */ + int irq_active; + + /*! Interrupt number (IRQ# or MSI vector). */ + int irq_vect; + + /*! Number of interrupt status/mask register pairs. */ + int num_regs; + + /*! Interrupt status/mask register pairs for this device. */ + ngbde_irq_reg_t regs[NGBDE_NUM_IRQ_REGS_MAX]; + + /*! Interrupt ACK register/value for this device. */ + ngbde_intr_ack_reg_t intr_ack; + + /*! Wait queue for user mode interrupt thread. */ + wait_queue_head_t user_thread_wq; + + /*! Flag to wake up user mode interrupt thread. */ + atomic_t run_user_thread; + + /*! Primary interrupt handler. */ + ngbde_isr_f isr_func; + + /*! Context for primary interrupt handler. */ + void *isr_data; + +} ngbde_intr_ctrl_t; + +/*! Convenience macro for 1 kilobyte. */ +#define ONE_KB 1024 + +/*! Convenience macro for 1 megabyte. */ +#define ONE_MB (1024*1024) + +/*! + * \name DMA allocation types. + * \anchor NGBDE_DMA_T_xxx + */ + +/*! \{ */ + +/*! + * Do not allocate any DMA memory. + */ +#define NGBDE_DMA_T_NONE 0 + +/*! + * Try different allocation methods until DMA memory is successfully + * allocated. + */ +#define NGBDE_DMA_T_AUTO 1 + +/*! Use kernel DMA API (dma_alloc_coherent). */ +#define NGBDE_DMA_T_KAPI 2 + +/*! Use page allocator and map to physical address manually. */ +#define NGBDE_DMA_T_PGMEM 3 + +/*! \} */ + +/*! DMA memory allocation control structure. */ +typedef struct ngbde_dmactrl_s { + + /*! Requested size of DMA memory block (in bytes). */ + size_t size; + + /*! Kernel flags for memory allocation. */ + gfp_t flags; + + /*! Preferred DMA memory type (NGBDE_DMA_T_xxx). */ + int pref_type; + + /*! Kernel device for DMA memory management. */ + struct device *dev; + +} ngbde_dmactrl_t; + +/*! DMA memory descriptor. */ +typedef struct ngbde_dmamem_s { + + /*! Logical address of DMA memory block. */ + void *vaddr; + + /*! Physical address of DMA memory block. */ + dma_addr_t paddr; + + /*! Bus address of DMA memory block. */ + dma_addr_t baddr; + + /*! Actual size of DMA memory block (in bytes). */ + size_t size; + + /*! Actual DMA memory type (NGBDE_DMA_T_xxx). */ + int type; + + /*! Kernel device for DMA memory management. */ + struct device *dev; + +} ngbde_dmamem_t; + +/*! DMA memory pool. */ +typedef struct ngbde_dmapool_s { + + /*! DMA control parameters. */ + struct ngbde_dmactrl_s dmactrl; + + /*! DMA memory resources. */ + struct ngbde_dmamem_s dmamem; + +} ngbde_dmapool_t; + +/*! Switch device descriptor. */ +struct ngbde_dev_s { + + /*! Vendor ID (typically PCI vendor ID). */ + uint16_t vendor_id; + + /*! Device ID (typically PCI device ID). */ + uint16_t device_id; + + /*! Device revision (typically PCI revision). */ + uint16_t revision; + + /*! Additional device identification when primary ID is not unique. */ + uint16_t model; + + /*! Bus number (typically PCI bus number). */ + int bus_no; + + /*! Slot number (typically PCI slot number). */ + int slot_no; + + /*! Interrupt line associated with this device. */ + int irq_line; + + /*! Use MSI interrupts with this device. */ + int use_msi; + + /*! Non-zero if device was removed. */ + int inactive; + + /*! Physical I/O window for kernel driver device access. */ + struct ngbde_memwin_s pio_win; + + /*! Memory mapped I/O window for kernel driver device access. */ + uint8_t *pio_mem; + + /*! Physical I/O window for interrupt controller access. */ + struct ngbde_memwin_s iio_win; + + /*! Memory mapped I/O window for interrupt controller access. */ + uint8_t *iio_mem; + + /*! Physical I/O window for device PCI bridge access. */ + struct ngbde_memwin_s paxb_win; + + /*! Memory mapped I/O window for device PCI bridge access. */ + uint8_t *paxb_mem; + + /*! Current value of shared register (typically an IRQ mask register). */ + struct ngbde_shr_reg_s intr_shr_reg[NGBDE_NUM_INTR_SHR_REGS_MAX]; + + /*! Lock for shared register synchronization. */ + spinlock_t lock; + + /*! Interrupt control information. */ + struct ngbde_intr_ctrl_s intr_ctrl[NGBDE_NUM_IRQS_MAX]; + + /*! Linux PCI handle. */ + struct pci_dev *pci_dev; + + /*! Kernel device for DMA memory management. */ + struct device *dma_dev; + + /*! Physical device I/O. */ + struct ngbde_memwin_s iowin[NGBDE_NUM_IOWIN_MAX]; + + /*! DMA memory pools. */ + struct ngbde_dmapool_s dmapool[NGBDE_NUM_DMAPOOL_MAX]; +}; + +/*! + * \brief Linux IOCTL handler. + * + * This function handles communication between user mode and kernel + * mode. + * + * \param [in] file Device file handle. + * \param [in] cmd IOCTL command. + * \param [in] arg IOCTL command argument. + * + * \retval 0 No errors + */ +extern long +ngbde_ioctl(struct file *file, unsigned int cmd, unsigned long arg); + +/*! + * \brief Initialize procfs for BDE driver. + * + * Create procfs read interface for dumping probe information. + * + * \return 0 if no errors, otherwise -1. + */ +extern int +ngbde_procfs_init(void); + +/*! + * \brief Clean up procfs for BDE driver. + * + * Clean up resources allocated by \ref ngbde_procfs_init. + * + * \return 0 if no errors, otherwise -1. + */ +extern int +ngbde_procfs_cleanup(void); + +/*! + * \brief Allocate DMA memory pools for all probed devices. + * + * \return 0 if no errors, otherwise -1. + */ +extern int +ngbde_dma_init(void); + +/*! + * \brief Free DMA memory pools for all probed devices. + * + * \return Nothing. + */ +extern void +ngbde_dma_cleanup(void); + +/*! + * \brief Connect to hardware interrupt handler. + * + * \param [in] kdev Device number. + * \param [in] irq_num Interrupt number (MSI vector). + * + * \retval 0 No errors + * \retval -1 Something went wrong. + */ +extern int +ngbde_intr_connect(int kdev, unsigned int irq_num); + +/*! + * \brief Disconnect from hardware interrupt handler. + * + * \param [in] kdev Device number. + * \param [in] irq_num Interrupt number (MSI vector). + * + * \retval 0 No errors + * \retval -1 Something went wrong. + */ +extern int +ngbde_intr_disconnect(int kdev, unsigned int irq_num); + +/*! + * \brief Disconnect from all hardware interrupt handlers. + */ +void +ngbde_intr_cleanup(void); + +/*! + * \brief Wait for hardware interrupt. + * + * A user mode thread will call this function and sleep until a + * hardware interrupt occurs. + * + * \param [in] kdev Device number. + * \param [in] irq_num Interrupt number (MSI vector). + * + * \retval 0 No errors + * \retval -1 Something went wrong. + */ +extern int +ngbde_intr_wait(int kdev, unsigned int irq_num); + +/*! + * \brief Wake up sleeping interrupt thread. + * + * Wake up interrupt thread even if no interrupt has occurred. + * + * Intended for graceful shut-down procedure. + * + * \param [in] kdev Device number. + * \param [in] irq_num Interrupt number (MSI vector). + * + * \retval 0 No errors + * \retval -1 Something went wrong. + */ +extern int +ngbde_intr_stop(int kdev, unsigned int irq_num); + +/*! + * \brief Clear list of interrupt status/mask registers. + * + * This function is typically called before new interrupt register + * information is added. + * + * \param [in] kdev Device number. + * \param [in] irq_num Interrupt number (MSI vector). + * + * \retval 0 No errors + * \retval -1 Something went wrong. + */ +extern int +ngbde_intr_regs_clr(int kdev, unsigned int irq_num); + +/*! + * \brief Add interrupt status/mask register to monitor. + * + * This function adds a new interrupt status/mask register set to the + * list of registers monitored by the user-mode interrupt handler. + * + * The register list is used to determine whether a user-mode + * interrupt has occurred. + * + * See also \ref ngbde_intr_regs_clr. + * + * \param [in] kdev Device number. + * \param [in] irq_num Interrupt number (MSI vector). + * \param [in] ireg Interrupt status/mask register information. + * + * \retval 0 No errors + * \retval -1 Something went wrong. + */ +extern int +ngbde_intr_reg_add(int kdev, unsigned int irq_num, + struct ngbde_irq_reg_s *ireg); + +/*! + * \brief Add interrupt ack register to monitor. + * + * This function adds a interrupt register and mask value + * to acknowledge corresponding irq_num. + * + * \param [in] kdev Device number. + * \param [in] irq_num Interrupt number (MSI vector). + * \param [in] ackreg Interrupt ack register information. + * + * \retval 0 No errors + * \retval -1 Something went wrong. + */ +extern int +ngbde_intr_ack_reg_add(int kdev, unsigned int irq_num, + struct ngbde_intr_ack_reg_s *ackreg); + +/*! + * \brief Write shared interrupt mask register. + * + * This function is used by an interrupt handler when a shared + * interrupt mask register needs to be updated. + * + * Since the register is shared between multiple interrupt handlers, + * access must be protected by a lock. + * + * The register information provided via \ref ngbde_intr_reg_add is + * used to detemine which bits of the mask register belong to the user + * mode driver. + * + * Note that the mask register to access is referenced by the + * corresponding status register. This is because the mask register + * may be different depending on the host CPU interface being used + * (e.g. PCI vs. AXI). On the other hand, the status register is the + * same irrespective of the host CPU interface. + * + * \param [in] kdev Device number. + * \param [in] irq_num Interrupt number (MSI vector). + * \param [in] kapi Must be set to 1 if called from kernel API. + * \param [in] status_reg Corresponding interrupt status register offset. + * \param [in] mask_val New value to write to mask register. + * + * \retval 0 No errors + * \retval -1 Something went wrong. + */ +extern int +ngbde_intr_mask_write(int kdev, unsigned int irq_num, int kapi, + uint32_t status_reg, uint32_t mask_val); + +/*! + * \brief Probe for PCI-attached Broadcom switch devices. + * + * \return 0 if no errors, otherwise -1. + */ +extern int +ngbde_pci_probe(void); + +/*! + * \brief Clean up resources for PCI-attached Broadcom switch devices. + * + * \return 0 if no errors, otherwise -1. + */ +extern int +ngbde_pci_cleanup(void); + +/*! + * \brief Add new switch device to BDE database. + * + * Add device information for probed or fixed switch device. + * + * \param [in] nd Switch device information. + * + * \return 0 if no errors, otherwise -1. + */ +extern int +ngbde_swdev_add(struct ngbde_dev_s *nd); + +/*! + * \brief Get device information for a BDE switch device. + * + * \param [in] kdev Switch device number. + * + * \return Pointer to switch device structure or NULL on error. + */ +struct ngbde_dev_s * +ngbde_swdev_get(int kdev); + +/*! + * \brief Get list of all probed switch devices. + * + * Return a pointer to the array of registered switch devices. + * + * \param [out] nd Pointer to array of switch devices. + * \param [in] num_nd number of valid entries in switch device array. + * + * \retval 0 No errors + */ +extern int +ngbde_swdev_get_all(struct ngbde_dev_s **nd, unsigned int *num_nd); + +/*! + * \brief Allocate memory using page allocator + * + * For any sizes less than MEM_CHUNK_SIZE, we ask the page allocator + * for the entire memory block, otherwise we try to assemble a + * contiguous cmblock ourselves. + * + * Upon successful allocation, the memory block will be added to the + * global list of allocated memory blocks. + * + * \param [in] size Number of bytes to allocate. + * \param [in] flags Kernel flags (GFP_xxx) for memory allocation. + * + * \return Pointer to allocated memory or NULL if failure. + */ +void * +ngbde_pgmem_alloc(size_t size, gfp_t flags); + +/*! + * \brief Free memory block allocated by ngbde_pgmem_alloc. + * + * \param [in] ptr Pointer returned by ngbde_pgmem_alloc. + * + * \return 0 if succesfully freed, otherwise -1. + */ +extern int +ngbde_pgmem_free(void *ptr); + +/*! + * \brief Free all memory blocks allocated by ngbde_pgmem_alloc. + * + * This function will walk the global list of allocated memory blocks + * and free all associated resources. + * + * Intended for a full clean up before the module is unloaded. + * + * \return Nothing. + */ +extern void +ngbde_pgmem_free_all(void); + +/*! + * \brief Map I/O memory in kernel driver. + * + * This function is used to provide device I/O access to a kernel mode + * driver. + * + * \param [in] devh Device handle (\ref ngbde_dev_s). + * \param [in] addr Physical address to map. + * \param [in] size Size of I/O window to map. + * + * \return Pointer to mapped I/O memory, or NULL on error. + */ +extern void * +ngbde_pio_map(void *devh, phys_addr_t addr, phys_addr_t size); + +/*! + * \brief Unmap I/O memory in kernel driver. + * + * Unmap I/O memory previously mapped via \ref ngbde_pio_map. + * + * \param [in] devh Device handle (\ref ngbde_dev_s). + * + * \return Nothing. + */ +extern void +ngbde_pio_unmap(void *devh); + +/*! + * \brief Unmap all I/O windows. + */ +extern void +ngbde_pio_cleanup(void); + +/*! + * \brief Write a memory-mapped register from kernel driver. + * + * Write a 32-bit register using I/O memory previously mapped via \ref + * ngbde_pio_map. + * + * \param [in] devh Device handle (\ref ngbde_dev_s). + * \param [in] offs Register address offset. + * \param [in] val Value to write to register. + * + * \return Nothing. + */ +extern void +ngbde_pio_write32(void *devh, uint32_t offs, uint32_t val); + +/*! + * \brief Read a memory-mapped register from kernel driver. + * + * Read a 32-bit register using I/O memory previously mapped via \ref + * ngbde_pio_map. + * + * \param [in] devh Device handle (\ref ngbde_dev_s). + * \param [in] offs Register address offset. + * + * \return Value read from register. + */ +extern uint32_t +ngbde_pio_read32(void *devh, uint32_t offs); + +/*! + * \brief Map interrupt controller I/O memory. + * + * On some devices the interrupt controller is a device separate from + * the main switch device. This function is used to provide interrupt + * controller I/O access to a kernel mode driver. + * + * \param [in] devh Device handle (\ref ngbde_dev_s). + * \param [in] addr Physical address to map. + * \param [in] size Size of I/O window to map. + * + * \return Pointer to mapped I/O memory, or NULL on error. + */ +extern void * +ngbde_iio_map(void *devh, phys_addr_t addr, phys_addr_t size); + +/*! + * \brief Unmap interrupt controller I/O memory. + * + * Unmap I/O memory previously mapped via \ref ngbde_iio_map. + * + * \param [in] devh Device handle (\ref ngbde_dev_s). + * + * \return Nothing. + */ +extern void +ngbde_iio_unmap(void *devh); + +/*! + * \brief Unmap all interrupt controller I/O windows. + */ +extern void +ngbde_iio_cleanup(void); + +/*! + * \brief Write a memory-mapped interrupt controller register. + * + * Write a 32-bit register using I/O memory previously mapped via \ref + * ngbde_iio_map. + * + * \param [in] devh Device handle (\ref ngbde_dev_s). + * \param [in] offs Register address offset. + * \param [in] val Value to write to register. + * + * \return Nothing. + */ +extern void +ngbde_iio_write32(void *devh, uint32_t offs, uint32_t val); + +/*! + * \brief Read a memory-mapped interrupt controller register. + * + * Read a 32-bit register using I/O memory previously mapped via \ref + * ngbde_iio_map. + * + * \param [in] devh Device handle (\ref ngbde_dev_s). + * \param [in] offs Register address offset. + * + * \return Value read from register. + */ +extern uint32_t +ngbde_iio_read32(void *devh, uint32_t offs); + +/*! + * \brief Map PCI bridge I/O memory. + * + * On some devices the interrupt controller is a device separate from + * the main switch device. This function is used to provide interrupt + * controller I/O access to a kernel mode driver. + * + * \param [in] devh Device handle (\ref ngbde_dev_s). + * \param [in] addr Physical address to map. + * \param [in] size Size of I/O window to map. + * + * \return Pointer to mapped I/O memory, or NULL on error. + */ +extern void * +ngbde_paxb_map(void *devh, phys_addr_t addr, phys_addr_t size); + +/*! + * \brief Unmap PCI bridge I/O memory. + * + * Unmap I/O memory previously mapped via \ref ngbde_paxb_map. + * + * \param [in] devh Device handle (\ref ngbde_dev_s). + * + * \return Nothing. + */ +extern void +ngbde_paxb_unmap(void *devh); + +/*! + * \brief Unmap all PCI bridge I/O windows. + */ +extern void +ngbde_paxb_cleanup(void); + +/*! + * \brief Probe for Broadcom switch devices on IPROC internal bus. + * + * \return 0 if no errors, otherwise -1. + */ +extern int +ngbde_iproc_probe(void); + +/*! + * \brief Clean up resources for Broadcom switch devices on IPROC internal bus. + * + * \return 0 if no errors, otherwise -1. + */ +extern int +ngbde_iproc_cleanup(void); + +#endif /* NGBDE_H */ diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_dma.c b/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_dma.c new file mode 100644 index 000000000000..9cc2b191f48c --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_dma.c @@ -0,0 +1,340 @@ +/*! \file ngbde_dma.c + * + * This module handles allocation of DMA memory pools. + * + */ +/* + * $Copyright: Copyright 2018-2020 Broadcom. All rights reserved. + * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * A copy of the GNU General Public License version 2 (GPLv2) can + * be found in the LICENSES folder.$ + */ + +#include + +/*! \cond */ +static int dma_debug = 0; +module_param(dma_debug, int, 0); +MODULE_PARM_DESC(dma_debug, +"DMA debug output enable (default 0)."); +/*! \endcond */ + +/*! Default size of of DMA memory pools (in MB). */ +#define DMAPOOL_SIZE_DEFAULT 16 + +/*! Default number of DMA memory pools per device. */ +#define NUM_DMAPOOL_DEFAULT 1 + +/*! \cond */ +static int dma_size = DMAPOOL_SIZE_DEFAULT; +module_param(dma_size, int, 0); +MODULE_PARM_DESC(dma_size, +"Size of of DMA memory pools in MB (default 16 MB)."); +/*! \endcond */ + +/*! \cond */ +static char *dma_alloc; +module_param(dma_alloc, charp, 0); +MODULE_PARM_DESC(dma_alloc, +"DMA allocation method auto|kapi|pgmem (default auto)"); +/*! \endcond */ + +/*! \cond */ +static int dma_pools = NUM_DMAPOOL_DEFAULT; +module_param(dma_pools, int, 0); +MODULE_PARM_DESC(dma_pools, +"Number of DMA memory pools to pre-allocate per device (default 1)."); +/*! \endcond */ + +/*! + * \brief Allocate DMA memory via kernel API. + * + * \param [in] dmactrl DMA allocation control. + * \param [out] dmamem DMA allocation result. + * + * \return Nothing. + */ +static void +ngbde_dmamem_kapi_alloc(ngbde_dmactrl_t *dmactrl, ngbde_dmamem_t *dmamem) +{ + void *vaddr; + dma_addr_t baddr; + + vaddr = dma_alloc_coherent(dmactrl->dev, dmactrl->size, &baddr, + dmactrl->flags); + if (vaddr) { + /* Store allocation information in dmamem structure */ + dmamem->vaddr = vaddr; + dmamem->paddr = virt_to_phys(vaddr); + dmamem->dev = dmactrl->dev; + dmamem->size = dmactrl->size; + dmamem->type = NGBDE_DMA_T_KAPI; + dmamem->baddr = baddr; + + /* Write small signature for debug purposes */ + strcpy((char *)vaddr, "DMA_KAPI"); + + if (dma_debug) { + printk("DMA: Allocated %d KB of KAPI memory at 0x%08lx\n", + (int)(dmamem->size / ONE_KB), + (unsigned long)dmamem->paddr); + } + } else { + if (dma_debug) { + printk("DMA: Failed to allocate KAPI memory\n"); + } + } +} + +/*! + * \brief Allocate DMA memory via page allocator. + * + * \param [in] dmactrl DMA allocation control. + * \param [out] dmamem DMA allocation result. + * + * \return Nothing. + */ +static void +ngbde_dmamem_pgmem_alloc(ngbde_dmactrl_t *dmactrl, ngbde_dmamem_t *dmamem) +{ + void *vaddr; + + vaddr = ngbde_pgmem_alloc(dmactrl->size, dmactrl->flags); + if (vaddr) { + /* Store allocation information in dmamem structure */ + dmamem->vaddr = vaddr; + dmamem->paddr = virt_to_phys(vaddr); + dmamem->dev = dmactrl->dev; + dmamem->size = dmactrl->size; + dmamem->type = NGBDE_DMA_T_PGMEM; + dmamem->baddr = dma_map_single(dmamem->dev, dmamem->vaddr, + dmamem->size, DMA_BIDIRECTIONAL); + if (dma_mapping_error(dmactrl->dev, dmamem->baddr)) { + dmamem->baddr = 0; + if (dma_debug) { + printk("DMA: Failed to map PGMEM memory\n"); + } + } + + /* Write small signature for debug purposes */ + strcpy((char *)vaddr, "DMA_PGMEM"); + + if (dma_debug) { + printk("DMA: Allocated %d KB of PGMEM memory at 0x%08lx\n", + (int)(dmamem->size / ONE_KB), + (unsigned long)dmamem->paddr); + } + } else { + if (dma_debug) { + printk("DMA: Failed to allocate PGMEM memory\n"); + } + } +} + +/*! + * \brief Allocate DMA memory. + * + * Depending on the DMA allocation control parameters, we select one + * of several DMA memory allocation methods. + * + * \param [in] dmactrl DMA allocation control. + * \param [out] dmamem DMA allocation result. + * + * \return Nothing. + */ +static int +ngbde_dmamem_alloc(ngbde_dmactrl_t *dmactrl, ngbde_dmamem_t *dmamem) +{ + int kapi = 0; + + if (dmamem->vaddr) { + /* Already allocated */ + return 0; + } + +#ifdef CONFIG_CMA + /* Always allow KAPI when CMA is available */ + kapi = 1; +#else + if (dmactrl->size <= (1 << (MAX_ORDER - 1 + PAGE_SHIFT))) { + kapi = 1; + } +#endif + + /* Allocation via kernel DMA API (if allowed) */ + if (kapi) { + switch (dmactrl->pref_type) { + case NGBDE_DMA_T_AUTO: + case NGBDE_DMA_T_KAPI: + ngbde_dmamem_kapi_alloc(dmactrl, dmamem); + break; + default: + break; + } + } + + /* Allocation via private page allocator */ + if (dmamem->vaddr == NULL) { + switch (dmactrl->pref_type) { + case NGBDE_DMA_T_AUTO: + case NGBDE_DMA_T_PGMEM: + ngbde_dmamem_pgmem_alloc(dmactrl, dmamem); + break; + default: + break; + } + } + + if (dmamem->vaddr == NULL) { + printk(KERN_WARNING "%s: Failed to allocate DMA memory\n", + MOD_NAME); + return -1; + } + + return 0; +} + +/*! + * \brief Free DMA memory. + * + * Free DMA memory allocated via \ref ngbde_dmamem_alloc. + * + * \param [in] dmamem DMA allocation result from \ref ngbde_dmamem_alloc. + * + * \return Nothing. + */ +static int +ngbde_dmamem_free(ngbde_dmamem_t *dmamem) +{ + switch (dmamem->type) { + case NGBDE_DMA_T_KAPI: + if (dma_debug) { + printk("DMA: Freeing %d KB of KAPI memory\n", + (int)(dmamem->size / ONE_KB)); + } + dma_free_coherent(dmamem->dev, dmamem->size, + dmamem->vaddr, dmamem->paddr); + memset(dmamem, 0, sizeof(*dmamem)); + break; + case NGBDE_DMA_T_PGMEM: + if (dma_debug) { + printk("DMA: Freeing %d KB of PGMEM memory\n", + (int)(dmamem->size / ONE_KB)); + } + if (dmamem->baddr) { + if (dma_debug) { + printk("DMA: Unmapping PGMEM memory at 0x%08lx\n", + (unsigned long)dmamem->baddr); + } + dma_unmap_single(dmamem->dev, dmamem->baddr, + dmamem->size, DMA_BIDIRECTIONAL); + } + ngbde_pgmem_free(dmamem->vaddr); + memset(dmamem, 0, sizeof(*dmamem)); + break; + case NGBDE_DMA_T_NONE: + /* Nothing to free */ + break; + default: + printk(KERN_WARNING "%s: Unable to free unknown DMA memory type\n", + MOD_NAME); + break; + } + return 0; +} + +/*! + * \brief Free all DMA memory pools for all devices. + * + * \return Nothing. + */ +void +ngbde_dma_cleanup(void) +{ + struct ngbde_dev_s *swdev; + unsigned int num_swdev, idx; + unsigned int pool; + + ngbde_swdev_get_all(&swdev, &num_swdev); + + for (idx = 0; idx < num_swdev; idx++) { + for (pool = 0; pool < NGBDE_NUM_DMAPOOL_MAX; pool++) { + if (swdev[idx].inactive) { + ngbde_dmamem_free(&swdev[idx].dmapool[pool].dmamem); + } + } + } +} + +/*! + * \brief Allocate DMA memory pools for all devices. + * + * \return Nothing. + */ +int +ngbde_dma_init(void) +{ + int rv; + struct ngbde_dev_s *swdev; + unsigned int num_swdev, idx; + int dma_type = NGBDE_DMA_T_AUTO; + struct ngbde_dmapool_s *dmapool; + unsigned int pool; + + /* Default DMA memory size per device */ + if (dma_size < 0) { + dma_size = DMAPOOL_SIZE_DEFAULT; + } + + /* Check for forced DMA allocation method */ + if (dma_alloc) { + if (strcmp(dma_alloc, "kapi") == 0) { + dma_type = NGBDE_DMA_T_KAPI; + } else if (strcmp(dma_alloc, "pgmem") == 0) { + dma_type = NGBDE_DMA_T_PGMEM; + } else { + printk(KERN_WARNING "%s: Unknown DMA type: %s\n", + MOD_NAME, dma_alloc); + } + } + + /* Number of DMA memory pools per device */ + if ((unsigned int)dma_pools >= NGBDE_NUM_DMAPOOL_MAX) { + dma_pools = NUM_DMAPOOL_DEFAULT; + } + + ngbde_swdev_get_all(&swdev, &num_swdev); + + for (idx = 0; idx < num_swdev; idx++) { + + /* Set DMA allocation parameters */ + for (pool = 0; pool < NGBDE_NUM_DMAPOOL_MAX; pool++) { + dmapool = &swdev[idx].dmapool[pool]; + dmapool->dmactrl.dev = swdev[idx].dma_dev; + dmapool->dmactrl.size = dma_size * ONE_MB; + dmapool->dmactrl.pref_type = dma_type; + dmapool->dmactrl.flags = GFP_KERNEL | GFP_DMA32; + } + + /* Allocate DMA pools */ + for (pool = 0; pool < dma_pools; pool++) { + dmapool = &swdev[idx].dmapool[pool]; + rv = ngbde_dmamem_alloc(&dmapool->dmactrl, &dmapool->dmamem); + if (rv < 0) { + printk(KERN_WARNING "%s: Unable to allocate DMA pool %d %d\n", + MOD_NAME, idx, pool); + } + } + } + return 0; +} diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_iio.c b/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_iio.c new file mode 100644 index 000000000000..e97f1fcea730 --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_iio.c @@ -0,0 +1,143 @@ +/*! \file ngbde_iio.c + * + * API for managing and accessing memory-mapped I/O for interrupt + * controller registers. + * + */ +/* + * $Copyright: Copyright 2018-2020 Broadcom. All rights reserved. + * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * A copy of the GNU General Public License version 2 (GPLv2) can + * be found in the LICENSES folder.$ + */ + +#include + +void * +ngbde_iio_map(void *devh, phys_addr_t addr, phys_addr_t size) +{ + struct ngbde_dev_s *sd = (struct ngbde_dev_s *)devh; + + if (sd->iio_mem) { + if (addr == sd->iio_win.addr && size == sd->iio_win.size) { + /* Already mapped */ + return sd->iio_mem; + } + ngbde_iio_unmap(devh); + } + + sd->iio_mem = ioremap_nocache(addr, size); + + if (sd->iio_mem) { + /* Save mapped resources */ + sd->iio_win.addr = addr; + sd->iio_win.size = size; + } + + return sd->iio_mem; +} + +void +ngbde_iio_unmap(void *devh) +{ + struct ngbde_dev_s *sd = (struct ngbde_dev_s *)devh; + + if (sd->iio_mem) { + iounmap(sd->iio_mem); + sd->iio_mem = NULL; + } +} + +void +ngbde_iio_cleanup(void) +{ + struct ngbde_dev_s *swdev, *sd; + unsigned int num_swdev, idx; + + ngbde_swdev_get_all(&swdev, &num_swdev); + + for (idx = 0; idx < num_swdev; idx++) { + sd = ngbde_swdev_get(idx); + ngbde_iio_unmap(sd); + } +} + +void +ngbde_iio_write32(void *devh, uint32_t offs, uint32_t val) +{ + struct ngbde_dev_s *sd = (struct ngbde_dev_s *)devh; + + if (sd->iio_mem) { + NGBDE_IOWRITE32(val, sd->iio_mem + offs); + } +} + +uint32_t +ngbde_iio_read32(void *devh, uint32_t offs) +{ + struct ngbde_dev_s *sd = (struct ngbde_dev_s *)devh; + + if (sd->iio_mem) { + return NGBDE_IOREAD32(sd->iio_mem + offs); + } + return 0; +} + +void * +ngbde_paxb_map(void *devh, phys_addr_t addr, phys_addr_t size) +{ + struct ngbde_dev_s *sd = (struct ngbde_dev_s *)devh; + + if (sd->paxb_mem) { + if (addr == sd->paxb_win.addr && size == sd->paxb_win.size) { + /* Already mapped */ + return sd->paxb_mem; + } + iounmap(sd->paxb_mem); + } + + sd->paxb_mem = ioremap_nocache(addr, size); + + if (sd->paxb_mem) { + /* Save mapped resources */ + sd->paxb_win.addr = addr; + sd->paxb_win.size = size; + } + + return sd->paxb_mem; +} + +void +ngbde_paxb_unmap(void *devh) +{ + struct ngbde_dev_s *sd = (struct ngbde_dev_s *)devh; + + if (sd->paxb_mem) { + iounmap(sd->paxb_mem); + sd->paxb_mem = NULL; + } +} + +void +ngbde_paxb_cleanup(void) +{ + struct ngbde_dev_s *swdev, *sd; + unsigned int num_swdev, idx; + + ngbde_swdev_get_all(&swdev, &num_swdev); + + for (idx = 0; idx < num_swdev; idx++) { + sd = ngbde_swdev_get(idx); + ngbde_paxb_unmap(sd); + } +} diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_intr.c b/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_intr.c new file mode 100644 index 000000000000..acec7da100f7 --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_intr.c @@ -0,0 +1,550 @@ +/*! \file ngbde_intr.c + * + * API for controlling a thread-based user-mode interrupt handler. + * + */ +/* + * $Copyright: Copyright 2018-2020 Broadcom. All rights reserved. + * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * A copy of the GNU General Public License version 2 (GPLv2) can + * be found in the LICENSES folder.$ + */ + +#include + +/*! \cond */ +static int intr_debug = 0; +module_param(intr_debug, int, 0); +MODULE_PARM_DESC(intr_debug, +"Interrupt debug output enable (default 0)."); +/*! \endcond */ + +static int +ngbde_intr_shared_write32(struct ngbde_dev_s *sd, struct ngbde_intr_ctrl_s *ic, + uint32_t reg_offs, uint32_t reg_val, uint32_t shr_mask) +{ + unsigned long flags; + struct ngbde_shr_reg_s *sr; + int idx; + + sr = NULL; + for (idx = 0; idx < NGBDE_NUM_INTR_SHR_REGS_MAX; idx++) { + if (sd->intr_shr_reg[idx].reg_offs == 0) { + /* If not found, then we add a new entry */ + sd->intr_shr_reg[idx].reg_offs = reg_offs; + } + if (sd->intr_shr_reg[idx].reg_offs == reg_offs) { + sr = &sd->intr_shr_reg[idx]; + break; + } + } + + if (sr == NULL) { + return -1; + } + + spin_lock_irqsave(&sd->lock, flags); + + sr->cur_val &= ~shr_mask; + sr->cur_val |= (reg_val & shr_mask); + + NGBDE_IOWRITE32(sr->cur_val, ic->iomem + reg_offs); + + spin_unlock_irqrestore(&sd->lock, flags); + + return 0; +} + +/*! + * \brief Interrupt handler for user mode thread. + * + * This function will determine whether a user-mode interrupt has + * occurred by reading the configured interrupt status and mask + * registers. + * + * If an interrupt has occurred, any waiting user-mode thread is woken + * up. + * + * \param [in] ic Interrupt control information. + * + * \retval 1 One or more user mode interrupts occurred. + * \retval 0 No user mode interrupts occurred. + */ +static int +ngbde_user_isr(ngbde_intr_ctrl_t *ic) +{ + int idx; + int active_interrupts = 0; + uint32_t stat = 0, mask = 0; + uint32_t kmask; + + /* Check if any enabled interrupts are active */ + for (idx = 0; idx < ic->num_regs; idx++) { + ngbde_irq_reg_t *ir = &ic->regs[idx]; + + /* Get mask of all kernel interrupt sources for this register address */ + kmask = ir->kmask; + + stat = NGBDE_IOREAD32(&ic->iomem[ir->status_reg]); + mask = NGBDE_IOREAD32(&ic->iomem[ir->mask_reg]); + + if (stat & mask & ~kmask) { + active_interrupts = 1; + break; + } + } + + /* No active interrupts to service */ + if (!active_interrupts) { + return 0; + } + + /* Disable (mask off) all interrupts */ + for (idx = 0; idx < ic->num_regs; idx++) { + ngbde_irq_reg_t *ir = &ic->regs[idx]; + + /* Get mask of all kernel interrupt sources for this register address */ + kmask = ir->kmask; + + if (kmask == 0xffffffff) { + /* Kernel driver owns all interrupts in this register */ + continue; + } else if (kmask) { + /* Synchronized write */ + struct ngbde_dev_s *sd = ngbde_swdev_get(ic->kdev); + if (ngbde_intr_shared_write32(sd, ic, ir->mask_reg, 0, ~kmask) < 0) { + printk(KERN_WARNING + "%s: Failed to write shared register for device %d\n", + MOD_NAME, ic->kdev); + /* Fall back to normal write to ensure interrupts are masked */ + NGBDE_IOWRITE32(0, &ic->iomem[ir->mask_reg]); + } + } else { + NGBDE_IOWRITE32(0, &ic->iomem[ir->mask_reg]); + } + } + + atomic_set(&ic->run_user_thread, 1); + wake_up_interruptible(&ic->user_thread_wq); + + return 1; +} + +/*! + * \brief Interrupt handler for kernel driver. + * + * Typically used by the KNET driver. + * + * \param [in] ic Interrupt control information. + * + * \retval 1 One or more kernel mode interrupts occurred. + * \retval 0 No kernel mode interrupts occurred. + */ +static int +ngbde_kernel_isr(ngbde_intr_ctrl_t *ic) +{ + if (ic->isr_func) { + return ic->isr_func(ic->isr_data); + } + return 0; +} + +/*! + * \brief Acknowledge interrupt + * + * \param [in] data Interrupt control information + * + * \retval 0 + */ +static int +ngbde_intr_ack(ngbde_intr_ctrl_t *ic) +{ + struct ngbde_dev_s *sd = ngbde_swdev_get(ic->kdev); + struct ngbde_intr_ack_reg_s *ar = &ic->intr_ack; + + if (sd->use_msi) { + if (ar->flags & NGBDE_INTR_ACK_F_PAXB) { + NGBDE_IOWRITE32(ar->ack_val, &sd->paxb_mem[ar->ack_reg]); + } else { + NGBDE_IOWRITE32(ar->ack_val, &sd->pio_mem[ar->ack_reg]); + } + } + + return 0; +} + +/*! + * \brief Linux ISR + * + * Will call the user-mode interrupts handler and optionally also a + * kernel mode interrupt handler (typically KNET). + * + * \param [in] irq_num Interrupt vector from kernel. + * \param [in] data Interrupt control information + * + * \retval IRQ_NONE Interrupt not recognized. + * \retval IRQ_HANDLED Interrupt recognized and handled (masked off). + */ +static irqreturn_t +ngbde_isr(int irq_num, void *data) +{ + struct ngbde_intr_ctrl_s *ic = (struct ngbde_intr_ctrl_s *)data; + irqreturn_t rv = IRQ_NONE; + + ngbde_intr_ack(ic); + + if (ngbde_user_isr(ic)) { + rv = IRQ_HANDLED; + } + if (ngbde_kernel_isr(ic)) { + rv = IRQ_HANDLED; + } + return rv; +} + +int +ngbde_intr_connect(int kdev, unsigned int irq_num) +{ + struct ngbde_dev_s *sd; + struct ngbde_intr_ctrl_s *ic; + unsigned long irq_flags; + + sd = ngbde_swdev_get(kdev); + if (!sd) { + return -1; + } + + if (irq_num >= NGBDE_NUM_IRQS_MAX) { + return -1; + } + + ic = &sd->intr_ctrl[irq_num]; + + if (ic->irq_active) { + return 0; + } + + if (sd->irq_line >= 0) { + if (sd->pio_mem == NULL) { + printk(KERN_WARNING "%s: No memory-mapped I/O for device %d\n", + MOD_NAME, kdev); + return -1; + } + ic->kdev = kdev; + ic->iomem = sd->pio_mem; + if (sd->iio_mem) { + if (intr_debug) { + printk("INTR: Using dedicated interrupt controller\n"); + } + ic->iomem = sd->iio_mem; + } + init_waitqueue_head(&ic->user_thread_wq); + atomic_set(&ic->run_user_thread, 0); + irq_flags = IRQF_SHARED; + ic->irq_vect = sd->irq_line; + + /* + * The pci_enable_msi function must be called after enabling + * BAR0_PAXB_OARR_FUNC0_MSI_PAGE, otherwise, MSI interrupts + * cannot be triggered! + */ + if (sd->use_msi) { + if (pci_enable_msi(sd->pci_dev) == 0) { + irq_flags = 0; + ic->irq_vect = sd->pci_dev->irq; + if (intr_debug) { + printk("INTR: Enabled MSI interrupts\n"); + } + } else { + printk(KERN_WARNING "%s: Failed to enable MSI for device %d\n", + MOD_NAME, kdev); + sd->use_msi = 0; + } + } + if (intr_debug) { + printk("INTR: Request IRQ %d\n", ic->irq_vect); + } + if (request_irq(ic->irq_vect, ngbde_isr, irq_flags, MOD_NAME, ic) < 0) { + printk(KERN_WARNING "%s: Could not get IRQ %d for device %d\n", + MOD_NAME, ic->irq_vect, kdev); + return -1; + } + ic->irq_active = 1; + } + + return 0; +} + +int +ngbde_intr_disconnect(int kdev, unsigned int irq_num) +{ + struct ngbde_dev_s *sd; + struct ngbde_intr_ctrl_s *ic; + + sd = ngbde_swdev_get(kdev); + if (!sd) { + return -1; + } + + if (irq_num >= NGBDE_NUM_IRQS_MAX) { + return -1; + } + + ic = &sd->intr_ctrl[irq_num]; + + if (!ic->irq_active) { + return 0; + } + + if (ic->isr_func) { + printk(KERN_WARNING "%s: Disconnecting IRQ %d blocked by kernel ISR\n", + MOD_NAME, irq_num); + return 0; + } + + if (ic->irq_vect >= 0) { + free_irq(ic->irq_vect, ic); + if (sd->use_msi) { + pci_disable_msi(sd->pci_dev); + } + ic->irq_active = 0; + } + + return 0; +} + +void +ngbde_intr_cleanup(void) +{ + struct ngbde_dev_s *swdev; + unsigned int num_swdev, idx, irq_num; + + ngbde_swdev_get_all(&swdev, &num_swdev); + + for (idx = 0; idx < num_swdev; idx++) { + for (irq_num = 0; irq_num < NGBDE_NUM_IRQS_MAX; irq_num++) { + ngbde_intr_disconnect(idx, irq_num); + } + } +} + +int +ngbde_intr_wait(int kdev, unsigned int irq_num) +{ + struct ngbde_dev_s *sd; + struct ngbde_intr_ctrl_s *ic; + + sd = ngbde_swdev_get(kdev); + if (!sd) { + return -1; + } + + if (irq_num >= NGBDE_NUM_IRQS_MAX) { + return -1; + } + + ic = &sd->intr_ctrl[irq_num]; + + if (!ic->irq_active) { + return 0; + } + + wait_event_interruptible(ic->user_thread_wq, + atomic_read(&ic->run_user_thread) != 0); + atomic_set(&ic->run_user_thread, 0); + + return 0; +} + +int +ngbde_intr_stop(int kdev, unsigned int irq_num) +{ + struct ngbde_dev_s *sd; + struct ngbde_intr_ctrl_s *ic; + + sd = ngbde_swdev_get(kdev); + if (!sd) { + return -1; + } + + if (irq_num >= NGBDE_NUM_IRQS_MAX) { + return -1; + } + + ic = &sd->intr_ctrl[irq_num]; + + if (!ic->irq_active) { + return 0; + } + + /* Wake up user thread */ + atomic_set(&ic->run_user_thread, 1); + wake_up_interruptible(&ic->user_thread_wq); + + return 0; +} + +int +ngbde_intr_regs_clr(int kdev, unsigned int irq_num) +{ + struct ngbde_dev_s *sd; + struct ngbde_intr_ctrl_s *ic; + + sd = ngbde_swdev_get(kdev); + if (!sd) { + return -1; + } + + if (irq_num >= NGBDE_NUM_IRQS_MAX) { + return -1; + } + + ic = &sd->intr_ctrl[irq_num]; + + if (ic->irq_active) { + /* Do not clear configuration with interrupt connected */ + return 0; + } + + ic->num_regs = 0; + memset(ic->regs, 0, sizeof(ic->regs)); + + return 0; +} + +int +ngbde_intr_reg_add(int kdev, unsigned int irq_num, + struct ngbde_irq_reg_s *ireg) +{ + struct ngbde_dev_s *sd; + struct ngbde_intr_ctrl_s *ic; + struct ngbde_irq_reg_s *ir; + unsigned int idx; + + sd = ngbde_swdev_get(kdev); + if (!sd) { + return -1; + } + + if (irq_num >= NGBDE_NUM_IRQS_MAX) { + return -1; + } + + ic = &sd->intr_ctrl[irq_num]; + + if (ic->irq_active) { + /* + * If the interrupt is connected, then we only update the + * kernel mask for existing entries. + */ + for (idx = 0; idx < ic->num_regs; idx++) { + ir = &ic->regs[idx]; + if (ir->status_reg == ireg->status_reg && + ir->mask_reg == ireg->mask_reg) { + ir->kmask = ireg->kmask; + if (intr_debug) { + printk("INTR: Updating interrupt register " + "0x%08x/0x%08x (0x%08x)\n", + ir->status_reg, ir->mask_reg, ir->kmask); + } + return 0; + } + } + return -1; + } + + if (ic->num_regs >= NGBDE_NUM_IRQ_REGS_MAX) { + return -1; + } + + ir = &ic->regs[ic->num_regs++]; + + memcpy(ir, ireg, sizeof (*ir)); + + if (intr_debug) { + printk("INTR: Adding interrupt register 0x%08x/0x%08x (0x%08x)\n", + ir->status_reg, ir->mask_reg, ir->kmask); + } + + return ic->num_regs; +} + +int +ngbde_intr_ack_reg_add(int kdev, unsigned int irq_num, + struct ngbde_intr_ack_reg_s *ackreg) +{ + struct ngbde_dev_s *sd; + struct ngbde_intr_ctrl_s *ic; + struct ngbde_intr_ack_reg_s *ar; + + sd = ngbde_swdev_get(kdev); + if (!sd) { + return -1; + } + + if (irq_num >= NGBDE_NUM_IRQS_MAX) { + return -1; + } + + ic = &sd->intr_ctrl[irq_num]; + + if (ic->irq_active) { + /* Ignore request if interrupt is connected */ + return 0; + } + + ar = &ic->intr_ack; + + memcpy(ar, ackreg, sizeof (*ar)); + + if (intr_debug) { + printk("INTR: Adding interrupt ACK register 0x%08x/0x%08x (0x%08x)\n", + ar->ack_reg, ar->ack_val, ar->flags); + } + + return 0; +} + +int +ngbde_intr_mask_write(int kdev, unsigned int irq_num, int kapi, + uint32_t status_reg, uint32_t mask_val) +{ + struct ngbde_dev_s *sd; + struct ngbde_intr_ctrl_s *ic; + struct ngbde_irq_reg_s *ir; + unsigned int idx; + uint32_t bmask; + + sd = ngbde_swdev_get(kdev); + if (!sd) { + return -1; + } + + if (irq_num >= NGBDE_NUM_IRQS_MAX) { + return -1; + } + + ic = &sd->intr_ctrl[irq_num]; + + ir = ic->regs; + for (idx = 0; idx < ic->num_regs; idx++) { + if (ir->status_reg == status_reg) { + bmask = kapi ? ir->kmask : ~ir->kmask; + ngbde_intr_shared_write32(sd, ic, ir->mask_reg, mask_val, bmask); + return 0; + } + ir++; + } + + return -1; +} diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_ioctl.c b/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_ioctl.c new file mode 100644 index 000000000000..ccd0b7ee01d0 --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_ioctl.c @@ -0,0 +1,237 @@ +/*! \file ngbde_ioctl.c + * + * NGBDE IOCTL interface. + * + */ +/* + * $Copyright: Copyright 2018-2020 Broadcom. All rights reserved. + * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * A copy of the GNU General Public License version 2 (GPLv2) can + * be found in the LICENSES folder.$ + */ + +#include + +#include + +long +ngbde_ioctl(struct file *file, unsigned int cmd, unsigned long arg) +{ + struct ngbde_ioc_cmd_s ioc; + struct ngbde_dev_s *swdev; + struct ngbde_irq_reg_s ireg; + struct ngbde_intr_ack_reg_s ackreg; + phys_addr_t addr, size; + unsigned int num_swdev; + unsigned int rsrc_type, rsrc_idx; + unsigned int irq_num, intr_cmd; + uint32_t mreg, mval; + + if (copy_from_user(&ioc, (void *)arg, sizeof(ioc))) { + return -EFAULT; + } + + ioc.rc = NGBDE_IOC_SUCCESS; + + switch (cmd) { + case NGBDE_IOC_MOD_INFO: + ioc.op.mod_info.version = NGBDE_IOC_VERSION; + break; + case NGBDE_IOC_PROBE_INFO: + ngbde_swdev_get_all(NULL, &num_swdev); + ioc.op.probe_info.num_swdev = num_swdev; + break; + case NGBDE_IOC_DEV_INFO: + swdev = ngbde_swdev_get(ioc.devid); + if (!swdev) { + ioc.rc = NGBDE_IOC_FAIL; + break; + } + ioc.op.dev_info.vendor_id = swdev->vendor_id; + ioc.op.dev_info.device_id = swdev->device_id; + ioc.op.dev_info.revision = swdev->revision; + ioc.op.dev_info.model = swdev->model; + if (swdev->use_msi) { + ioc.op.dev_info.flags |= NGBDE_DEV_F_MSI; + } + break; + case NGBDE_IOC_PHYS_ADDR: + swdev = ngbde_swdev_get(ioc.devid); + if (!swdev) { + ioc.rc = NGBDE_IOC_FAIL; + break; + } + rsrc_type = ioc.op.rsrc_id.type; + rsrc_idx = ioc.op.rsrc_id.inst; + switch (rsrc_type) { + case NGBDE_IO_RSRC_DEV_IO: + if (rsrc_idx >= NGBDE_NUM_IOWIN_MAX) { + printk(KERN_WARNING + "ngbde: invalid resource index (%d)\n", + rsrc_idx); + ioc.rc = NGBDE_IOC_FAIL; + break; + } + ioc.op.phys_addr.addr = swdev->iowin[rsrc_idx].addr; + ioc.op.phys_addr.size = swdev->iowin[rsrc_idx].size; + break; + case NGBDE_IO_RSRC_DMA_MEM: + if (rsrc_idx >= NGBDE_NUM_DMAPOOL_MAX) { + printk(KERN_WARNING + "ngbde: invalid resource index (%d)\n", + rsrc_idx); + ioc.rc = NGBDE_IOC_FAIL; + break; + } + ioc.op.phys_addr.addr = swdev->dmapool[rsrc_idx].dmamem.paddr; + ioc.op.phys_addr.size = swdev->dmapool[rsrc_idx].dmactrl.size; + break; + case NGBDE_IO_RSRC_DMA_BUS: + if (rsrc_idx >= NGBDE_NUM_DMAPOOL_MAX) { + printk(KERN_WARNING + "ngbde: invalid resource index (%d)\n", + rsrc_idx); + ioc.rc = NGBDE_IOC_FAIL; + break; + } + ioc.op.phys_addr.addr = swdev->dmapool[rsrc_idx].dmamem.baddr; + ioc.op.phys_addr.size = swdev->dmapool[rsrc_idx].dmactrl.size; + break; + default: + printk(KERN_WARNING + "ngbde: unknown resource type (%d)\n", + rsrc_type); + ioc.rc = NGBDE_IOC_FAIL; + break; + } + break; + case NGBDE_IOC_INTR_CTRL: + irq_num = ioc.op.intr_ctrl.irq_num; + intr_cmd = ioc.op.intr_ctrl.cmd; + switch (intr_cmd) { + case NGBDE_ICTL_INTR_CONN: + if (ngbde_intr_connect(ioc.devid, irq_num) < 0) { + ioc.rc = NGBDE_IOC_FAIL; + } + break; + case NGBDE_ICTL_INTR_DISC: + if (ngbde_intr_disconnect(ioc.devid, irq_num) < 0) { + ioc.rc = NGBDE_IOC_FAIL; + } + break; + case NGBDE_ICTL_INTR_WAIT: + if (ngbde_intr_wait(ioc.devid, irq_num) < 0) { + ioc.rc = NGBDE_IOC_FAIL; + } + break; + case NGBDE_ICTL_INTR_STOP: + if (ngbde_intr_stop(ioc.devid, irq_num) < 0) { + ioc.rc = NGBDE_IOC_FAIL; + } + break; + case NGBDE_ICTL_REGS_CLR: + if (ngbde_intr_regs_clr(ioc.devid, irq_num) < 0) { + ioc.rc = NGBDE_IOC_FAIL; + } + break; + default: + printk(KERN_WARNING + "%s: unknown interrupt control command (%d)\n", + MOD_NAME, intr_cmd); + ioc.rc = NGBDE_IOC_FAIL; + break; + } + break; + case NGBDE_IOC_IRQ_REG_ADD: + irq_num = ioc.op.irq_reg_add.irq_num; + ireg.status_reg = ioc.op.irq_reg_add.status_reg; + ireg.mask_reg = ioc.op.irq_reg_add.mask_reg; + ireg.kmask = ioc.op.irq_reg_add.kmask; + if (ngbde_intr_reg_add(ioc.devid, irq_num, &ireg) < 0) { + printk(KERN_WARNING + "%s: Unable to add interrupt register\n", + MOD_NAME); + ioc.rc = NGBDE_IOC_FAIL; + } + break; + case NGBDE_IOC_INTR_ACK_REG_ADD: + irq_num = ioc.op.intr_ack_reg_add.irq_num; + ackreg.ack_reg = ioc.op.intr_ack_reg_add.ack_reg; + ackreg.ack_val = ioc.op.intr_ack_reg_add.ack_val; + ackreg.flags = ioc.op.intr_ack_reg_add.flags; + if (ngbde_intr_ack_reg_add(ioc.devid, irq_num, &ackreg) < 0) { + printk(KERN_WARNING + "%s: Unable to add interrupt ack register\n", + MOD_NAME); + ioc.rc = NGBDE_IOC_FAIL; + } + break; + case NGBDE_IOC_IRQ_MASK_WR: + irq_num = ioc.op.irq_mask_wr.irq_num; + mreg = ioc.op.irq_mask_wr.offs; + mval = ioc.op.irq_mask_wr.val; + if (ngbde_intr_mask_write(ioc.devid, irq_num, 0, mreg, mval) < 0) { + printk(KERN_WARNING + "%s: Unable to write shared register\n", + MOD_NAME); + ioc.rc = NGBDE_IOC_FAIL; + } + break; + case NGBDE_IOC_PIO_WIN_MAP: + swdev = ngbde_swdev_get(ioc.devid); + if (!swdev) { + ioc.rc = NGBDE_IOC_FAIL; + break; + } + addr = ioc.op.pio_win.addr; + size = ioc.op.pio_win.size; + if (ngbde_pio_map(swdev, addr, size) == NULL) { + ioc.rc = NGBDE_IOC_FAIL; + } + break; + case NGBDE_IOC_IIO_WIN_MAP: + swdev = ngbde_swdev_get(ioc.devid); + if (!swdev) { + ioc.rc = NGBDE_IOC_FAIL; + break; + } + addr = ioc.op.pio_win.addr; + size = ioc.op.pio_win.size; + if (ngbde_iio_map(swdev, addr, size) == NULL) { + ioc.rc = NGBDE_IOC_FAIL; + } + break; + case NGBDE_IOC_PAXB_WIN_MAP: + swdev = ngbde_swdev_get(ioc.devid); + if (!swdev) { + ioc.rc = NGBDE_IOC_FAIL; + break; + } + addr = ioc.op.pio_win.addr; + size = ioc.op.pio_win.size; + if (ngbde_paxb_map(swdev, addr, size) == NULL) { + ioc.rc = NGBDE_IOC_FAIL; + } + break; + default: + printk(KERN_ERR "ngbde: invalid ioctl (%08x)\n", cmd); + ioc.rc = NGBDE_IOC_FAIL; + break; + } + + if (copy_to_user((void *)arg, &ioc, sizeof(ioc))) { + return -EFAULT; + } + + return 0; +} diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_iproc_probe.c b/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_iproc_probe.c new file mode 100644 index 000000000000..63b02a4075a3 --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_iproc_probe.c @@ -0,0 +1,164 @@ +/*! \file ngbde_iproc_probe.c + * + * BDE probe for IPROC internal bus devices. + * + * Validate CMICD existence on the platform. If Linux device tree matched, + * probe function of platform driver is called and the switch device read from + * CMICD register is added to the device list. + * + */ +/* + * $Copyright: Copyright 2018-2020 Broadcom. All rights reserved. + * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * A copy of the GNU General Public License version 2 (GPLv2) can + * be found in the LICENSES folder.$ + */ + +#include +#include +#include + +/*! \cond */ +static int iproc_debug = 0; +module_param(iproc_debug, int, 0); +MODULE_PARM_DESC(iproc_debug, +"IPROC debug output enable (default 0)."); +/*! \endcond */ + +/*! + * \brief Probe devices on the IPROC internal bus. + * + * \param [in] pldev Platform device. + * + * \retval 0 No errors + * \retval -1 Something went wrong. + */ +static int +iproc_cmicd_probe(struct platform_device *pldev) +{ + int rv; + uint32_t size; + void *base_address; + uint32_t dev_rev_id; + struct ngbde_dev_s ngbde_dev, *nd = &ngbde_dev; + struct resource *memres, *irqres; + + memres = platform_get_resource(pldev, IORESOURCE_MEM, 0); + if (memres == NULL) { + printk("Unable to retrieve iProc CMIC memory resource."); + return -1; + } + size = memres->end - memres->start + 1; + + if (iproc_debug) { + printk("CMIC info : Memory start=%p, end=%p\n", + (void *)memres->start, (void *)memres->end); + } + + base_address = ioremap_nocache(memres->start, size); + if (!base_address) { + printk(KERN_WARNING "Error mapping iProc CMIC registers"); + return -1; + } + + memset(nd, 0, sizeof(*nd)); + nd->pci_dev = NULL; /* No PCI bus */ + nd->dma_dev = &pldev->dev; + + /* Read switch device ID from CMIC */ + dev_rev_id = *((uint32_t*)(base_address + 0x10224)); + nd->vendor_id = 0x14e4; + nd->device_id = dev_rev_id & 0xffff; + nd->revision = (dev_rev_id >> 16) & 0xff; + + irqres = platform_get_resource(pldev, IORESOURCE_IRQ, 0); + if (irqres == NULL) { + printk(KERN_WARNING "Unable to retrieve iProc CMIC IRQ resource."); + return -1; + } + nd->irq_line = irqres->start; + if (iproc_debug) { + printk("CMIC info : IRQ line=%p\n", (void *)irqres->start); + } + + nd->iowin[0].addr = memres->start; + nd->iowin[0].size = size; + + if (base_address) { + iounmap(base_address); + } + rv = ngbde_swdev_add(nd); + + return rv; +} + +/*! + * \brief Remove the platform device. + * + * \param [in] pldev Platform device. + * + * \retval 0 No errors + */ +static int +iproc_cmicd_remove(struct platform_device *pldev) +{ + return 0; +} + +/*! Matching compatible property with device tree. */ +static const struct of_device_id iproc_cmicd_of_match[] = { + { .compatible = "brcm,iproc-cmicd" }, + {}, +}; +MODULE_DEVICE_TABLE(of, iproc_cmicd_of_match); + +static char iproc_cmicd_string[] = "bcmiproc-cmicd"; + +/*! Platform driver definition. */ +static struct platform_driver iproc_cmicd_driver = +{ + .probe = iproc_cmicd_probe, + .remove = iproc_cmicd_remove, + .driver = + { + .name = iproc_cmicd_string, + .owner = THIS_MODULE, + .of_match_table = iproc_cmicd_of_match, + }, +}; + +/*! + * \brief Probe for Broadcom switch devices on IPROC internal bus. + * + * \return 0 if no errors, otherwise -1. + */ +int +ngbde_iproc_probe(void) +{ + platform_driver_register(&iproc_cmicd_driver); + + return 0; +} + +/*! + * \brief Clean up resources for Broadcom switch devices on IPROC internal bus. + * + * \return 0 if no errors, otherwise -1. + */ +int +ngbde_iproc_cleanup(void) +{ + platform_driver_unregister(&iproc_cmicd_driver); + + return 0; +} diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_kapi.c b/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_kapi.c new file mode 100644 index 000000000000..340e7b057d44 --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_kapi.c @@ -0,0 +1,216 @@ +/*! \file ngbde_kapi.c + * + * Public BDE kernel API for use with other kernel modules. + * + */ +/* + * $Copyright: Copyright 2018-2020 Broadcom. All rights reserved. + * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * A copy of the GNU General Public License version 2 (GPLv2) can + * be found in the LICENSES folder.$ + */ + +#include + +#include + +struct pci_dev * +ngbde_kapi_pci_dev_get(int kdev) +{ + struct ngbde_dev_s *sd; + + sd = ngbde_swdev_get(kdev); + if (!sd) { + return NULL; + } + + return sd->pci_dev; +} +/*! \cond */ +EXPORT_SYMBOL(ngbde_kapi_pci_dev_get); +/*! \endcond */ + +struct device * +ngbde_kapi_dma_dev_get(int kdev) +{ + struct ngbde_dev_s *sd; + + sd = ngbde_swdev_get(kdev); + if (!sd) { + return NULL; + } + + return sd->dma_dev; +} +/*! \cond */ +EXPORT_SYMBOL(ngbde_kapi_dma_dev_get); +/*! \endcond */ + +void * +ngbde_kapi_dma_bus_to_virt(int kdev, dma_addr_t baddr) +{ + struct ngbde_dev_s *sd; + struct ngbde_dmamem_s *dmamem; + size_t dma_offset; + int idx; + + sd = ngbde_swdev_get(kdev); + if (!sd) { + return NULL; + } + + for (idx = 0; idx < NGBDE_NUM_DMAPOOL_MAX; idx++) { + dmamem = &sd->dmapool[idx].dmamem; + dma_offset = baddr - dmamem->baddr; + if (dma_offset < dmamem->size) { + return (uint8_t *)dmamem->vaddr + dma_offset; + } + } + return NULL; +} +/*! \cond */ +EXPORT_SYMBOL(ngbde_kapi_dma_bus_to_virt); +/*! \endcond */ + +dma_addr_t +ngbde_kapi_dma_virt_to_bus(int kdev, void *vaddr) +{ + struct ngbde_dev_s *sd; + struct ngbde_dmamem_s *dmamem; + size_t dma_offset; + int idx; + + sd = ngbde_swdev_get(kdev); + if (!sd) { + return 0UL; + } + + for (idx = 0; idx < NGBDE_NUM_DMAPOOL_MAX; idx++) { + dmamem = &sd->dmapool[idx].dmamem; + dma_offset = (uintptr_t)vaddr - (uintptr_t)dmamem->vaddr; + if (dma_offset < dmamem->size) { + return dmamem->baddr + dma_offset; + } + } + return 0UL; +} +/*! \cond */ +EXPORT_SYMBOL(ngbde_kapi_dma_virt_to_bus); +/*! \endcond */ + +void +ngbde_kapi_pio_write32(int kdev, uint32_t offs, uint32_t val) +{ + struct ngbde_dev_s *sd; + + sd = ngbde_swdev_get(kdev); + if (sd) { + return ngbde_pio_write32(sd, offs, val); + } +} +/*! \cond */ +EXPORT_SYMBOL(ngbde_kapi_pio_write32); +/*! \endcond */ + +uint32_t +ngbde_kapi_pio_read32(int kdev, uint32_t offs) +{ + struct ngbde_dev_s *sd; + + sd = ngbde_swdev_get(kdev); + if (sd) { + return ngbde_pio_read32(sd, offs); + } + + return (uint32_t)-1; +} +/*! \cond */ +EXPORT_SYMBOL(ngbde_kapi_pio_read32); +/*! \endcond */ + +void * +ngbde_kapi_pio_membase(int kdev) +{ + struct ngbde_dev_s *sd; + + sd = ngbde_swdev_get(kdev); + if (!sd) { + return NULL; + } + + return sd->pio_mem; +} +/*! \cond */ +EXPORT_SYMBOL(ngbde_kapi_pio_membase); +/*! \endcond */ + +int +ngbde_kapi_intr_connect(int kdev, unsigned int irq_num, + int (*isr_func)(void *), void *isr_data) +{ + struct ngbde_dev_s *sd; + struct ngbde_intr_ctrl_s *ic; + + sd = ngbde_swdev_get(kdev); + if (!sd) { + return -1; + } + + if (irq_num >= NGBDE_NUM_IRQS_MAX) { + return -1; + } + + ic = &sd->intr_ctrl[irq_num]; + ic->isr_func = isr_func; + ic->isr_data = isr_data; + + return 0; +} +/*! \cond */ +EXPORT_SYMBOL(ngbde_kapi_intr_connect); +/*! \endcond */ + +int +ngbde_kapi_intr_disconnect(int kdev, unsigned int irq_num) +{ + struct ngbde_dev_s *sd; + struct ngbde_intr_ctrl_s *ic; + + sd = ngbde_swdev_get(kdev); + if (!sd) { + return -1; + } + + if (irq_num >= NGBDE_NUM_IRQS_MAX) { + return -1; + } + + ic = &sd->intr_ctrl[irq_num]; + ic->isr_func = NULL; + ic->isr_data = NULL; + + return 0; +} +/*! \cond */ +EXPORT_SYMBOL(ngbde_kapi_intr_disconnect); +/*! \endcond */ + +int +ngbde_kapi_intr_mask_write(int kdev, unsigned int irq_num, + uint32_t status_reg, uint32_t mask_val) +{ + return ngbde_intr_mask_write(kdev, irq_num, 1, status_reg, mask_val); +} +/*! \cond */ +EXPORT_SYMBOL(ngbde_kapi_intr_mask_write); +/*! \endcond */ diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_main.c b/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_main.c new file mode 100644 index 000000000000..5ce48ebc5134 --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_main.c @@ -0,0 +1,297 @@ +/*! \file ngbde_main.c + * + * NGBDE module entry. + * + */ +/* + * $Copyright: Copyright 2018-2020 Broadcom. All rights reserved. + * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * A copy of the GNU General Public License version 2 (GPLv2) can + * be found in the LICENSES folder.$ + */ + +#include + +/*! \cond */ +MODULE_AUTHOR("Broadcom Corporation"); +MODULE_DESCRIPTION("NG BDE Module"); +MODULE_LICENSE("GPL"); +/*! \endcond */ + +/*! \cond */ +static int mmap_debug = 0; +module_param(mmap_debug, int, 0); +MODULE_PARM_DESC(mmap_debug, +"MMAP debug output enable (default 0)."); +/*! \endcond */ + +/*! + * \brief Remap user space DMA memory to non-cached area. + * + * Since we cannot flush and invalidate DMA memory from user space, + * the DMA memory pools need to be cache-coherent, even if this means + * that we need to remap the DMA memory as non-cached. + * + * If undefined, we set this value according to kernel configuration. + */ +#ifndef REMAP_DMA_NONCACHED +# ifdef CONFIG_DMA_NONCOHERENT +# define REMAP_DMA_NONCACHED 1 +# else +# define REMAP_DMA_NONCACHED 0 +# endif +#endif + +static int +ngbde_open(struct inode *inode, struct file *filp) +{ + return 0; +} + +static int +ngbde_release(struct inode *inode, struct file *filp) +{ + return 0; +} + +/*! + * \brief Check if memory range is within existing DMA memory pools. + * + * \param [in] paddr Physical start address of memory range. + * \param [in] size Size of memory range. + * + * \retval true Range is valid. + * \retval false Range is not valid. + */ +static bool +ngbde_dma_range_valid(unsigned long paddr, unsigned long size) +{ + struct ngbde_dev_s *swdev; + unsigned int num_swdev, idx; + struct ngbde_dmamem_s *dmamem; + unsigned int pool; + + ngbde_swdev_get_all(&swdev, &num_swdev); + + for (idx = 0; idx < num_swdev; idx++) { + for (pool = 0; pool < NGBDE_NUM_DMAPOOL_MAX; pool++) { + dmamem = &swdev[idx].dmapool[pool].dmamem; + if (paddr >= dmamem->paddr && + (paddr + size) <= (dmamem->paddr + dmamem->size)) { + return true; + } + } + } + return false; +} + +/*! + * \brief Check if memory range is within device I/O ranges. + * + * \param [in] paddr Physical start address of I/O memory range. + * \param [in] size Size of memory range. + * + * \retval true Range is valid. + * \retval false Range is not valid. + */ +static bool +ngbde_pio_range_valid(unsigned long paddr, unsigned long size) +{ + struct ngbde_dev_s *swdev; + unsigned int num_swdev, idx; + struct ngbde_memwin_s *iowin; + unsigned long iowin_size; + unsigned int wdx; + + ngbde_swdev_get_all(&swdev, &num_swdev); + + for (idx = 0; idx < num_swdev; idx++) { + for (wdx = 0; wdx < NGBDE_NUM_IOWIN_MAX; wdx++) { + iowin = &swdev[idx].iowin[wdx]; + iowin_size = iowin->size; + if (iowin_size < PAGE_SIZE) { + iowin_size = PAGE_SIZE; + } + if (mmap_debug) { + printk("MMAP: Check 0x%08lx/0x%08lx against " + "0x%08lx/0x%08lx(0x%08lx)\n", + paddr, size, + (unsigned long)iowin->addr, + (unsigned long)iowin->size, iowin_size); + } + if (paddr >= iowin->addr && + (paddr + size) <= (iowin->addr + iowin_size)) { + return true; + } + } + } + return false; +} + +/*! + * \brief Match incomplete address with device base addresses. + * + * Use for physical addresses larger than 44 bits. + * + * \param [in] paddr Physical address from user space. + * + * \return Matched device base addess or 0 if no match. + */ +static unsigned long +ngbde_pio_base_match(unsigned long paddr) +{ + struct ngbde_dev_s *swdev; + unsigned int num_swdev, idx; + struct ngbde_memwin_s *iowin; + unsigned int wdx; + + ngbde_swdev_get_all(&swdev, &num_swdev); + + for (idx = 0; idx < num_swdev; idx++) { + for (wdx = 0; wdx < NGBDE_NUM_IOWIN_MAX; wdx++) { + iowin = &swdev[idx].iowin[wdx]; + if (((paddr ^ iowin->addr) & 0xfffffffffffULL) == 0) { + if (mmap_debug) { + printk("MMAP: Matched 0x%08lx to 0x%08lx\n", + (unsigned long)paddr, + (unsigned long)iowin->addr); + } + return iowin->addr; + } + } + } + return 0; +} + +/* + * Some kernels are configured to prevent mapping of kernel RAM memory + * into user space via the /dev/mem device. + * + * The function below provides a backdoor to mapping the DMA pool to + * user space via the BDE device file. + */ +static int +ngbde_mmap(struct file *filp, struct vm_area_struct *vma) +{ + unsigned long paddr = vma->vm_pgoff << PAGE_SHIFT; + unsigned long size = vma->vm_end - vma->vm_start; + int map_noncached = REMAP_DMA_NONCACHED; + int range_valid = 0; + + if (mmap_debug) { + printk("MMAP: Mapping %lu Kbytes at 0x%08lx (0x%lx)\n", + size / 1024, paddr, vma->vm_pgoff); + } + + if (ngbde_dma_range_valid(paddr, size)) { + range_valid = 1; + } else { + map_noncached = 1; + if (ngbde_pio_range_valid(paddr, size)) { + range_valid = 1; + } else { + paddr = ngbde_pio_base_match(paddr); + if (ngbde_pio_range_valid(paddr, size)) { + range_valid = 1; + } + } + } + + if (!range_valid) { + printk("BDE: Invalid mmap range 0x%08lx/0x%lx\n", paddr, size); + return -EINVAL; + } + + if (map_noncached) { + vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); + } + + if (remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff, + size, vma->vm_page_prot)) { + printk("BDE: Failed to mmap phys range 0x%lx-0x%lx to 0x%lx-0x%lx\n", + paddr, paddr + size, vma->vm_start, vma->vm_end); + return -EAGAIN; + } + + return 0; +} + +static struct file_operations fops = { + .open = ngbde_open, + .release = ngbde_release, + .unlocked_ioctl = ngbde_ioctl, + .compat_ioctl = ngbde_ioctl, + .mmap = ngbde_mmap, +}; + +/*! + * \brief Standard module cleanup. + * + * \return Nothing. + */ +void __exit +cleanup_module(void) +{ + ngbde_intr_cleanup(); + ngbde_iio_cleanup(); + ngbde_paxb_cleanup(); + ngbde_pio_cleanup(); + ngbde_dma_cleanup(); + ngbde_procfs_cleanup(); + unregister_chrdev(MOD_MAJOR, MOD_NAME); + ngbde_pci_cleanup(); + ngbde_iproc_cleanup(); + printk(KERN_INFO "Broadcom NGBDE unloaded successfully\n"); +} + +/*! + * \brief Standard module initialization. + * + * \return Nothing. + */ +int __init +init_module(void) +{ + int rv; + + rv = register_chrdev(MOD_MAJOR, MOD_NAME, &fops); + if (rv < 0) { + printk(KERN_WARNING "%s: can't get major %d\n", + MOD_NAME, MOD_MAJOR); + return rv; + } + + rv = ngbde_iproc_probe(); + if (rv < 0) { + printk(KERN_WARNING "%s: Error probing for AXI bus devices.\n", + MOD_NAME); + return rv; + } + + rv = ngbde_pci_probe(); + if (rv < 0) { + printk(KERN_WARNING "%s: Error probing for PCI bus devices.\n", + MOD_NAME); + return rv; + } + + rv = ngbde_procfs_init(); + if (rv < 0) { + printk(KERN_WARNING "%s: Unable to initialize proc files\n", + MOD_NAME); + return rv; + } + + printk(KERN_INFO "Broadcom NGBDE loaded successfully\n"); + return 0; +} diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_pci_probe.c b/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_pci_probe.c new file mode 100644 index 000000000000..37da39cd38a7 --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_pci_probe.c @@ -0,0 +1,211 @@ +/*! \file ngbde_pci_probe.c + * + * NG BDE probe for PCI devices. + * + */ +/* + * $Copyright: Copyright 2018-2020 Broadcom. All rights reserved. + * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * A copy of the GNU General Public License version 2 (GPLv2) can + * be found in the LICENSES folder.$ + */ + +#include + +/*! \cond */ +static int use_msi = 1; +module_param(use_msi, int, 0); +MODULE_PARM_DESC(use_msi, +"Use MSI interrupts if supported by the kernel (default 1)."); +/*! \endcond */ + +/*! \cond */ +static int pci_debug = 0; +module_param(pci_debug, int, 0); +MODULE_PARM_DESC(pci_debug, +"PCI debug output enable (default 0)."); +/*! \endcond */ + +/*! + * Use BCMDRD_DEVLIST_ENTRY macro to generate a device list based on + * supported/installed devices. + */ +#define BCMDRD_DEVLIST_ENTRY(_nm,_vn,_dv,_rv,_md,_pi,_bd,_bc,_fn,_cn,_pf,_pd,_r0,_r1) \ + { _vn, _dv, PCI_ANY_ID, PCI_ANY_ID }, + +/*! Include all chip variants in the list of supported devices. */ +#define BCMDRD_DEVLIST_INCLUDE_ALL + +static struct pci_device_id pci_id_table[] = { +#include + { BROADCOM_VENDOR_ID, 0xb524, PCI_ANY_ID, PCI_ANY_ID }, + { BROADCOM_VENDOR_ID, 0xb684, PCI_ANY_ID, PCI_ANY_ID }, + { 0, 0, 0, 0 } +}; + +static int +pci_probe(struct pci_dev *pci_dev, const struct pci_device_id *ent) +{ + int rv; + int bdx; + int cmic_bar = 0; + uint8_t rev; + struct ngbde_dev_s ngbde_dev, *nd = &ngbde_dev; + int bus_no = pci_dev->bus ? pci_dev->bus->number : 0; + int slot_no = PCI_SLOT(pci_dev->devfn); + + if (PCI_FUNC(pci_dev->devfn) > 0) { + return 0; + } + + if (pci_debug) { + printk("PCI: pci_probe: bus %d slot %d: %04x:%04x\n", + bus_no, slot_no, + pci_dev->vendor, pci_dev->device); + } + + memset(nd, 0, sizeof(*nd)); + nd->pci_dev = pci_dev; + nd->dma_dev = &pci_dev->dev; + nd->vendor_id = pci_dev->vendor; + nd->device_id = pci_dev->device; + nd->bus_no = bus_no; + nd->slot_no = slot_no; + + /* PCI revision must extracted "manually */ + pci_read_config_byte(pci_dev, PCI_REVISION_ID, &rev); + nd->revision = rev; + + if (pci_enable_device(pci_dev)) { + printk(KERN_WARNING "%s: Cannot enable PCI device: " + "vendor_id = %x, device_id = %x\n", + MOD_NAME, pci_dev->vendor, pci_dev->device); + } + pci_set_master(pci_dev); + + /* IRQ number is only valid if PCI device is enabled */ + nd->irq_line = pci_dev->irq; + + /* Check for iProc */ + if (pci_resource_len(pci_dev, 2)) { + nd->iowin[1].addr = pci_resource_start(pci_dev, 0); + nd->iowin[1].size = pci_resource_len(pci_dev, 0); + cmic_bar = 2; + } + nd->iowin[0].addr = pci_resource_start(pci_dev, cmic_bar); + nd->iowin[0].size = pci_resource_len(pci_dev, cmic_bar); + + /* Verify basic I/O access by reading first word of each BAR window */ + for (bdx = 0; bdx < 2; bdx++) { + if (nd->iowin[bdx].size == 0) { + continue; + } + if (ngbde_pio_map(nd, nd->iowin[bdx].addr, nd->iowin[bdx].size)) { + if (pci_debug) { + printk("PCI: BAR %d adddress 0 = 0x%x\n", + bdx, (unsigned int)ngbde_pio_read32(nd, 0)); + } + ngbde_pio_unmap(nd); + } else { + printk(KERN_WARNING "%s: Cannot map PCI BAR %d: " + "start = %08lx, len = %lx\n", + MOD_NAME, bdx, + (unsigned long)nd->iowin[bdx].addr, + (unsigned long)nd->iowin[bdx].size); + } + } + + spin_lock_init(&nd->lock); + + /* Determine MSI configuration by enabling MSI on the device */ + nd->use_msi = use_msi; + if (nd->use_msi) { + if (pci_enable_msi(nd->pci_dev) == 0) { + pci_disable_msi(nd->pci_dev); + } else { + nd->use_msi = 0; + } + } + + rv = ngbde_swdev_add(nd); + + if (rv == 0) { + /* Update DMA pools for all devices */ + rv = ngbde_dma_init(); + if (rv < 0) { + printk(KERN_WARNING "%s: Error initializing DMA memory\n", + MOD_NAME); + /* Mark device as inactive */ + nd->inactive = 1; + } + } + + return rv; +} + +static void +pci_remove(struct pci_dev* pci_dev) +{ + struct ngbde_dev_s *swdev; + unsigned int num_swdev, idx; + int bus_no = pci_dev->bus ? pci_dev->bus->number : 0; + int slot_no = PCI_SLOT(pci_dev->devfn); + + if (pci_debug) { + printk("PCI: pci_remove: bus %d slot %d: %04x:%04x\n", + bus_no, slot_no, + pci_dev->vendor, pci_dev->device); + } + + ngbde_swdev_get_all(&swdev, &num_swdev); + for (idx = 0; idx < num_swdev; idx++) { + if (swdev[idx].bus_no == bus_no && + swdev[idx].slot_no == slot_no) { + if (swdev[idx].inactive) { + printk(KERN_WARNING "%s: Device already removed\n", + MOD_NAME); + } + /* Active device in this slot already? */ + swdev[idx].inactive = 1; + } + } + + /* Update DMA pools for all devices */ + ngbde_dma_cleanup(); +} + +static struct pci_driver pci_driver = { + .name = MOD_NAME, + .probe = pci_probe, + .remove = pci_remove, + .id_table = pci_id_table, + /* The rest are dynamic */ +}; + +int +ngbde_pci_probe(void) +{ + if (pci_register_driver(&pci_driver) < 0) { + return -ENODEV; + } + + return 0; +} + +int +ngbde_pci_cleanup(void) +{ + pci_unregister_driver(&pci_driver); + + return 0; +} diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_pgmem.c b/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_pgmem.c new file mode 100644 index 000000000000..e473f0c545cb --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_pgmem.c @@ -0,0 +1,472 @@ +/*! \file ngbde_pgmem.c + * + * \brief PGMEM allocator. + * + * This module is used to allocate large physically contiguous memory + * blocks using the Linux kernel page allocator. + * + * The Linux page allocator can allocate contiguous memory up until a + * certain size, which depends on the kernel version and the CPU + * architecture. + * + * If a larger contiguous memory block is requested, then we need to + * allocate multiple blocks from the Linux page allocator and then + * check if which ones are contiguous. + * + * The smaller memory blocks from which the larger block is assembled + * are referred to as "chunks". + * + * The PGMEM allocator will continue to allocate chunks from the Linux + * page allocator, until a contiguous memory block of the requested + * size has been assembled, or until a predefined maximum number of + * chunks have been allocated. Obviously the process is also stopped + * if the Linux page allocator returns an error. + * + * A physically contiguous memory block assembled from smaller memory + * chunks are referred to as "cmblocks". + * + * The chance of success depends on the requested memory block size as + * well as the fragmentation level of the system memory, i.e. the + * sooner after system boot these memory block are requested, the more + * likely these requests are to succeed. + */ +/* + * $Copyright: Copyright 2018-2020 Broadcom. All rights reserved. + * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * A copy of the GNU General Public License version 2 (GPLv2) can + * be found in the LICENSES folder.$ + */ + +#include + + +/******************************************************************************* + * Local definitions + ******************************************************************************/ + +/*! Maximum size the kernel can allocate in a single allocation. */ +#define MEM_CHUNK_SIZE_MAX (1 << (MAX_ORDER - 1 + PAGE_SHIFT)) + +/*! Default block size we wil request from the kernel. */ +#define MEM_CHUNK_SIZE_DEFAULT (512 * ONE_KB) + +/*! \cond */ +static int pgmem_chunk_size = 0; +module_param(pgmem_chunk_size, int, 0); +MODULE_PARM_DESC(pgmem_chunk_size, +"Memory chunk size in KB used by page allocator (default auto)."); +/*! \endcond */ + +/*! \cond */ +static int pgmem_debug = 0; +module_param(pgmem_debug, int, 0); +MODULE_PARM_DESC(pgmem_debug, +"Enable page memory allocator debug output (default 0)."); +/*! \endcond */ + +/*! Helper macro for debug trace output. */ +#define PGMEM_TRACE(_s) \ + do { \ + if (pgmem_debug) { \ + printk(_s); \ + } \ + } while (0) + +/*! + * Chunk memory block descriptor. + */ +typedef struct cmblock_desc_s { + + /*! Linked-list handle. */ + struct list_head list; + + /*! Requested cmblock size. */ + unsigned long req_size; + + /*! Memory chunk size. */ + unsigned long chunk_size; + + /*! Memory chunk size in alternate format (2^x). */ + unsigned long chunk_order; + + /*! Current cmblock size. */ + unsigned long cmblk_size; + + /*! Logical address of cmblock. */ + unsigned long cmblk_begin; + + /*! Logical end address of cmblock. */ + unsigned long cmblk_end; + + /*! Array of logical chunk addresses. */ + unsigned long *chunk_ptr; + + /*! Maximum number of chunks to allocate. */ + int chunk_cnt_max; + + /*! Current number of chunks allocated. */ + int chunk_cnt; + +} cmblock_desc_t; + +static LIST_HEAD(cmblocks_list); + + +/*! + * \name Chunk tag mask. + * \anchor CT_xxx + * + * The lower two bits of the chunk address is used to tag the chunk + * with its current state. + */ +#define CT_MASK 0x3 + +/*! Chunk is untagged. */ +#define CT_UNTAGGED 0 + +/*! Chunk was discarded. */ +#define CT_DISCARDED 1 + +/*! Chunk is part of largest cmblock. */ +#define CT_LARGEST 2 + +/*! Chunk is part of current cmblock. */ +#define CT_CURRENT 3 + +/*! Set block as untagged. */ +#define CTAG_SET(_a, _t) \ + do { \ + (_a) &= ~CT_MASK; \ + (_a) |= _t; \ + } while (0) + +/*! Set block as untagged. */ +#define CTAG_GET(_a) \ + ((_a) & CT_MASK) + + +/******************************************************************************* + * Private Functions + ******************************************************************************/ + +/*! + * \brief Find largest contiguous memory block. + * + * Find largest contiguous memory block from a pool of memory chunks. + * + * Assembly stops if a cmblock of the requested cmblock size has been + * obtained. + * + * The lower two address bits of the memory chunks are encoded as a + * tag according to \ref CT_xxx. + * + * \param [in] cmbd cmblock descriptor. + * + * \return Always 0. + */ +static int +find_largest_cmblock(cmblock_desc_t *cmbd) +{ + int i, j, chunks, found; + unsigned long b, e, a; + unsigned long *cptr; + + /* Convenience variable */ + chunks = cmbd->chunk_cnt; + cptr = cmbd->chunk_ptr; + + /* Clear all chunk tags */ + for (i = 0; i < chunks; i++) { + CTAG_SET(cptr[i], CT_UNTAGGED); + } + for (i = 0; i < chunks && cmbd->cmblk_size < cmbd->req_size; i++) { + /* First chunk must be an untagged chunk */ + if (CTAG_GET(cptr[i]) == CT_UNTAGGED) { + /* Initial cmblock size is the chunk size */ + b = cptr[i]; + e = b + cmbd->chunk_size; + CTAG_SET(cptr[i], CT_CURRENT); + /* Loop looking for adjacent chunks */ + do { + found = 0; + for (j = i + 1; j < chunks && (e - b) < cmbd->req_size; j++) { + a = cptr[j]; + /* Check untagged chunks only */ + if (CTAG_GET(a) == CT_UNTAGGED) { + if (a == (b - cmbd->chunk_size)) { + /* Found adjacent chunk below current cmblock */ + CTAG_SET(cptr[j], CT_CURRENT); + b = a; + found = 1; + } else if (a == e) { + /* Found adjacent chunk above current cmblock */ + CTAG_SET(cptr[j], CT_CURRENT); + e += cmbd->chunk_size; + found = 1; + } + } + } + } while (found); + /* Now check the size of the assembled memory block */ + if ((e - b) > cmbd->cmblk_size) { + /* The current block is largest so far */ + cmbd->cmblk_begin = b; + cmbd->cmblk_end = e; + cmbd->cmblk_size = e - b; + /* Re-tag current and previous largest cmblock */ + for (j = 0; j < chunks; j++) { + if (CTAG_GET(cptr[j]) == CT_CURRENT) { + /* Tag current cmblock as the largest */ + CTAG_SET(cptr[j], CT_LARGEST); + } else if (CTAG_GET(cptr[j]) == CT_LARGEST) { + /* Discard previous largest cmblock */ + CTAG_SET(cptr[j], CT_DISCARDED); + } + } + } else { + /* Discard all chunks in current cmblock */ + for (j = 0; j < chunks; j++) { + if (CTAG_GET(cptr[j]) == CT_CURRENT) { + CTAG_SET(cptr[j], CT_DISCARDED); + } + } + } + } + } + return 0; +} + +/*! + * \brief Allocate memory chunks and add them to the pool. + * + * Memory chunks are allocated using the kernel page allocator. + * + * \param [in] cmbd - cmblock descriptor. + * \param [in] chunks - Number of memory chunks to allocate. + * + * \return 0 if no errors, otherwise -1. + */ +static int +alloc_mem_chunks(cmblock_desc_t *cmbd, int chunks) +{ + int i, start; + unsigned long addr; + + if (cmbd->chunk_cnt + chunks > cmbd->chunk_cnt_max) { + printk("PGMEM: No more memory chunks\n"); + return -1; + } + start = cmbd->chunk_cnt; + cmbd->chunk_cnt += chunks; + for (i = start; i < cmbd->chunk_cnt; i++) { + /* Get chunk from kernel allocator */ + addr = __get_free_pages(GFP_KERNEL | GFP_DMA32, cmbd->chunk_order); + PGMEM_TRACE("."); + if (addr) { + cmbd->chunk_ptr[i] = addr; + } else { + printk("PGMEM: Page memory allocation failed\n"); + return -1; + } + } + return 0; +} + +/*! + * \brief Allocate large physically contiguous memory block. + * + * If we cannot allocate a sufficiently large block of contiguous + * memory from the kernel, then we simply keep allocating smaller + * chunks until we can assemble a contiguous block of the desired + * size. + * + * When maximum amount of system memory has been allocated without the + * successful assembly of a contiguous memory block, the allocation + * function will return the largest contiguous block found so far. It + * is then up to the calling function to decide whether this amount is + * sufficient to proceed. + * + * \param [in] size Requested memory block size. + * \param [in] chunk_size Assemble cmblock from chunks of this size. + * + * \return Pointer to cmblock descriptor, or NULL if error. + */ +static cmblock_desc_t * +cmblock_alloc(size_t size, size_t chunk_size) +{ + cmblock_desc_t *cmbd; + int i, chunk_ptr_size; + unsigned long page_addr; + struct sysinfo si; + + /* Sanity check */ + if (size == 0 || chunk_size == 0) { + return NULL; + } + + /* Allocate an initialize memory cmblock descriptor */ + if ((cmbd = kmalloc(sizeof(cmblock_desc_t), GFP_KERNEL)) == NULL) { + return NULL; + } + memset(cmbd, 0, sizeof(*cmbd)); + cmbd->req_size = size; + cmbd->chunk_size = PAGE_ALIGN(chunk_size); + while ((PAGE_SIZE << cmbd->chunk_order) < cmbd->chunk_size) { + cmbd->chunk_order++; + } + + /* Determine the maximum possible number of memory chunks */ + si_meminfo(&si); + cmbd->chunk_cnt_max = (si.totalram << PAGE_SHIFT) / cmbd->chunk_size; + chunk_ptr_size = cmbd->chunk_cnt_max * sizeof(unsigned long); + + /* Allocate an initialize memory chunk pool */ + cmbd->chunk_ptr = kmalloc(chunk_ptr_size, GFP_KERNEL); + if (cmbd->chunk_ptr == NULL) { + kfree(cmbd); + return NULL; + } + memset(cmbd->chunk_ptr, 0, chunk_ptr_size); + + /* Allocate minimum number of memory chunks */ + (void)alloc_mem_chunks(cmbd, cmbd->req_size / cmbd->chunk_size); + + /* Allocate more chunks until we have a complete cmblock */ + do { + find_largest_cmblock(cmbd); + PGMEM_TRACE("o"); + if (cmbd->cmblk_size >= cmbd->req_size) { + break; + } + } while (alloc_mem_chunks(cmbd, 8) == 0); + + /* Reserve all pages in the cmblock and free unused chunks */ + for (i = 0; i < cmbd->chunk_cnt; i++) { + if (CTAG_GET(cmbd->chunk_ptr[i]) == CT_LARGEST) { + CTAG_SET(cmbd->chunk_ptr[i], CT_UNTAGGED); + for (page_addr = cmbd->chunk_ptr[i]; + page_addr < cmbd->chunk_ptr[i] + cmbd->chunk_size; + page_addr += PAGE_SIZE) { + SetPageReserved(virt_to_page((void *)page_addr)); + } + } else if (cmbd->chunk_ptr[i]) { + CTAG_SET(cmbd->chunk_ptr[i], CT_UNTAGGED); + free_pages(cmbd->chunk_ptr[i], cmbd->chunk_order); + PGMEM_TRACE("x"); + cmbd->chunk_ptr[i] = 0; + } + } + PGMEM_TRACE("O\n"); + return cmbd; +} + +/*! + * \brief Free cmblock and associated resources. + * + * Free all memory chunks and other associated resources associated + * with a contiguous memory block. + * + * See alse \ref cmblock_alloc. + * + * \param [in] cmbd Command block descriptor to free. + * + * \return Nothing. + */ +static void +cmblock_free(cmblock_desc_t *cmbd) +{ + int i; + unsigned long page_addr; + + if (cmbd->chunk_ptr) { + for (i = 0; i < cmbd->chunk_cnt; i++) { + if (cmbd->chunk_ptr[i]) { + for (page_addr = cmbd->chunk_ptr[i]; + page_addr < cmbd->chunk_ptr[i] + cmbd->chunk_size; + page_addr += PAGE_SIZE) { + ClearPageReserved(virt_to_page((void *)page_addr)); + } + free_pages(cmbd->chunk_ptr[i], cmbd->chunk_order); + PGMEM_TRACE("X"); + } + } + kfree(cmbd->chunk_ptr); + kfree(cmbd); + } +} + + +/******************************************************************************* + * Public Functions + ******************************************************************************/ + +void * +ngbde_pgmem_alloc(size_t size, gfp_t flags) +{ + cmblock_desc_t *cmbd; + size_t chunk_size; + + chunk_size = size; + + if (pgmem_chunk_size > 0) { + chunk_size = pgmem_chunk_size * ONE_KB; + } + + if (chunk_size > MEM_CHUNK_SIZE_MAX) { + chunk_size = MEM_CHUNK_SIZE_DEFAULT; + } + + if (pgmem_debug) { + printk("PGMEM: Allocate %d MB in %d KB chunks\n", + (int)(size / ONE_MB), (int)(chunk_size / ONE_KB)); + } + + if ((cmbd = cmblock_alloc(size, chunk_size)) == NULL) { + return NULL; + } + if (cmbd->cmblk_size < size) { + /* If we didn't get the full size then forget it */ + cmblock_free(cmbd); + return NULL; + } + list_add(&cmbd->list, &cmblocks_list); + return (void *)cmbd->cmblk_begin; +} + +int +ngbde_pgmem_free(void *ptr) +{ + struct list_head *pos; + + list_for_each(pos, &cmblocks_list) { + cmblock_desc_t *cmbd = list_entry(pos, cmblock_desc_t, list); + if (ptr == (void *)cmbd->cmblk_begin) { + list_del(&cmbd->list); + cmblock_free(cmbd); + return 0; + } + } + return -1; +} + +void +ngbde_pgmem_free_all(void) +{ + struct list_head *pos, *tmp; + + list_for_each_safe(pos, tmp, &cmblocks_list) { + cmblock_desc_t *cmbd = list_entry(pos, cmblock_desc_t, list); + list_del(&cmbd->list); + cmblock_free(cmbd); + } +} diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_pio.c b/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_pio.c new file mode 100644 index 000000000000..cab094a2feca --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_pio.c @@ -0,0 +1,97 @@ +/*! \file ngbde_pio.c + * + * API for managing and accessing memory-mapped I/O for switch + * registers. + * + */ +/* + * $Copyright: Copyright 2018-2020 Broadcom. All rights reserved. + * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * A copy of the GNU General Public License version 2 (GPLv2) can + * be found in the LICENSES folder.$ + */ + +#include + +void * +ngbde_pio_map(void *devh, phys_addr_t addr, phys_addr_t size) +{ + struct ngbde_dev_s *sd = (struct ngbde_dev_s *)devh; + + if (sd->pio_mem) { + if (addr == sd->pio_win.addr && size == sd->pio_win.size) { + /* Already mapped */ + return sd->pio_mem; + } + ngbde_pio_unmap(devh); + } + + sd->pio_mem = ioremap_nocache(addr, size); + + if (sd->pio_mem) { + /* Save mapped resources */ + sd->pio_win.addr = addr; + sd->pio_win.size = size; + } else { + printk(KERN_WARNING "%s: Unable to map address 0x%08lu\n", + MOD_NAME, (unsigned long)addr); + } + + return sd->pio_mem; +} + +void +ngbde_pio_unmap(void *devh) +{ + struct ngbde_dev_s *sd = (struct ngbde_dev_s *)devh; + + if (sd->pio_mem) { + iounmap(sd->pio_mem); + sd->pio_mem = NULL; + } +} + +void +ngbde_pio_cleanup(void) +{ + struct ngbde_dev_s *swdev, *sd; + unsigned int num_swdev, idx; + + ngbde_swdev_get_all(&swdev, &num_swdev); + + for (idx = 0; idx < num_swdev; idx++) { + sd = ngbde_swdev_get(idx); + ngbde_pio_unmap(sd); + } +} + +void +ngbde_pio_write32(void *devh, uint32_t offs, uint32_t val) +{ + struct ngbde_dev_s *sd = (struct ngbde_dev_s *)devh; + + if (sd->pio_mem) { + NGBDE_IOWRITE32(val, sd->pio_mem + offs); + } +} + +uint32_t +ngbde_pio_read32(void *devh, uint32_t offs) +{ + struct ngbde_dev_s *sd = (struct ngbde_dev_s *)devh; + + if (sd->pio_mem) { + return NGBDE_IOREAD32(sd->pio_mem + offs); + } + return 0; +} diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_procfs.c b/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_procfs.c new file mode 100644 index 000000000000..f99339a5b0dc --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_procfs.c @@ -0,0 +1,120 @@ +/*! \file ngbde_procfs.c + * + * + * + */ +/* + * $Copyright: Copyright 2018-2020 Broadcom. All rights reserved. + * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * A copy of the GNU General Public License version 2 (GPLv2) can + * be found in the LICENSES folder.$ + */ + +#include + +static int +proc_show(struct seq_file *m, void *v) +{ + struct ngbde_dev_s *swdev; + unsigned int num_swdev, idx; + struct ngbde_dmamem_s *dmamem; + unsigned int pool; + unsigned int dma_pools; + char *dma_str; + + ngbde_swdev_get_all(&swdev, &num_swdev); + + seq_printf(m, "Broadcom Device Enumerator (%s)\n", MOD_NAME); + + seq_printf(m, "Found %d switch device(s):\n", num_swdev); + for (idx = 0; idx < num_swdev; idx++) { + if (swdev->inactive) { + seq_printf(m, "%d:removed\n", idx); + continue; + } + seq_printf(m, "%d:%04x:%04x:%02x,%s(%d)\n", idx, + swdev->vendor_id, swdev->device_id, swdev->revision, + swdev->use_msi ? "MSI" : "IRQ", swdev->irq_line); + } + + seq_printf(m, "DMA pools:\n"); + for (idx = 0; idx < num_swdev; idx++) { + seq_printf(m, "%d", idx); + dma_pools = 0; + for (pool = 0; pool < NGBDE_NUM_DMAPOOL_MAX; pool++) { + dmamem = &swdev[idx].dmapool[pool].dmamem; + dma_str = "unknown"; + if (dmamem->type == NGBDE_DMA_T_NONE) { + /* Skip empty DMA pools */ + continue; + } else if (dmamem->type == NGBDE_DMA_T_KAPI) { + dma_str = "kapi"; + } else if (dmamem->type == NGBDE_DMA_T_PGMEM) { + dma_str = "pgmem"; + } + seq_printf(m, ":%dMB@0x%08lx(%s)", + (int)(dmamem->size / ONE_MB), + (unsigned long)dmamem->baddr, dma_str); + dma_pools++; + } + if (dma_pools == 0) { + seq_printf(m, ":none"); + } + seq_printf(m, "\n"); + } + + return 0; +} + +static int +proc_open(struct inode *inode, struct file *file) +{ + return single_open(file, proc_show, NULL); +} + +static int +proc_release(struct inode *inode, struct file *file) +{ + return single_release(inode, file); +} + +static struct file_operations proc_fops = { + owner: THIS_MODULE, + open: proc_open, + read: seq_read, + llseek: seq_lseek, + release: proc_release, +}; + +int +ngbde_procfs_init(void) +{ + struct proc_dir_entry *entry; + + PROC_CREATE(entry, MOD_NAME, 0666, NULL, &proc_fops); + + if (entry == NULL) { + printk(KERN_ERR "ngbde: proc_create failed\n"); + return -1; + } + + return 0; +} + +int +ngbde_procfs_cleanup(void) +{ + remove_proc_entry(MOD_NAME, NULL); + + return 0; +} diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_swdev.c b/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_swdev.c new file mode 100644 index 000000000000..60d328ad2526 --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/linux/bde/ngbde_swdev.c @@ -0,0 +1,79 @@ +/*! \file ngbde_swdev.c + * + * + * + */ +/* + * $Copyright: Copyright 2018-2020 Broadcom. All rights reserved. + * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * A copy of the GNU General Public License version 2 (GPLv2) can + * be found in the LICENSES folder.$ + */ + +#include + +/* Switch devices */ +static struct ngbde_dev_s swdevs[NGBDE_NUM_SWDEV_MAX]; + +/* Number of probed switch devices */ +static unsigned int num_swdev; + +int +ngbde_swdev_add(struct ngbde_dev_s *nd) +{ + unsigned int idx; + + /* Look for existing slot */ + for (idx = 0; idx < num_swdev; idx++) { + if (swdevs[idx].bus_no == nd->bus_no && + swdevs[idx].slot_no == nd->slot_no) { + if (swdevs[idx].inactive) { + memcpy(&swdevs[idx], nd, sizeof(swdevs[0])); + return 0; + } + /* Active device in this slot already? */ + printk(KERN_WARNING "%s: Device exists\n", + MOD_NAME); + return -EBUSY; + } + } + + /* Add new device */ + if (num_swdev >= NGBDE_NUM_SWDEV_MAX) { + return -ENOMEM; + } + memcpy(&swdevs[num_swdev], nd, sizeof(swdevs[0])); + ++num_swdev; + return 0; +} + +struct ngbde_dev_s * +ngbde_swdev_get(int kdev) +{ + if ((unsigned int)kdev < num_swdev) { + return &swdevs[kdev]; + } + return NULL; +} + +int +ngbde_swdev_get_all(struct ngbde_dev_s **nd, unsigned int *num_nd) +{ + if (nd) { + *nd = swdevs; + } + if (num_nd) { + *num_nd = num_swdev; + } + return 0; +} diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/include/lkm/lkm.h b/platform/broadcom/saibcm-modules/sdklt/linux/include/lkm/lkm.h new file mode 100644 index 000000000000..c0ba0a319767 --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/linux/include/lkm/lkm.h @@ -0,0 +1,126 @@ +/*! \file lkm.h + * + * + * + */ +/* + * $Copyright: Copyright 2018-2020 Broadcom. All rights reserved. + * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * A copy of the GNU General Public License version 2 (GPLv2) can + * be found in the LICENSES folder.$ + */ + +#ifndef LKM_H +#define LKM_H + +#include +#include +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) +#error Kernel too old +#endif +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0) +#include +#endif +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0) +#include +#endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39) +#include +#endif +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#ifdef CONFIG_DEVFS_FS +#include +#endif + +/* Compatibility Macros */ + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0) +#define PROC_CREATE(_entry, _name, _acc, _path, _fops) \ + do { \ + _entry = proc_create(_name, _acc, _path, _fops); \ + } while (0) + +#define PROC_CREATE_DATA(_entry, _name, _acc, _path, _fops, _data) \ + do { \ + _entry = proc_create_data(_name, _acc, _path, _fops, _data); \ + } while (0) + +#define PROC_PDE_DATA(_node) PDE_DATA(_node) +#else +#define PROC_CREATE(_entry, _name, _acc, _path, _fops) \ + do { \ + _entry = create_proc_entry(_name, _acc, _path); \ + if (_entry) { \ + _entry->proc_fops = _fops; \ + } \ + } while (0) + +#define PROC_CREATE_DATA(_entry, _name, _acc, _path, _fops, _data) \ + do { \ + _entry = create_proc_entry(_name, _acc, _path); \ + if (_entry) { \ + _entry->proc_fops = _fops; \ + _entry->data=_data; \ + } \ + } while (0) + +#define PROC_PDE_DATA(_node) PROC_I(_node)->pde->data +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0) +#define timer_arg(var, context, timer_fieldname) \ + (typeof(var))(context) +#define timer_context_t unsigned long +#else +#define timer_context_t struct timer_list * +#define timer_arg(var, context, timer_fieldname) \ + from_timer(var, context, timer_fieldname) +#endif + +#ifndef setup_timer +#define setup_timer(timer, fn, data) \ + timer_setup(timer, fn, 0) +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0) +static inline void page_ref_inc(struct page *page) +{ + atomic_inc(&page->_count); +} + +static inline void page_ref_dec(struct page *page) +{ + atomic_dec(&page->_count); +} +#endif + +#endif /* LKM_H */ diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/include/lkm/ngbde_ioctl.h b/platform/broadcom/saibcm-modules/sdklt/linux/include/lkm/ngbde_ioctl.h new file mode 100644 index 000000000000..b90486ce06f2 --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/linux/include/lkm/ngbde_ioctl.h @@ -0,0 +1,345 @@ +/*! \file ngbde_ioctl.h + * + * NGBDE device I/O control definitions. + * + * This file is intended for use in both kernel mode and user mode. + * + * IMPORTANT! + * All shared structures must be properly 64-bit aligned. + * + */ +/* + * $Copyright: Copyright 2018-2020 Broadcom. All rights reserved. + * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * A copy of the GNU General Public License version 2 (GPLv2) can + * be found in the LICENSES folder.$ + */ + +#ifndef NGBDE_IOCTL_H +#define NGBDE_IOCTL_H + +#include +#include + +/*! Must be updated if backward compatibility is broken. */ +#define NGBDE_IOC_VERSION 2 + +/*! LUBDE IOCTL command magic. */ +#define NGBDE_IOC_MAGIC 'L' + +/*! + * \name IOCTL commands for the NGBDE kernel module. + * \anchor NGBDE_IOC_xxx + * + * Note that we use __u64 for the IOCTL parameter size because + * sizeof(void *) is different between 32-bit and 64-bit code, and we + * need a 32-bit user mode application to generate the same IOCTL + * command codes as a 64-bit kernel when using the _IOW macro. + */ + +/*! \{ */ + +/*! Get kernel module information. */ +#define NGBDE_IOC_MOD_INFO _IOW(NGBDE_IOC_MAGIC, 0, __u64) + +/*! Get information about registered devices. */ +#define NGBDE_IOC_PROBE_INFO _IOW(NGBDE_IOC_MAGIC, 1, __u64) + +/*! Get detailed switch device information. */ +#define NGBDE_IOC_DEV_INFO _IOW(NGBDE_IOC_MAGIC, 2, __u64) + +/*! Get a physical memory address associated with a switch device. */ +#define NGBDE_IOC_PHYS_ADDR _IOW(NGBDE_IOC_MAGIC, 3, __u64) + +/*! Interrupt control command (see \ref NGBDE_ICTL_xxx). */ +#define NGBDE_IOC_INTR_CTRL _IOW(NGBDE_IOC_MAGIC, 4, __u64) + +/*! Add interrupt status/mask register for kernel to control. */ +#define NGBDE_IOC_IRQ_REG_ADD _IOW(NGBDE_IOC_MAGIC, 5, __u64) + +/*! Write to a shared interrupt mask register. */ +#define NGBDE_IOC_IRQ_MASK_WR _IOW(NGBDE_IOC_MAGIC, 6, __u64) + +/*! Map device registers in kernel space. */ +#define NGBDE_IOC_PIO_WIN_MAP _IOW(NGBDE_IOC_MAGIC, 7, __u64) + +/*! Map interrupt controller registers in kernel space. */ +#define NGBDE_IOC_IIO_WIN_MAP _IOW(NGBDE_IOC_MAGIC, 8, __u64) + +/*! Map PCI bridge registers in kernel space. */ +#define NGBDE_IOC_PAXB_WIN_MAP _IOW(NGBDE_IOC_MAGIC, 9, __u64) + +/*! Add interrupt ACK register for kernel to control. */ +#define NGBDE_IOC_INTR_ACK_REG_ADD _IOW(NGBDE_IOC_MAGIC, 10, __u64) + +/*! \} */ + +/*! IOCTL command return code for success. */ +#define NGBDE_IOC_SUCCESS 0 + +/*! IOCTL command return code for failure. */ +#define NGBDE_IOC_FAIL ((__u32)-1) + +/*! + * \name Device flags. + * \anchor NGBDE_DEV_F_xxx + */ + +/*! \{ */ + +/*! Message-signaled interrupts, PCI interrupts are operating in MSI mode. */ +#define NGBDE_DEV_F_MSI (1 << 0) + +/*! \} */ + +/*! + * \name Interrupt control commands. + * \anchor NGBDE_ICTL_xxx + */ + +/*! \{ */ + +/*! Connect interrupt handler. */ +#define NGBDE_ICTL_INTR_CONN 0 + +/*! Disconnect interrupt handler. */ +#define NGBDE_ICTL_INTR_DISC 1 + +/*! Wait for interrupt. */ +#define NGBDE_ICTL_INTR_WAIT 2 + +/*! Force waiting thread to return. */ +#define NGBDE_ICTL_INTR_STOP 3 + +/*! Clear list of interrupt status/mask registers. */ +#define NGBDE_ICTL_REGS_CLR 4 + +/*! \} */ + +/*! Kernel module information. */ +struct ngbde_ioc_mod_info_s { + + /*! IOCTL version used by kernel module. */ + __u16 version; +}; + +/*! Probing results. */ +struct ngbde_ioc_probe_info_s { + + /*! Number of switch devices. */ + __u16 num_swdev; +}; + +/*! Device information. */ +struct ngbde_ioc_dev_info_s { + + /*! Device type. */ + __u16 type; + + /*! Device flags (\ref NGBDE_DEV_F_xxx). */ + __u16 flags; + + /*! Vendor ID (typically the PCI vendor ID). */ + __u16 vendor_id; + + /*! Device ID (typically the PCI vendor ID). */ + __u16 device_id; + + /*! Device revision (typically the PCI device revision). */ + __u16 revision; + + /*! Device model (device-identification beyond PCI generic ID). */ + __u16 model; +}; + +/*! + * \name I/O resource types. + * \anchor NGBDE_IO_RSRC_xxx + */ + +/*! \{ */ + +/*! Memory-mapped I/O. */ +#define NGBDE_IO_RSRC_DEV_IO 0 + +/*! DMA memory pool. */ +#define NGBDE_IO_RSRC_DMA_MEM 1 + +/*! DMA memory pool as mapped by IOMMU. */ +#define NGBDE_IO_RSRC_DMA_BUS 2 + +/*! \} */ + +/*! + * \brief Resource ID (IOCTL input). + * + * This structure is used to query a physical address resource in the + * kernel module. The caller must provide a resource type (device I/O, + * DMA memory, etc.) and a resource instance number (e.g. a PCI BAR + * address will have multiple instances). + * + * Also see \ref ngbde_ioc_phys_addr_s. + */ +struct ngbde_ioc_rsrc_id_s { + + /*! Resource type (\ref NGBDE_IO_RSRC_xxx). */ + __u32 type; + + /*! Resource instance number. */ + __u32 inst; +}; + +/*! + * \brief Physical device address. + * + * This structure is returned in response to the \ref + * NGBDE_IOC_PHYS_ADDR command. The caller must identify the requested + * physical address using the \ref ngbde_ioc_rsrc_id_s structure. + */ +struct ngbde_ioc_phys_addr_s { + + /*! Physical address. */ + __u64 addr; + + /*! Resource size (in bytes). */ + __u32 size; +}; + +/*! Interrupt control operation */ +struct ngbde_ioc_intr_ctrl_s { + + /*! Interrupt instance for this device. */ + __u32 irq_num; + + /*! Interrupt control command. */ + __u32 cmd; +}; + +/*! Add interrupt register information. */ +struct ngbde_ioc_irq_reg_add_s { + + /*! Interrupt instance for this device. */ + __u32 irq_num; + + /*! Interrupt status register address offset. */ + __u32 status_reg; + + /*! Interrupt mask register address offset. */ + __u32 mask_reg; + + /*! Interrupt mask for interrupts handled by the kernel. */ + __u32 kmask; + + /*! Reserved for future use. */ + __u32 flags; +}; + +/*! + * \name Interrupt ACK register access flags. + * \anchor NGBDE_DEV_INTR_ACK_F_xxx + */ + +/*! \{ */ + +/*! ACK registers resides in PCI bridge I/O window. */ +#define NGBDE_DEV_INTR_ACK_F_PAXB (1 << 0) + +/*! \} */ + +/*! Add interrupt ACK register information. */ +struct ngbde_ioc_intr_ack_reg_add_s { + + /*! Interrupt instance for this device. */ + __u32 irq_num; + + /*! Interrupt ACK register address offset. */ + __u32 ack_reg; + + /*! Interrupt ACK value. */ + __u32 ack_val; + + /*! Flags to indicate ack_reg resides in PCI bridge window. */ + __u32 flags; +}; + +/*! Memory-mapped I/O window */ +struct ngbde_ioc_pio_win_s { + + /*! Physical address */ + __u64 addr; + + /*! Resource size */ + __u32 size; +}; + +/*! Interrupt mask register write */ +struct ngbde_ioc_irq_mask_wr_s { + + /*! Interrupt instance for this device. */ + __u32 irq_num; + + /*! Register offset. */ + __u32 offs; + + /*! Value to write. */ + __u32 val; +}; + +/*! IOCTL operation data. */ +union ngbde_ioc_op_s { + + /*! Get kernel module information. */ + struct ngbde_ioc_mod_info_s mod_info; + + /*! Get information about registered devices. */ + struct ngbde_ioc_probe_info_s probe_info; + + /*! Get detailed switch device information. */ + struct ngbde_ioc_dev_info_s dev_info; + + /*! Resource ID (input). */ + struct ngbde_ioc_rsrc_id_s rsrc_id; + + /*! Get a physical memory address associated with a switch device. */ + struct ngbde_ioc_phys_addr_s phys_addr; + + /*! Interrupt control command (see \ref NGBDE_ICTL_xxx). */ + struct ngbde_ioc_intr_ctrl_s intr_ctrl; + + /*! Add interrupt status/mask register for kernel to control. */ + struct ngbde_ioc_irq_reg_add_s irq_reg_add; + + /*! Add interrupt ACK register for kernel to control. */ + struct ngbde_ioc_intr_ack_reg_add_s intr_ack_reg_add; + + /*! Write to a shared interrupt mask register. */ + struct ngbde_ioc_irq_mask_wr_s irq_mask_wr; + + /*! Map device registers in kernel space. */ + struct ngbde_ioc_pio_win_s pio_win; +}; + +/*! IOCTL command message. */ +typedef struct ngbde_ioc_cmd_s { + + /*! Device handle. */ + __u32 devid; + + /*! Return code (0 means success). */ + __u32 rc; + + /*! IOCTL operation. */ + union ngbde_ioc_op_s op; +} ngbde_ioc_cmd_t; + +#endif /* NGBDE_IOCTL_H */ diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/include/lkm/ngbde_kapi.h b/platform/broadcom/saibcm-modules/sdklt/linux/include/lkm/ngbde_kapi.h new file mode 100644 index 000000000000..142aa63b572c --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/linux/include/lkm/ngbde_kapi.h @@ -0,0 +1,169 @@ +/*! \file ngbde_kapi.h + * + * NGBDE kernel API. + * + * This file is intended for use by other kernel modules relying on the BDE. + * + */ +/* + * $Copyright: Copyright 2018-2020 Broadcom. All rights reserved. + * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * A copy of the GNU General Public License version 2 (GPLv2) can + * be found in the LICENSES folder.$ + */ + +#ifndef NGBDE_KAPI_H +#define NGBDE_KAPI_H + +#include + +/*! Maximum number of switch devices supported. */ +#ifndef NGBDE_NUM_SWDEV_MAX +#define NGBDE_NUM_SWDEV_MAX 16 +#endif + +/*! + * \brief Get Linux PCI device handle for a switch device. + * + * \param [in] kdev Device number. + * + * \return Linux PCI device handle or NULL if unavailable. + */ +extern struct pci_dev * +ngbde_kapi_pci_dev_get(int kdev); + +/*! + * \brief Get Linux kernel device handle for a switch device. + * + * \param [in] kdev Device number. + * + * \return Linux kernel device handle or NULL if unavailable. + */ +extern struct device * +ngbde_kapi_dma_dev_get(int kdev); + +/*! + * \brief Convert DMA bus address to virtual address. + * + * This API will convert a physical DMA bus address to a kernel + * virtual address for a memory location that belongs to one of the + * DMA memory pools allocated by the BDE module. + * + * \param [in] kdev Device number. + * \param [in] baddr Physical DMA bus address for this device. + * + * \return Virtual kernel address or NULL on error. + */ +void * +ngbde_kapi_dma_bus_to_virt(int kdev, dma_addr_t baddr); + +/*! + * \brief Convert virtual address to DMA bus address. + * + * This API will convert a kernel virtual address to a physical DMA + * bus address for a memory location that belongs to one of the DMA + * memory pools allocated by the BDE module. + * + * \param [in] kdev Device number. + * \param [in] vaddr Virtual kernel address. + * + * \return Physical DMA bus address for this device or 0 on error. + */ +dma_addr_t +ngbde_kapi_dma_virt_to_bus(int kdev, void *vaddr); + +/*! + * \brief Write a memory-mapped register from kernel driver. + * + * \param [in] kdev Device number. + * \param [in] offs Register address offset. + * \param [in] val Value to write to register. + * + * \return Nothing. + */ +extern void +ngbde_kapi_pio_write32(int kdev, uint32_t offs, uint32_t val); + +/*! + * \brief Read a memory-mapped register from kernel driver. + * + * \param [in] kdev Device number. + * \param [in] offs Register address offset. + * + * \return Value read from register. + */ +extern uint32_t +ngbde_kapi_pio_read32(int kdev, uint32_t offs); + +/*! + * \brief Get base address fo memory-mapped I/O memory. + * + * The lgical base address returned can be used with ioread32, etc. + * + * \param [in] kdev Device number. + * + * \return Logical base address or NULL if unavailable. + */ +extern void * +ngbde_kapi_pio_membase(int kdev); + +/*! + * \brief Install kernel mode interrupt handler. + * + * \param [in] kdev Device number. + * \param [in] irq_num MSI interrupt number. + * \param [in] isr_func Interrupt handler function. + * \param [in] isr_data Interrupt handler context. + * + * \retval 0 No errors + */ +extern int +ngbde_kapi_intr_connect(int kdev, unsigned int irq_num, + int (*isr_func)(void *), void *isr_data); + +/*! + * \brief Uninstall kernel mode interrupt handler. + * + * \param [in] kdev Device number. + * \param [in] irq_num MSI interrupt number. + * + * \retval 0 No errors + */ +extern int +ngbde_kapi_intr_disconnect(int kdev, unsigned int irq_num); + +/*! + * \brief Write shared interrupt mask register. + * + * This function is used by an interrupt handler when a shared + * interrupt mask register needs to be updated. + * + * Note that the mask register to access is referenced by the + * corrsponding status register. This is because the mask register may + * be different depending on the host CPU interface being used + * (e.g. PCI vs. AXI). On the other hand, the status register is the + * same irrespective of the host CPU interface. + * + * \param [in] kdev Device number. + * \param [in] irq_num Interrupt number (MSI vector). + * \param [in] status_reg Corresponding interrupt status register offset. + * \param [in] mask_val New value to write to mask register. + * + * \retval 0 No errors + * \retval -1 Something went wrong. + */ +extern int +ngbde_kapi_intr_mask_write(int kdev, unsigned int irq_num, + uint32_t status_reg, uint32_t mask_val); + +#endif /* NGBDE_KAPI_H */ diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/include/lkm/ngknet_dev.h b/platform/broadcom/saibcm-modules/sdklt/linux/include/lkm/ngknet_dev.h new file mode 100644 index 000000000000..74d3d5b350b0 --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/linux/include/lkm/ngknet_dev.h @@ -0,0 +1,408 @@ +/*! \file ngknet_dev.h + * + * NGKNET device definitions. + * + * This file is intended for use in both kernel mode and user mode. + * + * IMPORTANT! + * All shared structures must be properly 64-bit aligned. + * + */ +/* + * $Copyright: Copyright 2018-2020 Broadcom. All rights reserved. + * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * A copy of the GNU General Public License version 2 (GPLv2) can + * be found in the LICENSES folder.$ + */ + +#ifndef NGKNET_DEV_H +#define NGKNET_DEV_H + +#include + +/*! Device name length */ +#define NGKNET_DEV_NAME_MAX 16 + +/*! Maximum number of virtual network devices */ +#ifndef NGKNET_NETIF_MAX +#define NUM_VDEV_MAX 128 +#else +#define NUM_VDEV_MAX NGKNET_NETIF_MAX +#endif + +/*! Maximum number of filters */ +#ifndef NGKNET_FILTER_MAX +#define NUM_FILTER_MAX 128 +#else +#define NUM_FILTER_MAX NGKNET_FILTER_MAX +#endif + +/*! + * \brief System network interface + * + * Network interface types: + * + * NGKNET_NETIF_T_VLAN + * Transmits to this interface will go to ingress PIPE of switch + * CPU port using specified VLAN ID. Packet will be switched. + * + * NGKNET_NETIF_T_PORT + * Transmits to this interface will go to unmodified to specified + * physical switch port. All switching logic is bypassed. Meta data + * should be provided when this interface is created. + * + * NGKNET_NETIF_T_META + * Transmits to this interface will be done using raw meta data + * as DMA descriptors. + * + * Network interface flags: + * + * NGKNET_NETIF_F_RCPU_ENCAP + * Use RCPU encapsulation for packets that enter and exit this + * interface. + * + * NGKNET_NETIF_F_ADD_TAG + * Add VLAN tag to packets sent directly to physical port. + * + * NGKNET_NETIF_F_BIND_CHAN + * Bind this interface to a Rx channel. + */ +/*! Max network interface name length */ +#define NGKNET_NETIF_NAME_MAX 16 +/*! Max network interface meta bytes */ +#define NGKNET_NETIF_META_MAX 16 +/*! Max netif user data in bytes */ +#define NGKNET_NETIF_USER_DATA 64 + +/*! Send packets to switch */ +#define NGKNET_NETIF_T_VLAN 0 +/*! Send packets to port */ +#define NGKNET_NETIF_T_PORT 1 +/*! Send packets with matadata attached */ +#define NGKNET_NETIF_T_META 2 + +/*! Send packets with RCPU encapsulation */ +#define NGKNET_NETIF_F_RCPU_ENCAP (1U << 0) +/*! Send packets with vlan tag */ +#define NGKNET_NETIF_F_ADD_TAG (1U << 1) +/*! Bind network interface to Rx channel */ +#define NGKNET_NETIF_F_BIND_CHAN (1U << 2) + +/*! + * \brief Network interface description. + */ +typedef struct ngknet_netif_s { + /*! This network interface ID */ + uint16_t id; + + /*! Next network interface ID */ + uint16_t next; + + /*! Network interface type */ + uint16_t type; + + /*! Network interface flags */ + uint16_t flags; + + /*! Network interface VLAN ID */ + uint16_t vlan; + + /*! Network interface MAC address */ + uint8_t macaddr[6]; + + /*! Network interface MTU */ + uint32_t mtu; + + /*! Network interface bound to channel */ + uint32_t chan; + + /*! Network interface name */ + char name[NGKNET_NETIF_NAME_MAX]; + + /*! Metadata offset from Ethernet header */ + uint16_t meta_off; + + /*! Metadata length */ + uint16_t meta_len; + + /*! Metadata used to send packets to physical port */ + uint8_t meta_data[NGKNET_NETIF_META_MAX]; + + /*! User data gotten back through callbacks */ + uint8_t user_data[NGKNET_NETIF_USER_DATA]; +} ngknet_netif_t; + +/*! + * \brief Packet filters + * + * Filters work like software TCAMs where a mask is applied to the + * source data, and the result is then compared to the filter data. + * + * Filters are checked in priority order with the lowest priority + * values being checked first (i.e. 0 is the highest priority). + * + * Filter types: + * + * NGKNET_FILTER_T_RX_PKT + * Filter data and mask are applied to the Rx DMA control block + * as well as to the Rx packet contents. + * + * Destination types: + * + * NGKNET_FILTER_DEST_T_NULL + * Packet is dropped. + * + * NGKNET_FILTER_DEST_T_NETIF + * Packet is sent to network interface with ID . + * + * NGKNET_FILTER_DEST_T_VNET + * Packet is sent to VNET in user space. + * + * Filter flags: + * + * NGKNET_FILTER_F_ANY_DATA + * When this flags is set the filter will match any packet on + * the associated unit. + * + * NGKNET_FILTER_F_STRIP_TAG + * Strip VLAN tag before packet is sent to destination. + */ +/*! Roundup to word */ +#define NGKNET_BYTES2WORDS(bytes) ((bytes + 3) / 4) + +/*! Max filter description length */ +#define NGKNET_FILTER_DESC_MAX 32 +/*! Max filter bytes size */ +#define NGKNET_FILTER_BYTES_MAX 256 +/*! Max filter words size */ +#define NGKNET_FILTER_WORDS_MAX NGKNET_BYTES2WORDS(NGKNET_FILTER_BYTES_MAX) +/*! Max filter user data in bytes */ +#define NGKNET_FILTER_USER_DATA 64 + +/*! Filter to Rx */ +#define NGKNET_FILTER_T_RX_PKT 1 + +/*! Drop packet */ +#define NGKNET_FILTER_DEST_T_NULL 0 +/*! Send packet to netif */ +#define NGKNET_FILTER_DEST_T_NETIF 1 +/*! Send packet to VNET */ +#define NGKNET_FILTER_DEST_T_VNET 2 +/*! Send packet to kernel callback function (BCMPKT_DEST_T_CALLBACK) */ +#define NGKNET_FILTER_DEST_T_CB 3 + +/*! Match any data */ +#define NGKNET_FILTER_F_ANY_DATA (1U << 0) +/*! Strip vlan tag */ +#define NGKNET_FILTER_F_STRIP_TAG (1U << 1) +/*! Match Rx channel */ +#define NGKNET_FILTER_F_MATCH_CHAN (1U << 2) +/*! Filter created with raw metadata */ +#define NGKNET_FILTER_F_RAW_PMD (1U << 15) + +/*! + * \brief Filter description. + */ +typedef struct ngknet_filter_s { + /*! This filter ID */ + uint16_t id; + + /*! Next filter ID */ + uint16_t next; + + /*! Filter type. Refer to \ref NGKNET_FILTER_T_XXX. */ + uint16_t type; + + /*! Filter flags. Refer to \ref NGKNET_FILTER_F_XXX. */ + uint16_t flags; + + /*! Filter priority */ + uint32_t priority; + + /*! Filter belong to */ + uint32_t chan; + + /*! Filter description */ + char desc[NGKNET_FILTER_DESC_MAX]; + + /*! Destination type. Refer to \ref NGKNET_FILTER_DEST_T_XXX. */ + uint16_t dest_type; + + /*! Destination network interface ID */ + uint16_t dest_id; + + /*! Destination network interface protocol type */ + uint16_t dest_proto; + + /*! Mirror type */ + uint16_t mirror_type; + + /*! Mirror network interface ID */ + uint16_t mirror_id; + + /*! Mirror network interface protocol type */ + uint16_t mirror_proto; + + /*! Out band data offset */ + uint16_t oob_data_offset; + + /*! Out band data size */ + uint16_t oob_data_size; + + /*! Packet data offset */ + uint16_t pkt_data_offset; + + /*! Packet data size */ + uint16_t pkt_data_size; + + /*! Filtering data */ + union { + uint8_t b[NGKNET_FILTER_BYTES_MAX]; + uint32_t w[NGKNET_FILTER_WORDS_MAX]; + } data; + + /*! Filtering mask */ + union { + uint8_t b[NGKNET_FILTER_BYTES_MAX]; + uint32_t w[NGKNET_FILTER_WORDS_MAX]; + } mask; + + /*! User data gotten back through callbacks */ + uint8_t user_data[NGKNET_FILTER_USER_DATA]; +} ngknet_filter_t; + +/*! + * \brief Device configure structure. + */ +typedef struct ngknet_dev_cfg_s { + /*! Device name */ + char name[NGKNET_DEV_NAME_MAX]; + + /*! Device type string */ + char type_str[NGKNET_DEV_NAME_MAX]; + + /*! Device ID */ + uint32_t dev_id; + + /*! Device mode */ + dev_mode_t mode; + + /*! Number of groups */ + uint32_t nb_grp; + + /*! Bitmap of groups */ + uint32_t bm_grp; + + /*! Rx packet header size */ + uint32_t rx_ph_size; + + /*! Tx packet header size */ + uint32_t tx_ph_size; + + /*! Base network interface */ + ngknet_netif_t base_netif; +} ngknet_dev_cfg_t; + +/*! + * \brief Channel configure structure. + */ +typedef struct ngknet_chan_cfg_s { + /*! Channel number */ + int chan; + + /*! Number of descriptors */ + uint32_t nb_desc; + + /*! Rx buffer size */ + uint32_t rx_buf_size; + + /*! Channel control */ + uint32_t chan_ctrl; + /*! Packet_byte_swap */ +#define NGKNET_PKT_BYTE_SWAP (1 << 0) + /*! Non packet_byte_swap */ +#define NGKNET_OTH_BYTE_SWAP (1 << 1) + /*! Header_byte_swap */ +#define NGKNET_HDR_BYTE_SWAP (1 << 2) + + /*! Rx or Tx */ + int dir; + /*! Rx channel */ +#define NGKNET_RX_CHAN 0 + /*! Tx channel */ +#define NGKNET_TX_CHAN 1 +} ngknet_chan_cfg_t; + +/*! + * \brief RCPU header structure. + */ +struct ngknet_rcpu_hdr { + /*! Destination MAC address */ + uint8_t dst_mac[6]; + + /*! Source MAC address */ + uint8_t src_mac[6]; + + /*! VLAN TPID */ + uint16_t vlan_tpid; + + /*! VLAN TCI */ + uint16_t vlan_tci; + + /*! Ethernet type */ + uint16_t eth_type; + + /*! Packet signature */ + uint16_t pkt_sig; + + /*! Operation code */ + uint8_t op_code; + + /*! Flags */ + uint8_t flags; + + /*! Transaction number */ + uint16_t trans_id; + + /*! Packet data length */ + uint16_t data_len; + + /*! Reserved must be 0 */ + uint16_t rsvd0; + + /*! packet meta data length */ + uint8_t meta_len; + + /*! Transmission queue number */ + uint8_t queue_id; + + /*! Reserved must be 0 */ + uint16_t rsvd1; +}; + +/*! RCPU Rx operation */ +#define RCPU_OPCODE_RX 0x10 +/*! RCPU Tx operation */ +#define RCPU_OPCODE_TX 0x20 + +/*! RCPU purge flag */ +#define RCPU_FLAG_PURGE (1 << 0) +/*! RCPU pause flag */ +#define RCPU_FLAG_PAUSE (1 << 1) +/*! RCPU modhdr flag */ +#define RCPU_FLAG_MODHDR (1 << 2) +/*! RCPU bind queue flag */ +#define RCPU_FLAG_BIND_QUE (1 << 3) + +#endif /* NGKNET_DEV_H */ + diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/include/lkm/ngknet_ioctl.h b/platform/broadcom/saibcm-modules/sdklt/linux/include/lkm/ngknet_ioctl.h new file mode 100644 index 000000000000..6da52c778191 --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/linux/include/lkm/ngknet_ioctl.h @@ -0,0 +1,112 @@ +/*! \file ngknet_ioctl.h + * + * NGKNET I/O control definitions. + * + * This file is intended for use in both kernel mode and user mode. + * + * IMPORTANT! + * All shared structures must be properly 64-bit aligned. + * + */ +/* + * $Copyright: Copyright 2018-2020 Broadcom. All rights reserved. + * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * A copy of the GNU General Public License version 2 (GPLv2) can + * be found in the LICENSES folder.$ + */ + +#ifndef NGKNET_IOCTL_H +#define NGKNET_IOCTL_H + +/*! Module information */ +#define NGKNET_MODULE_NAME "linux_ngknet" +#define NGKNET_MODULE_MAJOR 121 + +/*! Must be updated if backward compatibility is broken */ +#define NGKNET_IOC_VERSION 2 + +/*! Max number of input arguments */ +#define NGKNET_IOC_IARG_MAX 2 + +#define NGKNET_IOC_MAGIC 'K' + +#define NGKNET_VERSION_GET _IOR(NGKNET_IOC_MAGIC, 0xa0, unsigned int) +#define NGKNET_RX_RATE_LIMIT _IOWR(NGKNET_IOC_MAGIC, 0xa1, unsigned int) +#define NGKNET_DEV_INIT _IOWR(NGKNET_IOC_MAGIC, 0xb0, unsigned int) +#define NGKNET_DEV_DEINIT _IOWR(NGKNET_IOC_MAGIC, 0xb1, unsigned int) +#define NGKNET_DEV_SUSPEND _IOWR(NGKNET_IOC_MAGIC, 0xb2, unsigned int) +#define NGKNET_DEV_RESUME _IOWR(NGKNET_IOC_MAGIC, 0xb3, unsigned int) +#define NGKNET_DEV_VNET_WAIT _IOWR(NGKNET_IOC_MAGIC, 0xb4, unsigned int) +#define NGKNET_DEV_HNET_WAKE _IOWR(NGKNET_IOC_MAGIC, 0xb5, unsigned int) +#define NGKNET_DEV_VNET_DOCK _IOWR(NGKNET_IOC_MAGIC, 0xb6, unsigned int) +#define NGKNET_DEV_VNET_UNDOCK _IOWR(NGKNET_IOC_MAGIC, 0xb7, unsigned int) +#define NGKNET_QUEUE_CONFIG _IOWR(NGKNET_IOC_MAGIC, 0xc0, unsigned int) +#define NGKNET_QUEUE_QUERY _IOR(NGKNET_IOC_MAGIC, 0xc1, unsigned int) +#define NGKNET_RCPU_CONFIG _IOWR(NGKNET_IOC_MAGIC, 0xc2, unsigned int) +#define NGKNET_RCPU_GET _IOR(NGKNET_IOC_MAGIC, 0xc3, unsigned int) +#define NGKNET_NETIF_CREATE _IOWR(NGKNET_IOC_MAGIC, 0xd0, unsigned int) +#define NGKNET_NETIF_DESTROY _IOWR(NGKNET_IOC_MAGIC, 0xd1, unsigned int) +#define NGKNET_NETIF_GET _IOR(NGKNET_IOC_MAGIC, 0xd2, unsigned int) +#define NGKNET_NETIF_NEXT _IOR(NGKNET_IOC_MAGIC, 0xd3, unsigned int) +#define NGKNET_NETIF_LINK_SET _IOW(NGKNET_IOC_MAGIC, 0xd4, unsigned int) +#define NGKNET_FILT_CREATE _IOWR(NGKNET_IOC_MAGIC, 0xe0, unsigned int) +#define NGKNET_FILT_DESTROY _IOWR(NGKNET_IOC_MAGIC, 0xe1, unsigned int) +#define NGKNET_FILT_GET _IOR(NGKNET_IOC_MAGIC, 0xe2, unsigned int) +#define NGKNET_FILT_NEXT _IOR(NGKNET_IOC_MAGIC, 0xe3, unsigned int) +#define NGKNET_INFO_GET _IOR(NGKNET_IOC_MAGIC, 0xf0, unsigned int) +#define NGKNET_STATS_GET _IOR(NGKNET_IOC_MAGIC, 0xf1, unsigned int) +#define NGKNET_STATS_RESET _IOWR(NGKNET_IOC_MAGIC, 0xf2, unsigned int) +#define NGKNET_PTP_DEV_CTRL _IOWR(NGKNET_IOC_MAGIC, 0x90, unsigned int) + +/*! Kernel module information. */ +struct ngknet_ioc_mod_info { + /*! IOCTL version used by kernel module */ + uint32_t version; +}; + +/*! Data transmission */ +struct ngknet_ioc_data_xmit { + /*! Data buffer address */ + uint64_t buf; + + /*! Data buffer length */ + uint32_t len; +}; + +/*! IOCTL operations */ +union ngknet_ioc_op { + /*! Get module info */ + struct ngknet_ioc_mod_info info; + /*! Transmit data */ + struct ngknet_ioc_data_xmit data; +}; + +/*! + * \brief NGKNET IOCTL command message. + */ +struct ngknet_ioctl { + /*! Device number */ + uint32_t unit; + + /*! Return code (0 means success) */ + uint32_t rc; + + /*! Input arguments */ + int iarg[NGKNET_IOC_IARG_MAX]; + + /*! IOCTL operation */ + union ngknet_ioc_op op; +}; + +#endif /* NGKNET_IOCTL_H */ + diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/include/net/psample.h b/platform/broadcom/saibcm-modules/sdklt/linux/include/net/psample.h new file mode 100644 index 000000000000..64188c95daeb --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/linux/include/net/psample.h @@ -0,0 +1,24 @@ +#ifndef __NET_PSAMPLE_H +#define __NET_PSAMPLE_H + +#include +#include +#include +#include + +struct psample_group { + struct list_head list; + struct net *net; + u32 group_num; + u32 refcount; + u32 seq; +}; + +extern struct psample_group *psample_group_get(struct net *net, u32 group_num); +extern void psample_group_put(struct psample_group *group); + +extern void psample_sample_packet(struct psample_group *group, struct sk_buff *skb, + u32 trunc_size, int in_ifindex, int out_ifindex, + u32 sample_rate); + +#endif /* __NET_PSAMPLE_H */ diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/include/uapi/linux/psample.h b/platform/broadcom/saibcm-modules/sdklt/linux/include/uapi/linux/psample.h new file mode 100644 index 000000000000..ed48996ec0e8 --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/linux/include/uapi/linux/psample.h @@ -0,0 +1,35 @@ +#ifndef __UAPI_PSAMPLE_H +#define __UAPI_PSAMPLE_H + +enum { + /* sampled packet metadata */ + PSAMPLE_ATTR_IIFINDEX, + PSAMPLE_ATTR_OIFINDEX, + PSAMPLE_ATTR_ORIGSIZE, + PSAMPLE_ATTR_SAMPLE_GROUP, + PSAMPLE_ATTR_GROUP_SEQ, + PSAMPLE_ATTR_SAMPLE_RATE, + PSAMPLE_ATTR_DATA, + + /* commands attributes */ + PSAMPLE_ATTR_GROUP_REFCOUNT, + + __PSAMPLE_ATTR_MAX +}; + +enum psample_command { + PSAMPLE_CMD_SAMPLE, + PSAMPLE_CMD_GET_GROUP, + PSAMPLE_CMD_NEW_GROUP, + PSAMPLE_CMD_DEL_GROUP, +}; + +/* Can be overridden at runtime by module option */ +#define PSAMPLE_ATTR_MAX (__PSAMPLE_ATTR_MAX - 1) + +#define PSAMPLE_NL_MCGRP_CONFIG_NAME "config" +#define PSAMPLE_NL_MCGRP_SAMPLE_NAME "packets" +#define PSAMPLE_GENL_NAME "psample" +#define PSAMPLE_GENL_VERSION 1 + +#endif diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/knet/Kbuild b/platform/broadcom/saibcm-modules/sdklt/linux/knet/Kbuild new file mode 100644 index 000000000000..fe5d5c5bfefc --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/linux/knet/Kbuild @@ -0,0 +1,44 @@ +# -*- Kbuild -*- +# +# Linux KNET module. +# +# $Copyright: Copyright 2018-2020 Broadcom. All rights reserved. +# The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# version 2 as published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# A copy of the GNU General Public License version 2 (GPLv2) can +# be found in the LICENSES folder.$ +# + +obj-m := linux_ngknet.o + +ccflags-y := $(KNET_CPPFLAGS) $(LKM_CFLAGS) \ + -I$(SDK)/shr/include \ + -I$(SDK)/bcmdrd/include \ + -I$(SDK)/linux/include \ + -I$(SDK)/linux/knet/include \ + -I$(SDK)/linux/knet + +linux_ngknet-y := $(CHIP_OBJS) \ + bcmcnet_cmicd_pdma_hw.o \ + bcmcnet_cmicd_pdma_rxtx.o \ + bcmcnet_cmicx_pdma_hw.o \ + bcmcnet_cmicx_pdma_rxtx.o \ + bcmcnet_core.o \ + bcmcnet_dev.o \ + bcmcnet_rxtx.o \ + ngknet_buff.o \ + ngknet_callback.o \ + ngknet_extra.o \ + ngknet_linux.o \ + ngknet_main.o \ + ngknet_procfs.o \ + ngknet_ptp.o diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/knet/Makefile b/platform/broadcom/saibcm-modules/sdklt/linux/knet/Makefile new file mode 100644 index 000000000000..785b81fadb17 --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/linux/knet/Makefile @@ -0,0 +1,105 @@ +# -*- Makefile -*- +# +# Linux KNET module. +# +# $Copyright: Copyright 2018-2020 Broadcom. All rights reserved. +# The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# version 2 as published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# A copy of the GNU General Public License version 2 (GPLv2) can +# be found in the LICENSES folder.$ +# + +CNETDIR = $(SDK)/bcmcnet +KNETDIR = $(SDK)/linux/knet +SRCIDIR = $(CNETDIR)/include/bcmcnet +DSTIDIR = $(KNETDIR)/include/bcmcnet + +# Change comma-separated list to space-separated list +comma = , +empty = +space = $(empty) $(empty) +spc_sep = $(subst $(comma),$(space),$1) + +# Convert chip name to uppercase +chip_uc = $(subst a,A,$(subst b,B,$(subst c,C,$(subst m,M,$1)))) + +# Convert chip name to lowercase +chip_lc = $(subst A,a,$(subst B,b,$(subst C,c,$(subst M,m,$1)))) + +# +# If SDK_CHIPS is defined, then exclude any chip directory which is +# not part of this list. +# +KNET_CHIPS := $(subst $(CNETDIR)/chip/,,$(wildcard $(CNETDIR)/chip/bcm*)) +ifdef SDK_CHIPS +# Create space-separated lowercase version of chip list +SDK_CHIPS_SPC := $(call spc_sep,$(SDK_CHIPS)) +SDK_CHIPS_LC := $(call chip_lc,$(SDK_CHIPS_SPC)) +# Configure build flags according to chip list +KNET_CHIPS := $(filter $(SDK_CHIPS_LC),$(KNET_CHIPS)) +KNET_CPPFLAGS := CHIP_DEFAULT=0 $(addsuffix =1,$(call chip_uc,$(KNET_CHIPS))) +KNET_CPPFLAGS := $(addprefix -DBCMDRD_CONFIG_INCLUDE_,$(KNET_CPPFLAGS)) +export KNET_CPPFLAGS +endif + +.PHONY: mklinks rmlinks + +knet: mklinks + $(MAKE) all + +# +# Suppress symlink error messages. +# +# Note that we do not use "ln -f" as this may cause failures if +# multiple builds are done in parallel on the same source tree. +# +R = 2>/dev/null + +mklinks: + mkdir -p $(DSTIDIR) + -ln -s $(KNETDIR)/ngknet_dep.h $(DSTIDIR)/bcmcnet_dep.h $(R) + -ln -s $(KNETDIR)/ngknet_buff.h $(DSTIDIR)/bcmcnet_buff.h $(R) + -ln -s $(SRCIDIR)/bcmcnet_types.h $(DSTIDIR) $(R) + -ln -s $(SRCIDIR)/bcmcnet_internal.h $(DSTIDIR) $(R) + -ln -s $(SRCIDIR)/bcmcnet_core.h $(DSTIDIR) $(R) + -ln -s $(SRCIDIR)/bcmcnet_dev.h $(DSTIDIR) $(R) + -ln -s $(SRCIDIR)/bcmcnet_rxtx.h $(DSTIDIR) $(R) + -ln -s $(SRCIDIR)/bcmcnet_cmicd.h $(DSTIDIR) $(R) + -ln -s $(SRCIDIR)/bcmcnet_cmicx.h $(DSTIDIR) $(R) + -ln -s $(CNETDIR)/chip/*/*attach.c $(KNETDIR) $(R) + -ln -s $(CNETDIR)/hmi/cmicd/*.c $(KNETDIR) $(R) + -ln -s $(CNETDIR)/hmi/cmicx/*.c $(KNETDIR) $(R) + -ln -s $(CNETDIR)/main/bcmcnet_core.c $(KNETDIR) $(R) + -ln -s $(CNETDIR)/main/bcmcnet_dev.c $(KNETDIR) $(R) + -ln -s $(CNETDIR)/main/bcmcnet_rxtx.c $(KNETDIR) $(R) + +rmlinks: + -rm -f bcm* + -rm -rf include + +CHIP_SRCS := $(addsuffix _pdma_attach.c,$(KNET_CHIPS)) +CHIP_OBJS ?= $(patsubst %.c, %.o, $(CHIP_SRCS)) +export CHIP_OBJS + +include Kbuild + +ifeq ($(KERNELRELEASE),) + +MOD_NAME = linux_ngknet + +include $(SDK)/make/lkm.mk + +endif + +.PHONY: distclean + +distclean: rmlinks diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_buff.c b/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_buff.c new file mode 100644 index 000000000000..750fff69caf3 --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_buff.c @@ -0,0 +1,326 @@ +/*! \file ngknet_buff.c + * + * Utility routines for NGKNET packet buffer management in Linux kernel mode. + * + */ +/* + * $Copyright: Copyright 2018-2020 Broadcom. All rights reserved. + * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * A copy of the GNU General Public License version 2 (GPLv2) can + * be found in the LICENSES folder.$ + */ + +#include +#include +#include +#include "ngknet_main.h" +#include "ngknet_buff.h" + +/*! + * Allocate coherent memory + */ +static void * +bcmcnet_ring_buf_alloc(struct pdma_dev *dev, uint32_t size, dma_addr_t *dma) +{ + struct ngknet_dev *kdev = (struct ngknet_dev *)dev->priv; + + return dma_alloc_coherent(kdev->dev, size, dma, GFP_KERNEL); +} + +/*! + * Free coherent memory + */ +static void +bcmcnet_ring_buf_free(struct pdma_dev *dev, uint32_t size, void *addr, dma_addr_t dma) +{ + struct ngknet_dev *kdev = (struct ngknet_dev *)dev->priv; + + dma_free_coherent(kdev->dev, size, addr, dma); +} + +/*! + * Allocate Rx buffer + */ +static int +bcmcnet_rx_buf_alloc(struct pdma_dev *dev, struct pdma_rx_queue *rxq, + struct pdma_rx_buf *pbuf) +{ + struct ngknet_dev *kdev = (struct ngknet_dev *)dev->priv; + dma_addr_t dma; + struct page *page; + struct sk_buff *skb; + + if (rxq->mode == PDMA_BUF_MODE_PAGE) { + page = kal_dev_alloc_page(); + if (unlikely(!page)) { + return SHR_E_MEMORY; + } + dma = dma_map_page(kdev->dev, page, 0, PAGE_SIZE, DMA_FROM_DEVICE); + if (unlikely(dma_mapping_error(kdev->dev, dma))) { + __free_page(page); + return SHR_E_MEMORY; + } + pbuf->dma = dma; + pbuf->page = page; + pbuf->page_offset = 0; + } else { + skb = netdev_alloc_skb(kdev->net_dev, PDMA_RXB_RESV + pbuf->adj + rxq->buf_size); + if (unlikely(!skb)) { + return SHR_E_MEMORY; + } + skb_reserve(skb, PDMA_RXB_ALIGN - (((unsigned long)skb->data) & (PDMA_RXB_ALIGN - 1))); + pbuf->skb = skb; + pbuf->pkb = (struct pkt_buf *)skb->data; + dma = dma_map_single(kdev->dev, &pbuf->pkb->data + pbuf->adj, rxq->buf_size, DMA_FROM_DEVICE); + if (unlikely(dma_mapping_error(kdev->dev, dma))) { + dev_kfree_skb_any(skb); + return SHR_E_MEMORY; + } + pbuf->dma = dma; + } + + return SHR_E_NONE; +} + +/*! + * Get Rx buffer DMA address + */ +static void +bcmcnet_rx_buf_dma(struct pdma_dev *dev, struct pdma_rx_queue *rxq, + struct pdma_rx_buf *pbuf, dma_addr_t *addr) +{ + if (rxq->mode == PDMA_BUF_MODE_PAGE) { + *addr = pbuf->dma + pbuf->page_offset + PDMA_RXB_RESV + pbuf->adj; + } else { + *addr = pbuf->dma; + } +} + +/*! + * Check Rx buffer + */ +static int +bcmcnet_rx_buf_avail(struct pdma_dev *dev, struct pdma_rx_queue *rxq, + struct pdma_rx_buf *pbuf) +{ + if (rxq->mode == PDMA_BUF_MODE_PAGE) { + pbuf->skb = NULL; + } + + return pbuf->dma != 0; +} + +/*! + * Get Rx buffer + */ +static struct pkt_hdr * +bcmcnet_rx_buf_get(struct pdma_dev *dev, struct pdma_rx_queue *rxq, + struct pdma_rx_buf *pbuf, int len) +{ + struct ngknet_dev *kdev = (struct ngknet_dev *)dev->priv; + struct sk_buff *skb; + + if (rxq->mode == PDMA_BUF_MODE_PAGE) { + if (pbuf->skb) { + return &pbuf->pkb->pkh; + } + skb = kal_build_skb(page_address(pbuf->page) + pbuf->page_offset, + PDMA_SKB_RESV + pbuf->adj + rxq->buf_size); + if (unlikely(!skb)) { + return NULL; + } + skb_reserve(skb, PDMA_RXB_ALIGN); + dma_sync_single_range_for_cpu(kdev->dev, pbuf->dma, pbuf->page_offset, + PDMA_PAGE_BUF_MAX, DMA_FROM_DEVICE); + pbuf->skb = skb; + pbuf->pkb = (struct pkt_buf *)skb->data; + + /* Try to reuse this page */ + if (unlikely(page_count(pbuf->page) != 1)) { + dma_unmap_page(kdev->dev, pbuf->dma, PAGE_SIZE, DMA_FROM_DEVICE); + pbuf->dma = 0; + } else { + pbuf->page_offset ^= PDMA_PAGE_BUF_MAX; + page_ref_inc(pbuf->page); + dma_sync_single_range_for_device(kdev->dev, pbuf->dma, pbuf->page_offset, + PDMA_PAGE_BUF_MAX, DMA_FROM_DEVICE); + } + } else { + if (!pbuf->dma) { + return &pbuf->pkb->pkh; + } + skb = pbuf->skb; + dma_unmap_single(kdev->dev, pbuf->dma, rxq->buf_size, DMA_FROM_DEVICE); + pbuf->dma = 0; + } + + skb_put(skb, PKT_HDR_SIZE + pbuf->adj + len); + + return &pbuf->pkb->pkh; +} + +/*! + * Put Rx buffer + */ +static int +bcmcnet_rx_buf_put(struct pdma_dev *dev, struct pdma_rx_queue *rxq, + struct pdma_rx_buf *pbuf, int len) +{ + struct ngknet_dev *kdev = (struct ngknet_dev *)dev->priv; + dma_addr_t dma; + struct sk_buff *skb; + + if (rxq->mode == PDMA_BUF_MODE_PAGE) { + dev_kfree_skb_any(pbuf->skb); + } else { + skb = pbuf->skb; + dma = dma_map_single(kdev->dev, &pbuf->pkb->data + pbuf->adj, + rxq->buf_size, DMA_FROM_DEVICE); + if (unlikely(dma_mapping_error(kdev->dev, dma))) { + dev_kfree_skb_any(skb); + pbuf->dma = 0; + return SHR_E_MEMORY; + } + pbuf->dma = dma; + skb_trim(skb, skb->len - (PKT_HDR_SIZE + pbuf->adj + len)); + } + + return SHR_E_NONE; +} + +/*! + * Free Rx buffer + */ +static void +bcmcnet_rx_buf_free(struct pdma_dev *dev, struct pdma_rx_queue *rxq, + struct pdma_rx_buf *pbuf) +{ + struct ngknet_dev *kdev = (struct ngknet_dev *)dev->priv; + + if (rxq->mode == PDMA_BUF_MODE_PAGE) { + dma_unmap_single(kdev->dev, pbuf->dma, PAGE_SIZE, DMA_FROM_DEVICE); + __free_page(pbuf->page); + } else { + dma_unmap_single(kdev->dev, pbuf->dma, rxq->buf_size, DMA_FROM_DEVICE); + dev_kfree_skb_any(pbuf->skb); + } + + pbuf->dma = 0; + pbuf->page = NULL; + pbuf->page_offset = 0; + pbuf->skb = NULL; + pbuf->pkb = NULL; + pbuf->adj = 0; +} + +/*! + * Get Rx buffer mode + */ +static enum buf_mode +bcmcnet_rx_buf_mode(struct pdma_dev *dev, struct pdma_rx_queue *rxq) +{ + uint32_t len; + + len = dev->rx_ph_size ? rxq->buf_size : rxq->buf_size + PDMA_RXB_META; + if (PDMA_RXB_SIZE(len) <= PDMA_PAGE_BUF_MAX && PAGE_SIZE < 8192 && + kal_support_paged_skb()) { + return PDMA_BUF_MODE_PAGE; + } + + return PDMA_BUF_MODE_SKB; +} + +/*! + * Get Tx buffer + */ +static struct pkt_hdr * +bcmcnet_tx_buf_get(struct pdma_dev *dev, struct pdma_tx_queue *txq, + struct pdma_tx_buf *pbuf, void *buf) +{ + struct ngknet_dev *kdev = (struct ngknet_dev *)dev->priv; + struct sk_buff *skb = (struct sk_buff *)buf; + struct pkt_buf *pkb = (struct pkt_buf *)skb->data; + dma_addr_t dma; + + pbuf->len = pkb->pkh.data_len + (pbuf->adj ? pkb->pkh.meta_len : 0); + dma = dma_map_single(kdev->dev, &pkb->data + (pbuf->adj ? 0 : pkb->pkh.meta_len), + pbuf->len, DMA_TO_DEVICE); + if (unlikely(dma_mapping_error(kdev->dev, dma))) { + dev_kfree_skb_any(skb); + return NULL; + } + pbuf->dma = dma; + pbuf->skb = skb; + pbuf->pkb = pkb; + + return &pkb->pkh; +} + +/*! + * Get Tx buffer DMA address + */ +static void +bcmcnet_tx_buf_dma(struct pdma_dev *dev, struct pdma_tx_queue *txq, + struct pdma_tx_buf *pbuf, dma_addr_t *addr) +{ + *addr = pbuf->dma; +} + +/*! + * Free Tx buffer + */ +static void +bcmcnet_tx_buf_free(struct pdma_dev *dev, struct pdma_tx_queue *txq, + struct pdma_tx_buf *pbuf) +{ + struct ngknet_dev *kdev = (struct ngknet_dev *)dev->priv; + + dma_unmap_single(kdev->dev, pbuf->dma, pbuf->len, DMA_TO_DEVICE); + if (skb_shinfo(pbuf->skb)->tx_flags & SKBTX_IN_PROGRESS) { + skb_queue_tail(&kdev->ptp_tx_queue, pbuf->skb); + schedule_work(&kdev->ptp_tx_work); + } else { + dev_kfree_skb_any(pbuf->skb); + } + + pbuf->dma = 0; + pbuf->len = 0; + pbuf->skb = NULL; + pbuf->pkb = NULL; + pbuf->adj = 0; +} + +static const struct pdma_buf_mngr buf_mngr = { + .ring_buf_alloc = bcmcnet_ring_buf_alloc, + .ring_buf_free = bcmcnet_ring_buf_free, + .rx_buf_alloc = bcmcnet_rx_buf_alloc, + .rx_buf_dma = bcmcnet_rx_buf_dma, + .rx_buf_avail = bcmcnet_rx_buf_avail, + .rx_buf_get = bcmcnet_rx_buf_get, + .rx_buf_put = bcmcnet_rx_buf_put, + .rx_buf_free = bcmcnet_rx_buf_free, + .rx_buf_mode = bcmcnet_rx_buf_mode, + .tx_buf_get = bcmcnet_tx_buf_get, + .tx_buf_dma = bcmcnet_tx_buf_dma, + .tx_buf_free = bcmcnet_tx_buf_free, +}; + +/*! + * Open a device + */ +void +bcmcnet_buf_mngr_init(struct pdma_dev *dev) +{ + dev->ctrl.buf_mngr = (struct pdma_buf_mngr *)&buf_mngr; +} + diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_buff.h b/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_buff.h new file mode 100644 index 000000000000..54768e826917 --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_buff.h @@ -0,0 +1,83 @@ +/*! \file ngknet_buff.h + * + * Generic data structure definitions for NGKNET packet buffer management. + * + */ +/* + * $Copyright: Copyright 2018-2020 Broadcom. All rights reserved. + * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * A copy of the GNU General Public License version 2 (GPLv2) can + * be found in the LICENSES folder.$ + */ + +#ifndef NGKNET_BUFF_H +#define NGKNET_BUFF_H + +/*! Rx buffer align size */ +#define PDMA_RXB_ALIGN 32 +/*! Rx buffer reserved size */ +#define PDMA_RXB_RESV (PDMA_RXB_ALIGN + PKT_HDR_SIZE) +/*! Rx SKB reserved size */ +#define PDMA_SKB_RESV (PDMA_RXB_RESV + SKB_DATA_ALIGN(sizeof(struct skb_shared_info))) +/*! Rx buffer size */ +#define PDMA_RXB_SIZE(len) (SKB_DATA_ALIGN(len + NET_SKB_PAD) + PDMA_SKB_RESV) +/*! Rx reserved meta size */ +#define PDMA_RXB_META 64 +/*! Max page buffer size */ +#define PDMA_PAGE_BUF_MAX 2048 + +/*! + * \brief Rx buffer. + */ +struct pdma_rx_buf { + /*! DMA address */ + dma_addr_t dma; + + /*! Buffer page */ + struct page *page; + + /*! Buffer page offset */ + unsigned int page_offset; + + /*! Rx SKB */ + struct sk_buff *skb; + + /*! Packet buffer point */ + struct pkt_buf *pkb; + + /*! Packet buffer adjustment */ + uint32_t adj; +}; + +/*! + * \brief Tx buffer. + */ +struct pdma_tx_buf { + /*! DMA address */ + dma_addr_t dma; + + /*! Tx buffer length */ + uint32_t len; + + /*! Tx SKB */ + struct sk_buff *skb; + + /*! Packet buffer point */ + struct pkt_buf *pkb; + + /*! Packet buffer adjustment */ + uint32_t adj; +}; + +#endif /* NGKNET_BUFF_H */ + diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_callback.c b/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_callback.c new file mode 100644 index 000000000000..21512a51fbd2 --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_callback.c @@ -0,0 +1,315 @@ +/*! \file ngknet_callback.c + * + * Utility routines for NGKNET callbacks. + * + */ +/* + * $Copyright: Copyright 2018-2020 Broadcom. All rights reserved. + * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * A copy of the GNU General Public License version 2 (GPLv2) can + * be found in the LICENSES folder.$ + */ + +#include "ngknet_callback.h" + +static struct ngknet_callback_ctrl callback_ctrl; + +int +ngknet_callback_control_get(struct ngknet_callback_ctrl **cbc) +{ + *cbc = &callback_ctrl; + + return 0; +} + +/*! + * Call-back interfaces for other Linux kernel drivers. + * + * The Rx call-back allows an external module to modify packet contents + * before it is handed off to the Linux network stack. + * + * The Tx call-back allows an external module to modify packet contents + * before it is injected into the switch. + */ + +int +ngknet_rx_cb_register(ngknet_rx_cb_f rx_cb) +{ + if (callback_ctrl.rx_cb != NULL) { + return -1; + } + callback_ctrl.rx_cb = rx_cb; + + return 0; +} + +int +ngknet_rx_cb_unregister(ngknet_rx_cb_f rx_cb) +{ + if (rx_cb == NULL || callback_ctrl.rx_cb != rx_cb) { + return -1; + } + callback_ctrl.rx_cb = NULL; + + return 0; +} + +int +ngknet_tx_cb_register(ngknet_tx_cb_f tx_cb) +{ + if (callback_ctrl.tx_cb != NULL) { + return -1; + } + callback_ctrl.tx_cb = tx_cb; + + return 0; +} + +int +ngknet_tx_cb_unregister(ngknet_tx_cb_f tx_cb) +{ + if (tx_cb == NULL || callback_ctrl.tx_cb != tx_cb) { + return -1; + } + callback_ctrl.tx_cb = NULL; + + return 0; +} + +int +ngknet_ptp_rx_config_set_cb_register(ngknet_ptp_config_set_cb_f ptp_rx_config_set_cb) +{ + if (callback_ctrl.ptp_rx_config_set_cb != NULL) { + return -1; + } + callback_ctrl.ptp_rx_config_set_cb = ptp_rx_config_set_cb; + + return 0; +} + +int +ngknet_ptp_rx_config_set_cb_unregister(ngknet_ptp_config_set_cb_f ptp_rx_config_set_cb) +{ + if (ptp_rx_config_set_cb == NULL || + callback_ctrl.ptp_rx_config_set_cb != ptp_rx_config_set_cb) { + return -1; + } + callback_ctrl.ptp_rx_config_set_cb = NULL; + + return 0; +} + +int +ngknet_ptp_tx_config_set_cb_register(ngknet_ptp_config_set_cb_f ptp_tx_config_set_cb) +{ + if (callback_ctrl.ptp_tx_config_set_cb != NULL) { + return -1; + } + callback_ctrl.ptp_tx_config_set_cb = ptp_tx_config_set_cb; + + return 0; +} + +int +ngknet_ptp_tx_config_set_cb_unregister(ngknet_ptp_config_set_cb_f ptp_tx_config_set_cb) +{ + if (ptp_tx_config_set_cb == NULL || + callback_ctrl.ptp_tx_config_set_cb != ptp_tx_config_set_cb) { + return -1; + } + callback_ctrl.ptp_tx_config_set_cb = NULL; + + return 0; +} + +int +ngknet_ptp_rx_hwts_get_cb_register(ngknet_ptp_hwts_get_cb_f ptp_rx_hwts_get_cb) +{ + if (callback_ctrl.ptp_rx_hwts_get_cb != NULL) { + return -1; + } + callback_ctrl.ptp_rx_hwts_get_cb = ptp_rx_hwts_get_cb; + + return 0; +} + +int +ngknet_ptp_rx_hwts_get_cb_unregister(ngknet_ptp_hwts_get_cb_f ptp_rx_hwts_get_cb) +{ + if (ptp_rx_hwts_get_cb == NULL || + callback_ctrl.ptp_rx_hwts_get_cb != ptp_rx_hwts_get_cb) { + return -1; + } + callback_ctrl.ptp_rx_hwts_get_cb = NULL; + + return 0; +} + +int +ngknet_ptp_tx_hwts_get_cb_register(ngknet_ptp_hwts_get_cb_f ptp_tx_hwts_get_cb) +{ + if (callback_ctrl.ptp_tx_hwts_get_cb != NULL) { + return -1; + } + callback_ctrl.ptp_tx_hwts_get_cb = ptp_tx_hwts_get_cb; + + return 0; +} + +int +ngknet_ptp_tx_hwts_get_cb_unregister(ngknet_ptp_hwts_get_cb_f ptp_tx_hwts_get_cb) +{ + if (ptp_tx_hwts_get_cb == NULL || + callback_ctrl.ptp_tx_hwts_get_cb != ptp_tx_hwts_get_cb) { + return -1; + } + callback_ctrl.ptp_tx_hwts_get_cb = NULL; + + return 0; +} + +int +ngknet_ptp_tx_meta_set_cb_register(ngknet_ptp_meta_set_cb_f ptp_tx_meta_set_cb) +{ + if (callback_ctrl.ptp_tx_meta_set_cb != NULL) { + return -1; + } + callback_ctrl.ptp_tx_meta_set_cb = ptp_tx_meta_set_cb; + + return 0; +} + +int +ngknet_ptp_tx_meta_set_cb_unregister(ngknet_ptp_meta_set_cb_f ptp_tx_meta_set_cb) +{ + if (ptp_tx_meta_set_cb == NULL || + callback_ctrl.ptp_tx_meta_set_cb != ptp_tx_meta_set_cb) { + return -1; + } + callback_ctrl.ptp_tx_meta_set_cb = NULL; + + return 0; +} + +int +ngknet_ptp_phc_index_get_cb_register(ngknet_ptp_phc_index_get_cb_f ptp_phc_index_get_cb) +{ + if (callback_ctrl.ptp_phc_index_get_cb != NULL) { + return -1; + } + callback_ctrl.ptp_phc_index_get_cb = ptp_phc_index_get_cb; + + return 0; +} + +int +ngknet_ptp_phc_index_get_cb_unregister(ngknet_ptp_phc_index_get_cb_f ptp_phc_index_get_cb) +{ + if (ptp_phc_index_get_cb == NULL || + callback_ctrl.ptp_phc_index_get_cb != ptp_phc_index_get_cb) { + return -1; + } + callback_ctrl.ptp_phc_index_get_cb = NULL; + + return 0; +} + +int +ngknet_ptp_dev_ctrl_cb_register(ngknet_ptp_dev_ctrl_cb_f ptp_dev_ctrl_cb) +{ + if (callback_ctrl.ptp_dev_ctrl_cb != NULL) { + return -1; + } + callback_ctrl.ptp_dev_ctrl_cb = ptp_dev_ctrl_cb; + + return 0; +} + +int +ngknet_ptp_dev_ctrl_cb_unregister(ngknet_ptp_dev_ctrl_cb_f ptp_dev_ctrl_cb) +{ + if (ptp_dev_ctrl_cb == NULL || + callback_ctrl.ptp_dev_ctrl_cb != ptp_dev_ctrl_cb) { + return -1; + } + callback_ctrl.ptp_dev_ctrl_cb = NULL; + + return 0; +} + +int +ngknet_netif_create_cb_register(ngknet_netif_cb_f netif_cb) +{ + if (callback_ctrl.netif_create_cb != NULL) { + return -1; + } + callback_ctrl.netif_create_cb = netif_cb; + + return 0; +} + +int +ngknet_netif_create_cb_unregister(ngknet_netif_cb_f netif_cb) +{ + if (netif_cb == NULL || callback_ctrl.netif_create_cb != netif_cb) { + return -1; + } + callback_ctrl.netif_create_cb = NULL; + + return 0; +} + +int +ngknet_netif_destroy_cb_register(ngknet_netif_cb_f netif_cb) +{ + if (callback_ctrl.netif_destroy_cb != NULL) { + return -1; + } + callback_ctrl.netif_destroy_cb = netif_cb; + + return 0; +} + +int +ngknet_netif_destroy_cb_unregister(ngknet_netif_cb_f netif_cb) +{ + if (netif_cb == NULL || callback_ctrl.netif_destroy_cb != netif_cb) { + return -1; + } + callback_ctrl.netif_destroy_cb = NULL; + + return 0; +} + +EXPORT_SYMBOL(ngknet_rx_cb_register); +EXPORT_SYMBOL(ngknet_rx_cb_unregister); +EXPORT_SYMBOL(ngknet_tx_cb_register); +EXPORT_SYMBOL(ngknet_tx_cb_unregister); +EXPORT_SYMBOL(ngknet_ptp_rx_config_set_cb_register); +EXPORT_SYMBOL(ngknet_ptp_rx_config_set_cb_unregister); +EXPORT_SYMBOL(ngknet_ptp_tx_config_set_cb_register); +EXPORT_SYMBOL(ngknet_ptp_tx_config_set_cb_unregister); +EXPORT_SYMBOL(ngknet_ptp_rx_hwts_get_cb_register); +EXPORT_SYMBOL(ngknet_ptp_rx_hwts_get_cb_unregister); +EXPORT_SYMBOL(ngknet_ptp_tx_hwts_get_cb_register); +EXPORT_SYMBOL(ngknet_ptp_tx_hwts_get_cb_unregister); +EXPORT_SYMBOL(ngknet_ptp_tx_meta_set_cb_register); +EXPORT_SYMBOL(ngknet_ptp_tx_meta_set_cb_unregister); +EXPORT_SYMBOL(ngknet_ptp_phc_index_get_cb_register); +EXPORT_SYMBOL(ngknet_ptp_phc_index_get_cb_unregister); +EXPORT_SYMBOL(ngknet_ptp_dev_ctrl_cb_register); +EXPORT_SYMBOL(ngknet_ptp_dev_ctrl_cb_unregister); +EXPORT_SYMBOL(ngknet_netif_create_cb_register); +EXPORT_SYMBOL(ngknet_netif_create_cb_unregister); +EXPORT_SYMBOL(ngknet_netif_destroy_cb_register); +EXPORT_SYMBOL(ngknet_netif_destroy_cb_unregister); diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_callback.h b/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_callback.h new file mode 100644 index 000000000000..54583adffa36 --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_callback.h @@ -0,0 +1,364 @@ +/*! \file ngknet_callback.h + * + * Data structure definitions for NGKNET callbacks. + * + */ +/* + * $Copyright: Copyright 2018-2020 Broadcom. All rights reserved. + * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * A copy of the GNU General Public License version 2 (GPLv2) can + * be found in the LICENSES folder.$ + */ + +#ifndef NGKNET_CALLBACK_H +#define NGKNET_CALLBACK_H + +#include +#include "ngknet_main.h" + +/*! + * \brief NGKNET callback description. + */ +struct ngknet_callback_desc { + /*! Device number */ + int dev_no; + + /*! Device ID */ + uint32_t dev_id; + + /*! Device type string */ + const char *type_str; + + /*! Network interface private data */ + struct ngknet_private *priv; + + /*! Matched filter */ + struct ngknet_filter_s *filt; + + /*! Packet meta data */ + uint8_t *pmd; + + /*! Packet meta data length */ + int pmd_len; + + /*! Packet data length */ + int pkt_len; + + /*! Matched callback filter */ + struct ngknet_filter_s *filt_cb; +}; + +#define NGKNET_SKB_CB(_skb) ((struct ngknet_callback_desc *)_skb->cb) + +/*! Handle Rx packet */ +typedef struct sk_buff * +(*ngknet_rx_cb_f)(struct sk_buff *skb); + +/*! Handle Tx packet */ +typedef struct sk_buff * +(*ngknet_tx_cb_f)(struct sk_buff *skb); + +/*! PTP Rx/Tx config set */ +typedef int +(*ngknet_ptp_config_set_cb_f)(struct ngknet_private *priv, int *value); + +/*! PTP Rx/Tx HW timestamp get */ +typedef int +(*ngknet_ptp_hwts_get_cb_f)(struct sk_buff *skb, uint64_t *ts); + +/*! PTP Tx meta set */ +typedef int +(*ngknet_ptp_meta_set_cb_f)(struct sk_buff *skb); + +/*! PTP PHC index get */ +typedef int +(*ngknet_ptp_phc_index_get_cb_f)(struct ngknet_private *priv, int *index); + +/*! PTP device control */ +typedef int +(*ngknet_ptp_dev_ctrl_cb_f)(struct ngknet_dev *dev, int cmd, char *data, int len); + +/*! Netif callback */ +typedef int +(*ngknet_netif_cb_f)(struct net_device *dev); + +/*! + * \brief NGKNET callback control. + */ +struct ngknet_callback_ctrl { + /*! Handle Rx packet */ + ngknet_rx_cb_f rx_cb; + + /*! Handle Tx packet */ + ngknet_tx_cb_f tx_cb; + + /*! PTP Rx config set */ + ngknet_ptp_config_set_cb_f ptp_rx_config_set_cb; + + /*! PTP Tx config set */ + ngknet_ptp_config_set_cb_f ptp_tx_config_set_cb; + + /*! PTP Rx HW timestamp get */ + ngknet_ptp_hwts_get_cb_f ptp_rx_hwts_get_cb; + + /*! PTP Tx HW timestamp get */ + ngknet_ptp_hwts_get_cb_f ptp_tx_hwts_get_cb; + + /*! PTP Tx meta set */ + ngknet_ptp_meta_set_cb_f ptp_tx_meta_set_cb; + + /*! PTP PHC index get */ + ngknet_ptp_phc_index_get_cb_f ptp_phc_index_get_cb; + + /*! PTP device control */ + ngknet_ptp_dev_ctrl_cb_f ptp_dev_ctrl_cb; + + /*! Handle Netif create */ + ngknet_netif_cb_f netif_create_cb; + + /*! Handle Netif destroy */ + ngknet_netif_cb_f netif_destroy_cb; +}; + +/*! + * \brief Get callback control. + * + * \param [in] cbc Pointer to callback control. + * + * \retval SHR_E_NONE No errors. + */ +extern int +ngknet_callback_control_get(struct ngknet_callback_ctrl **cbc); + +/*! + * \brief Register Rx callback. + * + * \param [in] rx_cb Rx callback function. + * + * \retval SHR_E_NONE No errors. + */ +extern int +ngknet_rx_cb_register(ngknet_rx_cb_f rx_cb); + +/*! + * \brief Unregister Rx callback. + * + * \param [in] rx_cb Rx callback function. + * + * \retval SHR_E_NONE No errors. + */ +extern int +ngknet_rx_cb_unregister(ngknet_rx_cb_f rx_cb); + +/*! + * \brief Register Tx callback. + * + * \param [in] tx_cb Tx callback function. + * + * \retval SHR_E_NONE No errors. + */ +extern int +ngknet_tx_cb_register(ngknet_tx_cb_f tx_cb); + +/*! + * \brief Unregister Tx callback. + * + * \param [in] tx_cb Tx callback function. + * + * \retval SHR_E_NONE No errors. + */ +extern int +ngknet_tx_cb_unregister(ngknet_tx_cb_f tx_cb); + +/*! + * \brief Register PTP Rx config set callback. + * + * \param [in] ptp_rx_config_set_cb Rx config set callback function. + * + * \retval SHR_E_NONE No errors. + */ +extern int +ngknet_ptp_rx_config_set_cb_register(ngknet_ptp_config_set_cb_f ptp_rx_config_set_cb); + +/*! + * \brief Unregister PTP Rx config set callback. + * + * \param [in] ptp_rx_config_set_cb Rx config set callback function. + * + * \retval SHR_E_NONE No errors. + */ +extern int +ngknet_ptp_rx_config_set_cb_unregister(ngknet_ptp_config_set_cb_f ptp_rx_config_set_cb); + +/*! + * \brief Register PTP Tx config set callback. + * + * \param [in] ptp_tx_config_set_cb Tx config set callback function. + * + * \retval SHR_E_NONE No errors. + */ +extern int +ngknet_ptp_tx_config_set_cb_register(ngknet_ptp_config_set_cb_f ptp_tx_config_set_cb); + +/*! + * \brief Unregister PTP Tx config set callback. + * + * \param [in] ptp_tx_config_set_cb Tx config set callback function. + * + * \retval SHR_E_NONE No errors. + */ +extern int +ngknet_ptp_tx_config_set_cb_unregister(ngknet_ptp_config_set_cb_f ptp_tx_config_set_cb); + +/*! + * \brief Register PTP Rx HW timestamp get callback. + * + * \param [in] ptp_rx_hwts_get_cb Rx HW timestamp get callback function. + * + * \retval SHR_E_NONE No errors. + */ +extern int +ngknet_ptp_rx_hwts_get_cb_register(ngknet_ptp_hwts_get_cb_f ptp_rx_hwts_get_cb); + +/*! + * \brief Unregister PTP Rx HW timestamp get callback. + * + * \param [in] ptp_rx_hwts_get_cb Rx HW timestamp get callback function. + * + * \retval SHR_E_NONE No errors. + */ +extern int +ngknet_ptp_rx_hwts_get_cb_unregister(ngknet_ptp_hwts_get_cb_f ptp_rx_hwts_get_cb); + +/*! + * \brief Register PTP Tx HW timestamp get callback. + * + * \param [in] ptp_tx_hwts_get_cb Tx HW timestamp get callback function. + * + * \retval SHR_E_NONE No errors. + */ +extern int +ngknet_ptp_tx_hwts_get_cb_register(ngknet_ptp_hwts_get_cb_f ptp_tx_hwts_get_cb); + +/*! + * \brief Unregister PTP Tx HW timestamp get callback. + * + * \param [in] ptp_tx_hwts_get_cb Tx HW timestamp get callback function. + * + * \retval SHR_E_NONE No errors. + */ +extern int +ngknet_ptp_tx_hwts_get_cb_unregister(ngknet_ptp_hwts_get_cb_f ptp_tx_hwts_get_cb); + +/*! + * \brief Register PTP Tx meta set callback. + * + * \param [in] ptp_tx_meta_set_cb Tx meta set callback function. + * + * \retval SHR_E_NONE No errors. + */ +extern int +ngknet_ptp_tx_meta_set_cb_register(ngknet_ptp_meta_set_cb_f ptp_tx_meta_set_cb); + +/*! + * \brief Unregister PTP Tx meta set callback. + * + * \param [in] ptp_tx_meta_set_cb Tx meta set callback function. + * + * \retval SHR_E_NONE No errors. + */ +extern int +ngknet_ptp_tx_meta_set_cb_unregister(ngknet_ptp_meta_set_cb_f ptp_tx_meta_set_cb); + +/*! + * \brief Register PTP PHC index get callback. + * + * \param [in] ptp_phc_index_get_cb PHC index get callback function. + * + * \retval SHR_E_NONE No errors. + */ +extern int +ngknet_ptp_phc_index_get_cb_register(ngknet_ptp_phc_index_get_cb_f ptp_phc_index_get_cb); + +/*! + * \brief Unregister PTP PHC index get callback. + * + * \param [in] ptp_phc_index_get_cb PHC index get callback function. + * + * \retval SHR_E_NONE No errors. + */ +extern int +ngknet_ptp_phc_index_get_cb_unregister(ngknet_ptp_phc_index_get_cb_f ptp_phc_index_get_cb); + +/*! + * \brief Register PTP device control callback. + * + * \param [in] ptp_dev_ctrl_cb Device control callback function. + * + * \retval SHR_E_NONE No errors. + */ +extern int +ngknet_ptp_dev_ctrl_cb_register(ngknet_ptp_dev_ctrl_cb_f ptp_dev_ctrl_cb); + +/*! + * \brief Unregister PTP device control callback. + * + * \param [in] ptp_dev_ctrl_cb Device control callback function. + * + * \retval SHR_E_NONE No errors. + */ +extern int +ngknet_ptp_dev_ctrl_cb_unregister(ngknet_ptp_dev_ctrl_cb_f ptp_dev_ctrl_cb); + +/*! + * \brief Register Netif Create callback. + * + * \param [netif_cb] netif_cb create callback function. + * + * \retval SHR_E_NONE No errors. + */ +extern int +ngknet_netif_create_cb_register(ngknet_netif_cb_f netif_cb); + +/*! + * \brief Unregister Netif Create callback. + * + * \param [netif_cb] netif_cb destroy callback function. + * + * \retval SHR_E_NONE No errors. + */ +extern int +ngknet_netif_create_cb_unregister(ngknet_netif_cb_f netif_cb); + +/*! + * \brief Register Netif Destroy callback. + * + * \param [netif_cb] netif_cb destroy callback function. + * + * \retval SHR_E_NONE No errors. + */ +extern int +ngknet_netif_destroy_cb_register(ngknet_netif_cb_f netif_cb); + +/*! + * \brief Unregister Netif Destroy callback. + * + * \param [netif_cb] netif_cb destroy callback function. + * + * \retval SHR_E_NONE No errors. + */ +extern int +ngknet_netif_destroy_cb_unregister(ngknet_netif_cb_f netif_cb); + +#endif /* NGKNET_CALLBACK_H */ + diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_dep.h b/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_dep.h new file mode 100644 index 000000000000..919dd6450340 --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_dep.h @@ -0,0 +1,61 @@ +/*! \file ngknet_dep.h + * + * Macro definitions for NGKNET dependence. + * + */ +/* + * $Copyright: Copyright 2018-2020 Broadcom. All rights reserved. + * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * A copy of the GNU General Public License version 2 (GPLv2) can + * be found in the LICENSES folder.$ + */ + +#ifndef NGKNET_DEP_H +#define NGKNET_DEP_H + +#include +#include + +#ifndef TRUE +#define TRUE 1 +#endif +#ifndef FALSE +#define FALSE 0 +#endif + +/*! Memorry barrier */ +#define MEMORY_BARRIER smp_mb() + +/*! CNET print uitility */ +#define CNET_PR(fmt, args...) printk(fmt, ##args) + +struct pdma_dev; + +/*! Externs for the required functions. */ +#define BCMDRD_DEVLIST_ENTRY(_nm,_vn,_dv,_rv,_md,_pi,_bd,_bc,_fn,_cn,_pf,_pd,_r0,_r1) \ +extern int _bd##_cnet_pdma_attach(struct pdma_dev *dev); \ +extern int _bd##_cnet_pdma_detach(struct pdma_dev *dev); +#include + +/*! Create enumeration values from list of supported devices. */ +#define BCMDRD_DEVLIST_ENTRY(_nm,_vn,_dv,_rv,_md,_pi,_bd,_bc,_fn,_cn,_pf,_pd,_r0,_r1) \ + NGKNET_DEV_T_##_bd, +/*! Enumeration for all base device types. */ +typedef enum { + NGKNET_DEV_T_NONE = 0, +#include + NGKNET_DEV_T_COUNT +} ngknet_dev_type_t; + +#endif /* NGKNET_DEP_H */ + diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_extra.c b/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_extra.c new file mode 100644 index 000000000000..00fdb3da8849 --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_extra.c @@ -0,0 +1,505 @@ +/*! \file ngknet_extra.c + * + * Utility routines for NGKNET enhancement. + * + */ +/* + * $Copyright: Copyright 2018-2020 Broadcom. All rights reserved. + * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * A copy of the GNU General Public License version 2 (GPLv2) can + * be found in the LICENSES folder.$ + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include "ngknet_main.h" +#include "ngknet_extra.h" +#include "ngknet_callback.h" + +static struct ngknet_rl_ctrl rl_ctrl; + +int +ngknet_filter_create(struct ngknet_dev *dev, ngknet_filter_t *filter) +{ + struct filt_ctrl *fc = NULL; + struct list_head *list = NULL; + ngknet_filter_t *filt = NULL; + unsigned long flags; + int num, id, done = 0; + + switch (filter->type) { + case NGKNET_FILTER_T_RX_PKT: + break; + default: + return SHR_E_UNAVAIL; + } + + switch (filter->dest_type) { + case NGKNET_FILTER_DEST_T_NULL: + case NGKNET_FILTER_DEST_T_NETIF: + case NGKNET_FILTER_DEST_T_VNET: + case NGKNET_FILTER_DEST_T_CB: /* SDKLT-26907: support NGKNET_FILTER_DEST_T_CB */ + break; + default: + return SHR_E_UNAVAIL; + } + + spin_lock_irqsave(&dev->lock, flags); + + num = (long)dev->fc[0]; + for (id = 1; id < num + 1; id++) { + if (!dev->fc[id]) { + break; + } + } + if (id > NUM_FILTER_MAX) { + spin_unlock_irqrestore(&dev->lock, flags); + return SHR_E_RESOURCE; + } + + fc = kzalloc(sizeof(*fc), GFP_KERNEL); + if (!fc) { + spin_unlock_irqrestore(&dev->lock, flags); + return SHR_E_MEMORY; + } + + dev->fc[id] = fc; + num += id == (num + 1) ? 1 : 0; + dev->fc[0] = (void *)(long)num; + + memcpy(&fc->filt, filter, sizeof(fc->filt)); + fc->filt.id = id; + + list_for_each(list, &dev->filt_list) { + filt = &((struct filt_ctrl *)list)->filt; + if (filt->flags & NGKNET_FILTER_F_MATCH_CHAN) { + if (!(fc->filt.flags & NGKNET_FILTER_F_MATCH_CHAN) || + fc->filt.chan > filt->chan) { + continue; + } + if (fc->filt.chan < filt->chan || + fc->filt.priority < filt->priority) { + list_add_tail(&fc->list, list); + done = 1; + break; + } + } else { + if (fc->filt.flags & NGKNET_FILTER_F_MATCH_CHAN || + fc->filt.priority < filt->priority) { + list_add_tail(&fc->list, list); + done = 1; + break; + } + } + } + if (!done) { + list_add_tail(&fc->list, &dev->filt_list); + } + + filter->id = fc->filt.id; + + spin_unlock_irqrestore(&dev->lock, flags); + + return SHR_E_NONE; +} + +int +ngknet_filter_destroy(struct ngknet_dev *dev, int id) +{ + struct filt_ctrl *fc = NULL; + unsigned long flags; + int num; + + if (id <= 0 || id > NUM_FILTER_MAX) { + return SHR_E_PARAM; + } + + spin_lock_irqsave(&dev->lock, flags); + + fc = (struct filt_ctrl *)dev->fc[id]; + if (!fc) { + spin_unlock_irqrestore(&dev->lock, flags); + return SHR_E_NOT_FOUND; + } + + list_del(&fc->list); + kfree(fc); + + dev->fc[id] = NULL; + num = (long)dev->fc[0]; + while (num-- == id--) { + if (dev->fc[id]) { + dev->fc[0] = (void *)(long)num; + break; + } + } + + spin_unlock_irqrestore(&dev->lock, flags); + + return SHR_E_NONE; +} + +int +ngknet_filter_destroy_all(struct ngknet_dev *dev) +{ + int id; + int rv; + + for (id = 1; id <= NUM_FILTER_MAX; id++) { + rv = ngknet_filter_destroy(dev, id); + if (SHR_FAILURE(rv)) { + return rv; + } + } + + return SHR_E_NONE; +} + +int +ngknet_filter_get(struct ngknet_dev *dev, int id, ngknet_filter_t *filter) +{ + struct filt_ctrl *fc = NULL; + unsigned long flags; + int num; + + if (id <= 0 || id > NUM_FILTER_MAX) { + return SHR_E_PARAM; + } + + spin_lock_irqsave(&dev->lock, flags); + + fc = (struct filt_ctrl *)dev->fc[id]; + if (!fc) { + spin_unlock_irqrestore(&dev->lock, flags); + return SHR_E_NOT_FOUND; + } + + memcpy(filter, &fc->filt, sizeof(*filter)); + + num = (long)dev->fc[0]; + for (id++; id < num + 1; id++) { + if (dev->fc[id]) { + break; + } + } + filter->next = id == (num + 1) ? 0 : id; + + spin_unlock_irqrestore(&dev->lock, flags); + + return SHR_E_NONE; +} + +int +ngknet_filter_get_next(struct ngknet_dev *dev, ngknet_filter_t *filter) +{ + int id; + int rv; + + if (!filter->next) { + for (id = 1; id <= NUM_FILTER_MAX; id++) { + rv = ngknet_filter_get(dev, id, filter); + if (SHR_SUCCESS(rv)) { + return rv; + } + } + if (id > NUM_FILTER_MAX) { + return SHR_E_NOT_FOUND; + } + } + + return ngknet_filter_get(dev, filter->next, filter); +} + +int +ngknet_rx_pkt_filter(struct ngknet_dev *dev, struct sk_buff *skb, struct net_device **ndev, + struct net_device **mndev, struct sk_buff **mskb) +{ + struct pkt_buf *pkb = (struct pkt_buf *)skb->data; + struct net_device *dest_ndev = NULL, *mirror_ndev = NULL; + struct sk_buff *mirror_skb = NULL; + struct ngknet_private *priv = NULL; + struct filt_ctrl *fc = NULL; + struct list_head *list = NULL; + ngknet_filter_t scratch, *filt = NULL, *filt_cb = NULL; + uint8_t *oob = &pkb->data, *data = NULL; + uint16_t tpid; + unsigned long flags; + int wsize; + int chan_id; + int idx, match = 0, match_cb = 0; + + bcmcnet_pdma_dev_queue_to_chan(&dev->pdma_dev, pkb->pkh.queue_id, + PDMA_Q_RX, &chan_id); + + spin_lock_irqsave(&dev->lock, flags); + + dest_ndev = dev->bdev[chan_id]; + if (dest_ndev) { + skb->dev = dest_ndev; + priv = netdev_priv(dest_ndev); + priv->users++; + *ndev = dest_ndev; + spin_unlock_irqrestore(&dev->lock, flags); + return SHR_E_NONE; + } + + if (list_empty(&dev->filt_list)) { + spin_unlock_irqrestore(&dev->lock, flags); + return SHR_E_NONE; + } + + list_for_each(list, &dev->filt_list) { + fc = (struct filt_ctrl *)list; + filt = &fc->filt; + if (filt->flags & NGKNET_FILTER_F_ANY_DATA) { + match = 1; + break; + } + if (filt->flags & NGKNET_FILTER_F_MATCH_CHAN && filt->chan != chan_id) { + continue; + } + memcpy(&scratch.data.b[0], + &oob[filt->oob_data_offset], filt->oob_data_size); + memcpy(&scratch.data.b[filt->oob_data_size], + &pkb->data + pkb->pkh.meta_len + filt->pkt_data_offset, + filt->pkt_data_size); + wsize = NGKNET_BYTES2WORDS(filt->oob_data_size + filt->pkt_data_size); + for (idx = 0; idx < wsize; idx++) { + scratch.data.w[idx] &= filt->mask.w[idx]; + if (scratch.data.w[idx] != filt->data.w[idx]) { + break; + } + } + if (idx == wsize) { + if (NGKNET_FILTER_DEST_T_CB == filt->dest_type) { + match_cb = 1; + filt_cb = filt; + continue; + } + match = 1; + break; + } + } + + if (match) { + fc->hits++; + switch (filt->dest_type) { + case NGKNET_FILTER_DEST_T_NETIF: + if (filt->dest_id == 0) { + dest_ndev = dev->net_dev; + } else { + dest_ndev = dev->vdev[filt->dest_id]; + } + if (dest_ndev) { + skb->dev = dest_ndev; + if (filt->dest_proto) { + pkb->pkh.attrs |= PDMA_RX_SET_PROTO; + skb->protocol = filt->dest_proto; + } + priv = netdev_priv(dest_ndev); + priv->users++; + } + break; + case NGKNET_FILTER_DEST_T_VNET: + pkb->pkh.attrs |= PDMA_RX_TO_VNET; + spin_unlock_irqrestore(&dev->lock, flags); + return SHR_E_NO_HANDLER; + case NGKNET_FILTER_DEST_T_NULL: + default: + spin_unlock_irqrestore(&dev->lock, flags); + return SHR_E_UNAVAIL; + } + } + + spin_unlock_irqrestore(&dev->lock, flags); + + if (!dest_ndev) { + return SHR_E_NONE; + } else { + *ndev = dest_ndev; + } + + if (filt->flags & NGKNET_FILTER_F_STRIP_TAG) { + pkb->pkh.attrs |= PDMA_RX_STRIP_TAG; + data = skb->data + PKT_HDR_SIZE + pkb->pkh.meta_len; + tpid = data[12] << 8 | data[13]; + if (tpid == ETH_P_8021Q || tpid == ETH_P_8021AD) { + pkb->pkh.data_len -= VLAN_HLEN; + memmove(skb->data + VLAN_HLEN, skb->data, + PKT_HDR_SIZE + pkb->pkh.meta_len + 2 * ETH_ALEN); + skb_pull(skb, VLAN_HLEN); + } + } + + if (dev->cbc->rx_cb) { + NGKNET_SKB_CB(skb)->filt = filt; + + /* Add callback filter if matched */ + if (match_cb) { + NGKNET_SKB_CB(skb)->filt_cb = filt_cb; + } + } + + if (filt->mirror_type == NGKNET_FILTER_DEST_T_NETIF) { + spin_lock_irqsave(&dev->lock, flags); + if (filt->mirror_id == 0) { + mirror_ndev = dev->net_dev; + } else { + mirror_ndev = dev->vdev[filt->mirror_id]; + } + if (mirror_ndev) { + mirror_skb = pskb_copy(skb, GFP_ATOMIC); + if (mirror_skb) { + mirror_skb->dev = mirror_ndev; + if (filt->mirror_proto) { + pkb->pkh.attrs |= PDMA_RX_SET_PROTO; + mirror_skb->protocol = filt->mirror_proto; + } + if (dev->cbc->rx_cb) { + NGKNET_SKB_CB(mirror_skb)->filt = filt; + } + priv = netdev_priv(mirror_ndev); + priv->users++; + *mndev = mirror_ndev; + *mskb = mirror_skb; + } + } + spin_unlock_irqrestore(&dev->lock, flags); + } + + return SHR_E_NONE; +} + +static void +ngknet_rl_process(timer_context_t data) +{ + struct ngknet_rl_ctrl *rc = timer_arg(rc, data, timer); + struct ngknet_dev *dev; + unsigned long flags; + int idx; + + spin_lock_irqsave(&rc->lock, flags); + rc->rx_pkts = 0; + for (idx = 0; idx < NUM_PDMA_DEV_MAX; idx++) { + dev = &rc->devs[idx]; + if (rc->dev_active[idx] && rc->dev_paused[idx]) { + bcmcnet_pdma_dev_rx_resume(&dev->pdma_dev); + rl_ctrl.dev_paused[dev->dev_no] = 0; + } + } + spin_unlock_irqrestore(&rc->lock, flags); + + rc->timer.expires = jiffies + HZ / rc->rx_ticks; + add_timer(&rc->timer); +} + +void +ngknet_rx_rate_limit_init(struct ngknet_dev *devs) +{ + sal_memset(&rl_ctrl, 0, sizeof(rl_ctrl)); + rl_ctrl.rx_ticks = 10; + setup_timer(&rl_ctrl.timer, ngknet_rl_process, (timer_context_t)&rl_ctrl); + spin_lock_init(&rl_ctrl.lock); + rl_ctrl.devs = devs; +} + +void +ngknet_rx_rate_limit_cleanup(void) +{ + del_timer_sync(&rl_ctrl.timer); +} + +int +ngknet_rx_rate_limit_started(void) +{ + return rl_ctrl.started; +} + +void +ngknet_rx_rate_limit_start(struct ngknet_dev *dev) +{ + unsigned long flags; + + spin_lock_irqsave(&rl_ctrl.lock, flags); + rl_ctrl.dev_active[dev->dev_no] = 1; + spin_unlock_irqrestore(&rl_ctrl.lock, flags); + + if (!rl_ctrl.started) { + rl_ctrl.started = 1; + rl_ctrl.timer.expires = jiffies + HZ / rl_ctrl.rx_ticks; + add_timer(&rl_ctrl.timer); + } +} + +void +ngknet_rx_rate_limit_stop(struct ngknet_dev *dev) +{ + unsigned long flags; + + spin_lock_irqsave(&rl_ctrl.lock, flags); + rl_ctrl.dev_active[dev->dev_no] = 0; + spin_unlock_irqrestore(&rl_ctrl.lock, flags); +} + +void +ngknet_rx_rate_limit(struct ngknet_dev *dev, int limit) +{ + unsigned long flags; + + spin_lock_irqsave(&rl_ctrl.lock, flags); + if ((++rl_ctrl.rx_pkts + rl_ctrl.rx_overruns > limit / rl_ctrl.rx_ticks) && + !rl_ctrl.dev_paused[dev->dev_no] && rl_ctrl.dev_active[dev->dev_no]) { + rl_ctrl.dev_paused[dev->dev_no] = 1; + rl_ctrl.rx_overruns = 0; + bcmcnet_pdma_dev_rx_suspend(&dev->pdma_dev); + } + if (rl_ctrl.dev_paused[dev->dev_no]) { + rl_ctrl.rx_overruns++; + } + spin_unlock_irqrestore(&rl_ctrl.lock, flags); +} + +void +ngknet_tx_queue_schedule(struct ngknet_dev *dev, struct sk_buff *skb, int *queue) +{ + struct pkt_buf *pkb = (struct pkt_buf *)skb->data; + + if (pkb->pkh.attrs & PDMA_TX_BIND_QUE) { + *queue = pkb->pkh.queue_id; + } +} + diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_extra.h b/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_extra.h new file mode 100644 index 000000000000..27dea9e368e7 --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_extra.h @@ -0,0 +1,218 @@ +/*! \file ngknet_extra.h + * + * Generic data structure definitions for NGKNET enhancement. + * + */ +/* + * $Copyright: Copyright 2018-2020 Broadcom. All rights reserved. + * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * A copy of the GNU General Public License version 2 (GPLv2) can + * be found in the LICENSES folder.$ + */ + +#ifndef NGKNET_EXTRA_H +#define NGKNET_EXTRA_H + +/*! + * \brief Filter control. + */ +struct filt_ctrl { + /*! List head */ + struct list_head list; + + /*! Device number */ + int dev_no; + + /*! Number of hits */ + uint64_t hits; + + /*! Filter description */ + ngknet_filter_t filt; +}; + +/*! + * \brief Create filter. + * + * \param [in] dev Device structure point. + * \param [in] filter Filter structure point. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +ngknet_filter_create(struct ngknet_dev *dev, ngknet_filter_t *filter); + +/*! + * \brief Destroy filter. + * + * \param [in] dev Device structure point. + * \param [in] id Filter ID. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +ngknet_filter_destroy(struct ngknet_dev *dev, int id); + +/*! + * \brief Destroy all the filters. + * + * \param [in] dev Device structure point. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +ngknet_filter_destroy_all(struct ngknet_dev *dev); + +/*! + * \brief Get filter. + * + * \param [in] dev Device structure point. + * \param [in] id Filter ID. + * \param [out] filter Filter structure point. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +ngknet_filter_get(struct ngknet_dev *dev, int id, ngknet_filter_t *filter); + +/*! + * \brief Get the next filter. + * + * \param [in] dev Device structure point. + * \param [out] filter Filter structure point. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +ngknet_filter_get_next(struct ngknet_dev *dev, ngknet_filter_t *filter); + +/*! + * \brief Filter packet. + * + * \param [in] dev Device structure point. + * \param [in] skb Rx packet SKB. + * \param [out] mndev Mirror network interface. + * \param [out] mskb Mirror Rx packet SKB. + * + * \retval Matched network interface. + * \retval NULL No matched network interface. + */ +extern int +ngknet_rx_pkt_filter(struct ngknet_dev *dev, struct sk_buff *skb, struct net_device **ndev, + struct net_device **mndev, struct sk_buff **mskb); + +/*! + * \brief Rx rate limit control. + * + * This contains all the control information for Rx rate limit such as + * the number of Rx packets, status related to Rx rate limit, etc. + * + * The rate limit is kernel-oriented, i.e. all the Rx packets from any + * device/channel will be accounted for. Once the received packets reach + * the limit value in an 1-Sec interval, the driver API XXXX_rx_suspend() + * will be called to suspend Rx. The 1-Sec basis timer will call the driver + * API XXXX_rx_resume() to resume Rx and reset rate-related status/counters + * at the begin of the next 1-Sec interval. + * + * The NGKNET module parameter 'rx_rate_limit' is used to decide the maximum + * Rx rate. Disable Rx rate limit if set 0. It can be set when inserting + * NGKNET module or modified using its SYSFS attributions. + */ +struct ngknet_rl_ctrl { + /*! Rx packets */ + int rx_pkts; + + /*! Rx overruns */ + int rx_overruns; + + /*! Rx ticks */ + int rx_ticks; + + /*! Active devices under rate control */ + int dev_active[NUM_PDMA_DEV_MAX]; + + /*! Paused devices due to no Rx credit */ + int dev_paused[NUM_PDMA_DEV_MAX]; + + /*! Rate limit timer */ + struct timer_list timer; + + /*! Rate limit lock */ + spinlock_t lock; + + /*! Devices */ + struct ngknet_dev *devs; + + /*! Rate limit status indicator */ + int started; +}; + +/*! + * \brief Initialize Rx rate limit. + * + * \param [in] devs Devices array. + */ +extern void +ngknet_rx_rate_limit_init(struct ngknet_dev *devs); + +/*! + * \brief Cleanup Rx rate limit. + */ +extern void +ngknet_rx_rate_limit_cleanup(void); + +/*! + * \brief Get Rx rate limit state. + */ +extern int +ngknet_rx_rate_limit_started(void); + +/*! + * \brief Start Rx rate limit. + * + * \param [in] dev Device structure point. + */ +extern void +ngknet_rx_rate_limit_start(struct ngknet_dev *dev); + +/*! + * \brief Stop Rx rate limit. + * + * \param [in] dev Device structure point. + */ +extern void +ngknet_rx_rate_limit_stop(struct ngknet_dev *dev); + +/*! + * \brief Limit Rx rate. + * + * \param [in] dev Device structure point. + */ +extern void +ngknet_rx_rate_limit(struct ngknet_dev *dev, int limit); + +/*! + * \brief Schedule Tx queue. + * + * \param [in] dev Device structure point. + * \param [in] queue Tx queue number. + */ +extern void +ngknet_tx_queue_schedule(struct ngknet_dev *dev, struct sk_buff *skb, int *queue); + +#endif /* NGKNET_EXTRA_H */ + diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_linux.c b/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_linux.c new file mode 100644 index 000000000000..0162ae5b96c1 --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_linux.c @@ -0,0 +1,173 @@ +/*! \file ngknet_linux.c + * + * Utility routines for Linux kernel APIs abstraction. + * + */ +/* + * $Copyright: Copyright 2018-2020 Broadcom. All rights reserved. + * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * A copy of the GNU General Public License version 2 (GPLv2) can + * be found in the LICENSES folder.$ + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "ngknet_linux.h" + +/*! + * Time + */ + +unsigned long +sal_time_usecs(void) +{ + struct timeval tv; + + kal_time_val_get(&tv); + + return tv.tv_sec * 1000000 + tv.tv_usec; +} + +void +sal_usleep(unsigned long usec) +{ + unsigned long then, now, hz; + + hz = usec * HZ / 1000000; + if (hz) { + schedule_timeout(hz); + } + usec = usec * HZ % 1000000 / HZ; + if (usec) { + then = sal_time_usecs(); + do { + schedule(); + now = sal_time_usecs(); + } while (now > then && (now - then) < usec); + } +} + +/*! + * Synchronization + */ + +typedef struct { + struct semaphore sem; + char *desc; + int binary; +} sem_ctrl_t; + +sal_sem_t +sal_sem_create(char *desc, int binary, int count) +{ + sem_ctrl_t *sc = kmalloc(sizeof(*sc), GFP_KERNEL); + + if (sc != NULL) { + sema_init(&sc->sem, count); + sc->desc = desc; + sc->binary = binary; + } + + return (sal_sem_t)sc; +} + +void +sal_sem_destroy(sal_sem_t sem) +{ + sem_ctrl_t *sc = (sem_ctrl_t *)sem; + + kfree(sc); +} + +int +sal_sem_take(sal_sem_t sem, int usec) +{ + sem_ctrl_t *sc = (sem_ctrl_t *)sem; + int rv; + + if (usec == SAL_SEM_FOREVER) { + do { + rv = down_interruptible(&sc->sem); + } while (rv == -EINTR); + return rv ? -1 : 0; + } + + return -1; +} + +int +sal_sem_give(sal_sem_t sem) +{ + sem_ctrl_t *sc = (sem_ctrl_t *)sem; + + up(&sc->sem); + + return 0; +} + +typedef struct spinlock_ctrl_s { + spinlock_t spinlock; + unsigned long flags; + char *desc; +} *spinlock_ctrl_t; + +sal_spinlock_t +sal_spinlock_create(char *desc) +{ + spinlock_ctrl_t sl = kmalloc(sizeof(*sl), GFP_KERNEL); + + if (sl != NULL) { + spin_lock_init(&sl->spinlock); + sl->flags = 0; + sl->desc = desc; + } + + return (sal_spinlock_t)sl; +} + +void +sal_spinlock_destroy(sal_spinlock_t lock) +{ + spinlock_ctrl_t sl = (spinlock_ctrl_t)lock; + + kfree(sl); +} + +int +sal_spinlock_lock(sal_spinlock_t lock) +{ + spinlock_ctrl_t sl = (spinlock_ctrl_t)lock; + + spin_lock_irqsave(&sl->spinlock, sl->flags); + + return 0; +} + +int +sal_spinlock_unlock(sal_spinlock_t lock) +{ + spinlock_ctrl_t sl = (spinlock_ctrl_t)lock; + + spin_unlock_irqrestore(&sl->spinlock, sl->flags); + + return 0; +} + diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_linux.h b/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_linux.h new file mode 100644 index 000000000000..686aac8f5571 --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_linux.h @@ -0,0 +1,240 @@ +/*! \file ngknet_linux.h + * + * Data structure and macro definitions for Linux kernel APIs abstraction. + * + */ +/* + * $Copyright: Copyright 2018-2020 Broadcom. All rights reserved. + * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * A copy of the GNU General Public License version 2 (GPLv2) can + * be found in the LICENSES folder.$ + */ + +#ifndef NGKNET_LINUX_H +#define NGKNET_LINUX_H + +#include +#include +#include +#include + +/*! + * Kernel abstraction + */ + +#define MODULE_PARAM(n, t, p) module_param(n, t, p) + +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0) +#define kal_vlan_hwaccel_put_tag(skb, proto, tci) \ + __vlan_hwaccel_put_tag(skb, tci) +#define NETIF_F_HW_VLAN_CTAG_RX NETIF_F_HW_VLAN_RX +#define NETIF_F_HW_VLAN_CTAG_TX NETIF_F_HW_VLAN_TX +#else +#define kal_vlan_hwaccel_put_tag(skb, proto, tci) \ + __vlan_hwaccel_put_tag(skb, htons(proto), tci) +#endif /* KERNEL_VERSION(3,10,0) */ + +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,6,0) +static inline int +kal_support_paged_skb(void) +{ + return false; +} +#else +static inline int +kal_support_paged_skb(void) +{ + return true; +} +#endif /* KERNEL_VERSION(3,6,0) */ + +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,6,0) +static inline struct page * +kal_dev_alloc_page(void) +{ + return NULL; +} +#elif LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0) +static inline struct page * +kal_dev_alloc_page(void) +{ + return alloc_pages(GFP_ATOMIC | __GFP_ZERO | __GFP_COLD | + __GFP_COMP | __GFP_MEMALLOC, 0); +} +#else +static inline struct page * +kal_dev_alloc_page(void) +{ + return dev_alloc_page(); +} +#endif /* KERNEL_VERSION(3,6,0) */ + +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,6,0) +static inline struct sk_buff * +kal_build_skb(void *data, unsigned int frag_size) +{ + return NULL; +} +#else +static inline struct sk_buff * +kal_build_skb(void *data, unsigned int frag_size) +{ + return build_skb(data, frag_size); +} +#endif /* KERNEL_VERSION(3,6,0) */ + +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,7,0) +static inline void +kal_netif_trans_update(struct net_device *dev) +{ + dev->trans_start = jiffies; +} +#else +static inline void +kal_netif_trans_update(struct net_device *dev) +{ + netif_trans_update(dev); +} +#endif /* KERNEL_VERSION(4,7,0) */ + +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,17,0) +static inline void +kal_time_val_get(struct timeval *tv) +{ + do_gettimeofday(tv); +} +#else +static inline void +kal_time_val_get(struct timeval *tv) +{ + struct timespec64 ts; + ktime_get_real_ts64(&ts); + tv->tv_sec = ts.tv_sec; + tv->tv_usec = ts.tv_nsec / 1000; +} +#endif /* KERNEL_VERSION(3,17,0) */ + +static inline unsigned long +kal_copy_from_user(void *to, const void __user *from, + unsigned int dl, unsigned int sl) +{ + unsigned int len = dl; + + if (unlikely(len != sl)) { + printk(KERN_WARNING "Unmatched linux_ngknet.ko, please use the latest.\n"); + len = min(dl, sl); + } + + return copy_from_user(to, from, len); +} + +static inline unsigned long +kal_copy_to_user(void __user *to, const void *from, + unsigned int dl, unsigned int sl) +{ + unsigned int len = dl; + + if (unlikely(len != sl)) { + printk(KERN_WARNING "Unmatched linux_ngknet.ko, please use the latest.\n"); + len = min(dl, sl); + } + + return copy_to_user(to, from, len); +} + +/*! + * System abstraction + */ + +static inline void * +sal_alloc(unsigned int sz, char *s) +{ + return kmalloc(sz, GFP_KERNEL); +} + +static inline void +sal_free(void *addr) +{ + kfree(addr); +} + +static inline void * +sal_memset(void *dest, int c, size_t cnt) +{ + return memset(dest, c, cnt); +} + +static inline void * +sal_memcpy(void *dest, const void *src, size_t cnt) +{ + return memcpy(dest, src, cnt); +} + +static inline char * +sal_strncpy(char *dest, const char *src, size_t cnt) +{ + return strncpy(dest, src, cnt); +} + +/*! + * Time + */ + +extern unsigned long +sal_time_usecs(void); + +extern void +sal_usleep(unsigned long usec); + +/*! + * Synchronization + */ + +typedef struct sal_sem_s { + char semaphore_opaque_type; +} *sal_sem_t; + +typedef struct sal_spinlock_s { + char spinlock_opaque_type; +} *sal_spinlock_t; + +#define SAL_SEM_FOREVER -1 +#define SAL_SEM_BINARY 1 +#define SAL_SEM_COUNTING 0 + +extern sal_sem_t +sal_sem_create(char *desc, int binary, int count); + +extern void +sal_sem_destroy(sal_sem_t sem); + +extern int +sal_sem_take(sal_sem_t sem, int usec); + +extern int +sal_sem_give(sal_sem_t sem); + +extern sal_spinlock_t +sal_spinlock_create(char *desc); + +extern void +sal_spinlock_destroy(sal_spinlock_t lock); + +extern int +sal_spinlock_lock(sal_spinlock_t lock); + +extern int +sal_spinlock_unlock(sal_spinlock_t lock); + +#endif /* NGKNET_LINUX_H */ + diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_main.c b/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_main.c new file mode 100644 index 000000000000..b8af31d85ff2 --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_main.c @@ -0,0 +1,2689 @@ +/*! \file ngknet_main.c + * + * NGKNET module entry. + * + */ +/* + * $Copyright: Copyright 2018-2020 Broadcom. All rights reserved. + * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * A copy of the GNU General Public License version 2 (GPLv2) can + * be found in the LICENSES folder.$ + */ + +/* + * This module implements a Linux network driver for Broadcom + * XGS switch devices. The driver simultaneously serves a + * number of virtual Linux network devices. + * + * Packets received from the switch device are sent to a virtual + * Linux network device based on a set of packet filters. + * + * Packets from the virtual Linux network devices are multiplexed + * with fifo mode if only one Tx queue enabled. + * + * A command-based IOCTL interface is used for managing the devices, + * packet filters and virtual Linux network interfaces. + * + * A virtual network interface can be configured to work in RCPU + * mode, which means that packets from the switch device will + * be encapsulated with a RCPU header and a block of meta data + * that basically contains the core DCB information. Likewise, + * packets received from the Linux network stack are assumed to + * be RCPU encapsulated when going out on an interface in RCPU + * mode. If a virtual network interface does not work in RCPU + * mode and transmits to this interface will unmodified go to + * specified physical switch port, DCB information should be + * provided when the interface is created. + * + * The module implements basic Rx DMA rate control. The rate is + * specified in packets per second, and different Rx DMA channels + * can be configured to use different maximum packet rates. + * The packet rate can be configure as a module parameter, and + * it can also be changed dynamically through the proc file + * system (syntax is described in function header comment). + * + * For a list of supported module parameters, please see below. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include "ngknet_main.h" +#include "ngknet_extra.h" +#include "ngknet_procfs.h" +#include "ngknet_callback.h" +#include "ngknet_ptp.h" + +/*! \cond */ +MODULE_AUTHOR("Broadcom Corporation"); +MODULE_DESCRIPTION("Network Device Driver Module"); +MODULE_LICENSE("GPL"); +/*! \endcond */ + +/*! \cond */ +static int debug = 0; +MODULE_PARAM(debug, int, 0); +MODULE_PARM_DESC(debug, +"Debug level (default 0)"); +/*! \endcond */ + +/*! \cond */ +static char *base_dev_name = "bcm"; +MODULE_PARAM(base_dev_name, charp, 0); +MODULE_PARM_DESC(base_dev_name, +"Base device name (default bcm0, bcm1, etc.)"); +/*! \endcond */ + +/*! \cond */ +static char *mac_addr = NULL; +MODULE_PARAM(mac_addr, charp, 0); +MODULE_PARM_DESC(mac_addr, +"Ethernet MAC address (default 02:10:18:xx:xx:xx)"); +/*! \endcond */ + +/*! \cond */ +static int default_mtu = 1500; +MODULE_PARAM(default_mtu, int, 0); +MODULE_PARM_DESC(default_mtu, +"Default MTU for NGKNET network interfaces (default 1500)"); +/*! \endcond */ + +/*! \cond */ +static int rx_buffer_size = RX_BUF_SIZE_DFLT; +MODULE_PARAM(rx_buffer_size, int, 0); +MODULE_PARM_DESC(rx_buffer_size, +"Default size of RX packet buffers (default 9216)"); +/*! \endcond */ + +/*! \cond */ +static int rx_rate_limit = -1; +MODULE_PARAM(rx_rate_limit, int, 0); +MODULE_PARM_DESC(rx_rate_limit, +"Rx rate limit (pps, default -1 no limit)"); +/*! \endcond */ + +/*! \cond */ +static int tx_polling = 0; +MODULE_PARAM(tx_polling, int, 0); +MODULE_PARM_DESC(tx_polling, +"Tx polling mode (default 0 in interrupt mode)"); +/*! \endcond */ + +/*! \cond */ +static int rx_batching = 0; +MODULE_PARAM(rx_batching, int, 0); +MODULE_PARM_DESC(rx_batching, +"Rx batching mode (default 0 in single fill mode)"); +/*! \endcond */ + +typedef int (*drv_ops_attach)(struct pdma_dev *dev); + +struct bcmcnet_drv_ops { + const char *drv_desc; + drv_ops_attach drv_attach; + drv_ops_attach drv_detach; +}; + +#define BCMDRD_DEVLIST_ENTRY(_nm,_vn,_dv,_rv,_md,_pi,_bd,_bc,_fn,_cn,_pf,_pd,_r0,_r1) \ + static struct bcmcnet_drv_ops _bd##_cnet_drv_ops = { \ + #_bd, \ + _bd##_cnet_pdma_attach, \ + _bd##_cnet_pdma_detach, \ + }; +#include + +#define BCMDRD_DEVLIST_ENTRY(_nm,_vn,_dv,_rv,_md,_pi,_bd,_bc,_fn,_cn,_pf,_pd,_r0,_r1) \ + &_bd##_cnet_drv_ops, +static struct bcmcnet_drv_ops *drv_ops[] = { + NULL, +#include + NULL +}; +static int drv_num = sizeof(drv_ops) / sizeof(drv_ops[0]); + +struct ngknet_dev ngknet_devices[NUM_PDMA_DEV_MAX]; + +/* Default random MAC address has Broadcom OUI with local admin bit set */ +static uint8_t ngknet_dev_mac[6] = {0x02, 0x10, 0x18, 0x00, 0x00, 0x00}; + +/* Interrupt handles */ +struct ngknet_intr_handle { + struct napi_struct napi; + struct intr_handle *hdl; + int napi_resched; + int napi_pending; +}; + +static struct ngknet_intr_handle priv_hdl[NUM_PDMA_DEV_MAX][NUM_QUE_MAX]; + +/*! + * Dump packet content for debug + */ +static void +ngknet_pkt_dump(uint8_t *data, int len) +{ + char str[128]; + int i; + + len = len > 256 ? 256 : len; + + for (i = 0; i < len; i++) { + if ((i & 0x1f) == 0) { + sprintf(str, "%04x: ", i); + } + sprintf(&str[strlen(str)], "%02x", data[i]); + if ((i & 0x1f) == 0x1f) { + sprintf(&str[strlen(str)], "\n"); + printk(str); + continue; + } + if ((i & 0x3) == 0x3) { + sprintf(&str[strlen(str)], " "); + } + } + if ((i & 0x1f) != 0) { + sprintf(&str[strlen(str)], "\n"); + printk(str); + } + printk("\n"); +} + +/*! + * Rx packets rate test for debug + */ +static void +ngknet_pkt_stats(struct pdma_dev *pdev, int dir) +{ + static struct timeval tv0[2], tv1[2]; + static uint32_t pkts[2] = {0}, prts[2] = {0}; + static uint64_t intrs = 0; + + if (pkts[dir] == 0) { + kal_time_val_get(&tv0[dir]); + intrs = pdev->stats.intrs; + } + if (++pkts[dir] >= 100000) { + uint32_t iv_time; + uint32_t pps; + kal_time_val_get(&tv1[dir]); + iv_time = (tv1[dir].tv_sec - tv0[dir].tv_sec) * 1000000 + + (tv1[dir].tv_usec - tv0[dir].tv_usec); + pps = 100000 * 1000 / (iv_time / 1000); + prts[dir]++; + if (pps <= 100000 || prts[dir] * 100000 >= pps) { + printk(KERN_CRIT "%s -- limit: %d pps, 100K pkts time: %d usec, rate: %d pps, intrs: %llu\n", + dir == PDMA_Q_RX ? "Rx" : "Tx", + dir == PDMA_Q_RX ? rx_rate_limit : -1, + iv_time, pps, pdev->stats.intrs - intrs); + prts[dir] = 0; + } + pkts[dir] = 0; + } +} + +/*! + * Read 32-bit register callback + */ +static int +ngknet_dev_read32(struct pdma_dev *dev, uint32_t addr, uint32_t *data) +{ + *data = ngbde_kapi_pio_read32(dev->unit, addr); + + return 0; +} + +/*! + * Write 32-bit register callback + */ +static int +ngknet_dev_write32(struct pdma_dev *dev, uint32_t addr, uint32_t data) +{ + ngbde_kapi_pio_write32(dev->unit, addr, data); + + return 0; +} + +/*! + * Set Rx HW timestamping. + */ +static int +ngknet_ptp_rx_hwts_set(struct net_device *ndev, struct sk_buff *skb) +{ + struct skb_shared_hwtstamps *shhwtstamps = skb_hwtstamps(skb); + uint64_t ts = 0; + int rv; + + rv = ngknet_ptp_rx_hwts_get(ndev, skb, &ts); + if (SHR_FAILURE(rv) || !ts) { + return SHR_E_FAIL; + } + + memset(shhwtstamps, 0, sizeof(*shhwtstamps)); + shhwtstamps->hwtstamp = ns_to_ktime(ts); + + return SHR_E_NONE; +} + +/*! + * \brief Process Rx packet. + * + * Add RCPU encapsulation or strip matadata if needed + * + * \param [in] ndev Network device structure point. + * \param [in] oskb Rx packet SKB. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +static int +ngknet_rx_frame_process(struct net_device *ndev, struct sk_buff **oskb) +{ + struct ngknet_private *priv = netdev_priv(ndev); + struct ngknet_dev *dev = priv->bkn_dev; + struct sk_buff *skb = *oskb; + struct ngknet_rcpu_hdr *rch = (struct ngknet_rcpu_hdr *)skb->data; + struct pkt_hdr *pkh = (struct pkt_hdr *)skb->data; + uint8_t meta_len = pkh->meta_len; + + /* Do Rx timestamping */ + if (priv->hwts_rx_filter) { + ngknet_ptp_rx_hwts_set(ndev, skb); + } + + /* Remove FCS from packet length */ + skb_trim(skb, skb->len - ETH_FCS_LEN); + pkh->data_len -= ETH_FCS_LEN; + + if (priv->flags & NGKNET_NETIF_F_RCPU_ENCAP) { + /* Set up RCPU header */ + memcpy(skb->data, skb->data + PKT_HDR_SIZE + meta_len, 2 * ETH_ALEN); + if (*(uint32_t *)&dev->rcpu_ctrl.dst_mac[0] != 0 || + *(uint16_t *)&dev->rcpu_ctrl.dst_mac[4] != 0) { + memcpy(rch->dst_mac, dev->rcpu_ctrl.dst_mac, ETH_ALEN); + } + if (*(uint32_t *)&dev->rcpu_ctrl.src_mac[0] != 0 || + *(uint16_t *)&dev->rcpu_ctrl.src_mac[4] != 0) { + memcpy(rch->src_mac, dev->rcpu_ctrl.src_mac, ETH_ALEN); + } + rch->vlan_tpid = htons(dev->rcpu_ctrl.vlan_tpid); + rch->vlan_tci = htons(dev->rcpu_ctrl.vlan_tci); + rch->eth_type = htons(dev->rcpu_ctrl.eth_type); + rch->pkt_sig = htons(dev->rcpu_ctrl.pkt_sig); + rch->op_code = RCPU_OPCODE_RX; + rch->flags = RCPU_FLAG_MODHDR; + rch->trans_id = htons(dev->rcpu_ctrl.trans_id); + rch->data_len = htons(pkh->data_len); + } else { + /* Remove packet header and meta data */ + skb_pull(skb, PKT_HDR_SIZE + meta_len); + } + + /* Optional callback handle */ + if (dev->cbc->rx_cb) { + struct ngknet_callback_desc *cbd = NGKNET_SKB_CB(skb); + cbd->dev_no = dev->dev_no; + cbd->dev_id = dev->pdma_dev.dev_id; + cbd->type_str = drv_ops[dev->pdma_dev.dev_type]->drv_desc; + cbd->priv = priv; + if (priv->flags & NGKNET_NETIF_F_RCPU_ENCAP) { + cbd->pmd = skb->data + PKT_HDR_SIZE; + cbd->pkt_len = ntohs(rch->data_len); + } else { + cbd->pmd = skb->data - meta_len; + cbd->pkt_len = pkh->data_len; + } + cbd->pmd_len = meta_len; + skb = dev->cbc->rx_cb(skb); + if (!skb) { + *oskb = NULL; + return SHR_E_UNAVAIL; + } + if (priv->flags & NGKNET_NETIF_F_RCPU_ENCAP) { + rch = (struct ngknet_rcpu_hdr *)skb->data; + rch->data_len = htons(skb->len - PKT_HDR_SIZE - meta_len); + } + } + + /* Update SKB pointer */ + *oskb = skb; + + return SHR_E_NONE; +} + +/*! + * \brief Network interface Rx function. + * + * After processing the packet, send it up to network stack. + * + * \param [in] ndev Network device structure point. + * \param [in] skb Rx packet SKB. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +static int +ngknet_netif_recv(struct net_device *ndev, struct sk_buff *skb) +{ + struct ngknet_private *priv = netdev_priv(ndev); + struct ngknet_dev *dev = priv->bkn_dev; + struct pdma_dev *pdev = &dev->pdma_dev; + struct pkt_hdr *pkh = (struct pkt_hdr *)skb->data; + struct napi_struct *napi = NULL; + uint16_t proto; + int chan, gi, qi; + int rv; + + /* Handle one incoming packet */ + rv = ngknet_rx_frame_process(ndev, &skb); + if (SHR_FAILURE(rv)) { + if (!skb) { + return SHR_E_NONE; + } + } + + DBG_VERB(("Rx packet sent up to ndev%d (%d bytes).\n", priv->id, skb->len)); + if (debug & DBG_LVL_PDMP) { + ngknet_pkt_dump(skb->data, skb->len); + } + + if (ndev->features & NETIF_F_RXCSUM) { + if ((pkh->attrs & (PDMA_RX_TU_CSUM | PDMA_RX_IP_CSUM)) == + (PDMA_RX_TU_CSUM | PDMA_RX_IP_CSUM)) { + skb->ip_summed = CHECKSUM_UNNECESSARY; + } else { + skb_checksum_none_assert(skb); + } + } + + if (!(priv->flags & NGKNET_NETIF_F_RCPU_ENCAP) && + ndev->features & NETIF_F_HW_VLAN_CTAG_RX && + pkh->attrs & PDMA_RX_STRIP_TAG) { + kal_vlan_hwaccel_put_tag(skb, ETH_P_8021Q, priv->vlan); + } + + proto = eth_type_trans(skb, ndev); + if (priv->flags & NGKNET_NETIF_F_RCPU_ENCAP) { + skb->protocol = htons(dev->rcpu_ctrl.eth_type); + } else if (!(pkh->attrs & PDMA_RX_SET_PROTO) || !skb->protocol) { + skb->protocol = proto; + } + + skb_record_rx_queue(skb, pkh->queue_id); + + bcmcnet_pdma_dev_queue_to_chan(pdev, pkh->queue_id, PDMA_Q_RX, &chan); + gi = chan / pdev->grp_queues; + if (pdev->flags & PDMA_GROUP_INTR) { + napi = (struct napi_struct *)pdev->ctrl.grp[gi].intr_hdl[0].priv; + } else { + qi = pkh->queue_id; + napi = (struct napi_struct *)pdev->ctrl.grp[gi].intr_hdl[qi].priv; + } + napi_gro_receive(napi, skb); + + /* Update accounting */ + priv->stats.rx_packets++; + priv->stats.rx_bytes += skb->len; + + /* Rate limit */ + if (rx_rate_limit >= 0) { + if (!ngknet_rx_rate_limit_started()) { + ngknet_rx_rate_limit_start(dev); + } + ngknet_rx_rate_limit(dev, rx_rate_limit); + } + + return SHR_E_NONE; +} + +/*! + * \brief Driver Rx callback. + * + * After processing the packet, send it up to network stack. + * + * \param [in] pdev Packet DMA device structure point. + * \param [in] buf Raw Rx buffer. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +static int +ngknet_frame_recv(struct pdma_dev *pdev, int queue, void *buf) +{ + struct ngknet_dev *dev = (struct ngknet_dev *)pdev->priv; + struct sk_buff *skb = (struct sk_buff *)buf, *mskb = NULL; + struct net_device *ndev = NULL, *mndev = NULL; + struct ngknet_private *priv = NULL; + unsigned long flags; + int rv; + + DBG_VERB(("Rx packet (%d bytes).\n", skb->len)); + if (debug & DBG_LVL_PDMP) { + ngknet_pkt_dump(skb->data, skb->len); + } + + /* Go through the filters */ + rv = ngknet_rx_pkt_filter(dev, skb, &ndev, &mndev, &mskb); + if (SHR_FAILURE(rv) || !ndev) { + return SHR_E_FAIL; + } + + /* Populate header, checksum status, VLAN, and protocol */ + priv = netdev_priv(ndev); + if (netif_carrier_ok(ndev)) { + ngknet_netif_recv(ndev, skb); + } else { + priv->stats.rx_dropped++; + rv = SHR_E_UNAVAIL; + } + + spin_lock_irqsave(&dev->lock, flags); + priv->users--; + if (!priv->users && priv->wait) { + wake_up(&dev->wq); + } + spin_unlock_irqrestore(&dev->lock, flags); + + /* Handle mirrored packet */ + if (mndev && mskb) { + priv = netdev_priv(mndev); + if (netif_carrier_ok(mndev)) { + ngknet_netif_recv(mndev, mskb); + } else { + priv->stats.rx_dropped++; + dev_kfree_skb_any(mskb); + } + spin_lock_irqsave(&dev->lock, flags); + priv->users--; + if (!priv->users && priv->wait) { + wake_up(&dev->wq); + } + spin_unlock_irqrestore(&dev->lock, flags); + } + + /* Measure speed */ + if (debug & DBG_LVL_RATE) { + ngknet_pkt_stats(pdev, PDMA_Q_RX); + } + + return rv; +} + +/*! + * Set Tx HW timestamping. + */ +static int +ngknet_ptp_tx_hwts_set(struct net_device *ndev, struct sk_buff *skb) +{ + struct skb_shared_hwtstamps shhwtstamps; + uint64_t ts = 0; + int rv; + + rv = ngknet_ptp_tx_hwts_get(ndev, skb, &ts); + if (SHR_FAILURE(rv) || !ts) { + return SHR_E_FAIL; + } + + memset(&shhwtstamps, 0, sizeof(shhwtstamps)); + shhwtstamps.hwtstamp = ns_to_ktime(ts); + skb_tstamp_tx(skb, &shhwtstamps); + + return SHR_E_NONE; +} + +/*! + * PTP Tx worker. + */ +static void +ngknet_ptp_tx_work(struct work_struct *work) +{ + struct ngknet_dev *dev = container_of(work, struct ngknet_dev, ptp_tx_work); + struct sk_buff *skb; + int rv; + + while (skb_queue_len(&dev->ptp_tx_queue)) { + skb = skb_dequeue(&dev->ptp_tx_queue); + rv = ngknet_ptp_tx_hwts_set(dev->net_dev, skb); + if (SHR_FAILURE(rv)) { + printk("Timestamp value has not been set for current skb.\n"); + } + dev_kfree_skb_any(skb); + } +} + +/*! + * Config Tx metadata for HW timestamping. + */ +static int +ngknet_ptp_tx_config(struct net_device *ndev, struct sk_buff *skb) +{ + struct ngknet_private *priv = netdev_priv(ndev); + struct ngknet_dev *dev = priv->bkn_dev; + int rv; + + if (priv->type == NGKNET_NETIF_T_PORT) { + rv = ngknet_ptp_tx_meta_set(ndev, skb); + if (SHR_FAILURE(rv)) { + return rv; + } + } else if (priv->hwts_tx_type != HWTSTAMP_TX_ONESTEP_SYNC) { + return SHR_E_UNAVAIL; + } + + skb_shinfo(skb)->tx_flags |= SKBTX_IN_PROGRESS; + + if (priv->hwts_tx_type == HWTSTAMP_TX_ONESTEP_SYNC) { + skb_queue_tail(&dev->ptp_tx_queue, skb_get(skb)); + schedule_work(&dev->ptp_tx_work); + } + + return SHR_E_NONE; +} + +/*! + * \brief Process Tx packet. + * + * Strip RCPU encapsulation, setup CNET packet buffer, add vlan tag + * or pad the packet. + * + * \param [in] ndev Network device structure point. + * \param [in] oskb Tx packet SKB. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +static int +ngknet_tx_frame_process(struct net_device *ndev, struct sk_buff **oskb) +{ + struct ngknet_private *priv = netdev_priv(ndev); + struct ngknet_dev *dev = priv->bkn_dev; + struct sk_buff *skb = *oskb; + struct ngknet_rcpu_hdr *rch = (struct ngknet_rcpu_hdr *)skb->data; + struct pkt_hdr *pkh = (struct pkt_hdr *)skb->data; + struct sk_buff *nskb = NULL; + char *data = NULL; + uint32_t copy_len, meta_len, data_len, pkt_len, tag_len; + uint16_t tpid; + + /* Set up packet header */ + if (priv->flags & NGKNET_NETIF_F_RCPU_ENCAP) { + /* RCPU encapsulation packet */ + data_len = pkh->attrs & PDMA_TX_HDR_COOKED ? + pkh->data_len - ETH_FCS_LEN : ntohs(rch->data_len); + pkt_len = PKT_HDR_SIZE + rch->meta_len + data_len; + if (skb->len != pkt_len || skb->len < (PKT_HDR_SIZE + 14)) { + DBG_WARN(("Tx drop: Invalid RCPU encapsulation\n")); + return SHR_E_FAIL; + } + if (dev->rcpu_ctrl.pkt_sig && dev->rcpu_ctrl.pkt_sig != ntohs(rch->pkt_sig)) { + DBG_WARN(("Tx drop: Invalid RCPU signature\n")); + return SHR_E_FAIL; + } + if (pkh->attrs & PDMA_TX_HDR_COOKED) { + /* Resumed packet */ + return SHR_E_NONE; + } + pkh->data_len = data_len + ETH_FCS_LEN; + pkh->meta_len = rch->meta_len; + pkh->attrs = 0; + if (rch->flags & RCPU_FLAG_MODHDR) { + pkh->attrs |= PDMA_TX_HIGIG_PKT; + } + if (rch->flags & RCPU_FLAG_PAUSE) { + pkh->attrs |= PDMA_TX_PAUSE_PKT; + } + if (rch->flags & RCPU_FLAG_PURGE) { + pkh->attrs |= PDMA_TX_PURGE_PKT; + } + if (rch->flags & RCPU_FLAG_BIND_QUE) { + pkh->attrs |= PDMA_TX_BIND_QUE; + } + } else { + /* Non-RCPU encapsulation packet */ + data_len = pkh->data_len - ETH_FCS_LEN; + pkt_len = PKT_HDR_SIZE + pkh->meta_len + data_len; + if (skb->len == pkt_len && pkh->attrs & PDMA_TX_HDR_COOKED && + pkh->pkt_sig == dev->rcpu_ctrl.pkt_sig) { + /* Resumed packet */ + return SHR_E_NONE; + } + meta_len = 0; + if (priv->type == NGKNET_NETIF_T_PORT) { + meta_len = priv->meta_len; + if (!meta_len) { + printk("Tx abort: no metadata\n"); + return SHR_E_UNAVAIL; + } + } + if (skb_header_cloned(skb) || + skb_headroom(skb) < (PKT_HDR_SIZE + meta_len + VLAN_HLEN) || + skb_tailroom(skb) < ETH_FCS_LEN) { + nskb = skb_copy_expand(skb, PKT_HDR_SIZE + meta_len + VLAN_HLEN, + ETH_FCS_LEN, GFP_ATOMIC); + if (!nskb) { + return SHR_E_MEMORY; + } + skb_shinfo(nskb)->tx_flags = skb_shinfo(skb)->tx_flags; + skb = nskb; + } + skb_push(skb, PKT_HDR_SIZE + meta_len); + memset(skb->data, 0, PKT_HDR_SIZE + meta_len); + pkh = (struct pkt_hdr *)skb->data; + pkh->data_len = skb->len - PKT_HDR_SIZE - meta_len + ETH_FCS_LEN; + pkh->meta_len = meta_len; + pkh->attrs = 0; + if (priv->type == NGKNET_NETIF_T_PORT) { + /* Send to physical port using netif metadata */ + if (priv->meta_off) { + memmove(skb->data + PKT_HDR_SIZE, skb->data + PKT_HDR_SIZE + meta_len, priv->meta_off); + } + memcpy(skb->data + PKT_HDR_SIZE + priv->meta_off, priv->meta_data, priv->meta_len); + pkh->attrs |= PDMA_TX_HIGIG_PKT; + } + pkh->pkt_sig = dev->rcpu_ctrl.pkt_sig; + } + + /* Packet header done here */ + pkh->attrs |= PDMA_TX_HDR_COOKED; + + data = skb->data + PKT_HDR_SIZE + pkh->meta_len; + tpid = data[12] << 8 | data[13]; + tag_len = (tpid == ETH_P_8021Q || tpid == ETH_P_8021AD) ? VLAN_HLEN : 0; + + /* Need to add VLAN tag if packet is untagged */ + if (!tag_len && (!(pkh->attrs & PDMA_TX_HIGIG_PKT) || priv->flags & NGKNET_NETIF_F_ADD_TAG)) { + copy_len = PKT_HDR_SIZE + pkh->meta_len + 2 * ETH_ALEN; + if (skb_header_cloned(skb) || skb_headroom(skb) < VLAN_HLEN) { + nskb = skb_copy_expand(skb, VLAN_HLEN, 0, GFP_ATOMIC); + if (!nskb) { + return SHR_E_MEMORY; + } + skb_shinfo(nskb)->tx_flags = skb_shinfo(skb)->tx_flags; + skb = nskb; + } + skb_push(skb, VLAN_HLEN); + memmove(skb->data, skb->data + VLAN_HLEN, copy_len); + pkh = (struct pkt_hdr *)skb->data; + data = skb->data + PKT_HDR_SIZE + pkh->meta_len; + data[12] = 0x81; + data[13] = 0x00; + data[14] = priv->vlan >> 8 & 0xf; + data[15] = priv->vlan & 0xff; + pkh->data_len += VLAN_HLEN; + tag_len = VLAN_HLEN; + } + + /* Optional callback handle */ + if (dev->cbc->tx_cb) { + struct ngknet_callback_desc *cbd = NGKNET_SKB_CB(skb); + cbd->dev_no = dev->dev_no; + cbd->dev_id = dev->pdma_dev.dev_id; + cbd->type_str = drv_ops[dev->pdma_dev.dev_type]->drv_desc; + cbd->priv = priv; + cbd->pmd = skb->data + PKT_HDR_SIZE; + cbd->pmd_len = pkh->meta_len; + cbd->pkt_len = skb->len - PKT_HDR_SIZE - pkh->meta_len; + skb = dev->cbc->tx_cb(skb); + if (!skb) { + if (!nskb) { + *oskb = NULL; + } + return SHR_E_UNAVAIL; + } + pkh = (struct pkt_hdr *)skb->data; + pkh->data_len = skb->len - PKT_HDR_SIZE - pkh->meta_len + ETH_FCS_LEN; + } + + /* Pad packet if needed */ + if (pkh->data_len < (64 + tag_len)) { + pkh->data_len = 64 + tag_len; + if (skb_padto(skb, PKT_HDR_SIZE + pkh->meta_len + pkh->data_len - ETH_FCS_LEN)) { + if (!nskb) { + *oskb = NULL; + } + return SHR_E_MEMORY; + } + } + + /* Update SKB pointer */ + *oskb = skb; + + return SHR_E_NONE; +} + +/*! + * Suspend Tx queue callback + */ +static void +ngknet_tx_suspend(struct pdma_dev *pdev, int queue) +{ + struct ngknet_dev *dev = (struct ngknet_dev *)pdev->priv; + unsigned long flags; + int vdi; + + netif_stop_subqueue(dev->net_dev, queue); + + spin_lock_irqsave(&dev->lock, flags); + for (vdi = 1; vdi <= NUM_VDEV_MAX; vdi++) { + if (!dev->vdev[vdi]) { + continue; + } + netif_stop_subqueue(dev->vdev[vdi], queue); + } + spin_unlock_irqrestore(&dev->lock, flags); +} + +/*! + * Resume Tx queue callback + */ +static void +ngknet_tx_resume(struct pdma_dev *pdev, int queue) +{ + struct ngknet_dev *dev = (struct ngknet_dev *)pdev->priv; + unsigned long flags; + int vdi; + + if (__netif_subqueue_stopped(dev->net_dev, queue)) { + netif_wake_subqueue(dev->net_dev, queue); + } + + spin_lock_irqsave(&dev->lock, flags); + for (vdi = 1; vdi <= NUM_VDEV_MAX; vdi++) { + if (!dev->vdev[vdi]) { + continue; + } + if (__netif_subqueue_stopped(dev->vdev[vdi], queue)) { + netif_wake_subqueue(dev->vdev[vdi], queue); + } + } + spin_unlock_irqrestore(&dev->lock, flags); + + if (pdev->mode == DEV_MODE_HNET) { + atomic_set(&dev->hnet_active, 1); + wake_up_interruptible(&dev->hnet_wq); + } +} + +/*! + * Enable interrupt callback + */ +static void +ngknet_intr_enable(struct pdma_dev *pdev, int cmc, int chan, + uint32_t reg, uint32_t mask) +{ + pdev->ctrl.grp[cmc].irq_mask |= mask; + ngbde_kapi_intr_mask_write(pdev->unit, 0, reg, pdev->ctrl.grp[cmc].irq_mask); +} + +/*! + * Disable interrupt callback + */ +static void +ngknet_intr_disable(struct pdma_dev *pdev, int cmc, int chan, + uint32_t reg, uint32_t mask) +{ + pdev->ctrl.grp[cmc].irq_mask &= ~mask; + ngbde_kapi_intr_mask_write(pdev->unit, 0, reg, pdev->ctrl.grp[cmc].irq_mask); +} + +/*! + * NAPI polling function + */ +static int +ngknet_poll(struct napi_struct *napi, int budget) +{ + struct ngknet_intr_handle *kih = (struct ngknet_intr_handle *)napi; + struct intr_handle *hdl = kih->hdl; + struct pdma_dev *pdev = (struct pdma_dev *)hdl->dev; + struct ngknet_dev *dev = (struct ngknet_dev *)pdev->priv; + unsigned long flags; + int work_done; + + DBG_NAPI(("Scheduled NAPI on queue %d.\n", hdl->queue)); + + kih->napi_resched = 0; + kih->napi_pending = 0; + + if (pdev->flags & PDMA_GROUP_INTR) { + work_done = bcmcnet_group_poll(pdev, hdl->group, budget); + } else { + work_done = bcmcnet_queue_poll(pdev, hdl, budget); + } + + if (work_done < budget) { + napi_complete(napi); + if (kih->napi_pending && napi_schedule_prep(napi)) { + __napi_schedule(napi); + return work_done; + } + spin_lock_irqsave(&dev->lock, flags); + if (!kih->napi_resched) { + if (pdev->flags & PDMA_GROUP_INTR) { + bcmcnet_group_intr_enable(pdev, hdl->group); + } else { + bcmcnet_queue_intr_enable(pdev, hdl); + } + } + spin_unlock_irqrestore(&dev->lock, flags); + } + + return work_done; +} + +/*! + * NGKNET ISR + */ +static int +ngknet_isr(void *isr_data) +{ + struct ngknet_dev *dev = isr_data; + struct pdma_dev *pdev = &dev->pdma_dev; + struct intr_handle *hdl = NULL; + struct napi_struct *napi = NULL; + unsigned long flags; + int gi, qi; + int iv = 0; + + for (gi = 0; gi < pdev->num_groups; gi++) { + if (!pdev->ctrl.grp[gi].attached) { + continue; + } + for (qi = 0; qi < pdev->grp_queues; qi++) { + hdl = &pdev->ctrl.grp[gi].intr_hdl[qi]; + if (pdev->flags & PDMA_GROUP_INTR) { + if (!bcmcnet_group_intr_check(pdev, gi)) { + break; + } + } else { + if (!bcmcnet_queue_intr_check(pdev, hdl)) { + continue; + } + } + spin_lock_irqsave(&dev->lock, flags); + if (pdev->flags & PDMA_GROUP_INTR) { + bcmcnet_group_intr_disable(pdev, gi); + } else { + bcmcnet_queue_intr_disable(pdev, hdl); + } + spin_unlock_irqrestore(&dev->lock, flags); + napi = (struct napi_struct *)hdl->priv; + if (likely(napi_schedule_prep(napi))) { + __napi_schedule(napi); + } + iv++; + if (pdev->flags & PDMA_GROUP_INTR) { + break; + } + } + } + + if (iv) { + DBG_IRQ(("Got interrupt on device %d.\n", dev->dev_no)); + pdev->stats.intrs++; + return IRQ_HANDLED; + } else { + return IRQ_NONE; + } +} + +/*! + * Hypervisor network work handler + */ +static void +ngknet_dev_hnet_work(struct pdma_dev *pdev) +{ + struct ngknet_dev *dev = (struct ngknet_dev *)pdev->priv; + struct intr_handle *hdl = NULL; + struct napi_struct *napi = NULL; + struct ngknet_intr_handle *kih = NULL; + unsigned long flags; + int gi, qi; + + for (gi = 0; gi < pdev->num_groups; gi++) { + if (!pdev->ctrl.grp[gi].attached) { + continue; + } + for (qi = 0; qi < pdev->grp_queues; qi++) { + hdl = &pdev->ctrl.grp[gi].intr_hdl[qi]; + napi = (struct napi_struct *)hdl->priv; + kih = (struct ngknet_intr_handle *)napi; + kih->napi_pending = 1; + if (napi_schedule_prep(napi)) { + spin_lock_irqsave(&dev->lock, flags); + kih->napi_resched = 1; + spin_unlock_irqrestore(&dev->lock, flags); + local_bh_disable(); + __napi_schedule(napi); + local_bh_enable(); + } + if (pdev->flags & PDMA_GROUP_INTR) { + break; + } + } + } +} + +/*! + * Hypervisor network wait handler + */ +static int +ngknet_dev_hnet_wait(struct pdma_dev *pdev) +{ + struct ngknet_dev *dev = (struct ngknet_dev *)pdev->priv; + int qi; + int rv; + + while (!kthread_should_stop()) { + wait_event_interruptible(dev->hnet_wq, + atomic_read(&dev->hnet_active) != 0); + if (!(dev->flags & NGKNET_DEV_ACTIVE)) { + schedule_timeout(HZ); + continue; + } + atomic_set(&dev->hnet_active, 0); + for (qi = 0; qi < pdev->ctrl.nb_txq; qi++) { + do { + rv = pdev->pkt_xmit(pdev, qi, 0); + } while (rv == SHR_E_NONE); + } + schedule_work(&dev->hnet_work); + } + + return 0; +} + +/*! + * Hypervisor network wake handler + */ +static int +ngknet_dev_vnet_wake(struct pdma_dev *pdev) +{ + struct ngknet_dev *dev = (struct ngknet_dev *)pdev->priv; + + atomic_set(&dev->vnet_active, 1); + wake_up_interruptible(&dev->vnet_wq); + + return SHR_E_NONE; +} + +/*! + * Hypervisor network process + */ +static int +ngknet_dev_hnet_process(void *data) +{ + return ngknet_dev_hnet_wait((struct pdma_dev *)data); +} + +/*! + * Hypervisor network schedule + */ +static void +ngknet_dev_hnet_schedule(struct work_struct *work) +{ + struct ngknet_dev *dev = container_of(work, struct ngknet_dev, hnet_work); + + ngknet_dev_hnet_work(&dev->pdma_dev); +} + +/*! + * Convert physical address to virtual address + */ +static void * +ngknet_sys_p2v(struct pdma_dev *pdev, uint64_t paddr) +{ + return ngbde_kapi_dma_bus_to_virt(pdev->unit, (dma_addr_t)paddr); +} + +/*! + * Convert virtual address to physical address + */ +static uint64_t +ngknet_sys_v2p(struct pdma_dev *pdev, void *vaddr) +{ + return (uint64_t)ngbde_kapi_dma_virt_to_bus(pdev->unit, vaddr); +} + +/*! + * Open network device + */ +static int +ngknet_enet_open(struct net_device *ndev) +{ + struct ngknet_private *priv = netdev_priv(ndev); + struct ngknet_dev *dev = priv->bkn_dev; + struct pdma_dev *pdev = &dev->pdma_dev; + struct napi_struct *napi = NULL; + unsigned long bm_queue; + int gi, qi; + int rv; + + if (!pdev->ctrl.bm_rxq || !pdev->ctrl.bm_txq) { + printk("Not config Rx or Tx queue yet!\n"); + return -EPERM; + } + + if (priv->id <= 0) { + /* Register interrupt handler */ + ngbde_kapi_intr_connect(dev->dev_no, 0, ngknet_isr, dev); + + /* Start PDMA device */ + rv = bcmcnet_pdma_dev_start(pdev); + if (SHR_FAILURE(rv)) { + ngbde_kapi_intr_disconnect(dev->dev_no, 0); + return -EPERM; + } + + /* Start rate limit */ + if (rx_rate_limit >= 0) { + ngknet_rx_rate_limit_start(dev); + } + + /* Notify the stack of the actual queue counts. */ + rv = netif_set_real_num_rx_queues(dev->net_dev, pdev->ctrl.nb_rxq); + if (rv < 0) { + ngbde_kapi_intr_disconnect(dev->dev_no, 0); + return rv; + } + rv = netif_set_real_num_tx_queues(dev->net_dev, pdev->ctrl.nb_txq); + if (rv < 0) { + ngbde_kapi_intr_disconnect(dev->dev_no, 0); + return rv; + } + + for (gi = 0; gi < pdev->num_groups; gi++) { + if (!pdev->ctrl.grp[gi].attached) { + continue; + } + bm_queue = pdev->ctrl.grp[gi].bm_rxq | pdev->ctrl.grp[gi].bm_txq; + for (qi = 0; qi < pdev->grp_queues; qi++) { + napi = (struct napi_struct *)pdev->ctrl.grp[gi].intr_hdl[qi].priv; + if (pdev->flags & PDMA_GROUP_INTR) { + napi_enable(napi); + break; + } + if (1 << qi & bm_queue) { + napi_enable(napi); + } + } + } + } else { + /* Notify the stack of the actual queue counts. */ + rv = netif_set_real_num_rx_queues(ndev, pdev->ctrl.nb_rxq); + if (rv < 0) { + return rv; + } + rv = netif_set_real_num_tx_queues(ndev, pdev->ctrl.nb_txq); + if (rv < 0) { + return rv; + } + } + + /* Prevent tx timeout */ + kal_netif_trans_update(ndev); + + netif_tx_wake_all_queues(ndev); + + return 0; +} + +/*! + * Stop network device + */ +static int +ngknet_enet_stop(struct net_device *ndev) +{ + struct ngknet_private *priv = netdev_priv(ndev); + struct ngknet_dev *dev = priv->bkn_dev; + struct pdma_dev *pdev = &dev->pdma_dev; + struct napi_struct *napi = NULL; + unsigned long bm_queue; + int gi, qi; + + netif_tx_stop_all_queues(ndev); + + if (priv->id <= 0) { + /* Stop rate limit */ + if (rx_rate_limit >= 0) { + ngknet_rx_rate_limit_stop(dev); + } + + /* Suspend PDMA device */ + bcmcnet_pdma_dev_suspend(pdev); + + for (gi = 0; gi < pdev->num_groups; gi++) { + if (!pdev->ctrl.grp[gi].attached) { + continue; + } + bm_queue = pdev->ctrl.grp[gi].bm_rxq | pdev->ctrl.grp[gi].bm_txq; + for (qi = 0; qi < pdev->grp_queues; qi++) { + napi = (struct napi_struct *)pdev->ctrl.grp[gi].intr_hdl[qi].priv; + if (pdev->flags & PDMA_GROUP_INTR) { + napi_disable(napi); + break; + } + if (1 << qi & bm_queue) { + napi_disable(napi); + } + } + } + + /* Stop PDMA device */ + bcmcnet_pdma_dev_stop(pdev); + + /* Unregister interrupt handler */ + ngbde_kapi_intr_disconnect(dev->dev_no, 0); + } + + return 0; +} + +/*! + * Start transmission + */ +static int +ngknet_start_xmit(struct sk_buff *skb, struct net_device *ndev) +{ + struct ngknet_private *priv = netdev_priv(ndev); + struct ngknet_dev *dev = priv->bkn_dev; + struct pdma_dev *pdev = &dev->pdma_dev; + struct sk_buff *bskb = skb; + uint32_t len = skb->len; + int queue; + int rv; + + DBG_VERB(("Tx packet from ndev%d (%d bytes).\n", priv->id, skb->len)); + if (debug & DBG_LVL_PDMP) { + ngknet_pkt_dump(skb->data, skb->len); + } + + /* Do not transmit on base device */ + if (priv->id <= 0) { + priv->stats.tx_dropped++; + dev_kfree_skb_any(skb); + return NETDEV_TX_OK; + } + + /* Measure speed */ + if (debug & DBG_LVL_RATE) { + ngknet_pkt_stats(pdev, PDMA_Q_TX); + } + + queue = skb->queue_mapping; + + /* Handle one outgoing packet */ + rv = ngknet_tx_frame_process(ndev, &skb); + if (SHR_FAILURE(rv)) { + priv->stats.tx_dropped++; + if (skb) { + dev_kfree_skb_any(skb); + } + return NETDEV_TX_OK; + } + + /* Schedule Tx queue */ + ngknet_tx_queue_schedule(dev, skb, &queue); + skb->queue_mapping = queue; + + DBG_VERB(("Tx packet (%d bytes).\n", skb->len)); + if (debug & DBG_LVL_PDMP) { + ngknet_pkt_dump(skb->data, skb->len); + } + + /* Do Tx timestamping */ + if (skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP) { + ngknet_ptp_tx_config(ndev, skb); + } + + skb_tx_timestamp(skb); + + rv = pdev->pkt_xmit(pdev, queue, skb); + + if (rv == SHR_E_UNAVAIL) { + DBG_WARN(("Tx drop: DMA device not ready\n")); + priv->stats.tx_dropped++; + if (skb != bskb) { + dev_kfree_skb_any(skb); + } + dev_kfree_skb_any(bskb); + return NETDEV_TX_OK; + } + + if (rv == SHR_E_BUSY) { + DBG_WARN(("Tx suspend: No DMA resources\n")); + priv->stats.tx_fifo_errors++; + if (skb != bskb) { + dev_kfree_skb_any(skb); + } + return NETDEV_TX_BUSY; + } else { + if (skb != bskb) { + dev_kfree_skb_any(bskb); + } + } + + /* Update accounting */ + priv->stats.tx_packets++; + priv->stats.tx_bytes += len; + + return NETDEV_TX_OK; +} + +/*! + * Get network device stats + */ +static struct net_device_stats * +ngknet_get_stats(struct net_device *ndev) +{ + struct ngknet_private *priv = netdev_priv(ndev); + + return &priv->stats; +} + +/*! + * Set network device MC list + */ +static void +ngknet_set_multicast_list(struct net_device *ndev) +{ + return; +} + +/*! + * Set network device MAC address + */ +static int +ngknet_set_mac_address(struct net_device *ndev, void *addr) +{ + if (!is_valid_ether_addr(((struct sockaddr *)addr)->sa_data)) { + return -EINVAL; + } + + netdev_info(ndev, "Setting new MAC address\n"); + memcpy(ndev->dev_addr, ((struct sockaddr *)addr)->sa_data, ndev->addr_len); + + return 0; +} + +/*! + * Change network device MTU + */ +static int +ngknet_change_mtu(struct net_device *ndev, int new_mtu) +{ + int frame_size = new_mtu + ETH_HLEN + VLAN_HLEN + ETH_FCS_LEN; + + if (frame_size < 68 || frame_size > rx_buffer_size) { + return -EINVAL; + } + + netdev_info(ndev, "Changing MTU from %d to %d\n", ndev->mtu, new_mtu); + ndev->mtu = new_mtu; + + return 0; +} + +/*! + * Do I/O control + */ +static int +ngknet_do_ioctl(struct net_device *ndev, struct ifreq *ifr, int cmd) +{ + struct ngknet_private *priv = netdev_priv(ndev); + struct hwtstamp_config config; + int rv; + + if (cmd == SIOCSHWTSTAMP) { + if (copy_from_user(&config, ifr->ifr_data, sizeof(config))) { + return -EFAULT; + } + + if (priv->type != NGKNET_NETIF_T_PORT) { + return -ENOSYS; + } + + switch (config.tx_type) { + case HWTSTAMP_TX_OFF: + priv->hwts_tx_type = HWTSTAMP_TX_OFF; + rv = ngknet_ptp_tx_config_set(ndev, priv->hwts_tx_type); + if (SHR_FAILURE(rv)) { + return -ENOSYS; + } + break; + case HWTSTAMP_TX_ON: + priv->hwts_tx_type = HWTSTAMP_TX_ON; + rv = ngknet_ptp_tx_config_set(ndev, priv->hwts_tx_type); + if (SHR_FAILURE(rv)) { + return -ENOSYS; + } + break; + case HWTSTAMP_TX_ONESTEP_SYNC: + priv->hwts_tx_type = HWTSTAMP_TX_ONESTEP_SYNC; + rv = ngknet_ptp_tx_config_set(ndev, priv->hwts_tx_type); + if (SHR_FAILURE(rv)) { + return -ENOSYS; + } + break; + default: + return -ERANGE; + } + + switch (config.rx_filter) { + case HWTSTAMP_FILTER_NONE: + rv = ngknet_ptp_rx_config_set(ndev, &config.rx_filter); + if (SHR_FAILURE(rv)) { + return -ENOSYS; + } + priv->hwts_rx_filter = HWTSTAMP_FILTER_NONE; + break; + default: + rv = ngknet_ptp_rx_config_set(ndev, &config.rx_filter); + if (SHR_FAILURE(rv)) { + return -ENOSYS; + } + priv->hwts_rx_filter = config.rx_filter; + break; + } + + return copy_to_user(ifr->ifr_data, &config, sizeof(config)) ? -EFAULT : 0; + } + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) + if (cmd == SIOCGHWTSTAMP) { + config.flags = 0; + config.tx_type = priv->hwts_tx_type; + config.rx_filter = priv->hwts_rx_filter; + + return copy_to_user(ifr->ifr_data, &config, sizeof(config)) ? -EFAULT : 0; + } +#endif + + return -EINVAL; +} + +#ifdef CONFIG_NET_POLL_CONTROLLER +/*! + * Poll network device + */ +static void +ngknet_poll_controller(struct net_device *ndev) +{ + struct ngknet_private *priv = netdev_priv(ndev); + + disable_irq(ndev->irq); + ngknet_isr(priv->bkn_dev); + enable_irq(ndev->irq); +} +#endif + +static const struct net_device_ops ngknet_netdev_ops = { + .ndo_open = ngknet_enet_open, + .ndo_stop = ngknet_enet_stop, + .ndo_start_xmit = ngknet_start_xmit, + .ndo_get_stats = ngknet_get_stats, + .ndo_validate_addr = eth_validate_addr, + .ndo_set_rx_mode = ngknet_set_multicast_list, + .ndo_set_mac_address = ngknet_set_mac_address, + .ndo_change_mtu = ngknet_change_mtu, + .ndo_set_features = NULL, + .ndo_do_ioctl = ngknet_do_ioctl, + .ndo_tx_timeout = NULL, +#ifdef CONFIG_NET_POLL_CONTROLLER + .ndo_poll_controller = ngknet_poll_controller, +#endif +}; + +static void +ngknet_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *drvinfo) +{ + strlcpy(drvinfo->driver, "linux_ngknet", sizeof(drvinfo->driver)); + snprintf(drvinfo->version, sizeof(drvinfo->version), "%d", NGKNET_IOC_VERSION); + strlcpy(drvinfo->fw_version, "N/A", sizeof(drvinfo->fw_version)); + strlcpy(drvinfo->bus_info, "N/A", sizeof(drvinfo->bus_info)); +} + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) +static int +ngknet_get_ts_info(struct net_device *ndev, struct ethtool_ts_info *info) +{ + int rv; + + info->so_timestamping = SOF_TIMESTAMPING_TX_HARDWARE | + SOF_TIMESTAMPING_TX_SOFTWARE | + SOF_TIMESTAMPING_RX_HARDWARE | + SOF_TIMESTAMPING_RX_SOFTWARE | + SOF_TIMESTAMPING_SOFTWARE | + SOF_TIMESTAMPING_RAW_HARDWARE; + info->tx_types = 1 << HWTSTAMP_TX_OFF | 1 << HWTSTAMP_TX_ON | 1 << HWTSTAMP_TX_ONESTEP_SYNC; + info->rx_filters = 1 << HWTSTAMP_FILTER_NONE | 1 << HWTSTAMP_FILTER_ALL; + rv = ngknet_ptp_phc_index_get(ndev, &info->phc_index); + if (SHR_FAILURE(rv)) { + info->phc_index = -1; + } + + return 0; +} +#endif + +static const struct ethtool_ops ngknet_ethtool_ops = { + .get_drvinfo = ngknet_get_drvinfo, +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) + .get_ts_info = ngknet_get_ts_info, +#endif +}; + +/*! + * \brief Initialize network device. + * + * \param [in] name Network device name. + * \param [in] mac Network device MAC address. + * \param [out] nd New registered network device. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +static int +ngknet_ndev_init(ngknet_netif_t *netif, struct net_device **nd) +{ + struct net_device *ndev = NULL; + uint8_t *ma; + int rv; + + if (!netif) { + DBG_WARN(("Network interface is NULL.\n")); + return SHR_E_PARAM; + } + if (!nd) { + DBG_WARN(("Network device is NULL.\n")); + return SHR_E_PARAM; + } + + ndev = alloc_etherdev_mq(sizeof(struct ngknet_private), NUM_QUE_MAX); + if (!ndev) { + DBG_WARN(("Error allocating network device.\n")); + return SHR_E_MEMORY; + } + if (!ndev->dev_addr) { + DBG_WARN(("ndev->dev_addr is NULL\n")); + free_netdev(ndev); + return SHR_E_INTERNAL; + } + + /* Device information -- not available right now */ + ndev->irq = 0; + ndev->base_addr = 0; + + /* Fill in the dev structure */ + ndev->watchdog_timeo = 5 * HZ; + + /* Default MTU should not exceed MTU of switch front-panel ports */ + ndev->mtu = netif->mtu; + if (!ndev->mtu) { + ndev->mtu = default_mtu ? default_mtu : rx_buffer_size; + } + + ndev->netdev_ops = &ngknet_netdev_ops; + ndev->ethtool_ops = &ngknet_ethtool_ops; + + /* Network device name */ + if (netif->name && *netif->name) { + strncpy(ndev->name, netif->name, IFNAMSIZ - 1); + } + + /* Set the device MAC address */ + ma = netif->macaddr; + if ((ma[0] | ma[1] | ma[2] | ma[3] | ma[4] | ma[5]) == 0) { + ngknet_dev_mac[5]++; + ma = ngknet_dev_mac; + } + memcpy(ndev->dev_addr, ma, ETH_ALEN); + + /* Initialize the device features */ + ndev->hw_features = NETIF_F_SG | NETIF_F_RXCSUM | + NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_HW_VLAN_CTAG_TX; + ndev->features |= NETIF_F_HIGHDMA | NETIF_F_HW_VLAN_CTAG_RX; + + /* Register the kernel network device */ + rv = register_netdev(ndev); + if (rv < 0) { + DBG_WARN(("Error registering network device %s.\n", ndev->name)); + free_netdev(ndev); + return SHR_E_FAIL; + } + + *nd = ndev; + + DBG_VERB(("Created network device %s.\n", ndev->name)); + + return SHR_E_NONE; +} + +/*! + * \brief Initialize Packet DMA device. + * + * \param [in] dev NGKNET device structure point. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +static int +ngknet_pdev_init(struct ngknet_dev *dev) +{ + struct pdma_dev *pdev = &dev->pdma_dev; + int rv; + + /* Initialize PDMA control structure */ + pdev->unit = dev->dev_no; + pdev->priv = dev; + pdev->ctrl.dev = pdev; + pdev->ctrl.hw_addr = dev->base_addr; + pdev->ctrl.rx_buf_size = rx_buffer_size; + + /* Hook callbacks */ + pdev->dev_read32 = ngknet_dev_read32; + pdev->dev_write32 = ngknet_dev_write32; + pdev->pkt_recv = ngknet_frame_recv; + pdev->tx_suspend = ngknet_tx_suspend; + pdev->tx_resume = ngknet_tx_resume; + pdev->intr_unmask = ngknet_intr_enable; + pdev->intr_mask = ngknet_intr_disable; + pdev->xnet_wait = ngknet_dev_hnet_wait; + pdev->xnet_wake = ngknet_dev_vnet_wake; + pdev->sys_p2v = ngknet_sys_p2v; + pdev->sys_v2p = ngknet_sys_v2p; + + pdev->flags |= PDMA_GROUP_INTR; + if (tx_polling) { + pdev->flags |= PDMA_TX_POLLING; + } + if (rx_batching || pdev->mode == DEV_MODE_HNET) { + pdev->flags |= PDMA_RX_BATCHING; + } + + /* Attach PDMA driver */ + rv = drv_ops[pdev->dev_type]->drv_attach(pdev); + if (SHR_FAILURE(rv)) { + DBG_WARN(("Attach DMA driver failed.\n")); + return rv; + } + + /* Initialize PDMA device */ + rv = bcmcnet_pdma_dev_init(pdev); + if (SHR_FAILURE(rv)) { + DBG_WARN(("Init DMA device.failed.\n")); + return rv; + } + + DBG_VERB(("Attached DMA device %s.\n", pdev->name)); + + return SHR_E_NONE; +} + +/*! + * \brief Get device information from BDE. + * + * \param [in] dn Device number. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +static int +ngknet_dev_info_get(int dn) +{ + struct ngknet_dev *dev = &ngknet_devices[dn]; + + dev->base_addr = ngbde_kapi_pio_membase(dn); + dev->dev = ngbde_kapi_dma_dev_get(dn); + + if (!dev->base_addr || !dev->dev) { + return SHR_E_ACCESS; + } + + dev->dev_no = dn; + + return SHR_E_NONE; +} + +/*! + * \brief Probe device. + * + * Get the information from BDE, initialize Packet DMA device, + * initialize base network device and allocate other resources. + * + * \param [in] dn Device number. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +static int +ngknet_dev_probe(int dn, ngknet_netif_t *netif) +{ + struct ngknet_dev *dev = &ngknet_devices[dn]; + struct pdma_dev *pdev = &dev->pdma_dev; + struct net_device *ndev = NULL; + struct ngknet_private *priv = NULL; + struct intr_handle *hdl = NULL; + struct cpumask mask; + int gi, qi; + int rv; + + DBG_VERB(("%s: dev %d\n",__FUNCTION__, dn)); + + /* Get device information */ + rv = ngknet_dev_info_get(dn); + if (SHR_FAILURE(rv)) { + return rv; + } + + /* Initialize PDMA device */ + rv = ngknet_pdev_init(dev); + if (SHR_FAILURE(rv)) { + return rv; + } + + /* Get base network device name */ + if (netif->name[0] == '\0') { + /* Reserve 6 vacancies for base&vitual device number, i.e. nameAB_XYZ */ + if (strlen(base_dev_name) < IFNAMSIZ - 6) { + snprintf(netif->name, IFNAMSIZ, "%s%d", base_dev_name, dn); + } else { + DBG_WARN(("Too long network device name: %s.\n", base_dev_name)); + return SHR_E_PARAM; + } + } + + rv = ngknet_ndev_init(netif, &ndev); + if (SHR_FAILURE(rv)) { + bcmcnet_pdma_dev_cleanup(pdev); + return rv; + } + dev->net_dev = ndev; + + /* Initialize private information for base network device */ + priv = netdev_priv(ndev); + priv->net_dev = ndev; + priv->bkn_dev = dev; + priv->id = 0; + priv->type = netif->type; + if (priv->type == NGKNET_NETIF_T_PORT) { + priv->meta_off = netif->meta_off; + priv->meta_len = netif->meta_len; + memcpy(priv->meta_data, netif->meta_data, priv->meta_len); + } + priv->flags = netif->flags; + priv->vlan = netif->vlan; + priv->chan = netif->chan; + memcpy(priv->user_data, netif->user_data, sizeof(priv->user_data)); + + netif->id = priv->id; + memcpy(netif->macaddr, ndev->dev_addr, ETH_ALEN); + netif->mtu = ndev->mtu; + memcpy(netif->name, ndev->name, sizeof(netif->name) - 1); + + if (priv->flags & NGKNET_NETIF_F_BIND_CHAN) { + dev->bdev[priv->chan] = ndev; + } + + /* Register for napi */ + for (gi = 0; gi < pdev->num_groups; gi++) { + if (!pdev->ctrl.grp[gi].attached) { + continue; + } + for (qi = 0; qi < pdev->grp_queues; qi++) { + hdl = &pdev->ctrl.grp[gi].intr_hdl[qi]; + priv_hdl[hdl->unit][hdl->chan].hdl = hdl; + hdl->priv = &priv_hdl[hdl->unit][hdl->chan]; + netif_napi_add(ndev, (struct napi_struct *)hdl->priv, + ngknet_poll, pdev->ctrl.budget); + if (pdev->flags & PDMA_GROUP_INTR) { + break; + } + } + } + + /* Get callback control */ + ngknet_callback_control_get(&dev->cbc); + + INIT_LIST_HEAD(&dev->filt_list); + spin_lock_init(&dev->lock); + init_waitqueue_head(&dev->wq); + if (pdev->mode == DEV_MODE_HNET) { + init_waitqueue_head(&dev->vnet_wq); + atomic_set(&dev->vnet_active, 0); + init_waitqueue_head(&dev->hnet_wq); + atomic_set(&dev->hnet_active, 0); + dev->hnet_task = kthread_run(ngknet_dev_hnet_process, pdev, pdev->name); + if (IS_ERR(dev->hnet_task)) { + dev->hnet_task = NULL; + return SHR_E_INTERNAL; + } + cpumask_clear(&mask); + cpumask_set_cpu(1, &mask); + set_cpus_allowed_ptr(dev->hnet_task, &mask); + INIT_WORK(&dev->hnet_work, ngknet_dev_hnet_schedule); + } + + skb_queue_head_init(&dev->ptp_tx_queue); + INIT_WORK(&dev->ptp_tx_work, ngknet_ptp_tx_work); + + dev->flags |= NGKNET_DEV_ACTIVE; + + DBG_NDEV(("Broadcom NGKNET Attached\n")); + DBG_NDEV(("MAC: %pM\n", ndev->dev_addr)); + DBG_NDEV(("Running with NAPI enabled\n")); + + return SHR_E_NONE; +} + +/*! + * \brief Remove device. + * + * Suspend device firstly, destroy all virtual network devices + * and filters, clean up Packet DMA device. + * + * \param [in] dn Device number. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +static int +ngknet_dev_remove(int dn) +{ + struct ngknet_dev *dev = &ngknet_devices[dn]; + struct pdma_dev *pdev = &dev->pdma_dev; + struct net_device *ndev = NULL; + struct intr_handle *hdl = NULL; + int di, gi, qi; + int rv; + + if (!(dev->flags & NGKNET_DEV_ACTIVE)) { + return SHR_E_NONE; + } + + DBG_VERB(("%s: dev %d\n",__FUNCTION__, dn)); + + dev->flags &= ~NGKNET_DEV_ACTIVE; + + skb_queue_purge(&dev->ptp_tx_queue); + + if (pdev->mode == DEV_MODE_HNET && dev->hnet_task) { + atomic_set(&dev->hnet_active, 1); + wake_up_interruptible(&dev->hnet_wq); + kthread_stop(dev->hnet_task); + dev->hnet_task = NULL; + } + + /* Destroy all the filters */ + ngknet_filter_destroy_all(dev); + + /* Destroy all the virtual devices */ + for (di = 1; di <= NUM_VDEV_MAX; di++) { + ndev = dev->vdev[di]; + if (ndev) { + netif_carrier_off(ndev); + unregister_netdev(ndev); + free_netdev(ndev); + dev->vdev[di] = NULL; + } + } + dev->vdev[0] = NULL; + + DBG_VERB(("Removing base network device %s.\n", dev->net_dev->name)); + + /* Destroy the base network device */ + ndev = dev->net_dev; + unregister_netdev(ndev); + free_netdev(ndev); + + for (qi = 0; qi < NUM_QUE_MAX; qi++) { + dev->bdev[qi] = NULL; + } + + for (gi = 0; gi < pdev->num_groups; gi++) { + if (!pdev->ctrl.grp[gi].attached) { + continue; + } + for (qi = 0; qi < pdev->grp_queues; qi++) { + hdl = &pdev->ctrl.grp[gi].intr_hdl[qi]; + netif_napi_del((struct napi_struct *)hdl->priv); + priv_hdl[hdl->unit][hdl->chan].hdl = NULL; + if (pdev->flags & PDMA_GROUP_INTR) { + break; + } + } + } + + /* Clean up PDMA device */ + bcmcnet_pdma_dev_cleanup(pdev); + + /* Detach PDMA driver */ + rv = drv_ops[pdev->dev_type]->drv_detach(pdev); + if (SHR_FAILURE(rv)) { + DBG_WARN(("Detach DMA driver failed.\n")); + } + + return rv; +} + +/*! + * Network interface functions + */ + +int +ngknet_netif_create(struct ngknet_dev *dev, ngknet_netif_t *netif) +{ + struct net_device *ndev = NULL; + struct ngknet_private *priv = NULL; + unsigned long flags; + int num, id; + int rv; + + switch (netif->type) { + case NGKNET_NETIF_T_VLAN: + case NGKNET_NETIF_T_PORT: + case NGKNET_NETIF_T_META: + break; + default: + return SHR_E_UNAVAIL; + } + + /* Get vitual network device name */ + if (netif->name[0] == '\0') { + /* Reserve 6 vacancies for base&vitual device number, i.e. nameAB_XYZ */ + if (strlen(base_dev_name) < IFNAMSIZ - 6) { + snprintf(netif->name, IFNAMSIZ, "%s%d%s", base_dev_name, dev->dev_no, "_"); + strncat(netif->name, "%d", 3); + } else { + DBG_WARN(("Too long network device name: %s.\n", base_dev_name)); + return SHR_E_PARAM; + } + } + + rv = ngknet_ndev_init(netif, &ndev); + if (SHR_FAILURE(rv)) { + return rv; + } + + spin_lock_irqsave(&dev->lock, flags); + + num = (long)dev->vdev[0]; + for (id = 1; id < num + 1; id++) { + if (!dev->vdev[id]) { + break; + } + } + if (id > NUM_VDEV_MAX) { + spin_unlock_irqrestore(&dev->lock, flags); + unregister_netdev(ndev); + free_netdev(ndev); + return SHR_E_RESOURCE; + } + + dev->vdev[id] = ndev; + num += id == (num + 1) ? 1 : 0; + dev->vdev[0] = (struct net_device *)(long)num; + + spin_unlock_irqrestore(&dev->lock, flags); + + priv = netdev_priv(ndev); + priv->net_dev = ndev; + priv->bkn_dev = dev; + priv->id = id; + priv->type = netif->type; + if (priv->type == NGKNET_NETIF_T_PORT) { + priv->meta_off = netif->meta_off; + priv->meta_len = netif->meta_len; + memcpy(priv->meta_data, netif->meta_data, priv->meta_len); + } + priv->flags = netif->flags; + priv->vlan = netif->vlan; + priv->chan = netif->chan; + memcpy(priv->user_data, netif->user_data, sizeof(priv->user_data)); + + netif->id = priv->id; + memcpy(netif->macaddr, ndev->dev_addr, ETH_ALEN); + netif->mtu = ndev->mtu; + memcpy(netif->name, ndev->name, sizeof(netif->name) - 1); + + if (priv->flags & NGKNET_NETIF_F_BIND_CHAN) { + dev->bdev[priv->chan] = ndev; + } + + /* Optional netif create callback handle */ + if (dev->cbc->netif_create_cb) { + rv = dev->cbc->netif_create_cb(ndev); + if (rv) { + DBG_WARN(("Netif create callback failed with rv %d for '%s'\n", rv, ndev->name)); + } + } + + DBG_VERB(("Created virtual network device %s (%d).\n", ndev->name, priv->id)); + + return SHR_E_NONE; +} + +int +ngknet_netif_destroy(struct ngknet_dev *dev, int id) +{ + struct net_device *ndev = NULL; + struct ngknet_private *priv = NULL; + unsigned long flags; + int num; + DECLARE_WAITQUEUE(wait, current); + + if (id <= 0 || id > NUM_VDEV_MAX) { + return SHR_E_PARAM; + } + + spin_lock_irqsave(&dev->lock, flags); + + ndev = dev->vdev[id]; + if (!ndev) { + spin_unlock_irqrestore(&dev->lock, flags); + return SHR_E_NOT_FOUND; + } + priv = netdev_priv(ndev); + + add_wait_queue(&dev->wq, &wait); + + while (priv->users) { + priv->wait = 1; + set_current_state(TASK_INTERRUPTIBLE); + spin_unlock_irqrestore(&dev->lock, flags); + schedule(); + spin_lock_irqsave(&dev->lock, flags); + priv->wait = 0; + set_current_state(TASK_RUNNING); + } + + if (priv->flags & NGKNET_NETIF_F_BIND_CHAN) { + dev->bdev[priv->chan] = NULL; + } + + dev->vdev[id] = NULL; + num = (long)dev->vdev[0]; + while (num-- == id--) { + if (dev->vdev[id]) { + dev->vdev[0] = (struct net_device *)(long)num; + break; + } + } + + spin_unlock_irqrestore(&dev->lock, flags); + + remove_wait_queue(&dev->wq, &wait); + + /* Optional netif destroy callback handle */ + if (dev->cbc->netif_destroy_cb) { + int rv = dev->cbc->netif_destroy_cb(ndev); + if (rv) { + DBG_WARN(("Netif destroy callback failed with rv %d for '%s'\n", rv, ndev->name)); + } + } + DBG_VERB(("Removing virtual network device %s (%d).\n", ndev->name, priv->id)); + + netif_carrier_off(ndev); + unregister_netdev(ndev); + free_netdev(ndev); + + return SHR_E_NONE; +} + +int +ngknet_netif_get(struct ngknet_dev *dev, int id, ngknet_netif_t *netif) +{ + struct net_device *ndev = NULL; + struct ngknet_private *priv = NULL; + unsigned long flags; + int num; + + if (id < 0 || id > NUM_VDEV_MAX) { + return SHR_E_PARAM; + } + + spin_lock_irqsave(&dev->lock, flags); + + ndev = id == 0 ? dev->net_dev : dev->vdev[id]; + if (!ndev) { + spin_unlock_irqrestore(&dev->lock, flags); + return SHR_E_NOT_FOUND; + } + + priv = netdev_priv(ndev); + netif->id = priv->id; + netif->type = priv->type; + netif->flags = priv->flags; + netif->vlan = priv->vlan; + memcpy(netif->macaddr, priv->net_dev->dev_addr, ETH_ALEN); + netif->mtu = priv->net_dev->mtu; + netif->chan = priv->chan; + memcpy(netif->name, priv->net_dev->name, sizeof(netif->name) - 1); + netif->meta_off = priv->meta_off; + netif->meta_len = priv->meta_len; + memcpy(netif->meta_data, priv->meta_data, netif->meta_len); + memcpy(netif->user_data, priv->user_data, sizeof(netif->user_data)); + + num = (long)dev->vdev[0]; + for (id++; id < num + 1; id++) { + if (dev->vdev[id]) { + break; + } + } + netif->next = id == (num + 1) ? 0 : id; + + spin_unlock_irqrestore(&dev->lock, flags); + + DBG_VERB(("Got virtual network device %s (%d).\n", ndev->name, priv->id)); + + return SHR_E_NONE; +} + +int +ngknet_netif_get_next(struct ngknet_dev *dev, ngknet_netif_t *netif) +{ + return ngknet_netif_get(dev, netif->next, netif); +} + +/*! + * System control interfaces + */ + +int +ngknet_debug_level_get(void) +{ + return debug; +} + +void +ngknet_debug_level_set(int debug_level) +{ + debug = debug_level; +} + +int +ngknet_rx_rate_limit_get(void) +{ + return rx_rate_limit; +} + +void +ngknet_rx_rate_limit_set(int rate_limit) +{ + rx_rate_limit = rate_limit; +} + +/*! + * Generic module functions + */ + +static int +ngknet_open(struct inode *inode, struct file *filp) +{ + return 0; +} + +static int +ngknet_release(struct inode *inode, struct file *filp) +{ + return 0; +} + +static long +ngknet_ioctl(struct file *file, unsigned int cmd, unsigned long arg) +{ + struct ngknet_ioctl ioc; + struct ngknet_dev *dev = NULL; + struct net_device *ndev = NULL; + struct pdma_dev *pdev = NULL; + union { + ngknet_dev_cfg_t dev_cfg; + ngknet_chan_cfg_t chan_cfg; + ngknet_netif_t netif; + ngknet_filter_t filter; + } iod; + ngknet_dev_cfg_t *dev_cfg = &iod.dev_cfg; + ngknet_chan_cfg_t *chan_cfg = &iod.chan_cfg; + ngknet_netif_t *netif = &iod.netif; + ngknet_filter_t *filter = &iod.filter; + char *data = NULL; + int dt, gi, qi; + + if (_IOC_TYPE(cmd) != NGKNET_IOC_MAGIC) { + DBG_WARN(("Unsupported command (cmd=%d)\n", cmd)); + return -EINVAL; + } + + if (copy_from_user(&ioc, (void *)arg, sizeof(ioc))) { + return -EFAULT; + } + + ioc.rc = SHR_E_NONE; + + dev = &ngknet_devices[ioc.unit]; + pdev = &dev->pdma_dev; + + if (cmd != NGKNET_VERSION_GET && + cmd != NGKNET_RX_RATE_LIMIT && + cmd != NGKNET_DEV_INIT && + !(dev->flags & NGKNET_DEV_ACTIVE)) { + ioc.rc = SHR_E_UNAVAIL; + if (copy_to_user((void *)arg, &ioc, sizeof(ioc))) { + return -EFAULT; + } + return 0; + } + + switch (cmd) { + case NGKNET_VERSION_GET: + DBG_CMD(("NGKNET_VERSION_GET\n")); + ioc.op.info.version = NGKNET_IOC_VERSION; + break; + case NGKNET_RX_RATE_LIMIT: + DBG_CMD(("NGKNET_RX_RATE_LIMIT\n")); + if (ioc.iarg[0]) { + ngknet_rx_rate_limit_set(ioc.iarg[1]); + } else { + ioc.iarg[1] = ngknet_rx_rate_limit_get(); + } + break; + case NGKNET_DEV_INIT: + DBG_CMD(("NGKNET_DEV_INIT\n")); + if (dev->flags & NGKNET_DEV_ACTIVE) { + DBG_CMD(("NGKNET_DEV_INIT, retrieve device configurations.\n")); + strlcpy(dev_cfg->name, pdev->name, sizeof(dev_cfg->name)); + dev_cfg->dev_id = pdev->dev_id; + dev_cfg->nb_grp = pdev->ctrl.nb_grp; + dev_cfg->bm_grp = pdev->ctrl.bm_grp; + ioc.rc = ngknet_netif_get(dev, 0, &dev_cfg->base_netif); + if (SHR_FAILURE((int)ioc.rc)) { + break; + } + if (kal_copy_to_user((void *)(unsigned long)ioc.op.data.buf, dev_cfg, + ioc.op.data.len, sizeof(*dev_cfg))) { + return -EFAULT; + } + break; + } + if (kal_copy_from_user(dev_cfg, (void *)(unsigned long)ioc.op.data.buf, + sizeof(*dev_cfg), ioc.op.data.len)) { + return -EFAULT; + } + if (!dev_cfg->name[0] || !dev_cfg->bm_grp || + dev_cfg->bm_grp >= (1 << NUM_GRP_MAX)) { + DBG_WARN(("Invalid parameter: name=%s, bm_grp=0x%x\n", + dev_cfg->name, dev_cfg->bm_grp)); + ioc.rc = SHR_E_PARAM; + break; + } + memset(pdev, 0, sizeof(*pdev)); + strlcpy(pdev->name, dev_cfg->name, sizeof(pdev->name)); + pdev->dev_id = dev_cfg->dev_id; + for (dt = 0; dt < drv_num; dt++) { + if (!drv_ops[dt]) { + continue; + } + if (!strcasecmp(dev_cfg->type_str, drv_ops[dt]->drv_desc)) { + pdev->dev_type = dt; + break; + } + } + if (pdev->dev_type <= NGKNET_DEV_T_NONE || + pdev->dev_type >= NGKNET_DEV_T_COUNT) { + ioc.rc = SHR_E_PARAM; + break; + } + pdev->ctrl.bm_grp = dev_cfg->bm_grp; + for (gi = 0; gi < NUM_GRP_MAX; gi++) { + if (1 << gi & dev_cfg->bm_grp) { + pdev->ctrl.nb_grp++; + pdev->ctrl.grp[gi].attached = 1; + pdev->num_groups = gi + 1; + } + } + pdev->rx_ph_size = dev_cfg->rx_ph_size; + pdev->tx_ph_size = dev_cfg->tx_ph_size; + pdev->mode = dev_cfg->mode; + if (pdev->mode != DEV_MODE_KNET && pdev->mode != DEV_MODE_HNET) { + pdev->mode = DEV_MODE_KNET; + } + ioc.rc = ngknet_dev_probe(ioc.unit, &dev_cfg->base_netif); + if (SHR_FAILURE((int)ioc.rc)) { + break; + } + if (kal_copy_to_user((void *)(unsigned long)ioc.op.data.buf, dev_cfg, + ioc.op.data.len, sizeof(*dev_cfg))) { + return -EFAULT; + } + break; + case NGKNET_DEV_DEINIT: + DBG_CMD(("NGKNET_DEV_DEINIT\n")); + if (dev->flags & NGKNET_DEV_ACTIVE) { + ioc.rc = ngknet_dev_remove(ioc.unit); + } + break; + case NGKNET_QUEUE_CONFIG: + DBG_CMD(("NGKNET_QUEUE_CONFIG\n")); + if (kal_copy_from_user(chan_cfg, (void *)(unsigned long)ioc.op.data.buf, + sizeof(*chan_cfg), ioc.op.data.len)) { + return -EFAULT; + } + gi = chan_cfg->chan / pdev->grp_queues; + if (!(1 << gi & pdev->ctrl.bm_grp)) { + DBG_WARN(("Invalid parameter: chan=%d (bm_grp=0x%x)\n", + chan_cfg->chan, pdev->ctrl.bm_grp)); + ioc.rc = SHR_E_PARAM; + break; + } + if (chan_cfg->dir == PDMA_Q_RX) { + if (1 << chan_cfg->chan & pdev->ctrl.bm_txq) { + pdev->ctrl.bm_txq &= ~(1 << chan_cfg->chan); + pdev->ctrl.nb_txq--; + } + if (!(1 << chan_cfg->chan & pdev->ctrl.bm_rxq)) { + pdev->ctrl.bm_rxq |= 1 << chan_cfg->chan; + pdev->ctrl.nb_rxq++; + } + } else { + if (1 << chan_cfg->chan & pdev->ctrl.bm_rxq) { + pdev->ctrl.bm_rxq &= ~(1 << chan_cfg->chan); + pdev->ctrl.nb_rxq--; + } + if (!(1 << chan_cfg->chan & pdev->ctrl.bm_txq)) { + pdev->ctrl.bm_txq |= 1 << chan_cfg->chan; + pdev->ctrl.nb_txq++; + } + } + qi = chan_cfg->chan % pdev->grp_queues; + pdev->ctrl.grp[gi].nb_desc[qi] = chan_cfg->nb_desc; + pdev->ctrl.grp[gi].rx_size[qi] = chan_cfg->rx_buf_size; + pdev->ctrl.grp[gi].que_ctrl[qi] &= ~(PDMA_PKT_BYTE_SWAP | + PDMA_OTH_BYTE_SWAP | + PDMA_HDR_BYTE_SWAP); + if (chan_cfg->chan_ctrl & NGKNET_PKT_BYTE_SWAP) { + pdev->ctrl.grp[gi].que_ctrl[qi] |= PDMA_PKT_BYTE_SWAP; + } + if (chan_cfg->chan_ctrl & NGKNET_OTH_BYTE_SWAP) { + pdev->ctrl.grp[gi].que_ctrl[qi] |= PDMA_OTH_BYTE_SWAP; + } + if (chan_cfg->chan_ctrl & NGKNET_HDR_BYTE_SWAP) { + pdev->ctrl.grp[gi].que_ctrl[qi] |= PDMA_HDR_BYTE_SWAP; + } + break; + case NGKNET_QUEUE_QUERY: + DBG_CMD(("NGKNET_QUEUE_QUERY\n")); + if (kal_copy_from_user(chan_cfg, (void *)(unsigned long)ioc.op.data.buf, + sizeof(*chan_cfg), ioc.op.data.len)) { + return -EFAULT; + } + if (1 << chan_cfg->chan & pdev->ctrl.bm_rxq) { + chan_cfg->dir = PDMA_Q_RX; + } else if (1 << chan_cfg->chan & pdev->ctrl.bm_txq) { + chan_cfg->dir = PDMA_Q_TX; + } else { + ioc.rc = SHR_E_UNAVAIL; + break; + } + gi = chan_cfg->chan / pdev->grp_queues; + qi = chan_cfg->chan % pdev->grp_queues; + chan_cfg->nb_desc = pdev->ctrl.grp[gi].nb_desc[qi]; + chan_cfg->chan_ctrl = pdev->ctrl.grp[gi].que_ctrl[qi]; + if (chan_cfg->dir == PDMA_Q_RX) { + chan_cfg->rx_buf_size = pdev->ctrl.grp[gi].rx_size[qi]; + } else { + chan_cfg->rx_buf_size = 0; + } + if (kal_copy_to_user((void *)(unsigned long)ioc.op.data.buf, chan_cfg, + ioc.op.data.len, sizeof(*chan_cfg))) { + return -EFAULT; + } + break; + case NGKNET_DEV_SUSPEND: + DBG_CMD(("NGKNET_DEV_SUSPEND\n")); + if (rx_rate_limit >= 0) { + ngknet_rx_rate_limit_stop(dev); + } + ioc.rc = bcmcnet_pdma_dev_suspend(pdev); + break; + case NGKNET_DEV_RESUME: + DBG_CMD(("NGKNET_DEV_RESUME\n")); + ioc.rc = bcmcnet_pdma_dev_resume(pdev); + if (rx_rate_limit >= 0) { + ngknet_rx_rate_limit_start(dev); + } + break; + case NGKNET_DEV_VNET_WAIT: + DBG_CMD(("NGKNET_DEV_VNET_WAIT\n")); + if (pdev->mode != DEV_MODE_HNET) { + ioc.rc = SHR_E_UNAVAIL; + break; + } + wait_event_interruptible(dev->vnet_wq, + atomic_read(&dev->vnet_active) != 0); + atomic_set(&dev->vnet_active, 0); + break; + case NGKNET_DEV_HNET_WAKE: + DBG_CMD(("NGKNET_DEV_HNET_WAKE\n")); + if (pdev->mode != DEV_MODE_HNET) { + ioc.rc = SHR_E_UNAVAIL; + break; + } + atomic_set(&dev->hnet_active, 1); + wake_up_interruptible(&dev->hnet_wq); + break; + case NGKNET_DEV_VNET_DOCK: + DBG_CMD(("NGKNET_DEV_VNET_DOCK\n")); + if (pdev->mode != DEV_MODE_HNET) { + ioc.rc = SHR_E_UNAVAIL; + break; + } + if (kal_copy_from_user(&pdev->ctrl.vsync, (void *)(unsigned long)ioc.op.data.buf, + sizeof(pdev->ctrl.vsync), ioc.op.data.len)) { + return -EFAULT; + } + ioc.rc = bcmcnet_pdma_dev_dock(pdev); + break; + case NGKNET_DEV_VNET_UNDOCK: + DBG_CMD(("NGKNET_DEV_VNET_UNDOCK\n")); + if (pdev->mode != DEV_MODE_HNET) { + ioc.rc = SHR_E_UNAVAIL; + break; + } + ngknet_dev_vnet_wake(pdev); + ioc.rc = bcmcnet_pdma_dev_undock(pdev); + break; + case NGKNET_RCPU_CONFIG: + DBG_CMD(("NGKNET_RCPU_CONFIG\n")); + if (kal_copy_from_user(&dev->rcpu_ctrl, (void *)(unsigned long)ioc.op.data.buf, + sizeof(dev->rcpu_ctrl), ioc.op.data.len)) { + return -EFAULT; + } + break; + case NGKNET_RCPU_GET: + DBG_CMD(("NGKNET_RCPU_GET\n")); + if (kal_copy_to_user((void *)(unsigned long)ioc.op.data.buf, &dev->rcpu_ctrl, + ioc.op.data.len, sizeof(dev->rcpu_ctrl))) { + return -EFAULT; + } + break; + case NGKNET_INFO_GET: + DBG_CMD(("NGKNET_INFO_GET\n")); + bcmcnet_pdma_dev_info_get(pdev); + if (kal_copy_to_user((void *)(unsigned long)ioc.op.data.buf, &pdev->info, + ioc.op.data.len, sizeof(pdev->info))) { + return -EFAULT; + } + break; + case NGKNET_STATS_GET: + DBG_CMD(("NGKNET_STATS_GET\n")); + bcmcnet_pdma_dev_stats_get(pdev); + if (kal_copy_to_user((void *)(unsigned long)ioc.op.data.buf, &pdev->stats, + ioc.op.data.len, sizeof(pdev->stats))) { + return -EFAULT; + } + break; + case NGKNET_STATS_RESET: + DBG_CMD(("NGKNET_STATS_RESET\n")); + bcmcnet_pdma_dev_stats_reset(pdev); + break; + case NGKNET_NETIF_CREATE: + DBG_CMD(("NGKNET_NETIF_CREATE\n")); + if (kal_copy_from_user(netif, (void *)(unsigned long)ioc.op.data.buf, + sizeof(*netif), ioc.op.data.len)) { + return -EFAULT; + } + ioc.rc = ngknet_netif_create(dev, netif); + if (SHR_FAILURE((int)ioc.rc)) { + break; + } + if (kal_copy_to_user((void *)(unsigned long)ioc.op.data.buf, netif, + ioc.op.data.len, sizeof(*netif))) { + return -EFAULT; + } + break; + case NGKNET_NETIF_DESTROY: + DBG_CMD(("NGKNET_NETIF_DESTROY\n")); + ioc.rc = ngknet_netif_destroy(dev, ioc.iarg[0]); + break; + case NGKNET_NETIF_GET: + DBG_CMD(("NGKNET_NETIF_GET\n")); + ioc.rc = ngknet_netif_get(dev, ioc.iarg[0], netif); + if (SHR_FAILURE((int)ioc.rc)) { + break; + } + if (kal_copy_to_user((void *)(unsigned long)ioc.op.data.buf, netif, + ioc.op.data.len, sizeof(*netif))) { + return -EFAULT; + } + break; + case NGKNET_NETIF_NEXT: + DBG_CMD(("NGKNET_NETIF_NEXT\n")); + if (kal_copy_from_user(netif, (void *)(unsigned long)ioc.op.data.buf, + sizeof(*netif), ioc.op.data.len)) { + return -EFAULT; + } + ioc.rc = ngknet_netif_get_next(dev, netif); + if (SHR_FAILURE((int)ioc.rc)) { + break; + } + if (kal_copy_to_user((void *)(unsigned long)ioc.op.data.buf, netif, + ioc.op.data.len, sizeof(*netif))) { + return -EFAULT; + } + break; + case NGKNET_NETIF_LINK_SET: + DBG_CMD(("NGKNET_NETIF_LINK_SET\n")); + ioc.rc = ngknet_netif_get(dev, ioc.iarg[0], netif); + if (SHR_FAILURE((int)ioc.rc)) { + break; + } + ndev = dev->vdev[netif->id]; + if (ioc.iarg[1]) { + if (!netif_carrier_ok(ndev)) { + netif_carrier_on(ndev); + netif_tx_wake_all_queues(ndev); + DBG_LINK(("%s: link up\n", netif->name)); + } + } else { + if (netif_carrier_ok(ndev)) { + netif_carrier_off(ndev); + netif_tx_stop_all_queues(ndev); + DBG_LINK(("%s: link down\n", netif->name)); + } + } + break; + case NGKNET_FILT_CREATE: + DBG_CMD(("NGKNET_FILT_CREATE\n")); + if (kal_copy_from_user(filter, (void *)(unsigned long)ioc.op.data.buf, + sizeof(*filter), ioc.op.data.len)) { + return -EFAULT; + } + ioc.rc = ngknet_filter_create(dev, filter); + if (SHR_FAILURE((int)ioc.rc)) { + break; + } + if (kal_copy_to_user((void *)(unsigned long)ioc.op.data.buf, filter, + ioc.op.data.len, sizeof(*filter))) { + return -EFAULT; + } + break; + case NGKNET_FILT_DESTROY: + DBG_CMD(("NGKNET_FILT_DESTROY\n")); + ioc.rc = ngknet_filter_destroy(dev, ioc.iarg[0]); + break; + case NGKNET_FILT_GET: + DBG_CMD(("NGKNET_FILT_GET\n")); + ioc.rc = ngknet_filter_get(dev, ioc.iarg[0], filter); + if (SHR_FAILURE((int)ioc.rc)) { + break; + } + if (kal_copy_to_user((void *)(unsigned long)ioc.op.data.buf, filter, + ioc.op.data.len, sizeof(*filter))) { + return -EFAULT; + } + break; + case NGKNET_FILT_NEXT: + DBG_CMD(("NGKNET_FILT_NEXT\n")); + if (kal_copy_from_user(filter, (void *)(unsigned long)ioc.op.data.buf, + sizeof(*filter), ioc.op.data.len)) { + return -EFAULT; + } + ioc.rc = ngknet_filter_get_next(dev, filter); + if (SHR_FAILURE((int)ioc.rc)) { + break; + } + if (kal_copy_to_user((void *)(unsigned long)ioc.op.data.buf, filter, + ioc.op.data.len, sizeof(*filter))) { + return -EFAULT; + } + break; + case NGKNET_PTP_DEV_CTRL: + DBG_CMD(("NGKNET_PTP_DEV_CTRL\n")); + if (ioc.op.data.len) { + data = kmalloc(ioc.op.data.len, GFP_ATOMIC); + if (data == NULL) { + printk("Fatal error: no memory for PTP device ioctl\n"); + return -EFAULT; + } + if (copy_from_user(data, (void *)(unsigned long)ioc.op.data.buf, + ioc.op.data.len)) { + kfree(data); + return -EFAULT; + } + } + ioc.rc = ngknet_ptp_dev_ctrl(dev, ioc.iarg[0], data, ioc.op.data.len); + if (SHR_FAILURE((int)ioc.rc)) { + if (data) { + kfree(data); + } + break; + } + if (ioc.op.data.len) { + if (copy_to_user((void *)(unsigned long)ioc.op.data.buf, data, + ioc.op.data.len)) { + kfree(data); + return -EFAULT; + } + kfree(data); + } + break; + default: + ioc.rc = SHR_E_UNAVAIL; + printk("Invalid IOCTL"); + break; + } + + if (copy_to_user((void *)arg, &ioc, sizeof(ioc))) { + return -EFAULT; + } + + return 0; +} + +static int +ngknet_mmap(struct file *filp, struct vm_area_struct *vma) +{ + return 0; +} + +static struct file_operations ngknet_fops = { + .open = ngknet_open, + .release = ngknet_release, + .unlocked_ioctl = ngknet_ioctl, + .compat_ioctl = ngknet_ioctl, + .mmap = ngknet_mmap, +}; + +static int __init +ngknet_init_module(void) +{ + int idx; + int rv; + + rv = register_chrdev(NGKNET_MODULE_MAJOR, NGKNET_MODULE_NAME, &ngknet_fops); + if (rv < 0) { + printk(KERN_WARNING "%s: can't get major %d\n", + NGKNET_MODULE_NAME, NGKNET_MODULE_MAJOR); + return rv; + } + + /* Randomize lower 3 bytes of the MAC address (TESTING ONLY) */ + get_random_bytes(&ngknet_dev_mac[3], 3); + + /* Check for user-supplied MAC address (recommended) */ + if (mac_addr != NULL && strlen(mac_addr) == 17) { + for (idx = 0; idx < 6; idx++) { + ngknet_dev_mac[idx] = simple_strtoul(&mac_addr[idx * 3], NULL, 16); + } + /* Do not allow multicast address */ + ngknet_dev_mac[0] &= ~0x01; + } + + /* Initialize procfs */ + ngknet_procfs_init(); + + /* Initialize Rx rate limit */ + ngknet_rx_rate_limit_init(ngknet_devices); + + return 0; +} + +static void __exit +ngknet_exit_module(void) +{ + int idx; + + /* Cleanup Rx rate limit */ + ngknet_rx_rate_limit_cleanup(); + + /* Cleanup procfs */ + ngknet_procfs_cleanup(); + + /* Remove all the devices */ + for (idx = 0; idx < NUM_PDMA_DEV_MAX; idx++) { + ngknet_dev_remove(idx); + } + + unregister_chrdev(NGKNET_MODULE_MAJOR, NGKNET_MODULE_NAME); +} + +module_init(ngknet_init_module); +module_exit(ngknet_exit_module); + diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_main.h b/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_main.h new file mode 100644 index 000000000000..fb38f1b9abc3 --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_main.h @@ -0,0 +1,278 @@ +/*! \file ngknet_main.h + * + * Data structure and macro definitions for NGKNET kernel module. + * + */ +/* + * $Copyright: Copyright 2018-2020 Broadcom. All rights reserved. + * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * A copy of the GNU General Public License version 2 (GPLv2) can + * be found in the LICENSES folder.$ + */ + +#ifndef NGKNET_MAIN_H +#define NGKNET_MAIN_H + +#include +#include +#include +#include + +/*! Maximum number of PDMA devices supported */ +#ifdef NGBDE_NUM_SWDEV_MAX +#define NUM_PDMA_DEV_MAX NGBDE_NUM_SWDEV_MAX +#else +#define NUM_PDMA_DEV_MAX 16 +#endif + +/*! + * Debug levels + */ +#define DBG_LVL_VERB 0x0001 +#define DBG_LVL_PKT 0x0002 +#define DBG_LVL_CMD 0x0004 +#define DBG_LVL_IRQ 0x0008 +#define DBG_LVL_NAPI 0x0010 +#define DBG_LVL_NDEV 0x0020 +#define DBG_LVL_FILT 0x0040 +#define DBG_LVL_RCPU 0x0080 +#define DBG_LVL_WARN 0x0100 +#define DBG_LVL_PDMP 0x0200 +#define DBG_LVL_RATE 0x0400 +#define DBG_LVL_LINK 0x0800 + +#define DBG_VERB(_s) do { if (debug & DBG_LVL_VERB) printk _s; } while (0) +#define DBG_PKT(_s) do { if (debug & DBG_LVL_PKT) printk _s; } while (0) +#define DBG_CMD(_s) do { if (debug & DBG_LVL_CMD) printk _s; } while (0) +#define DBG_IRQ(_s) do { if (debug & DBG_LVL_IRQ) printk _s; } while (0) +#define DBG_NAPI(_s) do { if (debug & DBG_LVL_NAPI) printk _s; } while (0) +#define DBG_NDEV(_s) do { if (debug & DBG_LVL_NDEV) printk _s; } while (0) +#define DBG_FILT(_s) do { if (debug & DBG_LVL_FILT) printk _s; } while (0) +#define DBG_RCPU(_s) do { if (debug & DBG_LVL_RCPU) printk _s; } while (0) +#define DBG_WARN(_s) do { if (debug & DBG_LVL_WARN) printk _s; } while (0) +#define DBG_PDMP(_s) do { if (debug & DBG_LVL_PDMP) printk _s; } while (0) +#define DBG_RATE(_s) do { if (debug & DBG_LVL_RATE) printk _s; } while (0) +#define DBG_LINK(_s) do { if (debug & DBG_LVL_LINK) printk _s; } while (0) + +/*! + * Device description + */ +struct ngknet_dev { + /*! Base address for PCI register access */ + volatile void *base_addr; + + /*! Required for DMA memory control */ + struct device *dev; + + /*! Required for PCI memory control */ + struct pci_dev *pci_dev; + + /*! Base network device */ + struct net_device *net_dev; + + /*! PDMA device */ + struct pdma_dev pdma_dev; + + /*! Device number (from BDE) */ + int dev_no; + + /*! Vitual network devices, 0 is reserved */ + struct net_device *vdev[NUM_VDEV_MAX + 1]; + + /*! Vitual network devices bound to queue */ + struct net_device *bdev[NUM_QUE_MAX]; + + /*! Filter list */ + struct list_head filt_list; + + /*! Filter control, 0 is reserved */ + void *fc[NUM_FILTER_MAX + 1]; + + /*! Callback control */ + struct ngknet_callback_ctrl *cbc; + + /*! RCPU control */ + struct ngknet_rcpu_hdr rcpu_ctrl; + + /*! NGKNET lock */ + spinlock_t lock; + + /*! NGKNET wait queue */ + wait_queue_head_t wq; + + /*! VNET wait queue */ + wait_queue_head_t vnet_wq; + + /*! VNET is active */ + atomic_t vnet_active; + + /*! HNET wait queue */ + wait_queue_head_t hnet_wq; + + /*! HNET is active */ + atomic_t hnet_active; + + /*! HNET deamon */ + struct task_struct *hnet_task; + + /*! HNET work */ + struct work_struct hnet_work; + + /*! PTP Tx queue */ + struct sk_buff_head ptp_tx_queue; + + /*! PTP Tx work */ + struct work_struct ptp_tx_work; + + /*! Flags */ + int flags; + /*! NGKNET device is active */ +#define NGKNET_DEV_ACTIVE (1 << 0) +}; + +/*! + * Network interface specific private data + */ +struct ngknet_private { + /*! Network device */ + struct net_device *net_dev; + + /*! Network stats */ + struct net_device_stats stats; + + /*! NGKNET device */ + struct ngknet_dev *bkn_dev; + + /*! Network interface ID */ + int id; + + /*! Network interface type */ + int type; + + /*! Network interface flags */ + uint32_t flags; + + /*! Network interface vlan */ + uint32_t vlan; + + /*! Network interface bound to */ + uint32_t chan; + + /*! Metadata offset from Ethernet header */ + uint32_t meta_off; + + /*! Metadata length */ + uint32_t meta_len; + + /*! Metadata used to send packets to physical port */ + uint8_t meta_data[NGKNET_NETIF_META_MAX]; + + /*! User data gotten back through callbacks */ + uint8_t user_data[NGKNET_NETIF_USER_DATA]; + + /*! Users of this network interface */ + int users; + + /*! Wait for this network interface free */ + int wait; + + /*! HW timestamp Rx filter */ + int hwts_rx_filter; + + /*! HW timestamp Tx type */ + int hwts_tx_type; +}; + +/*! + * \brief Create network interface. + * + * \param [in] dev NGKNET device structure point. + * \param [in] netif Network interface structure point. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +ngknet_netif_create(struct ngknet_dev *dev, ngknet_netif_t *netif); + +/*! + * \brief Destroy network interface. + * + * \param [in] dev NGKNET device structure point. + * \param [in] id Network interface ID. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +ngknet_netif_destroy(struct ngknet_dev *dev, int id); + +/*! + * \brief Get network interface. + * + * \param [in] dev NGKNET device structure point. + * \param [in] id Network interface ID. + * \param [out] netif Network interface structure point. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +ngknet_netif_get(struct ngknet_dev *dev, int id, ngknet_netif_t *netif); + +/*! + * \brief Get the next network interface. + * + * \param [in] dev NGKNET device structure point. + * \param [out] netif Network interface structure point. + * + * \retval SHR_E_NONE No errors. + * \retval SHR_E_XXXX Operation failed. + */ +extern int +ngknet_netif_get_next(struct ngknet_dev *dev, ngknet_netif_t *netif); + +/*! + * \brief Get debug level. + * + * \retval Current debug level. + */ +extern int +ngknet_debug_level_get(void); + +/*! + * \brief Set debug level. + * + * \param [in] debug_level Debug level to be set. + */ +extern void +ngknet_debug_level_set(int debug_level); + +/*! + * \brief Get Rx rate limit. + * + * \retval Current Rx rate limit. + */ +extern int +ngknet_rx_rate_limit_get(void); + +/*! + * \brief Set Rx rate limit. + * + * \param [in] rate_limit Rx rate limit to be set. + */ +extern void +ngknet_rx_rate_limit_set(int rate_limit); + +#endif /* NGKNET_MAIN_H */ + diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_procfs.c b/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_procfs.c new file mode 100644 index 000000000000..85edaa26abb9 --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_procfs.c @@ -0,0 +1,655 @@ +/*! \file ngknet_procfs.c + * + * + * + */ +/* + * $Copyright: Copyright 2018-2020 Broadcom. All rights reserved. + * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * A copy of the GNU General Public License version 2 (GPLv2) can + * be found in the LICENSES folder.$ + */ + +#include +#include +#include "ngknet_main.h" +#include "ngknet_extra.h" + +extern struct ngknet_dev ngknet_devices[]; + +static struct proc_dir_entry *proc_root = NULL; + +static void +proc_data_show(struct seq_file *m, const unsigned char *buf, size_t len) +{ + uint32_t i; + + if (!buf || !len) { + seq_printf(m, "\n"); + return; + } + + for (i = 0; i < len; i++) { + seq_printf(m, "%02x ", buf[i]); + if ((i + 1) % 32 == 0 || (i + 1) == len) { + seq_printf(m, "\n"); + if ((i + 1) < len) { + seq_printf(m, " "); + } + } + } +} + +static int +proc_debug_level_show(struct seq_file *m, void *v) +{ + seq_printf(m, "Debug level: 0x%x\n", ngknet_debug_level_get()); + + return 0; +} + +static int +proc_debug_level_open(struct inode *inode, struct file *file) +{ + return single_open(file, proc_debug_level_show, NULL); +} + +static ssize_t +proc_debug_level_write(struct file *file, const char *buf, + size_t count, loff_t *loff) +{ + char level_str[11] = {0}; + int debug_level; + + if (copy_from_user(level_str, buf, sizeof(level_str) - 1)) { + return -EFAULT; + } + debug_level = simple_strtol(level_str, NULL, 16); + + ngknet_debug_level_set(debug_level); + printk("Debug level set to: 0x%x\n", debug_level); + + return count; +} + +static int +proc_debug_level_release(struct inode *inode, struct file *file) +{ + return single_release(inode, file); +} + +static struct file_operations proc_debug_level_fops = { + owner: THIS_MODULE, + open: proc_debug_level_open, + read: seq_read, + write: proc_debug_level_write, + llseek: seq_lseek, + release: proc_debug_level_release, +}; + +static int +proc_device_info_show(struct seq_file *m, void *v) +{ + struct ngknet_dev *dev; + struct bcmcnet_dev_info *info; + int di, qi, ai = 0; + int rv; + + for (di = 0; di < NUM_PDMA_DEV_MAX; di++) { + dev = &ngknet_devices[di]; + if (!(dev->flags & NGKNET_DEV_ACTIVE)) { + continue; + } + ai++; + + rv = bcmcnet_pdma_dev_info_get(&dev->pdma_dev); + if (SHR_FAILURE(rv)) { + printk("ngknet: get device%d info failed\n", di); + break; + } + + info = &dev->pdma_dev.info; + seq_printf(m, "dev_no: %d\n", di); + seq_printf(m, "dev_name: %s\n", info->dev_name); + seq_printf(m, "dev_id: 0x%x\n", info->dev_id); + seq_printf(m, "dev_type: %d\n", info->dev_type); + seq_printf(m, "max_groups: %d\n", info->max_groups); + seq_printf(m, "max_queues: %d\n", info->max_queues); + seq_printf(m, "bm_groups: 0x%x\n", info->bm_groups); + seq_printf(m, "bm_rx_queues: 0x%x\n", info->bm_rx_queues); + seq_printf(m, "bm_tx_queues: 0x%x\n", info->bm_tx_queues); + seq_printf(m, "nb_groups: %d\n", info->nb_groups); + seq_printf(m, "nb_rx_queues: %d\n", info->nb_rx_queues); + seq_printf(m, "nb_tx_queues: %d\n", info->nb_tx_queues); + seq_printf(m, "rx_desc_size: %d\n", info->rx_desc_size); + seq_printf(m, "tx_desc_size: %d\n", info->tx_desc_size); + seq_printf(m, "rx_ph_size: %d\n", info->rx_ph_size); + seq_printf(m, "tx_ph_size: %d\n", info->tx_ph_size); + for (qi = 0; qi < info->nb_rx_queues; qi++) { + seq_printf(m, "rx_buf_sz[%d]: %d\n", qi, info->rx_buf_size[qi]); + } + for (qi = 0; qi < info->nb_rx_queues; qi++) { + seq_printf(m, "nb_rx_desc[%d]: %d\n", qi, info->nb_rx_desc[qi]); + } + for (qi = 0; qi < info->nb_tx_queues; qi++) { + seq_printf(m, "nb_tx_desc[%d]: %d\n", qi, info->nb_tx_desc[qi]); + } + } + + if (!ai) { + seq_printf(m, "%s\n", "No active device"); + } else { + seq_printf(m, "------------------------\n"); + seq_printf(m, "Total %d devices\n", ai); + } + + return 0; +} + +static int +proc_device_info_open(struct inode *inode, struct file *file) +{ + return single_open(file, proc_device_info_show, NULL); +} + +static int +proc_device_info_release(struct inode *inode, struct file *file) +{ + return single_release(inode, file); +} + +static struct file_operations proc_device_info_fops = { + owner: THIS_MODULE, + open: proc_device_info_open, + read: seq_read, + llseek: seq_lseek, + release: proc_device_info_release, +}; + +static int +proc_filter_info_show(struct seq_file *m, void *v) +{ + struct ngknet_dev *dev; + ngknet_filter_t filt = {0}; + int di, dn = 0, fn = 0; + int rv; + + for (di = 0; di < NUM_PDMA_DEV_MAX; di++) { + dev = &ngknet_devices[di]; + if (!(dev->flags & NGKNET_DEV_ACTIVE)) { + continue; + } + dn++; + + do { + rv = ngknet_filter_get_next(dev, &filt); + if (SHR_FAILURE(rv)) { + printk("ngknet: get device%d filter failed\n", di); + break; + } + fn++; + + seq_printf(m, "\n"); + seq_printf(m, "dev_no: %d\n", di); + seq_printf(m, "id: %d\n", filt.id); + seq_printf(m, "next: %d\n", filt.next); + seq_printf(m, "type: %d\n", filt.type); + seq_printf(m, "flags: 0x%x\n", filt.flags); + seq_printf(m, "prio: %d\n", filt.priority); + seq_printf(m, "chan: %d\n", filt.chan); + seq_printf(m, "desc: %s\n", filt.desc); + seq_printf(m, "dest_type: %d\n", filt.dest_type); + seq_printf(m, "dest_id: %d\n", filt.dest_id); + seq_printf(m, "dest_proto: 0x%x\n", filt.dest_proto); + seq_printf(m, "mirror_type: %d\n", filt.mirror_type); + seq_printf(m, "mirror_id: %d\n", filt.mirror_id); + seq_printf(m, "mirror_proto: 0x%x\n", filt.mirror_proto); + seq_printf(m, "oob_offset: %d\n", filt.oob_data_offset); + seq_printf(m, "oob_size: %d\n", filt.oob_data_size); + seq_printf(m, "pkt_offset: %d\n", filt.pkt_data_offset); + seq_printf(m, "pkt_size: %d\n", filt.pkt_data_size); + seq_printf(m, "filt_data: "); + proc_data_show(m, filt.data.b, filt.oob_data_size + filt.pkt_data_size); + seq_printf(m, "filt_mask: "); + proc_data_show(m, filt.mask.b, filt.oob_data_size + filt.pkt_data_size); + seq_printf(m, "user_data: "); + proc_data_show(m, filt.user_data, NGKNET_FILTER_USER_DATA); + seq_printf(m, "hits: %llu\n", ((struct filt_ctrl *)dev->fc[filt.id])->hits); + } while (filt.next); + } + + if (!dn) { + seq_printf(m, "%s\n", "No active device"); + } else { + seq_printf(m, "--------------------------------\n"); + seq_printf(m, "Total %d devices, %d filters\n", dn, fn); + } + + return 0; +} + +static int +proc_filter_info_open(struct inode *inode, struct file *file) +{ + return single_open(file, proc_filter_info_show, NULL); +} + +static int +proc_filter_info_release(struct inode *inode, struct file *file) +{ + return single_release(inode, file); +} + +static struct file_operations proc_filter_info_fops = { + owner: THIS_MODULE, + open: proc_filter_info_open, + read: seq_read, + llseek: seq_lseek, + release: proc_filter_info_release, +}; + +static int +proc_netif_info_show(struct seq_file *m, void *v) +{ + struct ngknet_dev *dev; + struct net_device *ndev; + struct ngknet_private *priv; + ngknet_netif_t netif = {0}; + int di, ma, dn = 0, nn = 0; + int rv; + + for (di = 0; di < NUM_PDMA_DEV_MAX; di++) { + dev = &ngknet_devices[di]; + if (!(dev->flags & NGKNET_DEV_ACTIVE)) { + continue; + } + dn++; + + do { + rv = ngknet_netif_get_next(dev, &netif); + if (SHR_FAILURE(rv)) { + printk("ngknet: get device%d netif failed\n", di); + break; + } + nn++; + ndev = netif.id == 0 ? dev->net_dev : dev->vdev[netif.id]; + priv = netdev_priv(ndev); + + seq_printf(m, "\n"); + seq_printf(m, "dev_no: %d\n", di); + seq_printf(m, "id: %d\n", netif.id); + seq_printf(m, "next: %d\n", netif.next); + seq_printf(m, "type: %d\n", netif.type); + seq_printf(m, "flags: 0x%x\n", netif.flags); + seq_printf(m, "vlan: %d\n", netif.vlan); + seq_printf(m, "mac: "); + for (ma = 0; ma < 6; ma++) { + if (ma == 5) { + seq_printf(m, "%02x\n", netif.macaddr[ma]); + } else { + seq_printf(m, "%02x:", netif.macaddr[ma]); + } + } + seq_printf(m, "mtu: %d\n", netif.mtu); + seq_printf(m, "chan: %d\n", netif.chan); + seq_printf(m, "name: %s\n", netif.name); + seq_printf(m, "meta_off: %d\n", netif.meta_off); + seq_printf(m, "meta_len: %d\n", netif.meta_len); + seq_printf(m, "meta_data: "); + proc_data_show(m, netif.meta_data, netif.meta_len); + seq_printf(m, "user_data: "); + proc_data_show(m, netif.user_data, NGKNET_NETIF_USER_DATA); + seq_printf(m, "rx_packets: %lu\n", priv->stats.rx_packets); + seq_printf(m, "rx_bytes: %lu\n", priv->stats.rx_bytes); + seq_printf(m, "rx_dropped: %lu\n", priv->stats.rx_dropped); + seq_printf(m, "rx_errors: %lu\n", priv->stats.rx_errors); + seq_printf(m, "tx_packets: %lu\n", priv->stats.tx_packets); + seq_printf(m, "tx_bytes: %lu\n", priv->stats.tx_bytes); + seq_printf(m, "tx_dropped: %lu\n", priv->stats.tx_dropped); + seq_printf(m, "tx_errors: %lu\n", priv->stats.tx_errors); + } while (netif.next); + } + + if (!dn) { + seq_printf(m, "%s\n", "No active device"); + } else { + seq_printf(m, "--------------------------------\n"); + seq_printf(m, "Total %d devices, %d netifs\n", dn, nn); + } + + return 0; +} + +static int +proc_netif_info_open(struct inode *inode, struct file *file) +{ + return single_open(file, proc_netif_info_show, NULL); +} + +static int +proc_netif_info_release(struct inode *inode, struct file *file) +{ + return single_release(inode, file); +} + +static struct file_operations proc_netif_info_fops = { + owner: THIS_MODULE, + open: proc_netif_info_open, + read: seq_read, + llseek: seq_lseek, + release: proc_netif_info_release, +}; + +static int +proc_pkt_stats_show(struct seq_file *m, void *v) +{ + struct ngknet_dev *dev; + struct bcmcnet_dev_stats *stats; + int di, qi, ai = 0; + int rv; + + for (di = 0; di < NUM_PDMA_DEV_MAX; di++) { + dev = &ngknet_devices[di]; + if (!(dev->flags & NGKNET_DEV_ACTIVE)) { + continue; + } + ai++; + + rv = bcmcnet_pdma_dev_stats_get(&dev->pdma_dev); + if (SHR_FAILURE(rv)) { + printk("ngknet: get device%d stats failed\n", di); + break; + } + + stats = &dev->pdma_dev.stats; + seq_printf(m, "rx_packets: %llu\n", (unsigned long long)stats->rx_packets); + seq_printf(m, "rx_bytes: %llu\n", (unsigned long long)stats->rx_bytes); + for (qi = 0; qi < dev->pdma_dev.ctrl.nb_rxq; qi++) { + seq_printf(m, "rx_packets[%d]: %llu\n", qi, (unsigned long long)stats->rxq_packets[qi]); + seq_printf(m, "rx_bytes[%d]: %llu\n", qi, (unsigned long long)stats->rxq_bytes[qi]); + } + seq_printf(m, "rx_dropped: %llu\n", (unsigned long long)stats->rx_dropped); + seq_printf(m, "rx_errors: %llu\n", (unsigned long long)stats->rx_errors); + seq_printf(m, "rx_nomems: %llu\n", (unsigned long long)stats->rx_nomems); + seq_printf(m, "tx_packets: %llu\n", (unsigned long long)stats->tx_packets); + seq_printf(m, "tx_bytes: %llu\n", (unsigned long long)stats->tx_bytes); + for (qi = 0; qi < dev->pdma_dev.ctrl.nb_txq; qi++) { + seq_printf(m, "tx_packets[%d]: %llu\n", qi, (unsigned long long)stats->txq_packets[qi]); + seq_printf(m, "tx_bytes[%d]: %llu\n", qi, (unsigned long long)stats->txq_bytes[qi]); + } + seq_printf(m, "tx_dropped: %llu\n", (unsigned long long)stats->tx_dropped); + seq_printf(m, "tx_errors: %llu\n", (unsigned long long)stats->tx_errors); + seq_printf(m, "tx_xoffs: %llu\n", (unsigned long long)stats->tx_xoffs); + seq_printf(m, "interrupts: %llu\n", (unsigned long long)stats->intrs); + } + + if (!ai) { + seq_printf(m, "%s\n", "No active device"); + } else { + seq_printf(m, "------------------------\n"); + seq_printf(m, "Total %d devices\n", ai); + } + + return 0; +} + +static int +proc_pkt_stats_open(struct inode *inode, struct file *file) +{ + return single_open(file, proc_pkt_stats_show, NULL); +} + +static int +proc_pkt_stats_release(struct inode *inode, struct file *file) +{ + return single_release(inode, file); +} + +static struct file_operations proc_pkt_stats_fops = { + owner: THIS_MODULE, + open: proc_pkt_stats_open, + read: seq_read, + llseek: seq_lseek, + release: proc_pkt_stats_release, +}; + +static int +proc_rate_limit_show(struct seq_file *m, void *v) +{ + seq_printf(m, "Rx rate limit: %d pps\n", ngknet_rx_rate_limit_get()); + + return 0; +} + +static int +proc_rate_limit_open(struct inode *inode, struct file *file) +{ + return single_open(file, proc_rate_limit_show, NULL); +} + +static ssize_t +proc_rate_limit_write(struct file *file, const char *buf, + size_t count, loff_t *loff) +{ + char limit_str[9] = {0}; + int rate_limit; + + if (copy_from_user(limit_str, buf, sizeof(limit_str) - 1)) { + return -EFAULT; + } + rate_limit = simple_strtol(limit_str, NULL, 10); + + ngknet_rx_rate_limit_set(rate_limit); + printk("Rx rate limit set to: %d pps\n", rate_limit); + + return count; +} + +static int +proc_rate_limit_release(struct inode *inode, struct file *file) +{ + return single_release(inode, file); +} + +static struct file_operations proc_rate_limit_fops = { + owner: THIS_MODULE, + open: proc_rate_limit_open, + read: seq_read, + write: proc_rate_limit_write, + llseek: seq_lseek, + release: proc_rate_limit_release, +}; + +static int +proc_reg_status_show(struct seq_file *m, void *v) +{ + struct ngknet_dev *dev; + int di, qi, ai = 0; + + for (di = 0; di < NUM_PDMA_DEV_MAX; di++) { + dev = &ngknet_devices[di]; + if (!(dev->flags & NGKNET_DEV_ACTIVE)) { + continue; + } + ai++; + for (qi = 0; qi < dev->pdma_dev.ctrl.nb_rxq; qi++) { + bcmcnet_pdma_rx_queue_reg_dump(&dev->pdma_dev, qi); + } + for (qi = 0; qi < dev->pdma_dev.ctrl.nb_txq; qi++) { + bcmcnet_pdma_tx_queue_reg_dump(&dev->pdma_dev, qi); + } + } + + if (!ai) { + seq_printf(m, "%s\n", "No active device"); + } else { + seq_printf(m, "------------------------\n"); + seq_printf(m, "Total %d devices\n", ai); + } + + return 0; +} + +static int +proc_reg_status_open(struct inode *inode, struct file *file) +{ + return single_open(file, proc_reg_status_show, NULL); +} + +static int +proc_reg_status_release(struct inode *inode, struct file *file) +{ + return single_release(inode, file); +} + +static struct file_operations proc_reg_status_fops = { + owner: THIS_MODULE, + open: proc_reg_status_open, + read: seq_read, + llseek: seq_lseek, + release: proc_reg_status_release, +}; + +static int +proc_ring_status_show(struct seq_file *m, void *v) +{ + struct ngknet_dev *dev; + int di, qi, ai = 0; + + for (di = 0; di < NUM_PDMA_DEV_MAX; di++) { + dev = &ngknet_devices[di]; + if (!(dev->flags & NGKNET_DEV_ACTIVE)) { + continue; + } + ai++; + seq_printf(m, "%s-%d, ", "Unit", di); + for (qi = 0; qi < dev->pdma_dev.ctrl.nb_rxq; qi++) { + bcmcnet_pdma_rx_ring_dump(&dev->pdma_dev, qi); + } + seq_printf(m, "%s%d, ", "Rx queues: ", qi); + for (qi = 0; qi < dev->pdma_dev.ctrl.nb_txq; qi++) { + bcmcnet_pdma_tx_ring_dump(&dev->pdma_dev, qi); + } + seq_printf(m, "%s%d. ", "Tx queues: ", qi); + seq_printf(m, "\n"); + } + + if (!ai) { + seq_printf(m, "%s\n", "No active device"); + } else { + seq_printf(m, "------------------------\n"); + seq_printf(m, "Total %d devices\n", ai); + } + + return 0; +} + +static int +proc_ring_status_open(struct inode *inode, struct file *file) +{ + return single_open(file, proc_ring_status_show, NULL); +} + +static int +proc_ring_status_release(struct inode *inode, struct file *file) +{ + return single_release(inode, file); +} + +static struct file_operations proc_ring_status_fops = { + owner: THIS_MODULE, + open: proc_ring_status_open, + read: seq_read, + llseek: seq_lseek, + release: proc_ring_status_release, +}; + +int +ngknet_procfs_init(void) +{ + struct proc_dir_entry *entry = NULL; + + proc_root = proc_mkdir(NGKNET_MODULE_NAME, NULL); + if (proc_root == NULL) { + printk(KERN_ERR "ngknet: proc_mkdir failed\n"); + return -1; + } + + PROC_CREATE(entry, "debug_level", 0666, proc_root, &proc_debug_level_fops); + if (entry == NULL) { + printk(KERN_ERR "ngknet: proc_create failed\n"); + return -1; + } + + PROC_CREATE(entry, "device_info", 0444, proc_root, &proc_device_info_fops); + if (entry == NULL) { + printk(KERN_ERR "ngknet: proc_create failed\n"); + return -1; + } + + PROC_CREATE(entry, "filter_info", 0444, proc_root, &proc_filter_info_fops); + if (entry == NULL) { + printk(KERN_ERR "ngknet: proc_create failed\n"); + return -1; + } + + PROC_CREATE(entry, "netif_info", 0444, proc_root, &proc_netif_info_fops); + if (entry == NULL) { + printk(KERN_ERR "ngknet: proc_create failed\n"); + return -1; + } + + PROC_CREATE(entry, "pkt_stats", 0444, proc_root, &proc_pkt_stats_fops); + if (entry == NULL) { + printk(KERN_ERR "ngknet: proc_create failed\n"); + return -1; + } + + PROC_CREATE(entry, "rate_limit", 0666, proc_root, &proc_rate_limit_fops); + if (entry == NULL) { + printk(KERN_ERR "ngknet: proc_create failed\n"); + return -1; + } + + PROC_CREATE(entry, "reg_status", 0444, proc_root, &proc_reg_status_fops); + if (entry == NULL) { + printk(KERN_ERR "ngknet: proc_create failed\n"); + return -1; + } + + PROC_CREATE(entry, "ring_status", 0444, proc_root, &proc_ring_status_fops); + if (entry == NULL) { + printk(KERN_ERR "ngknet: proc_create failed\n"); + return -1; + } + + return 0; +} + +int +ngknet_procfs_cleanup(void) +{ + remove_proc_entry("debug_level", proc_root); + remove_proc_entry("device_info", proc_root); + remove_proc_entry("filter_info", proc_root); + remove_proc_entry("netif_info", proc_root); + remove_proc_entry("pkt_stats", proc_root); + remove_proc_entry("rate_limit", proc_root); + remove_proc_entry("reg_status", proc_root); + remove_proc_entry("ring_status", proc_root); + + remove_proc_entry(NGKNET_MODULE_NAME, NULL); + + return 0; +} + diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_procfs.h b/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_procfs.h new file mode 100644 index 000000000000..3c1938121ebb --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_procfs.h @@ -0,0 +1,47 @@ +/*! \file ngknet_procfs.h + * + * Procfs-related definitions and APIs for NGKNET module. + * + */ +/* + * $Copyright: Copyright 2018-2020 Broadcom. All rights reserved. + * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * A copy of the GNU General Public License version 2 (GPLv2) can + * be found in the LICENSES folder.$ + */ + +#ifndef NGKNET_PROCFS_H +#define NGKNET_PROCFS_H + +/*! + * \brief Initialize procfs for KNET driver. + * + * Create procfs read/write interfaces. + * + * \return 0 if no errors, otherwise -1. + */ +extern int +ngknet_procfs_init(void); + +/*! + * \brief Clean up procfs for KNET driver. + * + * Clean up resources allocated by \ref ngknet_procfs_init. + * + * \return 0 if no errors, otherwise -1. + */ +extern int +ngknet_procfs_cleanup(void); + +#endif /* NGKNET_PROCFS_H */ + diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_ptp.c b/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_ptp.c new file mode 100644 index 000000000000..13579208eab0 --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_ptp.c @@ -0,0 +1,194 @@ +/*! \file ngknet_ptp.c + * + * Utility routines for PTP. + * + */ +/* + * $Copyright: Copyright 2018-2020 Broadcom. All rights reserved. + * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * A copy of the GNU General Public License version 2 (GPLv2) can + * be found in the LICENSES folder.$ + */ + +#include "ngknet_callback.h" +#include "ngknet_ptp.h" + +int +ngknet_ptp_rx_config_set(struct net_device *ndev, int *filter) +{ + struct ngknet_private *priv = netdev_priv(ndev); + struct ngknet_dev *dev = priv->bkn_dev; + + if (!dev->cbc->ptp_rx_config_set_cb) { + return SHR_E_UNAVAIL; + } + + /* + * The expected Rx filter value is passed to the callback. The callback + * should pass back the actual filter value by the paramter . + * The callback can use priv->user_data to get other private parameters + * such as phys_port, dev_type, etc, which should be introduced when the + * netif is created. + */ + return dev->cbc->ptp_rx_config_set_cb(priv, filter); +} + +int +ngknet_ptp_tx_config_set(struct net_device *ndev, int type) +{ + struct ngknet_private *priv = netdev_priv(ndev); + struct ngknet_dev *dev = priv->bkn_dev; + + if (!dev->cbc->ptp_tx_config_set_cb) { + return SHR_E_UNAVAIL; + } + + /* + * The Tx type value is passed to the callback by the parameter . + * The callback should do the configuration according to the type. + * The callback can use priv->user_data to get other private parameters + * such as phys_port, dev_type, etc, which should be introduced when the + * netif is created. + */ + return dev->cbc->ptp_tx_config_set_cb(priv, &type); +} + +int +ngknet_ptp_rx_hwts_get(struct net_device *ndev, struct sk_buff *skb, uint64_t *ts) +{ + struct ngknet_private *priv = netdev_priv(ndev); + struct ngknet_dev *dev = priv->bkn_dev; + struct ngknet_callback_desc *cbd = NGKNET_SKB_CB(skb); + struct pkt_hdr *pkh = (struct pkt_hdr *)skb->data; + + if (!dev->cbc->ptp_rx_hwts_get_cb) { + return SHR_E_UNAVAIL; + } + + cbd->dev_no = dev->dev_no; + cbd->dev_id = dev->pdma_dev.dev_id; + cbd->priv = priv; + cbd->pmd = skb->data + PKT_HDR_SIZE; + cbd->pmd_len = pkh->meta_len; + cbd->pkt_len = pkh->data_len; + + /* + * The callback should get timestamp value for a Rx packet and return + * by the parameter . + * Some parameters have been consolidated to SKB as above. They can be + * achieved by NGKNET_SKB_CB(skb). Specially more private paramters are + * in NGKNET_SKB_CB(skb)->priv->user_data[]. + */ + return dev->cbc->ptp_rx_hwts_get_cb(skb, ts); +} + +int +ngknet_ptp_tx_hwts_get(struct net_device *ndev, struct sk_buff *skb, uint64_t *ts) +{ + struct ngknet_private *priv = netdev_priv(ndev); + struct ngknet_dev *dev = priv->bkn_dev; + struct ngknet_callback_desc *cbd = NGKNET_SKB_CB(skb); + struct pkt_hdr *pkh = (struct pkt_hdr *)skb->data; + + if (!dev->cbc->ptp_tx_hwts_get_cb) { + return SHR_E_UNAVAIL; + } + + cbd->dev_no = dev->dev_no; + cbd->dev_id = dev->pdma_dev.dev_id; + cbd->priv = priv; + cbd->pmd = skb->data + PKT_HDR_SIZE; + cbd->pmd_len = pkh->meta_len; + cbd->pkt_len = pkh->data_len; + + /* + * The callback should get timestamp value for a Tx packet and return + * by the parameter . + * For HWTSTAMP_TX_ONESTEP_SYNC type, the time value can be achieved and + * returned immediately. Otherwise, for HWTSTAMP_TX_ON type, the callback + * should wait till the time value can be available, i.e. the packet has + * been tranmitted out from port. + * Some parameters have been consolidated to SKB as above. They can be + * achieved by NGKNET_SKB_CB(skb). Specially more private paramters are + * in NGKNET_SKB_CB(skb)->priv->user_data[] such as phys_port, dev_type, + * and so on. + */ + return dev->cbc->ptp_tx_hwts_get_cb(skb, ts); +} + +int +ngknet_ptp_tx_meta_set(struct net_device *ndev, struct sk_buff *skb) +{ + struct ngknet_private *priv = netdev_priv(ndev); + struct ngknet_dev *dev = priv->bkn_dev; + struct ngknet_callback_desc *cbd = NGKNET_SKB_CB(skb); + struct pkt_hdr *pkh = (struct pkt_hdr *)skb->data; + + if (!dev->cbc->ptp_tx_meta_set_cb) { + return SHR_E_UNAVAIL; + } + + cbd->dev_no = dev->dev_no; + cbd->dev_id = dev->pdma_dev.dev_id; + cbd->priv = priv; + cbd->pmd = skb->data + PKT_HDR_SIZE; + cbd->pmd_len = pkh->meta_len; + cbd->pkt_len = pkh->data_len; + + /* + * The callback should configure the metadata pmd> + * for HW timestamping according to the corresponding switch device. + * Some parameters have been consolidated to SKB as above. They can be + * achieved by NGKNET_SKB_CB(skb). Specially more private paramters are + * in NGKNET_SKB_CB(skb)->priv->user_data[] such as phys_port, dev_type, + * and so on. + */ + return dev->cbc->ptp_tx_meta_set_cb(skb); +} + +int +ngknet_ptp_phc_index_get(struct net_device *ndev, int *index) +{ + struct ngknet_private *priv = netdev_priv(ndev); + struct ngknet_dev *dev = priv->bkn_dev; + + if (!dev->cbc->ptp_phc_index_get_cb) { + return SHR_E_UNAVAIL; + } + + /* + * The callback should return the HPC index by the parameter . + * priv->user_data[] can be used to get other private parameters such as + * phys_port, dev_type, etc, which should be introduced when the netif is + * created. + */ + return dev->cbc->ptp_phc_index_get_cb(priv, index); +} + +int +ngknet_ptp_dev_ctrl(struct ngknet_dev *dev, int cmd, char *data, int len) +{ + if (!dev->cbc->ptp_dev_ctrl_cb) { + return SHR_E_UNAVAIL; + } + + /* + * The callback is IOCTL dispatcher for PTP driver/module. + * The parameter is the command defined by the user. The parameter + * and are used for interactions between the user application + * and the driver for PTP device start/stop, enable/disable, set/get, and + * so on. + */ + return dev->cbc->ptp_dev_ctrl_cb(dev, cmd, data, len); +} + diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_ptp.h b/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_ptp.h new file mode 100644 index 000000000000..86dcb6c4904a --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/linux/knet/ngknet_ptp.h @@ -0,0 +1,111 @@ +/*! \file ngknet_ptp.h + * + * Definitions and APIs declaration for PTP. + * + */ +/* + * $Copyright: Copyright 2018-2020 Broadcom. All rights reserved. + * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * A copy of the GNU General Public License version 2 (GPLv2) can + * be found in the LICENSES folder.$ + */ + +#ifndef NGKNET_PTP_H +#define NGKNET_PTP_H + +#include +#include "ngknet_main.h" + +/*! + * \brief PTP Rx config set. + * + * \param [in] ndev Network device structure point. + * \param [in] filter Rx filter. + * + * \retval SHR_E_NONE No errors. + */ +extern int +ngknet_ptp_rx_config_set(struct net_device *ndev, int *filter); + +/*! + * \brief PTP Tx config set. + * + * \param [in] ndev Network device structure point. + * \param [in] type Tx type. + * + * \retval SHR_E_NONE No errors. + */ +extern int +ngknet_ptp_tx_config_set(struct net_device *ndev, int type); + +/*! + * \brief PTP Rx HW timestamping get. + * + * \param [in] ndev Network device structure point. + * \param [in] skb Rx packet SKB. + * \param [out] ts Timestamp value. + * + * \retval SHR_E_NONE No errors. + */ +extern int +ngknet_ptp_rx_hwts_get(struct net_device *ndev, struct sk_buff *skb, uint64_t *ts); + +/*! + * \brief PTP Tx HW timestamping get. + * + * \param [in] ndev Network device structure point. + * \param [in] skb Tx packet SKB. + * \param [out] ts Timestamp value. + * + * \retval SHR_E_NONE No errors. + */ +extern int +ngknet_ptp_tx_hwts_get(struct net_device *ndev, struct sk_buff *skb, uint64_t *ts); + +/*! + * \brief PTP Tx meta set. + * + * \param [in] ndev Network device structure point. + * \param [in] skb Tx packet SKB. + * + * \retval SHR_E_NONE No errors. + */ +extern int +ngknet_ptp_tx_meta_set(struct net_device *ndev, struct sk_buff *skb); + +/*! + * \brief PTP PHC index get. + * + * \param [in] ndev Network device structure point. + * \param [out] index PHC index. + * + * \retval SHR_E_NONE No errors. + */ +extern int +ngknet_ptp_phc_index_get(struct net_device *ndev, int *index); + +/*! + * \brief PTP device control. + * + * \param [in] dev NGKNET device structure point. + * \param [in] cmd Command. + * \param [in] data Data buffer. + * \param [in] len Data length. + * + * \retval SHR_E_NONE No errors. + */ +extern int +ngknet_ptp_dev_ctrl(struct ngknet_dev *dev, int cmd, char *data, int len); + +#endif /* NGKNET_PTP_H */ + diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/knetcb/Kbuild b/platform/broadcom/saibcm-modules/sdklt/linux/knetcb/Kbuild new file mode 100644 index 000000000000..2ce66edb3c63 --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/linux/knetcb/Kbuild @@ -0,0 +1,36 @@ +# -*- Kbuild -*- +# +# Linux KNET Callback module. +# +# $Copyright: Copyright 2018-2020 Broadcom. All rights reserved. +# The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# version 2 as published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# A copy of the GNU General Public License version 2 (GPLv2) can +# be found in the LICENSES folder.$ +# +ifeq ($(BUILD_PSAMPLE),1) +PSAMPLE_CFLAGS=-DPSAMPLE_SUPPORT +PSAMPLE_CB_OBJS=psample-cb.o +endif + +obj-m := linux_ngknetcb.o + +ccflags-y := $(LKM_CFLAGS) \ + -I$(SDK)/shr/include \ + -I$(SDK)/bcmdrd/include \ + -I$(SDK)/linux/include \ + -I$(SDK)/linux/knet/include \ + -I$(SDK)/linux/knet \ + $(PSAMPLE_CFLAGS) + +linux_ngknetcb-y := ngknetcb_main.o \ + $(PSAMPLE_CB_OBJS) diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/knetcb/Makefile b/platform/broadcom/saibcm-modules/sdklt/linux/knetcb/Makefile new file mode 100644 index 000000000000..e2acfed49d6c --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/linux/knetcb/Makefile @@ -0,0 +1,33 @@ +# -*- Makefile -*- +# +# Linux KNET Callback module. +# +# $Copyright: Copyright 2018-2020 Broadcom. All rights reserved. +# The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# version 2 as published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# A copy of the GNU General Public License version 2 (GPLv2) can +# be found in the LICENSES folder.$ +# + +include Kbuild + +ifeq ($(KERNELRELEASE),) + +MOD_NAME = linux_ngknetcb + +include $(SDK)/make/lkm.mk + +endif + +.PHONY: distclean + +distclean: diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/knetcb/ngknetcb_main.c b/platform/broadcom/saibcm-modules/sdklt/linux/knetcb/ngknetcb_main.c new file mode 100644 index 000000000000..aa248dafce52 --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/linux/knetcb/ngknetcb_main.c @@ -0,0 +1,444 @@ +/*! \file ngknetcb_main.c + * + * NGKNET Callback module entry. + */ +/* + * $Copyright: (c) 2019 Broadcom. + * Broadcom Proprietary and Confidential. All rights reserved.$ + */ + +#include +#include +#include "psample-cb.h" + +/*! \cond */ +MODULE_AUTHOR("Broadcom Corporation"); +MODULE_DESCRIPTION("NGKNET Callback Module"); +MODULE_LICENSE("GPL"); +/*! \endcond */ + +/*! \cond */ +int debug = 0; +MODULE_PARAM(debug, int, 0); +MODULE_PARM_DESC(debug, +"Debug level (default 0)"); +/*! \endcond */ + +/*! Module information */ +#define NGKNETCB_MODULE_NAME "linux_ngknetcb" +#define NGKNETCB_MODULE_MAJOR 122 + +/* set KNET_CB_DEBUG for debug info */ +#define KNET_CB_DEBUG + +/* These below need to match incoming enum values */ +#define FILTER_TAG_STRIP 0 +#define FILTER_TAG_KEEP 1 +#define FILTER_TAG_ORIGINAL 2 + +/* Maintain tag strip statistics */ +struct strip_stats_s { + unsigned long stripped; /* Number of packets that have been stripped */ + unsigned long checked; + unsigned long skipped; +}; + +static struct strip_stats_s strip_stats; +static unsigned int rx_count = 0; + +/* Local function prototypes */ +static void strip_vlan_tag(struct sk_buff *skb); + +/* Remove VLAN tag for select TPIDs */ +static void +strip_vlan_tag(struct sk_buff *skb) +{ + uint16_t vlan_proto; + uint8_t *pkt = skb->data; + + vlan_proto = (uint16_t) ((pkt[12] << 8) | pkt[13]); + if ((vlan_proto == 0x8100) || (vlan_proto == 0x88a8) || (vlan_proto == 0x9100)) { + /* Move first 12 bytes of packet back by 4 */ + memmove(&skb->data[4], skb->data, 12); + skb_pull(skb, 4); /* Remove 4 bytes from start of buffer */ + } +} + +/* + * The function get_tag_status() returns the tag status. + * 0 = Untagged + * 1 = Single inner-tag + * 2 = Single outer-tag + * 3 = Double tagged. + * -1 = Unsupported type + */ +static int +get_tag_status(uint32_t dev_type, void *meta) +{ + uint32_t *valptr; + uint32_t fd_index; + uint32_t outer_l2_hdr; + int tag_status = -1; + + if ((dev_type == 0xb880) || (dev_type == 0xb780)) + { + /* Field BCM_PKTIO_RXPMD_MATCH_ID_LO has tag status in RX PMD */ + fd_index = 2; + valptr = (uint32_t *)meta; + outer_l2_hdr = (valptr[fd_index] >> ((dev_type == 0xb780) ? 2 : 1) & 0xFF); + + if (outer_l2_hdr & 0x1) { +#ifdef KNET_CB_DEBUG + if (debug & 0x1) { + printk(" L2 Header Present\n"); + } +#endif + tag_status = 0; + if (outer_l2_hdr & 0x4) { +#ifdef KNET_CB_DEBUG + if (debug & 0x1) { + printk(" SNAP/LLC\n"); + } +#endif + tag_status = 0; + } + if (outer_l2_hdr & 0x10) { +#ifdef KNET_CB_DEBUG + if (debug & 0x1) { + printk(" Outer Tagged\n"); + } +#endif + tag_status = 2; + if (outer_l2_hdr & 0x20) { +#ifdef KNET_CB_DEBUG + if (debug & 0x1) { + printk(" Double Tagged\n"); + } +#endif + tag_status = 3; + } + } + else if (outer_l2_hdr & 0x20) { +#ifdef KNET_CB_DEBUG + if (debug & 0x1) { + printk(" Inner Tagged\n"); + } +#endif + tag_status = 1; + } + } + } + else if ((dev_type == 0xb990)|| (dev_type == 0xb996)) + { + fd_index = 9; + valptr = (uint32_t *)meta; + /* On TH4, outer_l2_header means INCOMING_TAG_STATUS. + * TH4 only supports single tagging, so if TAG_STATUS + * says there's a tag, then we don't want to strip. + * Otherwise, we do. + */ + outer_l2_hdr = (valptr[fd_index] >> 13) & 3; + + if (outer_l2_hdr) + { + tag_status = 2; +#ifdef KNET_CB_DEBUG + if (debug & 0x1) + { + printk(" Incoming frame tagged\n"); + } +#endif + } + else + { + tag_status = 0; +#ifdef KNET_CB_DEBUG + if (debug & 0x1) + { + printk(" Incoming frame untagged\n"); + } +#endif + } + } +#ifdef KNET_CB_DEBUG + if (debug & 0x1) { + printk("%s; Device Type: %d; tag status: %d\n", __func__, dev_type, tag_status); + } +#endif + return tag_status; +} + +#ifdef KNET_CB_DEBUG +static void +dump_buffer(uint8_t * data, int size) +{ + const char *const to_hex = "0123456789ABCDEF"; + int i; + char buffer[128]; + char *buffer_ptr; + int addr = 0; + + buffer_ptr = buffer; + for (i = 0; i < size; i++) { + *buffer_ptr++ = ' '; + *buffer_ptr++ = to_hex[(data[i] >> 4) & 0xF]; + *buffer_ptr++ = to_hex[data[i] & 0xF]; + if (((i % 16) == 15) || (i == size - 1)) { + *buffer_ptr = '\0'; + buffer_ptr = buffer; + printk(KERN_INFO "%04X %s\n", addr, buffer); + addr = i + 1; + } + } +} + +static void +show_pmd(uint8_t *pmd, int len) +{ + if (debug & 0x1) { + printk("PMD (%d bytes):\n", len); + dump_buffer(pmd, len); + } +} + +static void +show_mac(uint8_t *pkt) +{ + if (debug & 0x1) { + printk("DMAC=%02X:%02X:%02X:%02X:%02X:%02X\n", + pkt[0], pkt[1], pkt[2], pkt[3], pkt[4], pkt[5]); + } +} +#endif + +static struct sk_buff * +strip_tag_rx_cb(struct sk_buff *skb) +{ + const struct ngknet_callback_desc *cbd = NGKNET_SKB_CB(skb); + const struct ngknet_private *priv = cbd->priv; + int rcpu_mode = 0; + int tag_status; + + rcpu_mode = (priv->flags & NGKNET_NETIF_F_RCPU_ENCAP)? 1 : 0; +#ifdef KNET_CB_DEBUG + if (debug & 0x1) + { + printk(KERN_INFO + "\n%4u --------------------------------------------------------------------------------\n", + rx_count); + printk(KERN_INFO + "RX KNET callback: dev_no=%1d; dev_id=0x%04X; type_str=%4s; RCPU: %3s \n", + cbd->dev_no, cbd->dev_id, cbd->type_str, rcpu_mode ? "yes" : "no"); + printk(KERN_INFO " pkt_len=%4d; pmd_len=%2d; SKB len: %4d\n", + cbd->pkt_len, cbd->pmd_len, skb->len); + if (cbd->filt) { + printk(KERN_INFO "Filter user data: 0x%08x\n", + *(uint32_t *) cbd->filt->user_data); + } + printk(KERN_INFO "Before SKB (%d bytes):\n", skb->len); + dump_buffer(skb->data, skb->len); + printk("rx_cb for dev %d: id 0x%x, %s\n", cbd->dev_no, cbd->dev_id, cbd->type_str); + printk("netif user data: 0x%08x\n", *(uint32_t *)cbd->priv->user_data); + show_pmd(cbd->pmd, cbd->pmd_len); + if (rcpu_mode) { + const int RCPU_header_len = PKT_HDR_SIZE + cbd->pmd_len; + const int payload_len = skb->len - RCPU_header_len; + unsigned char *payload_start = skb->data + payload_len; + + printk(KERN_INFO "Packet Payload (%d bytes):\n", payload_len); + dump_buffer(payload_start, payload_len); + } else { + printk(KERN_INFO "Packet (%d bytes):\n", cbd->pkt_len); + dump_buffer(skb->data, cbd->pkt_len); + } + } +#endif + + if ((!rcpu_mode) && (cbd->filt)) { + if (FILTER_TAG_ORIGINAL == cbd->filt->user_data[0]) { + tag_status = get_tag_status(cbd->dev_id, (void *)cbd->pmd); + if (tag_status < 0) { + strip_stats.skipped++; + goto _strip_tag_rx_cb_exit; + } + strip_stats.checked++; + if (tag_status < 2) { + strip_stats.stripped++; + strip_vlan_tag(skb); + } + } + } +_strip_tag_rx_cb_exit: +#ifdef KNET_CB_DEBUG + if (debug & 0x1) { + printk(KERN_INFO "After SKB (%d bytes):\n", skb->len); + dump_buffer(skb->data, skb->len); + printk(KERN_INFO + "\n%4u --------------------------------------------------------------------------------\n", + rx_count++); + } +#endif + return skb; +} + +static struct sk_buff * +strip_tag_tx_cb(struct sk_buff *skb) +{ +#ifdef KNET_CB_DEBUG + struct ngknet_callback_desc *cbd = NGKNET_SKB_CB(skb); + + if (debug & 0x1) { + printk("tx_cb for dev %d: %s\n", cbd->dev_no, cbd->type_str); + } + show_pmd(cbd->pmd, cbd->pmd_len); + show_mac(cbd->pmd + cbd->pmd_len); +#endif + return skb; +} + +static struct sk_buff * +ngknet_rx_cb(struct sk_buff *skb) +{ + skb = strip_tag_rx_cb(skb); +#ifdef PSAMPLE_SUPPORT + skb = psample_rx_cb(skb); +#endif + return skb; +} + +static struct sk_buff * +ngknet_tx_cb(struct sk_buff *skb) +{ + skb = strip_tag_tx_cb(skb); + return skb; +} + +static int +ngknet_netif_create_cb(struct net_device *dev) +{ + int retv = 0; +#ifdef PSAMPLE_SUPPORT + retv = psample_netif_create_cb(dev); +#endif + return retv; +} + +static int +ngknet_netif_destroy_cb(struct net_device *dev) +{ + int retv = 0; +#ifdef PSAMPLE_SUPPORT + retv = psample_netif_destroy_cb(dev); +#endif + return retv; +} + +/*! + * Generic module functions + */ +static int +ngknetcb_show(struct seq_file *m, void *v) +{ + seq_printf(m, "Broadcom Linux NGKNET Callback: Untagged VLAN Stripper\n"); + seq_printf(m, " %lu stripped packets\n", strip_stats.stripped); + seq_printf(m, " %lu packets checked\n", strip_stats.checked); + seq_printf(m, " %lu packets skipped\n", strip_stats.skipped); + return 0; +} + +static int +ngknetcb_open(struct inode *inode, struct file *filp) +{ + return single_open(filp, ngknetcb_show, NULL); +} + +static int +ngknetcb_release(struct inode *inode, struct file *filp) +{ + return 0; +} + +static ssize_t +ngknetcb_write(struct file *file, const char *buf, + size_t count, loff_t *loff) +{ + memset(&strip_stats, 0, sizeof(strip_stats)); + printk("Cleared NGKNET callback stats\n"); + return count; +} + +static long +ngknetcb_ioctl(struct file *file, unsigned int cmd, unsigned long arg) +{ + return 0; +} + +static int +ngknetcb_mmap(struct file *filp, struct vm_area_struct *vma) +{ + return 0; +} + +static struct file_operations ngknetcb_fops = { + .owner = THIS_MODULE, + .open = ngknetcb_open, + .read = seq_read, + .write = ngknetcb_write, + .llseek = seq_lseek, + .release = ngknetcb_release, + .unlocked_ioctl = ngknetcb_ioctl, + .compat_ioctl = ngknetcb_ioctl, + .mmap = ngknetcb_mmap, +}; + +static int __init +ngknetcb_init_module(void) +{ + int rv; + struct proc_dir_entry *entry = NULL; + + rv = register_chrdev(NGKNETCB_MODULE_MAJOR, NGKNETCB_MODULE_NAME, &ngknetcb_fops); + if (rv < 0) { + printk(KERN_WARNING "%s: can't get major %d\n", + NGKNETCB_MODULE_NAME, NGKNETCB_MODULE_MAJOR); + return rv; + } + + PROC_CREATE(entry, NGKNETCB_MODULE_NAME, 0666, NULL, &ngknetcb_fops); + if (entry == NULL) { + printk(KERN_ERR "%s: proc_mkdir failed\n", + NGKNETCB_MODULE_NAME); + } + + ngknet_rx_cb_register(ngknet_rx_cb); + ngknet_tx_cb_register(ngknet_tx_cb); + +#ifdef PSAMPLE_SUPPORT + psample_init(); +#endif + + ngknet_netif_create_cb_register(ngknet_netif_create_cb); + ngknet_netif_destroy_cb_register(ngknet_netif_destroy_cb); + return 0; +} + +static void __exit +ngknetcb_exit_module(void) +{ + ngknet_netif_create_cb_unregister(ngknet_netif_create_cb); + ngknet_netif_destroy_cb_unregister(ngknet_netif_destroy_cb); + +#ifdef PSAMPLE_SUPPORT + psample_cleanup(); +#endif + + ngknet_rx_cb_unregister(ngknet_rx_cb); + ngknet_tx_cb_unregister(ngknet_tx_cb); + + remove_proc_entry(NGKNETCB_MODULE_NAME, NULL); + + unregister_chrdev(NGKNETCB_MODULE_MAJOR, NGKNETCB_MODULE_NAME); +} + +module_init(ngknetcb_init_module); +module_exit(ngknetcb_exit_module); diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/knetcb/psample-cb.c b/platform/broadcom/saibcm-modules/sdklt/linux/knetcb/psample-cb.c new file mode 100644 index 000000000000..be34430218d3 --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/linux/knetcb/psample-cb.c @@ -0,0 +1,995 @@ +/* + * Copyright 2017-2019 Broadcom + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation (the "GPL"). + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License version 2 (GPLv2) for more details. + * + * You should have received a copy of the GNU General Public License + * version 2 (GPLv2) along with this source code. + */ +/* + * $Id: psample_cb.c $ + * $Copyright: (c) 2019 Broadcom Corp. + * All Rights Reserved.$ + */ + +/* + * Driver for call-back functions for Linux KNET driver. + * + * This code is used to integrate packet sampling KNET callback to + * the psample infra for sending sampled pkts to userspace sflow + * applications such as Host Sflow (https://github.com/sflow/host-sflow) + * using genetlink interfaces. + * + * The module can be built from the standard Linux user mode target + * directories using the following command (assuming bash), e.g. + * + * cd $SDK/systems/linux/user/ + * make BUILD_KNET_CB=1 + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include "psample-cb.h" + +#define PSAMPLE_CB_DBG +#ifdef PSAMPLE_CB_DBG +extern int debug; +#define PSAMPLE_CB_DBG_LVL_VERB (0x1) +#define PSAMPLE_CB_DBG_LVL_PMD (0x2) +#define PSAMPLE_CB_DBG_PRINT(...) if (debug & PSAMPLE_CB_DBG_LVL_VERB) { printk(__VA_ARGS__); } +#define PSAMPLE_CB_PMD_PRINT(...) if (debug & PSAMPLE_CB_DBG_LVL_PMD) { printk(__VA_ARGS__); } +#else +#define PSAMPLE_CB_DBG_PRINT(...) +#define PSAMPLE_CB_PMD_PRINT(...) +#endif + +#define FCS_SZ 4 +#define PSAMPLE_NLA_PADDING 4 +#define PSAMPLE_PKT_HANDLED (1) + +#define PSAMPLE_RATE_DFLT 1 +#define PSAMPLE_SIZE_DFLT 128 +static int psample_size = PSAMPLE_SIZE_DFLT; +MODULE_PARAM(psample_size, int, 0); +MODULE_PARM_DESC(psample_size, +"psample pkt size (default 128 bytes)"); + +#define PSAMPLE_QLEN_DFLT 1024 +static int psample_qlen = PSAMPLE_QLEN_DFLT; +MODULE_PARAM(psample_qlen, int, 0); +MODULE_PARM_DESC(psample_qlen, +"psample queue length (default 1024 buffers)"); + +/* driver proc entry root */ +static struct proc_dir_entry *psample_proc_root = NULL; +static struct proc_dir_entry *knet_cb_proc_root = NULL; + +/* psample general info */ +typedef struct { + struct list_head netif_list; + int netif_count; + struct net *netns; + spinlock_t lock; + int dcb_type; +} psample_info_t; +static psample_info_t g_psample_info = {0}; + +/* Maintain sampled pkt statistics */ +typedef struct psample_stats_s { + unsigned long pkts_f_psample_cb; + unsigned long pkts_f_psample_mod; + unsigned long pkts_f_handled; + unsigned long pkts_f_pass_through; + unsigned long pkts_f_dst_mc; + unsigned long pkts_c_qlen_cur; + unsigned long pkts_c_qlen_hi; + unsigned long pkts_d_qlen_max; + unsigned long pkts_d_no_mem; + unsigned long pkts_d_no_group; + unsigned long pkts_d_sampling_disabled; + unsigned long pkts_d_not_ready; + unsigned long pkts_d_metadata; + unsigned long pkts_d_skb; + unsigned long pkts_d_skb_cbd; + unsigned long pkts_d_meta_srcport; + unsigned long pkts_d_meta_dstport; + unsigned long pkts_d_invalid_size; +} psample_stats_t; +static psample_stats_t g_psample_stats = {0}; + +typedef struct psample_meta_s { + int trunc_size; + int src_ifindex; + int dst_ifindex; + int sample_rate; +} psample_meta_t; + +typedef struct psample_pkt_s { + struct list_head list; + struct psample_group *group; + psample_meta_t meta; + struct sk_buff *skb; +} psample_pkt_t; + +typedef struct psample_work_s { + struct list_head pkt_list; + struct work_struct wq; + spinlock_t lock; +} psample_work_t; +static psample_work_t g_psample_work = {0}; + +static psample_netif_t* +psample_netif_lookup_by_ifindex(int ifindex) +{ + struct list_head *list; + psample_netif_t *psample_netif = NULL; + unsigned long flags; + + /* look for port from list of available net_devices */ + spin_lock_irqsave(&g_psample_info.lock, flags); + list_for_each(list, &g_psample_info.netif_list) { + psample_netif = (psample_netif_t*)list; + if (psample_netif->dev->ifindex == ifindex) { + spin_unlock_irqrestore(&g_psample_info.lock, flags); + return psample_netif; + } + } + spin_unlock_irqrestore(&g_psample_info.lock, flags); + return (NULL); +} + +static psample_netif_t* +psample_netif_lookup_by_port(int port) +{ + struct list_head *list; + psample_netif_t *psample_netif = NULL; + unsigned long flags; + + /* look for port from list of available net_devices */ + spin_lock_irqsave(&g_psample_info.lock, flags); + list_for_each(list, &g_psample_info.netif_list) { + psample_netif = (psample_netif_t*)list; + if (psample_netif->port == port) { + spin_unlock_irqrestore(&g_psample_info.lock, flags); + return psample_netif; + } + } + spin_unlock_irqrestore(&g_psample_info.lock, flags); + return (NULL); +} + +static int +psample_meta_sample_reason(uint8_t *pkt, void *pkt_meta) +{ + uint32_t *metadata = (uint32_t*)pkt_meta; + uint32_t reason = 0; + uint32_t reason_hi = 0; + uint32_t sample_rx_reason_mask = 0; + + if (metadata) { + /* Sample Pkt reason code (bcmRxReasonSampleSource) */ + switch(g_psample_info.dcb_type) { + case 36: /* TD3 */ + case 38: /* TH3 */ + reason_hi = *(metadata + 4); + reason = *(metadata + 5); + sample_rx_reason_mask = (1 << 3); + break; + case 32: /* TH1/TH2 */ + case 26: /* TD2 */ + case 23: /* HX4 */ + reason_hi = *(metadata + 2); + reason = *(metadata + 3); + sample_rx_reason_mask = (1 << 5); + break; + default: + break; + } + } + PSAMPLE_CB_DBG_PRINT("%s: DCB%d sample_rx_reason_mask: 0x%08x, reason: 0x%08x, reason_hi: 0x%08x\n", + __func__, g_psample_info.dcb_type, sample_rx_reason_mask, reason, reason_hi); + + /* Check if only sample reason code is set. + * If only sample reason code, then consume pkt. + * If other reason codes exist, then pkt should be + * passed through to Linux network stack. + */ + if ((reason & ~sample_rx_reason_mask) || reason_hi) { + return 0; /* multiple reasons set, pass through */ + } + + /* only sample rx reason set, consume pkt */ + return (PSAMPLE_PKT_HANDLED); +} + +static int +psample_meta_get(struct sk_buff *skb, psample_meta_t *sflow_meta) +{ + int src_ifindex = 0; + int sample_rate = 1; + int sample_size = PSAMPLE_SIZE_DFLT; + psample_netif_t *psample_netif = NULL; + const struct ngknet_callback_desc *cbd = NGKNET_SKB_CB(skb); + const struct ngknet_private *netif = cbd->priv; + memset(sflow_meta, 0, sizeof(psample_meta_t)); + + /* find src port */ + if ((psample_netif = psample_netif_lookup_by_ifindex(netif->net_dev->ifindex))) { + src_ifindex = psample_netif->dev->ifindex; + sample_rate = psample_netif->sample_rate; + sample_size = psample_netif->sample_size; + } else { + g_psample_stats.pkts_d_meta_srcport++; + PSAMPLE_CB_DBG_PRINT("%s: could not find psample netif for src dev %s (ifidx %d)\n", + __func__, netif->net_dev->name, netif->net_dev->ifindex); + } + + sflow_meta->src_ifindex = src_ifindex; + sflow_meta->trunc_size = sample_size; + sflow_meta->sample_rate = sample_rate; + return (0); +} + +static void +psample_task(struct work_struct *work) +{ + psample_work_t *psample_work = container_of(work, psample_work_t, wq); + unsigned long flags; + struct list_head *list_ptr, *list_next; + psample_pkt_t *pkt; + + spin_lock_irqsave(&psample_work->lock, flags); + list_for_each_safe(list_ptr, list_next, &psample_work->pkt_list) { + /* dequeue pkt from list */ + pkt = list_entry(list_ptr, psample_pkt_t, list); + list_del(list_ptr); + g_psample_stats.pkts_c_qlen_cur--; + spin_unlock_irqrestore(&psample_work->lock, flags); + + /* send to psample */ + if (pkt) { + PSAMPLE_CB_DBG_PRINT("%s: group 0x%x, trunc_size %d, src_ifdx 0x%x, dst_ifdx 0x%x, sample_rate %d\n", + __func__, pkt->group->group_num, + pkt->meta.trunc_size, pkt->meta.src_ifindex, + pkt->meta.dst_ifindex, pkt->meta.sample_rate); + + psample_sample_packet(pkt->group, + pkt->skb, + pkt->meta.trunc_size, + pkt->meta.src_ifindex, + pkt->meta.dst_ifindex, + pkt->meta.sample_rate); + g_psample_stats.pkts_f_psample_mod++; + + dev_kfree_skb_any(pkt->skb); + kfree(pkt); + } + spin_lock_irqsave(&psample_work->lock, flags); + } + spin_unlock_irqrestore(&psample_work->lock, flags); +} + +struct sk_buff* +psample_rx_cb(struct sk_buff *skb) +{ + struct psample_group *group; + psample_meta_t meta; + int rv = 0, size; + const struct ngknet_callback_desc *cbd = NULL; + const struct ngknet_private *netif = NULL; + const struct ngknet_filter_s *filt = NULL; + const struct ngknet_filter_s *filt_src = NULL; + + if (!skb) { + printk("%s: skb is NULL\n", __func__); + g_psample_stats.pkts_d_skb++; + return (NULL); + } + cbd = NGKNET_SKB_CB(skb); + netif = cbd->priv; + filt_src = cbd->filt; + filt = cbd->filt_cb; + + if (!cbd || !netif || !filt_src) { + printk("%s: cbd(0x%p) or priv(0x%p) or filter src(0x%p) is NULL\n", + __func__, cbd, netif, filt_src); + g_psample_stats.pkts_d_skb_cbd++; + return (skb); + } + + /* Enable PMD output in dmesg: "echo "debug=0x2" > /proc/bcm/knet-cb/psample/debug" + * Use bshell cmd "pmddecode rxpmd ..." to decode pkt metadata + */ + if (debug & PSAMPLE_CB_DBG_LVL_PMD) { + char str[128]; + int i, len = cbd->pmd_len > 128? 128 : cbd->pmd_len; + PSAMPLE_CB_PMD_PRINT("PMD (%d bytes): %s\n", + cbd->pmd_len, skb->dev->name); + for (i=0; ipmd+i))); + if ((i & 0x1c) == 0x1c) { + sprintf(&str[strlen(str)], "\n"); + printk(str); + continue; + } + } + if ((i & 0x1f) != 0) { + sprintf(&str[strlen(str)], "\n"); + PSAMPLE_CB_PMD_PRINT(str); + } + } + + /* check if this packet is sampled packet (from sample filter) */ + if (!filt || + (NGKNET_FILTER_DEST_T_CB != filt->dest_type) || + (strncmp(filt->desc, PSAMPLE_CB_NAME, NGKNET_FILTER_DESC_MAX) != 0)) { + return (skb); + } + + PSAMPLE_CB_DBG_PRINT("%s: src dev %s, pkt size %d, filt->dest_id %d\n", + __func__, skb->dev->name, cbd->pkt_len, filt->dest_id); + g_psample_stats.pkts_f_psample_cb++; + + /* get psample group info. psample genetlink group ID passed in filt->dest_id */ + group = psample_group_get(g_psample_info.netns, filt->dest_id); + if (!group) { + printk("%s: Could not find psample genetlink group %d\n", __func__, filt->dest_id); + g_psample_stats.pkts_d_no_group++; + goto PSAMPLE_FILTER_CB_PKT_HANDLED; + } + + /* get psample metadata */ + rv = psample_meta_get(skb, &meta); + if (rv < 0) { + printk("%s: Could not parse pkt metadata\n", __func__); + g_psample_stats.pkts_d_metadata++; + goto PSAMPLE_FILTER_CB_PKT_HANDLED; + } + + /* Adjust original pkt size to remove 4B FCS */ + size = cbd->pkt_len; + if (size < FCS_SZ) { + g_psample_stats.pkts_d_invalid_size++; + goto PSAMPLE_FILTER_CB_PKT_HANDLED; + } else { + size -= FCS_SZ; + } + + /* Account for padding in libnl used by psample */ + if (meta.trunc_size >= size) { + meta.trunc_size = size - PSAMPLE_NLA_PADDING; + } + + PSAMPLE_CB_DBG_PRINT("%s: group 0x%x, trunc_size %d, src_ifdx 0x%x, dst_ifdx 0x%x, sample_rate %d\n", + __func__, group->group_num, meta.trunc_size, meta.src_ifindex, meta.dst_ifindex, meta.sample_rate); + + /* drop if configured sample rate is 0 */ + if (meta.sample_rate > 0) { + unsigned long flags; + psample_pkt_t *psample_pkt; + struct sk_buff *skb_psample; + + if (g_psample_stats.pkts_c_qlen_cur >= psample_qlen) { + printk("%s: tail drop due to max qlen %d reached\n", __func__, psample_qlen); + g_psample_stats.pkts_d_qlen_max++; + goto PSAMPLE_FILTER_CB_PKT_HANDLED; + } + + if ((psample_pkt = kmalloc(sizeof(psample_pkt_t), GFP_ATOMIC)) == NULL) { + printk("%s: failed to alloc psample mem for pkt\n", __func__); + g_psample_stats.pkts_d_no_mem++; + goto PSAMPLE_FILTER_CB_PKT_HANDLED; + } + memcpy(&psample_pkt->meta, &meta, sizeof(psample_meta_t)); + psample_pkt->group = group; + + if ((skb_psample = dev_alloc_skb(meta.trunc_size)) == NULL) { + printk("%s: failed to alloc psample mem for pkt skb\n", __func__); + g_psample_stats.pkts_d_no_mem++; + goto PSAMPLE_FILTER_CB_PKT_HANDLED; + } + + /* setup skb to point to pkt */ + memcpy(skb_psample->data, skb->data, meta.trunc_size); + skb_put(skb_psample, meta.trunc_size); + skb_psample->len = meta.trunc_size; + psample_pkt->skb = skb_psample; + + spin_lock_irqsave(&g_psample_work.lock, flags); + list_add_tail(&psample_pkt->list, &g_psample_work.pkt_list); + + g_psample_stats.pkts_c_qlen_cur++; + if (g_psample_stats.pkts_c_qlen_cur > g_psample_stats.pkts_c_qlen_hi) { + g_psample_stats.pkts_c_qlen_hi = g_psample_stats.pkts_c_qlen_cur; + } + + schedule_work(&g_psample_work.wq); + spin_unlock_irqrestore(&g_psample_work.lock, flags); + } else { + g_psample_stats.pkts_d_sampling_disabled++; + } + +PSAMPLE_FILTER_CB_PKT_HANDLED: + /* if sample reason only, consume pkt. else pass through */ + rv = psample_meta_sample_reason(skb->data, cbd->pmd); + if (rv) { + g_psample_stats.pkts_f_handled++; + return NULL; + } + g_psample_stats.pkts_f_pass_through++; + return skb; +} + +int +psample_netif_create_cb(struct net_device *dev) +{ + int found; + struct list_head *list; + psample_netif_t *psample_netif, *lpsample_netif; + unsigned long flags; + struct ngknet_private *netif = NULL; + + if (!dev) { + printk("%s: net_device is NULL\n", __func__); + return (-1); + } + netif = netdev_priv(dev); + + if ((psample_netif = kmalloc(sizeof(psample_netif_t), GFP_ATOMIC)) == NULL) { + printk("%s: failed to alloc psample mem for netif '%s'\n", + __func__, dev->name); + return (-1); + } + + spin_lock_irqsave(&g_psample_info.lock, flags); + + psample_netif->dev = dev; + psample_netif->id = netif->id; + /* FIXME: port is not saved in ngknet_private, need to get from metadata?? */ + //psample_netif->port = netif->port; + psample_netif->vlan = netif->vlan; + psample_netif->sample_rate = PSAMPLE_RATE_DFLT; + psample_netif->sample_size = PSAMPLE_SIZE_DFLT; + + /* insert netif sorted by ID similar to bkn_knet_netif_create() */ + found = 0; + list_for_each(list, &g_psample_info.netif_list) { + lpsample_netif = (psample_netif_t*)list; + if (netif->id < lpsample_netif->id) { + found = 1; + g_psample_info.netif_count++; + break; + } + } + + if (found) { + /* Replace previously removed interface */ + list_add_tail(&psample_netif->list, &lpsample_netif->list); + } else { + /* No holes - add to end of list */ + list_add_tail(&psample_netif->list, &g_psample_info.netif_list); + } + + spin_unlock_irqrestore(&g_psample_info.lock, flags); + + PSAMPLE_CB_DBG_PRINT("%s: added psample netif '%s'\n", __func__, dev->name); + return (0); +} + +int +psample_netif_destroy_cb(struct net_device *dev) +{ + int found; + struct list_head *list; + psample_netif_t *psample_netif; + unsigned long flags; + struct ngknet_private *netif = NULL; + + if (!dev) { + printk("%s: net_device is NULL\n", __func__); + return (-1); + } + netif = netdev_priv(dev); + + spin_lock_irqsave(&g_psample_info.lock, flags); + + list_for_each(list, &g_psample_info.netif_list) { + psample_netif = (psample_netif_t*)list; + if (netif->id == psample_netif->id) { + found = 1; + list_del(&psample_netif->list); + PSAMPLE_CB_DBG_PRINT("%s: removing psample netif '%s'\n", __func__, dev->name); + kfree(psample_netif); + g_psample_info.netif_count--; + break; + } + } + + spin_unlock_irqrestore(&g_psample_info.lock, flags); + + if (!found) { + printk("%s: netif ID %d not found!\n", __func__, netif->id); + return (-1); + } + return (0); +} + +/* + * psample rate Proc Read Entry + */ +static int +psample_proc_rate_show(struct seq_file *m, void *v) +{ + struct list_head *list; + psample_netif_t *psample_netif; + unsigned long flags; + + spin_lock_irqsave(&g_psample_info.lock, flags); + + list_for_each(list, &g_psample_info.netif_list) { + psample_netif = (psample_netif_t*)list; + seq_printf(m, " %-14s %d\n", psample_netif->dev->name, psample_netif->sample_rate); + } + + spin_unlock_irqrestore(&g_psample_info.lock, flags); + + return 0; +} + +static int +psample_proc_rate_open(struct inode * inode, struct file * file) +{ + return single_open(file, psample_proc_rate_show, NULL); +} + +/* + * psample rate Proc Write Entry + * + * Syntax: + * = + * + * Where is a virtual network interface name. + * + * Examples: + * eth4=1000 + */ +static ssize_t +psample_proc_rate_write(struct file *file, const char *buf, + size_t count, loff_t *loff) +{ + int found; + struct list_head *list; + psample_netif_t *psample_netif; + char sample_str[40], *ptr, *newline; + unsigned long flags; + + + if (count > sizeof(sample_str)) { + count = sizeof(sample_str) - 1; + sample_str[count] = '\0'; + } + if (copy_from_user(sample_str, buf, count)) { + return -EFAULT; + } + sample_str[count] = 0; + newline = strchr(sample_str, '\n'); + if (newline) { + /* Chop off the trailing newline */ + *newline = '\0'; + } + + if ((ptr = strchr(sample_str, '=')) == NULL && + (ptr = strchr(sample_str, ':')) == NULL) { + printk("Error: Pkt sample rate syntax not recognized: '%s'\n", sample_str); + return count; + } + *ptr++ = 0; + + spin_lock_irqsave(&g_psample_info.lock, flags); + + found = 0; + list_for_each(list, &g_psample_info.netif_list) { + psample_netif = (psample_netif_t*)list; + if (strcmp(psample_netif->dev->name, sample_str) == 0) { + psample_netif->sample_rate = simple_strtol(ptr, NULL, 10); + // TODO MLI@BRCM - check valid sample rate + found = 1; + break; + } + } + + spin_unlock_irqrestore(&g_psample_info.lock, flags); + + if (!found) { + printk("Warning: Failed setting psample rate on unknown network interface: '%s'\n", sample_str); + } + return count; +} + +struct file_operations psample_proc_rate_file_ops = { + owner: THIS_MODULE, + open: psample_proc_rate_open, + read: seq_read, + llseek: seq_lseek, + write: psample_proc_rate_write, + release: single_release, +}; + +/* + * psample size Proc Read Entry + */ +static int +psample_proc_size_show(struct seq_file *m, void *v) +{ + struct list_head *list; + psample_netif_t *psample_netif; + unsigned long flags; + + spin_lock_irqsave(&g_psample_info.lock, flags); + + list_for_each(list, &g_psample_info.netif_list) { + psample_netif = (psample_netif_t*)list; + seq_printf(m, " %-14s %d\n", psample_netif->dev->name, psample_netif->sample_size); + } + + spin_unlock_irqrestore(&g_psample_info.lock, flags); + return 0; +} + +static int +psample_proc_size_open(struct inode * inode, struct file * file) +{ + return single_open(file, psample_proc_size_show, NULL); +} + +/* + * psample size Proc Write Entry + * + * Syntax: + * = + * + * Where is a virtual network interface name. + * + * Examples: + * eth4=128 + */ +static ssize_t +psample_proc_size_write(struct file *file, const char *buf, + size_t count, loff_t *loff) +{ + int found; + struct list_head *list; + psample_netif_t *psample_netif; + char sample_str[40], *ptr, *newline; + unsigned long flags; + + if (count > sizeof(sample_str)) { + count = sizeof(sample_str) - 1; + sample_str[count] = '\0'; + } + if (copy_from_user(sample_str, buf, count)) { + return -EFAULT; + } + sample_str[count] = 0; + newline = strchr(sample_str, '\n'); + if (newline) { + /* Chop off the trailing newline */ + *newline = '\0'; + } + + if ((ptr = strchr(sample_str, '=')) == NULL && + (ptr = strchr(sample_str, ':')) == NULL) { + printk("Error: Pkt sample size syntax not recognized: '%s'\n", sample_str); + return count; + } + *ptr++ = 0; + + spin_lock_irqsave(&g_psample_info.lock, flags); + + found = 0; + list_for_each(list, &g_psample_info.netif_list) { + psample_netif = (psample_netif_t*)list; + if (strcmp(psample_netif->dev->name, sample_str) == 0) { + psample_netif->sample_size = simple_strtol(ptr, NULL, 10); + // TODO MLI@BRCM - check valid sample size + found = 1; + break; + } + } + + spin_unlock_irqrestore(&g_psample_info.lock, flags); + + if (!found) { + printk("Warning: Failed setting psample size on unknown network interface: '%s'\n", sample_str); + } + return count; +} + +struct file_operations psample_proc_size_file_ops = { + owner: THIS_MODULE, + open: psample_proc_size_open, + read: seq_read, + llseek: seq_lseek, + write: psample_proc_size_write, + release: single_release, +}; + +/* + * psample map Proc Read Entry + */ +static int +psample_proc_map_show(struct seq_file *m, void *v) +{ + struct list_head *list; + psample_netif_t *psample_netif; + unsigned long flags; + + seq_printf(m, " Interface logical port ifindex\n"); + seq_printf(m, "------------- ------------ -------\n"); + spin_lock_irqsave(&g_psample_info.lock, flags); + + list_for_each(list, &g_psample_info.netif_list) { + psample_netif = (psample_netif_t*)list; + seq_printf(m, " %-14s %-14d %d\n", + psample_netif->dev->name, + psample_netif->port, + psample_netif->dev->ifindex); + } + + spin_unlock_irqrestore(&g_psample_info.lock, flags); + return 0; +} + +static int +psample_proc_map_open(struct inode * inode, struct file * file) +{ + return single_open(file, psample_proc_map_show, NULL); +} + +struct file_operations psample_proc_map_file_ops = { + owner: THIS_MODULE, + open: psample_proc_map_open, + read: seq_read, + llseek: seq_lseek, + write: NULL, + release: single_release, +}; + +/* + * psample debug Proc Read Entry + */ +static int +psample_proc_debug_show(struct seq_file *m, void *v) +{ + seq_printf(m, "BCM KNET %s Callback Config\n", PSAMPLE_CB_NAME); + seq_printf(m, " debug: 0x%x\n", debug); + seq_printf(m, " dcb_type: %d\n", g_psample_info.dcb_type); + seq_printf(m, " netif_count: %d\n", g_psample_info.netif_count); + seq_printf(m, " queue length: %d\n", psample_qlen); + + return 0; +} + +static int +psample_proc_debug_open(struct inode * inode, struct file * file) +{ + return single_open(file, psample_proc_debug_show, NULL); +} + +/* + * psample debug Proc Write Entry + * + * Syntax: + * debug= + * + * Where corresponds to the debug module parameter. + * + * Examples: + * debug=0x1 + */ +static ssize_t +psample_proc_debug_write(struct file *file, const char *buf, + size_t count, loff_t *loff) +{ + char debug_str[40]; + char *ptr; + + if (count > sizeof(debug_str)) { + count = sizeof(debug_str) - 1; + debug_str[count] = '\0'; + } + if (copy_from_user(debug_str, buf, count)) { + return -EFAULT; + } + + if ((ptr = strstr(debug_str, "debug=")) != NULL) { + ptr += 6; + debug = simple_strtol(ptr, NULL, 0); + } else { + printk("Warning: unknown configuration setting\n"); + } + + return count; +} + +struct file_operations psample_proc_debug_file_ops = { + owner: THIS_MODULE, + open: psample_proc_debug_open, + read: seq_read, + llseek: seq_lseek, + write: psample_proc_debug_write, + release: single_release, +}; + +static int +psample_proc_stats_show(struct seq_file *m, void *v) +{ + seq_printf(m, "BCM KNET %s Callback Stats\n", PSAMPLE_CB_NAME); + seq_printf(m, " DCB type %d\n", g_psample_info.dcb_type); + seq_printf(m, " pkts filter psample cb %10lu\n", g_psample_stats.pkts_f_psample_cb); + seq_printf(m, " pkts sent to psample module %10lu\n", g_psample_stats.pkts_f_psample_mod); + seq_printf(m, " pkts handled by psample %10lu\n", g_psample_stats.pkts_f_handled); + seq_printf(m, " pkts pass through %10lu\n", g_psample_stats.pkts_f_pass_through); + seq_printf(m, " pkts with mc destination %10lu\n", g_psample_stats.pkts_f_dst_mc); + seq_printf(m, " pkts current queue length %10lu\n", g_psample_stats.pkts_c_qlen_cur); + seq_printf(m, " pkts high queue length %10lu\n", g_psample_stats.pkts_c_qlen_hi); + seq_printf(m, " pkts drop max queue length %10lu\n", g_psample_stats.pkts_d_qlen_max); + seq_printf(m, " pkts drop no memory %10lu\n", g_psample_stats.pkts_d_no_mem); + seq_printf(m, " pkts drop no psample group %10lu\n", g_psample_stats.pkts_d_no_group); + seq_printf(m, " pkts drop sampling disabled %10lu\n", g_psample_stats.pkts_d_sampling_disabled); + seq_printf(m, " pkts drop psample not ready %10lu\n", g_psample_stats.pkts_d_not_ready); + seq_printf(m, " pkts drop metadata parse error %10lu\n", g_psample_stats.pkts_d_metadata); + seq_printf(m, " pkts drop skb error %10lu\n", g_psample_stats.pkts_d_skb); + seq_printf(m, " pkts drop skb cbd error %10lu\n", g_psample_stats.pkts_d_skb_cbd); + seq_printf(m, " pkts with invalid src port %10lu\n", g_psample_stats.pkts_d_meta_srcport); + seq_printf(m, " pkts with invalid dst port %10lu\n", g_psample_stats.pkts_d_meta_dstport); + seq_printf(m, " pkts with invalid orig pkt sz %10lu\n", g_psample_stats.pkts_d_invalid_size); + return 0; +} + +static int +psample_proc_stats_open(struct inode * inode, struct file * file) +{ + return single_open(file, psample_proc_stats_show, NULL); +} + +/* + * psample stats Proc Write Entry + * + * Syntax: + * write any value to clear stats + */ +static ssize_t +psample_proc_stats_write(struct file *file, const char *buf, + size_t count, loff_t *loff) +{ + int qlen_cur = 0; + unsigned long flags; + + spin_lock_irqsave(&g_psample_work.lock, flags); + qlen_cur = g_psample_stats.pkts_c_qlen_cur; + memset(&g_psample_stats, 0, sizeof(psample_stats_t)); + g_psample_stats.pkts_c_qlen_cur = qlen_cur; + spin_unlock_irqrestore(&g_psample_work.lock, flags); + + return count; +} +struct file_operations psample_proc_stats_file_ops = { + owner: THIS_MODULE, + open: psample_proc_stats_open, + read: seq_read, + llseek: seq_lseek, + write: psample_proc_stats_write, + release: single_release, +}; + +int psample_cleanup(void) +{ + cancel_work_sync(&g_psample_work.wq); + remove_proc_entry("stats", psample_proc_root); + remove_proc_entry("rate", psample_proc_root); + remove_proc_entry("size", psample_proc_root); + remove_proc_entry("debug", psample_proc_root); + remove_proc_entry("map" , psample_proc_root); + remove_proc_entry("psample", knet_cb_proc_root); + remove_proc_entry("bcm/knet-cb", NULL); + remove_proc_entry("bcm", NULL); + return 0; +} + +int psample_init(void) +{ + #define PROCFS_MAX_PATH 1024 + char psample_procfs_path[PROCFS_MAX_PATH]; + struct proc_dir_entry *entry; + + /* initialize proc files (for ngknet) */ + proc_mkdir("bcm", NULL); + + /* create procfs for psample */ + snprintf(psample_procfs_path, PROCFS_MAX_PATH, "bcm/knet-cb"); + knet_cb_proc_root = proc_mkdir(psample_procfs_path, NULL); + snprintf(psample_procfs_path, PROCFS_MAX_PATH, "%s/%s", psample_procfs_path, PSAMPLE_CB_NAME); + psample_proc_root = proc_mkdir(psample_procfs_path, NULL); + + /* create procfs for psample stats */ + PROC_CREATE(entry, "stats", 0666, psample_proc_root, &psample_proc_stats_file_ops); + if (entry == NULL) { + printk("%s: Unable to create procfs entry '/procfs/%s/stats'\n", __func__, psample_procfs_path); + return -1; + } + + /* create procfs for setting sample rates */ + PROC_CREATE(entry, "rate", 0666, psample_proc_root, &psample_proc_rate_file_ops); + if (entry == NULL) { + printk("%s: Unable to create procfs entry '/procfs/%s/rate'\n", __func__, psample_procfs_path); + return -1; + } + + /* create procfs for setting sample size */ + PROC_CREATE(entry, "size", 0666, psample_proc_root, &psample_proc_size_file_ops); + if (entry == NULL) { + printk("%s: Unable to create procfs entry '/procfs/%s/size'\n", __func__, psample_procfs_path); + return -1; + } + + /* create procfs for getting netdev mapping */ + PROC_CREATE(entry, "map", 0666, psample_proc_root, &psample_proc_map_file_ops); + if (entry == NULL) { + printk("%s: Unable to create procfs entry '/procfs/%s/map'\n", __func__, psample_procfs_path); + return -1; + } + + /* create procfs for debug log */ + PROC_CREATE(entry, "debug", 0666, psample_proc_root, &psample_proc_debug_file_ops); + if (entry == NULL) { + printk("%s: Unable to create procfs entry '/procfs/%s/debug'\n", __func__, psample_procfs_path); + return -1; + } + + /* clear data structs */ + memset(&g_psample_stats, 0, sizeof(psample_stats_t)); + memset(&g_psample_info, 0, sizeof(psample_info_t)); + memset(&g_psample_work, 0, sizeof(psample_work_t)); + + /* FIXME: How to get DCB type from NGKNET? */ + //g_psample_info.dcb_type + + /* setup psample_info struct */ + INIT_LIST_HEAD(&g_psample_info.netif_list); + spin_lock_init(&g_psample_info.lock); + + /* setup psample work queue */ + spin_lock_init(&g_psample_work.lock); + INIT_LIST_HEAD(&g_psample_work.pkt_list); + INIT_WORK(&g_psample_work.wq, psample_task); + + /* get net namespace */ + g_psample_info.netns = get_net_ns_by_pid(current->pid); + if (!g_psample_info.netns) { + printk("%s: Could not get network namespace for pid %d\n", __func__, current->pid); + return (-1); + } + PSAMPLE_CB_DBG_PRINT("%s: current->pid %d, netns 0x%p, sample_size %d\n", __func__, + current->pid, g_psample_info.netns, psample_size); + + + return 0; +} diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/knetcb/psample-cb.h b/platform/broadcom/saibcm-modules/sdklt/linux/knetcb/psample-cb.h new file mode 100644 index 000000000000..2e3342ead5c3 --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/linux/knetcb/psample-cb.h @@ -0,0 +1,57 @@ +/* + * Copyright 2017 Broadcom + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation (the "GPL"). + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License version 2 (GPLv2) for more details. + * + * You should have received a copy of the GNU General Public License + * version 2 (GPLv2) along with this source code. + */ +/* + * $Id: psample_cb.h $ + * $Copyright: (c) 2019 Broadcom Corp. + * All Rights Reserved.$ + */ +#ifndef __PSAMPLE_CB_H__ +#define __PSAMPLE_CB_H__ + +#include +#include + +//#define PSAMPLE_SUPPORT 1 // TODO: MLI@BRCM - Add this as part of conditional in Makefile +#define PSAMPLE_CB_NAME "psample" + +extern int +psample_init(void); + +extern int +psample_cleanup(void); + +extern struct sk_buff* +psample_rx_cb(struct sk_buff *skb); + +/* psample data per interface */ +typedef struct { + struct list_head list; + struct net_device *dev; + uint16_t id; + uint8_t port; + uint16_t vlan; + uint16_t qnum; + uint32_t sample_rate; + uint32_t sample_size; +} psample_netif_t; + +extern int +psample_netif_create_cb(struct net_device *dev); + +extern int +psample_netif_destroy_cb(struct net_device *dev); + +#endif /* __PSAMPLE_CB_H__ */ diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/psample/Kbuild b/platform/broadcom/saibcm-modules/sdklt/linux/psample/Kbuild new file mode 100644 index 000000000000..0049e399076b --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/linux/psample/Kbuild @@ -0,0 +1,18 @@ +# -*- Kbuild -*- +# +# Linux psample module. +# +# $Copyright: (c) 2020 Broadcom. +# Broadcom Proprietary and Confidential. All rights reserved.$ +# + +obj-m := linux_psample.o + +ccflags-y := $(LKM_CFLAGS) \ + -I$(SDK)/shr/include \ + -I$(SDK)/bcmdrd/include \ + -I$(SDK)/linux/include \ + -I$(SDK)/linux/knet/include \ + -I$(SDK)/linux/knet + +linux_psample-y := psample.o diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/psample/Makefile b/platform/broadcom/saibcm-modules/sdklt/linux/psample/Makefile new file mode 100644 index 000000000000..b37b8ebb1c29 --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/linux/psample/Makefile @@ -0,0 +1,21 @@ +# -*- Makefile -*- +# +# Linux psample module. +# +# $Copyright: (c) 2020 Broadcom. +# Broadcom Proprietary and Confidential. All rights reserved.$ +# + +include Kbuild + +ifeq ($(KERNELRELEASE),) + +MOD_NAME = linux_psample + +include $(SDK)/make/lkm.mk + +endif + +.PHONY: distclean + +distclean: diff --git a/platform/broadcom/saibcm-modules/sdklt/linux/psample/psample.c b/platform/broadcom/saibcm-modules/sdklt/linux/psample/psample.c new file mode 100644 index 000000000000..f0c9beab5784 --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/linux/psample/psample.c @@ -0,0 +1,302 @@ +/* + * net/psample/psample.c - Netlink channel for packet sampling + * Copyright (c) 2017 Yotam Gigi + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define PSAMPLE_MAX_PACKET_SIZE 0xffff + +static LIST_HEAD(psample_groups_list); +static DEFINE_SPINLOCK(psample_groups_lock); + +/* multicast groups */ +enum psample_nl_multicast_groups { + PSAMPLE_NL_MCGRP_CONFIG, + PSAMPLE_NL_MCGRP_SAMPLE, +}; + +static const struct genl_multicast_group psample_nl_mcgrps[] = { + [PSAMPLE_NL_MCGRP_CONFIG] = { .name = PSAMPLE_NL_MCGRP_CONFIG_NAME }, + [PSAMPLE_NL_MCGRP_SAMPLE] = { .name = PSAMPLE_NL_MCGRP_SAMPLE_NAME }, +}; + +static struct genl_family psample_nl_family; + +static int psample_group_nl_fill(struct sk_buff *msg, + struct psample_group *group, + enum psample_command cmd, u32 portid, u32 seq, + int flags) +{ + void *hdr; + int ret; + + hdr = genlmsg_put(msg, portid, seq, &psample_nl_family, flags, cmd); + if (!hdr) + return -EMSGSIZE; + + ret = nla_put_u32(msg, PSAMPLE_ATTR_SAMPLE_GROUP, group->group_num); + if (ret < 0) + goto error; + + ret = nla_put_u32(msg, PSAMPLE_ATTR_GROUP_REFCOUNT, group->refcount); + if (ret < 0) + goto error; + + ret = nla_put_u32(msg, PSAMPLE_ATTR_GROUP_SEQ, group->seq); + if (ret < 0) + goto error; + + genlmsg_end(msg, hdr); + return 0; + +error: + genlmsg_cancel(msg, hdr); + return -EMSGSIZE; +} + +static int psample_nl_cmd_get_group_dumpit(struct sk_buff *msg, + struct netlink_callback *cb) +{ + struct psample_group *group; + int start = cb->args[0]; + int idx = 0; + int err; + + spin_lock(&psample_groups_lock); + list_for_each_entry(group, &psample_groups_list, list) { + if (!net_eq(group->net, sock_net(msg->sk))) + continue; + if (idx < start) { + idx++; + continue; + } + err = psample_group_nl_fill(msg, group, PSAMPLE_CMD_NEW_GROUP, + NETLINK_CB(cb->skb).portid, + cb->nlh->nlmsg_seq, NLM_F_MULTI); + if (err) + break; + idx++; + } + + spin_unlock(&psample_groups_lock); + cb->args[0] = idx; + return msg->len; +} + +static const struct genl_ops psample_nl_ops[] = { + { + .cmd = PSAMPLE_CMD_GET_GROUP, + .dumpit = psample_nl_cmd_get_group_dumpit, + /* can be retrieved by unprivileged users */ + } +}; + +static struct genl_family psample_nl_family = { + .name = PSAMPLE_GENL_NAME, + .version = PSAMPLE_GENL_VERSION, + .maxattr = PSAMPLE_ATTR_MAX, + .netnsok = true, + .module = THIS_MODULE, + .mcgrps = psample_nl_mcgrps, + .ops = psample_nl_ops, + .n_ops = ARRAY_SIZE(psample_nl_ops), + .n_mcgrps = ARRAY_SIZE(psample_nl_mcgrps), +}; + +static void psample_group_notify(struct psample_group *group, + enum psample_command cmd) +{ + struct sk_buff *msg; + int err; + + msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_ATOMIC); + if (!msg) + return; + + err = psample_group_nl_fill(msg, group, cmd, 0, 0, NLM_F_MULTI); + if (!err) + genlmsg_multicast_netns(&psample_nl_family, group->net, msg, 0, + PSAMPLE_NL_MCGRP_CONFIG, GFP_ATOMIC); + else + nlmsg_free(msg); +} + +static struct psample_group *psample_group_create(struct net *net, + u32 group_num) +{ + struct psample_group *group; + + group = kzalloc(sizeof(*group), GFP_ATOMIC); + if (!group) + return NULL; + + group->net = net; + group->group_num = group_num; + list_add_tail(&group->list, &psample_groups_list); + + psample_group_notify(group, PSAMPLE_CMD_NEW_GROUP); + return group; +} + +static void psample_group_destroy(struct psample_group *group) +{ + psample_group_notify(group, PSAMPLE_CMD_DEL_GROUP); + list_del(&group->list); + kfree(group); +} + +static struct psample_group * +psample_group_lookup(struct net *net, u32 group_num) +{ + struct psample_group *group; + + list_for_each_entry(group, &psample_groups_list, list) + if ((group->group_num == group_num) && (group->net == net)) + return group; + return NULL; +} + +struct psample_group *psample_group_get(struct net *net, u32 group_num) +{ + struct psample_group *group; + + spin_lock(&psample_groups_lock); + + group = psample_group_lookup(net, group_num); + if (!group) { + group = psample_group_create(net, group_num); + if (!group) + goto out; + } + group->refcount++; + +out: + spin_unlock(&psample_groups_lock); + return group; +} +EXPORT_SYMBOL_GPL(psample_group_get); + +void psample_group_put(struct psample_group *group) +{ + spin_lock(&psample_groups_lock); + + if (--group->refcount == 0) + psample_group_destroy(group); + + spin_unlock(&psample_groups_lock); +} +EXPORT_SYMBOL_GPL(psample_group_put); + +void psample_sample_packet(struct psample_group *group, struct sk_buff *skb, + u32 trunc_size, int in_ifindex, int out_ifindex, + u32 sample_rate) +{ + struct sk_buff *nl_skb; + int data_len; + int meta_len; + void *data; + int ret; + + meta_len = (in_ifindex ? nla_total_size(sizeof(u16)) : 0) + + (out_ifindex ? nla_total_size(sizeof(u16)) : 0) + + nla_total_size(sizeof(u32)) + /* sample_rate */ + nla_total_size(sizeof(u32)) + /* orig_size */ + nla_total_size(sizeof(u32)) + /* group_num */ + nla_total_size(sizeof(u32)); /* seq */ + + data_len = min(skb->len, trunc_size); + if (meta_len + nla_total_size(data_len) > PSAMPLE_MAX_PACKET_SIZE) + data_len = PSAMPLE_MAX_PACKET_SIZE - meta_len - NLA_HDRLEN + - NLA_ALIGNTO; + + nl_skb = genlmsg_new(meta_len + nla_total_size(data_len), GFP_ATOMIC); + if (unlikely(!nl_skb)) + return; + + data = genlmsg_put(nl_skb, 0, 0, &psample_nl_family, 0, + PSAMPLE_CMD_SAMPLE); + if (unlikely(!data)) + goto error; + + if (in_ifindex) { + ret = nla_put_u16(nl_skb, PSAMPLE_ATTR_IIFINDEX, in_ifindex); + if (unlikely(ret < 0)) + goto error; + } + + if (out_ifindex) { + ret = nla_put_u16(nl_skb, PSAMPLE_ATTR_OIFINDEX, out_ifindex); + if (unlikely(ret < 0)) + goto error; + } + + ret = nla_put_u32(nl_skb, PSAMPLE_ATTR_SAMPLE_RATE, sample_rate); + if (unlikely(ret < 0)) + goto error; + + ret = nla_put_u32(nl_skb, PSAMPLE_ATTR_ORIGSIZE, skb->len); + if (unlikely(ret < 0)) + goto error; + + ret = nla_put_u32(nl_skb, PSAMPLE_ATTR_SAMPLE_GROUP, group->group_num); + if (unlikely(ret < 0)) + goto error; + + ret = nla_put_u32(nl_skb, PSAMPLE_ATTR_GROUP_SEQ, group->seq++); + if (unlikely(ret < 0)) + goto error; + + if (data_len) { + int nla_len = nla_total_size(data_len); + struct nlattr *nla; + + nla = (struct nlattr *)skb_put(nl_skb, nla_len); + nla->nla_type = PSAMPLE_ATTR_DATA; + nla->nla_len = nla_attr_size(data_len); + + if (skb_copy_bits(skb, 0, nla_data(nla), data_len)) + goto error; + } + + genlmsg_end(nl_skb, data); + genlmsg_multicast_netns(&psample_nl_family, group->net, nl_skb, 0, + PSAMPLE_NL_MCGRP_SAMPLE, GFP_ATOMIC); + + return; +error: + pr_err_ratelimited("Could not create psample log message\n"); + nlmsg_free(nl_skb); +} +EXPORT_SYMBOL_GPL(psample_sample_packet); + +static int __init psample_module_init(void) +{ + return genl_register_family(&psample_nl_family); +} + +static void __exit psample_module_exit(void) +{ + genl_unregister_family(&psample_nl_family); +} + +module_init(psample_module_init); +module_exit(psample_module_exit); + +MODULE_AUTHOR("Yotam Gigi "); +MODULE_DESCRIPTION("netlink channel for packet sampling"); +MODULE_LICENSE("GPL v2"); diff --git a/platform/broadcom/saibcm-modules/sdklt/make/lkm.mk b/platform/broadcom/saibcm-modules/sdklt/make/lkm.mk new file mode 100644 index 000000000000..c3d2a4d40b50 --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/make/lkm.mk @@ -0,0 +1,76 @@ +# +# $Copyright: Copyright 2018-2020 Broadcom. All rights reserved. +# The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# version 2 as published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# A copy of the GNU General Public License version 2 (GPLv2) can +# be found in the LICENSES folder.$ +# +# Shared makefile include for building Linux kernel modules. +# + +# KDIR must point to the Linux kernel sources +ifndef KDIR +nokdir:; @echo 'The $$KDIR variable is not set'; exit 1 +endif + +# Required for older kernels +export EXTRA_CFLAGS = $(ccflags-y) + +PWD := $(shell pwd) + +ifneq ($(LKM_BLDDIR),) +# +# If a build directory has been specified, then we symlink all sources +# to this directory and redirect the module build path. +# +# Note that the KBUILD_OUTPUT variable cannot be used to redirect the +# output as we want it. +# +MDIR = $(LKM_BLDDIR) +MSRCS = $(patsubst %.o,%.c,$($(MOD_NAME)-y)) +MSRCS += Makefile Kbuild +BSRCS = $(addprefix $(PWD)/,$(MSRCS)) +else +# +# Build in current directory by default. +# +MDIR = $(PWD) +endif + +all: + $(Q)echo Building kernel module $(MOD_NAME) +ifneq ($(LKM_BLDDIR),) +ifneq ($(LKM_BLDDIR),$(PWD)) + $(Q)mkdir -p $(MDIR) + (cd $(MDIR); \ + rm -rf *.c Makefile Kbuild; \ + for f in $(BSRCS); do \ + ln -s $$f; \ + done) +endif +endif + $(MAKE) -C $(KDIR) M=$(MDIR) + +clean:: + $(Q)echo Cleaning kernel module $(MOD_NAME) + $(MAKE) -C $(KDIR) M=$(MDIR) clean +ifneq ($(LKM_BLDDIR),) +ifneq ($(LKM_BLDDIR),$(PWD)) +# Remove all files except for Makefile (needed by 'make clean') + rm -f $(LKM_BLDDIR)/*[cdors] +endif +endif + +.PHONY: all clean + +# Standard documentation targets +-include $(SDK)/make/doc.mk diff --git a/platform/broadcom/saibcm-modules/sdklt/shr/include/shr/shr_error.h b/platform/broadcom/saibcm-modules/sdklt/shr/include/shr/shr_error.h new file mode 100644 index 000000000000..1924d600de53 --- /dev/null +++ b/platform/broadcom/saibcm-modules/sdklt/shr/include/shr/shr_error.h @@ -0,0 +1,195 @@ +/*! \file shr_error.h + * + * Shared error codes. + * + */ +/* + * $Copyright: Copyright 2018-2020 Broadcom. All rights reserved. + * The term 'Broadcom' refers to Broadcom Inc. and/or its subsidiaries. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * A copy of the GNU General Public License version 2 (GPLv2) can + * be found in the LICENSES folder.$ + */ + +#ifndef SHR_ERROR_H +#define SHR_ERROR_H + +/*! + * \brief Standard SDK error codes. + * + * IMPORTANT: These error codes must match the corresponding text + * messages in shr_error.c. + */ +typedef enum { + + /*! + * The operation completed successfully. + */ + SHR_E_NONE = 0, + + /*! + * This usually indicates that software encountered an internal + * data inconsistency or an unanticipated hardware state. + */ + SHR_E_INTERNAL = -1, + + /*! + * An operation failed due to insufficient dynamically allocated + * memory. + */ + SHR_E_MEMORY = -2, + + /*! + * The first argument of many API routines is a unit number. This + * error occurs if that number refers to a non-existent unit. + */ + SHR_E_UNIT = -3, + + /*! + * A parameter to an API routine was invalid. A null pointer value + * may have been passed to the routine, or an integer parameter + * may be outside of its allowed range. + */ + SHR_E_PARAM = -4, + + /*! + * The operation encountered a pooled resource (e.g. a table or a + * list) with no valid elements. + */ + SHR_E_EMPTY = -5, + + /*! + * The operation encountered a pooled resource (e.g. a table or a + * list) with no room for new elements. + */ + SHR_E_FULL = -6, + + /*! + * The specified entry in a pooled resource (e.g. a table or a + * list) could not be found. + */ + SHR_E_NOT_FOUND = -7, + + /*! + * The specified entry of a pooled resource (e.g. a table or a + * list) already exists. + */ + SHR_E_EXISTS = -8, + + /*! + * The operation did not complete within the maximum allowed time frame. + */ + SHR_E_TIMEOUT = -9, + + /*! + * An operation was attempted before the previous operation had + * completed. + */ + SHR_E_BUSY = -10, + + /*! + * An operation could not be completed. This may be due to a + * hardware or configuration problem. + */ + SHR_E_FAIL = -11, + + /*! + * The operation could not be completed because a required feature + * was disabled. + */ + SHR_E_DISABLED = -12, + + /*! + * The specified identifier was not valid. Note that this error + * code will normally take precedence over \ref SHR_E_PARAM. + */ + SHR_E_BADID = -13, + + /*! + * The operation could not be completed due to lack of hardware + * resources. + */ + SHR_E_RESOURCE = -14, + + /*! + * The operation could not be completed due to incomplete or + * incorrect configuration. + */ + SHR_E_CONFIG = -15, + + /*! + * The hardware does not support the requested operation. + */ + SHR_E_UNAVAIL = -16, + + /*! + * An operation was attempted before initialization was complete. + */ + SHR_E_INIT = -17, + + /*! + * The specified port value was not valid. Note that this error + * code will normally take precedence over \ref SHR_E_PARAM. + */ + SHR_E_PORT = -18, + + /*! + * A low-level register or memory access failed. + */ + SHR_E_IO = -19, + + /*! + * Access method not permitted. Typically returned if attempting + * to write to a read-only object. + */ + SHR_E_ACCESS = -20, + + /*! + * No handler exists to perform the hardware access associated + * with a an operation on a software object. + */ + SHR_E_NO_HANDLER = -21, + + /*! + * The operation was only partially completed, and this could + * potentially leave the system in an unexpected state. + */ + SHR_E_PARTIAL = -22, + + /*! + * The operation failed because of a hash collision. + */ + SHR_E_COLL = -23, + + SHR_E_LIMIT = -24 /* Must come last */ + +} shr_error_t; + +/*! Check for successful return value. */ +#define SHR_SUCCESS(_expr) ((_expr) >= 0) + +/*! Check for error return value. */ +#define SHR_FAILURE(_expr) ((_expr) < 0) + +/*! + * \brief Get standard error message + * + * Returns a text message corresponding to the error code passed in. + * + * \param [in] rv Error code + * + * \return Pointer to error message + */ +extern const char * +shr_errmsg(int rv); + +#endif /* SHR_ERROR_H */ diff --git a/platform/broadcom/saibcm-modules/systems/bde/linux/include/linux-bde.h b/platform/broadcom/saibcm-modules/systems/bde/linux/include/linux-bde.h index bdf7a56dcabb..c4d31579bfdf 100644 --- a/platform/broadcom/saibcm-modules/systems/bde/linux/include/linux-bde.h +++ b/platform/broadcom/saibcm-modules/systems/bde/linux/include/linux-bde.h @@ -1,5 +1,10 @@ /* - * Copyright 2017 Broadcom + * Copyright 2007-2020 Broadcom Inc. All rights reserved. + * + * Permission is granted to use, copy, modify and/or distribute this + * software under either one of the licenses below. + * + * License Option 1: GPL * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License, version 2, as @@ -12,6 +17,12 @@ * * You should have received a copy of the GNU General Public License * version 2 (GPLv2) along with this source code. + * + * + * License Option 2: Broadcom Open Network Switch APIs (OpenNSA) license + * + * This software is governed by the Broadcom Open Network Switch APIs license: + * https://www.broadcom.com/products/ethernet-connectivity/software/opennsa */ /*********************************************************************** * @@ -58,7 +69,6 @@ #define __LINUX_BDE_H__ #include - #include @@ -104,12 +114,17 @@ /* Max devices */ /* 16 switch chips + 2 out-of-band Ethernet + 2 CPUs */ +#ifndef LINUX_BDE_MAX_SWITCH_DEVICES #define LINUX_BDE_MAX_SWITCH_DEVICES 16 +#endif #define LINUX_BDE_MAX_ETHER_DEVICES 2 #define LINUX_BDE_MAX_CPU_DEVICES 2 #define LINUX_BDE_MAX_DEVICES (LINUX_BDE_MAX_SWITCH_DEVICES + \ LINUX_BDE_MAX_ETHER_DEVICES + \ - LINUX_BDE_MAX_CPU_DEVICES) + LINUX_BDE_MAX_CPU_DEVICES) +#define LINUX_BDE_NOF_DEVICE_BITMAP_WORDS ((LINUX_BDE_MAX_DEVICES+31)/32) +#define LINUX_BDE_MAX_IPROC_UC_CORES 12 /* Maximum number of R5 cores per device */ +typedef uint32 linux_bde_device_bitmap_t[LINUX_BDE_NOF_DEVICE_BITMAP_WORDS]; /* * PCI devices will be initialized by the Linux Kernel, @@ -148,14 +163,24 @@ typedef struct linux_bde_bus_s { */ #define BDE_DEV_STATE_CHANGED (2) +/* + * BDE_DEV_INST_ID_INVALID : The invalid instance identifier. + */ +#define BDE_DEV_INST_ID_INVALID ((uint32)-1) + extern int linux_bde_create(linux_bde_bus_t* bus, ibde_t** bde); extern int linux_bde_destroy(ibde_t* bde); #ifdef BCM_INSTANCE_SUPPORT extern int linux_bde_instance_attach(unsigned int dev_mask,unsigned int dma_size); +extern int linux_bde_instance_config(linux_bde_device_bitmap_t dev_mask,unsigned int dma_size); #endif #ifdef __KERNEL__ +#ifdef INCLUDE_EDK +#define BDE_EDK_SUPPORT +#endif + /* * Backdoors provided by the kernel bde * @@ -171,6 +196,10 @@ extern int linux_bde_instance_attach(unsigned int dev_mask,unsigned int dma_size extern int lkbde_get_dma_info(phys_addr_t *cpu_pbase, phys_addr_t *dma_pbase, ssize_t *size); extern uint32 lkbde_get_dev_phys(int d); extern uint32 lkbde_get_dev_phys_hi(int d); +#ifdef BDE_EDK_SUPPORT +extern int lkbde_edk_get_dma_info(int dev_id, phys_addr_t* cpu_pbase, + phys_addr_t* dma_pbase, ssize_t* size); +#endif /* * Virtual device address needed by kernel space @@ -183,8 +212,8 @@ extern void *lkbde_get_dev_virt(int d); * the userland code to mmap. The following functions * supports multiple resources for a single device. */ -extern int lkbde_get_dev_resource(int d, int rsrc, uint32 *flags, - uint32 *phys_lo, uint32 *phys_hi); +extern int lkbde_get_dev_resource(int d, int rsrc, uint32_t *phys_lo, + uint32_t *phys_hi, uint32_t *size); /* * Backdoor to retrieve OS device structure to be used for @@ -215,6 +244,19 @@ extern int lkbde_dev_state_set(int d, uint32 state); extern int lkbde_dev_instid_get(int d, uint32 *instid); extern int lkbde_dev_instid_set(int d, uint32 instid); + +/* + * Return none-zero if the SDK instance with the given instance ID + * manages the given device. + */ +extern int lkbde_is_dev_managed_by_instance(uint32 dev, uint32 inst_id); + +/* + * Return a pointer to the bitmap of the SDK instance managed devices. + */ +extern linux_bde_device_bitmap_t* lkbde_get_inst_devs(uint32 inst_id); + + /* * Functions that allow an interrupt handler in user mode to * coexist with interrupt handler in kernel module. @@ -256,13 +298,6 @@ extern int lkbde_cpu_pci_register(int d); #endif #endif -/* Don't use _SIMPLE_MEMORY_ALLOCATION_ method for newer kernel than 3.10.0 */ -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)) -#ifndef _SIMPLE_MEMORY_ALLOCATION_ -#define _SIMPLE_MEMORY_ALLOCATION_ 0 -#endif -#endif - /* Allocation via dma_alloc_coherent is turned off by default */ #ifndef _SIMPLE_MEMORY_ALLOCATION_ #define _SIMPLE_MEMORY_ALLOCATION_ 9 /* compile in the allocation method, but do not use it by default */ diff --git a/platform/broadcom/saibcm-modules/systems/bde/linux/include/linux_dma.h b/platform/broadcom/saibcm-modules/systems/bde/linux/include/linux_dma.h index 3bf7488abce9..23eb3fa33e9e 100644 --- a/platform/broadcom/saibcm-modules/systems/bde/linux/include/linux_dma.h +++ b/platform/broadcom/saibcm-modules/systems/bde/linux/include/linux_dma.h @@ -1,5 +1,10 @@ /* - * Copyright 2017 Broadcom + * Copyright 2007-2020 Broadcom Inc. All rights reserved. + * + * Permission is granted to use, copy, modify and/or distribute this + * software under either one of the licenses below. + * + * License Option 1: GPL * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License, version 2, as @@ -12,6 +17,12 @@ * * You should have received a copy of the GNU General Public License * version 2 (GPLv2) along with this source code. + * + * + * License Option 2: Broadcom Open Network Switch APIs (OpenNSA) license + * + * This software is governed by the Broadcom Open Network Switch APIs license: + * https://www.broadcom.com/products/ethernet-connectivity/software/opennsa */ /*********************************************************************** * @@ -60,7 +71,7 @@ extern void _dma_init(int dev_index); extern int _dma_cleanup(void); -extern void _dma_pprint(void); +extern void _dma_pprint(struct seq_file *m); extern uint32_t *_salloc(int d, int size, const char *name); extern void _sfree(int d, void *ptr); extern int _sinval(int d, void *ptr, int length); diff --git a/platform/broadcom/saibcm-modules/systems/bde/linux/include/mpool.h b/platform/broadcom/saibcm-modules/systems/bde/linux/include/mpool.h index be4d436f8da9..15d496ff623d 100644 --- a/platform/broadcom/saibcm-modules/systems/bde/linux/include/mpool.h +++ b/platform/broadcom/saibcm-modules/systems/bde/linux/include/mpool.h @@ -1,5 +1,10 @@ /* - * Copyright 2017 Broadcom + * Copyright 2007-2020 Broadcom Inc. All rights reserved. + * + * Permission is granted to use, copy, modify and/or distribute this + * software under either one of the licenses below. + * + * License Option 1: GPL * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License, version 2, as @@ -12,6 +17,12 @@ * * You should have received a copy of the GNU General Public License * version 2 (GPLv2) along with this source code. + * + * + * License Option 2: Broadcom Open Network Switch APIs (OpenNSA) license + * + * This software is governed by the Broadcom Open Network Switch APIs license: + * https://www.broadcom.com/products/ethernet-connectivity/software/opennsa */ /* * $Id: mpool.h,v 1.2 Broadcom SDK $ diff --git a/platform/broadcom/saibcm-modules/systems/bde/linux/kernel/Makefile b/platform/broadcom/saibcm-modules/systems/bde/linux/kernel/Makefile index cfd72d3a9216..2aa3bec11d73 100644 --- a/platform/broadcom/saibcm-modules/systems/bde/linux/kernel/Makefile +++ b/platform/broadcom/saibcm-modules/systems/bde/linux/kernel/Makefile @@ -1,5 +1,10 @@ # -# Copyright 2017 Broadcom +# Copyright 2007-2020 Broadcom Inc. All rights reserved. +# +# Permission is granted to use, copy, modify and/or distribute this +# software under either one of the licenses below. +# +# License Option 1: GPL # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License, version 2, as @@ -12,6 +17,12 @@ # # You should have received a copy of the GNU General Public License # version 2 (GPLv2) along with this source code. +# +# +# License Option 2: Broadcom Open Network Switch APIs (OpenNSA) license +# +# This software is governed by the Broadcom Open Network Switch APIs license: +# https://www.broadcom.com/products/ethernet-connectivity/software/opennsa # # -*- Makefile -*- # $Id: Makefile,v 1.18 Broadcom SDK $ diff --git a/platform/broadcom/saibcm-modules/systems/bde/linux/kernel/linux-kernel-bde.c b/platform/broadcom/saibcm-modules/systems/bde/linux/kernel/linux-kernel-bde.c index 3a60ac4dd54e..9029b3b51477 100644 --- a/platform/broadcom/saibcm-modules/systems/bde/linux/kernel/linux-kernel-bde.c +++ b/platform/broadcom/saibcm-modules/systems/bde/linux/kernel/linux-kernel-bde.c @@ -339,10 +339,19 @@ typedef struct bde_ctrl_s { uint32 dev_state; /* inst_id */ - uint32 inst_id; + uint32 inst_id; /* The instance ID of the instance controlling the device */ } bde_ctrl_t; static bde_ctrl_t _devices[LINUX_BDE_MAX_DEVICES]; + +/* information stored per SDK instance, curently the devices it manages */ +typedef struct { + linux_bde_device_bitmap_t devices; /* The devices controlled by this instance */ +} lkbde_inst_info_t; + +/* Information for each SDK instance (array index), the device that it manages */ +static lkbde_inst_info_t _instance_info[LINUX_BDE_MAX_DEVICES] = {{ .devices = {0}}}; + static int _ndevices = 0; static int _switch_ndevices = 0; static int _ether_ndevices = 0; @@ -810,6 +819,25 @@ iproc_cmicd_probe(struct platform_device *pldev) static int iproc_cmicd_remove(struct platform_device *pldev) { + int i; + uint32 mask = BDE_SWITCH_DEV_TYPE | BDE_AXI_DEV_TYPE; + bde_ctrl_t *ctrl; + + for (i = 0; i < _ndevices; i++) { + ctrl = _devices + i; + if ((ctrl->dev_type & mask) == mask) { + if (ctrl->bde_dev.base_address1) { + iounmap((void *)ctrl->bde_dev.base_address1); + ctrl->bde_dev.base_address1 = 0; + } + + if (ctrl->bde_dev.base_address) { + iounmap((void *)ctrl->bde_dev.base_address); + ctrl->bde_dev.base_address = 0; + } + } + } + return 0; } #ifdef CONFIG_OF @@ -1429,6 +1457,7 @@ static const struct pci_device_id _id_table[] = { { BROADCOM_VENDOR_ID, BCM53575_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM56070_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM56071_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, + { BROADCOM_VENDOR_ID, BCM56072_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9656, PCI_ANY_ID, PCI_ANY_ID }, { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9056, PCI_ANY_ID, PCI_ANY_ID }, { BCM53000_VENDOR_ID, BCM53000PCIE_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, @@ -1474,9 +1503,11 @@ static const struct pci_device_id _id_table[] = { { BROADCOM_VENDOR_ID, BCM88270_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, + { BROADCOM_VENDOR_ID, BCM88271_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM88272_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM88273_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM88274_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, + { BROADCOM_VENDOR_ID, BCM88276_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM88278_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM88279_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, @@ -1496,7 +1527,6 @@ static const struct pci_device_id _id_table[] = { { BROADCOM_VENDOR_ID, BCM88687_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM88380_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM88381_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, - { BROADCOM_VENDOR_ID, BCM88202_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM88360_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM88361_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM88363_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, @@ -1527,18 +1557,37 @@ static const struct pci_device_id _id_table[] = { { BROADCOM_VENDOR_ID, BCM8869E_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM8869F_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM88800_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, - { BROADCOM_VENDOR_ID, BCM88821_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, - { BROADCOM_VENDOR_ID, BCM88826_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, + { BROADCOM_VENDOR_ID, BCM88801_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM88802_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM88803_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM88804_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM88805_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM88806_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, + { BROADCOM_VENDOR_ID, BCM88807_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, + { BROADCOM_VENDOR_ID, BCM88808_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, + { BROADCOM_VENDOR_ID, BCM88809_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, + { BROADCOM_VENDOR_ID, BCM8880A_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, + { BROADCOM_VENDOR_ID, BCM8880B_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, + { BROADCOM_VENDOR_ID, BCM8880C_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, + { BROADCOM_VENDOR_ID, BCM8880D_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, + { BROADCOM_VENDOR_ID, BCM8880E_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, + { BROADCOM_VENDOR_ID, BCM8880F_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM88820_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, + { BROADCOM_VENDOR_ID, BCM88821_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM88822_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM88823_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM88824_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM88825_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, + { BROADCOM_VENDOR_ID, BCM88826_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, + { BROADCOM_VENDOR_ID, BCM88827_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, + { BROADCOM_VENDOR_ID, BCM88828_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, + { BROADCOM_VENDOR_ID, BCM88829_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, + { BROADCOM_VENDOR_ID, BCM8882A_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, + { BROADCOM_VENDOR_ID, BCM8882B_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, + { BROADCOM_VENDOR_ID, BCM8882C_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, + { BROADCOM_VENDOR_ID, BCM8882D_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, + { BROADCOM_VENDOR_ID, BCM8882E_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, + { BROADCOM_VENDOR_ID, BCM8882F_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM88480_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM88481_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM88482_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, @@ -1555,12 +1604,40 @@ static const struct pci_device_id _id_table[] = { { BROADCOM_VENDOR_ID, BCM8848D_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM8848E_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM8848F_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, + { BROADCOM_VENDOR_ID, BCM88280_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, + { BROADCOM_VENDOR_ID, BCM88281_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, + { BROADCOM_VENDOR_ID, BCM88282_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, + { BROADCOM_VENDOR_ID, BCM88283_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, + { BROADCOM_VENDOR_ID, BCM88284_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, + { BROADCOM_VENDOR_ID, BCM88285_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, + { BROADCOM_VENDOR_ID, BCM88286_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, + { BROADCOM_VENDOR_ID, BCM88287_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, + { BROADCOM_VENDOR_ID, BCM88288_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, + { BROADCOM_VENDOR_ID, BCM88289_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, + { BROADCOM_VENDOR_ID, BCM8828A_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, + { BROADCOM_VENDOR_ID, BCM8828B_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, + { BROADCOM_VENDOR_ID, BCM8828C_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, + { BROADCOM_VENDOR_ID, BCM8828D_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, + { BROADCOM_VENDOR_ID, BCM8828E_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, + { BROADCOM_VENDOR_ID, BCM8828F_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM88850_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, + { BROADCOM_VENDOR_ID, BCM88851_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, + { BROADCOM_VENDOR_ID, BCM88852_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, + { BROADCOM_VENDOR_ID, BCM88853_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, + { BROADCOM_VENDOR_ID, BCM88854_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, + { BROADCOM_VENDOR_ID, BCM88855_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, + { BROADCOM_VENDOR_ID, BCM88856_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, + { BROADCOM_VENDOR_ID, BCM88857_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, + { BROADCOM_VENDOR_ID, BCM88858_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, + { BROADCOM_VENDOR_ID, BCM88859_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, + { BROADCOM_VENDOR_ID, BCM8885A_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, + { BROADCOM_VENDOR_ID, BCM8885B_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, + { BROADCOM_VENDOR_ID, BCM8885C_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, + { BROADCOM_VENDOR_ID, BCM8885D_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, + { BROADCOM_VENDOR_ID, BCM8885E_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, + { BROADCOM_VENDOR_ID, BCM8885F_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, #endif /* BCM_DNX_SUPPORT */ #ifdef BCM_DFE_SUPPORT - { BROADCOM_VENDOR_ID, BCM88750_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, - { BROADCOM_VENDOR_ID, BCM88753_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, - { BROADCOM_VENDOR_ID, BCM88755_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM88770_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM88773_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM88774_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, @@ -1574,7 +1651,6 @@ static const struct pci_device_id _id_table[] = { { BROADCOM_VENDOR_ID, BCM88954_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM88955_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM88956_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, - { BROADCOM_VENDOR_ID, BCM88752_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM88772_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM88952_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, #endif @@ -1613,6 +1689,10 @@ static const struct pci_device_id _id_table[] = { { BROADCOM_VENDOR_ID, BCM56276_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM56277_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM56278_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, + { BROADCOM_VENDOR_ID, BCM56279_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, + { BROADCOM_VENDOR_ID, BCM56575_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, + { BROADCOM_VENDOR_ID, BCM56175_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, + { BROADCOM_VENDOR_ID, BCM56176_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM56370_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM56371_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM56372_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, @@ -1638,6 +1718,7 @@ static const struct pci_device_id _id_table[] = { { BROADCOM_VENDOR_ID, BCM56470_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM56471_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { BROADCOM_VENDOR_ID, BCM56472_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, + { BROADCOM_VENDOR_ID, BCM56475_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID }, { 0, 0, 0, 0 } };; @@ -2540,9 +2621,6 @@ _pci_probe(struct pci_dev *dev, const struct pci_device_id *ent) #if defined(BCM_DFE_SUPPORT) switch (dev->device) { - case BCM88750_DEVICE_ID: - case BCM88753_DEVICE_ID: - case BCM88755_DEVICE_ID: case BCM88770_DEVICE_ID: case BCM88773_DEVICE_ID: case BCM88774_DEVICE_ID: @@ -2554,7 +2632,6 @@ _pci_probe(struct pci_dev *dev, const struct pci_device_id *ent) case BCM88954_DEVICE_ID: case BCM88955_DEVICE_ID: case BCM88956_DEVICE_ID: - case BCM88752_DEVICE_ID: case BCM88772_DEVICE_ID: case BCM88952_DEVICE_ID: @@ -2801,9 +2878,10 @@ _pci_remove(struct pci_dev* dev) } static struct pci_driver _device_driver = { - probe: _pci_probe, - remove: _pci_remove, - id_table: _id_table, + .name = LINUX_KERNEL_BDE_NAME, + .probe = _pci_probe, + .remove = _pci_remove, + .id_table = _id_table, /* The rest are dynamic */ }; @@ -2978,7 +3056,13 @@ probe_plx_local_bus(void) static int _init(void) { + unsigned i; #ifdef IPROC_CMICD + /* + * Adjust the PCI driver name to prevent our device file from + * getting removed when the module is unloaded. + */ + _device_driver.name = LINUX_KERNEL_BDE_NAME ".iproc"; #ifdef CONFIG_OF if (of_find_compatible_node(NULL, NULL, IPROC_CMICX_COMPATIBLE)) { iproc_platform_driver_register(&iproc_cmicd_driver); @@ -3000,9 +3084,6 @@ _init(void) #ifdef BCM_ICS _ics_bde_create(); #else /* PCI */ - /* Register our goodies */ - _device_driver.name = LINUX_KERNEL_BDE_NAME; - /* Configure MSI interrupt support */ use_msi = usemsi; @@ -3078,6 +3159,10 @@ _init(void) } } + for (i = 0; i < LINUX_BDE_MAX_DEVICES; ++i) { + _devices[i].inst_id = BDE_DEV_INST_ID_INVALID; + } + return 0; } @@ -3150,45 +3235,45 @@ _cleanup(void) * Always 0 */ static int -_pprint(void) +_pprint(struct seq_file *m) { int i = 0; - pprintf("Broadcom Device Enumerator (%s)\n", LINUX_KERNEL_BDE_NAME); + pprintf(m, "Broadcom Device Enumerator (%s)\n", LINUX_KERNEL_BDE_NAME); - pprintf("Module parameters:\n"); - pprintf("\tmaxpayload=%d\n", maxpayload); - pprintf("\tusemsi=%d\n", usemsi); + pprintf(m, "Module parameters:\n"); + pprintf(m, "\tmaxpayload=%d\n", maxpayload); + pprintf(m, "\tusemsi=%d\n", usemsi); - _dma_pprint(); + _dma_pprint(m); if (_ndevices == 0) { - pprintf("No devices found\n"); + pprintf(m, "No devices found\n"); } else { - pprintf("Devices:\n"); + pprintf(m, "Devices:\n"); } for (i = 0; i < _ndevices; i++) { bde_ctrl_t *ctrl = _devices + i; if (ctrl->dev_type & BDE_SWITCH_DEV_TYPE) { - pprintf("\t%d (swi) : ", i); + pprintf(m, "\t%d (swi) : ", i); } else if (ctrl->dev_type & BDE_ETHER_DEV_TYPE) { - pprintf("\t%d (eth) : ", i); + pprintf(m, "\t%d (eth) : ", i); } else if (ctrl->dev_type & BDE_CPU_DEV_TYPE) { - pprintf("\t%d (cpu) : ", i); + pprintf(m, "\t%d (cpu) : ", i); } else { - pprintf("\t%d (?) : ", i); + pprintf(m, "\t%d (?) : ", i); } if (ctrl->dev_state == BDE_DEV_STATE_REMOVED) { - pprintf("PCI device 0x%x:0x%x:%d REMOVED\n", + pprintf(m, "PCI device 0x%x:0x%x:%d REMOVED\n", ctrl->pci_device->vendor, ctrl->pci_device->device, ctrl->bde_dev.rev); continue; } if (ctrl->dev_type & BDE_PCI_DEV_TYPE) { - pprintf("PCI device %02x:%02x.%x 0x%x:0x%x:%d:0x%.8lx:0x%.8lx:%d%s\n", + pprintf(m, "PCI device %02x:%02x.%x 0x%x:0x%x:%d:0x%.8lx:0x%.8lx:%d%s\n", (unsigned int)ctrl->pci_device->bus->number, PCI_SLOT(ctrl->pci_device->devfn), PCI_FUNC(ctrl->pci_device->devfn), @@ -3200,7 +3285,7 @@ _pprint(void) ctrl->pci_device->irq, ctrl->use_msi ? " (MSI)" : ""); } else if (ctrl->dev_type & BDE_SPI_DEV_TYPE) { - pprintf("SPI Device %d:%x:%x:0x%x:0x%x:%d\n", + pprintf(m, "SPI Device %d:%x:%x:0x%x:0x%x:%d\n", ctrl->spi_device->cid, ctrl->spi_device->part, ctrl->spi_device->rev, @@ -3208,26 +3293,35 @@ _pprint(void) ctrl->spi_device->phyid_low, ctrl->bde_dev.rev); } else if (ctrl->dev_type & BDE_ICS_DEV_TYPE) { - pprintf("ICS Device 0x%x:0x%x\n", + pprintf(m, "ICS Device 0x%x:0x%x\n", ctrl->bde_dev.device, ctrl->bde_dev.rev); } else if (ctrl->dev_type & BDE_AXI_DEV_TYPE) { - pprintf("AXI Device 0x%x:0x%x:0x%.8lx:%d\n", + pprintf(m, "AXI Device 0x%x:0x%x:0x%.8lx:%d\n", ctrl->bde_dev.device, ctrl->bde_dev.rev, (unsigned long)ctrl->iowin[0].addr, ctrl->iLine); } else if (ctrl->dev_type & BDE_EB_DEV_TYPE) { - pprintf("EB Bus Device 0x%x:0x%x\n", + pprintf(m, "EB Bus Device 0x%x:0x%x\n", ctrl->bde_dev.device, ctrl->bde_dev.rev); } if (debug >= 1) { - pprintf("\t\timask:imask2:fmask 0x%x:0x%x:0x%x\n", + pprintf(m, "\t\timask:imask2:fmask 0x%x:0x%x:0x%x\n", ctrl->imask, ctrl->imask2, ctrl->fmask); } + if (debug >= 1) { + if (ctrl->inst_id == BDE_DEV_INST_ID_INVALID) { + pprintf(m, "\t\tinst_id INVALID\n"); + } else { + pprintf(m, "\t\tinst_id %u%s\n", + ctrl->inst_id, + ctrl->inst_id < LINUX_BDE_MAX_DEVICES ? "":"(Illegal)"); + } + } } return 0; } @@ -3952,9 +4046,6 @@ lkbde_cpu_pci_register(int d) pci_write_config_byte(ctrl->pci_device, 0x88, 0x2f); pci_write_config_byte(ctrl->pci_device, 0x89, 0x10); break; - case BCM88750_DEVICE_ID: - case BCM88753_DEVICE_ID: - case BCM88755_DEVICE_ID: case BCM88770_DEVICE_ID: case BCM88773_DEVICE_ID: case BCM88774_DEVICE_ID: @@ -3966,7 +4057,6 @@ lkbde_cpu_pci_register(int d) case BCM88954_DEVICE_ID: case BCM88955_DEVICE_ID: case BCM88956_DEVICE_ID: - case BCM88752_DEVICE_ID: case BCM88772_DEVICE_ID: case BCM88952_DEVICE_ID: case ACP_PCI_DEVICE_ID: @@ -4013,9 +4103,11 @@ lkbde_cpu_pci_register(int d) case BCM88476_DEVICE_ID: case BCM88477_DEVICE_ID: case BCM88270_DEVICE_ID: + case BCM88271_DEVICE_ID: case BCM88272_DEVICE_ID: case BCM88273_DEVICE_ID: case BCM88274_DEVICE_ID: + case BCM88276_DEVICE_ID: case BCM88278_DEVICE_ID: case BCM8206_DEVICE_ID: case BCM88350_DEVICE_ID: @@ -4061,6 +4153,7 @@ lkbde_cpu_pci_register(int d) case J2C_DEVICE_ID: case J2C_2ND_DEVICE_ID: case Q2A_DEVICE_ID: + case Q2U_DEVICE_ID: case J2P_DEVICE_ID: #endif #ifdef BCM_DNXF_SUPPORT @@ -4277,14 +4370,14 @@ lkbde_get_dev_virt(int d) } int -lkbde_get_dev_resource(int d, int rsrc, uint32_t *flags, - uint32_t *phys_lo, uint32_t *phys_hi) +lkbde_get_dev_resource(int d, int rsrc, uint32_t *phys_lo, + uint32_t *phys_hi, uint32_t *size) { if (!VALID_DEVICE(d)) { return -1; } - *flags = 0; + *size = 0; *phys_lo = 0; *phys_hi = 0; @@ -4300,12 +4393,14 @@ lkbde_get_dev_resource(int d, int rsrc, uint32_t *flags, #ifdef PHYS_ADDR_IS_64BIT *phys_hi = (uint32_t)(_devices[d].iowin[0].addr >> 32); #endif + *size = _devices[d].iowin[0].size; break; case 1: *phys_lo = (uint32_t)(_devices[d].iowin[1].addr); #ifdef PHYS_ADDR_IS_64BIT *phys_hi = (uint32_t)(_devices[d].iowin[1].addr >> 32); #endif + *size = _devices[d].iowin[1].size; break; default: break; @@ -4431,7 +4526,7 @@ lkbde_irq_mask_set(int d, uint32_t addr, uint32_t mask, uint32_t fmask) if (iproc_reg) { _iproc_write(d, addr, ctrl->imask | ctrl->imask2); } else { - _write(d, addr, ctrl->imask | ctrl->imask2); + _write(d, addr, ctrl->imask | ctrl->imask2); } spin_unlock_irqrestore(&ctrl->lock, flags); @@ -4481,6 +4576,29 @@ lkbde_get_num_devices(int type) return _num_devices(type); } +/* + * Return none-zero if the SDK instance with the given instance ID + * manages the given device. + */ +int lkbde_is_dev_managed_by_instance(uint32 dev, uint32 inst_id) +{ + if (inst_id >= LINUX_BDE_MAX_DEVICES || dev >= _ndevices) { + return 0; + } + return _instance_info[inst_id].devices[dev / 32] & (1 << (dev % 32)) ? 1 : 0; +} + +/* + * Return a pointer to the bitmap of the SDK instance managed devices. + */ +linux_bde_device_bitmap_t* lkbde_get_inst_devs(uint32 inst_id) +{ + if (inst_id >= LINUX_BDE_MAX_DEVICES) { + return NULL; + } + return &_instance_info[inst_id].devices; +} + /* * Export functions */ @@ -4503,3 +4621,5 @@ LKM_EXPORT_SYM(lkbde_cpu_write); LKM_EXPORT_SYM(lkbde_cpu_read); LKM_EXPORT_SYM(lkbde_cpu_pci_register); #endif +LKM_EXPORT_SYM(lkbde_is_dev_managed_by_instance); +LKM_EXPORT_SYM(lkbde_get_inst_devs); diff --git a/platform/broadcom/saibcm-modules/systems/bde/linux/kernel/linux_dma.c b/platform/broadcom/saibcm-modules/systems/bde/linux/kernel/linux_dma.c index 4f9518e9f4a9..52711964a533 100644 --- a/platform/broadcom/saibcm-modules/systems/bde/linux/kernel/linux_dma.c +++ b/platform/broadcom/saibcm-modules/systems/bde/linux/kernel/linux_dma.c @@ -1,5 +1,10 @@ /* - * Copyright 2017 Broadcom + * Copyright 2007-2020 Broadcom Inc. All rights reserved. + * + * Permission is granted to use, copy, modify and/or distribute this + * software under either one of the licenses below. + * + * License Option 1: GPL * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License, version 2, as @@ -12,6 +17,12 @@ * * You should have received a copy of the GNU General Public License * version 2 (GPLv2) along with this source code. + * + * + * License Option 2: Broadcom Open Network Switch APIs (OpenNSA) license + * + * This software is governed by the Broadcom Open Network Switch APIs license: + * https://www.broadcom.com/products/ethernet-connectivity/software/opennsa */ /* * $Id: linux_dma.c,v 1.414 Broadcom SDK $ @@ -78,9 +89,10 @@ /* allocation types/methods for the DMA memory pool */ #define ALLOC_TYPE_CHUNK 0 /* use small allocations and join them */ #define ALLOC_TYPE_API 1 /* use one allocation */ + #if _SIMPLE_MEMORY_ALLOCATION_ #include -#if defined(IPROC_CMICD) && defined(CONFIG_CMA) && defined(CONFIG_CMA_SIZE_MBYTES) +#if defined(CONFIG_CMA) && defined(CONFIG_CMA_SIZE_MBYTES) #define DMA_MAX_ALLOC_SIZE (CONFIG_CMA_SIZE_MBYTES * 1024 * 1024) #else #define DMA_MAX_ALLOC_SIZE (1 << (MAX_ORDER - 1 + PAGE_SHIFT)) /* Maximum size the kernel can allocate in one allocation */ @@ -88,6 +100,7 @@ #endif /* _SIMPLE_MEMORY_ALLOCATION_ */ #if _SIMPLE_MEMORY_ALLOCATION_ == 1 +/* Use Linux DMA API to allocate contiguous memory */ #define ALLOC_METHOD_DEFAULT ALLOC_TYPE_API #if defined(__arm__) #define USE_DMA_MMAP_COHERENT @@ -196,6 +209,17 @@ MODULE_PARM_DESC(himemaddr, #define DMA_MEM_DEFAULT (8 * ONE_MB) #endif +#ifdef BDE_EDK_SUPPORT +typedef struct { + phys_addr_t cpu_pbase; /* CPU physical base address of the DMA pool */ + phys_addr_t dma_pbase; /* Bus base address of the DMA pool */ + void __iomem *dma_vbase; + uint32 size; /* Total size of the pool */ +}_edk_dma_pool_t; +static _edk_dma_pool_t _edk_dma_pool[LINUX_BDE_MAX_DEVICES]; +static int _edk_use_dma_mapping = 0; +#endif + /* We try to assemble a contiguous segment from chunks of this size */ #define DMA_BLOCK_SIZE (512 * ONE_KB) @@ -552,18 +576,145 @@ _pgfree(void *ptr) return -1; } +#ifdef BDE_EDK_SUPPORT +/* + * Function: _edk_mpool_free + * + * Purpose: + * Free all memory allocated by _adk_mpool_alloc + * Parameters: + * None + * Returns: + * Nothing. + */ +static void +_edk_mpool_free(void) +{ + int i, ndevices; + + ndevices = BDE_NUM_DEVICES(BDE_SWITCH_DEVICES); + for (i = 0; i < ndevices && DMA_DEV(i); i ++) { + if (_edk_dma_pool[i].dma_vbase) { + if (_edk_use_dma_mapping) { + dma_unmap_single(DMA_DEV(i), (dma_addr_t)_edk_dma_pool[i].dma_pbase, + _edk_dma_pool[i].size, DMA_BIDIRECTIONAL); + } + _pgfree(_edk_dma_pool[i].dma_vbase); + _edk_dma_pool[i].dma_vbase = NULL; + } + } + _edk_use_dma_mapping = 0; +} + +/* + * Function: edk_mpool_alloc + * + * Purpose: + * Allocate DMA memory pool for EDK + * Parameters: + * size - size of DMA memory pool + * Returns: + * Nothing. + */ +static void +_edk_mpool_alloc(int dev_id, size_t size) +{ + static void __iomem *dma_vbase = NULL; + static phys_addr_t cpu_pbase = 0; + static phys_addr_t dma_pbase = 0; + + struct device *dev = DMA_DEV(DMA_DEV_INDEX); + unsigned long pbase = 0; + + dma_vbase = _pgalloc(size); + if (!dma_vbase) { + gprintk("Failed to allocate memory pool of size 0x%lx for EDK\n", + (unsigned long)size); + return; + } + cpu_pbase = virt_to_bus(dma_vbase); + + /* Use dma_map_single to obtain DMA bus address or IOVA if IOMMU is present. */ + if (dev) { + pbase = dma_map_single(dev, dma_vbase, size, DMA_BIDIRECTIONAL); + if (BDE_DMA_MAPPING_ERROR(dev, pbase)) { + gprintk("Failed to map memory at %p for EDK\n", dma_vbase); + _pgfree(dma_vbase); + dma_vbase = NULL; + return; + } + _edk_use_dma_mapping = 1; + } else { + pbase = cpu_pbase; + } + + dma_pbase = pbase; + +#ifdef REMAP_DMA_NONCACHED + _dma_vbase = IOREMAP(dma_pbase, size); +#endif + _edk_dma_pool[dev_id].cpu_pbase = cpu_pbase; + _edk_dma_pool[dev_id].dma_pbase = dma_pbase; + _edk_dma_pool[dev_id].dma_vbase = dma_vbase; + _edk_dma_pool[dev_id].size = size; +} + +int +lkbde_edk_get_dma_info(int dev_id, phys_addr_t* cpu_pbase, phys_addr_t* dma_pbase, ssize_t* size) +{ + if (_edk_dma_pool[dev_id].dma_vbase == NULL) { + _edk_mpool_alloc(dev_id, *size * ONE_MB); + } + + if (cpu_pbase) { + *cpu_pbase = _edk_dma_pool[dev_id].cpu_pbase; + } + + if (dma_pbase) { + *dma_pbase = _edk_dma_pool[dev_id].dma_pbase; + } + + *size = (_edk_dma_pool[dev_id].dma_vbase) ? _edk_dma_pool[dev_id].size : 0; + return 0; +} + /* - * Function: _pgcleanup + * The below function validates the memory to the EDK allocated DMA pool, + * required to user space via the BDE device file. + */ +static int +_edk_vm_is_valid(struct file *filp, struct vm_area_struct *vma) +{ + unsigned long phys_addr = vma->vm_pgoff << PAGE_SHIFT; + unsigned long size = vma->vm_end - vma->vm_start; + int i, ndevices; + + ndevices = BDE_NUM_DEVICES(BDE_SWITCH_DEVICES); + for (i = 0; i < ndevices; i++) { + if (phys_addr < (unsigned long )_edk_dma_pool[i].cpu_pbase || + (phys_addr + size) > ((unsigned long )_edk_dma_pool[i].cpu_pbase + + _edk_dma_pool[i].size)) { + continue; + } + return 1; + } + + return 0; +} +#endif + +/* + * Function: _mpool_free * * Purpose: - * Free all memory allocated by _pgalloc + * Free all memory allocated by _mpool_alloc * Parameters: * None * Returns: * Nothing. */ static void -_pgcleanup(void) +_mpool_free(void) { switch (dmaalloc) { #if _SIMPLE_MEMORY_ALLOCATION_ @@ -599,7 +750,7 @@ _pgcleanup(void) } /* - * Function: _alloc_mpool + * Function: _mpool_alloc * * Purpose: * Allocate DMA memory pool @@ -613,7 +764,7 @@ _pgcleanup(void) * It is assumed there is only one pool. */ static void -_alloc_mpool(size_t size) +_mpool_alloc(size_t size) { unsigned long pbase = 0; struct device *dev = DMA_DEV(DMA_DEV_INDEX); @@ -643,7 +794,22 @@ _alloc_mpool(size_t size) gprintk("DMA in high memory at 0x%lx size 0x%lx is beyond the 4GB limit and not supported.\n", pbase, (unsigned long)size); return; } - _cpu_pbase = _dma_pbase = pbase; + _cpu_pbase = pbase; + if (dev) { + /* Use dma_map_single to obtain DMA bus address or I/O virtual address, if + IOMMU is present. */ + pbase = dma_map_single(dev, bus_to_virt(_cpu_pbase), size, DMA_BIDIRECTIONAL); + if (BDE_DMA_MAPPING_ERROR(dev, pbase)) { + gprintk("Error !! Failed to map memory at phys base 0x%lx\n", + (unsigned long)_cpu_pbase); + _cpu_pbase = 0; + return; + } + _use_dma_mapping = 1; + } else { + pbase = _cpu_pbase; + } + _dma_pbase = pbase; _dma_vbase = IOREMAP(_dma_pbase, size); } else { /* Get DMA memory from kernel */ @@ -684,14 +850,13 @@ _alloc_mpool(size_t size) return; } _cpu_pbase = virt_to_bus(_dma_vbase); - /* Use dma_map_single to obtain DMA bus address or IOVA if iommu is present. */ + /* Use dma_map_single to obtain DMA bus address or IOVA if IOMMU is present. */ if (dev) { pbase = dma_map_single(dev, _dma_vbase, size, DMA_BIDIRECTIONAL); if (BDE_DMA_MAPPING_ERROR(dev, pbase)) { gprintk("Failed to map memory at %p\n", _dma_vbase); - _pgcleanup(); + _mpool_free(); _dma_vbase = NULL; - _cpu_pbase = 0; return; } _use_dma_mapping = 1; @@ -709,7 +874,7 @@ _alloc_mpool(size_t size) if (!dma64_support && ((pbase + (size - 1)) >> 16) > DMA_BIT_MASK(16)) { gprintk("DMA memory allocated at 0x%lx size 0x%lx is beyond the 4GB limit and not supported.\n", pbase, (unsigned long)size); - _pgcleanup(); + _mpool_free(); _dma_vbase = NULL; _dma_pbase = 0; return; @@ -739,15 +904,27 @@ _alloc_mpool(size_t size) int _dma_cleanup(void) { +#ifdef BDE_EDK_SUPPORT + _edk_mpool_free(); +#endif if (_dma_vbase) { mpool_destroy(_dma_pool); if (_use_himem) { + int i, ndevices; iounmap(_dma_vbase); + if (_use_dma_mapping) { + ndevices = BDE_NUM_DEVICES(BDE_SWITCH_DEVICES); + for (i = 0; i < ndevices && DMA_DEV(i); i ++) { + dma_unmap_single(DMA_DEV(i), (dma_addr_t)_dma_pbase, _dma_mem_size, + DMA_BIDIRECTIONAL); + } + _use_dma_mapping = 0; + } } else { #ifdef REMAP_DMA_NONCACHED iounmap(_dma_vbase); #endif - _pgcleanup(); + _mpool_free(); } _dma_vbase = NULL; _dma_pbase = 0; @@ -811,7 +988,7 @@ void _dma_init(int dev_index) } if (_dma_mem_size) { - _alloc_mpool(_dma_mem_size); + _mpool_alloc(_dma_mem_size); if (_dma_vbase == NULL) { gprintk("no DMA memory available\n"); } else { @@ -835,10 +1012,17 @@ int _dma_mmap(struct file *filp, struct vm_area_struct *vma) if (phys_addr < (unsigned long )_cpu_pbase || (phys_addr + size) > ((unsigned long )_cpu_pbase + _dma_mem_size)) { +#ifdef BDE_EDK_SUPPORT + if(!_edk_vm_is_valid(filp, vma)) { + gprintk("range 0x%lx-0x%lx outside DMA pool\n", phys_addr, phys_addr + size); + return -EINVAL; + } +#else gprintk("range 0x%lx-0x%lx outside DMA pool 0x%lx-0x%lx\n", phys_addr, phys_addr + size, (unsigned long )_cpu_pbase, (unsigned long )_cpu_pbase + _dma_mem_size); return -EINVAL; +#endif } #ifdef USE_DMA_MMAP_COHERENT @@ -995,7 +1179,7 @@ lkbde_get_dma_info(phys_addr_t* cpu_pbase, phys_addr_t* dma_pbase, ssize_t* size if (_dma_mem_size == 0) { _dma_mem_size = DMA_MEM_DEFAULT; } - _alloc_mpool(_dma_mem_size); + _mpool_alloc(_dma_mem_size); } *cpu_pbase = _cpu_pbase; *dma_pbase = _dma_pbase; @@ -1004,12 +1188,12 @@ lkbde_get_dma_info(phys_addr_t* cpu_pbase, phys_addr_t* dma_pbase, ssize_t* size } void -_dma_pprint(void) +_dma_pprint(struct seq_file *m) { - pprintf("\tdmasize=%s\n", dmasize); - pprintf("\thimem=%s\n", himem); - pprintf("\thimemaddr=%s\n", himemaddr); - pprintf("DMA Memory (%s): %d bytes, %d used, %d free%s\n", + pprintf(m, "\tdmasize=%s\n", dmasize); + pprintf(m, "\thimem=%s\n", himem); + pprintf(m, "\thimemaddr=%s\n", himemaddr); + pprintf(m, "DMA Memory (%s): %d bytes, %d used, %d free%s\n", (_use_himem) ? "high" : "kernel", (_dma_vbase) ? _dma_mem_size : 0, (_dma_vbase) ? mpool_usage(_dma_pool) : 0, @@ -1020,6 +1204,10 @@ _dma_pprint(void) /* * Export functions */ + +#ifdef BDE_EDK_SUPPORT +LKM_EXPORT_SYM(lkbde_edk_get_dma_info); +#endif LKM_EXPORT_SYM(kmalloc_giant); LKM_EXPORT_SYM(kfree_giant); LKM_EXPORT_SYM(lkbde_get_dma_info); diff --git a/platform/broadcom/saibcm-modules/systems/bde/linux/kernel/linux_shbde.c b/platform/broadcom/saibcm-modules/systems/bde/linux/kernel/linux_shbde.c index a2d58858a5a5..dd003e1f9297 100644 --- a/platform/broadcom/saibcm-modules/systems/bde/linux/kernel/linux_shbde.c +++ b/platform/broadcom/saibcm-modules/systems/bde/linux/kernel/linux_shbde.c @@ -1,5 +1,10 @@ /* - * Copyright 2017 Broadcom + * Copyright 2007-2020 Broadcom Inc. All rights reserved. + * + * Permission is granted to use, copy, modify and/or distribute this + * software under either one of the licenses below. + * + * License Option 1: GPL * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License, version 2, as @@ -12,6 +17,12 @@ * * You should have received a copy of the GNU General Public License * version 2 (GPLv2) along with this source code. + * + * + * License Option 2: Broadcom Open Network Switch APIs (OpenNSA) license + * + * This software is governed by the Broadcom Open Network Switch APIs license: + * https://www.broadcom.com/products/ethernet-connectivity/software/opennsa */ /* * $Id: $ diff --git a/platform/broadcom/saibcm-modules/systems/bde/linux/kernel/linux_shbde.h b/platform/broadcom/saibcm-modules/systems/bde/linux/kernel/linux_shbde.h index 5e8a70119e85..ef4b49dc2124 100644 --- a/platform/broadcom/saibcm-modules/systems/bde/linux/kernel/linux_shbde.h +++ b/platform/broadcom/saibcm-modules/systems/bde/linux/kernel/linux_shbde.h @@ -1,5 +1,10 @@ /* - * Copyright 2017 Broadcom + * Copyright 2007-2020 Broadcom Inc. All rights reserved. + * + * Permission is granted to use, copy, modify and/or distribute this + * software under either one of the licenses below. + * + * License Option 1: GPL * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License, version 2, as @@ -12,6 +17,12 @@ * * You should have received a copy of the GNU General Public License * version 2 (GPLv2) along with this source code. + * + * + * License Option 2: Broadcom Open Network Switch APIs (OpenNSA) license + * + * This software is governed by the Broadcom Open Network Switch APIs license: + * https://www.broadcom.com/products/ethernet-connectivity/software/opennsa */ /* * $Id: $ diff --git a/platform/broadcom/saibcm-modules/systems/bde/linux/shared/mpool.c b/platform/broadcom/saibcm-modules/systems/bde/linux/shared/mpool.c index 13206596ee26..4c2db5e4de6c 100644 --- a/platform/broadcom/saibcm-modules/systems/bde/linux/shared/mpool.c +++ b/platform/broadcom/saibcm-modules/systems/bde/linux/shared/mpool.c @@ -1,5 +1,10 @@ /* - * Copyright 2017 Broadcom + * Copyright 2007-2020 Broadcom Inc. All rights reserved. + * + * Permission is granted to use, copy, modify and/or distribute this + * software under either one of the licenses below. + * + * License Option 1: GPL * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License, version 2, as @@ -12,6 +17,12 @@ * * You should have received a copy of the GNU General Public License * version 2 (GPLv2) along with this source code. + * + * + * License Option 2: Broadcom Open Network Switch APIs (OpenNSA) license + * + * This software is governed by the Broadcom Open Network Switch APIs license: + * https://www.broadcom.com/products/ethernet-connectivity/software/opennsa */ /* * $Id: mpool.c,v 1.18 Broadcom SDK $ @@ -71,7 +82,7 @@ static sal_sem_t _mpool_lock; #endif #define MPOOL_BUF_SIZE 1024 -#define MPOOL_BUF_ALLOC_COUNT_MAX 16 +#define MPOOL_BUF_ALLOC_COUNT_MAX 128 typedef struct mpool_mem_s { unsigned char *address; @@ -80,20 +91,42 @@ typedef struct mpool_mem_s { struct mpool_mem_s *next; } mpool_mem_t; +static int _mpool_count; static int _buf_alloc_count; static mpool_mem_t *mpool_buf[MPOOL_BUF_ALLOC_COUNT_MAX]; static mpool_mem_t *free_list; -#define ALLOC_INIT_MPOOL_BUF(ptr) \ - ptr = MALLOC((sizeof(mpool_mem_t) * MPOOL_BUF_SIZE)); \ - if (ptr) { \ - int i; \ - for (i = 0; i < MPOOL_BUF_SIZE - 1; i++) { \ - ptr[i].next = &ptr[i+1]; \ - } \ - ptr[MPOOL_BUF_SIZE - 1].next = NULL; \ - free_list = &ptr[0]; \ - } +static mpool_mem_t * +_mpool_buf_create(void) +{ + int i; + mpool_mem_t *ptr; + + if (_buf_alloc_count == MPOOL_BUF_ALLOC_COUNT_MAX) { + return NULL; + } + + mpool_buf[_buf_alloc_count] = MALLOC((sizeof(mpool_mem_t) * MPOOL_BUF_SIZE)); + if (!mpool_buf[_buf_alloc_count]) { + return NULL; + } + + ptr = mpool_buf[_buf_alloc_count]; + for (i = 0; i < MPOOL_BUF_SIZE - 1; i++) { + ptr[i].next = &ptr[i+1]; + } + + ptr[MPOOL_BUF_SIZE - 1].next = NULL; + + if (free_list) { + free_list->next = &ptr[0]; + } else { + free_list = &ptr[0]; + } + + _buf_alloc_count++; + return ptr; +} /* * Function: mpool_init @@ -108,7 +141,15 @@ static mpool_mem_t *free_list; int mpool_init(void) { + int i; + MPOOL_LOCK_INIT(); + _buf_alloc_count = 0; + _mpool_count = 0; + for (i = 0; i < MPOOL_BUF_ALLOC_COUNT_MAX; i++) { + mpool_buf[i] = NULL; + } + free_list = NULL; return 0; } @@ -140,7 +181,7 @@ mpool_alloc(mpool_handle_t pool, int size) } mod = size & (BCM_CACHE_LINE_BYTES - 1); - if (mod != 0 ) { + if (mod != 0) { size += (BCM_CACHE_LINE_BYTES - mod); } while (ptr && ptr->next) { @@ -155,20 +196,9 @@ mpool_alloc(mpool_handle_t pool, int size) return NULL; } - if (!free_list) { - if (_buf_alloc_count == MPOOL_BUF_ALLOC_COUNT_MAX) { - MPOOL_UNLOCK(); - return NULL; - } - - ALLOC_INIT_MPOOL_BUF(mpool_buf[_buf_alloc_count]); - - if (mpool_buf[_buf_alloc_count] == NULL) { - MPOOL_UNLOCK(); - return NULL; - } - - _buf_alloc_count++; + if (!free_list && !_mpool_buf_create()) { + MPOOL_UNLOCK(); + return NULL; } newptr = free_list; @@ -251,25 +281,16 @@ mpool_create(void *base_ptr, int size) { mpool_mem_t *head, *tail; int mod = (int)(((unsigned long)base_ptr) & (BCM_CACHE_LINE_BYTES - 1)); - int i; MPOOL_LOCK(); - for (i = 0; i < MPOOL_BUF_ALLOC_COUNT_MAX; i++) { - mpool_buf[i] = NULL; - } - - _buf_alloc_count = 0; - - ALLOC_INIT_MPOOL_BUF(mpool_buf[_buf_alloc_count]); - - if (mpool_buf[_buf_alloc_count] == NULL) { - MPOOL_UNLOCK(); - return NULL; + if (!free_list || !(free_list->next)) { + if (!_mpool_buf_create()) { + MPOOL_UNLOCK(); + return NULL; + } } - _buf_alloc_count++; - if (mod) { base_ptr = (char*)base_ptr + (BCM_CACHE_LINE_BYTES - mod); size -= (BCM_CACHE_LINE_BYTES - mod); @@ -288,6 +309,7 @@ mpool_create(void *base_ptr, int size) head->next = tail; tail->prev = head; tail->next = NULL; + _mpool_count++; MPOOL_UNLOCK(); return head; @@ -307,19 +329,27 @@ int mpool_destroy(mpool_handle_t pool) { int i; + mpool_mem_t *head = pool; MPOOL_LOCK(); - if ((mpool_mem_t *)pool != mpool_buf[0]) { + if (!(head && head->prev)) { MPOOL_UNLOCK(); return 0; } - for (i = 0; i < MPOOL_BUF_ALLOC_COUNT_MAX; i++) { - if (mpool_buf[i]) { - FREE(mpool_buf[i]); - mpool_buf[i] = NULL; + head->prev->next = free_list; + free_list = head; + _mpool_count--; + + if (_mpool_count == 0) { + for (i = 0; i < MPOOL_BUF_ALLOC_COUNT_MAX; i++) { + if (mpool_buf[i]) { + FREE(mpool_buf[i]); + mpool_buf[i] = NULL; + } } + free_list = NULL; } MPOOL_UNLOCK(); diff --git a/platform/broadcom/saibcm-modules/systems/bde/linux/user/kernel/Makefile b/platform/broadcom/saibcm-modules/systems/bde/linux/user/kernel/Makefile index 424f2fe24bee..2cc96df02d0a 100644 --- a/platform/broadcom/saibcm-modules/systems/bde/linux/user/kernel/Makefile +++ b/platform/broadcom/saibcm-modules/systems/bde/linux/user/kernel/Makefile @@ -1,5 +1,10 @@ # -# Copyright 2017 Broadcom +# Copyright 2007-2020 Broadcom Inc. All rights reserved. +# +# Permission is granted to use, copy, modify and/or distribute this +# software under either one of the licenses below. +# +# License Option 1: GPL # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License, version 2, as @@ -12,6 +17,12 @@ # # You should have received a copy of the GNU General Public License # version 2 (GPLv2) along with this source code. +# +# +# License Option 2: Broadcom Open Network Switch APIs (OpenNSA) license +# +# This software is governed by the Broadcom Open Network Switch APIs license: +# https://www.broadcom.com/products/ethernet-connectivity/software/opennsa # # -*- Makefile -*- # $Id: Makefile,v 1.1 Broadcom SDK $ diff --git a/platform/broadcom/saibcm-modules/systems/bde/linux/user/kernel/linux-user-bde.c b/platform/broadcom/saibcm-modules/systems/bde/linux/user/kernel/linux-user-bde.c index 46f60c8a3ae9..4e6186e2d80d 100644 --- a/platform/broadcom/saibcm-modules/systems/bde/linux/user/kernel/linux-user-bde.c +++ b/platform/broadcom/saibcm-modules/systems/bde/linux/user/kernel/linux-user-bde.c @@ -24,14 +24,13 @@ #include #include #include - +#include #include "linux-user-bde.h" #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0) #include #endif - MODULE_AUTHOR("Broadcom Corporation"); MODULE_DESCRIPTION("User BDE Helper Module"); MODULE_LICENSE("GPL"); @@ -71,7 +70,7 @@ MODULE_LICENSE("GPL"); /* CMICX defines */ #define INTC_INTR_REG_NUM (8) - +#define PAXB_INTRCLR_DELAY_REG_NUM (16) /* TODO:HX5 The INTR base address values are changed for HX5, @@ -80,15 +79,27 @@ be made. */ #define PAXB_0_PAXB_IC_INTRCLR_0 (0x180123a0) #define PAXB_0_PAXB_IC_INTRCLR_1 (0x180123a4) - #define PAXB_0_PAXB_IC_INTRCLR_MODE_0 (0x180123a8) #define PAXB_0_PAXB_IC_INTRCLR_MODE_1 (0x180123ac) +#define PAXB_0_PAXB_INTR_STATUS (0x18012f38) +#define PAXB_0_PAXB_IC_INTR_PACING_CTRL (0x18012398) +#define PAXB_0_PAXB_INTRCLR_DELAY_UNIT (0x1801239c) +#define PAXB_0_PAXB_IC_INTRCLR_DELAY_REG0 (0x180123b0) +#define PAXB_0_PCIE_ERROR_STATUS (0x18012024) #define HX5_PAXB_0_PAXB_IC_INTRCLR_0 (0x102303a0) #define HX5_PAXB_0_PAXB_IC_INTRCLR_1 (0x102303a4) #define HX5_PAXB_0_PAXB_IC_INTRCLR_MODE_0 (0x102303a8) #define HX5_PAXB_0_PAXB_IC_INTRCLR_MODE_1 (0x102303ac) +#define HX5_PAXB_0_PAXB_INTR_STATUS (0x10230f38) +#define HX5_PAXB_0_PAXB_IC_INTR_PACING_CTRL (0x10230398) +#define HX5_PAXB_0_PAXB_INTRCLR_DELAY_UNIT (0x1023039c) +#define HX5_PAXB_0_PAXB_IC_INTRCLR_DELAY_REG0 (0x102303b0) +#define HX5_PAXB_0_PCIE_ERROR_STATUS (0x10230024) + +#define PAXB_0_PAXB_IC_INTRCLR_DELAY_BASE (PAXB_0_PAXB_IC_INTRCLR_DELAY_REG0) +#define HX5_PAXB_0_PAXB_IC_INTRCLR_DELAY_BASE (HX5_PAXB_0_PAXB_IC_INTRCLR_DELAY_REG0) #define INTC_INTR_ENABLE_REG0 (0x180130f0) #define INTC_INTR_STATUS_REG0 (0x18013190) @@ -129,9 +140,9 @@ be made. #define INTC_LOW_PRIORITY_INTR_REG_IND IRQ_MASK_INDEX(HX5_CHIP_INTR_LOW_PRIORITY) #define INTC_PDMA_INTR_REG_IND 4 -#define READ_INTC_INTR(d, reg, v) \ +#define IPROC_READ(d, reg, v) \ (v = user_bde->iproc_read(d, reg)) -#define WRITE_INTC_INTR(d, reg, v) \ +#define IPROC_WRITE(d, reg, v) \ (user_bde->iproc_write(d, reg, v)) #define IHOST_READ_INTR(d, reg, v) \ @@ -155,6 +166,22 @@ be made. static uint32 *ihost_intr_status_base = NULL; static uint32 *ihost_intr_enable_base = NULL; +/* Module parameter for Interruptible timeout */ +static int intr_timeout = 0; +LKM_MOD_PARAM(intr_timeout, "i", int, (S_IRUGO | S_IWUSR)); +MODULE_PARM_DESC(intr_timeout, +"Interruptible wait timeout in milliseconds for Interrupt to be triggered."); + +static ulong intr_count = 0; +LKM_MOD_PARAM(intr_count, "intr_count", ulong, (S_IRUGO | S_IWUSR)); +MODULE_PARM_DESC(intr_count, +"Interrupt count provides information about the number of times the ISR is called."); + +static ulong intr_timeout_count = 0; +LKM_MOD_PARAM(intr_timeout_count, "intr_timeout_count", ulong, (S_IRUGO | S_IWUSR)); +MODULE_PARM_DESC(intr_timeout_count, +"Interrupt timeout count provides information about the number of times the interrupt wait is timeed out."); + /* Debug output */ static int debug; LKM_MOD_PARAM(debug, "i", int, (S_IRUGO | S_IWUSR)); @@ -168,10 +195,16 @@ typedef void (*isr_f)(void *); typedef struct _intr_regs_s { uint32 intc_intr_status_base; uint32 intc_intr_enable_base; + uint32 intc_intr_raw_status_base; uint32 intc_intr_clear_0; uint32 intc_intr_clear_1; uint32 intc_intr_clear_mode_0; uint32 intc_intr_clear_mode_1; + uint32 intc_intr_status; + uint32 intc_intr_pacing_ctrl; + uint32 intc_intr_clear_delay_unit; + uint32 intc_intr_clear_delay_base; + uint32 intc_intr_pcie_err_status; } _intr_regs_t; typedef struct bde_ctrl_s { @@ -181,7 +214,8 @@ typedef struct bde_ctrl_s { int devid; isr_f isr; uint32 *ba; - int inst; /* associate to _bde_inst_resource[] */ + uint32 inst; /* the resource/instance index in _bde_inst_resource[] */ + int edk_irq_enabled; _intr_regs_t intr_regs; } bde_ctrl_t; @@ -199,20 +233,37 @@ static atomic_t _ether_interrupt_has_taken_place = ATOMIC_INIT(0); */ static int _bde_multi_inst = 0; +#define MAX_UC_CORES LINUX_BDE_MAX_IPROC_UC_CORES + +/* Structure to hold info about interrupts handled by EDK */ typedef struct { - unsigned int inst_id; - unsigned int dma_offset; - unsigned int dma_size; + uint32_t timer_intrc_offset; /* Timer interrupts INTC offset */ + uint32_t timer_intrc_mask; /* Timer interrupts mask */ + uint32_t sw_intr_intrc_offset; /* SW Programmable Interrupt's offset */ + uint32_t sw_intr_intrc_mask; /* SW interrupt's mask */ + uint32_t sw_intr_src_bitmap; /* SW interrupt's bitmask to navigate ICFG registers */ + uint32_t sw_intr_icfg_reg[MAX_UC_CORES]; /* ICFG registers for each core */ +} bde_edk_intr_t; + +typedef struct { + int is_active; /* Is the instance active */ + unsigned int dma_offset; /* offset of the instance's DMA memory in the DMA buffer pool */ + unsigned int dma_size; /* size of the instance's DMA memory (in the DMA buffer pool) */ wait_queue_head_t intr_wq; + wait_queue_head_t edk_intr_wq; atomic_t intr; + atomic_t edk_intr; + bde_edk_intr_t edk_irqs; } bde_inst_resource_t; +/* This array contains information for SDK instance, the index in the array is the instance ID */ static bde_inst_resource_t _bde_inst_resource[LINUX_BDE_MAX_DEVICES]; /* * Lock used to protect changes to _bde_inst_resource */ static spinlock_t bde_resource_lock; + typedef struct { phys_addr_t cpu_pbase; /* CPU physical base address of the DMA pool */ phys_addr_t dma_pbase; /* Bus base address of the DMA pool */ @@ -291,23 +342,98 @@ _cmic_interrupt(bde_ctrl_t *ctrl) #endif } -static void -_cmicx_interrupt(bde_ctrl_t *ctrl) +void +dump_interrupt_regs(bde_ctrl_t *ctrl , int dev) +{ + int ind; + uint32_t val; + + if (debug >= 2) { + gprintk("Interrupt timeout count = %lu\n", intr_timeout_count); + gprintk("Interrupt count = %lu\n", intr_count); + for (ind = 0; ind < INTC_INTR_REG_NUM; ind++) { + IPROC_READ(dev, ctrl->intr_regs.intc_intr_status_base + 4 * ind, val); + gprintk("INTC_INTR_STATUS_REG_%d = 0x%x\n", ind, val); + IPROC_READ(dev, ctrl->intr_regs.intc_intr_raw_status_base + 4 * ind, val); + gprintk("INTC_INTR_RAW_STATUS_REG_%d = 0x%x\n", ind, val); + IPROC_READ(dev, ctrl->intr_regs.intc_intr_enable_base + 4 * ind, val); + gprintk("INTC_INTR_ENABLE_REG_%d = 0x%x\n", ind, val); + } + /* Dump PAXB Register */ + IPROC_READ(dev, ctrl->intr_regs.intc_intr_status, val); + gprintk("PAXB_0_PAXB_INTR_STATUS = 0x%x\n", val); + IPROC_READ(dev, ctrl->intr_regs.intc_intr_pacing_ctrl, val); + gprintk("PAXB_0_PAXB_IC_INTR_PACING_CTRL = 0x%x\n", val); + IPROC_READ(dev, ctrl->intr_regs.intc_intr_clear_delay_unit, val); + gprintk("PAXB_0_PAXB_INTRCLR_DELAY_UNIT = 0x%x\n", val); + IPROC_READ(dev, ctrl->intr_regs.intc_intr_pcie_err_status, val); + gprintk("PAXB_0_PCIE_ERROR_STATUS = 0x%x\n", val); + + for (ind = 0; ind < PAXB_INTRCLR_DELAY_REG_NUM; ind++) { + IPROC_READ(dev, ctrl->intr_regs.intc_intr_clear_delay_base + 4 * ind, val); + gprintk("PAXB_0_PAXB_IC_INTRCLR_DELAY_REG_%d = 0x%x\n", ind, val); + } + } + /* Clear interrupt enable registers */ + for (ind = 0; ind < INTC_INTR_REG_NUM; ind++) { + IPROC_WRITE(dev, ctrl->intr_regs.intc_intr_enable_base + 4 * ind, 0); + } +} + +#ifdef BDE_EDK_SUPPORT +static int +_cmicx_edk_interrupt_check(bde_ctrl_t *ctrl, int d) { - int d, ind; - uint32 stat, iena, mask, fmask; bde_inst_resource_t *res; + uint32 stat, mask = 0, bitmap = 0; + int idx; + + res = &_bde_inst_resource[ctrl->inst]; + bitmap = res->edk_irqs.sw_intr_src_bitmap; + + /* Explicitly reading raw_status so as to not clear the status on read */ + IPROC_READ(d, ctrl->intr_regs.intc_intr_raw_status_base + + (res->edk_irqs.sw_intr_intrc_offset * 4), stat); + /* Check whether Software Programmable Interrupt is set */ + if (stat & res->edk_irqs.sw_intr_intrc_mask) { + for (idx = 0; (bitmap && (idx < MAX_UC_CORES)); idx++) { + if (bitmap & 1) { + IPROC_READ(d, res->edk_irqs.sw_intr_icfg_reg[idx], stat); + mask |= (stat & 1) << idx; + } + bitmap = (bitmap >> 1); + } + if (mask) + return 1; + } + + /* EDK uses timer interrupt as watchdog to indicate the the firmware has crashed */ + IPROC_READ(d, ctrl->intr_regs.intc_intr_raw_status_base + + (res->edk_irqs.timer_intrc_offset * 4), stat); + if (stat & res->edk_irqs.timer_intrc_mask) { + return 1; + } + return 0; +} +#endif + +static int +_cmicx_interrupt_prepare(bde_ctrl_t *ctrl) +{ + int d, ind, ret = 0; + uint32 stat, iena, mask, fmask; d = (((uint8 *)ctrl - (uint8 *)_devices) / sizeof (bde_ctrl_t)); if (ctrl->dev_type & BDE_PCI_DEV_TYPE) { + IPROC_READ(d, ctrl->intr_regs.intc_intr_clear_mode_0, stat); /* Clear MSI interrupts immediately to prevent spurious interrupts */ - WRITE_INTC_INTR(d, ctrl->intr_regs.intc_intr_clear_0, 0xFFFFFFFF); - WRITE_INTC_INTR(d, ctrl->intr_regs.intc_intr_clear_1, 0xFFFFFFFF); + if (stat == 0) { + IPROC_WRITE(d, ctrl->intr_regs.intc_intr_clear_0, 0xFFFFFFFF); + IPROC_WRITE(d, ctrl->intr_regs.intc_intr_clear_1, 0xFFFFFFFF); + } } - res = &_bde_inst_resource[ctrl->inst]; - lkbde_irq_mask_get(d, &mask, &fmask); if (fmask) { @@ -315,15 +441,15 @@ _cmicx_interrupt(bde_ctrl_t *ctrl) IHOST_READ_INTR(d, ihost_intr_status_base + INTC_PDMA_INTR_REG_IND, stat); IHOST_READ_INTR(d, ihost_intr_enable_base + INTC_PDMA_INTR_REG_IND, iena); } else { - READ_INTC_INTR(d, ctrl->intr_regs.intc_intr_status_base + 4 * INTC_PDMA_INTR_REG_IND, stat); - READ_INTC_INTR(d, ctrl->intr_regs.intc_intr_enable_base + 4 * INTC_PDMA_INTR_REG_IND, iena); + IPROC_READ(d, ctrl->intr_regs.intc_intr_status_base + 4 * INTC_PDMA_INTR_REG_IND, stat); + IPROC_READ(d, ctrl->intr_regs.intc_intr_enable_base + 4 * INTC_PDMA_INTR_REG_IND, iena); } if (stat & iena) { if (ctrl->dev_type & BDE_AXI_DEV_TYPE) { IHOST_WRITE_INTR(d, ihost_intr_enable_base + INTC_PDMA_INTR_REG_IND + HX5_IHOST_IRQ_MASK_OFFSET, ~0); } else { - WRITE_INTC_INTR(d, ctrl->intr_regs.intc_intr_enable_base + 4 * INTC_PDMA_INTR_REG_IND, 0); + IPROC_WRITE(d, ctrl->intr_regs.intc_intr_enable_base + 4 * INTC_PDMA_INTR_REG_IND, 0); } for (ind = 0; ind < INTC_INTR_REG_NUM; ind++) { @@ -344,16 +470,16 @@ _cmicx_interrupt(bde_ctrl_t *ctrl) } } } else { - READ_INTC_INTR(d, ctrl->intr_regs.intc_intr_status_base + 4 * ind, stat); - READ_INTC_INTR(d, ctrl->intr_regs.intc_intr_enable_base + 4 * ind, iena); + IPROC_READ(d, ctrl->intr_regs.intc_intr_status_base + 4 * ind, stat); + IPROC_READ(d, ctrl->intr_regs.intc_intr_enable_base + 4 * ind, iena); } if (stat & iena) { break; } } - + /* No pending interrupts */ if (ind >= INTC_INTR_REG_NUM) { - return; + return -1; } } } @@ -362,6 +488,11 @@ _cmicx_interrupt(bde_ctrl_t *ctrl) * So as to avoid getting new interrupts until the user level driver * enumerates the interrupts to be serviced */ +#ifdef BDE_EDK_SUPPORT + if (ctrl->edk_irq_enabled) + ret = _cmicx_edk_interrupt_check(ctrl, d); +#endif + for (ind = 0; ind < INTC_INTR_REG_NUM; ind++) { if (fmask && ind == INTC_PDMA_INTR_REG_IND) { continue; @@ -381,17 +512,42 @@ _cmicx_interrupt(bde_ctrl_t *ctrl) HX5_IHOST_IRQ_MASK_OFFSET, ~0); } } else { - WRITE_INTC_INTR(d, ctrl->intr_regs.intc_intr_enable_base + 4*ind, 0); + IPROC_WRITE(d, ctrl->intr_regs.intc_intr_enable_base + (4 * ind), 0); } } - /* Notify */ - atomic_set(&res->intr, 1); + return ret; +} + +static void +_cmicx_interrupt(bde_ctrl_t *ctrl) +{ + bde_inst_resource_t *res; + int ret; + + intr_count++; + + res = &_bde_inst_resource[ctrl->inst]; + ret = _cmicx_interrupt_prepare(ctrl); + if (ret < 0) { + return; + } else if (ret > 0) { + /* Notify */ + atomic_set(&res->edk_intr, 1); #ifdef BDE_LINUX_NON_INTERRUPTIBLE - wake_up(&res->intr_wq); + wake_up(&res->edk_intr_wq); #else - wake_up_interruptible(&res->intr_wq); + wake_up_interruptible(&res->edk_intr_wq); #endif + } else { + /* Notify */ + atomic_set(&res->intr, 1); +#ifdef BDE_LINUX_NON_INTERRUPTIBLE + wake_up(&res->intr_wq); +#else + wake_up_interruptible(&res->intr_wq); +#endif + } } static void @@ -695,25 +851,6 @@ _cmicd_interrupt(bde_ctrl_t *ctrl) #endif } -static void -_bcm88750_interrupt(bde_ctrl_t *ctrl) -{ - int d; - bde_inst_resource_t *res; - - d = (((uint8 *)ctrl - (uint8 *)_devices) / sizeof (bde_ctrl_t)); - res = &_bde_inst_resource[ctrl->inst]; - lkbde_irq_mask_set(d, CMIC_IRQ_MASK, 0, 0); - - lkbde_irq_mask_set(d, CMIC_IRQ_MASK_1, 0, 0); - lkbde_irq_mask_set(d, CMIC_IRQ_MASK_2, 0, 0); - atomic_set(&res->intr, 1); -#ifdef BDE_LINUX_NON_INTERRUPTIBLE - wake_up(&res->intr_wq); -#else - wake_up_interruptible(&res->intr_wq); -#endif -} /* The actual interrupt handler of ethernet devices */ static void @@ -738,7 +875,6 @@ static struct _intr_mode_s { { (isr_f)_cmicm_interrupt, "CMICm" }, { (isr_f)_cmicd_interrupt, "CMICd" }, { (isr_f)_cmicd_cmc0_interrupt, "CMICd CMC0" }, - { (isr_f)_bcm88750_interrupt, "BCM88750" }, { (isr_f)_cmicx_interrupt, "CMICx" }, { NULL, NULL } }; @@ -764,17 +900,31 @@ _intr_regs_init(bde_ctrl_t *ctrl, int hx5_intr) if (hx5_intr) { ctrl->intr_regs.intc_intr_status_base = HX5_INTC_INTR_STATUS_BASE; ctrl->intr_regs.intc_intr_enable_base = HX5_INTC_INTR_ENABLE_BASE; + ctrl->intr_regs.intc_intr_raw_status_base = HX5_INTC_INTR_RAW_STATUS_BASE; ctrl->intr_regs.intc_intr_clear_0 = HX5_PAXB_0_PAXB_IC_INTRCLR_0; ctrl->intr_regs.intc_intr_clear_1 = HX5_PAXB_0_PAXB_IC_INTRCLR_1; ctrl->intr_regs.intc_intr_clear_mode_0 = HX5_PAXB_0_PAXB_IC_INTRCLR_MODE_0; ctrl->intr_regs.intc_intr_clear_mode_1 = HX5_PAXB_0_PAXB_IC_INTRCLR_MODE_1; + ctrl->intr_regs.intc_intr_status = HX5_PAXB_0_PAXB_INTR_STATUS; + ctrl->intr_regs.intc_intr_pacing_ctrl = HX5_PAXB_0_PAXB_IC_INTR_PACING_CTRL; + ctrl->intr_regs.intc_intr_clear_delay_unit = HX5_PAXB_0_PAXB_INTRCLR_DELAY_UNIT; + ctrl->intr_regs.intc_intr_clear_delay_base = HX5_PAXB_0_PAXB_IC_INTRCLR_DELAY_BASE; + ctrl->intr_regs.intc_intr_pcie_err_status = HX5_PAXB_0_PCIE_ERROR_STATUS; + } else { ctrl->intr_regs.intc_intr_status_base = INTC_INTR_STATUS_BASE; + ctrl->intr_regs.intc_intr_raw_status_base = INTC_INTR_RAW_STATUS_BASE; ctrl->intr_regs.intc_intr_enable_base = INTC_INTR_ENABLE_BASE; ctrl->intr_regs.intc_intr_clear_0 = PAXB_0_PAXB_IC_INTRCLR_0; ctrl->intr_regs.intc_intr_clear_1 = PAXB_0_PAXB_IC_INTRCLR_1; ctrl->intr_regs.intc_intr_clear_mode_0 = PAXB_0_PAXB_IC_INTRCLR_MODE_0; ctrl->intr_regs.intc_intr_clear_mode_1 = PAXB_0_PAXB_IC_INTRCLR_MODE_1; + ctrl->intr_regs.intc_intr_status = PAXB_0_PAXB_INTR_STATUS; + ctrl->intr_regs.intc_intr_pacing_ctrl = PAXB_0_PAXB_IC_INTR_PACING_CTRL; + ctrl->intr_regs.intc_intr_clear_delay_unit = PAXB_0_PAXB_INTRCLR_DELAY_UNIT; + ctrl->intr_regs.intc_intr_clear_delay_base = PAXB_0_PAXB_IC_INTRCLR_DELAY_BASE; + ctrl->intr_regs.intc_intr_pcie_err_status = PAXB_0_PCIE_ERROR_STATUS; + } } @@ -804,13 +954,6 @@ _devices_init(int d) } if (ctrl->dev_type & BDE_SWITCH_DEV_TYPE) { switch (user_bde->get_dev(d)->device) { - case BCM88750_DEVICE_ID: - case BCM88753_DEVICE_ID: - case BCM88754_DEVICE_ID: - case BCM88755_DEVICE_ID: - case BCM88752_DEVICE_ID: - ctrl->isr = (isr_f)_bcm88750_interrupt; - break; case BCM53540_DEVICE_ID: case BCM53547_DEVICE_ID: case BCM53548_DEVICE_ID: @@ -894,6 +1037,10 @@ _devices_init(int d) case BCM56276_DEVICE_ID: case BCM56277_DEVICE_ID: case BCM56278_DEVICE_ID: + case BCM56279_DEVICE_ID: + case BCM56575_DEVICE_ID: + case BCM56175_DEVICE_ID: + case BCM56176_DEVICE_ID: ctrl->isr = (isr_f)_cmicx_interrupt; if (ctrl->dev_type & BDE_AXI_DEV_TYPE) { if (!ihost_intr_enable_base) { @@ -944,6 +1091,7 @@ _devices_init(int d) case J2C_DEVICE_ID: case J2C_2ND_DEVICE_ID: case Q2A_DEVICE_ID: + case Q2U_DEVICE_ID: case J2P_DEVICE_ID: #endif #ifdef BCM_DNXF_SUPPORT @@ -974,10 +1122,11 @@ _devices_init(int d) static int _init(void) { - int i; + int i, nof_devices; phys_addr_t cpu_pbase, dma_pbase; ssize_t dmasize; bde_inst_resource_t *res; + uint32 *bitmap_ptr; /* Connect to the kernel bde */ if ((linux_bde_create(NULL, &user_bde) < 0) || user_bde == NULL) { @@ -1002,16 +1151,30 @@ _init(void) res->dma_offset = 0; res->dma_size = _dma_pool.total_size; init_waitqueue_head(&res->intr_wq); + init_waitqueue_head(&res->edk_intr_wq); atomic_set(&res->intr, 0); + atomic_set(&res->edk_intr, 0); ihost_intr_enable_base = NULL; ihost_intr_status_base = NULL; - for (i = 0; i < user_bde->num_devices(BDE_ALL_DEVICES); i++) { - res->inst_id |= (1 << i); + nof_devices = user_bde->num_devices(BDE_ALL_DEVICES); + /* for no BDE instances, mark the single SDK as controlling all devices */ + bitmap_ptr = *lkbde_get_inst_devs(0); + for (i = nof_devices; i >=32; i -= 32) { + *(bitmap_ptr++) = 0xffffffff; + } + *bitmap_ptr = (((uint32)1) << i) - 1; + res->is_active = 1; + + for (i = 0; i < nof_devices; i++) { /* init all devices */ _devices_init(i); } + if (intr_timeout > 0) { + gprintk("Interruptible wait timeout = %d msecs\n", intr_timeout); + } + return 0; } @@ -1036,7 +1199,7 @@ _cleanup(void) BDE_DEV_MEM_MAPPED(_devices[i].dev_type)) { user_bde->interrupt_disconnect(i); } - lkbde_dev_instid_set(i, 0); + lkbde_dev_instid_set(i, BDE_DEV_INST_ID_INVALID); } linux_bde_destroy(user_bde); user_bde = NULL; @@ -1065,48 +1228,53 @@ _cleanup(void) * Always 0 */ static int -_pprint(void) +_pprint(struct seq_file *m) { int idx; const char *name; bde_inst_resource_t *res; uint32 state, instid; - pprintf("Broadcom Device Enumerator (%s)\n", LINUX_USER_BDE_NAME); + pprintf(m, "Broadcom Device Enumerator (%s)\n", LINUX_USER_BDE_NAME); for (idx = 0; idx < user_bde->num_devices(BDE_ALL_DEVICES); idx++) { name = _intr_mode_str(_devices[idx].isr); if (name == NULL) { name = "unknown"; } - pprintf("\t%d: Interrupt mode %s ",idx, name); + pprintf(m, "\t%d: Interrupt mode %s ",idx, name); (void)lkbde_dev_state_get(idx, &state); if (state == BDE_DEV_STATE_REMOVED) { - pprintf(" Device REMOVED ! \n"); + pprintf(m, " Device REMOVED ! \n"); } else { (void)lkbde_dev_instid_get(idx, &instid); - if (instid) { - pprintf("Inst id 0x%x\n",instid); + if (instid != BDE_DEV_INST_ID_INVALID) { + pprintf(m, "Inst id 0x%x\n",instid); } else { - pprintf("\n"); + pprintf(m, "\n"); } } } - pprintf("Instance resource \n"); + pprintf(m, "Instance resource \n"); for (idx = 0; idx < user_bde->num_devices(BDE_ALL_DEVICES); idx++) { res = &_bde_inst_resource[idx]; - if (res->inst_id) { - pprintf("\tDev mask 0x%x : " - "DMA offset %d size %d MB\n", - res->inst_id, + if (res->is_active) { + linux_bde_device_bitmap_t* bitmap_p = lkbde_get_inst_devs(idx); + pprintf(m, "\t%d: DMA offset %d size %d MB Dev mask 0x", + idx, res->dma_offset, res->dma_size); + for (state = 0; state * 32 < user_bde->num_devices(BDE_ALL_DEVICES); ++state) { + pprintf(m,"%.8x ", (*bitmap_p)[state]); + } + pprintf(m,"\n"); } } return 0; } +#ifdef BCM_INSTANCE_SUPPORT /* * Allocate the DMA resource from DMA pool * Parameter : @@ -1127,22 +1295,21 @@ _dma_resource_alloc(unsigned int dma_size, unsigned int *dma_offset) _dma_pool.offset += dma_size; return 0; } +#endif static int -_dma_resource_get(int inst_id, phys_addr_t *cpu_pbase, phys_addr_t *dma_pbase, ssize_t* size) +_dma_resource_get(unsigned inst_id, phys_addr_t *cpu_pbase, phys_addr_t *dma_pbase, ssize_t* size) { - int i; unsigned int dma_size = 0, dma_offset = 0; bde_inst_resource_t *res; - for (i = 0; i < user_bde->num_devices(BDE_ALL_DEVICES); i++) { - res = &_bde_inst_resource[i]; - if (res->inst_id == inst_id) { - dma_size = res->dma_size; - dma_offset = res->dma_offset; - break; - } + if (inst_id >= user_bde->num_devices(BDE_ALL_DEVICES)) { + gprintk("ERROR: requested DMA resources for an instance number out of range: %u\n", inst_id); + return -1; } + res = &_bde_inst_resource[inst_id]; + dma_size = res->dma_size; + dma_offset = res->dma_offset; *cpu_pbase = _dma_pool.cpu_pbase + dma_offset * ONE_MB; *dma_pbase = _dma_pool.dma_pbase + dma_offset * ONE_MB; @@ -1151,28 +1318,49 @@ _dma_resource_get(int inst_id, phys_addr_t *cpu_pbase, phys_addr_t *dma_pbase, s return 0; } +#ifdef BCM_INSTANCE_SUPPORT +/* + * Checks if we have the instance in _bde_inst_resource. If not, return LUBDE_SUCCESS==0 (considered a new instance). + * If it exists with the same dmasize, return 1 (It is considered already in use) + * Otherwise if the device with the same index of the resource, has resource/instance index 0, return LUBDE_SUCCESS==0. (bug) + * Otherwise return LUBDE_FAIL==-1 (It is considered to exist with a different dmasize). + */ static int -_instance_validate(unsigned int inst_id, unsigned int dmasize) +_instance_validate(unsigned int inst_id, unsigned int dmasize, linux_bde_device_bitmap_t inst_devices) { - int i; - bde_inst_resource_t *res; + unsigned i; + uint32 bits; + bde_inst_resource_t *res = _bde_inst_resource + inst_id; + linux_bde_device_bitmap_t* bitmap_p; - for (i = 0; i < user_bde->num_devices(BDE_ALL_DEVICES); i++) { - res = &_bde_inst_resource[i]; - if (res->inst_id == inst_id) { - if (res->dma_size != dmasize) { - if(_devices[i].inst == 0){ - /* Skip _instance_validate (not init yet) */ - return LUBDE_SUCCESS; - } - gprintk("ERROR: dma_size mismatch\n"); - return LUBDE_FAIL; - } - return (1); + if (inst_id >= user_bde->num_devices(BDE_ALL_DEVICES)) { + gprintk("ERROR: instance number out of range: %u\n", inst_id); + return LUBDE_FAIL; + } + + if (res->is_active == 0) { + /* FIXME SDK-225233 check that the devices are not used by another active instance */ + return LUBDE_SUCCESS; + } + + bitmap_p = lkbde_get_inst_devs(inst_id); + for (i = 0; i < LINUX_BDE_NOF_DEVICE_BITMAP_WORDS; ++i) { + bits = inst_devices[i] ^ (*bitmap_p)[i]; + if (bits != 0) { + for (i *= 32; (bits & 1) == 0; bits >>= 1, ++i); + gprintk("ERROR: existing instance number %u does not control the same devices, see device %u\n", inst_id, i); + return LUBDE_FAIL; } } - return LUBDE_SUCCESS; + + if (res->dma_size == dmasize) { + return 1; /* For an existing same instance with the same DMA size, do nothing */ + } + /* with a different DMS size */ + gprintk("ERROR: dma_size mismatch\n"); + return LUBDE_FAIL; } +#endif static int _device_reprobe(void) @@ -1187,33 +1375,49 @@ _device_reprobe(void) return 0; } +#ifdef BCM_INSTANCE_SUPPORT +/* + * Attach an SDK instance: + * _device_reprobe(); + * Check If an instance with the same bitmap exists, if yes with the same dmasize, return, if yes a different dmasize return an error, if no: + * Allocate DMA for the instance. + * This loop finds the first free resource in _bde_inst_resource[] and configure it for the instance. + * Store the resource/instance index in _bde_inst_resource for every device in the instance. + */ static int -_instance_attach(unsigned int inst_id, unsigned int dma_size) +_instance_attach(unsigned int inst_id, unsigned int dma_size, linux_bde_device_bitmap_t inst_devices) { unsigned int dma_offset; int i, exist; bde_inst_resource_t *res; - int inst_idx = -1; - uint32 instid; + uint32 previous_inst_id; /* Reprobe the system for hot-plugged device */ _device_reprobe(); if (debug >= 2) { - gprintk("INFO: Request to attach to instance_id %d with dma size %d!\n", inst_id, dma_size); + gprintk("INFO: Request to attach to instance_id %u with dma size %d!\n", inst_id, dma_size); } spin_lock(&bde_resource_lock); - /* Validate the resource with inst_id */ - exist = _instance_validate(inst_id, dma_size); - if (exist < 0) { + /* If not in multi instance mode, move to the mode and fix the first instance that represented all devices */ + if (_bde_multi_inst == 0) { + _bde_multi_inst = 1; + _bde_inst_resource->is_active = 0; + /*_bde_inst_resource->dev will not be used when _bde_inst_resource->is_active == 0 */ + } + + /* Validate the resource with inst_devices */ + exist = _instance_validate(inst_id, dma_size, inst_devices); + + if (exist == LUBDE_FAIL) { spin_unlock(&bde_resource_lock); return LUBDE_FAIL; } if (exist > 0) { if (debug >= 2) { - gprintk("INFO: Already attached to instance_id %d with dma size %d!\n", inst_id, dma_size); + gprintk("INFO: Already attached to instance_id %u with dma size %d!\n", inst_id, dma_size); } spin_unlock(&bde_resource_lock); return LUBDE_SUCCESS; @@ -1222,38 +1426,59 @@ _instance_attach(unsigned int inst_id, unsigned int dma_size) spin_unlock(&bde_resource_lock); return LUBDE_FAIL; } - for (i = 0; i < user_bde->num_devices(BDE_ALL_DEVICES); i++) { - res = &_bde_inst_resource[i]; - if ((_bde_multi_inst == 0) || (res->inst_id == 0)) { - res->inst_id = inst_id; - res->dma_offset = dma_offset; - res->dma_size = dma_size; - _bde_multi_inst++; - inst_idx = i; - init_waitqueue_head(&res->intr_wq); - atomic_set(&res->intr, 0); - break; - } + + /* configure the instance ID resources */ + res = _bde_inst_resource + inst_id; + res->is_active = 1; + res->dma_offset = dma_offset; + res->dma_size = dma_size; +#ifdef SAI_FIXUP /* SDK-240875 */ + /* skip instance 0, WQ for instance 0 has been initialized in user_bde init, see _init() */ + if (inst_id != 0) { + init_waitqueue_head(&res->intr_wq); + init_waitqueue_head(&res->edk_intr_wq); + atomic_set(&res->intr, 0); + atomic_set(&res->edk_intr, 0); } +#endif + memcpy(*lkbde_get_inst_devs(inst_id), inst_devices, sizeof(linux_bde_device_bitmap_t)); /* SDK-225233 */ + /* store the resource/instance index in _bde_inst_resource for every device in the instance */ for (i = 0; i < user_bde->num_devices(BDE_ALL_DEVICES); i++) { - if (inst_id & (1 << i)) { - _devices[i].inst = inst_idx; - /* Pass the instid to the kernel BDE */ - if (lkbde_dev_instid_get(i, &instid) == 0) { - if (!instid) { + if (inst_devices[i / 32] & (1 << (i % 32))) { + _devices[i].inst = inst_id; + /* Pass the inst_id to the kernel BDE */ + if (lkbde_dev_instid_get(i, &previous_inst_id) == 0) { /* If the linux-kernel-bde inst_id is not set for the device, set it to the instance ID */ + if (previous_inst_id == BDE_DEV_INST_ID_INVALID) { lkbde_dev_instid_set(i, inst_id); } - } + } /* TODO handle the case where the device is marked belonging to a different instance */ } } spin_unlock(&bde_resource_lock); if (debug >= 2) { - gprintk("INFO: Attached to instance_id %d with dma size %d! SUCCESS\n", inst_id, dma_size); + gprintk("INFO: Attached to instance_id %lu with dma size %d! SUCCESS\n", (unsigned long)inst_devices, dma_size); } return LUBDE_SUCCESS; } +#endif /* BCM_INSTANCE_SUPPORT */ + +#ifdef BDE_EDK_SUPPORT +static int +_edk_instance_attach(unsigned int inst_id, unsigned int dma_size) +{ + ssize_t size = (ssize_t)dma_size; + if (size) { + lkbde_edk_get_dma_info(inst_id, NULL, NULL, &size); + if (!size) { + gprintk("Error: EDK Attached to instance_id %lu failed\n", (unsigned long)inst_id); + return LUBDE_FAIL; + } + } + return LUBDE_SUCCESS; +} +#endif /* * Function: _ioctl @@ -1273,7 +1498,7 @@ _ioctl(unsigned int cmd, unsigned long arg) phys_addr_t cpu_pbase, dma_pbase; ssize_t size; const ibde_dev_t *bde_dev; - int inst_id; + int inst_id, idx; bde_inst_resource_t *res; uint32_t *mapaddr; @@ -1341,10 +1566,19 @@ _ioctl(unsigned int cmd, unsigned long arg) case LUBDE_GET_DMA_INFO: inst_id = io.dev; if (_bde_multi_inst){ - _dma_resource_get(inst_id, &cpu_pbase, &dma_pbase, &size); + if (_dma_resource_get(inst_id, &cpu_pbase, &dma_pbase, &size)) { + io.rc = LUBDE_FAIL; + } } else { lkbde_get_dma_info(&cpu_pbase, &dma_pbase, &size); } +#ifdef BDE_EDK_SUPPORT + case LUBDE_GET_EDK_DMA_INFO: + if (cmd == LUBDE_GET_EDK_DMA_INFO) { + inst_id = io.dev; + lkbde_edk_get_dma_info(inst_id, &cpu_pbase, &dma_pbase, &size); + } +#endif io.d0 = dma_pbase; io.d1 = size; /* Optionally enable DMA mmap via /dev/linux-kernel-bde */ @@ -1365,14 +1599,6 @@ _ioctl(unsigned int cmd, unsigned long arg) } if (_devices[io.dev].dev_type & BDE_SWITCH_DEV_TYPE) { if (_devices[io.dev].isr && !_devices[io.dev].enabled) { - bde_ctrl_t *ctrl; - ctrl = &_devices[io.dev]; - if ((ctrl->isr == (isr_f)_cmicx_interrupt) && - (ctrl->dev_type & BDE_PCI_DEV_TYPE)) { - /* Set MSI mode to SW clear vs auto clear */ - WRITE_INTC_INTR(io.dev, ctrl->intr_regs.intc_intr_clear_mode_0, 0x0); - WRITE_INTC_INTR(io.dev, ctrl->intr_regs.intc_intr_clear_mode_1, 0x0); - } user_bde->interrupt_connect(io.dev, _devices[io.dev].isr, _devices+io.dev); @@ -1398,6 +1624,32 @@ _ioctl(unsigned int cmd, unsigned long arg) _devices[io.dev].enabled = 0; } break; + case LUBDE_SET_EDK_INTERRUPTS: + if (!VALID_DEVICE(io.dev)) { + return -EINVAL; + } + res = &_bde_inst_resource[_devices[io.dev].inst]; + res->edk_irqs.timer_intrc_offset = io.d0; + res->edk_irqs.timer_intrc_mask = io.d1; + res->edk_irqs.sw_intr_intrc_offset = io.d2; + res->edk_irqs.sw_intr_intrc_mask = io.d3; + res->edk_irqs.sw_intr_src_bitmap = io.dx.dw[0]; + for (idx = 0; idx < MAX_UC_CORES; idx++) { + res->edk_irqs.sw_intr_icfg_reg[idx] = io.dx.dw[idx + 1]; + } + break; + case LUBDE_ENABLE_EDK_INTERRUPTS: + if (!VALID_DEVICE(io.dev)) { + return -EINVAL; + } + _devices[io.dev].edk_irq_enabled = 1; + break; + case LUBDE_DISABLE_EDK_INTERRUPTS: + if (!VALID_DEVICE(io.dev)) { + return -EINVAL; + } + _devices[io.dev].edk_irq_enabled = 0; + break; case LUBDE_WAIT_FOR_INTERRUPT: if (!VALID_DEVICE(io.dev)) { return -EINVAL; @@ -1409,8 +1661,34 @@ _ioctl(unsigned int cmd, unsigned long arg) atomic_read(&res->intr) != 0, 100); #else - wait_event_interruptible(res->intr_wq, - atomic_read(&res->intr) != 0); + /* CMICX Devices */ + if ((_devices[io.dev].dev_type & BDE_PCI_DEV_TYPE) && + (_devices[io.dev].isr == (isr_f)_cmicx_interrupt) && + (intr_timeout > 0)) { + unsigned long t_jiffies; + int err=0; + t_jiffies = msecs_to_jiffies(intr_timeout); + err = wait_event_interruptible_timeout(res->intr_wq, + atomic_read(&res->intr) != 0, + t_jiffies); + /* Timeout happend and condition not set */ + if (err == 0) { + bde_ctrl_t *ctrl; + ctrl = &_devices[io.dev]; + intr_timeout_count++; + if (debug >= 1) { + gprintk("Timeout happend and condition not set\n"); + } + dump_interrupt_regs(ctrl, io.dev); + } else if (err == -ERESTARTSYS) { + if (debug >= 1) { + gprintk("Interrupted by Signal\n"); + } + } + } else { + wait_event_interruptible(res->intr_wq, + atomic_read(&res->intr) != 0); + } #endif /* * Even if we get multiple interrupts, we @@ -1424,14 +1702,56 @@ _ioctl(unsigned int cmd, unsigned long arg) #else wait_event_interruptible(_ether_interrupt_wq, atomic_read(&_ether_interrupt_has_taken_place) != 0); + #endif /* - * Even if we get multiple interrupts, we + * Even if we get multiple interrupts, we * only run the interrupt handler once. */ atomic_set(&_ether_interrupt_has_taken_place, 0); } break; + case LUBDE_WAIT_FOR_EDK_INTERRUPT: + if (!VALID_DEVICE(io.dev)) { + return -EINVAL; + } + res = &_bde_inst_resource[_devices[io.dev].inst]; +#ifdef BDE_LINUX_NON_INTERRUPTIBLE + wait_event_timeout(res->edk_intr_wq, + atomic_read(&res->edk_intr) != 0, 100); + +#else + /* CMICX Devices */ + if ((_devices[io.dev].dev_type & BDE_PCI_DEV_TYPE) && + (_devices[io.dev].isr == (isr_f)_cmicx_interrupt) && + (intr_timeout > 0)) { + unsigned long t_jiffies; + int err = 0; + t_jiffies = msecs_to_jiffies(intr_timeout); + err = wait_event_interruptible_timeout(res->edk_intr_wq, + atomic_read(&res->edk_intr) != 0, t_jiffies); + /* Timeout happend and condition not set */ + if (err == 0) { + bde_ctrl_t *ctrl; + ctrl = &_devices[io.dev]; + intr_timeout_count++; + if (debug >= 1) { + gprintk("EDK Interrrupt: Timeout happened\n"); + } + dump_interrupt_regs(ctrl, io.dev); + } else if (err == -ERESTARTSYS) { + if (debug >= 1) { + gprintk("EDK Interrrupt: Interrupted by Signal\n"); + } + } + } else { + wait_event_interruptible(res->edk_intr_wq, atomic_read(&res->edk_intr) != 0); + } +#endif + /* Even if we get multiple interrupts, we + * only run the interrupt handler once. */ + atomic_set(&res->edk_intr, 0); + break; case LUBDE_USLEEP: case LUBDE_UDELAY: case LUBDE_SEM_OP: @@ -1487,7 +1807,7 @@ _ioctl(unsigned int cmd, unsigned long arg) if (BDE_DEV_MEM_MAPPED(_devices[io.dev].dev_type)) { /* Get physical address to map */ io.rc = lkbde_get_dev_resource(io.dev, io.d0, - &io.d1, &io.d2, &io.d3); + &io.d2, &io.d3, &io.d1); } } else { io.rc = LUBDE_FAIL; @@ -1517,9 +1837,16 @@ _ioctl(unsigned int cmd, unsigned long arg) io.rc = LUBDE_FAIL; } break; +#ifdef BDE_EDK_SUPPORT + case LUBDE_ATTACH_EDK_INSTANCE: + io.rc = _edk_instance_attach(io.d0, io.d1); + break; +#endif +#ifdef BCM_INSTANCE_SUPPORT case LUBDE_ATTACH_INSTANCE: - io.rc = _instance_attach(io.d0, io.d1); + io.rc = _instance_attach(io.d0, io.d1, io.dx.dw); break; +#endif case LUBDE_GET_DEVICE_STATE: io.rc = lkbde_dev_state_get(io.dev, &io.d0); break; diff --git a/platform/broadcom/saibcm-modules/systems/bde/linux/user/kernel/linux-user-bde.h b/platform/broadcom/saibcm-modules/systems/bde/linux/user/kernel/linux-user-bde.h index 535ccac9fad9..4bd4b746c521 100644 --- a/platform/broadcom/saibcm-modules/systems/bde/linux/user/kernel/linux-user-bde.h +++ b/platform/broadcom/saibcm-modules/systems/bde/linux/user/kernel/linux-user-bde.h @@ -1,5 +1,10 @@ /* - * Copyright 2017 Broadcom + * Copyright 2007-2020 Broadcom Inc. All rights reserved. + * + * Permission is granted to use, copy, modify and/or distribute this + * software under either one of the licenses below. + * + * License Option 1: GPL * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License, version 2, as @@ -12,6 +17,12 @@ * * You should have received a copy of the GNU General Public License * version 2 (GPLv2) along with this source code. + * + * + * License Option 2: Broadcom Open Network Switch APIs (OpenNSA) license + * + * This software is governed by the Broadcom Open Network Switch APIs license: + * https://www.broadcom.com/products/ethernet-connectivity/software/opennsa */ /* * $Id: linux-user-bde.h,v 1.23 Broadcom SDK $ @@ -45,7 +56,7 @@ typedef struct { unsigned int d3; bde_kernel_addr_t p0; union { - unsigned int dw[2]; + uint32_t dw[16]; unsigned char buf[64]; } dx; } lubde_ioctl_t; @@ -54,34 +65,41 @@ typedef struct { /* LUBDE ioctls */ #define LUBDE_MAGIC 'L' -#define LUBDE_VERSION _IO(LUBDE_MAGIC, 0) -#define LUBDE_GET_NUM_DEVICES _IO(LUBDE_MAGIC, 1) -#define LUBDE_GET_DEVICE _IO(LUBDE_MAGIC, 2) -#define LUBDE_PCI_CONFIG_PUT32 _IO(LUBDE_MAGIC, 3) -#define LUBDE_PCI_CONFIG_GET32 _IO(LUBDE_MAGIC, 4) -#define LUBDE_GET_DMA_INFO _IO(LUBDE_MAGIC, 5) -#define LUBDE_ENABLE_INTERRUPTS _IO(LUBDE_MAGIC, 6) -#define LUBDE_DISABLE_INTERRUPTS _IO(LUBDE_MAGIC, 7) -#define LUBDE_USLEEP _IO(LUBDE_MAGIC, 8) -#define LUBDE_WAIT_FOR_INTERRUPT _IO(LUBDE_MAGIC, 9) -#define LUBDE_SEM_OP _IO(LUBDE_MAGIC, 10) -#define LUBDE_UDELAY _IO(LUBDE_MAGIC, 11) -#define LUBDE_GET_DEVICE_TYPE _IO(LUBDE_MAGIC, 12) -#define LUBDE_SPI_READ_REG _IO(LUBDE_MAGIC, 13) -#define LUBDE_SPI_WRITE_REG _IO(LUBDE_MAGIC, 14) -#define LUBDE_READ_REG_16BIT_BUS _IO(LUBDE_MAGIC, 19) -#define LUBDE_WRITE_REG_16BIT_BUS _IO(LUBDE_MAGIC, 20) -#define LUBDE_GET_BUS_FEATURES _IO(LUBDE_MAGIC, 21) -#define LUBDE_WRITE_IRQ_MASK _IO(LUBDE_MAGIC, 22) -#define LUBDE_CPU_WRITE_REG _IO(LUBDE_MAGIC, 23) -#define LUBDE_CPU_READ_REG _IO(LUBDE_MAGIC, 24) -#define LUBDE_CPU_PCI_REGISTER _IO(LUBDE_MAGIC, 25) -#define LUBDE_DEV_RESOURCE _IO(LUBDE_MAGIC, 26) -#define LUBDE_IPROC_READ_REG _IO(LUBDE_MAGIC, 27) -#define LUBDE_IPROC_WRITE_REG _IO(LUBDE_MAGIC, 28) -#define LUBDE_ATTACH_INSTANCE _IO(LUBDE_MAGIC, 29) -#define LUBDE_GET_DEVICE_STATE _IO(LUBDE_MAGIC, 30) -#define LUBDE_REPROBE _IO(LUBDE_MAGIC, 31) +#define LUBDE_VERSION _IO(LUBDE_MAGIC, 0) +#define LUBDE_GET_NUM_DEVICES _IO(LUBDE_MAGIC, 1) +#define LUBDE_GET_DEVICE _IO(LUBDE_MAGIC, 2) +#define LUBDE_PCI_CONFIG_PUT32 _IO(LUBDE_MAGIC, 3) +#define LUBDE_PCI_CONFIG_GET32 _IO(LUBDE_MAGIC, 4) +#define LUBDE_GET_DMA_INFO _IO(LUBDE_MAGIC, 5) +#define LUBDE_ENABLE_INTERRUPTS _IO(LUBDE_MAGIC, 6) +#define LUBDE_DISABLE_INTERRUPTS _IO(LUBDE_MAGIC, 7) +#define LUBDE_USLEEP _IO(LUBDE_MAGIC, 8) +#define LUBDE_WAIT_FOR_INTERRUPT _IO(LUBDE_MAGIC, 9) +#define LUBDE_SEM_OP _IO(LUBDE_MAGIC, 10) +#define LUBDE_UDELAY _IO(LUBDE_MAGIC, 11) +#define LUBDE_GET_DEVICE_TYPE _IO(LUBDE_MAGIC, 12) +#define LUBDE_SPI_READ_REG _IO(LUBDE_MAGIC, 13) +#define LUBDE_SPI_WRITE_REG _IO(LUBDE_MAGIC, 14) +#define LUBDE_READ_REG_16BIT_BUS _IO(LUBDE_MAGIC, 19) +#define LUBDE_WRITE_REG_16BIT_BUS _IO(LUBDE_MAGIC, 20) +#define LUBDE_GET_BUS_FEATURES _IO(LUBDE_MAGIC, 21) +#define LUBDE_WRITE_IRQ_MASK _IO(LUBDE_MAGIC, 22) +#define LUBDE_CPU_WRITE_REG _IO(LUBDE_MAGIC, 23) +#define LUBDE_CPU_READ_REG _IO(LUBDE_MAGIC, 24) +#define LUBDE_CPU_PCI_REGISTER _IO(LUBDE_MAGIC, 25) +#define LUBDE_DEV_RESOURCE _IO(LUBDE_MAGIC, 26) +#define LUBDE_IPROC_READ_REG _IO(LUBDE_MAGIC, 27) +#define LUBDE_IPROC_WRITE_REG _IO(LUBDE_MAGIC, 28) +#define LUBDE_ATTACH_INSTANCE _IO(LUBDE_MAGIC, 29) +#define LUBDE_GET_DEVICE_STATE _IO(LUBDE_MAGIC, 30) +#define LUBDE_REPROBE _IO(LUBDE_MAGIC, 31) +#define LUBDE_SET_EDK_INTERRUPTS _IO(LUBDE_MAGIC, 32) +#define LUBDE_ENABLE_EDK_INTERRUPTS _IO(LUBDE_MAGIC, 33) +#define LUBDE_DISABLE_EDK_INTERRUPTS _IO(LUBDE_MAGIC, 34) +#define LUBDE_WAIT_FOR_EDK_INTERRUPT _IO(LUBDE_MAGIC, 35) +#define LUBDE_ATTACH_EDK_INSTANCE _IO(LUBDE_MAGIC, 36) +#define LUBDE_GET_EDK_DMA_INFO _IO(LUBDE_MAGIC, 37) + #define LUBDE_SEM_OP_CREATE 1 #define LUBDE_SEM_OP_DESTROY 2 diff --git a/platform/broadcom/saibcm-modules/systems/bde/shared/include/shbde.h b/platform/broadcom/saibcm-modules/systems/bde/shared/include/shbde.h index 53003a40ce53..2d0651191fbb 100644 --- a/platform/broadcom/saibcm-modules/systems/bde/shared/include/shbde.h +++ b/platform/broadcom/saibcm-modules/systems/bde/shared/include/shbde.h @@ -1,5 +1,10 @@ /* - * Copyright 2017 Broadcom + * Copyright 2007-2020 Broadcom Inc. All rights reserved. + * + * Permission is granted to use, copy, modify and/or distribute this + * software under either one of the licenses below. + * + * License Option 1: GPL * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License, version 2, as @@ -12,6 +17,12 @@ * * You should have received a copy of the GNU General Public License * version 2 (GPLv2) along with this source code. + * + * + * License Option 2: Broadcom Open Network Switch APIs (OpenNSA) license + * + * This software is governed by the Broadcom Open Network Switch APIs license: + * https://www.broadcom.com/products/ethernet-connectivity/software/opennsa */ /* * $Id: $ diff --git a/platform/broadcom/saibcm-modules/systems/bde/shared/include/shbde_iproc.h b/platform/broadcom/saibcm-modules/systems/bde/shared/include/shbde_iproc.h index 4b614ba53139..4b71b8f16ee3 100644 --- a/platform/broadcom/saibcm-modules/systems/bde/shared/include/shbde_iproc.h +++ b/platform/broadcom/saibcm-modules/systems/bde/shared/include/shbde_iproc.h @@ -1,5 +1,10 @@ /* - * Copyright 2017 Broadcom + * Copyright 2007-2020 Broadcom Inc. All rights reserved. + * + * Permission is granted to use, copy, modify and/or distribute this + * software under either one of the licenses below. + * + * License Option 1: GPL * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License, version 2, as @@ -12,6 +17,12 @@ * * You should have received a copy of the GNU General Public License * version 2 (GPLv2) along with this source code. + * + * + * License Option 2: Broadcom Open Network Switch APIs (OpenNSA) license + * + * This software is governed by the Broadcom Open Network Switch APIs license: + * https://www.broadcom.com/products/ethernet-connectivity/software/opennsa */ /* * $Id: $ diff --git a/platform/broadcom/saibcm-modules/systems/bde/shared/include/shbde_mdio.h b/platform/broadcom/saibcm-modules/systems/bde/shared/include/shbde_mdio.h index 5f8fa63533f4..a51dd2ac6f5f 100644 --- a/platform/broadcom/saibcm-modules/systems/bde/shared/include/shbde_mdio.h +++ b/platform/broadcom/saibcm-modules/systems/bde/shared/include/shbde_mdio.h @@ -1,5 +1,10 @@ /* - * Copyright 2017 Broadcom + * Copyright 2007-2020 Broadcom Inc. All rights reserved. + * + * Permission is granted to use, copy, modify and/or distribute this + * software under either one of the licenses below. + * + * License Option 1: GPL * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License, version 2, as @@ -12,6 +17,12 @@ * * You should have received a copy of the GNU General Public License * version 2 (GPLv2) along with this source code. + * + * + * License Option 2: Broadcom Open Network Switch APIs (OpenNSA) license + * + * This software is governed by the Broadcom Open Network Switch APIs license: + * https://www.broadcom.com/products/ethernet-connectivity/software/opennsa */ /* * $Id: $ diff --git a/platform/broadcom/saibcm-modules/systems/bde/shared/include/shbde_pci.h b/platform/broadcom/saibcm-modules/systems/bde/shared/include/shbde_pci.h index 1f045d7b02c8..a0b88494823f 100644 --- a/platform/broadcom/saibcm-modules/systems/bde/shared/include/shbde_pci.h +++ b/platform/broadcom/saibcm-modules/systems/bde/shared/include/shbde_pci.h @@ -1,5 +1,10 @@ /* - * Copyright 2017 Broadcom + * Copyright 2007-2020 Broadcom Inc. All rights reserved. + * + * Permission is granted to use, copy, modify and/or distribute this + * software under either one of the licenses below. + * + * License Option 1: GPL * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License, version 2, as @@ -12,6 +17,12 @@ * * You should have received a copy of the GNU General Public License * version 2 (GPLv2) along with this source code. + * + * + * License Option 2: Broadcom Open Network Switch APIs (OpenNSA) license + * + * This software is governed by the Broadcom Open Network Switch APIs license: + * https://www.broadcom.com/products/ethernet-connectivity/software/opennsa */ /* * $Id: $ diff --git a/platform/broadcom/saibcm-modules/systems/bde/shared/shbde_iproc.c b/platform/broadcom/saibcm-modules/systems/bde/shared/shbde_iproc.c index 087720a20a8b..ca8024c78a32 100644 --- a/platform/broadcom/saibcm-modules/systems/bde/shared/shbde_iproc.c +++ b/platform/broadcom/saibcm-modules/systems/bde/shared/shbde_iproc.c @@ -1,5 +1,10 @@ /* - * Copyright 2017 Broadcom + * Copyright 2007-2020 Broadcom Inc. All rights reserved. + * + * Permission is granted to use, copy, modify and/or distribute this + * software under either one of the licenses below. + * + * License Option 1: GPL * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License, version 2, as @@ -12,6 +17,12 @@ * * You should have received a copy of the GNU General Public License * version 2 (GPLv2) along with this source code. + * + * + * License Option 2: Broadcom Open Network Switch APIs (OpenNSA) license + * + * This software is governed by the Broadcom Open Network Switch APIs license: + * https://www.broadcom.com/products/ethernet-connectivity/software/opennsa */ /* * $Id: $ @@ -292,12 +303,19 @@ shbde_iproc_paxb_init(shbde_hal_t *shbde, void *iproc_regs, /* Configure MSIX interrupt page, need for iproc ver 0x10 and 0x12 */ if ((icfg->use_msi == 2) && - ((icfg->iproc_ver == 0x10) || (icfg->iproc_ver == 0x12))){ + ((icfg->iproc_ver == 0x10) + || (icfg->iproc_ver == 0x12) + || (icfg->iproc_ver == 0x11))){ unsigned int mask = (0x1 << PAXB_0_FUNC0_IMAP1_3_ADDR_SHIFT) - 1; reg = ROFFS(iproc_regs, PAXB_0_FUNC0_IMAP1_3); data = iproc32_read(shbde, reg); data &= mask; - data |= 0x410 << PAXB_0_FUNC0_IMAP1_3_ADDR_SHIFT; + if (icfg->iproc_ver == 0x11) { + data |= 0x400 << PAXB_0_FUNC0_IMAP1_3_ADDR_SHIFT; + } else { + data |= 0x410 << PAXB_0_FUNC0_IMAP1_3_ADDR_SHIFT; + } + iproc32_write(shbde, reg, data); } diff --git a/platform/broadcom/saibcm-modules/systems/bde/shared/shbde_mdio.c b/platform/broadcom/saibcm-modules/systems/bde/shared/shbde_mdio.c index ef4a72071b33..1e38eb024adc 100644 --- a/platform/broadcom/saibcm-modules/systems/bde/shared/shbde_mdio.c +++ b/platform/broadcom/saibcm-modules/systems/bde/shared/shbde_mdio.c @@ -1,5 +1,10 @@ /* - * Copyright 2017 Broadcom + * Copyright 2007-2020 Broadcom Inc. All rights reserved. + * + * Permission is granted to use, copy, modify and/or distribute this + * software under either one of the licenses below. + * + * License Option 1: GPL * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License, version 2, as @@ -12,6 +17,12 @@ * * You should have received a copy of the GNU General Public License * version 2 (GPLv2) along with this source code. + * + * + * License Option 2: Broadcom Open Network Switch APIs (OpenNSA) license + * + * This software is governed by the Broadcom Open Network Switch APIs license: + * https://www.broadcom.com/products/ethernet-connectivity/software/opennsa */ /* * $Id: $ diff --git a/platform/broadcom/saibcm-modules/systems/bde/shared/shbde_pci.c b/platform/broadcom/saibcm-modules/systems/bde/shared/shbde_pci.c index 5cc46d0d463d..8e64b475a41f 100644 --- a/platform/broadcom/saibcm-modules/systems/bde/shared/shbde_pci.c +++ b/platform/broadcom/saibcm-modules/systems/bde/shared/shbde_pci.c @@ -1,5 +1,10 @@ /* - * Copyright 2017 Broadcom + * Copyright 2007-2020 Broadcom Inc. All rights reserved. + * + * Permission is granted to use, copy, modify and/or distribute this + * software under either one of the licenses below. + * + * License Option 1: GPL * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License, version 2, as @@ -12,6 +17,12 @@ * * You should have received a copy of the GNU General Public License * version 2 (GPLv2) along with this source code. + * + * + * License Option 2: Broadcom Open Network Switch APIs (OpenNSA) license + * + * This software is governed by the Broadcom Open Network Switch APIs license: + * https://www.broadcom.com/products/ethernet-connectivity/software/opennsa */ /* * $Id: $ diff --git a/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/Makefile b/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/Makefile index 448b4b9a9310..b599580ae861 100644 --- a/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/Makefile +++ b/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/Makefile @@ -1,5 +1,10 @@ # -# Copyright 2017 Broadcom +# Copyright 2007-2020 Broadcom Inc. All rights reserved. +# +# Permission is granted to use, copy, modify and/or distribute this +# software under either one of the licenses below. +# +# License Option 1: GPL # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License, version 2, as @@ -12,6 +17,12 @@ # # You should have received a copy of the GNU General Public License # version 2 (GPLv2) along with this source code. +# +# +# License Option 2: Broadcom Open Network Switch APIs (OpenNSA) license +# +# This software is governed by the Broadcom Open Network Switch APIs license: +# https://www.broadcom.com/products/ethernet-connectivity/software/opennsa # # -*- Makefile -*- # $Id: Makefile,v 1.10 Broadcom SDK $ diff --git a/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/bcm-knet/Makefile b/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/bcm-knet/Makefile index a3f430a6a903..9879be69b0b6 100644 --- a/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/bcm-knet/Makefile +++ b/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/bcm-knet/Makefile @@ -1,5 +1,10 @@ # -# Copyright 2017 Broadcom +# Copyright 2007-2020 Broadcom Inc. All rights reserved. +# +# Permission is granted to use, copy, modify and/or distribute this +# software under either one of the licenses below. +# +# License Option 1: GPL # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License, version 2, as @@ -12,6 +17,12 @@ # # You should have received a copy of the GNU General Public License # version 2 (GPLv2) along with this source code. +# +# +# License Option 2: Broadcom Open Network Switch APIs (OpenNSA) license +# +# This software is governed by the Broadcom Open Network Switch APIs license: +# https://www.broadcom.com/products/ethernet-connectivity/software/opennsa # # -*- Makefile -*- # $Id: Makefile,v 1.3 Broadcom SDK $ diff --git a/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/bcm-knet/bcm-knet.c b/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/bcm-knet/bcm-knet.c index a9eda27ad4d5..43edc056beff 100644 --- a/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/bcm-knet/bcm-knet.c +++ b/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/bcm-knet/bcm-knet.c @@ -60,10 +60,6 @@ #include #include -#if LINUX_VERSION_CODE <= KERNEL_VERSION(3,16,0) -#include -#endif - #include #include #include @@ -222,6 +218,7 @@ MODULE_PARM_DESC(ft_vid, #define DBG_LVL_DCB_RX 0x20000 #define DBG_LVL_PDMP_TX 0x40000 #define DBG_LVL_PDMP_RX 0x80000 +#define DBG_LVL_PTP 0x100000 #define DBG_VERB(_s) do { if (debug & DBG_LVL_VERB) gprintk _s; } while (0) #define DBG_PKT(_s) do { if (debug & DBG_LVL_PKT) gprintk _s; } while (0) @@ -245,6 +242,7 @@ MODULE_PARM_DESC(ft_vid, #define DBG_DCB(_s) do { if (debug & (DBG_LVL_DCB|DBG_LVL_DCB_TX| \ DBG_LVL_DCB_RX)) \ gprintk _s; } while (0) +#define DBG_PTP(_s) do { if (debug & DBG_LVL_PTP) gprintk _s; } while (0) /* This flag is used to indicate if debugging packet function is open or closed */ @@ -499,6 +497,12 @@ static inline void bkn_skb_tx_timestamp(struct sk_buff *skb) #define BKN_DMA_MAPPING_ERROR(d,a) bkn_pci_dma_mapping_error(d,a) #endif +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)) +#define BKN_NETDEV_TX_BUSY NETDEV_TX_BUSY +#else +#define BKN_NETDEV_TX_BUSY 1 +#endif + /* * Get a 16-bit value from packet offset * _data Pointer to packet @@ -672,6 +676,8 @@ typedef struct bkn_switch_info_s { } rx[NUM_RX_CHAN]; } bkn_switch_info_t; +#define INVALID_INSTANCE_ID BDE_DEV_INST_ID_INVALID + /* 0x1 - Jericho 2 mode */ #define BKN_DNX_JR2_MODE 1 /* PTCH_2 */ @@ -936,13 +942,6 @@ typedef struct bkn_filter_s { kcom_filter_t kf; } bkn_filter_t; -#ifdef SAI_FIXUP /* SDK-224448 */ -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)) -#define BKN_NETDEV_TX_BUSY NETDEV_TX_BUSY -#else -#define BKN_NETDEV_TX_BUSY 1 -#endif -#endif /* SDK-224448 */ /* * Multiple instance support in KNET @@ -1071,6 +1070,7 @@ bkn_sleep(int clicks) #define DEV_IS_CMICX(_sinfo) ((_sinfo)->cmic_type == 'x') #define DEV_IS_CMICM(_sinfo) ((_sinfo)->cmic_type == 'm') +#define DEV_IS_CMIC(_sinfo) ((_sinfo)->cmic_type != 0) #define CDMA_CH(_d, _ch) ((_d)->cdma_channels & (1 << (_ch))) /* @@ -2125,12 +2125,13 @@ bkn_api_rx_chain_done(bkn_switch_info_t *sinfo, int chan) static int bkn_api_rx_copy_from_skb(bkn_switch_info_t *sinfo, - int chan, bkn_desc_info_t *desc) + int chan, bkn_desc_info_t *desc, int rx_hwts) { bkn_dcb_chain_t *dcb_chain; uint32_t *dcb; uint32_t dcb_stat; uint8_t *pkt; + uint8_t *skb_pkt; uint64_t pkt_dma; int pktlen; int i; @@ -2168,8 +2169,18 @@ bkn_api_rx_copy_from_skb(bkn_switch_info_t *sinfo, return -1; } + skb_pkt = desc->skb->data; + + /* Strip custom header from KNETSync packets. */ + if ((rx_hwts) && + ((skb_pkt[0] == 'B') && (skb_pkt[1] == 'C') && + (skb_pkt[2] == 'M') && (skb_pkt[3] == 'C'))) { + + skb_pkt = skb_pkt + skb_pkt[4]; + } + /* Copy packet data */ - memcpy(pkt, desc->skb->data, pktlen); + memcpy(pkt, skb_pkt, pktlen); /* Copy packet metadata and mark as done */ if (sinfo->cmic_type != 'x') { @@ -2235,11 +2246,11 @@ bkn_rx_refill(bkn_switch_info_t *sinfo, int chan) while (sinfo->rx[chan].free < MAX_RX_DCBS) { desc = &sinfo->rx[chan].desc[sinfo->rx[chan].cur]; if (desc->skb == NULL) { - skb = dev_alloc_skb(rx_buffer_size + RCPU_RX_ENCAP_SIZE); + skb = dev_alloc_skb(rx_buffer_size + SKB_DATA_ALIGN(resv_size)); if (skb == NULL) { break; } - skb_reserve(skb, resv_size); + skb_reserve(skb, SKB_DATA_ALIGN(resv_size)); desc->skb = skb; } else { DBG_DCB_RX(("Refill Rx%d SKB in DCB %d recycled.\n", @@ -3832,6 +3843,11 @@ bkn_do_skb_rx(bkn_switch_info_t *sinfo, int chan, int budget) while (dcbs_done < budget) { char str[32]; + + if (!sinfo->rx[chan].running) { + /* DCBs might be cleaned up when bkn_knet_hw_reset is triggered. */ + return 0; + } sprintf(str, "Rx DCB (%d)", sinfo->rx[chan].dirty); desc = &sinfo->rx[chan].desc[sinfo->rx[chan].dirty]; dcb = desc->dcb_mem; @@ -3850,6 +3866,12 @@ bkn_do_skb_rx(bkn_switch_info_t *sinfo, int chan, int budget) sinfo->rx[chan].pkts++; skb = desc->skb; + DBG_DCB_RX(("Rx%d SKB DMA done (%d).\n", chan, sinfo->rx[chan].dirty)); + BKN_DMA_UNMAP_SINGLE(sinfo->dma_dev, + desc->skb_dma, desc->dma_size, + BKN_DMA_FROMDEV); + desc->skb_dma = 0; + if (device_is_sand(sinfo)) { err_woff = BKN_SAND_SCRATCH_DATA_SIZE - 1; sand_scratch_data[err_woff] = dcb[sinfo->dcb_wsize-1]; @@ -3868,11 +3890,6 @@ bkn_do_skb_rx(bkn_switch_info_t *sinfo, int chan, int budget) pktlen = dcb[sinfo->dcb_wsize-1] & 0xffff; priv = netdev_priv(sinfo->dev); - DBG_DCB_RX(("Rx%d SKB DMA done (%d).\n", chan, sinfo->rx[chan].dirty)); - BKN_DMA_UNMAP_SINGLE(sinfo->dma_dev, - desc->skb_dma, desc->dma_size, - BKN_DMA_FROMDEV); - desc->skb_dma = 0; bkn_dump_pkt(skb->data, pktlen, XGS_DMA_RX_CHAN); if (device_is_sand(sinfo)) { @@ -3945,7 +3962,7 @@ bkn_do_skb_rx(bkn_switch_info_t *sinfo, int chan, int budget) case KCOM_DEST_T_API: DBG_FLTR(("Send to Rx API\n")); sinfo->rx[chan].pkts_f_api++; - bkn_api_rx_copy_from_skb(sinfo, chan, desc); + bkn_api_rx_copy_from_skb(sinfo, chan, desc, 0); break; case KCOM_DEST_T_NETIF: priv = bkn_netif_lookup(sinfo, filter->kf.dest_id); @@ -3961,7 +3978,7 @@ bkn_do_skb_rx(bkn_switch_info_t *sinfo, int chan, int budget) if ((filter->kf.mirror_type == KCOM_DEST_T_API) || dbg_pkt_enable) { sinfo->rx[chan].pkts_m_api++; - bkn_api_rx_copy_from_skb(sinfo, chan, desc); + bkn_api_rx_copy_from_skb(sinfo, chan, desc, priv->rx_hwts); } if (device_is_sand(sinfo)) { @@ -4095,6 +4112,9 @@ bkn_do_skb_rx(bkn_switch_info_t *sinfo, int chan, int budget) } } + /* Ensure that we reallocate SKB for this DCB */ + desc->skb = NULL; + /* Unlock while calling up network stack */ spin_unlock(&sinfo->lock); if (use_napi) { @@ -4104,8 +4124,6 @@ bkn_do_skb_rx(bkn_switch_info_t *sinfo, int chan, int budget) } spin_lock(&sinfo->lock); - /* Ensure that we reallocate SKB for this DCB */ - desc->skb = NULL; } else { DBG_FLTR(("Unknown netif %d\n", filter->kf.dest_id)); @@ -4299,11 +4317,28 @@ bkn_hw_tstamp_tx_work(struct work_struct *work) { bkn_switch_info_t *sinfo = container_of(work, bkn_switch_info_t, tx_ptp_work); struct sk_buff *skb; + int ret; while (skb_queue_len(&sinfo->tx_ptp_queue)) { skb = skb_dequeue(&sinfo->tx_ptp_queue); - if (bkn_hw_tstamp_tx_set(sinfo, skb) < 0) { - gprintk("Timestamp has not been taken for the current skb.\n"); + ret = bkn_hw_tstamp_tx_set(sinfo, skb); + if (ret < 0) { +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)) + ktime_t now; + now = ktime_get(); + DBG_PTP(("2Step TX Timestamp has not been taken for the current skb (%lld us)\n", + ktime_us_delta(now, skb->tstamp))); + } else { + ktime_t now; + now = ktime_get(); + /* Timeout 20 should be same as configured by PTP4L */ + if (ktime_us_delta(now, skb->tstamp) >= 20000) { + DBG_PTP(("2Step TX Timestamp fetch took long time %lld us\n", + ktime_us_delta(now, skb->tstamp))); + } +#else + DBG_PTP(("2Step TX Timestamp has not been taken for the current skb\n")); +#endif } dev_kfree_skb_any(skb); } @@ -4346,6 +4381,9 @@ bkn_do_tx(bkn_switch_info_t *sinfo) } if (bkn_skb_tx_flags(desc->skb) & SKBTX_IN_PROGRESS) { +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)) + desc->skb->tstamp = ktime_get(); +#endif skb_queue_tail(&sinfo->tx_ptp_queue, desc->skb); schedule_work(&sinfo->tx_ptp_work); } else { @@ -5310,6 +5348,7 @@ bkn_hw_tstamp_tx_config(bkn_switch_info_t *sinfo, case 26: case 32: case 33: + case 35: meta[2] |= md[0]; meta[3] |= md[1]; meta[4] |= md[2]; @@ -5342,6 +5381,7 @@ bkn_tx(struct sk_buff *skb, struct net_device *dev) uint32_t *metadata; unsigned long flags; uint32_t cpu_channel = 0; + int headroom, tailroom; DBG_VERB(("Netif Tx: Len=%d priv->id=%d\n", skb->len, priv->id)); @@ -5449,7 +5489,16 @@ bkn_tx(struct sk_buff *skb, struct net_device *dev) if (skb_header_cloned(skb)) { /* Current SKB cannot be modified */ DBG_SKB(("Realloc Tx SKB\n")); - new_skb = dev_alloc_skb(pktlen + TAG_SZ + FCS_SZ); + /* + * New SKB needs extra TAG_SZ for VLAN tag + * and extra FCS_SZ for Ethernet FCS. + */ + headroom = TAG_SZ; + tailroom = FCS_SZ; + new_skb = skb_copy_expand(skb, + headroom + skb_headroom(skb), + tailroom + skb_tailroom(skb), + GFP_ATOMIC); if (new_skb == NULL) { DBG_WARN(("Tx drop: No SKB memory\n")); priv->stats.tx_dropped++; @@ -5458,9 +5507,12 @@ bkn_tx(struct sk_buff *skb, struct net_device *dev) spin_unlock_irqrestore(&sinfo->lock, flags); return 0; } + /* Remove rcpulen from buffer. */ + skb_pull(new_skb, rcpulen); + /* Extended by TAG_SZ at the start of buffer. */ + skb_push(new_skb, TAG_SZ); + /* Restore the data before the tag. */ memcpy(new_skb->data, pktdata, 12); - memcpy(&new_skb->data[16], &pktdata[12], pktlen - 12); - skb_put(new_skb, pktlen + TAG_SZ); bkn_skb_tstamp_copy(new_skb, skb); dev_kfree_skb_any(skb); skb = new_skb; @@ -5489,7 +5541,16 @@ bkn_tx(struct sk_buff *skb, struct net_device *dev) if (skb_header_cloned(skb) || skb_headroom(skb) < hdrlen + 4) { /* Current SKB cannot be modified */ DBG_SKB(("Realloc Tx SKB\n")); - new_skb = dev_alloc_skb(pktlen + hdrlen + 4 + FCS_SZ); + if (device_is_sand(sinfo)) { + headroom = hdrlen; + } else { + headroom = hdrlen + 4; + } + tailroom = FCS_SZ; + new_skb = skb_copy_expand(skb, + headroom + skb_headroom(skb), + tailroom + skb_tailroom(skb), + GFP_ATOMIC); if (new_skb == NULL) { DBG_WARN(("Tx drop: No SKB memory\n")); priv->stats.tx_dropped++; @@ -5498,12 +5559,7 @@ bkn_tx(struct sk_buff *skb, struct net_device *dev) spin_unlock_irqrestore(&sinfo->lock, flags); return 0; } - if (!device_is_sand(sinfo)) - { - skb_reserve(new_skb, 4); - } - memcpy(new_skb->data + hdrlen, skb->data, pktlen); - skb_put(new_skb, pktlen + hdrlen); + skb_push(new_skb, hdrlen); bkn_skb_tstamp_copy(new_skb, skb); dev_kfree_skb_any(skb); skb = new_skb; @@ -5526,7 +5582,12 @@ bkn_tx(struct sk_buff *skb, struct net_device *dev) if (skb_header_cloned(skb) || skb_headroom(skb) < 4) { /* Current SKB cannot be modified */ DBG_SKB(("Realloc Tx SKB\n")); - new_skb = dev_alloc_skb(pktlen + TAG_SZ + FCS_SZ); + headroom = TAG_SZ; + tailroom = FCS_SZ; + new_skb = skb_copy_expand(skb, + headroom + skb_headroom(skb), + tailroom + skb_tailroom(skb), + GFP_ATOMIC); if (new_skb == NULL) { DBG_WARN(("Tx drop: No SKB memory\n")); priv->stats.tx_dropped++; @@ -5535,10 +5596,8 @@ bkn_tx(struct sk_buff *skb, struct net_device *dev) spin_unlock_irqrestore(&sinfo->lock, flags); return 0; } - memcpy(new_skb->data, skb->data, hdrlen + 12); - memcpy(&new_skb->data[hdrlen + 16], &skb->data[hdrlen + 12], - pktlen - hdrlen - 12); - skb_put(new_skb, pktlen + TAG_SZ); + skb_push(new_skb, TAG_SZ); + memcpy(new_skb->data, pktdata, hdrlen + 12); bkn_skb_tstamp_copy(new_skb, skb); dev_kfree_skb_any(skb); skb = new_skb; @@ -5868,24 +5927,11 @@ bkn_tx(struct sk_buff *skb, struct net_device *dev) priv->stats.tx_bytes += pktlen; sinfo->tx.pkts++; } else { -#ifdef SAI_FIXUP /* SDK-224448 */ DBG_VERB(("Tx busy: No DMA resources\n")); sinfo->tx.pkts_d_dma_resrc++; -#else - DBG_WARN(("Tx drop: No DMA resources\n")); - priv->stats.tx_dropped++; - sinfo->tx.pkts_d_dma_resrc++; - dev_kfree_skb_any(skb); - } - - /* Check our Tx resources */ - if (sinfo->tx.free <= 1) { -#endif /* SDK-224448 */ bkn_suspend_tx(sinfo); -#ifdef SAI_FIXUP /* SDK-224448 */ spin_unlock_irqrestore(&sinfo->lock, flags); return BKN_NETDEV_TX_BUSY; -#endif /* SDK-224448 */ } NETDEV_UPDATE_TRANS_START_TIME(dev); @@ -6105,6 +6151,7 @@ bkn_create_sinfo(int dev_no) sinfo->dma_dev = lkbde_get_dma_dev(dev_no); sinfo->pdev = lkbde_get_hw_dev(dev_no); sinfo->dev_no = dev_no; + sinfo->inst_id = INVALID_INSTANCE_ID; sinfo->evt_idx = -1; spin_lock_init(&sinfo->lock); @@ -6196,6 +6243,7 @@ bkn_get_ts_info(struct net_device *dev, struct ethtool_ts_info *info) case 26: case 32: case 33: + case 35: case 36: case 38: case 40: @@ -6292,6 +6340,7 @@ bkn_init_ndev(u8 *mac, char *name) if (dev->mtu == 0) { dev->mtu = rx_buffer_size; } + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) dev->min_mtu = 68; dev->max_mtu = rx_buffer_size; @@ -7296,9 +7345,9 @@ bkn_proc_cleanup(void) */ static int -_pprint(void) +_pprint(struct seq_file *m) { - pprintf("Broadcom BCM KNET Linux Network Driver\n"); + pprintf(m, "Broadcom BCM KNET Linux Network Driver\n"); return 0; } @@ -7460,7 +7509,7 @@ bkn_create_inst(uint32 inst_id) DBG_INST(("%s evt_idx %d inst_id 0x%x\n",__FUNCTION__, i, inst_id)); break; } - if ((_bkn_multi_inst == 0) || (evt->inst_id == 0)) { + if ((_bkn_multi_inst == 0) || (evt->inst_id == INVALID_INSTANCE_ID)) { _bkn_multi_inst ++; evt_idx = i; init_waitqueue_head(&evt->evt_wq); @@ -7475,7 +7524,7 @@ bkn_create_inst(uint32 inst_id) return -1; } for (i = 0; i < kernel_bde->num_devices(BDE_ALL_DEVICES); i++) { - if (inst_id & (1 << i)) { + if (lkbde_is_dev_managed_by_instance(i, inst_id)) { sinfo = bkn_sinfo_from_unit(i); spin_lock_irqsave(&sinfo->lock, flags); sinfo->evt_idx = evt_idx; @@ -7519,23 +7568,28 @@ bkn_knet_dev_inst_set(kcom_msg_reprobe_t *kmsg) { bkn_switch_info_t *sinfo; int d = kmsg->hdr.unit; - uint32 inst = 0; + uint32 inst = INVALID_INSTANCE_ID; unsigned long flags; struct list_head *list; sinfo = bkn_sinfo_from_unit(d); +#ifdef BCM_INSTANCE_SUPPORT lkbde_dev_instid_get(d, &inst); +#else + inst = INVALID_INSTANCE_ID; +#endif + DBG_INST(("%s sinfo->inst_id %d d %d inst %d\n",__FUNCTION__,sinfo->inst_id, d, inst)); spin_lock_irqsave(&sinfo->lock, flags); if (sinfo->inst_id != inst) { /* Instance database changed, reinit the inst_id */ - sinfo->inst_id = 0; + sinfo->inst_id = INVALID_INSTANCE_ID; sinfo->evt_idx = -1; } spin_unlock_irqrestore(&sinfo->lock, flags); - if (inst) { - if (sinfo->inst_id == 0) { + if (inst != INVALID_INSTANCE_ID) { + if (sinfo->inst_id == INVALID_INSTANCE_ID) { if (bkn_create_inst(inst) != 0) { return -1; } @@ -7549,7 +7603,7 @@ bkn_knet_dev_inst_set(kcom_msg_reprobe_t *kmsg) sinfo = (bkn_switch_info_t *)list; spin_lock_irqsave(&sinfo->lock, flags); sinfo->evt_idx = 0; - sinfo->inst_id = 0; + sinfo->inst_id = INVALID_INSTANCE_ID; spin_unlock_irqrestore(&sinfo->lock, flags); } } @@ -7880,16 +7934,16 @@ bkn_knet_netif_create(kcom_msg_netif_create_t *kmsg, int len) } } + DBG_VERB(("Assigned ID %d to Ethernet device %s\n", priv->id, dev->name)); kmsg->netif.id = priv->id; memcpy(kmsg->netif.macaddr, dev->dev_addr, 6); memcpy(kmsg->netif.name, dev->name, KCOM_NETIF_NAME_MAX - 1); - if (knet_netif_create_cb != NULL) { int retv = knet_netif_create_cb(kmsg->hdr.unit, &(kmsg->netif), dev); - if (retv) { + if (retv) { gprintk("Warning: knet_netif_create_cb() returned %d for netif '%s'\n", retv, dev->name); } } @@ -7947,6 +8001,7 @@ bkn_knet_netif_destroy(kcom_msg_netif_destroy_t *kmsg, int len) netif.id = priv->id; knet_netif_destroy_cb(kmsg->hdr.unit, &netif, priv->dev); } + list_del(&priv->list); if (priv->id < sinfo->ndev_max) { @@ -8473,8 +8528,8 @@ bkn_get_next_dma_event(kcom_msg_dma_info_t *kmsg) sinfo = bkn_sinfo_from_unit(dev_no); } - if (sinfo && (sinfo->inst_id != 0) && - ((sinfo->inst_id & (1 << dev_evt)) == 0)) { + if (sinfo && (sinfo->inst_id != INVALID_INSTANCE_ID) && + (!lkbde_is_dev_managed_by_instance(dev_evt, sinfo->inst_id))) { DBG_INST((" %s skip dev(%d)\n",__FUNCTION__,dev_no)); continue; } @@ -8540,8 +8595,10 @@ _cleanup(void) del_timer_sync(&sinfo->rxtick); spin_lock_irqsave(&sinfo->lock, flags); - bkn_dma_abort(sinfo); - dev_irq_mask_set(sinfo, 0); + if (DEV_IS_CMIC(sinfo)) { + bkn_dma_abort(sinfo); + dev_irq_mask_set(sinfo, 0); + } spin_unlock_irqrestore(&sinfo->lock, flags); DBG_IRQ(("Unregister ISR.\n")); @@ -8759,6 +8816,7 @@ _init(void) /* Initialize event queue */ for (idx = 0; idx < LINUX_BDE_MAX_DEVICES; idx++) { memset(&_bkn_evt[idx], 0, sizeof(bkn_evt_resource_t)); + _bkn_evt[idx].inst_id = INVALID_INSTANCE_ID; } evt = &_bkn_evt[0]; init_waitqueue_head(&evt->evt_wq); diff --git a/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/bcm-ptp-clock/Makefile b/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/bcm-ptp-clock/Makefile index 1c9a3209e133..9aa3be686851 100644 --- a/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/bcm-ptp-clock/Makefile +++ b/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/bcm-ptp-clock/Makefile @@ -14,9 +14,9 @@ # version 2 (GPLv2) along with this source code. # # -*- Makefile -*- -# $Id: Makefile,v 1.3 Broadcom SDK $ -# $Copyright: (c) 2020 Broadcom. -# Broadcom Proprietary and Confidential. All rights reserved.$ +# $Id: Makefile,v 1.3 2012/07/17 07:39:51 mlarsen Exp $ +# $Copyright: (c) 2005 Broadcom Corp. +# All Rights Reserved.$ # LOCALDIR = systems/linux/kernel/modules/bcm-ptp-clock diff --git a/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/bcm-ptp-clock/bcm-ptp-clock.c b/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/bcm-ptp-clock/bcm-ptp-clock.c index 5b0a6bde738d..edc4a38c741c 100644 --- a/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/bcm-ptp-clock/bcm-ptp-clock.c +++ b/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/bcm-ptp-clock/bcm-ptp-clock.c @@ -76,9 +76,13 @@ MODULE_PARM_DESC(fw_core, /* Debug levels */ #define DBG_LVL_VERB 0x1 #define DBG_LVL_WARN 0x2 +#define DBG_LVL_TXTS 0x4 +#define DBG_LVL_CMDS 0x8 #define DBG_VERB(_s) do { if (debug & DBG_LVL_VERB) gprintk _s; } while (0) #define DBG_WARN(_s) do { if (debug & DBG_LVL_WARN) gprintk _s; } while (0) +#define DBG_TXTS(_s) do { if (debug & DBG_LVL_TXTS) gprintk _s; } while (0) +#define DBG_CMDS(_s) do { if (debug & DBG_LVL_CMDS) gprintk _s; } while (0) #define DBG_ERR(_s) do { if (1) gprintk _s; } while (0) @@ -98,41 +102,37 @@ MODULE_PARM_DESC(fw_core, #define BKSYNC_PACKLEN_U24 3 #define BKSYNC_PACKLEN_U32 4 -#define BKSYNC_UNPACK_U8(_buf, _var) \ +#define BKSYNC_UNPACK_U8(_buf, _var) \ _var = *_buf++ -#define BKSYNC_UNPACK_U16(_buf, _var) \ +#define BKSYNC_UNPACK_U16(_buf, _var) \ do { \ (_var) = (((_buf)[0] << 8) | \ (_buf)[1]); \ - (_buf) += BKSYNC_PACKLEN_U16; \ + (_buf) += BKSYNC_PACKLEN_U16; \ } while (0) -#define BKSYNC_UNPACK_U24(_buf, _var) \ +#define BKSYNC_UNPACK_U24(_buf, _var) \ do { \ (_var) = (((_buf)[0] << 16) | \ ((_buf)[1] << 8) | \ (_buf)[2]); \ - (_buf) += BKSYNC_PACKLEN_U24; \ + (_buf) += BKSYNC_PACKLEN_U24; \ } while (0) -#define BKSYNC_UNPACK_U32(_buf, _var) \ +#define BKSYNC_UNPACK_U32(_buf, _var) \ do { \ (_var) = (((_buf)[0] << 24) | \ ((_buf)[1] << 16) | \ ((_buf)[2] << 8) | \ (_buf)[3]); \ - (_buf) += BKSYNC_PACKLEN_U32; \ + (_buf) += BKSYNC_PACKLEN_U32; \ } while (0) #define CMICX_DEV_TYPE ((ptp_priv->dcb_type == 38) || \ (ptp_priv->dcb_type == 36)) -#define HOSTCMD_USE_REGS ((ptp_priv->dcb_type == 38) || \ - (ptp_priv->dcb_type == 36) || \ - (ptp_priv->dcb_type == 32)) - /* CMIC MCS-0 SCHAN Messaging registers */ /* Core0:CMC1 Core1:CMC2 */ #define CMIC_CMC_BASE \ @@ -154,30 +154,58 @@ MODULE_PARM_DESC(fw_core, u32 hostcmd_regs[5] = { 0 }; -/* TX Timestamp FIFO Access */ -#define BCM_NUM_PORTS 128 +#define BCMKSYNC_NUM_PORTS 128 /* NUM_PORTS where 2-step is supported. */ +#define BCMKSYNC_MAX_NUM_PORTS 256 /* Max ever NUM_PORTS in the system */ +#define BCMKSYNC_MAX_MTP_IDX 8 /* Max number of mtps in the system */ -/* Service request commands to R5 */ +/* Service request commands to Firmware. */ enum { - BCM_KSYNC_DONE = 0x0, - BCM_KSYNC_INIT = 0x1, - BCM_KSYNC_DEINIT = 0x2, - BCM_KSYNC_GETTIME = 0x3, - BCM_KSYNC_SETTIME = 0x4, - BCM_KSYNC_FREQCOR = 0x5, - BCM_KSYNC_PBM_UPDATE = 0x6, - BCM_KSYNC_ADJTIME = 0x7, - BCM_KSYNC_GET_TSTIME = 0x8, + BKSYNC_DONE = (0x0), + BKSYNC_INIT = (0x1), + BKSYNC_DEINIT = (0x2), + BKSYNC_GETTIME = (0x3), + BKSYNC_SETTIME = (0x4), + BKSYNC_FREQCOR = (0x5), + BKSYNC_PBM_UPDATE = (0x6), + BKSYNC_ADJTIME = (0x7), + BKSYNC_GET_TSTIME = (0x8), + BKSYNC_MTP_TS_UPDATE_ENABLE = (0x9), + BKSYNC_MTP_TS_UPDATE_DISABLE = (0xa), + BKSYNC_ACK_TSTIME = (0xb), +}; + + +/* 1588 message types. */ +enum +{ + IEEE1588_MSGTYPE_SYNC = (0x0), + IEEE1588_MSGTYPE_DELREQ = (0x1), + IEEE1588_MSGTYPE_PDELREQ = (0x2), + IEEE1588_MSGTYPE_PDELRESP = (0x3), + /* reserved (0x4) */ + /* reserved (0x5) */ + /* reserved (0x6) */ + /* reserved (0x7) */ + IEEE1588_MSGTYPE_GENERALMASK = (0x8), /* all non-event messages have this bit set */ + IEEE1588_MSGTYPE_FLWUP = (0x8), + IEEE1588_MSGTYPE_DELRESP = (0x9), + IEEE1588_MSGTYPE_PDELRES_FLWUP = (0xA), + IEEE1588_MSGTYPE_ANNOUNCE = (0xB), + IEEE1588_MSGTYPE_SGNLNG = (0xC), + IEEE1588_MSGTYPE_MNGMNT = (0xD) + /* reserved (0xE) */ + /* reserved (0xF) */ }; /* Usage macros */ #define ONE_BILLION (1000000000) #define SKB_U16_GET(_skb, _pkt_offset) \ - ((_skb->data[_pkt_offset] << 8) | _skb->data[_pkt_offset + 1]) + ((_skb->data[_pkt_offset] << 8) | _skb->data[_pkt_offset + 1]) #define BKSYNC_PTP_EVENT_MSG(_ptp_msg_type) \ - ((_ptp_msg_type == DELAY_REQ) || (_ptp_msg_type == SYNC)) + ((_ptp_msg_type == IEEE1588_MSGTYPE_DELREQ) || \ + (_ptp_msg_type == IEEE1588_MSGTYPE_SYNC)) #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30) @@ -187,10 +215,6 @@ enum { #endif -/* Values for the messageType field */ -#define SYNC 0x0 -#define DELAY_REQ 0x1 - /* * Hardware specific information. * 4 words of information used from this data set. @@ -225,6 +249,19 @@ uint32_t sobmhudpipv6_dcb32[24] = {0x00000000, 0x00013E00, 0x00000000, 0x0000000 0x00000000, 0x000C3E00, 0x00000000, 0x00000000, 0x00000000, 0x000C4200, 0x00000000, 0x00000000, 0x00000000, 0x000C3E00, 0x00000000, 0x00000000, 0x00000000, 0x000C4200, 0x00000000, 0x00000000}; +uint32_t sobmhrawpkts_dcb35[24] = {0x00000000, 0x0020E000, 0x00000000, 0x00000000, 0x00000000, 0x00212000, 0x00000000, 0x00000000, + 0x00000000, 0x0100E000, 0x00000000, 0x00000000, 0x00000000, 0x01012000, 0x00000000, 0x00000000, + 0x00000000, 0x0140E000, 0x00000000, 0x00000000, 0x00000000, 0x01412000, 0x00000000, 0x00000000}; + +uint32_t sobmhudpipv4_dcb35[24] = {0x00000000, 0x0022A000, 0x00000000, 0x00000000, 0x00000000, 0x0022E000, 0x00000000, 0x00000000, + 0x00000000, 0x0102A000, 0x00000000, 0x00000000, 0x00000000, 0x0102E000, 0x00000000, 0x00000000, + 0x00000000, 0x0142A000, 0x00000000, 0x00000000, 0x00000000, 0x0142E000, 0x00000000, 0x00000000}; + +uint32_t sobmhudpipv6_dcb35[24] = {0x00000000, 0x0023E000, 0x00000000, 0x00000000, 0x00000000, 0x00242000, 0x00000000, 0x00000000, + 0x00000000, 0x0103E000, 0x00000000, 0x00000000, 0x00000000, 0x01042000, 0x00000000, 0x00000000, + 0x00000000, 0x0143E000, 0x00000000, 0x00000000, 0x00000000, 0x01442000, 0x00000000, 0x00000000}; + + uint32_t sobmhrawpkts_dcb36[24] = {0x00000000, 0x00010E00, 0x00000000, 0x00000000, 0x00000000, 0x00011200, 0x00000000, 0x00000000, 0x00000000, 0x00080E00, 0x00000000, 0x00000000, 0x00000000, 0x00081200, 0x00000000, 0x00000000, 0x00000000, 0x00080E00, 0x00000000, 0x00000000, 0x00000000, 0x00081200, 0x00000000, 0x00000000}; @@ -267,21 +304,26 @@ typedef struct _bksync_uc_linux_ipc_s u32 ksyncinit; u32 dev_id; s64 freqcorr; - u64 portmap[BCM_NUM_PORTS/64]; + u64 portmap[BCMKSYNC_NUM_PORTS/64]; /* Two-step enabled ports */ u64 ptptime; u64 reftime; s64 phase_offset; - bksync_tx_ts_data_t port_ts_data[BCM_NUM_PORTS]; + bksync_tx_ts_data_t port_ts_data[BCMKSYNC_NUM_PORTS]; } bksync_uc_linux_ipc_t; typedef struct bksync_port_stats_s { u32 pkt_rxctr; /* All ingress packets */ u32 pkt_txctr; /* All egress packets */ + u32 pkt_txonestep; /* 1-step Tx packet counter */ u32 tsts_match; /* 2-Step tstamp req match */ u32 tsts_timeout; /* 2-Step tstamp req timeouts */ u32 tsts_discard; /* 2-Step tstamp req discards */ u32 osts_event_pkts; /* 1-step event packet counter */ u32 osts_tstamp_reqs; /* 1-step events with tstamp request */ + u32 fifo_rxctr; /* 2-Step tstamp req match */ + u64 tsts_best_fetch_time; /* 1-step events with tstamp request */ + u64 tsts_worst_fetch_time; /* 1-step events with tstamp request */ + u32 tsts_avg_fetch_time; /* 1-step events with tstamp request */ } bksync_port_stats_t; /* Clock Private Data */ @@ -296,14 +338,10 @@ struct bksync_ptp_priv { volatile bksync_uc_linux_ipc_t *shared_addr; /* address for shared memory access */ uint64_t dma_mem; int dma_mem_size; - int num_pports; struct DMA_DEV *dma_dev; /* Required for DMA memory control */ - u32 pkt_rxctr[BCM_NUM_PORTS]; - u32 pkt_txctr[BCM_NUM_PORTS]; - u32 ts_match[BCM_NUM_PORTS]; - u32 ts_timeout[BCM_NUM_PORTS]; - u32 ts_discard[BCM_NUM_PORTS]; + int num_pports; int timekeep_status; + u32 mirror_encap_bmp; struct delayed_work time_keep; bksync_port_stats_t *port_stats; }; @@ -311,7 +349,7 @@ struct bksync_ptp_priv { static struct bksync_ptp_priv *ptp_priv; volatile bksync_uc_linux_ipc_t *linuxPTPMemory = (bksync_uc_linux_ipc_t*)(0); static volatile int module_initialized; -static int retry_count = 10; /* Default retry for 10 jiffies */ +static int num_retries = 10; /* Retry count */ static void bksync_ptp_time_keep_init(void); static void bksync_ptp_time_keep_deinit(void); @@ -366,64 +404,6 @@ ptp_sleep(int jiffies) } -static int bksync_cmd_cmicm_go(u32 cmd, void *data0, void *data1) -{ - int ret = -1; - int retry_cnt = retry_count; - u32 cmd_status; - - mutex_lock(&ptp_priv->ptp_lock); - ptp_priv->shared_addr->ksyncinit = cmd; - switch (cmd) { - case BCM_KSYNC_INIT: - ptp_priv->shared_addr->phase_offset = 0; - ret = 0; - break; - case BCM_KSYNC_FREQCOR: - ptp_priv->shared_addr->freqcorr = *((s32 *)data0); - break; - case BCM_KSYNC_ADJTIME: - ptp_priv->shared_addr->phase_offset = *((s64 *)data0); - break; - case BCM_KSYNC_GETTIME: - break; - case BCM_KSYNC_SETTIME: - ptp_priv->shared_addr->ptptime = *((s64 *)data0); - ptp_priv->shared_addr->phase_offset = 0; - break; - default: - break; - } - - do { - cmd_status = ptp_priv->shared_addr->ksyncinit; - if (cmd_status == BCM_KSYNC_DONE) { - switch (cmd) { - case BCM_KSYNC_GETTIME: - *((s64 *)data0) = ptp_priv->shared_addr->ptptime; - *((s64 *)data1) = ptp_priv->shared_addr->reftime; /* ptp counter */ - break; - default: - break; - } - ret = 0; - break; - } - ptp_sleep(1); - retry_cnt--; - } while (retry_cnt); - mutex_unlock(&ptp_priv->ptp_lock); - - if (retry_cnt == 0) { - DBG_ERR(("Timeout on response from R5\n")); - } - - - return ret; -} - - - static void bksync_hostcmd_data_op(int setget, u64 *d1, u64 *d2) { u32 w0, w1; @@ -455,14 +435,28 @@ static void bksync_hostcmd_data_op(int setget, u64 *d1, u64 *d2) } -static int bksync_cmd_cmicx_go(u32 cmd, void *data0, void *data1) +static int bksync_cmd_go(u32 cmd, void *data0, void *data1) { int ret = -1; - int retry_cnt = (retry_count * 100); + int retry_cnt = (1000); /* 1ms default timeout for hostcmd response */ u32 cmd_status; char cmd_str[20]; + int port; + uint32_t seq_id; + ktime_t start, now; + + if (ptp_priv == NULL || ptp_priv->shared_addr == NULL) { + return ret; + } mutex_lock(&ptp_priv->ptp_lock); + + if (cmd == BKSYNC_GET_TSTIME || cmd == BKSYNC_ACK_TSTIME) { + port = *((uint64_t *)data0) & 0xFFF; + seq_id = *((uint64_t*)data0) >> 16; + } + start = ktime_get(); + ptp_priv->shared_addr->ksyncinit = cmd; /* init data */ @@ -472,36 +466,53 @@ static int bksync_cmd_cmicx_go(u32 cmd, void *data0, void *data1) DEV_WRITE32(ptp_priv, hostcmd_regs[4], 0x0); switch (cmd) { - case BCM_KSYNC_INIT: + case BKSYNC_INIT: sprintf(cmd_str, "KSYNC_INIT"); ptp_priv->shared_addr->phase_offset = 0; bksync_hostcmd_data_op(1, (u64 *)&(ptp_priv->shared_addr->phase_offset), 0); break; - case BCM_KSYNC_FREQCOR: + case BKSYNC_FREQCOR: sprintf(cmd_str, "KSYNC_FREQCORR"); ptp_priv->shared_addr->freqcorr = *((s32 *)data0); bksync_hostcmd_data_op(1, (u64 *)&(ptp_priv->shared_addr->freqcorr), 0); break; - case BCM_KSYNC_ADJTIME: + case BKSYNC_ADJTIME: sprintf(cmd_str, "KSYNC_ADJTIME"); ptp_priv->shared_addr->phase_offset = *((s64 *)data0); bksync_hostcmd_data_op(1, (u64 *)&(ptp_priv->shared_addr->phase_offset), 0); break; - case BCM_KSYNC_GETTIME: + case BKSYNC_GETTIME: + retry_cnt = (retry_cnt * 2); sprintf(cmd_str, "KSYNC_GETTIME"); break; - case BCM_KSYNC_GET_TSTIME: + case BKSYNC_GET_TSTIME: retry_cnt = (retry_cnt * 2); sprintf(cmd_str, "KSYNC_GET_TSTIME"); bksync_hostcmd_data_op(1, data0, data1); break; - case BCM_KSYNC_SETTIME: + case BKSYNC_ACK_TSTIME: + retry_cnt = (retry_cnt * 2); + sprintf(cmd_str, "KSYNC_ACK_TSTIME"); + bksync_hostcmd_data_op(1, data0, data1); + break; + case BKSYNC_SETTIME: sprintf(cmd_str, "KSYNC_SETTIME"); ptp_priv->shared_addr->ptptime = *((s64 *)data0); ptp_priv->shared_addr->phase_offset = 0; bksync_hostcmd_data_op(1, (u64 *)&(ptp_priv->shared_addr->ptptime), (u64 *)&(ptp_priv->shared_addr->phase_offset)); break; - case BCM_KSYNC_DEINIT: + case BKSYNC_MTP_TS_UPDATE_ENABLE: + retry_cnt = (retry_cnt * 6); + sprintf(cmd_str, "KSYNC_MTP_TS_UPDATE_ENABLE"); + bksync_hostcmd_data_op(1, (u64 *)data0, 0); + break; + case BKSYNC_MTP_TS_UPDATE_DISABLE: + retry_cnt = (retry_cnt * 6); + sprintf(cmd_str, "KSYNC_MTP_TS_UPDATE_DISABLE"); + bksync_hostcmd_data_op(1, (u64 *)data0, 0); + break; + case BKSYNC_DEINIT: + retry_cnt = (retry_cnt * 4); sprintf(cmd_str, "KSYNC_DEINIT"); break; default: @@ -514,11 +525,11 @@ static int bksync_cmd_cmicx_go(u32 cmd, void *data0, void *data1) DEV_READ32(ptp_priv, hostcmd_regs[0], &cmd_status); ptp_priv->shared_addr->ksyncinit = cmd_status; - if (cmd_status == BCM_KSYNC_DONE) { + if (cmd_status == BKSYNC_DONE) { ret = 0; switch (cmd) { - case BCM_KSYNC_GET_TSTIME: - case BCM_KSYNC_GETTIME: + case BKSYNC_GET_TSTIME: + case BKSYNC_GETTIME: bksync_hostcmd_data_op(0, (u64 *)data0, (u64 *)data1); break; default: @@ -530,37 +541,20 @@ static int bksync_cmd_cmicx_go(u32 cmd, void *data0, void *data1) retry_cnt--; } while (retry_cnt); + now = ktime_get(); mutex_unlock(&ptp_priv->ptp_lock); if (retry_cnt == 0) { - DBG_ERR(("Timeout on response from R5 to cmd %s\n", cmd_str)); + DBG_ERR(("Timeout on response from R5 to cmd %s time taken %lld us\n", cmd_str, ktime_us_delta(now, start))); + if (cmd == BKSYNC_GET_TSTIME) { + DBG_TXTS(("Timeout Port %d SeqId %d\n", port, seq_id)); + } } - - - return ret; -} - - -static int bksync_cmd_go(u32 cmd, void *data0, void *data1) -{ - int ret = -1; - - if (ptp_priv == NULL || ptp_priv->shared_addr == NULL) { - return ret; + if (debug & DBG_LVL_CMDS) { + if (ktime_us_delta(now, start) > 5000) + DBG_CMDS(("R5 Command %s exceeded time expected (%lld us)\n", cmd_str, ktime_us_delta(now, start))); } - switch (ptp_priv->dcb_type) { - case 26: - ret = bksync_cmd_cmicm_go(cmd, data0, data1); - break; - case 32: - case 36: - case 38: - ret = bksync_cmd_cmicx_go(cmd, data0, data1); - break; - default: - break; - } return ret; } @@ -577,7 +571,7 @@ static int bksync_cmd_go(u32 cmd, void *data0, void *data1) static int bksync_ptp_adjfreq(struct ptp_clock_info *ptp, s32 ppb) { int ret = -1; - u32 cmd_status = BCM_KSYNC_FREQCOR; + u32 cmd_status = BKSYNC_FREQCOR; ret = bksync_cmd_go(cmd_status, &ppb, NULL); DBG_VERB(("applying freq correction: %x\n", ppb)); @@ -595,7 +589,7 @@ static int bksync_ptp_adjfreq(struct ptp_clock_info *ptp, s32 ppb) */ static int bksync_ptp_adjtime(struct ptp_clock_info *ptp, s64 delta) { - u32 cmd_status = BCM_KSYNC_ADJTIME; + u32 cmd_status = BKSYNC_ADJTIME; int ret = -1; ret = bksync_cmd_go(cmd_status, (void *)&delta, NULL); @@ -616,18 +610,20 @@ static int bksync_ptp_adjtime(struct ptp_clock_info *ptp, s64 delta) static int bksync_ptp_gettime(struct ptp_clock_info *ptp, struct timespec64 *ts) { int ret = -1; - u32 cmd_status = BCM_KSYNC_GETTIME; + u32 cmd_status = BKSYNC_GETTIME; s64 reftime = 0; s64 refctr = 0; ret = bksync_cmd_go(cmd_status, (void *)&reftime, (void *)&refctr); - DBG_VERB(("ptp gettime: 0x%llx refctr:0x%llx\n", reftime, refctr)); - mutex_lock(&ptp_priv->ptp_pair_lock); - ptp_priv->shared_addr->ptptime = reftime; - ptp_priv->shared_addr->reftime = refctr; - mutex_unlock(&ptp_priv->ptp_pair_lock); - - *ts = ns_to_timespec64(reftime); + if (ret == 0) { + DBG_VERB(("ptp gettime: 0x%llx refctr:0x%llx\n", reftime, refctr)); + mutex_lock(&ptp_priv->ptp_pair_lock); + ptp_priv->shared_addr->ptptime = reftime; + ptp_priv->shared_addr->reftime = refctr; + mutex_unlock(&ptp_priv->ptp_pair_lock); + + *ts = ns_to_timespec64(reftime); + } return ret; } @@ -646,7 +642,7 @@ static int bksync_ptp_settime(struct ptp_clock_info *ptp, { s64 reftime, phaseadj; int ret = -1; - u32 cmd_status = BCM_KSYNC_SETTIME; + u32 cmd_status = BKSYNC_SETTIME; phaseadj = 0; reftime = timespec64_to_ns(ts); @@ -663,6 +659,38 @@ static int bksync_ptp_enable(struct ptp_clock_info *ptp, return 0; } + +static int bksync_ptp_mirror_encap_update(struct ptp_clock_info *ptp, + int mtp_idx, int start) +{ + int ret = -1; + u64 mirror_encap_idx; + u32 cmd_status; + + if (mtp_idx > BCMKSYNC_MAX_MTP_IDX) { + return ret; + } + + mirror_encap_idx = mtp_idx; + if (start) { + cmd_status = BKSYNC_MTP_TS_UPDATE_ENABLE; + ptp_priv->mirror_encap_bmp |= (1 << mtp_idx); + } else { + if (!(ptp_priv->mirror_encap_bmp & mtp_idx)) { + /* Not running */ + return ret; + } + cmd_status = BKSYNC_MTP_TS_UPDATE_DISABLE; + ptp_priv->mirror_encap_bmp &= ~mtp_idx; + } + + ret = bksync_cmd_go(cmd_status, &mirror_encap_idx, NULL); + DBG_VERB(("ptp mmirror_encap_update: %d, mpt_index: %d, ret:%d \n", start, mtp_idx, ret)); + + return ret; + +} + /* structure describing a PTP hardware clock */ static struct ptp_clock_info bksync_ptp_caps = { .owner = THIS_MODULE, @@ -721,7 +749,7 @@ int bksync_ptp_hw_tstamp_enable(int dev_no, int port, int tx_type) portmap |= (uint64_t)0x1 << port; ptp_priv->shared_addr->portmap[map] = portmap; /* Command to R5 for the update */ - ptp_priv->shared_addr->ksyncinit=BCM_KSYNC_PBM_UPDATE; + ptp_priv->shared_addr->ksyncinit=BKSYNC_PBM_UPDATE; } exit: @@ -769,7 +797,7 @@ int bksync_ptp_hw_tstamp_disable(int dev_no, int port, int tx_type) ptp_priv->shared_addr->portmap[map]= portmap; /* Command to R5 for the update */ - ptp_priv->shared_addr->ksyncinit = BCM_KSYNC_PBM_UPDATE; + ptp_priv->shared_addr->ksyncinit = BKSYNC_PBM_UPDATE; } exit: return ret; @@ -818,23 +846,26 @@ bksync_txpkt_tsts_tsamp_get(int port, uint32_t pkt_seq_id, uint32_t *ts_valid, u { int ret = 0; uint64_t tmp; + u32 fifo_rxctr = 0; tmp = (port & 0xFFFF) | (pkt_seq_id << 16); - if (HOSTCMD_USE_REGS) { - ret = bksync_cmd_go(BCM_KSYNC_GET_TSTIME, &tmp, timestamp); - - if (ret >= 0) { - *seq_id = ((tmp >> 16) & 0xFFFF); - *ts_valid = (tmp & 0x1); + ret = bksync_cmd_go(BKSYNC_GET_TSTIME, &tmp, timestamp); + + if (ret >= 0) { + fifo_rxctr = (tmp >> 32) & 0xFFFF; + *seq_id = ((tmp >> 16) & 0xFFFF); + *ts_valid = (tmp & 0x1); + if (*ts_valid) { + tmp = (port & 0xFFFF) | (pkt_seq_id << 16); + bksync_cmd_go(BKSYNC_ACK_TSTIME, &tmp, 0); + if (fifo_rxctr != 0) { + if (fifo_rxctr != ptp_priv->port_stats[port].fifo_rxctr + 1) { + DBG_ERR(("FW Reset or Lost Timestamp RxSeq:(Prev %d : Current %d)\n", ptp_priv->port_stats[port].fifo_rxctr, fifo_rxctr)); + } + ptp_priv->port_stats[port].fifo_rxctr = fifo_rxctr; + } } -#if 0 - if (tmp & 0x1) gprintk("in_port: %d in_seq_id: %d out_port: %lld ts_valid: %lld seq_id: %lld ts: %llx\n", port, pkt_seq_id, ((tmp & 0xFFFF) >> 1), (tmp & 0x1), (tmp >> 16), *timestamp); -#endif - } else { - *ts_valid = ptp_priv->shared_addr->port_ts_data[port].ts_valid; - *seq_id = ptp_priv->shared_addr->port_ts_data[port].ts_seq_id; - *timestamp = ptp_priv->shared_addr->port_ts_data[port].timestamp; } @@ -861,9 +892,12 @@ int bksync_ptp_hw_tstamp_tx_time_get(int dev_no, int port, uint8_t *pkt, uint64_ uint32_t pktseq_id = 0; uint64_t timestamp = 0; uint16_t tpid = 0; - int retry_cnt = retry_count; + ktime_t start; + u64 delta; + int retry_cnt = num_retries; int seq_id_offset, tpid_offset; int transport = network_transport; + start = ktime_get(); if (!ptp_priv || !pkt || !ts || port < 1 || port > 255 || ptp_priv->shared_addr == NULL) { return -1; @@ -918,25 +952,26 @@ int bksync_ptp_hw_tstamp_tx_time_get(int dev_no, int port, uint8_t *pkt, uint64_ if (seq_id == pktseq_id) { *ts = timestamp; - if (HOSTCMD_USE_REGS) { - ptp_priv->port_stats[port].tsts_match += 1; - } else { - ptp_priv->ts_match[port] += 1; - } + ptp_priv->port_stats[port].tsts_match += 1; - DBG_VERB(("Port: %d Skb_SeqID %d FW_SeqId %d and TS:%llx\n", - port, pktseq_id, seq_id, timestamp)); + delta = ktime_us_delta(ktime_get(), start); + DBG_VERB(("Port: %d Skb_SeqID %d FW_SeqId %d and TS:%llx FetchTime %lld\n", + port, pktseq_id, seq_id, timestamp, delta)); + if (delta < ptp_priv->port_stats[port].tsts_best_fetch_time || ptp_priv->port_stats[port].tsts_best_fetch_time == 0) { + ptp_priv->port_stats[port].tsts_best_fetch_time = delta; + } + if (delta > ptp_priv->port_stats[port].tsts_worst_fetch_time || ptp_priv->port_stats[port].tsts_worst_fetch_time == 0) { + ptp_priv->port_stats[port].tsts_worst_fetch_time = delta; + } + /* Calculate Moving Average*/ + ptp_priv->port_stats[port].tsts_avg_fetch_time = ((u32)delta + ((ptp_priv->port_stats[port].tsts_match - 1) * ptp_priv->port_stats[port].tsts_avg_fetch_time)) / ptp_priv->port_stats[port].tsts_match; break; } else { - DBG_ERR(("discard timestamp on port %d Skb_SeqID %d FW_SeqId %d\n", - port, pktseq_id, seq_id)); + DBG_TXTS(("Discard timestamp on port %d Skb_SeqID %d FW_SeqId %d RetryCnt %d TimeLapsed (%lld us)\n", + port, pktseq_id, seq_id, (num_retries - retry_cnt), ktime_us_delta(ktime_get(),start))); - if (HOSTCMD_USE_REGS) { - ptp_priv->port_stats[port].tsts_discard += 1; - } else { - ptp_priv->ts_discard[port] += 1; - } + ptp_priv->port_stats[port].tsts_discard += 1; continue; } } @@ -945,19 +980,12 @@ int bksync_ptp_hw_tstamp_tx_time_get(int dev_no, int port, uint8_t *pkt, uint64_ } while(retry_cnt); - if (HOSTCMD_USE_REGS) { - ptp_priv->port_stats[port].pkt_txctr += 1; - } else { - ptp_priv->pkt_txctr[port] += 1; - } + ptp_priv->port_stats[port].pkt_txctr += 1; if (retry_cnt == 0) { - if (HOSTCMD_USE_REGS) { - ptp_priv->port_stats[port].tsts_timeout += 1; - } else { - ptp_priv->ts_timeout[port] += 1; - } - DBG_ERR(("FW Response timeout: Tx TS on phy port:%d Skb_SeqID: %d\n", port, seq_id)); + ptp_priv->port_stats[port].tsts_timeout += 1; + DBG_ERR(("FW Response timeout: Tx TS on phy port:%d Skb_SeqID: %d TimeLapsed (%lld us)\n", + port, pktseq_id, ktime_us_delta(ktime_get(), start))); } @@ -1113,6 +1141,7 @@ int bksync_ptp_hw_tstamp_rx_time_upscale(int dev_no, int port, struct sk_buff *s switch (KNET_SKB_CB(skb)->dcb_type) { case 26: case 32: + case 35: if (pci_cos != (meta[4] & 0x3F)) { return -1; } @@ -1142,12 +1171,8 @@ int bksync_ptp_hw_tstamp_rx_time_upscale(int dev_no, int port, struct sk_buff *s } if (port > 0){ - port -= 1; - if (HOSTCMD_USE_REGS) { + port -= 1; ptp_priv->port_stats[port].pkt_rxctr += 1; - } else { - ptp_priv->pkt_rxctr[port] += 1; - } } return ret; @@ -1240,6 +1265,8 @@ int bksync_ptp_hw_tstamp_tx_meta_get(int dev_no, if (md) *md = &sobmhrawpkts_dcb32[md_offset]; } else if(KNET_SKB_CB(skb)->dcb_type == 26) { if (md) *md = &sobmhrawpkts_dcb26[md_offset]; + } else if(KNET_SKB_CB(skb)->dcb_type == 35) { + if (md) *md = &sobmhrawpkts_dcb35[md_offset]; } else if(KNET_SKB_CB(skb)->dcb_type == 36) { if (md) *md = &sobmhrawpkts_dcb36[md_offset]; } else if(KNET_SKB_CB(skb)->dcb_type == 38) { @@ -1252,6 +1279,8 @@ int bksync_ptp_hw_tstamp_tx_meta_get(int dev_no, if (md) *md = &sobmhudpipv4_dcb32[md_offset]; } else if(KNET_SKB_CB(skb)->dcb_type == 26) { if (md) *md = &sobmhudpipv4_dcb26[md_offset]; + } else if(KNET_SKB_CB(skb)->dcb_type == 35) { + if (md) *md = &sobmhudpipv4_dcb35[md_offset]; } else if(KNET_SKB_CB(skb)->dcb_type == 36) { if (md) *md = &sobmhudpipv4_dcb36[md_offset]; } else if(KNET_SKB_CB(skb)->dcb_type == 38) { @@ -1264,6 +1293,8 @@ int bksync_ptp_hw_tstamp_tx_meta_get(int dev_no, if (md) *md = &sobmhudpipv6_dcb32[md_offset]; } else if(KNET_SKB_CB(skb)->dcb_type == 26) { if (md) *md = &sobmhudpipv6_dcb26[md_offset]; + } else if(KNET_SKB_CB(skb)->dcb_type == 35) { + if (md) *md = &sobmhudpipv6_dcb35[md_offset]; } else if(KNET_SKB_CB(skb)->dcb_type == 36) { if (md) *md = &sobmhudpipv6_dcb36[md_offset]; } else if(KNET_SKB_CB(skb)->dcb_type == 38) { @@ -1276,6 +1307,8 @@ int bksync_ptp_hw_tstamp_tx_meta_get(int dev_no, if (md) *md = &sobmhudpipv4_dcb32[md_offset]; } else if(KNET_SKB_CB(skb)->dcb_type == 26) { if (md) *md = &sobmhudpipv4_dcb26[md_offset]; + } else if(KNET_SKB_CB(skb)->dcb_type == 35) { + if (md) *md = &sobmhudpipv4_dcb35[md_offset]; } else if(KNET_SKB_CB(skb)->dcb_type == 36) { if (md) *md = &sobmhudpipv4_dcb36[md_offset]; } else if(KNET_SKB_CB(skb)->dcb_type == 38) { @@ -1285,7 +1318,7 @@ int bksync_ptp_hw_tstamp_tx_meta_get(int dev_no, } - if ((hwts == HWTSTAMP_TX_ONESTEP_SYNC) && + if ((hwts == HWTSTAMP_TX_ONESTEP_SYNC) && BKSYNC_PTP_EVENT_MSG(skb->data[ptp_hdr_offset])) { /* One Step Timestamp Field updation */ int corr_offset = ptp_hdr_offset + 8; @@ -1295,6 +1328,7 @@ int bksync_ptp_hw_tstamp_tx_meta_get(int dev_no, int udp_csum_regen; u32 udp_csum20; u16 udp_csum; + int port; udp_csum = SKB_U16_GET(skb, (ptp_hdr_offset - 2)); @@ -1360,12 +1394,15 @@ int bksync_ptp_hw_tstamp_tx_meta_get(int dev_no, skb->data[ptp_hdr_offset - 1] = ((udp_csum ) & 0xFF); } - if (skb->data[ptp_hdr_offset] == DELAY_REQ) { + if (skb->data[ptp_hdr_offset] == IEEE1588_MSGTYPE_DELREQ) { *tstamp = ptptime; DBG_VERB(("ptp delay req packet tstamp : 0x%llx corrField: 0x%llx\n", ptptime, corrField)); } + port = KNET_SKB_CB(skb)->port; + port -= 1; + ptp_priv->port_stats[port].pkt_txonestep += 1; } return 0; @@ -1425,14 +1462,14 @@ static void bksync_ptp_time_keep_deinit(void) static int bksync_ptp_init(struct ptp_clock_info *ptp) { - return bksync_cmd_go(BCM_KSYNC_INIT, NULL, NULL); + return bksync_cmd_go(BKSYNC_INIT, NULL, NULL); } static int bksync_ptp_deinit(struct ptp_clock_info *ptp) { bksync_ptp_time_keep_deinit(); - return bksync_cmd_go(BCM_KSYNC_DEINIT, NULL, NULL); + return bksync_cmd_go(BKSYNC_DEINIT, NULL, NULL); } /* @@ -1450,14 +1487,15 @@ static void *bksync_proc_seq_start(struct seq_file *s, loff_t *pos) /* beginning a new sequence ? */ if ( (int)*pos == 0 && ptp_priv->shared_addr != NULL) { - seq_printf(s, "Port Bitmap : %08llx%08llx\n", + seq_printf(s, "TwoStep Port Bitmap : %08llx%08llx\n", (uint64_t)(ptp_priv->shared_addr->portmap[1]), (uint64_t)(ptp_priv->shared_addr->portmap[0])); - seq_printf(s,"%4s| %9s| %9s| %9s| %9s| %9s| %9s|\n", - "Port", "RxCounter", "TxCounter", "TSTimeout", "TSRead", "TSMatch", "TSDiscard"); + seq_printf(s,"%4s| %9s| %9s| %9s| %9s| %9s| %9s| %9s| %9s| %9s| %9s| %9s\n", + "Port", "RxCounter", "TxCounter", "TxOneStep", "TSTimeout", "TSRead", "TSMatch", "TSDiscard", + "TimeHi" , "TimeLo", "TimeAvg", "FIFORx"); } - if (ptp_priv->shared_addr != NULL && (int)*pos < (ptp_priv->num_pports)) + if ((int)*pos < (ptp_priv->num_pports)) return (void *)(unsigned long)(*pos + 1); /* End of the sequence, return NULL */ return NULL; @@ -1490,33 +1528,24 @@ static int bksync_proc_seq_show(struct seq_file *s, void *v) { unsigned long port = (unsigned long)v; port = port - 1; - if (HOSTCMD_USE_REGS) { - if (ptp_priv->port_stats[port].pkt_rxctr || ptp_priv->port_stats[port].pkt_txctr || - ptp_priv->port_stats[port].tsts_discard || ptp_priv->port_stats[port].tsts_timeout || - ptp_priv->shared_addr->port_ts_data[port].ts_cnt || ptp_priv->port_stats[port].tsts_match) { - seq_printf(s, "%4lu | %9d| %9d| %9d| %9d| %9d| %9d| %s\n", (port + 1), - ptp_priv->port_stats[port].pkt_rxctr, - ptp_priv->port_stats[port].pkt_txctr, - ptp_priv->port_stats[port].tsts_timeout, - ptp_priv->shared_addr->port_ts_data[port].ts_cnt, - ptp_priv->port_stats[port].tsts_match, - ptp_priv->port_stats[port].tsts_discard, - ptp_priv->port_stats[port].pkt_txctr != ptp_priv->port_stats[port].tsts_match ? "***":""); - } - } else { - if (ptp_priv->pkt_rxctr[port] || ptp_priv->pkt_txctr[port] || - ptp_priv->ts_discard[port] || ptp_priv->ts_timeout[port] || - ptp_priv->shared_addr->port_ts_data[port].ts_cnt || ptp_priv->ts_match[port]) { - seq_printf(s, "%4lu | %9d| %9d| %9d| %9d| %9d| %9d| %s\n", (port + 1), - ptp_priv->pkt_rxctr[port], - ptp_priv->pkt_txctr[port], - ptp_priv->ts_timeout[port], + if (ptp_priv->port_stats[port].pkt_rxctr || ptp_priv->port_stats[port].pkt_txctr || + ptp_priv->port_stats[port].pkt_txonestep|| + ptp_priv->port_stats[port].tsts_discard || ptp_priv->port_stats[port].tsts_timeout || + ptp_priv->shared_addr->port_ts_data[port].ts_cnt || ptp_priv->port_stats[port].tsts_match) { + seq_printf(s, "%4lu | %9d| %9d| %9d| %9d| %9d| %9d| %9d| %9lld| %9lld | %9d|%9d | %s\n", (port + 1), + ptp_priv->port_stats[port].pkt_rxctr, + ptp_priv->port_stats[port].pkt_txctr, + ptp_priv->port_stats[port].pkt_txonestep, + ptp_priv->port_stats[port].tsts_timeout, ptp_priv->shared_addr->port_ts_data[port].ts_cnt, - ptp_priv->ts_match[port], - ptp_priv->ts_discard[port], - ptp_priv->pkt_txctr[port] != ptp_priv->ts_match[port] ? "***":""); + ptp_priv->port_stats[port].tsts_match, + ptp_priv->port_stats[port].tsts_discard, + ptp_priv->port_stats[port].tsts_worst_fetch_time, + ptp_priv->port_stats[port].tsts_best_fetch_time, + ptp_priv->port_stats[port].tsts_avg_fetch_time, + ptp_priv->port_stats[port].fifo_rxctr, + ptp_priv->port_stats[port].pkt_txctr != ptp_priv->port_stats[port].tsts_match ? "***":""); } - } return 0; } @@ -1549,19 +1578,12 @@ bksync_proc_txts_write(struct file *file, const char *buf, if ((ptr = strstr(debug_str, "clear")) != NULL) { for (port = 0; port < ptp_priv->num_pports; port++) { - if (HOSTCMD_USE_REGS) { - ptp_priv->port_stats[port].pkt_rxctr = 0; - ptp_priv->port_stats[port].pkt_txctr = 0; - ptp_priv->port_stats[port].tsts_discard = 0; - ptp_priv->port_stats[port].tsts_timeout = 0; - ptp_priv->port_stats[port].tsts_match = 0; - } else { - ptp_priv->pkt_rxctr[port] = 0; - ptp_priv->pkt_txctr[port] = 0; - ptp_priv->ts_discard[port] = 0; - ptp_priv->ts_timeout[port] = 0; - ptp_priv->ts_match[port] = 0; - } + ptp_priv->port_stats[port].pkt_rxctr = 0; + ptp_priv->port_stats[port].pkt_txctr = 0; + ptp_priv->port_stats[port].pkt_txonestep = 0; + ptp_priv->port_stats[port].tsts_timeout = 0; + ptp_priv->port_stats[port].tsts_match = 0; + ptp_priv->port_stats[port].tsts_discard = 0; if (ptp_priv->shared_addr) ptp_priv->shared_addr->port_ts_data[port].ts_cnt = 0; } @@ -1581,91 +1603,90 @@ struct file_operations bksync_proc_txts_file_ops = { release: seq_release, }; +/* + * Driver Debug Proc Entry + */ static int -bksync_proc_init(void) +bksync_proc_debug_show(struct seq_file *m, void *v) { - struct proc_dir_entry *entry; - - PROC_CREATE(entry, "stats", 0666, bksync_proc_root, &bksync_proc_txts_file_ops); - if (entry == NULL) { - return -1; - } + seq_printf(m, "Configuration:\n"); + seq_printf(m, " debug: 0x%x\n", debug); return 0; } -static int -bksync_proc_cleanup(void) +static ssize_t +bksync_proc_debug_write(struct file *file, const char *buf, + size_t count, loff_t *loff) { - remove_proc_entry("stats", bksync_proc_root); - return 0; -} + char debug_str[40]; + char *ptr; -static void bksync_ptp_cmicm_dma_init(int dcb_type) -{ - int endianess; - int num_pports = 128; - dma_addr_t dma_mem = 0; + if (copy_from_user(debug_str, buf, count)) { + return -EFAULT; + } - /* Initialize the Base address for CMIC and shared Memory access */ - ptp_priv->base_addr = lkbde_get_dev_virt(0); - ptp_priv->dma_dev = lkbde_get_dma_dev(0); + if ((ptr = strstr(debug_str, "debug=")) != NULL) { + ptr += 6; + debug = simple_strtol(ptr, NULL, 0); + } else { + gprintk("Warning: unknown configuration\n"); + } - ptp_priv->dma_mem_size = 16384;/*sizeof(bksync_uc_linux_ipc_t);*/ + return count; +} - if (ptp_priv->shared_addr == NULL) { - DBG_ERR(("Allocate shared memory with R5\n")); - ptp_priv->shared_addr = DMA_ALLOC_COHERENT(ptp_priv->dma_dev, - ptp_priv->dma_mem_size, - &dma_mem); - ptp_priv->dma_mem = (uint64_t)dma_mem; - ptp_priv->num_pports = num_pports; - ptp_priv->port_stats = kzalloc((sizeof(bksync_port_stats_t) * num_pports), GFP_KERNEL); - } +static int bksync_proc_debug_open(struct inode * inode, struct file * file) +{ + return single_open(file, bksync_proc_debug_show, NULL); +} - if (ptp_priv->shared_addr != NULL) { - /* Reset memory */ - memset((void *)ptp_priv->shared_addr, 0, ptp_priv->dma_mem_size); - DBG_ERR(("Shared memory allocation (%d bytes) successful at 0x%016lx.\n", - ptp_priv->dma_mem_size, (long unsigned int)ptp_priv->dma_mem)); -#ifdef __LITTLE_ENDIAN - endianess = 0; -#else - endianess = 1; -#endif - DEV_WRITE32(ptp_priv, CMIC_CMC_SCHAN_MESSAGE_12r(CMIC_CMC_BASE), ((pci_cos << 16) | endianess)); +struct file_operations bksync_proc_debug_file_ops = { + owner: THIS_MODULE, + open: bksync_proc_debug_open, + read: seq_read, + llseek: seq_lseek, + write: bksync_proc_debug_write, + release: single_release, +}; - DEV_WRITE32(ptp_priv, CMIC_CMC_SCHAN_MESSAGE_10r(CMIC_CMC_BASE), - (ptp_priv->dma_mem & 0xffffffff)); - DEV_WRITE32(ptp_priv, CMIC_CMC_SCHAN_MESSAGE_11r(CMIC_CMC_BASE), - (ptp_priv->dma_mem >> 32) & 0xffffffff); - ptp_priv->dcb_type = dcb_type; - } +static int +bksync_proc_init(void) +{ + struct proc_dir_entry *entry; - if (debug & DBG_LVL_VERB) { - printk(KERN_EMERG"%s %p:%p\n",__FUNCTION__, - ptp_priv->base_addr,(void *)ptp_priv->shared_addr); + PROC_CREATE(entry, "stats", 0666, bksync_proc_root, &bksync_proc_txts_file_ops); + if (entry == NULL) { + return -1; + } + PROC_CREATE(entry, "debug", 0666, bksync_proc_root, &bksync_proc_debug_file_ops); + if (entry == NULL) { + return -1; } + return 0; +} - return; +static int +bksync_proc_cleanup(void) +{ + remove_proc_entry("stats", bksync_proc_root); + remove_proc_entry("debug", bksync_proc_root); + return 0; } -static void bksync_ptp_cmicx_dma_init(int dcb_type) +static void bksync_ptp_dma_init(int dcb_type) { int endianess; int num_pports = 256; - /* Initialize the Base address for CMIC and shared Memory access */ - ptp_priv->base_addr = lkbde_get_dev_virt(0); - ptp_priv->dma_dev = lkbde_get_dma_dev(0); + ptp_priv->num_pports = num_pports; ptp_priv->dcb_type = dcb_type; ptp_priv->dma_mem_size = 16384;/*sizeof(bksync_uc_linux_ipc_t);*/ if (ptp_priv->shared_addr == NULL) { ptp_priv->shared_addr = kzalloc(16384, GFP_KERNEL); - ptp_priv->num_pports = num_pports; ptp_priv->port_stats = kzalloc((sizeof(bksync_port_stats_t) * num_pports), GFP_KERNEL); } @@ -1678,10 +1699,10 @@ static void bksync_ptp_cmicx_dma_init(int dcb_type) #else endianess = 1; #endif - DEV_WRITE32(ptp_priv, CMIC_CMC_SCHAN_MESSAGE_12r(CMIC_CMC_BASE), ((pci_cos << 16) | endianess)); + DEV_WRITE32(ptp_priv, CMIC_CMC_SCHAN_MESSAGE_14r(CMIC_CMC_BASE), ((pci_cos << 16) | endianess)); - DEV_WRITE32(ptp_priv, CMIC_CMC_SCHAN_MESSAGE_10r(CMIC_CMC_BASE), 1); - DEV_WRITE32(ptp_priv, CMIC_CMC_SCHAN_MESSAGE_11r(CMIC_CMC_BASE), 1); + DEV_WRITE32(ptp_priv, CMIC_CMC_SCHAN_MESSAGE_15r(CMIC_CMC_BASE), 1); + DEV_WRITE32(ptp_priv, CMIC_CMC_SCHAN_MESSAGE_16r(CMIC_CMC_BASE), 1); } @@ -1690,6 +1711,7 @@ static void bksync_ptp_cmicx_dma_init(int dcb_type) ptp_priv->base_addr,(void *)ptp_priv->shared_addr); } + ptp_priv->mirror_encap_bmp = 0x0; hostcmd_regs[0] = CMIC_CMC_SCHAN_MESSAGE_21r(CMIC_CMC_BASE); hostcmd_regs[1] = CMIC_CMC_SCHAN_MESSAGE_20r(CMIC_CMC_BASE); @@ -1701,28 +1723,6 @@ static void bksync_ptp_cmicx_dma_init(int dcb_type) } -static void bksync_ptp_dma_init(int dcb_type) -{ - switch (dcb_type) { - case 26: - bksync_ptp_cmicm_dma_init(dcb_type); - ptp_priv->dcb_type = dcb_type; - break; - case 32: - case 36: - case 38: - bksync_ptp_cmicx_dma_init(dcb_type); - ptp_priv->dcb_type = dcb_type; - break; - default: - break; - } - - return; -} - - - /** * bksync_ioctl_cmd_handler * @kmsg: kcom message - ptp clock ioctl command. @@ -1732,6 +1732,7 @@ static void bksync_ptp_dma_init(int dcb_type) static int bksync_ioctl_cmd_handler(kcom_msg_clock_cmd_t *kmsg, int len, int dcb_type) { + u32 fw_status; kmsg->hdr.type = KCOM_MSG_TYPE_RSP; if (!module_initialized && kmsg->clock_info.cmd != KSYNC_M_HW_INIT) { @@ -1744,6 +1745,20 @@ bksync_ioctl_cmd_handler(kcom_msg_clock_cmd_t *kmsg, int len, int dcb_type) pci_cos = kmsg->clock_info.data[0]; if (kmsg->clock_info.data[1] == 0 || kmsg->clock_info.data[1] == 1) { fw_core = kmsg->clock_info.data[1]; + DEV_READ32(ptp_priv, CMIC_CMC_SCHAN_MESSAGE_21r(CMIC_CMC_BASE), &fw_status); + + /* Return success if the app is already initialized. */ + if (module_initialized) { + kmsg->hdr.status = KCOM_E_NONE; + return sizeof(kcom_msg_hdr_t); + } + + /* Return error if the app is not ready yet. */ + if (fw_status != 0xBADC0DE1) { + kmsg->hdr.status = KCOM_E_RESOURCE; + return sizeof(kcom_msg_hdr_t); + } + bksync_ptp_dma_init(dcb_type); if (bksync_ptp_init(&(ptp_priv->ptp_caps)) >= 0) { module_initialized = 1; @@ -1757,6 +1772,12 @@ bksync_ioctl_cmd_handler(kcom_msg_clock_cmd_t *kmsg, int len, int dcb_type) case KSYNC_M_HW_TS_DISABLE: bksync_ptp_hw_tstamp_disable(0, kmsg->clock_info.data[0], 0); break; + case KSYNC_M_MTP_TS_UPDATE_ENABLE: + bksync_ptp_mirror_encap_update(0, kmsg->clock_info.data[0], TRUE); + break; + case KSYNC_M_MTP_TS_UPDATE_DISABLE: + bksync_ptp_mirror_encap_update(0, kmsg->clock_info.data[0], FALSE); + break; case KSYNC_M_VERSION: break; default: @@ -1813,6 +1834,10 @@ static int bksync_ptp_register(void) /* Register ptp clock driver with bksync_ptp_caps */ ptp_priv->ptp_clock = ptp_clock_register(&ptp_priv->ptp_caps, NULL); + /* Initialize the Base address for CMIC and shared Memory access */ + ptp_priv->base_addr = lkbde_get_dev_virt(0); + ptp_priv->dma_dev = lkbde_get_dma_dev(0); + if (IS_ERR(ptp_priv->ptp_clock)) { ptp_priv->ptp_clock = NULL; } else if (ptp_priv->ptp_clock) { @@ -1858,8 +1883,8 @@ static int bksync_ptp_remove(void) bkn_hw_tstamp_ioctl_cmd_cb_unregister(bksync_ioctl_cmd_handler); if (module_initialized) { - DEV_WRITE32(ptp_priv, CMIC_CMC_SCHAN_MESSAGE_10r(CMIC_CMC_BASE), 0); - DEV_WRITE32(ptp_priv, CMIC_CMC_SCHAN_MESSAGE_11r(CMIC_CMC_BASE), 0); + DEV_WRITE32(ptp_priv, CMIC_CMC_SCHAN_MESSAGE_15r(CMIC_CMC_BASE), 0); + DEV_WRITE32(ptp_priv, CMIC_CMC_SCHAN_MESSAGE_16r(CMIC_CMC_BASE), 0); } /* Deinitialize the PTP */ bksync_ptp_deinit(&(ptp_priv->ptp_caps)); @@ -1870,12 +1895,7 @@ static int bksync_ptp_remove(void) ptp_priv->port_stats = NULL; } if (ptp_priv->shared_addr != NULL) { - if (HOSTCMD_USE_REGS) { - kfree((void *)ptp_priv->shared_addr); - } else { - DMA_FREE_COHERENT(ptp_priv->dma_dev, ptp_priv->dma_mem_size, - (void *)ptp_priv->shared_addr, (dma_addr_t)ptp_priv->dma_mem); - } + kfree((void *)ptp_priv->shared_addr); ptp_priv->shared_addr = NULL; DBG_ERR(("Free R5 memory\n")); } @@ -1906,13 +1926,13 @@ static int bksync_ptp_remove(void) * Always 0 */ static int -_pprint(void) +_pprint(struct seq_file *m) { #if LINUX_VERSION_CODE > KERNEL_VERSION(3,17,0) /* put some goodies here */ - pprintf("Broadcom BCM PTP Hardware Clock Module\n"); + pprintf(m, "Broadcom BCM PTP Hardware Clock Module\n"); #else - pprintf("Broadcom BCM PTP Hardware Clock Module not supported\n"); + pprintf(m, "Broadcom BCM PTP Hardware Clock Module not supported\n"); #endif return 0; } diff --git a/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/include/bcm-knet.h b/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/include/bcm-knet.h index df8874fb1f70..8d710869824f 100644 --- a/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/include/bcm-knet.h +++ b/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/include/bcm-knet.h @@ -1,5 +1,10 @@ /* - * Copyright 2017 Broadcom + * Copyright 2007-2020 Broadcom Inc. All rights reserved. + * + * Permission is granted to use, copy, modify and/or distribute this + * software under either one of the licenses below. + * + * License Option 1: GPL * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License, version 2, as @@ -12,6 +17,12 @@ * * You should have received a copy of the GNU General Public License * version 2 (GPLv2) along with this source code. + * + * + * License Option 2: Broadcom Open Network Switch APIs (OpenNSA) license + * + * This software is governed by the Broadcom Open Network Switch APIs license: + * https://www.broadcom.com/products/ethernet-connectivity/software/opennsa */ /* * $Id: bcm-knet.h,v 1.4 Broadcom SDK $ @@ -137,7 +148,6 @@ bkn_hw_tstamp_ioctl_cmd_cb_register(knet_hw_tstamp_ioctl_cmd_cb_f hw_tstamp_ioct extern int bkn_hw_tstamp_ioctl_cmd_cb_unregister(knet_hw_tstamp_ioctl_cmd_cb_f hw_tstamp_ioctl_cmd_cb); - typedef struct { uint8 cmic_type; uint8 dcb_type; diff --git a/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/include/gmodule.h b/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/include/gmodule.h index 22cef82a8ddc..a9db097f3062 100644 --- a/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/include/gmodule.h +++ b/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/include/gmodule.h @@ -1,5 +1,10 @@ /* - * Copyright 2017 Broadcom + * Copyright 2007-2020 Broadcom Inc. All rights reserved. + * + * Permission is granted to use, copy, modify and/or distribute this + * software under either one of the licenses below. + * + * License Option 1: GPL * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License, version 2, as @@ -12,6 +17,12 @@ * * You should have received a copy of the GNU General Public License * version 2 (GPLv2) along with this source code. + * + * + * License Option 2: Broadcom Open Network Switch APIs (OpenNSA) license + * + * This software is governed by the Broadcom Open Network Switch APIs license: + * https://www.broadcom.com/products/ethernet-connectivity/software/opennsa */ /* * $Id: gmodule.h,v 1.9 Broadcom SDK $ @@ -23,6 +34,7 @@ #define __COMMON_LINUX_KRN_GMODULE_H__ #include +#include typedef struct gmodule_s { @@ -32,9 +44,7 @@ typedef struct gmodule_s { int (*init)(void); int (*cleanup)(void); - - int (*pprint)(void); - + int (*pprint)(struct seq_file *m); int (*open)(void); int (*ioctl)(unsigned int cmd, unsigned long arg); int (*close)(void); @@ -48,8 +58,8 @@ extern gmodule_t* gmodule_get(void); /* Proc Filesystem information */ -extern int pprintf(const char* fmt, ...) - __attribute__ ((format (printf, 1, 2))); +extern int pprintf(struct seq_file *m, const char* fmt, ...) + __attribute__ ((format (printf, 2, 3))); extern int gmodule_vpprintf(char** page, const char* fmt, va_list args) __attribute__ ((format (printf, 2, 0))); extern int gmodule_pprintf(char** page, const char* fmt, ...) diff --git a/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/include/lkm.h b/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/include/lkm.h index 56d641c9c87c..9ea8fc5896d8 100644 --- a/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/include/lkm.h +++ b/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/include/lkm.h @@ -1,5 +1,10 @@ /* - * Copyright 2017 Broadcom + * Copyright 2007-2020 Broadcom Inc. All rights reserved. + * + * Permission is granted to use, copy, modify and/or distribute this + * software under either one of the licenses below. + * + * License Option 1: GPL * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License, version 2, as @@ -12,6 +17,12 @@ * * You should have received a copy of the GNU General Public License * version 2 (GPLv2) along with this source code. + * + * + * License Option 2: Broadcom Open Network Switch APIs (OpenNSA) license + * + * This software is governed by the Broadcom Open Network Switch APIs license: + * https://www.broadcom.com/products/ethernet-connectivity/software/opennsa */ /* * $Id: lkm.h,v 1.22 Broadcom SDK $ @@ -34,7 +45,8 @@ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) #include #endif -#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32) +/* The version kconfig.h became available in. */ #include #endif #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0) diff --git a/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/knet-cb/Makefile b/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/knet-cb/Makefile index 3de3e07080c4..b8697731dd4e 100644 --- a/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/knet-cb/Makefile +++ b/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/knet-cb/Makefile @@ -1,5 +1,10 @@ # -# Copyright 2017 Broadcom +# Copyright 2007-2020 Broadcom Inc. All rights reserved. +# +# Permission is granted to use, copy, modify and/or distribute this +# software under either one of the licenses below. +# +# License Option 1: GPL # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License, version 2, as @@ -12,6 +17,12 @@ # # You should have received a copy of the GNU General Public License # version 2 (GPLv2) along with this source code. +# +# +# License Option 2: Broadcom Open Network Switch APIs (OpenNSA) license +# +# This software is governed by the Broadcom Open Network Switch APIs license: +# https://www.broadcom.com/products/ethernet-connectivity/software/opennsa # # -*- Makefile -*- # $Id: Makefile,v 1.3 Broadcom SDK $ diff --git a/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/knet-cb/knet-cb.c b/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/knet-cb/knet-cb.c index 1626d33c1c5d..650a4ced1d7a 100644 --- a/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/knet-cb/knet-cb.c +++ b/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/knet-cb/knet-cb.c @@ -107,7 +107,7 @@ static struct sk_buff *strip_tag_rx_cb(struct sk_buff *skb, int dev_no, void *me static struct sk_buff *strip_tag_tx_cb(struct sk_buff *skb, int dev_no, void *meta); static int strip_tag_filter_cb(uint8_t * pkt, int size, int dev_no, void *meta, int chan, kcom_filter_t * kf); -static int _pprint(void); +static int _pprint(struct seq_file *m); static int _cleanup(void); static int _init(void); @@ -333,11 +333,11 @@ knet_filter_cb(uint8_t * pkt, int size, int dev_no, void *meta, int chan, kcom_filter_t *kf) { /* check for filter callback handler */ -#ifdef PSAMPLE_SUPPORT + #ifdef PSAMPLE_SUPPORT if (strncmp(kf->desc, PSAMPLE_CB_NAME, KCOM_FILTER_DESC_MAX) == 0) { return psample_filter_cb (pkt, size, dev_no, meta, chan, kf); } -#endif + #endif return strip_tag_filter_cb (pkt, size, dev_no, meta, chan, kf); } @@ -366,12 +366,12 @@ knet_netif_destroy_cb(int unit, kcom_netif_t *netif, struct net_device *dev) * % cat /proc/linux-knet-cb */ static int -_pprint(void) +_pprint(struct seq_file *m) { - pprintf("Broadcom Linux KNET Call-Back: Untagged VLAN Stripper\n"); - pprintf(" %lu stripped packets\n", strip_stats.stripped); - pprintf(" %lu packets checked\n", strip_stats.checked); - pprintf(" %lu packets skipped\n", strip_stats.skipped); + pprintf(m, "Broadcom Linux KNET Call-Back: Untagged VLAN Stripper\n"); + pprintf(m, " %lu stripped packets\n", strip_stats.stripped); + pprintf(m ," %lu packets checked\n", strip_stats.checked); + pprintf(m, " %lu packets skipped\n", strip_stats.skipped); return 0; } @@ -395,6 +395,7 @@ _cleanup(void) #ifdef PSAMPLE_SUPPORT psample_cleanup(); #endif + return 0; } @@ -410,9 +411,10 @@ _init(void) bkn_tx_skb_cb_register(strip_tag_tx_cb); } -#ifdef PSAMPLE_SUPPORT + #ifdef PSAMPLE_SUPPORT psample_init(); -#endif + #endif + bkn_filter_cb_register(knet_filter_cb); bkn_netif_create_cb_register(knet_netif_create_cb); diff --git a/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/knet-cb/psample-cb.c b/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/knet-cb/psample-cb.c index e1a6086a52ae..755955b20fdd 100644 --- a/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/knet-cb/psample-cb.c +++ b/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/knet-cb/psample-cb.c @@ -967,7 +967,7 @@ psample_proc_stats_open(struct inode * inode, struct file * file) * psample stats Proc Write Entry * * Syntax: - * write any value to clear stats + * write any value to clear stats */ static ssize_t psample_proc_stats_write(struct file *file, const char *buf, @@ -1009,13 +1009,13 @@ int psample_cleanup(void) int psample_init(void) { #define PROCFS_MAX_PATH 1024 + #define PSAMPLE_PROCFS_PATH "bcm/knet-cb" char psample_procfs_path[PROCFS_MAX_PATH]; struct proc_dir_entry *entry; /* create procfs for psample */ - snprintf(psample_procfs_path, PROCFS_MAX_PATH, "bcm/knet-cb"); - knet_cb_proc_root = proc_mkdir(psample_procfs_path, NULL); - snprintf(psample_procfs_path, PROCFS_MAX_PATH, "%s/%s", psample_procfs_path, PSAMPLE_CB_NAME); + proc_mkdir(PSAMPLE_PROCFS_PATH, NULL); + snprintf(psample_procfs_path, sizeof(psample_procfs_path), "%s/%s", PSAMPLE_PROCFS_PATH, PSAMPLE_CB_NAME); psample_proc_root = proc_mkdir(psample_procfs_path, NULL); /* create procfs for psample stats */ @@ -1031,7 +1031,7 @@ int psample_init(void) gprintk("%s: Unable to create procfs entry '/procfs/%s/rate'\n", __func__, psample_procfs_path); return -1; } - + /* create procfs for setting sample size */ PROC_CREATE(entry, "size", 0666, psample_proc_root, &psample_proc_size_file_ops); if (entry == NULL) { @@ -1059,23 +1059,23 @@ int psample_init(void) memset(&g_psample_work, 0, sizeof(psample_work_t)); /* setup psample_info struct */ - INIT_LIST_HEAD(&g_psample_info.netif_list); + INIT_LIST_HEAD(&g_psample_info.netif_list); spin_lock_init(&g_psample_info.lock); /* setup psample work queue */ - spin_lock_init(&g_psample_work.lock); - INIT_LIST_HEAD(&g_psample_work.pkt_list); + spin_lock_init(&g_psample_work.lock); + INIT_LIST_HEAD(&g_psample_work.pkt_list); INIT_WORK(&g_psample_work.wq, psample_task); - /* get net namespace */ + /* get net namespace */ g_psample_info.netns = get_net_ns_by_pid(current->pid); if (!g_psample_info.netns) { gprintk("%s: Could not get network namespace for pid %d\n", __func__, current->pid); return (-1); } - PSAMPLE_CB_DBG_PRINT("%s: current->pid %d, netns 0x%p, sample_size %d\n", __func__, + PSAMPLE_CB_DBG_PRINT("%s: current->pid %d, netns 0x%p, sample_size %d\n", __func__, current->pid, g_psample_info.netns, psample_size); - + return 0; } diff --git a/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/psample/psample.c b/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/psample/psample.c index 1deccacc5edd..99317cbf30cc 100644 --- a/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/psample/psample.c +++ b/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/psample/psample.c @@ -224,7 +224,7 @@ void psample_sample_packet(struct psample_group *group, struct sk_buff *skb, data_len = PSAMPLE_MAX_PACKET_SIZE - meta_len - NLA_HDRLEN - NLA_ALIGNTO; - nl_skb = genlmsg_new(meta_len + data_len, GFP_ATOMIC); + nl_skb = genlmsg_new(meta_len + nla_total_size(data_len), GFP_ATOMIC); if (unlikely(!nl_skb)) return; diff --git a/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/shared/Makefile b/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/shared/Makefile index 5e97a3a32123..966f639f6983 100644 --- a/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/shared/Makefile +++ b/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/shared/Makefile @@ -1,5 +1,10 @@ # -# Copyright 2017 Broadcom +# Copyright 2007-2020 Broadcom Inc. All rights reserved. +# +# Permission is granted to use, copy, modify and/or distribute this +# software under either one of the licenses below. +# +# License Option 1: GPL # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License, version 2, as @@ -12,6 +17,12 @@ # # You should have received a copy of the GNU General Public License # version 2 (GPLv2) along with this source code. +# +# +# License Option 2: Broadcom Open Network Switch APIs (OpenNSA) license +# +# This software is governed by the Broadcom Open Network Switch APIs license: +# https://www.broadcom.com/products/ethernet-connectivity/software/opennsa # # -*- Makefile -*- # $Id: Makefile,v 1.2 Broadcom SDK $ diff --git a/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/shared/gmodule.c b/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/shared/gmodule.c index cdfaf089674a..3ef000961837 100644 --- a/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/shared/gmodule.c +++ b/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/shared/gmodule.c @@ -1,5 +1,10 @@ /* - * Copyright 2017 Broadcom + * Copyright 2007-2020 Broadcom Inc. All rights reserved. + * + * Permission is granted to use, copy, modify and/or distribute this + * software under either one of the licenses below. + * + * License Option 1: GPL * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License, version 2, as @@ -12,6 +17,12 @@ * * You should have received a copy of the GNU General Public License * version 2 (GPLv2) along with this source code. + * + * + * License Option 2: Broadcom Open Network Switch APIs (OpenNSA) license + * + * This software is governed by the Broadcom Open Network Switch APIs license: + * https://www.broadcom.com/products/ethernet-connectivity/software/opennsa */ /* * $Id: gmodule.c,v 1.20 Broadcom SDK $ @@ -26,8 +37,6 @@ #include #include #include -#include - /* Module Vector Table */ static gmodule_t* _gmodule = NULL; @@ -94,21 +103,18 @@ gdbg(const char* fmt, ...) * Proc FS Utilities */ #if PROC_INTERFACE_KERN_VER_3_10 -static struct seq_file* _proc_buf = NULL; - int -pprintf(const char* fmt, ...) +pprintf(struct seq_file *m, const char* fmt, ...) { va_list args; va_start(args, fmt); - seq_vprintf(_proc_buf, fmt, args); + seq_vprintf(m, fmt, args); va_end(args); return 0; } static int _gmodule_proc_show(struct seq_file *m, void *v){ - _proc_buf = m; - _gmodule->pprint(); + _gmodule->pprint(m); return 0; } @@ -174,7 +180,7 @@ gmodule_pprintf(char** page_ptr, const char* fmt, ...) static char* _proc_buf = NULL; int -pprintf(const char* fmt, ...) +pprintf(struct seq_file *m, const char* fmt, ...) { int rv; @@ -193,7 +199,7 @@ static int _gmodule_pprint(char* buf) { PSTART(buf); - _gmodule->pprint(); + _gmodule->pprint(NULL); return PEND(buf); } diff --git a/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/shared/ksal.c b/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/shared/ksal.c index d1caf871f0e2..7f90c59c3a39 100644 --- a/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/shared/ksal.c +++ b/platform/broadcom/saibcm-modules/systems/linux/kernel/modules/shared/ksal.c @@ -1,5 +1,10 @@ /* - * Copyright 2017 Broadcom + * Copyright 2007-2020 Broadcom Inc. All rights reserved. + * + * Permission is granted to use, copy, modify and/or distribute this + * software under either one of the licenses below. + * + * License Option 1: GPL * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License, version 2, as @@ -12,6 +17,12 @@ * * You should have received a copy of the GNU General Public License * version 2 (GPLv2) along with this source code. + * + * + * License Option 2: Broadcom Open Network Switch APIs (OpenNSA) license + * + * This software is governed by the Broadcom Open Network Switch APIs license: + * https://www.broadcom.com/products/ethernet-connectivity/software/opennsa */ /* * $Id: ksal.c,v 1.1 Broadcom SDK $ diff --git a/platform/broadcom/saibcm-modules/systems/linux/user/common/Makefile b/platform/broadcom/saibcm-modules/systems/linux/user/common/Makefile index f95593a383ce..8f59a763e314 100644 --- a/platform/broadcom/saibcm-modules/systems/linux/user/common/Makefile +++ b/platform/broadcom/saibcm-modules/systems/linux/user/common/Makefile @@ -1,5 +1,10 @@ # -# Copyright 2017 Broadcom +# Copyright 2007-2020 Broadcom Inc. All rights reserved. +# +# Permission is granted to use, copy, modify and/or distribute this +# software under either one of the licenses below. +# +# License Option 1: GPL # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License, version 2, as @@ -12,6 +17,12 @@ # # You should have received a copy of the GNU General Public License # version 2 (GPLv2) along with this source code. +# +# +# License Option 2: Broadcom Open Network Switch APIs (OpenNSA) license +# +# This software is governed by the Broadcom Open Network Switch APIs license: +# https://www.broadcom.com/products/ethernet-connectivity/software/opennsa # # -*- Makefile -*- # $Id: Makefile,v 1.4 Broadcom SDK $ @@ -113,6 +124,7 @@ endif ifndef BUILD_KNET BUILD_KNET = 1 endif + # Remove this when LinuxPTP support becomes optional. ifndef BUILD_LPTP BUILD_LPTP = 1 @@ -141,7 +153,6 @@ ifdef BUILD_PSAMPLE all_targets += $(PSAMPLE) ADD_TO_CFLAGS += -DPSAMPLE_SUPPORT - # KnetSync support ifdef BUILD_KNETSYNC @@ -151,17 +162,17 @@ LOCAL_KERNEL_TARGETS += $(patsubst %,$(realpath ..)/$(platform)/%,$(BCM_PTP_CLOC endif # BUILD_KNETSYNC ifeq ($(NO_LOCAL_TARGETS),) -LOCAL_TARGETS +=$(patsubst %,../$(platform)/%,$(PSAMPLE_LOCAL)) -all_targets +=$(LOCAL_TARGETS) + LOCAL_TARGETS +=$(patsubst %,../$(platform)/%,$(PSAMPLE_LOCAL)) + all_targets +=$(LOCAL_TARGETS) endif endif ifdef BUILD_LPTP -all_targets += $(BCM_LPTP) + all_targets += $(BCM_LPTP) ifeq ($(NO_LOCAL_TARGETS),) -LOCAL_TARGETS +=$(patsubst %,../$(platform)/%,$(BCM_LPTP_LOCAL)) -all_targets +=$(LOCAL_TARGETS) + LOCAL_TARGETS +=$(patsubst %,../$(platform)/%,$(BCM_LPTP_LOCAL)) + all_targets +=$(LOCAL_TARGETS) endif endif @@ -191,7 +202,7 @@ CFLAGS:=$(filter-out -fPIC, $(CFLAGS)) # KnetSync Support ifdef BUILD_KNETSYNC -knetsync_subdirs = bcm-ptp-clock + knetsync_subdirs = bcm-ptp-clock endif # BUILD_KNETSYNC kernel_modules: @@ -200,7 +211,7 @@ kernel_modules: ifeq ($(BUILD_KNET),1) $(MAKE) -C $(SDK)/systems/linux/kernel/modules kernel_version=$(kernel_version) \ subdirs="shared bcm-knet" override-target=linux-$(platform) CFLAGS="$(CFLAGS)" -ifdef BUILD_PSAMPLE +ifdef BUILD_PSAMPLE $(MAKE) -C $(SDK)/systems/linux/kernel/modules kernel_version=$(kernel_version) \ subdirs="psample" override-target=linux-$(platform) CFLAGS="$(CFLAGS)" endif diff --git a/platform/broadcom/saibcm-modules/systems/linux/user/gts/Makefile b/platform/broadcom/saibcm-modules/systems/linux/user/gts/Makefile index 466faf02a515..5acaeab271cc 100644 --- a/platform/broadcom/saibcm-modules/systems/linux/user/gts/Makefile +++ b/platform/broadcom/saibcm-modules/systems/linux/user/gts/Makefile @@ -1,5 +1,10 @@ # -# Copyright 2017 Broadcom +# Copyright 2007-2020 Broadcom Inc. All rights reserved. +# +# Permission is granted to use, copy, modify and/or distribute this +# software under either one of the licenses below. +# +# License Option 1: GPL # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License, version 2, as @@ -12,6 +17,12 @@ # # You should have received a copy of the GNU General Public License # version 2 (GPLv2) along with this source code. +# +# +# License Option 2: Broadcom Open Network Switch APIs (OpenNSA) license +# +# This software is governed by the Broadcom Open Network Switch APIs license: +# https://www.broadcom.com/products/ethernet-connectivity/software/opennsa # # -*- Makefile -*- # $Id: Makefile,v 0.1 Broadcom SDK $ diff --git a/platform/broadcom/saibcm-modules/systems/linux/user/iproc-3_14/Makefile b/platform/broadcom/saibcm-modules/systems/linux/user/iproc-3_14/Makefile index c9f538802f6d..b874340ddec2 100644 --- a/platform/broadcom/saibcm-modules/systems/linux/user/iproc-3_14/Makefile +++ b/platform/broadcom/saibcm-modules/systems/linux/user/iproc-3_14/Makefile @@ -1,5 +1,10 @@ # -# Copyright 2017 Broadcom +# Copyright 2007-2020 Broadcom Inc. All rights reserved. +# +# Permission is granted to use, copy, modify and/or distribute this +# software under either one of the licenses below. +# +# License Option 1: GPL # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License, version 2, as @@ -12,6 +17,12 @@ # # You should have received a copy of the GNU General Public License # version 2 (GPLv2) along with this source code. +# +# +# License Option 2: Broadcom Open Network Switch APIs (OpenNSA) license +# +# This software is governed by the Broadcom Open Network Switch APIs license: +# https://www.broadcom.com/products/ethernet-connectivity/software/opennsa # # -*- Makefile -*- # $Id: Makefile,v 1.7 Broadcom SDK $ diff --git a/platform/broadcom/saibcm-modules/systems/linux/user/iproc-4_4/Makefile b/platform/broadcom/saibcm-modules/systems/linux/user/iproc-4_4/Makefile index e8405f5c2a0c..2b724be3202f 100644 --- a/platform/broadcom/saibcm-modules/systems/linux/user/iproc-4_4/Makefile +++ b/platform/broadcom/saibcm-modules/systems/linux/user/iproc-4_4/Makefile @@ -1,5 +1,10 @@ # -# Copyright 2017 Broadcom +# Copyright 2007-2020 Broadcom Inc. All rights reserved. +# +# Permission is granted to use, copy, modify and/or distribute this +# software under either one of the licenses below. +# +# License Option 1: GPL # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License, version 2, as @@ -12,6 +17,12 @@ # # You should have received a copy of the GNU General Public License # version 2 (GPLv2) along with this source code. +# +# +# License Option 2: Broadcom Open Network Switch APIs (OpenNSA) license +# +# This software is governed by the Broadcom Open Network Switch APIs license: +# https://www.broadcom.com/products/ethernet-connectivity/software/opennsa # # -*- Makefile -*- # $Id: Makefile,v 1.7 Broadcom SDK $ diff --git a/platform/broadcom/saibcm-modules/systems/linux/user/iproc/Makefile b/platform/broadcom/saibcm-modules/systems/linux/user/iproc/Makefile index 03300ff8a046..f10c5c37a082 100644 --- a/platform/broadcom/saibcm-modules/systems/linux/user/iproc/Makefile +++ b/platform/broadcom/saibcm-modules/systems/linux/user/iproc/Makefile @@ -1,5 +1,10 @@ # -# Copyright 2017 Broadcom +# Copyright 2007-2020 Broadcom Inc. All rights reserved. +# +# Permission is granted to use, copy, modify and/or distribute this +# software under either one of the licenses below. +# +# License Option 1: GPL # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License, version 2, as @@ -12,6 +17,12 @@ # # You should have received a copy of the GNU General Public License # version 2 (GPLv2) along with this source code. +# +# +# License Option 2: Broadcom Open Network Switch APIs (OpenNSA) license +# +# This software is governed by the Broadcom Open Network Switch APIs license: +# https://www.broadcom.com/products/ethernet-connectivity/software/opennsa # # -*- Makefile -*- # $Id: Makefile,v 1.7 Broadcom SDK $ diff --git a/platform/broadcom/saibcm-modules/systems/linux/user/iproc_64/Makefile b/platform/broadcom/saibcm-modules/systems/linux/user/iproc_64/Makefile index 778c85a03bed..983b3abbced7 100644 --- a/platform/broadcom/saibcm-modules/systems/linux/user/iproc_64/Makefile +++ b/platform/broadcom/saibcm-modules/systems/linux/user/iproc_64/Makefile @@ -1,5 +1,10 @@ # -# Copyright 2017 Broadcom +# Copyright 2007-2020 Broadcom Inc. All rights reserved. +# +# Permission is granted to use, copy, modify and/or distribute this +# software under either one of the licenses below. +# +# License Option 1: GPL # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License, version 2, as @@ -12,6 +17,12 @@ # # You should have received a copy of the GNU General Public License # version 2 (GPLv2) along with this source code. +# +# +# License Option 2: Broadcom Open Network Switch APIs (OpenNSA) license +# +# This software is governed by the Broadcom Open Network Switch APIs license: +# https://www.broadcom.com/products/ethernet-connectivity/software/opennsa # # -*- Makefile -*- # $Id: Makefile,v 1.7 Broadcom SDK $ diff --git a/platform/broadcom/saibcm-modules/systems/linux/user/slk/Makefile b/platform/broadcom/saibcm-modules/systems/linux/user/slk/Makefile index 99d49d285145..6ef360156572 100644 --- a/platform/broadcom/saibcm-modules/systems/linux/user/slk/Makefile +++ b/platform/broadcom/saibcm-modules/systems/linux/user/slk/Makefile @@ -1,5 +1,10 @@ # -# Copyright 2017 Broadcom +# Copyright 2007-2020 Broadcom Inc. All rights reserved. +# +# Permission is granted to use, copy, modify and/or distribute this +# software under either one of the licenses below. +# +# License Option 1: GPL # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License, version 2, as @@ -12,6 +17,12 @@ # # You should have received a copy of the GNU General Public License # version 2 (GPLv2) along with this source code. +# +# +# License Option 2: Broadcom Open Network Switch APIs (OpenNSA) license +# +# This software is governed by the Broadcom Open Network Switch APIs license: +# https://www.broadcom.com/products/ethernet-connectivity/software/opennsa # # -*- Makefile -*- # $Id: Makefile,v 0.1 Broadcom SDK $ diff --git a/platform/broadcom/saibcm-modules/systems/linux/user/x86-smp_generic_64-2_6/Makefile b/platform/broadcom/saibcm-modules/systems/linux/user/x86-smp_generic_64-2_6/Makefile index 29717b3af42a..78c2c0cb1702 100644 --- a/platform/broadcom/saibcm-modules/systems/linux/user/x86-smp_generic_64-2_6/Makefile +++ b/platform/broadcom/saibcm-modules/systems/linux/user/x86-smp_generic_64-2_6/Makefile @@ -1,5 +1,10 @@ # -# Copyright 2017 Broadcom +# Copyright 2007-2020 Broadcom Inc. All rights reserved. +# +# Permission is granted to use, copy, modify and/or distribute this +# software under either one of the licenses below. +# +# License Option 1: GPL # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License, version 2, as @@ -12,6 +17,12 @@ # # You should have received a copy of the GNU General Public License # version 2 (GPLv2) along with this source code. +# +# +# License Option 2: Broadcom Open Network Switch APIs (OpenNSA) license +# +# This software is governed by the Broadcom Open Network Switch APIs license: +# https://www.broadcom.com/products/ethernet-connectivity/software/opennsa # # -*- Makefile -*- # $Id: Makefile,v 1.2 Broadcom SDK $ diff --git a/platform/broadcom/saibcm-modules/systems/linux/user/xlr/Makefile b/platform/broadcom/saibcm-modules/systems/linux/user/xlr/Makefile index 13246d09e78f..e19eeff4aef2 100644 --- a/platform/broadcom/saibcm-modules/systems/linux/user/xlr/Makefile +++ b/platform/broadcom/saibcm-modules/systems/linux/user/xlr/Makefile @@ -1,5 +1,10 @@ # -# Copyright 2017 Broadcom +# Copyright 2007-2020 Broadcom Inc. All rights reserved. +# +# Permission is granted to use, copy, modify and/or distribute this +# software under either one of the licenses below. +# +# License Option 1: GPL # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License, version 2, as @@ -12,6 +17,12 @@ # # You should have received a copy of the GNU General Public License # version 2 (GPLv2) along with this source code. +# +# +# License Option 2: Broadcom Open Network Switch APIs (OpenNSA) license +# +# This software is governed by the Broadcom Open Network Switch APIs license: +# https://www.broadcom.com/products/ethernet-connectivity/software/opennsa # # -*- Makefile -*- # $Id: Makefile,v 0.1 Broadcom SDK $ diff --git a/platform/broadcom/saibcm-modules/tools/mktool.pl b/platform/broadcom/saibcm-modules/tools/mktool.pl index 8800c00613d8..518ab25535c3 100644 --- a/platform/broadcom/saibcm-modules/tools/mktool.pl +++ b/platform/broadcom/saibcm-modules/tools/mktool.pl @@ -1,5 +1,10 @@ # -# Copyright 2017 Broadcom +# Copyright 2007-2020 Broadcom Inc. All rights reserved. +# +# Permission is granted to use, copy, modify and/or distribute this +# software under either one of the licenses below. +# +# License Option 1: GPL # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License, version 2, as @@ -12,6 +17,12 @@ # # You should have received a copy of the GNU General Public License # version 2 (GPLv2) along with this source code. +# +# +# License Option 2: Broadcom Open Network Switch APIs (OpenNSA) license +# +# This software is governed by the Broadcom Open Network Switch APIs license: +# https://www.broadcom.com/products/ethernet-connectivity/software/opennsa # # # mktool.pl diff --git a/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/utils/accton_as4630_54pe_util.py b/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/utils/accton_as4630_54pe_util.py index ed0df177ee13..4039119288a0 100755 --- a/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/utils/accton_as4630_54pe_util.py +++ b/platform/broadcom/sonic-platform-modules-accton/as4630-54pe/utils/accton_as4630_54pe_util.py @@ -214,10 +214,12 @@ def log_os_system(cmd, show): return status, output def driver_inserted(): - ret, lsmod = log_os_system("lsmod| grep accton", 0) + ret, lsmod = log_os_system("ls /sys/module/*accton*", 0) logging.info('mods:'+lsmod) - if len(lsmod) ==0: + if ret : return False + else : + return True #'modprobe cpr_4011_4mxx', diff --git a/platform/broadcom/sonic-platform-modules-accton/as4630-54te/classes/__init__.py b/platform/broadcom/sonic-platform-modules-accton/as4630-54te/classes/__init__.py new file mode 100755 index 000000000000..e69de29bb2d1 diff --git a/platform/broadcom/sonic-platform-modules-accton/as4630-54te/classes/fanutil.py b/platform/broadcom/sonic-platform-modules-accton/as4630-54te/classes/fanutil.py new file mode 100755 index 000000000000..121b8409a585 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as4630-54te/classes/fanutil.py @@ -0,0 +1,213 @@ +#!/usr/bin/env python +# Copyright (c) 2019 Edgecore Networks Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT +# LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS +# FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. +# +# See the Apache Version 2.0 License for specific language governing +# permissions and limitations under the License. +# +# ------------------------------------------------------------------ +# HISTORY: +# mm/dd/yyyy (A.D.) +# 10/24/2019:Jostar craete for as4630_54te +# ------------------------------------------------------------------ + +try: + import logging +except ImportError as e: + raise ImportError('%s - required module not found' % str(e)) + + +class FanUtil(object): + """Platform-specific FanUtil class""" + + FAN_NUM_ON_MAIN_BROAD = 3 + FAN_NUM_1_IDX = 1 + FAN_NUM_2_IDX = 2 + FAN_NUM_3_IDX = 3 + + FAN_NODE_NUM_OF_MAP = 4 + FAN_NODE_FAULT_IDX_OF_MAP = 1 + FAN_NODE_DIR_IDX_OF_MAP = 2 + FAN_NODE_PRESENT_IDX_OF_MAP = 3 + FAN_NODE_SPEED_IDX_OF_MAP = 4 + + BASE_VAL_PATH = '/sys/bus/i2c/devices/3-0060/{0}' + FAN_DUTY_PATH = '/sys/bus/i2c/devices/3-0060/fan_duty_cycle_percentage' + + """ Dictionary where + key1 = fan id index (integer) starting from 1 + key2 = fan node index (interger) starting from 1 + value = path to fan device file (string) """ + _fan_device_path_mapping = {} + + _fan_device_node_mapping = { + (FAN_NUM_1_IDX, FAN_NODE_FAULT_IDX_OF_MAP): 'fan_fault_1', + (FAN_NUM_1_IDX, FAN_NODE_DIR_IDX_OF_MAP): 'fan_direction_1', + (FAN_NUM_1_IDX, FAN_NODE_PRESENT_IDX_OF_MAP): 'fan_present_1', + (FAN_NUM_1_IDX, FAN_NODE_SPEED_IDX_OF_MAP): 'fan1_input', + + + (FAN_NUM_2_IDX, FAN_NODE_FAULT_IDX_OF_MAP): 'fan_fault_2', + (FAN_NUM_2_IDX, FAN_NODE_DIR_IDX_OF_MAP): 'fan_direction_2', + (FAN_NUM_2_IDX, FAN_NODE_PRESENT_IDX_OF_MAP): 'fan_present_2', + (FAN_NUM_2_IDX, FAN_NODE_SPEED_IDX_OF_MAP): 'fan2_input', + + (FAN_NUM_3_IDX, FAN_NODE_FAULT_IDX_OF_MAP): 'fan_fault_3', + (FAN_NUM_3_IDX, FAN_NODE_DIR_IDX_OF_MAP): 'fan_direction_3', + (FAN_NUM_3_IDX, FAN_NODE_PRESENT_IDX_OF_MAP): 'fan_present_3', + (FAN_NUM_3_IDX, FAN_NODE_SPEED_IDX_OF_MAP): 'fan3_input', + } + + def _get_fan_device_node(self, fan_num, node_num): + return self._fan_device_node_mapping[(fan_num, node_num)] + + def _get_fan_node_val(self, fan_num, node_num): + if fan_num < self.FAN_NUM_1_IDX or fan_num > self.FAN_NUM_ON_MAIN_BROAD: + logging.debug('GET. Parameter error. fan_num:%d', fan_num) + return None + + if node_num < self.FAN_NODE_FAULT_IDX_OF_MAP or node_num > self.FAN_NODE_NUM_OF_MAP: + logging.debug('GET. Parameter error. node_num:%d', node_num) + return None + + device_path = self.get_fan_device_path(fan_num, node_num) + + try: + val_file = open(device_path, 'r') + except IOError as e: + logging.error('GET. unable to open file: %s', str(e)) + return None + + content = val_file.readline().rstrip() + if content == '': + logging.debug('GET. content is NULL. device_path:%s', device_path) + return None + + try: + val_file.close() + except Exception: + logging.debug( + 'GET. unable to close file. device_path:%s', + device_path) + return None + + return int(content) + + def _set_fan_node_val(self, fan_num, node_num, val): + if fan_num < self.FAN_NUM_1_IDX or fan_num > self.FAN_NUM_ON_MAIN_BROAD: + logging.debug('GET. Parameter error. fan_num:%d', fan_num) + return None + + if node_num < self.FAN_NODE_FAULT_IDX_OF_MAP or node_num > self.FAN_NODE_NUM_OF_MAP: + logging.debug('GET. Parameter error. node_num:%d', node_num) + return None + + content = str(val) + if content == '': + logging.debug('GET. content is NULL. device_path:%s', device_path) + return None + + device_path = self.get_fan_device_path(fan_num, node_num) + try: + val_file = open(device_path, 'w') + except IOError as e: + logging.error('GET. unable to open file: %s', str(e)) + return None + + val_file.write(content) + + try: + val_file.close() + except BaseException: + logging.debug( + 'GET. unable to close file. device_path:%s', + device_path) + return None + + return True + + def __init__(self): + fan_path = self.BASE_VAL_PATH + for fan_num in range( + self.FAN_NUM_1_IDX, + self.FAN_NUM_ON_MAIN_BROAD + 1): + for node_num in range( + self.FAN_NODE_FAULT_IDX_OF_MAP, + self.FAN_NODE_NUM_OF_MAP + 1): + self._fan_device_path_mapping[(fan_num, node_num)] = fan_path.format( + self._fan_device_node_mapping[(fan_num, node_num)]) + + def get_size_node_map(self): + return len(self._fan_device_node_mapping) + + def get_fan_device_path(self, fan_num, node_num): + return self._fan_device_path_mapping[(fan_num, node_num)] + + def get_fan_fault(self, fan_num): + return self._get_fan_node_val(fan_num, self.FAN_NODE_FAULT_IDX_OF_MAP) + + def get_fan_present(self, fan_num): + return self._get_fan_node_val( + fan_num, self.FAN_NODE_PRESENT_IDX_OF_MAP) + + def get_fan_dir(self, fan_num): + return self._get_fan_node_val(fan_num, self.FAN_NODE_DIR_IDX_OF_MAP) + + def get_fan_duty_cycle(self): + try: + val_file = open(self.FAN_DUTY_PATH) + except IOError as e: + print "Error: unable to open file: %s" % str(e) + return False + + content = val_file.readline().rstrip() + val_file.close() + + return int(content) + + def set_fan_duty_cycle(self, val): + try: + fan_file = open(self.FAN_DUTY_PATH, 'r+') + except IOError as e: + print "Error: unable to open file: %s" % str(e) + return False + + fan_file.write(str(val)) + fan_file.close() + return True + + def get_fan_speed(self, fan_num): + return self._get_fan_node_val(fan_num, self.FAN_NODE_SPEED_IDX_OF_MAP) + + def get_fan_status(self, fan_num): + if fan_num < self.FAN_NUM_1_IDX or fan_num > self.FAN_NUM_ON_MAIN_BROAD: + logging.debug('GET. Parameter error. fan_num, %d', fan_num) + return None + if self.get_fan_fault( + fan_num) == 0 and self.get_fan_present(fan_num) > 0: + return 1 + else: + logging.debug('GET. FAN fault. fan_num, %d', fan_num) + return 0 + + +def main(): + fan = FanUtil() + logging.debug('fan_duty_cycle=%d', fan.get_fan_duty_cycle()) + for i in range(1, 4): + logging.debug('fan-%d speed=%d', i, fan.get_fan_speed(i)) + logging.debug('fan-%d present=%d', i, fan.get_fan_present(i)) + logging.debug('fan-%d fault=%d', i, fan.get_fan_fault(i)) + logging.debug('fan-%d status=%d', i, fan.get_fan_status(i)) + + +if __name__ == '__main__': + main() diff --git a/platform/broadcom/sonic-platform-modules-accton/as4630-54te/classes/thermalutil.py b/platform/broadcom/sonic-platform-modules-accton/as4630-54te/classes/thermalutil.py new file mode 100755 index 000000000000..15947da12ee3 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as4630-54te/classes/thermalutil.py @@ -0,0 +1,93 @@ +#!/usr/bin/env python +# Copyright (c) 2019 Edgecore Networks Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT +# LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS +# FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. +# +# See the Apache Version 2.0 License for specific language governing +# permissions and limitations under the License. +# +# ------------------------------------------------------------------ +# HISTORY: +# mm/dd/yyyy (A.D.) +# 10/24/2019:Jostar craete for as4630_54te +# ------------------------------------------------------------------ + +try: + import logging + import glob +except ImportError as e: + raise ImportError('%s - required module not found' % str(e)) + + +class ThermalUtil(object): + """Platform-specific ThermalUtil class""" + THERMAL_NUM_MAX = 4 + THERMAL_NUM_1_IDX = 1 + THERMAL_NUM_2_IDX = 2 + THERMAL_NUM_3_IDX = 3 + THERMAL_NUM_4_IDX = 4 + + """ Dictionary where + key1 = thermal id index (integer) starting from 1 + value = path to fan device file (string) """ + + thermal_sysfspath = { + THERMAL_NUM_1_IDX: ["/sys/bus/i2c/devices/14-0048/hwmon/hwmon*/temp1_input"], + THERMAL_NUM_2_IDX: ["/sys/bus/i2c/devices/24-004b/hwmon/hwmon*/temp1_input"], + THERMAL_NUM_3_IDX: ["/sys/bus/i2c/devices/25-004a/hwmon/hwmon*/temp1_input"], + THERMAL_NUM_4_IDX: ["/sys/class/hwmon/hwmon1/temp1_input"], + } + + def _get_thermal_val(self, thermal_num): + if thermal_num < self.THERMAL_NUM_1_IDX or thermal_num > self.THERMAL_NUM_MAX: + logging.debug('GET. Parameter error. thermal_num, %d', thermal_num) + return None + + device_path = self.get_thermal_path(thermal_num) + for filename in glob.glob(device_path): + try: + val_file = open(filename, 'r') + except IOError as e: + logging.error('GET. unable to open file: %s', str(e)) + return None + content = val_file.readline().rstrip() + if content == '': + logging.debug( + 'GET. content is NULL. device_path:%s', + device_path) + return None + try: + val_file.close() + except BaseException: + logging.debug( + 'GET. unable to close file. device_path:%s', + device_path) + return None + + return int(content) + + return 0 + + def get_num_thermals(self): + return self.THERMAL_NUM_MAX + + def get_size_path_map(self): + return len(self.thermal_sysfspath) + + def get_thermal_path(self, thermal_num): + return self.thermal_sysfspath[thermal_num][0] + + +def main(): + ThermalUtil() + + +if __name__ == '__main__': + main() diff --git a/platform/broadcom/sonic-platform-modules-accton/as4630-54te/modules/Makefile b/platform/broadcom/sonic-platform-modules-accton/as4630-54te/modules/Makefile new file mode 100755 index 000000000000..1b5914d9e5aa --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as4630-54te/modules/Makefile @@ -0,0 +1,19 @@ +ifneq ($(KERNELRELEASE),) +obj-m:= x86-64-accton-as4630-54te-cpld.o x86-64-accton-as4630-54te-psu.o \ + x86-64-accton-as4630-54te-leds.o ym2651y.o + +else +ifeq (,$(KERNEL_SRC)) +#$(error KERNEL_SRC is not defined) +KVERSION=3.16.0-8-amd64 +KERNEL_DIR = /usr/src/linux-headers-$(KVERSION)/ +KERNELDIR:=$(KERNEL_DIR) +else +KERNELDIR:=$(KERNEL_SRC) +endif +PWD:=$(shell pwd) +default: + $(MAKE) -C $(KERNELDIR) M=$(PWD) modules +clean: + rm -rf *.o *.mod.o *.mod.o *.mod.c *.ko .*cmd .tmp_versions Module.markers Module.symvers modules.order +endif diff --git a/platform/broadcom/sonic-platform-modules-accton/as4630-54te/modules/x86-64-accton-as4630-54te-cpld.c b/platform/broadcom/sonic-platform-modules-accton/as4630-54te/modules/x86-64-accton-as4630-54te-cpld.c new file mode 100755 index 000000000000..98b855329c64 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as4630-54te/modules/x86-64-accton-as4630-54te-cpld.c @@ -0,0 +1,1106 @@ +/* + * Copyright (C) Jostar yang + * + * This module supports the accton cpld that hold the channel select + * mechanism for other i2c slave devices, such as SFP. + * This includes the: + * Accton as4630_54te CPLD + * + * Based on: + * pca954x.c from Kumar Gala + * Copyright (C) 2006 + * + * Based on: + * pca954x.c from Ken Harrenstien + * Copyright (C) 2004 Google, Inc. (Ken Harrenstien) + * + * Based on: + * i2c-virtual_cb.c from Brian Kuschak + * and + * pca9540.c from Jean Delvare . + * + * This file is licensed under the terms of the GNU General Public + * License version 2. This program is licensed "as is" without any + * warranty of any kind, whether express or implied. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#define I2C_RW_RETRY_COUNT 10 +#define I2C_RW_RETRY_INTERVAL 60 /* ms */ +#define FAN_DUTY_CYCLE_REG_MASK 0x1F +#define FAN_MAX_DUTY_CYCLE 100 +#define FAN_REG_VAL_TO_SPEED_RPM_STEP 114 // R.P.M value = read value x3.79*60/2 + +#define NUM_THERMAL_SENSORS (3) /* Get sum of this number of sensors.*/ +#define THERMAL_SENSORS_DRIVER "lm75" +#define THERMAL_SENSORS_ADDRS {0x48, 0x4a, 0x4b} + +static LIST_HEAD(cpld_client_list); +static struct mutex list_lock; + +struct cpld_client_node { + struct i2c_client *client; + struct list_head list; +}; + +enum cpld_type { + as4630_54te_cpld, +}; +enum fan_id { + FAN1_ID, + FAN2_ID, + FAN3_ID, +}; + +static const u8 fan_reg[] = { + 0x87, /* fan status, fan direction */ + 0x1A, /* fan PWM(for fan1 ,fan2) */ + 0x1B, /* fan PWM(for fan1 ,fan2) */ + 0x88, /* front fan1 speed(rpm) */ + 0x89, /* front fan2 speed(rpm) */ + 0x8A, /* front fan3 speed(rpm) */ + 0x20, /*fan fault*/ +}; + +struct as4630_54te_cpld_data { + enum cpld_type type; + struct device *hwmon_dev; + struct mutex update_lock; + char valid; /* != 0 if registers are valid */ + unsigned long last_updated; /* In jiffies */ + u8 reg_fan_val[ARRAY_SIZE(fan_reg)]; /* Register value */ + int system_temp; /*In unit of mini-Celsius*/ + int sensors_found; +}; + + + +static const struct i2c_device_id as4630_54te_cpld_id[] = { + { "as4630_54te_cpld", as4630_54te_cpld}, + { } +}; +MODULE_DEVICE_TABLE(i2c, as4630_54te_cpld_id); + +#define TRANSCEIVER_PRESENT_ATTR_ID(index) MODULE_PRESENT_##index +#define TRANSCEIVER_TXDISABLE_ATTR_ID(index) MODULE_TXDISABLE_##index +#define TRANSCEIVER_RXLOS_ATTR_ID(index) MODULE_RXLOS_##index +#define TRANSCEIVER_TXFAULT_ATTR_ID(index) MODULE_TXFAULT_##index +#define FAN_SPEED_RPM_ATTR_ID(index) FAN_SPEED_RPM_##index +#define FAN_DIRECTION_ID(index) FAN_DIRECTION_##index +#define FAN_PRESENT_ATTR_ID(index) FAN_PRESENT_##index +#define FAN_FAULT_ATTR_ID(index) FAN_FAULT_##index + +enum as4630_54te_cpld_sysfs_attributes { + CPLD_VERSION, + ACCESS, + /* transceiver attributes */ + TRANSCEIVER_RXLOS_ATTR_ID(49), + TRANSCEIVER_RXLOS_ATTR_ID(50), + TRANSCEIVER_RXLOS_ATTR_ID(51), + TRANSCEIVER_RXLOS_ATTR_ID(52), + TRANSCEIVER_TXFAULT_ATTR_ID(49), + TRANSCEIVER_TXFAULT_ATTR_ID(50), + TRANSCEIVER_TXFAULT_ATTR_ID(51), + TRANSCEIVER_TXFAULT_ATTR_ID(52), + TRANSCEIVER_PRESENT_ATTR_ID(49), + TRANSCEIVER_PRESENT_ATTR_ID(50), + TRANSCEIVER_PRESENT_ATTR_ID(51), + TRANSCEIVER_PRESENT_ATTR_ID(52), + TRANSCEIVER_PRESENT_ATTR_ID(53), + TRANSCEIVER_PRESENT_ATTR_ID(54), + TRANSCEIVER_TXDISABLE_ATTR_ID(49), + TRANSCEIVER_TXDISABLE_ATTR_ID(50), + TRANSCEIVER_TXDISABLE_ATTR_ID(51), + TRANSCEIVER_TXDISABLE_ATTR_ID(52), + FAN_PRESENT_ATTR_ID(1), + FAN_PRESENT_ATTR_ID(2), + FAN_PRESENT_ATTR_ID(3), + FAN_SPEED_RPM_ATTR_ID(1), + FAN_SPEED_RPM_ATTR_ID(2), + FAN_SPEED_RPM_ATTR_ID(3), + FAN_DIRECTION_ID(1), + FAN_DIRECTION_ID(2), + FAN_DIRECTION_ID(3), + FAN_FAULT_ATTR_ID(1), + FAN_FAULT_ATTR_ID(2), + FAN_FAULT_ATTR_ID(3), + FAN_DUTY_CYCLE_PERCENTAGE, +}; + +/* sysfs attributes for hwmon + */ +static ssize_t show_status(struct device *dev, struct device_attribute *da, + char *buf); +static ssize_t set_tx_disable(struct device *dev, struct device_attribute *da, + const char *buf, size_t count); +static ssize_t access(struct device *dev, struct device_attribute *da, + const char *buf, size_t count); +static ssize_t show_version(struct device *dev, struct device_attribute *da, + char *buf); +static int as4630_54te_cpld_read_internal(struct i2c_client *client, u8 reg); +static int as4630_54te_cpld_write_internal(struct i2c_client *client, u8 reg, u8 value); + +/*fan sysfs*/ +static struct as4630_54te_cpld_data *as4630_54te_fan_update_device(struct device *dev); +static ssize_t fan_show_value(struct device *dev, struct device_attribute *da, char *buf); +static ssize_t set_duty_cycle(struct device *dev, struct device_attribute *da, + const char *buf, size_t count); +static ssize_t get_sys_temp(struct device *dev, struct device_attribute *da, char *buf); +//static ssize_t show_power(struct device *dev, struct device_attribute *da, + // char *buf); + + + +/* transceiver attributes */ +#define DECLARE_SFP_TRANSCEIVER_SENSOR_DEVICE_ATTR(index) \ + static SENSOR_DEVICE_ATTR(module_present_##index, S_IRUGO, show_status, NULL, MODULE_PRESENT_##index); \ + static SENSOR_DEVICE_ATTR(module_tx_disable_##index, S_IRUGO | S_IWUSR, show_status, set_tx_disable, MODULE_TXDISABLE_##index); \ + static SENSOR_DEVICE_ATTR(module_rx_los_##index, S_IRUGO, show_status, NULL, MODULE_RXLOS_##index); \ + static SENSOR_DEVICE_ATTR(module_tx_fault_##index, S_IRUGO, show_status, NULL, MODULE_TXFAULT_##index); + +#define DECLARE_SFP_TRANSCEIVER_ATTR(index) \ + &sensor_dev_attr_module_present_##index.dev_attr.attr, \ + &sensor_dev_attr_module_tx_disable_##index.dev_attr.attr, \ + &sensor_dev_attr_module_rx_los_##index.dev_attr.attr, \ + &sensor_dev_attr_module_tx_fault_##index.dev_attr.attr + +#define DECLARE_QSFP_TRANSCEIVER_SENSOR_DEVICE_ATTR(index) \ + static SENSOR_DEVICE_ATTR(module_present_##index, S_IRUGO, show_status, NULL, MODULE_PRESENT_##index); + +#define DECLARE_QSFP_TRANSCEIVER_ATTR(index) \ + &sensor_dev_attr_module_present_##index.dev_attr.attr + + +#define DECLARE_FAN_SENSOR_DEV_ATTR(index) \ + static SENSOR_DEVICE_ATTR(fan_present_##index, S_IRUGO, fan_show_value, NULL, FAN_PRESENT_##index); \ + static SENSOR_DEVICE_ATTR(fan_fault_##index, S_IRUGO, fan_show_value, NULL, FAN_FAULT_##index); \ + static SENSOR_DEVICE_ATTR(fan_speed_rpm_##index, S_IRUGO, fan_show_value, NULL, FAN_SPEED_RPM_##index); \ + static SENSOR_DEVICE_ATTR(fan##index##_input, S_IRUGO, fan_show_value, NULL, FAN_SPEED_RPM_##index);\ + static SENSOR_DEVICE_ATTR(fan_direction_##index, S_IRUGO, fan_show_value, NULL, FAN_DIRECTION_##index); + +#define DECLARE_FAN_ATTR(index) \ + &sensor_dev_attr_fan_present_##index.dev_attr.attr, \ + &sensor_dev_attr_fan_fault_##index.dev_attr.attr, \ + &sensor_dev_attr_fan_speed_rpm_##index.dev_attr.attr, \ + &sensor_dev_attr_fan##index##_input.dev_attr.attr, \ + &sensor_dev_attr_fan_direction_##index.dev_attr.attr + +#define DECLARE_FAN_DUTY_CYCLE_SENSOR_DEV_ATTR(index) \ + static SENSOR_DEVICE_ATTR(fan_duty_cycle_percentage, S_IWUSR | S_IRUGO, fan_show_value, set_duty_cycle, FAN_DUTY_CYCLE_PERCENTAGE); +#define DECLARE_FAN_DUTY_CYCLE_ATTR(index) &sensor_dev_attr_fan_duty_cycle_percentage.dev_attr.attr + +#define DECLARE_FAN_SYSTEM_TEMP_SENSOR_DEV_ATTR() \ + static SENSOR_DEVICE_ATTR(sys_temp, S_IRUGO, get_sys_temp, NULL, FAN_DUTY_CYCLE_PERCENTAGE) + +#define DECLARE_FAN_SYSTEM_TEMP_ATTR() &sensor_dev_attr_sys_temp.dev_attr.attr + +static SENSOR_DEVICE_ATTR(version, S_IRUGO, show_version, NULL, CPLD_VERSION); +static SENSOR_DEVICE_ATTR(access, S_IWUSR, NULL, access, ACCESS); + + + +/* transceiver attributes */ +DECLARE_SFP_TRANSCEIVER_SENSOR_DEVICE_ATTR(49); +DECLARE_SFP_TRANSCEIVER_SENSOR_DEVICE_ATTR(50); +DECLARE_SFP_TRANSCEIVER_SENSOR_DEVICE_ATTR(51); +DECLARE_SFP_TRANSCEIVER_SENSOR_DEVICE_ATTR(52); +DECLARE_QSFP_TRANSCEIVER_SENSOR_DEVICE_ATTR(53); +DECLARE_QSFP_TRANSCEIVER_SENSOR_DEVICE_ATTR(54); +/* fan attributes */ +DECLARE_FAN_SENSOR_DEV_ATTR(1); +DECLARE_FAN_SENSOR_DEV_ATTR(2); +DECLARE_FAN_SENSOR_DEV_ATTR(3); +DECLARE_FAN_DUTY_CYCLE_SENSOR_DEV_ATTR(1); + +static struct attribute *as4630_54te_cpld_attributes[] = { + &sensor_dev_attr_version.dev_attr.attr, + &sensor_dev_attr_access.dev_attr.attr, + DECLARE_SFP_TRANSCEIVER_ATTR(49), + DECLARE_SFP_TRANSCEIVER_ATTR(50), + DECLARE_SFP_TRANSCEIVER_ATTR(51), + DECLARE_SFP_TRANSCEIVER_ATTR(52), + DECLARE_QSFP_TRANSCEIVER_ATTR(53), + DECLARE_QSFP_TRANSCEIVER_ATTR(54), + DECLARE_FAN_ATTR(1), + DECLARE_FAN_ATTR(2), + DECLARE_FAN_ATTR(3), + DECLARE_FAN_DUTY_CYCLE_ATTR(1), + NULL +}; + +static const struct attribute_group as4630_54te_cpld_group = { + .attrs = as4630_54te_cpld_attributes, +}; + + +static ssize_t show_status(struct device *dev, struct device_attribute *da, + char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + struct i2c_client *client = to_i2c_client(dev); + struct as4630_54te_cpld_data *data = i2c_get_clientdata(client); + int status = 0; + u8 reg = 0, mask = 0, revert = 0; + + switch (attr->index) + { + case MODULE_RXLOS_49 ... MODULE_RXLOS_50: + reg=0x5; + mask = 0x1<< (attr->index==MODULE_RXLOS_49?4:0); + break; + case MODULE_TXFAULT_49 ... MODULE_TXFAULT_50: + reg=0x5; + mask=0x1 << (attr->index==MODULE_TXFAULT_49?5:1); + break; + case MODULE_PRESENT_49 ... MODULE_PRESENT_50: + reg=0x5; + mask=0x1 << (attr->index==MODULE_PRESENT_49?6:2); + break; + case MODULE_TXDISABLE_49 ... MODULE_TXDISABLE_50: + reg=0x5; + mask=0x1 << (attr->index==MODULE_TXFAULT_49?7:3); + break; + + case MODULE_RXLOS_51 ... MODULE_RXLOS_52: + reg=0x6; + mask = 0x1<< (attr->index==MODULE_RXLOS_51?4:0); + break; + case MODULE_TXFAULT_51 ... MODULE_TXFAULT_52: + reg=0x6; + mask=0x1 << (attr->index==MODULE_TXFAULT_51?5:1); + break; + case MODULE_PRESENT_51 ... MODULE_PRESENT_52: + reg=0x6; + mask=0x1 << (attr->index==MODULE_PRESENT_51?6:2); + break; + case MODULE_TXDISABLE_51 ... MODULE_TXDISABLE_52: + reg=0x6; + mask=0x1 << (attr->index==MODULE_TXFAULT_51?7:3); + break; + case MODULE_PRESENT_53 ... MODULE_PRESENT_54: + reg=0x21; + mask=0x1 << (attr->index==MODULE_PRESENT_53?0:4); + break; + default: + return 0; + } + + if( attr->index >= MODULE_PRESENT_49 && attr->index <= MODULE_PRESENT_54 ) + { + revert = 1; + } + + mutex_lock(&data->update_lock); + status = as4630_54te_cpld_read_internal(client, reg); + if (unlikely(status < 0)) { + goto exit; + } + mutex_unlock(&data->update_lock); + + return sprintf(buf, "%d\n", revert ? !(status & mask) : !!(status & mask)); + +exit: + mutex_unlock(&data->update_lock); + return status; +} + +static ssize_t set_tx_disable(struct device *dev, struct device_attribute *da, + const char *buf, size_t count) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + struct i2c_client *client = to_i2c_client(dev); + struct as4630_54te_cpld_data *data = i2c_get_clientdata(client); + long disable; + int status; + u8 reg = 0, mask = 0; + + status = kstrtol(buf, 10, &disable); + if (status) { + return status; + } + reg = 0x9; + switch (attr->index) + { + case MODULE_TXDISABLE_49 ... MODULE_TXDISABLE_50: + reg=0x5; + mask=0x1 << (attr->index==MODULE_TXFAULT_49?7:3); + break; + case MODULE_TXDISABLE_51 ... MODULE_TXDISABLE_52: + reg=0x6; + mask=0x1 << (attr->index==MODULE_TXFAULT_51?7:3); + break; + + default: + return 0; + } + + /* Read current status */ + mutex_lock(&data->update_lock); + status = as4630_54te_cpld_read_internal(client, reg); + if (unlikely(status < 0)) { + goto exit; + } + /* Update tx_disable status */ + if (disable) { + status &= ~mask; + } + else { + status |= mask; + } + status = as4630_54te_cpld_write_internal(client, reg, status); + if (unlikely(status < 0)) { + goto exit; + } + + mutex_unlock(&data->update_lock); + return count; + +exit: + mutex_unlock(&data->update_lock); + return status; +} + +static ssize_t access(struct device *dev, struct device_attribute *da, + const char *buf, size_t count) +{ + int status; + u32 addr, val; + struct i2c_client *client = to_i2c_client(dev); + struct as4630_54te_cpld_data *data = i2c_get_clientdata(client); + + if (sscanf(buf, "0x%x 0x%x", &addr, &val) != 2) { + return -EINVAL; + } + + if (addr > 0xFF || val > 0xFF) { + return -EINVAL; + } + + mutex_lock(&data->update_lock); + status = as4630_54te_cpld_write_internal(client, addr, val); + if (unlikely(status < 0)) { + goto exit; + } + mutex_unlock(&data->update_lock); + return count; + +exit: + mutex_unlock(&data->update_lock); + return status; +} + +static void as4630_54te_cpld_add_client(struct i2c_client *client) +{ + struct cpld_client_node *node = kzalloc(sizeof(struct cpld_client_node), GFP_KERNEL); + + if (!node) { + dev_dbg(&client->dev, "Can't allocate cpld_client_node (0x%x)\n", client->addr); + return; + } + + node->client = client; + + mutex_lock(&list_lock); + list_add(&node->list, &cpld_client_list); + mutex_unlock(&list_lock); +} + +static void as4630_54te_cpld_remove_client(struct i2c_client *client) +{ + struct list_head *list_node = NULL; + struct cpld_client_node *cpld_node = NULL; + int found = 0; + + mutex_lock(&list_lock); + + list_for_each(list_node, &cpld_client_list) + { + cpld_node = list_entry(list_node, struct cpld_client_node, list); + + if (cpld_node->client == client) { + found = 1; + break; + } + } + + if (found) { + list_del(list_node); + kfree(cpld_node); + } + + mutex_unlock(&list_lock); +} + +static ssize_t show_version(struct device *dev, struct device_attribute *attr, char *buf) +{ + int val = 0; + struct i2c_client *client = to_i2c_client(dev); + + val = i2c_smbus_read_byte_data(client, 0x1); + + if (val < 0) { + dev_dbg(&client->dev, "cpld(0x%x) reg(0x1) err %d\n", client->addr, val); + } + + return sprintf(buf, "%d\n", val); +} + +/* fan utility functions + */ +static u32 reg_val_to_duty_cycle(u8 reg_val) +{ + reg_val &= FAN_DUTY_CYCLE_REG_MASK; + return ((u32)(reg_val) * 625)/ 100; +} + +static u8 duty_cycle_to_reg_val(u8 duty_cycle) +{ + return ((u32)duty_cycle * 100 / 625); +} + +static u32 reg_val_to_speed_rpm(u8 reg_val) +{ + return (u32)reg_val * FAN_REG_VAL_TO_SPEED_RPM_STEP; +} + +static ssize_t set_duty_cycle(struct device *dev, struct device_attribute *da, + const char *buf, size_t count) +{ + int error, value; + struct i2c_client *client = to_i2c_client(dev); + + error = kstrtoint(buf, 10, &value); + if (error) + return error; + + if (value < 0 || value > FAN_MAX_DUTY_CYCLE) + return -EINVAL; + + as4630_54te_cpld_write_internal(client, fan_reg[1], duty_cycle_to_reg_val(value)); + as4630_54te_cpld_write_internal(client, fan_reg[2], duty_cycle_to_reg_val(value)); + return count; +} + +static u8 reg_val_to_direction(u8 reg_val, enum fan_id id) +{ + u8 mask = (1 << id); + + reg_val &= mask; + + return reg_val ? 1 : 0; +} + +static u8 reg_val_to_is_present(u8 reg_val, enum fan_id id) +{ + u8 mask = (1 << id); + + reg_val &= mask; + + return reg_val ? 0 : 1; +} + +static u8 is_fan_fault(struct as4630_54te_cpld_data *data, enum fan_id id) +{ + u8 ret = 1; + + if(id > FAN3_ID) + return 1; + /* Check if the speed of front or rear fan is ZERO, + */ + if (reg_val_to_speed_rpm(data->reg_fan_val[id+3])) + { + + ret = 0; + } + + return ret; +} + +/* Due to this struct is declared at lm75.c, it cannot be include + * under Sonic environment. I duplicate it from lm75.c. + */ +struct lm75_data { + struct i2c_client *client; + struct device *hwmon_dev; + struct thermal_zone_device *tz; + struct mutex update_lock; + u8 orig_conf; + u8 resolution; /* In bits, between 9 and 12 */ + u8 resolution_limits; + char valid; /* !=0 if registers are valid */ + unsigned long last_updated; /* In jiffies */ + unsigned long sample_time; /* In jiffies */ + s16 temp[3]; /* Register values, + 0 = input + 1 = max + 2 = hyst */ +}; + +/*Copied from lm75.c*/ +static inline long lm75_reg_to_mc(s16 temp, u8 resolution) +{ + return ((temp >> (16 - resolution)) * 1000) >> (resolution - 8); +} + +/*Get hwmon_dev from i2c_client, set hwmon_dev = NULL is failed.*/ +static struct device * get_hwmon_dev( + struct i2c_client *client) +{ + struct lm75_data *data = NULL; + + data = i2c_get_clientdata(client); + if(data) + { + if( data->valid == 1 && data->hwmon_dev) + { + return data->hwmon_dev; + } + + } + return NULL; +} + +/* To find hwmon index by opening hwmon under that i2c address. + */ +static int find_hwmon_index_by_FileOpen( + int bus_nr, + unsigned short addr, + int *index) +{ +#define MAX_HWMON_DEVICE (10) /* Find hwmon device in 0~10*/ + struct file *sfd; + char client_name[96]; + int i=0; + + do { + snprintf(client_name, sizeof(client_name), + "/sys/bus/i2c/devices/%d-%04x/hwmon/hwmon%d/temp1_input", + bus_nr, addr, i); + + sfd = filp_open(client_name, O_RDONLY, 0); + i++; + } while( IS_ERR(sfd) && i < MAX_HWMON_DEVICE); + + if (IS_ERR(sfd)) { + pr_err("Failed to open file(%s)#%d\r\n", client_name, __LINE__); + return -ENOENT; + } + filp_close(sfd, 0); + *index = i - 1; + return 0; + +#undef MAX_HWMON_DEVICE +} + +static int get_temp_file_path( + int bus_nr, unsigned short addr, + struct device *hwmon_dev + ,char *path, int max_len) +{ + + if(hwmon_dev && strlen(dev_name(hwmon_dev))) + { + snprintf(path, max_len, + "/sys/bus/i2c/devices/%d-%04x/hwmon/%s/temp1_input", + bus_nr, addr, dev_name(hwmon_dev)); + } + else + { + int i=0; + if(find_hwmon_index_by_FileOpen( bus_nr, addr, &i)) + { + return -EIO; + } + snprintf(path, max_len, + "/sys/bus/i2c/devices/%d-%04x/hwmon/hwmon%d/temp1_input", + bus_nr, addr, i); + } + + return 0; +} + +/*File read the dev file at user space.*/ +static int read_devfile_temp1_input( + struct device *dev, + int bus_nr, + unsigned short addr, + struct device *hwmon_dev, + int *miniCelsius) +{ + struct file *sfd; + char buffer[96]; + char devfile[96]; + int rc, status; + int rdlen, value; + mm_segment_t old_fs; + + rc = 0; + get_temp_file_path(bus_nr, addr, hwmon_dev, devfile, sizeof(devfile)); + sfd = filp_open(devfile, O_RDONLY, 0); + if (IS_ERR(sfd)) { + pr_err("Failed to open file(%s)#%d\r\n", devfile, __LINE__); + return -ENOENT; + } + dev_dbg(dev, "Found device:%s\n",devfile); + + if(!(sfd->f_op) || !(sfd->f_op->read) ) { + pr_err("file %s cann't readable ?\n",devfile); + return -ENOENT; + } + + old_fs = get_fs(); + set_fs(KERNEL_DS); + rdlen = sfd->f_op->read(sfd, buffer, sizeof(buffer), &sfd->f_pos); + if (rdlen == 0) { + pr_err( "File(%s) empty!\n", devfile); + rc = -EIO; + goto exit; + } + status = sscanf(buffer, "%d", &value); + if (status != 1) { + rc = -EIO; + goto exit; + } + *miniCelsius = value; + dev_dbg(dev,"found sensors: %d @i2c %d-%04x\n", value, bus_nr, addr); + +exit: + set_fs(old_fs); + filp_close(sfd, 0); + return rc; +} + +static u8 is_lm75_data_due(struct i2c_client *client) +{ + struct lm75_data *data = NULL; + + data = i2c_get_clientdata(client); + if (time_after(jiffies, data->last_updated + data->sample_time)) + { + return 1; + } + return 0; +} +static int get_lm75_temp(struct i2c_client *client, int *miniCelsius) +{ + struct lm75_data *data = NULL; + + data = i2c_get_clientdata(client); + *miniCelsius = lm75_reg_to_mc(data->temp[0], data->resolution); + + return 0; +} + +static bool lm75_addr_mached(unsigned short addr) +{ + int i; + unsigned short addrs[] = THERMAL_SENSORS_ADDRS; + + for (i = 0; i < ARRAY_SIZE(addrs); i++) + { + if( addr == addrs[i]) + return 1; + } + return 0; +} + +static int _find_lm75_device(struct device *dev, void *data) +{ + struct device_driver *driver; + struct as4630_54te_cpld_data *prv = data; + char *driver_name = THERMAL_SENSORS_DRIVER; + + driver = dev->driver; + if (driver && driver->name && + strcmp(driver->name, driver_name) == 0) + { + struct i2c_client *client; + client = to_i2c_client(dev); + if (client) + { + /*cannot use "struct i2c_adapter *adap = to_i2c_adapter(dev);"*/ + struct i2c_adapter *adap = client->adapter; + int miniCelsius = 0; + + if (! lm75_addr_mached(client->addr)) + { + return 0; + } + + if (!adap) { + return -ENXIO; + } + + /* If the data is not updated, read them from devfile + to drive them updateing data from chip.*/ + if (is_lm75_data_due(client)) + { + struct device *hwmon_dev; + + hwmon_dev = get_hwmon_dev(client); + if(0 == read_devfile_temp1_input(dev, adap->nr, + client->addr, hwmon_dev, &miniCelsius)) + { + prv->system_temp += miniCelsius; + prv->sensors_found++; + } + + } + else + { + get_lm75_temp(client, &miniCelsius); + prv->system_temp += miniCelsius; + prv->sensors_found++; + + } + } + } + return 0; +} + +/*Find all lm75 devices and return sum of temperatures.*/ +static ssize_t get_sys_temp(struct device *dev, struct device_attribute *da, + char *buf) +{ + ssize_t ret = 0; + struct as4630_54te_cpld_data *data = as4630_54te_fan_update_device(dev); + + data->system_temp=0; + data->sensors_found=0; + i2c_for_each_dev(data, _find_lm75_device); + if (NUM_THERMAL_SENSORS != data->sensors_found) + { + dev_dbg(dev,"only %d of %d temps are found\n", + data->sensors_found, NUM_THERMAL_SENSORS); + data->system_temp = INT_MAX; + } + ret = sprintf(buf, "%d\n",data->system_temp); + return ret; +} + +static ssize_t fan_show_value(struct device *dev, struct device_attribute *da, + char *buf) +{ + u32 duty_cycle; + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + struct as4630_54te_cpld_data *data = as4630_54te_fan_update_device(dev); + ssize_t ret = 0; + + if (data->valid) { + switch (attr->index) + { + case FAN_PRESENT_1: + case FAN_PRESENT_2: + case FAN_PRESENT_3: + ret = sprintf(buf, "%d\n", + reg_val_to_is_present(data->reg_fan_val[0], + attr->index - FAN_PRESENT_1)); + break; + case FAN_DUTY_CYCLE_PERCENTAGE: + duty_cycle = reg_val_to_duty_cycle(data->reg_fan_val[1]); + ret = sprintf(buf, "%u\n", duty_cycle); + break; + case FAN_SPEED_RPM_1: + case FAN_SPEED_RPM_2: + case FAN_SPEED_RPM_3: + ret = sprintf(buf, "%u\n", reg_val_to_speed_rpm(data->reg_fan_val[attr->index-FAN_SPEED_RPM_1+3])); + break; + case FAN_FAULT_1: + case FAN_FAULT_2: + case FAN_FAULT_3: + ret = sprintf(buf, "%d\n", is_fan_fault(data, attr->index - FAN_FAULT_1)); + break; + case FAN_DIRECTION_1: + case FAN_DIRECTION_2: + case FAN_DIRECTION_3: + ret = sprintf(buf, "%d\n", + reg_val_to_direction(data->reg_fan_val[0], + attr->index - FAN_DIRECTION_1)); + break; + default: + break; + } + } + + return ret; +} + +static struct as4630_54te_cpld_data *as4630_54te_fan_update_device(struct device *dev) +{ + struct i2c_client *client = to_i2c_client(dev); + struct as4630_54te_cpld_data *data = i2c_get_clientdata(client); + + mutex_lock(&data->update_lock); + + if (time_after(jiffies, data->last_updated + HZ + HZ / 2) || + !data->valid) { + int i; + + dev_dbg(&client->dev, "Starting as4630_54te_fan update\n"); + data->valid = 0; + + /* Update fan data + */ + for (i = 0; i < ARRAY_SIZE(data->reg_fan_val); i++) { + int status = as4630_54te_cpld_read_internal(client, fan_reg[i]); + if (status < 0) { + data->valid = 0; + mutex_unlock(&data->update_lock); + dev_dbg(&client->dev, "reg 0x%x, err %d\n", fan_reg[i], status); + return data; + } + else { + data->reg_fan_val[i] = status & 0xff; + } + } + + data->last_updated = jiffies; + data->valid = 1; + } + + mutex_unlock(&data->update_lock); + + return data; +} + +/* +static ssize_t show_power(struct device *dev, struct device_attribute *da, + char *buf) +{ + struct i2c_client *client = to_i2c_client(dev); + struct as4630_54te_cpld_data *data = i2c_get_clientdata(client); + int status = 0; + u8 reg = 0, mask = 0; + + reg=0xc; + mask=0x2; + mutex_lock(&data->update_lock); + status = as4630_54te_cpld_read_internal(client, reg); + if (unlikely(status < 0)) { + goto exit; + } + mutex_unlock(&data->update_lock); + + return sprintf(buf, "%d\n", !(status & mask)); + +exit: + mutex_unlock(&data->update_lock); + return status; +} +*/ +/* + * I2C init/probing/exit functions + */ +static int as4630_54te_cpld_probe(struct i2c_client *client, + const struct i2c_device_id *id) +{ + struct i2c_adapter *adap = to_i2c_adapter(client->dev.parent); + struct as4630_54te_cpld_data *data; + int ret = -ENODEV; +// int status; + const struct attribute_group *group = NULL; + + if (!i2c_check_functionality(adap, I2C_FUNC_SMBUS_BYTE)) + goto exit; + + data = kzalloc(sizeof(struct as4630_54te_cpld_data), GFP_KERNEL); + if (!data) { + ret = -ENOMEM; + goto exit; + } + + i2c_set_clientdata(client, data); + mutex_init(&data->update_lock); + data->type = id->driver_data; + + /* Register sysfs hooks */ + switch (data->type) + { + case as4630_54te_cpld: + group = &as4630_54te_cpld_group; + break; + default: + break; + } + + if (group) + { + ret = sysfs_create_group(&client->dev.kobj, group); + if (ret) { + goto exit_free; + } + } + + as4630_54te_cpld_add_client(client); + + + data->hwmon_dev = hwmon_device_register(&client->dev); + if (IS_ERR(data->hwmon_dev)) { + ret = PTR_ERR(data->hwmon_dev); + goto exit_free; + } + + + return 0; + +exit_free: + kfree(data); +exit: + return ret; +} + +static int as4630_54te_cpld_remove(struct i2c_client *client) +{ + struct as4630_54te_cpld_data *data = i2c_get_clientdata(client); + const struct attribute_group *group = NULL; + + as4630_54te_cpld_remove_client(client); + + /* Remove sysfs hooks */ + switch (data->type) + { + case as4630_54te_cpld: + group = &as4630_54te_cpld_group; + break; + default: + break; + } + + if (group) { + hwmon_device_unregister(data->hwmon_dev); + sysfs_remove_group(&client->dev.kobj, group); + } + + + kfree(data); + + return 0; +} + +static int as4630_54te_cpld_read_internal(struct i2c_client *client, u8 reg) +{ + int status = 0, retry = I2C_RW_RETRY_COUNT; + + while (retry) { + status = i2c_smbus_read_byte_data(client, reg); + if (unlikely(status < 0)) { + msleep(I2C_RW_RETRY_INTERVAL); + retry--; + continue; + } + + break; + } + + return status; +} + +static int as4630_54te_cpld_write_internal(struct i2c_client *client, u8 reg, u8 value) +{ + int status = 0, retry = I2C_RW_RETRY_COUNT; + + while (retry) { + status = i2c_smbus_write_byte_data(client, reg, value); + if (unlikely(status < 0)) { + msleep(I2C_RW_RETRY_INTERVAL); + retry--; + continue; + } + + break; + } + + return status; +} + +int as4630_54te_cpld_read(unsigned short cpld_addr, u8 reg) +{ + struct list_head *list_node = NULL; + struct cpld_client_node *cpld_node = NULL; + int ret = -EPERM; + + mutex_lock(&list_lock); + + list_for_each(list_node, &cpld_client_list) + { + cpld_node = list_entry(list_node, struct cpld_client_node, list); + + if (cpld_node->client->addr == cpld_addr) { + ret = as4630_54te_cpld_read_internal(cpld_node->client, reg); + break; + } + } + + mutex_unlock(&list_lock); + + return ret; +} +EXPORT_SYMBOL(as4630_54te_cpld_read); + +int as4630_54te_cpld_write(unsigned short cpld_addr, u8 reg, u8 value) +{ + struct list_head *list_node = NULL; + struct cpld_client_node *cpld_node = NULL; + int ret = -EIO; + + mutex_lock(&list_lock); + + list_for_each(list_node, &cpld_client_list) + { + cpld_node = list_entry(list_node, struct cpld_client_node, list); + + if (cpld_node->client->addr == cpld_addr) { + ret = as4630_54te_cpld_write_internal(cpld_node->client, reg, value); + break; + } + } + + mutex_unlock(&list_lock); + + return ret; +} +EXPORT_SYMBOL(as4630_54te_cpld_write); + +static struct i2c_driver as4630_54te_cpld_driver = { + .driver = { + .name = "as4630_54te_cpld", + .owner = THIS_MODULE, + }, + .probe = as4630_54te_cpld_probe, + .remove = as4630_54te_cpld_remove, + .id_table = as4630_54te_cpld_id, +}; + +static int __init as4630_54te_cpld_init(void) +{ + mutex_init(&list_lock); + return i2c_add_driver(&as4630_54te_cpld_driver); +} + +static void __exit as4630_54te_cpld_exit(void) +{ + i2c_del_driver(&as4630_54te_cpld_driver); +} + +MODULE_AUTHOR("Jostar Yang "); +MODULE_DESCRIPTION("Accton I2C CPLD driver"); +MODULE_LICENSE("GPL"); + +module_init(as4630_54te_cpld_init); +module_exit(as4630_54te_cpld_exit); + diff --git a/platform/broadcom/sonic-platform-modules-accton/as4630-54te/modules/x86-64-accton-as4630-54te-leds.c b/platform/broadcom/sonic-platform-modules-accton/as4630-54te/modules/x86-64-accton-as4630-54te-leds.c new file mode 100755 index 000000000000..f4e2668348ff --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as4630-54te/modules/x86-64-accton-as4630-54te-leds.c @@ -0,0 +1,579 @@ +/* + * A LED driver for the accton_as4630_54te_led + * + * Copyright (C) 2014 Accton Technology Corporation. + * Brandon Chuang + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/*#define DEBUG*/ + +#include +#include +#include +#include +#include +#include +#include +#include + +extern int as4630_54te_cpld_read (unsigned short cpld_addr, u8 reg); +extern int as4630_54te_cpld_write(unsigned short cpld_addr, u8 reg, u8 value); + +#define DRVNAME "accton_as4630_54te_led" + +struct accton_as4630_54te_led_data { + struct platform_device *pdev; + struct mutex update_lock; + char valid; /* != 0 if registers are valid */ + unsigned long last_updated; /* In jiffies */ + u8 reg_val[2]; /* only 1 register*/ +}; + +static struct accton_as4630_54te_led_data *ledctl = NULL; + +/* LED related data + */ + +#define LED_CNTRLER_I2C_ADDRESS (0x60) + +#define LED_TYPE_DIAG_REG_MASK (0x20|0x40|0x80) +#define LED_MODE_DIAG_GREEN_VALUE (0x20) +#define LED_MODE_DIAG_GREEN_BLINK_VALUE (0x60) +#define LED_MODE_DIAG_AMBER_VALUE (0x80) /*It's yellow actually. Green+Red=Yellow*/ +#define LED_MODE_DIAG_OFF_VALUE (0x0) + +#define LED_TYPE_PRI_REG_MASK (0x8|0x4) +#define LED_MODE_PRI_GREEN_VALUE 0x4 +#define LED_MODE_PRI_AMBER_VALUE 0x8 +#define LED_MODE_PRI_OFF_VALUE 0x0 + +#define LED_TYPE_POE_REG_MASK (0x2|0x1) +#define LED_MODE_POE_GREEN_VALUE 0x1 +#define LED_MODE_POE_AMBER_VALUE 0x2 +#define LED_MODE_POE_OFF_VALUE 0x0 + +#define LED_TYPE_STK1_REG_MASK 0x20 +#define LED_MODE_STK1_GREEN_VALUE 0x0 +#define LED_MODE_STK1_OFF_VALUE 0x20 + +#define LED_TYPE_STK2_REG_MASK 0x10 +#define LED_MODE_STK2_GREEN_VALUE 0x0 +#define LED_MODE_STK2_OFF_VALUE 0x10 + +#define LED_TYPE_FAN_REG_MASK (0x20|0x10) +#define LED_MODE_FAN_AMBER_VALUE 0x20 +#define LED_MODE_FAN_GREEN_VALUE 0x10 +#define LED_MODE_FAN_OFF_VALUE (0x0) + +#define LED_TYPE_PSU2_REG_MASK (0x8|0x4) +#define LED_MODE_PSU2_AMBER_VALUE 0x8 +#define LED_MODE_PSU2_GREEN_VALUE 0x4 +#define LED_MODE_PSU2_OFF_VALUE (0x0) + +#define LED_TYPE_PSU1_REG_MASK (0x2|0x1) +#define LED_MODE_PSU1_AMBER_VALUE 0x2 +#define LED_MODE_PSU1_GREEN_VALUE 0x1 +#define LED_MODE_PSU1_OFF_VALUE (0x0) + +enum led_type { + LED_TYPE_DIAG, + LED_TYPE_PRI, + LED_TYPE_POE, + LED_TYPE_STK1, + LED_TYPE_STK2, + LED_TYPE_FAN, + LED_TYPE_PSU1, + LED_TYPE_PSU2 +}; + +struct led_reg { + u32 types; + u8 reg_addr; +}; + +static const struct led_reg led_reg_map[] = { + {(1<update_lock); + + if (time_after(jiffies, ledctl->last_updated + HZ + HZ / 2) + || !ledctl->valid) { + int i; + + dev_dbg(&ledctl->pdev->dev, "Starting accton_as4630_54te_led update\n"); + + /* Update LED data + */ + for (i = 0; i < ARRAY_SIZE(ledctl->reg_val); i++) { + int status = accton_as4630_54te_led_read_value(led_reg_map[i].reg_addr); + + if (status < 0) { + ledctl->valid = 0; + dev_dbg(&ledctl->pdev->dev, "reg %d, err %d\n", led_reg_map[i].reg_addr, status); + goto exit; + } + else + { + ledctl->reg_val[i] = status; + } + } + + ledctl->last_updated = jiffies; + ledctl->valid = 1; + } + +exit: + mutex_unlock(&ledctl->update_lock); +} + +static void accton_as4630_54te_led_set(struct led_classdev *led_cdev, + enum led_brightness led_light_mode, + enum led_type type) +{ + int reg_val; + u8 reg ; + mutex_lock(&ledctl->update_lock); + + if( !accton_getLedReg(type, ®)) + { + dev_dbg(&ledctl->pdev->dev, "Not match item for %d.\n", type); + } + + + reg_val = accton_as4630_54te_led_read_value(reg); + if (reg_val < 0) { + dev_dbg(&ledctl->pdev->dev, "reg %d, err %d\n", reg, reg_val); + goto exit; + } + reg_val = led_light_mode_to_reg_val(type, led_light_mode, reg_val); + + accton_as4630_54te_led_write_value(reg, reg_val); + + /* to prevent the slow-update issue */ + ledctl->valid = 0; + +exit: + mutex_unlock(&ledctl->update_lock); +} + + +static void accton_as4630_54te_led_diag_set(struct led_classdev *led_cdev, + enum led_brightness led_light_mode) +{ + accton_as4630_54te_led_set(led_cdev, led_light_mode, LED_TYPE_DIAG); +} + +static enum led_brightness accton_as4630_54te_led_diag_get(struct led_classdev *cdev) +{ + accton_as4630_54te_led_update(); + return led_reg_val_to_light_mode(LED_TYPE_DIAG, ledctl->reg_val[0]); +} + +static void accton_as4630_54te_led_pri_set(struct led_classdev *led_cdev, + enum led_brightness led_light_mode) +{ + accton_as4630_54te_led_set(led_cdev, led_light_mode, LED_TYPE_PRI); +} + +static enum led_brightness accton_as4630_54te_led_pri_get(struct led_classdev *cdev) +{ + accton_as4630_54te_led_update(); + return led_reg_val_to_light_mode(LED_TYPE_PRI, ledctl->reg_val[0]); +} + +static void accton_as4630_54te_led_poe_set(struct led_classdev *led_cdev, + enum led_brightness led_light_mode) +{ + accton_as4630_54te_led_set(led_cdev, led_light_mode, LED_TYPE_POE); +} + +static enum led_brightness accton_as4630_54te_led_poe_get(struct led_classdev *cdev) +{ + accton_as4630_54te_led_update(); + return led_reg_val_to_light_mode(LED_TYPE_POE, ledctl->reg_val[1]); +} + + +static void accton_as4630_54te_led_stk1_set(struct led_classdev *led_cdev, + enum led_brightness led_light_mode) +{ + accton_as4630_54te_led_set(led_cdev, led_light_mode, LED_TYPE_STK1); +} + +static enum led_brightness accton_as4630_54te_led_stk1_get(struct led_classdev *cdev) +{ + accton_as4630_54te_led_update(); + return led_reg_val_to_light_mode(LED_TYPE_STK1, ledctl->reg_val[1]); +} + +static void accton_as4630_54te_led_stk2_set(struct led_classdev *led_cdev, + enum led_brightness led_light_mode) +{ + accton_as4630_54te_led_set(led_cdev, led_light_mode, LED_TYPE_STK2); +} + +static enum led_brightness accton_as4630_54te_led_stk2_get(struct led_classdev *cdev) +{ + accton_as4630_54te_led_update(); + return led_reg_val_to_light_mode(LED_TYPE_STK2, ledctl->reg_val[1]); +} + +static void accton_as4630_54te_led_fan_set(struct led_classdev *led_cdev, + enum led_brightness led_light_mode) +{ + accton_as4630_54te_led_set(led_cdev, led_light_mode, LED_TYPE_FAN); +} + +static enum led_brightness accton_as4630_54te_led_fan_get(struct led_classdev *cdev) +{ + accton_as4630_54te_led_update(); + return led_reg_val_to_light_mode(LED_TYPE_FAN, ledctl->reg_val[0]); +} + +static void accton_as4630_54te_led_psu1_set(struct led_classdev *led_cdev, + enum led_brightness led_light_mode) +{ + accton_as4630_54te_led_set(led_cdev, led_light_mode, LED_TYPE_PSU1); +} + +static enum led_brightness accton_as4630_54te_led_psu1_get(struct led_classdev *cdev) +{ + accton_as4630_54te_led_update(); + return led_reg_val_to_light_mode(LED_TYPE_PSU1, ledctl->reg_val[0]); +} + +static void accton_as4630_54te_led_psu2_set(struct led_classdev *led_cdev, + enum led_brightness led_light_mode) +{ + accton_as4630_54te_led_set(led_cdev, led_light_mode, LED_TYPE_PSU2); +} + +static enum led_brightness accton_as4630_54te_led_psu2_get(struct led_classdev *cdev) +{ + accton_as4630_54te_led_update(); + return led_reg_val_to_light_mode(LED_TYPE_PSU2, ledctl->reg_val[0]); +} + +static struct led_classdev accton_as4630_54te_leds[] = { + [LED_TYPE_DIAG] = { + .name = "diag", + .default_trigger = "unused", + .brightness_set = accton_as4630_54te_led_diag_set, + .brightness_get = accton_as4630_54te_led_diag_get, + .flags = LED_CORE_SUSPENDRESUME, + .max_brightness = LED_MODE_GREEN, + }, + [LED_TYPE_PRI] = { + .name = "pri", + .default_trigger = "unused", + .brightness_set = accton_as4630_54te_led_pri_set, + .brightness_get = accton_as4630_54te_led_pri_get, + .flags = LED_CORE_SUSPENDRESUME, + .max_brightness = LED_MODE_AMBER, + }, + [LED_TYPE_POE] = { + .name = "poe", + .default_trigger = "unused", + .brightness_set = accton_as4630_54te_led_poe_set, + .brightness_get = accton_as4630_54te_led_poe_get, + .flags = LED_CORE_SUSPENDRESUME, + .max_brightness = LED_MODE_AMBER, + }, + [LED_TYPE_STK1] = { + .name = "stk1", + .default_trigger = "unused", + .brightness_set = accton_as4630_54te_led_stk1_set, + .brightness_get = accton_as4630_54te_led_stk1_get, + .flags = LED_CORE_SUSPENDRESUME, + .max_brightness = LED_MODE_GREEN, + }, + [LED_TYPE_STK2] = { + .name = "stk2", + .default_trigger = "unused", + .brightness_set = accton_as4630_54te_led_stk2_set, + .brightness_get = accton_as4630_54te_led_stk2_get, + .flags = LED_CORE_SUSPENDRESUME, + .max_brightness = LED_MODE_GREEN, + }, + [LED_TYPE_FAN] = { + .name = "fan", + .default_trigger = "unused", + .brightness_set = accton_as4630_54te_led_fan_set, + .brightness_get = accton_as4630_54te_led_fan_get, + .flags = LED_CORE_SUSPENDRESUME, + .max_brightness = LED_MODE_AUTO, + }, + [LED_TYPE_PSU1] = { + .name = "psu1", + .default_trigger = "unused", + .brightness_set = accton_as4630_54te_led_psu1_set, + .brightness_get = accton_as4630_54te_led_psu1_get, + .flags = LED_CORE_SUSPENDRESUME, + .max_brightness = LED_MODE_AUTO, + }, + [LED_TYPE_PSU2] = { + .name = "psu2", + .default_trigger = "unused", + .brightness_set = accton_as4630_54te_led_psu2_set, + .brightness_get = accton_as4630_54te_led_psu2_get, + .flags = LED_CORE_SUSPENDRESUME, + .max_brightness = LED_MODE_AUTO, + }, +}; + +static int accton_as4630_54te_led_suspend(struct platform_device *dev, + pm_message_t state) +{ + int i = 0; + + for (i = 0; i < ARRAY_SIZE(accton_as4630_54te_leds); i++) { + led_classdev_suspend(&accton_as4630_54te_leds[i]); + } + + return 0; +} + +static int accton_as4630_54te_led_resume(struct platform_device *dev) +{ + int i = 0; + + for (i = 0; i < ARRAY_SIZE(accton_as4630_54te_leds); i++) { + led_classdev_resume(&accton_as4630_54te_leds[i]); + } + + return 0; +} + +static int accton_as4630_54te_led_probe(struct platform_device *pdev) +{ + int ret, i; + + for (i = 0; i < ARRAY_SIZE(accton_as4630_54te_leds); i++) { + ret = led_classdev_register(&pdev->dev, &accton_as4630_54te_leds[i]); + + if (ret < 0) + break; + } + + /* Check if all LEDs were successfully registered */ + if (i != ARRAY_SIZE(accton_as4630_54te_leds)) { + int j; + + /* only unregister the LEDs that were successfully registered */ + for (j = 0; j < i; j++) { + led_classdev_unregister(&accton_as4630_54te_leds[i]); + } + } + + return ret; +} + +static int accton_as4630_54te_led_remove(struct platform_device *pdev) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(accton_as4630_54te_leds); i++) { + led_classdev_unregister(&accton_as4630_54te_leds[i]); + } + + return 0; +} + +static struct platform_driver accton_as4630_54te_led_driver = { + .probe = accton_as4630_54te_led_probe, + .remove = accton_as4630_54te_led_remove, + .suspend = accton_as4630_54te_led_suspend, + .resume = accton_as4630_54te_led_resume, + .driver = { + .name = DRVNAME, + .owner = THIS_MODULE, + }, +}; + +static int __init accton_as4630_54te_led_init(void) +{ + int ret; + + ret = platform_driver_register(&accton_as4630_54te_led_driver); + if (ret < 0) { + goto exit; + } + + ledctl = kzalloc(sizeof(struct accton_as4630_54te_led_data), GFP_KERNEL); + if (!ledctl) { + ret = -ENOMEM; + platform_driver_unregister(&accton_as4630_54te_led_driver); + goto exit; + } + + mutex_init(&ledctl->update_lock); + + ledctl->pdev = platform_device_register_simple(DRVNAME, -1, NULL, 0); + if (IS_ERR(ledctl->pdev)) { + ret = PTR_ERR(ledctl->pdev); + platform_driver_unregister(&accton_as4630_54te_led_driver); + kfree(ledctl); + goto exit; + } + +exit: + return ret; +} + +static void __exit accton_as4630_54te_led_exit(void) +{ + platform_device_unregister(ledctl->pdev); + platform_driver_unregister(&accton_as4630_54te_led_driver); + kfree(ledctl); +} + +module_init(accton_as4630_54te_led_init); +module_exit(accton_as4630_54te_led_exit); + +MODULE_AUTHOR("Brandon Chuang "); +MODULE_DESCRIPTION("accton_as4630_54te_led driver"); +MODULE_LICENSE("GPL"); diff --git a/platform/broadcom/sonic-platform-modules-accton/as4630-54te/modules/x86-64-accton-as4630-54te-psu.c b/platform/broadcom/sonic-platform-modules-accton/as4630-54te/modules/x86-64-accton-as4630-54te-psu.c new file mode 100755 index 000000000000..3a99f19a9cd2 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as4630-54te/modules/x86-64-accton-as4630-54te-psu.c @@ -0,0 +1,320 @@ +/* + * An hwmon driver for accton as4630_54te Power Module + * + * Copyright (C) 2014 Accton Technology Corporation. + * Brandon Chuang + * + * Based on ad7414.c + * Copyright 2006 Stefan Roese , DENX Software Engineering + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define MAX_MODEL_NAME 20 +#define MAX_SERIAL_NUMBER 18 + +static ssize_t show_status(struct device *dev, struct device_attribute *da, char *buf); +static ssize_t show_string(struct device *dev, struct device_attribute *da, char *buf); +static int as4630_54te_psu_read_block(struct i2c_client *client, u8 command, u8 *data,int data_len); +extern int as4630_54te_cpld_read(unsigned short cpld_addr, u8 reg); + +/* Addresses scanned + */ +static const unsigned short normal_i2c[] = { 0x50, 0x51, I2C_CLIENT_END }; + +/* Each client has this additional data + */ +struct as4630_54te_psu_data { + struct device *hwmon_dev; + struct mutex update_lock; + char valid; /* !=0 if registers are valid */ + unsigned long last_updated; /* In jiffies */ + u8 index; /* PSU index */ + u8 status; /* Status(present/power_good) register read from CPLD */ + char model_name[MAX_MODEL_NAME]; /* Model name, read from eeprom */ + char serial_number[MAX_SERIAL_NUMBER]; +}; + +static struct as4630_54te_psu_data *as4630_54te_psu_update_device(struct device *dev); + +enum as4630_54te_psu_sysfs_attributes { + PSU_PRESENT, + PSU_MODEL_NAME, + PSU_POWER_GOOD, + PSU_SERIAL_NUMBER +}; + +/* sysfs attributes for hwmon + */ +static SENSOR_DEVICE_ATTR(psu_present, S_IRUGO, show_status, NULL, PSU_PRESENT); +static SENSOR_DEVICE_ATTR(psu_model_name, S_IRUGO, show_string, NULL, PSU_MODEL_NAME); +static SENSOR_DEVICE_ATTR(psu_power_good, S_IRUGO, show_status, NULL, PSU_POWER_GOOD); +static SENSOR_DEVICE_ATTR(psu_serial_number, S_IRUGO, show_string, NULL, PSU_SERIAL_NUMBER); + + +static struct attribute *as4630_54te_psu_attributes[] = { + &sensor_dev_attr_psu_present.dev_attr.attr, + &sensor_dev_attr_psu_model_name.dev_attr.attr, + &sensor_dev_attr_psu_power_good.dev_attr.attr, + &sensor_dev_attr_psu_serial_number.dev_attr.attr, + NULL +}; + +static ssize_t show_status(struct device *dev, struct device_attribute *da, + char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + struct as4630_54te_psu_data *data = as4630_54te_psu_update_device(dev); + u8 status = 0; + + //printk("data->status=0x%x, attr->index=%d,data->index=%d \n", data->status, attr->index, data->index); + if (attr->index == PSU_PRESENT) { + if(data->index==0) + status = !( (data->status >> 5) & 0x1); + else + status = !( (data->status >> 1) & 0x1); + } + else { /* PSU_POWER_GOOD */ + if(data->index==0) + status = ( (data->status >> 6) & 0x1); + else + status = ( (data->status >> 2) & 0x1); + } + + return sprintf(buf, "%d\n", status); +} + +static ssize_t show_string(struct device *dev, struct device_attribute *da, + char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + struct as4630_54te_psu_data *data = as4630_54te_psu_update_device(dev); + char *ptr = NULL; + + if (!data->valid) { + return -EIO; + } + + switch (attr->index) { + case PSU_MODEL_NAME: + ptr = data->model_name; + break; + case PSU_SERIAL_NUMBER: + ptr = data->serial_number; + break; + default: + return -EINVAL; + } + + return sprintf(buf, "%s\n", ptr); +} + +static const struct attribute_group as4630_54te_psu_group = { + .attrs = as4630_54te_psu_attributes, +}; + +static int as4630_54te_psu_probe(struct i2c_client *client, + const struct i2c_device_id *dev_id) +{ + struct as4630_54te_psu_data *data; + int status; + + if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_I2C_BLOCK)) { + status = -EIO; + goto exit; + } + + data = kzalloc(sizeof(struct as4630_54te_psu_data), GFP_KERNEL); + if (!data) { + status = -ENOMEM; + goto exit; + } + + i2c_set_clientdata(client, data); + data->valid = 0; + data->index = dev_id->driver_data; + mutex_init(&data->update_lock); + + dev_info(&client->dev, "chip found\n"); + + /* Register sysfs hooks */ + status = sysfs_create_group(&client->dev.kobj, &as4630_54te_psu_group); + if (status) { + goto exit_free; + } + + data->hwmon_dev = hwmon_device_register(&client->dev); + if (IS_ERR(data->hwmon_dev)) { + status = PTR_ERR(data->hwmon_dev); + goto exit_remove; + } + + dev_info(&client->dev, "%s: psu '%s'\n", + dev_name(data->hwmon_dev), client->name); + + return 0; + +exit_remove: + sysfs_remove_group(&client->dev.kobj, &as4630_54te_psu_group); +exit_free: + kfree(data); +exit: + + return status; +} + +static int as4630_54te_psu_remove(struct i2c_client *client) +{ + struct as4630_54te_psu_data *data = i2c_get_clientdata(client); + + hwmon_device_unregister(data->hwmon_dev); + sysfs_remove_group(&client->dev.kobj, &as4630_54te_psu_group); + kfree(data); + + return 0; +} + +enum psu_index +{ + as4630_54te_psu1, + as4630_54te_psu2 +}; + +static const struct i2c_device_id as4630_54te_psu_id[] = { + { "as4630_54te_psu1", as4630_54te_psu1 }, + { "as4630_54te_psu2", as4630_54te_psu2 }, + {} +}; +MODULE_DEVICE_TABLE(i2c, as4630_54te_psu_id); + +static struct i2c_driver as4630_54te_psu_driver = { + .class = I2C_CLASS_HWMON, + .driver = { + .name = "as4630_54te_psu", + }, + .probe = as4630_54te_psu_probe, + .remove = as4630_54te_psu_remove, + .id_table = as4630_54te_psu_id, + .address_list = normal_i2c, +}; + +static int as4630_54te_psu_read_block(struct i2c_client *client, u8 command, u8 *data, + int data_len) +{ + int result = 0; + int retry_count = 5; + + while (retry_count) { + retry_count--; + + result = i2c_smbus_read_i2c_block_data(client, command, data_len, data); + + if (unlikely(result < 0)) { + msleep(10); + continue; + } + + if (unlikely(result != data_len)) { + result = -EIO; + msleep(10); + continue; + } + + result = 0; + break; + } + + return result; +} + +static struct as4630_54te_psu_data *as4630_54te_psu_update_device(struct device *dev) +{ + struct i2c_client *client = to_i2c_client(dev); + struct as4630_54te_psu_data *data = i2c_get_clientdata(client); + + mutex_lock(&data->update_lock); + + if (time_after(jiffies, data->last_updated + HZ + HZ / 2) + || !data->valid) { + int status; + int power_good = 0; + + dev_dbg(&client->dev, "Starting as4630_54te update\n"); + + /* Read psu status */ + status = as4630_54te_cpld_read(0x60, 0x22); + //printk("status=0x%x in %s\n", status, __FUNCTION__); + if (status < 0) { + dev_dbg(&client->dev, "cpld reg 0x60 err %d\n", status); + } + else { + data->status = status; + } + + /* Read model name */ + memset(data->model_name, 0, sizeof(data->model_name)); + memset(data->serial_number, 0, sizeof(data->serial_number)); + power_good = (data->status >> (3-data->index) & 0x1); + + if (power_good) { + status = as4630_54te_psu_read_block(client, 0x20, data->model_name, + ARRAY_SIZE(data->model_name)-1); + if (status < 0) { + data->model_name[0] = '\0'; + dev_dbg(&client->dev, "unable to read model name from (0x%x)\n", client->addr); + printk("unable to read model name from (0x%x)\n", client->addr); + } + else { + data->model_name[ARRAY_SIZE(data->model_name)-1] = '\0'; + + } + /* Read from offset 0x2e ~ 0x3d (16 bytes) */ + status = as4630_54te_psu_read_block(client, 0x35,data->serial_number, MAX_SERIAL_NUMBER); + if (status < 0) + { + data->serial_number[0] = '\0'; + dev_dbg(&client->dev, "unable to read model name from (0x%x) offset(0x2e)\n", client->addr); + printk("unable to read model name from (0x%x) offset(0x2e)\n", client->addr); + } + data->serial_number[MAX_SERIAL_NUMBER-1]='\0'; + } + + data->last_updated = jiffies; + data->valid = 1; + } + + mutex_unlock(&data->update_lock); + + return data; +} + +module_i2c_driver(as4630_54te_psu_driver); + +MODULE_AUTHOR("Brandon Chuang "); +MODULE_DESCRIPTION("as4630_54te_psu driver"); +MODULE_LICENSE("GPL"); + diff --git a/platform/broadcom/sonic-platform-modules-accton/as4630-54te/modules/ym2651y.c b/platform/broadcom/sonic-platform-modules-accton/as4630-54te/modules/ym2651y.c new file mode 120000 index 000000000000..f4d67640ccc3 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as4630-54te/modules/ym2651y.c @@ -0,0 +1 @@ +../../common/modules/ym2651y.c \ No newline at end of file diff --git a/platform/broadcom/sonic-platform-modules-accton/as4630-54te/service/as4630-54te-platform-handle-mgmt-interface.service b/platform/broadcom/sonic-platform-modules-accton/as4630-54te/service/as4630-54te-platform-handle-mgmt-interface.service new file mode 100644 index 000000000000..fa4e1cca61c3 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as4630-54te/service/as4630-54te-platform-handle-mgmt-interface.service @@ -0,0 +1,11 @@ +[Unit] +Description=Accton AS4630-54TE Platform handle management interface service +After=sysinit.target + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/usr/local/bin/handle_mgmt_interface.sh + +[Install] +WantedBy=multi-user.target diff --git a/platform/broadcom/sonic-platform-modules-accton/as4630-54te/service/as4630-54te-platform-monitor-fan.service b/platform/broadcom/sonic-platform-modules-accton/as4630-54te/service/as4630-54te-platform-monitor-fan.service new file mode 100644 index 000000000000..d7b8b8cb2d34 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as4630-54te/service/as4630-54te-platform-monitor-fan.service @@ -0,0 +1,16 @@ +[Unit] +Description=Accton AS4630-54TE Platform Monitoring FAN service +Before=pmon.service +After=as4630-54te-platform-monitor.service +DefaultDependencies=no + +[Service] +ExecStart=/usr/local/bin/accton_as4630_54te_monitor_fan.py +KillSignal=SIGKILL +SuccessExitStatus=SIGKILL + +# Resource Limitations +LimitCORE=infinity + +[Install] +WantedBy=multi-user.target diff --git a/platform/broadcom/sonic-platform-modules-accton/as4630-54te/service/as4630-54te-platform-monitor-psu.service b/platform/broadcom/sonic-platform-modules-accton/as4630-54te/service/as4630-54te-platform-monitor-psu.service new file mode 100644 index 000000000000..a85a0918e290 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as4630-54te/service/as4630-54te-platform-monitor-psu.service @@ -0,0 +1,16 @@ +[Unit] +Description=Accton AS4630-54TE Platform Monitoring PSU service +Before=pmon.service +After=as4630-54te-platform-monitor.service +DefaultDependencies=no + +[Service] +ExecStart=/usr/local/bin/accton_as4630_54te_monitor_psu.py +KillSignal=SIGKILL +SuccessExitStatus=SIGKILL + +# Resource Limitations +LimitCORE=infinity + +[Install] +WantedBy=multi-user.target diff --git a/platform/broadcom/sonic-platform-modules-accton/as4630-54te/service/as4630-54te-platform-monitor.service b/platform/broadcom/sonic-platform-modules-accton/as4630-54te/service/as4630-54te-platform-monitor.service new file mode 100644 index 000000000000..587e6a1cafa1 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as4630-54te/service/as4630-54te-platform-monitor.service @@ -0,0 +1,17 @@ +[Unit] +Description=Accton AS4630-54TE Platform Monitoring service +Before=pmon.service +After=sysinit.target +DefaultDependencies=no + +[Service] +ExecStartPre=/usr/local/bin/accton_as4630_54te_util.py install +ExecStart=/usr/local/bin/accton_as4630_54te_monitor.py +KillSignal=SIGKILL +SuccessExitStatus=SIGKILL + +# Resource Limitations +LimitCORE=infinity + +[Install] +WantedBy=multi-user.target diff --git a/platform/broadcom/sonic-platform-modules-accton/as4630-54te/setup.py b/platform/broadcom/sonic-platform-modules-accton/as4630-54te/setup.py new file mode 100755 index 000000000000..78b45368c791 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as4630-54te/setup.py @@ -0,0 +1,14 @@ +#!/usr/bin/env python + +import os +from setuptools import setup +os.listdir + +setup( + name='as4630_54te', + version='1.0', + description='Module to initialize Accton AS4630-54TE platforms', + + packages=['as4630_54te'], + package_dir={'as4630_54te': 'as4630-54te/classes'}, +) diff --git a/platform/broadcom/sonic-platform-modules-accton/as4630-54te/sonic_platform_setup.py b/platform/broadcom/sonic-platform-modules-accton/as4630-54te/sonic_platform_setup.py new file mode 100644 index 000000000000..d256f7b3c1cd --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as4630-54te/sonic_platform_setup.py @@ -0,0 +1,34 @@ +from setuptools import setup + +DEVICE_NAME = 'accton' +HW_SKU = 'x86_64-accton_as4630_54te-r0' + +setup( + name='sonic-platform', + version='1.0', + description='SONiC platform API implementation on Accton Platforms', + license='Apache 2.0', + author='SONiC Team', + author_email='linuxnetdev@microsoft.com', + url='https://github.com/Azure/sonic-buildimage', + maintainer='Michael Shih', + maintainer_email='michael_shih@edge-core.com', + packages=[ + 'sonic_platform', + ], + package_dir={ + 'sonic_platform': '../../../../device/{}/{}/sonic_platform'.format(DEVICE_NAME, HW_SKU)}, + classifiers=[ + 'Development Status :: 3 - Alpha', + 'Environment :: Plugins', + 'Intended Audience :: Developers', + 'Intended Audience :: Information Technology', + 'Intended Audience :: System Administrators', + 'License :: OSI Approved :: Apache Software License', + 'Natural Language :: English', + 'Operating System :: POSIX :: Linux', + 'Programming Language :: Python :: 3.7', + 'Topic :: Utilities', + ], + keywords='sonic SONiC platform PLATFORM', +) diff --git a/platform/broadcom/sonic-platform-modules-accton/as4630-54te/utils/README b/platform/broadcom/sonic-platform-modules-accton/as4630-54te/utils/README new file mode 100755 index 000000000000..65bad2200816 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as4630-54te/utils/README @@ -0,0 +1,67 @@ +Copyright (C) 2019 Accton Networks, Inc. + +This program is free software: you can redistribute it and/or modify +It under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . + +All Linux kernel code is licensed under the GPLv1. All other code is +licensed under the GPLv3. Please see the LICENSE file for copies of +both licenses. + +The code for integacting with Accton AS4630-54te has 2 parts, +kernel drivers and operational script. +The kernel drivers of peripherals are under module/ directory. +1. These drivers are at module dir. +2. A operational script, accton_as4630_util.py, for device initializatian and + peripheral accessing should be installed at /usr/bin. + Run "accton_as4630_util.py install" to install drivers. + +To initialize the system, run "accton_as4630_util.py install". +To clean up the drivers & devices, run "accton_as4630_util.py clean". +To dump information of sensors, run "accton_as4630_util.py show". +To dump SFP EEPROM, run "accton_as4630_util.py sff". +To set fan speed, run "accton_as4630_util.py set fan". +To enable/disable SFP emission, run "accton_as4630_util.py set sfp". +To set system LEDs' color, run "accton_as4630_util.py set led" +For more information, run "accton_as4630_util.py --help". + +==================================================================== +Besides applying accton_as4630_util.py to access peripherals, you can +access peripherals by sysfs nodes directly after the installation is run. + +System LED: + There are 5 system LEDs at the lower-left corner of front panel. + They are loc, diag, fan, ps1, and ps2. + The sysfs interface color mappings are as follows: + Brightness: + 0 => off + 1 => green + 2 => amber + 3 => red + 4 => blue + But not all colors are available for each LED. + +Fan Control: + There are 10 fans inside 5 fan modules. + All fans share 1 duty setting, ranged from 0~100. + +Thermal sensers: + 3 temperature sensors are controlled by the lm75 kernel modules. + +PSUs: + There 2 power supplies slot at the left/right side of the back. + Once if a PSU is not plugged, the status of it is shown failed. + +There are 48 SFP+ and 6 QSFP modules are equipped. +Before operating on PSU and QSFP+, please make sure it is well plugged. +Otherwise, operation is going to fail. + diff --git a/platform/broadcom/sonic-platform-modules-accton/as4630-54te/utils/accton_as4630_54te_monitor.py b/platform/broadcom/sonic-platform-modules-accton/as4630-54te/utils/accton_as4630_54te_monitor.py new file mode 100755 index 000000000000..8c704ac60e86 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as4630-54te/utils/accton_as4630_54te_monitor.py @@ -0,0 +1,261 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -* +# Copyright (c) 2019 Edgecore Networks Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT +# LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS +# FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. +# +# See the Apache Version 2.0 License for specific language governing +# permissions and limitations under the License. +# +# HISTORY: +# mm/dd/yyyy (A.D.)# +# 10/24/2019:Jostar create for as4630_54te thermal plan +# ------------------------------------------------------------------ + +try: + import os + import sys + import getopt + import logging + import logging.config + import logging.handlers + import time + from as4630_54te.fanutil import FanUtil + from as4630_54te.thermalutil import ThermalUtil +except ImportError as e: + raise ImportError('%s - required module not found' % str(e)) + +# Deafults +VERSION = '1.0' +FUNCTION_NAME = '/usr/local/bin/accton_as4630_54te_monitor' + +# Temperature Policy +# If any fan fail , please set fan speed register to 16 +# The max value of fan speed register is 14 +# LM77(48)+LM75(4B)+LM75(4A) > 140, Set 10 +# LM77(48)+LM75(4B)+LM75(4A) > 150, Set 12 +# LM77(48)+LM75(4B)+LM75(4A) > 160, Set 14 +# LM77(48)+LM75(4B)+LM75(4A) < 140, Set 8 +# LM77(48)+LM75(4B)+LM75(4A) < 150, Set 10 +# LM77(48)+LM75(4B)+LM75(4A) < 160, Set 12 +# Reset DUT:LM77(48)>=70C +# +class switch(object): + def __init__(self, value): + self.value = value + self.fall = False + + def __iter__(self): + """Return the match method once, then stop""" + yield self.match + raise StopIteration + + def match(self, *args): + """Indicate whether or not to enter a case suite""" + if self.fall or not args: + return True + elif self.value in args: # changed for v1.5, see below + self.fall = True + return True + else: + return False + + +fan_policy_state = 0 +fan_fail = 0 +alarm_state = 0 # 0->default or clear, 1-->alarm detect +test_temp = 0 +test_temp_list = [0, 0, 0] +temp_test_data = 0 +test_temp_revert = 0 +# Make a class we can use to capture stdout and sterr in the log + + +class device_monitor(object): + # static temp var + temp = 0 + new_pwm = 0 + pwm = 0 + ori_pwm = 0 + default_pwm = 0x4 + + def __init__(self, log_file, log_level): + """Needs a logger and a logger level.""" + # set up logging to file + logging.basicConfig( + filename=log_file, + filemode='w', + level=log_level, + format='[%(asctime)s] {%(pathname)s:%(lineno)d} %(levelname)s - %(message)s', + datefmt='%H:%M:%S') + # set up logging to console + if log_level == logging.DEBUG: + console = logging.StreamHandler() + console.setLevel(log_level) + formatter = logging.Formatter( + '%(name)-12s: %(levelname)-8s %(message)s') + console.setFormatter(formatter) + logging.getLogger('').addHandler(console) + + sys_handler = logging.handlers.SysLogHandler( + address='/dev/log') + sys_handler.setLevel(logging.WARNING) + logging.getLogger('').addHandler(sys_handler) + + def get_state_from_fan_policy(self, temp, policy): + state = 0 + for i in range(0, len(policy)): + if (temp > policy[i][2]): # temp_down + if temp <= policy[i][3]: # temp_up + state = i + + return state + + def manage_fans(self): + global fan_policy_state + global fan_fail + global test_temp + global test_temp_list + global alarm_state + global temp_test_data + global test_temp_revert + LEVEL_FAN_MIN = 0 + LEVEL_FAN_NORMAL = 1 + LEVEL_FAN_MID = 2 + LEVEL_FAN_HIGH = 3 + LEVEL_TEMP_CRITICAL = 4 + fan_policy = { + LEVEL_FAN_MIN: [50, 8, 0, 140000], + LEVEL_FAN_NORMAL: [62, 10, 140000, 150000], + LEVEL_FAN_MID: [75, 12, 150000, 160000], + LEVEL_FAN_HIGH: [88, 14, 160000, 240000], + LEVEL_TEMP_CRITICAL: [100, 16, 240000, 300000], + } + temp = [0, 0, 0] + thermal = ThermalUtil() + fan = FanUtil() + ori_duty_cycle = fan.get_fan_duty_cycle() + new_duty_cycle = 0 + + if test_temp == 0: + for i in range(0, 3): + temp[i] = thermal._get_thermal_val(i + 1) + if temp[i] == 0 or temp[i] is None: + logging.warning("Get temp-%d fail", i) + return False + else: + if test_temp_revert == 0: + temp_test_data = temp_test_data + 2000 + else: + temp_test_data = temp_test_data - 2000 + + for i in range(0, 3): + temp[i] = test_temp_list[i] + temp_test_data + fan_fail = 0 + + temp_val = 0 + for i in range(0, 3): + if temp[i] is None: + break + temp_val += temp[i] + + # Check Fan status + for i in range(fan.FAN_NUM_1_IDX, fan.FAN_NUM_ON_MAIN_BROAD + 1): + if fan.get_fan_status(i) == 0: + new_pwm = 100 + logging.warning('Fan_%d fail, set pwm to 100', i) + if test_temp == 0: + fan_fail = 1 + fan.set_fan_duty_cycle(new_pwm) + break + else: + fan_fail = 0 + + ori_state = fan_policy_state + fan_policy_state = self.get_state_from_fan_policy(temp_val, fan_policy) + + if fan_policy_state > LEVEL_TEMP_CRITICAL or fan_policy_state < LEVEL_FAN_MIN: + logging.error("Get error fan current_state\n") + return 0 + + # Decision : Decide new fan pwm percent. + if fan_fail == 0 and ori_duty_cycle != fan_policy[fan_policy_state][0]: + new_duty_cycle = fan_policy[fan_policy_state][0] + fan.set_fan_duty_cycle(new_duty_cycle) + + if temp[0] >= 70000: # LM75-48 + # critical case*/ + logging.critical( + 'Alarm-Critical for temperature critical is detected, reset DUT') + cmd_str = "i2cset -y -f 3 0x60 0x4 0xE4" + time.sleep(2) + return_value = os.system(cmd_str) + logging.warning('Fan set: i2cset -y -f 3 0x60 0x4 0xE4, status is %d', return_value) + + #logging.debug('ori_state=%d, current_state=%d, temp_val=%d\n\n',ori_state, fan_policy_state, temp_val) + + if ori_state < LEVEL_FAN_HIGH: + if fan_policy_state >= LEVEL_FAN_HIGH: + if alarm_state == 0: + logging.warning('Alarm for temperature high is detected') + alarm_state = 1 + + if fan_policy_state < LEVEL_FAN_MID: + if alarm_state == 1: + logging.info('Alarm for temperature high is cleared') + alarm_state = 0 + + return True + + +def main(argv): + log_file = '%s.log' % FUNCTION_NAME + log_level = logging.INFO + global test_temp + if len(sys.argv) != 1: + try: + opts, args = getopt.getopt(argv, 'hdlt:', ['lfile=']) + except getopt.GetoptError: + print 'Usage: %s [-d] [-l ]' % sys.argv[0] + return 0 + for opt, arg in opts: + if opt == '-h': + print 'Usage: %s [-d] [-l ]' % sys.argv[0] + return 0 + elif opt in ('-d', '--debug'): + log_level = logging.DEBUG + elif opt in ('-l', '--lfile'): + log_file = arg + + if sys.argv[1] == '-t': + if len(sys.argv) != 5: + print "temp test, need input three temp" + return 0 + + i = 0 + for x in range(2, 5): + test_temp_list[i] = int(sys.argv[x]) * 1000 + i = i + 1 + test_temp = 1 + log_level = logging.DEBUG + print test_temp_list + + fan = FanUtil() + fan.set_fan_duty_cycle(50) + print "set default fan speed to 50%" + monitor = device_monitor(log_file, log_level) + # Loop forever, doing something useful hopefully: + while True: + monitor.manage_fans() + time.sleep(10) # 10sec + + +if __name__ == '__main__': + main(sys.argv[1:]) diff --git a/platform/broadcom/sonic-platform-modules-accton/as4630-54te/utils/accton_as4630_54te_monitor_fan.py b/platform/broadcom/sonic-platform-modules-accton/as4630-54te/utils/accton_as4630_54te_monitor_fan.py new file mode 100755 index 000000000000..6d8ab0ea3c95 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as4630-54te/utils/accton_as4630_54te_monitor_fan.py @@ -0,0 +1,186 @@ +#!/usr/bin/env python +# +# Copyright (C) 2018 Accton Technology Corporation +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# ------------------------------------------------------------------ +# HISTORY: +# mm/dd/yyyy (A.D.) +# 5/15/2019: Jostar create for as4630-54te +# ------------------------------------------------------------------ + +try: + import sys + import getopt + import logging + import logging.config + import logging.handlers + import time # this is only being used as part of the example + +except ImportError as e: + raise ImportError('%s - required module not found' % str(e)) + +# Deafults +VERSION = '1.0' +FUNCTION_NAME = '/usr/local/bin/accton_as4630_54te_monitor_fan' + + +class switch(object): + def __init__(self, value): + self.value = value + self.fall = False + + def __iter__(self): + """Return the match method once, then stop""" + yield self.match + raise StopIteration + + def match(self, *args): + """Indicate whether or not to enter a case suite""" + if self.fall or not args: + return True + elif self.value in args: # changed for v1.5, see below + self.fall = True + return True + else: + return False + + +fan_state = [2, 2, 2, 2] # init state=2, insert=1, remove=0 +fan_status_state = [2, 2, 2, 2] # init state=2, fault=1, normal=0 +# Make a class we can use to capture stdout and sterr in the log + + +class device_monitor(object): + + def __init__(self, log_file, log_level): + + self.fan_num = 3 + self.fan_path = "/sys/bus/i2c/devices/3-0060/" + self.present = { + 0: "fan_present_1", + 1: "fan_present_2", + 2: "fan_present_3", + } + + self.fault = { + 0: "fan_fault_1", + 1: "fan_fault_2", + 2: "fan_fault_3", + } + + """Needs a logger and a logger level.""" + # set up logging to file + logging.basicConfig( + filename=log_file, + filemode='w', + level=log_level, + format='[%(asctime)s] {%(pathname)s:%(lineno)d} %(levelname)s - %(message)s', + datefmt='%H:%M:%S') + + # set up logging to console + if log_level == logging.DEBUG: + console = logging.StreamHandler() + console.setLevel(logging.DEBUG) + formatter = logging.Formatter( + '%(name)-12s: %(levelname)-8s %(message)s') + console.setFormatter(formatter) + logging.getLogger('').addHandler(console) + + sys_handler = logging.handlers.SysLogHandler(address='/dev/log') + # sys_handler.setLevel(logging.WARNING) + sys_handler.setLevel(logging.INFO) + logging.getLogger('').addHandler(sys_handler) + + #logging.debug('SET. logfile:%s / loglevel:%d', log_file, log_level) + + def manage_fan(self): + + FAN_STATE_REMOVE = 0 + FAN_STATE_INSERT = 1 + + FAN_STATUS_FAULT = 1 + FAN_STATUS_NORMAL = 0 + + global fan_state + global fan_status_state + + for idx in range(0, self.fan_num): + node = self.fan_path + self.present[idx] + try: + val_file = open(node) + except IOError as e: + print "Error: unable to open file: %s" % str(e) + return False + content = val_file.readline().rstrip() + val_file.close() + # content is a string, either "0" or "1" + if content == "1": + if fan_state[idx] != 1: + fan_state[idx] = FAN_STATE_INSERT + logging.info("FAN-%d present is detected", idx + 1) + else: + if fan_state[idx] != 0: + fan_state[idx] = FAN_STATE_REMOVE + logging.warning( + "Alarm for FAN-%d absent is detected", idx + 1) + + for idx in range(0, self.fan_num): + node = self.fan_path + self.fault[idx] + try: + val_file = open(node) + except IOError as e: + print "Error: unable to open file: %s" % str(e) + return False + content = val_file.readline().rstrip() + val_file.close() + # content is a string, either "0" or "1" + if content == "1": + if fan_status_state[idx] != FAN_STATUS_FAULT: + if fan_state[idx] == FAN_STATE_INSERT: + logging.warning( + "Alarm for FAN-%d failed is detected", idx + 1) + fan_status_state[idx] = FAN_STATUS_FAULT + else: + fan_status_state[idx] = FAN_STATUS_NORMAL + + return True + + +def main(argv): + log_file = '%s.log' % FUNCTION_NAME + log_level = logging.INFO + if len(sys.argv) != 1: + try: + opts, args = getopt.getopt(argv, 'hdl:', ['lfile=']) + except getopt.GetoptError: + print 'Usage: %s [-d] [-l ]' % sys.argv[0] + return 0 + for opt, arg in opts: + if opt == '-h': + print 'Usage: %s [-d] [-l ]' % sys.argv[0] + return 0 + elif opt in ('-d', '--debug'): + log_level = logging.DEBUG + elif opt in ('-l', '--lfile'): + log_file = arg + monitor = device_monitor(log_file, log_level) + while True: + monitor.manage_fan() + time.sleep(3) + + +if __name__ == '__main__': + main(sys.argv[1:]) diff --git a/platform/broadcom/sonic-platform-modules-accton/as4630-54te/utils/accton_as4630_54te_monitor_psu.py b/platform/broadcom/sonic-platform-modules-accton/as4630-54te/utils/accton_as4630_54te_monitor_psu.py new file mode 100755 index 000000000000..9bff640434bf --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as4630-54te/utils/accton_as4630_54te_monitor_psu.py @@ -0,0 +1,168 @@ +#!/usr/bin/env python +# +# Copyright (C) 2018 Accton Technology Corporation +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# ------------------------------------------------------------------ +# HISTORY: +# mm/dd/yyyy (A.D.) +# 5/15/2019: Jostar create for as4630-54te +# ------------------------------------------------------------------ + +try: + import sys + import getopt + import logging + import logging.config + import logging.handlers + import time # this is only being used as part of the example + +except ImportError as e: + raise ImportError('%s - required module not found' % str(e)) + +# Deafults +VERSION = '1.0' +FUNCTION_NAME = '/usr/local/bin/accton_as4630_54te_monitor_psu' + + +psu_state = [2, 2] +psu_status_state = [2, 2] +# Make a class we can use to capture stdout and sterr in the log + + +class device_monitor(object): + + def __init__(self, log_file, log_level): + + self.psu_num = 2 + self.psu_path = "/sys/bus/i2c/devices/" + self.presence = "/psu_present" + self.oper_status = "/psu_power_good" + self.mapping = { + 0: "10-0050", + 1: "11-0051", + } + + """Needs a logger and a logger level.""" + # set up logging to file + logging.basicConfig( + filename=log_file, + filemode='w', + level=log_level, + format='[%(asctime)s] {%(pathname)s:%(lineno)d} %(levelname)s - %(message)s', + datefmt='%H:%M:%S') + # set up logging to console + + if log_level == logging.DEBUG: + console = logging.StreamHandler() + console.setLevel(log_level) + formatter = logging.Formatter( + '%(name)-12s: %(levelname)-8s %(message)s') + console.setFormatter(formatter) + logging.getLogger('').addHandler(console) + + sys_handler = logging.handlers.SysLogHandler(address='/dev/log') + # sys_handler.setLevel(logging.WARNING) + sys_handler.setLevel(logging.INFO) + logging.getLogger('').addHandler(sys_handler) + + #logging.debug('SET. logfile:%s / loglevel:%d', log_file, log_level) + + def manage_psu(self): + + PSU_STATE_REMOVE = 0 + PSU_STATE_INSERT = 1 + + PSU_STATUS_NO_POWER = 0 + PSU_STATUS_POWER_GOOD = 1 + PSU_STATUS_IDLE = 2 + + global psu_state + + for idx in range(0, self.psu_num): + node = self.psu_path + self.mapping[idx] + self.presence + try: + val_file = open(node) + except IOError as e: + print "Error: unable to open file: %s" % str(e) + return False + content = val_file.readline().rstrip() + val_file.close() + # content is a string, either "0" or "1" + if content == "1": + if psu_state[idx] != 1: + psu_state[idx] = PSU_STATE_INSERT + logging.info("PSU-%d present is detected", idx + 1) + # psu_status_state[idx]=PSU_STATUS_POWER_GOOD #when insert, + # assume power is good. If no_power, next code will find + # it. + else: + if psu_state[idx] != 0: + psu_state[idx] = PSU_STATE_REMOVE + logging.warning( + "Alarm for PSU-%d absent is detected", idx + 1) + psu_status_state[idx] = PSU_STATUS_IDLE + + for idx in range(0, self.psu_num): + node = self.psu_path + self.mapping[idx] + self.oper_status + try: + val_file = open(node) + except IOError as e: + print "Error: unable to open file: %s" % str(e) + return False + content = val_file.readline().rstrip() + val_file.close() + # content is a string, either "0" or "1" + if content == "0": + if psu_status_state[idx] != PSU_STATUS_NO_POWER: + if psu_state[idx] == PSU_STATE_INSERT: + logging.warning( + "Alarm for PSU-%d failed is detected", idx + 1) + psu_status_state[idx] = PSU_STATUS_NO_POWER + else: + if psu_state[idx] == PSU_STATE_INSERT: + if psu_status_state[idx] != PSU_STATUS_POWER_GOOD: + logging.info("PSU-%d power_good is detected", idx + 1) + psu_status_state[idx] = PSU_STATUS_POWER_GOOD + + return True + + +def main(argv): + log_file = '%s.log' % FUNCTION_NAME + log_level = logging.INFO + if len(sys.argv) != 1: + try: + opts, args = getopt.getopt(argv, 'hdl:', ['lfile=']) + except getopt.GetoptError: + print 'Usage: %s [-d] [-l ]' % sys.argv[0] + return 0 + for opt, arg in opts: + if opt == '-h': + print 'Usage: %s [-d] [-l ]' % sys.argv[0] + return 0 + elif opt in ('-d', '--debug'): + log_level = logging.DEBUG + elif opt in ('-l', '--lfile'): + log_file = arg + monitor = device_monitor(log_file, log_level) + # Loop forever, doing something useful hopefully: + while True: + monitor.manage_psu() + time.sleep(3) + + +if __name__ == '__main__': + main(sys.argv[1:]) diff --git a/platform/broadcom/sonic-platform-modules-accton/as4630-54te/utils/accton_as4630_54te_util.py b/platform/broadcom/sonic-platform-modules-accton/as4630-54te/utils/accton_as4630_54te_util.py new file mode 100755 index 000000000000..172a9842a8bf --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as4630-54te/utils/accton_as4630_54te_util.py @@ -0,0 +1,681 @@ +#!/usr/bin/env python +# +# Copyright (C) 2016 Accton Networks, Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +""" +Usage: %(scriptName)s [options] command object +options: + -h | --help : this help message + -d | --debug : run with debug mode + -f | --force : ignore error during installation or clean +command: + install : install drivers and generate related sysfs nodes + clean : uninstall drivers and remove related sysfs nodes + show : show all systen status + sff : dump SFP eeprom + set : change board setting with fan|led|sfp +""" + +import commands +import getopt +import sys +import logging +import re +import time +import os + +PROJECT_NAME = 'as4630_54te' +version = '0.0.1' +verbose = False +DEBUG = False +args = [] +ALL_DEVICE = {} +DEVICE_NO = { + 'led': 5, + 'fan1': 1, + 'fan2': 1, + 'fan3': 1, + 'fan4': 1, + 'fan5': 1, + 'thermal': 3, + 'psu': 2, + 'sfp': 54} + + +led_prefix = '/sys/devices/platform/as4630_54te_led/leds/accton_' + \ + PROJECT_NAME + '_led::' +fan_prefix = '/sys/devices/platform/as4630_54te_' +hwmon_types = {'led': ['diag', 'fan', 'loc', 'psu1', 'psu2'], + 'fan1': ['fan'], + 'fan2': ['fan'], + 'fan3': ['fan'], + 'fan4': ['fan'], + 'fan5': ['fan'], + } +hwmon_nodes = { + 'led': ['brightness'], + 'fan1': [ + 'fan_duty_cycle_percentage', + 'fan1_fault', + 'fan1_speed_rpm', + 'fan1_direction', + 'fanr1_fault', + 'fanr1_speed_rpm'], + 'fan2': [ + 'fan_duty_cycle_percentage', + 'fan2_fault', + 'fan2_speed_rpm', + 'fan2_direction', + 'fanr2_fault', + 'fanr2_speed_rpm'], + 'fan3': [ + 'fan_duty_cycle_percentage', + 'fan3_fault', + 'fan3_speed_rpm', + 'fan3_direction', + 'fanr3_fault', + 'fanr3_speed_rpm'], + 'fan4': [ + 'fan4_duty_cycle_percentage', + 'fan4_fault', + 'fan4_speed_rpm', + 'fan4_direction', + 'fanr4_fault', + 'fanr4_speed_rpm'], + 'fan5': [ + 'fan_duty_cycle_percentage', + 'fan5_fault', + 'fan5_speed_rpm', + 'fan5_direction', + 'fanr5_fault', + 'fanr5_speed_rpm'], +} +hwmon_prefix = {'led': led_prefix, + 'fan1': fan_prefix, + 'fan2': fan_prefix, + 'fan3': fan_prefix, + 'fan4': fan_prefix, + 'fan5': fan_prefix, + } + +i2c_prefix = '/sys/bus/i2c/devices/' +i2c_bus = {'fan': ['54-0066'], + 'thermal': ['54-004c', '55-0048', '55-0049', '55-004a', '55-004b'], + 'psu': ['49-0050', '50-0053'], + 'sfp': ['-0050']} +i2c_nodes = {'fan': ['present', 'front_speed_rpm', 'rear_speed_rpm'], + 'thermal': ['hwmon/hwmon*/temp1_input'], + 'psu': ['psu_present ', 'psu_power_good'], + 'sfp': ['module_present_ ', 'module_tx_disable_']} + +sfp_map = [18, 19, 20, 21, 22, 23] + +mknod = [ + 'echo pca9548 0x77 > /sys/bus/i2c/devices/i2c-1/new_device', + 'echo pca9548 0x71 > /sys/bus/i2c/devices/i2c-2/new_device', + 'echo pca9548 0x70 > /sys/bus/i2c/devices/i2c-3/new_device', + + 'echo as4630_54te_cpld 0x60 > /sys/bus/i2c/devices/i2c-3/new_device', + + 'echo lm77 0x48 > /sys/bus/i2c/devices/i2c-14/new_device', + 'echo lm75 0x4a > /sys/bus/i2c/devices/i2c-25/new_device', + 'echo lm75 0x4b > /sys/bus/i2c/devices/i2c-24/new_device', + + + # PSU-1 + 'echo as4630_54te_psu1 0x50 > /sys/bus/i2c/devices/i2c-10/new_device', + 'echo ype1200am 0x58 > /sys/bus/i2c/devices/i2c-10/new_device', + + # PSU-2 + 'echo as4630_54te_psu2 0x51> /sys/bus/i2c/devices/i2c-11/new_device', + 'echo ype1200am 0x59 > /sys/bus/i2c/devices/i2c-11/new_device', + + # EERPOM + 'echo 24c02 0x57 > /sys/bus/i2c/devices/i2c-1/new_device', +] + +# Disable CPLD debug mode +cpld_set = [ + 'i2cset -y -f 3 0x60 0x2a 0xff', + 'i2cset -y -f 3 0x60 0x2b 0xff', + 'i2cset -y -f 3 0x60 0x86 0x89' +] + +FORCE = 0 +#logging.basicConfig(filename= PROJECT_NAME+'.log', filemode='w',level=logging.DEBUG) +# logging.basicConfig(level=logging.INFO) + + +def main(): + global DEBUG + global args + global FORCE + + if DEBUG: + print(sys.argv[0]) + print('ARGV : %s' % sys.argv[1:]) + + if len(sys.argv) < 2: + show_help() + + options, args = getopt.getopt(sys.argv[1:], 'hdf', ['help', + 'debug', + 'force', + ]) + if DEBUG: + print options + print args + print len(sys.argv) + + for opt, arg in options: + if opt in ('-h', '--help'): + show_help() + elif opt in ('-d', '--debug'): + DEBUG = True + logging.basicConfig(level=logging.INFO) + elif opt in ('-f', '--force'): + FORCE = 1 + else: + print "TEST" + logging.info('no option') + for arg in args: + if arg == 'install': + do_install() + elif arg == 'clean': + do_uninstall() + elif arg == 'api': + do_sonic_platform_install() + elif arg == 'api_clean': + do_sonic_platform_clean() + elif arg == 'show': + device_traversal() + elif arg == 'sff': + if len(args) != 2: + show_eeprom_help() + elif int(args[1]) == 0 or int(args[1]) > DEVICE_NO['sfp']: + show_eeprom_help() + else: + show_eeprom(args[1]) + return + elif arg == 'set': + if len(args) < 3: + show_set_help() + else: + set_device(args[1:]) + return + else: + show_help() + + return 0 + + +def show_help(): + print __doc__ % {'scriptName': sys.argv[0].split("/")[-1]} + sys.exit(0) + + +def show_set_help(): + cmd = sys.argv[0].split("/")[-1] + " " + args[0] + print cmd + " [led|sfp|fan]" + print " use \"" + cmd + " led 0-4 \" to set led color" + print " use \"" + cmd + " fan 0-100\" to set fan duty percetage" + print " use \"" + cmd + " sfp 1-32 {0|1}\" to set sfp# tx_disable" + sys.exit(0) + + +def show_eeprom_help(): + cmd = sys.argv[0].split("/")[-1] + " " + args[0] + print " use \"" + cmd + " 1-32 \" to dump sfp# eeprom" + sys.exit(0) + + +def my_log(txt): + if DEBUG: + print "[ACCTON DBG]: " + txt + return + + +def log_os_system(cmd, show): + logging.info('Run :' + cmd) + output = "" + status, output = commands.getstatusoutput(cmd) + my_log(cmd + "with result:" + str(status)) + my_log("cmd:" + cmd) + my_log(" output:" + output) + if status: + logging.info('Failed :' + cmd) + if show: + print('Failed :' + cmd) + return status, output + + +def driver_inserted(): + ret, lsmod = log_os_system("ls /sys/module/*accton*", 0) + logging.info('mods:' + lsmod) + if ret: + return False + +#'modprobe cpr_4011_4mxx', + + +kos = [ + 'depmod -ae', + 'modprobe i2c_dev', + 'modprobe i2c_mux_pca954x force_deselect_on_exit=1', + 'modprobe ym2651y', + 'modprobe x86_64_accton_as4630_54te_cpld', + 'modprobe x86_64_accton_as4630_54te_leds', + 'modprobe x86_64_accton_as4630_54te_psu', + 'modprobe optoe'] + + +def driver_install(): + global FORCE + + my_log("rmmond i2cismt") + log_os_system("rmmod i2c_ismt", 1) + log_os_system("rmmod i2c_i801", 1) + log_os_system("modprobe i2c-i801", 1) + time.sleep(1) + log_os_system("modprobe i2c-ismt", 1) + + for i in range(0, len(kos)): + status, output = log_os_system(kos[i], 1) + if status: + if FORCE == 0: + return status + + return 0 + + +def driver_uninstall(): + global FORCE + for i in range(0, len(kos)): + rm = kos[-(i + 1)].replace("modprobe", "modprobe -rq") + lst = rm.split(" ") + print "lst=%s" % lst + if len(lst) > 3: + del(lst[3]) + rm = " ".join(lst) + status, output = log_os_system(rm, 1) + if status: + if FORCE == 0: + return status + return 0 + + +def device_install(): + global FORCE + + for i in range(0, len(mknod)): + # for pca954x need times to built new i2c buses + if mknod[i].find('pca954') != -1: + time.sleep(2) + + status, output = log_os_system(mknod[i], 1) + if status: + print output + if FORCE == 0: + return status + print("Check SFP") + for i in range(0, len(sfp_map)): + if(i < 4): + opt = 'optoe2' + else: + opt = 'optoe1' + status, output = log_os_system("echo " + + str(opt) + + " 0x50 > /sys/bus/i2c/devices/i2c-" + + str(sfp_map[i]) + + "/new_device", 1) + if status: + print output + if FORCE == 0: + return status + + status, output = log_os_system("echo port" + + str(i + + 49) + + " > /sys/bus/i2c/devices/" + + str(sfp_map[i]) + + "-0050/port_name", 1) + if status: + print output + if FORCE == 0: + return status + + return + + +def device_uninstall(): + global FORCE + + for i in range(0, len(sfp_map)): + target = "/sys/bus/i2c/devices/i2c-" + \ + str(sfp_map[i]) + "/delete_device" + status, output = log_os_system("echo 0x50 > " + target, 1) + if status: + print output + if FORCE == 0: + return status + + nodelist = mknod + + for i in range(len(nodelist)): + target = nodelist[-(i + 1)] + temp = target.split() + del temp[1] + temp[-1] = temp[-1].replace('new_device', 'delete_device') + status, output = log_os_system(" ".join(temp), 1) + if status: + print output + if FORCE == 0: + return status + + return + + +def system_ready(): + if driver_inserted() == False: + return False + if not device_exist(): + print "not device_exist()" + return False + return True + +PLATFORM_ROOT_PATH = '/usr/share/sonic/device' +PLATFORM_API2_WHL_FILE_PY3 ='sonic_platform-1.0-py3-none-any.whl' +def do_sonic_platform_install(): + device_path = "{}{}{}{}".format(PLATFORM_ROOT_PATH, '/x86_64-accton_', PROJECT_NAME, '-r0') + SONIC_PLATFORM_BSP_WHL_PKG_PY3 = "/".join([device_path, PLATFORM_API2_WHL_FILE_PY3]) + + #Check API2.0 on py whl file + status, output = log_os_system("pip3 show sonic-platform > /dev/null 2>&1", 0) + if status: + if os.path.exists(SONIC_PLATFORM_BSP_WHL_PKG_PY3): + status, output = log_os_system("pip3 install "+ SONIC_PLATFORM_BSP_WHL_PKG_PY3, 1) + if status: + print "Error: Failed to install {}".format(PLATFORM_API2_WHL_FILE_PY3) + return status + else: + print "Successfully installed {} package".format(PLATFORM_API2_WHL_FILE_PY3) + else: + print('{} is not found'.format(PLATFORM_API2_WHL_FILE_PY3)) + else: + print('{} has installed'.format(PLATFORM_API2_WHL_FILE_PY3)) + + return + +def do_sonic_platform_clean(): + status, output = log_os_system("pip3 show sonic-platform > /dev/null 2>&1", 0) + if status: + print('{} does not install, not need to uninstall'.format(PLATFORM_API2_WHL_FILE_PY3)) + + else: + status, output = log_os_system("pip3 uninstall sonic-platform -y", 0) + if status: + print('Error: Failed to uninstall {}'.format(PLATFORM_API2_WHL_FILE_PY3)) + return status + else: + print('{} is uninstalled'.format(PLATFORM_API2_WHL_FILE_PY3)) + + return + + +def do_install(): + if driver_inserted() == False: + status = driver_install() + if status: + if FORCE == 0: + return status + else: + print PROJECT_NAME.upper() + " drivers detected...." + if not device_exist(): + status = device_install() + if status: + if FORCE == 0: + return status + else: + print PROJECT_NAME.upper() + " devices detected...." + + for i in range(len(cpld_set)): + status, output = log_os_system(cpld_set[i], 1) + if status: + if FORCE == 0: + return status + + do_sonic_platform_install() + + return + + +def do_uninstall(): + if not device_exist(): + print PROJECT_NAME.upper() + " has no device installed...." + else: + print "Removing device...." + status = device_uninstall() + if status: + if FORCE == 0: + return status + + if driver_inserted() == False: + print PROJECT_NAME.upper() + " has no driver installed...." + else: + print "Removing installed driver...." + status = driver_uninstall() + if status: + if FORCE == 0: + return status + + do_sonic_platform_clean() + + return + + +def devices_info(): + global DEVICE_NO + global ALL_DEVICE + global i2c_bus, hwmon_types + for key in DEVICE_NO: + ALL_DEVICE[key] = {} + for i in range(0, DEVICE_NO[key]): + ALL_DEVICE[key][key + str(i + 1)] = [] + + for key in i2c_bus: + buses = i2c_bus[key] + nodes = i2c_nodes[key] + for i in range(0, len(buses)): + for j in range(0, len(nodes)): + if 'fan' == key: + for k in range(0, DEVICE_NO[key]): + node = key + str(k + 1) + path = i2c_prefix + \ + buses[i] + "/fan" + str(k + 1) + "_" + nodes[j] + my_log(node + ": " + path) + ALL_DEVICE[key][node].append(path) + elif 'sfp' == key: + for k in range(0, DEVICE_NO[key]): + node = key + str(k + 1) + path = i2c_prefix + \ + str(sfp_map[k]) + buses[i] + "/" + nodes[j] + my_log(node + ": " + path) + ALL_DEVICE[key][node].append(path) + else: + node = key + str(i + 1) + path = i2c_prefix + buses[i] + "/" + nodes[j] + my_log(node + ": " + path) + ALL_DEVICE[key][node].append(path) + + for key in hwmon_types: + itypes = hwmon_types[key] + nodes = hwmon_nodes[key] + for i in range(0, len(itypes)): + for j in range(0, len(nodes)): + node = key + "_" + itypes[i] + path = hwmon_prefix[key] + itypes[i] + "/" + nodes[j] + my_log(node + ": " + path) + ALL_DEVICE[key][key + str(i + 1)].append(path) + + # show dict all in the order + if DEBUG: + for i in sorted(ALL_DEVICE.keys()): + print(i + ": ") + for j in sorted(ALL_DEVICE[i].keys()): + print(" " + j) + for k in (ALL_DEVICE[i][j]): + print(" " + " " + k) + return + + +def show_eeprom(index): + if system_ready() == False: + print("System's not ready.") + print("Please install first!") + return + + if len(ALL_DEVICE) == 0: + devices_info() + node = ALL_DEVICE['sfp']['sfp' + str(index)][0] + node = node.replace(node.split("/")[-1], 'eeprom') + # check if got hexdump command in current environment + ret, log = log_os_system("which hexdump", 0) + ret, log2 = log_os_system("which busybox hexdump", 0) + if len(log): + hex_cmd = 'hexdump' + elif len(log2): + hex_cmd = ' busybox hexdump' + else: + log = 'Failed : no hexdump cmd!!' + logging.info(log) + print log + return 1 + print "node=%s" % node + print node + ":" + ret, log = log_os_system("cat " + node + "| " + hex_cmd + " -C", 1) + if ret == 0: + print log + else: + print "**********device no found**********" + return + + +def set_device(args): + global DEVICE_NO + global ALL_DEVICE + if system_ready() == False: + print("System's not ready.") + print("Please install first!") + return + + if len(ALL_DEVICE) == 0: + devices_info() + + if args[0] == 'led': + if int(args[1]) > 4: + show_set_help() + return + #print ALL_DEVICE['led'] + for i in range(0, len(ALL_DEVICE['led'])): + for k in (ALL_DEVICE['led']['led' + str(i + 1)]): + ret, log = log_os_system("echo " + args[1] + " >" + k, 1) + if ret: + return ret + elif args[0] == 'fan': + if int(args[1]) > 100: + show_set_help() + return + #print ALL_DEVICE['fan'] + # fan1~6 is all fine, all fan share same setting + node = ALL_DEVICE['fan1']['fan11'][0] + node = node.replace(node.split("/")[-1], 'fan1_duty_cycle_percentage') + ret, log = log_os_system("cat " + node, 1) + if ret == 0: + print ("Previous fan duty: " + log.strip() + "%") + ret, log = log_os_system("echo " + args[1] + " >" + node, 1) + if ret == 0: + print ("Current fan duty: " + args[1] + "%") + return ret + elif args[0] == 'sfp': + if int(args[1]) > DEVICE_NO[args[0]] or int(args[1]) == 0: + show_set_help() + return + if len(args) < 2: + show_set_help() + return + + if int(args[2]) > 1: + show_set_help() + return + + #print ALL_DEVICE[args[0]] + for i in range(0, len(ALL_DEVICE[args[0]])): + for j in ALL_DEVICE[args[0]][args[0] + str(args[1])]: + if j.find('tx_disable') != -1: + ret, log = log_os_system("echo " + args[2] + " >" + j, 1) + if ret: + return ret + + return + +# get digits inside a string. +# Ex: 31 for "sfp31" + + +def get_value(input): + digit = re.findall(r'\d+', input) + return int(digit[0]) + + +def device_traversal(): + if system_ready() == False: + print("System's not ready.") + print("Please install first!") + return + + if len(ALL_DEVICE) == 0: + devices_info() + for i in sorted(ALL_DEVICE.keys()): + print("============================================") + print(i.upper() + ": ") + print("============================================") + + for j in sorted(ALL_DEVICE[i].keys(), key=get_value): + print " " + j + ":", + for k in (ALL_DEVICE[i][j]): + ret, log = log_os_system("cat " + k, 0) + func = k.split("/")[-1].strip() + func = re.sub(j + '_', '', func, 1) + func = re.sub(i.lower() + '_', '', func, 1) + if ret == 0: + print func + "=" + log + " ", + else: + print func + "=" + "X" + " ", + print + print("----------------------------------------------------------------") + + print + return + + +def device_exist(): + ret1, log = log_os_system("ls " + i2c_prefix + "*0077", 0) + ret2, log = log_os_system("ls " + i2c_prefix + "i2c-2", 0) + return not(ret1 or ret2) + + +if __name__ == "__main__": + main() diff --git a/platform/broadcom/sonic-platform-modules-accton/as4630-54te/utils/handle_mgmt_interface.sh b/platform/broadcom/sonic-platform-modules-accton/as4630-54te/utils/handle_mgmt_interface.sh new file mode 100755 index 000000000000..82f4d5e02116 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as4630-54te/utils/handle_mgmt_interface.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +#Due to the hardware design, as4630-54te use "eth2" instead of "eth0" as management interface. +#Rename netdev "eth0" and "eth2" to swap original "eth2" to "eth0". +ifconfig eth0 down +ip link set eth0 name eth3 +ip link set eth2 name eth0 +ifconfig eth0 up diff --git a/platform/broadcom/sonic-platform-modules-accton/as5712-54x/utils/accton_as5712_util.py b/platform/broadcom/sonic-platform-modules-accton/as5712-54x/utils/accton_as5712_util.py index ff5d883f1fe8..ed9667da8c99 100755 --- a/platform/broadcom/sonic-platform-modules-accton/as5712-54x/utils/accton_as5712_util.py +++ b/platform/broadcom/sonic-platform-modules-accton/as5712-54x/utils/accton_as5712_util.py @@ -240,11 +240,12 @@ def log_os_system(cmd, show): return status, output def driver_inserted(): - ret, lsmod = log_os_system("ls /sys/module/ | grep accton", 0) + ret, lsmod = log_os_system("ls /sys/module/*accton*", 0) logging.info('mods:'+lsmod) - if not lsmod: + if ret : return False - + else : + return True kos = [ 'depmod -ae', diff --git a/platform/broadcom/sonic-platform-modules-accton/as5812-54t/utils/accton_as5812_util.py b/platform/broadcom/sonic-platform-modules-accton/as5812-54t/utils/accton_as5812_util.py index e5ec4fa856d2..3859c3279c45 100755 --- a/platform/broadcom/sonic-platform-modules-accton/as5812-54t/utils/accton_as5812_util.py +++ b/platform/broadcom/sonic-platform-modules-accton/as5812-54t/utils/accton_as5812_util.py @@ -145,11 +145,12 @@ def log_os_system(cmd, show): return status, output def driver_check(): - ret, lsmod = log_os_system("lsmod| grep accton", 0) + ret, lsmod = log_os_system("ls /sys/module/*accton*", 0) logging.info('mods:'+lsmod) - if len(lsmod) ==0: - return False - return True + if ret : + return False + else : + return True kos = [ 'modprobe i2c_dev', diff --git a/platform/broadcom/sonic-platform-modules-accton/as5812-54x/utils/accton_as5812_util.py b/platform/broadcom/sonic-platform-modules-accton/as5812-54x/utils/accton_as5812_util.py index be4b5a450c19..464c85745f90 100755 --- a/platform/broadcom/sonic-platform-modules-accton/as5812-54x/utils/accton_as5812_util.py +++ b/platform/broadcom/sonic-platform-modules-accton/as5812-54x/utils/accton_as5812_util.py @@ -240,10 +240,12 @@ def log_os_system(cmd, show): return status, output def driver_inserted(): - ret, lsmod = log_os_system("ls /sys/module | grep accton", 0) + ret, lsmod = log_os_system("ls /sys/module/*accton*", 0) logging.info('mods:'+lsmod) - if len(lsmod) ==0: + if ret : return False + else : + return True diff --git a/platform/broadcom/sonic-platform-modules-accton/as5835-54t/utils/accton_as5835_54t_util.py b/platform/broadcom/sonic-platform-modules-accton/as5835-54t/utils/accton_as5835_54t_util.py index 84625fd6dbf9..48e49cbaba13 100755 --- a/platform/broadcom/sonic-platform-modules-accton/as5835-54t/utils/accton_as5835_54t_util.py +++ b/platform/broadcom/sonic-platform-modules-accton/as5835-54t/utils/accton_as5835_54t_util.py @@ -145,11 +145,12 @@ def log_os_system(cmd, show): return status, output def driver_check(): - ret, lsmod = log_os_system("lsmod| grep accton", 0) + ret, lsmod = log_os_system("ls /sys/module/*accton*", 0) logging.info('mods:'+lsmod) - if len(lsmod) ==0: - return False - return True + if ret : + return False + else : + return True diff --git a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform_setup.py b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform_setup.py new file mode 100644 index 000000000000..a775511c643d --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/sonic_platform_setup.py @@ -0,0 +1,34 @@ +from setuptools import setup + +DEVICE_NAME = 'accton' +HW_SKU = 'x86_64-accton_as5835_54x-r0' + +setup( + name='sonic-platform', + version='1.0', + description='SONiC platform API implementation on Accton Platforms', + license='Apache 2.0', + author='SONiC Team', + author_email='linuxnetdev@microsoft.com', + url='https://github.com/Azure/sonic-buildimage', + maintainer='Jostar Yang', + maintainer_email='jostar_yang@accton.com', + packages=[ + 'sonic_platform', + ], + package_dir={ + 'sonic_platform': '../../../../device/{}/{}/sonic_platform'.format(DEVICE_NAME, HW_SKU)}, + classifiers=[ + 'Development Status :: 3 - Alpha', + 'Environment :: Plugins', + 'Intended Audience :: Developers', + 'Intended Audience :: Information Technology', + 'Intended Audience :: System Administrators', + 'License :: OSI Approved :: Apache Software License', + 'Natural Language :: English', + 'Operating System :: POSIX :: Linux', + 'Programming Language :: Python :: 3.7', + 'Topic :: Utilities', + ], + keywords='sonic SONiC platform PLATFORM', +) diff --git a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/utils/accton_as5835_54x_util.py b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/utils/accton_as5835_54x_util.py index 87ef06f0de16..25faba378181 100755 --- a/platform/broadcom/sonic-platform-modules-accton/as5835-54x/utils/accton_as5835_54x_util.py +++ b/platform/broadcom/sonic-platform-modules-accton/as5835-54x/utils/accton_as5835_54x_util.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Copyright (C) 2019 Accton Networks, Inc. # @@ -17,25 +17,20 @@ """ Usage: %(scriptName)s [options] command object - options: -h | --help : this help message -d | --debug : run with debug mode -f | --force : ignore error during installation or clean command: install : install drivers and generate related sysfs nodes - clean : uninstall drivers and remove related sysfs nodes - show : show all systen status - sff : dump SFP eeprom - set : change board setting with fan|led|sfp + clean : uninstall drivers and remove related sysfs nodes """ - -import commands +import subprocess import getopt import sys import logging -import re import time +import os @@ -46,15 +41,15 @@ DEBUG = False args = [] ALL_DEVICE = {} -DEVICE_NO = {'led':5, 'fan':5,'thermal':4, 'psu':2, 'sfp':54} FORCE = 0 + #logging.basicConfig(filename= PROJECT_NAME+'.log', filemode='w',level=logging.DEBUG) #logging.basicConfig(level=logging.INFO) if DEBUG == True: - print sys.argv[0] - print 'ARGV :', sys.argv[1:] + print(sys.argv[0]) + print("ARGV :", sys.argv[1:]) def main(): @@ -70,9 +65,9 @@ def main(): 'force', ]) if DEBUG == True: - print options - print args - print len(sys.argv) + print(options) + print(args) + print(len(sys.argv)) for opt, arg in options: if opt in ('-h', '--help'): @@ -89,22 +84,11 @@ def main(): do_install() elif arg == 'clean': do_uninstall() - elif arg == 'show': - device_traversal() - elif arg == 'sff': - if len(args)!=2: - show_eeprom_help() - elif int(args[1]) ==0 or int(args[1]) > DEVICE_NO['sfp']: - show_eeprom_help() - else: - show_eeprom(args[1]) - return - elif arg == 'set': - if len(args)<3: - show_set_help() - else: - set_device(args[1:]) - return + elif arg == 'api': + do_sonic_platform_install() + elif arg == 'api_clean': + do_sonic_platform_clean() + else: show_help() @@ -112,30 +96,18 @@ def main(): return 0 def show_help(): - print __doc__ % {'scriptName' : sys.argv[0].split("/")[-1]} - sys.exit(0) - -def show_set_help(): - cmd = sys.argv[0].split("/")[-1]+ " " + args[0] - print cmd +" [led|sfp|fan]" - print " use \""+ cmd + " led 0-4 \" to set led color" - print " use \""+ cmd + " fan 0-100\" to set fan duty percetage" - print " use \""+ cmd + " sfp 1-48 {0|1}\" to set sfp# tx_disable" + print(__doc__ % {'scriptName' : sys.argv[0].split("/")[-1]}) sys.exit(0) -def show_eeprom_help(): - cmd = sys.argv[0].split("/")[-1]+ " " + args[0] - print " use \""+ cmd + " 1-54 \" to dump sfp# eeprom" - sys.exit(0) def my_log(txt): if DEBUG == True: - print "[Debug]"+txt + print("[Debug]"+txt) return def log_os_system(cmd, show): logging.info('Run :'+cmd) - status, output = commands.getstatusoutput(cmd) + status, output = subprocess.getstatusoutput(cmd) my_log (cmd +"with result:" + str(status)) my_log (" output:"+output) if status: @@ -145,11 +117,12 @@ def log_os_system(cmd, show): return status, output def driver_check(): - ret, lsmod = log_os_system("ls /sys/module/ | grep accton", 0) + ret, lsmod = log_os_system("ls /sys/module/*accton*", 0) logging.info('mods:'+lsmod) - if len(lsmod) ==0: + if ret : return False - return True + else : + return True @@ -171,6 +144,8 @@ def driver_install(): if ret[0]: if FORCE == 0: return ret[0] + print("Done driver_install") + return 0 def driver_uninstall(): @@ -188,12 +163,8 @@ def driver_uninstall(): return ret[0] return 0 -led_prefix ='/sys/class/leds/'+PROJECT_NAME+'_led::' -hwmon_types = {'led': ['diag','fan','loc','psu1','psu2']} -hwmon_nodes = {'led': ['brightness'] } -hwmon_prefix ={'led': led_prefix} - i2c_prefix = '/sys/bus/i2c/devices/' +''' i2c_bus = {'fan': ['3-0063'] , 'thermal': ['18-004b','19-004c', '20-0049', '21-004a'] , 'psu': ['11-0050','12-0053'], @@ -202,7 +173,7 @@ def driver_uninstall(): 'thermal': ['hwmon/hwmon*/temp1_input'] , 'psu': ['psu_present ', 'psu_power_good'] , 'sfp': ['module_present_', 'module_tx_disable_']} - +''' sfp_map = [42,43,44,45,46,47,48,49,50,51, 52,53,54,55,56,57,58,59,60,61, 62,63,64,65,66,67,68,69,70,71, @@ -297,7 +268,7 @@ def device_install(): status, output = log_os_system(mknod2[i], 1) time.sleep(0.01) if status: - print output + print(output) if FORCE == 0: return status else: @@ -308,7 +279,7 @@ def device_install(): status, output = log_os_system(mknod[i], 1) if status: - print output + print(output) if FORCE == 0: return status @@ -321,9 +292,11 @@ def device_install(): else: status, output =log_os_system("echo optoe1 0x50 > /sys/bus/i2c/devices/i2c-"+str(sfp_map[i])+"/new_device", 1) if status: - print output + print(output) if FORCE == 0: return status + print("Done device_install") + return def device_uninstall(): @@ -333,7 +306,7 @@ def device_uninstall(): target = "/sys/bus/i2c/devices/i2c-"+str(sfp_map[i])+"/delete_device" status, output =log_os_system("echo 0x50 > "+ target, 1) if status: - print output + print(output) if FORCE == 0: return status @@ -350,7 +323,7 @@ def device_uninstall(): temp[-1] = temp[-1].replace('new_device', 'delete_device') status, output = log_os_system(" ".join(temp), 1) if status: - print output + print(output) if FORCE == 0: return status @@ -363,227 +336,89 @@ def system_ready(): return False return True +PLATFORM_ROOT_PATH = '/usr/share/sonic/device' +PLATFORM_API2_WHL_FILE_PY3 ='sonic_platform-1.0-py3-none-any.whl' +def do_sonic_platform_install(): + device_path = "{}{}{}{}".format(PLATFORM_ROOT_PATH, '/x86_64-accton_', PROJECT_NAME, '-r0') + SONIC_PLATFORM_BSP_WHL_PKG_PY3 = "/".join([device_path, PLATFORM_API2_WHL_FILE_PY3]) + + #Check API2.0 on py whl file + status, output = log_os_system("pip3 show sonic-platform > /dev/null 2>&1", 0) + if status: + if os.path.exists(SONIC_PLATFORM_BSP_WHL_PKG_PY3): + status, output = log_os_system("pip3 install "+ SONIC_PLATFORM_BSP_WHL_PKG_PY3, 1) + if status: + print("Error: Failed to install {}".format(PLATFORM_API2_WHL_FILE_PY3) ) + return status + else: + print("Successfully installed {} package".format(PLATFORM_API2_WHL_FILE_PY3) ) + else: + print('{} is not found'.format(PLATFORM_API2_WHL_FILE_PY3)) + else: + print('{} has installed'.format(PLATFORM_API2_WHL_FILE_PY3)) + + return + +def do_sonic_platform_clean(): + status, output = log_os_system("pip3 show sonic-platform > /dev/null 2>&1", 0) + if status: + print('{} does not install, not need to uninstall'.format(PLATFORM_API2_WHL_FILE_PY3)) + + else: + status, output = log_os_system("pip3 uninstall sonic-platform -y", 0) + if status: + print('Error: Failed to uninstall {}'.format(PLATFORM_API2_WHL_FILE_PY3)) + return status + else: + print('{} is uninstalled'.format(PLATFORM_API2_WHL_FILE_PY3)) + def do_install(): - print "Checking system...." + print("Checking system....") if driver_check() == False: - print "No driver, installing...." + print("No driver, installing....") status = driver_install() if status: if FORCE == 0: return status else: - print PROJECT_NAME.upper()+" drivers detected...." + print(PROJECT_NAME.upper()+" drivers detected....") if not device_exist(): - print "No device, installing...." + print("No device, installing....") status = device_install() if status: if FORCE == 0: return status else: - print PROJECT_NAME.upper()+" devices detected...." + print(PROJECT_NAME.upper()+" devices detected....") + + do_sonic_platform_install() + return def do_uninstall(): - print "Checking system...." + print("Checking system....") if not device_exist(): - print PROJECT_NAME.upper() +" has no device installed...." + print(PROJECT_NAME.upper() +" has no device installed....") else: - print "Removing device...." + print("Removing device....") status = device_uninstall() if status: if FORCE == 0: return status if driver_check()== False : - print PROJECT_NAME.upper() +" has no driver installed...." + print(PROJECT_NAME.upper() +" has no driver installed....") else: - print "Removing installed driver...." + print("Removing installed driver....") status = driver_uninstall() if status: if FORCE == 0: return status - return - -def devices_info(): - global DEVICE_NO - global ALL_DEVICE - global i2c_bus, hwmon_types - for key in DEVICE_NO: - ALL_DEVICE[key]= {} - for i in range(0,DEVICE_NO[key]): - ALL_DEVICE[key][key+str(i+1)] = [] - - for key in i2c_bus: - buses = i2c_bus[key] - nodes = i2c_nodes[key] - for i in range(0,len(buses)): - for j in range(0,len(nodes)): - if 'fan' == key: - for k in range(0,DEVICE_NO[key]): - node = key+str(k+1) - path = i2c_prefix+ buses[i]+"/fan"+str(k+1)+"_"+ nodes[j] - my_log(node+": "+ path) - ALL_DEVICE[key][node].append(path) - elif 'sfp' == key: - for k in range(0,DEVICE_NO[key]): - for lk in cpld_of_module: - if k in cpld_of_module[lk]: - node = key+str(k+1) - path = i2c_prefix + lk + "/"+ nodes[j] + str(k+1) - my_log(node+": "+ path) - ALL_DEVICE[key][node].append(path) - else: - node = key+str(i+1) - path = i2c_prefix+ buses[i]+"/"+ nodes[j] - my_log(node+": "+ path) - ALL_DEVICE[key][node].append(path) - - for key in hwmon_types: - itypes = hwmon_types[key] - nodes = hwmon_nodes[key] - for i in range(0,len(itypes)): - for j in range(0,len(nodes)): - node = key+"_"+itypes[i] - path = hwmon_prefix[key]+ itypes[i]+"/"+ nodes[j] - my_log(node+": "+ path) - ALL_DEVICE[key][ key+str(i+1)].append(path) - - #show dict all in the order - if DEBUG == True: - for i in sorted(ALL_DEVICE.keys()): - print(i+": ") - for j in sorted(ALL_DEVICE[i].keys()): - print(" "+j) - for k in (ALL_DEVICE[i][j]): - print(" "+" "+k) - return - -def show_eeprom(index): - if system_ready()==False: - print("System's not ready.") - print("Please install first!") - return - - if len(ALL_DEVICE)==0: - devices_info() - node = ALL_DEVICE['sfp'] ['sfp'+str(index)][0] - node = node.replace(node.split("/")[-1], 'sfp_eeprom') - # check if got hexdump command in current environment - ret, log = log_os_system("which hexdump", 0) - ret, log2 = log_os_system("which busybox hexdump", 0) - if log : - hex_cmd = 'hexdump' - elif log2 : - hex_cmd = ' busybox hexdump' - else: - log = 'Failed : no hexdump cmd!!' - logging.info(log) - print log - return 1 - - print node + ":" - ret, log = log_os_system("cat "+node+"| "+hex_cmd+" -C", 1) - if ret==0: - print log - else: - print "**********device no found**********" - return - -def set_device(args): - global DEVICE_NO - global ALL_DEVICE - if system_ready()==False: - print("System's not ready.") - print("Please install first!") - return - - if len(ALL_DEVICE)==0: - devices_info() - - if args[0]=='led': - if int(args[1])>4: - show_set_help() - return - #print ALL_DEVICE['led'] - for i in range(0,len(ALL_DEVICE['led'])): - for k in (ALL_DEVICE['led']['led'+str(i+1)]): - ret = log_os_system("echo "+args[1]+" >"+k, 1) - if ret[0]: - return ret[0] - elif args[0]=='fan': - if int(args[1])>100: - show_set_help() - return - #print ALL_DEVICE['fan'] - #fan1~5 is all fine, all fan share same setting - node = ALL_DEVICE['fan'] ['fan1'][0] - node = node.replace(node.split("/")[-1], 'fan_duty_cycle_percentage') - ret = log_os_system("cat "+ node, 1) - if ret[0] == 0: - print ("Previous fan duty: " + log.strip() +"%") - ret = log_os_system("echo "+args[1]+" >"+node, 1) - if ret[0] == 0: - print ("Current fan duty: " + args[1] +"%") - return ret[0] - elif args[0]=='sfp': - if int(args[1])> qsfp_start or int(args[1])==0: - show_set_help() - return - if len(args)<2: - show_set_help() - return - - if int(args[2])>1: - show_set_help() - return - - #print ALL_DEVICE[args[0]] - for i in range(0,len(ALL_DEVICE[args[0]])): - for j in ALL_DEVICE[args[0]][args[0]+str(args[1])]: - if j.find('tx_disable')!= -1: - ret = log_os_system("echo "+args[2]+" >"+ j, 1) - if ret[0]: - return ret[0] + do_sonic_platform_clean() return -#get digits inside a string. -#Ex: 31 for "sfp31" -def get_value(input): - digit = re.findall('\d+', input) - return int(digit[0]) - -def device_traversal(): - if system_ready()==False: - print("System's not ready.") - print("Please install first!") - return - - if len(ALL_DEVICE)==0: - devices_info() - for i in sorted(ALL_DEVICE.keys()): - print("============================================") - print(i.upper()+": ") - print("============================================") - - for j in sorted(ALL_DEVICE[i].keys(), key=get_value): - print " "+j+":", - for k in (ALL_DEVICE[i][j]): - ret, log = log_os_system("cat "+k, 0) - func = k.split("/")[-1].strip() - func = re.sub(j+'_','',func,1) - func = re.sub(i.lower()+'_','',func,1) - if ret==0: - print func+"="+log+" ", - else: - print func+"="+"X"+" ", - print - print("----------------------------------------------------------------") - - - print - return def device_exist(): ret1 = log_os_system("ls "+i2c_prefix+"*0077", 0) diff --git a/platform/broadcom/sonic-platform-modules-accton/as6712-32x/utils/accton_as6712_util.py b/platform/broadcom/sonic-platform-modules-accton/as6712-32x/utils/accton_as6712_util.py index 20968d57a91f..10cdac787309 100755 --- a/platform/broadcom/sonic-platform-modules-accton/as6712-32x/utils/accton_as6712_util.py +++ b/platform/broadcom/sonic-platform-modules-accton/as6712-32x/utils/accton_as6712_util.py @@ -249,10 +249,12 @@ def log_os_system(cmd, show): return status, output def driver_inserted(): - ret, lsmod = log_os_system("lsmod| grep accton", 0) + ret, lsmod = log_os_system("ls /sys/module/*accton*", 0) logging.info('mods:'+lsmod) - if len(lsmod) ==0: + if ret : return False + else : + return True diff --git a/platform/broadcom/sonic-platform-modules-accton/as7312-54x/sonic_platform_setup.py b/platform/broadcom/sonic-platform-modules-accton/as7312-54x/sonic_platform_setup.py new file mode 100755 index 000000000000..672fe89cef6c --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as7312-54x/sonic_platform_setup.py @@ -0,0 +1,34 @@ +from setuptools import setup + +DEVICE_NAME = 'accton' +HW_SKU = 'x86_64-accton_as7312_54x-r0' + +setup( + name='sonic-platform', + version='1.0', + description='SONiC platform API implementation on Accton Platforms', + license='Apache 2.0', + author='SONiC Team', + author_email='linuxnetdev@microsoft.com', + url='https://github.com/Azure/sonic-buildimage', + maintainer='Jostar Yang', + maintainer_email='jostar_yang@edge-core.com', + packages=[ + 'sonic_platform', + ], + package_dir={ + 'sonic_platform': '../../../../device/{}/{}/sonic_platform'.format(DEVICE_NAME, HW_SKU)}, + classifiers=[ + 'Development Status :: 3 - Alpha', + 'Environment :: Plugins', + 'Intended Audience :: Developers', + 'Intended Audience :: Information Technology', + 'Intended Audience :: System Administrators', + 'License :: OSI Approved :: Apache Software License', + 'Natural Language :: English', + 'Operating System :: POSIX :: Linux', + 'Programming Language :: Python :: 3.7', + 'Topic :: Utilities', + ], + keywords='sonic SONiC platform PLATFORM', +) diff --git a/platform/broadcom/sonic-platform-modules-accton/as7312-54x/utils/accton_as7312_util.py b/platform/broadcom/sonic-platform-modules-accton/as7312-54x/utils/accton_as7312_util.py index db58d769b3aa..e2f058b4e37a 100755 --- a/platform/broadcom/sonic-platform-modules-accton/as7312-54x/utils/accton_as7312_util.py +++ b/platform/broadcom/sonic-platform-modules-accton/as7312-54x/utils/accton_as7312_util.py @@ -35,7 +35,7 @@ import logging import re import time - +import os PROJECT_NAME = 'as7312_54x' version = '0.1.0' @@ -90,6 +90,10 @@ def main(): do_install() elif arg == 'clean': do_uninstall() + elif arg == 'api': + do_sonic_platform_install() + elif arg == 'api_clean': + do_sonic_platform_clean() elif arg == 'show': device_traversal() elif arg == 'sff': @@ -150,11 +154,12 @@ def log_os_system(cmd, show): def driver_check(): - (ret, lsmod) = log_os_system('ls /sys/module/ | grep accton', 0) - logging.info('mods:' + lsmod) - if not lsmod: + ret, lsmod = log_os_system("ls /sys/module/*accton*", 0) + logging.info('mods:'+lsmod) + if ret : return False - return True + else : + return True kos = [ @@ -357,6 +362,43 @@ def system_ready(): return False return True +PLATFORM_ROOT_PATH = '/usr/share/sonic/device' +PLATFORM_API2_WHL_FILE_PY3 ='sonic_platform-1.0-py3-none-any.whl' +def do_sonic_platform_install(): + device_path = "{}{}{}{}".format(PLATFORM_ROOT_PATH, '/x86_64-accton_', PROJECT_NAME, '-r0') + SONIC_PLATFORM_BSP_WHL_PKG_PY3 = "/".join([device_path, PLATFORM_API2_WHL_FILE_PY3]) + + #Check API2.0 on py whl file + status, output = log_os_system("pip3 show sonic-platform > /dev/null 2>&1", 0) + if status: + if os.path.exists(SONIC_PLATFORM_BSP_WHL_PKG_PY3): + status, output = log_os_system("pip3 install "+ SONIC_PLATFORM_BSP_WHL_PKG_PY3, 1) + if status: + print "Error: Failed to install {}".format(PLATFORM_API2_WHL_FILE_PY3) + return status + else: + print "Successfully installed {} package".format(PLATFORM_API2_WHL_FILE_PY3) + else: + print('{} is not found'.format(PLATFORM_API2_WHL_FILE_PY3)) + else: + print('{} has installed'.format(PLATFORM_API2_WHL_FILE_PY3)) + + return + +def do_sonic_platform_clean(): + status, output = log_os_system("pip3 show sonic-platform > /dev/null 2>&1", 0) + if status: + print('{} does not install, not need to uninstall'.format(PLATFORM_API2_WHL_FILE_PY3)) + + else: + status, output = log_os_system("pip3 uninstall sonic-platform -y", 0) + if status: + print('Error: Failed to uninstall {}'.format(PLATFORM_API2_WHL_FILE_PY3)) + return status + else: + print('{} is uninstalled'.format(PLATFORM_API2_WHL_FILE_PY3)) + + return def do_install(): print 'Checking system....' @@ -376,6 +418,8 @@ def do_install(): return status else: print PROJECT_NAME.upper() + ' devices detected....' + do_sonic_platform_install() + return @@ -396,6 +440,9 @@ def do_uninstall(): status = driver_uninstall() if status and FORCE == 0: return status + + do_sonic_platform_clean() + return None @@ -459,8 +506,8 @@ def devices_info(): def show_eeprom(index): if system_ready() is False: - print "System's not ready." - print 'Please install first!' + print('Systems not ready.') + print('Please install first!') return if len(ALL_DEVICE) == 0: @@ -487,7 +534,7 @@ def show_eeprom(index): if ret == 0: print log else: - print '**********device no found**********' + print( '**********device no found**********') return @@ -495,8 +542,8 @@ def set_device(args): global DEVICE_NO global ALL_DEVICE if system_ready() is False: - print "System's not ready." - print 'Please install first!' + print('System is not ready.') + print('Please install first!') return if not ALL_DEVICE: @@ -564,7 +611,7 @@ def get_value(i): def device_traversal(): if system_ready() is False: - print "System's not ready." + print "System is not ready." print 'Please install first!' return diff --git a/platform/broadcom/sonic-platform-modules-accton/as7312-54xs/utils/accton_as7312_util.py b/platform/broadcom/sonic-platform-modules-accton/as7312-54xs/utils/accton_as7312_util.py index 4b2ebbe1cca2..f6a21bdd3df9 100755 --- a/platform/broadcom/sonic-platform-modules-accton/as7312-54xs/utils/accton_as7312_util.py +++ b/platform/broadcom/sonic-platform-modules-accton/as7312-54xs/utils/accton_as7312_util.py @@ -145,11 +145,12 @@ def log_os_system(cmd, show): return status, output def driver_check(): - ret, lsmod = log_os_system("lsmod| grep accton", 0) + ret, lsmod = log_os_system("ls /sys/module/*accton*", 0) logging.info('mods:'+lsmod) - if len(lsmod) ==0: - return False - return True + if ret : + return False + else : + return True diff --git a/platform/broadcom/sonic-platform-modules-accton/as7315-27xb/utils/accton_as7315_util.py b/platform/broadcom/sonic-platform-modules-accton/as7315-27xb/utils/accton_as7315_util.py index 869a7784f0d9..e3810e42102e 100755 --- a/platform/broadcom/sonic-platform-modules-accton/as7315-27xb/utils/accton_as7315_util.py +++ b/platform/broadcom/sonic-platform-modules-accton/as7315-27xb/utils/accton_as7315_util.py @@ -147,11 +147,12 @@ def log_os_system(cmd, show): return status, output def driver_check(): - ret, lsmod = log_os_system("lsmod| grep accton", 0) + ret, lsmod = log_os_system("ls /sys/module/*accton*", 0) logging.info('mods:'+lsmod) - if len(lsmod) ==0: - return False - return True + if ret : + return False + else : + return True diff --git a/platform/broadcom/sonic-platform-modules-accton/as7326-56x/utils/accton_as7326_util.py b/platform/broadcom/sonic-platform-modules-accton/as7326-56x/utils/accton_as7326_util.py index cc04c1de38a9..c5d047e9d4e0 100755 --- a/platform/broadcom/sonic-platform-modules-accton/as7326-56x/utils/accton_as7326_util.py +++ b/platform/broadcom/sonic-platform-modules-accton/as7326-56x/utils/accton_as7326_util.py @@ -178,11 +178,12 @@ def log_os_system(cmd, show): return status, output def driver_check(): - ret, lsmod = log_os_system("lsmod| grep accton", 0) + ret, lsmod = log_os_system("ls /sys/module/*accton*", 0) logging.info('mods:'+lsmod) - if len(lsmod) ==0: + if ret : return False - return True + else : + return True diff --git a/platform/broadcom/sonic-platform-modules-accton/as7712-32x/utils/accton_as7712_util.py b/platform/broadcom/sonic-platform-modules-accton/as7712-32x/utils/accton_as7712_util.py index 9741c506b2d1..8ebc39e6c9c1 100755 --- a/platform/broadcom/sonic-platform-modules-accton/as7712-32x/utils/accton_as7712_util.py +++ b/platform/broadcom/sonic-platform-modules-accton/as7712-32x/utils/accton_as7712_util.py @@ -145,11 +145,12 @@ def log_os_system(cmd, show): return status, output def driver_check(): - ret, lsmod = log_os_system("lsmod| grep accton", 0) + ret, lsmod = log_os_system("ls /sys/module/*accton*", 0) logging.info('mods:'+lsmod) - if len(lsmod) ==0: - return False - return True + if ret : + return False + else : + return True diff --git a/platform/broadcom/sonic-platform-modules-accton/as7716-32x/utils/accton_as7716_util.py b/platform/broadcom/sonic-platform-modules-accton/as7716-32x/utils/accton_as7716_util.py index 7be4a00b0478..142ce754a5c7 100755 --- a/platform/broadcom/sonic-platform-modules-accton/as7716-32x/utils/accton_as7716_util.py +++ b/platform/broadcom/sonic-platform-modules-accton/as7716-32x/utils/accton_as7716_util.py @@ -267,10 +267,12 @@ def log_os_system(cmd, show): return status, output def driver_inserted(): - ret, lsmod = log_os_system("lsmod| grep accton", 0) + ret, lsmod = log_os_system("ls /sys/module/*accton*", 0) logging.info('mods:'+lsmod) - if len(lsmod) ==0: + if ret : return False + else : + return True #'modprobe cpr_4011_4mxx', diff --git a/platform/broadcom/sonic-platform-modules-accton/as7716-32xb/utils/accton_as7716_32xb_util.py b/platform/broadcom/sonic-platform-modules-accton/as7716-32xb/utils/accton_as7716_32xb_util.py index 0f1f0d66fddb..3a31d253f633 100755 --- a/platform/broadcom/sonic-platform-modules-accton/as7716-32xb/utils/accton_as7716_32xb_util.py +++ b/platform/broadcom/sonic-platform-modules-accton/as7716-32xb/utils/accton_as7716_32xb_util.py @@ -240,10 +240,12 @@ def log_os_system(cmd, show): return status, output def driver_inserted(): - ret, lsmod = log_os_system("lsmod| grep accton", 0) + ret, lsmod = log_os_system("ls /sys/module/*accton*", 0) logging.info('mods:'+lsmod) - if len(lsmod) ==0: + if ret : return False + else : + return True kos = [ diff --git a/platform/broadcom/sonic-platform-modules-accton/as7726-32x/modules/accton_as7726_32x_cpld.c b/platform/broadcom/sonic-platform-modules-accton/as7726-32x/modules/accton_as7726_32x_cpld.c index 9ffc3353839c..6ca5b1c1296a 100755 --- a/platform/broadcom/sonic-platform-modules-accton/as7726-32x/modules/accton_as7726_32x_cpld.c +++ b/platform/broadcom/sonic-platform-modules-accton/as7726-32x/modules/accton_as7726_32x_cpld.c @@ -498,6 +498,10 @@ static ssize_t show_status(struct device *dev, struct device_attribute *da, if (attr->index >= MODULE_PRESENT_1 && attr->index <= MODULE_PRESENT_34) { revert = 1; } + if (attr->index >= MODULE_RESET_1 && attr->index <= MODULE_RESET_32) { + revert = 1; + } + mutex_lock(&data->update_lock); status = as7726_32x_cpld_read_internal(client, reg); diff --git a/platform/broadcom/sonic-platform-modules-accton/as7726-32x/sonic_platform_setup.py b/platform/broadcom/sonic-platform-modules-accton/as7726-32x/sonic_platform_setup.py new file mode 100644 index 000000000000..96e64460d56c --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as7726-32x/sonic_platform_setup.py @@ -0,0 +1,34 @@ +from setuptools import setup + +DEVICE_NAME = 'accton' +HW_SKU = 'x86_64-accton_as7726_32x-r0' + +setup( + name='sonic-platform', + version='1.0', + description='SONiC platform API implementation on Accton Platforms', + license='Apache 2.0', + author='SONiC Team', + author_email='linuxnetdev@microsoft.com', + url='https://github.com/Azure/sonic-buildimage', + maintainer='Jostar Yang', + maintainer_email='jostar_yang@edge-core.com', + packages=[ + 'sonic_platform', + ], + package_dir={ + 'sonic_platform': '../../../../device/{}/{}/sonic_platform'.format(DEVICE_NAME, HW_SKU)}, + classifiers=[ + 'Development Status :: 3 - Alpha', + 'Environment :: Plugins', + 'Intended Audience :: Developers', + 'Intended Audience :: Information Technology', + 'Intended Audience :: System Administrators', + 'License :: OSI Approved :: Apache Software License', + 'Natural Language :: English', + 'Operating System :: POSIX :: Linux', + 'Programming Language :: Python :: 3.7', + 'Topic :: Utilities', + ], + keywords='sonic SONiC platform PLATFORM', +) diff --git a/platform/broadcom/sonic-platform-modules-accton/as7726-32x/utils/accton_as7726_32x_util.py b/platform/broadcom/sonic-platform-modules-accton/as7726-32x/utils/accton_as7726_32x_util.py index 590add7e925f..9518e0ba64ed 100755 --- a/platform/broadcom/sonic-platform-modules-accton/as7726-32x/utils/accton_as7726_32x_util.py +++ b/platform/broadcom/sonic-platform-modules-accton/as7726-32x/utils/accton_as7726_32x_util.py @@ -25,9 +25,6 @@ command: install : install drivers and generate related sysfs nodes clean : uninstall drivers and remove related sysfs nodes - show : show all systen status - sff : dump SFP eeprom - set : change board setting with fan|led|sfp """ import commands @@ -36,6 +33,7 @@ import logging import re import time +import os PROJECT_NAME = 'as7726_32x' version = '0.0.1' @@ -165,6 +163,10 @@ def main(): do_install() elif arg == 'clean': do_uninstall() + elif arg == 'api': + do_sonic_platform_install() + elif arg == 'api_clean': + do_sonic_platform_clean() elif arg == 'show': device_traversal() elif arg == 'sff': @@ -248,10 +250,12 @@ def log_os_system(cmd, show): return status, output def driver_inserted(): - ret, lsmod = log_os_system("lsmod| grep accton", 0) + ret, lsmod = log_os_system("ls /sys/module/*accton*", 0) logging.info('mods:'+lsmod) - if len(lsmod) ==0: + if ret : return False + else : + return True def cpld_reset_mac(): ret, lsmod = log_os_system("i2cset -y 0 0x77 0x1", 0) @@ -369,6 +373,43 @@ def system_ready(): return False return True +PLATFORM_ROOT_PATH = '/usr/share/sonic/device' +PLATFORM_API2_WHL_FILE_PY3 ='sonic_platform-1.0-py3-none-any.whl' +def do_sonic_platform_install(): + device_path = "{}{}{}{}".format(PLATFORM_ROOT_PATH, '/x86_64-accton_', PROJECT_NAME, '-r0') + SONIC_PLATFORM_BSP_WHL_PKG_PY3 = "/".join([device_path, PLATFORM_API2_WHL_FILE_PY3]) + + #Check API2.0 on py whl file + status, output = log_os_system("pip3 show sonic-platform > /dev/null 2>&1", 0) + if status: + if os.path.exists(SONIC_PLATFORM_BSP_WHL_PKG_PY3): + status, output = log_os_system("pip3 install "+ SONIC_PLATFORM_BSP_WHL_PKG_PY3, 1) + if status: + print "Error: Failed to install {}".format(PLATFORM_API2_WHL_FILE_PY3) + return status + else: + print "Successfully installed {} package".format(PLATFORM_API2_WHL_FILE_PY3) + else: + print('{} is not found'.format(PLATFORM_API2_WHL_FILE_PY3)) + else: + print('{} has installed'.format(PLATFORM_API2_WHL_FILE_PY3)) + + return + +def do_sonic_platform_clean(): + status, output = log_os_system("pip3 show sonic-platform > /dev/null 2>&1", 0) + if status: + print('{} does not install, not need to uninstall'.format(PLATFORM_API2_WHL_FILE_PY3)) + + else: + status, output = log_os_system("pip3 uninstall sonic-platform -y", 0) + if status: + print('Error: Failed to uninstall {}'.format(PLATFORM_API2_WHL_FILE_PY3)) + return status + else: + print('{} is uninstalled'.format(PLATFORM_API2_WHL_FILE_PY3)) + + return def do_install(): if driver_inserted() == False: status = driver_install() @@ -387,6 +428,9 @@ def do_install(): return status else: print PROJECT_NAME.upper()+" devices detected...." + + do_sonic_platform_install() + return def do_uninstall(): @@ -408,6 +452,8 @@ def do_uninstall(): if FORCE == 0: return status + do_sonic_platform_clean() + return def devices_info(): diff --git a/platform/broadcom/sonic-platform-modules-accton/as7816-64x/utils/accton_as7816_monitor.py b/platform/broadcom/sonic-platform-modules-accton/as7816-64x/utils/accton_as7816_monitor.py index a8dcba0f77db..217351ad2a3c 100755 --- a/platform/broadcom/sonic-platform-modules-accton/as7816-64x/utils/accton_as7816_monitor.py +++ b/platform/broadcom/sonic-platform-modules-accton/as7816-64x/utils/accton_as7816_monitor.py @@ -54,6 +54,9 @@ class accton_as7816_monitor(object): def __init__(self, log_file, log_level): """Needs a logger and a logger level.""" + + self.thermal = ThermalUtil() + self.fan = FanUtil() # set up logging to file logging.basicConfig( filename=log_file, @@ -83,8 +86,8 @@ def manage_fans(self): 4: [max_duty, 57000, sys.maxsize], } - thermal = ThermalUtil() - fan = FanUtil() + thermal = self.thermal + fan = self.fan for x in range(fan.get_idx_fan_start(), fan.get_num_fans()+1): fan_status = fan.get_fan_status(x) if fan_status is None: diff --git a/platform/broadcom/sonic-platform-modules-accton/as7816-64x/utils/accton_as7816_util.py b/platform/broadcom/sonic-platform-modules-accton/as7816-64x/utils/accton_as7816_util.py index 0dad870c9718..3aae150dad5c 100755 --- a/platform/broadcom/sonic-platform-modules-accton/as7816-64x/utils/accton_as7816_util.py +++ b/platform/broadcom/sonic-platform-modules-accton/as7816-64x/utils/accton_as7816_util.py @@ -167,11 +167,12 @@ def log_os_system(cmd, show): return status, output def driver_check(): - ret, lsmod = log_os_system("lsmod| grep accton", 0) + ret, lsmod = log_os_system("ls /sys/module/*accton*", 0) logging.info('mods:'+lsmod) - if len(lsmod) ==0: - return False - return True + if ret : + return False + else : + return True diff --git a/platform/broadcom/sonic-platform-modules-accton/as9716-32d/utils/accton_as9716_32d_util.py b/platform/broadcom/sonic-platform-modules-accton/as9716-32d/utils/accton_as9716_32d_util.py index 61d19d0ac7fd..898fcaa0f0d3 100755 --- a/platform/broadcom/sonic-platform-modules-accton/as9716-32d/utils/accton_as9716_32d_util.py +++ b/platform/broadcom/sonic-platform-modules-accton/as9716-32d/utils/accton_as9716_32d_util.py @@ -254,10 +254,12 @@ def log_os_system(cmd, show): return status, output def driver_inserted(): - ret, lsmod = log_os_system("lsmod| grep accton", 0) + ret, lsmod = log_os_system("ls /sys/module/*accton*", 0) logging.info('mods:'+lsmod) - if len(lsmod) ==0: + if ret : return False + else : + return True kos = [ diff --git a/platform/broadcom/sonic-platform-modules-accton/as9726-32d/classes/__init__.py b/platform/broadcom/sonic-platform-modules-accton/as9726-32d/classes/__init__.py new file mode 100755 index 000000000000..e69de29bb2d1 diff --git a/platform/broadcom/sonic-platform-modules-accton/as9726-32d/classes/fanutil.py b/platform/broadcom/sonic-platform-modules-accton/as9726-32d/classes/fanutil.py new file mode 100755 index 000000000000..1231b458801e --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as9726-32d/classes/fanutil.py @@ -0,0 +1,216 @@ +#!/usr/bin/env python +# Copyright (c) 2019 Edgecore Networks Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT +# LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS +# FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. +# +# See the Apache Version 2.0 License for specific language governing +# permissions and limitations under the License. +# +# ------------------------------------------------------------------ +# HISTORY: +# mm/dd/yyyy (A.D.) +# 04/06/2021:Michael_Shih craete for as9726_32d +# ------------------------------------------------------------------ + +try: + import logging +except ImportError as e: + raise ImportError('%s - required module not found' % str(e)) + + +class FanUtil(object): + """Platform-specific FanUtil class""" + + FAN_NUM_ON_MAIN_BROAD = 6 + FAN_NUM_1_IDX = 1 + FAN_NUM_2_IDX = 2 + FAN_NUM_3_IDX = 3 + FAN_NUM_4_IDX = 4 + FAN_NUM_5_IDX = 5 + FAN_NUM_6_IDX = 6 + + FAN_NODE_NUM_OF_MAP = 2 + FAN_NODE_FAULT_IDX_OF_MAP = 1 + FAN_NODE_DIR_IDX_OF_MAP = 2 + + BASE_VAL_PATH = '/sys/bus/i2c/devices/14-0066/{0}' + FAN_DUTY_PATH = '/sys/bus/i2c/devices/14-0066/fan_duty_cycle_percentage' + + #logfile = '' + #loglevel = logging.INFO + + """ Dictionary where + key1 = fan id index (integer) starting from 1 + key2 = fan node index (interger) starting from 1 + value = path to fan device file (string) """ + _fan_device_path_mapping = {} + +#fan1_direction +#fan1_fault +#fan1_present + + #(FAN_NUM_2_IDX, FAN_NODE_DUTY_IDX_OF_MAP): 'fan2_duty_cycle_percentage', + _fan_device_node_mapping = { + (FAN_NUM_1_IDX, FAN_NODE_FAULT_IDX_OF_MAP): 'fan1_fault', + (FAN_NUM_1_IDX, FAN_NODE_DIR_IDX_OF_MAP): 'fan1_direction', + + (FAN_NUM_2_IDX, FAN_NODE_FAULT_IDX_OF_MAP): 'fan2_fault', + (FAN_NUM_2_IDX, FAN_NODE_DIR_IDX_OF_MAP): 'fan2_direction', + + (FAN_NUM_3_IDX, FAN_NODE_FAULT_IDX_OF_MAP): 'fan3_fault', + (FAN_NUM_3_IDX, FAN_NODE_DIR_IDX_OF_MAP): 'fan3_direction', + + (FAN_NUM_4_IDX, FAN_NODE_FAULT_IDX_OF_MAP): 'fan4_fault', + (FAN_NUM_4_IDX, FAN_NODE_DIR_IDX_OF_MAP): 'fan4_direction', + + (FAN_NUM_5_IDX, FAN_NODE_FAULT_IDX_OF_MAP): 'fan5_fault', + (FAN_NUM_5_IDX, FAN_NODE_DIR_IDX_OF_MAP): 'fan5_direction', + + (FAN_NUM_6_IDX, FAN_NODE_FAULT_IDX_OF_MAP): 'fan6_fault', + (FAN_NUM_6_IDX, FAN_NODE_DIR_IDX_OF_MAP): 'fan6_direction', + } + + def _get_fan_device_node(self, fan_num, node_num): + return self._fan_device_node_mapping[(fan_num, node_num)] + + def _get_fan_node_val(self, fan_num, node_num): + if fan_num < self.FAN_NUM_1_IDX or fan_num > self.FAN_NUM_ON_MAIN_BROAD: + logging.debug('GET. Parameter error. fan_num:%d', fan_num) + return None + + if node_num < self.FAN_NODE_FAULT_IDX_OF_MAP or node_num > self.FAN_NODE_NUM_OF_MAP: + logging.debug('GET. Parameter error. node_num:%d', node_num) + return None + + device_path = self.get_fan_device_path(fan_num, node_num) + + try: + val_file = open(device_path, 'r') + except IOError as e: + logging.error('GET. unable to open file: %s', str(e)) + return None + + content = val_file.readline().rstrip() + + if content == '': + logging.debug('GET. content is NULL. device_path:%s', device_path) + return None + + try: + val_file.close() + except IOError: + logging.debug('GET. unable to close file. device_path:%s', device_path) + return None + + return int(content) + + def _set_fan_node_val(self, fan_num, node_num, val): + if fan_num < self.FAN_NUM_1_IDX or fan_num > self.FAN_NUM_ON_MAIN_BROAD: + logging.debug('GET. Parameter error. fan_num:%d', fan_num) + return None + + if node_num < self.FAN_NODE_FAULT_IDX_OF_MAP or node_num > self.FAN_NODE_NUM_OF_MAP: + logging.debug('GET. Parameter error. node_num:%d', node_num) + return None + + content = str(val) + if content == '': + logging.debug('GET. content is NULL. device_path:%s', device_path) + return None + + device_path = self.get_fan_device_path(fan_num, node_num) + try: + val_file = open(device_path, 'w') + except IOError as e: + logging.error('GET. unable to open file: %s', str(e)) + return None + + val_file.write(content) + + try: + val_file.close() + except BaseException: + logging.debug('GET. unable to close file. device_path:%s', device_path) + return None + + return True + + def __init__(self): + fan_path = self.BASE_VAL_PATH + + for fan_num in range(self.FAN_NUM_1_IDX, self.FAN_NUM_ON_MAIN_BROAD+1): + for node_num in range(self.FAN_NODE_FAULT_IDX_OF_MAP, self.FAN_NODE_NUM_OF_MAP+1): + self._fan_device_path_mapping[(fan_num, node_num)] = fan_path.format( + self._fan_device_node_mapping[(fan_num, node_num)]) + + def get_num_fans(self): + return self.FAN_NUM_ON_MAIN_BROAD + + def get_idx_fan_start(self): + return self.FAN_NUM_1_IDX + + def get_num_nodes(self): + return self.FAN_NODE_NUM_OF_MAP + + def get_idx_node_start(self): + return self.FAN_NODE_FAULT_IDX_OF_MAP + + def get_size_node_map(self): + return len(self._fan_device_node_mapping) + + def get_size_path_map(self): + return len(self._fan_device_path_mapping) + + def get_fan_device_path(self, fan_num, node_num): + return self._fan_device_path_mapping[(fan_num, node_num)] + + def get_fan_fault(self, fan_num): + return self._get_fan_node_val(fan_num, self.FAN_NODE_FAULT_IDX_OF_MAP) + + def get_fan_dir(self, fan_num): + return self._get_fan_node_val(fan_num, self.FAN_NODE_DIR_IDX_OF_MAP) + + def get_fan_duty_cycle(self): + #duty_path = self.FAN_DUTY_PATH + try: + val_file = open(self.FAN_DUTY_PATH) + except IOError as e: + print "Error: unable to open file: %s" % str(e) + return False + + content = val_file.readline().rstrip() + val_file.close() + + return int(content) + + def set_fan_duty_cycle(self, val): + try: + fan_file = open(self.FAN_DUTY_PATH, 'r+') + except IOError as e: + print "Error: unable to open file: %s" % str(e) + return False + + fan_file.write(str(val)) + fan_file.close() + return True + + def get_fanr_speed(self, fan_num): + return self._get_fan_node_val(fan_num, self.FANR_NODE_SPEED_IDX_OF_MAP) + + def get_fan_status(self, fan_num): + if fan_num < self.FAN_NUM_1_IDX or fan_num > self.FAN_NUM_ON_MAIN_BROAD: + logging.debug('GET. Parameter error. fan_num, %d', fan_num) + return None + + if self.get_fan_fault(fan_num) is not None and self.get_fan_fault(fan_num) > 0: + logging.debug('GET. FAN fault. fan_num, %d', fan_num) + return False + + return True diff --git a/platform/broadcom/sonic-platform-modules-accton/as9726-32d/classes/thermalutil.py b/platform/broadcom/sonic-platform-modules-accton/as9726-32d/classes/thermalutil.py new file mode 100755 index 000000000000..1f00d72b8411 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as9726-32d/classes/thermalutil.py @@ -0,0 +1,89 @@ +#!/usr/bin/env python +# Copyright (c) 2019 Edgecore Networks Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT +# LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS +# FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. +# +# See the Apache Version 2.0 License for specific language governing +# permissions and limitations under the License. +# +# ------------------------------------------------------------------ +# HISTORY: +# mm/dd/yyyy (A.D.) +# 04/06/2021: Michael_Shih craete for as9726_32d +# ------------------------------------------------------------------ + +try: + import logging + import glob +except ImportError as e: + raise ImportError('%s - required module not found' % str(e)) + +class ThermalUtil(object): + """Platform-specific ThermalUtil class""" + THERMAL_NUM_MAX = 7 + THERMAL_NUM_1_IDX = 1 # 1~6 are mainboard thermal sensors + THERMAL_NUM_2_IDX = 2 + THERMAL_NUM_3_IDX = 3 + THERMAL_NUM_4_IDX = 4 + THERMAL_NUM_5_IDX = 5 + THERMAL_NUM_6_IDX = 6 # CPU core + THERMAL_NUM_7_IDX = 7 + + """ Dictionary where + key1 = thermal id index (integer) starting from 1 + value = path to fan device file (string) """ + #_thermal_to_device_path_mapping = {} + + thermal_sysfspath ={ + THERMAL_NUM_1_IDX: ["/sys/bus/i2c/devices/15-0048/hwmon/hwmon*/temp1_input"], + THERMAL_NUM_2_IDX: ["/sys/bus/i2c/devices/15-0049/hwmon/hwmon*/temp1_input"], + THERMAL_NUM_3_IDX: ["/sys/bus/i2c/devices/15-004a/hwmon/hwmon*/temp1_input"], + THERMAL_NUM_4_IDX: ["/sys/bus/i2c/devices/15-004c/hwmon/hwmon*/temp1_input"], + THERMAL_NUM_5_IDX: ["/sys/bus/i2c/devices/15-004f/hwmon/hwmon*/temp1_input"], + THERMAL_NUM_6_IDX: ["/sys/class/hwmon/hwmon0/temp1_input"], + THERMAL_NUM_7_IDX: ["/sys/bus/i2c/devices/15-004b/hwmon/hwmon*/temp1_input"], + } + + #def __init__(self): + + def _get_thermal_val(self, thermal_num): + if thermal_num < self.THERMAL_NUM_1_IDX or thermal_num > self.THERMAL_NUM_MAX: + logging.debug('GET. Parameter error. thermal_num, %d', thermal_num) + return None + + device_path = self.get_thermal_path(thermal_num) + for filename in glob.glob(device_path): + try: + val_file = open(filename, 'r') + except IOError as e: + logging.error('GET. unable to open file: %s', str(e)) + return None + content = val_file.readline().rstrip() + if content == '': + logging.debug('GET. content is NULL. device_path:%s', device_path) + return None + try: + val_file.close() + except BaseException: + logging.debug('GET. unable to close file. device_path:%s', device_path) + return None + + return int(content) + + return 0 + + def get_num_thermals(self): + return self.THERMAL_NUM_MAX + + def get_size_path_map(self): + return len(self.thermal_sysfspath) + + def get_thermal_path(self, thermal_num): + return self.thermal_sysfspath[thermal_num][0] diff --git a/platform/broadcom/sonic-platform-modules-accton/as9726-32d/modules/Makefile b/platform/broadcom/sonic-platform-modules-accton/as9726-32d/modules/Makefile new file mode 100755 index 000000000000..d27e10b6d8de --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as9726-32d/modules/Makefile @@ -0,0 +1,19 @@ +ifneq ($(KERNELRELEASE),) +obj-m:= x86-64-accton-as9726-32d-cpld.o x86-64-accton-as9726-32d-psu.o \ + x86-64-accton-as9726-32d-fan.o ym2651y.o + +else +ifeq (,$(KERNEL_SRC)) +#$(error KERNEL_SRC is not defined) +KVERSION=3.16.0-8-amd64 +KERNEL_DIR = /usr/src/linux-headers-$(KVERSION)/ +KERNELDIR:=$(KERNEL_DIR) +else +KERNELDIR:=$(KERNEL_SRC) +endif +PWD:=$(shell pwd) +default: + $(MAKE) -C $(KERNELDIR) M=$(PWD) modules +clean: + rm -rf *.o *.mod.o *.mod.o *.mod.c *.ko .*cmd .tmp_versions Module.markers Module.symvers modules.order +endif diff --git a/platform/broadcom/sonic-platform-modules-accton/as9726-32d/modules/x86-64-accton-as9726-32d-cpld.c b/platform/broadcom/sonic-platform-modules-accton/as9726-32d/modules/x86-64-accton-as9726-32d-cpld.c new file mode 100755 index 000000000000..096d1384b650 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as9726-32d/modules/x86-64-accton-as9726-32d-cpld.c @@ -0,0 +1,987 @@ +/* + * Copyright (C) Brandon Chuang + * + * This module supports the accton cpld that hold the channel select + * mechanism for other i2c slave devices, such as SFP. + * This includes the: + * Accton as9726_32d CPU-CPLD/CPLD2/CPLD3 + * + * Based on: + * pca954x.c from Kumar Gala + * Copyright (C) 2006 + * + * Based on: + * pca954x.c from Ken Harrenstien + * Copyright (C) 2004 Google, Inc. (Ken Harrenstien) + * + * Based on: + * i2c-virtual_cb.c from Brian Kuschak + * and + * pca9540.c from Jean Delvare . + * + * This file is licensed under the terms of the GNU General Public + * License version 2. This program is licensed "as is" without any + * warranty of any kind, whether express or implied. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define I2C_RW_RETRY_COUNT 10 +#define I2C_RW_RETRY_INTERVAL 60 /* ms */ + +static LIST_HEAD(cpld_client_list); +static struct mutex list_lock; + +struct cpld_client_node { + struct i2c_client *client; + struct list_head list; +}; + +enum cpld_type { + as9726_32d_fpga, + as9726_32d_cpld2, + as9726_32d_cpld3, + as9726_32d_cpld_cpu +}; + +struct as9726_32d_cpld_data { + enum cpld_type type; + struct device *hwmon_dev; + struct mutex update_lock; +}; + +static const struct i2c_device_id as9726_32d_cpld_id[] = { + { "as9726_32d_fpga", as9726_32d_fpga }, + { "as9726_32d_cpld2", as9726_32d_cpld2 }, + { "as9726_32d_cpld3", as9726_32d_cpld3 }, + { "as9726_32d_cpld_cpu", as9726_32d_cpld_cpu }, + { } +}; +MODULE_DEVICE_TABLE(i2c, as9726_32d_cpld_id); + +#define TRANSCEIVER_PRESENT_ATTR_ID(index) MODULE_PRESENT_##index +#define TRANSCEIVER_TXDISABLE_ATTR_ID(index) MODULE_TXDISABLE_##index +#define TRANSCEIVER_RXLOS_ATTR_ID(index) MODULE_RXLOS_##index +#define TRANSCEIVER_TXFAULT_ATTR_ID(index) MODULE_TXFAULT_##index +#define TRANSCEIVER_RESET_ATTR_ID(index) MODULE_RESET_##index +#define CPLD_INTR_ATTR_ID(index) CPLD_INTR_##index + +enum as9726_32d_cpld_sysfs_attributes { + CPLD_VERSION, + ACCESS, + /* transceiver attributes */ + TRANSCEIVER_PRESENT_ATTR_ID(1), + TRANSCEIVER_PRESENT_ATTR_ID(2), + TRANSCEIVER_PRESENT_ATTR_ID(3), + TRANSCEIVER_PRESENT_ATTR_ID(4), + TRANSCEIVER_PRESENT_ATTR_ID(5), + TRANSCEIVER_PRESENT_ATTR_ID(6), + TRANSCEIVER_PRESENT_ATTR_ID(7), + TRANSCEIVER_PRESENT_ATTR_ID(8), + TRANSCEIVER_PRESENT_ATTR_ID(9), + TRANSCEIVER_PRESENT_ATTR_ID(10), + TRANSCEIVER_PRESENT_ATTR_ID(11), + TRANSCEIVER_PRESENT_ATTR_ID(12), + TRANSCEIVER_PRESENT_ATTR_ID(13), + TRANSCEIVER_PRESENT_ATTR_ID(14), + TRANSCEIVER_PRESENT_ATTR_ID(15), + TRANSCEIVER_PRESENT_ATTR_ID(16), + TRANSCEIVER_PRESENT_ATTR_ID(17), + TRANSCEIVER_PRESENT_ATTR_ID(18), + TRANSCEIVER_PRESENT_ATTR_ID(19), + TRANSCEIVER_PRESENT_ATTR_ID(20), + TRANSCEIVER_PRESENT_ATTR_ID(21), + TRANSCEIVER_PRESENT_ATTR_ID(22), + TRANSCEIVER_PRESENT_ATTR_ID(23), + TRANSCEIVER_PRESENT_ATTR_ID(24), + TRANSCEIVER_PRESENT_ATTR_ID(25), + TRANSCEIVER_PRESENT_ATTR_ID(26), + TRANSCEIVER_PRESENT_ATTR_ID(27), + TRANSCEIVER_PRESENT_ATTR_ID(28), + TRANSCEIVER_PRESENT_ATTR_ID(29), + TRANSCEIVER_PRESENT_ATTR_ID(30), + TRANSCEIVER_PRESENT_ATTR_ID(31), + TRANSCEIVER_PRESENT_ATTR_ID(32), + TRANSCEIVER_PRESENT_ATTR_ID(33), + TRANSCEIVER_PRESENT_ATTR_ID(34), + TRANSCEIVER_TXDISABLE_ATTR_ID(33), + TRANSCEIVER_TXDISABLE_ATTR_ID(34), + TRANSCEIVER_RXLOS_ATTR_ID(33), + TRANSCEIVER_RXLOS_ATTR_ID(34), + TRANSCEIVER_TXFAULT_ATTR_ID(33), + TRANSCEIVER_TXFAULT_ATTR_ID(34), + TRANSCEIVER_RESET_ATTR_ID(1), + TRANSCEIVER_RESET_ATTR_ID(2), + TRANSCEIVER_RESET_ATTR_ID(3), + TRANSCEIVER_RESET_ATTR_ID(4), + TRANSCEIVER_RESET_ATTR_ID(5), + TRANSCEIVER_RESET_ATTR_ID(6), + TRANSCEIVER_RESET_ATTR_ID(7), + TRANSCEIVER_RESET_ATTR_ID(8), + TRANSCEIVER_RESET_ATTR_ID(9), + TRANSCEIVER_RESET_ATTR_ID(10), + TRANSCEIVER_RESET_ATTR_ID(11), + TRANSCEIVER_RESET_ATTR_ID(12), + TRANSCEIVER_RESET_ATTR_ID(13), + TRANSCEIVER_RESET_ATTR_ID(14), + TRANSCEIVER_RESET_ATTR_ID(15), + TRANSCEIVER_RESET_ATTR_ID(16), + TRANSCEIVER_RESET_ATTR_ID(17), + TRANSCEIVER_RESET_ATTR_ID(18), + TRANSCEIVER_RESET_ATTR_ID(19), + TRANSCEIVER_RESET_ATTR_ID(20), + TRANSCEIVER_RESET_ATTR_ID(21), + TRANSCEIVER_RESET_ATTR_ID(22), + TRANSCEIVER_RESET_ATTR_ID(23), + TRANSCEIVER_RESET_ATTR_ID(24), + TRANSCEIVER_RESET_ATTR_ID(25), + TRANSCEIVER_RESET_ATTR_ID(26), + TRANSCEIVER_RESET_ATTR_ID(27), + TRANSCEIVER_RESET_ATTR_ID(28), + TRANSCEIVER_RESET_ATTR_ID(29), + TRANSCEIVER_RESET_ATTR_ID(30), + TRANSCEIVER_RESET_ATTR_ID(31), + TRANSCEIVER_RESET_ATTR_ID(32), + CPLD_INTR_ATTR_ID(1), + CPLD_INTR_ATTR_ID(2), + CPLD_INTR_ATTR_ID(3), + CPLD_INTR_ATTR_ID(4), + +}; + +/* sysfs attributes for hwmon + */ +static ssize_t show_interrupt(struct device *dev, struct device_attribute *da, + char *buf); +static ssize_t show_status(struct device *dev, struct device_attribute *da, + char *buf); +static ssize_t set_tx_disable(struct device *dev, struct device_attribute *da, + const char *buf, size_t count); +static ssize_t access(struct device *dev, struct device_attribute *da, + const char *buf, size_t count); +static ssize_t show_version(struct device *dev, struct device_attribute *da, + char *buf); +static ssize_t get_mode_reset(struct device *dev, struct device_attribute *da, + char *buf); +static ssize_t set_mode_reset(struct device *dev, struct device_attribute *da, + const char *buf, size_t count); +static int as9726_32d_cpld_read_internal(struct i2c_client *client, u8 reg); +static int as9726_32d_cpld_write_internal(struct i2c_client *client, u8 reg, u8 value); + +/* transceiver attributes */ +#define DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(index) \ + static SENSOR_DEVICE_ATTR(module_present_##index, S_IRUGO, show_status, NULL, MODULE_PRESENT_##index) +#define DECLARE_TRANSCEIVER_PRESENT_ATTR(index) &sensor_dev_attr_module_present_##index.dev_attr.attr + +#define DECLARE_SFP_TRANSCEIVER_SENSOR_DEVICE_ATTR(index) \ + static SENSOR_DEVICE_ATTR(module_tx_disable_##index, S_IRUGO | S_IWUSR, show_status, set_tx_disable, MODULE_TXDISABLE_##index); \ + static SENSOR_DEVICE_ATTR(module_rx_los_##index, S_IRUGO, show_status, NULL, MODULE_RXLOS_##index); \ + static SENSOR_DEVICE_ATTR(module_tx_fault_##index, S_IRUGO, show_status, NULL, MODULE_RXLOS_##index); + +#define DECLARE_SFP_TRANSCEIVER_ATTR(index) \ + &sensor_dev_attr_module_tx_disable_##index.dev_attr.attr, \ + &sensor_dev_attr_module_rx_los_##index.dev_attr.attr, \ + &sensor_dev_attr_module_tx_fault_##index.dev_attr.attr + +/*reset*/ +#define DECLARE_TRANSCEIVER_SENSOR_DEVICE_RESET_ATTR(index) \ + static SENSOR_DEVICE_ATTR(module_reset_##index, S_IWUSR | S_IRUGO, get_mode_reset, set_mode_reset, MODULE_RESET_##index) +#define DECLARE_TRANSCEIVER_RESET_ATTR(index) &sensor_dev_attr_module_reset_##index.dev_attr.attr + +/*cpld interrupt*/ +#define DECLARE_CPLD_DEVICE_INTR_ATTR(index) \ + static SENSOR_DEVICE_ATTR(cpld_intr_##index, S_IRUGO, show_interrupt, NULL, CPLD_INTR_##index) +#define DECLARE_CPLD_INTR_ATTR(index) &sensor_dev_attr_cpld_intr_##index.dev_attr.attr + + + +static SENSOR_DEVICE_ATTR(version, S_IRUGO, show_version, NULL, CPLD_VERSION); +static SENSOR_DEVICE_ATTR(access, S_IWUSR, NULL, access, ACCESS); +/* transceiver attributes */ +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(1); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(2); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(3); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(4); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(5); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(6); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(7); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(8); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(9); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(10); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(11); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(12); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(13); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(14); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(15); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(16); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(17); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(18); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(19); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(20); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(21); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(22); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(23); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(24); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(25); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(26); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(27); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(28); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(29); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(30); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(31); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(32); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(33); +DECLARE_TRANSCEIVER_PRESENT_SENSOR_DEVICE_ATTR(34); +DECLARE_SFP_TRANSCEIVER_SENSOR_DEVICE_ATTR(33); +DECLARE_SFP_TRANSCEIVER_SENSOR_DEVICE_ATTR(34); +DECLARE_TRANSCEIVER_SENSOR_DEVICE_RESET_ATTR(1); +DECLARE_TRANSCEIVER_SENSOR_DEVICE_RESET_ATTR(2); +DECLARE_TRANSCEIVER_SENSOR_DEVICE_RESET_ATTR(3); +DECLARE_TRANSCEIVER_SENSOR_DEVICE_RESET_ATTR(4); +DECLARE_TRANSCEIVER_SENSOR_DEVICE_RESET_ATTR(5); +DECLARE_TRANSCEIVER_SENSOR_DEVICE_RESET_ATTR(6); +DECLARE_TRANSCEIVER_SENSOR_DEVICE_RESET_ATTR(7); +DECLARE_TRANSCEIVER_SENSOR_DEVICE_RESET_ATTR(8); +DECLARE_TRANSCEIVER_SENSOR_DEVICE_RESET_ATTR(9); +DECLARE_TRANSCEIVER_SENSOR_DEVICE_RESET_ATTR(10); +DECLARE_TRANSCEIVER_SENSOR_DEVICE_RESET_ATTR(11); +DECLARE_TRANSCEIVER_SENSOR_DEVICE_RESET_ATTR(12); +DECLARE_TRANSCEIVER_SENSOR_DEVICE_RESET_ATTR(13); +DECLARE_TRANSCEIVER_SENSOR_DEVICE_RESET_ATTR(14); +DECLARE_TRANSCEIVER_SENSOR_DEVICE_RESET_ATTR(15); +DECLARE_TRANSCEIVER_SENSOR_DEVICE_RESET_ATTR(16); +DECLARE_TRANSCEIVER_SENSOR_DEVICE_RESET_ATTR(17); +DECLARE_TRANSCEIVER_SENSOR_DEVICE_RESET_ATTR(18); +DECLARE_TRANSCEIVER_SENSOR_DEVICE_RESET_ATTR(19); +DECLARE_TRANSCEIVER_SENSOR_DEVICE_RESET_ATTR(20); +DECLARE_TRANSCEIVER_SENSOR_DEVICE_RESET_ATTR(21); +DECLARE_TRANSCEIVER_SENSOR_DEVICE_RESET_ATTR(22); +DECLARE_TRANSCEIVER_SENSOR_DEVICE_RESET_ATTR(23); +DECLARE_TRANSCEIVER_SENSOR_DEVICE_RESET_ATTR(24); +DECLARE_TRANSCEIVER_SENSOR_DEVICE_RESET_ATTR(25); +DECLARE_TRANSCEIVER_SENSOR_DEVICE_RESET_ATTR(26); +DECLARE_TRANSCEIVER_SENSOR_DEVICE_RESET_ATTR(27); +DECLARE_TRANSCEIVER_SENSOR_DEVICE_RESET_ATTR(28); +DECLARE_TRANSCEIVER_SENSOR_DEVICE_RESET_ATTR(29); +DECLARE_TRANSCEIVER_SENSOR_DEVICE_RESET_ATTR(30); +DECLARE_TRANSCEIVER_SENSOR_DEVICE_RESET_ATTR(31); +DECLARE_TRANSCEIVER_SENSOR_DEVICE_RESET_ATTR(32); +DECLARE_CPLD_DEVICE_INTR_ATTR(1); +DECLARE_CPLD_DEVICE_INTR_ATTR(2); +DECLARE_CPLD_DEVICE_INTR_ATTR(3); +DECLARE_CPLD_DEVICE_INTR_ATTR(4); + + + +static struct attribute *as9726_32d_fpga_attributes[] = { + &sensor_dev_attr_version.dev_attr.attr, + &sensor_dev_attr_access.dev_attr.attr, + NULL +}; + +static const struct attribute_group as9726_32d_fpga_group = { + .attrs = as9726_32d_fpga_attributes, +}; + +static struct attribute *as9726_32d_cpld2_attributes[] = { + &sensor_dev_attr_version.dev_attr.attr, + &sensor_dev_attr_access.dev_attr.attr, + DECLARE_TRANSCEIVER_PRESENT_ATTR(1), + DECLARE_TRANSCEIVER_PRESENT_ATTR(2), + DECLARE_TRANSCEIVER_PRESENT_ATTR(3), + DECLARE_TRANSCEIVER_PRESENT_ATTR(4), + DECLARE_TRANSCEIVER_PRESENT_ATTR(5), + DECLARE_TRANSCEIVER_PRESENT_ATTR(6), + DECLARE_TRANSCEIVER_PRESENT_ATTR(7), + DECLARE_TRANSCEIVER_PRESENT_ATTR(8), + DECLARE_TRANSCEIVER_PRESENT_ATTR(9), + DECLARE_TRANSCEIVER_PRESENT_ATTR(10), + DECLARE_TRANSCEIVER_PRESENT_ATTR(11), + DECLARE_TRANSCEIVER_PRESENT_ATTR(12), + DECLARE_TRANSCEIVER_PRESENT_ATTR(13), + DECLARE_TRANSCEIVER_PRESENT_ATTR(14), + DECLARE_TRANSCEIVER_PRESENT_ATTR(15), + DECLARE_TRANSCEIVER_PRESENT_ATTR(16), + DECLARE_TRANSCEIVER_RESET_ATTR(1), + DECLARE_TRANSCEIVER_RESET_ATTR(2), + DECLARE_TRANSCEIVER_RESET_ATTR(3), + DECLARE_TRANSCEIVER_RESET_ATTR(4), + DECLARE_TRANSCEIVER_RESET_ATTR(5), + DECLARE_TRANSCEIVER_RESET_ATTR(6), + DECLARE_TRANSCEIVER_RESET_ATTR(7), + DECLARE_TRANSCEIVER_RESET_ATTR(8), + DECLARE_TRANSCEIVER_RESET_ATTR(9), + DECLARE_TRANSCEIVER_RESET_ATTR(10), + DECLARE_TRANSCEIVER_RESET_ATTR(11), + DECLARE_TRANSCEIVER_RESET_ATTR(12), + DECLARE_TRANSCEIVER_RESET_ATTR(13), + DECLARE_TRANSCEIVER_RESET_ATTR(14), + DECLARE_TRANSCEIVER_RESET_ATTR(15), + DECLARE_TRANSCEIVER_RESET_ATTR(16), + DECLARE_CPLD_INTR_ATTR(1), + DECLARE_CPLD_INTR_ATTR(2), + NULL +}; + +static const struct attribute_group as9726_32d_cpld2_group = { + .attrs = as9726_32d_cpld2_attributes, +}; + +static struct attribute *as9726_32d_cpld3_attributes[] = { + &sensor_dev_attr_version.dev_attr.attr, + &sensor_dev_attr_access.dev_attr.attr, + DECLARE_TRANSCEIVER_PRESENT_ATTR(17), + DECLARE_TRANSCEIVER_PRESENT_ATTR(18), + DECLARE_TRANSCEIVER_PRESENT_ATTR(19), + DECLARE_TRANSCEIVER_PRESENT_ATTR(20), + DECLARE_TRANSCEIVER_PRESENT_ATTR(21), + DECLARE_TRANSCEIVER_PRESENT_ATTR(22), + DECLARE_TRANSCEIVER_PRESENT_ATTR(23), + DECLARE_TRANSCEIVER_PRESENT_ATTR(24), + DECLARE_TRANSCEIVER_PRESENT_ATTR(25), + DECLARE_TRANSCEIVER_PRESENT_ATTR(26), + DECLARE_TRANSCEIVER_PRESENT_ATTR(27), + DECLARE_TRANSCEIVER_PRESENT_ATTR(28), + DECLARE_TRANSCEIVER_PRESENT_ATTR(29), + DECLARE_TRANSCEIVER_PRESENT_ATTR(30), + DECLARE_TRANSCEIVER_PRESENT_ATTR(31), + DECLARE_TRANSCEIVER_PRESENT_ATTR(32), + DECLARE_TRANSCEIVER_PRESENT_ATTR(33), + DECLARE_TRANSCEIVER_PRESENT_ATTR(34), + DECLARE_SFP_TRANSCEIVER_ATTR(33), + DECLARE_SFP_TRANSCEIVER_ATTR(34), + DECLARE_TRANSCEIVER_RESET_ATTR(17), + DECLARE_TRANSCEIVER_RESET_ATTR(18), + DECLARE_TRANSCEIVER_RESET_ATTR(19), + DECLARE_TRANSCEIVER_RESET_ATTR(20), + DECLARE_TRANSCEIVER_RESET_ATTR(21), + DECLARE_TRANSCEIVER_RESET_ATTR(22), + DECLARE_TRANSCEIVER_RESET_ATTR(23), + DECLARE_TRANSCEIVER_RESET_ATTR(24), + DECLARE_TRANSCEIVER_RESET_ATTR(25), + DECLARE_TRANSCEIVER_RESET_ATTR(26), + DECLARE_TRANSCEIVER_RESET_ATTR(27), + DECLARE_TRANSCEIVER_RESET_ATTR(28), + DECLARE_TRANSCEIVER_RESET_ATTR(29), + DECLARE_TRANSCEIVER_RESET_ATTR(30), + DECLARE_TRANSCEIVER_RESET_ATTR(31), + DECLARE_TRANSCEIVER_RESET_ATTR(32), + DECLARE_CPLD_INTR_ATTR(3), + DECLARE_CPLD_INTR_ATTR(4), + NULL +}; + +static const struct attribute_group as9726_32d_cpld3_group = { + .attrs = as9726_32d_cpld3_attributes, +}; + +static struct attribute *as9726_32d_cpld_cpu_attributes[] = { + &sensor_dev_attr_version.dev_attr.attr, + NULL +}; + +static const struct attribute_group as9726_32d_cpld_cpu_group = { + .attrs = as9726_32d_cpld_cpu_attributes, +}; + +static ssize_t show_interrupt(struct device *dev, struct device_attribute *da, + char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + struct i2c_client *client = to_i2c_client(dev); + struct as9726_32d_cpld_data *data = i2c_get_clientdata(client); + int status = 0; + u8 reg = 0; + + switch (attr->index) + { + case CPLD_INTR_1: + reg = 0x10; + break; + case CPLD_INTR_3: + reg = 0x10; + break; + case CPLD_INTR_2: + reg = 0x11; + break; + case CPLD_INTR_4: + reg = 0x11; + break; + default: + return -ENODEV; + } + mutex_lock(&data->update_lock); + status = as9726_32d_cpld_read_internal(client, reg); + if (unlikely(status < 0)) { + goto exit; + } + mutex_unlock(&data->update_lock); + + return sprintf(buf, "0x%x\n", status); + +exit: + mutex_unlock(&data->update_lock); + return status; +} + + +static ssize_t show_status(struct device *dev, struct device_attribute *da, + char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + struct i2c_client *client = to_i2c_client(dev); + struct as9726_32d_cpld_data *data = i2c_get_clientdata(client); + int status = 0; + u8 reg = 0, mask = 0, revert = 0; + + switch (attr->index) { + case MODULE_PRESENT_1 ... MODULE_PRESENT_8: + reg = 0x12; + mask = 0x1 << (attr->index - MODULE_PRESENT_1); + break; + case MODULE_PRESENT_9 ... MODULE_PRESENT_16: + reg = 0x13; + mask = 0x1 << (attr->index - MODULE_PRESENT_9); + break; + case MODULE_PRESENT_17 ... MODULE_PRESENT_24: + reg = 0x12; + mask = 0x1 << (attr->index - MODULE_PRESENT_17); + break; + case MODULE_PRESENT_25 ... MODULE_PRESENT_32: + reg = 0x13; + mask = 0x1 << (attr->index - MODULE_PRESENT_25); + break; + case MODULE_PRESENT_33: + reg = 0x20; + mask = 0x1; + break; + case MODULE_PRESENT_34: + reg = 0x20; + mask = 0x2; + break; + case MODULE_RXLOS_33: + reg = 0x26; + mask = 0x1; + break; + case MODULE_RXLOS_34: + reg = 0x26; + mask = 0x2; + break; + case MODULE_TXDISABLE_33: + reg = 0x21; + mask = 0x1; + break; + case MODULE_TXDISABLE_34: + reg = 0x21; + mask = 0x2; + break; + + default: + return 0; + } + + if (attr->index >= MODULE_PRESENT_1 && attr->index <= MODULE_PRESENT_34) { + revert = 1; + } + + mutex_lock(&data->update_lock); + status = as9726_32d_cpld_read_internal(client, reg); + if (unlikely(status < 0)) { + goto exit; + } + mutex_unlock(&data->update_lock); + + return sprintf(buf, "%d\n", revert ? !(status & mask) : !!(status & mask)); + +exit: + mutex_unlock(&data->update_lock); + return status; +} + +static ssize_t set_tx_disable(struct device *dev, struct device_attribute *da, + const char *buf, size_t count) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + struct i2c_client *client = to_i2c_client(dev); + struct as9726_32d_cpld_data *data = i2c_get_clientdata(client); + long disable; + int status; + u8 reg = 0, mask = 0; + + status = kstrtol(buf, 10, &disable); + if (status) { + return status; + } + + switch (attr->index) { + case MODULE_TXDISABLE_33: + reg = 0x21; + mask = 0x1; + break; + case MODULE_TXDISABLE_34: + reg = 0x21; + mask = 0x2; + break; + default: + return 0; + } + + /* Read current status */ + mutex_lock(&data->update_lock); + status = as9726_32d_cpld_read_internal(client, reg); + if (unlikely(status < 0)) { + goto exit; + } + + /* Update tx_disable status */ + if (disable) { + status |= mask; + } + else { + status &= ~mask; + } + + status = as9726_32d_cpld_write_internal(client, reg, status); + if (unlikely(status < 0)) { + goto exit; + } + + mutex_unlock(&data->update_lock); + return count; + +exit: + mutex_unlock(&data->update_lock); + return status; +} + +static ssize_t access(struct device *dev, struct device_attribute *da, + const char *buf, size_t count) +{ + int status; + u32 addr, val; + struct i2c_client *client = to_i2c_client(dev); + struct as9726_32d_cpld_data *data = i2c_get_clientdata(client); + + if (sscanf(buf, "0x%x 0x%x", &addr, &val) != 2) { + return -EINVAL; + } + + if (addr > 0xFF || val > 0xFF) { + return -EINVAL; + } + + mutex_lock(&data->update_lock); + status = as9726_32d_cpld_write_internal(client, addr, val); + if (unlikely(status < 0)) { + goto exit; + } + mutex_unlock(&data->update_lock); + return count; + +exit: + mutex_unlock(&data->update_lock); + return status; +} + +static void as9726_32d_cpld_add_client(struct i2c_client *client) +{ + struct cpld_client_node *node = kzalloc(sizeof(struct cpld_client_node), GFP_KERNEL); + + if (!node) { + dev_dbg(&client->dev, "Can't allocate cpld_client_node (0x%x)\n", client->addr); + return; + } + + node->client = client; + + mutex_lock(&list_lock); + list_add(&node->list, &cpld_client_list); + mutex_unlock(&list_lock); +} + +static void as9726_32d_cpld_remove_client(struct i2c_client *client) +{ + struct list_head *list_node = NULL; + struct cpld_client_node *cpld_node = NULL; + int found = 0; + + mutex_lock(&list_lock); + + list_for_each(list_node, &cpld_client_list) + { + cpld_node = list_entry(list_node, struct cpld_client_node, list); + + if (cpld_node->client == client) { + found = 1; + break; + } + } + + if (found) { + list_del(list_node); + kfree(cpld_node); + } + + mutex_unlock(&list_lock); +} + +static ssize_t show_version(struct device *dev, struct device_attribute *attr, char *buf) +{ + int val = 0; + struct i2c_client *client = to_i2c_client(dev); + + val = i2c_smbus_read_byte_data(client, 0x1); + + if (val < 0) { + dev_dbg(&client->dev, "cpld(0x%x) reg(0x1) err %d\n", client->addr, val); + } + + return sprintf(buf, "0x%x\n", val); +} + +static ssize_t get_mode_reset(struct device *dev, struct device_attribute *da, + char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + struct i2c_client *client = to_i2c_client(dev); + struct as9726_32d_cpld_data *data = i2c_get_clientdata(client); + int status = 0; + u8 reg = 0, mask = 0; + + switch (attr->index) { + case MODULE_RESET_1 ... MODULE_RESET_8: + reg = 0x14; + mask = 0x1 << (attr->index - MODULE_RESET_1); + break; + case MODULE_RESET_9 ... MODULE_RESET_16: + reg = 0x15; + mask = 0x1 << (attr->index - MODULE_RESET_9); + break; + case MODULE_RESET_17 ... MODULE_RESET_24: + reg = 0x14; + mask = 0x1 << (attr->index - MODULE_RESET_17); + break; + case MODULE_RESET_25 ... MODULE_RESET_32: + reg = 0x15; + mask = 0x1 << (attr->index - MODULE_RESET_25); + break; + default: + return 0; + } + + + mutex_lock(&data->update_lock); + status = as9726_32d_cpld_read_internal(client, reg); + + if (unlikely(status < 0)) { + goto exit; + } + mutex_unlock(&data->update_lock); + + return sprintf(buf, "%d\r\n", !(status & mask)); + +exit: + mutex_unlock(&data->update_lock); + return status; +} + +static ssize_t set_mode_reset(struct device *dev, struct device_attribute *da, + const char *buf, size_t count) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + struct i2c_client *client = to_i2c_client(dev); + struct as9726_32d_cpld_data *data = i2c_get_clientdata(client); + long reset; + int status=0, val, error; + u8 reg = 0, mask = 0; + + + error = kstrtol(buf, 10, &reset); + if (error) { + return error; + } + + switch (attr->index) { + case MODULE_RESET_1 ... MODULE_RESET_8: + reg = 0x14; + mask = 0x1 << (attr->index - MODULE_RESET_1); + break; + case MODULE_RESET_9 ... MODULE_RESET_16: + reg = 0x15; + mask = 0x1 << (attr->index - MODULE_RESET_9); + break; + case MODULE_RESET_17 ... MODULE_RESET_24: + reg = 0x14; + mask = 0x1 << (attr->index - MODULE_RESET_17); + break; + case MODULE_RESET_25 ... MODULE_RESET_32: + reg = 0x15; + mask = 0x1 << (attr->index - MODULE_RESET_25); + break; + default: + return 0; + } + mutex_lock(&data->update_lock); + + status = as9726_32d_cpld_read_internal(client, reg); + if (unlikely(status < 0)) { + goto exit; + } + + /* Update lp_mode status */ + if (reset) + { + val = status&(~mask); + } + else + { + val =status | (mask); + } + + status = as9726_32d_cpld_write_internal(client, reg, val); + if (unlikely(status < 0)) { + goto exit; + } + mutex_unlock(&data->update_lock); + return count; + +exit: + mutex_unlock(&data->update_lock); + return status; +} + + + +/* + * I2C init/probing/exit functions + */ +static int as9726_32d_cpld_probe(struct i2c_client *client, + const struct i2c_device_id *id) +{ + struct i2c_adapter *adap = to_i2c_adapter(client->dev.parent); + struct as9726_32d_cpld_data *data; + int ret = -ENODEV; + int status; + const struct attribute_group *group = NULL; + + if (!i2c_check_functionality(adap, I2C_FUNC_SMBUS_BYTE)) + goto exit; + + data = kzalloc(sizeof(struct as9726_32d_cpld_data), GFP_KERNEL); + if (!data) { + ret = -ENOMEM; + goto exit; + } + + i2c_set_clientdata(client, data); + mutex_init(&data->update_lock); + data->type = id->driver_data; + + + /* Register sysfs hooks */ + switch (data->type) { + case as9726_32d_fpga: + group = &as9726_32d_fpga_group; + break; + case as9726_32d_cpld2: + group = &as9726_32d_cpld2_group; + /*Set interrupt mask to 0, and then can get intr from 0x8*/ + status=as9726_32d_cpld_write_internal(client, 0x9, 0x0); + if (status < 0) + { + dev_dbg(&client->dev, "cpld2 reg 0x9 err %d\n", status); + } + break; + case as9726_32d_cpld3: + group = &as9726_32d_cpld3_group; + /*Set interrupt mask to 0, and then can get intr from 0x8*/ + status=as9726_32d_cpld_write_internal(client, 0x9, 0x0); + if (status < 0) + { + dev_dbg(&client->dev, "cpld3 reg 0x9 err %d\n", status); + } + break; + case as9726_32d_cpld_cpu: + group = &as9726_32d_cpld_cpu_group; + /* Disable CPLD reset to avoid DUT will be reset. + */ +// status=as9726_32d_cpld_write_internal(client, 0x3, 0x0); +// if (status < 0) +// { +// dev_dbg(&client->dev, "cpu_cpld reg 0x65 err %d\n", status); +// } + break; + default: + break; + } + + if (group) { + ret = sysfs_create_group(&client->dev.kobj, group); + if (ret) { + goto exit_free; + } + } + + as9726_32d_cpld_add_client(client); + return 0; + +exit_free: + kfree(data); +exit: + return ret; +} + +static int as9726_32d_cpld_remove(struct i2c_client *client) +{ + struct as9726_32d_cpld_data *data = i2c_get_clientdata(client); + const struct attribute_group *group = NULL; + + as9726_32d_cpld_remove_client(client); + + /* Remove sysfs hooks */ + switch (data->type) { + case as9726_32d_fpga: + group = &as9726_32d_fpga_group; + break; + case as9726_32d_cpld2: + group = &as9726_32d_cpld2_group; + break; + case as9726_32d_cpld3: + group = &as9726_32d_cpld3_group; + break; + case as9726_32d_cpld_cpu: + group = &as9726_32d_cpld_cpu_group; + break; + default: + break; + } + + if (group) { + sysfs_remove_group(&client->dev.kobj, group); + } + + kfree(data); + + return 0; +} + +static int as9726_32d_cpld_read_internal(struct i2c_client *client, u8 reg) +{ + int status = 0, retry = I2C_RW_RETRY_COUNT; + + while (retry) { + status = i2c_smbus_read_byte_data(client, reg); + if (unlikely(status < 0)) { + msleep(I2C_RW_RETRY_INTERVAL); + retry--; + continue; + } + + break; + } + + return status; +} + +static int as9726_32d_cpld_write_internal(struct i2c_client *client, u8 reg, u8 value) +{ + int status = 0, retry = I2C_RW_RETRY_COUNT; + + while (retry) { + status = i2c_smbus_write_byte_data(client, reg, value); + if (unlikely(status < 0)) { + msleep(I2C_RW_RETRY_INTERVAL); + retry--; + continue; + } + + break; + } + + return status; +} + +int as9726_32d_cpld_read(unsigned short cpld_addr, u8 reg) +{ + struct list_head *list_node = NULL; + struct cpld_client_node *cpld_node = NULL; + int ret = -EPERM; + + mutex_lock(&list_lock); + + list_for_each(list_node, &cpld_client_list) + { + cpld_node = list_entry(list_node, struct cpld_client_node, list); + + if (cpld_node->client->addr == cpld_addr) { + ret = as9726_32d_cpld_read_internal(cpld_node->client, reg); + break; + } + } + + mutex_unlock(&list_lock); + + return ret; +} +EXPORT_SYMBOL(as9726_32d_cpld_read); + +int as9726_32d_cpld_write(unsigned short cpld_addr, u8 reg, u8 value) +{ + struct list_head *list_node = NULL; + struct cpld_client_node *cpld_node = NULL; + int ret = -EIO; + + mutex_lock(&list_lock); + + list_for_each(list_node, &cpld_client_list) + { + cpld_node = list_entry(list_node, struct cpld_client_node, list); + + if (cpld_node->client->addr == cpld_addr) { + ret = as9726_32d_cpld_write_internal(cpld_node->client, reg, value); + break; + } + } + + mutex_unlock(&list_lock); + + return ret; +} +EXPORT_SYMBOL(as9726_32d_cpld_write); + +static struct i2c_driver as9726_32d_cpld_driver = { + .driver = { + .name = "as9726_32d_cpld", + .owner = THIS_MODULE, + }, + .probe = as9726_32d_cpld_probe, + .remove = as9726_32d_cpld_remove, + .id_table = as9726_32d_cpld_id, +}; + +static int __init as9726_32d_cpld_init(void) +{ + mutex_init(&list_lock); + return i2c_add_driver(&as9726_32d_cpld_driver); +} + +static void __exit as9726_32d_cpld_exit(void) +{ + i2c_del_driver(&as9726_32d_cpld_driver); +} + +MODULE_AUTHOR("Michael Shih "); +MODULE_DESCRIPTION("Accton I2C CPLD driver"); +MODULE_LICENSE("GPL"); + +module_init(as9726_32d_cpld_init); +module_exit(as9726_32d_cpld_exit); + diff --git a/platform/broadcom/sonic-platform-modules-accton/as9726-32d/modules/x86-64-accton-as9726-32d-fan.c b/platform/broadcom/sonic-platform-modules-accton/as9726-32d/modules/x86-64-accton-as9726-32d-fan.c new file mode 100755 index 000000000000..faf1e84acc37 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as9726-32d/modules/x86-64-accton-as9726-32d-fan.c @@ -0,0 +1,717 @@ +/* + * A hwmon driver for the Accton as9726 32d fan + * + * Copyright (C) 2014 Accton Technology Corporation. + * Brandon Chuang + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define DRVNAME "as9726_32d_fan" + +static struct as9726_32d_fan_data *as9726_32d_fan_update_device(struct device *dev); +static ssize_t fan_show_value(struct device *dev, struct device_attribute *da, char *buf); +static ssize_t set_duty_cycle(struct device *dev, struct device_attribute *da, + const char *buf, size_t count); + +/* fan related data, the index should match sysfs_fan_attributes + */ +static const u8 fan_reg[] = { + 0x0F, /* fan 1-6 present status */ + 0x10, /* fan 1-6 direction(0:F2B 1:B2F) */ + 0x11, /* fan PWM(for all fan) */ + 0x12, /* front fan 1 speed(rpm) */ + 0x13, /* front fan 2 speed(rpm) */ + 0x14, /* front fan 3 speed(rpm) */ + 0x15, /* front fan 4 speed(rpm) */ + 0x16, /* front fan 5 speed(rpm) */ + 0x17, /* front fan 6 speed(rpm) */ + 0x22, /* rear fan 1 speed(rpm) */ + 0x23, /* rear fan 2 speed(rpm) */ + 0x24, /* rear fan 3 speed(rpm) */ + 0x25, /* rear fan 4 speed(rpm) */ + 0x26, /* rear fan 5 speed(rpm) */ + 0x27, /* rear fan 6 speed(rpm) */ +}; + +/* Each client has this additional data */ +struct as9726_32d_fan_data { + struct device *hwmon_dev; + struct mutex update_lock; + char valid; /* != 0 if registers are valid */ + unsigned long last_updated; /* In jiffies */ + u8 reg_val[ARRAY_SIZE(fan_reg)]; /* Register value */ + int system_temp; /*In unit of mini-Celsius*/ + int sensors_found; +}; + +enum fan_id { + FAN1_ID, + FAN2_ID, + FAN3_ID, + FAN4_ID, + FAN5_ID, + FAN6_ID +}; + +enum sysfs_fan_attributes { + FAN_PRESENT_REG, + FAN_DIRECTION_REG, + FAN_DUTY_CYCLE_PERCENTAGE, /* Only one CPLD register to control duty cycle for all fans */ + FAN1_FRONT_SPEED_RPM, + FAN2_FRONT_SPEED_RPM, + FAN3_FRONT_SPEED_RPM, + FAN4_FRONT_SPEED_RPM, + FAN5_FRONT_SPEED_RPM, + FAN6_FRONT_SPEED_RPM, + FAN1_REAR_SPEED_RPM, + FAN2_REAR_SPEED_RPM, + FAN3_REAR_SPEED_RPM, + FAN4_REAR_SPEED_RPM, + FAN5_REAR_SPEED_RPM, + FAN6_REAR_SPEED_RPM, + FAN1_DIRECTION, + FAN2_DIRECTION, + FAN3_DIRECTION, + FAN4_DIRECTION, + FAN5_DIRECTION, + FAN6_DIRECTION, + FAN1_PRESENT, + FAN2_PRESENT, + FAN3_PRESENT, + FAN4_PRESENT, + FAN5_PRESENT, + FAN6_PRESENT, + FAN1_FAULT, + FAN2_FAULT, + FAN3_FAULT, + FAN4_FAULT, + FAN5_FAULT, + FAN6_FAULT +}; + +/* Define attributes + */ +#define DECLARE_FAN_FAULT_SENSOR_DEV_ATTR(index) \ + static SENSOR_DEVICE_ATTR(fan##index##_fault, S_IRUGO, fan_show_value, NULL, FAN##index##_FAULT) + +#define DECLARE_FAN_FAULT_ATTR(index) &sensor_dev_attr_fan##index##_fault.dev_attr.attr + +#define DECLARE_FAN_DIRECTION_SENSOR_DEV_ATTR(index) \ + static SENSOR_DEVICE_ATTR(fan##index##_direction, S_IRUGO, fan_show_value, NULL, FAN##index##_DIRECTION) + +#define DECLARE_FAN_DIRECTION_ATTR(index) &sensor_dev_attr_fan##index##_direction.dev_attr.attr + +#define DECLARE_FAN_DUTY_CYCLE_SENSOR_DEV_ATTR(index) \ + static SENSOR_DEVICE_ATTR(fan##index##_duty_cycle_percentage, S_IWUSR | S_IRUGO, fan_show_value, set_duty_cycle, FAN##index##_DUTY_CYCLE_PERCENTAGE) + +#define DECLARE_FAN_DUTY_CYCLE_ATTR(index) &sensor_dev_attr_fan##index##_duty_cycle_percentage.dev_attr.attr + +#define DECLARE_FAN_PRESENT_SENSOR_DEV_ATTR(index) \ + static SENSOR_DEVICE_ATTR(fan##index##_present, S_IRUGO, fan_show_value, NULL, FAN##index##_PRESENT) + +#define DECLARE_FAN_PRESENT_ATTR(index) &sensor_dev_attr_fan##index##_present.dev_attr.attr + +#define DECLARE_FAN_SPEED_RPM_SENSOR_DEV_ATTR(index, index2) \ + static SENSOR_DEVICE_ATTR(fan##index##_front_speed_rpm, S_IRUGO, fan_show_value, NULL, FAN##index##_FRONT_SPEED_RPM);\ + static SENSOR_DEVICE_ATTR(fan##index##_rear_speed_rpm, S_IRUGO, fan_show_value, NULL, FAN##index##_REAR_SPEED_RPM);\ + static SENSOR_DEVICE_ATTR(fan##index##_input, S_IRUGO, fan_show_value, NULL, FAN##index##_FRONT_SPEED_RPM);\ + static SENSOR_DEVICE_ATTR(fan##index2##_input, S_IRUGO, fan_show_value, NULL, FAN##index##_REAR_SPEED_RPM) + +#define DECLARE_FAN_SPEED_RPM_ATTR(index, index2) &sensor_dev_attr_fan##index##_front_speed_rpm.dev_attr.attr, \ + &sensor_dev_attr_fan##index##_rear_speed_rpm.dev_attr.attr, \ + &sensor_dev_attr_fan##index##_input.dev_attr.attr, \ + &sensor_dev_attr_fan##index2##_input.dev_attr.attr + +/* 6 fan fault attributes in this platform */ +DECLARE_FAN_FAULT_SENSOR_DEV_ATTR(1); +DECLARE_FAN_FAULT_SENSOR_DEV_ATTR(2); +DECLARE_FAN_FAULT_SENSOR_DEV_ATTR(3); +DECLARE_FAN_FAULT_SENSOR_DEV_ATTR(4); +DECLARE_FAN_FAULT_SENSOR_DEV_ATTR(5); +DECLARE_FAN_FAULT_SENSOR_DEV_ATTR(6); +/* 6 fan speed(rpm) attributes in this platform */ +DECLARE_FAN_SPEED_RPM_SENSOR_DEV_ATTR(1,11); +DECLARE_FAN_SPEED_RPM_SENSOR_DEV_ATTR(2,12); +DECLARE_FAN_SPEED_RPM_SENSOR_DEV_ATTR(3,13); +DECLARE_FAN_SPEED_RPM_SENSOR_DEV_ATTR(4,14); +DECLARE_FAN_SPEED_RPM_SENSOR_DEV_ATTR(5,15); +DECLARE_FAN_SPEED_RPM_SENSOR_DEV_ATTR(6,16); +/* 6 fan present attributes in this platform */ +DECLARE_FAN_PRESENT_SENSOR_DEV_ATTR(1); +DECLARE_FAN_PRESENT_SENSOR_DEV_ATTR(2); +DECLARE_FAN_PRESENT_SENSOR_DEV_ATTR(3); +DECLARE_FAN_PRESENT_SENSOR_DEV_ATTR(4); +DECLARE_FAN_PRESENT_SENSOR_DEV_ATTR(5); +DECLARE_FAN_PRESENT_SENSOR_DEV_ATTR(6); +/* 6 fan direction attribute in this platform */ +DECLARE_FAN_DIRECTION_SENSOR_DEV_ATTR(1); +DECLARE_FAN_DIRECTION_SENSOR_DEV_ATTR(2); +DECLARE_FAN_DIRECTION_SENSOR_DEV_ATTR(3); +DECLARE_FAN_DIRECTION_SENSOR_DEV_ATTR(4); +DECLARE_FAN_DIRECTION_SENSOR_DEV_ATTR(5); +DECLARE_FAN_DIRECTION_SENSOR_DEV_ATTR(6); +/* 1 fan duty cycle attribute in this platform */ +DECLARE_FAN_DUTY_CYCLE_SENSOR_DEV_ATTR(); + +static struct attribute *as9726_32d_fan_attributes[] = { + /* fan related attributes */ + DECLARE_FAN_FAULT_ATTR(1), + DECLARE_FAN_FAULT_ATTR(2), + DECLARE_FAN_FAULT_ATTR(3), + DECLARE_FAN_FAULT_ATTR(4), + DECLARE_FAN_FAULT_ATTR(5), + DECLARE_FAN_FAULT_ATTR(6), + DECLARE_FAN_SPEED_RPM_ATTR(1,11), + DECLARE_FAN_SPEED_RPM_ATTR(2,12), + DECLARE_FAN_SPEED_RPM_ATTR(3,13), + DECLARE_FAN_SPEED_RPM_ATTR(4,14), + DECLARE_FAN_SPEED_RPM_ATTR(5,15), + DECLARE_FAN_SPEED_RPM_ATTR(6,16), + DECLARE_FAN_PRESENT_ATTR(1), + DECLARE_FAN_PRESENT_ATTR(2), + DECLARE_FAN_PRESENT_ATTR(3), + DECLARE_FAN_PRESENT_ATTR(4), + DECLARE_FAN_PRESENT_ATTR(5), + DECLARE_FAN_PRESENT_ATTR(6), + DECLARE_FAN_DIRECTION_ATTR(1), + DECLARE_FAN_DIRECTION_ATTR(2), + DECLARE_FAN_DIRECTION_ATTR(3), + DECLARE_FAN_DIRECTION_ATTR(4), + DECLARE_FAN_DIRECTION_ATTR(5), + DECLARE_FAN_DIRECTION_ATTR(6), + DECLARE_FAN_DUTY_CYCLE_ATTR(), + NULL +}; + +#define FAN_DUTY_CYCLE_REG_MASK 0xF +#define FAN_MAX_DUTY_CYCLE 100 +#define FAN_REG_VAL_TO_SPEED_RPM_STEP 200 + +static int as9726_32d_fan_read_value(struct i2c_client *client, u8 reg) +{ + return i2c_smbus_read_byte_data(client, reg); +} + +static int as9726_32d_fan_write_value(struct i2c_client *client, u8 reg, u8 value) +{ + return i2c_smbus_write_byte_data(client, reg, value); +} + +/* fan utility functions + */ +static u32 reg_val_to_duty_cycle(u8 reg_val) +{ + reg_val &= FAN_DUTY_CYCLE_REG_MASK; + u32 duty_cycle = 0; + + switch(reg_val) + { + case 0: + duty_cycle = 0; + break; + case 5 ... 6: + duty_cycle = ( ((u32)(reg_val)+1) *6) + 1; + break; + case 7 ... 10: + duty_cycle = ( ((u32)(reg_val)+1) *6) + 2; + break; + case 11 ... 14: + duty_cycle = ( ((u32)(reg_val)+1) *6) + 3; + break; + case 15: + duty_cycle = 100; + break; + default: // 1~4 + duty_cycle = 31; + break; + } + + return duty_cycle; +} + +static u8 duty_cycle_to_reg_val(u8 duty_cycle) +{ + u32 reg_val = 0; + + if((u32)duty_cycle == 0) { + reg_val = 0; + } + else if((u32)duty_cycle <= 31) { + reg_val = 4; + } + else if((u32)duty_cycle <= 37) { + reg_val = 5; + } + else if((u32)duty_cycle <= 43) { + reg_val = 6; + } + else if((u32)duty_cycle <= 50) { + reg_val = 7; + } + else if((u32)duty_cycle <= 56) { + reg_val = 8; + } + else if((u32)duty_cycle <= 62) { + reg_val = 9; + } + else if((u32)duty_cycle <= 68) { + reg_val = 10; + } + else if((u32)duty_cycle <= 75) { + reg_val = 11; + } + else if((u32)duty_cycle <= 81) { + reg_val = 12; + } + else if((u32)duty_cycle <= 87) { + reg_val = 13; + } + else if((u32)duty_cycle <= 93) { + reg_val = 14; + } + else { + reg_val = 15; + } + + return reg_val; +} + +static u32 reg_val_to_speed_rpm(u8 reg_val) +{ + return (u32)reg_val * FAN_REG_VAL_TO_SPEED_RPM_STEP; +} + +static u8 reg_val_to_direction(u8 reg_val, enum fan_id id) +{ + u8 mask = (1 << id); + + reg_val &= mask; + + return reg_val ? 1 : 0; +} +static u8 reg_val_to_is_present(u8 reg_val, enum fan_id id) +{ + u8 mask = (1 << id); + + reg_val &= mask; + + return reg_val ? 0 : 1; +} + +static u8 is_fan_fault(struct as9726_32d_fan_data *data, enum fan_id id) +{ + u8 ret = 1; + int front_fan_index = FAN1_FRONT_SPEED_RPM + id; + int rear_fan_index = FAN1_REAR_SPEED_RPM + id; + + /* Check if the speed of front or rear fan is ZERO, + */ + if (reg_val_to_speed_rpm(data->reg_val[front_fan_index]) && + reg_val_to_speed_rpm(data->reg_val[rear_fan_index])) { + ret = 0; + } + + return ret; +} + +static ssize_t set_duty_cycle(struct device *dev, struct device_attribute *da, + const char *buf, size_t count) +{ + int error, value; + struct i2c_client *client = to_i2c_client(dev); + + error = kstrtoint(buf, 10, &value); + if (error) + return error; + + if (value < 0 || value > FAN_MAX_DUTY_CYCLE) + return -EINVAL; + + as9726_32d_fan_write_value(client, 0x33, 0); /* Disable fan speed watch dog */ + as9726_32d_fan_write_value(client, fan_reg[FAN_DUTY_CYCLE_PERCENTAGE], duty_cycle_to_reg_val(value)); + return count; +} + +/* Due to this struct is declared at lm75.c, it cannot be include + * under Sonic environment. I duplicate it from lm75.c. + */ +struct lm75_data { + struct i2c_client *client; + struct device *hwmon_dev; + struct thermal_zone_device *tz; + struct mutex update_lock; + u8 orig_conf; + u8 resolution; /* In bits, between 9 and 12 */ + u8 resolution_limits; + char valid; /* !=0 if registers are valid */ + unsigned long last_updated; /* In jiffies */ + unsigned long sample_time; /* In jiffies */ + s16 temp[3]; /* Register values, + 0 = input + 1 = max + 2 = hyst */ +}; + +/*Copied from lm75.c*/ +static inline long lm75_reg_to_mc(s16 temp, u8 resolution) +{ + return ((temp >> (16 - resolution)) * 1000) >> (resolution - 8); +} + +/*Get hwmon_dev from i2c_client, set hwmon_dev = NULL is failed.*/ +static struct device * get_hwmon_dev( + struct i2c_client *client) +{ + struct lm75_data *data = NULL; + + data = i2c_get_clientdata(client); + if(data) + { + if( data->valid == 1 && data->hwmon_dev) + { + return data->hwmon_dev; + } + + } + return NULL; +} + +/* To find hwmon index by opening hwmon under that i2c address. + */ +static int find_hwmon_index_by_FileOpen( + int bus_nr, + unsigned short addr, + int *index) +{ +#define MAX_HWMON_DEVICE (10) /* Find hwmon device in 0~10*/ + struct file *sfd; + char client_name[96]; + int i=0; + + do { + snprintf(client_name, sizeof(client_name), + "/sys/bus/i2c/devices/%d-%04x/hwmon/hwmon%d/temp1_input", + bus_nr, addr, i); + + sfd = filp_open(client_name, O_RDONLY, 0); + i++; + } while( IS_ERR(sfd) && i < MAX_HWMON_DEVICE); + + if (IS_ERR(sfd)) { + pr_err("Failed to open file(%s)#%d\r\n", client_name, __LINE__); + return -ENOENT; + } + filp_close(sfd, 0); + *index = i - 1; + return 0; + +#undef MAX_HWMON_DEVICE +} + +static int get_temp_file_path( + int bus_nr, unsigned short addr, + struct device *hwmon_dev + ,char *path, int max_len) +{ + + if(hwmon_dev && strlen(dev_name(hwmon_dev))) + { + snprintf(path, max_len, + "/sys/bus/i2c/devices/%d-%04x/hwmon/%s/temp1_input", + bus_nr, addr, dev_name(hwmon_dev)); + } + else + { + int i=0; + if(find_hwmon_index_by_FileOpen( bus_nr, addr, &i)) + { + return -EIO; + } + snprintf(path, max_len, + "/sys/bus/i2c/devices/%d-%04x/hwmon/hwmon%d/temp1_input", + bus_nr, addr, i); + } + + return 0; +} + +/*File read the dev file at user space.*/ +static int read_devfile_temp1_input( + struct device *dev, + int bus_nr, + unsigned short addr, + struct device *hwmon_dev, + int *miniCelsius) +{ + struct file *sfd; + char buffer[96]; + char devfile[96]; + int rc, status; + int rdlen, value; + mm_segment_t old_fs; + + rc = 0; + get_temp_file_path(bus_nr, addr, hwmon_dev, devfile, sizeof(devfile)); + sfd = filp_open(devfile, O_RDONLY, 0); + if (IS_ERR(sfd)) { + pr_err("Failed to open file(%s)#%d\r\n", devfile, __LINE__); + return -ENOENT; + } + dev_dbg(dev, "Found device:%s\n",devfile); + + if(!(sfd->f_op) || !(sfd->f_op->read) ) { + pr_err("file %s cann't readable ?\n",devfile); + return -ENOENT; + } + + old_fs = get_fs(); + set_fs(KERNEL_DS); + rdlen = sfd->f_op->read(sfd, buffer, sizeof(buffer), &sfd->f_pos); + if (rdlen == 0) { + pr_err( "File(%s) empty!\n", devfile); + rc = -EIO; + goto exit; + } + status = sscanf(buffer, "%d", &value); + if (status != 1) { + rc = -EIO; + goto exit; + } + *miniCelsius = value; + dev_dbg(dev,"found sensors: %d @i2c %d-%04x\n", value, bus_nr, addr); + +exit: + set_fs(old_fs); + filp_close(sfd, 0); + return rc; +} + +static u8 is_lm75_data_due(struct i2c_client *client) +{ + struct lm75_data *data = NULL; + + data = i2c_get_clientdata(client); + if (time_after(jiffies, data->last_updated + data->sample_time)) + { + return 1; + } + return 0; +} + +static ssize_t fan_show_value(struct device *dev, struct device_attribute *da, + char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + struct as9726_32d_fan_data *data = as9726_32d_fan_update_device(dev); + ssize_t ret = 0; + + if (data->valid) { + switch (attr->index) { + case FAN_DUTY_CYCLE_PERCENTAGE: + { + u32 duty_cycle = reg_val_to_duty_cycle(data->reg_val[FAN_DUTY_CYCLE_PERCENTAGE]); + ret = sprintf(buf, "%u\n", duty_cycle); + break; + } + case FAN1_FRONT_SPEED_RPM: + case FAN2_FRONT_SPEED_RPM: + case FAN3_FRONT_SPEED_RPM: + case FAN4_FRONT_SPEED_RPM: + case FAN5_FRONT_SPEED_RPM: + case FAN6_FRONT_SPEED_RPM: + case FAN1_REAR_SPEED_RPM: + case FAN2_REAR_SPEED_RPM: + case FAN3_REAR_SPEED_RPM: + case FAN4_REAR_SPEED_RPM: + case FAN5_REAR_SPEED_RPM: + case FAN6_REAR_SPEED_RPM: + ret = sprintf(buf, "%u\n", reg_val_to_speed_rpm(data->reg_val[attr->index])); + break; + case FAN1_PRESENT: + case FAN2_PRESENT: + case FAN3_PRESENT: + case FAN4_PRESENT: + case FAN5_PRESENT: + case FAN6_PRESENT: + ret = sprintf(buf, "%d\n", + reg_val_to_is_present(data->reg_val[FAN_PRESENT_REG], + attr->index - FAN1_PRESENT)); + break; + case FAN1_FAULT: + case FAN2_FAULT: + case FAN3_FAULT: + case FAN4_FAULT: + case FAN5_FAULT: + case FAN6_FAULT: + ret = sprintf(buf, "%d\n", is_fan_fault(data, attr->index - FAN1_FAULT)); + break; + case FAN1_DIRECTION: + case FAN2_DIRECTION: + case FAN3_DIRECTION: + case FAN4_DIRECTION: + case FAN5_DIRECTION: + case FAN6_DIRECTION: + ret = sprintf(buf, "%d\n", + reg_val_to_direction(data->reg_val[FAN_DIRECTION_REG], + attr->index - FAN1_DIRECTION)); + break; + default: + break; + } + } + + return ret; +} + +static const struct attribute_group as9726_32d_fan_group = { + .attrs = as9726_32d_fan_attributes, +}; + +static struct as9726_32d_fan_data *as9726_32d_fan_update_device(struct device *dev) +{ + struct i2c_client *client = to_i2c_client(dev); + struct as9726_32d_fan_data *data = i2c_get_clientdata(client); + + mutex_lock(&data->update_lock); + + if (time_after(jiffies, data->last_updated + HZ + HZ / 2) || + !data->valid) { + int i; + + dev_dbg(&client->dev, "Starting as9726_32d_fan update\n"); + data->valid = 0; + + /* Update fan data + */ + for (i = 0; i < ARRAY_SIZE(data->reg_val); i++) { + int status = as9726_32d_fan_read_value(client, fan_reg[i]); + if (status < 0) { + data->valid = 0; + mutex_unlock(&data->update_lock); + dev_dbg(&client->dev, "reg %d, err %d\n", fan_reg[i], status); + return data; + } + else { + data->reg_val[i] = status; + } + } + + data->last_updated = jiffies; + data->valid = 1; + } + + mutex_unlock(&data->update_lock); + + return data; +} + +static int as9726_32d_fan_probe(struct i2c_client *client, + const struct i2c_device_id *dev_id) +{ + struct as9726_32d_fan_data *data; + int status; + + if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) { + status = -EIO; + goto exit; + } + + data = kzalloc(sizeof(struct as9726_32d_fan_data), GFP_KERNEL); + if (!data) { + status = -ENOMEM; + goto exit; + } + + i2c_set_clientdata(client, data); + data->valid = 0; + mutex_init(&data->update_lock); + + dev_info(&client->dev, "chip found\n"); + + /* Register sysfs hooks */ + status = sysfs_create_group(&client->dev.kobj, &as9726_32d_fan_group); + if (status) { + goto exit_free; + } + + data->hwmon_dev = hwmon_device_register(&client->dev); + if (IS_ERR(data->hwmon_dev)) { + status = PTR_ERR(data->hwmon_dev); + goto exit_remove; + } + + dev_info(&client->dev, "%s: fan '%s'\n", + dev_name(data->hwmon_dev), client->name); + + return 0; + +exit_remove: + sysfs_remove_group(&client->dev.kobj, &as9726_32d_fan_group); +exit_free: + kfree(data); +exit: + + return status; +} + +static int as9726_32d_fan_remove(struct i2c_client *client) +{ + struct as9726_32d_fan_data *data = i2c_get_clientdata(client); + hwmon_device_unregister(data->hwmon_dev); + sysfs_remove_group(&client->dev.kobj, &as9726_32d_fan_group); + + return 0; +} + +/* Addresses to scan */ +static const unsigned short normal_i2c[] = { 0x66, I2C_CLIENT_END }; + +static const struct i2c_device_id as9726_32d_fan_id[] = { + { "as9726_32d_fan", 0 }, + {} +}; +MODULE_DEVICE_TABLE(i2c, as9726_32d_fan_id); + +static struct i2c_driver as9726_32d_fan_driver = { + .class = I2C_CLASS_HWMON, + .driver = { + .name = DRVNAME, + }, + .probe = as9726_32d_fan_probe, + .remove = as9726_32d_fan_remove, + .id_table = as9726_32d_fan_id, + .address_list = normal_i2c, +}; + +module_i2c_driver(as9726_32d_fan_driver); + +MODULE_AUTHOR("Michael Shih "); +MODULE_DESCRIPTION("as9726_32d_fan driver"); +MODULE_LICENSE("GPL"); + diff --git a/platform/broadcom/sonic-platform-modules-accton/as9726-32d/modules/x86-64-accton-as9726-32d-psu.c b/platform/broadcom/sonic-platform-modules-accton/as9726-32d/modules/x86-64-accton-as9726-32d-psu.c new file mode 100755 index 000000000000..cdf11f503d6e --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as9726-32d/modules/x86-64-accton-as9726-32d-psu.c @@ -0,0 +1,321 @@ +/* + * An hwmon driver for accton as9726_32d Power Module + * + * Copyright (C) 2014 Accton Technology Corporation. + * Brandon Chuang + * + * Based on ad7414.c + * Copyright 2006 Stefan Roese , DENX Software Engineering + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define MAX_MODEL_NAME 20 +#define MAX_SERIAL_NUMBER 19 + +static ssize_t show_status(struct device *dev, struct device_attribute *da, char *buf); +static ssize_t show_string(struct device *dev, struct device_attribute *da, char *buf); +static int as9726_32d_psu_read_block(struct i2c_client *client, u8 command, u8 *data,int data_len); +extern int as9726_32d_cpld_read(unsigned short cpld_addr, u8 reg); + +/* Addresses scanned + */ +static const unsigned short normal_i2c[] = { 0x50, 0x51, I2C_CLIENT_END }; + +/* Each client has this additional data + */ +struct as9726_32d_psu_data { + struct device *hwmon_dev; + struct mutex update_lock; + char valid; /* !=0 if registers are valid */ + unsigned long last_updated; /* In jiffies */ + u8 index; /* PSU index */ + u8 status; /* Status(present/power_good) register read from CPLD */ + char model_name[MAX_MODEL_NAME]; /* Model name, read from eeprom */ + char serial_number[MAX_SERIAL_NUMBER]; +}; + +static struct as9726_32d_psu_data *as9726_32d_psu_update_device(struct device *dev); + +enum as9726_32d_psu_sysfs_attributes { + PSU_PRESENT, + PSU_MODEL_NAME, + PSU_POWER_GOOD, + PSU_SERIAL_NUMBER +}; + +/* sysfs attributes for hwmon + */ +static SENSOR_DEVICE_ATTR(psu_present, S_IRUGO, show_status, NULL, PSU_PRESENT); +static SENSOR_DEVICE_ATTR(psu_model_name, S_IRUGO, show_string, NULL, PSU_MODEL_NAME); +static SENSOR_DEVICE_ATTR(psu_power_good, S_IRUGO, show_status, NULL, PSU_POWER_GOOD); +static SENSOR_DEVICE_ATTR(psu_serial_number, S_IRUGO, show_string, NULL, PSU_SERIAL_NUMBER); + + +static struct attribute *as9726_32d_psu_attributes[] = { + &sensor_dev_attr_psu_present.dev_attr.attr, + &sensor_dev_attr_psu_model_name.dev_attr.attr, + &sensor_dev_attr_psu_power_good.dev_attr.attr, + &sensor_dev_attr_psu_serial_number.dev_attr.attr, + NULL +}; + +static ssize_t show_status(struct device *dev, struct device_attribute *da, + char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + struct as9726_32d_psu_data *data = as9726_32d_psu_update_device(dev); + u8 status = 0; + + //printk("data->status=0x%x, attr->index=%d,data->index=%d \n", data->status, attr->index, data->index); + if (attr->index == PSU_PRESENT) { + if(data->index==0) + status = !( (data->status) & 0x1); + else + status = !( (data->status >> 1) & 0x1); + } + else { /* PSU_POWER_GOOD */ + if(data->index==0) + status = ( (data->status >> 2) & 0x1); + else + status = ( (data->status >> 3) & 0x1); + } + + return sprintf(buf, "%d\n", status); +} + +static ssize_t show_string(struct device *dev, struct device_attribute *da, + char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + struct as9726_32d_psu_data *data = as9726_32d_psu_update_device(dev); + char *ptr = NULL; + + if (!data->valid) { + return -EIO; + } + + switch (attr->index) { + case PSU_MODEL_NAME: + ptr = data->model_name; + break; + case PSU_SERIAL_NUMBER: + ptr = data->serial_number; + break; + default: + return -EINVAL; + } + + return sprintf(buf, "%s\n", ptr); +} + +static const struct attribute_group as9726_32d_psu_group = { + .attrs = as9726_32d_psu_attributes, +}; + +static int as9726_32d_psu_probe(struct i2c_client *client, + const struct i2c_device_id *dev_id) +{ + struct as9726_32d_psu_data *data; + int status; + + if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_I2C_BLOCK)) { + status = -EIO; + goto exit; + } + + data = kzalloc(sizeof(struct as9726_32d_psu_data), GFP_KERNEL); + if (!data) { + status = -ENOMEM; + goto exit; + } + + i2c_set_clientdata(client, data); + data->valid = 0; + data->index = dev_id->driver_data; + mutex_init(&data->update_lock); + + dev_info(&client->dev, "chip found\n"); + + /* Register sysfs hooks */ + status = sysfs_create_group(&client->dev.kobj, &as9726_32d_psu_group); + if (status) { + goto exit_free; + } + + data->hwmon_dev = hwmon_device_register(&client->dev); + if (IS_ERR(data->hwmon_dev)) { + status = PTR_ERR(data->hwmon_dev); + goto exit_remove; + } + + dev_info(&client->dev, "%s: psu '%s'\n", + dev_name(data->hwmon_dev), client->name); + + return 0; + +exit_remove: + sysfs_remove_group(&client->dev.kobj, &as9726_32d_psu_group); +exit_free: + kfree(data); +exit: + + return status; +} + +static int as9726_32d_psu_remove(struct i2c_client *client) +{ + struct as9726_32d_psu_data *data = i2c_get_clientdata(client); + + hwmon_device_unregister(data->hwmon_dev); + sysfs_remove_group(&client->dev.kobj, &as9726_32d_psu_group); + kfree(data); + + return 0; +} + +enum psu_index +{ + as9726_32d_psu1, + as9726_32d_psu2 +}; + +static const struct i2c_device_id as9726_32d_psu_id[] = { + { "as9726_32d_psu1", as9726_32d_psu1 }, + { "as9726_32d_psu2", as9726_32d_psu2 }, + {} +}; +MODULE_DEVICE_TABLE(i2c, as9726_32d_psu_id); + +static struct i2c_driver as9726_32d_psu_driver = { + .class = I2C_CLASS_HWMON, + .driver = { + .name = "as9726_32d_psu", + }, + .probe = as9726_32d_psu_probe, + .remove = as9726_32d_psu_remove, + .id_table = as9726_32d_psu_id, + .address_list = normal_i2c, +}; + +static int as9726_32d_psu_read_block(struct i2c_client *client, u8 command, u8 *data, + int data_len) +{ + int result = 0; + int retry_count = 5; + + while (retry_count) { + retry_count--; + + result = i2c_smbus_read_i2c_block_data(client, command, data_len, data); + + if (unlikely(result < 0)) { + msleep(10); + continue; + } + + if (unlikely(result != data_len)) { + result = -EIO; + msleep(10); + continue; + } + + result = 0; + break; + } + + return result; +} + +static struct as9726_32d_psu_data *as9726_32d_psu_update_device(struct device *dev) +{ + struct i2c_client *client = to_i2c_client(dev); + struct as9726_32d_psu_data *data = i2c_get_clientdata(client); + + mutex_lock(&data->update_lock); + + if (time_after(jiffies, data->last_updated + HZ + HZ / 2) + || !data->valid) { + int status; + int psu_present = 0; + + dev_dbg(&client->dev, "Starting as9726_32d update\n"); + + /* Read psu status */ + status = as9726_32d_cpld_read(0x60, 0x03); + //printk("status=0x%x in %s\n", status, __FUNCTION__); + + if (status < 0) { + dev_dbg(&client->dev, "cpld reg 0x60 err %d\n", status); + } + else { + data->status = status; + } + + /* Read model name */ + memset(data->model_name, 0, sizeof(data->model_name)); + memset(data->serial_number, 0, sizeof(data->serial_number)); + psu_present = (data->status >> (data->index) & 0x1); //0:present, 1:not present + + if (!psu_present) { + status = as9726_32d_psu_read_block(client, 0x20, data->model_name, + ARRAY_SIZE(data->model_name)-1); + if (status < 0) { + data->model_name[0] = '\0'; + dev_dbg(&client->dev, "unable to read model name from (0x%x)\n", client->addr); + printk("unable to read model name from (0x%x)\n", client->addr); + } + else { + data->model_name[ARRAY_SIZE(data->model_name)-1] = '\0'; + + } + /* Read from offset 0x35 ~ 0x46 (18 bytes) */ + status = as9726_32d_psu_read_block(client, 0x35,data->serial_number, MAX_SERIAL_NUMBER); + if (status < 0) + { + data->serial_number[0] = '\0'; + dev_dbg(&client->dev, "unable to read model name from (0x%x) offset(0x2e)\n", client->addr); + printk("unable to read model name from (0x%x) offset(0x2e)\n", client->addr); + } + data->serial_number[MAX_SERIAL_NUMBER-1]='\0'; + } + + data->last_updated = jiffies; + data->valid = 1; + } + + mutex_unlock(&data->update_lock); + + return data; +} + +module_i2c_driver(as9726_32d_psu_driver); + +MODULE_AUTHOR("Michael Shih "); +MODULE_DESCRIPTION("as9726_32d_psu driver"); +MODULE_LICENSE("GPL"); + diff --git a/platform/broadcom/sonic-platform-modules-accton/as9726-32d/modules/ym2651y.c b/platform/broadcom/sonic-platform-modules-accton/as9726-32d/modules/ym2651y.c new file mode 100755 index 000000000000..63488d2c6c78 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as9726-32d/modules/ym2651y.c @@ -0,0 +1,678 @@ +/* + * An hwmon driver for the 3Y Power YM-2651Y Power Module + * + * Copyright (C) 2014 Accton Technology Corporation. + * Brandon Chuang + * + * Based on ad7414.c + * Copyright 2006 Stefan Roese , DENX Software Engineering + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define MAX_FAN_DUTY_CYCLE 100 + +/* Addresses scanned + */ +static const unsigned short normal_i2c[] = { 0x58, 0x59, I2C_CLIENT_END }; + +enum chips { + YM2651, + YM2401, + YM2851, + YPEB1200AM, +}; + +/* Each client has this additional data + */ +struct ym2651y_data { + struct device *hwmon_dev; + struct mutex update_lock; + char valid; /* !=0 if registers are valid */ + unsigned long last_updated; /* In jiffies */ + u8 chip; /* chip id */ + u8 capability; /* Register value */ + u16 status_word; /* Register value */ + u8 fan_fault; /* Register value */ + u8 over_temp; /* Register value */ + u16 v_out; /* Register value */ + u16 i_out; /* Register value */ + u16 p_out; /* Register value */ + u8 vout_mode; /* Register value */ + u16 temp; /* Register value */ + u16 fan_speed; /* Register value */ + u16 fan_duty_cycle[2]; /* Register value */ + u8 fan_dir[4]; /* Register value */ + u8 pmbus_revision; /* Register value */ + u8 mfr_id[10]; /* Register value */ + u8 mfr_model[10]; /* Register value */ + u8 mfr_revsion[3]; /* Register value */ + u16 mfr_vin_min; /* Register value */ + u16 mfr_vin_max; /* Register value */ + u16 mfr_iin_max; /* Register value */ + u16 mfr_iout_max; /* Register value */ + u16 mfr_pin_max; /* Register value */ + u16 mfr_pout_max; /* Register value */ + u16 mfr_vout_min; /* Register value */ + u16 mfr_vout_max; /* Register value */ +}; + +static ssize_t show_vout(struct device *dev, struct device_attribute *da, + char *buf); +static ssize_t show_byte(struct device *dev, struct device_attribute *da, + char *buf); +static ssize_t show_word(struct device *dev, struct device_attribute *da, + char *buf); +static ssize_t show_linear(struct device *dev, struct device_attribute *da, + char *buf); +static ssize_t show_fan_fault(struct device *dev, struct device_attribute *da, + char *buf); +static ssize_t show_over_temp(struct device *dev, struct device_attribute *da, + char *buf); +static ssize_t show_ascii(struct device *dev, struct device_attribute *da, + char *buf); +static struct ym2651y_data *ym2651y_update_device(struct device *dev); +static ssize_t set_fan_duty_cycle(struct device *dev, struct device_attribute *da, + const char *buf, size_t count); +static int ym2651y_write_word(struct i2c_client *client, u8 reg, u16 value); + +enum ym2651y_sysfs_attributes { + PSU_POWER_ON = 0, + PSU_TEMP_FAULT, + PSU_POWER_GOOD, + PSU_FAN1_FAULT, + PSU_FAN_DIRECTION, + PSU_OVER_TEMP, + PSU_V_OUT, + PSU_I_OUT, + PSU_P_OUT, + PSU_P_OUT_UV, /*In Unit of microVolt, instead of mini.*/ + PSU_TEMP1_INPUT, + PSU_FAN1_SPEED, + PSU_FAN1_DUTY_CYCLE, + PSU_PMBUS_REVISION, + PSU_MFR_ID, + PSU_MFR_MODEL, + PSU_MFR_REVISION, + PSU_MFR_VIN_MIN, + PSU_MFR_VIN_MAX, + PSU_MFR_VOUT_MIN, + PSU_MFR_VOUT_MAX, + PSU_MFR_IIN_MAX, + PSU_MFR_IOUT_MAX, + PSU_MFR_PIN_MAX, + PSU_MFR_POUT_MAX +}; + +/* sysfs attributes for hwmon + */ +static SENSOR_DEVICE_ATTR(psu_power_on, S_IRUGO, show_word, NULL, PSU_POWER_ON); +static SENSOR_DEVICE_ATTR(psu_temp_fault, S_IRUGO, show_word, NULL, PSU_TEMP_FAULT); +static SENSOR_DEVICE_ATTR(psu_power_good, S_IRUGO, show_word, NULL, PSU_POWER_GOOD); +static SENSOR_DEVICE_ATTR(psu_fan1_fault, S_IRUGO, show_fan_fault, NULL, PSU_FAN1_FAULT); +static SENSOR_DEVICE_ATTR(psu_over_temp, S_IRUGO, show_over_temp, NULL, PSU_OVER_TEMP); +static SENSOR_DEVICE_ATTR(psu_v_out, S_IRUGO, show_vout, NULL, PSU_V_OUT); +static SENSOR_DEVICE_ATTR(psu_i_out, S_IRUGO, show_linear, NULL, PSU_I_OUT); +static SENSOR_DEVICE_ATTR(psu_p_out, S_IRUGO, show_linear, NULL, PSU_P_OUT); +static SENSOR_DEVICE_ATTR(psu_temp1_input, S_IRUGO, show_linear, NULL, PSU_TEMP1_INPUT); +static SENSOR_DEVICE_ATTR(psu_fan1_speed_rpm, S_IRUGO, show_linear, NULL, PSU_FAN1_SPEED); +static SENSOR_DEVICE_ATTR(psu_fan1_duty_cycle_percentage, S_IWUSR | S_IRUGO, show_linear, set_fan_duty_cycle, PSU_FAN1_DUTY_CYCLE); +static SENSOR_DEVICE_ATTR(psu_fan_dir, S_IRUGO, show_ascii, NULL, PSU_FAN_DIRECTION); +static SENSOR_DEVICE_ATTR(psu_pmbus_revision, S_IRUGO, show_byte, NULL, PSU_PMBUS_REVISION); +static SENSOR_DEVICE_ATTR(psu_mfr_id, S_IRUGO, show_ascii, NULL, PSU_MFR_ID); +static SENSOR_DEVICE_ATTR(psu_mfr_model, S_IRUGO, show_ascii, NULL, PSU_MFR_MODEL); +static SENSOR_DEVICE_ATTR(psu_mfr_revision, S_IRUGO, show_ascii, NULL, PSU_MFR_REVISION); +static SENSOR_DEVICE_ATTR(psu_mfr_vin_min, S_IRUGO, show_linear, NULL, PSU_MFR_VIN_MIN); +static SENSOR_DEVICE_ATTR(psu_mfr_vin_max, S_IRUGO, show_linear, NULL, PSU_MFR_VIN_MAX); +static SENSOR_DEVICE_ATTR(psu_mfr_vout_min, S_IRUGO, show_linear, NULL, PSU_MFR_VOUT_MIN); +static SENSOR_DEVICE_ATTR(psu_mfr_vout_max, S_IRUGO, show_linear, NULL, PSU_MFR_VOUT_MAX); +static SENSOR_DEVICE_ATTR(psu_mfr_iin_max, S_IRUGO, show_linear, NULL, PSU_MFR_IIN_MAX); +static SENSOR_DEVICE_ATTR(psu_mfr_iout_max, S_IRUGO, show_linear, NULL, PSU_MFR_IOUT_MAX); +static SENSOR_DEVICE_ATTR(psu_mfr_pin_max, S_IRUGO, show_linear, NULL, PSU_MFR_PIN_MAX); +static SENSOR_DEVICE_ATTR(psu_mfr_pout_max, S_IRUGO, show_linear, NULL, PSU_MFR_POUT_MAX); + +/*Duplicate nodes for lm-sensors.*/ +static SENSOR_DEVICE_ATTR(in3_input, S_IRUGO, show_vout, NULL, PSU_V_OUT); +static SENSOR_DEVICE_ATTR(curr2_input, S_IRUGO, show_linear, NULL, PSU_I_OUT); +static SENSOR_DEVICE_ATTR(power2_input, S_IRUGO, show_linear, NULL, PSU_P_OUT_UV); +static SENSOR_DEVICE_ATTR(temp1_input, S_IRUGO, show_linear, NULL, PSU_TEMP1_INPUT); +static SENSOR_DEVICE_ATTR(fan1_input, S_IRUGO, show_linear, NULL, PSU_FAN1_SPEED); +static SENSOR_DEVICE_ATTR(temp1_fault, S_IRUGO, show_word, NULL, PSU_TEMP_FAULT); + +static struct attribute *ym2651y_attributes[] = { + &sensor_dev_attr_psu_power_on.dev_attr.attr, + &sensor_dev_attr_psu_temp_fault.dev_attr.attr, + &sensor_dev_attr_psu_power_good.dev_attr.attr, + &sensor_dev_attr_psu_fan1_fault.dev_attr.attr, + &sensor_dev_attr_psu_over_temp.dev_attr.attr, + &sensor_dev_attr_psu_v_out.dev_attr.attr, + &sensor_dev_attr_psu_i_out.dev_attr.attr, + &sensor_dev_attr_psu_p_out.dev_attr.attr, + &sensor_dev_attr_psu_temp1_input.dev_attr.attr, + &sensor_dev_attr_psu_fan1_speed_rpm.dev_attr.attr, + &sensor_dev_attr_psu_fan1_duty_cycle_percentage.dev_attr.attr, + &sensor_dev_attr_psu_fan_dir.dev_attr.attr, + &sensor_dev_attr_psu_pmbus_revision.dev_attr.attr, + &sensor_dev_attr_psu_mfr_id.dev_attr.attr, + &sensor_dev_attr_psu_mfr_model.dev_attr.attr, + &sensor_dev_attr_psu_mfr_revision.dev_attr.attr, + &sensor_dev_attr_psu_mfr_vin_min.dev_attr.attr, + &sensor_dev_attr_psu_mfr_vin_max.dev_attr.attr, + &sensor_dev_attr_psu_mfr_pout_max.dev_attr.attr, + &sensor_dev_attr_psu_mfr_iin_max.dev_attr.attr, + &sensor_dev_attr_psu_mfr_pin_max.dev_attr.attr, + &sensor_dev_attr_psu_mfr_vout_min.dev_attr.attr, + &sensor_dev_attr_psu_mfr_vout_max.dev_attr.attr, + &sensor_dev_attr_psu_mfr_iout_max.dev_attr.attr, + /*Duplicate nodes for lm-sensors.*/ + &sensor_dev_attr_curr2_input.dev_attr.attr, + &sensor_dev_attr_in3_input.dev_attr.attr, + &sensor_dev_attr_power2_input.dev_attr.attr, + &sensor_dev_attr_temp1_input.dev_attr.attr, + &sensor_dev_attr_fan1_input.dev_attr.attr, + &sensor_dev_attr_temp1_fault.dev_attr.attr, + NULL +}; + +static ssize_t show_byte(struct device *dev, struct device_attribute *da, + char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + struct ym2651y_data *data = ym2651y_update_device(dev); + + return (attr->index == PSU_PMBUS_REVISION) ? sprintf(buf, "%d\n", data->pmbus_revision) : + sprintf(buf, "0\n"); +} + +static ssize_t show_word(struct device *dev, struct device_attribute *da, + char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + struct ym2651y_data *data = ym2651y_update_device(dev); + u16 status = 0; + + switch (attr->index) { + case PSU_POWER_ON: /* psu_power_on, low byte bit 6 of status_word, 0=>ON, 1=>OFF */ + status = (data->status_word & 0x40) ? 0 : 1; + break; + case PSU_TEMP_FAULT: /* psu_temp_fault, low byte bit 2 of status_word, 0=>Normal, 1=>temp fault */ + status = (data->status_word & 0x4) >> 2; + break; + case PSU_POWER_GOOD: /* psu_power_good, high byte bit 3 of status_word, 0=>OK, 1=>FAIL */ + status = (data->status_word & 0x800) ? 0 : 1; + break; + } + + return sprintf(buf, "%d\n", status); +} + +static int two_complement_to_int(u16 data, u8 valid_bit, int mask) +{ + u16 valid_data = data & mask; + bool is_negative = valid_data >> (valid_bit - 1); + + return is_negative ? (-(((~valid_data) & mask) + 1)) : valid_data; +} + +static ssize_t set_fan_duty_cycle(struct device *dev, struct device_attribute *da, + const char *buf, size_t count) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + struct i2c_client *client = to_i2c_client(dev); + struct ym2651y_data *data = i2c_get_clientdata(client); + int nr = (attr->index == PSU_FAN1_DUTY_CYCLE) ? 0 : 1; + long speed; + int error; + + error = kstrtol(buf, 10, &speed); + if (error) + return error; + + if (speed < 0 || speed > MAX_FAN_DUTY_CYCLE) + return -EINVAL; + + mutex_lock(&data->update_lock); + data->fan_duty_cycle[nr] = speed; + ym2651y_write_word(client, 0x3B + nr, data->fan_duty_cycle[nr]); + mutex_unlock(&data->update_lock); + + return count; +} + +static ssize_t show_linear(struct device *dev, struct device_attribute *da, + char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + struct ym2651y_data *data = ym2651y_update_device(dev); + + u16 value = 0; + int exponent, mantissa; + int multiplier = 1000; + + switch (attr->index) { + case PSU_V_OUT: + value = data->v_out; + break; + case PSU_I_OUT: + value = data->i_out; + break; + case PSU_P_OUT_UV: + multiplier = 1000000; /*For lm-sensors, unit is micro-Volt.*/ + /*Passing through*/ + case PSU_P_OUT: + value = data->p_out; + break; + case PSU_TEMP1_INPUT: + value = data->temp; + break; + case PSU_FAN1_SPEED: + value = data->fan_speed; + multiplier = 1; + break; + case PSU_FAN1_DUTY_CYCLE: + value = data->fan_duty_cycle[0]; + multiplier = 1; + break; + case PSU_MFR_VIN_MIN: + value = data->mfr_vin_min; + break; + case PSU_MFR_VIN_MAX: + value = data->mfr_vin_max; + break; + case PSU_MFR_VOUT_MIN: + value = data->mfr_vout_min; + break; + case PSU_MFR_VOUT_MAX: + value = data->mfr_vout_max; + break; + case PSU_MFR_PIN_MAX: + value = data->mfr_pin_max; + break; + case PSU_MFR_POUT_MAX: + value = data->mfr_pout_max; + break; + case PSU_MFR_IOUT_MAX: + value = data->mfr_iout_max; + break; + case PSU_MFR_IIN_MAX: + value = data->mfr_iin_max; + break; + } + + exponent = two_complement_to_int(value >> 11, 5, 0x1f); + mantissa = two_complement_to_int(value & 0x7ff, 11, 0x7ff); + return (exponent >= 0) ? sprintf(buf, "%d\n", (mantissa << exponent) * multiplier) : + sprintf(buf, "%d\n", (mantissa * multiplier) / (1 << -exponent)); +} + +static ssize_t show_fan_fault(struct device *dev, struct device_attribute *da, + char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + struct ym2651y_data *data = ym2651y_update_device(dev); + + u8 shift = (attr->index == PSU_FAN1_FAULT) ? 7 : 6; + + return sprintf(buf, "%d\n", data->fan_fault >> shift); +} + +static ssize_t show_over_temp(struct device *dev, struct device_attribute *da, + char *buf) +{ + struct ym2651y_data *data = ym2651y_update_device(dev); + + return sprintf(buf, "%d\n", data->over_temp >> 7); +} + +static ssize_t show_ascii(struct device *dev, struct device_attribute *da, + char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + struct ym2651y_data *data = ym2651y_update_device(dev); + u8 *ptr = NULL; + + switch (attr->index) { + case PSU_FAN_DIRECTION: /* psu_fan_dir */ + if (data->chip==YPEB1200AM) + { + memcpy(data->fan_dir, "F2B", 3); + data->fan_dir[3]='\0'; + } + ptr = data->fan_dir; + break; + case PSU_MFR_ID: /* psu_mfr_id */ + ptr = data->mfr_id; + break; + case PSU_MFR_MODEL: /* psu_mfr_model */ + ptr = data->mfr_model; + break; + case PSU_MFR_REVISION: /* psu_mfr_revision */ + ptr = data->mfr_revsion; + break; + default: + return 0; + } + + return sprintf(buf, "%s\n", ptr); +} + +static ssize_t show_vout_by_mode(struct device *dev, struct device_attribute *da, + char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(da); + struct ym2651y_data *data = ym2651y_update_device(dev); + int exponent, mantissa; + int multiplier = 1000; + + if (!data->valid) { + return 0; + } + + exponent = two_complement_to_int(data->vout_mode, 5, 0x1f); + switch (attr->index) { + case PSU_MFR_VOUT_MIN: + mantissa = data->mfr_vout_min; + break; + case PSU_MFR_VOUT_MAX: + mantissa = data->mfr_vout_max; + break; + case PSU_V_OUT: + mantissa = data->v_out; + break; + default: + return 0; + } + + return (exponent > 0) ? sprintf(buf, "%d\n", (mantissa << exponent) * multiplier) : + sprintf(buf, "%d\n", (mantissa * multiplier) / (1 << -exponent)); +} + +static ssize_t show_vout(struct device *dev, struct device_attribute *da, + char *buf) +{ + struct i2c_client *client = to_i2c_client(dev); + struct ym2651y_data *data = i2c_get_clientdata(client); + u8 *ptr = NULL; + + ptr = data->mfr_model + 1; /* The first byte is the count byte of string. */ + if (data->chip == YM2401) { + return show_vout_by_mode(dev, da, buf); + } + else { + return show_linear(dev, da, buf); + } +} + +static const struct attribute_group ym2651y_group = { + .attrs = ym2651y_attributes, +}; + +static int ym2651y_probe(struct i2c_client *client, + const struct i2c_device_id *dev_id) +{ + struct ym2651y_data *data; + int status; + + if (!i2c_check_functionality(client->adapter, + I2C_FUNC_SMBUS_BYTE_DATA | + I2C_FUNC_SMBUS_WORD_DATA | + I2C_FUNC_SMBUS_I2C_BLOCK)) { + status = -EIO; + goto exit; + } + + data = kzalloc(sizeof(struct ym2651y_data), GFP_KERNEL); + if (!data) { + status = -ENOMEM; + goto exit; + } + + i2c_set_clientdata(client, data); + mutex_init(&data->update_lock); + data->chip = dev_id->driver_data; + dev_info(&client->dev, "chip found\n"); + + /* Register sysfs hooks */ + status = sysfs_create_group(&client->dev.kobj, &ym2651y_group); + if (status) { + goto exit_free; + } + + data->hwmon_dev = hwmon_device_register(&client->dev); + if (IS_ERR(data->hwmon_dev)) { + status = PTR_ERR(data->hwmon_dev); + goto exit_remove; + } + + dev_info(&client->dev, "%s: psu '%s'\n", + dev_name(data->hwmon_dev), client->name); + + return 0; + +exit_remove: + sysfs_remove_group(&client->dev.kobj, &ym2651y_group); +exit_free: + kfree(data); +exit: + + return status; +} + +static int ym2651y_remove(struct i2c_client *client) +{ + struct ym2651y_data *data = i2c_get_clientdata(client); + + hwmon_device_unregister(data->hwmon_dev); + sysfs_remove_group(&client->dev.kobj, &ym2651y_group); + kfree(data); + + return 0; +} + +static const struct i2c_device_id ym2651y_id[] = { + { "ym2651", YM2651 }, + { "ym2401", YM2401 }, + { "ym2851", YM2851 }, + { "ype1200am", YPEB1200AM }, + {} +}; +MODULE_DEVICE_TABLE(i2c, ym2651y_id); + +static struct i2c_driver ym2651y_driver = { + .class = I2C_CLASS_HWMON, + .driver = { + .name = "ym2651", + }, + .probe = ym2651y_probe, + .remove = ym2651y_remove, + .id_table = ym2651y_id, + .address_list = normal_i2c, +}; + +static int ym2651y_read_byte(struct i2c_client *client, u8 reg) +{ + return i2c_smbus_read_byte_data(client, reg); +} + +static int ym2651y_read_word(struct i2c_client *client, u8 reg) +{ + return i2c_smbus_read_word_data(client, reg); +} + +static int ym2651y_write_word(struct i2c_client *client, u8 reg, u16 value) +{ + return i2c_smbus_write_word_data(client, reg, value); +} + +static int ym2651y_read_block(struct i2c_client *client, u8 command, u8 *data, + int data_len) +{ + int result = i2c_smbus_read_i2c_block_data(client, command, data_len, data); + + if (unlikely(result < 0)) + goto abort; + if (unlikely(result != data_len)) { + result = -EIO; + goto abort; + } + + result = 0; + +abort: + return result; +} + +struct reg_data_byte { + u8 reg; + u8 *value; +}; + +struct reg_data_word { + u8 reg; + u16 *value; +}; + +static struct ym2651y_data *ym2651y_update_device(struct device *dev) +{ + struct i2c_client *client = to_i2c_client(dev); + struct ym2651y_data *data = i2c_get_clientdata(client); + + mutex_lock(&data->update_lock); + + if (time_after(jiffies, data->last_updated + HZ + HZ / 2) + || !data->valid) { + int i, status; + u8 command; + u8 fan_dir[5] = {0}; + struct reg_data_byte regs_byte[] = { {0x19, &data->capability}, + {0x20, &data->vout_mode}, + {0x7d, &data->over_temp}, + {0x81, &data->fan_fault}, + {0x98, &data->pmbus_revision} + }; + struct reg_data_word regs_word[] = { {0x79, &data->status_word}, + {0x8b, &data->v_out}, + {0x8c, &data->i_out}, + {0x96, &data->p_out}, + {0x8d, &data->temp}, + {0x3b, &(data->fan_duty_cycle[0])}, + {0x3c, &(data->fan_duty_cycle[1])}, + {0x90, &data->fan_speed}, + {0xa0, &data->mfr_vin_min}, + {0xa1, &data->mfr_vin_max}, + {0xa2, &data->mfr_iin_max}, + {0xa3, &data->mfr_pin_max}, + {0xa4, &data->mfr_vout_min}, + {0xa5, &data->mfr_vout_max}, + {0xa6, &data->mfr_iout_max}, + {0xa7, &data->mfr_pout_max} + }; + + dev_dbg(&client->dev, "Starting ym2651 update\n"); + + /* Read byte data */ + for (i = 0; i < ARRAY_SIZE(regs_byte); i++) { + status = ym2651y_read_byte(client, regs_byte[i].reg); + + if (status < 0) + { + dev_dbg(&client->dev, "reg %d, err %d\n", + regs_byte[i].reg, status); + *(regs_byte[i].value) = 0; + } + else { + *(regs_byte[i].value) = status; + } + } + + /* Read word data */ + for (i = 0; i < ARRAY_SIZE(regs_word); i++) { + status = ym2651y_read_word(client, regs_word[i].reg); + + if (status < 0) + { + dev_dbg(&client->dev, "reg %d, err %d\n", + regs_word[i].reg, status); + *(regs_word[i].value) = 0; + } + else { + *(regs_word[i].value) = status; + } + } + + /* Read fan_direction */ + command = 0xC3; + status = ym2651y_read_block(client, command, fan_dir, ARRAY_SIZE(fan_dir)-1); + + if (status < 0) { + dev_dbg(&client->dev, "reg %d, err %d\n", command, status); + } + + strncpy(data->fan_dir, fan_dir+1, ARRAY_SIZE(data->fan_dir)-1); + data->fan_dir[ARRAY_SIZE(data->fan_dir)-1] = '\0'; + + /* Read mfr_id */ + command = 0x99; + status = ym2651y_read_block(client, command, data->mfr_id, + ARRAY_SIZE(data->mfr_id)-1); + data->mfr_id[ARRAY_SIZE(data->mfr_id)-1] = '\0'; + + if (status < 0) + dev_dbg(&client->dev, "reg %d, err %d\n", command, status); + + /* Read mfr_model */ + command = 0x9a; + status = ym2651y_read_block(client, command, data->mfr_model, + ARRAY_SIZE(data->mfr_model)-1); + data->mfr_model[ARRAY_SIZE(data->mfr_model)-1] = '\0'; + + if (status < 0) + dev_dbg(&client->dev, "reg %d, err %d\n", command, status); + + /* Read mfr_revsion */ + command = 0x9b; + status = ym2651y_read_block(client, command, data->mfr_revsion, + ARRAY_SIZE(data->mfr_revsion)-1); + data->mfr_revsion[ARRAY_SIZE(data->mfr_revsion)-1] = '\0'; + + if (status < 0) + dev_dbg(&client->dev, "reg %d, err %d\n", command, status); + + data->last_updated = jiffies; + data->valid = 1; + } + + mutex_unlock(&data->update_lock); + + return data; +} + +module_i2c_driver(ym2651y_driver); + +MODULE_AUTHOR("Michael Shih "); +MODULE_DESCRIPTION("3Y Power YM-2651Y driver"); +MODULE_LICENSE("GPL"); + + diff --git a/platform/broadcom/sonic-platform-modules-accton/as9726-32d/service/as9726-32d-platform-monitor-fan.service b/platform/broadcom/sonic-platform-modules-accton/as9726-32d/service/as9726-32d-platform-monitor-fan.service new file mode 100644 index 000000000000..ac0114c8f507 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as9726-32d/service/as9726-32d-platform-monitor-fan.service @@ -0,0 +1,16 @@ +[Unit] +Description=Accton AS9726_32D Platform Monitoring FAN service +Before=pmon.service +After=as9726-32d-platform-monitor.service +DefaultDependencies=no + +[Service] +ExecStart=/usr/local/bin/accton_as9726_32d_monitor_fan.py +KillSignal=SIGKILL +SuccessExitStatus=SIGKILL + +# Resource Limitations +LimitCORE=infinity + +[Install] +WantedBy=multi-user.target diff --git a/platform/broadcom/sonic-platform-modules-accton/as9726-32d/service/as9726-32d-platform-monitor-psu.service b/platform/broadcom/sonic-platform-modules-accton/as9726-32d/service/as9726-32d-platform-monitor-psu.service new file mode 100644 index 000000000000..916219c9f7de --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as9726-32d/service/as9726-32d-platform-monitor-psu.service @@ -0,0 +1,16 @@ +[Unit] +Description=Accton AS9726_32D Platform Monitoring PSU service +Before=pmon.service +After=as9726-32d-platform-monitor.service +DefaultDependencies=no + +[Service] +ExecStart=/usr/local/bin/accton_as9726_32d_monitor_psu.py +KillSignal=SIGKILL +SuccessExitStatus=SIGKILL + +# Resource Limitations +LimitCORE=infinity + +[Install] +WantedBy=multi-user.target diff --git a/platform/broadcom/sonic-platform-modules-accton/as9726-32d/service/as9726-32d-platform-monitor.service b/platform/broadcom/sonic-platform-modules-accton/as9726-32d/service/as9726-32d-platform-monitor.service new file mode 100644 index 000000000000..072a8227e7e9 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as9726-32d/service/as9726-32d-platform-monitor.service @@ -0,0 +1,17 @@ +[Unit] +Description=Accton AS9726_32D Platform Monitoring service +Before=pmon.service +After=sysinit.target +DefaultDependencies=no + +[Service] +ExecStartPre=/usr/local/bin/accton_as9726_32d_util.py install +ExecStart=/usr/local/bin/accton_as9726_32d_monitor.py +KillSignal=SIGKILL +SuccessExitStatus=SIGKILL + +# Resource Limitations +LimitCORE=infinity + +[Install] +WantedBy=multi-user.target diff --git a/platform/broadcom/sonic-platform-modules-accton/as9726-32d/setup.py b/platform/broadcom/sonic-platform-modules-accton/as9726-32d/setup.py new file mode 100755 index 000000000000..7b84a9cab7ec --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as9726-32d/setup.py @@ -0,0 +1,14 @@ +#!/usr/bin/env python + +import os +from setuptools import setup +os.listdir + +setup( + name='as9726_32d', + version='1.0', + description='Module to initialize Accton AS9726_32D platforms', + + packages=['as9726_32d'], + package_dir={'as9726_32d': 'as9726-32d/classes'}, +) diff --git a/platform/broadcom/sonic-platform-modules-accton/as9726-32d/sonic_platform_setup.py b/platform/broadcom/sonic-platform-modules-accton/as9726-32d/sonic_platform_setup.py new file mode 100644 index 000000000000..474094b28dcb --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as9726-32d/sonic_platform_setup.py @@ -0,0 +1,34 @@ +from setuptools import setup + +DEVICE_NAME = 'accton' +HW_SKU = 'x86_64-accton_as9726_32d-r0' + +setup( + name='sonic-platform', + version='1.0', + description='SONiC platform API implementation on Accton Platforms', + license='Apache 2.0', + author='SONiC Team', + author_email='linuxnetdev@microsoft.com', + url='https://github.com/Azure/sonic-buildimage', + maintainer='Michael Shih', + maintainer_email='michael_shih@edge-core.com', + packages=[ + 'sonic_platform', + ], + package_dir={ + 'sonic_platform': '../../../../device/{}/{}/sonic_platform'.format(DEVICE_NAME, HW_SKU)}, + classifiers=[ + 'Development Status :: 3 - Alpha', + 'Environment :: Plugins', + 'Intended Audience :: Developers', + 'Intended Audience :: Information Technology', + 'Intended Audience :: System Administrators', + 'License :: OSI Approved :: Apache Software License', + 'Natural Language :: English', + 'Operating System :: POSIX :: Linux', + 'Programming Language :: Python :: 3.7', + 'Topic :: Utilities', + ], + keywords='sonic SONiC platform PLATFORM', +) diff --git a/platform/broadcom/sonic-platform-modules-accton/as9726-32d/utils/README b/platform/broadcom/sonic-platform-modules-accton/as9726-32d/utils/README new file mode 100755 index 000000000000..16efca9ef848 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as9726-32d/utils/README @@ -0,0 +1,65 @@ +Copyright (C) 2019 Accton Networks, Inc. + +This program is free software: you can redistribute it and/or modify +It under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . + +All Linux kernel code is licensed under the GPLv1. All other code is +licensed under the GPLv3. Please see the LICENSE file for copies of +both licenses. + +The code for integacting with Accton AS9726-32D has 2 parts, +kernel drivers and operational script. +The kernel drivers of peripherals are under module/ directory. +1. These drivers are at module dir. +2. A operational script, accton_as9726_32d_util.py, for device initializatian and + peripheral accessing should be installed at /usr/bin. + Run "accton_as9726_32d_util.py install" to install drivers. + +To initialize the system, run "accton_as9726_32d_util.py install". +To clean up the drivers & devices, run "accton_as9726_32d_util.py clean". +To dump information of sensors, run "accton_as9726_32d_util.py show". +To dump SFP EEPROM, run "accton_as9726_32d_util.py sff". +To set fan speed, run "accton_as9726_32d_util.py set fan". +To enable/disable SFP emission, run "accton_as9726_32d_util.py set sfp". +To set system LEDs' color, run "accton_as9726_32d_util.py set led" +For more information, run "accton_as9726_32d_util.py --help". + +==================================================================== +Besides applying accton_as9726_32d_util.py to access peripherals, you can +access peripherals by sysfs nodes directly after the installation is run. + +System LED: + There are 5 system LEDs at the lower-left corner of front panel. + They are loc, diag, psu1, psu2 and fan. + The sysfs interface color mappings are as follows: + Brightness: + 0 => off + 1 => green + 2 => amber + But not all colors are available for each LED. + +Fan Control: + There are 12 fans inside 6 fan modules. + All fans share 1 duty setting, ranged from 0~100. + +Thermal sensers: + 6 temperature sensors are controlled by the lm75 kernel modules. + +PSUs: + There 2 power supplies slot at the left/right side of the back. + Once if a PSU is not plugged, the status of it is shown failed. + +There are 32 QSFP56-DD and 2 SFP+ modules are equipped. +Before operating on PSU and QSFP+, please make sure it is well plugged. +Otherwise, operation is going to fail. + diff --git a/platform/broadcom/sonic-platform-modules-accton/as9726-32d/utils/accton_as9726_32d_monitor.py b/platform/broadcom/sonic-platform-modules-accton/as9726-32d/utils/accton_as9726_32d_monitor.py new file mode 100755 index 000000000000..9d91e942baa2 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as9726-32d/utils/accton_as9726_32d_monitor.py @@ -0,0 +1,565 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -* +# Copyright (c) 2019 Edgecore Networks Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT +# LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS +# FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. +# +# See the Apache Version 2.0 License for specific language governing +# permissions and limitations under the License. +# +# HISTORY: +# mm/dd/yyyy (A.D.)# +# 04/23/2021: Michael_Shih create for as9726_32d thermal plan +# ------------------------------------------------------------------ + +try: + import commands + import getopt + import sys + import logging + import logging.config + import logging.handlers + import time # this is only being used as part of the example + from as9726_32d.fanutil import FanUtil + from as9726_32d.thermalutil import ThermalUtil +except ImportError as e: + raise ImportError('%s - required module not found' % str(e)) + +# Deafults +VERSION = '1.0' +FUNCTION_NAME = '/usr/local/bin/accton_as9726_32d_monitor' + +class switch(object): + def __init__(self, value): + self.value = value + self.fall = False + + def __iter__(self): + """Return the match method once, then stop""" + yield self.match + raise StopIteration + + def match(self, *args): + """Indicate whether or not to enter a case suite""" + if self.fall or not args: + return True + elif self.value in args: # changed for v1.5, see below + self.fall = True + return True + else: + return False + + + +# Read fanN_direction=1: The air flow of Fan6 is “AFI-Back to Front” +# 0: The air flow of Fan6 is “AFO-Front to back” +# +# Thermal policy: +# a.Defaut fan duty_cycle=100% +# b.One fan fail, set to fan duty_cycle=100% +# 1.For AFI: +# Default fan duty_cycle will be 100%(fan_policy_state=LEVEL_FAN_MAX). +# If all below case meet with, set to 75%(LEVEL_FAN_MID). +# MB board +# (MB board) +# LM75-1(0X48)>=49.5 +# LM75-2(0X49)>=42.9 +# LM75-3(0X4A)>=46.3 +# LM75-4(0X4C)>=40.1 +# LM75-6(0X4F)>=39.4 +# (CPU board) +# Core>=46 +# LM75-1(0X4B)>=34.8 + +# When fan_policy_state=LEVEL_FAN_MID, meet with below case, Fan duty_cycle will be 100%(LEVEL_FAN_DAX) +# (MB board) +# LM75-1(0X48)>=55.9 +# LM75-2(0X49)>=48.8 +# LM75-3(0X4A)>=51.5 +# LM75-4(0X4C)>=45.3 +# LM75-6(0X4F)>=43.4 +# (CPU board) +# Core>=50 +# LM75-1(0X4B)>=43.4 + +#Yellow Alarm +#MB board +#LM75-1(0X48)>=57.9 +#LM75-2(0X49)>=51.9 +#LM75-3(0X4A)>=48.9 +#LM75-4(0X4C)>=55.9 +#LM75-6(0X4F)>=48.5 +#CPU Board +#Core>=52 +#LM75-1(0X4B)>=41.8 + +#Red Alarm +#MB board +#LM75-1(0X48)>=62.9 +#LM75-2(0X49)>=56.9 +#LM75-3(0X4A)>=53.9 +#LM75-4(0X4C)>=58.9 +#LM75-6(0X4F)>=53.5 +#CPU Board +#Core>=57 +#LM75-1(0X4B)>=46.8 + +#Shut down +#MB board +#LM75-1(0X48)>=67.9 +#LM75-2(0X49)>=61.9 +#LM75-3(0X4A)>=58.9 +#LM75-4(0X4C)>=63.9 +#LM75-6(0X4F)>=58.5 +#CPU Board +#Core>=62 +#LM75-1(0X4B)>=51.8 + +# 2. For AFO: +# At default, FAN duty_cycle was 100%(LEVEL_FAN_MAX). If all below case meet with, set to 75%(LEVEL_FAN_MID). +# (MB board) +# LM75-1(0X48)<=56 +# LM75-2(0X49)<=53.5 +# LM75-3(0X4A)<=52.5 +# LM75-4(0X4C)<=52 +# LM75-6(0X4F)<=52.8 +# (CPU board) +# Core<=62 +# LM75-1(0X4B)<=45.8 + +# When FAN duty_cycle was 75%(LEVEL_FAN_MID). If all below case meet with, set to 50%(LEVEL_FAN_DEF). +# (MB board) +# LM75-1(0X48)<=50 +# LM75-2(0X49)<=47.3 +# LM75-3(0X4A)<=46.4 +# LM75-4(0X4C)<=44.6 +# LM75-6(0X4F)<=47 +# (CPU board) +# Core<=56 +# LM75-1(0X4B)<=38.8 + +# When fan_speed 50%(LEVEL_FAN_DEF). +# Meet with below case, Fan duty_cycle will be 75%(LEVEL_FAN_MID) +# (MB board) +# LM75-1(0X48)>=63 +# LM75-2(0X49)>=60.5 +# LM75-3(0X4A)>=60 +# LM75-4(0X4C)>=60 +# LM75-6(0X4F)>=61 +# (CPU board) +# Core>=72 +# LM75-1(0X4B)>=50 + +# When FAN duty_cycle was 75%(LEVEL_FAN_MID). If all below case meet with, set to 100%(LEVEL_FAN_MAX). +# (MB board) +# LM75-1(0X48)>=63 +# LM75-2(0X49)>=60 +# LM75-3(0X4A)>=60 +# LM75-4(0X4C)>=59 +# LM75-6(0X4F)>=60 + +# (CPU board) +# Core >=69 +# LM75-1(0X4B)>=51.5 + + +#Yellow Alarm +#MB board +#LM75-1(0X48)>=67 +#LM75-2(0X49)>=65 +#LM75-3(0X4A)>=64 +#LM75-4(0X4C)>=62 +#LM75-6(0X4F)>=64 +#CPU Board +#Core>=73 +#LM75-1(0X4B)>=67 + +#Red Alarm +#MB board +#LM75-1(0X48)>=72 +#LM75-2(0X49)>=70 +#LM75-3(0X4A)>=69 +#LM75-4(0X4C)>=67 +#LM75-6(0X4F)>=69 +#CPU Board +#Core>=78 +#LM75-1(0X4B)>=72 + +#Shut down +#MB board +#LM75-1(0X48)>=77 +#LM75-2(0X49)>=75 +#LM75-3(0X4A)>=74 +#LM75-4(0X4C)>=72 +#LM75-6(0X4F)>=74 +#CPU Board +#Core>=83 +#LM75-1(0X4B)>=77 + +def power_off_dut(): + cmd_str="i2cset -y -f 1 0x60 0x60 0x10" + status, output = commands.getstatusoutput(cmd_str) + return status + +#If only one PSU insert(or one of PSU pwoer fail), and watt >800w. Must let DUT fan pwm >= 75% in AFO. +# Because the psu temp is high. +# Return 1: full load +# Return 0: Not full load +def check_psu_loading(): + psu_power_status=[1, 1] + + psu_power_good = { + 2: "/sys/bus/i2c/devices/9-0051/psu_power_good", + 1: "/sys/bus/i2c/devices/9-0050/psu_power_good", + } + psu_power_out = { + 2: "/sys/bus/i2c/devices/9-0059/psu_p_out", + 1: "/sys/bus/i2c/devices/9-0058/psu_p_out", + } + + check_psu_watt=0 + for i in range(1,3): + node = psu_power_good[i] + try: + with open(node, 'r') as power_status: + status = int(power_status.read()) + except IOError: + return None + + psu_power_status[i-1]=int(status) + if status==0: + check_psu_watt=1 + + if check_psu_watt: + for i in range(1,3): + if psu_power_status[i-1]==1: + #check watt + node = psu_power_out[i] + try: + with open(node, 'r') as power_status: + status = int(power_status.read()) + except IOError: + return None + psu_p_out= int(status) + if psu_p_out/1000 > 800: + return True + else: + return False + + + return False + +fan_policy_state=0 +fan_policy_alarm=0 +send_yellow_alarm=0 +send_red_alarm=0 +fan_fail=0 +count_check=0 + +test_temp = 0 +test_temp_list = [0, 0, 0, 0, 0, 0, 0] +temp_test_data=0 +test_temp_revert=0 + +# Make a class we can use to capture stdout and sterr in the log +class device_monitor(object): + # static temp var + temp = 0 + new_duty_cycle = 0 + duty_cycle=0 + ori_duty_cycle = 0 + + + def __init__(self, log_file, log_level): + """Needs a logger and a logger level.""" + + self.thermal = ThermalUtil() + self.fan = FanUtil() + # set up logging to file + logging.basicConfig( + filename=log_file, + filemode='w', + level=log_level, + format= '[%(asctime)s] {%(pathname)s:%(lineno)d} %(levelname)s - %(message)s', + datefmt='%H:%M:%S' + ) + # set up logging to console + if log_level == logging.DEBUG: + console = logging.StreamHandler() + console.setLevel(log_level) + formatter = logging.Formatter('%(name)-12s: %(levelname)-8s %(message)s') + console.setFormatter(formatter) + logging.getLogger('').addHandler(console) + + sys_handler = logging.handlers.SysLogHandler(address = '/dev/log') + sys_handler.setLevel(logging.WARNING) + logging.getLogger('').addHandler(sys_handler) + #logging.debug('SET. logfile:%s / loglevel:%d', log_file, log_level) + + + def manage_fans(self): + + global fan_policy_state + global fan_policy_alarm + global send_yellow_alarm + global send_red_alarm + global fan_fail + global count_check + global test_temp + global test_temp_list + global temp_test_data + global test_temp_revert + + CHECK_TIMES=3 + + LEVEL_FAN_INIT=0 + LEVEL_FAN_MIN=1 + LEVEL_FAN_MID=2 + LEVEL_FAN_MAX=3 + LEVEL_FAN_YELLOW_ALARM=4 + LEVEL_FAN_RED_ALARM=5 + LEVEL_FAN_SHUTDOWN=6 + + fan_policy_f2b = { #AFO + LEVEL_FAN_MIN: [50, 0x7], + LEVEL_FAN_MID: [75, 0xb], + LEVEL_FAN_MAX: [100, 0xf] + } + fan_policy_b2f = { #AFI + LEVEL_FAN_MID: [75, 0xb], + LEVEL_FAN_MAX: [100, 0xf] + } + + afi_thermal_spec={ + "mid_to_max_temp":[61500, 51500, 49400, 49400, 45100, 46750, 48000, 38500], + "max_to_mid_temp":[57000, 47300, 45000, 45100, 40750, 42100, 44000, 35000], + "max_to_yellow_alarm": [57900, 51900, 48900, 55900, 48500, 52000, 41800], + "yellow_to_red_alarm": [62900, 56900, 53900, 58900, 53500, 57000, 46800], + "red_alarm_to_shutdown": [67900, 61900, 58900, 63900, 58500, 62000, 51800] + } + afo_thermal_spec={ + "min_to_mid_temp": [63000, 60500, 60000, 60000, 61000, 72000, 50000], + "mid_to_max_temp": [63000, 60000, 60000, 59000, 60000, 69000, 51500], + "max_to_mid_temp": [56000, 53500, 52500, 52000, 52800, 62000, 45800], + "mid_to_min_temp": [50000, 47300, 46400, 44600, 47000, 56000, 38800], + "max_to_yellow_alarm": [67000, 65000, 64000, 62000, 64000, 73000, 67000], + "yellow_to_red_alarm": [72000, 70000, 69000, 67000, 69000, 78000, 72000], + "red_alarm_to_shutdown": [77000, 75000, 74000, 72000, 74000, 83000, 77000] + } + + thermal_val=[0,0,0,0,0,0,0] + max_to_mid=0 + mid_to_min=0 + + fan = self.fan + if fan_policy_state==LEVEL_FAN_INIT: + fan_policy_state=LEVEL_FAN_MAX #This is default state + logging.debug("fan_policy_state=LEVEL_FAN_MAX") + return + + count_check=count_check+1 + if count_check < CHECK_TIMES: + return + else: + count_check=0 + + thermal = self.thermal + fan_dir=fan.get_fan_dir(1) + + if fan_dir==1: # AFI + fan_thermal_spec = afi_thermal_spec + fan_policy=fan_policy_b2f + elif fan_dir==0: # AFO + fan_thermal_spec = afo_thermal_spec + fan_policy=fan_policy_f2b + else: + logging.debug( "NULL case") + + ori_duty_cycle=fan.get_fan_duty_cycle() + new_duty_cycle=0 + + if test_temp_revert==0: + temp_test_data=temp_test_data+2000 + else: + temp_test_data=temp_test_data-2000 + + if test_temp==0: + for i in range (thermal.THERMAL_NUM_1_IDX, thermal.THERMAL_NUM_MAX+1): + thermal_val[i-1]=thermal._get_thermal_val(i) + else: + for i in range (thermal.THERMAL_NUM_1_IDX, thermal.THERMAL_NUM_MAX+1): + thermal_val[i-1]=test_temp_list[i-1] + thermal_val[i-1]= thermal_val[i-1] + temp_test_data + logging.debug(thermal_val) + fan_fail=0 + + ori_state=fan_policy_state; + current_state=fan_policy_state; + + if fan_dir==1: #AFI + for i in range (0, thermal.THERMAL_NUM_MAX): + if ori_state==LEVEL_FAN_MID: + if thermal_val[i] >= fan_thermal_spec["mid_to_max_temp"][i]: + current_state=LEVEL_FAN_MAX + logging.debug("current_state=LEVEL_FAN_MAX") + break + else: + if (thermal_val[i] <= fan_thermal_spec["max_to_mid_temp"][i]): + max_to_mid=max_to_mid+1 + if fan_policy_alarm==0: + if thermal_val[i] >= fan_thermal_spec["max_to_yellow_alarm"][i]: + if send_yellow_alarm==0: + logging.warning('Alarm-Yellow for temperature high is detected') + fan_policy_alarm=LEVEL_FAN_YELLOW_ALARM + send_yellow_alarm=1 + elif fan_policy_alarm==LEVEL_FAN_YELLOW_ALARM: + if thermal_val[i] >= fan_thermal_spec["yellow_to_red_alarm"][i]: + if send_red_alarm==0: + logging.warning('Alarm-Red for temperature high is detected') + fan_policy_alarm=LEVEL_FAN_RED_ALARM + send_red_alarm=1 + elif fan_policy_alarm==LEVEL_FAN_RED_ALARM: + if thermal_val[i] >= fan_thermal_spec["red_alarm_to_shutdown"][i]: + logging.critical('Alarm-Critical for temperature high is detected, shutdown DUT') + fan_policy_alarm=LEVEL_FAN_SHUTDOWN + time.sleep(2) + power_off_dut() + + if max_to_mid==thermal.THERMAL_NUM_MAX and fan_policy_state==LEVEL_FAN_MAX: + current_state=LEVEL_FAN_MID + if fan_policy_alarm!=0: + logging.warning('Alarm for temperature high is cleared') + fan_policy_alarm=0 + send_yellow_alarm=0 + send_red_alarm=0 + test_temp_revert=0 + logging.debug("current_state=LEVEL_FAN_MID") + + else: #AFO + psu_full_load=check_psu_loading() + for i in range (0, thermal.THERMAL_NUM_MAX): + if ori_state==LEVEL_FAN_MID: + if thermal_val[i] >= fan_thermal_spec["mid_to_max_temp"][i]: + current_state=LEVEL_FAN_MAX + break + else: + if psu_full_load!=True and thermal_val[i] <= fan_thermal_spec["mid_to_min_temp"][i]: + mid_to_min=mid_to_min+1 + + elif ori_state==LEVEL_FAN_MIN: + if psu_full_load==True: + current_state=LEVEL_FAN_MID + logging.debug("psu_full_load, set current_state=LEVEL_FAN_MID") + if thermal_val[i] >= fan_thermal_spec["min_to_mid_temp"][i]: + current_state=LEVEL_FAN_MID + + else: + if thermal_val[i] <= fan_thermal_spec["max_to_mid_temp"][i] : + max_to_mid=max_to_mid+1 + if fan_policy_alarm==0: + if thermal_val[i] >= fan_thermal_spec["max_to_yellow_alarm"][i]: + if send_yellow_alarm==0: + logging.warning('Alarm-Yellow for temperature high is detected') + fan_policy_alarm=LEVEL_FAN_YELLOW_ALARM + send_yellow_alarm=1 + elif fan_policy_alarm==LEVEL_FAN_YELLOW_ALARM: + if thermal_val[i] >= fan_thermal_spec["yellow_to_red_alarm"][i]: + if send_red_alarm==0: + logging.warning('Alarm-Red for temperature high is detected') + fan_policy_alarm=LEVEL_FAN_RED_ALARM + send_red_alarm=1 + elif fan_policy_alarm==LEVEL_FAN_RED_ALARM: + if thermal_val[i] >= fan_thermal_spec["red_alarm_to_shutdown"][i]: + logging.critical('Alarm-Critical for temperature high is detected, shutdown DUT') + fan_policy_alarm=LEVEL_FAN_SHUTDOWN + time.sleep(2) + power_off_dut() + + if max_to_mid==thermal.THERMAL_NUM_MAX and ori_state==LEVEL_FAN_MAX: + current_state=LEVEL_FAN_MID + if fan_policy_alarm!=0: + logging.warning('Alarm for temperature high is cleared') + fan_policy_alarm=0 + send_yellow_alarm=0 + send_red_alarm=0 + test_temp_revert=0 + logging.debug("current_state=LEVEL_FAN_MID") + + if mid_to_min==thermal.THERMAL_NUM_MAX and ori_state==LEVEL_FAN_MID: + if psu_full_load==0: + current_state=LEVEL_FAN_MIN + logging.debug("current_state=LEVEL_FAN_MIN") + + #Check Fan fault status. True: fan not fault/present, 1: fan fault/un-present + for i in range (fan.FAN_NUM_1_IDX, fan.FAN_NUM_ON_MAIN_BROAD+1): + if fan.get_fan_status(i)==False: + new_duty_cycle=100 + current_state=LEVEL_FAN_MAX + logging.debug('fan_%d fail, set duty_cycle to 100',i) + if test_temp==0: + fan_fail=1 + fan.set_fan_duty_cycle(new_duty_cycle) + break + else: + fan_fail=0 + + if current_state!=ori_state: + fan_policy_state=current_state + new_duty_cycle=fan_policy[current_state][0] + logging.debug("fan_policy_state=%d, new_duty_cycle=%d", fan_policy_state, new_duty_cycle) + if new_duty_cycle!=ori_duty_cycle and fan_fail==0: + fan.set_fan_duty_cycle(new_duty_cycle) + return True + if new_duty_cycle==0 and fan_fail==0: + fan.set_fan_duty_cycle(FAN_DUTY_CYCLE_MAX) + + return True + +def main(argv): + log_file = '%s.log' % FUNCTION_NAME + log_level = logging.INFO + global test_temp + if len(sys.argv) != 1: + try: + opts, args = getopt.getopt(argv,'hdlt:',['lfile=']) + except getopt.GetoptError: + print 'Usage: %s [-d] [-l ]' % sys.argv[0] + return 0 + for opt, arg in opts: + if opt == '-h': + print 'Usage: %s [-d] [-l ]' % sys.argv[0] + return 0 + elif opt in ('-d', '--debug'): + log_level = logging.DEBUG + elif opt in ('-l', '--lfile'): + log_file = arg + + if sys.argv[1]== '-t': + if len(sys.argv)!=9: + print "temp test, need input 7 temp" + return 0 + i=0 + for x in range(2, 9): + test_temp_list[i]= int(sys.argv[x])*1000 + i=i+1 + test_temp = 1 + log_level = logging.DEBUG + print test_temp_list + + fan = FanUtil() + fan.set_fan_duty_cycle(100) + monitor = device_monitor(log_file, log_level) + # Loop forever, doing something useful hopefully: + while True: + monitor.manage_fans() + time.sleep(3) + +if __name__ == '__main__': + main(sys.argv[1:]) diff --git a/platform/broadcom/sonic-platform-modules-accton/as9726-32d/utils/accton_as9726_32d_monitor_fan.py b/platform/broadcom/sonic-platform-modules-accton/as9726-32d/utils/accton_as9726_32d_monitor_fan.py new file mode 100755 index 000000000000..0e3d8ee08a63 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as9726-32d/utils/accton_as9726_32d_monitor_fan.py @@ -0,0 +1,186 @@ +#!/usr/bin/env python +# +# Copyright (C) 2018 Accton Technology Corporation +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# ------------------------------------------------------------------ +# HISTORY: +# mm/dd/yyyy (A.D.) +# 04/23/2021: Michael_Shih create for as9726-32d +# ------------------------------------------------------------------ + +try: + import getopt + import sys + import logging + import logging.config + import logging.handlers + import time # this is only being used as part of the example +except ImportError as e: + raise ImportError('%s - required module not found' % str(e)) + +# Deafults +VERSION = '1.0' +FUNCTION_NAME = '/usr/local/bin/accton_as9726_32d_monitor_fan' + +class switch(object): + def __init__(self, value): + self.value = value + self.fall = False + + def __iter__(self): + """Return the match method once, then stop""" + yield self.match + raise StopIteration + + def match(self, *args): + """Indicate whether or not to enter a case suite""" + if self.fall or not args: + return True + elif self.value in args: # changed for v1.5, see below + self.fall = True + return True + else: + return False + + +fan_state=[2, 2, 2, 2, 2, 2] #init state=2, insert=1, remove=0 +fan_status_state=[2, 2, 2, 2, 2, 2] #init state=2, fault=1, normal=0 +# Make a class we can use to capture stdout and sterr in the log +class device_monitor(object): + + def __init__(self, log_file, log_level): + + self.fan_num = 6 + self.fan_path = "/sys/bus/i2c/devices/14-0066/" + self.present = { + 0: "fan1_present", + 1: "fan2_present", + 2: "fan3_present", + 3: "fan4_present", + 4: "fan5_present", + 5: "fan6_present", + } + + self.fault = { + 0: "fan1_fault", + 1: "fan2_fault", + 2: "fan3_fault", + 3: "fan4_fault", + 4: "fan5_fault", + 5: "fan6_fault", + } + + + """Needs a logger and a logger level.""" + # set up logging to file + logging.basicConfig( + filename=log_file, + filemode='w', + level=log_level, + format= '[%(asctime)s] {%(pathname)s:%(lineno)d} %(levelname)s - %(message)s', + datefmt='%H:%M:%S' + ) + + # set up logging to console + if log_level == logging.DEBUG: + console = logging.StreamHandler() + console.setLevel(logging.DEBUG) + formatter = logging.Formatter('%(name)-12s: %(levelname)-8s %(message)s') + console.setFormatter(formatter) + logging.getLogger('').addHandler(console) + + sys_handler = logging.handlers.SysLogHandler(address = '/dev/log') + #sys_handler.setLevel(logging.WARNING) + sys_handler.setLevel(logging.INFO) + logging.getLogger('').addHandler(sys_handler) + + + #logging.debug('SET. logfile:%s / loglevel:%d', log_file, log_level) + + def manage_fan(self): + + FAN_STATE_REMOVE = 0 + FAN_STATE_INSERT = 1 + + FAN_STATUS_FAULT = 1 + FAN_STATUS_NORMAL = 0 + + global fan_state + global fan_status_state + + for idx in range (0, self.fan_num): + node = self.fan_path + self.present[idx] + try: + val_file = open(node) + except IOError as e: + print "Error: unable to open file: %s" % str(e) + return False + content = val_file.readline().rstrip() + val_file.close() + # content is a string, either "0" or "1" + if content == "1": + if fan_state[idx]!=1: + fan_state[idx]=FAN_STATE_INSERT + logging.info("FAN-%d present is detected", idx+1); + else: + if fan_state[idx]!=0: + fan_state[idx]=FAN_STATE_REMOVE + logging.warning("Alarm for FAN-%d absent is detected", idx+1) + + for idx in range (0, self.fan_num): + node = self.fan_path + self.fault[idx] + try: + val_file = open(node) + except IOError as e: + print "Error: unable to open file: %s" % str(e) + return False + content = val_file.readline().rstrip() + val_file.close() + # content is a string, either "0" or "1" + if content == "1": + if fan_status_state[idx]!=FAN_STATUS_FAULT: + if fan_state[idx] == FAN_STATE_INSERT: + logging.warning("Alarm for FAN-%d failed is detected", idx+1); + fan_status_state[idx]=FAN_STATUS_FAULT + else: + fan_status_state[idx]=FAN_STATUS_NORMAL + + return True + +def main(argv): + log_file = '%s.log' % FUNCTION_NAME + log_level = logging.INFO + if len(sys.argv) != 1: + try: + opts, args = getopt.getopt(argv,'hdl:',['lfile=']) + except getopt.GetoptError: + print 'Usage: %s [-d] [-l ]' % sys.argv[0] + return 0 + for opt, arg in opts: + if opt == '-h': + print 'Usage: %s [-d] [-l ]' % sys.argv[0] + return 0 + elif opt in ('-d', '--debug'): + log_level = logging.DEBUG + elif opt in ('-l', '--lfile'): + log_file = arg + monitor = device_monitor(log_file, log_level) + while True: + monitor.manage_fan() + time.sleep(3) + +if __name__ == '__main__': + main(sys.argv[1:]) diff --git a/platform/broadcom/sonic-platform-modules-accton/as9726-32d/utils/accton_as9726_32d_monitor_psu.py b/platform/broadcom/sonic-platform-modules-accton/as9726-32d/utils/accton_as9726_32d_monitor_psu.py new file mode 100755 index 000000000000..d9159c38bcf1 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as9726-32d/utils/accton_as9726_32d_monitor_psu.py @@ -0,0 +1,159 @@ +#!/usr/bin/env python +# +# Copyright (C) 2018 Accton Technology Corporation +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# ------------------------------------------------------------------ +# HISTORY: +# mm/dd/yyyy (A.D.) +# 04/23/2021: Michael_shih create for as9726-32d +# ------------------------------------------------------------------ + +try: + import getopt + import sys + import logging + import logging.config + import logging.handlers + import time # this is only being used as part of the example +except ImportError as e: + raise ImportError('%s - required module not found' % str(e)) + +# Deafults +VERSION = '1.0' +FUNCTION_NAME = '/usr/local/bin/accton_as9726_32d_monitor_psu' + +psu_state=[2, 2] +psu_status_state=[2, 2] +# Make a class we can use to capture stdout and sterr in the log +class device_monitor(object): + + def __init__(self, log_file, log_level): + + self.psu_num = 2 + self.psu_path = "/sys/bus/i2c/devices/" + self.presence = "/psu_present" + self.oper_status = "/psu_power_good" + self.mapping = { + 0: "9-0050", + 1: "9-0051", + } + + """Needs a logger and a logger level.""" + # set up logging to file + logging.basicConfig( + filename=log_file, + filemode='w', + level=log_level, + format= '[%(asctime)s] {%(pathname)s:%(lineno)d} %(levelname)s - %(message)s', + datefmt='%H:%M:%S' + ) + # set up logging to console + + if log_level == logging.DEBUG: + console = logging.StreamHandler() + console.setLevel(log_level) + formatter = logging.Formatter('%(name)-12s: %(levelname)-8s %(message)s') + console.setFormatter(formatter) + logging.getLogger('').addHandler(console) + + sys_handler = logging.handlers.SysLogHandler(address = '/dev/log') + #sys_handler.setLevel(logging.WARNING) + sys_handler.setLevel(logging.INFO) + logging.getLogger('').addHandler(sys_handler) + + #logging.debug('SET. logfile:%s / loglevel:%d', log_file, log_level) + + def manage_psu(self): + + PSU_STATE_REMOVE = 0 + PSU_STATE_INSERT = 1 + + PSU_STATUS_NO_POWER = 0 + PSU_STATUS_POWER_GOOD = 1 + PSU_STATUS_IDLE =2 + + global psu_state + + for idx in range (0, self.psu_num): + node = self.psu_path + self.mapping[idx] + self.presence + try: + val_file = open(node) + except IOError as e: + print "Error: unable to open file: %s" % str(e) + return False + content = val_file.readline().rstrip() + val_file.close() + # content is a string, either "0" or "1" + if content == "1": + if psu_state[idx]!=1: + psu_state[idx]=PSU_STATE_INSERT + logging.info("PSU-%d present is detected", idx+1); + #psu_status_state[idx]=PSU_STATUS_POWER_GOOD #when insert, assume power is good. If no_power, next code will find it. + else: + if psu_state[idx]!=0: + psu_state[idx]=PSU_STATE_REMOVE + logging.warning("Alarm for PSU-%d absent is detected", idx+1); + psu_status_state[idx]=PSU_STATUS_IDLE + + for idx in range (0, self.psu_num): + node = self.psu_path + self.mapping[idx] + self.oper_status + try: + val_file = open(node) + except IOError as e: + print "Error: unable to open file: %s" % str(e) + return False + content = val_file.readline().rstrip() + val_file.close() + # content is a string, either "0" or "1" + if content == "0": + if psu_status_state[idx]!=PSU_STATUS_NO_POWER: + if psu_state[idx]==PSU_STATE_INSERT: + logging.warning("Alarm for PSU-%d failed is detected", idx+1); + psu_status_state[idx]=PSU_STATUS_NO_POWER + else: + if psu_state[idx]==PSU_STATE_INSERT: + if psu_status_state[idx]!=PSU_STATUS_POWER_GOOD: + logging.info("PSU-%d power_good is detected", idx+1); + psu_status_state[idx]=PSU_STATUS_POWER_GOOD + + + return True + +def main(argv): + log_file = '%s.log' % FUNCTION_NAME + log_level = logging.INFO + if len(sys.argv) != 1: + try: + opts, args = getopt.getopt(argv,'hdl:',['lfile=']) + except getopt.GetoptError: + print 'Usage: %s [-d] [-l ]' % sys.argv[0] + return 0 + for opt, arg in opts: + if opt == '-h': + print 'Usage: %s [-d] [-l ]' % sys.argv[0] + return 0 + elif opt in ('-d', '--debug'): + log_level = logging.DEBUG + elif opt in ('-l', '--lfile'): + log_file = arg + monitor = device_monitor(log_file, log_level) + # Loop forever, doing something useful hopefully: + while True: + monitor.manage_psu() + time.sleep(3) + +if __name__ == '__main__': + main(sys.argv[1:]) diff --git a/platform/broadcom/sonic-platform-modules-accton/as9726-32d/utils/accton_as9726_32d_util.py b/platform/broadcom/sonic-platform-modules-accton/as9726-32d/utils/accton_as9726_32d_util.py new file mode 100755 index 000000000000..d686a77b91c5 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/as9726-32d/utils/accton_as9726_32d_util.py @@ -0,0 +1,680 @@ +#!/usr/bin/env python +# +# Copyright (C) 2016 Accton Networks, Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +""" +Usage: %(scriptName)s [options] command object +options: + -h | --help : this help message + -d | --debug : run with debug mode + -f | --force : ignore error during installation or clean +command: + install : install drivers and generate related sysfs nodes + clean : uninstall drivers and remove related sysfs nodes + show : show all systen status + sfp : dump SFP eeprom + set : change board setting with fan|sfp +""" + +import commands +import getopt +import sys +import logging +import re +import time +import os + +PROJECT_NAME = 'as9726_32d' +version = '0.0.1' +verbose = False +DEBUG = False +args = [] +ALL_DEVICE = {} +DEVICE_NO = { + 'fan1': 3, + 'fan2': 3, + 'fan3': 3, + 'fan4': 3, + 'fan5': 3, + 'fan6': 3, + 'thermal': 6, + 'psu': 2, + 'sfp': 34} + +fan_prefix = '/sys/devices/platform/as9726_32d_' +hwmon_types = {'fan1': ['fan'], + 'fan2': ['fan'], + 'fan3': ['fan'], + 'fan4': ['fan'], + 'fan5': ['fan'], + 'fan6': ['fan'], + } +hwmon_nodes = { + 'fan1': [ + 'fan_duty_cycle_percentage', + 'fan1_fault', + 'fan1_front_speed_rpm', + 'fan1_direction', + 'fan1_rear_speed_rpm'], + 'fan2': [ + 'fan_duty_cycle_percentage', + 'fan2_fault', + 'fan2_front_speed_rpm', + 'fan2_direction', + 'fan2_rear_speed_rpm'], + 'fan3': [ + 'fan_duty_cycle_percentage', + 'fan3_fault', + 'fan3_front_speed_rpm', + 'fan3_direction', + 'fan3_rear_speed_rpm'], + 'fan4': [ + 'fan4_duty_cycle_percentage', + 'fan4_fault', + 'fan4_front_speed_rpm', + 'fan4_direction', + 'fan4_rear_speed_rpm'], + 'fan5': [ + 'fan_duty_cycle_percentage', + 'fan5_fault', + 'fan5_front_speed_rpm', + 'fan5_direction', + 'fan5_rear_speed_rpm'], + 'fan6': [ + 'fan_duty_cycle_percentage', + 'fan6_fault', + 'fan6_front_speed_rpm', + 'fan6_direction', + 'fan6_rear_speed_rpm'], +} +hwmon_prefix = {'fan1': fan_prefix, + 'fan2': fan_prefix, + 'fan3': fan_prefix, + 'fan4': fan_prefix, + 'fan5': fan_prefix, + 'fan6': fan_prefix, + } + +i2c_prefix = '/sys/bus/i2c/devices/' +i2c_bus = {'fan': ['14-0066'], + 'thermal': ['15-0048', '15-0049', '15-004a', '15-004b', '15-004c', '15-004f'], + 'psu': ['9-0050', '9-0051'], + 'sfp': ['10-0061', '10-0062']} +i2c_nodes = {'fan': ['present', 'front_speed_rpm', 'rear_speed_rpm'], + 'thermal': ['hwmon/hwmon*/temp1_input'], + 'psu': ['psu_present ', 'psu_power_good'], + 'sfp': ['module_present_', 'module_tx_disable_']} + +sfp_map = [17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50] + +mknod = [ + # i2c-mux + 'echo pca9548 0x77 > /sys/bus/i2c/devices/i2c-0/new_device', + 'echo pca9548 0x71 > /sys/bus/i2c/devices/i2c-1/new_device', + 'echo pca9548 0x72 > /sys/bus/i2c/devices/i2c-1/new_device', + 'echo pca9548 0x73 > /sys/bus/i2c/devices/i2c-1/new_device', + 'echo pca9548 0x74 > /sys/bus/i2c/devices/i2c-1/new_device', + 'echo pca9548 0x75 > /sys/bus/i2c/devices/i2c-1/new_device', + 'echo pca9548 0x76 > /sys/bus/i2c/devices/i2c-1/new_device', + + # CPLD + 'echo as9726_32d_cpld_cpu 0x65 > /sys/bus/i2c/devices/i2c-1/new_device', + 'echo as9726_32d_fpga 0x60 > /sys/bus/i2c/devices/i2c-1/new_device', + 'echo as9726_32d_cpld2 0x61 > /sys/bus/i2c/devices/i2c-10/new_device', + 'echo as9726_32d_cpld3 0x62 > /sys/bus/i2c/devices/i2c-10/new_device', + + # FAN + 'echo as9726_32d_fan 0x66 > /sys/bus/i2c/devices/i2c-14/new_device', + + # LM75 + 'echo lm75 0x48 > /sys/bus/i2c/devices/i2c-15/new_device', + 'echo lm75 0x49 > /sys/bus/i2c/devices/i2c-15/new_device', + 'echo lm75 0x4a > /sys/bus/i2c/devices/i2c-15/new_device', + 'echo lm75 0x4b > /sys/bus/i2c/devices/i2c-15/new_device', + 'echo lm75 0x4c > /sys/bus/i2c/devices/i2c-15/new_device', + 'echo lm75 0x4f > /sys/bus/i2c/devices/i2c-15/new_device', + + # PSU-1 + 'echo ym2401 0x58 > /sys/bus/i2c/devices/i2c-9/new_device', + 'echo as9726_32d_psu1 0x50 > /sys/bus/i2c/devices/i2c-9/new_device', + + # PSU-2 + 'echo ym2401 0x59 > /sys/bus/i2c/devices/i2c-9/new_device', + 'echo as9726_32d_psu2 0x51 > /sys/bus/i2c/devices/i2c-9/new_device', + + # CPU EERPOM + 'echo 24c02 0x57 > /sys/bus/i2c/devices/i2c-1/new_device', + # MAINBOARD EEPROM + 'echo 24c02 0x56 > /sys/bus/i2c/devices/i2c-13/new_device', +] + +FORCE = 0 + +def main(): + global DEBUG + global args + global FORCE + + if len(sys.argv) < 2: + show_help() + + options, args = getopt.getopt(sys.argv[1:], 'hdf', ['help', + 'debug', + 'force', + ]) + if DEBUG: + print options + print args + print len(sys.argv) + + for opt, arg in options: + if opt in ('-h', '--help'): + show_help() + elif opt in ('-d', '--debug'): + DEBUG = True + logging.basicConfig(level=logging.INFO) + elif opt in ('-f', '--force'): + FORCE = 1 + else: + print "TEST" + logging.info('no option') + for arg in args: + if arg == 'install': + do_install() + elif arg == 'clean': + do_uninstall() + elif arg == 'api': + do_sonic_platform_install() + elif arg == 'api_clean': + do_sonic_platform_clean() + elif arg == 'show': + device_traversal() + elif arg == 'sff': + if len(args) != 2: + show_eeprom_help() + elif int(args[1]) == 0 or int(args[1]) > DEVICE_NO['sfp']: + show_eeprom_help() + else: + show_eeprom(args[1]) + return + elif arg == 'set': + if len(args) < 3: + show_set_help() + else: + set_device(args[1:]) + return + else: + show_help() + + return 0 + + +def show_help(): + print __doc__ % {'scriptName': sys.argv[0].split("/")[-1]} + sys.exit(0) + + +def show_set_help(): + cmd = sys.argv[0].split("/")[-1] + " " + args[0] + print cmd + " [sfp|fan]" + print " use \"" + cmd + " fan 0-100\" to set fan duty percetage" + print " use \"" + cmd + " sfp 33-34 {0|1}\" to set sfp# tx_disable" + sys.exit(0) + + +def show_eeprom_help(): + cmd = sys.argv[0].split("/")[-1] + " " + args[0] + print " use \"" + cmd + " 1-32 \" to dump sfp# eeprom" + sys.exit(0) + + +def my_log(txt): + if DEBUG: + print "[ACCTON DBG]: " + txt + return + + +def log_os_system(cmd, show): + logging.info('Run :' + cmd) + output = "" + status, output = commands.getstatusoutput(cmd) + my_log(cmd + "with result:" + str(status)) + my_log("cmd:" + cmd) + my_log(" output:" + output) + if status: + logging.info('Failed :' + cmd) + if show: + print('Failed :' + cmd) + return status, output + + +def driver_inserted(): + ret, lsmod = log_os_system("ls /sys/module/*accton*", 0) + logging.info('mods:' + lsmod) + if ret: + return False + +#'modprobe cpr_4011_4mxx', + + +kos = [ + 'depmod -ae', + 'modprobe i2c_dev', + 'modprobe i2c_mux_pca954x force_deselect_on_exit=1', + 'modprobe ym2651y', + 'modprobe x86-64-accton-as9726-32d_cpld', + 'modprobe x86-64-accton-as9726-32d_fan', + 'modprobe x86-64-accton-as9726-32d_psu', + 'modprobe optoe', + 'modprobe lm75'] + + +def driver_install(): + global FORCE + + for i in range(0, len(kos)): + status, output = log_os_system(kos[i], 1) + if status: + if FORCE == 0: + return status + return 0 + + +def driver_uninstall(): + global FORCE + for i in range(0, len(kos)): + rm = kos[-(i + 1)].replace("modprobe", "modprobe -rq") + lst = rm.split(" ") + print "lst=%s" % lst + if len(lst) > 3: + del(lst[3]) + rm = " ".join(lst) + status, output = log_os_system(rm, 1) + if status: + if FORCE == 0: + return status + return 0 + + +def device_install(): + global FORCE + + for i in range(0, len(mknod)): + # for pca954x need times to built new i2c buses + if mknod[i].find('pca954') != -1: + time.sleep(2) + + status, output = log_os_system(mknod[i], 1) + if status: + print output + if FORCE == 0: + return status + print("Check SFP") + for i in range(0, len(sfp_map)): + if(i >= (len(sfp_map)-2)): + opt = 'optoe2' #last 2 port is sfp + else: + opt = 'optoe1' #first 32 port is qsfp + status, output = log_os_system("echo " + + str(opt) + + " 0x50 > /sys/bus/i2c/devices/i2c-" + + str(sfp_map[i]) + + "/new_device", 1) + if status: + print output + if FORCE == 0: + return status + + status, output = log_os_system("echo port" + + str(i) + + " > /sys/bus/i2c/devices/" + + str(sfp_map[i]) + + "-0050/port_name", 1) + if status: + print output + if FORCE == 0: + return status + + return + + +def device_uninstall(): + global FORCE + + for i in range(0, len(sfp_map)): + target = "/sys/bus/i2c/devices/i2c-" + \ + str(sfp_map[i]) + "/delete_device" + status, output = log_os_system("echo 0x50 > " + target, 1) + if status: + print output + if FORCE == 0: + return status + + nodelist = mknod + + for i in range(len(nodelist)): + target = nodelist[-(i + 1)] + temp = target.split() + del temp[1] + temp[-1] = temp[-1].replace('new_device', 'delete_device') + status, output = log_os_system(" ".join(temp), 1) + if status: + print output + if FORCE == 0: + return status + + return + + +def system_ready(): + if driver_inserted() == False: + return False + if not device_exist(): + print "not device_exist()" + return False + return True + +PLATFORM_ROOT_PATH = '/usr/share/sonic/device' +PLATFORM_API2_WHL_FILE_PY3 ='sonic_platform-1.0-py3-none-any.whl' +def do_sonic_platform_install(): + device_path = "{}{}{}{}".format(PLATFORM_ROOT_PATH, '/x86_64-accton_', PROJECT_NAME, '-r0') + SONIC_PLATFORM_BSP_WHL_PKG_PY3 = "/".join([device_path, PLATFORM_API2_WHL_FILE_PY3]) + + #Check API2.0 on py whl file + status, output = log_os_system("pip3 show sonic-platform > /dev/null 2>&1", 0) + if status: + if os.path.exists(SONIC_PLATFORM_BSP_WHL_PKG_PY3): + status, output = log_os_system("pip3 install "+ SONIC_PLATFORM_BSP_WHL_PKG_PY3, 1) + if status: + print "Error: Failed to install {}".format(PLATFORM_API2_WHL_FILE_PY3) + return status + else: + print "Successfully installed {} package".format(PLATFORM_API2_WHL_FILE_PY3) + else: + print('{} is not found'.format(PLATFORM_API2_WHL_FILE_PY3)) + else: + print('{} has installed'.format(PLATFORM_API2_WHL_FILE_PY3)) + + return + +def do_sonic_platform_clean(): + status, output = log_os_system("pip3 show sonic-platform > /dev/null 2>&1", 0) + if status: + print('{} does not install, not need to uninstall'.format(PLATFORM_API2_WHL_FILE_PY3)) + + else: + status, output = log_os_system("pip3 uninstall sonic-platform -y", 0) + if status: + print('Error: Failed to uninstall {}'.format(PLATFORM_API2_WHL_FILE_PY3)) + return status + else: + print('{} is uninstalled'.format(PLATFORM_API2_WHL_FILE_PY3)) + + return + + +def do_install(): + if driver_inserted() == False: + status = driver_install() + if status: + if FORCE == 0: + return status + else: + print PROJECT_NAME.upper() + " drivers detected...." + if not device_exist(): + status = device_install() + if status: + if FORCE == 0: + return status + else: + print PROJECT_NAME.upper() + " devices detected...." + +# for i in range(len(cpld_set)): +# status, output = log_os_system(cpld_set[i], 1) +# if status: +# if FORCE == 0: +# return status + + do_sonic_platform_install() + + return + + +def do_uninstall(): + if not device_exist(): + print PROJECT_NAME.upper() + " has no device installed...." + else: + print "Removing device...." + status = device_uninstall() + if status: + if FORCE == 0: + return status + + if driver_inserted() == False: + print PROJECT_NAME.upper() + " has no driver installed...." + else: + print "Removing installed driver...." + status = driver_uninstall() + if status: + if FORCE == 0: + return status + + do_sonic_platform_clean() + + return + + +def devices_info(): + global DEVICE_NO + global ALL_DEVICE + global i2c_bus, hwmon_types + for key in DEVICE_NO: + ALL_DEVICE[key] = {} + for i in range(0, DEVICE_NO[key]): + ALL_DEVICE[key][key + str(i + 1)] = [] + + for key in i2c_bus: + buses = i2c_bus[key] + nodes = i2c_nodes[key] + for i in range(0, len(buses)): + for j in range(0, len(nodes)): + if 'fan' == key: + for k in range(0, 6): + node = key + str(k + 1) + path = i2c_prefix + \ + buses[i] + "/fan" + str(k + 1) + "_" + nodes[j] + my_log(node + ": " + path) + ALL_DEVICE[key + str(k + 1)][node + str(j + 1)].append(path) + elif 'sfp' == key: + for k in range(0, DEVICE_NO[key]): + node = key + str(k + 1) + if k < 16 and i==0 and j==0: + path = i2c_prefix + \ + str(buses[0] + "/" + nodes[j] + str(k+1)) + my_log(node + ": " + path) + ALL_DEVICE[key][node].append(path) + if k >= 16 and i==1 and j==0: + path = i2c_prefix + \ + str(buses[1] + "/" + nodes[j] + str(k+1)) + my_log(node + ": " + path) + ALL_DEVICE[key][node].append(path) + if k >= 32 and i==1 and j==1: + path = i2c_prefix + \ + str(buses[1] + "/" + nodes[j] + str(k+1)) + my_log(node + ": " + path) + ALL_DEVICE[key][node].append(path) + else: + node = key + str(i + 1) + path = i2c_prefix + buses[i] + "/" + nodes[j] + my_log(node + ": " + path) + ALL_DEVICE[key][node].append(path) + + #for key in hwmon_types: + # itypes = hwmon_types[key] + # nodes = hwmon_nodes[key] + # for i in range(0, len(itypes)): + # for j in range(0, len(nodes)): + # node = key + "_" + itypes[i] + # path = hwmon_prefix[key] + itypes[i] + "/" + nodes[j] + # my_log(node + ": " + path) + # ALL_DEVICE[key][key + str(i + 1)].append(path) + + # show dict all in the order + if DEBUG: + for i in sorted(ALL_DEVICE.keys()): + print(i + ": ") + for j in sorted(ALL_DEVICE[i].keys()): + print(" " + j) + for k in (ALL_DEVICE[i][j]): + print(" " + " " + k) + return + + +def show_eeprom(index): + if system_ready() == False: + print("System's not ready.") + print("Please install first!") + return + + if len(ALL_DEVICE) == 0: + devices_info() + node = ALL_DEVICE['sfp']['sfp' + str(index)][0] + node = node.replace(node.split("/")[-1], 'eeprom') + sfp_node = str(sfp_map[int(index)-1]) + '-0050' + node = node.replace(node.split("/")[-2], sfp_node) + # check if got hexdump command in current environment + ret, log = log_os_system("which hexdump", 0) + ret, log2 = log_os_system("which busybox hexdump", 0) + if len(log): + hex_cmd = 'hexdump' + elif len(log2): + hex_cmd = ' busybox hexdump' + else: + log = 'Failed : no hexdump cmd!!' + logging.info(log) + print log + return 1 + print "node=%s" % node + print node + ":" + ret, log = log_os_system("cat " + node + "| " + hex_cmd + " -C", 1) + if ret == 0: + print log + else: + print "**********device no found**********" + return + + +def set_device(args): + global DEVICE_NO + global ALL_DEVICE + if system_ready() == False: + print("System's not ready.") + print("Please install first!") + return + + if len(ALL_DEVICE) == 0: + devices_info() + + if args[0] == 'fan': + if int(args[1]) > 100: + show_set_help() + return + #print ALL_DEVICE['fan'] + # fan1~6 is all fine, all fan share same setting + node = ALL_DEVICE['fan1']['fan11'][0] + node = node.replace(node.split("/")[-1], 'fan_duty_cycle_percentage') + ret, log = log_os_system("cat " + node, 1) + if ret == 0: + print ("Previous fan duty: " + log.strip() + "%") + ret, log = log_os_system("echo " + args[1] + " >" + node, 1) + if ret == 0: + print ("Current fan duty: " + args[1] + "%") + return ret + elif args[0] == 'sfp': + if int(args[1]) > DEVICE_NO[args[0]] or int(args[1]) < DEVICE_NO[args[0]]-1: #33-34 + show_set_help() + return + if len(args)<3 or len(args)>4: #len(args)=3 + show_set_help() + return + if int(args[2])>1 or int(args[2])<0: #0|1 + show_set_help() + return + + #print ALL_DEVICE[args[0]] + for i in range(0, len(ALL_DEVICE[args[0]])): + for j in ALL_DEVICE[args[0]][args[0] + str(args[1])]: + if j.find('tx_disable') != -1: + ret, log = log_os_system("echo " + args[2] + " >" + j, 1) + if ret: + return ret + else: + show_set_help() + + return + +# get digits inside a string. +# Ex: 31 for "sfp31" + + +def get_value(input): + digit = re.findall(r'\d+', input) + return int(digit[0]) + + +def device_traversal(): + if system_ready() == False: + print("System's not ready.") + print("Please install first!") + return + + if len(ALL_DEVICE) == 0: + devices_info() + for i in sorted(ALL_DEVICE.keys()): + print("============================================") + print(i.upper() + ": ") + print("============================================") + + for j in sorted(ALL_DEVICE[i].keys(), key=get_value): + print " " + j + ":", + for k in (ALL_DEVICE[i][j]): + ret, log = log_os_system("cat " + k, 0) + func = k.split("/")[-1].strip() + func = re.sub(j + '_', '', func, 1) + func = re.sub(i.lower() + '_', '', func, 1) + if ret == 0: + print func + "=" + log + " ", + else: + print func + "=" + "X" + " ", + print + print("----------------------------------------------------------------") + + print + return + + +def device_exist(): + ret1, log = log_os_system("ls " + i2c_prefix + "*0077", 0) + ret2, log = log_os_system("ls " + i2c_prefix + "i2c-2", 0) + return not(ret1 or ret2) + + +if __name__ == "__main__": + main() diff --git a/platform/broadcom/sonic-platform-modules-accton/debian/control b/platform/broadcom/sonic-platform-modules-accton/debian/control index 2b3c1af3d80f..4410a2f07796 100755 --- a/platform/broadcom/sonic-platform-modules-accton/debian/control +++ b/platform/broadcom/sonic-platform-modules-accton/debian/control @@ -45,6 +45,10 @@ Package: sonic-platform-accton-as4630-54pe Architecture: amd64 Description: kernel modules for platform devices such as fan, led, sfp +Package: sonic-platform-accton-as4630-54te +Architecture: amd64 +Description: kernel modules for platform devices such as fan, led, sfp + Package: sonic-platform-accton-minipack Architecture: amd64 Description: kernel modules for platform devices such as fan, led, sfp @@ -65,6 +69,10 @@ Package: sonic-platform-accton-as9716-32d Architecture: amd64 Description: kernel modules for platform devices such as fan, led, sfp +Package: sonic-platform-accton-as9726-32d +Architecture: amd64 +Description: kernel modules for platform devices such as fan, led, sfp + Package: sonic-platform-accton-as5835-54t Architecture: amd64 Description: kernel modules for platform devices such as fan, led, sfp diff --git a/platform/broadcom/sonic-platform-modules-accton/debian/rules b/platform/broadcom/sonic-platform-modules-accton/debian/rules index 722d4126ad0e..678d649a79ed 100755 --- a/platform/broadcom/sonic-platform-modules-accton/debian/rules +++ b/platform/broadcom/sonic-platform-modules-accton/debian/rules @@ -14,14 +14,15 @@ include /usr/share/dpkg/pkg-info.mk export INSTALL_MOD_DIR:=extra PYTHON ?= python2 +PYTHON3 ?= python3 PACKAGE_PRE_NAME := sonic-platform-accton KVERSION ?= $(shell uname -r) KERNEL_SRC := /lib/modules/$(KVERSION) MOD_SRC_DIR:= $(shell pwd) MODULE_DIRS := as7712-32x as5712-54x as7816-64x as7716-32x as7716-32xb as7312-54x -MODULE_DIRS += as7326-56x as6712-32x as7726-32x as4630-54pe minipack as5812-54x -MODULE_DIRS += as5835-54x as9716-32d as5835-54t as7312-54xs as7315-27xb as5812-54t +MODULE_DIRS += as7326-56x as6712-32x as7726-32x as4630-54pe as4630-54te minipack as5812-54x +MODULE_DIRS += as5835-54x as9716-32d as9726-32d as5835-54t as7312-54xs as7315-27xb as5812-54t MODULE_DIR := modules UTILS_DIR := utils SERVICE_DIR := service @@ -40,6 +41,12 @@ build: (for mod in $(MODULE_DIRS); do \ make modules -C $(KERNEL_SRC)/build M=$(MOD_SRC_DIR)/$${mod}/modules; \ $(PYTHON) $${mod}/setup.py build; \ + cd $(MOD_SRC_DIR)/$${mod}; \ + if [ -f sonic_platform_setup.py ]; then \ + $(PYTHON3) sonic_platform_setup.py bdist_wheel -d $(MOD_SRC_DIR)/$${mod}; \ + echo "Finished makig whl package for $$mod"; \ + fi; \ + cd $(MOD_SRC_DIR); \ done) binary: binary-arch binary-indep diff --git a/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as4630-54te.install b/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as4630-54te.install new file mode 100644 index 000000000000..fe4f35f1e2c1 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as4630-54te.install @@ -0,0 +1,2 @@ +as4630-54te/sonic_platform-1.0-py3-none-any.whl usr/share/sonic/device/x86_64-accton_as4630_54te-r0 + diff --git a/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as5835-54x.install b/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as5835-54x.install new file mode 100644 index 000000000000..556e3964ee28 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as5835-54x.install @@ -0,0 +1,3 @@ +as5835-54x/sonic_platform-1.0-py3-none-any.whl usr/share/sonic/device/x86_64-accton_as5835_54x-r0 + + diff --git a/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as7312-54x.install b/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as7312-54x.install new file mode 100644 index 000000000000..c0e14a1f6b1b --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as7312-54x.install @@ -0,0 +1,2 @@ +as7312-54x/sonic_platform-1.0-py3-none-any.whl usr/share/sonic/device/x86_64-accton_as7312_54x-r0 + diff --git a/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as7726-32x.install b/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as7726-32x.install new file mode 100644 index 000000000000..f6a25d920cde --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as7726-32x.install @@ -0,0 +1,2 @@ +as7726-32x/sonic_platform-1.0-py3-none-any.whl usr/share/sonic/device/x86_64-accton_as7726_32x-r0 + diff --git a/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as9726-32d.install b/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as9726-32d.install new file mode 100644 index 000000000000..01eb8dff9e41 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-accton/debian/sonic-platform-accton-as9726-32d.install @@ -0,0 +1,2 @@ +as9726-32d/sonic_platform-1.0-py3-none-any.whl usr/share/sonic/device/x86_64-accton_as9726_32d-r0 + diff --git a/platform/broadcom/sonic-platform-modules-accton/minipack/utils/accton_minipack_util.py b/platform/broadcom/sonic-platform-modules-accton/minipack/utils/accton_minipack_util.py index cf8e91faf549..25979963bb30 100755 --- a/platform/broadcom/sonic-platform-modules-accton/minipack/utils/accton_minipack_util.py +++ b/platform/broadcom/sonic-platform-modules-accton/minipack/utils/accton_minipack_util.py @@ -181,10 +181,12 @@ def log_os_system(cmd, show): return status, output def driver_inserted(): - ret, lsmod = log_os_system("lsmod| grep accton", 0) + ret, lsmod = log_os_system("ls /sys/module/*accton*", 0) logging.info('mods:'+lsmod) - if len(lsmod) ==0: + if ret : return False + else : + return True diff --git a/platform/broadcom/sonic-platform-modules-alphanetworks/debian/control b/platform/broadcom/sonic-platform-modules-alphanetworks/debian/control index 6c7b1c41446f..6535dbb88bb8 100644 --- a/platform/broadcom/sonic-platform-modules-alphanetworks/debian/control +++ b/platform/broadcom/sonic-platform-modules-alphanetworks/debian/control @@ -7,11 +7,11 @@ Standards-Version: 3.9.3 Package: sonic-platform-alphanetworks-snh60a0-320fv2 Architecture: amd64 -Depends: linux-image-4.19.0-9-2-amd64-unsigned +Depends: linux-image-4.19.0-12-2-amd64-unsigned Description: kernel modules for platform devices such as fan, led, sfp Package: sonic-platform-alphanetworks-snh60b0-640f Architecture: amd64 -Depends: linux-image-4.19.0-9-2-amd64-unsigned +Depends: linux-image-4.19.0-12-2-amd64-unsigned Description: kernel modules for platform devices such as fan, led, sfp diff --git a/platform/broadcom/sonic-platform-modules-arista b/platform/broadcom/sonic-platform-modules-arista index adf108419894..a682da369cbb 160000 --- a/platform/broadcom/sonic-platform-modules-arista +++ b/platform/broadcom/sonic-platform-modules-arista @@ -1 +1 @@ -Subproject commit adf108419894f3b58c0c69722e0be3c72613180e +Subproject commit a682da369cbbab66dd477ca573dfe12f52c74c9c diff --git a/platform/broadcom/sonic-platform-modules-brcm-xlr-gts/Makefile b/platform/broadcom/sonic-platform-modules-brcm-xlr-gts/Makefile index cd2a5a101ad5..3f93a0bfe52a 100644 --- a/platform/broadcom/sonic-platform-modules-brcm-xlr-gts/Makefile +++ b/platform/broadcom/sonic-platform-modules-brcm-xlr-gts/Makefile @@ -7,7 +7,7 @@ MAIN_TARGET = $(BRCM_XLR_GTS_PLATFORM_MODULE) $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : # Build the package export PYBUILD_INSTALL_ARGS_python2=--install-scripts=/dev/null - dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) + dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR) mv $(addprefix ../, $* $(EXTRA_TARGETS)) $(DEST)/ diff --git a/platform/broadcom/sonic-platform-modules-cel/debian/control b/platform/broadcom/sonic-platform-modules-cel/debian/control index 1eedf83d07b0..a41f92ab54e9 100644 --- a/platform/broadcom/sonic-platform-modules-cel/debian/control +++ b/platform/broadcom/sonic-platform-modules-cel/debian/control @@ -7,21 +7,21 @@ Standards-Version: 3.9.3 Package: platform-modules-dx010 Architecture: amd64 -Depends: linux-image-4.19.0-9-2-amd64-unsigned +Depends: linux-image-4.19.0-12-2-amd64-unsigned Description: kernel modules for platform devices such as fan, led, sfp Package: platform-modules-haliburton Architecture: amd64 -Depends: linux-image-4.19.0-9-2-amd64-unsigned +Depends: linux-image-4.19.0-12-2-amd64-unsigned Description: kernel modules for platform devices such as fan, led, sfp Package: platform-modules-seastone2 Architecture: amd64 -Depends: linux-image-4.19.0-9-2-amd64-unsigned +Depends: linux-image-4.19.0-12-2-amd64-unsigned Description: kernel modules for platform devices such as led, sfp Package: platform-modules-silverstone Architecture: amd64 -Depends: linux-image-4.19.0-9-2-amd64-unsigned +Depends: linux-image-4.19.0-12-2-amd64-unsigned Description: kernel modules for platform devices such as led, sfp. diff --git a/platform/broadcom/sonic-platform-modules-cel/debian/platform-modules-dx010.init b/platform/broadcom/sonic-platform-modules-cel/debian/platform-modules-dx010.init index e27d4df46782..12f8fc61f2ea 100644 --- a/platform/broadcom/sonic-platform-modules-cel/debian/platform-modules-dx010.init +++ b/platform/broadcom/sonic-platform-modules-cel/debian/platform-modules-dx010.init @@ -61,19 +61,19 @@ start) [ $found -eq 0 ] && echo "cannot find iSMT" && exit 1 i2cset -y ${devnum} 0x70 0x10 0x00 0x01 i - sleep 1 + sleep 0.1 # Attach PCA9548 0x71 Channel Extender for Main Board echo pca9548 0x71 > /sys/bus/i2c/devices/i2c-${devnum}/new_device - sleep 1 + sleep 0.1 # Attach PCA9548 0x73 Channel Extender for CPU Board echo pca9548 0x73 > /sys/bus/i2c/devices/i2c-${devnum}/new_device - sleep 1 + sleep 0.1 # Attach PCA9548 0x77 Channel Extender for Fan's EEPROMs echo pca9548 0x77 > /sys/bus/i2c/devices/i2c-${devnum}/new_device - sleep 1 + sleep 0.1 # Attach syseeprom echo 24lc64t 0x50 > /sys/bus/i2c/devices/i2c-12/new_device @@ -89,15 +89,24 @@ start) echo emc2305 0x2e > /sys/bus/i2c/devices/i2c-13/new_device echo emc2305 0x4d > /sys/bus/i2c/devices/i2c-13/new_device + echo 24c02 0x50 > /sys/bus/i2c/devices/i2c-18/new_device + echo 24c02 0x50 > /sys/bus/i2c/devices/i2c-19/new_device + echo 24c02 0x50 > /sys/bus/i2c/devices/i2c-20/new_device + echo 24c02 0x50 > /sys/bus/i2c/devices/i2c-21/new_device + echo 24c02 0x50 > /sys/bus/i2c/devices/i2c-22/new_device + # Attach PSUs echo dps460 0x5a > /sys/bus/i2c/devices/i2c-10/new_device echo dps460 0x5b > /sys/bus/i2c/devices/i2c-11/new_device + echo 24c02 0x52 > /sys/bus/i2c/devices/i2c-10/new_device + echo 24c02 0x53 > /sys/bus/i2c/devices/i2c-11/new_device + # Attach PCA9506 GPIO expander for 40 pins echo pca9505 0x20 > /sys/bus/i2c/devices/i2c-17/new_device modprobe dx010_cpld - sleep 2 + sleep 1 # Export platform gpio sysfs export_gpio 10 "in" # Fan 1 present @@ -117,16 +126,16 @@ start) export_gpio 27 "in" # PSU L ABS export_gpio 28 "in" # PSU R ABS - export_gpio 29 "out" # Fan 1 LED: Red - export_gpio 30 "out" # Fan 1 LED: Yellow - export_gpio 31 "out" # Fan 2 LED: Red - export_gpio 32 "out" # Fan 2 LED: Yellow - export_gpio 33 "out" # Fan 3 LED: Red - export_gpio 34 "out" # Fan 3 LED: Yellow - export_gpio 35 "out" # Fan 4 LED: Red - export_gpio 36 "out" # Fan 4 LED: Yellow - export_gpio 37 "out" # Fan 5 LED: Red - export_gpio 38 "out" # Fan 5 LED: Yellow + export_gpio 29 "out" # Fan 2 LED: Red + export_gpio 30 "out" # Fan 2 LED: Green + export_gpio 31 "out" # Fan 1 LED: Red + export_gpio 32 "out" # Fan 1 LED: Green + export_gpio 33 "out" # Fan 5 LED: Red + export_gpio 34 "out" # Fan 5 LED: Green + export_gpio 35 "out" # Fan 3 LED: Red + export_gpio 36 "out" # Fan 3 LED: Green + export_gpio 37 "out" # Fan 4 LED: Red + export_gpio 38 "out" # Fan 4 LED: Green # Turn off/down lpmod by defult (0 - Normal, 1 - Low Pow) echo 0x00000000 > /sys/devices/platform/dx010_cpld/qsfp_lpmode @@ -138,7 +147,17 @@ start) sleep 0.1 done - /bin/sh /usr/local/bin/platform_api_mgnt.sh init + bus_en=8 + cfg_r=`i2cget -y -f 8 0x60 0xD1` + ((cfg_w=$cfg_r+$bus_en)) + i2cset -y -f 8 0x60 0xD1 $cfg_w + sleep 0.1 + cfg_r=`i2cget -y -f 9 0x20 0xD1` + ((cfg_w=$cfg_r+$bus_en)) + i2cset -y -f 9 0x20 0xD1 $cfg_w + sleep 0.1 + + /bin/sh /usr/local/bin/platform_api_mgnt.sh init echo "done." ;; diff --git a/platform/broadcom/sonic-platform-modules-cel/debian/platform-modules-dx010.install b/platform/broadcom/sonic-platform-modules-cel/debian/platform-modules-dx010.install index d7720cea90f4..4698507c6b9d 100644 --- a/platform/broadcom/sonic-platform-modules-cel/debian/platform-modules-dx010.install +++ b/platform/broadcom/sonic-platform-modules-cel/debian/platform-modules-dx010.install @@ -3,7 +3,6 @@ dx010/cfg/dx010-modules.conf etc/modules-load.d dx010/systemd/platform-modules-dx010.service lib/systemd/system dx010/scripts/fancontrol.sh etc/init.d dx010/scripts/fancontrol.service lib/systemd/system -dx010/scripts/thermal_overload_control.sh usr/local/bin services/fancontrol/fancontrol usr/local/bin -dx010/modules/sonic_platform-1.0-py2-none-any.whl usr/share/sonic/device/x86_64-cel_seastone-r0 +dx010/modules/sonic_platform-1.0-py3-none-any.whl usr/share/sonic/device/x86_64-cel_seastone-r0 services/platform_api/platform_api_mgnt.sh usr/local/bin diff --git a/platform/broadcom/sonic-platform-modules-cel/debian/platform-modules-dx010.postinst b/platform/broadcom/sonic-platform-modules-cel/debian/platform-modules-dx010.postinst index 8dbf0ece6676..b198584282db 100644 --- a/platform/broadcom/sonic-platform-modules-cel/debian/platform-modules-dx010.postinst +++ b/platform/broadcom/sonic-platform-modules-cel/debian/platform-modules-dx010.postinst @@ -6,4 +6,5 @@ systemctl start platform-modules-dx010.service systemctl start fancontrol.service /usr/local/bin/platform_api_mgnt.sh install +/etc/init.d/fancontrol.sh install diff --git a/platform/broadcom/sonic-platform-modules-cel/debian/platform-modules-haliburton.init b/platform/broadcom/sonic-platform-modules-cel/debian/platform-modules-haliburton.init index 1dc0ea5cfeeb..3f6358bf4ab4 100644 --- a/platform/broadcom/sonic-platform-modules-cel/debian/platform-modules-haliburton.init +++ b/platform/broadcom/sonic-platform-modules-cel/debian/platform-modules-haliburton.init @@ -11,6 +11,26 @@ # Short-Description: Setup Haliburton board. ### END INIT INFO +setup_swap () { + SWAPFILE=/host/myswapfile + + if [ ! -f $SWAPFILE ]; then + availspace=`df -h --output=avail /host | sed '1d;s/\s//g;s/[^0-9].*//g'` + diff=$(( availspace - 2*$1 )) + if [ $diff -gt 0 ]; then + fallocate -l ${1}G $SWAPFILE + chmod 600 $SWAPFILE + echo "swap file created successfully" + else + echo "not enough disk space to turn on swap." + return + fi + fi + mkswap $SWAPFILE + swapon $SWAPFILE + echo "swap on successfully" +} + case "$1" in start) echo -n "Setting up board... " @@ -18,6 +38,7 @@ start) modprobe smc modprobe hlx_gpio_ich modprobe dps200 + modprobe cp210x found=0 for devnum in 0 1; do @@ -54,7 +75,9 @@ start) # Attach PSUs echo dps200 0x5a > /sys/bus/i2c/devices/i2c-12/new_device + echo 24c02 0x52 > /sys/bus/i2c/devices/i2c-12/new_device echo dps200 0x5b > /sys/bus/i2c/devices/i2c-13/new_device + echo 24c02 0x53 > /sys/bus/i2c/devices/i2c-13/new_device # Attach fans echo emc2305 0x4d > /sys/bus/i2c/devices/i2c-23/new_device @@ -71,6 +94,8 @@ start) /bin/sh /usr/local/bin/platform_api_mgnt.sh init + setup_swap 2 + echo "done." ;; diff --git a/platform/broadcom/sonic-platform-modules-cel/debian/platform-modules-haliburton.install b/platform/broadcom/sonic-platform-modules-cel/debian/platform-modules-haliburton.install index 167de45532db..af61050308b8 100644 --- a/platform/broadcom/sonic-platform-modules-cel/debian/platform-modules-haliburton.install +++ b/platform/broadcom/sonic-platform-modules-cel/debian/platform-modules-haliburton.install @@ -4,7 +4,9 @@ haliburton/script/fancontrol.sh etc/init.d haliburton/script/fancontrol.service lib/systemd/system services/fancontrol/fancontrol usr/local/bin haliburton/modules/sonic_platform-1.0-py2-none-any.whl usr/share/sonic/device/x86_64-cel_e1031-r0 +haliburton/modules/sonic_platform-1.0-py3-none-any.whl usr/share/sonic/device/x86_64-cel_e1031-r0 services/platform_api/platform_api_mgnt.sh usr/local/bin haliburton/script/popmsg.sh usr/local/bin haliburton/script/udev_prefix.sh usr/local/bin +haliburton/script/reload_udev.sh usr/local/bin haliburton/script/50-ttyUSB-C0.rules etc/udev/rules.d diff --git a/platform/broadcom/sonic-platform-modules-cel/debian/platform-modules-haliburton.postinst b/platform/broadcom/sonic-platform-modules-cel/debian/platform-modules-haliburton.postinst index 74a4a4b17928..57ac1be34152 100644 --- a/platform/broadcom/sonic-platform-modules-cel/debian/platform-modules-haliburton.postinst +++ b/platform/broadcom/sonic-platform-modules-cel/debian/platform-modules-haliburton.postinst @@ -1,10 +1,15 @@ depmod -a + +sudo chmod +x /usr/local/bin/udev_prefix.sh +sudo chmod +x /usr/local/bin/popmsg.sh +sudo chmod +x /usr/local/bin/reload_udev.sh + +/usr/local/bin/platform_api_mgnt.sh install +/etc/init.d/fancontrol.sh install +/usr/local/bin/reload_udev.sh + systemctl enable platform-modules-haliburton.service systemctl enable fancontrol.service systemctl start platform-modules-haliburton.service -systemctl start fancontrol.service - -/usr/local/bin/platform_api_mgnt.sh install -sudo chmod +x /usr/local/bin/udev_prefix.sh -sudo chmod +x /usr/local/bin/popmsg.sh +systemctl start fancontrol.service \ No newline at end of file diff --git a/platform/broadcom/sonic-platform-modules-cel/debian/rules b/platform/broadcom/sonic-platform-modules-cel/debian/rules index a7293e0b6700..efb5aa47b437 100755 --- a/platform/broadcom/sonic-platform-modules-cel/debian/rules +++ b/platform/broadcom/sonic-platform-modules-cel/debian/rules @@ -13,13 +13,15 @@ MODULE_DIRS:= dx010 haliburton silverstone seastone2 override_dh_auto_build: (for mod in $(MODULE_DIRS); do \ make -C $(KERNEL_SRC)/build M=$(MOD_SRC_DIR)/$${mod}/modules; \ - cd $(MOD_SRC_DIR)/$${mod}; \ - python2.7 setup.py bdist_wheel -d $(MOD_SRC_DIR)/$${mod}/modules; \ - cd $(MOD_SRC_DIR); \ if [ $$mod = "seastone2" ]; then \ cd services/platform_api; \ - python2 setup.py bdist_wheel -d $(MOD_SRC_DIR)/$${mod}/modules; \ - fi \ + python2.7 setup.py bdist_wheel -d $(MOD_SRC_DIR)/$${mod}/modules; \ + python3 setup.py bdist_wheel -d $(MOD_SRC_DIR)/$${mod}/modules; \ + continue; \ + fi; \ + cd $(MOD_SRC_DIR)/$${mod}; \ + python2.7 setup.py bdist_wheel -d $(MOD_SRC_DIR)/$${mod}/modules; \ + python3 setup.py bdist_wheel -d $(MOD_SRC_DIR)/$${mod}/modules; \ done) override_dh_auto_install: @@ -37,4 +39,3 @@ override_dh_clean: (for mod in $(MODULE_DIRS); do \ make -C $(KERNEL_SRC)/build M=$(MOD_SRC_DIR)/$${mod}/modules clean; \ done) - diff --git a/platform/broadcom/sonic-platform-modules-cel/dx010/modules/dx010_cpld.c b/platform/broadcom/sonic-platform-modules-cel/dx010/modules/dx010_cpld.c index d8142777c6e1..3cdfb3939558 100644 --- a/platform/broadcom/sonic-platform-modules-cel/dx010/modules/dx010_cpld.c +++ b/platform/broadcom/sonic-platform-modules-cel/dx010/modules/dx010_cpld.c @@ -1,7 +1,7 @@ /* * dx010_cpld.c - driver for SeaStone's CPLD * - * Copyright (C) 2017 Celestica Corp. + * Copyright (C) 2023 Celestica Corp. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -120,11 +120,11 @@ #define SSRR_ID_BANK2 0x296 #define SSRR_ID_BANK3 0x396 -#define HST_CNTL2_QUICK 0x00 -#define HST_CNTL2_BYTE 0x01 -#define HST_CNTL2_BYTE_DATA 0x02 -#define HST_CNTL2_WORD_DATA 0x03 -#define HST_CNTL2_BLOCK 0x05 +#define SSRR_MASTER_ERR 0x80 +#define SSRR_BUS_BUSY 0x40 + +#define I2C_BAUD_RATE_100K 0x40 + struct dx010_i2c_data { int portid; @@ -610,6 +610,166 @@ static int i2c_read_eeprom(struct i2c_adapter *a, u16 addr, return error; } + +/** + * Read/Write eeprom of CPLD connected QSFP device. + * @param a i2c adapter. + * @param addr address to read. + * @param new_data QSFP port number struct. + * @param rw read/write flag + * @param cmd i2c command. + * @param size access size + * @return 0 if not error, else the error code. + */ +static int dx010_cpld_i2c_access(struct i2c_adapter *a, u16 addr, + struct dx010_i2c_data *new_data, char rw, + u8 cmd, int size, union i2c_smbus_data *data) +{ + u32 reg; + int ioBase=0; + char byte; + char data_len = 0; + short temp; + short portid, opcode, devaddr, cmdbyte0, ssrr, writedata, readdata; + __u16 word_data; + __u8 byte_data; + int error = -EIO; + + mutex_lock(&cpld_data->cpld_lock); + + if (((new_data->portid >= PORT_BANK1_START) + && (new_data->portid <= PORT_BANK1_END)) + || (new_data->portid == PORT_SFPP1) + || (new_data->portid == PORT_SFPP2)) + { + portid = PORT_ID_BANK1; + opcode = OPCODE_ID_BANK1; + devaddr = DEVADDR_ID_BANK1; + cmdbyte0 = CMDBYT_ID_BANK1; + ssrr = SSRR_ID_BANK1; + writedata = WRITE_ID_BANK1; + readdata = READ_ID_BANK1; + }else if ((new_data->portid >= PORT_BANK2_START) && (new_data->portid <= PORT_BANK2_END)){ + portid = PORT_ID_BANK2; + opcode = OPCODE_ID_BANK2; + devaddr = DEVADDR_ID_BANK2; + cmdbyte0 = CMDBYT_ID_BANK2; + ssrr = SSRR_ID_BANK2; + writedata = WRITE_ID_BANK2; + readdata = READ_ID_BANK2; + }else if ((new_data->portid >= PORT_BANK3_START) && (new_data->portid <= PORT_BANK3_END)){ + portid = PORT_ID_BANK3; + opcode = OPCODE_ID_BANK3; + devaddr = DEVADDR_ID_BANK3; + cmdbyte0 = CMDBYT_ID_BANK3; + ssrr = SSRR_ID_BANK3; + writedata = WRITE_ID_BANK3; + readdata = READ_ID_BANK3; + }else{ + /* Invalid parameter! */ + error = -EINVAL; + goto exit; + } + + if (size == I2C_SMBUS_BYTE || size == I2C_SMBUS_BYTE_DATA) + data_len = 1; + else if (size == I2C_SMBUS_WORD_DATA) + data_len = 2; + else { + error = -EINVAL; + goto exit; + } + + while ((inb(ioBase + ssrr) & SSRR_BUS_BUSY)); + if ((inb(ioBase + ssrr) & SSRR_MASTER_ERR) == SSRR_MASTER_ERR) { + error = -EIO; + /* Read error reset the port */ + outb(0x00, ioBase + ssrr); + udelay(3000); + outb(0x01, ioBase + ssrr); + goto exit; + } + + byte = I2C_BAUD_RATE_100K + new_data->portid; + reg = cmd; + outb(byte, ioBase + portid); + outb(reg, ioBase + cmdbyte0); + byte = (data_len << 4) | 0x1; + outb(byte, ioBase + opcode); + addr = addr << 1; + if (rw == I2C_SMBUS_READ) + { + addr |= 0x01; + outb(addr, ioBase + devaddr); + while ((inb(ioBase + ssrr) & SSRR_BUS_BUSY)) + { + udelay(100); + } + + if ((inb(ioBase + ssrr) & SSRR_MASTER_ERR) == SSRR_MASTER_ERR) { + /* Read error reset the port */ + error = -EIO; + outb(0x00, ioBase + ssrr); + udelay(3000); + outb(0x01, ioBase + ssrr); + goto exit; + } + + temp = ioBase + readdata; + if (data_len == 1) + { + byte_data = inb(temp); + data->byte = byte_data; + } + else if (data_len == 2) + { + word_data = inb(temp); + word_data |= (inb(++temp) << 8); + data->word = word_data; + } + } + else // do i2c write + { + temp = ioBase + writedata; + if (data_len == 1) + { + byte_data = data->byte; + outb(byte_data, temp); + } + else if (data_len == 2) + { + word_data = data->word; + outb((word_data & 0xff), temp); + outb((word_data >> 4), (++temp)); + } + // write dev addr + outb(addr, ioBase + devaddr); + + // check bus access status + while ((inb(ioBase + ssrr) & SSRR_BUS_BUSY)) + { + udelay(100); + } + + if ((inb(ioBase + ssrr) & SSRR_MASTER_ERR) == SSRR_MASTER_ERR) { + /* Read error reset the port */ + error = -EIO; + outb(0x00, ioBase + ssrr); + udelay(3000); + outb(0x01, ioBase + ssrr); + goto exit; + } + } + + mutex_unlock(&cpld_data->cpld_lock); + return 0; + +exit: + mutex_unlock(&cpld_data->cpld_lock); + return error; +} + + static int dx010_i2c_access(struct i2c_adapter *a, u16 addr, unsigned short flags, char rw, u8 cmd, int size, union i2c_smbus_data *data) @@ -624,39 +784,19 @@ static int dx010_i2c_access(struct i2c_adapter *a, u16 addr, /* Map the size to what the chip understands */ switch (size) { - case I2C_SMBUS_QUICK: - size = HST_CNTL2_QUICK; - break; case I2C_SMBUS_BYTE: - size = HST_CNTL2_BYTE; - break; case I2C_SMBUS_BYTE_DATA: - size = HST_CNTL2_BYTE_DATA; - break; case I2C_SMBUS_WORD_DATA: - size = HST_CNTL2_WORD_DATA; - break; - case I2C_SMBUS_BLOCK_DATA: - size = HST_CNTL2_BLOCK; - break; - default: - dev_warn(&a->dev, "Unsupported transaction %d\n", size); - error = -EOPNOTSUPP; - goto Done; - } - - switch (size) { - case HST_CNTL2_BYTE: /* Result put in SMBHSTDAT0 */ - break; - case HST_CNTL2_BYTE_DATA: - break; - case HST_CNTL2_WORD_DATA: - if( 0 == i2c_read_eeprom(a,addr,new_data,cmd,data)){ + if(0 == dx010_cpld_i2c_access(a, addr, new_data, rw, cmd, size, data)){ error = 0; }else{ error = -EIO; } break; + default: + dev_warn(&a->dev, "Unsupported transaction %d\n", size); + error = -EOPNOTSUPP; + goto Done; } Done: @@ -790,6 +930,6 @@ module_init(cel_dx010_lpc_init); module_exit(cel_dx010_lpc_exit); MODULE_AUTHOR("Pradchaya P "); -MODULE_VERSION("1.0.1"); +MODULE_VERSION("1.0.2"); MODULE_DESCRIPTION("Celestica SeaStone DX010 LPC Driver"); -MODULE_LICENSE("GPL"); \ No newline at end of file +MODULE_LICENSE("GPL"); diff --git a/platform/broadcom/sonic-platform-modules-cel/dx010/modules/emc2305.c b/platform/broadcom/sonic-platform-modules-cel/dx010/modules/emc2305.c index b406a29fd9be..b7a85c17a332 100644 --- a/platform/broadcom/sonic-platform-modules-cel/dx010/modules/emc2305.c +++ b/platform/broadcom/sonic-platform-modules-cel/dx010/modules/emc2305.c @@ -742,6 +742,7 @@ emc2305_probe(struct i2c_client *client, const struct i2c_device_id *id) int status; int i; int fan_idx; + unsigned char dis_to = 0; if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) return -EIO; @@ -752,6 +753,11 @@ emc2305_probe(struct i2c_client *client, const struct i2c_device_id *id) i2c_set_clientdata(client, data); mutex_init(&data->update_lock); + + dis_to = i2c_smbus_read_byte_data(client, REG_CONFIGURATION); + dis_to &= 0xBF; + /* The SMBus timeout function is enabled */ + (void)i2c_smbus_write_byte_data(client, REG_CONFIGURATION, dis_to); status = i2c_smbus_read_byte_data(client, REG_PRODUCT_ID); switch (status) { diff --git a/platform/broadcom/sonic-platform-modules-cel/dx010/scripts/fancontrol.sh b/platform/broadcom/sonic-platform-modules-cel/dx010/scripts/fancontrol.sh index 75ad6c65b37f..21274ed6e27d 100644 --- a/platform/broadcom/sonic-platform-modules-cel/dx010/scripts/fancontrol.sh +++ b/platform/broadcom/sonic-platform-modules-cel/dx010/scripts/fancontrol.sh @@ -7,75 +7,42 @@ # Default-Start: 2 3 4 5 # Default-Stop: # Short-Description: fancontrol -# Description: fan speed regulator +# Description: fancontrol configuration selector ### END INIT INFO . /lib/lsb/init-functions [ -f /etc/default/rcS ] && . /etc/default/rcS -PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin -DAEMON=/usr/local/bin/fancontrol -DESC="fan speed regulator" -NAME="fancontrol" -PIDFILE=/var/run/fancontrol.pid MAIN_CONF=/usr/share/sonic/device/x86_64-cel_seastone-r0/fancontrol -DEVPATH=/sys/devices/pci0000:00/0000:00:13.0/i2c-*/i2c-13/13-002e GPIO_DIR=/sys/class/gpio -BASE_GPIO=$(find $GPIO_DIR | grep gpiochip | grep -o '[[:digit:]]*') -DIRGPIO_START=15 -test -x $DAEMON || exit 0 +init() { + DIRGPIO_START=15 + BASE_GPIO=$(find $GPIO_DIR | grep gpiochip | grep -o '[[:digit:]]*') + FANDIR_GPIO_NUMBER=$((DIRGPIO_START + BASE_GPIO)) + FANDIR_VALUE=$(cat ${GPIO_DIR}/gpio${FANDIR_GPIO_NUMBER}/value) + DIRGPIO_START=$((DIRGPIO_START + 1)) + FANDIR=$([ $FANDIR_VALUE = 1 ] && echo "B2F" || echo "F2B") + CONF=${MAIN_CONF}-${FANDIR} + echo $FANDIR > /usr/share/sonic/device/x86_64-cel_seastone-r0/fan_airflow +} -for i in 1 2 3 4 5 -do - FANFAULT=$(cat ${DEVPATH}/fan${i}_fault) - [ $FANFAULT = 1 ] && continue - FANDIR_GPIO_NUMBER=$((DIRGPIO_START + BASE_GPIO)) - FANDIR_VALUE=$(cat ${GPIO_DIR}/gpio${FANDIR_GPIO_NUMBER}/value) - DIRGPIO_START=$((DIRGPIO_START+1)) - FANDIR=$([ $FANDIR_VALUE = 1 ] && echo "B2F" || echo "F2B") -done -CONF=${MAIN_CONF}-${FANDIR} +install() { + find /var/lib/docker/overlay*/ -path */sbin/fancontrol -exec cp /usr/local/bin/fancontrol {} \; +} case "$1" in - start) - if [ -f $CONF ] ; then - if $DAEMON --check $CONF 1>/dev/null 2>/dev/null ; then - log_daemon_msg "Starting $DESC" "$NAME\n" - start-stop-daemon --start --quiet --pidfile $PIDFILE --startas $DAEMON $CONF - log_end_msg $? - else - log_failure_msg "Not starting fancontrol, broken configuration file; please re-run pwmconfig." - fi - else - if [ "$VERBOSE" != no ]; then - log_warning_msg "Not starting fancontrol; run pwmconfig first." - fi - fi - ;; - stop) - log_daemon_msg "Stopping $DESC" "$NAME" - start-stop-daemon --stop --quiet --pidfile $PIDFILE --oknodo --startas $DAEMON $CONF - rm -f $PIDFILE - log_end_msg $? - ;; - restart) - $0 stop - sleep 3 - $0 start - ;; - force-reload) - if start-stop-daemon --stop --test --quiet --pidfile $PIDFILE --startas $DAEMON $CONF ; then - $0 restart - fi - ;; - status) - status_of_proc $DAEMON $NAME $CONF && exit 0 || exit $? - ;; - *) - log_success_msg "Usage: /etc/init.d/fancontrol {start|stop|restart|force-reload|status}" - exit 1 - ;; +start) + init + cp $CONF $MAIN_CONF + ;; +install) + install + ;; +*) + log_success_msg "Usage: /etc/init.d/fancontrol {start} | {install}" + exit 1 + ;; esac exit 0 diff --git a/platform/broadcom/sonic-platform-modules-cel/haliburton/modules/Makefile b/platform/broadcom/sonic-platform-modules-cel/haliburton/modules/Makefile index 415d1b5e62f0..b34cf2cabe20 100644 --- a/platform/broadcom/sonic-platform-modules-cel/haliburton/modules/Makefile +++ b/platform/broadcom/sonic-platform-modules-cel/haliburton/modules/Makefile @@ -1 +1 @@ -obj-m := mc24lc64t.o emc2305.o smc.o hlx_gpio_ich.o dps200.o +obj-m := mc24lc64t.o emc2305.o smc.o hlx_gpio_ich.o diff --git a/platform/broadcom/sonic-platform-modules-cel/haliburton/modules/dps200.c b/platform/broadcom/sonic-platform-modules-cel/haliburton/modules/dps200.c deleted file mode 100644 index 6279ca70decf..000000000000 --- a/platform/broadcom/sonic-platform-modules-cel/haliburton/modules/dps200.c +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Hardware monitoring driver for Delta DPS200 - * - * (C) Copyright 2019, Celestica Inc. - * Author: Pradchaya Phucharoen - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include "pmbus.h" - - -static int dps200_read_word_data(struct i2c_client *client, int page, int reg) -{ - - if (reg >= PMBUS_VIRT_BASE || - reg == PMBUS_VOUT_OV_FAULT_LIMIT || - reg == PMBUS_VOUT_OV_WARN_LIMIT || - reg == PMBUS_VOUT_UV_WARN_LIMIT || - reg == PMBUS_VOUT_UV_FAULT_LIMIT || - reg == PMBUS_IOUT_OC_LV_FAULT_LIMIT || - reg == PMBUS_IOUT_UC_FAULT_LIMIT || - reg == PMBUS_UT_WARN_LIMIT || - reg == PMBUS_UT_FAULT_LIMIT || - reg == PMBUS_VIN_OV_FAULT_LIMIT || - reg == PMBUS_VIN_OV_WARN_LIMIT || - reg == PMBUS_IIN_OC_FAULT_LIMIT || - reg == PMBUS_POUT_MAX) - return -ENXIO; - - /* - * WARNING: The following feild have coinstant driver value. - * If the register are - * PMBUS_IOUT_OC_WARN_LIMIT or PMBUS_IOUT_OC_FAULT_LIMIT convert - * the constant value from linear to direct fomat. - */ - if (reg == PMBUS_IOUT_OC_WARN_LIMIT) - return 0xb4; - else if (reg == PMBUS_IOUT_OC_FAULT_LIMIT) - return 0xc8; - else - return pmbus_read_word_data(client, page, reg); -} - -/* - * Form DPS-200 datasheet the supported sensors format defined as: - * VOUT: direct mode with one decimal place. - * - * Other sensors: - * IOUT: direct mode with one decimal place. - * IOUT Limits: linear mode, which difference from IOUT. - * VIN, IIN, POWER, TEMP, & FAN: linear mode. - */ -static struct pmbus_driver_info dps200_info = { - .pages = 1, - .func[0] = PMBUS_HAVE_VIN | PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT - | PMBUS_HAVE_IIN | PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT - | PMBUS_HAVE_PIN | PMBUS_HAVE_POUT - | PMBUS_HAVE_FAN12 | PMBUS_HAVE_STATUS_FAN12 - | PMBUS_HAVE_TEMP | PMBUS_HAVE_TEMP2 | PMBUS_HAVE_TEMP3 | PMBUS_HAVE_STATUS_TEMP - | PMBUS_HAVE_STATUS_INPUT, - .format = { - [PSC_VOLTAGE_OUT] = direct, - [PSC_CURRENT_OUT] = direct, - }, - .m = { - [PSC_VOLTAGE_OUT] = 10, - [PSC_CURRENT_OUT] = 10, - }, - .b = { - [PSC_VOLTAGE_OUT] = 0, - [PSC_CURRENT_OUT] = 0, - }, - .R = { - [PSC_VOLTAGE_OUT] = 0, - [PSC_CURRENT_OUT] = 0, - }, - .read_word_data = &dps200_read_word_data, -}; - -static int pmbus_probe(struct i2c_client *client, - const struct i2c_device_id *id) -{ - return pmbus_do_probe(client, id, &dps200_info); -} -/* user driver datat to pass the grpup */ -static const struct i2c_device_id dps200_id[] = { - {"dps200", 0}, - {} -}; - -MODULE_DEVICE_TABLE(i2c, dps200_id); - -/* This is the driver that will be inserted */ -static struct i2c_driver dps200_driver = { - .driver = { - .name = "dps200", - }, - .probe = pmbus_probe, - .remove = pmbus_do_remove, - .id_table = dps200_id, -}; - -module_i2c_driver(dps200_driver); - -MODULE_AUTHOR("Pradchaya Phucharoen"); -MODULE_DESCRIPTION("PMBus driver for Delta DPS200"); -MODULE_LICENSE("GPL"); diff --git a/platform/broadcom/sonic-platform-modules-cel/haliburton/modules/emc2305.c b/platform/broadcom/sonic-platform-modules-cel/haliburton/modules/emc2305.c index f08033e080ce..c32f5dffbc2d 100644 --- a/platform/broadcom/sonic-platform-modules-cel/haliburton/modules/emc2305.c +++ b/platform/broadcom/sonic-platform-modules-cel/haliburton/modules/emc2305.c @@ -407,6 +407,35 @@ emc2305_set_pwm(struct i2c_client *client, int fan_idx, long pwm) mutex_unlock(&data->update_lock); return status; } + +static int +emc2305_enable_timeout(struct i2c_client *client, bool enable) +{ + struct emc2305_data *data = i2c_get_clientdata(client); + int status = 0; + u8 conf_val = 0; + + mutex_lock(&data->update_lock); + + status = read_u8_from_i2c(client, REG_CONFIGURATION, &conf_val); + if (status < 0) { + mutex_unlock(&data->update_lock); + return status; + } + + // Section 6.2: CONFIG REGISTER DIS_TO bit(bit 6) + if (enable) { + conf_val &= ~(1 << 6); + } else { + conf_val |= (1 << 6); + } + + status = i2c_smbus_write_byte_data(client, REG_CONFIGURATION, conf_val); + + mutex_unlock(&data->update_lock); + return status; +} + /* * sysfs callback functions * @@ -744,6 +773,9 @@ emc2305_probe(struct i2c_client *client, const struct i2c_device_id *id) i2c_set_clientdata(client, data); mutex_init(&data->update_lock); + // Enable SMBus timeout feature + emc2305_enable_timeout(client, true); + status = i2c_smbus_read_byte_data(client, REG_PRODUCT_ID); switch (status) { case 0x34: /* EMC2305 */ diff --git a/platform/broadcom/sonic-platform-modules-cel/haliburton/modules/pmbus.h b/platform/broadcom/sonic-platform-modules-cel/haliburton/modules/pmbus.h deleted file mode 100644 index 521baf6da49a..000000000000 --- a/platform/broadcom/sonic-platform-modules-cel/haliburton/modules/pmbus.h +++ /dev/null @@ -1,425 +0,0 @@ -/* - * pmbus.h - Common defines and structures for PMBus devices - * - * Copyright (c) 2010, 2011 Ericsson AB. - * Copyright (c) 2012 Guenter Roeck - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#ifndef PMBUS_H -#define PMBUS_H - -#include -#include - -/* - * Registers - */ -enum pmbus_regs { - PMBUS_PAGE = 0x00, - PMBUS_OPERATION = 0x01, - PMBUS_ON_OFF_CONFIG = 0x02, - PMBUS_CLEAR_FAULTS = 0x03, - PMBUS_PHASE = 0x04, - - PMBUS_CAPABILITY = 0x19, - PMBUS_QUERY = 0x1A, - - PMBUS_VOUT_MODE = 0x20, - PMBUS_VOUT_COMMAND = 0x21, - PMBUS_VOUT_TRIM = 0x22, - PMBUS_VOUT_CAL_OFFSET = 0x23, - PMBUS_VOUT_MAX = 0x24, - PMBUS_VOUT_MARGIN_HIGH = 0x25, - PMBUS_VOUT_MARGIN_LOW = 0x26, - PMBUS_VOUT_TRANSITION_RATE = 0x27, - PMBUS_VOUT_DROOP = 0x28, - PMBUS_VOUT_SCALE_LOOP = 0x29, - PMBUS_VOUT_SCALE_MONITOR = 0x2A, - - PMBUS_COEFFICIENTS = 0x30, - PMBUS_POUT_MAX = 0x31, - - PMBUS_FAN_CONFIG_12 = 0x3A, - PMBUS_FAN_COMMAND_1 = 0x3B, - PMBUS_FAN_COMMAND_2 = 0x3C, - PMBUS_FAN_CONFIG_34 = 0x3D, - PMBUS_FAN_COMMAND_3 = 0x3E, - PMBUS_FAN_COMMAND_4 = 0x3F, - - PMBUS_VOUT_OV_FAULT_LIMIT = 0x40, - PMBUS_VOUT_OV_FAULT_RESPONSE = 0x41, - PMBUS_VOUT_OV_WARN_LIMIT = 0x42, - PMBUS_VOUT_UV_WARN_LIMIT = 0x43, - PMBUS_VOUT_UV_FAULT_LIMIT = 0x44, - PMBUS_VOUT_UV_FAULT_RESPONSE = 0x45, - PMBUS_IOUT_OC_FAULT_LIMIT = 0x46, - PMBUS_IOUT_OC_FAULT_RESPONSE = 0x47, - PMBUS_IOUT_OC_LV_FAULT_LIMIT = 0x48, - PMBUS_IOUT_OC_LV_FAULT_RESPONSE = 0x49, - PMBUS_IOUT_OC_WARN_LIMIT = 0x4A, - PMBUS_IOUT_UC_FAULT_LIMIT = 0x4B, - PMBUS_IOUT_UC_FAULT_RESPONSE = 0x4C, - - PMBUS_OT_FAULT_LIMIT = 0x4F, - PMBUS_OT_FAULT_RESPONSE = 0x50, - PMBUS_OT_WARN_LIMIT = 0x51, - PMBUS_UT_WARN_LIMIT = 0x52, - PMBUS_UT_FAULT_LIMIT = 0x53, - PMBUS_UT_FAULT_RESPONSE = 0x54, - PMBUS_VIN_OV_FAULT_LIMIT = 0x55, - PMBUS_VIN_OV_FAULT_RESPONSE = 0x56, - PMBUS_VIN_OV_WARN_LIMIT = 0x57, - PMBUS_VIN_UV_WARN_LIMIT = 0x58, - PMBUS_VIN_UV_FAULT_LIMIT = 0x59, - - PMBUS_IIN_OC_FAULT_LIMIT = 0x5B, - PMBUS_IIN_OC_WARN_LIMIT = 0x5D, - - PMBUS_POUT_OP_FAULT_LIMIT = 0x68, - PMBUS_POUT_OP_WARN_LIMIT = 0x6A, - PMBUS_PIN_OP_WARN_LIMIT = 0x6B, - - PMBUS_STATUS_BYTE = 0x78, - PMBUS_STATUS_WORD = 0x79, - PMBUS_STATUS_VOUT = 0x7A, - PMBUS_STATUS_IOUT = 0x7B, - PMBUS_STATUS_INPUT = 0x7C, - PMBUS_STATUS_TEMPERATURE = 0x7D, - PMBUS_STATUS_CML = 0x7E, - PMBUS_STATUS_OTHER = 0x7F, - PMBUS_STATUS_MFR_SPECIFIC = 0x80, - PMBUS_STATUS_FAN_12 = 0x81, - PMBUS_STATUS_FAN_34 = 0x82, - - PMBUS_READ_VIN = 0x88, - PMBUS_READ_IIN = 0x89, - PMBUS_READ_VCAP = 0x8A, - PMBUS_READ_VOUT = 0x8B, - PMBUS_READ_IOUT = 0x8C, - PMBUS_READ_TEMPERATURE_1 = 0x8D, - PMBUS_READ_TEMPERATURE_2 = 0x8E, - PMBUS_READ_TEMPERATURE_3 = 0x8F, - PMBUS_READ_FAN_SPEED_1 = 0x90, - PMBUS_READ_FAN_SPEED_2 = 0x91, - PMBUS_READ_FAN_SPEED_3 = 0x92, - PMBUS_READ_FAN_SPEED_4 = 0x93, - PMBUS_READ_DUTY_CYCLE = 0x94, - PMBUS_READ_FREQUENCY = 0x95, - PMBUS_READ_POUT = 0x96, - PMBUS_READ_PIN = 0x97, - - PMBUS_REVISION = 0x98, - PMBUS_MFR_ID = 0x99, - PMBUS_MFR_MODEL = 0x9A, - PMBUS_MFR_REVISION = 0x9B, - PMBUS_MFR_LOCATION = 0x9C, - PMBUS_MFR_DATE = 0x9D, - PMBUS_MFR_SERIAL = 0x9E, - -/* - * Virtual registers. - * Useful to support attributes which are not supported by standard PMBus - * registers but exist as manufacturer specific registers on individual chips. - * Must be mapped to real registers in device specific code. - * - * Semantics: - * Virtual registers are all word size. - * READ registers are read-only; writes are either ignored or return an error. - * RESET registers are read/write. Reading reset registers returns zero - * (used for detection), writing any value causes the associated history to be - * reset. - * Virtual registers have to be handled in device specific driver code. Chip - * driver code returns non-negative register values if a virtual register is - * supported, or a negative error code if not. The chip driver may return - * -ENODATA or any other error code in this case, though an error code other - * than -ENODATA is handled more efficiently and thus preferred. Either case, - * the calling PMBus core code will abort if the chip driver returns an error - * code when reading or writing virtual registers. - */ - PMBUS_VIRT_BASE = 0x100, - PMBUS_VIRT_READ_TEMP_AVG, - PMBUS_VIRT_READ_TEMP_MIN, - PMBUS_VIRT_READ_TEMP_MAX, - PMBUS_VIRT_RESET_TEMP_HISTORY, - PMBUS_VIRT_READ_VIN_AVG, - PMBUS_VIRT_READ_VIN_MIN, - PMBUS_VIRT_READ_VIN_MAX, - PMBUS_VIRT_RESET_VIN_HISTORY, - PMBUS_VIRT_READ_IIN_AVG, - PMBUS_VIRT_READ_IIN_MIN, - PMBUS_VIRT_READ_IIN_MAX, - PMBUS_VIRT_RESET_IIN_HISTORY, - PMBUS_VIRT_READ_PIN_AVG, - PMBUS_VIRT_READ_PIN_MIN, - PMBUS_VIRT_READ_PIN_MAX, - PMBUS_VIRT_RESET_PIN_HISTORY, - PMBUS_VIRT_READ_POUT_AVG, - PMBUS_VIRT_READ_POUT_MIN, - PMBUS_VIRT_READ_POUT_MAX, - PMBUS_VIRT_RESET_POUT_HISTORY, - PMBUS_VIRT_READ_VOUT_AVG, - PMBUS_VIRT_READ_VOUT_MIN, - PMBUS_VIRT_READ_VOUT_MAX, - PMBUS_VIRT_RESET_VOUT_HISTORY, - PMBUS_VIRT_READ_IOUT_AVG, - PMBUS_VIRT_READ_IOUT_MIN, - PMBUS_VIRT_READ_IOUT_MAX, - PMBUS_VIRT_RESET_IOUT_HISTORY, - PMBUS_VIRT_READ_TEMP2_AVG, - PMBUS_VIRT_READ_TEMP2_MIN, - PMBUS_VIRT_READ_TEMP2_MAX, - PMBUS_VIRT_RESET_TEMP2_HISTORY, - - PMBUS_VIRT_READ_VMON, - PMBUS_VIRT_VMON_UV_WARN_LIMIT, - PMBUS_VIRT_VMON_OV_WARN_LIMIT, - PMBUS_VIRT_VMON_UV_FAULT_LIMIT, - PMBUS_VIRT_VMON_OV_FAULT_LIMIT, - PMBUS_VIRT_STATUS_VMON, -}; - -/* - * OPERATION - */ -#define PB_OPERATION_CONTROL_ON BIT(7) - -/* - * CAPABILITY - */ -#define PB_CAPABILITY_SMBALERT BIT(4) -#define PB_CAPABILITY_ERROR_CHECK BIT(7) - -/* - * VOUT_MODE - */ -#define PB_VOUT_MODE_MODE_MASK 0xe0 -#define PB_VOUT_MODE_PARAM_MASK 0x1f - -#define PB_VOUT_MODE_LINEAR 0x00 -#define PB_VOUT_MODE_VID 0x20 -#define PB_VOUT_MODE_DIRECT 0x40 - -/* - * Fan configuration - */ -#define PB_FAN_2_PULSE_MASK (BIT(0) | BIT(1)) -#define PB_FAN_2_RPM BIT(2) -#define PB_FAN_2_INSTALLED BIT(3) -#define PB_FAN_1_PULSE_MASK (BIT(4) | BIT(5)) -#define PB_FAN_1_RPM BIT(6) -#define PB_FAN_1_INSTALLED BIT(7) - -/* - * STATUS_BYTE, STATUS_WORD (lower) - */ -#define PB_STATUS_NONE_ABOVE BIT(0) -#define PB_STATUS_CML BIT(1) -#define PB_STATUS_TEMPERATURE BIT(2) -#define PB_STATUS_VIN_UV BIT(3) -#define PB_STATUS_IOUT_OC BIT(4) -#define PB_STATUS_VOUT_OV BIT(5) -#define PB_STATUS_OFF BIT(6) -#define PB_STATUS_BUSY BIT(7) - -/* - * STATUS_WORD (upper) - */ -#define PB_STATUS_UNKNOWN BIT(8) -#define PB_STATUS_OTHER BIT(9) -#define PB_STATUS_FANS BIT(10) -#define PB_STATUS_POWER_GOOD_N BIT(11) -#define PB_STATUS_WORD_MFR BIT(12) -#define PB_STATUS_INPUT BIT(13) -#define PB_STATUS_IOUT_POUT BIT(14) -#define PB_STATUS_VOUT BIT(15) - -/* - * STATUS_IOUT - */ -#define PB_POUT_OP_WARNING BIT(0) -#define PB_POUT_OP_FAULT BIT(1) -#define PB_POWER_LIMITING BIT(2) -#define PB_CURRENT_SHARE_FAULT BIT(3) -#define PB_IOUT_UC_FAULT BIT(4) -#define PB_IOUT_OC_WARNING BIT(5) -#define PB_IOUT_OC_LV_FAULT BIT(6) -#define PB_IOUT_OC_FAULT BIT(7) - -/* - * STATUS_VOUT, STATUS_INPUT - */ -#define PB_VOLTAGE_UV_FAULT BIT(4) -#define PB_VOLTAGE_UV_WARNING BIT(5) -#define PB_VOLTAGE_OV_WARNING BIT(6) -#define PB_VOLTAGE_OV_FAULT BIT(7) - -/* - * STATUS_INPUT - */ -#define PB_PIN_OP_WARNING BIT(0) -#define PB_IIN_OC_WARNING BIT(1) -#define PB_IIN_OC_FAULT BIT(2) - -/* - * STATUS_TEMPERATURE - */ -#define PB_TEMP_UT_FAULT BIT(4) -#define PB_TEMP_UT_WARNING BIT(5) -#define PB_TEMP_OT_WARNING BIT(6) -#define PB_TEMP_OT_FAULT BIT(7) - -/* - * STATUS_FAN - */ -#define PB_FAN_AIRFLOW_WARNING BIT(0) -#define PB_FAN_AIRFLOW_FAULT BIT(1) -#define PB_FAN_FAN2_SPEED_OVERRIDE BIT(2) -#define PB_FAN_FAN1_SPEED_OVERRIDE BIT(3) -#define PB_FAN_FAN2_WARNING BIT(4) -#define PB_FAN_FAN1_WARNING BIT(5) -#define PB_FAN_FAN2_FAULT BIT(6) -#define PB_FAN_FAN1_FAULT BIT(7) - -/* - * CML_FAULT_STATUS - */ -#define PB_CML_FAULT_OTHER_MEM_LOGIC BIT(0) -#define PB_CML_FAULT_OTHER_COMM BIT(1) -#define PB_CML_FAULT_PROCESSOR BIT(3) -#define PB_CML_FAULT_MEMORY BIT(4) -#define PB_CML_FAULT_PACKET_ERROR BIT(5) -#define PB_CML_FAULT_INVALID_DATA BIT(6) -#define PB_CML_FAULT_INVALID_COMMAND BIT(7) - -enum pmbus_sensor_classes { - PSC_VOLTAGE_IN = 0, - PSC_VOLTAGE_OUT, - PSC_CURRENT_IN, - PSC_CURRENT_OUT, - PSC_POWER, - PSC_TEMPERATURE, - PSC_FAN, - PSC_NUM_CLASSES /* Number of power sensor classes */ -}; - -#define PMBUS_PAGES 32 /* Per PMBus specification */ - -/* Functionality bit mask */ -#define PMBUS_HAVE_VIN BIT(0) -#define PMBUS_HAVE_VCAP BIT(1) -#define PMBUS_HAVE_VOUT BIT(2) -#define PMBUS_HAVE_IIN BIT(3) -#define PMBUS_HAVE_IOUT BIT(4) -#define PMBUS_HAVE_PIN BIT(5) -#define PMBUS_HAVE_POUT BIT(6) -#define PMBUS_HAVE_FAN12 BIT(7) -#define PMBUS_HAVE_FAN34 BIT(8) -#define PMBUS_HAVE_TEMP BIT(9) -#define PMBUS_HAVE_TEMP2 BIT(10) -#define PMBUS_HAVE_TEMP3 BIT(11) -#define PMBUS_HAVE_STATUS_VOUT BIT(12) -#define PMBUS_HAVE_STATUS_IOUT BIT(13) -#define PMBUS_HAVE_STATUS_INPUT BIT(14) -#define PMBUS_HAVE_STATUS_TEMP BIT(15) -#define PMBUS_HAVE_STATUS_FAN12 BIT(16) -#define PMBUS_HAVE_STATUS_FAN34 BIT(17) -#define PMBUS_HAVE_VMON BIT(18) -#define PMBUS_HAVE_STATUS_VMON BIT(19) - -enum pmbus_data_format { linear = 0, direct, vid }; -enum vrm_version { vr11 = 0, vr12 }; - -struct pmbus_driver_info { - int pages; /* Total number of pages */ - enum pmbus_data_format format[PSC_NUM_CLASSES]; - enum vrm_version vrm_version; - /* - * Support one set of coefficients for each sensor type - * Used for chips providing data in direct mode. - */ - int m[PSC_NUM_CLASSES]; /* mantissa for direct data format */ - int b[PSC_NUM_CLASSES]; /* offset */ - int R[PSC_NUM_CLASSES]; /* exponent */ - - u32 func[PMBUS_PAGES]; /* Functionality, per page */ - /* - * The following functions map manufacturing specific register values - * to PMBus standard register values. Specify only if mapping is - * necessary. - * Functions return the register value (read) or zero (write) if - * successful. A return value of -ENODATA indicates that there is no - * manufacturer specific register, but that a standard PMBus register - * may exist. Any other negative return value indicates that the - * register does not exist, and that no attempt should be made to read - * the standard register. - */ - int (*read_byte_data)(struct i2c_client *client, int page, int reg); - int (*read_word_data)(struct i2c_client *client, int page, int reg); - int (*write_word_data)(struct i2c_client *client, int page, int reg, - u16 word); - int (*write_byte)(struct i2c_client *client, int page, u8 value); - /* - * The identify function determines supported PMBus functionality. - * This function is only necessary if a chip driver supports multiple - * chips, and the chip functionality is not pre-determined. - */ - int (*identify)(struct i2c_client *client, - struct pmbus_driver_info *info); - - /* Regulator functionality, if supported by this chip driver. */ - int num_regulators; - const struct regulator_desc *reg_desc; -}; - -/* Regulator ops */ - -extern const struct regulator_ops pmbus_regulator_ops; - -/* Macro for filling in array of struct regulator_desc */ -#define PMBUS_REGULATOR(_name, _id) \ - [_id] = { \ - .name = (_name # _id), \ - .id = (_id), \ - .of_match = of_match_ptr(_name # _id), \ - .regulators_node = of_match_ptr("regulators"), \ - .ops = &pmbus_regulator_ops, \ - .type = REGULATOR_VOLTAGE, \ - .owner = THIS_MODULE, \ - } - -/* Function declarations */ - -void pmbus_clear_cache(struct i2c_client *client); -int pmbus_set_page(struct i2c_client *client, u8 page); -int pmbus_read_word_data(struct i2c_client *client, u8 page, u8 reg); -int pmbus_write_word_data(struct i2c_client *client, u8 page, u8 reg, u16 word); -int pmbus_read_byte_data(struct i2c_client *client, int page, u8 reg); -int pmbus_write_byte(struct i2c_client *client, int page, u8 value); -int pmbus_write_byte_data(struct i2c_client *client, int page, u8 reg, - u8 value); -int pmbus_update_byte_data(struct i2c_client *client, int page, u8 reg, - u8 mask, u8 value); -void pmbus_clear_faults(struct i2c_client *client); -bool pmbus_check_byte_register(struct i2c_client *client, int page, int reg); -bool pmbus_check_word_register(struct i2c_client *client, int page, int reg); -int pmbus_do_probe(struct i2c_client *client, const struct i2c_device_id *id, - struct pmbus_driver_info *info); -int pmbus_do_remove(struct i2c_client *client); -const struct pmbus_driver_info *pmbus_get_driver_info(struct i2c_client - *client); - -#endif /* PMBUS_H */ \ No newline at end of file diff --git a/platform/broadcom/sonic-platform-modules-cel/haliburton/script/fancontrol.sh b/platform/broadcom/sonic-platform-modules-cel/haliburton/script/fancontrol.sh index f2c0f3cd0f4e..03617a1fad36 100755 --- a/platform/broadcom/sonic-platform-modules-cel/haliburton/script/fancontrol.sh +++ b/platform/broadcom/sonic-platform-modules-cel/haliburton/script/fancontrol.sh @@ -7,72 +7,37 @@ # Default-Start: 2 3 4 5 # Default-Stop: # Short-Description: fancontrol -# Description: fan speed regulator +# Description: fancontrol configuration selector ### END INIT INFO . /lib/lsb/init-functions [ -f /etc/default/rcS ] && . /etc/default/rcS -PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin -DAEMON=/usr/local/bin/fancontrol -DESC="fan speed regulator" -NAME="fancontrol" -PIDFILE=/var/run/fancontrol.pid -PLATFORMPATH=/sys/devices/platform/e1031.smc MAIN_CONF=/usr/share/sonic/device/x86_64-cel_e1031-r0/fancontrol -DEVPATH=/sys/devices/pci0000:00/0000:00:13.0/i2c-0/i2c-8/i2c-23/23-004d +PLATFORM_PATH=/sys/devices/platform/e1031.smc -test -x $DAEMON || exit 0 +init() { + FANDIR=$(cat ${PLATFORM_PATH}/fan1_dir) + CONF=${MAIN_CONF}-${FANDIR} + echo $FANDIR > /usr/share/sonic/device/x86_64-cel_e1031-r0/fan_airflow +} -for i in 1 2 3 -do - j=$i - [ $i -eq 3 ] && j=4 - FANFAULT=$(cat ${DEVPATH}/fan${j}_fault) - [ $FANFAULT = 1 ] && continue - FANDIR=$(cat ${PLATFORMPATH}/fan${i}_dir) -done -CONF=${MAIN_CONF}-${FANDIR} +install() { + find /var/lib/docker/overlay*/ -path */sbin/fancontrol -exec cp /usr/local/bin/fancontrol {} \; +} case "$1" in - start) - if [ -f $CONF ] ; then - if $DAEMON --check $CONF 1>/dev/null 2>/dev/null ; then - log_daemon_msg "Starting $DESC" "$NAME\n" - start-stop-daemon --start --quiet --pidfile $PIDFILE --startas $DAEMON $CONF - log_end_msg $? - else - log_failure_msg "Not starting fancontrol, broken configuration file; please re-run pwmconfig." - fi - else - if [ "$VERBOSE" != no ]; then - log_warning_msg "Not starting fancontrol; run pwmconfig first." - fi - fi - ;; - stop) - log_daemon_msg "Stopping $DESC" "$NAME" - start-stop-daemon --stop --quiet --pidfile $PIDFILE --oknodo --startas $DAEMON $CONF - rm -f $PIDFILE - log_end_msg $? - ;; - restart) - $0 stop - sleep 3 - $0 start - ;; - force-reload) - if start-stop-daemon --stop --test --quiet --pidfile $PIDFILE --startas $DAEMON $CONF ; then - $0 restart - fi - ;; - status) - status_of_proc $DAEMON $NAME $CONF && exit 0 || exit $? - ;; - *) - log_success_msg "Usage: /etc/init.d/fancontrol {start|stop|restart|force-reload|status}" - exit 1 - ;; +start) + init + cp $CONF $MAIN_CONF + ;; +install) + install + ;; +*) + log_success_msg "Usage: /etc/init.d/fancontrol {start} | {install}" + exit 1 + ;; esac -exit 0 \ No newline at end of file +exit 0 diff --git a/platform/broadcom/sonic-platform-modules-cel/haliburton/script/reload_udev.sh b/platform/broadcom/sonic-platform-modules-cel/haliburton/script/reload_udev.sh new file mode 100644 index 000000000000..aa4e2c67cd4d --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-cel/haliburton/script/reload_udev.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +UDEV_DIR=/etc/udev/rules.d/50-ttyUSB-C0.rules +TTYUSB_DIR=/dev/ttyUSB + +if [ -f "$UDEV_DIR" ]; then + for i in {0..95} + do + ttydev=$TTYUSB_DIR$i + if [ -c "$ttydev" ]; then + udevadm trigger -c add $ttydev + fi + done +fi diff --git a/platform/broadcom/sonic-platform-modules-cel/haliburton/script/udev_prefix.sh b/platform/broadcom/sonic-platform-modules-cel/haliburton/script/udev_prefix.sh index 20fa0a278808..c5842fab0a7e 100644 --- a/platform/broadcom/sonic-platform-modules-cel/haliburton/script/udev_prefix.sh +++ b/platform/broadcom/sonic-platform-modules-cel/haliburton/script/udev_prefix.sh @@ -3,21 +3,21 @@ PREV_REBOOT_CAUSE="/host/reboot-cause/" DEVICE="/usr/share/sonic/device" PLATFORM=$(/usr/local/bin/sonic-cfggen -H -v DEVICE_METADATA.localhost.platform) -FILES=$DEVICE/$PLATFORM/plugins +PLATFORM_PATH=$DEVICE/$PLATFORM FILENAME="udevprefix.conf" if [ "$1" = "clear" ] then - if [ -e $FILES/$FILENAME ]; then - rm $FILES/$FILENAME + if [ -e $PLATFORM_PATH/$FILENAME ]; then + rm $PLATFORM_PATH/$FILENAME fi else - if [ -e $FILES/$FILENAME ]; then - : > $FILES/$FILENAME - echo -n "$1" > $FILES/$FILENAME + if [ -e $PLATFORM_PATH/$FILENAME ]; then + : > $PLATFORM_PATH/$FILENAME + echo -n "$1" > $PLATFORM_PATH/$FILENAME else - touch $FILES/$FILENMAE - echo -n "$1" > $FILES/$FILENAME + touch $PLATFORM_PATH/$FILENMAE + echo -n "$1" > $PLATFORM_PATH/$FILENAME fi fi diff --git a/platform/broadcom/sonic-platform-modules-cel/services/fancontrol/fancontrol b/platform/broadcom/sonic-platform-modules-cel/services/fancontrol/fancontrol index cdd5005e3688..e625ce9a921e 100755 --- a/platform/broadcom/sonic-platform-modules-cel/services/fancontrol/fancontrol +++ b/platform/broadcom/sonic-platform-modules-cel/services/fancontrol/fancontrol @@ -180,42 +180,6 @@ function LoadConfig } -function CheckFanFault() -{ - let fancount=0 - while (( $fancount < ${#AFCFANFAULT[@]} )) # go through all fan fault. - do - fault=`cat ${AFCFANFAULT[$fancount]}` - if [[ "$fault" == "1" ]] - then - return 1 # fan fault detected - fi - let fancount=$fancount+1 - done - return 0 -} - -function CheckTempOver() -{ - let tempcount=0 - while (( $tempcount < ${#CSTEMP[@]} )) # go through all temp. - do - ctemp=`cat ${CSTEMP[$tempcount]}` - let maxcrit="${CSMAXTEMPCRIT[$tempcount]}*1000" - if [ $ctemp -ge $maxcrit ] - then - logger "Thermal overload : ${CSMAXTEMPTYPE[$tempcount]} temperature ${ctemp} > ${maxcrit}" - if [ -f "$THERMAL_OVERLOAD_CONTROL_FILE" ] - then - toc_cmd="${THERMAL_OVERLOAD_CONTROL_FILE} ${CSMAXTEMPTYPE[$tempcount],,}" - bash $toc_cmd - exit 1 - fi - fi - let tempcount=$tempcount+1 - done - return 0 -} function DevicePath() { @@ -384,8 +348,12 @@ CheckFiles || exit 1 if [ -f "$PIDFILE" ] then - echo "File $PIDFILE exists, is fancontrol already running?" >&2 - exit 1 + # Test if process is really running, if not, no need to exit + if ps -p $(echo $PIDFILE) > /dev/null + then + echo "File $PIDFILE exists, is fancontrol already running?" >&2 + exit 1 + fi fi echo $$ > "$PIDFILE" @@ -508,18 +476,6 @@ function UpdateFanSpeeds maxpwm=${AFCMAXPWM[$fcvcount]} let tHyst="${AFCTHYST[$fcvcount]}*1000" - #if some fan fault detected all pwm=100% - CheckFanFault - if [ $? -ne 0 ] - then - echo $MAX > $pwmo - let fcvcount=$fcvcount+1 - continue - fi - - #check thermal overload - CheckTempOver - read tval < ${tsens} if [ $? -ne 0 ] then @@ -619,7 +575,7 @@ function UpdateFanSpeeds echo $minsa > $pwmo # Sleep while still handling signals sleep 1 & - wait $! + wait fi fi echo $pwmval > $pwmo # write new value to pwm output @@ -658,5 +614,5 @@ do UpdateFanSpeeds # Sleep while still handling signals sleep $INTERVAL & - wait $! + wait done diff --git a/platform/broadcom/sonic-platform-modules-cel/services/platform_api/platform_api_mgnt.sh b/platform/broadcom/sonic-platform-modules-cel/services/platform_api/platform_api_mgnt.sh index e1d330357894..208c8696c4b3 100755 --- a/platform/broadcom/sonic-platform-modules-cel/services/platform_api/platform_api_mgnt.sh +++ b/platform/broadcom/sonic-platform-modules-cel/services/platform_api/platform_api_mgnt.sh @@ -4,12 +4,20 @@ PREV_REBOOT_CAUSE="/host/reboot-cause/" DEVICE="/usr/share/sonic/device" PLATFORM=$(/usr/local/bin/sonic-cfggen -H -v DEVICE_METADATA.localhost.platform) FILES=$DEVICE/$PLATFORM/api_files +PY2_PACK=$DEVICE/$PLATFORM/sonic_platform-1.0-py2-none-any.whl +PY3_PACK=$DEVICE/$PLATFORM/sonic_platform-1.0-py3-none-any.whl install() { - # Install sonic-platform package - if [ -e $DEVICE/$PLATFORM/sonic_platform-1.0-py2-none-any.whl ]; then - pip install $DEVICE/$PLATFORM/sonic_platform-1.0-py2-none-any.whl + # Install python2.7 sonic-platform package + if [ -e $PY2_PACK ]; then + pip install $PY2_PACK fi + + # Install python3 sonic-platform package + if [ -e $PY3_PACK ]; then + pip3 install $PY3_PACK + fi + } init() { diff --git a/platform/broadcom/sonic-platform-modules-cel/services/platform_api/sonic_platform/eeprom.py b/platform/broadcom/sonic-platform-modules-cel/services/platform_api/sonic_platform/eeprom.py index 7756c0f2f839..1e06e7b80e62 100644 --- a/platform/broadcom/sonic-platform-modules-cel/services/platform_api/sonic_platform/eeprom.py +++ b/platform/broadcom/sonic-platform-modules-cel/services/platform_api/sonic_platform/eeprom.py @@ -45,7 +45,7 @@ def _parse_output(self, decode_output): for line in lines: try: match = re.search( - '(0x[0-9a-fA-F]{2})([\s]+[\S]+[\s]+)([\S]+)', line) + '(0x[0-9a-fA-F]{2})([\s]+[\S]+[\s]+)(.*$)', line) if match is not None: idx = match.group(1) value = match.group(3).rstrip('\0') diff --git a/platform/broadcom/sonic-platform-modules-cel/services/platform_api/sonic_platform/sfp.py b/platform/broadcom/sonic-platform-modules-cel/services/platform_api/sonic_platform/sfp.py index 17f2756dee1a..07eac37d8d82 100644 --- a/platform/broadcom/sonic-platform-modules-cel/services/platform_api/sonic_platform/sfp.py +++ b/platform/broadcom/sonic-platform-modules-cel/services/platform_api/sonic_platform/sfp.py @@ -358,7 +358,7 @@ def _dom_capability_detect(self): QSFP_VERSION_COMPLIANCE_OFFSET, QSFP_VERSION_COMPLIANCE_WIDTH) qsfp_version_compliance = int( qsfp_version_compliance_raw[0], 16) - dom_capability = sfpi_obj.parse_qsfp_dom_capability( + dom_capability = sfpi_obj.parse_dom_capability( qsfp_dom_capability_raw, 0) if qsfp_version_compliance >= 0x08: self.dom_temp_supported = dom_capability['data']['Temp_support']['value'] == 'On' @@ -407,7 +407,7 @@ def _dom_capability_detect(self): if qsfp_dom_capability_raw is not None: self.dom_temp_supported = True self.dom_volt_supported = True - dom_capability = sfpi_obj.parse_qsfp_dom_capability( + dom_capability = sfpi_obj.parse_dom_capability( qsfp_dom_capability_raw, 0) if dom_capability['data']['Flat_MEM']['value'] == 'Off': self.dom_supported = True diff --git a/platform/broadcom/sonic-platform-modules-dell/common/dell_pmc.c b/platform/broadcom/sonic-platform-modules-dell/common/dell_pmc.c index 3193e8b4642f..5712c0fbb552 100644 --- a/platform/broadcom/sonic-platform-modules-dell/common/dell_pmc.c +++ b/platform/broadcom/sonic-platform-modules-dell/common/dell_pmc.c @@ -174,6 +174,9 @@ /* Mailbox PowerOn Reason */ #define TRACK_POWERON_REASON 0x05FF +/* System Status LED */ +#define SYSTEM_STATUS_LED 0x04DF + /* CPU Set IO Modules */ #define CPU_IOM1_CTRL_FLAG 0x04D9 #define CPU_IOM2_CTRL_FLAG 0x04DA @@ -607,6 +610,44 @@ static ssize_t show_mb_poweron_reason(struct device *dev, return sprintf(buf, "0x%x\n", ret); } +/* System Status LED */ +static ssize_t set_sys_status_led(struct device *dev, + struct device_attribute *devattr, const char *buf, size_t count) +{ + int err = 0; + unsigned int dev_data = 0; + struct smf_data *data = dev_get_drvdata(dev); + + if (data->kind == z9100smf) + return -1; + + err = kstrtouint(buf, 16, &dev_data); + if (err) + return err; + + err = smf_write_reg(data, SYSTEM_STATUS_LED, dev_data); + if(err < 0) + return err; + + return count; +} + +static ssize_t show_sys_status_led(struct device *dev, + struct device_attribute *devattr, char *buf) +{ + unsigned int ret = 0; + struct smf_data *data = dev_get_drvdata(dev); + + if (data->kind == z9100smf) + return 0; + + ret = smf_read_reg(data, SYSTEM_STATUS_LED); + if(ret < 0) + return ret; + + return sprintf(buf, "0x%x\n", ret); +} + /* FANIN ATTR */ static ssize_t show_fan_label(struct device *dev, struct device_attribute *attr, char *buf) @@ -2081,12 +2122,17 @@ static SENSOR_DEVICE_ATTR(smf_poweron_reason, S_IRUGO, static SENSOR_DEVICE_ATTR(mb_poweron_reason, S_IRUGO|S_IWUSR, show_mb_poweron_reason, set_mb_poweron_reason, 0); +/* System Status LED */ +static SENSOR_DEVICE_ATTR(sys_status_led, S_IRUGO|S_IWUSR, + show_sys_status_led, set_sys_status_led, 0); + static struct attribute *smf_dell_attrs[] = { &sensor_dev_attr_smf_version.dev_attr.attr, &sensor_dev_attr_smf_firmware_ver.dev_attr.attr, &sensor_dev_attr_smf_reset_reason.dev_attr.attr, &sensor_dev_attr_smf_poweron_reason.dev_attr.attr, &sensor_dev_attr_mb_poweron_reason.dev_attr.attr, + &sensor_dev_attr_sys_status_led.dev_attr.attr, &sensor_dev_attr_fan_tray_presence.dev_attr.attr, &sensor_dev_attr_fan1_airflow.dev_attr.attr, &sensor_dev_attr_fan3_airflow.dev_attr.attr, diff --git a/platform/broadcom/sonic-platform-modules-dell/common/ipmihelper.py b/platform/broadcom/sonic-platform-modules-dell/common/ipmihelper.py index f70c505d4914..3908f90bdad4 100644 --- a/platform/broadcom/sonic-platform-modules-dell/common/ipmihelper.py +++ b/platform/broadcom/sonic-platform-modules-dell/common/ipmihelper.py @@ -33,12 +33,12 @@ def get_ipmitool_raw_output(args): command = "ipmitool raw {}".format(args) try: proc = subprocess.Popen(command.split(), stdout=subprocess.PIPE, - stderr=subprocess.STDOUT) + universal_newlines=True, stderr=subprocess.STDOUT) stdout = proc.communicate()[0] proc.wait() if not proc.returncode: result = stdout.rstrip('\n') - except: + except EnvironmentError: pass for i in result.split(): @@ -90,7 +90,10 @@ def get_twos_complement(val, bits): R_exp = get_twos_complement((factors[6] & 0xF0) >> 4, 4) B_exp = get_twos_complement(factors[6] & 0x0F, 4) - converted_reading = ((M * raw_value) + (B * 10**B_exp)) * 10**R_exp + if R_exp < 0: + converted_reading = ((M * raw_value) + (B * 10**B_exp)) / 10**(-R_exp) + else: + converted_reading = ((M * raw_value) + (B * 10**B_exp)) * 10**R_exp return True, converted_reading @@ -175,12 +178,12 @@ def _get_ipmitool_fru_print(self): command = "ipmitool fru print {}".format(self.id) try: proc = subprocess.Popen(command.split(), stdout=subprocess.PIPE, - stderr=subprocess.STDOUT) + universal_newlines=True, stderr=subprocess.STDOUT) stdout = proc.communicate()[0] proc.wait() if not proc.returncode: - result = stdout.decode('utf-8').rstrip('\n') - except: + result = stdout.rstrip('\n') + except EnvironmentError: pass return result @@ -248,12 +251,12 @@ def get_fru_data(self, offset, count=1): offset_MSB, count) try: proc = subprocess.Popen(command.split(), stdout=subprocess.PIPE, - stderr=subprocess.STDOUT) + universal_newlines=True, stderr=subprocess.STDOUT) stdout = proc.communicate()[0] proc.wait() if not proc.returncode: - result = stdout.decode('utf-8').rstrip('\n') - except: + result = stdout.rstrip('\n') + except EnvironmentError: is_valid = False if (not result) or (not is_valid): diff --git a/platform/broadcom/sonic-platform-modules-dell/common/onie_stage_fwpkg b/platform/broadcom/sonic-platform-modules-dell/common/onie_stage_fwpkg new file mode 100755 index 000000000000..dcc74a09a91e --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-dell/common/onie_stage_fwpkg @@ -0,0 +1,70 @@ +#!/bin/bash + +ONIE_PATH="/mnt/onie-boot" +ONIE_PENDING_DIR="${ONIE_PATH}/onie/update/pending" + +unset FWPKG + +function stage_fwpkg() +{ + local name=$(basename ${FWPKG}) + local pending="${ONIE_PENDING_DIR}/$name" + + # Exit if not superuser + if [[ "$EUID" -ne 0 ]]; then + echo "ERROR: This command must be run as root" >&2 + exit 1 + fi + + # Mount ONIE partition if not already mounted + if ! grep -qs ${ONIE_PATH} /proc/mounts; then + mkdir -p ${ONIE_PATH} + mount LABEL=ONIE-BOOT ${ONIE_PATH} || { + echo "ERROR: Failed to mount ONIE partition" + exit 1 + } + fi + + [ -f "$pending" ] && { + echo "INFO: Firmware update package ${name} is already staged" + exit 2 + } + + ${ONIE_PATH}/onie/tools/bin/onie-fwpkg add ${FWPKG} || { + echo "ERROR: onie-fwpkg add for ${name} failed" + exit 1 + } +} + +SCRIPT=$0 + +function show_help_and_exit() +{ + echo "Usage ${SCRIPT} [options]" + echo " This script will stage ONIE firmware update package." + echo " " + echo " Available options:" + echo " -h, -? : getting this help" + echo " -a [fwpkg] : stages the firmware update package" + + exit 0 +} + + +function parse_options() +{ + while getopts ":h?a:" opt; do + case $opt in + a ) + FWPKG=$(realpath $OPTARG) + stage_fwpkg + ;; + h|\? ) + show_help_and_exit + ;; + esac + done +} + +parse_options $@ +exit 0 diff --git a/platform/broadcom/sonic-platform-modules-dell/common/sonic_platform/hwaccess.py b/platform/broadcom/sonic-platform-modules-dell/common/sonic_platform/hwaccess.py index b0020144a4fb..642a6ddc6fc8 100644 --- a/platform/broadcom/sonic-platform-modules-dell/common/sonic_platform/hwaccess.py +++ b/platform/broadcom/sonic-platform-modules-dell/common/sonic_platform/hwaccess.py @@ -1,5 +1,6 @@ # Helper functions to access hardware +import os import struct import mmap import subprocess @@ -18,7 +19,55 @@ def pci_get_value(resource, offset): mm.close() return val +def pci_mem_write(memmap, offset, data): + """ Write PCI device """ + memmap.seek(offset) + memmap.write(struct.pack('I', data)) + +def pci_set_value(resource, val, offset): + """ Set a value to PCI device """ + with open(resource, 'w+b') as filed: + memmap = None + try: + memmap = mmap.mmap(filed.fileno(), 0) + pci_mem_write(memmap, offset, val) + except EnvironmentError: + pass + if memmap is not None: + memmap.close() + # Read I2C device def i2c_get(bus, i2caddr, ofs): - return int(subprocess.check_output(['/usr/sbin/i2cget', '-y', str(bus), str(i2caddr), str(ofs)]), 16) + try: + return int(subprocess.check_output(['/usr/sbin/i2cget', '-y', str(bus), str(i2caddr), str(ofs)]), 16) + except (FileNotFoundError, subprocess.CalledProcessError): + return -1 + +def io_reg_read(io_resource, offset): + fd = os.open(io_resource, os.O_RDONLY) + if fd < 0: + print('file open failed %s' % io_resource) + return -1 + if os.lseek(fd, offset, os.SEEK_SET) != offset: + print('lseek failed on %s' % io_resource) + return -1 + buf = os.read(fd, 1) + reg_val1 = ord(buf) + os.close(fd) + return reg_val1 + +def io_reg_write(io_resource, offset, val): + fd = os.open(io_resource, os.O_RDWR) + if fd < 0: + print('file open failed %s' % io_resource) + return False + if os.lseek(fd, offset, os.SEEK_SET) != offset: + print('lseek failed on %s' % io_resource) + return False + ret = os.write(fd, struct.pack('B', val)) + if ret != 1: + print('write failed %d' % ret) + return False + os.close(fd) + return True diff --git a/platform/broadcom/sonic-platform-modules-dell/debian/control b/platform/broadcom/sonic-platform-modules-dell/debian/control index 82b0e402a15d..2920602fcd60 100644 --- a/platform/broadcom/sonic-platform-modules-dell/debian/control +++ b/platform/broadcom/sonic-platform-modules-dell/debian/control @@ -7,37 +7,37 @@ Standards-Version: 3.9.3 Package: platform-modules-s6000 Architecture: amd64 -Depends: linux-image-4.19.0-9-2-amd64-unsigned +Depends: linux-image-4.19.0-12-2-amd64-unsigned Description: kernel modules for platform devices such as fan, led, sfp Package: platform-modules-z9100 Architecture: amd64 -Depends: linux-image-4.19.0-9-2-amd64-unsigned +Depends: linux-image-4.19.0-12-2-amd64-unsigned Description: kernel modules for platform devices such as fan, led, sfp Package: platform-modules-s6100 Architecture: amd64 -Depends: linux-image-4.19.0-9-2-amd64-unsigned +Depends: linux-image-4.19.0-12-2-amd64-unsigned Description: kernel modules for platform devices such as fan, led, sfp Package: platform-modules-z9264f Architecture: amd64 -Depends: linux-image-4.19.0-9-2-amd64-unsigned +Depends: linux-image-4.19.0-12-2-amd64-unsigned Description: kernel modules for platform devices such as fan, led, sfp Package: platform-modules-s5232f Architecture: amd64 -Depends: linux-image-4.19.0-9-2-amd64-unsigned +Depends: linux-image-4.19.0-12-2-amd64-unsigned Description: kernel modules for platform devices such as fan, led, sfp Package: platform-modules-s5248f Architecture: amd64 -Depends: linux-image-4.19.0-9-2-amd64-unsigned +Depends: linux-image-4.19.0-12-2-amd64-unsigned Description: kernel modules for platform devices such as fan, led, sfp Package: platform-modules-z9332f Architecture: amd64 -Depends: linux-image-4.19.0-9-2-amd64-unsigned +Depends: linux-image-4.19.0-12-2-amd64-unsigned Description: kernel modules for platform devices such as fan, led, sfp Package: platform-modules-s5296f diff --git a/platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-s5248f.install b/platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-s5248f.install index 6e74fbec0ae5..1bf81a9ce2e6 100644 --- a/platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-s5248f.install +++ b/platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-s5248f.install @@ -5,6 +5,7 @@ s5248f/scripts/sensors usr/bin s5248f/scripts/qsfp_irq_enable.py usr/bin s5248f/cfg/s5248f-modules.conf etc/modules-load.d s5248f/systemd/platform-modules-s5248f.service etc/systemd/system +s5248f/modules/sonic_platform-1.0-py3-none-any.whl usr/share/sonic/device/x86_64-dellemc_s5248f_c3538-r0 common/platform_reboot usr/share/sonic/device/x86_64-dellemc_s5248f_c3538-r0 common/fw-updater usr/local/bin common/onie_mode_set usr/local/bin diff --git a/platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-s6000.install b/platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-s6000.install index d87efb31c488..e67a59485136 100644 --- a/platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-s6000.install +++ b/platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-s6000.install @@ -5,5 +5,8 @@ s6000/scripts/fancontrol.sh usr/local/bin s6000/systemd/platform-modules-s6000.service etc/systemd/system s6000/systemd/fancontrol.service etc/systemd/system common/io_rd_wr.py usr/local/bin +s6000/scripts/platform_reboot_override usr/share/sonic/device/x86_64-dell_s6000_s1220-r0 +s6000/scripts/platform_update_reboot_cause usr/share/sonic/device/x86_64-dell_s6000_s1220-r0 +s6000/scripts/override.conf /etc/systemd/system/systemd-reboot.service.d s6000/modules/sonic_platform-1.0-py2-none-any.whl usr/share/sonic/device/x86_64-dell_s6000_s1220-r0 s6000/modules/sonic_platform-1.0-py3-none-any.whl usr/share/sonic/device/x86_64-dell_s6000_s1220-r0 diff --git a/platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-s6100.init b/platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-s6100.init deleted file mode 100755 index c798b24ef235..000000000000 --- a/platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-s6100.init +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash - -### BEGIN INIT INFO -# Provides: setup-board -# Required-Start: -# Required-Stop: -# Should-Start: -# Should-Stop: -# Default-Start: S -# Default-Stop: 0 6 -# Short-Description: Setup S6100 board. -### END INIT INFO - -case "$1" in -start) - echo -n "Setting up board... " - - /usr/local/bin/iom_power_on.sh - /usr/local/bin/s6100_platform.sh init - - echo "done." - ;; - -stop) - /usr/local/bin/s6100_platform.sh deinit - echo "done." - - ;; - -force-reload|restart) - echo "Not supported" - ;; - -*) - echo "Usage: /etc/init.d/platform-modules-s6100.init {start|stop}" - exit 1 - ;; -esac - -exit 0 diff --git a/platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-s6100.install b/platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-s6100.install index a9eb63eeea45..5bae3b607c53 100644 --- a/platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-s6100.install +++ b/platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-s6100.install @@ -1,6 +1,6 @@ s6100/scripts/iom_power_*.sh usr/local/bin s6100/scripts/s6100_platform.sh usr/local/bin -s6100/scripts/s6100_i2c_enumeration.sh usr/local/bin +s6100/scripts/s6100_platform_startup.sh usr/local/bin s6100/scripts/s6100_bitbang_reset.sh usr/local/bin s6100/scripts/pcisysfs.py usr/bin common/dell_i2c_utils.sh usr/local/bin @@ -10,19 +10,29 @@ s6100/scripts/platform_reboot_override usr/share/sonic/device/x86_64-dell_s6100_ s6100/scripts/fast-reboot_plugin usr/share/sonic/device/x86_64-dell_s6100_c2538-r0 s6100/scripts/track_reboot_reason.sh usr/share/sonic/device/x86_64-dell_s6100_c2538-r0 s6100/scripts/warm-reboot_plugin usr/share/sonic/device/x86_64-dell_s6100_c2538-r0 +s6100/scripts/soft-reboot_plugin usr/share/sonic/device/x86_64-dell_s6100_c2538-r0 s6100/scripts/ssd-fw-upgrade usr/share/sonic/device/x86_64-dell_s6100_c2538-r0 s6100/scripts/override.conf /etc/systemd/system/systemd-reboot.service.d +s6100/scripts/s6100_serial_getty_monitor etc/monit/conf.d +s6100/scripts/check-getty.sh usr/local/bin common/dell_lpc_mon.sh usr/local/bin +s6100/scripts/s6100_ssd_mon.sh usr/local/bin +s6100/scripts/s6100_ssd_upgrade_status.sh usr/local/bin s6100/scripts/platform_sensors.py usr/local/bin +s6100/scripts/platform_reboot_pre_check usr/share/sonic/device/x86_64-dell_s6100_c2538-r0 s6100/modules/sonic_platform-1.0-py2-none-any.whl usr/share/sonic/device/x86_64-dell_s6100_c2538-r0 s6100/modules/sonic_platform-1.0-py3-none-any.whl usr/share/sonic/device/x86_64-dell_s6100_c2538-r0 s6100/scripts/platform_watchdog_enable.sh usr/local/bin s6100/scripts/platform_watchdog_disable.sh usr/local/bin s6100/scripts/sensors usr/bin +s6100/scripts/iSMART_64 usr/local/bin s6100/systemd/platform-modules-s6100.service etc/systemd/system s6100/systemd/s6100-lpc-monitor.service etc/systemd/system +s6100/systemd/s6100-ssd-monitor.service etc/systemd/system +s6100/systemd/s6100-ssd-monitor.timer etc/systemd/system +s6100/systemd/s6100-ssd-upgrade-status.service etc/systemd/system s6100/systemd/s6100-reboot-cause.service etc/systemd/system -s6100/systemd/s6100-i2c-enumerate.service etc/systemd/system +s6100/systemd/s6100-platform-startup.service etc/systemd/system tools/flashrom/flashrom usr/local/bin/ common/fw-updater usr/local/bin common/onie_mode_set usr/local/bin diff --git a/platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-s6100.postinst b/platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-s6100.postinst index eda8f7c8a41a..78c78fa0037f 100644 --- a/platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-s6100.postinst +++ b/platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-s6100.postinst @@ -1,11 +1,7 @@ # postinst script for S6100 # Enable Dell-S6100-platform-service -depmod -a systemctl enable platform-modules-s6100.service -systemctl start platform-modules-s6100.service - -systemctl enable s6100-lpc-monitor.service -systemctl start s6100-lpc-monitor.service +systemctl start --no-block platform-modules-s6100.service #DEBHELPER# diff --git a/platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-z9332f.install b/platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-z9332f.install index 9915b08b72ee..6d12d4e1732a 100644 --- a/platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-z9332f.install +++ b/platform/broadcom/sonic-platform-modules-dell/debian/platform-modules-z9332f.install @@ -9,3 +9,4 @@ common/platform_reboot usr/share/sonic/device/x86_64-dellemc_z9332f_d1508-r0 common/pcisysfs.py usr/bin common/fw-updater usr/local/bin common/onie_mode_set usr/local/bin +common/onie_stage_fwpkg usr/local/bin diff --git a/platform/broadcom/sonic-platform-modules-dell/debian/rules b/platform/broadcom/sonic-platform-modules-dell/debian/rules index 2c16f5561f98..68f86c23b5a1 100755 --- a/platform/broadcom/sonic-platform-modules-dell/debian/rules +++ b/platform/broadcom/sonic-platform-modules-dell/debian/rules @@ -45,6 +45,11 @@ override_dh_auto_build: python2.7 setup.py bdist_wheel -d $(MOD_SRC_DIR)/$${mod}/modules; \ python3 setup.py bdist_wheel -d $(MOD_SRC_DIR)/$${mod}/modules; \ cd $(MOD_SRC_DIR); \ + elif [ $$mod = "s5248f" ]; then \ + cp $(COMMON_DIR)/ipmihelper.py $(MOD_SRC_DIR)/$${mod}/sonic_platform/ipmihelper.py; \ + cd $(MOD_SRC_DIR)/$${mod}; \ + python3 setup.py bdist_wheel -d $(MOD_SRC_DIR)/$${mod}/modules; \ + cd $(MOD_SRC_DIR); \ elif [ $$mod = "z9332f" ]; then \ cp $(COMMON_DIR)/ipmihelper.py $(MOD_SRC_DIR)/$${mod}/sonic_platform/ipmihelper.py; \ cd $(MOD_SRC_DIR)/$${mod}; \ @@ -73,6 +78,9 @@ override_dh_auto_install: override_dh_usrlocal: +override_dh_installmodules: + dh_installmodules --no-scripts; + override_dh_clean: dh_clean set -e; \ @@ -103,6 +111,11 @@ override_dh_clean: rm -f $(MOD_SRC_DIR)/$${mod}/modules/*.whl; \ rm -rf $(MOD_SRC_DIR)/$${mod}/build; \ rm -rf $(MOD_SRC_DIR)/$${mod}/build/*.egg-info; \ + elif [ $$mod = "s5248f" ]; then \ + rm -f $(MOD_SRC_DIR)/$${mod}/sonic_platform/ipmihelper.py; \ + rm -f $(MOD_SRC_DIR)/$${mod}/modules/*.whl; \ + rm -rf $(MOD_SRC_DIR)/$${mod}/build; \ + rm -rf $(MOD_SRC_DIR)/$${mod}/build/*.egg-info; \ elif [ $$mod = "z9332f" ]; then \ rm -f $(MOD_SRC_DIR)/$${mod}/sonic_platform/ipmihelper.py; \ rm -f $(MOD_SRC_DIR)/$${mod}/modules/*.whl; \ diff --git a/platform/broadcom/sonic-platform-modules-dell/s5232f/sonic_platform/chassis.py b/platform/broadcom/sonic-platform-modules-dell/s5232f/sonic_platform/chassis.py index 1022d0bb481b..55f422a17704 100644 --- a/platform/broadcom/sonic-platform-modules-dell/s5232f/sonic_platform/chassis.py +++ b/platform/broadcom/sonic-platform-modules-dell/s5232f/sonic_platform/chassis.py @@ -38,7 +38,7 @@ class Chassis(ChassisBase): oir_fd = -1 epoll = -1 - + REBOOT_CAUSE_PATH = "/host/reboot-cause/platform/reboot_reason" _global_port_pres_dict = {} def __init__(self): @@ -87,7 +87,6 @@ def __del__(self): # check for this event change for sfp / do we need to handle timeout/sleep def get_change_event(self, timeout=0): - from time import sleep """ Returns a nested dictionary containing all devices which have experienced a change at chassis level @@ -116,7 +115,6 @@ def get_change_event(self, timeout=0): if (now_ms - start_ms >= timeout): return True, change_dict - def get_sfp(self, index): """ Retrieves sfp represented by (0-based) index @@ -136,7 +134,7 @@ def get_sfp(self, index): # The index will start from 0 sfp = self._sfp_list[index-1] except IndexError: - sys.stderr.write("SFP index {} out of range (0-{})\n".format( + sys.stderr.write("SFP index {} out of range (1-{})\n".format( index, len(self._sfp_list))) return sfp @@ -223,6 +221,7 @@ def get_num_sfps(self): An integer represences the number of SFPs on the chassis. """ return self._num_sfps + def get_reboot_cause(self): """ Retrieves the cause of the previous reboot @@ -240,15 +239,15 @@ def get_reboot_cause(self): return (self.REBOOT_CAUSE_NON_HARDWARE, None) if reboot_cause & 0x1: - return (self.REBOOT_CAUSE_POWER_LOSS, None) + return (self.REBOOT_CAUSE_POWER_LOSS, "Power on reset") elif reboot_cause & 0x2: return (self.REBOOT_CAUSE_NON_HARDWARE, None) elif reboot_cause & 0x4: return (self.REBOOT_CAUSE_HARDWARE_OTHER, "PSU Shutdown") elif reboot_cause & 0x8: - return (self.REBOOT_CAUSE_THERMAL_OVERLOAD_CPU, None) + return (self.REBOOT_CAUSE_THERMAL_OVERLOAD_CPU, "Thermal overload") elif reboot_cause & 0x10: - return (self.REBOOT_CAUSE_WATCHDOG, None) + return (self.REBOOT_CAUSE_WATCHDOG, "Watchdog reset") elif reboot_cause & 0x20: return (self.REBOOT_CAUSE_HARDWARE_OTHER, "BMC Shutdown") elif reboot_cause & 0x40: @@ -259,4 +258,3 @@ def get_reboot_cause(self): return (self.REBOOT_CAUSE_HARDWARE_OTHER, "Reset Button Cold Reboot") else: return (self.REBOOT_CAUSE_NON_HARDWARE, None) - diff --git a/platform/broadcom/sonic-platform-modules-dell/s5232f/sonic_platform/component.py b/platform/broadcom/sonic-platform-modules-dell/s5232f/sonic_platform/component.py index f7fcc94662c1..52f2bacd70aa 100644 --- a/platform/broadcom/sonic-platform-modules-dell/s5232f/sonic_platform/component.py +++ b/platform/broadcom/sonic-platform-modules-dell/s5232f/sonic_platform/component.py @@ -82,6 +82,7 @@ class Component(ComponentBase): ] def __init__(self, component_index = 0): + ComponentBase.__init__(self) self.index = component_index self.name = self.CHASSIS_COMPONENTS[self.index][0] self.description = self.CHASSIS_COMPONENTS[self.index][1] diff --git a/platform/broadcom/sonic-platform-modules-dell/s5232f/sonic_platform/fan.py b/platform/broadcom/sonic-platform-modules-dell/s5232f/sonic_platform/fan.py index 1b624cb76eda..c634dc7d0d17 100644 --- a/platform/broadcom/sonic-platform-modules-dell/s5232f/sonic_platform/fan.py +++ b/platform/broadcom/sonic-platform-modules-dell/s5232f/sonic_platform/fan.py @@ -41,6 +41,7 @@ class Fan(FanBase): def __init__(self, fantray_index=1, fan_index=1, psu_fan=False, dependency=None): + FanBase.__init__(self) self.is_psu_fan = psu_fan if not self.is_psu_fan: # API index is starting from 0, DellEMC platform index is diff --git a/platform/broadcom/sonic-platform-modules-dell/s5232f/sonic_platform/sfp.py b/platform/broadcom/sonic-platform-modules-dell/s5232f/sonic_platform/sfp.py index 56f37afea6e8..eed6dc7b03da 100644 --- a/platform/broadcom/sonic-platform-modules-dell/s5232f/sonic_platform/sfp.py +++ b/platform/broadcom/sonic-platform-modules-dell/s5232f/sonic_platform/sfp.py @@ -118,7 +118,7 @@ 'hardware_rev': [QSFP_INFO_OFFSET, 56, 2, 'parse_vendor_rev'], 'serial': [QSFP_INFO_OFFSET, 68, 16, 'parse_vendor_sn'], 'vendor_date': [QSFP_INFO_OFFSET, 84, 8, 'parse_vendor_date'], - 'dom_capability': [QSFP_INFO_OFFSET, 92, 1, 'parse_qsfp_dom_capability'], + 'dom_capability': [QSFP_INFO_OFFSET, 92, 1, 'parse_dom_capability'], 'dom_rev': [QSFP_DOM_OFFSET, 1, 1, 'parse_sfp_dom_rev'], 'ModuleThreshold': [QSFP_DOM_OFFSET1, 128, 24, 'parse_module_threshold_values'], 'ChannelThreshold': [QSFP_DOM_OFFSET1, 176, 16, 'parse_channel_threshold_values'], @@ -214,8 +214,13 @@ def _read_eeprom_bytes(self, eeprom_path, offset, num_bytes): return None try: - for n in range(0, num_bytes): - eeprom_raw[n] = hex(ord(raw[n]))[2:].zfill(2) + if isinstance(raw , str): + for n in range(0, num_bytes): + eeprom_raw[n] = hex(ord(raw[n]))[2:].zfill(2) + else: + for n in range(0, num_bytes): + eeprom_raw[n] = hex(raw[n])[2:].zfill(2) + except BaseException: eeprom.close() return None diff --git a/platform/broadcom/sonic-platform-modules-dell/s5232f/sonic_platform/thermal.py b/platform/broadcom/sonic-platform-modules-dell/s5232f/sonic_platform/thermal.py index d8c4ef14d5b2..2a6ff8927e0a 100644 --- a/platform/broadcom/sonic-platform-modules-dell/s5232f/sonic_platform/thermal.py +++ b/platform/broadcom/sonic-platform-modules-dell/s5232f/sonic_platform/thermal.py @@ -105,9 +105,9 @@ def get_high_threshold(self): Celsius up to nearest thousandth of one degree Celsius, e.g. 30.125 """ - is_valid, high_threshold = self.sensor.get_threshold("UpperCritical") + is_valid, high_threshold = self.sensor.get_threshold("UpperNonCritical") if not is_valid: - high_threshold = 0 + return super(Thermal, self).get_high_threshold() return float(high_threshold) @@ -134,12 +134,11 @@ def get_high_critical_threshold(self): thermal in Celsius up to nearest thousandth of one degree Celsius, e.g. 30.125 """ - is_valid, high_crit_threshold = self.sensor.get_threshold("UpperNonRecoverable") + is_valid, high_crit_threshold = self.sensor.get_threshold("UpperCritical") if not is_valid: - high_crit_threshold = 0 + return super(Thermal, self).get_high_critical_threshold() return float(high_crit_threshold) - def set_high_threshold(self, temperature): """ diff --git a/platform/broadcom/sonic-platform-modules-dell/s5232f/sonic_platform/watchdog.py b/platform/broadcom/sonic-platform-modules-dell/s5232f/sonic_platform/watchdog.py index 878d5f4f952d..961bd8b3dbb4 100644 --- a/platform/broadcom/sonic-platform-modules-dell/s5232f/sonic_platform/watchdog.py +++ b/platform/broadcom/sonic-platform-modules-dell/s5232f/sonic_platform/watchdog.py @@ -36,6 +36,7 @@ class Watchdog(WatchdogBase): CLOCK_MONOTONIC = 1 def __init__(self): + WatchdogBase.__init__(self) self._librt = ctypes.CDLL('librt.so.1', use_errno=True) self._clock_gettime = self._librt.clock_gettime self._clock_gettime.argtypes=[ctypes.c_int, ctypes.POINTER(_timespec)] @@ -43,7 +44,7 @@ def __init__(self): def _get_command_result(self, cmdline): try: proc = subprocess.Popen(cmdline.split(), stdout=subprocess.PIPE, - stderr=subprocess.STDOUT) + stderr=subprocess.STDOUT, universal_newlines=True) stdout = proc.communicate()[0] proc.wait() result = stdout.rstrip('\n') @@ -207,4 +208,3 @@ def get_remaining_time(self): return self.timeout - diff_time return 0 - diff --git a/platform/broadcom/sonic-platform-modules-dell/s5232f/systemd/platform-modules-s5232f.service b/platform/broadcom/sonic-platform-modules-dell/s5232f/systemd/platform-modules-s5232f.service index 7fb3801e339e..0ca31b522bd4 100644 --- a/platform/broadcom/sonic-platform-modules-dell/s5232f/systemd/platform-modules-s5232f.service +++ b/platform/broadcom/sonic-platform-modules-dell/s5232f/systemd/platform-modules-s5232f.service @@ -1,6 +1,6 @@ [Unit] Description=Dell S5232f Platform modules -Before=pmon.service +Before=pmon.service determine-reboot-cause.service DefaultDependencies=no [Service] diff --git a/platform/broadcom/sonic-platform-modules-dell/s5248f/scripts/s5248f_platform.sh b/platform/broadcom/sonic-platform-modules-dell/s5248f/scripts/s5248f_platform.sh index e006e53cfc49..692a6a602b0f 100755 --- a/platform/broadcom/sonic-platform-modules-dell/s5248f/scripts/s5248f_platform.sh +++ b/platform/broadcom/sonic-platform-modules-dell/s5248f/scripts/s5248f_platform.sh @@ -86,6 +86,20 @@ switch_board_modsel() { done } +install_python_api_package() { + device="/usr/share/sonic/device" + platform=$(/usr/local/bin/sonic-cfggen -H -v DEVICE_METADATA.localhost.platform) + + rv=$(pip3 install $device/$platform/sonic_platform-1.0-py3-none-any.whl) +} + +remove_python_api_package() { + rv=$(pip3 show sonic-platform > /dev/null 2>/dev/null) + if [ $? -eq 0 ]; then + rv=$(pip3 uninstall -y sonic-platform > /dev/null 2>/dev/null) + fi +} + platform_firmware_versions() { FIRMWARE_VERSION_FILE=/var/log/firmware_versions rm -rf ${FIRMWARE_VERSION_FILE} @@ -146,6 +160,7 @@ if [ "$1" == "init" ]; then switch_board_modsel switch_board_led_default #/usr/bin/qsfp_irq_enable.py + install_python_api_package platform_firmware_versions elif [ "$1" == "deinit" ]; then @@ -153,6 +168,7 @@ elif [ "$1" == "deinit" ]; then switch_board_qsfp "delete_device" switch_board_qsfp_mux "delete_device" + remove_python_api_package modprobe -r i2c-mux-pca954x modprobe -r i2c-dev else diff --git a/platform/broadcom/sonic-platform-modules-dell/s5248f/setup.py b/platform/broadcom/sonic-platform-modules-dell/s5248f/setup.py new file mode 100755 index 000000000000..2febedc1801d --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-dell/s5248f/setup.py @@ -0,0 +1,30 @@ +from setuptools import setup + +setup( + name='sonic-platform', + version='1.0', + description='SONiC platform API implementation on DellEmc Platforms', + license='Apache 2.0', + author='SONiC Team', + author_email='linuxnetdev@microsoft.com', + url='https://github.com/Azure/sonic-buildimage', + maintainer='DellEMC', + maintainer_email='dell-sonic@dell.com', + packages=[ + 'sonic_platform', + ], + classifiers=[ + 'Development Status :: 3 - Alpha', + 'Environment :: Plugins', + 'Intended Audience :: Developers', + 'Intended Audience :: Information Technology', + 'Intended Audience :: System Administrators', + 'License :: OSI Approved :: Apache Software License', + 'Natural Language :: English', + 'Operating System :: POSIX :: Linux', + 'Programming Language :: Python :: 3.7', + 'Topic :: Utilities', + ], + keywords='sonic SONiC platform PLATFORM', +) + diff --git a/platform/broadcom/sonic-platform-modules-dell/s5248f/sonic_platform/__init__.py b/platform/broadcom/sonic-platform-modules-dell/s5248f/sonic_platform/__init__.py new file mode 100644 index 000000000000..929d4eac3de4 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-dell/s5248f/sonic_platform/__init__.py @@ -0,0 +1,3 @@ +__all__ = ["platform", "chassis", "sfp", "eeprom", "component", "thermal", "psu", "fan", "fan_drawer", "watchdog"] +from sonic_platform import * + diff --git a/platform/broadcom/sonic-platform-modules-dell/s5248f/sonic_platform/chassis.py b/platform/broadcom/sonic-platform-modules-dell/s5248f/sonic_platform/chassis.py new file mode 100644 index 000000000000..b1ce7413fb24 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-dell/s5248f/sonic_platform/chassis.py @@ -0,0 +1,389 @@ +#!/usr/bin/env python + +############################################################################# +# DELLEMC S5248F +# +# Module contains an implementation of SONiC Platform Base API and +# provides the platform information +# +############################################################################# + +try: + import time + import sys + from sonic_platform_base.chassis_base import ChassisBase + from sonic_platform.sfp import Sfp + from sonic_platform.eeprom import Eeprom + from sonic_platform.component import Component + from sonic_platform.psu import Psu + from sonic_platform.thermal import Thermal + from sonic_platform.watchdog import Watchdog + from sonic_platform.fan import Fan + from sonic_platform.fan_drawer import FanDrawer + from sonic_platform.hwaccess import pci_get_value, pci_set_value +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +MAX_S5248F_COMPONENT = 6 # BIOS,BMC,FPGA,SYSTEM CPLD,2 SLAVE CPLDs +MAX_S5248F_FANTRAY =4 +MAX_S5248F_FAN = 2 +MAX_S5248F_PSU = 2 +MAX_S5248F_THERMAL = 8 +SYSTEM_LED_REG = 0x24 +SYSTEM_BEACON_LED_SET = 0x8 +SYSTEM_BEACON_LED_CLEAR = 0xFFFFFFF7 + +media_part_num_list = set([ \ +"8T47V","XTY28","MHVPK","GF76J","J6FGD","F1KMV","9DN5J","H4DHD","6MCNV","0WRX0","X7F70","5R2PT","WTRD1","WTRD1","WTRD1","WTRD1","5250G","WTRD1","C5RNH","C5RNH","FTLX8571D3BCL-FC", +"C5RNH","5250G","N8TDR","7D64H","7D64H","RN84N","RN84N","HMTNW","6K3Y6","6K3Y6","TY5FM","50M0R","PGYJT","WP2PP","85Y13","1HCGH","FP9R1","FYD0M","C6Y7M","C6Y7M","V250M","V250M", +"5CWK6","5CWK6","53HVN","53HVN","358VV","358VV","MV799","MV799","YJF03","P9GND","T1KCN","1DXKP","MT7R2","K0T7R","W5G04","7TCDN","7TCDN","7TCDN","7TCDN","7TCDN","V3XJK","0MV31", +"5FVP7","N6KM9","C41MF","77KC3","XW7J0","V4NJV","2XJHY","H93DH","H93DH","F8CG0","F8CG0","F8CG0","119N6","WFMF5","794RX","288F6","1M31V","1M31V","5NP8R","5NP8R","4TC09","4TC09", +"FC6KV","FC6KV","J90VN","J90VN","05RH0","05RH0","YDN52","0C2YV","YDN52","0C2YV","9JT65","D7M6H","6GW14","FYVFW","0VF5H","P4YPY","P4YPY","TCPM2","TCPM2","JNPF8","JNPF8","27GG5", +"27GG5","P8T4W","P8T4W","JR54Y","M6N0J","XJYD0","K44H9","035KG","P7C7N","76V43","3CC35","FN4FC","26FN3","YFNDD","YFNDD","7R9N9","035KG","P7C7N","76V43","3CC35","PLRXPLSCS43811", +"FN4FC","26FN3","YFNDD","YFNDD","7R9N9","G86YJ","V407F","V407F","9KH6T","G86YJ","V407F","9KH6T","2JVDD","D0R73","VXFJY","9X8JP","2JVDD","D0R73","VXFJY","9X8JP","2JVDD","D0R73","VXFJY", +"9X8JP","GMFC5","GMFC5","GMFC5","D7P80","3MFXG","3MFXG","0GWXJ","THPF3","THPF3","THPF3","THPF3","THPF3","PJ62G","3XCX1","JJYKG","RRRTK","16K56","86JM2","K5R6C","7MG2C","WTPPN","9HTT2", +"NKM4F","VXGGG","JC9W6","6MR8M","RP3GV","M5PPJ","XKY55","TKCXT","05J8P","5WGKD","XFDRT","NW8DM","YPKH3","5WGKD","XFDRT","NW8DM","YPKH3","71XXK","MVCX6","0XYP6","HPPVW","3GHRT","71XXK", +"MVCX6","0XYP6","HPPVW","3GHRT","2X5T6","135V2","KD5MV","2X5T6","KD5MV","HHFK0","3YWG7","5CMT2","RCVP5","X5DH4","HHFK0","3YWG7","5CMT2","RCVP5","X5DH4","3YWG7","5CMT2","RCVP5","X5DH4", +"4WJ41","4WJ41","14NV5","14NV5","14NV5","4WGYD","YKMH7","X7CCC","X7CCC","0X9CT","0CY8V","P7D7R","W4GPP","W4GPP","W4GPP","HHHCHC","07RN7","07RN7","0YR96","0YR96","JCYM9","FTLX8571D3BCL", +"DDW0X","VPFDJ","229KM","9FC7D","DDW0X","VPFDJ","6FMR5","J7K20","N3K9W","6FMR5","8R4VM","7VN5T","D9YM8","8R4VM","VYXPW","87TPX","WY6FK","VYXPW","87TPX","WY6FK","WG8C4","N8K82","2DV6Y", +"77C3C","RC0HM","77C3C","RC0HM","JHXTN","3P3PG","92YVM","4VX5M","4VX5M","6RRGD","W4JWV","22V6R","XR11M","9GMDY","JMCWK","TP2F0","6MGDY","78RHK", "C0TP5","0WDNV","FCLF8522P2BTL"\ +]) + +class Chassis(ChassisBase): + """ + DELLEMC Platform-specific Chassis class + """ + + REBOOT_CAUSE_PATH = "/host/reboot-cause/platform/reboot_reason" + oir_fd = -1 + epoll = -1 + + _global_port_pres_dict = {} + + _port_to_i2c_mapping = { + 1: 2, + 2: 3, + 3: 4, + 4: 5, + 5: 6, + 6: 7, + 7: 8, + 8: 9, + 9: 10, + 10: 11, + 11: 12, + 12: 13, + 13: 14, + 14: 15, + 15: 16, + 16: 17, + 17: 18, + 18: 19, + 19: 20, + 20: 21, + 21: 22, + 22: 23, + 23: 24, + 24: 25, + 25: 26, + 26: 27, + 27: 28, + 28: 29, + 29: 30, + 30: 31, + 31: 32, + 32: 33, + 33: 34, + 34: 35, + 35: 36, + 36: 37, + 37: 38, + 38: 39, + 39: 40, + 40: 41, + 41: 42, + 42: 43, + 43: 44, + 44: 45, + 45: 46, + 46: 47, + 47: 48, + 48: 49, + # DD + QSFP28 + 49: 50, + 50: 50, + 51: 51, + 52: 51, + 53: 52, + 54: 53, + 55: 54, + 56: 55, + } + + def __init__(self): + ChassisBase.__init__(self) + # sfp.py will read eeprom contents and retrive the eeprom data. + # We pass the eeprom path from chassis.py + self.PORT_START = 1 + self.PORT_END = 56 + self.PORTS_IN_BLOCK = (self.PORT_END + 1) + _sfp_port = range(49, self.PORTS_IN_BLOCK) + eeprom_base = "/sys/class/i2c-adapter/i2c-{0}/{0}-0050/eeprom" + for index in range(self.PORT_START, self.PORTS_IN_BLOCK): + eeprom_path = eeprom_base.format(self._port_to_i2c_mapping[index]) + port_type = 'QSFP' if index in _sfp_port else 'SFP' + sfp_node = Sfp(index, port_type, eeprom_path) + self._sfp_list.append(sfp_node) + + self._eeprom = Eeprom() + self._watchdog = Watchdog() + self._num_sfps = self.PORT_END + self._num_fans = MAX_S5248F_FANTRAY * MAX_S5248F_FAN + self._fan_list = [Fan(i, j) for i in range(MAX_S5248F_FANTRAY) \ + for j in range(MAX_S5248F_FAN)] + for i in range(MAX_S5248F_FANTRAY): + fandrawer = FanDrawer(i) + self._fan_drawer_list.append(fandrawer) + self._fan_list.extend(fandrawer._fan_list) + + self._psu_list = [Psu(i) for i in range(MAX_S5248F_PSU)] + self._thermal_list = [Thermal(i) for i in range(MAX_S5248F_THERMAL)] + self._component_list = [Component(i) for i in range(MAX_S5248F_COMPONENT)] + for port_num in range(self.PORT_START, self.PORTS_IN_BLOCK): + # sfp get uses zero-indexing, but port numbers start from 1 + presence = self.get_sfp(port_num-1).get_presence() + self._global_port_pres_dict[port_num] = '1' if presence else '0' + + #self.LOCATOR_LED_ON = self.STATUS_LED_COLOR_BLUE_BLINK + #self.LOCATOR_LED_OFF = self.STATUS_LED_COLOR_OFF + + def __del__(self): + if self.oir_fd != -1: + self.epoll.unregister(self.oir_fd.fileno()) + self.epoll.close() + self.oir_fd.close() + +# check for this event change for sfp / do we need to handle timeout/sleep + + def get_change_event(self, timeout=0): + """ + Returns a nested dictionary containing all devices which have + experienced a change at chassis level + """ + start_ms = time.time() * 1000 + port_dict = {} + change_dict = {} + change_dict['sfp'] = port_dict + while True: + time.sleep(0.5) + for port_num in range(self.PORT_START, (self.PORT_END + 1)): + presence = self.get_sfp(port_num-1).get_presence() + if(presence and self._global_port_pres_dict[port_num] == '0'): + self._global_port_pres_dict[port_num] = '1' + port_dict[port_num] = '1' + elif(not presence and + self._global_port_pres_dict[port_num] == '1'): + self._global_port_pres_dict[port_num] = '0' + port_dict[port_num] = '0' + + if(len(port_dict) > 0): + return True, change_dict + + if timeout: + now_ms = time.time() * 1000 + if (now_ms - start_ms >= timeout): + return True, change_dict + + + def get_sfp(self, index): + """ + Retrieves sfp represented by (0-based) index + + Args: + index: An integer, the index (0-based) of the sfp to retrieve. + The index should be the sequence of a physical port in a chassis, + starting from 0. + For example, 0 for Ethernet0, 1 for Ethernet1 and so on. + + Returns: + An object dervied from SfpBase representing the specified sfp + """ + sfp = None + + try: + # The index will start from 0 + sfp = self._sfp_list[index-1] + except IndexError: + sys.stderr.write("SFP index {} out of range (1-{})\n".format( + index, len(self._sfp_list))) + return sfp + + def get_name(self): + """ + Retrieves the name of the chassis + Returns: + string: The name of the chassis + """ + return self._eeprom.modelstr() + + def get_presence(self): + """ + Retrieves the presence of the chassis + Returns: + bool: True if chassis is present, False if not + """ + return True + + def get_model(self): + """ + Retrieves the model number (or part number) of the chassis + Returns: + string: Model/part number of chassis + """ + return self._eeprom.part_number_str() + + def get_serial(self): + """ + Retrieves the serial number of the chassis (Service tag) + Returns: + string: Serial number of chassis + """ + return self._eeprom.serial_str() + + def get_status(self): + """ + Retrieves the operational status of the chassis + Returns: + bool: A boolean value, True if chassis is operating properly + False if not + """ + return True + + def get_base_mac(self): + """ + Retrieves the base MAC address for the chassis + Returns: + A string containing the MAC address in the format + 'XX:XX:XX:XX:XX:XX' + """ + return self._eeprom.base_mac_addr('') + + def get_serial_number(self): + """ + Retrieves the hardware serial number for the chassis + Returns: + A string containing the hardware serial number for this chassis. + """ + return self._eeprom.serial_number_str() + + def get_system_eeprom_info(self): + """ + Retrieves the full content of system EEPROM information for the chassis + Returns: + A dictionary where keys are the type code defined in + OCP ONIE TlvInfo EEPROM format and values are their corresponding + values. + """ + return self._eeprom.system_eeprom_info() + + def get_eeprom(self): + """ + Retrieves the Sys Eeprom instance for the chassis. + Returns : + The instance of the Sys Eeprom + """ + return self._eeprom + + def get_num_fans(self): + """ + Retrives the number of Fans on the chassis. + Returns : + An integer represents the number of Fans on the chassis. + """ + return self._num_fans + + def get_num_sfps(self): + """ + Retrives the numnber of Media on the chassis. + Returns: + An integer represences the number of SFPs on the chassis. + """ + return self._num_sfps + + def get_reboot_cause(self): + """ + Retrieves the cause of the previous reboot + Returns: + A tuple (string, string) where the first element is a string + containing the cause of the previous reboot. This string must be + one of the predefined strings in this class. If the first string + is "REBOOT_CAUSE_HARDWARE_OTHER", the second string can be used + to pass a description of the reboot cause. + """ + try: + with open(self.REBOOT_CAUSE_PATH) as fd: + reboot_cause = int(fd.read(), 16) + except EnvironmentError: + return (self.REBOOT_CAUSE_NON_HARDWARE, None) + + if reboot_cause & 0x1: + return (self.REBOOT_CAUSE_POWER_LOSS, "Power on reset") + elif reboot_cause & 0x2: + return (self.REBOOT_CAUSE_NON_HARDWARE, None) + elif reboot_cause & 0x4: + return (self.REBOOT_CAUSE_HARDWARE_OTHER, "PSU Shutdown") + elif reboot_cause & 0x8: + return (self.REBOOT_CAUSE_THERMAL_OVERLOAD_CPU, "Thermal overload") + elif reboot_cause & 0x10: + return (self.REBOOT_CAUSE_WATCHDOG, "Watchdog reset") + elif reboot_cause & 0x20: + return (self.REBOOT_CAUSE_HARDWARE_OTHER, "BMC Shutdown") + elif reboot_cause & 0x40: + return (self.REBOOT_CAUSE_HARDWARE_OTHER, "Hot-Swap Shutdown") + elif reboot_cause & 0x80: + return (self.REBOOT_CAUSE_HARDWARE_OTHER, "Reset Button Shutdown") + elif reboot_cause & 0x100: + return (self.REBOOT_CAUSE_HARDWARE_OTHER, "Reset Button Cold Reboot") + else: + return (self.REBOOT_CAUSE_NON_HARDWARE, None) + + def get_qualified_media_list(self): + return media_part_num_list + + def set_locator_led(self, color): + """ + Sets the state of the Chassis Locator LED + + Args: + color: A string representing the color with which to set the Chassis Locator LED + + Returns: + bool: True if the Chassis Locator LED state is set successfully, False if not + + """ + resource = "/sys/bus/pci/devices/0000:04:00.0/resource0" + val = pci_get_value(resource, SYSTEM_LED_REG) + if self.LOCATOR_LED_ON == color: + val = int(val) | SYSTEM_BEACON_LED_SET + elif self.LOCATOR_LED_OFF == color: + val = int(val) & SYSTEM_BEACON_LED_CLEAR + else: + return False + pci_set_value(resource, val, SYSTEM_LED_REG) + return True + + def get_locator_led(self): + """ + Gets the state of the Chassis Locator LED + + Returns: + LOCATOR_LED_ON or LOCATOR_LED_OFF + """ + resource = "/sys/bus/pci/devices/0000:04:00.0/resource0" + val = pci_get_value(resource, SYSTEM_LED_REG) + val = int(val) & SYSTEM_BEACON_LED_SET + if not val: + return self.LOCATOR_LED_OFF + else: + return self.LOCATOR_LED_ON + diff --git a/platform/broadcom/sonic-platform-modules-dell/s5248f/sonic_platform/component.py b/platform/broadcom/sonic-platform-modules-dell/s5248f/sonic_platform/component.py new file mode 100644 index 000000000000..fdca4614c2fa --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-dell/s5248f/sonic_platform/component.py @@ -0,0 +1,123 @@ +#!/usr/bin/env python + +######################################################################## +# DELLEMC S5248F +# +# Module contains an implementation of SONiC Platform Base API and +# provides the Components' (e.g., BIOS, CPLD, FPGA, BMC etc.) available in +# the platform +# +######################################################################## + +try: + import subprocess + from sonic_platform_base.component_base import ComponentBase + import sonic_platform.hwaccess as hwaccess + +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +def get_bios_version(): + return subprocess.check_output(['dmidecode', '-s', 'system-version']).strip() + +def get_fpga_version(): + val = hwaccess.pci_get_value('/sys/bus/pci/devices/0000:04:00.0/resource0', 0) + return '{}.{}'.format((val >> 8) & 0xff, val & 0xff) + +def get_bmc_version(): + return subprocess.check_output( + ['cat', '/sys/class/ipmi/ipmi0/device/bmc/firmware_revision'] + ).strip() + +def get_cpld_version(bus, i2caddr): + return '{}.{}'.format(hwaccess.i2c_get(bus, i2caddr, 1), + hwaccess.i2c_get(bus, i2caddr, 0) + ) + +def get_cpld0_version(): + return get_cpld_version(601, 0x31) + +def get_cpld1_version(): + return get_cpld_version(600, 0x30) + +def get_cpld2_version(): + return get_cpld_version(600, 0x31) + + + +class Component(ComponentBase): + """DellEMC Platform-specific Component class""" + + CHASSIS_COMPONENTS = [ + ['BIOS', + 'Performs initialization of hardware components during booting', + get_bios_version + ], + + ['FPGA', + 'Used for managing the system LEDs', + get_fpga_version + ], + + ['BMC', + 'Platform management controller for on-board temperature monitoring, in-chassis power, Fan and LED control', + get_bmc_version + ], + + ['System CPLD', + 'Used for managing the CPU power sequence and CPU states', + get_cpld0_version + ], + + ['Slave CPLD 1', + 'Used for managing SFP28/QSFP28 port transceivers (SFP28 1-24, QSFP28 1-4)', + get_cpld1_version + ], + + ['Slave CPLD 2', + 'Used for managing SFP28/QSFP28 port transceivers (SFP28 25-48, QSFP28 5-8)', + get_cpld2_version + ] + + ] + + def __init__(self, component_index = 0): + self.index = component_index + self.name = self.CHASSIS_COMPONENTS[self.index][0] + self.description = self.CHASSIS_COMPONENTS[self.index][1] + self.version = self.CHASSIS_COMPONENTS[self.index][2]() + + def get_name(self): + """ + Retrieves the name of the component + Returns: + A string containing the name of the component + """ + return self.name + + def get_description(self): + """ + Retrieves the description of the component + Returns: + A string containing the description of the component + """ + return self.description + + def get_firmware_version(self): + """ + Retrieves the firmware version of the component + Returns: + A string containing the firmware version of the component + """ + return self.version + + def install_firmware(self, image_path): + """ + Installs firmware to the component + Args: + image_path: A string, path to firmware image + Returns: + A boolean, True if install was successful, False if not + """ + return False diff --git a/platform/broadcom/sonic-platform-modules-dell/s5248f/sonic_platform/eeprom.py b/platform/broadcom/sonic-platform-modules-dell/s5248f/sonic_platform/eeprom.py new file mode 100644 index 000000000000..bf3434733f36 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-dell/s5248f/sonic_platform/eeprom.py @@ -0,0 +1,133 @@ +#!/usr/bin/env python + +############################################################################# +# DellEmc S5248F +# +# Platform and model specific eeprom subclass, inherits from the base class, +# and provides the followings: +# - the eeprom format definition +# - specific encoder/decoder if there is special need +############################################################################# +try: + import os.path + from sonic_eeprom import eeprom_tlvinfo +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class Eeprom(eeprom_tlvinfo.TlvInfoDecoder): + + def __init__(self): + self.eeprom_path = None + for b in (0, 1): + f = '/sys/class/i2c-adapter/i2c-{0}/{0}-0050/eeprom'.format(b) + if os.path.exists(f): + self.eeprom_path = f + break + if self.eeprom_path is None: + return + super(Eeprom, self).__init__(self.eeprom_path, 0, '', True) + self.eeprom_tlv_dict = dict() + try: + self.eeprom_data = self.read_eeprom() + except: + self.eeprom_data = "N/A" + raise RuntimeError("Eeprom is not Programmed") + + eeprom = self.eeprom_data + + if not self.is_valid_tlvinfo_header(eeprom): + return + + total_length = (eeprom[9] << 8) | eeprom[10] + tlv_index = self._TLV_INFO_HDR_LEN + tlv_end = self._TLV_INFO_HDR_LEN + total_length + + while (tlv_index + 2) < len(eeprom) and tlv_index < tlv_end: + if not self.is_valid_tlv(eeprom[tlv_index:]): + break + + tlv = eeprom[tlv_index:tlv_index + 2 + + eeprom[tlv_index + 1]] + code = "0x%02X" % tlv[0] + + name, value = self.decoder(None, tlv) + + self.eeprom_tlv_dict[code] = value + if eeprom[tlv_index] == self._TLV_CODE_CRC_32: + break + + tlv_index += eeprom[tlv_index+1] + 2 + + def serial_number_str(self): + """ + Returns the serial number + """ + (is_valid, results) = self.get_tlv_field( + self.eeprom_data, self._TLV_CODE_SERIAL_NUMBER) + if not is_valid: + return "N/A" + return results[2].decode('ascii') + + def base_mac_addr(self, e): + """ + Returns the base mac address found in the system EEPROM + """ + (is_valid, t) = self.get_tlv_field( + self.eeprom_data, self._TLV_CODE_MAC_BASE) + if not is_valid or t[1] != 6: + return super(eeprom_tlvinfo.TlvInfoDecoder, self).switchaddrstr(t) + + return ":".join(["{:02x}".format(T) for T in t[2]]).upper() + + def modelstr(self): + """ + Returns the Model name + """ + (is_valid, results) = self.get_tlv_field( + self.eeprom_data, self._TLV_CODE_PRODUCT_NAME) + if not is_valid: + return "N/A" + + return results[2].decode('ascii') + + def part_number_str(self): + """ + Returns the part number + """ + (is_valid, results) = self.get_tlv_field( + self.eeprom_data, self._TLV_CODE_PART_NUMBER) + if not is_valid: + return "N/A" + + return results[2].decode('ascii') + + def serial_str(self): + """ + Returns the servicetag number + """ + (is_valid, results) = self.get_tlv_field( + self.eeprom_data, self._TLV_CODE_SERVICE_TAG) + if not is_valid: + return "N/A" + + return results[2].decode('ascii') + + def revision_str(self): + """ + Returns the device revision + """ + (is_valid, results) = self.get_tlv_field( + self.eeprom_data, self._TLV_CODE_DEVICE_VERSION) + if not is_valid: + return "N/A" + + return results[2].decode('ascii') + + def system_eeprom_info(self): + """ + Returns a dictionary, where keys are the type code defined in + ONIE EEPROM format and values are their corresponding values + found in the system EEPROM. + """ + return self.eeprom_tlv_dict diff --git a/platform/broadcom/sonic-platform-modules-dell/s5248f/sonic_platform/fan.py b/platform/broadcom/sonic-platform-modules-dell/s5248f/sonic_platform/fan.py new file mode 100644 index 000000000000..55327d5ddf58 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-dell/s5248f/sonic_platform/fan.py @@ -0,0 +1,185 @@ +#!/usr/bin/env python + +######################################################################## +# DellEMC S5248F +# +# Module contains an implementation of SONiC Platform Base API and +# provides the Fans' information which are available in the platform. +# +######################################################################## + +try: + from sonic_platform_base.fan_base import FanBase + from sonic_platform.ipmihelper import IpmiSensor, IpmiFru +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +FAN1_MAX_SPEED_OFFSET = 71 +FAN2_MAX_SPEED_OFFSET = 73 +PSU_FAN_MAX_SPEED_OFFSET = 50 +FAN_DIRECTION_OFFSET = 69 +PSU_FAN_DIRECTION_OFFSET = 47 + + +class Fan(FanBase): + """DellEMC Platform-specific Fan class""" + # { FAN-ID: { Sensor-Name: Sensor-ID } } + # System rev X01, BMC firmware rev 1.02 + FAN_SENSOR_MAPPING = { 1: {"Prsnt": 0x53, "State": 0x57, "Speed": 0x24}, + 2: {"Prsnt": 0x53, "State": 0x5b, "Speed": 0x20}, + 3: {"Prsnt": 0x54, "State": 0x58, "Speed": 0x25}, + 4: {"Prsnt": 0x54, "State": 0x5c, "Speed": 0x21}, + 5: {"Prsnt": 0x55, "State": 0x59, "Speed": 0x26}, + 6: {"Prsnt": 0x55, "State": 0x5d, "Speed": 0x22}, + 7: {"Prsnt": 0x56, "State": 0x5a, "Speed": 0x27}, + 8: {"Prsnt": 0x56, "State": 0x5e, "Speed": 0x23} + } + PSU_FAN_SENSOR_MAPPING = { 1: {"State": 0x31, "Speed": 0x28}, + 2: {"State": 0x32, "Speed": 0x29} } + + # { FANTRAY-ID: FRU-ID } + FAN_FRU_MAPPING = { 1: 3, 2: 4, 3: 5, 4: 6 } + PSU_FRU_MAPPING = { 1: 1, 2: 2 } + + def __init__(self, fantray_index=1, fan_index=1, psu_fan=False, + dependency=None): + FanBase.__init__(self) + self.is_psu_fan = psu_fan + if not self.is_psu_fan: + # API index is starting from 0, DellEMC platform index is + # starting from 1 + self.fantrayindex = fantray_index + 1 + self.fanindex = fan_index + 1 + if (self.fanindex == 1): + self.max_speed_offset = FAN1_MAX_SPEED_OFFSET + else: + self.max_speed_offset = FAN2_MAX_SPEED_OFFSET + self.fan_direction_offset = FAN_DIRECTION_OFFSET + self.index = (self.fantrayindex - 1) * 2 + self.fanindex + self.prsnt_sensor = IpmiSensor(self.FAN_SENSOR_MAPPING[self.index]["Prsnt"], + is_discrete=True) + self.state_sensor = IpmiSensor(self.FAN_SENSOR_MAPPING[self.index]["State"], + is_discrete=True) + self.speed_sensor = IpmiSensor(self.FAN_SENSOR_MAPPING[self.index]["Speed"]) + self.fru = IpmiFru(self.FAN_FRU_MAPPING[self.fantrayindex]) + else: + self.dependency = dependency + self.fanindex = fan_index + self.state_sensor = IpmiSensor(self.PSU_FAN_SENSOR_MAPPING[self.fanindex]["State"], + is_discrete=True) + self.speed_sensor = IpmiSensor(self.PSU_FAN_SENSOR_MAPPING[self.fanindex]["Speed"]) + self.fru = IpmiFru(self.PSU_FRU_MAPPING[self.fanindex]) + self.max_speed_offset = PSU_FAN_MAX_SPEED_OFFSET + self.fan_direction_offset = PSU_FAN_DIRECTION_OFFSET + self.max_speed = self.fru.get_fru_data(self.max_speed_offset,2)[1] + self.max_speed = self.max_speed[1] << 8 | self.max_speed[0] + + def get_name(self): + """ + Retrieves the name of the device + Returns: + String: The name of the device + """ + if self.is_psu_fan: + return "PSU{} Fan".format(self.fanindex) + else: + return "FanTray{}-Fan{}".format(self.fantrayindex, self.fanindex) + + def get_model(self): + """ + Retrieves the part number of the FAN + Returns: + String: Part number of FAN + """ + if self.is_psu_fan: + return None + else: + return self.fru.get_board_part_number() + + def get_serial(self): + """ + Retrieves the serial number of the FAN + Returns: + String: Serial number of FAN + """ + if self.is_psu_fan: + return None + else: + return self.fru.get_board_serial() + + def get_presence(self): + """ + Retrieves the presence of the FAN + Returns: + bool: True if fan is present, False if not + """ + presence = False + if self.is_psu_fan: + return self.dependency.get_presence() + else: + is_valid, state = self.prsnt_sensor.get_reading() + if is_valid: + if (state & 0b1): + presence = True + return presence + + def get_status(self): + """ + Retrieves the operational status of the FAN + Returns: + bool: True if FAN is operating properly, False if not + """ + status = False + is_valid, state = self.state_sensor.get_reading() + if is_valid: + if not state > 1: + status = True + return status + + def get_direction(self): + """ + Retrieves the fan airfow direction + Returns: + A string, either FAN_DIRECTION_INTAKE or FAN_DIRECTION_EXHAUST + depending on fan direction + + Notes: + In DellEMC platforms, + - Forward/Exhaust : Air flows from Port side to Fan side. + - Reverse/Intake : Air flows from Fan side to Port side. + """ + direction = [self.FAN_DIRECTION_EXHAUST, self.FAN_DIRECTION_INTAKE] + fan_status = self.get_presence() + if not fan_status: + return None + is_valid, fan_direction = self.fru.get_fru_data(self.fan_direction_offset) + if is_valid and fan_direction[0] < len(direction): + return direction[fan_direction[0]] + else: + return None + + def get_speed(self): + """ + Retrieves the speed of the fan + Returns: + int: percentage of the max fan speed + """ + if self.max_speed == 0: + self.max_speed = self.fru.get_fru_data(self.max_speed_offset,2)[1] + self.max_speed = self.max_speed[1] << 8 | self.max_speed[0] + is_valid, fan_speed = self.speed_sensor.get_reading() + if not is_valid or self.max_speed == 0: + return None + else: + speed = (100 * fan_speed)//self.max_speed + return speed + + def get_speed_rpm(self): + """ + Retrieves the speed of the fan + Returns: + int: percentage of the max fan speed + """ + fan_speed = 0 + is_valid, fan_speed = self.speed_sensor.get_reading() + return fan_speed if is_valid else None diff --git a/platform/broadcom/sonic-platform-modules-dell/s5248f/sonic_platform/fan_drawer.py b/platform/broadcom/sonic-platform-modules-dell/s5248f/sonic_platform/fan_drawer.py new file mode 100644 index 000000000000..59391f38d4e6 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-dell/s5248f/sonic_platform/fan_drawer.py @@ -0,0 +1,37 @@ +#!/usr/bin/env python + +######################################################################## +# DellEMC S5248F +# +# Module contains an implementation of SONiC Platform Base API and +# provides the Fan-Drawers' information available in the platform. +# +######################################################################## + +try: + from sonic_platform_base.fan_drawer_base import FanDrawerBase + from sonic_platform.fan import Fan +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +S5248F_FANS_PER_FANTRAY = 2 + + +class FanDrawer(FanDrawerBase): + """DellEMC Platform-specific Fan class""" + + def __init__(self, fantray_index): + + FanDrawerBase.__init__(self) + # FanTray is 1-based in DellEMC platforms + self.fantrayindex = fantray_index + 1 + for i in range(S5248F_FANS_PER_FANTRAY): + self._fan_list.append(Fan(fantray_index, i)) + + def get_name(self): + """ + Retrieves the fan drawer name + Returns: + string: The name of the device + """ + return "FanTray{}".format(self.fantrayindex) diff --git a/platform/broadcom/sonic-platform-modules-dell/s5248f/sonic_platform/hwaccess.py b/platform/broadcom/sonic-platform-modules-dell/s5248f/sonic_platform/hwaccess.py new file mode 120000 index 000000000000..e8fa340a444d --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-dell/s5248f/sonic_platform/hwaccess.py @@ -0,0 +1 @@ +../../common/sonic_platform/hwaccess.py \ No newline at end of file diff --git a/platform/broadcom/sonic-platform-modules-dell/s5248f/sonic_platform/media_settings_plugin.py b/platform/broadcom/sonic-platform-modules-dell/s5248f/sonic_platform/media_settings_plugin.py new file mode 100644 index 000000000000..3b7667846eda --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-dell/s5248f/sonic_platform/media_settings_plugin.py @@ -0,0 +1,13 @@ +# Media settings key plugin +# +# Generate keys used for lookup in media_settings,json + +def get_media_settings_key(physical_port, transceiver_dict): + d = transceiver_dict[physical_port] + media_interface = d['media_interface'] + generic_key = '{}-{}'.format(d['form_factor'], media_interface) + if media_interface == 'CR': + generic_key = '{}-{}'.format(generic_key, d['cable_length_detailed']) + return ['{}-{}'.format(d['manufacturename'], d['modelname']), + generic_key + ] diff --git a/platform/broadcom/sonic-platform-modules-dell/s5248f/sonic_platform/platform.py b/platform/broadcom/sonic-platform-modules-dell/s5248f/sonic_platform/platform.py new file mode 100644 index 000000000000..996d94cf5a6e --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-dell/s5248f/sonic_platform/platform.py @@ -0,0 +1,24 @@ +#!/usr/bin/env python + +############################################################################# +# +# Module contains an implementation of SONiC Platform Base API and +# provides the platform information +# +############################################################################# + +try: + from sonic_platform_base.platform_base import PlatformBase + from sonic_platform.chassis import Chassis +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class Platform(PlatformBase): + """ + DELLEMC Platform-specific class + """ + + def __init__(self): + PlatformBase.__init__(self) + self._chassis = Chassis() diff --git a/platform/broadcom/sonic-platform-modules-dell/s5248f/sonic_platform/psu.py b/platform/broadcom/sonic-platform-modules-dell/s5248f/sonic_platform/psu.py new file mode 100644 index 000000000000..192a93b2d3a9 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-dell/s5248f/sonic_platform/psu.py @@ -0,0 +1,230 @@ +#!/usr/bin/env python + +######################################################################## +# DellEMC S5248F +# +# Module contains an implementation of SONiC Platform Base API and +# provides the PSUs' information which are available in the platform +# +######################################################################## + + +try: + from sonic_platform_base.psu_base import PsuBase + from sonic_platform.ipmihelper import IpmiSensor, IpmiFru + from sonic_platform.fan import Fan +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class Psu(PsuBase): + """DellEMC Platform-specific PSU class""" + + # { PSU-ID: { Sensor-Name: Sensor-ID } } + SENSOR_MAPPING = { 1: { "State": 0x31, "Current": 0x39, + "Power": 0x37, "Voltage": 0x38, + "InCurrent": 0x36, "InPower": 0x34, + "InVoltage": 0x35 }, + 2: { "State": 0x32, "Current": 0x3F, + "Power": 0x3D, "Voltage": 0x3E, + "InCurrent": 0x3C, "InPower": 0x3A, + "InVoltage": 0x3B } } + # ( PSU-ID: FRU-ID } + FRU_MAPPING = { 1: 1, 2: 2 } + + def __init__(self, psu_index): + PsuBase.__init__(self) + # PSU is 1-based in DellEMC platforms + self.index = psu_index + 1 + self.state_sensor = IpmiSensor(self.SENSOR_MAPPING[self.index]["State"], + is_discrete=True) + self.voltage_sensor = IpmiSensor(self.SENSOR_MAPPING[self.index]["Voltage"]) + self.current_sensor = IpmiSensor(self.SENSOR_MAPPING[self.index]["Current"]) + self.power_sensor = IpmiSensor(self.SENSOR_MAPPING[self.index]["Power"]) + self.input_voltage_sensor = IpmiSensor(self.SENSOR_MAPPING[self.index]["InVoltage"]) + self.input_current_sensor = IpmiSensor(self.SENSOR_MAPPING[self.index]["InCurrent"]) + self.input_power_sensor = IpmiSensor(self.SENSOR_MAPPING[self.index]["InPower"]) + self.fru = IpmiFru(self.FRU_MAPPING[self.index]) + + self._fan_list.append(Fan(fan_index=self.index, psu_fan=True, + dependency=self)) + + def get_name(self): + """ + Retrieves the name of the device + + Returns: + string: The name of the device + """ + return "PSU{}".format(self.index) + + def get_presence(self): + """ + Retrieves the presence of the Power Supply Unit (PSU) + + Returns: + bool: True if PSU is present, False if not + """ + presence = False + is_valid, state = self.state_sensor.get_reading() + if is_valid: + if (state & 0b1): + presence = True + + return presence + + def get_model(self): + """ + Retrieves the part number of the PSU + + Returns: + string: Part number of PSU + """ + return self.fru.get_board_part_number() + + def get_serial(self): + """ + Retrieves the serial number of the PSU + + Returns: + string: Serial number of PSU + """ + return self.fru.get_board_serial() + + def get_status(self): + """ + Retrieves the operational status of the PSU + + Returns: + bool: True if PSU is operating properly, False if not + """ + status = False + is_valid, state = self.state_sensor.get_reading() + if is_valid: + if (state == 0x01): + status = True + + return status + + def get_voltage(self): + """ + Retrieves current PSU voltage output + + Returns: + A float number, the output voltage in volts, + e.g. 12.1 + """ + is_valid, voltage = self.voltage_sensor.get_reading() + if not is_valid: + return None + + return "{:.1f}".format(voltage) + + def get_current(self): + """ + Retrieves present electric current supplied by PSU + + Returns: + A float number, electric current in amperes, + e.g. 15.4 + """ + is_valid, current = self.current_sensor.get_reading() + if not is_valid: + return None + + return "{:.1f}".format(current) + + def get_power(self): + """ + Retrieves current energy supplied by PSU + + Returns: + A float number, the power in watts, + e.g. 302.6 + """ + is_valid, power = self.power_sensor.get_reading() + if not is_valid: + return None + + return "{:.1f}".format(power) + + def get_input_voltage(self): + """ + Retrieves current PSU voltage input + + Returns: + A float number, the input voltage in volts, + e.g. 12.1 + """ + is_valid, input_voltage = self.input_voltage_sensor.get_reading() + if not is_valid: + return None + + return "{:.1f}".format(input_voltage) + + def get_input_current(self): + """ + Retrieves present electric current supplied to PSU + + Returns: + A float number, electric current in amperes, + e.g. 15.4 + """ + is_valid, input_current = self.input_current_sensor.get_reading() + if not is_valid: + return None + + return "{:.1f}".format(input_current) + + def get_input_power(self): + """ + Retrieves current energy supplied to PSU + + Returns: + A float number, the power in watts, + e.g. 302.6 + """ + is_valid, input_power = self.input_power_sensor.get_reading() + if not is_valid: + return None + + return "{:.1f}".format(input_power) + + def get_powergood_status(self): + """ + Retrieves the powergood status of PSU + + Returns: + A boolean, True if PSU has stablized its output voltages and + passed all its internal self-tests, False if not. + """ + status = False + is_valid, state = self.state_sensor.get_reading() + if is_valid: + if (state == 0x01): + status = True + + return status + + def get_mfr_id(self): + """ + Retrives the Manufacturer Id of PSU + + Returns: + A string, the manunfacturer id. + """ + return self.fru.get_board_mfr_id() + + def get_type(self): + """ + Retrives the Power Type of PSU + + Returns : + A string, PSU power type + """ + board_product = self.fru.get_board_product() + if board_product is not None : + info = board_product.split(',') + if 'AC' in info : return 'AC' + if 'DC' in info : return 'DC' + return None diff --git a/platform/broadcom/sonic-platform-modules-dell/s5248f/sonic_platform/sfp.py b/platform/broadcom/sonic-platform-modules-dell/s5248f/sonic_platform/sfp.py new file mode 100644 index 000000000000..eed6dc7b03da --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-dell/s5248f/sonic_platform/sfp.py @@ -0,0 +1,1050 @@ +#!/usr/bin/env python + +############################################################################# +# DELLEMC +# +# Module contains an implementation of SONiC Platform Base API and +# provides the platform information +# +############################################################################# + +try: + import os + import time + import struct + import mmap + from sonic_platform_base.sfp_base import SfpBase + from sonic_platform_base.sonic_sfp.sff8436 import sff8436InterfaceId + from sonic_platform_base.sonic_sfp.sff8436 import sff8436Dom + from sonic_platform_base.sonic_sfp.sff8472 import sff8472InterfaceId + from sonic_platform_base.sonic_sfp.sff8472 import sff8472Dom + from sonic_platform_base.sonic_sfp.sff8472 import sffbase + +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +PAGE_OFFSET = 0 +KEY_OFFSET = 1 +KEY_WIDTH = 2 +FUNC_NAME = 3 + +QSFP_INFO_OFFSET = 128 +QSFP_DOM_OFFSET = 0 +QSFP_DOM_OFFSET1 = 384 + +SFP_INFO_OFFSET = 0 +SFP_DOM_OFFSET = 256 + +SFP_STATUS_CONTROL_OFFSET = 110 +SFP_STATUS_CONTROL_WIDTH = 7 +SFP_TX_DISABLE_HARD_BIT = 7 +SFP_TX_DISABLE_SOFT_BIT = 6 + +qsfp_cable_length_tup = ('Length(km)', 'Length OM3(2m)', 'Length OM2(m)', + 'Length OM1(m)', 'Length Cable Assembly(m)') + +qsfp_compliance_code_tup = ( + '10/40G Ethernet Compliance Code', + 'SONET Compliance codes', + 'SAS/SATA compliance codes', + 'Gigabit Ethernet Compliant codes', + 'Fibre Channel link length/Transmitter Technology', + 'Fibre Channel transmission media', + 'Fibre Channel Speed') + +sfp_cable_length_tup = ('LengthSMFkm-UnitsOfKm', 'LengthSMF(UnitsOf100m)', + 'Length50um(UnitsOf10m)', 'Length62.5um(UnitsOfm)', + 'LengthOM3(UnitsOf10m)', 'LengthCable(UnitsOfm)') + +sfp_compliance_code_tup = ('10GEthernetComplianceCode', 'InfinibandComplianceCode', + 'ESCONComplianceCodes', 'SONETComplianceCodes', + 'EthernetComplianceCodes', 'FibreChannelLinkLength', + 'FibreChannelTechnology', 'SFP+CableTechnology', + 'FibreChannelTransmissionMedia', 'FibreChannelSpeed') + +info_dict_keys = ['type', 'hardware_rev', 'serial', + 'manufacturer', 'model', 'connector', + 'encoding', 'ext_identifier', 'ext_rateselect_compliance', + 'cable_type', 'cable_length', 'nominal_bit_rate', + 'specification_compliance', 'type_abbrv_name','vendor_date', 'vendor_oui'] + +dom_dict_keys = ['rx_los', 'tx_fault', 'reset_status', + 'power_lpmode', 'tx_disable', 'tx_disable_channel', + 'temperature', 'voltage', 'rx1power', + 'rx2power', 'rx3power', 'rx4power', + 'tx1bias', 'tx2bias', 'tx3bias', + 'tx4bias', 'tx1power', 'tx2power', + 'tx3power', 'tx4power'] + +threshold_dict_keys = ['temphighalarm', 'temphighwarning', + 'templowalarm', 'templowwarning', + 'vcchighalarm', 'vcchighwarning', + 'vcclowalarm', 'vcclowwarning', + 'rxpowerhighalarm', 'rxpowerhighwarning', + 'rxpowerlowalarm', 'rxpowerlowwarning', + 'txpowerhighalarm', 'txpowerhighwarning', + 'txpowerlowalarm', 'txpowerlowwarning', + 'txbiashighalarm', 'txbiashighwarning', + 'txbiaslowalarm', 'txbiaslowwarning'] + +sff8436_parser = { + 'reset_status': [QSFP_DOM_OFFSET, 2, 1, 'parse_dom_status_indicator'], + 'rx_los': [QSFP_DOM_OFFSET, 3, 1, 'parse_dom_tx_rx_los'], + 'tx_fault': [QSFP_DOM_OFFSET, 4, 1, 'parse_dom_tx_fault'], + 'tx_disable': [QSFP_DOM_OFFSET, 86, 1, 'parse_dom_tx_disable'], + 'power_lpmode': [QSFP_DOM_OFFSET, 93, 1, 'parse_dom_power_control'], + 'power_override': [QSFP_DOM_OFFSET, 93, 1, 'parse_dom_power_control'], + 'Temperature': [QSFP_DOM_OFFSET, 22, 2, 'parse_temperature'], + 'Voltage': [QSFP_DOM_OFFSET, 26, 2, 'parse_voltage'], + 'ChannelMonitor': [QSFP_DOM_OFFSET, 34, 16, 'parse_channel_monitor_params'], + 'ChannelMonitor_TxPower': + [QSFP_DOM_OFFSET, 34, 24, 'parse_channel_monitor_params_with_tx_power'], + + 'cable_type': [QSFP_INFO_OFFSET, -1, -1, 'parse_sfp_info_bulk'], + 'cable_length': [QSFP_INFO_OFFSET, -1, -1, 'parse_sfp_info_bulk'], + 'connector': [QSFP_INFO_OFFSET, 0, 20, 'parse_sfp_info_bulk'], + 'type': [QSFP_INFO_OFFSET, 0, 20, 'parse_sfp_info_bulk'], + 'encoding': [QSFP_INFO_OFFSET, 0, 20, 'parse_sfp_info_bulk'], + 'ext_identifier': [QSFP_INFO_OFFSET, 0, 20, 'parse_sfp_info_bulk'], + 'ext_rateselect_compliance': + [QSFP_INFO_OFFSET, 0, 20, 'parse_sfp_info_bulk'], + 'nominal_bit_rate': [QSFP_INFO_OFFSET, 0, 20, 'parse_sfp_info_bulk'], + 'specification_compliance': + [QSFP_INFO_OFFSET, 0, 20, 'parse_sfp_info_bulk'], + 'type_abbrv_name': [QSFP_INFO_OFFSET, 0, 20, 'parse_sfp_info_bulk'], + 'manufacturer': [QSFP_INFO_OFFSET, 20, 16, 'parse_vendor_name'], + 'vendor_oui': [QSFP_INFO_OFFSET, 37, 3, 'parse_vendor_oui'], + 'model': [QSFP_INFO_OFFSET, 40, 16, 'parse_vendor_pn'], + 'hardware_rev': [QSFP_INFO_OFFSET, 56, 2, 'parse_vendor_rev'], + 'serial': [QSFP_INFO_OFFSET, 68, 16, 'parse_vendor_sn'], + 'vendor_date': [QSFP_INFO_OFFSET, 84, 8, 'parse_vendor_date'], + 'dom_capability': [QSFP_INFO_OFFSET, 92, 1, 'parse_dom_capability'], + 'dom_rev': [QSFP_DOM_OFFSET, 1, 1, 'parse_sfp_dom_rev'], + 'ModuleThreshold': [QSFP_DOM_OFFSET1, 128, 24, 'parse_module_threshold_values'], + 'ChannelThreshold': [QSFP_DOM_OFFSET1, 176, 16, 'parse_channel_threshold_values'], +} + +sff8472_parser = { + 'Temperature': [SFP_DOM_OFFSET, 96, 2, 'parse_temperature'], + 'Voltage': [SFP_DOM_OFFSET, 98, 2, 'parse_voltage'], + 'ChannelMonitor': [SFP_DOM_OFFSET, 100, 6, 'parse_channel_monitor_params'], + + 'cable_type': [SFP_INFO_OFFSET, -1, -1, 'parse_sfp_info_bulk'], + 'cable_length': [SFP_INFO_OFFSET, -1, -1, 'parse_sfp_info_bulk'], + 'connector': [SFP_INFO_OFFSET, 0, 21, 'parse_sfp_info_bulk'], + 'type': [SFP_INFO_OFFSET, 0, 21, 'parse_sfp_info_bulk'], + 'encoding': [SFP_INFO_OFFSET, 0, 21, 'parse_sfp_info_bulk'], + 'ext_identifier': [SFP_INFO_OFFSET, 0, 21, 'parse_sfp_info_bulk'], + 'ext_rateselect_compliance': + [SFP_INFO_OFFSET, 0, 21, 'parse_sfp_info_bulk'], + 'nominal_bit_rate': [SFP_INFO_OFFSET, 0, 21, 'parse_sfp_info_bulk'], + 'specification_compliance': + [SFP_INFO_OFFSET, 0, 21, 'parse_sfp_info_bulk'], + 'type_abbrv_name': [SFP_INFO_OFFSET, 0, 21, 'parse_sfp_info_bulk'], + 'manufacturer': [SFP_INFO_OFFSET, 20, 16, 'parse_vendor_name'], + 'vendor_oui': [SFP_INFO_OFFSET, 37, 3, 'parse_vendor_oui'], + 'model': [SFP_INFO_OFFSET, 40, 16, 'parse_vendor_pn'], + 'hardware_rev': [SFP_INFO_OFFSET, 56, 4, 'parse_vendor_rev'], + 'serial': [SFP_INFO_OFFSET, 68, 16, 'parse_vendor_sn'], + 'vendor_date': [SFP_INFO_OFFSET, 84, 8, 'parse_vendor_date'], + 'ModuleThreshold': [SFP_DOM_OFFSET, 0, 56, 'parse_alarm_warning_threshold'], +} + + +class Sfp(SfpBase): + """ + DELLEMC Platform-specific Sfp class + """ + BASE_RES_PATH = "/sys/bus/pci/devices/0000:04:00.0/resource0" + + def __init__(self, index=0, sfp_type=0, eeprom_path=''): + SfpBase.__init__(self) + self.sfp_type = sfp_type + self.index = index + self.eeprom_path = eeprom_path + self.qsfpInfo = sff8436InterfaceId() + self.qsfpDomInfo = sff8436Dom() + self.sfpInfo = sff8472InterfaceId() + self.sfpDomInfo = sff8472Dom(None,1) + + def pci_mem_read(self, mm, offset): + mm.seek(offset) + read_data_stream = mm.read(4) + reg_val = struct.unpack('I', read_data_stream) + mem_val = str(reg_val)[1:-2] + # print "reg_val read:%x"%reg_val + return mem_val + + def pci_mem_write(self, mm, offset, data): + mm.seek(offset) + # print "data to write:%x"%data + mm.write(struct.pack('I', data)) + + def pci_set_value(self, resource, val, offset): + fd = os.open(resource, os.O_RDWR) + mm = mmap.mmap(fd, 0) + val = self.pci_mem_write(mm, offset, val) + mm.close() + os.close(fd) + return val + + def pci_get_value(self, resource, offset): + fd = os.open(resource, os.O_RDWR) + mm = mmap.mmap(fd, 0) + val = self.pci_mem_read(mm, offset) + mm.close() + os.close(fd) + return val + + def _read_eeprom_bytes(self, eeprom_path, offset, num_bytes): + eeprom_raw = [] + try: + eeprom = open(eeprom_path, mode="rb", buffering=0) + except IOError: + return None + + for i in range(0, num_bytes): + eeprom_raw.append("0x00") + + try: + eeprom.seek(offset) + raw = eeprom.read(num_bytes) + except IOError: + eeprom.close() + return None + + try: + if isinstance(raw , str): + for n in range(0, num_bytes): + eeprom_raw[n] = hex(ord(raw[n]))[2:].zfill(2) + else: + for n in range(0, num_bytes): + eeprom_raw[n] = hex(raw[n])[2:].zfill(2) + + except BaseException: + eeprom.close() + return None + + eeprom.close() + return eeprom_raw + + def _get_eeprom_data(self, eeprom_key): + eeprom_data = None + page_offset = None + + if(self.sfp_type == 'QSFP'): + page_offset = sff8436_parser[eeprom_key][PAGE_OFFSET] + eeprom_data_raw = self._read_eeprom_bytes( + self.eeprom_path, + (sff8436_parser[eeprom_key][PAGE_OFFSET] + + sff8436_parser[eeprom_key][KEY_OFFSET]), + sff8436_parser[eeprom_key][KEY_WIDTH]) + if (eeprom_data_raw is not None): + # Offset 128 is used to retrieve sff8436InterfaceId Info + # Offset 0 is used to retrieve sff8436Dom Info + if (page_offset == 128): + if ( self.qsfpInfo is None): + return None + eeprom_data = getattr( + self.qsfpInfo, sff8436_parser[eeprom_key][FUNC_NAME])( + eeprom_data_raw, 0) + else: + if ( self.qsfpDomInfo is None): + return None + eeprom_data = getattr( + self.qsfpDomInfo, sff8436_parser[eeprom_key][FUNC_NAME])( + eeprom_data_raw, 0) + else: + page_offset = sff8472_parser[eeprom_key][PAGE_OFFSET] + eeprom_data_raw = self._read_eeprom_bytes( + self.eeprom_path, + (sff8472_parser[eeprom_key][PAGE_OFFSET] + + sff8472_parser[eeprom_key][KEY_OFFSET]), + sff8472_parser[eeprom_key][KEY_WIDTH]) + if (eeprom_data_raw is not None): + # Offset 0 is used to retrieve sff8472InterfaceId Info + # Offset 256 is used to retrieve sff8472Dom Info + if (page_offset == 0): + if ( self.sfpInfo is None): + return None + eeprom_data = getattr( + self.sfpInfo, sff8472_parser[eeprom_key][FUNC_NAME])( + eeprom_data_raw, 0) + else: + if ( self.sfpDomInfo is None): + return None + eeprom_data = getattr( + self.sfpDomInfo, sff8472_parser[eeprom_key][FUNC_NAME])( + eeprom_data_raw, 0) + + return eeprom_data + + def get_transceiver_info(self): + """ + Retrieves transceiver info of this SFP + """ + transceiver_info_dict = {} + compliance_code_dict = {} + transceiver_info_dict = dict.fromkeys(info_dict_keys, 'N/A') + # BaseInformation + iface_data = self._get_eeprom_data('type') + if (iface_data is not None): + connector = iface_data['data']['Connector']['value'] + encoding = iface_data['data']['EncodingCodes']['value'] + ext_id = iface_data['data']['Extended Identifier']['value'] + rate_identifier = iface_data['data']['RateIdentifier']['value'] + identifier = iface_data['data']['type']['value'] + type_abbrv_name=iface_data['data']['type_abbrv_name']['value'] + if(self.sfp_type == 'QSFP'): + bit_rate = str( + iface_data['data']['Nominal Bit Rate(100Mbs)']['value']) + for key in qsfp_compliance_code_tup: + if key in iface_data['data']['Specification compliance']['value']: + compliance_code_dict[key] = iface_data['data']['Specification compliance']['value'][key]['value'] + for key in qsfp_cable_length_tup: + if key in iface_data['data']: + cable_type = key + cable_length = str(iface_data['data'][key]['value']) + else: + bit_rate = str( + iface_data['data']['NominalSignallingRate(UnitsOf100Mbd)']['value']) + for key in sfp_compliance_code_tup: + if key in iface_data['data']['Specification compliance']['value']: + compliance_code_dict[key] = iface_data['data']['Specification compliance']['value'][key]['value'] + for key in sfp_cable_length_tup: + if key in iface_data['data']: + cable_type = key + cable_length = str(iface_data['data'][key]['value']) + else: + return transceiver_info_dict + + # Vendor Date + vendor_date_data = self._get_eeprom_data('vendor_date') + if (vendor_date_data is not None): + vendor_date = vendor_date_data['data']['VendorDataCode(YYYY-MM-DD Lot)']['value'] + else: + return transceiver_info_dict + + # Vendor Name + vendor_name_data = self._get_eeprom_data('manufacturer') + if (vendor_name_data is not None): + vendor_name = vendor_name_data['data']['Vendor Name']['value'] + else: + return transceiver_info_dict + + # Vendor OUI + vendor_oui_data = self._get_eeprom_data('vendor_oui') + if (vendor_oui_data is not None): + vendor_oui = vendor_oui_data['data']['Vendor OUI']['value'] + else: + return transceiver_info_dict + + # Vendor PN + vendor_pn_data = self._get_eeprom_data('model') + if (vendor_pn_data is not None): + vendor_pn = vendor_pn_data['data']['Vendor PN']['value'] + else: + return transceiver_info_dict + + # Vendor Revision + vendor_rev_data = self._get_eeprom_data('hardware_rev') + if (vendor_rev_data is not None): + vendor_rev = vendor_rev_data['data']['Vendor Rev']['value'] + else: + return transceiver_info_dict + + # Vendor Serial Number + vendor_sn_data = self._get_eeprom_data('serial') + if (vendor_sn_data is not None): + vendor_sn = vendor_sn_data['data']['Vendor SN']['value'] + else: + return transceiver_info_dict + + # Fill The Dictionary and return + transceiver_info_dict['type'] = identifier + transceiver_info_dict['hardware_rev'] = vendor_rev + transceiver_info_dict['serial'] = vendor_sn + transceiver_info_dict['manufacturer'] = vendor_name + transceiver_info_dict['model'] = vendor_pn + transceiver_info_dict['connector'] = connector + transceiver_info_dict['encoding'] = encoding + transceiver_info_dict['ext_identifier'] = ext_id + transceiver_info_dict['ext_rateselect_compliance'] = rate_identifier + transceiver_info_dict['cable_type'] = cable_type + transceiver_info_dict['cable_length'] = cable_length + transceiver_info_dict['nominal_bit_rate'] = bit_rate + transceiver_info_dict['specification_compliance'] = str(compliance_code_dict) + transceiver_info_dict['vendor_date'] = vendor_date + transceiver_info_dict['vendor_oui'] = vendor_oui + transceiver_info_dict['type_abbrv_name']=type_abbrv_name + + return transceiver_info_dict + + def get_transceiver_threshold_info(self): + """ + Retrieves transceiver threshold info of this SFP + """ + transceiver_dom_threshold_dict = {} + transceiver_dom_threshold_dict = dict.fromkeys( + threshold_dict_keys, 'N/A') + + # Module Threshold + module_threshold_data = self._get_eeprom_data('ModuleThreshold') + if (self.sfp_type == 'QSFP'): + # Channel Threshold + channel_threshold_data = self._get_eeprom_data('ChannelThreshold') + + if (channel_threshold_data is not None and module_threshold_data is not None): + transceiver_dom_threshold_dict['temphighalarm'] = module_threshold_data['data']['TempHighAlarm']['value'] + transceiver_dom_threshold_dict['temphighwarning'] = module_threshold_data['data']['TempHighWarning']['value'] + transceiver_dom_threshold_dict['templowalarm'] = module_threshold_data['data']['TempLowAlarm']['value'] + transceiver_dom_threshold_dict['templowwarning'] = module_threshold_data['data']['TempLowWarning']['value'] + transceiver_dom_threshold_dict['vcchighalarm'] = module_threshold_data['data']['VccHighAlarm']['value'] + transceiver_dom_threshold_dict['vcchighwarning'] = module_threshold_data['data']['VccHighWarning']['value'] + transceiver_dom_threshold_dict['vcclowalarm'] = module_threshold_data['data']['VccLowAlarm']['value'] + transceiver_dom_threshold_dict['vcclowwarning'] = module_threshold_data['data']['VccLowWarning']['value'] + transceiver_dom_threshold_dict['rxpowerhighalarm'] = channel_threshold_data['data']['RxPowerHighAlarm']['value'] + transceiver_dom_threshold_dict['rxpowerhighwarning'] = channel_threshold_data['data']['RxPowerHighWarning']['value'] + transceiver_dom_threshold_dict['rxpowerlowalarm'] = channel_threshold_data['data']['RxPowerLowAlarm']['value'] + transceiver_dom_threshold_dict['rxpowerlowwarning'] = channel_threshold_data['data']['RxPowerLowWarning']['value'] + transceiver_dom_threshold_dict['txbiashighalarm'] = channel_threshold_data['data']['TxBiasHighAlarm']['value'] + transceiver_dom_threshold_dict['txbiashighwarning'] = channel_threshold_data['data']['TxBiasHighWarning']['value'] + transceiver_dom_threshold_dict['txbiaslowalarm'] = channel_threshold_data['data']['TxBiasLowAlarm']['value'] + transceiver_dom_threshold_dict['txbiaslowwarning'] = channel_threshold_data['data']['TxBiasLowWarning']['value'] + + else: + return transceiver_dom_threshold_dict + else: + #SFP + if (module_threshold_data is not None): + #Threshold Data + transceiver_dom_threshold_dict['temphighalarm'] = module_threshold_data['data']['TempHighAlarm']['value'] + transceiver_dom_threshold_dict['templowalarm'] = module_threshold_data['data']['TempLowAlarm']['value'] + transceiver_dom_threshold_dict['temphighwarning'] = module_threshold_data['data']['TempHighWarning']['value'] + transceiver_dom_threshold_dict['templowwarning'] = module_threshold_data['data']['TempLowWarning']['value'] + transceiver_dom_threshold_dict['vcchighalarm'] = module_threshold_data['data']['VoltageHighAlarm']['value'] + transceiver_dom_threshold_dict['vcclowalarm'] = module_threshold_data['data']['VoltageLowAlarm']['value'] + transceiver_dom_threshold_dict['vcchighwarning'] = module_threshold_data['data']['VoltageHighWarning']['value'] + transceiver_dom_threshold_dict['vcclowwarning'] = module_threshold_data['data']['VoltageLowWarning']['value'] + transceiver_dom_threshold_dict['txbiashighalarm'] = module_threshold_data['data']['BiasHighAlarm']['value'] + transceiver_dom_threshold_dict['txbiaslowalarm'] = module_threshold_data['data']['BiasLowAlarm']['value'] + transceiver_dom_threshold_dict['txbiashighwarning'] = module_threshold_data['data']['BiasHighWarning']['value'] + transceiver_dom_threshold_dict['txbiaslowwarning'] = module_threshold_data['data']['BiasLowWarning']['value'] + transceiver_dom_threshold_dict['txpowerhighalarm'] = module_threshold_data['data']['TXPowerHighAlarm']['value'] + transceiver_dom_threshold_dict['txpowerlowalarm'] = module_threshold_data['data']['TXPowerLowAlarm']['value'] + transceiver_dom_threshold_dict['txpowerhighwarning'] = module_threshold_data['data']['TXPowerHighWarning']['value'] + transceiver_dom_threshold_dict['txpowerlowwarning'] = module_threshold_data['data']['TXPowerLowWarning']['value'] + transceiver_dom_threshold_dict['rxpowerhighalarm'] = module_threshold_data['data']['RXPowerHighAlarm']['value'] + transceiver_dom_threshold_dict['rxpowerlowalarm'] = module_threshold_data['data']['RXPowerLowAlarm']['value'] + transceiver_dom_threshold_dict['rxpowerhighwarning'] = module_threshold_data['data']['RXPowerHighWarning']['value'] + transceiver_dom_threshold_dict['rxpowerlowwarning'] = module_threshold_data['data']['RXPowerLowWarning']['value'] + else: + return transceiver_dom_threshold_dict + + return transceiver_dom_threshold_dict + + def get_transceiver_bulk_status(self): + """ + Retrieves transceiver bulk status of this SFP + """ + tx_bias_list = [] + rx_power_list = [] + transceiver_dom_dict = {} + transceiver_dom_dict = dict.fromkeys(dom_dict_keys, 'N/A') + + # RxLos + rx_los = self.get_rx_los() + + # TxFault + tx_fault = self.get_tx_fault() + + # ResetStatus + reset_state = self.get_reset_status() + + # LowPower Mode + lp_mode = self.get_lpmode() + + # TxDisable + tx_disable = self.get_tx_disable() + + # TxDisable Channel + tx_disable_channel = self.get_tx_disable_channel() + + # Temperature + temperature = self.get_temperature() + + # Voltage + voltage = self.get_voltage() + + # Channel Monitor + tx_power_list = self.get_tx_power() + + # tx bias + tx_bias_list = self.get_tx_bias() + + # rx power + rx_power_list = self.get_rx_power() + + if (len(tx_bias_list) != 0): + transceiver_dom_dict['tx1bias'] = tx_bias_list[0] + transceiver_dom_dict['tx2bias'] = tx_bias_list[1] + transceiver_dom_dict['tx3bias'] = tx_bias_list[2] + transceiver_dom_dict['tx4bias'] = tx_bias_list[3] + + if (len(rx_power_list) != 0): + transceiver_dom_dict['rx1power'] = rx_power_list[0] + transceiver_dom_dict['rx2power'] = rx_power_list[1] + transceiver_dom_dict['rx3power'] = rx_power_list[2] + transceiver_dom_dict['rx4power'] = rx_power_list[3] + + if (len(tx_power_list) != 0): + transceiver_dom_dict['tx1power'] = tx_power_list[0] + transceiver_dom_dict['tx2power'] = tx_power_list[1] + transceiver_dom_dict['tx3power'] = tx_power_list[2] + transceiver_dom_dict['tx4power'] = tx_power_list[3] + + transceiver_dom_dict['rx_los'] = rx_los + transceiver_dom_dict['tx_fault'] = tx_fault + transceiver_dom_dict['reset_status'] = reset_state + transceiver_dom_dict['power_lpmode'] = lp_mode + transceiver_dom_dict['tx_disable'] = tx_disable + transceiver_dom_dict['tx_disable_channel'] = tx_disable_channel + transceiver_dom_dict['temperature'] = temperature + transceiver_dom_dict['voltage'] = voltage + + return transceiver_dom_dict + + def get_name(self): + """ + Retrieves the name of the sfp + Returns : QSFP or QSFP+ or QSFP28 + """ + + iface_data = self._get_eeprom_data('type') + if (iface_data is not None): + identifier = iface_data['data']['type']['value'] + else: + return None + + return identifier + + def get_presence(self): + """ + Retrieves the presence of the sfp + Returns : True if sfp is present and false if it is absent + """ + # Check for invalid port_num + + # Port offset starts with 0x4004 + port_offset = 16388 + ((self.index-1) * 16) + + status = self.pci_get_value(self.BASE_RES_PATH, port_offset) + reg_value = int(status) + + # Absence of status throws error + if (reg_value == ""): + return False + + # Mask off 4th bit for presence + if(self.sfp_type == 'QSFP'): + mask = (1 << 4) + + # Mask off 1st bit for presence 65,66 + if (self.sfp_type == 'SFP'): + mask = (1 << 0) + # ModPrsL is active low + if reg_value & mask == 0: + return True + + return False + + def get_model(self): + """ + Retrieves the model number (or part number) of the sfp + """ + vendor_pn_data = self._get_eeprom_data('model') + if (vendor_pn_data is not None): + vendor_pn = vendor_pn_data['data']['Vendor PN']['value'] + else: + return None + + return vendor_pn + + def get_serial(self): + """ + Retrieves the serial number of the sfp + """ + vendor_sn_data = self._get_eeprom_data('serial') + if (vendor_sn_data is not None): + vendor_sn = vendor_sn_data['data']['Vendor SN']['value'] + else: + return None + + return vendor_sn + + def get_reset_status(self): + """ + Retrives the reset status of SFP + """ + reset_status = False + if (self.sfp_type == 'QSFP'): + # Port offset starts with 0x4000 + port_offset = 16384 + ((self.index-1) * 16) + + status = self.pci_get_value(self.BASE_RES_PATH, port_offset) + reg_value = int(status) + + # Absence of status throws error + if (reg_value == ""): + return reset_status + + # Mask off 4th bit for reset status + mask = (1 << 4) + + if ((reg_value & mask) == 0): + reset_status = True + else: + reset_status = False + + return reset_status + + def get_rx_los(self): + """ + Retrieves the RX LOS (lost-of-signal) status of SFP + """ + rx_los = None + rx_los_list = [] + if (self.sfp_type == 'QSFP'): + rx_los_data = self._get_eeprom_data('rx_los') + if (rx_los_data is not None): + rx_los = rx_los_data['data']['Rx1LOS']['value'] + if (rx_los is 'On'): + rx_los_list.append(True) + else: + rx_los_list.append(False) + rx_los = rx_los_data['data']['Rx2LOS']['value'] + if (rx_los is 'On'): + rx_los_list.append(True) + else: + rx_los_list.append(False) + rx_los = rx_los_data['data']['Rx3LOS']['value'] + if (rx_los is 'On'): + rx_los_list.append(True) + else: + rx_los_list.append(False) + rx_los = rx_los_data['data']['Rx4LOS']['value'] + if (rx_los is 'On'): + rx_los_list.append(True) + else: + rx_los_list.append(False) + + if (rx_los_list[0] and rx_los_list[1] + and rx_los_list[2] and rx_los_list[3]): + rx_los = True + else: + rx_los = False + else: + rx_los_data = self._read_eeprom_bytes(self.eeprom_path, SFP_STATUS_CONTROL_OFFSET, SFP_STATUS_CONTROL_WIDTH) + if (rx_los_data is not None): + data = int(rx_los_data[0], 16) + rx_los = (sffbase().test_bit(data, 1) != 0) + + return rx_los + + def get_tx_fault(self): + """ + Retrieves the TX fault status of SFP + """ + tx_fault = None + tx_fault_list = [] + if (self.sfp_type == 'QSFP'): + tx_fault_data = self._get_eeprom_data('tx_fault') + if (tx_fault_data is not None): + tx_fault = tx_fault_data['data']['Tx1Fault']['value'] + if (tx_fault is 'On'): + tx_fault_list.append(True) + else: + tx_fault_list.append(False) + tx_fault = tx_fault_data['data']['Tx2Fault']['value'] + if (tx_fault is 'On'): + tx_fault_list.append(True) + else: + tx_fault_list.append(False) + tx_fault = tx_fault_data['data']['Tx3Fault']['value'] + if (tx_fault is 'On'): + tx_fault_list.append(True) + else: + tx_fault_list.append(False) + tx_fault = tx_fault_data['data']['Tx4Fault']['value'] + if (tx_fault is 'On'): + tx_fault_list.append(True) + else: + tx_fault_list.append(False) + + if (tx_fault_list[0] and tx_fault_list[1] + and tx_fault_list[2] and tx_fault_list[3]): + tx_fault = True + else: + tx_fault = False + + else: + tx_fault_data = self._read_eeprom_bytes(self.eeprom_path, SFP_STATUS_CONTROL_OFFSET, SFP_STATUS_CONTROL_WIDTH) + if (tx_fault_data is not None): + data = int(tx_fault_data[0], 16) + tx_fault = (sffbase().test_bit(data, 2) != 0) + + return tx_fault + + def get_tx_disable(self): + """ + Retrieves the tx_disable status of this SFP + """ + tx_disable = None + tx_disable_list = [] + if (self.sfp_type == 'QSFP'): + tx_disable_data = self._get_eeprom_data('tx_disable') + if (tx_disable_data is not None): + tx_disable = tx_disable_data['data']['Tx1Disable']['value'] + if (tx_disable is 'On'): + tx_disable_list.append(True) + else: + tx_disable_list.append(False) + tx_disable = tx_disable_data['data']['Tx2Disable']['value'] + if (tx_disable is 'On'): + tx_disable_list.append(True) + else: + tx_disable_list.append(False) + tx_disable = tx_disable_data['data']['Tx3Disable']['value'] + if (tx_disable is 'On'): + tx_disable_list.append(True) + else: + tx_disable_list.append(False) + tx_disable = tx_disable_data['data']['Tx4Disable']['value'] + if (tx_disable is 'On'): + tx_disable_list.append(True) + else: + tx_disable_list.append(False) + + if (tx_disable_list[0] and tx_disable_list[1] + and tx_disable_list[2] and tx_disable_list[3]): + tx_disable = True + else: + tx_disable = False + + else: + tx_disable_data = self._read_eeprom_bytes(self.eeprom_path, SFP_STATUS_CONTROL_OFFSET, SFP_STATUS_CONTROL_WIDTH) + if (tx_disable_data is not None): + data = int(tx_disable_data[0], 16) + tx_disable_hard = (sffbase().test_bit(data, SFP_TX_DISABLE_HARD_BIT) != 0) + tx_disable_soft = (sffbase().test_bit(data, SFP_TX_DISABLE_SOFT_BIT) != 0) + tx_disable = tx_disable_hard | tx_disable_soft + + + return tx_disable + + def get_tx_disable_channel(self): + """ + Retrieves the TX disabled channels in this SFP + """ + tx_disable = None + tx_disable_list = [] + tx_disable_channel = 0 + + if (self.sfp_type == 'QSFP'): + tx_disable_data = self._get_eeprom_data('tx_disable') + if (tx_disable_data is not None): + tx_disable = tx_disable_data['data']['Tx1Disable']['value'] + if (tx_disable is 'On'): + tx_disable_list.append(1) + else: + tx_disable_list.append(0) + tx_disable = tx_disable_data['data']['Tx2Disable']['value'] + if (tx_disable is 'On'): + tx_disable_list.append(1) + else: + tx_disable_list.append(0) + tx_disable = tx_disable_data['data']['Tx3Disable']['value'] + if (tx_disable is 'On'): + tx_disable_list.append(1) + else: + tx_disable_list.append(0) + tx_disable = tx_disable_data['data']['Tx4Disable']['value'] + if (tx_disable is 'On'): + tx_disable_list.append(1) + else: + tx_disable_list.append(0) + + bit4 = int(tx_disable_list[3]) * 8 + bit3 = int(tx_disable_list[2]) * 4 + bit2 = int(tx_disable_list[1]) * 2 + bit1 = int(tx_disable_list[0]) * 1 + + tx_disable_channel = hex(bit4 + bit3 + bit2 + bit1) + + return tx_disable_channel + + def get_lpmode(self): + """ + Retrieves the lpmode(low power mode) of this SFP + """ + lpmode_state = False + if (self.sfp_type == 'QSFP'): + + # Port offset starts with 0x4000 + port_offset = 16384 + ((self.index-1) * 16) + + status = self.pci_get_value(self.BASE_RES_PATH, port_offset) + reg_value = int(status) + + # Absence of status throws error + if (reg_value == ""): + return lpmode_state + + # Mask off 6th bit for lpmode + mask = (1 << 6) + + # LPMode is active high + if reg_value & mask == 0: + lpmode_state = False + else: + lpmode_state = True + + return lpmode_state + + def get_power_override(self): + """ + Retrieves the power-override status of this SFP + """ + power_override_state = False + + if (self.sfp_type == 'QSFP'): + power_override_data = self._get_eeprom_data('power_override') + if (power_override_data is not None): + power_override = power_override_data['data']['PowerOverRide']['value'] + if (power_override is 'On'): + power_override_state = True + else: + power_override_state = False + + return power_override_state + + def get_temperature(self): + """ + Retrieves the temperature of this SFP + """ + temperature = None + + temperature_data = self._get_eeprom_data('Temperature') + if (temperature_data is not None): + temperature = temperature_data['data']['Temperature']['value'] + + return temperature + + def get_voltage(self): + """ + Retrieves the supply voltage of this SFP + """ + voltage = None + + voltage_data = self._get_eeprom_data('Voltage') + if (voltage_data is not None): + voltage = voltage_data['data']['Vcc']['value'] + + return voltage + + def get_tx_bias(self): + """ + Retrieves the TX bias current of this SFP + """ + tx_bias = None + tx_bias_list = [] + + tx_bias_data = self._get_eeprom_data('ChannelMonitor') + if (tx_bias_data is not None): + if (self.sfp_type == 'QSFP'): + tx_bias = tx_bias_data['data']['TX1Bias']['value'] + tx_bias_list.append(tx_bias) + tx_bias = tx_bias_data['data']['TX2Bias']['value'] + tx_bias_list.append(tx_bias) + tx_bias = tx_bias_data['data']['TX3Bias']['value'] + tx_bias_list.append(tx_bias) + tx_bias = tx_bias_data['data']['TX4Bias']['value'] + tx_bias_list.append(tx_bias) + else: + tx1_bias = tx_bias_data['data']['TXBias']['value'] + return [tx1_bias, "N/A", "N/A", "N/A"] + + return tx_bias_list + + def get_rx_power(self): + """ + Retrieves the received optical power for this SFP + """ + rx_power = None + rx_power_list = [] + + rx_power_data = self._get_eeprom_data('ChannelMonitor') + if (rx_power_data is not None): + if (self.sfp_type == 'QSFP'): + rx_power = rx_power_data['data']['RX1Power']['value'] + rx_power_list.append(rx_power) + rx_power = rx_power_data['data']['RX2Power']['value'] + rx_power_list.append(rx_power) + rx_power = rx_power_data['data']['RX3Power']['value'] + rx_power_list.append(rx_power) + rx_power = rx_power_data['data']['RX4Power']['value'] + rx_power_list.append(rx_power) + else: + rx1_pw = rx_power_data['data']['RXPower']['value'] + return [rx1_pw, "N/A", "N/A", "N/A"] + + return rx_power_list + + def get_tx_power(self): + """ + Retrieves the TX power of this SFP + """ + tx_power_list = [] + if(self.sfp_type == 'QSFP'): + # QSFP capability byte parse, through this byte can know whether it support tx_power or not. + # TODO: in the future when decided to migrate to support SFF-8636 instead of SFF-8436, + # need to add more code for determining the capability and version compliance + # in SFF-8636 dom capability definitions evolving with the versions. + qspf_dom_capability_data = self._get_eeprom_data('dom_capability') + qsfp_dom_rev_data = self._get_eeprom_data('dom_rev') + if (qspf_dom_capability_data is not None and qsfp_dom_rev_data is not None): + qsfp_dom_rev = qsfp_dom_rev_data['data']['dom_rev']['value'] + qsfp_tx_power_support = qspf_dom_capability_data['data']['Tx_power_support']['value'] + else: + return tx_power_list + + # The tx_power monitoring is only available on QSFP which compliant with SFF-8636 + # and claimed that it support tx_power with one indicator bit. + if (qsfp_dom_rev[0:8] != 'SFF-8636' or (qsfp_dom_rev[0:8] == 'SFF-8636' and qsfp_tx_power_support != 'on')): + return tx_power_list + else: + channel_monitor_data = self._get_eeprom_data('ChannelMonitor_TxPower') + if (channel_monitor_data is not None): + tx1_pw = channel_monitor_data['data']['TX1Power']['value'] + tx2_pw = channel_monitor_data['data']['TX2Power']['value'] + tx3_pw = channel_monitor_data['data']['TX3Power']['value'] + tx4_pw = channel_monitor_data['data']['TX4Power']['value'] + else: + return tx_power_list + + else: + channel_monitor_data = self._get_eeprom_data('ChannelMonitor') + if (channel_monitor_data is not None): + tx1_pw = channel_monitor_data['data']['TXPower']['value'] + tx2_pw = 'N/A' + tx3_pw = 'N/A' + tx4_pw = 'N/A' + else: + return tx_power_list + + tx_power_list.append(tx1_pw) + tx_power_list.append(tx2_pw) + tx_power_list.append(tx3_pw) + tx_power_list.append(tx4_pw) + + return tx_power_list + + def reset(self): + """ + Reset the SFP and returns all user settings to their default state + """ + if (self.sfp_type == 'QSFP'): + # Port offset starts with 0x4000 + port_offset = 16384 + ((self.index-1) * 16) + + status = self.pci_get_value(self.BASE_RES_PATH, port_offset) + reg_value = int(status) + + # Absence of status throws error + if (reg_value == ""): + return False + + # Mask off 4th bit for reset + mask = (1 << 4) + + # ResetL is active low + reg_value = reg_value & ~mask + + # Convert our register value back to a hex string and write back + self.pci_set_value(self.BASE_RES_PATH, reg_value, port_offset) + + # Sleep 1 second to allow it to settle + time.sleep(1) + + reg_value = reg_value | mask + + # Convert our register value back to a hex string and write back + self.pci_set_value(self.BASE_RES_PATH, reg_value, port_offset) + + return True + + else: + return False + + def set_lpmode(self, lpmode): + """ + Sets the lpmode(low power mode) of this SFP + """ + if (self.sfp_type == 'QSFP'): + # Port offset starts with 0x4000 + port_offset = 16384 + ((self.index-1) * 16) + + status = self.pci_get_value(self.BASE_RES_PATH, port_offset) + reg_value = int(status) + + # Absence of status throws error + if (reg_value == ""): + return False + + # Mask off 6th bit for lowpower mode + mask = (1 << 6) + + # LPMode is active high; set or clear the bit accordingly + if lpmode is True: + reg_value = reg_value | mask + else: + reg_value = reg_value & ~mask + + # Convert our register value back to a hex string and write back + self.pci_set_value(self.BASE_RES_PATH, reg_value, port_offset) + + return True + + else: + return False + + def tx_disable(self, tx_disable): + """ + Disable SFP TX for all channels + """ + return False + + def tx_disable_channel(self, channel, disable): + """ + Sets the tx_disable for specified SFP channels + """ + return False + + def set_power_override(self, power_override, power_set): + """ + Sets SFP power level using power_override and power_set + """ + return False + + def get_status(self): + """ + Retrieves the operational status of the device + """ + reset = self.get_reset_status() + + if (reset == True): + status = False + else: + status = True + + return status diff --git a/platform/broadcom/sonic-platform-modules-dell/s5248f/sonic_platform/thermal.py b/platform/broadcom/sonic-platform-modules-dell/s5248f/sonic_platform/thermal.py new file mode 100644 index 000000000000..b78fca2dc776 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-dell/s5248f/sonic_platform/thermal.py @@ -0,0 +1,174 @@ +#!/usr/bin/env python + +######################################################################## +# DellEMC S5248F +# +# Module contains an implementation of SONiC Platform Base API and +# provides the Thermals' information which are available in the platform +# +######################################################################## + + +try: + from sonic_platform_base.thermal_base import ThermalBase + from sonic_platform.ipmihelper import IpmiSensor +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class Thermal(ThermalBase): + """DellEMC Platform-specific Thermal class""" + + # [ Sensor-Name, Sensor-ID ] + SENSOR_MAPPING = [ + ['CPU On-board', 0xe], + ['ASIC On-board', 0x2], + ['System Front Left', 0x3], + ['System Front Middle', 0x1], + ['System Front Right', 0x4], + ['Inlet Airflow Sensor', 0x5], + ['PSU1 Airflow Sensor', 0x7], + ['PSU2 Airflow Sensor', 0x8] + ] + + def __init__(self, thermal_index): + ThermalBase.__init__(self) + self.index = thermal_index + 1 + self.sensor = IpmiSensor(self.SENSOR_MAPPING[self.index - 1][1]) + + def get_name(self): + """ + Retrieves the name of the thermal + + Returns: + string: The name of the thermal + """ + return self.SENSOR_MAPPING[self.index - 1][0] + + def get_presence(self): + """ + Retrieves the presence of the thermal + + Returns: + bool: True if thermal is present, False if not + """ + return True + + def get_model(self): + """ + Retrieves the model number (or part number) of the Thermal + + Returns: + string: Model/part number of Thermal + """ + return 'NA' + + def get_serial(self): + """ + Retrieves the serial number of the Thermal + + Returns: + string: Serial number of Thermal + """ + return 'NA' + + def get_status(self): + """ + Retrieves the operational status of the thermal + + Returns: + A boolean value, True if thermal is operating properly, + False if not + """ + return True + + def get_temperature(self): + """ + Retrieves current temperature reading from thermal + + Returns: + A float number of current temperature in Celsius up to + nearest thousandth of one degree Celsius, e.g. 30.125 + """ + is_valid, temperature = self.sensor.get_reading() + if not is_valid: + temperature = 0 + + #return "{:.3f}".format(temperature) + return float(temperature) + + def get_high_threshold(self): + """ + Retrieves the high threshold temperature of thermal + + Returns: + A float number, the high threshold temperature of thermal in + Celsius up to nearest thousandth of one degree Celsius, + e.g. 30.125 + """ + is_valid, high_threshold = self.sensor.get_threshold("UpperNonCritical") + if not is_valid: + return super(Thermal, self).get_high_threshold() + + #return "{:.3f}".format(high_threshold) + return float(high_threshold) + + def get_high_critical_threshold(self): + """ + Retrieves the high critical threshold temperature of thermal + + Returns: + A float number, the high critical threshold temperature of thermal in + Celsius up to nearest thousandth of one degree Celsius, + e.g. 30.125 + """ + is_valid, high_crit_threshold = self.sensor.get_threshold("UpperCritical") + if not is_valid: + return super(Thermal, self).get_high_critical_threshold() + + #return "{:.3f}".format(high_crit_threshold) + return float(high_crit_threshold) + + def get_low_threshold(self): + """ + Retrieves the low threshold temperature of thermal + + Returns: + A float number, the low threshold temperature of thermal in + Celsius up to nearest thousandth of one degree Celsius, + e.g. 30.125 + """ + is_valid, low_threshold = self.sensor.get_threshold("LowerNonRecoverable") + if not is_valid: + low_threshold = 0 + + #return "{:.3f}".format(low_threshold) + return float(low_threshold) + + def set_high_threshold(self, temperature): + """ + Sets the high threshold temperature of thermal + + Args : + temperature: A float number up to nearest thousandth of one + degree Celsius, e.g. 30.125 + Returns: + A boolean, True if threshold is set successfully, False if + not + """ + # Thermal threshold values are pre-defined based on HW. + return False + + def set_low_threshold(self, temperature): + """ + Sets the low threshold temperature of thermal + + Args : + temperature: A float number up to nearest thousandth of one + degree Celsius, e.g. 30.125 + Returns: + A boolean, True if threshold is set successfully, False if + not + """ + # Thermal threshold values are pre-defined based on HW. + return False diff --git a/platform/broadcom/sonic-platform-modules-dell/s5248f/sonic_platform/watchdog.py b/platform/broadcom/sonic-platform-modules-dell/s5248f/sonic_platform/watchdog.py new file mode 100644 index 000000000000..d6131821cdf4 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-dell/s5248f/sonic_platform/watchdog.py @@ -0,0 +1,212 @@ +#!/usr/bin/env python + +######################################################################## +# +# DELLEMC S5248f +# +# Abstract base class for implementing a platform-specific class with +# which to interact with a hardware watchdog module in SONiC +# +######################################################################## + +try: + import ctypes + import subprocess + import syslog + import sonic_platform.component as Component + from sonic_platform_base.watchdog_base import WatchdogBase +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class _timespec(ctypes.Structure): + _fields_ = [ + ('tv_sec', ctypes.c_long), + ('tv_nsec', ctypes.c_long) + ] + + +class Watchdog(WatchdogBase): + """ + Abstract base class for interfacing with a hardware watchdog module + """ + + TIMERS = [15,20,30,40,50,60,65,70,80,100,120,140,160,180,210,240] + + armed_time = 0 + timeout = 0 + CLOCK_MONOTONIC = 1 + + def __init__(self): + self._librt = ctypes.CDLL('librt.so.1', use_errno=True) + self._clock_gettime = self._librt.clock_gettime + self._clock_gettime.argtypes=[ctypes.c_int, ctypes.POINTER(_timespec)] + + def _get_command_result(self, cmdline): + try: + proc = subprocess.Popen(cmdline.split(), stdout=subprocess.PIPE, + stderr=subprocess.STDOUT) + stdout = proc.communicate()[0] + proc.wait() + result = stdout.rstrip('\n'.encode()) + except OSError: + result = None + + return result + + def _get_reg_val(self): + # 0x31 = CPLD I2C Base Address + # 0x07 = Watchdog Function Register + value = self._get_command_result("/usr/sbin/i2cget -y 601 0x31 0x07") + if not value: + return None + else: + return int(value, 16) + + def _set_reg_val(self,val): + # 0x31 = CPLD I2C Base Address + # 0x07 = Watchdog Function Register + value = self._get_command_result("/usr/sbin/i2cset -y 601 0x31 0x07 %s" + % (val)) + return value + + def _get_time(self): + """ + To get clock monotonic time + """ + ts = _timespec() + if self._clock_gettime(self.CLOCK_MONOTONIC, ctypes.pointer(ts)) != 0: + self._errno = ctypes.get_errno() + return 0 + return ts.tv_sec + ts.tv_nsec * 1e-9 + + def arm(self, seconds): + """ + Arm the hardware watchdog with a timeout of seconds. + If the watchdog is currently armed, calling this function will + simply reset the timer to the provided value. If the underlying + hardware does not support the value provided in , this + method should arm the watchdog with the *next greater* + available value. + + Returns: + An integer specifying the *actual* number of seconds the + watchdog was armed with. On failure returns -1. + """ + timer_offset = -1 + for key,timer_seconds in enumerate(self.TIMERS): + if seconds <= timer_seconds: + timer_offset = key + seconds = timer_seconds + break + + if timer_offset == -1: + return -1 + + cpld_version = Component.get_cpld0_version() + wd_enabled_version = "0.8" + + if cpld_version < wd_enabled_version: + syslog.syslog(syslog.LOG_ERR, + 'Older System CPLD ver, Update to 0.8 to support watchdog ') + return -1 + + # Extracting 5th to 8th bits for WD timer values + reg_val = self._get_reg_val() + wd_timer_offset = (reg_val >> 4) & 0xf + + if wd_timer_offset != timer_offset: + # Setting 5th to 7th bits + # value from timer_offset + self.disarm() + self._set_reg_val((reg_val & 0x07) | (timer_offset << 4)) + + if self.is_armed(): + # Setting last bit to WD Timer punch + # Last bit = WD Timer punch + self._set_reg_val(reg_val & 0xFE) + + self.armed_time = self._get_time() + self.timeout = seconds + return seconds + else: + # Setting 4th bit to enable WD + # 4th bit = Enable WD + reg_val = self._get_reg_val() + self._set_reg_val(reg_val | 0x8) + + self.armed_time = self._get_time() + self.timeout = seconds + return seconds + + def disarm(self): + """ + Disarm the hardware watchdog + + Returns: + A boolean, True if watchdog is disarmed successfully, False + if not + """ + if self.is_armed(): + # Setting 4th bit to disable WD + # 4th bit = Disable WD + reg_val = self._get_reg_val() + self._set_reg_val(reg_val & 0xF7) + + self.armed_time = 0 + self.timeout = 0 + return True + + return False + + def is_armed(self): + """ + Retrieves the armed state of the hardware watchdog. + + Returns: + A boolean, True if watchdog is armed, False if not + """ + + # Extracting 4th bit to get WD Enable/Disable status + # 0 - Disabled WD + # 1 - Enabled WD + reg_val = self._get_reg_val() + wd_offset = (reg_val >> 3) & 1 + + return bool(wd_offset) + + def get_remaining_time(self): + """ + If the watchdog is armed, retrieve the number of seconds + remaining on the watchdog timer + + Returns: + An integer specifying the number of seconds remaining on + their watchdog timer. If the watchdog is not armed, returns + -1. + + S5248f doesnot have hardware support to show remaining time. + Due to this limitation, this API is implemented in software. + This API would return correct software time difference if it + is called from the process which armed the watchdog timer. + If this API called from any other process, it would return + 0. If the watchdog is not armed, this API would return -1. + """ + if not self.is_armed(): + return -1 + + if self.armed_time > 0 and self.timeout != 0: + cur_time = self._get_time() + + if cur_time <= 0: + return 0 + + diff_time = int(cur_time - self.armed_time) + + if diff_time > self.timeout: + return self.timeout + else: + return self.timeout - diff_time + + return 0 + diff --git a/platform/broadcom/sonic-platform-modules-dell/s6000/modules/dell_s6000_platform.c b/platform/broadcom/sonic-platform-modules-dell/s6000/modules/dell_s6000_platform.c index cbf506940ac9..351e518ba438 100644 --- a/platform/broadcom/sonic-platform-modules-dell/s6000/modules/dell_s6000_platform.c +++ b/platform/broadcom/sonic-platform-modules-dell/s6000/modules/dell_s6000_platform.c @@ -312,6 +312,25 @@ static ssize_t get_modsel(struct device *dev, struct device_attribute *devattr, return sprintf(buf, "0x%08x\n", data); } +static ssize_t set_modsel(struct device *dev, struct device_attribute *devattr, const char *buf, size_t count) +{ + int err; + unsigned long data = 0; + struct cpld_platform_data *pdata = dev->platform_data; + + err = kstrtoul(buf, 16, &data); + if (err) + return err; + + dell_i2c_smbus_write_byte_data(pdata[slave_cpld].client, 0x0, (u8)(data & 0xff)); + dell_i2c_smbus_write_byte_data(pdata[slave_cpld].client, 0x1, (u8)((data >> 8) & 0xff)); + dell_i2c_smbus_write_byte_data(pdata[master_cpld].client, 0xa, (u8)((data >> 16) & 0xff)); + dell_i2c_smbus_write_byte_data(pdata[master_cpld].client, 0xb, (u8)((data >> 24) & 0xff)); + + msleep(2); // As per HW spec + return count; +} + static ssize_t get_lpmode(struct device *dev, struct device_attribute *devattr, char *buf) { int ret; @@ -1128,7 +1147,7 @@ static ssize_t get_reboot_reason(struct device *dev, return sprintf(buf, "0x%x\n", data); } -static DEVICE_ATTR(qsfp_modsel, S_IRUGO, get_modsel, NULL); +static DEVICE_ATTR(qsfp_modsel, S_IRUGO | S_IWUSR, get_modsel, set_modsel); static DEVICE_ATTR(qsfp_modprs, S_IRUGO, get_modprs, NULL); static DEVICE_ATTR(qsfp_lpmode, S_IRUGO | S_IWUSR, get_lpmode, set_lpmode); static DEVICE_ATTR(qsfp_reset, S_IRUGO | S_IWUSR, get_reset, set_reset); diff --git a/platform/broadcom/sonic-platform-modules-dell/s6000/scripts/override.conf b/platform/broadcom/sonic-platform-modules-dell/s6000/scripts/override.conf new file mode 100644 index 000000000000..4291afe0d249 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-dell/s6000/scripts/override.conf @@ -0,0 +1,3 @@ +[Service] +ExecStart= +ExecStart=/usr/share/sonic/device/x86_64-dell_s6000_s1220-r0/platform_reboot_override diff --git a/platform/broadcom/sonic-platform-modules-dell/s6000/scripts/platform_reboot_override b/platform/broadcom/sonic-platform-modules-dell/s6000/scripts/platform_reboot_override new file mode 100755 index 000000000000..cae804f2cfb1 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-dell/s6000/scripts/platform_reboot_override @@ -0,0 +1,27 @@ +#!/usr/bin/python3 + +import os +import struct + +PORT_RES = '/dev/port' +COLD_RESET = 0xE # Cold Reset +WARM_RESET = 0x6 # Warm Reset +RESET_REG = 0xCF9 + +def io_reg_write(resource, offset, val): + fd = os.open(resource, os.O_RDWR) + if(fd < 0): + print('file open failed %s" % resource') + return + if(os.lseek(fd, offset, os.SEEK_SET) != offset): + print('lseek failed on %s' % resource) + return + ret = os.write(fd, struct.pack('B', val)) + if(ret != 1): + print('write failed %d' % ret) + return + os.close(fd) + + +if __name__ == "__main__": + io_reg_write(PORT_RES, RESET_REG, COLD_RESET) diff --git a/platform/broadcom/sonic-platform-modules-dell/s6000/scripts/platform_update_reboot_cause b/platform/broadcom/sonic-platform-modules-dell/s6000/scripts/platform_update_reboot_cause new file mode 100755 index 000000000000..ba6e3bbab539 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-dell/s6000/scripts/platform_update_reboot_cause @@ -0,0 +1,25 @@ +#!/usr/bin/python3 + +import os +import struct + +NVRAM_RES = '/dev/nvram' +COLD_RESET = 0xE # Cold Reset +WARM_RESET = 0x6 # Warm Reset + +def io_reg_write(resource, offset, val): + fd = os.open(resource, os.O_RDWR) + if(fd < 0): + print('file open failed %s" % resource') + return + if(os.lseek(fd, offset, os.SEEK_SET) != offset): + print('lseek failed on %s' % resource) + return + ret = os.write(fd, struct.pack('B', val)) + if(ret != 1): + print('write failed %d' % ret) + return + os.close(fd) + +if __name__ == "__main__": + io_reg_write(NVRAM_RES, 0x49, COLD_RESET) diff --git a/platform/broadcom/sonic-platform-modules-dell/s6000/scripts/s6000_platform.sh b/platform/broadcom/sonic-platform-modules-dell/s6000/scripts/s6000_platform.sh index a98df43ef27b..862667ba619e 100755 --- a/platform/broadcom/sonic-platform-modules-dell/s6000/scripts/s6000_platform.sh +++ b/platform/broadcom/sonic-platform-modules-dell/s6000/scripts/s6000_platform.sh @@ -97,6 +97,10 @@ remove_python_api_package() { # read SONiC immutable variables [ -f /etc/sonic/sonic-environment ] && . /etc/sonic/sonic-environment +if [ ! -e /etc/sonic/sfp_lock ]; then + touch /etc/sonic/sfp_lock +fi + if [[ "$1" == "init" ]]; then depmod -a modprobe nvram diff --git a/platform/broadcom/sonic-platform-modules-dell/s6000/sonic_platform/chassis.py b/platform/broadcom/sonic-platform-modules-dell/s6000/sonic_platform/chassis.py index 899754709bcc..08c128d678bc 100755 --- a/platform/broadcom/sonic-platform-modules-dell/s6000/sonic_platform/chassis.py +++ b/platform/broadcom/sonic-platform-modules-dell/s6000/sonic_platform/chassis.py @@ -24,7 +24,7 @@ MAX_S6000_FANTRAY = 3 MAX_S6000_PSU = 2 -MAX_S6000_THERMAL = 10 +MAX_S6000_THERMAL = 6 MAX_S6000_COMPONENT = 4 @@ -44,6 +44,8 @@ class Chassis(ChassisBase): def __init__(self): ChassisBase.__init__(self) + self.status_led_reg = "system_led" + self.supported_led_color = ['green', 'blinking green', 'amber', 'blinking amber'] # Initialize SFP list self.PORT_START = 0 self.PORT_END = 31 @@ -101,13 +103,30 @@ def _get_cpld_register(self, reg_name): try: with open(mb_reg_file, 'r') as fd: rv = fd.read() - except Exception as error: + except IOError: rv = 'ERR' rv = rv.rstrip('\r\n') rv = rv.lstrip(" ") return rv + def _set_cpld_register(self, reg_name, value): + # On successful write, returns the value will be written on + # reg_name and on failure returns 'ERR' + rv = 'ERR' + cpld_reg_file = self.CPLD_DIR+'/'+reg_name + + if (not os.path.isfile(cpld_reg_file)): + return rv + + try: + with open(cpld_reg_file, 'w') as fd: + rv = fd.write(str(value)) + except IOError: + rv = 'ERR' + + return rv + def _nvram_write(self, offset, val): resource = "/dev/nvram" fd = os.open(resource, os.O_RDWR) @@ -179,6 +198,23 @@ def get_status(self): """ return True + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device. + Returns: + integer: The 1-based relative physical position in parent + device or -1 if cannot determine the position + """ + return -1 + + def is_replaceable(self): + """ + Indicate whether Chassis is replaceable. + Returns: + bool: True if it is replaceable. + """ + return False + def get_base_mac(self): """ Retrieves the base MAC address for the chassis @@ -305,4 +341,44 @@ def get_change_event(self, timeout=0): return True, ret_dict return False, ret_dict + def initizalize_system_led(self): + return True + + def set_status_led(self, color): + """ + Sets the state of the system LED + + Args: + color: A string representing the color with which to set the + system LED + + Returns: + bool: True if system LED state is set successfully, False if not + """ + if color not in self.supported_led_color: + return False + # Change color string format to the one used by driver + color = color.replace('amber', 'yellow') + color = color.replace('blinking ', 'blink_') + rv = self._set_cpld_register(self.status_led_reg, color) + if (rv != 'ERR'): + return True + else: + return False + + def get_status_led(self): + """ + Gets the state of the system LED + + Returns: + A string, one of the valid LED color strings which could be vendor + specified. + """ + status_led = self._get_cpld_register(self.status_led_reg) + if (status_led != 'ERR'): + status_led = status_led.replace('yellow', 'amber') + status_led = status_led.replace('blink_', 'blinking ') + return status_led + else: + return None diff --git a/platform/broadcom/sonic-platform-modules-dell/s6000/sonic_platform/component.py b/platform/broadcom/sonic-platform-modules-dell/s6000/sonic_platform/component.py index 1e21c233f5d8..92ae95fae4f6 100644 --- a/platform/broadcom/sonic-platform-modules-dell/s6000/sonic_platform/component.py +++ b/platform/broadcom/sonic-platform-modules-dell/s6000/sonic_platform/component.py @@ -29,11 +29,12 @@ class Component(ComponentBase): "booting")], ["System-CPLD", "Used for managing CPU board devices and power"], ["Master-CPLD", ("Used for managing Fan, PSU, system LEDs, QSFP " - "modules (1-16)")], - ["Slave-CPLD", "Used for managing QSFP modules (17-32)"] + "modules (17-32)")], + ["Slave-CPLD", "Used for managing QSFP modules (1-16)"] ] def __init__(self, component_index): + ComponentBase.__init__(self) self.index = component_index self.name = self.CHASSIS_COMPONENTS[self.index][0] self.description = self.CHASSIS_COMPONENTS[self.index][1] @@ -90,6 +91,55 @@ def get_name(self): """ return self.name + def get_model(self): + """ + Retrieves the part number of the component + Returns: + string: Part number of component + """ + return 'NA' + + def get_serial(self): + """ + Retrieves the serial number of the component + Returns: + string: Serial number of component + """ + return 'NA' + + def get_presence(self): + """ + Retrieves the presence of the component + Returns: + bool: True if present, False if not + """ + return True + + def get_status(self): + """ + Retrieves the operational status of the component + Returns: + bool: True if component is operating properly, False if not + """ + return True + + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device. + Returns: + integer: The 1-based relative physical position in parent + device or -1 if cannot determine the position + """ + return -1 + + def is_replaceable(self): + """ + Indicate whether component is replaceable. + Returns: + bool: True if it is replaceable. + """ + return False + def get_description(self): """ Retrieves the description of the component diff --git a/platform/broadcom/sonic-platform-modules-dell/s6000/sonic_platform/eeprom.py b/platform/broadcom/sonic-platform-modules-dell/s6000/sonic_platform/eeprom.py index ef736089c44b..5afe0112441b 100644 --- a/platform/broadcom/sonic-platform-modules-dell/s6000/sonic_platform/eeprom.py +++ b/platform/broadcom/sonic-platform-modules-dell/s6000/sonic_platform/eeprom.py @@ -36,8 +36,8 @@ ('Fab Rev', 's', 2) ] -# Fan eeprom fields in format required by EepromDecoder -fan_eeprom_format = [ +# FanTray eeprom fields in format required by EepromDecoder +fantray_eeprom_format = [ ('PPID', 's', 20), ('DPN Rev', 's', 3), ('Service Tag', 's', 7), ('Part Number', 's', 10), ('Part Num Revision', 's', 3), ('Mfg Test', 's', 2), ('Redundant copy', 's', 83), @@ -51,10 +51,10 @@ class Eeprom(TlvInfoDecoder): I2C_DIR = "/sys/class/i2c-adapter/" - def __init__(self, is_psu=False, psu_index=0, is_fan=False, fan_index=0): + def __init__(self, is_psu=False, psu_index=0, is_fantray=False, fantray_index=0): self.is_psu_eeprom = is_psu - self.is_fan_eeprom = is_fan - self.is_sys_eeprom = not (is_psu | is_fan) + self.is_fantray_eeprom = is_fantray + self.is_sys_eeprom = not (is_psu | is_fantray) if self.is_sys_eeprom: self.start_offset = 0 @@ -71,10 +71,10 @@ def __init__(self, is_psu=False, psu_index=0, is_fan=False, fan_index=0): + "i2c-1/1-005{}/eeprom".format(2 - self.index) self.format = psu_eeprom_format else: - self.index = fan_index + self.index = fantray_index self.eeprom_path = self.I2C_DIR \ + "i2c-11/11-005{}/eeprom".format(4 - self.index) - self.format = fan_eeprom_format + self.format = fantray_eeprom_format EepromDecoder.__init__(self, self.eeprom_path, self.format, self.start_offset, '', True) self._load_device_eeprom() diff --git a/platform/broadcom/sonic-platform-modules-dell/s6000/sonic_platform/fan.py b/platform/broadcom/sonic-platform-modules-dell/s6000/sonic_platform/fan.py index fbdbf650db73..940c70cebede 100644 --- a/platform/broadcom/sonic-platform-modules-dell/s6000/sonic_platform/fan.py +++ b/platform/broadcom/sonic-platform-modules-dell/s6000/sonic_platform/fan.py @@ -13,7 +13,6 @@ import os import glob from sonic_platform_base.fan_base import FanBase - from sonic_platform.eeprom import Eeprom except ImportError as e: raise ImportError(str(e) + "- required module not found") @@ -25,33 +24,38 @@ class Fan(FanBase): """DellEMC Platform-specific Fan class""" - CPLD_DIR = "/sys/devices/platform/dell-s6000-cpld.0/" I2C_DIR = "/sys/class/i2c-adapter/" - - def __init__(self, fan_index, psu_fan=False, dependency=None): + FAN_DEV_MAPPING = { + 1: {1: ("i2c-11/11-002a", 1), 2: ("i2c-11/11-002a", 2)}, + 2: {1: ("i2c-11/11-0029", 3), 2: ("i2c-11/11-0029", 4)}, + 3: {1: ("i2c-11/11-0029", 1), 2: ("i2c-11/11-0029", 2)} + } + + def __init__(self, fantray_index=1, fan_index=1, + psu_index=1, psu_fan=False, dependency=None): + FanBase.__init__(self) self.is_psu_fan = psu_fan self.is_driver_initialized = True if not self.is_psu_fan: # Fan is 1-based in DellEMC platforms - self.index = fan_index + 1 - self.fan_presence_reg = "fan_prs" - self.fan_led_reg = "fan{}_led".format(fan_index) - self.get_fan_speed_reg = self.I2C_DIR + "i2c-11/11-0029/" +\ - "fan{}_input".format(self.index) - self.set_fan_speed_reg = self.I2C_DIR + "i2c-11/11-0029/" +\ - "fan{}_target".format(self.index) - self.eeprom = Eeprom(is_fan=True, fan_index=self.index) + self.fantray_index = fantray_index + self.index = fan_index + self.dependency = dependency + self.get_fan_speed_reg = self.I2C_DIR +\ + "{}/fan{}_input".format(*self.FAN_DEV_MAPPING[fantray_index][fan_index]) + self.set_fan_speed_reg = self.I2C_DIR +\ + "{}/fan{}_target".format(*self.FAN_DEV_MAPPING[fantray_index][fan_index]) self.max_fan_speed = MAX_S6000_FAN_SPEED - self.supported_led_color = ['off', 'green', 'amber'] else: - self.index = fan_index + self.psu_index = psu_index + self.index = 1 self.dependency = dependency self.set_fan_speed_reg = self.I2C_DIR +\ - "i2c-1/1-005{}/fan1_target".format(10 - self.index) + "i2c-1/1-005{}/fan1_target".format(10 - self.psu_index) hwmon_dir = self.I2C_DIR +\ - "i2c-1/1-005{}/hwmon/".format(10 - self.index) + "i2c-1/1-005{}/hwmon/".format(10 - self.psu_index) try: hwmon_node = os.listdir(hwmon_dir)[0] except OSError: @@ -61,43 +65,6 @@ def __init__(self, fan_index, psu_fan=False, dependency=None): self.get_fan_speed_reg = hwmon_dir + hwmon_node + '/fan1_input' self.max_fan_speed = MAX_S6000_PSU_FAN_SPEED - def _get_cpld_register(self, reg_name): - # On successful read, returns the value read from given - # reg_name and on failure returns 'ERR' - rv = 'ERR' - cpld_reg_file = self.CPLD_DIR + reg_name - - if (not os.path.isfile(cpld_reg_file)): - return rv - - try: - with open(cpld_reg_file, 'r') as fd: - rv = fd.read() - except: - rv = 'ERR' - - rv = rv.rstrip('\r\n') - rv = rv.lstrip(" ") - return rv - - def _set_cpld_register(self, reg_name, value): - # On successful write, returns the value will be written on - # reg_name and on failure returns 'ERR' - rv = 'ERR' - cpld_reg_file = self.CPLD_DIR + reg_name - - if (not os.path.isfile(cpld_reg_file)): - print("open error") - return rv - - try: - with open(cpld_reg_file, 'w') as fd: - rv = fd.write(str(value)) - except: - rv = 'ERR' - - return rv - def _get_i2c_register(self, reg_file): # On successful read, returns the value read from given # reg_name and on failure returns 'ERR' @@ -155,9 +122,9 @@ def get_name(self): string: The name of the Fan """ if not self.is_psu_fan: - return "FanTray{}-Fan1".format(self.index) + return "FanTray{}-Fan{}".format(self.fantray_index, self.index) else: - return "PSU{} Fan".format(self.index) + return "PSU{} Fan".format(self.psu_index) def get_presence(self): """ @@ -166,42 +133,23 @@ def get_presence(self): Returns: bool: True if Fan is present, False if not """ - status = False - if self.is_psu_fan: - return self.dependency.get_presence() - - fan_presence = self._get_cpld_register(self.fan_presence_reg) - if (fan_presence != 'ERR'): - fan_presence = int(fan_presence,16) & self.index - if fan_presence: - status = True - - return status + return self.dependency.get_presence() def get_model(self): """ Retrieves the part number of the Fan - Returns: string: Part number of Fan """ - if not self.is_psu_fan: - return self.eeprom.get_part_number() - else: - return 'NA' + return 'NA' def get_serial(self): """ Retrieves the serial number of the Fan - Returns: string: Serial number of Fan """ - # Sample Serial number format "US-01234D-54321-25A-0123-A00" - if not self.is_psu_fan: - return self.eeprom.get_serial_number() - else: - return 'NA' + return 'NA' def get_status(self): """ @@ -218,6 +166,23 @@ def get_status(self): return status + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device. + Returns: + integer: The 1-based relative physical position in parent + device or -1 if cannot determine the position + """ + return self.index + + def is_replaceable(self): + """ + Indicate whether Fan is replaceable. + Returns: + bool: True if it is replaceable. + """ + return False + def get_direction(self): """ Retrieves the fan airflow direction @@ -234,11 +199,10 @@ def get_direction(self): if self.is_psu_fan: direction = {1: self.FAN_DIRECTION_EXHAUST, 2: self.FAN_DIRECTION_INTAKE, 3: self.FAN_DIRECTION_EXHAUST, 4: self.FAN_DIRECTION_INTAKE} - fan_direction = self.dependency.eeprom.airflow_fan_type() else: direction = {1: self.FAN_DIRECTION_EXHAUST, 2: self.FAN_DIRECTION_INTAKE} - fan_direction = self.eeprom.airflow_fan_type() + fan_direction = self.dependency.eeprom.airflow_fan_type() return direction.get(fan_direction, self.FAN_DIRECTION_NOT_APPLICABLE) def get_speed(self): @@ -282,8 +246,8 @@ def set_speed(self, speed): Returns: bool: True if set success, False if fail. """ - fan_set = (speed * self.max_fan_speed)/ 100 - rv = self._set_i2c_register(self.set_fan_speed_reg , fan_set) + fan_set = (speed * self.max_fan_speed) // 100 + rv = self._set_i2c_register(self.set_fan_speed_reg, fan_set) if (rv != 'ERR'): return True else: @@ -298,16 +262,9 @@ def set_status_led(self, color): Returns: bool: True if set success, False if fail. """ - if self.is_psu_fan or (color not in self.supported_led_color): - return False - if(color == self.STATUS_LED_COLOR_AMBER): - color = 'yellow' - - rv = self._set_cpld_register(self.fan_led_reg ,color) - if (rv != 'ERR'): - return True - else: - return False + # No LED available for FanTray and PSU Fan + # Return True to avoid thermalctld alarm. + return True def get_status_led(self): """ @@ -316,18 +273,8 @@ def get_status_led(self): Returns: A string, one of the predefined STATUS_LED_COLOR_* strings. """ - if self.is_psu_fan: - # No LED available for PSU Fan - return None - - fan_led = self._get_cpld_register(self.fan_led_reg) - if (fan_led != 'ERR'): - if (fan_led == 'yellow'): - return self.STATUS_LED_COLOR_AMBER - else: - return fan_led - else: - return self.STATUS_LED_COLOR_OFF + # No LED available for FanTray and PSU Fan + return None def get_target_speed(self): """ diff --git a/platform/broadcom/sonic-platform-modules-dell/s6000/sonic_platform/fan_drawer.py b/platform/broadcom/sonic-platform-modules-dell/s6000/sonic_platform/fan_drawer.py index c8ea283e5ba4..2e5e3446cd80 100644 --- a/platform/broadcom/sonic-platform-modules-dell/s6000/sonic_platform/fan_drawer.py +++ b/platform/broadcom/sonic-platform-modules-dell/s6000/sonic_platform/fan_drawer.py @@ -9,26 +9,176 @@ ######################################################################## try: + import os + from sonic_platform_base.fan_drawer_base import FanDrawerBase + from sonic_platform.eeprom import Eeprom from sonic_platform.fan import Fan except ImportError as e: raise ImportError(str(e) + "- required module not found") +MAX_S6000_FANS_PER_FANTRAY = 2 + class FanDrawer(FanDrawerBase): - """DellEMC Platform-specific Fan class""" + """DellEMC Platform-specific Fan Drawer class""" - def __init__(self, fantray_index): + CPLD_DIR = "/sys/devices/platform/dell-s6000-cpld.0/" + def __init__(self, fantray_index): FanDrawerBase.__init__(self) # FanTray is 1-based in DellEMC platforms - self.fantrayindex = fantray_index + 1 - self._fan_list.append(Fan(fantray_index)) + self.index = fantray_index + 1 + self.eeprom = Eeprom(is_fantray=True, fantray_index=self.index) + self.fantray_presence_reg = "fan_prs" + self.fantray_led_reg = "fan{}_led".format(self.index - 1) + self.supported_led_color = ['off', 'green', 'amber'] + + for i in range(1, MAX_S6000_FANS_PER_FANTRAY+1): + self._fan_list.append(Fan(fantray_index=self.index, fan_index=i, dependency=self)) + + def _get_cpld_register(self, reg_name): + # On successful read, returns the value read from given + # reg_name and on failure returns 'ERR' + rv = 'ERR' + cpld_reg_file = self.CPLD_DIR + reg_name + + if (not os.path.isfile(cpld_reg_file)): + return rv + + try: + with open(cpld_reg_file, 'r') as fd: + rv = fd.read() + except IOError: + rv = 'ERR' + + rv = rv.rstrip('\r\n') + rv = rv.lstrip(" ") + return rv + + def _set_cpld_register(self, reg_name, value): + # On successful write, returns the value will be written on + # reg_name and on failure returns 'ERR' + rv = 'ERR' + cpld_reg_file = self.CPLD_DIR + reg_name + + if (not os.path.isfile(cpld_reg_file)): + return rv + + try: + with open(cpld_reg_file, 'w') as fd: + rv = fd.write(str(value)) + except IOError: + rv = 'ERR' + + return rv def get_name(self): """ - Retrieves the fan drawer name + Retrieves the Fandrawer name Returns: string: The name of the device """ - return "FanTray{}".format(self.fantrayindex) + return "FanTray{}".format(self.index) + + def get_presence(self): + """ + Retrieves the presence of the Fandrawer + + Returns: + bool: True if Fandrawer is present, False if not + """ + presence = False + + fantray_presence = self._get_cpld_register(self.fantray_presence_reg) + if (fantray_presence != 'ERR'): + fantray_presence = int(fantray_presence, 16) & (1 << (self.index - 1)) + if fantray_presence: + presence = True + + return presence + + def get_model(self): + """ + Retrieves the part number of the Fandrawer + + Returns: + string: Part number of Fandrawer + """ + return self.eeprom.get_part_number() + + def get_serial(self): + """ + Retrieves the serial number of the Fandrawer + + Returns: + string: Serial number of Fandrawer + """ + # Sample Serial number format "US-01234D-54321-25A-0123-A00" + return self.eeprom.get_serial_number() + + def get_status(self): + """ + Retrieves the operational status of the Fandrawer + + Returns: + bool: True if Fandrawer is operating properly, False if not + """ + status = True + for fan in self.get_all_fans(): + status &= fan.get_status() + + return status + + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device. + Returns: + integer: The 1-based relative physical position in parent + device or -1 if cannot determine the position + """ + return self.index + + def is_replaceable(self): + """ + Indicate whether this fan drawer is replaceable. + Returns: + bool: True if it is replaceable. + """ + return True + + def set_status_led(self, color): + """ + Set led to expected color + Args: + color: A string representing the color with which to set the + fandrawer status LED + Returns: + bool: True if set success, False if fail. + """ + if color not in self.supported_led_color: + return False + if color == self.STATUS_LED_COLOR_AMBER: + color = 'yellow' + + rv = self._set_cpld_register(self.fantray_led_reg, color) + if (rv != 'ERR'): + return True + else: + return False + + def get_status_led(self): + """ + Gets the state of the fandrawer status LED + + Returns: + A string, one of the predefined STATUS_LED_COLOR_* strings. + """ + fantray_led = self._get_cpld_register(self.fantray_led_reg) + if (fantray_led != 'ERR'): + if (fantray_led == 'yellow'): + return self.STATUS_LED_COLOR_AMBER + else: + return fantray_led + else: + return self.STATUS_LED_COLOR_OFF diff --git a/platform/broadcom/sonic-platform-modules-dell/s6000/sonic_platform/psu.py b/platform/broadcom/sonic-platform-modules-dell/s6000/sonic_platform/psu.py index af52ccedbc44..e217c0a08c40 100644 --- a/platform/broadcom/sonic-platform-modules-dell/s6000/sonic_platform/psu.py +++ b/platform/broadcom/sonic-platform-modules-dell/s6000/sonic_platform/psu.py @@ -15,9 +15,12 @@ from sonic_platform_base.psu_base import PsuBase from sonic_platform.eeprom import Eeprom from sonic_platform.fan import Fan + from sonic_platform.thermal import Thermal except ImportError as e: raise ImportError(str(e) + "- required module not found") +MAX_S6000_THERMALS_PER_PSU = 2 + class Psu(PsuBase): """DellEMC Platform-specific PSU class""" @@ -53,7 +56,10 @@ def __init__(self, psu_index): self.eeprom = Eeprom(is_psu=True, psu_index=self.index) - self._fan_list.append(Fan(self.index, psu_fan=True, dependency=self)) + self._fan_list.append(Fan(psu_index=self.index, psu_fan=True, dependency=self)) + for i in range(1, MAX_S6000_THERMALS_PER_PSU+1): + self._thermal_list.append(Thermal(psu_index=self.index, thermal_index=i, + psu_thermal=True, dependency=self)) def _get_cpld_register(self, reg_name): # On successful read, returns the value read from given @@ -171,6 +177,23 @@ def get_status(self): return status + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device. + Returns: + integer: The 1-based relative physical position in parent + device or -1 if cannot determine the position + """ + return self.index + + def is_replaceable(self): + """ + Indicate whether PSU is replaceable. + Returns: + bool: True if it is replaceable. + """ + return True + def get_voltage(self): """ Retrieves current PSU voltage output @@ -266,3 +289,50 @@ def set_status_led(self, color): # In S6000, the firmware running in the PSU controls the LED # and the PSU LED state cannot be changed from CPU. return False + + def get_temperature(self): + """ + Retrieves current temperature reading from PSU + + Returns: + A float number of current temperature in Celsius up to + nearest thousandth of one degree Celsius, e.g. 30.125 + """ + if self.get_presence(): + return self.get_thermal(0).get_temperature() + else: + return 0.0 + + def get_temperature_high_threshold(self): + """ + Retrieves the high threshold temperature of PSU + + Returns: + A float number, the high threshold temperature of PSU in + Celsius up to nearest thousandth of one degree Celsius, + e.g. 30.125 + """ + if self.get_presence(): + return self.get_thermal(0).get_high_threshold() + else: + return 0.0 + + def get_voltage_high_threshold(self): + """ + Retrieves the high threshold PSU voltage output + + Returns: + A float number, the high threshold output voltage in volts, + e.g. 12.1 + """ + return 12.6 + + def get_voltage_low_threshold(self): + """ + Retrieves the low threshold PSU voltage output + + Returns: + A float number, the low threshold output voltage in volts, + e.g. 12.1 + """ + return 11.4 diff --git a/platform/broadcom/sonic-platform-modules-dell/s6000/sonic_platform/sfp.py b/platform/broadcom/sonic-platform-modules-dell/s6000/sonic_platform/sfp.py index 175e601dbe76..56b8287302a3 100644 --- a/platform/broadcom/sonic-platform-modules-dell/s6000/sonic_platform/sfp.py +++ b/platform/broadcom/sonic-platform-modules-dell/s6000/sonic_platform/sfp.py @@ -10,7 +10,9 @@ try: import re + import struct import time + import fcntl from sonic_platform_base.sfp_base import SfpBase from sonic_platform_base.sonic_sfp.sff8436 import sff8436InterfaceId from sonic_platform_base.sonic_sfp.sff8436 import sff8436Dom @@ -27,6 +29,9 @@ DOM_OFFSET = 0 DOM_OFFSET1 = 384 +QSFP_CONTROL_OFFSET = 86 +QSFP_POWEROVERRIDE_OFFSET = 93 + cable_length_tup = ('Length(km)', 'Length OM3(2m)', 'Length OM2(m)', 'Length OM1(m)', 'Length Cable Assembly(m)') @@ -108,7 +113,7 @@ def __init__(self, index, sfp_type, eeprom_path, sfp_control, sfp_ctrl_idx): SfpBase.__init__(self) self.sfp_type = sfp_type - self.index = index + self.index = index + 1 self.eeprom_path = eeprom_path self.sfp_control = sfp_control self.sfp_ctrl_idx = sfp_ctrl_idx @@ -132,9 +137,10 @@ def _read_eeprom_bytes(self, eeprom_path, offset, num_bytes): eeprom.close() return None + raw = bytearray(raw) try: for n in range(0, num_bytes): - eeprom_raw[n] = hex(ord(raw[n]))[2:].zfill(2) + eeprom_raw[n] = hex(raw[n])[2:].zfill(2) except BaseException: eeprom.close() return None @@ -149,6 +155,15 @@ def _get_eeprom_data(self, eeprom_key): if (self.sfpInfo is None): return None + SFP_LOCK_FILE="/etc/sonic/sfp_lock" + try: + fd = open(SFP_LOCK_FILE, "r") + except IOError as e: + print("Error: unable to open file: %s" % str(e)) + return None + fcntl.flock(fd, fcntl.LOCK_EX) + self.set_modsel() + page_offset = sff8436_parser[eeprom_key][PAGE_OFFSET] eeprom_data_raw = self._read_eeprom_bytes( self.eeprom_path, @@ -167,6 +182,7 @@ def _get_eeprom_data(self, eeprom_key): self.sfpDomInfo, sff8436_parser[eeprom_key][FUNC_NAME])( eeprom_data_raw, 0) + fcntl.flock(fd, fcntl.LOCK_UN) return eeprom_data def _strip_unit_from_str(self, value_str): @@ -418,6 +434,16 @@ def get_presence(self): Retrieves the presence of the sfp """ presence_ctrl = self.sfp_control + 'qsfp_modprs' + SFP_LOCK_FILE="/etc/sonic/sfp_lock" + + try: + fd = open(SFP_LOCK_FILE, "r") + except IOError as e: + print("Error: unable to open file: %s" % str(e)) + return False + fcntl.flock(fd, fcntl.LOCK_EX) + self.set_modsel() + try: reg_file = open(presence_ctrl) except IOError as e: @@ -432,12 +458,69 @@ def get_presence(self): # Mask off the bit corresponding to our port mask = (1 << self.sfp_ctrl_idx) + fcntl.flock(fd, fcntl.LOCK_UN) + # ModPrsL is active low if ((reg_value & mask) == 0): return True return False + def get_modsel(self): + modsel_ctrl = self.sfp_control + 'qsfp_modsel' + try: + reg_file = open(modsel_ctrl, "r+") + except IOError as e: + return False + + reg_hex = reg_file.readline().rstrip() + + # content is a string containing the hex + # representation of the register + reg_value = int(reg_hex, 16) + + # Mask off the bit corresponding to our port + index = self.sfp_ctrl_idx + + mask = (1 << index) + + if ((reg_value & mask) == 1): + modsel_state = False + else: + modsel_state = True + + return modsel_state + + def set_modsel(self): + modsel_ctrl = self.sfp_control + 'qsfp_modsel' + try: + reg_file = open(modsel_ctrl, "r+") + except IOError as e: + return False + + reg_hex = reg_file.readline().rstrip() + + # content is a string containing the hex + # representation of the register + reg_value = int(reg_hex, 16) + + # Mask off the bit corresponding to our port + index = self.sfp_ctrl_idx + + reg_value = reg_value | int("0xffffffff", 16) + mask = (1 << index) + + reg_value = (reg_value & ~mask) + + # Convert our register value back to a hex string and write back + content = hex(reg_value) + + reg_file.seek(0) + reg_file.write(content) + reg_file.close() + + return True + def get_model(self): """ Retrieves the model number (or part number) of the sfp @@ -588,40 +671,14 @@ def get_tx_disable_channel(self): """ Retrieves the TX disabled channels in this SFP """ - tx_disable = None - tx_disable_list = [] - - tx_disable_data = self._get_eeprom_data('tx_disable') - if (tx_disable_data is not None): - tx_disable = tx_disable_data['data']['Tx1Disable']['value'] - if (tx_disable == 'On'): - tx_disable_list.append(1) - else: - tx_disable_list.append(0) - tx_disable = tx_disable_data['data']['Tx2Disable']['value'] - if (tx_disable == 'On'): - tx_disable_list.append(1) - else: - tx_disable_list.append(0) - tx_disable = tx_disable_data['data']['Tx3Disable']['value'] - if (tx_disable == 'On'): - tx_disable_list.append(1) - else: - tx_disable_list.append(0) - tx_disable = tx_disable_data['data']['Tx4Disable']['value'] - if (tx_disable == 'On'): - tx_disable_list.append(1) - else: - tx_disable_list.append(0) - - bit4 = int(tx_disable_list[3]) * 8 - bit3 = int(tx_disable_list[2]) * 4 - bit2 = int(tx_disable_list[1]) * 2 - bit1 = int(tx_disable_list[0]) * 1 + tx_disable_channel = 0 - tx_disable_channel = hex(bit4 + bit3 + bit2 + bit1) + tx_disable = self.get_tx_disable() + for channel, disable in enumerate(tx_disable): + if disable: + tx_disable_channel |= 1 << channel - return tx_disable_channel + return tx_disable_channel def get_lpmode(self): """ @@ -722,7 +779,6 @@ def get_rx_power(self): return rx_power_list - def get_tx_power(self): """ Retrieves the TX power of this SFP @@ -822,19 +878,68 @@ def tx_disable(self, tx_disable): """ Disable SFP TX for all channels """ - return False + eeprom = None + tx_disable_value = 0xf if tx_disable else 0x0 + + try: + eeprom = open(self.eeprom_path, "r+b") + eeprom.seek(QSFP_CONTROL_OFFSET) + eeprom.write(struct.pack('B', tx_disable_value)) + except IOError: + return False + finally: + if eeprom is not None: + eeprom.close() + time.sleep(0.01) + + return True def tx_disable_channel(self, channel, disable): """ Sets the tx_disable for specified SFP channels """ - return False + eeprom = None + current_state = self.get_tx_disable_channel() + + if disable: + tx_disable_value = current_state | channel + else: + tx_disable_value = current_state & (~channel) + + try: + eeprom = open(self.eeprom_path, "r+b") + eeprom.seek(QSFP_CONTROL_OFFSET) + eeprom.write(struct.pack('B', tx_disable_value)) + except IOError: + return False + finally: + if eeprom is not None: + eeprom.close() + time.sleep(0.01) + + return True def set_power_override(self, power_override, power_set): """ Sets SFP power level using power_override and power_set """ - return False + eeprom = None + power_override_bit = 0x1 if power_override else 0 + power_set_bit = 0x2 if power_set else 0 + value = power_override_bit | power_set_bit + + try: + eeprom = open(self.eeprom_path, "r+b") + eeprom.seek(QSFP_POWEROVERRIDE_OFFSET) + eeprom.write(struct.pack('B', value)) + except IOError: + return False + finally: + if eeprom is not None: + eeprom.close() + time.sleep(0.01) + + return True def get_status(self): """ @@ -848,3 +953,20 @@ def get_status(self): status = True return status + + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device. + Returns: + integer: The 1-based relative physical position in parent + device or -1 if cannot determine the position + """ + return self.index + + def is_replaceable(self): + """ + Indicate whether this device is replaceable. + Returns: + bool: True if it is replaceable. + """ + return True diff --git a/platform/broadcom/sonic-platform-modules-dell/s6000/sonic_platform/thermal.py b/platform/broadcom/sonic-platform-modules-dell/s6000/sonic_platform/thermal.py index 2f130ebabbb3..bfb1385a9f05 100644 --- a/platform/broadcom/sonic-platform-modules-dell/s6000/sonic_platform/thermal.py +++ b/platform/broadcom/sonic-platform-modules-dell/s6000/sonic_platform/thermal.py @@ -13,7 +13,6 @@ import os import glob from sonic_platform_base.thermal_base import ThermalBase - from sonic_platform.psu import Psu except ImportError as e: raise ImportError(str(e) + "- required module not found") @@ -34,11 +33,21 @@ class Thermal(ThermalBase): 'PSU1-Sensor 1', 'PSU1-Sensor 2', 'PSU2-Sensor 1', 'PSU2-Sensor 2', 'CPU Core 0', 'CPU Core 1') - def __init__(self, thermal_index): - self.index = thermal_index + 1 - self.is_psu_thermal = False + def __init__(self, thermal_index, + psu_index=1, psu_thermal=False, dependency=None): + ThermalBase.__init__(self) + self.is_psu_thermal = psu_thermal + self.dependency = dependency self.is_driver_initialized = True - self.dependency = None + + if self.is_psu_thermal: + self.index = (2 * psu_index) + thermal_index + 2 + else: + # CPU thermal + if thermal_index > 3: + self.index = thermal_index + 5 + else: + self.index = thermal_index + 1 if self.index < 9: i2c_path = self.I2C_DIR + self.I2C_DEV_MAPPING[self.index - 1][0] @@ -54,10 +63,6 @@ def __init__(self, thermal_index): if self.index == 4: hwmon_temp_suffix = "crit" - - if self.index > 4: - self.is_psu_thermal = True - self.dependency = Psu(self.index / 7) else: dev_path = "/sys/devices/platform/coretemp.0/hwmon/" hwmon_temp_index = self.index - 7 @@ -168,6 +173,23 @@ def get_status(self): else: return True + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device. + Returns: + integer: The 1-based relative physical position in parent + device or -1 if cannot determine the position + """ + return self.index + + def is_replaceable(self): + """ + Indicate whether Thermal is replaceable. + Returns: + bool: True if it is replaceable. + """ + return False + def get_temperature(self): """ Retrieves current temperature reading from thermal diff --git a/platform/broadcom/sonic-platform-modules-dell/s6000/systemd/platform-modules-s6000.service b/platform/broadcom/sonic-platform-modules-dell/s6000/systemd/platform-modules-s6000.service index b55a466890bd..22de50ca929e 100644 --- a/platform/broadcom/sonic-platform-modules-dell/s6000/systemd/platform-modules-s6000.service +++ b/platform/broadcom/sonic-platform-modules-dell/s6000/systemd/platform-modules-s6000.service @@ -1,7 +1,7 @@ [Unit] Description=Dell S6000 Platform modules After=local-fs.target -Before=pmon.service +Before=pmon.service determine-reboot-cause.service [Service] Type=oneshot diff --git a/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/check-getty.sh b/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/check-getty.sh new file mode 100755 index 000000000000..9c6412eddf0b --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/check-getty.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +RETRY=0 +while [ $RETRY -lt 5 ]; do + let RETRY=$RETRY+1 + + /bin/systemctl --quiet is-active serial-getty@ttyS1.service + status=$? + if [ $status == 0 ]; then + exit 0 + fi + + # when serial-getty not running, recheck later, beause systemd will restart serial-getty automatically. + sleep 1 +done + +exit 1 \ No newline at end of file diff --git a/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/fast-reboot_plugin b/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/fast-reboot_plugin index e32747c7fed5..d8e839e5be74 100755 --- a/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/fast-reboot_plugin +++ b/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/fast-reboot_plugin @@ -4,4 +4,4 @@ if [[ -d /sys/devices/platform/SMF.512/hwmon/ ]]; then cd /sys/devices/platform/SMF.512/hwmon/* echo 0xcc > mb_poweron_reason fi -/usr/local/bin/s6100_i2c_enumeration.sh deinit & > /dev/null +/usr/local/bin/s6100_platform_startup.sh deinit & > /dev/null diff --git a/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/iSMART_64 b/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/iSMART_64 new file mode 100755 index 000000000000..e485a6ee104e Binary files /dev/null and b/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/iSMART_64 differ diff --git a/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/platform_reboot_pre_check b/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/platform_reboot_pre_check new file mode 100755 index 000000000000..d7eac17862f6 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/platform_reboot_pre_check @@ -0,0 +1,38 @@ +#!/bin/bash +SSD_FW_UPGRADE="/host/ssd_fw_upgrade" + +_error_msg(){ + echo "The SSD on this unit is $1. Do not power-cycle/reboot this unit." + echo "soft-/fast-/warm-reboot is allowed." + logger -p user.crit -t DELL_S6100_SSD_MON "The SSD on this unit is $1. Do not power-cycle/reboot this unit." + logger -p user.crit -t DELL_S6100_SSD_MON "soft-/fast-/warm-reboot is allowed." +} + +# Check SSD Status +if [ -e $SSD_FW_UPGRADE/GPIO7_pending_upgrade ]; then + _error_msg "running older firmware" + exit 1 +fi + +if [ -e $SSD_FW_UPGRADE/GPIO7_low ] || [ -e $SSD_FW_UPGRADE/GPIO7_error ]; then + _error_msg "faulty" + exit 1 +fi + +if [ -e $SSD_FW_UPGRADE/GPIO7_high ]; then + iSMART="/usr/local/bin/iSMART_64" + iSMART_OPTIONS="-d /dev/sda" + + iSMART_CMD=`$iSMART $iSMART_OPTIONS` + + GPIO_STATUS=$(echo "$iSMART_CMD" | grep GPIO | awk '{print $NF}') + + if [ $GPIO_STATUS == "0x01" ];then + exit 0 + else + _error_msg "faulty" + exit 1 + fi +fi + +exit 1 diff --git a/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/s6100_i2c_enumeration.sh b/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/s6100_i2c_enumeration.sh deleted file mode 100755 index d00fec233eaa..000000000000 --- a/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/s6100_i2c_enumeration.sh +++ /dev/null @@ -1,305 +0,0 @@ -#!/bin/bash - -### DellEMC S6100 I2C MUX Enumeration script - -source dell_i2c_utils.sh - -init_devnum() { - found=0 - for devnum in 0 1; do - devname=`cat /sys/bus/i2c/devices/i2c-${devnum}/name` - # iSMT adapter can be at either dffd0000 or dfff0000 - if [[ $devname == 'SMBus iSMT adapter at '* ]]; then - found=1 - break - fi - done - - [[ $found -eq 0 ]] && echo "cannot find iSMT" && exit 1 -} - -# Attach/Detach CPU board mux @ 0x70 -cpu_board_mux() { - case $1 in - "new_device") i2c_mux_create pca9547 0x70 $devnum 2 - ;; - "delete_device") i2c_mux_delete 0x70 $devnum - ;; - *) echo "s6100_platform: cpu_board_mux: invalid command !" - ;; - esac -} - -# Attach/Detach Switchboard MUX @ 0x71 -switch_board_mux() { - case $1 in - "new_device") i2c_mux_create pca9548 0x71 4 10 - ;; - "delete_device") i2c_mux_delete 0x71 4 - ;; - *) echo "s6100_platform: switch_board_mux : invalid command !" - ;; - esac -} - -# Attach/Detach syseeprom on CPU board -sys_eeprom() { - case $1 in - "new_device") i2c_config "echo 24c02 0x50 > /sys/bus/i2c/devices/i2c-2/$1" - ;; - "delete_device") i2c_config "echo 0x50 > /sys/bus/i2c/devices/i2c-2/$1" - ;; - *) echo "s6100_platform: sys_eeprom : invalid command !" - ;; - esac -} - -#Attach/Detach eeprom on each IOM -switch_board_eeprom() { - case $1 in - "new_device") - for ((i=14;i<=17;i++)); - do - i2c_config "echo 24c02 0x50 > /sys/bus/i2c/devices/i2c-$i/$1" - done - ;; - "delete_device") - for ((i=14;i<=17;i++)); - do - i2c_config "echo 0x50 > /sys/bus/i2c/devices/i2c-$i/$1" - done - ;; - *) echo "s6100_platform: switch_board_eeprom : invalid command !" - ;; - esac -} - -#Attach/Detach CPLD devices to drivers for each IOM -switch_board_cpld() { - case $1 in - "new_device") - for ((i=14;i<=17;i++)); - do - i2c_config "echo dell_s6100_iom_cpld 0x3e > /sys/bus/i2c/devices/i2c-$i/$1" - done - ;; - "delete_device") - for ((i=14;i<=17;i++)); - do - i2c_config "echo 0x3e > /sys/bus/i2c/devices/i2c-$i/$1" - done - ;; - *) echo "s6100_platform: switch_board_cpld : invalid command !" - ;; - esac -} - -#Attach/Detach the MUX connecting all QSFPs on each IOM @0x71 and 0x72 -switch_board_qsfp_mux() { - case $1 in - "new_device") - # The mux for the QSFPs spawn {18..25}, {26..33}... {74..81} - # starting at chennel 18 and 16 channels per IOM. - channel_first=18 - for ((i=9;i>=6;i--)); - do - # 0x71 mux on the IOM 1 - mux_index=$(expr $i - 5) - echo "Attaching PCA9548 $mux_index" - i2c_mux_create pca9548 0x71 $i $channel_first - i2c_mux_create pca9548 0x72 $i $(expr $channel_first + 8) - channel_first=$(expr $channel_first + 16) - done - ;; - "delete_device") - for ((i=9;i>=6;i--)); - do - # 0x71 mux on the IOM 1 - mux_index=$(expr $i - 5) - echo "Detaching PCA9548 $mux_index" - i2c_mux_delete 0x71 $i - i2c_mux_delete 0x72 $i - done - ;; - *) echo "s6100_platform: switch_board_qsfp_mux: invalid command !" - ;; - esac -} - -#Attach/Detach the SFP modules on PCA9548_2 -switch_board_sfp() { - case $1 in - "new_device") i2c_config "echo optoe2 0x50 > /sys/bus/i2c/devices/i2c-11/$1" - i2c_config "echo optoe2 0x50 > /sys/bus/i2c/devices/i2c-12/$1" - ;; - "delete_device") i2c_config "echo 0x50 > /sys/bus/i2c/devices/i2c-11/$1" - i2c_config "echo 0x50 > /sys/bus/i2c/devices/i2c-12/$1" - ;; - *) echo "s6100_platform: switch_board_sfp: invalid command !" - ;; - esac -} - -#Add/Delete ($1) a range ($2..$3) of QSFPs -qsfp_device_mod() { - case $1 in - "new_device") for ((i=$2;i<=$3;i++)); - do - i2c_config "echo optoe1 0x50 > /sys/bus/i2c/devices/i2c-$i/$1" - done - ;; - "delete_device") for ((i=$2;i<=$3;i++)); - do - i2c_config "echo 0x50 > /sys/bus/i2c/devices/i2c-$i/$1" - done - ;; - *) echo "s6100_platform: qsfp_device_mod: invalid command $1:$2,$3!" - ;; - esac -} - -# Attach/Detach 16 instances of QSFP ports on each IO modules -# eeprom can dump data using below command -switch_board_qsfp() { - if i2c_poll_bus_exists "/sys/bus/i2c/devices/i2c-18"; then - qsfp_device_mod $1 18 33 - fi - - if i2c_poll_bus_exists "/sys/bus/i2c/devices/i2c-34"; then - qsfp_device_mod $1 34 49 - fi - - if i2c_poll_bus_exists "/sys/bus/i2c/devices/i2c-50"; then - qsfp_device_mod $1 50 65 - fi - - if i2c_poll_bus_exists "/sys/bus/i2c/devices/i2c-66"; then - qsfp_device_mod $1 66 81 - fi -} - -# Enable/Disable low power mode on all QSFP ports -switch_board_qsfp_lpmode() { - case $1 in - "enable") value=0xffff - ;; - "disable") value=0x0 - ;; - *) echo "s6100_platform: switch_board_qsfp_lpmode: invalid command $1!" - return - ;; - esac - echo $value > /sys/class/i2c-adapter/i2c-14/14-003e/qsfp_lpmode - echo $value > /sys/class/i2c-adapter/i2c-15/15-003e/qsfp_lpmode - echo $value > /sys/class/i2c-adapter/i2c-16/16-003e/qsfp_lpmode - echo $value > /sys/class/i2c-adapter/i2c-17/17-003e/qsfp_lpmode -} - -# Enable/Disable xcvr presence interrupts -xcvr_presence_interrupts() { - case $1 in - "enable") - for ((i=14;i<=17;i++)); - do - echo 0x0 > /sys/class/i2c-adapter/i2c-$i/$i-003e/qsfp_abs_mask - done - ;; - "disable") - for ((i=14;i<=17;i++)); - do - echo 0xffff > /sys/class/i2c-adapter/i2c-$i/$i-003e/qsfp_abs_mask - done - ;; - *) echo "s6100_platform: xcvr_presence_interrupts: invalid command !" - ;; - esac -} - -# Reset the mux tree -reset_muxes() { - local i - - # Reset the IOM muxes (if they have been already instantiated) - for ((i=14;i<=17;i++)); - do - if [[ -e /sys/class/i2c-adapter/i2c-$i/$i-003e ]]; then - echo 0xfc > /sys/class/i2c-adapter/i2c-$i/$i-003e/sep_reset - echo 0xff > /sys/class/i2c-adapter/i2c-$i/$i-003e/sep_reset - fi - done - - # Reset the switch card PCA9548A - io_rd_wr.py --set --val 0xef --offset 0x110 - io_rd_wr.py --set --val 0xff --offset 0x110 - - # Reset the CPU Card PCA9547 - io_rd_wr.py --set --val 0xfd --offset 0x20b - io_rd_wr.py --set --val 0xff --offset 0x20b -} - -init_devnum - -check_iom_status() -{ - SMF_DIR="/sys/devices/platform/SMF.512/hwmon/*" - count=0 - iom_sta=0 - MAX_IOM_STARTUP_DELAY=50 - - if [ -d $SMF_DIR ]; then - iom_status=$(cat $SMF_DIR/iom_status) - cpu_iom1_sta=$(cat $SMF_DIR/cpu_iom1_control) - cpu_iom2_sta=$(cat $SMF_DIR/cpu_iom2_control) - cpu_iom3_sta=$(cat $SMF_DIR/cpu_iom3_control) - cpu_iom4_sta=$(cat $SMF_DIR/cpu_iom4_control) - cpu_iom_sta=$(( cpu_iom1_sta|cpu_iom2_sta|cpu_iom3_sta|cpu_iom4_sta )) - echo "Started polling IOM status" - while [ "$iom_status" != "f0" -o "$cpu_iom_sta" != "0" ]; - do - if [ "$count" -gt "$MAX_IOM_STARTUP_DELAY" ];then - echo "IOM is taking longer than expected to power up.Aborting. - iom_status- $iom_status cpu_iom_sta1- $cpu_iom1_sta cpu_iom_sta2- $cpu_iom2_sta - cpu_iom_sta3- $cpu_iom3_sta cpu_iom_sta4- $cpu_iom4_sta " - iom_sta=1 - break - fi - cpu_iom1_sta=$(cat $SMF_DIR/cpu_iom1_control) - cpu_iom2_sta=$(cat $SMF_DIR/cpu_iom2_control) - cpu_iom3_sta=$(cat $SMF_DIR/cpu_iom3_control) - cpu_iom4_sta=$(cat $SMF_DIR/cpu_iom4_control) - cpu_iom_sta=$(( cpu_iom1_sta|cpu_iom2_sta|cpu_iom3_sta|cpu_iom4_sta )) - iom_status=$(cat $SMF_DIR/iom_status) - sleep .1 - count=`expr $count + 1` - done - - if [ "$iom_sta" != "1" ];then - echo "All IOM's are UP" - fi - fi -} - -if [[ "$1" == "init" ]]; then - cpu_board_mux "new_device" - switch_board_mux "new_device" - sys_eeprom "new_device" - switch_board_eeprom "new_device" - switch_board_cpld "new_device" - check_iom_status - switch_board_qsfp_mux "new_device" - switch_board_sfp "new_device" - switch_board_qsfp "new_device" - switch_board_qsfp_lpmode "disable" - /usr/local/bin/s6100_bitbang_reset.sh - xcvr_presence_interrupts "enable" -elif [[ "$1" == "deinit" ]]; then - xcvr_presence_interrupts "disable" - switch_board_sfp "delete_device" - switch_board_cpld "delete_device" - switch_board_eeprom "delete_device" - switch_board_mux "delete_device" - sys_eeprom "delete_device" - switch_board_qsfp "delete_device" - switch_board_qsfp_mux "delete_device" - cpu_board_mux "delete_device" -fi diff --git a/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/s6100_platform.sh b/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/s6100_platform.sh index 62a8c1a2812f..166a5c63a184 100755 --- a/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/s6100_platform.sh +++ b/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/s6100_platform.sh @@ -2,28 +2,31 @@ #platform init script for Dell S6100 -install_python_api_package() { - device="/usr/share/sonic/device" - platform=$(/usr/local/bin/sonic-cfggen -H -v DEVICE_METADATA.localhost.platform) - - rv=$(pip install $device/$platform/sonic_platform-1.0-py2-none-any.whl) - rv=$(pip3 install $device/$platform/sonic_platform-1.0-py3-none-any.whl) -} - -remove_python_api_package() { - rv=$(pip show sonic-platform > /dev/null 2>/dev/null) - if [ $? -eq 0 ]; then - rv=$(pip uninstall -y sonic-platform > /dev/null 2>/dev/null) - fi +if [[ "$1" == "init" ]]; then + depmod -a + case "$(cat /proc/cmdline)" in + *SONIC_BOOT_TYPE=warm*) + TYPE='warm' + ;; + *SONIC_BOOT_TYPE=fastfast*) + TYPE='fastfast' + ;; + *SONIC_BOOT_TYPE=fast*|*fast-reboot*) + TYPE='fast' + ;; + *SONIC_BOOT_TYPE=soft*) + TYPE='soft' + ;; + *) + TYPE='cold' + esac - rv=$(pip3 show sonic-platform > /dev/null 2>/dev/null) - if [ $? -eq 0 ]; then - rv=$(pip3 uninstall -y sonic-platform > /dev/null 2>/dev/null) + if [[ "$TYPE" == "cold" ]]; then + /usr/local/bin/iom_power_on.sh fi -} - -if [[ "$1" == "init" ]]; then + systemctl enable s6100-lpc-monitor.service + systemctl start --no-block s6100-lpc-monitor.service pericom="/sys/bus/pci/devices/0000:08:00.0" modprobe i2c-dev @@ -43,18 +46,17 @@ if [[ "$1" == "init" ]]; then /usr/local/bin/platform_watchdog_disable.sh fi - is_fast_warm=$(cat /proc/cmdline | grep SONIC_BOOT_TYPE | wc -l) + systemctl start --no-block s6100-ssd-upgrade-status.service - if [[ "$is_fast_warm" == "1" ]]; then - systemctl start --no-block s6100-i2c-enumerate.service + if [[ "$TYPE" == "cold" ]]; then + systemctl start s6100-platform-startup.service else - systemctl start s6100-i2c-enumerate.service + systemctl start --no-block s6100-platform-startup.service fi - install_python_api_package elif [[ "$1" == "deinit" ]]; then - /usr/local/bin/s6100_i2c_enumeration.sh deinit + /usr/local/bin/s6100_platform_startup.sh deinit modprobe -r dell_s6100_lpc modprobe -r dell_s6100_iom_cpld @@ -62,7 +64,6 @@ elif [[ "$1" == "deinit" ]]; then modprobe -r i2c-dev modprobe -r dell_ich modprobe -r nvram - remove_python_api_package else echo "s6100_platform : Invalid option !" fi diff --git a/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/s6100_platform_startup.sh b/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/s6100_platform_startup.sh new file mode 100755 index 000000000000..a95771bf82ce --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/s6100_platform_startup.sh @@ -0,0 +1,325 @@ +#!/bin/bash + +### DellEMC S6100 Platform Startup script + +source dell_i2c_utils.sh + +install_python_api_package() { + device="/usr/share/sonic/device" + platform=$(/usr/local/bin/sonic-cfggen -H -v DEVICE_METADATA.localhost.platform) + + rv=$(pip3 install $device/$platform/sonic_platform-1.0-py3-none-any.whl) +} + +remove_python_api_package() { + + rv=$(pip3 show sonic-platform > /dev/null 2>/dev/null) + if [ $? -eq 0 ]; then + rv=$(pip3 uninstall -y sonic-platform > /dev/null 2>/dev/null) + fi +} + +init_devnum() { + found=0 + for devnum in 0 1; do + devname=`cat /sys/bus/i2c/devices/i2c-${devnum}/name` + # iSMT adapter can be at either dffd0000 or dfff0000 + if [[ $devname == 'SMBus iSMT adapter at '* ]]; then + found=1 + break + fi + done + + [[ $found -eq 0 ]] && echo "cannot find iSMT" && exit 1 +} + +# Attach/Detach CPU board mux @ 0x70 +cpu_board_mux() { + case $1 in + "new_device") i2c_mux_create pca9547 0x70 $devnum 2 + ;; + "delete_device") i2c_mux_delete 0x70 $devnum + ;; + *) echo "s6100_platform: cpu_board_mux: invalid command !" + ;; + esac +} + +# Attach/Detach Switchboard MUX @ 0x71 +switch_board_mux() { + case $1 in + "new_device") i2c_mux_create pca9548 0x71 4 10 + ;; + "delete_device") i2c_mux_delete 0x71 4 + ;; + *) echo "s6100_platform: switch_board_mux : invalid command !" + ;; + esac +} + +# Attach/Detach syseeprom on CPU board +sys_eeprom() { + case $1 in + "new_device") i2c_config "echo 24c02 0x50 > /sys/bus/i2c/devices/i2c-2/$1" + ;; + "delete_device") i2c_config "echo 0x50 > /sys/bus/i2c/devices/i2c-2/$1" + ;; + *) echo "s6100_platform: sys_eeprom : invalid command !" + ;; + esac +} + +#Attach/Detach eeprom on each IOM +switch_board_eeprom() { + case $1 in + "new_device") + for ((i=14;i<=17;i++)); + do + i2c_config "echo 24c02 0x50 > /sys/bus/i2c/devices/i2c-$i/$1" + done + ;; + "delete_device") + for ((i=14;i<=17;i++)); + do + i2c_config "echo 0x50 > /sys/bus/i2c/devices/i2c-$i/$1" + done + ;; + *) echo "s6100_platform: switch_board_eeprom : invalid command !" + ;; + esac +} + +#Attach/Detach CPLD devices to drivers for each IOM +switch_board_cpld() { + case $1 in + "new_device") + for ((i=14;i<=17;i++)); + do + i2c_config "echo dell_s6100_iom_cpld 0x3e > /sys/bus/i2c/devices/i2c-$i/$1" + done + ;; + "delete_device") + for ((i=14;i<=17;i++)); + do + i2c_config "echo 0x3e > /sys/bus/i2c/devices/i2c-$i/$1" + done + ;; + *) echo "s6100_platform: switch_board_cpld : invalid command !" + ;; + esac +} + +#Attach/Detach the MUX connecting all QSFPs on each IOM @0x71 and 0x72 +switch_board_qsfp_mux() { + case $1 in + "new_device") + # The mux for the QSFPs spawn {18..25}, {26..33}... {74..81} + # starting at chennel 18 and 16 channels per IOM. + channel_first=18 + for ((i=9;i>=6;i--)); + do + # 0x71 mux on the IOM 1 + mux_index=$(expr $i - 5) + echo "Attaching PCA9548 $mux_index" + i2c_mux_create pca9548 0x71 $i $channel_first + i2c_mux_create pca9548 0x72 $i $(expr $channel_first + 8) + channel_first=$(expr $channel_first + 16) + done + ;; + "delete_device") + for ((i=9;i>=6;i--)); + do + # 0x71 mux on the IOM 1 + mux_index=$(expr $i - 5) + echo "Detaching PCA9548 $mux_index" + i2c_mux_delete 0x71 $i + i2c_mux_delete 0x72 $i + done + ;; + *) echo "s6100_platform: switch_board_qsfp_mux: invalid command !" + ;; + esac +} + +#Attach/Detach the SFP modules on PCA9548_2 +switch_board_sfp() { + case $1 in + "new_device") i2c_config "echo optoe2 0x50 > /sys/bus/i2c/devices/i2c-11/$1" + i2c_config "echo optoe2 0x50 > /sys/bus/i2c/devices/i2c-12/$1" + ;; + "delete_device") i2c_config "echo 0x50 > /sys/bus/i2c/devices/i2c-11/$1" + i2c_config "echo 0x50 > /sys/bus/i2c/devices/i2c-12/$1" + ;; + *) echo "s6100_platform: switch_board_sfp: invalid command !" + ;; + esac +} + +#Add/Delete ($1) a range ($2..$3) of QSFPs +qsfp_device_mod() { + case $1 in + "new_device") for ((i=$2;i<=$3;i++)); + do + i2c_config "echo optoe1 0x50 > /sys/bus/i2c/devices/i2c-$i/$1" + done + ;; + "delete_device") for ((i=$2;i<=$3;i++)); + do + i2c_config "echo 0x50 > /sys/bus/i2c/devices/i2c-$i/$1" + done + ;; + *) echo "s6100_platform: qsfp_device_mod: invalid command $1:$2,$3!" + ;; + esac +} + +# Attach/Detach 16 instances of QSFP ports on each IO modules +# eeprom can dump data using below command +switch_board_qsfp() { + if i2c_poll_bus_exists "/sys/bus/i2c/devices/i2c-18"; then + qsfp_device_mod $1 18 33 + fi + + if i2c_poll_bus_exists "/sys/bus/i2c/devices/i2c-34"; then + qsfp_device_mod $1 34 49 + fi + + if i2c_poll_bus_exists "/sys/bus/i2c/devices/i2c-50"; then + qsfp_device_mod $1 50 65 + fi + + if i2c_poll_bus_exists "/sys/bus/i2c/devices/i2c-66"; then + qsfp_device_mod $1 66 81 + fi +} + +# Enable/Disable low power mode on all QSFP ports +switch_board_qsfp_lpmode() { + case $1 in + "enable") value=0xffff + ;; + "disable") value=0x0 + ;; + *) echo "s6100_platform: switch_board_qsfp_lpmode: invalid command $1!" + return + ;; + esac + echo $value > /sys/class/i2c-adapter/i2c-14/14-003e/qsfp_lpmode + echo $value > /sys/class/i2c-adapter/i2c-15/15-003e/qsfp_lpmode + echo $value > /sys/class/i2c-adapter/i2c-16/16-003e/qsfp_lpmode + echo $value > /sys/class/i2c-adapter/i2c-17/17-003e/qsfp_lpmode +} + +# Enable/Disable xcvr presence interrupts +xcvr_presence_interrupts() { + case $1 in + "enable") + for ((i=14;i<=17;i++)); + do + echo 0x0 > /sys/class/i2c-adapter/i2c-$i/$i-003e/qsfp_abs_mask + done + ;; + "disable") + for ((i=14;i<=17;i++)); + do + echo 0xffff > /sys/class/i2c-adapter/i2c-$i/$i-003e/qsfp_abs_mask + done + ;; + *) echo "s6100_platform: xcvr_presence_interrupts: invalid command !" + ;; + esac +} + +# Reset the mux tree +reset_muxes() { + local i + + # Reset the IOM muxes (if they have been already instantiated) + for ((i=14;i<=17;i++)); + do + if [[ -e /sys/class/i2c-adapter/i2c-$i/$i-003e ]]; then + echo 0xfc > /sys/class/i2c-adapter/i2c-$i/$i-003e/sep_reset + echo 0xff > /sys/class/i2c-adapter/i2c-$i/$i-003e/sep_reset + fi + done + + # Reset the switch card PCA9548A + io_rd_wr.py --set --val 0xef --offset 0x110 + io_rd_wr.py --set --val 0xff --offset 0x110 + + # Reset the CPU Card PCA9547 + io_rd_wr.py --set --val 0xfd --offset 0x20b + io_rd_wr.py --set --val 0xff --offset 0x20b +} + +init_devnum + +check_iom_status() +{ + SMF_DIR="/sys/devices/platform/SMF.512/hwmon/*" + count=0 + iom_sta=0 + MAX_IOM_STARTUP_DELAY=50 + + if [ -d $SMF_DIR ]; then + iom_status=$(cat $SMF_DIR/iom_status) + cpu_iom1_sta=$(cat $SMF_DIR/cpu_iom1_control) + cpu_iom2_sta=$(cat $SMF_DIR/cpu_iom2_control) + cpu_iom3_sta=$(cat $SMF_DIR/cpu_iom3_control) + cpu_iom4_sta=$(cat $SMF_DIR/cpu_iom4_control) + cpu_iom_sta=$(( cpu_iom1_sta|cpu_iom2_sta|cpu_iom3_sta|cpu_iom4_sta )) + echo "Started polling IOM status" + while [ "$iom_status" != "f0" -o "$cpu_iom_sta" != "0" ]; + do + if [ "$count" -gt "$MAX_IOM_STARTUP_DELAY" ];then + echo "IOM is taking longer than expected to power up.Aborting. + iom_status- $iom_status cpu_iom_sta1- $cpu_iom1_sta cpu_iom_sta2- $cpu_iom2_sta + cpu_iom_sta3- $cpu_iom3_sta cpu_iom_sta4- $cpu_iom4_sta " + iom_sta=1 + break + fi + cpu_iom1_sta=$(cat $SMF_DIR/cpu_iom1_control) + cpu_iom2_sta=$(cat $SMF_DIR/cpu_iom2_control) + cpu_iom3_sta=$(cat $SMF_DIR/cpu_iom3_control) + cpu_iom4_sta=$(cat $SMF_DIR/cpu_iom4_control) + cpu_iom_sta=$(( cpu_iom1_sta|cpu_iom2_sta|cpu_iom3_sta|cpu_iom4_sta )) + iom_status=$(cat $SMF_DIR/iom_status) + sleep .1 + count=`expr $count + 1` + done + + if [ "$iom_sta" != "1" ];then + echo "All IOM's are UP" + fi + fi +} + +if [[ "$1" == "init" ]]; then + cpu_board_mux "new_device" + switch_board_mux "new_device" + sys_eeprom "new_device" + switch_board_eeprom "new_device" + switch_board_cpld "new_device" + check_iom_status + switch_board_qsfp_mux "new_device" + switch_board_sfp "new_device" + switch_board_qsfp "new_device" + switch_board_qsfp_lpmode "disable" + /usr/local/bin/s6100_bitbang_reset.sh + xcvr_presence_interrupts "enable" + + install_python_api_package + monit reload +elif [[ "$1" == "deinit" ]]; then + xcvr_presence_interrupts "disable" + switch_board_sfp "delete_device" + switch_board_cpld "delete_device" + switch_board_eeprom "delete_device" + switch_board_mux "delete_device" + sys_eeprom "delete_device" + switch_board_qsfp "delete_device" + switch_board_qsfp_mux "delete_device" + cpu_board_mux "delete_device" + + remove_python_api_package +fi diff --git a/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/s6100_serial_getty_monitor b/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/s6100_serial_getty_monitor new file mode 100644 index 000000000000..f57ae3679016 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/s6100_serial_getty_monitor @@ -0,0 +1,5 @@ +#Dell S6100 serial getty monitor +check program serial-getty with path /usr/local/bin/check-getty.sh +start program = "/bin/systemctl start serial-getty@ttyS1.service" +stop program = "/bin/systemctl stop serial-getty@ttyS1.service" +if status != 0 then restart \ No newline at end of file diff --git a/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/s6100_ssd_mon.sh b/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/s6100_ssd_mon.sh new file mode 100755 index 000000000000..8691d656bf93 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/s6100_ssd_mon.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +SSD_FW_UPGRADE="/host/ssd_fw_upgrade" + +if [ -e $SSD_FW_UPGRADE/GPIO7_high ]; then + iSMART="/usr/local/bin/iSMART_64" + iSMART_OPTIONS="-d /dev/sda" + + iSMART_CMD=`$iSMART $iSMART_OPTIONS` + GPIO_STATUS=$(echo "$iSMART_CMD" | grep GPIO | awk '{print $NF}') + + if [ $GPIO_STATUS != "0x01" ];then + logger -p user.crit -t DELL_S6100_SSD_MON "The SSD on this unit is faulty. Do not power-cycle/reboot this unit!" + logger -p user.crit -t DELL_S6100_SSD_MON "soft-/fast-/warm-reboot is allowed." + rm -rf $SSD_FW_UPGRADE/GPIO7_* + touch $SSD_FW_UPGRADE/GPIO7_low + systemctl stop s6100-ssd-monitor.timer + fi +else + systemctl stop s6100-ssd-monitor.timer +fi diff --git a/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/s6100_ssd_upgrade_status.sh b/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/s6100_ssd_upgrade_status.sh new file mode 100755 index 000000000000..b06de8184ca0 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/s6100_ssd_upgrade_status.sh @@ -0,0 +1,116 @@ +#!/bin/bash + +SSD_FW_UPGRADE="/host/ssd_fw_upgrade" + +if [ -e $SSD_FW_UPGRADE/GPIO7_high ]; then + systemctl start --no-block s6100-ssd-monitor.timer + exit 0 +fi + +if [ -e $SSD_FW_UPGRADE/GPIO7_low ] || [ -e $SSD_FW_UPGRADE/GPIO7_error ]; then + exit 0 +fi + +[ ! -d $SSD_FW_UPGRADE ] && mkdir $SSD_FW_UPGRADE + +SSD_UPGRADE_LOG="$SSD_FW_UPGRADE/upgrade.log" + +iSMART="/usr/local/bin/iSMART_64" +iSMART_OPTIONS="-d /dev/sda" +iSMART_CMD=`$iSMART $iSMART_OPTIONS` +SMART_CMD=`smartctl -a /dev/sda` + +SSD_FW_VERSION=$(echo "$iSMART_CMD" | grep "FW Version" | awk '{print $NF}') +SSD_FW_VERSION=${SSD_FW_VERSION,,} +SSD_MODEL=$(echo "$iSMART_CMD" | grep "Model" | awk '{print $NF}') + +if [ -e $SSD_FW_UPGRADE/GPIO7_pending_upgrade ]; then + if [ $SSD_MODEL == "3IE" ] && [ $SSD_FW_VERSION == "s141002c" ]; then + # If SSD Firmware is not upgraded + exit 0 + fi + if [ $SSD_FW_VERSION == "s16425c1" ] || [ $SSD_FW_VERSION == "s16425cq" ]; then + # If SSD Firmware is not upgraded + exit 0 + fi +fi + +echo "$0 `date` SSD FW upgrade logs post reboot." >> $SSD_UPGRADE_LOG + +SSD_UPGRADE_STATUS1=`io_rd_wr.py --set --val 06 --offset 210; io_rd_wr.py --set --val 09 --offset 211; io_rd_wr.py --get --offset 212` +SSD_UPGRADE_STATUS1=$(echo "$SSD_UPGRADE_STATUS1" | awk '{print $NF}') + +SSD_UPGRADE_STATUS2=`io_rd_wr.py --set --val 06 --offset 210; io_rd_wr.py --set --val 0A --offset 211; io_rd_wr.py --get --offset 212` +SSD_UPGRADE_STATUS2=$(echo "$SSD_UPGRADE_STATUS2" | awk '{print $NF}') + +if [ $SSD_UPGRADE_STATUS1 == "2" ]; then + rm -rf $SSD_FW_UPGRADE/GPIO7_* + touch $SSD_FW_UPGRADE/GPIO7_error + + echo "$0 `date` Upgraded to unknown version after first mp_64 upgrade." >> $SSD_UPGRADE_LOG + +elif [ $SSD_MODEL == "3IE3" ] && [ $SSD_UPGRADE_STATUS2 == "2" ];then + rm -rf $SSD_FW_UPGRADE/GPIO7_* + touch $SSD_FW_UPGRADE/GPIO7_error + + echo "$0 `date` Upgraded to unknown version after second mp_64 upgrade." >> $SSD_UPGRADE_LOG + +elif [ $SSD_FW_VERSION == "s210506g" ] || [ $SSD_FW_VERSION == "s16425cg" ]; then + # If SSD Firmware is upgraded + GPIO_STATUS=$(echo "$iSMART_CMD" | grep GPIO | awk '{print $NF}') + + if [ $GPIO_STATUS != "0x01" ];then + logger -p user.crit -t DELL_S6100_SSD_MON "The SSD on this unit is faulty. Do not power-cycle/reboot this unit!" + logger -p user.crit -t DELL_S6100_SSD_MON "soft-/fast-/warm-reboot is allowed." + rm -rf $SSD_FW_UPGRADE/GPIO7_* + touch $SSD_FW_UPGRADE/GPIO7_low + echo "$0 `date` The SSD on this unit is faulty. Do not power-cycle/reboot this unit!" >> $SSD_UPGRADE_LOG + echo "$0 `date` soft-/fast-/warm-reboot is allowed." >> $SSD_UPGRADE_LOG + + else + rm -rf $SSD_FW_UPGRADE/GPIO7_* + touch $SSD_FW_UPGRADE/GPIO7_high + systemctl start --no-block s6100-ssd-monitor.timer + if [ $SSD_UPGRADE_STATUS1 == "0" ]; then + if [ $SSD_MODEL == "3IE" ];then + echo "$0 `date` SSD FW upgraded from S141002C to S210506G in first mp_64." >> $SSD_UPGRADE_LOG + else + echo "$0 `date` SSD FW upgraded from S16425c1 to S16425cG in first mp_64." >> $SSD_UPGRADE_LOG + fi + elif [ $SSD_MODEL == "3IE3" ] && [ $SSD_UPGRADE_STATUS2 == "1" ]; then + rm -rf $SSD_FW_UPGRADE/GPIO7_* + touch $SSD_FW_UPGRADE/GPIO7_low + logger -p user.crit -t DELL_S6100_SSD_MON "The SSD on this unit is faulty. Do not power-cycle/reboot this unit!" + logger -p user.crit -t DELL_S6100_SSD_MON "soft-/fast-/warm-reboot is allowed." + + echo "$0 `date` SSD entered loader mode in first mp_64 and upgraded to latest version after second mp_64." >> $SSD_UPGRADE_LOG + fi + fi + +else + if [ $SSD_UPGRADE_STATUS1 == "ff" ] && [ $SSD_UPGRADE_STATUS2 == "ff" ]; then + rm -rf $SSD_FW_UPGRADE/GPIO7_* + touch $SSD_FW_UPGRADE/GPIO7_pending_upgrade + + echo "$0 `date` SSD upgrade didn’t happen." >> $SSD_UPGRADE_LOG + + elif [ $SSD_UPGRADE_STATUS1 == "1" ]; then + rm -rf $SSD_FW_UPGRADE/GPIO7_* + touch $SSD_FW_UPGRADE/GPIO7_low + logger -p user.crit -t DELL_S6100_SSD_MON "The SSD on this unit is faulty. Do not power-cycle/reboot this unit!" + logger -p user.crit -t DELL_S6100_SSD_MON "soft-/fast-/warm-reboot is allowed." + + echo "$0 `date` SSD entered loader mode in first mp_64 upgrade." >> $SSD_UPGRADE_LOG + + if [ $SSD_MODEL == "3IE3" ] && [ $SSD_UPGRADE_STATUS2 == "0" ]; then + echo "$0 `date` SSD entered loader mode in first mp_64 and recovered back to older version in second mp_64." >> $SSD_UPGRADE_LOG + fi + fi + +fi + +echo "$0 `date` SMF Register 1 = $SSD_UPGRADE_STATUS1" >> $SSD_UPGRADE_LOG +echo "$0 `date` SMF Register 2 = $SSD_UPGRADE_STATUS2" >> $SSD_UPGRADE_LOG +echo "$SMART_CMD" >> $SSD_UPGRADE_LOG +echo "$iSMART_CMD" >> $SSD_UPGRADE_LOG +sync diff --git a/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/soft-reboot_plugin b/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/soft-reboot_plugin new file mode 120000 index 000000000000..180742bbc4d5 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/soft-reboot_plugin @@ -0,0 +1 @@ +fast-reboot_plugin \ No newline at end of file diff --git a/platform/broadcom/sonic-platform-modules-dell/s6100/sonic_platform/chassis.py b/platform/broadcom/sonic-platform-modules-dell/s6100/sonic_platform/chassis.py index 47ef87b951db..b33db2e11b15 100755 --- a/platform/broadcom/sonic-platform-modules-dell/s6100/sonic_platform/chassis.py +++ b/platform/broadcom/sonic-platform-modules-dell/s6100/sonic_platform/chassis.py @@ -54,15 +54,35 @@ class Chassis(ChassisBase): power_reason_dict[33] = ChassisBase.REBOOT_CAUSE_THERMAL_OVERLOAD_ASIC power_reason_dict[44] = ChassisBase.REBOOT_CAUSE_INSUFFICIENT_FAN_SPEED + status_led_reg_to_color = { + 0x00: 'green', 0x01: 'blinking green', 0x02: 'amber', + 0x04: 'amber', 0x08: 'blinking amber', 0x10: 'blinking amber' + } + + color_to_status_led_reg = { + 'green': 0x00, 'blinking green': 0x01, + 'amber': 0x02, 'blinking amber': 0x08 + } + def __init__(self): ChassisBase.__init__(self) + self.status_led_reg = "sys_status_led" + self.supported_led_color = ['green', 'blinking green', 'amber', 'blinking amber'] # Initialize EEPROM self._eeprom = Eeprom() for i in range(MAX_S6100_MODULE): module = Module(i) self._module_list.append(module) self._sfp_list.extend(module._sfp_list) + #SFP ports + sfp_port = 11 + for index in range(64,66): + eeprom_path = "/sys/bus/i2c/devices/i2c-{0}/{0}-0050/eeprom".format(sfp_port) + sfp_control = "" + sfp_node = Sfp(index, 'SFP', eeprom_path, sfp_control, index) + self._sfp_list.append(sfp_node) + sfp_port = sfp_port + 1 for i in range(MAX_S6100_FANTRAY): fandrawer = FanDrawer(i) @@ -113,6 +133,23 @@ def _get_pmc_register(self, reg_name): rv = rv.lstrip(" ") return rv + def _set_pmc_register(self, reg_name, value): + # On successful write, returns the length of value written on + # reg_name and on failure returns 'ERR' + rv = 'ERR' + mb_reg_file = self.MAILBOX_DIR + '/' + reg_name + + if (not os.path.isfile(mb_reg_file)): + return rv + + try: + with open(mb_reg_file, 'w') as fd: + rv = fd.write(str(value)) + except IOError: + rv = 'ERR' + + return rv + def _get_register(self, reg_file): # On successful read, returns the value read from given # reg_name and on failure returns 'ERR' @@ -172,6 +209,23 @@ def get_status(self): """ return True + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device. + Returns: + integer: The 1-based relative physical position in parent + device or -1 if cannot determine the position + """ + return -1 + + def is_replaceable(self): + """ + Indicate whether Chassis is replaceable. + Returns: + bool: True if it is replaceable. + """ + return False + def get_base_mac(self): """ Retrieves the base MAC address for the chassis @@ -325,3 +379,41 @@ def get_change_event(self, timeout=0): break return True, ret_dict + + def initizalize_system_led(self): + return True + + def set_status_led(self, color): + """ + Sets the state of the system LED + + Args: + color: A string representing the color with which to set the + system LED + + Returns: + bool: True if system LED state is set successfully, False if not + """ + if color not in self.supported_led_color: + return False + + value = self.color_to_status_led_reg[color] + rv = self._set_pmc_register(self.status_led_reg, value) + if (rv != 'ERR'): + return True + else: + return False + + def get_status_led(self): + """ + Gets the state of the system LED + + Returns: + A string, one of the valid LED color strings which could be + vendor specified. + """ + reg_val = self._get_pmc_register(self.status_led_reg) + if (reg_val != 'ERR'): + return self.status_led_reg_to_color.get(int(reg_val, 16), None) + else: + return None diff --git a/platform/broadcom/sonic-platform-modules-dell/s6100/sonic_platform/component.py b/platform/broadcom/sonic-platform-modules-dell/s6100/sonic_platform/component.py index 6b1420a98606..2e916488123d 100644 --- a/platform/broadcom/sonic-platform-modules-dell/s6100/sonic_platform/component.py +++ b/platform/broadcom/sonic-platform-modules-dell/s6100/sonic_platform/component.py @@ -39,9 +39,11 @@ class Component(ComponentBase): ] def __init__(self, component_index=0, - is_module=False, iom_index=0, i2c_line=0): + is_module=False, iom_index=0, i2c_line=0, dependency=None): + ComponentBase.__init__(self) self.is_module_component = is_module + self.dependency = dependency if self.is_module_component: self.index = iom_index @@ -132,6 +134,61 @@ def get_name(self): """ return self.name + def get_model(self): + """ + Retrieves the part number of the component + Returns: + string: Part number of component + """ + return 'NA' + + def get_serial(self): + """ + Retrieves the serial number of the component + Returns: + string: Serial number of component + """ + return 'NA' + + def get_presence(self): + """ + Retrieves the presence of the component + Returns: + bool: True if present, False if not + """ + if self.is_module_component: + return self.dependency.get_presence() + else: + return True + + def get_status(self): + """ + Retrieves the operational status of the component + Returns: + bool: True if component is operating properly, False if not + """ + if self.is_module_component: + return self.dependency.get_status() + else: + return True + + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device. + Returns: + integer: The 1-based relative physical position in parent + device or -1 if cannot determine the position + """ + return -1 + + def is_replaceable(self): + """ + Indicate whether component is replaceable. + Returns: + bool: True if it is replaceable. + """ + return False + def get_description(self): """ Retrieves the description of the component diff --git a/platform/broadcom/sonic-platform-modules-dell/s6100/sonic_platform/fan.py b/platform/broadcom/sonic-platform-modules-dell/s6100/sonic_platform/fan.py index 8404a8d2bf5f..e95fceaff91d 100644 --- a/platform/broadcom/sonic-platform-modules-dell/s6100/sonic_platform/fan.py +++ b/platform/broadcom/sonic-platform-modules-dell/s6100/sonic_platform/fan.py @@ -26,30 +26,24 @@ class Fan(FanBase): HWMON_NODE = os.listdir(HWMON_DIR)[0] MAILBOX_DIR = HWMON_DIR + HWMON_NODE - def __init__(self, fantray_index=1, fan_index=1, psu_fan=False): + def __init__(self, fantray_index=1, psu_index=1, psu_fan=False, dependency=None): + FanBase.__init__(self) self.is_psu_fan = psu_fan if not self.is_psu_fan: - # API index is starting from 0, DellEMC platform index is starting - # from 1 - self.fantrayindex = fantray_index + 1 - self.fanindex = fan_index + 1 - self.fan_presence_reg = "fan{}_fault".format( - 2 * self.fantrayindex - 1) + self.fantrayindex = fantray_index + self.dependency = dependency self.fan_status_reg = "fan{}_alarm".format( 2 * self.fantrayindex - 1) self.get_fan_speed_reg = "fan{}_input".format( 2 * self.fantrayindex - 1) self.get_fan_dir_reg = "fan{}_airflow".format( 2 * self.fantrayindex - 1) - self.fan_serialno_reg = "fan{}_serialno".format( - 2 * self.fantrayindex - 1) self.max_fan_speed = MAX_S6100_FAN_SPEED else: - # PSU Fan index starts from 11 - self.fanindex = fan_index + 10 - self.fan_presence_reg = "fan{}_fault".format(self.fanindex) - self.get_fan_speed_reg = "fan{}_input".format(self.fanindex) - self.get_fan_dir_reg = "fan{}_airflow".format(self.fanindex) + self.psuindex = psu_index + self.fan_presence_reg = "fan{}_fault".format(self.psuindex + 10) + self.get_fan_speed_reg = "fan{}_input".format(self.psuindex + 10) + self.get_fan_dir_reg = "fan{}_airflow".format(self.psuindex + 10) self.max_fan_speed = MAX_S6100_PSU_FAN_SPEED def _get_pmc_register(self, reg_name): @@ -77,10 +71,9 @@ def get_name(self): string: The name of the device """ if not self.is_psu_fan: - return "FanTray{}-Fan{}".format( - self.fantrayindex, self.fanindex - 1) + return "FanTray{}-Fan1".format(self.fantrayindex) else: - return "PSU{} Fan".format(self.fanindex - 10) + return "PSU{} Fan".format(self.psuindex) def get_model(self): """ @@ -88,21 +81,7 @@ def get_model(self): Returns: string: Part number of FAN """ - # For Serial number "US-01234D-54321-25A-0123-A00", the part - # number is "01234D" - if self.is_psu_fan: - return 'NA' - - fan_serialno = self._get_pmc_register(self.fan_serialno_reg) - if (fan_serialno != 'ERR') and self.get_presence(): - if (len(fan_serialno.split('-')) > 1): - fan_partno = fan_serialno.split('-')[1] - else: - fan_partno = 'NA' - else: - fan_partno = 'NA' - - return fan_partno + return 'NA' def get_serial(self): """ @@ -110,15 +89,7 @@ def get_serial(self): Returns: string: Serial number of FAN """ - # Sample Serial number format "US-01234D-54321-25A-0123-A00" - if self.is_psu_fan: - return 'NA' - - fan_serialno = self._get_pmc_register(self.fan_serialno_reg) - if (fan_serialno == 'ERR') or not self.get_presence(): - fan_serialno = 'NA' - - return fan_serialno + return 'NA' def get_presence(self): """ @@ -126,14 +97,17 @@ def get_presence(self): Returns: bool: True if fan is present, False if not """ - status = False - fantray_presence = self._get_pmc_register(self.fan_presence_reg) - if (fantray_presence != 'ERR'): - fantray_presence = int(fantray_presence, 10) - if (~fantray_presence & 0b1): - status = True + if not self.is_psu_fan: + return self.dependency.get_presence() - return status + presence = False + fan_presence = self._get_pmc_register(self.fan_presence_reg) + if (fan_presence != 'ERR'): + fan_presence = int(fan_presence, 10) + if (~fan_presence & 0b1): + presence = True + + return presence def get_status(self): """ @@ -157,6 +131,23 @@ def get_status(self): return status + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device. + Returns: + integer: The 1-based relative physical position in parent + device or -1 if cannot determine the position + """ + return 1 + + def is_replaceable(self): + """ + Indicate whether Fan is replaceable. + Returns: + bool: True if it is replaceable. + """ + return False + def get_direction(self): """ Retrieves the fan airflow direction @@ -216,7 +207,6 @@ def set_speed(self, speed): Returns: bool: True if set success, False if fail. """ - # Fan speeds are controlled by Smart-fussion FPGA. return False @@ -229,7 +219,7 @@ def set_status_led(self, color): Returns: bool: True if set success, False if fail. """ - # Leds are controlled by Smart-fussion FPGA. + # No LED available for FanTray and PSU Fan # Return True to avoid thermalctld alarm. return True @@ -240,17 +230,8 @@ def get_status_led(self): Returns: A string, one of the predefined STATUS_LED_COLOR_* strings. """ - if self.is_psu_fan: - # No LED available for PSU Fan - return None - else: - if self.get_presence(): - if self.get_status(): - return self.STATUS_LED_COLOR_GREEN - else: - return self.STATUS_LED_COLOR_AMBER - else: - return self.STATUS_LED_COLOR_OFF + # No LED available for FanTray and PSU Fan + return None def get_target_speed(self): """ @@ -262,5 +243,3 @@ def get_target_speed(self): # Fan speeds are controlled by Smart-fussion FPGA. # Return current speed to avoid false thermalctld alarm. return self.get_speed() - - diff --git a/platform/broadcom/sonic-platform-modules-dell/s6100/sonic_platform/fan_drawer.py b/platform/broadcom/sonic-platform-modules-dell/s6100/sonic_platform/fan_drawer.py index ada5e93393c9..41e870a63971 100644 --- a/platform/broadcom/sonic-platform-modules-dell/s6100/sonic_platform/fan_drawer.py +++ b/platform/broadcom/sonic-platform-modules-dell/s6100/sonic_platform/fan_drawer.py @@ -9,6 +9,8 @@ ######################################################################## try: + import os + from sonic_platform_base.fan_drawer_base import FanDrawerBase from sonic_platform.fan import Fan except ImportError as e: @@ -16,14 +18,38 @@ class FanDrawer(FanDrawerBase): - """DellEMC Platform-specific Fan class""" + """DellEMC Platform-specific Fan Drawer class""" - def __init__(self, fantray_index): + HWMON_DIR = "/sys/devices/platform/SMF.512/hwmon/" + HWMON_NODE = os.listdir(HWMON_DIR)[0] + MAILBOX_DIR = HWMON_DIR + HWMON_NODE + def __init__(self, fantray_index): FanDrawerBase.__init__(self) # FanTray is 1-based in DellEMC platforms - self.fantrayindex = fantray_index + 1 - self._fan_list.append(Fan(fantray_index)) + self.index = fantray_index + 1 + self.presence_reg = "fan{}_fault".format(2 * self.index - 1) + self.serialno_reg = "fan{}_serialno".format(2 * self.index - 1) + + self._fan_list.append(Fan(self.index, dependency=self)) + + def _get_pmc_register(self, reg_name): + # On successful read, returns the value read from given + # reg_name and on failure returns 'ERR' + rv = 'ERR' + mb_reg_file = self.MAILBOX_DIR+'/'+reg_name + + if (not os.path.isfile(mb_reg_file)): + return rv + try: + with open(mb_reg_file, 'r') as fd: + rv = fd.read() + except Exception as error: + rv = 'ERR' + + rv = rv.rstrip('\r\n') + rv = rv.lstrip(" ") + return rv def get_name(self): """ @@ -31,4 +57,105 @@ def get_name(self): Returns: string: The name of the device """ - return "FanTray{}".format(self.fantrayindex) + return "FanTray{}".format(self.index) + + def get_model(self): + """ + Retrieves the part number of Fandrawer + Returns: + string: Part number of Fandrawer + """ + # For Serial number "US-01234D-54321-25A-0123-A00", the part + # number is "01234D" + fantray_serialno = self._get_pmc_register(self.serialno_reg) + if (fantray_serialno != 'ERR') and self.get_presence(): + if (len(fantray_serialno.split('-')) > 1): + fantray_partno = fantray_serialno.split('-')[1] + else: + fantray_partno = 'NA' + else: + fantray_partno = 'NA' + + return fantray_partno + + def get_serial(self): + """ + Retrieves the serial number of Fandrawer + Returns: + string: Serial number of Fandrawer + """ + # Sample Serial number format "US-01234D-54321-25A-0123-A00" + fantray_serialno = self._get_pmc_register(self.serialno_reg) + if (fantray_serialno == 'ERR') or not self.get_presence(): + fantray_serialno = 'NA' + + return fantray_serialno + + def get_presence(self): + """ + Retrieves the presence of the Fandrawer + Returns: + bool: True if fan is present, False if not + """ + presence = False + fantray_presence = self._get_pmc_register(self.presence_reg) + if (fantray_presence != 'ERR'): + fantray_presence = int(fantray_presence, 10) + if (~fantray_presence & 0b1): + presence = True + + return presence + + def get_status(self): + """ + Retrieves the operational status of the Fandrawer + + Returns: + bool: True if Fandrawer is operating properly, False if not + """ + return self.get_fan(0).get_status() + + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device. + Returns: + integer: The 1-based relative physical position in parent + device or -1 if cannot determine the position + """ + return self.index + + def is_replaceable(self): + """ + Indicate whether this Fandrawer is replaceable. + Returns: + bool: True if it is replaceable. + """ + return True + + def set_status_led(self, color): + """ + Set led to expected color + Args: + color: A string representing the color with which to set the + fan module status LED + Returns: + bool: True if set success, False if fail. + """ + # Leds are controlled by Smart-fussion FPGA. + # Return True to avoid thermalctld alarm. + return True + + def get_status_led(self): + """ + Gets the state of the Fan status LED + + Returns: + A string, one of the predefined STATUS_LED_COLOR_* strings. + """ + if self.get_presence(): + if self.get_fan(0).get_status(): + return self.STATUS_LED_COLOR_GREEN + else: + return self.STATUS_LED_COLOR_AMBER + else: + return self.STATUS_LED_COLOR_OFF diff --git a/platform/broadcom/sonic-platform-modules-dell/s6100/sonic_platform/module.py b/platform/broadcom/sonic-platform-modules-dell/s6100/sonic_platform/module.py index 6b93bcfd1fa7..923bb5c0550a 100644 --- a/platform/broadcom/sonic-platform-modules-dell/s6100/sonic_platform/module.py +++ b/platform/broadcom/sonic-platform-modules-dell/s6100/sonic_platform/module.py @@ -63,7 +63,7 @@ def __init__(self, module_index): self.iom_presence_reg = "iom_presence" component = Component(is_module=True, iom_index=self.index, - i2c_line=self.port_i2c_line) + i2c_line=self.port_i2c_line, dependency=self) self._component_list.append(component) eeprom_base = "/sys/class/i2c-adapter/i2c-{0}/i2c-{1}/{1}-0050/eeprom" @@ -157,6 +157,23 @@ def get_status(self): return status + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device. + Returns: + integer: The 1-based relative physical position in parent + device or -1 if cannot determine the position + """ + return self.index + + def is_replaceable(self): + """ + Indicate whether Module is replaceable. + Returns: + bool: True if it is replaceable. + """ + return True + def get_base_mac(self): """ Retrieves the base MAC address for the module diff --git a/platform/broadcom/sonic-platform-modules-dell/s6100/sonic_platform/pcie.py b/platform/broadcom/sonic-platform-modules-dell/s6100/sonic_platform/pcie.py new file mode 100644 index 000000000000..cff56c1ea55f --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-dell/s6100/sonic_platform/pcie.py @@ -0,0 +1,29 @@ +######################################################################## +# +# DELLEMC S6100 +# +# Module contains a platform specific implementation of SONiC Platform +# Base PCIe class +# +######################################################################## + +try: + from sonic_platform.component import Component + from sonic_platform_base.sonic_pcie.pcie_common import PcieUtil +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class Pcie(PcieUtil): + """DellEMC Platform-specific PCIe class""" + + def __init__(self, platform_path): + PcieUtil.__init__(self, platform_path) + bios = Component(component_index=0) + bios_ver = bios.get_firmware_version() + + versions = bios_ver.split("-") + if (len(versions) == 2) and int(versions[1], 10) > 5: + self._conf_rev = "2" + else: + self._conf_rev = "1" diff --git a/platform/broadcom/sonic-platform-modules-dell/s6100/sonic_platform/psu.py b/platform/broadcom/sonic-platform-modules-dell/s6100/sonic_platform/psu.py index 48b266daa278..4e528b679e4a 100644 --- a/platform/broadcom/sonic-platform-modules-dell/s6100/sonic_platform/psu.py +++ b/platform/broadcom/sonic-platform-modules-dell/s6100/sonic_platform/psu.py @@ -34,13 +34,15 @@ def __init__(self, psu_index): self.psu_voltage_reg = "in30_input" self.psu_current_reg = "curr602_input" self.psu_power_reg = "power2_input" + self.psu_temperature_reg = "temp14_input" elif self.index == 2: self.psu_voltage_reg = "in32_input" self.psu_current_reg = "curr702_input" self.psu_power_reg = "power4_input" + self.psu_temperature_reg = "temp15_input" # Passing True to specify it is a PSU fan - psu_fan = Fan(fan_index=self.index, psu_fan=True) + psu_fan = Fan(psu_index=self.index, psu_fan=True) self._fan_list.append(psu_fan) def _get_pmc_register(self, reg_name): @@ -232,3 +234,87 @@ def set_status_led(self, color): # In S6100, SmartFusion FPGA controls the PSU LED and the PSU # LED state cannot be changed from CPU. return False + + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device. + Returns: + integer: The 1-based relative physical position in parent + device or -1 if cannot determine the position + """ + return self.index + + def is_replaceable(self): + """ + Indicate whether this PSU is replaceable. + Returns: + bool: True if it is replaceable. + """ + return True + + def get_temperature(self): + """ + Retrieves current temperature reading from PSU + + Returns: + A float number of current temperature in Celsius up to + nearest thousandth of one degree Celsius, e.g. 30.125 + """ + temperature = 0.0 + if self.get_presence(): + psu_temperature = self._get_pmc_register(self.psu_temperature_reg) + if (psu_temperature != 'ERR'): + temperature = float(psu_temperature) / 1000 + + return temperature + + def get_temperature_high_threshold(self): + """ + Retrieves the high threshold temperature of PSU + + Returns: + A float number, the high threshold temperature of PSU in + Celsius up to nearest thousandth of one degree Celsius, + e.g. 30.125 + """ + return 90.0 + + def get_voltage_high_threshold(self): + """ + Retrieves the high threshold PSU voltage output + + Returns: + A float number, the high threshold output voltage in volts, + e.g. 12.1 + """ + voltage_high_threshold = 0.0 + if self.get_presence(): + psu_type = self._get_pmc_register(self.psu_presence_reg) + if (psu_type != 'ERR'): + psu_type = int(psu_type, 16) + if (psu_type & 0b10): + voltage_high_threshold = 12.6 + else: + voltage_high_threshold = 12.8 + + return voltage_high_threshold + + def get_voltage_low_threshold(self): + """ + Retrieves the low threshold PSU voltage output + + Returns: + A float number, the low threshold output voltage in volts, + e.g. 12.1 + """ + voltage_low_threshold = 0.0 + if self.get_presence(): + psu_type = self._get_pmc_register(self.psu_presence_reg) + if (psu_type != 'ERR'): + psu_type = int(psu_type, 16) + if (psu_type & 0b10): + voltage_low_threshold = 11.4 + else: + voltage_low_threshold = 11.6 + + return voltage_low_threshold diff --git a/platform/broadcom/sonic-platform-modules-dell/s6100/sonic_platform/sfp.py b/platform/broadcom/sonic-platform-modules-dell/s6100/sonic_platform/sfp.py index 6947b6cf2b66..fd9173c229ee 100755 --- a/platform/broadcom/sonic-platform-modules-dell/s6100/sonic_platform/sfp.py +++ b/platform/broadcom/sonic-platform-modules-dell/s6100/sonic_platform/sfp.py @@ -10,6 +10,7 @@ try: import re + import struct import time from sonic_platform_base.sfp_base import SfpBase from sonic_platform_base.sonic_sfp.sff8436 import sff8436InterfaceId @@ -27,6 +28,9 @@ DOM_OFFSET = 0 DOM_OFFSET1 = 384 +QSFP_CONTROL_OFFSET = 86 +QSFP_POWEROVERRIDE_OFFSET = 93 + cable_length_tup = ('Length(km)', 'Length OM3(2m)', 'Length OM2(m)', 'Length OM1(m)', 'Length Cable Assembly(m)') @@ -44,7 +48,7 @@ 'encoding', 'ext_identifier', 'ext_rateselect_compliance', 'cable_type', 'cable_length', 'nominal_bit_rate', 'specification_compliance', 'vendor_date', 'vendor_oui', - 'application_advertisement'] + 'type_abbrv_name', 'application_advertisement'] dom_dict_keys = ['rx_los', 'tx_fault', 'reset_status', 'power_lpmode', 'tx_disable', 'tx_disable_channel', @@ -87,6 +91,7 @@ 'nominal_bit_rate': [INFO_OFFSET, 0, 20, 'parse_sfp_info_bulk'], 'specification_compliance': [INFO_OFFSET, 0, 20, 'parse_sfp_info_bulk'], + 'type_abbrv_name': [INFO_OFFSET, 0, 20, 'parse_sfp_info_bulk'], 'manufacturer': [INFO_OFFSET, 20, 16, 'parse_vendor_name'], 'vendor_oui': [INFO_OFFSET, 37, 3, 'parse_vendor_oui'], 'model': [INFO_OFFSET, 40, 16, 'parse_vendor_pn'], @@ -107,7 +112,7 @@ def __init__(self, index, sfp_type, eeprom_path, sfp_control, sfp_ctrl_idx): SfpBase.__init__(self) self.sfp_type = sfp_type - self.index = index + self.index = index + 1 self.eeprom_path = eeprom_path self.sfp_control = sfp_control self.sfp_ctrl_idx = sfp_ctrl_idx @@ -131,9 +136,10 @@ def _read_eeprom_bytes(self, eeprom_path, offset, num_bytes): eeprom.close() return None + raw = bytearray(raw) try: for n in range(0, num_bytes): - eeprom_raw[n] = hex(ord(raw[n]))[2:].zfill(2) + eeprom_raw[n] = hex(raw[n])[2:].zfill(2) except BaseException: eeprom.close() return None @@ -193,6 +199,7 @@ def get_transceiver_info(self): ext_id = iface_data['data']['Extended Identifier']['value'] rate_identifier = iface_data['data']['RateIdentifier']['value'] identifier = iface_data['data']['type']['value'] + type_abbrv_name = iface_data['data']['type_abbrv_name']['value'] bit_rate = str( iface_data['data']['Nominal Bit Rate(100Mbs)']['value']) @@ -249,6 +256,7 @@ def get_transceiver_info(self): return transceiver_info_dict # Fill The Dictionary and return + transceiver_info_dict['type_abbrv_name'] = type_abbrv_name transceiver_info_dict['type'] = identifier transceiver_info_dict['hardware_rev'] = vendor_rev transceiver_info_dict['serial'] = vendor_sn @@ -414,6 +422,9 @@ def get_presence(self): """ Retrieves the presence of the sfp """ + if self.index > 64: + return False + presence_ctrl = self.sfp_control + 'qsfp_modprs' try: reg_file = open(presence_ctrl) @@ -469,6 +480,9 @@ def get_reset_status(self): """ Retrieves the reset status of SFP """ + if self.index > 64: + return False + reset_status = None reset_ctrl = self.sfp_control + 'qsfp_reset' try: @@ -594,45 +608,22 @@ def get_tx_disable_channel(self): """ Retrieves the TX disabled channels in this SFP """ - tx_disable = None - tx_disable_list = [] - - tx_disable_data = self._get_eeprom_data('tx_disable') - if (tx_disable_data is not None): - tx_disable = tx_disable_data['data']['Tx1Disable']['value'] - if (tx_disable == 'On'): - tx_disable_list.append(1) - else: - tx_disable_list.append(0) - tx_disable = tx_disable_data['data']['Tx2Disable']['value'] - if (tx_disable == 'On'): - tx_disable_list.append(1) - else: - tx_disable_list.append(0) - tx_disable = tx_disable_data['data']['Tx3Disable']['value'] - if (tx_disable == 'On'): - tx_disable_list.append(1) - else: - tx_disable_list.append(0) - tx_disable = tx_disable_data['data']['Tx4Disable']['value'] - if (tx_disable == 'On'): - tx_disable_list.append(1) - else: - tx_disable_list.append(0) + tx_disable_channel = 0 - bit4 = int(tx_disable_list[3]) * 8 - bit3 = int(tx_disable_list[2]) * 4 - bit2 = int(tx_disable_list[1]) * 2 - bit1 = int(tx_disable_list[0]) * 1 - - tx_disable_channel = hex(bit4 + bit3 + bit2 + bit1) + tx_disable = self.get_tx_disable() + for channel, disable in enumerate(tx_disable): + if disable: + tx_disable_channel |= 1 << channel - return tx_disable_channel + return tx_disable_channel def get_lpmode(self): """ Retrieves the lpmode (low power mode) status of this SFP """ + if self.index > 64: + return False + lpmode_ctrl = self.sfp_control + 'qsfp_lpmode' try: reg_file = open(lpmode_ctrl, "r+") @@ -748,6 +739,9 @@ def reset(self): """ Reset SFP and return all user module settings to their default srate. """ + if self.index > 64: + return False + reset_ctrl = self.sfp_control + 'qsfp_reset' try: # Open reset_ctrl in both read & write mode @@ -797,6 +791,9 @@ def set_lpmode(self, lpmode): """ Sets the lpmode (low power mode) of SFP """ + if self.index > 64: + return False + lpmode_ctrl = self.sfp_control + 'qsfp_lpmode' try: reg_file = open(lpmode_ctrl, "r+") @@ -836,19 +833,68 @@ def tx_disable(self, tx_disable): """ Disable SFP TX for all channels """ - return False + eeprom = None + tx_disable_value = 0xf if tx_disable else 0x0 + + try: + eeprom = open(self.eeprom_path, "r+b") + eeprom.seek(QSFP_CONTROL_OFFSET) + eeprom.write(struct.pack('B', tx_disable_value)) + except IOError: + return False + finally: + if eeprom is not None: + eeprom.close() + time.sleep(0.01) + + return True def tx_disable_channel(self, channel, disable): """ Sets the tx_disable for specified SFP channels """ - return False + eeprom = None + current_state = self.get_tx_disable_channel() + + if disable: + tx_disable_value = current_state | channel + else: + tx_disable_value = current_state & (~channel) + + try: + eeprom = open(self.eeprom_path, "r+b") + eeprom.seek(QSFP_CONTROL_OFFSET) + eeprom.write(struct.pack('B', tx_disable_value)) + except IOError: + return False + finally: + if eeprom is not None: + eeprom.close() + time.sleep(0.01) + + return True def set_power_override(self, power_override, power_set): """ Sets SFP power level using power_override and power_set """ - return False + eeprom = None + power_override_bit = 0x1 if power_override else 0 + power_set_bit = 0x2 if power_set else 0 + value = power_override_bit | power_set_bit + + try: + eeprom = open(self.eeprom_path, "r+b") + eeprom.seek(QSFP_POWEROVERRIDE_OFFSET) + eeprom.write(struct.pack('B', value)) + except IOError: + return False + finally: + if eeprom is not None: + eeprom.close() + time.sleep(0.01) + + return True def get_status(self): """ @@ -862,3 +908,20 @@ def get_status(self): status = True return status + + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device. + Returns: + integer: The 1-based relative physical position in parent + device or -1 if cannot determine the position + """ + return self.index + + def is_replaceable(self): + """ + Indicate whether this device is replaceable. + Returns: + bool: True if it is replaceable. + """ + return True diff --git a/platform/broadcom/sonic-platform-modules-dell/s6100/sonic_platform/thermal.py b/platform/broadcom/sonic-platform-modules-dell/s6100/sonic_platform/thermal.py index f7037b000c5b..6b8ce0954c96 100644 --- a/platform/broadcom/sonic-platform-modules-dell/s6100/sonic_platform/thermal.py +++ b/platform/broadcom/sonic-platform-modules-dell/s6100/sonic_platform/thermal.py @@ -26,6 +26,7 @@ class Thermal(ThermalBase): ) def __init__(self, thermal_index): + ThermalBase.__init__(self) self.is_cpu_thermal = False self.index = thermal_index + 1 @@ -131,6 +132,23 @@ def get_status(self): return status + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device. + Returns: + integer: The 1-based relative physical position in parent + device or -1 if cannot determine the position + """ + return self.index + + def is_replaceable(self): + """ + Indicate whether this Thermal is replaceable. + Returns: + bool: True if it is replaceable. + """ + return False + def get_temperature(self): """ Retrieves current temperature reading from thermal diff --git a/platform/broadcom/sonic-platform-modules-dell/s6100/sonic_platform/watchdog.py b/platform/broadcom/sonic-platform-modules-dell/s6100/sonic_platform/watchdog.py index c6d5e6e2e9df..177315ef1805 100644 --- a/platform/broadcom/sonic-platform-modules-dell/s6100/sonic_platform/watchdog.py +++ b/platform/broadcom/sonic-platform-modules-dell/s6100/sonic_platform/watchdog.py @@ -41,6 +41,7 @@ class Watchdog(WatchdogBase): CLOCK_MONOTONIC = 1 def __init__(self): + WatchdogBase.__init__(self) self._librt = ctypes.CDLL('librt.so.1', use_errno=True) self._clock_gettime = self._librt.clock_gettime self._clock_gettime.argtypes=[ctypes.c_int, ctypes.POINTER(_timespec)] @@ -151,9 +152,9 @@ def arm(self, seconds): if self.is_armed(): gpio_val = self._read_gpio_file(gpio) high_val = gpio_val | (1 << 15) - if self._write_gpio_file(gpio, hex(high_val)) != -1: + if self._write_gpio_file(gpio, hex(high_val).encode('utf-8')) != -1: low_val = high_val & 0xFFFF7FFF - if self._write_gpio_file(gpio, hex(low_val)) != -1: + if self._write_gpio_file(gpio, hex(low_val).encode('utf-8')) != -1: self.armed_time = self._get_time() self.timeout = seconds return seconds diff --git a/platform/broadcom/sonic-platform-modules-dell/s6100/systemd/platform-modules-s6100.service b/platform/broadcom/sonic-platform-modules-dell/s6100/systemd/platform-modules-s6100.service index 9b5805d5cbbb..127426f09873 100644 --- a/platform/broadcom/sonic-platform-modules-dell/s6100/systemd/platform-modules-s6100.service +++ b/platform/broadcom/sonic-platform-modules-dell/s6100/systemd/platform-modules-s6100.service @@ -1,6 +1,6 @@ [Unit] Description=Dell S6100 Platform modules -Before=pmon.service +Before=pmon.service determine-reboot-cause.service pcie-check.service system-health.service watchdog-control.service DefaultDependencies=no [Service] diff --git a/platform/broadcom/sonic-platform-modules-dell/s6100/systemd/s6100-i2c-enumerate.service b/platform/broadcom/sonic-platform-modules-dell/s6100/systemd/s6100-i2c-enumerate.service deleted file mode 100644 index c63482831940..000000000000 --- a/platform/broadcom/sonic-platform-modules-dell/s6100/systemd/s6100-i2c-enumerate.service +++ /dev/null @@ -1,12 +0,0 @@ -[Unit] -Description=Dell S6100 I2C MUX Enumeration -Before=pmon.service -DefaultDependencies=no - -[Service] -Type=oneshot -ExecStart=/usr/local/bin/s6100_i2c_enumeration.sh init -RemainAfterExit=no - -[Install] -WantedBy=multi-user.target diff --git a/platform/broadcom/sonic-platform-modules-dell/s6100/systemd/s6100-platform-startup.service b/platform/broadcom/sonic-platform-modules-dell/s6100/systemd/s6100-platform-startup.service new file mode 100644 index 000000000000..ecba7b006361 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-dell/s6100/systemd/s6100-platform-startup.service @@ -0,0 +1,12 @@ +[Unit] +Description=Dell S6100 Platform Startup Service +Before=pmon.service determine-reboot-cause.service pcie-check.service system-health.service watchdog-control.service +DefaultDependencies=no + +[Service] +Type=oneshot +ExecStart=/usr/local/bin/s6100_platform_startup.sh init +RemainAfterExit=no + +[Install] +WantedBy=multi-user.target diff --git a/platform/broadcom/sonic-platform-modules-dell/s6100/systemd/s6100-ssd-monitor.service b/platform/broadcom/sonic-platform-modules-dell/s6100/systemd/s6100-ssd-monitor.service new file mode 100644 index 000000000000..75e3b224b65b --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-dell/s6100/systemd/s6100-ssd-monitor.service @@ -0,0 +1,12 @@ +[Unit] +Description=Dell S6100 SSD monitoring poller +DefaultDependencies=no + +[Service] +User=root +ExecStart=/usr/local/bin/s6100_ssd_mon.sh +RemainAfterExit=no + +[Install] +WantedBy=multi-user.target + diff --git a/platform/broadcom/sonic-platform-modules-dell/s6100/systemd/s6100-ssd-monitor.timer b/platform/broadcom/sonic-platform-modules-dell/s6100/systemd/s6100-ssd-monitor.timer new file mode 100644 index 000000000000..ede2b636d80b --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-dell/s6100/systemd/s6100-ssd-monitor.timer @@ -0,0 +1,12 @@ +[Unit] +Description=Dell S6100 SSD monitoring poller timer +DefaultDependencies=no +After=pmon.service + +[Timer] +OnBootSec=5min +OnUnitActiveSec=60min + +[Install] +WantedBy=timers.target + diff --git a/platform/broadcom/sonic-platform-modules-dell/s6100/systemd/s6100-ssd-upgrade-status.service b/platform/broadcom/sonic-platform-modules-dell/s6100/systemd/s6100-ssd-upgrade-status.service new file mode 100644 index 000000000000..4de9cf73b965 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-dell/s6100/systemd/s6100-ssd-upgrade-status.service @@ -0,0 +1,14 @@ +[Unit] +Description= Checking Dell S6100 SSD upgrade status +After=pmon.service +DefaultDependencies=no + +[Service] +User=root +Type=oneshot +ExecStart=/usr/local/bin/s6100_ssd_upgrade_status.sh +RemainAfterExit=no + +[Install] +WantedBy=multi-user.target + diff --git a/platform/broadcom/sonic-platform-modules-dell/z9100/sonic_platform/component.py b/platform/broadcom/sonic-platform-modules-dell/z9100/sonic_platform/component.py index 52dee31a524e..d3822307e24b 100644 --- a/platform/broadcom/sonic-platform-modules-dell/z9100/sonic_platform/component.py +++ b/platform/broadcom/sonic-platform-modules-dell/z9100/sonic_platform/component.py @@ -39,6 +39,7 @@ class Component(ComponentBase): ] def __init__(self, component_index=0): + ComponentBase.__init__(self) self.index = component_index self.name = self.CHASSIS_COMPONENTS[self.index][0] self.description = self.CHASSIS_COMPONENTS[self.index][1] diff --git a/platform/broadcom/sonic-platform-modules-dell/z9100/sonic_platform/fan.py b/platform/broadcom/sonic-platform-modules-dell/z9100/sonic_platform/fan.py index 31bda2f4cefb..e85f614a82e4 100755 --- a/platform/broadcom/sonic-platform-modules-dell/z9100/sonic_platform/fan.py +++ b/platform/broadcom/sonic-platform-modules-dell/z9100/sonic_platform/fan.py @@ -27,6 +27,7 @@ class Fan(FanBase): MAILBOX_DIR = HWMON_DIR + HWMON_NODE def __init__(self, fantray_index=1, fan_index=1, psu_fan=False): + FanBase.__init__(self) self.is_psu_fan = psu_fan if not self.is_psu_fan: # API index is starting from 0, DellEMC platform index is starting diff --git a/platform/broadcom/sonic-platform-modules-dell/z9100/sonic_platform/psu.py b/platform/broadcom/sonic-platform-modules-dell/z9100/sonic_platform/psu.py index f76d0ac1bec6..d32cb8f7f3aa 100644 --- a/platform/broadcom/sonic-platform-modules-dell/z9100/sonic_platform/psu.py +++ b/platform/broadcom/sonic-platform-modules-dell/z9100/sonic_platform/psu.py @@ -25,6 +25,7 @@ class Psu(PsuBase): MAILBOX_DIR = HWMON_DIR + HWMON_NODE def __init__(self, psu_index): + PsuBase.__init__(self) # PSU is 1-based in DellEMC platforms self.index = psu_index + 1 self.psu_presence_reg = "psu{}_presence".format(self.index) diff --git a/platform/broadcom/sonic-platform-modules-dell/z9100/sonic_platform/thermal.py b/platform/broadcom/sonic-platform-modules-dell/z9100/sonic_platform/thermal.py index 942934ed7638..72e6fff1e16b 100644 --- a/platform/broadcom/sonic-platform-modules-dell/z9100/sonic_platform/thermal.py +++ b/platform/broadcom/sonic-platform-modules-dell/z9100/sonic_platform/thermal.py @@ -26,6 +26,7 @@ class Thermal(ThermalBase): ) def __init__(self, thermal_index): + ThermalBase.__init__(self) self.is_cpu_thermal = False self.index = thermal_index + 1 diff --git a/platform/broadcom/sonic-platform-modules-dell/z9100/systemd/platform-modules-z9100.service b/platform/broadcom/sonic-platform-modules-dell/z9100/systemd/platform-modules-z9100.service index 00fbfa6803ef..390cb6e0f567 100644 --- a/platform/broadcom/sonic-platform-modules-dell/z9100/systemd/platform-modules-z9100.service +++ b/platform/broadcom/sonic-platform-modules-dell/z9100/systemd/platform-modules-z9100.service @@ -1,6 +1,6 @@ [Unit] Description=Dell Z9100 Platform modules -Before=pmon.service +Before=pmon.service determine-reboot-cause.service DefaultDependencies=no [Service] diff --git a/platform/broadcom/sonic-platform-modules-dell/z9264f/sonic_platform/chassis.py b/platform/broadcom/sonic-platform-modules-dell/z9264f/sonic_platform/chassis.py index 3f99cf503b3b..78e8dea999c8 100644 --- a/platform/broadcom/sonic-platform-modules-dell/z9264f/sonic_platform/chassis.py +++ b/platform/broadcom/sonic-platform-modules-dell/z9264f/sonic_platform/chassis.py @@ -104,7 +104,7 @@ def _get_register(self, reg_file): try: with os.fdopen(os.open(reg_file, os.O_RDONLY)) as fd: retval = fd.read() - except: + except Exception: pass retval = retval.rstrip('\r\n') retval = retval.lstrip(" ") @@ -134,6 +134,8 @@ def get_change_event(self, timeout=0): port_dict = {} change_dict = {} change_dict['sfp'] = port_dict + if timeout != 0: + timeout = timeout / 1000 try: # We get notified when there is a MSI interrupt (vector 4/5)CVR # Open the sysfs file and register the epoll object @@ -174,7 +176,7 @@ def get_change_event(self, timeout=0): if (retval != 0): return False, change_dict return True, change_dict - except: + except Exception: return False, change_dict finally: if self.oir_fd != -1: @@ -183,7 +185,6 @@ def get_change_event(self, timeout=0): self.oir_fd.close() self.oir_fd = -1 self.epoll = -1 - return False, change_dict def get_sfp(self, index): """ @@ -281,7 +282,7 @@ def get_reboot_cause(self): try: with open(self.REBOOT_CAUSE_PATH) as fd: reboot_cause = int(fd.read(), 16) - except: + except Exception: return (self.REBOOT_CAUSE_NON_HARDWARE, None) if reboot_cause & 0x1: diff --git a/platform/broadcom/sonic-platform-modules-dell/z9264f/sonic_platform/component.py b/platform/broadcom/sonic-platform-modules-dell/z9264f/sonic_platform/component.py index 6ead7ef524f2..aa09d730b5ce 100644 --- a/platform/broadcom/sonic-platform-modules-dell/z9264f/sonic_platform/component.py +++ b/platform/broadcom/sonic-platform-modules-dell/z9264f/sonic_platform/component.py @@ -10,7 +10,6 @@ ######################################################################## try: - import os import re from sonic_platform_base.component_base import ComponentBase @@ -24,18 +23,20 @@ class Component(ComponentBase): CHASSIS_COMPONENTS = [ ["BIOS", ("Performs initialization of hardware components during " - "booting")], + "booting")], ["FPGA", ("Used for managing the system LEDs")], ["BMC", ("Platform management controller for on-board temperature " - "monitoring, in-chassis power, Fan and LED control")], + "monitoring, in-chassis power, Fan and LED control")], ["System CPLD", ("Used for managing the CPU power sequence and CPU states")], ["Slave CPLD 1", ("Used for managing QSFP/QSFP28 port transceivers (1-16)")], ["Slave CPLD 2", ("Used for managing QSFP/QSFP28 port transceivers (17-32)")], ["Slave CPLD 3", ("Used for managing QSFP/QSFP28 port transceivers (33-48)")], ["Slave CPLD 4", ("Used for managing QSFP/QSFP28 port transceivers (49-64) and SFP/SFP28 " - "port transceivers (65 and 66)")], - ] + "port transceivers (65 and 66)")], + ] + def __init__(self, component_index=0): + ComponentBase.__init__(self) self.index = component_index self.name = self.CHASSIS_COMPONENTS[self.index][0] self.description = self.CHASSIS_COMPONENTS[self.index][1] @@ -48,7 +49,6 @@ def get_name(self): """ return self.name - def get_description(self): """ Retrieves the description of the component @@ -77,7 +77,7 @@ def get_firmware_version(self): if version: rv = version.group(1).strip() return rv - + def install_firmware(self, image_path): """ Installs firmware to the component @@ -87,5 +87,3 @@ def install_firmware(self, image_path): A boolean, True if install was successful, False if not """ return False - - diff --git a/platform/broadcom/sonic-platform-modules-dell/z9264f/sonic_platform/fan.py b/platform/broadcom/sonic-platform-modules-dell/z9264f/sonic_platform/fan.py index 39307d453486..b7d990877daa 100644 --- a/platform/broadcom/sonic-platform-modules-dell/z9264f/sonic_platform/fan.py +++ b/platform/broadcom/sonic-platform-modules-dell/z9264f/sonic_platform/fan.py @@ -43,6 +43,7 @@ class Fan(FanBase): def __init__(self, fantray_index=1, fan_index=1, psu_fan=False, dependency=None): + FanBase.__init__(self) self.is_psu_fan = psu_fan if not self.is_psu_fan: # API index is starting from 0, DellEMC platform index is diff --git a/platform/broadcom/sonic-platform-modules-dell/z9264f/sonic_platform/sfp.py b/platform/broadcom/sonic-platform-modules-dell/z9264f/sonic_platform/sfp.py index 8d9bd36c6abb..d6d3e59b5891 100644 --- a/platform/broadcom/sonic-platform-modules-dell/z9264f/sonic_platform/sfp.py +++ b/platform/broadcom/sonic-platform-modules-dell/z9264f/sonic_platform/sfp.py @@ -12,11 +12,7 @@ import os import time import struct - import sys - import getopt - import select import mmap - from sonic_platform_base.chassis_base import ChassisBase from sonic_platform_base.sfp_base import SfpBase from sonic_platform_base.sonic_sfp.sff8436 import sff8436InterfaceId from sonic_platform_base.sonic_sfp.sff8436 import sff8436Dom @@ -122,7 +118,7 @@ 'hardware_rev': [QSFP_INFO_OFFSET, 56, 2, 'parse_vendor_rev'], 'serial': [QSFP_INFO_OFFSET, 68, 16, 'parse_vendor_sn'], 'vendor_date': [QSFP_INFO_OFFSET, 84, 8, 'parse_vendor_date'], - 'dom_capability': [QSFP_INFO_OFFSET, 92, 1, 'parse_qsfp_dom_capability'], + 'dom_capability': [QSFP_INFO_OFFSET, 92, 1, 'parse_dom_capability'], 'dom_rev': [QSFP_DOM_OFFSET, 1, 1, 'parse_sfp_dom_rev'], 'ModuleThreshold': [QSFP_DOM_OFFSET1, 128, 24, 'parse_module_threshold_values'], 'ChannelThreshold': [QSFP_DOM_OFFSET1, 176, 16, 'parse_channel_threshold_values'], @@ -219,8 +215,13 @@ def _read_eeprom_bytes(self, eeprom_path, offset, num_bytes): return None try: - for n in range(0, num_bytes): - eeprom_raw[n] = hex(ord(raw[n]))[2:].zfill(2) + if isinstance(raw , str): + for n in range(0, num_bytes): + eeprom_raw[n] = hex(ord(raw[n]))[2:].zfill(2) + else: + for n in range(0, num_bytes): + eeprom_raw[n] = hex(raw[n])[2:].zfill(2) + except BaseException: eeprom.close() return None @@ -971,7 +972,7 @@ def reset(self): reg_value = reg_value & ~mask # Convert our register value back to a hex string and write back - status = self.pci_set_value(self.BASE_RES_PATH, reg_value, port_offset) + self.pci_set_value(self.BASE_RES_PATH, reg_value, port_offset) # Sleep 1 second to allow it to settle time.sleep(1) @@ -979,7 +980,7 @@ def reset(self): reg_value = reg_value | mask # Convert our register value back to a hex string and write back - status = self.pci_set_value(self.BASE_RES_PATH, reg_value, port_offset) + self.pci_set_value(self.BASE_RES_PATH, reg_value, port_offset) return True @@ -1011,7 +1012,7 @@ def set_lpmode(self, lpmode): reg_value = reg_value & ~mask # Convert our register value back to a hex string and write back - status = self.pci_set_value(self.BASE_RES_PATH, reg_value, port_offset) + self.pci_set_value(self.BASE_RES_PATH, reg_value, port_offset) return True @@ -1030,12 +1031,6 @@ def tx_disable_channel(self, channel, disable): """ return False - def tx_disable_channel(self, channel, disable): - """ - Sets the tx_disable for specified SFP channels - """ - return False - def set_power_override(self, power_override, power_set): """ Sets SFP power level using power_override and power_set diff --git a/platform/broadcom/sonic-platform-modules-dell/z9264f/sonic_platform/thermal.py b/platform/broadcom/sonic-platform-modules-dell/z9264f/sonic_platform/thermal.py index 1f3caaa02dd3..d6432f66bcab 100644 --- a/platform/broadcom/sonic-platform-modules-dell/z9264f/sonic_platform/thermal.py +++ b/platform/broadcom/sonic-platform-modules-dell/z9264f/sonic_platform/thermal.py @@ -11,7 +11,7 @@ try: from sonic_platform_base.thermal_base import ThermalBase - from sonic_platform.ipmihelper import IpmiSensor, IpmiFru + from sonic_platform.ipmihelper import IpmiSensor except ImportError as e: raise ImportError(str(e) + "- required module not found") @@ -105,9 +105,9 @@ def get_high_threshold(self): Celsius up to nearest thousandth of one degree Celsius, e.g. 30.125 """ - is_valid, high_threshold = self.sensor.get_threshold("UpperCritical") + is_valid, high_threshold = self.sensor.get_threshold("UpperNonCritical") if not is_valid: - high_threshold = 0 + return super(Thermal, self).get_high_threshold() return float(high_threshold) @@ -135,9 +135,9 @@ def get_high_critical_threshold(self): thermal in Celsius up to nearest thousandth of one degree Celsius, e.g. 30.125 """ - is_valid, high_crit_threshold = self.sensor.get_threshold("UpperNonRecoverable") + is_valid, high_crit_threshold = self.sensor.get_threshold("UpperCritical") if not is_valid: - high_crit_threshold = 0 + return super(Thermal, self).get_high_critical_threshold() return float(high_crit_threshold) diff --git a/platform/broadcom/sonic-platform-modules-dell/z9264f/sonic_platform/watchdog.py b/platform/broadcom/sonic-platform-modules-dell/z9264f/sonic_platform/watchdog.py index d3363067db63..3ba9f671a9fc 100644 --- a/platform/broadcom/sonic-platform-modules-dell/z9264f/sonic_platform/watchdog.py +++ b/platform/broadcom/sonic-platform-modules-dell/z9264f/sonic_platform/watchdog.py @@ -10,8 +10,6 @@ ######################################################################## try: - import sys - import struct import ctypes import subprocess from sonic_platform_base.watchdog_base import WatchdogBase @@ -38,6 +36,7 @@ class Watchdog(WatchdogBase): CLOCK_MONOTONIC = 1 def __init__(self): + WatchdogBase.__init__(self) self._librt = ctypes.CDLL('librt.so.1', use_errno=True) self._clock_gettime = self._librt.clock_gettime self._clock_gettime.argtypes=[ctypes.c_int, ctypes.POINTER(_timespec)] @@ -45,7 +44,7 @@ def __init__(self): def _get_command_result(self, cmdline): try: proc = subprocess.Popen(cmdline.split(), stdout=subprocess.PIPE, - stderr=subprocess.STDOUT) + stderr=subprocess.STDOUT, universal_newlines=True) stdout = proc.communicate()[0] proc.wait() result = stdout.rstrip('\n') @@ -139,8 +138,6 @@ def arm(self, seconds): self.timeout = seconds return seconds - return -1 - def disarm(self): """ Disarm the hardware watchdog @@ -211,4 +208,3 @@ def get_remaining_time(self): return self.timeout - diff_time return 0 - diff --git a/platform/broadcom/sonic-platform-modules-dell/z9264f/systemd/platform-modules-z9264f.service b/platform/broadcom/sonic-platform-modules-dell/z9264f/systemd/platform-modules-z9264f.service index b89f61ea6226..05d920a8502b 100644 --- a/platform/broadcom/sonic-platform-modules-dell/z9264f/systemd/platform-modules-z9264f.service +++ b/platform/broadcom/sonic-platform-modules-dell/z9264f/systemd/platform-modules-z9264f.service @@ -1,6 +1,6 @@ [Unit] Description=Dell Z9264f Platform modules -Before=pmon.service +Before=pmon.service determine-reboot-cause.service DefaultDependencies=no [Service] diff --git a/platform/broadcom/sonic-platform-modules-dell/z9332f/scripts/z9332f_platform.sh b/platform/broadcom/sonic-platform-modules-dell/z9332f/scripts/z9332f_platform.sh index 91c644f1a6f4..e8890f641468 100755 --- a/platform/broadcom/sonic-platform-modules-dell/z9332f/scripts/z9332f_platform.sh +++ b/platform/broadcom/sonic-platform-modules-dell/z9332f/scripts/z9332f_platform.sh @@ -58,7 +58,7 @@ switch_board_qsfp() { "new_device") for ((i=10;i<=41;i++)); do - echo optoe1 0x50 > /sys/bus/i2c/devices/i2c-$i/$1 + echo optoe3 0x50 > /sys/bus/i2c/devices/i2c-$i/$1 done ;; @@ -187,7 +187,7 @@ if [ "$1" == "init" ]; then modprobe i2c-dev modprobe i2c-mux-pca954x force_deselect_on_exit=1 modprobe ipmi_devintf - modprobe ipmi_si kipmid_max_busy_us=1000 + modprobe ipmi_si kipmid_max_busy_us=2500 modprobe cls-i2c-ocore modprobe cls-switchboard modprobe mc24lc64t @@ -200,7 +200,7 @@ if [ "$1" == "init" ]; then # /usr/bin/qsfp_irq_enable.py platform_firmware_versions get_reboot_cause - echo 1000 > /sys/module/ipmi_si/parameters/kipmid_max_busy_us + echo 2500 > /sys/module/ipmi_si/parameters/kipmid_max_busy_us elif [ "$1" == "deinit" ]; then sys_eeprom "delete_device" diff --git a/platform/broadcom/sonic-platform-modules-dell/z9332f/sonic_platform/chassis.py b/platform/broadcom/sonic-platform-modules-dell/z9332f/sonic_platform/chassis.py index 3651b0d4bf08..e14ce1ce4ddb 100755 --- a/platform/broadcom/sonic-platform-modules-dell/z9332f/sonic_platform/chassis.py +++ b/platform/broadcom/sonic-platform-modules-dell/z9332f/sonic_platform/chassis.py @@ -19,6 +19,7 @@ from sonic_platform.thermal import Thermal from sonic_platform.fan_drawer import FanDrawer from sonic_platform.watchdog import Watchdog + import sonic_platform.hwaccess as hwaccess except ImportError as e: raise ImportError(str(e) + "- required module not found") @@ -27,7 +28,7 @@ MAX_Z9332F_FAN = 2 MAX_Z9332F_PSU = 2 MAX_Z9332F_THERMAL = 14 -MAX_Z9332F_COMPONENT = 6 # BIOS,FPGA,BMC,BB CPLD and 2 Switch CPLDs +MAX_Z9332F_COMPONENT = 8 # BIOS,FPGA,BMC,BB CPLD,2 Switch CPLDs,SSD and PCIe media_part_num_list = set([ \ "8T47V","XTY28","MHVPK","GF76J","J6FGD","F1KMV","9DN5J","H4DHD","6MCNV","0WRX0","X7F70","5R2PT","WTRD1","WTRD1","WTRD1","WTRD1","5250G","WTRD1","C5RNH","C5RNH","FTLX8571D3BCL-FC", @@ -53,9 +54,25 @@ class Chassis(ChassisBase): REBOOT_CAUSE_PATH = "/host/reboot-cause/platform/reboot_reason" oir_fd = -1 epoll = -1 + io_res = "/dev/port" + sysled_offset = 0xA162 + SYSLED_COLOR_TO_REG = { + "green": 0xd0, + "yellow": 0xe0, + "flashing green": 0xd2, + "flashing yellow": 0xe2 + } + + REG_TO_SYSLED_COLOR = { + 0xd0 : "green", + 0xe0 : "yellow", + 0xd2 : "flashing green", + 0xd1 : "flashing green", + 0xe2 : "flashing yellow", + 0xe1 : "flashing yellow" + } _global_port_pres_dict = {} - _port_to_i2c_mapping = { 1: 10, 2: 11, @@ -93,6 +110,14 @@ class Chassis(ChassisBase): 34: 2, } + reboot_reason_dict = { 0x11: (ChassisBase.REBOOT_CAUSE_POWER_LOSS, "Power on reset"), + 0x22: (ChassisBase.REBOOT_CAUSE_HARDWARE_OTHER, "Soft-set CPU warm reset"), + 0x33: (ChassisBase.REBOOT_CAUSE_HARDWARE_OTHER, "Soft-set CPU cold reset"), + 0x66: (ChassisBase.REBOOT_CAUSE_WATCHDOG, "GPIO watchdog reset"), + 0x77: (ChassisBase.REBOOT_CAUSE_POWER_LOSS, "Power cycle reset"), + 0x88: (ChassisBase.REBOOT_CAUSE_WATCHDOG, "CPLD watchdog reset") + } + def __init__(self): ChassisBase.__init__(self) # sfp.py will read eeprom contents and retrive the eeprom data. @@ -104,7 +129,7 @@ def __init__(self): eeprom_base = "/sys/class/i2c-adapter/i2c-{0}/{0}-0050/eeprom" for index in range(self.PORT_START, self.PORTS_IN_BLOCK): eeprom_path = eeprom_base.format(self._port_to_i2c_mapping[index]) - port_type = 'SFP' if index in _sfp_port else 'QSFP' + port_type = 'SFP' if index in _sfp_port else 'QSFP_DD' sfp_node = Sfp(index, port_type, eeprom_path) self._sfp_list.append(sfp_node) @@ -183,7 +208,7 @@ def get_sfp(self, index): # The index will start from 0 sfp = self._sfp_list[index-1] except IndexError: - sys.stderr.write("SFP index {} out of range (0-{})\n".format( + sys.stderr.write("SFP index {} out of range (1-{})\n".format( index, len(self._sfp_list))) return sfp @@ -245,6 +270,15 @@ def get_serial_number(self): """ return self._eeprom.serial_number_str() + def get_revision(self): + """ + Retrieves the hardware revision of the device + + Returns: + string: Revision value of device + """ + return self._eeprom.revision_str() + def get_system_eeprom_info(self): """ Retrieves the full content of system EEPROM information for the chassis @@ -295,25 +329,59 @@ def get_reboot_cause(self): except EnvironmentError: return (self.REBOOT_CAUSE_NON_HARDWARE, None) - if reboot_cause & 0x1: - return (self.REBOOT_CAUSE_POWER_LOSS, None) - elif reboot_cause & 0x2: - return (self.REBOOT_CAUSE_NON_HARDWARE, None) - elif reboot_cause & 0x44: - return (self.REBOOT_CAUSE_HARDWARE_OTHER, "CPU warm reset") - elif reboot_cause & 0x8: - return (self.REBOOT_CAUSE_THERMAL_OVERLOAD_CPU, None) - elif reboot_cause & 0x66: - return (self.REBOOT_CAUSE_WATCHDOG, None) - elif reboot_cause & 0x55: - return (self.REBOOT_CAUSE_HARDWARE_OTHER, "CPU cold reset") - elif reboot_cause & 0x11: - return (self.REBOOT_CAUSE_HARDWARE_OTHER, "Power on reset") - elif reboot_cause & 0x77: - return (self.REBOOT_CAUSE_HARDWARE_OTHER, "Power Cycle reset") + if reboot_cause in self.reboot_reason_dict.keys(): + return self.reboot_reason_dict.get(reboot_cause) else: return (self.REBOOT_CAUSE_NON_HARDWARE, None) def get_qualified_media_list(self): return media_part_num_list + + def initizalize_system_led(self): + self.sys_ledcolor = "green" + + def get_status_led(self): + """ + Gets the current system LED color + + Returns: + A string that represents the supported color + """ + val = hwaccess.io_reg_read(self.io_res, self.sysled_offset) + if val != -1: + return self.REG_TO_SYSLED_COLOR.get(val) + return self.sys_ledcolor + + def set_status_led(self, color): + """ + Set system LED status based on the color type passed in the argument. + Argument: Color to be set + Returns: + bool: True is specified color is set, Otherwise return False + """ + + if color not in list(self.SYSLED_COLOR_TO_REG.keys()): + return False + + if(not hwaccess.io_reg_write(self.io_res, self.sysled_offset, self.SYSLED_COLOR_TO_REG[color])): + return False + self.sys_ledcolor = color + return True + + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device. + Returns: + integer: The 1-based relative physical position in parent + device or -1 if cannot determine the position + """ + return -1 + + def is_replaceable(self): + """ + Indicate whether Chassis is replaceable. + Returns: + bool: True if it is replaceable. + """ + return False diff --git a/platform/broadcom/sonic-platform-modules-dell/z9332f/sonic_platform/component.py b/platform/broadcom/sonic-platform-modules-dell/z9332f/sonic_platform/component.py index 58c944cd6eb3..306749270d26 100644 --- a/platform/broadcom/sonic-platform-modules-dell/z9332f/sonic_platform/component.py +++ b/platform/broadcom/sonic-platform-modules-dell/z9332f/sonic_platform/component.py @@ -10,28 +10,49 @@ ######################################################################## try: + import json + import os + import re import subprocess + import tarfile + import tempfile from sonic_platform_base.component_base import ComponentBase import sonic_platform.hwaccess as hwaccess - except ImportError as e: raise ImportError(str(e) + "- required module not found") def get_bios_version(): - return subprocess.check_output(['dmidecode', '-s', 'bios-version']).strip() + try: + return subprocess.check_output(['dmidecode', '-s', 'bios-version'], + text=True).strip() + except (FileNotFoundError, subprocess.CalledProcessError): + return 'NA' def get_fpga_version(): val = hwaccess.pci_get_value('/sys/bus/pci/devices/0000:09:00.0/resource0', 0) - return '{}.{}'.format((val >> 8) & 0xff, val & 0xff) - + return '{}.{}'.format((val >> 16) & 0xffff, val & 0xffff) + def get_bmc_version(): - return subprocess.check_output( - ['cat', '/sys/class/ipmi/ipmi0/device/bmc/firmware_revision'] - ).strip() + val = 'NA' + try: + bmc_ver = subprocess.check_output(['ipmitool', 'mc', 'info'], + stderr=subprocess.STDOUT, text=True) + except (FileNotFoundError, subprocess.CalledProcessError): + pass + else: + version = re.search(r'Firmware Revision\s*:\s(.*)', bmc_ver) + if version: + val = version.group(1).strip() + + return val def get_cpld_version(bus, i2caddr): - return '{}'.format(hwaccess.i2c_get(bus, i2caddr, 0)) + val = hwaccess.i2c_get(bus, i2caddr, 0) + if val != -1: + return '{:x}.{:x}'.format((val >> 4) & 0xf, val & 0xf) + else: + return 'NA' def get_cpld0_version(): return get_cpld_version(5, 0x0d) @@ -42,6 +63,31 @@ def get_cpld1_version(): def get_cpld2_version(): return get_cpld_version(4, 0x31) +def get_ssd_version(): + val = 'NA' + try: + ssd_ver = subprocess.check_output(['ssdutil','-v'], text=True) + except Exception: + return val + else: + version = re.search(r'Firmware\s*:(.*)',ssd_ver) + if version: + val = version.group(1).strip() + + return val + +def get_pciephy_version(): + val = 'NA' + try: + pcie_ver = subprocess.check_output('bcmcmd "pciephy fw version"', shell=True, text=True) + except Exception: + return val + else: + version = re.search(r'PCIe FW version:\s(.*)', pcie_ver) + if version: + val = version.group(1).strip() + + return val class Component(ComponentBase): @@ -69,23 +115,98 @@ class Component(ComponentBase): ], ['Switch CPLD 1', - 'Used for managing QSFP28/SFP port transceivers ', + 'Used for managing QSFP-DD/QSFP28/SFP port transceivers ', get_cpld1_version ], ['Switch CPLD 2', - 'Used for managing QSFP28/SFP port transceivers', + 'Used for managing QSFP-DD/QSFP28/SFP port transceivers', get_cpld2_version - ] + ], + + ['SSD', + 'Solid State Drive that stores data persistently', + get_ssd_version + ], + ['PCIe', + 'ASIC PCIe firmware', + get_pciephy_version + ] ] - def __init__(self, component_index = 0): + def __init__(self, component_index=0): + ComponentBase.__init__(self) self.index = component_index self.name = self.CHASSIS_COMPONENTS[self.index][0] self.description = self.CHASSIS_COMPONENTS[self.index][1] self.version = self.CHASSIS_COMPONENTS[self.index][2]() + @staticmethod + def _get_available_firmware_version(image_path): + if not os.path.isfile(image_path): + return False, "ERROR: File not found" + + with tempfile.TemporaryDirectory() as tmpdir: + cmd = "sed -e '1,/^exit_marker$/d' {} | tar -x -C {} installer/onie-update.tar.xz".format(image_path, tmpdir) + try: + subprocess.check_call(cmd, stdout=subprocess.DEVNULL, + stderr=subprocess.DEVNULL, shell=True) + except subprocess.CalledProcessError: + return False, "ERROR: Unable to extract firmware updater" + + try: + updater = tarfile.open(os.path.join(tmpdir, "installer/onie-update.tar.xz"), "r") + except tarfile.ReadError: + return False, "ERROR: Unable to extract firmware updater" + + try: + ver_info_fd = updater.extractfile("firmware/fw-component-version") + except KeyError: + updater.close() + return False, "ERROR: Version info not available" + + ver_info = json.load(ver_info_fd) + ver_info_fd.close() + updater.close() + + ver_info = ver_info.get("x86_64-dellemc_z9332f_d1508-r0") + if ver_info: + components = list(ver_info.keys()) + for component in components: + if "CPLD" in component and ver_info[component].get('version'): + val = ver_info.pop(component) + ver = int(val['version'], 16) + val['version'] = "{:x}.{:x}".format((ver >> 4) & 0xf, ver & 0xf) + ver_info[component.replace("-", " ")] = val + + return True, ver_info + else: + return False, "ERROR: Version info not available" + + @staticmethod + def _stage_firmware_package(image_path): + stage_msg = None + cmd = "onie_stage_fwpkg -a {}".format(image_path) + try: + subprocess.check_output(cmd.split(), stderr=subprocess.STDOUT, text=True) + except subprocess.CalledProcessError as e: + if e.returncode != 2: + return False, e.output.strip() + else: + stage_msg = e.output.strip() + + cmd = "onie_mode_set -o update" + try: + subprocess.check_output(cmd.split(), stderr=subprocess.STDOUT, text=True) + except subprocess.CalledProcessError as e: + return False, e.output.strip() + + if stage_msg: + return True, stage_msg + else: + return True, "INFO: Firmware upgrade staged" + def get_name(self): """ Retrieves the name of the component @@ -110,12 +231,219 @@ def get_firmware_version(self): """ return self.version + def get_presence(self): + """ + Retrieves the presence of the component + Returns: + bool: True if present, False if not + """ + return True + + def get_model(self): + """ + Retrieves the part number of the component + Returns: + string: Part number of component + """ + return 'NA' + + def get_serial(self): + """ + Retrieves the serial number of the component + Returns: + string: Serial number of component + """ + return 'NA' + + def get_status(self): + """ + Retrieves the operational status of the component + Returns: + bool: True if component is operating properly, False if not + """ + return True + + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device. + Returns: + integer: The 1-based relative physical position in parent + device or -1 if cannot determine the position + """ + return -1 + + def is_replaceable(self): + """ + Indicate whether component is replaceable. + Returns: + bool: True if it is replaceable. + """ + return False + + def get_available_firmware_version(self, image_path): + """ + Retrieves the available firmware version of the component + + Note: the firmware version will be read from image + + Args: + image_path: A string, path to firmware image + + Returns: + A string containing the available firmware version of the component + """ + avail_ver = None + valid, version = self._get_available_firmware_version(image_path) + if valid: + avail_ver = version.get(self.name) + if avail_ver: + avail_ver = avail_ver.get("version") + else: + print(version) + + return avail_ver if avail_ver else "NA" + + def get_firmware_update_notification(self, image_path): + """ + Retrieves a notification on what should be done in order to complete + the component firmware update + + Args: + image_path: A string, path to firmware image + + Returns: + A string containing the component firmware update notification if required. + By default 'None' value will be used, which indicates that no actions are required + """ + valid, version = self._get_available_firmware_version(image_path) + if valid: + avail_ver = version.get(self.name) + if avail_ver: + avail_ver = avail_ver.get("version") + if avail_ver and avail_ver != self.get_firmware_version(): + return "Cold reboot is required to perform firmware upgrade" + else: + print(version) + + return None + def install_firmware(self, image_path): """ Installs firmware to the component + + This API performs firmware installation only: this may/may not be the same as firmware update. + In case platform component requires some extra steps (apart from calling Low Level Utility) + to load the installed firmware (e.g, reboot, power cycle, etc.) - this must be done manually by user + + Note: in case immediate actions are required to complete the component firmware update + (e.g., reboot, power cycle, etc.) - will be done automatically by API and no return value provided + Args: - image_path: A string, path to firmware image + image_path: A string, path to firmware image + Returns: - A boolean, True if install was successful, False if not + A boolean, True if install was successful, False if not """ + valid, version = self._get_available_firmware_version(image_path) + if valid: + avail_ver = version.get(self.name) + if avail_ver: + avail_ver = avail_ver.get("version") + if avail_ver and avail_ver != self.get_firmware_version(): + status, msg = self._stage_firmware_package(image_path) + print(msg) + if status: + return True + else: + return False + + print("INFO: Firmware version up-to-date") + return True + else: + print(version) + return False + + def update_firmware(self, image_path): + """ + Updates firmware of the component + + This API performs firmware update: it assumes firmware installation and loading in a single call. + In case platform component requires some extra steps (apart from calling Low Level Utility) + to load the installed firmware (e.g, reboot, power cycle, etc.) - this will be done automatically by API + + Args: + image_path: A string, path to firmware image + + Raises: + RuntimeError: update failed + """ + valid, version = self._get_available_firmware_version(image_path) + if valid: + avail_ver = version.get(self.name) + if avail_ver: + avail_ver = avail_ver.get("version") + if avail_ver and avail_ver != self.get_firmware_version(): + status, msg = self._stage_firmware_package(image_path) + if status: + print(msg) + subprocess.call("reboot") + else: + raise RuntimeError(msg) + + print("INFO: Firmware version up-to-date") + return None + else: + raise RuntimeError(version) + + def auto_update_firmware(self, image_path, boot_type): + """ + Updates firmware of the component + + This API performs firmware update automatically based on boot_type: it assumes firmware installation + and/or creating a loading task during the reboot, if needed, in a single call. + In case platform component requires some extra steps (apart from calling Low Level Utility) + to load the installed firmware (e.g, reboot, power cycle, etc.) - this will be done automatically during the reboot. + The loading task will be created by API. + + Args: + image_path: A string, path to firmware image + boot_type: A string, reboot type following the upgrade + - none/fast/warm/cold + + Returns: + Output: A return code + return_code: An integer number, status of component firmware auto-update + - return code of a positive number indicates successful auto-update + - status_installed = 1 + - status_updated = 2 + - status_scheduled = 3 + - return_code of a negative number indicates failed auto-update + - status_err_boot_type = -1 + - status_err_image = -2 + - status_err_unknown = -3 + + Raises: + RuntimeError: auto-update failure cause + """ + valid, version = self._get_available_firmware_version(image_path) + if valid: + avail_ver = version.get(self.name) + if avail_ver: + avail_ver = avail_ver.get("version") + if avail_ver and avail_ver != self.get_firmware_version(): + if boot_type != "cold": + return -1 + + status, msg = self._stage_firmware_package(image_path) + if status: + print(msg) + return 3 + else: + raise RuntimeError(msg) + + print("INFO: Firmware version up-to-date") + return 1 + else: + print(version) + return -2 diff --git a/platform/broadcom/sonic-platform-modules-dell/z9332f/sonic_platform/eeprom.py b/platform/broadcom/sonic-platform-modules-dell/z9332f/sonic_platform/eeprom.py index eda04ae3bd8e..fe7da80d012f 100644 --- a/platform/broadcom/sonic-platform-modules-dell/z9332f/sonic_platform/eeprom.py +++ b/platform/broadcom/sonic-platform-modules-dell/z9332f/sonic_platform/eeprom.py @@ -51,13 +51,7 @@ def __init__(self): tlv = eeprom[tlv_index:tlv_index + 2 + eeprom[tlv_index + 1]] code = "0x%02X" % tlv[0] - - if tlv[0] == self._TLV_CODE_VENDOR_EXT: - value = str((tlv[2] << 24) | (tlv[3] << 16) | - (tlv[4] << 8) | tlv[5]) - value += tlv[6:6 + tlv[1]].decode('ascii') - else: - name, value = self.decoder(None, tlv) + name, value = self.decoder(None, tlv) self.eeprom_tlv_dict[code] = value if eeprom[tlv_index] == self._TLV_CODE_CRC_32: @@ -124,7 +118,7 @@ def revision_str(self): Returns the device revision """ (is_valid, results) = self.get_tlv_field( - self.eeprom_data, self._TLV_CODE_DEVICE_VERSION) + self.eeprom_data, self._TLV_CODE_LABEL_REVISION) if not is_valid: return "N/A" diff --git a/platform/broadcom/sonic-platform-modules-dell/z9332f/sonic_platform/fan.py b/platform/broadcom/sonic-platform-modules-dell/z9332f/sonic_platform/fan.py index ff7a08bdd1ad..4fce691c02f1 100755 --- a/platform/broadcom/sonic-platform-modules-dell/z9332f/sonic_platform/fan.py +++ b/platform/broadcom/sonic-platform-modules-dell/z9332f/sonic_platform/fan.py @@ -9,7 +9,7 @@ ######################################################################## try: from sonic_platform_base.fan_base import FanBase - from sonic_platform.ipmihelper import IpmiSensor, IpmiFru, get_ipmitool_raw_output + from sonic_platform.ipmihelper import IpmiSensor, get_ipmitool_raw_output except ImportError as e: raise ImportError(str(e) + "- required module not found") @@ -33,11 +33,8 @@ class Fan(FanBase): PSU_FAN_SENSOR_MAPPING = { 1: {"State": 0x2f, "Speed": 0x33}, 2: {"State": 0x39, "Speed": 0x3d} } - # { FANTRAY-ID: FRU-ID } - FAN_FRU_MAPPING = { 1: 6, 2: 7, 3: 8, 4: 9, 5: 10, 6: 11, 7: 12 } - PSU_FRU_MAPPING = { 1: 3, 2: 4 } - def __init__(self, fantray_index=1, fan_index=1, psu_fan=False, dependency=None): + FanBase.__init__(self) self.is_psu_fan = psu_fan if not self.is_psu_fan: # API index is starting from 0, DellEMC platform index is @@ -50,17 +47,19 @@ def __init__(self, fantray_index=1, fan_index=1, psu_fan=False, dependency=None) self.state_sensor = IpmiSensor(self.FAN_SENSOR_MAPPING[self.index]["State"], is_discrete=True) self.speed_sensor = IpmiSensor(self.FAN_SENSOR_MAPPING[self.index]["Speed"]) - self.fru = IpmiFru(self.FAN_FRU_MAPPING[self.fantrayindex]) self.fan_dir_raw_cmd = "0x3a 0x0a {}".format(fantray_index) + if self.fanindex == 1: + self.max_speed = 24700 + else: + self.max_speed = 29700 else: self.dependency = dependency self.fanindex = fan_index self.state_sensor = IpmiSensor(self.PSU_FAN_SENSOR_MAPPING[self.fanindex]["State"], is_discrete=True) self.speed_sensor = IpmiSensor(self.PSU_FAN_SENSOR_MAPPING[self.fanindex]["Speed"]) - self.fru = IpmiFru(self.PSU_FRU_MAPPING[self.fanindex]) self.fan_dir_raw_cmd = "0x3a 0x0a {}".format(7+(fan_index-1)) - self.max_speed = 23500 + self.max_speed = 26500 def get_name(self): """ @@ -79,10 +78,7 @@ def get_model(self): Returns: String: Part number of FAN """ - if self.is_psu_fan: - return None - else: - return self.fru.get_board_part_number() + return 'NA' def get_serial(self): """ @@ -90,10 +86,7 @@ def get_serial(self): Returns: String: Serial number of FAN """ - if self.is_psu_fan: - return None - else: - return self.fru.get_board_serial() + return 'NA' def get_presence(self): """ @@ -158,7 +151,7 @@ def get_speed(self): if not is_valid or self.max_speed == 0: return None else: - speed = (100 * fan_speed)/self.max_speed + speed = (100 * fan_speed)//self.max_speed return speed def get_speed_rpm(self): @@ -169,3 +162,48 @@ def get_speed_rpm(self): """ is_valid, fan_speed = self.speed_sensor.get_reading() return fan_speed if is_valid else None + + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device. + Returns: + integer: The 1-based relative physical position in parent + device or -1 if cannot determine the position + """ + return self.fanindex + + def is_replaceable(self): + """ + Indicate whether Fan is replaceable. + Returns: + bool: True if it is replaceable. + """ + return False + + def get_speed_tolerance(self): + """ + Retrieves the speed tolerance of the fan + Returns: + An integer, the percentage of variance from target speed which is + considered tolerable + """ + if self.get_presence(): + # The tolerance value is fixed as 20% for all the DellEMC platforms + tolerance = 20 + else: + tolerance = 0 + + return tolerance + + def set_status_led(self, color): + """ + Set led to expected color + Args: + color: A string representing the color with which to set the + fan status LED + Returns: + bool: True if set success, False if fail. + """ + # Fan tray status LED controlled by HW + # Return True to avoid thermalctld alarm + return True diff --git a/platform/broadcom/sonic-platform-modules-dell/z9332f/sonic_platform/fan_drawer.py b/platform/broadcom/sonic-platform-modules-dell/z9332f/sonic_platform/fan_drawer.py index 0fdc80e651ed..98d9f95c53fb 100644 --- a/platform/broadcom/sonic-platform-modules-dell/z9332f/sonic_platform/fan_drawer.py +++ b/platform/broadcom/sonic-platform-modules-dell/z9332f/sonic_platform/fan_drawer.py @@ -11,6 +11,7 @@ try: from sonic_platform_base.fan_drawer_base import FanDrawerBase from sonic_platform.fan import Fan + from sonic_platform.ipmihelper import IpmiFru except ImportError as e: raise ImportError(str(e) + "- required module not found") @@ -20,6 +21,7 @@ class FanDrawer(FanDrawerBase): """DellEMC Platform-specific Fan class""" + FAN_FRU_MAPPING = { 1: 6, 2: 7, 3: 8, 4: 9, 5: 10, 6: 11, 7: 12 } def __init__(self, fantray_index): FanDrawerBase.__init__(self) @@ -27,6 +29,7 @@ def __init__(self, fantray_index): self.fantrayindex = fantray_index + 1 for i in range(Z9332F_FANS_PER_FANTRAY): self._fan_list.append(Fan(fantray_index, i)) + self.fru = IpmiFru(self.FAN_FRU_MAPPING[self.fantrayindex]) def get_name(self): """ @@ -35,3 +38,78 @@ def get_name(self): string: The name of the device """ return "FanTray{}".format(self.fantrayindex) + + def get_presence(self): + """ + Retrieves the presence of the fan drawer + Returns: + bool: True if fan_tray is present, False if not + """ + return self.get_fan(0).get_presence() + + def get_model(self): + """ + Retrieves the part number of the fan drawer + Returns: + string: Part number of fan drawer + """ + return self.fru.get_board_part_number() + + def get_serial(self): + """ + Retrieves the serial number of the fan drawer + Returns: + string: Serial number of the fan drawer + """ + return self.fru.get_board_serial() + + def get_status(self): + """ + Retrieves the operational status of the fan drawer + Returns: + bool: True if fan drawer is operating properly, False if not + """ + status = True + for fan in self.get_all_fans(): + status &= fan.get_status() + return status + + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device. + Returns: + integer: The 1-based relative physical position in parent + device or -1 if cannot determine the position + """ + return self.fantrayindex + + def is_replaceable(self): + """ + Indicate whether this fan drawer is replaceable. + Returns: + bool: True if it is replaceable, False if not + """ + return True + + def set_status_led(self, color): + """ + Set led to expected color + Args: + color: A string representing the color with which to set the + fan module status LED + Returns: + bool: True if set success, False if fail. + """ + # Fan tray status LED controlled by BMC + # Return True to avoid thermalctld alarm + return True + + def get_maximum_consumed_power(self): + """ + Retrives the maximum power drawn by Fan Drawer + + Returns: + A float, with value of the maximum consumable power of the + component. + """ + return 36.0 diff --git a/platform/broadcom/sonic-platform-modules-dell/z9332f/sonic_platform/ipmihelper.py b/platform/broadcom/sonic-platform-modules-dell/z9332f/sonic_platform/ipmihelper.py deleted file mode 100644 index ceeaebfbf047..000000000000 --- a/platform/broadcom/sonic-platform-modules-dell/z9332f/sonic_platform/ipmihelper.py +++ /dev/null @@ -1,269 +0,0 @@ -#!/usr/bin/python3 - -######################################################################## -# DellEMC -# -# Module contains implementation of IpmiSensor and IpmiFru classes that -# provide Sensor's and FRU's information respectively. -# -######################################################################## - -import subprocess -import re - -# IPMI Request Network Function Codes -NetFn_SensorEvent = 0x04 -NetFn_Storage = 0x0A - -# IPMI Sensor Device Commands -Cmd_GetSensorReadingFactors = 0x23 -Cmd_GetSensorThreshold = 0x27 -Cmd_GetSensorReading = 0x2D - -# IPMI FRU Device Commands -Cmd_ReadFRUData = 0x11 - -def get_ipmitool_raw_output(args): - """ - Returns a list the elements of which are the individual bytes of - ipmitool raw command output. - """ - result_bytes = list() - result = "" - command = "ipmitool raw {}".format(args) - try: - proc = subprocess.Popen(command.split(), stdout=subprocess.PIPE, - stderr=subprocess.STDOUT) - stdout = proc.communicate()[0] - proc.wait() - if not proc.returncode: - result = stdout.rstrip('\n') - except EnvironmentError: - pass - - for i in result.split(): - result_bytes.append(int(i, 16)) - - return result_bytes - -class IpmiSensor(object): - - # Sensor Threshold types and their respective bit masks - THRESHOLD_BIT_MASK = { - "LowerNonCritical" : 0, - "LowerCritical" : 1, - "LowerNonRecoverable" : 2, - "UpperNonCritical" : 3, - "UpperCritical" : 4, - "UpperNonRecoverable" : 5 - } - - def __init__(self, sensor_id, is_discrete=False): - self.id = sensor_id - self.is_discrete = is_discrete - - def _get_converted_sensor_reading(self, raw_value): - """ - Returns a 2 element tuple(bool, int) in which first element - provides the validity of the reading and the second element is - the converted sensor reading - """ - # Get Sensor Reading Factors - cmd_args = "{} {} {} {}".format(NetFn_SensorEvent, - Cmd_GetSensorReadingFactors, - self.id, raw_value) - factors = get_ipmitool_raw_output(cmd_args) - - if len(factors) != 7: - return False, 0 - - # Compute Twos complement - def get_twos_complement(val, bits): - if val & (1 << (bits - 1)): - val = val - (1 << bits) - return val - - # Calculate actual sensor value from the raw sensor value - # using the sensor reading factors. - M = get_twos_complement(((factors[2] & 0xC0) << 8) | factors[1], 10) - B = get_twos_complement(((factors[4] & 0xC0) << 8) | factors[3], 10) - R_exp = get_twos_complement((factors[6] & 0xF0) >> 4, 4) - B_exp = get_twos_complement(factors[6] & 0x0F, 4) - - converted_reading = ((M * raw_value) + (B * 10**B_exp)) * 10**R_exp - - return True, converted_reading - - def get_reading(self): - """ - For Threshold sensors, returns the sensor reading. - For Discrete sensors, returns the state value. - - Returns: - A tuple (bool, int) where the first element provides the - validity of the reading and the second element provides the - sensor reading/state value. - """ - # Get Sensor Reading - cmd_args = "{} {} {}".format(NetFn_SensorEvent, Cmd_GetSensorReading, - self.id) - output = get_ipmitool_raw_output(cmd_args) - if len(output) != 4: - return False, 0 - - # Check reading/state unavailable - if output[1] & 0x20: - return False, 0 - - if self.is_discrete: - state = ((output[3] & 0x7F) << 8) | output[2] - return True, state - else: - return self._get_converted_sensor_reading(output[0]) - - def get_threshold(self, threshold_type): - """ - Returns the sensor's threshold value for a given threshold type. - - Args: - threshold_type (str) - one of the below mentioned - threshold type strings - - "LowerNonCritical" - "LowerCritical" - "LowerNonRecoverable" - "UpperNonCritical" - "UpperCritical" - "UpperNonRecoverable" - Returns: - A tuple (bool, int) where the first element provides the - validity of that threshold and second element provides the - threshold value. - """ - # Thresholds are not valid for discrete sensors - if self.is_discrete: - raise TypeError("Threshold is not applicable for Discrete Sensor") - - if threshold_type not in list(self.THRESHOLD_BIT_MASK.keys()): - raise ValueError("Invalid threshold type {} provided. Valid types " - "are {}".format(threshold_type, - list(self.THRESHOLD_BIT_MASK.keys()))) - - bit_mask = self.THRESHOLD_BIT_MASK[threshold_type] - - # Get Sensor Threshold - cmd_args = "{} {} {}".format(NetFn_SensorEvent, Cmd_GetSensorThreshold, - self.id) - thresholds = get_ipmitool_raw_output(cmd_args) - if len(thresholds) != 7: - return False, 0 - - valid_thresholds = thresholds.pop(0) - # Check whether particular threshold is readable - if valid_thresholds & (1 << bit_mask): - return self._get_converted_sensor_reading(thresholds[bit_mask]) - else: - return False, 0 - -class IpmiFru(object): - - def __init__(self, fru_id): - self.id = fru_id - - def _get_ipmitool_fru_print(self): - result = "" - command = "ipmitool fru print {}".format(self.id) - try: - proc = subprocess.Popen(command.split(), stdout=subprocess.PIPE, - stderr=subprocess.STDOUT) - stdout = proc.communicate()[0] - proc.wait() - if not proc.returncode: - result = stdout.decode('utf-8').rstrip('\n') - except EnvironmentError: - pass - - return result - - def _get_from_fru(self, info): - """ - Returns a string containing the info from FRU - """ - fru_output = self._get_ipmitool_fru_print() - if not fru_output: - return "NA" - - info_req = re.search(r"%s\s*:(.*)" % info, fru_output) - if not info_req: - return "NA" - - return info_req.group(1).strip() - - def get_board_serial(self): - """ - Returns a string containing the Serial Number of the device. - """ - return self._get_from_fru('Board Serial') - - def get_board_part_number(self): - """ - Returns a string containing the Part Number of the device. - """ - return self._get_from_fru('Board Part Number') - - def get_board_mfr_id(self): - """ - Returns a string containing the manufacturer id of the FRU. - """ - return self._get_from_fru('Board Mfg') - - def get_board_product(self): - """ - Returns a string containing the manufacturer id of the FRU. - """ - return self._get_from_fru('Board Product') - - def get_fru_data(self, offset, count=1): - """ - Reads and returns the FRU data at the provided offset. - - Args: - offset (int) - FRU offset to read - count (int) - Number of bytes to read [optional, default = 1] - Returns: - A tuple (bool, list(int)) where the first element provides - the validity of the data read and the second element is a - list, the elements of which are the individual bytes of the - FRU data read. - """ - result_bytes = list() - is_valid = True - result = "" - - offset_LSB = offset & 0xFF - offset_MSB = offset & 0xFF00 - command = "ipmitool raw {} {} {} {} {} {}".format(NetFn_Storage, - Cmd_ReadFRUData, - self.id, offset_LSB, - offset_MSB, count) - try: - proc = subprocess.Popen(command.split(), stdout=subprocess.PIPE, - stderr=subprocess.STDOUT) - stdout = proc.communicate()[0] - proc.wait() - if not proc.returncode: - result = stdout.decode('utf-8').rstrip('\n') - except EnvironmentError: - is_valid = False - - if (not result) or (not is_valid): - return False, result_bytes - - for i in result.split(): - result_bytes.append(int(i, 16)) - - read_count = result_bytes.pop(0) - if read_count != count: - return False, result_bytes - else: - return True, result_bytes diff --git a/platform/broadcom/sonic-platform-modules-dell/z9332f/sonic_platform/psu.py b/platform/broadcom/sonic-platform-modules-dell/z9332f/sonic_platform/psu.py index 3be32043ade8..5aeebd4144b2 100644 --- a/platform/broadcom/sonic-platform-modules-dell/z9332f/sonic_platform/psu.py +++ b/platform/broadcom/sonic-platform-modules-dell/z9332f/sonic_platform/psu.py @@ -21,9 +21,12 @@ class Psu(PsuBase): # { PSU-ID: { Sensor-Name: Sensor-ID } } SENSOR_MAPPING = { 1: { "State": 0x2f, "Current": 0x37, - "Power": 0x38, "Voltage": 0x36 }, + "Power": 0x38, "Voltage": 0x36, + "Temperature": 0x35 }, 2: { "State": 0x39, "Current": 0x41, - "Power": 0x42, "Voltage": 0x40 } } + "Power": 0x42, "Voltage": 0x40, + "Temperature": 0x3F } } + # ( PSU-ID: FRU-ID } FRU_MAPPING = { 1: 3, 2: 4 } @@ -36,6 +39,7 @@ def __init__(self, psu_index): self.voltage_sensor = IpmiSensor(self.SENSOR_MAPPING[self.index]["Voltage"]) self.current_sensor = IpmiSensor(self.SENSOR_MAPPING[self.index]["Current"]) self.power_sensor = IpmiSensor(self.SENSOR_MAPPING[self.index]["Power"]) + self.temp_sensor = IpmiSensor(self.SENSOR_MAPPING[self.index ]["Temperature"]) self.fru = IpmiFru(self.FRU_MAPPING[self.index]) self.psu_type_raw_cmd = "0x3A 0x0B {}".format(psu_index+1) @@ -83,6 +87,19 @@ def get_serial(self): """ return self.fru.get_board_serial() + def get_revision(self): + """ + Retrieves the hardware revision of the device + + Returns: + string: Revision value of device + """ + serial = self.fru.get_board_serial() + if serial != "NA" and len(serial) == 23: + return serial[-3:] + else: + return "NA" + def get_status(self): """ Retrieves the operational status of the PSU @@ -110,7 +127,56 @@ def get_voltage(self): if not is_valid: return None - return "{:.1f}".format(voltage) + return float(voltage) + + def get_voltage_low_threshold(self): + """ + Returns PSU low threshold in Volts + """ + is_valid, low_threshold = self.voltage_sensor.get_threshold("LowerCritical") + if not is_valid: + low_threshold = 11.4 + low_threshold = "{:.2f}".format(low_threshold) + + return float(low_threshold) + + + def get_voltage_high_threshold(self): + """ + Returns PSU high threshold in Volts + """ + is_valid, high_threshold = self.voltage_sensor.get_threshold("UpperCritical") + if not is_valid: + high_threshold = 12.6 + high_threshold = "{:.2f}".format(high_threshold) + + return float(high_threshold) + + def get_temperature(self): + """ + Retrieves current temperature reading from thermal + + Returns: + A float number of current temperature in Celsius up to + nearest thousandth of one degree Celsius, e.g. 30.125 + """ + is_valid, temperature = self.temp_sensor.get_reading() + if not is_valid: + temperature = 0 + + return float(temperature) + + def get_temperature_high_threshold(self): + """ + Returns the high temperature threshold for PSU in Celsius + """ + is_valid, high_threshold = self.temp_sensor.get_threshold("UpperCritical") + if not is_valid: + high_threshold = 113 + high_threshold = "{:.2f}".format(high_threshold) + + return float(high_threshold) + def get_current(self): """ @@ -124,7 +190,7 @@ def get_current(self): if not is_valid: return None - return "{:.1f}".format(current) + return float(current) def get_power(self): """ @@ -138,7 +204,21 @@ def get_power(self): if not is_valid: return None - return "{:.1f}".format(power) + return float(power) + + def get_maximum_supplied_power(self): + """ + Retrieves the maximum supplied power by PSU + + Returns: + A float number, the maximum power output in Watts. + e.g. 1200.1 + """ + is_valid, power = self.power_sensor.get_threshold("UpperCritical") + if not is_valid: + return None + + return float(power) def get_powergood_status(self): """ @@ -177,3 +257,20 @@ def get_type(self): if type_res is not None and len(type_res) == 1 : return psu_type[type_res[0]] return None + + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device. + Returns: + integer: The 1-based relative physical position in parent + device or -1 if cannot determine the position + """ + return self.index + + def is_replaceable(self): + """ + Indicate whether this PSU is replaceable. + Returns: + bool: True if it is replaceable. + """ + return True diff --git a/platform/broadcom/sonic-platform-modules-dell/z9332f/sonic_platform/sfp.py b/platform/broadcom/sonic-platform-modules-dell/z9332f/sonic_platform/sfp.py index ccd1d642640f..c0ee8bdb84f6 100644 --- a/platform/broadcom/sonic-platform-modules-dell/z9332f/sonic_platform/sfp.py +++ b/platform/broadcom/sonic-platform-modules-dell/z9332f/sonic_platform/sfp.py @@ -1,7 +1,7 @@ #!/usr/bin/env python ############################################################################# -# DELLEMC S5248F +# DELLEMC Z9332F # # Module contains an implementation of SONiC Platform Base API and # provides the platform information @@ -10,8 +10,9 @@ try: import os + import re import time - import struct + import subprocess import mmap from sonic_platform_base.sfp_base import SfpBase from sonic_platform_base.sonic_sfp.sff8436 import sff8436InterfaceId @@ -19,23 +20,48 @@ from sonic_platform_base.sonic_sfp.sff8472 import sff8472InterfaceId from sonic_platform_base.sonic_sfp.sff8472 import sff8472Dom from sonic_platform_base.sonic_sfp.sff8472 import sffbase + from sonic_platform_base.sonic_sfp.qsfp_dd import qsfp_dd_InterfaceId + from sonic_platform_base.sonic_sfp.sff8024 import type_of_media_interface + from sonic_platform_base.sonic_sfp.qsfp_dd import qsfp_dd_Dom except ImportError as e: raise ImportError(str(e) + "- required module not found") -# Enabled when ext_media is available -#ext_media_module = None -#try: -# import ext_media_api as ext_media_module -#except : -# ext_media_module = None -# pass - PAGE_OFFSET = 0 KEY_OFFSET = 1 KEY_WIDTH = 2 FUNC_NAME = 3 +QSFP_DD_PAGE0 = 0 +QSFP_DD_PAGE1 = 128 +QSFP_DD_PAGE2 = 256 +QSFP_DD_PAGE3 = 384 +QSFP_DD_PAGE17 = 2176 +QSFP_DD_DOM_CAPABILITY_OFFSET = 2 +QSFP_DD_DOM_CAPABILITY_WIDTH = 1 +QSFP_DD_TEMP_OFFSET = 14 +QSFP_DD_TEMP_WIDTH = 2 +QSFP_DD_VOLT_OFFSET = 16 +QSFP_DD_VOLT_WIDTH = 2 +QSFP_DD_TXBIAS_OFFSET = 170 +QSFP_DD_TXBIAS_WIDTH = 16 +QSFP_DD_TXPOWER_OFFSET = 154 +QSFP_DD_TXPOWER_WIDTH = 16 +QSFP_DD_RXPOWER_OFFSET = 186 +QSFP_DD_RXPOWER_WIDTH = 16 +QSFP_DD_RXLOS_OFFSET = 19 +QSFP_DD_RXLOS_WIDTH = 1 +QSFP_DD_TX_DISABLE_OFFSET = 86 +QSFP_DD_TX_DISABLE_WIDTH = 1 +QSFP_DD_MEDIA_TYPE_OFFSET = 85 +QSFP_DD_MEDIA_TYPE_WIDTH = 1 +QSFP_DD_APP1_ADV_OFFSET = 86 +QSFP_DD_APP1_ADV_WIDTH = 32 +QSFP_DD_APP2_ADV_OFFSET = 351 +QSFP_DD_APP2_ADV_WIDTH = 28 +QSFP_DD_MODULE_ENC_OFFSET = 3 +QSFP_DD_MODULE_ENC_WIDTH = 1 + QSFP_INFO_OFFSET = 128 QSFP_DOM_OFFSET = 0 QSFP_DOM_OFFSET1 = 384 @@ -44,7 +70,7 @@ SFP_DOM_OFFSET = 256 SFP_STATUS_CONTROL_OFFSET = 110 -SFP_STATUS_CONTROL_WIDTH = 7 +SFP_STATUS_CONTROL_WIDTH = 1 SFP_TX_DISABLE_HARD_BIT = 7 SFP_TX_DISABLE_SOFT_BIT = 6 @@ -74,15 +100,20 @@ 'manufacturer', 'model', 'connector', 'encoding', 'ext_identifier', 'ext_rateselect_compliance', 'cable_type', 'cable_length', 'nominal_bit_rate', - 'specification_compliance', 'type_abbrv_name','vendor_date', 'vendor_oui'] + 'specification_compliance', 'type_abbrv_name', 'vendor_date', + 'vendor_oui', 'application_advertisement'] dom_dict_keys = ['rx_los', 'tx_fault', 'reset_status', 'power_lpmode', 'tx_disable', 'tx_disable_channel', 'temperature', 'voltage', 'rx1power', 'rx2power', 'rx3power', 'rx4power', - 'tx1bias', 'tx2bias', 'tx3bias', - 'tx4bias', 'tx1power', 'tx2power', - 'tx3power', 'tx4power'] + 'rx5power', 'rx6power', 'rx7power', + 'rx8power', 'tx1bias', 'tx2bias', + 'tx3bias', 'tx4bias', 'tx5bias', + 'tx6bias', 'tx7bias', 'tx8bias', + 'tx1power', 'tx2power', 'tx3power', + 'tx4power', 'tx5power', 'tx6power', + 'tx7power', 'tx8power'] threshold_dict_keys = ['temphighalarm', 'temphighwarning', 'templowalarm', 'templowwarning', @@ -94,6 +125,22 @@ 'txpowerlowalarm', 'txpowerlowwarning', 'txbiashighalarm', 'txbiashighwarning', 'txbiaslowalarm', 'txbiaslowwarning'] +qsfp_dd_parser = { + 'ChannelThreshold': [QSFP_DD_PAGE3, 0, 72, 'parse_module_threshold_values'], + 'cable_length': [QSFP_DD_PAGE1, 74, 1, 'parse_cable_len'], + 'connector': [QSFP_DD_PAGE1, 75, 1, 'parse_connector'], + 'type': [QSFP_DD_PAGE1, 0, 1, 'parse_sfp_type'], + 'ext_identifier': [QSFP_DD_PAGE1, 72, 2, 'parse_ext_iden'], + 'type_abbrv_name': [QSFP_DD_PAGE1, 0, 21, 'parse_sfp_type_abbrv_name'], + 'manufacturer': [QSFP_DD_PAGE1, 1, 16, 'parse_vendor_name'], + 'vendor_oui': [QSFP_DD_PAGE1, 17, 3, 'parse_vendor_oui'], + 'model': [QSFP_DD_PAGE1, 20, 16, 'parse_vendor_pn'], + 'hardware_rev': [QSFP_DD_PAGE1, 36, 2, 'parse_vendor_rev'], + 'serial': [QSFP_DD_PAGE1, 38, 16, 'parse_vendor_sn'], + 'vendor_date': [QSFP_DD_PAGE1, 54, 8, 'parse_vendor_date'], + 'ModuleThreshold': [QSFP_DD_PAGE3, 0, 72, 'parse_module_threshold_values'], + 'dom_capability': [QSFP_DD_PAGE0, 2 , 1, 'parse_dom_capability'], +} sff8436_parser = { 'reset_status': [QSFP_DOM_OFFSET, 2, 1, 'parse_dom_status_indicator'], @@ -105,9 +152,8 @@ 'Temperature': [QSFP_DOM_OFFSET, 22, 2, 'parse_temperature'], 'Voltage': [QSFP_DOM_OFFSET, 26, 2, 'parse_voltage'], 'ChannelMonitor': [QSFP_DOM_OFFSET, 34, 16, 'parse_channel_monitor_params'], - 'ChannelMonitor_TxPower': + 'ChannelMonitor_TxPower': [QSFP_DOM_OFFSET, 34, 24, 'parse_channel_monitor_params_with_tx_power'], - 'cable_type': [QSFP_INFO_OFFSET, -1, -1, 'parse_sfp_info_bulk'], 'cable_length': [QSFP_INFO_OFFSET, -1, -1, 'parse_sfp_info_bulk'], 'connector': [QSFP_INFO_OFFSET, 0, 20, 'parse_sfp_info_bulk'], @@ -126,7 +172,7 @@ 'hardware_rev': [QSFP_INFO_OFFSET, 56, 2, 'parse_vendor_rev'], 'serial': [QSFP_INFO_OFFSET, 68, 16, 'parse_vendor_sn'], 'vendor_date': [QSFP_INFO_OFFSET, 84, 8, 'parse_vendor_date'], - 'dom_capability': [QSFP_INFO_OFFSET, 92, 1, 'parse_qsfp_dom_capability'], + 'dom_capability': [QSFP_INFO_OFFSET, 92, 1, 'parse_dom_capability'], 'dom_rev': [QSFP_DOM_OFFSET, 1, 1, 'parse_sfp_dom_rev'], 'ModuleThreshold': [QSFP_DOM_OFFSET1, 128, 24, 'parse_module_threshold_values'], 'ChannelThreshold': [QSFP_DOM_OFFSET1, 176, 16, 'parse_channel_threshold_values'], @@ -157,6 +203,24 @@ 'vendor_date': [SFP_INFO_OFFSET, 84, 8, 'parse_vendor_date'], 'ModuleThreshold': [SFP_DOM_OFFSET, 0, 56, 'parse_alarm_warning_threshold'], } +MEDIA_TYPE_OFFSET = 0 +MEDIA_TYPE_WIDTH = 1 + +SFP_TYPE_LIST = [ + '03' # SFP/SFP+/SFP28 and later +] +QSFP_TYPE_LIST = [ + '0c', # QSFP + '0d', # QSFP+ or later + '11' # QSFP28 or later +] +QSFP_DD_TYPE_LIST = [ + '18' #QSFP_DD Type +] +OSFP_TYPE_LIST=[ + '19' # OSFP 8X Type +] + class Sfp(SfpBase): @@ -164,32 +228,96 @@ class Sfp(SfpBase): DELLEMC Platform-specific Sfp class """ BASE_RES_PATH = "/sys/bus/pci/devices/0000:09:00.0/resource0" + _port_to_i2c_mapping = { + 1: 10, + 2: 11, + 3: 12, + 4: 13, + 5: 14, + 6: 15, + 7: 16, + 8: 17, + 9: 18, + 10: 19, + 11: 20, + 12: 21, + 13: 22, + 14: 23, + 15: 24, + 16: 25, + 17: 26, + 18: 27, + 19: 28, + 20: 29, + 21: 30, + 22: 31, + 23: 32, + 24: 33, + 25: 34, + 26: 35, + 27: 36, + 28: 37, + 29: 38, + 30: 39, + 31: 40, + 32: 41, + 33: 1, + 34: 2 + } def __init__(self, index, sfp_type, eeprom_path): SfpBase.__init__(self) - self.sfp_type = sfp_type self.index = index self.eeprom_path = eeprom_path + #port_type is the native port type and sfp_type is the transceiver type + #sfp_type will be detected in get_transceiver_info + self.port_type = sfp_type + self.sfp_type = self.port_type self.qsfpInfo = sff8436InterfaceId() self.qsfpDomInfo = sff8436Dom() self.sfpInfo = sff8472InterfaceId() self.sfpDomInfo = sff8472Dom(None,1) + self.qsfp_dd_Info = qsfp_dd_InterfaceId() + self.qsfp_dd_DomInfo = qsfp_dd_Dom() + self.qsfp_dd_app2_list = False + self.qsfp_dd_rxpower_supported = False + self.qsfp_dd_txpower_supported = False + self.qsfp_dd_txbias_supported = False def get_eeprom_sysfs_path(self): return self.eeprom_path + def detect_dom_capability(self): + if self.sfp_type == 'QSFP_DD': + offset = 0 + qsfp_dom_capability_raw = self._read_eeprom_bytes( + self.eeprom_path, offset + QSFP_DD_DOM_CAPABILITY_OFFSET, QSFP_DD_DOM_CAPABILITY_WIDTH) + if qsfp_dom_capability_raw is not None: + if self.qsfp_dd_Info is None: + return None + dom_capability = self.qsfp_dd_Info.parse_dom_capability(qsfp_dom_capability_raw, 0) + if dom_capability['data']['Flat_MEM']['value'] == 'Off': + self.qsfp_dd_app2_list = True + self.qsfp_dd_rxpower_supported = True + self.qsfp_dd_txpower_supported = True + self.qsfp_dd_txbias_supported = True + + def _strip_unit_from_str(self, value_str): + match = re.match(r'(.*)C$|(.*)Volts$|(.*)mA$|(.*)dBm$', value_str) + if match: + for value in match.groups(): + if value is not None: + return float(value) + return None + def pci_mem_read(self, mm, offset): mm.seek(offset) - read_data_stream = mm.read(4) - reg_val = struct.unpack('I', read_data_stream) - mem_val = str(reg_val)[1:-2] - # print "reg_val read:%x"%reg_val - return mem_val + return mm.read_byte() def pci_mem_write(self, mm, offset, data): mm.seek(offset) # print "data to write:%x"%data - mm.write(struct.pack('I', data)) + mm.write_byte(data) def pci_set_value(self, resource, val, offset): fd = os.open(resource, os.O_RDWR) @@ -207,6 +335,15 @@ def pci_get_value(self, resource, offset): os.close(fd) return val + def _write_eeprom_bytes(self, offset, num_bytes, value): + try: + with open(self.eeprom_path, mode='r+b', buffering=0) as f: + f.seek(offset) + f.write(value[0:num_bytes]) + except (OSError, IOError): + return False + return True + def _read_eeprom_bytes(self, eeprom_path, offset, num_bytes): eeprom_raw = [] try: @@ -225,8 +362,13 @@ def _read_eeprom_bytes(self, eeprom_path, offset, num_bytes): return None try: - for n in range(0, num_bytes): - eeprom_raw[n] = hex(ord(raw[n]))[2:].zfill(2) + if isinstance(raw , str): + for n in range(0, num_bytes): + eeprom_raw[n] = hex(ord(raw[n]))[2:].zfill(2) + else: + for n in range(0, num_bytes): + eeprom_raw[n] = hex(raw[n])[2:].zfill(2) + except BaseException: eeprom.close() return None @@ -238,24 +380,46 @@ def _get_eeprom_data(self, eeprom_key): eeprom_data = None page_offset = None - if(self.sfp_type == 'QSFP'): + if self.sfp_type == 'QSFP_DD': + page_offset = qsfp_dd_parser[eeprom_key][PAGE_OFFSET] + eeprom_data_raw = self._read_eeprom_bytes( + self.eeprom_path, + (qsfp_dd_parser[eeprom_key][PAGE_OFFSET] + + qsfp_dd_parser[eeprom_key][KEY_OFFSET]), + qsfp_dd_parser[eeprom_key][KEY_WIDTH]) + if eeprom_data_raw is not None: + # Offset 128 is used to retrieve qsfpDD_InterfaceId Info + # Offset 0 is used to retrieve QsfpDD_Dom Info + if page_offset <= 128: + if self.qsfp_dd_Info is None: + return None + eeprom_data = getattr( + self.qsfp_dd_Info, qsfp_dd_parser[eeprom_key][FUNC_NAME])( + eeprom_data_raw, 0) + else: + if self.qsfp_dd_DomInfo is None: + return None + eeprom_data = getattr( + self.qsfp_dd_DomInfo, qsfp_dd_parser[eeprom_key][FUNC_NAME])( + eeprom_data_raw, 0) + elif self.sfp_type == 'QSFP': page_offset = sff8436_parser[eeprom_key][PAGE_OFFSET] eeprom_data_raw = self._read_eeprom_bytes( self.eeprom_path, (sff8436_parser[eeprom_key][PAGE_OFFSET] + sff8436_parser[eeprom_key][KEY_OFFSET]), sff8436_parser[eeprom_key][KEY_WIDTH]) - if (eeprom_data_raw is not None): + if eeprom_data_raw is not None: # Offset 128 is used to retrieve sff8436InterfaceId Info # Offset 0 is used to retrieve sff8436Dom Info - if (page_offset == 128): - if ( self.qsfpInfo is None): + if page_offset == 128: + if self.qsfpInfo is None: return None eeprom_data = getattr( self.qsfpInfo, sff8436_parser[eeprom_key][FUNC_NAME])( eeprom_data_raw, 0) else: - if ( self.qsfpDomInfo is None): + if self.qsfpDomInfo is None: return None eeprom_data = getattr( self.qsfpDomInfo, sff8436_parser[eeprom_key][FUNC_NAME])( @@ -267,17 +431,17 @@ def _get_eeprom_data(self, eeprom_key): (sff8472_parser[eeprom_key][PAGE_OFFSET] + sff8472_parser[eeprom_key][KEY_OFFSET]), sff8472_parser[eeprom_key][KEY_WIDTH]) - if (eeprom_data_raw is not None): + if eeprom_data_raw is not None: # Offset 0 is used to retrieve sff8472InterfaceId Info # Offset 256 is used to retrieve sff8472Dom Info - if (page_offset == 0): - if ( self.sfpInfo is None): + if page_offset == 0: + if self.sfpInfo is None: return None eeprom_data = getattr( self.sfpInfo, sff8472_parser[eeprom_key][FUNC_NAME])( eeprom_data_raw, 0) else: - if ( self.sfpDomInfo is None): + if self.sfpDomInfo is None: return None eeprom_data = getattr( self.sfpDomInfo, sff8472_parser[eeprom_key][FUNC_NAME])( @@ -292,8 +456,17 @@ def get_transceiver_info(self): transceiver_info_dict = {} compliance_code_dict = {} transceiver_info_dict = dict.fromkeys(info_dict_keys, 'N/A') + if not self.get_presence(): + return transceiver_info_dict + + self.sfp_type = self.set_media_type() + if self.reinit_sfp_driver() is False: + return transceiver_info_dict + + self.detect_dom_capability() + # BaseInformation - try: + if self.sfp_type != 'QSFP_DD': iface_data = self._get_eeprom_data('type') connector = iface_data['data']['Connector']['value'] encoding = iface_data['data']['EncodingCodes']['value'] @@ -301,9 +474,8 @@ def get_transceiver_info(self): rate_identifier = iface_data['data']['RateIdentifier']['value'] identifier = iface_data['data']['type']['value'] type_abbrv_name=iface_data['data']['type_abbrv_name']['value'] - if(self.sfp_type == 'QSFP'): - bit_rate = str( - iface_data['data']['Nominal Bit Rate(100Mbs)']['value']) + if self.sfp_type == 'QSFP': + bit_rate = str(iface_data['data']['Nominal Bit Rate(100Mbs)']['value']) for key in qsfp_compliance_code_tup: if key in iface_data['data']['Specification compliance']['value']: compliance_code_dict[key] = iface_data['data']['Specification compliance']['value'][key]['value'] @@ -322,68 +494,145 @@ def get_transceiver_info(self): cable_type = key cable_length = str(iface_data['data'][key]['value']) - transceiver_info_dict['type_abbrv_name']=type_abbrv_name + transceiver_info_dict['type_abbrv_name'] = type_abbrv_name transceiver_info_dict['type'] = identifier transceiver_info_dict['connector'] = connector transceiver_info_dict['encoding'] = encoding transceiver_info_dict['ext_identifier'] = ext_id transceiver_info_dict['ext_rateselect_compliance'] = rate_identifier transceiver_info_dict['cable_type'] = cable_type - transceiver_info_dict['cable_length'] = cable_length + transceiver_info_dict['cable_length'] = str(float(cable_length)) transceiver_info_dict['nominal_bit_rate'] = bit_rate transceiver_info_dict['specification_compliance'] = str(compliance_code_dict) - except (ValueError, TypeError) : pass - # Vendor Date - try: vendor_date_data = self._get_eeprom_data('vendor_date') - vendor_date = vendor_date_data['data']['VendorDataCode(YYYY-MM-DD Lot)']['value'] - transceiver_info_dict['vendor_date'] = vendor_date - except (ValueError, TypeError) : pass + if vendor_date_data is not None: + vendor_date = vendor_date_data['data']['VendorDataCode(YYYY-MM-DD Lot)']['value'] + transceiver_info_dict['vendor_date'] = vendor_date - # Vendor Name - try: vendor_name_data = self._get_eeprom_data('manufacturer') - vendor_name = vendor_name_data['data']['Vendor Name']['value'] - transceiver_info_dict['manufacturer'] = vendor_name - except (ValueError, TypeError) : pass + if vendor_name_data is not None: + vendor_name = vendor_name_data['data']['Vendor Name']['value'] + transceiver_info_dict['manufacturer'] = vendor_name - # Vendor OUI - try: vendor_oui_data = self._get_eeprom_data('vendor_oui') - vendor_oui = vendor_oui_data['data']['Vendor OUI']['value'] - transceiver_info_dict['vendor_oui'] = vendor_oui - except (ValueError, TypeError) : pass + if vendor_oui_data is not None: + vendor_oui = vendor_oui_data['data']['Vendor OUI']['value'] + transceiver_info_dict['vendor_oui'] = vendor_oui - # Vendor PN - try: vendor_pn_data = self._get_eeprom_data('model') - vendor_pn = vendor_pn_data['data']['Vendor PN']['value'] - transceiver_info_dict['model'] = vendor_pn - except (ValueError, TypeError) : pass + if vendor_pn_data is not None: + vendor_pn = vendor_pn_data['data']['Vendor PN']['value'] + transceiver_info_dict['model'] = vendor_pn - # Vendor Revision - try: vendor_rev_data = self._get_eeprom_data('hardware_rev') - vendor_rev = vendor_rev_data['data']['Vendor Rev']['value'] - transceiver_info_dict['hardware_rev'] = vendor_rev - except (ValueError, TypeError) : pass + if vendor_rev_data is not None: + vendor_rev = vendor_rev_data['data']['Vendor Rev']['value'] + transceiver_info_dict['hardware_rev'] = vendor_rev - # Vendor Serial Number - try: vendor_sn_data = self._get_eeprom_data('serial') - vendor_sn = vendor_sn_data['data']['Vendor SN']['value'] - transceiver_info_dict['serial'] = vendor_sn - except (ValueError, TypeError) : pass + if vendor_sn_data is not None: + vendor_sn = vendor_sn_data['data']['Vendor SN']['value'] + transceiver_info_dict['serial'] = vendor_sn - # Attempt ext_media read -# if ext_media_module is not None: -# ext_media_dict = ext_media_module.get_ext_media_info(self) -# for key in ext_media_dict: -# value = ext_media_dict[key] -# if value in [None, 'None', 'none','n/a', '']: -# value = 'N/A' -# transceiver_info_dict[key] = str(value) + else: + #QSFP_DD + type_abbrv_name = self._get_eeprom_data('type_abbrv_name') + if type_abbrv_name is not None: + transceiver_info_dict['type_abbrv_name'] = type_abbrv_name['data']['type_abbrv_name']['value'] + + identifier = self._get_eeprom_data('type') + if identifier is not None: + transceiver_info_dict['type'] = identifier['data']['type']['value'] + + connector = self._get_eeprom_data('connector') + if connector is not None: + transceiver_info_dict['connector'] = connector['data']['Connector']['value'] + + ext_id = self._get_eeprom_data('ext_identifier') + if ext_id is not None: + transceiver_info_dict['ext_identifier'] = ext_id['data']['Extended Identifier']['value'] + + cable_length = self._get_eeprom_data('cable_length') + if cable_length is not None: + #Since the cable length field can be returned as decimal and float in M,converting it to float as common type. + #If the currentreturn type persists, cable length has to defined twice for the same length(e.g. 1 and 1.0M) + transceiver_info_dict['cable_length'] = str(float(cable_length['data']['Length Cable Assembly(m)']['value'])) + + transceiver_info_dict['encoding'] = "Not supported" + transceiver_info_dict['nominal_bit_rate'] = "Not supported" + transceiver_info_dict['ext_rateselect_compliance'] = "Not supported" + + eeprom_raw = [] + eeprom_raw = self._read_eeprom_bytes(self.eeprom_path, QSFP_DD_MEDIA_TYPE_OFFSET, + QSFP_DD_MEDIA_TYPE_WIDTH) + if eeprom_raw is not None: + transceiver_info_dict['specification_compliance'] = type_of_media_interface[eeprom_raw[0]] + + transceiver_info_dict['cable_type'] = "Length Cable Assembly(m)" + + vendor_date = self._get_eeprom_data('vendor_date') + if vendor_date is not None: + transceiver_info_dict['vendor_date'] = vendor_date['data']['VendorDataCode(YYYY-MM-DD Lot)']['value'] + + vendor_name = self._get_eeprom_data('manufacturer') + if vendor_name is not None: + transceiver_info_dict['manufacturer'] = vendor_name['data']['Vendor Name']['value'] + + vendor_oui = self._get_eeprom_data('vendor_oui') + if vendor_oui is not None: + transceiver_info_dict['vendor_oui'] = vendor_oui['data']['Vendor OUI']['value'] + + vendor_pn = self._get_eeprom_data('model') + if vendor_pn is not None: + transceiver_info_dict['model'] = vendor_pn['data']['Vendor PN']['value'] + + vendor_rev = self._get_eeprom_data('hardware_rev') + if vendor_rev is not None: + transceiver_info_dict['hardware_rev'] = vendor_rev['data']['Vendor Rev']['value'] + + vendor_sn = self._get_eeprom_data('serial') + if vendor_sn is not None: + transceiver_info_dict['serial'] = vendor_sn['data']['Vendor SN']['value'] + + if self.qsfp_dd_Info is None: + return None + + sfp_media_type_raw = self._read_eeprom_bytes(self.eeprom_path, QSFP_DD_MEDIA_TYPE_OFFSET, + QSFP_DD_MEDIA_TYPE_WIDTH) + if sfp_media_type_raw is not None: + sfp_media_type_dict = self.qsfp_dd_Info.parse_media_type(sfp_media_type_raw, 0) + if sfp_media_type_dict is None: + return None + + host_media_list = "" + if self.qsfp_dd_Info is None: + return None + qsfp_dd_app1_list = self._read_eeprom_bytes(self.eeprom_path, QSFP_DD_APP1_ADV_OFFSET, + QSFP_DD_APP1_ADV_WIDTH) + if self.qsfp_dd_app2_list: + possible_application_count = 15 + #Additional application advertisement + qsfp_dd_app2_list = self._read_eeprom_bytes(self.eeprom_path, QSFP_DD_APP2_ADV_OFFSET, + QSFP_DD_APP2_ADV_WIDTH) + if qsfp_dd_app1_list is not None and qsfp_dd_app2_list is not None: + sfp_application_type_list = qsfp_dd_app1_list + qsfp_dd_app2_list + else: + return None + else: + possible_application_count = 8 + if qsfp_dd_app1_list is not None: + sfp_application_type_list = qsfp_dd_app1_list + else: + return None + + for i in range(0, possible_application_count): + if sfp_application_type_list[i * 4] == 'ff': + break + host_electrical, media_interface = self.qsfp_dd_Info.parse_application(sfp_media_type_dict, + sfp_application_type_list[i * 4], sfp_application_type_list[i * 4 + 1]) + host_media_list = host_media_list + host_electrical + ' - ' + media_interface + ' ' + transceiver_info_dict['application_advertisement'] = host_media_list return transceiver_info_dict @@ -396,9 +645,29 @@ def get_transceiver_threshold_info(self): threshold_dict_keys, 'N/A') try: - # Module Threshold module_threshold_data = self._get_eeprom_data('ModuleThreshold') - if (self.sfp_type == 'QSFP'): + if self.sfp_type == 'QSFP_DD': + transceiver_dom_threshold_dict['temphighalarm'] = module_threshold_data['data']['TempHighAlarm']['value'] + transceiver_dom_threshold_dict['temphighwarning'] = module_threshold_data['data']['TempHighWarning']['value'] + transceiver_dom_threshold_dict['templowalarm'] = module_threshold_data['data']['TempLowAlarm']['value'] + transceiver_dom_threshold_dict['templowwarning'] = module_threshold_data['data']['TempLowWarning']['value'] + transceiver_dom_threshold_dict['vcchighalarm'] = module_threshold_data['data']['VccHighAlarm']['value'] + transceiver_dom_threshold_dict['vcchighwarning'] = module_threshold_data['data']['VccHighWarning']['value'] + transceiver_dom_threshold_dict['vcclowalarm'] = module_threshold_data['data']['VccLowAlarm']['value'] + transceiver_dom_threshold_dict['vcclowwarning'] = module_threshold_data['data']['VccLowWarning']['value'] + transceiver_dom_threshold_dict['rxpowerhighalarm'] = module_threshold_data['data']['RxPowerHighAlarm']['value'] + transceiver_dom_threshold_dict['rxpowerhighwarning'] = module_threshold_data['data']['RxPowerHighWarning']['value'] + transceiver_dom_threshold_dict['rxpowerlowalarm'] = module_threshold_data['data']['RxPowerLowAlarm']['value'] + transceiver_dom_threshold_dict['rxpowerlowwarning'] = module_threshold_data['data']['RxPowerLowWarning']['value'] + transceiver_dom_threshold_dict['txbiashighalarm'] = module_threshold_data['data']['TxBiasHighAlarm']['value'] + transceiver_dom_threshold_dict['txbiashighwarning'] = module_threshold_data['data']['TxBiasHighWarning']['value'] + transceiver_dom_threshold_dict['txbiaslowalarm'] = module_threshold_data['data']['TxBiasLowAlarm']['value'] + transceiver_dom_threshold_dict['txbiaslowwarning'] = module_threshold_data['data']['TxBiasLowWarning']['value'] + transceiver_dom_threshold_dict['txpowerhighalarm'] = module_threshold_data['data']['TxPowerHighAlarm']['value'] + transceiver_dom_threshold_dict['txpowerhighwarning'] = module_threshold_data['data']['TxPowerHighWarning']['value'] + transceiver_dom_threshold_dict['txpowerlowalarm'] = module_threshold_data['data']['TxPowerLowAlarm']['value'] + transceiver_dom_threshold_dict['txpowerlowwarning'] = module_threshold_data['data']['TxPowerLowWarning']['value'] + elif self.sfp_type == 'QSFP': transceiver_dom_threshold_dict['temphighalarm'] = module_threshold_data['data']['TempHighAlarm']['value'] transceiver_dom_threshold_dict['temphighwarning'] = module_threshold_data['data']['TempHighWarning']['value'] transceiver_dom_threshold_dict['templowalarm'] = module_threshold_data['data']['TempLowAlarm']['value'] @@ -431,7 +700,7 @@ def get_transceiver_threshold_info(self): except (ValueError, TypeError) : pass try: - if (self.sfp_type == 'QSFP'): + if self.sfp_type == 'QSFP': channel_threshold_data = self._get_eeprom_data('ChannelThreshold') transceiver_dom_threshold_dict['rxpowerhighalarm'] = channel_threshold_data['data']['RxPowerHighAlarm']['value'] transceiver_dom_threshold_dict['rxpowerhighwarning'] = channel_threshold_data['data']['RxPowerHighWarning']['value'] @@ -450,6 +719,7 @@ def get_transceiver_bulk_status(self): Retrieves transceiver bulk status of this SFP """ tx_bias_list = [] + tx_power_list = [] rx_power_list = [] transceiver_dom_dict = {} transceiver_dom_dict = dict.fromkeys(dom_dict_keys, 'N/A') @@ -487,24 +757,67 @@ def get_transceiver_bulk_status(self): # rx power rx_power_list = self.get_rx_power() - if tx_bias_list is not None: - transceiver_dom_dict['tx1bias'] = tx_bias_list[0] - transceiver_dom_dict['tx2bias'] = tx_bias_list[1] - transceiver_dom_dict['tx3bias'] = tx_bias_list[2] - transceiver_dom_dict['tx4bias'] = tx_bias_list[3] - - if rx_power_list is not None: - transceiver_dom_dict['rx1power'] = rx_power_list[0] - transceiver_dom_dict['rx2power'] = rx_power_list[1] - transceiver_dom_dict['rx3power'] = rx_power_list[2] - transceiver_dom_dict['rx4power'] = rx_power_list[3] - - if tx_power_list is not None: - transceiver_dom_dict['tx1power'] = tx_power_list[0] - transceiver_dom_dict['tx2power'] = tx_power_list[1] - transceiver_dom_dict['tx3power'] = tx_power_list[2] - transceiver_dom_dict['tx4power'] = tx_power_list[3] - + if self.sfp_type == 'QSFP_DD': + if tx_bias_list: + transceiver_dom_dict['tx1bias'] = tx_bias_list[0] + transceiver_dom_dict['tx2bias'] = tx_bias_list[1] + transceiver_dom_dict['tx3bias'] = tx_bias_list[2] + transceiver_dom_dict['tx4bias'] = tx_bias_list[3] + transceiver_dom_dict['tx5bias'] = tx_bias_list[4] + transceiver_dom_dict['tx6bias'] = tx_bias_list[5] + transceiver_dom_dict['tx7bias'] = tx_bias_list[6] + transceiver_dom_dict['tx8bias'] = tx_bias_list[7] + + elif self.sfp_type == 'QSFP': + if tx_bias_list: + transceiver_dom_dict['tx1bias'] = tx_bias_list[0] + transceiver_dom_dict['tx2bias'] = tx_bias_list[1] + transceiver_dom_dict['tx3bias'] = tx_bias_list[2] + transceiver_dom_dict['tx4bias'] = tx_bias_list[3] + else: + if tx_bias_list: + transceiver_dom_dict['tx1bias'] = tx_bias_list[0] + + if self.sfp_type == 'QSFP_DD': + if rx_power_list: + transceiver_dom_dict['rx1power'] = rx_power_list[0] + transceiver_dom_dict['rx2power'] = rx_power_list[1] + transceiver_dom_dict['rx3power'] = rx_power_list[2] + transceiver_dom_dict['rx4power'] = rx_power_list[3] + transceiver_dom_dict['rx5power'] = rx_power_list[4] + transceiver_dom_dict['rx6power'] = rx_power_list[5] + transceiver_dom_dict['rx7power'] = rx_power_list[6] + transceiver_dom_dict['rx8power'] = rx_power_list[7] + + elif self.sfp_type == 'QSFP': + if rx_power_list: + transceiver_dom_dict['rx1power'] = rx_power_list[0] + transceiver_dom_dict['rx2power'] = rx_power_list[1] + transceiver_dom_dict['rx3power'] = rx_power_list[2] + transceiver_dom_dict['rx4power'] = rx_power_list[3] + else: + if rx_power_list: + transceiver_dom_dict['rx1power'] = rx_power_list[0] + + if self.sfp_type == 'QSFP_DD': + if tx_power_list: + transceiver_dom_dict['tx1power'] = tx_power_list[0] + transceiver_dom_dict['tx2power'] = tx_power_list[1] + transceiver_dom_dict['tx3power'] = tx_power_list[2] + transceiver_dom_dict['tx4power'] = tx_power_list[3] + transceiver_dom_dict['tx5power'] = tx_power_list[4] + transceiver_dom_dict['tx6power'] = tx_power_list[5] + transceiver_dom_dict['tx7power'] = tx_power_list[6] + transceiver_dom_dict['tx8power'] = tx_power_list[7] + elif self.sfp_type == 'QSFP': + if tx_power_list: + transceiver_dom_dict['tx1power'] = tx_power_list[0] + transceiver_dom_dict['tx2power'] = tx_power_list[1] + transceiver_dom_dict['tx3power'] = tx_power_list[2] + transceiver_dom_dict['tx4power'] = tx_power_list[3] + else: + if tx_power_list: + transceiver_dom_dict['tx1power'] = tx_power_list[0] transceiver_dom_dict['rx_los'] = rx_los transceiver_dom_dict['tx_fault'] = tx_fault transceiver_dom_dict['reset_status'] = reset_state @@ -534,7 +847,7 @@ def get_presence(self): Returns : True if sfp is present and false if it is absent """ # Check for invalid port_num - mask = {'QSFP' : (1 << 4), 'SFP' : (1 << 0)} + mask = {'QSFP_DD' : (1 << 4), 'SFP' : (1 << 0)} # Port offset starts with 0x4004 port_offset = 16388 + ((self.index-1) * 16) @@ -542,7 +855,7 @@ def get_presence(self): status = self.pci_get_value(self.BASE_RES_PATH, port_offset) reg_value = int(status) # ModPrsL is active low - if reg_value & mask[self.sfp_type] == 0: + if reg_value & mask[self.port_type] == 0: return True except ValueError: pass @@ -578,7 +891,7 @@ def get_reset_status(self): """ reset_status = False try: - if (self.sfp_type == 'QSFP'): + if self.port_type == 'QSFP_DD': # Port offset starts with 0x4000 port_offset = 16384 + ((self.index-1) * 16) @@ -596,71 +909,114 @@ def get_rx_los(self): """ Retrieves the RX LOS (lost-of-signal) status of SFP """ - rx_los = False + rx_los_list = [] try: - if (self.sfp_type == 'QSFP'): + if self.sfp_type == 'QSFP_DD': + offset = 2176 + rx_los_mask = [ 0x01, 0x02, 0x04, 0x08 ,0x10, 0x20, 0x40, 0x80 ] + dom_channel_monitor_raw = self._read_eeprom_bytes(self.eeprom_path, + offset + 147, 1) + if dom_channel_monitor_raw is not None: + rx_los_data = int(dom_channel_monitor_raw[0], 8) + for mask in rx_los_mask: + rx_los_list.append(bool(rx_los_data & mask != 0)) + elif self.sfp_type == 'QSFP': rx_los_data = self._get_eeprom_data('rx_los') # As the function expects a single boolean, if any one channel experience LOS, - # is considered LOS for QSFP + # is considered LOS for QSFP for rx_los_id in ('Rx1LOS', 'Rx2LOS', 'Rx3LOS', 'Rx4LOS') : - rx_los |= (rx_los_data['data'][rx_los_id]['value'] is 'On') + rx_los_list.append(rx_los_data['data'][rx_los_id]['value'] == 'On') else: rx_los_data = self._read_eeprom_bytes(self.eeprom_path, SFP_STATUS_CONTROL_OFFSET, SFP_STATUS_CONTROL_WIDTH) data = int(rx_los_data[0], 16) - rx_los = sffbase().test_bit(data, 1) != 0 + rx_los_list.append(sffbase().test_bit(data, 1) != 0) except (TypeError, ValueError): return 'N/A' - return rx_los + return rx_los_list def get_tx_fault(self): """ Retrieves the TX fault status of SFP """ - tx_fault = False + tx_fault_list = [] try: - if (self.sfp_type == 'QSFP'): + if self.sfp_type == 'QSFP_DD': + tx_fault_list.append(False) + elif self.sfp_type == 'QSFP': tx_fault_data = self._get_eeprom_data('tx_fault') - for tx_fault_id in ('Tx1Fault', 'Tx2Fault', 'Tx3Fault', 'Tx4Fault') : - tx_fault |= (tx_fault_data['data'][tx_fault_id]['value'] is 'On') + for tx_fault_id in ('Tx1Fault', 'Tx2Fault', 'Tx3Fault', 'Tx4Fault') : + tx_fault_list.append(tx_fault_data['data'][tx_fault_id]['value'] == 'On') else: tx_fault_data = self._read_eeprom_bytes(self.eeprom_path, SFP_STATUS_CONTROL_OFFSET, SFP_STATUS_CONTROL_WIDTH) data = int(tx_fault_data[0], 16) - tx_fault = (sffbase().test_bit(data, 2) != 0) + tx_fault_list.append(sffbase().test_bit(data, 2) != 0) except (TypeError, ValueError): return 'N/A' - return tx_fault + return tx_fault_list def get_tx_disable(self): """ Retrieves the tx_disable status of this SFP """ - tx_disable = False + tx_disable_list = [] try: - if (self.sfp_type == 'QSFP'): + if self.sfp_type == 'QSFP_DD': + dom_channel_monitor_raw = self._read_eeprom_bytes(self.eeprom_path,2048 + 130, 1) + if dom_channel_monitor_raw is not None: + tx_disable_data = int(dom_channel_monitor_raw[0], 16) + for i in range(8): + tx_disable_list.append(bool(tx_disable_data & (1 << i) != 0)) + + elif self.sfp_type == 'QSFP': tx_disable_data = self._get_eeprom_data('tx_disable') for tx_disable_id in ('Tx1Disable', 'Tx2Disable', 'Tx3Disable', 'Tx4Disable'): - tx_disable |= (tx_disable_data['data'][tx_disable_id]['value'] is 'On') + tx_disable_list.append(tx_disable_data['data'][tx_disable_id]['value'] == 'On') else: - tx_disable_data = self._read_eeprom_bytes(self.eeprom_path, SFP_STATUS_CONTROL_OFFSET, SFP_STATUS_CONTROL_WIDTH) + offset = 256 + tx_disable_data = self._read_eeprom_bytes(self.eeprom_path, offset + SFP_STATUS_CONTROL_OFFSET, SFP_STATUS_CONTROL_WIDTH) data = int(tx_disable_data[0], 16) tx_disable_hard = (sffbase().test_bit(data, SFP_TX_DISABLE_HARD_BIT) != 0) tx_disable_soft = (sffbase().test_bit(data, SFP_TX_DISABLE_SOFT_BIT) != 0) - tx_disable = tx_disable_hard | tx_disable_soft + tx_disable_list.append(tx_disable_hard | tx_disable_soft) except (TypeError, ValueError): return 'N/A' - return tx_disable + return tx_disable_list + + def tx_disable(self, tx_disable): + if self.sfp_type == 'QSFP_DD': + val = 0xff if tx_disable else 0x0 + return self._write_eeprom_bytes(2048 + 130, 1, bytearray([val])) + + elif self.sfp_type == 'QSFP': + val = 0xf if tx_disable else 0x0 + return self._write_eeprom_bytes( 0 + 86, 1, bytearray([val])) + + else: + offset = 256 + if tx_disable is True: + val = 64 + else: + val = 191 + return self._write_eeprom_bytes(offset + SFP_STATUS_CONTROL_OFFSET, SFP_STATUS_CONTROL_WIDTH, bytearray([val])) def get_tx_disable_channel(self): """ Retrieves the TX disabled channels in this SFP """ - tx_disable_channel = 0 + tx_disable_channel = None try: - if (self.sfp_type == 'QSFP'): + if self.sfp_type == 'QSFP_DD': + offset = 2048 + dom_channel_monitor_raw = self._read_eeprom_bytes(self.eeprom_path, offset + 130, 1) + if dom_channel_monitor_raw is not None: + tx_disable_channel = int(dom_channel_monitor_raw[0], 16) + elif self.sfp_type == 'QSFP': tx_disable_data = self._get_eeprom_data('tx_disable') for tx_disable_id in ('Tx1Disable', 'Tx2Disable', 'Tx3Disable', 'Tx4Disable'): tx_disable_channel <<= 1 - tx_disable_channel |= (tx_disable_data['data']['Tx1Disable']['value'] is 'On') + tx_disable_channel |= (tx_disable_data['data']['Tx1Disable']['value'] == 'On') + else: + tx_disable_channel = int(self.get_tx_disable()[0]) except (TypeError, ValueError): return 'N/A' return tx_disable_channel @@ -670,8 +1026,14 @@ def get_lpmode(self): Retrieves the lpmode(low power mode) of this SFP """ lpmode_state = False - try: - if (self.sfp_type == 'QSFP'): + try: + if self.sfp_type == 'QSFP_DD': + lpmode = self._read_eeprom_bytes(self.eeprom_path, QSFP_DD_MODULE_ENC_OFFSET, QSFP_DD_MODULE_ENC_WIDTH) + if lpmode is not None: + if int(lpmode[0])>>1 == 1: + return True + return False + else: # Port offset starts with 0x4000 port_offset = 16384 + ((self.index-1) * 16) @@ -682,8 +1044,9 @@ def get_lpmode(self): mask = (1 << 6) lpmode_state = (reg_value & mask) - except ValueError: pass - return lpmode_state + except ValueError: + pass + return bool(lpmode_state) def get_power_override(self): """ @@ -692,7 +1055,7 @@ def get_power_override(self): power_override_state = False try: - if (self.sfp_type == 'QSFP'): + if self.sfp_type.startswith('QSFP'): power_override_data = self._get_eeprom_data('power_override') power_override = power_override_data['data']['PowerOverRide']['value'] power_override_state = (power_override is 'On') @@ -703,10 +1066,20 @@ def get_temperature(self): """ Retrieves the temperature of this SFP """ - temperature = None - try : - temperature_data = self._get_eeprom_data('Temperature') - temperature = temperature_data['data']['Temperature']['value'] + temperature = 0.0 + try: + if self.sfp_type == 'QSFP_DD': + if self.qsfp_dd_DomInfo is None: + return None + dom_data_raw = self._read_eeprom_bytes(self.eeprom_path, QSFP_DD_TEMP_OFFSET, QSFP_DD_TEMP_WIDTH) + if dom_data_raw is None: + return None + temperature_data = self.qsfp_dd_DomInfo.parse_temperature(dom_data_raw, 0) + + else: + temperature_data = self._get_eeprom_data('Temperature') + if temperature_data is not None: + temperature = self._strip_unit_from_str(temperature_data['data']['Temperature']['value']) except (TypeError, ValueError): return None return temperature @@ -715,10 +1088,20 @@ def get_voltage(self): """ Retrieves the supply voltage of this SFP """ - voltage = None + voltage = 0.0 try: - voltage_data = self._get_eeprom_data('Voltage') - voltage = voltage_data['data']['Vcc']['value'] + if self.sfp_type == 'QSFP_DD': + if self.qsfp_dd_DomInfo is None: + return None + dom_data_raw = self._read_eeprom_bytes(self.eeprom_path, QSFP_DD_VOLT_OFFSET, QSFP_DD_VOLT_WIDTH) + if dom_data_raw is None: + return None + voltage_data = self.qsfp_dd_DomInfo.parse_voltage(dom_data_raw, 0) + + else: + voltage_data = self._get_eeprom_data('Voltage') + if voltage_data is not None: + voltage = self._strip_unit_from_str(voltage_data['data']['Vcc']['value']) except (TypeError, ValueError): return None return voltage @@ -729,14 +1112,34 @@ def get_tx_bias(self): """ tx_bias_list = [] try: - tx_bias_data = self._get_eeprom_data('ChannelMonitor') - if (self.sfp_type == 'QSFP'): - for tx_bias_id in ('TX1Bias', 'TX2Bias', 'TX3Bias', 'TX4Bias') : - tx_bias = tx_bias_data['data'][tx_bias_id]['value'] + offset = QSFP_DD_PAGE17 + if self.sfp_type == 'QSFP_DD': + if self.qsfp_dd_DomInfo is None: + return None + if not self.qsfp_dd_txbias_supported: + for lane in range(0, 8): + tx_bias_list.append(False) + return tx_bias_list + + tx_bias_data_raw = self._read_eeprom_bytes(self.eeprom_path, offset + QSFP_DD_TXBIAS_OFFSET, QSFP_DD_TXBIAS_WIDTH) + tx_bias_data = self.qsfp_dd_DomInfo.parse_dom_tx_bias(tx_bias_data_raw, 0) + + for tx_bias_id in ('TX1Bias', 'TX2Bias', 'TX3Bias', 'TX4Bias', + 'TX5Bias', 'TX6Bias', 'TX7Bias', 'TX8Bias'): + tx_bias = self._strip_unit_from_str(tx_bias_data['data'][tx_bias_id]['value']) + tx_bias_list.append(tx_bias) + + elif self.sfp_type == 'QSFP': + tx_bias_data = self._get_eeprom_data('ChannelMonitor') + for tx_bias_id in ('TX1Bias', 'TX2Bias', 'TX3Bias', 'TX4Bias'): + tx_bias = self._strip_unit_from_str(tx_bias_data['data'][tx_bias_id]['value']) tx_bias_list.append(tx_bias) else: - tx1_bias = tx_bias_data['data']['TXBias']['value'] - tx_bias_list = [tx1_bias, "N/A", "N/A", "N/A"] + tx_bias_data = self._get_eeprom_data('ChannelMonitor') + if tx_bias_data is not None: + tx1_bias = self._strip_unit_from_str(tx_bias_data['data']['TXBias']['value']) + tx_bias_list.append(tx1_bias) + except (TypeError, ValueError): return None return tx_bias_list @@ -747,14 +1150,33 @@ def get_rx_power(self): """ rx_power_list = [] try: - rx_power_data = self._get_eeprom_data('ChannelMonitor') - if (self.sfp_type == 'QSFP'): + if self.sfp_type == 'QSFP_DD': + if self.qsfp_dd_DomInfo is None: + return None + if not self.qsfp_dd_rxpower_supported: + for lane in range(0, 8): + rx_power_list.append(False) + return rx_power_list + + offset = QSFP_DD_PAGE17 + rx_power_data_raw = self._read_eeprom_bytes(self.eeprom_path, offset + QSFP_DD_RXPOWER_OFFSET, QSFP_DD_TXPOWER_WIDTH) + rx_power_data = self.qsfp_dd_DomInfo.parse_dom_rx_power(rx_power_data_raw, 0) + + for rx_power_id in ('RX1Power', 'RX2Power', 'RX3Power', 'RX4Power', + 'RX5Power', 'RX6Power', 'RX7Power', 'RX8Power'): + rx_power = self._strip_unit_from_str(rx_power_data['data'][rx_power_id]['value']) + rx_power_list.append(rx_power) + + elif self.sfp_type == 'QSFP': + rx_power_data = self._get_eeprom_data('ChannelMonitor') for rx_power_id in ('RX1Power', 'RX2Power', 'RX3Power', 'RX4Power'): rx_power = rx_power_data['data'][rx_power_id]['value'] rx_power_list.append(rx_power) else: - rx1_pw = rx_power_data['data']['RXPower']['value'] - rx_power_list = [rx1_pw, "N/A", "N/A", "N/A"] + rx_power_data = self._get_eeprom_data('ChannelMonitor') + if rx_power_data is not None: + rx1_pw = self._strip_unit_from_str(rx_power_data['data']['RXPower']['value']) + rx_power_list.append(rx1_pw) except (TypeError, ValueError): return None return rx_power_list @@ -765,7 +1187,25 @@ def get_tx_power(self): """ tx_power_list = [] try: - if(self.sfp_type == 'QSFP'): + if self.sfp_type == 'QSFP_DD': + if self.qsfp_dd_DomInfo is None: + return None + if not self.qsfp_dd_txpower_supported: + for lane in range(0, 8): + tx_power_list.append(False) + return tx_power_list + + offset = QSFP_DD_PAGE17 + tx_power_data_raw = self._read_eeprom_bytes(self.eeprom_path, offset + QSFP_DD_TXPOWER_OFFSET, + QSFP_DD_TXPOWER_WIDTH) + tx_power_data = self.qsfp_dd_DomInfo.parse_dom_tx_power(tx_power_data_raw, 0) + + for tx_power_id in ('TX1Power', 'TX2Power', 'TX3Power', 'TX4Power', + 'TX5Power', 'TX6Power', 'TX7Power', 'TX8Power'): + tx_pw = self._strip_unit_from_str(tx_power_data['data'][tx_power_id]['value']) + tx_power_list.append(tx_pw) + + elif self.sfp_type == 'QSFP': # QSFP capability byte parse, through this byte can know whether it support tx_power or not. # TODO: in the future when decided to migrate to support SFF-8636 instead of SFF-8436, # need to add more code for determining the capability and version compliance @@ -781,12 +1221,13 @@ def get_tx_power(self): return None channel_monitor_data = self._get_eeprom_data('ChannelMonitor_TxPower') for tx_power_id in ('TX1Power', 'TX2Power', 'TX3Power', 'TX4Power'): - tx_pw = channel_monitor_data['data'][tx_power_id]['value'] + tx_pw = self._strip_unit_from_str(channel_monitor_data['data'][tx_power_id]['value']) tx_power_list.append(tx_pw) else: channel_monitor_data = self._get_eeprom_data('ChannelMonitor') - tx1_pw = channel_monitor_data['data']['TXPower']['value'] - tx_power_list = [tx1_pw, 'N/A', 'N/A', 'N/A'] + if channel_monitor_data is not None: + tx1_pw = self._strip_unit_from_str(channel_monitor_data['data']['TXPower']['value']) + tx_power_list.append(tx1_pw) except (TypeError, ValueError): return None return tx_power_list @@ -796,7 +1237,7 @@ def reset(self): Reset the SFP and returns all user settings to their default state """ try: - if (self.sfp_type == 'QSFP'): + if self.port_type == 'QSFP_DD': # Port offset starts with 0x4000 port_offset = 16384 + ((self.index-1) * 16) @@ -819,6 +1260,8 @@ def reset(self): # Convert our register value back to a hex string and write back self.pci_set_value(self.BASE_RES_PATH, reg_value, port_offset) + else: + return False except ValueError: return False return True @@ -828,7 +1271,14 @@ def set_lpmode(self, lpmode): Sets the lpmode(low power mode) of this SFP """ try: - if (self.sfp_type == 'QSFP'): + if self.sfp_type == 'QSFP_DD': + if lpmode is True: + write_val = 0x10 + else: + write_val = 0x0 + + self._write_eeprom_bytes(26, 1, bytearray([write_val])) + else: # Port offset starts with 0x4000 port_offset = 16384 + ((self.index-1) * 16) @@ -855,8 +1305,8 @@ def get_intl_state(self): Sets the intL (interrupt; active low) pin of this SFP """ intl_state = True - try: - if (self.sfp_type == 'QSFP'): + try: + if self.port_type == 'QSFP_DD': # Port offset starts with 0x4004 port_offset = 16388 + ((self.index-1) * 16) @@ -870,17 +1320,45 @@ def get_intl_state(self): except ValueError: pass return intl_state - def tx_disable(self, tx_disable): - """ - Disable SFP TX for all channels - """ - return False - def tx_disable_channel(self, channel, disable): """ - Sets the tx_disable for specified SFP channels + Enables/Disables TX channel for SFP based on disable flag """ - return False + channel_state = self.get_tx_disable_channel() + if channel_state is None or channel_state == 'N/A': + return False + if self.sfp_type == 'QSFP_DD': + for i in range(8): + mask = (1 << i) + if not (channel & mask): + continue + if disable: + channel_state |= mask + else: + channel_state &= ~mask + return self._write_eeprom_bytes(2048 + 130, 1, bytearray([channel_state])) + elif self.sfp_type == 'QSFP': + for i in range(4): + mask = (1 << i) + if not (channel & mask): + continue + if disable: + channel_state |= mask + else: + channel_state &= ~mask + return self._write_eeprom_bytes(86, 1, bytearray([channel_state])) + else: + channel_state = self.get_tx_disable_channel() + if channel_state is None or channel_state == "N/A": + return False + offset = 256 + mask = (1 << 0) + if disable: + channel_state |= mask + else: + channel_state &= ~mask + + return self._write_eeprom_bytes(offset + SFP_STATUS_CONTROL_OFFSET, SFP_STATUS_CONTROL_WIDTH, bytearray([channel_state])) def set_power_override(self, power_override, power_set): """ @@ -895,14 +1373,101 @@ def get_status(self): reset = self.get_reset_status() return (not reset) + def get_port_form_factor(self): + """ + Retrieves the native port type + """ + return self.port_type + def get_max_port_power(self): """ Retrieves the maximum power allowed on the port in watts - *** This method of fetching power values is not ideal. TODO: enhance by placing power limits in config file *** """ - return (12.0 if self.sfp_type=='QSFP' else 2.5) + return 12.0 if self.port_type == 'QSFP_DD' else 2.5 + + def set_media_type(self): + """ + Reads optic eeprom byte to determine media type inserted + """ + eeprom_raw = [] + eeprom_raw = self._read_eeprom_bytes(self.eeprom_path, MEDIA_TYPE_OFFSET, MEDIA_TYPE_WIDTH) + if eeprom_raw is not None: + if eeprom_raw[0] in SFP_TYPE_LIST: + self.sfp_type = 'SFP' + elif eeprom_raw[0] in QSFP_TYPE_LIST: + self.sfp_type = 'QSFP' + elif eeprom_raw[0] in QSFP_DD_TYPE_LIST: + self.sfp_type = 'QSFP_DD' + else: + #Set native port type if EEPROM type is not recognized/readable + self.sfp_type = self.port_type + else: + self.sfp_type = self.port_type + + return self.sfp_type + + def reinit_sfp_driver(self): + """ + Changes the driver based on media type detected + """ + del_sfp_path = "/sys/class/i2c-adapter/i2c-{0}/delete_device".format(self._port_to_i2c_mapping[self.index]) + new_sfp_path = "/sys/class/i2c-adapter/i2c-{0}/new_device".format(self._port_to_i2c_mapping[self.index]) + driver_path = "/sys/class/i2c-adapter/i2c-{0}/{0}-0050/name".format(self._port_to_i2c_mapping[self.index]) + delete_device = "echo 0x50 >" + del_sfp_path + + if not os.path.isfile(driver_path): + print(driver_path, "does not exist") + return False + + try: + with os.fdopen(os.open(driver_path, os.O_RDONLY)) as fd: + driver_name = fd.read() + driver_name = driver_name.rstrip('\r\n') + driver_name = driver_name.lstrip(" ") + + #Avoid re-initialization of the QSFP/SFP optic on QSFP/SFP port. + if self.sfp_type == 'SFP' and driver_name in ['optoe1', 'optoe3']: + subprocess.Popen(delete_device, shell=True, stdout=subprocess.PIPE) + time.sleep(0.2) + new_device = "echo optoe2 0x50 >" + new_sfp_path + subprocess.Popen(new_device, shell=True, stdout=subprocess.PIPE) + time.sleep(2) + elif self.sfp_type == 'QSFP' and driver_name in ['optoe2', 'optoe3']: + subprocess.Popen(delete_device, shell=True, stdout=subprocess.PIPE) + time.sleep(0.2) + new_device = "echo optoe1 0x50 >" + new_sfp_path + subprocess.Popen(new_device, shell=True, stdout=subprocess.PIPE) + time.sleep(2) + elif self.sfp_type == 'QSFP_DD' and driver_name in ['optoe1', 'optoe2']: + subprocess.Popen(delete_device, shell=True, stdout=subprocess.PIPE) + time.sleep(0.2) + new_device = "echo optoe3 0x50 >" + new_sfp_path + subprocess.Popen(new_device, shell=True, stdout=subprocess.PIPE) + time.sleep(2) + + except IOError as e: + print("Error: Unable to open file: %s" % str(e)) + return False + return True + + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device. + Returns: + integer: The 1-based relative physical position in parent + device or -1 if cannot determine the position + """ + return self.index + + def is_replaceable(self): + """ + Indicate whether this device is replaceable. + Returns: + bool: True if it is replaceable. + """ + return True diff --git a/platform/broadcom/sonic-platform-modules-dell/z9332f/sonic_platform/thermal.py b/platform/broadcom/sonic-platform-modules-dell/z9332f/sonic_platform/thermal.py index 86d5f9492d50..578be59735a9 100644 --- a/platform/broadcom/sonic-platform-modules-dell/z9332f/sonic_platform/thermal.py +++ b/platform/broadcom/sonic-platform-modules-dell/z9332f/sonic_platform/thermal.py @@ -19,28 +19,30 @@ class Thermal(ThermalBase): """DellEMC Platform-specific Thermal class""" - # [ Sensor-Name, Sensor-ID ] + # [ Sensor-Name, Sensor-ID, high threshold, high critical_threshold ] SENSOR_MAPPING = [ - ['CPU On-board', 0x5], - ['Baseboard U3', 0x4], - ['SW Internal', 0x61], - ['Fan U52', 0x0], - ['Fan U17', 0x1], - ['SW U52', 0x2], - ['SW U16', 0x3], - ['PSU1 Inlet', 0x34], - ['PSU1 Hotspot', 0x35], - ['PSU2 Inlet', 0x3E], - ['PSU2 Hotspot', 0x3F], - ['SW U04', 0x4F], - ['SW U14', 0x56], - ['SW U4403', 0x5D] + ['CPU On-board', 0x5, False, True], + ['Baseboard U3', 0x4, False, False], + ['SW Internal', 0x61, True, True], + ['Fan U52', 0x0, True, True], + ['Fan U17', 0x1, False, False], + ['SW U52', 0x2, False, False], + ['SW U16', 0x3, True, True], + ['PSU1 Inlet', 0x34, False, False], + ['PSU1 Hotspot', 0x35, False, False], + ['PSU2 Inlet', 0x3E, False, False], + ['PSU2 Hotspot', 0x3F, False, False], + ['SW U04', 0x4F, False, False], + ['SW U14', 0x56, False, False], + ['SW U4403', 0x5D, False, False] ] def __init__(self, thermal_index=0): ThermalBase.__init__(self) self.index = thermal_index + 1 self.sensor = IpmiSensor(self.SENSOR_MAPPING[self.index - 1][1]) + self.has_high_threshold = self.SENSOR_MAPPING[self.index - 1][2] + self.has_high_crit_threshold = self.SENSOR_MAPPING[self.index - 1][3] def get_name(self): """ @@ -111,11 +113,12 @@ def get_high_threshold(self): Celsius up to nearest thousandth of one degree Celsius, e.g. 30.125 """ - is_valid, high_threshold = self.sensor.get_threshold("UpperCritical") - if not is_valid: - high_threshold = 0 + if self.has_high_threshold: + is_valid, high_threshold = self.sensor.get_threshold("UpperNonCritical") + if is_valid: + return float(high_threshold) - return float(high_threshold) + return super(Thermal, self).get_high_threshold() def get_low_threshold(self): """ @@ -126,11 +129,7 @@ def get_low_threshold(self): Celsius up to nearest thousandth of one degree Celsius, e.g. 30.125 """ - is_valid, low_threshold = self.sensor.get_threshold("LowerNonRecoverable") - if not is_valid: - low_threshold = 0 - - return float(low_threshold) + return 0.0 def get_high_critical_threshold(self): """ @@ -140,12 +139,12 @@ def get_high_critical_threshold(self): thermal in Celsius up to nearest thousandth of one degree Celsius, e.g. 30.125 """ - is_valid, high_crit_threshold = self.sensor.get_threshold("UpperNonRecoverable") - if not is_valid: - high_crit_threshold = 0 + if self.has_high_crit_threshold: + is_valid, high_crit_threshold = self.sensor.get_threshold("UpperCritical") + if is_valid: + return float(high_crit_threshold) - return float(high_crit_threshold) - + return super(Thermal, self).get_high_critical_threshold() def set_high_threshold(self, temperature): """ @@ -174,3 +173,20 @@ def set_low_threshold(self, temperature): """ # Thermal threshold values are pre-defined based on HW. return False + + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device. + Returns: + integer: The 1-based relative physical position in parent + device or -1 if cannot determine the position + """ + return self.index + + def is_replaceable(self): + """ + Indicate whether this Thermal is replaceable. + Returns: + bool: True if it is replaceable. + """ + return False diff --git a/platform/broadcom/sonic-platform-modules-dell/z9332f/sonic_platform/watchdog.py b/platform/broadcom/sonic-platform-modules-dell/z9332f/sonic_platform/watchdog.py index 265fab66d922..55460bdf06e1 100644 --- a/platform/broadcom/sonic-platform-modules-dell/z9332f/sonic_platform/watchdog.py +++ b/platform/broadcom/sonic-platform-modules-dell/z9332f/sonic_platform/watchdog.py @@ -11,8 +11,8 @@ try: import ctypes - import subprocess from sonic_platform_base.watchdog_base import WatchdogBase + from sonic_platform.hwaccess import io_reg_read, io_reg_write except ImportError as e: raise ImportError(str(e) + "- required module not found") @@ -29,45 +29,25 @@ class Watchdog(WatchdogBase): Abstract base class for interfacing with a hardware watchdog module """ - TIMERS = [15,20,30,40,50,60,65,70] + TIMERS = [0.2, 30, 60, 180, 240, 300, 420, 600] + io_resource = "/dev/port" + wd_timer_offset = 0xA181 + wd_status_offset = 0xA182 + wd_timer_punch_offset = 0xA184 + wd_enable = 1 + wd_disable = 0 + wd_punch_enable = 0 armed_time = 0 timeout = 0 CLOCK_MONOTONIC = 1 def __init__(self): + WatchdogBase.__init__(self) self._librt = ctypes.CDLL('librt.so.1', use_errno=True) self._clock_gettime = self._librt.clock_gettime self._clock_gettime.argtypes=[ctypes.c_int, ctypes.POINTER(_timespec)] - def _get_command_result(self, cmdline): - try: - proc = subprocess.Popen(cmdline.split(), stdout=subprocess.PIPE, - stderr=subprocess.STDOUT) - stdout = proc.communicate()[0] - proc.wait() - result = stdout.rstrip('\n') - except OSError: - result = None - - return result - - def _get_reg_val(self): - # 0x31 = CPLD I2C Base Address - # 0x07 = Watchdog Function Register - value = self._get_command_result("/usr/sbin/i2cget -y 601 0x31 0x07") - if not value: - return None - else: - return int(value, 16) - - def _set_reg_val(self,val): - # 0x31 = CPLD I2C Base Address - # 0x07 = Watchdog Function Register - value = self._get_command_result("/usr/sbin/i2cset -y 601 0x31 0x07 %s" - % (val)) - return value - def _get_time(self): """ To get clock monotonic time @@ -93,7 +73,7 @@ def arm(self, seconds): """ timer_offset = -1 for key,timer_seconds in enumerate(self.TIMERS): - if seconds <= timer_seconds: + if seconds > 0 and seconds <= timer_seconds: timer_offset = key seconds = timer_seconds break @@ -101,43 +81,25 @@ def arm(self, seconds): if timer_offset == -1: return -1 - # Extracting 5th to 7th bits for WD timer values - # 000 - 15 sec - # 001 - 20 sec - # 010 - 30 sec - # 011 - 40 sec - # 100 - 50 sec - # 101 - 60 sec - # 110 - 65 sec - # 111 - 70 sec - reg_val = self._get_reg_val() - wd_timer_offset = (reg_val >> 4) & 0x7 - - if wd_timer_offset != timer_offset: - # Setting 5th to 7th bits - # value from timer_offset + wd_timer_val = io_reg_read(self.io_resource, self.wd_timer_offset) + + if wd_timer_val != timer_offset: self.disarm() - self._set_reg_val(reg_val | (timer_offset << 4)) + io_reg_write(self.io_resource, self.wd_timer_offset, timer_offset) if self.is_armed(): - # Setting last bit to WD Timer punch - # Last bit = WD Timer punch - self._set_reg_val(reg_val & 0xFE) - + # Setting the WD timer punch + io_reg_write(self.io_resource, self.wd_timer_punch_offset, self.wd_punch_enable) self.armed_time = self._get_time() self.timeout = seconds return seconds else: - # Setting 4th bit to enable WD - # 4th bit = Enable WD - reg_val = self._get_reg_val() - self._set_reg_val(reg_val | 0x8) - + # Enable WD + io_reg_write(self.io_resource, self.wd_status_offset, self.wd_enable) self.armed_time = self._get_time() self.timeout = seconds return seconds - def disarm(self): """ Disarm the hardware watchdog @@ -147,11 +109,8 @@ def disarm(self): if not """ if self.is_armed(): - # Setting 4th bit to disable WD - # 4th bit = Disable WD - reg_val = self._get_reg_val() - self._set_reg_val(reg_val & 0xF7) - + # Disable WD + io_reg_write(self.io_resource, self.wd_status_offset, self.wd_disable) self.armed_time = 0 self.timeout = 0 return True @@ -165,14 +124,11 @@ def is_armed(self): Returns: A boolean, True if watchdog is armed, False if not """ - - # Extracting 4th bit to get WD Enable/Disable status + # Getting the WD Enable/Disable status # 0 - Disabled WD # 1 - Enabled WD - reg_val = self._get_reg_val() - wd_offset = (reg_val >> 3) & 1 - - return bool(wd_offset) + wd_status = io_reg_read(self.io_resource, self.wd_status_offset) + return bool(wd_status) def get_remaining_time(self): """ @@ -184,7 +140,7 @@ def get_remaining_time(self): their watchdog timer. If the watchdog is not armed, returns -1. - S5232 doesnot have hardware support to show remaining time. + Z9332 does not have hardware support to show remaining time. Due to this limitation, this API is implemented in software. This API would return correct software time difference if it is called from the process which armed the watchdog timer. diff --git a/platform/broadcom/sonic-platform-modules-dell/z9332f/systemd/platform-modules-z9332f.service b/platform/broadcom/sonic-platform-modules-dell/z9332f/systemd/platform-modules-z9332f.service index 49064b00d682..348313718a70 100644 --- a/platform/broadcom/sonic-platform-modules-dell/z9332f/systemd/platform-modules-z9332f.service +++ b/platform/broadcom/sonic-platform-modules-dell/z9332f/systemd/platform-modules-z9332f.service @@ -1,6 +1,6 @@ [Unit] Description=Dell Z9332f Platform modules -Before=pmon.service +Before=pmon.service determine-reboot-cause.service DefaultDependencies=no [Service] diff --git a/platform/broadcom/sonic-platform-modules-delta/debian/control b/platform/broadcom/sonic-platform-modules-delta/debian/control index 6105f280ad33..809c58b0c0b1 100644 --- a/platform/broadcom/sonic-platform-modules-delta/debian/control +++ b/platform/broadcom/sonic-platform-modules-delta/debian/control @@ -7,30 +7,30 @@ Standards-Version: 3.9.3 Package: platform-modules-ag9032v1 Architecture: amd64 -Depends: linux-image-4.19.0-9-2-amd64-unsigned +Depends: linux-image-4.19.0-12-2-amd64-unsigned Description: kernel modules for platform devices such as fan, led, sfp Package: platform-modules-ag9064 Architecture: amd64 -Depends: linux-image-4.19.0-9-2-amd64-unsigned +Depends: linux-image-4.19.0-12-2-amd64-unsigned Description: kernel modules for platform devices such as fan, led, sfp Package: platform-modules-ag5648 Architecture: amd64 -Depends: linux-image-4.19.0-9-2-amd64-unsigned +Depends: linux-image-4.19.0-12-2-amd64-unsigned Description: kernel modules for platform devices such as fan, led, sfp Package: platform-modules-et-6248brb Architecture: amd64 -Depends: linux-image-4.19.0-9-2-amd64-unsigned +Depends: linux-image-4.19.0-12-2-amd64-unsigned Description: kernel modules for platform devices such as fan, led, sfp Package: platform-modules-ag9032v2a Architecture: amd64 -Depends: linux-image-4.19.0-9-2-amd64-unsigned +Depends: linux-image-4.19.0-12-2-amd64-unsigned Description: kernel modules for platform devices such as syseeprom, sfp Package: platform-modules-agc032 Architecture: amd64 -Depends: linux-image-4.19.0-9-2-amd64-unsigned +Depends: linux-image-4.19.0-12-2-amd64-unsigned Description: kernel modules for platform devices such as fan, led, sfp diff --git a/platform/broadcom/sonic-platform-modules-inventec/d6332/sonic_platform/qsfp.py b/platform/broadcom/sonic-platform-modules-inventec/d6332/sonic_platform/qsfp.py index 178ac0cf9aa5..17763cd1264f 100644 --- a/platform/broadcom/sonic-platform-modules-inventec/d6332/sonic_platform/qsfp.py +++ b/platform/broadcom/sonic-platform-modules-inventec/d6332/sonic_platform/qsfp.py @@ -436,7 +436,7 @@ def get_transceiver_bulk_status(self): # in SFF-8636 dom capability definitions evolving with the versions. qsfp_dom_capability_raw = self.__read_eeprom_specific_bytes((offset_xcvr + XCVR_DOM_CAPABILITY_OFFSET), XCVR_DOM_CAPABILITY_WIDTH) if qsfp_dom_capability_raw is not None: - qspf_dom_capability_data = sfpi_obj.parse_qsfp_dom_capability(qsfp_dom_capability_raw, 0) + qspf_dom_capability_data = sfpi_obj.parse_dom_capability(qsfp_dom_capability_raw, 0) else: return None @@ -793,7 +793,7 @@ def get_tx_bias(self): qsfp_dom_capability_raw = self.__read_eeprom_specific_bytes((offset_xcvr + XCVR_DOM_CAPABILITY_OFFSET), XCVR_DOM_CAPABILITY_WIDTH) if qsfp_dom_capability_raw is not None: - qspf_dom_capability_data = sfpi_obj.parse_qsfp_dom_capability(qsfp_dom_capability_raw, 0) + qspf_dom_capability_data = sfpi_obj.parse_dom_capability(qsfp_dom_capability_raw, 0) else: return None @@ -844,7 +844,7 @@ def get_rx_power(self): qsfp_dom_capability_raw = self.__read_eeprom_specific_bytes((offset_xcvr + XCVR_DOM_CAPABILITY_OFFSET), XCVR_DOM_CAPABILITY_WIDTH) if qsfp_dom_capability_raw is not None: - qspf_dom_capability_data = sfpi_obj.parse_qsfp_dom_capability(qsfp_dom_capability_raw, 0) + qspf_dom_capability_data = sfpi_obj.parse_dom_capability(qsfp_dom_capability_raw, 0) else: return None @@ -895,7 +895,7 @@ def get_tx_power(self): qsfp_dom_capability_raw = self.__read_eeprom_specific_bytes((offset_xcvr + XCVR_DOM_CAPABILITY_OFFSET), XCVR_DOM_CAPABILITY_WIDTH) if qsfp_dom_capability_raw is not None: - qspf_dom_capability_data = sfpi_obj.parse_qsfp_dom_capability(qsfp_dom_capability_raw, 0) + qspf_dom_capability_data = sfpi_obj.parse_dom_capability(qsfp_dom_capability_raw, 0) else: return None diff --git a/platform/broadcom/sonic-platform-modules-inventec/d6356/sonic_platform/qsfp.py b/platform/broadcom/sonic-platform-modules-inventec/d6356/sonic_platform/qsfp.py index c002697d96a3..2cc4b6ca593a 100644 --- a/platform/broadcom/sonic-platform-modules-inventec/d6356/sonic_platform/qsfp.py +++ b/platform/broadcom/sonic-platform-modules-inventec/d6356/sonic_platform/qsfp.py @@ -388,7 +388,7 @@ def get_transceiver_bulk_status(self): # in SFF-8636 dom capability definitions evolving with the versions. qsfp_dom_capability_raw = self.__read_eeprom_specific_bytes((offset_xcvr + XCVR_DOM_CAPABILITY_OFFSET), XCVR_DOM_CAPABILITY_WIDTH) if qsfp_dom_capability_raw is not None: - qspf_dom_capability_data = sfpi_obj.parse_qsfp_dom_capability(qsfp_dom_capability_raw, 0) + qspf_dom_capability_data = sfpi_obj.parse_dom_capability(qsfp_dom_capability_raw, 0) else: return None diff --git a/platform/broadcom/sonic-platform-modules-inventec/d7054q28b/sonic_platform/sfp.py b/platform/broadcom/sonic-platform-modules-inventec/d7054q28b/sonic_platform/sfp.py index 760aa179c256..a18d98d502f5 100644 --- a/platform/broadcom/sonic-platform-modules-inventec/d7054q28b/sonic_platform/sfp.py +++ b/platform/broadcom/sonic-platform-modules-inventec/d7054q28b/sonic_platform/sfp.py @@ -636,7 +636,7 @@ def get_transceiver_bulk_status(self): qsfp_dom_capability_raw = self.__read_eeprom_specific_bytes( (offset_xcvr + XCVR_DOM_CAPABILITY_OFFSET), XCVR_DOM_CAPABILITY_WIDTH) if qsfp_dom_capability_raw is not None: - qspf_dom_capability_data = sfpi_obj.parse_qsfp_dom_capability( + qspf_dom_capability_data = sfpi_obj.parse_dom_capability( qsfp_dom_capability_raw, 0) else: return None diff --git a/platform/broadcom/sonic-platform-modules-inventec/debian/control b/platform/broadcom/sonic-platform-modules-inventec/debian/control index d5ba6b0869e8..7a435d9b6e60 100644 --- a/platform/broadcom/sonic-platform-modules-inventec/debian/control +++ b/platform/broadcom/sonic-platform-modules-inventec/debian/control @@ -7,35 +7,35 @@ Standards-Version: 3.9.3 Package: platform-modules-d7032q28b Architecture: amd64 -Depends: linux-image-4.19.0-9-2-amd64-unsigned +Depends: linux-image-4.19.0-12-2-amd64-unsigned Description: kernel modules for platform devices such as fan, led Package: platform-modules-d7054q28b Architecture: amd64 -Depends: linux-image-4.19.0-9-2-amd64-unsigned +Depends: linux-image-4.19.0-12-2-amd64-unsigned Description: kernel modules for platform devices such as fan, led Package: platform-modules-d6254qs Architecture: amd64 -Depends: linux-image-4.19.0-9-2-amd64-unsigned +Depends: linux-image-4.19.0-12-2-amd64-unsigned Description: kernel modules for platform devices such as fan, led Package: platform-modules-d6556 Architecture: amd64 -Depends: linux-image-4.19.0-9-2-amd64-unsigned +Depends: linux-image-4.19.0-12-2-amd64-unsigned Description: kernel modules for platform devices such as fan, led Package: platform-modules-d6356 Architecture: amd64 -Depends: linux-image-4.19.0-9-2-amd64-unsigned +Depends: linux-image-4.19.0-12-2-amd64-unsigned Description: kernel modules for platform devices such as fan, led Package: platform-modules-d7264q28b Architecture: amd64 -Depends: linux-image-4.19.0-9-2-amd64-unsigned +Depends: linux-image-4.19.0-12-2-amd64-unsigned Description: kernel modules for platform devices such as fan, led Package: platform-modules-d6332 Architecture: amd64 -Depends: linux-image-4.19.0-9-2-amd64-unsigned +Depends: linux-image-4.19.0-12-2-amd64-unsigned Description: kernel modules for platform devices such as fan, led diff --git a/platform/broadcom/sonic-platform-modules-mitac/debian/control b/platform/broadcom/sonic-platform-modules-mitac/debian/control index f1a62577f6e2..f909c6af9489 100644 --- a/platform/broadcom/sonic-platform-modules-mitac/debian/control +++ b/platform/broadcom/sonic-platform-modules-mitac/debian/control @@ -7,6 +7,6 @@ Standards-Version: 3.9.3 Package: sonic-platform-mitac-ly1200-32x Architecture: amd64 -Depends: linux-image-4.19.0-9-2-amd64-unsigned +Depends: linux-image-4.19.0-12-2-amd64-unsigned Description: kernel modules for platform devices such as fan, led, sfp diff --git a/platform/broadcom/sonic-platform-modules-quanta/LICENSE b/platform/broadcom/sonic-platform-modules-quanta/LICENSE old mode 100755 new mode 100644 diff --git a/platform/broadcom/sonic-platform-modules-quanta/debian/changelog b/platform/broadcom/sonic-platform-modules-quanta/debian/changelog index fe1cfa45490b..ff5d9587c4c9 100644 --- a/platform/broadcom/sonic-platform-modules-quanta/debian/changelog +++ b/platform/broadcom/sonic-platform-modules-quanta/debian/changelog @@ -32,3 +32,17 @@ sonic-quanta-platform-modules (1.0) unstable; urgency=low * Initial release -- Jonathan Tsai Thu, 31 Jan 2019 13:09:01 +0800 + +sonic-quanta-platform-modules (1.0) unstable; urgency=low + + * Add support for Quanta IX7-BWDE-32X + * Initial release + + -- Robert Hong Tue, 2 Mar 2021 11:07:01 +0800 + +sonic-quanta-platform-modules (1.0) unstable; urgency=low + + * Add support for Quanta IX8A-BWDE-56X + * Initial release + + -- Robert Hong Tue, 2 Mar 2021 15:20:01 +0800 diff --git a/platform/broadcom/sonic-platform-modules-quanta/debian/compat b/platform/broadcom/sonic-platform-modules-quanta/debian/compat old mode 100755 new mode 100644 diff --git a/platform/broadcom/sonic-platform-modules-quanta/debian/control b/platform/broadcom/sonic-platform-modules-quanta/debian/control index f25b0d8e3c5b..c42a033806ab 100644 --- a/platform/broadcom/sonic-platform-modules-quanta/debian/control +++ b/platform/broadcom/sonic-platform-modules-quanta/debian/control @@ -13,10 +13,18 @@ Package: sonic-platform-quanta-ix7-32x Architecture: amd64 Description: kernel modules for platform devices such as psu, led, sfp +Package: sonic-platform-quanta-ix7-bwde-32x +Architecture: amd64 +Description: kernel modules for platform devices such as psu, led, sfp + Package: sonic-platform-quanta-ix8-56x Architecture: amd64 Description: kernel modules for platform devices such as psu, led, sfp +Package: sonic-platform-quanta-ix8a-bwde-56x +Architecture: amd64 +Description: kernel modules for platform devices such as psu, led, sfp + Package: sonic-platform-quanta-ix8c-56x Architecture: amd64 Description: kernel modules for platform devices such as psu, led, sfp diff --git a/platform/broadcom/sonic-platform-modules-quanta/debian/rules b/platform/broadcom/sonic-platform-modules-quanta/debian/rules index 46b9607135a8..9ddb76355592 100755 --- a/platform/broadcom/sonic-platform-modules-quanta/debian/rules +++ b/platform/broadcom/sonic-platform-modules-quanta/debian/rules @@ -13,44 +13,54 @@ include /usr/share/dpkg/pkg-info.mk export INSTALL_MOD_DIR:=extra -PYTHON ?= python2 PACKAGE_PRE_NAME := sonic-platform-quanta KVERSION ?= $(shell uname -r) KERNEL_SRC := /lib/modules/$(KVERSION) MOD_SRC_DIR:= $(shell pwd) -MODULE_DIRS:= ix1b-32x ix7-32x ix8-56x ix8c-56x ix9-32x +MODULE_DIRS:= ix1b-32x ix7-32x ix7-bwde-32x ix8-56x ix8a-bwde-56x ix8c-56x ix9-32x MODULE_DIR := modules UTILS_DIR := utils SERVICE_DIR := service CLASSES_DIR := classes CONF_DIR := conf - +SYSTEMD_DIR := systemd %: - dh $@ --with systemd,python2,python3 --buildsystem=pybuild + dh $@ --with systemd,python3 --buildsystem=pybuild clean: dh_testdir dh_testroot dh_clean + (for mod in $(MODULE_DIRS); do \ + if [ -f $(MOD_SRC_DIR)/$${mod}/*.whl ]; then \ + rm -f $(MOD_SRC_DIR)/$${mod}/*.whl; \ + fi; \ + done) build: #make modules -C $(KERNEL_SRC)/build M=$(MODULE_SRC) (for mod in $(MODULE_DIRS); do \ make modules -C $(KERNEL_SRC)/build M=$(MOD_SRC_DIR)/$${mod}/modules; \ - $(PYTHON) $${mod}/setup.py build; \ + python3 $${mod}/setup.py build; \ + cd $(MOD_SRC_DIR)/$${mod}; \ + if [ -f sonic_platform_setup.py ]; then \ + python3 sonic_platform_setup.py bdist_wheel -d $(MOD_SRC_DIR)/$${mod}; \ + echo "Finished makig whl package for $$mod"; \ + fi; \ + cd $(MOD_SRC_DIR); \ done) binary: binary-arch binary-indep # Nothing to do -binary-arch: +binary-arch: # Nothing to do #install: build #dh_testdir #dh_testroot - #dh_clean -k + #dh_clean -k #dh_installdirs binary-indep: @@ -62,10 +72,12 @@ binary-indep: dh_installdirs -p$(PACKAGE_PRE_NAME)-$${mod} $(KERNEL_SRC)/$(INSTALL_MOD_DIR); \ dh_installdirs -p$(PACKAGE_PRE_NAME)-$${mod} usr/local/bin; \ dh_installdirs -p$(PACKAGE_PRE_NAME)-$${mod} lib/systemd/system; \ + dh_installdirs -p$(PACKAGE_PRE_NAME)-$${mod} lib/systemd/system.conf.d/; \ cp $(MOD_SRC_DIR)/$${mod}/$(MODULE_DIR)/*.ko debian/$(PACKAGE_PRE_NAME)-$${mod}/$(KERNEL_SRC)/$(INSTALL_MOD_DIR); \ cp $(MOD_SRC_DIR)/$${mod}/$(UTILS_DIR)/* debian/$(PACKAGE_PRE_NAME)-$${mod}/usr/local/bin/; \ cp $(MOD_SRC_DIR)/$${mod}/$(SERVICE_DIR)/*.service debian/$(PACKAGE_PRE_NAME)-$${mod}/lib/systemd/system/; \ - $(PYTHON) $${mod}/setup.py install --root=$(MOD_SRC_DIR)/debian/$(PACKAGE_PRE_NAME)-$${mod} --install-layout=deb; \ + cp $(MOD_SRC_DIR)/$${mod}/$(SYSTEMD_DIR)/*.conf debian/$(PACKAGE_PRE_NAME)-$${mod}/lib/systemd/system.conf.d/; \ + python3 $${mod}/setup.py install --root=$(MOD_SRC_DIR)/debian/$(PACKAGE_PRE_NAME)-$${mod} --install-layout=deb; \ done) # Resuming debhelper scripts dh_testroot diff --git a/platform/broadcom/sonic-platform-modules-quanta/debian/sonic-platform-quanta-ix7-32x.install b/platform/broadcom/sonic-platform-modules-quanta/debian/sonic-platform-quanta-ix7-32x.install new file mode 100644 index 000000000000..963de8a12252 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/debian/sonic-platform-quanta-ix7-32x.install @@ -0,0 +1 @@ +ix7-32x/sonic_platform-1.0-py3-none-any.whl usr/share/sonic/device/x86_64-quanta_ix7_rglbmc-r0 diff --git a/platform/broadcom/sonic-platform-modules-quanta/debian/sonic-platform-quanta-ix7-bwde-32x.install b/platform/broadcom/sonic-platform-modules-quanta/debian/sonic-platform-quanta-ix7-bwde-32x.install new file mode 100644 index 000000000000..866d77a44ff5 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/debian/sonic-platform-quanta-ix7-bwde-32x.install @@ -0,0 +1 @@ +ix7-bwde-32x/sonic_platform-1.0-py3-none-any.whl usr/share/sonic/device/x86_64-quanta_ix7_bwde-r0 diff --git a/platform/broadcom/sonic-platform-modules-quanta/debian/sonic-platform-quanta-ix8-56x.install b/platform/broadcom/sonic-platform-modules-quanta/debian/sonic-platform-quanta-ix8-56x.install new file mode 100644 index 000000000000..5984981414b5 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/debian/sonic-platform-quanta-ix8-56x.install @@ -0,0 +1 @@ +ix8-56x/sonic_platform-1.0-py3-none-any.whl usr/share/sonic/device/x86_64-quanta_ix8_rglbmc-r0 diff --git a/platform/broadcom/sonic-platform-modules-quanta/debian/sonic-platform-quanta-ix8a-bwde-56x.install b/platform/broadcom/sonic-platform-modules-quanta/debian/sonic-platform-quanta-ix8a-bwde-56x.install new file mode 100644 index 000000000000..02c2aba9a95a --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/debian/sonic-platform-quanta-ix8a-bwde-56x.install @@ -0,0 +1 @@ +ix8a-bwde-56x/sonic_platform-1.0-py3-none-any.whl usr/share/sonic/device/x86_64-quanta_ix8a_bwde-r0 diff --git a/platform/broadcom/sonic-platform-modules-quanta/debian/sonic-platform-quanta-ix8c-56x.install b/platform/broadcom/sonic-platform-modules-quanta/debian/sonic-platform-quanta-ix8c-56x.install new file mode 100644 index 000000000000..e1a2dbe98a9e --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/debian/sonic-platform-quanta-ix8c-56x.install @@ -0,0 +1 @@ +ix8c-56x/sonic_platform-1.0-py3-none-any.whl usr/share/sonic/device/x86_64-quanta_ix8c_bwde-r0 diff --git a/platform/broadcom/sonic-platform-modules-quanta/debian/sonic-platform-quanta-ix9-32x.install b/platform/broadcom/sonic-platform-modules-quanta/debian/sonic-platform-quanta-ix9-32x.install new file mode 100644 index 000000000000..e1131c68c651 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/debian/sonic-platform-quanta-ix9-32x.install @@ -0,0 +1 @@ +ix9-32x/sonic_platform-1.0-py3-none-any.whl usr/share/sonic/device/x86_64-quanta_ix9_bwde-r0 diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix1b-32x/modules/qci_cpld_qsfp28.c b/platform/broadcom/sonic-platform-modules-quanta/ix1b-32x/modules/qci_cpld_qsfp28.c index 15c5369fd219..92fa9a13c493 100755 --- a/platform/broadcom/sonic-platform-modules-quanta/ix1b-32x/modules/qci_cpld_qsfp28.c +++ b/platform/broadcom/sonic-platform-modules-quanta/ix1b-32x/modules/qci_cpld_qsfp28.c @@ -396,8 +396,11 @@ static int cpld_remove(struct i2c_client *client) kfree(data->port_data[i]); } - if (cpld_idr_is_empty(&cpld_ida.idr)) + if (ida_is_empty(&cpld_ida)) + { class_destroy(cpld_class); + cpld_class = NULL; + } return 0; } diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix7-32x/modules/Makefile b/platform/broadcom/sonic-platform-modules-quanta/ix7-32x/modules/Makefile index 405c9153c091..c36586fa82ad 100644 --- a/platform/broadcom/sonic-platform-modules-quanta/ix7-32x/modules/Makefile +++ b/platform/broadcom/sonic-platform-modules-quanta/ix7-32x/modules/Makefile @@ -1,3 +1,3 @@ -obj-m:=qci_cpld.o qci_cpld_led.o quanta_platform_ix7.o +obj-m:=qci_cpld.o qci_cpld_led.o quanta_platform_ix7.o quanta_hwmon_ipmi.o diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix7-32x/modules/qci_cpld.c b/platform/broadcom/sonic-platform-modules-quanta/ix7-32x/modules/qci_cpld.c index e8556bc72d46..1d2bf2023336 100644 --- a/platform/broadcom/sonic-platform-modules-quanta/ix7-32x/modules/qci_cpld.c +++ b/platform/broadcom/sonic-platform-modules-quanta/ix7-32x/modules/qci_cpld.c @@ -172,11 +172,20 @@ static ssize_t get_module_present(struct device *dev, u8 group = (u8)(data->cpld_port / 4); u8 group_port = data->cpld_port % 4; s32 value; + int retry = 0; dev_dbg(&client->dev, "port_id %d => cpld_port %d, group %d(%d)\n", data->port_id, data->cpld_port + 1, group + 1, group_port + 1); - value = i2c_smbus_read_word_data(client, get_group_cmd(group)); + for (retry = 0; retry < 10; retry++) + { + value = i2c_smbus_read_word_data(client, get_group_cmd(group)); + if (value >= 0) + break; + else + printk("%s: retry:%d\n", __FUNCTION__, retry); + msleep(1); + } if (value < 0) return -ENODEV; @@ -338,7 +347,7 @@ static int cpld_probe(struct i2c_client *client, if (!cpld_class) { - cpld_class = class_create(THIS_MODULE, name); + cpld_class = class_create(THIS_MODULE, "cpld-qsfp28"); if (IS_ERR(cpld_class)) { pr_err("couldn't create sysfs class\n"); return PTR_ERR(cpld_class); @@ -405,7 +414,7 @@ static int cpld_probe(struct i2c_client *client, } /* FIXME: for older kernel doesn't with idr_is_empty function, implement here */ -#if 1 +#if 0 static int idr_has_entry(int id, void *p, void *data) { return 1; @@ -438,8 +447,11 @@ static int cpld_remove(struct i2c_client *client) kfree(data->port_data[i]); } - if (cpld_idr_is_empty(&cpld_ida.idr)) + if (ida_is_empty(&cpld_ida)) + { class_destroy(cpld_class); + cpld_class = NULL; + } return 0; } diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix7-32x/modules/qci_cpld_led.c b/platform/broadcom/sonic-platform-modules-quanta/ix7-32x/modules/qci_cpld_led.c index 37fc2e07246e..64841e8538f6 100644 --- a/platform/broadcom/sonic-platform-modules-quanta/ix7-32x/modules/qci_cpld_led.c +++ b/platform/broadcom/sonic-platform-modules-quanta/ix7-32x/modules/qci_cpld_led.c @@ -241,6 +241,7 @@ static int cpld_led_probe(struct i2c_client *client, return nr; } +#if 0 /* FIXME: for older kernel doesn't with idr_is_empty function, implement here */ static int idr_has_entry(int id, void *p, void *data) { @@ -251,6 +252,7 @@ static bool cpld_idr_is_empty(struct idr *idp) { return !idr_for_each(idp, idr_has_entry, NULL); } +#endif static int cpld_led_remove(struct i2c_client *client) { @@ -261,8 +263,11 @@ static int cpld_led_remove(struct i2c_client *client) ida_simple_remove(&cpld_led_ida, data->cpld_data->cpld_id); kfree(data->cpld_data); - if (cpld_idr_is_empty(&cpld_led_ida.idr)) + if (ida_is_empty(&cpld_led_ida)) + { class_destroy(cpld_class); + cpld_class = NULL; + } return 0; } diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix7-32x/modules/quanta_hwmon_ipmi.c b/platform/broadcom/sonic-platform-modules-quanta/ix7-32x/modules/quanta_hwmon_ipmi.c new file mode 100644 index 000000000000..08d6a97d9a09 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix7-32x/modules/quanta_hwmon_ipmi.c @@ -0,0 +1,1908 @@ +/* +* +* A hwmon driver for the Quanta switch BMC hwmon +* +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define enable_debug_msg 0 +#define DEBUGUSE_SHIFT 0 + +#define DRVNAME "quanta_hwmon_ipmi" + +#define tos32(val, bits) ((val & ((1<<((bits)-1)))) ? (-((val) & (1<<((bits)-1))) | (val)) : (val)) +#define BSWAP_16(x) ((((x) & 0xff00) >> 8) | (((x) & 0x00ff) << 8)) +#define BSWAP_32(x) ((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >> 8) | (((x) & 0x0000ff00) << 8) | (((x) & 0x000000ff) << 24)) +#define __TO_M(mtol) (int16_t)(tos32((((BSWAP_16(mtol) & 0xff00) >> 8) | ((BSWAP_16(mtol) & 0xc0) << 2)), 10)) +#define __TO_B(bacc) (int32_t)(tos32((((BSWAP_32(bacc) & 0xff000000) >> 24) | ((BSWAP_32(bacc) & 0xc00000) >> 14)), 10)) +#define __TO_R_EXP(bacc) (int32_t)(tos32(((BSWAP_32(bacc) & 0xf0) >> 4), 4)) +#define __TO_B_EXP(bacc) (int32_t)(tos32((BSWAP_32(bacc) & 0xf), 4)) + +#define SENSOR_ATTR_MAX 19 +#define SENSOR_ATTR_NAME_LENGTH 20 + +#define SENSOR_GET_CAP_LABEL 0x001 +#define SENSOR_GET_CAP_ALARM 0x002 +#define SENSOR_GET_CAP_INPUT 0x004 + +#define SENSOR_GET_CAP_LNC 0x008 +#define SENSOR_GET_CAP_LCR 0x010 +#define SENSOR_GET_CAP_LNR 0x020 + +#define SENSOR_GET_CAP_UNC 0x040 +#define SENSOR_GET_CAP_UCR 0x080 +#define SENSOR_GET_CAP_UNR 0x100 + +#define SENSOR_GET_CAP_MODEL 0x200 +#define SENSOR_GET_CAP_SN 0x400 +#define SENSOR_GET_CAP_PWM 0x800 + +#define SENSOR_GET_CAP_CONMODE 0x1000 +#define SENSOR_GET_CAP_DIRECTION 0x2000 +#define SENSOR_GET_CAP_FAN_PRESENT 0x4000 +#define SENSOR_GET_CAP_PSU_PRESENT 0x8000 + +#define SENSOR_GET_CAP_MFRID 0x10000 +#define SENSOR_GET_CAP_VIN_TYPE 0x20000 +#define SENSOR_GET_CAP_POUT_MAX 0x40000 + +#define SDR_SENSOR_TYPE_TEMP 0x01 +#define SDR_SENSOR_TYPE_VOLT 0x02 +#define SDR_SENSOR_TYPE_CURR 0x03 +#define SDR_SENSOR_TYPE_FAN 0x04 +#define SDR_SENSOR_TYPE_PS 0x08 +#define SDR_SENSOR_TYPE_OTHER 0x0b + +#define BMC_GET_DEVICE_ID 0x01 + +#define IPMI_NETFN_SE 0x04 +#define IPMI_NETFN_APP 0x06 +#define IPMI_NETFN_STORAGE 0x0a +#define IPMI_NETFN_TSOL 0x30 + +#define GET_SDR_REPO_INFO 0x20 +#define GET_DEVICE_SDR 0x21 +#define GET_SDR_RESERVE_REPO 0x22 +#define GET_SDR 0x23 +#define GET_SENSOR_THRESHOLDS 0x27 +#define GET_SENSOR_EVENT_ENABLE 0x29 +#define GET_SENSOR_EVENT_STATUS 0x2b +#define GET_SENSOR_READING 0x2d +#define GET_PSU_READING 0x52 +#define GET_FAN_INFO 0xd6 +#define GET_FRU_INFO 0x11 + +#define IPM_DEV_DEVICE_ID_SDR_MASK (0x80) /* 1 = provides SDRs */ +#define IPMI_TIMEOUT (4 * HZ) +#define IPMI_MAX_WAIT_QUEUE 1 + +struct quanta_hwmon_ipmi_data +{ + struct platform_device *ipmi_platform_dev; + struct device *ipmi_hwmon_dev; + /*struct mutex ipmi_lock; */ + + int32_t total_sensor_id; + int32_t total_suport_sensor; + int32_t total_create_sysfs; +} *data; + +static struct mutex ipmi_lock; +static struct completion g_read_complete; + +static ipmi_user_t ipmi_mh_user = NULL; + +static int8_t g_fan_control_mode = 3; +static int32_t g_use_built_in = 0; +static int32_t ipmi_wait_queue = 0; + +struct ipmi_sensor_data +{ + uint8_t addr; + uint8_t sensor_type; + uint8_t sensor_idstring[SENSOR_ATTR_NAME_LENGTH]; + + uint32_t capability; + + struct header_info + { + uint8_t header_type; + uint8_t header_byte; + } headerinfo; + + struct record_info + { + uint8_t record_analog; + uint8_t record_linearization; + + int32_t record_m; + int32_t record_b; + int32_t record_k1; + int32_t record_k2; + } recordinfo; + + struct threshold_upper_info + { + uint8_t unr; + uint8_t ucr; + uint8_t unc; + } upperinfo; + + struct threshold_lower_info + { + uint8_t lnr; + uint8_t lcr; + uint8_t lnc; + } lowerinfo; + + struct attr_info + { + bool attr_exist; + char attr_name[SENSOR_ATTR_MAX][SENSOR_ATTR_NAME_LENGTH]; + char attr_type_str[SENSOR_ATTR_NAME_LENGTH]; + + struct attribute *attrs[SENSOR_ATTR_MAX + 1]; + struct attribute_group attr_group; + struct sensor_device_attribute sd_attrs[SENSOR_ATTR_MAX + 1]; + } attrinfo; + +} *g_sensor_data; + +struct ipmi_comm_data +{ + int32_t tx_id; + + int32_t rx_result; + int64_t rx_len; + void *rx_data; + struct completion *rx_read_complete; +}; + +struct ipmi_sdr_iterator +{ + uint16_t reservation; + int32_t total; + int32_t next; +}; + +struct ipm_devid_rsp +{ + uint8_t device_id; + uint8_t device_revision; + uint8_t fw_rev1; + uint8_t fw_rev2; + uint8_t ipmi_version; + uint8_t adtl_device_support; + uint8_t manufacturer_id[3]; + uint8_t product_id[2]; + uint8_t aux_fw_rev[4]; +} __attribute__((packed)); + +struct sdr_repo_info_rs +{ + uint8_t version; /* SDR version (51h) */ + uint16_t count; /* number of records */ + uint16_t free; /* free space in SDR */ + uint32_t add_stamp; /* last add timestamp */ + uint32_t erase_stamp; /* last del timestamp */ + uint8_t op_support; /* supported operations */ +} __attribute__((packed)); + +struct sdr_device_info_rs +{ + uint8_t count; /* number of records */ + uint8_t flags; /* flags */ + uint8_t popChangeInd[3]; /* free space in SDR */ +} __attribute__((packed)); + +struct sdr_get_rs +{ + uint16_t next; /* next record id */ + uint16_t id; /* record ID */ + uint8_t version; /* SDR version (51h) */ +#define SDR_RECORD_TYPE_FULL_SENSOR 0x01 +#define SDR_RECORD_TYPE_COMPACT_SENSOR 0x02 +#define SDR_RECORD_TYPE_EVENTONLY_SENSOR 0x03 +#define SDR_RECORD_TYPE_ENTITY_ASSOC 0x08 +#define SDR_RECORD_TYPE_DEVICE_ENTITY_ASSOC 0x09 +#define SDR_RECORD_TYPE_GENERIC_DEVICE_LOCATOR 0x10 +#define SDR_RECORD_TYPE_FRU_DEVICE_LOCATOR 0x11 +#define SDR_RECORD_TYPE_MC_DEVICE_LOCATOR 0x12 +#define SDR_RECORD_TYPE_MC_CONFIRMATION 0x13 +#define SDR_RECORD_TYPE_BMC_MSG_CHANNEL_INFO 0x14 +#define SDR_RECORD_TYPE_OEM 0xc0 + uint8_t type; /* record type */ + uint8_t length; /* remaining record bytes */ +} __attribute__((packed)); + +struct sdr_get_rq +{ + uint16_t reserve_id; /* reservation ID */ + uint16_t id; /* record ID */ + uint8_t offset; /* offset into SDR */ +#define GET_SDR_ENTIRE_RECORD 0xff + uint8_t length; /* length to read */ +} __attribute__((packed)); + +struct entity_id +{ + uint8_t id; /* physical entity id */ +#ifdef WORDS_BIGENDIAN + uint8_t logical : 1; /* physical/logical */ + uint8_t instance : 7; /* instance number */ +#else + uint8_t instance : 7; /* instance number */ + uint8_t logical : 1; /* physical/logical */ +#endif +} __attribute__((packed)); + +struct sdr_record_mask +{ + union + { + struct + { + uint16_t assert_event; /* assertion event mask */ + uint16_t deassert_event; /* de-assertion event mask */ + uint16_t read; /* discrete reading mask */ + } discrete; + struct + { +#ifdef WORDS_BIGENDIAN + uint16_t reserved : 1; + uint16_t status_lnr : 1; + uint16_t status_lcr : 1; + uint16_t status_lnc : 1; + uint16_t assert_unr_high : 1; + uint16_t assert_unr_low : 1; + uint16_t assert_ucr_high : 1; + uint16_t assert_ucr_low : 1; + uint16_t assert_unc_high : 1; + uint16_t assert_unc_low : 1; + uint16_t assert_lnr_high : 1; + uint16_t assert_lnr_low : 1; + uint16_t assert_lcr_high : 1; + uint16_t assert_lcr_low : 1; + uint16_t assert_lnc_high : 1; + uint16_t assert_lnc_low : 1; +#else + uint16_t assert_lnc_low : 1; + uint16_t assert_lnc_high : 1; + uint16_t assert_lcr_low : 1; + uint16_t assert_lcr_high : 1; + uint16_t assert_lnr_low : 1; + uint16_t assert_lnr_high : 1; + uint16_t assert_unc_low : 1; + uint16_t assert_unc_high : 1; + uint16_t assert_ucr_low : 1; + uint16_t assert_ucr_high : 1; + uint16_t assert_unr_low : 1; + uint16_t assert_unr_high : 1; + uint16_t status_lnc : 1; + uint16_t status_lcr : 1; + uint16_t status_lnr : 1; + uint16_t reserved : 1; +#endif +#ifdef WORDS_BIGENDIAN + uint16_t reserved_2 : 1; + uint16_t status_unr : 1; + uint16_t status_ucr : 1; + uint16_t status_unc : 1; + uint16_t deassert_unr_high : 1; + uint16_t deassert_unr_low : 1; + uint16_t deassert_ucr_high : 1; + uint16_t deassert_ucr_low : 1; + uint16_t deassert_unc_high : 1; + uint16_t deassert_unc_low : 1; + uint16_t deassert_lnr_high : 1; + uint16_t deassert_lnr_low : 1; + uint16_t deassert_lcr_high : 1; + uint16_t deassert_lcr_low : 1; + uint16_t deassert_lnc_high : 1; + uint16_t deassert_lnc_low : 1; +#else + uint16_t deassert_lnc_low : 1; + uint16_t deassert_lnc_high : 1; + uint16_t deassert_lcr_low : 1; + uint16_t deassert_lcr_high : 1; + uint16_t deassert_lnr_low : 1; + uint16_t deassert_lnr_high : 1; + uint16_t deassert_unc_low : 1; + uint16_t deassert_unc_high : 1; + uint16_t deassert_ucr_low : 1; + uint16_t deassert_ucr_high : 1; + uint16_t deassert_unr_low : 1; + uint16_t deassert_unr_high : 1; + uint16_t status_unc : 1; + uint16_t status_ucr : 1; + uint16_t status_unr : 1; + uint16_t reserved_2 : 1; +#endif + union + { + struct + { +#ifdef WORDS_BIGENDIAN /* settable threshold mask */ + uint16_t reserved : 2; + uint16_t unr : 1; + uint16_t ucr : 1; + uint16_t unc : 1; + uint16_t lnr : 1; + uint16_t lcr : 1; + uint16_t lnc : 1; + /* padding lower 8 bits */ + uint16_t readable : 8; +#else + uint16_t readable : 8; + uint16_t lnc : 1; + uint16_t lcr : 1; + uint16_t lnr : 1; + uint16_t unc : 1; + uint16_t ucr : 1; + uint16_t unr : 1; + uint16_t reserved : 2; +#endif + } set; + struct + { +#ifdef WORDS_BIGENDIAN /* readable threshold mask */ + /* padding upper 8 bits */ + uint16_t settable : 8; + uint16_t reserved : 2; + uint16_t unr : 1; + uint16_t ucr : 1; + uint16_t unc : 1; + uint16_t lnr : 1; + uint16_t lcr : 1; + uint16_t lnc : 1; +#else + uint16_t lnc : 1; + uint16_t lcr : 1; + uint16_t lnr : 1; + uint16_t unc : 1; + uint16_t ucr : 1; + uint16_t unr : 1; + uint16_t reserved : 2; + uint16_t settable : 8; +#endif + } read; + }; + } threshold; + } type; +} __attribute__((packed)); + +struct sdr_record_full_sensor +{ + struct + { + uint8_t owner_id; +#ifdef WORDS_BIGENDIAN + uint8_t channel : 4; /* channel number */ + uint8_t __reserved : 2; + uint8_t lun : 2; /* sensor owner lun */ +#else + uint8_t lun : 2; /* sensor owner lun */ + uint8_t __reserved : 2; + uint8_t channel : 4; /* channel number */ +#endif + uint8_t sensor_num; /* unique sensor number */ + } keys; + + struct entity_id entity; + + struct + { + struct + { +#ifdef WORDS_BIGENDIAN + uint8_t __reserved : 1; + uint8_t scanning : 1; + uint8_t events : 1; + uint8_t thresholds : 1; + uint8_t hysteresis : 1; + uint8_t type : 1; + uint8_t event_gen : 1; + uint8_t sensor_scan : 1; +#else + uint8_t sensor_scan : 1; + uint8_t event_gen : 1; + uint8_t type : 1; + uint8_t hysteresis : 1; + uint8_t thresholds : 1; + uint8_t events : 1; + uint8_t scanning : 1; + uint8_t __reserved : 1; +#endif + } init; + struct + { +#ifdef WORDS_BIGENDIAN + uint8_t ignore : 1; + uint8_t rearm : 1; + uint8_t hysteresis : 2; + uint8_t threshold : 2; + uint8_t event_msg : 2; +#else + uint8_t event_msg : 2; + uint8_t threshold : 2; + uint8_t hysteresis : 2; + uint8_t rearm : 1; + uint8_t ignore : 1; +#endif + } capabilities; + uint8_t type; + } sensor; + + uint8_t event_type; /* event/reading type code */ + + struct sdr_record_mask mask; + + struct + { +#ifdef WORDS_BIGENDIAN + uint8_t analog : 2; + uint8_t rate : 3; + uint8_t modifier : 2; + uint8_t pct : 1; +#else + uint8_t pct : 1; + uint8_t modifier : 2; + uint8_t rate : 3; + uint8_t analog : 2; +#endif + struct + { + uint8_t base; + uint8_t modifier; + } type; + } unit; + +#define SDR_SENSOR_L_LINEAR 0x00 +#define SDR_SENSOR_L_LN 0x01 +#define SDR_SENSOR_L_LOG10 0x02 +#define SDR_SENSOR_L_LOG2 0x03 +#define SDR_SENSOR_L_E 0x04 +#define SDR_SENSOR_L_EXP10 0x05 +#define SDR_SENSOR_L_EXP2 0x06 +#define SDR_SENSOR_L_1_X 0x07 +#define SDR_SENSOR_L_SQR 0x08 +#define SDR_SENSOR_L_CUBE 0x09 +#define SDR_SENSOR_L_SQRT 0x0a +#define SDR_SENSOR_L_CUBERT 0x0b +#define SDR_SENSOR_L_NONLINEAR 0x70 + + uint8_t linearization; /* 70h=non linear, 71h-7Fh=non linear, OEM */ + uint16_t mtol; /* M, tolerance */ + uint32_t bacc; /* accuracy, B, Bexp, Rexp */ + + struct + { +#ifdef WORDS_BIGENDIAN + uint8_t __reserved : 5; + uint8_t normal_min : 1; /* normal min field specified */ + uint8_t normal_max : 1; /* normal max field specified */ + uint8_t nominal_read : 1; /* nominal reading field specified */ +#else + uint8_t nominal_read : 1; /* nominal reading field specified */ + uint8_t normal_max : 1; /* normal max field specified */ + uint8_t normal_min : 1; /* normal min field specified */ + uint8_t __reserved : 5; +#endif + } analog_flag; + + uint8_t nominal_read; /* nominal reading, raw value */ + uint8_t normal_max; /* normal maximum, raw value */ + uint8_t normal_min; /* normal minimum, raw value */ + uint8_t sensor_max; /* sensor maximum, raw value */ + uint8_t sensor_min; /* sensor minimum, raw value */ + + struct + { + struct + { + uint8_t non_recover; + uint8_t critical; + uint8_t non_critical; + } upper; + struct + { + uint8_t non_recover; + uint8_t critical; + uint8_t non_critical; + } lower; + struct + { + uint8_t positive; + uint8_t negative; + } hysteresis; + } threshold; + uint8_t __reserved[2]; + uint8_t oem; /* reserved for OEM use */ + uint8_t id_code; /* sensor ID string type/length code */ + uint8_t id_string[16]; /* sensor ID string bytes, only if id_code != 0 */ +} __attribute__((packed)); + +int32_t pow_convert(int32_t *a, int32_t b) +{ + /* function input parameter (a * 10 ^ b) */ + int32_t i = 0, r = 1, temp_b = 0; + + temp_b = (b > 0) ? b : -b; + + for (i = 0; i < temp_b; i++) + { + r = r * 10; + } + + if (b > 0) + { + *a = (*a) * r; + r = 1; + } + /* function return parameter calc_result = *a, decimal_point = r */ + return r; +} + +void simple_atoi(const char *buf, int8_t *output_val) +{ + while (*buf >= '0' && *buf <= '9') + { + *output_val = *output_val * 10 + *buf - '0'; + buf++; + } +} + +static void ipmi_msg_handler(struct ipmi_recv_msg *msg, void *handler_data) +{ + int32_t rv = -IPMI_UNKNOWN_ERR_COMPLETION_CODE; + + struct ipmi_comm_data *comm_data = msg->user_msg_data; + + ipmi_wait_queue--; + + if (msg->msg.data[0] != 0) + { + if ((msg->msg.data[0] != 0x83) && (msg->msg.netfn != 0x07) + && (msg->msg.cmd != 0x52)) + { + /*skip master r/w cmd return code */ + printk("ipmi: Error 0x%x on cmd 0x%x/0x%x\n", msg->msg.data[0], msg->msg.netfn, + msg->msg.cmd); + rv = msg->msg.data[0]; + goto get_BMC_response_fail; + } + } + + if (msg->msgid != comm_data->tx_id) + { + printk("ipmi: rx msgid %d mismatch tx msgid %d\n", (int32_t)msg->msgid, + comm_data->tx_id); + goto get_BMC_response_fail; + } + + if (msg->msg.data_len <= 0) + { + printk("ipmi: Data len too low (%d)\n", msg->msg.data_len); + goto get_BMC_response_fail; + } + + if (msg->msg.data_len > 1) + { + if (comm_data->rx_len) + { + comm_data->rx_len = msg->msg.data_len - 1; + memcpy(comm_data->rx_data, msg->msg.data + 1, comm_data->rx_len); + } + else + { + printk("ipmi: rx len = 0, it should be not retrun ?\n"); + goto get_BMC_response_fail; + } + } + + rv = 0; + +get_BMC_response_fail: + ipmi_free_recv_msg(msg); + + if (ipmi_wait_queue == 0) + { + comm_data->rx_result = rv; + if (rv == 0) + { + complete(comm_data->rx_read_complete); + } + } +} +static struct ipmi_user_hndl ipmi_hndlrs = { .ipmi_recv_hndl = ipmi_msg_handler, }; + +int32_t ipmi_request_wait_for_response(struct kernel_ipmi_msg msg, + struct ipmi_comm_data *comm_data) +{ + int32_t rv = 0; + int32_t escape_time = 0; + + struct ipmi_addr ipmi_address; + + if (ipmi_wait_queue >= IPMI_MAX_WAIT_QUEUE) + { + /* printk("msg queue full, cannot send ipmi cmd\n"); */ + return -EBUSY; + } + ipmi_wait_queue++; + + ipmi_address.addr_type = IPMI_SYSTEM_INTERFACE_ADDR_TYPE; + ipmi_address.channel = IPMI_BMC_CHANNEL; + ipmi_address.data[0] = 0; + + rv = ipmi_validate_addr(&ipmi_address, sizeof(ipmi_address)); + if (rv) + { + printk("ipmi_validate_addr fail, err code : %d\n", rv); + return rv; + } + + ipmi_request_settime(ipmi_mh_user, &ipmi_address, comm_data->tx_id, &msg, + comm_data, 0, 0, 0); + + escape_time = wait_for_completion_timeout(comm_data->rx_read_complete, + IPMI_TIMEOUT); + + rv = comm_data->rx_result; + if (escape_time == 0) + { + printk("BMC not response (%d)\n", escape_time); + } + + return rv; +} + +int32_t ipmi_send_system_cmd(uint8_t *msg_tx_data, int32_t msg_tx_len, + void *msg_rx_data, int32_t msg_rx_len) +{ + int32_t i = 0; + int32_t rv = 0; + + static uint64_t tx_msgid = 1; + + struct kernel_ipmi_msg msg; + struct ipmi_comm_data *comm_data = NULL; + struct completion read_complete; + + init_completion(&read_complete); + + /* prepare transfer message */ + msg.netfn = msg_tx_data[0]; + msg.cmd = msg_tx_data[1]; + msg.data_len = msg_tx_len - 2; + + msg.data = kzalloc(msg.data_len, GFP_KERNEL); + if (msg.data == NULL) + { + printk("%s(%d): malloc [msg.data] failure", __func__, __LINE__); + rv = -ENOMEM; + goto alloc_mem_fail; + } + + comm_data = kzalloc(sizeof(struct ipmi_comm_data), GFP_KERNEL); + if (comm_data == NULL) + { + printk("%s(%d): malloc [comm_data] failure", __func__, __LINE__); + rv = -ENOMEM; + goto alloc_mem_fail; + } + + for (i = 2; i < msg_tx_len; i++) + { + msg.data[i - 2] = msg_tx_data[i]; + } + + comm_data->tx_id = tx_msgid++; + + /* prepare recive message */ + comm_data->rx_data = msg_rx_data; + comm_data->rx_len = msg_rx_len; + comm_data->rx_result = -1; + comm_data->rx_read_complete = &read_complete; + + rv = ipmi_request_wait_for_response(msg, comm_data); + +alloc_mem_fail: + if (msg.data) + { + kfree(msg.data); + } + if (comm_data) + { + kfree(comm_data); + } + if (tx_msgid > UINT_MAX) + { + tx_msgid = 1; + } + + return rv; +} + +int32_t ipmi_sdr_get_reservation(uint16_t *reserve_id) +{ + int32_t rv = 0; + uint8_t msg_data[] = { 0x00, GET_SDR_RESERVE_REPO }; /*netfn = 0x00; cmd = GET_SDR_RESERVE_REPO; */ + + msg_data[0] = (g_use_built_in == 0) ? IPMI_NETFN_STORAGE : IPMI_NETFN_SE; + + /* obtain reservation ID */ + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), reserve_id, 1); + if (rv) + { + printk("BMC down at (%d)!!\n", __LINE__); + } + +#if enable_debug_msg + printk("SDR reservation ID %04x\n", *reserve_id); +#endif + + return rv; +} + +int32_t ipmi_sdr_start(struct ipmi_sdr_iterator *itr) +{ + int32_t rv = 0; + + uint8_t msg_data[] = { IPMI_NETFN_APP, BMC_GET_DEVICE_ID }; /*netfn = IPMI_NETFN_APP; cmd = BMC_GET_DEVICE_ID; */ + + struct ipm_devid_rsp devid; + + /* check SDRR capability */ + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), &devid, 1); + if (rv) + { + printk("BMC down at (%d)!!\n", __LINE__); + return rv; + } + + if (devid.device_revision & IPM_DEV_DEVICE_ID_SDR_MASK) + { + if ((devid.adtl_device_support & 0x02) == 0) + { + if ((devid.adtl_device_support & 0x01)) + { + printk("Using Device SDRs\n"); + g_use_built_in = 1; + } + else + { + printk("Error obtaining SDR info\n"); + } + } + } + + if (g_use_built_in == 0) + { + struct sdr_repo_info_rs sdr_info; + /* get sdr repository info */ + msg_data[0] = IPMI_NETFN_STORAGE; + msg_data[1] = GET_SDR_REPO_INFO; + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), &sdr_info, 1); + itr->total = sdr_info.count; + +#if enable_debug_msg + printk("SDR version: 0x%x\n", sdr_info.version); + printk("SDR free space: %d\n", sdr_info.free); +#endif + } + else + { + struct sdr_device_info_rs sdr_info; + /* get device sdr info */ + msg_data[0] = IPMI_NETFN_SE; + msg_data[1] = GET_SDR_REPO_INFO; + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), &sdr_info, 1); + itr->total = sdr_info.count; + } + +#if enable_debug_msg + printk("SDR records : %d\n", sdr_info.count); +#endif + + if (rv) + { + printk("BMC down at (%d)!!\n", __LINE__); + } + else + { + itr->next = 0; + rv = ipmi_sdr_get_reservation(&(itr->reservation)); + } + + return rv; +} + +int32_t ipmi_sdr_get_header(struct ipmi_sdr_iterator *itr, + struct sdr_get_rs *sdr_rs) +{ + int32_t rv = 0; + + uint8_t msg_data[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; /*netfn = 0x00; cmd = 0x00; */ + + struct sdr_get_rq sdr_rq; + + sdr_rq.reserve_id = itr->reservation; + sdr_rq.id = itr->next; + sdr_rq.offset = 0; + sdr_rq.length = 5; /* only get the header */ + + if (g_use_built_in == 0) + { + msg_data[0] = IPMI_NETFN_STORAGE; + msg_data[1] = GET_SDR; + } + else + { + msg_data[0] = IPMI_NETFN_SE; + msg_data[1] = GET_DEVICE_SDR; + } + + memcpy(msg_data + 2, (uint8_t *)&sdr_rq, sizeof(struct sdr_get_rq)); + + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), sdr_rs, 1); + if ((rv) || (sdr_rs->length == 0)) + { + printk("SDR record id 0x%04x: invalid length %d", itr->next, sdr_rs->length); + return -1; + } + + if (sdr_rs->id != itr->next) + { +#if enable_debug_msg + printk("SDR record id mismatch: 0x%04x\n", sdr_rs->id); +#endif + sdr_rs->id = itr->next; + } +#if enable_debug_msg + printk("\nSDR record ID : 0x%04x", itr->next); + printk("SDR record type : 0x%02x\n", sdr_rs->type); + printk("SDR record next : 0x%04x\n", sdr_rs->next); + printk("SDR record bytes: %d\n", sdr_rs->length); +#endif + + return rv; +} + +int32_t ipmi_sdr_get_record(struct sdr_get_rs *header, + struct ipmi_sdr_iterator *itr, uint8_t *ret_data) +{ + int32_t rv = 0, len = 0; + + uint8_t buff[128] = ""; + uint8_t msg_data[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; /*netfn = 0x00; cmd = 0x00; */ + + struct sdr_get_rq sdr_rq; + + len = header->length; + if (len > 0) + { + memset(&sdr_rq, 0, sizeof(sdr_rq)); + sdr_rq.reserve_id = itr->reservation; + sdr_rq.id = header->id; + sdr_rq.offset = 5; + sdr_rq.length = len; + + if (g_use_built_in == 0) + { + msg_data[0] = IPMI_NETFN_STORAGE; + msg_data[1] = GET_SDR; + } + else + { + msg_data[0] = IPMI_NETFN_SE; + msg_data[1] = GET_DEVICE_SDR; + } + + memcpy(msg_data + 2, (uint8_t *)&sdr_rq, sizeof(struct sdr_get_rq)); + + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), ret_data, 1); + if (rv) + { + printk("BMC down at (%d)!!\n", __LINE__); + } + else + { + memset(buff, 0, sizeof(buff)); + memcpy(buff, ret_data + 2, sdr_rq.length); + memcpy(ret_data, buff, sdr_rq.length + 2); + } + } + + return rv; +} + +void ipmi_sdr_set_sensor_threshold(uint8_t idx, + struct sdr_record_full_sensor *sensor) +{ + + /* lower threshold info */ + if (sensor->mask.type.threshold.read.lnc) + { + g_sensor_data[idx].capability |= SENSOR_GET_CAP_LNC; + } + if (sensor->mask.type.threshold.read.lcr) + { + g_sensor_data[idx].capability |= SENSOR_GET_CAP_LCR; + } + if (sensor->mask.type.threshold.read.lnr) + { + g_sensor_data[idx].capability |= SENSOR_GET_CAP_LNR; + } + g_sensor_data[idx].lowerinfo.lnc = sensor->threshold.lower.non_critical; + g_sensor_data[idx].lowerinfo.lcr = sensor->threshold.lower.critical; + g_sensor_data[idx].lowerinfo.lnr = sensor->threshold.lower.non_recover; + + /* upper threshold info */ + if (sensor->mask.type.threshold.read.unc) + { + g_sensor_data[idx].capability |= SENSOR_GET_CAP_UNC; + } + if (sensor->mask.type.threshold.read.ucr) + { + g_sensor_data[idx].capability |= SENSOR_GET_CAP_UCR; + } + if (sensor->mask.type.threshold.read.unr) + { + g_sensor_data[idx].capability |= SENSOR_GET_CAP_UNR; + } + g_sensor_data[idx].upperinfo.unc = sensor->threshold.upper.non_critical; + g_sensor_data[idx].upperinfo.ucr = sensor->threshold.upper.critical; + g_sensor_data[idx].upperinfo.unr = sensor->threshold.upper.non_recover; +} + +void ipmi_sdr_set_sensor_factor(uint8_t idx, + struct sdr_record_full_sensor *sensor) +{ + char *loc = NULL; + + g_sensor_data[idx].sensor_type = sensor->sensor.type; + sprintf(g_sensor_data[idx].sensor_idstring, "%s", sensor->id_string); + + g_sensor_data[idx].recordinfo.record_m = __TO_M(sensor->mtol); + g_sensor_data[idx].recordinfo.record_b = __TO_B(sensor->bacc); + g_sensor_data[idx].recordinfo.record_k1 = __TO_B_EXP(sensor->bacc); + g_sensor_data[idx].recordinfo.record_k2 = __TO_R_EXP(sensor->bacc); + + g_sensor_data[idx].recordinfo.record_analog = sensor->unit.analog; + g_sensor_data[idx].recordinfo.record_linearization = sensor->linearization; + + memset(g_sensor_data[idx].attrinfo.attr_type_str, 0x00, + SENSOR_ATTR_NAME_LENGTH); + + switch (g_sensor_data[idx].sensor_type) + { + case SDR_SENSOR_TYPE_TEMP: + sprintf(g_sensor_data[idx].attrinfo.attr_type_str, "temp"); + break; + case SDR_SENSOR_TYPE_VOLT: + sprintf(g_sensor_data[idx].attrinfo.attr_type_str, "in"); + break; + case SDR_SENSOR_TYPE_FAN: + g_sensor_data[idx].capability |= SENSOR_GET_CAP_PWM; + g_sensor_data[idx].capability |= SENSOR_GET_CAP_CONMODE; + g_sensor_data[idx].capability |= SENSOR_GET_CAP_DIRECTION; + sprintf(g_sensor_data[idx].attrinfo.attr_type_str, "fan"); + break; + case SDR_SENSOR_TYPE_PS: + loc = strstr(g_sensor_data[idx].sensor_idstring, "POWER"); + if (loc) + { + if ((strncmp(g_sensor_data[idx].sensor_idstring + 11, "OUT", 3)) == 0) + { + g_sensor_data[idx].capability |= SENSOR_GET_CAP_MODEL; + g_sensor_data[idx].capability |= SENSOR_GET_CAP_SN; + g_sensor_data[idx].capability |= SENSOR_GET_CAP_MFRID; + g_sensor_data[idx].capability |= SENSOR_GET_CAP_PSU_PRESENT; + g_sensor_data[idx].capability |= SENSOR_GET_CAP_VIN_TYPE; + g_sensor_data[idx].capability |= SENSOR_GET_CAP_POUT_MAX; + } + sprintf(g_sensor_data[idx].attrinfo.attr_type_str, "power"); + } + + loc = strstr(g_sensor_data[idx].sensor_idstring, "VOLTAGE"); + if (loc) + { + sprintf(g_sensor_data[idx].attrinfo.attr_type_str, "in"); + } + + loc = strstr(g_sensor_data[idx].sensor_idstring, "CURRENT"); + if (loc) + { + sprintf(g_sensor_data[idx].attrinfo.attr_type_str, "curr"); + } + + break; + case SDR_SENSOR_TYPE_CURR: + sprintf(g_sensor_data[idx].attrinfo.attr_type_str, "curr"); + break; + case SDR_SENSOR_TYPE_OTHER: + sprintf(g_sensor_data[idx].attrinfo.attr_type_str, "other"); + break; + default: + printk("not support sensor type !! [%d]\n", g_sensor_data[idx].sensor_type); + break; + } + + if ((strncmp(g_sensor_data[idx].sensor_idstring, "Fan", 3)) == 0) + { + g_sensor_data[idx].capability |= SENSOR_GET_CAP_FAN_PRESENT; + } + +#if enable_debug_msg + { + printk("\n********************\n"); + + printk("m[%d], b[%d], k1[%d], k2[%d]\n", g_sensor_data[idx].recordinfo.record_m, + g_sensor_data[idx].recordinfo.record_b + , g_sensor_data[idx].recordinfo.record_k1, + g_sensor_data[idx].recordinfo.record_k2); + + printk("sensor [%s] type[%d], analog[%d], linearization[%d]\n", + g_sensor_data[idx].sensor_idstring, g_sensor_data[idx].sensor_type + , g_sensor_data[idx].recordinfo.record_analog, + g_sensor_data[idx].recordinfo.record_linearization); + + printk("\n********************\n"); + } +#endif + +} + +int32_t sdr_convert_sensor_reading(uint8_t idx, uint8_t val, + int32_t *point_result) +{ + int32_t m = g_sensor_data[idx].recordinfo.record_m; + int32_t b = g_sensor_data[idx].recordinfo.record_b; + int32_t k1 = g_sensor_data[idx].recordinfo.record_k1; + int32_t k2 = g_sensor_data[idx].recordinfo.record_k2; + int32_t decimal_point = 0; + int32_t result = 0; + + decimal_point = pow_convert(&b, k1); + + switch (g_sensor_data[idx].recordinfo.record_analog) + { + case 0: + result = m * val * decimal_point + b; + break; + case 1: + if (val & 0x80) + { + val++; + } + case 2: + result = (m * (int16_t)val) * decimal_point + b; + break; + default: + return result; + } + + pow_convert(&result, k2); + if (k1 < 0) + { + *point_result += -k1; + } + if (k2 < 0) + { + *point_result += -k2; + } + + if (g_sensor_data[idx].sensor_type != SDR_SENSOR_TYPE_FAN) + { + result = result * 1000; /*shift for lm-sensors */ + } + + return result; +} + +int32_t ipmi_sdr_parsing_value(int32_t idx, uint8_t input_value, + int8_t *ret_str) +{ + int32_t calc_result = 0, point_result = 0; + int32_t temp_len = 0; + + uint8_t temp_str[16] = ""; + + calc_result = sdr_convert_sensor_reading(idx, input_value, &point_result); + + temp_len = sprintf(temp_str, "%d", calc_result); + temp_len = temp_len - point_result; + + /* int part */ + if (temp_len <= 0) + { + sprintf(ret_str, "0"); + } + else + { + snprintf(ret_str, temp_len + 1, "%s", + temp_str); /* +1 for snprintf reserve space'\0' */ + } + + /* point part */ + strcat(ret_str, "."); + + /* float part */ + if ((point_result == 0) || (temp_len < 0)) + { + strcat(ret_str, "0"); + } + else + { + strcat(ret_str, temp_str + temp_len); + } + + /* EOL part */ + strcat(ret_str, "\n\0"); + + return (temp_len + 1 + point_result + + 2); /*integer + point + float + EOL + \0 */ +} + + +uint8_t ipmi_check_psu_present(uint8_t psu_slot) +{ + uint8_t slot_mask = 0x0; + int32_t rv = 0; + + uint8_t returnData[128] = { 0 }; + uint8_t msg_data[] = { 0x36, 0xB9, 0x4C, 0x1C, 0x00, 0x03 }; /*netfn = 0x36; cmd = 0xB9; */ + /*uint8_t msg_data[] = { 0x06, 0x52, 0x1B, 0x4C, 0x01, 0x00 }; //netfn = IPMI_NETFN_APP; cmd = GET_PSU_READING; */ + + mutex_lock(&ipmi_lock); + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), returnData, 1); + mutex_unlock(&ipmi_lock); + + if (rv) + { + printk("BMC down at (%d)!!\n", __LINE__); + return 0; + } + else + { + slot_mask = (psu_slot == 1) ? 0x01 : 0x02; + return (returnData[0] & slot_mask) ? 0 : 1; + } +} + +int32_t ipmi_get_psu_info(uint8_t idx, uint8_t cmd, uint8_t *retbuf) +{ + uint8_t psu_slot = 0; + int32_t rv = 0; + + uint8_t returnData[128] = { 0 }; + uint8_t msg_data[] = { 0x36, 0xBB, 0x4C, 0x1C, 0x00, cmd, 0x00 }; /*netfn = 0x36; cmd = 0xBB; */ + + if (strstr(g_sensor_data[idx].sensor_idstring, "PSU1")) + { + psu_slot = 1; + } + else + { + psu_slot = 2; + } + + if (ipmi_check_psu_present(psu_slot)) + { + msg_data[6] = psu_slot; + mutex_lock(&ipmi_lock); + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), returnData, 1); + mutex_unlock(&ipmi_lock); + + if (rv) + { + printk("BMC down at (%d)!!\n", __LINE__); + } + else + { + return sprintf(retbuf, "%s\n", returnData); + } + } + else + { + /*printk("Error ! cannot detect PSU%d\n", psu_slot); */ + } + + return sprintf(retbuf, "N/A\n"); +} + +int32_t ipmi_get_vin_type(uint8_t idx, uint8_t *retbuf) +{ + uint8_t psu_slot = 0; + int32_t rv = 0; + + uint8_t returnData = 0; + uint8_t msg_data[] = { 0x06, 0x52, 0x0f, 0x00, 0x01, 0xd8 }; // read line status + + if (strstr(g_sensor_data[idx].sensor_idstring, "PSU1")) psu_slot = 1; + else psu_slot = 2; + + msg_data[3] = (psu_slot == 1) ? 0xb0 : 0xb2; + if (ipmi_check_psu_present(psu_slot)) { + mutex_lock(&ipmi_lock); + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), &returnData, 1); + mutex_unlock(&ipmi_lock); + + if (rv) { + printk("BMC down at (%d)!!\n", __LINE__); + } + else { + switch (returnData) + { + case 0x7: //LVDC + case 0x3: //HVDC + return sprintf(retbuf, "DC\n"); + default: + return sprintf(retbuf, "AC\n"); + } + } + } + else { + //printk("Error ! cannot detect PSU%d\n", psu_slot); + } + + return sprintf(retbuf, "N/A\n"); +} + +int32_t ipmi_get_pout_max(uint8_t idx, uint8_t *retbuf) +{ + uint8_t psu_slot = 0; + int32_t rv = 0, pout_max = 0; + + uint8_t returnData[2] = { 0 }; + uint8_t msg_data[] = { 0x06, 0x52, 0x0f, 0x00, 0x02, 0xa7 }; + + if (strstr(g_sensor_data[idx].sensor_idstring, "PSU1")) psu_slot = 1; + else psu_slot = 2; + + msg_data[3] = (psu_slot == 1) ? 0xb0 : 0xb2; + if (ipmi_check_psu_present(psu_slot)) { + mutex_lock(&ipmi_lock); + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), returnData, 1); + mutex_unlock(&ipmi_lock); + + if (rv) { + printk("BMC down at (%d)!!\n", __LINE__); + } + else { + /* MFR_POUT_MAX has 2 data format: Direct and Linear Data (see PMbus spec). + Query command is needed to tell the data format, but since we have not use PSU + whose output power is over 0x07ff (2047), just check the first 5 bits*/ + if ((returnData[1] & 0xf8) == 0) // Direct + pout_max = (returnData[1] << 8) | returnData[0]; + else // Linear Data + pout_max = (((returnData[1] & 0x07) << 8) | returnData[0]) << ((returnData[1] & 0xf8) >> 3); + return sprintf(retbuf, "%d\n", pout_max); + } + } + else { + //printk("Error ! cannot detect PSU%d\n", psu_slot); + } + + return sprintf(retbuf, "N/A\n"); +} + +void ipmi_fan_control(uint8_t cmd_data1, uint8_t cmd_data2, uint8_t *retbuf) +{ + int32_t rv = 0; + + uint8_t returnData[10] = { 0 }; + uint8_t msg_data[] = { IPMI_NETFN_TSOL, GET_FAN_INFO, cmd_data1, cmd_data2 }; /*netfn = IPMI_NETFN_TSOL; cmd = GET_FAN_INFO; */ + + mutex_lock(&ipmi_lock); + if (cmd_data1) + { + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), NULL, 0); + } + else + { + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), returnData, 1); + } + mutex_unlock(&ipmi_lock); + + if (rv) + { + printk("BMC down at (%d)!!\n", __LINE__); + sprintf(retbuf, "N/A\n"); + } + else + { + sprintf(retbuf, "%s", returnData); + } +} + +static ssize_t show_label(struct device *dev, struct device_attribute *devattr, + char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return sprintf(buf, "%s\n", + g_sensor_data[attr->index + DEBUGUSE_SHIFT].sensor_idstring); +} + +static ssize_t show_crit_alarm(struct device *dev, + struct device_attribute *devattr, char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return sprintf(buf, "%d\n", attr->index); +} + +static ssize_t show_input(struct device *dev, struct device_attribute *devattr, + char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + int32_t rv = 0; + + uint8_t returnData[4] = ""; + uint8_t msg_data[] = { IPMI_NETFN_SE, GET_SENSOR_READING, 0x00 }; /*netfn = IPMI_NETFN_SE; cmd = GET_SENSOR_READING; */ + + mutex_lock(&ipmi_lock); + msg_data[2] = g_sensor_data[attr->index + DEBUGUSE_SHIFT].addr; + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), returnData, 1); + mutex_unlock(&ipmi_lock); + + if (rv) + { + printk("BMC down at (%d)!!\n", __LINE__); + return sprintf(buf, "0.0\n"); + } + else + { + return ipmi_sdr_parsing_value(attr->index + DEBUGUSE_SHIFT, returnData[0], buf); + } +} + +static ssize_t show_lnr(struct device *dev, struct device_attribute *devattr, + char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return ipmi_sdr_parsing_value(attr->index + DEBUGUSE_SHIFT, + g_sensor_data[attr->index + DEBUGUSE_SHIFT].lowerinfo.lnr, buf); +} + +static ssize_t show_lcr(struct device *dev, struct device_attribute *devattr, + char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return ipmi_sdr_parsing_value(attr->index + DEBUGUSE_SHIFT, + g_sensor_data[attr->index + DEBUGUSE_SHIFT].lowerinfo.lcr, buf); +} + +static ssize_t show_lnc(struct device *dev, struct device_attribute *devattr, + char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return ipmi_sdr_parsing_value(attr->index + DEBUGUSE_SHIFT, + g_sensor_data[attr->index + DEBUGUSE_SHIFT].lowerinfo.lnc, buf); +} + +static ssize_t show_unr(struct device *dev, struct device_attribute *devattr, + char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return ipmi_sdr_parsing_value(attr->index + DEBUGUSE_SHIFT, + g_sensor_data[attr->index + DEBUGUSE_SHIFT].upperinfo.unr, buf); +} + +static ssize_t show_ucr(struct device *dev, struct device_attribute *devattr, + char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return ipmi_sdr_parsing_value(attr->index + DEBUGUSE_SHIFT, + g_sensor_data[attr->index + DEBUGUSE_SHIFT].upperinfo.ucr, buf); +} + +static ssize_t show_unc(struct device *dev, struct device_attribute *devattr, + char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return ipmi_sdr_parsing_value(attr->index + DEBUGUSE_SHIFT, + g_sensor_data[attr->index + DEBUGUSE_SHIFT].upperinfo.unc, buf); +} + +static ssize_t show_model(struct device *dev, struct device_attribute *devattr, + char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return ipmi_get_psu_info(attr->index + DEBUGUSE_SHIFT, 0x9a, buf); +} + +static ssize_t show_sn(struct device *dev, struct device_attribute *devattr, + char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return ipmi_get_psu_info(attr->index + DEBUGUSE_SHIFT, 0x9e, buf); +} + +static ssize_t show_mfrid(struct device *dev, struct device_attribute *devattr, + char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return ipmi_get_psu_info(attr->index + DEBUGUSE_SHIFT, 0x99, buf); +} + +static ssize_t show_vin_type(struct device *dev, struct device_attribute *devattr, char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return ipmi_get_vin_type(attr->index + DEBUGUSE_SHIFT, buf); +} + +static ssize_t show_pout_max(struct device *dev, struct device_attribute *devattr, char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return ipmi_get_pout_max(attr->index + DEBUGUSE_SHIFT, buf); +} + +static ssize_t show_pwm(struct device *dev, struct device_attribute *devattr, + char *buf) +{ + uint8_t returnData[10] = { 0 }; + ipmi_fan_control(0x00, 0x00, returnData); + return sprintf(buf, "%d\n", returnData[0]); +} + +static ssize_t store_pwm(struct device *dev, struct device_attribute *devattr, + const char *buf, size_t count) +{ + uint8_t store_input = 0; + uint8_t returnData[10] = { 0 }; + simple_atoi(buf, &store_input); + if (g_fan_control_mode == 1) + { + ipmi_fan_control(0x01, store_input, returnData); + } + + return count; +} + +static ssize_t show_controlmode(struct device *dev, + struct device_attribute *devattr, char *buf) +{ + return sprintf(buf, "%d\n", g_fan_control_mode); +} + +static ssize_t store_controlmode(struct device *dev, + struct device_attribute *devattr, const char *buf, size_t count) +{ + uint8_t store_input = 0; + uint8_t returnData[10] = { 0 }; + simple_atoi(buf, &store_input); + g_fan_control_mode = store_input; + if (g_fan_control_mode == 3) + { + ipmi_fan_control(0x7f, 0xff, returnData); + } + + return count; +} + +static ssize_t show_direction(struct device *dev, + struct device_attribute *devattr, char *buf) +{ + int32_t rv = 0; + + uint8_t returnData[10] = { 0 }; + uint8_t msg_data[] = { IPMI_NETFN_STORAGE, GET_FRU_INFO, 0x00, 0x19, 0x00, 0x01 }; /*netfn = IPMI_NETFN_STORAGE; cmd = GET_FRU_INFO; */ + + mutex_lock(&ipmi_lock); + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), returnData, 1); + mutex_unlock(&ipmi_lock); + + if (rv) + { + printk("BMC down at (%d)!!\n", __LINE__); + return sprintf(buf, "N/A\n"); + } + else + { + return sprintf(buf, "%c\n", returnData[1]); + } +} + +static ssize_t show_fanpresent(struct device *dev, + struct device_attribute *devattr, char *buf) +{ + int32_t rv = 0; + int32_t fan_idx = 0, fan_present = 0; + + uint8_t returnData[10] = { 0 }; + uint8_t msg_data[] = { 0x36, 0xB9, 0x4C, 0x1C, 0x00, 0x02 }; /*netfn = 0x36; cmd = 0xB9; */ + + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + + fan_idx = (g_sensor_data[attr->index].sensor_idstring[8] - '0') - 1; + + mutex_lock(&ipmi_lock); + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), returnData, 1); + mutex_unlock(&ipmi_lock); + + fan_present = ((returnData[0] >> fan_idx) & 0x1) ? 0 : 1; + + return sprintf(buf, "%d\n", fan_present); +} + +static ssize_t show_psupresent(struct device *dev, + struct device_attribute *devattr, char *buf) +{ + int32_t psu_idx = 0; + + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + + psu_idx = g_sensor_data[attr->index].sensor_idstring[3] - '0'; + + return sprintf(buf, "%d\n", ipmi_check_psu_present(psu_idx)); +} + +static ssize_t(*const attr_show_func_ptr[SENSOR_ATTR_MAX])(struct device *dev, + struct device_attribute *devattr, char *buf) = +{ + show_label, show_crit_alarm, show_input + , show_lnc, show_lcr, show_lnr + , show_unc, show_ucr, show_unr + , show_model, show_sn, show_pwm + , show_controlmode, show_direction, show_fanpresent + , show_psupresent, show_mfrid, show_vin_type + , show_pout_max +}; + +static ssize_t(*const attr_store_func_ptr[SENSOR_ATTR_MAX])(struct device *dev, + struct device_attribute *devattr, const char *buf, size_t count) = +{ + NULL, NULL, NULL + , NULL, NULL, NULL + , NULL, NULL, NULL + , NULL, NULL, store_pwm + , store_controlmode, NULL, NULL + , NULL, NULL, NULL + , NULL +}; + +static const char *const sensor_attrnames[SENSOR_ATTR_MAX] = +{ + "%s%d_label", "%s%d_crit_alarm", "%s%d_input" + , "%s%d_lncrit", "%s%d_lcrit", "%s%d_min" + , "%s%d_ncrit", "%s%d_crit", "%s%d_max" + , "%s%d_model", "%s%d_sn", "%s%d_pwm" + , "%s%d_controlmode", "%s%d_direction", "%s%d_present" + , "%s%d_present", "%s%d_mfrid", "%s%d_vin_type" + , "%s%d_pout_max" +}; + +static int32_t create_sensor_attrs(int32_t attr_no) +{ + int32_t i = 0, j = 0; + + struct attr_info *attrdata = &g_sensor_data[attr_no].attrinfo; + +#if enable_debug_msg + printk("##### %s:%d attr_no %d\n", __FUNCTION__, __LINE__, attr_no); +#endif + + for (i = 0; i < SENSOR_ATTR_MAX; i++) + { + if ((g_sensor_data[attr_no].capability >> i) & 0x01) + { + snprintf(attrdata->attr_name[j], SENSOR_ATTR_NAME_LENGTH, sensor_attrnames[i], + attrdata->attr_type_str, attr_no - DEBUGUSE_SHIFT); + + sysfs_attr_init(&attrdata->sd_attrs[j].dev_attr.attr); + attrdata->sd_attrs[j].dev_attr.attr.name = attrdata->attr_name[j]; + attrdata->sd_attrs[j].dev_attr.show = attr_show_func_ptr[i]; + attrdata->sd_attrs[j].dev_attr.store = attr_store_func_ptr[i]; + + attrdata->sd_attrs[j].dev_attr.attr.mode = S_IRUGO; + if (attrdata->sd_attrs[j].dev_attr.store) + { + attrdata->sd_attrs[j].dev_attr.attr.mode |= S_IWUSR; + } + + attrdata->sd_attrs[j].index = attr_no - DEBUGUSE_SHIFT; + attrdata->attrs[j] = &attrdata->sd_attrs[j].dev_attr.attr; + j++; + + data->total_create_sysfs++; + } + } + + attrdata->attrs[j] = NULL; + attrdata->attr_group.attrs = attrdata->attrs; + + g_sensor_data[attr_no].attrinfo.attr_exist = 1; + + return sysfs_create_group(&data->ipmi_hwmon_dev->kobj, &attrdata->attr_group); +} + +static int32_t remove_sensor_attrs(void) +{ + int32_t i = 0; + + for (i = 0; i < data->total_sensor_id; i++) + { + if (g_sensor_data[i].attrinfo.attr_exist) + { + sysfs_remove_group(&data->ipmi_hwmon_dev->kobj, + &g_sensor_data[i].attrinfo.attr_group); + } + } + return 0; +} + +int32_t ipmi_init_sdr_sensors_data(void) +{ + int32_t sdr_idx = 0; + int32_t err = 0; + + struct ipmi_sdr_iterator *itr = NULL; + struct sdr_get_rs *header = NULL; + + uint8_t *rec = NULL; + + mutex_lock(&ipmi_lock); + + itr = kzalloc(sizeof(struct ipmi_sdr_iterator), GFP_KERNEL); + if (itr == NULL) + { + printk("%s(%d): kzalloc failure.\n", __func__, __LINE__); + goto itr_malloc_fail; + } + + header = kzalloc(sizeof(struct sdr_get_rs), GFP_KERNEL); + if (header == NULL) + { + printk("%s(%d): malloc failure.\n", __func__, __LINE__); + goto header_malloc_fail; + } + + err = ipmi_sdr_start(itr); + if (err) + { + printk("%s(%d): ipmi_sdr_start fail.\n", __func__, __LINE__); + goto ipmi_sdr_start_fail; + } + + data->total_sensor_id = itr->total; + rec = kzalloc(GET_SDR_ENTIRE_RECORD, GFP_KERNEL); + if (rec == NULL) + { + printk("%s(%d): kzalloc failure\n", __func__, __LINE__); + goto rec_malloc_fail; + } + + g_sensor_data = kzalloc(itr->total * sizeof(struct ipmi_sensor_data), + GFP_KERNEL); + if (g_sensor_data == NULL) + { + printk("%s(%d): malloc failure", __func__, __LINE__); + goto g_sensor_data_malloc_fail; + } + + memset(g_sensor_data, 0x0, itr->total * sizeof(struct ipmi_sensor_data)); + + for (sdr_idx = 0; sdr_idx < itr->total; sdr_idx++) + { + err = ipmi_sdr_get_header(itr, header); + if (err) + { + if (err == 0xC5) + { + /* C5h : Reservation Invalid */ +#if enable_debug_msg + printk("ipmi: reservation number given was invalid or the reservation was lost\n"); + printk("ipmi: retry\n"); +#endif + ipmi_sdr_get_reservation(&(itr->reservation)); + sdr_idx--; + continue; + } + printk("ipmi: Get SDR header fail,so break this request\n"); + goto ipmi_sdr_get_header_fail; + } + + + memset(rec, 0, GET_SDR_ENTIRE_RECORD); + err = ipmi_sdr_get_record(header, itr, rec); + if (err) + { + if (err == 0xC5) + { + /* C5h : Reservation Invalid */ +#if enable_debug_msg + printk("ipmi: reservation number given was invalid or the reservation was lost\n"); + printk("ipmi: retry\n"); +#endif + ipmi_sdr_get_reservation(&(itr->reservation)); + sdr_idx--; + continue; + } + printk("ipmi: Get SDR header fail,so break this request\n"); + goto ipmi_sdr_get_record_fail; + } + + itr->next = header->next; + + switch (header->type) + { + case SDR_RECORD_TYPE_FULL_SENSOR: + /* prepare (threshold, factor)data whilie init, for reduce reading step and improve operate speed */ + g_sensor_data[sdr_idx].addr = rec[2]; + g_sensor_data[sdr_idx].capability = + SENSOR_GET_CAP_LABEL /*| SENSOR_GET_CAP_ALARM */ | SENSOR_GET_CAP_INPUT; + g_sensor_data[sdr_idx].headerinfo.header_type = header->type; + g_sensor_data[sdr_idx].headerinfo.header_byte = header->length; + + ipmi_sdr_set_sensor_threshold(sdr_idx, (struct sdr_record_full_sensor *) rec); + ipmi_sdr_set_sensor_factor(sdr_idx, (struct sdr_record_full_sensor *) rec); + + if (sdr_idx >= DEBUGUSE_SHIFT) + { + err = create_sensor_attrs(sdr_idx); + if (err) + { + g_sensor_data[sdr_idx].attrinfo.attr_exist = 0; + printk("[err : %d]sysfs_create_group fail in [%d] %s\n", err, sdr_idx, + g_sensor_data[sdr_idx].sensor_idstring); + goto create_sysfs_fail; + } + } + + data->total_suport_sensor++; + + break; + case SDR_RECORD_TYPE_COMPACT_SENSOR: /* not supporrt now */ + case SDR_RECORD_TYPE_EVENTONLY_SENSOR: /* not supporrt now */ + case SDR_RECORD_TYPE_MC_DEVICE_LOCATOR: /* not supporrt now */ + default: + g_sensor_data[sdr_idx].attrinfo.attr_exist = 0; +#if enable_debug_msg + printk("ID[%d] : not support type [%d]\n", sdr_idx, header->type); +#endif + break; + } + } + + printk("quanta_hwmon_ipmi : detected [%d] sensor, create [%d] sysfs\n", + data->total_suport_sensor, data->total_create_sysfs); + +create_sysfs_fail: +ipmi_sdr_get_header_fail: +ipmi_sdr_get_record_fail: +g_sensor_data_malloc_fail: + if (header) + { + kfree(header); + header = NULL; + } + if (rec) + { + kfree(rec); + rec = NULL; + } + +rec_malloc_fail: +ipmi_sdr_start_fail: +header_malloc_fail: + if (itr) + { + kfree(itr); + itr = NULL; + } + +itr_malloc_fail: + mutex_unlock(&ipmi_lock); + + return err; +} + +static int32_t __init quanta_hwmon_ipmi_init(void) +{ + int32_t err = 0; + + init_completion(&g_read_complete); + + data = kzalloc(sizeof(struct quanta_hwmon_ipmi_data), GFP_KERNEL); + if (NULL == data) + { + printk("alloc data fail\n"); + goto alloc_err; + } + + data->ipmi_platform_dev = platform_device_register_simple(DRVNAME, -1, NULL, 0); + err = IS_ERR(data->ipmi_platform_dev); + if (err) + { + printk("platform device register fail (err : %d)\n", err); + goto device_reg_err; + } + + data->ipmi_hwmon_dev = hwmon_device_register_with_groups(NULL, DRVNAME, NULL, + NULL); + err = IS_ERR(data->ipmi_hwmon_dev); + if (err) + { + printk("hwmon register fail\n"); + goto hwmon_register_err; + } + + err = ipmi_create_user(0, &ipmi_hndlrs, NULL, &ipmi_mh_user); + if (err) + { + printk("warning: create user fail, watchdog broken (err : %d)\n", err); + goto ipmi_create_err; + } + + mutex_init(&ipmi_lock); + err = ipmi_init_sdr_sensors_data(); + if (err) + { + printk("init sensor data fail (err : %d)\n", err); + goto init_sensor_err; + } + + return 0; + +init_sensor_err: + if (g_sensor_data) + { + kfree(g_sensor_data); + g_sensor_data = NULL; + } +ipmi_create_err: + hwmon_device_unregister(data->ipmi_hwmon_dev); +hwmon_register_err: + platform_device_unregister(data->ipmi_platform_dev); +device_reg_err: + if (data) + { + kfree(data); + data = NULL; + } +alloc_err: + return err; +} + +static void __exit quanta_hwmon_ipmi_exit(void) +{ + remove_sensor_attrs(); + hwmon_device_unregister(data->ipmi_hwmon_dev); + + mutex_lock(&ipmi_lock); + ipmi_destroy_user(ipmi_mh_user); + mutex_unlock(&ipmi_lock); + + platform_device_unregister(data->ipmi_platform_dev); + + if (g_sensor_data) + { + kfree(g_sensor_data); + g_sensor_data = NULL; + } + + if (data) + { + kfree(data); + data = NULL; + } +} + +module_init(quanta_hwmon_ipmi_init); +module_exit(quanta_hwmon_ipmi_exit); + +MODULE_AUTHOR("Charcar~~Charcar~Charlie li li"); +MODULE_VERSION("2.0"); +MODULE_DESCRIPTION("Quanta BMC hardware monitor driver"); +MODULE_LICENSE("GPL"); diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix7-32x/modules/quanta_platform_ix7.c b/platform/broadcom/sonic-platform-modules-quanta/ix7-32x/modules/quanta_platform_ix7.c index a6e5733199ac..02705e37d828 100644 --- a/platform/broadcom/sonic-platform-modules-quanta/ix7-32x/modules/quanta_platform_ix7.c +++ b/platform/broadcom/sonic-platform-modules-quanta/ix7-32x/modules/quanta_platform_ix7.c @@ -39,119 +39,12 @@ #include #include #include -#include #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,16,0)) #include #else #include #endif -#define MUX_INFO(bus, deselect) \ - {.adap_id = bus, .deselect_on_exit = deselect} - -static struct pca954x_platform_mode pca9548sfp1_modes[] = { - MUX_INFO(0x20, 1), - MUX_INFO(0x21, 1), - MUX_INFO(0x22, 1), - MUX_INFO(0x23, 1), - MUX_INFO(0x24, 1), - MUX_INFO(0x25, 1), - MUX_INFO(0x26, 1), - MUX_INFO(0x27, 1), -}; - -static struct pca954x_platform_data pca9548sfp1_data = { - .modes = pca9548sfp1_modes, - .num_modes = 8, -}; - -static struct pca954x_platform_mode pca9548sfp2_modes[] = { - MUX_INFO(0x28, 1), - MUX_INFO(0x29, 1), - MUX_INFO(0x2a, 1), - MUX_INFO(0x2b, 1), - MUX_INFO(0x2c, 1), - MUX_INFO(0x2d, 1), - MUX_INFO(0x2e, 1), - MUX_INFO(0x2f, 1), -}; - -static struct pca954x_platform_data pca9548sfp2_data = { - .modes = pca9548sfp2_modes, - .num_modes = 8, -}; -static struct pca954x_platform_mode pca9548sfp3_modes[] = { - MUX_INFO(0x30, 1), - MUX_INFO(0x31, 1), - MUX_INFO(0x32, 1), - MUX_INFO(0x33, 1), - MUX_INFO(0x34, 1), - MUX_INFO(0x35, 1), - MUX_INFO(0x36, 1), - MUX_INFO(0x37, 1), -}; - -static struct pca954x_platform_data pca9548sfp3_data = { - .modes = pca9548sfp3_modes, - .num_modes = 8, -}; - -static struct pca954x_platform_mode pca9548sfp4_modes[] = { - MUX_INFO(0x38, 1), - MUX_INFO(0x39, 1), - MUX_INFO(0x3a, 1), - MUX_INFO(0x3b, 1), - MUX_INFO(0x3c, 1), - MUX_INFO(0x3d, 1), - MUX_INFO(0x3e, 1), - MUX_INFO(0x3f, 1), -}; - -static struct pca954x_platform_data pca9548sfp4_data = { - .modes = pca9548sfp4_modes, - .num_modes = 8, -}; - -static struct pca954x_platform_mode pca9546_modes[] = { - MUX_INFO(0x10, 1), - MUX_INFO(0x11, 1), - MUX_INFO(0x12, 1), - MUX_INFO(0x13, 1), -}; - -static struct pca954x_platform_data pca9546_data = { - .modes = pca9546_modes, - .num_modes = 4, -}; - -static struct pca954x_platform_mode pca9548_modes[] = { - MUX_INFO(0x14, 1), - MUX_INFO(0x15, 1), - MUX_INFO(0x16, 1), - MUX_INFO(0x17, 1), - MUX_INFO(0x18, 1), - MUX_INFO(0x19, 1), - MUX_INFO(0x1a, 1), - MUX_INFO(0x1b, 1), -}; - -static struct pca954x_platform_data pca9548_data = { - .modes = pca9548_modes, - .num_modes = 8, -}; - -/* CPU Board i2c device */ -static struct pca954x_platform_mode pca9546_cpu_modes[] = { - MUX_INFO(0x02, 1), - MUX_INFO(0x03, 1), - MUX_INFO(0x04, 1), - MUX_INFO(0x05, 1), -}; - -static struct pca954x_platform_data pca9546_cpu_data = { - .modes = pca9546_cpu_modes, - .num_modes = 4, -}; //MB Board Data static struct pca953x_platform_data pca9555_1_data = { .gpio_base = 0x10, @@ -164,30 +57,24 @@ static struct pca953x_platform_data pca9555_CPU_data = { static struct i2c_board_info ix7_i2c_devices[] = { { I2C_BOARD_INFO("pca9546", 0x72), // 0 - .platform_data = &pca9546_data, }, { I2C_BOARD_INFO("pca9548", 0x77), // 1 - .platform_data = &pca9548_data, }, { I2C_BOARD_INFO("24c02", 0x54), // 2 0x72 ch2 eeprom }, { I2C_BOARD_INFO("pca9548", 0x73), // 3 0x77 ch0 - .platform_data = &pca9548sfp1_data, }, { I2C_BOARD_INFO("pca9548", 0x73), // 4 0x77 ch1 - .platform_data = &pca9548sfp2_data, }, { I2C_BOARD_INFO("pca9548", 0x73), // 5 0x77 ch2 - .platform_data = &pca9548sfp3_data, }, { I2C_BOARD_INFO("pca9548", 0x73), // 6 0x77 ch3 - .platform_data = &pca9548sfp4_data, }, { I2C_BOARD_INFO("pca9555", 0x23), // 7 0x72 ch3 pca9555 MB Board Data @@ -201,7 +88,6 @@ static struct i2c_board_info ix7_i2c_devices[] = { }, { I2C_BOARD_INFO("pca9546", 0x71), // 10 CPU Board i2c device - .platform_data = &pca9546_cpu_data, }, { I2C_BOARD_INFO("pca9555", 0x20), // 11 0x71 ch0 CPU Board Data @@ -227,9 +113,13 @@ static struct platform_driver ix7_platform_driver = { static struct platform_device *ix7_device; +static struct i2c_client **g_client; +static struct i2c_client **g_client_port; +int numof_i2c_devices = 14; // num of ix7_i2c_devices - 1 (for optoe1) +int numof_ports = 32; + static int __init ix7_platform_init(void) { - struct i2c_client *client; struct i2c_adapter *adapter; int ret, i; @@ -248,55 +138,139 @@ static int __init ix7_platform_init(void) if (ret) goto fail_platform_device; + g_client = kmalloc(sizeof(*g_client) * numof_i2c_devices, GFP_KERNEL); + for (i = 0; i < numof_i2c_devices; i++) g_client[i] = NULL; + + g_client_port = kmalloc(sizeof(*g_client_port) * numof_ports, GFP_KERNEL); + for (i = 0; i < numof_ports; i++) g_client_port[i] = NULL; + adapter = i2c_get_adapter(0); - client = i2c_new_device(adapter, &ix7_i2c_devices[0]); // pca9546 - client = i2c_new_device(adapter, &ix7_i2c_devices[1]); // pca9548 - client = i2c_new_device(adapter, &ix7_i2c_devices[10]); // pca9546 in CPU board - i2c_put_adapter(adapter); - - adapter = i2c_get_adapter(0x02); - client = i2c_new_device(adapter, &ix7_i2c_devices[11]); // CPU Board Data - i2c_put_adapter(adapter); - - adapter = i2c_get_adapter(0x10); - client = i2c_new_device(adapter, &ix7_i2c_devices[8]); // CPLD2 - client = i2c_new_device(adapter, &ix7_i2c_devices[13]); // CPLD_led_1 - i2c_put_adapter(adapter); - - adapter = i2c_get_adapter(0x11); - client = i2c_new_device(adapter, &ix7_i2c_devices[9]); // CPLD3 - client = i2c_new_device(adapter, &ix7_i2c_devices[14]); // CPLD_led_2 - i2c_put_adapter(adapter); - - adapter = i2c_get_adapter(0x12); - client = i2c_new_device(adapter, &ix7_i2c_devices[2]); // MB_BOARDINFO_EEPROM - i2c_put_adapter(adapter); - - adapter = i2c_get_adapter(0x13); - client = i2c_new_device(adapter, &ix7_i2c_devices[7]); // pca9555 MB Board Data - i2c_put_adapter(adapter); - - adapter = i2c_get_adapter(0x14); - client = i2c_new_device(adapter, &ix7_i2c_devices[3]); // pca9548_1 SFP - i2c_put_adapter(adapter); - - adapter = i2c_get_adapter(0x15); - client = i2c_new_device(adapter, &ix7_i2c_devices[4]); // pca9548_2 SFP - i2c_put_adapter(adapter); - - adapter = i2c_get_adapter(0x16); - client = i2c_new_device(adapter, &ix7_i2c_devices[5]); // pca9548_3 SFP - i2c_put_adapter(adapter); - - adapter = i2c_get_adapter(0x17); - client = i2c_new_device(adapter, &ix7_i2c_devices[6]); // pca9548_4 SFP - i2c_put_adapter(adapter); - for(i = 32; i < 64; i ++){ // QSFP 1~32 EEPROM - adapter = i2c_get_adapter(i); - client = i2c_new_device(adapter, &ix7_i2c_devices[12]); + if (adapter == NULL) + { + printk("[%s] get i2c adapter fail at line %d", __FUNCTION__, __LINE__); + } + else + { + g_client[0] = i2c_new_device(adapter, &ix7_i2c_devices[0]); // pca9546 + g_client[1] = i2c_new_device(adapter, &ix7_i2c_devices[1]); // pca9548 + g_client[2] = i2c_new_device(adapter, &ix7_i2c_devices[10]); // pca9546 in CPU board + i2c_put_adapter(adapter); + } + + adapter = i2c_get_adapter(13); + if (adapter == NULL) + { + printk("[%s] get i2c adapter fail at line %d", __FUNCTION__, __LINE__); + } + else + { + g_client[3] = i2c_new_device(adapter, &ix7_i2c_devices[11]); // CPU Board Data + i2c_put_adapter(adapter); + } + + adapter = i2c_get_adapter(1); + if (adapter == NULL) + { + printk("[%s] get i2c adapter fail at line %d", __FUNCTION__, __LINE__); + } + else + { + g_client[4] = i2c_new_device(adapter, &ix7_i2c_devices[8]); // CPLD2 + g_client[5] = i2c_new_device(adapter, &ix7_i2c_devices[13]); // CPLD_led_1 i2c_put_adapter(adapter); } + adapter = i2c_get_adapter(2); + if (adapter == NULL) + { + printk("[%s] get i2c adapter fail at line %d", __FUNCTION__, __LINE__); + } + else + { + g_client[6] = i2c_new_device(adapter, &ix7_i2c_devices[9]); // CPLD3 + g_client[7] = i2c_new_device(adapter, &ix7_i2c_devices[14]); // CPLD_led_2 + i2c_put_adapter(adapter); + } + + adapter = i2c_get_adapter(3); + if (adapter == NULL) + { + printk("[%s] get i2c adapter fail at line %d", __FUNCTION__, __LINE__); + } + else + { + g_client[8] = i2c_new_device(adapter, &ix7_i2c_devices[2]); // MB_BOARDINFO_EEPROM + i2c_put_adapter(adapter); + } + + adapter = i2c_get_adapter(4); + if (adapter == NULL) + { + printk("[%s] get i2c adapter fail at line %d", __FUNCTION__, __LINE__); + } + else + { + g_client[9] = i2c_new_device(adapter, &ix7_i2c_devices[7]); // pca9555 MB Board Data + i2c_put_adapter(adapter); + } + + adapter = i2c_get_adapter(5); + if (adapter == NULL) + { + printk("[%s] get i2c adapter fail at line %d", __FUNCTION__, __LINE__); + } + else + { + g_client[10] = i2c_new_device(adapter, &ix7_i2c_devices[3]); // pca9548_1 SFP + i2c_put_adapter(adapter); + } + + adapter = i2c_get_adapter(6); + if (adapter == NULL) + { + printk("[%s] get i2c adapter fail at line %d", __FUNCTION__, __LINE__); + } + else + { + g_client[11] = i2c_new_device(adapter, &ix7_i2c_devices[4]); // pca9548_2 SFP + i2c_put_adapter(adapter); + } + + adapter = i2c_get_adapter(7); + if (adapter == NULL) + { + printk("[%s] get i2c adapter fail at line %d", __FUNCTION__, __LINE__); + } + else + { + g_client[12] = i2c_new_device(adapter, &ix7_i2c_devices[5]); // pca9548_3 SFP + i2c_put_adapter(adapter); + } + + adapter = i2c_get_adapter(8); + if (adapter == NULL) + { + printk("[%s] get i2c adapter fail at line %d", __FUNCTION__, __LINE__); + } + else + { + g_client[13] = i2c_new_device(adapter, &ix7_i2c_devices[6]); // pca9548_4 SFP + i2c_put_adapter(adapter); + } + + for(i = 17; i < 49; i ++){ // QSFP 1~32 EEPROM + adapter = i2c_get_adapter(i); + if (adapter == NULL) + { + printk("[%s] get i2c adapter fail at line %d", __FUNCTION__, __LINE__); + } + else + { + g_client_port[i - 17] = i2c_new_device(adapter, &ix7_i2c_devices[12]); + i2c_put_adapter(adapter); + } + } + return 0; fail_platform_device: @@ -309,6 +283,26 @@ static int __init ix7_platform_init(void) static void __exit ix7_platform_exit(void) { + int i = 0; + + for (i = numof_ports - 1; i >= 0; i--) + { + if (g_client_port[i]) + { + i2c_unregister_device(g_client_port[i]); + g_client_port[i] = NULL; + } + } + + for (i = numof_i2c_devices - 1; i >= 0; i--) + { + if (g_client[i]) + { + i2c_unregister_device(g_client[i]); + g_client[i] = NULL; + } + } + platform_device_unregister(ix7_device); platform_driver_unregister(&ix7_platform_driver); } diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix7-32x/service/ix7-platform-init.service b/platform/broadcom/sonic-platform-modules-quanta/ix7-32x/service/ix7-platform-init.service old mode 100755 new mode 100644 diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix7-32x/setup.py b/platform/broadcom/sonic-platform-modules-quanta/ix7-32x/setup.py index a2f84b31a56a..7973be92052a 100644 --- a/platform/broadcom/sonic-platform-modules-quanta/ix7-32x/setup.py +++ b/platform/broadcom/sonic-platform-modules-quanta/ix7-32x/setup.py @@ -1,7 +1,6 @@ #!/usr/bin/env python import os -import sys from setuptools import setup os.listdir diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix7-32x/sonic_platform/__init__.py b/platform/broadcom/sonic-platform-modules-quanta/ix7-32x/sonic_platform/__init__.py new file mode 100644 index 000000000000..d82f3749319c --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix7-32x/sonic_platform/__init__.py @@ -0,0 +1,2 @@ +__all__ = ["platform", "chassis"] +from sonic_platform import * diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix7-32x/sonic_platform/chassis.py b/platform/broadcom/sonic-platform-modules-quanta/ix7-32x/sonic_platform/chassis.py new file mode 100644 index 000000000000..58d44f4c553e --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix7-32x/sonic_platform/chassis.py @@ -0,0 +1,256 @@ +#!/usr/bin/env python +# +# Name: chassis.py, version: 1.0 +# +# Description: Module contains the definitions of SONiC platform APIs +# + +try: + import sys + import time + import syslog + from sonic_platform_base.chassis_base import ChassisBase + from sonic_platform.eeprom import Eeprom + from sonic_platform.psu import Psu + from sonic_platform.sfp import Sfp + from sonic_platform.fan import Fan + from sonic_platform.fan_drawer import FanDrawer + from sonic_platform.thermal import Thermal + +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +class Chassis(ChassisBase): + + def __init__(self): + ChassisBase.__init__(self) + self.__num_of_psus = 2 + self.__num_of_ports = 32 + self.__num_of_sfps = 0 + self.__num_of_fan_drawers = 6 + self.__fan_per_drawer = 2 + self.__num_of_thermals = 15 + self.__xcvr_presence = {} + + # Initialize EEPROM + self._eeprom = Eeprom() + + # Initialize watchdog + #self._watchdog = Watchdog() + + # Initialize FAN + fan_index = 1 + for drawer_index in range(1, self.__num_of_fan_drawers + 1): + drawer_fan_list = [] + for index in range(0, self.__fan_per_drawer): + fan = Fan(fan_index, False) + fan_index += 1 + self._fan_list.append(fan) + drawer_fan_list.append(fan) + fan_drawer = FanDrawer(drawer_index, drawer_fan_list) + self._fan_drawer_list.append(fan_drawer) + + # Initialize thermal + for index in range(1, self.__num_of_thermals + 1): + thermal = Thermal(index) + self._thermal_list.append(thermal) + + # Initialize PSU and PSU_FAN + for index in range(1, self.__num_of_psus + 1): + psu = Psu(index) + self._psu_list.append(psu) + + # Initialize SFP + for index in range(1, self.__num_of_ports + 1): + if index in range(1, self.__num_of_sfps + 1): + sfp = Sfp(index, 'SFP') + else: + sfp = Sfp(index, 'QSFP') + + self._sfp_list.append(sfp) + + for index in range(1, self.__num_of_ports + 1): + self.__xcvr_presence[index] = self._sfp_list[index-1].get_presence() + +############################################## +# Device methods +############################################## + + def get_sfp(self, index): + """ + Retrieves sfp represented by (1-based) index + For Quanta the index in sfputil.py starts from 1, so override + + Args: + index: An integer, the index (1-based) of the sfp to retrieve. + The index should be the sequence of a physical port in a chassis, + starting from 1. + + Returns: + An object dervied from SfpBase representing the specified sfp + """ + sfp = None + + try: + if (index == 0): + raise IndexError + sfp = self._sfp_list[index-1] + except IndexError: + sys.stderr.write("override: SFP index {} out of range (1-{})\n".format( + index, len(self._sfp_list))) + + return sfp + + def get_name(self): + """ + Retrieves the name of the chassis + Returns: + string: The name of the chassis + """ + return self._eeprom.modelstr() + + def get_presence(self): + """ + Retrieves the presence of the chassis + Returns: + bool: True if chassis is present, False if not + """ + return True + + def get_model(self): + """ + Retrieves the model number (or part number) of the chassis + Returns: + string: Model/part number of chassis + """ + return self._eeprom.part_number_str() + + def get_serial(self): + """ + Retrieves the serial number of the chassis + Returns: + string: Serial number of chassis + """ + return self._eeprom.serial_number_str() + + def get_status(self): + """ + Retrieves the operational status of the chassis + Returns: + bool: A boolean value, True if chassis is operating properly + False if not + """ + return True + +############################################## +# Chassis methods +############################################## + + def get_base_mac(self): + """ + Retrieves the base MAC address for the chassis + + Returns: + A string containing the MAC address in the format + 'XX:XX:XX:XX:XX:XX' + """ + return self._eeprom.base_mac_addr() + + def get_serial_number(self): + """ + Retrieves the hardware serial number for the chassis + + Returns: + A string containing the hardware serial number for this chassis. + """ + return self._eeprom.serial_number_str() + + def get_system_eeprom_info(self): + """ + Retrieves the full content of system EEPROM information for the chassis + + Returns: + A dictionary where keys are the type code defined in + OCP ONIE TlvInfo EEPROM format and values are their corresponding + values. + Ex. { '0x21':'AG9064', '0x22':'V1.0', '0x23':'AG9064-0109867821', + '0x24':'001c0f000fcd0a', '0x25':'02/03/2018 16:22:00', + '0x26':'01', '0x27':'REV01', '0x28':'AG9064-C2358-16G'} + """ + return self._eeprom.system_eeprom_info() + + def get_reboot_cause(self): + """ + Retrieves the cause of the previous reboot + Returns: + A tuple (string, string) where the first element is a string + containing the cause of the previous reboot. This string must be + one of the predefined strings in this class. If the first string + is "REBOOT_CAUSE_HARDWARE_OTHER", the second string can be used + to pass a description of the reboot cause. + """ + hw_reboot_cause = "" + with open("/sys/class/watchdog/watchdog0/reboot_reason", "r") as f: + hw_reboot_cause = f.read().strip('\n') + + if hw_reboot_cause == "2": + reboot_cause = self.REBOOT_CAUSE_WATCHDOG + description = 'Hardware Watchdog Reset' + else: + reboot_cause = self.REBOOT_CAUSE_NON_HARDWARE + description = 'Unknown reason' + + return (reboot_cause, description) + + + ############################################## + # Other methods + ############################################## + def get_watchdog(self): + """ + Retreives hardware watchdog device on this chassis + + Returns: + An object derived from WatchdogBase representing the hardware + watchdog device + """ + try: + if self._watchdog is None: + from sonic_platform.watchdog import Watchdog + # Create the watchdog Instance + self._watchdog = Watchdog() + + except Exception as e: + syslog.syslog(syslog.LOG_ERR, "Fail to load watchdog due to {}".format(e)) + return self._watchdog + + def get_change_event(self, timeout=0): + """ + Currently only support transceiver change events + """ + + start_ms = time.time() * 1000 + xcvr_change_event_dict = {} + event = False + + while True: + time.sleep(0.5) + for index in range(1, self.__num_of_ports + 1): + cur_xcvr_presence = self._sfp_list[index-1].get_presence() + if cur_xcvr_presence != self.__xcvr_presence[index]: + if cur_xcvr_presence is True: + xcvr_change_event_dict[str(index)] = '1' + self.__xcvr_presence[index] = True + elif cur_xcvr_presence is False: + xcvr_change_event_dict[str(index)] = '0' + self.__xcvr_presence[index] = False + event = True + + if event is True: + return True, {'sfp':xcvr_change_event_dict} + + if timeout: + now_ms = time.time() * 1000 + if (now_ms - start_ms >= timeout): + return True, {'sfp':xcvr_change_event_dict} + diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix7-32x/sonic_platform/eeprom.py b/platform/broadcom/sonic-platform-modules-quanta/ix7-32x/sonic_platform/eeprom.py new file mode 100644 index 000000000000..ef01115fe7cf --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix7-32x/sonic_platform/eeprom.py @@ -0,0 +1,209 @@ +#!/usr/bin/env python +# +# Name: eeprom.py, version: 1.0 +# +# Description: Module contains the definitions of SONiC platform APIs +# + +try: + from sonic_eeprom import eeprom_tlvinfo +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +class Eeprom(eeprom_tlvinfo.TlvInfoDecoder): + + def __init__(self): + self.__eeprom_path = "/sys/bus/i2c/devices/3-0054/eeprom" + super(Eeprom, self).__init__(self.__eeprom_path, 0, '', True) + self.__eeprom_tlv_dict = dict() + try: + self.__eeprom_data = self.read_eeprom() + except: + self.__eeprom_data = "N/A" + raise RuntimeError("Eeprom is not Programmed") + else: + eeprom = self.__eeprom_data + + if not self.is_valid_tlvinfo_header(eeprom): + return + + total_length = (eeprom[9] << 8) | eeprom[10] + tlv_index = self._TLV_INFO_HDR_LEN + tlv_end = self._TLV_INFO_HDR_LEN + total_length + + while (tlv_index + 2) < len(eeprom) and tlv_index < tlv_end: + if not self.is_valid_tlv(eeprom[tlv_index:]): + break + + tlv = eeprom[tlv_index:tlv_index + 2 + + eeprom[tlv_index + 1]] + code = "0x%02X" % tlv[0] + + if tlv[0] == self._TLV_CODE_VENDOR_EXT: + value = str((tlv[2] << 24) | (tlv[3] << 16) | + (tlv[4] << 8) | tlv[5]) + value += tlv[6:6 + tlv[1]].decode('ascii') + else: + value = self.decoder(None, tlv)[30:] + + self.__eeprom_tlv_dict[code] = value + if eeprom[tlv_index] == self._TLV_CODE_CRC_32: + break + + tlv_index += eeprom[tlv_index+1] + 2 + + def serial_number_str(self): + (is_valid, results) = self.get_tlv_field( + self.__eeprom_data, self._TLV_CODE_SERIAL_NUMBER) + if not is_valid: + return "N/A" + + return results[2].decode('ascii') + + def base_mac_addr(self): + (is_valid, results) = self.get_tlv_field( + self.__eeprom_data, self._TLV_CODE_MAC_BASE) + if not is_valid or results[1] != 6: + return super(TlvInfoDecoder, self).switchaddrstr(e) + + return ":".join(["{:02x}".format(T) for T in results[2]]).upper() + + def modelstr(self): + (is_valid, results) = self.get_tlv_field( + self.__eeprom_data, self._TLV_CODE_PRODUCT_NAME) + if not is_valid: + return "N/A" + + return results[2].decode('ascii') + + def part_number_str(self): + (is_valid, results) = self.get_tlv_field( + self.__eeprom_data, self._TLV_CODE_PART_NUMBER) + if not is_valid: + return "N/A" + + return results[2].decode('ascii') + + def serial_tag_str(self): + (is_valid, results) = self.get_tlv_field( + self.__eeprom_data, self._TLV_CODE_SERVICE_TAG) + if not is_valid: + return "N/A" + + return results[2].decode('ascii') + + def revision_str(self): + (is_valid, results) = self.get_tlv_field( + self.__eeprom_data, self._TLV_CODE_DEVICE_VERSION) + if not is_valid: + return "N/A" + + return results[2].decode('ascii') + + def system_eeprom_info(self): + """ + Returns a dictionary, where keys are the type code defined in + ONIE EEPROM format and values are their corresponding values + found in the system EEPROM. + """ + return self.__eeprom_tlv_dict + + def decoder(self, s, t): + ''' + Return a string representing the contents of the TLV field. The format of + the string is: + 1. The name of the field left justified in 20 characters + 2. The type code in hex right justified in 5 characters + 3. The length in decimal right justified in 4 characters + 4. The value, left justified in however many characters it takes + The vailidity of EEPROM contents and the TLV field has been verified + prior to calling this function. The 's' parameter is unused + ''' + if t[0] == self._TLV_CODE_PRODUCT_NAME: + name = "Product Name" + value = t[2:2 + t[1]].decode("ascii") + elif t[0] == self._TLV_CODE_PART_NUMBER: + name = "Part Number" + value = t[2:2 + t[1]].decode("ascii") + elif t[0] == self._TLV_CODE_SERIAL_NUMBER: + name = "Serial Number" + value = t[2:2 + t[1]].decode("ascii") + elif t[0] == self._TLV_CODE_MAC_BASE: + name = "Base MAC Address" + value = ":".join(["{:02x}".format(T) for T in t[2:8]]).upper() + elif t[0] == self._TLV_CODE_MANUF_DATE: + name = "Manufacture Date" + value = t[2:2 + t[1]].decode("ascii") + elif t[0] == self._TLV_CODE_DEVICE_VERSION: + name = "Device Version" + value = str(t[2]) + elif t[0] == self._TLV_CODE_LABEL_REVISION: + name = "Label Revision" + value = t[2:2 + t[1]].decode("ascii") + elif t[0] == self._TLV_CODE_PLATFORM_NAME: + name = "Platform Name" + value = t[2:2 + t[1]].decode("ascii") + elif t[0] == self._TLV_CODE_ONIE_VERSION: + name = "ONIE Version" + value = t[2:2 + t[1]].decode("ascii") + elif t[0] == self._TLV_CODE_MAC_SIZE: + name = "MAC Addresses" + value = str((t[2] << 8) | t[3]) + elif t[0] == self._TLV_CODE_MANUF_NAME: + name = "Manufacturer" + value = t[2:2 + t[1]].decode("ascii") + elif t[0] == self._TLV_CODE_MANUF_COUNTRY: + name = "Manufacture Country" + value = t[2:2 + t[1]].decode("ascii") + elif t[0] == self._TLV_CODE_VENDOR_NAME: + name = "Vendor Name" + value = t[2:2 + t[1]].decode("ascii") + elif t[0] == self._TLV_CODE_DIAG_VERSION: + name = "Diag Version" + # Quanta legacy format of diag version + if t[1] == 4: + value = "{}.{}.{}.{}".format('{:02x}'.format(t[2])[0], '{:02x}'.format(t[2])[1], + '{:02x}'.format(t[3])[0], '{:02x}'.format(t[3])[1]) + else: + value = t[2:2 + t[1]].decode("ascii") + elif t[0] == self._TLV_CODE_SERVICE_TAG: + name = "Service Tag" + value = t[2:2 + t[1]].decode("ascii") + elif t[0] == self._TLV_CODE_VENDOR_EXT: + name = "Vendor Extension" + value = "" + if self._TLV_DISPLAY_VENDOR_EXT: + for c in t[2:2 + t[1]]: + value += "0x%02X " % c + elif t[0] == self._TLV_CODE_CRC_32 and len(t) == 6: + name = "CRC-32" + value = "0x%08X" % ((t[2] << 24) | (t[3] << 16) | (t[4] << 8) | t[5]) + # Quanta specific codes below here. + # These decodes are lifted from their U-Boot codes + elif t[0] == self._TLV_CODE_QUANTA_MAGIC and len(t) == 3: + name = "Magic Number" + value = "0x%02X" % t[2] + elif t[0] == self._TLV_CODE_QUANTA_CRC and len(t) == 4: + name = "QUANTA-CRC" + value = "0x%04X" % ((t[2] << 8) + t[3]) + elif t[0] == self._TLV_CODE_QUANTA_CARD_TYPE and len(t) == 6: + name = "Card Type" + value = "0x%08X" % ((t[2] << 24) | (t[3] << 16) | (t[4] << 8) | t[5]) + elif t[0] == self._TLV_CODE_QUANTA_HW_VERSION and len(t) == 6: + name = "Hardware Version" + value = "%d.%d" % (t[2], t[3]) + elif t[0] == self._TLV_CODE_QUANTA_SW_VERSION and len(t) == 6: + name = "Software Version" + value = "%d.%d.%d.%d" % ((t[2] >> 4), (t[2] & 0xF), (t[3] >> 4), (t[3] & 0xF)) + elif t[0] == self._TLV_CODE_QUANTA_MANUF_DATE and len(t) == 6: + name = "Manufacture Date" + value = "%04d/%d/%d" % (((t[2] << 8) | t[3]), t[4], t[5]) + elif t[0] == self._TLV_CODE_QUANTA_MODEL_NAME: + name = "Model Name" + value = t[2:2 + t[1]].decode("ascii") + else: + name = "Unknown" + value = "" + for c in t[2:2 + t[1]]: + value += "0x%02X " % c + return name, value \ No newline at end of file diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix7-32x/sonic_platform/fan.py b/platform/broadcom/sonic-platform-modules-quanta/ix7-32x/sonic_platform/fan.py new file mode 100644 index 000000000000..31bbe0e52e48 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix7-32x/sonic_platform/fan.py @@ -0,0 +1,220 @@ +#!/usr/bin/env python + +############################################################################# +# Quanta IX7 +# +# Module contains an implementation of SONiC Platform Base API and +# provides the FAN information +# +############################################################################# + +try: + import logging + import os + from sonic_platform_base.fan_base import FanBase +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +############### +# Global +############### +HWMON_DIR = "/sys/class/hwmon/hwmon1/" +FAN_INDEX_START = 21 +NUM_FANTRAYS = 6 +FANS_PERTRAY = 2 + +class Fan(FanBase): + """Platform-specific Fan class""" + + def __init__(self, index, is_psu_fan=False): + self.is_psu_fan = is_psu_fan + self.fan_index = index + self.psu_fan_index_mapping = { + 1:40, + 2:50, + } + self.psu_index_mapping = { + 1:42, + 2:52, + } + if self.is_psu_fan: + self.fan_presence_attr = "power{}_present".format(self.psu_index_mapping[index]) + self.fan_pwm_attr = "fan{}_pwm".format(self.psu_fan_index_mapping[index]) + self.fan_rpm_attr = "fan{}_input".format(self.psu_fan_index_mapping[index]) + self.fan_direction_attr = "fan{}_direction".format(self.psu_fan_index_mapping[index]) + else: + self.fan_presence_attr = "fan{}_present".format(FAN_INDEX_START+(index-1)) + self.fan_pwm_attr = "fan{}_pwm".format(FAN_INDEX_START+(index-1)) + self.fan_rpm_attr = "fan{}_input".format(FAN_INDEX_START+(index-1)) + self.fan_direction_attr = "fan{}_direction".format(FAN_INDEX_START+(index-1)) + + +####################### +# private function +####################### + + def __get_attr_value(self, attr_path): + + retval = 'ERR' + if (not os.path.isfile(attr_path)): + return retval + + try: + with open(attr_path, 'r') as fd: + retval = fd.read() + except Exception as error: + logging.error("Unable to open " + attr_path + " file !") + + retval = retval.rstrip(' \t\n\r') + return retval + + + #################### + # Device base + #################### + + def get_name(self): + """ + Retrieves the name of the device + + Returns: + string: The name of the device + """ + if self.is_psu_fan: + return "PSU-{}_FAN".format(self.fan_index) + else: + fantray_index = (self.fan_index-1)//FANS_PERTRAY+1 + fan_index_intray = self.fan_index - ((fantray_index-1)*FANS_PERTRAY) + return "Fantray{}_{}".format(fantray_index, fan_index_intray) + + def get_presence(self): + """ + Retrieves the presence of the device + + Returns: + bool: True if device is present, False if not + """ + attr_path = HWMON_DIR + self.fan_presence_attr + attr_rv = self.__get_attr_value(attr_path) + if (attr_rv != 'ERR'): + if (attr_rv == '1'): + return True + else: + return False + + return None + + def get_status(self): + """ + Retrieves the operational status of the device + + Returns: + A boolean value, True if device is operating properly, False if not + """ + attr_path = HWMON_DIR + self.fan_rpm_attr + attr_rv = self.__get_attr_value(attr_path) + + if (attr_rv != 'ERR' and attr_rv != '0.0'): + return True + else: + return False + + ################# + # fan base + ################# + + def get_direction(self): + """ + Retrieves the direction of fan + + Returns: + A string, either FAN_DIRECTION_INTAKE or FAN_DIRECTION_EXHAUST + depending on fan direction + """ + attr_path = HWMON_DIR + self.fan_direction_attr + attr_rv = self.__get_attr_value(attr_path) + + if attr_rv == '2': + return self.FAN_DIRECTION_INTAKE + else: + return self.FAN_DIRECTION_EXHAUST + + def get_speed(self): + """ + Retrieves the speed of fan as a percentage of full speed + + Returns: + An integer, the percentage of full fan speed, in the range 0 (off) + to 100 (full speed) + """ + attr_path = HWMON_DIR + self.fan_pwm_attr + attr_rv = self.__get_attr_value(attr_path) + + if (attr_rv != 'ERR'): + return int(float(attr_rv)) + else: + return False + + def get_speed_rpm(self): + """ + Retrieves the speed of fan in revolutions per minute (RPM) + + Returns: + An integer, speed of the fan in RPM + """ + attr_path = HWMON_DIR + self.fan_rpm_attr + attr_rv = self.__get_attr_value(attr_path) + + if (attr_rv != 'ERR'): + return int(float(attr_rv)) + else: + return False + + def get_target_speed(self): + """ + Retrieves the target (expected) speed of the fan + + Returns: + An integer, the percentage of full fan speed, in the range 0 (off) + to 100 (full speed) + """ + attr_path = HWMON_DIR + self.fan_pwm_attr + attr_rv = self.__get_attr_value(attr_path) + + if (attr_rv != 'ERR'): + return int(float(attr_rv)) + else: + return False + + def get_speed_tolerance(self): + """ + Retrieves the speed tolerance of the fan + + Returns: + An integer, the percentage of variance from target speed which is + considered tolerable + """ + return 25 + + def set_status_led(self, color): + """ + Sets the state of the fan module status LED + + Args: + color: A string representing the color with which to set the + fan module status LED + + Returns: + bool: True if status LED state is set successfully, False if not + """ + return True + + def get_status_led(self): + """ + Gets the state of the fan status LED + + Returns: + A string, one of the predefined STATUS_LED_COLOR_* strings above + """ + return None diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix7-32x/sonic_platform/fan_drawer.py b/platform/broadcom/sonic-platform-modules-quanta/ix7-32x/sonic_platform/fan_drawer.py new file mode 100644 index 000000000000..75e954576a28 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix7-32x/sonic_platform/fan_drawer.py @@ -0,0 +1,47 @@ +#!/usr/bin/env python + +############################################################################# +# Quanta +# +# Module contains an implementation of SONiC Platform Base API and +# provides the fan status which are available in the platform +# +############################################################################# + +try: + from sonic_platform_base.fan_drawer_base import FanDrawerBase +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class FanDrawer(FanDrawerBase): + + def __init__(self, index, fan_list): + FanDrawerBase.__init__(self) + + self._fan_list = fan_list + self._index = index + + def get_name(self): + """ + Retrieves the name of the device + Returns: + string: The name of the device + """ + return 'Fan {}'.format(self._index) + + def get_presence(self): + """ + Retrieves the presence of the FAN + Returns: + bool: True if FAN is present, False if not + """ + return self._fan_list[0].get_presence() + + def get_status(self): + """ + Retrieves the operational status of the device + Returns: + A boolean value, True if device is operating properly, False if not + """ + return self._fan_list[0].get_status() diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix7-32x/sonic_platform/platform.py b/platform/broadcom/sonic-platform-modules-quanta/ix7-32x/sonic_platform/platform.py new file mode 100644 index 000000000000..c4f945277f4d --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix7-32x/sonic_platform/platform.py @@ -0,0 +1,20 @@ +#!/usr/bin/env python +# +# Name: platform.py, version: 1.0 +# +# Description: Module contains the definitions of SONiC platform APIs +# + + +try: + from sonic_platform_base.platform_base import PlatformBase + from sonic_platform.chassis import Chassis +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class Platform(PlatformBase): + + def __init__(self): + PlatformBase.__init__(self) + self._chassis = Chassis() \ No newline at end of file diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix7-32x/sonic_platform/psu.py b/platform/broadcom/sonic-platform-modules-quanta/ix7-32x/sonic_platform/psu.py new file mode 100644 index 000000000000..49846fff48ff --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix7-32x/sonic_platform/psu.py @@ -0,0 +1,320 @@ +#!/usr/bin/env python +# +# Name: psu.py, version: 1.0 +# +# Description: Module contains the definitions of SONiC platform APIs +# + +try: + import logging + import os + from sonic_platform_base.psu_base import PsuBase + from sonic_platform.fan import Fan +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +HWMON_DIR = "/sys/class/hwmon/hwmon1/" + + +class Psu(PsuBase): + def __init__(self, index): + PsuBase.__init__(self) + fan = Fan(index, True) + self._fan_list.append(fan) + + self.psu_index_mapping = { + 1:42, + 2:52, + } + self.psu_powerin_index_mapping = { + 1:41, + 2:51, + } + self.psu_currentout_index_mapping = { + 1:39, + 2:49, + } + self.psu_currentin_index_mapping = { + 1:38, + 2:48, + } + self.psu_voltageout_index_mapping = { + 1:47, + 2:57, + } + self.psu_voltagein_index_mapping = { + 1:46, + 2:56, + } + self.index = index + self.psu_presence_attr = "power{}_present".format(self.psu_index_mapping[self.index]) + self.psu_status_attr = "curr{}_input".format(self.psu_currentout_index_mapping[self.index]) + self.psu_power_in_attr = "power{}_input".format(self.psu_powerin_index_mapping[self.index]) + self.psu_power_out_attr = "power{}_input".format(self.psu_index_mapping[self.index]) + self.psu_voltage_out_attr = "in{}_input".format(self.psu_voltageout_index_mapping[self.index]) + self.psu_current_out_attr = "curr{}_input".format(self.psu_currentout_index_mapping[self.index]) + self.psu_voltage_in_attr = "in{}_input".format(self.psu_voltagein_index_mapping[self.index]) + self.psu_current_in_attr = "curr{}_input".format(self.psu_currentin_index_mapping[self.index]) + self.psu_serial_attr = "power{}_sn".format(self.psu_index_mapping[self.index]) + self.psu_model_attr = "power{}_model".format(self.psu_index_mapping[self.index]) + self.psu_mfr_id_attr = "power{}_mfrid".format(self.psu_index_mapping[self.index]) + self.psu_capacity_attr = "power{}_pout_max".format(self.psu_index_mapping[self.index]) + self.psu_type_attr = "power{}_vin_type".format(self.psu_index_mapping[self.index]) + + def __get_attr_value(self, attr_path): + + retval = 'ERR' + if (not os.path.isfile(attr_path)): + return retval + + try: + with open(attr_path, 'r') as fd: + retval = fd.read() + except Exception as error: + logging.error("Unable to open " + attr_path + " file !") + + retval = retval.rstrip(' \t\n\r') + fd.close() + return retval + +############################################## +# Device methods +############################################## + + def get_name(self): + """ + Retrieves the name of the device + + Returns: + string: The name of the device + """ + return "PSU{}".format(self.index) + + def get_presence(self): + """ + Retrieves the presence of the device + + Returns: + bool: True if device is present, False if not + """ + presence = False + attr_path = HWMON_DIR+self.psu_presence_attr + attr_normal = '1' + + attr_rv = self.__get_attr_value(attr_path) + if (attr_rv != 'ERR'): + if (attr_rv == attr_normal): + presence = True + + return presence + + def get_model(self): + """ + Retrieves the model number (or part number) of the device + + Returns: + string: Model/part number of device + """ + model = "N/A" + attr_path = HWMON_DIR+self.psu_model_attr + attr_rv = self.__get_attr_value(attr_path) + if (attr_rv != 'ERR'): + model = attr_rv + + return model + + def get_mfr_id(self): + """ + Retrieves the manufacturer's name (or id) of the device + + Returns: + string: Manufacturer's id of device + """ + mfr_id = "N/A" + attr_path = HWMON_DIR+self.psu_mfr_id_attr + attr_rv = self.__get_attr_value(attr_path) + if (attr_rv != 'ERR'): + mfr_id = attr_rv + + return mfr_id + + def get_serial(self): + """ + Retrieves the serial number of the device + + Returns: + string: Serial number of device + """ + serial = "N/A" + attr_path = HWMON_DIR+self.psu_serial_attr + + attr_rv = self.__get_attr_value(attr_path) + if (attr_rv != 'ERR'): + serial = attr_rv + + return serial + + def get_status(self): + """ + Retrieves the operational status of the device + + Returns: + A boolean value, True if device is operating properly, False if not + """ + status = False + attr_path = HWMON_DIR+self.psu_status_attr + + attr_rv = self.__get_attr_value(attr_path) + if (attr_rv != 'ERR'): + attr_rv, dummy = attr_rv.split('.', 1) + if (int(attr_rv) != 0): + status = True + + return status + +############################################## +# PSU methods +############################################## + + def get_voltage(self): + """ + Retrieves current PSU voltage output + + Returns: + A float number, the output voltage in volts, + e.g. 12.1 + """ + voltage_out = 0.0 + attr_path = HWMON_DIR+self.psu_voltage_out_attr + + attr_rv = self.__get_attr_value(attr_path) + if (attr_rv != 'ERR'): + attr_rv, dummy = attr_rv.split('.', 1) + voltage_out = float(attr_rv) / 1000 + + return voltage_out + + def get_current(self): + """ + Retrieves present electric current supplied by PSU + + Returns: + A float number, the electric current in amperes, e.g 15.4 + """ + current_out = 0.0 + attr_path = HWMON_DIR+self.psu_current_out_attr + + attr_rv = self.__get_attr_value(attr_path) + if (attr_rv != 'ERR'): + attr_rv, dummy = attr_rv.split('.', 1) + current_out = float(attr_rv) / 1000 + + return current_out + + def get_input_voltage(self): + """ + Retrieves current PSU voltage output + + Returns: + A float number, the output voltage in volts, + e.g. 12.1 + """ + voltage_in = 0.0 + attr_path = HWMON_DIR+self.psu_voltage_in_attr + + attr_rv = self.__get_attr_value(attr_path) + if (attr_rv != 'ERR'): + attr_rv, dummy = attr_rv.split('.', 1) + voltage_in = float(attr_rv) / 1000 + + return voltage_in + + def get_input_current(self): + """ + Retrieves present electric current supplied by PSU + + Returns: + A float number, the electric current in amperes, e.g 15.4 + """ + current_in = 0.0 + attr_path = HWMON_DIR+self.psu_current_in_attr + + attr_rv = self.__get_attr_value(attr_path) + if (attr_rv != 'ERR'): + attr_rv, dummy = attr_rv.split('.', 1) + current_in = float(attr_rv) / 1000 + + return current_in + + def get_power(self): + """ + Retrieves current energy supplied by PSU + + Returns: + A float number, the power in watts, e.g. 302.6 + """ + power_out = 0.0 + attr_path = HWMON_DIR+self.psu_power_out_attr + + attr_rv = self.__get_attr_value(attr_path) + if (attr_rv != 'ERR'): + attr_rv, dummy = attr_rv.split('.', 1) + power_out = float(attr_rv) / 1000 + + return power_out + + def get_powergood_status(self): + """ + Retrieves the powergood status of PSU + + Returns: + A boolean, True if PSU has stablized its output voltages and passed all + its internal self-tests, False if not. + """ + return self.get_status() + + def get_status_led(self): + """ + Gets the state of the PSU status LED + + Returns: + A string, one of the predefined STATUS_LED_COLOR_* strings above + """ + if self.get_powergood_status(): + return self.STATUS_LED_COLOR_GREEN + else: + return self.STATUS_LED_COLOR_OFF + + def get_type(self): + """ + Gets the type of the PSU + + Returns: + A string, the type of PSU (AC/DC) + """ + type = "AC" + attr_path = HWMON_DIR+self.psu_type_attr + attr_rv = self.__get_attr_value(attr_path) + if (attr_rv != 'ERR'): + type = attr_rv + + return type + + def get_capacity(self): + """ + Gets the capacity (maximum output power) of the PSU in watts + + Returns: + An integer, the capacity of PSU + """ + capacity = 0 + attr_path = HWMON_DIR+self.psu_capacity_attr + attr_rv = self.__get_attr_value(attr_path) + if (attr_rv != 'ERR'): + try: + capacity = int(attr_rv) + except ValueError: + capacity = 0 + + return capacity + diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix7-32x/sonic_platform/sfp.py b/platform/broadcom/sonic-platform-modules-quanta/ix7-32x/sonic_platform/sfp.py new file mode 100644 index 000000000000..c97e91d74a75 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix7-32x/sonic_platform/sfp.py @@ -0,0 +1,1596 @@ +#!/usr/bin/env python + +############################################################################# +# Quanta +# +# Sfp contains an implementation of SONiC Platform Base API and +# provides the sfp device status which are available in the platform +# +############################################################################# + +import os +import time +#import subprocess +#import sonic_device_util +from ctypes import create_string_buffer + +try: + from sonic_platform_base.sfp_base import SfpBase +# from sonic_platform_base.sonic_eeprom import eeprom_dts + from sonic_platform_base.sonic_sfp.sff8472 import sff8472InterfaceId + from sonic_platform_base.sonic_sfp.sff8472 import sff8472Dom + from sonic_platform_base.sonic_sfp.sff8436 import sff8436InterfaceId + from sonic_platform_base.sonic_sfp.sff8436 import sff8436Dom + from sonic_platform_base.sonic_sfp.sfputilhelper import SfpUtilHelper +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +QSFP_INFO_OFFSET = 128 +QSFP_DOM_OFFSET = 0 +SFP_INFO_OFFSET = 0 +SFP_DOM_OFFSET = 256 + +# definitions of the offset and width for values in XCVR info eeprom +XCVR_INTFACE_BULK_OFFSET = 0 +XCVR_INTFACE_BULK_WIDTH_QSFP = 20 +XCVR_INTFACE_BULK_WIDTH_SFP = 21 +XCVR_TYPE_OFFSET = 0 +XCVR_TYPE_WIDTH = 1 +XCVR_EXT_TYPE_OFFSET = 1 +XCVR_EXT_TYPE_WIDTH = 1 +XCVR_CONNECTOR_OFFSET = 2 +XCVR_CONNECTOR_WIDTH = 1 +XCVR_COMPLIANCE_CODE_OFFSET = 3 +XCVR_COMPLIANCE_CODE_WIDTH = 8 +XCVR_ENCODING_OFFSET = 11 +XCVR_ENCODING_WIDTH = 1 +XCVR_NBR_OFFSET = 12 +XCVR_NBR_WIDTH = 1 +XCVR_EXT_RATE_SEL_OFFSET = 13 +XCVR_EXT_RATE_SEL_WIDTH = 1 +XCVR_CABLE_LENGTH_OFFSET = 14 +XCVR_CABLE_LENGTH_WIDTH_QSFP = 5 +XCVR_CABLE_LENGTH_WIDTH_SFP = 6 +XCVR_VENDOR_NAME_OFFSET = 20 +XCVR_VENDOR_NAME_WIDTH = 16 +XCVR_VENDOR_OUI_OFFSET = 37 +XCVR_VENDOR_OUI_WIDTH = 3 +XCVR_VENDOR_PN_OFFSET = 40 +XCVR_VENDOR_PN_WIDTH = 16 +XCVR_HW_REV_OFFSET = 56 +XCVR_HW_REV_WIDTH_QSFP = 2 +XCVR_HW_REV_WIDTH_SFP = 4 +XCVR_VENDOR_SN_OFFSET = 68 +XCVR_VENDOR_SN_WIDTH = 16 +XCVR_VENDOR_DATE_OFFSET = 84 +XCVR_VENDOR_DATE_WIDTH = 8 +XCVR_DOM_CAPABILITY_OFFSET = 92 +XCVR_DOM_CAPABILITY_WIDTH = 2 + +XCVR_INTERFACE_DATA_START = 0 +XCVR_INTERFACE_DATA_SIZE = 92 + +QSFP_DOM_BULK_DATA_START = 22 +QSFP_DOM_BULK_DATA_SIZE = 36 +SFP_DOM_BULK_DATA_START = 96 +SFP_DOM_BULK_DATA_SIZE = 10 + +# Offset for values in QSFP eeprom +QSFP_DOM_REV_OFFSET = 1 +QSFP_DOM_REV_WIDTH = 1 +QSFP_TEMPE_OFFSET = 22 +QSFP_TEMPE_WIDTH = 2 +QSFP_VOLT_OFFSET = 26 +QSFP_VOLT_WIDTH = 2 +QSFP_VERSION_COMPLIANCE_OFFSET = 1 +QSFP_VERSION_COMPLIANCE_WIDTH = 1 +QSFP_CHANNL_MON_OFFSET = 34 +QSFP_CHANNL_MON_WIDTH = 16 +QSFP_CHANNL_MON_WITH_TX_POWER_WIDTH = 24 +QSFP_CHANNL_DISABLE_STATUS_OFFSET = 86 +QSFP_CHANNL_DISABLE_STATUS_WIDTH = 1 +QSFP_CHANNL_RX_LOS_STATUS_OFFSET = 3 +QSFP_CHANNL_RX_LOS_STATUS_WIDTH = 1 +QSFP_CHANNL_TX_FAULT_STATUS_OFFSET = 4 +QSFP_CHANNL_TX_FAULT_STATUS_WIDTH = 1 +QSFP_CONTROL_OFFSET = 86 +QSFP_CONTROL_WIDTH = 8 +QSFP_MODULE_MONITOR_OFFSET = 0 +QSFP_MODULE_MONITOR_WIDTH = 9 +QSFP_MODULE_THRESHOLD_OFFSET = 512 +QSFP_MODULE_THRESHOLD_WIDTH = 24 +QSFP_CHANNEL_THRESHOLD_OFFSET = 560 +QSFP_CHANNEL_THRESHOLD_WIDTH = 16 +QSFP_POWEROVERRIDE_OFFSET = 93 +QSFP_POWEROVERRIDE_WIDTH = 1 +QSFP_POWEROVERRIDE_BIT = 0 +QSFP_POWERSET_BIT = 1 +QSFP_OPTION_VALUE_OFFSET = 192 +QSFP_OPTION_VALUE_WIDTH = 4 + +SFP_TEMPE_OFFSET = 96 +SFP_TEMPE_WIDTH = 2 +SFP_VOLT_OFFSET = 98 +SFP_VOLT_WIDTH = 2 +SFP_CHANNL_MON_OFFSET = 100 +SFP_CHANNL_MON_WIDTH = 6 +SFP_MODULE_THRESHOLD_OFFSET = 0 +SFP_MODULE_THRESHOLD_WIDTH = 40 +SFP_CHANNL_THRESHOLD_OFFSET = 112 +SFP_CHANNL_THRESHOLD_WIDTH = 2 +SFP_STATUS_CONTROL_OFFSET = 110 +SFP_STATUS_CONTROL_WIDTH = 1 +SFP_TX_DISABLE_HARD_BIT = 7 +SFP_TX_DISABLE_SOFT_BIT = 6 + +qsfp_cable_length_tup = ('Length(km)', 'Length OM3(2m)', + 'Length OM2(m)', 'Length OM1(m)', + 'Length Cable Assembly(m)') + +sfp_cable_length_tup = ('LengthSMFkm-UnitsOfKm', 'LengthSMF(UnitsOf100m)', + 'Length50um(UnitsOf10m)', 'Length62.5um(UnitsOfm)', + 'LengthCable(UnitsOfm)', 'LengthOM3(UnitsOf10m)') + +sfp_compliance_code_tup = ('10GEthernetComplianceCode', 'InfinibandComplianceCode', + 'ESCONComplianceCodes', 'SONETComplianceCodes', + 'EthernetComplianceCodes','FibreChannelLinkLength', + 'FibreChannelTechnology', 'SFP+CableTechnology', + 'FibreChannelTransmissionMedia','FibreChannelSpeed') + +qsfp_compliance_code_tup = ('10/40G Ethernet Compliance Code', 'SONET Compliance codes', + 'SAS/SATA compliance codes', 'Gigabit Ethernet Compliant codes', + 'Fibre Channel link length/Transmitter Technology', + 'Fibre Channel transmission media', 'Fibre Channel Speed') + +SFP_TYPE = "SFP" +QSFP_TYPE = "QSFP" + + +class Sfp(SfpBase): + """Platform-specific Sfp class""" + + # Port number + PORT_START = 1 + PORT_END = 32 + QSFP_START = 1 + QSFP_END = 32 + + dom_supported = True + dom_temp_supported = True + dom_volt_supported = True + dom_rx_power_supported = True + dom_tx_power_supported = True + dom_tx_disable_supported = True + calibration = 1 + + # Path to QSFP sysfs + PLATFORM_ROOT_PATH = "/usr/share/sonic/device" + PMON_HWSKU_PATH = "/usr/share/sonic/hwsku" + HOST_CHK_CMD = "docker > /dev/null 2>&1" + + PLATFORM = "x86_64-quanta_ix7_rglbmc-r0" + HWSKU = "Quanta-IX7-32X" + + def __init__(self, sfp_index, sfp_type): + # Init index + self.index = sfp_index + self.port_num = self.index + #self.dom_supported = False + self.sfp_type = sfp_type + self.lpmode_path = "/sys/class/cpld-qsfp28/port-"+str(self.port_num)+"/lpmode" + self.reset_path = "/sys/class/cpld-qsfp28/port-"+str(self.port_num)+"/reset" + # Init eeprom path + eeprom_path = '/sys/bus/i2c/devices/i2c-{0}/{0}-0050/eeprom' + self.port_to_eeprom_mapping = {} + self.port_to_i2c_mapping = { + 1 : 17, + 2 : 18, + 3 : 19, + 4 : 20, + 5 : 21, + 6 : 22, + 7 : 23, + 8 : 24, + 9 : 25, + 10 : 26, + 11 : 27, + 12 : 28, + 13 : 29, + 14 : 30, + 15 : 31, + 16 : 32, + 17 : 33, + 18 : 34, + 19 : 35, + 20 : 36, + 21 : 37, + 22 : 38, + 23 : 39, + 24 : 40, + 25 : 41, + 26 : 42, + 27 : 43, + 28 : 44, + 29 : 45, + 30 : 46, + 31 : 47, + 32 : 48 + } + + for x in range(self.PORT_START, self.PORT_END + 1): + port_eeprom_path = eeprom_path.format(self.port_to_i2c_mapping[x]) + self.port_to_eeprom_mapping[x] = port_eeprom_path + + self.info_dict_keys = ['type', 'hardware_rev', 'serial', 'manufacturer', + 'model', 'connector', 'encoding', 'ext_identifier', + 'ext_rateselect_compliance', 'cable_type', 'cable_length', + 'nominal_bit_rate', 'specification_compliance', 'vendor_date', + 'vendor_oui', 'application_advertisement'] + + self.dom_dict_keys = ['rx_los', 'tx_fault', 'reset_status', 'power_lpmode', + 'tx_disable', 'tx_disable_channel', 'temperature', 'voltage', + 'rx1power', 'rx2power', 'rx3power', 'rx4power', 'tx1bias', 'tx2bias', + 'tx3bias', 'tx4bias', 'tx1power', 'tx2power', 'tx3power', 'tx4power'] + + self.threshold_dict_keys = ['temphighalarm', 'temphighwarning', + 'templowalarm', 'templowwarning', 'vcchighalarm', 'vcchighwarning', + 'vcclowalarm', 'vcclowwarning', 'rxpowerhighalarm', 'rxpowerhighwarning', + 'rxpowerlowalarm', 'rxpowerlowwarning', 'txpowerhighalarm', + 'txpowerhighwarning', 'txpowerlowalarm', 'txpowerlowwarning', + 'txbiashighalarm', 'txbiashighwarning', 'txbiaslowalarm', 'txbiaslowwarning'] + + SfpBase.__init__(self) + + + def _convert_string_to_num(self, value_str): + if "-inf" in value_str: + return 'N/A' + elif "Unknown" in value_str: + return 'N/A' + elif 'dBm' in value_str: + t_str = value_str.rstrip('dBm') + return float(t_str) + elif 'mA' in value_str: + t_str = value_str.rstrip('mA') + return float(t_str) + elif 'C' in value_str: + t_str = value_str.rstrip('C') + return float(t_str) + elif 'Volts' in value_str: + t_str = value_str.rstrip('Volts') + return float(t_str) + else: + return 'N/A' + + def __read_txt_file(self, file_path): + try: + with open(file_path, 'r') as fd: + data = fd.read() + return data.strip() + except IOError: + pass + return "" + + def __is_host(self): + return os.system(self.HOST_CHK_CMD) == 0 + + def __get_path_to_port_config_file(self): + platform_path = "/".join([self.PLATFORM_ROOT_PATH, self.PLATFORM]) + hwsku_path = "/".join([platform_path, self.HWSKU] + ) if self.__is_host() else self.PMON_HWSKU_PATH + return "/".join([hwsku_path, "port_config.ini"]) + + def get_presence(self): + """ + Retrieves the presence of the SFP module + Returns: + bool: True if SFP module is present, False if not + """ + # Check for invalid port_num + if self.port_num < self.PORT_START or self.port_num > self.PORT_END: + return False + + try: + reg_file = open("/sys/class/cpld-qsfp28/port-"+str(self.port_num)+"/module_present") + except IOError as e: + print("Error: unable to open file: %s" % str(e)) + return False + + reg_value = reg_file.readline().rstrip() + reg_file.close() + if reg_value == '1': + return True + + return False + + def __read_eeprom_specific_bytes(self, offset, num_bytes): + sysfsfile_eeprom = None + eeprom_raw = [] + for i in range(0, num_bytes): + eeprom_raw.append("0x00") + + sysfs_sfp_i2c_client_eeprom_path = self.port_to_eeprom_mapping[self.port_num] + try: + sysfsfile_eeprom = open( + sysfs_sfp_i2c_client_eeprom_path, mode="rb", buffering=0) + sysfsfile_eeprom.seek(offset) + raw = sysfsfile_eeprom.read(num_bytes) + for n in range(0, num_bytes): + eeprom_raw[n] = hex(raw[n])[2:].zfill(2) + except Exception: + eeprom_raw = None + finally: + if sysfsfile_eeprom: + sysfsfile_eeprom.close() + + return eeprom_raw + + def __convert_string_to_num(self, value_str): + if "-inf" in value_str: + return 'N/A' + elif "Unknown" in value_str: + return 'N/A' + elif 'dBm' in value_str: + t_str = value_str.rstrip('dBm') + return float(t_str) + elif 'mA' in value_str: + t_str = value_str.rstrip('mA') + return float(t_str) + elif 'C' in value_str: + t_str = value_str.rstrip('C') + return float(t_str) + elif 'Volts' in value_str: + t_str = value_str.rstrip('Volts') + return float(t_str) + else: + return 'N/A' + + def _dom_capability_detect(self): + if not self.get_presence(): + self.dom_supported = False + self.dom_temp_supported = False + self.dom_volt_supported = False + self.dom_rx_power_supported = False + self.dom_tx_power_supported = False + self.calibration = 0 + return + + if self.sfp_type == "QSFP": + self.calibration = 1 + sfpi_obj = sff8436InterfaceId() + if sfpi_obj is None: + self.dom_supported = False + offset = 128 + + # QSFP capability byte parse, through this byte can know whether it support tx_power or not. + # TODO: in the future when decided to migrate to support SFF-8636 instead of SFF-8436, + # need to add more code for determining the capability and version compliance + # in SFF-8636 dom capability definitions evolving with the versions. + qsfp_dom_capability_raw = self.__read_eeprom_specific_bytes( + (offset + XCVR_DOM_CAPABILITY_OFFSET), XCVR_DOM_CAPABILITY_WIDTH) + if qsfp_dom_capability_raw is not None: + qsfp_dom_capability = int(qsfp_dom_capability_raw[0], 16) + + qsfp_version_compliance_raw = self.__read_eeprom_specific_bytes( + QSFP_VERSION_COMPLIANCE_OFFSET, QSFP_VERSION_COMPLIANCE_OFFSET) + if qsfp_version_compliance_raw is not None: + qsfp_version_compliance = int(qsfp_version_compliance_raw[0], 16) + else: + self.dom_supported = False + self.dom_temp_supported = False + self.dom_volt_supported = False + self.dom_rx_power_supported = False + self.dom_tx_power_supported = False + self.calibration = 0 + return + + if qsfp_version_compliance >= 0x08: + self.dom_temp_supported = (qsfp_dom_capability & 0x20 != 0) + self.dom_volt_supported = (qsfp_dom_capability & 0x10 != 0) + self.dom_rx_power_supported = (qsfp_dom_capability & 0x08 != 0) + self.dom_tx_power_supported = (qsfp_dom_capability & 0x04 != 0) + else: + self.dom_temp_supported = True + self.dom_volt_supported = True + self.dom_rx_power_supported = (qsfp_dom_capability & 0x08 != 0) + self.dom_tx_power_supported = True + self.dom_supported = True + self.calibration = 1 + self.dom_tx_disable_supported = True + else: + self.dom_supported = False + self.dom_temp_supported = False + self.dom_volt_supported = False + self.dom_rx_power_supported = False + self.dom_tx_power_supported = False + self.calibration = 0 + elif self.sfp_type == "SFP": + sfpi_obj = sff8472InterfaceId() + if sfpi_obj is None: + return None + sfp_dom_capability_raw = self.__read_eeprom_specific_bytes( + XCVR_DOM_CAPABILITY_OFFSET, XCVR_DOM_CAPABILITY_WIDTH) + if sfp_dom_capability_raw is not None: + sfp_dom_capability = int(sfp_dom_capability_raw[0], 16) + self.dom_supported = (sfp_dom_capability & 0x40 != 0) + if self.dom_supported: + self.dom_temp_supported = True + self.dom_volt_supported = True + self.dom_rx_power_supported = True + self.dom_tx_power_supported = True + if sfp_dom_capability & 0x20 != 0: + self.calibration = 1 + elif sfp_dom_capability & 0x10 != 0: + self.calibration = 2 + else: + self.calibration = 0 + else: + self.dom_temp_supported = False + self.dom_volt_supported = False + self.dom_rx_power_supported = False + self.dom_tx_power_supported = False + self.calibration = 0 + self.dom_tx_disable_supported = (int(sfp_dom_capability_raw[1], 16) & 0x40 != 0) + else: + self.dom_supported = False + self.dom_temp_supported = False + self.dom_volt_supported = False + self.dom_rx_power_supported = False + self.dom_tx_power_supported = False + + def get_transceiver_info(self): + """ + Retrieves transceiver info of this SFP + Returns: + A dict which contains following keys/values : + ======================================================================== + keys |Value Format |Information + ---------------------------|---------------|---------------------------- + type |1*255VCHAR |type of SFP + hardware_rev |1*255VCHAR |hardware version of SFP + serial |1*255VCHAR |serial number of the SFP + manufacturer |1*255VCHAR |SFP vendor name + model |1*255VCHAR |SFP model name + connector |1*255VCHAR |connector information + encoding |1*255VCHAR |encoding information + ext_identifier |1*255VCHAR |extend identifier + ext_rateselect_compliance |1*255VCHAR |extended rateSelect compliance + cable_length |INT |cable length in m + nominal_bit_rate |INT |nominal bit rate by 100Mbs + specification_compliance |1*255VCHAR |specification compliance + vendor_date |1*255VCHAR |vendor date + vendor_oui |1*255VCHAR |vendor OUI + application_advertisement |1*255VCHAR |supported applications advertisement + ======================================================================== + """ + + transceiver_info_dict = {} + compliance_code_dict = {} + transceiver_info_dict = dict.fromkeys(self.info_dict_keys, 'N/A') + transceiver_info_dict['specification_compliance'] = '{}' + if not self.get_presence(): + return transceiver_info_dict + + if self.sfp_type == QSFP_TYPE: + offset = QSFP_INFO_OFFSET + vendor_rev_width = XCVR_HW_REV_WIDTH_QSFP + interface_info_bulk_width = XCVR_INTFACE_BULK_WIDTH_QSFP + + sfpi_obj = sff8436InterfaceId() + if sfpi_obj is None: + print("Error: sfp_object open failed") + return transceiver_info_dict + + elif self.sfp_type == SFP_TYPE: + offset = SFP_INFO_OFFSET + vendor_rev_width = XCVR_HW_REV_WIDTH_SFP + interface_info_bulk_width = XCVR_INTFACE_BULK_WIDTH_SFP + + sfpi_obj = sff8472InterfaceId() + if sfpi_obj is None: + print("Error: sfp_object open failed") + return transceiver_info_dict + else: + return transceiver_info_dict + + # Add retry for xcvr eeprom to get ready + max_retry = 10 + for i in range(0,max_retry): + sfp_interface_bulk_raw = self.__read_eeprom_specific_bytes( + offset + XCVR_INTERFACE_DATA_START, XCVR_INTERFACE_DATA_SIZE) + if sfp_interface_bulk_raw is not None: + break + else: + if not self.get_presence(): + return transceiver_info_dict + elif i == max_retry-1: + pass + else: + time.sleep(0.5) + + if sfp_interface_bulk_raw is None: + return transceiver_info_dict + + start = XCVR_INTFACE_BULK_OFFSET - XCVR_INTERFACE_DATA_START + end = start + interface_info_bulk_width + sfp_interface_bulk_data = sfpi_obj.parse_sfp_info_bulk(sfp_interface_bulk_raw[start : end], 0) + + start = XCVR_VENDOR_NAME_OFFSET - XCVR_INTERFACE_DATA_START + end = start + XCVR_VENDOR_NAME_WIDTH + sfp_vendor_name_data = sfpi_obj.parse_vendor_name(sfp_interface_bulk_raw[start : end], 0) + + start = XCVR_VENDOR_PN_OFFSET - XCVR_INTERFACE_DATA_START + end = start + XCVR_VENDOR_PN_WIDTH + sfp_vendor_pn_data = sfpi_obj.parse_vendor_pn(sfp_interface_bulk_raw[start : end], 0) + + start = XCVR_HW_REV_OFFSET - XCVR_INTERFACE_DATA_START + end = start + vendor_rev_width + sfp_vendor_rev_data = sfpi_obj.parse_vendor_rev(sfp_interface_bulk_raw[start : end], 0) + + start = XCVR_VENDOR_SN_OFFSET - XCVR_INTERFACE_DATA_START + end = start + XCVR_VENDOR_SN_WIDTH + sfp_vendor_sn_data = sfpi_obj.parse_vendor_sn(sfp_interface_bulk_raw[start : end], 0) + + start = XCVR_VENDOR_OUI_OFFSET - XCVR_INTERFACE_DATA_START + end = start + XCVR_VENDOR_OUI_WIDTH + sfp_vendor_oui_data = sfpi_obj.parse_vendor_oui(sfp_interface_bulk_raw[start : end], 0) + + start = XCVR_VENDOR_DATE_OFFSET - XCVR_INTERFACE_DATA_START + end = start + XCVR_VENDOR_DATE_WIDTH + sfp_vendor_date_data = sfpi_obj.parse_vendor_date(sfp_interface_bulk_raw[start : end], 0) + transceiver_info_dict['type'] = sfp_interface_bulk_data \ + ['data']['type']['value'] + transceiver_info_dict['manufacturer'] = sfp_vendor_name_data \ + ['data']['Vendor Name']['value'] + transceiver_info_dict['model'] = sfp_vendor_pn_data \ + ['data']['Vendor PN']['value'] + transceiver_info_dict['hardware_rev'] = sfp_vendor_rev_data \ + ['data']['Vendor Rev']['value'] + transceiver_info_dict['serial'] = sfp_vendor_sn_data \ + ['data']['Vendor SN']['value'] + transceiver_info_dict['vendor_oui'] = sfp_vendor_oui_data \ + ['data']['Vendor OUI']['value'] + transceiver_info_dict['vendor_date'] = sfp_vendor_date_data \ + ['data']['VendorDataCode(YYYY-MM-DD Lot)']['value'] + transceiver_info_dict['connector'] = sfp_interface_bulk_data \ + ['data']['Connector']['value'] + transceiver_info_dict['encoding'] = sfp_interface_bulk_data \ + ['data']['EncodingCodes']['value'] + transceiver_info_dict['ext_identifier'] = sfp_interface_bulk_data \ + ['data']['Extended Identifier']['value'] + transceiver_info_dict['ext_rateselect_compliance'] = sfp_interface_bulk_data \ + ['data']['RateIdentifier']['value'] + transceiver_info_dict['type_abbrv_name'] = 'N/A' + if self.sfp_type == QSFP_TYPE: + for key in qsfp_cable_length_tup: + if key in sfp_interface_bulk_data['data']: + transceiver_info_dict['cable_type'] = key + transceiver_info_dict['cable_length'] = str( + sfp_interface_bulk_data['data'][key]['value']) + + for key in qsfp_compliance_code_tup: + if key in sfp_interface_bulk_data['data']['Specification compliance']['value']: + compliance_code_dict[key] = sfp_interface_bulk_data \ + ['data']['Specification compliance']['value'][key]['value'] + transceiver_info_dict['specification_compliance'] = str(compliance_code_dict) + + transceiver_info_dict['nominal_bit_rate'] = str(sfp_interface_bulk_data \ + ['data']['Nominal Bit Rate(100Mbs)']['value']) + else: + for key in sfp_cable_length_tup: + if key in sfp_interface_bulk_data['data']: + transceiver_info_dict['cable_type'] = key + transceiver_info_dict['cable_length'] = str( + sfp_interface_bulk_data['data'][key]['value']) + + for key in sfp_compliance_code_tup: + if key in sfp_interface_bulk_data['data']['Specification compliance']['value']: + compliance_code_dict[key] = sfp_interface_bulk_data \ + ['data']['Specification compliance']['value'][key]['value'] + transceiver_info_dict['specification_compliance'] = str(compliance_code_dict) + + transceiver_info_dict['nominal_bit_rate'] = str(sfp_interface_bulk_data \ + ['data']['NominalSignallingRate(UnitsOf100Mbd)']['value']) + + return transceiver_info_dict + + def get_transceiver_bulk_status(self): + """ + Retrieves transceiver bulk status of this SFP + Returns: + A dict which contains following keys/values : + ======================================================================== + keys |Value Format |Information + ---------------------------|---------------|---------------------------- + rx_los |BOOLEAN |RX loss-of-signal status, True if has RX los, False if not. + tx_fault |BOOLEAN |TX fault status, True if has TX fault, False if not. + reset_status |BOOLEAN |reset status, True if SFP in reset, False if not. + lp_mode |BOOLEAN |low power mode status, True in lp mode, False if not. + tx_disable |BOOLEAN |TX disable status, True TX disabled, False if not. + tx_disabled_channel |HEX |disabled TX channels in hex, bits 0 to 3 represent channel 0 + | |to channel 3. + temperature |INT |module temperature in Celsius + voltage |INT |supply voltage in mV + txbias |INT |TX Bias Current in mA, n is the channel number, + | |for example, tx2bias stands for tx bias of channel 2. + rxpower |INT |received optical power in mW, n is the channel number, + | |for example, rx2power stands for rx power of channel 2. + txpower |INT |TX output power in mW, n is the channel number, + | |for example, tx2power stands for tx power of channel 2. + ======================================================================== + """ + + if not self.get_presence(): + return {} + + self._dom_capability_detect() + + if self.sfp_type == QSFP_TYPE: + sfpd_obj = sff8436Dom() + sfpi_obj = sff8436InterfaceId() + + if not sfpi_obj or not sfpd_obj: + return {} + + transceiver_dom_info_dict = dict.fromkeys(self.dom_dict_keys, 'N/A') + offset = QSFP_DOM_OFFSET + offset_xcvr = QSFP_INFO_OFFSET + + # QSFP capability byte parse, through this byte can know whether it support tx_power or not. + # TODO: in the future when decided to migrate to support SFF-8636 instead of SFF-8436, + # need to add more code for determining the capability and version compliance + # in SFF-8636 dom capability definitions evolving with the versions. + qsfp_dom_capability_raw = self.__read_eeprom_specific_bytes( + (offset_xcvr + XCVR_DOM_CAPABILITY_OFFSET), XCVR_DOM_CAPABILITY_WIDTH) + if qsfp_dom_capability_raw is not None: + qsfp_dom_capability_data = sfpi_obj.parse_dom_capability( + qsfp_dom_capability_raw, 0) + else: + return None + + dom_temperature_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_TEMPE_OFFSET), QSFP_TEMPE_WIDTH) + if dom_temperature_raw is not None: + dom_temperature_data = sfpd_obj.parse_temperature( + dom_temperature_raw, 0) + transceiver_dom_info_dict['temperature'] = dom_temperature_data['data']['Temperature']['value'] + + dom_voltage_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_VOLT_OFFSET), QSFP_VOLT_WIDTH) + if dom_voltage_raw is not None: + dom_voltage_data = sfpd_obj.parse_voltage(dom_voltage_raw, 0) + transceiver_dom_info_dict['voltage'] = dom_voltage_data['data']['Vcc']['value'] + + qsfp_dom_rev_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_DOM_REV_OFFSET), QSFP_DOM_REV_WIDTH) + if qsfp_dom_rev_raw is not None: + qsfp_dom_rev_data = sfpd_obj.parse_sfp_dom_rev(qsfp_dom_rev_raw, 0) + qsfp_dom_rev = qsfp_dom_rev_data['data']['dom_rev']['value'] + + # The tx_power monitoring is only available on QSFP which compliant with SFF-8636 + # and claimed that it support tx_power with one indicator bit. + dom_channel_monitor_data = {} + dom_channel_monitor_raw = None + qsfp_tx_power_support = qsfp_dom_capability_data['data']['Tx_power_support']['value'] + if (qsfp_dom_rev[0:8] != 'SFF-8636' or (qsfp_dom_rev[0:8] == 'SFF-8636' and qsfp_tx_power_support != 'on')): + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_CHANNL_MON_OFFSET), QSFP_CHANNL_MON_WIDTH) + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = sfpd_obj.parse_channel_monitor_params( + dom_channel_monitor_raw, 0) + + else: + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_CHANNL_MON_OFFSET), QSFP_CHANNL_MON_WITH_TX_POWER_WIDTH) + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = sfpd_obj.parse_channel_monitor_params_with_tx_power( + dom_channel_monitor_raw, 0) + transceiver_dom_info_dict['tx1power'] = dom_channel_monitor_data['data']['TX1Power']['value'] + transceiver_dom_info_dict['tx2power'] = dom_channel_monitor_data['data']['TX2Power']['value'] + transceiver_dom_info_dict['tx3power'] = dom_channel_monitor_data['data']['TX3Power']['value'] + transceiver_dom_info_dict['tx4power'] = dom_channel_monitor_data['data']['TX4Power']['value'] + + if dom_channel_monitor_raw: + transceiver_dom_info_dict['rx1power'] = dom_channel_monitor_data['data']['RX1Power']['value'] + transceiver_dom_info_dict['rx2power'] = dom_channel_monitor_data['data']['RX2Power']['value'] + transceiver_dom_info_dict['rx3power'] = dom_channel_monitor_data['data']['RX3Power']['value'] + transceiver_dom_info_dict['rx4power'] = dom_channel_monitor_data['data']['RX4Power']['value'] + transceiver_dom_info_dict['tx1bias'] = dom_channel_monitor_data['data']['TX1Bias']['value'] + transceiver_dom_info_dict['tx2bias'] = dom_channel_monitor_data['data']['TX2Bias']['value'] + transceiver_dom_info_dict['tx3bias'] = dom_channel_monitor_data['data']['TX3Bias']['value'] + transceiver_dom_info_dict['tx4bias'] = dom_channel_monitor_data['data']['TX4Bias']['value'] + elif self.sfp_type == SFP_TYPE: + sfpd_obj = sff8472Dom() + if not sfpd_obj: + return {} + + eeprom_ifraw = self.__read_eeprom_specific_bytes(0, SFP_DOM_OFFSET) + if eeprom_ifraw is not None: + sfpi_obj = sff8472InterfaceId(eeprom_ifraw) + cal_type = sfpi_obj.get_calibration_type() + sfpd_obj._calibration_type = cal_type + + offset = SFP_DOM_OFFSET + transceiver_dom_info_dict = dict.fromkeys(self.dom_dict_keys, 'N/A') + dom_temperature_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_TEMPE_OFFSET), SFP_TEMPE_WIDTH) + + if dom_temperature_raw is not None: + dom_temperature_data = sfpd_obj.parse_temperature( + dom_temperature_raw, 0) + transceiver_dom_info_dict['temperature'] = dom_temperature_data['data']['Temperature']['value'] + + dom_voltage_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_VOLT_OFFSET), SFP_VOLT_WIDTH) + if dom_voltage_raw is not None: + dom_voltage_data = sfpd_obj.parse_voltage(dom_voltage_raw, 0) + transceiver_dom_info_dict['voltage'] = dom_voltage_data['data']['Vcc']['value'] + + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_CHANNL_MON_OFFSET), SFP_CHANNL_MON_WIDTH) + if dom_channel_monitor_raw is not None: + dom_voltage_data = sfpd_obj.parse_channel_monitor_params( + dom_channel_monitor_raw, 0) + transceiver_dom_info_dict['tx1power'] = dom_voltage_data['data']['TXPower']['value'] + transceiver_dom_info_dict['rx1power'] = dom_voltage_data['data']['RXPower']['value'] + transceiver_dom_info_dict['tx1bias'] = dom_voltage_data['data']['TXBias']['value'] + else: + return None + + for key in transceiver_dom_info_dict: + transceiver_dom_info_dict[key] = self._convert_string_to_num( + transceiver_dom_info_dict[key]) + + transceiver_dom_info_dict['rx_los'] = self.get_rx_los() + transceiver_dom_info_dict['tx_fault'] = self.get_tx_fault() + transceiver_dom_info_dict['reset_status'] = self.get_reset_status() + transceiver_dom_info_dict['lp_mode'] = self.get_lpmode() + transceiver_dom_info_dict['tx_disable'] = self.get_tx_disable() + transceiver_dom_info_dict['tx_disable_channel'] = self.get_tx_disable_channel() + + return transceiver_dom_info_dict + + def get_transceiver_threshold_info(self): + """ + Retrieves transceiver threshold info of this SFP + + Returns: + A dict which contains following keys/values : + ======================================================================== + keys |Value Format |Information + ---------------------------|---------------|---------------------------- + temphighalarm |FLOAT |High Alarm Threshold value of temperature in Celsius. + templowalarm |FLOAT |Low Alarm Threshold value of temperature in Celsius. + temphighwarning |FLOAT |High Warning Threshold value of temperature in Celsius. + templowwarning |FLOAT |Low Warning Threshold value of temperature in Celsius. + vcchighalarm |FLOAT |High Alarm Threshold value of supply voltage in mV. + vcclowalarm |FLOAT |Low Alarm Threshold value of supply voltage in mV. + vcchighwarning |FLOAT |High Warning Threshold value of supply voltage in mV. + vcclowwarning |FLOAT |Low Warning Threshold value of supply voltage in mV. + rxpowerhighalarm |FLOAT |High Alarm Threshold value of received power in dBm. + rxpowerlowalarm |FLOAT |Low Alarm Threshold value of received power in dBm. + rxpowerhighwarning |FLOAT |High Warning Threshold value of received power in dBm. + rxpowerlowwarning |FLOAT |Low Warning Threshold value of received power in dBm. + txpowerhighalarm |FLOAT |High Alarm Threshold value of transmit power in dBm. + txpowerlowalarm |FLOAT |Low Alarm Threshold value of transmit power in dBm. + txpowerhighwarning |FLOAT |High Warning Threshold value of transmit power in dBm. + txpowerlowwarning |FLOAT |Low Warning Threshold value of transmit power in dBm. + txbiashighalarm |FLOAT |High Alarm Threshold value of tx Bias Current in mA. + txbiaslowalarm |FLOAT |Low Alarm Threshold value of tx Bias Current in mA. + txbiashighwarning |FLOAT |High Warning Threshold value of tx Bias Current in mA. + txbiaslowwarning |FLOAT |Low Warning Threshold value of tx Bias Current in mA. + ======================================================================== + """ + transceiver_dom_threshold_info_dict_keys = ['temphighalarm', 'temphighwarning', 'templowalarm', 'templowwarning', + 'vcchighalarm', 'vcchighwarning', 'vcclowalarm', 'vcclowwarning', + 'rxpowerhighalarm', 'rxpowerhighwarning', 'rxpowerlowalarm', 'rxpowerlowwarning', + 'txpowerhighalarm', 'txpowerhighwarning', 'txpowerlowalarm', 'txpowerlowwarning', + 'txbiashighalarm', 'txbiashighwarning', 'txbiaslowalarm', 'txbiaslowwarning'] + + if self.sfp_type == QSFP_TYPE: + sfpd_obj = sff8436Dom() + if not self.get_presence() or not sfpd_obj: + return {} + DOM_OFFSET = 0 + transceiver_dom_threshold_dict = dict.fromkeys(transceiver_dom_threshold_info_dict_keys, 'N/A') + offset = DOM_OFFSET + + dom_module_threshold_raw = self.__read_eeprom_specific_bytes((offset + QSFP_MODULE_THRESHOLD_OFFSET), QSFP_MODULE_THRESHOLD_WIDTH) + if dom_module_threshold_raw is not None: + module_threshold_values = sfpd_obj.parse_module_threshold_values(dom_module_threshold_raw, 0) + module_threshold_data = module_threshold_values.get('data') + if module_threshold_data: + transceiver_dom_threshold_dict['temphighalarm'] = module_threshold_data['TempHighAlarm']['value'] + transceiver_dom_threshold_dict['templowalarm'] = module_threshold_data['TempLowAlarm']['value'] + transceiver_dom_threshold_dict['temphighwarning'] = module_threshold_data['TempHighWarning']['value'] + transceiver_dom_threshold_dict['templowwarning'] = module_threshold_data['TempLowWarning']['value'] + transceiver_dom_threshold_dict['vcchighalarm'] = module_threshold_data['VccHighAlarm']['value'] + transceiver_dom_threshold_dict['vcclowalarm'] = module_threshold_data['VccLowAlarm']['value'] + transceiver_dom_threshold_dict['vcchighwarning'] = module_threshold_data['VccHighWarning']['value'] + transceiver_dom_threshold_dict['vcclowwarning'] = module_threshold_data['VccLowWarning']['value'] + + dom_channel_thres_raw = self.__read_eeprom_specific_bytes((offset + QSFP_CHANNEL_THRESHOLD_OFFSET), QSFP_CHANNEL_THRESHOLD_WIDTH) + if dom_channel_thres_raw is not None: + channel_threshold_values = sfpd_obj.parse_channel_threshold_values(dom_channel_thres_raw, 0) + channel_threshold_data = channel_threshold_values.get('data') + else: + channel_threshold_data = None + if channel_threshold_data: + transceiver_dom_threshold_dict['rxpowerhighalarm'] = channel_threshold_data['RxPowerHighAlarm']['value'] + transceiver_dom_threshold_dict['rxpowerlowalarm'] = channel_threshold_data['RxPowerLowAlarm']['value'] + transceiver_dom_threshold_dict['rxpowerhighwarning'] = channel_threshold_data['RxPowerHighWarning']['value'] + transceiver_dom_threshold_dict['rxpowerlowwarning'] = channel_threshold_data['RxPowerLowWarning']['value'] + transceiver_dom_threshold_dict['txpowerhighalarm'] = "0.0dBm" + transceiver_dom_threshold_dict['txpowerlowalarm'] = "0.0dBm" + transceiver_dom_threshold_dict['txpowerhighwarning'] = "0.0dBm" + transceiver_dom_threshold_dict['txpowerlowwarning'] = "0.0dBm" + transceiver_dom_threshold_dict['txbiashighalarm'] = channel_threshold_data['TxBiasHighAlarm']['value'] + transceiver_dom_threshold_dict['txbiaslowalarm'] = channel_threshold_data['TxBiasLowAlarm']['value'] + transceiver_dom_threshold_dict['txbiashighwarning'] = channel_threshold_data['TxBiasHighWarning']['value'] + transceiver_dom_threshold_dict['txbiaslowwarning'] = channel_threshold_data['TxBiasLowWarning']['value'] + + for key in transceiver_dom_threshold_dict: + transceiver_dom_threshold_dict[key] = self.__convert_string_to_num(transceiver_dom_threshold_dict[key]) + + return transceiver_dom_threshold_dict + + elif self.sfp_type == SFP_TYPE: + sfpd_obj = sff8472Dom() + + if not self.get_presence() and not sfpd_obj: + return {} + DOM_OFFSET = 256 + eeprom_ifraw = self.__read_eeprom_specific_bytes(0, DOM_OFFSET) + if eeprom_ifraw is not None: + sfpi_obj = sff8472InterfaceId(eeprom_ifraw) + cal_type = sfpi_obj.get_calibration_type() + sfpd_obj._calibration_type = cal_type + + offset = DOM_OFFSET + transceiver_dom_threshold_info_dict = dict.fromkeys(transceiver_dom_threshold_info_dict_keys, 'N/A') + dom_module_threshold_raw = self.__read_eeprom_specific_bytes((offset + SFP_MODULE_THRESHOLD_OFFSET), SFP_MODULE_THRESHOLD_WIDTH) + if dom_module_threshold_raw is not None: + dom_module_threshold_data = sfpd_obj.parse_alarm_warning_threshold(dom_module_threshold_raw, 0) + + transceiver_dom_threshold_info_dict['temphighalarm'] = dom_module_threshold_data['data']['TempHighAlarm']['value'] + transceiver_dom_threshold_info_dict['templowalarm'] = dom_module_threshold_data['data']['TempLowAlarm']['value'] + transceiver_dom_threshold_info_dict['temphighwarning'] = dom_module_threshold_data['data']['TempHighWarning']['value'] + transceiver_dom_threshold_info_dict['templowwarning'] = dom_module_threshold_data['data']['TempLowWarning']['value'] + + transceiver_dom_threshold_info_dict['vcchighalarm'] = dom_module_threshold_data['data']['VoltageHighAlarm']['value'] + transceiver_dom_threshold_info_dict['vcclowalarm'] = dom_module_threshold_data['data']['VoltageLowAlarm']['value'] + transceiver_dom_threshold_info_dict['vcchighwarning'] = dom_module_threshold_data['data']['VoltageHighWarning']['value'] + transceiver_dom_threshold_info_dict['vcclowwarning'] = dom_module_threshold_data['data']['VoltageLowWarning']['value'] + + transceiver_dom_threshold_info_dict['txbiashighalarm'] = dom_module_threshold_data['data']['BiasHighAlarm']['value'] + transceiver_dom_threshold_info_dict['txbiaslowalarm'] = dom_module_threshold_data['data']['BiasLowAlarm']['value'] + transceiver_dom_threshold_info_dict['txbiashighwarning'] = dom_module_threshold_data['data']['BiasHighWarning']['value'] + transceiver_dom_threshold_info_dict['txbiaslowwarning'] = dom_module_threshold_data['data']['BiasLowWarning']['value'] + + transceiver_dom_threshold_info_dict['txpowerhighalarm'] = dom_module_threshold_data['data']['TXPowerHighAlarm']['value'] + transceiver_dom_threshold_info_dict['txpowerlowalarm'] = dom_module_threshold_data['data']['TXPowerLowAlarm']['value'] + transceiver_dom_threshold_info_dict['txpowerhighwarning'] = dom_module_threshold_data['data']['TXPowerHighWarning']['value'] + transceiver_dom_threshold_info_dict['txpowerlowwarning'] = dom_module_threshold_data['data']['TXPowerLowWarning']['value'] + + transceiver_dom_threshold_info_dict['rxpowerhighalarm'] = dom_module_threshold_data['data']['RXPowerHighAlarm']['value'] + transceiver_dom_threshold_info_dict['rxpowerlowalarm'] = dom_module_threshold_data['data']['RXPowerLowAlarm']['value'] + transceiver_dom_threshold_info_dict['rxpowerhighwarning'] = dom_module_threshold_data['data']['RXPowerHighWarning']['value'] + transceiver_dom_threshold_info_dict['rxpowerlowwarning'] = dom_module_threshold_data['data']['RXPowerLowWarning']['value'] + + for key in transceiver_dom_threshold_info_dict: + transceiver_dom_threshold_info_dict[key] = self.__convert_string_to_num(transceiver_dom_threshold_info_dict[key]) + + return transceiver_dom_threshold_info_dict + + else: + return None + + def get_reset_status(self): + """ + Retrieves the reset status of SFP + Returns: + A Boolean, True if reset enabled, False if disabled + """ + # SFP doesn't support this feature + if self.sfp_type == SFP_TYPE: + return False + elif self.sfp_type == QSFP_TYPE: + try: + reg_file = open(self.reset_path) + except IOError as e: + print("Error: unable to open file: %s" % str(e)) + return None + reg_value = int(reg_file.readline().rstrip()) + reg_file.close() + if reg_value == 0: + return True + else: + return False + else: + return None + + def get_rx_los(self): + """ + Retrieves the RX LOS (lost-of-signal) status of SFP + Returns: + A Boolean, True if SFP has RX LOS, False if not. + Note : RX LOS status is latched until a call to get_rx_los or a reset. + """ + if not self.dom_supported: + return None + + rx_los_list = [] + + if self.sfp_type == QSFP_TYPE: + offset = 0 + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_CHANNL_RX_LOS_STATUS_OFFSET), QSFP_CHANNL_RX_LOS_STATUS_WIDTH) + if dom_channel_monitor_raw is not None: + rx_los_data = int(dom_channel_monitor_raw[0], 16) + rx_los_list.append(rx_los_data & 0x01 != 0) + rx_los_list.append(rx_los_data & 0x02 != 0) + rx_los_list.append(rx_los_data & 0x04 != 0) + rx_los_list.append(rx_los_data & 0x08 != 0) + elif self.sfp_type == SFP_TYPE: + offset = 256 + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_STATUS_CONTROL_OFFSET), SFP_STATUS_CONTROL_WIDTH) + if dom_channel_monitor_raw is not None: + rx_los_data = int(dom_channel_monitor_raw[0], 16) + rx_los_list.append(rx_los_data & 0x02 != 0) + else: + return None + else: + return None + + return rx_los_list + + def get_tx_fault(self): + """ + Retrieves the TX fault status of SFP + Returns: + A Boolean, True if SFP has TX fault, False if not + Note : TX fault status is lached until a call to get_tx_fault or a reset. + """ + if not self.dom_supported: + return None + + tx_fault_list = [] + + if self.sfp_type == QSFP_TYPE: + offset = 0 + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_CHANNL_TX_FAULT_STATUS_OFFSET), QSFP_CHANNL_TX_FAULT_STATUS_WIDTH) + if dom_channel_monitor_raw is not None: + tx_fault_data = int(dom_channel_monitor_raw[0], 16) + tx_fault_list.append(tx_fault_data & 0x01 != 0) + tx_fault_list.append(tx_fault_data & 0x02 != 0) + tx_fault_list.append(tx_fault_data & 0x04 != 0) + tx_fault_list.append(tx_fault_data & 0x08 != 0) + elif self.sfp_type == SFP_TYPE: + offset = 256 + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_STATUS_CONTROL_OFFSET), SFP_STATUS_CONTROL_WIDTH) + if dom_channel_monitor_raw is not None: + tx_fault_data = int(dom_channel_monitor_raw[0], 16) + tx_fault_list.append(tx_fault_data & 0x04 != 0) + else: + return None + else: + return None + + return tx_fault_list + + def get_tx_disable(self): + """ + Retrieves the tx_disable status of this SFP + Returns: + A Boolean, True if tx_disable is enabled, False if disabled + """ + if not self.dom_supported: + return None + + tx_disable_list = [] + + if self.sfp_type == QSFP_TYPE: + offset = 0 + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_CHANNL_DISABLE_STATUS_OFFSET), QSFP_CHANNL_DISABLE_STATUS_WIDTH) + if dom_channel_monitor_raw is not None: + tx_disable_data = int(dom_channel_monitor_raw[0], 16) + tx_disable_list.append(tx_disable_data & 0x01 != 0) + tx_disable_list.append(tx_disable_data & 0x02 != 0) + tx_disable_list.append(tx_disable_data & 0x04 != 0) + tx_disable_list.append(tx_disable_data & 0x08 != 0) + elif self.sfp_type == SFP_TYPE: + offset = 256 + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_STATUS_CONTROL_OFFSET), SFP_STATUS_CONTROL_WIDTH) + if dom_channel_monitor_raw is not None: + tx_disable_data = int(dom_channel_monitor_raw[0], 16) + tx_disable_list.append(tx_disable_data & 0xC0 != 0) + else: + return None + else: + return None + + return tx_disable_list + + def get_tx_disable_channel(self): + """ + Retrieves the TX disabled channels in this SFP + Returns: + A hex of 4 bits (bit 0 to bit 3 as channel 0 to channel 3) to represent + TX channels which have been disabled in this SFP. + As an example, a returned value of 0x5 indicates that channel 0 + and channel 2 have been disabled. + """ + # SFP doesn't support this feature + if self.sfp_type == SFP_TYPE: + return 0 + elif self.sfp_type == QSFP_TYPE: + tx_disable_list = self.get_tx_disable() + if tx_disable_list is None: + return 0 + tx_disabled = 0 + for i in range(len(tx_disable_list)): + if tx_disable_list[i]: + tx_disabled |= 1 << i + else: + return None + + return tx_disabled + + def get_lpmode(self): + """ + Retrieves the lpmode (low power mode) status of this QSFP module + Returns: + A Boolean, True if lpmode is enabled, False if disabled + """ + # SFP doesn't support this feature + if self.sfp_type == SFP_TYPE: + return False + elif self.sfp_type == QSFP_TYPE: + try: + reg_file = open(self.lpmode_path) + except IOError as e: + print("Error: unable to open file: %s" % str(e)) + return False + reg_value = int(reg_file.readline().rstrip()) + reg_file.close() + if reg_value == 0: + return False + else: + return True + else: + return None + + def get_power_override(self): + """ + Retrieves the power-override status of this SFP + Returns: + A Boolean, True if power-override is enabled, False if disabled + """ + # SFP doesn't support this feature + if self.sfp_type == SFP_TYPE: + return False + elif self.sfp_type == QSFP_TYPE: + offset = 0 + sfpd_obj = sff8436Dom() + if sfpd_obj is None: + return False + + dom_control_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_POWEROVERRIDE_OFFSET), QSFP_POWEROVERRIDE_WIDTH) + if dom_control_raw is not None: + if int(dom_control_raw[0],16) & (0x01 << QSFP_POWEROVERRIDE_BIT): + return True + else: + return False + else: + return None + + def get_temperature(self): + """ + Retrieves the temperature of this SFP + Returns: + An integer number of current temperature in Celsius + """ + if not self.dom_supported: + return None + if self.sfp_type == QSFP_TYPE: + offset = 0 + + sfpd_obj = sff8436Dom() + if sfpd_obj is None: + return None + + if self.dom_temp_supported: + dom_temperature_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_TEMPE_OFFSET), QSFP_TEMPE_WIDTH) + if dom_temperature_raw is not None: + dom_temperature_data = sfpd_obj.parse_temperature(dom_temperature_raw, 0) + temp = self._convert_string_to_num( + dom_temperature_data['data']['Temperature']['value']) + return temp + else: + return None + elif self.sfp_type == SFP_TYPE: + offset = 256 + sfpd_obj = sff8472Dom() + if sfpd_obj is None: + return None + sfpd_obj._calibration_type = 1 + + dom_temperature_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_TEMPE_OFFSET), SFP_TEMPE_WIDTH) + if dom_temperature_raw is not None: + dom_temperature_data = sfpd_obj.parse_temperature(dom_temperature_raw, 0) + temp = self._convert_string_to_num( + dom_temperature_data['data']['Temperature']['value']) + return temp + else: + return None + else: + return None + + def get_voltage(self): + """ + Retrieves the supply voltage of this SFP + Returns: + An integer number of supply voltage in mV + """ + if not self.dom_supported: + return None + if self.sfp_type == QSFP_TYPE: + offset = 0 + + sfpd_obj = sff8436Dom() + if sfpd_obj is None: + return None + + if self.dom_volt_supported: + dom_voltage_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_VOLT_OFFSET), QSFP_VOLT_WIDTH) + if dom_voltage_raw is not None: + dom_voltage_data = sfpd_obj.parse_voltage(dom_voltage_raw, 0) + voltage = self._convert_string_to_num( + dom_voltage_data['data']['Vcc']['value']) + return voltage + else: + return None + elif self.sfp_type == SFP_TYPE: + offset = 256 + + sfpd_obj = sff8472Dom() + if sfpd_obj is None: + return None + + sfpd_obj._calibration_type = self.calibration + + dom_voltage_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_VOLT_OFFSET), SFP_VOLT_WIDTH) + if dom_voltage_raw is not None: + dom_voltage_data = sfpd_obj.parse_voltage(dom_voltage_raw, 0) + voltage = self._convert_string_to_num( + dom_voltage_data['data']['Vcc']['value']) + return voltage + else: + return None + else: + return None + + def get_tx_bias(self): + """ + Retrieves the TX bias current of this SFP + Returns: + A list of four integer numbers, representing TX bias in mA + for channel 0 to channel 4. + Ex. ['110.09', '111.12', '108.21', '112.09'] + """ + tx_bias_list = [] + if self.sfp_type == QSFP_TYPE: + offset = 0 + + sfpd_obj = sff8436Dom() + if sfpd_obj is None: + return None + + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_CHANNL_MON_OFFSET), QSFP_CHANNL_MON_WITH_TX_POWER_WIDTH) + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = \ + sfpd_obj.parse_channel_monitor_params_with_tx_power(dom_channel_monitor_raw, 0) + tx_bias_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TX1Bias']['value'])) + tx_bias_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TX2Bias']['value'])) + tx_bias_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TX3Bias']['value'])) + tx_bias_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TX4Bias']['value'])) + elif self.sfp_type == SFP_TYPE: + offset = 256 + + sfpd_obj = sff8472Dom() + if sfpd_obj is None: + return None + sfpd_obj._calibration_type = self.calibration + + if self.dom_supported: + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_CHANNL_MON_OFFSET), SFP_CHANNL_MON_WIDTH) + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = sfpd_obj.parse_channel_monitor_params( \ + dom_channel_monitor_raw, 0) + tx_bias_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TXBias']['value'])) + else: + return None + else: + return None + else: + return None + + return tx_bias_list + + def get_rx_power(self): + """ + Retrieves the received optical power for this SFP + Returns: + A list of four integer numbers, representing received optical + power in mW for channel 0 to channel 4. + Ex. ['1.77', '1.71', '1.68', '1.70'] + """ + rx_power_list = [] + + if self.sfp_type == QSFP_TYPE: + offset = 0 + + sfpd_obj = sff8436Dom() + if sfpd_obj is None: + return None + + if self.dom_rx_power_supported: + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_CHANNL_MON_OFFSET), QSFP_CHANNL_MON_WITH_TX_POWER_WIDTH) + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = \ + sfpd_obj.parse_channel_monitor_params_with_tx_power(dom_channel_monitor_raw, 0) + rx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['RX1Power']['value'])) + rx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['RX2Power']['value'])) + rx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['RX3Power']['value'])) + rx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['RX4Power']['value'])) + else: + return None + else: + return None + elif self.sfp_type == SFP_TYPE: + offset = 256 + + sfpd_obj = sff8472Dom() + if sfpd_obj is None: + return None + + if self.dom_supported: + sfpd_obj._calibration_type = self.calibration + + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_CHANNL_MON_OFFSET), SFP_CHANNL_MON_WIDTH) + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = \ + sfpd_obj.parse_channel_monitor_params(dom_channel_monitor_raw, 0) + rx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['RXPower']['value'])) + else: + return None + else: + return None + else: + return None + + return rx_power_list + + def get_tx_power(self): + """ + Retrieves the TX power of this SFP + Returns: + A list of four integer numbers, representing TX power in mW + for channel 0 to channel 4. + Ex. ['1.86', '1.86', '1.86', '1.86'] + """ + tx_power_list = [] + + if self.sfp_type == QSFP_TYPE: + offset = 0 + + sfpd_obj = sff8436Dom() + if sfpd_obj is None: + return None + + if self.dom_tx_power_supported: + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_CHANNL_MON_OFFSET), QSFP_CHANNL_MON_WITH_TX_POWER_WIDTH) + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = \ + sfpd_obj.parse_channel_monitor_params_with_tx_power(dom_channel_monitor_raw, 0) + tx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TX1Power']['value'])) + tx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TX2Power']['value'])) + tx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TX3Power']['value'])) + tx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TX4Power']['value'])) + else: + return None + else: + return None + elif self.sfp_type == SFP_TYPE: + offset = 256 + sfpd_obj = sff8472Dom() + if sfpd_obj is None: + return None + + if self.dom_supported: + sfpd_obj._calibration_type = self.calibration + + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_CHANNL_MON_OFFSET), SFP_CHANNL_MON_WIDTH) + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = \ + sfpd_obj.parse_channel_monitor_params(dom_channel_monitor_raw, 0) + tx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TXPower']['value'])) + else: + return None + else: + return None + else: + return None + + return tx_power_list + + def reset(self): + """ + Reset SFP and return all user module settings to their default state. + Returns: + A boolean, True if successful, False if not + """ + if not self.get_presence(): + return False + + # SFP doesn't support this feature + if self.sfp_type == SFP_TYPE: + return False + elif self.sfp_type == QSFP_TYPE: + try: + reg_file = open(self.reset_path, "r+") + except IOError as e: + print("Error: unable to open file: %s" % str(e)) + return False + + reg_value = 0 + reg_file.write(hex(reg_value)) + reg_file.close() + + # Sleep 2 second to allow it to settle + time.sleep(2) + + # Flip the value back write back to the register to take port out of reset + try: + reg_file = open("/sys/class/cpld-qsfp28/port-"+str(self.port_num)+"/reset", "r+") + except IOError as e: + print("Error: unable to open file: %s" % str(e)) + return False + + reg_value = 1 + reg_file.write(hex(reg_value)) + reg_file.close() + else: + return None + + return True + + def tx_disable(self, tx_disable): + """ + Disable SFP TX for all channels + Args: + tx_disable : A Boolean, True to enable tx_disable mode, False to disable + tx_disable mode. + Returns: + A boolean, True if tx_disable is set successfully, False if not + """ + if not self.get_presence(): + return False + + if self.sfp_type == SFP_TYPE: + if self.dom_tx_disable_supported: + offset = 256 + sysfs_sfp_i2c_client_eeprom_path = self.port_to_eeprom_mapping[self.port_num] + status_control_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_STATUS_CONTROL_OFFSET), SFP_STATUS_CONTROL_WIDTH) + if status_control_raw is not None: + # Set bit 6 for Soft TX Disable Select + # 01000000 = 64 and 10111111 = 191 + tx_disable_bit = 64 if tx_disable else 191 + status_control = int(status_control_raw[0], 16) + tx_disable_ctl = (status_control | tx_disable_bit) if tx_disable else ( + status_control & tx_disable_bit) + try: + sysfsfile_eeprom = open( + sysfs_sfp_i2c_client_eeprom_path, mode="r+b", buffering=0) + buffer = create_string_buffer(1) + buffer[0] = chr(tx_disable_ctl) + # Write to eeprom + sysfsfile_eeprom.seek(offset + SFP_STATUS_CONTROL_OFFSET) + sysfsfile_eeprom.write(buffer[0]) + except IOError as e: + print("Error: unable to open file: %s" % str(e)) + return False + finally: + if sysfsfile_eeprom: + sysfsfile_eeprom.close() + time.sleep(0.01) + return True + return False + else: + return False + elif self.sfp_type == QSFP_TYPE: + if self.dom_tx_disable_supported: + channel_mask = 0x0f + if tx_disable: + return self.tx_disable_channel(channel_mask, True) + else: + return self.tx_disable_channel(channel_mask, False) + else: + return False + else: + return None + + def tx_disable_channel(self, channel, disable): + """ + Sets the tx_disable for specified SFP channels + Args: + channel : A hex of 4 bits (bit 0 to bit 3) which represent channel 0 to 3, + e.g. 0x5 for channel 0 and channel 2. + disable : A boolean, True to disable TX channels specified in channel, + False to enable + Returns: + A boolean, True if successful, False if not + """ + if not self.get_presence(): + return False + # SFP doesn't support this feature + if self.sfp_type == SFP_TYPE: + return False + elif self.sfp_type == QSFP_TYPE: + if self.dom_tx_disable_supported: + sysfsfile_eeprom = None + try: + channel_state = self.get_tx_disable_channel() + if disable: + tx_disable_ctl = channel_state | channel + else: + tx_disable_ctl = channel_state & (~channel) + buffer = create_string_buffer(1) + buffer[0] = chr(tx_disable_ctl) + # Write to eeprom + sysfsfile_eeprom = open( + self.port_to_eeprom_mapping[self.port_num], "r+b") + sysfsfile_eeprom.seek(QSFP_CONTROL_OFFSET) + sysfsfile_eeprom.write(buffer[0]) + except IOError as e: + print("Error: unable to open file: %s" % str(e)) + return False + finally: + if sysfsfile_eeprom is not None: + sysfsfile_eeprom.close() + time.sleep(0.01) + return True + else: + return False + else: + return None + + def set_lpmode(self, lpmode): + """ + Sets the lpmode (low power mode) of SFP + Args: + lpmode: A Boolean, True to enable lpmode, False to disable it + Note : lpmode can be overridden by set_power_override + Returns: + A boolean, True if lpmode is set successfully, False if not + """ + if not self.get_presence(): + return False + # SFP doesn't support this feature + if self.sfp_type == SFP_TYPE: + return False + elif self.sfp_type == QSFP_TYPE: + try: + reg_file = open(self.lpmode_path, "r+") + except IOError as e: + print("Error: unable to open file: %s" % str(e)) + return False + + # LPMode is active high; set or clear the bit accordingly + if lpmode: + reg_value = 1 + else: + reg_value = 0 + + reg_file.write(hex(reg_value)) + reg_file.close() + else: + return None + + return True + + def set_power_override(self, power_override, power_set): + """ + Sets SFP power level using power_override and power_set + Args: + power_override : + A Boolean, True to override set_lpmode and use power_set + to control SFP power, False to disable SFP power control + through power_override/power_set and use set_lpmode + to control SFP power. + power_set : + Only valid when power_override is True. + A Boolean, True to set SFP to low power mode, False to set + SFP to high power mode. + Returns: + A boolean, True if power-override and power_set are set successfully, + False if not + """ + # SFP doesn't support this feature + if not self.get_presence(): + return False + + if self.sfp_type == SFP_TYPE: + return False + elif self.sfp_type == QSFP_TYPE: + try: + power_override_bit = 0 + if power_override: + power_override_bit |= 1 << 0 + + power_set_bit = 0 + if power_set: + power_set_bit |= 1 << 1 + + buffer = create_string_buffer(1) + buffer[0] = chr(power_override_bit | power_set_bit) + # Write to eeprom + sysfsfile_eeprom = open(self.port_to_eeprom_mapping[self.port_num], "r+b") + sysfsfile_eeprom.seek(QSFP_POWEROVERRIDE_OFFSET) + sysfsfile_eeprom.write(buffer[0]) + except IOError as e: + print("Error: unable to open file: %s" % str(e)) + return False + finally: + if sysfsfile_eeprom is not None: + sysfsfile_eeprom.close() + time.sleep(0.01) + else: + return None + + return True + + def get_name(self): + """ + Retrieves the name of the device + Returns: + string: The name of the device + """ + sfputil_helper = SfpUtilHelper() + sfputil_helper.read_porttab_mappings(self.__get_path_to_port_config_file()) + print("self.index{}".format(self.index)) + name = sfputil_helper.logical[self.index-1] or "Unknown" + return name + diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix7-32x/sonic_platform/thermal.py b/platform/broadcom/sonic-platform-modules-quanta/ix7-32x/sonic_platform/thermal.py new file mode 100644 index 000000000000..bf5757c9fa22 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix7-32x/sonic_platform/thermal.py @@ -0,0 +1,154 @@ +#!/usr/bin/env python + +############################################################################# +# Quanta +# +# Module contains an implementation of SONiC Platform Base API and +# provides the Thermal information +# +############################################################################# + +import logging +import os + +try: + from sonic_platform_base.thermal_base import ThermalBase +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +HWMON_DIR = "/sys/class/hwmon/hwmon1/" + +thermal_index_mapping = { + 1:43, + 2:44, + 3:45, + 4:53, + 5:54, + 6:55, + 7:68, + 8:69, + 9:70, + 10:71, + 11:72, + 12:73, + 13:74, + 14:75, + 15:76 +} + +class Thermal(ThermalBase): + """Platform-specific Thermal class""" + + def __init__(self, thermal_index): + self.index = thermal_index + self.temp_attr = "temp{}_input".format(thermal_index_mapping[self.index]) + self.high_th_attr = "temp{}_ncrit".format(thermal_index_mapping[self.index]) + self.high_crit_th_attr = "temp{}_crit".format(thermal_index_mapping[self.index]) + self.name_attr = "temp{}_label".format(thermal_index_mapping[self.index]) + + + def __get_attr_value(self, attr_path): + + retval = 'ERR' + if (not os.path.isfile(attr_path)): + return retval + + try: + with open(attr_path, 'r') as fd: + retval = fd.read() + except Exception as error: + logging.error("Unable to open ", attr_path, " file !") + + retval = retval.rstrip(' \t\n\r') + return retval + + def get_name(self): + """ + Retrieves the name of the device + + Returns: + string: The name of the device + """ + attr_path = HWMON_DIR + self.name_attr + attr_rv = self.__get_attr_value(attr_path) + + if (attr_rv != 'ERR'): + return attr_rv + else: + return None + + def get_presence(self): + """ + Retrieves the presence of the device + + Returns: + bool: True if device is present, False if not + """ + attr_path = HWMON_DIR + self.name_attr + attr_rv = self.__get_attr_value(attr_path) + + if (attr_rv != 'ERR'): + return True + else: + return False + + def get_status(self): + """ + Retrieves the operational status of the device + + Returns: + A boolean value, True if device is operating properly, False if not + """ + if (self.get_temperature() != None): + return True + else: + return False + + def get_temperature(self): + """ + Retrieves current temperature reading from thermal + + Returns: + A float number of current temperature in Celsius up to nearest thousandth + of one degree Celsius, e.g. 30.125 + """ + attr_path = HWMON_DIR + self.temp_attr + attr_rv = self.__get_attr_value(attr_path) + + if (attr_rv != 'ERR'): + return float(attr_rv) / 1000 + else: + return None + + def get_high_threshold(self): + """ + Retrieves the high threshold temperature of thermal + + Returns: + A float number, the high threshold temperature of thermal in Celsius + up to nearest thousandth of one degree Celsius, e.g. 30.125 + """ + attr_path = HWMON_DIR + self.high_th_attr + attr_rv = self.__get_attr_value(attr_path) + + if (attr_rv != 'ERR'): + return float(attr_rv) / 1000 + else: + return None + + def get_high_critical_threshold(self): + """ + Retrieves the high threshold temperature of thermal + + Returns: + A float number, the high threshold temperature of thermal in Celsius + up to nearest thousandth of one degree Celsius, e.g. 30.125 + """ + attr_path = HWMON_DIR + self.high_crit_th_attr + attr_rv = self.__get_attr_value(attr_path) + + if (attr_rv != 'ERR'): + return float(attr_rv) / 1000 + else: + return None + diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix7-32x/sonic_platform/watchdog.py b/platform/broadcom/sonic-platform-modules-quanta/ix7-32x/sonic_platform/watchdog.py new file mode 100644 index 000000000000..282f356f4e73 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix7-32x/sonic_platform/watchdog.py @@ -0,0 +1,234 @@ +#!/usr/bin/env python + +############################################################################# +# +# Watchdog contains an implementation of SONiC Platform Base Watchdog API +# +############################################################################# +import fcntl +import os +import array + +try: + from sonic_platform_base.watchdog_base import WatchdogBase +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +""" ioctl constants """ +IO_WRITE = 0x40000000 +IO_READ = 0x80000000 +IO_READ_WRITE = 0xC0000000 +IO_SIZE_INT = 0x00040000 +IO_SIZE_40 = 0x00280000 +IO_TYPE_WATCHDOG = ord('W') << 8 + +WDR_INT = IO_READ | IO_SIZE_INT | IO_TYPE_WATCHDOG +WDR_40 = IO_READ | IO_SIZE_40 | IO_TYPE_WATCHDOG +WDWR_INT = IO_READ_WRITE | IO_SIZE_INT | IO_TYPE_WATCHDOG + +""" Watchdog ioctl commands """ +WDIOC_GETSUPPORT = 0 | WDR_40 +WDIOC_GETSTATUS = 1 | WDR_INT +WDIOC_GETBOOTSTATUS = 2 | WDR_INT +WDIOC_GETTEMP = 3 | WDR_INT +WDIOC_SETOPTIONS = 4 | WDR_INT +WDIOC_KEEPALIVE = 5 | WDR_INT +WDIOC_SETTIMEOUT = 6 | WDWR_INT +WDIOC_GETTIMEOUT = 7 | WDR_INT +WDIOC_SETPRETIMEOUT = 8 | WDWR_INT +WDIOC_GETPRETIMEOUT = 9 | WDR_INT +WDIOC_GETTIMELEFT = 10 | WDR_INT + +""" Watchdog status constants """ +WDIOS_DISABLECARD = 0x0001 +WDIOS_ENABLECARD = 0x0002 + +WDT_COMMON_ERROR = -1 +WD_MAIN_IDENTITY = "iTCO_wdt" +WDT_SYSFS_PATH = "/sys/class/watchdog/" + +DEFAULT_TIMEOUT=180 + +class Watchdog(WatchdogBase): + + def __init__(self): + + self.watchdog, self.wdt_main_dev_name = self._get_wdt() + self.status_path = "/sys/class/watchdog/%s/status" % self.wdt_main_dev_name + self.state_path = "/sys/class/watchdog/%s/state" % self.wdt_main_dev_name + self.timeout_path = "/sys/class/watchdog/%s/timeout" % self.wdt_main_dev_name + # Set default value + self._disable() + self.armed = False + self.timeout = DEFAULT_TIMEOUT + + def _is_wd_main(self, dev): + """ + Checks watchdog identity + """ + identity = self._read_file( + "{}/{}/identity".format(WDT_SYSFS_PATH, dev)) + return identity == WD_MAIN_IDENTITY + + def _get_wdt(self): + """ + Retrieves watchdog device + """ + wdt_main_dev_list = [dev for dev in os.listdir( + "/dev/") if dev.startswith("watchdog") and self._is_wd_main(dev)] + if not wdt_main_dev_list: + return None + wdt_main_dev_name = wdt_main_dev_list[0] + watchdog_device_path = "/dev/{}".format(wdt_main_dev_name) + self.watchdog = os.open(watchdog_device_path, os.O_RDWR) + return self.watchdog, wdt_main_dev_name + + def _read_file(self, file_path): + """ + Read text file + """ + try: + with open(file_path, "r") as fd: + txt = fd.read() + except IOError: + return WDT_COMMON_ERROR + return txt.strip() + + def _enable(self): + """ + Turn on the watchdog timer + """ + req = array.array('h', [WDIOS_ENABLECARD]) + fcntl.ioctl(self.watchdog, WDIOC_SETOPTIONS, req, False) + + def _disable(self): + """ + Turn off the watchdog timer + """ + req = array.array('h', [WDIOS_DISABLECARD]) + fcntl.ioctl(self.watchdog, WDIOC_SETOPTIONS, req, False) + + def _keepalive(self): + """ + Keep alive watchdog timer + """ + fcntl.ioctl(self.watchdog, WDIOC_KEEPALIVE) + + def _settimeout(self, seconds): + """ + Set watchdog timer timeout + @param seconds - timeout in seconds + @return is the actual set timeout + """ + req = array.array('I', [seconds]) + fcntl.ioctl(self.watchdog, WDIOC_SETTIMEOUT, req, True) + return int(req[0]) + + def _gettimeout(self, timeout_path): + """ + Get watchdog timeout + @return watchdog timeout + """ + req = array.array('I', [0]) + fcntl.ioctl(self.watchdog, WDIOC_GETTIMEOUT, req, True) + + return int(req[0]) + + def _gettimeleft(self): + """ + Get time left before watchdog timer expires + @return time left in seconds + """ + req = array.array('I', [0]) + fcntl.ioctl(self.watchdog, WDIOC_GETTIMELEFT, req, True) + + return int(req[0]) + + ################################################################# + + def arm(self, seconds): + """ + Arm the hardware watchdog with a timeout of seconds. + If the watchdog is currently armed, calling this function will + simply reset the timer to the provided value. If the underlying + hardware does not support the value provided in , this + method should arm the watchdog with the *next greater* available + value. + Returns: + An integer specifying the *actual* number of seconds the watchdog + was armed with. On failure returns -1. + """ + + ret = WDT_COMMON_ERROR + if seconds < 0: + return ret + + try: + if self.timeout != seconds: + self.timeout = self._settimeout(seconds) + if self.armed: + self._keepalive() + else: + self._settimeout(seconds) + self._enable() + self.armed = True + ret = self.timeout + except IOError as e: + pass + + return ret + + def disarm(self): + """ + Disarm the hardware watchdog + Returns: + A boolean, True if watchdog is disarmed successfully, False if not + """ + disarmed = False + if self.is_armed(): + try: + self._disable() + self.armed = False + disarmed = True + except IOError: + pass + + return disarmed + + def is_armed(self): + """ + Retrieves the armed state of the hardware watchdog. + Returns: + A boolean, True if watchdog is armed, False if not + """ + + return self.armed + + def get_remaining_time(self): + """ + If the watchdog is armed, retrieve the number of seconds remaining on + the watchdog timer + Returns: + An integer specifying the number of seconds remaining on thei + watchdog timer. If the watchdog is not armed, returns -1. + """ + + timeleft = WDT_COMMON_ERROR + + if self.armed: + try: + timeleft = self._gettimeleft() + except IOError: + pass + + return timeleft + + def __del__(self): + """ + Close watchdog + """ + + os.close(self.watchdog) + + + diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix7-32x/sonic_platform_setup.py b/platform/broadcom/sonic-platform-modules-quanta/ix7-32x/sonic_platform_setup.py new file mode 100644 index 000000000000..a4899c618337 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix7-32x/sonic_platform_setup.py @@ -0,0 +1,24 @@ +import os +from setuptools import setup +os.listdir + +setup( + name='sonic-platform', + version='1.0', + description='SONiC platform API implementation on Quanta Platforms', + license='Apache 2.0', + packages=['sonic_platform'], + classifiers=[ + 'Development Status :: 3 - Alpha', + 'Environment :: Plugins', + 'Intended Audience :: Developers', + 'Intended Audience :: Information Technology', + 'Intended Audience :: System Administrators', + 'License :: OSI Approved :: Apache Software License', + 'Natural Language :: English', + 'Operating System :: POSIX :: Linux', + 'Programming Language :: Python :: 3.7', + 'Topic :: Utilities', + ], + keywords='sonic SONiC platform PLATFORM', +) diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix7-32x/utils/quanta_ix7_util.py b/platform/broadcom/sonic-platform-modules-quanta/ix7-32x/utils/quanta_ix7_util.py old mode 100644 new mode 100755 index e583d2374a99..901f7ba1ae86 --- a/platform/broadcom/sonic-platform-modules-quanta/ix7-32x/utils/quanta_ix7_util.py +++ b/platform/broadcom/sonic-platform-modules-quanta/ix7-32x/utils/quanta_ix7_util.py @@ -21,19 +21,17 @@ options: -h | --help : this help message -d | --debug : run with debug mode - -f | --force : ignore error during installation or clean + -f | --force : ignore error during installation or clean command: install : install drivers and generate related sysfs nodes - clean : uninstall drivers and remove related sysfs nodes + clean : uninstall drivers and remove related sysfs nodes """ import os import commands import sys, getopt import logging -import re import time -from collections import namedtuple DEBUG = False args = [] @@ -43,77 +41,68 @@ if DEBUG == True: print sys.argv[0] - print 'ARGV :', sys.argv[1:] + print 'ARGV :', sys.argv[1:] def main(): global DEBUG global args global FORCE - + if len(sys.argv)<2: show_help() - + options, args = getopt.getopt(sys.argv[1:], 'hdf', ['help', 'debug', 'force', ]) - if DEBUG == True: + if DEBUG == True: print options print args print len(sys.argv) - + for opt, arg in options: if opt in ('-h', '--help'): show_help() - elif opt in ('-d', '--debug'): + elif opt in ('-d', '--debug'): DEBUG = True logging.basicConfig(level=logging.INFO) - elif opt in ('-f', '--force'): + elif opt in ('-f', '--force'): FORCE = 1 else: - logging.info('no option') - for arg in args: + logging.info('no option') + for arg in args: if arg == 'install': install() elif arg == 'clean': uninstall() else: show_help() - - - return 0 - + + + return 0 + def show_help(): print __doc__ % {'scriptName' : sys.argv[0].split("/")[-1]} sys.exit(0) - + def show_log(txt): if DEBUG == True: print "[IX7-32X]"+txt return - + def exec_cmd(cmd, show): - logging.info('Run :'+cmd) - status, output = commands.getstatusoutput(cmd) + logging.info('Run :'+cmd) + status, output = commands.getstatusoutput(cmd) show_log (cmd +"with result:" + str(status)) - show_log (" output:"+output) + show_log (" output:"+output) if status: logging.info('Failed :'+cmd) if show: print('Failed :'+cmd) return status, output - + instantiate =[ -#turn on module power -'echo 21 > /sys/class/gpio/export', -'echo out > /sys/class/gpio/gpio21/direction', -'echo 1 >/sys/class/gpio/gpio21/value', -#Reset fron-ports LED CPLD -'echo 73 > /sys/class/gpio/export', -'echo out > /sys/class/gpio/gpio73/direction', -'echo 0 >/sys/class/gpio/gpio73/value', -'echo 1 >/sys/class/gpio/gpio73/value', #Enable front-ports LED decoding 'echo 1 > /sys/class/cpld-led/CPLDLED-1/led_decode', 'echo 1 > /sys/class/cpld-led/CPLDLED-2/led_decode', @@ -130,27 +119,40 @@ def exec_cmd(cmd, show): 'lpc_ich', 'i2c-i801', 'i2c-dev', +'i2c-mux-pca954x force_deselect_on_exit=1', +'gpio-pca953x', +'optoe', +'qci_cpld', +'qci_cpld_led', +'quanta_platform_ix7', +'ipmi_devintf', +'quanta_hwmon_ipmi' +] + +un_drivers =[ +'lpc_ich', +'i2c-i801', +'i2c-dev', 'i2c-mux-pca954x', 'gpio-pca953x', 'optoe', 'qci_cpld', 'qci_cpld_led', 'quanta_platform_ix7', -'ipmi_devintf' +'ipmi_devintf', +'quanta_hwmon_ipmi' ] - - def system_install(): global FORCE #remove default drivers to avoid modprobe order conflicts - status, output = exec_cmd("echo 'blacklist i2c-ismt' > /etc/modprobe.d/blacklist.conf", 1) + exec_cmd("echo 'blacklist i2c-ismt' > /etc/modprobe.d/blacklist.conf", 1) time.sleep(1) - status, output = exec_cmd("modprobe -r i2c-ismt ", 1) - status, output = exec_cmd("modprobe -r i2c-i801 ", 1) + exec_cmd("modprobe -r i2c-ismt ", 1) + exec_cmd("modprobe -r i2c-i801 ", 1) #setup driver dependency - status, output = exec_cmd("depmod -a ", 1) + exec_cmd("depmod -a ", 1) #install drivers for i in range(0,len(drivers)): status, output = exec_cmd("modprobe "+drivers[i], 1) @@ -159,6 +161,18 @@ def system_install(): if FORCE == 0: return status + #turn on module power + exec_cmd("echo 21 > /sys/class/gpio/export ", 1) + exec_cmd("echo high > /sys/class/gpio/gpio21/direction ", 1) + + #Reset fron-ports LED CPLD + exec_cmd("echo 33 > /sys/class/gpio/export ", 1) + status, output = exec_cmd("cat /sys/class/gpio/gpio33/value", 1) + if output != '1': + exec_cmd("echo out > /sys/class/gpio/gpio33/direction ", 1) + exec_cmd("echo 0 >/sys/class/gpio/gpio33/value", 1) + exec_cmd("echo 1 >/sys/class/gpio/gpio33/value", 1) + #instantiate devices for i in range(0,len(instantiate)): status, output = exec_cmd(instantiate[i], 1) @@ -166,26 +180,32 @@ def system_install(): print output if FORCE == 0: return status - + #QSFP for 1~32 port for port_number in range(1,33): - bus_number = port_number + 31 + bus_number = port_number + 16 os.system("echo %d >/sys/bus/i2c/devices/%d-0050/port_name" % (port_number, bus_number)) - return - - + return + + def system_ready(): - if not device_found(): + if not device_found(): return False return True - -def install(): + +def install(): if not device_found(): - print "No device, installing...." - status = system_install() + print "No device, installing...." + status = system_install() + if status: + if FORCE == 0: + return status + + status, output = exec_cmd("pip3 install /usr/share/sonic/device/x86_64-quanta_ix7_rglbmc-r0/sonic_platform-1.0-py3-none-any.whl",1) if status: - if FORCE == 0: - return status + print output + if FORCE == 0: + return status else: print " ix7 driver already installed...." return @@ -193,17 +213,28 @@ def install(): def uninstall(): global FORCE #uninstall drivers - for i in range(len(drivers)-1,-1,-1): - status, output = exec_cmd("rmmod "+drivers[i], 1) + for i in range(len(un_drivers)-1,-1,-1): + status, output = exec_cmd("rmmod "+un_drivers[i], 1) if status: print output if FORCE == 0: return status + + status, output = exec_cmd("pip3 uninstall sonic-platform -y ",1) + if status: + print output + if FORCE == 0: + return status return def device_found(): - ret1, log = exec_cmd("ls "+i2c_prefix+"i2c-0", 0) - return ret1 + ret1, log1 = exec_cmd("cat /proc/modules | grep ix7 > /tmp/chkdriver.log", 0) + ret2, log2 = exec_cmd("cat /tmp/chkdriver.log | grep ix7", 0) + + if ret1 == 0 and len(log2) > 0: + return True + else: + return False if __name__ == "__main__": main() diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix7-bwde-32x/classes/__init__.py b/platform/broadcom/sonic-platform-modules-quanta/ix7-bwde-32x/classes/__init__.py new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix7-bwde-32x/modules/Makefile b/platform/broadcom/sonic-platform-modules-quanta/ix7-bwde-32x/modules/Makefile new file mode 100644 index 000000000000..160b2a28f1c1 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix7-bwde-32x/modules/Makefile @@ -0,0 +1,3 @@ +obj-m:=qci_cpld.o qci_cpld_led.o quanta_platform_ix7_bwde.o quanta_hwmon_ipmi.o + + diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix7-bwde-32x/modules/qci_cpld.c b/platform/broadcom/sonic-platform-modules-quanta/ix7-bwde-32x/modules/qci_cpld.c new file mode 100644 index 000000000000..1d2bf2023336 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix7-bwde-32x/modules/qci_cpld.c @@ -0,0 +1,463 @@ +/* + * A CPLD driver for monitor QSFP28 module I/O + * + * The CPLD is customize by Quanta for controlling QSFP28 module signals, + * they are RESET , INTERREPT , Module_Present, LPMODE + * Each CPLD control 16 modules, each module use 4 bits in register. + * + * Copyright (C) 2015 Quanta Inc. + * + * Author: Luffy Cheng + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static DEFINE_IDA(cpld_ida); + +enum platform_type { + SFP = 0, + QSFP, + QSFP28, + NONE +}; + +static struct class *cpld_class = NULL; + +struct sfp_data { + struct i2c_client *cpld_client; + char name[8]; + char type[8]; + u8 port_id; + u8 cpld_port; +}; + +struct cpld_data { + struct mutex lock; + struct device *port_dev[16]; + struct sfp_data *port_data[16]; +}; + +static int cpld_probe(struct i2c_client *client, + const struct i2c_device_id *id); +static int cpld_remove(struct i2c_client *client); + +static const struct i2c_device_id cpld_id[] = { + { "CPLD-SFP", SFP }, + { "CPLD-QSFP", QSFP }, + { "CPLD-QSFP28", QSFP28 }, + { } +}; +MODULE_DEVICE_TABLE(i2c, cpld_id); + +static struct i2c_driver cpld_driver = { + .class = I2C_CLASS_HWMON, + .driver = { + .name = "qci_cpld", + }, + .probe = cpld_probe, + .remove = cpld_remove, + .id_table = cpld_id, +// .address_list = normal_i2c, +}; + +#define CPLD_ID_PREFIX "port-" +#define CPLD_ID_FORMAT CPLD_ID_PREFIX "%d" + +#define RESET_MASK 0x08 +#define INTERRUPT_MASK 0x04 +#define MODULE_PRESENT_MASK 0x02 +#define LPMODE_MASK 0x01 +//#define I2C_MONITOR_MASK 0x01 + +static inline u8 get_group_cmd(u8 group) +{ + //FIXME: if group cmd change + return (group + 1); +} + +static inline u8 port_remapping(u8 phy_port) +{ + /* FIXME: implement by hardware design */ + /* The CPLD register port mapping is weird : + * MSB -------- LSB (word data) + * P3 P4 P1 P2 (per port 4 bits) + * For easy coding bit shift, we treat it as hw port swap + */ + return (phy_port % 2) ? (phy_port - 1) : (phy_port + 1); +} + +static ssize_t get_reset(struct device *dev, + struct device_attribute *devattr, + char *buf) +{ + struct sfp_data *data = dev_get_drvdata(dev); + struct i2c_client *client = data->cpld_client; + u8 group = (u8)(data->cpld_port / 4); + u8 group_port = data->cpld_port % 4; + s32 value; + + dev_dbg(&client->dev, "port_id %d => cpld_port %d, group %d(%d)\n", data->port_id, + data->cpld_port + 1, group + 1, group_port + 1); + + value = i2c_smbus_read_word_data(client, get_group_cmd(group)); + if (value < 0) + return -ENODEV; + + dev_dbg(&client->dev, "read group%d value= %x\n", group + 1, value); + + value >>= (group_port * 4); + value &= RESET_MASK; + + return sprintf(buf, "%d\n", value ? 1 : 0); +} + +static ssize_t get_interrupt(struct device *dev, + struct device_attribute *devattr, + char *buf) +{ + struct sfp_data *data = dev_get_drvdata(dev); + struct i2c_client *client = data->cpld_client; + u8 group = (u8)(data->cpld_port / 4); + u8 group_port = data->cpld_port % 4; + s32 value; + + dev_dbg(&client->dev, "port_id %d => cpld_port %d, group %d(%d)\n", data->port_id, + data->cpld_port + 1, group + 1, group_port + 1); + + value = i2c_smbus_read_word_data(client, get_group_cmd(group)); + if (value < 0) + return -ENODEV; + + dev_dbg(&client->dev, "read group%d value= %x\n", group + 1, value); + + value >>= (group_port * 4); + value &= INTERRUPT_MASK; + + return sprintf(buf, "%d\n", value ? 1 : 0); +} + +static ssize_t get_module_present(struct device *dev, + struct device_attribute *devattr, + char *buf) +{ + struct sfp_data *data = dev_get_drvdata(dev); + struct i2c_client *client = data->cpld_client; + u8 group = (u8)(data->cpld_port / 4); + u8 group_port = data->cpld_port % 4; + s32 value; + int retry = 0; + + dev_dbg(&client->dev, "port_id %d => cpld_port %d, group %d(%d)\n", data->port_id, + data->cpld_port + 1, group + 1, group_port + 1); + + for (retry = 0; retry < 10; retry++) + { + value = i2c_smbus_read_word_data(client, get_group_cmd(group)); + if (value >= 0) + break; + else + printk("%s: retry:%d\n", __FUNCTION__, retry); + msleep(1); + } + if (value < 0) + return -ENODEV; + + dev_dbg(&client->dev, "read group%d value= %x\n", group + 1, value); + + value >>= (group_port * 4); + value &= MODULE_PRESENT_MASK; + + //FIXME: if present is not low active + return sprintf(buf, "%d\n", value ? 0 : 1); +} + +static ssize_t get_lpmode(struct device *dev, + struct device_attribute *devattr, + char *buf) +{ + struct sfp_data *data = dev_get_drvdata(dev); + struct i2c_client *client = data->cpld_client; + u8 group = (u8)(data->cpld_port / 4); + u8 group_port = data->cpld_port % 4; + s32 value; + + dev_dbg(&client->dev, "port_id %d => cpld_port %d, group %d(%d)\n", data->port_id, + data->cpld_port + 1, group + 1, group_port + 1); + + value = i2c_smbus_read_word_data(client, get_group_cmd(group)); + if (value < 0) + return -ENODEV; + + dev_dbg(&client->dev, "read group%d value= %x\n", group + 1, value); + + value >>= (group_port * 4); + value &= LPMODE_MASK; + + return sprintf(buf, "%d\n", value ? 1 : 0); +} + +static ssize_t set_reset(struct device *dev, + struct device_attribute *devattr, + const char *buf, + size_t count) +{ + struct sfp_data *data = dev_get_drvdata(dev); + struct i2c_client *client = data->cpld_client; + u8 group = (u8)(data->cpld_port / 4); + u8 group_port = data->cpld_port % 4; + s32 value; + long disable; + + dev_dbg(&client->dev, "port_id %d => cpld_port %d, group %d(%d)\n", data->port_id, + data->cpld_port + 1, group + 1, group_port + 1); + + if (kstrtol(buf, 0, &disable)) + return -EINVAL; + + if ((disable != 1) && (disable != 0)) + return -EINVAL; + +// mutex_lock(&data->lock); + value = i2c_smbus_read_word_data(client, get_group_cmd(group)); + if (value < 0) + return -ENODEV; + + dev_dbg(&client->dev, "read group%d value= %x\n", group + 1, value); + + value &= ~(RESET_MASK << (group_port * 4)); + if (disable) + value |= (RESET_MASK << (group_port * 4)); + + dev_dbg(&client->dev, "write group%d value= %x\n", group + 1, value); + + i2c_smbus_write_word_data(client, get_group_cmd(group), (u16)value); +// mutex_unlock(&data->lock); + + return count; +} + +static ssize_t set_lpmode(struct device *dev, + struct device_attribute *devattr, + const char *buf, + size_t count) +{ + struct sfp_data *data = dev_get_drvdata(dev); + struct i2c_client *client = data->cpld_client; + u8 group = (u8)(data->cpld_port / 4); + u8 group_port = data->cpld_port % 4; + s32 value; + long disable; + + dev_dbg(&client->dev, "port_id %d => cpld_port %d, group %d(%d)\n", data->port_id, + data->cpld_port + 1, group + 1, group_port + 1); + + if (kstrtol(buf, 0, &disable)) + return -EINVAL; + + if ((disable != 1) && (disable != 0)) + return -EINVAL; + +// mutex_lock(&data->lock); + value = i2c_smbus_read_word_data(client, get_group_cmd(group)); + if (value < 0) + return -ENODEV; + + dev_dbg(&client->dev, "read group%d value= %x\n", group + 1, value); + + value &= ~(LPMODE_MASK << (group_port * 4)); + if (disable) + value |= (LPMODE_MASK << (group_port * 4)); + + dev_dbg(&client->dev, "write group%d value= %x\n", group + 1, value); + + i2c_smbus_write_word_data(client, get_group_cmd(group), (u16)value); +// mutex_unlock(&data->lock); + + return count; +} + +static DEVICE_ATTR(reset, S_IWUSR | S_IRUGO, get_reset, set_reset); +static DEVICE_ATTR(lpmode, S_IWUSR | S_IRUGO, get_lpmode, set_lpmode); +static DEVICE_ATTR(module_present, S_IRUGO, get_module_present, NULL); +static DEVICE_ATTR(interrupt, S_IRUGO, get_interrupt, NULL); +//static DEVICE_ATTR(led_enable, S_IWUSR | S_IRUGO, get_led_enable, set_led_enable); +//static DEVICE_ATTR(monitor_enable, S_IWUSR | S_IRUGO, get_monitor_enable, set_monitor_enable); + +static const struct attribute *sfp_attrs[] = { + &dev_attr_reset.attr, + &dev_attr_lpmode.attr, + &dev_attr_module_present.attr, + &dev_attr_interrupt.attr, +// &dev_attr_led_enable.attr, + NULL, +}; + +static const struct attribute_group sfp_attr_group = { + .attrs = (struct attribute **) sfp_attrs, +}; + +static int cpld_probe(struct i2c_client *client, + const struct i2c_device_id *id) +{ + struct cpld_data *data; + struct sfp_data *port_data; +// struct i2c_monitor_data *monitor_data; + struct device *port_dev; +// struct device *i2c_dev; + int port_nr, i=0, err, max_port_num; + char name[I2C_NAME_SIZE], type[I2C_NAME_SIZE]; + + printk("cpld cpld_probe\n"); + + while(id->name[i]) + { + name[i]=tolower(id->name[i]); + i++; + } + name[i]='\0'; + strncpy(type,name+5,strlen(name)-5); + type[strlen(name)-5]='\0'; + + if (!cpld_class) + { + cpld_class = class_create(THIS_MODULE, "cpld-qsfp28"); + if (IS_ERR(cpld_class)) { + pr_err("couldn't create sysfs class\n"); + return PTR_ERR(cpld_class); + } + } + + data = devm_kzalloc(&client->dev, sizeof(struct cpld_data), + GFP_KERNEL); + if (!data) + return -ENOMEM; + + if(!strcmp(client->name, "CPLD-QSFP28")){ + max_port_num = 16; + } + else{ + max_port_num = 4; + } + + /* register sfp port data to sysfs */ + for (i = 0; i < max_port_num; i++) + { + port_nr = ida_simple_get(&cpld_ida, 1, 99, GFP_KERNEL); + if (port_nr < 0) + goto err_out; + + port_data = kzalloc(sizeof(struct sfp_data), GFP_KERNEL); + + port_dev = device_create(cpld_class, &client->dev, MKDEV(0,0), port_data, CPLD_ID_FORMAT, port_nr); + if (IS_ERR(port_dev)) { + err = PTR_ERR(port_dev); + printk("err_status\n"); + } + + data->port_dev[i] = port_dev; + data->port_data[i] = port_data; + + strcpy(port_data->type, type); + + dev_info(&client->dev, "Register %s port-%d\n", port_data->type , port_nr); + + /* FIXME: implement Logical/Physical port remapping */ + //port_data->cpld_port = i; + port_data->cpld_port = port_remapping(i); + sprintf(port_data->name, "port-%d", port_nr); + port_data->port_id = port_nr; + dev_set_drvdata(port_dev, port_data); + port_dev->init_name = port_data->name; + port_data->cpld_client = client; + + err = sysfs_create_group(&port_dev->kobj, &sfp_attr_group); + // if (status) printk("err status\n"); + } + + i2c_set_clientdata(client, data); + mutex_init(&data->lock); + + dev_info(&client->dev, "%s device found\n", client->name); + + + return 0; + +err_out: + return port_nr; +} + +/* FIXME: for older kernel doesn't with idr_is_empty function, implement here */ +#if 0 +static int idr_has_entry(int id, void *p, void *data) +{ + return 1; +} + +static bool cpld_idr_is_empty(struct idr *idp) +{ + return !idr_for_each(idp, idr_has_entry, NULL); +} +#endif + +static int cpld_remove(struct i2c_client *client) +{ + struct cpld_data *data = i2c_get_clientdata(client); + int i, max_port_num; +// int id; + + if(!strcmp(client->name, "CPLD-QSFP28")){ + max_port_num = 16; + } + else{ + max_port_num = 4; + } + + for (i = (max_port_num - 1); i >= 0; i--) + { + dev_info(data->port_dev[i], "Remove %s port-%d\n", data->port_data[i]->type , data->port_data[i]->port_id); + device_unregister(data->port_dev[i]); + ida_simple_remove(&cpld_ida, data->port_data[i]->port_id); + kfree(data->port_data[i]); + } + + if (ida_is_empty(&cpld_ida)) + { + class_destroy(cpld_class); + cpld_class = NULL; + } + + return 0; +} + +module_i2c_driver(cpld_driver); + +MODULE_AUTHOR("Luffy Cheng "); +MODULE_DESCRIPTION("Quanta Switch QSFP28 CPLD driver"); +MODULE_LICENSE("GPL"); diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix7-bwde-32x/modules/qci_cpld_led.c b/platform/broadcom/sonic-platform-modules-quanta/ix7-bwde-32x/modules/qci_cpld_led.c new file mode 100644 index 000000000000..d924f51ebc29 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix7-bwde-32x/modules/qci_cpld_led.c @@ -0,0 +1,284 @@ +/* + * A LED CPLD driver for Quanta Switch Platform + * + * The CPLD is customize by Quanta for decode led bit stream, + * This driver modify from Quanta CPLD I/O driver. + * + * Copyright (C) 2015 Quanta Inc. + * + * Author: Luffy Cheng + * Author: Roger Chang + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static DEFINE_IDA(cpld_led_ida); + +enum platform_type { + IX7 = 0, + IX8, + IX7_BWDE, + IX8A_BWDE, + NONE +}; + +static struct class *cpld_class = NULL; + +struct cpld_data { + struct i2c_client *cpld_client; + char name[8]; + u8 cpld_id; +}; + +struct cpld_led_data { + struct mutex lock; + struct device *port_dev; + struct cpld_data *cpld_data; +}; + +static int cpld_led_probe(struct i2c_client *client, + const struct i2c_device_id *id); +static int cpld_led_remove(struct i2c_client *client); + +static const struct i2c_device_id cpld_led_id[] = { + { "CPLDLED_IX7", IX7 }, + { "CPLDLED_IX8", IX8 }, + { "CPLDLED_IX7_BWDE", IX7_BWDE }, + { "CPLDLED_IX8A_BWDE", IX8A_BWDE }, + { } +}; +MODULE_DEVICE_TABLE(i2c, cpld_led_id); + +static struct i2c_driver cpld_led_driver = { + .class = I2C_CLASS_HWMON, + .driver = { + .name = "qci_cpld_led", + }, + .probe = cpld_led_probe, + .remove = cpld_led_remove, + .id_table = cpld_led_id, +// .address_list = normal_i2c, +}; + +#define CPLD_LED_ID_PREFIX "CPLDLED-" +#define CPLD_LED_ID_FORMAT CPLD_LED_ID_PREFIX "%d" + +#define CPLD_DECODER_OFFSET 0x4 +#define CPLD_DECODER_MASK 0x1 +#define CPLD_USERCODE_START_OFFSET 0x0 + +static ssize_t get_led_decode(struct device *dev, + struct device_attribute *devattr, + char *buf) +{ + struct cpld_data *data = dev_get_drvdata(dev); + struct i2c_client *client = data->cpld_client; + u8 offset = (u8)(CPLD_DECODER_OFFSET); + s32 value; + + value = i2c_smbus_read_byte_data(client, offset); + if (value < 0) + return -ENODEV; + + dev_dbg(&client->dev, "read led decode value= %x\n", value); + + value &= CPLD_DECODER_MASK; + + return sprintf(buf, "%d\n", (value == 0) ? 1 : 0); +} + +static ssize_t get_usercode(struct device *dev, + struct device_attribute *devattr, + char *buf) +{ + struct cpld_data *data = dev_get_drvdata(dev); + struct i2c_client *client = data->cpld_client; + u8 i = 0; + s32 value = 0, reading = 0; + + for (i = 0; i < 4; i++) + { + reading = i2c_smbus_read_byte_data(client, CPLD_USERCODE_START_OFFSET + i); + if (reading < 0) + return -ENODEV; + + dev_dbg(&client->dev, "read led usercode reg %d value= %x\n", i, reading); + + value |= reading << (24 - 8 * i); + } + + return sprintf(buf, "%X\n", value); +} + +static ssize_t set_led_decode(struct device *dev, + struct device_attribute *devattr, + const char *buf, + size_t count) +{ + struct cpld_data *data = dev_get_drvdata(dev); + struct i2c_client *client = data->cpld_client; + s32 value; + long enable; + + if (kstrtol(buf, 0, &enable)) + return -EINVAL; + + if ((enable != 1) && (enable != 0)) + return -EINVAL; + +// mutex_lock(&data->lock); + value = i2c_smbus_read_byte_data(client, CPLD_DECODER_OFFSET); + if (value < 0) + return -ENODEV; + + dev_dbg(&client->dev, "read led decode value= %x\n", value); + + value |= CPLD_DECODER_MASK; + if (enable) + value &= ~CPLD_DECODER_MASK; + + dev_dbg(&client->dev, "write led decode value= %x\n", value); + + i2c_smbus_write_byte_data(client, CPLD_DECODER_OFFSET, (u8)value); +// mutex_unlock(&data->lock); + + return count; +} + +static DEVICE_ATTR(led_decode, S_IWUSR | S_IRUGO, get_led_decode, set_led_decode); +static DEVICE_ATTR(usercode, S_IRUGO, get_usercode, NULL); + +static const struct attribute *led_attrs[] = { + &dev_attr_usercode.attr, + &dev_attr_led_decode.attr, + NULL, +}; + +static const struct attribute_group led_attr_group = { + .attrs = (struct attribute **) led_attrs, +}; + +static int cpld_led_probe(struct i2c_client *client, + const struct i2c_device_id *id) +{ + struct cpld_led_data *data; + struct cpld_data *led_data; + struct device *port_dev; + int nr, err; + + if (!cpld_class) + { + cpld_class = class_create(THIS_MODULE, "cpld-led"); + if (IS_ERR(cpld_class)) { + pr_err("couldn't create sysfs class\n"); + return PTR_ERR(cpld_class); + } + } + + data = devm_kzalloc(&client->dev, sizeof(struct cpld_led_data), + GFP_KERNEL); + if (!data) + return -ENOMEM; + + /* Test */ + nr = ida_simple_get(&cpld_led_ida, 1, 99, GFP_KERNEL); + if (nr < 0) + goto err_out; + + led_data = kzalloc(sizeof(struct cpld_led_data), GFP_KERNEL); + + port_dev = device_create(cpld_class, &client->dev, MKDEV(0,0), led_data, CPLD_LED_ID_FORMAT, nr); + if (IS_ERR(port_dev)) { + err = PTR_ERR(port_dev); + // printk("err_status\n"); + } + + data->port_dev = port_dev; + data->cpld_data = led_data; + + dev_info(&client->dev, "Register CPLDLED %d\n", nr); + + sprintf(led_data->name, "LED%d-data", nr); + led_data->cpld_id = nr; + dev_set_drvdata(port_dev, led_data); + port_dev->init_name = led_data->name; + led_data->cpld_client = client; + + err = sysfs_create_group(&port_dev->kobj, &led_attr_group); + // if (status) printk("err status\n"); + /* end */ + + i2c_set_clientdata(client, data); + mutex_init(&data->lock); + + dev_info(&client->dev, "%s device found\n", client->name); + + + return 0; + +err_out: + return nr; +} + +#if 0 +/* FIXME: for older kernel doesn't with idr_is_empty function, implement here */ +static int idr_has_entry(int id, void *p, void *data) +{ + return 1; +} + +static bool cpld_idr_is_empty(struct idr *idp) +{ + return !idr_for_each(idp, idr_has_entry, NULL); +} +#endif + +static int cpld_led_remove(struct i2c_client *client) +{ + struct cpld_led_data *data = i2c_get_clientdata(client); + + dev_info(data->port_dev, "Remove CPLDLED-%d\n", data->cpld_data->cpld_id); + device_unregister(data->port_dev); + ida_simple_remove(&cpld_led_ida, data->cpld_data->cpld_id); + kfree(data->cpld_data); + + if (ida_is_empty(&cpld_led_ida)) + { + class_destroy(cpld_class); + cpld_class = NULL; + } + + return 0; +} + +module_i2c_driver(cpld_led_driver); + +MODULE_AUTHOR("Luffy Cheng "); +MODULE_AUTHOR("Roger Chang "); +MODULE_DESCRIPTION("Quanta Switch LED CPLD driver"); +MODULE_LICENSE("GPL"); diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix7-bwde-32x/modules/quanta_hwmon_ipmi.c b/platform/broadcom/sonic-platform-modules-quanta/ix7-bwde-32x/modules/quanta_hwmon_ipmi.c new file mode 100644 index 000000000000..08d6a97d9a09 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix7-bwde-32x/modules/quanta_hwmon_ipmi.c @@ -0,0 +1,1908 @@ +/* +* +* A hwmon driver for the Quanta switch BMC hwmon +* +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define enable_debug_msg 0 +#define DEBUGUSE_SHIFT 0 + +#define DRVNAME "quanta_hwmon_ipmi" + +#define tos32(val, bits) ((val & ((1<<((bits)-1)))) ? (-((val) & (1<<((bits)-1))) | (val)) : (val)) +#define BSWAP_16(x) ((((x) & 0xff00) >> 8) | (((x) & 0x00ff) << 8)) +#define BSWAP_32(x) ((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >> 8) | (((x) & 0x0000ff00) << 8) | (((x) & 0x000000ff) << 24)) +#define __TO_M(mtol) (int16_t)(tos32((((BSWAP_16(mtol) & 0xff00) >> 8) | ((BSWAP_16(mtol) & 0xc0) << 2)), 10)) +#define __TO_B(bacc) (int32_t)(tos32((((BSWAP_32(bacc) & 0xff000000) >> 24) | ((BSWAP_32(bacc) & 0xc00000) >> 14)), 10)) +#define __TO_R_EXP(bacc) (int32_t)(tos32(((BSWAP_32(bacc) & 0xf0) >> 4), 4)) +#define __TO_B_EXP(bacc) (int32_t)(tos32((BSWAP_32(bacc) & 0xf), 4)) + +#define SENSOR_ATTR_MAX 19 +#define SENSOR_ATTR_NAME_LENGTH 20 + +#define SENSOR_GET_CAP_LABEL 0x001 +#define SENSOR_GET_CAP_ALARM 0x002 +#define SENSOR_GET_CAP_INPUT 0x004 + +#define SENSOR_GET_CAP_LNC 0x008 +#define SENSOR_GET_CAP_LCR 0x010 +#define SENSOR_GET_CAP_LNR 0x020 + +#define SENSOR_GET_CAP_UNC 0x040 +#define SENSOR_GET_CAP_UCR 0x080 +#define SENSOR_GET_CAP_UNR 0x100 + +#define SENSOR_GET_CAP_MODEL 0x200 +#define SENSOR_GET_CAP_SN 0x400 +#define SENSOR_GET_CAP_PWM 0x800 + +#define SENSOR_GET_CAP_CONMODE 0x1000 +#define SENSOR_GET_CAP_DIRECTION 0x2000 +#define SENSOR_GET_CAP_FAN_PRESENT 0x4000 +#define SENSOR_GET_CAP_PSU_PRESENT 0x8000 + +#define SENSOR_GET_CAP_MFRID 0x10000 +#define SENSOR_GET_CAP_VIN_TYPE 0x20000 +#define SENSOR_GET_CAP_POUT_MAX 0x40000 + +#define SDR_SENSOR_TYPE_TEMP 0x01 +#define SDR_SENSOR_TYPE_VOLT 0x02 +#define SDR_SENSOR_TYPE_CURR 0x03 +#define SDR_SENSOR_TYPE_FAN 0x04 +#define SDR_SENSOR_TYPE_PS 0x08 +#define SDR_SENSOR_TYPE_OTHER 0x0b + +#define BMC_GET_DEVICE_ID 0x01 + +#define IPMI_NETFN_SE 0x04 +#define IPMI_NETFN_APP 0x06 +#define IPMI_NETFN_STORAGE 0x0a +#define IPMI_NETFN_TSOL 0x30 + +#define GET_SDR_REPO_INFO 0x20 +#define GET_DEVICE_SDR 0x21 +#define GET_SDR_RESERVE_REPO 0x22 +#define GET_SDR 0x23 +#define GET_SENSOR_THRESHOLDS 0x27 +#define GET_SENSOR_EVENT_ENABLE 0x29 +#define GET_SENSOR_EVENT_STATUS 0x2b +#define GET_SENSOR_READING 0x2d +#define GET_PSU_READING 0x52 +#define GET_FAN_INFO 0xd6 +#define GET_FRU_INFO 0x11 + +#define IPM_DEV_DEVICE_ID_SDR_MASK (0x80) /* 1 = provides SDRs */ +#define IPMI_TIMEOUT (4 * HZ) +#define IPMI_MAX_WAIT_QUEUE 1 + +struct quanta_hwmon_ipmi_data +{ + struct platform_device *ipmi_platform_dev; + struct device *ipmi_hwmon_dev; + /*struct mutex ipmi_lock; */ + + int32_t total_sensor_id; + int32_t total_suport_sensor; + int32_t total_create_sysfs; +} *data; + +static struct mutex ipmi_lock; +static struct completion g_read_complete; + +static ipmi_user_t ipmi_mh_user = NULL; + +static int8_t g_fan_control_mode = 3; +static int32_t g_use_built_in = 0; +static int32_t ipmi_wait_queue = 0; + +struct ipmi_sensor_data +{ + uint8_t addr; + uint8_t sensor_type; + uint8_t sensor_idstring[SENSOR_ATTR_NAME_LENGTH]; + + uint32_t capability; + + struct header_info + { + uint8_t header_type; + uint8_t header_byte; + } headerinfo; + + struct record_info + { + uint8_t record_analog; + uint8_t record_linearization; + + int32_t record_m; + int32_t record_b; + int32_t record_k1; + int32_t record_k2; + } recordinfo; + + struct threshold_upper_info + { + uint8_t unr; + uint8_t ucr; + uint8_t unc; + } upperinfo; + + struct threshold_lower_info + { + uint8_t lnr; + uint8_t lcr; + uint8_t lnc; + } lowerinfo; + + struct attr_info + { + bool attr_exist; + char attr_name[SENSOR_ATTR_MAX][SENSOR_ATTR_NAME_LENGTH]; + char attr_type_str[SENSOR_ATTR_NAME_LENGTH]; + + struct attribute *attrs[SENSOR_ATTR_MAX + 1]; + struct attribute_group attr_group; + struct sensor_device_attribute sd_attrs[SENSOR_ATTR_MAX + 1]; + } attrinfo; + +} *g_sensor_data; + +struct ipmi_comm_data +{ + int32_t tx_id; + + int32_t rx_result; + int64_t rx_len; + void *rx_data; + struct completion *rx_read_complete; +}; + +struct ipmi_sdr_iterator +{ + uint16_t reservation; + int32_t total; + int32_t next; +}; + +struct ipm_devid_rsp +{ + uint8_t device_id; + uint8_t device_revision; + uint8_t fw_rev1; + uint8_t fw_rev2; + uint8_t ipmi_version; + uint8_t adtl_device_support; + uint8_t manufacturer_id[3]; + uint8_t product_id[2]; + uint8_t aux_fw_rev[4]; +} __attribute__((packed)); + +struct sdr_repo_info_rs +{ + uint8_t version; /* SDR version (51h) */ + uint16_t count; /* number of records */ + uint16_t free; /* free space in SDR */ + uint32_t add_stamp; /* last add timestamp */ + uint32_t erase_stamp; /* last del timestamp */ + uint8_t op_support; /* supported operations */ +} __attribute__((packed)); + +struct sdr_device_info_rs +{ + uint8_t count; /* number of records */ + uint8_t flags; /* flags */ + uint8_t popChangeInd[3]; /* free space in SDR */ +} __attribute__((packed)); + +struct sdr_get_rs +{ + uint16_t next; /* next record id */ + uint16_t id; /* record ID */ + uint8_t version; /* SDR version (51h) */ +#define SDR_RECORD_TYPE_FULL_SENSOR 0x01 +#define SDR_RECORD_TYPE_COMPACT_SENSOR 0x02 +#define SDR_RECORD_TYPE_EVENTONLY_SENSOR 0x03 +#define SDR_RECORD_TYPE_ENTITY_ASSOC 0x08 +#define SDR_RECORD_TYPE_DEVICE_ENTITY_ASSOC 0x09 +#define SDR_RECORD_TYPE_GENERIC_DEVICE_LOCATOR 0x10 +#define SDR_RECORD_TYPE_FRU_DEVICE_LOCATOR 0x11 +#define SDR_RECORD_TYPE_MC_DEVICE_LOCATOR 0x12 +#define SDR_RECORD_TYPE_MC_CONFIRMATION 0x13 +#define SDR_RECORD_TYPE_BMC_MSG_CHANNEL_INFO 0x14 +#define SDR_RECORD_TYPE_OEM 0xc0 + uint8_t type; /* record type */ + uint8_t length; /* remaining record bytes */ +} __attribute__((packed)); + +struct sdr_get_rq +{ + uint16_t reserve_id; /* reservation ID */ + uint16_t id; /* record ID */ + uint8_t offset; /* offset into SDR */ +#define GET_SDR_ENTIRE_RECORD 0xff + uint8_t length; /* length to read */ +} __attribute__((packed)); + +struct entity_id +{ + uint8_t id; /* physical entity id */ +#ifdef WORDS_BIGENDIAN + uint8_t logical : 1; /* physical/logical */ + uint8_t instance : 7; /* instance number */ +#else + uint8_t instance : 7; /* instance number */ + uint8_t logical : 1; /* physical/logical */ +#endif +} __attribute__((packed)); + +struct sdr_record_mask +{ + union + { + struct + { + uint16_t assert_event; /* assertion event mask */ + uint16_t deassert_event; /* de-assertion event mask */ + uint16_t read; /* discrete reading mask */ + } discrete; + struct + { +#ifdef WORDS_BIGENDIAN + uint16_t reserved : 1; + uint16_t status_lnr : 1; + uint16_t status_lcr : 1; + uint16_t status_lnc : 1; + uint16_t assert_unr_high : 1; + uint16_t assert_unr_low : 1; + uint16_t assert_ucr_high : 1; + uint16_t assert_ucr_low : 1; + uint16_t assert_unc_high : 1; + uint16_t assert_unc_low : 1; + uint16_t assert_lnr_high : 1; + uint16_t assert_lnr_low : 1; + uint16_t assert_lcr_high : 1; + uint16_t assert_lcr_low : 1; + uint16_t assert_lnc_high : 1; + uint16_t assert_lnc_low : 1; +#else + uint16_t assert_lnc_low : 1; + uint16_t assert_lnc_high : 1; + uint16_t assert_lcr_low : 1; + uint16_t assert_lcr_high : 1; + uint16_t assert_lnr_low : 1; + uint16_t assert_lnr_high : 1; + uint16_t assert_unc_low : 1; + uint16_t assert_unc_high : 1; + uint16_t assert_ucr_low : 1; + uint16_t assert_ucr_high : 1; + uint16_t assert_unr_low : 1; + uint16_t assert_unr_high : 1; + uint16_t status_lnc : 1; + uint16_t status_lcr : 1; + uint16_t status_lnr : 1; + uint16_t reserved : 1; +#endif +#ifdef WORDS_BIGENDIAN + uint16_t reserved_2 : 1; + uint16_t status_unr : 1; + uint16_t status_ucr : 1; + uint16_t status_unc : 1; + uint16_t deassert_unr_high : 1; + uint16_t deassert_unr_low : 1; + uint16_t deassert_ucr_high : 1; + uint16_t deassert_ucr_low : 1; + uint16_t deassert_unc_high : 1; + uint16_t deassert_unc_low : 1; + uint16_t deassert_lnr_high : 1; + uint16_t deassert_lnr_low : 1; + uint16_t deassert_lcr_high : 1; + uint16_t deassert_lcr_low : 1; + uint16_t deassert_lnc_high : 1; + uint16_t deassert_lnc_low : 1; +#else + uint16_t deassert_lnc_low : 1; + uint16_t deassert_lnc_high : 1; + uint16_t deassert_lcr_low : 1; + uint16_t deassert_lcr_high : 1; + uint16_t deassert_lnr_low : 1; + uint16_t deassert_lnr_high : 1; + uint16_t deassert_unc_low : 1; + uint16_t deassert_unc_high : 1; + uint16_t deassert_ucr_low : 1; + uint16_t deassert_ucr_high : 1; + uint16_t deassert_unr_low : 1; + uint16_t deassert_unr_high : 1; + uint16_t status_unc : 1; + uint16_t status_ucr : 1; + uint16_t status_unr : 1; + uint16_t reserved_2 : 1; +#endif + union + { + struct + { +#ifdef WORDS_BIGENDIAN /* settable threshold mask */ + uint16_t reserved : 2; + uint16_t unr : 1; + uint16_t ucr : 1; + uint16_t unc : 1; + uint16_t lnr : 1; + uint16_t lcr : 1; + uint16_t lnc : 1; + /* padding lower 8 bits */ + uint16_t readable : 8; +#else + uint16_t readable : 8; + uint16_t lnc : 1; + uint16_t lcr : 1; + uint16_t lnr : 1; + uint16_t unc : 1; + uint16_t ucr : 1; + uint16_t unr : 1; + uint16_t reserved : 2; +#endif + } set; + struct + { +#ifdef WORDS_BIGENDIAN /* readable threshold mask */ + /* padding upper 8 bits */ + uint16_t settable : 8; + uint16_t reserved : 2; + uint16_t unr : 1; + uint16_t ucr : 1; + uint16_t unc : 1; + uint16_t lnr : 1; + uint16_t lcr : 1; + uint16_t lnc : 1; +#else + uint16_t lnc : 1; + uint16_t lcr : 1; + uint16_t lnr : 1; + uint16_t unc : 1; + uint16_t ucr : 1; + uint16_t unr : 1; + uint16_t reserved : 2; + uint16_t settable : 8; +#endif + } read; + }; + } threshold; + } type; +} __attribute__((packed)); + +struct sdr_record_full_sensor +{ + struct + { + uint8_t owner_id; +#ifdef WORDS_BIGENDIAN + uint8_t channel : 4; /* channel number */ + uint8_t __reserved : 2; + uint8_t lun : 2; /* sensor owner lun */ +#else + uint8_t lun : 2; /* sensor owner lun */ + uint8_t __reserved : 2; + uint8_t channel : 4; /* channel number */ +#endif + uint8_t sensor_num; /* unique sensor number */ + } keys; + + struct entity_id entity; + + struct + { + struct + { +#ifdef WORDS_BIGENDIAN + uint8_t __reserved : 1; + uint8_t scanning : 1; + uint8_t events : 1; + uint8_t thresholds : 1; + uint8_t hysteresis : 1; + uint8_t type : 1; + uint8_t event_gen : 1; + uint8_t sensor_scan : 1; +#else + uint8_t sensor_scan : 1; + uint8_t event_gen : 1; + uint8_t type : 1; + uint8_t hysteresis : 1; + uint8_t thresholds : 1; + uint8_t events : 1; + uint8_t scanning : 1; + uint8_t __reserved : 1; +#endif + } init; + struct + { +#ifdef WORDS_BIGENDIAN + uint8_t ignore : 1; + uint8_t rearm : 1; + uint8_t hysteresis : 2; + uint8_t threshold : 2; + uint8_t event_msg : 2; +#else + uint8_t event_msg : 2; + uint8_t threshold : 2; + uint8_t hysteresis : 2; + uint8_t rearm : 1; + uint8_t ignore : 1; +#endif + } capabilities; + uint8_t type; + } sensor; + + uint8_t event_type; /* event/reading type code */ + + struct sdr_record_mask mask; + + struct + { +#ifdef WORDS_BIGENDIAN + uint8_t analog : 2; + uint8_t rate : 3; + uint8_t modifier : 2; + uint8_t pct : 1; +#else + uint8_t pct : 1; + uint8_t modifier : 2; + uint8_t rate : 3; + uint8_t analog : 2; +#endif + struct + { + uint8_t base; + uint8_t modifier; + } type; + } unit; + +#define SDR_SENSOR_L_LINEAR 0x00 +#define SDR_SENSOR_L_LN 0x01 +#define SDR_SENSOR_L_LOG10 0x02 +#define SDR_SENSOR_L_LOG2 0x03 +#define SDR_SENSOR_L_E 0x04 +#define SDR_SENSOR_L_EXP10 0x05 +#define SDR_SENSOR_L_EXP2 0x06 +#define SDR_SENSOR_L_1_X 0x07 +#define SDR_SENSOR_L_SQR 0x08 +#define SDR_SENSOR_L_CUBE 0x09 +#define SDR_SENSOR_L_SQRT 0x0a +#define SDR_SENSOR_L_CUBERT 0x0b +#define SDR_SENSOR_L_NONLINEAR 0x70 + + uint8_t linearization; /* 70h=non linear, 71h-7Fh=non linear, OEM */ + uint16_t mtol; /* M, tolerance */ + uint32_t bacc; /* accuracy, B, Bexp, Rexp */ + + struct + { +#ifdef WORDS_BIGENDIAN + uint8_t __reserved : 5; + uint8_t normal_min : 1; /* normal min field specified */ + uint8_t normal_max : 1; /* normal max field specified */ + uint8_t nominal_read : 1; /* nominal reading field specified */ +#else + uint8_t nominal_read : 1; /* nominal reading field specified */ + uint8_t normal_max : 1; /* normal max field specified */ + uint8_t normal_min : 1; /* normal min field specified */ + uint8_t __reserved : 5; +#endif + } analog_flag; + + uint8_t nominal_read; /* nominal reading, raw value */ + uint8_t normal_max; /* normal maximum, raw value */ + uint8_t normal_min; /* normal minimum, raw value */ + uint8_t sensor_max; /* sensor maximum, raw value */ + uint8_t sensor_min; /* sensor minimum, raw value */ + + struct + { + struct + { + uint8_t non_recover; + uint8_t critical; + uint8_t non_critical; + } upper; + struct + { + uint8_t non_recover; + uint8_t critical; + uint8_t non_critical; + } lower; + struct + { + uint8_t positive; + uint8_t negative; + } hysteresis; + } threshold; + uint8_t __reserved[2]; + uint8_t oem; /* reserved for OEM use */ + uint8_t id_code; /* sensor ID string type/length code */ + uint8_t id_string[16]; /* sensor ID string bytes, only if id_code != 0 */ +} __attribute__((packed)); + +int32_t pow_convert(int32_t *a, int32_t b) +{ + /* function input parameter (a * 10 ^ b) */ + int32_t i = 0, r = 1, temp_b = 0; + + temp_b = (b > 0) ? b : -b; + + for (i = 0; i < temp_b; i++) + { + r = r * 10; + } + + if (b > 0) + { + *a = (*a) * r; + r = 1; + } + /* function return parameter calc_result = *a, decimal_point = r */ + return r; +} + +void simple_atoi(const char *buf, int8_t *output_val) +{ + while (*buf >= '0' && *buf <= '9') + { + *output_val = *output_val * 10 + *buf - '0'; + buf++; + } +} + +static void ipmi_msg_handler(struct ipmi_recv_msg *msg, void *handler_data) +{ + int32_t rv = -IPMI_UNKNOWN_ERR_COMPLETION_CODE; + + struct ipmi_comm_data *comm_data = msg->user_msg_data; + + ipmi_wait_queue--; + + if (msg->msg.data[0] != 0) + { + if ((msg->msg.data[0] != 0x83) && (msg->msg.netfn != 0x07) + && (msg->msg.cmd != 0x52)) + { + /*skip master r/w cmd return code */ + printk("ipmi: Error 0x%x on cmd 0x%x/0x%x\n", msg->msg.data[0], msg->msg.netfn, + msg->msg.cmd); + rv = msg->msg.data[0]; + goto get_BMC_response_fail; + } + } + + if (msg->msgid != comm_data->tx_id) + { + printk("ipmi: rx msgid %d mismatch tx msgid %d\n", (int32_t)msg->msgid, + comm_data->tx_id); + goto get_BMC_response_fail; + } + + if (msg->msg.data_len <= 0) + { + printk("ipmi: Data len too low (%d)\n", msg->msg.data_len); + goto get_BMC_response_fail; + } + + if (msg->msg.data_len > 1) + { + if (comm_data->rx_len) + { + comm_data->rx_len = msg->msg.data_len - 1; + memcpy(comm_data->rx_data, msg->msg.data + 1, comm_data->rx_len); + } + else + { + printk("ipmi: rx len = 0, it should be not retrun ?\n"); + goto get_BMC_response_fail; + } + } + + rv = 0; + +get_BMC_response_fail: + ipmi_free_recv_msg(msg); + + if (ipmi_wait_queue == 0) + { + comm_data->rx_result = rv; + if (rv == 0) + { + complete(comm_data->rx_read_complete); + } + } +} +static struct ipmi_user_hndl ipmi_hndlrs = { .ipmi_recv_hndl = ipmi_msg_handler, }; + +int32_t ipmi_request_wait_for_response(struct kernel_ipmi_msg msg, + struct ipmi_comm_data *comm_data) +{ + int32_t rv = 0; + int32_t escape_time = 0; + + struct ipmi_addr ipmi_address; + + if (ipmi_wait_queue >= IPMI_MAX_WAIT_QUEUE) + { + /* printk("msg queue full, cannot send ipmi cmd\n"); */ + return -EBUSY; + } + ipmi_wait_queue++; + + ipmi_address.addr_type = IPMI_SYSTEM_INTERFACE_ADDR_TYPE; + ipmi_address.channel = IPMI_BMC_CHANNEL; + ipmi_address.data[0] = 0; + + rv = ipmi_validate_addr(&ipmi_address, sizeof(ipmi_address)); + if (rv) + { + printk("ipmi_validate_addr fail, err code : %d\n", rv); + return rv; + } + + ipmi_request_settime(ipmi_mh_user, &ipmi_address, comm_data->tx_id, &msg, + comm_data, 0, 0, 0); + + escape_time = wait_for_completion_timeout(comm_data->rx_read_complete, + IPMI_TIMEOUT); + + rv = comm_data->rx_result; + if (escape_time == 0) + { + printk("BMC not response (%d)\n", escape_time); + } + + return rv; +} + +int32_t ipmi_send_system_cmd(uint8_t *msg_tx_data, int32_t msg_tx_len, + void *msg_rx_data, int32_t msg_rx_len) +{ + int32_t i = 0; + int32_t rv = 0; + + static uint64_t tx_msgid = 1; + + struct kernel_ipmi_msg msg; + struct ipmi_comm_data *comm_data = NULL; + struct completion read_complete; + + init_completion(&read_complete); + + /* prepare transfer message */ + msg.netfn = msg_tx_data[0]; + msg.cmd = msg_tx_data[1]; + msg.data_len = msg_tx_len - 2; + + msg.data = kzalloc(msg.data_len, GFP_KERNEL); + if (msg.data == NULL) + { + printk("%s(%d): malloc [msg.data] failure", __func__, __LINE__); + rv = -ENOMEM; + goto alloc_mem_fail; + } + + comm_data = kzalloc(sizeof(struct ipmi_comm_data), GFP_KERNEL); + if (comm_data == NULL) + { + printk("%s(%d): malloc [comm_data] failure", __func__, __LINE__); + rv = -ENOMEM; + goto alloc_mem_fail; + } + + for (i = 2; i < msg_tx_len; i++) + { + msg.data[i - 2] = msg_tx_data[i]; + } + + comm_data->tx_id = tx_msgid++; + + /* prepare recive message */ + comm_data->rx_data = msg_rx_data; + comm_data->rx_len = msg_rx_len; + comm_data->rx_result = -1; + comm_data->rx_read_complete = &read_complete; + + rv = ipmi_request_wait_for_response(msg, comm_data); + +alloc_mem_fail: + if (msg.data) + { + kfree(msg.data); + } + if (comm_data) + { + kfree(comm_data); + } + if (tx_msgid > UINT_MAX) + { + tx_msgid = 1; + } + + return rv; +} + +int32_t ipmi_sdr_get_reservation(uint16_t *reserve_id) +{ + int32_t rv = 0; + uint8_t msg_data[] = { 0x00, GET_SDR_RESERVE_REPO }; /*netfn = 0x00; cmd = GET_SDR_RESERVE_REPO; */ + + msg_data[0] = (g_use_built_in == 0) ? IPMI_NETFN_STORAGE : IPMI_NETFN_SE; + + /* obtain reservation ID */ + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), reserve_id, 1); + if (rv) + { + printk("BMC down at (%d)!!\n", __LINE__); + } + +#if enable_debug_msg + printk("SDR reservation ID %04x\n", *reserve_id); +#endif + + return rv; +} + +int32_t ipmi_sdr_start(struct ipmi_sdr_iterator *itr) +{ + int32_t rv = 0; + + uint8_t msg_data[] = { IPMI_NETFN_APP, BMC_GET_DEVICE_ID }; /*netfn = IPMI_NETFN_APP; cmd = BMC_GET_DEVICE_ID; */ + + struct ipm_devid_rsp devid; + + /* check SDRR capability */ + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), &devid, 1); + if (rv) + { + printk("BMC down at (%d)!!\n", __LINE__); + return rv; + } + + if (devid.device_revision & IPM_DEV_DEVICE_ID_SDR_MASK) + { + if ((devid.adtl_device_support & 0x02) == 0) + { + if ((devid.adtl_device_support & 0x01)) + { + printk("Using Device SDRs\n"); + g_use_built_in = 1; + } + else + { + printk("Error obtaining SDR info\n"); + } + } + } + + if (g_use_built_in == 0) + { + struct sdr_repo_info_rs sdr_info; + /* get sdr repository info */ + msg_data[0] = IPMI_NETFN_STORAGE; + msg_data[1] = GET_SDR_REPO_INFO; + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), &sdr_info, 1); + itr->total = sdr_info.count; + +#if enable_debug_msg + printk("SDR version: 0x%x\n", sdr_info.version); + printk("SDR free space: %d\n", sdr_info.free); +#endif + } + else + { + struct sdr_device_info_rs sdr_info; + /* get device sdr info */ + msg_data[0] = IPMI_NETFN_SE; + msg_data[1] = GET_SDR_REPO_INFO; + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), &sdr_info, 1); + itr->total = sdr_info.count; + } + +#if enable_debug_msg + printk("SDR records : %d\n", sdr_info.count); +#endif + + if (rv) + { + printk("BMC down at (%d)!!\n", __LINE__); + } + else + { + itr->next = 0; + rv = ipmi_sdr_get_reservation(&(itr->reservation)); + } + + return rv; +} + +int32_t ipmi_sdr_get_header(struct ipmi_sdr_iterator *itr, + struct sdr_get_rs *sdr_rs) +{ + int32_t rv = 0; + + uint8_t msg_data[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; /*netfn = 0x00; cmd = 0x00; */ + + struct sdr_get_rq sdr_rq; + + sdr_rq.reserve_id = itr->reservation; + sdr_rq.id = itr->next; + sdr_rq.offset = 0; + sdr_rq.length = 5; /* only get the header */ + + if (g_use_built_in == 0) + { + msg_data[0] = IPMI_NETFN_STORAGE; + msg_data[1] = GET_SDR; + } + else + { + msg_data[0] = IPMI_NETFN_SE; + msg_data[1] = GET_DEVICE_SDR; + } + + memcpy(msg_data + 2, (uint8_t *)&sdr_rq, sizeof(struct sdr_get_rq)); + + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), sdr_rs, 1); + if ((rv) || (sdr_rs->length == 0)) + { + printk("SDR record id 0x%04x: invalid length %d", itr->next, sdr_rs->length); + return -1; + } + + if (sdr_rs->id != itr->next) + { +#if enable_debug_msg + printk("SDR record id mismatch: 0x%04x\n", sdr_rs->id); +#endif + sdr_rs->id = itr->next; + } +#if enable_debug_msg + printk("\nSDR record ID : 0x%04x", itr->next); + printk("SDR record type : 0x%02x\n", sdr_rs->type); + printk("SDR record next : 0x%04x\n", sdr_rs->next); + printk("SDR record bytes: %d\n", sdr_rs->length); +#endif + + return rv; +} + +int32_t ipmi_sdr_get_record(struct sdr_get_rs *header, + struct ipmi_sdr_iterator *itr, uint8_t *ret_data) +{ + int32_t rv = 0, len = 0; + + uint8_t buff[128] = ""; + uint8_t msg_data[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; /*netfn = 0x00; cmd = 0x00; */ + + struct sdr_get_rq sdr_rq; + + len = header->length; + if (len > 0) + { + memset(&sdr_rq, 0, sizeof(sdr_rq)); + sdr_rq.reserve_id = itr->reservation; + sdr_rq.id = header->id; + sdr_rq.offset = 5; + sdr_rq.length = len; + + if (g_use_built_in == 0) + { + msg_data[0] = IPMI_NETFN_STORAGE; + msg_data[1] = GET_SDR; + } + else + { + msg_data[0] = IPMI_NETFN_SE; + msg_data[1] = GET_DEVICE_SDR; + } + + memcpy(msg_data + 2, (uint8_t *)&sdr_rq, sizeof(struct sdr_get_rq)); + + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), ret_data, 1); + if (rv) + { + printk("BMC down at (%d)!!\n", __LINE__); + } + else + { + memset(buff, 0, sizeof(buff)); + memcpy(buff, ret_data + 2, sdr_rq.length); + memcpy(ret_data, buff, sdr_rq.length + 2); + } + } + + return rv; +} + +void ipmi_sdr_set_sensor_threshold(uint8_t idx, + struct sdr_record_full_sensor *sensor) +{ + + /* lower threshold info */ + if (sensor->mask.type.threshold.read.lnc) + { + g_sensor_data[idx].capability |= SENSOR_GET_CAP_LNC; + } + if (sensor->mask.type.threshold.read.lcr) + { + g_sensor_data[idx].capability |= SENSOR_GET_CAP_LCR; + } + if (sensor->mask.type.threshold.read.lnr) + { + g_sensor_data[idx].capability |= SENSOR_GET_CAP_LNR; + } + g_sensor_data[idx].lowerinfo.lnc = sensor->threshold.lower.non_critical; + g_sensor_data[idx].lowerinfo.lcr = sensor->threshold.lower.critical; + g_sensor_data[idx].lowerinfo.lnr = sensor->threshold.lower.non_recover; + + /* upper threshold info */ + if (sensor->mask.type.threshold.read.unc) + { + g_sensor_data[idx].capability |= SENSOR_GET_CAP_UNC; + } + if (sensor->mask.type.threshold.read.ucr) + { + g_sensor_data[idx].capability |= SENSOR_GET_CAP_UCR; + } + if (sensor->mask.type.threshold.read.unr) + { + g_sensor_data[idx].capability |= SENSOR_GET_CAP_UNR; + } + g_sensor_data[idx].upperinfo.unc = sensor->threshold.upper.non_critical; + g_sensor_data[idx].upperinfo.ucr = sensor->threshold.upper.critical; + g_sensor_data[idx].upperinfo.unr = sensor->threshold.upper.non_recover; +} + +void ipmi_sdr_set_sensor_factor(uint8_t idx, + struct sdr_record_full_sensor *sensor) +{ + char *loc = NULL; + + g_sensor_data[idx].sensor_type = sensor->sensor.type; + sprintf(g_sensor_data[idx].sensor_idstring, "%s", sensor->id_string); + + g_sensor_data[idx].recordinfo.record_m = __TO_M(sensor->mtol); + g_sensor_data[idx].recordinfo.record_b = __TO_B(sensor->bacc); + g_sensor_data[idx].recordinfo.record_k1 = __TO_B_EXP(sensor->bacc); + g_sensor_data[idx].recordinfo.record_k2 = __TO_R_EXP(sensor->bacc); + + g_sensor_data[idx].recordinfo.record_analog = sensor->unit.analog; + g_sensor_data[idx].recordinfo.record_linearization = sensor->linearization; + + memset(g_sensor_data[idx].attrinfo.attr_type_str, 0x00, + SENSOR_ATTR_NAME_LENGTH); + + switch (g_sensor_data[idx].sensor_type) + { + case SDR_SENSOR_TYPE_TEMP: + sprintf(g_sensor_data[idx].attrinfo.attr_type_str, "temp"); + break; + case SDR_SENSOR_TYPE_VOLT: + sprintf(g_sensor_data[idx].attrinfo.attr_type_str, "in"); + break; + case SDR_SENSOR_TYPE_FAN: + g_sensor_data[idx].capability |= SENSOR_GET_CAP_PWM; + g_sensor_data[idx].capability |= SENSOR_GET_CAP_CONMODE; + g_sensor_data[idx].capability |= SENSOR_GET_CAP_DIRECTION; + sprintf(g_sensor_data[idx].attrinfo.attr_type_str, "fan"); + break; + case SDR_SENSOR_TYPE_PS: + loc = strstr(g_sensor_data[idx].sensor_idstring, "POWER"); + if (loc) + { + if ((strncmp(g_sensor_data[idx].sensor_idstring + 11, "OUT", 3)) == 0) + { + g_sensor_data[idx].capability |= SENSOR_GET_CAP_MODEL; + g_sensor_data[idx].capability |= SENSOR_GET_CAP_SN; + g_sensor_data[idx].capability |= SENSOR_GET_CAP_MFRID; + g_sensor_data[idx].capability |= SENSOR_GET_CAP_PSU_PRESENT; + g_sensor_data[idx].capability |= SENSOR_GET_CAP_VIN_TYPE; + g_sensor_data[idx].capability |= SENSOR_GET_CAP_POUT_MAX; + } + sprintf(g_sensor_data[idx].attrinfo.attr_type_str, "power"); + } + + loc = strstr(g_sensor_data[idx].sensor_idstring, "VOLTAGE"); + if (loc) + { + sprintf(g_sensor_data[idx].attrinfo.attr_type_str, "in"); + } + + loc = strstr(g_sensor_data[idx].sensor_idstring, "CURRENT"); + if (loc) + { + sprintf(g_sensor_data[idx].attrinfo.attr_type_str, "curr"); + } + + break; + case SDR_SENSOR_TYPE_CURR: + sprintf(g_sensor_data[idx].attrinfo.attr_type_str, "curr"); + break; + case SDR_SENSOR_TYPE_OTHER: + sprintf(g_sensor_data[idx].attrinfo.attr_type_str, "other"); + break; + default: + printk("not support sensor type !! [%d]\n", g_sensor_data[idx].sensor_type); + break; + } + + if ((strncmp(g_sensor_data[idx].sensor_idstring, "Fan", 3)) == 0) + { + g_sensor_data[idx].capability |= SENSOR_GET_CAP_FAN_PRESENT; + } + +#if enable_debug_msg + { + printk("\n********************\n"); + + printk("m[%d], b[%d], k1[%d], k2[%d]\n", g_sensor_data[idx].recordinfo.record_m, + g_sensor_data[idx].recordinfo.record_b + , g_sensor_data[idx].recordinfo.record_k1, + g_sensor_data[idx].recordinfo.record_k2); + + printk("sensor [%s] type[%d], analog[%d], linearization[%d]\n", + g_sensor_data[idx].sensor_idstring, g_sensor_data[idx].sensor_type + , g_sensor_data[idx].recordinfo.record_analog, + g_sensor_data[idx].recordinfo.record_linearization); + + printk("\n********************\n"); + } +#endif + +} + +int32_t sdr_convert_sensor_reading(uint8_t idx, uint8_t val, + int32_t *point_result) +{ + int32_t m = g_sensor_data[idx].recordinfo.record_m; + int32_t b = g_sensor_data[idx].recordinfo.record_b; + int32_t k1 = g_sensor_data[idx].recordinfo.record_k1; + int32_t k2 = g_sensor_data[idx].recordinfo.record_k2; + int32_t decimal_point = 0; + int32_t result = 0; + + decimal_point = pow_convert(&b, k1); + + switch (g_sensor_data[idx].recordinfo.record_analog) + { + case 0: + result = m * val * decimal_point + b; + break; + case 1: + if (val & 0x80) + { + val++; + } + case 2: + result = (m * (int16_t)val) * decimal_point + b; + break; + default: + return result; + } + + pow_convert(&result, k2); + if (k1 < 0) + { + *point_result += -k1; + } + if (k2 < 0) + { + *point_result += -k2; + } + + if (g_sensor_data[idx].sensor_type != SDR_SENSOR_TYPE_FAN) + { + result = result * 1000; /*shift for lm-sensors */ + } + + return result; +} + +int32_t ipmi_sdr_parsing_value(int32_t idx, uint8_t input_value, + int8_t *ret_str) +{ + int32_t calc_result = 0, point_result = 0; + int32_t temp_len = 0; + + uint8_t temp_str[16] = ""; + + calc_result = sdr_convert_sensor_reading(idx, input_value, &point_result); + + temp_len = sprintf(temp_str, "%d", calc_result); + temp_len = temp_len - point_result; + + /* int part */ + if (temp_len <= 0) + { + sprintf(ret_str, "0"); + } + else + { + snprintf(ret_str, temp_len + 1, "%s", + temp_str); /* +1 for snprintf reserve space'\0' */ + } + + /* point part */ + strcat(ret_str, "."); + + /* float part */ + if ((point_result == 0) || (temp_len < 0)) + { + strcat(ret_str, "0"); + } + else + { + strcat(ret_str, temp_str + temp_len); + } + + /* EOL part */ + strcat(ret_str, "\n\0"); + + return (temp_len + 1 + point_result + + 2); /*integer + point + float + EOL + \0 */ +} + + +uint8_t ipmi_check_psu_present(uint8_t psu_slot) +{ + uint8_t slot_mask = 0x0; + int32_t rv = 0; + + uint8_t returnData[128] = { 0 }; + uint8_t msg_data[] = { 0x36, 0xB9, 0x4C, 0x1C, 0x00, 0x03 }; /*netfn = 0x36; cmd = 0xB9; */ + /*uint8_t msg_data[] = { 0x06, 0x52, 0x1B, 0x4C, 0x01, 0x00 }; //netfn = IPMI_NETFN_APP; cmd = GET_PSU_READING; */ + + mutex_lock(&ipmi_lock); + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), returnData, 1); + mutex_unlock(&ipmi_lock); + + if (rv) + { + printk("BMC down at (%d)!!\n", __LINE__); + return 0; + } + else + { + slot_mask = (psu_slot == 1) ? 0x01 : 0x02; + return (returnData[0] & slot_mask) ? 0 : 1; + } +} + +int32_t ipmi_get_psu_info(uint8_t idx, uint8_t cmd, uint8_t *retbuf) +{ + uint8_t psu_slot = 0; + int32_t rv = 0; + + uint8_t returnData[128] = { 0 }; + uint8_t msg_data[] = { 0x36, 0xBB, 0x4C, 0x1C, 0x00, cmd, 0x00 }; /*netfn = 0x36; cmd = 0xBB; */ + + if (strstr(g_sensor_data[idx].sensor_idstring, "PSU1")) + { + psu_slot = 1; + } + else + { + psu_slot = 2; + } + + if (ipmi_check_psu_present(psu_slot)) + { + msg_data[6] = psu_slot; + mutex_lock(&ipmi_lock); + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), returnData, 1); + mutex_unlock(&ipmi_lock); + + if (rv) + { + printk("BMC down at (%d)!!\n", __LINE__); + } + else + { + return sprintf(retbuf, "%s\n", returnData); + } + } + else + { + /*printk("Error ! cannot detect PSU%d\n", psu_slot); */ + } + + return sprintf(retbuf, "N/A\n"); +} + +int32_t ipmi_get_vin_type(uint8_t idx, uint8_t *retbuf) +{ + uint8_t psu_slot = 0; + int32_t rv = 0; + + uint8_t returnData = 0; + uint8_t msg_data[] = { 0x06, 0x52, 0x0f, 0x00, 0x01, 0xd8 }; // read line status + + if (strstr(g_sensor_data[idx].sensor_idstring, "PSU1")) psu_slot = 1; + else psu_slot = 2; + + msg_data[3] = (psu_slot == 1) ? 0xb0 : 0xb2; + if (ipmi_check_psu_present(psu_slot)) { + mutex_lock(&ipmi_lock); + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), &returnData, 1); + mutex_unlock(&ipmi_lock); + + if (rv) { + printk("BMC down at (%d)!!\n", __LINE__); + } + else { + switch (returnData) + { + case 0x7: //LVDC + case 0x3: //HVDC + return sprintf(retbuf, "DC\n"); + default: + return sprintf(retbuf, "AC\n"); + } + } + } + else { + //printk("Error ! cannot detect PSU%d\n", psu_slot); + } + + return sprintf(retbuf, "N/A\n"); +} + +int32_t ipmi_get_pout_max(uint8_t idx, uint8_t *retbuf) +{ + uint8_t psu_slot = 0; + int32_t rv = 0, pout_max = 0; + + uint8_t returnData[2] = { 0 }; + uint8_t msg_data[] = { 0x06, 0x52, 0x0f, 0x00, 0x02, 0xa7 }; + + if (strstr(g_sensor_data[idx].sensor_idstring, "PSU1")) psu_slot = 1; + else psu_slot = 2; + + msg_data[3] = (psu_slot == 1) ? 0xb0 : 0xb2; + if (ipmi_check_psu_present(psu_slot)) { + mutex_lock(&ipmi_lock); + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), returnData, 1); + mutex_unlock(&ipmi_lock); + + if (rv) { + printk("BMC down at (%d)!!\n", __LINE__); + } + else { + /* MFR_POUT_MAX has 2 data format: Direct and Linear Data (see PMbus spec). + Query command is needed to tell the data format, but since we have not use PSU + whose output power is over 0x07ff (2047), just check the first 5 bits*/ + if ((returnData[1] & 0xf8) == 0) // Direct + pout_max = (returnData[1] << 8) | returnData[0]; + else // Linear Data + pout_max = (((returnData[1] & 0x07) << 8) | returnData[0]) << ((returnData[1] & 0xf8) >> 3); + return sprintf(retbuf, "%d\n", pout_max); + } + } + else { + //printk("Error ! cannot detect PSU%d\n", psu_slot); + } + + return sprintf(retbuf, "N/A\n"); +} + +void ipmi_fan_control(uint8_t cmd_data1, uint8_t cmd_data2, uint8_t *retbuf) +{ + int32_t rv = 0; + + uint8_t returnData[10] = { 0 }; + uint8_t msg_data[] = { IPMI_NETFN_TSOL, GET_FAN_INFO, cmd_data1, cmd_data2 }; /*netfn = IPMI_NETFN_TSOL; cmd = GET_FAN_INFO; */ + + mutex_lock(&ipmi_lock); + if (cmd_data1) + { + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), NULL, 0); + } + else + { + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), returnData, 1); + } + mutex_unlock(&ipmi_lock); + + if (rv) + { + printk("BMC down at (%d)!!\n", __LINE__); + sprintf(retbuf, "N/A\n"); + } + else + { + sprintf(retbuf, "%s", returnData); + } +} + +static ssize_t show_label(struct device *dev, struct device_attribute *devattr, + char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return sprintf(buf, "%s\n", + g_sensor_data[attr->index + DEBUGUSE_SHIFT].sensor_idstring); +} + +static ssize_t show_crit_alarm(struct device *dev, + struct device_attribute *devattr, char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return sprintf(buf, "%d\n", attr->index); +} + +static ssize_t show_input(struct device *dev, struct device_attribute *devattr, + char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + int32_t rv = 0; + + uint8_t returnData[4] = ""; + uint8_t msg_data[] = { IPMI_NETFN_SE, GET_SENSOR_READING, 0x00 }; /*netfn = IPMI_NETFN_SE; cmd = GET_SENSOR_READING; */ + + mutex_lock(&ipmi_lock); + msg_data[2] = g_sensor_data[attr->index + DEBUGUSE_SHIFT].addr; + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), returnData, 1); + mutex_unlock(&ipmi_lock); + + if (rv) + { + printk("BMC down at (%d)!!\n", __LINE__); + return sprintf(buf, "0.0\n"); + } + else + { + return ipmi_sdr_parsing_value(attr->index + DEBUGUSE_SHIFT, returnData[0], buf); + } +} + +static ssize_t show_lnr(struct device *dev, struct device_attribute *devattr, + char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return ipmi_sdr_parsing_value(attr->index + DEBUGUSE_SHIFT, + g_sensor_data[attr->index + DEBUGUSE_SHIFT].lowerinfo.lnr, buf); +} + +static ssize_t show_lcr(struct device *dev, struct device_attribute *devattr, + char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return ipmi_sdr_parsing_value(attr->index + DEBUGUSE_SHIFT, + g_sensor_data[attr->index + DEBUGUSE_SHIFT].lowerinfo.lcr, buf); +} + +static ssize_t show_lnc(struct device *dev, struct device_attribute *devattr, + char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return ipmi_sdr_parsing_value(attr->index + DEBUGUSE_SHIFT, + g_sensor_data[attr->index + DEBUGUSE_SHIFT].lowerinfo.lnc, buf); +} + +static ssize_t show_unr(struct device *dev, struct device_attribute *devattr, + char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return ipmi_sdr_parsing_value(attr->index + DEBUGUSE_SHIFT, + g_sensor_data[attr->index + DEBUGUSE_SHIFT].upperinfo.unr, buf); +} + +static ssize_t show_ucr(struct device *dev, struct device_attribute *devattr, + char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return ipmi_sdr_parsing_value(attr->index + DEBUGUSE_SHIFT, + g_sensor_data[attr->index + DEBUGUSE_SHIFT].upperinfo.ucr, buf); +} + +static ssize_t show_unc(struct device *dev, struct device_attribute *devattr, + char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return ipmi_sdr_parsing_value(attr->index + DEBUGUSE_SHIFT, + g_sensor_data[attr->index + DEBUGUSE_SHIFT].upperinfo.unc, buf); +} + +static ssize_t show_model(struct device *dev, struct device_attribute *devattr, + char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return ipmi_get_psu_info(attr->index + DEBUGUSE_SHIFT, 0x9a, buf); +} + +static ssize_t show_sn(struct device *dev, struct device_attribute *devattr, + char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return ipmi_get_psu_info(attr->index + DEBUGUSE_SHIFT, 0x9e, buf); +} + +static ssize_t show_mfrid(struct device *dev, struct device_attribute *devattr, + char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return ipmi_get_psu_info(attr->index + DEBUGUSE_SHIFT, 0x99, buf); +} + +static ssize_t show_vin_type(struct device *dev, struct device_attribute *devattr, char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return ipmi_get_vin_type(attr->index + DEBUGUSE_SHIFT, buf); +} + +static ssize_t show_pout_max(struct device *dev, struct device_attribute *devattr, char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return ipmi_get_pout_max(attr->index + DEBUGUSE_SHIFT, buf); +} + +static ssize_t show_pwm(struct device *dev, struct device_attribute *devattr, + char *buf) +{ + uint8_t returnData[10] = { 0 }; + ipmi_fan_control(0x00, 0x00, returnData); + return sprintf(buf, "%d\n", returnData[0]); +} + +static ssize_t store_pwm(struct device *dev, struct device_attribute *devattr, + const char *buf, size_t count) +{ + uint8_t store_input = 0; + uint8_t returnData[10] = { 0 }; + simple_atoi(buf, &store_input); + if (g_fan_control_mode == 1) + { + ipmi_fan_control(0x01, store_input, returnData); + } + + return count; +} + +static ssize_t show_controlmode(struct device *dev, + struct device_attribute *devattr, char *buf) +{ + return sprintf(buf, "%d\n", g_fan_control_mode); +} + +static ssize_t store_controlmode(struct device *dev, + struct device_attribute *devattr, const char *buf, size_t count) +{ + uint8_t store_input = 0; + uint8_t returnData[10] = { 0 }; + simple_atoi(buf, &store_input); + g_fan_control_mode = store_input; + if (g_fan_control_mode == 3) + { + ipmi_fan_control(0x7f, 0xff, returnData); + } + + return count; +} + +static ssize_t show_direction(struct device *dev, + struct device_attribute *devattr, char *buf) +{ + int32_t rv = 0; + + uint8_t returnData[10] = { 0 }; + uint8_t msg_data[] = { IPMI_NETFN_STORAGE, GET_FRU_INFO, 0x00, 0x19, 0x00, 0x01 }; /*netfn = IPMI_NETFN_STORAGE; cmd = GET_FRU_INFO; */ + + mutex_lock(&ipmi_lock); + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), returnData, 1); + mutex_unlock(&ipmi_lock); + + if (rv) + { + printk("BMC down at (%d)!!\n", __LINE__); + return sprintf(buf, "N/A\n"); + } + else + { + return sprintf(buf, "%c\n", returnData[1]); + } +} + +static ssize_t show_fanpresent(struct device *dev, + struct device_attribute *devattr, char *buf) +{ + int32_t rv = 0; + int32_t fan_idx = 0, fan_present = 0; + + uint8_t returnData[10] = { 0 }; + uint8_t msg_data[] = { 0x36, 0xB9, 0x4C, 0x1C, 0x00, 0x02 }; /*netfn = 0x36; cmd = 0xB9; */ + + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + + fan_idx = (g_sensor_data[attr->index].sensor_idstring[8] - '0') - 1; + + mutex_lock(&ipmi_lock); + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), returnData, 1); + mutex_unlock(&ipmi_lock); + + fan_present = ((returnData[0] >> fan_idx) & 0x1) ? 0 : 1; + + return sprintf(buf, "%d\n", fan_present); +} + +static ssize_t show_psupresent(struct device *dev, + struct device_attribute *devattr, char *buf) +{ + int32_t psu_idx = 0; + + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + + psu_idx = g_sensor_data[attr->index].sensor_idstring[3] - '0'; + + return sprintf(buf, "%d\n", ipmi_check_psu_present(psu_idx)); +} + +static ssize_t(*const attr_show_func_ptr[SENSOR_ATTR_MAX])(struct device *dev, + struct device_attribute *devattr, char *buf) = +{ + show_label, show_crit_alarm, show_input + , show_lnc, show_lcr, show_lnr + , show_unc, show_ucr, show_unr + , show_model, show_sn, show_pwm + , show_controlmode, show_direction, show_fanpresent + , show_psupresent, show_mfrid, show_vin_type + , show_pout_max +}; + +static ssize_t(*const attr_store_func_ptr[SENSOR_ATTR_MAX])(struct device *dev, + struct device_attribute *devattr, const char *buf, size_t count) = +{ + NULL, NULL, NULL + , NULL, NULL, NULL + , NULL, NULL, NULL + , NULL, NULL, store_pwm + , store_controlmode, NULL, NULL + , NULL, NULL, NULL + , NULL +}; + +static const char *const sensor_attrnames[SENSOR_ATTR_MAX] = +{ + "%s%d_label", "%s%d_crit_alarm", "%s%d_input" + , "%s%d_lncrit", "%s%d_lcrit", "%s%d_min" + , "%s%d_ncrit", "%s%d_crit", "%s%d_max" + , "%s%d_model", "%s%d_sn", "%s%d_pwm" + , "%s%d_controlmode", "%s%d_direction", "%s%d_present" + , "%s%d_present", "%s%d_mfrid", "%s%d_vin_type" + , "%s%d_pout_max" +}; + +static int32_t create_sensor_attrs(int32_t attr_no) +{ + int32_t i = 0, j = 0; + + struct attr_info *attrdata = &g_sensor_data[attr_no].attrinfo; + +#if enable_debug_msg + printk("##### %s:%d attr_no %d\n", __FUNCTION__, __LINE__, attr_no); +#endif + + for (i = 0; i < SENSOR_ATTR_MAX; i++) + { + if ((g_sensor_data[attr_no].capability >> i) & 0x01) + { + snprintf(attrdata->attr_name[j], SENSOR_ATTR_NAME_LENGTH, sensor_attrnames[i], + attrdata->attr_type_str, attr_no - DEBUGUSE_SHIFT); + + sysfs_attr_init(&attrdata->sd_attrs[j].dev_attr.attr); + attrdata->sd_attrs[j].dev_attr.attr.name = attrdata->attr_name[j]; + attrdata->sd_attrs[j].dev_attr.show = attr_show_func_ptr[i]; + attrdata->sd_attrs[j].dev_attr.store = attr_store_func_ptr[i]; + + attrdata->sd_attrs[j].dev_attr.attr.mode = S_IRUGO; + if (attrdata->sd_attrs[j].dev_attr.store) + { + attrdata->sd_attrs[j].dev_attr.attr.mode |= S_IWUSR; + } + + attrdata->sd_attrs[j].index = attr_no - DEBUGUSE_SHIFT; + attrdata->attrs[j] = &attrdata->sd_attrs[j].dev_attr.attr; + j++; + + data->total_create_sysfs++; + } + } + + attrdata->attrs[j] = NULL; + attrdata->attr_group.attrs = attrdata->attrs; + + g_sensor_data[attr_no].attrinfo.attr_exist = 1; + + return sysfs_create_group(&data->ipmi_hwmon_dev->kobj, &attrdata->attr_group); +} + +static int32_t remove_sensor_attrs(void) +{ + int32_t i = 0; + + for (i = 0; i < data->total_sensor_id; i++) + { + if (g_sensor_data[i].attrinfo.attr_exist) + { + sysfs_remove_group(&data->ipmi_hwmon_dev->kobj, + &g_sensor_data[i].attrinfo.attr_group); + } + } + return 0; +} + +int32_t ipmi_init_sdr_sensors_data(void) +{ + int32_t sdr_idx = 0; + int32_t err = 0; + + struct ipmi_sdr_iterator *itr = NULL; + struct sdr_get_rs *header = NULL; + + uint8_t *rec = NULL; + + mutex_lock(&ipmi_lock); + + itr = kzalloc(sizeof(struct ipmi_sdr_iterator), GFP_KERNEL); + if (itr == NULL) + { + printk("%s(%d): kzalloc failure.\n", __func__, __LINE__); + goto itr_malloc_fail; + } + + header = kzalloc(sizeof(struct sdr_get_rs), GFP_KERNEL); + if (header == NULL) + { + printk("%s(%d): malloc failure.\n", __func__, __LINE__); + goto header_malloc_fail; + } + + err = ipmi_sdr_start(itr); + if (err) + { + printk("%s(%d): ipmi_sdr_start fail.\n", __func__, __LINE__); + goto ipmi_sdr_start_fail; + } + + data->total_sensor_id = itr->total; + rec = kzalloc(GET_SDR_ENTIRE_RECORD, GFP_KERNEL); + if (rec == NULL) + { + printk("%s(%d): kzalloc failure\n", __func__, __LINE__); + goto rec_malloc_fail; + } + + g_sensor_data = kzalloc(itr->total * sizeof(struct ipmi_sensor_data), + GFP_KERNEL); + if (g_sensor_data == NULL) + { + printk("%s(%d): malloc failure", __func__, __LINE__); + goto g_sensor_data_malloc_fail; + } + + memset(g_sensor_data, 0x0, itr->total * sizeof(struct ipmi_sensor_data)); + + for (sdr_idx = 0; sdr_idx < itr->total; sdr_idx++) + { + err = ipmi_sdr_get_header(itr, header); + if (err) + { + if (err == 0xC5) + { + /* C5h : Reservation Invalid */ +#if enable_debug_msg + printk("ipmi: reservation number given was invalid or the reservation was lost\n"); + printk("ipmi: retry\n"); +#endif + ipmi_sdr_get_reservation(&(itr->reservation)); + sdr_idx--; + continue; + } + printk("ipmi: Get SDR header fail,so break this request\n"); + goto ipmi_sdr_get_header_fail; + } + + + memset(rec, 0, GET_SDR_ENTIRE_RECORD); + err = ipmi_sdr_get_record(header, itr, rec); + if (err) + { + if (err == 0xC5) + { + /* C5h : Reservation Invalid */ +#if enable_debug_msg + printk("ipmi: reservation number given was invalid or the reservation was lost\n"); + printk("ipmi: retry\n"); +#endif + ipmi_sdr_get_reservation(&(itr->reservation)); + sdr_idx--; + continue; + } + printk("ipmi: Get SDR header fail,so break this request\n"); + goto ipmi_sdr_get_record_fail; + } + + itr->next = header->next; + + switch (header->type) + { + case SDR_RECORD_TYPE_FULL_SENSOR: + /* prepare (threshold, factor)data whilie init, for reduce reading step and improve operate speed */ + g_sensor_data[sdr_idx].addr = rec[2]; + g_sensor_data[sdr_idx].capability = + SENSOR_GET_CAP_LABEL /*| SENSOR_GET_CAP_ALARM */ | SENSOR_GET_CAP_INPUT; + g_sensor_data[sdr_idx].headerinfo.header_type = header->type; + g_sensor_data[sdr_idx].headerinfo.header_byte = header->length; + + ipmi_sdr_set_sensor_threshold(sdr_idx, (struct sdr_record_full_sensor *) rec); + ipmi_sdr_set_sensor_factor(sdr_idx, (struct sdr_record_full_sensor *) rec); + + if (sdr_idx >= DEBUGUSE_SHIFT) + { + err = create_sensor_attrs(sdr_idx); + if (err) + { + g_sensor_data[sdr_idx].attrinfo.attr_exist = 0; + printk("[err : %d]sysfs_create_group fail in [%d] %s\n", err, sdr_idx, + g_sensor_data[sdr_idx].sensor_idstring); + goto create_sysfs_fail; + } + } + + data->total_suport_sensor++; + + break; + case SDR_RECORD_TYPE_COMPACT_SENSOR: /* not supporrt now */ + case SDR_RECORD_TYPE_EVENTONLY_SENSOR: /* not supporrt now */ + case SDR_RECORD_TYPE_MC_DEVICE_LOCATOR: /* not supporrt now */ + default: + g_sensor_data[sdr_idx].attrinfo.attr_exist = 0; +#if enable_debug_msg + printk("ID[%d] : not support type [%d]\n", sdr_idx, header->type); +#endif + break; + } + } + + printk("quanta_hwmon_ipmi : detected [%d] sensor, create [%d] sysfs\n", + data->total_suport_sensor, data->total_create_sysfs); + +create_sysfs_fail: +ipmi_sdr_get_header_fail: +ipmi_sdr_get_record_fail: +g_sensor_data_malloc_fail: + if (header) + { + kfree(header); + header = NULL; + } + if (rec) + { + kfree(rec); + rec = NULL; + } + +rec_malloc_fail: +ipmi_sdr_start_fail: +header_malloc_fail: + if (itr) + { + kfree(itr); + itr = NULL; + } + +itr_malloc_fail: + mutex_unlock(&ipmi_lock); + + return err; +} + +static int32_t __init quanta_hwmon_ipmi_init(void) +{ + int32_t err = 0; + + init_completion(&g_read_complete); + + data = kzalloc(sizeof(struct quanta_hwmon_ipmi_data), GFP_KERNEL); + if (NULL == data) + { + printk("alloc data fail\n"); + goto alloc_err; + } + + data->ipmi_platform_dev = platform_device_register_simple(DRVNAME, -1, NULL, 0); + err = IS_ERR(data->ipmi_platform_dev); + if (err) + { + printk("platform device register fail (err : %d)\n", err); + goto device_reg_err; + } + + data->ipmi_hwmon_dev = hwmon_device_register_with_groups(NULL, DRVNAME, NULL, + NULL); + err = IS_ERR(data->ipmi_hwmon_dev); + if (err) + { + printk("hwmon register fail\n"); + goto hwmon_register_err; + } + + err = ipmi_create_user(0, &ipmi_hndlrs, NULL, &ipmi_mh_user); + if (err) + { + printk("warning: create user fail, watchdog broken (err : %d)\n", err); + goto ipmi_create_err; + } + + mutex_init(&ipmi_lock); + err = ipmi_init_sdr_sensors_data(); + if (err) + { + printk("init sensor data fail (err : %d)\n", err); + goto init_sensor_err; + } + + return 0; + +init_sensor_err: + if (g_sensor_data) + { + kfree(g_sensor_data); + g_sensor_data = NULL; + } +ipmi_create_err: + hwmon_device_unregister(data->ipmi_hwmon_dev); +hwmon_register_err: + platform_device_unregister(data->ipmi_platform_dev); +device_reg_err: + if (data) + { + kfree(data); + data = NULL; + } +alloc_err: + return err; +} + +static void __exit quanta_hwmon_ipmi_exit(void) +{ + remove_sensor_attrs(); + hwmon_device_unregister(data->ipmi_hwmon_dev); + + mutex_lock(&ipmi_lock); + ipmi_destroy_user(ipmi_mh_user); + mutex_unlock(&ipmi_lock); + + platform_device_unregister(data->ipmi_platform_dev); + + if (g_sensor_data) + { + kfree(g_sensor_data); + g_sensor_data = NULL; + } + + if (data) + { + kfree(data); + data = NULL; + } +} + +module_init(quanta_hwmon_ipmi_init); +module_exit(quanta_hwmon_ipmi_exit); + +MODULE_AUTHOR("Charcar~~Charcar~Charlie li li"); +MODULE_VERSION("2.0"); +MODULE_DESCRIPTION("Quanta BMC hardware monitor driver"); +MODULE_LICENSE("GPL"); diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix7-bwde-32x/modules/quanta_platform_ix7_bwde.c b/platform/broadcom/sonic-platform-modules-quanta/ix7-bwde-32x/modules/quanta_platform_ix7_bwde.c new file mode 100644 index 000000000000..4658cee28583 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix7-bwde-32x/modules/quanta_platform_ix7_bwde.c @@ -0,0 +1,303 @@ +/* + * Quanta IX7-bwde platform driver + * + * + * Copyright (C) 2014 Quanta Computer inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,16,0)) +#include +#else +#include +#endif + +//MB Board Data +static struct pca953x_platform_data pca9555_1_data = { + .gpio_base = 0x10, +}; +//CPU Board pca9555 +static struct pca953x_platform_data pca9555_CPU_data = { + .gpio_base = 0x20, +}; + +static struct i2c_board_info ix7_bwde_i2c_devices[] = { + { + I2C_BOARD_INFO("pca9546", 0x72), // 0 + }, + { + I2C_BOARD_INFO("pca9548", 0x77), // 1 + }, + { + I2C_BOARD_INFO("24c02", 0x54), // 2 0x72 ch2 eeprom + }, + { + I2C_BOARD_INFO("pca9548", 0x73), // 3 0x77 ch0 + }, + { + I2C_BOARD_INFO("pca9548", 0x73), // 4 0x77 ch1 + }, + { + I2C_BOARD_INFO("pca9548", 0x73), // 5 0x77 ch2 + }, + { + I2C_BOARD_INFO("pca9548", 0x73), // 6 0x77 ch3 + }, + { + I2C_BOARD_INFO("pca9555", 0x23), // 7 0x72 ch3 pca9555 MB Board Data + .platform_data = &pca9555_1_data, + }, + { + I2C_BOARD_INFO("CPLD-QSFP28", 0x38), // 8 0x72 ch0 + }, + { + I2C_BOARD_INFO("CPLD-QSFP28", 0x38), // 9 0x72 ch1 + }, + { + I2C_BOARD_INFO("pca9555", 0x22), // 10 0x71 ch0 CPU Board Data + .platform_data = &pca9555_CPU_data, + }, + { + I2C_BOARD_INFO("optoe1", 0x50), // 11 0x50 QSFP EEPROM + }, + { + I2C_BOARD_INFO("CPLDLED_IX7_BWDE", 0x39), // 12 0x72 ch0 CPLD_led_1 + }, + { + I2C_BOARD_INFO("CPLDLED_IX7_BWDE", 0x39), // 13 0x72 ch1 CPLD_led_1 + }, +}; + +static struct platform_driver ix7_bwde_platform_driver = { + .driver = { + .name = "qci-ix7-bwde", + .owner = THIS_MODULE, + }, +}; + +static struct platform_device *ix7_bwde_device; + +static struct i2c_client **g_client; +static struct i2c_client **g_client_port; +int numof_i2c_devices = 13; // num of ix7_bwde_i2c_devices - 1 (for optoe1) +int numof_ports = 32; + +static int __init ix7_bwde_platform_init(void) +{ + struct i2c_adapter *adapter; + int ret, i; + + ret = platform_driver_register(&ix7_bwde_platform_driver); + if (ret < 0) + return ret; + + /* Register platform stuff */ + ix7_bwde_device = platform_device_alloc("qci-ix7_bwde", -1); + if (!ix7_bwde_device) { + ret = -ENOMEM; + goto fail_platform_driver; + } + + ret = platform_device_add(ix7_bwde_device); + if (ret) + goto fail_platform_device; + + g_client = kmalloc(sizeof(*g_client) * numof_i2c_devices, GFP_KERNEL); + for (i = 0; i < numof_i2c_devices; i++) g_client[i] = NULL; + + g_client_port = kmalloc(sizeof(*g_client_port) * numof_ports, GFP_KERNEL); + for (i = 0; i < numof_ports; i++) g_client_port[i] = NULL; + + adapter = i2c_get_adapter(0); + if (adapter == NULL) + { + printk("[%s] get i2c adapter fail at line %d", __FUNCTION__, __LINE__); + } + else + { + g_client[0] = i2c_new_device(adapter, &ix7_bwde_i2c_devices[0]); // pca9546 + g_client[1] = i2c_new_device(adapter, &ix7_bwde_i2c_devices[1]); // pca9548 + g_client[2] = i2c_new_device(adapter, &ix7_bwde_i2c_devices[10]); // CPU Board Data + i2c_put_adapter(adapter); + } + + adapter = i2c_get_adapter(0x01); + if (adapter == NULL) + { + printk("[%s] get i2c adapter fail at line %d", __FUNCTION__, __LINE__); + } + else + { + g_client[3] = i2c_new_device(adapter, &ix7_bwde_i2c_devices[8]); // CPLD2 + g_client[4] = i2c_new_device(adapter, &ix7_bwde_i2c_devices[12]); // CPLD_led_1 + i2c_put_adapter(adapter); + } + + adapter = i2c_get_adapter(0x02); + if (adapter == NULL) + { + printk("[%s] get i2c adapter fail at line %d", __FUNCTION__, __LINE__); + } + else + { + g_client[5] = i2c_new_device(adapter, &ix7_bwde_i2c_devices[9]); // CPLD3 + g_client[6] = i2c_new_device(adapter, &ix7_bwde_i2c_devices[13]); // CPLD_led_2 + i2c_put_adapter(adapter); + } + + adapter = i2c_get_adapter(0x03); + if (adapter == NULL) + { + printk("[%s] get i2c adapter fail at line %d", __FUNCTION__, __LINE__); + } + else + { + g_client[7] = i2c_new_device(adapter, &ix7_bwde_i2c_devices[2]); // MB_BOARDINFO_EEPROM + i2c_put_adapter(adapter); + } + + adapter = i2c_get_adapter(0x04); + if (adapter == NULL) + { + printk("[%s] get i2c adapter fail at line %d", __FUNCTION__, __LINE__); + } + else + { + g_client[8] = i2c_new_device(adapter, &ix7_bwde_i2c_devices[7]); // pca9555 MB Board Data + i2c_put_adapter(adapter); + } + + adapter = i2c_get_adapter(0x05); + if (adapter == NULL) + { + printk("[%s] get i2c adapter fail at line %d", __FUNCTION__, __LINE__); + } + else + { + g_client[9] = i2c_new_device(adapter, &ix7_bwde_i2c_devices[3]); // pca9548_1 SFP + i2c_put_adapter(adapter); + } + + adapter = i2c_get_adapter(0x06); + if (adapter == NULL) + { + printk("[%s] get i2c adapter fail at line %d", __FUNCTION__, __LINE__); + } + else + { + g_client[10] = i2c_new_device(adapter, &ix7_bwde_i2c_devices[4]); // pca9548_2 SFP + i2c_put_adapter(adapter); + } + + adapter = i2c_get_adapter(0x07); + if (adapter == NULL) + { + printk("[%s] get i2c adapter fail at line %d", __FUNCTION__, __LINE__); + } + else + { + g_client[11] = i2c_new_device(adapter, &ix7_bwde_i2c_devices[5]); // pca9548_3 SFP + i2c_put_adapter(adapter); + } + + adapter = i2c_get_adapter(0x08); + if (adapter == NULL) + { + printk("[%s] get i2c adapter fail at line %d", __FUNCTION__, __LINE__); + } + else + { + g_client[12] = i2c_new_device(adapter, &ix7_bwde_i2c_devices[6]); // pca9548_4 SFP + i2c_put_adapter(adapter); + } + + for(i = 13; i < 45; i ++){ // QSFP 1~32 EEPROM + adapter = i2c_get_adapter(i); + if (adapter == NULL) + { + printk("[%s] get i2c adapter fail at line %d", __FUNCTION__, __LINE__); + } + else + { + g_client_port[i - 13] = i2c_new_device(adapter, &ix7_bwde_i2c_devices[11]); + i2c_put_adapter(adapter); + } + } + + return 0; + +fail_platform_device: + platform_device_put(ix7_bwde_device); + +fail_platform_driver: + platform_driver_unregister(&ix7_bwde_platform_driver); + return ret; +} + +static void __exit ix7_bwde_platform_exit(void) +{ + int i = 0; + + for (i = numof_ports - 1; i >= 0; i--) + { + if (g_client_port[i]) + { + i2c_unregister_device(g_client_port[i]); + g_client_port[i] = NULL; + } + } + + for (i = numof_i2c_devices - 1; i >= 0; i--) + { + if (g_client[i]) + { + i2c_unregister_device(g_client[i]); + g_client[i] = NULL; + } + } + + platform_device_unregister(ix7_bwde_device); + platform_driver_unregister(&ix7_bwde_platform_driver); +} + +module_init(ix7_bwde_platform_init); +module_exit(ix7_bwde_platform_exit); + + +MODULE_AUTHOR("Robert Hong "); +MODULE_VERSION("1.0"); +MODULE_DESCRIPTION("Quanta IX7-bwde Platform Driver"); +MODULE_LICENSE("GPL"); diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix7-bwde-32x/service/ix7-bwde-platform-init.service b/platform/broadcom/sonic-platform-modules-quanta/ix7-bwde-32x/service/ix7-bwde-platform-init.service new file mode 100644 index 000000000000..e1067d45c5b0 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix7-bwde-32x/service/ix7-bwde-platform-init.service @@ -0,0 +1,13 @@ +[Unit] +Description=Quanta IX7-BWDE-32X Platform initialization service +Before=pmon.service +DefaultDependencies=no + +[Service] +Type=oneshot +ExecStart=/usr/local/bin/quanta_ix7_bwde_util.py install +ExecStop=/usr/local/bin/quanta_ix7_bwde_util.py clean +RemainAfterExit=yes + +[Install] +WantedBy=multi-user.target diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix7-bwde-32x/setup.py b/platform/broadcom/sonic-platform-modules-quanta/ix7-bwde-32x/setup.py new file mode 100644 index 000000000000..fa6203d436ff --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix7-bwde-32x/setup.py @@ -0,0 +1,15 @@ +#!/usr/bin/env python + +import os +from setuptools import setup +os.listdir + +setup( + name='ix7_bwde_32x', + version='1.0', + description='Module to initialize Quanta IX7-BWDE-32X platforms', + + packages=['ix7_bwde_32x'], + package_dir={'ix7_bwde_32x': 'ix7-bwde-32x/classes'}, +) + diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix7-bwde-32x/sonic_platform/__init__.py b/platform/broadcom/sonic-platform-modules-quanta/ix7-bwde-32x/sonic_platform/__init__.py new file mode 100644 index 000000000000..4bfefa0fb636 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix7-bwde-32x/sonic_platform/__init__.py @@ -0,0 +1,3 @@ +__all__ = ["platform", "chassis"] +from sonic_platform import * + diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix7-bwde-32x/sonic_platform/chassis.py b/platform/broadcom/sonic-platform-modules-quanta/ix7-bwde-32x/sonic_platform/chassis.py new file mode 100644 index 000000000000..92a8c433ce80 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix7-bwde-32x/sonic_platform/chassis.py @@ -0,0 +1,210 @@ +#!/usr/bin/env python +# +# Name: chassis.py, version: 1.0 +# +# Description: Module contains the definitions of SONiC platform APIs +# + +try: + import sys + import time + from sonic_platform_base.chassis_base import ChassisBase + from sonic_platform.eeprom import Eeprom + from sonic_platform.psu import Psu + from sonic_platform.sfp import Sfp + from sonic_platform.fan import Fan + from sonic_platform.fan_drawer import FanDrawer + from sonic_platform.thermal import Thermal + +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +class Chassis(ChassisBase): + + def __init__(self): + ChassisBase.__init__(self) + self.__num_of_psus = 2 + self.__num_of_ports = 32 + self.__num_of_sfps = 0 + self.__num_of_fan_drawers = 6 + self.__fan_per_drawer = 2 + self.__num_of_thermals = 18 + self.__xcvr_presence = {} + + # Initialize EEPROM + self._eeprom = Eeprom() + + # Initialize watchdog + #self._watchdog = Watchdog() + + # Initialize FAN + fan_index = 1 + for drawer_index in range(1, self.__num_of_fan_drawers + 1): + drawer_fan_list = [] + for index in range(0, self.__fan_per_drawer): + fan = Fan(fan_index, False) + fan_index += 1 + self._fan_list.append(fan) + drawer_fan_list.append(fan) + fan_drawer = FanDrawer(drawer_index, drawer_fan_list) + self._fan_drawer_list.append(fan_drawer) + + # Initialize thermal + for index in range(1, self.__num_of_thermals + 1): + thermal = Thermal(index) + self._thermal_list.append(thermal) + + # Initialize PSU and PSU_FAN + for index in range(1, self.__num_of_psus + 1): + psu = Psu(index) + self._psu_list.append(psu) + + # Initialize SFP + for index in range(1, self.__num_of_ports + 1): + if index in range(1, self.__num_of_sfps + 1): + sfp = Sfp(index, 'SFP') + else: + sfp = Sfp(index, 'QSFP') + + self._sfp_list.append(sfp) + + for index in range(1, self.__num_of_ports + 1): + self.__xcvr_presence[index] = self._sfp_list[index-1].get_presence() + +############################################## +# Device methods +############################################## + + def get_sfp(self, index): + """ + Retrieves sfp represented by (1-based) index + For Quanta the index in sfputil.py starts from 1, so override + + Args: + index: An integer, the index (1-based) of the sfp to retrieve. + The index should be the sequence of a physical port in a chassis, + starting from 1. + + Returns: + An object dervied from SfpBase representing the specified sfp + """ + sfp = None + + try: + if (index == 0): + raise IndexError + sfp = self._sfp_list[index-1] + except IndexError: + sys.stderr.write("override: SFP index {} out of range (1-{})\n".format( + index, len(self._sfp_list))) + + return sfp + + def get_name(self): + """ + Retrieves the name of the chassis + Returns: + string: The name of the chassis + """ + return self._eeprom.modelstr() + + def get_presence(self): + """ + Retrieves the presence of the chassis + Returns: + bool: True if chassis is present, False if not + """ + return True + + def get_model(self): + """ + Retrieves the model number (or part number) of the chassis + Returns: + string: Model/part number of chassis + """ + return self._eeprom.part_number_str() + + def get_serial(self): + """ + Retrieves the serial number of the chassis + Returns: + string: Serial number of chassis + """ + return self._eeprom.serial_number_str() + + def get_status(self): + """ + Retrieves the operational status of the chassis + Returns: + bool: A boolean value, True if chassis is operating properly + False if not + """ + return True + +############################################## +# Chassis methods +############################################## + + def get_base_mac(self): + """ + Retrieves the base MAC address for the chassis + + Returns: + A string containing the MAC address in the format + 'XX:XX:XX:XX:XX:XX' + """ + return self._eeprom.base_mac_addr() + + def get_serial_number(self): + """ + Retrieves the hardware serial number for the chassis + + Returns: + A string containing the hardware serial number for this chassis. + """ + return self._eeprom.serial_number_str() + + def get_system_eeprom_info(self): + """ + Retrieves the full content of system EEPROM information for the chassis + + Returns: + A dictionary where keys are the type code defined in + OCP ONIE TlvInfo EEPROM format and values are their corresponding + values. + Ex. { '0x21':'AG9064', '0x22':'V1.0', '0x23':'AG9064-0109867821', + '0x24':'001c0f000fcd0a', '0x25':'02/03/2018 16:22:00', + '0x26':'01', '0x27':'REV01', '0x28':'AG9064-C2358-16G'} + """ + return self._eeprom.system_eeprom_info() + + def get_change_event(self, timeout=0): + """ + Currently only support transceiver change events + """ + + start_ms = time.time() * 1000 + xcvr_change_event_dict = {} + event = False + + while True: + time.sleep(0.5) + for index in range(1, self.__num_of_ports + 1): + cur_xcvr_presence = self._sfp_list[index-1].get_presence() + if cur_xcvr_presence != self.__xcvr_presence[index]: + if cur_xcvr_presence is True: + xcvr_change_event_dict[str(index)] = '1' + self.__xcvr_presence[index] = True + elif cur_xcvr_presence is False: + xcvr_change_event_dict[str(index)] = '0' + self.__xcvr_presence[index] = False + event = True + + if event is True: + return True, {'sfp':xcvr_change_event_dict} + + if timeout: + now_ms = time.time() * 1000 + if (now_ms - start_ms >= timeout): + return True, {'sfp':xcvr_change_event_dict} + diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix7-bwde-32x/sonic_platform/eeprom.py b/platform/broadcom/sonic-platform-modules-quanta/ix7-bwde-32x/sonic_platform/eeprom.py new file mode 100644 index 000000000000..d154a8a0c4a0 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix7-bwde-32x/sonic_platform/eeprom.py @@ -0,0 +1,110 @@ +#!/usr/bin/env python +# +# Name: eeprom.py, version: 1.0 +# +# Description: Module contains the definitions of SONiC platform APIs +# + +try: + from sonic_eeprom import eeprom_tlvinfo +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +class Eeprom(eeprom_tlvinfo.TlvInfoDecoder): + + def __init__(self): + self.__eeprom_path = "/sys/bus/i2c/devices/3-0054/eeprom" + super(Eeprom, self).__init__(self.__eeprom_path, 0, '', True) + self.__eeprom_tlv_dict = dict() + try: + self.__eeprom_data = self.read_eeprom() + except: + self.__eeprom_data = "N/A" + raise RuntimeError("Eeprom is not Programmed") + else: + eeprom = self.__eeprom_data + + if not self.is_valid_tlvinfo_header(eeprom): + return + + total_length = (eeprom[9] << 8) | eeprom[10] + tlv_index = self._TLV_INFO_HDR_LEN + tlv_end = self._TLV_INFO_HDR_LEN + total_length + + while (tlv_index + 2) < len(eeprom) and tlv_index < tlv_end: + if not self.is_valid_tlv(eeprom[tlv_index:]): + break + + tlv = eeprom[tlv_index:tlv_index + 2 + + eeprom[tlv_index + 1]] + code = "0x%02X" % tlv[0] + + if tlv[0] == self._TLV_CODE_VENDOR_EXT: + value = str((tlv[2] << 24) | (tlv[3] << 16) | + (tlv[4] << 8) | tlv[5]) + value += tlv[6:6 + tlv[1]].decode('ascii') + else: + value = self.decoder(None, tlv)[30:] + + self.__eeprom_tlv_dict[code] = value + if eeprom[tlv_index] == self._TLV_CODE_CRC_32: + break + + tlv_index += eeprom[tlv_index+1] + 2 + + def serial_number_str(self): + (is_valid, results) = self.get_tlv_field( + self.__eeprom_data, self._TLV_CODE_SERIAL_NUMBER) + if not is_valid: + return "N/A" + + return results[2].decode('ascii') + + def base_mac_addr(self): + (is_valid, results) = self.get_tlv_field( + self.__eeprom_data, self._TLV_CODE_MAC_BASE) + if not is_valid or results[1] != 6: + return super(TlvInfoDecoder, self).switchaddrstr(e) + + return ":".join(["{:02x}".format(T) for T in results[2]]).upper() + + def modelstr(self): + (is_valid, results) = self.get_tlv_field( + self.__eeprom_data, self._TLV_CODE_PRODUCT_NAME) + if not is_valid: + return "N/A" + + return results[2].decode('ascii') + + def part_number_str(self): + (is_valid, results) = self.get_tlv_field( + self.__eeprom_data, self._TLV_CODE_PART_NUMBER) + if not is_valid: + return "N/A" + + return results[2].decode('ascii') + + def serial_tag_str(self): + (is_valid, results) = self.get_tlv_field( + self.__eeprom_data, self._TLV_CODE_SERVICE_TAG) + if not is_valid: + return "N/A" + + return results[2].decode('ascii') + + def revision_str(self): + (is_valid, results) = self.get_tlv_field( + self.__eeprom_data, self._TLV_CODE_DEVICE_VERSION) + if not is_valid: + return "N/A" + + return results[2].decode('ascii') + + def system_eeprom_info(self): + """ + Returns a dictionary, where keys are the type code defined in + ONIE EEPROM format and values are their corresponding values + found in the system EEPROM. + """ + return self.__eeprom_tlv_dict + diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix7-bwde-32x/sonic_platform/fan.py b/platform/broadcom/sonic-platform-modules-quanta/ix7-bwde-32x/sonic_platform/fan.py new file mode 100644 index 000000000000..5567eaff9395 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix7-bwde-32x/sonic_platform/fan.py @@ -0,0 +1,220 @@ +#!/usr/bin/env python + +############################################################################# +# Quanta IX7 +# +# Module contains an implementation of SONiC Platform Base API and +# provides the FAN information +# +############################################################################# + +try: + import logging + import os + from sonic_platform_base.fan_base import FanBase +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +############### +# Global +############### +HWMON_DIR = "/sys/class/hwmon/hwmon2/" +FAN_INDEX_START = 18 +NUM_FANTRAYS = 6 +FANS_PERTRAY = 2 + +class Fan(FanBase): + """Platform-specific Fan class""" + + def __init__(self, index, is_psu_fan=False): + self.is_psu_fan = is_psu_fan + self.fan_index = index + self.psu_fan_index_mapping = { + 1:37, + 2:47, + } + self.psu_index_mapping = { + 1:39, + 2:49, + } + if self.is_psu_fan: + self.fan_presence_attr = "power{}_present".format(self.psu_index_mapping[index]) + self.fan_pwm_attr = "fan{}_pwm".format(self.psu_fan_index_mapping[index]) + self.fan_rpm_attr = "fan{}_input".format(self.psu_fan_index_mapping[index]) + self.fan_direction_attr = "fan{}_direction".format(self.psu_fan_index_mapping[index]) + else: + self.fan_presence_attr = "fan{}_present".format(FAN_INDEX_START+(index-1)) + self.fan_pwm_attr = "fan{}_pwm".format(FAN_INDEX_START+(index-1)) + self.fan_rpm_attr = "fan{}_input".format(FAN_INDEX_START+(index-1)) + self.fan_direction_attr = "fan{}_direction".format(FAN_INDEX_START+(index-1)) + + +####################### +# private function +####################### + + def __get_attr_value(self, attr_path): + + retval = 'ERR' + if (not os.path.isfile(attr_path)): + return retval + + try: + with open(attr_path, 'r') as fd: + retval = fd.read() + except Exception as error: + logging.error("Unable to open " + attr_path + " file !") + + retval = retval.rstrip(' \t\n\r') + return retval + + + #################### + # Device base + #################### + + def get_name(self): + """ + Retrieves the name of the device + + Returns: + string: The name of the device + """ + if self.is_psu_fan: + return "PSU-{}_FAN".format(self.fan_index) + else: + fantray_index = (self.fan_index-1)//FANS_PERTRAY+1 + fan_index_intray = self.fan_index - ((fantray_index-1)*FANS_PERTRAY) + return "Fantray{}_{}".format(fantray_index, fan_index_intray) + + def get_presence(self): + """ + Retrieves the presence of the device + + Returns: + bool: True if device is present, False if not + """ + attr_path = HWMON_DIR + self.fan_presence_attr + attr_rv = self.__get_attr_value(attr_path) + if (attr_rv != 'ERR'): + if (attr_rv == '1'): + return True + else: + return False + + return None + + def get_status(self): + """ + Retrieves the operational status of the device + + Returns: + A boolean value, True if device is operating properly, False if not + """ + attr_path = HWMON_DIR + self.fan_rpm_attr + attr_rv = self.__get_attr_value(attr_path) + + if (attr_rv != 'ERR' and attr_rv != '0.0'): + return True + else: + return False + + ################# + # fan base + ################# + + def get_direction(self): + """ + Retrieves the direction of fan + + Returns: + A string, either FAN_DIRECTION_INTAKE or FAN_DIRECTION_EXHAUST + depending on fan direction + """ + attr_path = HWMON_DIR + self.fan_direction_attr + attr_rv = self.__get_attr_value(attr_path) + + if attr_rv == '2': + return self.FAN_DIRECTION_INTAKE + else: + return self.FAN_DIRECTION_EXHAUST + + def get_speed(self): + """ + Retrieves the speed of fan as a percentage of full speed + + Returns: + An integer, the percentage of full fan speed, in the range 0 (off) + to 100 (full speed) + """ + attr_path = HWMON_DIR + self.fan_pwm_attr + attr_rv = self.__get_attr_value(attr_path) + + if (attr_rv != 'ERR'): + return int(float(attr_rv)) + else: + return False + + def get_speed_rpm(self): + """ + Retrieves the speed of fan in revolutions per minute (RPM) + + Returns: + An integer, speed of the fan in RPM + """ + attr_path = HWMON_DIR + self.fan_rpm_attr + attr_rv = self.__get_attr_value(attr_path) + + if (attr_rv != 'ERR'): + return int(float(attr_rv)) + else: + return False + + def get_target_speed(self): + """ + Retrieves the target (expected) speed of the fan + + Returns: + An integer, the percentage of full fan speed, in the range 0 (off) + to 100 (full speed) + """ + attr_path = HWMON_DIR + self.fan_pwm_attr + attr_rv = self.__get_attr_value(attr_path) + + if (attr_rv != 'ERR'): + return int(float(attr_rv)) + else: + return False + + def get_speed_tolerance(self): + """ + Retrieves the speed tolerance of the fan + + Returns: + An integer, the percentage of variance from target speed which is + considered tolerable + """ + return 25 + + def set_status_led(self, color): + """ + Sets the state of the fan module status LED + + Args: + color: A string representing the color with which to set the + fan module status LED + + Returns: + bool: True if status LED state is set successfully, False if not + """ + return True + + def get_status_led(self): + """ + Gets the state of the fan status LED + + Returns: + A string, one of the predefined STATUS_LED_COLOR_* strings above + """ + return None diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix7-bwde-32x/sonic_platform/fan_drawer.py b/platform/broadcom/sonic-platform-modules-quanta/ix7-bwde-32x/sonic_platform/fan_drawer.py new file mode 100644 index 000000000000..75e954576a28 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix7-bwde-32x/sonic_platform/fan_drawer.py @@ -0,0 +1,47 @@ +#!/usr/bin/env python + +############################################################################# +# Quanta +# +# Module contains an implementation of SONiC Platform Base API and +# provides the fan status which are available in the platform +# +############################################################################# + +try: + from sonic_platform_base.fan_drawer_base import FanDrawerBase +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class FanDrawer(FanDrawerBase): + + def __init__(self, index, fan_list): + FanDrawerBase.__init__(self) + + self._fan_list = fan_list + self._index = index + + def get_name(self): + """ + Retrieves the name of the device + Returns: + string: The name of the device + """ + return 'Fan {}'.format(self._index) + + def get_presence(self): + """ + Retrieves the presence of the FAN + Returns: + bool: True if FAN is present, False if not + """ + return self._fan_list[0].get_presence() + + def get_status(self): + """ + Retrieves the operational status of the device + Returns: + A boolean value, True if device is operating properly, False if not + """ + return self._fan_list[0].get_status() diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix7-bwde-32x/sonic_platform/platform.py b/platform/broadcom/sonic-platform-modules-quanta/ix7-bwde-32x/sonic_platform/platform.py new file mode 100644 index 000000000000..c4f945277f4d --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix7-bwde-32x/sonic_platform/platform.py @@ -0,0 +1,20 @@ +#!/usr/bin/env python +# +# Name: platform.py, version: 1.0 +# +# Description: Module contains the definitions of SONiC platform APIs +# + + +try: + from sonic_platform_base.platform_base import PlatformBase + from sonic_platform.chassis import Chassis +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class Platform(PlatformBase): + + def __init__(self): + PlatformBase.__init__(self) + self._chassis = Chassis() \ No newline at end of file diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix7-bwde-32x/sonic_platform/psu.py b/platform/broadcom/sonic-platform-modules-quanta/ix7-bwde-32x/sonic_platform/psu.py new file mode 100644 index 000000000000..3fcb9e979ab5 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix7-bwde-32x/sonic_platform/psu.py @@ -0,0 +1,320 @@ +#!/usr/bin/env python +# +# Name: psu.py, version: 1.0 +# +# Description: Module contains the definitions of SONiC platform APIs +# + +try: + import logging + import os + from sonic_platform_base.psu_base import PsuBase + from sonic_platform.fan import Fan +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +HWMON_DIR = "/sys/class/hwmon/hwmon2/" + + +class Psu(PsuBase): + def __init__(self, index): + PsuBase.__init__(self) + fan = Fan(index, True) + self._fan_list.append(fan) + + self.psu_index_mapping = { + 1:39, + 2:49, + } + self.psu_powerin_index_mapping = { + 1:38, + 2:48, + } + self.psu_currentout_index_mapping = { + 1:36, + 2:46, + } + self.psu_currentin_index_mapping = { + 1:35, + 2:45, + } + self.psu_voltageout_index_mapping = { + 1:44, + 2:54, + } + self.psu_voltagein_index_mapping = { + 1:43, + 2:53, + } + self.index = index + self.psu_presence_attr = "power{}_present".format(self.psu_index_mapping[self.index]) + self.psu_status_attr = "curr{}_input".format(self.psu_currentout_index_mapping[self.index]) + self.psu_power_in_attr = "power{}_input".format(self.psu_powerin_index_mapping[self.index]) + self.psu_power_out_attr = "power{}_input".format(self.psu_index_mapping[self.index]) + self.psu_voltage_out_attr = "in{}_input".format(self.psu_voltageout_index_mapping[self.index]) + self.psu_current_out_attr = "curr{}_input".format(self.psu_currentout_index_mapping[self.index]) + self.psu_voltage_in_attr = "in{}_input".format(self.psu_voltagein_index_mapping[self.index]) + self.psu_current_in_attr = "curr{}_input".format(self.psu_currentin_index_mapping[self.index]) + self.psu_serial_attr = "power{}_sn".format(self.psu_index_mapping[self.index]) + self.psu_model_attr = "power{}_model".format(self.psu_index_mapping[self.index]) + self.psu_mfr_id_attr = "power{}_mfrid".format(self.psu_index_mapping[self.index]) + self.psu_capacity_attr = "power{}_pout_max".format(self.psu_index_mapping[self.index]) + self.psu_type_attr = "power{}_vin_type".format(self.psu_index_mapping[self.index]) + + def __get_attr_value(self, attr_path): + + retval = 'ERR' + if (not os.path.isfile(attr_path)): + return retval + + try: + with open(attr_path, 'r') as fd: + retval = fd.read() + except Exception as error: + logging.error("Unable to open " + attr_path + " file !") + + retval = retval.rstrip(' \t\n\r') + fd.close() + return retval + +############################################## +# Device methods +############################################## + + def get_name(self): + """ + Retrieves the name of the device + + Returns: + string: The name of the device + """ + return "PSU{}".format(self.index) + + def get_presence(self): + """ + Retrieves the presence of the device + + Returns: + bool: True if device is present, False if not + """ + presence = False + attr_path = HWMON_DIR+self.psu_presence_attr + attr_normal = '1' + + attr_rv = self.__get_attr_value(attr_path) + if (attr_rv != 'ERR'): + if (attr_rv == attr_normal): + presence = True + + return presence + + def get_model(self): + """ + Retrieves the model number (or part number) of the device + + Returns: + string: Model/part number of device + """ + model = "N/A" + attr_path = HWMON_DIR+self.psu_model_attr + attr_rv = self.__get_attr_value(attr_path) + if (attr_rv != 'ERR'): + model = attr_rv + + return model + + def get_mfr_id(self): + """ + Retrieves the manufacturer's name (or id) of the device + + Returns: + string: Manufacturer's id of device + """ + mfr_id = "N/A" + attr_path = HWMON_DIR+self.psu_mfr_id_attr + attr_rv = self.__get_attr_value(attr_path) + if (attr_rv != 'ERR'): + mfr_id = attr_rv + + return mfr_id + + def get_serial(self): + """ + Retrieves the serial number of the device + + Returns: + string: Serial number of device + """ + serial = "N/A" + attr_path = HWMON_DIR+self.psu_serial_attr + + attr_rv = self.__get_attr_value(attr_path) + if (attr_rv != 'ERR'): + serial = attr_rv + + return serial + + def get_status(self): + """ + Retrieves the operational status of the device + + Returns: + A boolean value, True if device is operating properly, False if not + """ + status = False + attr_path = HWMON_DIR+self.psu_status_attr + + attr_rv = self.__get_attr_value(attr_path) + if (attr_rv != 'ERR'): + attr_rv, dummy = attr_rv.split('.', 1) + if (int(attr_rv) != 0): + status = True + + return status + +############################################## +# PSU methods +############################################## + + def get_voltage(self): + """ + Retrieves current PSU voltage output + + Returns: + A float number, the output voltage in volts, + e.g. 12.1 + """ + voltage_out = 0.0 + attr_path = HWMON_DIR+self.psu_voltage_out_attr + + attr_rv = self.__get_attr_value(attr_path) + if (attr_rv != 'ERR'): + attr_rv, dummy = attr_rv.split('.', 1) + voltage_out = float(attr_rv) / 1000 + + return voltage_out + + def get_current(self): + """ + Retrieves present electric current supplied by PSU + + Returns: + A float number, the electric current in amperes, e.g 15.4 + """ + current_out = 0.0 + attr_path = HWMON_DIR+self.psu_current_out_attr + + attr_rv = self.__get_attr_value(attr_path) + if (attr_rv != 'ERR'): + attr_rv, dummy = attr_rv.split('.', 1) + current_out = float(attr_rv) / 1000 + + return current_out + + def get_input_voltage(self): + """ + Retrieves current PSU voltage output + + Returns: + A float number, the output voltage in volts, + e.g. 12.1 + """ + voltage_in = 0.0 + attr_path = HWMON_DIR+self.psu_voltage_in_attr + + attr_rv = self.__get_attr_value(attr_path) + if (attr_rv != 'ERR'): + attr_rv, dummy = attr_rv.split('.', 1) + voltage_in = float(attr_rv) / 1000 + + return voltage_in + + def get_input_current(self): + """ + Retrieves present electric current supplied by PSU + + Returns: + A float number, the electric current in amperes, e.g 15.4 + """ + current_in = 0.0 + attr_path = HWMON_DIR+self.psu_current_in_attr + + attr_rv = self.__get_attr_value(attr_path) + if (attr_rv != 'ERR'): + attr_rv, dummy = attr_rv.split('.', 1) + current_in = float(attr_rv) / 1000 + + return current_in + + def get_power(self): + """ + Retrieves current energy supplied by PSU + + Returns: + A float number, the power in watts, e.g. 302.6 + """ + power_out = 0.0 + attr_path = HWMON_DIR+self.psu_power_out_attr + + attr_rv = self.__get_attr_value(attr_path) + if (attr_rv != 'ERR'): + attr_rv, dummy = attr_rv.split('.', 1) + power_out = float(attr_rv) / 1000 + + return power_out + + def get_powergood_status(self): + """ + Retrieves the powergood status of PSU + + Returns: + A boolean, True if PSU has stablized its output voltages and passed all + its internal self-tests, False if not. + """ + return self.get_status() + + def get_status_led(self): + """ + Gets the state of the PSU status LED + + Returns: + A string, one of the predefined STATUS_LED_COLOR_* strings above + """ + if self.get_powergood_status(): + return self.STATUS_LED_COLOR_GREEN + else: + return self.STATUS_LED_COLOR_OFF + + def get_type(self): + """ + Gets the type of the PSU + + Returns: + A string, the type of PSU (AC/DC) + """ + type = "AC" + attr_path = HWMON_DIR+self.psu_type_attr + attr_rv = self.__get_attr_value(attr_path) + if (attr_rv != 'ERR'): + type = attr_rv + + return type + + def get_capacity(self): + """ + Gets the capacity (maximum output power) of the PSU in watts + + Returns: + An integer, the capacity of PSU + """ + capacity = 0 + attr_path = HWMON_DIR+self.psu_capacity_attr + attr_rv = self.__get_attr_value(attr_path) + if (attr_rv != 'ERR'): + try: + capacity = int(attr_rv) + except ValueError: + capacity = 0 + + return capacity + diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix7-bwde-32x/sonic_platform/sfp.py b/platform/broadcom/sonic-platform-modules-quanta/ix7-bwde-32x/sonic_platform/sfp.py new file mode 100644 index 000000000000..d06ae5cabed7 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix7-bwde-32x/sonic_platform/sfp.py @@ -0,0 +1,1596 @@ +#!/usr/bin/env python + +############################################################################# +# Quanta +# +# Sfp contains an implementation of SONiC Platform Base API and +# provides the sfp device status which are available in the platform +# +############################################################################# + +import os +import time +#import subprocess +#import sonic_device_util +from ctypes import create_string_buffer + +try: + from sonic_platform_base.sfp_base import SfpBase +# from sonic_platform_base.sonic_eeprom import eeprom_dts + from sonic_platform_base.sonic_sfp.sff8472 import sff8472InterfaceId + from sonic_platform_base.sonic_sfp.sff8472 import sff8472Dom + from sonic_platform_base.sonic_sfp.sff8436 import sff8436InterfaceId + from sonic_platform_base.sonic_sfp.sff8436 import sff8436Dom + from sonic_platform_base.sonic_sfp.sfputilhelper import SfpUtilHelper +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +QSFP_INFO_OFFSET = 128 +QSFP_DOM_OFFSET = 0 +SFP_INFO_OFFSET = 0 +SFP_DOM_OFFSET = 256 + +# definitions of the offset and width for values in XCVR info eeprom +XCVR_INTFACE_BULK_OFFSET = 0 +XCVR_INTFACE_BULK_WIDTH_QSFP = 20 +XCVR_INTFACE_BULK_WIDTH_SFP = 21 +XCVR_TYPE_OFFSET = 0 +XCVR_TYPE_WIDTH = 1 +XCVR_EXT_TYPE_OFFSET = 1 +XCVR_EXT_TYPE_WIDTH = 1 +XCVR_CONNECTOR_OFFSET = 2 +XCVR_CONNECTOR_WIDTH = 1 +XCVR_COMPLIANCE_CODE_OFFSET = 3 +XCVR_COMPLIANCE_CODE_WIDTH = 8 +XCVR_ENCODING_OFFSET = 11 +XCVR_ENCODING_WIDTH = 1 +XCVR_NBR_OFFSET = 12 +XCVR_NBR_WIDTH = 1 +XCVR_EXT_RATE_SEL_OFFSET = 13 +XCVR_EXT_RATE_SEL_WIDTH = 1 +XCVR_CABLE_LENGTH_OFFSET = 14 +XCVR_CABLE_LENGTH_WIDTH_QSFP = 5 +XCVR_CABLE_LENGTH_WIDTH_SFP = 6 +XCVR_VENDOR_NAME_OFFSET = 20 +XCVR_VENDOR_NAME_WIDTH = 16 +XCVR_VENDOR_OUI_OFFSET = 37 +XCVR_VENDOR_OUI_WIDTH = 3 +XCVR_VENDOR_PN_OFFSET = 40 +XCVR_VENDOR_PN_WIDTH = 16 +XCVR_HW_REV_OFFSET = 56 +XCVR_HW_REV_WIDTH_QSFP = 2 +XCVR_HW_REV_WIDTH_SFP = 4 +XCVR_VENDOR_SN_OFFSET = 68 +XCVR_VENDOR_SN_WIDTH = 16 +XCVR_VENDOR_DATE_OFFSET = 84 +XCVR_VENDOR_DATE_WIDTH = 8 +XCVR_DOM_CAPABILITY_OFFSET = 92 +XCVR_DOM_CAPABILITY_WIDTH = 2 + +XCVR_INTERFACE_DATA_START = 0 +XCVR_INTERFACE_DATA_SIZE = 92 + +QSFP_DOM_BULK_DATA_START = 22 +QSFP_DOM_BULK_DATA_SIZE = 36 +SFP_DOM_BULK_DATA_START = 96 +SFP_DOM_BULK_DATA_SIZE = 10 + +# Offset for values in QSFP eeprom +QSFP_DOM_REV_OFFSET = 1 +QSFP_DOM_REV_WIDTH = 1 +QSFP_TEMPE_OFFSET = 22 +QSFP_TEMPE_WIDTH = 2 +QSFP_VOLT_OFFSET = 26 +QSFP_VOLT_WIDTH = 2 +QSFP_VERSION_COMPLIANCE_OFFSET = 1 +QSFP_VERSION_COMPLIANCE_WIDTH = 1 +QSFP_CHANNL_MON_OFFSET = 34 +QSFP_CHANNL_MON_WIDTH = 16 +QSFP_CHANNL_MON_WITH_TX_POWER_WIDTH = 24 +QSFP_CHANNL_DISABLE_STATUS_OFFSET = 86 +QSFP_CHANNL_DISABLE_STATUS_WIDTH = 1 +QSFP_CHANNL_RX_LOS_STATUS_OFFSET = 3 +QSFP_CHANNL_RX_LOS_STATUS_WIDTH = 1 +QSFP_CHANNL_TX_FAULT_STATUS_OFFSET = 4 +QSFP_CHANNL_TX_FAULT_STATUS_WIDTH = 1 +QSFP_CONTROL_OFFSET = 86 +QSFP_CONTROL_WIDTH = 8 +QSFP_MODULE_MONITOR_OFFSET = 0 +QSFP_MODULE_MONITOR_WIDTH = 9 +QSFP_MODULE_THRESHOLD_OFFSET = 512 +QSFP_MODULE_THRESHOLD_WIDTH = 24 +QSFP_CHANNEL_THRESHOLD_OFFSET = 560 +QSFP_CHANNEL_THRESHOLD_WIDTH = 16 +QSFP_POWEROVERRIDE_OFFSET = 93 +QSFP_POWEROVERRIDE_WIDTH = 1 +QSFP_POWEROVERRIDE_BIT = 0 +QSFP_POWERSET_BIT = 1 +QSFP_OPTION_VALUE_OFFSET = 192 +QSFP_OPTION_VALUE_WIDTH = 4 + +SFP_TEMPE_OFFSET = 96 +SFP_TEMPE_WIDTH = 2 +SFP_VOLT_OFFSET = 98 +SFP_VOLT_WIDTH = 2 +SFP_CHANNL_MON_OFFSET = 100 +SFP_CHANNL_MON_WIDTH = 6 +SFP_MODULE_THRESHOLD_OFFSET = 0 +SFP_MODULE_THRESHOLD_WIDTH = 40 +SFP_CHANNL_THRESHOLD_OFFSET = 112 +SFP_CHANNL_THRESHOLD_WIDTH = 2 +SFP_STATUS_CONTROL_OFFSET = 110 +SFP_STATUS_CONTROL_WIDTH = 1 +SFP_TX_DISABLE_HARD_BIT = 7 +SFP_TX_DISABLE_SOFT_BIT = 6 + +qsfp_cable_length_tup = ('Length(km)', 'Length OM3(2m)', + 'Length OM2(m)', 'Length OM1(m)', + 'Length Cable Assembly(m)') + +sfp_cable_length_tup = ('LengthSMFkm-UnitsOfKm', 'LengthSMF(UnitsOf100m)', + 'Length50um(UnitsOf10m)', 'Length62.5um(UnitsOfm)', + 'LengthCable(UnitsOfm)', 'LengthOM3(UnitsOf10m)') + +sfp_compliance_code_tup = ('10GEthernetComplianceCode', 'InfinibandComplianceCode', + 'ESCONComplianceCodes', 'SONETComplianceCodes', + 'EthernetComplianceCodes','FibreChannelLinkLength', + 'FibreChannelTechnology', 'SFP+CableTechnology', + 'FibreChannelTransmissionMedia','FibreChannelSpeed') + +qsfp_compliance_code_tup = ('10/40G Ethernet Compliance Code', 'SONET Compliance codes', + 'SAS/SATA compliance codes', 'Gigabit Ethernet Compliant codes', + 'Fibre Channel link length/Transmitter Technology', + 'Fibre Channel transmission media', 'Fibre Channel Speed') + +SFP_TYPE = "SFP" +QSFP_TYPE = "QSFP" + + +class Sfp(SfpBase): + """Platform-specific Sfp class""" + + # Port number + PORT_START = 1 + PORT_END = 32 + QSFP_START = 1 + QSFP_END = 32 + + dom_supported = True + dom_temp_supported = True + dom_volt_supported = True + dom_rx_power_supported = True + dom_tx_power_supported = True + dom_tx_disable_supported = True + calibration = 1 + + # Path to QSFP sysfs + PLATFORM_ROOT_PATH = "/usr/share/sonic/device" + PMON_HWSKU_PATH = "/usr/share/sonic/hwsku" + HOST_CHK_CMD = "docker > /dev/null 2>&1" + + PLATFORM = "x86_64-quanta_ix7_bwde-r0" + HWSKU = "Quanta-IX7-BWDE-32X" + + def __init__(self, sfp_index, sfp_type): + # Init index + self.index = sfp_index + self.port_num = self.index + #self.dom_supported = False + self.sfp_type = sfp_type + self.lpmode_path = "/sys/class/cpld-qsfp28/port-"+str(self.port_num)+"/lpmode" + self.reset_path = "/sys/class/cpld-qsfp28/port-"+str(self.port_num)+"/reset" + # Init eeprom path + eeprom_path = '/sys/bus/i2c/devices/i2c-{0}/{0}-0050/eeprom' + self.port_to_eeprom_mapping = {} + self.port_to_i2c_mapping = { + 1 : 13, + 2 : 14, + 3 : 15, + 4 : 16, + 5 : 17, + 6 : 18, + 7 : 19, + 8 : 20, + 9 : 21, + 10 : 22, + 11 : 23, + 12 : 24, + 13 : 25, + 14 : 26, + 15 : 27, + 16 : 28, + 17 : 29, + 18 : 30, + 19 : 31, + 20 : 32, + 21 : 33, + 22 : 34, + 23 : 35, + 24 : 36, + 25 : 37, + 26 : 38, + 27 : 39, + 28 : 40, + 29 : 41, + 30 : 42, + 31 : 43, + 32 : 44 + } + + for x in range(self.PORT_START, self.PORT_END + 1): + port_eeprom_path = eeprom_path.format(self.port_to_i2c_mapping[x]) + self.port_to_eeprom_mapping[x] = port_eeprom_path + + self.info_dict_keys = ['type', 'hardware_rev', 'serial', 'manufacturer', + 'model', 'connector', 'encoding', 'ext_identifier', + 'ext_rateselect_compliance', 'cable_type', 'cable_length', + 'nominal_bit_rate', 'specification_compliance', 'vendor_date', + 'application_advertisement', 'vendor_oui'] + + self.dom_dict_keys = ['rx_los', 'tx_fault', 'reset_status', 'power_lpmode', + 'tx_disable', 'tx_disable_channel', 'temperature', 'voltage', + 'rx1power', 'rx2power', 'rx3power', 'rx4power', 'tx1bias', 'tx2bias', + 'tx3bias', 'tx4bias', 'tx1power', 'tx2power', 'tx3power', 'tx4power'] + + self.threshold_dict_keys = ['temphighalarm', 'temphighwarning', + 'templowalarm', 'templowwarning', 'vcchighalarm', 'vcchighwarning', + 'vcclowalarm', 'vcclowwarning', 'rxpowerhighalarm', 'rxpowerhighwarning', + 'rxpowerlowalarm', 'rxpowerlowwarning', 'txpowerhighalarm', + 'txpowerhighwarning', 'txpowerlowalarm', 'txpowerlowwarning', + 'txbiashighalarm', 'txbiashighwarning', 'txbiaslowalarm', 'txbiaslowwarning'] + + SfpBase.__init__(self) + + + def _convert_string_to_num(self, value_str): + if "-inf" in value_str: + return 'N/A' + elif "Unknown" in value_str: + return 'N/A' + elif 'dBm' in value_str: + t_str = value_str.rstrip('dBm') + return float(t_str) + elif 'mA' in value_str: + t_str = value_str.rstrip('mA') + return float(t_str) + elif 'C' in value_str: + t_str = value_str.rstrip('C') + return float(t_str) + elif 'Volts' in value_str: + t_str = value_str.rstrip('Volts') + return float(t_str) + else: + return 'N/A' + + def __read_txt_file(self, file_path): + try: + with open(file_path, 'r') as fd: + data = fd.read() + return data.strip() + except IOError: + pass + return "" + + def __is_host(self): + return os.system(self.HOST_CHK_CMD) == 0 + + def __get_path_to_port_config_file(self): + platform_path = "/".join([self.PLATFORM_ROOT_PATH, self.PLATFORM]) + hwsku_path = "/".join([platform_path, self.HWSKU] + ) if self.__is_host() else self.PMON_HWSKU_PATH + return "/".join([hwsku_path, "port_config.ini"]) + + def get_presence(self): + """ + Retrieves the presence of the SFP module + Returns: + bool: True if SFP module is present, False if not + """ + # Check for invalid port_num + if self.port_num < self.PORT_START or self.port_num > self.PORT_END: + return False + + try: + reg_file = open("/sys/class/cpld-qsfp28/port-"+str(self.port_num)+"/module_present") + except IOError as e: + print("Error: unable to open file: %s" % str(e)) + return False + + reg_value = reg_file.readline().rstrip() + reg_file.close() + if reg_value == '1': + return True + + return False + + def __read_eeprom_specific_bytes(self, offset, num_bytes): + sysfsfile_eeprom = None + eeprom_raw = [] + for i in range(0, num_bytes): + eeprom_raw.append("0x00") + + sysfs_sfp_i2c_client_eeprom_path = self.port_to_eeprom_mapping[self.port_num] + try: + sysfsfile_eeprom = open( + sysfs_sfp_i2c_client_eeprom_path, mode="rb", buffering=0) + sysfsfile_eeprom.seek(offset) + raw = sysfsfile_eeprom.read(num_bytes) + for n in range(0, num_bytes): + eeprom_raw[n] = hex(raw[n])[2:].zfill(2) + except Exception: + eeprom_raw = None + finally: + if sysfsfile_eeprom: + sysfsfile_eeprom.close() + + return eeprom_raw + + def __convert_string_to_num(self, value_str): + if "-inf" in value_str: + return 'N/A' + elif "Unknown" in value_str: + return 'N/A' + elif 'dBm' in value_str: + t_str = value_str.rstrip('dBm') + return float(t_str) + elif 'mA' in value_str: + t_str = value_str.rstrip('mA') + return float(t_str) + elif 'C' in value_str: + t_str = value_str.rstrip('C') + return float(t_str) + elif 'Volts' in value_str: + t_str = value_str.rstrip('Volts') + return float(t_str) + else: + return 'N/A' + + def _dom_capability_detect(self): + if not self.get_presence(): + self.dom_supported = False + self.dom_temp_supported = False + self.dom_volt_supported = False + self.dom_rx_power_supported = False + self.dom_tx_power_supported = False + self.calibration = 0 + return + + if self.sfp_type == "QSFP": + self.calibration = 1 + sfpi_obj = sff8436InterfaceId() + if sfpi_obj is None: + self.dom_supported = False + offset = 128 + + # QSFP capability byte parse, through this byte can know whether it support tx_power or not. + # TODO: in the future when decided to migrate to support SFF-8636 instead of SFF-8436, + # need to add more code for determining the capability and version compliance + # in SFF-8636 dom capability definitions evolving with the versions. + qsfp_dom_capability_raw = self.__read_eeprom_specific_bytes( + (offset + XCVR_DOM_CAPABILITY_OFFSET), XCVR_DOM_CAPABILITY_WIDTH) + if qsfp_dom_capability_raw is not None: + qsfp_dom_capability = int(qsfp_dom_capability_raw[0], 16) + + qsfp_version_compliance_raw = self.__read_eeprom_specific_bytes( + QSFP_VERSION_COMPLIANCE_OFFSET, QSFP_VERSION_COMPLIANCE_OFFSET) + if qsfp_version_compliance_raw is not None: + qsfp_version_compliance = int(qsfp_version_compliance_raw[0], 16) + else: + self.dom_supported = False + self.dom_temp_supported = False + self.dom_volt_supported = False + self.dom_rx_power_supported = False + self.dom_tx_power_supported = False + self.calibration = 0 + return + + if qsfp_version_compliance >= 0x08: + self.dom_temp_supported = (qsfp_dom_capability & 0x20 != 0) + self.dom_volt_supported = (qsfp_dom_capability & 0x10 != 0) + self.dom_rx_power_supported = (qsfp_dom_capability & 0x08 != 0) + self.dom_tx_power_supported = (qsfp_dom_capability & 0x04 != 0) + else: + self.dom_temp_supported = True + self.dom_volt_supported = True + self.dom_rx_power_supported = (qsfp_dom_capability & 0x08 != 0) + self.dom_tx_power_supported = True + self.dom_supported = True + self.calibration = 1 + self.dom_tx_disable_supported = True + else: + self.dom_supported = False + self.dom_temp_supported = False + self.dom_volt_supported = False + self.dom_rx_power_supported = False + self.dom_tx_power_supported = False + self.calibration = 0 + elif self.sfp_type == "SFP": + sfpi_obj = sff8472InterfaceId() + if sfpi_obj is None: + return None + sfp_dom_capability_raw = self.__read_eeprom_specific_bytes( + XCVR_DOM_CAPABILITY_OFFSET, XCVR_DOM_CAPABILITY_WIDTH) + if sfp_dom_capability_raw is not None: + sfp_dom_capability = int(sfp_dom_capability_raw[0], 16) + self.dom_supported = (sfp_dom_capability & 0x40 != 0) + if self.dom_supported: + self.dom_temp_supported = True + self.dom_volt_supported = True + self.dom_rx_power_supported = True + self.dom_tx_power_supported = True + if sfp_dom_capability & 0x20 != 0: + self.calibration = 1 + elif sfp_dom_capability & 0x10 != 0: + self.calibration = 2 + else: + self.calibration = 0 + else: + self.dom_temp_supported = False + self.dom_volt_supported = False + self.dom_rx_power_supported = False + self.dom_tx_power_supported = False + self.calibration = 0 + self.dom_tx_disable_supported = (int(sfp_dom_capability_raw[1], 16) & 0x40 != 0) + else: + self.dom_supported = False + self.dom_temp_supported = False + self.dom_volt_supported = False + self.dom_rx_power_supported = False + self.dom_tx_power_supported = False + + def get_transceiver_info(self): + """ + Retrieves transceiver info of this SFP + Returns: + A dict which contains following keys/values : + ======================================================================== + keys |Value Format |Information + ---------------------------|---------------|---------------------------- + type |1*255VCHAR |type of SFP + hardware_rev |1*255VCHAR |hardware version of SFP + serial |1*255VCHAR |serial number of the SFP + manufacturer |1*255VCHAR |SFP vendor name + model |1*255VCHAR |SFP model name + connector |1*255VCHAR |connector information + encoding |1*255VCHAR |encoding information + ext_identifier |1*255VCHAR |extend identifier + ext_rateselect_compliance |1*255VCHAR |extended rateSelect compliance + cable_length |INT |cable length in m + nominal_bit_rate |INT |nominal bit rate by 100Mbs + specification_compliance |1*255VCHAR |specification compliance + vendor_date |1*255VCHAR |vendor date + vendor_oui |1*255VCHAR |vendor OUI + application_advertisement |1*255VCHAR |supported applications advertisement + ======================================================================== + """ + + transceiver_info_dict = {} + compliance_code_dict = {} + transceiver_info_dict = dict.fromkeys(self.info_dict_keys, 'N/A') + transceiver_info_dict['specification_compliance'] = '{}' + if not self.get_presence(): + return transceiver_info_dict + + if self.sfp_type == QSFP_TYPE: + offset = QSFP_INFO_OFFSET + vendor_rev_width = XCVR_HW_REV_WIDTH_QSFP + interface_info_bulk_width = XCVR_INTFACE_BULK_WIDTH_QSFP + + sfpi_obj = sff8436InterfaceId() + if sfpi_obj is None: + print("Error: sfp_object open failed") + return transceiver_info_dict + + elif self.sfp_type == SFP_TYPE: + offset = SFP_INFO_OFFSET + vendor_rev_width = XCVR_HW_REV_WIDTH_SFP + interface_info_bulk_width = XCVR_INTFACE_BULK_WIDTH_SFP + + sfpi_obj = sff8472InterfaceId() + if sfpi_obj is None: + print("Error: sfp_object open failed") + return transceiver_info_dict + else: + return transceiver_info_dict + + # Add retry for xcvr eeprom to get ready + max_retry = 10 + for i in range(0,max_retry): + sfp_interface_bulk_raw = self.__read_eeprom_specific_bytes( + offset + XCVR_INTERFACE_DATA_START, XCVR_INTERFACE_DATA_SIZE) + if sfp_interface_bulk_raw is not None: + break + else: + if not self.get_presence(): + return transceiver_info_dict + elif i == max_retry-1: + pass + else: + time.sleep(0.5) + + if sfp_interface_bulk_raw is None: + return transceiver_info_dict + + start = XCVR_INTFACE_BULK_OFFSET - XCVR_INTERFACE_DATA_START + end = start + interface_info_bulk_width + sfp_interface_bulk_data = sfpi_obj.parse_sfp_info_bulk(sfp_interface_bulk_raw[start : end], 0) + + start = XCVR_VENDOR_NAME_OFFSET - XCVR_INTERFACE_DATA_START + end = start + XCVR_VENDOR_NAME_WIDTH + sfp_vendor_name_data = sfpi_obj.parse_vendor_name(sfp_interface_bulk_raw[start : end], 0) + + start = XCVR_VENDOR_PN_OFFSET - XCVR_INTERFACE_DATA_START + end = start + XCVR_VENDOR_PN_WIDTH + sfp_vendor_pn_data = sfpi_obj.parse_vendor_pn(sfp_interface_bulk_raw[start : end], 0) + + start = XCVR_HW_REV_OFFSET - XCVR_INTERFACE_DATA_START + end = start + vendor_rev_width + sfp_vendor_rev_data = sfpi_obj.parse_vendor_rev(sfp_interface_bulk_raw[start : end], 0) + + start = XCVR_VENDOR_SN_OFFSET - XCVR_INTERFACE_DATA_START + end = start + XCVR_VENDOR_SN_WIDTH + sfp_vendor_sn_data = sfpi_obj.parse_vendor_sn(sfp_interface_bulk_raw[start : end], 0) + + start = XCVR_VENDOR_OUI_OFFSET - XCVR_INTERFACE_DATA_START + end = start + XCVR_VENDOR_OUI_WIDTH + sfp_vendor_oui_data = sfpi_obj.parse_vendor_oui(sfp_interface_bulk_raw[start : end], 0) + + start = XCVR_VENDOR_DATE_OFFSET - XCVR_INTERFACE_DATA_START + end = start + XCVR_VENDOR_DATE_WIDTH + sfp_vendor_date_data = sfpi_obj.parse_vendor_date(sfp_interface_bulk_raw[start : end], 0) + transceiver_info_dict['type'] = sfp_interface_bulk_data \ + ['data']['type']['value'] + transceiver_info_dict['manufacturer'] = sfp_vendor_name_data \ + ['data']['Vendor Name']['value'] + transceiver_info_dict['model'] = sfp_vendor_pn_data \ + ['data']['Vendor PN']['value'] + transceiver_info_dict['hardware_rev'] = sfp_vendor_rev_data \ + ['data']['Vendor Rev']['value'] + transceiver_info_dict['serial'] = sfp_vendor_sn_data \ + ['data']['Vendor SN']['value'] + transceiver_info_dict['vendor_oui'] = sfp_vendor_oui_data \ + ['data']['Vendor OUI']['value'] + transceiver_info_dict['vendor_date'] = sfp_vendor_date_data \ + ['data']['VendorDataCode(YYYY-MM-DD Lot)']['value'] + transceiver_info_dict['connector'] = sfp_interface_bulk_data \ + ['data']['Connector']['value'] + transceiver_info_dict['encoding'] = sfp_interface_bulk_data \ + ['data']['EncodingCodes']['value'] + transceiver_info_dict['ext_identifier'] = sfp_interface_bulk_data \ + ['data']['Extended Identifier']['value'] + transceiver_info_dict['ext_rateselect_compliance'] = sfp_interface_bulk_data \ + ['data']['RateIdentifier']['value'] + transceiver_info_dict['type_abbrv_name'] = 'N/A' + if self.sfp_type == QSFP_TYPE: + for key in qsfp_cable_length_tup: + if key in sfp_interface_bulk_data['data']: + transceiver_info_dict['cable_type'] = key + transceiver_info_dict['cable_length'] = str( + sfp_interface_bulk_data['data'][key]['value']) + + for key in qsfp_compliance_code_tup: + if key in sfp_interface_bulk_data['data']['Specification compliance']['value']: + compliance_code_dict[key] = sfp_interface_bulk_data \ + ['data']['Specification compliance']['value'][key]['value'] + transceiver_info_dict['specification_compliance'] = str(compliance_code_dict) + + transceiver_info_dict['nominal_bit_rate'] = str(sfp_interface_bulk_data \ + ['data']['Nominal Bit Rate(100Mbs)']['value']) + else: + for key in sfp_cable_length_tup: + if key in sfp_interface_bulk_data['data']: + transceiver_info_dict['cable_type'] = key + transceiver_info_dict['cable_length'] = str( + sfp_interface_bulk_data['data'][key]['value']) + + for key in sfp_compliance_code_tup: + if key in sfp_interface_bulk_data['data']['Specification compliance']['value']: + compliance_code_dict[key] = sfp_interface_bulk_data \ + ['data']['Specification compliance']['value'][key]['value'] + transceiver_info_dict['specification_compliance'] = str(compliance_code_dict) + + transceiver_info_dict['nominal_bit_rate'] = str(sfp_interface_bulk_data \ + ['data']['NominalSignallingRate(UnitsOf100Mbd)']['value']) + + return transceiver_info_dict + + def get_transceiver_bulk_status(self): + """ + Retrieves transceiver bulk status of this SFP + Returns: + A dict which contains following keys/values : + ======================================================================== + keys |Value Format |Information + ---------------------------|---------------|---------------------------- + rx_los |BOOLEAN |RX loss-of-signal status, True if has RX los, False if not. + tx_fault |BOOLEAN |TX fault status, True if has TX fault, False if not. + reset_status |BOOLEAN |reset status, True if SFP in reset, False if not. + lp_mode |BOOLEAN |low power mode status, True in lp mode, False if not. + tx_disable |BOOLEAN |TX disable status, True TX disabled, False if not. + tx_disabled_channel |HEX |disabled TX channels in hex, bits 0 to 3 represent channel 0 + | |to channel 3. + temperature |INT |module temperature in Celsius + voltage |INT |supply voltage in mV + txbias |INT |TX Bias Current in mA, n is the channel number, + | |for example, tx2bias stands for tx bias of channel 2. + rxpower |INT |received optical power in mW, n is the channel number, + | |for example, rx2power stands for rx power of channel 2. + txpower |INT |TX output power in mW, n is the channel number, + | |for example, tx2power stands for tx power of channel 2. + ======================================================================== + """ + + if not self.get_presence(): + return {} + + self._dom_capability_detect() + + if self.sfp_type == QSFP_TYPE: + sfpd_obj = sff8436Dom() + sfpi_obj = sff8436InterfaceId() + + if not sfpi_obj or not sfpd_obj: + return {} + + transceiver_dom_info_dict = dict.fromkeys(self.dom_dict_keys, 'N/A') + offset = QSFP_DOM_OFFSET + offset_xcvr = QSFP_INFO_OFFSET + + # QSFP capability byte parse, through this byte can know whether it support tx_power or not. + # TODO: in the future when decided to migrate to support SFF-8636 instead of SFF-8436, + # need to add more code for determining the capability and version compliance + # in SFF-8636 dom capability definitions evolving with the versions. + qsfp_dom_capability_raw = self.__read_eeprom_specific_bytes( + (offset_xcvr + XCVR_DOM_CAPABILITY_OFFSET), XCVR_DOM_CAPABILITY_WIDTH) + if qsfp_dom_capability_raw is not None: + qsfp_dom_capability_data = sfpi_obj.parse_dom_capability( + qsfp_dom_capability_raw, 0) + else: + return None + + dom_temperature_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_TEMPE_OFFSET), QSFP_TEMPE_WIDTH) + if dom_temperature_raw is not None: + dom_temperature_data = sfpd_obj.parse_temperature( + dom_temperature_raw, 0) + transceiver_dom_info_dict['temperature'] = dom_temperature_data['data']['Temperature']['value'] + + dom_voltage_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_VOLT_OFFSET), QSFP_VOLT_WIDTH) + if dom_voltage_raw is not None: + dom_voltage_data = sfpd_obj.parse_voltage(dom_voltage_raw, 0) + transceiver_dom_info_dict['voltage'] = dom_voltage_data['data']['Vcc']['value'] + + qsfp_dom_rev_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_DOM_REV_OFFSET), QSFP_DOM_REV_WIDTH) + if qsfp_dom_rev_raw is not None: + qsfp_dom_rev_data = sfpd_obj.parse_sfp_dom_rev(qsfp_dom_rev_raw, 0) + qsfp_dom_rev = qsfp_dom_rev_data['data']['dom_rev']['value'] + + # The tx_power monitoring is only available on QSFP which compliant with SFF-8636 + # and claimed that it support tx_power with one indicator bit. + dom_channel_monitor_data = {} + dom_channel_monitor_raw = None + qsfp_tx_power_support = qsfp_dom_capability_data['data']['Tx_power_support']['value'] + if (qsfp_dom_rev[0:8] != 'SFF-8636' or (qsfp_dom_rev[0:8] == 'SFF-8636' and qsfp_tx_power_support != 'on')): + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_CHANNL_MON_OFFSET), QSFP_CHANNL_MON_WIDTH) + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = sfpd_obj.parse_channel_monitor_params( + dom_channel_monitor_raw, 0) + + else: + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_CHANNL_MON_OFFSET), QSFP_CHANNL_MON_WITH_TX_POWER_WIDTH) + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = sfpd_obj.parse_channel_monitor_params_with_tx_power( + dom_channel_monitor_raw, 0) + transceiver_dom_info_dict['tx1power'] = dom_channel_monitor_data['data']['TX1Power']['value'] + transceiver_dom_info_dict['tx2power'] = dom_channel_monitor_data['data']['TX2Power']['value'] + transceiver_dom_info_dict['tx3power'] = dom_channel_monitor_data['data']['TX3Power']['value'] + transceiver_dom_info_dict['tx4power'] = dom_channel_monitor_data['data']['TX4Power']['value'] + + if dom_channel_monitor_raw: + transceiver_dom_info_dict['rx1power'] = dom_channel_monitor_data['data']['RX1Power']['value'] + transceiver_dom_info_dict['rx2power'] = dom_channel_monitor_data['data']['RX2Power']['value'] + transceiver_dom_info_dict['rx3power'] = dom_channel_monitor_data['data']['RX3Power']['value'] + transceiver_dom_info_dict['rx4power'] = dom_channel_monitor_data['data']['RX4Power']['value'] + transceiver_dom_info_dict['tx1bias'] = dom_channel_monitor_data['data']['TX1Bias']['value'] + transceiver_dom_info_dict['tx2bias'] = dom_channel_monitor_data['data']['TX2Bias']['value'] + transceiver_dom_info_dict['tx3bias'] = dom_channel_monitor_data['data']['TX3Bias']['value'] + transceiver_dom_info_dict['tx4bias'] = dom_channel_monitor_data['data']['TX4Bias']['value'] + elif self.sfp_type == SFP_TYPE: + sfpd_obj = sff8472Dom() + if not sfpd_obj: + return {} + + eeprom_ifraw = self.__read_eeprom_specific_bytes(0, SFP_DOM_OFFSET) + if eeprom_ifraw is not None: + sfpi_obj = sff8472InterfaceId(eeprom_ifraw) + cal_type = sfpi_obj.get_calibration_type() + sfpd_obj._calibration_type = cal_type + + offset = SFP_DOM_OFFSET + transceiver_dom_info_dict = dict.fromkeys(self.dom_dict_keys, 'N/A') + dom_temperature_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_TEMPE_OFFSET), SFP_TEMPE_WIDTH) + + if dom_temperature_raw is not None: + dom_temperature_data = sfpd_obj.parse_temperature( + dom_temperature_raw, 0) + transceiver_dom_info_dict['temperature'] = dom_temperature_data['data']['Temperature']['value'] + + dom_voltage_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_VOLT_OFFSET), SFP_VOLT_WIDTH) + if dom_voltage_raw is not None: + dom_voltage_data = sfpd_obj.parse_voltage(dom_voltage_raw, 0) + transceiver_dom_info_dict['voltage'] = dom_voltage_data['data']['Vcc']['value'] + + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_CHANNL_MON_OFFSET), SFP_CHANNL_MON_WIDTH) + if dom_channel_monitor_raw is not None: + dom_voltage_data = sfpd_obj.parse_channel_monitor_params( + dom_channel_monitor_raw, 0) + transceiver_dom_info_dict['tx1power'] = dom_voltage_data['data']['TXPower']['value'] + transceiver_dom_info_dict['rx1power'] = dom_voltage_data['data']['RXPower']['value'] + transceiver_dom_info_dict['tx1bias'] = dom_voltage_data['data']['TXBias']['value'] + else: + return None + + for key in transceiver_dom_info_dict: + transceiver_dom_info_dict[key] = self._convert_string_to_num( + transceiver_dom_info_dict[key]) + + transceiver_dom_info_dict['rx_los'] = self.get_rx_los() + transceiver_dom_info_dict['tx_fault'] = self.get_tx_fault() + transceiver_dom_info_dict['reset_status'] = self.get_reset_status() + transceiver_dom_info_dict['lp_mode'] = self.get_lpmode() + transceiver_dom_info_dict['tx_disable'] = self.get_tx_disable() + transceiver_dom_info_dict['tx_disable_channel'] = self.get_tx_disable_channel() + + return transceiver_dom_info_dict + + def get_transceiver_threshold_info(self): + """ + Retrieves transceiver threshold info of this SFP + + Returns: + A dict which contains following keys/values : + ======================================================================== + keys |Value Format |Information + ---------------------------|---------------|---------------------------- + temphighalarm |FLOAT |High Alarm Threshold value of temperature in Celsius. + templowalarm |FLOAT |Low Alarm Threshold value of temperature in Celsius. + temphighwarning |FLOAT |High Warning Threshold value of temperature in Celsius. + templowwarning |FLOAT |Low Warning Threshold value of temperature in Celsius. + vcchighalarm |FLOAT |High Alarm Threshold value of supply voltage in mV. + vcclowalarm |FLOAT |Low Alarm Threshold value of supply voltage in mV. + vcchighwarning |FLOAT |High Warning Threshold value of supply voltage in mV. + vcclowwarning |FLOAT |Low Warning Threshold value of supply voltage in mV. + rxpowerhighalarm |FLOAT |High Alarm Threshold value of received power in dBm. + rxpowerlowalarm |FLOAT |Low Alarm Threshold value of received power in dBm. + rxpowerhighwarning |FLOAT |High Warning Threshold value of received power in dBm. + rxpowerlowwarning |FLOAT |Low Warning Threshold value of received power in dBm. + txpowerhighalarm |FLOAT |High Alarm Threshold value of transmit power in dBm. + txpowerlowalarm |FLOAT |Low Alarm Threshold value of transmit power in dBm. + txpowerhighwarning |FLOAT |High Warning Threshold value of transmit power in dBm. + txpowerlowwarning |FLOAT |Low Warning Threshold value of transmit power in dBm. + txbiashighalarm |FLOAT |High Alarm Threshold value of tx Bias Current in mA. + txbiaslowalarm |FLOAT |Low Alarm Threshold value of tx Bias Current in mA. + txbiashighwarning |FLOAT |High Warning Threshold value of tx Bias Current in mA. + txbiaslowwarning |FLOAT |Low Warning Threshold value of tx Bias Current in mA. + ======================================================================== + """ + transceiver_dom_threshold_info_dict_keys = ['temphighalarm', 'temphighwarning', 'templowalarm', 'templowwarning', + 'vcchighalarm', 'vcchighwarning', 'vcclowalarm', 'vcclowwarning', + 'rxpowerhighalarm', 'rxpowerhighwarning', 'rxpowerlowalarm', 'rxpowerlowwarning', + 'txpowerhighalarm', 'txpowerhighwarning', 'txpowerlowalarm', 'txpowerlowwarning', + 'txbiashighalarm', 'txbiashighwarning', 'txbiaslowalarm', 'txbiaslowwarning'] + + if self.sfp_type == QSFP_TYPE: + sfpd_obj = sff8436Dom() + if not self.get_presence() or not sfpd_obj: + return {} + DOM_OFFSET = 0 + transceiver_dom_threshold_dict = dict.fromkeys(transceiver_dom_threshold_info_dict_keys, 'N/A') + offset = DOM_OFFSET + + dom_module_threshold_raw = self.__read_eeprom_specific_bytes((offset + QSFP_MODULE_THRESHOLD_OFFSET), QSFP_MODULE_THRESHOLD_WIDTH) + if dom_module_threshold_raw is not None: + module_threshold_values = sfpd_obj.parse_module_threshold_values(dom_module_threshold_raw, 0) + module_threshold_data = module_threshold_values.get('data') + if module_threshold_data: + transceiver_dom_threshold_dict['temphighalarm'] = module_threshold_data['TempHighAlarm']['value'] + transceiver_dom_threshold_dict['templowalarm'] = module_threshold_data['TempLowAlarm']['value'] + transceiver_dom_threshold_dict['temphighwarning'] = module_threshold_data['TempHighWarning']['value'] + transceiver_dom_threshold_dict['templowwarning'] = module_threshold_data['TempLowWarning']['value'] + transceiver_dom_threshold_dict['vcchighalarm'] = module_threshold_data['VccHighAlarm']['value'] + transceiver_dom_threshold_dict['vcclowalarm'] = module_threshold_data['VccLowAlarm']['value'] + transceiver_dom_threshold_dict['vcchighwarning'] = module_threshold_data['VccHighWarning']['value'] + transceiver_dom_threshold_dict['vcclowwarning'] = module_threshold_data['VccLowWarning']['value'] + + dom_channel_thres_raw = self.__read_eeprom_specific_bytes((offset + QSFP_CHANNEL_THRESHOLD_OFFSET), QSFP_CHANNEL_THRESHOLD_WIDTH) + if dom_channel_thres_raw is not None: + channel_threshold_values = sfpd_obj.parse_channel_threshold_values(dom_channel_thres_raw, 0) + channel_threshold_data = channel_threshold_values.get('data') + else: + channel_threshold_data = None + if channel_threshold_data: + transceiver_dom_threshold_dict['rxpowerhighalarm'] = channel_threshold_data['RxPowerHighAlarm']['value'] + transceiver_dom_threshold_dict['rxpowerlowalarm'] = channel_threshold_data['RxPowerLowAlarm']['value'] + transceiver_dom_threshold_dict['rxpowerhighwarning'] = channel_threshold_data['RxPowerHighWarning']['value'] + transceiver_dom_threshold_dict['rxpowerlowwarning'] = channel_threshold_data['RxPowerLowWarning']['value'] + transceiver_dom_threshold_dict['txpowerhighalarm'] = "0.0dBm" + transceiver_dom_threshold_dict['txpowerlowalarm'] = "0.0dBm" + transceiver_dom_threshold_dict['txpowerhighwarning'] = "0.0dBm" + transceiver_dom_threshold_dict['txpowerlowwarning'] = "0.0dBm" + transceiver_dom_threshold_dict['txbiashighalarm'] = channel_threshold_data['TxBiasHighAlarm']['value'] + transceiver_dom_threshold_dict['txbiaslowalarm'] = channel_threshold_data['TxBiasLowAlarm']['value'] + transceiver_dom_threshold_dict['txbiashighwarning'] = channel_threshold_data['TxBiasHighWarning']['value'] + transceiver_dom_threshold_dict['txbiaslowwarning'] = channel_threshold_data['TxBiasLowWarning']['value'] + + for key in transceiver_dom_threshold_dict: + transceiver_dom_threshold_dict[key] = self.__convert_string_to_num(transceiver_dom_threshold_dict[key]) + + return transceiver_dom_threshold_dict + + elif self.sfp_type == SFP_TYPE: + sfpd_obj = sff8472Dom() + + if not self.get_presence() and not sfpd_obj: + return {} + DOM_OFFSET = 256 + eeprom_ifraw = self.__read_eeprom_specific_bytes(0, DOM_OFFSET) + if eeprom_ifraw is not None: + sfpi_obj = sff8472InterfaceId(eeprom_ifraw) + cal_type = sfpi_obj.get_calibration_type() + sfpd_obj._calibration_type = cal_type + + offset = DOM_OFFSET + transceiver_dom_threshold_info_dict = dict.fromkeys(transceiver_dom_threshold_info_dict_keys, 'N/A') + dom_module_threshold_raw = self.__read_eeprom_specific_bytes((offset + SFP_MODULE_THRESHOLD_OFFSET), SFP_MODULE_THRESHOLD_WIDTH) + if dom_module_threshold_raw is not None: + dom_module_threshold_data = sfpd_obj.parse_alarm_warning_threshold(dom_module_threshold_raw, 0) + + transceiver_dom_threshold_info_dict['temphighalarm'] = dom_module_threshold_data['data']['TempHighAlarm']['value'] + transceiver_dom_threshold_info_dict['templowalarm'] = dom_module_threshold_data['data']['TempLowAlarm']['value'] + transceiver_dom_threshold_info_dict['temphighwarning'] = dom_module_threshold_data['data']['TempHighWarning']['value'] + transceiver_dom_threshold_info_dict['templowwarning'] = dom_module_threshold_data['data']['TempLowWarning']['value'] + + transceiver_dom_threshold_info_dict['vcchighalarm'] = dom_module_threshold_data['data']['VoltageHighAlarm']['value'] + transceiver_dom_threshold_info_dict['vcclowalarm'] = dom_module_threshold_data['data']['VoltageLowAlarm']['value'] + transceiver_dom_threshold_info_dict['vcchighwarning'] = dom_module_threshold_data['data']['VoltageHighWarning']['value'] + transceiver_dom_threshold_info_dict['vcclowwarning'] = dom_module_threshold_data['data']['VoltageLowWarning']['value'] + + transceiver_dom_threshold_info_dict['txbiashighalarm'] = dom_module_threshold_data['data']['BiasHighAlarm']['value'] + transceiver_dom_threshold_info_dict['txbiaslowalarm'] = dom_module_threshold_data['data']['BiasLowAlarm']['value'] + transceiver_dom_threshold_info_dict['txbiashighwarning'] = dom_module_threshold_data['data']['BiasHighWarning']['value'] + transceiver_dom_threshold_info_dict['txbiaslowwarning'] = dom_module_threshold_data['data']['BiasLowWarning']['value'] + + transceiver_dom_threshold_info_dict['txpowerhighalarm'] = dom_module_threshold_data['data']['TXPowerHighAlarm']['value'] + transceiver_dom_threshold_info_dict['txpowerlowalarm'] = dom_module_threshold_data['data']['TXPowerLowAlarm']['value'] + transceiver_dom_threshold_info_dict['txpowerhighwarning'] = dom_module_threshold_data['data']['TXPowerHighWarning']['value'] + transceiver_dom_threshold_info_dict['txpowerlowwarning'] = dom_module_threshold_data['data']['TXPowerLowWarning']['value'] + + transceiver_dom_threshold_info_dict['rxpowerhighalarm'] = dom_module_threshold_data['data']['RXPowerHighAlarm']['value'] + transceiver_dom_threshold_info_dict['rxpowerlowalarm'] = dom_module_threshold_data['data']['RXPowerLowAlarm']['value'] + transceiver_dom_threshold_info_dict['rxpowerhighwarning'] = dom_module_threshold_data['data']['RXPowerHighWarning']['value'] + transceiver_dom_threshold_info_dict['rxpowerlowwarning'] = dom_module_threshold_data['data']['RXPowerLowWarning']['value'] + + for key in transceiver_dom_threshold_info_dict: + transceiver_dom_threshold_info_dict[key] = self.__convert_string_to_num(transceiver_dom_threshold_info_dict[key]) + + return transceiver_dom_threshold_info_dict + + else: + return None + + def get_reset_status(self): + """ + Retrieves the reset status of SFP + Returns: + A Boolean, True if reset enabled, False if disabled + """ + # SFP doesn't support this feature + if self.sfp_type == SFP_TYPE: + return False + elif self.sfp_type == QSFP_TYPE: + try: + reg_file = open(self.reset_path) + except IOError as e: + print("Error: unable to open file: %s" % str(e)) + return None + reg_value = int(reg_file.readline().rstrip()) + reg_file.close() + if reg_value == 0: + return True + else: + return False + else: + return None + + def get_rx_los(self): + """ + Retrieves the RX LOS (lost-of-signal) status of SFP + Returns: + A Boolean, True if SFP has RX LOS, False if not. + Note : RX LOS status is latched until a call to get_rx_los or a reset. + """ + if not self.dom_supported: + return None + + rx_los_list = [] + + if self.sfp_type == QSFP_TYPE: + offset = 0 + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_CHANNL_RX_LOS_STATUS_OFFSET), QSFP_CHANNL_RX_LOS_STATUS_WIDTH) + if dom_channel_monitor_raw is not None: + rx_los_data = int(dom_channel_monitor_raw[0], 16) + rx_los_list.append(rx_los_data & 0x01 != 0) + rx_los_list.append(rx_los_data & 0x02 != 0) + rx_los_list.append(rx_los_data & 0x04 != 0) + rx_los_list.append(rx_los_data & 0x08 != 0) + elif self.sfp_type == SFP_TYPE: + offset = 256 + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_STATUS_CONTROL_OFFSET), SFP_STATUS_CONTROL_WIDTH) + if dom_channel_monitor_raw is not None: + rx_los_data = int(dom_channel_monitor_raw[0], 16) + rx_los_list.append(rx_los_data & 0x02 != 0) + else: + return None + else: + return None + + return rx_los_list + + def get_tx_fault(self): + """ + Retrieves the TX fault status of SFP + Returns: + A Boolean, True if SFP has TX fault, False if not + Note : TX fault status is lached until a call to get_tx_fault or a reset. + """ + if not self.dom_supported: + return None + + tx_fault_list = [] + + if self.sfp_type == QSFP_TYPE: + offset = 0 + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_CHANNL_TX_FAULT_STATUS_OFFSET), QSFP_CHANNL_TX_FAULT_STATUS_WIDTH) + if dom_channel_monitor_raw is not None: + tx_fault_data = int(dom_channel_monitor_raw[0], 16) + tx_fault_list.append(tx_fault_data & 0x01 != 0) + tx_fault_list.append(tx_fault_data & 0x02 != 0) + tx_fault_list.append(tx_fault_data & 0x04 != 0) + tx_fault_list.append(tx_fault_data & 0x08 != 0) + elif self.sfp_type == SFP_TYPE: + offset = 256 + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_STATUS_CONTROL_OFFSET), SFP_STATUS_CONTROL_WIDTH) + if dom_channel_monitor_raw is not None: + tx_fault_data = int(dom_channel_monitor_raw[0], 16) + tx_fault_list.append(tx_fault_data & 0x04 != 0) + else: + return None + else: + return None + + return tx_fault_list + + def get_tx_disable(self): + """ + Retrieves the tx_disable status of this SFP + Returns: + A Boolean, True if tx_disable is enabled, False if disabled + """ + if not self.dom_supported: + return None + + tx_disable_list = [] + + if self.sfp_type == QSFP_TYPE: + offset = 0 + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_CHANNL_DISABLE_STATUS_OFFSET), QSFP_CHANNL_DISABLE_STATUS_WIDTH) + if dom_channel_monitor_raw is not None: + tx_disable_data = int(dom_channel_monitor_raw[0], 16) + tx_disable_list.append(tx_disable_data & 0x01 != 0) + tx_disable_list.append(tx_disable_data & 0x02 != 0) + tx_disable_list.append(tx_disable_data & 0x04 != 0) + tx_disable_list.append(tx_disable_data & 0x08 != 0) + elif self.sfp_type == SFP_TYPE: + offset = 256 + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_STATUS_CONTROL_OFFSET), SFP_STATUS_CONTROL_WIDTH) + if dom_channel_monitor_raw is not None: + tx_disable_data = int(dom_channel_monitor_raw[0], 16) + tx_disable_list.append(tx_disable_data & 0xC0 != 0) + else: + return None + else: + return None + + return tx_disable_list + + def get_tx_disable_channel(self): + """ + Retrieves the TX disabled channels in this SFP + Returns: + A hex of 4 bits (bit 0 to bit 3 as channel 0 to channel 3) to represent + TX channels which have been disabled in this SFP. + As an example, a returned value of 0x5 indicates that channel 0 + and channel 2 have been disabled. + """ + # SFP doesn't support this feature + if self.sfp_type == SFP_TYPE: + return 0 + elif self.sfp_type == QSFP_TYPE: + tx_disable_list = self.get_tx_disable() + if tx_disable_list is None: + return 0 + tx_disabled = 0 + for i in range(len(tx_disable_list)): + if tx_disable_list[i]: + tx_disabled |= 1 << i + else: + return None + + return tx_disabled + + def get_lpmode(self): + """ + Retrieves the lpmode (low power mode) status of this QSFP module + Returns: + A Boolean, True if lpmode is enabled, False if disabled + """ + # SFP doesn't support this feature + if self.sfp_type == SFP_TYPE: + return False + elif self.sfp_type == QSFP_TYPE: + try: + reg_file = open(self.lpmode_path) + except IOError as e: + print("Error: unable to open file: %s" % str(e)) + return False + reg_value = int(reg_file.readline().rstrip()) + reg_file.close() + if reg_value == 0: + return False + else: + return True + else: + return None + + def get_power_override(self): + """ + Retrieves the power-override status of this SFP + Returns: + A Boolean, True if power-override is enabled, False if disabled + """ + # SFP doesn't support this feature + if self.sfp_type == SFP_TYPE: + return False + elif self.sfp_type == QSFP_TYPE: + offset = 0 + sfpd_obj = sff8436Dom() + if sfpd_obj is None: + return False + + dom_control_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_POWEROVERRIDE_OFFSET), QSFP_POWEROVERRIDE_WIDTH) + if dom_control_raw is not None: + if int(dom_control_raw[0],16) & (0x01 << QSFP_POWEROVERRIDE_BIT): + return True + else: + return False + else: + return None + + def get_temperature(self): + """ + Retrieves the temperature of this SFP + Returns: + An integer number of current temperature in Celsius + """ + if not self.dom_supported: + return None + if self.sfp_type == QSFP_TYPE: + offset = 0 + + sfpd_obj = sff8436Dom() + if sfpd_obj is None: + return None + + if self.dom_temp_supported: + dom_temperature_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_TEMPE_OFFSET), QSFP_TEMPE_WIDTH) + if dom_temperature_raw is not None: + dom_temperature_data = sfpd_obj.parse_temperature(dom_temperature_raw, 0) + temp = self._convert_string_to_num( + dom_temperature_data['data']['Temperature']['value']) + return temp + else: + return None + elif self.sfp_type == SFP_TYPE: + offset = 256 + sfpd_obj = sff8472Dom() + if sfpd_obj is None: + return None + sfpd_obj._calibration_type = 1 + + dom_temperature_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_TEMPE_OFFSET), SFP_TEMPE_WIDTH) + if dom_temperature_raw is not None: + dom_temperature_data = sfpd_obj.parse_temperature(dom_temperature_raw, 0) + temp = self._convert_string_to_num( + dom_temperature_data['data']['Temperature']['value']) + return temp + else: + return None + else: + return None + + def get_voltage(self): + """ + Retrieves the supply voltage of this SFP + Returns: + An integer number of supply voltage in mV + """ + if not self.dom_supported: + return None + if self.sfp_type == QSFP_TYPE: + offset = 0 + + sfpd_obj = sff8436Dom() + if sfpd_obj is None: + return None + + if self.dom_volt_supported: + dom_voltage_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_VOLT_OFFSET), QSFP_VOLT_WIDTH) + if dom_voltage_raw is not None: + dom_voltage_data = sfpd_obj.parse_voltage(dom_voltage_raw, 0) + voltage = self._convert_string_to_num( + dom_voltage_data['data']['Vcc']['value']) + return voltage + else: + return None + elif self.sfp_type == SFP_TYPE: + offset = 256 + + sfpd_obj = sff8472Dom() + if sfpd_obj is None: + return None + + sfpd_obj._calibration_type = self.calibration + + dom_voltage_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_VOLT_OFFSET), SFP_VOLT_WIDTH) + if dom_voltage_raw is not None: + dom_voltage_data = sfpd_obj.parse_voltage(dom_voltage_raw, 0) + voltage = self._convert_string_to_num( + dom_voltage_data['data']['Vcc']['value']) + return voltage + else: + return None + else: + return None + + def get_tx_bias(self): + """ + Retrieves the TX bias current of this SFP + Returns: + A list of four integer numbers, representing TX bias in mA + for channel 0 to channel 4. + Ex. ['110.09', '111.12', '108.21', '112.09'] + """ + tx_bias_list = [] + if self.sfp_type == QSFP_TYPE: + offset = 0 + + sfpd_obj = sff8436Dom() + if sfpd_obj is None: + return None + + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_CHANNL_MON_OFFSET), QSFP_CHANNL_MON_WITH_TX_POWER_WIDTH) + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = \ + sfpd_obj.parse_channel_monitor_params_with_tx_power(dom_channel_monitor_raw, 0) + tx_bias_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TX1Bias']['value'])) + tx_bias_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TX2Bias']['value'])) + tx_bias_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TX3Bias']['value'])) + tx_bias_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TX4Bias']['value'])) + elif self.sfp_type == SFP_TYPE: + offset = 256 + + sfpd_obj = sff8472Dom() + if sfpd_obj is None: + return None + sfpd_obj._calibration_type = self.calibration + + if self.dom_supported: + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_CHANNL_MON_OFFSET), SFP_CHANNL_MON_WIDTH) + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = sfpd_obj.parse_channel_monitor_params( \ + dom_channel_monitor_raw, 0) + tx_bias_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TXBias']['value'])) + else: + return None + else: + return None + else: + return None + + return tx_bias_list + + def get_rx_power(self): + """ + Retrieves the received optical power for this SFP + Returns: + A list of four integer numbers, representing received optical + power in mW for channel 0 to channel 4. + Ex. ['1.77', '1.71', '1.68', '1.70'] + """ + rx_power_list = [] + + if self.sfp_type == QSFP_TYPE: + offset = 0 + + sfpd_obj = sff8436Dom() + if sfpd_obj is None: + return None + + if self.dom_rx_power_supported: + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_CHANNL_MON_OFFSET), QSFP_CHANNL_MON_WITH_TX_POWER_WIDTH) + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = \ + sfpd_obj.parse_channel_monitor_params_with_tx_power(dom_channel_monitor_raw, 0) + rx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['RX1Power']['value'])) + rx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['RX2Power']['value'])) + rx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['RX3Power']['value'])) + rx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['RX4Power']['value'])) + else: + return None + else: + return None + elif self.sfp_type == SFP_TYPE: + offset = 256 + + sfpd_obj = sff8472Dom() + if sfpd_obj is None: + return None + + if self.dom_supported: + sfpd_obj._calibration_type = self.calibration + + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_CHANNL_MON_OFFSET), SFP_CHANNL_MON_WIDTH) + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = \ + sfpd_obj.parse_channel_monitor_params(dom_channel_monitor_raw, 0) + rx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['RXPower']['value'])) + else: + return None + else: + return None + else: + return None + + return rx_power_list + + def get_tx_power(self): + """ + Retrieves the TX power of this SFP + Returns: + A list of four integer numbers, representing TX power in mW + for channel 0 to channel 4. + Ex. ['1.86', '1.86', '1.86', '1.86'] + """ + tx_power_list = [] + + if self.sfp_type == QSFP_TYPE: + offset = 0 + + sfpd_obj = sff8436Dom() + if sfpd_obj is None: + return None + + if self.dom_tx_power_supported: + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_CHANNL_MON_OFFSET), QSFP_CHANNL_MON_WITH_TX_POWER_WIDTH) + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = \ + sfpd_obj.parse_channel_monitor_params_with_tx_power(dom_channel_monitor_raw, 0) + tx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TX1Power']['value'])) + tx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TX2Power']['value'])) + tx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TX3Power']['value'])) + tx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TX4Power']['value'])) + else: + return None + else: + return None + elif self.sfp_type == SFP_TYPE: + offset = 256 + sfpd_obj = sff8472Dom() + if sfpd_obj is None: + return None + + if self.dom_supported: + sfpd_obj._calibration_type = self.calibration + + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_CHANNL_MON_OFFSET), SFP_CHANNL_MON_WIDTH) + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = \ + sfpd_obj.parse_channel_monitor_params(dom_channel_monitor_raw, 0) + tx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TXPower']['value'])) + else: + return None + else: + return None + else: + return None + + return tx_power_list + + def reset(self): + """ + Reset SFP and return all user module settings to their default state. + Returns: + A boolean, True if successful, False if not + """ + if not self.get_presence(): + return False + + # SFP doesn't support this feature + if self.sfp_type == SFP_TYPE: + return False + elif self.sfp_type == QSFP_TYPE: + try: + reg_file = open(self.reset_path, "r+") + except IOError as e: + print("Error: unable to open file: %s" % str(e)) + return False + + reg_value = 0 + reg_file.write(hex(reg_value)) + reg_file.close() + + # Sleep 2 second to allow it to settle + time.sleep(2) + + # Flip the value back write back to the register to take port out of reset + try: + reg_file = open("/sys/class/cpld-qsfp28/port-"+str(self.port_num)+"/reset", "r+") + except IOError as e: + print("Error: unable to open file: %s" % str(e)) + return False + + reg_value = 1 + reg_file.write(hex(reg_value)) + reg_file.close() + else: + return None + + return True + + def tx_disable(self, tx_disable): + """ + Disable SFP TX for all channels + Args: + tx_disable : A Boolean, True to enable tx_disable mode, False to disable + tx_disable mode. + Returns: + A boolean, True if tx_disable is set successfully, False if not + """ + if not self.get_presence(): + return False + + if self.sfp_type == SFP_TYPE: + if self.dom_tx_disable_supported: + offset = 256 + sysfs_sfp_i2c_client_eeprom_path = self.port_to_eeprom_mapping[self.port_num] + status_control_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_STATUS_CONTROL_OFFSET), SFP_STATUS_CONTROL_WIDTH) + if status_control_raw is not None: + # Set bit 6 for Soft TX Disable Select + # 01000000 = 64 and 10111111 = 191 + tx_disable_bit = 64 if tx_disable else 191 + status_control = int(status_control_raw[0], 16) + tx_disable_ctl = (status_control | tx_disable_bit) if tx_disable else ( + status_control & tx_disable_bit) + try: + sysfsfile_eeprom = open( + sysfs_sfp_i2c_client_eeprom_path, mode="r+b", buffering=0) + buffer = create_string_buffer(1) + buffer[0] = chr(tx_disable_ctl) + # Write to eeprom + sysfsfile_eeprom.seek(offset + SFP_STATUS_CONTROL_OFFSET) + sysfsfile_eeprom.write(buffer[0]) + except IOError as e: + print("Error: unable to open file: %s" % str(e)) + return False + finally: + if sysfsfile_eeprom: + sysfsfile_eeprom.close() + time.sleep(0.01) + return True + return False + else: + return False + elif self.sfp_type == QSFP_TYPE: + if self.dom_tx_disable_supported: + channel_mask = 0x0f + if tx_disable: + return self.tx_disable_channel(channel_mask, True) + else: + return self.tx_disable_channel(channel_mask, False) + else: + return False + else: + return None + + def tx_disable_channel(self, channel, disable): + """ + Sets the tx_disable for specified SFP channels + Args: + channel : A hex of 4 bits (bit 0 to bit 3) which represent channel 0 to 3, + e.g. 0x5 for channel 0 and channel 2. + disable : A boolean, True to disable TX channels specified in channel, + False to enable + Returns: + A boolean, True if successful, False if not + """ + if not self.get_presence(): + return False + # SFP doesn't support this feature + if self.sfp_type == SFP_TYPE: + return False + elif self.sfp_type == QSFP_TYPE: + if self.dom_tx_disable_supported: + sysfsfile_eeprom = None + try: + channel_state = self.get_tx_disable_channel() + if disable: + tx_disable_ctl = channel_state | channel + else: + tx_disable_ctl = channel_state & (~channel) + buffer = create_string_buffer(1) + buffer[0] = chr(tx_disable_ctl) + # Write to eeprom + sysfsfile_eeprom = open( + self.port_to_eeprom_mapping[self.port_num], "r+b") + sysfsfile_eeprom.seek(QSFP_CONTROL_OFFSET) + sysfsfile_eeprom.write(buffer[0]) + except IOError as e: + print("Error: unable to open file: %s" % str(e)) + return False + finally: + if sysfsfile_eeprom is not None: + sysfsfile_eeprom.close() + time.sleep(0.01) + return True + else: + return False + else: + return None + + def set_lpmode(self, lpmode): + """ + Sets the lpmode (low power mode) of SFP + Args: + lpmode: A Boolean, True to enable lpmode, False to disable it + Note : lpmode can be overridden by set_power_override + Returns: + A boolean, True if lpmode is set successfully, False if not + """ + if not self.get_presence(): + return False + # SFP doesn't support this feature + if self.sfp_type == SFP_TYPE: + return False + elif self.sfp_type == QSFP_TYPE: + try: + reg_file = open(self.lpmode_path, "r+") + except IOError as e: + print("Error: unable to open file: %s" % str(e)) + return False + + # LPMode is active high; set or clear the bit accordingly + if lpmode: + reg_value = 1 + else: + reg_value = 0 + + reg_file.write(hex(reg_value)) + reg_file.close() + else: + return None + + return True + + def set_power_override(self, power_override, power_set): + """ + Sets SFP power level using power_override and power_set + Args: + power_override : + A Boolean, True to override set_lpmode and use power_set + to control SFP power, False to disable SFP power control + through power_override/power_set and use set_lpmode + to control SFP power. + power_set : + Only valid when power_override is True. + A Boolean, True to set SFP to low power mode, False to set + SFP to high power mode. + Returns: + A boolean, True if power-override and power_set are set successfully, + False if not + """ + # SFP doesn't support this feature + if not self.get_presence(): + return False + + if self.sfp_type == SFP_TYPE: + return False + elif self.sfp_type == QSFP_TYPE: + try: + power_override_bit = 0 + if power_override: + power_override_bit |= 1 << 0 + + power_set_bit = 0 + if power_set: + power_set_bit |= 1 << 1 + + buffer = create_string_buffer(1) + buffer[0] = chr(power_override_bit | power_set_bit) + # Write to eeprom + sysfsfile_eeprom = open(self.port_to_eeprom_mapping[self.port_num], "r+b") + sysfsfile_eeprom.seek(QSFP_POWEROVERRIDE_OFFSET) + sysfsfile_eeprom.write(buffer[0]) + except IOError as e: + print("Error: unable to open file: %s" % str(e)) + return False + finally: + if sysfsfile_eeprom is not None: + sysfsfile_eeprom.close() + time.sleep(0.01) + else: + return None + + return True + + def get_name(self): + """ + Retrieves the name of the device + Returns: + string: The name of the device + """ + sfputil_helper = SfpUtilHelper() + sfputil_helper.read_porttab_mappings(self.__get_path_to_port_config_file()) + print("self.index{}".format(self.index)) + name = sfputil_helper.logical[self.index-1] or "Unknown" + return name + diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix7-bwde-32x/sonic_platform/thermal.py b/platform/broadcom/sonic-platform-modules-quanta/ix7-bwde-32x/sonic_platform/thermal.py new file mode 100644 index 000000000000..a80a07a999ba --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix7-bwde-32x/sonic_platform/thermal.py @@ -0,0 +1,157 @@ +#!/usr/bin/env python + +############################################################################# +# Quanta +# +# Module contains an implementation of SONiC Platform Base API and +# provides the Thermal information +# +############################################################################# + +import logging +import os + +try: + from sonic_platform_base.thermal_base import ThermalBase +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +HWMON_DIR = "/sys/class/hwmon/hwmon2/" + +thermal_index_mapping = { + 1:40, + 2:41, + 3:42, + 4:50, + 5:51, + 6:52, + 7:73, + 8:74, + 9:75, + 10:76, + 11:77, + 12:78, + 13:79, + 14:80, + 15:81, + 16:82, + 17:83, + 18:84 +} + +class Thermal(ThermalBase): + """Platform-specific Thermal class""" + + def __init__(self, thermal_index): + self.index = thermal_index + self.temp_attr = "temp{}_input".format(thermal_index_mapping[self.index]) + self.high_th_attr = "temp{}_ncrit".format(thermal_index_mapping[self.index]) + self.high_crit_th_attr = "temp{}_crit".format(thermal_index_mapping[self.index]) + self.name_attr = "temp{}_label".format(thermal_index_mapping[self.index]) + + + def __get_attr_value(self, attr_path): + + retval = 'ERR' + if (not os.path.isfile(attr_path)): + return retval + + try: + with open(attr_path, 'r') as fd: + retval = fd.read() + except Exception as error: + logging.error("Unable to open ", attr_path, " file !") + + retval = retval.rstrip(' \t\n\r') + return retval + + def get_name(self): + """ + Retrieves the name of the device + + Returns: + string: The name of the device + """ + attr_path = HWMON_DIR + self.name_attr + attr_rv = self.__get_attr_value(attr_path) + + if (attr_rv != 'ERR'): + return attr_rv + else: + return None + + def get_presence(self): + """ + Retrieves the presence of the device + + Returns: + bool: True if device is present, False if not + """ + attr_path = HWMON_DIR + self.name_attr + attr_rv = self.__get_attr_value(attr_path) + + if (attr_rv != 'ERR'): + return True + else: + return False + + def get_status(self): + """ + Retrieves the operational status of the device + + Returns: + A boolean value, True if device is operating properly, False if not + """ + if (self.get_temperature() != None): + return True + else: + return False + + def get_temperature(self): + """ + Retrieves current temperature reading from thermal + + Returns: + A float number of current temperature in Celsius up to nearest thousandth + of one degree Celsius, e.g. 30.125 + """ + attr_path = HWMON_DIR + self.temp_attr + attr_rv = self.__get_attr_value(attr_path) + + if (attr_rv != 'ERR'): + return float(attr_rv) / 1000 + else: + return None + + def get_high_threshold(self): + """ + Retrieves the high threshold temperature of thermal + + Returns: + A float number, the high threshold temperature of thermal in Celsius + up to nearest thousandth of one degree Celsius, e.g. 30.125 + """ + attr_path = HWMON_DIR + self.high_th_attr + attr_rv = self.__get_attr_value(attr_path) + + if (attr_rv != 'ERR'): + return float(attr_rv) / 1000 + else: + return None + + def get_high_critical_threshold(self): + """ + Retrieves the high threshold temperature of thermal + + Returns: + A float number, the high threshold temperature of thermal in Celsius + up to nearest thousandth of one degree Celsius, e.g. 30.125 + """ + attr_path = HWMON_DIR + self.high_crit_th_attr + attr_rv = self.__get_attr_value(attr_path) + + if (attr_rv != 'ERR'): + return float(attr_rv) / 1000 + else: + return None + diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix7-bwde-32x/sonic_platform_setup.py b/platform/broadcom/sonic-platform-modules-quanta/ix7-bwde-32x/sonic_platform_setup.py new file mode 100644 index 000000000000..a4899c618337 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix7-bwde-32x/sonic_platform_setup.py @@ -0,0 +1,24 @@ +import os +from setuptools import setup +os.listdir + +setup( + name='sonic-platform', + version='1.0', + description='SONiC platform API implementation on Quanta Platforms', + license='Apache 2.0', + packages=['sonic_platform'], + classifiers=[ + 'Development Status :: 3 - Alpha', + 'Environment :: Plugins', + 'Intended Audience :: Developers', + 'Intended Audience :: Information Technology', + 'Intended Audience :: System Administrators', + 'License :: OSI Approved :: Apache Software License', + 'Natural Language :: English', + 'Operating System :: POSIX :: Linux', + 'Programming Language :: Python :: 3.7', + 'Topic :: Utilities', + ], + keywords='sonic SONiC platform PLATFORM', +) diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix7-bwde-32x/utils/quanta_ix7_bwde_util.py b/platform/broadcom/sonic-platform-modules-quanta/ix7-bwde-32x/utils/quanta_ix7_bwde_util.py new file mode 100755 index 000000000000..952fc11a6816 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix7-bwde-32x/utils/quanta_ix7_bwde_util.py @@ -0,0 +1,241 @@ +#!/usr/bin/env python +# +# Copyright (C) 2018 Quanta Computer Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +""" +Usage: %(scriptName)s [options] command object + +options: + -h | --help : this help message + -d | --debug : run with debug mode + -f | --force : ignore error during installation or clean +command: + install : install drivers and generate related sysfs nodes + clean : uninstall drivers and remove related sysfs nodes +""" + +import os +import commands +import sys, getopt +import logging + +DEBUG = False +args = [] +FORCE = 0 +i2c_prefix = '/sys/bus/i2c/devices/' + + +if DEBUG == True: + print sys.argv[0] + print 'ARGV :', sys.argv[1:] + + +def main(): + global DEBUG + global args + global FORCE + + if len(sys.argv)<2: + show_help() + + options, args = getopt.getopt(sys.argv[1:], 'hdf', ['help', + 'debug', + 'force', + ]) + if DEBUG == True: + print options + print args + print len(sys.argv) + + for opt, arg in options: + if opt in ('-h', '--help'): + show_help() + elif opt in ('-d', '--debug'): + DEBUG = True + logging.basicConfig(level=logging.INFO) + elif opt in ('-f', '--force'): + FORCE = 1 + else: + logging.info('no option') + for arg in args: + if arg == 'install': + install() + elif arg == 'clean': + uninstall() + else: + show_help() + + + return 0 + +def show_help(): + print __doc__ % {'scriptName' : sys.argv[0].split("/")[-1]} + sys.exit(0) + +def show_log(txt): + if DEBUG == True: + print "[IX7-BWDE-32X]"+txt + return + +def exec_cmd(cmd, show): + logging.info('Run :'+cmd) + status, output = commands.getstatusoutput(cmd) + show_log (cmd +"with result:" + str(status)) + show_log (" output:"+output) + if status: + logging.info('Failed :'+cmd) + if show: + print('Failed :'+cmd) + return status, output + +instantiate =[ +#Enable front-ports LED decoding +'echo 1 > /sys/class/cpld-led/CPLDLED-1/led_decode', +'echo 1 > /sys/class/cpld-led/CPLDLED-2/led_decode', +#Update System LED +'echo 39 > /sys/class/gpio/export', +'echo out > /sys/class/gpio/gpio39/direction', +'echo 0 > /sys/class/gpio/gpio39/value', +'echo 40 > /sys/class/gpio/export', +'echo out > /sys/class/gpio/gpio40/direction', +'echo 1 > /sys/class/gpio/gpio40/value', +] + +drivers =[ +'lpc_ich', +'i2c-i801', +'i2c-dev', +'i2c-mux-pca954x force_deselect_on_exit=1', +'gpio-pca953x', +'optoe', +'qci_cpld', +'qci_cpld_led', +'quanta_platform_ix7_bwde', +'ipmi_devintf', +'quanta_hwmon_ipmi' +] + +un_drivers =[ +'lpc_ich', +'i2c-i801', +'i2c-dev', +'i2c-mux-pca954x', +'gpio-pca953x', +'optoe', +'qci_cpld', +'qci_cpld_led', +'quanta_platform_ix7_bwde', +'ipmi_devintf', +'quanta_hwmon_ipmi' +] + +def system_install(): + global FORCE + + #setup driver dependency + exec_cmd("depmod -a ", 1) + #install drivers + for i in range(0,len(drivers)): + status, output = exec_cmd("modprobe "+drivers[i], 1) + if status: + print output + if FORCE == 0: + return status + + #reload ethernet drivers for correct order + exec_cmd("rmmod ixgbe ", 1) + exec_cmd("rmmod igb ", 1) + exec_cmd("modprobe igb ", 1) + exec_cmd("modprobe ixgbe ", 1) + + #turn on module power + exec_cmd("echo 21 > /sys/class/gpio/export ", 1) + exec_cmd("echo high > /sys/class/gpio/gpio21/direction ", 1) + + #Reset fron-ports LED CPLD + exec_cmd("echo 33 > /sys/class/gpio/export ", 1) + status, output = exec_cmd("cat /sys/class/gpio/gpio33/value", 1) + if output != '1': + exec_cmd("echo out > /sys/class/gpio/gpio33/direction ", 1) + exec_cmd("echo 0 >/sys/class/gpio/gpio33/value", 1) + exec_cmd("echo 1 >/sys/class/gpio/gpio33/value", 1) + + #instantiate devices + for i in range(0,len(instantiate)): + status, output = exec_cmd(instantiate[i], 1) + if status: + print output + if FORCE == 0: + return status + + #QSFP for 1~32 port + for port_number in range(1,33): + bus_number = port_number + 12 + os.system("echo %d >/sys/bus/i2c/devices/%d-0050/port_name" % (port_number, bus_number)) + + status, output = exec_cmd("pip3 install /usr/share/sonic/device/x86_64-quanta_ix7_bwde-r0/sonic_platform-1.0-py3-none-any.whl",1) + if status: + print output + if FORCE == 0: + return status + + return + + +def system_ready(): + if not device_found(): + return False + return True + +def install(): + if not device_found(): + print "No device, installing...." + status = system_install() + if status: + if FORCE == 0: + return status + else: + print " ix7-bwde driver already installed...." + return + +def uninstall(): + global FORCE + #uninstall drivers + for i in range(len(un_drivers)-1,-1,-1): + status, output = exec_cmd("rmmod "+un_drivers[i], 1) + if status: + print output + if FORCE == 0: + return status + status, output = exec_cmd("pip3 uninstall sonic-platform -y ",1) + if status: + print output + if FORCE == 0: + return status + return + +def device_found(): + ret1, log1 = exec_cmd("cat /proc/modules | grep ix7_bwde > /tmp/chkdriver.log", 0) + ret2, log2 = exec_cmd("cat /tmp/chkdriver.log | grep ix7_bwde", 0) + + if ret1 == 0 and len(log2) > 0: + return True + else: + return False + +if __name__ == "__main__": + main() + diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix8-56x/classes/__init__.py b/platform/broadcom/sonic-platform-modules-quanta/ix8-56x/classes/__init__.py old mode 100755 new mode 100644 diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix8-56x/modules/Makefile b/platform/broadcom/sonic-platform-modules-quanta/ix8-56x/modules/Makefile old mode 100755 new mode 100644 index 011cd52d673d..8ea865a8b55f --- a/platform/broadcom/sonic-platform-modules-quanta/ix8-56x/modules/Makefile +++ b/platform/broadcom/sonic-platform-modules-quanta/ix8-56x/modules/Makefile @@ -1,3 +1,3 @@ -obj-m:=qci_cpld_sfp28.o qci_cpld_led.o qci_platform_ix8.o +obj-m:=qci_cpld_sfp28.o qci_cpld_led.o qci_platform_ix8.o quanta_hwmon_ipmi.o diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix8-56x/modules/qci_cpld_led.c b/platform/broadcom/sonic-platform-modules-quanta/ix8-56x/modules/qci_cpld_led.c old mode 100755 new mode 100644 index 37fc2e07246e..64841e8538f6 --- a/platform/broadcom/sonic-platform-modules-quanta/ix8-56x/modules/qci_cpld_led.c +++ b/platform/broadcom/sonic-platform-modules-quanta/ix8-56x/modules/qci_cpld_led.c @@ -241,6 +241,7 @@ static int cpld_led_probe(struct i2c_client *client, return nr; } +#if 0 /* FIXME: for older kernel doesn't with idr_is_empty function, implement here */ static int idr_has_entry(int id, void *p, void *data) { @@ -251,6 +252,7 @@ static bool cpld_idr_is_empty(struct idr *idp) { return !idr_for_each(idp, idr_has_entry, NULL); } +#endif static int cpld_led_remove(struct i2c_client *client) { @@ -261,8 +263,11 @@ static int cpld_led_remove(struct i2c_client *client) ida_simple_remove(&cpld_led_ida, data->cpld_data->cpld_id); kfree(data->cpld_data); - if (cpld_idr_is_empty(&cpld_led_ida.idr)) + if (ida_is_empty(&cpld_led_ida)) + { class_destroy(cpld_class); + cpld_class = NULL; + } return 0; } diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix8-56x/modules/qci_cpld_sfp28.c b/platform/broadcom/sonic-platform-modules-quanta/ix8-56x/modules/qci_cpld_sfp28.c old mode 100755 new mode 100644 index dac76667c6ca..61350cdd8c27 --- a/platform/broadcom/sonic-platform-modules-quanta/ix8-56x/modules/qci_cpld_sfp28.c +++ b/platform/broadcom/sonic-platform-modules-quanta/ix8-56x/modules/qci_cpld_sfp28.c @@ -298,7 +298,7 @@ static int cpld_probe(struct i2c_client *client, if (!cpld_class) { - cpld_class = class_create(THIS_MODULE, name); + cpld_class = class_create(THIS_MODULE, "cpld-sfp28"); if (IS_ERR(cpld_class)) { pr_err("couldn't create sysfs class\n"); return PTR_ERR(cpld_class); @@ -358,7 +358,7 @@ static int cpld_probe(struct i2c_client *client, } /* FIXME: for older kernel doesn't with idr_is_empty function, implement here */ -#if 1 +#if 0 static int idr_has_entry(int id, void *p, void *data) { return 1; @@ -384,8 +384,11 @@ static int cpld_remove(struct i2c_client *client) kfree(data->port_data[i]); } - if (cpld_idr_is_empty(&cpld_ida.idr)) + if (ida_is_empty(&cpld_ida)) + { class_destroy(cpld_class); + cpld_class = NULL; + } return 0; } diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix8-56x/modules/qci_platform_ix8.c b/platform/broadcom/sonic-platform-modules-quanta/ix8-56x/modules/qci_platform_ix8.c old mode 100755 new mode 100644 index d35a56641e38..51876246e1a2 --- a/platform/broadcom/sonic-platform-modules-quanta/ix8-56x/modules/qci_platform_ix8.c +++ b/platform/broadcom/sonic-platform-modules-quanta/ix8-56x/modules/qci_platform_ix8.c @@ -39,170 +39,13 @@ #include #include #include -#include +#include #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,16,0)) #include #else #include #endif -#define MUX_INFO(bus, deselect) \ - {.adap_id = bus, .deselect_on_exit = deselect} - -static struct pca954x_platform_mode pca9548sfp1_modes[] = { - MUX_INFO(0x20, 1), - MUX_INFO(0x21, 1), - MUX_INFO(0x22, 1), - MUX_INFO(0x23, 1), - MUX_INFO(0x24, 1), - MUX_INFO(0x25, 1), - MUX_INFO(0x26, 1), - MUX_INFO(0x27, 1), -}; - -static struct pca954x_platform_data pca9548sfp1_data = { - .modes = pca9548sfp1_modes, - .num_modes = 8, -}; - -static struct pca954x_platform_mode pca9548sfp2_modes[] = { - MUX_INFO(0x28, 1), - MUX_INFO(0x29, 1), - MUX_INFO(0x2a, 1), - MUX_INFO(0x2b, 1), - MUX_INFO(0x2c, 1), - MUX_INFO(0x2d, 1), - MUX_INFO(0x2e, 1), - MUX_INFO(0x2f, 1), -}; - -static struct pca954x_platform_data pca9548sfp2_data = { - .modes = pca9548sfp2_modes, - .num_modes = 8, -}; -static struct pca954x_platform_mode pca9548sfp3_modes[] = { - MUX_INFO(0x30, 1), - MUX_INFO(0x31, 1), - MUX_INFO(0x32, 1), - MUX_INFO(0x33, 1), - MUX_INFO(0x34, 1), - MUX_INFO(0x35, 1), - MUX_INFO(0x36, 1), - MUX_INFO(0x37, 1), -}; - -static struct pca954x_platform_data pca9548sfp3_data = { - .modes = pca9548sfp3_modes, - .num_modes = 8, -}; - -static struct pca954x_platform_mode pca9548sfp4_modes[] = { - MUX_INFO(0x38, 1), - MUX_INFO(0x39, 1), - MUX_INFO(0x3a, 1), - MUX_INFO(0x3b, 1), - MUX_INFO(0x3c, 1), - MUX_INFO(0x3d, 1), - MUX_INFO(0x3e, 1), - MUX_INFO(0x3f, 1), -}; - -static struct pca954x_platform_data pca9548sfp4_data = { - .modes = pca9548sfp4_modes, - .num_modes = 8, -}; - -static struct pca954x_platform_mode pca9548sfp5_modes[] = { - MUX_INFO(0x40, 1), - MUX_INFO(0x41, 1), - MUX_INFO(0x42, 1), - MUX_INFO(0x43, 1), - MUX_INFO(0x44, 1), - MUX_INFO(0x45, 1), - MUX_INFO(0x46, 1), - MUX_INFO(0x47, 1), -}; - -static struct pca954x_platform_data pca9548sfp5_data = { - .modes = pca9548sfp5_modes, - .num_modes = 8, -}; - -static struct pca954x_platform_mode pca9548sfp6_modes[] = { - MUX_INFO(0x48, 1), - MUX_INFO(0x49, 1), - MUX_INFO(0x4a, 1), - MUX_INFO(0x4b, 1), - MUX_INFO(0x4c, 1), - MUX_INFO(0x4d, 1), - MUX_INFO(0x4e, 1), - MUX_INFO(0x4f, 1), -}; - -static struct pca954x_platform_data pca9548sfp6_data = { - .modes = pca9548sfp6_modes, - .num_modes = 8, -}; - -//ZQSFP -static struct pca954x_platform_mode pca9548sfp7_modes[] = { - MUX_INFO(0x50, 1), - MUX_INFO(0x51, 1), - MUX_INFO(0x52, 1), - MUX_INFO(0x53, 1), - MUX_INFO(0x54, 1), - MUX_INFO(0x55, 1), - MUX_INFO(0x56, 1), - MUX_INFO(0x57, 1), -}; - -static struct pca954x_platform_data pca9548sfp7_data = { - .modes = pca9548sfp7_modes, - .num_modes = 8, -}; - -// end port - -static struct pca954x_platform_mode pca9546_modes[] = { - MUX_INFO(0x10, 1), - MUX_INFO(0x11, 1), - MUX_INFO(0x12, 1), - MUX_INFO(0x13, 1), -}; - -static struct pca954x_platform_data pca9546_data = { - .modes = pca9546_modes, - .num_modes = 4, -}; - -static struct pca954x_platform_mode pca9548_modes[] = { - MUX_INFO(0x14, 1), - MUX_INFO(0x15, 1), - MUX_INFO(0x16, 1), - MUX_INFO(0x17, 1), - MUX_INFO(0x18, 1), - MUX_INFO(0x19, 1), - MUX_INFO(0x1a, 1), - MUX_INFO(0x1b, 1), -}; - -static struct pca954x_platform_data pca9548_data = { - .modes = pca9548_modes, - .num_modes = 8, -}; - -/* CPU Board i2c device */ -static struct pca954x_platform_mode pca9546_cpu_modes[] = { - MUX_INFO(0x02, 1), - MUX_INFO(0x03, 1), - MUX_INFO(0x04, 1), - MUX_INFO(0x05, 1), -}; - -static struct pca954x_platform_data pca9546_cpu_data = { - .modes = pca9546_cpu_modes, - .num_modes = 4, -}; //MB Board Data static struct pca953x_platform_data pca9555_1_data = { .gpio_base = 0x10, @@ -218,42 +61,33 @@ static struct pca953x_platform_data pca9555_CPU_data = { static struct i2c_board_info ix8_i2c_devices[] = { { I2C_BOARD_INFO("pca9546", 0x72), // 0 - .platform_data = &pca9546_data, }, { I2C_BOARD_INFO("pca9548", 0x77), // 1 - .platform_data = &pca9548_data, }, { I2C_BOARD_INFO("24c02", 0x54), // 2 eeprom }, { I2C_BOARD_INFO("pca9548", 0x73), // 3 0x77 ch0 - .platform_data = &pca9548sfp1_data, }, { I2C_BOARD_INFO("pca9548", 0x73), // 4 0x77 ch1 - .platform_data = &pca9548sfp2_data, }, { I2C_BOARD_INFO("pca9548", 0x73), // 5 0x77 ch2 - .platform_data = &pca9548sfp3_data, }, { I2C_BOARD_INFO("pca9548", 0x73), // 6 0x77 ch3 - .platform_data = &pca9548sfp4_data, }, { I2C_BOARD_INFO("pca9548", 0x73), // 7 0x77 ch4 - .platform_data = &pca9548sfp5_data, }, { I2C_BOARD_INFO("pca9548", 0x73), // 8 0x77 ch5 - .platform_data = &pca9548sfp6_data, }, { I2C_BOARD_INFO("pca9548", 0x73), // 9 0x77 ch6 - .platform_data = &pca9548sfp7_data, }, { I2C_BOARD_INFO("CPLD-SFP28", 0x38), // 10 0x72 ch0 CPLD1_:SFP28 1~16 @@ -277,7 +111,6 @@ static struct i2c_board_info ix8_i2c_devices[] = { }, { I2C_BOARD_INFO("pca9546", 0x71), // 16 - .platform_data = &pca9546_cpu_data, }, { I2C_BOARD_INFO("pca9555", 0x20), // 17 0x71 ch0 CPU Board Data @@ -301,11 +134,33 @@ static struct platform_driver ix8_platform_driver = { }, }; +static struct i2c_adapter *i2c_get_adapter_wait(int nr) +{ + struct i2c_adapter *adap = NULL; + int i = 0; + + for (i = 0; i < 300; ++i) { + adap = i2c_get_adapter(nr); + if (adap) + break; + msleep(10); + } + + if (adap == NULL) + printk(KERN_ERR "%s: unable to get i2c adapter for bus %d\n", __FILE__, nr); + + return adap; +} + static struct platform_device *ix8_device; +static struct i2c_client **g_client; +static struct i2c_client **g_client_port; +int numof_i2c_devices = 19; // num of ix8_i2c_devices - 2 (for optoe1, optoe2) +int numof_ports = 56; + static int __init ix8_platform_init(void) { - struct i2c_client *client; struct i2c_adapter *adapter; int ret, i; @@ -324,76 +179,187 @@ static int __init ix8_platform_init(void) if (ret) goto fail_platform_device; - adapter = i2c_get_adapter(0); - client = i2c_new_device(adapter, &ix8_i2c_devices[0]); // pca9546 - client = i2c_new_device(adapter, &ix8_i2c_devices[1]); // pca9548 - client = i2c_new_device(adapter, &ix8_i2c_devices[16]); // pca9546cpu - i2c_put_adapter(adapter); - - adapter = i2c_get_adapter(0x02); - client = i2c_new_device(adapter, &ix8_i2c_devices[17]); // CPU Board Data - i2c_put_adapter(adapter); - - adapter = i2c_get_adapter(0x10); - client = i2c_new_device(adapter, &ix8_i2c_devices[10]); // CPLD_1 - client = i2c_new_device(adapter, &ix8_i2c_devices[18]); // CPLD_4 - client = i2c_new_device(adapter, &ix8_i2c_devices[19]); // CPLD_6 - i2c_put_adapter(adapter); - - adapter = i2c_get_adapter(0x11); - client = i2c_new_device(adapter, &ix8_i2c_devices[11]); // CPLD_2 - i2c_put_adapter(adapter); - - adapter = i2c_get_adapter(0x12); - client = i2c_new_device(adapter, &ix8_i2c_devices[12]); // CPLD_3 - client = i2c_new_device(adapter, &ix8_i2c_devices[2]); // MB_BOARDINFO_EEPROM - i2c_put_adapter(adapter); - - adapter = i2c_get_adapter(0x13); - client = i2c_new_device(adapter, &ix8_i2c_devices[13]); // MB Board Data - client = i2c_new_device(adapter, &ix8_i2c_devices[14]); // QSFP:49~52 - i2c_put_adapter(adapter); - - adapter = i2c_get_adapter(0x14); - client = i2c_new_device(adapter, &ix8_i2c_devices[3]); // pca9548_1 SFP - i2c_put_adapter(adapter); - - adapter = i2c_get_adapter(0x15); - client = i2c_new_device(adapter, &ix8_i2c_devices[4]); // pca9548_2 SFP - i2c_put_adapter(adapter); - - adapter = i2c_get_adapter(0x16); - client = i2c_new_device(adapter, &ix8_i2c_devices[5]); // pca9548_3 SFP - i2c_put_adapter(adapter); - - adapter = i2c_get_adapter(0x17); - client = i2c_new_device(adapter, &ix8_i2c_devices[6]); // pca9548_4 SFP - i2c_put_adapter(adapter); - - adapter = i2c_get_adapter(0x18); - client = i2c_new_device(adapter, &ix8_i2c_devices[7]); // pca9548_5 SFP - i2c_put_adapter(adapter); - - adapter = i2c_get_adapter(0x19); - client = i2c_new_device(adapter, &ix8_i2c_devices[8]); // pca9548_6 SFP - i2c_put_adapter(adapter); - - adapter = i2c_get_adapter(0x1a); - client = i2c_new_device(adapter, &ix8_i2c_devices[9]); // pca9548_7 QSFP - i2c_put_adapter(adapter); - - for(i = 80; i < 88; i ++){ // QSFP 49~56 EEPROM - adapter = i2c_get_adapter(i); - client = i2c_new_device(adapter, &ix8_i2c_devices[15]); + g_client = kmalloc(sizeof(*g_client) * numof_i2c_devices, GFP_KERNEL); + for (i = 0; i < numof_i2c_devices; i++) g_client[i] = NULL; + + g_client_port = kmalloc(sizeof(*g_client_port) * numof_ports, GFP_KERNEL); + for (i = 0; i < numof_ports; i++) g_client_port[i] = NULL; + + adapter = i2c_get_adapter_wait(0); + if (adapter == NULL) + { + printk("[%s] get i2c adapter fail at line %d", __FUNCTION__, __LINE__); + } + else + { + g_client[0] = i2c_new_device(adapter, &ix8_i2c_devices[0]); // pca9546 + g_client[1] = i2c_new_device(adapter, &ix8_i2c_devices[1]); // pca9548 + g_client[2] = i2c_new_device(adapter, &ix8_i2c_devices[16]); // pca9546cpu + i2c_put_adapter(adapter); + } + + adapter = i2c_get_adapter_wait(13); + if (adapter == NULL) + { + printk("[%s] get i2c adapter fail at line %d", __FUNCTION__, __LINE__); + } + else + { + g_client[3] = i2c_new_device(adapter, &ix8_i2c_devices[17]); // CPU Board Data + i2c_put_adapter(adapter); + } + + adapter = i2c_get_adapter_wait(1); + if (adapter == NULL) + { + printk("[%s] get i2c adapter fail at line %d", __FUNCTION__, __LINE__); + } + else + { + g_client[4] = i2c_new_device(adapter, &ix8_i2c_devices[10]); // CPLD_1 + g_client[5] = i2c_new_device(adapter, &ix8_i2c_devices[18]); // CPLD_4 + g_client[6] = i2c_new_device(adapter, &ix8_i2c_devices[19]); // CPLD_6 i2c_put_adapter(adapter); } - for(i = 32; i < 80; i ++){ // SFP28 1~48 EEPROM - adapter = i2c_get_adapter(i); - client = i2c_new_device(adapter, &ix8_i2c_devices[20]); + adapter = i2c_get_adapter_wait(2); + if (adapter == NULL) + { + printk("[%s] get i2c adapter fail at line %d", __FUNCTION__, __LINE__); + } + else + { + g_client[7] = i2c_new_device(adapter, &ix8_i2c_devices[11]); // CPLD_2 i2c_put_adapter(adapter); } + adapter = i2c_get_adapter_wait(3); + if (adapter == NULL) + { + printk("[%s] get i2c adapter fail at line %d", __FUNCTION__, __LINE__); + } + else + { + g_client[8] = i2c_new_device(adapter, &ix8_i2c_devices[12]); // CPLD_3 + g_client[9] = i2c_new_device(adapter, &ix8_i2c_devices[2]); // MB_BOARDINFO_EEPROM + i2c_put_adapter(adapter); + } + + adapter = i2c_get_adapter_wait(4); + if (adapter == NULL) + { + printk("[%s] get i2c adapter fail at line %d", __FUNCTION__, __LINE__); + } + else + { + g_client[10] = i2c_new_device(adapter, &ix8_i2c_devices[13]); // MB Board Data + g_client[11] = i2c_new_device(adapter, &ix8_i2c_devices[14]); // QSFP:49~52 + i2c_put_adapter(adapter); + } + + adapter = i2c_get_adapter_wait(5); + if (adapter == NULL) + { + printk("[%s] get i2c adapter fail at line %d", __FUNCTION__, __LINE__); + } + else + { + g_client[12] = i2c_new_device(adapter, &ix8_i2c_devices[3]); // pca9548_1 SFP + i2c_put_adapter(adapter); + } + + adapter = i2c_get_adapter_wait(6); + if (adapter == NULL) + { + printk("[%s] get i2c adapter fail at line %d", __FUNCTION__, __LINE__); + } + else + { + g_client[13] = i2c_new_device(adapter, &ix8_i2c_devices[4]); // pca9548_2 SFP + i2c_put_adapter(adapter); + } + + adapter = i2c_get_adapter_wait(7); + if (adapter == NULL) + { + printk("[%s] get i2c adapter fail at line %d", __FUNCTION__, __LINE__); + } + else + { + g_client[14] = i2c_new_device(adapter, &ix8_i2c_devices[5]); // pca9548_3 SFP + i2c_put_adapter(adapter); + } + + adapter = i2c_get_adapter_wait(8); + if (adapter == NULL) + { + printk("[%s] get i2c adapter fail at line %d", __FUNCTION__, __LINE__); + } + else + { + g_client[15] = i2c_new_device(adapter, &ix8_i2c_devices[6]); // pca9548_4 SFP + i2c_put_adapter(adapter); + } + + adapter = i2c_get_adapter_wait(9); + if (adapter == NULL) + { + printk("[%s] get i2c adapter fail at line %d", __FUNCTION__, __LINE__); + } + else + { + g_client[16] = i2c_new_device(adapter, &ix8_i2c_devices[7]); // pca9548_5 SFP + i2c_put_adapter(adapter); + } + + adapter = i2c_get_adapter_wait(10); + if (adapter == NULL) + { + printk("[%s] get i2c adapter fail at line %d", __FUNCTION__, __LINE__); + } + else + { + g_client[17] = i2c_new_device(adapter, &ix8_i2c_devices[8]); // pca9548_6 SFP + i2c_put_adapter(adapter); + } + + adapter = i2c_get_adapter_wait(11); + if (adapter == NULL) + { + printk("[%s] get i2c adapter fail at line %d", __FUNCTION__, __LINE__); + } + else + { + g_client[18] = i2c_new_device(adapter, &ix8_i2c_devices[9]); // pca9548_7 QSFP + i2c_put_adapter(adapter); + } + + for(i = 65; i < 73; i ++){ // QSFP 49~56 EEPROM + adapter = i2c_get_adapter_wait(i); + if (adapter == NULL) + { + printk("[%s] get i2c adapter fail at line %d", __FUNCTION__, __LINE__); + } + else + { + g_client_port[i - 17] = i2c_new_device(adapter, &ix8_i2c_devices[15]); + i2c_put_adapter(adapter); + } + } + + for(i = 17; i < 65; i ++){ // SFP28 1~48 EEPROM + if (adapter == NULL) + { + printk("[%s] get i2c adapter fail at line %d", __FUNCTION__, __LINE__); + } + else + { + adapter = i2c_get_adapter_wait(i); + g_client_port[i - 17] = i2c_new_device(adapter, &ix8_i2c_devices[20]); + i2c_put_adapter(adapter); + } + } + return 0; fail_platform_device: @@ -406,6 +372,26 @@ static int __init ix8_platform_init(void) static void __exit ix8_platform_exit(void) { + int i = 0; + + for (i = numof_ports - 1; i >= 0; i--) + { + if (g_client_port[i]) + { + i2c_unregister_device(g_client_port[i]); + g_client_port[i] = NULL; + } + } + + for (i = numof_i2c_devices - 1; i >= 0; i--) + { + if (g_client[i]) + { + i2c_unregister_device(g_client[i]); + g_client[i] = NULL; + } + } + platform_device_unregister(ix8_device); platform_driver_unregister(&ix8_platform_driver); } diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix8-56x/modules/quanta_hwmon_ipmi.c b/platform/broadcom/sonic-platform-modules-quanta/ix8-56x/modules/quanta_hwmon_ipmi.c new file mode 100644 index 000000000000..5c9570c1035a --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix8-56x/modules/quanta_hwmon_ipmi.c @@ -0,0 +1,1909 @@ +/* +* +* A hwmon driver for the Quanta switch BMC hwmon +* +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define enable_debug_msg 0 +#define DEBUGUSE_SHIFT 0 + +#define DRVNAME "quanta_hwmon_ipmi" + +#define tos32(val, bits) ((val & ((1<<((bits)-1)))) ? (-((val) & (1<<((bits)-1))) | (val)) : (val)) +#define BSWAP_16(x) ((((x) & 0xff00) >> 8) | (((x) & 0x00ff) << 8)) +#define BSWAP_32(x) ((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >> 8) | (((x) & 0x0000ff00) << 8) | (((x) & 0x000000ff) << 24)) +#define __TO_M(mtol) (int16_t)(tos32((((BSWAP_16(mtol) & 0xff00) >> 8) | ((BSWAP_16(mtol) & 0xc0) << 2)), 10)) +#define __TO_B(bacc) (int32_t)(tos32((((BSWAP_32(bacc) & 0xff000000) >> 24) | ((BSWAP_32(bacc) & 0xc00000) >> 14)), 10)) +#define __TO_R_EXP(bacc) (int32_t)(tos32(((BSWAP_32(bacc) & 0xf0) >> 4), 4)) +#define __TO_B_EXP(bacc) (int32_t)(tos32((BSWAP_32(bacc) & 0xf), 4)) + +#define SENSOR_ATTR_MAX 19 +#define SENSOR_ATTR_NAME_LENGTH 20 + +#define SENSOR_GET_CAP_LABEL 0x001 +#define SENSOR_GET_CAP_ALARM 0x002 +#define SENSOR_GET_CAP_INPUT 0x004 + +#define SENSOR_GET_CAP_LNC 0x008 +#define SENSOR_GET_CAP_LCR 0x010 +#define SENSOR_GET_CAP_LNR 0x020 + +#define SENSOR_GET_CAP_UNC 0x040 +#define SENSOR_GET_CAP_UCR 0x080 +#define SENSOR_GET_CAP_UNR 0x100 + +#define SENSOR_GET_CAP_MODEL 0x200 +#define SENSOR_GET_CAP_SN 0x400 +#define SENSOR_GET_CAP_PWM 0x800 + +#define SENSOR_GET_CAP_CONMODE 0x1000 +#define SENSOR_GET_CAP_DIRECTION 0x2000 +#define SENSOR_GET_CAP_FAN_PRESENT 0x4000 +#define SENSOR_GET_CAP_PSU_PRESENT 0x8000 + +#define SENSOR_GET_CAP_MFRID 0x10000 +#define SENSOR_GET_CAP_VIN_TYPE 0x20000 +#define SENSOR_GET_CAP_POUT_MAX 0x40000 + +#define SDR_SENSOR_TYPE_TEMP 0x01 +#define SDR_SENSOR_TYPE_VOLT 0x02 +#define SDR_SENSOR_TYPE_CURR 0x03 +#define SDR_SENSOR_TYPE_FAN 0x04 +#define SDR_SENSOR_TYPE_PS 0x08 +#define SDR_SENSOR_TYPE_OTHER 0x0b + +#define BMC_GET_DEVICE_ID 0x01 + +#define IPMI_NETFN_SE 0x04 +#define IPMI_NETFN_APP 0x06 +#define IPMI_NETFN_STORAGE 0x0a +#define IPMI_NETFN_TSOL 0x30 + +#define GET_SDR_REPO_INFO 0x20 +#define GET_DEVICE_SDR 0x21 +#define GET_SDR_RESERVE_REPO 0x22 +#define GET_SDR 0x23 +#define GET_SENSOR_THRESHOLDS 0x27 +#define GET_SENSOR_EVENT_ENABLE 0x29 +#define GET_SENSOR_EVENT_STATUS 0x2b +#define GET_SENSOR_READING 0x2d +#define GET_PSU_READING 0x52 +#define GET_FAN_INFO 0xd6 +#define GET_FRU_INFO 0x11 + +#define IPM_DEV_DEVICE_ID_SDR_MASK (0x80) /* 1 = provides SDRs */ +#define IPMI_TIMEOUT (4 * HZ) +#define IPMI_MAX_WAIT_QUEUE 1 + +struct quanta_hwmon_ipmi_data +{ + struct platform_device *ipmi_platform_dev; + struct device *ipmi_hwmon_dev; + /*struct mutex ipmi_lock; */ + + int32_t total_sensor_id; + int32_t total_suport_sensor; + int32_t total_create_sysfs; +} *data; + +static struct mutex ipmi_lock; +static struct completion g_read_complete; + +static ipmi_user_t ipmi_mh_user = NULL; + +static int8_t g_fan_control_mode = 3; +static int32_t g_use_built_in = 0; +static int32_t ipmi_wait_queue = 0; + +struct ipmi_sensor_data +{ + uint8_t addr; + uint8_t sensor_type; + uint8_t sensor_idstring[SENSOR_ATTR_NAME_LENGTH]; + + uint32_t capability; + + struct header_info + { + uint8_t header_type; + uint8_t header_byte; + } headerinfo; + + struct record_info + { + uint8_t record_analog; + uint8_t record_linearization; + + int32_t record_m; + int32_t record_b; + int32_t record_k1; + int32_t record_k2; + } recordinfo; + + struct threshold_upper_info + { + uint8_t unr; + uint8_t ucr; + uint8_t unc; + } upperinfo; + + struct threshold_lower_info + { + uint8_t lnr; + uint8_t lcr; + uint8_t lnc; + } lowerinfo; + + struct attr_info + { + bool attr_exist; + char attr_name[SENSOR_ATTR_MAX][SENSOR_ATTR_NAME_LENGTH]; + char attr_type_str[SENSOR_ATTR_NAME_LENGTH]; + + struct attribute *attrs[SENSOR_ATTR_MAX + 1]; + struct attribute_group attr_group; + struct sensor_device_attribute sd_attrs[SENSOR_ATTR_MAX + 1]; + } attrinfo; + +} *g_sensor_data; + +struct ipmi_comm_data +{ + int32_t tx_id; + + int32_t rx_result; + int64_t rx_len; + void *rx_data; + struct completion *rx_read_complete; +}; + +struct ipmi_sdr_iterator +{ + uint16_t reservation; + int32_t total; + int32_t next; +}; + +struct ipm_devid_rsp +{ + uint8_t device_id; + uint8_t device_revision; + uint8_t fw_rev1; + uint8_t fw_rev2; + uint8_t ipmi_version; + uint8_t adtl_device_support; + uint8_t manufacturer_id[3]; + uint8_t product_id[2]; + uint8_t aux_fw_rev[4]; +} __attribute__((packed)); + +struct sdr_repo_info_rs +{ + uint8_t version; /* SDR version (51h) */ + uint16_t count; /* number of records */ + uint16_t free; /* free space in SDR */ + uint32_t add_stamp; /* last add timestamp */ + uint32_t erase_stamp; /* last del timestamp */ + uint8_t op_support; /* supported operations */ +} __attribute__((packed)); + +struct sdr_device_info_rs +{ + uint8_t count; /* number of records */ + uint8_t flags; /* flags */ + uint8_t popChangeInd[3]; /* free space in SDR */ +} __attribute__((packed)); + +struct sdr_get_rs +{ + uint16_t next; /* next record id */ + uint16_t id; /* record ID */ + uint8_t version; /* SDR version (51h) */ +#define SDR_RECORD_TYPE_FULL_SENSOR 0x01 +#define SDR_RECORD_TYPE_COMPACT_SENSOR 0x02 +#define SDR_RECORD_TYPE_EVENTONLY_SENSOR 0x03 +#define SDR_RECORD_TYPE_ENTITY_ASSOC 0x08 +#define SDR_RECORD_TYPE_DEVICE_ENTITY_ASSOC 0x09 +#define SDR_RECORD_TYPE_GENERIC_DEVICE_LOCATOR 0x10 +#define SDR_RECORD_TYPE_FRU_DEVICE_LOCATOR 0x11 +#define SDR_RECORD_TYPE_MC_DEVICE_LOCATOR 0x12 +#define SDR_RECORD_TYPE_MC_CONFIRMATION 0x13 +#define SDR_RECORD_TYPE_BMC_MSG_CHANNEL_INFO 0x14 +#define SDR_RECORD_TYPE_OEM 0xc0 + uint8_t type; /* record type */ + uint8_t length; /* remaining record bytes */ +} __attribute__((packed)); + +struct sdr_get_rq +{ + uint16_t reserve_id; /* reservation ID */ + uint16_t id; /* record ID */ + uint8_t offset; /* offset into SDR */ +#define GET_SDR_ENTIRE_RECORD 0xff + uint8_t length; /* length to read */ +} __attribute__((packed)); + +struct entity_id +{ + uint8_t id; /* physical entity id */ +#ifdef WORDS_BIGENDIAN + uint8_t logical : 1; /* physical/logical */ + uint8_t instance : 7; /* instance number */ +#else + uint8_t instance : 7; /* instance number */ + uint8_t logical : 1; /* physical/logical */ +#endif +} __attribute__((packed)); + +struct sdr_record_mask +{ + union + { + struct + { + uint16_t assert_event; /* assertion event mask */ + uint16_t deassert_event; /* de-assertion event mask */ + uint16_t read; /* discrete reading mask */ + } discrete; + struct + { +#ifdef WORDS_BIGENDIAN + uint16_t reserved : 1; + uint16_t status_lnr : 1; + uint16_t status_lcr : 1; + uint16_t status_lnc : 1; + uint16_t assert_unr_high : 1; + uint16_t assert_unr_low : 1; + uint16_t assert_ucr_high : 1; + uint16_t assert_ucr_low : 1; + uint16_t assert_unc_high : 1; + uint16_t assert_unc_low : 1; + uint16_t assert_lnr_high : 1; + uint16_t assert_lnr_low : 1; + uint16_t assert_lcr_high : 1; + uint16_t assert_lcr_low : 1; + uint16_t assert_lnc_high : 1; + uint16_t assert_lnc_low : 1; +#else + uint16_t assert_lnc_low : 1; + uint16_t assert_lnc_high : 1; + uint16_t assert_lcr_low : 1; + uint16_t assert_lcr_high : 1; + uint16_t assert_lnr_low : 1; + uint16_t assert_lnr_high : 1; + uint16_t assert_unc_low : 1; + uint16_t assert_unc_high : 1; + uint16_t assert_ucr_low : 1; + uint16_t assert_ucr_high : 1; + uint16_t assert_unr_low : 1; + uint16_t assert_unr_high : 1; + uint16_t status_lnc : 1; + uint16_t status_lcr : 1; + uint16_t status_lnr : 1; + uint16_t reserved : 1; +#endif +#ifdef WORDS_BIGENDIAN + uint16_t reserved_2 : 1; + uint16_t status_unr : 1; + uint16_t status_ucr : 1; + uint16_t status_unc : 1; + uint16_t deassert_unr_high : 1; + uint16_t deassert_unr_low : 1; + uint16_t deassert_ucr_high : 1; + uint16_t deassert_ucr_low : 1; + uint16_t deassert_unc_high : 1; + uint16_t deassert_unc_low : 1; + uint16_t deassert_lnr_high : 1; + uint16_t deassert_lnr_low : 1; + uint16_t deassert_lcr_high : 1; + uint16_t deassert_lcr_low : 1; + uint16_t deassert_lnc_high : 1; + uint16_t deassert_lnc_low : 1; +#else + uint16_t deassert_lnc_low : 1; + uint16_t deassert_lnc_high : 1; + uint16_t deassert_lcr_low : 1; + uint16_t deassert_lcr_high : 1; + uint16_t deassert_lnr_low : 1; + uint16_t deassert_lnr_high : 1; + uint16_t deassert_unc_low : 1; + uint16_t deassert_unc_high : 1; + uint16_t deassert_ucr_low : 1; + uint16_t deassert_ucr_high : 1; + uint16_t deassert_unr_low : 1; + uint16_t deassert_unr_high : 1; + uint16_t status_unc : 1; + uint16_t status_ucr : 1; + uint16_t status_unr : 1; + uint16_t reserved_2 : 1; +#endif + union + { + struct + { +#ifdef WORDS_BIGENDIAN /* settable threshold mask */ + uint16_t reserved : 2; + uint16_t unr : 1; + uint16_t ucr : 1; + uint16_t unc : 1; + uint16_t lnr : 1; + uint16_t lcr : 1; + uint16_t lnc : 1; + /* padding lower 8 bits */ + uint16_t readable : 8; +#else + uint16_t readable : 8; + uint16_t lnc : 1; + uint16_t lcr : 1; + uint16_t lnr : 1; + uint16_t unc : 1; + uint16_t ucr : 1; + uint16_t unr : 1; + uint16_t reserved : 2; +#endif + } set; + struct + { +#ifdef WORDS_BIGENDIAN /* readable threshold mask */ + /* padding upper 8 bits */ + uint16_t settable : 8; + uint16_t reserved : 2; + uint16_t unr : 1; + uint16_t ucr : 1; + uint16_t unc : 1; + uint16_t lnr : 1; + uint16_t lcr : 1; + uint16_t lnc : 1; +#else + uint16_t lnc : 1; + uint16_t lcr : 1; + uint16_t lnr : 1; + uint16_t unc : 1; + uint16_t ucr : 1; + uint16_t unr : 1; + uint16_t reserved : 2; + uint16_t settable : 8; +#endif + } read; + }; + } threshold; + } type; +} __attribute__((packed)); + +struct sdr_record_full_sensor +{ + struct + { + uint8_t owner_id; +#ifdef WORDS_BIGENDIAN + uint8_t channel : 4; /* channel number */ + uint8_t __reserved : 2; + uint8_t lun : 2; /* sensor owner lun */ +#else + uint8_t lun : 2; /* sensor owner lun */ + uint8_t __reserved : 2; + uint8_t channel : 4; /* channel number */ +#endif + uint8_t sensor_num; /* unique sensor number */ + } keys; + + struct entity_id entity; + + struct + { + struct + { +#ifdef WORDS_BIGENDIAN + uint8_t __reserved : 1; + uint8_t scanning : 1; + uint8_t events : 1; + uint8_t thresholds : 1; + uint8_t hysteresis : 1; + uint8_t type : 1; + uint8_t event_gen : 1; + uint8_t sensor_scan : 1; +#else + uint8_t sensor_scan : 1; + uint8_t event_gen : 1; + uint8_t type : 1; + uint8_t hysteresis : 1; + uint8_t thresholds : 1; + uint8_t events : 1; + uint8_t scanning : 1; + uint8_t __reserved : 1; +#endif + } init; + struct + { +#ifdef WORDS_BIGENDIAN + uint8_t ignore : 1; + uint8_t rearm : 1; + uint8_t hysteresis : 2; + uint8_t threshold : 2; + uint8_t event_msg : 2; +#else + uint8_t event_msg : 2; + uint8_t threshold : 2; + uint8_t hysteresis : 2; + uint8_t rearm : 1; + uint8_t ignore : 1; +#endif + } capabilities; + uint8_t type; + } sensor; + + uint8_t event_type; /* event/reading type code */ + + struct sdr_record_mask mask; + + struct + { +#ifdef WORDS_BIGENDIAN + uint8_t analog : 2; + uint8_t rate : 3; + uint8_t modifier : 2; + uint8_t pct : 1; +#else + uint8_t pct : 1; + uint8_t modifier : 2; + uint8_t rate : 3; + uint8_t analog : 2; +#endif + struct + { + uint8_t base; + uint8_t modifier; + } type; + } unit; + +#define SDR_SENSOR_L_LINEAR 0x00 +#define SDR_SENSOR_L_LN 0x01 +#define SDR_SENSOR_L_LOG10 0x02 +#define SDR_SENSOR_L_LOG2 0x03 +#define SDR_SENSOR_L_E 0x04 +#define SDR_SENSOR_L_EXP10 0x05 +#define SDR_SENSOR_L_EXP2 0x06 +#define SDR_SENSOR_L_1_X 0x07 +#define SDR_SENSOR_L_SQR 0x08 +#define SDR_SENSOR_L_CUBE 0x09 +#define SDR_SENSOR_L_SQRT 0x0a +#define SDR_SENSOR_L_CUBERT 0x0b +#define SDR_SENSOR_L_NONLINEAR 0x70 + + uint8_t linearization; /* 70h=non linear, 71h-7Fh=non linear, OEM */ + uint16_t mtol; /* M, tolerance */ + uint32_t bacc; /* accuracy, B, Bexp, Rexp */ + + struct + { +#ifdef WORDS_BIGENDIAN + uint8_t __reserved : 5; + uint8_t normal_min : 1; /* normal min field specified */ + uint8_t normal_max : 1; /* normal max field specified */ + uint8_t nominal_read : 1; /* nominal reading field specified */ +#else + uint8_t nominal_read : 1; /* nominal reading field specified */ + uint8_t normal_max : 1; /* normal max field specified */ + uint8_t normal_min : 1; /* normal min field specified */ + uint8_t __reserved : 5; +#endif + } analog_flag; + + uint8_t nominal_read; /* nominal reading, raw value */ + uint8_t normal_max; /* normal maximum, raw value */ + uint8_t normal_min; /* normal minimum, raw value */ + uint8_t sensor_max; /* sensor maximum, raw value */ + uint8_t sensor_min; /* sensor minimum, raw value */ + + struct + { + struct + { + uint8_t non_recover; + uint8_t critical; + uint8_t non_critical; + } upper; + struct + { + uint8_t non_recover; + uint8_t critical; + uint8_t non_critical; + } lower; + struct + { + uint8_t positive; + uint8_t negative; + } hysteresis; + } threshold; + uint8_t __reserved[2]; + uint8_t oem; /* reserved for OEM use */ + uint8_t id_code; /* sensor ID string type/length code */ + uint8_t id_string[16]; /* sensor ID string bytes, only if id_code != 0 */ +} __attribute__((packed)); + +int32_t pow_convert(int32_t *a, int32_t b) +{ + /* function input parameter (a * 10 ^ b) */ + int32_t i = 0, r = 1, temp_b = 0; + + temp_b = (b > 0) ? b : -b; + + for (i = 0; i < temp_b; i++) + { + r = r * 10; + } + + if (b > 0) + { + *a = (*a) * r; + r = 1; + } + /* function return parameter calc_result = *a, decimal_point = r */ + return r; +} + +void simple_atoi(const char *buf, int8_t *output_val) +{ + while (*buf >= '0' && *buf <= '9') + { + *output_val = *output_val * 10 + *buf - '0'; + buf++; + } +} + +static void ipmi_msg_handler(struct ipmi_recv_msg *msg, void *handler_data) +{ + int32_t rv = -IPMI_UNKNOWN_ERR_COMPLETION_CODE; + + struct ipmi_comm_data *comm_data = msg->user_msg_data; + + ipmi_wait_queue--; + + if (msg->msg.data[0] != 0) + { + if ((msg->msg.data[0] != 0x83) && (msg->msg.netfn != 0x07) + && (msg->msg.cmd != 0x52)) + { + /*skip master r/w cmd return code */ + printk("ipmi: Error 0x%x on cmd 0x%x/0x%x\n", msg->msg.data[0], msg->msg.netfn, + msg->msg.cmd); + rv = msg->msg.data[0]; + goto get_BMC_response_fail; + } + } + + if (msg->msgid != comm_data->tx_id) + { + printk("ipmi: rx msgid %d mismatch tx msgid %d\n", (int32_t)msg->msgid, + comm_data->tx_id); + goto get_BMC_response_fail; + } + + if (msg->msg.data_len <= 0) + { + printk("ipmi: Data len too low (%d)\n", msg->msg.data_len); + goto get_BMC_response_fail; + } + + if (msg->msg.data_len > 1) + { + if (comm_data->rx_len) + { + comm_data->rx_len = msg->msg.data_len - 1; + memcpy(comm_data->rx_data, msg->msg.data + 1, comm_data->rx_len); + } + else + { + printk("ipmi: rx len = 0, it should be not retrun ?\n"); + goto get_BMC_response_fail; + } + } + + rv = 0; + +get_BMC_response_fail: + ipmi_free_recv_msg(msg); + + if (ipmi_wait_queue == 0) + { + comm_data->rx_result = rv; + if (rv == 0) + { + complete(comm_data->rx_read_complete); + } + } +} +static struct ipmi_user_hndl ipmi_hndlrs = { .ipmi_recv_hndl = ipmi_msg_handler, }; + +int32_t ipmi_request_wait_for_response(struct kernel_ipmi_msg msg, + struct ipmi_comm_data *comm_data) +{ + int32_t rv = 0; + int32_t escape_time = 0; + + struct ipmi_addr ipmi_address; + + if (ipmi_wait_queue >= IPMI_MAX_WAIT_QUEUE) + { + /* printk("msg queue full, cannot send ipmi cmd\n"); */ + return -EBUSY; + } + ipmi_wait_queue++; + + ipmi_address.addr_type = IPMI_SYSTEM_INTERFACE_ADDR_TYPE; + ipmi_address.channel = IPMI_BMC_CHANNEL; + ipmi_address.data[0] = 0; + + rv = ipmi_validate_addr(&ipmi_address, sizeof(ipmi_address)); + if (rv) + { + printk("ipmi_validate_addr fail, err code : %d\n", rv); + return rv; + } + + ipmi_request_settime(ipmi_mh_user, &ipmi_address, comm_data->tx_id, &msg, + comm_data, 0, 0, 0); + + escape_time = wait_for_completion_timeout(comm_data->rx_read_complete, + IPMI_TIMEOUT); + + rv = comm_data->rx_result; + if (escape_time == 0) + { + printk("BMC not response (%d)\n", escape_time); + } + + return rv; +} + +int32_t ipmi_send_system_cmd(uint8_t *msg_tx_data, int32_t msg_tx_len, + void *msg_rx_data, int32_t msg_rx_len) +{ + int32_t i = 0; + int32_t rv = 0; + + static uint64_t tx_msgid = 1; + + struct kernel_ipmi_msg msg; + struct ipmi_comm_data *comm_data = NULL; + struct completion read_complete; + + init_completion(&read_complete); + + /* prepare transfer message */ + msg.netfn = msg_tx_data[0]; + msg.cmd = msg_tx_data[1]; + msg.data_len = msg_tx_len - 2; + + msg.data = kzalloc(msg.data_len, GFP_KERNEL); + if (msg.data == NULL) + { + printk("%s(%d): malloc [msg.data] failure", __func__, __LINE__); + rv = -ENOMEM; + goto alloc_mem_fail; + } + + comm_data = kzalloc(sizeof(struct ipmi_comm_data), GFP_KERNEL); + if (comm_data == NULL) + { + printk("%s(%d): malloc [comm_data] failure", __func__, __LINE__); + rv = -ENOMEM; + goto alloc_mem_fail; + } + + for (i = 2; i < msg_tx_len; i++) + { + msg.data[i - 2] = msg_tx_data[i]; + } + + comm_data->tx_id = tx_msgid++; + + /* prepare recive message */ + comm_data->rx_data = msg_rx_data; + comm_data->rx_len = msg_rx_len; + comm_data->rx_result = -1; + comm_data->rx_read_complete = &read_complete; + + rv = ipmi_request_wait_for_response(msg, comm_data); + +alloc_mem_fail: + if (msg.data) + { + kfree(msg.data); + } + if (comm_data) + { + kfree(comm_data); + } + if (tx_msgid > UINT_MAX) + { + tx_msgid = 1; + } + + return rv; +} + +int32_t ipmi_sdr_get_reservation(uint16_t *reserve_id) +{ + int32_t rv = 0; + uint8_t msg_data[] = { 0x00, GET_SDR_RESERVE_REPO }; /*netfn = 0x00; cmd = GET_SDR_RESERVE_REPO; */ + + msg_data[0] = (g_use_built_in == 0) ? IPMI_NETFN_STORAGE : IPMI_NETFN_SE; + + /* obtain reservation ID */ + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), reserve_id, 1); + if (rv) + { + printk("BMC down at (%d)!!\n", __LINE__); + } + +#if enable_debug_msg + printk("SDR reservation ID %04x\n", *reserve_id); +#endif + + return rv; +} + +int32_t ipmi_sdr_start(struct ipmi_sdr_iterator *itr) +{ + int32_t rv = 0; + + uint8_t msg_data[] = { IPMI_NETFN_APP, BMC_GET_DEVICE_ID }; /*netfn = IPMI_NETFN_APP; cmd = BMC_GET_DEVICE_ID; */ + + struct ipm_devid_rsp devid; + + /* check SDRR capability */ + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), &devid, 1); + if (rv) + { + printk("BMC down at (%d)!!\n", __LINE__); + return rv; + } + + if (devid.device_revision & IPM_DEV_DEVICE_ID_SDR_MASK) + { + if ((devid.adtl_device_support & 0x02) == 0) + { + if ((devid.adtl_device_support & 0x01)) + { + printk("Using Device SDRs\n"); + g_use_built_in = 1; + } + else + { + printk("Error obtaining SDR info\n"); + } + } + } + + if (g_use_built_in == 0) + { + struct sdr_repo_info_rs sdr_info; + /* get sdr repository info */ + msg_data[0] = IPMI_NETFN_STORAGE; + msg_data[1] = GET_SDR_REPO_INFO; + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), &sdr_info, 1); + itr->total = sdr_info.count; + +#if enable_debug_msg + printk("SDR version: 0x%x\n", sdr_info.version); + printk("SDR free space: %d\n", sdr_info.free); +#endif + } + else + { + struct sdr_device_info_rs sdr_info; + /* get device sdr info */ + msg_data[0] = IPMI_NETFN_SE; + msg_data[1] = GET_SDR_REPO_INFO; + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), &sdr_info, 1); + itr->total = sdr_info.count; + } + +#if enable_debug_msg + printk("SDR records : %d\n", sdr_info.count); +#endif + + if (rv) + { + printk("BMC down at (%d)!!\n", __LINE__); + } + else + { + itr->next = 0; + rv = ipmi_sdr_get_reservation(&(itr->reservation)); + } + + return rv; +} + +int32_t ipmi_sdr_get_header(struct ipmi_sdr_iterator *itr, + struct sdr_get_rs *sdr_rs) +{ + int32_t rv = 0; + + uint8_t msg_data[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; /*netfn = 0x00; cmd = 0x00; */ + + struct sdr_get_rq sdr_rq; + + sdr_rq.reserve_id = itr->reservation; + sdr_rq.id = itr->next; + sdr_rq.offset = 0; + sdr_rq.length = 5; /* only get the header */ + + if (g_use_built_in == 0) + { + msg_data[0] = IPMI_NETFN_STORAGE; + msg_data[1] = GET_SDR; + } + else + { + msg_data[0] = IPMI_NETFN_SE; + msg_data[1] = GET_DEVICE_SDR; + } + + memcpy(msg_data + 2, (uint8_t *)&sdr_rq, sizeof(struct sdr_get_rq)); + + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), sdr_rs, 1); + if ((rv) || (sdr_rs->length == 0)) + { + printk("SDR record id 0x%04x: invalid length %d", itr->next, sdr_rs->length); + return -1; + } + + if (sdr_rs->id != itr->next) + { +#if enable_debug_msg + printk("SDR record id mismatch: 0x%04x\n", sdr_rs->id); +#endif + sdr_rs->id = itr->next; + } +#if enable_debug_msg + printk("\nSDR record ID : 0x%04x", itr->next); + printk("SDR record type : 0x%02x\n", sdr_rs->type); + printk("SDR record next : 0x%04x\n", sdr_rs->next); + printk("SDR record bytes: %d\n", sdr_rs->length); +#endif + + return rv; +} + +int32_t ipmi_sdr_get_record(struct sdr_get_rs *header, + struct ipmi_sdr_iterator *itr, uint8_t *ret_data) +{ + int32_t rv = 0, len = 0; + + uint8_t buff[128] = ""; + uint8_t msg_data[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; /*netfn = 0x00; cmd = 0x00; */ + + struct sdr_get_rq sdr_rq; + + len = header->length; + if (len > 0) + { + memset(&sdr_rq, 0, sizeof(sdr_rq)); + sdr_rq.reserve_id = itr->reservation; + sdr_rq.id = header->id; + sdr_rq.offset = 5; + sdr_rq.length = len; + + if (g_use_built_in == 0) + { + msg_data[0] = IPMI_NETFN_STORAGE; + msg_data[1] = GET_SDR; + } + else + { + msg_data[0] = IPMI_NETFN_SE; + msg_data[1] = GET_DEVICE_SDR; + } + + memcpy(msg_data + 2, (uint8_t *)&sdr_rq, sizeof(struct sdr_get_rq)); + + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), ret_data, 1); + if (rv) + { + printk("BMC down at (%d)!!\n", __LINE__); + } + else + { + memset(buff, 0, sizeof(buff)); + memcpy(buff, ret_data + 2, sdr_rq.length); + memcpy(ret_data, buff, sdr_rq.length + 2); + } + } + + return rv; +} + +void ipmi_sdr_set_sensor_threshold(uint8_t idx, + struct sdr_record_full_sensor *sensor) +{ + + /* lower threshold info */ + if (sensor->mask.type.threshold.read.lnc) + { + g_sensor_data[idx].capability |= SENSOR_GET_CAP_LNC; + } + if (sensor->mask.type.threshold.read.lcr) + { + g_sensor_data[idx].capability |= SENSOR_GET_CAP_LCR; + } + if (sensor->mask.type.threshold.read.lnr) + { + g_sensor_data[idx].capability |= SENSOR_GET_CAP_LNR; + } + g_sensor_data[idx].lowerinfo.lnc = sensor->threshold.lower.non_critical; + g_sensor_data[idx].lowerinfo.lcr = sensor->threshold.lower.critical; + g_sensor_data[idx].lowerinfo.lnr = sensor->threshold.lower.non_recover; + + /* upper threshold info */ + if (sensor->mask.type.threshold.read.unc) + { + g_sensor_data[idx].capability |= SENSOR_GET_CAP_UNC; + } + if (sensor->mask.type.threshold.read.ucr) + { + g_sensor_data[idx].capability |= SENSOR_GET_CAP_UCR; + } + if (sensor->mask.type.threshold.read.unr) + { + g_sensor_data[idx].capability |= SENSOR_GET_CAP_UNR; + } + g_sensor_data[idx].upperinfo.unc = sensor->threshold.upper.non_critical; + g_sensor_data[idx].upperinfo.ucr = sensor->threshold.upper.critical; + g_sensor_data[idx].upperinfo.unr = sensor->threshold.upper.non_recover; +} + +void ipmi_sdr_set_sensor_factor(uint8_t idx, + struct sdr_record_full_sensor *sensor) +{ + char *loc = NULL; + + g_sensor_data[idx].sensor_type = sensor->sensor.type; + sprintf(g_sensor_data[idx].sensor_idstring, "%s", sensor->id_string); + + g_sensor_data[idx].recordinfo.record_m = __TO_M(sensor->mtol); + g_sensor_data[idx].recordinfo.record_b = __TO_B(sensor->bacc); + g_sensor_data[idx].recordinfo.record_k1 = __TO_B_EXP(sensor->bacc); + g_sensor_data[idx].recordinfo.record_k2 = __TO_R_EXP(sensor->bacc); + + g_sensor_data[idx].recordinfo.record_analog = sensor->unit.analog; + g_sensor_data[idx].recordinfo.record_linearization = sensor->linearization; + + memset(g_sensor_data[idx].attrinfo.attr_type_str, 0x00, + SENSOR_ATTR_NAME_LENGTH); + + switch (g_sensor_data[idx].sensor_type) + { + case SDR_SENSOR_TYPE_TEMP: + sprintf(g_sensor_data[idx].attrinfo.attr_type_str, "temp"); + break; + case SDR_SENSOR_TYPE_VOLT: + sprintf(g_sensor_data[idx].attrinfo.attr_type_str, "in"); + break; + case SDR_SENSOR_TYPE_FAN: + g_sensor_data[idx].capability |= SENSOR_GET_CAP_PWM; + g_sensor_data[idx].capability |= SENSOR_GET_CAP_CONMODE; + g_sensor_data[idx].capability |= SENSOR_GET_CAP_DIRECTION; + sprintf(g_sensor_data[idx].attrinfo.attr_type_str, "fan"); + break; + case SDR_SENSOR_TYPE_PS: + loc = strstr(g_sensor_data[idx].sensor_idstring, "POWER"); + if (loc) + { + if ((strncmp(g_sensor_data[idx].sensor_idstring + 11, "OUT", 3)) == 0) + { + g_sensor_data[idx].capability |= SENSOR_GET_CAP_MODEL; + g_sensor_data[idx].capability |= SENSOR_GET_CAP_SN; + g_sensor_data[idx].capability |= SENSOR_GET_CAP_MFRID; + g_sensor_data[idx].capability |= SENSOR_GET_CAP_PSU_PRESENT; + g_sensor_data[idx].capability |= SENSOR_GET_CAP_VIN_TYPE; + g_sensor_data[idx].capability |= SENSOR_GET_CAP_POUT_MAX; + } + sprintf(g_sensor_data[idx].attrinfo.attr_type_str, "power"); + } + + loc = strstr(g_sensor_data[idx].sensor_idstring, "VOLTAGE"); + if (loc) + { + sprintf(g_sensor_data[idx].attrinfo.attr_type_str, "in"); + } + + loc = strstr(g_sensor_data[idx].sensor_idstring, "CURRENT"); + if (loc) + { + sprintf(g_sensor_data[idx].attrinfo.attr_type_str, "curr"); + } + + break; + case SDR_SENSOR_TYPE_CURR: + sprintf(g_sensor_data[idx].attrinfo.attr_type_str, "curr"); + break; + case SDR_SENSOR_TYPE_OTHER: + sprintf(g_sensor_data[idx].attrinfo.attr_type_str, "other"); + break; + default: + printk("not support sensor type !! [%d]\n", g_sensor_data[idx].sensor_type); + break; + } + + if ((strncmp(g_sensor_data[idx].sensor_idstring, "Fan", 3)) == 0) + { + g_sensor_data[idx].capability |= SENSOR_GET_CAP_FAN_PRESENT; + } + +#if enable_debug_msg + { + printk("\n********************\n"); + + printk("m[%d], b[%d], k1[%d], k2[%d]\n", g_sensor_data[idx].recordinfo.record_m, + g_sensor_data[idx].recordinfo.record_b + , g_sensor_data[idx].recordinfo.record_k1, + g_sensor_data[idx].recordinfo.record_k2); + + printk("sensor [%s] type[%d], analog[%d], linearization[%d]\n", + g_sensor_data[idx].sensor_idstring, g_sensor_data[idx].sensor_type + , g_sensor_data[idx].recordinfo.record_analog, + g_sensor_data[idx].recordinfo.record_linearization); + + printk("\n********************\n"); + } +#endif + +} + +int32_t sdr_convert_sensor_reading(uint8_t idx, uint8_t val, + int32_t *point_result) +{ + int32_t m = g_sensor_data[idx].recordinfo.record_m; + int32_t b = g_sensor_data[idx].recordinfo.record_b; + int32_t k1 = g_sensor_data[idx].recordinfo.record_k1; + int32_t k2 = g_sensor_data[idx].recordinfo.record_k2; + int32_t decimal_point = 0; + int32_t result = 0; + + decimal_point = pow_convert(&b, k1); + + switch (g_sensor_data[idx].recordinfo.record_analog) + { + case 0: + result = m * val * decimal_point + b; + break; + case 1: + if (val & 0x80) + { + val++; + } + case 2: + result = (m * (int16_t)val) * decimal_point + b; + break; + default: + return; + } + + pow_convert(&result, k2); + if (k1 < 0) + { + *point_result += -k1; + } + if (k2 < 0) + { + *point_result += -k2; + } + + if (g_sensor_data[idx].sensor_type != SDR_SENSOR_TYPE_FAN) + { + result = result * 1000; /*shift for lm-sensors */ + } + + return result; +} + +int32_t ipmi_sdr_parsing_value(int32_t idx, uint8_t input_value, + int8_t *ret_str) +{ + int32_t calc_result = 0, point_result = 0; + int32_t temp_len = 0; + + uint8_t temp_str[16] = ""; + + calc_result = sdr_convert_sensor_reading(idx, input_value, &point_result); + + temp_len = sprintf(temp_str, "%d", calc_result); + temp_len = temp_len - point_result; + + /* int part */ + if (temp_len <= 0) + { + sprintf(ret_str, "0"); + } + else + { + snprintf(ret_str, temp_len + 1, "%s", + temp_str); /* +1 for snprintf reserve space'\0' */ + } + + /* point part */ + strcat(ret_str, "."); + + /* float part */ + if ((point_result == 0) || (temp_len < 0)) + { + strcat(ret_str, "0"); + } + else + { + strcat(ret_str, temp_str + temp_len); + } + + /* EOL part */ + strcat(ret_str, "\n\0"); + + return (temp_len + 1 + point_result + + 2); /*integer + point + float + EOL + \0 */ +} + + +uint8_t ipmi_check_psu_present(uint8_t psu_slot) +{ + uint8_t slot_mask = 0x0; + int32_t rv = 0; + + uint8_t returnData[128] = { 0 }; + uint8_t msg_data[] = { 0x36, 0xB9, 0x4C, 0x1C, 0x00, 0x03 }; /*netfn = 0x36; cmd = 0xB9; */ + /*uint8_t msg_data[] = { 0x06, 0x52, 0x1B, 0x4C, 0x01, 0x00 }; //netfn = IPMI_NETFN_APP; cmd = GET_PSU_READING; */ + + mutex_lock(&ipmi_lock); + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), returnData, 1); + mutex_unlock(&ipmi_lock); + + if (rv) + { + printk("BMC down at (%d)!!\n", __LINE__); + return 0; + } + else + { + slot_mask = (psu_slot == 1) ? 0x01 : 0x02; + return (returnData[0] & slot_mask) ? 0 : 1; + } +} + +int32_t ipmi_get_psu_info(uint8_t idx, uint8_t cmd, uint8_t *retbuf) +{ + uint8_t psu_slot = 0; + int32_t rv = 0; + + uint8_t returnData[128] = { 0 }; + uint8_t msg_data[] = { 0x36, 0xBB, 0x4C, 0x1C, 0x00, cmd, 0x00 }; /*netfn = 0x36; cmd = 0xBB; */ + + if (strstr(g_sensor_data[idx].sensor_idstring, "PSU1")) + { + psu_slot = 1; + } + else + { + psu_slot = 2; + } + + if (ipmi_check_psu_present(psu_slot)) + { + msg_data[6] = psu_slot; + mutex_lock(&ipmi_lock); + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), returnData, 1); + mutex_unlock(&ipmi_lock); + + if (rv) + { + printk("BMC down at (%d)!!\n", __LINE__); + } + else + { + return sprintf(retbuf, "%s\n", returnData); + } + } + else + { + /*printk("Error ! cannot detect PSU%d\n", psu_slot); */ + } + + return sprintf(retbuf, "N/A\n"); +} + +int32_t ipmi_get_vin_type(uint8_t idx, uint8_t *retbuf) +{ + uint8_t psu_slot = 0; + int32_t rv = 0; + + uint8_t returnData = 0; + uint8_t msg_data[] = { 0x06, 0x52, 0x0f, 0x00, 0x01, 0xd8 }; // read line status + + if (strstr(g_sensor_data[idx].sensor_idstring, "PSU1")) psu_slot = 1; + else psu_slot = 2; + + msg_data[3] = (psu_slot == 1) ? 0xb0 : 0xb2; + if (ipmi_check_psu_present(psu_slot)) { + mutex_lock(&ipmi_lock); + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), &returnData, 1); + mutex_unlock(&ipmi_lock); + + if (rv) { + printk("BMC down at (%d)!!\n", __LINE__); + } + else { + switch (returnData) + { + case 0x7: //LVDC + case 0x3: //HVDC + return sprintf(retbuf, "DC\n"); + default: + return sprintf(retbuf, "AC\n"); + } + } + } + else { + //printk("Error ! cannot detect PSU%d\n", psu_slot); + } + + return sprintf(retbuf, "N/A\n"); +} + +int32_t ipmi_get_pout_max(uint8_t idx, uint8_t *retbuf) +{ + uint8_t psu_slot = 0; + int32_t rv = 0, pout_max = 0; + + uint8_t returnData[2] = { 0 }, tempData[2] = { 0 }; + uint8_t msg_data[] = { 0x06, 0x52, 0x0f, 0x00, 0x02, 0xa7 }; + + if (strstr(g_sensor_data[idx].sensor_idstring, "PSU1")) psu_slot = 1; + else psu_slot = 2; + + msg_data[3] = (psu_slot == 1) ? 0xb0 : 0xb2; + if (ipmi_check_psu_present(psu_slot)) { + mutex_lock(&ipmi_lock); + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), returnData, 1); + mutex_unlock(&ipmi_lock); + + if (rv) { + printk("BMC down at (%d)!!\n", __LINE__); + } + else { + /* MFR_POUT_MAX has 2 data format: Direct and Linear Data (see PMbus spec). + Query command is needed to tell the data format, but since we have not use PSU + whose output power is over 0x07ff (2047), just check the first 5 bits*/ + if (returnData[1] & 0xf8 == 0) // Direct + pout_max = (returnData[1] << 8) | returnData[0]; + else // Linear Data + pout_max = (((returnData[1] & 0x07) << 8) | returnData[0]) << ((returnData[1] & 0xf8) >> 3); + return sprintf(retbuf, "%d\n", pout_max); + } + } + else { + //printk("Error ! cannot detect PSU%d\n", psu_slot); + } + + return sprintf(retbuf, "N/A\n"); +} + +void ipmi_fan_control(uint8_t cmd_data1, uint8_t cmd_data2, uint8_t *retbuf) +{ + int32_t rv = 0; + + uint8_t returnData[10] = { 0 }; + uint8_t msg_data[] = { IPMI_NETFN_TSOL, GET_FAN_INFO, cmd_data1, cmd_data2 }; /*netfn = IPMI_NETFN_TSOL; cmd = GET_FAN_INFO; */ + + mutex_lock(&ipmi_lock); + if (cmd_data1) + { + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), NULL, 0); + } + else + { + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), returnData, 1); + } + mutex_unlock(&ipmi_lock); + + if (rv) + { + printk("BMC down at (%d)!!\n", __LINE__); + sprintf(retbuf, "N/A\n"); + } + else + { + sprintf(retbuf, "%s", returnData); + } +} + +static ssize_t show_label(struct device *dev, struct device_attribute *devattr, + char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return sprintf(buf, "%s\n", + g_sensor_data[attr->index + DEBUGUSE_SHIFT].sensor_idstring); +} + +static ssize_t show_crit_alarm(struct device *dev, + struct device_attribute *devattr, char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return sprintf(buf, "%d\n", attr->index); +} + +static ssize_t show_input(struct device *dev, struct device_attribute *devattr, + char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + int32_t rv = 0; + + uint8_t returnData[4] = ""; + uint8_t msg_data[] = { IPMI_NETFN_SE, GET_SENSOR_READING, 0x00 }; /*netfn = IPMI_NETFN_SE; cmd = GET_SENSOR_READING; */ + + mutex_lock(&ipmi_lock); + msg_data[2] = g_sensor_data[attr->index + DEBUGUSE_SHIFT].addr; + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), returnData, 1); + mutex_unlock(&ipmi_lock); + + if (rv) + { + printk("BMC down at (%d)!!\n", __LINE__); + return sprintf(buf, "0.0\n"); + } + else + { + return ipmi_sdr_parsing_value(attr->index + DEBUGUSE_SHIFT, returnData[0], buf); + } +} + +static ssize_t show_lnr(struct device *dev, struct device_attribute *devattr, + char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return ipmi_sdr_parsing_value(attr->index + DEBUGUSE_SHIFT, + g_sensor_data[attr->index + DEBUGUSE_SHIFT].lowerinfo.lnr, buf); +} + +static ssize_t show_lcr(struct device *dev, struct device_attribute *devattr, + char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return ipmi_sdr_parsing_value(attr->index + DEBUGUSE_SHIFT, + g_sensor_data[attr->index + DEBUGUSE_SHIFT].lowerinfo.lcr, buf); +} + +static ssize_t show_lnc(struct device *dev, struct device_attribute *devattr, + char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return ipmi_sdr_parsing_value(attr->index + DEBUGUSE_SHIFT, + g_sensor_data[attr->index + DEBUGUSE_SHIFT].lowerinfo.lnc, buf); +} + +static ssize_t show_unr(struct device *dev, struct device_attribute *devattr, + char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return ipmi_sdr_parsing_value(attr->index + DEBUGUSE_SHIFT, + g_sensor_data[attr->index + DEBUGUSE_SHIFT].upperinfo.unr, buf); +} + +static ssize_t show_ucr(struct device *dev, struct device_attribute *devattr, + char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return ipmi_sdr_parsing_value(attr->index + DEBUGUSE_SHIFT, + g_sensor_data[attr->index + DEBUGUSE_SHIFT].upperinfo.ucr, buf); +} + +static ssize_t show_unc(struct device *dev, struct device_attribute *devattr, + char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return ipmi_sdr_parsing_value(attr->index + DEBUGUSE_SHIFT, + g_sensor_data[attr->index + DEBUGUSE_SHIFT].upperinfo.unc, buf); +} + +static ssize_t show_model(struct device *dev, struct device_attribute *devattr, + char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return ipmi_get_psu_info(attr->index + DEBUGUSE_SHIFT, 0x9a, buf); +} + +static ssize_t show_sn(struct device *dev, struct device_attribute *devattr, + char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return ipmi_get_psu_info(attr->index + DEBUGUSE_SHIFT, 0x9e, buf); +} + +static ssize_t show_mfrid(struct device *dev, struct device_attribute *devattr, + char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return ipmi_get_psu_info(attr->index + DEBUGUSE_SHIFT, 0x99, buf); +} + +static ssize_t show_vin_type(struct device *dev, struct device_attribute *devattr, char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return ipmi_get_vin_type(attr->index + DEBUGUSE_SHIFT, buf); +} + +static ssize_t show_pout_max(struct device *dev, struct device_attribute *devattr, char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return ipmi_get_pout_max(attr->index + DEBUGUSE_SHIFT, buf); +} + +static ssize_t show_pwm(struct device *dev, struct device_attribute *devattr, + char *buf) +{ + uint8_t returnData[10] = { 0 }; + ipmi_fan_control(0x00, 0x00, returnData); + return sprintf(buf, "%d\n", returnData[0]); +} + +static ssize_t store_pwm(struct device *dev, struct device_attribute *devattr, + const char *buf, size_t count) +{ + uint8_t store_input = 0; + uint8_t returnData[10] = { 0 }; + simple_atoi(buf, &store_input); + if (g_fan_control_mode == 1) + { + ipmi_fan_control(0x01, store_input, returnData); + } + + return count; +} + +static ssize_t show_controlmode(struct device *dev, + struct device_attribute *devattr, char *buf) +{ + return sprintf(buf, "%d\n", g_fan_control_mode); +} + +static ssize_t store_controlmode(struct device *dev, + struct device_attribute *devattr, const char *buf, size_t count) +{ + uint8_t store_input = 0; + uint8_t returnData[10] = { 0 }; + simple_atoi(buf, &store_input); + g_fan_control_mode = store_input; + if (g_fan_control_mode == 3) + { + ipmi_fan_control(0x7f, 0xff, returnData); + } + + return count; +} + +static ssize_t show_direction(struct device *dev, + struct device_attribute *devattr, char *buf) +{ + int32_t rv = 0; + + uint8_t returnData[10] = { 0 }; + uint8_t msg_data[] = { IPMI_NETFN_STORAGE, GET_FRU_INFO, 0x00, 0x19, 0x00, 0x01 }; /*netfn = IPMI_NETFN_STORAGE; cmd = GET_FRU_INFO; */ + + mutex_lock(&ipmi_lock); + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), returnData, 1); + mutex_unlock(&ipmi_lock); + + if (rv) + { + printk("BMC down at (%d)!!\n", __LINE__); + return sprintf(buf, "N/A\n"); + } + else + { + return sprintf(buf, "%c\n", returnData[1]); + } +} + +static ssize_t show_fanpresent(struct device *dev, + struct device_attribute *devattr, char *buf) +{ + int32_t rv = 0; + int32_t fan_idx = 0, fan_present = 0; + + uint8_t returnData[10] = { 0 }; + uint8_t msg_data[] = { 0x36, 0xB9, 0x4C, 0x1C, 0x00, 0x02 }; /*netfn = 0x36; cmd = 0xB9; */ + + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + struct kernel_ipmi_msg msg; + + fan_idx = (g_sensor_data[attr->index].sensor_idstring[8] - '0') - 1; + + mutex_lock(&ipmi_lock); + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), returnData, 1); + mutex_unlock(&ipmi_lock); + + fan_present = ((returnData[0] >> fan_idx) & 0x1) ? 0 : 1; + + return sprintf(buf, "%d\n", fan_present); +} + +static ssize_t show_psupresent(struct device *dev, + struct device_attribute *devattr, char *buf) +{ + int32_t psu_idx = 0; + + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + + psu_idx = g_sensor_data[attr->index].sensor_idstring[3] - '0'; + + return sprintf(buf, "%d\n", ipmi_check_psu_present(psu_idx)); +} + +static ssize_t(*const attr_show_func_ptr[SENSOR_ATTR_MAX])(struct device *dev, + struct device_attribute *devattr, char *buf) = +{ + show_label, show_crit_alarm, show_input + , show_lnc, show_lcr, show_lnr + , show_unc, show_ucr, show_unr + , show_model, show_sn, show_pwm + , show_controlmode, show_direction, show_fanpresent + , show_psupresent, show_mfrid, show_vin_type + , show_pout_max +}; + +static ssize_t(*const attr_store_func_ptr[SENSOR_ATTR_MAX])(struct device *dev, + struct device_attribute *devattr, const char *buf, size_t count) = +{ + NULL, NULL, NULL + , NULL, NULL, NULL + , NULL, NULL, NULL + , NULL, NULL, store_pwm + , store_controlmode, NULL, NULL + , NULL, NULL, NULL + , NULL +}; + +static const char *const sensor_attrnames[SENSOR_ATTR_MAX] = +{ + "%s%d_label", "%s%d_crit_alarm", "%s%d_input" + , "%s%d_lncrit", "%s%d_lcrit", "%s%d_min" + , "%s%d_ncrit", "%s%d_crit", "%s%d_max" + , "%s%d_model", "%s%d_sn", "%s%d_pwm" + , "%s%d_controlmode", "%s%d_direction", "%s%d_present" + , "%s%d_present", "%s%d_mfrid", "%s%d_vin_type" + , "%s%d_pout_max" +}; + +static int32_t create_sensor_attrs(int32_t attr_no) +{ + int32_t i = 0, j = 0; + + struct attr_info *attrdata = &g_sensor_data[attr_no].attrinfo; + +#if enable_debug_msg + printk("##### %s:%d attr_no %d\n", __FUNCTION__, __LINE__, attr_no); +#endif + + for (i = 0; i < SENSOR_ATTR_MAX; i++) + { + if ((g_sensor_data[attr_no].capability >> i) & 0x01) + { + snprintf(attrdata->attr_name[j], SENSOR_ATTR_NAME_LENGTH, sensor_attrnames[i], + attrdata->attr_type_str, attr_no - DEBUGUSE_SHIFT); + + sysfs_attr_init(&attrdata->sd_attrs[j].dev_attr.attr); + attrdata->sd_attrs[j].dev_attr.attr.name = attrdata->attr_name[j]; + attrdata->sd_attrs[j].dev_attr.show = attr_show_func_ptr[i]; + attrdata->sd_attrs[j].dev_attr.store = attr_store_func_ptr[i]; + + attrdata->sd_attrs[j].dev_attr.attr.mode = S_IRUGO; + if (attrdata->sd_attrs[j].dev_attr.store) + { + attrdata->sd_attrs[j].dev_attr.attr.mode |= S_IWUSR; + } + + attrdata->sd_attrs[j].index = attr_no - DEBUGUSE_SHIFT; + attrdata->attrs[j] = &attrdata->sd_attrs[j].dev_attr.attr; + j++; + + data->total_create_sysfs++; + } + } + + attrdata->attrs[j] = NULL; + attrdata->attr_group.attrs = attrdata->attrs; + + g_sensor_data[attr_no].attrinfo.attr_exist = 1; + + return sysfs_create_group(&data->ipmi_hwmon_dev->kobj, &attrdata->attr_group); +} + +static int32_t remove_sensor_attrs(void) +{ + int32_t i = 0; + + for (i = 0; i < data->total_sensor_id; i++) + { + if (g_sensor_data[i].attrinfo.attr_exist) + { + sysfs_remove_group(&data->ipmi_hwmon_dev->kobj, + &g_sensor_data[i].attrinfo.attr_group); + } + } + return 0; +} + +int32_t ipmi_init_sdr_sensors_data(void) +{ + int32_t sdr_idx = 0; + int32_t err = 0; + + struct ipmi_sdr_iterator *itr = NULL; + struct sdr_get_rs *header = NULL; + + uint8_t *rec = NULL; + + mutex_lock(&ipmi_lock); + + itr = kzalloc(sizeof(struct ipmi_sdr_iterator), GFP_KERNEL); + if (itr == NULL) + { + printk("%s(%d): kzalloc failure.\n", __func__, __LINE__); + goto itr_malloc_fail; + } + + header = kzalloc(sizeof(struct sdr_get_rs), GFP_KERNEL); + if (header == NULL) + { + printk("%s(%d): malloc failure.\n", __func__, __LINE__); + goto header_malloc_fail; + } + + err = ipmi_sdr_start(itr); + if (err) + { + printk("%s(%d): ipmi_sdr_start fail.\n", __func__, __LINE__); + goto ipmi_sdr_start_fail; + } + + data->total_sensor_id = itr->total; + rec = kzalloc(GET_SDR_ENTIRE_RECORD, GFP_KERNEL); + if (rec == NULL) + { + printk("%s(%d): kzalloc failure\n", __func__, __LINE__); + goto rec_malloc_fail; + } + + g_sensor_data = kzalloc(itr->total * sizeof(struct ipmi_sensor_data), + GFP_KERNEL); + if (g_sensor_data == NULL) + { + printk("%s(%d): malloc failure", __func__, __LINE__); + goto g_sensor_data_malloc_fail; + } + + memset(g_sensor_data, 0x0, itr->total * sizeof(struct ipmi_sensor_data)); + + for (sdr_idx = 0; sdr_idx < itr->total; sdr_idx++) + { + err = ipmi_sdr_get_header(itr, header); + if (err) + { + if (err == 0xC5) + { + /* C5h : Reservation Invalid */ +#if enable_debug_msg + printk("ipmi: reservation number given was invalid or the reservation was lost\n"); + printk("ipmi: retry\n"); +#endif + ipmi_sdr_get_reservation(&(itr->reservation)); + sdr_idx--; + continue; + } + printk("ipmi: Get SDR header fail,so break this request\n"); + goto ipmi_sdr_get_header_fail; + } + + + memset(rec, 0, GET_SDR_ENTIRE_RECORD); + err = ipmi_sdr_get_record(header, itr, rec); + if (err) + { + if (err == 0xC5) + { + /* C5h : Reservation Invalid */ +#if enable_debug_msg + printk("ipmi: reservation number given was invalid or the reservation was lost\n"); + printk("ipmi: retry\n"); +#endif + ipmi_sdr_get_reservation(&(itr->reservation)); + sdr_idx--; + continue; + } + printk("ipmi: Get SDR header fail,so break this request\n"); + goto ipmi_sdr_get_record_fail; + } + + itr->next = header->next; + + switch (header->type) + { + case SDR_RECORD_TYPE_FULL_SENSOR: + /* prepare (threshold, factor)data whilie init, for reduce reading step and improve operate speed */ + g_sensor_data[sdr_idx].addr = rec[2]; + g_sensor_data[sdr_idx].capability = + SENSOR_GET_CAP_LABEL /*| SENSOR_GET_CAP_ALARM */ | SENSOR_GET_CAP_INPUT; + g_sensor_data[sdr_idx].headerinfo.header_type = header->type; + g_sensor_data[sdr_idx].headerinfo.header_byte = header->length; + + ipmi_sdr_set_sensor_threshold(sdr_idx, (struct sdr_record_full_sensor *) rec); + ipmi_sdr_set_sensor_factor(sdr_idx, (struct sdr_record_full_sensor *) rec); + + if (sdr_idx >= DEBUGUSE_SHIFT) + { + err = create_sensor_attrs(sdr_idx); + if (err) + { + g_sensor_data[sdr_idx].attrinfo.attr_exist = 0; + printk("[err : %d]sysfs_create_group fail in [%d] %s\n", err, sdr_idx, + g_sensor_data[sdr_idx].sensor_idstring); + goto create_sysfs_fail; + } + } + + data->total_suport_sensor++; + + break; + case SDR_RECORD_TYPE_COMPACT_SENSOR: /* not supporrt now */ + case SDR_RECORD_TYPE_EVENTONLY_SENSOR: /* not supporrt now */ + case SDR_RECORD_TYPE_MC_DEVICE_LOCATOR: /* not supporrt now */ + default: + g_sensor_data[sdr_idx].attrinfo.attr_exist = 0; +#if enable_debug_msg + printk("ID[%d] : not support type [%d]\n", sdr_idx, header->type); +#endif + break; + } + } + + printk("quanta_hwmon_ipmi : detected [%d] sensor, create [%d] sysfs\n", + data->total_suport_sensor, data->total_create_sysfs); + +create_sysfs_fail: +ipmi_sdr_get_header_fail: +ipmi_sdr_get_record_fail: +g_sensor_data_malloc_fail: + if (header) + { + kfree(header); + header = NULL; + } + if (rec) + { + kfree(rec); + rec = NULL; + } + +rec_malloc_fail: +ipmi_sdr_start_fail: +header_malloc_fail: + if (itr) + { + kfree(itr); + itr = NULL; + } + +itr_malloc_fail: + mutex_unlock(&ipmi_lock); + + return err; +} + +static int32_t __init quanta_hwmon_ipmi_init(void) +{ + int32_t err = 0; + + init_completion(&g_read_complete); + + data = kzalloc(sizeof(struct quanta_hwmon_ipmi_data), GFP_KERNEL); + if (NULL == data) + { + printk("alloc data fail\n"); + goto alloc_err; + } + + data->ipmi_platform_dev = platform_device_register_simple(DRVNAME, -1, NULL, 0); + err = IS_ERR(data->ipmi_platform_dev); + if (err) + { + printk("platform device register fail (err : %d)\n", err); + goto device_reg_err; + } + + data->ipmi_hwmon_dev = hwmon_device_register_with_groups(NULL, DRVNAME, NULL, + NULL); + err = IS_ERR(data->ipmi_hwmon_dev); + if (err) + { + printk("hwmon register fail\n"); + goto hwmon_register_err; + } + + err = ipmi_create_user(0, &ipmi_hndlrs, NULL, &ipmi_mh_user); + if (err) + { + printk("warning: create user fail, watchdog broken (err : %d)\n", err); + goto ipmi_create_err; + } + + mutex_init(&ipmi_lock); + err = ipmi_init_sdr_sensors_data(); + if (err) + { + printk("init sensor data fail (err : %d)\n", err); + goto init_sensor_err; + } + + return 0; + +init_sensor_err: + if (g_sensor_data) + { + kfree(g_sensor_data); + g_sensor_data = NULL; + } +ipmi_create_err: + hwmon_device_unregister(data->ipmi_hwmon_dev); +hwmon_register_err: + platform_device_unregister(data->ipmi_platform_dev); +device_reg_err: + if (data) + { + kfree(data); + data = NULL; + } +alloc_err: + return err; +} + +static void __exit quanta_hwmon_ipmi_exit(void) +{ + remove_sensor_attrs(); + hwmon_device_unregister(data->ipmi_hwmon_dev); + + mutex_lock(&ipmi_lock); + ipmi_destroy_user(ipmi_mh_user); + mutex_unlock(&ipmi_lock); + + platform_device_unregister(data->ipmi_platform_dev); + + if (g_sensor_data) + { + kfree(g_sensor_data); + g_sensor_data = NULL; + } + + if (data) + { + kfree(data); + data = NULL; + } +} + +module_init(quanta_hwmon_ipmi_init); +module_exit(quanta_hwmon_ipmi_exit); + +MODULE_AUTHOR("Charcar~~Charcar~Charlie li li"); +MODULE_VERSION("2.0"); +MODULE_DESCRIPTION("Quanta BMC hardware monitor driver"); +MODULE_LICENSE("GPL"); diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix8-56x/service/ix8-platform-init.service b/platform/broadcom/sonic-platform-modules-quanta/ix8-56x/service/ix8-platform-init.service old mode 100755 new mode 100644 diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix8-56x/setup.py b/platform/broadcom/sonic-platform-modules-quanta/ix8-56x/setup.py old mode 100755 new mode 100644 index 76c5eacbee4c..1f6a99b1a70c --- a/platform/broadcom/sonic-platform-modules-quanta/ix8-56x/setup.py +++ b/platform/broadcom/sonic-platform-modules-quanta/ix8-56x/setup.py @@ -1,7 +1,6 @@ #!/usr/bin/env python import os -import sys from setuptools import setup os.listdir diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix8-56x/sonic_platform/__init__.py b/platform/broadcom/sonic-platform-modules-quanta/ix8-56x/sonic_platform/__init__.py new file mode 100644 index 000000000000..4bfefa0fb636 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix8-56x/sonic_platform/__init__.py @@ -0,0 +1,3 @@ +__all__ = ["platform", "chassis"] +from sonic_platform import * + diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix8-56x/sonic_platform/chassis.py b/platform/broadcom/sonic-platform-modules-quanta/ix8-56x/sonic_platform/chassis.py new file mode 100644 index 000000000000..b959d6678048 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix8-56x/sonic_platform/chassis.py @@ -0,0 +1,232 @@ +#!/usr/bin/env python +# +# Name: chassis.py, version: 1.0 +# +# Description: Module contains the definitions of SONiC platform APIs +# + +try: + import sys + import time + import syslog + from sonic_platform_base.chassis_base import ChassisBase + from sonic_platform.eeprom import Eeprom + from sonic_platform.psu import Psu + from sonic_platform.sfp import Sfp + from sonic_platform.fan import Fan + from sonic_platform.fan_drawer import FanDrawer + from sonic_platform.thermal import Thermal + +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +class Chassis(ChassisBase): + + def __init__(self): + ChassisBase.__init__(self) + self.__num_of_psus = 2 + self.__num_of_ports = 56 + self.__num_of_sfps = 48 + self.__num_of_fan_drawers = 6 + self.__fan_per_drawer = 2 + self.__num_of_thermals = 15 + self.__xcvr_presence = {} + + # Initialize EEPROM + self._eeprom = Eeprom() + + # Initialize watchdog + #self._watchdog = Watchdog() + + # Initialize FAN + fan_index = 1 + for drawer_index in range(1, self.__num_of_fan_drawers + 1): + drawer_fan_list = [] + for index in range(0, self.__fan_per_drawer): + fan = Fan(fan_index, False) + fan_index += 1 + self._fan_list.append(fan) + drawer_fan_list.append(fan) + fan_drawer = FanDrawer(drawer_index, drawer_fan_list) + self._fan_drawer_list.append(fan_drawer) + + # Initialize thermal + for index in range(1, self.__num_of_thermals + 1): + thermal = Thermal(index) + self._thermal_list.append(thermal) + + # Initialize PSU and PSU_FAN + for index in range(1, self.__num_of_psus + 1): + psu = Psu(index) + self._psu_list.append(psu) + + # Initialize SFP + for index in range(1, self.__num_of_ports + 1): + if index in range(1, self.__num_of_sfps + 1): + sfp = Sfp(index, 'SFP') + else: + sfp = Sfp(index, 'QSFP') + + self._sfp_list.append(sfp) + + for index in range(1, self.__num_of_ports + 1): + self.__xcvr_presence[index] = self._sfp_list[index-1].get_presence() + +############################################## +# Device methods +############################################## + + def get_sfp(self, index): + """ + Retrieves sfp represented by (1-based) index + For Quanta IX8 the index in sfputil.py starts from 1, so override + + Args: + index: An integer, the index (1-based) of the sfp to retrieve. + The index should be the sequence of a physical port in a chassis, + starting from 1. + + Returns: + An object dervied from SfpBase representing the specified sfp + """ + sfp = None + + try: + if (index == 0): + raise IndexError + sfp = self._sfp_list[index-1] + except IndexError: + sys.stderr.write("override: SFP index {} out of range (1-{})\n".format( + index, len(self._sfp_list))) + + return sfp + + def get_name(self): + """ + Retrieves the name of the chassis + Returns: + string: The name of the chassis + """ + return self._eeprom.modelstr() + + def get_presence(self): + """ + Retrieves the presence of the chassis + Returns: + bool: True if chassis is present, False if not + """ + return True + + def get_model(self): + """ + Retrieves the model number (or part number) of the chassis + Returns: + string: Model/part number of chassis + """ + return self._eeprom.part_number_str() + + def get_serial(self): + """ + Retrieves the serial number of the chassis + Returns: + string: Serial number of chassis + """ + return self._eeprom.serial_number_str() + + def get_status(self): + """ + Retrieves the operational status of the chassis + Returns: + bool: A boolean value, True if chassis is operating properly + False if not + """ + return True + +############################################## +# Chassis methods +############################################## + + def get_base_mac(self): + """ + Retrieves the base MAC address for the chassis + + Returns: + A string containing the MAC address in the format + 'XX:XX:XX:XX:XX:XX' + """ + return self._eeprom.base_mac_addr() + + def get_serial_number(self): + """ + Retrieves the hardware serial number for the chassis + + Returns: + A string containing the hardware serial number for this chassis. + """ + return self._eeprom.serial_number_str() + + def get_system_eeprom_info(self): + """ + Retrieves the full content of system EEPROM information for the chassis + + Returns: + A dictionary where keys are the type code defined in + OCP ONIE TlvInfo EEPROM format and values are their corresponding + values. + Ex. { '0x21':'AG9064', '0x22':'V1.0', '0x23':'AG9064-0109867821', + '0x24':'001c0f000fcd0a', '0x25':'02/03/2018 16:22:00', + '0x26':'01', '0x27':'REV01', '0x28':'AG9064-C2358-16G'} + """ + return self._eeprom.system_eeprom_info() + + ############################################## + # Other methods + ############################################## + def get_watchdog(self): + """ + Retreives hardware watchdog device on this chassis + + Returns: + An object derived from WatchdogBase representing the hardware + watchdog device + """ + try: + if self._watchdog is None: + from sonic_platform.watchdog import Watchdog + # Create the watchdog Instance + self._watchdog = Watchdog() + + except Exception as e: + syslog.syslog(syslog.LOG_ERR, "Fail to load watchdog due to {}".format(e)) + return self._watchdog + + def get_change_event(self, timeout=0): + """ + Currently only support transceiver change events + """ + + start_ms = time.time() * 1000 + xcvr_change_event_dict = {} + event = False + + while True: + time.sleep(0.5) + for index in range(1, self.__num_of_ports + 1): + cur_xcvr_presence = self._sfp_list[index-1].get_presence() + if cur_xcvr_presence != self.__xcvr_presence[index]: + if cur_xcvr_presence is True: + xcvr_change_event_dict[str(index)] = '1' + self.__xcvr_presence[index] = True + elif cur_xcvr_presence is False: + xcvr_change_event_dict[str(index)] = '0' + self.__xcvr_presence[index] = False + event = True + + if event is True: + return True, {'sfp':xcvr_change_event_dict} + + if timeout: + now_ms = time.time() * 1000 + if (now_ms - start_ms >= timeout): + return True, {'sfp':xcvr_change_event_dict} + diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix8-56x/sonic_platform/eeprom.py b/platform/broadcom/sonic-platform-modules-quanta/ix8-56x/sonic_platform/eeprom.py new file mode 100644 index 000000000000..1c044638ed26 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix8-56x/sonic_platform/eeprom.py @@ -0,0 +1,212 @@ +#!/usr/bin/env python +# +# Name: eeprom.py, version: 1.0 +# +# Description: Module contains the definitions of SONiC platform APIs +# + +try: + from sonic_eeprom import eeprom_tlvinfo +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +class Eeprom(eeprom_tlvinfo.TlvInfoDecoder): + # Display vendor extension for Quanta platforms + _TLV_DISPLAY_VENDOR_EXT = True + + def __init__(self): + self.__eeprom_path = "/sys/bus/i2c/devices/3-0054/eeprom" + super(Eeprom, self).__init__(self.__eeprom_path, 0, '', True) + self.__eeprom_tlv_dict = dict() + try: + self.__eeprom_data = self.read_eeprom() + except: + self.__eeprom_data = "N/A" + raise RuntimeError("Eeprom is not Programmed") + else: + eeprom = self.__eeprom_data + + if not self.is_valid_tlvinfo_header(eeprom): + return + + total_length = (eeprom[9] << 8) | eeprom[10] + tlv_index = self._TLV_INFO_HDR_LEN + tlv_end = self._TLV_INFO_HDR_LEN + total_length + + while (tlv_index + 2) < len(eeprom) and tlv_index < tlv_end: + if not self.is_valid_tlv(eeprom[tlv_index:]): + break + + tlv = eeprom[tlv_index:tlv_index + 2 + + eeprom[tlv_index + 1]] + code = "0x%02X" % tlv[0] + + if tlv[0] == self._TLV_CODE_VENDOR_EXT: + value = str((tlv[2] << 24) | (tlv[3] << 16) | + (tlv[4] << 8) | tlv[5]) + value += tlv[6:6 + tlv[1]].decode('ascii') + else: + value = self.decoder(None, tlv)[30:] + + self.__eeprom_tlv_dict[code] = value + if eeprom[tlv_index] == self._TLV_CODE_CRC_32: + break + + tlv_index += eeprom[tlv_index+1] + 2 + + def serial_number_str(self): + (is_valid, results) = self.get_tlv_field( + self.__eeprom_data, self._TLV_CODE_SERIAL_NUMBER) + if not is_valid: + return "N/A" + + return results[2].decode('ascii') + + def base_mac_addr(self): + (is_valid, results) = self.get_tlv_field( + self.__eeprom_data, self._TLV_CODE_MAC_BASE) + if not is_valid or results[1] != 6: + return super(TlvInfoDecoder, self).switchaddrstr(e) + + return ":".join(["{:02x}".format(T) for T in results[2]]).upper() + + def modelstr(self): + (is_valid, results) = self.get_tlv_field( + self.__eeprom_data, self._TLV_CODE_PRODUCT_NAME) + if not is_valid: + return "N/A" + + return results[2].decode('ascii') + + def part_number_str(self): + (is_valid, results) = self.get_tlv_field( + self.__eeprom_data, self._TLV_CODE_PART_NUMBER) + if not is_valid: + return "N/A" + + return results[2].decode('ascii') + + def serial_tag_str(self): + (is_valid, results) = self.get_tlv_field( + self.__eeprom_data, self._TLV_CODE_SERVICE_TAG) + if not is_valid: + return "N/A" + + return results[2].decode('ascii') + + def revision_str(self): + (is_valid, results) = self.get_tlv_field( + self.__eeprom_data, self._TLV_CODE_DEVICE_VERSION) + if not is_valid: + return "N/A" + + return results[2].decode('ascii') + + def system_eeprom_info(self): + """ + Returns a dictionary, where keys are the type code defined in + ONIE EEPROM format and values are their corresponding values + found in the system EEPROM. + """ + return self.__eeprom_tlv_dict + + def decoder(self, s, t): + ''' + Return a string representing the contents of the TLV field. The format of + the string is: + 1. The name of the field left justified in 20 characters + 2. The type code in hex right justified in 5 characters + 3. The length in decimal right justified in 4 characters + 4. The value, left justified in however many characters it takes + The vailidity of EEPROM contents and the TLV field has been verified + prior to calling this function. The 's' parameter is unused + ''' + if t[0] == self._TLV_CODE_PRODUCT_NAME: + name = "Product Name" + value = t[2:2 + t[1]].decode("ascii") + elif t[0] == self._TLV_CODE_PART_NUMBER: + name = "Part Number" + value = t[2:2 + t[1]].decode("ascii") + elif t[0] == self._TLV_CODE_SERIAL_NUMBER: + name = "Serial Number" + value = t[2:2 + t[1]].decode("ascii") + elif t[0] == self._TLV_CODE_MAC_BASE: + name = "Base MAC Address" + value = ":".join(["{:02x}".format(T) for T in t[2:8]]).upper() + elif t[0] == self._TLV_CODE_MANUF_DATE: + name = "Manufacture Date" + value = t[2:2 + t[1]].decode("ascii") + elif t[0] == self._TLV_CODE_DEVICE_VERSION: + name = "Device Version" + value = str(t[2]) + elif t[0] == self._TLV_CODE_LABEL_REVISION: + name = "Label Revision" + value = t[2:2 + t[1]].decode("ascii") + elif t[0] == self._TLV_CODE_PLATFORM_NAME: + name = "Platform Name" + value = t[2:2 + t[1]].decode("ascii") + elif t[0] == self._TLV_CODE_ONIE_VERSION: + name = "ONIE Version" + value = t[2:2 + t[1]].decode("ascii") + elif t[0] == self._TLV_CODE_MAC_SIZE: + name = "MAC Addresses" + value = str((t[2] << 8) | t[3]) + elif t[0] == self._TLV_CODE_MANUF_NAME: + name = "Manufacturer" + value = t[2:2 + t[1]].decode("ascii") + elif t[0] == self._TLV_CODE_MANUF_COUNTRY: + name = "Manufacture Country" + value = t[2:2 + t[1]].decode("ascii") + elif t[0] == self._TLV_CODE_VENDOR_NAME: + name = "Vendor Name" + value = t[2:2 + t[1]].decode("ascii") + elif t[0] == self._TLV_CODE_DIAG_VERSION: + name = "Diag Version" + # Quanta legacy format of diag version + if t[1] == 4: + value = "{}.{}.{}.{}".format('{:02x}'.format(t[2])[0], '{:02x}'.format(t[2])[1], + '{:02x}'.format(t[3])[0], '{:02x}'.format(t[3])[1]) + else: + value = t[2:2 + t[1]].decode("ascii") + elif t[0] == self._TLV_CODE_SERVICE_TAG: + name = "Service Tag" + value = t[2:2 + t[1]].decode("ascii") + elif t[0] == self._TLV_CODE_VENDOR_EXT: + name = "Vendor Extension" + value = "" + if self._TLV_DISPLAY_VENDOR_EXT: + for c in t[2:2 + t[1]]: + value += "0x%02X " % c + elif t[0] == self._TLV_CODE_CRC_32 and len(t) == 6: + name = "CRC-32" + value = "0x%08X" % ((t[2] << 24) | (t[3] << 16) | (t[4] << 8) | t[5]) + # Quanta specific codes below here. + # These decodes are lifted from their U-Boot codes + elif t[0] == self._TLV_CODE_QUANTA_MAGIC and len(t) == 3: + name = "Magic Number" + value = "0x%02X" % t[2] + elif t[0] == self._TLV_CODE_QUANTA_CRC and len(t) == 4: + name = "QUANTA-CRC" + value = "0x%04X" % ((t[2] << 8) + t[3]) + elif t[0] == self._TLV_CODE_QUANTA_CARD_TYPE and len(t) == 6: + name = "Card Type" + value = "0x%08X" % ((t[2] << 24) | (t[3] << 16) | (t[4] << 8) | t[5]) + elif t[0] == self._TLV_CODE_QUANTA_HW_VERSION and len(t) == 6: + name = "Hardware Version" + value = "%d.%d" % (t[2], t[3]) + elif t[0] == self._TLV_CODE_QUANTA_SW_VERSION and len(t) == 6: + name = "Software Version" + value = "%d.%d.%d.%d" % ((t[2] >> 4), (t[2] & 0xF), (t[3] >> 4), (t[3] & 0xF)) + elif t[0] == self._TLV_CODE_QUANTA_MANUF_DATE and len(t) == 6: + name = "Manufacture Date" + value = "%04d/%d/%d" % (((t[2] << 8) | t[3]), t[4], t[5]) + elif t[0] == self._TLV_CODE_QUANTA_MODEL_NAME: + name = "Model Name" + value = t[2:2 + t[1]].decode("ascii") + else: + name = "Unknown" + value = "" + for c in t[2:2 + t[1]]: + value += "0x%02X " % c + return name, value + diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix8-56x/sonic_platform/fan.py b/platform/broadcom/sonic-platform-modules-quanta/ix8-56x/sonic_platform/fan.py new file mode 100644 index 000000000000..97797df673e5 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix8-56x/sonic_platform/fan.py @@ -0,0 +1,226 @@ +#!/usr/bin/env python + +############################################################################# +# Quanta IX8 +# +# Module contains an implementation of SONiC Platform Base API and +# provides the FAN information +# +############################################################################# + +try: + import logging + import os + from sonic_platform_base.fan_base import FanBase +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +############### +# Global +############### +HWMON_DIR = "/sys/class/hwmon/hwmon1/" +FAN_INDEX_START = 21 +NUM_FANTRAYS = 6 +FANS_PERTRAY = 2 + +class Fan(FanBase): + """Platform-specific Fan class""" + + def __init__(self, index, is_psu_fan=False): + self.is_psu_fan = is_psu_fan + self.fan_index = index + self.psu_fan_index_mapping = { + 1:41, + 2:52, + } + self.psu_index_mapping = { + 1:43, + 2:54, + } + if self.is_psu_fan: + self.fan_presence_attr = "power{}_present".format(self.psu_index_mapping[index]) + self.fan_pwm_attr = "fan{}_pwm".format(self.psu_fan_index_mapping[index]) + self.fan_rpm_attr = "fan{}_input".format(self.psu_fan_index_mapping[index]) + self.fan_direction_attr = "fan{}_direction".format(self.psu_fan_index_mapping[index]) + else: + self.fan_presence_attr = "fan{}_present".format(FAN_INDEX_START+(index-1)) + self.fan_pwm_attr = "fan{}_pwm".format(FAN_INDEX_START+(index-1)) + self.fan_rpm_attr = "fan{}_input".format(FAN_INDEX_START+(index-1)) + self.fan_direction_attr = "fan{}_direction".format(FAN_INDEX_START+(index-1)) + + +####################### +# private function +####################### + + def __get_attr_value(self, attr_path): + + retval = 'ERR' + if (not os.path.isfile(attr_path)): + return retval + + try: + with open(attr_path, 'r') as fd: + retval = fd.read() + except Exception as error: + logging.error("Unable to open " + attr_path + " file !") + + retval = retval.rstrip(' \t\n\r') + return retval + + + #################### + # Device base + #################### + + def get_name(self): + """ + Retrieves the name of the device + + Returns: + string: The name of the device + """ + if self.is_psu_fan: + return "PSU-{}_FAN".format(self.fan_index) + else: + fantray_index = (self.fan_index-1)//FANS_PERTRAY+1 + fan_index_intray = self.fan_index - ((fantray_index-1)*FANS_PERTRAY) + return "Fantray{}_{}".format(fantray_index, fan_index_intray) + + def get_presence(self): + """ + Retrieves the presence of the device + + Returns: + bool: True if device is present, False if not + """ + attr_path = HWMON_DIR + self.fan_presence_attr + attr_rv = self.__get_attr_value(attr_path) + if (attr_rv != 'ERR'): + if (attr_rv == '1'): + return True + else: + return False + + return None + + def get_status(self): + """ + Retrieves the operational status of the device + + Returns: + A boolean value, True if device is operating properly, False if not + """ + if self.get_presence(): + attr_path = HWMON_DIR + self.fan_rpm_attr + attr_rv = self.__get_attr_value(attr_path) + + if (attr_rv != 'ERR' and attr_rv != '0.0'): + return True + else: + return False + else: + return False + + ################# + # fan base + ################# + + def get_direction(self): + """ + Retrieves the direction of fan + + Returns: + A string, either FAN_DIRECTION_INTAKE or FAN_DIRECTION_EXHAUST + depending on fan direction + """ + attr_path = HWMON_DIR + self.fan_direction_attr + attr_rv = self.__get_attr_value(attr_path) + + if attr_rv == '2': + return self.FAN_DIRECTION_INTAKE + else: + return self.FAN_DIRECTION_EXHAUST + + def get_speed(self): + """ + Retrieves the speed of fan as a percentage of full speed + + Returns: + An integer, the percentage of full fan speed, in the range 0 (off) + to 100 (full speed) + """ + if self.get_presence(): + attr_path = HWMON_DIR + self.fan_pwm_attr + attr_rv = self.__get_attr_value(attr_path) + + if (attr_rv != 'ERR'): + return int(float(attr_rv)) + else: + return False + else: + return 0 + + def get_speed_rpm(self): + """ + Retrieves the speed of fan in revolutions per minute (RPM) + + Returns: + An integer, speed of the fan in RPM + """ + attr_path = HWMON_DIR + self.fan_rpm_attr + attr_rv = self.__get_attr_value(attr_path) + + if (attr_rv != 'ERR'): + return int(float(attr_rv)) + else: + return False + + def get_target_speed(self): + """ + Retrieves the target (expected) speed of the fan + + Returns: + An integer, the percentage of full fan speed, in the range 0 (off) + to 100 (full speed) + """ + attr_path = HWMON_DIR + self.fan_pwm_attr + attr_rv = self.__get_attr_value(attr_path) + + if (attr_rv != 'ERR'): + return int(float(attr_rv)) + else: + return False + + def get_speed_tolerance(self): + """ + Retrieves the speed tolerance of the fan + + Returns: + An integer, the percentage of variance from target speed which is + considered tolerable + """ + return 25 + + def set_status_led(self, color): + """ + Sets the state of the fan module status LED + + Args: + color: A string representing the color with which to set the + fan module status LED + + Returns: + bool: True if status LED state is set successfully, False if not + """ + return True + + def get_status_led(self): + """ + Gets the state of the fan status LED + + Returns: + A string, one of the predefined STATUS_LED_COLOR_* strings above + """ + return None diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix8-56x/sonic_platform/fan_drawer.py b/platform/broadcom/sonic-platform-modules-quanta/ix8-56x/sonic_platform/fan_drawer.py new file mode 100644 index 000000000000..75e954576a28 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix8-56x/sonic_platform/fan_drawer.py @@ -0,0 +1,47 @@ +#!/usr/bin/env python + +############################################################################# +# Quanta +# +# Module contains an implementation of SONiC Platform Base API and +# provides the fan status which are available in the platform +# +############################################################################# + +try: + from sonic_platform_base.fan_drawer_base import FanDrawerBase +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class FanDrawer(FanDrawerBase): + + def __init__(self, index, fan_list): + FanDrawerBase.__init__(self) + + self._fan_list = fan_list + self._index = index + + def get_name(self): + """ + Retrieves the name of the device + Returns: + string: The name of the device + """ + return 'Fan {}'.format(self._index) + + def get_presence(self): + """ + Retrieves the presence of the FAN + Returns: + bool: True if FAN is present, False if not + """ + return self._fan_list[0].get_presence() + + def get_status(self): + """ + Retrieves the operational status of the device + Returns: + A boolean value, True if device is operating properly, False if not + """ + return self._fan_list[0].get_status() diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix8-56x/sonic_platform/platform.py b/platform/broadcom/sonic-platform-modules-quanta/ix8-56x/sonic_platform/platform.py new file mode 100644 index 000000000000..8d20abef9009 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix8-56x/sonic_platform/platform.py @@ -0,0 +1,20 @@ +#!/usr/bin/env python +# +# Name: platform.py, version: 1.0 +# +# Description: Module contains the definitions of SONiC platform APIs +# + + +try: + from sonic_platform_base.platform_base import PlatformBase + from sonic_platform.chassis import Chassis +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class Platform(PlatformBase): + + def __init__(self): + PlatformBase.__init__(self) + self._chassis = Chassis() diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix8-56x/sonic_platform/psu.py b/platform/broadcom/sonic-platform-modules-quanta/ix8-56x/sonic_platform/psu.py new file mode 100644 index 000000000000..60e0f29740db --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix8-56x/sonic_platform/psu.py @@ -0,0 +1,316 @@ +#!/usr/bin/env python +# +# Name: psu.py, version: 1.0 +# +# Description: Module contains the definitions of SONiC platform APIs +# + +try: + import logging + import os + from sonic_platform_base.psu_base import PsuBase + from sonic_platform.fan import Fan +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +HWMON_DIR = "/sys/class/hwmon/hwmon1/" + +class Psu(PsuBase): + def __init__(self, index): + PsuBase.__init__(self) + fan = Fan(index, True) + self._fan_list.append(fan) + + self.psu_index_mapping = { + 1:43, + 2:54, + } + self.psu_powerin_index_mapping = { + 1:42, + 2:53, + } + self.psu_currentout_index_mapping = { + 1:40, + 2:51, + } + self.psu_currentin_index_mapping = { + 1:39, + 2:50, + } + self.psu_voltageout_index_mapping = { + 1:48, + 2:59, + } + self.psu_voltagein_index_mapping = { + 1:47, + 2:58, + } + self.index = index + self.psu_presence_attr = "power{}_present".format(self.psu_index_mapping[self.index]) + self.psu_status_attr = "curr{}_input".format(self.psu_currentout_index_mapping[self.index]) + self.psu_power_in_attr = "power{}_input".format(self.psu_powerin_index_mapping[self.index]) + self.psu_power_out_attr = "power{}_input".format(self.psu_index_mapping[self.index]) + self.psu_voltage_out_attr = "in{}_input".format(self.psu_voltageout_index_mapping[self.index]) + self.psu_current_out_attr = "curr{}_input".format(self.psu_currentout_index_mapping[self.index]) + self.psu_voltage_in_attr = "in{}_input".format(self.psu_voltagein_index_mapping[self.index]) + self.psu_current_in_attr = "curr{}_input".format(self.psu_currentin_index_mapping[self.index]) + self.psu_serial_attr = "power{}_sn".format(self.psu_index_mapping[self.index]) + self.psu_model_attr = "power{}_model".format(self.psu_index_mapping[self.index]) + self.psu_mfr_id_attr = "power{}_mfrid".format(self.psu_index_mapping[self.index]) + self.psu_capacity_attr = "power{}_pout_max".format(self.psu_index_mapping[self.index]) + self.psu_type_attr = "power{}_vin_type".format(self.psu_index_mapping[self.index]) + + def __get_attr_value(self, attr_path): + + retval = 'ERR' + if (not os.path.isfile(attr_path)): + return retval + + try: + with open(attr_path, 'r') as fd: + retval = fd.read() + except Exception as error: + logging.error("Unable to open " + attr_path + " file !") + + retval = retval.rstrip(' \t\n\r') + fd.close() + return retval + +############################################## +# Device methods +############################################## + + def get_name(self): + """ + Retrieves the name of the device + + Returns: + string: The name of the device + """ + return "PSU{}".format(self.index) + + def get_presence(self): + """ + Retrieves the presence of the device + + Returns: + bool: True if device is present, False if not + """ + presence = False + attr_path = HWMON_DIR+self.psu_presence_attr + attr_normal = '1' + + attr_rv = self.__get_attr_value(attr_path) + if (attr_rv != 'ERR'): + if (attr_rv == attr_normal): + presence = True + + return presence + + def get_model(self): + """ + Retrieves the model number (or part number) of the device + + Returns: + string: Model/part number of device + """ + model = "N/A" + attr_path = HWMON_DIR+self.psu_model_attr + attr_rv = self.__get_attr_value(attr_path) + if (attr_rv != 'ERR'): + model = attr_rv + + return model + + def get_mfr_id(self): + """ + Retrieves the manufacturer's name (or id) of the device + + Returns: + string: Manufacturer's id of device + """ + mfr_id = "N/A" + attr_path = HWMON_DIR+self.psu_mfr_id_attr + attr_rv = self.__get_attr_value(attr_path) + if (attr_rv != 'ERR'): + mfr_id = attr_rv + + return mfr_id + + def get_serial(self): + """ + Retrieves the serial number of the device + + Returns: + string: Serial number of device + """ + serial = "N/A" + attr_path = HWMON_DIR+self.psu_serial_attr + + attr_rv = self.__get_attr_value(attr_path) + if (attr_rv != 'ERR'): + serial = attr_rv + + return serial + + def get_status(self): + """ + Retrieves the operational status of the device + + Returns: + A boolean value, True if device is operating properly, False if not + """ + status = False + attr_path = HWMON_DIR+self.psu_status_attr + + attr_rv = self.__get_attr_value(attr_path) + if (attr_rv != 'ERR'): + attr_rv, dummy = attr_rv.split('.', 1) + if (int(attr_rv) != 0): + status = True + + return status + +############################################## +# PSU methods +############################################## + + def get_voltage(self): + """ + Retrieves current PSU voltage output + + Returns: + A float number, the output voltage in volts, + e.g. 12.1 + """ + voltage_out = 0.0 + attr_path = HWMON_DIR+self.psu_voltage_out_attr + + attr_rv = self.__get_attr_value(attr_path) + if (attr_rv != 'ERR'): + attr_rv, dummy = attr_rv.split('.', 1) + voltage_out = float(attr_rv) / 1000 + + return voltage_out + + def get_current(self): + """ + Retrieves present electric current supplied by PSU + + Returns: + A float number, the electric current in amperes, e.g 15.4 + """ + current_out = 0.0 + attr_path = HWMON_DIR+self.psu_current_out_attr + + attr_rv = self.__get_attr_value(attr_path) + if (attr_rv != 'ERR'): + attr_rv, dummy = attr_rv.split('.', 1) + current_out = float(attr_rv) / 1000 + + return current_out + + def get_input_voltage(self): + """ + Retrieves current PSU voltage output + + Returns: + A float number, the output voltage in volts, + e.g. 12.1 + """ + voltage_in = 0.0 + attr_path = HWMON_DIR+self.psu_voltage_in_attr + + attr_rv = self.__get_attr_value(attr_path) + if (attr_rv != 'ERR'): + attr_rv, dummy = attr_rv.split('.', 1) + voltage_in = float(attr_rv) / 1000 + + return voltage_in + + def get_input_current(self): + """ + Retrieves present electric current supplied by PSU + + Returns: + A float number, the electric current in amperes, e.g 15.4 + """ + current_in = 0.0 + attr_path = HWMON_DIR+self.psu_current_in_attr + + attr_rv = self.__get_attr_value(attr_path) + if (attr_rv != 'ERR'): + attr_rv, dummy = attr_rv.split('.', 1) + current_in = float(attr_rv) / 1000 + + return current_in + + def get_power(self): + """ + Retrieves current energy supplied by PSU + + Returns: + A float number, the power in watts, e.g. 302.6 + """ + power_out = 0.0 + attr_path = HWMON_DIR+self.psu_power_out_attr + + attr_rv = self.__get_attr_value(attr_path) + if (attr_rv != 'ERR'): + attr_rv, dummy = attr_rv.split('.', 1) + power_out = float(attr_rv) / 1000 + + return power_out + + def get_powergood_status(self): + """ + Retrieves the powergood status of PSU + + Returns: + A boolean, True if PSU has stablized its output voltages and passed all + its internal self-tests, False if not. + """ + return self.get_status() + + def get_status_led(self): + """ + Gets the state of the PSU status LED + + Returns: + A string, one of the predefined STATUS_LED_COLOR_* strings above + """ + if self.get_powergood_status(): + return self.STATUS_LED_COLOR_GREEN + else: + return self.STATUS_LED_COLOR_OFF + + def get_type(self): + """ + Gets the type of the PSU + + Returns: + A string, the type of PSU (AC/DC) + """ + type = "AC" + attr_path = HWMON_DIR+self.psu_type_attr + attr_rv = self.__get_attr_value(attr_path) + if (attr_rv != 'ERR'): + type = attr_rv + + return type + + def get_capacity(self): + """ + Gets the capacity (maximum output power) of the PSU in watts + + Returns: + An integer, the capacity of PSU + """ + capacity = 0 + attr_path = HWMON_DIR+self.psu_capacity_attr + attr_rv = self.__get_attr_value(attr_path) + if (attr_rv != 'ERR'): + capacity = int(attr_rv) + + return capacity + diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix8-56x/sonic_platform/sfp.py b/platform/broadcom/sonic-platform-modules-quanta/ix8-56x/sonic_platform/sfp.py new file mode 100644 index 000000000000..6679e96a7eb2 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix8-56x/sonic_platform/sfp.py @@ -0,0 +1,1625 @@ +#!/usr/bin/env python + +############################################################################# +# Quanta +# +# Sfp contains an implementation of SONiC Platform Base API and +# provides the sfp device status which are available in the platform +# +############################################################################# + +import os +import time +#import subprocess +#import sonic_device_util +from ctypes import create_string_buffer + +try: + from sonic_platform_base.sfp_base import SfpBase +# from sonic_platform_base.sonic_eeprom import eeprom_dts + from sonic_platform_base.sonic_sfp.sff8472 import sff8472InterfaceId + from sonic_platform_base.sonic_sfp.sff8472 import sff8472Dom + from sonic_platform_base.sonic_sfp.sff8436 import sff8436InterfaceId + from sonic_platform_base.sonic_sfp.sff8436 import sff8436Dom + from sonic_platform_base.sonic_sfp.sfputilhelper import SfpUtilHelper +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +QSFP_INFO_OFFSET = 128 +QSFP_DOM_OFFSET = 0 +SFP_INFO_OFFSET = 0 +SFP_DOM_OFFSET = 256 + +# definitions of the offset and width for values in XCVR info eeprom +XCVR_INTFACE_BULK_OFFSET = 0 +XCVR_INTFACE_BULK_WIDTH_QSFP = 20 +XCVR_INTFACE_BULK_WIDTH_SFP = 21 +XCVR_TYPE_OFFSET = 0 +XCVR_TYPE_WIDTH = 1 +XCVR_EXT_TYPE_OFFSET = 1 +XCVR_EXT_TYPE_WIDTH = 1 +XCVR_CONNECTOR_OFFSET = 2 +XCVR_CONNECTOR_WIDTH = 1 +XCVR_COMPLIANCE_CODE_OFFSET = 3 +XCVR_COMPLIANCE_CODE_WIDTH = 8 +XCVR_ENCODING_OFFSET = 11 +XCVR_ENCODING_WIDTH = 1 +XCVR_NBR_OFFSET = 12 +XCVR_NBR_WIDTH = 1 +XCVR_EXT_RATE_SEL_OFFSET = 13 +XCVR_EXT_RATE_SEL_WIDTH = 1 +XCVR_CABLE_LENGTH_OFFSET = 14 +XCVR_CABLE_LENGTH_WIDTH_QSFP = 5 +XCVR_CABLE_LENGTH_WIDTH_SFP = 6 +XCVR_VENDOR_NAME_OFFSET = 20 +XCVR_VENDOR_NAME_WIDTH = 16 +XCVR_VENDOR_OUI_OFFSET = 37 +XCVR_VENDOR_OUI_WIDTH = 3 +XCVR_VENDOR_PN_OFFSET = 40 +XCVR_VENDOR_PN_WIDTH = 16 +XCVR_HW_REV_OFFSET = 56 +XCVR_HW_REV_WIDTH_QSFP = 2 +XCVR_HW_REV_WIDTH_SFP = 4 +XCVR_VENDOR_SN_OFFSET = 68 +XCVR_VENDOR_SN_WIDTH = 16 +XCVR_VENDOR_DATE_OFFSET = 84 +XCVR_VENDOR_DATE_WIDTH = 8 +XCVR_DOM_CAPABILITY_OFFSET = 92 +XCVR_DOM_CAPABILITY_WIDTH = 2 + +XCVR_INTERFACE_DATA_START = 0 +XCVR_INTERFACE_DATA_SIZE = 92 + +QSFP_DOM_BULK_DATA_START = 22 +QSFP_DOM_BULK_DATA_SIZE = 36 +SFP_DOM_BULK_DATA_START = 96 +SFP_DOM_BULK_DATA_SIZE = 10 + +# Offset for values in QSFP eeprom +QSFP_DOM_REV_OFFSET = 1 +QSFP_DOM_REV_WIDTH = 1 +QSFP_TEMPE_OFFSET = 22 +QSFP_TEMPE_WIDTH = 2 +QSFP_VOLT_OFFSET = 26 +QSFP_VOLT_WIDTH = 2 +QSFP_VERSION_COMPLIANCE_OFFSET = 1 +QSFP_VERSION_COMPLIANCE_WIDTH = 1 +QSFP_CHANNL_MON_OFFSET = 34 +QSFP_CHANNL_MON_WIDTH = 16 +QSFP_CHANNL_MON_WITH_TX_POWER_WIDTH = 24 +QSFP_CHANNL_DISABLE_STATUS_OFFSET = 86 +QSFP_CHANNL_DISABLE_STATUS_WIDTH = 1 +QSFP_CHANNL_RX_LOS_STATUS_OFFSET = 3 +QSFP_CHANNL_RX_LOS_STATUS_WIDTH = 1 +QSFP_CHANNL_TX_FAULT_STATUS_OFFSET = 4 +QSFP_CHANNL_TX_FAULT_STATUS_WIDTH = 1 +QSFP_CONTROL_OFFSET = 86 +QSFP_CONTROL_WIDTH = 8 +QSFP_MODULE_MONITOR_OFFSET = 0 +QSFP_MODULE_MONITOR_WIDTH = 9 +QSFP_MODULE_THRESHOLD_OFFSET = 512 +QSFP_MODULE_THRESHOLD_WIDTH = 24 +QSFP_CHANNEL_THRESHOLD_OFFSET = 560 +QSFP_CHANNEL_THRESHOLD_WIDTH = 16 +QSFP_POWEROVERRIDE_OFFSET = 93 +QSFP_POWEROVERRIDE_WIDTH = 1 +QSFP_POWEROVERRIDE_BIT = 0 +QSFP_POWERSET_BIT = 1 +QSFP_OPTION_VALUE_OFFSET = 192 +QSFP_OPTION_VALUE_WIDTH = 4 + +SFP_TEMPE_OFFSET = 96 +SFP_TEMPE_WIDTH = 2 +SFP_VOLT_OFFSET = 98 +SFP_VOLT_WIDTH = 2 +SFP_CHANNL_MON_OFFSET = 100 +SFP_CHANNL_MON_WIDTH = 6 +SFP_MODULE_THRESHOLD_OFFSET = 0 +SFP_MODULE_THRESHOLD_WIDTH = 40 +SFP_CHANNL_THRESHOLD_OFFSET = 112 +SFP_CHANNL_THRESHOLD_WIDTH = 2 +SFP_STATUS_CONTROL_OFFSET = 110 +SFP_STATUS_CONTROL_WIDTH = 1 +SFP_TX_DISABLE_HARD_BIT = 7 +SFP_TX_DISABLE_SOFT_BIT = 6 + +qsfp_cable_length_tup = ('Length(km)', 'Length OM3(2m)', + 'Length OM2(m)', 'Length OM1(m)', + 'Length Cable Assembly(m)') + +sfp_cable_length_tup = ('LengthSMFkm-UnitsOfKm', 'LengthSMF(UnitsOf100m)', + 'Length50um(UnitsOf10m)', 'Length62.5um(UnitsOfm)', + 'LengthCable(UnitsOfm)', 'LengthOM3(UnitsOf10m)') + +sfp_compliance_code_tup = ('10GEthernetComplianceCode', 'InfinibandComplianceCode', + 'ESCONComplianceCodes', 'SONETComplianceCodes', + 'EthernetComplianceCodes','FibreChannelLinkLength', + 'FibreChannelTechnology', 'SFP+CableTechnology', + 'FibreChannelTransmissionMedia','FibreChannelSpeed') + +qsfp_compliance_code_tup = ('10/40G Ethernet Compliance Code', 'SONET Compliance codes', + 'SAS/SATA compliance codes', 'Gigabit Ethernet Compliant codes', + 'Fibre Channel link length/Transmitter Technology', + 'Fibre Channel transmission media', 'Fibre Channel Speed') + +SFP_TYPE = "SFP" +QSFP_TYPE = "QSFP" + + +class Sfp(SfpBase): + """Platform-specific Sfp class""" + + # Port number + PORT_START = 1 + PORT_END = 56 + QSFP_START = 49 + QSFP_END = 56 + + dom_supported = True + dom_temp_supported = True + dom_volt_supported = True + dom_rx_power_supported = True + dom_tx_power_supported = True + dom_tx_disable_supported = True + calibration = 1 + + # Path to QSFP sysfs + PLATFORM_ROOT_PATH = "/usr/share/sonic/device" + PMON_HWSKU_PATH = "/usr/share/sonic/hwsku" + HOST_CHK_CMD = "docker > /dev/null 2>&1" + + PLATFORM = "x86_64-quanta_ix8_rglbmc-r0" + HWSKU = "Quanta-IX8-56X" + + def __init__(self, sfp_index, sfp_type): + # Init index + self.index = sfp_index + self.port_num = self.index + #self.dom_supported = False + self.sfp_type = sfp_type + # Init eeprom path + eeprom_path = '/sys/bus/i2c/devices/i2c-{0}/{0}-0050/eeprom' + self.port_to_eeprom_mapping = {} + self.port_to_i2c_mapping = { + 1 : 17, + 2 : 18, + 3 : 19, + 4 : 20, + 5 : 21, + 6 : 22, + 7 : 23, + 8 : 24, + 9 : 25, + 10 : 26, + 11 : 27, + 12 : 28, + 13 : 29, + 14 : 30, + 15 : 31, + 16 : 32, + 17 : 33, + 18 : 34, + 19 : 35, + 20 : 36, + 21 : 37, + 22 : 38, + 23 : 39, + 24 : 40, + 25 : 41, + 26 : 42, + 27 : 43, + 28 : 44, + 29 : 45, + 30 : 46, + 31 : 47, + 32 : 48, + 33 : 49, + 34 : 50, + 35 : 51, + 36 : 52, + 37 : 53, + 38 : 54, + 39 : 55, + 40 : 56, + 41 : 57, + 42 : 58, + 43 : 59, + 44 : 60, + 45 : 61, + 46 : 62, + 47 : 63, + 48 : 64, + 49 : 65,#QSFP49 + 50 : 66,#QSFP50 + 51 : 67,#QSFP51 + 52 : 68,#QSFP52 + 53 : 69,#QSFP53 + 54 : 70,#QSFP54 + 55 : 71,#QSFP55 + 56 : 72,#QSFP56 + } + + for x in range(self.PORT_START, self.PORT_END + 1): + port_eeprom_path = eeprom_path.format(self.port_to_i2c_mapping[x]) + self.port_to_eeprom_mapping[x] = port_eeprom_path + + self.info_dict_keys = ['type', 'hardware_rev', 'serial', 'manufacturer', + 'model', 'connector', 'encoding', 'ext_identifier', + 'ext_rateselect_compliance', 'cable_type', 'cable_length', + 'nominal_bit_rate', 'specification_compliance', 'vendor_date', + 'vendor_oui', 'application_advertisement'] + + self.dom_dict_keys = ['rx_los', 'tx_fault', 'reset_status', 'power_lpmode', + 'tx_disable', 'tx_disable_channel', 'temperature', 'voltage', + 'rx1power', 'rx2power', 'rx3power', 'rx4power', 'tx1bias', 'tx2bias', + 'tx3bias', 'tx4bias', 'tx1power', 'tx2power', 'tx3power', 'tx4power'] + + self.threshold_dict_keys = ['temphighalarm', 'temphighwarning', + 'templowalarm', 'templowwarning', 'vcchighalarm', 'vcchighwarning', + 'vcclowalarm', 'vcclowwarning', 'rxpowerhighalarm', 'rxpowerhighwarning', + 'rxpowerlowalarm', 'rxpowerlowwarning', 'txpowerhighalarm', + 'txpowerhighwarning', 'txpowerlowalarm', 'txpowerlowwarning', + 'txbiashighalarm', 'txbiashighwarning', 'txbiaslowalarm', 'txbiaslowwarning'] + + SfpBase.__init__(self) + + + def _convert_string_to_num(self, value_str): + if "-inf" in value_str: + return 'N/A' + elif "Unknown" in value_str: + return 'N/A' + elif 'dBm' in value_str: + t_str = value_str.rstrip('dBm') + return float(t_str) + elif 'mA' in value_str: + t_str = value_str.rstrip('mA') + return float(t_str) + elif 'C' in value_str: + t_str = value_str.rstrip('C') + return float(t_str) + elif 'Volts' in value_str: + t_str = value_str.rstrip('Volts') + return float(t_str) + else: + return 'N/A' + + def __read_txt_file(self, file_path): + try: + with open(file_path, 'r') as fd: + data = fd.read() + return data.strip() + except IOError: + pass + return "" + + def __is_host(self): + return os.system(self.HOST_CHK_CMD) == 0 + + def __get_path_to_port_config_file(self): + platform_path = "/".join([self.PLATFORM_ROOT_PATH, self.PLATFORM]) + hwsku_path = "/".join([platform_path, self.HWSKU] + ) if self.__is_host() else self.PMON_HWSKU_PATH + return "/".join([hwsku_path, "port_config.ini"]) + + def get_presence(self): + """ + Retrieves the presence of the SFP module + Returns: + bool: True if SFP module is present, False if not + """ + # Check for invalid port_num + if self.port_num < self.PORT_START or self.port_num > self.PORT_END: + return False + + try: + if self.sfp_type == SFP_TYPE: + reg_file = open("/sys/class/cpld-sfp28/port-"+str(self.port_num)+"/pre_n") + else: + reg_file = open("/sys/class/gpio/gpio" + +str((self.port_num-self.QSFP_START)*4+34)+"/value") + except IOError as e: + print("Error: unable to open file: %s" % str(e)) + return False + + reg_value = reg_file.readline().rstrip() + reg_file.close() + if self.sfp_type == SFP_TYPE: + if reg_value == '1': + return True + else: + if reg_value == '0': + return True + + return False + + def __read_eeprom_specific_bytes(self, offset, num_bytes): + sysfsfile_eeprom = None + eeprom_raw = [] + for i in range(0, num_bytes): + eeprom_raw.append("0x00") + + sysfs_sfp_i2c_client_eeprom_path = self.port_to_eeprom_mapping[self.port_num] + try: + sysfsfile_eeprom = open( + sysfs_sfp_i2c_client_eeprom_path, mode="rb", buffering=0) + sysfsfile_eeprom.seek(offset) + raw = sysfsfile_eeprom.read(num_bytes) + for n in range(0, num_bytes): + eeprom_raw[n] = hex(raw[n])[2:].zfill(2) + except Exception: + eeprom_raw = None + finally: + if sysfsfile_eeprom: + sysfsfile_eeprom.close() + + return eeprom_raw + + def __convert_string_to_num(self, value_str): + if "-inf" in value_str: + return 'N/A' + elif "Unknown" in value_str: + return 'N/A' + elif 'dBm' in value_str: + t_str = value_str.rstrip('dBm') + return float(t_str) + elif 'mA' in value_str: + t_str = value_str.rstrip('mA') + return float(t_str) + elif 'C' in value_str: + t_str = value_str.rstrip('C') + return float(t_str) + elif 'Volts' in value_str: + t_str = value_str.rstrip('Volts') + return float(t_str) + else: + return 'N/A' + + def _dom_capability_detect(self): + if not self.get_presence(): + self.dom_supported = False + self.dom_temp_supported = False + self.dom_volt_supported = False + self.dom_rx_power_supported = False + self.dom_tx_power_supported = False + self.calibration = 0 + return + + if self.sfp_type == "QSFP": + self.calibration = 1 + sfpi_obj = sff8436InterfaceId() + if sfpi_obj is None: + self.dom_supported = False + offset = 128 + + # QSFP capability byte parse, through this byte can know whether it support tx_power or not. + # TODO: in the future when decided to migrate to support SFF-8636 instead of SFF-8436, + # need to add more code for determining the capability and version compliance + # in SFF-8636 dom capability definitions evolving with the versions. + qsfp_dom_capability_raw = self.__read_eeprom_specific_bytes( + (offset + XCVR_DOM_CAPABILITY_OFFSET), XCVR_DOM_CAPABILITY_WIDTH) + if qsfp_dom_capability_raw is not None: + qsfp_dom_capability = int(qsfp_dom_capability_raw[0], 16) + + qsfp_version_compliance_raw = self.__read_eeprom_specific_bytes( + QSFP_VERSION_COMPLIANCE_OFFSET, QSFP_VERSION_COMPLIANCE_OFFSET) + if qsfp_version_compliance_raw is not None: + qsfp_version_compliance = int(qsfp_version_compliance_raw[0], 16) + else: + self.dom_supported = False + self.dom_temp_supported = False + self.dom_volt_supported = False + self.dom_rx_power_supported = False + self.dom_tx_power_supported = False + self.calibration = 0 + return + + if qsfp_version_compliance >= 0x08: + self.dom_temp_supported = (qsfp_dom_capability & 0x20 != 0) + self.dom_volt_supported = (qsfp_dom_capability & 0x10 != 0) + self.dom_rx_power_supported = (qsfp_dom_capability & 0x08 != 0) + self.dom_tx_power_supported = (qsfp_dom_capability & 0x04 != 0) + else: + self.dom_temp_supported = True + self.dom_volt_supported = True + self.dom_rx_power_supported = (qsfp_dom_capability & 0x08 != 0) + self.dom_tx_power_supported = True + self.dom_supported = True + self.calibration = 1 + self.dom_tx_disable_supported = True + else: + self.dom_supported = False + self.dom_temp_supported = False + self.dom_volt_supported = False + self.dom_rx_power_supported = False + self.dom_tx_power_supported = False + self.calibration = 0 + elif self.sfp_type == "SFP": + sfpi_obj = sff8472InterfaceId() + if sfpi_obj is None: + return None + sfp_dom_capability_raw = self.__read_eeprom_specific_bytes( + XCVR_DOM_CAPABILITY_OFFSET, XCVR_DOM_CAPABILITY_WIDTH) + if sfp_dom_capability_raw is not None: + sfp_dom_capability = int(sfp_dom_capability_raw[0], 16) + self.dom_supported = (sfp_dom_capability & 0x40 != 0) + if self.dom_supported: + self.dom_temp_supported = True + self.dom_volt_supported = True + self.dom_rx_power_supported = True + self.dom_tx_power_supported = True + if sfp_dom_capability & 0x20 != 0: + self.calibration = 1 + elif sfp_dom_capability & 0x10 != 0: + self.calibration = 2 + else: + self.calibration = 0 + else: + self.dom_temp_supported = False + self.dom_volt_supported = False + self.dom_rx_power_supported = False + self.dom_tx_power_supported = False + self.calibration = 0 + self.dom_tx_disable_supported = (int(sfp_dom_capability_raw[1], 16) & 0x40 != 0) + else: + self.dom_supported = False + self.dom_temp_supported = False + self.dom_volt_supported = False + self.dom_rx_power_supported = False + self.dom_tx_power_supported = False + + def get_transceiver_info(self): + """ + Retrieves transceiver info of this SFP + Returns: + A dict which contains following keys/values : + ======================================================================== + keys |Value Format |Information + ---------------------------|---------------|---------------------------- + type |1*255VCHAR |type of SFP + hardware_rev |1*255VCHAR |hardware version of SFP + serial |1*255VCHAR |serial number of the SFP + manufacturer |1*255VCHAR |SFP vendor name + model |1*255VCHAR |SFP model name + connector |1*255VCHAR |connector information + encoding |1*255VCHAR |encoding information + ext_identifier |1*255VCHAR |extend identifier + ext_rateselect_compliance |1*255VCHAR |extended rateSelect compliance + cable_length |INT |cable length in m + nominal_bit_rate |INT |nominal bit rate by 100Mbs + specification_compliance |1*255VCHAR |specification compliance + vendor_date |1*255VCHAR |vendor date + vendor_oui |1*255VCHAR |vendor OUI + application_advertisement |1*255VCHAR |supported applications advertisement + ======================================================================== + """ + + transceiver_info_dict = {} + compliance_code_dict = {} + transceiver_info_dict = dict.fromkeys(self.info_dict_keys, 'N/A') + transceiver_info_dict['specification_compliance'] = '{}' + if not self.get_presence(): + return transceiver_info_dict + + if self.sfp_type == QSFP_TYPE: + offset = QSFP_INFO_OFFSET + vendor_rev_width = XCVR_HW_REV_WIDTH_QSFP + interface_info_bulk_width = XCVR_INTFACE_BULK_WIDTH_QSFP + + sfpi_obj = sff8436InterfaceId() + if sfpi_obj is None: + print("Error: sfp_object open failed") + return transceiver_info_dict + + elif self.sfp_type == SFP_TYPE: + offset = SFP_INFO_OFFSET + vendor_rev_width = XCVR_HW_REV_WIDTH_SFP + interface_info_bulk_width = XCVR_INTFACE_BULK_WIDTH_SFP + + sfpi_obj = sff8472InterfaceId() + if sfpi_obj is None: + print("Error: sfp_object open failed") + return transceiver_info_dict + else: + return transceiver_info_dict + + # Add retry for xcvr eeprom to get ready + max_retry = 10 + for i in range(0,max_retry): + sfp_interface_bulk_raw = self.__read_eeprom_specific_bytes( + offset + XCVR_INTERFACE_DATA_START, XCVR_INTERFACE_DATA_SIZE) + if sfp_interface_bulk_raw is not None: + break + else: + if not self.get_presence(): + return transceiver_info_dict + elif i == max_retry-1: + pass + else: + time.sleep(0.5) + + if sfp_interface_bulk_raw is None: + return transceiver_info_dict + + start = XCVR_INTFACE_BULK_OFFSET - XCVR_INTERFACE_DATA_START + end = start + interface_info_bulk_width + sfp_interface_bulk_data = sfpi_obj.parse_sfp_info_bulk(sfp_interface_bulk_raw[start : end], 0) + + start = XCVR_VENDOR_NAME_OFFSET - XCVR_INTERFACE_DATA_START + end = start + XCVR_VENDOR_NAME_WIDTH + sfp_vendor_name_data = sfpi_obj.parse_vendor_name(sfp_interface_bulk_raw[start : end], 0) + + start = XCVR_VENDOR_PN_OFFSET - XCVR_INTERFACE_DATA_START + end = start + XCVR_VENDOR_PN_WIDTH + sfp_vendor_pn_data = sfpi_obj.parse_vendor_pn(sfp_interface_bulk_raw[start : end], 0) + + start = XCVR_HW_REV_OFFSET - XCVR_INTERFACE_DATA_START + end = start + vendor_rev_width + sfp_vendor_rev_data = sfpi_obj.parse_vendor_rev(sfp_interface_bulk_raw[start : end], 0) + + start = XCVR_VENDOR_SN_OFFSET - XCVR_INTERFACE_DATA_START + end = start + XCVR_VENDOR_SN_WIDTH + sfp_vendor_sn_data = sfpi_obj.parse_vendor_sn(sfp_interface_bulk_raw[start : end], 0) + + start = XCVR_VENDOR_OUI_OFFSET - XCVR_INTERFACE_DATA_START + end = start + XCVR_VENDOR_OUI_WIDTH + sfp_vendor_oui_data = sfpi_obj.parse_vendor_oui(sfp_interface_bulk_raw[start : end], 0) + + start = XCVR_VENDOR_DATE_OFFSET - XCVR_INTERFACE_DATA_START + end = start + XCVR_VENDOR_DATE_WIDTH + sfp_vendor_date_data = sfpi_obj.parse_vendor_date(sfp_interface_bulk_raw[start : end], 0) + transceiver_info_dict['type'] = sfp_interface_bulk_data \ + ['data']['type']['value'] + transceiver_info_dict['manufacturer'] = sfp_vendor_name_data \ + ['data']['Vendor Name']['value'] + transceiver_info_dict['model'] = sfp_vendor_pn_data \ + ['data']['Vendor PN']['value'] + transceiver_info_dict['hardware_rev'] = sfp_vendor_rev_data \ + ['data']['Vendor Rev']['value'] + transceiver_info_dict['serial'] = sfp_vendor_sn_data \ + ['data']['Vendor SN']['value'] + transceiver_info_dict['vendor_oui'] = sfp_vendor_oui_data \ + ['data']['Vendor OUI']['value'] + transceiver_info_dict['vendor_date'] = sfp_vendor_date_data \ + ['data']['VendorDataCode(YYYY-MM-DD Lot)']['value'] + transceiver_info_dict['connector'] = sfp_interface_bulk_data \ + ['data']['Connector']['value'] + transceiver_info_dict['encoding'] = sfp_interface_bulk_data \ + ['data']['EncodingCodes']['value'] + transceiver_info_dict['ext_identifier'] = sfp_interface_bulk_data \ + ['data']['Extended Identifier']['value'] + transceiver_info_dict['ext_rateselect_compliance'] = sfp_interface_bulk_data \ + ['data']['RateIdentifier']['value'] + transceiver_info_dict['type_abbrv_name'] = 'N/A' + if self.sfp_type == QSFP_TYPE: + for key in qsfp_cable_length_tup: + if key in sfp_interface_bulk_data['data']: + transceiver_info_dict['cable_type'] = key + transceiver_info_dict['cable_length'] = str( + sfp_interface_bulk_data['data'][key]['value']) + + for key in qsfp_compliance_code_tup: + if key in sfp_interface_bulk_data['data']['Specification compliance']['value']: + compliance_code_dict[key] = sfp_interface_bulk_data \ + ['data']['Specification compliance']['value'][key]['value'] + transceiver_info_dict['specification_compliance'] = str(compliance_code_dict) + + transceiver_info_dict['nominal_bit_rate'] = str(sfp_interface_bulk_data \ + ['data']['Nominal Bit Rate(100Mbs)']['value']) + else: + for key in sfp_cable_length_tup: + if key in sfp_interface_bulk_data['data']: + transceiver_info_dict['cable_type'] = key + transceiver_info_dict['cable_length'] = str( + sfp_interface_bulk_data['data'][key]['value']) + + for key in sfp_compliance_code_tup: + if key in sfp_interface_bulk_data['data']['Specification compliance']['value']: + compliance_code_dict[key] = sfp_interface_bulk_data \ + ['data']['Specification compliance']['value'][key]['value'] + transceiver_info_dict['specification_compliance'] = str(compliance_code_dict) + + transceiver_info_dict['nominal_bit_rate'] = str(sfp_interface_bulk_data \ + ['data']['NominalSignallingRate(UnitsOf100Mbd)']['value']) + + return transceiver_info_dict + + def get_transceiver_bulk_status(self): + """ + Retrieves transceiver bulk status of this SFP + Returns: + A dict which contains following keys/values : + ======================================================================== + keys |Value Format |Information + ---------------------------|---------------|---------------------------- + rx_los |BOOLEAN |RX loss-of-signal status, True if has RX los, False if not. + tx_fault |BOOLEAN |TX fault status, True if has TX fault, False if not. + reset_status |BOOLEAN |reset status, True if SFP in reset, False if not. + lp_mode |BOOLEAN |low power mode status, True in lp mode, False if not. + tx_disable |BOOLEAN |TX disable status, True TX disabled, False if not. + tx_disabled_channel |HEX |disabled TX channels in hex, bits 0 to 3 represent channel 0 + | |to channel 3. + temperature |INT |module temperature in Celsius + voltage |INT |supply voltage in mV + txbias |INT |TX Bias Current in mA, n is the channel number, + | |for example, tx2bias stands for tx bias of channel 2. + rxpower |INT |received optical power in mW, n is the channel number, + | |for example, rx2power stands for rx power of channel 2. + txpower |INT |TX output power in mW, n is the channel number, + | |for example, tx2power stands for tx power of channel 2. + ======================================================================== + """ + + if not self.get_presence(): + return {} + + self._dom_capability_detect() + + if self.sfp_type == QSFP_TYPE: + sfpd_obj = sff8436Dom() + sfpi_obj = sff8436InterfaceId() + + if not sfpi_obj or not sfpd_obj: + return {} + + transceiver_dom_info_dict = dict.fromkeys(self.dom_dict_keys, 'N/A') + offset = QSFP_DOM_OFFSET + offset_xcvr = QSFP_INFO_OFFSET + + # QSFP capability byte parse, through this byte can know whether it support tx_power or not. + # TODO: in the future when decided to migrate to support SFF-8636 instead of SFF-8436, + # need to add more code for determining the capability and version compliance + # in SFF-8636 dom capability definitions evolving with the versions. + qsfp_dom_capability_raw = self.__read_eeprom_specific_bytes( + (offset_xcvr + XCVR_DOM_CAPABILITY_OFFSET), XCVR_DOM_CAPABILITY_WIDTH) + if qsfp_dom_capability_raw is not None: + qsfp_dom_capability_data = sfpi_obj.parse_dom_capability( + qsfp_dom_capability_raw, 0) + else: + return None + + dom_temperature_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_TEMPE_OFFSET), QSFP_TEMPE_WIDTH) + if dom_temperature_raw is not None: + dom_temperature_data = sfpd_obj.parse_temperature( + dom_temperature_raw, 0) + transceiver_dom_info_dict['temperature'] = dom_temperature_data['data']['Temperature']['value'] + + dom_voltage_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_VOLT_OFFSET), QSFP_VOLT_WIDTH) + if dom_voltage_raw is not None: + dom_voltage_data = sfpd_obj.parse_voltage(dom_voltage_raw, 0) + transceiver_dom_info_dict['voltage'] = dom_voltage_data['data']['Vcc']['value'] + + qsfp_dom_rev_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_DOM_REV_OFFSET), QSFP_DOM_REV_WIDTH) + if qsfp_dom_rev_raw is not None: + qsfp_dom_rev_data = sfpd_obj.parse_sfp_dom_rev(qsfp_dom_rev_raw, 0) + qsfp_dom_rev = qsfp_dom_rev_data['data']['dom_rev']['value'] + + # The tx_power monitoring is only available on QSFP which compliant with SFF-8636 + # and claimed that it support tx_power with one indicator bit. + dom_channel_monitor_data = {} + dom_channel_monitor_raw = None + qsfp_tx_power_support = qsfp_dom_capability_data['data']['Tx_power_support']['value'] + if (qsfp_dom_rev[0:8] != 'SFF-8636' or (qsfp_dom_rev[0:8] == 'SFF-8636' and qsfp_tx_power_support != 'on')): + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_CHANNL_MON_OFFSET), QSFP_CHANNL_MON_WIDTH) + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = sfpd_obj.parse_channel_monitor_params( + dom_channel_monitor_raw, 0) + + else: + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_CHANNL_MON_OFFSET), QSFP_CHANNL_MON_WITH_TX_POWER_WIDTH) + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = sfpd_obj.parse_channel_monitor_params_with_tx_power( + dom_channel_monitor_raw, 0) + transceiver_dom_info_dict['tx1power'] = dom_channel_monitor_data['data']['TX1Power']['value'] + transceiver_dom_info_dict['tx2power'] = dom_channel_monitor_data['data']['TX2Power']['value'] + transceiver_dom_info_dict['tx3power'] = dom_channel_monitor_data['data']['TX3Power']['value'] + transceiver_dom_info_dict['tx4power'] = dom_channel_monitor_data['data']['TX4Power']['value'] + + if dom_channel_monitor_raw: + transceiver_dom_info_dict['rx1power'] = dom_channel_monitor_data['data']['RX1Power']['value'] + transceiver_dom_info_dict['rx2power'] = dom_channel_monitor_data['data']['RX2Power']['value'] + transceiver_dom_info_dict['rx3power'] = dom_channel_monitor_data['data']['RX3Power']['value'] + transceiver_dom_info_dict['rx4power'] = dom_channel_monitor_data['data']['RX4Power']['value'] + transceiver_dom_info_dict['tx1bias'] = dom_channel_monitor_data['data']['TX1Bias']['value'] + transceiver_dom_info_dict['tx2bias'] = dom_channel_monitor_data['data']['TX2Bias']['value'] + transceiver_dom_info_dict['tx3bias'] = dom_channel_monitor_data['data']['TX3Bias']['value'] + transceiver_dom_info_dict['tx4bias'] = dom_channel_monitor_data['data']['TX4Bias']['value'] + elif self.sfp_type == SFP_TYPE: + sfpd_obj = sff8472Dom() + if not sfpd_obj: + return {} + + eeprom_ifraw = self.__read_eeprom_specific_bytes(0, SFP_DOM_OFFSET) + if eeprom_ifraw is not None: + sfpi_obj = sff8472InterfaceId(eeprom_ifraw) + cal_type = sfpi_obj.get_calibration_type() + sfpd_obj._calibration_type = cal_type + + offset = SFP_DOM_OFFSET + transceiver_dom_info_dict = dict.fromkeys(self.dom_dict_keys, 'N/A') + dom_temperature_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_TEMPE_OFFSET), SFP_TEMPE_WIDTH) + + if dom_temperature_raw is not None: + dom_temperature_data = sfpd_obj.parse_temperature( + dom_temperature_raw, 0) + transceiver_dom_info_dict['temperature'] = dom_temperature_data['data']['Temperature']['value'] + + dom_voltage_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_VOLT_OFFSET), SFP_VOLT_WIDTH) + if dom_voltage_raw is not None: + dom_voltage_data = sfpd_obj.parse_voltage(dom_voltage_raw, 0) + transceiver_dom_info_dict['voltage'] = dom_voltage_data['data']['Vcc']['value'] + + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_CHANNL_MON_OFFSET), SFP_CHANNL_MON_WIDTH) + if dom_channel_monitor_raw is not None: + dom_voltage_data = sfpd_obj.parse_channel_monitor_params( + dom_channel_monitor_raw, 0) + transceiver_dom_info_dict['tx1power'] = dom_voltage_data['data']['TXPower']['value'] + transceiver_dom_info_dict['rx1power'] = dom_voltage_data['data']['RXPower']['value'] + transceiver_dom_info_dict['tx1bias'] = dom_voltage_data['data']['TXBias']['value'] + else: + return None + + for key in transceiver_dom_info_dict: + transceiver_dom_info_dict[key] = self._convert_string_to_num( + transceiver_dom_info_dict[key]) + + transceiver_dom_info_dict['rx_los'] = self.get_rx_los() + transceiver_dom_info_dict['tx_fault'] = self.get_tx_fault() + transceiver_dom_info_dict['reset_status'] = self.get_reset_status() + transceiver_dom_info_dict['lp_mode'] = self.get_lpmode() + transceiver_dom_info_dict['tx_disable'] = self.get_tx_disable() + transceiver_dom_info_dict['tx_disable_channel'] = self.get_tx_disable_channel() + + return transceiver_dom_info_dict + + def get_transceiver_threshold_info(self): + """ + Retrieves transceiver threshold info of this SFP + + Returns: + A dict which contains following keys/values : + ======================================================================== + keys |Value Format |Information + ---------------------------|---------------|---------------------------- + temphighalarm |FLOAT |High Alarm Threshold value of temperature in Celsius. + templowalarm |FLOAT |Low Alarm Threshold value of temperature in Celsius. + temphighwarning |FLOAT |High Warning Threshold value of temperature in Celsius. + templowwarning |FLOAT |Low Warning Threshold value of temperature in Celsius. + vcchighalarm |FLOAT |High Alarm Threshold value of supply voltage in mV. + vcclowalarm |FLOAT |Low Alarm Threshold value of supply voltage in mV. + vcchighwarning |FLOAT |High Warning Threshold value of supply voltage in mV. + vcclowwarning |FLOAT |Low Warning Threshold value of supply voltage in mV. + rxpowerhighalarm |FLOAT |High Alarm Threshold value of received power in dBm. + rxpowerlowalarm |FLOAT |Low Alarm Threshold value of received power in dBm. + rxpowerhighwarning |FLOAT |High Warning Threshold value of received power in dBm. + rxpowerlowwarning |FLOAT |Low Warning Threshold value of received power in dBm. + txpowerhighalarm |FLOAT |High Alarm Threshold value of transmit power in dBm. + txpowerlowalarm |FLOAT |Low Alarm Threshold value of transmit power in dBm. + txpowerhighwarning |FLOAT |High Warning Threshold value of transmit power in dBm. + txpowerlowwarning |FLOAT |Low Warning Threshold value of transmit power in dBm. + txbiashighalarm |FLOAT |High Alarm Threshold value of tx Bias Current in mA. + txbiaslowalarm |FLOAT |Low Alarm Threshold value of tx Bias Current in mA. + txbiashighwarning |FLOAT |High Warning Threshold value of tx Bias Current in mA. + txbiaslowwarning |FLOAT |Low Warning Threshold value of tx Bias Current in mA. + ======================================================================== + """ + transceiver_dom_threshold_info_dict_keys = ['temphighalarm', 'temphighwarning', 'templowalarm', 'templowwarning', + 'vcchighalarm', 'vcchighwarning', 'vcclowalarm', 'vcclowwarning', + 'rxpowerhighalarm', 'rxpowerhighwarning', 'rxpowerlowalarm', 'rxpowerlowwarning', + 'txpowerhighalarm', 'txpowerhighwarning', 'txpowerlowalarm', 'txpowerlowwarning', + 'txbiashighalarm', 'txbiashighwarning', 'txbiaslowalarm', 'txbiaslowwarning'] + + if self.sfp_type == QSFP_TYPE: + sfpd_obj = sff8436Dom() + if not self.get_presence() or not sfpd_obj: + return {} + DOM_OFFSET = 0 + transceiver_dom_threshold_dict = dict.fromkeys(transceiver_dom_threshold_info_dict_keys, 'N/A') + offset = DOM_OFFSET + + dom_module_threshold_raw = self.__read_eeprom_specific_bytes((offset + QSFP_MODULE_THRESHOLD_OFFSET), QSFP_MODULE_THRESHOLD_WIDTH) + if dom_module_threshold_raw is not None: + module_threshold_values = sfpd_obj.parse_module_threshold_values(dom_module_threshold_raw, 0) + module_threshold_data = module_threshold_values.get('data') + if module_threshold_data: + transceiver_dom_threshold_dict['temphighalarm'] = module_threshold_data['TempHighAlarm']['value'] + transceiver_dom_threshold_dict['templowalarm'] = module_threshold_data['TempLowAlarm']['value'] + transceiver_dom_threshold_dict['temphighwarning'] = module_threshold_data['TempHighWarning']['value'] + transceiver_dom_threshold_dict['templowwarning'] = module_threshold_data['TempLowWarning']['value'] + transceiver_dom_threshold_dict['vcchighalarm'] = module_threshold_data['VccHighAlarm']['value'] + transceiver_dom_threshold_dict['vcclowalarm'] = module_threshold_data['VccLowAlarm']['value'] + transceiver_dom_threshold_dict['vcchighwarning'] = module_threshold_data['VccHighWarning']['value'] + transceiver_dom_threshold_dict['vcclowwarning'] = module_threshold_data['VccLowWarning']['value'] + + dom_channel_thres_raw = self.__read_eeprom_specific_bytes((offset + QSFP_CHANNEL_THRESHOLD_OFFSET), QSFP_CHANNEL_THRESHOLD_WIDTH) + if dom_channel_thres_raw is not None: + channel_threshold_values = sfpd_obj.parse_channel_threshold_values(dom_channel_thres_raw, 0) + channel_threshold_data = channel_threshold_values.get('data') + else: + channel_threshold_data = None + if channel_threshold_data: + transceiver_dom_threshold_dict['rxpowerhighalarm'] = channel_threshold_data['RxPowerHighAlarm']['value'] + transceiver_dom_threshold_dict['rxpowerlowalarm'] = channel_threshold_data['RxPowerLowAlarm']['value'] + transceiver_dom_threshold_dict['rxpowerhighwarning'] = channel_threshold_data['RxPowerHighWarning']['value'] + transceiver_dom_threshold_dict['rxpowerlowwarning'] = channel_threshold_data['RxPowerLowWarning']['value'] + transceiver_dom_threshold_dict['txpowerhighalarm'] = "0.0dBm" + transceiver_dom_threshold_dict['txpowerlowalarm'] = "0.0dBm" + transceiver_dom_threshold_dict['txpowerhighwarning'] = "0.0dBm" + transceiver_dom_threshold_dict['txpowerlowwarning'] = "0.0dBm" + transceiver_dom_threshold_dict['txbiashighalarm'] = channel_threshold_data['TxBiasHighAlarm']['value'] + transceiver_dom_threshold_dict['txbiaslowalarm'] = channel_threshold_data['TxBiasLowAlarm']['value'] + transceiver_dom_threshold_dict['txbiashighwarning'] = channel_threshold_data['TxBiasHighWarning']['value'] + transceiver_dom_threshold_dict['txbiaslowwarning'] = channel_threshold_data['TxBiasLowWarning']['value'] + + for key in transceiver_dom_threshold_dict: + transceiver_dom_threshold_dict[key] = self.__convert_string_to_num(transceiver_dom_threshold_dict[key]) + + return transceiver_dom_threshold_dict + + elif self.sfp_type == SFP_TYPE: + sfpd_obj = sff8472Dom() + + if not self.get_presence() and not sfpd_obj: + return {} + DOM_OFFSET = 256 + eeprom_ifraw = self.__read_eeprom_specific_bytes(0, DOM_OFFSET) + if eeprom_ifraw is not None: + sfpi_obj = sff8472InterfaceId(eeprom_ifraw) + cal_type = sfpi_obj.get_calibration_type() + sfpd_obj._calibration_type = cal_type + + offset = DOM_OFFSET + transceiver_dom_threshold_info_dict = dict.fromkeys(transceiver_dom_threshold_info_dict_keys, 'N/A') + dom_module_threshold_raw = self.__read_eeprom_specific_bytes((offset + SFP_MODULE_THRESHOLD_OFFSET), SFP_MODULE_THRESHOLD_WIDTH) + if dom_module_threshold_raw is not None: + dom_module_threshold_data = sfpd_obj.parse_alarm_warning_threshold(dom_module_threshold_raw, 0) + + transceiver_dom_threshold_info_dict['temphighalarm'] = dom_module_threshold_data['data']['TempHighAlarm']['value'] + transceiver_dom_threshold_info_dict['templowalarm'] = dom_module_threshold_data['data']['TempLowAlarm']['value'] + transceiver_dom_threshold_info_dict['temphighwarning'] = dom_module_threshold_data['data']['TempHighWarning']['value'] + transceiver_dom_threshold_info_dict['templowwarning'] = dom_module_threshold_data['data']['TempLowWarning']['value'] + + transceiver_dom_threshold_info_dict['vcchighalarm'] = dom_module_threshold_data['data']['VoltageHighAlarm']['value'] + transceiver_dom_threshold_info_dict['vcclowalarm'] = dom_module_threshold_data['data']['VoltageLowAlarm']['value'] + transceiver_dom_threshold_info_dict['vcchighwarning'] = dom_module_threshold_data['data']['VoltageHighWarning']['value'] + transceiver_dom_threshold_info_dict['vcclowwarning'] = dom_module_threshold_data['data']['VoltageLowWarning']['value'] + + transceiver_dom_threshold_info_dict['txbiashighalarm'] = dom_module_threshold_data['data']['BiasHighAlarm']['value'] + transceiver_dom_threshold_info_dict['txbiaslowalarm'] = dom_module_threshold_data['data']['BiasLowAlarm']['value'] + transceiver_dom_threshold_info_dict['txbiashighwarning'] = dom_module_threshold_data['data']['BiasHighWarning']['value'] + transceiver_dom_threshold_info_dict['txbiaslowwarning'] = dom_module_threshold_data['data']['BiasLowWarning']['value'] + + transceiver_dom_threshold_info_dict['txpowerhighalarm'] = dom_module_threshold_data['data']['TXPowerHighAlarm']['value'] + transceiver_dom_threshold_info_dict['txpowerlowalarm'] = dom_module_threshold_data['data']['TXPowerLowAlarm']['value'] + transceiver_dom_threshold_info_dict['txpowerhighwarning'] = dom_module_threshold_data['data']['TXPowerHighWarning']['value'] + transceiver_dom_threshold_info_dict['txpowerlowwarning'] = dom_module_threshold_data['data']['TXPowerLowWarning']['value'] + + transceiver_dom_threshold_info_dict['rxpowerhighalarm'] = dom_module_threshold_data['data']['RXPowerHighAlarm']['value'] + transceiver_dom_threshold_info_dict['rxpowerlowalarm'] = dom_module_threshold_data['data']['RXPowerLowAlarm']['value'] + transceiver_dom_threshold_info_dict['rxpowerhighwarning'] = dom_module_threshold_data['data']['RXPowerHighWarning']['value'] + transceiver_dom_threshold_info_dict['rxpowerlowwarning'] = dom_module_threshold_data['data']['RXPowerLowWarning']['value'] + + for key in transceiver_dom_threshold_info_dict: + transceiver_dom_threshold_info_dict[key] = self.__convert_string_to_num(transceiver_dom_threshold_info_dict[key]) + + return transceiver_dom_threshold_info_dict + + else: + return None + + def get_reset_status(self): + """ + Retrieves the reset status of SFP + Returns: + A Boolean, True if reset enabled, False if disabled + """ + # SFP doesn't support this feature + if self.sfp_type == SFP_TYPE: + return False + elif self.sfp_type == QSFP_TYPE: + try: + reg_file = open("/sys/class/gpio/gpio" + +str((self.port_num-self.QSFP_START)*4+32)+"/value") + except IOError as e: + print("Error: unable to open file: %s" % str(e)) + return None + reg_value = int(reg_file.readline().rstrip()) + reg_file.close() + if reg_value == 0: + return True + else: + return False + else: + return None + + def get_rx_los(self): + """ + Retrieves the RX LOS (lost-of-signal) status of SFP + Returns: + A Boolean, True if SFP has RX LOS, False if not. + Note : RX LOS status is latched until a call to get_rx_los or a reset. + """ + if not self.dom_supported: + return None + + rx_los_list = [] + + if self.sfp_type == QSFP_TYPE: + offset = 0 + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_CHANNL_RX_LOS_STATUS_OFFSET), QSFP_CHANNL_RX_LOS_STATUS_WIDTH) + if dom_channel_monitor_raw is not None: + rx_los_data = int(dom_channel_monitor_raw[0], 16) + rx_los_list.append(rx_los_data & 0x01 != 0) + rx_los_list.append(rx_los_data & 0x02 != 0) + rx_los_list.append(rx_los_data & 0x04 != 0) + rx_los_list.append(rx_los_data & 0x08 != 0) + elif self.sfp_type == SFP_TYPE: + offset = 256 + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_STATUS_CONTROL_OFFSET), SFP_STATUS_CONTROL_WIDTH) + if dom_channel_monitor_raw is not None: + rx_los_data = int(dom_channel_monitor_raw[0], 16) + rx_los_list.append(rx_los_data & 0x02 != 0) + else: + return None + else: + return None + + return rx_los_list + + def get_tx_fault(self): + """ + Retrieves the TX fault status of SFP + Returns: + A Boolean, True if SFP has TX fault, False if not + Note : TX fault status is lached until a call to get_tx_fault or a reset. + """ + if not self.dom_supported: + return None + + tx_fault_list = [] + + if self.sfp_type == QSFP_TYPE: + offset = 0 + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_CHANNL_TX_FAULT_STATUS_OFFSET), QSFP_CHANNL_TX_FAULT_STATUS_WIDTH) + if dom_channel_monitor_raw is not None: + tx_fault_data = int(dom_channel_monitor_raw[0], 16) + tx_fault_list.append(tx_fault_data & 0x01 != 0) + tx_fault_list.append(tx_fault_data & 0x02 != 0) + tx_fault_list.append(tx_fault_data & 0x04 != 0) + tx_fault_list.append(tx_fault_data & 0x08 != 0) + elif self.sfp_type == SFP_TYPE: + offset = 256 + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_STATUS_CONTROL_OFFSET), SFP_STATUS_CONTROL_WIDTH) + if dom_channel_monitor_raw is not None: + tx_fault_data = int(dom_channel_monitor_raw[0], 16) + tx_fault_list.append(tx_fault_data & 0x04 != 0) + else: + return None + else: + return None + + return tx_fault_list + + def get_tx_disable(self): + """ + Retrieves the tx_disable status of this SFP + Returns: + A Boolean, True if tx_disable is enabled, False if disabled + """ + if not self.dom_supported: + return None + + tx_disable_list = [] + + if self.sfp_type == QSFP_TYPE: + offset = 0 + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_CHANNL_DISABLE_STATUS_OFFSET), QSFP_CHANNL_DISABLE_STATUS_WIDTH) + if dom_channel_monitor_raw is not None: + tx_disable_data = int(dom_channel_monitor_raw[0], 16) + tx_disable_list.append(tx_disable_data & 0x01 != 0) + tx_disable_list.append(tx_disable_data & 0x02 != 0) + tx_disable_list.append(tx_disable_data & 0x04 != 0) + tx_disable_list.append(tx_disable_data & 0x08 != 0) + elif self.sfp_type == SFP_TYPE: + offset = 256 + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_STATUS_CONTROL_OFFSET), SFP_STATUS_CONTROL_WIDTH) + if dom_channel_monitor_raw is not None: + tx_disable_data = int(dom_channel_monitor_raw[0], 16) + tx_disable_list.append(tx_disable_data & 0xC0 != 0) + else: + return None + else: + return None + + return tx_disable_list + + def get_tx_disable_channel(self): + """ + Retrieves the TX disabled channels in this SFP + Returns: + A hex of 4 bits (bit 0 to bit 3 as channel 0 to channel 3) to represent + TX channels which have been disabled in this SFP. + As an example, a returned value of 0x5 indicates that channel 0 + and channel 2 have been disabled. + """ + # SFP doesn't support this feature + if self.sfp_type == SFP_TYPE: + return 0 + elif self.sfp_type == QSFP_TYPE: + tx_disable_list = self.get_tx_disable() + if tx_disable_list is None: + return 0 + tx_disabled = 0 + for i in range(len(tx_disable_list)): + if tx_disable_list[i]: + tx_disabled |= 1 << i + else: + return None + + return tx_disabled + + def get_lpmode(self): + """ + Retrieves the lpmode (low power mode) status of this QSFP module + Returns: + A Boolean, True if lpmode is enabled, False if disabled + """ + # SFP doesn't support this feature + if self.sfp_type == SFP_TYPE: + return False + elif self.sfp_type == QSFP_TYPE: + try: + reg_file = open("/sys/class/gpio/gpio" + +str((self.port_num-self.QSFP_START)*4+35)+"/value") + except IOError as e: + print("Error: unable to open file: %s" % str(e)) + return False + reg_value = int(reg_file.readline().rstrip()) + reg_file.close() + if reg_value == 0: + return False + else: + return True + else: + return None + + def get_power_override(self): + """ + Retrieves the power-override status of this SFP + Returns: + A Boolean, True if power-override is enabled, False if disabled + """ + # SFP doesn't support this feature + if self.sfp_type == SFP_TYPE: + return False + elif self.sfp_type == QSFP_TYPE: + offset = 0 + sfpd_obj = sff8436Dom() + if sfpd_obj is None: + return False + + dom_control_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_POWEROVERRIDE_OFFSET), QSFP_POWEROVERRIDE_WIDTH) + if dom_control_raw is not None: + if int(dom_control_raw[0],16) & (0x01 << QSFP_POWEROVERRIDE_BIT): + return True + else: + return False + else: + return None + + def get_temperature(self): + """ + Retrieves the temperature of this SFP + Returns: + An integer number of current temperature in Celsius + """ + if not self.dom_supported: + return None + if self.sfp_type == QSFP_TYPE: + offset = 0 + + sfpd_obj = sff8436Dom() + if sfpd_obj is None: + return None + + if self.dom_temp_supported: + dom_temperature_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_TEMPE_OFFSET), QSFP_TEMPE_WIDTH) + if dom_temperature_raw is not None: + dom_temperature_data = sfpd_obj.parse_temperature(dom_temperature_raw, 0) + temp = self._convert_string_to_num( + dom_temperature_data['data']['Temperature']['value']) + return temp + else: + return None + elif self.sfp_type == SFP_TYPE: + offset = 256 + sfpd_obj = sff8472Dom() + if sfpd_obj is None: + return None + sfpd_obj._calibration_type = 1 + + dom_temperature_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_TEMPE_OFFSET), SFP_TEMPE_WIDTH) + if dom_temperature_raw is not None: + dom_temperature_data = sfpd_obj.parse_temperature(dom_temperature_raw, 0) + temp = self._convert_string_to_num( + dom_temperature_data['data']['Temperature']['value']) + return temp + else: + return None + else: + return None + + def get_voltage(self): + """ + Retrieves the supply voltage of this SFP + Returns: + An integer number of supply voltage in mV + """ + if not self.dom_supported: + return None + if self.sfp_type == QSFP_TYPE: + offset = 0 + + sfpd_obj = sff8436Dom() + if sfpd_obj is None: + return None + + if self.dom_volt_supported: + dom_voltage_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_VOLT_OFFSET), QSFP_VOLT_WIDTH) + if dom_voltage_raw is not None: + dom_voltage_data = sfpd_obj.parse_voltage(dom_voltage_raw, 0) + voltage = self._convert_string_to_num( + dom_voltage_data['data']['Vcc']['value']) + return voltage + else: + return None + elif self.sfp_type == SFP_TYPE: + offset = 256 + + sfpd_obj = sff8472Dom() + if sfpd_obj is None: + return None + + sfpd_obj._calibration_type = self.calibration + + dom_voltage_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_VOLT_OFFSET), SFP_VOLT_WIDTH) + if dom_voltage_raw is not None: + dom_voltage_data = sfpd_obj.parse_voltage(dom_voltage_raw, 0) + voltage = self._convert_string_to_num( + dom_voltage_data['data']['Vcc']['value']) + return voltage + else: + return None + else: + return None + + def get_tx_bias(self): + """ + Retrieves the TX bias current of this SFP + Returns: + A list of four integer numbers, representing TX bias in mA + for channel 0 to channel 4. + Ex. ['110.09', '111.12', '108.21', '112.09'] + """ + tx_bias_list = [] + if self.sfp_type == QSFP_TYPE: + offset = 0 + + sfpd_obj = sff8436Dom() + if sfpd_obj is None: + return None + + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_CHANNL_MON_OFFSET), QSFP_CHANNL_MON_WITH_TX_POWER_WIDTH) + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = \ + sfpd_obj.parse_channel_monitor_params_with_tx_power(dom_channel_monitor_raw, 0) + tx_bias_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TX1Bias']['value'])) + tx_bias_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TX2Bias']['value'])) + tx_bias_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TX3Bias']['value'])) + tx_bias_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TX4Bias']['value'])) + elif self.sfp_type == SFP_TYPE: + offset = 256 + + sfpd_obj = sff8472Dom() + if sfpd_obj is None: + return None + sfpd_obj._calibration_type = self.calibration + + if self.dom_supported: + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_CHANNL_MON_OFFSET), SFP_CHANNL_MON_WIDTH) + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = sfpd_obj.parse_channel_monitor_params( \ + dom_channel_monitor_raw, 0) + tx_bias_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TXBias']['value'])) + else: + return None + else: + return None + else: + return None + + return tx_bias_list + + def get_rx_power(self): + """ + Retrieves the received optical power for this SFP + Returns: + A list of four integer numbers, representing received optical + power in mW for channel 0 to channel 4. + Ex. ['1.77', '1.71', '1.68', '1.70'] + """ + rx_power_list = [] + + if self.sfp_type == QSFP_TYPE: + offset = 0 + + sfpd_obj = sff8436Dom() + if sfpd_obj is None: + return None + + if self.dom_rx_power_supported: + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_CHANNL_MON_OFFSET), QSFP_CHANNL_MON_WITH_TX_POWER_WIDTH) + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = \ + sfpd_obj.parse_channel_monitor_params_with_tx_power(dom_channel_monitor_raw, 0) + rx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['RX1Power']['value'])) + rx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['RX2Power']['value'])) + rx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['RX3Power']['value'])) + rx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['RX4Power']['value'])) + else: + return None + else: + return None + elif self.sfp_type == SFP_TYPE: + offset = 256 + + sfpd_obj = sff8472Dom() + if sfpd_obj is None: + return None + + if self.dom_supported: + sfpd_obj._calibration_type = self.calibration + + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_CHANNL_MON_OFFSET), SFP_CHANNL_MON_WIDTH) + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = \ + sfpd_obj.parse_channel_monitor_params(dom_channel_monitor_raw, 0) + rx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['RXPower']['value'])) + else: + return None + else: + return None + else: + return None + + return rx_power_list + + def get_tx_power(self): + """ + Retrieves the TX power of this SFP + Returns: + A list of four integer numbers, representing TX power in mW + for channel 0 to channel 4. + Ex. ['1.86', '1.86', '1.86', '1.86'] + """ + tx_power_list = [] + + if self.sfp_type == QSFP_TYPE: + offset = 0 + + sfpd_obj = sff8436Dom() + if sfpd_obj is None: + return None + + if self.dom_tx_power_supported: + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_CHANNL_MON_OFFSET), QSFP_CHANNL_MON_WITH_TX_POWER_WIDTH) + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = \ + sfpd_obj.parse_channel_monitor_params_with_tx_power(dom_channel_monitor_raw, 0) + tx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TX1Power']['value'])) + tx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TX2Power']['value'])) + tx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TX3Power']['value'])) + tx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TX4Power']['value'])) + else: + return None + else: + return None + elif self.sfp_type == SFP_TYPE: + offset = 256 + sfpd_obj = sff8472Dom() + if sfpd_obj is None: + return None + + if self.dom_supported: + sfpd_obj._calibration_type = self.calibration + + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_CHANNL_MON_OFFSET), SFP_CHANNL_MON_WIDTH) + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = \ + sfpd_obj.parse_channel_monitor_params(dom_channel_monitor_raw, 0) + tx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TXPower']['value'])) + else: + return None + else: + return None + else: + return None + + return tx_power_list + + def reset(self): + """ + Reset SFP and return all user module settings to their default state. + Returns: + A boolean, True if successful, False if not + """ + if not self.get_presence(): + return False + + # SFP doesn't support this feature + if self.sfp_type == SFP_TYPE: + return False + elif self.sfp_type == QSFP_TYPE: + try: + with open("/sys/class/gpio/gpio"+str((self.port_num-self.QSFP_START)*4+32)+"/direction", 'r+') as f: + f.write('out') + with open("/sys/class/gpio/gpio"+str((self.port_num-self.QSFP_START)*4+32)+"/value", "r+") as f: + f.write('0') + except IOError as e: + print("Error: unable to open file: %s" % str(e)) + return False + + # Sleep 2 second to allow it to settle + time.sleep(2) + + # Flip the value back write back to the register to take port out of reset + try: + with open("/sys/class/gpio/gpio"+str((self.port_num-self.QSFP_START)*4+32)+"/value", "r+") as f: + f.write('1') + except IOError as e: + print("Error: unable to open file: %s" % str(e)) + return False + else: + return None + + return True + + def tx_disable(self, tx_disable): + """ + Disable SFP TX for all channels + Args: + tx_disable : A Boolean, True to enable tx_disable mode, False to disable + tx_disable mode. + Returns: + A boolean, True if tx_disable is set successfully, False if not + """ + if not self.get_presence(): + return False + + if self.sfp_type == SFP_TYPE: + if self.dom_tx_disable_supported: + offset = 256 + sysfs_sfp_i2c_client_eeprom_path = self.port_to_eeprom_mapping[self.port_num] + status_control_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_STATUS_CONTROL_OFFSET), SFP_STATUS_CONTROL_WIDTH) + if status_control_raw is not None: + # Set bit 6 for Soft TX Disable Select + # 01000000 = 64 and 10111111 = 191 + tx_disable_bit = 64 if tx_disable else 191 + status_control = int(status_control_raw[0], 16) + tx_disable_ctl = (status_control | tx_disable_bit) if tx_disable else ( + status_control & tx_disable_bit) + try: + sysfsfile_eeprom = open( + sysfs_sfp_i2c_client_eeprom_path, mode="r+b", buffering=0) + buffer = create_string_buffer(1) + buffer[0] = chr(tx_disable_ctl) + # Write to eeprom + sysfsfile_eeprom.seek(offset + SFP_STATUS_CONTROL_OFFSET) + sysfsfile_eeprom.write(buffer[0]) + except IOError as e: + print("Error: unable to open file: %s" % str(e)) + return False + finally: + if sysfsfile_eeprom: + sysfsfile_eeprom.close() + time.sleep(0.01) + return True + return False + else: + return False + elif self.sfp_type == QSFP_TYPE: + if self.dom_tx_disable_supported: + channel_mask = 0x0f + if tx_disable: + return self.tx_disable_channel(channel_mask, True) + else: + return self.tx_disable_channel(channel_mask, False) + else: + return False + else: + return None + + def tx_disable_channel(self, channel, disable): + """ + Sets the tx_disable for specified SFP channels + Args: + channel : A hex of 4 bits (bit 0 to bit 3) which represent channel 0 to 3, + e.g. 0x5 for channel 0 and channel 2. + disable : A boolean, True to disable TX channels specified in channel, + False to enable + Returns: + A boolean, True if successful, False if not + """ + if not self.get_presence(): + return False + # SFP doesn't support this feature + if self.sfp_type == SFP_TYPE: + return False + elif self.sfp_type == QSFP_TYPE: + if self.dom_tx_disable_supported: + sysfsfile_eeprom = None + try: + channel_state = self.get_tx_disable_channel() + if disable: + tx_disable_ctl = channel_state | channel + else: + tx_disable_ctl = channel_state & (~channel) + buffer = create_string_buffer(1) + buffer[0] = chr(tx_disable_ctl) + # Write to eeprom + sysfsfile_eeprom = open( + self.port_to_eeprom_mapping[self.port_num], "r+b") + sysfsfile_eeprom.seek(QSFP_CONTROL_OFFSET) + sysfsfile_eeprom.write(buffer[0]) + except IOError as e: + print("Error: unable to open file: %s" % str(e)) + return False + finally: + if sysfsfile_eeprom is not None: + sysfsfile_eeprom.close() + time.sleep(0.01) + return True + else: + return False + else: + return None + + def set_lpmode(self, lpmode): + """ + Sets the lpmode (low power mode) of SFP + Args: + lpmode: A Boolean, True to enable lpmode, False to disable it + Note : lpmode can be overridden by set_power_override + Returns: + A boolean, True if lpmode is set successfully, False if not + """ + if not self.get_presence(): + return False + # SFP doesn't support this feature + if self.sfp_type == SFP_TYPE: + return False + elif self.sfp_type == QSFP_TYPE: + try: + reg_file = open("/sys/class/gpio/gpio" + +str((self.port_num-self.QSFP_START)*4+35)+"/value", "r+") + except IOError as e: + print("Error: unable to open file: %s" % str(e)) + return False + + # LPMode is active high; set or clear the bit accordingly + if lpmode: + reg_value = 1 + else: + reg_value = 0 + + reg_file.write(hex(reg_value)) + reg_file.close() + else: + return None + + return True + + def set_power_override(self, power_override, power_set): + """ + Sets SFP power level using power_override and power_set + Args: + power_override : + A Boolean, True to override set_lpmode and use power_set + to control SFP power, False to disable SFP power control + through power_override/power_set and use set_lpmode + to control SFP power. + power_set : + Only valid when power_override is True. + A Boolean, True to set SFP to low power mode, False to set + SFP to high power mode. + Returns: + A boolean, True if power-override and power_set are set successfully, + False if not + """ + # SFP doesn't support this feature + if not self.get_presence(): + return False + + if self.sfp_type == SFP_TYPE: + return False + elif self.sfp_type == QSFP_TYPE: + try: + power_override_bit = 0 + if power_override: + power_override_bit |= 1 << 0 + + power_set_bit = 0 + if power_set: + power_set_bit |= 1 << 1 + + buffer = create_string_buffer(1) + buffer[0] = chr(power_override_bit | power_set_bit) + # Write to eeprom + sysfsfile_eeprom = open(self.port_to_eeprom_mapping[self.port_num], "r+b") + sysfsfile_eeprom.seek(QSFP_POWEROVERRIDE_OFFSET) + sysfsfile_eeprom.write(buffer[0]) + except IOError as e: + print("Error: unable to open file: %s" % str(e)) + return False + finally: + if sysfsfile_eeprom is not None: + sysfsfile_eeprom.close() + time.sleep(0.01) + else: + return None + + return True + + def get_name(self): + """ + Retrieves the name of the device + Returns: + string: The name of the device + """ + sfputil_helper = SfpUtilHelper() + sfputil_helper.read_porttab_mappings(self.__get_path_to_port_config_file()) + print("self.index{}".format(self.index)) + name = sfputil_helper.logical[self.index-1] or "Unknown" + return name + diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix8-56x/sonic_platform/thermal.py b/platform/broadcom/sonic-platform-modules-quanta/ix8-56x/sonic_platform/thermal.py new file mode 100644 index 000000000000..f2ba18754759 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix8-56x/sonic_platform/thermal.py @@ -0,0 +1,153 @@ +#!/usr/bin/env python + +############################################################################# +# Quanta +# +# Module contains an implementation of SONiC Platform Base API and +# provides the Thermal information +# +############################################################################# + +import logging +import os + +try: + from sonic_platform_base.thermal_base import ThermalBase +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +HWMON_DIR = "/sys/class/hwmon/hwmon1/" + +thermal_index_mapping = { + 1:44, + 2:45, + 3:46, + 4:55, + 5:56, + 6:57, + 7:70, + 8:71, + 9:72, + 10:73, + 11:74, + 12:75, + 13:76, + 14:77, + 15:78, +} + +class Thermal(ThermalBase): + """Platform-specific Thermal class""" + + def __init__(self, thermal_index): + self.index = thermal_index + self.temp_attr = "temp{}_input".format(thermal_index_mapping[self.index]) + self.high_th_attr = "temp{}_ncrit".format(thermal_index_mapping[self.index]) + self.high_crit_th_attr = "temp{}_crit".format(thermal_index_mapping[self.index]) + self.name_attr = "temp{}_label".format(thermal_index_mapping[self.index]) + + + def __get_attr_value(self, attr_path): + + retval = 'ERR' + if (not os.path.isfile(attr_path)): + return retval + + try: + with open(attr_path, 'r') as fd: + retval = fd.read() + except Exception as error: + logging.error("Unable to open " + attr_path + " file !") + + retval = retval.rstrip(' \t\n\r') + return retval + + def get_name(self): + """ + Retrieves the name of the device + + Returns: + string: The name of the device + """ + attr_path = HWMON_DIR + self.name_attr + attr_rv = self.__get_attr_value(attr_path) + + if (attr_rv != 'ERR'): + return attr_rv + else: + return None + + def get_presence(self): + """ + Retrieves the presence of the device + + Returns: + bool: True if device is present, False if not + """ + attr_path = HWMON_DIR + self.name_attr + attr_rv = self.__get_attr_value(attr_path) + + if (attr_rv != 'ERR'): + return True + else: + return False + + def get_status(self): + """ + Retrieves the operational status of the device + + Returns: + A boolean value, True if device is operating properly, False if not + """ + if (self.get_temperature() != None): + return True + else: + return False + + def get_temperature(self): + """ + Retrieves current temperature reading from thermal + + Returns: + A float number of current temperature in Celsius up to nearest thousandth + of one degree Celsius, e.g. 30.125 + """ + attr_path = HWMON_DIR + self.temp_attr + attr_rv = self.__get_attr_value(attr_path) + + if (attr_rv != 'ERR'): + return float(attr_rv) / 1000 + else: + return None + + def get_high_threshold(self): + """ + Retrieves the high threshold temperature of thermal + + Returns: + A float number, the high threshold temperature of thermal in Celsius + up to nearest thousandth of one degree Celsius, e.g. 30.125 + """ + attr_path = HWMON_DIR + self.high_th_attr + attr_rv = self.__get_attr_value(attr_path) + + if (attr_rv != 'ERR'): + return float(attr_rv) / 1000 + else: + return None + + def get_high_critical_threshold(self): + """ + Retrieves the high threshold temperature of thermal + + Returns: + A float number, the high threshold temperature of thermal in Celsius + up to nearest thousandth of one degree Celsius, e.g. 30.125 + """ + attr_path = HWMON_DIR + self.high_crit_th_attr + attr_rv = self.__get_attr_value(attr_path) + + if (attr_rv != 'ERR'): + return float(attr_rv) / 1000 + else: + return None diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix8-56x/sonic_platform/watchdog.py b/platform/broadcom/sonic-platform-modules-quanta/ix8-56x/sonic_platform/watchdog.py new file mode 100644 index 000000000000..282f356f4e73 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix8-56x/sonic_platform/watchdog.py @@ -0,0 +1,234 @@ +#!/usr/bin/env python + +############################################################################# +# +# Watchdog contains an implementation of SONiC Platform Base Watchdog API +# +############################################################################# +import fcntl +import os +import array + +try: + from sonic_platform_base.watchdog_base import WatchdogBase +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +""" ioctl constants """ +IO_WRITE = 0x40000000 +IO_READ = 0x80000000 +IO_READ_WRITE = 0xC0000000 +IO_SIZE_INT = 0x00040000 +IO_SIZE_40 = 0x00280000 +IO_TYPE_WATCHDOG = ord('W') << 8 + +WDR_INT = IO_READ | IO_SIZE_INT | IO_TYPE_WATCHDOG +WDR_40 = IO_READ | IO_SIZE_40 | IO_TYPE_WATCHDOG +WDWR_INT = IO_READ_WRITE | IO_SIZE_INT | IO_TYPE_WATCHDOG + +""" Watchdog ioctl commands """ +WDIOC_GETSUPPORT = 0 | WDR_40 +WDIOC_GETSTATUS = 1 | WDR_INT +WDIOC_GETBOOTSTATUS = 2 | WDR_INT +WDIOC_GETTEMP = 3 | WDR_INT +WDIOC_SETOPTIONS = 4 | WDR_INT +WDIOC_KEEPALIVE = 5 | WDR_INT +WDIOC_SETTIMEOUT = 6 | WDWR_INT +WDIOC_GETTIMEOUT = 7 | WDR_INT +WDIOC_SETPRETIMEOUT = 8 | WDWR_INT +WDIOC_GETPRETIMEOUT = 9 | WDR_INT +WDIOC_GETTIMELEFT = 10 | WDR_INT + +""" Watchdog status constants """ +WDIOS_DISABLECARD = 0x0001 +WDIOS_ENABLECARD = 0x0002 + +WDT_COMMON_ERROR = -1 +WD_MAIN_IDENTITY = "iTCO_wdt" +WDT_SYSFS_PATH = "/sys/class/watchdog/" + +DEFAULT_TIMEOUT=180 + +class Watchdog(WatchdogBase): + + def __init__(self): + + self.watchdog, self.wdt_main_dev_name = self._get_wdt() + self.status_path = "/sys/class/watchdog/%s/status" % self.wdt_main_dev_name + self.state_path = "/sys/class/watchdog/%s/state" % self.wdt_main_dev_name + self.timeout_path = "/sys/class/watchdog/%s/timeout" % self.wdt_main_dev_name + # Set default value + self._disable() + self.armed = False + self.timeout = DEFAULT_TIMEOUT + + def _is_wd_main(self, dev): + """ + Checks watchdog identity + """ + identity = self._read_file( + "{}/{}/identity".format(WDT_SYSFS_PATH, dev)) + return identity == WD_MAIN_IDENTITY + + def _get_wdt(self): + """ + Retrieves watchdog device + """ + wdt_main_dev_list = [dev for dev in os.listdir( + "/dev/") if dev.startswith("watchdog") and self._is_wd_main(dev)] + if not wdt_main_dev_list: + return None + wdt_main_dev_name = wdt_main_dev_list[0] + watchdog_device_path = "/dev/{}".format(wdt_main_dev_name) + self.watchdog = os.open(watchdog_device_path, os.O_RDWR) + return self.watchdog, wdt_main_dev_name + + def _read_file(self, file_path): + """ + Read text file + """ + try: + with open(file_path, "r") as fd: + txt = fd.read() + except IOError: + return WDT_COMMON_ERROR + return txt.strip() + + def _enable(self): + """ + Turn on the watchdog timer + """ + req = array.array('h', [WDIOS_ENABLECARD]) + fcntl.ioctl(self.watchdog, WDIOC_SETOPTIONS, req, False) + + def _disable(self): + """ + Turn off the watchdog timer + """ + req = array.array('h', [WDIOS_DISABLECARD]) + fcntl.ioctl(self.watchdog, WDIOC_SETOPTIONS, req, False) + + def _keepalive(self): + """ + Keep alive watchdog timer + """ + fcntl.ioctl(self.watchdog, WDIOC_KEEPALIVE) + + def _settimeout(self, seconds): + """ + Set watchdog timer timeout + @param seconds - timeout in seconds + @return is the actual set timeout + """ + req = array.array('I', [seconds]) + fcntl.ioctl(self.watchdog, WDIOC_SETTIMEOUT, req, True) + return int(req[0]) + + def _gettimeout(self, timeout_path): + """ + Get watchdog timeout + @return watchdog timeout + """ + req = array.array('I', [0]) + fcntl.ioctl(self.watchdog, WDIOC_GETTIMEOUT, req, True) + + return int(req[0]) + + def _gettimeleft(self): + """ + Get time left before watchdog timer expires + @return time left in seconds + """ + req = array.array('I', [0]) + fcntl.ioctl(self.watchdog, WDIOC_GETTIMELEFT, req, True) + + return int(req[0]) + + ################################################################# + + def arm(self, seconds): + """ + Arm the hardware watchdog with a timeout of seconds. + If the watchdog is currently armed, calling this function will + simply reset the timer to the provided value. If the underlying + hardware does not support the value provided in , this + method should arm the watchdog with the *next greater* available + value. + Returns: + An integer specifying the *actual* number of seconds the watchdog + was armed with. On failure returns -1. + """ + + ret = WDT_COMMON_ERROR + if seconds < 0: + return ret + + try: + if self.timeout != seconds: + self.timeout = self._settimeout(seconds) + if self.armed: + self._keepalive() + else: + self._settimeout(seconds) + self._enable() + self.armed = True + ret = self.timeout + except IOError as e: + pass + + return ret + + def disarm(self): + """ + Disarm the hardware watchdog + Returns: + A boolean, True if watchdog is disarmed successfully, False if not + """ + disarmed = False + if self.is_armed(): + try: + self._disable() + self.armed = False + disarmed = True + except IOError: + pass + + return disarmed + + def is_armed(self): + """ + Retrieves the armed state of the hardware watchdog. + Returns: + A boolean, True if watchdog is armed, False if not + """ + + return self.armed + + def get_remaining_time(self): + """ + If the watchdog is armed, retrieve the number of seconds remaining on + the watchdog timer + Returns: + An integer specifying the number of seconds remaining on thei + watchdog timer. If the watchdog is not armed, returns -1. + """ + + timeleft = WDT_COMMON_ERROR + + if self.armed: + try: + timeleft = self._gettimeleft() + except IOError: + pass + + return timeleft + + def __del__(self): + """ + Close watchdog + """ + + os.close(self.watchdog) + + + diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix8-56x/sonic_platform_setup.py b/platform/broadcom/sonic-platform-modules-quanta/ix8-56x/sonic_platform_setup.py new file mode 100644 index 000000000000..1ec6ba42717e --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix8-56x/sonic_platform_setup.py @@ -0,0 +1,24 @@ +import os +from setuptools import setup +os.listdir + +setup( + name='sonic-platform', + version='1.0', + description='SONiC platform API implementation on Quanta Platforms', + license='Apache 2.0', + packages=['sonic_platform'], + classifiers=[ + 'Development Status :: 3 - Alpha', + 'Environment :: Plugins', + 'Intended Audience :: Developers', + 'Intended Audience :: Information Technology', + 'Intended Audience :: System Administrators', + 'License :: OSI Approved :: Apache Software License', + 'Natural Language :: English', + 'Operating System :: POSIX :: Linux', + 'Programming Language :: Python :: 3.7', + 'Topic :: Utilities', + ], + keywords='sonic SONiC platform PLATFORM', +) diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix8-56x/utils/quanta_ix8_util.py b/platform/broadcom/sonic-platform-modules-quanta/ix8-56x/utils/quanta_ix8_util.py index fe93611b114c..19dc24e370bd 100755 --- a/platform/broadcom/sonic-platform-modules-quanta/ix8-56x/utils/quanta_ix8_util.py +++ b/platform/broadcom/sonic-platform-modules-quanta/ix8-56x/utils/quanta_ix8_util.py @@ -21,19 +21,17 @@ options: -h | --help : this help message -d | --debug : run with debug mode - -f | --force : ignore error during installation or clean + -f | --force : ignore error during installation or clean command: install : install drivers and generate related sysfs nodes - clean : uninstall drivers and remove related sysfs nodes + clean : uninstall drivers and remove related sysfs nodes """ import os import commands import sys, getopt import logging -import re import time -from collections import namedtuple DEBUG = False args = [] @@ -43,72 +41,68 @@ if DEBUG == True: print sys.argv[0] - print 'ARGV :', sys.argv[1:] + print 'ARGV :', sys.argv[1:] def main(): global DEBUG global args global FORCE - + if len(sys.argv)<2: show_help() - + options, args = getopt.getopt(sys.argv[1:], 'hdf', ['help', 'debug', 'force', ]) - if DEBUG == True: + if DEBUG == True: print options print args print len(sys.argv) - + for opt, arg in options: if opt in ('-h', '--help'): show_help() - elif opt in ('-d', '--debug'): + elif opt in ('-d', '--debug'): DEBUG = True logging.basicConfig(level=logging.INFO) - elif opt in ('-f', '--force'): + elif opt in ('-f', '--force'): FORCE = 1 else: - logging.info('no option') - for arg in args: + logging.info('no option') + for arg in args: if arg == 'install': install() elif arg == 'clean': uninstall() else: show_help() - - - return 0 - + + + return 0 + def show_help(): print __doc__ % {'scriptName' : sys.argv[0].split("/")[-1]} sys.exit(0) - + def show_log(txt): if DEBUG == True: print "[IX8-56X]"+txt return - + def exec_cmd(cmd, show): - logging.info('Run :'+cmd) - status, output = commands.getstatusoutput(cmd) + logging.info('Run :'+cmd) + status, output = commands.getstatusoutput(cmd) show_log (cmd +"with result:" + str(status)) - show_log (" output:"+output) + show_log (" output:"+output) if status: logging.info('Failed :'+cmd) if show: print('Failed :'+cmd) return status, output - + instantiate =[ -#turn on module power -'echo 21 > /sys/class/gpio/export', -'echo out > /sys/class/gpio/gpio21/direction', -'echo 1 >/sys/class/gpio/gpio21/value', #export pca9698 for qsfp present 'echo 34 > /sys/class/gpio/export', 'echo in > /sys/class/gpio/gpio34/direction', @@ -126,31 +120,6 @@ def exec_cmd(cmd, show): 'echo in > /sys/class/gpio/gpio58/direction', 'echo 62 > /sys/class/gpio/export', 'echo in > /sys/class/gpio/gpio62/direction', -#export pca9698 for qsfp reset -'echo 32 > /sys/class/gpio/export', -'echo out > /sys/class/gpio/gpio32/direction', -'echo 1 >/sys/class/gpio/gpio32/value', -'echo 36 > /sys/class/gpio/export', -'echo out > /sys/class/gpio/gpio36/direction', -'echo 1 >/sys/class/gpio/gpio36/value', -'echo 40 > /sys/class/gpio/export', -'echo out > /sys/class/gpio/gpio40/direction', -'echo 1 >/sys/class/gpio/gpio40/value', -'echo 44 > /sys/class/gpio/export', -'echo out > /sys/class/gpio/gpio44/direction', -'echo 1 >/sys/class/gpio/gpio44/value', -'echo 48 > /sys/class/gpio/export', -'echo out > /sys/class/gpio/gpio48/direction', -'echo 1 >/sys/class/gpio/gpio48/value', -'echo 52 > /sys/class/gpio/export', -'echo out > /sys/class/gpio/gpio52/direction', -'echo 1 >/sys/class/gpio/gpio52/value', -'echo 56 > /sys/class/gpio/export', -'echo out > /sys/class/gpio/gpio56/direction', -'echo 1 >/sys/class/gpio/gpio56/value', -'echo 60 > /sys/class/gpio/export', -'echo out > /sys/class/gpio/gpio60/direction', -'echo 1 >/sys/class/gpio/gpio60/value', #export pca9698 for qsfp lpmode 'echo 35 > /sys/class/gpio/export', 'echo out > /sys/class/gpio/gpio35/direction', @@ -176,14 +145,6 @@ def exec_cmd(cmd, show): 'echo 63 > /sys/class/gpio/export', 'echo out > /sys/class/gpio/gpio63/direction', 'echo 0 >/sys/class/gpio/gpio63/value', -#Reset fron-ports LED CPLD -'echo 73 > /sys/class/gpio/export', -'echo out > /sys/class/gpio/gpio73/direction', -'echo 0 >/sys/class/gpio/gpio73/value', -'echo 1 >/sys/class/gpio/gpio73/value', -#Enable front-ports LED decoding -'echo 1 > /sys/class/cpld-led/CPLDLED-1/led_decode', -'echo 1 > /sys/class/cpld-led/CPLDLED-2/led_decode', #SFP28 Module TxEnable 'echo 0 > /sys/class/cpld-sfp28/port-1/tx_dis', 'echo 0 > /sys/class/cpld-sfp28/port-2/tx_dis', @@ -246,27 +207,40 @@ def exec_cmd(cmd, show): 'lpc_ich', 'i2c-i801', 'i2c-dev', +'i2c-mux-pca954x force_deselect_on_exit=1', +'gpio-pca953x', +'optoe', +'qci_cpld_sfp28', +'qci_cpld_led', +'qci_platform_ix8', +'ipmi_devintf', +'quanta_hwmon_ipmi' +] + +un_drivers =[ +'lpc_ich', +'i2c-i801', +'i2c-dev', 'i2c-mux-pca954x', 'gpio-pca953x', 'optoe', 'qci_cpld_sfp28', 'qci_cpld_led', 'qci_platform_ix8', -'ipmi_devintf' +'ipmi_devintf', +'quanta_hwmon_ipmi' ] - - def system_install(): global FORCE - + #remove default drivers to avoid modprobe order conflicts - status, output = exec_cmd("echo 'blacklist i2c-ismt' > /etc/modprobe.d/blacklist.conf", 1) + exec_cmd("echo 'blacklist i2c-ismt' > /etc/modprobe.d/blacklist.conf", 1) time.sleep(1) - status, output = exec_cmd("modprobe -r i2c-ismt ", 1) - status, output = exec_cmd("modprobe -r i2c-i801 ", 1) + exec_cmd("modprobe -r i2c-ismt ", 1) + exec_cmd("modprobe -r i2c-i801 ", 1) #setup driver dependency - status, output = exec_cmd("depmod -a ", 1) + exec_cmd("depmod -a ", 1) #install drivers for i in range(0,len(drivers)): status, output = exec_cmd("modprobe "+drivers[i], 1) @@ -274,35 +248,62 @@ def system_install(): print output if FORCE == 0: return status - + + #turn on module power + exec_cmd("echo 21 > /sys/class/gpio/export ", 1) + exec_cmd("echo high > /sys/class/gpio/gpio21/direction ", 1) + + # qsfp reset gpio + time.sleep(1) + for qsfp_reset in [32, 36, 40, 44, 48, 52, 56, 60]: + exec_cmd("echo "+str(qsfp_reset)+" > /sys/class/gpio/export", 1) + exec_cmd("echo high > /sys/class/gpio/gpio"+str(qsfp_reset)+"/direction", 1) + + # Reset fron-ports LED CPLD + exec_cmd("echo 73 > /sys/class/gpio/export ", 1) + status, output = exec_cmd("cat /sys/class/gpio/gpio73/value", 1) + if output != '1': + exec_cmd("echo out > /sys/class/gpio/gpio73/direction ", 1) + exec_cmd("echo 0 >/sys/class/gpio/gpio73/value", 1) + exec_cmd("echo 1 >/sys/class/gpio/gpio73/value", 1) + #instantiate devices for i in range(0,len(instantiate)): - status, output = exec_cmd(instantiate[i], 1) + status, output = exec_cmd(instantiate[i], 1) if status: print output if FORCE == 0: return status - + #QSFP for 1~56 port for port_number in range(1,57): - bus_number = port_number + 31 + bus_number = port_number + 16 os.system("echo %d >/sys/bus/i2c/devices/%d-0050/port_name" % (port_number, bus_number)) - - return - - + + status, output = exec_cmd("pip3 install /usr/share/sonic/device/x86_64-quanta_ix8_rglbmc-r0/sonic_platform-1.0-py3-none-any.whl",1) + if status: + print output + if FORCE == 0: + return status + + #Enable front-ports LED decoding + exec_cmd('echo 1 > /sys/class/cpld-led/CPLDLED-1/led_decode', 1) + exec_cmd('echo 1 > /sys/class/cpld-led/CPLDLED-2/led_decode', 1) + + return + def system_ready(): - if not device_found(): + if not device_found(): return False return True - -def install(): + +def install(): if not device_found(): - print "No device, installing...." - status = system_install() + print "No device, installing...." + status = system_install() if status: - if FORCE == 0: - return status + if FORCE == 0: + return status else: print " ix8 driver already installed...." return @@ -310,17 +311,27 @@ def install(): def uninstall(): global FORCE #uninstall drivers - for i in range(len(drivers)-1,-1,-1): - status, output = exec_cmd("rmmod "+drivers[i], 1) + for i in range(len(un_drivers)-1,-1,-1): + status, output = exec_cmd("rmmod "+un_drivers[i], 1) + if status: + print output + if FORCE == 0: + return status + status, output = exec_cmd("pip3 uninstall sonic-platform -y ",1) if status: print output - if FORCE == 0: + if FORCE == 0: return status return def device_found(): - ret1, log = exec_cmd("ls "+i2c_prefix+"i2c-0", 0) - return ret1 + ret1, log1 = exec_cmd("cat /proc/modules | grep ix8 > /tmp/chkdriver.log", 0) + ret2, log2 = exec_cmd("cat /tmp/chkdriver.log | grep ix8", 0) + + if ret1 == 0 and len(log2) > 0: + return True + else: + return False if __name__ == "__main__": main() diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix8a-bwde-56x/classes/__init__.py b/platform/broadcom/sonic-platform-modules-quanta/ix8a-bwde-56x/classes/__init__.py new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix8a-bwde-56x/modules/Makefile b/platform/broadcom/sonic-platform-modules-quanta/ix8a-bwde-56x/modules/Makefile new file mode 100644 index 000000000000..209ad8eaaf3d --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix8a-bwde-56x/modules/Makefile @@ -0,0 +1 @@ +obj-m:=qci_cpld_sfp28.o qci_cpld_led.o qci_platform_ix8a_bwde.o quanta_hwmon_ipmi.o diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix8a-bwde-56x/modules/qci_cpld_led.c b/platform/broadcom/sonic-platform-modules-quanta/ix8a-bwde-56x/modules/qci_cpld_led.c new file mode 100644 index 000000000000..9be8920f51e9 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix8a-bwde-56x/modules/qci_cpld_led.c @@ -0,0 +1,279 @@ +/* + * A LED CPLD driver for Quanta Switch Platform + * + * The CPLD is customize by Quanta for decode led bit stream, + * This driver modify from Quanta CPLD I/O driver. + * + * Copyright (C) 2015 Quanta Inc. + * + * Author: Luffy Cheng + * Author: Roger Chang + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static DEFINE_IDA(cpld_led_ida); + +enum platform_type { + IX7 = 0, + IX8A_BWDE, + NONE +}; + +static struct class *cpld_class = NULL; + +struct cpld_data { + struct i2c_client *cpld_client; + char name[8]; + u8 cpld_id; +}; + +struct cpld_led_data { + struct mutex lock; + struct device *port_dev; + struct cpld_data *cpld_data; +}; + +static int cpld_led_probe(struct i2c_client *client, + const struct i2c_device_id *id); +static int cpld_led_remove(struct i2c_client *client); + +static const struct i2c_device_id cpld_led_id[] = { + { "CPLDLED_IX7", IX7 }, + { "CPLDLED_IX8A_BWDE", IX8A_BWDE }, + { } +}; +MODULE_DEVICE_TABLE(i2c, cpld_led_id); + +static struct i2c_driver cpld_led_driver = { + .class = I2C_CLASS_HWMON, + .driver = { + .name = "qci_cpld_led", + }, + .probe = cpld_led_probe, + .remove = cpld_led_remove, + .id_table = cpld_led_id, +// .address_list = normal_i2c, +}; + +#define CPLD_LED_ID_PREFIX "CPLDLED-" +#define CPLD_LED_ID_FORMAT CPLD_LED_ID_PREFIX "%d" + +#define CPLD_DECODER_OFFSET 0x4 +#define CPLD_DECODER_MASK 0x1 +#define CPLD_USERCODE_START_OFFSET 0x0 + +static ssize_t get_led_decode(struct device *dev, + struct device_attribute *devattr, + char *buf) +{ + struct cpld_data *data = dev_get_drvdata(dev); + struct i2c_client *client = data->cpld_client; + u8 offset = (u8)(CPLD_DECODER_OFFSET); + s32 value; + + value = i2c_smbus_read_byte_data(client, offset); + if (value < 0) + return -ENODEV; + + dev_dbg(&client->dev, "read led decode value= %x\n", value); + + value &= CPLD_DECODER_MASK; + + return sprintf(buf, "%d\n", (value == 0) ? 1 : 0); +} + +static ssize_t get_usercode(struct device *dev, + struct device_attribute *devattr, + char *buf) +{ + struct cpld_data *data = dev_get_drvdata(dev); + struct i2c_client *client = data->cpld_client; + u8 i = 0; + s32 value = 0, reading = 0; + + for (i = 0; i < 4; i++) + { + reading = i2c_smbus_read_byte_data(client, CPLD_USERCODE_START_OFFSET + i); + if (reading < 0) + return -ENODEV; + + dev_dbg(&client->dev, "read led usercode reg %d value= %x\n", i, reading); + + value |= reading << (24 - 8 * i); + } + + return sprintf(buf, "%X\n", value); +} + +static ssize_t set_led_decode(struct device *dev, + struct device_attribute *devattr, + const char *buf, + size_t count) +{ + struct cpld_data *data = dev_get_drvdata(dev); + struct i2c_client *client = data->cpld_client; + s32 value; + long enable; + + if (kstrtol(buf, 0, &enable)) + return -EINVAL; + + if ((enable != 1) && (enable != 0)) + return -EINVAL; + +// mutex_lock(&data->lock); + value = i2c_smbus_read_byte_data(client, CPLD_DECODER_OFFSET); + if (value < 0) + return -ENODEV; + + dev_dbg(&client->dev, "read led decode value= %x\n", value); + + value |= CPLD_DECODER_MASK; + if (enable) + value &= ~CPLD_DECODER_MASK; + + dev_dbg(&client->dev, "write led decode value= %x\n", value); + + i2c_smbus_write_byte_data(client, CPLD_DECODER_OFFSET, (u8)value); +// mutex_unlock(&data->lock); + + return count; +} + +static DEVICE_ATTR(led_decode, S_IWUSR | S_IRUGO, get_led_decode, set_led_decode); +static DEVICE_ATTR(usercode, S_IRUGO, get_usercode, NULL); + +static const struct attribute *led_attrs[] = { + &dev_attr_usercode.attr, + &dev_attr_led_decode.attr, + NULL, +}; + +static const struct attribute_group led_attr_group = { + .attrs = (struct attribute **) led_attrs, +}; + +static int cpld_led_probe(struct i2c_client *client, + const struct i2c_device_id *id) +{ + struct cpld_led_data *data; + struct cpld_data *led_data; + struct device *port_dev; + int nr, err; + + if (!cpld_class) + { + cpld_class = class_create(THIS_MODULE, "cpld-led"); + if (IS_ERR(cpld_class)) { + pr_err("couldn't create sysfs class\n"); + return PTR_ERR(cpld_class); + } + } + + data = devm_kzalloc(&client->dev, sizeof(struct cpld_led_data), + GFP_KERNEL); + if (!data) + return -ENOMEM; + + /* Test */ + nr = ida_simple_get(&cpld_led_ida, 1, 99, GFP_KERNEL); + if (nr < 0) + goto err_out; + + led_data = kzalloc(sizeof(struct cpld_led_data), GFP_KERNEL); + + port_dev = device_create(cpld_class, &client->dev, MKDEV(0,0), led_data, CPLD_LED_ID_FORMAT, nr); + if (IS_ERR(port_dev)) { + err = PTR_ERR(port_dev); + // printk("err_status\n"); + } + + data->port_dev = port_dev; + data->cpld_data = led_data; + + dev_info(&client->dev, "Register CPLDLED %d\n", nr); + + sprintf(led_data->name, "LED%d-data", nr); + led_data->cpld_id = nr; + dev_set_drvdata(port_dev, led_data); + port_dev->init_name = led_data->name; + led_data->cpld_client = client; + + err = sysfs_create_group(&port_dev->kobj, &led_attr_group); + // if (status) printk("err status\n"); + /* end */ + + i2c_set_clientdata(client, data); + mutex_init(&data->lock); + + dev_info(&client->dev, "%s device found\n", client->name); + + + return 0; + +err_out: + return nr; +} + +/* FIXME: for older kernel doesn't with idr_is_empty function, implement here */ +#if 0 +static int idr_has_entry(int id, void *p, void *data) +{ + return 1; +} + +static bool cpld_idr_is_empty(struct idr *idp) +{ + return !idr_for_each(idp, idr_has_entry, NULL); +} +#endif + +static int cpld_led_remove(struct i2c_client *client) +{ + struct cpld_led_data *data = i2c_get_clientdata(client); + + dev_info(data->port_dev, "Remove CPLDLED-%d\n", data->cpld_data->cpld_id); + device_unregister(data->port_dev); + ida_simple_remove(&cpld_led_ida, data->cpld_data->cpld_id); + kfree(data->cpld_data); + + if (ida_is_empty(&cpld_led_ida)) { + class_destroy(cpld_class); + cpld_class = NULL; + } + + return 0; +} + +module_i2c_driver(cpld_led_driver); + +MODULE_AUTHOR("Luffy Cheng "); +MODULE_AUTHOR("Roger Chang "); +MODULE_DESCRIPTION("Quanta Switch LED CPLD driver"); +MODULE_LICENSE("GPL"); diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix8a-bwde-56x/modules/qci_cpld_sfp28.c b/platform/broadcom/sonic-platform-modules-quanta/ix8a-bwde-56x/modules/qci_cpld_sfp28.c new file mode 100644 index 000000000000..a36bdf94bcae --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix8a-bwde-56x/modules/qci_cpld_sfp28.c @@ -0,0 +1,381 @@ +/* + * A CPLD driver for monitor SFP28 module I/O + * + * The CPLD is customize by Quanta for controlling SFP28 module signals, + * they are TX_FAULT , TX_DIS , PRE_N , RX_LOS + * Each CPLD control 16 modules, each module use 4 bits in register. + * + * Copyright (C) 2015 Quanta Inc. + * + * Author: Luffy Cheng + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static DEFINE_IDA(cpld_ida); + +enum platform_type { + SFP = 0, + SFP28, + NONE +}; + +static struct class *cpld_class = NULL; + +struct sfp_data { + struct i2c_client *cpld_client; + char name[8]; + u8 port_id; + u8 cpld_port; +}; + +struct cpld_data { + struct mutex lock; + struct device *port_dev[16]; + struct sfp_data *port_data[16]; +}; + +static int cpld_probe(struct i2c_client *client, + const struct i2c_device_id *id); +static int cpld_remove(struct i2c_client *client); + +static const struct i2c_device_id cpld_id[] = { + { "CPLD-SFP", SFP }, + { "CPLD-SFP28", SFP28 }, + { } +}; +MODULE_DEVICE_TABLE(i2c, cpld_id); + +static struct i2c_driver cpld_driver = { + .class = I2C_CLASS_HWMON, + .driver = { + .name = "qci_cpld_sfp28", + }, + .probe = cpld_probe, + .remove = cpld_remove, + .id_table = cpld_id, +// .address_list = normal_i2c, +}; + +#define CPLD_ID_PREFIX "port-" +#define CPLD_ID_FORMAT CPLD_ID_PREFIX "%d" + +//SFP28 +#define TX_FAULT_MASK 0x08 +#define TX_DIS_MASK 0x04 +#define PRE_N_MASK 0x02 +#define RX_LOS_MASK 0x01 + +static inline u8 get_group_cmd(u8 group) +{ + //FIXME: if group cmd change + return (group + 1); +} + +static inline u8 port_remapping(u8 phy_port) +{ + /* FIXME: implement by hardware design */ + /* The CPLD register port mapping is weird : + * MSB -------- LSB (word data) + * P3 P4 P1 P2 (per port 4 bits) + * For easy coding bit shift, we treat it as hw port swap + */ + return (phy_port % 2) ? (phy_port - 1) : (phy_port + 1); +} + +//SFP +static ssize_t get_tx_fault(struct device *dev, + struct device_attribute *devattr, + char *buf) +{ + struct sfp_data *data = dev_get_drvdata(dev); + struct i2c_client *client = data->cpld_client; + u8 group = (u8)(data->cpld_port / 4); + u8 group_port = data->cpld_port % 4; + s32 value; + + dev_dbg(&client->dev, "port_id %d => cpld_port %d, group %d(%d)\n", data->port_id, + data->cpld_port + 1, group + 1, group_port + 1); + + value = i2c_smbus_read_word_data(client, get_group_cmd(group)); + if (value < 0) + return -ENODEV; + + dev_dbg(&client->dev, "read group%d value= %x\n", group + 1, value); + + value >>= (group_port * 4); + value &= TX_FAULT_MASK; + + return sprintf(buf, "%d\n", value ? 1 : 0); +} + +static ssize_t get_tx_dis(struct device *dev, + struct device_attribute *devattr, + char *buf) +{ + struct sfp_data *data = dev_get_drvdata(dev); + struct i2c_client *client = data->cpld_client; + u8 group = (u8)(data->cpld_port / 4); + u8 group_port = data->cpld_port % 4; + s32 value; + + dev_dbg(&client->dev, "port_id %d => cpld_port %d, group %d(%d)\n", data->port_id, + data->cpld_port + 1, group + 1, group_port + 1); + + value = i2c_smbus_read_word_data(client, get_group_cmd(group)); + if (value < 0) + return -ENODEV; + + dev_dbg(&client->dev, "read group%d value= %x\n", group + 1, value); + + value >>= (group_port * 4); + value &= TX_DIS_MASK; + + return sprintf(buf, "%d\n", value ? 1 : 0); +} + +static ssize_t get_pre_n(struct device *dev, + struct device_attribute *devattr, + char *buf) +{ + struct sfp_data *data = dev_get_drvdata(dev); + struct i2c_client *client = data->cpld_client; + u8 group = (u8)(data->cpld_port / 4); + u8 group_port = data->cpld_port % 4; + s32 value; + + dev_dbg(&client->dev, "port_id %d => cpld_port %d, group %d(%d)\n", data->port_id, + data->cpld_port + 1, group + 1, group_port + 1); + + value = i2c_smbus_read_word_data(client, get_group_cmd(group)); + if (value < 0) + return -ENODEV; + + dev_dbg(&client->dev, "read group%d value= %x\n", group + 1, value); + + value >>= (group_port * 4); + value &= PRE_N_MASK; + + //FIXME: if present is not low active + return sprintf(buf, "%d\n", value ? 0 : 1); +} + +static ssize_t get_rx_los(struct device *dev, + struct device_attribute *devattr, + char *buf) +{ + struct sfp_data *data = dev_get_drvdata(dev); + struct i2c_client *client = data->cpld_client; + u8 group = (u8)(data->cpld_port / 4); + u8 group_port = data->cpld_port % 4; + s32 value; + + dev_dbg(&client->dev, "port_id %d => cpld_port %d, group %d(%d)\n", data->port_id, + data->cpld_port + 1, group + 1, group_port + 1); + + value = i2c_smbus_read_word_data(client, get_group_cmd(group)); + if (value < 0) + return -ENODEV; + + dev_dbg(&client->dev, "read group%d value= %x\n", group + 1, value); + + value >>= (group_port * 4); + value &= RX_LOS_MASK; + + return sprintf(buf, "%d\n", value ? 1 : 0); +} +static ssize_t set_tx_dis(struct device *dev, + struct device_attribute *devattr, + const char *buf, + size_t count) +{ + struct sfp_data *data = dev_get_drvdata(dev); + struct i2c_client *client = data->cpld_client; + u8 group = (u8)(data->cpld_port / 4); + u8 group_port = data->cpld_port % 4; + s32 value; + long disable; + + dev_dbg(&client->dev, "port_id %d => cpld_port %d, group %d(%d)\n", data->port_id, + data->cpld_port + 1, group + 1, group_port + 1); + + if (kstrtol(buf, 0, &disable)) + return -EINVAL; + + if ((disable != 1) && (disable != 0)) + return -EINVAL; + +// mutex_lock(&data->lock); + value = i2c_smbus_read_word_data(client, get_group_cmd(group)); + if (value < 0) + return -ENODEV; + + dev_dbg(&client->dev, "read group%d value= %x\n", group + 1, value); + + value &= ~(TX_DIS_MASK << (group_port * 4)); + if (disable) + value |= (TX_DIS_MASK << (group_port * 4)); + + dev_dbg(&client->dev, "write group%d value= %x\n", group + 1, value); + + i2c_smbus_write_word_data(client, get_group_cmd(group), (u16)value); +// mutex_unlock(&data->lock); + + return count; +} +//SFP + +//SFP +static DEVICE_ATTR(tx_fault, S_IRUGO, get_tx_fault, NULL); +static DEVICE_ATTR(tx_dis, S_IWUSR | S_IRUGO, get_tx_dis, set_tx_dis); +static DEVICE_ATTR(pre_n, S_IRUGO, get_pre_n, NULL); +static DEVICE_ATTR(rx_los, S_IRUGO, get_rx_los, NULL); + +static const struct attribute *sfp_attrs[] = { + &dev_attr_tx_fault.attr, + &dev_attr_tx_dis.attr, + &dev_attr_pre_n.attr, + &dev_attr_rx_los.attr, + NULL, +}; + +static const struct attribute_group sfp_attr_group = { + .attrs = (struct attribute **) sfp_attrs, +}; + +static int cpld_probe(struct i2c_client *client, + const struct i2c_device_id *id) +{ + struct cpld_data *data; + struct sfp_data *port_data; + struct device *port_dev; + int port_nr, i=0, err; + + printk("cpld cpld_probe\n"); + + if (!cpld_class) + { + cpld_class = class_create(THIS_MODULE, "cpld-sfp28"); + if (IS_ERR(cpld_class)) { + pr_err("couldn't create sysfs class\n"); + return PTR_ERR(cpld_class); + } + } + + data = devm_kzalloc(&client->dev, sizeof(struct cpld_data), + GFP_KERNEL); + if (!data) + return -ENOMEM; + + /* register sfp port data to sysfs */ + for (i = 0; i < 16; i++) + { + port_nr = ida_simple_get(&cpld_ida, 1, 99, GFP_KERNEL); + if (port_nr < 0) + goto err_out; + + port_data = kzalloc(sizeof(struct sfp_data), GFP_KERNEL); + + port_dev = device_create(cpld_class, &client->dev, MKDEV(0,0), port_data, CPLD_ID_FORMAT, port_nr); + if (IS_ERR(port_dev)) { + err = PTR_ERR(port_dev); + printk("err_status\n"); + } + + data->port_dev[i] = port_dev; + data->port_data[i] = port_data; + + dev_info(&client->dev, "Register port-%d\n", port_nr); + + /* FIXME: implement Logical/Physical port remapping */ + //port_data->cpld_port = i; + port_data->cpld_port = port_remapping(i); + sprintf(port_data->name, "port-%d", port_nr); + port_data->port_id = port_nr; + dev_set_drvdata(port_dev, port_data); + port_dev->init_name = port_data->name; + port_data->cpld_client = client; + + err = sysfs_create_group(&port_dev->kobj, &sfp_attr_group); + // if (status) printk("err status\n"); + } + + i2c_set_clientdata(client, data); + mutex_init(&data->lock); + + dev_info(&client->dev, "%s device found\n", client->name); + + + return 0; + +err_out: + return port_nr; +} + +/* FIXME: for older kernel doesn't with idr_is_empty function, implement here */ +#if 0 +static int idr_has_entry(int id, void *p, void *data) +{ + return 1; +} + +static bool cpld_idr_is_empty(struct idr *idp) +{ + return !idr_for_each(idp, idr_has_entry, NULL); +} +#endif + +static int cpld_remove(struct i2c_client *client) +{ + struct cpld_data *data = i2c_get_clientdata(client); + int i; + + for (i = 15; i >= 0; i--) + { + dev_info(data->port_dev[i], "Remove port-%d\n", data->port_data[i]->port_id); + device_unregister(data->port_dev[i]); + ida_simple_remove(&cpld_ida, data->port_data[i]->port_id); + kfree(data->port_data[i]); + } + + if (ida_is_empty(&cpld_ida)) + { + class_destroy(cpld_class); + cpld_class = NULL; + } + + return 0; +} + +module_i2c_driver(cpld_driver); + +MODULE_AUTHOR("Luffy Cheng "); +MODULE_DESCRIPTION("Quanta Switch SFP28 CPLD driver"); +MODULE_LICENSE("GPL"); diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix8a-bwde-56x/modules/qci_platform_ix8a_bwde.c b/platform/broadcom/sonic-platform-modules-quanta/ix8a-bwde-56x/modules/qci_platform_ix8a_bwde.c new file mode 100644 index 000000000000..e5f6a6529d40 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix8a-bwde-56x/modules/qci_platform_ix8a_bwde.c @@ -0,0 +1,372 @@ +/* + * Quanta ix8a_bwde platform driver + * + * + * Copyright (C) 2014 Quanta Computer inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#if LINUX_VERSION_CODE > KERNEL_VERSION(3,12,0) +#include +#else +#include +#endif + +static struct pca953x_platform_data pca9539_1_data = { + .gpio_base = 0x10, +}; + +static struct pca953x_platform_data pca9698_data = { + .gpio_base = 0x20, +}; +//CPU Linking Board at CPU's I2C Bus +static struct pca953x_platform_data pca9555_CPU_data = { + .gpio_base = 0x48, +}; + +static struct i2c_board_info ix8a_bwde_i2c_devices[] = { + { + I2C_BOARD_INFO("pca9546", 0x72), // 0 + }, + { + I2C_BOARD_INFO("pca9548", 0x77), // 1 + }, + { + I2C_BOARD_INFO("pca9539", 0x74), // 2 + .platform_data = &pca9539_1_data, + }, + { + I2C_BOARD_INFO("24c02", 0x54), // 3 + }, + { + I2C_BOARD_INFO("pca9548", 0x73), // 4 + }, + { + I2C_BOARD_INFO("pca9548", 0x73), // 5 + }, + { + I2C_BOARD_INFO("pca9548", 0x73), // 6 + }, + { + I2C_BOARD_INFO("pca9548", 0x73), // 7 + }, + { + I2C_BOARD_INFO("pca9548", 0x73), // 8 + }, + { + I2C_BOARD_INFO("pca9548", 0x73), // 9 + }, + { + I2C_BOARD_INFO("pca9548", 0x73), // 10 + }, + { + I2C_BOARD_INFO("CPLD-SFP28", 0x38), // 11 + }, + { + I2C_BOARD_INFO("CPLD-SFP28", 0x38), // 12 + }, + { + I2C_BOARD_INFO("CPLD-SFP28", 0x38), // 13 + }, + { + I2C_BOARD_INFO("pca9698", 0x21), + .platform_data = &pca9698_data, // 14 + }, + { + I2C_BOARD_INFO("optoe1", 0x50), // 15 0x50 QSFP EEPROM + }, + { + I2C_BOARD_INFO("pca9555", 0x22), // 16 CPU Linking Board at CPU's I2C Bus + .platform_data = &pca9555_CPU_data, + }, + { + I2C_BOARD_INFO("CPLDLED_IX8A_BWDE", 0x3a), // 17 0x72 ch0 CPLD4 LED function of SFP28 & QSFP28 (Port27~56) + }, + { + I2C_BOARD_INFO("CPLDLED_IX8A_BWDE", 0x39), // 18 0x72 ch0 CPLD6 LED function of SFP28 & QSFP28 (Port1~26) + }, + { + I2C_BOARD_INFO("optoe2", 0x50), // 19 0x50 SFP28 EEPROM + }, +}; + +static struct platform_driver ix8a_bwde_platform_driver = { + .driver = { + .name = "qci-ix8a-bwde", + .owner = THIS_MODULE, + }, +}; + +static struct platform_device *ix8a_bwde_device; + +static struct i2c_client **g_client; +static struct i2c_client **g_client_port; +int numof_i2c_devices = 18; // num of ix8a_bwde_i2c_devices - 2 (for optoe1, optoe2) +int numof_ports = 56; + +static int __init ix8a_bwde_platform_init(void) +{ + struct i2c_adapter *adapter; + int ret, i; + + ret = platform_driver_register(&ix8a_bwde_platform_driver); + if (ret < 0) + return ret; + + /* Register platform stuff */ + ix8a_bwde_device = platform_device_alloc("qci-ix8a_bwde", -1); + if (!ix8a_bwde_device) { + ret = -ENOMEM; + goto fail_platform_driver; + } + + ret = platform_device_add(ix8a_bwde_device); + if (ret) + goto fail_platform_device; + + g_client = kmalloc(sizeof(*g_client) * numof_i2c_devices, GFP_KERNEL); + for (i = 0; i < numof_i2c_devices; i++) g_client[i] = NULL; + + g_client_port = kmalloc(sizeof(*g_client_port) * numof_ports, GFP_KERNEL); + for (i = 0; i < numof_ports; i++) g_client_port[i] = NULL; + + adapter = i2c_get_adapter(0); + if (adapter == NULL) + { + printk("[%s] get i2c adapter fail at line %d", __FUNCTION__, __LINE__); + } + else + { + g_client[0] = i2c_new_device(adapter, &ix8a_bwde_i2c_devices[0]); // pca9546_1 + g_client[1] = i2c_new_device(adapter, &ix8a_bwde_i2c_devices[1]); // pca9548_1 + g_client[2] = i2c_new_device(adapter, &ix8a_bwde_i2c_devices[16]); // CPU Linking Board at CPU's I2C Bus // + i2c_put_adapter(adapter); + } + + adapter = i2c_get_adapter(0x01); + if (adapter == NULL) + { + printk("[%s] get i2c adapter fail at line %d", __FUNCTION__, __LINE__); + } + else + { + g_client[3] = i2c_new_device(adapter, &ix8a_bwde_i2c_devices[11]); // CPLD_1 + g_client[4] = i2c_new_device(adapter, &ix8a_bwde_i2c_devices[17]); // CPLD_4 // + g_client[5] = i2c_new_device(adapter, &ix8a_bwde_i2c_devices[18]); // CPLD_6 // + i2c_put_adapter(adapter); + } + + adapter = i2c_get_adapter(0x02); + if (adapter == NULL) + { + printk("[%s] get i2c adapter fail at line %d", __FUNCTION__, __LINE__); + } + else + { + g_client[6] = i2c_new_device(adapter, &ix8a_bwde_i2c_devices[12]); // CPLD_2 + i2c_put_adapter(adapter); + } + + adapter = i2c_get_adapter(0x03); + if (adapter == NULL) + { + printk("[%s] get i2c adapter fail at line %d", __FUNCTION__, __LINE__); + } + else + { + g_client[7] = i2c_new_device(adapter, &ix8a_bwde_i2c_devices[13]); // CPLD_3 + i2c_put_adapter(adapter); + } + + adapter = i2c_get_adapter(0x04); + if (adapter == NULL) + { + printk("[%s] get i2c adapter fail at line %d", __FUNCTION__, __LINE__); + } + else + { + g_client[8] = i2c_new_device(adapter, &ix8a_bwde_i2c_devices[2]); // pca9539_1 + g_client[9] = i2c_new_device(adapter, &ix8a_bwde_i2c_devices[14]); // pca9698_QSFP + i2c_put_adapter(adapter); + } + + adapter = i2c_get_adapter(0x05); + if (adapter == NULL) + { + printk("[%s] get i2c adapter fail at line %d", __FUNCTION__, __LINE__); + } + else + { + g_client[10] = i2c_new_device(adapter, &ix8a_bwde_i2c_devices[4]); // pca9548_1 SFP + i2c_put_adapter(adapter); + } + + adapter = i2c_get_adapter(0x06); + if (adapter == NULL) + { + printk("[%s] get i2c adapter fail at line %d", __FUNCTION__, __LINE__); + } + else + { + g_client[11] = i2c_new_device(adapter, &ix8a_bwde_i2c_devices[5]); // pca9548_2 SFP + i2c_put_adapter(adapter); + } + + adapter = i2c_get_adapter(0x07); + if (adapter == NULL) + { + printk("[%s] get i2c adapter fail at line %d", __FUNCTION__, __LINE__); + } + else + { + g_client[12] = i2c_new_device(adapter, &ix8a_bwde_i2c_devices[6]); // pca9548_3 SFP + i2c_put_adapter(adapter); + } + + adapter = i2c_get_adapter(0x08); + if (adapter == NULL) + { + printk("[%s] get i2c adapter fail at line %d", __FUNCTION__, __LINE__); + } + else + { + g_client[13] = i2c_new_device(adapter, &ix8a_bwde_i2c_devices[7]); // pca9548_4 SFP + i2c_put_adapter(adapter); + } + + adapter = i2c_get_adapter(0x09); + if (adapter == NULL) + { + printk("[%s] get i2c adapter fail at line %d", __FUNCTION__, __LINE__); + } + else + { + g_client[14] = i2c_new_device(adapter, &ix8a_bwde_i2c_devices[8]); // pca9548_5 SFP + i2c_put_adapter(adapter); + } + + adapter = i2c_get_adapter(0x0a); + if (adapter == NULL) + { + printk("[%s] get i2c adapter fail at line %d", __FUNCTION__, __LINE__); + } + else + { + g_client[15] = i2c_new_device(adapter, &ix8a_bwde_i2c_devices[9]); // pca9548_6 SFP + i2c_put_adapter(adapter); + } + + adapter = i2c_get_adapter(0x0b); + if (adapter == NULL) + { + printk("[%s] get i2c adapter fail at line %d", __FUNCTION__, __LINE__); + } + else + { + g_client[16] = i2c_new_device(adapter, &ix8a_bwde_i2c_devices[10]); // pca9548_7 SFP + i2c_put_adapter(adapter); + } + + adapter = i2c_get_adapter(0x03); + if (adapter == NULL) + { + printk("[%s] get i2c adapter fail at line %d", __FUNCTION__, __LINE__); + } + else + { + g_client[17] = i2c_new_device(adapter, &ix8a_bwde_i2c_devices[3]); // eeprom + i2c_put_adapter(adapter); + } + + for(i = 13; i < 69; i ++){ + adapter = i2c_get_adapter(i); + if (adapter == NULL) + { + printk("[%s] get i2c adapter fail at line %d", __FUNCTION__, __LINE__); + } + else + { + if (i < 61) // SFP28 1~48 EEPROM + g_client_port[i - 13] = i2c_new_device(adapter, &ix8a_bwde_i2c_devices[19]); + else // QSFP 49~56 EEPROM + g_client_port[i - 13] = i2c_new_device(adapter, &ix8a_bwde_i2c_devices[15]); + i2c_put_adapter(adapter); + } + } + + return 0; + +fail_platform_device: + platform_device_put(ix8a_bwde_device); + +fail_platform_driver: + platform_driver_unregister(&ix8a_bwde_platform_driver); + return ret; +} + +static void __exit ix8a_bwde_platform_exit(void) +{ + int i = 0; + + for (i = numof_ports - 1; i >= 0; i--) + { + if (g_client_port[i]) + { + i2c_unregister_device(g_client_port[i]); + g_client_port[i] = NULL; + } + } + + for (i = numof_i2c_devices - 1; i >= 0; i--) + { + if (g_client[i]) + { + i2c_unregister_device(g_client[i]); + g_client[i] = NULL; + } + } + + platform_device_unregister(ix8a_bwde_device); + platform_driver_unregister(&ix8a_bwde_platform_driver); +} + +module_init(ix8a_bwde_platform_init); +module_exit(ix8a_bwde_platform_exit); + + +MODULE_AUTHOR("Robert Hong (robert.hong@qct.io)"); +MODULE_DESCRIPTION("Quanta ix8a-bwde Platform Driver"); +MODULE_LICENSE("GPL"); diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix8a-bwde-56x/modules/quanta_hwmon_ipmi.c b/platform/broadcom/sonic-platform-modules-quanta/ix8a-bwde-56x/modules/quanta_hwmon_ipmi.c new file mode 100644 index 000000000000..65517e5d915a --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix8a-bwde-56x/modules/quanta_hwmon_ipmi.c @@ -0,0 +1,1814 @@ +/* +* +* A hwmon driver for the Quanta switch BMC hwmon +* +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define enable_debug_msg 0 +#define DEBUGUSE_SHIFT 0 + +#define DRVNAME "quanta_hwmon_ipmi" + +#define tos32(val, bits) ((val & ((1<<((bits)-1)))) ? (-((val) & (1<<((bits)-1))) | (val)) : (val)) +#define BSWAP_16(x) ((((x) & 0xff00) >> 8) | (((x) & 0x00ff) << 8)) +#define BSWAP_32(x) ((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >> 8) | (((x) & 0x0000ff00) << 8) | (((x) & 0x000000ff) << 24)) +#define __TO_M(mtol) (int16_t)(tos32((((BSWAP_16(mtol) & 0xff00) >> 8) | ((BSWAP_16(mtol) & 0xc0) << 2)), 10)) +#define __TO_B(bacc) (int32_t)(tos32((((BSWAP_32(bacc) & 0xff000000) >> 24) | ((BSWAP_32(bacc) & 0xc00000) >> 14)), 10)) +#define __TO_R_EXP(bacc) (int32_t)(tos32(((BSWAP_32(bacc) & 0xf0) >> 4), 4)) +#define __TO_B_EXP(bacc) (int32_t)(tos32((BSWAP_32(bacc) & 0xf), 4)) + +#define SENSOR_ATTR_MAX 17 +#define SENSOR_ATTR_NAME_LENGTH 20 + +#define SENSOR_GET_CAP_LABEL 0x001 +#define SENSOR_GET_CAP_ALARM 0x002 +#define SENSOR_GET_CAP_INPUT 0x004 + +#define SENSOR_GET_CAP_LNC 0x008 +#define SENSOR_GET_CAP_LCR 0x010 +#define SENSOR_GET_CAP_LNR 0x020 + +#define SENSOR_GET_CAP_UNC 0x040 +#define SENSOR_GET_CAP_UCR 0x080 +#define SENSOR_GET_CAP_UNR 0x100 + +#define SENSOR_GET_CAP_MODEL 0x200 +#define SENSOR_GET_CAP_SN 0x400 +#define SENSOR_GET_CAP_PWM 0x800 + +#define SENSOR_GET_CAP_CONMODE 0x1000 +#define SENSOR_GET_CAP_DIRECTION 0x2000 +#define SENSOR_GET_CAP_FAN_PRESENT 0x4000 +#define SENSOR_GET_CAP_PSU_PRESENT 0x8000 + +#define SENSOR_GET_CAP_MFRID 0x10000 + +#define SDR_SENSOR_TYPE_TEMP 0x01 +#define SDR_SENSOR_TYPE_VOLT 0x02 +#define SDR_SENSOR_TYPE_CURR 0x03 +#define SDR_SENSOR_TYPE_FAN 0x04 +#define SDR_SENSOR_TYPE_PS 0x08 +#define SDR_SENSOR_TYPE_OTHER 0x0b + +#define BMC_GET_DEVICE_ID 0x01 + +#define IPMI_NETFN_SE 0x04 +#define IPMI_NETFN_APP 0x06 +#define IPMI_NETFN_STORAGE 0x0a +#define IPMI_NETFN_TSOL 0x30 + +#define GET_SDR_REPO_INFO 0x20 +#define GET_DEVICE_SDR 0x21 +#define GET_SDR_RESERVE_REPO 0x22 +#define GET_SDR 0x23 +#define GET_SENSOR_THRESHOLDS 0x27 +#define GET_SENSOR_EVENT_ENABLE 0x29 +#define GET_SENSOR_EVENT_STATUS 0x2b +#define GET_SENSOR_READING 0x2d +#define GET_PSU_READING 0x52 +#define GET_FAN_INFO 0xd6 +#define GET_FRU_INFO 0x11 + +#define IPM_DEV_DEVICE_ID_SDR_MASK (0x80) /* 1 = provides SDRs */ +#define IPMI_TIMEOUT (4 * HZ) +#define IPMI_MAX_WAIT_QUEUE 1 + +struct quanta_hwmon_ipmi_data +{ + struct platform_device *ipmi_platform_dev; + struct device *ipmi_hwmon_dev; + /*struct mutex ipmi_lock; */ + + int32_t total_sensor_id; + int32_t total_suport_sensor; + int32_t total_create_sysfs; +} *data; + +static struct mutex ipmi_lock; +static struct completion g_read_complete; + +static ipmi_user_t ipmi_mh_user = NULL; + +static int8_t g_fan_control_mode = 3; +static int32_t g_use_built_in = 0; +static int32_t ipmi_wait_queue = 0; + +struct ipmi_sensor_data +{ + uint8_t addr; + uint8_t sensor_type; + uint8_t sensor_idstring[SENSOR_ATTR_NAME_LENGTH]; + + uint32_t capability; + + struct header_info + { + uint8_t header_type; + uint8_t header_byte; + } headerinfo; + + struct record_info + { + uint8_t record_analog; + uint8_t record_linearization; + + int32_t record_m; + int32_t record_b; + int32_t record_k1; + int32_t record_k2; + } recordinfo; + + struct threshold_upper_info + { + uint8_t unr; + uint8_t ucr; + uint8_t unc; + } upperinfo; + + struct threshold_lower_info + { + uint8_t lnr; + uint8_t lcr; + uint8_t lnc; + } lowerinfo; + + struct attr_info + { + bool attr_exist; + char attr_name[SENSOR_ATTR_MAX][SENSOR_ATTR_NAME_LENGTH]; + char attr_type_str[SENSOR_ATTR_NAME_LENGTH]; + + struct attribute *attrs[SENSOR_ATTR_MAX + 1]; + struct attribute_group attr_group; + struct sensor_device_attribute sd_attrs[SENSOR_ATTR_MAX + 1]; + } attrinfo; + +} *g_sensor_data; + +struct ipmi_comm_data +{ + int32_t tx_id; + + int32_t rx_result; + int64_t rx_len; + void *rx_data; + struct completion *rx_read_complete; +}; + +struct ipmi_sdr_iterator +{ + uint16_t reservation; + int32_t total; + int32_t next; +}; + +struct ipm_devid_rsp +{ + uint8_t device_id; + uint8_t device_revision; + uint8_t fw_rev1; + uint8_t fw_rev2; + uint8_t ipmi_version; + uint8_t adtl_device_support; + uint8_t manufacturer_id[3]; + uint8_t product_id[2]; + uint8_t aux_fw_rev[4]; +} __attribute__((packed)); + +struct sdr_repo_info_rs +{ + uint8_t version; /* SDR version (51h) */ + uint16_t count; /* number of records */ + uint16_t free; /* free space in SDR */ + uint32_t add_stamp; /* last add timestamp */ + uint32_t erase_stamp; /* last del timestamp */ + uint8_t op_support; /* supported operations */ +} __attribute__((packed)); + +struct sdr_device_info_rs +{ + uint8_t count; /* number of records */ + uint8_t flags; /* flags */ + uint8_t popChangeInd[3]; /* free space in SDR */ +} __attribute__((packed)); + +struct sdr_get_rs +{ + uint16_t next; /* next record id */ + uint16_t id; /* record ID */ + uint8_t version; /* SDR version (51h) */ +#define SDR_RECORD_TYPE_FULL_SENSOR 0x01 +#define SDR_RECORD_TYPE_COMPACT_SENSOR 0x02 +#define SDR_RECORD_TYPE_EVENTONLY_SENSOR 0x03 +#define SDR_RECORD_TYPE_ENTITY_ASSOC 0x08 +#define SDR_RECORD_TYPE_DEVICE_ENTITY_ASSOC 0x09 +#define SDR_RECORD_TYPE_GENERIC_DEVICE_LOCATOR 0x10 +#define SDR_RECORD_TYPE_FRU_DEVICE_LOCATOR 0x11 +#define SDR_RECORD_TYPE_MC_DEVICE_LOCATOR 0x12 +#define SDR_RECORD_TYPE_MC_CONFIRMATION 0x13 +#define SDR_RECORD_TYPE_BMC_MSG_CHANNEL_INFO 0x14 +#define SDR_RECORD_TYPE_OEM 0xc0 + uint8_t type; /* record type */ + uint8_t length; /* remaining record bytes */ +} __attribute__((packed)); + +struct sdr_get_rq +{ + uint16_t reserve_id; /* reservation ID */ + uint16_t id; /* record ID */ + uint8_t offset; /* offset into SDR */ +#define GET_SDR_ENTIRE_RECORD 0xff + uint8_t length; /* length to read */ +} __attribute__((packed)); + +struct entity_id +{ + uint8_t id; /* physical entity id */ +#ifdef WORDS_BIGENDIAN + uint8_t logical : 1; /* physical/logical */ + uint8_t instance : 7; /* instance number */ +#else + uint8_t instance : 7; /* instance number */ + uint8_t logical : 1; /* physical/logical */ +#endif +} __attribute__((packed)); + +struct sdr_record_mask +{ + union + { + struct + { + uint16_t assert_event; /* assertion event mask */ + uint16_t deassert_event; /* de-assertion event mask */ + uint16_t read; /* discrete reading mask */ + } discrete; + struct + { +#ifdef WORDS_BIGENDIAN + uint16_t reserved : 1; + uint16_t status_lnr : 1; + uint16_t status_lcr : 1; + uint16_t status_lnc : 1; + uint16_t assert_unr_high : 1; + uint16_t assert_unr_low : 1; + uint16_t assert_ucr_high : 1; + uint16_t assert_ucr_low : 1; + uint16_t assert_unc_high : 1; + uint16_t assert_unc_low : 1; + uint16_t assert_lnr_high : 1; + uint16_t assert_lnr_low : 1; + uint16_t assert_lcr_high : 1; + uint16_t assert_lcr_low : 1; + uint16_t assert_lnc_high : 1; + uint16_t assert_lnc_low : 1; +#else + uint16_t assert_lnc_low : 1; + uint16_t assert_lnc_high : 1; + uint16_t assert_lcr_low : 1; + uint16_t assert_lcr_high : 1; + uint16_t assert_lnr_low : 1; + uint16_t assert_lnr_high : 1; + uint16_t assert_unc_low : 1; + uint16_t assert_unc_high : 1; + uint16_t assert_ucr_low : 1; + uint16_t assert_ucr_high : 1; + uint16_t assert_unr_low : 1; + uint16_t assert_unr_high : 1; + uint16_t status_lnc : 1; + uint16_t status_lcr : 1; + uint16_t status_lnr : 1; + uint16_t reserved : 1; +#endif +#ifdef WORDS_BIGENDIAN + uint16_t reserved_2 : 1; + uint16_t status_unr : 1; + uint16_t status_ucr : 1; + uint16_t status_unc : 1; + uint16_t deassert_unr_high : 1; + uint16_t deassert_unr_low : 1; + uint16_t deassert_ucr_high : 1; + uint16_t deassert_ucr_low : 1; + uint16_t deassert_unc_high : 1; + uint16_t deassert_unc_low : 1; + uint16_t deassert_lnr_high : 1; + uint16_t deassert_lnr_low : 1; + uint16_t deassert_lcr_high : 1; + uint16_t deassert_lcr_low : 1; + uint16_t deassert_lnc_high : 1; + uint16_t deassert_lnc_low : 1; +#else + uint16_t deassert_lnc_low : 1; + uint16_t deassert_lnc_high : 1; + uint16_t deassert_lcr_low : 1; + uint16_t deassert_lcr_high : 1; + uint16_t deassert_lnr_low : 1; + uint16_t deassert_lnr_high : 1; + uint16_t deassert_unc_low : 1; + uint16_t deassert_unc_high : 1; + uint16_t deassert_ucr_low : 1; + uint16_t deassert_ucr_high : 1; + uint16_t deassert_unr_low : 1; + uint16_t deassert_unr_high : 1; + uint16_t status_unc : 1; + uint16_t status_ucr : 1; + uint16_t status_unr : 1; + uint16_t reserved_2 : 1; +#endif + union + { + struct + { +#ifdef WORDS_BIGENDIAN /* settable threshold mask */ + uint16_t reserved : 2; + uint16_t unr : 1; + uint16_t ucr : 1; + uint16_t unc : 1; + uint16_t lnr : 1; + uint16_t lcr : 1; + uint16_t lnc : 1; + /* padding lower 8 bits */ + uint16_t readable : 8; +#else + uint16_t readable : 8; + uint16_t lnc : 1; + uint16_t lcr : 1; + uint16_t lnr : 1; + uint16_t unc : 1; + uint16_t ucr : 1; + uint16_t unr : 1; + uint16_t reserved : 2; +#endif + } set; + struct + { +#ifdef WORDS_BIGENDIAN /* readable threshold mask */ + /* padding upper 8 bits */ + uint16_t settable : 8; + uint16_t reserved : 2; + uint16_t unr : 1; + uint16_t ucr : 1; + uint16_t unc : 1; + uint16_t lnr : 1; + uint16_t lcr : 1; + uint16_t lnc : 1; +#else + uint16_t lnc : 1; + uint16_t lcr : 1; + uint16_t lnr : 1; + uint16_t unc : 1; + uint16_t ucr : 1; + uint16_t unr : 1; + uint16_t reserved : 2; + uint16_t settable : 8; +#endif + } read; + }; + } threshold; + } type; +} __attribute__((packed)); + +struct sdr_record_full_sensor +{ + struct + { + uint8_t owner_id; +#ifdef WORDS_BIGENDIAN + uint8_t channel : 4; /* channel number */ + uint8_t __reserved : 2; + uint8_t lun : 2; /* sensor owner lun */ +#else + uint8_t lun : 2; /* sensor owner lun */ + uint8_t __reserved : 2; + uint8_t channel : 4; /* channel number */ +#endif + uint8_t sensor_num; /* unique sensor number */ + } keys; + + struct entity_id entity; + + struct + { + struct + { +#ifdef WORDS_BIGENDIAN + uint8_t __reserved : 1; + uint8_t scanning : 1; + uint8_t events : 1; + uint8_t thresholds : 1; + uint8_t hysteresis : 1; + uint8_t type : 1; + uint8_t event_gen : 1; + uint8_t sensor_scan : 1; +#else + uint8_t sensor_scan : 1; + uint8_t event_gen : 1; + uint8_t type : 1; + uint8_t hysteresis : 1; + uint8_t thresholds : 1; + uint8_t events : 1; + uint8_t scanning : 1; + uint8_t __reserved : 1; +#endif + } init; + struct + { +#ifdef WORDS_BIGENDIAN + uint8_t ignore : 1; + uint8_t rearm : 1; + uint8_t hysteresis : 2; + uint8_t threshold : 2; + uint8_t event_msg : 2; +#else + uint8_t event_msg : 2; + uint8_t threshold : 2; + uint8_t hysteresis : 2; + uint8_t rearm : 1; + uint8_t ignore : 1; +#endif + } capabilities; + uint8_t type; + } sensor; + + uint8_t event_type; /* event/reading type code */ + + struct sdr_record_mask mask; + + struct + { +#ifdef WORDS_BIGENDIAN + uint8_t analog : 2; + uint8_t rate : 3; + uint8_t modifier : 2; + uint8_t pct : 1; +#else + uint8_t pct : 1; + uint8_t modifier : 2; + uint8_t rate : 3; + uint8_t analog : 2; +#endif + struct + { + uint8_t base; + uint8_t modifier; + } type; + } unit; + +#define SDR_SENSOR_L_LINEAR 0x00 +#define SDR_SENSOR_L_LN 0x01 +#define SDR_SENSOR_L_LOG10 0x02 +#define SDR_SENSOR_L_LOG2 0x03 +#define SDR_SENSOR_L_E 0x04 +#define SDR_SENSOR_L_EXP10 0x05 +#define SDR_SENSOR_L_EXP2 0x06 +#define SDR_SENSOR_L_1_X 0x07 +#define SDR_SENSOR_L_SQR 0x08 +#define SDR_SENSOR_L_CUBE 0x09 +#define SDR_SENSOR_L_SQRT 0x0a +#define SDR_SENSOR_L_CUBERT 0x0b +#define SDR_SENSOR_L_NONLINEAR 0x70 + + uint8_t linearization; /* 70h=non linear, 71h-7Fh=non linear, OEM */ + uint16_t mtol; /* M, tolerance */ + uint32_t bacc; /* accuracy, B, Bexp, Rexp */ + + struct + { +#ifdef WORDS_BIGENDIAN + uint8_t __reserved : 5; + uint8_t normal_min : 1; /* normal min field specified */ + uint8_t normal_max : 1; /* normal max field specified */ + uint8_t nominal_read : 1; /* nominal reading field specified */ +#else + uint8_t nominal_read : 1; /* nominal reading field specified */ + uint8_t normal_max : 1; /* normal max field specified */ + uint8_t normal_min : 1; /* normal min field specified */ + uint8_t __reserved : 5; +#endif + } analog_flag; + + uint8_t nominal_read; /* nominal reading, raw value */ + uint8_t normal_max; /* normal maximum, raw value */ + uint8_t normal_min; /* normal minimum, raw value */ + uint8_t sensor_max; /* sensor maximum, raw value */ + uint8_t sensor_min; /* sensor minimum, raw value */ + + struct + { + struct + { + uint8_t non_recover; + uint8_t critical; + uint8_t non_critical; + } upper; + struct + { + uint8_t non_recover; + uint8_t critical; + uint8_t non_critical; + } lower; + struct + { + uint8_t positive; + uint8_t negative; + } hysteresis; + } threshold; + uint8_t __reserved[2]; + uint8_t oem; /* reserved for OEM use */ + uint8_t id_code; /* sensor ID string type/length code */ + uint8_t id_string[16]; /* sensor ID string bytes, only if id_code != 0 */ +} __attribute__((packed)); + +int32_t pow_convert(int32_t *a, int32_t b) +{ + /* function input parameter (a * 10 ^ b) */ + int32_t i = 0, r = 1, temp_b = 0; + + temp_b = (b > 0) ? b : -b; + + for (i = 0; i < temp_b; i++) + { + r = r * 10; + } + + if (b > 0) + { + *a = (*a) * r; + r = 1; + } + /* function return parameter calc_result = *a, decimal_point = r */ + return r; +} + +void simple_atoi(const char *buf, int8_t *output_val) +{ + while (*buf >= '0' && *buf <= '9') + { + *output_val = *output_val * 10 + *buf - '0'; + buf++; + } +} + +static void ipmi_msg_handler(struct ipmi_recv_msg *msg, void *handler_data) +{ + int32_t rv = -IPMI_UNKNOWN_ERR_COMPLETION_CODE; + + struct ipmi_comm_data *comm_data = msg->user_msg_data; + + ipmi_wait_queue--; + + if (msg->msg.data[0] != 0) + { + if ((msg->msg.data[0] != 0x83) && (msg->msg.netfn != 0x07) + && (msg->msg.cmd != 0x52)) + { + /*skip master r/w cmd return code */ + printk("ipmi: Error 0x%x on cmd 0x%x/0x%x\n", msg->msg.data[0], msg->msg.netfn, + msg->msg.cmd); + rv = msg->msg.data[0]; + goto get_BMC_response_fail; + } + } + + if (msg->msgid != comm_data->tx_id) + { + printk("ipmi: rx msgid %d mismatch tx msgid %d\n", (int32_t)msg->msgid, + comm_data->tx_id); + goto get_BMC_response_fail; + } + + if (msg->msg.data_len <= 0) + { + printk("ipmi: Data len too low (%d)\n", msg->msg.data_len); + goto get_BMC_response_fail; + } + + if (msg->msg.data_len > 1) + { + if (comm_data->rx_len) + { + comm_data->rx_len = msg->msg.data_len - 1; + memcpy(comm_data->rx_data, msg->msg.data + 1, comm_data->rx_len); + } + else + { + printk("ipmi: rx len = 0, it should be not retrun ?\n"); + goto get_BMC_response_fail; + } + } + + rv = 0; + +get_BMC_response_fail: + ipmi_free_recv_msg(msg); + + if (ipmi_wait_queue == 0) + { + comm_data->rx_result = rv; + if (rv == 0) + { + complete(comm_data->rx_read_complete); + } + } +} +static struct ipmi_user_hndl ipmi_hndlrs = { .ipmi_recv_hndl = ipmi_msg_handler, }; + +int32_t ipmi_request_wait_for_response(struct kernel_ipmi_msg msg, + struct ipmi_comm_data *comm_data) +{ + int32_t rv = 0; + int32_t escape_time = 0; + + struct ipmi_addr ipmi_address; + + if (ipmi_wait_queue >= IPMI_MAX_WAIT_QUEUE) + { + /* printk("msg queue full, cannot send ipmi cmd\n"); */ + return -EBUSY; + } + ipmi_wait_queue++; + + ipmi_address.addr_type = IPMI_SYSTEM_INTERFACE_ADDR_TYPE; + ipmi_address.channel = IPMI_BMC_CHANNEL; + ipmi_address.data[0] = 0; + + rv = ipmi_validate_addr(&ipmi_address, sizeof(ipmi_address)); + if (rv) + { + printk("ipmi_validate_addr fail, err code : %d\n", rv); + return rv; + } + + ipmi_request_settime(ipmi_mh_user, &ipmi_address, comm_data->tx_id, &msg, + comm_data, 0, 0, 0); + + escape_time = wait_for_completion_timeout(comm_data->rx_read_complete, + IPMI_TIMEOUT); + + rv = comm_data->rx_result; + if (escape_time == 0) + { + printk("BMC not response (%d)\n", escape_time); + } + + return rv; +} + +int32_t ipmi_send_system_cmd(uint8_t *msg_tx_data, int32_t msg_tx_len, + void *msg_rx_data, int32_t msg_rx_len) +{ + int32_t i = 0; + int32_t rv = 0; + + static uint64_t tx_msgid = 1; + + struct kernel_ipmi_msg msg; + struct ipmi_comm_data *comm_data = NULL; + struct completion read_complete; + + init_completion(&read_complete); + + /* prepare transfer message */ + msg.netfn = msg_tx_data[0]; + msg.cmd = msg_tx_data[1]; + msg.data_len = msg_tx_len - 2; + + msg.data = kzalloc(msg.data_len, GFP_KERNEL); + if (msg.data == NULL) + { + printk("%s(%d): malloc [msg.data] failure", __func__, __LINE__); + rv = -ENOMEM; + goto alloc_mem_fail; + } + + comm_data = kzalloc(sizeof(struct ipmi_comm_data), GFP_KERNEL); + if (comm_data == NULL) + { + printk("%s(%d): malloc [comm_data] failure", __func__, __LINE__); + rv = -ENOMEM; + goto alloc_mem_fail; + } + + for (i = 2; i < msg_tx_len; i++) + { + msg.data[i - 2] = msg_tx_data[i]; + } + + comm_data->tx_id = tx_msgid++; + + /* prepare recive message */ + comm_data->rx_data = msg_rx_data; + comm_data->rx_len = msg_rx_len; + comm_data->rx_result = -1; + comm_data->rx_read_complete = &read_complete; + + rv = ipmi_request_wait_for_response(msg, comm_data); + +alloc_mem_fail: + if (msg.data) + { + kfree(msg.data); + } + if (comm_data) + { + kfree(comm_data); + } + if (tx_msgid > UINT_MAX) + { + tx_msgid = 1; + } + + return rv; +} + +int32_t ipmi_sdr_get_reservation(uint16_t *reserve_id) +{ + int32_t rv = 0; + uint8_t msg_data[] = { 0x00, GET_SDR_RESERVE_REPO }; /*netfn = 0x00; cmd = GET_SDR_RESERVE_REPO; */ + + msg_data[0] = (g_use_built_in == 0) ? IPMI_NETFN_STORAGE : IPMI_NETFN_SE; + + /* obtain reservation ID */ + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), reserve_id, 1); + if (rv) + { + printk("BMC down at (%d)!!\n", __LINE__); + } + +#if enable_debug_msg + printk("SDR reservation ID %04x\n", *reserve_id); +#endif + + return rv; +} + +int32_t ipmi_sdr_start(struct ipmi_sdr_iterator *itr) +{ + int32_t rv = 0; + + uint8_t msg_data[] = { IPMI_NETFN_APP, BMC_GET_DEVICE_ID }; /*netfn = IPMI_NETFN_APP; cmd = BMC_GET_DEVICE_ID; */ + + struct ipm_devid_rsp devid; + + /* check SDRR capability */ + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), &devid, 1); + if (rv) + { + printk("BMC down at (%d)!!\n", __LINE__); + return rv; + } + + if (devid.device_revision & IPM_DEV_DEVICE_ID_SDR_MASK) + { + if ((devid.adtl_device_support & 0x02) == 0) + { + if ((devid.adtl_device_support & 0x01)) + { + printk("Using Device SDRs\n"); + g_use_built_in = 1; + } + else + { + printk("Error obtaining SDR info\n"); + } + } + } + + if (g_use_built_in == 0) + { + struct sdr_repo_info_rs sdr_info; + /* get sdr repository info */ + msg_data[0] = IPMI_NETFN_STORAGE; + msg_data[1] = GET_SDR_REPO_INFO; + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), &sdr_info, 1); + itr->total = sdr_info.count; + +#if enable_debug_msg + printk("SDR version: 0x%x\n", sdr_info.version); + printk("SDR free space: %d\n", sdr_info.free); +#endif + } + else + { + struct sdr_device_info_rs sdr_info; + /* get device sdr info */ + msg_data[0] = IPMI_NETFN_SE; + msg_data[1] = GET_SDR_REPO_INFO; + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), &sdr_info, 1); + itr->total = sdr_info.count; + } + +#if enable_debug_msg + printk("SDR records : %d\n", sdr_info.count); +#endif + + if (rv) + { + printk("BMC down at (%d)!!\n", __LINE__); + } + else + { + itr->next = 0; + rv = ipmi_sdr_get_reservation(&(itr->reservation)); + } + + return rv; +} + +int32_t ipmi_sdr_get_header(struct ipmi_sdr_iterator *itr, + struct sdr_get_rs *sdr_rs) +{ + int32_t rv = 0; + + uint8_t msg_data[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; /*netfn = 0x00; cmd = 0x00; */ + + struct sdr_get_rq sdr_rq; + + sdr_rq.reserve_id = itr->reservation; + sdr_rq.id = itr->next; + sdr_rq.offset = 0; + sdr_rq.length = 5; /* only get the header */ + + if (g_use_built_in == 0) + { + msg_data[0] = IPMI_NETFN_STORAGE; + msg_data[1] = GET_SDR; + } + else + { + msg_data[0] = IPMI_NETFN_SE; + msg_data[1] = GET_DEVICE_SDR; + } + + memcpy(msg_data + 2, (uint8_t *)&sdr_rq, sizeof(struct sdr_get_rq)); + + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), sdr_rs, 1); + if ((rv) || (sdr_rs->length == 0)) + { + printk("SDR record id 0x%04x: invalid length %d", itr->next, sdr_rs->length); + return -1; + } + + if (sdr_rs->id != itr->next) + { +#if enable_debug_msg + printk("SDR record id mismatch: 0x%04x\n", sdr_rs->id); +#endif + sdr_rs->id = itr->next; + } +#if enable_debug_msg + printk("\nSDR record ID : 0x%04x", itr->next); + printk("SDR record type : 0x%02x\n", sdr_rs->type); + printk("SDR record next : 0x%04x\n", sdr_rs->next); + printk("SDR record bytes: %d\n", sdr_rs->length); +#endif + + return rv; +} + +int32_t ipmi_sdr_get_record(struct sdr_get_rs *header, + struct ipmi_sdr_iterator *itr, uint8_t *ret_data) +{ + int32_t rv = 0, len = 0; + + uint8_t buff[128] = ""; + uint8_t msg_data[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; /*netfn = 0x00; cmd = 0x00; */ + + struct sdr_get_rq sdr_rq; + + len = header->length; + if (len > 0) + { + memset(&sdr_rq, 0, sizeof(sdr_rq)); + sdr_rq.reserve_id = itr->reservation; + sdr_rq.id = header->id; + sdr_rq.offset = 5; + sdr_rq.length = len; + + if (g_use_built_in == 0) + { + msg_data[0] = IPMI_NETFN_STORAGE; + msg_data[1] = GET_SDR; + } + else + { + msg_data[0] = IPMI_NETFN_SE; + msg_data[1] = GET_DEVICE_SDR; + } + + memcpy(msg_data + 2, (uint8_t *)&sdr_rq, sizeof(struct sdr_get_rq)); + + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), ret_data, 1); + if (rv) + { + printk("BMC down at (%d)!!\n", __LINE__); + } + else + { + memset(buff, 0, sizeof(buff)); + memcpy(buff, ret_data + 2, sdr_rq.length); + memcpy(ret_data, buff, sdr_rq.length + 2); + } + } + + return rv; +} + +void ipmi_sdr_set_sensor_threshold(uint8_t idx, + struct sdr_record_full_sensor *sensor) +{ + + /* lower threshold info */ + if (sensor->mask.type.threshold.read.lnc) + { + g_sensor_data[idx].capability |= SENSOR_GET_CAP_LNC; + } + if (sensor->mask.type.threshold.read.lcr) + { + g_sensor_data[idx].capability |= SENSOR_GET_CAP_LCR; + } + if (sensor->mask.type.threshold.read.lnr) + { + g_sensor_data[idx].capability |= SENSOR_GET_CAP_LNR; + } + g_sensor_data[idx].lowerinfo.lnc = sensor->threshold.lower.non_critical; + g_sensor_data[idx].lowerinfo.lcr = sensor->threshold.lower.critical; + g_sensor_data[idx].lowerinfo.lnr = sensor->threshold.lower.non_recover; + + /* upper threshold info */ + if (sensor->mask.type.threshold.read.unc) + { + g_sensor_data[idx].capability |= SENSOR_GET_CAP_UNC; + } + if (sensor->mask.type.threshold.read.ucr) + { + g_sensor_data[idx].capability |= SENSOR_GET_CAP_UCR; + } + if (sensor->mask.type.threshold.read.unr) + { + g_sensor_data[idx].capability |= SENSOR_GET_CAP_UNR; + } + g_sensor_data[idx].upperinfo.unc = sensor->threshold.upper.non_critical; + g_sensor_data[idx].upperinfo.ucr = sensor->threshold.upper.critical; + g_sensor_data[idx].upperinfo.unr = sensor->threshold.upper.non_recover; +} + +void ipmi_sdr_set_sensor_factor(uint8_t idx, + struct sdr_record_full_sensor *sensor) +{ + char *loc = NULL; + + g_sensor_data[idx].sensor_type = sensor->sensor.type; + sprintf(g_sensor_data[idx].sensor_idstring, "%s", sensor->id_string); + + g_sensor_data[idx].recordinfo.record_m = __TO_M(sensor->mtol); + g_sensor_data[idx].recordinfo.record_b = __TO_B(sensor->bacc); + g_sensor_data[idx].recordinfo.record_k1 = __TO_B_EXP(sensor->bacc); + g_sensor_data[idx].recordinfo.record_k2 = __TO_R_EXP(sensor->bacc); + + g_sensor_data[idx].recordinfo.record_analog = sensor->unit.analog; + g_sensor_data[idx].recordinfo.record_linearization = sensor->linearization; + + memset(g_sensor_data[idx].attrinfo.attr_type_str, 0x00, + SENSOR_ATTR_NAME_LENGTH); + + switch (g_sensor_data[idx].sensor_type) + { + case SDR_SENSOR_TYPE_TEMP: + sprintf(g_sensor_data[idx].attrinfo.attr_type_str, "temp"); + break; + case SDR_SENSOR_TYPE_VOLT: + sprintf(g_sensor_data[idx].attrinfo.attr_type_str, "in"); + break; + case SDR_SENSOR_TYPE_FAN: + g_sensor_data[idx].capability |= SENSOR_GET_CAP_PWM; + g_sensor_data[idx].capability |= SENSOR_GET_CAP_CONMODE; + g_sensor_data[idx].capability |= SENSOR_GET_CAP_DIRECTION; + sprintf(g_sensor_data[idx].attrinfo.attr_type_str, "fan"); + break; + case SDR_SENSOR_TYPE_PS: + loc = strstr(g_sensor_data[idx].sensor_idstring, "POWER"); + if (loc) + { + if ((strncmp(g_sensor_data[idx].sensor_idstring + 11, "OUT", 3)) == 0) + { + g_sensor_data[idx].capability |= SENSOR_GET_CAP_MODEL; + g_sensor_data[idx].capability |= SENSOR_GET_CAP_SN; + g_sensor_data[idx].capability |= SENSOR_GET_CAP_MFRID; + g_sensor_data[idx].capability |= SENSOR_GET_CAP_PSU_PRESENT; + } + sprintf(g_sensor_data[idx].attrinfo.attr_type_str, "power"); + } + + loc = strstr(g_sensor_data[idx].sensor_idstring, "VOLTAGE"); + if (loc) + { + sprintf(g_sensor_data[idx].attrinfo.attr_type_str, "in"); + } + + loc = strstr(g_sensor_data[idx].sensor_idstring, "CURRENT"); + if (loc) + { + sprintf(g_sensor_data[idx].attrinfo.attr_type_str, "curr"); + } + + break; + case SDR_SENSOR_TYPE_CURR: + sprintf(g_sensor_data[idx].attrinfo.attr_type_str, "curr"); + break; + case SDR_SENSOR_TYPE_OTHER: + sprintf(g_sensor_data[idx].attrinfo.attr_type_str, "other"); + break; + default: + printk("not support sensor type !! [%d]\n", g_sensor_data[idx].sensor_type); + break; + } + + if ((strncmp(g_sensor_data[idx].sensor_idstring, "Fan", 3)) == 0) + { + g_sensor_data[idx].capability |= SENSOR_GET_CAP_FAN_PRESENT; + } + +#if enable_debug_msg + { + printk("\n********************\n"); + + printk("m[%d], b[%d], k1[%d], k2[%d]\n", g_sensor_data[idx].recordinfo.record_m, + g_sensor_data[idx].recordinfo.record_b + , g_sensor_data[idx].recordinfo.record_k1, + g_sensor_data[idx].recordinfo.record_k2); + + printk("sensor [%s] type[%d], analog[%d], linearization[%d]\n", + g_sensor_data[idx].sensor_idstring, g_sensor_data[idx].sensor_type + , g_sensor_data[idx].recordinfo.record_analog, + g_sensor_data[idx].recordinfo.record_linearization); + + printk("\n********************\n"); + } +#endif + +} + +int32_t sdr_convert_sensor_reading(uint8_t idx, uint8_t val, + int32_t *point_result) +{ + int32_t m = g_sensor_data[idx].recordinfo.record_m; + int32_t b = g_sensor_data[idx].recordinfo.record_b; + int32_t k1 = g_sensor_data[idx].recordinfo.record_k1; + int32_t k2 = g_sensor_data[idx].recordinfo.record_k2; + int32_t decimal_point = 0; + int32_t result = 0; + + decimal_point = pow_convert(&b, k1); + + switch (g_sensor_data[idx].recordinfo.record_analog) + { + case 0: + result = m * val * decimal_point + b; + break; + case 1: + if (val & 0x80) + { + val++; + } + case 2: + result = (m * (int16_t)val) * decimal_point + b; + break; + default: + return; + } + + pow_convert(&result, k2); + if (k1 < 0) + { + *point_result += -k1; + } + if (k2 < 0) + { + *point_result += -k2; + } + + if (g_sensor_data[idx].sensor_type != SDR_SENSOR_TYPE_FAN) + { + result = result * 1000; /*shift for lm-sensors */ + } + + return result; +} + +int32_t ipmi_sdr_parsing_value(int32_t idx, uint8_t input_value, + int8_t *ret_str) +{ + int32_t calc_result = 0, point_result = 0; + int32_t temp_len = 0; + + uint8_t temp_str[16] = ""; + + calc_result = sdr_convert_sensor_reading(idx, input_value, &point_result); + + temp_len = sprintf(temp_str, "%d", calc_result); + temp_len = temp_len - point_result; + + /* int part */ + if (temp_len <= 0) + { + sprintf(ret_str, "0"); + } + else + { + snprintf(ret_str, temp_len + 1, "%s", + temp_str); /* +1 for snprintf reserve space'\0' */ + } + + /* point part */ + strcat(ret_str, "."); + + /* float part */ + if ((point_result == 0) || (temp_len < 0)) + { + strcat(ret_str, "0"); + } + else + { + strcat(ret_str, temp_str + temp_len); + } + + /* EOL part */ + strcat(ret_str, "\n\0"); + + return (temp_len + 1 + point_result + + 2); /*integer + point + float + EOL + \0 */ +} + + +uint8_t ipmi_check_psu_present(uint8_t psu_slot) +{ + uint8_t slot_mask = 0x0; + int32_t rv = 0; + + uint8_t returnData[128] = { 0 }; + uint8_t msg_data[] = { 0x36, 0xB9, 0x4C, 0x1C, 0x00, 0x03 }; /*netfn = 0x36; cmd = 0xB9; */ + /*uint8_t msg_data[] = { 0x06, 0x52, 0x1B, 0x4C, 0x01, 0x00 }; //netfn = IPMI_NETFN_APP; cmd = GET_PSU_READING; */ + + mutex_lock(&ipmi_lock); + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), returnData, 1); + mutex_unlock(&ipmi_lock); + + if (rv) + { + printk("BMC down at (%d)!!\n", __LINE__); + return 0; + } + else + { + slot_mask = (psu_slot == 1) ? 0x01 : 0x02; + return (returnData[0] & slot_mask) ? 0 : 1; + } +} + +int32_t ipmi_get_psu_info(uint8_t idx, uint8_t cmd, uint8_t *retbuf) +{ + uint8_t psu_slot = 0; + int32_t rv = 0; + + uint8_t returnData[128] = { 0 }; + uint8_t msg_data[] = { 0x36, 0xBB, 0x4C, 0x1C, 0x00, cmd, 0x00 }; /*netfn = 0x36; cmd = 0xBB; */ + + if (strstr(g_sensor_data[idx].sensor_idstring, "PSU1")) + { + psu_slot = 1; + } + else + { + psu_slot = 2; + } + + if (ipmi_check_psu_present(psu_slot)) + { + msg_data[6] = psu_slot; + mutex_lock(&ipmi_lock); + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), returnData, 1); + mutex_unlock(&ipmi_lock); + + if (rv) + { + printk("BMC down at (%d)!!\n", __LINE__); + } + else + { + return sprintf(retbuf, "%s\n", returnData); + } + } + else + { + /*printk("Error ! cannot detect PSU%d\n", psu_slot); */ + } + + return sprintf(retbuf, "N/A\n"); +} + +void ipmi_fan_control(uint8_t cmd_data1, uint8_t cmd_data2, uint8_t *retbuf) +{ + int32_t rv = 0; + + uint8_t returnData[10] = { 0 }; + uint8_t msg_data[] = { IPMI_NETFN_TSOL, GET_FAN_INFO, cmd_data1, cmd_data2 }; /*netfn = IPMI_NETFN_TSOL; cmd = GET_FAN_INFO; */ + + mutex_lock(&ipmi_lock); + if (cmd_data1) + { + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), NULL, 0); + } + else + { + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), returnData, 1); + } + mutex_unlock(&ipmi_lock); + + if (rv) + { + printk("BMC down at (%d)!!\n", __LINE__); + sprintf(retbuf, "N/A\n"); + } + else + { + sprintf(retbuf, "%s", returnData); + } +} + +static ssize_t show_label(struct device *dev, struct device_attribute *devattr, + char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return sprintf(buf, "%s\n", + g_sensor_data[attr->index + DEBUGUSE_SHIFT].sensor_idstring); +} + +static ssize_t show_crit_alarm(struct device *dev, + struct device_attribute *devattr, char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return sprintf(buf, "%d\n", attr->index); +} + +static ssize_t show_input(struct device *dev, struct device_attribute *devattr, + char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + int32_t rv = 0; + + uint8_t returnData[4] = ""; + uint8_t msg_data[] = { IPMI_NETFN_SE, GET_SENSOR_READING, 0x00 }; /*netfn = IPMI_NETFN_SE; cmd = GET_SENSOR_READING; */ + + mutex_lock(&ipmi_lock); + msg_data[2] = g_sensor_data[attr->index + DEBUGUSE_SHIFT].addr; + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), returnData, 1); + mutex_unlock(&ipmi_lock); + + if (rv) + { + printk("BMC down at (%d)!!\n", __LINE__); + return sprintf(buf, "0.0\n"); + } + else + { + return ipmi_sdr_parsing_value(attr->index + DEBUGUSE_SHIFT, returnData[0], buf); + } +} + +static ssize_t show_lnr(struct device *dev, struct device_attribute *devattr, + char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return ipmi_sdr_parsing_value(attr->index + DEBUGUSE_SHIFT, + g_sensor_data[attr->index + DEBUGUSE_SHIFT].lowerinfo.lnr, buf); +} + +static ssize_t show_lcr(struct device *dev, struct device_attribute *devattr, + char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return ipmi_sdr_parsing_value(attr->index + DEBUGUSE_SHIFT, + g_sensor_data[attr->index + DEBUGUSE_SHIFT].lowerinfo.lcr, buf); +} + +static ssize_t show_lnc(struct device *dev, struct device_attribute *devattr, + char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return ipmi_sdr_parsing_value(attr->index + DEBUGUSE_SHIFT, + g_sensor_data[attr->index + DEBUGUSE_SHIFT].lowerinfo.lnc, buf); +} + +static ssize_t show_unr(struct device *dev, struct device_attribute *devattr, + char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return ipmi_sdr_parsing_value(attr->index + DEBUGUSE_SHIFT, + g_sensor_data[attr->index + DEBUGUSE_SHIFT].upperinfo.unr, buf); +} + +static ssize_t show_ucr(struct device *dev, struct device_attribute *devattr, + char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return ipmi_sdr_parsing_value(attr->index + DEBUGUSE_SHIFT, + g_sensor_data[attr->index + DEBUGUSE_SHIFT].upperinfo.ucr, buf); +} + +static ssize_t show_unc(struct device *dev, struct device_attribute *devattr, + char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return ipmi_sdr_parsing_value(attr->index + DEBUGUSE_SHIFT, + g_sensor_data[attr->index + DEBUGUSE_SHIFT].upperinfo.unc, buf); +} + +static ssize_t show_model(struct device *dev, struct device_attribute *devattr, + char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return ipmi_get_psu_info(attr->index + DEBUGUSE_SHIFT, 0x9a, buf); +} + +static ssize_t show_sn(struct device *dev, struct device_attribute *devattr, + char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return ipmi_get_psu_info(attr->index + DEBUGUSE_SHIFT, 0x9e, buf); +} + +static ssize_t show_mfrid(struct device *dev, struct device_attribute *devattr, + char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return ipmi_get_psu_info(attr->index + DEBUGUSE_SHIFT, 0x99, buf); +} + +static ssize_t show_pwm(struct device *dev, struct device_attribute *devattr, + char *buf) +{ + uint8_t returnData[10] = { 0 }; + ipmi_fan_control(0x00, 0x00, returnData); + return sprintf(buf, "%d\n", returnData[0]); +} + +static ssize_t store_pwm(struct device *dev, struct device_attribute *devattr, + const char *buf, size_t count) +{ + uint8_t store_input = 0; + uint8_t returnData[10] = { 0 }; + simple_atoi(buf, &store_input); + if (g_fan_control_mode == 1) + { + ipmi_fan_control(0x01, store_input, returnData); + } + + return count; +} + +static ssize_t show_controlmode(struct device *dev, + struct device_attribute *devattr, char *buf) +{ + return sprintf(buf, "%d\n", g_fan_control_mode); +} + +static ssize_t store_controlmode(struct device *dev, + struct device_attribute *devattr, const char *buf, size_t count) +{ + uint8_t store_input = 0; + uint8_t returnData[10] = { 0 }; + simple_atoi(buf, &store_input); + g_fan_control_mode = store_input; + if (g_fan_control_mode == 3) + { + ipmi_fan_control(0x7f, 0xff, returnData); + } + + return count; +} + +static ssize_t show_direction(struct device *dev, + struct device_attribute *devattr, char *buf) +{ + int32_t rv = 0; + + uint8_t returnData[10] = { 0 }; + uint8_t msg_data[] = { IPMI_NETFN_STORAGE, GET_FRU_INFO, 0x00, 0x19, 0x00, 0x01 }; /*netfn = IPMI_NETFN_STORAGE; cmd = GET_FRU_INFO; */ + + mutex_lock(&ipmi_lock); + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), returnData, 1); + mutex_unlock(&ipmi_lock); + + if (rv) + { + printk("BMC down at (%d)!!\n", __LINE__); + return sprintf(buf, "N/A\n"); + } + else + { + return sprintf(buf, "%c\n", returnData[1]); + } +} + +static ssize_t show_fanpresent(struct device *dev, + struct device_attribute *devattr, char *buf) +{ + int32_t rv = 0; + int32_t fan_idx = 0, fan_present = 0; + + uint8_t returnData[10] = { 0 }; + uint8_t msg_data[] = { 0x36, 0xB9, 0x4C, 0x1C, 0x00, 0x02 }; /*netfn = 0x36; cmd = 0xB9; */ + + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + struct kernel_ipmi_msg msg; + + fan_idx = (g_sensor_data[attr->index].sensor_idstring[8] - '0') - 1; + + mutex_lock(&ipmi_lock); + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), returnData, 1); + mutex_unlock(&ipmi_lock); + + fan_present = ((returnData[0] >> fan_idx) & 0x1) ? 0 : 1; + + return sprintf(buf, "%d\n", fan_present); +} + +static ssize_t show_psupresent(struct device *dev, + struct device_attribute *devattr, char *buf) +{ + int32_t psu_idx = 0; + + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + + psu_idx = g_sensor_data[attr->index].sensor_idstring[3] - '0'; + + return sprintf(buf, "%d\n", ipmi_check_psu_present(psu_idx)); +} + +static ssize_t(*const attr_show_func_ptr[SENSOR_ATTR_MAX])(struct device *dev, + struct device_attribute *devattr, char *buf) = +{ + show_label, show_crit_alarm, show_input + , show_lnc, show_lcr, show_lnr + , show_unc, show_ucr, show_unr + , show_model, show_sn, show_pwm + , show_controlmode, show_direction, show_fanpresent + , show_psupresent, show_mfrid +}; + +static ssize_t(*const attr_store_func_ptr[SENSOR_ATTR_MAX])(struct device *dev, + struct device_attribute *devattr, const char *buf, size_t count) = +{ + NULL, NULL, NULL + , NULL, NULL, NULL + , NULL, NULL, NULL + , NULL, NULL, store_pwm + , store_controlmode, NULL, NULL + , NULL, NULL +}; + +static const char *const sensor_attrnames[SENSOR_ATTR_MAX] = +{ + "%s%d_label", "%s%d_crit_alarm", "%s%d_input" + , "%s%d_lncrit", "%s%d_lcrit", "%s%d_min" + , "%s%d_ncrit", "%s%d_crit", "%s%d_max" + , "%s%d_model", "%s%d_sn", "%s%d_pwm" + , "%s%d_controlmode", "%s%d_direction", "%s%d_present" + , "%s%d_present", "%s%d_mfrid" +}; + +static int32_t create_sensor_attrs(int32_t attr_no) +{ + int32_t i = 0, j = 0; + + struct attr_info *attrdata = &g_sensor_data[attr_no].attrinfo; + +#if enable_debug_msg + printk("##### %s:%d attr_no %d\n", __FUNCTION__, __LINE__, attr_no); +#endif + + for (i = 0; i < SENSOR_ATTR_MAX; i++) + { + if ((g_sensor_data[attr_no].capability >> i) & 0x01) + { + snprintf(attrdata->attr_name[j], SENSOR_ATTR_NAME_LENGTH, sensor_attrnames[i], + attrdata->attr_type_str, attr_no - DEBUGUSE_SHIFT); + + sysfs_attr_init(&attrdata->sd_attrs[j].dev_attr.attr); + attrdata->sd_attrs[j].dev_attr.attr.name = attrdata->attr_name[j]; + attrdata->sd_attrs[j].dev_attr.show = attr_show_func_ptr[i]; + attrdata->sd_attrs[j].dev_attr.store = attr_store_func_ptr[i]; + + attrdata->sd_attrs[j].dev_attr.attr.mode = S_IRUGO; + if (attrdata->sd_attrs[j].dev_attr.store) + { + attrdata->sd_attrs[j].dev_attr.attr.mode |= S_IWUSR; + } + + attrdata->sd_attrs[j].index = attr_no - DEBUGUSE_SHIFT; + attrdata->attrs[j] = &attrdata->sd_attrs[j].dev_attr.attr; + j++; + + data->total_create_sysfs++; + } + } + + attrdata->attrs[j] = NULL; + attrdata->attr_group.attrs = attrdata->attrs; + + g_sensor_data[attr_no].attrinfo.attr_exist = 1; + + return sysfs_create_group(&data->ipmi_hwmon_dev->kobj, &attrdata->attr_group); +} + +static int32_t remove_sensor_attrs(void) +{ + int32_t i = 0; + + for (i = 0; i < data->total_sensor_id; i++) + { + if (g_sensor_data[i].attrinfo.attr_exist) + { + sysfs_remove_group(&data->ipmi_hwmon_dev->kobj, + &g_sensor_data[i].attrinfo.attr_group); + } + } + return 0; +} + +int32_t ipmi_init_sdr_sensors_data(void) +{ + int32_t sdr_idx = 0; + int32_t err = 0; + + struct ipmi_sdr_iterator *itr = NULL; + struct sdr_get_rs *header = NULL; + + uint8_t *rec = NULL; + + mutex_lock(&ipmi_lock); + + itr = kzalloc(sizeof(struct ipmi_sdr_iterator), GFP_KERNEL); + if (itr == NULL) + { + printk("%s(%d): kzalloc failure.\n", __func__, __LINE__); + goto itr_malloc_fail; + } + + header = kzalloc(sizeof(struct sdr_get_rs), GFP_KERNEL); + if (header == NULL) + { + printk("%s(%d): malloc failure.\n", __func__, __LINE__); + goto header_malloc_fail; + } + + err = ipmi_sdr_start(itr); + if (err) + { + printk("%s(%d): ipmi_sdr_start fail.\n", __func__, __LINE__); + goto ipmi_sdr_start_fail; + } + + data->total_sensor_id = itr->total; + rec = kzalloc(GET_SDR_ENTIRE_RECORD, GFP_KERNEL); + if (rec == NULL) + { + printk("%s(%d): kzalloc failure\n", __func__, __LINE__); + goto rec_malloc_fail; + } + + g_sensor_data = kzalloc(itr->total * sizeof(struct ipmi_sensor_data), + GFP_KERNEL); + if (g_sensor_data == NULL) + { + printk("%s(%d): malloc failure", __func__, __LINE__); + goto g_sensor_data_malloc_fail; + } + + memset(g_sensor_data, 0x0, itr->total * sizeof(struct ipmi_sensor_data)); + + for (sdr_idx = 0; sdr_idx < itr->total; sdr_idx++) + { + err = ipmi_sdr_get_header(itr, header); + if (err) + { + if (err == 0xC5) + { + /* C5h : Reservation Invalid */ +#if enable_debug_msg + printk("ipmi: reservation number given was invalid or the reservation was lost\n"); + printk("ipmi: retry\n"); +#endif + ipmi_sdr_get_reservation(&(itr->reservation)); + sdr_idx--; + continue; + } + printk("ipmi: Get SDR header fail,so break this request\n"); + goto ipmi_sdr_get_header_fail; + } + + + memset(rec, 0, GET_SDR_ENTIRE_RECORD); + err = ipmi_sdr_get_record(header, itr, rec); + if (err) + { + if (err == 0xC5) + { + /* C5h : Reservation Invalid */ +#if enable_debug_msg + printk("ipmi: reservation number given was invalid or the reservation was lost\n"); + printk("ipmi: retry\n"); +#endif + ipmi_sdr_get_reservation(&(itr->reservation)); + sdr_idx--; + continue; + } + printk("ipmi: Get SDR header fail,so break this request\n"); + goto ipmi_sdr_get_record_fail; + } + + itr->next = header->next; + + switch (header->type) + { + case SDR_RECORD_TYPE_FULL_SENSOR: + /* prepare (threshold, factor)data whilie init, for reduce reading step and improve operate speed */ + g_sensor_data[sdr_idx].addr = rec[2]; + g_sensor_data[sdr_idx].capability = + SENSOR_GET_CAP_LABEL /*| SENSOR_GET_CAP_ALARM */ | SENSOR_GET_CAP_INPUT; + g_sensor_data[sdr_idx].headerinfo.header_type = header->type; + g_sensor_data[sdr_idx].headerinfo.header_byte = header->length; + + ipmi_sdr_set_sensor_threshold(sdr_idx, (struct sdr_record_full_sensor *) rec); + ipmi_sdr_set_sensor_factor(sdr_idx, (struct sdr_record_full_sensor *) rec); + + if (sdr_idx >= DEBUGUSE_SHIFT) + { + err = create_sensor_attrs(sdr_idx); + if (err) + { + g_sensor_data[sdr_idx].attrinfo.attr_exist = 0; + printk("[err : %d]sysfs_create_group fail in [%d] %s\n", err, sdr_idx, + g_sensor_data[sdr_idx].sensor_idstring); + goto create_sysfs_fail; + } + } + + data->total_suport_sensor++; + + break; + case SDR_RECORD_TYPE_COMPACT_SENSOR: /* not supporrt now */ + case SDR_RECORD_TYPE_EVENTONLY_SENSOR: /* not supporrt now */ + case SDR_RECORD_TYPE_MC_DEVICE_LOCATOR: /* not supporrt now */ + default: + g_sensor_data[sdr_idx].attrinfo.attr_exist = 0; +#if enable_debug_msg + printk("ID[%d] : not support type [%d]\n", sdr_idx, header->type); +#endif + break; + } + } + + printk("quanta_hwmon_ipmi : detected [%d] sensor, create [%d] sysfs\n", + data->total_suport_sensor, data->total_create_sysfs); + +create_sysfs_fail: +ipmi_sdr_get_header_fail: +ipmi_sdr_get_record_fail: +g_sensor_data_malloc_fail: + if (header) + { + kfree(header); + header = NULL; + } + if (rec) + { + kfree(rec); + rec = NULL; + } + +rec_malloc_fail: +ipmi_sdr_start_fail: +header_malloc_fail: + if (itr) + { + kfree(itr); + itr = NULL; + } + +itr_malloc_fail: + mutex_unlock(&ipmi_lock); + + return err; +} + +static int32_t __init quanta_hwmon_ipmi_init(void) +{ + int32_t err = 0; + + init_completion(&g_read_complete); + + data = kzalloc(sizeof(struct quanta_hwmon_ipmi_data), GFP_KERNEL); + if (NULL == data) + { + printk("alloc data fail\n"); + goto alloc_err; + } + + data->ipmi_platform_dev = platform_device_register_simple(DRVNAME, -1, NULL, 0); + err = IS_ERR(data->ipmi_platform_dev); + if (err) + { + printk("platform device register fail (err : %d)\n", err); + goto device_reg_err; + } + + data->ipmi_hwmon_dev = hwmon_device_register_with_groups(NULL, DRVNAME, NULL, + NULL); + err = IS_ERR(data->ipmi_hwmon_dev); + if (err) + { + printk("hwmon register fail\n"); + goto hwmon_register_err; + } + + err = ipmi_create_user(0, &ipmi_hndlrs, NULL, &ipmi_mh_user); + if (err) + { + printk("warning: create user fail, watchdog broken (err : %d)\n", err); + goto ipmi_create_err; + } + + mutex_init(&ipmi_lock); + err = ipmi_init_sdr_sensors_data(); + if (err) + { + printk("init sensor data fail (err : %d)\n", err); + goto init_sensor_err; + } + + return 0; + +init_sensor_err: + if (g_sensor_data) + { + kfree(g_sensor_data); + g_sensor_data = NULL; + } +ipmi_create_err: + hwmon_device_unregister(data->ipmi_hwmon_dev); +hwmon_register_err: + platform_device_unregister(data->ipmi_platform_dev); +device_reg_err: + if (data) + { + kfree(data); + data = NULL; + } +alloc_err: + return err; +} + +static void __exit quanta_hwmon_ipmi_exit(void) +{ + remove_sensor_attrs(); + hwmon_device_unregister(data->ipmi_hwmon_dev); + + mutex_lock(&ipmi_lock); + ipmi_destroy_user(ipmi_mh_user); + mutex_unlock(&ipmi_lock); + + platform_device_unregister(data->ipmi_platform_dev); + + if (g_sensor_data) + { + kfree(g_sensor_data); + g_sensor_data = NULL; + } + + if (data) + { + kfree(data); + data = NULL; + } +} + +module_init(quanta_hwmon_ipmi_init); +module_exit(quanta_hwmon_ipmi_exit); + +MODULE_AUTHOR("Charcar~~Charcar~Charlie li li"); +MODULE_VERSION("2.0"); +MODULE_DESCRIPTION("Quanta BMC hardware monitor driver"); +MODULE_LICENSE("GPL"); diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix8a-bwde-56x/service/ix8a-bwde-platform-init.service b/platform/broadcom/sonic-platform-modules-quanta/ix8a-bwde-56x/service/ix8a-bwde-platform-init.service new file mode 100644 index 000000000000..4527d70bd39d --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix8a-bwde-56x/service/ix8a-bwde-platform-init.service @@ -0,0 +1,13 @@ +[Unit] +Description=Quanta IX8A-BWDE-56X Platform initialization service +Before=pmon.service +DefaultDependencies=no + +[Service] +Type=oneshot +ExecStart=/usr/local/bin/quanta_ix8a_bwde_util.py install +ExecStop=/usr/local/bin/quanta_ix8a_bwde_util.py clean +RemainAfterExit=yes + +[Install] +WantedBy=multi-user.target diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix8a-bwde-56x/setup.py b/platform/broadcom/sonic-platform-modules-quanta/ix8a-bwde-56x/setup.py new file mode 100644 index 000000000000..a157e46cb60d --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix8a-bwde-56x/setup.py @@ -0,0 +1,15 @@ +#!/usr/bin/env python + +import os +from setuptools import setup +os.listdir + +setup( + name='ix8a_bwde_56x', + version='1.0', + description='Module to initialize Quanta IX8A-BWDE-56X platforms', + + packages=['ix8a_bwde_56x'], + package_dir={'ix8a_bwde_56x': 'ix8a-bwde-56x/classes'}, +) + diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix8a-bwde-56x/sonic_platform/__init__.py b/platform/broadcom/sonic-platform-modules-quanta/ix8a-bwde-56x/sonic_platform/__init__.py new file mode 100644 index 000000000000..4bfefa0fb636 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix8a-bwde-56x/sonic_platform/__init__.py @@ -0,0 +1,3 @@ +__all__ = ["platform", "chassis"] +from sonic_platform import * + diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix8a-bwde-56x/sonic_platform/chassis.py b/platform/broadcom/sonic-platform-modules-quanta/ix8a-bwde-56x/sonic_platform/chassis.py new file mode 100644 index 000000000000..c765f3734473 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix8a-bwde-56x/sonic_platform/chassis.py @@ -0,0 +1,232 @@ +#!/usr/bin/env python +# +# Name: chassis.py, version: 1.0 +# +# Description: Module contains the definitions of SONiC platform APIs +# + +try: + import sys + import time + import syslog + from sonic_platform_base.chassis_base import ChassisBase + from sonic_platform.eeprom import Eeprom + from sonic_platform.psu import Psu + from sonic_platform.sfp import Sfp + from sonic_platform.fan import Fan + from sonic_platform.fan_drawer import FanDrawer + from sonic_platform.thermal import Thermal + +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +class Chassis(ChassisBase): + + def __init__(self): + ChassisBase.__init__(self) + self.__num_of_psus = 2 + self.__num_of_ports = 56 + self.__num_of_sfps = 48 + self.__num_of_fan_drawers = 6 + self.__fan_per_drawer = 2 + self.__num_of_thermals = 28 + self.__xcvr_presence = {} + + # Initialize EEPROM + self._eeprom = Eeprom() + + # Initialize watchdog + #self._watchdog = Watchdog() + + # Initialize FAN + fan_index = 1 + for drawer_index in range(1, self.__num_of_fan_drawers + 1): + drawer_fan_list = [] + for index in range(0, self.__fan_per_drawer): + fan = Fan(fan_index, False) + fan_index += 1 + self._fan_list.append(fan) + drawer_fan_list.append(fan) + fan_drawer = FanDrawer(drawer_index, drawer_fan_list) + self._fan_drawer_list.append(fan_drawer) + + # Initialize thermal + for index in range(1, self.__num_of_thermals + 1): + thermal = Thermal(index) + self._thermal_list.append(thermal) + + # Initialize PSU and PSU_FAN + for index in range(1, self.__num_of_psus + 1): + psu = Psu(index) + self._psu_list.append(psu) + + # Initialize SFP + for index in range(1, self.__num_of_ports + 1): + if index in range(1, self.__num_of_sfps + 1): + sfp = Sfp(index, 'SFP') + else: + sfp = Sfp(index, 'QSFP') + + self._sfp_list.append(sfp) + + for index in range(1, self.__num_of_ports + 1): + self.__xcvr_presence[index] = self._sfp_list[index-1].get_presence() + +############################################## +# Device methods +############################################## + + def get_sfp(self, index): + """ + Retrieves sfp represented by (1-based) index + For Quanta IX8A the index in sfputil.py starts from 1, so override + + Args: + index: An integer, the index (1-based) of the sfp to retrieve. + The index should be the sequence of a physical port in a chassis, + starting from 1. + + Returns: + An object dervied from SfpBase representing the specified sfp + """ + sfp = None + + try: + if (index == 0): + raise IndexError + sfp = self._sfp_list[index-1] + except IndexError: + sys.stderr.write("override: SFP index {} out of range (1-{})\n".format( + index, len(self._sfp_list))) + + return sfp + + def get_name(self): + """ + Retrieves the name of the chassis + Returns: + string: The name of the chassis + """ + return self._eeprom.modelstr() + + def get_presence(self): + """ + Retrieves the presence of the chassis + Returns: + bool: True if chassis is present, False if not + """ + return True + + def get_model(self): + """ + Retrieves the model number (or part number) of the chassis + Returns: + string: Model/part number of chassis + """ + return self._eeprom.part_number_str() + + def get_serial(self): + """ + Retrieves the serial number of the chassis + Returns: + string: Serial number of chassis + """ + return self._eeprom.serial_number_str() + + def get_status(self): + """ + Retrieves the operational status of the chassis + Returns: + bool: A boolean value, True if chassis is operating properly + False if not + """ + return True + +############################################## +# Chassis methods +############################################## + + def get_base_mac(self): + """ + Retrieves the base MAC address for the chassis + + Returns: + A string containing the MAC address in the format + 'XX:XX:XX:XX:XX:XX' + """ + return self._eeprom.base_mac_addr() + + def get_serial_number(self): + """ + Retrieves the hardware serial number for the chassis + + Returns: + A string containing the hardware serial number for this chassis. + """ + return self._eeprom.serial_number_str() + + def get_system_eeprom_info(self): + """ + Retrieves the full content of system EEPROM information for the chassis + + Returns: + A dictionary where keys are the type code defined in + OCP ONIE TlvInfo EEPROM format and values are their corresponding + values. + Ex. { '0x21':'AG9064', '0x22':'V1.0', '0x23':'AG9064-0109867821', + '0x24':'001c0f000fcd0a', '0x25':'02/03/2018 16:22:00', + '0x26':'01', '0x27':'REV01', '0x28':'AG9064-C2358-16G'} + """ + return self._eeprom.system_eeprom_info() + + ############################################## + # Other methods + ############################################## + def get_watchdog(self): + """ + Retreives hardware watchdog device on this chassis + + Returns: + An object derived from WatchdogBase representing the hardware + watchdog device + """ + try: + if self._watchdog is None: + from sonic_platform.watchdog import Watchdog + # Create the watchdog Instance + self._watchdog = Watchdog() + + except Exception as e: + syslog.syslog(syslog.LOG_ERR, "Fail to load watchdog due to {}".format(e)) + return self._watchdog + + def get_change_event(self, timeout=0): + """ + Currently only support transceiver change events + """ + + start_ms = time.time() * 1000 + xcvr_change_event_dict = {} + event = False + + while True: + time.sleep(0.5) + for index in range(1, self.__num_of_ports + 1): + cur_xcvr_presence = self._sfp_list[index-1].get_presence() + if cur_xcvr_presence != self.__xcvr_presence[index]: + if cur_xcvr_presence is True: + xcvr_change_event_dict[str(index)] = '1' + self.__xcvr_presence[index] = True + elif cur_xcvr_presence is False: + xcvr_change_event_dict[str(index)] = '0' + self.__xcvr_presence[index] = False + event = True + + if event is True: + return True, {'sfp':xcvr_change_event_dict} + + if timeout: + now_ms = time.time() * 1000 + if (now_ms - start_ms >= timeout): + return True, {'sfp':xcvr_change_event_dict} + diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix8a-bwde-56x/sonic_platform/eeprom.py b/platform/broadcom/sonic-platform-modules-quanta/ix8a-bwde-56x/sonic_platform/eeprom.py new file mode 100644 index 000000000000..d154a8a0c4a0 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix8a-bwde-56x/sonic_platform/eeprom.py @@ -0,0 +1,110 @@ +#!/usr/bin/env python +# +# Name: eeprom.py, version: 1.0 +# +# Description: Module contains the definitions of SONiC platform APIs +# + +try: + from sonic_eeprom import eeprom_tlvinfo +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +class Eeprom(eeprom_tlvinfo.TlvInfoDecoder): + + def __init__(self): + self.__eeprom_path = "/sys/bus/i2c/devices/3-0054/eeprom" + super(Eeprom, self).__init__(self.__eeprom_path, 0, '', True) + self.__eeprom_tlv_dict = dict() + try: + self.__eeprom_data = self.read_eeprom() + except: + self.__eeprom_data = "N/A" + raise RuntimeError("Eeprom is not Programmed") + else: + eeprom = self.__eeprom_data + + if not self.is_valid_tlvinfo_header(eeprom): + return + + total_length = (eeprom[9] << 8) | eeprom[10] + tlv_index = self._TLV_INFO_HDR_LEN + tlv_end = self._TLV_INFO_HDR_LEN + total_length + + while (tlv_index + 2) < len(eeprom) and tlv_index < tlv_end: + if not self.is_valid_tlv(eeprom[tlv_index:]): + break + + tlv = eeprom[tlv_index:tlv_index + 2 + + eeprom[tlv_index + 1]] + code = "0x%02X" % tlv[0] + + if tlv[0] == self._TLV_CODE_VENDOR_EXT: + value = str((tlv[2] << 24) | (tlv[3] << 16) | + (tlv[4] << 8) | tlv[5]) + value += tlv[6:6 + tlv[1]].decode('ascii') + else: + value = self.decoder(None, tlv)[30:] + + self.__eeprom_tlv_dict[code] = value + if eeprom[tlv_index] == self._TLV_CODE_CRC_32: + break + + tlv_index += eeprom[tlv_index+1] + 2 + + def serial_number_str(self): + (is_valid, results) = self.get_tlv_field( + self.__eeprom_data, self._TLV_CODE_SERIAL_NUMBER) + if not is_valid: + return "N/A" + + return results[2].decode('ascii') + + def base_mac_addr(self): + (is_valid, results) = self.get_tlv_field( + self.__eeprom_data, self._TLV_CODE_MAC_BASE) + if not is_valid or results[1] != 6: + return super(TlvInfoDecoder, self).switchaddrstr(e) + + return ":".join(["{:02x}".format(T) for T in results[2]]).upper() + + def modelstr(self): + (is_valid, results) = self.get_tlv_field( + self.__eeprom_data, self._TLV_CODE_PRODUCT_NAME) + if not is_valid: + return "N/A" + + return results[2].decode('ascii') + + def part_number_str(self): + (is_valid, results) = self.get_tlv_field( + self.__eeprom_data, self._TLV_CODE_PART_NUMBER) + if not is_valid: + return "N/A" + + return results[2].decode('ascii') + + def serial_tag_str(self): + (is_valid, results) = self.get_tlv_field( + self.__eeprom_data, self._TLV_CODE_SERVICE_TAG) + if not is_valid: + return "N/A" + + return results[2].decode('ascii') + + def revision_str(self): + (is_valid, results) = self.get_tlv_field( + self.__eeprom_data, self._TLV_CODE_DEVICE_VERSION) + if not is_valid: + return "N/A" + + return results[2].decode('ascii') + + def system_eeprom_info(self): + """ + Returns a dictionary, where keys are the type code defined in + ONIE EEPROM format and values are their corresponding values + found in the system EEPROM. + """ + return self.__eeprom_tlv_dict + diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix8a-bwde-56x/sonic_platform/fan.py b/platform/broadcom/sonic-platform-modules-quanta/ix8a-bwde-56x/sonic_platform/fan.py new file mode 100644 index 000000000000..8aae9147c444 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix8a-bwde-56x/sonic_platform/fan.py @@ -0,0 +1,226 @@ +#!/usr/bin/env python + +############################################################################# +# Quanta IX8A-BWDE +# +# Module contains an implementation of SONiC Platform Base API and +# provides the FAN information +# +############################################################################# + +try: + import logging + import os + from sonic_platform_base.fan_base import FanBase +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +############### +# Global +############### +HWMON_DIR = "/sys/class/hwmon/hwmon2/" +FAN_INDEX_START = 18 +NUM_FANTRAYS = 6 +FANS_PERTRAY = 2 + +class Fan(FanBase): + """Platform-specific Fan class""" + + def __init__(self, index, is_psu_fan=False): + self.is_psu_fan = is_psu_fan + self.fan_index = index + self.psu_fan_index_mapping = { + 1:120, + 2:132, + } + self.psu_index_mapping = { + 1:114, + 2:126, + } + if self.is_psu_fan: + self.fan_presence_attr = "power{}_present".format(self.psu_index_mapping[index]) + self.fan_pwm_attr = "fan{}_pwm".format(self.psu_fan_index_mapping[index]) + self.fan_rpm_attr = "fan{}_input".format(self.psu_fan_index_mapping[index]) + self.fan_direction_attr = "fan{}_direction".format(self.psu_fan_index_mapping[index]) + else: + self.fan_presence_attr = "fan{}_present".format(FAN_INDEX_START+(index-1)) + self.fan_pwm_attr = "fan{}_pwm".format(FAN_INDEX_START+(index-1)) + self.fan_rpm_attr = "fan{}_input".format(FAN_INDEX_START+(index-1)) + self.fan_direction_attr = "fan{}_direction".format(FAN_INDEX_START+(index-1)) + + +####################### +# private function +####################### + + def __get_attr_value(self, attr_path): + + retval = 'ERR' + if (not os.path.isfile(attr_path)): + return retval + + try: + with open(attr_path, 'r') as fd: + retval = fd.read() + except Exception as error: + logging.error("Unable to open " + attr_path + " file !") + + retval = retval.rstrip(' \t\n\r') + return retval + + + #################### + # Device base + #################### + + def get_name(self): + """ + Retrieves the name of the device + + Returns: + string: The name of the device + """ + if self.is_psu_fan: + return "PSU-{}_FAN".format(self.fan_index) + else: + fantray_index = (self.fan_index-1)//FANS_PERTRAY+1 + fan_index_intray = self.fan_index - ((fantray_index-1)*FANS_PERTRAY) + return "Fantray{}_{}".format(fantray_index, fan_index_intray) + + def get_presence(self): + """ + Retrieves the presence of the device + + Returns: + bool: True if device is present, False if not + """ + attr_path = HWMON_DIR + self.fan_presence_attr + attr_rv = self.__get_attr_value(attr_path) + if (attr_rv != 'ERR'): + if (attr_rv == '1'): + return True + else: + return False + + return None + + def get_status(self): + """ + Retrieves the operational status of the device + + Returns: + A boolean value, True if device is operating properly, False if not + """ + if self.get_presence(): + attr_path = HWMON_DIR + self.fan_rpm_attr + attr_rv = self.__get_attr_value(attr_path) + + if (attr_rv != 'ERR' and attr_rv != '0.0'): + return True + else: + return False + else: + return False + + ################# + # fan base + ################# + + def get_direction(self): + """ + Retrieves the direction of fan + + Returns: + A string, either FAN_DIRECTION_INTAKE or FAN_DIRECTION_EXHAUST + depending on fan direction + """ + attr_path = HWMON_DIR + self.fan_direction_attr + attr_rv = self.__get_attr_value(attr_path) + + if attr_rv == '2': + return self.FAN_DIRECTION_INTAKE + else: + return self.FAN_DIRECTION_EXHAUST + + def get_speed(self): + """ + Retrieves the speed of fan as a percentage of full speed + + Returns: + An integer, the percentage of full fan speed, in the range 0 (off) + to 100 (full speed) + """ + if self.get_presence(): + attr_path = HWMON_DIR + self.fan_pwm_attr + attr_rv = self.__get_attr_value(attr_path) + + if (attr_rv != 'ERR'): + return int(float(attr_rv)) + else: + return False + else: + return 0 + + def get_speed_rpm(self): + """ + Retrieves the speed of fan in revolutions per minute (RPM) + + Returns: + An integer, speed of the fan in RPM + """ + attr_path = HWMON_DIR + self.fan_rpm_attr + attr_rv = self.__get_attr_value(attr_path) + + if (attr_rv != 'ERR'): + return int(float(attr_rv)) + else: + return False + + def get_target_speed(self): + """ + Retrieves the target (expected) speed of the fan + + Returns: + An integer, the percentage of full fan speed, in the range 0 (off) + to 100 (full speed) + """ + attr_path = HWMON_DIR + self.fan_pwm_attr + attr_rv = self.__get_attr_value(attr_path) + + if (attr_rv != 'ERR'): + return int(float(attr_rv)) + else: + return False + + def get_speed_tolerance(self): + """ + Retrieves the speed tolerance of the fan + + Returns: + An integer, the percentage of variance from target speed which is + considered tolerable + """ + return 25 + + def set_status_led(self, color): + """ + Sets the state of the fan module status LED + + Args: + color: A string representing the color with which to set the + fan module status LED + + Returns: + bool: True if status LED state is set successfully, False if not + """ + return True + + def get_status_led(self): + """ + Gets the state of the fan status LED + + Returns: + A string, one of the predefined STATUS_LED_COLOR_* strings above + """ + return None diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix8a-bwde-56x/sonic_platform/fan_drawer.py b/platform/broadcom/sonic-platform-modules-quanta/ix8a-bwde-56x/sonic_platform/fan_drawer.py new file mode 100644 index 000000000000..75e954576a28 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix8a-bwde-56x/sonic_platform/fan_drawer.py @@ -0,0 +1,47 @@ +#!/usr/bin/env python + +############################################################################# +# Quanta +# +# Module contains an implementation of SONiC Platform Base API and +# provides the fan status which are available in the platform +# +############################################################################# + +try: + from sonic_platform_base.fan_drawer_base import FanDrawerBase +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class FanDrawer(FanDrawerBase): + + def __init__(self, index, fan_list): + FanDrawerBase.__init__(self) + + self._fan_list = fan_list + self._index = index + + def get_name(self): + """ + Retrieves the name of the device + Returns: + string: The name of the device + """ + return 'Fan {}'.format(self._index) + + def get_presence(self): + """ + Retrieves the presence of the FAN + Returns: + bool: True if FAN is present, False if not + """ + return self._fan_list[0].get_presence() + + def get_status(self): + """ + Retrieves the operational status of the device + Returns: + A boolean value, True if device is operating properly, False if not + """ + return self._fan_list[0].get_status() diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix8a-bwde-56x/sonic_platform/platform.py b/platform/broadcom/sonic-platform-modules-quanta/ix8a-bwde-56x/sonic_platform/platform.py new file mode 100644 index 000000000000..8d20abef9009 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix8a-bwde-56x/sonic_platform/platform.py @@ -0,0 +1,20 @@ +#!/usr/bin/env python +# +# Name: platform.py, version: 1.0 +# +# Description: Module contains the definitions of SONiC platform APIs +# + + +try: + from sonic_platform_base.platform_base import PlatformBase + from sonic_platform.chassis import Chassis +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class Platform(PlatformBase): + + def __init__(self): + PlatformBase.__init__(self) + self._chassis = Chassis() diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix8a-bwde-56x/sonic_platform/psu.py b/platform/broadcom/sonic-platform-modules-quanta/ix8a-bwde-56x/sonic_platform/psu.py new file mode 100644 index 000000000000..bd3f4ce8089e --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix8a-bwde-56x/sonic_platform/psu.py @@ -0,0 +1,319 @@ +#!/usr/bin/env python +# +# Name: psu.py, version: 1.0 +# +# Description: Module contains the definitions of SONiC platform APIs +# + +try: + import logging + import os + from sonic_platform_base.psu_base import PsuBase + from sonic_platform.fan import Fan +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +HWMON_DIR = "/sys/class/hwmon/hwmon2/" + +class Psu(PsuBase): + def __init__(self, index): + PsuBase.__init__(self) + fan = Fan(index, True) + self._fan_list.append(fan) + + self.psu_index_mapping = { + 1:114, + 2:126, + } + self.psu_powerin_index_mapping = { + 1:119, + 2:131, + } + self.psu_currentout_index_mapping = { + 1:130, + 2:115, + } + self.psu_currentin_index_mapping = { + 1:130, + 2:115, + } + self.psu_voltageout_index_mapping = { + 1:129, + 2:124, + } + self.psu_voltagein_index_mapping = { + 1:125, + 2:128, + } + self.index = index + self.psu_presence_attr = "power{}_present".format(self.psu_index_mapping[self.index]) + self.psu_status_attr = "curr{}_input".format(self.psu_currentout_index_mapping[self.index]) + self.psu_power_in_attr = "power{}_input".format(self.psu_powerin_index_mapping[self.index]) + self.psu_power_out_attr = "power{}_input".format(self.psu_index_mapping[self.index]) + self.psu_voltage_out_attr = "in{}_input".format(self.psu_voltageout_index_mapping[self.index]) + self.psu_current_out_attr = "curr{}_input".format(self.psu_currentout_index_mapping[self.index]) + self.psu_voltage_in_attr = "in{}_input".format(self.psu_voltagein_index_mapping[self.index]) + self.psu_current_in_attr = "curr{}_input".format(self.psu_currentin_index_mapping[self.index]) + self.psu_serial_attr = "power{}_sn".format(self.psu_index_mapping[self.index]) + self.psu_model_attr = "power{}_model".format(self.psu_index_mapping[self.index]) + self.psu_mfr_id_attr = "power{}_mfrid".format(self.psu_index_mapping[self.index]) + self.psu_capacity_attr = "power{}_pout_max".format(self.psu_index_mapping[self.index]) + self.psu_type_attr = "power{}_vin_type".format(self.psu_index_mapping[self.index]) + + def __get_attr_value(self, attr_path): + + retval = 'ERR' + if (not os.path.isfile(attr_path)): + return retval + + try: + with open(attr_path, 'r') as fd: + retval = fd.read() + except Exception as error: + logging.error("Unable to open " + attr_path + " file !") + + retval = retval.rstrip(' \t\n\r') + fd.close() + return retval + +############################################## +# Device methods +############################################## + + def get_name(self): + """ + Retrieves the name of the device + + Returns: + string: The name of the device + """ + return "PSU{}".format(self.index) + + def get_presence(self): + """ + Retrieves the presence of the device + + Returns: + bool: True if device is present, False if not + """ + presence = False + attr_path = HWMON_DIR+self.psu_presence_attr + attr_normal = '1' + + attr_rv = self.__get_attr_value(attr_path) + if (attr_rv != 'ERR'): + if (attr_rv == attr_normal): + presence = True + + return presence + + def get_model(self): + """ + Retrieves the model number (or part number) of the device + + Returns: + string: Model/part number of device + """ + model = "N/A" + attr_path = HWMON_DIR+self.psu_model_attr + attr_rv = self.__get_attr_value(attr_path) + if (attr_rv != 'ERR'): + model = attr_rv + + return model + + def get_mfr_id(self): + """ + Retrieves the manufacturer's name (or id) of the device + + Returns: + string: Manufacturer's id of device + """ + mfr_id = "N/A" + attr_path = HWMON_DIR+self.psu_mfr_id_attr + attr_rv = self.__get_attr_value(attr_path) + if (attr_rv != 'ERR'): + mfr_id = attr_rv + + return mfr_id + + def get_serial(self): + """ + Retrieves the serial number of the device + + Returns: + string: Serial number of device + """ + serial = "N/A" + attr_path = HWMON_DIR+self.psu_serial_attr + + attr_rv = self.__get_attr_value(attr_path) + if (attr_rv != 'ERR'): + serial = attr_rv + + return serial + + def get_status(self): + """ + Retrieves the operational status of the device + + Returns: + A boolean value, True if device is operating properly, False if not + """ + status = False + attr_path = HWMON_DIR+self.psu_status_attr + + attr_rv = self.__get_attr_value(attr_path) + if (attr_rv != 'ERR'): + attr_rv, dummy = attr_rv.split('.', 1) + if (int(attr_rv) != 0): + status = True + + return status + +############################################## +# PSU methods +############################################## + + def get_voltage(self): + """ + Retrieves current PSU voltage output + + Returns: + A float number, the output voltage in volts, + e.g. 12.1 + """ + voltage_out = 0.0 + attr_path = HWMON_DIR+self.psu_voltage_out_attr + + attr_rv = self.__get_attr_value(attr_path) + if (attr_rv != 'ERR'): + attr_rv, dummy = attr_rv.split('.', 1) + voltage_out = float(attr_rv) / 1000 + + return voltage_out + + def get_current(self): + """ + Retrieves present electric current supplied by PSU + + Returns: + A float number, the electric current in amperes, e.g 15.4 + """ + current_out = 0.0 + attr_path = HWMON_DIR+self.psu_current_out_attr + + attr_rv = self.__get_attr_value(attr_path) + if (attr_rv != 'ERR'): + attr_rv, dummy = attr_rv.split('.', 1) + current_out = float(attr_rv) / 1000 + + return current_out + + def get_input_voltage(self): + """ + Retrieves current PSU voltage output + + Returns: + A float number, the output voltage in volts, + e.g. 12.1 + """ + voltage_in = 0.0 + attr_path = HWMON_DIR+self.psu_voltage_in_attr + + attr_rv = self.__get_attr_value(attr_path) + if (attr_rv != 'ERR'): + attr_rv, dummy = attr_rv.split('.', 1) + voltage_in = float(attr_rv) / 1000 + + return voltage_in + + def get_input_current(self): + """ + Retrieves present electric current supplied by PSU + + Returns: + A float number, the electric current in amperes, e.g 15.4 + """ + current_in = 0.0 + attr_path = HWMON_DIR+self.psu_current_in_attr + + attr_rv = self.__get_attr_value(attr_path) + if (attr_rv != 'ERR'): + attr_rv, dummy = attr_rv.split('.', 1) + current_in = float(attr_rv) / 1000 + + return current_in + + def get_power(self): + """ + Retrieves current energy supplied by PSU + + Returns: + A float number, the power in watts, e.g. 302.6 + """ + power_out = 0.0 + attr_path = HWMON_DIR+self.psu_power_out_attr + + attr_rv = self.__get_attr_value(attr_path) + if (attr_rv != 'ERR'): + attr_rv, dummy = attr_rv.split('.', 1) + power_out = float(attr_rv) / 1000 + + return power_out + + def get_powergood_status(self): + """ + Retrieves the powergood status of PSU + + Returns: + A boolean, True if PSU has stablized its output voltages and passed all + its internal self-tests, False if not. + """ + return self.get_status() + + def get_status_led(self): + """ + Gets the state of the PSU status LED + + Returns: + A string, one of the predefined STATUS_LED_COLOR_* strings above + """ + if self.get_powergood_status(): + return self.STATUS_LED_COLOR_GREEN + else: + return self.STATUS_LED_COLOR_OFF + + def get_type(self): + """ + Gets the type of the PSU + + Returns: + A string, the type of PSU (AC/DC) + """ + type = "AC" + attr_path = HWMON_DIR+self.psu_type_attr + attr_rv = self.__get_attr_value(attr_path) + if (attr_rv != 'ERR'): + type = attr_rv + + return type + + def get_capacity(self): + """ + Gets the capacity (maximum output power) of the PSU in watts + + Returns: + An integer, the capacity of PSU + """ + capacity = 0 + attr_path = HWMON_DIR+self.psu_capacity_attr + attr_rv = self.__get_attr_value(attr_path) + if (attr_rv != 'ERR'): + try: + capacity = int(attr_rv) + except ValueError: + capacity = 0 + + return capacity + diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix8a-bwde-56x/sonic_platform/sfp.py b/platform/broadcom/sonic-platform-modules-quanta/ix8a-bwde-56x/sonic_platform/sfp.py new file mode 100644 index 000000000000..3b75b6927578 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix8a-bwde-56x/sonic_platform/sfp.py @@ -0,0 +1,1633 @@ +#!/usr/bin/env python + +############################################################################# +# Quanta +# +# Sfp contains an implementation of SONiC Platform Base API and +# provides the sfp device status which are available in the platform +# +############################################################################# + +import os +import time +#import subprocess +#import sonic_device_util +from ctypes import create_string_buffer + +try: + from sonic_platform_base.sfp_base import SfpBase +# from sonic_platform_base.sonic_eeprom import eeprom_dts + from sonic_platform_base.sonic_sfp.sff8472 import sff8472InterfaceId + from sonic_platform_base.sonic_sfp.sff8472 import sff8472Dom + from sonic_platform_base.sonic_sfp.sff8436 import sff8436InterfaceId + from sonic_platform_base.sonic_sfp.sff8436 import sff8436Dom + from sonic_platform_base.sonic_sfp.sfputilhelper import SfpUtilHelper +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +QSFP_INFO_OFFSET = 128 +QSFP_DOM_OFFSET = 0 +SFP_INFO_OFFSET = 0 +SFP_DOM_OFFSET = 256 + +# definitions of the offset and width for values in XCVR info eeprom +XCVR_INTFACE_BULK_OFFSET = 0 +XCVR_INTFACE_BULK_WIDTH_QSFP = 20 +XCVR_INTFACE_BULK_WIDTH_SFP = 21 +XCVR_TYPE_OFFSET = 0 +XCVR_TYPE_WIDTH = 1 +XCVR_EXT_TYPE_OFFSET = 1 +XCVR_EXT_TYPE_WIDTH = 1 +XCVR_CONNECTOR_OFFSET = 2 +XCVR_CONNECTOR_WIDTH = 1 +XCVR_COMPLIANCE_CODE_OFFSET = 3 +XCVR_COMPLIANCE_CODE_WIDTH = 8 +XCVR_ENCODING_OFFSET = 11 +XCVR_ENCODING_WIDTH = 1 +XCVR_NBR_OFFSET = 12 +XCVR_NBR_WIDTH = 1 +XCVR_EXT_RATE_SEL_OFFSET = 13 +XCVR_EXT_RATE_SEL_WIDTH = 1 +XCVR_CABLE_LENGTH_OFFSET = 14 +XCVR_CABLE_LENGTH_WIDTH_QSFP = 5 +XCVR_CABLE_LENGTH_WIDTH_SFP = 6 +XCVR_VENDOR_NAME_OFFSET = 20 +XCVR_VENDOR_NAME_WIDTH = 16 +XCVR_VENDOR_OUI_OFFSET = 37 +XCVR_VENDOR_OUI_WIDTH = 3 +XCVR_VENDOR_PN_OFFSET = 40 +XCVR_VENDOR_PN_WIDTH = 16 +XCVR_HW_REV_OFFSET = 56 +XCVR_HW_REV_WIDTH_QSFP = 2 +XCVR_HW_REV_WIDTH_SFP = 4 +XCVR_VENDOR_SN_OFFSET = 68 +XCVR_VENDOR_SN_WIDTH = 16 +XCVR_VENDOR_DATE_OFFSET = 84 +XCVR_VENDOR_DATE_WIDTH = 8 +XCVR_DOM_CAPABILITY_OFFSET = 92 +XCVR_DOM_CAPABILITY_WIDTH = 2 + +XCVR_INTERFACE_DATA_START = 0 +XCVR_INTERFACE_DATA_SIZE = 92 + +QSFP_DOM_BULK_DATA_START = 22 +QSFP_DOM_BULK_DATA_SIZE = 36 +SFP_DOM_BULK_DATA_START = 96 +SFP_DOM_BULK_DATA_SIZE = 10 + +# Offset for values in QSFP eeprom +QSFP_DOM_REV_OFFSET = 1 +QSFP_DOM_REV_WIDTH = 1 +QSFP_TEMPE_OFFSET = 22 +QSFP_TEMPE_WIDTH = 2 +QSFP_VOLT_OFFSET = 26 +QSFP_VOLT_WIDTH = 2 +QSFP_VERSION_COMPLIANCE_OFFSET = 1 +QSFP_VERSION_COMPLIANCE_WIDTH = 1 +QSFP_CHANNL_MON_OFFSET = 34 +QSFP_CHANNL_MON_WIDTH = 16 +QSFP_CHANNL_MON_WITH_TX_POWER_WIDTH = 24 +QSFP_CHANNL_DISABLE_STATUS_OFFSET = 86 +QSFP_CHANNL_DISABLE_STATUS_WIDTH = 1 +QSFP_CHANNL_RX_LOS_STATUS_OFFSET = 3 +QSFP_CHANNL_RX_LOS_STATUS_WIDTH = 1 +QSFP_CHANNL_TX_FAULT_STATUS_OFFSET = 4 +QSFP_CHANNL_TX_FAULT_STATUS_WIDTH = 1 +QSFP_CONTROL_OFFSET = 86 +QSFP_CONTROL_WIDTH = 8 +QSFP_MODULE_MONITOR_OFFSET = 0 +QSFP_MODULE_MONITOR_WIDTH = 9 +QSFP_MODULE_THRESHOLD_OFFSET = 512 +QSFP_MODULE_THRESHOLD_WIDTH = 24 +QSFP_CHANNEL_THRESHOLD_OFFSET = 560 +QSFP_CHANNEL_THRESHOLD_WIDTH = 16 +QSFP_POWEROVERRIDE_OFFSET = 93 +QSFP_POWEROVERRIDE_WIDTH = 1 +QSFP_POWEROVERRIDE_BIT = 0 +QSFP_POWERSET_BIT = 1 +QSFP_OPTION_VALUE_OFFSET = 192 +QSFP_OPTION_VALUE_WIDTH = 4 + +SFP_TEMPE_OFFSET = 96 +SFP_TEMPE_WIDTH = 2 +SFP_VOLT_OFFSET = 98 +SFP_VOLT_WIDTH = 2 +SFP_CHANNL_MON_OFFSET = 100 +SFP_CHANNL_MON_WIDTH = 6 +SFP_MODULE_THRESHOLD_OFFSET = 0 +SFP_MODULE_THRESHOLD_WIDTH = 40 +SFP_CHANNL_THRESHOLD_OFFSET = 112 +SFP_CHANNL_THRESHOLD_WIDTH = 2 +SFP_STATUS_CONTROL_OFFSET = 110 +SFP_STATUS_CONTROL_WIDTH = 1 +SFP_TX_DISABLE_HARD_BIT = 7 +SFP_TX_DISABLE_SOFT_BIT = 6 + +qsfp_cable_length_tup = ('Length(km)', 'Length OM3(2m)', + 'Length OM2(m)', 'Length OM1(m)', + 'Length Cable Assembly(m)') + +sfp_cable_length_tup = ('LengthSMFkm-UnitsOfKm', 'LengthSMF(UnitsOf100m)', + 'Length50um(UnitsOf10m)', 'Length62.5um(UnitsOfm)', + 'LengthCable(UnitsOfm)', 'LengthOM3(UnitsOf10m)') + +sfp_compliance_code_tup = ('10GEthernetComplianceCode', 'InfinibandComplianceCode', + 'ESCONComplianceCodes', 'SONETComplianceCodes', + 'EthernetComplianceCodes','FibreChannelLinkLength', + 'FibreChannelTechnology', 'SFP+CableTechnology', + 'FibreChannelTransmissionMedia','FibreChannelSpeed') + +qsfp_compliance_code_tup = ('10/40G Ethernet Compliance Code', 'SONET Compliance codes', + 'SAS/SATA compliance codes', 'Gigabit Ethernet Compliant codes', + 'Fibre Channel link length/Transmitter Technology', + 'Fibre Channel transmission media', 'Fibre Channel Speed') + +SFP_TYPE = "SFP" +QSFP_TYPE = "QSFP" + + +class Sfp(SfpBase): + """Platform-specific Sfp class""" + + # Port number + PORT_START = 1 + PORT_END = 56 + QSFP_START = 49 + QSFP_END = 56 + + dom_supported = True + dom_temp_supported = True + dom_volt_supported = True + dom_rx_power_supported = True + dom_tx_power_supported = True + dom_tx_disable_supported = True + calibration = 1 + + # Path to QSFP sysfs + PLATFORM_ROOT_PATH = "/usr/share/sonic/device" + PMON_HWSKU_PATH = "/usr/share/sonic/hwsku" + HOST_CHK_CMD = "docker > /dev/null 2>&1" + + PLATFORM = "x86_64-quanta_ix8a_bwde-r0" + HWSKU = "Quanta-IX8A-BWDE-56X" + + def __init__(self, sfp_index, sfp_type): + # Init index + self.index = sfp_index + self.port_num = self.index + #self.dom_supported = False + self.sfp_type = sfp_type + # Init eeprom path + eeprom_path = '/sys/bus/i2c/devices/i2c-{0}/{0}-0050/eeprom' + self.port_to_eeprom_mapping = {} + self.port_to_i2c_mapping = { + 1 : 13, + 2 : 14, + 3 : 15, + 4 : 16, + 5 : 17, + 6 : 18, + 7 : 19, + 8 : 20, + 9 : 21, + 10 : 22, + 11 : 23, + 12 : 24, + 13 : 25, + 14 : 26, + 15 : 27, + 16 : 28, + 17 : 29, + 18 : 30, + 19 : 31, + 20 : 32, + 21 : 33, + 22 : 34, + 23 : 35, + 24 : 36, + 25 : 37, + 26 : 38, + 27 : 39, + 28 : 40, + 29 : 41, + 30 : 42, + 31 : 43, + 32 : 44, + 33 : 45, + 34 : 46, + 35 : 47, + 36 : 48, + 37 : 49, + 38 : 50, + 39 : 51, + 40 : 52, + 41 : 53, + 42 : 54, + 43 : 55, + 44 : 56, + 45 : 57, + 46 : 58, + 47 : 59, + 48 : 60, + 49 : 61,#QSFP49 + 50 : 62,#QSFP50 + 51 : 63,#QSFP51 + 52 : 64,#QSFP52 + 53 : 65,#QSFP53 + 54 : 66,#QSFP54 + 55 : 67,#QSFP55 + 56 : 68,#QSFP56 + } + + for x in range(self.PORT_START, self.PORT_END + 1): + port_eeprom_path = eeprom_path.format(self.port_to_i2c_mapping[x]) + self.port_to_eeprom_mapping[x] = port_eeprom_path + + self.info_dict_keys = ['type', 'hardware_rev', 'serial', 'manufacturer', + 'model', 'connector', 'encoding', 'ext_identifier', + 'ext_rateselect_compliance', 'cable_type', 'cable_length', + 'nominal_bit_rate', 'specification_compliance', 'vendor_date', + 'vendor_oui', 'application_advertisement'] + + self.dom_dict_keys = ['rx_los', 'tx_fault', 'reset_status', 'power_lpmode', + 'tx_disable', 'tx_disable_channel', 'temperature', 'voltage', + 'rx1power', 'rx2power', 'rx3power', 'rx4power', 'tx1bias', 'tx2bias', + 'tx3bias', 'tx4bias', 'tx1power', 'tx2power', 'tx3power', 'tx4power'] + + self.threshold_dict_keys = ['temphighalarm', 'temphighwarning', + 'templowalarm', 'templowwarning', 'vcchighalarm', 'vcchighwarning', + 'vcclowalarm', 'vcclowwarning', 'rxpowerhighalarm', 'rxpowerhighwarning', + 'rxpowerlowalarm', 'rxpowerlowwarning', 'txpowerhighalarm', + 'txpowerhighwarning', 'txpowerlowalarm', 'txpowerlowwarning', + 'txbiashighalarm', 'txbiashighwarning', 'txbiaslowalarm', 'txbiaslowwarning'] + + SfpBase.__init__(self) + + + def _convert_string_to_num(self, value_str): + if "-inf" in value_str: + return 'N/A' + elif "Unknown" in value_str: + return 'N/A' + elif 'dBm' in value_str: + t_str = value_str.rstrip('dBm') + return float(t_str) + elif 'mA' in value_str: + t_str = value_str.rstrip('mA') + return float(t_str) + elif 'C' in value_str: + t_str = value_str.rstrip('C') + return float(t_str) + elif 'Volts' in value_str: + t_str = value_str.rstrip('Volts') + return float(t_str) + else: + return 'N/A' + + def __read_txt_file(self, file_path): + try: + with open(file_path, 'r') as fd: + data = fd.read() + return data.strip() + except IOError: + pass + return "" + + def __is_host(self): + return os.system(self.HOST_CHK_CMD) == 0 + + def __get_path_to_port_config_file(self): + platform_path = "/".join([self.PLATFORM_ROOT_PATH, self.PLATFORM]) + hwsku_path = "/".join([platform_path, self.HWSKU] + ) if self.__is_host() else self.PMON_HWSKU_PATH + return "/".join([hwsku_path, "port_config.ini"]) + + def get_presence(self): + """ + Retrieves the presence of the SFP module + Returns: + bool: True if SFP module is present, False if not + """ + # Check for invalid port_num + if self.port_num < self.PORT_START or self.port_num > self.PORT_END: + return False + + try: + if self.sfp_type == SFP_TYPE: + reg_file = open("/sys/class/cpld-sfp28/port-"+str(self.port_num)+"/pre_n") + else: + reg_file = open("/sys/class/gpio/gpio" + +str((self.port_num-self.QSFP_START)*4+34)+"/value") + except IOError as e: + print("Error: unable to open file: %s" % str(e)) + return False + + reg_value = reg_file.readline().rstrip() + reg_file.close() + if self.sfp_type == SFP_TYPE: + if reg_value == '1': + return True + else: + if reg_value == '0': + return True + + return False + + def __read_eeprom_specific_bytes(self, offset, num_bytes): + sysfsfile_eeprom = None + eeprom_raw = [] + for i in range(0, num_bytes): + eeprom_raw.append("0x00") + + sysfs_sfp_i2c_client_eeprom_path = self.port_to_eeprom_mapping[self.port_num] + try: + sysfsfile_eeprom = open( + sysfs_sfp_i2c_client_eeprom_path, mode="rb", buffering=0) + sysfsfile_eeprom.seek(offset) + raw = sysfsfile_eeprom.read(num_bytes) + for n in range(0, num_bytes): + eeprom_raw[n] = hex(raw[n])[2:].zfill(2) + except Exception: + eeprom_raw = None + finally: + if sysfsfile_eeprom: + sysfsfile_eeprom.close() + + return eeprom_raw + + def __convert_string_to_num(self, value_str): + if "-inf" in value_str: + return 'N/A' + elif "Unknown" in value_str: + return 'N/A' + elif 'dBm' in value_str: + t_str = value_str.rstrip('dBm') + return float(t_str) + elif 'mA' in value_str: + t_str = value_str.rstrip('mA') + return float(t_str) + elif 'C' in value_str: + t_str = value_str.rstrip('C') + return float(t_str) + elif 'Volts' in value_str: + t_str = value_str.rstrip('Volts') + return float(t_str) + else: + return 'N/A' + + def _dom_capability_detect(self): + if not self.get_presence(): + self.dom_supported = False + self.dom_temp_supported = False + self.dom_volt_supported = False + self.dom_rx_power_supported = False + self.dom_tx_power_supported = False + self.calibration = 0 + return + + if self.sfp_type == "QSFP": + self.calibration = 1 + sfpi_obj = sff8436InterfaceId() + if sfpi_obj is None: + self.dom_supported = False + offset = 128 + + # QSFP capability byte parse, through this byte can know whether it support tx_power or not. + # TODO: in the future when decided to migrate to support SFF-8636 instead of SFF-8436, + # need to add more code for determining the capability and version compliance + # in SFF-8636 dom capability definitions evolving with the versions. + qsfp_dom_capability_raw = self.__read_eeprom_specific_bytes( + (offset + XCVR_DOM_CAPABILITY_OFFSET), XCVR_DOM_CAPABILITY_WIDTH) + if qsfp_dom_capability_raw is not None: + qsfp_dom_capability = int(qsfp_dom_capability_raw[0], 16) + + qsfp_version_compliance_raw = self.__read_eeprom_specific_bytes( + QSFP_VERSION_COMPLIANCE_OFFSET, QSFP_VERSION_COMPLIANCE_OFFSET) + if qsfp_version_compliance_raw is not None: + qsfp_version_compliance = int(qsfp_version_compliance_raw[0], 16) + else: + self.dom_supported = False + self.dom_temp_supported = False + self.dom_volt_supported = False + self.dom_rx_power_supported = False + self.dom_tx_power_supported = False + self.calibration = 0 + return + + if qsfp_version_compliance >= 0x08: + self.dom_temp_supported = (qsfp_dom_capability & 0x20 != 0) + self.dom_volt_supported = (qsfp_dom_capability & 0x10 != 0) + self.dom_rx_power_supported = (qsfp_dom_capability & 0x08 != 0) + self.dom_tx_power_supported = (qsfp_dom_capability & 0x04 != 0) + else: + self.dom_temp_supported = True + self.dom_volt_supported = True + self.dom_rx_power_supported = (qsfp_dom_capability & 0x08 != 0) + self.dom_tx_power_supported = True + self.dom_supported = True + self.calibration = 1 + self.dom_tx_disable_supported = True + else: + self.dom_supported = False + self.dom_temp_supported = False + self.dom_volt_supported = False + self.dom_rx_power_supported = False + self.dom_tx_power_supported = False + self.calibration = 0 + elif self.sfp_type == "SFP": + sfpi_obj = sff8472InterfaceId() + if sfpi_obj is None: + return None + sfp_dom_capability_raw = self.__read_eeprom_specific_bytes( + XCVR_DOM_CAPABILITY_OFFSET, XCVR_DOM_CAPABILITY_WIDTH) + if sfp_dom_capability_raw is not None: + sfp_dom_capability = int(sfp_dom_capability_raw[0], 16) + self.dom_supported = (sfp_dom_capability & 0x40 != 0) + if self.dom_supported: + self.dom_temp_supported = True + self.dom_volt_supported = True + self.dom_rx_power_supported = True + self.dom_tx_power_supported = True + if sfp_dom_capability & 0x20 != 0: + self.calibration = 1 + elif sfp_dom_capability & 0x10 != 0: + self.calibration = 2 + else: + self.calibration = 0 + else: + self.dom_temp_supported = False + self.dom_volt_supported = False + self.dom_rx_power_supported = False + self.dom_tx_power_supported = False + self.calibration = 0 + self.dom_tx_disable_supported = (int(sfp_dom_capability_raw[1], 16) & 0x40 != 0) + else: + self.dom_supported = False + self.dom_temp_supported = False + self.dom_volt_supported = False + self.dom_rx_power_supported = False + self.dom_tx_power_supported = False + + def get_transceiver_info(self): + """ + Retrieves transceiver info of this SFP + Returns: + A dict which contains following keys/values : + ======================================================================== + keys |Value Format |Information + ---------------------------|---------------|---------------------------- + type |1*255VCHAR |type of SFP + hardware_rev |1*255VCHAR |hardware version of SFP + serial |1*255VCHAR |serial number of the SFP + manufacturer |1*255VCHAR |SFP vendor name + model |1*255VCHAR |SFP model name + connector |1*255VCHAR |connector information + encoding |1*255VCHAR |encoding information + ext_identifier |1*255VCHAR |extend identifier + ext_rateselect_compliance |1*255VCHAR |extended rateSelect compliance + cable_length |INT |cable length in m + nominal_bit_rate |INT |nominal bit rate by 100Mbs + specification_compliance |1*255VCHAR |specification compliance + vendor_date |1*255VCHAR |vendor date + vendor_oui |1*255VCHAR |vendor OUI + application_advertisement |1*255VCHAR |supported applications advertisement + ======================================================================== + """ + + transceiver_info_dict = {} + compliance_code_dict = {} + transceiver_info_dict = dict.fromkeys(self.info_dict_keys, 'N/A') + transceiver_info_dict['specification_compliance'] = '{}' + if not self.get_presence(): + return transceiver_info_dict + + if self.sfp_type == QSFP_TYPE: + offset = QSFP_INFO_OFFSET + vendor_rev_width = XCVR_HW_REV_WIDTH_QSFP + interface_info_bulk_width = XCVR_INTFACE_BULK_WIDTH_QSFP + + sfpi_obj = sff8436InterfaceId() + if sfpi_obj is None: + print("Error: sfp_object open failed") + return transceiver_info_dict + + elif self.sfp_type == SFP_TYPE: + offset = SFP_INFO_OFFSET + vendor_rev_width = XCVR_HW_REV_WIDTH_SFP + interface_info_bulk_width = XCVR_INTFACE_BULK_WIDTH_SFP + + sfpi_obj = sff8472InterfaceId() + if sfpi_obj is None: + print("Error: sfp_object open failed") + return transceiver_info_dict + else: + return transceiver_info_dict + + # Add retry for xcvr eeprom to get ready + max_retry = 10 + for i in range(0,max_retry): + sfp_interface_bulk_raw = self.__read_eeprom_specific_bytes( + offset + XCVR_INTERFACE_DATA_START, XCVR_INTERFACE_DATA_SIZE) + if sfp_interface_bulk_raw is not None: + break + else: + if not self.get_presence(): + return transceiver_info_dict + elif i == max_retry-1: + pass + else: + time.sleep(0.5) + + if sfp_interface_bulk_raw is None: + return transceiver_info_dict + + start = XCVR_INTFACE_BULK_OFFSET - XCVR_INTERFACE_DATA_START + end = start + interface_info_bulk_width + sfp_interface_bulk_data = sfpi_obj.parse_sfp_info_bulk(sfp_interface_bulk_raw[start : end], 0) + + start = XCVR_VENDOR_NAME_OFFSET - XCVR_INTERFACE_DATA_START + end = start + XCVR_VENDOR_NAME_WIDTH + sfp_vendor_name_data = sfpi_obj.parse_vendor_name(sfp_interface_bulk_raw[start : end], 0) + + start = XCVR_VENDOR_PN_OFFSET - XCVR_INTERFACE_DATA_START + end = start + XCVR_VENDOR_PN_WIDTH + sfp_vendor_pn_data = sfpi_obj.parse_vendor_pn(sfp_interface_bulk_raw[start : end], 0) + + start = XCVR_HW_REV_OFFSET - XCVR_INTERFACE_DATA_START + end = start + vendor_rev_width + sfp_vendor_rev_data = sfpi_obj.parse_vendor_rev(sfp_interface_bulk_raw[start : end], 0) + + start = XCVR_VENDOR_SN_OFFSET - XCVR_INTERFACE_DATA_START + end = start + XCVR_VENDOR_SN_WIDTH + sfp_vendor_sn_data = sfpi_obj.parse_vendor_sn(sfp_interface_bulk_raw[start : end], 0) + + start = XCVR_VENDOR_OUI_OFFSET - XCVR_INTERFACE_DATA_START + end = start + XCVR_VENDOR_OUI_WIDTH + sfp_vendor_oui_data = sfpi_obj.parse_vendor_oui(sfp_interface_bulk_raw[start : end], 0) + + start = XCVR_VENDOR_DATE_OFFSET - XCVR_INTERFACE_DATA_START + end = start + XCVR_VENDOR_DATE_WIDTH + sfp_vendor_date_data = sfpi_obj.parse_vendor_date(sfp_interface_bulk_raw[start : end], 0) + transceiver_info_dict['type'] = sfp_interface_bulk_data \ + ['data']['type']['value'] + transceiver_info_dict['manufacturer'] = sfp_vendor_name_data \ + ['data']['Vendor Name']['value'] + transceiver_info_dict['model'] = sfp_vendor_pn_data \ + ['data']['Vendor PN']['value'] + transceiver_info_dict['hardware_rev'] = sfp_vendor_rev_data \ + ['data']['Vendor Rev']['value'] + transceiver_info_dict['serial'] = sfp_vendor_sn_data \ + ['data']['Vendor SN']['value'] + transceiver_info_dict['vendor_oui'] = sfp_vendor_oui_data \ + ['data']['Vendor OUI']['value'] + transceiver_info_dict['vendor_date'] = sfp_vendor_date_data \ + ['data']['VendorDataCode(YYYY-MM-DD Lot)']['value'] + transceiver_info_dict['connector'] = sfp_interface_bulk_data \ + ['data']['Connector']['value'] + transceiver_info_dict['encoding'] = sfp_interface_bulk_data \ + ['data']['EncodingCodes']['value'] + transceiver_info_dict['ext_identifier'] = sfp_interface_bulk_data \ + ['data']['Extended Identifier']['value'] + transceiver_info_dict['ext_rateselect_compliance'] = sfp_interface_bulk_data \ + ['data']['RateIdentifier']['value'] + transceiver_info_dict['type_abbrv_name'] = 'N/A' + if self.sfp_type == QSFP_TYPE: + for key in qsfp_cable_length_tup: + if key in sfp_interface_bulk_data['data']: + transceiver_info_dict['cable_type'] = key + transceiver_info_dict['cable_length'] = str( + sfp_interface_bulk_data['data'][key]['value']) + + for key in qsfp_compliance_code_tup: + if key in sfp_interface_bulk_data['data']['Specification compliance']['value']: + compliance_code_dict[key] = sfp_interface_bulk_data \ + ['data']['Specification compliance']['value'][key]['value'] + transceiver_info_dict['specification_compliance'] = str(compliance_code_dict) + + transceiver_info_dict['nominal_bit_rate'] = str(sfp_interface_bulk_data \ + ['data']['Nominal Bit Rate(100Mbs)']['value']) + else: + for key in sfp_cable_length_tup: + if key in sfp_interface_bulk_data['data']: + transceiver_info_dict['cable_type'] = key + transceiver_info_dict['cable_length'] = str( + sfp_interface_bulk_data['data'][key]['value']) + + for key in sfp_compliance_code_tup: + if key in sfp_interface_bulk_data['data']['Specification compliance']['value']: + compliance_code_dict[key] = sfp_interface_bulk_data \ + ['data']['Specification compliance']['value'][key]['value'] + transceiver_info_dict['specification_compliance'] = str(compliance_code_dict) + + transceiver_info_dict['nominal_bit_rate'] = str(sfp_interface_bulk_data \ + ['data']['NominalSignallingRate(UnitsOf100Mbd)']['value']) + + return transceiver_info_dict + + def get_transceiver_bulk_status(self): + """ + Retrieves transceiver bulk status of this SFP + Returns: + A dict which contains following keys/values : + ======================================================================== + keys |Value Format |Information + ---------------------------|---------------|---------------------------- + rx_los |BOOLEAN |RX loss-of-signal status, True if has RX los, False if not. + tx_fault |BOOLEAN |TX fault status, True if has TX fault, False if not. + reset_status |BOOLEAN |reset status, True if SFP in reset, False if not. + lp_mode |BOOLEAN |low power mode status, True in lp mode, False if not. + tx_disable |BOOLEAN |TX disable status, True TX disabled, False if not. + tx_disabled_channel |HEX |disabled TX channels in hex, bits 0 to 3 represent channel 0 + | |to channel 3. + temperature |INT |module temperature in Celsius + voltage |INT |supply voltage in mV + txbias |INT |TX Bias Current in mA, n is the channel number, + | |for example, tx2bias stands for tx bias of channel 2. + rxpower |INT |received optical power in mW, n is the channel number, + | |for example, rx2power stands for rx power of channel 2. + txpower |INT |TX output power in mW, n is the channel number, + | |for example, tx2power stands for tx power of channel 2. + ======================================================================== + """ + + if not self.get_presence(): + return {} + + self._dom_capability_detect() + + if self.sfp_type == QSFP_TYPE: + sfpd_obj = sff8436Dom() + sfpi_obj = sff8436InterfaceId() + + if not sfpi_obj or not sfpd_obj: + return {} + + transceiver_dom_info_dict = dict.fromkeys(self.dom_dict_keys, 'N/A') + offset = QSFP_DOM_OFFSET + offset_xcvr = QSFP_INFO_OFFSET + + # QSFP capability byte parse, through this byte can know whether it support tx_power or not. + # TODO: in the future when decided to migrate to support SFF-8636 instead of SFF-8436, + # need to add more code for determining the capability and version compliance + # in SFF-8636 dom capability definitions evolving with the versions. + qsfp_dom_capability_raw = self.__read_eeprom_specific_bytes( + (offset_xcvr + XCVR_DOM_CAPABILITY_OFFSET), XCVR_DOM_CAPABILITY_WIDTH) + if qsfp_dom_capability_raw is not None: + qsfp_dom_capability_data = sfpi_obj.parse_dom_capability( + qsfp_dom_capability_raw, 0) + else: + return None + + dom_temperature_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_TEMPE_OFFSET), QSFP_TEMPE_WIDTH) + if dom_temperature_raw is not None: + dom_temperature_data = sfpd_obj.parse_temperature( + dom_temperature_raw, 0) + transceiver_dom_info_dict['temperature'] = dom_temperature_data['data']['Temperature']['value'] + + dom_voltage_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_VOLT_OFFSET), QSFP_VOLT_WIDTH) + if dom_voltage_raw is not None: + dom_voltage_data = sfpd_obj.parse_voltage(dom_voltage_raw, 0) + transceiver_dom_info_dict['voltage'] = dom_voltage_data['data']['Vcc']['value'] + + qsfp_dom_rev_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_DOM_REV_OFFSET), QSFP_DOM_REV_WIDTH) + if qsfp_dom_rev_raw is not None: + qsfp_dom_rev_data = sfpd_obj.parse_sfp_dom_rev(qsfp_dom_rev_raw, 0) + qsfp_dom_rev = qsfp_dom_rev_data['data']['dom_rev']['value'] + + # The tx_power monitoring is only available on QSFP which compliant with SFF-8636 + # and claimed that it support tx_power with one indicator bit. + dom_channel_monitor_data = {} + dom_channel_monitor_raw = None + qsfp_tx_power_support = qsfp_dom_capability_data['data']['Tx_power_support']['value'] + if (qsfp_dom_rev[0:8] != 'SFF-8636' or (qsfp_dom_rev[0:8] == 'SFF-8636' and qsfp_tx_power_support != 'on')): + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_CHANNL_MON_OFFSET), QSFP_CHANNL_MON_WIDTH) + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = sfpd_obj.parse_channel_monitor_params( + dom_channel_monitor_raw, 0) + + else: + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_CHANNL_MON_OFFSET), QSFP_CHANNL_MON_WITH_TX_POWER_WIDTH) + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = sfpd_obj.parse_channel_monitor_params_with_tx_power( + dom_channel_monitor_raw, 0) + transceiver_dom_info_dict['tx1power'] = dom_channel_monitor_data['data']['TX1Power']['value'] + transceiver_dom_info_dict['tx2power'] = dom_channel_monitor_data['data']['TX2Power']['value'] + transceiver_dom_info_dict['tx3power'] = dom_channel_monitor_data['data']['TX3Power']['value'] + transceiver_dom_info_dict['tx4power'] = dom_channel_monitor_data['data']['TX4Power']['value'] + + if dom_channel_monitor_raw: + transceiver_dom_info_dict['rx1power'] = dom_channel_monitor_data['data']['RX1Power']['value'] + transceiver_dom_info_dict['rx2power'] = dom_channel_monitor_data['data']['RX2Power']['value'] + transceiver_dom_info_dict['rx3power'] = dom_channel_monitor_data['data']['RX3Power']['value'] + transceiver_dom_info_dict['rx4power'] = dom_channel_monitor_data['data']['RX4Power']['value'] + transceiver_dom_info_dict['tx1bias'] = dom_channel_monitor_data['data']['TX1Bias']['value'] + transceiver_dom_info_dict['tx2bias'] = dom_channel_monitor_data['data']['TX2Bias']['value'] + transceiver_dom_info_dict['tx3bias'] = dom_channel_monitor_data['data']['TX3Bias']['value'] + transceiver_dom_info_dict['tx4bias'] = dom_channel_monitor_data['data']['TX4Bias']['value'] + elif self.sfp_type == SFP_TYPE: + sfpd_obj = sff8472Dom() + if not sfpd_obj: + return {} + + eeprom_ifraw = self.__read_eeprom_specific_bytes(0, SFP_DOM_OFFSET) + if eeprom_ifraw is not None: + sfpi_obj = sff8472InterfaceId(eeprom_ifraw) + cal_type = sfpi_obj.get_calibration_type() + sfpd_obj._calibration_type = cal_type + + offset = SFP_DOM_OFFSET + transceiver_dom_info_dict = dict.fromkeys(self.dom_dict_keys, 'N/A') + dom_temperature_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_TEMPE_OFFSET), SFP_TEMPE_WIDTH) + + if dom_temperature_raw is not None: + dom_temperature_data = sfpd_obj.parse_temperature( + dom_temperature_raw, 0) + transceiver_dom_info_dict['temperature'] = dom_temperature_data['data']['Temperature']['value'] + + dom_voltage_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_VOLT_OFFSET), SFP_VOLT_WIDTH) + if dom_voltage_raw is not None: + dom_voltage_data = sfpd_obj.parse_voltage(dom_voltage_raw, 0) + transceiver_dom_info_dict['voltage'] = dom_voltage_data['data']['Vcc']['value'] + + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_CHANNL_MON_OFFSET), SFP_CHANNL_MON_WIDTH) + if dom_channel_monitor_raw is not None: + dom_voltage_data = sfpd_obj.parse_channel_monitor_params( + dom_channel_monitor_raw, 0) + transceiver_dom_info_dict['tx1power'] = dom_voltage_data['data']['TXPower']['value'] + transceiver_dom_info_dict['rx1power'] = dom_voltage_data['data']['RXPower']['value'] + transceiver_dom_info_dict['tx1bias'] = dom_voltage_data['data']['TXBias']['value'] + else: + return None + + for key in transceiver_dom_info_dict: + transceiver_dom_info_dict[key] = self._convert_string_to_num( + transceiver_dom_info_dict[key]) + + transceiver_dom_info_dict['rx_los'] = self.get_rx_los() + transceiver_dom_info_dict['tx_fault'] = self.get_tx_fault() + transceiver_dom_info_dict['reset_status'] = self.get_reset_status() + transceiver_dom_info_dict['lp_mode'] = self.get_lpmode() + transceiver_dom_info_dict['tx_disable'] = self.get_tx_disable() + transceiver_dom_info_dict['tx_disable_channel'] = self.get_tx_disable_channel() + + return transceiver_dom_info_dict + + def get_transceiver_threshold_info(self): + """ + Retrieves transceiver threshold info of this SFP + + Returns: + A dict which contains following keys/values : + ======================================================================== + keys |Value Format |Information + ---------------------------|---------------|---------------------------- + temphighalarm |FLOAT |High Alarm Threshold value of temperature in Celsius. + templowalarm |FLOAT |Low Alarm Threshold value of temperature in Celsius. + temphighwarning |FLOAT |High Warning Threshold value of temperature in Celsius. + templowwarning |FLOAT |Low Warning Threshold value of temperature in Celsius. + vcchighalarm |FLOAT |High Alarm Threshold value of supply voltage in mV. + vcclowalarm |FLOAT |Low Alarm Threshold value of supply voltage in mV. + vcchighwarning |FLOAT |High Warning Threshold value of supply voltage in mV. + vcclowwarning |FLOAT |Low Warning Threshold value of supply voltage in mV. + rxpowerhighalarm |FLOAT |High Alarm Threshold value of received power in dBm. + rxpowerlowalarm |FLOAT |Low Alarm Threshold value of received power in dBm. + rxpowerhighwarning |FLOAT |High Warning Threshold value of received power in dBm. + rxpowerlowwarning |FLOAT |Low Warning Threshold value of received power in dBm. + txpowerhighalarm |FLOAT |High Alarm Threshold value of transmit power in dBm. + txpowerlowalarm |FLOAT |Low Alarm Threshold value of transmit power in dBm. + txpowerhighwarning |FLOAT |High Warning Threshold value of transmit power in dBm. + txpowerlowwarning |FLOAT |Low Warning Threshold value of transmit power in dBm. + txbiashighalarm |FLOAT |High Alarm Threshold value of tx Bias Current in mA. + txbiaslowalarm |FLOAT |Low Alarm Threshold value of tx Bias Current in mA. + txbiashighwarning |FLOAT |High Warning Threshold value of tx Bias Current in mA. + txbiaslowwarning |FLOAT |Low Warning Threshold value of tx Bias Current in mA. + ======================================================================== + """ + transceiver_dom_threshold_info_dict_keys = ['temphighalarm', 'temphighwarning', 'templowalarm', 'templowwarning', + 'vcchighalarm', 'vcchighwarning', 'vcclowalarm', 'vcclowwarning', + 'rxpowerhighalarm', 'rxpowerhighwarning', 'rxpowerlowalarm', 'rxpowerlowwarning', + 'txpowerhighalarm', 'txpowerhighwarning', 'txpowerlowalarm', 'txpowerlowwarning', + 'txbiashighalarm', 'txbiashighwarning', 'txbiaslowalarm', 'txbiaslowwarning'] + + if self.sfp_type == QSFP_TYPE: + sfpd_obj = sff8436Dom() + if not self.get_presence() or not sfpd_obj: + return {} + DOM_OFFSET = 0 + transceiver_dom_threshold_dict = dict.fromkeys(transceiver_dom_threshold_info_dict_keys, 'N/A') + offset = DOM_OFFSET + + dom_module_threshold_raw = self.__read_eeprom_specific_bytes((offset + QSFP_MODULE_THRESHOLD_OFFSET), QSFP_MODULE_THRESHOLD_WIDTH) + if dom_module_threshold_raw is not None: + module_threshold_values = sfpd_obj.parse_module_threshold_values(dom_module_threshold_raw, 0) + module_threshold_data = module_threshold_values.get('data') + if module_threshold_data: + transceiver_dom_threshold_dict['temphighalarm'] = module_threshold_data['TempHighAlarm']['value'] + transceiver_dom_threshold_dict['templowalarm'] = module_threshold_data['TempLowAlarm']['value'] + transceiver_dom_threshold_dict['temphighwarning'] = module_threshold_data['TempHighWarning']['value'] + transceiver_dom_threshold_dict['templowwarning'] = module_threshold_data['TempLowWarning']['value'] + transceiver_dom_threshold_dict['vcchighalarm'] = module_threshold_data['VccHighAlarm']['value'] + transceiver_dom_threshold_dict['vcclowalarm'] = module_threshold_data['VccLowAlarm']['value'] + transceiver_dom_threshold_dict['vcchighwarning'] = module_threshold_data['VccHighWarning']['value'] + transceiver_dom_threshold_dict['vcclowwarning'] = module_threshold_data['VccLowWarning']['value'] + + dom_channel_thres_raw = self.__read_eeprom_specific_bytes((offset + QSFP_CHANNEL_THRESHOLD_OFFSET), QSFP_CHANNEL_THRESHOLD_WIDTH) + if dom_channel_thres_raw is not None: + channel_threshold_values = sfpd_obj.parse_channel_threshold_values(dom_channel_thres_raw, 0) + channel_threshold_data = channel_threshold_values.get('data') + else: + channel_threshold_data = None + if channel_threshold_data: + transceiver_dom_threshold_dict['rxpowerhighalarm'] = channel_threshold_data['RxPowerHighAlarm']['value'] + transceiver_dom_threshold_dict['rxpowerlowalarm'] = channel_threshold_data['RxPowerLowAlarm']['value'] + transceiver_dom_threshold_dict['rxpowerhighwarning'] = channel_threshold_data['RxPowerHighWarning']['value'] + transceiver_dom_threshold_dict['rxpowerlowwarning'] = channel_threshold_data['RxPowerLowWarning']['value'] + transceiver_dom_threshold_dict['txpowerhighalarm'] = "0.0dBm" + transceiver_dom_threshold_dict['txpowerlowalarm'] = "0.0dBm" + transceiver_dom_threshold_dict['txpowerhighwarning'] = "0.0dBm" + transceiver_dom_threshold_dict['txpowerlowwarning'] = "0.0dBm" + transceiver_dom_threshold_dict['txbiashighalarm'] = channel_threshold_data['TxBiasHighAlarm']['value'] + transceiver_dom_threshold_dict['txbiaslowalarm'] = channel_threshold_data['TxBiasLowAlarm']['value'] + transceiver_dom_threshold_dict['txbiashighwarning'] = channel_threshold_data['TxBiasHighWarning']['value'] + transceiver_dom_threshold_dict['txbiaslowwarning'] = channel_threshold_data['TxBiasLowWarning']['value'] + + for key in transceiver_dom_threshold_dict: + transceiver_dom_threshold_dict[key] = self.__convert_string_to_num(transceiver_dom_threshold_dict[key]) + + return transceiver_dom_threshold_dict + + elif self.sfp_type == SFP_TYPE: + sfpd_obj = sff8472Dom() + + if not self.get_presence() and not sfpd_obj: + return {} + DOM_OFFSET = 256 + eeprom_ifraw = self.__read_eeprom_specific_bytes(0, DOM_OFFSET) + if eeprom_ifraw is not None: + sfpi_obj = sff8472InterfaceId(eeprom_ifraw) + cal_type = sfpi_obj.get_calibration_type() + sfpd_obj._calibration_type = cal_type + + offset = DOM_OFFSET + transceiver_dom_threshold_info_dict = dict.fromkeys(transceiver_dom_threshold_info_dict_keys, 'N/A') + dom_module_threshold_raw = self.__read_eeprom_specific_bytes((offset + SFP_MODULE_THRESHOLD_OFFSET), SFP_MODULE_THRESHOLD_WIDTH) + if dom_module_threshold_raw is not None: + dom_module_threshold_data = sfpd_obj.parse_alarm_warning_threshold(dom_module_threshold_raw, 0) + + transceiver_dom_threshold_info_dict['temphighalarm'] = dom_module_threshold_data['data']['TempHighAlarm']['value'] + transceiver_dom_threshold_info_dict['templowalarm'] = dom_module_threshold_data['data']['TempLowAlarm']['value'] + transceiver_dom_threshold_info_dict['temphighwarning'] = dom_module_threshold_data['data']['TempHighWarning']['value'] + transceiver_dom_threshold_info_dict['templowwarning'] = dom_module_threshold_data['data']['TempLowWarning']['value'] + + transceiver_dom_threshold_info_dict['vcchighalarm'] = dom_module_threshold_data['data']['VoltageHighAlarm']['value'] + transceiver_dom_threshold_info_dict['vcclowalarm'] = dom_module_threshold_data['data']['VoltageLowAlarm']['value'] + transceiver_dom_threshold_info_dict['vcchighwarning'] = dom_module_threshold_data['data']['VoltageHighWarning']['value'] + transceiver_dom_threshold_info_dict['vcclowwarning'] = dom_module_threshold_data['data']['VoltageLowWarning']['value'] + + transceiver_dom_threshold_info_dict['txbiashighalarm'] = dom_module_threshold_data['data']['BiasHighAlarm']['value'] + transceiver_dom_threshold_info_dict['txbiaslowalarm'] = dom_module_threshold_data['data']['BiasLowAlarm']['value'] + transceiver_dom_threshold_info_dict['txbiashighwarning'] = dom_module_threshold_data['data']['BiasHighWarning']['value'] + transceiver_dom_threshold_info_dict['txbiaslowwarning'] = dom_module_threshold_data['data']['BiasLowWarning']['value'] + + transceiver_dom_threshold_info_dict['txpowerhighalarm'] = dom_module_threshold_data['data']['TXPowerHighAlarm']['value'] + transceiver_dom_threshold_info_dict['txpowerlowalarm'] = dom_module_threshold_data['data']['TXPowerLowAlarm']['value'] + transceiver_dom_threshold_info_dict['txpowerhighwarning'] = dom_module_threshold_data['data']['TXPowerHighWarning']['value'] + transceiver_dom_threshold_info_dict['txpowerlowwarning'] = dom_module_threshold_data['data']['TXPowerLowWarning']['value'] + + transceiver_dom_threshold_info_dict['rxpowerhighalarm'] = dom_module_threshold_data['data']['RXPowerHighAlarm']['value'] + transceiver_dom_threshold_info_dict['rxpowerlowalarm'] = dom_module_threshold_data['data']['RXPowerLowAlarm']['value'] + transceiver_dom_threshold_info_dict['rxpowerhighwarning'] = dom_module_threshold_data['data']['RXPowerHighWarning']['value'] + transceiver_dom_threshold_info_dict['rxpowerlowwarning'] = dom_module_threshold_data['data']['RXPowerLowWarning']['value'] + + for key in transceiver_dom_threshold_info_dict: + transceiver_dom_threshold_info_dict[key] = self.__convert_string_to_num(transceiver_dom_threshold_info_dict[key]) + + return transceiver_dom_threshold_info_dict + + else: + return None + + def get_reset_status(self): + """ + Retrieves the reset status of SFP + Returns: + A Boolean, True if reset enabled, False if disabled + """ + # SFP doesn't support this feature + if self.sfp_type == SFP_TYPE: + return False + elif self.sfp_type == QSFP_TYPE: + try: + reg_file = open("/sys/class/gpio/gpio" + +str((self.port_num-self.QSFP_START)*4+32)+"/value") + except IOError as e: + print("Error: unable to open file: %s" % str(e)) + return None + reg_value = int(reg_file.readline().rstrip()) + reg_file.close() + if reg_value == 0: + return True + else: + return False + else: + return None + + def get_rx_los(self): + """ + Retrieves the RX LOS (lost-of-signal) status of SFP + Returns: + A Boolean, True if SFP has RX LOS, False if not. + Note : RX LOS status is latched until a call to get_rx_los or a reset. + """ + if not self.dom_supported: + return None + + rx_los_list = [] + + if self.sfp_type == QSFP_TYPE: + offset = 0 + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_CHANNL_RX_LOS_STATUS_OFFSET), QSFP_CHANNL_RX_LOS_STATUS_WIDTH) + if dom_channel_monitor_raw is not None: + rx_los_data = int(dom_channel_monitor_raw[0], 16) + rx_los_list.append(rx_los_data & 0x01 != 0) + rx_los_list.append(rx_los_data & 0x02 != 0) + rx_los_list.append(rx_los_data & 0x04 != 0) + rx_los_list.append(rx_los_data & 0x08 != 0) + elif self.sfp_type == SFP_TYPE: + offset = 256 + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_STATUS_CONTROL_OFFSET), SFP_STATUS_CONTROL_WIDTH) + if dom_channel_monitor_raw is not None: + rx_los_data = int(dom_channel_monitor_raw[0], 16) + rx_los_list.append(rx_los_data & 0x02 != 0) + else: + return None + else: + return None + + return rx_los_list + + def get_tx_fault(self): + """ + Retrieves the TX fault status of SFP + Returns: + A Boolean, True if SFP has TX fault, False if not + Note : TX fault status is lached until a call to get_tx_fault or a reset. + """ + if not self.dom_supported: + return None + + tx_fault_list = [] + + if self.sfp_type == QSFP_TYPE: + offset = 0 + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_CHANNL_TX_FAULT_STATUS_OFFSET), QSFP_CHANNL_TX_FAULT_STATUS_WIDTH) + if dom_channel_monitor_raw is not None: + tx_fault_data = int(dom_channel_monitor_raw[0], 16) + tx_fault_list.append(tx_fault_data & 0x01 != 0) + tx_fault_list.append(tx_fault_data & 0x02 != 0) + tx_fault_list.append(tx_fault_data & 0x04 != 0) + tx_fault_list.append(tx_fault_data & 0x08 != 0) + elif self.sfp_type == SFP_TYPE: + offset = 256 + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_STATUS_CONTROL_OFFSET), SFP_STATUS_CONTROL_WIDTH) + if dom_channel_monitor_raw is not None: + tx_fault_data = int(dom_channel_monitor_raw[0], 16) + tx_fault_list.append(tx_fault_data & 0x04 != 0) + else: + return None + else: + return None + + return tx_fault_list + + def get_tx_disable(self): + """ + Retrieves the tx_disable status of this SFP + Returns: + A Boolean, True if tx_disable is enabled, False if disabled + """ + if not self.dom_supported: + return None + + tx_disable_list = [] + + if self.sfp_type == QSFP_TYPE: + offset = 0 + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_CHANNL_DISABLE_STATUS_OFFSET), QSFP_CHANNL_DISABLE_STATUS_WIDTH) + if dom_channel_monitor_raw is not None: + tx_disable_data = int(dom_channel_monitor_raw[0], 16) + tx_disable_list.append(tx_disable_data & 0x01 != 0) + tx_disable_list.append(tx_disable_data & 0x02 != 0) + tx_disable_list.append(tx_disable_data & 0x04 != 0) + tx_disable_list.append(tx_disable_data & 0x08 != 0) + elif self.sfp_type == SFP_TYPE: + offset = 256 + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_STATUS_CONTROL_OFFSET), SFP_STATUS_CONTROL_WIDTH) + if dom_channel_monitor_raw is not None: + tx_disable_data = int(dom_channel_monitor_raw[0], 16) + tx_disable_list.append(tx_disable_data & 0xC0 != 0) + else: + return None + else: + return None + + return tx_disable_list + + def get_tx_disable_channel(self): + """ + Retrieves the TX disabled channels in this SFP + Returns: + A hex of 4 bits (bit 0 to bit 3 as channel 0 to channel 3) to represent + TX channels which have been disabled in this SFP. + As an example, a returned value of 0x5 indicates that channel 0 + and channel 2 have been disabled. + """ + # SFP doesn't support this feature + if self.sfp_type == SFP_TYPE: + return 0 + elif self.sfp_type == QSFP_TYPE: + tx_disable_list = self.get_tx_disable() + if tx_disable_list is None: + return 0 + tx_disabled = 0 + for i in range(len(tx_disable_list)): + if tx_disable_list[i]: + tx_disabled |= 1 << i + else: + return None + + return tx_disabled + + def get_lpmode(self): + """ + Retrieves the lpmode (low power mode) status of this QSFP module + Returns: + A Boolean, True if lpmode is enabled, False if disabled + """ + # SFP doesn't support this feature + if self.sfp_type == SFP_TYPE: + return False + elif self.sfp_type == QSFP_TYPE: + try: + reg_file = open("/sys/class/gpio/gpio" + +str((self.port_num-self.QSFP_START)*4+35)+"/value") + except IOError as e: + print("Error: unable to open file: %s" % str(e)) + return False + reg_value = int(reg_file.readline().rstrip()) + reg_file.close() + if reg_value == 0: + return False + else: + return True + else: + return None + + def get_power_override(self): + """ + Retrieves the power-override status of this SFP + Returns: + A Boolean, True if power-override is enabled, False if disabled + """ + # SFP doesn't support this feature + if self.sfp_type == SFP_TYPE: + return False + elif self.sfp_type == QSFP_TYPE: + offset = 0 + sfpd_obj = sff8436Dom() + if sfpd_obj is None: + return False + + dom_control_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_POWEROVERRIDE_OFFSET), QSFP_POWEROVERRIDE_WIDTH) + if dom_control_raw is not None: + if int(dom_control_raw[0],16) & (0x01 << QSFP_POWEROVERRIDE_BIT): + return True + else: + return False + else: + return None + + def get_temperature(self): + """ + Retrieves the temperature of this SFP + Returns: + An integer number of current temperature in Celsius + """ + if not self.dom_supported: + return None + if self.sfp_type == QSFP_TYPE: + offset = 0 + + sfpd_obj = sff8436Dom() + if sfpd_obj is None: + return None + + if self.dom_temp_supported: + dom_temperature_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_TEMPE_OFFSET), QSFP_TEMPE_WIDTH) + if dom_temperature_raw is not None: + dom_temperature_data = sfpd_obj.parse_temperature(dom_temperature_raw, 0) + temp = self._convert_string_to_num( + dom_temperature_data['data']['Temperature']['value']) + return temp + else: + return None + elif self.sfp_type == SFP_TYPE: + offset = 256 + sfpd_obj = sff8472Dom() + if sfpd_obj is None: + return None + sfpd_obj._calibration_type = 1 + + dom_temperature_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_TEMPE_OFFSET), SFP_TEMPE_WIDTH) + if dom_temperature_raw is not None: + dom_temperature_data = sfpd_obj.parse_temperature(dom_temperature_raw, 0) + temp = self._convert_string_to_num( + dom_temperature_data['data']['Temperature']['value']) + return temp + else: + return None + else: + return None + + def get_voltage(self): + """ + Retrieves the supply voltage of this SFP + Returns: + An integer number of supply voltage in mV + """ + if not self.dom_supported: + return None + if self.sfp_type == QSFP_TYPE: + offset = 0 + + sfpd_obj = sff8436Dom() + if sfpd_obj is None: + return None + + if self.dom_volt_supported: + dom_voltage_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_VOLT_OFFSET), QSFP_VOLT_WIDTH) + if dom_voltage_raw is not None: + dom_voltage_data = sfpd_obj.parse_voltage(dom_voltage_raw, 0) + voltage = self._convert_string_to_num( + dom_voltage_data['data']['Vcc']['value']) + return voltage + else: + return None + elif self.sfp_type == SFP_TYPE: + offset = 256 + + sfpd_obj = sff8472Dom() + if sfpd_obj is None: + return None + + sfpd_obj._calibration_type = self.calibration + + dom_voltage_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_VOLT_OFFSET), SFP_VOLT_WIDTH) + if dom_voltage_raw is not None: + dom_voltage_data = sfpd_obj.parse_voltage(dom_voltage_raw, 0) + voltage = self._convert_string_to_num( + dom_voltage_data['data']['Vcc']['value']) + return voltage + else: + return None + else: + return None + + def get_tx_bias(self): + """ + Retrieves the TX bias current of this SFP + Returns: + A list of four integer numbers, representing TX bias in mA + for channel 0 to channel 4. + Ex. ['110.09', '111.12', '108.21', '112.09'] + """ + tx_bias_list = [] + if self.sfp_type == QSFP_TYPE: + offset = 0 + + sfpd_obj = sff8436Dom() + if sfpd_obj is None: + return None + + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_CHANNL_MON_OFFSET), QSFP_CHANNL_MON_WITH_TX_POWER_WIDTH) + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = \ + sfpd_obj.parse_channel_monitor_params_with_tx_power(dom_channel_monitor_raw, 0) + tx_bias_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TX1Bias']['value'])) + tx_bias_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TX2Bias']['value'])) + tx_bias_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TX3Bias']['value'])) + tx_bias_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TX4Bias']['value'])) + elif self.sfp_type == SFP_TYPE: + offset = 256 + + sfpd_obj = sff8472Dom() + if sfpd_obj is None: + return None + sfpd_obj._calibration_type = self.calibration + + if self.dom_supported: + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_CHANNL_MON_OFFSET), SFP_CHANNL_MON_WIDTH) + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = sfpd_obj.parse_channel_monitor_params( \ + dom_channel_monitor_raw, 0) + tx_bias_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TXBias']['value'])) + else: + return None + else: + return None + else: + return None + + return tx_bias_list + + def get_rx_power(self): + """ + Retrieves the received optical power for this SFP + Returns: + A list of four integer numbers, representing received optical + power in mW for channel 0 to channel 4. + Ex. ['1.77', '1.71', '1.68', '1.70'] + """ + rx_power_list = [] + + if self.sfp_type == QSFP_TYPE: + offset = 0 + + sfpd_obj = sff8436Dom() + if sfpd_obj is None: + return None + + if self.dom_rx_power_supported: + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_CHANNL_MON_OFFSET), QSFP_CHANNL_MON_WITH_TX_POWER_WIDTH) + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = \ + sfpd_obj.parse_channel_monitor_params_with_tx_power(dom_channel_monitor_raw, 0) + rx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['RX1Power']['value'])) + rx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['RX2Power']['value'])) + rx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['RX3Power']['value'])) + rx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['RX4Power']['value'])) + else: + return None + else: + return None + elif self.sfp_type == SFP_TYPE: + offset = 256 + + sfpd_obj = sff8472Dom() + if sfpd_obj is None: + return None + + if self.dom_supported: + sfpd_obj._calibration_type = self.calibration + + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_CHANNL_MON_OFFSET), SFP_CHANNL_MON_WIDTH) + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = \ + sfpd_obj.parse_channel_monitor_params(dom_channel_monitor_raw, 0) + rx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['RXPower']['value'])) + else: + return None + else: + return None + else: + return None + + return rx_power_list + + def get_tx_power(self): + """ + Retrieves the TX power of this SFP + Returns: + A list of four integer numbers, representing TX power in mW + for channel 0 to channel 4. + Ex. ['1.86', '1.86', '1.86', '1.86'] + """ + tx_power_list = [] + + if self.sfp_type == QSFP_TYPE: + offset = 0 + + sfpd_obj = sff8436Dom() + if sfpd_obj is None: + return None + + if self.dom_tx_power_supported: + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_CHANNL_MON_OFFSET), QSFP_CHANNL_MON_WITH_TX_POWER_WIDTH) + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = \ + sfpd_obj.parse_channel_monitor_params_with_tx_power(dom_channel_monitor_raw, 0) + tx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TX1Power']['value'])) + tx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TX2Power']['value'])) + tx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TX3Power']['value'])) + tx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TX4Power']['value'])) + else: + return None + else: + return None + elif self.sfp_type == SFP_TYPE: + offset = 256 + sfpd_obj = sff8472Dom() + if sfpd_obj is None: + return None + + if self.dom_supported: + sfpd_obj._calibration_type = self.calibration + + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_CHANNL_MON_OFFSET), SFP_CHANNL_MON_WIDTH) + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = \ + sfpd_obj.parse_channel_monitor_params(dom_channel_monitor_raw, 0) + tx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TXPower']['value'])) + else: + return None + else: + return None + else: + return None + + return tx_power_list + + def reset(self): + """ + Reset SFP and return all user module settings to their default state. + Returns: + A boolean, True if successful, False if not + """ + if not self.get_presence(): + return False + + # SFP doesn't support this feature + if self.sfp_type == SFP_TYPE: + return False + elif self.sfp_type == QSFP_TYPE: + try: + with open("/sys/class/gpio/gpio"+str((self.port_num-self.QSFP_START)*4+32)+"/direction", 'r+') as f: + f.write('out') + reg_file = open("/sys/class/gpio/gpio" + +str((self.port_num-self.QSFP_START)*4+32)+"/value", "r+") + except IOError as e: + print ("Error: unable to open file: %s" % str(e)) + return False + + reg_value = 0 + reg_file.write(hex(reg_value)) + reg_file.close() + + # Sleep 2 second to allow it to settle + time.sleep(2) + + # Flip the value back write back to the register to take port out of reset + try: + reg_file = open("/sys/class/gpio/gpio" + +str((self.port_num-self.QSFP_START)*4+32)+"/value", "r+") + except IOError as e: + print ("Error: unable to open file: %s" % str(e)) + return False + + reg_value = 1 + reg_file.write(hex(reg_value)) + reg_file.close() + else: + return None + + return True + + def tx_disable(self, tx_disable): + """ + Disable SFP TX for all channels + Args: + tx_disable : A Boolean, True to enable tx_disable mode, False to disable + tx_disable mode. + Returns: + A boolean, True if tx_disable is set successfully, False if not + """ + if not self.get_presence(): + return False + + if self.sfp_type == SFP_TYPE: + if self.dom_tx_disable_supported: + offset = 256 + sysfs_sfp_i2c_client_eeprom_path = self.port_to_eeprom_mapping[self.port_num] + status_control_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_STATUS_CONTROL_OFFSET), SFP_STATUS_CONTROL_WIDTH) + if status_control_raw is not None: + # Set bit 6 for Soft TX Disable Select + # 01000000 = 64 and 10111111 = 191 + tx_disable_bit = 64 if tx_disable else 191 + status_control = int(status_control_raw[0], 16) + tx_disable_ctl = (status_control | tx_disable_bit) if tx_disable else ( + status_control & tx_disable_bit) + try: + sysfsfile_eeprom = open( + sysfs_sfp_i2c_client_eeprom_path, mode="r+b", buffering=0) + buffer = create_string_buffer(1) + buffer[0] = chr(tx_disable_ctl) + # Write to eeprom + sysfsfile_eeprom.seek(offset + SFP_STATUS_CONTROL_OFFSET) + sysfsfile_eeprom.write(buffer[0]) + except IOError as e: + print("Error: unable to open file: %s" % str(e)) + return False + finally: + if sysfsfile_eeprom: + sysfsfile_eeprom.close() + time.sleep(0.01) + return True + return False + else: + return False + elif self.sfp_type == QSFP_TYPE: + if self.dom_tx_disable_supported: + channel_mask = 0x0f + if tx_disable: + return self.tx_disable_channel(channel_mask, True) + else: + return self.tx_disable_channel(channel_mask, False) + else: + return False + else: + return None + + def tx_disable_channel(self, channel, disable): + """ + Sets the tx_disable for specified SFP channels + Args: + channel : A hex of 4 bits (bit 0 to bit 3) which represent channel 0 to 3, + e.g. 0x5 for channel 0 and channel 2. + disable : A boolean, True to disable TX channels specified in channel, + False to enable + Returns: + A boolean, True if successful, False if not + """ + if not self.get_presence(): + return False + # SFP doesn't support this feature + if self.sfp_type == SFP_TYPE: + return False + elif self.sfp_type == QSFP_TYPE: + if self.dom_tx_disable_supported: + sysfsfile_eeprom = None + try: + channel_state = self.get_tx_disable_channel() + if disable: + tx_disable_ctl = channel_state | channel + else: + tx_disable_ctl = channel_state & (~channel) + buffer = create_string_buffer(1) + buffer[0] = chr(tx_disable_ctl) + # Write to eeprom + sysfsfile_eeprom = open( + self.port_to_eeprom_mapping[self.port_num], "r+b") + sysfsfile_eeprom.seek(QSFP_CONTROL_OFFSET) + sysfsfile_eeprom.write(buffer[0]) + except IOError as e: + print("Error: unable to open file: %s" % str(e)) + return False + finally: + if sysfsfile_eeprom is not None: + sysfsfile_eeprom.close() + time.sleep(0.01) + return True + else: + return False + else: + return None + + def set_lpmode(self, lpmode): + """ + Sets the lpmode (low power mode) of SFP + Args: + lpmode: A Boolean, True to enable lpmode, False to disable it + Note : lpmode can be overridden by set_power_override + Returns: + A boolean, True if lpmode is set successfully, False if not + """ + if not self.get_presence(): + return False + # SFP doesn't support this feature + if self.sfp_type == SFP_TYPE: + return False + elif self.sfp_type == QSFP_TYPE: + try: + reg_file = open("/sys/class/gpio/gpio" + +str((self.port_num-self.QSFP_START)*4+35)+"/value", "r+") + except IOError as e: + print("Error: unable to open file: %s" % str(e)) + return False + + # LPMode is active high; set or clear the bit accordingly + if lpmode: + reg_value = 1 + else: + reg_value = 0 + + reg_file.write(hex(reg_value)) + reg_file.close() + else: + return None + + return True + + def set_power_override(self, power_override, power_set): + """ + Sets SFP power level using power_override and power_set + Args: + power_override : + A Boolean, True to override set_lpmode and use power_set + to control SFP power, False to disable SFP power control + through power_override/power_set and use set_lpmode + to control SFP power. + power_set : + Only valid when power_override is True. + A Boolean, True to set SFP to low power mode, False to set + SFP to high power mode. + Returns: + A boolean, True if power-override and power_set are set successfully, + False if not + """ + # SFP doesn't support this feature + if not self.get_presence(): + return False + + if self.sfp_type == SFP_TYPE: + return False + elif self.sfp_type == QSFP_TYPE: + try: + power_override_bit = 0 + if power_override: + power_override_bit |= 1 << 0 + + power_set_bit = 0 + if power_set: + power_set_bit |= 1 << 1 + + buffer = create_string_buffer(1) + buffer[0] = chr(power_override_bit | power_set_bit) + # Write to eeprom + sysfsfile_eeprom = open(self.port_to_eeprom_mapping[self.port_num], "r+b") + sysfsfile_eeprom.seek(QSFP_POWEROVERRIDE_OFFSET) + sysfsfile_eeprom.write(buffer[0]) + except IOError as e: + print("Error: unable to open file: %s" % str(e)) + return False + finally: + if sysfsfile_eeprom is not None: + sysfsfile_eeprom.close() + time.sleep(0.01) + else: + return None + + return True + + def get_name(self): + """ + Retrieves the name of the device + Returns: + string: The name of the device + """ + sfputil_helper = SfpUtilHelper() + sfputil_helper.read_porttab_mappings(self.__get_path_to_port_config_file()) + print("self.index{}".format(self.index)) + name = sfputil_helper.logical[self.index-1] or "Unknown" + return name + diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix8a-bwde-56x/sonic_platform/thermal.py b/platform/broadcom/sonic-platform-modules-quanta/ix8a-bwde-56x/sonic_platform/thermal.py new file mode 100644 index 000000000000..1e07cb0e3efd --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix8a-bwde-56x/sonic_platform/thermal.py @@ -0,0 +1,169 @@ +#!/usr/bin/env python + +############################################################################# +# Quanta +# +# Module contains an implementation of SONiC Platform Base API and +# provides the Thermal information +# +############################################################################# + +import logging +import os + +try: + from sonic_platform_base.thermal_base import ThermalBase +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +HWMON_DIR = "/sys/class/hwmon/hwmon2/" + +thermal_index_mapping = { + 1:53, + 2:54, + 3:55, + 4:56, + 5:57, + 6:58, + 7:59, + 8:60, + 9:61, + 10:62, + 11:63, + 12:64, + 13:86, + 14:87, + 15:88, + 16:89, + 17:90, + 18:91, + 19:92, + 20:93, + 21:94, + 22:109, + 23:116, + 24:117, + 25:121, + 26:122, + 27:123, + 28:127 +} + + + +class Thermal(ThermalBase): + """Platform-specific Thermal class""" + + def __init__(self, thermal_index): + self.index = thermal_index + self.temp_attr = "temp{}_input".format(thermal_index_mapping[self.index]) + self.high_th_attr = "temp{}_ncrit".format(thermal_index_mapping[self.index]) + self.high_crit_th_attr = "temp{}_crit".format(thermal_index_mapping[self.index]) + self.name_attr = "temp{}_label".format(thermal_index_mapping[self.index]) + + + def __get_attr_value(self, attr_path): + + retval = 'ERR' + if (not os.path.isfile(attr_path)): + return retval + + try: + with open(attr_path, 'r') as fd: + retval = fd.read() + except Exception as error: + logging.error("Unable to open " + attr_path + " file !") + + retval = retval.rstrip(' \t\n\r') + return retval + + def get_name(self): + """ + Retrieves the name of the device + + Returns: + string: The name of the device + """ + attr_path = HWMON_DIR + self.name_attr + attr_rv = self.__get_attr_value(attr_path) + + if (attr_rv != 'ERR'): + return attr_rv + else: + return None + + def get_presence(self): + """ + Retrieves the presence of the device + + Returns: + bool: True if device is present, False if not + """ + attr_path = HWMON_DIR + self.name_attr + attr_rv = self.__get_attr_value(attr_path) + + if (attr_rv != 'ERR'): + return True + else: + return False + + def get_status(self): + """ + Retrieves the operational status of the device + + Returns: + A boolean value, True if device is operating properly, False if not + """ + if (self.get_temperature() != None): + return True + else: + return False + + def get_temperature(self): + """ + Retrieves current temperature reading from thermal + + Returns: + A float number of current temperature in Celsius up to nearest thousandth + of one degree Celsius, e.g. 30.125 + """ + attr_path = HWMON_DIR + self.temp_attr + attr_rv = self.__get_attr_value(attr_path) + + if (attr_rv != 'ERR'): + return float(attr_rv) / 1000 + else: + return None + + def get_high_threshold(self): + """ + Retrieves the high threshold temperature of thermal + + Returns: + A float number, the high threshold temperature of thermal in Celsius + up to nearest thousandth of one degree Celsius, e.g. 30.125 + """ + attr_path = HWMON_DIR + self.high_th_attr + attr_rv = self.__get_attr_value(attr_path) + + if (attr_rv != 'ERR'): + return float(attr_rv) / 1000 + else: + return None + + def get_high_critical_threshold(self): + """ + Retrieves the high threshold temperature of thermal + + Returns: + A float number, the high threshold temperature of thermal in Celsius + up to nearest thousandth of one degree Celsius, e.g. 30.125 + """ + attr_path = HWMON_DIR + self.high_crit_th_attr + attr_rv = self.__get_attr_value(attr_path) + + if (attr_rv != 'ERR'): + return float(attr_rv) / 1000 + else: + return None + diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix8a-bwde-56x/sonic_platform/watchdog.py b/platform/broadcom/sonic-platform-modules-quanta/ix8a-bwde-56x/sonic_platform/watchdog.py new file mode 100644 index 000000000000..282f356f4e73 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix8a-bwde-56x/sonic_platform/watchdog.py @@ -0,0 +1,234 @@ +#!/usr/bin/env python + +############################################################################# +# +# Watchdog contains an implementation of SONiC Platform Base Watchdog API +# +############################################################################# +import fcntl +import os +import array + +try: + from sonic_platform_base.watchdog_base import WatchdogBase +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +""" ioctl constants """ +IO_WRITE = 0x40000000 +IO_READ = 0x80000000 +IO_READ_WRITE = 0xC0000000 +IO_SIZE_INT = 0x00040000 +IO_SIZE_40 = 0x00280000 +IO_TYPE_WATCHDOG = ord('W') << 8 + +WDR_INT = IO_READ | IO_SIZE_INT | IO_TYPE_WATCHDOG +WDR_40 = IO_READ | IO_SIZE_40 | IO_TYPE_WATCHDOG +WDWR_INT = IO_READ_WRITE | IO_SIZE_INT | IO_TYPE_WATCHDOG + +""" Watchdog ioctl commands """ +WDIOC_GETSUPPORT = 0 | WDR_40 +WDIOC_GETSTATUS = 1 | WDR_INT +WDIOC_GETBOOTSTATUS = 2 | WDR_INT +WDIOC_GETTEMP = 3 | WDR_INT +WDIOC_SETOPTIONS = 4 | WDR_INT +WDIOC_KEEPALIVE = 5 | WDR_INT +WDIOC_SETTIMEOUT = 6 | WDWR_INT +WDIOC_GETTIMEOUT = 7 | WDR_INT +WDIOC_SETPRETIMEOUT = 8 | WDWR_INT +WDIOC_GETPRETIMEOUT = 9 | WDR_INT +WDIOC_GETTIMELEFT = 10 | WDR_INT + +""" Watchdog status constants """ +WDIOS_DISABLECARD = 0x0001 +WDIOS_ENABLECARD = 0x0002 + +WDT_COMMON_ERROR = -1 +WD_MAIN_IDENTITY = "iTCO_wdt" +WDT_SYSFS_PATH = "/sys/class/watchdog/" + +DEFAULT_TIMEOUT=180 + +class Watchdog(WatchdogBase): + + def __init__(self): + + self.watchdog, self.wdt_main_dev_name = self._get_wdt() + self.status_path = "/sys/class/watchdog/%s/status" % self.wdt_main_dev_name + self.state_path = "/sys/class/watchdog/%s/state" % self.wdt_main_dev_name + self.timeout_path = "/sys/class/watchdog/%s/timeout" % self.wdt_main_dev_name + # Set default value + self._disable() + self.armed = False + self.timeout = DEFAULT_TIMEOUT + + def _is_wd_main(self, dev): + """ + Checks watchdog identity + """ + identity = self._read_file( + "{}/{}/identity".format(WDT_SYSFS_PATH, dev)) + return identity == WD_MAIN_IDENTITY + + def _get_wdt(self): + """ + Retrieves watchdog device + """ + wdt_main_dev_list = [dev for dev in os.listdir( + "/dev/") if dev.startswith("watchdog") and self._is_wd_main(dev)] + if not wdt_main_dev_list: + return None + wdt_main_dev_name = wdt_main_dev_list[0] + watchdog_device_path = "/dev/{}".format(wdt_main_dev_name) + self.watchdog = os.open(watchdog_device_path, os.O_RDWR) + return self.watchdog, wdt_main_dev_name + + def _read_file(self, file_path): + """ + Read text file + """ + try: + with open(file_path, "r") as fd: + txt = fd.read() + except IOError: + return WDT_COMMON_ERROR + return txt.strip() + + def _enable(self): + """ + Turn on the watchdog timer + """ + req = array.array('h', [WDIOS_ENABLECARD]) + fcntl.ioctl(self.watchdog, WDIOC_SETOPTIONS, req, False) + + def _disable(self): + """ + Turn off the watchdog timer + """ + req = array.array('h', [WDIOS_DISABLECARD]) + fcntl.ioctl(self.watchdog, WDIOC_SETOPTIONS, req, False) + + def _keepalive(self): + """ + Keep alive watchdog timer + """ + fcntl.ioctl(self.watchdog, WDIOC_KEEPALIVE) + + def _settimeout(self, seconds): + """ + Set watchdog timer timeout + @param seconds - timeout in seconds + @return is the actual set timeout + """ + req = array.array('I', [seconds]) + fcntl.ioctl(self.watchdog, WDIOC_SETTIMEOUT, req, True) + return int(req[0]) + + def _gettimeout(self, timeout_path): + """ + Get watchdog timeout + @return watchdog timeout + """ + req = array.array('I', [0]) + fcntl.ioctl(self.watchdog, WDIOC_GETTIMEOUT, req, True) + + return int(req[0]) + + def _gettimeleft(self): + """ + Get time left before watchdog timer expires + @return time left in seconds + """ + req = array.array('I', [0]) + fcntl.ioctl(self.watchdog, WDIOC_GETTIMELEFT, req, True) + + return int(req[0]) + + ################################################################# + + def arm(self, seconds): + """ + Arm the hardware watchdog with a timeout of seconds. + If the watchdog is currently armed, calling this function will + simply reset the timer to the provided value. If the underlying + hardware does not support the value provided in , this + method should arm the watchdog with the *next greater* available + value. + Returns: + An integer specifying the *actual* number of seconds the watchdog + was armed with. On failure returns -1. + """ + + ret = WDT_COMMON_ERROR + if seconds < 0: + return ret + + try: + if self.timeout != seconds: + self.timeout = self._settimeout(seconds) + if self.armed: + self._keepalive() + else: + self._settimeout(seconds) + self._enable() + self.armed = True + ret = self.timeout + except IOError as e: + pass + + return ret + + def disarm(self): + """ + Disarm the hardware watchdog + Returns: + A boolean, True if watchdog is disarmed successfully, False if not + """ + disarmed = False + if self.is_armed(): + try: + self._disable() + self.armed = False + disarmed = True + except IOError: + pass + + return disarmed + + def is_armed(self): + """ + Retrieves the armed state of the hardware watchdog. + Returns: + A boolean, True if watchdog is armed, False if not + """ + + return self.armed + + def get_remaining_time(self): + """ + If the watchdog is armed, retrieve the number of seconds remaining on + the watchdog timer + Returns: + An integer specifying the number of seconds remaining on thei + watchdog timer. If the watchdog is not armed, returns -1. + """ + + timeleft = WDT_COMMON_ERROR + + if self.armed: + try: + timeleft = self._gettimeleft() + except IOError: + pass + + return timeleft + + def __del__(self): + """ + Close watchdog + """ + + os.close(self.watchdog) + + + diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix8a-bwde-56x/sonic_platform_setup.py b/platform/broadcom/sonic-platform-modules-quanta/ix8a-bwde-56x/sonic_platform_setup.py new file mode 100644 index 000000000000..a4899c618337 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix8a-bwde-56x/sonic_platform_setup.py @@ -0,0 +1,24 @@ +import os +from setuptools import setup +os.listdir + +setup( + name='sonic-platform', + version='1.0', + description='SONiC platform API implementation on Quanta Platforms', + license='Apache 2.0', + packages=['sonic_platform'], + classifiers=[ + 'Development Status :: 3 - Alpha', + 'Environment :: Plugins', + 'Intended Audience :: Developers', + 'Intended Audience :: Information Technology', + 'Intended Audience :: System Administrators', + 'License :: OSI Approved :: Apache Software License', + 'Natural Language :: English', + 'Operating System :: POSIX :: Linux', + 'Programming Language :: Python :: 3.7', + 'Topic :: Utilities', + ], + keywords='sonic SONiC platform PLATFORM', +) diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix8a-bwde-56x/utils/quanta_ix8a_bwde_util.py b/platform/broadcom/sonic-platform-modules-quanta/ix8a-bwde-56x/utils/quanta_ix8a_bwde_util.py new file mode 100755 index 000000000000..ed8c5fef6bd9 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix8a-bwde-56x/utils/quanta_ix8a_bwde_util.py @@ -0,0 +1,336 @@ +#!/usr/bin/env python +# +# Copyright (C) 2018 Quanta Computer Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +""" +Usage: %(scriptName)s [options] command object + +options: + -h | --help : this help message + -d | --debug : run with debug mode + -f | --force : ignore error during installation or clean +command: + install : install drivers and generate related sysfs nodes + clean : uninstall drivers and remove related sysfs nodes +""" + +import os +import commands +import sys, getopt +import logging +import time + +DEBUG = False +args = [] +FORCE = 0 +i2c_prefix = '/sys/bus/i2c/devices/' + +if DEBUG == True: + print sys.argv[0] + print 'ARGV :', sys.argv[1:] + +def main(): + global DEBUG + global args + global FORCE + + if len(sys.argv) < 2: + show_help() + + options, args = getopt.getopt(sys.argv[1:], 'hdf', ['help', + 'debug', + 'force', + ]) + if DEBUG == True: + print options + print args + print len(sys.argv) + + for opt, arg in options: + if opt in ('-h', '--help'): + show_help() + elif opt in ('-d', '--debug'): + DEBUG = True + logging.basicConfig(level=logging.INFO) + elif opt in ('-f', '--force'): + FORCE = 1 + else: + logging.info('no option') + for arg in args: + if arg == 'install': + install() + elif arg == 'clean': + uninstall() + else: + show_help() + + return 0 + +def show_help(): + print __doc__ % {'scriptName' : sys.argv[0].split("/")[-1]} + sys.exit(0) + +def show_log(txt): + if DEBUG == True: + print "[IX8A-BWDE-56X]" + txt + return + +def exec_cmd(cmd, show): + logging.info('Run :' + cmd) + status, output = commands.getstatusoutput(cmd) + show_log (cmd +"with result:" + str(status)) + show_log (" output:" + output) + if status: + logging.info('Failed :' + cmd) + if show: + print('Failed :' + cmd) + return status, output + +instantiate =[ +#export pca9698 for qsfp present +'echo 34 > /sys/class/gpio/export', +'echo in > /sys/class/gpio/gpio34/direction', +'echo 38 > /sys/class/gpio/export', +'echo in > /sys/class/gpio/gpio38/direction', +'echo 42 > /sys/class/gpio/export', +'echo in > /sys/class/gpio/gpio42/direction', +'echo 46 > /sys/class/gpio/export', +'echo in > /sys/class/gpio/gpio46/direction', +'echo 50 > /sys/class/gpio/export', +'echo in > /sys/class/gpio/gpio50/direction', +'echo 54 > /sys/class/gpio/export', +'echo in > /sys/class/gpio/gpio54/direction', +'echo 58 > /sys/class/gpio/export', +'echo in > /sys/class/gpio/gpio58/direction', +'echo 62 > /sys/class/gpio/export', +'echo in > /sys/class/gpio/gpio62/direction', +#export pca9698 for qsfp lpmode +'echo 35 > /sys/class/gpio/export', +'echo out > /sys/class/gpio/gpio35/direction', +'echo 0 >/sys/class/gpio/gpio35/value', +'echo 39 > /sys/class/gpio/export', +'echo out > /sys/class/gpio/gpio39/direction', +'echo 0 >/sys/class/gpio/gpio39/value', +'echo 43 > /sys/class/gpio/export', +'echo out > /sys/class/gpio/gpio43/direction', +'echo 0 >/sys/class/gpio/gpio43/value', +'echo 47 > /sys/class/gpio/export', +'echo out > /sys/class/gpio/gpio47/direction', +'echo 0 >/sys/class/gpio/gpio47/value', +'echo 51 > /sys/class/gpio/export', +'echo out > /sys/class/gpio/gpio51/direction', +'echo 0 >/sys/class/gpio/gpio51/value', +'echo 55 > /sys/class/gpio/export', +'echo out > /sys/class/gpio/gpio55/direction', +'echo 0 >/sys/class/gpio/gpio55/value', +'echo 59 > /sys/class/gpio/export', +'echo out > /sys/class/gpio/gpio59/direction', +'echo 0 >/sys/class/gpio/gpio59/value', +'echo 63 > /sys/class/gpio/export', +'echo out > /sys/class/gpio/gpio63/direction', +'echo 0 >/sys/class/gpio/gpio63/value', +#SFP28 Module TxEnable +'echo 0 > /sys/class/cpld-sfp28/port-1/tx_dis', +'echo 0 > /sys/class/cpld-sfp28/port-2/tx_dis', +'echo 0 > /sys/class/cpld-sfp28/port-3/tx_dis', +'echo 0 > /sys/class/cpld-sfp28/port-4/tx_dis', +'echo 0 > /sys/class/cpld-sfp28/port-5/tx_dis', +'echo 0 > /sys/class/cpld-sfp28/port-6/tx_dis', +'echo 0 > /sys/class/cpld-sfp28/port-7/tx_dis', +'echo 0 > /sys/class/cpld-sfp28/port-8/tx_dis', +'echo 0 > /sys/class/cpld-sfp28/port-9/tx_dis', +'echo 0 > /sys/class/cpld-sfp28/port-10/tx_dis', +'echo 0 > /sys/class/cpld-sfp28/port-11/tx_dis', +'echo 0 > /sys/class/cpld-sfp28/port-12/tx_dis', +'echo 0 > /sys/class/cpld-sfp28/port-13/tx_dis', +'echo 0 > /sys/class/cpld-sfp28/port-14/tx_dis', +'echo 0 > /sys/class/cpld-sfp28/port-15/tx_dis', +'echo 0 > /sys/class/cpld-sfp28/port-16/tx_dis', +'echo 0 > /sys/class/cpld-sfp28/port-17/tx_dis', +'echo 0 > /sys/class/cpld-sfp28/port-18/tx_dis', +'echo 0 > /sys/class/cpld-sfp28/port-19/tx_dis', +'echo 0 > /sys/class/cpld-sfp28/port-20/tx_dis', +'echo 0 > /sys/class/cpld-sfp28/port-21/tx_dis', +'echo 0 > /sys/class/cpld-sfp28/port-22/tx_dis', +'echo 0 > /sys/class/cpld-sfp28/port-23/tx_dis', +'echo 0 > /sys/class/cpld-sfp28/port-24/tx_dis', +'echo 0 > /sys/class/cpld-sfp28/port-25/tx_dis', +'echo 0 > /sys/class/cpld-sfp28/port-26/tx_dis', +'echo 0 > /sys/class/cpld-sfp28/port-27/tx_dis', +'echo 0 > /sys/class/cpld-sfp28/port-28/tx_dis', +'echo 0 > /sys/class/cpld-sfp28/port-29/tx_dis', +'echo 0 > /sys/class/cpld-sfp28/port-30/tx_dis', +'echo 0 > /sys/class/cpld-sfp28/port-31/tx_dis', +'echo 0 > /sys/class/cpld-sfp28/port-32/tx_dis', +'echo 0 > /sys/class/cpld-sfp28/port-33/tx_dis', +'echo 0 > /sys/class/cpld-sfp28/port-34/tx_dis', +'echo 0 > /sys/class/cpld-sfp28/port-35/tx_dis', +'echo 0 > /sys/class/cpld-sfp28/port-36/tx_dis', +'echo 0 > /sys/class/cpld-sfp28/port-37/tx_dis', +'echo 0 > /sys/class/cpld-sfp28/port-38/tx_dis', +'echo 0 > /sys/class/cpld-sfp28/port-39/tx_dis', +'echo 0 > /sys/class/cpld-sfp28/port-40/tx_dis', +'echo 0 > /sys/class/cpld-sfp28/port-41/tx_dis', +'echo 0 > /sys/class/cpld-sfp28/port-42/tx_dis', +'echo 0 > /sys/class/cpld-sfp28/port-43/tx_dis', +'echo 0 > /sys/class/cpld-sfp28/port-44/tx_dis', +'echo 0 > /sys/class/cpld-sfp28/port-45/tx_dis', +'echo 0 > /sys/class/cpld-sfp28/port-46/tx_dis', +'echo 0 > /sys/class/cpld-sfp28/port-47/tx_dis', +'echo 0 > /sys/class/cpld-sfp28/port-48/tx_dis', +#Update System LED +'echo 79 > /sys/class/gpio/export', +'echo out > /sys/class/gpio/gpio79/direction', +'echo 0 > /sys/class/gpio/gpio79/value', +'echo 80 > /sys/class/gpio/export', +'echo out > /sys/class/gpio/gpio80/direction', +'echo 1 > /sys/class/gpio/gpio80/value' +] + +drivers =[ +'lpc_ich', +'i2c-i801', +'i2c-dev', +'i2c-mux-pca954x force_deselect_on_exit=1', +'gpio-pca953x', +'optoe', +'qci_cpld_sfp28', +'qci_cpld_led', +'qci_platform_ix8a_bwde', +'quanta_hwmon_ipmi', +'ipmi_devintf' +] + +un_drivers =[ +'lpc_ich', +'i2c-i801', +'i2c-dev', +'i2c-mux-pca954x', +'gpio-pca953x', +'optoe', +'qci_cpld_sfp28', +'qci_cpld_led', +'qci_platform_ix8a_bwde', +'quanta_hwmon_ipmi', +'ipmi_devintf' +] + +def system_install(): + global FORCE + + #setup driver dependency + exec_cmd("depmod -a ", 1) + #install drivers + for i in range(0,len(drivers)): + status, output = exec_cmd("modprobe " + drivers[i], 1) + if status: + print output + if FORCE == 0: + return status + + #reload ethernet drivers in correct order + exec_cmd("rmmod ixgbe ", 1) + exec_cmd("rmmod igb ", 1) + exec_cmd("modprobe igb ", 1) + exec_cmd("modprobe ixgbe ", 1) + + #turn on module power + exec_cmd("echo 21 > /sys/class/gpio/export ", 1) + exec_cmd("echo high > /sys/class/gpio/gpio21/direction ", 1) + + # qsfp reset gpio + time.sleep(1) + for qsfp_reset in [32, 36, 40, 44, 48, 52, 56, 60]: + exec_cmd("echo "+str(qsfp_reset)+" > /sys/class/gpio/export", 1) + exec_cmd("echo high > /sys/class/gpio/gpio"+str(qsfp_reset)+"/direction", 1) + + # Reset fron-ports LED CPLD + exec_cmd("echo 73 > /sys/class/gpio/export ", 1) + status, output = exec_cmd("cat /sys/class/gpio/gpio73/value", 1) + if output != '1': + exec_cmd("echo out > /sys/class/gpio/gpio73/direction ", 1) + exec_cmd("echo 0 >/sys/class/gpio/gpio73/value", 1) + exec_cmd("echo 1 >/sys/class/gpio/gpio73/value", 1) + + #instantiate devices + for i in range(0, len(instantiate)): + status, output = exec_cmd(instantiate[i], 1) + if status: + print output + if FORCE == 0: + return status + + #QSFP for 1~56 port + for port_number in range(1, 57): + bus_number = port_number + 12 + os.system("echo %d >/sys/bus/i2c/devices/%d-0050/port_name" % (port_number, bus_number)) + + #Enable front-ports LED decoding + exec_cmd('echo 1 > /sys/class/cpld-led/CPLDLED-1/led_decode', 1) + exec_cmd('echo 1 > /sys/class/cpld-led/CPLDLED-2/led_decode', 1) + + return + +def system_ready(): + if not device_found(): + return False + return True + +def install(): + if not device_found(): + print "No device, installing...." + status = system_install() + if status: + if FORCE == 0: + return status + status, output = exec_cmd("pip3 install /usr/share/sonic/device/x86_64-quanta_ix8a_bwde-r0/sonic_platform-1.0-py3-none-any.whl",1) + if status: + print output + if FORCE == 0: + return status + else: + print " ix8a-bwde driver already installed...." + return + +def uninstall(): + global FORCE + #uninstall drivers + for i in range(len(un_drivers) - 1, -1, -1): + status, output = exec_cmd("rmmod " + un_drivers[i], 1) + if status: + print output + if FORCE == 0: + return status + + status, output = exec_cmd("pip3 uninstall sonic-platform -y ",1) + if status: + print output + if FORCE == 0: + return status + + return + +def device_found(): + ret1, log1 = exec_cmd("cat /proc/modules | grep ix8a > /tmp/chkdriver.log", 0) + ret2, log2 = exec_cmd("cat /tmp/chkdriver.log | grep ix8a", 0) + + if ret1 == 0 and len(log2) > 0: + return True + else: + return False + +if __name__ == "__main__": + main() diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix8c-56x/modules/Makefile b/platform/broadcom/sonic-platform-modules-quanta/ix8c-56x/modules/Makefile index bfb8ec0c458f..df010f27e869 100644 --- a/platform/broadcom/sonic-platform-modules-quanta/ix8c-56x/modules/Makefile +++ b/platform/broadcom/sonic-platform-modules-quanta/ix8c-56x/modules/Makefile @@ -1,3 +1,3 @@ -obj-m:=qci_cpld_sfp28.o qci_cpld_led.o qci_platform_ix8c.o +obj-m:=qci_cpld_sfp28.o qci_cpld_led.o qci_platform_ix8c.o quanta_hwmon_ipmi.o diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix8c-56x/modules/qci_cpld_led.c b/platform/broadcom/sonic-platform-modules-quanta/ix8c-56x/modules/qci_cpld_led.c index 229195249b5f..2b0fe902c4a8 100644 --- a/platform/broadcom/sonic-platform-modules-quanta/ix8c-56x/modules/qci_cpld_led.c +++ b/platform/broadcom/sonic-platform-modules-quanta/ix8c-56x/modules/qci_cpld_led.c @@ -242,6 +242,7 @@ static int cpld_led_probe(struct i2c_client *client, } /* FIXME: for older kernel doesn't with idr_is_empty function, implement here */ +#if 0 static int idr_has_entry(int id, void *p, void *data) { return 1; @@ -251,6 +252,7 @@ static bool cpld_idr_is_empty(struct idr *idp) { return !idr_for_each(idp, idr_has_entry, NULL); } +#endif static int cpld_led_remove(struct i2c_client *client) { @@ -261,7 +263,7 @@ static int cpld_led_remove(struct i2c_client *client) ida_simple_remove(&cpld_led_ida, data->cpld_data->cpld_id); kfree(data->cpld_data); - if (cpld_idr_is_empty(&cpld_led_ida.idr)) + if (ida_is_empty(&cpld_led_ida)) class_destroy(cpld_class); return 0; diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix8c-56x/modules/qci_cpld_sfp28.c b/platform/broadcom/sonic-platform-modules-quanta/ix8c-56x/modules/qci_cpld_sfp28.c index dac76667c6ca..6e6608db6211 100644 --- a/platform/broadcom/sonic-platform-modules-quanta/ix8c-56x/modules/qci_cpld_sfp28.c +++ b/platform/broadcom/sonic-platform-modules-quanta/ix8c-56x/modules/qci_cpld_sfp28.c @@ -52,7 +52,6 @@ static struct class *cpld_class = NULL; struct sfp_data { struct i2c_client *cpld_client; char name[8]; - char type[8]; u8 port_id; u8 cpld_port; }; @@ -253,8 +252,6 @@ static ssize_t set_tx_dis(struct device *dev, } //SFP -//static DEVICE_ATTR(led_enable, S_IWUSR | S_IRUGO, get_led_enable, set_led_enable); -//static DEVICE_ATTR(monitor_enable, S_IWUSR | S_IRUGO, get_monitor_enable, set_monitor_enable); //SFP static DEVICE_ATTR(tx_fault, S_IRUGO, get_tx_fault, NULL); static DEVICE_ATTR(tx_dis, S_IWUSR | S_IRUGO, get_tx_dis, set_tx_dis); @@ -262,7 +259,6 @@ static DEVICE_ATTR(pre_n, S_IRUGO, get_pre_n, NULL); static DEVICE_ATTR(rx_los, S_IRUGO, get_rx_los, NULL); static const struct attribute *sfp_attrs[] = { -// &dev_attr_led_enable.attr, &dev_attr_tx_fault.attr, &dev_attr_tx_dis.attr, &dev_attr_pre_n.attr, @@ -279,26 +275,14 @@ static int cpld_probe(struct i2c_client *client, { struct cpld_data *data; struct sfp_data *port_data; -// struct i2c_monitor_data *monitor_data; struct device *port_dev; -// struct device *i2c_dev; int port_nr, i=0, err; - char name[I2C_NAME_SIZE], type[I2C_NAME_SIZE]; printk("cpld cpld_probe\n"); - while(id->name[i]) - { - name[i]=tolower(id->name[i]); - i++; - } - name[i]='\0'; - strncpy(type,name+5,strlen(name)-5); - type[strlen(name)-5]='\0'; - if (!cpld_class) { - cpld_class = class_create(THIS_MODULE, name); + cpld_class = class_create(THIS_MODULE, "cpld-sfp28"); if (IS_ERR(cpld_class)) { pr_err("couldn't create sysfs class\n"); return PTR_ERR(cpld_class); @@ -328,9 +312,7 @@ static int cpld_probe(struct i2c_client *client, data->port_dev[i] = port_dev; data->port_data[i] = port_data; - strcpy(port_data->type, type); - - dev_info(&client->dev, "Register %s port-%d\n", port_data->type , port_nr); + dev_info(&client->dev, "Register port-%d\n", port_nr); /* FIXME: implement Logical/Physical port remapping */ //port_data->cpld_port = i; @@ -358,7 +340,7 @@ static int cpld_probe(struct i2c_client *client, } /* FIXME: for older kernel doesn't with idr_is_empty function, implement here */ -#if 1 +#if 0 static int idr_has_entry(int id, void *p, void *data) { return 1; @@ -374,18 +356,20 @@ static int cpld_remove(struct i2c_client *client) { struct cpld_data *data = i2c_get_clientdata(client); int i; -// int id; for (i = 15; i >= 0; i--) { - dev_info(data->port_dev[i], "Remove %s port-%d\n", data->port_data[i]->type , data->port_data[i]->port_id); + dev_info(data->port_dev[i], "Remove port-%d\n", data->port_data[i]->port_id); device_unregister(data->port_dev[i]); ida_simple_remove(&cpld_ida, data->port_data[i]->port_id); kfree(data->port_data[i]); } - if (cpld_idr_is_empty(&cpld_ida.idr)) + if (ida_is_empty(&cpld_ida)) + { class_destroy(cpld_class); + cpld_class = NULL; + } return 0; } diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix8c-56x/modules/qci_platform_ix8c.c b/platform/broadcom/sonic-platform-modules-quanta/ix8c-56x/modules/qci_platform_ix8c.c index f389304a2fbd..d0ae085cd417 100644 --- a/platform/broadcom/sonic-platform-modules-quanta/ix8c-56x/modules/qci_platform_ix8c.c +++ b/platform/broadcom/sonic-platform-modules-quanta/ix8c-56x/modules/qci_platform_ix8c.c @@ -39,158 +39,12 @@ #include #include #include -#include #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,16,0)) #include #else #include #endif -#define MUX_INFO(bus, deselect) \ - {.adap_id = bus, .deselect_on_exit = deselect} - -static struct pca954x_platform_mode pca9548sfp1_modes[] = { - MUX_INFO(0x20, 1), - MUX_INFO(0x21, 1), - MUX_INFO(0x22, 1), - MUX_INFO(0x23, 1), - MUX_INFO(0x24, 1), - MUX_INFO(0x25, 1), - MUX_INFO(0x26, 1), - MUX_INFO(0x27, 1), -}; - -static struct pca954x_platform_data pca9548sfp1_data = { - .modes = pca9548sfp1_modes, - .num_modes = 8, -}; - -static struct pca954x_platform_mode pca9548sfp2_modes[] = { - MUX_INFO(0x28, 1), - MUX_INFO(0x29, 1), - MUX_INFO(0x2a, 1), - MUX_INFO(0x2b, 1), - MUX_INFO(0x2c, 1), - MUX_INFO(0x2d, 1), - MUX_INFO(0x2e, 1), - MUX_INFO(0x2f, 1), -}; - -static struct pca954x_platform_data pca9548sfp2_data = { - .modes = pca9548sfp2_modes, - .num_modes = 8, -}; -static struct pca954x_platform_mode pca9548sfp3_modes[] = { - MUX_INFO(0x30, 1), - MUX_INFO(0x31, 1), - MUX_INFO(0x32, 1), - MUX_INFO(0x33, 1), - MUX_INFO(0x34, 1), - MUX_INFO(0x35, 1), - MUX_INFO(0x36, 1), - MUX_INFO(0x37, 1), -}; - -static struct pca954x_platform_data pca9548sfp3_data = { - .modes = pca9548sfp3_modes, - .num_modes = 8, -}; - -static struct pca954x_platform_mode pca9548sfp4_modes[] = { - MUX_INFO(0x38, 1), - MUX_INFO(0x39, 1), - MUX_INFO(0x3a, 1), - MUX_INFO(0x3b, 1), - MUX_INFO(0x3c, 1), - MUX_INFO(0x3d, 1), - MUX_INFO(0x3e, 1), - MUX_INFO(0x3f, 1), -}; - -static struct pca954x_platform_data pca9548sfp4_data = { - .modes = pca9548sfp4_modes, - .num_modes = 8, -}; - -static struct pca954x_platform_mode pca9548sfp5_modes[] = { - MUX_INFO(0x40, 1), - MUX_INFO(0x41, 1), - MUX_INFO(0x42, 1), - MUX_INFO(0x43, 1), - MUX_INFO(0x44, 1), - MUX_INFO(0x45, 1), - MUX_INFO(0x46, 1), - MUX_INFO(0x47, 1), -}; - -static struct pca954x_platform_data pca9548sfp5_data = { - .modes = pca9548sfp5_modes, - .num_modes = 8, -}; - -static struct pca954x_platform_mode pca9548sfp6_modes[] = { - MUX_INFO(0x48, 1), - MUX_INFO(0x49, 1), - MUX_INFO(0x4a, 1), - MUX_INFO(0x4b, 1), - MUX_INFO(0x4c, 1), - MUX_INFO(0x4d, 1), - MUX_INFO(0x4e, 1), - MUX_INFO(0x4f, 1), -}; - -static struct pca954x_platform_data pca9548sfp6_data = { - .modes = pca9548sfp6_modes, - .num_modes = 8, -}; - -//ZQSFP -static struct pca954x_platform_mode pca9548sfp7_modes[] = { - MUX_INFO(0x50, 1), - MUX_INFO(0x51, 1), - MUX_INFO(0x52, 1), - MUX_INFO(0x53, 1), - MUX_INFO(0x54, 1), - MUX_INFO(0x55, 1), - MUX_INFO(0x56, 1), - MUX_INFO(0x57, 1), -}; - -static struct pca954x_platform_data pca9548sfp7_data = { - .modes = pca9548sfp7_modes, - .num_modes = 8, -}; - -// end port - -static struct pca954x_platform_mode pca9546_modes[] = { - MUX_INFO(0x10, 1), - MUX_INFO(0x11, 1), - MUX_INFO(0x12, 1), - MUX_INFO(0x13, 1), -}; - -static struct pca954x_platform_data pca9546_data = { - .modes = pca9546_modes, - .num_modes = 4, -}; - -static struct pca954x_platform_mode pca9548_modes[] = { - MUX_INFO(0x14, 1), - MUX_INFO(0x15, 1), - MUX_INFO(0x16, 1), - MUX_INFO(0x17, 1), - MUX_INFO(0x18, 1), - MUX_INFO(0x19, 1), - MUX_INFO(0x1a, 1), - MUX_INFO(0x1b, 1), -}; - -static struct pca954x_platform_data pca9548_data = { - .modes = pca9548_modes, - .num_modes = 8, -}; - //MB Board Data static struct pca953x_platform_data pca9555_1_data = { .gpio_base = 0x10, @@ -203,45 +57,37 @@ static struct pca953x_platform_data pca9698_2_data = { static struct pca953x_platform_data pca9555_CPU_data = { .gpio_base = 0x48, }; + static struct i2c_board_info ix8c_i2c_devices[] = { { I2C_BOARD_INFO("pca9546", 0x72), // 0 - .platform_data = &pca9546_data, }, { I2C_BOARD_INFO("pca9548", 0x77), // 1 - .platform_data = &pca9548_data, }, { I2C_BOARD_INFO("24c02", 0x54), // 2 eeprom }, { I2C_BOARD_INFO("pca9548", 0x73), // 3 0x77 ch0 - .platform_data = &pca9548sfp1_data, }, { I2C_BOARD_INFO("pca9548", 0x73), // 4 0x77 ch1 - .platform_data = &pca9548sfp2_data, }, { I2C_BOARD_INFO("pca9548", 0x73), // 5 0x77 ch2 - .platform_data = &pca9548sfp3_data, }, { I2C_BOARD_INFO("pca9548", 0x73), // 6 0x77 ch3 - .platform_data = &pca9548sfp4_data, }, { I2C_BOARD_INFO("pca9548", 0x73), // 7 0x77 ch4 - .platform_data = &pca9548sfp5_data, }, { I2C_BOARD_INFO("pca9548", 0x73), // 8 0x77 ch5 - .platform_data = &pca9548sfp6_data, }, { I2C_BOARD_INFO("pca9548", 0x73), // 9 0x77 ch6 - .platform_data = &pca9548sfp7_data, }, { I2C_BOARD_INFO("CPLD-SFP28", 0x38), // 10 0x72 ch0 CPLD1_:SFP28 1~16 @@ -287,9 +133,13 @@ static struct platform_driver ix8c_platform_driver = { static struct platform_device *ix8c_device; +static struct i2c_client **g_client; +static struct i2c_client **g_client_port; +int numof_i2c_devices = 18; +int numof_ports = 56; + static int __init ix8c_platform_init(void) { - struct i2c_client *client; struct i2c_adapter *adapter; int ret, i; @@ -308,72 +158,166 @@ static int __init ix8c_platform_init(void) if (ret) goto fail_platform_device; + g_client = kmalloc(sizeof(*g_client) * numof_i2c_devices, GFP_KERNEL); + for (i = 0; i < numof_i2c_devices; i++) g_client[i] = NULL; + + g_client_port = kmalloc(sizeof(*g_client_port) * numof_ports, GFP_KERNEL); + for (i = 0; i < numof_ports; i++) g_client_port[i] = NULL; + adapter = i2c_get_adapter(0); - client = i2c_new_device(adapter, &ix8c_i2c_devices[0]); // pca9546 - client = i2c_new_device(adapter, &ix8c_i2c_devices[1]); // pca9548 - client = i2c_new_device(adapter, &ix8c_i2c_devices[16]); // CPU Linking Board at CPU's I2C Bus - i2c_put_adapter(adapter); - - adapter = i2c_get_adapter(0x10); - client = i2c_new_device(adapter, &ix8c_i2c_devices[10]); // CPLD_1 - client = i2c_new_device(adapter, &ix8c_i2c_devices[17]); // CPLD_4 - client = i2c_new_device(adapter, &ix8c_i2c_devices[18]); // CPLD_6 - i2c_put_adapter(adapter); - - adapter = i2c_get_adapter(0x11); - client = i2c_new_device(adapter, &ix8c_i2c_devices[11]); // CPLD_2 - i2c_put_adapter(adapter); - - adapter = i2c_get_adapter(0x12); - client = i2c_new_device(adapter, &ix8c_i2c_devices[12]); // CPLD_3 - client = i2c_new_device(adapter, &ix8c_i2c_devices[2]); // MB_BOARDINFO_EEPROM - i2c_put_adapter(adapter); - - adapter = i2c_get_adapter(0x13); - client = i2c_new_device(adapter, &ix8c_i2c_devices[13]); // MB Board Data - client = i2c_new_device(adapter, &ix8c_i2c_devices[14]); // QSFP:49~52 - i2c_put_adapter(adapter); - - adapter = i2c_get_adapter(0x14); - client = i2c_new_device(adapter, &ix8c_i2c_devices[3]); // pca9548_1 SFP - i2c_put_adapter(adapter); - - adapter = i2c_get_adapter(0x15); - client = i2c_new_device(adapter, &ix8c_i2c_devices[4]); // pca9548_2 SFP - i2c_put_adapter(adapter); - - adapter = i2c_get_adapter(0x16); - client = i2c_new_device(adapter, &ix8c_i2c_devices[5]); // pca9548_3 SFP - i2c_put_adapter(adapter); - - adapter = i2c_get_adapter(0x17); - client = i2c_new_device(adapter, &ix8c_i2c_devices[6]); // pca9548_4 SFP - i2c_put_adapter(adapter); - - adapter = i2c_get_adapter(0x18); - client = i2c_new_device(adapter, &ix8c_i2c_devices[7]); // pca9548_5 SFP - i2c_put_adapter(adapter); - - adapter = i2c_get_adapter(0x19); - client = i2c_new_device(adapter, &ix8c_i2c_devices[8]); // pca9548_6 SFP - i2c_put_adapter(adapter); - - adapter = i2c_get_adapter(0x1a); - client = i2c_new_device(adapter, &ix8c_i2c_devices[9]); // pca9548_7 QSFP - i2c_put_adapter(adapter); - - for(i = 80; i < 88; i ++){ // QSFP 49~56 EEPROM - adapter = i2c_get_adapter(i); - client = i2c_new_device(adapter, &ix8c_i2c_devices[15]); + if (adapter == NULL) + { + printk("[%s] get i2c adapter fail at line %d", __FUNCTION__, __LINE__); + } + else + { + g_client[0] = i2c_new_device(adapter, &ix8c_i2c_devices[0]); // pca9546 + g_client[1] = i2c_new_device(adapter, &ix8c_i2c_devices[1]); // pca9548 + g_client[2] = i2c_new_device(adapter, &ix8c_i2c_devices[16]); // CPU Linking Board at CPU's I2C Bus i2c_put_adapter(adapter); } - for(i = 32; i < 80; i ++){ // SFP28 1~48 EEPROM - adapter = i2c_get_adapter(i); - client = i2c_new_device(adapter, &ix8c_i2c_devices[19]); + adapter = i2c_get_adapter(0x01); + if (adapter == NULL) + { + printk("[%s] get i2c adapter fail at line %d", __FUNCTION__, __LINE__); + } + else + { + g_client[3] = i2c_new_device(adapter, &ix8c_i2c_devices[10]); // CPLD_1 + g_client[4] = i2c_new_device(adapter, &ix8c_i2c_devices[17]); // CPLD_4 + g_client[5] = i2c_new_device(adapter, &ix8c_i2c_devices[18]); // CPLD_6 + i2c_put_adapter(adapter); + } + + adapter = i2c_get_adapter(0x02); + if (adapter == NULL) + { + printk("[%s] get i2c adapter fail at line %d", __FUNCTION__, __LINE__); + } + else + { + g_client[6] = i2c_new_device(adapter, &ix8c_i2c_devices[11]); // CPLD_2 + i2c_put_adapter(adapter); + } + + adapter = i2c_get_adapter(0x03); + if (adapter == NULL) + { + printk("[%s] get i2c adapter fail at line %d", __FUNCTION__, __LINE__); + } + else + { + g_client[7] = i2c_new_device(adapter, &ix8c_i2c_devices[12]); // CPLD_3 + g_client[8] = i2c_new_device(adapter, &ix8c_i2c_devices[2]); // MB_BOARDINFO_EEPROM + i2c_put_adapter(adapter); + } + + adapter = i2c_get_adapter(0x04); + if (adapter == NULL) + { + printk("[%s] get i2c adapter fail at line %d", __FUNCTION__, __LINE__); + } + else + { + g_client[9] = i2c_new_device(adapter, &ix8c_i2c_devices[13]); // MB Board Data + g_client[10] = i2c_new_device(adapter, &ix8c_i2c_devices[14]); // QSFP:49~52 + i2c_put_adapter(adapter); + } + + adapter = i2c_get_adapter(0x05); + if (adapter == NULL) + { + printk("[%s] get i2c adapter fail at line %d", __FUNCTION__, __LINE__); + } + else + { + g_client[11] = i2c_new_device(adapter, &ix8c_i2c_devices[3]); // pca9548_1 SFP + i2c_put_adapter(adapter); + } + + adapter = i2c_get_adapter(0x06); + if (adapter == NULL) + { + printk("[%s] get i2c adapter fail at line %d", __FUNCTION__, __LINE__); + } + else + { + g_client[12] = i2c_new_device(adapter, &ix8c_i2c_devices[4]); // pca9548_2 SFP i2c_put_adapter(adapter); } + adapter = i2c_get_adapter(0x07); + if (adapter == NULL) + { + printk("[%s] get i2c adapter fail at line %d", __FUNCTION__, __LINE__); + } + else + { + g_client[13] = i2c_new_device(adapter, &ix8c_i2c_devices[5]); // pca9548_3 SFP + i2c_put_adapter(adapter); + } + + adapter = i2c_get_adapter(0x08); + if (adapter == NULL) + { + printk("[%s] get i2c adapter fail at line %d", __FUNCTION__, __LINE__); + } + else + { + g_client[14] = i2c_new_device(adapter, &ix8c_i2c_devices[6]); // pca9548_4 SFP + i2c_put_adapter(adapter); + } + + adapter = i2c_get_adapter(0x09); + if (adapter == NULL) + { + printk("[%s] get i2c adapter fail at line %d", __FUNCTION__, __LINE__); + } + else + { + g_client[15] = i2c_new_device(adapter, &ix8c_i2c_devices[7]); // pca9548_5 SFP + i2c_put_adapter(adapter); + } + + adapter = i2c_get_adapter(0x0a); + if (adapter == NULL) + { + printk("[%s] get i2c adapter fail at line %d", __FUNCTION__, __LINE__); + } + else + { + g_client[16] = i2c_new_device(adapter, &ix8c_i2c_devices[8]); // pca9548_6 SFP + i2c_put_adapter(adapter); + } + + adapter = i2c_get_adapter(0x0b); + if (adapter == NULL) + { + printk("[%s] get i2c adapter fail at line %d", __FUNCTION__, __LINE__); + } + else + { + g_client[17] = i2c_new_device(adapter, &ix8c_i2c_devices[9]); // pca9548_7 QSFP + i2c_put_adapter(adapter); + } + + for(i = 13; i < 69; i ++){ + adapter = i2c_get_adapter(i); + if (adapter == NULL) + { + printk("[%s] get i2c adapter fail at line %d", __FUNCTION__, __LINE__); + } + else + { + if (i < 61) // SFP28 1~48 EEPROM + g_client_port[i - 13] = i2c_new_device(adapter, &ix8c_i2c_devices[19]); + else // QSFP 49~56 EEPROM + g_client_port[i - 13] = i2c_new_device(adapter, &ix8c_i2c_devices[15]); + i2c_put_adapter(adapter); + } + } + return 0; fail_platform_device: @@ -386,6 +330,26 @@ static int __init ix8c_platform_init(void) static void __exit ix8c_platform_exit(void) { + int i = 0; + + for (i = numof_ports - 1; i >= 0; i--) + { + if (g_client_port[i]) + { + i2c_unregister_device(g_client_port[i]); + g_client_port[i] = NULL; + } + } + + for (i = numof_i2c_devices - 1; i >= 0; i--) + { + if (g_client[i]) + { + i2c_unregister_device(g_client[i]); + g_client[i] = NULL; + } + } + platform_device_unregister(ix8c_device); platform_driver_unregister(&ix8c_platform_driver); } diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix8c-56x/modules/quanta_hwmon_ipmi.c b/platform/broadcom/sonic-platform-modules-quanta/ix8c-56x/modules/quanta_hwmon_ipmi.c new file mode 100644 index 000000000000..157ae94778d5 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix8c-56x/modules/quanta_hwmon_ipmi.c @@ -0,0 +1,1587 @@ +/* +* +* A hwmon driver for the Quanta switch BMC hwmon +* +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define enable_debug_msg 0 +#define DEBUGUSE_SHIFT 0 + +#define DRVNAME "quanta_hwmon_ipmi" + +#define tos32(val, bits) ((val & ((1<<((bits)-1)))) ? (-((val) & (1<<((bits)-1))) | (val)) : (val)) +#define BSWAP_16(x) ((((x) & 0xff00) >> 8) | (((x) & 0x00ff) << 8)) +#define BSWAP_32(x) ((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >> 8) | (((x) & 0x0000ff00) << 8) | (((x) & 0x000000ff) << 24)) +#define __TO_M(mtol) (int16_t)(tos32((((BSWAP_16(mtol) & 0xff00) >> 8) | ((BSWAP_16(mtol) & 0xc0) << 2)), 10)) +#define __TO_B(bacc) (int32_t)(tos32((((BSWAP_32(bacc) & 0xff000000) >> 24) | ((BSWAP_32(bacc) & 0xc00000) >> 14)), 10)) +#define __TO_R_EXP(bacc) (int32_t)(tos32(((BSWAP_32(bacc) & 0xf0) >> 4), 4)) +#define __TO_B_EXP(bacc) (int32_t)(tos32((BSWAP_32(bacc) & 0xf), 4)) + +#define SENSOR_ATTR_MAX 17 +#define SENSOR_ATTR_NAME_LENGTH 20 + +#define SENSOR_GET_CAP_LABEL 0x001 +#define SENSOR_GET_CAP_ALARM 0x002 +#define SENSOR_GET_CAP_INPUT 0x004 + +#define SENSOR_GET_CAP_LNC 0x008 +#define SENSOR_GET_CAP_LCR 0x010 +#define SENSOR_GET_CAP_LNR 0x020 + +#define SENSOR_GET_CAP_UNC 0x040 +#define SENSOR_GET_CAP_UCR 0x080 +#define SENSOR_GET_CAP_UNR 0x100 + +#define SENSOR_GET_CAP_MODEL 0x200 +#define SENSOR_GET_CAP_SN 0x400 +#define SENSOR_GET_CAP_PWM 0x800 + +#define SENSOR_GET_CAP_CONMODE 0x1000 +#define SENSOR_GET_CAP_DIRECTION 0x2000 +#define SENSOR_GET_CAP_FAN_PRESENT 0x4000 +#define SENSOR_GET_CAP_PSU_PRESENT 0x8000 + +#define SENSOR_GET_CAP_MFRID 0x10000 + +#define SDR_SENSOR_TYPE_TEMP 0x01 +#define SDR_SENSOR_TYPE_VOLT 0x02 +#define SDR_SENSOR_TYPE_CURR 0x03 +#define SDR_SENSOR_TYPE_FAN 0x04 +#define SDR_SENSOR_TYPE_PS 0x08 +#define SDR_SENSOR_TYPE_OTHER 0x0b + +#define BMC_GET_DEVICE_ID 0x01 + +#define IPMI_NETFN_SE 0x04 +#define IPMI_NETFN_APP 0x06 +#define IPMI_NETFN_STORAGE 0x0a +#define IPMI_NETFN_TSOL 0x30 + +#define GET_SDR_REPO_INFO 0x20 +#define GET_DEVICE_SDR 0x21 +#define GET_SDR_RESERVE_REPO 0x22 +#define GET_SDR 0x23 +#define GET_SENSOR_THRESHOLDS 0x27 +#define GET_SENSOR_EVENT_ENABLE 0x29 +#define GET_SENSOR_EVENT_STATUS 0x2b +#define GET_SENSOR_READING 0x2d +#define GET_PSU_READING 0x52 +#define GET_FAN_INFO 0xd6 +#define GET_FRU_INFO 0x11 + +#define IPM_DEV_DEVICE_ID_SDR_MASK (0x80) /* 1 = provides SDRs */ +#define IPMI_TIMEOUT (4 * HZ) +#define IPMI_MAX_WAIT_QUEUE 1 + +struct quanta_hwmon_ipmi_data { + struct platform_device *ipmi_platform_dev; + struct device *ipmi_hwmon_dev; + //struct mutex ipmi_lock; + + int32_t total_sensor_id; + int32_t total_suport_sensor; + int32_t total_create_sysfs; +} *data; + +static struct mutex ipmi_lock; +static struct completion g_read_complete; + +static ipmi_user_t ipmi_mh_user = NULL; + +static int8_t g_fan_control_mode = 3; +static int32_t g_use_built_in = 0; +static int32_t ipmi_wait_queue = 0; + +struct ipmi_sensor_data { + uint8_t addr; + uint8_t sensor_type; + uint8_t sensor_idstring[SENSOR_ATTR_NAME_LENGTH]; + + uint32_t capability; + + struct header_info { + uint8_t header_type; + uint8_t header_byte; + } headerinfo; + + struct record_info { + uint8_t record_analog; + uint8_t record_linearization; + + int32_t record_m; + int32_t record_b; + int32_t record_k1; + int32_t record_k2; + } recordinfo; + + struct threshold_upper_info { + uint8_t unr; + uint8_t ucr; + uint8_t unc; + } upperinfo; + + struct threshold_lower_info { + uint8_t lnr; + uint8_t lcr; + uint8_t lnc; + } lowerinfo; + + struct attr_info + { + bool attr_exist; + char attr_name[SENSOR_ATTR_MAX][SENSOR_ATTR_NAME_LENGTH]; + char attr_type_str[SENSOR_ATTR_NAME_LENGTH]; + + struct attribute *attrs[SENSOR_ATTR_MAX + 1]; + struct attribute_group attr_group; + struct sensor_device_attribute sd_attrs[SENSOR_ATTR_MAX + 1]; + } attrinfo; + +} *g_sensor_data; + +struct ipmi_comm_data { + int32_t tx_id; + + int32_t rx_result; + int64_t rx_len; + void *rx_data; + struct completion *rx_read_complete; +}; + +struct ipmi_sdr_iterator { + uint16_t reservation; + int32_t total; + int32_t next; +}; + +struct ipm_devid_rsp { + uint8_t device_id; + uint8_t device_revision; + uint8_t fw_rev1; + uint8_t fw_rev2; + uint8_t ipmi_version; + uint8_t adtl_device_support; + uint8_t manufacturer_id[3]; + uint8_t product_id[2]; + uint8_t aux_fw_rev[4]; +} __attribute__((packed)); + +struct sdr_repo_info_rs { + uint8_t version; /* SDR version (51h) */ + uint16_t count; /* number of records */ + uint16_t free; /* free space in SDR */ + uint32_t add_stamp; /* last add timestamp */ + uint32_t erase_stamp; /* last del timestamp */ + uint8_t op_support; /* supported operations */ +} __attribute__((packed)); + +struct sdr_device_info_rs { + uint8_t count; /* number of records */ + uint8_t flags; /* flags */ + uint8_t popChangeInd[3]; /* free space in SDR */ +} __attribute__((packed)); + +struct sdr_get_rs { + uint16_t next; /* next record id */ + uint16_t id; /* record ID */ + uint8_t version; /* SDR version (51h) */ +#define SDR_RECORD_TYPE_FULL_SENSOR 0x01 +#define SDR_RECORD_TYPE_COMPACT_SENSOR 0x02 +#define SDR_RECORD_TYPE_EVENTONLY_SENSOR 0x03 +#define SDR_RECORD_TYPE_ENTITY_ASSOC 0x08 +#define SDR_RECORD_TYPE_DEVICE_ENTITY_ASSOC 0x09 +#define SDR_RECORD_TYPE_GENERIC_DEVICE_LOCATOR 0x10 +#define SDR_RECORD_TYPE_FRU_DEVICE_LOCATOR 0x11 +#define SDR_RECORD_TYPE_MC_DEVICE_LOCATOR 0x12 +#define SDR_RECORD_TYPE_MC_CONFIRMATION 0x13 +#define SDR_RECORD_TYPE_BMC_MSG_CHANNEL_INFO 0x14 +#define SDR_RECORD_TYPE_OEM 0xc0 + uint8_t type; /* record type */ + uint8_t length; /* remaining record bytes */ +} __attribute__((packed)); + +struct sdr_get_rq { + uint16_t reserve_id; /* reservation ID */ + uint16_t id; /* record ID */ + uint8_t offset; /* offset into SDR */ +#define GET_SDR_ENTIRE_RECORD 0xff + uint8_t length; /* length to read */ +} __attribute__((packed)); + +struct entity_id { + uint8_t id; /* physical entity id */ +#ifdef WORDS_BIGENDIAN + uint8_t logical : 1; /* physical/logical */ + uint8_t instance : 7; /* instance number */ +#else + uint8_t instance : 7; /* instance number */ + uint8_t logical : 1; /* physical/logical */ +#endif +} __attribute__((packed)); + +struct sdr_record_mask { + union { + struct { + uint16_t assert_event; /* assertion event mask */ + uint16_t deassert_event; /* de-assertion event mask */ + uint16_t read; /* discrete reading mask */ + } discrete; + struct { +#ifdef WORDS_BIGENDIAN + uint16_t reserved : 1; + uint16_t status_lnr : 1; + uint16_t status_lcr : 1; + uint16_t status_lnc : 1; + uint16_t assert_unr_high : 1; + uint16_t assert_unr_low : 1; + uint16_t assert_ucr_high : 1; + uint16_t assert_ucr_low : 1; + uint16_t assert_unc_high : 1; + uint16_t assert_unc_low : 1; + uint16_t assert_lnr_high : 1; + uint16_t assert_lnr_low : 1; + uint16_t assert_lcr_high : 1; + uint16_t assert_lcr_low : 1; + uint16_t assert_lnc_high : 1; + uint16_t assert_lnc_low : 1; +#else + uint16_t assert_lnc_low : 1; + uint16_t assert_lnc_high : 1; + uint16_t assert_lcr_low : 1; + uint16_t assert_lcr_high : 1; + uint16_t assert_lnr_low : 1; + uint16_t assert_lnr_high : 1; + uint16_t assert_unc_low : 1; + uint16_t assert_unc_high : 1; + uint16_t assert_ucr_low : 1; + uint16_t assert_ucr_high : 1; + uint16_t assert_unr_low : 1; + uint16_t assert_unr_high : 1; + uint16_t status_lnc : 1; + uint16_t status_lcr : 1; + uint16_t status_lnr : 1; + uint16_t reserved : 1; +#endif +#ifdef WORDS_BIGENDIAN + uint16_t reserved_2 : 1; + uint16_t status_unr : 1; + uint16_t status_ucr : 1; + uint16_t status_unc : 1; + uint16_t deassert_unr_high : 1; + uint16_t deassert_unr_low : 1; + uint16_t deassert_ucr_high : 1; + uint16_t deassert_ucr_low : 1; + uint16_t deassert_unc_high : 1; + uint16_t deassert_unc_low : 1; + uint16_t deassert_lnr_high : 1; + uint16_t deassert_lnr_low : 1; + uint16_t deassert_lcr_high : 1; + uint16_t deassert_lcr_low : 1; + uint16_t deassert_lnc_high : 1; + uint16_t deassert_lnc_low : 1; +#else + uint16_t deassert_lnc_low : 1; + uint16_t deassert_lnc_high : 1; + uint16_t deassert_lcr_low : 1; + uint16_t deassert_lcr_high : 1; + uint16_t deassert_lnr_low : 1; + uint16_t deassert_lnr_high : 1; + uint16_t deassert_unc_low : 1; + uint16_t deassert_unc_high : 1; + uint16_t deassert_ucr_low : 1; + uint16_t deassert_ucr_high : 1; + uint16_t deassert_unr_low : 1; + uint16_t deassert_unr_high : 1; + uint16_t status_unc : 1; + uint16_t status_ucr : 1; + uint16_t status_unr : 1; + uint16_t reserved_2 : 1; +#endif + union { + struct { +#ifdef WORDS_BIGENDIAN /* settable threshold mask */ + uint16_t reserved : 2; + uint16_t unr : 1; + uint16_t ucr : 1; + uint16_t unc : 1; + uint16_t lnr : 1; + uint16_t lcr : 1; + uint16_t lnc : 1; + /* padding lower 8 bits */ + uint16_t readable : 8; +#else + uint16_t readable : 8; + uint16_t lnc : 1; + uint16_t lcr : 1; + uint16_t lnr : 1; + uint16_t unc : 1; + uint16_t ucr : 1; + uint16_t unr : 1; + uint16_t reserved : 2; +#endif + } set; + struct { +#ifdef WORDS_BIGENDIAN /* readable threshold mask */ + /* padding upper 8 bits */ + uint16_t settable : 8; + uint16_t reserved : 2; + uint16_t unr : 1; + uint16_t ucr : 1; + uint16_t unc : 1; + uint16_t lnr : 1; + uint16_t lcr : 1; + uint16_t lnc : 1; +#else + uint16_t lnc : 1; + uint16_t lcr : 1; + uint16_t lnr : 1; + uint16_t unc : 1; + uint16_t ucr : 1; + uint16_t unr : 1; + uint16_t reserved : 2; + uint16_t settable : 8; +#endif + } read; + }; + } threshold; + } type; +} __attribute__((packed)); + +struct sdr_record_full_sensor { + struct { + uint8_t owner_id; +#ifdef WORDS_BIGENDIAN + uint8_t channel : 4; /* channel number */ + uint8_t __reserved : 2; + uint8_t lun : 2; /* sensor owner lun */ +#else + uint8_t lun : 2; /* sensor owner lun */ + uint8_t __reserved : 2; + uint8_t channel : 4; /* channel number */ +#endif + uint8_t sensor_num; /* unique sensor number */ + } keys; + + struct entity_id entity; + + struct { + struct { +#ifdef WORDS_BIGENDIAN + uint8_t __reserved : 1; + uint8_t scanning : 1; + uint8_t events : 1; + uint8_t thresholds : 1; + uint8_t hysteresis : 1; + uint8_t type : 1; + uint8_t event_gen : 1; + uint8_t sensor_scan : 1; +#else + uint8_t sensor_scan : 1; + uint8_t event_gen : 1; + uint8_t type : 1; + uint8_t hysteresis : 1; + uint8_t thresholds : 1; + uint8_t events : 1; + uint8_t scanning : 1; + uint8_t __reserved : 1; +#endif + } init; + struct { +#ifdef WORDS_BIGENDIAN + uint8_t ignore : 1; + uint8_t rearm : 1; + uint8_t hysteresis : 2; + uint8_t threshold : 2; + uint8_t event_msg : 2; +#else + uint8_t event_msg : 2; + uint8_t threshold : 2; + uint8_t hysteresis : 2; + uint8_t rearm : 1; + uint8_t ignore : 1; +#endif + } capabilities; + uint8_t type; + } sensor; + + uint8_t event_type; /* event/reading type code */ + + struct sdr_record_mask mask; + + struct { +#ifdef WORDS_BIGENDIAN + uint8_t analog : 2; + uint8_t rate : 3; + uint8_t modifier : 2; + uint8_t pct : 1; +#else + uint8_t pct : 1; + uint8_t modifier : 2; + uint8_t rate : 3; + uint8_t analog : 2; +#endif + struct { + uint8_t base; + uint8_t modifier; + } type; + } unit; + +#define SDR_SENSOR_L_LINEAR 0x00 +#define SDR_SENSOR_L_LN 0x01 +#define SDR_SENSOR_L_LOG10 0x02 +#define SDR_SENSOR_L_LOG2 0x03 +#define SDR_SENSOR_L_E 0x04 +#define SDR_SENSOR_L_EXP10 0x05 +#define SDR_SENSOR_L_EXP2 0x06 +#define SDR_SENSOR_L_1_X 0x07 +#define SDR_SENSOR_L_SQR 0x08 +#define SDR_SENSOR_L_CUBE 0x09 +#define SDR_SENSOR_L_SQRT 0x0a +#define SDR_SENSOR_L_CUBERT 0x0b +#define SDR_SENSOR_L_NONLINEAR 0x70 + + uint8_t linearization; /* 70h=non linear, 71h-7Fh=non linear, OEM */ + uint16_t mtol; /* M, tolerance */ + uint32_t bacc; /* accuracy, B, Bexp, Rexp */ + + struct { +#ifdef WORDS_BIGENDIAN + uint8_t __reserved : 5; + uint8_t normal_min : 1; /* normal min field specified */ + uint8_t normal_max : 1; /* normal max field specified */ + uint8_t nominal_read : 1; /* nominal reading field specified */ +#else + uint8_t nominal_read : 1; /* nominal reading field specified */ + uint8_t normal_max : 1; /* normal max field specified */ + uint8_t normal_min : 1; /* normal min field specified */ + uint8_t __reserved : 5; +#endif + } analog_flag; + + uint8_t nominal_read; /* nominal reading, raw value */ + uint8_t normal_max; /* normal maximum, raw value */ + uint8_t normal_min; /* normal minimum, raw value */ + uint8_t sensor_max; /* sensor maximum, raw value */ + uint8_t sensor_min; /* sensor minimum, raw value */ + + struct { + struct { + uint8_t non_recover; + uint8_t critical; + uint8_t non_critical; + } upper; + struct { + uint8_t non_recover; + uint8_t critical; + uint8_t non_critical; + } lower; + struct { + uint8_t positive; + uint8_t negative; + } hysteresis; + } threshold; + uint8_t __reserved[2]; + uint8_t oem; /* reserved for OEM use */ + uint8_t id_code; /* sensor ID string type/length code */ + uint8_t id_string[16]; /* sensor ID string bytes, only if id_code != 0 */ +} __attribute__((packed)); + +int32_t pow_convert(int32_t *a, int32_t b) +{ + /* function input parameter (a * 10 ^ b) */ + int32_t i = 0, r = 1, temp_b = 0; + + temp_b = (b > 0) ? b : -b; + + for (i = 0; i < temp_b; i++) r = r * 10; + + if (b > 0) { + *a = (*a) * r; + r = 1; + } + /* function return parameter calc_result = *a, decimal_point = r */ + return r; +} + +void simple_atoi(const char *buf, int8_t *output_val) +{ + while (*buf >= '0' && *buf <= '9') { + *output_val = *output_val * 10 + *buf - '0'; + buf++; + } +} + +static void ipmi_msg_handler(struct ipmi_recv_msg *msg, void *handler_data) +{ + int32_t rv = -IPMI_UNKNOWN_ERR_COMPLETION_CODE; + + struct ipmi_comm_data *comm_data = msg->user_msg_data; + + ipmi_wait_queue--; + + if (msg->msg.data[0] != 0) { + if ((msg->msg.data[0] != 0x83) && (msg->msg.netfn != 0x07) && (msg->msg.cmd != 0x52)) { + //skip master r/w cmd return code + printk("ipmi: Error 0x%x on cmd 0x%x/0x%x\n", msg->msg.data[0], msg->msg.netfn, msg->msg.cmd); + rv = msg->msg.data[0]; + goto get_BMC_response_fail; + } + } + + if (msg->msgid != comm_data->tx_id) { + printk("ipmi: rx msgid %d mismatch tx msgid %d\n", (int32_t)msg->msgid, comm_data->tx_id); + goto get_BMC_response_fail; + } + + if (msg->msg.data_len <= 0) { + printk("ipmi: Data len too low (%d)\n", msg->msg.data_len); + goto get_BMC_response_fail; + } + + if (msg->msg.data_len > 1) { + if (comm_data->rx_len) { + comm_data->rx_len = msg->msg.data_len - 1; + memcpy(comm_data->rx_data, msg->msg.data + 1, comm_data->rx_len); + } + else { + printk("ipmi: rx len = 0, it should be not retrun ?\n"); + goto get_BMC_response_fail; + } + } + + rv = 0; + +get_BMC_response_fail: + ipmi_free_recv_msg(msg); + + if (ipmi_wait_queue == 0) { + comm_data->rx_result = rv; + if (rv == 0) complete(comm_data->rx_read_complete); + } +} +static struct ipmi_user_hndl ipmi_hndlrs = { .ipmi_recv_hndl = ipmi_msg_handler, }; + +int32_t ipmi_request_wait_for_response(struct kernel_ipmi_msg msg, struct ipmi_comm_data *comm_data) +{ + int32_t rv = 0; + int32_t escape_time = 0; + + struct ipmi_addr ipmi_address; + + if (ipmi_wait_queue >= IPMI_MAX_WAIT_QUEUE) { + /* printk("msg queue full, cannot send ipmi cmd\n"); */ + return -EBUSY; + } + ipmi_wait_queue++; + + ipmi_address.addr_type = IPMI_SYSTEM_INTERFACE_ADDR_TYPE; + ipmi_address.channel = IPMI_BMC_CHANNEL; + ipmi_address.data[0] = 0; + + rv = ipmi_validate_addr(&ipmi_address, sizeof(ipmi_address)); + if (rv) { + printk("ipmi_validate_addr fail, err code : %d\n", rv); + return rv; + } + + ipmi_request_settime(ipmi_mh_user, &ipmi_address, comm_data->tx_id, &msg, comm_data, 0, 0, 0); + + escape_time = wait_for_completion_timeout(comm_data->rx_read_complete, IPMI_TIMEOUT); + + rv = comm_data->rx_result; + if (escape_time == 0) { + printk("BMC not response (%d)\n", escape_time); + } + + return rv; +} + +int32_t ipmi_send_system_cmd(uint8_t *msg_tx_data, int32_t msg_tx_len, void *msg_rx_data, int32_t msg_rx_len) +{ + int32_t i = 0; + int32_t rv = 0; + + static uint64_t tx_msgid = 1; + + struct kernel_ipmi_msg msg; + struct ipmi_comm_data *comm_data = NULL; + struct completion read_complete; + + init_completion(&read_complete); + + /* prepare transfer message */ + msg.netfn = msg_tx_data[0]; + msg.cmd = msg_tx_data[1]; + msg.data_len = msg_tx_len - 2; + + msg.data = kzalloc(msg.data_len, GFP_KERNEL); + if (msg.data == NULL) { + printk("%s(%d): malloc [msg.data] failure", __func__, __LINE__); + rv = -ENOMEM; + goto alloc_mem_fail; + } + + comm_data = kzalloc(sizeof(struct ipmi_comm_data), GFP_KERNEL); + if (comm_data == NULL) { + printk("%s(%d): malloc [comm_data] failure", __func__, __LINE__); + rv = -ENOMEM; + goto alloc_mem_fail; + } + + for (i = 2; i < msg_tx_len; i++) { + msg.data[i - 2] = msg_tx_data[i]; + } + + comm_data->tx_id = tx_msgid++; + + /* prepare recive message */ + comm_data->rx_data = msg_rx_data; + comm_data->rx_len = msg_rx_len; + comm_data->rx_result = -1; + comm_data->rx_read_complete = &read_complete; + + rv = ipmi_request_wait_for_response(msg, comm_data); + +alloc_mem_fail: + if (msg.data) kfree(msg.data); + if (comm_data) kfree(comm_data); + if (tx_msgid > UINT_MAX) tx_msgid = 1; + + return rv; +} + +int32_t ipmi_sdr_get_reservation(uint16_t * reserve_id) +{ + int32_t rv = 0; + uint8_t msg_data[] = { 0x00, GET_SDR_RESERVE_REPO }; //netfn = 0x00; cmd = GET_SDR_RESERVE_REPO; + + msg_data[0] = (g_use_built_in == 0) ? IPMI_NETFN_STORAGE : IPMI_NETFN_SE; + + /* obtain reservation ID */ + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), reserve_id, 1); + if (rv) printk("BMC down at (%d)!!\n", __LINE__); + +#if enable_debug_msg + printk("SDR reservation ID %04x\n", *reserve_id); +#endif + + return rv; +} + +int32_t ipmi_sdr_start(struct ipmi_sdr_iterator *itr) +{ + int32_t rv = 0; + + uint8_t msg_data[] = { IPMI_NETFN_APP, BMC_GET_DEVICE_ID }; //netfn = IPMI_NETFN_APP; cmd = BMC_GET_DEVICE_ID; + + struct ipm_devid_rsp devid; + + /* check SDRR capability */ + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), &devid, 1); + if (rv) { + printk("BMC down at (%d)!!\n", __LINE__); + return rv; + } + + if (devid.device_revision & IPM_DEV_DEVICE_ID_SDR_MASK) { + if ((devid.adtl_device_support & 0x02) == 0) { + if ((devid.adtl_device_support & 0x01)) { + printk("Using Device SDRs\n"); + g_use_built_in = 1; + } + else { + printk("Error obtaining SDR info\n"); + } + } + } + + if (g_use_built_in == 0) { + struct sdr_repo_info_rs sdr_info; + /* get sdr repository info */ + msg_data[0] = IPMI_NETFN_STORAGE; + msg_data[1] = GET_SDR_REPO_INFO; + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), &sdr_info, 1); + itr->total = sdr_info.count; + +#if enable_debug_msg + printk("SDR version: 0x%x\n", sdr_info.version); + printk("SDR free space: %d\n", sdr_info.free); +#endif + } + else { + struct sdr_device_info_rs sdr_info; + /* get device sdr info */ + msg_data[0] = IPMI_NETFN_SE; + msg_data[1] = GET_SDR_REPO_INFO; + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), &sdr_info, 1); + itr->total = sdr_info.count; + } + +#if enable_debug_msg + printk("SDR records : %d\n", sdr_info.count); +#endif + + if (rv) { + printk("BMC down at (%d)!!\n", __LINE__); + } + else { + itr->next = 0; + rv = ipmi_sdr_get_reservation(&(itr->reservation)); + } + + return rv; +} + +int32_t ipmi_sdr_get_header(struct ipmi_sdr_iterator *itr, struct sdr_get_rs *sdr_rs) +{ + int32_t rv = 0; + + uint8_t msg_data[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; //netfn = 0x00; cmd = 0x00; + + struct sdr_get_rq sdr_rq; + + sdr_rq.reserve_id = itr->reservation; + sdr_rq.id = itr->next; + sdr_rq.offset = 0; + sdr_rq.length = 5; /* only get the header */ + + if (g_use_built_in == 0) { + msg_data[0] = IPMI_NETFN_STORAGE; + msg_data[1] = GET_SDR; + } + else { + msg_data[0] = IPMI_NETFN_SE; + msg_data[1] = GET_DEVICE_SDR; + } + + memcpy(msg_data + 2, (uint8_t *)&sdr_rq, sizeof(struct sdr_get_rq)); + + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), sdr_rs, 1); + if ((rv) || (sdr_rs->length == 0)) { + printk("SDR record id 0x%04x: invalid length %d", itr->next, sdr_rs->length); + return -1; + } + + if (sdr_rs->id != itr->next) { +#if enable_debug_msg + printk("SDR record id mismatch: 0x%04x\n", sdr_rs->id); +#endif + sdr_rs->id = itr->next; + } +#if enable_debug_msg + printk("\nSDR record ID : 0x%04x", itr->next); + printk("SDR record type : 0x%02x\n", sdr_rs->type); + printk("SDR record next : 0x%04x\n", sdr_rs->next); + printk("SDR record bytes: %d\n", sdr_rs->length); +#endif + + return rv; +} + +int32_t ipmi_sdr_get_record(struct sdr_get_rs * header, struct ipmi_sdr_iterator * itr, uint8_t *ret_data) +{ + int32_t rv = 0, len = 0; + + uint8_t buff[128] = ""; + uint8_t msg_data[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; //netfn = 0x00; cmd = 0x00; + + struct sdr_get_rq sdr_rq; + + len = header->length; + if (len > 0) { + memset(&sdr_rq, 0, sizeof(sdr_rq)); + sdr_rq.reserve_id = itr->reservation; + sdr_rq.id = header->id; + sdr_rq.offset = 5; + sdr_rq.length = len; + + if (g_use_built_in == 0) { + msg_data[0] = IPMI_NETFN_STORAGE; + msg_data[1] = GET_SDR; + } + else { + msg_data[0] = IPMI_NETFN_SE; + msg_data[1] = GET_DEVICE_SDR; + } + + memcpy(msg_data + 2, (uint8_t *)&sdr_rq, sizeof(struct sdr_get_rq)); + + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), ret_data, 1); + if (rv) { + printk("BMC down at (%d)!!\n", __LINE__); + } + else { + memset(buff, 0, sizeof(buff)); + memcpy(buff, ret_data + 2, sdr_rq.length); + memcpy(ret_data, buff, sdr_rq.length + 2); + } + } + + return rv; +} + +void ipmi_sdr_set_sensor_threshold(uint8_t idx, struct sdr_record_full_sensor *sensor) +{ + + /*refer to Table 35-, Get Sensor Event Enable*/ + /* + // change detect threshold method, keep it for record detail format + // in this version function input is + "void ipmi_sdr_set_sensor_threshold(uint8_t idx, uint8_t *rec)" + #define offset_threshold_enable 9 + #define offset_threshold_data 31 + if (rec[offset_threshold_enable + 1] & 0x08) g_sensor_data[idx].upperinfo.unr_high = 1; + if (rec[offset_threshold_enable + 1] & 0x04) g_sensor_data[idx].upperinfo.unr_low = 1; + if (rec[offset_threshold_enable + 1] & 0x02) g_sensor_data[idx].upperinfo.ucr_high = 1; + if (rec[offset_threshold_enable + 1] & 0x01) g_sensor_data[idx].upperinfo.ucr_low = 1; + if (rec[offset_threshold_enable] & 0x80) g_sensor_data[idx].upperinfo.unc_high = 1; + if (rec[offset_threshold_enable] & 0x40) g_sensor_data[idx].upperinfo.unc_low = 1; + + if (rec[offset_threshold_enable] & 0x20) g_sensor_data[idx].lowerinfo.lnr_high = 1; + if (rec[offset_threshold_enable] & 0x10) g_sensor_data[idx].lowerinfo.lnr_low = 1; + if (rec[offset_threshold_enable] & 0x08) g_sensor_data[idx].lowerinfo.lcr_high = 1; + if (rec[offset_threshold_enable] & 0x04) g_sensor_data[idx].lowerinfo.lcr_low = 1; + if (rec[offset_threshold_enable] & 0x02) g_sensor_data[idx].lowerinfo.lnc_high = 1; + if (rec[offset_threshold_enable] & 0x01) g_sensor_data[idx].lowerinfo.lnc_low = 1; + //*/ + + /* lower threshold info */ + if (sensor->mask.type.threshold.read.lnc) g_sensor_data[idx].capability |= SENSOR_GET_CAP_LNC; + if (sensor->mask.type.threshold.read.lcr) g_sensor_data[idx].capability |= SENSOR_GET_CAP_LCR; + if (sensor->mask.type.threshold.read.lnr) g_sensor_data[idx].capability |= SENSOR_GET_CAP_LNR; + g_sensor_data[idx].lowerinfo.lnc = sensor->threshold.lower.non_critical; + g_sensor_data[idx].lowerinfo.lcr = sensor->threshold.lower.critical; + g_sensor_data[idx].lowerinfo.lnr = sensor->threshold.lower.non_recover; + + /* upper threshold info */ + if (sensor->mask.type.threshold.read.unc) g_sensor_data[idx].capability |= SENSOR_GET_CAP_UNC; + if (sensor->mask.type.threshold.read.ucr) g_sensor_data[idx].capability |= SENSOR_GET_CAP_UCR; + if (sensor->mask.type.threshold.read.unr) g_sensor_data[idx].capability |= SENSOR_GET_CAP_UNR; + g_sensor_data[idx].upperinfo.unc = sensor->threshold.upper.non_critical; + g_sensor_data[idx].upperinfo.ucr = sensor->threshold.upper.critical; + g_sensor_data[idx].upperinfo.unr = sensor->threshold.upper.non_recover; +} + +void ipmi_sdr_set_sensor_factor(uint8_t idx, struct sdr_record_full_sensor *sensor) +{ + char *loc = NULL; + + g_sensor_data[idx].sensor_type = sensor->sensor.type; + sprintf(g_sensor_data[idx].sensor_idstring, "%s", sensor->id_string); + + g_sensor_data[idx].recordinfo.record_m = __TO_M(sensor->mtol); + g_sensor_data[idx].recordinfo.record_b = __TO_B(sensor->bacc); + g_sensor_data[idx].recordinfo.record_k1 = __TO_B_EXP(sensor->bacc); + g_sensor_data[idx].recordinfo.record_k2 = __TO_R_EXP(sensor->bacc); + + g_sensor_data[idx].recordinfo.record_analog = sensor->unit.analog; + g_sensor_data[idx].recordinfo.record_linearization = sensor->linearization; + + memset(g_sensor_data[idx].attrinfo.attr_type_str, 0x00, SENSOR_ATTR_NAME_LENGTH); + + switch (g_sensor_data[idx].sensor_type) + { + case SDR_SENSOR_TYPE_TEMP: + sprintf(g_sensor_data[idx].attrinfo.attr_type_str, "temp"); + break; + case SDR_SENSOR_TYPE_VOLT: + sprintf(g_sensor_data[idx].attrinfo.attr_type_str, "in"); + break; + case SDR_SENSOR_TYPE_FAN: + g_sensor_data[idx].capability |= SENSOR_GET_CAP_PWM; + g_sensor_data[idx].capability |= SENSOR_GET_CAP_CONMODE; + g_sensor_data[idx].capability |= SENSOR_GET_CAP_DIRECTION; + sprintf(g_sensor_data[idx].attrinfo.attr_type_str, "fan"); + break; + case SDR_SENSOR_TYPE_PS: + loc = strstr(g_sensor_data[idx].sensor_idstring, "POWER"); + if (loc) { + if ((strncmp(g_sensor_data[idx].sensor_idstring + 11, "OUT", 3)) == 0) { + g_sensor_data[idx].capability |= SENSOR_GET_CAP_MODEL; + g_sensor_data[idx].capability |= SENSOR_GET_CAP_SN; + g_sensor_data[idx].capability |= SENSOR_GET_CAP_MFRID; + g_sensor_data[idx].capability |= SENSOR_GET_CAP_PSU_PRESENT; + } + sprintf(g_sensor_data[idx].attrinfo.attr_type_str, "power"); + } + + loc = strstr(g_sensor_data[idx].sensor_idstring, "VOLTAGE"); + if (loc) sprintf(g_sensor_data[idx].attrinfo.attr_type_str, "in"); + + loc = strstr(g_sensor_data[idx].sensor_idstring, "CURRENT"); + if (loc) sprintf(g_sensor_data[idx].attrinfo.attr_type_str, "curr"); + + break; + case SDR_SENSOR_TYPE_CURR: + sprintf(g_sensor_data[idx].attrinfo.attr_type_str, "curr"); + break; + case SDR_SENSOR_TYPE_OTHER: + sprintf(g_sensor_data[idx].attrinfo.attr_type_str, "other"); + break; + default: + printk("not support sensor type !! [%d]\n", g_sensor_data[idx].sensor_type); + break; + } + + if ((strncmp(g_sensor_data[idx].sensor_idstring, "Fan", 3)) == 0) { + g_sensor_data[idx].capability |= SENSOR_GET_CAP_FAN_PRESENT; + } + +#if enable_debug_msg + { + printk("\n********************\n"); + + printk("m[%d], b[%d], k1[%d], k2[%d]\n", g_sensor_data[idx].recordinfo.record_m, g_sensor_data[idx].recordinfo.record_b + , g_sensor_data[idx].recordinfo.record_k1, g_sensor_data[idx].recordinfo.record_k2); + + printk("sensor [%s] type[%d], analog[%d], linearization[%d]\n", g_sensor_data[idx].sensor_idstring, g_sensor_data[idx].sensor_type + , g_sensor_data[idx].recordinfo.record_analog, g_sensor_data[idx].recordinfo.record_linearization); + + printk("\n********************\n"); + } +#endif + +} + +int32_t sdr_convert_sensor_reading(uint8_t idx, uint8_t val, int32_t *point_result) +{ + int32_t m = g_sensor_data[idx].recordinfo.record_m; + int32_t b = g_sensor_data[idx].recordinfo.record_b; + int32_t k1 = g_sensor_data[idx].recordinfo.record_k1; + int32_t k2 = g_sensor_data[idx].recordinfo.record_k2; + int32_t decimal_point = 0; + int32_t result = 0; + + decimal_point = pow_convert(&b, k1); + + switch (g_sensor_data[idx].recordinfo.record_analog) + { + case 0: + result = m * val * decimal_point + b; + break; + case 1: + if (val & 0x80) val++; + case 2: + result = (m * (int16_t)val) * decimal_point + b; + break; + default: + return; + } + + pow_convert(&result, k2); + if (k1 < 0) *point_result += -k1; + if (k2 < 0) *point_result += -k2; + + if (g_sensor_data[idx].sensor_type != SDR_SENSOR_TYPE_FAN) { + result = result * 1000; //shift for lm-sensors + } + + return result; +} + +int32_t ipmi_sdr_parsing_value(int32_t idx, uint8_t input_value, int8_t *ret_str) +{ + int32_t calc_result = 0, point_result = 0; + int32_t temp_len = 0; + + uint8_t temp_str[16] = ""; + + calc_result = sdr_convert_sensor_reading(idx, input_value, &point_result); + + temp_len = sprintf(temp_str, "%d", calc_result); + temp_len = temp_len - point_result; + + /* int part */ + if (temp_len <= 0) sprintf(ret_str, "0"); + else snprintf(ret_str, temp_len + 1, "%s", temp_str); // +1 for snprintf reserve space'\0' + + /* point part */ + strcat(ret_str, "."); + + /* float part */ + if ((point_result == 0) || (temp_len < 0)) strcat(ret_str, "0"); + else strcat(ret_str, temp_str + temp_len); + + /* EOL part */ + strcat(ret_str, "\n\0"); + + return (temp_len + 1 + point_result + 2); //integer + point + float + EOL + \0 +} + + +uint8_t ipmi_check_psu_present(uint8_t psu_slot) +{ + uint8_t slot_mask = 0x0; + int32_t rv = 0; + + uint8_t returnData[128] = { 0 }; + uint8_t msg_data[] = { 0x36, 0xB9, 0x4C, 0x1C, 0x00, 0x03 }; //netfn = 0x36; cmd = 0xB9; + //uint8_t msg_data[] = { 0x06, 0x52, 0x1B, 0x4C, 0x01, 0x00 }; //netfn = IPMI_NETFN_APP; cmd = GET_PSU_READING; + + mutex_lock(&ipmi_lock); + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), returnData, 1); + mutex_unlock(&ipmi_lock); + + if (rv) { + printk("BMC down at (%d)!!\n", __LINE__); + return 0; + } + else { + slot_mask = (psu_slot == 1) ? 0x02 : 0x01; // for IX8C, PSU order is different from other QCT projects + return (returnData[0] & slot_mask) ? 0 : 1; + } +} + +int32_t ipmi_get_psu_info(uint8_t idx, uint8_t cmd, uint8_t *retbuf) +{ + uint8_t psu_slot = 0; + int32_t rv = 0; + + uint8_t returnData[128] = { 0 }; + uint8_t msg_data[] = { 0x36, 0xBB, 0x4C, 0x1C, 0x00, cmd, 0x00 }; //netfn = 0x36; cmd = 0xBB; + + if (strstr(g_sensor_data[idx].sensor_idstring, "PSU1")) psu_slot = 1; + else psu_slot = 2; + + if (ipmi_check_psu_present(psu_slot)) { + msg_data[6] = psu_slot; + mutex_lock(&ipmi_lock); + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), returnData, 1); + mutex_unlock(&ipmi_lock); + + if (rv) { + printk("BMC down at (%d)!!\n", __LINE__); + } + else { + return sprintf(retbuf, "%s\n", returnData); + } + } + else { + //printk("Error ! cannot detect PSU%d\n", psu_slot); + } + + return sprintf(retbuf, "N/A\n"); +} + +void ipmi_fan_control(uint8_t cmd_data1, uint8_t cmd_data2, uint8_t *retbuf) +{ + int32_t rv = 0; + + uint8_t returnData[10] = { 0 }; + uint8_t msg_data[] = { IPMI_NETFN_TSOL, GET_FAN_INFO, cmd_data1, cmd_data2 }; //netfn = IPMI_NETFN_TSOL; cmd = GET_FAN_INFO; + + mutex_lock(&ipmi_lock); + if (cmd_data1) rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), NULL, 0); + else rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), returnData, 1); + mutex_unlock(&ipmi_lock); + + if (rv) { + printk("BMC down at (%d)!!\n", __LINE__); + sprintf(retbuf, "N/A\n"); + } + else { + sprintf(retbuf, "%s", returnData); + } +} + +static ssize_t show_label(struct device *dev, struct device_attribute *devattr, char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return sprintf(buf, "%s\n", g_sensor_data[attr->index + DEBUGUSE_SHIFT].sensor_idstring); +} + +static ssize_t show_crit_alarm(struct device *dev, struct device_attribute *devattr, char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return sprintf(buf, "%d\n", attr->index); +} + +static ssize_t show_input(struct device *dev, struct device_attribute *devattr, char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + int32_t rv = 0; + + uint8_t returnData[4] = ""; + uint8_t msg_data[] = { IPMI_NETFN_SE, GET_SENSOR_READING, 0x00 }; //netfn = IPMI_NETFN_SE; cmd = GET_SENSOR_READING; + + mutex_lock(&ipmi_lock); + msg_data[2] = g_sensor_data[attr->index + DEBUGUSE_SHIFT].addr; + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), returnData, 1); + mutex_unlock(&ipmi_lock); + + if (rv) { + printk("BMC down at (%d)!!\n", __LINE__); + return sprintf(buf, "0.0\n"); + } + else { + return ipmi_sdr_parsing_value(attr->index + DEBUGUSE_SHIFT, returnData[0], buf); + } +} + +static ssize_t show_lnr(struct device *dev, struct device_attribute *devattr, char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return ipmi_sdr_parsing_value(attr->index + DEBUGUSE_SHIFT, g_sensor_data[attr->index + DEBUGUSE_SHIFT].lowerinfo.lnr, buf); +} + +static ssize_t show_lcr(struct device *dev, struct device_attribute *devattr, char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return ipmi_sdr_parsing_value(attr->index + DEBUGUSE_SHIFT, g_sensor_data[attr->index + DEBUGUSE_SHIFT].lowerinfo.lcr, buf); +} + +static ssize_t show_lnc(struct device *dev, struct device_attribute *devattr, char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return ipmi_sdr_parsing_value(attr->index + DEBUGUSE_SHIFT, g_sensor_data[attr->index + DEBUGUSE_SHIFT].lowerinfo.lnc, buf); +} + +static ssize_t show_unr(struct device *dev, struct device_attribute *devattr, char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return ipmi_sdr_parsing_value(attr->index + DEBUGUSE_SHIFT, g_sensor_data[attr->index + DEBUGUSE_SHIFT].upperinfo.unr, buf); +} + +static ssize_t show_ucr(struct device *dev, struct device_attribute *devattr, char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return ipmi_sdr_parsing_value(attr->index + DEBUGUSE_SHIFT, g_sensor_data[attr->index + DEBUGUSE_SHIFT].upperinfo.ucr, buf); +} + +static ssize_t show_unc(struct device *dev, struct device_attribute *devattr, char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return ipmi_sdr_parsing_value(attr->index + DEBUGUSE_SHIFT, g_sensor_data[attr->index + DEBUGUSE_SHIFT].upperinfo.unc, buf); +} + +static ssize_t show_model(struct device *dev, struct device_attribute *devattr, char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return ipmi_get_psu_info(attr->index + DEBUGUSE_SHIFT, 0x9a, buf); +} + +static ssize_t show_sn(struct device *dev, struct device_attribute *devattr, char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return ipmi_get_psu_info(attr->index + DEBUGUSE_SHIFT, 0x9e, buf); +} + +static ssize_t show_mfrid(struct device *dev, struct device_attribute *devattr, char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return ipmi_get_psu_info(attr->index + DEBUGUSE_SHIFT, 0x99, buf); +} + +static ssize_t show_pwm(struct device *dev, struct device_attribute *devattr, char *buf) +{ + uint8_t returnData[10] = { 0 }; + ipmi_fan_control(0x00, 0x00, returnData); + return sprintf(buf, "%d\n", returnData[0]); +} + +static ssize_t store_pwm(struct device *dev, struct device_attribute *devattr, const char *buf, size_t count) +{ + uint8_t store_input = 0; + uint8_t returnData[10] = { 0 }; + simple_atoi(buf, &store_input); + if (g_fan_control_mode == 1) ipmi_fan_control(0x01, store_input, returnData); + + return count; +} + +static ssize_t show_controlmode(struct device *dev, struct device_attribute *devattr, char *buf) +{ + return sprintf(buf, "%d\n", g_fan_control_mode); +} + +static ssize_t store_controlmode(struct device *dev, struct device_attribute *devattr, const char *buf, size_t count) +{ + uint8_t store_input = 0; + uint8_t returnData[10] = { 0 }; + simple_atoi(buf, &store_input); + g_fan_control_mode = store_input; + if (g_fan_control_mode == 3) ipmi_fan_control(0x7f, 0xff, returnData); + + return count; +} + +static ssize_t show_direction(struct device *dev, struct device_attribute *devattr, char *buf) +{ + int32_t rv = 0; + + uint8_t returnData[10] = { 0 }; + uint8_t msg_data[] = { IPMI_NETFN_STORAGE, GET_FRU_INFO, 0x00, 0x19, 0x00, 0x01 }; //netfn = IPMI_NETFN_STORAGE; cmd = GET_FRU_INFO; + + mutex_lock(&ipmi_lock); + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), returnData, 1); + mutex_unlock(&ipmi_lock); + + if (rv) { + printk("BMC down at (%d)!!\n", __LINE__); + return sprintf(buf, "N/A\n"); + } + else { + return sprintf(buf, "%c\n", returnData[1]); + } +} + +static ssize_t show_fanpresent(struct device *dev, struct device_attribute *devattr, char *buf) +{ + int32_t rv = 0; + int32_t fan_idx = 0, fan_present = 0; + + uint8_t returnData[10] = { 0 }; + uint8_t msg_data[] = { 0x36, 0xB9, 0x4C, 0x1C, 0x00, 0x02 }; //netfn = 0x36; cmd = 0xB9; + + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + struct kernel_ipmi_msg msg; + + fan_idx = (g_sensor_data[attr->index].sensor_idstring[8] - '0') - 1; + fan_idx = 5 - fan_idx; // for IX8C, FAN order is different from other QCT projects + + mutex_lock(&ipmi_lock); + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), returnData, 1); + mutex_unlock(&ipmi_lock); + + fan_present = ((returnData[0] >> fan_idx) & 0x1) ? 0 : 1; + + return sprintf(buf, "%d\n", fan_present); +} + +static ssize_t show_psupresent(struct device *dev, struct device_attribute *devattr, char *buf) +{ + int32_t psu_idx = 0; + + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + + psu_idx = g_sensor_data[attr->index].sensor_idstring[3] - '0'; + + return sprintf(buf, "%d\n", ipmi_check_psu_present(psu_idx)); +} + +static ssize_t(*const attr_show_func_ptr[SENSOR_ATTR_MAX]) (struct device *dev, struct device_attribute *devattr, char *buf) = +{ + show_label, show_crit_alarm, show_input + , show_lnc, show_lcr, show_lnr + , show_unc, show_ucr, show_unr + , show_model, show_sn, show_pwm + , show_controlmode, show_direction, show_fanpresent + , show_psupresent, show_mfrid +}; + +static ssize_t(*const attr_store_func_ptr[SENSOR_ATTR_MAX]) (struct device *dev, struct device_attribute *devattr, const char *buf, size_t count) = +{ + NULL, NULL, NULL + , NULL, NULL, NULL + , NULL, NULL, NULL + , NULL, NULL, store_pwm + , store_controlmode, NULL, NULL + , NULL, NULL +}; + +static const char *const sensor_attrnames[SENSOR_ATTR_MAX] = +{ + "%s%d_label", "%s%d_crit_alarm", "%s%d_input" + , "%s%d_lncrit", "%s%d_lcrit", "%s%d_min" + , "%s%d_ncrit", "%s%d_crit", "%s%d_max" + , "%s%d_model", "%s%d_sn", "%s%d_pwm" + , "%s%d_controlmode", "%s%d_direction", "%s%d_present" + , "%s%d_present", "%s%d_mfrid" +}; + +static int32_t create_sensor_attrs(int32_t attr_no) +{ + int32_t i = 0, j = 0; + + struct attr_info *attrdata = &g_sensor_data[attr_no].attrinfo; + +#if enable_debug_msg + printk("##### %s:%d attr_no %d\n", __FUNCTION__, __LINE__, attr_no); +#endif + + for (i = 0; i < SENSOR_ATTR_MAX; i++) { + if ((g_sensor_data[attr_no].capability >> i) & 0x01) { + snprintf(attrdata->attr_name[j], SENSOR_ATTR_NAME_LENGTH, sensor_attrnames[i], attrdata->attr_type_str, attr_no - DEBUGUSE_SHIFT); + + sysfs_attr_init(&attrdata->sd_attrs[j].dev_attr.attr); + attrdata->sd_attrs[j].dev_attr.attr.name = attrdata->attr_name[j]; + attrdata->sd_attrs[j].dev_attr.show = attr_show_func_ptr[i]; + attrdata->sd_attrs[j].dev_attr.store = attr_store_func_ptr[i]; + + attrdata->sd_attrs[j].dev_attr.attr.mode = S_IRUGO; + if (attrdata->sd_attrs[j].dev_attr.store) attrdata->sd_attrs[j].dev_attr.attr.mode |= S_IWUSR; + + attrdata->sd_attrs[j].index = attr_no - DEBUGUSE_SHIFT; + attrdata->attrs[j] = &attrdata->sd_attrs[j].dev_attr.attr; + j++; + + data->total_create_sysfs++; + } + } + + attrdata->attrs[j] = NULL; + attrdata->attr_group.attrs = attrdata->attrs; + + g_sensor_data[attr_no].attrinfo.attr_exist = 1; + + return sysfs_create_group(&data->ipmi_hwmon_dev->kobj, &attrdata->attr_group); +} + +static int32_t remove_sensor_attrs(void) +{ + int32_t i = 0; + + for (i = 0; i < data->total_sensor_id; i++) { + if (g_sensor_data[i].attrinfo.attr_exist) { + sysfs_remove_group(&data->ipmi_hwmon_dev->kobj, &g_sensor_data[i].attrinfo.attr_group); + } + } + return 0; +} + +int32_t ipmi_init_sdr_sensors_data(void) +{ + int32_t sdr_idx = 0; + int32_t err = 0; + + struct ipmi_sdr_iterator *itr = NULL; + struct sdr_get_rs *header = NULL; + + uint8_t *rec = NULL; + + mutex_lock(&ipmi_lock); + + itr = kzalloc(sizeof(struct ipmi_sdr_iterator), GFP_KERNEL); + if (itr == NULL) { + printk("%s(%d): kzalloc failure.\n", __func__, __LINE__); + goto itr_malloc_fail; + } + + header = kzalloc(sizeof(struct sdr_get_rs), GFP_KERNEL); + if (header == NULL) { + printk("%s(%d): malloc failure.\n", __func__, __LINE__); + goto header_malloc_fail; + } + + err = ipmi_sdr_start(itr); + if (err) { + printk("%s(%d): ipmi_sdr_start fail.\n", __func__, __LINE__); + goto ipmi_sdr_start_fail; + } + + data->total_sensor_id = itr->total; + rec = kzalloc(GET_SDR_ENTIRE_RECORD, GFP_KERNEL); + if (rec == NULL) { + printk("%s(%d): kzalloc failure\n", __func__, __LINE__); + goto rec_malloc_fail; + } + + g_sensor_data = kzalloc(itr->total * sizeof(struct ipmi_sensor_data), GFP_KERNEL); + if (g_sensor_data == NULL) { + printk("%s(%d): malloc failure", __func__, __LINE__); + goto g_sensor_data_malloc_fail; + } + + memset(g_sensor_data, 0x0, itr->total * sizeof(struct ipmi_sensor_data)); + + for (sdr_idx = 0; sdr_idx < itr->total; sdr_idx++) { + err = ipmi_sdr_get_header(itr, header); + if (err) { + if (err == 0xC5) { + /* C5h : Reservation Invalid */ +#if enable_debug_msg + printk("ipmi: reservation number given was invalid or the reservation was lost\n"); + printk("ipmi: retry\n"); +#endif + ipmi_sdr_get_reservation(&(itr->reservation)); + sdr_idx--; + continue; + } + printk("ipmi: Get SDR header fail,so break this request\n"); + goto ipmi_sdr_get_header_fail; + } + + + memset(rec, 0, GET_SDR_ENTIRE_RECORD); + err = ipmi_sdr_get_record(header, itr, rec); + if (err) { + if (err == 0xC5) { + /* C5h : Reservation Invalid */ +#if enable_debug_msg + printk("ipmi: reservation number given was invalid or the reservation was lost\n"); + printk("ipmi: retry\n"); +#endif + ipmi_sdr_get_reservation(&(itr->reservation)); + sdr_idx--; + continue; + } + printk("ipmi: Get SDR header fail,so break this request\n"); + goto ipmi_sdr_get_record_fail; + } + + itr->next = header->next; + + switch (header->type) + { + case SDR_RECORD_TYPE_FULL_SENSOR: + /* prepare (threshold, factor)data whilie init, for reduce reading step and improve operate speed */ + g_sensor_data[sdr_idx].addr = rec[2]; + g_sensor_data[sdr_idx].capability = SENSOR_GET_CAP_LABEL /*| SENSOR_GET_CAP_ALARM */ | SENSOR_GET_CAP_INPUT; + g_sensor_data[sdr_idx].headerinfo.header_type = header->type; + g_sensor_data[sdr_idx].headerinfo.header_byte = header->length; + + ipmi_sdr_set_sensor_threshold(sdr_idx, (struct sdr_record_full_sensor*) rec); + ipmi_sdr_set_sensor_factor(sdr_idx, (struct sdr_record_full_sensor*) rec); + + if (sdr_idx >= DEBUGUSE_SHIFT) { + err = create_sensor_attrs(sdr_idx); + if (err) { + g_sensor_data[sdr_idx].attrinfo.attr_exist = 0; + printk("[err : %d]sysfs_create_group fail in [%d] %s\n", err, sdr_idx, g_sensor_data[sdr_idx].sensor_idstring); + goto create_sysfs_fail; + } + } + + data->total_suport_sensor++; + + break; + case SDR_RECORD_TYPE_COMPACT_SENSOR: /* not supporrt now */ + case SDR_RECORD_TYPE_EVENTONLY_SENSOR: /* not supporrt now */ + case SDR_RECORD_TYPE_MC_DEVICE_LOCATOR: /* not supporrt now */ + default: + g_sensor_data[sdr_idx].attrinfo.attr_exist = 0; +#if enable_debug_msg + printk("ID[%d] : not support type [%d]\n", sdr_idx, header->type); +#endif + break; + } + } + + printk("quanta_hwmon_ipmi : detected [%d] sensor, create [%d] sysfs\n", data->total_suport_sensor, data->total_create_sysfs); + +create_sysfs_fail: +ipmi_sdr_get_header_fail: +ipmi_sdr_get_record_fail: +g_sensor_data_malloc_fail: + if (header) { + kfree(header); + header = NULL; + } + if (rec) { + kfree(rec); + rec = NULL; + } + +rec_malloc_fail: +ipmi_sdr_start_fail: +header_malloc_fail: + if (itr) { + kfree(itr); + itr = NULL; + } + +itr_malloc_fail: + mutex_unlock(&ipmi_lock); + + return err; +} + +static int32_t __init quanta_hwmon_ipmi_init(void) +{ + int32_t err = 0; + + init_completion(&g_read_complete); + + data = kzalloc(sizeof(struct quanta_hwmon_ipmi_data), GFP_KERNEL); + if (NULL == data) { + printk("alloc data fail\n"); + goto alloc_err; + } + + data->ipmi_platform_dev = platform_device_register_simple(DRVNAME, -1, NULL, 0); + err = IS_ERR(data->ipmi_platform_dev); + if (err) { + printk("platform device register fail (err : %d)\n", err); + goto device_reg_err; + } + + data->ipmi_hwmon_dev = hwmon_device_register_with_groups(NULL, DRVNAME, NULL, NULL); + err = IS_ERR(data->ipmi_hwmon_dev); + if (err) { + printk("hwmon register fail\n"); + goto hwmon_register_err; + } + + err = ipmi_create_user(0, &ipmi_hndlrs, NULL, &ipmi_mh_user); + if (err) { + printk("warning: create user fail, watchdog broken (err : %d)\n", err); + goto ipmi_create_err; + } + + mutex_init(&ipmi_lock); + err = ipmi_init_sdr_sensors_data(); + if (err) { + printk("init sensor data fail (err : %d)\n", err); + goto init_sensor_err; + } + + return 0; + +init_sensor_err: + if (g_sensor_data) { + kfree(g_sensor_data); + g_sensor_data = NULL; + } +ipmi_create_err: + hwmon_device_unregister(data->ipmi_hwmon_dev); +hwmon_register_err: + platform_device_unregister(data->ipmi_platform_dev); +device_reg_err: + if (data) { + kfree(data); + data = NULL; + } +alloc_err: + return err; +} + +static void __exit quanta_hwmon_ipmi_exit(void) +{ + remove_sensor_attrs(); + hwmon_device_unregister(data->ipmi_hwmon_dev); + + mutex_lock(&ipmi_lock); + ipmi_destroy_user(ipmi_mh_user); + mutex_unlock(&ipmi_lock); + + platform_device_unregister(data->ipmi_platform_dev); + + if (g_sensor_data) { + kfree(g_sensor_data); + g_sensor_data = NULL; + } + + if (data) { + kfree(data); + data = NULL; + } +} + +module_init(quanta_hwmon_ipmi_init); +module_exit(quanta_hwmon_ipmi_exit); + +MODULE_AUTHOR("Charcar~~Charcar~Charlie li li"); +MODULE_VERSION("2.0"); +MODULE_DESCRIPTION("Quanta BMC hardware monitor driver"); +MODULE_LICENSE("GPL"); diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix8c-56x/service/ix8c-platform-init.service b/platform/broadcom/sonic-platform-modules-quanta/ix8c-56x/service/ix8c-platform-init.service old mode 100755 new mode 100644 diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix8c-56x/setup.py b/platform/broadcom/sonic-platform-modules-quanta/ix8c-56x/setup.py index 26a3101bf7a2..7d39961b70ae 100644 --- a/platform/broadcom/sonic-platform-modules-quanta/ix8c-56x/setup.py +++ b/platform/broadcom/sonic-platform-modules-quanta/ix8c-56x/setup.py @@ -1,7 +1,6 @@ #!/usr/bin/env python import os -import sys from setuptools import setup os.listdir @@ -9,7 +8,7 @@ name='ix8c_56x', version='1.0', description='Module to initialize Quanta IX8C-56X platforms', - + packages=['ix8c_56x'], package_dir={'ix8c_56x': 'ix8c-56x/classes'}, ) diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix8c-56x/sonic_platform/__init__.py b/platform/broadcom/sonic-platform-modules-quanta/ix8c-56x/sonic_platform/__init__.py new file mode 100644 index 000000000000..4bfefa0fb636 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix8c-56x/sonic_platform/__init__.py @@ -0,0 +1,3 @@ +__all__ = ["platform", "chassis"] +from sonic_platform import * + diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix8c-56x/sonic_platform/chassis.py b/platform/broadcom/sonic-platform-modules-quanta/ix8c-56x/sonic_platform/chassis.py new file mode 100644 index 000000000000..544a3ee27c64 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix8c-56x/sonic_platform/chassis.py @@ -0,0 +1,222 @@ +#!/usr/bin/env python +# +# Name: chassis.py, version: 1.0 +# +# Description: Module contains the definitions of SONiC platform APIs +# + +try: + import sys + import time + from sonic_platform_base.chassis_base import ChassisBase + from sonic_platform.eeprom import Eeprom + from sonic_platform.psu import Psu + from sonic_platform.sfp import Sfp + from sonic_platform.fan import Fan + from sonic_platform.fan_drawer import FanDrawer + from sonic_platform.thermal import Thermal + +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +class Chassis(ChassisBase): + + def __init__(self): + ChassisBase.__init__(self) + self.__num_of_psus = 2 + self.__num_of_ports = 56 + self.__num_of_sfps = 48 + self.__num_of_fan_drawers = 6 + self.__fan_per_drawer = 2 + self.__num_of_thermals = 18 + self.__xcvr_presence = {} + + # Initialize EEPROM + self._eeprom = Eeprom() + + # Initialize watchdog + #self._watchdog = Watchdog() + + # Initialize FAN + fan_index = 1 + for drawer_index in range(1, self.__num_of_fan_drawers + 1): + drawer_fan_list = [] + for index in range(0, self.__fan_per_drawer): + fan = Fan(fan_index, False) + fan_index += 1 + self._fan_list.append(fan) + drawer_fan_list.append(fan) + fan_drawer = FanDrawer(drawer_index, drawer_fan_list) + self._fan_drawer_list.append(fan_drawer) + + # Initialize thermal + for index in range(1, self.__num_of_thermals + 1): + thermal = Thermal(index) + self._thermal_list.append(thermal) + + # Initialize PSU and PSU_FAN + for index in range(1, self.__num_of_psus + 1): + psu = Psu(index) + self._psu_list.append(psu) + + # Initialize SFP + for index in range(1, self.__num_of_ports + 1): + if index in range(1, self.__num_of_sfps + 1): + sfp = Sfp(index, 'SFP') + else: + sfp = Sfp(index, 'QSFP') + + self._sfp_list.append(sfp) + + for index in range(1, self.__num_of_ports + 1): + self.__xcvr_presence[index] = self._sfp_list[index-1].get_presence() + +############################################## +# Device methods +############################################## + + def get_sfp(self, index): + """ + Retrieves sfp represented by (1-based) index + For Quanta IX8C the index in sfputil.py starts from 1, so override + + Args: + index: An integer, the index (1-based) of the sfp to retrieve. + The index should be the sequence of a physical port in a chassis, + starting from 1. + + Returns: + An object dervied from SfpBase representing the specified sfp + """ + sfp = None + + try: + if (index == 0): + raise IndexError + sfp = self._sfp_list[index-1] + except IndexError: + sys.stderr.write("override: SFP index {} out of range (1-{})\n".format( + index, len(self._sfp_list))) + + return sfp + + def get_name(self): + """ + Retrieves the name of the chassis + Returns: + string: The name of the chassis + """ + return self._eeprom.modelstr() + + def get_presence(self): + """ + Retrieves the presence of the chassis + Returns: + bool: True if chassis is present, False if not + """ + return True + + def get_model(self): + """ + Retrieves the model number (or part number) of the chassis + Returns: + string: Model/part number of chassis + """ + return self._eeprom.part_number_str() + + def get_serial(self): + """ + Retrieves the serial number of the chassis + Returns: + string: Serial number of chassis + """ + return self._eeprom.serial_number_str() + + def get_status(self): + """ + Retrieves the operational status of the chassis + Returns: + bool: A boolean value, True if chassis is operating properly + False if not + """ + return True + +############################################## +# Chassis methods +############################################## + + def get_base_mac(self): + """ + Retrieves the base MAC address for the chassis + + Returns: + A string containing the MAC address in the format + 'XX:XX:XX:XX:XX:XX' + """ + return self._eeprom.base_mac_addr() + + def get_serial_number(self): + """ + Retrieves the hardware serial number for the chassis + + Returns: + A string containing the hardware serial number for this chassis. + """ + return self._eeprom.serial_number_str() + + def get_system_eeprom_info(self): + """ + Retrieves the full content of system EEPROM information for the chassis + + Returns: + A dictionary where keys are the type code defined in + OCP ONIE TlvInfo EEPROM format and values are their corresponding + values. + Ex. { '0x21':'AG9064', '0x22':'V1.0', '0x23':'AG9064-0109867821', + '0x24':'001c0f000fcd0a', '0x25':'02/03/2018 16:22:00', + '0x26':'01', '0x27':'REV01', '0x28':'AG9064-C2358-16G'} + """ + return self._eeprom.system_eeprom_info() + + def get_reboot_cause(self): + """ + Retrieves the cause of the previous reboot + Returns: + A tuple (string, string) where the first element is a string + containing the cause of the previous reboot. This string must be + one of the predefined strings in this class. If the first string + is "REBOOT_CAUSE_HARDWARE_OTHER", the second string can be used + to pass a description of the reboot cause. + """ + #raise NotImplementedError + return (ChassisBase.REBOOT_CAUSE_HARDWARE_OTHER, "Invalid Reason") + + def get_change_event(self, timeout=0): + """ + Currently only support transceiver change events + """ + start_ms = time.time() * 1000 + xcvr_change_event_dict = {} + event = False + + while True: + time.sleep(0.5) + for index in range(1, self.__num_of_ports + 1): + cur_xcvr_presence = self._sfp_list[index-1].get_presence() + if cur_xcvr_presence != self.__xcvr_presence[index]: + if cur_xcvr_presence is True: + xcvr_change_event_dict[str(index)] = '1' + self.__xcvr_presence[index] = True + elif cur_xcvr_presence is False: + xcvr_change_event_dict[str(index)] = '0' + self.__xcvr_presence[index] = False + event = True + + if event is True: + return True, {'sfp':xcvr_change_event_dict} + + if timeout: + now_ms = time.time() * 1000 + if (now_ms - start_ms >= timeout): + return True, {'sfp':xcvr_change_event_dict} + diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix8c-56x/sonic_platform/eeprom.py b/platform/broadcom/sonic-platform-modules-quanta/ix8c-56x/sonic_platform/eeprom.py new file mode 100644 index 000000000000..1c044638ed26 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix8c-56x/sonic_platform/eeprom.py @@ -0,0 +1,212 @@ +#!/usr/bin/env python +# +# Name: eeprom.py, version: 1.0 +# +# Description: Module contains the definitions of SONiC platform APIs +# + +try: + from sonic_eeprom import eeprom_tlvinfo +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +class Eeprom(eeprom_tlvinfo.TlvInfoDecoder): + # Display vendor extension for Quanta platforms + _TLV_DISPLAY_VENDOR_EXT = True + + def __init__(self): + self.__eeprom_path = "/sys/bus/i2c/devices/3-0054/eeprom" + super(Eeprom, self).__init__(self.__eeprom_path, 0, '', True) + self.__eeprom_tlv_dict = dict() + try: + self.__eeprom_data = self.read_eeprom() + except: + self.__eeprom_data = "N/A" + raise RuntimeError("Eeprom is not Programmed") + else: + eeprom = self.__eeprom_data + + if not self.is_valid_tlvinfo_header(eeprom): + return + + total_length = (eeprom[9] << 8) | eeprom[10] + tlv_index = self._TLV_INFO_HDR_LEN + tlv_end = self._TLV_INFO_HDR_LEN + total_length + + while (tlv_index + 2) < len(eeprom) and tlv_index < tlv_end: + if not self.is_valid_tlv(eeprom[tlv_index:]): + break + + tlv = eeprom[tlv_index:tlv_index + 2 + + eeprom[tlv_index + 1]] + code = "0x%02X" % tlv[0] + + if tlv[0] == self._TLV_CODE_VENDOR_EXT: + value = str((tlv[2] << 24) | (tlv[3] << 16) | + (tlv[4] << 8) | tlv[5]) + value += tlv[6:6 + tlv[1]].decode('ascii') + else: + value = self.decoder(None, tlv)[30:] + + self.__eeprom_tlv_dict[code] = value + if eeprom[tlv_index] == self._TLV_CODE_CRC_32: + break + + tlv_index += eeprom[tlv_index+1] + 2 + + def serial_number_str(self): + (is_valid, results) = self.get_tlv_field( + self.__eeprom_data, self._TLV_CODE_SERIAL_NUMBER) + if not is_valid: + return "N/A" + + return results[2].decode('ascii') + + def base_mac_addr(self): + (is_valid, results) = self.get_tlv_field( + self.__eeprom_data, self._TLV_CODE_MAC_BASE) + if not is_valid or results[1] != 6: + return super(TlvInfoDecoder, self).switchaddrstr(e) + + return ":".join(["{:02x}".format(T) for T in results[2]]).upper() + + def modelstr(self): + (is_valid, results) = self.get_tlv_field( + self.__eeprom_data, self._TLV_CODE_PRODUCT_NAME) + if not is_valid: + return "N/A" + + return results[2].decode('ascii') + + def part_number_str(self): + (is_valid, results) = self.get_tlv_field( + self.__eeprom_data, self._TLV_CODE_PART_NUMBER) + if not is_valid: + return "N/A" + + return results[2].decode('ascii') + + def serial_tag_str(self): + (is_valid, results) = self.get_tlv_field( + self.__eeprom_data, self._TLV_CODE_SERVICE_TAG) + if not is_valid: + return "N/A" + + return results[2].decode('ascii') + + def revision_str(self): + (is_valid, results) = self.get_tlv_field( + self.__eeprom_data, self._TLV_CODE_DEVICE_VERSION) + if not is_valid: + return "N/A" + + return results[2].decode('ascii') + + def system_eeprom_info(self): + """ + Returns a dictionary, where keys are the type code defined in + ONIE EEPROM format and values are their corresponding values + found in the system EEPROM. + """ + return self.__eeprom_tlv_dict + + def decoder(self, s, t): + ''' + Return a string representing the contents of the TLV field. The format of + the string is: + 1. The name of the field left justified in 20 characters + 2. The type code in hex right justified in 5 characters + 3. The length in decimal right justified in 4 characters + 4. The value, left justified in however many characters it takes + The vailidity of EEPROM contents and the TLV field has been verified + prior to calling this function. The 's' parameter is unused + ''' + if t[0] == self._TLV_CODE_PRODUCT_NAME: + name = "Product Name" + value = t[2:2 + t[1]].decode("ascii") + elif t[0] == self._TLV_CODE_PART_NUMBER: + name = "Part Number" + value = t[2:2 + t[1]].decode("ascii") + elif t[0] == self._TLV_CODE_SERIAL_NUMBER: + name = "Serial Number" + value = t[2:2 + t[1]].decode("ascii") + elif t[0] == self._TLV_CODE_MAC_BASE: + name = "Base MAC Address" + value = ":".join(["{:02x}".format(T) for T in t[2:8]]).upper() + elif t[0] == self._TLV_CODE_MANUF_DATE: + name = "Manufacture Date" + value = t[2:2 + t[1]].decode("ascii") + elif t[0] == self._TLV_CODE_DEVICE_VERSION: + name = "Device Version" + value = str(t[2]) + elif t[0] == self._TLV_CODE_LABEL_REVISION: + name = "Label Revision" + value = t[2:2 + t[1]].decode("ascii") + elif t[0] == self._TLV_CODE_PLATFORM_NAME: + name = "Platform Name" + value = t[2:2 + t[1]].decode("ascii") + elif t[0] == self._TLV_CODE_ONIE_VERSION: + name = "ONIE Version" + value = t[2:2 + t[1]].decode("ascii") + elif t[0] == self._TLV_CODE_MAC_SIZE: + name = "MAC Addresses" + value = str((t[2] << 8) | t[3]) + elif t[0] == self._TLV_CODE_MANUF_NAME: + name = "Manufacturer" + value = t[2:2 + t[1]].decode("ascii") + elif t[0] == self._TLV_CODE_MANUF_COUNTRY: + name = "Manufacture Country" + value = t[2:2 + t[1]].decode("ascii") + elif t[0] == self._TLV_CODE_VENDOR_NAME: + name = "Vendor Name" + value = t[2:2 + t[1]].decode("ascii") + elif t[0] == self._TLV_CODE_DIAG_VERSION: + name = "Diag Version" + # Quanta legacy format of diag version + if t[1] == 4: + value = "{}.{}.{}.{}".format('{:02x}'.format(t[2])[0], '{:02x}'.format(t[2])[1], + '{:02x}'.format(t[3])[0], '{:02x}'.format(t[3])[1]) + else: + value = t[2:2 + t[1]].decode("ascii") + elif t[0] == self._TLV_CODE_SERVICE_TAG: + name = "Service Tag" + value = t[2:2 + t[1]].decode("ascii") + elif t[0] == self._TLV_CODE_VENDOR_EXT: + name = "Vendor Extension" + value = "" + if self._TLV_DISPLAY_VENDOR_EXT: + for c in t[2:2 + t[1]]: + value += "0x%02X " % c + elif t[0] == self._TLV_CODE_CRC_32 and len(t) == 6: + name = "CRC-32" + value = "0x%08X" % ((t[2] << 24) | (t[3] << 16) | (t[4] << 8) | t[5]) + # Quanta specific codes below here. + # These decodes are lifted from their U-Boot codes + elif t[0] == self._TLV_CODE_QUANTA_MAGIC and len(t) == 3: + name = "Magic Number" + value = "0x%02X" % t[2] + elif t[0] == self._TLV_CODE_QUANTA_CRC and len(t) == 4: + name = "QUANTA-CRC" + value = "0x%04X" % ((t[2] << 8) + t[3]) + elif t[0] == self._TLV_CODE_QUANTA_CARD_TYPE and len(t) == 6: + name = "Card Type" + value = "0x%08X" % ((t[2] << 24) | (t[3] << 16) | (t[4] << 8) | t[5]) + elif t[0] == self._TLV_CODE_QUANTA_HW_VERSION and len(t) == 6: + name = "Hardware Version" + value = "%d.%d" % (t[2], t[3]) + elif t[0] == self._TLV_CODE_QUANTA_SW_VERSION and len(t) == 6: + name = "Software Version" + value = "%d.%d.%d.%d" % ((t[2] >> 4), (t[2] & 0xF), (t[3] >> 4), (t[3] & 0xF)) + elif t[0] == self._TLV_CODE_QUANTA_MANUF_DATE and len(t) == 6: + name = "Manufacture Date" + value = "%04d/%d/%d" % (((t[2] << 8) | t[3]), t[4], t[5]) + elif t[0] == self._TLV_CODE_QUANTA_MODEL_NAME: + name = "Model Name" + value = t[2:2 + t[1]].decode("ascii") + else: + name = "Unknown" + value = "" + for c in t[2:2 + t[1]]: + value += "0x%02X " % c + return name, value + diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix8c-56x/sonic_platform/fan.py b/platform/broadcom/sonic-platform-modules-quanta/ix8c-56x/sonic_platform/fan.py new file mode 100644 index 000000000000..ed3a836ba150 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix8c-56x/sonic_platform/fan.py @@ -0,0 +1,226 @@ +#!/usr/bin/env python + +############################################################################# +# Inventec d7264 +# +# Module contains an implementation of SONiC Platform Base API and +# provides the FAN information +# +############################################################################# + +try: + import logging + import os + from sonic_platform_base.fan_base import FanBase +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +############### +# Global +############### +HWMON_DIR = "/sys/class/hwmon/hwmon2/" +FAN_INDEX_START = 20 +NUM_FANTRAYS = 6 +FANS_PERTRAY = 2 + +class Fan(FanBase): + """Platform-specific Fan class""" + + def __init__(self, index, is_psu_fan=False): + self.is_psu_fan = is_psu_fan + self.fan_index = index + self.psu_fan_index_mapping = { + 1:39, + 2:49, + } + self.psu_index_mapping = { + 1:41, + 2:51, + } + if self.is_psu_fan: + self.fan_presence_attr = "power{}_present".format(self.psu_index_mapping[index]) + self.fan_pwm_attr = "fan{}_pwm".format(self.psu_fan_index_mapping[index]) + self.fan_rpm_attr = "fan{}_input".format(self.psu_fan_index_mapping[index]) + self.fan_direction_attr = "fan{}_direction".format(self.psu_fan_index_mapping[index]) + else: + self.fan_presence_attr = "fan{}_present".format(FAN_INDEX_START+(index-1)) + self.fan_pwm_attr = "fan{}_pwm".format(FAN_INDEX_START+(index-1)) + self.fan_rpm_attr = "fan{}_input".format(FAN_INDEX_START+(index-1)) + self.fan_direction_attr = "fan{}_direction".format(FAN_INDEX_START+(index-1)) + + +####################### +# private function +####################### + + def __get_attr_value(self, attr_path): + + retval = 'ERR' + if (not os.path.isfile(attr_path)): + return retval + + try: + with open(attr_path, 'r') as fd: + retval = fd.read() + except Exception as error: + logging.error("Unable to open " + attr_path + " file !") + + retval = retval.rstrip(' \t\n\r') + return retval + + + #################### + # Device base + #################### + + def get_name(self): + """ + Retrieves the name of the device + + Returns: + string: The name of the device + """ + if self.is_psu_fan: + return "PSU-{}_FAN".format(self.fan_index) + else: + fantray_index = (self.fan_index-1)/FANS_PERTRAY+1 + fan_index_intray = self.fan_index - ((fantray_index-1)*FANS_PERTRAY) + return "Fantray{}_{}".format(fantray_index, fan_index_intray) + + def get_presence(self): + """ + Retrieves the presence of the device + + Returns: + bool: True if device is present, False if not + """ + attr_path = HWMON_DIR + self.fan_presence_attr + attr_rv = self.__get_attr_value(attr_path) + if (attr_rv != 'ERR'): + if (attr_rv == '1'): + return True + else: + return False + + return None + + def get_status(self): + """ + Retrieves the operational status of the device + + Returns: + A boolean value, True if device is operating properly, False if not + """ + if self.get_presence(): + attr_path = HWMON_DIR + self.fan_rpm_attr + attr_rv = self.__get_attr_value(attr_path) + + if (attr_rv != 'ERR' and attr_rv != '0.0'): + return True + else: + return False + else: + return False + + ################# + # fan base + ################# + + def get_direction(self): + """ + Retrieves the direction of fan + + Returns: + A string, either FAN_DIRECTION_INTAKE or FAN_DIRECTION_EXHAUST + depending on fan direction + """ + attr_path = HWMON_DIR + self.fan_direction_attr + attr_rv = self.__get_attr_value(attr_path) + + if attr_rv == '2': + return self.FAN_DIRECTION_INTAKE + else: + return self.FAN_DIRECTION_EXHAUST + + def get_speed(self): + """ + Retrieves the speed of fan as a percentage of full speed + + Returns: + An integer, the percentage of full fan speed, in the range 0 (off) + to 100 (full speed) + """ + if self.get_presence(): + attr_path = HWMON_DIR + self.fan_pwm_attr + attr_rv = self.__get_attr_value(attr_path) + + if (attr_rv != 'ERR'): + return int(float(attr_rv)) + else: + return False + else: + return 0 + + def get_speed_rpm(self): + """ + Retrieves the speed of fan in revolutions per minute (RPM) + + Returns: + An integer, speed of the fan in RPM + """ + attr_path = HWMON_DIR + self.fan_rpm_attr + attr_rv = self.__get_attr_value(attr_path) + + if (attr_rv != 'ERR'): + return int(float(attr_rv)) + else: + return False + + def get_target_speed(self): + """ + Retrieves the target (expected) speed of the fan + + Returns: + An integer, the percentage of full fan speed, in the range 0 (off) + to 100 (full speed) + """ + attr_path = HWMON_DIR + self.fan_pwm_attr + attr_rv = self.__get_attr_value(attr_path) + + if (attr_rv != 'ERR'): + return int(float(attr_rv)) + else: + return False + + def get_speed_tolerance(self): + """ + Retrieves the speed tolerance of the fan + + Returns: + An integer, the percentage of variance from target speed which is + considered tolerable + """ + return 25 + + def set_status_led(self, color): + """ + Sets the state of the fan module status LED + + Args: + color: A string representing the color with which to set the + fan module status LED + + Returns: + bool: True if status LED state is set successfully, False if not + """ + return True + + def get_status_led(self): + """ + Gets the state of the fan status LED + + Returns: + A string, one of the predefined STATUS_LED_COLOR_* strings above + """ + return None diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix8c-56x/sonic_platform/fan_drawer.py b/platform/broadcom/sonic-platform-modules-quanta/ix8c-56x/sonic_platform/fan_drawer.py new file mode 100644 index 000000000000..75e954576a28 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix8c-56x/sonic_platform/fan_drawer.py @@ -0,0 +1,47 @@ +#!/usr/bin/env python + +############################################################################# +# Quanta +# +# Module contains an implementation of SONiC Platform Base API and +# provides the fan status which are available in the platform +# +############################################################################# + +try: + from sonic_platform_base.fan_drawer_base import FanDrawerBase +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class FanDrawer(FanDrawerBase): + + def __init__(self, index, fan_list): + FanDrawerBase.__init__(self) + + self._fan_list = fan_list + self._index = index + + def get_name(self): + """ + Retrieves the name of the device + Returns: + string: The name of the device + """ + return 'Fan {}'.format(self._index) + + def get_presence(self): + """ + Retrieves the presence of the FAN + Returns: + bool: True if FAN is present, False if not + """ + return self._fan_list[0].get_presence() + + def get_status(self): + """ + Retrieves the operational status of the device + Returns: + A boolean value, True if device is operating properly, False if not + """ + return self._fan_list[0].get_status() diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix8c-56x/sonic_platform/platform.py b/platform/broadcom/sonic-platform-modules-quanta/ix8c-56x/sonic_platform/platform.py new file mode 100644 index 000000000000..ddad8c4c5788 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix8c-56x/sonic_platform/platform.py @@ -0,0 +1,20 @@ +#!/usr/bin/env python +# +# Name: platform.py, version: 1.0 +# +# Description: Module contains the definitions of SONiC platform APIs +# + + +try: + from sonic_platform_base.platform_base import PlatformBase + from sonic_platform.chassis import Chassis +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class Platform(PlatformBase): + + def __init__(self): + PlatformBase.__init__(self) + self._chassis = Chassis() \ No newline at end of file diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix8c-56x/sonic_platform/psu.py b/platform/broadcom/sonic-platform-modules-quanta/ix8c-56x/sonic_platform/psu.py new file mode 100644 index 000000000000..941d8faef4f5 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix8c-56x/sonic_platform/psu.py @@ -0,0 +1,223 @@ +#!/usr/bin/env python +# +# Name: psu.py, version: 1.0 +# +# Description: Module contains the definitions of SONiC platform APIs +# + +try: + import logging + import os + from sonic_platform_base.psu_base import PsuBase + from sonic_platform.fan import Fan +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +HWMON_DIR = "/sys/class/hwmon/hwmon2/" + +class Psu(PsuBase): + def __init__(self, index): + PsuBase.__init__(self) + fan = Fan(index, True) + self._fan_list.append(fan) + + self.psu_index_mapping = { + 1:41, + 2:51, + } + self.psu_powerin_index_mapping = { + 1:40, + 2:50, + } + self.psu_current_index_mapping = { + 1:38, + 2:48, + } + self.psu_voltageout_index_mapping = { + 1:46, + 2:56, + } + self.index = index + self.psu_presence_attr = "power{}_present".format(self.psu_index_mapping[self.index]) + self.psu_status_attr = "curr{}_input".format(self.psu_current_index_mapping[self.index]) + self.psu_power_in_attr = "power{}_input".format(self.psu_powerin_index_mapping[self.index]) + self.psu_power_out_attr = "power{}_input".format(self.psu_index_mapping[self.index]) + self.psu_voltage_out_attr = "in{}_input".format(self.psu_voltageout_index_mapping[self.index]) + self.psu_current_out_attr = "curr{}_input".format(self.psu_current_index_mapping[self.index]) + self.psu_serial_attr = "power{}_sn".format(self.psu_index_mapping[self.index]) + self.psu_model_attr = "power{}_model".format(self.psu_index_mapping[self.index]) + + def __get_attr_value(self, attr_path): + + retval = 'ERR' + if (not os.path.isfile(attr_path)): + return retval + + try: + with open(attr_path, 'r') as fd: + retval = fd.read() + except Exception as error: + logging.error("Unable to open " + attr_path + " file !") + + retval = retval.rstrip(' \t\n\r') + fd.close() + return retval + +############################################## +# Device methods +############################################## + + def get_name(self): + """ + Retrieves the name of the device + + Returns: + string: The name of the device + """ + return "PSU{}".format(self.index) + + def get_presence(self): + """ + Retrieves the presence of the device + + Returns: + bool: True if device is present, False if not + """ + presence = False + attr_path = HWMON_DIR+self.psu_presence_attr + attr_normal = '1' + + attr_rv = self.__get_attr_value(attr_path) + if (attr_rv != 'ERR'): + if (attr_rv == attr_normal): + presence = True + + return presence + + def get_model(self): + """ + Retrieves the model number (or part number) of the device + + Returns: + string: Model/part number of device + """ + model = "N/A" + attr_path = HWMON_DIR+self.psu_model_attr + attr_rv = self.__get_attr_value(attr_path) + if (attr_rv != 'ERR'): + model = attr_rv + + return model + + def get_serial(self): + """ + Retrieves the serial number of the device + + Returns: + string: Serial number of device + """ + serial = "N/A" + attr_path = HWMON_DIR+self.psu_serial_attr + + attr_rv = self.__get_attr_value(attr_path) + if (attr_rv != 'ERR'): + serial = attr_rv + + return serial + + def get_status(self): + """ + Retrieves the operational status of the device + + Returns: + A boolean value, True if device is operating properly, False if not + """ + status = False + attr_path = HWMON_DIR+self.psu_status_attr + + attr_rv = self.__get_attr_value(attr_path) + if (attr_rv != 'ERR'): + attr_rv, dummy = attr_rv.split('.', 1) + if (int(attr_rv) != 0): + status = True + + return status + +############################################## +# PSU methods +############################################## + + def get_voltage(self): + """ + Retrieves current PSU voltage output + + Returns: + A float number, the output voltage in volts, + e.g. 12.1 + """ + voltage_out = 0.0 + attr_path = HWMON_DIR+self.psu_voltage_out_attr + + attr_rv = self.__get_attr_value(attr_path) + if (attr_rv != 'ERR'): + attr_rv, dummy = attr_rv.split('.', 1) + voltage_out = float(attr_rv) / 1000 + + return voltage_out + + def get_current(self): + """ + Retrieves present electric current supplied by PSU + + Returns: + A float number, the electric current in amperes, e.g 15.4 + """ + current_out = 0.0 + attr_path = HWMON_DIR+self.psu_current_out_attr + + attr_rv = self.__get_attr_value(attr_path) + if (attr_rv != 'ERR'): + attr_rv, dummy = attr_rv.split('.', 1) + current_out = float(attr_rv) / 1000 + + return current_out + + def get_power(self): + """ + Retrieves current energy supplied by PSU + + Returns: + A float number, the power in watts, e.g. 302.6 + """ + power_out = 0.0 + attr_path = HWMON_DIR+self.psu_power_out_attr + + attr_rv = self.__get_attr_value(attr_path) + if (attr_rv != 'ERR'): + attr_rv, dummy = attr_rv.split('.', 1) + power_out = float(attr_rv) / 1000 + + return power_out + + def get_powergood_status(self): + """ + Retrieves the powergood status of PSU + + Returns: + A boolean, True if PSU has stablized its output voltages and passed all + its internal self-tests, False if not. + """ + return self.get_status() + + def get_status_led(self): + """ + Gets the state of the PSU status LED + + Returns: + A string, one of the predefined STATUS_LED_COLOR_* strings above + """ + if self.get_powergood_status(): + return self.STATUS_LED_COLOR_GREEN + else: + return self.STATUS_LED_COLOR_OFF + diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix8c-56x/sonic_platform/sfp.py b/platform/broadcom/sonic-platform-modules-quanta/ix8c-56x/sonic_platform/sfp.py new file mode 100644 index 000000000000..a85b225afec8 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix8c-56x/sonic_platform/sfp.py @@ -0,0 +1,1625 @@ +#!/usr/bin/env python + +############################################################################# +# Quanta +# +# Sfp contains an implementation of SONiC Platform Base API and +# provides the sfp device status which are available in the platform +# +############################################################################# + +import os +import time +#import subprocess +#import sonic_device_util +from ctypes import create_string_buffer + +try: + from sonic_platform_base.sfp_base import SfpBase +# from sonic_platform_base.sonic_eeprom import eeprom_dts + from sonic_platform_base.sonic_sfp.sff8472 import sff8472InterfaceId + from sonic_platform_base.sonic_sfp.sff8472 import sff8472Dom + from sonic_platform_base.sonic_sfp.sff8436 import sff8436InterfaceId + from sonic_platform_base.sonic_sfp.sff8436 import sff8436Dom + from sonic_platform_base.sonic_sfp.sfputilhelper import SfpUtilHelper +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +QSFP_INFO_OFFSET = 128 +QSFP_DOM_OFFSET = 0 +SFP_INFO_OFFSET = 0 +SFP_DOM_OFFSET = 256 + +# definitions of the offset and width for values in XCVR info eeprom +XCVR_INTFACE_BULK_OFFSET = 0 +XCVR_INTFACE_BULK_WIDTH_QSFP = 20 +XCVR_INTFACE_BULK_WIDTH_SFP = 21 +XCVR_TYPE_OFFSET = 0 +XCVR_TYPE_WIDTH = 1 +XCVR_EXT_TYPE_OFFSET = 1 +XCVR_EXT_TYPE_WIDTH = 1 +XCVR_CONNECTOR_OFFSET = 2 +XCVR_CONNECTOR_WIDTH = 1 +XCVR_COMPLIANCE_CODE_OFFSET = 3 +XCVR_COMPLIANCE_CODE_WIDTH = 8 +XCVR_ENCODING_OFFSET = 11 +XCVR_ENCODING_WIDTH = 1 +XCVR_NBR_OFFSET = 12 +XCVR_NBR_WIDTH = 1 +XCVR_EXT_RATE_SEL_OFFSET = 13 +XCVR_EXT_RATE_SEL_WIDTH = 1 +XCVR_CABLE_LENGTH_OFFSET = 14 +XCVR_CABLE_LENGTH_WIDTH_QSFP = 5 +XCVR_CABLE_LENGTH_WIDTH_SFP = 6 +XCVR_VENDOR_NAME_OFFSET = 20 +XCVR_VENDOR_NAME_WIDTH = 16 +XCVR_VENDOR_OUI_OFFSET = 37 +XCVR_VENDOR_OUI_WIDTH = 3 +XCVR_VENDOR_PN_OFFSET = 40 +XCVR_VENDOR_PN_WIDTH = 16 +XCVR_HW_REV_OFFSET = 56 +XCVR_HW_REV_WIDTH_QSFP = 2 +XCVR_HW_REV_WIDTH_SFP = 4 +XCVR_VENDOR_SN_OFFSET = 68 +XCVR_VENDOR_SN_WIDTH = 16 +XCVR_VENDOR_DATE_OFFSET = 84 +XCVR_VENDOR_DATE_WIDTH = 8 +XCVR_DOM_CAPABILITY_OFFSET = 92 +XCVR_DOM_CAPABILITY_WIDTH = 2 + +XCVR_INTERFACE_DATA_START = 0 +XCVR_INTERFACE_DATA_SIZE = 92 + +QSFP_DOM_BULK_DATA_START = 22 +QSFP_DOM_BULK_DATA_SIZE = 36 +SFP_DOM_BULK_DATA_START = 96 +SFP_DOM_BULK_DATA_SIZE = 10 + +# Offset for values in QSFP eeprom +QSFP_DOM_REV_OFFSET = 1 +QSFP_DOM_REV_WIDTH = 1 +QSFP_TEMPE_OFFSET = 22 +QSFP_TEMPE_WIDTH = 2 +QSFP_VOLT_OFFSET = 26 +QSFP_VOLT_WIDTH = 2 +QSFP_VERSION_COMPLIANCE_OFFSET = 1 +QSFP_VERSION_COMPLIANCE_WIDTH = 1 +QSFP_CHANNL_MON_OFFSET = 34 +QSFP_CHANNL_MON_WIDTH = 16 +QSFP_CHANNL_MON_WITH_TX_POWER_WIDTH = 24 +QSFP_CHANNL_DISABLE_STATUS_OFFSET = 86 +QSFP_CHANNL_DISABLE_STATUS_WIDTH = 1 +QSFP_CHANNL_RX_LOS_STATUS_OFFSET = 3 +QSFP_CHANNL_RX_LOS_STATUS_WIDTH = 1 +QSFP_CHANNL_TX_FAULT_STATUS_OFFSET = 4 +QSFP_CHANNL_TX_FAULT_STATUS_WIDTH = 1 +QSFP_CONTROL_OFFSET = 86 +QSFP_CONTROL_WIDTH = 8 +QSFP_MODULE_MONITOR_OFFSET = 0 +QSFP_MODULE_MONITOR_WIDTH = 9 +QSFP_MODULE_THRESHOLD_OFFSET = 512 +QSFP_MODULE_THRESHOLD_WIDTH = 24 +QSFP_CHANNEL_THRESHOLD_OFFSET = 560 +QSFP_CHANNEL_THRESHOLD_WIDTH = 16 +QSFP_POWEROVERRIDE_OFFSET = 93 +QSFP_POWEROVERRIDE_WIDTH = 1 +QSFP_POWEROVERRIDE_BIT = 0 +QSFP_POWERSET_BIT = 1 +QSFP_OPTION_VALUE_OFFSET = 192 +QSFP_OPTION_VALUE_WIDTH = 4 + +SFP_TEMPE_OFFSET = 96 +SFP_TEMPE_WIDTH = 2 +SFP_VOLT_OFFSET = 98 +SFP_VOLT_WIDTH = 2 +SFP_CHANNL_MON_OFFSET = 100 +SFP_CHANNL_MON_WIDTH = 6 +SFP_MODULE_THRESHOLD_OFFSET = 0 +SFP_MODULE_THRESHOLD_WIDTH = 40 +SFP_CHANNL_THRESHOLD_OFFSET = 112 +SFP_CHANNL_THRESHOLD_WIDTH = 2 +SFP_STATUS_CONTROL_OFFSET = 110 +SFP_STATUS_CONTROL_WIDTH = 1 +SFP_TX_DISABLE_HARD_BIT = 7 +SFP_TX_DISABLE_SOFT_BIT = 6 + +qsfp_cable_length_tup = ('Length(km)', 'Length OM3(2m)', + 'Length OM2(m)', 'Length OM1(m)', + 'Length Cable Assembly(m)') + +sfp_cable_length_tup = ('LengthSMFkm-UnitsOfKm', 'LengthSMF(UnitsOf100m)', + 'Length50um(UnitsOf10m)', 'Length62.5um(UnitsOfm)', + 'LengthCable(UnitsOfm)', 'LengthOM3(UnitsOf10m)') + +sfp_compliance_code_tup = ('10GEthernetComplianceCode', 'InfinibandComplianceCode', + 'ESCONComplianceCodes', 'SONETComplianceCodes', + 'EthernetComplianceCodes','FibreChannelLinkLength', + 'FibreChannelTechnology', 'SFP+CableTechnology', + 'FibreChannelTransmissionMedia','FibreChannelSpeed') + +qsfp_compliance_code_tup = ('10/40G Ethernet Compliance Code', 'SONET Compliance codes', + 'SAS/SATA compliance codes', 'Gigabit Ethernet Compliant codes', + 'Fibre Channel link length/Transmitter Technology', + 'Fibre Channel transmission media', 'Fibre Channel Speed') + +SFP_TYPE = "SFP" +QSFP_TYPE = "QSFP" + + +class Sfp(SfpBase): + """Platform-specific Sfp class""" + + # Port number + PORT_START = 1 + PORT_END = 56 + QSFP_START = 49 + QSFP_END = 56 + + dom_supported = True + dom_temp_supported = True + dom_volt_supported = True + dom_rx_power_supported = True + dom_tx_power_supported = True + dom_tx_disable_supported = True + calibration = 1 + + # Path to QSFP sysfs + PLATFORM_ROOT_PATH = "/usr/share/sonic/device" + PMON_HWSKU_PATH = "/usr/share/sonic/hwsku" + HOST_CHK_CMD = "docker > /dev/null 2>&1" + + PLATFORM = "x86_64-quanta_ix8c_bwde-r0" + HWSKU = "Quanta-IX8C-56X" + + def __init__(self, sfp_index, sfp_type): + # Init index + self.index = sfp_index + self.port_num = self.index + #self.dom_supported = False + self.sfp_type = sfp_type + # Init eeprom path + eeprom_path = '/sys/bus/i2c/devices/i2c-{0}/{0}-0050/eeprom' + self.port_to_eeprom_mapping = {} + self.port_to_i2c_mapping = { + 1 : 13, + 2 : 14, + 3 : 15, + 4 : 16, + 5 : 17, + 6 : 18, + 7 : 19, + 8 : 20, + 9 : 21, + 10 : 22, + 11 : 23, + 12 : 24, + 13 : 25, + 14 : 26, + 15 : 27, + 16 : 28, + 17 : 29, + 18 : 30, + 19 : 31, + 20 : 32, + 21 : 33, + 22 : 34, + 23 : 35, + 24 : 36, + 25 : 37, + 26 : 38, + 27 : 39, + 28 : 40, + 29 : 41, + 30 : 42, + 31 : 43, + 32 : 44, + 33 : 45, + 34 : 46, + 35 : 47, + 36 : 48, + 37 : 49, + 38 : 50, + 39 : 51, + 40 : 52, + 41 : 53, + 42 : 54, + 43 : 55, + 44 : 56, + 45 : 57, + 46 : 58, + 47 : 59, + 48 : 60, + 49 : 61,#QSFP49 + 50 : 62,#QSFP50 + 51 : 63,#QSFP51 + 52 : 64,#QSFP52 + 53 : 65,#QSFP53 + 54 : 66,#QSFP54 + 55 : 67,#QSFP55 + 56 : 68,#QSFP56 + } + + for x in range(self.PORT_START, self.PORT_END + 1): + port_eeprom_path = eeprom_path.format(self.port_to_i2c_mapping[x]) + self.port_to_eeprom_mapping[x] = port_eeprom_path + + self.info_dict_keys = ['type', 'hardware_rev', 'serialnum', 'manufacturer', + 'model', 'connector', 'encoding', 'ext_identifier', + 'ext_rateselect_compliance', 'cable_type', 'cable_length', + 'nominal_bit_rate', 'specification_compliance', 'vendor_date', + 'vendor_oui', 'application_advertisement'] + + self.dom_dict_keys = ['rx_los', 'tx_fault', 'reset_status', 'power_lpmode', + 'tx_disable', 'tx_disable_channel', 'temperature', 'voltage', + 'rx1power', 'rx2power', 'rx3power', 'rx4power', 'tx1bias', 'tx2bias', + 'tx3bias', 'tx4bias', 'tx1power', 'tx2power', 'tx3power', 'tx4power'] + + self.threshold_dict_keys = ['temphighalarm', 'temphighwarning', + 'templowalarm', 'templowwarning', 'vcchighalarm', 'vcchighwarning', + 'vcclowalarm', 'vcclowwarning', 'rxpowerhighalarm', 'rxpowerhighwarning', + 'rxpowerlowalarm', 'rxpowerlowwarning', 'txpowerhighalarm', + 'txpowerhighwarning', 'txpowerlowalarm', 'txpowerlowwarning', + 'txbiashighalarm', 'txbiashighwarning', 'txbiaslowalarm', 'txbiaslowwarning'] + + SfpBase.__init__(self) + + + def _convert_string_to_num(self, value_str): + if "-inf" in value_str: + return 'N/A' + elif "Unknown" in value_str: + return 'N/A' + elif 'dBm' in value_str: + t_str = value_str.rstrip('dBm') + return float(t_str) + elif 'mA' in value_str: + t_str = value_str.rstrip('mA') + return float(t_str) + elif 'C' in value_str: + t_str = value_str.rstrip('C') + return float(t_str) + elif 'Volts' in value_str: + t_str = value_str.rstrip('Volts') + return float(t_str) + else: + return 'N/A' + + def __read_txt_file(self, file_path): + try: + with open(file_path, 'r') as fd: + data = fd.read() + return data.strip() + except IOError: + pass + return "" + + def __is_host(self): + return os.system(self.HOST_CHK_CMD) == 0 + + def __get_path_to_port_config_file(self): + platform_path = "/".join([self.PLATFORM_ROOT_PATH, self.PLATFORM]) + hwsku_path = "/".join([platform_path, self.HWSKU] + ) if self.__is_host() else self.PMON_HWSKU_PATH + return "/".join([hwsku_path, "port_config.ini"]) + + def get_presence(self): + """ + Retrieves the presence of the SFP module + Returns: + bool: True if SFP module is present, False if not + """ + # Check for invalid port_num + if self.port_num < self.PORT_START or self.port_num > self.PORT_END: + return False + + try: + if self.sfp_type == SFP_TYPE: + reg_file = open("/sys/class/cpld-sfp28/port-"+str(self.port_num)+"/pre_n") + else: + reg_file = open("/sys/class/gpio/gpio" + +str((self.port_num-self.QSFP_START)*4+34)+"/value") + except IOError as e: + print ("Error: unable to open file: %s" % str(e)) + return False + + reg_value = reg_file.readline().rstrip() + reg_file.close() + if self.sfp_type == SFP_TYPE: + if reg_value == '1': + return True + else: + if reg_value == '0': + return True + + return False + + def __read_eeprom_specific_bytes(self, offset, num_bytes): + sysfsfile_eeprom = None + eeprom_raw = [] + for i in range(0, num_bytes): + eeprom_raw.append("0x00") + + sysfs_sfp_i2c_client_eeprom_path = self.port_to_eeprom_mapping[self.port_num] + try: + sysfsfile_eeprom = open( + sysfs_sfp_i2c_client_eeprom_path, mode="rb", buffering=0) + sysfsfile_eeprom.seek(offset) + raw = sysfsfile_eeprom.read(num_bytes) + for n in range(0, num_bytes): + eeprom_raw[n] = hex(raw[n])[2:].zfill(2) + except Exception: + eeprom_raw = None + finally: + if sysfsfile_eeprom: + sysfsfile_eeprom.close() + + return eeprom_raw + + def __convert_string_to_num(self, value_str): + if "-inf" in value_str: + return 'N/A' + elif "Unknown" in value_str: + return 'N/A' + elif 'dBm' in value_str: + t_str = value_str.rstrip('dBm') + return float(t_str) + elif 'mA' in value_str: + t_str = value_str.rstrip('mA') + return float(t_str) + elif 'C' in value_str: + t_str = value_str.rstrip('C') + return float(t_str) + elif 'Volts' in value_str: + t_str = value_str.rstrip('Volts') + return float(t_str) + else: + return 'N/A' + + def _dom_capability_detect(self): + if not self.get_presence(): + self.dom_supported = False + self.dom_temp_supported = False + self.dom_volt_supported = False + self.dom_rx_power_supported = False + self.dom_tx_power_supported = False + self.calibration = 0 + return + + if self.sfp_type == "QSFP": + self.calibration = 1 + sfpi_obj = sff8436InterfaceId() + if sfpi_obj is None: + self.dom_supported = False + offset = 128 + + # QSFP capability byte parse, through this byte can know whether it support tx_power or not. + # TODO: in the future when decided to migrate to support SFF-8636 instead of SFF-8436, + # need to add more code for determining the capability and version compliance + # in SFF-8636 dom capability definitions evolving with the versions. + qsfp_dom_capability_raw = self.__read_eeprom_specific_bytes( + (offset + XCVR_DOM_CAPABILITY_OFFSET), XCVR_DOM_CAPABILITY_WIDTH) + if qsfp_dom_capability_raw is not None: + qsfp_dom_capability = int(qsfp_dom_capability_raw[0], 16) + + qsfp_version_compliance_raw = self.__read_eeprom_specific_bytes( + QSFP_VERSION_COMPLIANCE_OFFSET, QSFP_VERSION_COMPLIANCE_OFFSET) + if qsfp_version_compliance_raw is not None: + qsfp_version_compliance = int(qsfp_version_compliance_raw[0], 16) + else: + self.dom_supported = False + self.dom_temp_supported = False + self.dom_volt_supported = False + self.dom_rx_power_supported = False + self.dom_tx_power_supported = False + self.calibration = 0 + return + + if qsfp_version_compliance >= 0x08: + self.dom_temp_supported = (qsfp_dom_capability & 0x20 != 0) + self.dom_volt_supported = (qsfp_dom_capability & 0x10 != 0) + self.dom_rx_power_supported = (qsfp_dom_capability & 0x08 != 0) + self.dom_tx_power_supported = (qsfp_dom_capability & 0x04 != 0) + else: + self.dom_temp_supported = True + self.dom_volt_supported = True + self.dom_rx_power_supported = (qsfp_dom_capability & 0x08 != 0) + self.dom_tx_power_supported = True + self.dom_supported = True + self.calibration = 1 + self.dom_tx_disable_supported = True + else: + self.dom_supported = False + self.dom_temp_supported = False + self.dom_volt_supported = False + self.dom_rx_power_supported = False + self.dom_tx_power_supported = False + self.calibration = 0 + elif self.sfp_type == "SFP": + sfpi_obj = sff8472InterfaceId() + if sfpi_obj is None: + return None + sfp_dom_capability_raw = self.__read_eeprom_specific_bytes( + XCVR_DOM_CAPABILITY_OFFSET, XCVR_DOM_CAPABILITY_WIDTH) + if sfp_dom_capability_raw is not None: + sfp_dom_capability = int(sfp_dom_capability_raw[0], 16) + self.dom_supported = (sfp_dom_capability & 0x40 != 0) + if self.dom_supported: + self.dom_temp_supported = True + self.dom_volt_supported = True + self.dom_rx_power_supported = True + self.dom_tx_power_supported = True + if sfp_dom_capability & 0x20 != 0: + self.calibration = 1 + elif sfp_dom_capability & 0x10 != 0: + self.calibration = 2 + else: + self.calibration = 0 + else: + self.dom_temp_supported = False + self.dom_volt_supported = False + self.dom_rx_power_supported = False + self.dom_tx_power_supported = False + self.calibration = 0 + self.dom_tx_disable_supported = (int(sfp_dom_capability_raw[1], 16) & 0x40 != 0) + else: + self.dom_supported = False + self.dom_temp_supported = False + self.dom_volt_supported = False + self.dom_rx_power_supported = False + self.dom_tx_power_supported = False + + def get_transceiver_info(self): + """ + Retrieves transceiver info of this SFP + Returns: + A dict which contains following keys/values : + ======================================================================== + keys |Value Format |Information + ---------------------------|---------------|---------------------------- + type |1*255VCHAR |type of SFP + hardware_rev |1*255VCHAR |hardware version of SFP + serialnum |1*255VCHAR |serial number of the SFP + manufacturer |1*255VCHAR |SFP vendor name + model |1*255VCHAR |SFP model name + connector |1*255VCHAR |connector information + encoding |1*255VCHAR |encoding information + ext_identifier |1*255VCHAR |extend identifier + ext_rateselect_compliance |1*255VCHAR |extended rateSelect compliance + cable_length |INT |cable length in m + nominal_bit_rate |INT |nominal bit rate by 100Mbs + specification_compliance |1*255VCHAR |specification compliance + vendor_date |1*255VCHAR |vendor date + vendor_oui |1*255VCHAR |vendor OUI + application_advertisement |1*255VCHAR |supported applications advertisement + ======================================================================== + """ + + transceiver_info_dict = {} + compliance_code_dict = {} + transceiver_info_dict = dict.fromkeys(self.info_dict_keys, 'N/A') + transceiver_info_dict['specification_compliance'] = '{}' + if not self.get_presence(): + return transceiver_info_dict + + if self.sfp_type == QSFP_TYPE: + offset = QSFP_INFO_OFFSET + vendor_rev_width = XCVR_HW_REV_WIDTH_QSFP + interface_info_bulk_width = XCVR_INTFACE_BULK_WIDTH_QSFP + + sfpi_obj = sff8436InterfaceId() + if sfpi_obj is None: + print("Error: sfp_object open failed") + return transceiver_info_dict + + elif self.sfp_type == SFP_TYPE: + offset = SFP_INFO_OFFSET + vendor_rev_width = XCVR_HW_REV_WIDTH_SFP + interface_info_bulk_width = XCVR_INTFACE_BULK_WIDTH_SFP + + sfpi_obj = sff8472InterfaceId() + if sfpi_obj is None: + print("Error: sfp_object open failed") + return transceiver_info_dict + else: + return transceiver_info_dict + + # Add retry for xcvr eeprom to get ready + max_retry = 10 + for i in range(0,max_retry): + sfp_interface_bulk_raw = self.__read_eeprom_specific_bytes( + offset + XCVR_INTERFACE_DATA_START, XCVR_INTERFACE_DATA_SIZE) + if sfp_interface_bulk_raw is not None: + break + else: + if not self.get_presence(): + return transceiver_info_dict + elif i == max_retry-1: + pass + else: + time.sleep(0.5) + + if sfp_interface_bulk_raw is None: + return transceiver_info_dict + + start = XCVR_INTFACE_BULK_OFFSET - XCVR_INTERFACE_DATA_START + end = start + interface_info_bulk_width + sfp_interface_bulk_data = sfpi_obj.parse_sfp_info_bulk(sfp_interface_bulk_raw[start : end], 0) + + start = XCVR_VENDOR_NAME_OFFSET - XCVR_INTERFACE_DATA_START + end = start + XCVR_VENDOR_NAME_WIDTH + sfp_vendor_name_data = sfpi_obj.parse_vendor_name(sfp_interface_bulk_raw[start : end], 0) + + start = XCVR_VENDOR_PN_OFFSET - XCVR_INTERFACE_DATA_START + end = start + XCVR_VENDOR_PN_WIDTH + sfp_vendor_pn_data = sfpi_obj.parse_vendor_pn(sfp_interface_bulk_raw[start : end], 0) + + start = XCVR_HW_REV_OFFSET - XCVR_INTERFACE_DATA_START + end = start + vendor_rev_width + sfp_vendor_rev_data = sfpi_obj.parse_vendor_rev(sfp_interface_bulk_raw[start : end], 0) + + start = XCVR_VENDOR_SN_OFFSET - XCVR_INTERFACE_DATA_START + end = start + XCVR_VENDOR_SN_WIDTH + sfp_vendor_sn_data = sfpi_obj.parse_vendor_sn(sfp_interface_bulk_raw[start : end], 0) + + start = XCVR_VENDOR_OUI_OFFSET - XCVR_INTERFACE_DATA_START + end = start + XCVR_VENDOR_OUI_WIDTH + sfp_vendor_oui_data = sfpi_obj.parse_vendor_oui(sfp_interface_bulk_raw[start : end], 0) + + start = XCVR_VENDOR_DATE_OFFSET - XCVR_INTERFACE_DATA_START + end = start + XCVR_VENDOR_DATE_WIDTH + sfp_vendor_date_data = sfpi_obj.parse_vendor_date(sfp_interface_bulk_raw[start : end], 0) + transceiver_info_dict['type'] = sfp_interface_bulk_data \ + ['data']['type']['value'] + transceiver_info_dict['manufacturer'] = sfp_vendor_name_data \ + ['data']['Vendor Name']['value'] + transceiver_info_dict['model'] = sfp_vendor_pn_data \ + ['data']['Vendor PN']['value'] + transceiver_info_dict['hardware_rev'] = sfp_vendor_rev_data \ + ['data']['Vendor Rev']['value'] + transceiver_info_dict['serial'] = sfp_vendor_sn_data \ + ['data']['Vendor SN']['value'] + transceiver_info_dict['vendor_oui'] = sfp_vendor_oui_data \ + ['data']['Vendor OUI']['value'] + transceiver_info_dict['vendor_date'] = sfp_vendor_date_data \ + ['data']['VendorDataCode(YYYY-MM-DD Lot)']['value'] + transceiver_info_dict['connector'] = sfp_interface_bulk_data \ + ['data']['Connector']['value'] + transceiver_info_dict['encoding'] = sfp_interface_bulk_data \ + ['data']['EncodingCodes']['value'] + transceiver_info_dict['ext_identifier'] = sfp_interface_bulk_data \ + ['data']['Extended Identifier']['value'] + transceiver_info_dict['ext_rateselect_compliance'] = sfp_interface_bulk_data \ + ['data']['RateIdentifier']['value'] + transceiver_info_dict['type_abbrv_name'] = 'N/A' + if self.sfp_type == QSFP_TYPE: + for key in qsfp_cable_length_tup: + if key in sfp_interface_bulk_data['data']: + transceiver_info_dict['cable_type'] = key + transceiver_info_dict['cable_length'] = str( + sfp_interface_bulk_data['data'][key]['value']) + + for key in qsfp_compliance_code_tup: + if key in sfp_interface_bulk_data['data']['Specification compliance']['value']: + compliance_code_dict[key] = sfp_interface_bulk_data \ + ['data']['Specification compliance']['value'][key]['value'] + transceiver_info_dict['specification_compliance'] = str(compliance_code_dict) + + transceiver_info_dict['nominal_bit_rate'] = str(sfp_interface_bulk_data \ + ['data']['Nominal Bit Rate(100Mbs)']['value']) + else: + for key in sfp_cable_length_tup: + if key in sfp_interface_bulk_data['data']: + transceiver_info_dict['cable_type'] = key + transceiver_info_dict['cable_length'] = str( + sfp_interface_bulk_data['data'][key]['value']) + + for key in sfp_compliance_code_tup: + if key in sfp_interface_bulk_data['data']['Specification compliance']['value']: + compliance_code_dict[key] = sfp_interface_bulk_data \ + ['data']['Specification compliance']['value'][key]['value'] + transceiver_info_dict['specification_compliance'] = str(compliance_code_dict) + + transceiver_info_dict['nominal_bit_rate'] = str(sfp_interface_bulk_data \ + ['data']['NominalSignallingRate(UnitsOf100Mbd)']['value']) + + return transceiver_info_dict + + def get_transceiver_bulk_status(self): + """ + Retrieves transceiver bulk status of this SFP + Returns: + A dict which contains following keys/values : + ======================================================================== + keys |Value Format |Information + ---------------------------|---------------|---------------------------- + rx_los |BOOLEAN |RX loss-of-signal status, True if has RX los, False if not. + tx_fault |BOOLEAN |TX fault status, True if has TX fault, False if not. + reset_status |BOOLEAN |reset status, True if SFP in reset, False if not. + lp_mode |BOOLEAN |low power mode status, True in lp mode, False if not. + tx_disable |BOOLEAN |TX disable status, True TX disabled, False if not. + tx_disabled_channel |HEX |disabled TX channels in hex, bits 0 to 3 represent channel 0 + | |to channel 3. + temperature |INT |module temperature in Celsius + voltage |INT |supply voltage in mV + txbias |INT |TX Bias Current in mA, n is the channel number, + | |for example, tx2bias stands for tx bias of channel 2. + rxpower |INT |received optical power in mW, n is the channel number, + | |for example, rx2power stands for rx power of channel 2. + txpower |INT |TX output power in mW, n is the channel number, + | |for example, tx2power stands for tx power of channel 2. + ======================================================================== + """ + + if not self.get_presence(): + return {} + + self._dom_capability_detect() + + if self.sfp_type == QSFP_TYPE: + sfpd_obj = sff8436Dom() + sfpi_obj = sff8436InterfaceId() + + if not sfpi_obj or not sfpd_obj: + return {} + + transceiver_dom_info_dict = dict.fromkeys(self.dom_dict_keys, 'N/A') + offset = QSFP_DOM_OFFSET + offset_xcvr = QSFP_INFO_OFFSET + + # QSFP capability byte parse, through this byte can know whether it support tx_power or not. + # TODO: in the future when decided to migrate to support SFF-8636 instead of SFF-8436, + # need to add more code for determining the capability and version compliance + # in SFF-8636 dom capability definitions evolving with the versions. + qsfp_dom_capability_raw = self.__read_eeprom_specific_bytes( + (offset_xcvr + XCVR_DOM_CAPABILITY_OFFSET), XCVR_DOM_CAPABILITY_WIDTH) + if qsfp_dom_capability_raw is not None: + qsfp_dom_capability_data = sfpi_obj.parse_dom_capability( + qsfp_dom_capability_raw, 0) + else: + return None + + dom_temperature_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_TEMPE_OFFSET), QSFP_TEMPE_WIDTH) + if dom_temperature_raw is not None: + dom_temperature_data = sfpd_obj.parse_temperature( + dom_temperature_raw, 0) + transceiver_dom_info_dict['temperature'] = dom_temperature_data['data']['Temperature']['value'] + + dom_voltage_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_VOLT_OFFSET), QSFP_VOLT_WIDTH) + if dom_voltage_raw is not None: + dom_voltage_data = sfpd_obj.parse_voltage(dom_voltage_raw, 0) + transceiver_dom_info_dict['voltage'] = dom_voltage_data['data']['Vcc']['value'] + + qsfp_dom_rev_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_DOM_REV_OFFSET), QSFP_DOM_REV_WIDTH) + if qsfp_dom_rev_raw is not None: + qsfp_dom_rev_data = sfpd_obj.parse_sfp_dom_rev(qsfp_dom_rev_raw, 0) + qsfp_dom_rev = qsfp_dom_rev_data['data']['dom_rev']['value'] + + # The tx_power monitoring is only available on QSFP which compliant with SFF-8636 + # and claimed that it support tx_power with one indicator bit. + dom_channel_monitor_data = {} + dom_channel_monitor_raw = None + qsfp_tx_power_support = qsfp_dom_capability_data['data']['Tx_power_support']['value'] + if (qsfp_dom_rev[0:8] != 'SFF-8636' or (qsfp_dom_rev[0:8] == 'SFF-8636' and qsfp_tx_power_support != 'on')): + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_CHANNL_MON_OFFSET), QSFP_CHANNL_MON_WIDTH) + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = sfpd_obj.parse_channel_monitor_params( + dom_channel_monitor_raw, 0) + + else: + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_CHANNL_MON_OFFSET), QSFP_CHANNL_MON_WITH_TX_POWER_WIDTH) + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = sfpd_obj.parse_channel_monitor_params_with_tx_power( + dom_channel_monitor_raw, 0) + transceiver_dom_info_dict['tx1power'] = dom_channel_monitor_data['data']['TX1Power']['value'] + transceiver_dom_info_dict['tx2power'] = dom_channel_monitor_data['data']['TX2Power']['value'] + transceiver_dom_info_dict['tx3power'] = dom_channel_monitor_data['data']['TX3Power']['value'] + transceiver_dom_info_dict['tx4power'] = dom_channel_monitor_data['data']['TX4Power']['value'] + + if dom_channel_monitor_raw: + transceiver_dom_info_dict['rx1power'] = dom_channel_monitor_data['data']['RX1Power']['value'] + transceiver_dom_info_dict['rx2power'] = dom_channel_monitor_data['data']['RX2Power']['value'] + transceiver_dom_info_dict['rx3power'] = dom_channel_monitor_data['data']['RX3Power']['value'] + transceiver_dom_info_dict['rx4power'] = dom_channel_monitor_data['data']['RX4Power']['value'] + transceiver_dom_info_dict['tx1bias'] = dom_channel_monitor_data['data']['TX1Bias']['value'] + transceiver_dom_info_dict['tx2bias'] = dom_channel_monitor_data['data']['TX2Bias']['value'] + transceiver_dom_info_dict['tx3bias'] = dom_channel_monitor_data['data']['TX3Bias']['value'] + transceiver_dom_info_dict['tx4bias'] = dom_channel_monitor_data['data']['TX4Bias']['value'] + elif self.sfp_type == SFP_TYPE: + sfpd_obj = sff8472Dom() + if not sfpd_obj: + return {} + + eeprom_ifraw = self.__read_eeprom_specific_bytes(0, SFP_DOM_OFFSET) + if eeprom_ifraw is not None: + sfpi_obj = sff8472InterfaceId(eeprom_ifraw) + cal_type = sfpi_obj.get_calibration_type() + sfpd_obj._calibration_type = cal_type + + offset = SFP_DOM_OFFSET + transceiver_dom_info_dict = dict.fromkeys(self.dom_dict_keys, 'N/A') + dom_temperature_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_TEMPE_OFFSET), SFP_TEMPE_WIDTH) + + if dom_temperature_raw is not None: + dom_temperature_data = sfpd_obj.parse_temperature( + dom_temperature_raw, 0) + transceiver_dom_info_dict['temperature'] = dom_temperature_data['data']['Temperature']['value'] + + dom_voltage_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_VOLT_OFFSET), SFP_VOLT_WIDTH) + if dom_voltage_raw is not None: + dom_voltage_data = sfpd_obj.parse_voltage(dom_voltage_raw, 0) + transceiver_dom_info_dict['voltage'] = dom_voltage_data['data']['Vcc']['value'] + + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_CHANNL_MON_OFFSET), SFP_CHANNL_MON_WIDTH) + if dom_channel_monitor_raw is not None: + dom_voltage_data = sfpd_obj.parse_channel_monitor_params( + dom_channel_monitor_raw, 0) + transceiver_dom_info_dict['tx1power'] = dom_voltage_data['data']['TXPower']['value'] + transceiver_dom_info_dict['rx1power'] = dom_voltage_data['data']['RXPower']['value'] + transceiver_dom_info_dict['tx1bias'] = dom_voltage_data['data']['TXBias']['value'] + else: + return None + + for key in transceiver_dom_info_dict: + transceiver_dom_info_dict[key] = self._convert_string_to_num( + transceiver_dom_info_dict[key]) + + transceiver_dom_info_dict['rx_los'] = self.get_rx_los() + transceiver_dom_info_dict['tx_fault'] = self.get_tx_fault() + transceiver_dom_info_dict['reset_status'] = self.get_reset_status() + transceiver_dom_info_dict['lp_mode'] = self.get_lpmode() + transceiver_dom_info_dict['tx_disable'] = self.get_tx_disable() + transceiver_dom_info_dict['tx_disable_channel'] = self.get_tx_disable_channel() + + return transceiver_dom_info_dict + + def get_transceiver_threshold_info(self): + """ + Retrieves transceiver threshold info of this SFP + + Returns: + A dict which contains following keys/values : + ======================================================================== + keys |Value Format |Information + ---------------------------|---------------|---------------------------- + temphighalarm |FLOAT |High Alarm Threshold value of temperature in Celsius. + templowalarm |FLOAT |Low Alarm Threshold value of temperature in Celsius. + temphighwarning |FLOAT |High Warning Threshold value of temperature in Celsius. + templowwarning |FLOAT |Low Warning Threshold value of temperature in Celsius. + vcchighalarm |FLOAT |High Alarm Threshold value of supply voltage in mV. + vcclowalarm |FLOAT |Low Alarm Threshold value of supply voltage in mV. + vcchighwarning |FLOAT |High Warning Threshold value of supply voltage in mV. + vcclowwarning |FLOAT |Low Warning Threshold value of supply voltage in mV. + rxpowerhighalarm |FLOAT |High Alarm Threshold value of received power in dBm. + rxpowerlowalarm |FLOAT |Low Alarm Threshold value of received power in dBm. + rxpowerhighwarning |FLOAT |High Warning Threshold value of received power in dBm. + rxpowerlowwarning |FLOAT |Low Warning Threshold value of received power in dBm. + txpowerhighalarm |FLOAT |High Alarm Threshold value of transmit power in dBm. + txpowerlowalarm |FLOAT |Low Alarm Threshold value of transmit power in dBm. + txpowerhighwarning |FLOAT |High Warning Threshold value of transmit power in dBm. + txpowerlowwarning |FLOAT |Low Warning Threshold value of transmit power in dBm. + txbiashighalarm |FLOAT |High Alarm Threshold value of tx Bias Current in mA. + txbiaslowalarm |FLOAT |Low Alarm Threshold value of tx Bias Current in mA. + txbiashighwarning |FLOAT |High Warning Threshold value of tx Bias Current in mA. + txbiaslowwarning |FLOAT |Low Warning Threshold value of tx Bias Current in mA. + ======================================================================== + """ + transceiver_dom_threshold_info_dict_keys = ['temphighalarm', 'temphighwarning', 'templowalarm', 'templowwarning', + 'vcchighalarm', 'vcchighwarning', 'vcclowalarm', 'vcclowwarning', + 'rxpowerhighalarm', 'rxpowerhighwarning', 'rxpowerlowalarm', 'rxpowerlowwarning', + 'txpowerhighalarm', 'txpowerhighwarning', 'txpowerlowalarm', 'txpowerlowwarning', + 'txbiashighalarm', 'txbiashighwarning', 'txbiaslowalarm', 'txbiaslowwarning'] + + if self.sfp_type == QSFP_TYPE: + sfpd_obj = sff8436Dom() + if not self.get_presence() or not sfpd_obj: + return {} + DOM_OFFSET = 0 + transceiver_dom_threshold_dict = dict.fromkeys(transceiver_dom_threshold_info_dict_keys, 'N/A') + offset = DOM_OFFSET + + dom_module_threshold_raw = self.__read_eeprom_specific_bytes((offset + QSFP_MODULE_THRESHOLD_OFFSET), QSFP_MODULE_THRESHOLD_WIDTH) + if dom_module_threshold_raw is not None: + module_threshold_values = sfpd_obj.parse_module_threshold_values(dom_module_threshold_raw, 0) + module_threshold_data = module_threshold_values.get('data') + if module_threshold_data: + transceiver_dom_threshold_dict['temphighalarm'] = module_threshold_data['TempHighAlarm']['value'] + transceiver_dom_threshold_dict['templowalarm'] = module_threshold_data['TempLowAlarm']['value'] + transceiver_dom_threshold_dict['temphighwarning'] = module_threshold_data['TempHighWarning']['value'] + transceiver_dom_threshold_dict['templowwarning'] = module_threshold_data['TempLowWarning']['value'] + transceiver_dom_threshold_dict['vcchighalarm'] = module_threshold_data['VccHighAlarm']['value'] + transceiver_dom_threshold_dict['vcclowalarm'] = module_threshold_data['VccLowAlarm']['value'] + transceiver_dom_threshold_dict['vcchighwarning'] = module_threshold_data['VccHighWarning']['value'] + transceiver_dom_threshold_dict['vcclowwarning'] = module_threshold_data['VccLowWarning']['value'] + + dom_channel_thres_raw = self.__read_eeprom_specific_bytes((offset + QSFP_CHANNEL_THRESHOLD_OFFSET), QSFP_CHANNEL_THRESHOLD_WIDTH) + if dom_channel_thres_raw is not None: + channel_threshold_values = sfpd_obj.parse_channel_threshold_values(dom_channel_thres_raw, 0) + channel_threshold_data = channel_threshold_values.get('data') + else: + channel_threshold_data = None + if channel_threshold_data: + transceiver_dom_threshold_dict['rxpowerhighalarm'] = channel_threshold_data['RxPowerHighAlarm']['value'] + transceiver_dom_threshold_dict['rxpowerlowalarm'] = channel_threshold_data['RxPowerLowAlarm']['value'] + transceiver_dom_threshold_dict['rxpowerhighwarning'] = channel_threshold_data['RxPowerHighWarning']['value'] + transceiver_dom_threshold_dict['rxpowerlowwarning'] = channel_threshold_data['RxPowerLowWarning']['value'] + transceiver_dom_threshold_dict['txpowerhighalarm'] = "0.0dBm" + transceiver_dom_threshold_dict['txpowerlowalarm'] = "0.0dBm" + transceiver_dom_threshold_dict['txpowerhighwarning'] = "0.0dBm" + transceiver_dom_threshold_dict['txpowerlowwarning'] = "0.0dBm" + transceiver_dom_threshold_dict['txbiashighalarm'] = channel_threshold_data['TxBiasHighAlarm']['value'] + transceiver_dom_threshold_dict['txbiaslowalarm'] = channel_threshold_data['TxBiasLowAlarm']['value'] + transceiver_dom_threshold_dict['txbiashighwarning'] = channel_threshold_data['TxBiasHighWarning']['value'] + transceiver_dom_threshold_dict['txbiaslowwarning'] = channel_threshold_data['TxBiasLowWarning']['value'] + + for key in transceiver_dom_threshold_dict: + transceiver_dom_threshold_dict[key] = self.__convert_string_to_num(transceiver_dom_threshold_dict[key]) + + return transceiver_dom_threshold_dict + + elif self.sfp_type == SFP_TYPE: + sfpd_obj = sff8472Dom() + + if not self.get_presence() and not sfpd_obj: + return {} + DOM_OFFSET = 256 + eeprom_ifraw = self.__read_eeprom_specific_bytes(0, DOM_OFFSET) + if eeprom_ifraw is not None: + sfpi_obj = sff8472InterfaceId(eeprom_ifraw) + cal_type = sfpi_obj.get_calibration_type() + sfpd_obj._calibration_type = cal_type + + offset = DOM_OFFSET + transceiver_dom_threshold_info_dict = dict.fromkeys(transceiver_dom_threshold_info_dict_keys, 'N/A') + dom_module_threshold_raw = self.__read_eeprom_specific_bytes((offset + SFP_MODULE_THRESHOLD_OFFSET), SFP_MODULE_THRESHOLD_WIDTH) + if dom_module_threshold_raw is not None: + dom_module_threshold_data = sfpd_obj.parse_alarm_warning_threshold(dom_module_threshold_raw, 0) + + transceiver_dom_threshold_info_dict['temphighalarm'] = dom_module_threshold_data['data']['TempHighAlarm']['value'] + transceiver_dom_threshold_info_dict['templowalarm'] = dom_module_threshold_data['data']['TempLowAlarm']['value'] + transceiver_dom_threshold_info_dict['temphighwarning'] = dom_module_threshold_data['data']['TempHighWarning']['value'] + transceiver_dom_threshold_info_dict['templowwarning'] = dom_module_threshold_data['data']['TempLowWarning']['value'] + + transceiver_dom_threshold_info_dict['vcchighalarm'] = dom_module_threshold_data['data']['VoltageHighAlarm']['value'] + transceiver_dom_threshold_info_dict['vcclowalarm'] = dom_module_threshold_data['data']['VoltageLowAlarm']['value'] + transceiver_dom_threshold_info_dict['vcchighwarning'] = dom_module_threshold_data['data']['VoltageHighWarning']['value'] + transceiver_dom_threshold_info_dict['vcclowwarning'] = dom_module_threshold_data['data']['VoltageLowWarning']['value'] + + transceiver_dom_threshold_info_dict['txbiashighalarm'] = dom_module_threshold_data['data']['BiasHighAlarm']['value'] + transceiver_dom_threshold_info_dict['txbiaslowalarm'] = dom_module_threshold_data['data']['BiasLowAlarm']['value'] + transceiver_dom_threshold_info_dict['txbiashighwarning'] = dom_module_threshold_data['data']['BiasHighWarning']['value'] + transceiver_dom_threshold_info_dict['txbiaslowwarning'] = dom_module_threshold_data['data']['BiasLowWarning']['value'] + + transceiver_dom_threshold_info_dict['txpowerhighalarm'] = dom_module_threshold_data['data']['TXPowerHighAlarm']['value'] + transceiver_dom_threshold_info_dict['txpowerlowalarm'] = dom_module_threshold_data['data']['TXPowerLowAlarm']['value'] + transceiver_dom_threshold_info_dict['txpowerhighwarning'] = dom_module_threshold_data['data']['TXPowerHighWarning']['value'] + transceiver_dom_threshold_info_dict['txpowerlowwarning'] = dom_module_threshold_data['data']['TXPowerLowWarning']['value'] + + transceiver_dom_threshold_info_dict['rxpowerhighalarm'] = dom_module_threshold_data['data']['RXPowerHighAlarm']['value'] + transceiver_dom_threshold_info_dict['rxpowerlowalarm'] = dom_module_threshold_data['data']['RXPowerLowAlarm']['value'] + transceiver_dom_threshold_info_dict['rxpowerhighwarning'] = dom_module_threshold_data['data']['RXPowerHighWarning']['value'] + transceiver_dom_threshold_info_dict['rxpowerlowwarning'] = dom_module_threshold_data['data']['RXPowerLowWarning']['value'] + + for key in transceiver_dom_threshold_info_dict: + transceiver_dom_threshold_info_dict[key] = self.__convert_string_to_num(transceiver_dom_threshold_info_dict[key]) + + return transceiver_dom_threshold_info_dict + + else: + return None + + def get_reset_status(self): + """ + Retrieves the reset status of SFP + Returns: + A Boolean, True if reset enabled, False if disabled + """ + # SFP doesn't support this feature + if self.sfp_type == SFP_TYPE: + return False + elif self.sfp_type == QSFP_TYPE: + try: + reg_file = open("/sys/class/gpio/gpio" + +str((self.port_num-self.QSFP_START)*4+32)+"/value") + except IOError as e: + print ("Error: unable to open file: %s" % str(e)) + return None + reg_value = int(reg_file.readline().rstrip()) + reg_file.close() + if reg_value == 0: + return True + else: + return False + else: + return None + + def get_rx_los(self): + """ + Retrieves the RX LOS (lost-of-signal) status of SFP + Returns: + A Boolean, True if SFP has RX LOS, False if not. + Note : RX LOS status is latched until a call to get_rx_los or a reset. + """ + if not self.dom_supported: + return None + + rx_los_list = [] + + if self.sfp_type == QSFP_TYPE: + offset = 0 + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_CHANNL_RX_LOS_STATUS_OFFSET), QSFP_CHANNL_RX_LOS_STATUS_WIDTH) + if dom_channel_monitor_raw is not None: + rx_los_data = int(dom_channel_monitor_raw[0], 16) + rx_los_list.append(rx_los_data & 0x01 != 0) + rx_los_list.append(rx_los_data & 0x02 != 0) + rx_los_list.append(rx_los_data & 0x04 != 0) + rx_los_list.append(rx_los_data & 0x08 != 0) + elif self.sfp_type == SFP_TYPE: + offset = 256 + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_STATUS_CONTROL_OFFSET), SFP_STATUS_CONTROL_WIDTH) + if dom_channel_monitor_raw is not None: + rx_los_data = int(dom_channel_monitor_raw[0], 16) + rx_los_list.append(rx_los_data & 0x02 != 0) + else: + return None + else: + return None + + return rx_los_list + + def get_tx_fault(self): + """ + Retrieves the TX fault status of SFP + Returns: + A Boolean, True if SFP has TX fault, False if not + Note : TX fault status is lached until a call to get_tx_fault or a reset. + """ + if not self.dom_supported: + return None + + tx_fault_list = [] + + if self.sfp_type == QSFP_TYPE: + offset = 0 + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_CHANNL_TX_FAULT_STATUS_OFFSET), QSFP_CHANNL_TX_FAULT_STATUS_WIDTH) + if dom_channel_monitor_raw is not None: + tx_fault_data = int(dom_channel_monitor_raw[0], 16) + tx_fault_list.append(tx_fault_data & 0x01 != 0) + tx_fault_list.append(tx_fault_data & 0x02 != 0) + tx_fault_list.append(tx_fault_data & 0x04 != 0) + tx_fault_list.append(tx_fault_data & 0x08 != 0) + elif self.sfp_type == SFP_TYPE: + offset = 256 + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_STATUS_CONTROL_OFFSET), SFP_STATUS_CONTROL_WIDTH) + if dom_channel_monitor_raw is not None: + tx_fault_data = int(dom_channel_monitor_raw[0], 16) + tx_fault_list.append(tx_fault_data & 0x04 != 0) + else: + return None + else: + return None + + return tx_fault_list + + def get_tx_disable(self): + """ + Retrieves the tx_disable status of this SFP + Returns: + A Boolean, True if tx_disable is enabled, False if disabled + """ + if not self.dom_supported: + return None + + tx_disable_list = [] + + if self.sfp_type == QSFP_TYPE: + offset = 0 + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_CHANNL_DISABLE_STATUS_OFFSET), QSFP_CHANNL_DISABLE_STATUS_WIDTH) + if dom_channel_monitor_raw is not None: + tx_disable_data = int(dom_channel_monitor_raw[0], 16) + tx_disable_list.append(tx_disable_data & 0x01 != 0) + tx_disable_list.append(tx_disable_data & 0x02 != 0) + tx_disable_list.append(tx_disable_data & 0x04 != 0) + tx_disable_list.append(tx_disable_data & 0x08 != 0) + elif self.sfp_type == SFP_TYPE: + offset = 256 + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_STATUS_CONTROL_OFFSET), SFP_STATUS_CONTROL_WIDTH) + if dom_channel_monitor_raw is not None: + tx_disable_data = int(dom_channel_monitor_raw[0], 16) + tx_disable_list.append(tx_disable_data & 0xC0 != 0) + else: + return None + else: + return None + + return tx_disable_list + + def get_tx_disable_channel(self): + """ + Retrieves the TX disabled channels in this SFP + Returns: + A hex of 4 bits (bit 0 to bit 3 as channel 0 to channel 3) to represent + TX channels which have been disabled in this SFP. + As an example, a returned value of 0x5 indicates that channel 0 + and channel 2 have been disabled. + """ + # SFP doesn't support this feature + if self.sfp_type == SFP_TYPE: + return 0 + elif self.sfp_type == QSFP_TYPE: + tx_disable_list = self.get_tx_disable() + if tx_disable_list is None: + return 0 + tx_disabled = 0 + for i in range(len(tx_disable_list)): + if tx_disable_list[i]: + tx_disabled |= 1 << i + else: + return None + + return tx_disabled + + def get_lpmode(self): + """ + Retrieves the lpmode (low power mode) status of this QSFP module + Returns: + A Boolean, True if lpmode is enabled, False if disabled + """ + # SFP doesn't support this feature + if self.sfp_type == SFP_TYPE: + return False + elif self.sfp_type == QSFP_TYPE: + try: + reg_file = open("/sys/class/gpio/gpio" + +str((self.port_num-self.QSFP_START)*4+35)+"/value") + except IOError as e: + print ("Error: unable to open file: %s" % str(e)) + return False + reg_value = int(reg_file.readline().rstrip()) + reg_file.close() + if reg_value == 0: + return False + else: + return True + else: + return None + + def get_power_override(self): + """ + Retrieves the power-override status of this SFP + Returns: + A Boolean, True if power-override is enabled, False if disabled + """ + # SFP doesn't support this feature + if self.sfp_type == SFP_TYPE: + return False + elif self.sfp_type == QSFP_TYPE: + offset = 0 + sfpd_obj = sff8436Dom() + if sfpd_obj is None: + return False + + dom_control_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_POWEROVERRIDE_OFFSET), QSFP_POWEROVERRIDE_WIDTH) + if dom_control_raw is not None: + if int(dom_control_raw[0],16) & (0x01 << QSFP_POWEROVERRIDE_BIT): + return True + else: + return False + else: + return None + + def get_temperature(self): + """ + Retrieves the temperature of this SFP + Returns: + An integer number of current temperature in Celsius + """ + if not self.dom_supported: + return None + if self.sfp_type == QSFP_TYPE: + offset = 0 + + sfpd_obj = sff8436Dom() + if sfpd_obj is None: + return None + + if self.dom_temp_supported: + dom_temperature_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_TEMPE_OFFSET), QSFP_TEMPE_WIDTH) + if dom_temperature_raw is not None: + dom_temperature_data = sfpd_obj.parse_temperature(dom_temperature_raw, 0) + temp = self._convert_string_to_num( + dom_temperature_data['data']['Temperature']['value']) + return temp + else: + return None + elif self.sfp_type == SFP_TYPE: + offset = 256 + sfpd_obj = sff8472Dom() + if sfpd_obj is None: + return None + sfpd_obj._calibration_type = 1 + + dom_temperature_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_TEMPE_OFFSET), SFP_TEMPE_WIDTH) + if dom_temperature_raw is not None: + dom_temperature_data = sfpd_obj.parse_temperature(dom_temperature_raw, 0) + temp = self._convert_string_to_num( + dom_temperature_data['data']['Temperature']['value']) + return temp + else: + return None + else: + return None + + def get_voltage(self): + """ + Retrieves the supply voltage of this SFP + Returns: + An integer number of supply voltage in mV + """ + if not self.dom_supported: + return None + if self.sfp_type == QSFP_TYPE: + offset = 0 + + sfpd_obj = sff8436Dom() + if sfpd_obj is None: + return None + + if self.dom_volt_supported: + dom_voltage_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_VOLT_OFFSET), QSFP_VOLT_WIDTH) + if dom_voltage_raw is not None: + dom_voltage_data = sfpd_obj.parse_voltage(dom_voltage_raw, 0) + voltage = self._convert_string_to_num( + dom_voltage_data['data']['Vcc']['value']) + return voltage + else: + return None + elif self.sfp_type == SFP_TYPE: + offset = 256 + + sfpd_obj = sff8472Dom() + if sfpd_obj is None: + return None + + sfpd_obj._calibration_type = self.calibration + + dom_voltage_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_VOLT_OFFSET), SFP_VOLT_WIDTH) + if dom_voltage_raw is not None: + dom_voltage_data = sfpd_obj.parse_voltage(dom_voltage_raw, 0) + voltage = self._convert_string_to_num( + dom_voltage_data['data']['Vcc']['value']) + return voltage + else: + return None + else: + return None + + def get_tx_bias(self): + """ + Retrieves the TX bias current of this SFP + Returns: + A list of four integer numbers, representing TX bias in mA + for channel 0 to channel 4. + Ex. ['110.09', '111.12', '108.21', '112.09'] + """ + tx_bias_list = [] + if self.sfp_type == QSFP_TYPE: + offset = 0 + + sfpd_obj = sff8436Dom() + if sfpd_obj is None: + return None + + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_CHANNL_MON_OFFSET), QSFP_CHANNL_MON_WITH_TX_POWER_WIDTH) + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = \ + sfpd_obj.parse_channel_monitor_params_with_tx_power(dom_channel_monitor_raw, 0) + tx_bias_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TX1Bias']['value'])) + tx_bias_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TX2Bias']['value'])) + tx_bias_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TX3Bias']['value'])) + tx_bias_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TX4Bias']['value'])) + elif self.sfp_type == SFP_TYPE: + offset = 256 + + sfpd_obj = sff8472Dom() + if sfpd_obj is None: + return None + sfpd_obj._calibration_type = self.calibration + + if self.dom_supported: + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_CHANNL_MON_OFFSET), SFP_CHANNL_MON_WIDTH) + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = sfpd_obj.parse_channel_monitor_params( \ + dom_channel_monitor_raw, 0) + tx_bias_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TXBias']['value'])) + else: + return None + else: + return None + else: + return None + + return tx_bias_list + + def get_rx_power(self): + """ + Retrieves the received optical power for this SFP + Returns: + A list of four integer numbers, representing received optical + power in mW for channel 0 to channel 4. + Ex. ['1.77', '1.71', '1.68', '1.70'] + """ + rx_power_list = [] + + if self.sfp_type == QSFP_TYPE: + offset = 0 + + sfpd_obj = sff8436Dom() + if sfpd_obj is None: + return None + + if self.dom_rx_power_supported: + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_CHANNL_MON_OFFSET), QSFP_CHANNL_MON_WITH_TX_POWER_WIDTH) + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = \ + sfpd_obj.parse_channel_monitor_params_with_tx_power(dom_channel_monitor_raw, 0) + rx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['RX1Power']['value'])) + rx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['RX2Power']['value'])) + rx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['RX3Power']['value'])) + rx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['RX4Power']['value'])) + else: + return None + else: + return None + elif self.sfp_type == SFP_TYPE: + offset = 256 + + sfpd_obj = sff8472Dom() + if sfpd_obj is None: + return None + + if self.dom_supported: + sfpd_obj._calibration_type = self.calibration + + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_CHANNL_MON_OFFSET), SFP_CHANNL_MON_WIDTH) + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = \ + sfpd_obj.parse_channel_monitor_params(dom_channel_monitor_raw, 0) + rx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['RXPower']['value'])) + else: + return None + else: + return None + else: + return None + + return rx_power_list + + def get_tx_power(self): + """ + Retrieves the TX power of this SFP + Returns: + A list of four integer numbers, representing TX power in mW + for channel 0 to channel 4. + Ex. ['1.86', '1.86', '1.86', '1.86'] + """ + tx_power_list = [] + + if self.sfp_type == QSFP_TYPE: + offset = 0 + + sfpd_obj = sff8436Dom() + if sfpd_obj is None: + return None + + if self.dom_tx_power_supported: + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_CHANNL_MON_OFFSET), QSFP_CHANNL_MON_WITH_TX_POWER_WIDTH) + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = \ + sfpd_obj.parse_channel_monitor_params_with_tx_power(dom_channel_monitor_raw, 0) + tx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TX1Power']['value'])) + tx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TX2Power']['value'])) + tx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TX3Power']['value'])) + tx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TX4Power']['value'])) + else: + return None + else: + return None + elif self.sfp_type == SFP_TYPE: + offset = 256 + sfpd_obj = sff8472Dom() + if sfpd_obj is None: + return None + + if self.dom_supported: + sfpd_obj._calibration_type = self.calibration + + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_CHANNL_MON_OFFSET), SFP_CHANNL_MON_WIDTH) + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = \ + sfpd_obj.parse_channel_monitor_params(dom_channel_monitor_raw, 0) + tx_power_list.append(self._convert_string_to_num( + dom_channel_monitor_data['data']['TXPower']['value'])) + else: + return None + else: + return None + else: + return None + + return tx_power_list + + def reset(self): + """ + Reset SFP and return all user module settings to their default state. + Returns: + A boolean, True if successful, False if not + """ + if not self.get_presence(): + return False + + # SFP doesn't support this feature + if self.sfp_type == SFP_TYPE: + return False + elif self.sfp_type == QSFP_TYPE: + try: + with open("/sys/class/gpio/gpio"+str((self.port_num-self.QSFP_START)*4+32)+"/direction", 'r+') as f: + f.write('out') + with open("/sys/class/gpio/gpio"+str((self.port_num-self.QSFP_START)*4+32)+"/value", "r+") as f: + f.write('0') + except IOError as e: + print ("Error: unable to open file: %s" % str(e)) + return False + + # Sleep 2 second to allow it to settle + time.sleep(2) + + # Flip the value back write back to the register to take port out of reset + try: + with open("/sys/class/gpio/gpio"+str((self.port_num-self.QSFP_START)*4+32)+"/value", "r+") as f: + f.write('1') + except IOError as e: + print ("Error: unable to open file: %s" % str(e)) + return False + else: + return None + + return True + + def tx_disable(self, tx_disable): + """ + Disable SFP TX for all channels + Args: + tx_disable : A Boolean, True to enable tx_disable mode, False to disable + tx_disable mode. + Returns: + A boolean, True if tx_disable is set successfully, False if not + """ + if not self.get_presence(): + return False + + if self.sfp_type == SFP_TYPE: + if self.dom_tx_disable_supported: + offset = 256 + sysfs_sfp_i2c_client_eeprom_path = self.port_to_eeprom_mapping[self.port_num] + status_control_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_STATUS_CONTROL_OFFSET), SFP_STATUS_CONTROL_WIDTH) + if status_control_raw is not None: + # Set bit 6 for Soft TX Disable Select + # 01000000 = 64 and 10111111 = 191 + tx_disable_bit = 64 if tx_disable else 191 + status_control = int(status_control_raw[0], 16) + tx_disable_ctl = (status_control | tx_disable_bit) if tx_disable else ( + status_control & tx_disable_bit) + try: + sysfsfile_eeprom = open( + sysfs_sfp_i2c_client_eeprom_path, mode="r+b", buffering=0) + buffer = create_string_buffer(1) + buffer[0] = chr(tx_disable_ctl) + # Write to eeprom + sysfsfile_eeprom.seek(offset + SFP_STATUS_CONTROL_OFFSET) + sysfsfile_eeprom.write(buffer[0]) + except IOError as e: + print("Error: unable to open file: %s" % str(e)) + return False + finally: + if sysfsfile_eeprom: + sysfsfile_eeprom.close() + time.sleep(0.01) + return True + return False + else: + return False + elif self.sfp_type == QSFP_TYPE: + if self.dom_tx_disable_supported: + channel_mask = 0x0f + if tx_disable: + return self.tx_disable_channel(channel_mask, True) + else: + return self.tx_disable_channel(channel_mask, False) + else: + return False + else: + return None + + def tx_disable_channel(self, channel, disable): + """ + Sets the tx_disable for specified SFP channels + Args: + channel : A hex of 4 bits (bit 0 to bit 3) which represent channel 0 to 3, + e.g. 0x5 for channel 0 and channel 2. + disable : A boolean, True to disable TX channels specified in channel, + False to enable + Returns: + A boolean, True if successful, False if not + """ + if not self.get_presence(): + return False + # SFP doesn't support this feature + if self.sfp_type == SFP_TYPE: + return False + elif self.sfp_type == QSFP_TYPE: + if self.dom_tx_disable_supported: + sysfsfile_eeprom = None + try: + channel_state = self.get_tx_disable_channel() + if disable: + tx_disable_ctl = channel_state | channel + else: + tx_disable_ctl = channel_state & (~channel) + buffer = create_string_buffer(1) + buffer[0] = chr(tx_disable_ctl) + # Write to eeprom + sysfsfile_eeprom = open( + self.port_to_eeprom_mapping[self.port_num], "r+b") + sysfsfile_eeprom.seek(QSFP_CONTROL_OFFSET) + sysfsfile_eeprom.write(buffer[0]) + except IOError as e: + print ("Error: unable to open file: %s" % str(e)) + return False + finally: + if sysfsfile_eeprom is not None: + sysfsfile_eeprom.close() + time.sleep(0.01) + return True + else: + return False + else: + return None + + def set_lpmode(self, lpmode): + """ + Sets the lpmode (low power mode) of SFP + Args: + lpmode: A Boolean, True to enable lpmode, False to disable it + Note : lpmode can be overridden by set_power_override + Returns: + A boolean, True if lpmode is set successfully, False if not + """ + if not self.get_presence(): + return False + # SFP doesn't support this feature + if self.sfp_type == SFP_TYPE: + return False + elif self.sfp_type == QSFP_TYPE: + try: + reg_file = open("/sys/class/gpio/gpio" + +str((self.port_num-self.QSFP_START)*4+35)+"/value", "r+") + except IOError as e: + print ("Error: unable to open file: %s" % str(e)) + return False + + # LPMode is active high; set or clear the bit accordingly + if lpmode: + reg_value = 1 + else: + reg_value = 0 + + reg_file.write(hex(reg_value)) + reg_file.close() + else: + return None + + return True + + def set_power_override(self, power_override, power_set): + """ + Sets SFP power level using power_override and power_set + Args: + power_override : + A Boolean, True to override set_lpmode and use power_set + to control SFP power, False to disable SFP power control + through power_override/power_set and use set_lpmode + to control SFP power. + power_set : + Only valid when power_override is True. + A Boolean, True to set SFP to low power mode, False to set + SFP to high power mode. + Returns: + A boolean, True if power-override and power_set are set successfully, + False if not + """ + # SFP doesn't support this feature + if not self.get_presence(): + return False + + if self.sfp_type == SFP_TYPE: + return False + elif self.sfp_type == QSFP_TYPE: + try: + power_override_bit = 0 + if power_override: + power_override_bit |= 1 << 0 + + power_set_bit = 0 + if power_set: + power_set_bit |= 1 << 1 + + buffer = create_string_buffer(1) + buffer[0] = chr(power_override_bit | power_set_bit) + # Write to eeprom + sysfsfile_eeprom = open(self.port_to_eeprom_mapping[self.port_num], "r+b") + sysfsfile_eeprom.seek(QSFP_POWEROVERRIDE_OFFSET) + sysfsfile_eeprom.write(buffer[0]) + except IOError as e: + print ("Error: unable to open file: %s" % str(e)) + return False + finally: + if sysfsfile_eeprom is not None: + sysfsfile_eeprom.close() + time.sleep(0.01) + else: + return None + + return True + + def get_name(self): + """ + Retrieves the name of the device + Returns: + string: The name of the device + """ + sfputil_helper = SfpUtilHelper() + sfputil_helper.read_porttab_mappings(self.__get_path_to_port_config_file()) + print ("self.index{}".format(self.index)) + name = sfputil_helper.logical[self.index-1] or "Unknown" + return name + diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix8c-56x/sonic_platform/thermal.py b/platform/broadcom/sonic-platform-modules-quanta/ix8c-56x/sonic_platform/thermal.py new file mode 100644 index 000000000000..f30bdc8d71da --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix8c-56x/sonic_platform/thermal.py @@ -0,0 +1,140 @@ +#!/usr/bin/env python + +############################################################################# +# Inventec d7264 +# +# Module contains an implementation of SONiC Platform Base API and +# provides the Thermal information +# +############################################################################# + +import logging +import os + +try: + from sonic_platform_base.thermal_base import ThermalBase +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +HWMON_DIR = "/sys/class/hwmon/hwmon2/" + +thermal_index_mapping = { + 1:1, + 2:2, + 3:42, + 4:43, + 5:44, + 6:52, + 7:53, + 8:54, + 9:75, + 10:76, + 11:77, + 12:78, + 13:79, + 14:80, + 15:81, + 16:82, + 17:83, + 18:84, +} + +class Thermal(ThermalBase): + """Platform-specific Thermal class""" + + def __init__(self, thermal_index): + self.index = thermal_index + self.temp_attr = "temp{}_input".format(thermal_index_mapping[self.index]) + self.high_th_attr = "temp{}_crit".format(thermal_index_mapping[self.index]) + self.name_attr = "temp{}_label".format(thermal_index_mapping[self.index]) + + + def __get_attr_value(self, attr_path): + + retval = 'ERR' + if (not os.path.isfile(attr_path)): + return retval + + try: + with open(attr_path, 'r') as fd: + retval = fd.read() + except Exception as error: + logging.error("Unable to open ", attr_path, " file !") + + retval = retval.rstrip(' \t\n\r') + return retval + + def get_name(self): + """ + Retrieves the name of the device + + Returns: + string: The name of the device + """ + attr_path = HWMON_DIR + self.name_attr + attr_rv = self.__get_attr_value(attr_path) + + if (attr_rv != 'ERR'): + return attr_rv + else: + return None + + def get_presence(self): + """ + Retrieves the presence of the device + + Returns: + bool: True if device is present, False if not + """ + attr_path = HWMON_DIR + self.name_attr + attr_rv = self.__get_attr_value(attr_path) + + if (attr_rv != 'ERR'): + return True + else: + return False + + def get_status(self): + """ + Retrieves the operational status of the device + + Returns: + A boolean value, True if device is operating properly, False if not + """ + if (self.get_temperature() != None): + return True + else: + return False + + def get_temperature(self): + """ + Retrieves current temperature reading from thermal + + Returns: + A float number of current temperature in Celsius up to nearest thousandth + of one degree Celsius, e.g. 30.125 + """ + attr_path = HWMON_DIR + self.temp_attr + attr_rv = self.__get_attr_value(attr_path) + + if (attr_rv != 'ERR'): + return float(attr_rv) / 1000 + else: + return None + + def get_high_threshold(self): + """ + Retrieves the high threshold temperature of thermal + + Returns: + A float number, the high threshold temperature of thermal in Celsius + up to nearest thousandth of one degree Celsius, e.g. 30.125 + """ + attr_path = HWMON_DIR + self.high_th_attr + attr_rv = self.__get_attr_value(attr_path) + + if (attr_rv != 'ERR'): + return float(attr_rv) / 1000 + else: + return None + diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix8c-56x/sonic_platform_setup.py b/platform/broadcom/sonic-platform-modules-quanta/ix8c-56x/sonic_platform_setup.py new file mode 100644 index 000000000000..b1ba37477628 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix8c-56x/sonic_platform_setup.py @@ -0,0 +1,24 @@ +import os +from setuptools import setup +os.listdir + +setup( + name='sonic-platform', + version='1.0', + description='SONiC platform API implementation on Quanta Platforms', + license='Apache 2.0', + packages=['sonic_platform'], + classifiers=[ + 'Development Status :: 3 - Alpha', + 'Environment :: Plugins', + 'Intended Audience :: Developers', + 'Intended Audience :: Information Technology', + 'Intended Audience :: System Administrators', + 'License :: OSI Approved :: Apache Software License', + 'Natural Language :: English', + 'Operating System :: POSIX :: Linux', + 'Programming Language :: Python :: 3.7', + 'Topic :: Utilities', + ], + keywords='sonic SONiC platform PLATFORM', +) diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix8c-56x/utils/quanta_ix8c_util.py b/platform/broadcom/sonic-platform-modules-quanta/ix8c-56x/utils/quanta_ix8c_util.py index c495533638e8..f8e8b0f0f96b 100755 --- a/platform/broadcom/sonic-platform-modules-quanta/ix8c-56x/utils/quanta_ix8c_util.py +++ b/platform/broadcom/sonic-platform-modules-quanta/ix8c-56x/utils/quanta_ix8c_util.py @@ -21,94 +21,86 @@ options: -h | --help : this help message -d | --debug : run with debug mode - -f | --force : ignore error during installation or clean + -f | --force : ignore error during installation or clean command: install : install drivers and generate related sysfs nodes - clean : uninstall drivers and remove related sysfs nodes + clean : uninstall drivers and remove related sysfs nodes """ import os import commands import sys, getopt import logging -import re import time -from collections import namedtuple DEBUG = False args = [] FORCE = 0 i2c_prefix = '/sys/bus/i2c/devices/' - if DEBUG == True: print sys.argv[0] - print 'ARGV :', sys.argv[1:] - + print 'ARGV :', sys.argv[1:] def main(): global DEBUG global args global FORCE - - if len(sys.argv)<2: + + if len(sys.argv) < 2: show_help() - + options, args = getopt.getopt(sys.argv[1:], 'hdf', ['help', 'debug', 'force', ]) - if DEBUG == True: + if DEBUG == True: print options print args print len(sys.argv) - + for opt, arg in options: if opt in ('-h', '--help'): show_help() - elif opt in ('-d', '--debug'): + elif opt in ('-d', '--debug'): DEBUG = True logging.basicConfig(level=logging.INFO) - elif opt in ('-f', '--force'): + elif opt in ('-f', '--force'): FORCE = 1 else: - logging.info('no option') - for arg in args: + logging.info('no option') + for arg in args: if arg == 'install': install() elif arg == 'clean': uninstall() else: show_help() - - - return 0 - + + + return 0 + def show_help(): print __doc__ % {'scriptName' : sys.argv[0].split("/")[-1]} sys.exit(0) - + def show_log(txt): if DEBUG == True: print "[IX8C-56X]"+txt return - + def exec_cmd(cmd, show): - logging.info('Run :'+cmd) - status, output = commands.getstatusoutput(cmd) + logging.info('Run :'+cmd) + status, output = commands.getstatusoutput(cmd) show_log (cmd +"with result:" + str(status)) - show_log (" output:"+output) + show_log (" output:"+output) if status: logging.info('Failed :'+cmd) if show: print('Failed :'+cmd) return status, output - + instantiate =[ -#turn on module power -'echo 21 > /sys/class/gpio/export', -'echo out > /sys/class/gpio/gpio21/direction', -'echo 1 >/sys/class/gpio/gpio21/value', #export pca9698 for qsfp present 'echo 34 > /sys/class/gpio/export', 'echo in > /sys/class/gpio/gpio34/direction', @@ -126,31 +118,6 @@ def exec_cmd(cmd, show): 'echo in > /sys/class/gpio/gpio58/direction', 'echo 62 > /sys/class/gpio/export', 'echo in > /sys/class/gpio/gpio62/direction', -#export pca9698 for qsfp reset -'echo 32 > /sys/class/gpio/export', -'echo out > /sys/class/gpio/gpio32/direction', -'echo 1 >/sys/class/gpio/gpio32/value', -'echo 36 > /sys/class/gpio/export', -'echo out > /sys/class/gpio/gpio36/direction', -'echo 1 >/sys/class/gpio/gpio36/value', -'echo 40 > /sys/class/gpio/export', -'echo out > /sys/class/gpio/gpio40/direction', -'echo 1 >/sys/class/gpio/gpio40/value', -'echo 44 > /sys/class/gpio/export', -'echo out > /sys/class/gpio/gpio44/direction', -'echo 1 >/sys/class/gpio/gpio44/value', -'echo 48 > /sys/class/gpio/export', -'echo out > /sys/class/gpio/gpio48/direction', -'echo 1 >/sys/class/gpio/gpio48/value', -'echo 52 > /sys/class/gpio/export', -'echo out > /sys/class/gpio/gpio52/direction', -'echo 1 >/sys/class/gpio/gpio52/value', -'echo 56 > /sys/class/gpio/export', -'echo out > /sys/class/gpio/gpio56/direction', -'echo 1 >/sys/class/gpio/gpio56/value', -'echo 60 > /sys/class/gpio/export', -'echo out > /sys/class/gpio/gpio60/direction', -'echo 1 >/sys/class/gpio/gpio60/value', #export pca9698 for qsfp lpmode 'echo 35 > /sys/class/gpio/export', 'echo out > /sys/class/gpio/gpio35/direction', @@ -176,11 +143,6 @@ def exec_cmd(cmd, show): 'echo 63 > /sys/class/gpio/export', 'echo out > /sys/class/gpio/gpio63/direction', 'echo 0 >/sys/class/gpio/gpio63/value', -#Reset fron-ports LED CPLD -'echo 73 > /sys/class/gpio/export', -'echo out > /sys/class/gpio/gpio73/direction', -'echo 0 >/sys/class/gpio/gpio73/value', -'echo 1 >/sys/class/gpio/gpio73/value', #Enable front-ports LED decoding 'echo 1 > /sys/class/cpld-led/CPLDLED-1/led_decode', 'echo 1 > /sys/class/cpld-led/CPLDLED-2/led_decode', @@ -239,41 +201,66 @@ def exec_cmd(cmd, show): 'lpc_ich', 'i2c-i801', 'i2c-dev', +'i2c-mux-pca954x force_deselect_on_exit=1', +'gpio-pca953x', +'optoe', +'qci_cpld_sfp28', +'qci_cpld_led', +'qci_platform_ix8c', +'quanta_hwmon_ipmi', +'ipmi_devintf' +] + +un_drivers =[ +'lpc_ich', +'i2c-i801', +'i2c-dev', 'i2c-mux-pca954x', 'gpio-pca953x', 'optoe', 'qci_cpld_sfp28', 'qci_cpld_led', 'qci_platform_ix8c', +'quanta_hwmon_ipmi', 'ipmi_devintf' ] - - def system_install(): global FORCE - #remove default drivers to avoid modprobe order conflicts - status, output = exec_cmd("rmmod i2c_ismt ", 1) - status, output = exec_cmd("rmmod i2c-i801 ", 1) #setup driver dependency - status, output = exec_cmd("depmod -a ", 1) + exec_cmd("depmod -a ", 1) #install drivers for i in range(0,len(drivers)): - status, output = exec_cmd("modprobe "+drivers[i], 1) + status, output = exec_cmd("modprobe " + drivers[i], 1) if status: print output if FORCE == 0: return status - #remove net rules for generating new net rules - status, output = exec_cmd("systemctl stop systemd-udevd.service ", 1) - status, output = exec_cmd("rm /etc/udev/rules.d/70-persistent-net.rules ", 1) - status, output = exec_cmd("rmmod ixgbe ", 1) - status, output = exec_cmd("rmmod igb ", 1) - status, output = exec_cmd("modprobe igb ", 1) - status, output = exec_cmd("modprobe ixgbe ", 1) - status, output = exec_cmd("systemctl start systemd-udevd.service ", 1) + #reload ethernet drivers in correct order + exec_cmd("rmmod ixgbe ", 1) + exec_cmd("rmmod igb ", 1) + exec_cmd("modprobe igb ", 1) + exec_cmd("modprobe ixgbe ", 1) + + #turn on module power + exec_cmd("echo 21 > /sys/class/gpio/export ", 1) + exec_cmd("echo high > /sys/class/gpio/gpio21/direction ", 1) + + time.sleep(1) + # qsfp reset gpio + for qsfp_reset in [32, 36, 40, 44, 48, 52, 56, 60]: + exec_cmd("echo "+str(qsfp_reset)+" > /sys/class/gpio/export", 1) + exec_cmd("echo high > /sys/class/gpio/gpio"+str(qsfp_reset)+"/direction", 1) + + # Reset fron-ports LED CPLD + exec_cmd("echo 73 > /sys/class/gpio/export ", 1) + status, output = exec_cmd("cat /sys/class/gpio/gpio73/value", 1) + if output != '1': + exec_cmd("echo out > /sys/class/gpio/gpio73/direction ", 1) + exec_cmd("echo 0 >/sys/class/gpio/gpio73/value", 1) + exec_cmd("echo 1 >/sys/class/gpio/gpio73/value", 1) #instantiate devices for i in range(0,len(instantiate)): @@ -285,24 +272,29 @@ def system_install(): #QSFP for 1~56 port for port_number in range(1,57): - bus_number = port_number + 31 + bus_number = port_number + 12 os.system("echo %d >/sys/bus/i2c/devices/%d-0050/port_name" % (port_number, bus_number)) return - - + + def system_ready(): - if not device_found(): + if not device_found(): return False return True - -def install(): + +def install(): if not device_found(): - print "No device, installing...." - status = system_install() + print "No device, installing...." + status = system_install() if status: - if FORCE == 0: - return status + if FORCE == 0: + return status + status, output = exec_cmd("pip3 install /usr/share/sonic/device/x86_64-quanta_ix8c_bwde-r0/sonic_platform-1.0-py3-none-any.whl",1) + if status: + print output + if FORCE == 0: + return status else: print " ix8c driver already installed...." return @@ -310,20 +302,29 @@ def install(): def uninstall(): global FORCE #uninstall drivers - for i in range(len(drivers)-1,-1,-1): - status, output = exec_cmd("rmmod "+drivers[i], 1) + for i in range(len(un_drivers) - 1, -1, -1): + status, output = exec_cmd("rmmod " + un_drivers[i], 1) if status: print output - if FORCE == 0: + if FORCE == 0: return status + + status, output = exec_cmd("pip3 uninstall sonic-platform -y ",1) + if status: + print output + if FORCE == 0: + return status + return def device_found(): - ret1, log = exec_cmd("ls "+i2c_prefix+"i2c-0", 0) - return ret1 + ret1, log1 = exec_cmd("cat /proc/modules | grep ix8c > /tmp/chkdriver.log", 0) + ret2, log2 = exec_cmd("cat /tmp/chkdriver.log | grep ix8c", 0) + + if ret1 == 0 and len(log2) > 0: + return True + else: + return False if __name__ == "__main__": main() - - - diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix9-32x/modules/Makefile b/platform/broadcom/sonic-platform-modules-quanta/ix9-32x/modules/Makefile index 929782931a47..8ab9ee0db1fb 100644 --- a/platform/broadcom/sonic-platform-modules-quanta/ix9-32x/modules/Makefile +++ b/platform/broadcom/sonic-platform-modules-quanta/ix9-32x/modules/Makefile @@ -1,3 +1,3 @@ -obj-m:=qci_cpld_qsfpdd.o qci_cpld_led.o qci_platform_ix9.o +obj-m:=qci_cpld_qsfpdd.o qci_cpld_led.o qci_platform_ix9.o quanta_hwmon_ipmi.o diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix9-32x/modules/qci_cpld_led.c b/platform/broadcom/sonic-platform-modules-quanta/ix9-32x/modules/qci_cpld_led.c index d8f89240a851..fdbc6c6c1634 100644 --- a/platform/broadcom/sonic-platform-modules-quanta/ix9-32x/modules/qci_cpld_led.c +++ b/platform/broadcom/sonic-platform-modules-quanta/ix9-32x/modules/qci_cpld_led.c @@ -26,6 +26,7 @@ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt +#include #include #include #include @@ -244,6 +245,8 @@ static int cpld_led_probe(struct i2c_client *client, } /* FIXME: for older kernel doesn't with idr_is_empty function, implement here */ +#if LINUX_VERSION_CODE > KERNEL_VERSION(4,10,0) +#else static int idr_has_entry(int id, void *p, void *data) { return 1; @@ -253,6 +256,7 @@ static bool cpld_idr_is_empty(struct idr *idp) { return !idr_for_each(idp, idr_has_entry, NULL); } +#endif static int cpld_led_remove(struct i2c_client *client) { @@ -262,8 +266,11 @@ static int cpld_led_remove(struct i2c_client *client) device_unregister(data->port_dev); ida_simple_remove(&cpld_led_ida, data->cpld_data->cpld_id); kfree(data->cpld_data); - +#if LINUX_VERSION_CODE > KERNEL_VERSION(4,10,0) + if (ida_is_empty(&cpld_led_ida)) +#else if (cpld_idr_is_empty(&cpld_led_ida.idr)) +#endif class_destroy(cpld_class); return 0; diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix9-32x/modules/qci_cpld_qsfpdd.c b/platform/broadcom/sonic-platform-modules-quanta/ix9-32x/modules/qci_cpld_qsfpdd.c index d616f887dbbf..89e04cee0902 100644 --- a/platform/broadcom/sonic-platform-modules-quanta/ix9-32x/modules/qci_cpld_qsfpdd.c +++ b/platform/broadcom/sonic-platform-modules-quanta/ix9-32x/modules/qci_cpld_qsfpdd.c @@ -26,6 +26,7 @@ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt +#include #include #include #include @@ -375,6 +376,8 @@ static int cpld_probe(struct i2c_client *client, } /* FIXME: for older kernel doesn't with idr_is_empty function, implement here */ +#if LINUX_VERSION_CODE > KERNEL_VERSION(4,10,0) +#else static int idr_has_entry(int id, void *p, void *data) { return 1; @@ -384,6 +387,7 @@ static bool cpld_idr_is_empty(struct idr *idp) { return !idr_for_each(idp, idr_has_entry, NULL); } +#endif static int cpld_remove(struct i2c_client *client) { @@ -397,9 +401,15 @@ static int cpld_remove(struct i2c_client *client) ida_simple_remove(&cpld_ida, data->port_data[i]->port_id); kfree(data->port_data[i]); } - +#if LINUX_VERSION_CODE > KERNEL_VERSION(4,10,0) + if (ida_is_empty(&cpld_ida)) +#else if (cpld_idr_is_empty(&cpld_ida.idr)) +#endif + { class_destroy(cpld_class); + cpld_class = NULL; + } return 0; } diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix9-32x/modules/qci_platform_ix9.c b/platform/broadcom/sonic-platform-modules-quanta/ix9-32x/modules/qci_platform_ix9.c index 1b98c4a2f31f..803b2b42f495 100644 --- a/platform/broadcom/sonic-platform-modules-quanta/ix9-32x/modules/qci_platform_ix9.c +++ b/platform/broadcom/sonic-platform-modules-quanta/ix9-32x/modules/qci_platform_ix9.c @@ -39,102 +39,11 @@ #include #include #include -#include #if LINUX_VERSION_CODE > KERNEL_VERSION(3,12,0) #include #else #include #endif -#define MUX_INFO(bus, deselect) \ - {.adap_id = bus, .deselect_on_exit = deselect} - -static struct pca954x_platform_mode pca9546_1_modes[] = { - MUX_INFO(0x10, 1), - MUX_INFO(0x11, 1), - MUX_INFO(0x12, 1), - MUX_INFO(0x13, 1), -}; - -static struct pca954x_platform_data pca9546_1_data = { - .modes = pca9546_1_modes, - .num_modes = 4, -}; - -static struct pca954x_platform_mode pca9548_1_modes[] = { - MUX_INFO(0x14, 1), - MUX_INFO(0x15, 1), - MUX_INFO(0x16, 1), - MUX_INFO(0x17, 1), -}; - -static struct pca954x_platform_data pca9548_1_data = { - .modes = pca9548_1_modes, - .num_modes = 4, -}; - -static struct pca954x_platform_mode pca9548sfp1_modes[] = { - MUX_INFO(0x20, 1), - MUX_INFO(0x21, 1), - MUX_INFO(0x22, 1), - MUX_INFO(0x23, 1), - MUX_INFO(0x24, 1), - MUX_INFO(0x25, 1), - MUX_INFO(0x26, 1), - MUX_INFO(0x27, 1), -}; - -static struct pca954x_platform_data pca9548sfp1_data = { - .modes = pca9548sfp1_modes, - .num_modes = 8, -}; - -static struct pca954x_platform_mode pca9548sfp2_modes[] = { - MUX_INFO(0x28, 1), - MUX_INFO(0x29, 1), - MUX_INFO(0x2a, 1), - MUX_INFO(0x2b, 1), - MUX_INFO(0x2c, 1), - MUX_INFO(0x2d, 1), - MUX_INFO(0x2e, 1), - MUX_INFO(0x2f, 1), -}; - -static struct pca954x_platform_data pca9548sfp2_data = { - .modes = pca9548sfp2_modes, - .num_modes = 8, -}; - -static struct pca954x_platform_mode pca9548sfp3_modes[] = { - MUX_INFO(0x30, 1), - MUX_INFO(0x31, 1), - MUX_INFO(0x32, 1), - MUX_INFO(0x33, 1), - MUX_INFO(0x34, 1), - MUX_INFO(0x35, 1), - MUX_INFO(0x36, 1), - MUX_INFO(0x37, 1), -}; - -static struct pca954x_platform_data pca9548sfp3_data = { - .modes = pca9548sfp3_modes, - .num_modes = 8, -}; - -static struct pca954x_platform_mode pca9548sfp4_modes[] = { - MUX_INFO(0x38, 1), - MUX_INFO(0x39, 1), - MUX_INFO(0x3a, 1), - MUX_INFO(0x3b, 1), - MUX_INFO(0x3c, 1), - MUX_INFO(0x3d, 1), - MUX_INFO(0x3e, 1), - MUX_INFO(0x3f, 1), -}; - -static struct pca954x_platform_data pca9548sfp4_data = { - .modes = pca9548sfp4_modes, - .num_modes = 8, -}; static struct pca953x_platform_data tca9539_1_data = { .gpio_base = 0x10, @@ -146,12 +55,10 @@ static struct pca953x_platform_data pca9555_CPU_data = { static struct i2c_board_info ix9_i2c_devices[] = { { - I2C_BOARD_INFO("pca9546", 0x72), - .platform_data = &pca9546_1_data, // 0 pca9546_1 + I2C_BOARD_INFO("pca9546", 0x72), // 0 pca9546_1 }, { - I2C_BOARD_INFO("pca9548", 0x77), - .platform_data = &pca9548_1_data, // 1 pca9548_1 + I2C_BOARD_INFO("pca9548", 0x77), // 1 pca9548_1 }, { I2C_BOARD_INFO("tca9539", 0x74), @@ -161,20 +68,16 @@ static struct i2c_board_info ix9_i2c_devices[] = { I2C_BOARD_INFO("24c02", 0x54), // 3 MB_BOARDINFO_EEPROM }, { - I2C_BOARD_INFO("pca9548", 0x73), - .platform_data = &pca9548sfp1_data, // 4 0x77 ch0 pca9548 #1 + I2C_BOARD_INFO("pca9548", 0x73), // 4 0x77 ch0 pca9548 #1 }, { - I2C_BOARD_INFO("pca9548", 0x73), - .platform_data = &pca9548sfp2_data, // 5 0x77 ch1 pca9548 #2 + I2C_BOARD_INFO("pca9548", 0x73), // 5 0x77 ch1 pca9548 #2 }, { - I2C_BOARD_INFO("pca9548", 0x73), - .platform_data = &pca9548sfp3_data, // 6 0x77 ch2 pca9548 #3 + I2C_BOARD_INFO("pca9548", 0x73), // 6 0x77 ch2 pca9548 #3 }, { - I2C_BOARD_INFO("pca9548", 0x73), - .platform_data = &pca9548sfp4_data, // 7 0x77 ch3 pca9548 #4 + I2C_BOARD_INFO("pca9548", 0x73), // 7 0x77 ch3 pca9548 #4 }, { I2C_BOARD_INFO("CPLD-QSFPDD", 0x38), // 8 0x72 ch0 CPLD-IO #2, #3 @@ -200,9 +103,13 @@ static struct platform_driver ix9_platform_driver = { static struct platform_device *ix9_device; +static struct i2c_client **g_client; +static struct i2c_client **g_client_port; +int numof_i2c_devices = 13; +int numof_ports = 32; + static int __init ix9_platform_init(void) { - struct i2c_client *client; struct i2c_adapter *adapter; int ret, i; @@ -221,51 +128,127 @@ static int __init ix9_platform_init(void) if (ret) goto fail_platform_device; + g_client = kmalloc(sizeof(*g_client) * numof_i2c_devices, GFP_KERNEL); + for (i = 0; i < numof_i2c_devices; i++) g_client[i] = NULL; + + g_client_port = kmalloc(sizeof(*g_client_port) * numof_ports, GFP_KERNEL); + for (i = 0; i < numof_ports; i++) g_client_port[i] = NULL; + adapter = i2c_get_adapter(0); - client = i2c_new_device(adapter, &ix9_i2c_devices[0]); // pca9546_1 - Address: 0x72 - client = i2c_new_device(adapter, &ix9_i2c_devices[1]); // pca9548_1 - Address: 0x77 - client = i2c_new_device(adapter, &ix9_i2c_devices[11]); // CPU Linking Board at CPU's I2C Bus - Address: 0x22 - i2c_put_adapter(adapter); + if (adapter == NULL) + { + printk("[%s] get i2c adapter fail at line %d", __FUNCTION__, __LINE__); + } + else + { + g_client[0] = i2c_new_device(adapter, &ix9_i2c_devices[0]); // pca9546_1 - Address: 0x72 + g_client[1] = i2c_new_device(adapter, &ix9_i2c_devices[1]); // pca9548_1 - Address: 0x77 + g_client[2] = i2c_new_device(adapter, &ix9_i2c_devices[11]); // CPU Linking Board at CPU's I2C Bus - Address: 0x22 + i2c_put_adapter(adapter); + } - adapter = i2c_get_adapter(0x10); - client = i2c_new_device(adapter, &ix9_i2c_devices[8]); // CPLD-IO #2 - Address: 0x38 - client = i2c_new_device(adapter, &ix9_i2c_devices[9]); // CPLD-LED #4 - Address: 0x39 - i2c_put_adapter(adapter); + adapter = i2c_get_adapter(0x01); + if (adapter == NULL) + { + printk("[%s] get i2c adapter fail at line %d", __FUNCTION__, __LINE__); + } + else + { + g_client[3] = i2c_new_device(adapter, &ix9_i2c_devices[8]); // CPLD-IO #2 - Address: 0x38 + g_client[4] = i2c_new_device(adapter, &ix9_i2c_devices[9]); // CPLD-LED #4 - Address: 0x39 + i2c_put_adapter(adapter); + } - adapter = i2c_get_adapter(0x11); - client = i2c_new_device(adapter, &ix9_i2c_devices[8]); // CPLD-IO #3 - Address: 0x38 - client = i2c_new_device(adapter, &ix9_i2c_devices[9]); // CPLD-LED #5 - Address: 0x39 - i2c_put_adapter(adapter); + adapter = i2c_get_adapter(0x02); + if (adapter == NULL) + { + printk("[%s] get i2c adapter fail at line %d", __FUNCTION__, __LINE__); + } + else + { + g_client[5] = i2c_new_device(adapter, &ix9_i2c_devices[8]); // CPLD-IO #3 - Address: 0x38 + g_client[6] = i2c_new_device(adapter, &ix9_i2c_devices[9]); // CPLD-LED #5 - Address: 0x39 + i2c_put_adapter(adapter); + } - adapter = i2c_get_adapter(0x12); - client = i2c_new_device(adapter, &ix9_i2c_devices[3]); // MB_BOARDINFO_EEPROM - Address: 0x54 - i2c_put_adapter(adapter); + adapter = i2c_get_adapter(0x03); + if (adapter == NULL) + { + printk("[%s] get i2c adapter fail at line %d", __FUNCTION__, __LINE__); + } + else + { + g_client[7] = i2c_new_device(adapter, &ix9_i2c_devices[3]); // MB_BOARDINFO_EEPROM - Address: 0x54 + i2c_put_adapter(adapter); + } - adapter = i2c_get_adapter(0x13); - client = i2c_new_device(adapter, &ix9_i2c_devices[2]); // tca9539_1 Board ID and QSFP-DD PW EN/PG - Address: 0x74 - i2c_put_adapter(adapter); + adapter = i2c_get_adapter(0x04); + if (adapter == NULL) + { + printk("[%s] get i2c adapter fail at line %d", __FUNCTION__, __LINE__); + } + else + { + g_client[8] = i2c_new_device(adapter, &ix9_i2c_devices[2]); // tca9539_1 Board ID and QSFP-DD PW EN/PG - Address: 0x74 + i2c_put_adapter(adapter); + } - adapter = i2c_get_adapter(0x14); - client = i2c_new_device(adapter, &ix9_i2c_devices[4]); // pca9548 #1 QSFPDD - Address: 0x73 - i2c_put_adapter(adapter); + adapter = i2c_get_adapter(0x05); + if (adapter == NULL) + { + printk("[%s] get i2c adapter fail at line %d", __FUNCTION__, __LINE__); + } + else + { + g_client[9] = i2c_new_device(adapter, &ix9_i2c_devices[4]); // pca9548 #1 QSFPDD - Address: 0x73 + i2c_put_adapter(adapter); + } - adapter = i2c_get_adapter(0x15); - client = i2c_new_device(adapter, &ix9_i2c_devices[5]); // pca9548 #2 QSFPDD - Address: 0x73 - i2c_put_adapter(adapter); + adapter = i2c_get_adapter(0x06); + if (adapter == NULL) + { + printk("[%s] get i2c adapter fail at line %d", __FUNCTION__, __LINE__); + } + else + { + g_client[10] = i2c_new_device(adapter, &ix9_i2c_devices[5]); // pca9548 #2 QSFPDD - Address: 0x73 + i2c_put_adapter(adapter); + } - adapter = i2c_get_adapter(0x16); - client = i2c_new_device(adapter, &ix9_i2c_devices[6]); // pca9548 #3 QSFPDD - Address: 0x73 - i2c_put_adapter(adapter); + adapter = i2c_get_adapter(0x07); + if (adapter == NULL) + { + printk("[%s] get i2c adapter fail at line %d", __FUNCTION__, __LINE__); + } + else + { + g_client[11] = i2c_new_device(adapter, &ix9_i2c_devices[6]); // pca9548 #3 QSFPDD - Address: 0x73 + i2c_put_adapter(adapter); + } - adapter = i2c_get_adapter(0x17); - client = i2c_new_device(adapter, &ix9_i2c_devices[7]); // pca9548 #4 QSFPDD - Address: 0x73 - i2c_put_adapter(adapter); + adapter = i2c_get_adapter(0x08); + if (adapter == NULL) + { + printk("[%s] get i2c adapter fail at line %d", __FUNCTION__, __LINE__); + } + else + { + g_client[12] = i2c_new_device(adapter, &ix9_i2c_devices[7]); // pca9548 #4 QSFPDD - Address: 0x73 + i2c_put_adapter(adapter); + } - for(i = 0x20; i < 0x40; i++) + for(i = 13; i < 45; i++) { adapter = i2c_get_adapter(i); - client = i2c_new_device(adapter, &ix9_i2c_devices[10]); // eeprom for loopback module - Address: 0x50 - i2c_put_adapter(adapter); + if (adapter == NULL) + { + printk("[%s] get i2c adapter fail at line %d", __FUNCTION__, __LINE__); + } + else + { + g_client_port[i - 13] = i2c_new_device(adapter, &ix9_i2c_devices[10]); // eeprom for loopback module - Address: 0x50 + i2c_put_adapter(adapter); + } } return 0; @@ -280,6 +263,26 @@ static int __init ix9_platform_init(void) static void __exit ix9_platform_exit(void) { + int i = 0; + + for (i = numof_ports - 1; i >= 0; i--) + { + if (g_client_port[i]) + { + i2c_unregister_device(g_client_port[i]); + g_client_port[i] = NULL; + } + } + + for (i = numof_i2c_devices - 1; i >= 0; i--) + { + if (g_client[i]) + { + i2c_unregister_device(g_client[i]); + g_client[i] = NULL; + } + } + platform_device_unregister(ix9_device); platform_driver_unregister(&ix9_platform_driver); } diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix9-32x/modules/quanta_hwmon_ipmi.c b/platform/broadcom/sonic-platform-modules-quanta/ix9-32x/modules/quanta_hwmon_ipmi.c new file mode 100644 index 000000000000..05a9e044c75b --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix9-32x/modules/quanta_hwmon_ipmi.c @@ -0,0 +1,1669 @@ +/* +* +* A hwmon driver for the Quanta switch BMC hwmon +* +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define enable_debug_msg 0 +#define DEBUGUSE_SHIFT 0 + +#define DRVNAME "quanta_hwmon_ipmi" + +#define tos32(val, bits) ((val & ((1<<((bits)-1)))) ? (-((val) & (1<<((bits)-1))) | (val)) : (val)) +#define BSWAP_16(x) ((((x) & 0xff00) >> 8) | (((x) & 0x00ff) << 8)) +#define BSWAP_32(x) ((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >> 8) | (((x) & 0x0000ff00) << 8) | (((x) & 0x000000ff) << 24)) +#define __TO_M(mtol) (int16_t)(tos32((((BSWAP_16(mtol) & 0xff00) >> 8) | ((BSWAP_16(mtol) & 0xc0) << 2)), 10)) +#define __TO_B(bacc) (int32_t)(tos32((((BSWAP_32(bacc) & 0xff000000) >> 24) | ((BSWAP_32(bacc) & 0xc00000) >> 14)), 10)) +#define __TO_R_EXP(bacc) (int32_t)(tos32(((BSWAP_32(bacc) & 0xf0) >> 4), 4)) +#define __TO_B_EXP(bacc) (int32_t)(tos32((BSWAP_32(bacc) & 0xf), 4)) + +#define SENSOR_ATTR_MAX 19 +#define SENSOR_ATTR_NAME_LENGTH 20 + +#define SENSOR_GET_CAP_LABEL 0x001 +#define SENSOR_GET_CAP_ALARM 0x002 +#define SENSOR_GET_CAP_INPUT 0x004 + +#define SENSOR_GET_CAP_LNC 0x008 +#define SENSOR_GET_CAP_LCR 0x010 +#define SENSOR_GET_CAP_LNR 0x020 + +#define SENSOR_GET_CAP_UNC 0x040 +#define SENSOR_GET_CAP_UCR 0x080 +#define SENSOR_GET_CAP_UNR 0x100 + +#define SENSOR_GET_CAP_MODEL 0x200 +#define SENSOR_GET_CAP_SN 0x400 +#define SENSOR_GET_CAP_PWM 0x800 + +#define SENSOR_GET_CAP_CONMODE 0x1000 +#define SENSOR_GET_CAP_DIRECTION 0x2000 +#define SENSOR_GET_CAP_FAN_PRESENT 0x4000 +#define SENSOR_GET_CAP_PSU_PRESENT 0x8000 + +#define SENSOR_GET_CAP_MFRID 0x10000 +#define SENSOR_GET_CAP_VIN_TYPE 0x20000 +#define SENSOR_GET_CAP_POUT_MAX 0x40000 + +#define SDR_SENSOR_TYPE_TEMP 0x01 +#define SDR_SENSOR_TYPE_VOLT 0x02 +#define SDR_SENSOR_TYPE_CURR 0x03 +#define SDR_SENSOR_TYPE_FAN 0x04 +#define SDR_SENSOR_TYPE_PS 0x08 +#define SDR_SENSOR_TYPE_OTHER 0x0b + +#define BMC_GET_DEVICE_ID 0x01 + +#define IPMI_NETFN_SE 0x04 +#define IPMI_NETFN_APP 0x06 +#define IPMI_NETFN_STORAGE 0x0a +#define IPMI_NETFN_TSOL 0x30 + +#define GET_SDR_REPO_INFO 0x20 +#define GET_DEVICE_SDR 0x21 +#define GET_SDR_RESERVE_REPO 0x22 +#define GET_SDR 0x23 +#define GET_SENSOR_THRESHOLDS 0x27 +#define GET_SENSOR_EVENT_ENABLE 0x29 +#define GET_SENSOR_EVENT_STATUS 0x2b +#define GET_SENSOR_READING 0x2d +#define GET_PSU_READING 0x52 +#define GET_FAN_INFO 0xd6 +#define GET_FRU_INFO 0x11 + +#define IPM_DEV_DEVICE_ID_SDR_MASK (0x80) /* 1 = provides SDRs */ +#define IPMI_TIMEOUT (4 * HZ) +#define IPMI_MAX_WAIT_QUEUE 1 + +struct quanta_hwmon_ipmi_data { + struct platform_device *ipmi_platform_dev; + struct device *ipmi_hwmon_dev; + //struct mutex ipmi_lock; + + int32_t total_sensor_id; + int32_t total_suport_sensor; + int32_t total_create_sysfs; +} *data; + +static struct mutex ipmi_lock; +static struct completion g_read_complete; + +static ipmi_user_t ipmi_mh_user = NULL; + +static int8_t g_fan_control_mode = 3; +static int32_t g_use_built_in = 0; +static int32_t ipmi_wait_queue = 0; + +struct ipmi_sensor_data { + uint8_t addr; + uint8_t sensor_type; + uint8_t sensor_idstring[SENSOR_ATTR_NAME_LENGTH]; + + uint32_t capability; + + struct header_info { + uint8_t header_type; + uint8_t header_byte; + } headerinfo; + + struct record_info { + uint8_t record_analog; + uint8_t record_linearization; + + int32_t record_m; + int32_t record_b; + int32_t record_k1; + int32_t record_k2; + } recordinfo; + + struct threshold_upper_info { + uint8_t unr; + uint8_t ucr; + uint8_t unc; + } upperinfo; + + struct threshold_lower_info { + uint8_t lnr; + uint8_t lcr; + uint8_t lnc; + } lowerinfo; + + struct attr_info + { + bool attr_exist; + char attr_name[SENSOR_ATTR_MAX][SENSOR_ATTR_NAME_LENGTH]; + char attr_type_str[SENSOR_ATTR_NAME_LENGTH]; + + struct attribute *attrs[SENSOR_ATTR_MAX + 1]; + struct attribute_group attr_group; + struct sensor_device_attribute sd_attrs[SENSOR_ATTR_MAX + 1]; + } attrinfo; + +} *g_sensor_data; + +struct ipmi_comm_data { + int32_t tx_id; + + int32_t rx_result; + int64_t rx_len; + void *rx_data; + struct completion *rx_read_complete; +}; + +struct ipmi_sdr_iterator { + uint16_t reservation; + int32_t total; + int32_t next; +}; + +struct ipm_devid_rsp { + uint8_t device_id; + uint8_t device_revision; + uint8_t fw_rev1; + uint8_t fw_rev2; + uint8_t ipmi_version; + uint8_t adtl_device_support; + uint8_t manufacturer_id[3]; + uint8_t product_id[2]; + uint8_t aux_fw_rev[4]; +} __attribute__((packed)); + +struct sdr_repo_info_rs { + uint8_t version; /* SDR version (51h) */ + uint16_t count; /* number of records */ + uint16_t free; /* free space in SDR */ + uint32_t add_stamp; /* last add timestamp */ + uint32_t erase_stamp; /* last del timestamp */ + uint8_t op_support; /* supported operations */ +} __attribute__((packed)); + +struct sdr_device_info_rs { + uint8_t count; /* number of records */ + uint8_t flags; /* flags */ + uint8_t popChangeInd[3]; /* free space in SDR */ +} __attribute__((packed)); + +struct sdr_get_rs { + uint16_t next; /* next record id */ + uint16_t id; /* record ID */ + uint8_t version; /* SDR version (51h) */ +#define SDR_RECORD_TYPE_FULL_SENSOR 0x01 +#define SDR_RECORD_TYPE_COMPACT_SENSOR 0x02 +#define SDR_RECORD_TYPE_EVENTONLY_SENSOR 0x03 +#define SDR_RECORD_TYPE_ENTITY_ASSOC 0x08 +#define SDR_RECORD_TYPE_DEVICE_ENTITY_ASSOC 0x09 +#define SDR_RECORD_TYPE_GENERIC_DEVICE_LOCATOR 0x10 +#define SDR_RECORD_TYPE_FRU_DEVICE_LOCATOR 0x11 +#define SDR_RECORD_TYPE_MC_DEVICE_LOCATOR 0x12 +#define SDR_RECORD_TYPE_MC_CONFIRMATION 0x13 +#define SDR_RECORD_TYPE_BMC_MSG_CHANNEL_INFO 0x14 +#define SDR_RECORD_TYPE_OEM 0xc0 + uint8_t type; /* record type */ + uint8_t length; /* remaining record bytes */ +} __attribute__((packed)); + +struct sdr_get_rq { + uint16_t reserve_id; /* reservation ID */ + uint16_t id; /* record ID */ + uint8_t offset; /* offset into SDR */ +#define GET_SDR_ENTIRE_RECORD 0xff + uint8_t length; /* length to read */ +} __attribute__((packed)); + +struct entity_id { + uint8_t id; /* physical entity id */ +#ifdef WORDS_BIGENDIAN + uint8_t logical : 1; /* physical/logical */ + uint8_t instance : 7; /* instance number */ +#else + uint8_t instance : 7; /* instance number */ + uint8_t logical : 1; /* physical/logical */ +#endif +} __attribute__((packed)); + +struct sdr_record_mask { + union { + struct { + uint16_t assert_event; /* assertion event mask */ + uint16_t deassert_event; /* de-assertion event mask */ + uint16_t read; /* discrete reading mask */ + } discrete; + struct { +#ifdef WORDS_BIGENDIAN + uint16_t reserved : 1; + uint16_t status_lnr : 1; + uint16_t status_lcr : 1; + uint16_t status_lnc : 1; + uint16_t assert_unr_high : 1; + uint16_t assert_unr_low : 1; + uint16_t assert_ucr_high : 1; + uint16_t assert_ucr_low : 1; + uint16_t assert_unc_high : 1; + uint16_t assert_unc_low : 1; + uint16_t assert_lnr_high : 1; + uint16_t assert_lnr_low : 1; + uint16_t assert_lcr_high : 1; + uint16_t assert_lcr_low : 1; + uint16_t assert_lnc_high : 1; + uint16_t assert_lnc_low : 1; +#else + uint16_t assert_lnc_low : 1; + uint16_t assert_lnc_high : 1; + uint16_t assert_lcr_low : 1; + uint16_t assert_lcr_high : 1; + uint16_t assert_lnr_low : 1; + uint16_t assert_lnr_high : 1; + uint16_t assert_unc_low : 1; + uint16_t assert_unc_high : 1; + uint16_t assert_ucr_low : 1; + uint16_t assert_ucr_high : 1; + uint16_t assert_unr_low : 1; + uint16_t assert_unr_high : 1; + uint16_t status_lnc : 1; + uint16_t status_lcr : 1; + uint16_t status_lnr : 1; + uint16_t reserved : 1; +#endif +#ifdef WORDS_BIGENDIAN + uint16_t reserved_2 : 1; + uint16_t status_unr : 1; + uint16_t status_ucr : 1; + uint16_t status_unc : 1; + uint16_t deassert_unr_high : 1; + uint16_t deassert_unr_low : 1; + uint16_t deassert_ucr_high : 1; + uint16_t deassert_ucr_low : 1; + uint16_t deassert_unc_high : 1; + uint16_t deassert_unc_low : 1; + uint16_t deassert_lnr_high : 1; + uint16_t deassert_lnr_low : 1; + uint16_t deassert_lcr_high : 1; + uint16_t deassert_lcr_low : 1; + uint16_t deassert_lnc_high : 1; + uint16_t deassert_lnc_low : 1; +#else + uint16_t deassert_lnc_low : 1; + uint16_t deassert_lnc_high : 1; + uint16_t deassert_lcr_low : 1; + uint16_t deassert_lcr_high : 1; + uint16_t deassert_lnr_low : 1; + uint16_t deassert_lnr_high : 1; + uint16_t deassert_unc_low : 1; + uint16_t deassert_unc_high : 1; + uint16_t deassert_ucr_low : 1; + uint16_t deassert_ucr_high : 1; + uint16_t deassert_unr_low : 1; + uint16_t deassert_unr_high : 1; + uint16_t status_unc : 1; + uint16_t status_ucr : 1; + uint16_t status_unr : 1; + uint16_t reserved_2 : 1; +#endif + union { + struct { +#ifdef WORDS_BIGENDIAN /* settable threshold mask */ + uint16_t reserved : 2; + uint16_t unr : 1; + uint16_t ucr : 1; + uint16_t unc : 1; + uint16_t lnr : 1; + uint16_t lcr : 1; + uint16_t lnc : 1; + /* padding lower 8 bits */ + uint16_t readable : 8; +#else + uint16_t readable : 8; + uint16_t lnc : 1; + uint16_t lcr : 1; + uint16_t lnr : 1; + uint16_t unc : 1; + uint16_t ucr : 1; + uint16_t unr : 1; + uint16_t reserved : 2; +#endif + } set; + struct { +#ifdef WORDS_BIGENDIAN /* readable threshold mask */ + /* padding upper 8 bits */ + uint16_t settable : 8; + uint16_t reserved : 2; + uint16_t unr : 1; + uint16_t ucr : 1; + uint16_t unc : 1; + uint16_t lnr : 1; + uint16_t lcr : 1; + uint16_t lnc : 1; +#else + uint16_t lnc : 1; + uint16_t lcr : 1; + uint16_t lnr : 1; + uint16_t unc : 1; + uint16_t ucr : 1; + uint16_t unr : 1; + uint16_t reserved : 2; + uint16_t settable : 8; +#endif + } read; + }; + } threshold; + } type; +} __attribute__((packed)); + +struct sdr_record_full_sensor { + struct { + uint8_t owner_id; +#ifdef WORDS_BIGENDIAN + uint8_t channel : 4; /* channel number */ + uint8_t __reserved : 2; + uint8_t lun : 2; /* sensor owner lun */ +#else + uint8_t lun : 2; /* sensor owner lun */ + uint8_t __reserved : 2; + uint8_t channel : 4; /* channel number */ +#endif + uint8_t sensor_num; /* unique sensor number */ + } keys; + + struct entity_id entity; + + struct { + struct { +#ifdef WORDS_BIGENDIAN + uint8_t __reserved : 1; + uint8_t scanning : 1; + uint8_t events : 1; + uint8_t thresholds : 1; + uint8_t hysteresis : 1; + uint8_t type : 1; + uint8_t event_gen : 1; + uint8_t sensor_scan : 1; +#else + uint8_t sensor_scan : 1; + uint8_t event_gen : 1; + uint8_t type : 1; + uint8_t hysteresis : 1; + uint8_t thresholds : 1; + uint8_t events : 1; + uint8_t scanning : 1; + uint8_t __reserved : 1; +#endif + } init; + struct { +#ifdef WORDS_BIGENDIAN + uint8_t ignore : 1; + uint8_t rearm : 1; + uint8_t hysteresis : 2; + uint8_t threshold : 2; + uint8_t event_msg : 2; +#else + uint8_t event_msg : 2; + uint8_t threshold : 2; + uint8_t hysteresis : 2; + uint8_t rearm : 1; + uint8_t ignore : 1; +#endif + } capabilities; + uint8_t type; + } sensor; + + uint8_t event_type; /* event/reading type code */ + + struct sdr_record_mask mask; + + struct { +#ifdef WORDS_BIGENDIAN + uint8_t analog : 2; + uint8_t rate : 3; + uint8_t modifier : 2; + uint8_t pct : 1; +#else + uint8_t pct : 1; + uint8_t modifier : 2; + uint8_t rate : 3; + uint8_t analog : 2; +#endif + struct { + uint8_t base; + uint8_t modifier; + } type; + } unit; + +#define SDR_SENSOR_L_LINEAR 0x00 +#define SDR_SENSOR_L_LN 0x01 +#define SDR_SENSOR_L_LOG10 0x02 +#define SDR_SENSOR_L_LOG2 0x03 +#define SDR_SENSOR_L_E 0x04 +#define SDR_SENSOR_L_EXP10 0x05 +#define SDR_SENSOR_L_EXP2 0x06 +#define SDR_SENSOR_L_1_X 0x07 +#define SDR_SENSOR_L_SQR 0x08 +#define SDR_SENSOR_L_CUBE 0x09 +#define SDR_SENSOR_L_SQRT 0x0a +#define SDR_SENSOR_L_CUBERT 0x0b +#define SDR_SENSOR_L_NONLINEAR 0x70 + + uint8_t linearization; /* 70h=non linear, 71h-7Fh=non linear, OEM */ + uint16_t mtol; /* M, tolerance */ + uint32_t bacc; /* accuracy, B, Bexp, Rexp */ + + struct { +#ifdef WORDS_BIGENDIAN + uint8_t __reserved : 5; + uint8_t normal_min : 1; /* normal min field specified */ + uint8_t normal_max : 1; /* normal max field specified */ + uint8_t nominal_read : 1; /* nominal reading field specified */ +#else + uint8_t nominal_read : 1; /* nominal reading field specified */ + uint8_t normal_max : 1; /* normal max field specified */ + uint8_t normal_min : 1; /* normal min field specified */ + uint8_t __reserved : 5; +#endif + } analog_flag; + + uint8_t nominal_read; /* nominal reading, raw value */ + uint8_t normal_max; /* normal maximum, raw value */ + uint8_t normal_min; /* normal minimum, raw value */ + uint8_t sensor_max; /* sensor maximum, raw value */ + uint8_t sensor_min; /* sensor minimum, raw value */ + + struct { + struct { + uint8_t non_recover; + uint8_t critical; + uint8_t non_critical; + } upper; + struct { + uint8_t non_recover; + uint8_t critical; + uint8_t non_critical; + } lower; + struct { + uint8_t positive; + uint8_t negative; + } hysteresis; + } threshold; + uint8_t __reserved[2]; + uint8_t oem; /* reserved for OEM use */ + uint8_t id_code; /* sensor ID string type/length code */ + uint8_t id_string[16]; /* sensor ID string bytes, only if id_code != 0 */ +} __attribute__((packed)); + +int32_t pow_convert(int32_t *a, int32_t b) +{ + /* function input parameter (a * 10 ^ b) */ + int32_t i = 0, r = 1, temp_b = 0; + + temp_b = (b > 0) ? b : -b; + + for (i = 0; i < temp_b; i++) r = r * 10; + + if (b > 0) { + *a = (*a) * r; + r = 1; + } + /* function return parameter calc_result = *a, decimal_point = r */ + return r; +} + +void simple_atoi(const char *buf, int8_t *output_val) +{ + while (*buf >= '0' && *buf <= '9') { + *output_val = *output_val * 10 + *buf - '0'; + buf++; + } +} + +static void ipmi_msg_handler(struct ipmi_recv_msg *msg, void *handler_data) +{ + int32_t rv = -IPMI_UNKNOWN_ERR_COMPLETION_CODE; + + struct ipmi_comm_data *comm_data = msg->user_msg_data; + + ipmi_wait_queue--; + + if (msg->msg.data[0] != 0) { + if ((msg->msg.data[0] != 0x83) && (msg->msg.netfn != 0x07) && (msg->msg.cmd != 0x52)) { + //skip master r/w cmd return code + printk("ipmi: Error 0x%x on cmd 0x%x/0x%x\n", msg->msg.data[0], msg->msg.netfn, msg->msg.cmd); + rv = msg->msg.data[0]; + goto get_BMC_response_fail; + } + } + + if (msg->msgid != comm_data->tx_id) { + printk("ipmi: rx msgid %d mismatch tx msgid %d\n", (int32_t)msg->msgid, comm_data->tx_id); + goto get_BMC_response_fail; + } + + if (msg->msg.data_len <= 0) { + printk("ipmi: Data len too low (%d)\n", msg->msg.data_len); + goto get_BMC_response_fail; + } + + if (msg->msg.data_len > 1) { + if (comm_data->rx_len) { + comm_data->rx_len = msg->msg.data_len - 1; + memcpy(comm_data->rx_data, msg->msg.data + 1, comm_data->rx_len); + } + else { + printk("ipmi: rx len = 0, it should be not retrun ?\n"); + goto get_BMC_response_fail; + } +} + + rv = 0; + +get_BMC_response_fail: + ipmi_free_recv_msg(msg); + + if (ipmi_wait_queue == 0) { + comm_data->rx_result = rv; + if (rv == 0) complete(comm_data->rx_read_complete); + } +} +static struct ipmi_user_hndl ipmi_hndlrs = { .ipmi_recv_hndl = ipmi_msg_handler, }; + +int32_t ipmi_request_wait_for_response(struct kernel_ipmi_msg msg, struct ipmi_comm_data *comm_data) +{ + int32_t rv = 0; + int32_t escape_time = 0; + + struct ipmi_addr ipmi_address; + + if (ipmi_wait_queue >= IPMI_MAX_WAIT_QUEUE) { + /* printk("msg queue full, cannot send ipmi cmd\n"); */ + return -EBUSY; + } + ipmi_wait_queue++; + + ipmi_address.addr_type = IPMI_SYSTEM_INTERFACE_ADDR_TYPE; + ipmi_address.channel = IPMI_BMC_CHANNEL; + ipmi_address.data[0] = 0; + + rv = ipmi_validate_addr(&ipmi_address, sizeof(ipmi_address)); + if (rv) { + printk("ipmi_validate_addr fail, err code : %d\n", rv); + return rv; + } + + ipmi_request_settime(ipmi_mh_user, &ipmi_address, comm_data->tx_id, &msg, comm_data, 0, 0, 0); + + escape_time = wait_for_completion_timeout(comm_data->rx_read_complete, IPMI_TIMEOUT); + + rv = comm_data->rx_result; + if (escape_time == 0) { + printk("BMC not response (%d)\n", escape_time); + } + + return rv; +} + +int32_t ipmi_send_system_cmd(uint8_t *msg_tx_data, int32_t msg_tx_len, void *msg_rx_data, int32_t msg_rx_len) +{ + int32_t i = 0; + int32_t rv = 0; + + static uint64_t tx_msgid = 1; + + struct kernel_ipmi_msg msg; + struct ipmi_comm_data *comm_data = NULL; + struct completion read_complete; + + init_completion(&read_complete); + + /* prepare transfer message */ + msg.netfn = msg_tx_data[0]; + msg.cmd = msg_tx_data[1]; + msg.data_len = msg_tx_len - 2; + + msg.data = kzalloc(msg.data_len, GFP_KERNEL); + if (msg.data == NULL) { + printk("%s(%d): malloc [msg.data] failure", __func__, __LINE__); + rv = -ENOMEM; + goto alloc_mem_fail; + } + + comm_data = kzalloc(sizeof(struct ipmi_comm_data), GFP_KERNEL); + if (comm_data == NULL) { + printk("%s(%d): malloc [comm_data] failure", __func__, __LINE__); + rv = -ENOMEM; + goto alloc_mem_fail; + } + + for (i = 2; i < msg_tx_len; i++) { + msg.data[i - 2] = msg_tx_data[i]; + } + + comm_data->tx_id = tx_msgid++; + + /* prepare recive message */ + comm_data->rx_data = msg_rx_data; + comm_data->rx_len = msg_rx_len; + comm_data->rx_result = -1; + comm_data->rx_read_complete = &read_complete; + + rv = ipmi_request_wait_for_response(msg, comm_data); + +alloc_mem_fail: + if (msg.data) kfree(msg.data); + if (comm_data) kfree(comm_data); + if (tx_msgid > UINT_MAX) tx_msgid = 1; + + return rv; +} + +int32_t ipmi_sdr_get_reservation(uint16_t * reserve_id) +{ + int32_t rv = 0; + uint8_t msg_data[] = { 0x00, GET_SDR_RESERVE_REPO }; //netfn = 0x00; cmd = GET_SDR_RESERVE_REPO; + + msg_data[0] = (g_use_built_in == 0) ? IPMI_NETFN_STORAGE : IPMI_NETFN_SE; + + /* obtain reservation ID */ + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), reserve_id, 1); + if (rv) printk("BMC down at (%d)!!\n", __LINE__); + +#if enable_debug_msg + printk("SDR reservation ID %04x\n", *reserve_id); +#endif + + return rv; +} + +int32_t ipmi_sdr_start(struct ipmi_sdr_iterator *itr) +{ + int32_t rv = 0; + + uint8_t msg_data[] = { IPMI_NETFN_APP, BMC_GET_DEVICE_ID }; //netfn = IPMI_NETFN_APP; cmd = BMC_GET_DEVICE_ID; + + struct ipm_devid_rsp devid; + + /* check SDRR capability */ + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), &devid, 1); + if (rv) { + printk("BMC down at (%d)!!\n", __LINE__); + return rv; + } + + if (devid.device_revision & IPM_DEV_DEVICE_ID_SDR_MASK) { + if ((devid.adtl_device_support & 0x02) == 0) { + if ((devid.adtl_device_support & 0x01)) { + printk("Using Device SDRs\n"); + g_use_built_in = 1; + } + else { + printk("Error obtaining SDR info\n"); + } + } + } + + if (g_use_built_in == 0) { + struct sdr_repo_info_rs sdr_info; + /* get sdr repository info */ + msg_data[0] = IPMI_NETFN_STORAGE; + msg_data[1] = GET_SDR_REPO_INFO; + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), &sdr_info, 1); + itr->total = sdr_info.count; + +#if enable_debug_msg + printk("SDR version: 0x%x\n", sdr_info.version); + printk("SDR free space: %d\n", sdr_info.free); +#endif + } + else { + struct sdr_device_info_rs sdr_info; + /* get device sdr info */ + msg_data[0] = IPMI_NETFN_SE; + msg_data[1] = GET_SDR_REPO_INFO; + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), &sdr_info, 1); + itr->total = sdr_info.count; + } + +#if enable_debug_msg + printk("SDR records : %d\n", sdr_info.count); +#endif + + if (rv) { + printk("BMC down at (%d)!!\n", __LINE__); + } + else { + itr->next = 0; + rv = ipmi_sdr_get_reservation(&(itr->reservation)); + } + + return rv; +} + +int32_t ipmi_sdr_get_header(struct ipmi_sdr_iterator *itr, struct sdr_get_rs *sdr_rs) +{ + int32_t rv = 0; + + uint8_t msg_data[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; //netfn = 0x00; cmd = 0x00; + + struct sdr_get_rq sdr_rq; + + sdr_rq.reserve_id = itr->reservation; + sdr_rq.id = itr->next; + sdr_rq.offset = 0; + sdr_rq.length = 5; /* only get the header */ + + if (g_use_built_in == 0) { + msg_data[0] = IPMI_NETFN_STORAGE; + msg_data[1] = GET_SDR; + } + else { + msg_data[0] = IPMI_NETFN_SE; + msg_data[1] = GET_DEVICE_SDR; + } + + memcpy(msg_data + 2, (uint8_t *)&sdr_rq, sizeof(struct sdr_get_rq)); + + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), sdr_rs, 1); + if ((rv) || (sdr_rs->length == 0)) { + printk("SDR record id 0x%04x: invalid length %d", itr->next, sdr_rs->length); + return -1; + } + + if (sdr_rs->id != itr->next) { +#if enable_debug_msg + printk("SDR record id mismatch: 0x%04x\n", sdr_rs->id); +#endif + sdr_rs->id = itr->next; + } +#if enable_debug_msg + printk("\nSDR record ID : 0x%04x", itr->next); + printk("SDR record type : 0x%02x\n", sdr_rs->type); + printk("SDR record next : 0x%04x\n", sdr_rs->next); + printk("SDR record bytes: %d\n", sdr_rs->length); +#endif + + return rv; +} + +int32_t ipmi_sdr_get_record(struct sdr_get_rs * header, struct ipmi_sdr_iterator * itr, uint8_t *ret_data) +{ + int32_t rv = 0, len = 0; + + uint8_t buff[128] = ""; + uint8_t msg_data[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; //netfn = 0x00; cmd = 0x00; + + struct sdr_get_rq sdr_rq; + + len = header->length; + if (len > 0) { + memset(&sdr_rq, 0, sizeof(sdr_rq)); + sdr_rq.reserve_id = itr->reservation; + sdr_rq.id = header->id; + sdr_rq.offset = 5; + sdr_rq.length = len; + + if (g_use_built_in == 0) { + msg_data[0] = IPMI_NETFN_STORAGE; + msg_data[1] = GET_SDR; + } + else { + msg_data[0] = IPMI_NETFN_SE; + msg_data[1] = GET_DEVICE_SDR; + } + + memcpy(msg_data + 2, (uint8_t *)&sdr_rq, sizeof(struct sdr_get_rq)); + + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), ret_data, 1); + if (rv) { + printk("BMC down at (%d)!!\n", __LINE__); + } + else { + memset(buff, 0, sizeof(buff)); + memcpy(buff, ret_data + 2, sdr_rq.length); + memcpy(ret_data, buff, sdr_rq.length + 2); + } + } + + return rv; +} + +void ipmi_sdr_set_sensor_threshold(uint8_t idx, struct sdr_record_full_sensor *sensor) +{ + + /*refer to Table 35-, Get Sensor Event Enable*/ + /* + // change detect threshold method, keep it for record detail format + // in this version function input is + "void ipmi_sdr_set_sensor_threshold(uint8_t idx, uint8_t *rec)" + #define offset_threshold_enable 9 + #define offset_threshold_data 31 + if (rec[offset_threshold_enable + 1] & 0x08) g_sensor_data[idx].upperinfo.unr_high = 1; + if (rec[offset_threshold_enable + 1] & 0x04) g_sensor_data[idx].upperinfo.unr_low = 1; + if (rec[offset_threshold_enable + 1] & 0x02) g_sensor_data[idx].upperinfo.ucr_high = 1; + if (rec[offset_threshold_enable + 1] & 0x01) g_sensor_data[idx].upperinfo.ucr_low = 1; + if (rec[offset_threshold_enable] & 0x80) g_sensor_data[idx].upperinfo.unc_high = 1; + if (rec[offset_threshold_enable] & 0x40) g_sensor_data[idx].upperinfo.unc_low = 1; + + if (rec[offset_threshold_enable] & 0x20) g_sensor_data[idx].lowerinfo.lnr_high = 1; + if (rec[offset_threshold_enable] & 0x10) g_sensor_data[idx].lowerinfo.lnr_low = 1; + if (rec[offset_threshold_enable] & 0x08) g_sensor_data[idx].lowerinfo.lcr_high = 1; + if (rec[offset_threshold_enable] & 0x04) g_sensor_data[idx].lowerinfo.lcr_low = 1; + if (rec[offset_threshold_enable] & 0x02) g_sensor_data[idx].lowerinfo.lnc_high = 1; + if (rec[offset_threshold_enable] & 0x01) g_sensor_data[idx].lowerinfo.lnc_low = 1; + //*/ + + /* lower threshold info */ + if (sensor->mask.type.threshold.read.lnc) g_sensor_data[idx].capability |= SENSOR_GET_CAP_LNC; + if (sensor->mask.type.threshold.read.lcr) g_sensor_data[idx].capability |= SENSOR_GET_CAP_LCR; + if (sensor->mask.type.threshold.read.lnr) g_sensor_data[idx].capability |= SENSOR_GET_CAP_LNR; + g_sensor_data[idx].lowerinfo.lnc = sensor->threshold.lower.non_critical; + g_sensor_data[idx].lowerinfo.lcr = sensor->threshold.lower.critical; + g_sensor_data[idx].lowerinfo.lnr = sensor->threshold.lower.non_recover; + + /* upper threshold info */ + if (sensor->mask.type.threshold.read.unc) g_sensor_data[idx].capability |= SENSOR_GET_CAP_UNC; + if (sensor->mask.type.threshold.read.ucr) g_sensor_data[idx].capability |= SENSOR_GET_CAP_UCR; + if (sensor->mask.type.threshold.read.unr) g_sensor_data[idx].capability |= SENSOR_GET_CAP_UNR; + g_sensor_data[idx].upperinfo.unc = sensor->threshold.upper.non_critical; + g_sensor_data[idx].upperinfo.ucr = sensor->threshold.upper.critical; + g_sensor_data[idx].upperinfo.unr = sensor->threshold.upper.non_recover; +} + +void ipmi_sdr_set_sensor_factor(uint8_t idx, struct sdr_record_full_sensor *sensor) +{ + char *loc = NULL; + + g_sensor_data[idx].sensor_type = sensor->sensor.type; + sprintf(g_sensor_data[idx].sensor_idstring, "%s", sensor->id_string); + + g_sensor_data[idx].recordinfo.record_m = __TO_M(sensor->mtol); + g_sensor_data[idx].recordinfo.record_b = __TO_B(sensor->bacc); + g_sensor_data[idx].recordinfo.record_k1 = __TO_B_EXP(sensor->bacc); + g_sensor_data[idx].recordinfo.record_k2 = __TO_R_EXP(sensor->bacc); + + g_sensor_data[idx].recordinfo.record_analog = sensor->unit.analog; + g_sensor_data[idx].recordinfo.record_linearization = sensor->linearization; + + memset(g_sensor_data[idx].attrinfo.attr_type_str, 0x00, SENSOR_ATTR_NAME_LENGTH); + + switch (g_sensor_data[idx].sensor_type) + { + case SDR_SENSOR_TYPE_TEMP: + sprintf(g_sensor_data[idx].attrinfo.attr_type_str, "temp"); + break; + case SDR_SENSOR_TYPE_VOLT: + sprintf(g_sensor_data[idx].attrinfo.attr_type_str, "in"); + break; + case SDR_SENSOR_TYPE_FAN: + g_sensor_data[idx].capability |= SENSOR_GET_CAP_PWM; + g_sensor_data[idx].capability |= SENSOR_GET_CAP_CONMODE; + g_sensor_data[idx].capability |= SENSOR_GET_CAP_DIRECTION; + sprintf(g_sensor_data[idx].attrinfo.attr_type_str, "fan"); + break; + case SDR_SENSOR_TYPE_PS: + loc = strstr(g_sensor_data[idx].sensor_idstring, "POWER"); + if (loc) { + if ((strncmp(g_sensor_data[idx].sensor_idstring + 11, "OUT", 3)) == 0) { + g_sensor_data[idx].capability |= SENSOR_GET_CAP_MODEL; + g_sensor_data[idx].capability |= SENSOR_GET_CAP_SN; + g_sensor_data[idx].capability |= SENSOR_GET_CAP_MFRID; + g_sensor_data[idx].capability |= SENSOR_GET_CAP_PSU_PRESENT; + g_sensor_data[idx].capability |= SENSOR_GET_CAP_VIN_TYPE; + g_sensor_data[idx].capability |= SENSOR_GET_CAP_POUT_MAX; + } + sprintf(g_sensor_data[idx].attrinfo.attr_type_str, "power"); + } + + loc = strstr(g_sensor_data[idx].sensor_idstring, "VOLTAGE"); + if (loc) sprintf(g_sensor_data[idx].attrinfo.attr_type_str, "in"); + + loc = strstr(g_sensor_data[idx].sensor_idstring, "CURRENT"); + if (loc) sprintf(g_sensor_data[idx].attrinfo.attr_type_str, "curr"); + + break; + case SDR_SENSOR_TYPE_CURR: + sprintf(g_sensor_data[idx].attrinfo.attr_type_str, "curr"); + break; + case SDR_SENSOR_TYPE_OTHER: + sprintf(g_sensor_data[idx].attrinfo.attr_type_str, "other"); + break; + default: + printk("not support sensor type !! [%d]\n", g_sensor_data[idx].sensor_type); + break; + } + + if ((strncmp(g_sensor_data[idx].sensor_idstring, "Fan", 3)) == 0) { + g_sensor_data[idx].capability |= SENSOR_GET_CAP_FAN_PRESENT; + } + +#if enable_debug_msg + { + printk("\n********************\n"); + + printk("m[%d], b[%d], k1[%d], k2[%d]\n", g_sensor_data[idx].recordinfo.record_m, g_sensor_data[idx].recordinfo.record_b + , g_sensor_data[idx].recordinfo.record_k1, g_sensor_data[idx].recordinfo.record_k2); + + printk("sensor [%s] type[%d], analog[%d], linearization[%d]\n", g_sensor_data[idx].sensor_idstring, g_sensor_data[idx].sensor_type + , g_sensor_data[idx].recordinfo.record_analog, g_sensor_data[idx].recordinfo.record_linearization); + + printk("\n********************\n"); + } +#endif + +} + +int32_t sdr_convert_sensor_reading(uint8_t idx, uint8_t val, int32_t *point_result) +{ + int32_t m = g_sensor_data[idx].recordinfo.record_m; + int32_t b = g_sensor_data[idx].recordinfo.record_b; + int32_t k1 = g_sensor_data[idx].recordinfo.record_k1; + int32_t k2 = g_sensor_data[idx].recordinfo.record_k2; + int32_t decimal_point = 0; + int32_t result = 0; + + decimal_point = pow_convert(&b, k1); + + switch (g_sensor_data[idx].recordinfo.record_analog) + { + case 0: + result = m * val * decimal_point + b; + break; + case 1: + if (val & 0x80) val++; + case 2: + result = (m * (int16_t)val) * decimal_point + b; + break; + default: + return result; + } + + pow_convert(&result, k2); + if (k1 < 0) *point_result += -k1; + if (k2 < 0) *point_result += -k2; + + if (g_sensor_data[idx].sensor_type != SDR_SENSOR_TYPE_FAN) { + result = result * 1000; //shift for lm-sensors + } + + return result; +} + +int32_t ipmi_sdr_parsing_value(int32_t idx, uint8_t input_value, int8_t *ret_str) +{ + int32_t calc_result = 0, point_result = 0; + int32_t temp_len = 0; + + uint8_t temp_str[16] = ""; + + calc_result = sdr_convert_sensor_reading(idx, input_value, &point_result); + + temp_len = sprintf(temp_str, "%d", calc_result); + temp_len = temp_len - point_result; + + /* int part */ + if (temp_len <= 0) sprintf(ret_str, "0"); + else snprintf(ret_str, temp_len + 1, "%s", temp_str); // +1 for snprintf reserve space'\0' + + /* point part */ + strcat(ret_str, "."); + + /* float part */ + if ((point_result == 0) || (temp_len < 0)) strcat(ret_str, "0"); + else strcat(ret_str, temp_str + temp_len); + + /* EOL part */ + strcat(ret_str, "\n\0"); + + return (temp_len + 1 + point_result + 2); //integer + point + float + EOL + \0 +} + + +uint8_t ipmi_check_psu_present(uint8_t psu_slot) +{ + uint8_t slot_mask = 0x0; + int32_t rv = 0; + + uint8_t returnData[128] = { 0 }; + uint8_t msg_data[] = { 0x36, 0xB9, 0x4C, 0x1C, 0x00, 0x03 }; //netfn = 0x36; cmd = 0xB9; + + mutex_lock(&ipmi_lock); + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), returnData, 1); + mutex_unlock(&ipmi_lock); + + if (rv) { + printk("BMC down at (%d)!!\n", __LINE__); + return 0; + } + else { + slot_mask = (psu_slot == 1) ? 0x01 : 0x02; + return (returnData[0] & slot_mask) ? 0 : 1; + } +} + +int32_t ipmi_get_psu_info(uint8_t idx, uint8_t cmd, uint8_t *retbuf) +{ + uint8_t psu_slot = 0; + int32_t rv = 0; + + uint8_t returnData[128] = { 0 }, tempData[128] = { 0 }; + uint8_t msg_data[] = { 0x06, 0x52, 0x0f, 0x00, 0x80, cmd }; //netfn = 0x06; cmd = 0x52; + + if (strstr(g_sensor_data[idx].sensor_idstring, "PSU1")) psu_slot = 1; + else psu_slot = 2; + + msg_data[3] = (psu_slot == 1) ? 0xb0 : 0xb2; + if (ipmi_check_psu_present(psu_slot)) { + mutex_lock(&ipmi_lock); + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), returnData, 1); + mutex_unlock(&ipmi_lock); + + if (rv) { + printk("BMC down at (%d)!!\n", __LINE__); + } + else { + if (returnData[0] < (sizeof(returnData) - 2)) { + snprintf(tempData, returnData[0] + 1, "%s", returnData + 1); + return sprintf(retbuf, "%s\n", tempData); + } + } + } + else { + //printk("Error ! cannot detect PSU%d\n", psu_slot); + } + + return sprintf(retbuf, "N/A\n"); +} + +int32_t ipmi_get_vin_type(uint8_t idx, uint8_t *retbuf) +{ + uint8_t psu_slot = 0; + int32_t rv = 0; + + uint8_t returnData = 0; + uint8_t msg_data[] = { 0x06, 0x52, 0x0f, 0x00, 0x01, 0xd8 }; // read line status + + if (strstr(g_sensor_data[idx].sensor_idstring, "PSU1")) psu_slot = 1; + else psu_slot = 2; + + msg_data[3] = (psu_slot == 1) ? 0xb0 : 0xb2; + if (ipmi_check_psu_present(psu_slot)) { + mutex_lock(&ipmi_lock); + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), &returnData, 1); + mutex_unlock(&ipmi_lock); + + if (rv) { + printk("BMC down at (%d)!!\n", __LINE__); + } + else { + switch (returnData) + { + case 0x7: //LVDC + case 0x3: //HVDC + return sprintf(retbuf, "DC\n"); + default: + return sprintf(retbuf, "AC\n"); + } + } + } + else { + //printk("Error ! cannot detect PSU%d\n", psu_slot); + } + + return sprintf(retbuf, "N/A\n"); +} + +int32_t ipmi_get_pout_max(uint8_t idx, uint8_t *retbuf) +{ + uint8_t psu_slot = 0; + int32_t rv = 0, pout_max = 0; + + uint8_t returnData[2] = { 0 }, tempData[2] = { 0 }; + uint8_t msg_data[] = { 0x06, 0x52, 0x0f, 0x00, 0x02, 0xa7 }; + + if (strstr(g_sensor_data[idx].sensor_idstring, "PSU1")) psu_slot = 1; + else psu_slot = 2; + + msg_data[3] = (psu_slot == 1) ? 0xb0 : 0xb2; + if (ipmi_check_psu_present(psu_slot)) { + mutex_lock(&ipmi_lock); + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), returnData, 1); + mutex_unlock(&ipmi_lock); + + if (rv) { + printk("BMC down at (%d)!!\n", __LINE__); + } + else { + /* MFR_POUT_MAX has 2 data format: Direct and Linear Data (see PMbus spec). + Query command is needed to tell the data format, but since we have not use PSU + whose output power is over 0x07ff (2047), just check the first 5 bits*/ + if (returnData[1] & 0xf8 == 0) // Direct + pout_max = (returnData[1] << 8) | returnData[0]; + else // Linear Data + pout_max = (((returnData[1] & 0x07) << 8) | returnData[0]) << ((returnData[1] & 0xf8) >> 3); + return sprintf(retbuf, "%d\n", pout_max); + } + } + else { + //printk("Error ! cannot detect PSU%d\n", psu_slot); + } + + return sprintf(retbuf, "N/A\n"); +} + +void ipmi_fan_control(uint8_t cmd_data1, uint8_t cmd_data2, uint8_t *retbuf) +{ + int32_t rv = 0; + + uint8_t returnData[10] = { 0 }; + uint8_t msg_data[] = { IPMI_NETFN_TSOL, GET_FAN_INFO, cmd_data1, cmd_data2 }; //netfn = IPMI_NETFN_TSOL; cmd = GET_FAN_INFO; + + mutex_lock(&ipmi_lock); + if (cmd_data1) rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), NULL, 0); + else rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), returnData, 1); + mutex_unlock(&ipmi_lock); + + if (rv) { + printk("BMC down at (%d)!!\n", __LINE__); + sprintf(retbuf, "N/A\n"); + } + else { + sprintf(retbuf, "%s", returnData); + } +} + +static ssize_t show_label(struct device *dev, struct device_attribute *devattr, char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return sprintf(buf, "%s\n", g_sensor_data[attr->index + DEBUGUSE_SHIFT].sensor_idstring); +} + +static ssize_t show_crit_alarm(struct device *dev, struct device_attribute *devattr, char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return sprintf(buf, "%d\n", attr->index); +} + +static ssize_t show_input(struct device *dev, struct device_attribute *devattr, char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + int32_t rv = 0; + + uint8_t returnData[4] = ""; + uint8_t msg_data[] = { IPMI_NETFN_SE, GET_SENSOR_READING, 0x00 }; //netfn = IPMI_NETFN_SE; cmd = GET_SENSOR_READING; + + mutex_lock(&ipmi_lock); + msg_data[2] = g_sensor_data[attr->index + DEBUGUSE_SHIFT].addr; + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), returnData, 1); + mutex_unlock(&ipmi_lock); + + if (rv) { + printk("BMC down at (%d)!!\n", __LINE__); + return sprintf(buf, "0.0\n"); + } + else { + return ipmi_sdr_parsing_value(attr->index + DEBUGUSE_SHIFT, returnData[0], buf); + } +} + +static ssize_t show_lnr(struct device *dev, struct device_attribute *devattr, char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return ipmi_sdr_parsing_value(attr->index + DEBUGUSE_SHIFT, g_sensor_data[attr->index + DEBUGUSE_SHIFT].lowerinfo.lnr, buf); +} + +static ssize_t show_lcr(struct device *dev, struct device_attribute *devattr, char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return ipmi_sdr_parsing_value(attr->index + DEBUGUSE_SHIFT, g_sensor_data[attr->index + DEBUGUSE_SHIFT].lowerinfo.lcr, buf); +} + +static ssize_t show_lnc(struct device *dev, struct device_attribute *devattr, char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return ipmi_sdr_parsing_value(attr->index + DEBUGUSE_SHIFT, g_sensor_data[attr->index + DEBUGUSE_SHIFT].lowerinfo.lnc, buf); +} + +static ssize_t show_unr(struct device *dev, struct device_attribute *devattr, char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return ipmi_sdr_parsing_value(attr->index + DEBUGUSE_SHIFT, g_sensor_data[attr->index + DEBUGUSE_SHIFT].upperinfo.unr, buf); +} + +static ssize_t show_ucr(struct device *dev, struct device_attribute *devattr, char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return ipmi_sdr_parsing_value(attr->index + DEBUGUSE_SHIFT, g_sensor_data[attr->index + DEBUGUSE_SHIFT].upperinfo.ucr, buf); +} + +static ssize_t show_unc(struct device *dev, struct device_attribute *devattr, char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return ipmi_sdr_parsing_value(attr->index + DEBUGUSE_SHIFT, g_sensor_data[attr->index + DEBUGUSE_SHIFT].upperinfo.unc, buf); +} + +static ssize_t show_model(struct device *dev, struct device_attribute *devattr, char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return ipmi_get_psu_info(attr->index + DEBUGUSE_SHIFT, 0x9a, buf); +} + +static ssize_t show_sn(struct device *dev, struct device_attribute *devattr, char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return ipmi_get_psu_info(attr->index + DEBUGUSE_SHIFT, 0x9e, buf); +} + +static ssize_t show_mfrid(struct device *dev, struct device_attribute *devattr, char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return ipmi_get_psu_info(attr->index + DEBUGUSE_SHIFT, 0x99, buf); +} + +static ssize_t show_vin_type(struct device *dev, struct device_attribute *devattr, char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return ipmi_get_vin_type(attr->index + DEBUGUSE_SHIFT, buf); +} + +static ssize_t show_pout_max(struct device *dev, struct device_attribute *devattr, char *buf) +{ + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + return ipmi_get_pout_max(attr->index + DEBUGUSE_SHIFT, buf); +} + +static ssize_t show_pwm(struct device *dev, struct device_attribute *devattr, char *buf) +{ + uint8_t returnData[10] = { 0 }; + ipmi_fan_control(0x00, 0x00, returnData); + return sprintf(buf, "%d\n", returnData[0]); +} + +static ssize_t store_pwm(struct device *dev, struct device_attribute *devattr, const char *buf, size_t count) +{ + uint8_t store_input = 0; + uint8_t returnData[10] = { 0 }; + simple_atoi(buf, &store_input); + if (g_fan_control_mode == 1) ipmi_fan_control(0x01, store_input, returnData); + + return count; +} + +static ssize_t show_controlmode(struct device *dev, struct device_attribute *devattr, char *buf) +{ + return sprintf(buf, "%d\n", g_fan_control_mode); +} + +static ssize_t store_controlmode(struct device *dev, struct device_attribute *devattr, const char *buf, size_t count) +{ + uint8_t store_input = 0; + uint8_t returnData[10] = { 0 }; + simple_atoi(buf, &store_input); + g_fan_control_mode = store_input; + if (g_fan_control_mode == 3) ipmi_fan_control(0x7f, 0xff, returnData); + + return count; +} + +static ssize_t show_direction(struct device *dev, struct device_attribute *devattr, char *buf) +{ + int32_t rv = 0; + + uint8_t returnData[10] = { 0 }; + uint8_t msg_data[] = { IPMI_NETFN_STORAGE, GET_FRU_INFO, 0x00, 0x19, 0x00, 0x01 }; //netfn = IPMI_NETFN_STORAGE; cmd = GET_FRU_INFO; + + mutex_lock(&ipmi_lock); + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), returnData, 1); + mutex_unlock(&ipmi_lock); + + if (rv) { + printk("BMC down at (%d)!!\n", __LINE__); + return sprintf(buf, "N/A\n"); + } + else { + return sprintf(buf, "%c\n", returnData[1]); + } +} + +static ssize_t show_fanpresent(struct device *dev, struct device_attribute *devattr, char *buf) +{ + int32_t rv = 0; + int32_t fan_idx = 0, fan_present = 0; + + uint8_t returnData[10] = { 0 }; + uint8_t msg_data[] = { 0x36, 0xB9, 0x4C, 0x1C, 0x00, 0x02 }; //netfn = 0x36; cmd = 0xB9; + + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + + fan_idx = (g_sensor_data[attr->index].sensor_idstring[8] - '0') - 1; + + mutex_lock(&ipmi_lock); + rv = ipmi_send_system_cmd(msg_data, sizeof(msg_data), returnData, 1); + mutex_unlock(&ipmi_lock); + + fan_present = ((returnData[0] >> fan_idx) & 0x1) ? 0 : 1; + + return sprintf(buf, "%d\n", fan_present); +} + +static ssize_t show_psupresent(struct device *dev, struct device_attribute *devattr, char *buf) +{ + int32_t psu_idx = 0; + + struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr); + + psu_idx = g_sensor_data[attr->index].sensor_idstring[3] - '0'; + + return sprintf(buf, "%d\n", ipmi_check_psu_present(psu_idx)); +} + +static ssize_t(*const attr_show_func_ptr[SENSOR_ATTR_MAX]) (struct device *dev, struct device_attribute *devattr, char *buf) = +{ + show_label, show_crit_alarm, show_input + , show_lnc, show_lcr, show_lnr + , show_unc, show_ucr, show_unr + , show_model, show_sn, show_pwm + , show_controlmode, show_direction, show_fanpresent + , show_psupresent, show_mfrid, show_vin_type + , show_pout_max +}; + +static ssize_t(*const attr_store_func_ptr[SENSOR_ATTR_MAX]) (struct device *dev, struct device_attribute *devattr, const char *buf, size_t count) = +{ + NULL, NULL, NULL + , NULL, NULL, NULL + , NULL, NULL, NULL + , NULL, NULL, store_pwm + , store_controlmode, NULL, NULL + , NULL, NULL, NULL + , NULL +}; + +static const char *const sensor_attrnames[SENSOR_ATTR_MAX] = +{ + "%s%d_label", "%s%d_crit_alarm", "%s%d_input" + , "%s%d_lncrit", "%s%d_lcrit", "%s%d_min" + , "%s%d_ncrit", "%s%d_crit", "%s%d_max" + , "%s%d_model", "%s%d_sn", "%s%d_pwm" + , "%s%d_controlmode", "%s%d_direction", "%s%d_present" + , "%s%d_present", "%s%d_mfrid", "%s%d_vin_type" + , "%s%d_pout_max" +}; + +static int32_t create_sensor_attrs(int32_t attr_no) +{ + int32_t i = 0, j = 0; + + struct attr_info *attrdata = &g_sensor_data[attr_no].attrinfo; + +#if enable_debug_msg + printk("##### %s:%d attr_no %d\n", __FUNCTION__, __LINE__, attr_no); +#endif + + for (i = 0; i < SENSOR_ATTR_MAX; i++) { + if ((g_sensor_data[attr_no].capability >> i) & 0x01) { + snprintf(attrdata->attr_name[j], SENSOR_ATTR_NAME_LENGTH, sensor_attrnames[i], attrdata->attr_type_str, attr_no - DEBUGUSE_SHIFT); + + sysfs_attr_init(&attrdata->sd_attrs[j].dev_attr.attr); + attrdata->sd_attrs[j].dev_attr.attr.name = attrdata->attr_name[j]; + attrdata->sd_attrs[j].dev_attr.show = attr_show_func_ptr[i]; + attrdata->sd_attrs[j].dev_attr.store = attr_store_func_ptr[i]; + + attrdata->sd_attrs[j].dev_attr.attr.mode = S_IRUGO; + if (attrdata->sd_attrs[j].dev_attr.store) attrdata->sd_attrs[j].dev_attr.attr.mode |= S_IWUSR; + + attrdata->sd_attrs[j].index = attr_no - DEBUGUSE_SHIFT; + attrdata->attrs[j] = &attrdata->sd_attrs[j].dev_attr.attr; + j++; + + data->total_create_sysfs++; + } + } + + attrdata->attrs[j] = NULL; + attrdata->attr_group.attrs = attrdata->attrs; + + g_sensor_data[attr_no].attrinfo.attr_exist = 1; + + return sysfs_create_group(&data->ipmi_hwmon_dev->kobj, &attrdata->attr_group); +} + +static int32_t remove_sensor_attrs(void) +{ + int32_t i = 0; + + for (i = 0; i < data->total_sensor_id; i++) { + if (g_sensor_data[i].attrinfo.attr_exist) { + sysfs_remove_group(&data->ipmi_hwmon_dev->kobj, &g_sensor_data[i].attrinfo.attr_group); + } + } + return 0; +} + +int32_t ipmi_init_sdr_sensors_data(void) +{ + int32_t sdr_idx = 0; + int32_t err = 0; + + struct ipmi_sdr_iterator *itr = NULL; + struct sdr_get_rs *header = NULL; + + uint8_t *rec = NULL; + + mutex_lock(&ipmi_lock); + + itr = kzalloc(sizeof(struct ipmi_sdr_iterator), GFP_KERNEL); + if (itr == NULL) { + printk("%s(%d): kzalloc failure.\n", __func__, __LINE__); + goto itr_malloc_fail; + } + + header = kzalloc(sizeof(struct sdr_get_rs), GFP_KERNEL); + if (header == NULL) { + printk("%s(%d): malloc failure.\n", __func__, __LINE__); + goto header_malloc_fail; + } + + err = ipmi_sdr_start(itr); + if (err) { + printk("%s(%d): ipmi_sdr_start fail.\n", __func__, __LINE__); + goto ipmi_sdr_start_fail; + } + + data->total_sensor_id = itr->total; + rec = kzalloc(GET_SDR_ENTIRE_RECORD, GFP_KERNEL); + if (rec == NULL) { + printk("%s(%d): kzalloc failure\n", __func__, __LINE__); + goto rec_malloc_fail; + } + + g_sensor_data = kzalloc(itr->total * sizeof(struct ipmi_sensor_data), GFP_KERNEL); + if (g_sensor_data == NULL) { + printk("%s(%d): malloc failure", __func__, __LINE__); + goto g_sensor_data_malloc_fail; + } + + memset(g_sensor_data, 0x0, itr->total * sizeof(struct ipmi_sensor_data)); + + for (sdr_idx = 0; sdr_idx < itr->total; sdr_idx++) { + err = ipmi_sdr_get_header(itr, header); + if (err) { + if (err == 0xC5) { + /* C5h : Reservation Invalid */ +#if enable_debug_msg + printk("ipmi: reservation number given was invalid or the reservation was lost\n"); + printk("ipmi: retry\n"); +#endif + ipmi_sdr_get_reservation(&(itr->reservation)); + sdr_idx--; + continue; + } + printk("ipmi: Get SDR header fail,so break this request\n"); + goto ipmi_sdr_get_header_fail; + } + + + memset(rec, 0, GET_SDR_ENTIRE_RECORD); + err = ipmi_sdr_get_record(header, itr, rec); + if (err) { + if (err == 0xC5) { + /* C5h : Reservation Invalid */ +#if enable_debug_msg + printk("ipmi: reservation number given was invalid or the reservation was lost\n"); + printk("ipmi: retry\n"); +#endif + ipmi_sdr_get_reservation(&(itr->reservation)); + sdr_idx--; + continue; + } + printk("ipmi: Get SDR header fail,so break this request\n"); + goto ipmi_sdr_get_record_fail; + } + + itr->next = header->next; + + switch (header->type) + { + case SDR_RECORD_TYPE_FULL_SENSOR: + /* prepare (threshold, factor)data whilie init, for reduce reading step and improve operate speed */ + g_sensor_data[sdr_idx].addr = rec[2]; + g_sensor_data[sdr_idx].capability = SENSOR_GET_CAP_LABEL /*| SENSOR_GET_CAP_ALARM */ | SENSOR_GET_CAP_INPUT; + g_sensor_data[sdr_idx].headerinfo.header_type = header->type; + g_sensor_data[sdr_idx].headerinfo.header_byte = header->length; + + ipmi_sdr_set_sensor_threshold(sdr_idx, (struct sdr_record_full_sensor*) rec); + ipmi_sdr_set_sensor_factor(sdr_idx, (struct sdr_record_full_sensor*) rec); + + if (sdr_idx >= DEBUGUSE_SHIFT) { + err = create_sensor_attrs(sdr_idx); + if (err) { + g_sensor_data[sdr_idx].attrinfo.attr_exist = 0; + printk("[err : %d]sysfs_create_group fail in [%d] %s\n", err, sdr_idx, g_sensor_data[sdr_idx].sensor_idstring); + goto create_sysfs_fail; + } + } + + data->total_suport_sensor++; + + break; + case SDR_RECORD_TYPE_COMPACT_SENSOR: /* not supporrt now */ + case SDR_RECORD_TYPE_EVENTONLY_SENSOR: /* not supporrt now */ + case SDR_RECORD_TYPE_MC_DEVICE_LOCATOR: /* not supporrt now */ + default: + g_sensor_data[sdr_idx].attrinfo.attr_exist = 0; +#if enable_debug_msg + printk("ID[%d] : not support type [%d]\n", sdr_idx, header->type); +#endif + break; + } + } + + printk("quanta_hwmon_ipmi : detected [%d] sensor, create [%d] sysfs\n", data->total_suport_sensor, data->total_create_sysfs); + +create_sysfs_fail: +ipmi_sdr_get_header_fail: +ipmi_sdr_get_record_fail: +g_sensor_data_malloc_fail: + if (header) { + kfree(header); + header = NULL; + } + if (rec) { + kfree(rec); + rec = NULL; + } + +rec_malloc_fail: +ipmi_sdr_start_fail: +header_malloc_fail: + if (itr) { + kfree(itr); + itr = NULL; + } + +itr_malloc_fail: + mutex_unlock(&ipmi_lock); + + return err; +} + +static int32_t __init quanta_hwmon_ipmi_init(void) +{ + int32_t err = 0; + + init_completion(&g_read_complete); + + data = kzalloc(sizeof(struct quanta_hwmon_ipmi_data), GFP_KERNEL); + if (NULL == data) { + printk("alloc data fail\n"); + goto alloc_err; + } + + data->ipmi_platform_dev = platform_device_register_simple(DRVNAME, -1, NULL, 0); + err = IS_ERR(data->ipmi_platform_dev); + if (err) { + printk("platform device register fail (err : %d)\n", err); + goto device_reg_err; + } + + data->ipmi_hwmon_dev = hwmon_device_register_with_groups(NULL, DRVNAME, NULL, NULL); + err = IS_ERR(data->ipmi_hwmon_dev); + if (err) { + printk("hwmon register fail\n"); + goto hwmon_register_err; + } + + err = ipmi_create_user(0, &ipmi_hndlrs, NULL, &ipmi_mh_user); + if (err) { + printk("warning: create user fail, watchdog broken (err : %d)\n", err); + goto ipmi_create_err; + } + + mutex_init(&ipmi_lock); + err = ipmi_init_sdr_sensors_data(); + if (err) { + printk("init sensor data fail (err : %d)\n", err); + goto init_sensor_err; + } + + return 0; + +init_sensor_err: + kfree(g_sensor_data); +ipmi_create_err: + hwmon_device_unregister(data->ipmi_hwmon_dev); +hwmon_register_err: + platform_device_unregister(data->ipmi_platform_dev); +device_reg_err: + kfree(data); +alloc_err: + return err; +} + +static void __exit quanta_hwmon_ipmi_exit(void) +{ + remove_sensor_attrs(); + hwmon_device_unregister(data->ipmi_hwmon_dev); + platform_device_unregister(data->ipmi_platform_dev); + + mutex_lock(&ipmi_lock); + ipmi_destroy_user(ipmi_mh_user); + mutex_unlock(&ipmi_lock); + + kfree(g_sensor_data); + kfree(data); + return; +} + +module_init(quanta_hwmon_ipmi_init); +module_exit(quanta_hwmon_ipmi_exit); + +MODULE_AUTHOR("Charcar~~Charcar~Charlie li li"); +MODULE_VERSION("2.0"); +MODULE_DESCRIPTION("Quanta BMC hardware monitor driver"); +MODULE_LICENSE("GPL"); diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix9-32x/setup.py b/platform/broadcom/sonic-platform-modules-quanta/ix9-32x/setup.py index b2f1b39fcd73..ad2b11a671c9 100644 --- a/platform/broadcom/sonic-platform-modules-quanta/ix9-32x/setup.py +++ b/platform/broadcom/sonic-platform-modules-quanta/ix9-32x/setup.py @@ -1,7 +1,6 @@ #!/usr/bin/env python import os -import sys from setuptools import setup os.listdir diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix9-32x/sonic_platform/__init__.py b/platform/broadcom/sonic-platform-modules-quanta/ix9-32x/sonic_platform/__init__.py new file mode 100644 index 000000000000..4bfefa0fb636 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix9-32x/sonic_platform/__init__.py @@ -0,0 +1,3 @@ +__all__ = ["platform", "chassis"] +from sonic_platform import * + diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix9-32x/sonic_platform/chassis.py b/platform/broadcom/sonic-platform-modules-quanta/ix9-32x/sonic_platform/chassis.py new file mode 100644 index 000000000000..33f67b0b9d90 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix9-32x/sonic_platform/chassis.py @@ -0,0 +1,217 @@ +#!/usr/bin/env python +# +# Name: chassis.py, version: 1.0 +# +# Description: Module contains the definitions of SONiC platform APIs +# + +try: + import sys + import time + from sonic_platform_base.chassis_base import ChassisBase + from sonic_platform.eeprom import Eeprom + from sonic_platform.psu import Psu + from sonic_platform.sfp import Sfp + from sonic_platform.fan import Fan + from sonic_platform.fan_drawer import FanDrawer + from sonic_platform.thermal import Thermal + +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +class Chassis(ChassisBase): + + def __init__(self): + ChassisBase.__init__(self) + self.__num_of_psus = 2 + self.__num_of_ports = 32 + self.__num_of_fan_drawers = 6 + self.__fan_per_drawer = 2 + self.__num_of_thermals = 19 + self.__xcvr_presence = {} + + # Initialize EEPROM + self._eeprom = Eeprom() + + # Initialize watchdog + #self._watchdog = Watchdog() + + # Initialize FAN + fan_index = 1 + for drawer_index in range(1, self.__num_of_fan_drawers + 1): + drawer_fan_list = [] + for index in range(0, self.__fan_per_drawer): + fan = Fan(fan_index, False) + fan_index += 1 + self._fan_list.append(fan) + drawer_fan_list.append(fan) + fan_drawer = FanDrawer(drawer_index, drawer_fan_list) + self._fan_drawer_list.append(fan_drawer) + + # Initialize thermal + for index in range(1, self.__num_of_thermals + 1): + thermal = Thermal(index) + self._thermal_list.append(thermal) + + # Initialize PSU and PSU_FAN + for index in range(1, self.__num_of_psus + 1): + psu = Psu(index) + self._psu_list.append(psu) + + # Initialize SFP + for index in range(1, self.__num_of_ports + 1): + sfp = Sfp(index, 'QSFP') + self._sfp_list.append(sfp) + self.__xcvr_presence[index] = self._sfp_list[index-1].get_presence() + + +############################################## +# Device methods +############################################## + + def get_sfp(self, index): + """ + Retrieves sfp represented by (1-based) index + For Quanta IX8C the index in sfputil.py starts from 1, so override + + Args: + index: An integer, the index (1-based) of the sfp to retrieve. + The index should be the sequence of a physical port in a chassis, + starting from 1. + + Returns: + An object dervied from SfpBase representing the specified sfp + """ + sfp = None + + try: + if (index == 0): + raise IndexError + sfp = self._sfp_list[index-1] + except IndexError: + sys.stderr.write("override: SFP index {} out of range (1-{})\n".format( + index, len(self._sfp_list))) + + return sfp + + def get_name(self): + """ + Retrieves the name of the chassis + Returns: + string: The name of the chassis + """ + return self._eeprom.modelstr() + + def get_presence(self): + """ + Retrieves the presence of the chassis + Returns: + bool: True if chassis is present, False if not + """ + return True + + def get_model(self): + """ + Retrieves the model number (or part number) of the chassis + Returns: + string: Model/part number of chassis + """ + return self._eeprom.part_number_str() + + def get_serial(self): + """ + Retrieves the serial number of the chassis + Returns: + string: Serial number of chassis + """ + return self._eeprom.serial_number_str() + + def get_status(self): + """ + Retrieves the operational status of the chassis + Returns: + bool: A boolean value, True if chassis is operating properly + False if not + """ + return True + +############################################## +# Chassis methods +############################################## + + def get_base_mac(self): + """ + Retrieves the base MAC address for the chassis + + Returns: + A string containing the MAC address in the format + 'XX:XX:XX:XX:XX:XX' + """ + return self._eeprom.base_mac_addr() + + def get_serial_number(self): + """ + Retrieves the hardware serial number for the chassis + + Returns: + A string containing the hardware serial number for this chassis. + """ + return self._eeprom.serial_number_str() + + def get_system_eeprom_info(self): + """ + Retrieves the full content of system EEPROM information for the chassis + + Returns: + A dictionary where keys are the type code defined in + OCP ONIE TlvInfo EEPROM format and values are their corresponding + values. + Ex. { '0x21':'AG9064', '0x22':'V1.0', '0x23':'AG9064-0109867821', + '0x24':'001c0f000fcd0a', '0x25':'02/03/2018 16:22:00', + '0x26':'01', '0x27':'REV01', '0x28':'AG9064-C2358-16G'} + """ + return self._eeprom.system_eeprom_info() + + def get_reboot_cause(self): + """ + Retrieves the cause of the previous reboot + Returns: + A tuple (string, string) where the first element is a string + containing the cause of the previous reboot. This string must be + one of the predefined strings in this class. If the first string + is "REBOOT_CAUSE_HARDWARE_OTHER", the second string can be used + to pass a description of the reboot cause. + """ + #raise NotImplementedError + return (ChassisBase.REBOOT_CAUSE_HARDWARE_OTHER, "Invalid Reason") + + def get_change_event(self, timeout=0): + """ + Currently only support transceiver change events + """ + + start_ms = time.time() * 1000 + xcvr_change_event_dict = {} + event = False + + while True: + time.sleep(0.5) + for index in range(1, self.__num_of_ports + 1): + cur_xcvr_presence = self._sfp_list[index-1].get_presence() + if cur_xcvr_presence != self.__xcvr_presence[index]: + if cur_xcvr_presence is True: + xcvr_change_event_dict[str(index)] = '1' + self.__xcvr_presence[index] = True + elif cur_xcvr_presence is False: + xcvr_change_event_dict[str(index)] = '0' + self.__xcvr_presence[index] = False + event = True + + if event is True: + return True, {'sfp':xcvr_change_event_dict} + + if timeout: + now_ms = time.time() * 1000 + if (now_ms - start_ms >= timeout): + return True, {'sfp':xcvr_change_event_dict} + diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix9-32x/sonic_platform/eeprom.py b/platform/broadcom/sonic-platform-modules-quanta/ix9-32x/sonic_platform/eeprom.py new file mode 100644 index 000000000000..1c044638ed26 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix9-32x/sonic_platform/eeprom.py @@ -0,0 +1,212 @@ +#!/usr/bin/env python +# +# Name: eeprom.py, version: 1.0 +# +# Description: Module contains the definitions of SONiC platform APIs +# + +try: + from sonic_eeprom import eeprom_tlvinfo +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +class Eeprom(eeprom_tlvinfo.TlvInfoDecoder): + # Display vendor extension for Quanta platforms + _TLV_DISPLAY_VENDOR_EXT = True + + def __init__(self): + self.__eeprom_path = "/sys/bus/i2c/devices/3-0054/eeprom" + super(Eeprom, self).__init__(self.__eeprom_path, 0, '', True) + self.__eeprom_tlv_dict = dict() + try: + self.__eeprom_data = self.read_eeprom() + except: + self.__eeprom_data = "N/A" + raise RuntimeError("Eeprom is not Programmed") + else: + eeprom = self.__eeprom_data + + if not self.is_valid_tlvinfo_header(eeprom): + return + + total_length = (eeprom[9] << 8) | eeprom[10] + tlv_index = self._TLV_INFO_HDR_LEN + tlv_end = self._TLV_INFO_HDR_LEN + total_length + + while (tlv_index + 2) < len(eeprom) and tlv_index < tlv_end: + if not self.is_valid_tlv(eeprom[tlv_index:]): + break + + tlv = eeprom[tlv_index:tlv_index + 2 + + eeprom[tlv_index + 1]] + code = "0x%02X" % tlv[0] + + if tlv[0] == self._TLV_CODE_VENDOR_EXT: + value = str((tlv[2] << 24) | (tlv[3] << 16) | + (tlv[4] << 8) | tlv[5]) + value += tlv[6:6 + tlv[1]].decode('ascii') + else: + value = self.decoder(None, tlv)[30:] + + self.__eeprom_tlv_dict[code] = value + if eeprom[tlv_index] == self._TLV_CODE_CRC_32: + break + + tlv_index += eeprom[tlv_index+1] + 2 + + def serial_number_str(self): + (is_valid, results) = self.get_tlv_field( + self.__eeprom_data, self._TLV_CODE_SERIAL_NUMBER) + if not is_valid: + return "N/A" + + return results[2].decode('ascii') + + def base_mac_addr(self): + (is_valid, results) = self.get_tlv_field( + self.__eeprom_data, self._TLV_CODE_MAC_BASE) + if not is_valid or results[1] != 6: + return super(TlvInfoDecoder, self).switchaddrstr(e) + + return ":".join(["{:02x}".format(T) for T in results[2]]).upper() + + def modelstr(self): + (is_valid, results) = self.get_tlv_field( + self.__eeprom_data, self._TLV_CODE_PRODUCT_NAME) + if not is_valid: + return "N/A" + + return results[2].decode('ascii') + + def part_number_str(self): + (is_valid, results) = self.get_tlv_field( + self.__eeprom_data, self._TLV_CODE_PART_NUMBER) + if not is_valid: + return "N/A" + + return results[2].decode('ascii') + + def serial_tag_str(self): + (is_valid, results) = self.get_tlv_field( + self.__eeprom_data, self._TLV_CODE_SERVICE_TAG) + if not is_valid: + return "N/A" + + return results[2].decode('ascii') + + def revision_str(self): + (is_valid, results) = self.get_tlv_field( + self.__eeprom_data, self._TLV_CODE_DEVICE_VERSION) + if not is_valid: + return "N/A" + + return results[2].decode('ascii') + + def system_eeprom_info(self): + """ + Returns a dictionary, where keys are the type code defined in + ONIE EEPROM format and values are their corresponding values + found in the system EEPROM. + """ + return self.__eeprom_tlv_dict + + def decoder(self, s, t): + ''' + Return a string representing the contents of the TLV field. The format of + the string is: + 1. The name of the field left justified in 20 characters + 2. The type code in hex right justified in 5 characters + 3. The length in decimal right justified in 4 characters + 4. The value, left justified in however many characters it takes + The vailidity of EEPROM contents and the TLV field has been verified + prior to calling this function. The 's' parameter is unused + ''' + if t[0] == self._TLV_CODE_PRODUCT_NAME: + name = "Product Name" + value = t[2:2 + t[1]].decode("ascii") + elif t[0] == self._TLV_CODE_PART_NUMBER: + name = "Part Number" + value = t[2:2 + t[1]].decode("ascii") + elif t[0] == self._TLV_CODE_SERIAL_NUMBER: + name = "Serial Number" + value = t[2:2 + t[1]].decode("ascii") + elif t[0] == self._TLV_CODE_MAC_BASE: + name = "Base MAC Address" + value = ":".join(["{:02x}".format(T) for T in t[2:8]]).upper() + elif t[0] == self._TLV_CODE_MANUF_DATE: + name = "Manufacture Date" + value = t[2:2 + t[1]].decode("ascii") + elif t[0] == self._TLV_CODE_DEVICE_VERSION: + name = "Device Version" + value = str(t[2]) + elif t[0] == self._TLV_CODE_LABEL_REVISION: + name = "Label Revision" + value = t[2:2 + t[1]].decode("ascii") + elif t[0] == self._TLV_CODE_PLATFORM_NAME: + name = "Platform Name" + value = t[2:2 + t[1]].decode("ascii") + elif t[0] == self._TLV_CODE_ONIE_VERSION: + name = "ONIE Version" + value = t[2:2 + t[1]].decode("ascii") + elif t[0] == self._TLV_CODE_MAC_SIZE: + name = "MAC Addresses" + value = str((t[2] << 8) | t[3]) + elif t[0] == self._TLV_CODE_MANUF_NAME: + name = "Manufacturer" + value = t[2:2 + t[1]].decode("ascii") + elif t[0] == self._TLV_CODE_MANUF_COUNTRY: + name = "Manufacture Country" + value = t[2:2 + t[1]].decode("ascii") + elif t[0] == self._TLV_CODE_VENDOR_NAME: + name = "Vendor Name" + value = t[2:2 + t[1]].decode("ascii") + elif t[0] == self._TLV_CODE_DIAG_VERSION: + name = "Diag Version" + # Quanta legacy format of diag version + if t[1] == 4: + value = "{}.{}.{}.{}".format('{:02x}'.format(t[2])[0], '{:02x}'.format(t[2])[1], + '{:02x}'.format(t[3])[0], '{:02x}'.format(t[3])[1]) + else: + value = t[2:2 + t[1]].decode("ascii") + elif t[0] == self._TLV_CODE_SERVICE_TAG: + name = "Service Tag" + value = t[2:2 + t[1]].decode("ascii") + elif t[0] == self._TLV_CODE_VENDOR_EXT: + name = "Vendor Extension" + value = "" + if self._TLV_DISPLAY_VENDOR_EXT: + for c in t[2:2 + t[1]]: + value += "0x%02X " % c + elif t[0] == self._TLV_CODE_CRC_32 and len(t) == 6: + name = "CRC-32" + value = "0x%08X" % ((t[2] << 24) | (t[3] << 16) | (t[4] << 8) | t[5]) + # Quanta specific codes below here. + # These decodes are lifted from their U-Boot codes + elif t[0] == self._TLV_CODE_QUANTA_MAGIC and len(t) == 3: + name = "Magic Number" + value = "0x%02X" % t[2] + elif t[0] == self._TLV_CODE_QUANTA_CRC and len(t) == 4: + name = "QUANTA-CRC" + value = "0x%04X" % ((t[2] << 8) + t[3]) + elif t[0] == self._TLV_CODE_QUANTA_CARD_TYPE and len(t) == 6: + name = "Card Type" + value = "0x%08X" % ((t[2] << 24) | (t[3] << 16) | (t[4] << 8) | t[5]) + elif t[0] == self._TLV_CODE_QUANTA_HW_VERSION and len(t) == 6: + name = "Hardware Version" + value = "%d.%d" % (t[2], t[3]) + elif t[0] == self._TLV_CODE_QUANTA_SW_VERSION and len(t) == 6: + name = "Software Version" + value = "%d.%d.%d.%d" % ((t[2] >> 4), (t[2] & 0xF), (t[3] >> 4), (t[3] & 0xF)) + elif t[0] == self._TLV_CODE_QUANTA_MANUF_DATE and len(t) == 6: + name = "Manufacture Date" + value = "%04d/%d/%d" % (((t[2] << 8) | t[3]), t[4], t[5]) + elif t[0] == self._TLV_CODE_QUANTA_MODEL_NAME: + name = "Model Name" + value = t[2:2 + t[1]].decode("ascii") + else: + name = "Unknown" + value = "" + for c in t[2:2 + t[1]]: + value += "0x%02X " % c + return name, value + diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix9-32x/sonic_platform/fan.py b/platform/broadcom/sonic-platform-modules-quanta/ix9-32x/sonic_platform/fan.py new file mode 100644 index 000000000000..e668013df900 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix9-32x/sonic_platform/fan.py @@ -0,0 +1,226 @@ +#!/usr/bin/env python + +############################################################################# +# Quanta IX9 +# +# Module contains an implementation of SONiC Platform Base API and +# provides the FAN information +# +############################################################################# + +try: + import logging + import os + from sonic_platform_base.fan_base import FanBase +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +############### +# Global +############### +HWMON_DIR = "/sys/class/hwmon/hwmon2/" +FAN_INDEX_START = 18 +NUM_FANTRAYS = 6 +FANS_PERTRAY = 2 + +class Fan(FanBase): + """Platform-specific Fan class""" + + def __init__(self, index, is_psu_fan=False): + self.is_psu_fan = is_psu_fan + self.fan_index = index + self.psu_fan_index_mapping = { + 1:37, + 2:47, + } + self.psu_index_mapping = { + 1:39, + 2:49, + } + if self.is_psu_fan: + self.fan_presence_attr = "power{}_present".format(self.psu_index_mapping[index]) + self.fan_pwm_attr = "fan{}_pwm".format(self.psu_fan_index_mapping[index]) + self.fan_rpm_attr = "fan{}_input".format(self.psu_fan_index_mapping[index]) + self.fan_direction_attr = "fan{}_direction".format(self.psu_fan_index_mapping[index]) + else: + self.fan_presence_attr = "fan{}_present".format(FAN_INDEX_START+(index-1)) + self.fan_pwm_attr = "fan{}_pwm".format(FAN_INDEX_START+(index-1)) + self.fan_rpm_attr = "fan{}_input".format(FAN_INDEX_START+(index-1)) + self.fan_direction_attr = "fan{}_direction".format(FAN_INDEX_START+(index-1)) + + +####################### +# private function +####################### + + def __get_attr_value(self, attr_path): + + retval = 'ERR' + if (not os.path.isfile(attr_path)): + return retval + + try: + with open(attr_path, 'r') as fd: + retval = fd.read() + except Exception as error: + logging.error("Unable to open " + attr_path + " file !") + + retval = retval.rstrip(' \t\n\r') + return retval + + + #################### + # Device base + #################### + + def get_name(self): + """ + Retrieves the name of the device + + Returns: + string: The name of the device + """ + if self.is_psu_fan: + return "PSU-{}_FAN".format(self.fan_index) + else: + fantray_index = (self.fan_index-1)/FANS_PERTRAY+1 + fan_index_intray = self.fan_index - ((fantray_index-1)*FANS_PERTRAY) + return "Fantray{}_{}".format(fantray_index, fan_index_intray) + + def get_presence(self): + """ + Retrieves the presence of the device + + Returns: + bool: True if device is present, False if not + """ + attr_path = HWMON_DIR + self.fan_presence_attr + attr_rv = self.__get_attr_value(attr_path) + if (attr_rv != 'ERR'): + if (attr_rv == '1'): + return True + else: + return False + + return None + + def get_status(self): + """ + Retrieves the operational status of the device + + Returns: + A boolean value, True if device is operating properly, False if not + """ + if self.get_presence(): + attr_path = HWMON_DIR + self.fan_rpm_attr + attr_rv = self.__get_attr_value(attr_path) + + if (attr_rv != 'ERR' and attr_rv != '0.0'): + return True + else: + return False + else: + return False + + ################# + # fan base + ################# + + def get_direction(self): + """ + Retrieves the direction of fan + + Returns: + A string, either FAN_DIRECTION_INTAKE or FAN_DIRECTION_EXHAUST + depending on fan direction + """ + attr_path = HWMON_DIR + self.fan_direction_attr + attr_rv = self.__get_attr_value(attr_path) + + if attr_rv == '2': + return self.FAN_DIRECTION_INTAKE + else: + return self.FAN_DIRECTION_EXHAUST + + def get_speed(self): + """ + Retrieves the speed of fan as a percentage of full speed + + Returns: + An integer, the percentage of full fan speed, in the range 0 (off) + to 100 (full speed) + """ + if self.get_presence(): + attr_path = HWMON_DIR + self.fan_pwm_attr + attr_rv = self.__get_attr_value(attr_path) + + if (attr_rv != 'ERR'): + return int(float(attr_rv)) + else: + return False + else: + return 0 + + def get_speed_rpm(self): + """ + Retrieves the speed of fan in revolutions per minute (RPM) + + Returns: + An integer, speed of the fan in RPM + """ + attr_path = HWMON_DIR + self.fan_rpm_attr + attr_rv = self.__get_attr_value(attr_path) + + if (attr_rv != 'ERR'): + return int(float(attr_rv)) + else: + return False + + def get_target_speed(self): + """ + Retrieves the target (expected) speed of the fan + + Returns: + An integer, the percentage of full fan speed, in the range 0 (off) + to 100 (full speed) + """ + attr_path = HWMON_DIR + self.fan_pwm_attr + attr_rv = self.__get_attr_value(attr_path) + + if (attr_rv != 'ERR'): + return int(float(attr_rv)) + else: + return False + + def get_speed_tolerance(self): + """ + Retrieves the speed tolerance of the fan + + Returns: + An integer, the percentage of variance from target speed which is + considered tolerable + """ + return 25 + + def set_status_led(self, color): + """ + Sets the state of the fan module status LED + + Args: + color: A string representing the color with which to set the + fan module status LED + + Returns: + bool: True if status LED state is set successfully, False if not + """ + return True + + def get_status_led(self): + """ + Gets the state of the fan status LED + + Returns: + A string, one of the predefined STATUS_LED_COLOR_* strings above + """ + return None diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix9-32x/sonic_platform/fan_drawer.py b/platform/broadcom/sonic-platform-modules-quanta/ix9-32x/sonic_platform/fan_drawer.py new file mode 100644 index 000000000000..75e954576a28 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix9-32x/sonic_platform/fan_drawer.py @@ -0,0 +1,47 @@ +#!/usr/bin/env python + +############################################################################# +# Quanta +# +# Module contains an implementation of SONiC Platform Base API and +# provides the fan status which are available in the platform +# +############################################################################# + +try: + from sonic_platform_base.fan_drawer_base import FanDrawerBase +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class FanDrawer(FanDrawerBase): + + def __init__(self, index, fan_list): + FanDrawerBase.__init__(self) + + self._fan_list = fan_list + self._index = index + + def get_name(self): + """ + Retrieves the name of the device + Returns: + string: The name of the device + """ + return 'Fan {}'.format(self._index) + + def get_presence(self): + """ + Retrieves the presence of the FAN + Returns: + bool: True if FAN is present, False if not + """ + return self._fan_list[0].get_presence() + + def get_status(self): + """ + Retrieves the operational status of the device + Returns: + A boolean value, True if device is operating properly, False if not + """ + return self._fan_list[0].get_status() diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix9-32x/sonic_platform/platform.py b/platform/broadcom/sonic-platform-modules-quanta/ix9-32x/sonic_platform/platform.py new file mode 100644 index 000000000000..a2ffe0a47e78 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix9-32x/sonic_platform/platform.py @@ -0,0 +1,20 @@ +#!/usr/bin/env python +# +# Name: platform.py, version: 1.0 +# +# Description: Module contains the definitions of SONiC platform APIs +# + + +try: + from sonic_platform_base.platform_base import PlatformBase + from sonic_platform.chassis import Chassis +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + + +class Platform(PlatformBase): + + def __init__(self): + PlatformBase.__init__(self) + self._chassis = Chassis() diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix9-32x/sonic_platform/psu.py b/platform/broadcom/sonic-platform-modules-quanta/ix9-32x/sonic_platform/psu.py new file mode 100644 index 000000000000..1043a4fe1857 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix9-32x/sonic_platform/psu.py @@ -0,0 +1,319 @@ +#!/usr/bin/env python +# +# Name: psu.py, version: 1.0 +# +# Description: Module contains the definitions of SONiC platform APIs +# + +try: + import logging + import os + from sonic_platform_base.psu_base import PsuBase + from sonic_platform.fan import Fan +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +HWMON_DIR = "/sys/class/hwmon/hwmon2/" + +class Psu(PsuBase): + def __init__(self, index): + PsuBase.__init__(self) + fan = Fan(index, True) + self._fan_list.append(fan) + + self.psu_index_mapping = { + 1:39, + 2:49, + } + self.psu_powerin_index_mapping = { + 1:38, + 2:48, + } + self.psu_currentout_index_mapping = { + 1:36, + 2:46, + } + self.psu_currentin_index_mapping = { + 1:35, + 2:45, + } + self.psu_voltageout_index_mapping = { + 1:44, + 2:54, + } + self.psu_voltagein_index_mapping = { + 1:43, + 2:53, + } + self.index = index + self.psu_presence_attr = "power{}_present".format(self.psu_index_mapping[self.index]) + self.psu_status_attr = "curr{}_input".format(self.psu_currentout_index_mapping[self.index]) + self.psu_power_in_attr = "power{}_input".format(self.psu_powerin_index_mapping[self.index]) + self.psu_power_out_attr = "power{}_input".format(self.psu_index_mapping[self.index]) + self.psu_voltage_out_attr = "in{}_input".format(self.psu_voltageout_index_mapping[self.index]) + self.psu_current_out_attr = "curr{}_input".format(self.psu_currentout_index_mapping[self.index]) + self.psu_voltage_in_attr = "in{}_input".format(self.psu_voltagein_index_mapping[self.index]) + self.psu_current_in_attr = "curr{}_input".format(self.psu_currentin_index_mapping[self.index]) + self.psu_serial_attr = "power{}_sn".format(self.psu_index_mapping[self.index]) + self.psu_model_attr = "power{}_model".format(self.psu_index_mapping[self.index]) + self.psu_mfr_id_attr = "power{}_mfrid".format(self.psu_index_mapping[self.index]) + self.psu_capacity_attr = "power{}_pout_max".format(self.psu_index_mapping[self.index]) + self.psu_type_attr = "power{}_vin_type".format(self.psu_index_mapping[self.index]) + + def __get_attr_value(self, attr_path): + + retval = 'ERR' + if (not os.path.isfile(attr_path)): + return retval + + try: + with open(attr_path, 'r') as fd: + retval = fd.read() + except Exception as error: + logging.error("Unable to open " + attr_path + " file !") + + retval = retval.rstrip(' \t\n\r') + fd.close() + return retval + +############################################## +# Device methods +############################################## + + def get_name(self): + """ + Retrieves the name of the device + + Returns: + string: The name of the device + """ + return "PSU{}".format(self.index) + + def get_presence(self): + """ + Retrieves the presence of the device + + Returns: + bool: True if device is present, False if not + """ + presence = False + attr_path = HWMON_DIR+self.psu_presence_attr + attr_normal = '1' + + attr_rv = self.__get_attr_value(attr_path) + if (attr_rv != 'ERR'): + if (attr_rv == attr_normal): + presence = True + + return presence + + def get_model(self): + """ + Retrieves the model number (or part number) of the device + + Returns: + string: Model/part number of device + """ + model = "N/A" + attr_path = HWMON_DIR+self.psu_model_attr + attr_rv = self.__get_attr_value(attr_path) + if (attr_rv != 'ERR'): + model = attr_rv + + return model + + def get_mfr_id(self): + """ + Retrieves the manufacturer's name (or id) of the device + + Returns: + string: Manufacturer's id of device + """ + mfr_id = "N/A" + attr_path = HWMON_DIR+self.psu_mfr_id_attr + attr_rv = self.__get_attr_value(attr_path) + if (attr_rv != 'ERR'): + mfr_id = attr_rv + + return mfr_id + + def get_serial(self): + """ + Retrieves the serial number of the device + + Returns: + string: Serial number of device + """ + serial = "N/A" + attr_path = HWMON_DIR+self.psu_serial_attr + + attr_rv = self.__get_attr_value(attr_path) + if (attr_rv != 'ERR'): + serial = attr_rv + + return serial + + def get_status(self): + """ + Retrieves the operational status of the device + + Returns: + A boolean value, True if device is operating properly, False if not + """ + status = False + attr_path = HWMON_DIR+self.psu_status_attr + + attr_rv = self.__get_attr_value(attr_path) + if (attr_rv != 'ERR'): + attr_rv, dummy = attr_rv.split('.', 1) + if (int(attr_rv) != 0): + status = True + + return status + +############################################## +# PSU methods +############################################## + + def get_voltage(self): + """ + Retrieves current PSU voltage output + + Returns: + A float number, the output voltage in volts, + e.g. 12.1 + """ + voltage_out = 0.0 + attr_path = HWMON_DIR+self.psu_voltage_out_attr + + attr_rv = self.__get_attr_value(attr_path) + if (attr_rv != 'ERR'): + attr_rv, dummy = attr_rv.split('.', 1) + voltage_out = float(attr_rv) / 1000 + + return voltage_out + + def get_current(self): + """ + Retrieves present electric current supplied by PSU + + Returns: + A float number, the electric current in amperes, e.g 15.4 + """ + current_out = 0.0 + attr_path = HWMON_DIR+self.psu_current_out_attr + + attr_rv = self.__get_attr_value(attr_path) + if (attr_rv != 'ERR'): + attr_rv, dummy = attr_rv.split('.', 1) + current_out = float(attr_rv) / 1000 + + return current_out + + def get_input_voltage(self): + """ + Retrieves current PSU voltage output + + Returns: + A float number, the output voltage in volts, + e.g. 12.1 + """ + voltage_in = 0.0 + attr_path = HWMON_DIR+self.psu_voltage_in_attr + + attr_rv = self.__get_attr_value(attr_path) + if (attr_rv != 'ERR'): + attr_rv, dummy = attr_rv.split('.', 1) + voltage_in = float(attr_rv) / 1000 + + return voltage_in + + def get_input_current(self): + """ + Retrieves present electric current supplied by PSU + + Returns: + A float number, the electric current in amperes, e.g 15.4 + """ + current_in = 0.0 + attr_path = HWMON_DIR+self.psu_current_in_attr + + attr_rv = self.__get_attr_value(attr_path) + if (attr_rv != 'ERR'): + attr_rv, dummy = attr_rv.split('.', 1) + current_in = float(attr_rv) / 1000 + + return current_in + + def get_power(self): + """ + Retrieves current energy supplied by PSU + + Returns: + A float number, the power in watts, e.g. 302.6 + """ + power_out = 0.0 + attr_path = HWMON_DIR+self.psu_power_out_attr + + attr_rv = self.__get_attr_value(attr_path) + if (attr_rv != 'ERR'): + attr_rv, dummy = attr_rv.split('.', 1) + power_out = float(attr_rv) / 1000 + + return power_out + + def get_powergood_status(self): + """ + Retrieves the powergood status of PSU + + Returns: + A boolean, True if PSU has stablized its output voltages and passed all + its internal self-tests, False if not. + """ + return self.get_status() + + def get_status_led(self): + """ + Gets the state of the PSU status LED + + Returns: + A string, one of the predefined STATUS_LED_COLOR_* strings above + """ + if self.get_powergood_status(): + return self.STATUS_LED_COLOR_GREEN + else: + return self.STATUS_LED_COLOR_OFF + + def get_type(self): + """ + Gets the type of the PSU + + Returns: + A string, the type of PSU (AC/DC) + """ + type = "AC" + attr_path = HWMON_DIR+self.psu_type_attr + attr_rv = self.__get_attr_value(attr_path) + if (attr_rv != 'ERR'): + type = attr_rv + + return type + + def get_capacity(self): + """ + Gets the capacity (maximum output power) of the PSU in watts + + Returns: + An integer, the capacity of PSU + """ + capacity = 0 + attr_path = HWMON_DIR+self.psu_capacity_attr + attr_rv = self.__get_attr_value(attr_path) + if (attr_rv != 'ERR'): + try: + capacity = int(attr_rv) + except ValueError: + capacity = 0 + + return capacity + diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix9-32x/sonic_platform/sfp.py b/platform/broadcom/sonic-platform-modules-quanta/ix9-32x/sonic_platform/sfp.py new file mode 100644 index 000000000000..e4505f509a10 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix9-32x/sonic_platform/sfp.py @@ -0,0 +1,2130 @@ +#!/usr/bin/env python + +############################################################################# +# Quanta +# +# Sfp contains an implementation of SONiC Platform Base API and +# provides the sfp device status which are available in the platform +# +############################################################################# + +import os +import time +from ctypes import create_string_buffer + +try: + from sonic_platform_base.sfp_base import SfpBase + from sonic_platform_base.sonic_sfp.sff8472 import sff8472InterfaceId + from sonic_platform_base.sonic_sfp.sff8472 import sff8472Dom + from sonic_platform_base.sonic_sfp.sff8436 import sff8436InterfaceId + from sonic_platform_base.sonic_sfp.sff8436 import sff8436Dom + from sonic_platform_base.sonic_sfp.inf8628 import inf8628InterfaceId + from sonic_platform_base.sonic_sfp.qsfp_dd import qsfp_dd_InterfaceId + from sonic_platform_base.sonic_sfp.qsfp_dd import qsfp_dd_Dom + from sonic_py_common.logger import Logger + from sonic_platform_base.sonic_sfp.sfputilhelper import SfpUtilHelper +except ImportError as e: + raise ImportError (str(e) + "- required module not found") + +# definitions of the offset and width for values in XCVR info eeprom +XCVR_INTFACE_BULK_OFFSET = 0 +XCVR_INTFACE_BULK_WIDTH_QSFP = 20 +XCVR_INTFACE_BULK_WIDTH_SFP = 21 +XCVR_TYPE_OFFSET = 0 +XCVR_TYPE_WIDTH = 1 +XCVR_EXT_TYPE_OFFSET = 1 +XCVR_EXT_TYPE_WIDTH = 1 +XCVR_CONNECTOR_OFFSET = 2 +XCVR_CONNECTOR_WIDTH = 1 +XCVR_COMPLIANCE_CODE_OFFSET = 3 +XCVR_COMPLIANCE_CODE_WIDTH = 8 +XCVR_ENCODING_OFFSET = 11 +XCVR_ENCODING_WIDTH = 1 +XCVR_NBR_OFFSET = 12 +XCVR_NBR_WIDTH = 1 +XCVR_EXT_RATE_SEL_OFFSET = 13 +XCVR_EXT_RATE_SEL_WIDTH = 1 +XCVR_CABLE_LENGTH_OFFSET = 14 +XCVR_CABLE_LENGTH_WIDTH_QSFP = 5 +XCVR_CABLE_LENGTH_WIDTH_SFP = 6 +XCVR_VENDOR_NAME_OFFSET = 20 +XCVR_VENDOR_NAME_WIDTH = 16 +XCVR_VENDOR_OUI_OFFSET = 37 +XCVR_VENDOR_OUI_WIDTH = 3 +XCVR_VENDOR_PN_OFFSET = 40 +XCVR_VENDOR_PN_WIDTH = 16 +XCVR_HW_REV_OFFSET = 56 +XCVR_HW_REV_WIDTH_OSFP = 2 +XCVR_HW_REV_WIDTH_QSFP = 2 +XCVR_HW_REV_WIDTH_SFP = 4 +XCVR_EXT_SPECIFICATION_COMPLIANCE_OFFSET = 64 +XCVR_EXT_SPECIFICATION_COMPLIANCE_WIDTH = 1 +XCVR_VENDOR_SN_OFFSET = 68 +XCVR_VENDOR_SN_WIDTH = 16 +XCVR_VENDOR_DATE_OFFSET = 84 +XCVR_VENDOR_DATE_WIDTH = 8 +XCVR_DOM_CAPABILITY_OFFSET = 92 +XCVR_DOM_CAPABILITY_WIDTH = 2 + +# definitions of the offset and width for values in XCVR_QSFP_DD info eeprom +XCVR_EXT_TYPE_OFFSET_QSFP_DD = 72 +XCVR_EXT_TYPE_WIDTH_QSFP_DD = 2 +XCVR_CONNECTOR_OFFSET_QSFP_DD = 75 +XCVR_CONNECTOR_WIDTH_QSFP_DD = 1 +XCVR_CABLE_LENGTH_OFFSET_QSFP_DD = 74 +XCVR_CABLE_LENGTH_WIDTH_QSFP_DD = 1 +XCVR_HW_REV_OFFSET_QSFP_DD = 36 +XCVR_HW_REV_WIDTH_QSFP_DD = 2 +XCVR_VENDOR_DATE_OFFSET_QSFP_DD = 54 +XCVR_VENDOR_DATE_WIDTH_QSFP_DD = 8 +XCVR_DOM_CAPABILITY_OFFSET_QSFP_DD = 2 +XCVR_DOM_CAPABILITY_WIDTH_QSFP_DD = 1 +XCVR_MEDIA_TYPE_OFFSET_QSFP_DD = 85 +XCVR_MEDIA_TYPE_WIDTH_QSFP_DD = 1 +XCVR_FIRST_APPLICATION_LIST_OFFSET_QSFP_DD = 86 +XCVR_FIRST_APPLICATION_LIST_WIDTH_QSFP_DD = 32 +XCVR_SECOND_APPLICATION_LIST_OFFSET_QSFP_DD = 351 +XCVR_SECOND_APPLICATION_LIST_WIDTH_QSFP_DD = 28 + +# to improve performance we retrieve all eeprom data via a single ethtool command +# in function get_transceiver_info and get_transceiver_bulk_status +# XCVR_INTERFACE_DATA_SIZE stands for the max size to be read +# this variable is only used by get_transceiver_info. +# please be noted that each time some new value added to the function +# we should make sure that it falls into the area +# [XCVR_INTERFACE_DATA_START, XCVR_INTERFACE_DATA_SIZE] or +# adjust XCVR_INTERFACE_MAX_SIZE to contain the new data +# It's same for [QSFP_DOM_BULK_DATA_START, QSFP_DOM_BULK_DATA_SIZE] and +# [SFP_DOM_BULK_DATA_START, SFP_DOM_BULK_DATA_SIZE] which are used by +# get_transceiver_bulk_status +XCVR_INTERFACE_DATA_START = 0 +XCVR_INTERFACE_DATA_SIZE = 92 +SFP_MODULE_ADDRA2_OFFSET = 256 +SFP_MODULE_THRESHOLD_OFFSET = 0 +SFP_MODULE_THRESHOLD_WIDTH = 56 + +QSFP_DOM_BULK_DATA_START = 22 +QSFP_DOM_BULK_DATA_SIZE = 36 +SFP_DOM_BULK_DATA_START = 96 +SFP_DOM_BULK_DATA_SIZE = 10 + +QSFP_DD_DOM_BULK_DATA_START = 14 +QSFP_DD_DOM_BULK_DATA_SIZE = 4 + +# definitions of the offset for values in OSFP info eeprom +OSFP_TYPE_OFFSET = 0 +OSFP_VENDOR_NAME_OFFSET = 129 +OSFP_VENDOR_PN_OFFSET = 148 +OSFP_HW_REV_OFFSET = 164 +OSFP_VENDOR_SN_OFFSET = 166 + +# definitions of the offset for values in QSFP_DD info eeprom +QSFP_DD_TYPE_OFFSET = 0 +QSFP_DD_VENDOR_NAME_OFFSET = 1 +QSFP_DD_VENDOR_PN_OFFSET = 20 +QSFP_DD_VENDOR_SN_OFFSET = 38 +QSFP_DD_VENDOR_OUI_OFFSET = 17 + +#definitions of the offset and width for values in DOM info eeprom +QSFP_DOM_REV_OFFSET = 1 +QSFP_DOM_REV_WIDTH = 1 +QSFP_TEMPE_OFFSET = 22 +QSFP_TEMPE_WIDTH = 2 +QSFP_VOLT_OFFSET = 26 +QSFP_VOLT_WIDTH = 2 +QSFP_VERSION_COMPLIANCE_OFFSET = 1 +QSFP_VERSION_COMPLIANCE_WIDTH = 2 +QSFP_CHANNL_MON_OFFSET = 34 +QSFP_CHANNL_MON_WIDTH = 16 +QSFP_CHANNL_MON_WITH_TX_POWER_WIDTH = 24 +QSFP_CHANNL_DISABLE_STATUS_OFFSET = 86 +QSFP_CHANNL_DISABLE_STATUS_WIDTH = 1 +QSFP_CHANNL_RX_LOS_STATUS_OFFSET = 3 +QSFP_CHANNL_RX_LOS_STATUS_WIDTH = 1 +QSFP_CHANNL_TX_FAULT_STATUS_OFFSET = 4 +QSFP_CHANNL_TX_FAULT_STATUS_WIDTH = 1 +QSFP_CONTROL_OFFSET = 86 +QSFP_CONTROL_WIDTH = 8 +QSFP_MODULE_MONITOR_OFFSET = 0 +QSFP_MODULE_MONITOR_WIDTH = 9 +QSFP_POWEROVERRIDE_OFFSET = 93 +QSFP_POWEROVERRIDE_WIDTH = 1 +QSFP_POWEROVERRIDE_BIT = 0 +QSFP_POWERSET_BIT = 1 +QSFP_OPTION_VALUE_OFFSET = 192 +QSFP_OPTION_VALUE_WIDTH = 4 + +QSFP_MODULE_UPPER_PAGE3_START = 384 +QSFP_MODULE_THRESHOLD_OFFSET = 128 +QSFP_MODULE_THRESHOLD_WIDTH = 24 +QSFP_CHANNL_THRESHOLD_OFFSET = 176 +QSFP_CHANNL_THRESHOLD_WIDTH = 24 + +SFP_TEMPE_OFFSET = 96 +SFP_TEMPE_WIDTH = 2 +SFP_VOLT_OFFSET = 98 +SFP_VOLT_WIDTH = 2 +SFP_CHANNL_MON_OFFSET = 100 +SFP_CHANNL_MON_WIDTH = 6 + + +SFP_CHANNL_STATUS_OFFSET = 110 +SFP_CHANNL_STATUS_WIDTH = 1 + +SFP_CHANNL_THRESHOLD_OFFSET = 112 +SFP_CHANNL_THRESHOLD_WIDTH = 2 +SFP_STATUS_CONTROL_OFFSET = 110 +SFP_STATUS_CONTROL_WIDTH = 1 +SFP_TX_DISABLE_HARD_BIT = 7 +SFP_TX_DISABLE_SOFT_BIT = 6 + +QSFP_DD_TEMPE_OFFSET = 14 +QSFP_DD_TEMPE_WIDTH = 2 +QSFP_DD_VOLT_OFFSET = 16 +QSFP_DD_VOLT_WIDTH = 2 +QSFP_DD_TX_BIAS_OFFSET = 42 +QSFP_DD_TX_BIAS_WIDTH = 16 +QSFP_DD_RX_POWER_OFFSET = 58 +QSFP_DD_RX_POWER_WIDTH = 16 +QSFP_DD_TX_POWER_OFFSET = 26 +QSFP_DD_TX_POWER_WIDTH = 16 +QSFP_DD_CHANNL_MON_OFFSET = 26 +QSFP_DD_CHANNL_MON_WIDTH = 48 +QSFP_DD_CHANNL_DISABLE_STATUS_OFFSET = 86 +QSFP_DD_CHANNL_DISABLE_STATUS_WIDTH = 1 +QSFP_DD_CHANNL_RX_LOS_STATUS_OFFSET = 19 +QSFP_DD_CHANNL_RX_LOS_STATUS_WIDTH = 1 +QSFP_DD_CHANNL_TX_FAULT_STATUS_OFFSET = 7 +QSFP_DD_CHANNL_TX_FAULT_STATUS_WIDTH = 1 +QSFP_DD_MODULE_THRESHOLD_OFFSET = 0 +QSFP_DD_MODULE_THRESHOLD_WIDTH = 72 +QSFP_DD_CHANNL_STATUS_OFFSET = 26 +QSFP_DD_CHANNL_STATUS_WIDTH = 1 + +# identifier value of xSFP module which is in the first byte of the EEPROM +# if the identifier value falls into SFP_TYPE_CODE_LIST the module is treated as a SFP module and parsed according to 8472 +# for QSFP_TYPE_CODE_LIST the module is treated as a QSFP module and parsed according to 8436/8636 +# Originally the type (SFP/QSFP) of each module is determined according to the SKU dictionary +# where the type of each FP port is defined. The content of EEPROM is parsed according to its type. +# However, sometimes the SFP module can be fit in an adapter and then pluged into a QSFP port. +# In this case the EEPROM content is in format of SFP but parsed as QSFP, causing failure. +# To resolve that issue the type field of the xSFP module is also fetched so that we can know exectly what type the +# module is. Currently only the following types are recognized as SFP/QSFP module. +# Meanwhile, if the a module's identifier value can't be recognized, it will be parsed according to the SKU dictionary. +# This is because in the future it's possible that some new identifier value which is not regonized but backward compatible +# with the current format and by doing so it can be parsed as much as possible. +SFP_TYPE_CODE_LIST = [ + '03' # SFP/SFP+/SFP28 +] +QSFP_TYPE_CODE_LIST = [ + '0d', # QSFP+ or later + '11' # QSFP28 or later +] +QSFP_DD_TYPE_CODE_LIST = [ + '18' # QSFP-DD Double Density 8X Pluggable Transceiver +] + +qsfp_cable_length_tup = ('Length(km)', 'Length OM3(2m)', + 'Length OM2(m)', 'Length OM1(m)', + 'Length Cable Assembly(m)') + +sfp_cable_length_tup = ('LengthSMFkm-UnitsOfKm', 'LengthSMF(UnitsOf100m)', + 'Length50um(UnitsOf10m)', 'Length62.5um(UnitsOfm)', + 'LengthCable(UnitsOfm)', 'LengthOM3(UnitsOf10m)') + +sfp_compliance_code_tup = ('10GEthernetComplianceCode', 'InfinibandComplianceCode', + 'ESCONComplianceCodes', 'SONETComplianceCodes', + 'EthernetComplianceCodes','FibreChannelLinkLength', + 'FibreChannelTechnology', 'SFP+CableTechnology', + 'FibreChannelTransmissionMedia','FibreChannelSpeed') + +qsfp_compliance_code_tup = ('10/40G Ethernet Compliance Code', 'SONET Compliance codes', + 'SAS/SATA compliance codes', 'Gigabit Ethernet Compliant codes', + 'Fibre Channel link length/Transmitter Technology', + 'Fibre Channel transmission media', 'Fibre Channel Speed') + +SFP_TYPE = "SFP" +QSFP_TYPE = "QSFP" +OSFP_TYPE = "OSFP" +QSFP_DD_TYPE = "QSFP_DD" + +# Global logger class instance +logger = Logger() + +class Sfp(SfpBase): + """Platform-specific Sfp class""" + + # Port number + PORT_START = 1 + PORT_END = 32 + + dom_supported = True + dom_temp_supported = True + dom_volt_supported = True + dom_rx_power_supported = True + dom_tx_power_supported = True + dom_tx_disable_supported = True + calibration = 1 + + # Path to QSFP sysfs + PLATFORM_ROOT_PATH = "/usr/share/sonic/device" + PMON_HWSKU_PATH = "/usr/share/sonic/hwsku" + HOST_CHK_CMD = "docker > /dev/null 2>&1" + + PLATFORM = "x86_64-quanta_ix9_bwde-r0" + HWSKU = "Quanta-IX9-32X" + + def __init__(self, sfp_index, sfp_type): + # Init index + self.index = sfp_index + self.port_num = self.index + #self.dom_supported = False + self.sfp_type = sfp_type + self.reset_path = "/sys/class/cpld-qsfpdd/port-"+str(self.port_num)+"/reset" + self.lpmode_path = "/sys/class/cpld-qsfpdd/port-"+str(self.port_num)+"/lpmode" + # Init eeprom path + eeprom_path = '/sys/bus/i2c/devices/{0}-0050/eeprom' + self.port_to_eeprom_mapping = {} + self.port_to_i2c_mapping = { + 1 : 13, + 2 : 14, + 3 : 15, + 4 : 16, + 5 : 17, + 6 : 18, + 7 : 19, + 8 : 20, + 9 : 21, + 10 : 22, + 11 : 23, + 12 : 24, + 13 : 25, + 14 : 26, + 15 : 27, + 16 : 28, + 17 : 29, + 18 : 30, + 19 : 31, + 20 : 32, + 21 : 33, + 22 : 34, + 23 : 35, + 24 : 36, + 25 : 37, + 26 : 38, + 27 : 39, + 28 : 40, + 29 : 41, + 30 : 42, + 31 : 43, + 32 : 44, + } + + for x in range(self.PORT_START, self.PORT_END + 1): + port_eeprom_path = eeprom_path.format(self.port_to_i2c_mapping[x]) + self.port_to_eeprom_mapping[x] = port_eeprom_path + + self._detect_sfp_type(sfp_type) + + self.info_dict_keys = ['type', 'hardware_rev', 'serial', 'manufacturer', + 'model', 'connector', 'encoding', 'ext_identifier', + 'ext_rateselect_compliance', 'cable_type', 'cable_length', + 'nominal_bit_rate', 'specification_compliance', 'vendor_date', 'vendor_oui', 'application_advertisement'] + + SfpBase.__init__(self) + + + def _convert_string_to_num(self, value_str): + if "-inf" in value_str: + return 'N/A' + elif "Unknown" in value_str: + return 'N/A' + elif 'dBm' in value_str: + t_str = value_str.rstrip('dBm') + return float(t_str) + elif 'mA' in value_str: + t_str = value_str.rstrip('mA') + return float(t_str) + elif 'C' in value_str: + t_str = value_str.rstrip('C') + return float(t_str) + elif 'Volts' in value_str: + t_str = value_str.rstrip('Volts') + return float(t_str) + else: + return 'N/A' + + def __read_txt_file(self, file_path): + try: + with open(file_path, 'r') as fd: + data = fd.read() + return data.strip() + except IOError: + pass + return "" + + def __is_host(self): + return os.system(self.HOST_CHK_CMD) == 0 + + def __get_path_to_port_config_file(self): + platform_path = "/".join([self.PLATFORM_ROOT_PATH, self.PLATFORM]) + hwsku_path = "/".join([platform_path, self.HWSKU] + ) if self.__is_host() else self.PMON_HWSKU_PATH + return "/".join([hwsku_path, "port_config.ini"]) + + def get_presence(self): + """ + Retrieves the presence of the SFP module + Returns: + bool: True if SFP module is present, False if not + """ + # Check for invalid port_num + if self.port_num < self.PORT_START or self.port_num > self.PORT_END: + return False + + try: + reg_file = open("/sys/class/cpld-qsfpdd/port-"+str(self.port_num)+"/module_present") + except IOError as e: + print ("Error: unable to open file: %s" % str(e)) + return False + + reg_value = reg_file.readline().rstrip() + if reg_value == '1': + return True + + return False + + def _read_eeprom_specific_bytes(self, offset, num_bytes): + sysfsfile_eeprom = None + eeprom_raw = [] + for i in range(0, num_bytes): + eeprom_raw.append("0x00") + + sysfs_sfp_i2c_client_eeprom_path = self.port_to_eeprom_mapping[self.port_num] + try: + sysfsfile_eeprom = open( + sysfs_sfp_i2c_client_eeprom_path, mode="rb", buffering=0) + sysfsfile_eeprom.seek(offset) + raw = sysfsfile_eeprom.read(num_bytes) + for n in range(0, num_bytes): + eeprom_raw[n] = hex(raw[n])[2:].zfill(2) + except Exception: + eeprom_raw = None + finally: + if sysfsfile_eeprom: + sysfsfile_eeprom.close() + + return eeprom_raw + + def _detect_sfp_type(self, sfp_type): + eeprom_raw = [] + eeprom_raw = self._read_eeprom_specific_bytes(XCVR_TYPE_OFFSET, XCVR_TYPE_WIDTH) + if eeprom_raw: + if eeprom_raw[0] in SFP_TYPE_CODE_LIST: + self.sfp_type = SFP_TYPE + elif eeprom_raw[0] in QSFP_TYPE_CODE_LIST: + self.sfp_type = QSFP_TYPE + elif eeprom_raw[0] in QSFP_DD_TYPE_CODE_LIST: + self.sfp_type = QSFP_TYPE + else: + # we don't regonize this identifier value, treat the xSFP module as the default type + self.sfp_type = sfp_type + logger.log_info("Identifier value of {} module {} is {} which isn't regonized and will be treated as default type ({})".format( + sfp_type, self.index, eeprom_raw[0], sfp_type + )) + else: + # eeprom_raw being None indicates the module is not present. + # in this case we treat it as the default type according to the SKU + self.sfp_type = sfp_type + + def __convert_string_to_num(self, value_str): + if "-inf" in value_str: + return 'N/A' + elif "Unknown" in value_str: + return 'N/A' + elif 'dBm' in value_str: + t_str = value_str.rstrip('dBm') + return float(t_str) + elif 'mA' in value_str: + t_str = value_str.rstrip('mA') + return float(t_str) + elif 'C' in value_str: + t_str = value_str.rstrip('C') + return float(t_str) + elif 'Volts' in value_str: + t_str = value_str.rstrip('Volts') + return float(t_str) + else: + return 'N/A' + + def _dom_capability_detect(self): + if not self.get_presence(): + self.dom_supported = False + self.dom_temp_supported = False + self.dom_volt_supported = False + self.dom_rx_power_supported = False + self.dom_tx_bias_power_supported = False + self.dom_tx_power_supported = False + self.calibration = 0 + return + + if self.sfp_type == QSFP_TYPE: + self.calibration = 1 + sfpi_obj = sff8436InterfaceId() + if sfpi_obj is None: + self.dom_supported = False + offset = 128 + + # QSFP capability byte parse, through this byte can know whether it support tx_power or not. + # TODO: in the future when decided to migrate to support SFF-8636 instead of SFF-8436, + # need to add more code for determining the capability and version compliance + # in SFF-8636 dom capability definitions evolving with the versions. + qsfp_dom_capability_raw = self._read_eeprom_specific_bytes((offset + XCVR_DOM_CAPABILITY_OFFSET), XCVR_DOM_CAPABILITY_WIDTH) + if qsfp_dom_capability_raw is not None: + qsfp_version_compliance_raw = self._read_eeprom_specific_bytes(QSFP_VERSION_COMPLIANCE_OFFSET, QSFP_VERSION_COMPLIANCE_WIDTH) + qsfp_version_compliance = int(qsfp_version_compliance_raw[0], 16) + dom_capability = sfpi_obj.parse_dom_capability(qsfp_dom_capability_raw, 0) + if qsfp_version_compliance >= 0x08: + self.dom_temp_supported = dom_capability['data']['Temp_support']['value'] == 'On' + self.dom_volt_supported = dom_capability['data']['Voltage_support']['value'] == 'On' + self.dom_rx_power_supported = dom_capability['data']['Rx_power_support']['value'] == 'On' + self.dom_tx_power_supported = dom_capability['data']['Tx_power_support']['value'] == 'On' + else: + self.dom_temp_supported = True + self.dom_volt_supported = True + self.dom_rx_power_supported = dom_capability['data']['Rx_power_support']['value'] == 'On' + self.dom_tx_power_supported = True + self.dom_supported = True + self.calibration = 1 + sfpd_obj = sff8436Dom() + if sfpd_obj is None: + return None + qsfp_option_value_raw = self._read_eeprom_specific_bytes(QSFP_OPTION_VALUE_OFFSET, QSFP_OPTION_VALUE_WIDTH) + if qsfp_option_value_raw is not None: + optional_capability = sfpd_obj.parse_option_params(qsfp_option_value_raw, 0) + self.dom_tx_disable_supported = optional_capability['data']['TxDisable']['value'] == 'On' + dom_status_indicator = sfpd_obj.parse_dom_status_indicator(qsfp_version_compliance_raw, 1) + self.qsfp_page3_available = dom_status_indicator['data']['FlatMem']['value'] == 'Off' + else: + self.dom_supported = False + self.dom_temp_supported = False + self.dom_volt_supported = False + self.dom_rx_power_supported = False + self.dom_tx_power_supported = False + self.calibration = 0 + self.qsfp_page3_available = False + + elif self.sfp_type == QSFP_DD_TYPE: + sfpi_obj = qsfp_dd_InterfaceId() + if sfpi_obj is None: + self.dom_supported = False + + offset = 0 + # two types of QSFP-DD cable types supported: Copper and Optical. + qsfp_dom_capability_raw = self._read_eeprom_specific_bytes((offset + XCVR_DOM_CAPABILITY_OFFSET_QSFP_DD), XCVR_DOM_CAPABILITY_WIDTH_QSFP_DD) + if qsfp_dom_capability_raw is not None: + self.dom_temp_supported = True + self.dom_volt_supported = True + dom_capability = sfpi_obj.parse_dom_capability(qsfp_dom_capability_raw, 0) + if dom_capability['data']['Flat_MEM']['value'] == 'Off': + self.dom_supported = True + self.second_application_list = True + self.dom_rx_power_supported = True + self.dom_tx_power_supported = True + self.dom_tx_bias_power_supported = True + self.dom_thresholds_supported = True + self.dom_rx_tx_power_bias_supported = True + else: + self.dom_supported = False + self.second_application_list = False + self.dom_rx_power_supported = False + self.dom_tx_power_supported = False + self.dom_tx_bias_power_supported = False + self.dom_thresholds_supported = False + self.dom_rx_tx_power_bias_supported = False + else: + self.dom_supported = False + self.dom_temp_supported = False + self.dom_volt_supported = False + self.dom_rx_power_supported = False + self.dom_tx_power_supported = False + self.dom_tx_bias_power_supported = False + self.dom_thresholds_supported = False + self.dom_rx_tx_power_bias_supported = False + + elif self.sfp_type == SFP_TYPE: + sfpi_obj = sff8472InterfaceId() + if sfpi_obj is None: + return None + sfp_dom_capability_raw = self._read_eeprom_specific_bytes(XCVR_DOM_CAPABILITY_OFFSET, XCVR_DOM_CAPABILITY_WIDTH) + if sfp_dom_capability_raw is not None: + sfp_dom_capability = int(sfp_dom_capability_raw[0], 16) + self.dom_supported = (sfp_dom_capability & 0x40 != 0) + if self.dom_supported: + self.dom_temp_supported = True + self.dom_volt_supported = True + self.dom_rx_power_supported = True + self.dom_tx_power_supported = True + if sfp_dom_capability & 0x20 != 0: + self.calibration = 1 + elif sfp_dom_capability & 0x10 != 0: + self.calibration = 2 + else: + self.calibration = 0 + else: + self.dom_temp_supported = False + self.dom_volt_supported = False + self.dom_rx_power_supported = False + self.dom_tx_power_supported = False + self.calibration = 0 + self.dom_tx_disable_supported = (int(sfp_dom_capability_raw[1], 16) & 0x40 != 0) + else: + self.dom_supported = False + self.dom_temp_supported = False + self.dom_volt_supported = False + self.dom_rx_power_supported = False + self.dom_tx_power_supported = False + + def get_transceiver_info(self): + """ + Retrieves transceiver info of this SFP + + Returns: + A dict which contains following keys/values : + ================================================================================ + keys |Value Format |Information + ---------------------------|---------------|---------------------------- + type |1*255VCHAR |type of SFP + hardware_rev |1*255VCHAR |hardware version of SFP + serial |1*255VCHAR |serial number of the SFP + manufacturer |1*255VCHAR |SFP vendor name + model |1*255VCHAR |SFP model name + connector |1*255VCHAR |connector information + encoding |1*255VCHAR |encoding information + ext_identifier |1*255VCHAR |extend identifier + ext_rateselect_compliance |1*255VCHAR |extended rateSelect compliance + cable_length |INT |cable length in m + mominal_bit_rate |INT |nominal bit rate by 100Mbs + specification_compliance |1*255VCHAR |specification compliance + vendor_date |1*255VCHAR |vendor date + vendor_oui |1*255VCHAR |vendor OUI + application_advertisement |1*255VCHAR |supported applications advertisement + ================================================================================ + """ + + transceiver_info_dict = {} + compliance_code_dict = {} + transceiver_info_dict = dict.fromkeys(self.info_dict_keys, 'N/A') + transceiver_info_dict['specification_compliance'] = '{}' + if not self.get_presence(): + return transceiver_info_dict + + self._detect_sfp_type(self.sfp_type) + + transceiver_info_dict = {} + compliance_code_dict = {} + + # ToDo: OSFP tranceiver info parsing not fully supported. + # in inf8628.py lack of some memory map definition + # will be implemented when the inf8628 memory map ready + if self.sfp_type == OSFP_TYPE: + offset = 0 + vendor_rev_width = XCVR_HW_REV_WIDTH_OSFP + + sfpi_obj = inf8628InterfaceId() + if sfpi_obj is None: + return None + + sfp_type_raw = self._read_eeprom_specific_bytes((offset + OSFP_TYPE_OFFSET), XCVR_TYPE_WIDTH) + if sfp_type_raw is not None: + sfp_type_data = sfpi_obj.parse_sfp_type(sfp_type_raw, 0) + else: + return None + + sfp_vendor_name_raw = self._read_eeprom_specific_bytes((offset + OSFP_VENDOR_NAME_OFFSET), XCVR_VENDOR_NAME_WIDTH) + if sfp_vendor_name_raw is not None: + sfp_vendor_name_data = sfpi_obj.parse_vendor_name(sfp_vendor_name_raw, 0) + else: + return None + + sfp_vendor_pn_raw = self._read_eeprom_specific_bytes((offset + OSFP_VENDOR_PN_OFFSET), XCVR_VENDOR_PN_WIDTH) + if sfp_vendor_pn_raw is not None: + sfp_vendor_pn_data = sfpi_obj.parse_vendor_pn(sfp_vendor_pn_raw, 0) + else: + return None + + sfp_vendor_rev_raw = self._read_eeprom_specific_bytes((offset + OSFP_HW_REV_OFFSET), vendor_rev_width) + if sfp_vendor_rev_raw is not None: + sfp_vendor_rev_data = sfpi_obj.parse_vendor_rev(sfp_vendor_rev_raw, 0) + else: + return None + + sfp_vendor_sn_raw = self._read_eeprom_specific_bytes((offset + OSFP_VENDOR_SN_OFFSET), XCVR_VENDOR_SN_WIDTH) + if sfp_vendor_sn_raw is not None: + sfp_vendor_sn_data = sfpi_obj.parse_vendor_sn(sfp_vendor_sn_raw, 0) + else: + return None + + transceiver_info_dict['type'] = sfp_type_data['data']['type']['value'] + transceiver_info_dict['manufacturer'] = sfp_vendor_name_data['data']['Vendor Name']['value'] + transceiver_info_dict['model'] = sfp_vendor_pn_data['data']['Vendor PN']['value'] + transceiver_info_dict['hardware_rev'] = sfp_vendor_rev_data['data']['Vendor Rev']['value'] + transceiver_info_dict['serial'] = sfp_vendor_sn_data['data']['Vendor SN']['value'] + transceiver_info_dict['vendor_oui'] = 'N/A' + transceiver_info_dict['vendor_date'] = 'N/A' + transceiver_info_dict['connector'] = 'N/A' + transceiver_info_dict['encoding'] = 'N/A' + transceiver_info_dict['ext_identifier'] = 'N/A' + transceiver_info_dict['ext_rateselect_compliance'] = 'N/A' + transceiver_info_dict['cable_type'] = 'N/A' + transceiver_info_dict['cable_length'] = 'N/A' + transceiver_info_dict['specification_compliance'] = 'N/A' + transceiver_info_dict['nominal_bit_rate'] = 'N/A' + transceiver_info_dict['application_advertisement'] = 'N/A' + + elif self.sfp_type == QSFP_TYPE: + offset = 128 + vendor_rev_width = XCVR_HW_REV_WIDTH_QSFP + interface_info_bulk_width = XCVR_INTFACE_BULK_WIDTH_QSFP + + sfpi_obj = sff8436InterfaceId() + if sfpi_obj is None: + print("Error: sfp_object open failed") + return None + + elif self.sfp_type == QSFP_DD_TYPE: + offset = 128 + + sfpi_obj = qsfp_dd_InterfaceId() + if sfpi_obj is None: + print("Error: sfp_object open failed") + return None + + sfp_type_raw = self._read_eeprom_specific_bytes((offset + QSFP_DD_TYPE_OFFSET), XCVR_TYPE_WIDTH) + if sfp_type_raw is not None: + sfp_type_data = sfpi_obj.parse_sfp_type(sfp_type_raw, 0) + else: + return None + + sfp_vendor_name_raw = self._read_eeprom_specific_bytes((offset + QSFP_DD_VENDOR_NAME_OFFSET), XCVR_VENDOR_NAME_WIDTH) + if sfp_vendor_name_raw is not None: + sfp_vendor_name_data = sfpi_obj.parse_vendor_name(sfp_vendor_name_raw, 0) + else: + return None + + sfp_vendor_pn_raw = self._read_eeprom_specific_bytes((offset + QSFP_DD_VENDOR_PN_OFFSET), XCVR_VENDOR_PN_WIDTH) + if sfp_vendor_pn_raw is not None: + sfp_vendor_pn_data = sfpi_obj.parse_vendor_pn(sfp_vendor_pn_raw, 0) + else: + return None + + sfp_vendor_rev_raw = self._read_eeprom_specific_bytes((offset + XCVR_HW_REV_OFFSET_QSFP_DD), XCVR_HW_REV_WIDTH_QSFP_DD) + if sfp_vendor_rev_raw is not None: + sfp_vendor_rev_data = sfpi_obj.parse_vendor_rev(sfp_vendor_rev_raw, 0) + else: + return None + + sfp_vendor_sn_raw = self._read_eeprom_specific_bytes((offset + QSFP_DD_VENDOR_SN_OFFSET), XCVR_VENDOR_SN_WIDTH) + if sfp_vendor_sn_raw is not None: + sfp_vendor_sn_data = sfpi_obj.parse_vendor_sn(sfp_vendor_sn_raw, 0) + else: + return None + + sfp_vendor_oui_raw = self._read_eeprom_specific_bytes((offset + QSFP_DD_VENDOR_OUI_OFFSET), XCVR_VENDOR_OUI_WIDTH) + if sfp_vendor_oui_raw is not None: + sfp_vendor_oui_data = sfpi_obj.parse_vendor_oui(sfp_vendor_oui_raw, 0) + else: + return None + + sfp_vendor_date_raw = self._read_eeprom_specific_bytes((offset + XCVR_VENDOR_DATE_OFFSET_QSFP_DD), XCVR_VENDOR_DATE_WIDTH_QSFP_DD) + if sfp_vendor_date_raw is not None: + sfp_vendor_date_data = sfpi_obj.parse_vendor_date(sfp_vendor_date_raw, 0) + else: + return None + + sfp_connector_raw = self._read_eeprom_specific_bytes((offset + XCVR_CONNECTOR_OFFSET_QSFP_DD), XCVR_CONNECTOR_WIDTH_QSFP_DD) + if sfp_connector_raw is not None: + sfp_connector_data = sfpi_obj.parse_connector(sfp_connector_raw, 0) + else: + return None + + sfp_ext_identifier_raw = self._read_eeprom_specific_bytes((offset + XCVR_EXT_TYPE_OFFSET_QSFP_DD), XCVR_EXT_TYPE_WIDTH_QSFP_DD) + if sfp_ext_identifier_raw is not None: + sfp_ext_identifier_data = sfpi_obj.parse_ext_iden(sfp_ext_identifier_raw, 0) + else: + return None + + sfp_cable_len_raw = self._read_eeprom_specific_bytes((offset + XCVR_CABLE_LENGTH_OFFSET_QSFP_DD), XCVR_CABLE_LENGTH_WIDTH_QSFP_DD) + if sfp_cable_len_raw is not None: + sfp_cable_len_data = sfpi_obj.parse_cable_len(sfp_cable_len_raw, 0) + else: + return None + + sfp_media_type_raw = self._read_eeprom_specific_bytes(XCVR_MEDIA_TYPE_OFFSET_QSFP_DD, XCVR_MEDIA_TYPE_WIDTH_QSFP_DD) + if sfp_media_type_raw is not None: + sfp_media_type_dict = sfpi_obj.parse_media_type(sfp_media_type_raw, 0) + if sfp_media_type_dict is None: + return None + + host_media_list = "" + sfp_application_type_first_list = self._read_eeprom_specific_bytes((XCVR_FIRST_APPLICATION_LIST_OFFSET_QSFP_DD), XCVR_FIRST_APPLICATION_LIST_WIDTH_QSFP_DD) + if self.second_application_list: + possible_application_count = 15 + sfp_application_type_second_list = self._read_eeprom_specific_bytes((XCVR_SECOND_APPLICATION_LIST_OFFSET_QSFP_DD), XCVR_SECOND_APPLICATION_LIST_WIDTH_QSFP_DD) + if sfp_application_type_first_list is not None and sfp_application_type_second_list is not None: + sfp_application_type_list = sfp_application_type_first_list + sfp_application_type_second_list + else: + return None + else: + possible_application_count = 8 + if sfp_application_type_first_list is not None: + sfp_application_type_list = sfp_application_type_first_list + else: + return None + + for i in range(0, possible_application_count): + if sfp_application_type_list[i * 4] == 'ff': + break + host_electrical, media_interface = sfpi_obj.parse_application(sfp_media_type_dict, sfp_application_type_list[i * 4], sfp_application_type_list[i * 4 + 1]) + host_media_list = host_media_list + host_electrical + ' - ' + media_interface + '\n\t\t\t\t ' + else: + return None + + transceiver_info_dict['type'] = str(sfp_type_data['data']['type']['value']) + transceiver_info_dict['manufacturer'] = str(sfp_vendor_name_data['data']['Vendor Name']['value']) + transceiver_info_dict['model'] = str(sfp_vendor_pn_data['data']['Vendor PN']['value']) + transceiver_info_dict['hardware_rev'] = str(sfp_vendor_rev_data['data']['Vendor Rev']['value']) + transceiver_info_dict['serial'] = str(sfp_vendor_sn_data['data']['Vendor SN']['value']) + transceiver_info_dict['vendor_oui'] = str(sfp_vendor_oui_data['data']['Vendor OUI']['value']) + transceiver_info_dict['vendor_date'] = str(sfp_vendor_date_data['data']['VendorDataCode(YYYY-MM-DD Lot)']['value']) + transceiver_info_dict['connector'] = str(sfp_connector_data['data']['Connector']['value']) + transceiver_info_dict['encoding'] = "Not supported for CMIS cables" + transceiver_info_dict['ext_identifier'] = str(sfp_ext_identifier_data['data']['Extended Identifier']['value']) + transceiver_info_dict['ext_rateselect_compliance'] = "Not supported for CMIS cables" + transceiver_info_dict['specification_compliance'] = "Not supported for CMIS cables" + transceiver_info_dict['cable_type'] = "Length Cable Assembly(m)" + transceiver_info_dict['cable_length'] = str(sfp_cable_len_data['data']['Length Cable Assembly(m)']['value']) + transceiver_info_dict['nominal_bit_rate'] = "Not supported for CMIS cables" + transceiver_info_dict['application_advertisement'] = host_media_list + + else: + offset = 0 + vendor_rev_width = XCVR_HW_REV_WIDTH_SFP + interface_info_bulk_width = XCVR_INTFACE_BULK_WIDTH_SFP + + sfpi_obj = sff8472InterfaceId() + if sfpi_obj is None: + print("Error: sfp_object open failed") + return None + + if self.sfp_type != QSFP_DD_TYPE: + # Add retry for xcvr eeprom to get ready + max_retry = 10 + for i in range(0,max_retry): + sfp_interface_bulk_raw = self._read_eeprom_specific_bytes( + offset + XCVR_INTERFACE_DATA_START, XCVR_INTERFACE_DATA_SIZE) + if sfp_interface_bulk_raw is not None: + break + else: + if not self.get_presence(): + return transceiver_info_dict + elif i == max_retry-1: + pass + else: + time.sleep(0.5) + + if sfp_interface_bulk_raw is None: + return transceiver_info_dict + + start = XCVR_INTFACE_BULK_OFFSET - XCVR_INTERFACE_DATA_START + end = start + interface_info_bulk_width + sfp_interface_bulk_data = sfpi_obj.parse_sfp_info_bulk(sfp_interface_bulk_raw[start : end], 0) + + start = XCVR_VENDOR_NAME_OFFSET - XCVR_INTERFACE_DATA_START + end = start + XCVR_VENDOR_NAME_WIDTH + sfp_vendor_name_data = sfpi_obj.parse_vendor_name(sfp_interface_bulk_raw[start : end], 0) + + start = XCVR_VENDOR_PN_OFFSET - XCVR_INTERFACE_DATA_START + end = start + XCVR_VENDOR_PN_WIDTH + sfp_vendor_pn_data = sfpi_obj.parse_vendor_pn(sfp_interface_bulk_raw[start : end], 0) + + start = XCVR_HW_REV_OFFSET - XCVR_INTERFACE_DATA_START + end = start + vendor_rev_width + sfp_vendor_rev_data = sfpi_obj.parse_vendor_rev(sfp_interface_bulk_raw[start : end], 0) + + start = XCVR_VENDOR_SN_OFFSET - XCVR_INTERFACE_DATA_START + end = start + XCVR_VENDOR_SN_WIDTH + sfp_vendor_sn_data = sfpi_obj.parse_vendor_sn(sfp_interface_bulk_raw[start : end], 0) + + start = XCVR_VENDOR_OUI_OFFSET - XCVR_INTERFACE_DATA_START + end = start + XCVR_VENDOR_OUI_WIDTH + sfp_vendor_oui_data = sfpi_obj.parse_vendor_oui(sfp_interface_bulk_raw[start : end], 0) + + start = XCVR_VENDOR_DATE_OFFSET - XCVR_INTERFACE_DATA_START + end = start + XCVR_VENDOR_DATE_WIDTH + sfp_vendor_date_data = sfpi_obj.parse_vendor_date(sfp_interface_bulk_raw[start : end], 0) + + transceiver_info_dict['type'] = sfp_interface_bulk_data['data']['type']['value'] + transceiver_info_dict['manufacturer'] = sfp_vendor_name_data['data']['Vendor Name']['value'] + transceiver_info_dict['model'] = sfp_vendor_pn_data['data']['Vendor PN']['value'] + transceiver_info_dict['hardware_rev'] = sfp_vendor_rev_data['data']['Vendor Rev']['value'] + transceiver_info_dict['serial'] = sfp_vendor_sn_data['data']['Vendor SN']['value'] + transceiver_info_dict['vendor_oui'] = sfp_vendor_oui_data['data']['Vendor OUI']['value'] + transceiver_info_dict['vendor_date'] = sfp_vendor_date_data['data']['VendorDataCode(YYYY-MM-DD Lot)']['value'] + transceiver_info_dict['connector'] = sfp_interface_bulk_data['data']['Connector']['value'] + transceiver_info_dict['encoding'] = sfp_interface_bulk_data['data']['EncodingCodes']['value'] + transceiver_info_dict['ext_identifier'] = sfp_interface_bulk_data['data']['Extended Identifier']['value'] + transceiver_info_dict['ext_rateselect_compliance'] = sfp_interface_bulk_data['data']['RateIdentifier']['value'] + transceiver_info_dict['application_advertisement'] = 'N/A' + + if self.sfp_type == QSFP_TYPE: + for key in qsfp_cable_length_tup: + if key in sfp_interface_bulk_data['data']: + transceiver_info_dict['cable_type'] = key + transceiver_info_dict['cable_length'] = str(sfp_interface_bulk_data['data'][key]['value']) + + for key in qsfp_compliance_code_tup: + if key in sfp_interface_bulk_data['data']['Specification compliance']['value']: + compliance_code_dict[key] = sfp_interface_bulk_data['data']['Specification compliance']['value'][key]['value'] + sfp_ext_specification_compliance_raw = self._read_eeprom_specific_bytes(offset + XCVR_EXT_SPECIFICATION_COMPLIANCE_OFFSET, XCVR_EXT_SPECIFICATION_COMPLIANCE_WIDTH) + if sfp_ext_specification_compliance_raw is not None: + sfp_ext_specification_compliance_data = sfpi_obj.parse_ext_specification_compliance(sfp_ext_specification_compliance_raw[0 : 1], 0) + if sfp_ext_specification_compliance_data['data']['Extended Specification compliance']['value'] != "Unspecified": + compliance_code_dict['Extended Specification compliance'] = sfp_ext_specification_compliance_data['data']['Extended Specification compliance']['value'] + transceiver_info_dict['specification_compliance'] = str(compliance_code_dict) + + transceiver_info_dict['nominal_bit_rate'] = str(sfp_interface_bulk_data['data']['Nominal Bit Rate(100Mbs)']['value']) + else: + for key in sfp_cable_length_tup: + if key in sfp_interface_bulk_data['data']: + transceiver_info_dict['cable_type'] = key + transceiver_info_dict['cable_length'] = str(sfp_interface_bulk_data['data'][key]['value']) + + for key in sfp_compliance_code_tup: + if key in sfp_interface_bulk_data['data']['Specification compliance']['value']: + compliance_code_dict[key] = sfp_interface_bulk_data['data']['Specification compliance']['value'][key]['value'] + transceiver_info_dict['specification_compliance'] = str(compliance_code_dict) + + transceiver_info_dict['nominal_bit_rate'] = str(sfp_interface_bulk_data['data']['NominalSignallingRate(UnitsOf100Mbd)']['value']) + + return transceiver_info_dict + + + def get_transceiver_bulk_status(self): + """ + Retrieves transceiver bulk status of this SFP + + Returns: + A dict which contains following keys/values : + ======================================================================== + keys |Value Format |Information + ---------------------------|---------------|---------------------------- + RX LOS |BOOLEAN |RX lost-of-signal status, + | |True if has RX los, False if not. + TX FAULT |BOOLEAN |TX fault status, + | |True if has TX fault, False if not. + Reset status |BOOLEAN |reset status, + | |True if SFP in reset, False if not. + LP mode |BOOLEAN |low power mode status, + | |True in lp mode, False if not. + TX disable |BOOLEAN |TX disable status, + | |True TX disabled, False if not. + TX disabled channel |HEX |disabled TX channles in hex, + | |bits 0 to 3 represent channel 0 + | |to channel 3. + Temperature |INT |module temperature in Celsius + Voltage |INT |supply voltage in mV + TX bias |INT |TX Bias Current in mA + RX power |INT |received optical power in mW + TX power |INT |TX output power in mW + ======================================================================== + """ + transceiver_dom_info_dict = {} + + dom_info_dict_keys = ['temperature', 'voltage', + 'rx1power', 'rx2power', + 'rx3power', 'rx4power', + 'rx5power', 'rx6power', + 'rx7power', 'rx8power', + 'tx1bias', 'tx2bias', + 'tx3bias', 'tx4bias', + 'tx5bias', 'tx6bias', + 'tx7bias', 'tx8bias', + 'tx1power', 'tx2power', + 'tx3power', 'tx4power', + 'tx5power', 'tx6power', + 'tx7power', 'tx8power' + ] + transceiver_dom_info_dict = dict.fromkeys(dom_info_dict_keys, 'N/A') + + if not self.get_presence(): + return {} + + self._dom_capability_detect() + + if self.sfp_type == OSFP_TYPE: + pass + + elif self.sfp_type == QSFP_TYPE: + if not self.dom_supported: + return transceiver_dom_info_dict + + offset = 0 + sfpd_obj = sff8436Dom() + if sfpd_obj is None: + return transceiver_dom_info_dict + + dom_data_raw = self._read_eeprom_specific_bytes((offset + QSFP_DOM_BULK_DATA_START), QSFP_DOM_BULK_DATA_SIZE) + if dom_data_raw is None: + return transceiver_dom_info_dict + + if self.dom_temp_supported: + start = QSFP_TEMPE_OFFSET - QSFP_DOM_BULK_DATA_START + end = start + QSFP_TEMPE_WIDTH + dom_temperature_data = sfpd_obj.parse_temperature(dom_data_raw[start : end], 0) + temp = self._convert_string_to_num(dom_temperature_data['data']['Temperature']['value']) + if temp is not None: + transceiver_dom_info_dict['temperature'] = temp + + if self.dom_volt_supported: + start = QSFP_VOLT_OFFSET - QSFP_DOM_BULK_DATA_START + end = start + QSFP_VOLT_WIDTH + dom_voltage_data = sfpd_obj.parse_voltage(dom_data_raw[start : end], 0) + volt = self._convert_string_to_num(dom_voltage_data['data']['Vcc']['value']) + if volt is not None: + transceiver_dom_info_dict['voltage'] = volt + + start = QSFP_CHANNL_MON_OFFSET - QSFP_DOM_BULK_DATA_START + end = start + QSFP_CHANNL_MON_WITH_TX_POWER_WIDTH + dom_channel_monitor_data = sfpd_obj.parse_channel_monitor_params_with_tx_power(dom_data_raw[start : end], 0) + + if self.dom_tx_power_supported: + transceiver_dom_info_dict['tx1power'] = self._convert_string_to_num(dom_channel_monitor_data['data']['TX1Power']['value']) + transceiver_dom_info_dict['tx2power'] = self._convert_string_to_num(dom_channel_monitor_data['data']['TX2Power']['value']) + transceiver_dom_info_dict['tx3power'] = self._convert_string_to_num(dom_channel_monitor_data['data']['TX3Power']['value']) + transceiver_dom_info_dict['tx4power'] = self._convert_string_to_num(dom_channel_monitor_data['data']['TX4Power']['value']) + + if self.dom_rx_power_supported: + transceiver_dom_info_dict['rx1power'] = self._convert_string_to_num(dom_channel_monitor_data['data']['RX1Power']['value']) + transceiver_dom_info_dict['rx2power'] = self._convert_string_to_num(dom_channel_monitor_data['data']['RX2Power']['value']) + transceiver_dom_info_dict['rx3power'] = self._convert_string_to_num(dom_channel_monitor_data['data']['RX3Power']['value']) + transceiver_dom_info_dict['rx4power'] = self._convert_string_to_num(dom_channel_monitor_data['data']['RX4Power']['value']) + + transceiver_dom_info_dict['tx1bias'] = dom_channel_monitor_data['data']['TX1Bias']['value'] + transceiver_dom_info_dict['tx2bias'] = dom_channel_monitor_data['data']['TX2Bias']['value'] + transceiver_dom_info_dict['tx3bias'] = dom_channel_monitor_data['data']['TX3Bias']['value'] + transceiver_dom_info_dict['tx4bias'] = dom_channel_monitor_data['data']['TX4Bias']['value'] + + elif self.sfp_type == QSFP_DD_TYPE: + + offset = 0 + sfpd_obj = qsfp_dd_Dom() + if sfpd_obj is None: + return transceiver_dom_info_dict + + dom_data_raw = self._read_eeprom_specific_bytes((offset + QSFP_DD_DOM_BULK_DATA_START), QSFP_DD_DOM_BULK_DATA_SIZE) + if dom_data_raw is None: + return transceiver_dom_info_dict + + if self.dom_temp_supported: + start = QSFP_DD_TEMPE_OFFSET - QSFP_DD_DOM_BULK_DATA_START + end = start + QSFP_DD_TEMPE_WIDTH + dom_temperature_data = sfpd_obj.parse_temperature(dom_data_raw[start : end], 0) + temp = self._convert_string_to_num(dom_temperature_data['data']['Temperature']['value']) + if temp is not None: + transceiver_dom_info_dict['temperature'] = temp + + if self.dom_volt_supported: + start = QSFP_DD_VOLT_OFFSET - QSFP_DD_DOM_BULK_DATA_START + end = start + QSFP_DD_VOLT_WIDTH + dom_voltage_data = sfpd_obj.parse_voltage(dom_data_raw[start : end], 0) + volt = self._convert_string_to_num(dom_voltage_data['data']['Vcc']['value']) + if volt is not None: + transceiver_dom_info_dict['voltage'] = volt + + if self.dom_rx_tx_power_bias_supported: + # page 11h + offset = 512 + dom_data_raw = self._read_eeprom_specific_bytes(offset + QSFP_DD_CHANNL_MON_OFFSET, QSFP_DD_CHANNL_MON_WIDTH) + if dom_data_raw is None: + return transceiver_dom_info_dict + dom_channel_monitor_data = sfpd_obj.parse_channel_monitor_params(dom_data_raw, 0) + + if self.dom_tx_power_supported: + transceiver_dom_info_dict['tx1power'] = str(self._convert_string_to_num(dom_channel_monitor_data['data']['TX1Power']['value'])) + transceiver_dom_info_dict['tx2power'] = str(self._convert_string_to_num(dom_channel_monitor_data['data']['TX2Power']['value'])) + transceiver_dom_info_dict['tx3power'] = str(self._convert_string_to_num(dom_channel_monitor_data['data']['TX3Power']['value'])) + transceiver_dom_info_dict['tx4power'] = str(self._convert_string_to_num(dom_channel_monitor_data['data']['TX4Power']['value'])) + transceiver_dom_info_dict['tx5power'] = str(self._convert_string_to_num(dom_channel_monitor_data['data']['TX5Power']['value'])) + transceiver_dom_info_dict['tx6power'] = str(self._convert_string_to_num(dom_channel_monitor_data['data']['TX6Power']['value'])) + transceiver_dom_info_dict['tx7power'] = str(self._convert_string_to_num(dom_channel_monitor_data['data']['TX7Power']['value'])) + transceiver_dom_info_dict['tx8power'] = str(self._convert_string_to_num(dom_channel_monitor_data['data']['TX8Power']['value'])) + + if self.dom_rx_power_supported: + transceiver_dom_info_dict['rx1power'] = str(self._convert_string_to_num(dom_channel_monitor_data['data']['RX1Power']['value'])) + transceiver_dom_info_dict['rx2power'] = str(self._convert_string_to_num(dom_channel_monitor_data['data']['RX2Power']['value'])) + transceiver_dom_info_dict['rx3power'] = str(self._convert_string_to_num(dom_channel_monitor_data['data']['RX3Power']['value'])) + transceiver_dom_info_dict['rx4power'] = str(self._convert_string_to_num(dom_channel_monitor_data['data']['RX4Power']['value'])) + transceiver_dom_info_dict['rx5power'] = str(self._convert_string_to_num(dom_channel_monitor_data['data']['RX5Power']['value'])) + transceiver_dom_info_dict['rx6power'] = str(self._convert_string_to_num(dom_channel_monitor_data['data']['RX6Power']['value'])) + transceiver_dom_info_dict['rx7power'] = str(self._convert_string_to_num(dom_channel_monitor_data['data']['RX7Power']['value'])) + transceiver_dom_info_dict['rx8power'] = str(self._convert_string_to_num(dom_channel_monitor_data['data']['RX8Power']['value'])) + + if self.dom_tx_bias_power_supported: + transceiver_dom_info_dict['tx1bias'] = str(dom_channel_monitor_data['data']['TX1Bias']['value']) + transceiver_dom_info_dict['tx2bias'] = str(dom_channel_monitor_data['data']['TX2Bias']['value']) + transceiver_dom_info_dict['tx3bias'] = str(dom_channel_monitor_data['data']['TX3Bias']['value']) + transceiver_dom_info_dict['tx4bias'] = str(dom_channel_monitor_data['data']['TX4Bias']['value']) + transceiver_dom_info_dict['tx5bias'] = str(dom_channel_monitor_data['data']['TX5Bias']['value']) + transceiver_dom_info_dict['tx6bias'] = str(dom_channel_monitor_data['data']['TX6Bias']['value']) + transceiver_dom_info_dict['tx7bias'] = str(dom_channel_monitor_data['data']['TX7Bias']['value']) + transceiver_dom_info_dict['tx8bias'] = str(dom_channel_monitor_data['data']['TX8Bias']['value']) + + return transceiver_dom_info_dict + + else: + if not self.dom_supported: + return transceiver_dom_info_dict + + offset = 256 + sfpd_obj = sff8472Dom() + if sfpd_obj is None: + return transceiver_dom_info_dict + sfpd_obj._calibration_type = self.calibration + + dom_data_raw = self._read_eeprom_specific_bytes((offset + SFP_DOM_BULK_DATA_START), SFP_DOM_BULK_DATA_SIZE) + + start = SFP_TEMPE_OFFSET - SFP_DOM_BULK_DATA_START + end = start + SFP_TEMPE_WIDTH + dom_temperature_data = sfpd_obj.parse_temperature(dom_data_raw[start: end], 0) + + start = SFP_VOLT_OFFSET - SFP_DOM_BULK_DATA_START + end = start + SFP_VOLT_WIDTH + dom_voltage_data = sfpd_obj.parse_voltage(dom_data_raw[start: end], 0) + + start = SFP_CHANNL_MON_OFFSET - SFP_DOM_BULK_DATA_START + end = start + SFP_CHANNL_MON_WIDTH + dom_channel_monitor_data = sfpd_obj.parse_channel_monitor_params(dom_data_raw[start: end], 0) + + transceiver_dom_info_dict['temperature'] = self._convert_string_to_num(dom_temperature_data['data']['Temperature']['value']) + transceiver_dom_info_dict['voltage'] = self._convert_string_to_num(dom_voltage_data['data']['Vcc']['value']) + transceiver_dom_info_dict['rx1power'] = self._convert_string_to_num(dom_channel_monitor_data['data']['RXPower']['value']) + transceiver_dom_info_dict['tx1bias'] = self._convert_string_to_num(dom_channel_monitor_data['data']['TXBias']['value']) + transceiver_dom_info_dict['tx1power'] = self._convert_string_to_num(dom_channel_monitor_data['data']['TXPower']['value']) + + return transceiver_dom_info_dict + + + def get_transceiver_threshold_info(self): + """ + Retrieves transceiver threshold info of this SFP + + Returns: + A dict which contains following keys/values : + ======================================================================== + keys |Value Format |Information + ---------------------------|---------------|---------------------------- + temphighalarm |FLOAT |High Alarm Threshold value of temperature in Celsius. + templowalarm |FLOAT |Low Alarm Threshold value of temperature in Celsius. + temphighwarning |FLOAT |High Warning Threshold value of temperature in Celsius. + templowwarning |FLOAT |Low Warning Threshold value of temperature in Celsius. + vcchighalarm |FLOAT |High Alarm Threshold value of supply voltage in mV. + vcclowalarm |FLOAT |Low Alarm Threshold value of supply voltage in mV. + vcchighwarning |FLOAT |High Warning Threshold value of supply voltage in mV. + vcclowwarning |FLOAT |Low Warning Threshold value of supply voltage in mV. + rxpowerhighalarm |FLOAT |High Alarm Threshold value of received power in dBm. + rxpowerlowalarm |FLOAT |Low Alarm Threshold value of received power in dBm. + rxpowerhighwarning |FLOAT |High Warning Threshold value of received power in dBm. + rxpowerlowwarning |FLOAT |Low Warning Threshold value of received power in dBm. + txpowerhighalarm |FLOAT |High Alarm Threshold value of transmit power in dBm. + txpowerlowalarm |FLOAT |Low Alarm Threshold value of transmit power in dBm. + txpowerhighwarning |FLOAT |High Warning Threshold value of transmit power in dBm. + txpowerlowwarning |FLOAT |Low Warning Threshold value of transmit power in dBm. + txbiashighalarm |FLOAT |High Alarm Threshold value of tx Bias Current in mA. + txbiaslowalarm |FLOAT |Low Alarm Threshold value of tx Bias Current in mA. + txbiashighwarning |FLOAT |High Warning Threshold value of tx Bias Current in mA. + txbiaslowwarning |FLOAT |Low Warning Threshold value of tx Bias Current in mA. + ======================================================================== + """ + transceiver_dom_threshold_info_dict = {} + + dom_info_dict_keys = ['temphighalarm', 'temphighwarning', + 'templowalarm', 'templowwarning', + 'vcchighalarm', 'vcchighwarning', + 'vcclowalarm', 'vcclowwarning', + 'rxpowerhighalarm', 'rxpowerhighwarning', + 'rxpowerlowalarm', 'rxpowerlowwarning', + 'txpowerhighalarm', 'txpowerhighwarning', + 'txpowerlowalarm', 'txpowerlowwarning', + 'txbiashighalarm', 'txbiashighwarning', + 'txbiaslowalarm', 'txbiaslowwarning' + ] + transceiver_dom_threshold_info_dict = dict.fromkeys(dom_info_dict_keys, 'N/A') + + if self.sfp_type == OSFP_TYPE: + pass + + elif self.sfp_type == QSFP_TYPE: + if not self.dom_supported or not self.qsfp_page3_available: + return transceiver_dom_threshold_info_dict + + # Dom Threshold data starts from offset 384 + # Revert offset back to 0 once data is retrieved + offset = QSFP_MODULE_UPPER_PAGE3_START + sfpd_obj = sff8436Dom() + if sfpd_obj is None: + return transceiver_dom_threshold_info_dict + + dom_module_threshold_raw = self._read_eeprom_specific_bytes((offset + QSFP_MODULE_THRESHOLD_OFFSET), QSFP_MODULE_THRESHOLD_WIDTH) + if dom_module_threshold_raw is None: + return transceiver_dom_threshold_info_dict + + dom_module_threshold_data = sfpd_obj.parse_module_threshold_values(dom_module_threshold_raw, 0) + + dom_channel_threshold_raw = self._read_eeprom_specific_bytes((offset + QSFP_CHANNL_THRESHOLD_OFFSET), + QSFP_CHANNL_THRESHOLD_WIDTH) + if dom_channel_threshold_raw is None: + return transceiver_dom_threshold_info_dict + dom_channel_threshold_data = sfpd_obj.parse_channel_threshold_values(dom_channel_threshold_raw, 0) + + # Threshold Data + transceiver_dom_threshold_info_dict['temphighalarm'] = dom_module_threshold_data['data']['TempHighAlarm']['value'] + transceiver_dom_threshold_info_dict['temphighwarning'] = dom_module_threshold_data['data']['TempHighWarning']['value'] + transceiver_dom_threshold_info_dict['templowalarm'] = dom_module_threshold_data['data']['TempLowAlarm']['value'] + transceiver_dom_threshold_info_dict['templowwarning'] = dom_module_threshold_data['data']['TempLowWarning']['value'] + transceiver_dom_threshold_info_dict['vcchighalarm'] = dom_module_threshold_data['data']['VccHighAlarm']['value'] + transceiver_dom_threshold_info_dict['vcchighwarning'] = dom_module_threshold_data['data']['VccHighWarning']['value'] + transceiver_dom_threshold_info_dict['vcclowalarm'] = dom_module_threshold_data['data']['VccLowAlarm']['value'] + transceiver_dom_threshold_info_dict['vcclowwarning'] = dom_module_threshold_data['data']['VccLowWarning']['value'] + transceiver_dom_threshold_info_dict['rxpowerhighalarm'] = dom_channel_threshold_data['data']['RxPowerHighAlarm']['value'] + transceiver_dom_threshold_info_dict['rxpowerhighwarning'] = dom_channel_threshold_data['data']['RxPowerHighWarning']['value'] + transceiver_dom_threshold_info_dict['rxpowerlowalarm'] = dom_channel_threshold_data['data']['RxPowerLowAlarm']['value'] + transceiver_dom_threshold_info_dict['rxpowerlowwarning'] = dom_channel_threshold_data['data']['RxPowerLowWarning']['value'] + transceiver_dom_threshold_info_dict['txbiashighalarm'] = dom_channel_threshold_data['data']['TxBiasHighAlarm']['value'] + transceiver_dom_threshold_info_dict['txbiashighwarning'] = dom_channel_threshold_data['data']['TxBiasHighWarning']['value'] + transceiver_dom_threshold_info_dict['txbiaslowalarm'] = dom_channel_threshold_data['data']['TxBiasLowAlarm']['value'] + transceiver_dom_threshold_info_dict['txbiaslowwarning'] = dom_channel_threshold_data['data']['TxBiasLowWarning']['value'] + transceiver_dom_threshold_info_dict['txpowerhighalarm'] = dom_channel_threshold_data['data']['TxPowerHighAlarm']['value'] + transceiver_dom_threshold_info_dict['txpowerhighwarning'] = dom_channel_threshold_data['data']['TxPowerHighWarning']['value'] + transceiver_dom_threshold_info_dict['txpowerlowalarm'] = dom_channel_threshold_data['data']['TxPowerLowAlarm']['value'] + transceiver_dom_threshold_info_dict['txpowerlowwarning'] = dom_channel_threshold_data['data']['TxPowerLowWarning']['value'] + + elif self.sfp_type == QSFP_DD_TYPE: + if not self.dom_supported: + return transceiver_dom_threshold_info_dict + + if not self.dom_thresholds_supported: + return transceiver_dom_threshold_info_dict + + sfpd_obj = qsfp_dd_Dom() + if sfpd_obj is None: + return transceiver_dom_threshold_info_dict + + # page 02 + offset = 384 + dom_module_threshold_raw = self._read_eeprom_specific_bytes((offset + QSFP_DD_MODULE_THRESHOLD_OFFSET), QSFP_DD_MODULE_THRESHOLD_WIDTH) + if dom_module_threshold_raw is None: + return transceiver_dom_threshold_info_dict + + dom_module_threshold_data = sfpd_obj.parse_module_threshold_values(dom_module_threshold_raw, 0) + + # Threshold Data + transceiver_dom_threshold_info_dict['temphighalarm'] = dom_module_threshold_data['data']['TempHighAlarm']['value'] + transceiver_dom_threshold_info_dict['temphighwarning'] = dom_module_threshold_data['data']['TempHighWarning']['value'] + transceiver_dom_threshold_info_dict['templowalarm'] = dom_module_threshold_data['data']['TempLowAlarm']['value'] + transceiver_dom_threshold_info_dict['templowwarning'] = dom_module_threshold_data['data']['TempLowWarning']['value'] + transceiver_dom_threshold_info_dict['vcchighalarm'] = dom_module_threshold_data['data']['VccHighAlarm']['value'] + transceiver_dom_threshold_info_dict['vcchighwarning'] = dom_module_threshold_data['data']['VccHighWarning']['value'] + transceiver_dom_threshold_info_dict['vcclowalarm'] = dom_module_threshold_data['data']['VccLowAlarm']['value'] + transceiver_dom_threshold_info_dict['vcclowwarning'] = dom_module_threshold_data['data']['VccLowWarning']['value'] + transceiver_dom_threshold_info_dict['rxpowerhighalarm'] = dom_module_threshold_data['data']['RxPowerHighAlarm']['value'] + transceiver_dom_threshold_info_dict['rxpowerhighwarning'] = dom_module_threshold_data['data']['RxPowerHighWarning']['value'] + transceiver_dom_threshold_info_dict['rxpowerlowalarm'] = dom_module_threshold_data['data']['RxPowerLowAlarm']['value'] + transceiver_dom_threshold_info_dict['rxpowerlowwarning'] = dom_module_threshold_data['data']['RxPowerLowWarning']['value'] + transceiver_dom_threshold_info_dict['txbiashighalarm'] = dom_module_threshold_data['data']['TxBiasHighAlarm']['value'] + transceiver_dom_threshold_info_dict['txbiashighwarning'] = dom_module_threshold_data['data']['TxBiasHighWarning']['value'] + transceiver_dom_threshold_info_dict['txbiaslowalarm'] = dom_module_threshold_data['data']['TxBiasLowAlarm']['value'] + transceiver_dom_threshold_info_dict['txbiaslowwarning'] = dom_module_threshold_data['data']['TxBiasLowWarning']['value'] + transceiver_dom_threshold_info_dict['txpowerhighalarm'] = dom_module_threshold_data['data']['TxPowerHighAlarm']['value'] + transceiver_dom_threshold_info_dict['txpowerhighwarning'] = dom_module_threshold_data['data']['TxPowerHighWarning']['value'] + transceiver_dom_threshold_info_dict['txpowerlowalarm'] = dom_module_threshold_data['data']['TxPowerLowAlarm']['value'] + transceiver_dom_threshold_info_dict['txpowerlowwarning'] = dom_module_threshold_data['data']['TxPowerLowWarning']['value'] + + else: + offset = SFP_MODULE_ADDRA2_OFFSET + + if not self.dom_supported: + return transceiver_dom_threshold_info_dict + + sfpd_obj = sff8472Dom(None, self.calibration) + if sfpd_obj is None: + return transceiver_dom_threshold_info_dict + + dom_module_threshold_raw = self._read_eeprom_specific_bytes((offset + SFP_MODULE_THRESHOLD_OFFSET), + SFP_MODULE_THRESHOLD_WIDTH) + if dom_module_threshold_raw is not None: + dom_module_threshold_data = sfpd_obj.parse_alarm_warning_threshold(dom_module_threshold_raw, 0) + else: + return transceiver_dom_threshold_info_dict + + # Threshold Data + transceiver_dom_threshold_info_dict['temphighalarm'] = dom_module_threshold_data['data']['TempHighAlarm']['value'] + transceiver_dom_threshold_info_dict['templowalarm'] = dom_module_threshold_data['data']['TempLowAlarm']['value'] + transceiver_dom_threshold_info_dict['temphighwarning'] = dom_module_threshold_data['data']['TempHighWarning']['value'] + transceiver_dom_threshold_info_dict['templowwarning'] = dom_module_threshold_data['data']['TempLowWarning']['value'] + transceiver_dom_threshold_info_dict['vcchighalarm'] = dom_module_threshold_data['data']['VoltageHighAlarm']['value'] + transceiver_dom_threshold_info_dict['vcclowalarm'] = dom_module_threshold_data['data']['VoltageLowAlarm']['value'] + transceiver_dom_threshold_info_dict['vcchighwarning'] = dom_module_threshold_data['data']['VoltageHighWarning']['value'] + transceiver_dom_threshold_info_dict['vcclowwarning'] = dom_module_threshold_data['data']['VoltageLowWarning']['value'] + transceiver_dom_threshold_info_dict['txbiashighalarm'] = dom_module_threshold_data['data']['BiasHighAlarm']['value'] + transceiver_dom_threshold_info_dict['txbiaslowalarm'] = dom_module_threshold_data['data']['BiasLowAlarm']['value'] + transceiver_dom_threshold_info_dict['txbiashighwarning'] = dom_module_threshold_data['data']['BiasHighWarning']['value'] + transceiver_dom_threshold_info_dict['txbiaslowwarning'] = dom_module_threshold_data['data']['BiasLowWarning']['value'] + transceiver_dom_threshold_info_dict['txpowerhighalarm'] = dom_module_threshold_data['data']['TXPowerHighAlarm']['value'] + transceiver_dom_threshold_info_dict['txpowerlowalarm'] = dom_module_threshold_data['data']['TXPowerLowAlarm']['value'] + transceiver_dom_threshold_info_dict['txpowerhighwarning'] = dom_module_threshold_data['data']['TXPowerHighWarning']['value'] + transceiver_dom_threshold_info_dict['txpowerlowwarning'] = dom_module_threshold_data['data']['TXPowerLowWarning']['value'] + transceiver_dom_threshold_info_dict['rxpowerhighalarm'] = dom_module_threshold_data['data']['RXPowerHighAlarm']['value'] + transceiver_dom_threshold_info_dict['rxpowerlowalarm'] = dom_module_threshold_data['data']['RXPowerLowAlarm']['value'] + transceiver_dom_threshold_info_dict['rxpowerhighwarning'] = dom_module_threshold_data['data']['RXPowerHighWarning']['value'] + transceiver_dom_threshold_info_dict['rxpowerlowwarning'] = dom_module_threshold_data['data']['RXPowerLowWarning']['value'] + + return transceiver_dom_threshold_info_dict + + def get_reset_status(self): + """ + Retrieves the reset status of SFP + Returns: + A Boolean, True if reset enabled, False if disabled + """ + # SFP doesn't support this feature + if self.sfp_type == SFP_TYPE: + return False + elif self.sfp_type == QSFP_TYPE: + return False + elif self.sfp_type == OSFP_TYPE or self.sfp_type == QSFP_DD_TYPE: + try: + reg_file = open(self.reset_path) + except IOError as e: + print ("Error: unable to open file: %s" % str(e)) + return None + reg_value = int(reg_file.readline().rstrip()) + reg_file.close() + if reg_value == 0: + return True + else: + return False + else: + return None + + def get_rx_los(self): + """ + Retrieves the RX LOS (lost-of-signal) status of SFP + + Returns: + A Boolean, True if SFP has RX LOS, False if not. + Note : RX LOS status is latched until a call to get_rx_los or a reset. + """ + if not self.dom_supported: + return None + + rx_los_list = [] + if self.sfp_type == OSFP_TYPE: + return None + elif self.sfp_type == QSFP_TYPE: + offset = 0 + dom_channel_monitor_raw = self._read_eeprom_specific_bytes((offset + QSFP_CHANNL_RX_LOS_STATUS_OFFSET), QSFP_CHANNL_RX_LOS_STATUS_WIDTH) + if dom_channel_monitor_raw is not None: + rx_los_data = int(dom_channel_monitor_raw[0], 16) + rx_los_list.append(rx_los_data & 0x01 != 0) + rx_los_list.append(rx_los_data & 0x02 != 0) + rx_los_list.append(rx_los_data & 0x04 != 0) + rx_los_list.append(rx_los_data & 0x08 != 0) + + elif self.sfp_type == QSFP_DD_TYPE: + # page 11h + if self.dom_rx_tx_power_bias_supported: + offset = 512 + dom_channel_monitor_raw = self._read_eeprom_specific_bytes((offset + QSFP_DD_CHANNL_RX_LOS_STATUS_OFFSET), QSFP_DD_CHANNL_RX_LOS_STATUS_WIDTH) + if dom_channel_monitor_raw is not None: + rx_los_data = int(dom_channel_monitor_raw[0], 8) + rx_los_list.append(rx_los_data & 0x01 != 0) + rx_los_list.append(rx_los_data & 0x02 != 0) + rx_los_list.append(rx_los_data & 0x04 != 0) + rx_los_list.append(rx_los_data & 0x08 != 0) + rx_los_list.append(rx_los_data & 0x10 != 0) + rx_los_list.append(rx_los_data & 0x20 != 0) + rx_los_list.append(rx_los_data & 0x40 != 0) + rx_los_list.append(rx_los_data & 0x80 != 0) + + else: + offset = 256 + dom_channel_monitor_raw = self._read_eeprom_specific_bytes((offset + SFP_CHANNL_STATUS_OFFSET), SFP_CHANNL_STATUS_WIDTH) + if dom_channel_monitor_raw is not None: + rx_los_data = int(dom_channel_monitor_raw[0], 16) + rx_los_list.append(rx_los_data & 0x02 != 0) + else: + return None + return rx_los_list + + + def get_tx_fault(self): + """ + Retrieves the TX fault status of SFP + + Returns: + A Boolean, True if SFP has TX fault, False if not + Note : TX fault status is lached until a call to get_tx_fault or a reset. + """ + if not self.dom_supported: + return None + + tx_fault_list = [] + if self.sfp_type == OSFP_TYPE: + return None + elif self.sfp_type == QSFP_TYPE: + offset = 0 + dom_channel_monitor_raw = self._read_eeprom_specific_bytes((offset + QSFP_CHANNL_TX_FAULT_STATUS_OFFSET), QSFP_CHANNL_TX_FAULT_STATUS_WIDTH) + if dom_channel_monitor_raw is not None: + tx_fault_data = int(dom_channel_monitor_raw[0], 16) + tx_fault_list.append(tx_fault_data & 0x01 != 0) + tx_fault_list.append(tx_fault_data & 0x02 != 0) + tx_fault_list.append(tx_fault_data & 0x04 != 0) + tx_fault_list.append(tx_fault_data & 0x08 != 0) + + elif self.sfp_type == QSFP_DD_TYPE: + return None + # page 11h + #if self.dom_rx_tx_power_bias_supported: + # offset = 512 + # dom_channel_monitor_raw = self._read_eeprom_specific_bytes((offset + QSFP_DD_CHANNL_TX_FAULT_STATUS_OFFSET), QSFP_DD_CHANNL_TX_FAULT_STATUS_WIDTH) + # if dom_channel_monitor_raw is not None: + # tx_fault_data = int(dom_channel_monitor_raw[0], 8) + # tx_fault_list.append(tx_fault_data & 0x01 != 0) + # tx_fault_list.append(tx_fault_data & 0x02 != 0) + # tx_fault_list.append(tx_fault_data & 0x04 != 0) + # tx_fault_list.append(tx_fault_data & 0x08 != 0) + # tx_fault_list.append(tx_fault_data & 0x10 != 0) + # tx_fault_list.append(tx_fault_data & 0x20 != 0) + # tx_fault_list.append(tx_fault_data & 0x40 != 0) + # tx_fault_list.append(tx_fault_data & 0x80 != 0) + + else: + offset = 256 + dom_channel_monitor_raw = self._read_eeprom_specific_bytes((offset + SFP_CHANNL_STATUS_OFFSET), SFP_CHANNL_STATUS_WIDTH) + if dom_channel_monitor_raw is not None: + tx_fault_data = int(dom_channel_monitor_raw[0], 16) + tx_fault_list.append(tx_fault_data & 0x04 != 0) + else: + return None + return tx_fault_list + + + def get_tx_disable(self): + """ + Retrieves the tx_disable status of this SFP + + Returns: + A Boolean, True if tx_disable is enabled, False if disabled + + for QSFP, the disable states of each channel which are the lower 4 bits in byte 85 page a0 + for SFP, the TX Disable State and Soft TX Disable Select is ORed as the tx_disable status returned + These two bits are bit 7 & 6 in byte 110 page a2 respectively + """ + if not self.dom_supported: + return None + + tx_disable_list = [] + if self.sfp_type == OSFP_TYPE: + return None + elif self.sfp_type == QSFP_TYPE: + offset = 0 + dom_channel_monitor_raw = self._read_eeprom_specific_bytes((offset + QSFP_CHANNL_DISABLE_STATUS_OFFSET), QSFP_CHANNL_DISABLE_STATUS_WIDTH) + if dom_channel_monitor_raw is not None: + tx_disable_data = int(dom_channel_monitor_raw[0], 16) + tx_disable_list.append(tx_disable_data & 0x01 != 0) + tx_disable_list.append(tx_disable_data & 0x02 != 0) + tx_disable_list.append(tx_disable_data & 0x04 != 0) + tx_disable_list.append(tx_disable_data & 0x08 != 0) + + elif self.sfp_type == QSFP_DD_TYPE: + if self.dom_rx_tx_power_bias_supported: + offset = 128 + dom_channel_monitor_raw = self._read_eeprom_specific_bytes((offset + QSFP_DD_CHANNL_DISABLE_STATUS_OFFSET), QSFP_DD_CHANNL_DISABLE_STATUS_WIDTH) + if dom_channel_monitor_raw is not None: + tx_disable_data = int(dom_channel_monitor_raw[0], 16) + tx_disable_list.append(tx_disable_data & 0x01 != 0) + tx_disable_list.append(tx_disable_data & 0x02 != 0) + tx_disable_list.append(tx_disable_data & 0x04 != 0) + tx_disable_list.append(tx_disable_data & 0x08 != 0) + tx_disable_list.append(tx_disable_data & 0x10 != 0) + tx_disable_list.append(tx_disable_data & 0x20 != 0) + tx_disable_list.append(tx_disable_data & 0x40 != 0) + tx_disable_list.append(tx_disable_data & 0x80 != 0) + + else: + offset = 256 + dom_channel_monitor_raw = self._read_eeprom_specific_bytes((offset + SFP_CHANNL_STATUS_OFFSET), SFP_CHANNL_STATUS_WIDTH) + if dom_channel_monitor_raw is not None: + tx_disable_data = int(dom_channel_monitor_raw[0], 16) + tx_disable_list.append(tx_disable_data & 0xC0 != 0) + else: + return None + return tx_disable_list + + + def get_tx_disable_channel(self): + """ + Retrieves the TX disabled channels in this SFP + Returns: + A hex of 4 bits (bit 0 to bit 3 as channel 0 to channel 3) to represent + TX channels which have been disabled in this SFP. + As an example, a returned value of 0x5 indicates that channel 0 + and channel 2 have been disabled. + """ + # SFP doesn't support this feature + if self.sfp_type == SFP_TYPE: + return 0 + elif self.sfp_type == QSFP_TYPE: + tx_disable_list = self.get_tx_disable() + if tx_disable_list is None: + return 0 + tx_disabled = 0 + for i in range(len(tx_disable_list)): + if tx_disable_list[i]: + tx_disabled |= 1 << i + else: + return None + + return tx_disabled + + def get_lpmode(self): + """ + Retrieves the lpmode (low power mode) status of this QSFP module + Returns: + A Boolean, True if lpmode is enabled, False if disabled + """ + # SFP doesn't support this feature + if self.sfp_type == SFP_TYPE: + return False + elif self.sfp_type == QSFP_TYPE: + return False + elif self.sfp_type == OSFP_TYPE: + try: + reg_file = open(self.lpmode_path) + except IOError as e: + print ("Error: unable to open file: %s" % str(e)) + return False + reg_value = int(reg_file.readline().rstrip()) + reg_file.close() + if reg_value == 0: + return False + else: + return True + else: + return None + + def get_power_override(self): + """ + Retrieves the power-override status of this SFP + Returns: + A Boolean, True if power-override is enabled, False if disabled + """ + # SFP doesn't support this feature + if self.sfp_type == SFP_TYPE: + return False + elif self.sfp_type == QSFP_TYPE: + offset = 0 + sfpd_obj = sff8436Dom() + if sfpd_obj is None: + return False + + dom_control_raw = self._read_eeprom_specific_bytes( + (offset + QSFP_POWEROVERRIDE_OFFSET), QSFP_POWEROVERRIDE_WIDTH) + if dom_control_raw is not None: + if int(dom_control_raw[0],16) & (0x01 << QSFP_POWEROVERRIDE_BIT): + return True + else: + return False + else: + return None + + def get_temperature(self): + """ + Retrieves the temperature of this SFP + + Returns: + An integer number of current temperature in Celsius + """ + if not self.dom_supported: + return None + if self.sfp_type == QSFP_TYPE: + offset = 0 + + sfpd_obj = sff8436Dom() + if sfpd_obj is None: + return None + + if self.dom_temp_supported: + dom_temperature_raw = self._read_eeprom_specific_bytes((offset + QSFP_TEMPE_OFFSET), QSFP_TEMPE_WIDTH) + if dom_temperature_raw is not None: + dom_temperature_data = sfpd_obj.parse_temperature(dom_temperature_raw, 0) + temp = self._convert_string_to_num(dom_temperature_data['data']['Temperature']['value']) + return temp + else: + return None + else: + return None + + elif self.sfp_type == QSFP_DD_TYPE: + offset = 0 + + sfpd_obj = qsfp_dd_Dom() + if sfpd_obj is None: + return None + + if self.dom_temp_supported: + dom_temperature_raw = self._read_eeprom_specific_bytes((offset + QSFP_DD_TEMPE_OFFSET), QSFP_DD_TEMPE_WIDTH) + if dom_temperature_raw is not None: + dom_temperature_data = sfpd_obj.parse_temperature(dom_temperature_raw, 0) + temp = self._convert_string_to_num(dom_temperature_data['data']['Temperature']['value']) + return temp + return None + + else: + offset = 256 + sfpd_obj = sff8472Dom() + if sfpd_obj is None: + return None + sfpd_obj._calibration_type = 1 + + dom_temperature_raw = self._read_eeprom_specific_bytes((offset + SFP_TEMPE_OFFSET), SFP_TEMPE_WIDTH) + if dom_temperature_raw is not None: + dom_temperature_data = sfpd_obj.parse_temperature(dom_temperature_raw, 0) + temp = self._convert_string_to_num(dom_temperature_data['data']['Temperature']['value']) + return temp + else: + return None + + + def get_voltage(self): + """ + Retrieves the supply voltage of this SFP + + Returns: + An integer number of supply voltage in mV + """ + if not self.dom_supported: + return None + if self.sfp_type == QSFP_TYPE: + offset = 0 + + sfpd_obj = sff8436Dom() + if sfpd_obj is None: + return None + + if self.dom_volt_supported: + dom_voltage_raw = self._read_eeprom_specific_bytes((offset + QSFP_VOLT_OFFSET), QSFP_VOLT_WIDTH) + if dom_voltage_raw is not None: + dom_voltage_data = sfpd_obj.parse_voltage(dom_voltage_raw, 0) + voltage = self._convert_string_to_num(dom_voltage_data['data']['Vcc']['value']) + return voltage + else: + return None + return None + + if self.sfp_type == QSFP_DD_TYPE: + offset = 128 + + sfpd_obj = qsfp_dd_Dom() + if sfpd_obj is None: + return None + + if self.dom_volt_supported: + dom_voltage_raw = self._read_eeprom_specific_bytes((offset + QSFP_DD_VOLT_OFFSET), QSFP_DD_VOLT_WIDTH) + if dom_voltage_raw is not None: + dom_voltage_data = sfpd_obj.parse_voltage(dom_voltage_raw, 0) + voltage = self._convert_string_to_num(dom_voltage_data['data']['Vcc']['value']) + return voltage + return None + + else: + offset = 256 + + sfpd_obj = sff8472Dom() + if sfpd_obj is None: + return None + + sfpd_obj._calibration_type = self.calibration + + dom_voltage_raw = self._read_eeprom_specific_bytes((offset + SFP_VOLT_OFFSET), SFP_VOLT_WIDTH) + if dom_voltage_raw is not None: + dom_voltage_data = sfpd_obj.parse_voltage(dom_voltage_raw, 0) + voltage = self._convert_string_to_num(dom_voltage_data['data']['Vcc']['value']) + return voltage + else: + return None + + + def get_tx_bias(self): + """ + Retrieves the TX bias current of this SFP + + Returns: + A list of four integer numbers, representing TX bias in mA + for channel 0 to channel 4. + Ex. ['110.09', '111.12', '108.21', '112.09'] + """ + tx_bias_list = [] + if self.sfp_type == QSFP_TYPE: + offset = 0 + + sfpd_obj = sff8436Dom() + if sfpd_obj is None: + return None + + dom_channel_monitor_raw = self._read_eeprom_specific_bytes((offset + QSFP_CHANNL_MON_OFFSET), QSFP_CHANNL_MON_WITH_TX_POWER_WIDTH) + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = sfpd_obj.parse_channel_monitor_params_with_tx_power(dom_channel_monitor_raw, 0) + tx_bias_list.append(self._convert_string_to_num(dom_channel_monitor_data['data']['TX1Bias']['value'])) + tx_bias_list.append(self._convert_string_to_num(dom_channel_monitor_data['data']['TX2Bias']['value'])) + tx_bias_list.append(self._convert_string_to_num(dom_channel_monitor_data['data']['TX3Bias']['value'])) + tx_bias_list.append(self._convert_string_to_num(dom_channel_monitor_data['data']['TX4Bias']['value'])) + + elif self.sfp_type == QSFP_DD_TYPE: + # page 11h + if self.dom_rx_tx_power_bias_supported: + offset = 512 + sfpd_obj = qsfp_dd_Dom() + if sfpd_obj is None: + return None + + if self.dom_tx_bias_power_supported: + dom_tx_bias_raw = self._read_eeprom_specific_bytes((offset + QSFP_DD_TX_BIAS_OFFSET), QSFP_DD_TX_BIAS_WIDTH) + if dom_tx_bias_raw is not None: + dom_tx_bias_data = sfpd_obj.parse_dom_tx_bias(dom_tx_bias_raw, 0) + tx_bias_list.append(self._convert_string_to_num(dom_tx_bias_data['data']['TX1Bias']['value'])) + tx_bias_list.append(self._convert_string_to_num(dom_tx_bias_data['data']['TX2Bias']['value'])) + tx_bias_list.append(self._convert_string_to_num(dom_tx_bias_data['data']['TX3Bias']['value'])) + tx_bias_list.append(self._convert_string_to_num(dom_tx_bias_data['data']['TX4Bias']['value'])) + tx_bias_list.append(self._convert_string_to_num(dom_tx_bias_data['data']['TX5Bias']['value'])) + tx_bias_list.append(self._convert_string_to_num(dom_tx_bias_data['data']['TX6Bias']['value'])) + tx_bias_list.append(self._convert_string_to_num(dom_tx_bias_data['data']['TX7Bias']['value'])) + tx_bias_list.append(self._convert_string_to_num(dom_tx_bias_data['data']['TX8Bias']['value'])) + + else: + offset = 256 + + sfpd_obj = sff8472Dom() + if sfpd_obj is None: + return None + sfpd_obj._calibration_type = self.calibration + + if self.dom_supported: + dom_channel_monitor_raw = self._read_eeprom_specific_bytes((offset + SFP_CHANNL_MON_OFFSET), SFP_CHANNL_MON_WIDTH) + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = sfpd_obj.parse_channel_monitor_params(dom_channel_monitor_raw, 0) + tx_bias_list.append(self._convert_string_to_num(dom_channel_monitor_data['data']['TXBias']['value'])) + else: + return None + else: + return None + + return tx_bias_list + + + def get_rx_power(self): + """ + Retrieves the received optical power for this SFP + + Returns: + A list of four integer numbers, representing received optical + power in mW for channel 0 to channel 4. + Ex. ['1.77', '1.71', '1.68', '1.70'] + """ + rx_power_list = [] + if self.sfp_type == OSFP_TYPE: + # OSFP not supported on our platform yet. + return None + + elif self.sfp_type == QSFP_TYPE: + offset = 0 + + sfpd_obj = sff8436Dom() + if sfpd_obj is None: + return None + + if self.dom_rx_power_supported: + dom_channel_monitor_raw = self._read_eeprom_specific_bytes((offset + QSFP_CHANNL_MON_OFFSET), QSFP_CHANNL_MON_WITH_TX_POWER_WIDTH) + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = sfpd_obj.parse_channel_monitor_params_with_tx_power(dom_channel_monitor_raw, 0) + rx_power_list.append(self._convert_string_to_num(dom_channel_monitor_data['data']['RX1Power']['value'])) + rx_power_list.append(self._convert_string_to_num(dom_channel_monitor_data['data']['RX2Power']['value'])) + rx_power_list.append(self._convert_string_to_num(dom_channel_monitor_data['data']['RX3Power']['value'])) + rx_power_list.append(self._convert_string_to_num(dom_channel_monitor_data['data']['RX4Power']['value'])) + else: + return None + else: + return None + + elif self.sfp_type == QSFP_DD_TYPE: + # page 11 + if self.dom_rx_tx_power_bias_supported: + offset = 512 + sfpd_obj = qsfp_dd_Dom() + if sfpd_obj is None: + return None + + if self.dom_rx_power_supported: + dom_rx_power_raw = self._read_eeprom_specific_bytes((offset + QSFP_DD_RX_POWER_OFFSET), QSFP_DD_RX_POWER_WIDTH) + if dom_rx_power_raw is not None: + dom_rx_power_data = sfpd_obj.parse_dom_rx_power(dom_rx_power_raw, 0) + rx_power_list.append(self._convert_string_to_num(dom_rx_power_data['data']['RX1Power']['value'])) + rx_power_list.append(self._convert_string_to_num(dom_rx_power_data['data']['RX2Power']['value'])) + rx_power_list.append(self._convert_string_to_num(dom_rx_power_data['data']['RX3Power']['value'])) + rx_power_list.append(self._convert_string_to_num(dom_rx_power_data['data']['RX4Power']['value'])) + rx_power_list.append(self._convert_string_to_num(dom_rx_power_data['data']['RX5Power']['value'])) + rx_power_list.append(self._convert_string_to_num(dom_rx_power_data['data']['RX6Power']['value'])) + rx_power_list.append(self._convert_string_to_num(dom_rx_power_data['data']['RX7Power']['value'])) + rx_power_list.append(self._convert_string_to_num(dom_rx_power_data['data']['RX8Power']['value'])) + + else: + offset = 256 + + sfpd_obj = sff8472Dom() + if sfpd_obj is None: + return None + + if self.dom_supported: + sfpd_obj._calibration_type = self.calibration + + dom_channel_monitor_raw = self._read_eeprom_specific_bytes((offset + SFP_CHANNL_MON_OFFSET), SFP_CHANNL_MON_WIDTH) + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = sfpd_obj.parse_channel_monitor_params(dom_channel_monitor_raw, 0) + rx_power_list.append(self._convert_string_to_num(dom_channel_monitor_data['data']['RXPower']['value'])) + else: + return None + else: + return None + return rx_power_list + + + def get_tx_power(self): + """ + Retrieves the TX power of this SFP + + Returns: + A list of four integer numbers, representing TX power in mW + for channel 0 to channel 4. + Ex. ['1.86', '1.86', '1.86', '1.86'] + """ + tx_power_list = [] + if self.sfp_type == OSFP_TYPE: + # OSFP not supported on our platform yet. + return None + + elif self.sfp_type == QSFP_TYPE: + offset = 0 + + sfpd_obj = sff8436Dom() + if sfpd_obj is None: + return None + + if self.dom_tx_power_supported: + dom_channel_monitor_raw = self._read_eeprom_specific_bytes((offset + QSFP_CHANNL_MON_OFFSET), QSFP_CHANNL_MON_WITH_TX_POWER_WIDTH) + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = sfpd_obj.parse_channel_monitor_params_with_tx_power(dom_channel_monitor_raw, 0) + tx_power_list.append(self._convert_string_to_num(dom_channel_monitor_data['data']['TX1Power']['value'])) + tx_power_list.append(self._convert_string_to_num(dom_channel_monitor_data['data']['TX2Power']['value'])) + tx_power_list.append(self._convert_string_to_num(dom_channel_monitor_data['data']['TX3Power']['value'])) + tx_power_list.append(self._convert_string_to_num(dom_channel_monitor_data['data']['TX4Power']['value'])) + else: + return None + else: + return None + + elif self.sfp_type == QSFP_DD_TYPE: + return None + # page 11 + #if self.dom_rx_tx_power_bias_supported: + # offset = 512 + # sfpd_obj = qsfp_dd_Dom() + # if sfpd_obj is None: + # return None + # + # if self.dom_tx_power_supported: + # dom_tx_power_raw = self._read_eeprom_specific_bytes((offset + QSFP_DD_TX_POWER_OFFSET), QSFP_DD_TX_POWER_WIDTH) + # if dom_tx_power_raw is not None: + # dom_tx_power_data = sfpd_obj.parse_dom_tx_power(dom_tx_power_raw, 0) + # tx_power_list.append(self._convert_string_to_num(dom_tx_power_data['data']['TX1Power']['value'])) + # tx_power_list.append(self._convert_string_to_num(dom_tx_power_data['data']['TX2Power']['value'])) + # tx_power_list.append(self._convert_string_to_num(dom_tx_power_data['data']['TX3Power']['value'])) + # tx_power_list.append(self._convert_string_to_num(dom_tx_power_data['data']['TX4Power']['value'])) + # tx_power_list.append(self._convert_string_to_num(dom_tx_power_data['data']['TX5Power']['value'])) + # tx_power_list.append(self._convert_string_to_num(dom_tx_power_data['data']['TX6Power']['value'])) + # tx_power_list.append(self._convert_string_to_num(dom_tx_power_data['data']['TX7Power']['value'])) + # tx_power_list.append(self._convert_string_to_num(dom_tx_power_data['data']['TX8Power']['value'])) + + else: + offset = 256 + sfpd_obj = sff8472Dom() + if sfpd_obj is None: + return None + + if self.dom_supported: + sfpd_obj._calibration_type = self.calibration + + dom_channel_monitor_raw = self._read_eeprom_specific_bytes((offset + SFP_CHANNL_MON_OFFSET), SFP_CHANNL_MON_WIDTH) + if dom_channel_monitor_raw is not None: + dom_channel_monitor_data = sfpd_obj.parse_channel_monitor_params(dom_channel_monitor_raw, 0) + tx_power_list.append(self._convert_string_to_num(dom_channel_monitor_data['data']['TXPower']['value'])) + else: + return None + else: + return None + return tx_power_list + + + def reset(self): + """ + Reset SFP and return all user module settings to their default state. + Returns: + A boolean, True if successful, False if not + """ + if not self.get_presence(): + return False + + # SFP doesn't support this feature + if self.sfp_type == SFP_TYPE: + return False + elif self.sfp_type == QSFP_TYPE: + return False + elif self.sfp_type == OSFP_TYPE: + try: + reg_file = open(self.reset_path, "r+") + except IOError as e: + print ("Error: unable to open file: %s" % str(e)) + return False + + reg_value = 0 + reg_file.write(hex(reg_value)) + reg_file.close() + + # Sleep 2 second to allow it to settle + time.sleep(2) + + # Flip the value back write back to the register to take port out of reset + try: + reg_file = open(self.reset_path, "r+") + except IOError as e: + print ("Error: unable to open file: %s" % str(e)) + return False + + reg_value = 1 + reg_file.write(hex(reg_value)) + reg_file.close() + else: + return None + + return True + + def tx_disable(self, tx_disable): + """ + Disable SFP TX for all channels + Args: + tx_disable : A Boolean, True to enable tx_disable mode, False to disable + tx_disable mode. + Returns: + A boolean, True if tx_disable is set successfully, False if not + """ + if not self.get_presence(): + return False + + if self.sfp_type == SFP_TYPE: + if self.dom_tx_disable_supported: + offset = 256 + sysfs_sfp_i2c_client_eeprom_path = self.port_to_eeprom_mapping[self.port_num] + status_control_raw = self._read_eeprom_specific_bytes( + (offset + SFP_STATUS_CONTROL_OFFSET), SFP_STATUS_CONTROL_WIDTH) + if status_control_raw is not None: + # Set bit 6 for Soft TX Disable Select + # 01000000 = 64 and 10111111 = 191 + tx_disable_bit = 64 if tx_disable else 191 + status_control = int(status_control_raw[0], 16) + tx_disable_ctl = (status_control | tx_disable_bit) if tx_disable else ( + status_control & tx_disable_bit) + try: + sysfsfile_eeprom = open( + sysfs_sfp_i2c_client_eeprom_path, mode="r+b", buffering=0) + buffer = create_string_buffer(1) + buffer[0] = chr(tx_disable_ctl) + # Write to eeprom + sysfsfile_eeprom.seek(offset + SFP_STATUS_CONTROL_OFFSET) + sysfsfile_eeprom.write(buffer[0]) + except IOError as e: + print("Error: unable to open file: %s" % str(e)) + return False + finally: + if sysfsfile_eeprom: + sysfsfile_eeprom.close() + time.sleep(0.01) + return True + return False + else: + return False + elif self.sfp_type == QSFP_TYPE: + if self.dom_tx_disable_supported: + channel_mask = 0x0f + if tx_disable: + return self.tx_disable_channel(channel_mask, True) + else: + return self.tx_disable_channel(channel_mask, False) + else: + return False + else: + return None + + def tx_disable_channel(self, channel, disable): + """ + Sets the tx_disable for specified SFP channels + Args: + channel : A hex of 4 bits (bit 0 to bit 3) which represent channel 0 to 3, + e.g. 0x5 for channel 0 and channel 2. + disable : A boolean, True to disable TX channels specified in channel, + False to enable + Returns: + A boolean, True if successful, False if not + """ + if not self.get_presence(): + return False + # SFP doesn't support this feature + if self.sfp_type == SFP_TYPE: + return False + elif self.sfp_type == QSFP_TYPE: + if self.dom_tx_disable_supported: + sysfsfile_eeprom = None + try: + channel_state = self.get_tx_disable_channel() + if disable: + tx_disable_ctl = channel_state | channel + else: + tx_disable_ctl = channel_state & (~channel) + buffer = create_string_buffer(1) + buffer[0] = chr(tx_disable_ctl) + # Write to eeprom + sysfsfile_eeprom = open( + self.port_to_eeprom_mapping[self.port_num], "r+b") + sysfsfile_eeprom.seek(QSFP_CONTROL_OFFSET) + sysfsfile_eeprom.write(buffer[0]) + except IOError as e: + print ("Error: unable to open file: %s" % str(e)) + return False + finally: + if sysfsfile_eeprom is not None: + sysfsfile_eeprom.close() + time.sleep(0.01) + return True + else: + return False + else: + return None + + def set_lpmode(self, lpmode): + """ + Sets the lpmode (low power mode) of SFP + Args: + lpmode: A Boolean, True to enable lpmode, False to disable it + Note : lpmode can be overridden by set_power_override + Returns: + A boolean, True if lpmode is set successfully, False if not + """ + if not self.get_presence(): + return False + # SFP doesn't support this feature + if self.sfp_type == SFP_TYPE: + return False + elif self.sfp_type == QSFP_TYPE: + return False + elif self.sfp_type == OSFP_TYPE: + try: + reg_file = open(self.lpmode_path, "r+") + except IOError as e: + print ("Error: unable to open file: %s" % str(e)) + return False + + # LPMode is active high; set or clear the bit accordingly + if lpmode: + reg_value = 1 + else: + reg_value = 0 + + reg_file.write(hex(reg_value)) + reg_file.close() + else: + return None + + return True + + def set_power_override(self, power_override, power_set): + """ + Sets SFP power level using power_override and power_set + Args: + power_override : + A Boolean, True to override set_lpmode and use power_set + to control SFP power, False to disable SFP power control + through power_override/power_set and use set_lpmode + to control SFP power. + power_set : + Only valid when power_override is True. + A Boolean, True to set SFP to low power mode, False to set + SFP to high power mode. + Returns: + A boolean, True if power-override and power_set are set successfully, + False if not + """ + # SFP doesn't support this feature + if not self.get_presence(): + return False + + if self.sfp_type == SFP_TYPE: + return False + elif self.sfp_type == QSFP_TYPE: + try: + power_override_bit = 0 + if power_override: + power_override_bit |= 1 << 0 + + power_set_bit = 0 + if power_set: + power_set_bit |= 1 << 1 + + buffer = create_string_buffer(1) + buffer[0] = chr(power_override_bit | power_set_bit) + # Write to eeprom + sysfsfile_eeprom = open(self.port_to_eeprom_mapping[self.port_num], "r+b") + sysfsfile_eeprom.seek(QSFP_POWEROVERRIDE_OFFSET) + sysfsfile_eeprom.write(buffer[0]) + except IOError as e: + print ("Error: unable to open file: %s" % str(e)) + return False + finally: + if sysfsfile_eeprom is not None: + sysfsfile_eeprom.close() + time.sleep(0.01) + else: + return None + + return True + + def get_name(self): + """ + Retrieves the name of the device + Returns: + string: The name of the device + """ + sfputil_helper = SfpUtilHelper() + sfputil_helper.read_porttab_mappings(self.__get_path_to_port_config_file()) + print ("self.index{}".format(self.index)) + name = sfputil_helper.logical[self.index-1] or "Unknown" + return name + diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix9-32x/sonic_platform/thermal.py b/platform/broadcom/sonic-platform-modules-quanta/ix9-32x/sonic_platform/thermal.py new file mode 100644 index 000000000000..5fb209749223 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix9-32x/sonic_platform/thermal.py @@ -0,0 +1,158 @@ +#!/usr/bin/env python + +############################################################################# +# Quanta +# +# Module contains an implementation of SONiC Platform Base API and +# provides the Thermal information +# +############################################################################# + +import logging +import os + +try: + from sonic_platform_base.thermal_base import ThermalBase +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +HWMON_DIR = "/sys/class/hwmon/hwmon2/" + +thermal_index_mapping = { + 1:40, + 2:41, + 3:42, + 4:50, + 5:51, + 6:52, + 7:73, + 8:74, + 9:75, + 10:76, + 11:77, + 12:78, + 13:79, + 14:80, + 15:81, + 16:82, + 17:83, + 18:84, + 19:85 +} + +class Thermal(ThermalBase): + """Platform-specific Thermal class""" + + def __init__(self, thermal_index): + self.index = thermal_index + self.temp_attr = "temp{}_input".format(thermal_index_mapping[self.index]) + self.high_th_attr = "temp{}_ncrit".format(thermal_index_mapping[self.index]) + self.high_crit_th_attr = "temp{}_crit".format(thermal_index_mapping[self.index]) + self.name_attr = "temp{}_label".format(thermal_index_mapping[self.index]) + + + def __get_attr_value(self, attr_path): + + retval = 'ERR' + if (not os.path.isfile(attr_path)): + return retval + + try: + with open(attr_path, 'r') as fd: + retval = fd.read() + except Exception as error: + logging.error("Unable to open " + attr_path + " file !") + + retval = retval.rstrip(' \t\n\r') + return retval + + def get_name(self): + """ + Retrieves the name of the device + + Returns: + string: The name of the device + """ + attr_path = HWMON_DIR + self.name_attr + attr_rv = self.__get_attr_value(attr_path) + + if (attr_rv != 'ERR'): + return attr_rv + else: + return None + + def get_presence(self): + """ + Retrieves the presence of the device + + Returns: + bool: True if device is present, False if not + """ + attr_path = HWMON_DIR + self.name_attr + attr_rv = self.__get_attr_value(attr_path) + + if (attr_rv != 'ERR'): + return True + else: + return False + + def get_status(self): + """ + Retrieves the operational status of the device + + Returns: + A boolean value, True if device is operating properly, False if not + """ + if (self.get_temperature() != None): + return True + else: + return False + + def get_temperature(self): + """ + Retrieves current temperature reading from thermal + + Returns: + A float number of current temperature in Celsius up to nearest thousandth + of one degree Celsius, e.g. 30.125 + """ + attr_path = HWMON_DIR + self.temp_attr + attr_rv = self.__get_attr_value(attr_path) + + if (attr_rv != 'ERR'): + return float(attr_rv) / 1000 + else: + return None + + def get_high_threshold(self): + """ + Retrieves the high threshold temperature of thermal + + Returns: + A float number, the high threshold temperature of thermal in Celsius + up to nearest thousandth of one degree Celsius, e.g. 30.125 + """ + attr_path = HWMON_DIR + self.high_th_attr + attr_rv = self.__get_attr_value(attr_path) + + if (attr_rv != 'ERR'): + return float(attr_rv) / 1000 + else: + return None + + def get_high_critical_threshold(self): + """ + Retrieves the high threshold temperature of thermal + + Returns: + A float number, the high threshold temperature of thermal in Celsius + up to nearest thousandth of one degree Celsius, e.g. 30.125 + """ + attr_path = HWMON_DIR + self.high_crit_th_attr + attr_rv = self.__get_attr_value(attr_path) + + if (attr_rv != 'ERR'): + return float(attr_rv) / 1000 + else: + return None + diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix9-32x/sonic_platform/watchdog.py b/platform/broadcom/sonic-platform-modules-quanta/ix9-32x/sonic_platform/watchdog.py new file mode 100644 index 000000000000..282f356f4e73 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix9-32x/sonic_platform/watchdog.py @@ -0,0 +1,234 @@ +#!/usr/bin/env python + +############################################################################# +# +# Watchdog contains an implementation of SONiC Platform Base Watchdog API +# +############################################################################# +import fcntl +import os +import array + +try: + from sonic_platform_base.watchdog_base import WatchdogBase +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +""" ioctl constants """ +IO_WRITE = 0x40000000 +IO_READ = 0x80000000 +IO_READ_WRITE = 0xC0000000 +IO_SIZE_INT = 0x00040000 +IO_SIZE_40 = 0x00280000 +IO_TYPE_WATCHDOG = ord('W') << 8 + +WDR_INT = IO_READ | IO_SIZE_INT | IO_TYPE_WATCHDOG +WDR_40 = IO_READ | IO_SIZE_40 | IO_TYPE_WATCHDOG +WDWR_INT = IO_READ_WRITE | IO_SIZE_INT | IO_TYPE_WATCHDOG + +""" Watchdog ioctl commands """ +WDIOC_GETSUPPORT = 0 | WDR_40 +WDIOC_GETSTATUS = 1 | WDR_INT +WDIOC_GETBOOTSTATUS = 2 | WDR_INT +WDIOC_GETTEMP = 3 | WDR_INT +WDIOC_SETOPTIONS = 4 | WDR_INT +WDIOC_KEEPALIVE = 5 | WDR_INT +WDIOC_SETTIMEOUT = 6 | WDWR_INT +WDIOC_GETTIMEOUT = 7 | WDR_INT +WDIOC_SETPRETIMEOUT = 8 | WDWR_INT +WDIOC_GETPRETIMEOUT = 9 | WDR_INT +WDIOC_GETTIMELEFT = 10 | WDR_INT + +""" Watchdog status constants """ +WDIOS_DISABLECARD = 0x0001 +WDIOS_ENABLECARD = 0x0002 + +WDT_COMMON_ERROR = -1 +WD_MAIN_IDENTITY = "iTCO_wdt" +WDT_SYSFS_PATH = "/sys/class/watchdog/" + +DEFAULT_TIMEOUT=180 + +class Watchdog(WatchdogBase): + + def __init__(self): + + self.watchdog, self.wdt_main_dev_name = self._get_wdt() + self.status_path = "/sys/class/watchdog/%s/status" % self.wdt_main_dev_name + self.state_path = "/sys/class/watchdog/%s/state" % self.wdt_main_dev_name + self.timeout_path = "/sys/class/watchdog/%s/timeout" % self.wdt_main_dev_name + # Set default value + self._disable() + self.armed = False + self.timeout = DEFAULT_TIMEOUT + + def _is_wd_main(self, dev): + """ + Checks watchdog identity + """ + identity = self._read_file( + "{}/{}/identity".format(WDT_SYSFS_PATH, dev)) + return identity == WD_MAIN_IDENTITY + + def _get_wdt(self): + """ + Retrieves watchdog device + """ + wdt_main_dev_list = [dev for dev in os.listdir( + "/dev/") if dev.startswith("watchdog") and self._is_wd_main(dev)] + if not wdt_main_dev_list: + return None + wdt_main_dev_name = wdt_main_dev_list[0] + watchdog_device_path = "/dev/{}".format(wdt_main_dev_name) + self.watchdog = os.open(watchdog_device_path, os.O_RDWR) + return self.watchdog, wdt_main_dev_name + + def _read_file(self, file_path): + """ + Read text file + """ + try: + with open(file_path, "r") as fd: + txt = fd.read() + except IOError: + return WDT_COMMON_ERROR + return txt.strip() + + def _enable(self): + """ + Turn on the watchdog timer + """ + req = array.array('h', [WDIOS_ENABLECARD]) + fcntl.ioctl(self.watchdog, WDIOC_SETOPTIONS, req, False) + + def _disable(self): + """ + Turn off the watchdog timer + """ + req = array.array('h', [WDIOS_DISABLECARD]) + fcntl.ioctl(self.watchdog, WDIOC_SETOPTIONS, req, False) + + def _keepalive(self): + """ + Keep alive watchdog timer + """ + fcntl.ioctl(self.watchdog, WDIOC_KEEPALIVE) + + def _settimeout(self, seconds): + """ + Set watchdog timer timeout + @param seconds - timeout in seconds + @return is the actual set timeout + """ + req = array.array('I', [seconds]) + fcntl.ioctl(self.watchdog, WDIOC_SETTIMEOUT, req, True) + return int(req[0]) + + def _gettimeout(self, timeout_path): + """ + Get watchdog timeout + @return watchdog timeout + """ + req = array.array('I', [0]) + fcntl.ioctl(self.watchdog, WDIOC_GETTIMEOUT, req, True) + + return int(req[0]) + + def _gettimeleft(self): + """ + Get time left before watchdog timer expires + @return time left in seconds + """ + req = array.array('I', [0]) + fcntl.ioctl(self.watchdog, WDIOC_GETTIMELEFT, req, True) + + return int(req[0]) + + ################################################################# + + def arm(self, seconds): + """ + Arm the hardware watchdog with a timeout of seconds. + If the watchdog is currently armed, calling this function will + simply reset the timer to the provided value. If the underlying + hardware does not support the value provided in , this + method should arm the watchdog with the *next greater* available + value. + Returns: + An integer specifying the *actual* number of seconds the watchdog + was armed with. On failure returns -1. + """ + + ret = WDT_COMMON_ERROR + if seconds < 0: + return ret + + try: + if self.timeout != seconds: + self.timeout = self._settimeout(seconds) + if self.armed: + self._keepalive() + else: + self._settimeout(seconds) + self._enable() + self.armed = True + ret = self.timeout + except IOError as e: + pass + + return ret + + def disarm(self): + """ + Disarm the hardware watchdog + Returns: + A boolean, True if watchdog is disarmed successfully, False if not + """ + disarmed = False + if self.is_armed(): + try: + self._disable() + self.armed = False + disarmed = True + except IOError: + pass + + return disarmed + + def is_armed(self): + """ + Retrieves the armed state of the hardware watchdog. + Returns: + A boolean, True if watchdog is armed, False if not + """ + + return self.armed + + def get_remaining_time(self): + """ + If the watchdog is armed, retrieve the number of seconds remaining on + the watchdog timer + Returns: + An integer specifying the number of seconds remaining on thei + watchdog timer. If the watchdog is not armed, returns -1. + """ + + timeleft = WDT_COMMON_ERROR + + if self.armed: + try: + timeleft = self._gettimeleft() + except IOError: + pass + + return timeleft + + def __del__(self): + """ + Close watchdog + """ + + os.close(self.watchdog) + + + diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix9-32x/sonic_platform_setup.py b/platform/broadcom/sonic-platform-modules-quanta/ix9-32x/sonic_platform_setup.py new file mode 100644 index 000000000000..b1ba37477628 --- /dev/null +++ b/platform/broadcom/sonic-platform-modules-quanta/ix9-32x/sonic_platform_setup.py @@ -0,0 +1,24 @@ +import os +from setuptools import setup +os.listdir + +setup( + name='sonic-platform', + version='1.0', + description='SONiC platform API implementation on Quanta Platforms', + license='Apache 2.0', + packages=['sonic_platform'], + classifiers=[ + 'Development Status :: 3 - Alpha', + 'Environment :: Plugins', + 'Intended Audience :: Developers', + 'Intended Audience :: Information Technology', + 'Intended Audience :: System Administrators', + 'License :: OSI Approved :: Apache Software License', + 'Natural Language :: English', + 'Operating System :: POSIX :: Linux', + 'Programming Language :: Python :: 3.7', + 'Topic :: Utilities', + ], + keywords='sonic SONiC platform PLATFORM', +) diff --git a/platform/broadcom/sonic-platform-modules-quanta/ix9-32x/utils/quanta_ix9_util.py b/platform/broadcom/sonic-platform-modules-quanta/ix9-32x/utils/quanta_ix9_util.py index 4c31aa8584b8..0554ccbf1b71 100755 --- a/platform/broadcom/sonic-platform-modules-quanta/ix9-32x/utils/quanta_ix9_util.py +++ b/platform/broadcom/sonic-platform-modules-quanta/ix9-32x/utils/quanta_ix9_util.py @@ -31,9 +31,6 @@ import commands import sys, getopt import logging -import re -import time -from collections import namedtuple DEBUG = False args = [] @@ -123,46 +120,87 @@ def exec_cmd(cmd, show): 'echo 40 > /sys/class/gpio/export', 'echo out > /sys/class/gpio/gpio40/direction', 'echo 1 > /sys/class/gpio/gpio40/value', +#Set 1 to release reset pins (low active) +'echo 1 > /sys/class/cpld-qsfpdd/port-1/reset', +'echo 1 > /sys/class/cpld-qsfpdd/port-2/reset', +'echo 1 > /sys/class/cpld-qsfpdd/port-3/reset', +'echo 1 > /sys/class/cpld-qsfpdd/port-4/reset', +'echo 1 > /sys/class/cpld-qsfpdd/port-5/reset', +'echo 1 > /sys/class/cpld-qsfpdd/port-6/reset', +'echo 1 > /sys/class/cpld-qsfpdd/port-7/reset', +'echo 1 > /sys/class/cpld-qsfpdd/port-8/reset', +'echo 1 > /sys/class/cpld-qsfpdd/port-9/reset', +'echo 1 > /sys/class/cpld-qsfpdd/port-10/reset', +'echo 1 > /sys/class/cpld-qsfpdd/port-11/reset', +'echo 1 > /sys/class/cpld-qsfpdd/port-12/reset', +'echo 1 > /sys/class/cpld-qsfpdd/port-13/reset', +'echo 1 > /sys/class/cpld-qsfpdd/port-14/reset', +'echo 1 > /sys/class/cpld-qsfpdd/port-15/reset', +'echo 1 > /sys/class/cpld-qsfpdd/port-16/reset', +'echo 1 > /sys/class/cpld-qsfpdd/port-17/reset', +'echo 1 > /sys/class/cpld-qsfpdd/port-18/reset', +'echo 1 > /sys/class/cpld-qsfpdd/port-19/reset', +'echo 1 > /sys/class/cpld-qsfpdd/port-20/reset', +'echo 1 > /sys/class/cpld-qsfpdd/port-21/reset', +'echo 1 > /sys/class/cpld-qsfpdd/port-22/reset', +'echo 1 > /sys/class/cpld-qsfpdd/port-23/reset', +'echo 1 > /sys/class/cpld-qsfpdd/port-24/reset', +'echo 1 > /sys/class/cpld-qsfpdd/port-25/reset', +'echo 1 > /sys/class/cpld-qsfpdd/port-26/reset', +'echo 1 > /sys/class/cpld-qsfpdd/port-27/reset', +'echo 1 > /sys/class/cpld-qsfpdd/port-28/reset', +'echo 1 > /sys/class/cpld-qsfpdd/port-29/reset', +'echo 1 > /sys/class/cpld-qsfpdd/port-30/reset', +'echo 1 > /sys/class/cpld-qsfpdd/port-31/reset', +'echo 1 > /sys/class/cpld-qsfpdd/port-32/reset' ] drivers =[ 'lpc_ich', 'i2c-i801', 'i2c-dev', -'i2c-mux-pca954x', +'i2c-mux-pca954x force_deselect_on_exit=1', 'gpio-pca953x', +'optoe', 'qci_cpld_qsfpdd', 'qci_cpld_led', 'qci_platform_ix9', +'quanta_hwmon_ipmi', 'ipmi_devintf' ] - +un_drivers =[ +'lpc_ich', +'i2c-i801', +'i2c-dev', +'i2c-mux-pca954x', +'gpio-pca953x', +'optoe', +'qci_cpld_qsfpdd', +'qci_cpld_led', +'qci_platform_ix9', +'quanta_hwmon_ipmi', +'ipmi_devintf' +] def system_install(): global FORCE - #remove default drivers to avoid modprobe order conflicts - status, output = exec_cmd("rmmod i2c_ismt ", 1) - status, output = exec_cmd("rmmod i2c-i801 ", 1) #setup driver dependency - status, output = exec_cmd("depmod -a ", 1) + exec_cmd("depmod -a ", 1) #install drivers for i in range(0,len(drivers)): - status, output = exec_cmd("modprobe "+drivers[i], 1) + status, output = exec_cmd("modprobe " + drivers[i], 1) if status: print output if FORCE == 0: return status - #remove net rules for generating new net rules - status, output = exec_cmd("systemctl stop systemd-udevd.service ", 1) - status, output = exec_cmd("rm /etc/udev/rules.d/70-persistent-net.rules ", 1) - status, output = exec_cmd("rmmod ixgbe ", 1) - status, output = exec_cmd("rmmod igb ", 1) - status, output = exec_cmd("modprobe igb ", 1) - status, output = exec_cmd("modprobe ixgbe ", 1) - status, output = exec_cmd("systemctl start systemd-udevd.service ", 1) + #reload ethernet drivers in correct order + exec_cmd("rmmod ixgbe ", 1) + exec_cmd("rmmod igb ", 1) + exec_cmd("modprobe igb ", 1) + exec_cmd("modprobe ixgbe ", 1) #instantiate devices for i in range(0,len(instantiate)): @@ -174,7 +212,7 @@ def system_install(): #QSFPDD for 1~32 port for port_number in range(1,33): - bus_number = port_number + 31 + bus_number = port_number + 12 os.system("echo %d >/sys/bus/i2c/devices/%d-0050/port_name" % (port_number, bus_number)) return @@ -191,6 +229,11 @@ def install(): if status: if FORCE == 0: return status + status, output = exec_cmd("pip3 install /usr/share/sonic/device/x86_64-quanta_ix9_bwde-r0/sonic_platform-1.0-py3-none-any.whl",1) + if status: + print output + if FORCE == 0: + return status else: print " ix9 driver already installed...." return @@ -198,20 +241,29 @@ def install(): def uninstall(): global FORCE #uninstall drivers - for i in range(len(drivers)-1,-1,-1): - status, output = exec_cmd("rmmod "+drivers[i], 1) + for i in range(len(un_drivers) - 1, -1, -1): + status, output = exec_cmd("rmmod " + un_drivers[i], 1) if status: print output if FORCE == 0: return status + + status, output = exec_cmd("pip3 uninstall sonic-platform -y ",1) + if status: + print output + if FORCE == 0: + return status + return def device_found(): - ret1, log = exec_cmd("ls "+i2c_prefix+"i2c-0", 0) - return ret1 + ret1, log1 = exec_cmd("cat /proc/modules | grep ix9 > /tmp/chkdriver.log", 0) + ret2, log2 = exec_cmd("cat /tmp/chkdriver.log | grep ix9", 0) + + if ret1 == 0 and len(log2) > 0: + return True + else: + return False if __name__ == "__main__": main() - - - diff --git a/platform/cavium/cavm_platform_modules/DEBIAN/control b/platform/cavium/cavm_platform_modules/DEBIAN/control index 938215c8f8ee..6a665e88c718 100755 --- a/platform/cavium/cavm_platform_modules/DEBIAN/control +++ b/platform/cavium/cavm_platform_modules/DEBIAN/control @@ -1,6 +1,6 @@ Package: cavm-platform-modules Version: 1.0 Architecture: amd64 -Depends: linux-image-4.19.0-9-2-amd64-unsigned +Depends: linux-image-4.19.0-12-2-amd64-unsigned Maintainer: Nadiya.Stetskovych@cavium.com Description: kernel modules for platform devices such as fan, led, sfp diff --git a/platform/cavium/docker-ptf-cavm.mk b/platform/cavium/docker-ptf-cavm.mk deleted file mode 100644 index ea96fd050bfe..000000000000 --- a/platform/cavium/docker-ptf-cavm.mk +++ /dev/null @@ -1,8 +0,0 @@ -# docker image for docker-ptf-cavm - -DOCKER_PTF_CAVM = docker-ptf-cavm.gz -$(DOCKER_PTF_CAVM)_PATH = $(DOCKERS_PATH)/docker-ptf-saithrift -$(DOCKER_PTF_CAVM)_DEPENDS += $(PYTHON_SAITHRIFT_CAVM) -$(DOCKER_PTF_CAVM)_LOAD_DOCKERS += $(DOCKER_PTF) -SONIC_DOCKER_IMAGES += $(DOCKER_PTF_CAVM) -SONIC_STRETCH_DOCKERS += $(DOCKER_PTF_CAVM) diff --git a/platform/cavium/docker-syncd-cavm-rpc/Dockerfile.j2 b/platform/cavium/docker-syncd-cavm-rpc/Dockerfile.j2 index 3c49748ae8ae..e9e9facef5ee 100644 --- a/platform/cavium/docker-syncd-cavm-rpc/Dockerfile.j2 +++ b/platform/cavium/docker-syncd-cavm-rpc/Dockerfile.j2 @@ -11,11 +11,6 @@ debs/ RUN apt-get purge -y syncd -RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; } ; \ -{% for deb in docker_syncd_cavm_rpc_debs.split(' ') -%} -dpkg_apt debs/{{ deb }}{{'; '}} -{%- endfor %} - ## Pre-install the fundamental packages RUN apt-get update \ && apt-get -y install \ @@ -27,7 +22,16 @@ RUN apt-get update \ python-dev \ wget \ cmake \ - && wget https://github.com/nanomsg/nanomsg/archive/1.0.0.tar.gz \ + libqt5core5a \ + libqt5network5 \ + libboost-atomic1.71.0 + +RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; } ; \ +{% for deb in docker_syncd_cavm_rpc_debs.split(' ') -%} +dpkg_apt debs/{{ deb }}{{'; '}} +{%- endfor %} + +RUN wget https://github.com/nanomsg/nanomsg/archive/1.0.0.tar.gz \ && tar xvfz 1.0.0.tar.gz \ && cd nanomsg-1.0.0 \ && mkdir -p build \ diff --git a/platform/cavium/docker-syncd-cavm.mk b/platform/cavium/docker-syncd-cavm.mk index 059d2c71ebb4..eeeb312ad4d1 100644 --- a/platform/cavium/docker-syncd-cavm.mk +++ b/platform/cavium/docker-syncd-cavm.mk @@ -20,4 +20,3 @@ $(DOCKER_SYNCD_CAVM)_CONTAINER_NAME = syncd $(DOCKER_SYNCD_CAVM)_RUN_OPT += --net=host --privileged -t $(DOCKER_SYNCD_CAVM)_RUN_OPT += -v /host/machine.conf:/etc/machine.conf $(DOCKER_SYNCD_CAVM)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro -$(DOCKER_SYNCD_CAVM)_BASE_IMAGE_FILES += monit_syncd:/etc/monit/conf.d diff --git a/platform/cavium/docker-syncd-cavm/base_image_files/monit_syncd b/platform/cavium/docker-syncd-cavm/base_image_files/monit_syncd deleted file mode 100644 index 61e290e3189e..000000000000 --- a/platform/cavium/docker-syncd-cavm/base_image_files/monit_syncd +++ /dev/null @@ -1,7 +0,0 @@ -############################################################################### -## Monit configuration for syncd container -## process list: -## syncd -############################################################################### -check program syncd|syncd with path "/usr/bin/process_checker syncd /usr/bin/syncd" - if status != 0 for 5 times within 5 cycles then alert repeat every 1 cycles diff --git a/platform/cavium/docker-syncd-cavm/supervisord.conf b/platform/cavium/docker-syncd-cavm/supervisord.conf index 0c6285d46ae0..0f1ae5593486 100644 --- a/platform/cavium/docker-syncd-cavm/supervisord.conf +++ b/platform/cavium/docker-syncd-cavm/supervisord.conf @@ -5,9 +5,10 @@ nodaemon=true [eventlistener:supervisor-proc-exit-listener] command=/usr/bin/supervisor-proc-exit-listener --container-name syncd -events=PROCESS_STATE_EXITED +events=PROCESS_STATE_EXITED,PROCESS_STATE_RUNNING autostart=true autorestart=unexpected +buffer_size=1024 [program:start.sh] command=/usr/bin/start.sh diff --git a/platform/cavium/rules.mk b/platform/cavium/rules.mk index bbc2e4d2d2f0..a526774d2951 100644 --- a/platform/cavium/rules.mk +++ b/platform/cavium/rules.mk @@ -5,7 +5,6 @@ include $(PLATFORM_PATH)/cavm-platform-modules.mk include $(PLATFORM_PATH)/cavm-xpnet.mk include $(PLATFORM_PATH)/one-image.mk include $(PLATFORM_PATH)/libsaithrift-dev.mk -include $(PLATFORM_PATH)/docker-ptf-cavm.mk SONIC_ALL += $(SONIC_ONE_IMAGE) \ $(DOCKER_FPM) \ diff --git a/platform/centec-arm64/docker-ptf-centec.mk b/platform/centec-arm64/docker-ptf-centec.mk deleted file mode 100755 index 3d4fe50e5f1f..000000000000 --- a/platform/centec-arm64/docker-ptf-centec.mk +++ /dev/null @@ -1,7 +0,0 @@ -# docker image for docker-ptf-centec - -DOCKER_PTF_CENTEC = docker-ptf-centec.gz -$(DOCKER_PTF_CENTEC)_PATH = $(DOCKERS_PATH)/docker-ptf-saithrift -$(DOCKER_PTF_CENTEC)_DEPENDS += $(PYTHON_SAITHRIFT) -$(DOCKER_PTF_CENTEC)_LOAD_DOCKERS += $(DOCKER_PTF) -SONIC_DOCKER_IMAGES += $(DOCKER_PTF_CENTEC) diff --git a/platform/centec-arm64/docker-saiserver-centec.mk b/platform/centec-arm64/docker-saiserver-centec.mk index 770b66b83233..8d1b11bf005e 100755 --- a/platform/centec-arm64/docker-saiserver-centec.mk +++ b/platform/centec-arm64/docker-saiserver-centec.mk @@ -4,7 +4,7 @@ DOCKER_SAISERVER_CENTEC = docker-saiserver-centec.gz $(DOCKER_SAISERVER_CENTEC)_PATH = $(PLATFORM_PATH)/docker-saiserver-centec $(DOCKER_SAISERVER_CENTEC)_DEPENDS += $(SAISERVER) $(DOCKER_SAISERVER_CENTEC)_FILES += $(DSSERVE) $(BCMCMD) -$(DOCKER_SAISERVER_CENTEC)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_STRETCH) +$(DOCKER_SAISERVER_CENTEC)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_BUSTER) SONIC_DOCKER_IMAGES += $(DOCKER_SAISERVER_CENTEC) $(DOCKER_SAISERVER_CENTEC)_CONTAINER_NAME = saiserver diff --git a/platform/centec-arm64/docker-syncd-centec-rpc.mk b/platform/centec-arm64/docker-syncd-centec-rpc.mk index 8d699c91347f..2c441e4fc410 100755 --- a/platform/centec-arm64/docker-syncd-centec-rpc.mk +++ b/platform/centec-arm64/docker-syncd-centec-rpc.mk @@ -12,7 +12,6 @@ $(DOCKER_SYNCD_CENTEC_RPC)_DEPENDS += $(SYNCD_RPC_DBG) \ endif $(DOCKER_SYNCD_CENTEC_RPC)_LOAD_DOCKERS += $(DOCKER_SYNCD_BASE) SONIC_DOCKER_IMAGES += $(DOCKER_SYNCD_CENTEC_RPC) -SONIC_STRETCH_DOCKERS += $(DOCKER_SYNCD_CENTEC_RPC) ifeq ($(ENABLE_SYNCD_RPC),y) SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_SYNCD_CENTEC_RPC) endif diff --git a/platform/centec-arm64/docker-syncd-centec-rpc/Dockerfile.j2 b/platform/centec-arm64/docker-syncd-centec-rpc/Dockerfile.j2 index d6719b224abd..bec9c7f4426b 100755 --- a/platform/centec-arm64/docker-syncd-centec-rpc/Dockerfile.j2 +++ b/platform/centec-arm64/docker-syncd-centec-rpc/Dockerfile.j2 @@ -11,23 +11,28 @@ debs/ RUN apt-get purge -y syncd -RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; } ; \ -{% for deb in docker_syncd_centec_rpc_debs.split(' ') -%} -dpkg_apt debs/{{ deb }}{{'; '}} -{%- endfor %} - ## Pre-install the fundamental packages RUN apt-get update \ && apt-get -y install \ net-tools \ python-pip \ + python-setuptools \ build-essential \ libssl-dev \ libffi-dev \ python-dev \ wget \ cmake \ - && wget https://github.com/nanomsg/nanomsg/archive/1.0.0.tar.gz \ + libqt5core5a \ + libqt5network5 \ + libboost-atomic1.71.0 + +RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; } ; \ +{% for deb in docker_syncd_centec_rpc_debs.split(' ') -%} +dpkg_apt debs/{{ deb }}{{'; '}} +{%- endfor %} + +RUN wget https://github.com/nanomsg/nanomsg/archive/1.0.0.tar.gz \ && tar xvfz 1.0.0.tar.gz \ && cd nanomsg-1.0.0 \ && mkdir -p build \ @@ -37,9 +42,10 @@ RUN apt-get update \ && cd .. \ && rm -fr nanomsg-1.0.0 \ && rm -f 1.0.0.tar.gz \ - && pip install cffi==1.7.0 \ - && pip install --upgrade cffi==1.7.0 \ - && pip install nnpy \ + && pip2 install cffi==1.7.0 \ + && pip2 install --upgrade cffi==1.7.0 \ + && pip2 install wheel \ + && pip2 install nnpy \ && mkdir -p /opt \ && cd /opt \ && wget https://raw.githubusercontent.com/p4lang/ptf/master/ptf_nn/ptf_nn_agent.py \ @@ -47,5 +53,5 @@ RUN apt-get update \ && rm -rf /root/deps COPY ["ptf_nn_agent.conf", "/etc/supervisor/conf.d/"] - + ENTRYPOINT ["/usr/local/bin/supervisord"] diff --git a/platform/centec-arm64/docker-syncd-centec.mk b/platform/centec-arm64/docker-syncd-centec.mk index 9943420660a4..9c3d1b1aff75 100755 --- a/platform/centec-arm64/docker-syncd-centec.mk +++ b/platform/centec-arm64/docker-syncd-centec.mk @@ -10,9 +10,6 @@ $(DOCKER_SYNCD_BASE)_DBG_DEPENDS += $(SYNCD_DBG) \ $(LIBSAIMETADATA_DBG) \ $(LIBSAIREDIS_DBG) -SONIC_STRETCH_DOCKERS += $(DOCKER_SYNCD_BASE) -SONIC_STRETCH_DBG_DOCKERS += $(DOCKER_SYNCD_BASE_DBG) - $(DOCKER_SYNCD_BASE)_RUN_OPT += -v /host/warmboot:/var/warmboot $(DOCKER_SYNCD_CENTEC)_RUN_OPT += --privileged -t $(DOCKER_SYNCD_CENTEC)_RUN_OPT += -v /host/machine.conf:/etc/machine.conf diff --git a/platform/centec-arm64/docker-syncd-centec/Dockerfile.j2 b/platform/centec-arm64/docker-syncd-centec/Dockerfile.j2 index 7590d65600b7..b97bfe3d3e18 100755 --- a/platform/centec-arm64/docker-syncd-centec/Dockerfile.j2 +++ b/platform/centec-arm64/docker-syncd-centec/Dockerfile.j2 @@ -1,4 +1,4 @@ -FROM docker-config-engine-stretch +FROM docker-config-engine-buster ARG docker_container_name RUN [ -f /etc/rsyslog.conf ] && sed -ri "s/%syslogtag%/$docker_container_name#%syslogtag%/;" /etc/rsyslog.conf @@ -19,7 +19,7 @@ RUN apt-get update \ net-tools \ iputils-ping -RUN apt-get -y install libpcap-dev libxml2-dev python-dev swig libsensors4-dev libjemalloc1 nfs-common +RUN apt-get -y install libpcap-dev libxml2-dev python-dev swig libsensors4-dev nfs-common RUN dpkg -i \ {% for deb in docker_syncd_centec_debs.split(' ') -%} diff --git a/platform/centec-arm64/docker-syncd-centec/supervisord.conf b/platform/centec-arm64/docker-syncd-centec/supervisord.conf index 2cf6814ddaa9..c4cadf37c602 100755 --- a/platform/centec-arm64/docker-syncd-centec/supervisord.conf +++ b/platform/centec-arm64/docker-syncd-centec/supervisord.conf @@ -10,13 +10,14 @@ autorestart=unexpected startretries=0 exitcodes=0,3 events=PROCESS_STATE -buffer_size=25 +buffer_size=1024 [eventlistener:supervisor-proc-exit-listener] command=python2 /usr/bin/supervisor-proc-exit-listener --container-name syncd -events=PROCESS_STATE_EXITED +events=PROCESS_STATE_EXITED,PROCESS_STATE_RUNNING autostart=true autorestart=unexpected +buffer_size=1024 [program:rsyslogd] command=/usr/sbin/rsyslogd -n -iNONE diff --git a/platform/centec-arm64/platform.conf b/platform/centec-arm64/platform.conf index 8b29d0ded3a9..2577f64ea274 100755 --- a/platform/centec-arm64/platform.conf +++ b/platform/centec-arm64/platform.conf @@ -37,7 +37,7 @@ bootloader_menu_config() { (cat < /tmp/env.txt diff --git a/platform/centec-arm64/rules.mk b/platform/centec-arm64/rules.mk index 79e1ab12b880..1982f86b757c 100755 --- a/platform/centec-arm64/rules.mk +++ b/platform/centec-arm64/rules.mk @@ -3,7 +3,6 @@ include $(PLATFORM_PATH)/docker-syncd-centec.mk include $(PLATFORM_PATH)/docker-syncd-centec-rpc.mk include $(PLATFORM_PATH)/one-image.mk include $(PLATFORM_PATH)/libsaithrift-dev.mk -include $(PLATFORM_PATH)/docker-ptf-centec.mk include $(PLATFORM_PATH)/tsingma-bsp.mk include $(PLATFORM_PATH)/platform-modules-centec-e530.mk diff --git a/platform/centec-arm64/sonic-platform-modules-e530/debian/control b/platform/centec-arm64/sonic-platform-modules-e530/debian/control index 023a365f4d7b..2a1bc972a8b2 100644 --- a/platform/centec-arm64/sonic-platform-modules-e530/debian/control +++ b/platform/centec-arm64/sonic-platform-modules-e530/debian/control @@ -7,10 +7,10 @@ Standards-Version: 3.9.3 Package: platform-modules-e530-48t4x-p Architecture: arm64 -Depends: linux-image-4.19.0-9-2-arm64-unsigned +Depends: linux-image-4.19.0-12-2-arm64-unsigned Description: kernel modules for platform devices such as fan, led, sfp Package: platform-modules-e530-24x2c Architecture: arm64 -Depends: linux-image-4.19.0-9-2-arm64-unsigned +Depends: linux-image-4.19.0-12-2-arm64-unsigned Description: kernel modules for platform devices such as fan, led, sfp diff --git a/platform/centec-arm64/sonic-platform-modules-e530/debian/platform-modules-e530-24x2c.install b/platform/centec-arm64/sonic-platform-modules-e530/debian/platform-modules-e530-24x2c.install index f9fceaf20f23..b74a968fe976 100644 --- a/platform/centec-arm64/sonic-platform-modules-e530/debian/platform-modules-e530-24x2c.install +++ b/platform/centec-arm64/sonic-platform-modules-e530/debian/platform-modules-e530-24x2c.install @@ -1,3 +1,3 @@ -../../centec/centec-dal/dal.ko /lib/modules/4.19.0-9-2-arm64/kernel/extra -24x2c/modules/centec_e530_24x2c_platform.ko /lib/modules/4.19.0-9-2-arm64/kernel/extra +../../centec/centec-dal/dal.ko /lib/modules/4.19.0-12-2-arm64/kernel/extra +24x2c/modules/centec_e530_24x2c_platform.ko /lib/modules/4.19.0-12-2-arm64/kernel/extra 24x2c/service/24x2c_platform.service /lib/systemd/system diff --git a/platform/centec-arm64/sonic-platform-modules-e530/debian/platform-modules-e530-48t4x-p.install b/platform/centec-arm64/sonic-platform-modules-e530/debian/platform-modules-e530-48t4x-p.install index 57d2eb4470ad..7d1c00eebeae 100644 --- a/platform/centec-arm64/sonic-platform-modules-e530/debian/platform-modules-e530-48t4x-p.install +++ b/platform/centec-arm64/sonic-platform-modules-e530/debian/platform-modules-e530-48t4x-p.install @@ -1,3 +1,3 @@ -../../centec/centec-dal/dal.ko /lib/modules/4.19.0-9-2-arm64/kernel/extra -48t4x_p/modules/centec_e530_48t4x_p_platform.ko /lib/modules/4.19.0-9-2-arm64/kernel/extra +../../centec/centec-dal/dal.ko /lib/modules/4.19.0-12-2-arm64/kernel/extra +48t4x_p/modules/centec_e530_48t4x_p_platform.ko /lib/modules/4.19.0-12-2-arm64/kernel/extra 48t4x_p/service/48t4x_p_platform.service /lib/systemd/system diff --git a/platform/centec-arm64/sonic_fit.its b/platform/centec-arm64/sonic_fit.its index 8a358ac325f4..7ee89e6c812f 100644 --- a/platform/centec-arm64/sonic_fit.its +++ b/platform/centec-arm64/sonic_fit.its @@ -12,7 +12,7 @@ images { kernel_ctc { description = "ARM64 Kernel"; - data = /incbin/("./vmlinuz-4.19.0-9-2-arm64"); + data = /incbin/("./vmlinuz-4.19.0-12-2-arm64"); type = "kernel"; arch = "arm64"; os = "linux"; @@ -25,7 +25,7 @@ }; initramfs { description = "initramfs"; - data = /incbin/("./initrd.img-4.19.0-9-2-arm64"); + data = /incbin/("./initrd.img-4.19.0-12-2-arm64"); type = "ramdisk"; arch = "arm64"; os = "linux"; diff --git a/platform/centec-arm64/tsingma-bsp/debian/control b/platform/centec-arm64/tsingma-bsp/debian/control index e183844f01e1..fc6d0b8def4f 100644 --- a/platform/centec-arm64/tsingma-bsp/debian/control +++ b/platform/centec-arm64/tsingma-bsp/debian/control @@ -7,5 +7,5 @@ Standards-Version: 3.9.3 Package: tsingma-bsp Architecture: arm64 -Depends: linux-image-4.19.0-9-2-arm64-unsigned +Depends: linux-image-4.19.0-12-2-arm64-unsigned Description: kernel modules for tsingma bsp diff --git a/platform/centec-arm64/tsingma-bsp/debian/tsingma-bsp.install b/platform/centec-arm64/tsingma-bsp/debian/tsingma-bsp.install index 81d328b68996..e2fb35af1b6c 100644 --- a/platform/centec-arm64/tsingma-bsp/debian/tsingma-bsp.install +++ b/platform/centec-arm64/tsingma-bsp/debian/tsingma-bsp.install @@ -1,17 +1,17 @@ -src/ctc5236-mc/ctc5236-mc.ko /lib/modules/4.19.0-9-2-arm64/kernel/extra -src/pwm-ctc/pwm-ctc.ko /lib/modules/4.19.0-9-2-arm64/kernel/extra -src/ctc5236_switch/ctc5236_switch.ko /lib/modules/4.19.0-9-2-arm64/kernel/extra -src/pinctrl-ctc/pinctrl-ctc.ko /lib/modules/4.19.0-9-2-arm64/kernel/extra -src/ctc_wdt/ctc_wdt.ko /lib/modules/4.19.0-9-2-arm64/kernel/extra -src/ctcmac/ctcmac.ko /lib/modules/4.19.0-9-2-arm64/kernel/extra -src/ctcmac/ctcmac_test.ko /lib/modules/4.19.0-9-2-arm64/kernel/extra -src/ctcmac/ctc5236_mdio.ko /lib/modules/4.19.0-9-2-arm64/kernel/extra -src/i2c-ctc/i2c-ctc.ko /lib/modules/4.19.0-9-2-arm64/kernel/extra -src/gpio-ctc/gpio-ctc.ko /lib/modules/4.19.0-9-2-arm64/kernel/extra -src/ehci-ctc/ehci-ctc.ko /lib/modules/4.19.0-9-2-arm64/kernel/extra -src/rtc-sd2405/rtc-sd2405.ko /lib/modules/4.19.0-9-2-arm64/kernel/extra -src/sdhci-ctc5236/sdhci-ctc5236.ko /lib/modules/4.19.0-9-2-arm64/kernel/extra -src/spi-ctc-qspi/spi-ctc-qspi.ko /lib/modules/4.19.0-9-2-arm64/kernel/extra +src/ctc5236-mc/ctc5236-mc.ko /lib/modules/4.19.0-12-2-arm64/kernel/extra +src/pwm-ctc/pwm-ctc.ko /lib/modules/4.19.0-12-2-arm64/kernel/extra +src/ctc5236_switch/ctc5236_switch.ko /lib/modules/4.19.0-12-2-arm64/kernel/extra +src/pinctrl-ctc/pinctrl-ctc.ko /lib/modules/4.19.0-12-2-arm64/kernel/extra +src/ctc_wdt/ctc_wdt.ko /lib/modules/4.19.0-12-2-arm64/kernel/extra +src/ctcmac/ctcmac.ko /lib/modules/4.19.0-12-2-arm64/kernel/extra +src/ctcmac/ctcmac_test.ko /lib/modules/4.19.0-12-2-arm64/kernel/extra +src/ctcmac/ctc5236_mdio.ko /lib/modules/4.19.0-12-2-arm64/kernel/extra +src/i2c-ctc/i2c-ctc.ko /lib/modules/4.19.0-12-2-arm64/kernel/extra +src/gpio-ctc/gpio-ctc.ko /lib/modules/4.19.0-12-2-arm64/kernel/extra +src/ehci-ctc/ehci-ctc.ko /lib/modules/4.19.0-12-2-arm64/kernel/extra +src/rtc-sd2405/rtc-sd2405.ko /lib/modules/4.19.0-12-2-arm64/kernel/extra +src/sdhci-ctc5236/sdhci-ctc5236.ko /lib/modules/4.19.0-12-2-arm64/kernel/extra +src/spi-ctc-qspi/spi-ctc-qspi.ko /lib/modules/4.19.0-12-2-arm64/kernel/extra src/ctc-dts/e530-ctc5236.dtb /boot/ src/config/fw_env.config /etc/ src/config/tsingma-bsp.service /lib/systemd/system diff --git a/platform/centec/docker-ptf-centec.mk b/platform/centec/docker-ptf-centec.mk deleted file mode 100644 index 47284f71756c..000000000000 --- a/platform/centec/docker-ptf-centec.mk +++ /dev/null @@ -1,8 +0,0 @@ -# docker image for docker-ptf-centec - -DOCKER_PTF_CENTEC = docker-ptf-centec.gz -$(DOCKER_PTF_CENTEC)_PATH = $(DOCKERS_PATH)/docker-ptf-saithrift -$(DOCKER_PTF_CENTEC)_DEPENDS += $(PYTHON_SAITHRIFT) -$(DOCKER_PTF_CENTEC)_LOAD_DOCKERS += $(DOCKER_PTF) -SONIC_DOCKER_IMAGES += $(DOCKER_PTF_CENTEC) -SONIC_STRETCH_DOCKERS += $(DOCKER_PTF_CENTEC) diff --git a/platform/centec/docker-syncd-centec-rpc.mk b/platform/centec/docker-syncd-centec-rpc.mk index 8915f1c35679..6b912185b7da 100644 --- a/platform/centec/docker-syncd-centec-rpc.mk +++ b/platform/centec/docker-syncd-centec-rpc.mk @@ -12,7 +12,6 @@ $(DOCKER_SYNCD_CENTEC_RPC)_DEPENDS += $(SYNCD_RPC_DBG) \ endif $(DOCKER_SYNCD_CENTEC_RPC)_LOAD_DOCKERS += $(DOCKER_SYNCD_BASE) SONIC_DOCKER_IMAGES += $(DOCKER_SYNCD_CENTEC_RPC) -SONIC_STRETCH_DOCKERS += $(DOCKER_SYNCD_CENTEC_RPC) ifeq ($(ENABLE_SYNCD_RPC),y) SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_SYNCD_CENTEC_RPC) endif diff --git a/platform/centec/docker-syncd-centec-rpc/Dockerfile.j2 b/platform/centec/docker-syncd-centec-rpc/Dockerfile.j2 index d6719b224abd..bec9c7f4426b 100644 --- a/platform/centec/docker-syncd-centec-rpc/Dockerfile.j2 +++ b/platform/centec/docker-syncd-centec-rpc/Dockerfile.j2 @@ -11,23 +11,28 @@ debs/ RUN apt-get purge -y syncd -RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; } ; \ -{% for deb in docker_syncd_centec_rpc_debs.split(' ') -%} -dpkg_apt debs/{{ deb }}{{'; '}} -{%- endfor %} - ## Pre-install the fundamental packages RUN apt-get update \ && apt-get -y install \ net-tools \ python-pip \ + python-setuptools \ build-essential \ libssl-dev \ libffi-dev \ python-dev \ wget \ cmake \ - && wget https://github.com/nanomsg/nanomsg/archive/1.0.0.tar.gz \ + libqt5core5a \ + libqt5network5 \ + libboost-atomic1.71.0 + +RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; } ; \ +{% for deb in docker_syncd_centec_rpc_debs.split(' ') -%} +dpkg_apt debs/{{ deb }}{{'; '}} +{%- endfor %} + +RUN wget https://github.com/nanomsg/nanomsg/archive/1.0.0.tar.gz \ && tar xvfz 1.0.0.tar.gz \ && cd nanomsg-1.0.0 \ && mkdir -p build \ @@ -37,9 +42,10 @@ RUN apt-get update \ && cd .. \ && rm -fr nanomsg-1.0.0 \ && rm -f 1.0.0.tar.gz \ - && pip install cffi==1.7.0 \ - && pip install --upgrade cffi==1.7.0 \ - && pip install nnpy \ + && pip2 install cffi==1.7.0 \ + && pip2 install --upgrade cffi==1.7.0 \ + && pip2 install wheel \ + && pip2 install nnpy \ && mkdir -p /opt \ && cd /opt \ && wget https://raw.githubusercontent.com/p4lang/ptf/master/ptf_nn/ptf_nn_agent.py \ @@ -47,5 +53,5 @@ RUN apt-get update \ && rm -rf /root/deps COPY ["ptf_nn_agent.conf", "/etc/supervisor/conf.d/"] - + ENTRYPOINT ["/usr/local/bin/supervisord"] diff --git a/platform/centec/docker-syncd-centec.mk b/platform/centec/docker-syncd-centec.mk index ada63a218d4a..73810463944e 100644 --- a/platform/centec/docker-syncd-centec.mk +++ b/platform/centec/docker-syncd-centec.mk @@ -10,11 +10,7 @@ $(DOCKER_SYNCD_CENTEC)_DEPENDS += $(SYNCD_DBG) \ $(LIBSAIMETADATA_DBG) \ $(LIBSAIREDIS_DBG) -SONIC_STRETCH_DOCKERS += $(DOCKER_SYNCD_BASE) -SONIC_STRETCH_DBG_DOCKERS += $(DOCKER_SYNCD_BASE_DBG) - $(DOCKER_SYNCD_CENTEC)_RUN_OPT += --privileged -t $(DOCKER_SYNCD_CENTEC)_RUN_OPT += -v /host/machine.conf:/etc/machine.conf $(DOCKER_SYNCD_CENTEC)_RUN_OPT += -v /var/run/docker-syncd:/var/run/sswsyncd $(DOCKER_SYNCD_CENTEC)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro -$(DOCKER_SYNCD_CENTEC)_BASE_IMAGE_FILES += monit_syncd:/etc/monit/conf.d diff --git a/platform/centec/docker-syncd-centec/Dockerfile.j2 b/platform/centec/docker-syncd-centec/Dockerfile.j2 index 8bb5041b15ba..ce3b47bcdd77 100755 --- a/platform/centec/docker-syncd-centec/Dockerfile.j2 +++ b/platform/centec/docker-syncd-centec/Dockerfile.j2 @@ -1,4 +1,4 @@ -FROM docker-config-engine-stretch +FROM docker-config-engine-buster ARG docker_container_name RUN [ -f /etc/rsyslog.conf ] && sed -ri "s/%syslogtag%/$docker_container_name#%syslogtag%/;" /etc/rsyslog.conf diff --git a/platform/centec/docker-syncd-centec/base_image_files/monit_syncd b/platform/centec/docker-syncd-centec/base_image_files/monit_syncd deleted file mode 100644 index 61e290e3189e..000000000000 --- a/platform/centec/docker-syncd-centec/base_image_files/monit_syncd +++ /dev/null @@ -1,7 +0,0 @@ -############################################################################### -## Monit configuration for syncd container -## process list: -## syncd -############################################################################### -check program syncd|syncd with path "/usr/bin/process_checker syncd /usr/bin/syncd" - if status != 0 for 5 times within 5 cycles then alert repeat every 1 cycles diff --git a/platform/centec/docker-syncd-centec/supervisord.conf b/platform/centec/docker-syncd-centec/supervisord.conf index 831b7256a43b..944c3be9171e 100644 --- a/platform/centec/docker-syncd-centec/supervisord.conf +++ b/platform/centec/docker-syncd-centec/supervisord.conf @@ -10,12 +10,14 @@ autorestart=unexpected startretries=0 exitcodes=0,3 events=PROCESS_STATE +buffer_size=1024 [eventlistener:supervisor-proc-exit-listener] command=python2 /usr/bin/supervisor-proc-exit-listener --container-name syncd -events=PROCESS_STATE_EXITED +events=PROCESS_STATE_EXITED,PROCESS_STATE_RUNNING autostart=true autorestart=unexpected +buffer_size=1024 [program:rsyslogd] command=/usr/sbin/rsyslogd -n -iNONE diff --git a/platform/centec/platform-modules-embedway.mk b/platform/centec/platform-modules-embedway.mk index 366080f04114..c2ddfc327542 100644 --- a/platform/centec/platform-modules-embedway.mk +++ b/platform/centec/platform-modules-embedway.mk @@ -9,5 +9,4 @@ EMBEDWAY_ES6220_PLATFORM_MODULE = platform-modules-embedway-es6220_$(EMBEDWAY_ES $(EMBEDWAY_ES6220_PLATFORM_MODULE)_SRC_PATH = $(PLATFORM_PATH)/sonic-platform-modules-embedway $(EMBEDWAY_ES6220_PLATFORM_MODULE)_DEPENDS += $(LINUX_HEADERS) $(LINUX_HEADERS_COMMON) $(EMBEDWAY_ES6220_PLATFORM_MODULE)_PLATFORM = x86_64-ew_es6220_x48q2h4-r0 -SONIC_STRETCH_DEBS += $(EMBEDWAY_ES6220_PLATFORM_MODULE) -SONIC_DPKG_DEBS += $(EMBEDWAY_ES6220_PLATFORM_MODULE) \ No newline at end of file +SONIC_DPKG_DEBS += $(EMBEDWAY_ES6220_PLATFORM_MODULE) diff --git a/platform/centec/rules.mk b/platform/centec/rules.mk index 52bb0275abff..182248ec1ac6 100644 --- a/platform/centec/rules.mk +++ b/platform/centec/rules.mk @@ -5,7 +5,6 @@ include $(PLATFORM_PATH)/docker-syncd-centec.mk include $(PLATFORM_PATH)/docker-syncd-centec-rpc.mk include $(PLATFORM_PATH)/one-image.mk include $(PLATFORM_PATH)/libsaithrift-dev.mk -include $(PLATFORM_PATH)/docker-ptf-centec.mk SONIC_ALL += $(SONIC_ONE_IMAGE) diff --git a/platform/centec/sonic-platform-modules-e582/debian/control b/platform/centec/sonic-platform-modules-e582/debian/control index 5d6bcc7002e8..97f617d4836a 100644 --- a/platform/centec/sonic-platform-modules-e582/debian/control +++ b/platform/centec/sonic-platform-modules-e582/debian/control @@ -7,11 +7,11 @@ Standards-Version: 3.9.3 Package: platform-modules-e582-48x2q4z Architecture: amd64 -Depends: linux-image-4.19.0-9-2-amd64-unsigned +Depends: linux-image-4.19.0-12-2-amd64-unsigned Description: kernel modules for platform devices such as fan, led, sfp Package: platform-modules-e582-48x6q Architecture: amd64 -Depends: linux-image-4.19.0-9-2-amd64-unsigned +Depends: linux-image-4.19.0-12-2-amd64-unsigned Description: kernel modules for platform devices such as fan, led, sfp diff --git a/platform/centec/sonic-platform-modules-embedway/debian/control b/platform/centec/sonic-platform-modules-embedway/debian/control index 781f4df43422..6fb02a824826 100644 --- a/platform/centec/sonic-platform-modules-embedway/debian/control +++ b/platform/centec/sonic-platform-modules-embedway/debian/control @@ -7,6 +7,6 @@ Standards-Version: 3.9.3 Package: platform-modules-embedway-es6220 Architecture: amd64 -Depends: linux-image-4.19.0-9-2-amd64-unsigned +Depends: linux-image-4.19.0-12-2-amd64-unsigned Description: kernel modules for platform devices such as fan, led, sfp diff --git a/platform/checkout/cisco-8000.ini b/platform/checkout/cisco-8000.ini new file mode 100644 index 000000000000..ba8059436f95 --- /dev/null +++ b/platform/checkout/cisco-8000.ini @@ -0,0 +1,3 @@ +[module] +repo=git@github.com:Cisco-8000-sonic/platform-cisco-8000.git +ref=202012.3.1.1 diff --git a/platform/checkout/template.j2 b/platform/checkout/template.j2 new file mode 100644 index 000000000000..17b8f00c8902 --- /dev/null +++ b/platform/checkout/template.j2 @@ -0,0 +1,11 @@ +{% set path = env('PLATFORM_PATH') %} +if [ ! -d {{ path }} ]; then git clone {{ module.repo }} {{ path }}; fi; +if [ -d {{ path }}/.git ]; then cd {{ path }} && + +{% if module.ref is defined %} +git checkout {{ module.ref }} && git submodule update --init --recursive; +{% else %} +git submodule update --init --recursive; +{% endif %} + +else echo "{{ path }}/.git not found"; exit 1; fi diff --git a/platform/innovium/docker-ptf-invm.mk b/platform/innovium/docker-ptf-invm.mk deleted file mode 100755 index 53ba41e9d386..000000000000 --- a/platform/innovium/docker-ptf-invm.mk +++ /dev/null @@ -1,8 +0,0 @@ -# docker image for docker-ptf-invm - -DOCKER_PTF_INVM = docker-ptf-invm.gz -$(DOCKER_PTF_INVM)_PATH = $(DOCKERS_PATH)/docker-ptf-saithrift -$(DOCKER_PTF_INVM)_DEPENDS += $(PYTHON_SAITHRIFT_INVM) -$(DOCKER_PTF_INVM)_LOAD_DOCKERS += $(DOCKER_PTF) -SONIC_DOCKER_IMAGES += $(DOCKER_PTF_INVM) -SONIC_STRETCH_DOCKERS += $(DOCKER_PTF_INVM) diff --git a/platform/innovium/docker-syncd-invm-rpc/Dockerfile.j2 b/platform/innovium/docker-syncd-invm-rpc/Dockerfile.j2 index 3a25afbe6161..739fe55efdbe 100755 --- a/platform/innovium/docker-syncd-invm-rpc/Dockerfile.j2 +++ b/platform/innovium/docker-syncd-invm-rpc/Dockerfile.j2 @@ -9,27 +9,32 @@ debs/{{ deb }}{{' '}} {%- endfor -%} debs/ -RUN dpkg -P syncd - -RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; } ; \ -{% for deb in docker_syncd_invm_rpc_debs.split(' ') -%} -dpkg_apt debs/{{ deb }}{{'; '}} -{%- endfor %} +RUN apt-get purge -y syncd ## Pre-install the fundamental packages RUN apt-get update \ && apt-get -y install \ net-tools \ python-pip \ + python-setuptools \ build-essential \ libssl-dev \ libffi-dev \ python-dev \ - libpython2.7 \ libjansson4 \ + libyaml-dev \ wget \ cmake \ - && wget https://github.com/nanomsg/nanomsg/archive/1.0.0.tar.gz \ + libqt5core5a \ + libqt5network5 \ + libboost-atomic1.71.0 + +RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; } ; \ +{% for deb in docker_syncd_invm_rpc_debs.split(' ') -%} +dpkg_apt debs/{{ deb }}{{'; '}} +{%- endfor %} + +RUN wget https://github.com/nanomsg/nanomsg/archive/1.0.0.tar.gz \ && tar xvfz 1.0.0.tar.gz \ && cd nanomsg-1.0.0 \ && mkdir -p build \ @@ -39,9 +44,10 @@ RUN apt-get update \ && cd .. \ && rm -fr nanomsg-1.0.0 \ && rm -f 1.0.0.tar.gz \ - && pip install cffi==1.7.0 \ - && pip install --upgrade cffi==1.7.0 \ - && pip install nnpy \ + && pip2 install cffi==1.7.0 \ + && pip2 install --upgrade cffi==1.7.0 \ + && pip2 install wheel \ + && pip2 install nnpy \ && mkdir -p /opt \ && cd /opt \ && wget https://raw.githubusercontent.com/p4lang/ptf/master/ptf_nn/ptf_nn_agent.py \ diff --git a/platform/innovium/docker-syncd-invm.mk b/platform/innovium/docker-syncd-invm.mk index 52c11b90911d..3ba35c5edb97 100755 --- a/platform/innovium/docker-syncd-invm.mk +++ b/platform/innovium/docker-syncd-invm.mk @@ -10,7 +10,4 @@ $(DOCKER_SYNCD_BASE)_DBG_DEPENDS += $(SYNCD_DBG) \ $(LIBSAIMETADATA_DBG) \ $(LIBSAIREDIS_DBG) -SONIC_STRETCH_DOCKERS += $(DOCKER_SYNCD_BASE) -SONIC_STRETCH_DBG_DOCKERS += $(DOCKER_SYNCD_BASE_DBG) - $(DOCKER_SYNCD_BASE)_RUN_OPT += -v /host/warmboot:/var/warmboot diff --git a/platform/innovium/docker-syncd-invm/Dockerfile.j2 b/platform/innovium/docker-syncd-invm/Dockerfile.j2 index ab4be823de66..0fa521c74719 100755 --- a/platform/innovium/docker-syncd-invm/Dockerfile.j2 +++ b/platform/innovium/docker-syncd-invm/Dockerfile.j2 @@ -1,4 +1,4 @@ -FROM docker-config-engine-stretch +FROM docker-config-engine-buster ARG docker_container_name RUN [ -f /etc/rsyslog.conf ] && sed -ri "s/%syslogtag%/$docker_container_name#%syslogtag%/;" /etc/rsyslog.conf @@ -16,8 +16,8 @@ debs/ # Needed for Innovium Debug Shell RUN apt-get install -y net-tools -RUN apt-get install -y libpython2.7 RUN apt-get install -y libjansson4 +RUN apt-get install -y libyaml-dev RUN dpkg -i \ {% for deb in docker_syncd_invm_debs.split(' ') -%} diff --git a/platform/innovium/docker-syncd-invm/start.sh b/platform/innovium/docker-syncd-invm/start.sh new file mode 100755 index 000000000000..32bdb12ebfc0 --- /dev/null +++ b/platform/innovium/docker-syncd-invm/start.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +if [ -f /usr/bin/ivm_start.sh ]; +then + /usr/bin/ivm_start.sh +fi diff --git a/platform/innovium/docker-syncd-invm/supervisord.conf b/platform/innovium/docker-syncd-invm/supervisord.conf index ffdb5fd85c47..e69546e42db6 100755 --- a/platform/innovium/docker-syncd-invm/supervisord.conf +++ b/platform/innovium/docker-syncd-invm/supervisord.conf @@ -4,13 +4,13 @@ logfile_backups=2 nodaemon=true [eventlistener:dependent-startup] -command=python2 -m supervisord_dependent_startup +command=python3 -m supervisord_dependent_startup autostart=true autorestart=unexpected startretries=0 exitcodes=0,3 events=PROCESS_STATE -buffer_size=25 +buffer_size=1024 [program:rsyslogd] command=/usr/sbin/rsyslogd -n -iNONE @@ -21,6 +21,17 @@ stdout_logfile=syslog stderr_logfile=syslog dependent_startup=true +[program:start] +command=/usr/bin/start.sh +priority=1 +autostart=false +autorestart=false +startsecs=0 +stdout_logfile=syslog +stderr_logfile=syslog +dependent_startup=true +dependent_startup_wait_for=rsyslogd:running + [program:syncd] command=/usr/bin/syncd_start.sh priority=2 diff --git a/platform/innovium/invm-sai.mk b/platform/innovium/invm-sai.mk index 25e490e44f83..240a2b0b5f5e 100755 --- a/platform/innovium/invm-sai.mk +++ b/platform/innovium/invm-sai.mk @@ -1,6 +1,6 @@ # INVM SAI -INVM_SAI_ONLINE = https://github.com/Innovium/SONiC/raw/master/debian/master +INVM_SAI_ONLINE = https://github.com/Innovium/SONiC/raw/master/debian/202012 INVM_LIBSAI = isai.deb INVM_HSAI = saihdr.deb diff --git a/platform/innovium/one-image.mk b/platform/innovium/one-image.mk index c88ec5e65cdf..2a9843c48b53 100755 --- a/platform/innovium/one-image.mk +++ b/platform/innovium/one-image.mk @@ -7,5 +7,10 @@ $(SONIC_ONE_IMAGE)_IMAGE_TYPE = onie $(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(CEL_MIDSTONE_200I_PLATFORM_MODULE) $(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(DELTA_PLATFORM_MODULE) $(SONIC_ONE_IMAGE)_INSTALLS += $(INVM_DRV) -$(SONIC_ONE_IMAGE)_DOCKERS += $(SONIC_INSTALL_DOCKER_IMAGES) +ifeq ($(INSTALL_DEBUG_TOOLS),y) +$(SONIC_ONE_IMAGE)_DOCKERS += $(SONIC_INSTALL_DOCKER_DBG_IMAGES) +$(SONIC_ONE_IMAGE)_DOCKERS += $(filter-out $(patsubst %-$(DBG_IMAGE_MARK).gz,%.gz, $(SONIC_INSTALL_DOCKER_DBG_IMAGES)), $(SONIC_INSTALL_DOCKER_IMAGES)) +else +$(SONIC_ONE_IMAGE)_DOCKERS = $(SONIC_INSTALL_DOCKER_IMAGES) +endif SONIC_INSTALLERS += $(SONIC_ONE_IMAGE) diff --git a/platform/innovium/rules.mk b/platform/innovium/rules.mk index 0387a4ba30f0..ea23466ad578 100755 --- a/platform/innovium/rules.mk +++ b/platform/innovium/rules.mk @@ -6,7 +6,6 @@ include $(PLATFORM_PATH)/docker-syncd-invm-rpc.mk include $(PLATFORM_PATH)/one-image.mk include $(PLATFORM_PATH)/libsaithrift-dev.mk include $(PLATFORM_PATH)/python-saithrift.mk -include $(PLATFORM_PATH)/docker-ptf-invm.mk SONIC_ALL += $(SONIC_INVM_ONE_IMAGE) \ $(DOCKER_FPM) \ diff --git a/platform/innovium/sonic-platform-modules-cel/debian/control b/platform/innovium/sonic-platform-modules-cel/debian/control index 3b9152232d38..374f1f75d3aa 100755 --- a/platform/innovium/sonic-platform-modules-cel/debian/control +++ b/platform/innovium/sonic-platform-modules-cel/debian/control @@ -7,5 +7,5 @@ Standards-Version: 3.9.3 Package: platform-modules-midstone-200i Architecture: amd64 -Depends: linux-image-4.19.0-9-2-amd64-unsigned +Depends: linux-image-4.19.0-12-2-amd64-unsigned Description: kernel modules for platform devices diff --git a/platform/innovium/sonic-platform-modules-delta/debian/control b/platform/innovium/sonic-platform-modules-delta/debian/control index ac94e19b4cf8..bcfea2d42f1f 100644 --- a/platform/innovium/sonic-platform-modules-delta/debian/control +++ b/platform/innovium/sonic-platform-modules-delta/debian/control @@ -7,7 +7,7 @@ Standards-Version: 3.9.3 Package: platform-modules-et-c032if Architecture: amd64 -Depends: linux-image-4.19.0-9-2-amd64-unsigned +Depends: linux-image-4.19.0-12-2-amd64-unsigned Description: kernel modules for platform devices such as fan, led, sfp diff --git a/platform/marvell-arm64/docker-ptf-mrvl.mk b/platform/marvell-arm64/docker-ptf-mrvl.mk deleted file mode 100644 index 72c860aec868..000000000000 --- a/platform/marvell-arm64/docker-ptf-mrvl.mk +++ /dev/null @@ -1,8 +0,0 @@ -# docker image for docker-ptf-mrvl - -DOCKER_PTF_MRVL = docker-ptf-mrvl.gz -$(DOCKER_PTF_MRVL)_PATH = $(DOCKERS_PATH)/docker-ptf-saithrift -$(DOCKER_PTF_MRVL)_DEPENDS += $(PYTHON_SAITHRIFT) -$(DOCKER_PTF_MRVL)_LOAD_DOCKERS += $(DOCKER_PTF) -SONIC_DOCKER_IMAGES += $(DOCKER_PTF_MRVL) -SONIC_STRETCH_DOCKERS += $(DOCKER_PTF_MRVL) diff --git a/platform/marvell-arm64/docker-syncd-mrvl-rpc/Dockerfile.j2 b/platform/marvell-arm64/docker-syncd-mrvl-rpc/Dockerfile.j2 index 6b9e3d8aaafc..118be5e1c5f2 100644 --- a/platform/marvell-arm64/docker-syncd-mrvl-rpc/Dockerfile.j2 +++ b/platform/marvell-arm64/docker-syncd-mrvl-rpc/Dockerfile.j2 @@ -11,11 +11,6 @@ debs/ RUN apt-get purge -y syncd -RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; } ; \ -{% for deb in docker_syncd_mrvl_rpc_debs.split(' ') -%} -dpkg_apt debs/{{ deb }}{{'; '}} -{%- endfor %} - ## Pre-install the fundamental packages RUN apt-get update \ && apt-get -y install \ @@ -27,7 +22,16 @@ RUN apt-get update \ python-dev \ wget \ cmake \ - && wget https://github.com/nanomsg/nanomsg/archive/1.0.0.tar.gz \ + libqt5core5a \ + libqt5network5 \ + libboost-atomic1.71.0 + +RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; } ; \ +{% for deb in docker_syncd_mrvl_rpc_debs.split(' ') -%} +dpkg_apt debs/{{ deb }}{{'; '}} +{%- endfor %} + +RUN wget https://github.com/nanomsg/nanomsg/archive/1.0.0.tar.gz \ && tar xvfz 1.0.0.tar.gz \ && cd nanomsg-1.0.0 \ && mkdir -p build \ diff --git a/platform/marvell-arm64/docker-syncd-mrvl.mk b/platform/marvell-arm64/docker-syncd-mrvl.mk index dd01caab687b..32b3899e191b 100644 --- a/platform/marvell-arm64/docker-syncd-mrvl.mk +++ b/platform/marvell-arm64/docker-syncd-mrvl.mk @@ -14,4 +14,3 @@ SONIC_STRETCH_DOCKERS += $(DOCKER_SYNCD_BASE) SONIC_STRETCH_DBG_DOCKERS += $(DOCKER_SYNCD_BASE_DBG) $(DOCKER_SYNCD_BASE)_RUN_OPT += -v /host/warmboot:/var/warmboot -$(DOCKER_SYNCD_BASE)_BASE_IMAGE_FILES += monit_syncd:/etc/monit/conf.d diff --git a/platform/marvell-arm64/docker-syncd-mrvl/base_image_files/monit_syncd b/platform/marvell-arm64/docker-syncd-mrvl/base_image_files/monit_syncd deleted file mode 100644 index 61e290e3189e..000000000000 --- a/platform/marvell-arm64/docker-syncd-mrvl/base_image_files/monit_syncd +++ /dev/null @@ -1,7 +0,0 @@ -############################################################################### -## Monit configuration for syncd container -## process list: -## syncd -############################################################################### -check program syncd|syncd with path "/usr/bin/process_checker syncd /usr/bin/syncd" - if status != 0 for 5 times within 5 cycles then alert repeat every 1 cycles diff --git a/platform/marvell-arm64/docker-syncd-mrvl/supervisord.conf b/platform/marvell-arm64/docker-syncd-mrvl/supervisord.conf index 2cf6814ddaa9..c4cadf37c602 100644 --- a/platform/marvell-arm64/docker-syncd-mrvl/supervisord.conf +++ b/platform/marvell-arm64/docker-syncd-mrvl/supervisord.conf @@ -10,13 +10,14 @@ autorestart=unexpected startretries=0 exitcodes=0,3 events=PROCESS_STATE -buffer_size=25 +buffer_size=1024 [eventlistener:supervisor-proc-exit-listener] command=python2 /usr/bin/supervisor-proc-exit-listener --container-name syncd -events=PROCESS_STATE_EXITED +events=PROCESS_STATE_EXITED,PROCESS_STATE_RUNNING autostart=true autorestart=unexpected +buffer_size=1024 [program:rsyslogd] command=/usr/sbin/rsyslogd -n -iNONE diff --git a/platform/marvell-arm64/platform.conf b/platform/marvell-arm64/platform.conf index 15f25a27b6b9..8ecdfa317425 100644 --- a/platform/marvell-arm64/platform.conf +++ b/platform/marvell-arm64/platform.conf @@ -108,8 +108,8 @@ prepare_boot_menu() { BORDER='echo "---------------------------------------------------";echo;' fw_setenv ${FW_ARG} print_menu $BORDER $BOOT1 $BOOT2 $BOOT3 $BORDER > /dev/null - fw_setenv ${FW_ARG} linuxargs "net.ifnames=0 loopfstype=squashfs loop=$image_dir/$FILESYSTEM_SQUASHFS varlog_size=$VAR_LOG" > /dev/null - fw_setenv ${FW_ARG} linuxargs_old "net.ifnames=0 loopfstype=squashfs loop=$image_dir_old/$FILESYSTEM_SQUASHFS varlog_size=$VAR_LOG" > /dev/null + fw_setenv ${FW_ARG} linuxargs "net.ifnames=0 loopfstype=squashfs loop=$image_dir/$FILESYSTEM_SQUASHFS systemd.unified_cgroup_hierarchy=0 varlog_size=$VAR_LOG" > /dev/null + fw_setenv ${FW_ARG} linuxargs_old "net.ifnames=0 loopfstype=squashfs loop=$image_dir_old/$FILESYSTEM_SQUASHFS systemd.unified_cgroup_hierarchy=0 varlog_size=$VAR_LOG" > /dev/null sonic_bootargs_old='setenv bootargs root='$demo_dev' rw rootwait rootfstype=ext4 panic=1 console=ttyS0,115200 ${othbootargs} ${mtdparts} ${linuxargs_old}' fw_setenv ${FW_ARG} sonic_bootargs_old $sonic_bootargs_old > /dev/null || true sonic_boot_load_old=$(fw_printenv -n sonic_boot_load || true) diff --git a/platform/marvell-arm64/rules.mk b/platform/marvell-arm64/rules.mk index c3d7092ebb82..f8e4c12a49ff 100644 --- a/platform/marvell-arm64/rules.mk +++ b/platform/marvell-arm64/rules.mk @@ -4,7 +4,6 @@ include $(PLATFORM_PATH)/docker-syncd-mrvl.mk include $(PLATFORM_PATH)/docker-syncd-mrvl-rpc.mk include $(PLATFORM_PATH)/docker-saiserver-mrvl.mk include $(PLATFORM_PATH)/libsaithrift-dev.mk -include $(PLATFORM_PATH)/docker-ptf-mrvl.mk include $(PLATFORM_PATH)/one-image.mk include $(PLATFORM_PATH)/linux-kernel-arm64.mk INCLUDE_SYSTEM_TELEMETRY = "" diff --git a/platform/marvell-armhf/docker-ptf-mrvl.mk b/platform/marvell-armhf/docker-ptf-mrvl.mk deleted file mode 100644 index 72c860aec868..000000000000 --- a/platform/marvell-armhf/docker-ptf-mrvl.mk +++ /dev/null @@ -1,8 +0,0 @@ -# docker image for docker-ptf-mrvl - -DOCKER_PTF_MRVL = docker-ptf-mrvl.gz -$(DOCKER_PTF_MRVL)_PATH = $(DOCKERS_PATH)/docker-ptf-saithrift -$(DOCKER_PTF_MRVL)_DEPENDS += $(PYTHON_SAITHRIFT) -$(DOCKER_PTF_MRVL)_LOAD_DOCKERS += $(DOCKER_PTF) -SONIC_DOCKER_IMAGES += $(DOCKER_PTF_MRVL) -SONIC_STRETCH_DOCKERS += $(DOCKER_PTF_MRVL) diff --git a/platform/marvell-armhf/docker-saiserver-mrvl.dep b/platform/marvell-armhf/docker-saiserver-mrvl.dep new file mode 100644 index 000000000000..73851b9bf3ec --- /dev/null +++ b/platform/marvell-armhf/docker-saiserver-mrvl.dep @@ -0,0 +1,8 @@ +DPATH := $($(DOCKER_SAISERVER_MRVL)_PATH) +DEP_FILES := $(SONIC_COMMON_FILES_LIST) platform/marvell-armhf/docker-saiserver-mrvl.mk platform/marvell-armhf/docker-saiserver-mrvl.dep +DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) +DEP_FILES += $(shell git ls-files $(DPATH)) + +$(DOCKER_SAISERVER_MRVL)_CACHE_MODE := GIT_CONTENT_SHA +$(DOCKER_SAISERVER_MRVL)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(DOCKER_SAISERVER_MRVL)_DEP_FILES := $(DEP_FILES) diff --git a/platform/marvell-armhf/docker-saiserver-mrvl.mk b/platform/marvell-armhf/docker-saiserver-mrvl.mk index 8720e3364688..0e40653ddbf3 100644 --- a/platform/marvell-armhf/docker-saiserver-mrvl.mk +++ b/platform/marvell-armhf/docker-saiserver-mrvl.mk @@ -4,9 +4,8 @@ DOCKER_SAISERVER_MRVL = docker-saiserver-mrvl.gz $(DOCKER_SAISERVER_MRVL)_PATH = $(PLATFORM_PATH)/docker-saiserver-mrvl $(DOCKER_SAISERVER_MRVL)_DEPENDS += $(SAISERVER) $(DOCKER_SAISERVER_MRVL)_FILES += $(DSSERVE) $(BCMCMD) -$(DOCKER_SAISERVER_MRVL)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_STRETCH) +$(DOCKER_SAISERVER_MRVL)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_BUSTER) SONIC_DOCKER_IMAGES += $(DOCKER_SAISERVER_MRVL) -SONIC_STRETCH_DOCKERS += $(DOCKER_SAISERVER_MRVL) $(DOCKER_SAISERVER_MRVL)_CONTAINER_NAME = saiserver $(DOCKER_SAISERVER_MRVL)_RUN_OPT += --net=host --privileged -t diff --git a/platform/marvell-armhf/docker-syncd-mrvl-rpc.dep b/platform/marvell-armhf/docker-syncd-mrvl-rpc.dep new file mode 100644 index 000000000000..957d3f9e7ab0 --- /dev/null +++ b/platform/marvell-armhf/docker-syncd-mrvl-rpc.dep @@ -0,0 +1,8 @@ +DPATH := $($(DOCKER_SYNCD_MRVL_RPC)_PATH) +DEP_FILES := $(SONIC_COMMON_FILES_LIST) $(PLATFORM_PATH)/docker-syncd-mrvl-rpc.mk $(PLATFORM_PATH)/docker-syncd-mrvl-rpc.dep +DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) +DEP_FILES += $(shell git ls-files $(DPATH)) + +$(DOCKER_SYNCD_MRVL_RPC)_CACHE_MODE := GIT_CONTENT_SHA +$(DOCKER_SYNCD_MRVL_RPC)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(DOCKER_SYNCD_MRVL_RPC)_DEP_FILES := $(DEP_FILES) diff --git a/platform/marvell-armhf/docker-syncd-mrvl-rpc.mk b/platform/marvell-armhf/docker-syncd-mrvl-rpc.mk index c3ce6c10119c..72c6d8722da8 100644 --- a/platform/marvell-armhf/docker-syncd-mrvl-rpc.mk +++ b/platform/marvell-armhf/docker-syncd-mrvl-rpc.mk @@ -12,7 +12,6 @@ $(DOCKER_SYNCD_MRVL_RPC)_DEPENDS += $(SYNCD_RPC_DBG) \ endif $(DOCKER_SYNCD_MRVL_RPC)_LOAD_DOCKERS += $(DOCKER_SYNCD_BASE) SONIC_DOCKER_IMAGES += $(DOCKER_SYNCD_MRVL_RPC) -SONIC_STRETCH_DOCKERS += $(DOCKER_SYNCD_MRVL_RPC) ifeq ($(ENABLE_SYNCD_RPC),y) SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_SYNCD_MRVL_RPC) endif diff --git a/platform/marvell-armhf/docker-syncd-mrvl-rpc/Dockerfile.j2 b/platform/marvell-armhf/docker-syncd-mrvl-rpc/Dockerfile.j2 index 6b9e3d8aaafc..118be5e1c5f2 100644 --- a/platform/marvell-armhf/docker-syncd-mrvl-rpc/Dockerfile.j2 +++ b/platform/marvell-armhf/docker-syncd-mrvl-rpc/Dockerfile.j2 @@ -11,11 +11,6 @@ debs/ RUN apt-get purge -y syncd -RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; } ; \ -{% for deb in docker_syncd_mrvl_rpc_debs.split(' ') -%} -dpkg_apt debs/{{ deb }}{{'; '}} -{%- endfor %} - ## Pre-install the fundamental packages RUN apt-get update \ && apt-get -y install \ @@ -27,7 +22,16 @@ RUN apt-get update \ python-dev \ wget \ cmake \ - && wget https://github.com/nanomsg/nanomsg/archive/1.0.0.tar.gz \ + libqt5core5a \ + libqt5network5 \ + libboost-atomic1.71.0 + +RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; } ; \ +{% for deb in docker_syncd_mrvl_rpc_debs.split(' ') -%} +dpkg_apt debs/{{ deb }}{{'; '}} +{%- endfor %} + +RUN wget https://github.com/nanomsg/nanomsg/archive/1.0.0.tar.gz \ && tar xvfz 1.0.0.tar.gz \ && cd nanomsg-1.0.0 \ && mkdir -p build \ diff --git a/platform/marvell-armhf/docker-syncd-mrvl.dep b/platform/marvell-armhf/docker-syncd-mrvl.dep new file mode 100644 index 000000000000..2aaef3b506f9 --- /dev/null +++ b/platform/marvell-armhf/docker-syncd-mrvl.dep @@ -0,0 +1,10 @@ +DPATH := $($(DOCKER_SYNCD_BASE)_PATH) +DEP_FILES := $(SONIC_COMMON_FILES_LIST) platform/marvell-armhf/docker-syncd-mrvl.mk platform/marvell-armhf/docker-syncd-mrvl.dep platform/marvell-armhf/sai.mk +DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) +DEP_FILES += $(shell git ls-files $(DPATH)) + +$(DOCKER_SYNCD_BASE)_CACHE_MODE := GIT_CONTENT_SHA +$(DOCKER_SYNCD_BASE)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(DOCKER_SYNCD_BASE)_DEP_FILES := $(DEP_FILES) + +$(eval $(call add_dbg_docker,$(DOCKER_SYNCD_BASE),$(DOCKER_SYNCD_BASE_DBG))) diff --git a/platform/marvell-armhf/docker-syncd-mrvl.mk b/platform/marvell-armhf/docker-syncd-mrvl.mk index dd01caab687b..4904ac3af104 100644 --- a/platform/marvell-armhf/docker-syncd-mrvl.mk +++ b/platform/marvell-armhf/docker-syncd-mrvl.mk @@ -3,15 +3,11 @@ DOCKER_SYNCD_PLATFORM_CODE = mrvl include $(PLATFORM_PATH)/../template/docker-syncd-base.mk -$(DOCKER_SYNCD_BASE)_DEPENDS += $(SYNCD) $(PYTHON_SDK_API) +$(DOCKER_SYNCD_BASE)_DEPENDS += $(SYNCD) $(DOCKER_SYNCD_BASE)_DBG_DEPENDS += $(SYNCD_DBG) \ $(LIBSWSSCOMMON_DBG) \ $(LIBSAIMETADATA_DBG) \ $(LIBSAIREDIS_DBG) -SONIC_STRETCH_DOCKERS += $(DOCKER_SYNCD_BASE) -SONIC_STRETCH_DBG_DOCKERS += $(DOCKER_SYNCD_BASE_DBG) - -$(DOCKER_SYNCD_BASE)_RUN_OPT += -v /host/warmboot:/var/warmboot -$(DOCKER_SYNCD_BASE)_BASE_IMAGE_FILES += monit_syncd:/etc/monit/conf.d +#$(DOCKER_SYNCD_BASE)_RUN_OPT += -v /host/warmboot:/var/warmboot diff --git a/platform/marvell-armhf/docker-syncd-mrvl/Dockerfile.j2 b/platform/marvell-armhf/docker-syncd-mrvl/Dockerfile.j2 index afaac3fd056c..aba1cedd7965 100755 --- a/platform/marvell-armhf/docker-syncd-mrvl/Dockerfile.j2 +++ b/platform/marvell-armhf/docker-syncd-mrvl/Dockerfile.j2 @@ -1,4 +1,5 @@ -FROM docker-config-engine-stretch +{% from "dockers/dockerfile-macros.j2" import install_debian_packages %} +FROM docker-config-engine-buster ARG docker_container_name RUN [ -f /etc/rsyslog.conf ] && sed -ri "s/%syslogtag%/$docker_container_name#%syslogtag%/;" /etc/rsyslog.conf @@ -19,7 +20,7 @@ RUN apt-get update \ net-tools \ iputils-ping -RUN apt-get -y install libpcap-dev libxml2-dev python-dev swig libsensors4-dev libjemalloc1 nfs-common +RUN apt-get -y install libpcap-dev libxml2-dev python-dev swig libsensors4-dev nfs-common RUN dpkg -i \ {% for deb in docker_syncd_mrvl_debs.split(' ') -%} diff --git a/platform/marvell-armhf/docker-syncd-mrvl/base_image_files/monit_syncd b/platform/marvell-armhf/docker-syncd-mrvl/base_image_files/monit_syncd deleted file mode 100644 index 61e290e3189e..000000000000 --- a/platform/marvell-armhf/docker-syncd-mrvl/base_image_files/monit_syncd +++ /dev/null @@ -1,7 +0,0 @@ -############################################################################### -## Monit configuration for syncd container -## process list: -## syncd -############################################################################### -check program syncd|syncd with path "/usr/bin/process_checker syncd /usr/bin/syncd" - if status != 0 for 5 times within 5 cycles then alert repeat every 1 cycles diff --git a/platform/marvell-armhf/docker-syncd-mrvl/supervisord.conf b/platform/marvell-armhf/docker-syncd-mrvl/supervisord.conf index c099bbccbf0f..55f095d2be91 100644 --- a/platform/marvell-armhf/docker-syncd-mrvl/supervisord.conf +++ b/platform/marvell-armhf/docker-syncd-mrvl/supervisord.conf @@ -4,19 +4,20 @@ logfile_backups=2 nodaemon=true [eventlistener:dependent-startup] -command=python2 -m supervisord_dependent_startup +command=python3 -m supervisord_dependent_startup autostart=true autorestart=unexpected startretries=0 exitcodes=0,3 events=PROCESS_STATE -buffer_size=25 +buffer_size=1024 [eventlistener:supervisor-proc-exit-listener] -command=python2 /usr/bin/supervisor-proc-exit-listener --container-name syncd -events=PROCESS_STATE_EXITED +command=python3 /usr/bin/supervisor-proc-exit-listener --container-name syncd +events=PROCESS_STATE_EXITED,PROCESS_STATE_RUNNING autostart=true autorestart=unexpected +buffer_size=1024 [program:rsyslogd] command=/usr/sbin/rsyslogd -n -iNONE diff --git a/platform/marvell-armhf/libsaithrift-dev.dep b/platform/marvell-armhf/libsaithrift-dev.dep new file mode 100644 index 000000000000..be9da37e8d0a --- /dev/null +++ b/platform/marvell-armhf/libsaithrift-dev.dep @@ -0,0 +1,11 @@ +SPATH := $($(LIBSAITHRIFT_DEV)_SRC_PATH) +DEP_FILES := $(SONIC_COMMON_FILES_LIST) platform/marvell-armhf/libsaithrift-dev.mk platform/marvell-armhf/libsaithrift-dev.dep +DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) +SMDEP_PATHS := $(SPATH) $(SPATH)/bm/behavioral-model $(SPATH)/test/ptf $(SPATH)/test/saithrift/ctypesgen +$(foreach path, $(SMDEP_PATHS), $(eval $(path) :=$(filter-out $(SMDEP_PATHS),$(addprefix $(path)/, $(shell cd $(path) && git ls-files | grep -Ev " " ))))) + +$(LIBSAITHRIFT_DEV)_CACHE_MODE := GIT_CONTENT_SHA +$(LIBSAITHRIFT_DEV)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(LIBSAITHRIFT_DEV)_DEP_FILES := $(DEP_FILES) +$(LIBSAITHRIFT_DEV)_SMDEP_FILES := $(foreach path, $(SMDEP_PATHS), $($(path))) +$(LIBSAITHRIFT_DEV)_SMDEP_PATHS := $(SMDEP_PATHS) diff --git a/platform/marvell-armhf/linux-kernel-armhf.mk b/platform/marvell-armhf/linux-kernel-armhf.mk deleted file mode 100644 index ac7aa3faf19a..000000000000 --- a/platform/marvell-armhf/linux-kernel-armhf.mk +++ /dev/null @@ -1,6 +0,0 @@ -# linux kernel package for marvell armhf - -# Add platform specific DTB -LINUX_KERNEL_DTB = linux-image-4.9.189-armhf.deb -$(LINUX_KERNEL_DTB)_URL = https://github.com/Marvell-switching/sonic-marvell-binaries/raw/master/armhf/kernel/$(LINUX_KERNEL_DTB) -SONIC_ONLINE_DEBS += $(LINUX_KERNEL_DTB) diff --git a/platform/marvell-armhf/linux/Makefile b/platform/marvell-armhf/linux/Makefile deleted file mode 100644 index dba660649abf..000000000000 --- a/platform/marvell-armhf/linux/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -.ONESHELL: -SHELL = /bin/bash -.SHELLFLAGS += -e - -LINUX_KERNEL_MRVL_URL = https://github.com/Marvell-switching/sonic-marvell-binaries/raw/master/armhf/kernel/$(LINUX_KERNEL_DTB) - -$(addprefix $(DEST)/, $(LINUX_KERNEL_DTB)): $(DEST)/% : - # get deb package - wget -O $(DEST)/$(LINUX_KERNEL_DTB) $(LINUX_KERNEL_MRVL_URL) - diff --git a/platform/marvell-armhf/one-image.dep b/platform/marvell-armhf/one-image.dep new file mode 100644 index 000000000000..154112a82abc --- /dev/null +++ b/platform/marvell-armhf/one-image.dep @@ -0,0 +1 @@ +$(SONIC_ONE_IMAGE)_CACHE_MODE := none diff --git a/platform/marvell-armhf/one-image.mk b/platform/marvell-armhf/one-image.mk index 44bcd9595281..b72b553487f2 100644 --- a/platform/marvell-armhf/one-image.mk +++ b/platform/marvell-armhf/one-image.mk @@ -4,7 +4,7 @@ SONIC_ONE_IMAGE = sonic-marvell-armhf.bin $(SONIC_ONE_IMAGE)_MACHINE = marvell-armhf $(SONIC_ONE_IMAGE)_IMAGE_TYPE = onie $(SONIC_ONE_IMAGE)_INSTALLS += $(SYSTEMD_SONIC_GENERATOR) -$(SONIC_ONE_IMAGE)_INSTALLS += $(LINUX_KERNEL_DTB) +$(SONIC_ONE_IMAGE)_INSTALLS += $(MRVL_PRESTERA_DEB) $(SONIC_ONE_IMAGE)_LAZY_INSTALLS += $(ET6448M_PLATFORM) \ $(NOKIA_7215_PLATFORM) ifeq ($(INSTALL_DEBUG_TOOLS),y) diff --git a/platform/marvell-armhf/platform-et6448m.dep b/platform/marvell-armhf/platform-et6448m.dep new file mode 100644 index 000000000000..5f7e41d1f745 --- /dev/null +++ b/platform/marvell-armhf/platform-et6448m.dep @@ -0,0 +1,8 @@ +MPATH := $($(ET6448M_PLATFORM)_SRC_PATH) +DEP_FILES := $(SONIC_COMMON_FILES_LIST) platform/marvell-armhf/platform-et6448m.mk platform/marvell-armhf/platform-et6448m.dep +DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) +DEP_FILES += $(shell git ls-files $(MPATH)) + +$(ET6448M_PLATFORM)_CACHE_MODE := GIT_CONTENT_SHA +$(ET6448M_PLATFORM)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(ET6448M_PLATFORM)_DEP_FILES := $(DEP_FILES) diff --git a/platform/marvell-armhf/platform-nokia.dep b/platform/marvell-armhf/platform-nokia.dep new file mode 100644 index 000000000000..752a2016b6c5 --- /dev/null +++ b/platform/marvell-armhf/platform-nokia.dep @@ -0,0 +1,8 @@ +MPATH := $($(NOKIA_7215_PLATFORM)_SRC_PATH) +DEP_FILES := $(SONIC_COMMON_FILES_LIST) platform/marvell-armhf/platform-nokia.mk platform/marvell-armhf/platform-nokia.dep +DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) +DEP_FILES += $(shell git ls-files $(MPATH)) + +$(NOKIA_7215_PLATFORM)_CACHE_MODE := GIT_CONTENT_SHA +$(NOKIA_7215_PLATFORM)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(NOKIA_7215_PLATFORM)_DEP_FILES := $(DEP_FILES) diff --git a/platform/marvell-armhf/platform.conf b/platform/marvell-armhf/platform.conf index 7fc7af8519bc..ddc603490dbc 100644 --- a/platform/marvell-armhf/platform.conf +++ b/platform/marvell-armhf/platform.conf @@ -6,12 +6,12 @@ echo "Preparing for installation ... " # global defines kernel_addr=0x1100000 -fdt_addr=0x1000000 -initrd_addr=0x2000000 -VAR_LOG=512 +fdt_addr=0x2800000 +fdt_high=0x28fffff +initrd_addr=0x2900000 -kernel_fname="/boot/vmlinuz-4.19.0-9-2-armmp" -initrd_fname="/boot/initrd.img-4.19.0-9-2-armmp" +kernel_fname="/boot/vmlinuz-4.19.0-12-2-armmp" +initrd_fname="/boot/initrd.img-4.19.0-12-2-armmp" fdt_fname="/boot/armada-385-ET6448M_4G_Nand.dtb" if [ "$install_env" = "onie" ]; then @@ -45,9 +45,9 @@ elif [ "$PLATFORM" = "armhf-nokia_ixs7215_52x-r0" ]; then fdt_fname="/boot/armada-385-ipd6448m.dtb" - BOOTARGS='setenv bootargs root=/dev/'$demo_dev' rw rootwait rootfstype=ext4 panic=1 console=ttyS0,115200 ${othbootargs} ${mtdparts} ${linuxargs}' + BOOTARGS='setenv bootargs root=/dev/'$demo_dev' rw rootwait rootfstype=ext4 panic=1 console=ttyS0,${baudrate} ${othbootargs} ${mtdparts} ${linuxargs}' UBI_LOAD='scsi init; ext4load scsi 0:2 $kernel_addr $image_name; ext4load scsi 0:2 $fdt_addr $fdt_name; ext4load scsi 0:2 $initrd_addr $initrd_name' - BOOTARGS_OLD='setenv bootargs root=/dev/'$demo_dev' rw rootwait rootfstype=ext4 panic=1 console=ttyS0,115200 ${othbootargs} ${mtdparts} ${linuxargs_old}' + BOOTARGS_OLD='setenv bootargs root=/dev/'$demo_dev' rw rootwait rootfstype=ext4 panic=1 console=ttyS0,${baudrate} ${othbootargs} ${mtdparts} ${linuxargs_old}' UBI_LOAD_OLD='scsi init; ext4load scsi 0:2 $kernel_addr $image_name_old; ext4load scsi 0:2 $fdt_addr $fdt_name_old; ext4load scsi 0:2 $initrd_addr $initrd_name_old' UBIBOOTCMD='run ubi_sonic_boot_bootargs; run ubi_sonic_boot_load; test -n "$boot_once" && setenv boot_once "" && saveenv; bootz $kernel_addr $initrd_addr $fdt_addr' UBIBOOTCMD_OLD='run ubi_sonic_boot_bootargs_old; run ubi_sonic_boot_load_old; test -n "$boot_once" && setenv boot_once "" && saveenv; bootz $kernel_addr $initrd_addr $fdt_addr' @@ -75,7 +75,7 @@ prepare_boot_menu() { UBOOT_ENV_ERASE_SIZ="0x$(grep uboot-env /proc/mtd | awk '{print $3}')" if [[ -n "$UBOOT_ENV_SIZ" && -n "$UBOOT_ENV_ERASE_SIZ" ]] then - # Env info from DTB + # Env info from DTB FW_ENV_DTB="/dev/$DTB_HAS_ENV_BLK 0x00000000 $UBOOT_ENV_SIZ $UBOOT_ENV_ERASE_SIZ" fi fi @@ -118,11 +118,42 @@ prepare_boot_menu() { fdt_name_old="" sonic_version_2="None" else - image_dir_old=$(fw_printenv -n image_dir || true) - image_name_old=$(fw_printenv -n image_name || true) - initrd_name_old=$(fw_printenv -n initrd_name || true) - fdt_name_old=$(fw_printenv -n fdt_name || true) - sonic_version_2=$(fw_printenv -n sonic_version_1 || true) + eval running_version="$(cat /proc/cmdline | sed -n 's/^.*loop=\/*image-\(\S\+\)\/.*$/\1/p')" + current_boot_next=$(fw_printenv -n boot_next || true) + running_sonic_image=1 + if [ "$current_boot_next" = "run sonic_image_1" ]; then + # boot_next=run sonic_image_1 + sonic_version_2=$(fw_printenv -n sonic_version_2 || true) + if test "${sonic_version_2#*$running_version}" != "$sonic_version_2" + then + running_sonic_image=2 + else + running_sonic_image=1 + fi + else + # boot_next=run sonic_image_2 + sonic_version_1=$(fw_printenv -n sonic_version_1 || true) + if test "${sonic_version_1#*$running_version}" != "$sonic_version_1" + then + running_sonic_image=1 + else + running_sonic_image=2 + fi + fi + + if [ $running_sonic_image -eq 1 ]; then + image_dir_old=$(fw_printenv -n image_dir || true) + image_name_old=$(fw_printenv -n image_name || true) + initrd_name_old=$(fw_printenv -n initrd_name || true) + fdt_name_old=$(fw_printenv -n fdt_name || true) + sonic_version_2=$(fw_printenv -n sonic_version_1 || true) + else + image_dir_old=$(fw_printenv -n image_dir_old || true) + image_name_old=$(fw_printenv -n image_name_old || true) + initrd_name_old=$(fw_printenv -n initrd_name_old || true) + fdt_name_old=$(fw_printenv -n fdt_name_old || true) + sonic_version_2=$(fw_printenv -n sonic_version_2 || true) + fi fi # Set boot variables @@ -144,14 +175,15 @@ prepare_boot_menu() { BOOT3='echo " > Boot3: ONIE - run onie_nand_boot";echo;' fi BORDER='echo "---------------------------------------------------";echo;' - fw_setenv ${FW_ARG} print_menu $BORDER $BOOT1 $BOOT2 $BOOT3 $BORDER > /dev/null + fw_setenv ${FW_ARG} print_menu "$BORDER $BOOT1 $BOOT2 $BOOT3 $BORDER" > /dev/null - fw_setenv ${FW_ARG} linuxargs "net.ifnames=0 loopfstype=squashfs loop=$image_dir/$FILESYSTEM_SQUASHFS varlog_size=$VAR_LOG loglevel=4" > /dev/null - fw_setenv ${FW_ARG} linuxargs_old "net.ifnames=0 loopfstype=squashfs loop=$image_dir_old/$FILESYSTEM_SQUASHFS varlog_size=$VAR_LOG loglevel=4" > /dev/null + fw_setenv ${FW_ARG} linuxargs "net.ifnames=0 loopfstype=squashfs loop=$image_dir/$FILESYSTEM_SQUASHFS systemd.unified_cgroup_hierarchy=0 varlog_size=$VAR_LOG_SIZE loglevel=4" > /dev/null + fw_setenv ${FW_ARG} linuxargs_old "net.ifnames=0 loopfstype=squashfs loop=$image_dir_old/$FILESYSTEM_SQUASHFS systemd.unified_cgroup_hierarchy=0 varlog_size=$VAR_LOG_SIZE loglevel=4" > /dev/null # Set boot configs fw_setenv ${FW_ARG} kernel_addr $kernel_addr > /dev/null fw_setenv ${FW_ARG} fdt_addr $fdt_addr > /dev/null + fw_setenv ${FW_ARG} fdt_high $fdt_high > /dev/null fw_setenv ${FW_ARG} initrd_addr $initrd_addr > /dev/null fw_setenv ${FW_ARG} mtdids 'nand0=armada-nand' > /dev/null if [ $UBOOT_FW_DEFAULT -eq 1 ] @@ -164,11 +196,11 @@ prepare_boot_menu() { fw_setenv ${FW_ARG} mtdparts 'mtdparts=spi0.0:4m(boot),-(spi-rootfs)' > /dev/null fi fw_setenv ${FW_ARG} ubi_sonic_boot_mount_ubi 'ubi part SONIC; ubifsmount ubi0' > /dev/null - fw_setenv ${FW_ARG} ubi_sonic_boot_bootargs $BOOTARGS > /dev/null - fw_setenv ${FW_ARG} ubi_sonic_boot_load $UBI_LOAD > /dev/null + fw_setenv ${FW_ARG} ubi_sonic_boot_bootargs "$BOOTARGS" > /dev/null + fw_setenv ${FW_ARG} ubi_sonic_boot_load "$UBI_LOAD" > /dev/null fw_setenv ${FW_ARG} sonic_image_1 "$UBIBOOTCMD" > /dev/null - fw_setenv ${FW_ARG} ubi_sonic_boot_bootargs_old $BOOTARGS_OLD > /dev/null - fw_setenv ${FW_ARG} ubi_sonic_boot_load_old $UBI_LOAD_OLD > /dev/null + fw_setenv ${FW_ARG} ubi_sonic_boot_bootargs_old "$BOOTARGS_OLD" > /dev/null + fw_setenv ${FW_ARG} ubi_sonic_boot_load_old "$UBI_LOAD_OLD" > /dev/null fw_setenv ${FW_ARG} sonic_image_2 "$UBIBOOTCMD_OLD" > /dev/null fw_setenv ${FW_ARG} boot_next 'run sonic_image_1'> /dev/null fw_setenv ${FW_ARG} bootcmd 'run print_menu; usb start; test -n "$boot_once" && run boot_once; run boot_next' > /dev/null @@ -176,7 +208,7 @@ prepare_boot_menu() { } create_ubi_partition() { - ubidetach /dev/ubi_ctrl -d 0 2>/dev/null || true + ubidetach /dev/ubi_ctrl -d 0 2>/dev/null || true trap_push "${onie_bin} ubidetach -d 0 /dev/ubi_ctrl || true" echo -en "Format mtd partition '$mtd_dev' " @@ -196,7 +228,7 @@ create_ubi_partition() { create_gpt_partition() { blk_dev="/dev/sda" - demo_part=$(sgdisk -p $blk_dev | grep -e "$demo_volume_label" -e "$legacy_volume_label" | awk '{print $1}') + demo_part=$(sgdisk -p $blk_dev | grep -e "$demo_volume_label" | awk '{print $1}') # ONIE partition size 168MB onie_part_size=168 @@ -232,7 +264,7 @@ create_gpt_partition() { } create_partition() { - # Platform speicific partition + # Platform speicific partition if [ "$PLATFORM" = "armhf-marvell_et6448m_52x-r0" ]; then echo "Doing UBI partition" create_ubi_partition diff --git a/platform/marvell-armhf/prestera.dep b/platform/marvell-armhf/prestera.dep new file mode 100644 index 000000000000..4fd2883b1193 --- /dev/null +++ b/platform/marvell-armhf/prestera.dep @@ -0,0 +1,8 @@ +MPATH := $($(MRVL_PRESTERA_DEB)_SRC_PATH) +DEP_FILES := $(SONIC_COMMON_FILES_LIST) platform/marvell-armhf/prestera.mk platform/marvell-armhf/prestera.dep +DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) +DEP_FILES += $(shell git ls-files $(MPATH)) + +$(MRVL_PRESTERA_DEB)_CACHE_MODE := GIT_CONTENT_SHA +$(MRVL_PRESTERA_DEB)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(MRVL_PRESTERA_DEB)_DEP_FILES := $(DEP_FILES) diff --git a/platform/marvell-armhf/prestera.mk b/platform/marvell-armhf/prestera.mk new file mode 100644 index 000000000000..a45b0c6a26fa --- /dev/null +++ b/platform/marvell-armhf/prestera.mk @@ -0,0 +1,11 @@ +# Marvell Prestera + +export MRVL_PRESTERA_VER = 1.0 +export MRVL_PRESTERA = mrvlprestera_$(MRVL_PRESTERA_VER)_$(PLATFORM_ARCH) +export MRVL_PRESTERA_DEB = $(MRVL_PRESTERA).deb +export MRVL_PRESTERA_SRC_URL = https://github.com/Marvell-switching/mrvl-prestera.git +export MRVL_PRESTERA_SRC_TAG = MRVL_PRESTERA_DRIVER_1.1_1 + +$(MRVL_PRESTERA_DEB)_SRC_PATH = $(PLATFORM_PATH)/prestera +$(MRVL_PRESTERA_DEB)_DEPENDS += $(LINUX_HEADERS) $(LINUX_HEADERS_COMMON) +SONIC_DPKG_DEBS += $(MRVL_PRESTERA_DEB) diff --git a/platform/marvell-armhf/prestera/debian/changelog b/platform/marvell-armhf/prestera/debian/changelog new file mode 100644 index 000000000000..ab8de1dfa386 --- /dev/null +++ b/platform/marvell-armhf/prestera/debian/changelog @@ -0,0 +1,5 @@ +mrvlprestera (1.0) unstable; urgency=low + + * Prestera switch driver + + -- Marvell Fri, 19 Feb 2021 10:39:18 +0800 diff --git a/platform/marvell-armhf/prestera/debian/compat b/platform/marvell-armhf/prestera/debian/compat new file mode 100644 index 000000000000..ec635144f600 --- /dev/null +++ b/platform/marvell-armhf/prestera/debian/compat @@ -0,0 +1 @@ +9 diff --git a/platform/marvell-armhf/prestera/debian/control b/platform/marvell-armhf/prestera/debian/control new file mode 100755 index 000000000000..51cb0579a263 --- /dev/null +++ b/platform/marvell-armhf/prestera/debian/control @@ -0,0 +1,15 @@ +Source: mrvlprestera +Section: unknown +Priority: optional +Maintainer: Marvell +Build-Depends: debhelper (>=9) +Standards-Version: 3.9.6 +Homepage: +#Vcs-Git: git://anonscm.debian.org/collab-maint/mrvlprestera.git +#Vcs-Browser: https://anonscm.debian.org/cgit/collab-maint/mrvlprestera.git + +Package: mrvlprestera +Architecture: armhf +Homepage: +Description: + kernel modules for prestera switch driver diff --git a/platform/marvell-armhf/prestera/debian/mrvlprestera.install.template b/platform/marvell-armhf/prestera/debian/mrvlprestera.install.template new file mode 100644 index 000000000000..d0e96ab1e7d6 --- /dev/null +++ b/platform/marvell-armhf/prestera/debian/mrvlprestera.install.template @@ -0,0 +1,3 @@ +mrvl-prestera/cpssEnabler/linuxNoKernelModule/drivers/mvDmaDrv.ko /lib/modules/KVERSION/kernel/extra +mrvl-prestera/cpssEnabler/linuxNoKernelModule/drivers/mvIntDrv.ko /lib/modules/KVERSION/kernel/extra +mrvl-prestera/platform/armhf/* / diff --git a/platform/marvell-armhf/prestera/debian/rules b/platform/marvell-armhf/prestera/debian/rules new file mode 100755 index 000000000000..18e4f82e9f64 --- /dev/null +++ b/platform/marvell-armhf/prestera/debian/rules @@ -0,0 +1,54 @@ +#!/usr/bin/make -f + +include /usr/share/dpkg/pkg-info.mk + +PACKAGE_PRE_NAME := mrvlprestera +KVERSION ?= $(shell uname -r) +KERNEL_SRC := /lib/modules/$(KVERSION) +MOD_SRC_DIR:= $(shell pwd) +MODULE_DIR := mrvl-prestera/cpssEnabler/linuxNoKernelModule/drivers + +%: + dh $@ --with systemd,python2,python3 --buildsystem=pybuild + +clean: + dh_testdir + dh_testroot + dh_clean + +build: + # get sources + rm -rf mrvl-prestera || true + git clone ${MRVL_PRESTERA_SRC_URL} + cd mrvl-prestera && git checkout ${MRVL_PRESTERA_SRC_TAG} && cd .. + sed "s/KVERSION/${KVERSION}/g" /sonic/platform/marvell-armhf/prestera/debian/mrvlprestera.install.template > /sonic/platform/marvell-armhf/prestera/debian/mrvlprestera.install + + make modules -C $(KERNEL_SRC)/build M=$(MOD_SRC_DIR)/$(MODULE_DIR)/ + +binary: binary-arch binary-indep + # Nothing to do + +binary-arch: + # Nothing to do + +binary-indep: + dh_testdir + dh_installdirs + + # Resuming debhelper scripts + dh_testroot + dh_install + dh_installchangelogs + dh_installdocs + dh_systemd_enable + dh_installinit + dh_systemd_start + dh_link + dh_fixperms + dh_compress + dh_strip + dh_installdeb + dh_gencontrol + dh_md5sums + dh_builddeb +.PHONY: build binary binary-arch binary-indep clean diff --git a/platform/marvell-armhf/rules.dep b/platform/marvell-armhf/rules.dep new file mode 100644 index 000000000000..427219b355d6 --- /dev/null +++ b/platform/marvell-armhf/rules.dep @@ -0,0 +1,9 @@ +include $(PLATFORM_PATH)/sai.dep +include $(PLATFORM_PATH)/prestera.dep +include $(PLATFORM_PATH)/docker-syncd-mrvl.dep +include $(PLATFORM_PATH)/docker-syncd-mrvl-rpc.dep +include $(PLATFORM_PATH)/docker-saiserver-mrvl.dep +include $(PLATFORM_PATH)/libsaithrift-dev.dep +include $(PLATFORM_PATH)/platform-et6448m.dep +include $(PLATFORM_PATH)/platform-nokia.dep +include $(PLATFORM_PATH)/one-image.dep diff --git a/platform/marvell-armhf/rules.mk b/platform/marvell-armhf/rules.mk index e53f9531b82b..fd320e8caa41 100644 --- a/platform/marvell-armhf/rules.mk +++ b/platform/marvell-armhf/rules.mk @@ -4,13 +4,11 @@ include $(PLATFORM_PATH)/docker-syncd-mrvl.mk include $(PLATFORM_PATH)/docker-syncd-mrvl-rpc.mk include $(PLATFORM_PATH)/docker-saiserver-mrvl.mk include $(PLATFORM_PATH)/libsaithrift-dev.mk -include $(PLATFORM_PATH)/docker-ptf-mrvl.mk include $(PLATFORM_PATH)/one-image.mk -include $(PLATFORM_PATH)/linux-kernel-armhf.mk include $(PLATFORM_PATH)/platform-et6448m.mk include $(PLATFORM_PATH)/platform-nokia.mk +include $(PLATFORM_PATH)/prestera.mk -INCLUDE_SYSTEM_TELEMETRY = "" ENABLE_SYNCD_RPC = "" INCLUDE_MGMT_FRAMEWORK = "" diff --git a/platform/marvell-armhf/sai.dep b/platform/marvell-armhf/sai.dep new file mode 100644 index 000000000000..d14927cdde20 --- /dev/null +++ b/platform/marvell-armhf/sai.dep @@ -0,0 +1,9 @@ +SPATH := $($(MRVL_SAI)_SRC_PATH) +DEP_FILES := $(SONIC_COMMON_FILES_LIST) platform/marvell-armhf/sai.mk platform/marvell-armhf/sai.dep +DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) +DEP_FILES += $(shell git ls-files $(SPATH)) +SMDEP_PATHS := $(SPATH) + +$(MRVL_SAI)_CACHE_MODE := GIT_CONTENT_SHA +$(MRVL_SAI)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(MRVL_SAI)_DEP_FILES := $(DEP_FILES) diff --git a/platform/marvell-armhf/sai.mk b/platform/marvell-armhf/sai.mk index 70aebfb514e3..8643b470c222 100644 --- a/platform/marvell-armhf/sai.mk +++ b/platform/marvell-armhf/sai.mk @@ -1,7 +1,7 @@ # Marvell SAI -export MRVL_SAI_VERSION = 1.7.1 -export MRVL_SAI = mrvllibsai_m0_MASTER_$(PLATFORM_ARCH)_$(MRVL_SAI_VERSION).deb +export MRVL_SAI_VERSION = 1.7.1-9 +export MRVL_SAI = mrvllibsai_$(MRVL_SAI_VERSION)_$(PLATFORM_ARCH).deb $(MRVL_SAI)_SRC_PATH = $(PLATFORM_PATH)/sai $(eval $(call add_conflict_package,$(MRVL_SAI),$(LIBSAIVS_DEV))) diff --git a/platform/marvell-armhf/sonic-platform-et6448m/entropy.py b/platform/marvell-armhf/sonic-platform-et6448m/entropy.py index 338e2ad9bcea..a2131cdc17fb 100644 --- a/platform/marvell-armhf/sonic-platform-et6448m/entropy.py +++ b/platform/marvell-armhf/sonic-platform-et6448m/entropy.py @@ -6,8 +6,11 @@ RNDADDENTROPY=0x40085203 def avail(): - with open("/proc/sys/kernel/random/entropy_avail", mode='r') as avail: - return int(avail.read()) + if path.exists("/proc/sys/kernel/random/entropy_avail"): + with open("/proc/sys/kernel/random/entropy_avail", mode='r') as avail: + return int(avail.read()) + else: + return int(2048) if path.exists("/proc/sys/kernel/random/entropy_avail"): while 1: diff --git a/platform/marvell-armhf/sonic-platform-nokia/7215/scripts/nokia-7215init.sh b/platform/marvell-armhf/sonic-platform-nokia/7215/scripts/nokia-7215init.sh index 43cd86d59bd0..f8a7ad54b310 100755 --- a/platform/marvell-armhf/sonic-platform-nokia/7215/scripts/nokia-7215init.sh +++ b/platform/marvell-armhf/sonic-platform-nokia/7215/scripts/nokia-7215init.sh @@ -51,6 +51,10 @@ chmod 644 /sys/class/i2c-adapter/i2c-0/0-0053/eeprom echo eeprom 0x55 > /sys/class/i2c-adapter/i2c-0/new_device echo eeprom 0x56 > /sys/class/i2c-adapter/i2c-0/new_device +# Enumerate PSU eeprom devices +echo eeprom 0x50 > /sys/class/i2c-adapter/i2c-1/new_device +echo eeprom 0x51 > /sys/class/i2c-adapter/i2c-1/new_device + # Enable optical SFP Tx i2cset -y -m 0x0f 0 0x41 0x5 0x00 diff --git a/platform/marvell-armhf/sonic-platform-nokia/7215/service/fstrim.timer/timer-override.conf b/platform/marvell-armhf/sonic-platform-nokia/7215/service/fstrim.timer/timer-override.conf new file mode 100644 index 000000000000..0456c60d42b0 --- /dev/null +++ b/platform/marvell-armhf/sonic-platform-nokia/7215/service/fstrim.timer/timer-override.conf @@ -0,0 +1,5 @@ +[Unit] +Description=Discard unused blocks daily + +[Timer] +OnCalendar=daily diff --git a/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/__init__.py b/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/__init__.py index 139597f9cb07..39c712316dc6 100755 --- a/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/__init__.py +++ b/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/__init__.py @@ -1,2 +1,4 @@ +__all__ = ["platform", "chassis"] +from sonic_platform import * diff --git a/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/chassis.py b/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/chassis.py index 7597492cc003..cf67a7bb30ac 100755 --- a/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/chassis.py +++ b/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/chassis.py @@ -13,7 +13,7 @@ from sonic_platform.sfp import Sfp from sonic_platform.eeprom import Eeprom from sonic_platform.fan import Fan - from .fan_drawer import VirtualDrawer + from .fan_drawer import RealDrawer from sonic_platform.psu import Psu from sonic_platform.thermal import Thermal from sonic_platform.component import Component @@ -27,6 +27,11 @@ except ImportError as e: smbus_present = 0 +if sys.version_info[0] < 3: + import commands as cmd +else: + import subprocess as cmd + MAX_SELECT_DELAY = 3600 COPPER_PORT_START = 1 COPPER_PORT_END = 48 @@ -35,8 +40,8 @@ PORT_END = 52 # Device counts -MAX_7215_FAN_DRAWER = 1 -MAX_7215_FAN = 2 +MAX_7215_FAN_DRAWERS = 2 +MAX_7215_FANS_PER_DRAWER = 1 MAX_7215_PSU = 2 MAX_7215_THERMAL = 6 @@ -89,9 +94,9 @@ def __init__(self): self._eeprom = Eeprom() # Construct lists fans, power supplies, thermals & components - drawer_num = MAX_7215_FAN_DRAWER - fan_num_per_drawer = MAX_7215_FAN - drawer_ctor = VirtualDrawer + drawer_num = MAX_7215_FAN_DRAWERS + fan_num_per_drawer = MAX_7215_FANS_PER_DRAWER + drawer_ctor = RealDrawer fan_index = 0 for drawer_index in range(drawer_num): drawer = drawer_ctor(drawer_index) @@ -159,13 +164,13 @@ def get_model(self): """ return self._eeprom.part_number_str() - def get_serial(self): + def get_service_tag(self): """ - Retrieves the serial number of the chassis (Service tag) + Retrieves the Service Tag of the chassis Returns: - string: Serial number of chassis + string: Service Tag of chassis """ - return self._eeprom.serial_str() + return self._eeprom.service_tag_str() def get_status(self): """ @@ -186,7 +191,7 @@ def get_base_mac(self): """ return self._eeprom.base_mac_addr() - def get_serial_number(self): + def get_serial(self): """ Retrieves the hardware serial number for the chassis @@ -278,6 +283,9 @@ def get_thermal_manager(self): from .thermal_manager import ThermalManager return ThermalManager + def initizalize_system_led(self): + return True + def set_status_led(self, color): """ Sets the state of the system LED @@ -306,17 +314,18 @@ def set_status_led(self, color): return False # Write sys led - if smbus_present == 0: - sonic_logger.log_info("PMON LED SET ERROR-> smbus present = 0") + if smbus_present == 0: # called from host (e.g. 'show system-health') + cmdstatus, value = cmd.getstatusoutput('sudo i2cset -y 0 0x41 0x7 %d' % value) + if cmdstatus: + sonic_logger.log_warning(" System LED set %s failed" % value) + return False else: bus = smbus.SMBus(0) DEVICE_ADDRESS = 0x41 DEVICEREG = 0x7 bus.write_byte_data(DEVICE_ADDRESS, DEVICEREG, value) - sonic_logger.log_info(" System LED set O.K. ") - return True - return False + return True def get_status_led(self): """ @@ -327,29 +336,29 @@ def get_status_led(self): specified. """ # Read sys led - if smbus_present == 0: - sonic_logger.log_info("PMON LED GET ERROR-> smbus present = 0") - return False + if smbus_present == 0: # called from host + cmdstatus, value = cmd.getstatusoutput('sudo i2cget -y 0 0x41 0x7') + value = int(value, 16) else: bus = smbus.SMBus(0) DEVICE_ADDRESS = 0x41 DEVICE_REG = 0x7 value = bus.read_byte_data(DEVICE_ADDRESS, DEVICE_REG) - if value == 0x00: - color = 'off' - elif value == 0x01: - color = 'amber' - elif value == 0x02: - color = 'green' - elif value == 0x03: - color = 'amber_blink' - elif value == 0x04: - color = 'green_blink' - else: - return False + if value == 0x00: + color = 'off' + elif value == 0x01: + color = 'amber' + elif value == 0x02: + color = 'green' + elif value == 0x03: + color = 'amber_blink' + elif value == 0x04: + color = 'green_blink' + else: + return None - return color + return color def get_watchdog(self): """ @@ -372,6 +381,23 @@ def get_watchdog(self): watchdog_device_path = "/dev/watchdog0" self._watchdog = WatchdogImplBase(watchdog_device_path) except Exception as e: - sonic_logger.log_info("Fail to load watchdog {}".format(repr(e))) + sonic_logger.log_warning(" Fail to load watchdog {}".format(repr(e))) return self._watchdog + + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device. If the agent cannot determine the parent-relative position + for some reason, or if the associated value of entPhysicalContainedIn is '0', then the value '-1' is returned + Returns: + integer: The 1-based relative physical position in parent device or -1 if cannot determine the position + """ + return -1 + + def is_replaceable(self): + """ + Indicate whether this device is replaceable. + Returns: + bool: True if it is replaceable. + """ + return False diff --git a/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/component.py b/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/component.py index 6a5410458df7..134856ea4213 100644 --- a/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/component.py +++ b/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/component.py @@ -16,6 +16,7 @@ except ImportError as e: raise ImportError(str(e) + "- required module not found") +smbus_present = 1 try: import smbus except ImportError as e: @@ -34,6 +35,7 @@ class Component(ComponentBase): ["System-CPLD", "Used for managing SFPs, LEDs, PSUs and FANs "], ["U-Boot", "Performs initialization during booting"], ] + CPLD_UPDATE_COMMAND = 'cp /usr/sbin/vme /tmp; cp {} /tmp; cd /tmp; ./vme {};' def __init__(self, component_index): self.index = component_index @@ -55,12 +57,12 @@ def _get_command_result(self, cmdline): def _get_cpld_version(self, cpld_number): if smbus_present == 0: - cmdstatus, cpld_version = cmd.getstatusoutput('i2cget -y 0 0x41 0x2') + cmdstatus, cpld_version = cmd.getstatusoutput('sudo i2cget -y 0 0x41 0x2') else: bus = smbus.SMBus(0) DEVICE_ADDRESS = 0x41 DEVICE_REG = 0x2 - cpld_version = bus.read_byte_data(DEVICE_ADDRESS, DEVICE_REG) + cpld_version = str(bus.read_byte_data(DEVICE_ADDRESS, DEVICE_REG)) return str(int(cpld_version, 16)) @@ -73,6 +75,55 @@ def get_name(self): """ return self.name + def get_model(self): + """ + Retrieves the part number of the component + Returns: + string: Part number of component + """ + return 'NA' + + def get_serial(self): + """ + Retrieves the serial number of the component + Returns: + string: Serial number of component + """ + return 'NA' + + def get_presence(self): + """ + Retrieves the presence of the component + Returns: + bool: True if present, False if not + """ + return True + + def get_status(self): + """ + Retrieves the operational status of the component + Returns: + bool: True if component is operating properly, False if not + """ + return True + + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device. + Returns: + integer: The 1-based relative physical position in parent + device or -1 if cannot determine the position + """ + return -1 + + def is_replaceable(self): + """ + Indicate whether component is replaceable. + Returns: + bool: True if it is replaceable. + """ + return False + def get_description(self): """ Retrieves the description of the component @@ -93,7 +144,7 @@ def get_firmware_version(self): return self._get_cpld_version(self.index) if self.index == 1: - cmdstatus, uboot_version = cmd.getstatusoutput('grep --null-data U-Boot /dev/mtd0ro|head -1 | cut -c 1-30') + cmdstatus, uboot_version = cmd.getstatusoutput('grep --null-data U-Boot /dev/mtd0ro|head -1 | cut -d" " -f2-4') return uboot_version def install_firmware(self, image_path): @@ -114,6 +165,18 @@ def install_firmware(self, image_path): print("ERROR: the cpld image {} doesn't exist ".format(image_path)) return False + cmdline = self.CPLD_UPDATE_COMMAND.format(image_path, image_name) + success_flag = False + try: + subprocess.check_call(cmdline, stderr=subprocess.STDOUT, shell=True) + success_flag = True + except subprocess.CalledProcessError as e: + print("ERROR: Failed to upgrade CPLD: rc={}".format(e.returncode)) + + if success_flag: + print("INFO: Refresh or power cycle is required to finish CPLD installation") + return success_flag + diff --git a/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/eeprom.py b/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/eeprom.py index cefcedaedf12..b3b31605b246 100644 --- a/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/eeprom.py +++ b/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/eeprom.py @@ -1,5 +1,5 @@ ######################################################################## -# Nokia IXR7220_D1 +# Nokia IXS7215 # # Module contains platform specific implementation of SONiC Platform # Base API and provides the EEPROMs' information. @@ -7,32 +7,28 @@ # The different EEPROMs available are as follows: # - System EEPROM : Contains Serial number, Service tag, Base MA # address, etc. in ONIE TlvInfo EEPROM format. -# - PSU EEPROM : Contains Serial number, Part number, Service Tag, -# PSU type, Revision. -# - Fan EEPROM : Contains Serial number, Part number, Service Tag, -# Fan type, Number of Fans in Fantray, Revision. +# - PSU EEPROM : Contains Model name and Part number. +# - Fan EEPROM : Contains Part number, Serial number, Manufacture Date, +# and Service Tag. ######################################################################## try: from sonic_platform_base.sonic_eeprom.eeprom_base import EepromDecoder from sonic_platform_base.sonic_eeprom.eeprom_tlvinfo import TlvInfoDecoder + from sonic_py_common import logger except ImportError as e: raise ImportError(str(e) + "- required module not found") # PSU eeprom fields in format required by EepromDecoder psu_eeprom_format = [ - ('PPID', 's', 20), ('DPN Rev', 's', 3), ('Service Tag', 's', 7), - ('Part Number', 's', 10), ('Part Num Revision', 's', 3), - ('Mfg Test', 's', 2), ('Redundant copy', 's', 83), ('PSU Type', 's', 1), - ('Fab Rev', 's', 2) + ('Model', 's', 15), ('burn', 'x', 1), + ('Part Number', 's', 14), ('burn', 'x', 40), + ('Serial Number', 's', 11) ] -# Fan eeprom fields in format required by EepromDecoder -fan_eeprom_format = [ - ('Model', 's', 12), ('Serial Number', 's', 13) - ] +sonic_logger = logger.Logger('eeprom') class Eeprom(TlvInfoDecoder): @@ -48,6 +44,7 @@ def __init__(self, is_psu=False, psu_index=0, is_fan=False, fan_index=0): if self.is_sys_eeprom: self.start_offset = 0 self.eeprom_path = self.I2C_DIR + "i2c-0/0-0053/eeprom" + # System EEPROM is in ONIE TlvInfo EEPROM format super(Eeprom, self).__init__(self.eeprom_path, self.start_offset, '', True) @@ -55,18 +52,24 @@ def __init__(self, is_psu=False, psu_index=0, is_fan=False, fan_index=0): else: if self.is_psu_eeprom: self.index = psu_index - self.start_offset = 6 + self.start_offset = 18 self.eeprom_path = self.I2C_DIR \ - + "i2c-1/1-005{}/eeprom".format(2 - self.index) + + "i2c-1/1-005{}/eeprom".format(self.index - 1) self.format = psu_eeprom_format + + # Decode device eeprom as per specified format + EepromDecoder.__init__(self, self.eeprom_path, self.format, + self.start_offset, '', True) else: self.index = fan_index - self.start_offset = 13 + self.start_offset = 0 self.eeprom_path = self.I2C_DIR \ - + "i2c-4{0}/4{0}-0050/eeprom".format(self.index - 1) - self.format = fan_eeprom_format - EepromDecoder.__init__(self, self.eeprom_path, self.format, - self.start_offset, '', True) + + "i2c-0/0-005{}/eeprom".format(self.index + 4) + + # Fan EEPROM is in ONIE TlvInfo EEPROM format + super(Eeprom, self).__init__(self.eeprom_path, + self.start_offset, '', True) + self._load_device_eeprom() def _load_system_eeprom(self): @@ -79,28 +82,30 @@ def _load_system_eeprom(self): # Read System EEPROM as per ONIE TlvInfo EEPROM format. self.eeprom_data = self.read_eeprom() except Exception as e: + sonic_logger.log_warning("Unable to read system eeprom") self.base_mac = 'NA' self.serial_number = 'NA' self.part_number = 'NA' self.model_str = 'NA' - self.serial = 'NA' + self.service_tag = 'NA' self.eeprom_tlv_dict = dict() else: eeprom = self.eeprom_data - self.eeprom_tlv_dict = dict() - if not self.is_valid_tlvinfo_header(eeprom): + sonic_logger.log_warning("Invalid system eeprom TLV header") self.base_mac = 'NA' self.serial_number = 'NA' self.part_number = 'NA' self.model_str = 'NA' - self.serial = 'NA' + self.service_tag = 'NA' return total_length = (eeprom[9] << 8) | eeprom[10] tlv_index = self._TLV_INFO_HDR_LEN tlv_end = self._TLV_INFO_HDR_LEN + total_length + # Construct dictionary of eeprom TLV entries + self.eeprom_tlv_dict = dict() while (tlv_index + 2) < len(eeprom) and tlv_index < tlv_end: if not self.is_valid_tlv(eeprom[tlv_index:]): break @@ -108,7 +113,7 @@ def _load_system_eeprom(self): tlv = eeprom[tlv_index:tlv_index + 2 + eeprom[tlv_index + 1]] code = "0x%02X" % (tlv[0]) - + name, value = self.decoder(None, tlv) self.eeprom_tlv_dict[code] = value @@ -118,56 +123,103 @@ def _load_system_eeprom(self): tlv_index += eeprom[tlv_index+1] + 2 self.base_mac = self.eeprom_tlv_dict.get( - "0x%X" % (self._TLV_CODE_MAC_BASE), 'NA') + "0x%X" % (self._TLV_CODE_MAC_BASE), 'NA') self.serial_number = self.eeprom_tlv_dict.get( - "0x%X" % (self._TLV_CODE_SERIAL_NUMBER), 'NA') + "0x%X" % (self._TLV_CODE_SERIAL_NUMBER), 'NA') self.part_number = self.eeprom_tlv_dict.get( - "0x%X" % (self._TLV_CODE_PART_NUMBER), 'NA') + "0x%X" % (self._TLV_CODE_PART_NUMBER), 'NA') self.model_str = self.eeprom_tlv_dict.get( - "0x%X" % (self._TLV_CODE_PRODUCT_NAME), 'NA') - self.serial = self.eeprom_tlv_dict.get( - "0x%X" % (self._TLV_CODE_SERVICE_TAG), 'NA') + "0x%X" % (self._TLV_CODE_PRODUCT_NAME), 'NA') + self.service_tag = self.eeprom_tlv_dict.get( + "0x%X" % (self._TLV_CODE_SERVICE_TAG), 'NA') def _load_device_eeprom(self): """ - Reads the Fan/PSU EEPROM and retrieves the serial number and - model number of the device. + Reads the Fan/PSU EEPROM and interprets as per the specified format """ - try: - # Read Fan/PSU EEPROM as per the specified format. - self.eeprom_data = EepromDecoder.read_eeprom(self) - except Exception as e: - self.serial_number = 'NA' - self.part_number = 'NA' - self.model_str = 'NA' - self.serial = 'NA' - else: + self.serial_number = 'NA' + self.part_number = 'NA' + self.model_str = 'NA' + self.service_tag = 'NA' + self.mfg_date = 'NA' + + # PSU device eeproms use proprietary format + if self.is_psu_eeprom: + try: + # Read Fan/PSU EEPROM as per the specified format. + self.eeprom_data = EepromDecoder.read_eeprom(self) + except Exception as e: + sonic_logger.log_warning("Unable to read device eeprom for PSU#{}".format(self.index)) + return + + # Bail out if PSU eeprom unavailable + if self.eeprom_data[0] == 255: + sonic_logger.log_warning("Uninitialized device eeprom for PSU#{}".format(self.index)) + return + (valid, data) = self._get_eeprom_field("Model") if valid: - self.model_str = data - else: - self.model_str = 'NA' + self.model_str = data.decode() - (valid, data) = self._get_eeprom_field("Serial Number") + (valid, data) = self._get_eeprom_field("Part Number") if valid: - self.serial_number = data - else: - self.serial_number = 'NA' + self.part_number = data.decode() - if self.is_psu_eeprom: - (valid, data) = self._get_eeprom_field("PSU Type") - if valid: - self.psu_type = data - else: - self.psu_type = 'NA' - else: - (valid, data) = self._get_eeprom_field("Fan Type") + # Early PSU device eeproms were not programmed with serial # + try: + (valid, data) = self._get_eeprom_field("Serial Number") if valid: - self.fan_type = data - else: - self.fan_type = 'NA' + self.serial_number = data.decode() + except Exception as e: + sonic_logger.log_warning("Unable to read serial# of PSU#{}".format(self.index)) + return + + # Fan device eeproms use ONIE TLV format + else: + try: + # Read Fan EEPROM as per ONIE TlvInfo EEPROM format. + self.eeprom_data = self.read_eeprom() + except Exception as e: + sonic_logger.log_warning("Unable to read device eeprom for Fan#{}".format(self.index)) + return + + eeprom = self.eeprom_data + if not self.is_valid_tlvinfo_header(eeprom): + sonic_logger.log_warning("Invalid device eeprom TLV header for Fan#{}".format(self.index)) + return - def _get_eeprom_field(self, field_name): + total_length = (eeprom[9] << 8) | eeprom[10] + tlv_index = self._TLV_INFO_HDR_LEN + tlv_end = self._TLV_INFO_HDR_LEN + total_length + + # Construct dictionary of eeprom TLV entries + self.eeprom_tlv_dict = dict() + while (tlv_index + 2) < len(eeprom) and tlv_index < tlv_end: + if not self.is_valid_tlv(eeprom[tlv_index:]): + break + + tlv = eeprom[tlv_index:tlv_index + 2 + + eeprom[tlv_index + 1]] + code = "0x%02X" % (tlv[0]) + + name, value = self.decoder(None, tlv) + + self.eeprom_tlv_dict[code] = value + if eeprom[tlv_index] == self._TLV_CODE_CRC_32: + break + + tlv_index += eeprom[tlv_index+1] + 2 + + self.serial_number = self.eeprom_tlv_dict.get( + "0x%X" % (self._TLV_CODE_SERIAL_NUMBER), 'NA') + self.part_number = self.eeprom_tlv_dict.get( + "0x%X" % (self._TLV_CODE_PART_NUMBER), 'NA') + self.model_str = self.eeprom_tlv_dict.get( + "0x%X" % (self._TLV_CODE_PRODUCT_NAME), 'NA') + self.service_tag = self.eeprom_tlv_dict.get( + "0x%X" % (self._TLV_CODE_SERVICE_TAG), 'NA') + + def _get_eeprom_field(self, field_name, decode=False): """ For a field name specified in the EEPROM format, returns the presence of the field and the value for the same. @@ -205,24 +257,23 @@ def airflow_fan_type(self): else: return int(self.fan_type.encode('hex'), 16) - # System EEPROM specific methods - def base_mac_addr(self): - """ - Returns the base MAC address found in the system EEPROM. - """ - return self.base_mac - def modelstr(self): """ Returns the Model name. """ return self.model_str - def serial_str(self): + def base_mac_addr(self): + """ + Returns the base MAC address found in the system EEPROM. + """ + return self.base_mac + + def service_tag_str(self): """ Returns the servicetag number. """ - return self.serial + return self.service_tag def system_eeprom_info(self): """ diff --git a/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/fan.py b/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/fan.py index 0b08f3f6b4f2..b8fd335930d6 100644 --- a/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/fan.py +++ b/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/fan.py @@ -1,5 +1,5 @@ ######################################################################## -# Nokia 7215 +# Nokia IXS7215 # # Module contains an implementation of SONiC Platform Base API and # provides the Fans' information which are available in the platform @@ -9,7 +9,9 @@ try: import os + import time from sonic_platform_base.fan_base import FanBase + from sonic_platform.eeprom import Eeprom from sonic_py_common import logger except ImportError as e: raise ImportError(str(e) + "- required module not found") @@ -41,6 +43,9 @@ def __init__(self, fan_index, fan_drawer, psu_fan=False, dependency=None): self.get_fan_speed_reg = ADT7473_DIR+"fan{}_input".format(self.index) self.max_fan_speed = MAX_IXS7215_FAN_SPEED self.supported_led_color = ['off', 'green', 'red'] + + # Fan eeprom + self.eeprom = Eeprom(is_fan=True, fan_index=self.index) else: # this is a PSU Fan self.index = fan_index @@ -78,6 +83,12 @@ def _set_i2c_register(self, reg_file, value): except Exception as e: rv = 'ERR' + # Ensure that the write operation has succeeded + if (int(self._get_i2c_register(reg_file)) != value ): + time.sleep(3) + if (int(self._get_i2c_register(reg_file)) != value ): + rv = 'ERR' + return rv def get_name(self): @@ -123,10 +134,9 @@ def get_model(self): Retrieves the model number of the Fan Returns: - string: Part number of Fan + string: Model number of Fan. Use part number for this. """ - - return 'NA' + return self.eeprom.part_number_str() def get_serial(self): """ @@ -135,8 +145,25 @@ def get_serial(self): Returns: string: Serial number of Fan """ + return self.eeprom.serial_number_str() - return 'NA' + def get_part_number(self): + """ + Retrieves the part number of the Fan + + Returns: + string: Part number of Fan + """ + return self.eeprom.part_number_str() + + def get_service_tag(self): + """ + Retrieves the service tag of the Fan + + Returns: + string: Service Tag of Fan + """ + return self.eeprom.service_tag_str() def get_status(self): """ @@ -163,7 +190,24 @@ def get_direction(self): FAN_DIRECTION_EXHAUST depending on fan direction """ - return 'FAN_DIRECTION_INTAKE' + return 'intake' + + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device + Returns: + integer: The 1-based relative physical position in parent device + """ + return self.index + + def is_replaceable(self): + """ + Indicate whether this device is replaceable. + Returns: + bool: True if it is replaceable. + """ + return True + def get_speed(self): """ @@ -176,9 +220,13 @@ def get_speed(self): fan_speed = self._get_i2c_register(self.get_fan_speed_reg) if (fan_speed != 'ERR'): - speed = int(fan_speed) + speed_in_rpm = int(fan_speed) else: - speed = 0 + speed_in_rpm = 0 + + speed = 100*speed_in_rpm//MAX_IXS7215_FAN_SPEED + if speed > 100: + speed = 100 return speed @@ -288,10 +336,10 @@ def get_status_led(self): """ if self.is_psu_fan: - return False + return None if smbus_present == 0: - return False + return None else: bus = smbus.SMBus(0) DEVICE_ADDRESS = 0x41 @@ -321,10 +369,16 @@ def get_target_speed(self): """ speed = 0 - fan_speed = self._get_i2c_register(self.get_fan_speed_reg) - if (fan_speed != 'ERR'): - speed = int(fan_speed) - else: - speed = 0 + fan_duty = self._get_i2c_register(self.set_fan_speed_reg) + if (fan_duty != 'ERR'): + dutyspeed = int(fan_duty) + if dutyspeed == 0: + speed = 0 + elif dutyspeed == 64: + speed = 25 + elif dutyspeed == 128: + speed = 50 + elif dutyspeed == 255: + speed = 100 return speed diff --git a/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/fan_drawer.py b/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/fan_drawer.py index ea0bc71bea5c..6c6218f0a794 100644 --- a/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/fan_drawer.py +++ b/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/fan_drawer.py @@ -8,9 +8,11 @@ try: from sonic_platform_base.fan_drawer_base import FanDrawerBase + from sonic_py_common import logger except ImportError as e: raise ImportError(str(e) + "- required module not found") +sonic_logger = logger.Logger('fan_drawer') class NokiaFanDrawer(FanDrawerBase): def __init__(self, index): @@ -21,8 +23,73 @@ def __init__(self, index): def get_index(self): return self._index - def get_led(self): - return self._led + def get_presence(self): + return self._fan_list[0].get_presence() + + def get_model(self): + """ + Retrieves the model number of the Fan Drawer + Returns: + string: Part number of Fan Drawer + """ + return self._fan_list[0].get_model() + + def get_serial(self): + """ + Retrieves the serial number of the Fan Drawer + Returns: + string: Serial number of Fan + """ + return self._fan_list[0].get_serial() + + def get_status(self): + """ + Retrieves the operational status of the Fan Drawer + Returns: + bool: True if Fan is operating properly, False if not + """ + return self._fan_list[0].get_status() + + def get_direction(self): + return 'intake' + + def set_status_led(self, color): + """ + Sets the state of the fan drawer status LED + + Args: + color: A string representing the color with which to set the + fan drawer status LED + + Returns: + bool: True if status LED state is set successfully, False if not + """ + return self._fan_list[0].set_status_led(color) + + def get_status_led(self): + """ + Gets the state of the fan drawer LED + + Returns: + A string, one of the predefined STATUS_LED_COLOR_* strings + """ + return self._fan_list[0].get_status_led() + + def is_replaceable(self): + """ + Indicate whether this device is replaceable. + Returns: + bool: True if it is replaceable. + """ + return True + + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device + Returns: + integer: The 1-based relative physical position in parent device + """ + return self._index # For Nokia platforms with fan drawer(s) @@ -33,15 +100,3 @@ def __init__(self, index): def get_name(self): return self._name - - -# For Nokia platforms with no physical fan drawer(s) -class VirtualDrawer(NokiaFanDrawer): - def __init__(self, index): - super(VirtualDrawer, self).__init__(index) - - def get_name(self): - return 'N/A' - - def set_status_led(self, color): - return 'N/A' diff --git a/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/psu.py b/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/psu.py index 4b8029daaa12..6217555f0d58 100644 --- a/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/psu.py +++ b/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/psu.py @@ -1,5 +1,5 @@ ######################################################################## -# Nokia 7215 +# Nokia IXS7215 # # Module contains an implementation of SONiC Platform Base API and # provides the PSUs' information which are available in the platform @@ -7,8 +7,11 @@ ######################################################################## try: + import os import sys from sonic_platform_base.psu_base import PsuBase + from sonic_py_common import logger + from sonic_platform.eeprom import Eeprom except ImportError as e: raise ImportError(str(e) + "- required module not found") @@ -23,15 +26,48 @@ except ImportError as e: smbus_present = 0 +sonic_logger = logger.Logger('psu') class Psu(PsuBase): """Nokia platform-specific PSU class for 7215 """ def __init__(self, psu_index): + PsuBase.__init__(self) # PSU is 1-based in Nokia platforms self.index = psu_index + 1 self._fan_list = [] + # PSU eeprom + self.eeprom = Eeprom(is_psu=True, psu_index=self.index) + + def _write_sysfs_file(self, sysfs_file, value): + rv = 'ERR' + + if (not os.path.isfile(sysfs_file)): + return rv + try: + with open(sysfs_file, 'w') as fd: + rv = fd.write(str(value)) + except Exception as e: + rv = 'ERR' + + return rv + + def _read_sysfs_file(self, sysfs_file): + rv = 'ERR' + + if (not os.path.isfile(sysfs_file)): + return rv + try: + with open(sysfs_file, 'r') as fd: + rv = fd.read() + except Exception as e: + rv = 'ERR' + + rv = rv.rstrip('\r\n') + rv = rv.lstrip(" ") + return rv + def get_name(self): """ Retrieves the name of the device @@ -50,7 +86,7 @@ def get_presence(self): """ if smbus_present == 0: # if called from psuutil outside of pmon - cmdstatus, psustatus = cmd.getstatusoutput('i2cget -y 0 0x41 0xa') + cmdstatus, psustatus = cmd.getstatusoutput('sudo i2cget -y 0 0x41 0xa') psustatus = int(psustatus, 16) else: bus = smbus.SMBus(0) @@ -78,6 +114,7 @@ def get_model(self): """ return self.eeprom.modelstr() + def get_serial(self): """ Retrieves the serial number of the PSU @@ -87,6 +124,16 @@ def get_serial(self): """ return self.eeprom.serial_number_str() + + def get_part_number(self): + """ + Retrieves the part number of the PSU + + Returns: + string: Part number of PSU + """ + return self.eeprom.part_number_str() + def get_status(self): """ Retrieves the operational status of the PSU @@ -96,8 +143,9 @@ def get_status(self): """ if smbus_present == 0: - cmdstatus, psustatus = cmd.getstatusoutput('i2cget -y 0 0x41 0xa') + cmdstatus, psustatus = cmd.getstatusoutput('sudo i2cget -y 0 0x41 0xa') psustatus = int(psustatus, 16) + sonic_logger.log_warning("PMON psu-smbus - presence = 0 ") else: bus = smbus.SMBus(0) DEVICE_ADDRESS = 0x41 @@ -124,7 +172,7 @@ def get_voltage(self): e.g. 12.1 """ if smbus_present == 0: - cmdstatus, psustatus = cmd.getstatusoutput('i2cget -y 0 0x41 0xa') + cmdstatus, psustatus = cmd.getstatusoutput('sudo i2cget -y 0 0x41 0xa') psustatus = int(psustatus, 16) else: bus = smbus.SMBus(0) @@ -146,29 +194,21 @@ def get_voltage(self): psu_voltage = 0.0 return psu_voltage - def get_current(self): + def get_position_in_parent(self): """ - Retrieves present electric current supplied by PSU - + Retrieves 1-based relative physical position in parent device Returns: - A float number, electric current in amperes, - e.g. 15.4 + integer: The 1-based relative physical position in parent device """ - psu_current = 0.0 - - return psu_current + return self.index - def get_power(self): + def is_replaceable(self): """ - Retrieves current energy supplied by PSU - + Indicate whether this device is replaceable. Returns: - A float number, the power in watts, - e.g. 302.6 + bool: True if it is replaceable. """ - psu_power = 0.0 - - return psu_power + return True def get_powergood_status(self): """ @@ -179,7 +219,7 @@ def get_powergood_status(self): """ if smbus_present == 0: - cmdstatus, psustatus = cmd.getstatusoutput('i2cget -y 0 0x41 0xa') + cmdstatus, psustatus = cmd.getstatusoutput('sudo i2cget -y 0 0x41 0xa') psustatus = int(psustatus, 16) else: bus = smbus.SMBus(0) @@ -220,6 +260,56 @@ def set_status_led(self, color): bool: True if status LED state is set successfully, False if not """ - # In IXR7220_D1, the firmware running in the PSU controls the LED + # The firmware running in the PSU controls the LED # and the PSU LED state cannot be changed from CPU. return False + + def get_status_master_led(self): + """ + Gets the state of the front panel PSU status LED + + Returns: + A string, one of the predefined STATUS_LED_COLOR_* strings. + """ + if (not os.path.isfile("/sys/class/gpio/psuLedGreen/value") or + not os.path.isfile("/sys/class/gpio/psuLedAmber/value")): + return None + + green = self._read_sysfs_file("/sys/class/gpio/psuLedGreen/value") + amber = self._read_sysfs_file("/sys/class/gpio/psuLedAmber/value") + if green == "ERR" or amber == "ERR": + return None + if green == "1": + return self.STATUS_LED_COLOR_GREEN + elif amber == "1": + return self.STATUS_LED_COLOR_AMBER + else: + return None + + def set_status_master_led(self, color): + """ + Sets the state of the front panel PSU status LED + + Returns: + bool: True if status LED state is set successfully, False if + not + """ + if (not os.path.isfile("/sys/class/gpio/psuLedGreen/value") or + not os.path.isfile("/sys/class/gpio/psuLedAmber/value")): + return False + + if color == self.STATUS_LED_COLOR_GREEN: + rvg = self._write_sysfs_file("/sys/class/gpio/psuLedGreen/value", 1) + if rvg != "ERR": + rva = self._write_sysfs_file("/sys/class/gpio/psuLedAmber/value", 0) + elif color == self.STATUS_LED_COLOR_AMBER: + rvg = self._write_sysfs_file("/sys/class/gpio/psuLedGreen/value", 0) + if rvg != "ERR": + rva = self._write_sysfs_file("/sys/class/gpio/psuLedAmber/value", 1) + else: + return False + + if rvg == "ERR" or rva == "ERR": + return False + + return True diff --git a/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/sfp.py b/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/sfp.py index 1bf3d4c03db0..d5f9cdb8e76c 100644 --- a/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/sfp.py +++ b/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/sfp.py @@ -5,7 +5,6 @@ import os import sys -import time try: from sonic_platform_base.sfp_base import SfpBase @@ -143,7 +142,7 @@ def __init__(self, index, sfp_type, eeprom_path, port_i2c_map): 'model', 'connector', 'encoding', 'ext_identifier', 'ext_rateselect_compliance', 'cable_type', 'cable_length', 'nominal_bit_rate', 'specification_compliance', - 'vendor_date', 'vendor_oui'] + 'type_abbrv_name', 'vendor_date', 'vendor_oui'] self.dom_dict_keys = ['rx_los', 'tx_fault', 'reset_status', 'power_lpmode', 'tx_disable', 'tx_disable_channel', 'temperature', @@ -210,7 +209,7 @@ def __read_eeprom_specific_bytes(self, offset, num_bytes): sysfsfile_eeprom.seek(offset) raw = sysfsfile_eeprom.read(num_bytes) for n in range(0, num_bytes): - eeprom_raw[n] = hex(ord(raw[n]))[2:].zfill(2) + eeprom_raw[n] = hex(raw[n])[2:].zfill(2) except Exception as e: pass finally: @@ -274,8 +273,10 @@ def get_transceiver_info(self): cable_length |INT |cable length in m nominal_bit_rate |INT |nominal bit rate by 100Mbs specification_compliance |1*255VCHAR |specification compliance + type_abbrv_name |1*255VCHAR |type of SFP (abbreviated) vendor_date |1*255VCHAR |vendor date vendor_oui |1*255VCHAR |vendor OUI + application_advertisement |1*255VCHAR |supported applications advertisement ======================================================================== """ @@ -337,33 +338,48 @@ def get_transceiver_info(self): end = start + XCVR_VENDOR_DATE_WIDTH sfp_vendor_date_data = sfpi_obj.parse_vendor_date( sfp_interface_bulk_raw[start: end], 0) - transceiver_info_dict['type'] = sfp_interface_bulk_data['data']['type']['value'] - transceiver_info_dict['manufacturer'] = sfp_vendor_name_data['data']['Vendor Name']['value'] - transceiver_info_dict['model'] = sfp_vendor_pn_data['data']['Vendor PN']['value'] - transceiver_info_dict['hardware_rev'] = sfp_vendor_rev_data['data']['Vendor Rev']['value'] - transceiver_info_dict['serial'] = sfp_vendor_sn_data['data']['Vendor SN']['value'] - transceiver_info_dict['vendor_oui'] = sfp_vendor_oui_data['data']['Vendor OUI']['value'] - transceiver_info_dict['vendor_date'] = sfp_vendor_date_data[ - 'data']['VendorDataCode(YYYY-MM-DD Lot)']['value'] - transceiver_info_dict['connector'] = sfp_interface_bulk_data['data']['Connector']['value'] - transceiver_info_dict['encoding'] = sfp_interface_bulk_data['data']['EncodingCodes']['value'] - transceiver_info_dict['ext_identifier'] = sfp_interface_bulk_data['data']['Extended Identifier']['value'] - transceiver_info_dict['ext_rateselect_compliance'] = sfp_interface_bulk_data['data']['RateIdentifier']['value'] + + transceiver_info_dict['type'] = sfp_interface_bulk_data \ + ['data']['type']['value'] + transceiver_info_dict['manufacturer'] = sfp_vendor_name_data \ + ['data']['Vendor Name']['value'] + transceiver_info_dict['model'] = sfp_vendor_pn_data \ + ['data']['Vendor PN']['value'] + transceiver_info_dict['hardware_rev'] = sfp_vendor_rev_data \ + ['data']['Vendor Rev']['value'] + transceiver_info_dict['serial'] = sfp_vendor_sn_data \ + ['data']['Vendor SN']['value'] + transceiver_info_dict['vendor_oui'] = sfp_vendor_oui_data \ + ['data']['Vendor OUI']['value'] + transceiver_info_dict['vendor_date'] = sfp_vendor_date_data \ + ['data']['VendorDataCode(YYYY-MM-DD Lot)']['value'] + transceiver_info_dict['connector'] = sfp_interface_bulk_data \ + ['data']['Connector']['value'] + transceiver_info_dict['encoding'] = sfp_interface_bulk_data \ + ['data']['EncodingCodes']['value'] + transceiver_info_dict['ext_identifier'] = sfp_interface_bulk_data \ + ['data']['Extended Identifier']['value'] + transceiver_info_dict['ext_rateselect_compliance'] = sfp_interface_bulk_data \ + ['data']['RateIdentifier']['value'] + transceiver_info_dict['type_abbrv_name'] = sfp_interface_bulk_data \ + ['data']['type_abbrv_name']['value'] for key in sfp_cable_length_tup: if key in sfp_interface_bulk_data['data']: transceiver_info_dict['cable_type'] = key - transceiver_info_dict['cable_length'] = str( - sfp_interface_bulk_data['data'][key]['value']) + transceiver_info_dict['cable_length'] = \ + str(sfp_interface_bulk_data['data'][key]['value']) for key in sfp_compliance_code_tup: if key in sfp_interface_bulk_data['data']['Specification compliance']['value']: - compliance_code_dict[key] = sfp_interface_bulk_data['data']['Specification compliance']['value'][key]['value'] - transceiver_info_dict['specification_compliance'] = str( - compliance_code_dict) + compliance_code_dict[key] = sfp_interface_bulk_data \ + ['data']['Specification compliance']['value'][key]['value'] - transceiver_info_dict['nominal_bit_rate'] = str( - sfp_interface_bulk_data['data']['NominalSignallingRate(UnitsOf100Mbd)']['value']) + transceiver_info_dict['specification_compliance'] = \ + str(compliance_code_dict) + transceiver_info_dict['nominal_bit_rate'] = \ + str(sfp_interface_bulk_data['data']['NominalSignallingRate(UnitsOf100Mbd)']['value']) + transceiver_info_dict['application_advertisement'] = 'N/A' return transceiver_info_dict @@ -557,26 +573,20 @@ def get_rx_los(self): A Boolean, True if SFP has RX LOS, False if not. """ if self.sfp_type == COPPER_TYPE: - return False + return None + if not self.dom_supported: + return None + rx_los_list = [] - if smbus_present == 0: - sonic_logger.log_info(" PMON - smbus ERROR - ") - cmdstatus, rxlosstatus = cmd.getstatusoutput('i2cget -y 0 0x41 0x4') - rxlosstatus = int(rxlosstatus, 16) + offset = 256 + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes((offset + SFP_CHANNL_STATUS_OFFSET), SFP_CHANNL_STATUS_WIDTH) + if dom_channel_monitor_raw is not None: + rx_los_data = int(dom_channel_monitor_raw[0], 16) + rx_los_list.append(rx_los_data & 0x02 != 0) else: - bus = smbus.SMBus(0) - DEVICE_ADDRESS = 0x41 - DEVICE_REG = 0x4 - rxlosstatus = bus.read_byte_data(DEVICE_ADDRESS, DEVICE_REG) - - pos = [1, 2, 4, 8] - bit_pos = pos[self.index-SFP_PORT_START] - rxlosstatus = rxlosstatus & (bit_pos) - - if rxlosstatus == 0: - return True + return None - return False + return rx_los_list def get_tx_fault(self): """ @@ -585,8 +595,21 @@ def get_tx_fault(self): A Boolean, True if SFP has TX fault, False if not Note : TX fault status is lached until a call to get_tx_fault or a reset. """ + if self.sfp_type == COPPER_TYPE: + return None + if not self.dom_supported: + return None + tx_fault_list = [] + + offset = 256 + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes((offset + SFP_CHANNL_STATUS_OFFSET), SFP_CHANNL_STATUS_WIDTH) + if dom_channel_monitor_raw is not None: + tx_fault_data = int(dom_channel_monitor_raw[0], 16) + tx_fault_list.append(tx_fault_data & 0x04 != 0) + else: + return None + return tx_fault_list - return False def get_tx_disable(self): """ @@ -596,26 +619,20 @@ def get_tx_disable(self): """ if self.sfp_type == COPPER_TYPE: - return False + return None + if not self.dom_supported: + return None - # Enable optical SFP Tx - if smbus_present == 0: - cmdstatus, disstatus = cmd.getstatusoutput('i2cget -y 0 0x41 0x5') - sonic_logger.log_info(" PMON - smbus ERROR tx- DEBUG ") + tx_disable_list = [] + offset = 256 + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes((offset + SFP_CHANNL_STATUS_OFFSET), SFP_CHANNL_STATUS_WIDTH) + if dom_channel_monitor_raw is not None: + tx_disable_data = int(dom_channel_monitor_raw[0], 16) + tx_disable_list.append(tx_disable_data & 0xC0 != 0) else: - bus = smbus.SMBus(0) - DEVICE_ADDRESS = 0x41 - DEVICE_REG = 0x5 - disstatus = bus.read_byte_data(DEVICE_ADDRESS, DEVICE_REG) - - pos = [1, 2, 4, 8] - bit_pos = pos[self.index-SFP_PORT_START] - disstatus = disstatus & (bit_pos) - - if disstatus == 0: - return True + return None - return False + return tx_disable_list def get_tx_disable_channel(self): """ @@ -663,6 +680,9 @@ def get_temperature(self): Returns: An integer number of current temperature in Celsius """ + if self.sfp_type == COPPER_TYPE: + return None + transceiver_bulk_status = self.get_transceiver_bulk_status() return transceiver_bulk_status.get("temperature", "N/A") @@ -672,6 +692,9 @@ def get_voltage(self): Returns: An integer number of supply voltage in mV """ + if self.sfp_type == COPPER_TYPE: + return None + transceiver_bulk_status = self.get_transceiver_bulk_status() return transceiver_bulk_status.get("voltage", "N/A") @@ -679,18 +702,18 @@ def get_tx_bias(self): """ Retrieves the TX bias current of this SFP Returns: - A list of four integer numbers, representing TX bias in mA - for channel 0 to channel 4. - Ex. ['110.09', '111.12', '108.21', '112.09'] + """ + if self.sfp_type == COPPER_TYPE: + return None + + tx_bias_list = [] transceiver_bulk_status = self.get_transceiver_bulk_status() - tx1_bs = transceiver_bulk_status.get("tx1bias", "N/A") - tx2_bs = transceiver_bulk_status.get("tx2bias", "N/A") - tx3_bs = transceiver_bulk_status.get("tx3bias", "N/A") - tx4_bs = transceiver_bulk_status.get("tx4bias", "N/A") - tx_bias_list = [tx1_bs, tx2_bs, tx3_bs, tx4_bs] + tx_bias_list.append(transceiver_bulk_status.get("tx1bias", "N/A")) + return tx_bias_list + def get_rx_power(self): """ Retrieves the received optical power for this SFP @@ -768,42 +791,56 @@ def get_tx_power(self): def reset(self): """ - Reset SFP and return all user module settings to their default srate. + Reset SFP. Returns: A boolean, True if successful, False if not """ - if self.sfp_type == COPPER_TYPE: - return False - - path = "/sys/class/i2c-adapter/i2c-{0}/{0}-0050/sfp_port_reset" - port_ps = path.format(self.port_to_i2c_mapping) - - try: - reg_file = open(port_ps, 'w') - except IOError as e: - # print "Error: unable to open file: %s" % str(e) - return False - - # toggle reset - reg_file.seek(0) - reg_file.write('1') - time.sleep(1) - reg_file.seek(0) - reg_file.write('0') - reg_file.close() - return True + # RJ45 and SFP ports not resettable + return False def tx_disable(self, tx_disable): """ - Disable SFP TX for all channels + Disable SFP TX Args: tx_disable : A Boolean, True to enable tx_disable mode, False to disable tx_disable mode. Returns: A boolean, True if tx_disable is set successfully, False if not """ + if self.sfp_type == COPPER_TYPE: + return False - return False + if smbus_present == 0: # if called from sfputil outside of pmon + cmdstatus, register = cmd.getstatusoutput('sudo i2cget -y 0 0x41 0x5') + if cmdstatus: + sonic_logger.log_warning("sfp cmdstatus i2c get failed %s" % register ) + return False + register = int(register, 16) + else: + bus = smbus.SMBus(0) + DEVICE_ADDRESS = 0x41 + DEVICE_REG = 0x5 + register = bus.read_byte_data(DEVICE_ADDRESS, DEVICE_REG) + + pos = [1, 2, 4, 8] + mask = pos[self.index-SFP_PORT_START] + if tx_disable == True: + setbits = register | mask + else: + setbits = register & ~mask + + if smbus_present == 0: # if called from sfputil outside of pmon + cmdstatus, output = cmd.getstatusoutput('sudo i2cset -y -m 0x0f 0 0x41 0x5 %d' % setbits) + if cmdstatus: + sonic_logger.log_warning("sfp cmdstatus i2c write failed %s" % output ) + return False + else: + bus = smbus.SMBus(0) + DEVICE_ADDRESS = 0x41 + DEVICE_REG = 0x5 + bus.write_byte_data(DEVICE_ADDRESS, DEVICE_REG, setbits) + + return True def tx_disable_channel(self, channel, disable): """ @@ -817,7 +854,7 @@ def tx_disable_channel(self, channel, disable): A boolean, True if successful, False if not """ - return False + return NotImplementedError def set_lpmode(self, lpmode): """ @@ -851,7 +888,7 @@ def set_power_override(self, power_override, power_set): False if not """ - return False + return NotImplementedError def get_name(self): """ @@ -862,7 +899,7 @@ def get_name(self): sfputil_helper = SfpUtilHelper() sfputil_helper.read_porttab_mappings( self.__get_path_to_port_config_file()) - name = sfputil_helper.logical[self.index] or "Unknown" + name = sfputil_helper.logical[self.index-1] or "Unknown" return name def get_presence(self): @@ -875,7 +912,7 @@ def get_presence(self): return False if smbus_present == 0: # if called from sfputil outside of pmon - cmdstatus, sfpstatus = cmd.getstatusoutput('i2cget -y 0 0x41 0x3') + cmdstatus, sfpstatus = cmd.getstatusoutput('sudo i2cget -y 0 0x41 0x3') sfpstatus = int(sfpstatus, 16) else: bus = smbus.SMBus(0) @@ -917,3 +954,23 @@ def get_status(self): A boolean value, True if device is operating properly, False if not """ return self.get_presence() + + def is_replaceable(self): + """ + Indicate whether this device is replaceable. + Returns: + bool: True if it is replaceable. + """ + + if self.sfp_type == "SFP": + return True + else: + return False + + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device + Returns: + integer: The 1-based relative physical position in parent device + """ + return self.index diff --git a/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/sfp_event.py b/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/sfp_event.py index ed2143886760..fd494ca674f5 100644 --- a/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/sfp_event.py +++ b/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/sfp_event.py @@ -51,7 +51,7 @@ def deinitialize(self): def _get_transceiver_status(self): if smbus_present == 0: sonic_logger.log_info(" PMON - smbus ERROR - DEBUG sfp_event ") - cmdstatus, sfpstatus = cmd.getstatusoutput('i2cget -y 0 0x41 0x3') + cmdstatus, sfpstatus = cmd.getstatusoutput('sudo i2cget -y 0 0x41 0x3') sfpstatus = int(sfpstatus, 16) else: bus = smbus.SMBus(0) diff --git a/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/test/test-chassis.py b/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/test/test-chassis.py index ee7c21c4638d..53c047ca2329 100755 --- a/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/test/test-chassis.py +++ b/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/test/test-chassis.py @@ -23,8 +23,6 @@ def main(): print(" Chassis status: {}".format(chassis.get_status())) - print(" Chassis serial_number: {}".format(chassis.get_serial_number())) - print(" Chassis base_mac: {}".format(chassis.get_base_mac())) print(" Chassis reboot cause: {}\n".format(chassis.get_reboot_cause())) @@ -43,6 +41,10 @@ def main(): print(" Chassis all_fans: {}\n".format(chassis.get_all_fans())) + print(" Chassis num_psus: {}".format(chassis.get_num_psus())) + + print(" Chassis all_psus: {}\n".format(chassis.get_all_psus())) + print(" Chassis num_thermals: {}".format(chassis.get_num_thermals())) print(" Chassis all_thermals: {}\n".format(chassis.get_all_thermals())) diff --git a/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/test/test-component.py b/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/test/test-component.py index edc9e03b3f66..1116cc7b5857 100755 --- a/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/test/test-component.py +++ b/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/test/test-component.py @@ -10,6 +10,11 @@ def main(): chassis = Chassis() + for component in chassis.get_all_components(): + print(" Name: {}".format(component.get_name())) + print(" Description: {}".format(component.get_description())) + print(" FW version: {}\n".format(component.get_firmware_version())) + return diff --git a/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/test/test-eeprom.py b/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/test/test-eeprom.py index 76f3d8995e4a..40836611692b 100755 --- a/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/test/test-eeprom.py +++ b/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/test/test-eeprom.py @@ -12,11 +12,11 @@ def main(): eeprom = chassis.get_eeprom() - print " Model: {}, Serial: {}".format(eeprom.modelstr(), - eeprom.serial_str()) - print " Part#: {}, Serial#: {}".format(eeprom.part_number_str(), - eeprom.serial_number_str()) - print " Base MAC: {}".format(eeprom.base_mac_addr()) + print(" Model: {}, Service Tag: {}".format(eeprom.modelstr(), + eeprom.service_tag_str())) + print(" Part#: {}, Serial#: {}".format(eeprom.part_number_str(), + eeprom.serial_number_str())) + print(" Base MAC: {}".format(eeprom.base_mac_addr())) return diff --git a/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/test/test-fan.py b/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/test/test-fan.py index 6f1ebd42adbe..9bbf4d864acb 100755 --- a/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/test/test-fan.py +++ b/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/test/test-fan.py @@ -11,15 +11,20 @@ def main(): chassis = Chassis() for fan in chassis.get_all_fans(): - print(" Name:", fan.get_name()) - print(" Presence: {}, Status: {}, LED: {}".format(fan.get_presence(), - fan.get_status(), - fan.get_status_led())) - print(" Model: {}, Serial: {}".format(fan.get_model(), - fan.get_serial())) - print(" Direction: {}, Speed: {}RPM, Target Speed: {}%\n".format(fan.get_direction(), - str(fan.get_speed()), - str(fan.get_target_speed()))) + if not fan.get_presence(): + print(" Name: {} not present".format(fan.get_name())) + else: + print(" Name:", fan.get_name()) + print(" Presence: {}, Status: {}, LED: {}".format(fan.get_presence(), + fan.get_status(), + fan.get_status_led())) + print(" Model: {}, Serial#: {}".format(fan.get_model(), + fan.get_serial())) + print(" Part#: {}, Service Tag: {}".format(fan.get_part_number(), + fan.get_service_tag())) + print(" Direction: {}, Speed: {}RPM, Target Speed: {}%\n".format(fan.get_direction(), + str(fan.get_speed()), + str(fan.get_target_speed()))) return diff --git a/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/test/test-psu.py b/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/test/test-psu.py index 1a333aeac441..e3979b8c4175 100755 --- a/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/test/test-psu.py +++ b/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/test/test-psu.py @@ -11,15 +11,28 @@ def main(): chassis = Chassis() for psu in chassis.get_all_psus(): - print(" Name:", psu.get_name()) - print(" Presence: {}, Status: {}, LED: {}".format(psu.get_presence(), - psu.get_status(), - psu.get_status_led())) - print(" Model: {}, Serial: {}".format(psu.get_model(), - psu.get_serial())) - print(" Voltage: {}, Current: {}, Power: {}\n".format(psu.get_voltage(), - psu.get_current(), - psu.get_power())) + if not psu.get_presence(): + print(" Name: {} not present".format(psu.get_name())) + else: + print(" Name:", psu.get_name()) + print(" Presence: {}, Status: {}, LED: {}".format(psu.get_presence(), + psu.get_status(), + psu.get_status_led())) + print(" Model: {}, Serial#: {}, Part#: {}".format(psu.get_model(), + psu.get_serial(), + psu.get_part_number())) + try: + current = psu.get_current() + except NotImplementedError: + current = "NA" + try: + power = psu.get_power() + except NotImplementedError: + power = "NA" + + print(" Voltage: {}, Current: {}, Power: {}\n".format(psu.get_voltage(), + current, + power)) return diff --git a/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/test/test-sfp.py b/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/test/test-sfp.py index 01f75562ad3b..4d283fa2eb03 100755 --- a/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/test/test-sfp.py +++ b/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/test/test-sfp.py @@ -1,21 +1,26 @@ #!/usr/bin/env python try: - import sonic_platform + from sonic_platform.chassis import Chassis except ImportError as e: raise ImportError(str(e) + "- required module not found") def main(): + print("---------------------") + print("Chassis SFP Unit Test") + print("---------------------") - PORT_START = 49 - PORT_END = 52 + chassis = Chassis() - chassis = sonic_platform.platform.Platform().get_chassis() + PORT_START = 1 + PORT_END = 52 for physical_port in range(PORT_START, PORT_END+1): print(" ") print(" SFP transceiver tests PORT = ", physical_port) + name = chassis.get_sfp(physical_port).get_name() + print(" SFP transceiver tests NAME = ", name) presence = chassis.get_sfp(physical_port).get_presence() print("TEST 1 - sfp presence [ True ] ", physical_port, presence) diff --git a/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/test/test-thermal.py b/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/test/test-thermal.py index e0259347c04e..95cc8e89f0d8 100755 --- a/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/test/test-thermal.py +++ b/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/test/test-thermal.py @@ -2,7 +2,6 @@ from sonic_platform.chassis import Chassis - def main(): print("-------------------------") print("Chassis Thermal Unit Test") @@ -11,14 +10,39 @@ def main(): chassis = Chassis() for thermal in chassis.get_all_thermals(): - print(" Name:", thermal.get_name()) - print(" Presence: {}, Status: {}".format(thermal.get_presence(), - thermal.get_status())) - print(" Model: {}, Serial: {}".format(thermal.get_model(), - thermal.get_serial())) - print(" Temperature: {}C, Low Threshold: {}C, High Threshold: {}C\n".format(thermal.get_temperature(), - thermal.get_low_threshold(), - thermal.get_high_threshold())) + if not thermal.get_presence(): + print(" Name: {} not present".format(thermal.get_name())) + else: + print(" Name:", thermal.get_name()) + print(" Presence: {}, Status: {}".format(thermal.get_presence(), + thermal.get_status())) + print(" Model: {}, Serial#: {}".format(thermal.get_model(), + thermal.get_serial())) + print(" Temperature(C): {}".format(thermal.get_temperature())) + + try: + low_thresh = thermal.get_low_threshold() + except NotImplementedError: + low_thresh = "NA" + try: + high_thresh = thermal.get_high_threshold() + except NotImplementedError: + high_thresh = "NA" + + print(" Low Threshold(C): {}, High Threshold(C): {}".format(low_thresh, + high_thresh)) + + try: + crit_low_thresh = thermal.get_low_critical_threshold() + except NotImplementedError: + crit_low_thresh = "NA" + try: + crit_high_thresh = thermal.get_high_critical_threshold() + except NotImplementedError: + crit_high_thresh = "NA" + + print(" Crit Low Threshold(C): {}, Crit High Threshold(C): {}\n".format(crit_low_thresh, + crit_high_thresh)) return diff --git a/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/test/test-watchdog.py b/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/test/test-watchdog.py new file mode 100755 index 000000000000..20805e04ed29 --- /dev/null +++ b/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/test/test-watchdog.py @@ -0,0 +1,22 @@ +#!/usr/bin/python + +from sonic_platform.chassis import Chassis + + +def main(): + print("---------------------") + print("Chassis Watchdog Test") + print("---------------------") + + chassis = Chassis() + + watchdog = chassis.get_watchdog() + + print(" Armed: {}".format(watchdog.is_armed())) + print(" Time Left: {}".format(watchdog.get_remaining_time())) + + return + + +if __name__ == '__main__': + main() diff --git a/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/thermal.py b/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/thermal.py index 2743520de245..391a86858504 100644 --- a/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/thermal.py +++ b/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/thermal.py @@ -10,9 +10,11 @@ try: import os from sonic_platform_base.thermal_base import ThermalBase + from sonic_py_common import logger except ImportError as e: raise ImportError(str(e) + "- required module not found") +sonic_logger = logger.Logger('thermal') class Thermal(ThermalBase): """Nokia platform-specific Thermal class""" @@ -31,16 +33,19 @@ class Thermal(ThermalBase): "CPU Core") def __init__(self, thermal_index): + ThermalBase.__init__(self) self.index = thermal_index + 1 self.is_psu_thermal = False self.dependency = None + self._minimum = None + self._maximum = None self.thermal_high_threshold_file = None # PCB temperature sensors if self.index < 3: i2c_path = self.I2C_CLASS_DIR + self.I2C_DEV_MAPPING[self.index - 1][0] sensor_index = self.I2C_DEV_MAPPING[self.index - 1][1] - sensor_max_suffix = "max" - sensor_crit_suffix = None + sensor_high_suffix = "max" + sensor_high_crit_suffix = None hwmon_node = os.listdir(i2c_path)[0] self.SENSOR_DIR = i2c_path + hwmon_node + '/' @@ -48,16 +53,16 @@ def __init__(self, thermal_index): elif self.index < 6: i2c_path = self.I2C_CLASS_DIR + self.I2C_DEV_MAPPING[self.index - 1][0] sensor_index = self.I2C_DEV_MAPPING[self.index - 1][1] - sensor_max_suffix = "max" - sensor_crit_suffix = "crit" + sensor_high_suffix = "crit" + sensor_high_crit_suffix = None self.SENSOR_DIR = i2c_path # Armada 38x SOC temperature sensor else: dev_path = self.HWMON_CLASS_DIR sensor_index = 1 - sensor_max_suffix = None - sensor_crit_suffix = None + sensor_high_suffix = None + sensor_high_crit_suffix = None hwmon_node = os.listdir(dev_path)[0] self.SENSOR_DIR = dev_path + hwmon_node + '/' @@ -66,16 +71,16 @@ def __init__(self, thermal_index): + "temp{}_input".format(sensor_index) # sysfs file for high threshold value if supported for this sensor - if sensor_max_suffix: + if sensor_high_suffix: self.thermal_high_threshold_file = self.SENSOR_DIR \ - + "temp{}_{}".format(sensor_index, sensor_max_suffix) + + "temp{}_{}".format(sensor_index, sensor_high_suffix) else: self.thermal_high_threshold_file = None # sysfs file for crit high threshold value if supported for this sensor - if sensor_crit_suffix: + if sensor_high_crit_suffix: self.thermal_high_crit_threshold_file = self.SENSOR_DIR \ - + "temp{}_{}".format(sensor_index, sensor_crit_suffix) + + "temp{}_{}".format(sensor_index, sensor_high_crit_suffix) else: self.thermal_high_crit_threshold_file = None @@ -161,6 +166,10 @@ def get_temperature(self): self.thermal_temperature_file) if (thermal_temperature != 'ERR'): thermal_temperature = float(thermal_temperature) / 1000 + if self._minimum is None or self._minimum > thermal_temperature: + self._minimum = thermal_temperature + if self._maximum is None or self._maximum < thermal_temperature: + self._maximum = thermal_temperature else: thermal_temperature = 0 @@ -175,7 +184,6 @@ def get_high_threshold(self): Celsius up to nearest thousandth of one degree Celsius, e.g. 30.125 """ - # Not implemented for this sensor if not self.thermal_high_threshold_file: raise NotImplementedError @@ -224,3 +232,27 @@ def get_high_critical_threshold(self): thermal_high_crit_threshold = 0.0 return float("{:.3f}".format(thermal_high_crit_threshold)) + + def get_minimum_recorded(self): + self.get_temperature() + return self._minimum + + def get_maximum_recorded(self): + self.get_temperature() + return self._maximum + + def get_position_in_parent(self): + """ + Retrieves 1-based relative physical position in parent device + Returns: + integer: The 1-based relative physical position in parent device + """ + return self.index + + def is_replaceable(self): + """ + Indicate whether this device is replaceable. + Returns: + bool: True if it is replaceable. + """ + return False diff --git a/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/watchdog.py b/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/watchdog.py index 75ec3ab177ae..903b6365dc48 100644 --- a/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/watchdog.py +++ b/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/watchdog.py @@ -10,19 +10,25 @@ import array from sonic_platform_base.watchdog_base import WatchdogBase -from sonic_py_common import logger """ ioctl constants """ +IO_WRITE = 0x40000000 IO_READ = 0x80000000 +IO_READ_WRITE = 0xC0000000 IO_SIZE_INT = 0x00040000 IO_TYPE_WATCHDOG = ord('W') << 8 WDR_INT = IO_READ | IO_SIZE_INT | IO_TYPE_WATCHDOG +WDWR_INT = IO_READ_WRITE | IO_SIZE_INT | IO_TYPE_WATCHDOG """ Watchdog ioctl commands """ WDIOC_SETOPTIONS = 4 | WDR_INT WDIOC_KEEPALIVE = 5 | WDR_INT +WDIOC_SETTIMEOUT = 6 | WDWR_INT WDIOC_GETTIMEOUT = 7 | WDR_INT +WDIOC_SETPRETIMEOUT = 8 | WDWR_INT +WDIOC_GETPRETIMEOUT = 9 | WDR_INT +WDIOC_GETTIMELEFT = 10 | WDR_INT """ Watchdog status constants """ WDIOS_DISABLECARD = 0x0001 @@ -33,8 +39,6 @@ WD_COMMON_ERROR = -1 -sonic_logger = logger.Logger() - class WatchdogImplBase(WatchdogBase): """ @@ -47,6 +51,7 @@ def __init__(self, wd_device_path): Open a watchdog handle @param wd_device_path Path to watchdog device """ + super(WatchdogImplBase, self).__init__() self.watchdog_path = wd_device_path self.watchdog = os.open(self.watchdog_path, os.O_WRONLY) @@ -57,32 +62,40 @@ def __init__(self, wd_device_path): self.armed = False self.timeout = self._gettimeout() - def disarm(self): + def _disablewatchdog(self): + """ + Turn off the watchdog timer """ - Disarm the hardware watchdog - Returns: - A boolean, True if watchdog is disarmed successfully, False - if not + req = array.array('h', [WDIOS_DISABLECARD]) + fcntl.ioctl(self.watchdog, WDIOC_SETOPTIONS, req, False) + + def _enablewatchdog(self): + """ + Turn on the watchdog timer """ - sonic_logger.log_info(" Debug disarm watchdog ") - try: - self._disablewatchdog() - self.armed = False - self.timeout = 0 - except IOError: - return False + req = array.array('h', [WDIOS_ENABLECARD]) + fcntl.ioctl(self.watchdog, WDIOC_SETOPTIONS, req, False) - return True + def _keepalive(self): + """ + Keep alive watchdog timer + """ - def _disablewatchdog(self): + fcntl.ioctl(self.watchdog, WDIOC_KEEPALIVE) + + def _settimeout(self, seconds): """ - Turn off the watchdog timer + Set watchdog timer timeout + @param seconds - timeout in seconds + @return is the actual set timeout """ - req = array.array('h', [WDIOS_DISABLECARD]) - fcntl.ioctl(self.watchdog, WDIOC_SETOPTIONS, req, False) + req = array.array('I', [seconds]) + fcntl.ioctl(self.watchdog, WDIOC_SETTIMEOUT, req, True) + + return int(req[0]) def _gettimeout(self): """ @@ -95,11 +108,22 @@ def _gettimeout(self): return int(req[0]) + def _gettimeleft(self): + """ + Get time left before watchdog timer expires + @return time left in seconds + """ + + req = array.array('I', [0]) + fcntl.ioctl(self.watchdog, WDIOC_GETTIMELEFT, req, True) + + return int(req[0]) + def arm(self, seconds): """ - Implements arm WatchdogBase API + Arm the hardware watchdog """ - sonic_logger.log_info(" Debug arm watchdog4 ") + ret = WD_COMMON_ERROR if seconds < 0: return ret @@ -110,7 +134,6 @@ def arm(self, seconds): if self.armed: self._keepalive() else: - sonic_logger.log_info(" Debug arm watchdog5 ") self._enablewatchdog() self.armed = True ret = self.timeout @@ -119,17 +142,42 @@ def arm(self, seconds): return ret - def _enablewatchdog(self): + def disarm(self): """ - Turn on the watchdog timer + Disarm the hardware watchdog + + Returns: + A boolean, True if watchdog is disarmed successfully, False + if not """ - req = array.array('h', [WDIOS_ENABLECARD]) - fcntl.ioctl(self.watchdog, WDIOC_SETOPTIONS, req, False) + try: + self._disablewatchdog() + self.armed = False + self.timeout = 0 + except IOError: + return False - def _keepalive(self): + return True + + def is_armed(self): """ - Keep alive watchdog timer + Implements is_armed WatchdogBase API """ - fcntl.ioctl(self.watchdog, WDIOC_KEEPALIVE) + return self.armed + + def get_remaining_time(self): + """ + Implements get_remaining_time WatchdogBase API + """ + + timeleft = WD_COMMON_ERROR + + if self.armed: + try: + timeleft = self._gettimeleft() + except IOError: + pass + + return timeleft diff --git a/platform/marvell-armhf/sonic-platform-nokia/debian/rules b/platform/marvell-armhf/sonic-platform-nokia/debian/rules index c1e6c1fbfb2b..b7592c2b51e9 100755 --- a/platform/marvell-armhf/sonic-platform-nokia/debian/rules +++ b/platform/marvell-armhf/sonic-platform-nokia/debian/rules @@ -14,7 +14,7 @@ SERVICE_DIR := service PLATFORM_DIR := sonic_platform %: - dh $@ --with systemd,python2,python3 --buildsystem=pybuild + dh $@ --with systemd,python3 --buildsystem=pybuild clean: dh_testdir @@ -23,7 +23,6 @@ clean: build: (for mod in $(MODULE_DIRS); do \ - python2 $${mod}/setup.py bdist_wheel -d $(MOD_SRC_DIR)/$${mod}; \ python3 $${mod}/setup.py bdist_wheel -d $(MOD_SRC_DIR)/$${mod}; \ done) @@ -42,7 +41,6 @@ binary-indep: dh_installdirs -p$(PACKAGE_PRE_NAME)-$${mod} /usr/local/bin; \ cp $(MOD_SRC_DIR)/$${mod}/$(SERVICE_DIR)/*.service debian/$(PACKAGE_PRE_NAME)-$${mod}/lib/systemd/system/; \ cp $(MOD_SRC_DIR)/$${mod}/$(UTILS_DIR)/* debian/$(PACKAGE_PRE_NAME)-$${mod}/usr/local/bin/; \ - python2 $${mod}/setup.py install --root=$(MOD_SRC_DIR)/debian/$(PACKAGE_PRE_NAME)-$${mod} --install-layout=deb; \ python3 $${mod}/setup.py install --root=$(MOD_SRC_DIR)/debian/$(PACKAGE_PRE_NAME)-$${mod} --install-layout=deb; \ done) diff --git a/platform/marvell-armhf/sonic-platform-nokia/debian/sonic-platform-nokia-7215.install b/platform/marvell-armhf/sonic-platform-nokia/debian/sonic-platform-nokia-7215.install index 0b867d259f10..be989f05c147 100644 --- a/platform/marvell-armhf/sonic-platform-nokia/debian/sonic-platform-nokia-7215.install +++ b/platform/marvell-armhf/sonic-platform-nokia/debian/sonic-platform-nokia-7215.install @@ -1,5 +1,7 @@ nokia-7215_plt_setup.sh usr/sbin 7215/scripts/nokia-7215init.sh usr/local/bin 7215/service/nokia-7215init.service etc/systemd/system -7215/sonic_platform-1.0-py2-none-any.whl usr/share/sonic/device/armhf-nokia_ixs7215_52x-r0 +7215/service/fstrim.timer/timer-override.conf /lib/systemd/system/fstrim.timer.d 7215/sonic_platform-1.0-py3-none-any.whl usr/share/sonic/device/armhf-nokia_ixs7215_52x-r0 +entropy.py etc/ +inband_mgmt.sh etc/ diff --git a/platform/marvell-armhf/sonic-platform-nokia/entropy.py b/platform/marvell-armhf/sonic-platform-nokia/entropy.py new file mode 100644 index 000000000000..a2131cdc17fb --- /dev/null +++ b/platform/marvell-armhf/sonic-platform-nokia/entropy.py @@ -0,0 +1,22 @@ +#!/usr/bin/python +import fcntl, struct +import time +from os import path + +RNDADDENTROPY=0x40085203 + +def avail(): + if path.exists("/proc/sys/kernel/random/entropy_avail"): + with open("/proc/sys/kernel/random/entropy_avail", mode='r') as avail: + return int(avail.read()) + else: + return int(2048) + +if path.exists("/proc/sys/kernel/random/entropy_avail"): + while 1: + while avail() < 2048: + with open('/dev/urandom', 'rb') as urnd, open("/dev/random", mode='wb') as rnd: + d = urnd.read(512) + t = struct.pack('ii', 4 * len(d), len(d)) + d + fcntl.ioctl(rnd, RNDADDENTROPY, t) + time.sleep(30) diff --git a/platform/marvell-armhf/sonic-platform-nokia/inband_mgmt.sh b/platform/marvell-armhf/sonic-platform-nokia/inband_mgmt.sh new file mode 100644 index 000000000000..25455d16ecbf --- /dev/null +++ b/platform/marvell-armhf/sonic-platform-nokia/inband_mgmt.sh @@ -0,0 +1,28 @@ +#!/bin/sh + +#inband_mgmt + +inband_mgmt(){ + # In this platform, one of the network ports is used as mgmt interface. + # This script periodically monitors inband management port eth0 and + # assigns IP address to eth0 if needed. + if [ ! -f /host/machine.conf ]; then + exit 0 + fi + #wait for n/w port init to complete + sleep 60 + while :; do + ip -br link show eth0 2> /dev/null + if [ $? -eq 0 ]; then + ip address show eth0 | grep -qw "inet" 2>/dev/null + if [ $? -ne 0 ]; then + ifconfig eth0 down + systemctl restart networking + fi + sleep 120 + else + sleep 3 + fi + done +} +(inband_mgmt > /dev/null)& diff --git a/platform/marvell-armhf/sonic-platform-nokia/nokia-7215_plt_setup.sh b/platform/marvell-armhf/sonic-platform-nokia/nokia-7215_plt_setup.sh index e4fc716cf5a5..0af85d730615 100755 --- a/platform/marvell-armhf/sonic-platform-nokia/nokia-7215_plt_setup.sh +++ b/platform/marvell-armhf/sonic-platform-nokia/nokia-7215_plt_setup.sh @@ -10,12 +10,6 @@ fw_uboot_env_cfg() if [ "$PLATFORM" = "armhf-nokia_ixs7215_52x-r0" ]; then # Ixs7215 / IPD6448M board Uboot ENV offset FW_ENV_DEFAULT='/dev/mtd0 0x00100000 0x10000 0x10000' - - demo_part=$(sgdisk -p /dev/sda | grep -e "SONiC-OS") - if [ -z "$demo_part" ]; then - # ET6448M Board - For Backward compatibility - FW_ENV_DEFAULT='/dev/mtd0 0x00500000 0x80000 0x100000 8' - fi else FW_ENV_DEFAULT='/dev/mtd0 0x00500000 0x80000 0x100000 8' fi @@ -30,6 +24,9 @@ main() { fw_uboot_env_cfg echo "Nokia-IXS7215: /dev/mtd0 FW_ENV_DEFAULT" + + python /etc/entropy.py & + /bin/sh /etc/inband_mgmt.sh } main $@ diff --git a/platform/marvell/docker-syncd-mrvl-rpc/Dockerfile.j2 b/platform/marvell/docker-syncd-mrvl-rpc/Dockerfile.j2 index 6b9e3d8aaafc..118be5e1c5f2 100644 --- a/platform/marvell/docker-syncd-mrvl-rpc/Dockerfile.j2 +++ b/platform/marvell/docker-syncd-mrvl-rpc/Dockerfile.j2 @@ -11,11 +11,6 @@ debs/ RUN apt-get purge -y syncd -RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; } ; \ -{% for deb in docker_syncd_mrvl_rpc_debs.split(' ') -%} -dpkg_apt debs/{{ deb }}{{'; '}} -{%- endfor %} - ## Pre-install the fundamental packages RUN apt-get update \ && apt-get -y install \ @@ -27,7 +22,16 @@ RUN apt-get update \ python-dev \ wget \ cmake \ - && wget https://github.com/nanomsg/nanomsg/archive/1.0.0.tar.gz \ + libqt5core5a \ + libqt5network5 \ + libboost-atomic1.71.0 + +RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; } ; \ +{% for deb in docker_syncd_mrvl_rpc_debs.split(' ') -%} +dpkg_apt debs/{{ deb }}{{'; '}} +{%- endfor %} + +RUN wget https://github.com/nanomsg/nanomsg/archive/1.0.0.tar.gz \ && tar xvfz 1.0.0.tar.gz \ && cd nanomsg-1.0.0 \ && mkdir -p build \ diff --git a/platform/marvell/docker-syncd-mrvl.mk b/platform/marvell/docker-syncd-mrvl.mk index d6d7d032b8ac..db1b505062a2 100644 --- a/platform/marvell/docker-syncd-mrvl.mk +++ b/platform/marvell/docker-syncd-mrvl.mk @@ -15,4 +15,3 @@ SONIC_STRETCH_DBG_DOCKERS += $(DOCKER_SYNCD_BASE_DBG) $(DOCKER_SYNCD_BASE)_RUN_OPT += -v /host/warmboot:/var/warmboot $(DOCKER_SYNCD_BASE)_RUN_OPT += -v /var/run/docker-syncd:/var/run/sswsyncd -$(DOCKER_SYNCD_BASE)_BASE_IMAGE_FILES += monit_syncd:/etc/monit/conf.d diff --git a/platform/marvell/docker-syncd-mrvl/base_image_files/monit_syncd b/platform/marvell/docker-syncd-mrvl/base_image_files/monit_syncd deleted file mode 100644 index 61e290e3189e..000000000000 --- a/platform/marvell/docker-syncd-mrvl/base_image_files/monit_syncd +++ /dev/null @@ -1,7 +0,0 @@ -############################################################################### -## Monit configuration for syncd container -## process list: -## syncd -############################################################################### -check program syncd|syncd with path "/usr/bin/process_checker syncd /usr/bin/syncd" - if status != 0 for 5 times within 5 cycles then alert repeat every 1 cycles diff --git a/platform/marvell/docker-syncd-mrvl/supervisord.conf b/platform/marvell/docker-syncd-mrvl/supervisord.conf index 85442933cf8e..ef78e2cbc969 100644 --- a/platform/marvell/docker-syncd-mrvl/supervisord.conf +++ b/platform/marvell/docker-syncd-mrvl/supervisord.conf @@ -10,13 +10,14 @@ autorestart=unexpected startretries=0 exitcodes=0,3 events=PROCESS_STATE -buffer_size=25 +buffer_size=1024 [eventlistener:supervisor-proc-exit-listener] command=python2 /usr/bin/supervisor-proc-exit-listener --container-name syncd -events=PROCESS_STATE_EXITED +events=PROCESS_STATE_EXITED,PROCESS_STATE_RUNNING autostart=true autorestart=unexpected +buffer_size=1024 [program:rsyslogd] command=/usr/sbin/rsyslogd -n -iNONE diff --git a/platform/mellanox/.gitignore b/platform/mellanox/.gitignore index 1f3d15d640d4..37c9f68b7812 100644 --- a/platform/mellanox/.gitignore +++ b/platform/mellanox/.gitignore @@ -16,6 +16,9 @@ sdk-src/*/* */*.gz */*.egg-info +# Exceptions +!bios/*.gz + # Autogenerated Dockerfiles docker-syncd-mlnx/Dockerfile docker-syncd-mlnx-rpc/Dockerfile diff --git a/platform/mellanox/asic_table.j2 b/platform/mellanox/asic_table.j2 index 4afc780b0b06..77f62e3b3689 100644 --- a/platform/mellanox/asic_table.j2 +++ b/platform/mellanox/asic_table.j2 @@ -14,13 +14,16 @@ 'x86_64-mlnx_msn2700-r0':'MELLANOX-SPECTRUM', 'x86_64-mlnx_msn2700_simx-r0':'MELLANOX-SPECTRUM', 'x86_64-mlnx_msn2740-r0':'MELLANOX-SPECTRUM', + 'x86_64-mlnx_msn3420-r0':'MELLANOX-SPECTRUM-2', 'x86_64-mlnx_msn3700c-r0':'MELLANOX-SPECTRUM-2', 'x86_64-mlnx_msn3700-r0':'MELLANOX-SPECTRUM-2', 'x86_64-mlnx_msn3700_simx-r0':'MELLANOX-SPECTRUM-2', 'x86_64-mlnx_msn3800-r0':'MELLANOX-SPECTRUM-2', + 'x86_64-mlnx_msn4410-r0':'MELLANOX-SPECTRUM-3', 'x86_64-mlnx_msn4700_simx-r0':'MELLANOX-SPECTRUM-3', 'x86_64-mlnx_msn4700-r0':'MELLANOX-SPECTRUM-3', 'x86_64-mlnx_msn4600c-r0':'MELLANOX-SPECTRUM-3', + 'x86_64-mlnx_msn4600-r0':'MELLANOX-SPECTRUM-3', 'vs-platform':'vs' } %} diff --git a/platform/mellanox/bios.mk b/platform/mellanox/bios.mk new file mode 100644 index 000000000000..7fd5e4bcd02c --- /dev/null +++ b/platform/mellanox/bios.mk @@ -0,0 +1,15 @@ +# Mellanox BIOS Firmware + +ifeq ($(shell [ -f $(PLATFORM_PATH)/bios/msn3800_bios.tar.gz ] && echo yes),yes) +MLNX_SN3800_BIOS_ARCHIVE = msn3800_bios.tar.gz +$(MLNX_SN3800_BIOS_ARCHIVE)_PATH = $(PLATFORM_PATH)/bios/ +SONIC_COPY_FILES += $(MLNX_SN3800_BIOS_ARCHIVE) + +MLNX_BIOS_ARCHIVES += $(MLNX_SN3800_BIOS_ARCHIVE) +endif + +ifdef MLNX_BIOS_ARCHIVES +MLNX_FILES += $(MLNX_BIOS_ARCHIVES) + +export MLNX_BIOS_ARCHIVES +endif diff --git a/platform/mellanox/bios/README.md b/platform/mellanox/bios/README.md new file mode 100644 index 000000000000..c58b844d3327 --- /dev/null +++ b/platform/mellanox/bios/README.md @@ -0,0 +1,5 @@ +# Mellanox BIOS + +## Description + +This directory contains BIOS packages. diff --git a/platform/mellanox/docker-ptf-mlnx.dep b/platform/mellanox/docker-ptf-mlnx.dep deleted file mode 100644 index 652fe0001c76..000000000000 --- a/platform/mellanox/docker-ptf-mlnx.dep +++ /dev/null @@ -1,10 +0,0 @@ -# DPKG FRK - -DPATH := $($(DOCKER_PTF_MLNX)_PATH) -DEP_FILES := $(SONIC_COMMON_FILES_LIST) $(PLATFORM_PATH)/docker-ptf-mlnx.mk $(PLATFORM_PATH)/docker-ptf-mlnx.dep -DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) -DEP_FILES += $(shell git ls-files -- $(DPATH)) - -$(DOCKER_PTF_MLNX)_CACHE_MODE := GIT_CONTENT_SHA -$(DOCKER_PTF_MLNX)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) -$(DOCKER_PTF_MLNX)_DEP_FILES := $(DEP_FILES) diff --git a/platform/mellanox/docker-ptf-mlnx.mk b/platform/mellanox/docker-ptf-mlnx.mk deleted file mode 100644 index eaaa54897d80..000000000000 --- a/platform/mellanox/docker-ptf-mlnx.mk +++ /dev/null @@ -1,8 +0,0 @@ -# docker image for docker-ptf-mlnx - -DOCKER_PTF_MLNX = docker-ptf-mlnx.gz -$(DOCKER_PTF_MLNX)_PATH = $(DOCKERS_PATH)/docker-ptf-saithrift -$(DOCKER_PTF_MLNX)_DEPENDS += $(PYTHON_SAITHRIFT) -$(DOCKER_PTF_MLNX)_LOAD_DOCKERS += $(DOCKER_PTF) -SONIC_DOCKER_IMAGES += $(DOCKER_PTF_MLNX) -SONIC_STRETCH_DOCKERS += $(DOCKER_PTF_MLNX) diff --git a/platform/mellanox/docker-syncd-mlnx-rpc/Dockerfile.j2 b/platform/mellanox/docker-syncd-mlnx-rpc/Dockerfile.j2 index e35c6582d2d0..b48d4ac3c793 100644 --- a/platform/mellanox/docker-syncd-mlnx-rpc/Dockerfile.j2 +++ b/platform/mellanox/docker-syncd-mlnx-rpc/Dockerfile.j2 @@ -11,17 +11,11 @@ RUN apt-get purge -y syncd {% if docker_syncd_mlnx_rpc_debs.strip() -%} # Copy locally-built Debian package dependencies {{ copy_files("debs/", docker_syncd_mlnx_rpc_debs.split(' '), "/debs/") }} - -# Install locally-built Debian packages and implicitly install their dependencies -{{ install_debian_packages(docker_syncd_mlnx_rpc_debs.split(' ')) }} {% endif %} {% if docker_syncd_mlnx_rpc_pydebs.strip() -%} # Copy locally-built Debian package dependencies {{ copy_files("python-debs/", docker_syncd_mlnx_rpc_pydebs.split(' '), "/debs/") }} - -# Install locally-built Debian packages and implicitly install their dependencies -{{ install_debian_packages(docker_syncd_mlnx_rpc_pydebs.split(' ')) }} {% endif %} ## Pre-install the fundamental packages @@ -29,13 +23,29 @@ RUN apt-get update \ && apt-get -y install \ net-tools \ python-pip \ + python-setuptools \ build-essential \ libssl-dev \ libffi-dev \ python-dev \ wget \ cmake \ - && wget https://github.com/nanomsg/nanomsg/archive/1.0.0.tar.gz \ + libqt5core5a \ + libqt5network5 \ + libboost-atomic1.71.0 + +{% if docker_syncd_mlnx_rpc_debs.strip() -%} +# Install locally-built Debian packages and implicitly install their dependencies +{{ install_debian_packages(docker_syncd_mlnx_rpc_debs.split(' ')) }} +{% endif %} + +{% if docker_syncd_mlnx_rpc_pydebs.strip() -%} +# Install locally-built Debian packages and implicitly install their dependencies +{{ install_debian_packages(docker_syncd_mlnx_rpc_pydebs.split(' ')) }} +{% endif %} + + +RUN wget https://github.com/nanomsg/nanomsg/archive/1.0.0.tar.gz \ && tar xvfz 1.0.0.tar.gz \ && cd nanomsg-1.0.0 \ && mkdir -p build \ @@ -45,9 +55,10 @@ RUN apt-get update \ && cd .. \ && rm -fr nanomsg-1.0.0 \ && rm -f 1.0.0.tar.gz \ - && pip install cffi==1.7.0 \ - && pip install --upgrade cffi==1.7.0 \ - && pip install nnpy \ + && pip2 install cffi==1.7.0 \ + && pip2 install --upgrade cffi==1.7.0 \ + && pip2 install wheel \ + && pip2 install nnpy \ && mkdir -p /opt \ && cd /opt \ && wget https://raw.githubusercontent.com/p4lang/ptf/master/ptf_nn/ptf_nn_agent.py \ diff --git a/platform/mellanox/docker-syncd-mlnx.dep b/platform/mellanox/docker-syncd-mlnx.dep index b8bdfdf625b7..659b09cec8f4 100644 --- a/platform/mellanox/docker-syncd-mlnx.dep +++ b/platform/mellanox/docker-syncd-mlnx.dep @@ -1,7 +1,7 @@ # DPKG FRK DPATH := $($(DOCKER_SYNCD_BASE)_PATH) -DEP_FILES := $(SONIC_COMMON_FILES_LIST) $(PLATFORM_PATH)/docker-syncd-mlnx.mk $(PLATFORM_PATH)/docker-syncd-mlnx.dep +DEP_FILES := $(SONIC_COMMON_FILES_LIST) $(PLATFORM_PATH)/docker-syncd-mlnx.mk $(PLATFORM_PATH)/docker-syncd-mlnx.dep platform/mellanox/mlnx-sai.mk DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) DEP_FILES += $(shell git ls-files -- $(DPATH)) diff --git a/platform/mellanox/docker-syncd-mlnx.mk b/platform/mellanox/docker-syncd-mlnx.mk index 9bdc5a8ad8ec..662c094bef5a 100644 --- a/platform/mellanox/docker-syncd-mlnx.mk +++ b/platform/mellanox/docker-syncd-mlnx.mk @@ -3,7 +3,7 @@ DOCKER_SYNCD_PLATFORM_CODE = mlnx include $(PLATFORM_PATH)/../template/docker-syncd-base.mk -$(DOCKER_SYNCD_BASE)_DEPENDS += $(SYNCD) $(PYTHON_SDK_API) +$(DOCKER_SYNCD_BASE)_DEPENDS += $(SYNCD) $(PYTHON_SDK_API) $(MFT) $(DOCKER_SYNCD_BASE)_DBG_DEPENDS += $(SYNCD_DBG) \ $(LIBSWSSCOMMON_DBG) \ @@ -15,4 +15,3 @@ $(DOCKER_SYNCD_BASE)_DBG_DEPENDS += $(MLNX_SDK_DBG_DEBS) $(MLNX_SAI_DBGSYM) endif $(DOCKER_SYNCD_BASE)_RUN_OPT += -v /host/warmboot:/var/warmboot -$(DOCKER_SYNCD_BASE)_BASE_IMAGE_FILES += monit_syncd:/etc/monit/conf.d diff --git a/platform/mellanox/docker-syncd-mlnx/Dockerfile.j2 b/platform/mellanox/docker-syncd-mlnx/Dockerfile.j2 index 5c9ac6c1c145..c862106c2b63 100755 --- a/platform/mellanox/docker-syncd-mlnx/Dockerfile.j2 +++ b/platform/mellanox/docker-syncd-mlnx/Dockerfile.j2 @@ -11,7 +11,13 @@ ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update && \ apt-get install -y \ - libxml2 + libxml2 \ + python-pip \ + python-dev \ + python-setuptools + +RUN pip2 install --upgrade pip +RUN apt-get purge -y python-pip {% if docker_syncd_mlnx_debs.strip() -%} # Copy locally-built Debian package dependencies diff --git a/platform/mellanox/docker-syncd-mlnx/base_image_files/monit_syncd b/platform/mellanox/docker-syncd-mlnx/base_image_files/monit_syncd deleted file mode 100644 index 61e290e3189e..000000000000 --- a/platform/mellanox/docker-syncd-mlnx/base_image_files/monit_syncd +++ /dev/null @@ -1,7 +0,0 @@ -############################################################################### -## Monit configuration for syncd container -## process list: -## syncd -############################################################################### -check program syncd|syncd with path "/usr/bin/process_checker syncd /usr/bin/syncd" - if status != 0 for 5 times within 5 cycles then alert repeat every 1 cycles diff --git a/platform/mellanox/docker-syncd-mlnx/supervisord.conf b/platform/mellanox/docker-syncd-mlnx/supervisord.conf index 9311a255b0c8..6fd59606062d 100644 --- a/platform/mellanox/docker-syncd-mlnx/supervisord.conf +++ b/platform/mellanox/docker-syncd-mlnx/supervisord.conf @@ -10,13 +10,14 @@ autorestart=unexpected startretries=0 exitcodes=0,3 events=PROCESS_STATE -buffer_size=25 +buffer_size=1024 [eventlistener:supervisor-proc-exit-listener] command=/usr/bin/supervisor-proc-exit-listener --container-name syncd -events=PROCESS_STATE_EXITED +events=PROCESS_STATE_EXITED,PROCESS_STATE_RUNNING autostart=true autorestart=unexpected +buffer_size=1024 [program:rsyslogd] command=/usr/sbin/rsyslogd -n -iNONE diff --git a/platform/mellanox/fw.mk b/platform/mellanox/fw.mk index 5c9a7442b98f..9026dc153176 100644 --- a/platform/mellanox/fw.mk +++ b/platform/mellanox/fw.mk @@ -5,23 +5,26 @@ MLNX_FW_BASE_PATH = $(MLNX_SDK_BASE_PATH) # Place an URL here to FW if you want to download FW instead MLNX_FW_BASE_URL = -ifneq ($(MLNX_FW_BASE_URL), ) FW_FROM_URL = y -else -FW_FROM_URL = n + +MLNX_FW_ASSETS_RELEASE_TAG = fw-2010.3196 +MLNX_FW_ASSETS_URL = $(MLNX_ASSETS_GITHUB_URL)/releases/download/$(MLNX_FW_ASSETS_RELEASE_TAG) + +ifeq ($(MLNX_FW_BASE_URL), ) +MLNX_FW_BASE_URL = $(MLNX_FW_ASSETS_URL) endif -MLNX_SPC_FW_VERSION = 13.2008.2208 +MLNX_SPC_FW_VERSION = 13.2010.3196 MLNX_SPC_FW_FILE = fw-SPC-rel-$(subst .,_,$(MLNX_SPC_FW_VERSION))-EVB.mfa $(MLNX_SPC_FW_FILE)_PATH = $(MLNX_FW_BASE_PATH) $(MLNX_SPC_FW_FILE)_URL = $(MLNX_FW_BASE_URL)/$(MLNX_SPC_FW_FILE) -MLNX_SPC2_FW_VERSION = 29.2008.2208 +MLNX_SPC2_FW_VERSION = 29.2010.3196 MLNX_SPC2_FW_FILE = fw-SPC2-rel-$(subst .,_,$(MLNX_SPC2_FW_VERSION))-EVB.mfa $(MLNX_SPC2_FW_FILE)_PATH = $(MLNX_FW_BASE_PATH) $(MLNX_SPC2_FW_FILE)_URL = $(MLNX_FW_BASE_URL)/$(MLNX_SPC2_FW_FILE) -MLNX_SPC3_FW_VERSION = 30.2008.2208 +MLNX_SPC3_FW_VERSION = 30.2010.3196 MLNX_SPC3_FW_FILE = fw-SPC3-rel-$(subst .,_,$(MLNX_SPC3_FW_VERSION))-EVB.mfa $(MLNX_SPC3_FW_FILE)_PATH = $(MLNX_FW_BASE_PATH) $(MLNX_SPC3_FW_FILE)_URL = $(MLNX_FW_BASE_URL)/$(MLNX_SPC3_FW_FILE) diff --git a/platform/mellanox/hw-management.mk b/platform/mellanox/hw-management.mk index 521daa1c7c3b..5e9c2e3c2215 100644 --- a/platform/mellanox/hw-management.mk +++ b/platform/mellanox/hw-management.mk @@ -1,6 +1,6 @@ # Mellanox HW Management -MLNX_HW_MANAGEMENT_VERSION = 7.0010.1300 +MLNX_HW_MANAGEMENT_VERSION = 7.0010.2349 export MLNX_HW_MANAGEMENT_VERSION diff --git a/platform/mellanox/hw-management/0001-Make-SONiC-determine-reboot-cause-service-start-afte.patch b/platform/mellanox/hw-management/0001-Make-SONiC-determine-reboot-cause-service-start-afte.patch new file mode 100644 index 000000000000..11539e606369 --- /dev/null +++ b/platform/mellanox/hw-management/0001-Make-SONiC-determine-reboot-cause-service-start-afte.patch @@ -0,0 +1,26 @@ +From 1a1011b6da491d35001df5a7204d4eecb2769767 Mon Sep 17 00:00:00 2001 +From: keboliu +Date: Fri, 15 Jan 2021 14:41:16 +0800 +Subject: [PATCH] Make SONiC determine-reboot-cause service start after hw-mgmt + service + +Signed-off-by: Kebo Liu +--- + debian/hw-management.hw-management.service | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/debian/hw-management.hw-management.service b/debian/hw-management.hw-management.service +index 39a2a54..2104b87 100755 +--- a/debian/hw-management.hw-management.service ++++ b/debian/hw-management.hw-management.service +@@ -1,6 +1,7 @@ + [Unit] + Description=Chassis HW management service of Mellanox systems + Documentation=man:hw-management.service(8) ++Before=determine-reboot-cause.service + + [Service] + Type=oneshot +-- +1.9.1 + diff --git a/platform/mellanox/hw-management/0002-Make-hw-mgmt-SimX-compatiable.patch b/platform/mellanox/hw-management/0002-Make-hw-mgmt-SimX-compatiable.patch new file mode 100644 index 000000000000..4e49516c8d54 --- /dev/null +++ b/platform/mellanox/hw-management/0002-Make-hw-mgmt-SimX-compatiable.patch @@ -0,0 +1,61 @@ +From 5858f60aa5948a502ca8a1c9357ac81baa6f68dc Mon Sep 17 00:00:00 2001 +From: junchao +Date: Fri, 23 Apr 2021 09:27:43 +0800 +Subject: [PATCH] Make hw-mgmt SimX compatible + +--- + usr/usr/bin/hw-management-ready.sh | 11 +++++++---- + usr/usr/bin/hw-management.sh | 9 +++++++++ + 2 files changed, 16 insertions(+), 4 deletions(-) + +diff --git a/usr/usr/bin/hw-management-ready.sh b/usr/usr/bin/hw-management-ready.sh +index 3c9f7b6..05d143f 100755 +--- a/usr/usr/bin/hw-management-ready.sh ++++ b/usr/usr/bin/hw-management-ready.sh +@@ -49,9 +49,12 @@ if [ -d /var/run/hw-management ]; then + rm -fr /var/run/hw-management + fi + +-while [ ! -d /sys/devices/platform/mlxplat/mlxreg-hotplug/hwmon ] +-do +- sleep 1 +-done ++if [ -z "$(lspci -vvv | grep SimX)" ]; then ++ while [ ! -d /sys/devices/platform/mlxplat/mlxreg-hotplug/hwmon ] ++ do ++ sleep 1 ++ done ++fi ++ + echo "Start Chassis HW management service." + logger -t hw-management -p daemon.notice "Start Chassis HW management service." +diff --git a/usr/usr/bin/hw-management.sh b/usr/usr/bin/hw-management.sh +index 991cf45..16ad0bf 100755 +--- a/usr/usr/bin/hw-management.sh ++++ b/usr/usr/bin/hw-management.sh +@@ -1265,6 +1265,13 @@ do_chip_down() + /usr/bin/hw-management-thermal-events.sh change hotplug_asic down %S %p + } + ++check_simx() ++{ ++ if [ -n "$(lspci -vvv | grep SimX)" ]; then ++ exit 0 ++ fi ++} ++ + __usage=" + Usage: $(basename "$0") [Options] + +@@ -1290,6 +1297,8 @@ Options: + force-reload Performs hw-management 'stop' and the 'start. + " + ++check_simx ++ + case $ACTION in + start) + if [ -d /var/run/hw-management ]; then +-- +1.9.1 + diff --git a/platform/mellanox/hw-management/Makefile b/platform/mellanox/hw-management/Makefile index 608c94e6b02a..9c62312d18c5 100644 --- a/platform/mellanox/hw-management/Makefile +++ b/platform/mellanox/hw-management/Makefile @@ -6,9 +6,10 @@ MAIN_TARGET = hw-management_1.mlnx.$(MLNX_HW_MANAGEMENT_VERSION)_amd64.deb $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : pushd hw-mgmt - git am ../*.patch + git stash + git apply -3 ../*.patch || exit 1 chmod +x ./debian/rules - sudo ./debian/rules binary KVERSION=$(KVERSION) + KVERSION=$(KVERSION) dpkg-buildpackage -us -uc -b -rfakeroot -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR) popd mv $* $(DEST)/ diff --git a/platform/mellanox/hw-management/hw-mgmt b/platform/mellanox/hw-management/hw-mgmt index dec7935777b5..67c3b6bd8617 160000 --- a/platform/mellanox/hw-management/hw-mgmt +++ b/platform/mellanox/hw-management/hw-mgmt @@ -1 +1 @@ -Subproject commit dec7935777b52d31a2220bad8b0cec4b71ec0961 +Subproject commit 67c3b6bd8617f4e0a282dab704a5f741088a3dd6 diff --git a/platform/mellanox/mft.mk b/platform/mellanox/mft.mk index 4529343931e3..9544830ccadb 100644 --- a/platform/mellanox/mft.mk +++ b/platform/mellanox/mft.mk @@ -1,7 +1,7 @@ # Mellanox SAI -MFT_VERSION = 4.15.3 -MFT_REVISION = 3 +MFT_VERSION = 4.21.0 +MFT_REVISION = 100 export MFT_VERSION MFT_REVISION diff --git a/platform/mellanox/mlnx-ffb.sh b/platform/mellanox/mlnx-ffb.sh index d0bef9d57761..c7a89d4d39d1 100755 --- a/platform/mellanox/mlnx-ffb.sh +++ b/platform/mellanox/mlnx-ffb.sh @@ -33,41 +33,47 @@ check_sdk_upgrade() return "${FFB_SUCCESS}" fi - while :; do - mkdir -p "${FS_MOUNTPOINT}" - mount -t squashfs "${FS_PATH}" "${FS_MOUNTPOINT}" || { - >&2 echo "Failed to mount next SONiC image" + ISSU_VERSION_FILE_PATH="/etc/mlnx/issu-version" + CURRENT_ISSU_VERSION="$(cat ${ISSU_VERSION_FILE_PATH})" + NEXT_ISSU_VERSION="Unknown" + + # /host/image-/platform/fw/asic/issu-version is now the new location for ISSU version. + NEXT_IMAGE_ISSU_VERSION_FILE_PATH="/host/image-${NEXT_SONIC_IMAGE#SONiC-OS-}/platform/fw/asic/issu-version" + + if [ -f "${NEXT_IMAGE_ISSU_VERSION_FILE_PATH}" ]; then + NEXT_ISSU_VERSION="$(cat ${NEXT_IMAGE_ISSU_VERSION_FILE_PATH})" + else + while :; do + mkdir -p "${FS_MOUNTPOINT}" + mount -t squashfs "${FS_PATH}" "${FS_MOUNTPOINT}" || { + >&2 echo "Failed to mount next SONiC image" + break + } + + [ -f "${ISSU_VERSION_FILE_PATH}" ] || { + >&2 echo "No ISSU version file found ${ISSU_VERSION_FILE_PATH}" + break + } + + [ -f "${FS_MOUNTPOINT}/${ISSU_VERSION_FILE_PATH}" ] || { + >&2 echo "No ISSU version file found ${ISSU_VERSION_FILE_PATH} in ${NEXT_SONIC_IMAGE}" + break + } + NEXT_ISSU_VERSION="$(cat ${FS_MOUNTPOINT}/${ISSU_VERSION_FILE_PATH})" break - } + done - ISSU_VERSION_FILE_PATH="/etc/mlnx/issu-version" - - [ -f "${ISSU_VERSION_FILE_PATH}" ] || { - >&2 echo "No ISSU version file found ${ISSU_VERSION_FILE_PATH}" - break - } - - [ -f "${FS_MOUNTPOINT}/${ISSU_VERSION_FILE_PATH}" ] || { - >&2 echo "No ISSU version file found ${ISSU_VERSION_FILE_PATH} in ${NEXT_SONIC_IMAGE}" - break - } - - CURRENT_ISSU_VERSION="$(cat ${ISSU_VERSION_FILE_PATH})" - NEXT_ISSU_VERSION="$(cat ${FS_MOUNTPOINT}/${ISSU_VERSION_FILE_PATH})" - - if [[ "${CURRENT_ISSU_VERSION}" == "${NEXT_ISSU_VERSION}" ]]; then - CHECK_RESULT="${FFB_SUCCESS}" - else - >&2 echo "Current and next ISSU version do not match:" - >&2 echo "Current ISSU version: ${CURRENT_ISSU_VERSION}" - >&2 echo "Next ISSU version: ${NEXT_ISSU_VERSION}" - fi - - break - done + umount -rf "${FS_MOUNTPOINT}" 2> /dev/null || true + rm -rf "${FS_MOUNTPOINT}" 2> /dev/null || true + fi - umount -rf "${FS_MOUNTPOINT}" 2> /dev/null || true - rm -rf "${FS_MOUNTPOINT}" 2> /dev/null || true + if [[ "${CURRENT_ISSU_VERSION}" == "${NEXT_ISSU_VERSION}" ]]; then + CHECK_RESULT="${FFB_SUCCESS}" + else + >&2 echo "Current and next ISSU version do not match:" + >&2 echo "Current ISSU version: ${CURRENT_ISSU_VERSION}" + >&2 echo "Next ISSU version: ${NEXT_ISSU_VERSION}" + fi return "${CHECK_RESULT}" } diff --git a/platform/mellanox/mlnx-fw-upgrade.j2 b/platform/mellanox/mlnx-fw-upgrade.j2 index 69f3d621cc44..82f9ce6f5918 100755 --- a/platform/mellanox/mlnx-fw-upgrade.j2 +++ b/platform/mellanox/mlnx-fw-upgrade.j2 @@ -29,11 +29,12 @@ declare -r SPC1_ASIC="spc1" declare -r SPC2_ASIC="spc2" declare -r SPC3_ASIC="spc3" declare -r UNKN_ASIC="unknown" +declare -r UNKN_MST="unknown" declare -rA FW_FILE_MAP=( \ - [$SPC1_ASIC]="/etc/mlnx/fw-SPC.mfa" \ - [$SPC2_ASIC]="/etc/mlnx/fw-SPC2.mfa" \ - [$SPC3_ASIC]="/etc/mlnx/fw-SPC3.mfa" \ + [$SPC1_ASIC]="fw-SPC.mfa" \ + [$SPC2_ASIC]="fw-SPC2.mfa" \ + [$SPC3_ASIC]="fw-SPC3.mfa" \ ) IMAGE_UPGRADE="${NO_PARAM}" @@ -152,6 +153,18 @@ function GetAsicType() { exit "${EXIT_FAILURE}" } +function GetMstDevice() { + local _MST_DEVICE="$(ls /dev/mst/*_pci_cr0 2>&1)" + + if [[ ! -c "${_MST_DEVICE}" ]]; then + echo "${UNKN_MST}" + else + echo "${_MST_DEVICE}" + fi + + exit "${EXIT_SUCCESS}" +} + function RunCmd() { local ERROR_CODE="${EXIT_SUCCESS}" @@ -168,17 +181,17 @@ function RunCmd() { } function UpgradeFW() { - local -r _FS_MOUNTPOINT="$1" + local -r _FW_BIN_PATH="$1" local -r _ASIC_TYPE="$(GetAsicType)" if [[ "${_ASIC_TYPE}" = "${UNKN_ASIC}" ]]; then ExitFailure "failed to detect ASIC type" fi - if [ ! -z "${_FS_MOUNTPOINT}" ]; then - local -r _FW_FILE="${_FS_MOUNTPOINT}/${FW_FILE_MAP[$_ASIC_TYPE]}" + if [ ! -z "${_FW_BIN_PATH}" ]; then + local -r _FW_FILE="${_FW_BIN_PATH}/${FW_FILE_MAP[$_ASIC_TYPE]}" else - local -r _FW_FILE="${FW_FILE_MAP[$_ASIC_TYPE]}" + local -r _FW_FILE="/etc/mlnx/${FW_FILE_MAP[$_ASIC_TYPE]}" fi if [ ! -f "${_FW_FILE}" ]; then @@ -207,7 +220,13 @@ function UpgradeFW() { ExitSuccess "firmware is up to date" else LogNotice "firmware upgrade is required. Installing compatible version..." - RunCmd "${BURN_CMD} -i ${_FW_FILE}" + local -r _MST_DEVICE="$(GetMstDevice)" + if [[ "${_MST_DEVICE}" = "${UNKN_MST}" ]]; then + LogWarning "could not find fastest mst device, using default device" + RunCmd "${BURN_CMD} -i ${_FW_FILE}" + else + RunCmd "${BURN_CMD} -d ${_MST_DEVICE} -i ${_FW_FILE}" + fi fi } @@ -220,11 +239,27 @@ function UpgradeFWFromImage() { if [[ "${_CURRENT_SONIC_IMAGE}" == "${_NEXT_SONIC_IMAGE}" ]]; then ExitSuccess "firmware is up to date" + fi + + # /host/image-/platform/fw/asic is now the new location for FW binaries. + # Prefere this path and if it does not exist use squashfs as a fallback. + local -r _PLATFORM_FW_BIN_PATH="/host/image-${_NEXT_SONIC_IMAGE#SONiC-OS-}/platform/fw/asic/" + + if [[ -d "${_PLATFORM_FW_BIN_PATH}" ]]; then + LogInfo "Using FW binaries from ${_PLATFORM_FW_BIN_PATH}" + + UpgradeFW "${_PLATFORM_FW_BIN_PATH}" else + local -r _FS_PATH="/host/image-${_NEXT_SONIC_IMAGE#SONiC-OS-}/fs.squashfs" + local -r _FS_MOUNTPOINT="/tmp/image-${_NEXT_SONIC_IMAGE#SONiC-OS-}-fs" + local -r _FW_BIN_PATH="${_FS_MOUNTPOINT}/etc/mlnx/" + + LogInfo "Using FW binaries from ${_FW_BIN_PATH}" + mkdir -p "${_FS_MOUNTPOINT}" mount -t squashfs "${_FS_PATH}" "${_FS_MOUNTPOINT}" - UpgradeFW "${_FS_MOUNTPOINT}" + UpgradeFW "${_FW_BIN_PATH}" umount -rf "${_FS_MOUNTPOINT}" rm -rf "${_FS_MOUNTPOINT}" @@ -232,7 +267,7 @@ function UpgradeFWFromImage() { } function ExitIfQEMU() { - if [[ $(cat /sys/devices/virtual/dmi/id/chassis_vendor) = "QEMU" ]]; then + if [ -n "$(lspci -vvv | grep SimX)" ]; then ExitSuccess "No FW upgrade for SimX platform" fi } diff --git a/platform/mellanox/mlnx-onie-fw-update.sh b/platform/mellanox/mlnx-onie-fw-update.sh index 0abc55ef76b4..27ba6bf39c9a 100755 --- a/platform/mellanox/mlnx-onie-fw-update.sh +++ b/platform/mellanox/mlnx-onie-fw-update.sh @@ -174,6 +174,10 @@ case "${cmd}" in rc=$? disable_onie_access if [[ ${rc} -eq 0 ]]; then + if [[ "${arg}" == "--no-reboot" ]]; then + echo "INFO: ONIE firmware update successfully STAGED for install at NEXT reboot. Please reboot manually to complete installation" + exit 0 + fi system_reboot else echo "ERROR: failed to enable ONIE firmware update mode" diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/chassis.py b/platform/mellanox/mlnx-platform-api/sonic_platform/chassis.py index c1d93b8ffdac..eb02b6359d5d 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/chassis.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/chassis.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - ############################################################################# # Mellanox # @@ -15,6 +13,7 @@ from sonic_py_common.logger import Logger from os import listdir from os.path import isfile, join + from . import utils import sys import io import re @@ -40,12 +39,20 @@ REBOOT_CAUSE_FILE_LENGTH = 1 +REBOOT_TYPE_KEXEC_FILE = "/proc/cmdline" +REBOOT_TYPE_KEXEC_PATTERN_WARM = ".*SONIC_BOOT_TYPE=(warm|fastfast).*" +REBOOT_TYPE_KEXEC_PATTERN_FAST = ".*SONIC_BOOT_TYPE=(fast|fast-reboot).*" + # Global logger class instance logger = Logger() # magic code defnition for port number, qsfp port position of each Platform # port_position_tuple = (PORT_START, QSFP_PORT_START, PORT_END, PORT_IN_BLOCK, EEPROM_OFFSET) -platform_dict_port = {'x86_64-mlnx_msn2010-r0': 3, 'x86_64-mlnx_msn2100-r0': 1, 'x86_64-mlnx_msn2410-r0': 2, 'x86_64-mlnx_msn2700-r0': 0, 'x86_64-mlnx_lssn2700':0, 'x86_64-mlnx_msn2740-r0': 0, 'x86_64-mlnx_msn3420-r0':5, 'x86_64-mlnx_msn3700-r0': 0, 'x86_64-mlnx_msn3700c-r0': 0, 'x86_64-mlnx_msn3800-r0': 4, 'x86_64-mlnx_msn4600c-r0':4, 'x86_64-mlnx_msn4700-r0': 0, 'x86_64-mlnx_msn4410-r0': 0} +platform_dict_port = {'x86_64-mlnx_msn2010-r0': 3, 'x86_64-mlnx_msn2100-r0': 1, 'x86_64-mlnx_msn2410-r0': 2, + 'x86_64-mlnx_msn2700-r0': 0, 'x86_64-mlnx_lssn2700': 0, 'x86_64-mlnx_msn2740-r0': 0, + 'x86_64-mlnx_msn3420-r0': 5, 'x86_64-mlnx_msn3700-r0': 0, 'x86_64-mlnx_msn3700c-r0': 0, + 'x86_64-mlnx_msn3800-r0': 4, 'x86_64-mlnx_msn4600-r0': 4, 'x86_64-mlnx_msn4600c-r0': 4, + 'x86_64-mlnx_msn4700-r0': 0, 'x86_64-mlnx_msn4410-r0': 0} port_position_tuple_list = [(0, 0, 31, 32, 1), (0, 0, 15, 16, 1), (0, 48, 55, 56, 1), (0, 18, 21, 22, 1), (0, 0, 63, 64, 1), (0, 48, 59, 60, 1)] class Chassis(ChassisBase): @@ -69,6 +76,7 @@ def __init__(self): self.sfp_event_initialized = False self.reboot_cause_initialized = False self.sdk_handle = None + self.deinitialize_sdk_handle = None logger.log_info("Chassis loaded successfully") @@ -76,9 +84,8 @@ def __del__(self): if self.sfp_event_initialized: self.sfp_event.deinitialize() - if self.sdk_handle: - from sonic_platform.sfp import deinitialize_sdk_handle - deinitialize_sdk_handle(self.sdk_handle) + if self.deinitialize_sdk_handle: + self.deinitialize_sdk_handle(self.sdk_handle) def initialize_psu(self): @@ -108,12 +115,10 @@ def initialize_fan(self): fan = Fan(fan_index, drawer, index + 1) fan_index += 1 drawer._fan_list.append(fan) - self._fan_list.append(fan) def initialize_sfp(self): from sonic_platform.sfp import SFP - from sonic_platform.sfp import initialize_sdk_handle self.sfp_module = SFP @@ -137,9 +142,12 @@ def initialize_sfp(self): def get_sdk_handle(self): if not self.sdk_handle: + from sonic_platform.sfp import initialize_sdk_handle, deinitialize_sdk_handle self.sdk_handle = initialize_sdk_handle() if self.sdk_handle is None: logger.log_error('Failed to open SDK handle') + else: + self.deinitialize_sdk_handle = deinitialize_sdk_handle return self.sdk_handle @@ -347,6 +355,17 @@ def _verify_reboot_cause(self, filename): ''' return bool(int(self._read_generic_file(join(REBOOT_CAUSE_ROOT, filename), REBOOT_CAUSE_FILE_LENGTH).rstrip('\n'))) + def _parse_warmfast_reboot_from_proc_cmdline(self): + if isfile(REBOOT_TYPE_KEXEC_FILE): + with open(REBOOT_TYPE_KEXEC_FILE) as cause_file: + cause_file_kexec = cause_file.readline() + m = re.search(REBOOT_TYPE_KEXEC_PATTERN_WARM, cause_file_kexec) + if m and m.group(1): + return 'warm-reboot' + m = re.search(REBOOT_TYPE_KEXEC_PATTERN_FAST, cause_file_kexec) + if m and m.group(1): + return 'fast-reboot' + return None def initialize_reboot_cause(self): self.reboot_major_cause_dict = { @@ -385,6 +404,13 @@ def get_reboot_cause(self): is "REBOOT_CAUSE_HARDWARE_OTHER", the second string can be used to pass a description of the reboot cause. """ + # To avoid the leftover hardware reboot cause confusing the reboot cause determine service + # Skip the hardware reboot cause check if warm/fast reboot cause found from cmdline + if utils.is_host(): + reboot_cause = self._parse_warmfast_reboot_from_proc_cmdline() + if reboot_cause: + return self.REBOOT_CAUSE_NON_HARDWARE, '' + #read reboot causes files in the following order if not self.reboot_cause_initialized: self.initialize_reboot_cause() diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/component.py b/platform/mellanox/mlnx-platform-api/sonic_platform/component.py index e70007e96562..8845b3faedba 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/component.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/component.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - ############################################################################# # Mellanox # @@ -323,6 +321,7 @@ def is_non_onie_firmware_update_supported(self): class Component(ComponentBase): def __init__(self): + super(Component, self).__init__() self.name = None self.description = None self.image_ext_name = None diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/device_data.py b/platform/mellanox/mlnx-platform-api/sonic_platform/device_data.py index 3853cac3f713..e1124d0d55e3 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/device_data.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/device_data.py @@ -10,7 +10,7 @@ 'drawer_num': 4, 'drawer_type': 'real', 'fan_num_per_drawer': 2, - 'support_fan_direction': False, + 'support_fan_direction': True, 'hot_swappable': True }, 'psus': { @@ -31,7 +31,7 @@ 'drawer_num': 4, 'drawer_type': 'real', 'fan_num_per_drawer': 1, - 'support_fan_direction': False, + 'support_fan_direction': True, 'hot_swappable': True }, 'psus': { @@ -52,7 +52,7 @@ 'drawer_num': 1, 'drawer_type': 'virtual', 'fan_num_per_drawer': 4, - 'support_fan_direction': False, + 'support_fan_direction': True, 'hot_swappable': False }, 'psus': { @@ -73,7 +73,7 @@ 'drawer_num': 4, 'drawer_type': 'real', 'fan_num_per_drawer': 2, - 'support_fan_direction': False, + 'support_fan_direction': True, 'hot_swappable': True }, 'psus': { @@ -94,7 +94,7 @@ 'drawer_num': 1, 'drawer_type': 'virtual', 'fan_num_per_drawer': 4, - 'support_fan_direction': False, + 'support_fan_direction': True, 'hot_swappable': False }, 'psus': { @@ -250,5 +250,26 @@ 'hot_swappable': True, 'led_num': 1 } + }, + 'x86_64-mlnx_msn4600-r0': { + 'thermal': { + 'minimum_table': { + "unk_trust": {"-127:40": 12, "41:120": 13}, + "unk_untrust": {"-127:5": 12, "6:20": 13, "21:30": 14, "31:35": 15, "36:40": 16, "41:120": 17}, + } + }, + 'fans': { + 'drawer_num': 3, + 'drawer_type': 'real', + 'fan_num_per_drawer': 1, + 'support_fan_direction': True, + 'hot_swappable': True + }, + 'psus': { + 'psu_num': 2, + 'fan_num_per_psu': 1, + 'hot_swappable': True, + 'led_num': 1 + } } -} \ No newline at end of file +} diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/eeprom.py b/platform/mellanox/mlnx-platform-api/sonic_platform/eeprom.py index b2e588a63557..da6b70f7890e 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/eeprom.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/eeprom.py @@ -6,13 +6,7 @@ # ############################################################################# import os -import sys -import re - -if sys.version_info.major == 3: - from io import StringIO -else: - from cStringIO import StringIO +import time from sonic_py_common.logger import Logger @@ -21,16 +15,9 @@ except ImportError as e: raise ImportError (str(e) + "- required module not found") -logger = Logger() +from .utils import default_return -# -# CACHE_XXX stuffs are supposted to be moved to the base classes -# since they are common for all vendors -# they are defined in decode-syseeprom which might be removed in the future -# currently we just copy them here -# -CACHE_ROOT = '/var/cache/sonic/decode-syseeprom' -CACHE_FILE = 'syseeprom_cache' +logger = Logger() # # this is mlnx-specific @@ -40,10 +27,6 @@ class Eeprom(eeprom_tlvinfo.TlvInfoDecoder): RETRIES = 3 - EEPROM_DECODE_HEADLINES = 6 - EEPROM_DECODE_MAXITEM = 3 - EEPROM_DECODE_OFFSET = 0 - EEPROM_DECODE_CONTENT = 2 def __init__(self): for attempt in range(self.RETRIES): @@ -52,95 +35,15 @@ def __init__(self): else: break - if not (os.path.exists(EEPROM_SYMLINK) \ - or os.path.isfile(os.path.join(CACHE_ROOT, CACHE_FILE))): - log_error("Nowhere to read syseeprom from! No symlink or cache file found") + if not os.path.exists(EEPROM_SYMLINK): + logger.log_error("Nowhere to read syseeprom from! No symlink or cache file found") raise RuntimeError("No syseeprom symlink or cache file found") self.eeprom_path = EEPROM_SYMLINK super(Eeprom, self).__init__(self.eeprom_path, 0, '', True) - self._eeprom_loaded = False - self._load_eeprom() - self._eeprom_loaded = True - - def _load_eeprom(self): - cache_file = os.path.join(CACHE_ROOT, CACHE_FILE) - if not os.path.exists(CACHE_ROOT): - try: - os.makedirs(CACHE_ROOT) - except: - pass - else: - try: - # Make sure first time always read eeprom data from hardware - if os.path.exists(cache_file): - os.remove(cache_file) - except Exception as e: - logger.log_error('Failed to remove cache file {} - {}'.format(cache_file, repr(e))) - - try: - self.set_cache_name(cache_file) - except: - pass - - eeprom = self.read_eeprom() - if eeprom is None : - return 0 - - try: - self.update_cache(eeprom) - except: - pass - - self._base_mac = self.mgmtaddrstr(eeprom) - if self._base_mac is None: - self._base_mac = "Undefined." - else: - self._base_mac = self._base_mac.strip('\0') - - self._serial_str = self.serial_number_str(eeprom) - if self._serial_str is None: - self._serial_str = "Undefined." - else: - self._serial_str = self._serial_str.strip('\0') - - self._product_name = self.modelstr(eeprom) - if self._product_name is None: - self._product_name = "Undefined." - else: - self._product_name = self._product_name.strip('\0') - - self._part_number = self.part_number_str(eeprom) - if self._part_number is None: - self._part_number = "Undefined." - else: - self._part_number = self._part_number.strip('\0') - - original_stdout = sys.stdout - sys.stdout = StringIO() - self.decode_eeprom(eeprom) - decode_output = sys.stdout.getvalue() - sys.stdout = original_stdout - - #parse decode_output into a dictionary - decode_output.replace('\0', '') - lines = decode_output.split('\n') - lines = lines[self.EEPROM_DECODE_HEADLINES:] - self._eeprom_info_dict = dict() - - for line in lines: - try: - match = re.search('(0x[0-9a-fA-F]{2})([\s]+[\S]+[\s]+)([\S]+[\s]*[\S]*)', line) - if match is not None: - idx = match.group(1) - value = match.group(3).rstrip('\0') - - self._eeprom_info_dict[idx] = value - except: - pass - - return 0 + self._eeprom_info_dict = None + @default_return(return_value='Undefined.') def get_base_mac(self): """ Retrieves the base MAC address for the chassis @@ -149,10 +52,9 @@ def get_base_mac(self): A string containing the MAC address in the format 'XX:XX:XX:XX:XX:XX' """ - if not self._eeprom_loaded: - self._load_eeprom() - return self._base_mac - + return self._get_eeprom_value(self._TLV_CODE_MAC_BASE) + + @default_return(return_value='Undefined.') def get_serial_number(self): """ Retrieves the hardware serial number for the chassis @@ -160,10 +62,9 @@ def get_serial_number(self): Returns: A string containing the hardware serial number for this chassis. """ - if not self._eeprom_loaded: - self._load_eeprom() - return self._serial_str + return self._get_eeprom_value(self._TLV_CODE_SERIAL_NUMBER) + @default_return(return_value='Undefined.') def get_product_name(self): """ Retrieves the hardware product name for the chassis @@ -171,10 +72,9 @@ def get_product_name(self): Returns: A string containing the hardware product name for this chassis. """ - if not self._eeprom_loaded: - self._load_eeprom() - return self._product_name + return self._get_eeprom_value(self._TLV_CODE_PRODUCT_NAME) + @default_return(return_value='Undefined.') def get_part_number(self): """ Retrieves the hardware part number for the chassis @@ -182,10 +82,9 @@ def get_part_number(self): Returns: A string containing the hardware part number for this chassis. """ - if not self._eeprom_loaded: - self._load_eeprom() - return self._part_number + return self._get_eeprom_value(self._TLV_CODE_PART_NUMBER) + @default_return({}) def get_system_eeprom_info(self): """ Retrieves the full content of system EEPROM information for the chassis @@ -195,6 +94,72 @@ def get_system_eeprom_info(self): OCP ONIE TlvInfo EEPROM format and values are their corresponding values. """ - if not self._eeprom_loaded: - self._load_eeprom() + if self._eeprom_info_dict is None: + self._eeprom_info_dict = {} + + # Try get from DB first + db_initialized = self._redis_hget('EEPROM_INFO|State', 'Initialized') + if db_initialized == '1': + code = self._TLV_CODE_PRODUCT_NAME + while code <= self._TLV_CODE_SERVICE_TAG: + value = self._redis_hget('EEPROM_INFO|{}'.format(hex(code)), 'Value') + if value: + self._eeprom_info_dict[hex(code)] = value + code += 1 + + # Handle vendor extension TLV + vendor_extension_tlv_code = hex(self._TLV_CODE_VENDOR_EXT) + try: + vendor_extension_num = int(self._redis_hget('EEPROM_INFO|{}'.format(vendor_extension_tlv_code), 'Num_vendor_ext')) + except (ValueError, TypeError): + vendor_extension_num = 0 + + if vendor_extension_num != 0: + for i in range(vendor_extension_num): + value = self._redis_hget('EEPROM_INFO|{}'.format(vendor_extension_tlv_code), 'Value_{}'.format(i)) + if value: + if vendor_extension_tlv_code not in self._eeprom_info_dict: + self._eeprom_info_dict[vendor_extension_tlv_code] = [value] + else: + self._eeprom_info_dict[vendor_extension_tlv_code].append(value) + + # Get CRC + value = self._redis_hget('EEPROM_INFO|{}'.format(hex(self._TLV_CODE_CRC_32)), 'Value') + if value: + self._eeprom_info_dict[hex(self._TLV_CODE_CRC_32)] = value + else: + eeprom = self.read_eeprom() + visitor = EepromContentVisitor(self._eeprom_info_dict) + self.visit_eeprom(eeprom, visitor) return self._eeprom_info_dict + + def _get_eeprom_value(self, code): + """Helper function to help get EEPROM data by code + + Args: + code (int): EEPROM TLV code + + Returns: + str: value of EEPROM TLV + """ + eeprom_info_dict = self.get_system_eeprom_info() + return eeprom_info_dict[hex(code)] + + +class EepromContentVisitor(eeprom_tlvinfo.EepromDefaultVisitor): + def __init__(self, content): + self.content = content + + def visit_tlv(self, name, code, length, value): + if code != Eeprom._TLV_CODE_VENDOR_EXT: + self.content[hex(code)] = value.rstrip('\0') + else: + if value: + value = value.rstrip('\0') + if value: + code = hex(code) + if code not in self.content: + self.content[code] = [value] + else: + self.content[code].append(value) + diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/fan.py b/platform/mellanox/mlnx-platform-api/sonic_platform/fan.py index cad7d014e0f7..1264517e6b6a 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/fan.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/fan.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - ############################################################################# # Mellanox # @@ -15,6 +13,7 @@ from sonic_platform_base.fan_base import FanBase from .led import FanLed, ComponentFaultyIndicator from .utils import read_int_from_file, read_str_from_file, write_file + from .thermal import Thermal except ImportError as e: raise ImportError (str(e) + "- required module not found") @@ -22,24 +21,23 @@ FAN_PATH = "/var/run/hw-management/thermal/" CONFIG_PATH = "/var/run/hw-management/config" -# fan_dir isn't supported on Spectrum 1. It is supported on Spectrum 2 and later switches -FAN_DIR = "/var/run/hw-management/system/fan_dir" -COOLING_STATE_PATH = "/var/run/hw-management/thermal/cooling_cur_state" + +FAN_DIR = "/var/run/hw-management/thermal/fan{}_dir" +FAN_DIR_VALUE_EXHAUST = 0 +FAN_DIR_VALUE_INTAKE = 1 class Fan(FanBase): """Platform-specific Fan class""" STATUS_LED_COLOR_ORANGE = "orange" - min_cooling_level = 2 - MIN_VALID_COOLING_LEVEL = 1 - MAX_VALID_COOLING_LEVEL = 10 + # PSU fan speed vector PSU_FAN_SPEED = ['0x3c', '0x3c', '0x3c', '0x3c', '0x3c', '0x3c', '0x3c', '0x46', '0x50', '0x5a', '0x64'] def __init__(self, fan_index, fan_drawer, position, psu_fan = False, psu=None): super(Fan, self).__init__() - + # API index is starting from 0, Mellanox platform index is starting from 1 self.index = fan_index + 1 self.fan_drawer = fan_drawer @@ -64,9 +62,9 @@ def __init__(self, fan_index, fan_drawer, position, psu_fan = False, psu=None): else: self.fan_speed_get_path = "psu{}_fan1_speed_get".format(self.index) self.fan_presence_path = "psu{}_fan1_speed_get".format(self.index) - self._name = 'psu_{}_fan_{}'.format(self.index, 1) - self.fan_max_speed_path = os.path.join(CONFIG_PATH, "psu_fan_max") - self.fan_min_speed_path = os.path.join(CONFIG_PATH, "psu_fan_min") + self._name = 'psu{}_fan{}'.format(self.index, 1) + self.fan_max_speed_path = os.path.join(FAN_PATH, "psu{}_fan_max".format(self.index)) + self.fan_min_speed_path = os.path.join(FAN_PATH, "psu{}_fan_min".format(self.index)) self.psu_i2c_bus_path = os.path.join(CONFIG_PATH, 'psu{0}_i2c_bus'.format(self.index)) self.psu_i2c_addr_path = os.path.join(CONFIG_PATH, 'psu{0}_i2c_addr'.format(self.index)) self.psu_i2c_command_path = os.path.join(CONFIG_PATH, 'fan_command') @@ -84,7 +82,7 @@ def get_direction(self): depending on fan direction Notes: - What Mellanox calls forward: + What Mellanox calls forward: Air flows from fans side to QSFP side, for example: MSN2700-CS2F which means intake in community What Mellanox calls reverse: @@ -161,7 +159,7 @@ def get_target_speed(self): if self.is_psu_fan: try: # Get PSU fan target speed according to current system cooling level - cooling_level = self.get_cooling_level() + cooling_level = Thermal.get_cooling_level() return int(self.PSU_FAN_SPEED[cooling_level], 16) except Exception: return self.get_speed() @@ -179,7 +177,7 @@ def set_speed(self, speed): in the range 0 (off) to 100 (full speed) Returns: - bool: True if set success, False if fail. + bool: True if set success, False if fail. """ status = True @@ -203,11 +201,6 @@ def set_speed(self, speed): return False try: - cooling_level = int(speed // 10) - if cooling_level < self.min_cooling_level: - cooling_level = self.min_cooling_level - speed = self.min_cooling_level * 10 - self.set_cooling_level(cooling_level, cooling_level) pwm = int(round(PWM_MAX*speed/100.0)) write_file(os.path.join(FAN_PATH, self.fan_speed_set_path), pwm, raise_exception=True) except (ValueError, IOError): @@ -225,7 +218,7 @@ def set_status_led(self, color): fan module status LED Returns: - bool: True if set success, False if fail. + bool: True if set success, False if fail. """ return self.led.set_status(color) @@ -267,36 +260,4 @@ def is_replaceable(self): """ return False - @classmethod - def set_cooling_level(cls, level, cur_state): - """ - Change cooling level. The input level should be an integer value [1, 10]. - 1 means 10%, 2 means 20%, 10 means 100%. - """ - if not isinstance(level, int): - raise RuntimeError("Failed to set cooling level, input parameter must be integer") - - if level < cls.MIN_VALID_COOLING_LEVEL or level > cls.MAX_VALID_COOLING_LEVEL: - raise RuntimeError("Failed to set cooling level, level value must be in range [{}, {}], got {}".format( - cls.MIN_VALID_COOLING_LEVEL, - cls.MAX_VALID_COOLING_LEVEL, - level - )) - try: - # Reset FAN cooling level vector. According to low level team, - # if we need set cooling level to X, we need first write a (10+X) - # to cooling_cur_state file to reset the cooling level vector. - write_file(COOLING_STATE_PATH, level + 10, raise_exception=True) - - # We need set cooling level after resetting the cooling level vector - write_file(COOLING_STATE_PATH, cur_state, raise_exception=True) - except (ValueError, IOError) as e: - raise RuntimeError("Failed to set cooling level - {}".format(e)) - - @classmethod - def get_cooling_level(cls): - try: - return read_int_from_file(COOLING_STATE_PATH, raise_exception=True) - except (ValueError, IOError) as e: - raise RuntimeError("Failed to get cooling level - {}".format(e)) diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/fan_drawer.py b/platform/mellanox/mlnx-platform-api/sonic_platform/fan_drawer.py index 66ee39491735..d73b52368100 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/fan_drawer.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/fan_drawer.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - ############################################################################# # Mellanox # @@ -14,6 +12,7 @@ from sonic_platform_base.fan_drawer_base import FanDrawerBase from sonic_platform_base.fan_base import FanBase from .led import FanLed, SharedLed + from .utils import read_int_from_file except ImportError as e: raise ImportError (str(e) + "- required module not found") @@ -51,14 +50,14 @@ def get_direction(self): return FanBase.FAN_DIRECTION_NOT_APPLICABLE try: - from .fan import FAN_DIR - with open(FAN_DIR, 'r') as fan_dir: - fan_dir_bits = int(fan_dir.read()) - fan_mask = 1 << self._index - 1 - if fan_dir_bits & fan_mask: - return FanBase.FAN_DIRECTION_INTAKE - else: - return FanBase.FAN_DIRECTION_EXHAUST + from .fan import FAN_DIR, FAN_DIR_VALUE_INTAKE, FAN_DIR_VALUE_EXHAUST + fan_dir = read_int_from_file(FAN_DIR.format(self._index), raise_exception=True) + if fan_dir == FAN_DIR_VALUE_INTAKE: + return FanBase.FAN_DIRECTION_INTAKE + elif fan_dir == FAN_DIR_VALUE_EXHAUST: + return FanBase.FAN_DIRECTION_EXHAUST + else: + raise RuntimeError("Got wrong value {} for fan direction {}".format(fan_dir, self._index)) except (ValueError, IOError) as e: raise RuntimeError("Failed to read fan direction status to {}".format(repr(e))) diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/led.py b/platform/mellanox/mlnx-platform-api/sonic_platform/led.py index 2e6002b77e6f..57c4815676c0 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/led.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/led.py @@ -41,6 +41,17 @@ def set_status(self, color): else: return False + with open(led_path, 'w') as led: + led.write(Led.LED_ON) + status = True + elif color == Led.STATUS_LED_COLOR_ORANGE: + if Led.STATUS_LED_COLOR_ORANGE in led_cap_list: + led_path = self.get_orange_led_path() + elif Led.STATUS_LED_COLOR_RED in led_cap_list: + led_path = self.get_red_led_path() + else: + return False + with open(led_path, 'w') as led: led.write(Led.LED_ON) status = True @@ -158,7 +169,7 @@ def get_capability(self): cap_list = set(caps.split()) except (ValueError, IOError): pass - + return cap_list def get_green_led_path(self): @@ -191,7 +202,7 @@ def get_orange_led_delay_on_path(self): def get_led_cap_path(self): pass - + class FanLed(Led): LED_PATH = "/var/run/hw-management/led/" @@ -207,8 +218,6 @@ def __init__(self, index): self._orange_led_path = os.path.join(Led.LED_PATH, "led_fan_orange") self._led_cap_path = os.path.join(Led.LED_PATH, "led_fan_capability") - self.set_status(Led.STATUS_LED_COLOR_GREEN) - def get_green_led_path(self): return self._green_led_path @@ -234,8 +243,6 @@ def __init__(self, index): self._red_led_path = os.path.join(Led.LED_PATH, "led_psu_red") self._orange_led_path = os.path.join(Led.LED_PATH, "led_psu_orange") self._led_cap_path = os.path.join(Led.LED_PATH, "led_psu_capability") - - self.set_status(Led.STATUS_LED_COLOR_GREEN) def get_green_led_path(self): return self._green_led_path diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/pcie.py b/platform/mellanox/mlnx-platform-api/sonic_platform/pcie.py new file mode 100644 index 000000000000..96d590e5e2e3 --- /dev/null +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/pcie.py @@ -0,0 +1,69 @@ +######################################################################## +# +# Copyright (C) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# Module contains a platform specific implementation of SONiC Platform +# Base PCIe class +# +######################################################################## +import os +import re + +try: + from sonic_platform_base.sonic_pcie.pcie_common import PcieUtil +except ImportError as e: + raise ImportError(str(e) + "- required module not found") + +SYSFS_PCI_DEVICE_PATH = '/sys/bus/pci/devices/' + + +class Pcie(PcieUtil): + # check the current PCIe device with config file and return the result + # use bus from _device_id_to_bus_map instead of from yaml file + def get_pcie_check(self): + self.load_config_file() + for item_conf in self.confInfo: + id_conf = item_conf["id"] + dev_conf = item_conf["dev"] + fn_conf = item_conf["fn"] + bus_conf = self._device_id_to_bus_map.get(str(id_conf)) + if bus_conf and self.check_pcie_sysfs(bus=int(bus_conf, base=16), device=int(dev_conf, base=16), + func=int(fn_conf, base=16)): + item_conf["result"] = "Passed" + else: + item_conf["result"] = "Failed" + return self.confInfo + + # Create + def _create_device_id_to_bus_map(self): + self._device_id_to_bus_map = {} + self.load_config_file() + device_folders = os.listdir(SYSFS_PCI_DEVICE_PATH) + for folder in device_folders: + # For each folder in the sysfs tree we check if it matches the normal PCIe device folder pattern, + # If match we add the device id from the device file and the bus from the folder name to the map + # + # Example for device folder name: 0000:ff:0b.1 + # + # The folder name is built from: + # 4 hex digit of domain + # colon ':' + # 2 hex digit of bus - this is what we are looking for + # colon ':' + # 2 hex digit of id + # dot '.' + # 1 digit of fn + pattern_for_device_folder = re.search('....:(..):..\..', folder) + if pattern_for_device_folder: + bus = pattern_for_device_folder.group(1) + with open(os.path.join('/sys/bus/pci/devices', folder, 'device'), 'r') as device_file: + # The 'device' file contain an hex repesantaion of the id key in the yaml file. + # Example of the file contact: + # 0x6fe2 + # We will strip the new line character, and remove the 0x prefix that is not needed. + device_id = device_file.read().strip().replace('0x', '') + self._device_id_to_bus_map[device_id] = bus + + def __init__(self, platform_path): + PcieUtil.__init__(self, platform_path) + self._create_device_id_to_bus_map() diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/platform.py b/platform/mellanox/mlnx-platform-api/sonic_platform/platform.py index f2a8af954790..f3f710da9929 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/platform.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/platform.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - ############################################################################# # Mellanox # @@ -16,16 +14,14 @@ class Platform(PlatformBase): def __init__(self): PlatformBase.__init__(self) - if self._is_host(): - self._chassis = Chassis() + self._chassis = Chassis() + self._chassis.initialize_psu() + self._chassis.initialize_eeprom() + if self._is_host(): self._chassis.initialize_components() - self._chassis.initizalize_system_led() - self._chassis.initialize_eeprom() - else: - self._chassis = Chassis() - self._chassis.initialize_psu() + self._chassis.initizalize_system_led() + else: self._chassis.initialize_fan() - self._chassis.initialize_eeprom() self._chassis.initialize_thermals() def _is_host(self): diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/psu.py b/platform/mellanox/mlnx-platform-api/sonic_platform/psu.py index 7b73b7196ce2..7d6357b33ef3 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/psu.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/psu.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - ############################################################################# # Mellanox # @@ -31,7 +29,9 @@ # in most platforms the file psuX_curr, psuX_volt and psuX_power contain current, voltage and power data respectively. # but there are exceptions which will be handled by the following dictionary -platform_dict_psu = {'x86_64-mlnx_msn3420-r0':1, 'x86_64-mlnx_msn3700-r0': 1, 'x86_64-mlnx_msn3700c-r0': 1, 'x86_64-mlnx_msn3800-r0': 1, 'x86_64-mlnx_msn4600c-r0':1, 'x86_64-mlnx_msn4700-r0': 1, 'x86_64-mlnx_msn4410-r0': 1} +platform_dict_psu = {'x86_64-mlnx_msn3420-r0': 1, 'x86_64-mlnx_msn3700-r0': 1, 'x86_64-mlnx_msn3700c-r0': 1, + 'x86_64-mlnx_msn3800-r0': 1, 'x86_64-mlnx_msn4600-r0': 1, 'x86_64-mlnx_msn4600c-r0': 1, + 'x86_64-mlnx_msn4700-r0': 1, 'x86_64-mlnx_msn4410-r0': 1} psu_profile_list = [ # default filename convention @@ -63,7 +63,7 @@ def __init__(self, psu_index, platform): psu_oper_status = "thermal/psu{}_pwr_status".format(self.index) #psu_oper_status should always be present for all platforms self.psu_oper_status = os.path.join(self.psu_path, psu_oper_status) - self._name = "PSU{}".format(psu_index + 1) + self._name = "PSU {}".format(psu_index + 1) if platform in platform_dict_psu: filemap = psu_profile_list[platform_dict_psu[platform]] diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py index 4b397b3f3ff8..5d26b7d43618 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - ############################################################################# # Mellanox # @@ -9,7 +7,7 @@ ############################################################################# try: - import subprocess + import functools import time from sonic_platform_base.sfp_base import SfpBase from sonic_platform_base.sonic_eeprom import eeprom_dts @@ -164,9 +162,9 @@ QSFP_OPTION_VALUE_WIDTH = 4 QSFP_MODULE_UPPER_PAGE3_START = 384 -QSFP_MODULE_THRESHOLD_OFFSET = 128 +QSFP_MODULE_THRESHOLD_OFFSET = 0 # original starting from 128, SDK only provide 128 bytes on this page. QSFP_MODULE_THRESHOLD_WIDTH = 24 -QSFP_CHANNL_THRESHOLD_OFFSET = 176 +QSFP_CHANNL_THRESHOLD_OFFSET = 48 QSFP_CHANNL_THRESHOLD_WIDTH = 24 SFP_TEMPE_OFFSET = 96 @@ -243,17 +241,28 @@ 'Fibre Channel link length/Transmitter Technology', 'Fibre Channel transmission media', 'Fibre Channel Speed') -SFP_PATH = "/var/run/hw-management/qsfp/" +SFP_SYSFS_PATH = "/sys/module/sx_core/asic0/module{}/eeprom/pages/" SFP_TYPE = "SFP" QSFP_TYPE = "QSFP" OSFP_TYPE = "OSFP" QSFP_DD_TYPE = "QSFP_DD" +PAGE_SIZE = 256 +PAGE00_LOWER_MEMORY_OFFSET = 0 +PAGE00_HIGH_MEMORY_OFFSET = 128 +PAGE01_OFFSET = 256 +PAGE02_OFFSET = 512 +PAGE03_OFFSET = 768 +PAGE17_OFFSET = 4352 + +PATH_PAGE = '/{}/data' +PATH_PAGE00 = '/0/i2c-0x50/data' +PATH_PAGE00_A2 = '/0/i2c-0x51/data' + #variables for sdk REGISTER_NUM = 1 DEVICE_ID = 1 SWITCH_ID = 0 -SX_PORT_ATTR_ARR_SIZE = 64 PMAOS_ASE = 1 PMAOS_EE = 1 @@ -314,17 +323,36 @@ def deinitialize_sdk_handle(sdk_handle): logger.log_warning("Sdk handle is none") return False + +def refresh_sfp_type(refresh_dom_capability=True): + """Decorator to force refreshing sfp type + + Args: + refresh_dom_capability (bool, optional): refresh DOM capability. Defaults to True. + """ + def decorator(method): + @functools.wraps(method) + def _impl(self, *args, **kwargs): + self._refresh_sfp_type() + if refresh_dom_capability: + self._dom_capability_detect() + return method(self, *args, **kwargs) + return _impl + return decorator + + class SFP(SfpBase): """Platform-specific SFP class""" def __init__(self, sfp_index, sfp_type, sdk_handle_getter, platform): SfpBase.__init__(self) self.index = sfp_index + 1 + self.sdk_sysfs_page_path_header = SFP_SYSFS_PATH.format(sfp_index) self.sfp_eeprom_path = "qsfp{}".format(self.index) self.sfp_status_path = "qsfp{}_status".format(self.index) - self._detect_sfp_type(sfp_type) + self._sfp_type = None + self._default_sfp_type = sfp_type self.dom_tx_disable_supported = False - self._dom_capability_detect() self.sdk_handle_getter = sdk_handle_getter self.sdk_index = sfp_index @@ -342,7 +370,7 @@ def reinit(self): Re-initialize this SFP object when a new SFP inserted :return: """ - self._detect_sfp_type(self.sfp_type) + self._refresh_sfp_type() self._dom_capability_detect() def get_presence(self): @@ -353,66 +381,86 @@ def get_presence(self): bool: True if device is present, False if not """ presence = False - ethtool_cmd = "ethtool -m sfp{} hex on offset 0 length 1 2>/dev/null".format(self.index) try: - proc = subprocess.Popen(ethtool_cmd, - stdout=subprocess.PIPE, - shell=True, - stderr=subprocess.STDOUT, - universal_newlines=True) - stdout = proc.communicate()[0] - proc.wait() - result = stdout.rstrip('\n') - if result != '': + with open((self.sdk_sysfs_page_path_header + PATH_PAGE00), mode='r+b', buffering=0) as f: + f.read(1) presence = True - - except OSError as e: - raise OSError("Cannot detect sfp") + except (OSError, IOError): + presence = False return presence # Read out any bytes from any offset def _read_eeprom_specific_bytes(self, offset, num_bytes): - eeprom_raw = [] - ethtool_cmd = "ethtool -m sfp{} hex on offset {} length {}".format(self.index, offset, num_bytes) try: - output = subprocess.check_output(ethtool_cmd, - shell=True, - universal_newlines=True) - output_lines = output.splitlines() - first_line_raw = output_lines[0] - if "Offset" in first_line_raw: - for line in output_lines[2:]: - line_split = line.split() - eeprom_raw = eeprom_raw + line_split[1:] - except subprocess.CalledProcessError as e: - return None - - return eeprom_raw + # if the data is on page0, offset indicate start of lower memory or upper memory + # if the data is on other page, then offset = page*256 + page_num = int(offset/PAGE_SIZE) + if page_num == 0: + page = self.sdk_sysfs_page_path_header + PATH_PAGE00 + else: + self._refresh_sfp_type() + if page_num == 1 and self.sfp_type == SFP_TYPE: + page = self.sdk_sysfs_page_path_header + PATH_PAGE00_A2 + else: + page = self.sdk_sysfs_page_path_header + PATH_PAGE.format(page_num) + offset = offset - page_num * PAGE_SIZE + with open(page, mode='r+b', buffering=0) as f: + f.seek(offset) + return ["{:02x}".format(c) for c in f.read(num_bytes)] + except (OSError, IOError): + return None - def _detect_sfp_type(self, sfp_type): - eeprom_raw = [] - eeprom_raw = self._read_eeprom_specific_bytes(XCVR_TYPE_OFFSET, XCVR_TYPE_WIDTH) - if eeprom_raw: - if eeprom_raw[0] in SFP_TYPE_CODE_LIST: - self.sfp_type = SFP_TYPE - elif eeprom_raw[0] in QSFP_TYPE_CODE_LIST: - self.sfp_type = QSFP_TYPE - elif eeprom_raw[0] in QSFP_DD_TYPE_CODE_LIST: - self.sfp_type = QSFP_DD_TYPE + @property + def sfp_type(self): + if self._sfp_type is None: + eeprom_raw = [] + eeprom_raw = self._read_eeprom_specific_bytes(XCVR_TYPE_OFFSET, XCVR_TYPE_WIDTH) + if eeprom_raw: + if eeprom_raw[0] in SFP_TYPE_CODE_LIST: + self._sfp_type = SFP_TYPE + elif eeprom_raw[0] in QSFP_TYPE_CODE_LIST: + self._sfp_type = QSFP_TYPE + elif eeprom_raw[0] in QSFP_DD_TYPE_CODE_LIST: + self._sfp_type = QSFP_DD_TYPE + else: + # we don't recognize this identifier value, treat the xSFP module as the default type + self._sfp_type = self._default_sfp_type + logger.log_info("Identifier value of {} module {} is {} which isn't recognized and will be treated as default type ({})".format( + self._default_sfp_type, self.index, eeprom_raw[0], self._default_sfp_type + )) else: - # we don't regonize this identifier value, treat the xSFP module as the default type - self.sfp_type = sfp_type - logger.log_info("Identifier value of {} module {} is {} which isn't regonized and will be treated as default type ({})".format( - sfp_type, self.index, eeprom_raw[0], sfp_type - )) - else: - # eeprom_raw being None indicates the module is not present. - # in this case we treat it as the default type according to the SKU - self.sfp_type = sfp_type + # eeprom_raw being None indicates the module is not present. + # in this case we treat it as the default type according to the SKU + self._sfp_type = self._default_sfp_type + self._default_sfp_type = self._sfp_type + return self._sfp_type + + def _refresh_sfp_type(self): + self._sfp_type = None + + def _is_qsfp_copper(self): + # This function read the specification compliance byte and + # ext specification compliance byte to judge whether the cable is copper or not. + # It is only designed for SFF 8636 cables, SFF 8472 and CMIS cables don't apply. + + # copper cables defined in SFF8024 "Extended Specification Compliance Codes" + copper_ext_specification_list = ['08', '0b', '0c', '0d', '19', '30', '32', '40'] + + offset = PAGE00_HIGH_MEMORY_OFFSET + qsfp_specification_raw = self._read_eeprom_specific_bytes(offset + XCVR_COMPLIANCE_CODE_OFFSET, 1) + qsfp_specification = int(qsfp_specification_raw[0], 16) + # The 4th bit of the specification complaince byte(131) indicate a 40GBASE-CR4 copper cable + if qsfp_specification & 0x8: + return True + qsfp_ext_specification_raw = self._read_eeprom_specific_bytes(offset + XCVR_EXT_SPECIFICATION_COMPLIANCE_OFFSET, XCVR_EXT_SPECIFICATION_COMPLIANCE_WIDTH) + if qsfp_ext_specification_raw[0] in copper_ext_specification_list: + return True + + return False def _dom_capability_detect(self): if not self.get_presence(): @@ -426,11 +474,21 @@ def _dom_capability_detect(self): return if self.sfp_type == QSFP_TYPE: + if self._is_qsfp_copper(): + self.dom_supported = False + self.dom_temp_supported = False + self.dom_volt_supported = False + self.dom_rx_power_supported = False + self.dom_tx_power_supported = False + self.calibration = 0 + self.qsfp_page3_available = False + return + self.calibration = 1 sfpi_obj = sff8436InterfaceId() if sfpi_obj is None: self.dom_supported = False - offset = 128 + offset = PAGE00_HIGH_MEMORY_OFFSET # QSFP capability byte parse, through this byte can know whether it support tx_power or not. # TODO: in the future when decided to migrate to support SFF-8636 instead of SFF-8436, @@ -440,7 +498,7 @@ def _dom_capability_detect(self): if qsfp_dom_capability_raw is not None: qsfp_version_compliance_raw = self._read_eeprom_specific_bytes(QSFP_VERSION_COMPLIANCE_OFFSET, QSFP_VERSION_COMPLIANCE_WIDTH) qsfp_version_compliance = int(qsfp_version_compliance_raw[0], 16) - dom_capability = sfpi_obj.parse_qsfp_dom_capability(qsfp_dom_capability_raw, 0) + dom_capability = sfpi_obj.parse_dom_capability(qsfp_dom_capability_raw, 0) if qsfp_version_compliance >= 0x08: self.dom_temp_supported = dom_capability['data']['Temp_support']['value'] == 'On' self.dom_volt_supported = dom_capability['data']['Voltage_support']['value'] == 'On' @@ -476,15 +534,15 @@ def _dom_capability_detect(self): if sfpi_obj is None: self.dom_supported = False - offset = 0 + offset = PAGE00_LOWER_MEMORY_OFFSET # two types of QSFP-DD cable types supported: Copper and Optical. qsfp_dom_capability_raw = self._read_eeprom_specific_bytes((offset + XCVR_DOM_CAPABILITY_OFFSET_QSFP_DD), XCVR_DOM_CAPABILITY_WIDTH_QSFP_DD) if qsfp_dom_capability_raw is not None: - self.dom_temp_supported = True - self.dom_volt_supported = True - dom_capability = sfpi_obj.parse_qsfp_dom_capability(qsfp_dom_capability_raw, 0) + dom_capability = sfpi_obj.parse_dom_capability(qsfp_dom_capability_raw, 0) if dom_capability['data']['Flat_MEM']['value'] == 'Off': self.dom_supported = True + self.dom_temp_supported = True + self.dom_volt_supported = True self.second_application_list = True self.dom_rx_power_supported = True self.dom_tx_power_supported = True @@ -493,6 +551,8 @@ def _dom_capability_detect(self): self.dom_rx_tx_power_bias_supported = True else: self.dom_supported = False + self.dom_temp_supported = False + self.dom_volt_supported = False self.second_application_list = False self.dom_rx_power_supported = False self.dom_tx_power_supported = False @@ -503,6 +563,7 @@ def _dom_capability_detect(self): self.dom_supported = False self.dom_temp_supported = False self.dom_volt_supported = False + self.second_application_list = False self.dom_rx_power_supported = False self.dom_tx_power_supported = False self.dom_tx_bias_power_supported = False @@ -544,9 +605,7 @@ def _dom_capability_detect(self): def _convert_string_to_num(self, value_str): - if "-inf" in value_str: - return 'N/A' - elif "Unknown" in value_str: + if "Unknown" in value_str: return 'N/A' elif 'dBm' in value_str: t_str = value_str.rstrip('dBm') @@ -563,7 +622,7 @@ def _convert_string_to_num(self, value_str): else: return 'N/A' - + @refresh_sfp_type() def get_transceiver_info(self): """ Retrieves transceiver info of this SFP @@ -597,7 +656,7 @@ def get_transceiver_info(self): # in inf8628.py lack of some memory map definition # will be implemented when the inf8628 memory map ready if self.sfp_type == OSFP_TYPE: - offset = 0 + offset = PAGE00_LOWER_MEMORY_OFFSET vendor_rev_width = XCVR_HW_REV_WIDTH_OSFP sfpi_obj = inf8628InterfaceId() @@ -652,7 +711,7 @@ def get_transceiver_info(self): transceiver_info_dict['application_advertisement'] = 'N/A' elif self.sfp_type == QSFP_TYPE: - offset = 128 + offset = PAGE00_HIGH_MEMORY_OFFSET vendor_rev_width = XCVR_HW_REV_WIDTH_QSFP cable_length_width = XCVR_CABLE_LENGTH_WIDTH_QSFP interface_info_bulk_width = XCVR_INTFACE_BULK_WIDTH_QSFP @@ -664,7 +723,7 @@ def get_transceiver_info(self): return None elif self.sfp_type == QSFP_DD_TYPE: - offset = 128 + offset = PAGE00_HIGH_MEMORY_OFFSET sfpi_obj = qsfp_dd_InterfaceId() if sfpi_obj is None: @@ -779,7 +838,7 @@ def get_transceiver_info(self): transceiver_info_dict['application_advertisement'] = host_media_list else: - offset = 0 + offset = PAGE00_LOWER_MEMORY_OFFSET vendor_rev_width = XCVR_HW_REV_WIDTH_SFP cable_length_width = XCVR_CABLE_LENGTH_WIDTH_SFP interface_info_bulk_width = XCVR_INTFACE_BULK_WIDTH_SFP @@ -868,7 +927,7 @@ def get_transceiver_info(self): return transceiver_info_dict - + @refresh_sfp_type() def get_transceiver_bulk_status(self): """ Retrieves transceiver bulk status of this SFP @@ -923,7 +982,7 @@ def get_transceiver_bulk_status(self): if not self.dom_supported: return transceiver_dom_info_dict - offset = 0 + offset = PAGE00_LOWER_MEMORY_OFFSET sfpd_obj = sff8436Dom() if sfpd_obj is None: return transceiver_dom_info_dict @@ -971,7 +1030,7 @@ def get_transceiver_bulk_status(self): elif self.sfp_type == QSFP_DD_TYPE: - offset = 0 + offset = PAGE00_LOWER_MEMORY_OFFSET sfpd_obj = qsfp_dd_Dom() if sfpd_obj is None: return transceiver_dom_info_dict @@ -998,7 +1057,7 @@ def get_transceiver_bulk_status(self): if self.dom_rx_tx_power_bias_supported: # page 11h - offset = 512 + offset = PAGE17_OFFSET dom_data_raw = self._read_eeprom_specific_bytes(offset + QSFP_DD_CHANNL_MON_OFFSET, QSFP_DD_CHANNL_MON_WIDTH) if dom_data_raw is None: return transceiver_dom_info_dict @@ -1040,7 +1099,7 @@ def get_transceiver_bulk_status(self): if not self.dom_supported: return transceiver_dom_info_dict - offset = 256 + offset = PAGE01_OFFSET sfpd_obj = sff8472Dom() if sfpd_obj is None: return transceiver_dom_info_dict @@ -1068,7 +1127,7 @@ def get_transceiver_bulk_status(self): return transceiver_dom_info_dict - + @refresh_sfp_type() def get_transceiver_threshold_info(self): """ Retrieves transceiver threshold info of this SFP @@ -1122,9 +1181,10 @@ def get_transceiver_threshold_info(self): if not self.dom_supported or not self.qsfp_page3_available: return transceiver_dom_threshold_info_dict - # Dom Threshold data starts from offset 384 + # Dom Threshold data starts from page03 # Revert offset back to 0 once data is retrieved - offset = QSFP_MODULE_UPPER_PAGE3_START + # offset = QSFP_MODULE_UPPER_PAGE3_START + offset = PAGE03_OFFSET sfpd_obj = sff8436Dom() if sfpd_obj is None: return transceiver_dom_threshold_info_dict @@ -1174,8 +1234,9 @@ def get_transceiver_threshold_info(self): if sfpd_obj is None: return transceiver_dom_threshold_info_dict - # page 02 - offset = 384 + # QSFP-DD cable threshold is started from 128 byte of page02 + # so the offset will be page00 + page01 = 256 + 256 + offset = PAGE02_OFFSET dom_module_threshold_raw = self._read_eeprom_specific_bytes((offset + QSFP_DD_MODULE_THRESHOLD_OFFSET), QSFP_DD_MODULE_THRESHOLD_WIDTH) if dom_module_threshold_raw is None: return transceiver_dom_threshold_info_dict @@ -1245,7 +1306,7 @@ def get_transceiver_threshold_info(self): return transceiver_dom_threshold_info_dict - + @refresh_sfp_type() def get_reset_status(self): """ Retrieves the reset status of SFP @@ -1270,7 +1331,7 @@ def get_reset_status(self): if self.sfp_type == OSFP_TYPE: return False elif self.sfp_type == QSFP_TYPE: - offset = 0 + offset = PAGE00_LOWER_MEMORY_OFFSET sfpd_obj = sff8436Dom() dom_module_monitor_raw = self._read_eeprom_specific_bytes((offset + QSFP_MODULE_MONITOR_OFFSET), QSFP_MODULE_MONITOR_WIDTH) @@ -1279,7 +1340,7 @@ def get_reset_status(self): else: return False elif self.sfp_type == SFP_TYPE: - offset = 0 + offset = PAGE00_LOWER_MEMORY_OFFSET sfpd_obj = sff8472Dom() dom_channel_monitor_raw = self._read_eeprom_specific_bytes((offset + SFP_CHANNL_STATUS_OFFSET), SFP_CHANNL_STATUS_WIDTH) @@ -1288,7 +1349,7 @@ def get_reset_status(self): else: return False elif self.sfp_type == QSFP_DD_TYPE: - offset = 0 + offset = PAGE00_LOWER_MEMORY_OFFSET sfpd_obj = qsfp_dd_Dom() dom_channel_status_raw = self._read_eeprom_specific_bytes((offset + QSFP_DD_CHANNL_STATUS_OFFSET), QSFP_DD_CHANNL_STATUS_WIDTH) @@ -1298,6 +1359,7 @@ def get_reset_status(self): dom_channel_status_data = sfpd_obj.parse_dom_channel_status(dom_channel_status_raw, 0) return dom_channel_status_data['data']['Status']['value'] == 'On' + @refresh_sfp_type() def get_rx_los(self): """ Retrieves the RX LOS (lost-of-signal) status of SFP @@ -1305,7 +1367,13 @@ def get_rx_los(self): Returns: A Boolean, True if SFP has RX LOS, False if not. Note : RX LOS status is latched until a call to get_rx_los or a reset. + + Known issue in this function: + These bytes are protected from reading due to some limitation + in the future will provide a dedicated sysfs for rx_los reading + Currently only provide dummy implementation, always return false """ + if not self.dom_supported: return None @@ -1313,42 +1381,18 @@ def get_rx_los(self): if self.sfp_type == OSFP_TYPE: return None elif self.sfp_type == QSFP_TYPE: - offset = 0 - dom_channel_monitor_raw = self._read_eeprom_specific_bytes((offset + QSFP_CHANNL_RX_LOS_STATUS_OFFSET), QSFP_CHANNL_RX_LOS_STATUS_WIDTH) - if dom_channel_monitor_raw is not None: - rx_los_data = int(dom_channel_monitor_raw[0], 16) - rx_los_list.append(rx_los_data & 0x01 != 0) - rx_los_list.append(rx_los_data & 0x02 != 0) - rx_los_list.append(rx_los_data & 0x04 != 0) - rx_los_list.append(rx_los_data & 0x08 != 0) - + rx_los_list = [False]*4 elif self.sfp_type == QSFP_DD_TYPE: # page 11h if self.dom_rx_tx_power_bias_supported: - offset = 512 - dom_channel_monitor_raw = self._read_eeprom_specific_bytes((offset + QSFP_DD_CHANNL_RX_LOS_STATUS_OFFSET), QSFP_DD_CHANNL_RX_LOS_STATUS_WIDTH) - if dom_channel_monitor_raw is not None: - rx_los_data = int(dom_channel_monitor_raw[0], 8) - rx_los_list.append(rx_los_data & 0x01 != 0) - rx_los_list.append(rx_los_data & 0x02 != 0) - rx_los_list.append(rx_los_data & 0x04 != 0) - rx_los_list.append(rx_los_data & 0x08 != 0) - rx_los_list.append(rx_los_data & 0x10 != 0) - rx_los_list.append(rx_los_data & 0x20 != 0) - rx_los_list.append(rx_los_data & 0x40 != 0) - rx_los_list.append(rx_los_data & 0x80 != 0) - - else: - offset = 256 - dom_channel_monitor_raw = self._read_eeprom_specific_bytes((offset + SFP_CHANNL_STATUS_OFFSET), SFP_CHANNL_STATUS_WIDTH) - if dom_channel_monitor_raw is not None: - rx_los_data = int(dom_channel_monitor_raw[0], 16) - rx_los_list.append(rx_los_data & 0x02 != 0) + rx_los_list = [False]*8 else: - return None + return rx_los_list + else: + rx_los_list.append(False) return rx_los_list - + @refresh_sfp_type() def get_tx_fault(self): """ Retrieves the TX fault status of SFP @@ -1356,7 +1400,13 @@ def get_tx_fault(self): Returns: A Boolean, True if SFP has TX fault, False if not Note : TX fault status is lached until a call to get_tx_fault or a reset. + + Known issue in this function: + These bytes are protected from reading due to some limitation + in the future will provide a dedicated sysfs for tx_fault reading + Currently only provide dummy implementation, always return false """ + if not self.dom_supported: return None @@ -1364,43 +1414,18 @@ def get_tx_fault(self): if self.sfp_type == OSFP_TYPE: return None elif self.sfp_type == QSFP_TYPE: - offset = 0 - dom_channel_monitor_raw = self._read_eeprom_specific_bytes((offset + QSFP_CHANNL_TX_FAULT_STATUS_OFFSET), QSFP_CHANNL_TX_FAULT_STATUS_WIDTH) - if dom_channel_monitor_raw is not None: - tx_fault_data = int(dom_channel_monitor_raw[0], 16) - tx_fault_list.append(tx_fault_data & 0x01 != 0) - tx_fault_list.append(tx_fault_data & 0x02 != 0) - tx_fault_list.append(tx_fault_data & 0x04 != 0) - tx_fault_list.append(tx_fault_data & 0x08 != 0) - + tx_fault_list = [False]*4 elif self.sfp_type == QSFP_DD_TYPE: - return None # page 11h if self.dom_rx_tx_power_bias_supported: - offset = 512 - dom_channel_monitor_raw = self._read_eeprom_specific_bytes((offset + QSFP_DD_CHANNL_TX_FAULT_STATUS_OFFSET), QSFP_DD_CHANNL_TX_FAULT_STATUS_WIDTH) - if dom_channel_monitor_raw is not None: - tx_fault_data = int(dom_channel_monitor_raw[0], 8) - tx_fault_list.append(tx_fault_data & 0x01 != 0) - tx_fault_list.append(tx_fault_data & 0x02 != 0) - tx_fault_list.append(tx_fault_data & 0x04 != 0) - tx_fault_list.append(tx_fault_data & 0x08 != 0) - tx_fault_list.append(tx_fault_data & 0x10 != 0) - tx_fault_list.append(tx_fault_data & 0x20 != 0) - tx_fault_list.append(tx_fault_data & 0x40 != 0) - tx_fault_list.append(tx_fault_data & 0x80 != 0) - - else: - offset = 256 - dom_channel_monitor_raw = self._read_eeprom_specific_bytes((offset + SFP_CHANNL_STATUS_OFFSET), SFP_CHANNL_STATUS_WIDTH) - if dom_channel_monitor_raw is not None: - tx_fault_data = int(dom_channel_monitor_raw[0], 16) - tx_fault_list.append(tx_fault_data & 0x04 != 0) + tx_fault_list = [False]*8 else: return None + else: + tx_fault_list.append(False) return tx_fault_list - + @refresh_sfp_type() def get_tx_disable(self): """ Retrieves the tx_disable status of this SFP @@ -1419,7 +1444,7 @@ def get_tx_disable(self): if self.sfp_type == OSFP_TYPE: return None elif self.sfp_type == QSFP_TYPE: - offset = 0 + offset = PAGE00_LOWER_MEMORY_OFFSET dom_channel_monitor_raw = self._read_eeprom_specific_bytes((offset + QSFP_CHANNL_DISABLE_STATUS_OFFSET), QSFP_CHANNL_DISABLE_STATUS_WIDTH) if dom_channel_monitor_raw is not None: tx_disable_data = int(dom_channel_monitor_raw[0], 16) @@ -1430,7 +1455,7 @@ def get_tx_disable(self): elif self.sfp_type == QSFP_DD_TYPE: if self.dom_rx_tx_power_bias_supported: - offset = 128 + offset = PAGE00_HIGH_MEMORY_OFFSET dom_channel_monitor_raw = self._read_eeprom_specific_bytes((offset + QSFP_DD_CHANNL_DISABLE_STATUS_OFFSET), QSFP_DD_CHANNL_DISABLE_STATUS_WIDTH) if dom_channel_monitor_raw is not None: tx_disable_data = int(dom_channel_monitor_raw[0], 16) @@ -1444,7 +1469,7 @@ def get_tx_disable(self): tx_disable_list.append(tx_disable_data & 0x80 != 0) else: - offset = 256 + offset = PAGE01_OFFSET dom_channel_monitor_raw = self._read_eeprom_specific_bytes((offset + SFP_CHANNL_STATUS_OFFSET), SFP_CHANNL_STATUS_WIDTH) if dom_channel_monitor_raw is not None: tx_disable_data = int(dom_channel_monitor_raw[0], 16) @@ -1479,9 +1504,12 @@ def mgmt_phy_mod_pwr_attr_get(self, power_attr_type): sx_mgmt_phy_mod_pwr_attr = sx_mgmt_phy_mod_pwr_attr_t() sx_mgmt_phy_mod_pwr_attr.power_attr_type = power_attr_type sx_mgmt_phy_mod_pwr_attr_t_p_assign(sx_mgmt_phy_mod_pwr_attr_p, sx_mgmt_phy_mod_pwr_attr) + module_id_info = sx_mgmt_module_id_info_t() + module_id_info.slot_id = 0 + module_id_info.module_id = self.sdk_index try: - rc = sx_mgmt_phy_mod_pwr_attr_get(self.sdk_handle, self.sdk_index, sx_mgmt_phy_mod_pwr_attr_p) - assert SX_STATUS_SUCCESS == rc, "sx_mgmt_phy_mod_pwr_attr_get failed" + rc = sx_mgmt_phy_module_pwr_attr_get(self.sdk_handle, module_id_info, sx_mgmt_phy_mod_pwr_attr_p) + assert SX_STATUS_SUCCESS == rc, "sx_mgmt_phy_module_pwr_attr_get failed {}".format(rc) sx_mgmt_phy_mod_pwr_attr = sx_mgmt_phy_mod_pwr_attr_t_p_value(sx_mgmt_phy_mod_pwr_attr_p) pwr_mode_attr = sx_mgmt_phy_mod_pwr_attr.pwr_mode_attr return pwr_mode_attr.admin_pwr_mode_e, pwr_mode_attr.oper_pwr_mode_e @@ -1500,7 +1528,7 @@ def get_lpmode(self): return oper_pwr_mode == SX_MGMT_PHY_MOD_PWR_MODE_LOW_E - + @refresh_sfp_type(refresh_dom_capability=True) def get_power_override(self): """ Retrieves the power-override status of this SFP @@ -1509,7 +1537,7 @@ def get_power_override(self): A Boolean, True if power-override is enabled, False if disabled """ if self.sfp_type == QSFP_TYPE: - offset = 0 + offset = PAGE00_LOWER_MEMORY_OFFSET sfpd_obj = sff8436Dom() if sfpd_obj is None: return False @@ -1521,7 +1549,7 @@ def get_power_override(self): else: return NotImplementedError - + @refresh_sfp_type() def get_temperature(self): """ Retrieves the temperature of this SFP @@ -1532,8 +1560,7 @@ def get_temperature(self): if not self.dom_supported: return None if self.sfp_type == QSFP_TYPE: - offset = 0 - offset_xcvr = 128 + offset = PAGE00_LOWER_MEMORY_OFFSET sfpd_obj = sff8436Dom() if sfpd_obj is None: @@ -1551,7 +1578,7 @@ def get_temperature(self): return None elif self.sfp_type == QSFP_DD_TYPE: - offset = 0 + offset = PAGE00_LOWER_MEMORY_OFFSET sfpd_obj = qsfp_dd_Dom() if sfpd_obj is None: @@ -1566,7 +1593,7 @@ def get_temperature(self): return None else: - offset = 256 + offset = PAGE01_OFFSET sfpd_obj = sff8472Dom() if sfpd_obj is None: return None @@ -1580,7 +1607,7 @@ def get_temperature(self): else: return None - + @refresh_sfp_type() def get_voltage(self): """ Retrieves the supply voltage of this SFP @@ -1591,8 +1618,7 @@ def get_voltage(self): if not self.dom_supported: return None if self.sfp_type == QSFP_TYPE: - offset = 0 - offset_xcvr = 128 + offset = PAGE00_LOWER_MEMORY_OFFSET sfpd_obj = sff8436Dom() if sfpd_obj is None: @@ -1609,7 +1635,7 @@ def get_voltage(self): return None if self.sfp_type == QSFP_DD_TYPE: - offset = 128 + offset = PAGE00_HIGH_MEMORY_OFFSET sfpd_obj = qsfp_dd_Dom() if sfpd_obj is None: @@ -1624,7 +1650,7 @@ def get_voltage(self): return None else: - offset = 256 + offset = PAGE01_OFFSET sfpd_obj = sff8472Dom() if sfpd_obj is None: @@ -1640,7 +1666,7 @@ def get_voltage(self): else: return None - + @refresh_sfp_type() def get_tx_bias(self): """ Retrieves the TX bias current of this SFP @@ -1652,8 +1678,7 @@ def get_tx_bias(self): """ tx_bias_list = [] if self.sfp_type == QSFP_TYPE: - offset = 0 - offset_xcvr = 128 + offset = PAGE00_LOWER_MEMORY_OFFSET sfpd_obj = sff8436Dom() if sfpd_obj is None: @@ -1670,12 +1695,12 @@ def get_tx_bias(self): elif self.sfp_type == QSFP_DD_TYPE: # page 11h if self.dom_rx_tx_power_bias_supported: - offset = 512 + offset = PAGE17_OFFSET sfpd_obj = qsfp_dd_Dom() if sfpd_obj is None: return None - if dom_tx_bias_power_supported: + if self.dom_tx_bias_power_supported: dom_tx_bias_raw = self._read_eeprom_specific_bytes((offset + QSFP_DD_TX_BIAS_OFFSET), QSFP_DD_TX_BIAS_WIDTH) if dom_tx_bias_raw is not None: dom_tx_bias_data = sfpd_obj.parse_dom_tx_bias(dom_tx_bias_raw, 0) @@ -1689,7 +1714,7 @@ def get_tx_bias(self): tx_bias_list.append(self._convert_string_to_num(dom_tx_bias_data['data']['TX8Bias']['value'])) else: - offset = 256 + offset = PAGE01_OFFSET sfpd_obj = sff8472Dom() if sfpd_obj is None: @@ -1708,7 +1733,7 @@ def get_tx_bias(self): return tx_bias_list - + @refresh_sfp_type() def get_rx_power(self): """ Retrieves the received optical power for this SFP @@ -1724,8 +1749,7 @@ def get_rx_power(self): return None elif self.sfp_type == QSFP_TYPE: - offset = 0 - offset_xcvr = 128 + offset = PAGE00_LOWER_MEMORY_OFFSET sfpd_obj = sff8436Dom() if sfpd_obj is None: @@ -1747,7 +1771,7 @@ def get_rx_power(self): elif self.sfp_type == QSFP_DD_TYPE: # page 11 if self.dom_rx_tx_power_bias_supported: - offset = 512 + offset = PAGE17_OFFSET sfpd_obj = qsfp_dd_Dom() if sfpd_obj is None: return None @@ -1766,7 +1790,7 @@ def get_rx_power(self): rx_power_list.append(self._convert_string_to_num(dom_rx_power_data['data']['RX8Power']['value'])) else: - offset = 256 + offset = PAGE01_OFFSET sfpd_obj = sff8472Dom() if sfpd_obj is None: @@ -1785,7 +1809,7 @@ def get_rx_power(self): return None return rx_power_list - + @refresh_sfp_type() def get_tx_power(self): """ Retrieves the TX power of this SFP @@ -1801,8 +1825,7 @@ def get_tx_power(self): return None elif self.sfp_type == QSFP_TYPE: - offset = 0 - offset_xcvr = 128 + offset = PAGE00_LOWER_MEMORY_OFFSET sfpd_obj = sff8436Dom() if sfpd_obj is None: @@ -1825,7 +1848,7 @@ def get_tx_power(self): return None # page 11 if self.dom_rx_tx_power_bias_supported: - offset = 512 + offset = PAGE17_OFFSET sfpd_obj = qsfp_dd_Dom() if sfpd_obj is None: return None @@ -1844,7 +1867,7 @@ def get_tx_power(self): tx_power_list.append(self._convert_string_to_num(dom_tx_power_data['data']['TX8Power']['value'])) else: - offset = 256 + offset = PAGE01_OFFSET sfpd_obj = sff8472Dom() if sfpd_obj is None: return None @@ -1872,9 +1895,12 @@ def reset(self): refer plugins/sfpreset.py """ - rc = sx_mgmt_phy_mod_reset(self.sdk_handle, self.sdk_index) + module_id_info = sx_mgmt_module_id_info_t() + module_id_info.slot_id = 0 + module_id_info.module_id = self.sdk_index + rc = sx_mgmt_phy_module_reset(self.sdk_handle, module_id_info) if rc != SX_STATUS_SUCCESS: - logger.log_warning("sx_mgmt_phy_mod_reset failed, rc = %d" % rc) + logger.log_error("Error occurred when resetting SFP module {}, error code {}".format(self.sdk_index, rc)) return rc == SX_STATUS_SUCCESS @@ -1951,14 +1977,17 @@ def set_port_admin_status_by_log_port(self, log_port, admin_status): def get_logical_ports(self): # Get all the ports related to the sfp, if port admin status is up, put it to list - port_attributes_list = new_sx_port_attributes_t_arr(SX_PORT_ATTR_ARR_SIZE) port_cnt_p = new_uint32_t_p() - uint32_t_p_assign(port_cnt_p, SX_PORT_ATTR_ARR_SIZE) + uint32_t_p_assign(port_cnt_p, 0) + rc = sx_api_port_device_get(self.sdk_handle, DEVICE_ID, SWITCH_ID, None, port_cnt_p) + assert rc == SX_STATUS_SUCCESS, "sx_api_port_device_get failed, rc = %d" % rc + port_cnt = uint32_t_p_value(port_cnt_p) + port_attributes_list = new_sx_port_attributes_t_arr(port_cnt) + rc = sx_api_port_device_get(self.sdk_handle, DEVICE_ID , SWITCH_ID, port_attributes_list, port_cnt_p) assert rc == SX_STATUS_SUCCESS, "sx_api_port_device_get failed, rc = %d" % rc - port_cnt = uint32_t_p_value(port_cnt_p) log_port_list = [] for i in range(0, port_cnt): port_attributes = sx_port_attributes_t_arr_getitem(port_attributes_list, i) @@ -1982,10 +2011,13 @@ def mgmt_phy_mod_pwr_attr_set(self, power_attr_type, admin_pwr_mode): sx_mgmt_phy_mod_pwr_attr.pwr_mode_attr = sx_mgmt_phy_mod_pwr_mode_attr sx_mgmt_phy_mod_pwr_attr_p = new_sx_mgmt_phy_mod_pwr_attr_t_p() sx_mgmt_phy_mod_pwr_attr_t_p_assign(sx_mgmt_phy_mod_pwr_attr_p, sx_mgmt_phy_mod_pwr_attr) + module_id_info = sx_mgmt_module_id_info_t() + module_id_info.slot_id = 0 + module_id_info.module_id = self.sdk_index try: - rc = sx_mgmt_phy_mod_pwr_attr_set(self.sdk_handle, SX_ACCESS_CMD_SET, self.sdk_index, sx_mgmt_phy_mod_pwr_attr_p) + rc = sx_mgmt_phy_module_pwr_attr_set(self.sdk_handle, SX_ACCESS_CMD_SET, module_id_info, sx_mgmt_phy_mod_pwr_attr_p) if SX_STATUS_SUCCESS != rc: - logger.log_error("sx_mgmt_phy_mod_pwr_attr_set failed, rc = %d" % rc) + logger.log_error("Error occurred when setting power mode for SFP module {}, error code {}".format(self.sdk_index, rc)) result = False else: result = True diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp_event.py b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp_event.py index 5c57e213a196..592d153e100f 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/sfp_event.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/sfp_event.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python ''' listen to the SDK for the SFP change event and return to chassis. ''' @@ -218,7 +217,7 @@ def check_sfp_status(self, port_change, timeout): found = 0 try: - read, _, _ = select.select([self.rx_fd_p.fd], [], [], timeout) + read, _, _ = select.select([self.rx_fd_p.fd], [], [], float(timeout) / 1000) except select.error as err: rc, msg = err if rc == errno.EAGAIN or rc == errno.EINTR: @@ -274,9 +273,8 @@ def on_pmpe(self, fd_p): pkt = new_uint8_t_arr(pkt_size) recv_info_p = new_sx_receive_info_t_p() pmpe_t = sx_event_pmpe_t() - port_attributes_list = new_sx_port_attributes_t_arr(64) port_cnt_p = new_uint32_t_p() - uint32_t_p_assign(port_cnt_p,64) + uint32_t_p_assign(port_cnt_p, 0) label_port_list = [] module_state = 0 @@ -296,27 +294,44 @@ def on_pmpe(self, fd_p): if module_state == SDK_SFP_STATE_ERR: logger.log_error("Receive PMPE error event on module {}: status {} error type {}".format(module_id, module_state, error_type)) elif module_state == SDK_SFP_STATE_DIS: - logger.log_info("Receive PMPE disable event on module {}: status {}".format(module_id, module_state)) + logger.log_notice("Receive PMPE disable event on module {}: status {}".format(module_id, module_state)) elif module_state == SDK_SFP_STATE_IN or module_state == SDK_SFP_STATE_OUT: - logger.log_info("Receive PMPE plug in/out event on module {}: status {}".format(module_id, module_state)) + logger.log_notice("Receive PMPE plug in/out event on module {}: status {}".format(module_id, module_state)) else: logger.log_error("Receive PMPE unknown event on module {}: status {}".format(module_id, module_state)) - for i in range(port_list_size): - logical_port = sx_port_log_id_t_arr_getitem(logical_port_list, i) - rc = sx_api_port_device_get(self.handle, 1 , 0, port_attributes_list, port_cnt_p) - port_cnt = uint32_t_p_value(port_cnt_p) - for i in range(port_cnt): - port_attributes = sx_port_attributes_t_arr_getitem(port_attributes_list,i) - if port_attributes.log_port == logical_port: - lable_port = port_attributes.port_mapping.module_port - break - label_port_list.append(lable_port) + # Call sx_api_port_device_get with port_cnt_p=0, SDK will return the logical port number + rc = sx_api_port_device_get(self.handle, 1, 0, None, port_cnt_p) + if rc != SX_STATUS_SUCCESS: + logger.log_error("Failed to get logical port number") + status = False + else: + port_cnt = uint32_t_p_value(port_cnt_p) + port_attributes_list = new_sx_port_attributes_t_arr(port_cnt) + rc = sx_api_port_device_get(self.handle, 1, 0, port_attributes_list, port_cnt_p) + if rc != SX_STATUS_SUCCESS: + logger.log_error("Failed to get logical port attributes") + status = False + else: + for i in range(port_list_size): + label_port = None + logical_port = sx_port_log_id_t_arr_getitem(logical_port_list, i) + for j in range(port_cnt): + port_attributes = sx_port_attributes_t_arr_getitem(port_attributes_list,j) + if port_attributes.log_port == logical_port: + label_port = port_attributes.port_mapping.module_port + break + + if label_port is not None: + label_port_list.append(label_port) + delete_sx_port_attributes_t_arr(port_attributes_list) delete_uint32_t_p(pkt_size_p) delete_uint8_t_arr(pkt) delete_sx_receive_info_t_p(recv_info_p) - delete_sx_port_attributes_t_arr(port_attributes_list) delete_uint32_t_p(port_cnt_p) + if not label_port_list: + logger.log_error('Dropping PMPE event due to label port not found') + return status, label_port_list, module_state, error_type diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/thermal.py b/platform/mellanox/mlnx-platform-api/sonic_platform/thermal.py index c942b0d89d35..afdb15bfe901 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/thermal.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/thermal.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - ############################################################################# # Mellanox # @@ -15,6 +13,9 @@ from os.path import isfile, join import io import os.path + import glob + + from . import utils except ImportError as e: raise ImportError (str(e) + "- required module not found") @@ -48,7 +49,17 @@ THERMAL_ZONE_MODE = "thermal_zone_mode" THERMAL_ZONE_POLICY = "thermal_zone_policy" THERMAL_ZONE_TEMPERATURE = "thermal_zone_temp" -THERMAL_ZONE_NORMAL_TEMPERATURE = "temp_trip_norm" +THERMAL_ZONE_HOT_THRESHOLD = "temp_trip_hot" +THERMAL_ZONE_HIGH_THRESHOLD = "temp_trip_high" +THERMAL_ZONE_NORMAL_THRESHOLD = "temp_trip_norm" +THERMAL_ZONE_FOLDER_WILDCARD = '/run/hw-management/thermal/mlxsw*' +THERMAL_ZONE_HYSTERESIS = 5000 +COOLING_STATE_PATH = "/var/run/hw-management/thermal/cooling_cur_state" +# Min allowed cooling level when all thermal zones are in normal state +MIN_COOLING_LEVEL_FOR_NORMAL = 2 +# Min allowed cooling level when any thermal zone is in high state but no thermal zone is in emergency state +MIN_COOLING_LEVEL_FOR_HIGH = 4 +MAX_COOLING_LEVEL = 10 MODULE_TEMPERATURE_FAULT_PATH = "/var/run/hw-management/thermal/module{}_temp_fault" @@ -98,14 +109,14 @@ THERMAL_DEV_BOARD_AMBIENT : "Ambient Board Temp" } thermal_api_handlers = { - THERMAL_DEV_CATEGORY_CPU_CORE : thermal_api_handler_cpu_core, + THERMAL_DEV_CATEGORY_CPU_CORE : thermal_api_handler_cpu_core, THERMAL_DEV_CATEGORY_CPU_PACK : thermal_api_handler_cpu_pack, THERMAL_DEV_CATEGORY_MODULE : thermal_api_handler_module, THERMAL_DEV_CATEGORY_PSU : thermal_api_handler_psu, THERMAL_DEV_CATEGORY_GEARBOX : thermal_api_handler_gearbox } thermal_name = { - THERMAL_DEV_CATEGORY_CPU_CORE : "CPU Core {} Temp", + THERMAL_DEV_CATEGORY_CPU_CORE : "CPU Core {} Temp", THERMAL_DEV_CATEGORY_CPU_PACK : "CPU Pack Temp", THERMAL_DEV_CATEGORY_MODULE : "xSFP module {} Temp", THERMAL_DEV_CATEGORY_PSU : "PSU-{} Temp", @@ -128,9 +139,13 @@ THERMAL_API_GET_HIGH_THRESHOLD ] -platform_dict_thermal = {'x86_64-mlnx_msn2700-r0': 0, 'x86_64-mlnx_lssn2700-r0':0, 'x86_64-mlnx_msn2740-r0': 3, 'x86_64-mlnx_msn2100-r0': 1, 'x86_64-mlnx_msn2410-r0': 2, 'x86_64-mlnx_msn2010-r0': 4, 'x86_64-mlnx_msn3420-r0':9, 'x86_64-mlnx_msn3700-r0': 5, 'x86_64-mlnx_msn3700c-r0': 6, 'x86_64-mlnx_msn3800-r0': 7, 'x86_64-mlnx_msn4600c-r0':9, 'x86_64-mlnx_msn4700-r0': 8, 'x86_64-mlnx_msn4410-r0': 8} +platform_dict_thermal = {'x86_64-mlnx_msn2700-r0': 0, 'x86_64-mlnx_lssn2700-r0': 0, 'x86_64-mlnx_msn2740-r0': 3, + 'x86_64-mlnx_msn2100-r0': 1, 'x86_64-mlnx_msn2410-r0': 2, 'x86_64-mlnx_msn2010-r0': 4, + 'x86_64-mlnx_msn3420-r0': 9, 'x86_64-mlnx_msn3700-r0': 5, 'x86_64-mlnx_msn3700c-r0': 6, + 'x86_64-mlnx_msn3800-r0': 7, 'x86_64-mlnx_msn4600-r0': 12, 'x86_64-mlnx_msn4600c-r0': 10, + 'x86_64-mlnx_msn4700-r0': 8, 'x86_64-mlnx_msn4410-r0': 8} thermal_profile_list = [ - # 2700 + # 0 2700 { THERMAL_DEV_CATEGORY_CPU_CORE:(0, 2), THERMAL_DEV_CATEGORY_MODULE:(1, 32), @@ -145,7 +160,7 @@ ] ) }, - # 2100 + # 1 2100 { THERMAL_DEV_CATEGORY_CPU_CORE:(0, 4), THERMAL_DEV_CATEGORY_MODULE:(1, 16), @@ -160,7 +175,7 @@ ] ) }, - # 2410 + # 2 2410 { THERMAL_DEV_CATEGORY_CPU_CORE:(0, 2), THERMAL_DEV_CATEGORY_MODULE:(1, 56), @@ -175,7 +190,7 @@ ] ) }, - # 2740 + # 3 2740 { THERMAL_DEV_CATEGORY_CPU_CORE:(0, 4), THERMAL_DEV_CATEGORY_MODULE:(1, 32), @@ -190,7 +205,7 @@ ] ) }, - # 2010 + # 4 2010 { THERMAL_DEV_CATEGORY_CPU_CORE:(0, 4), THERMAL_DEV_CATEGORY_MODULE:(1, 22), @@ -205,7 +220,7 @@ ] ) }, - # 3700 + # 5 3700 { THERMAL_DEV_CATEGORY_CPU_CORE:(0, 4), THERMAL_DEV_CATEGORY_MODULE:(1, 32), @@ -221,7 +236,7 @@ ] ) }, - # 3700c + # 6 3700c { THERMAL_DEV_CATEGORY_CPU_CORE:(0, 2), THERMAL_DEV_CATEGORY_MODULE:(1, 32), @@ -237,7 +252,7 @@ ] ) }, - # 3800 + # 7 3800 { THERMAL_DEV_CATEGORY_CPU_CORE:(0, 4), THERMAL_DEV_CATEGORY_MODULE:(1, 64), @@ -253,7 +268,7 @@ ] ) }, - # 4700 + # 8 4700 { THERMAL_DEV_CATEGORY_CPU_CORE:(0, 4), THERMAL_DEV_CATEGORY_MODULE:(1, 32), @@ -269,7 +284,7 @@ ] ) }, - # 3420 + # 9 3420 { THERMAL_DEV_CATEGORY_CPU_CORE:(0, 2), THERMAL_DEV_CATEGORY_MODULE:(1, 60), @@ -285,7 +300,7 @@ ] ) }, - # 4600C + # 10 4600C { THERMAL_DEV_CATEGORY_CPU_CORE:(0, 4), THERMAL_DEV_CATEGORY_MODULE:(1, 64), @@ -301,7 +316,7 @@ ] ) }, - # 4410 + # 11 4410 { THERMAL_DEV_CATEGORY_CPU_CORE:(0, 4), THERMAL_DEV_CATEGORY_MODULE:(1, 32), @@ -316,6 +331,22 @@ THERMAL_DEV_FAN_AMBIENT ] ) + }, + # 12 4600 + { + THERMAL_DEV_CATEGORY_CPU_CORE:(0, 4), + THERMAL_DEV_CATEGORY_MODULE:(1, 64), + THERMAL_DEV_CATEGORY_PSU:(1, 2), + THERMAL_DEV_CATEGORY_CPU_PACK:(0,1), + THERMAL_DEV_CATEGORY_GEARBOX:(0,0), + THERMAL_DEV_CATEGORY_AMBIENT:(0, + [ + THERMAL_DEV_ASIC_AMBIENT, + THERMAL_DEV_COMEX_AMBIENT, + THERMAL_DEV_PORT_AMBIENT, + THERMAL_DEV_FAN_AMBIENT + ] + ) } ] @@ -333,7 +364,7 @@ def initialize_sfp_thermals(platform, thermal_list, sfp_index): thermal = Thermal(THERMAL_DEV_CATEGORY_MODULE, sfp_index, True, 1) thermal_list.append(thermal) - + def initialize_chassis_thermals(platform, thermal_list): # create thermal objects for all categories of sensors tp_index = platform_dict_thermal[platform] @@ -368,11 +399,20 @@ def initialize_chassis_thermals(platform, thermal_list): class Thermal(ThermalBase): thermal_profile = None thermal_algorithm_status = False + # Expect cooling level, used for caching the cooling level value before commiting to hardware + expect_cooling_level = None + # Expect cooling state + expect_cooling_state = None + # Last committed cooling level + last_set_cooling_level = None + last_set_cooling_state = None + last_set_psu_cooling_level = None def __init__(self, category, index, has_index, position, dependency = None): """ index should be a string for category ambient and int for other categories """ + super(Thermal, self).__init__() if category == THERMAL_DEV_CATEGORY_AMBIENT: self.name = thermal_ambient_name[index] self.index = index @@ -445,7 +485,7 @@ def get_temperature(self): Returns: A float number of current temperature in Celsius up to nearest thousandth - of one degree Celsius, e.g. 30.125 + of one degree Celsius, e.g. 30.125 """ if self.dependency: status, hint = self.dependency() @@ -527,7 +567,7 @@ def is_replaceable(self): @classmethod def _write_generic_file(cls, filename, content): """ - Generic functions to write content to a specified file path if + Generic functions to write content to a specified file path if the content has changed. """ try: @@ -547,8 +587,8 @@ def set_thermal_algorithm_status(cls, status, force=True): only adjust fan speed when temperature across some "edge", e.g temperature changes to exceed high threshold. When disable kernel thermal algorithm, kernel no longer adjust fan speed. - We usually disable the algorithm when we want to set a fix speed. E.g, when - a fan unit is removed from system, we will set fan speed to 100% and disable + We usually disable the algorithm when we want to set a fix speed. E.g, when + a fan unit is removed from system, we will set fan speed to 100% and disable the algorithm to avoid it adjust the speed. Returns: @@ -582,51 +622,38 @@ def set_thermal_algorithm_status(cls, status, force=True): return True @classmethod - def check_thermal_zone_temperature(cls): - """ - Check thermal zone current temperature with normal temperature + def get_min_allowed_cooling_level_by_thermal_zone(cls): + """Get min allowed cooling level according to thermal zone status: + 1. If temperature of all thermal zones is less than normal threshold, min allowed cooling level is + $MIN_COOLING_LEVEL_FOR_NORMAL = 2 + 2. If temperature of any thermal zone is greater than normal threshold, but no thermal zone temperature + is greater than high threshold, min allowed cooling level is $MIN_COOLING_LEVEL_FOR_HIGH = 4 + 3. Otherwise, there is no minimum allowed value and policy should not adjust cooling level Returns: - True if all thermal zones current temperature less or equal than normal temperature + int: minimum allowed cooling level """ - if not cls.thermal_profile: - raise Exception("Fail to get thermal profile for this switch") - - if not cls._check_thermal_zone_temperature(THERMAL_ZONE_ASIC_PATH): - return False - - if THERMAL_DEV_CATEGORY_MODULE in cls.thermal_profile: - start, count = cls.thermal_profile[THERMAL_DEV_CATEGORY_MODULE] - if count != 0: - for index in range(count): - if not cls._check_thermal_zone_temperature(THERMAL_ZONE_MODULE_PATH.format(start + index)): - return False - - if THERMAL_DEV_CATEGORY_GEARBOX in cls.thermal_profile: - start, count = cls.thermal_profile[THERMAL_DEV_CATEGORY_GEARBOX] - if count != 0: - for index in range(count): - if not cls._check_thermal_zone_temperature(THERMAL_ZONE_GEARBOX_PATH.format(start + index)): - return False - - return True + min_allowed = MIN_COOLING_LEVEL_FOR_NORMAL + thermal_zone_present = False + try: + for thermal_zone_folder in glob.iglob(THERMAL_ZONE_FOLDER_WILDCARD): + thermal_zone_present = True + normal_thresh = utils.read_int_from_file(os.path.join(thermal_zone_folder, THERMAL_ZONE_NORMAL_THRESHOLD)) + current = utils.read_int_from_file(os.path.join(thermal_zone_folder, THERMAL_ZONE_TEMPERATURE)) + if current < normal_thresh - THERMAL_ZONE_HYSTERESIS: + continue - @classmethod - def _check_thermal_zone_temperature(cls, thermal_zone_path): - normal_temp_path = join(thermal_zone_path, THERMAL_ZONE_NORMAL_TEMPERATURE) - current_temp_path = join(thermal_zone_path, THERMAL_ZONE_TEMPERATURE) - normal = None - current = None - try: - with open(normal_temp_path, 'r') as file_obj: - normal = float(file_obj.read()) - - with open(current_temp_path, 'r') as file_obj: - current = float(file_obj.read()) - - return current <= normal + hot_thresh = utils.read_int_from_file(os.path.join(thermal_zone_folder, THERMAL_ZONE_HIGH_THRESHOLD)) + if current < hot_thresh - THERMAL_ZONE_HYSTERESIS: + min_allowed = MIN_COOLING_LEVEL_FOR_HIGH + else: + min_allowed = None + break except Exception as e: - logger.log_info("Fail to check thermal zone temperature for file {} due to {}".format(thermal_zone_path, repr(e))) + logger.log_error('Failed to get thermal zone status for {} - {}'.format(thermal_zone_folder, repr(e))) + return None + + return min_allowed if thermal_zone_present else None @classmethod def check_module_temperature_trustable(cls): @@ -650,3 +677,85 @@ def get_min_amb_temperature(cls): fan_ambient_temp = int(cls._read_generic_file(fan_ambient_path, 0)) port_ambient_temp = int(cls._read_generic_file(port_ambient_path, 0)) return fan_ambient_temp if fan_ambient_temp < port_ambient_temp else port_ambient_temp + + @classmethod + def set_cooling_level(cls, level): + """ + Change cooling level. The input level should be an integer value [1, 10]. + 1 means 10%, 2 means 20%, 10 means 100%. + """ + if cls.last_set_cooling_level != level: + utils.write_file(COOLING_STATE_PATH, level + 10, raise_exception=True) + cls.last_set_cooling_level = level + + @classmethod + def set_cooling_state(cls, state): + """Change cooling state. + + Args: + state (int): cooling state + """ + if cls.last_set_cooling_state != state: + utils.write_file(COOLING_STATE_PATH, state, raise_exception=True) + cls.last_set_cooling_state = state + + @classmethod + def get_cooling_level(cls): + try: + return utils.read_int_from_file(COOLING_STATE_PATH, raise_exception=True) + except (ValueError, IOError) as e: + raise RuntimeError("Failed to get cooling level - {}".format(e)) + + @classmethod + def set_expect_cooling_level(cls, expect_value): + """During thermal policy running, cache the expect cooling level generated by policies. The max expect + cooling level will be committed to hardware. + + Args: + expect_value (int): Expected cooling level value + """ + if cls.expect_cooling_level is None or cls.expect_cooling_level < expect_value: + cls.expect_cooling_level = int(expect_value) + + @classmethod + def commit_cooling_level(cls, thermal_info_dict): + """Commit cooling level to hardware. This will affect system fan and PSU fan speed. + + Args: + thermal_info_dict (dict): Thermal information dictionary + """ + if cls.expect_cooling_level is not None: + cls.set_cooling_level(cls.expect_cooling_level) + + if cls.expect_cooling_state is not None: + cls.set_cooling_state(cls.expect_cooling_state) + elif cls.expect_cooling_level is not None: + cls.set_cooling_state(cls.expect_cooling_level) + + cls.expect_cooling_level = None + # We need to set system fan speed here because kernel will automaticlly adjust fan speed according to cooling level and cooling state + + # Commit PSU fan speed with current state + from .thermal_infos import ChassisInfo + if ChassisInfo.INFO_NAME in thermal_info_dict and isinstance(thermal_info_dict[ChassisInfo.INFO_NAME], ChassisInfo): + cooling_level = cls.get_cooling_level() + if cls.last_set_psu_cooling_level == cooling_level: + return + speed = cooling_level * 10 + chassis = thermal_info_dict[ChassisInfo.INFO_NAME].get_chassis() + for psu in chassis.get_all_psus(): + for psu_fan in psu.get_all_fans(): + psu_fan.set_speed(speed) + cls.last_set_psu_cooling_level = cooling_level + + @classmethod + def monitor_asic_themal_zone(cls): + """This is a protection for asic thermal zone, if asic temperature is greater than hot threshold + THERMAL_ZONE_HYSTERESIS, + and if cooling state is not MAX, we need enforce the cooling state to MAX + """ + asic_temp = utils.read_int_from_file(os.path.join(THERMAL_ZONE_ASIC_PATH, THERMAL_ZONE_TEMPERATURE), raise_exception=True) + hot_thresh = utils.read_int_from_file(os.path.join(THERMAL_ZONE_ASIC_PATH, THERMAL_ZONE_HOT_THRESHOLD), raise_exception=True) + if asic_temp >= hot_thresh + THERMAL_ZONE_HYSTERESIS: + cls.expect_cooling_state = MAX_COOLING_LEVEL + else: + cls.expect_cooling_state = None diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/thermal_actions.py b/platform/mellanox/mlnx-platform-api/sonic_platform/thermal_actions.py index e7436bd0a5b7..c5c2645b7915 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/thermal_actions.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/thermal_actions.py @@ -1,6 +1,5 @@ from sonic_platform_base.sonic_thermal_control.thermal_action_base import ThermalPolicyActionBase from sonic_platform_base.sonic_thermal_control.thermal_json_object import thermal_json_object -from .thermal import logger class SetFanSpeedAction(ThermalPolicyActionBase): @@ -48,120 +47,30 @@ def execute(self, thermal_info_dict): :param thermal_info_dict: A dictionary stores all thermal information. :return: """ - from .thermal_infos import FanInfo - if FanInfo.INFO_NAME in thermal_info_dict and isinstance(thermal_info_dict[FanInfo.INFO_NAME], FanInfo): - fan_info_obj = thermal_info_dict[FanInfo.INFO_NAME] - for fan in fan_info_obj.get_presence_fans(): - fan.set_speed(self.speed) - logger.log_info('Set all system FAN speed to {}'.format(self.speed)) - - SetAllFanSpeedAction.set_psu_fan_speed(thermal_info_dict, self.speed) - - @classmethod - def set_psu_fan_speed(cls, thermal_info_dict, speed): - from .thermal_infos import ChassisInfo - if ChassisInfo.INFO_NAME in thermal_info_dict and isinstance(thermal_info_dict[ChassisInfo.INFO_NAME], ChassisInfo): - chassis = thermal_info_dict[ChassisInfo.INFO_NAME].get_chassis() - for psu in chassis.get_all_psus(): - for psu_fan in psu.get_all_fans(): - psu_fan.set_speed(speed) - - -@thermal_json_object('fan.all.check_and_set_speed') -class CheckAndSetAllFanSpeedAction(SetAllFanSpeedAction): - """ - Action to check thermal zone temperature and recover speed for all fans - """ - def execute(self, thermal_info_dict): - """ - Check thermal zone and set speed for all fans - :param thermal_info_dict: A dictionary stores all thermal information. - :return: - """ from .thermal import Thermal - if Thermal.check_thermal_zone_temperature(): - SetAllFanSpeedAction.execute(self, thermal_info_dict) - - -@thermal_json_object('thermal_control.control') -class ControlThermalAlgoAction(ThermalPolicyActionBase): - """ - Action to control the thermal control algorithm - """ - # JSON field definition - JSON_FIELD_STATUS = 'status' - - def __init__(self): - self.status = True - - def load_from_json(self, json_obj): - """ - Construct ControlThermalAlgoAction via JSON. JSON example: - { - "type": "thermal_control.control" - "status": "true" - } - :param json_obj: A JSON object representing a ControlThermalAlgoAction action. - :return: - """ - if ControlThermalAlgoAction.JSON_FIELD_STATUS in json_obj: - status_str = json_obj[ControlThermalAlgoAction.JSON_FIELD_STATUS].lower() - if status_str == 'true': - self.status = True - elif status_str == 'false': - self.status = False - else: - raise ValueError('Invalid {} field value, please specify true of false'. - format(ControlThermalAlgoAction.JSON_FIELD_STATUS)) - else: - raise ValueError('ControlThermalAlgoAction ' - 'missing mandatory field {} in JSON policy file'. - format(ControlThermalAlgoAction.JSON_FIELD_STATUS)) - - def execute(self, thermal_info_dict): - """ - Disable thermal control algorithm - :param thermal_info_dict: A dictionary stores all thermal information. - :return: - """ - from .thermal_infos import FanInfo - from .thermal import Thermal - from .thermal_conditions import UpdateCoolingLevelToMinCondition - from .fan import Fan - status_changed = Thermal.set_thermal_algorithm_status(self.status, False) - - # Only update cooling level if thermal algorithm status changed - if status_changed: - if self.status: - # Check thermal zone temperature, if all thermal zone temperature - # back to normal, set it to minimum allowed speed to - # save power - UpdateCoolingLevelToMinAction.update_cooling_level_to_minimum(thermal_info_dict) - - logger.log_info('Changed thermal algorithm status to {}'.format(self.status)) + Thermal.set_expect_cooling_level(self.speed / 10) @thermal_json_object('thermal.recover') class ThermalRecoverAction(ThermalPolicyActionBase): - def execute(self, thermal_info_dict): - UpdateCoolingLevelToMinAction.update_cooling_level_to_minimum(thermal_info_dict) - - -class ChangeMinCoolingLevelAction(ThermalPolicyActionBase): UNKNOWN_SKU_COOLING_LEVEL = 6 + def execute(self, thermal_info_dict): from .device_data import DEVICE_DATA - from .fan import Fan + from .thermal import Thermal, MAX_COOLING_LEVEL, MIN_COOLING_LEVEL_FOR_HIGH, logger from .thermal_infos import ChassisInfo - from .thermal_conditions import MinCoolingLevelChangeCondition - from .thermal_conditions import UpdateCoolingLevelToMinCondition + Thermal.monitor_asic_themal_zone() + # Calculate dynamic minimum cooling level + dynamic_min_cooling_level = None chassis = thermal_info_dict[ChassisInfo.INFO_NAME].get_chassis() if chassis.platform_name not in DEVICE_DATA or 'thermal' not in DEVICE_DATA[chassis.platform_name] or 'minimum_table' not in DEVICE_DATA[chassis.platform_name]['thermal']: - Fan.min_cooling_level = ChangeMinCoolingLevelAction.UNKNOWN_SKU_COOLING_LEVEL + # If there is no minimum_table defined, set dynamic_min_cooling_level to default value + dynamic_min_cooling_level = ThermalRecoverAction.UNKNOWN_SKU_COOLING_LEVEL else: - trust_state = MinCoolingLevelChangeCondition.trust_state - temperature = MinCoolingLevelChangeCondition.temperature + trust_state = Thermal.check_module_temperature_trustable() + temperature = Thermal.get_min_amb_temperature() + temperature = int(temperature / 1000) minimum_table = DEVICE_DATA[chassis.platform_name]['thermal']['minimum_table']['unk_{}'.format(trust_state)] for key, cooling_level in minimum_table.items(): @@ -169,41 +78,19 @@ def execute(self, thermal_info_dict): temp_min = int(temp_range[0].strip()) temp_max = int(temp_range[1].strip()) if temp_min <= temperature <= temp_max: - Fan.min_cooling_level = cooling_level - 10 + dynamic_min_cooling_level = cooling_level - 10 break - - current_cooling_level = Fan.get_cooling_level() - if current_cooling_level < Fan.min_cooling_level: - Fan.set_cooling_level(Fan.min_cooling_level, Fan.min_cooling_level) - SetAllFanSpeedAction.set_psu_fan_speed(thermal_info_dict, Fan.min_cooling_level * 10) - else: - Fan.set_cooling_level(Fan.min_cooling_level, current_cooling_level) - UpdateCoolingLevelToMinAction.update_cooling_level_to_minimum(thermal_info_dict) - -class UpdatePsuFanSpeedAction(ThermalPolicyActionBase): - def execute(self, thermal_info_dict): - from .thermal_conditions import CoolingLevelChangeCondition - SetAllFanSpeedAction.set_psu_fan_speed(thermal_info_dict, CoolingLevelChangeCondition.cooling_level * 10) + if not dynamic_min_cooling_level: + # Should not go to this branch, just in case + logger.log_error('Failed to get dynamic minimum cooling level') + dynamic_min_cooling_level = MAX_COOLING_LEVEL - -class UpdateCoolingLevelToMinAction(ThermalPolicyActionBase): - def execute(self, thermal_info_dict): - self.update_cooling_level_to_minimum(thermal_info_dict) - - @classmethod - def update_cooling_level_to_minimum(cls, thermal_info_dict): - from .fan import Fan - from .thermal import Thermal - from .thermal_conditions import UpdateCoolingLevelToMinCondition - from .thermal_infos import FanInfo - if Thermal.check_thermal_zone_temperature(): - fan_info_obj = thermal_info_dict[FanInfo.INFO_NAME] - speed = Fan.min_cooling_level * 10 - for fan in fan_info_obj.get_presence_fans(): - fan.set_speed(speed) - SetAllFanSpeedAction.set_psu_fan_speed(thermal_info_dict, speed) - UpdateCoolingLevelToMinCondition.enable = False + if Thermal.last_set_cooling_level is not None and dynamic_min_cooling_level > Thermal.last_set_cooling_level and dynamic_min_cooling_level >= MIN_COOLING_LEVEL_FOR_HIGH: + # No need to check thermal zone as dynamic_min_cooling_level is greater than previous value and MIN_COOLING_LEVEL_FOR_HIGH + Thermal.set_expect_cooling_level(dynamic_min_cooling_level) else: - UpdateCoolingLevelToMinCondition.enable = True - + min_cooling_level_by_tz = Thermal.get_min_allowed_cooling_level_by_thermal_zone() + if min_cooling_level_by_tz is not None: + cooling_level = max(dynamic_min_cooling_level, min_cooling_level_by_tz) + Thermal.set_expect_cooling_level(cooling_level) diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/thermal_conditions.py b/platform/mellanox/mlnx-platform-api/sonic_platform/thermal_conditions.py index 94e18a2e00b0..94366c2c27ac 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/thermal_conditions.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/thermal_conditions.py @@ -74,53 +74,3 @@ class AllPsuPresenceCondition(PsuCondition): def is_match(self, thermal_info_dict): psu_info_obj = self.get_psu_info(thermal_info_dict) return len(psu_info_obj.get_absence_psus()) == 0 if psu_info_obj else False - - -class MinCoolingLevelChangeCondition(ThermalPolicyConditionBase): - trust_state = None - temperature = None - - def is_match(self, thermal_info_dict): - from .thermal import Thermal - - trust_state = Thermal.check_module_temperature_trustable() - temperature = Thermal.get_min_amb_temperature() - temperature = temperature / 1000 - - change_cooling_level = False - if trust_state != MinCoolingLevelChangeCondition.trust_state: - MinCoolingLevelChangeCondition.trust_state = trust_state - change_cooling_level = True - - if temperature != MinCoolingLevelChangeCondition.temperature: - MinCoolingLevelChangeCondition.temperature = temperature - change_cooling_level = True - - return change_cooling_level - - -class CoolingLevelChangeCondition(ThermalPolicyConditionBase): - cooling_level = None - - def is_match(self, thermal_info_dict): - from .fan import Fan - current_cooling_level = Fan.get_cooling_level() - if current_cooling_level != CoolingLevelChangeCondition.cooling_level: - CoolingLevelChangeCondition.cooling_level = current_cooling_level - return True - else: - return False - - -class UpdateCoolingLevelToMinCondition(ThermalPolicyConditionBase): - enable = False - def is_match(self, thermal_info_dict): - if not UpdateCoolingLevelToMinCondition.enable: - return False - - from .fan import Fan - current_cooling_level = Fan.get_cooling_level() - if current_cooling_level == Fan.min_cooling_level: - UpdateCoolingLevelToMinCondition.enable = False - return False - return True diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/thermal_infos.py b/platform/mellanox/mlnx-platform-api/sonic_platform/thermal_infos.py index e810a5646456..983e788c961c 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/thermal_infos.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/thermal_infos.py @@ -24,27 +24,28 @@ def collect(self, chassis): :return: """ self._status_changed = False - for fan in chassis.get_all_fans(): - presence = fan.get_presence() - status = fan.get_status() - if presence and fan not in self._presence_fans: - self._presence_fans.add(fan) - self._status_changed = True - if fan in self._absence_fans: - self._absence_fans.remove(fan) - elif not presence and fan not in self._absence_fans: - self._absence_fans.add(fan) - self._status_changed = True - if fan in self._presence_fans: - self._presence_fans.remove(fan) + for fan_drawer in chassis.get_all_fan_drawers(): + for fan in fan_drawer.get_all_fans(): + presence = fan.get_presence() + status = fan.get_status() + if presence and fan not in self._presence_fans: + self._presence_fans.add(fan) + self._status_changed = True + if fan in self._absence_fans: + self._absence_fans.remove(fan) + elif not presence and fan not in self._absence_fans: + self._absence_fans.add(fan) + self._status_changed = True + if fan in self._presence_fans: + self._presence_fans.remove(fan) + + if not status and fan not in self._fault_fans: + self._fault_fans.add(fan) + self._status_changed = True + elif status and fan in self._fault_fans: + self._fault_fans.remove(fan) + self._status_changed = True - if not status and fan not in self._fault_fans: - self._fault_fans.add(fan) - self._status_changed = True - elif status and fan in self._fault_fans: - self._fault_fans.remove(fan) - self._status_changed = True - def get_absence_fans(self): """ @@ -95,12 +96,12 @@ def collect(self, chassis): """ self._status_changed = False for psu in chassis.get_all_psus(): - if psu.get_presence() and psu.get_powergood_status() and psu not in self._presence_psus: + if psu.get_presence() and psu not in self._presence_psus: self._presence_psus.add(psu) self._status_changed = True if psu in self._absence_psus: self._absence_psus.remove(psu) - elif (not psu.get_presence() or not psu.get_powergood_status()) and psu not in self._absence_psus: + elif (not psu.get_presence()) and psu not in self._absence_psus: self._absence_psus.add(psu) self._status_changed = True if psu in self._presence_psus: diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/thermal_manager.py b/platform/mellanox/mlnx-platform-api/sonic_platform/thermal_manager.py index 914eec79816c..23fb22670e02 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/thermal_manager.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/thermal_manager.py @@ -4,36 +4,18 @@ from .thermal_actions import * from .thermal_conditions import * from .thermal_infos import * +from .thermal import logger, MAX_COOLING_LEVEL, Thermal class ThermalManager(ThermalManagerBase): - @classmethod - def initialize(cls): - """ - Initialize thermal manager, including register thermal condition types and thermal action types - and any other vendor specific initialization. - :return: - """ - cls._add_private_thermal_policy() - - @classmethod - def deinitialize(cls): - """ - Destroy thermal manager, including any vendor specific cleanup. The default behavior of this function - is a no-op. - :return: - """ - cls.start_thermal_control_algorithm() - @classmethod def start_thermal_control_algorithm(cls): """ Start thermal control algorithm Returns: - bool: True if set success, False if fail. + bool: True if set success, False if fail. """ - from .thermal import Thermal Thermal.set_thermal_algorithm_status(True) @classmethod @@ -42,24 +24,33 @@ def stop_thermal_control_algorithm(cls): Stop thermal control algorithm Returns: - bool: True if set success, False if fail. + bool: True if set success, False if fail. """ - from .thermal import Thermal Thermal.set_thermal_algorithm_status(False) @classmethod - def _add_private_thermal_policy(cls): - dynamic_min_speed_policy = ThermalPolicy() - dynamic_min_speed_policy.conditions[MinCoolingLevelChangeCondition] = MinCoolingLevelChangeCondition() - dynamic_min_speed_policy.actions[ChangeMinCoolingLevelAction] = ChangeMinCoolingLevelAction() - cls._policy_dict['DynamicMinCoolingLevelPolicy'] = dynamic_min_speed_policy - - update_psu_fan_speed_policy = ThermalPolicy() - update_psu_fan_speed_policy.conditions[CoolingLevelChangeCondition] = CoolingLevelChangeCondition() - update_psu_fan_speed_policy.actions[UpdatePsuFanSpeedAction] = UpdatePsuFanSpeedAction() - cls._policy_dict['UpdatePsuFanSpeedPolicy'] = update_psu_fan_speed_policy + def run_policy(cls, chassis): + if not cls._policy_dict: + return + + try: + cls._collect_thermal_information(chassis) + except Exception as e: + logger.log_error('Failed to collect thermal information {}'.format(repr(e))) + Thermal.set_expect_cooling_level(MAX_COOLING_LEVEL) + Thermal.commit_cooling_level(cls._thermal_info_dict) + return + + for policy in cls._policy_dict.values(): + if not cls._running: + return + try: + if policy.is_match(cls._thermal_info_dict): + policy.do_action(cls._thermal_info_dict) + except Exception as e: + logger.log_error('Failed to run thermal policy {} - {}'.format(policy.name, repr(e))) + # In case there is an exception, we put cooling level to max value + Thermal.set_expect_cooling_level(MAX_COOLING_LEVEL) + + Thermal.commit_cooling_level(cls._thermal_info_dict) - update_cooling_level_policy = ThermalPolicy() - update_cooling_level_policy.conditions[UpdateCoolingLevelToMinCondition] = UpdateCoolingLevelToMinCondition() - update_cooling_level_policy.actions[UpdateCoolingLevelToMinAction] = UpdateCoolingLevelToMinAction() - cls._policy_dict['UpdateCoolingLevelPolicy'] = update_cooling_level_policy diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/utils.py b/platform/mellanox/mlnx-platform-api/sonic_platform/utils.py index d5175acf8d0e..cee6d27b63fa 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/utils.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/utils.py @@ -1,3 +1,10 @@ +import functools +import subprocess + +# flags to indicate whether this process is running in docker or host +_is_host = None + + def read_str_from_file(file_path, default='', raise_exception=False): """ Read string content from file @@ -55,3 +62,43 @@ def write_file(file_path, content, raise_exception=False): else: raise e return True + + +def is_host(): + """ + Test whether current process is running on the host or an docker + return True for host and False for docker + """ + global _is_host + if _is_host is not None: + return _is_host + + _is_host = False + try: + proc = subprocess.Popen("docker --version 2>/dev/null", + stdout=subprocess.PIPE, + shell=True, + stderr=subprocess.STDOUT, + universal_newlines=True) + stdout = proc.communicate()[0] + proc.wait() + result = stdout.rstrip('\n') + if result != '': + _is_host = True + + except OSError as e: + pass + + return _is_host + + +def default_return(return_value): + def wrapper(method): + @functools.wraps(method) + def _impl(*args, **kwargs): + try: + return method(*args, **kwargs) + except: + return return_value + return _impl + return wrapper diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/watchdog.py b/platform/mellanox/mlnx-platform-api/sonic_platform/watchdog.py index e9694f1b2a59..0737b0446671 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/watchdog.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/watchdog.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - """ Mellanox @@ -63,6 +61,7 @@ def __init__(self, wd_device_path): Open a watchdog handle @param wd_device_path Path to watchdog device """ + super(WatchdogImplBase, self).__init__() self.watchdog_path = wd_device_path self.watchdog = os.open(self.watchdog_path, os.O_WRONLY) @@ -276,6 +275,9 @@ def get_watchdog(): if device.startswith("watchdog") and is_mlnx_wd_main(device): watchdog_main_device_name = device + if watchdog_main_device_name is None: + return None + watchdog_device_path = "/dev/{}".format(watchdog_main_device_name) watchdog = None diff --git a/platform/mellanox/mlnx-platform-api/tests/mock_platform.py b/platform/mellanox/mlnx-platform-api/tests/mock_platform.py index 8edb9d4fb163..1cd8f89d4805 100644 --- a/platform/mellanox/mlnx-platform-api/tests/mock_platform.py +++ b/platform/mellanox/mlnx-platform-api/tests/mock_platform.py @@ -36,10 +36,19 @@ def get_all_fans(self): return [] +class MockFanDrawer: + def __init__(self): + self.fan_list = [] + + def get_all_fans(self): + return self.fan_list + + class MockChassis: def __init__(self): self.fan_list = [] self.psu_list = [] + self.fan_drawer_list = [] def get_all_psus(self): return self.psu_list @@ -47,6 +56,9 @@ def get_all_psus(self): def get_all_fans(self): return self.fan_list + def get_all_fan_drawers(self): + return self.fan_drawer_list + def get_thermal_manager(self): from sonic_platform.thermal_manager import ThermalManager return ThermalManager @@ -54,7 +66,9 @@ def get_thermal_manager(self): def make_fan_absence(self): fan = MockFan() fan.presence = False - self.fan_list.append(fan) + fan_drawer = MockFanDrawer() + self.fan_drawer_list.append(fan_drawer) + fan_drawer.fan_list.append(fan) def make_psu_absence(self): psu = MockPsu() diff --git a/platform/mellanox/mlnx-platform-api/tests/policy_with_same_conditions.json b/platform/mellanox/mlnx-platform-api/tests/policy_with_same_conditions.json index ace291be1c55..9efe773a9b07 100644 --- a/platform/mellanox/mlnx-platform-api/tests/policy_with_same_conditions.json +++ b/platform/mellanox/mlnx-platform-api/tests/policy_with_same_conditions.json @@ -27,8 +27,7 @@ ], "actions": [ { - "type": "thermal_control.control", - "status": "false" + "type": "thermal.recover" }, { "type": "fan.all.set_speed", @@ -45,8 +44,7 @@ ], "actions": [ { - "type": "thermal_control.control", - "status": "false" + "type": "thermal.recover" }, { "type": "fan.all.set_speed", @@ -66,8 +64,7 @@ ], "actions": [ { - "type": "thermal_control.control", - "status": "true" + "type": "thermal.recover" } ] } diff --git a/platform/mellanox/mlnx-platform-api/tests/test_thermal_policy.py b/platform/mellanox/mlnx-platform-api/tests/test_thermal_policy.py index 87fac359b2fd..1f7972497477 100644 --- a/platform/mellanox/mlnx-platform-api/tests/test_thermal_policy.py +++ b/platform/mellanox/mlnx-platform-api/tests/test_thermal_policy.py @@ -2,8 +2,8 @@ import sys import pytest import json -from mock import MagicMock -from .mock_platform import MockChassis, MockFan, MockPsu +from mock import MagicMock, patch +from .mock_platform import MockChassis, MockFan, MockFanDrawer, MockPsu test_path = os.path.dirname(os.path.abspath(__file__)) modules_path = os.path.dirname(test_path) @@ -11,11 +11,7 @@ from sonic_platform.thermal_manager import ThermalManager from sonic_platform.thermal_infos import FanInfo, PsuInfo -from sonic_platform.fan import Fan -from sonic_platform.thermal import Thermal - -Thermal.check_thermal_zone_temperature = MagicMock() -Thermal.set_thermal_algorithm_status = MagicMock() +from sonic_platform.thermal import Thermal, MAX_COOLING_LEVEL @pytest.fixture(scope='session', autouse=True) @@ -49,15 +45,14 @@ def test_fan_info(): assert len(fan_info.get_fault_fans()) == 0 assert fan_info.is_status_changed() - fan_list = chassis.get_all_fans() - fan_list[0].presence = True + chassis.get_all_fan_drawers()[0].get_all_fans()[0].presence = True fan_info.collect(chassis) assert len(fan_info.get_absence_fans()) == 0 assert len(fan_info.get_presence_fans()) == 1 assert len(fan_info.get_fault_fans()) == 0 assert fan_info.is_status_changed() - fan_list[0].status = False + chassis.get_all_fan_drawers()[0].get_all_fans()[0].status = False fan_info.collect(chassis) assert len(fan_info.get_absence_fans()) == 0 assert len(fan_info.get_presence_fans()) == 1 @@ -82,56 +77,63 @@ def test_psu_info(): psu_list[0].powergood = False psu_info.collect(chassis) - assert len(psu_info.get_absence_psus()) == 1 - assert len(psu_info.get_presence_psus()) == 0 - assert psu_info.is_status_changed() + assert len(psu_info.get_absence_psus()) == 0 + assert len(psu_info.get_presence_psus()) == 1 + assert not psu_info.is_status_changed() -def test_fan_policy(thermal_manager): +@patch('sonic_platform.thermal.Thermal.monitor_asic_themal_zone', MagicMock()) +@patch('sonic_platform.thermal.Thermal.get_min_allowed_cooling_level_by_thermal_zone', MagicMock(return_value=2)) +@patch('sonic_platform.thermal.Thermal.get_cooling_level', MagicMock(return_value=6)) +@patch('sonic_platform.thermal.Thermal.set_cooling_state') +@patch('sonic_platform.thermal.Thermal.set_cooling_level') +def test_fan_policy(mock_set_cooling_level, mock_set_cooling_state, thermal_manager): chassis = MockChassis() chassis.make_fan_absence() - chassis.fan_list.append(MockFan()) - thermal_manager.run_policy(chassis) + chassis.get_all_fan_drawers()[0].get_all_fans().append(MockFan()) + chassis.platform_name = 'some_platform' - fan_list = chassis.get_all_fans() - assert fan_list[1].speed == 100 - Thermal.set_thermal_algorithm_status.assert_called_with(False, False) + thermal_manager.run_policy(chassis) + mock_set_cooling_level.assert_called_with(MAX_COOLING_LEVEL) + mock_set_cooling_state.assert_called_with(MAX_COOLING_LEVEL) + Thermal.expect_cooling_level = None + fan_list = chassis.get_all_fan_drawers()[0].get_all_fans() fan_list[0].presence = True - Thermal.check_thermal_zone_temperature = MagicMock(return_value=True) thermal_manager.run_policy(chassis) - Thermal.set_thermal_algorithm_status.assert_called_with(True, False) - assert Thermal.check_thermal_zone_temperature.call_count == 2 - assert fan_list[0].speed == 60 - assert fan_list[1].speed == 60 + mock_set_cooling_level.assert_called_with(6) + mock_set_cooling_state.assert_called_with(6) + Thermal.expect_cooling_level = None fan_list[0].status = False thermal_manager.run_policy(chassis) - Thermal.set_thermal_algorithm_status.assert_called_with(False, False) + mock_set_cooling_level.assert_called_with(MAX_COOLING_LEVEL) + Thermal.expect_cooling_level = None fan_list[0].status = True - Thermal.check_thermal_zone_temperature = MagicMock(return_value=False) thermal_manager.run_policy(chassis) - Thermal.set_thermal_algorithm_status.assert_called_with(True, False) - assert Thermal.check_thermal_zone_temperature.call_count == 2 - assert fan_list[0].speed == 100 - assert fan_list[1].speed == 100 + mock_set_cooling_level.assert_called_with(6) + mock_set_cooling_state.assert_called_with(6) -def test_psu_policy(thermal_manager): +@patch('sonic_platform.thermal.Thermal.monitor_asic_themal_zone', MagicMock()) +@patch('sonic_platform.thermal.Thermal.get_min_allowed_cooling_level_by_thermal_zone', MagicMock(return_value=2)) +@patch('sonic_platform.thermal.Thermal.get_cooling_level', MagicMock(return_value=6)) +@patch('sonic_platform.thermal.Thermal.set_cooling_state') +@patch('sonic_platform.thermal.Thermal.set_cooling_level') +def test_psu_policy(mock_set_cooling_level, mock_set_cooling_state, thermal_manager): chassis = MockChassis() chassis.make_psu_absence() - chassis.fan_list.append(MockFan()) + chassis.platform_name = 'some_platform' thermal_manager.run_policy(chassis) - - fan_list = chassis.get_all_fans() - assert fan_list[0].speed == 100 - Thermal.set_thermal_algorithm_status.assert_called_with(False, False) + mock_set_cooling_level.assert_called_with(MAX_COOLING_LEVEL) + mock_set_cooling_state.assert_called_with(MAX_COOLING_LEVEL) psu_list = chassis.get_all_psus() psu_list[0].presence = True thermal_manager.run_policy(chassis) - Thermal.set_thermal_algorithm_status.assert_called_with(True, False) + mock_set_cooling_level.assert_called_with(6) + mock_set_cooling_state.assert_called_with(6) def test_any_fan_absence_condition(): @@ -144,7 +146,7 @@ def test_any_fan_absence_condition(): condition = AnyFanAbsenceCondition() assert condition.is_match({'fan_info': fan_info}) - fan = chassis.get_all_fans()[0] + fan = chassis.get_all_fan_drawers()[0].get_all_fans()[0] fan.presence = True fan_info.collect(chassis) assert not condition.is_match({'fan_info': fan_info}) @@ -154,7 +156,7 @@ def test_all_fan_absence_condition(): chassis = MockChassis() chassis.make_fan_absence() fan = MockFan() - fan_list = chassis.get_all_fans() + fan_list = chassis.get_all_fan_drawers()[0].get_all_fans() fan_list.append(fan) fan_info = FanInfo() fan_info.collect(chassis) @@ -172,7 +174,7 @@ def test_all_fan_presence_condition(): chassis = MockChassis() chassis.make_fan_absence() fan = MockFan() - fan_list = chassis.get_all_fans() + fan_list = chassis.get_all_fan_drawers()[0].get_all_fans() fan_list.append(fan) fan_info = FanInfo() fan_info.collect(chassis) @@ -187,8 +189,9 @@ def test_all_fan_presence_condition(): def test_any_fan_fault_condition(): chassis = MockChassis() + chassis.get_all_fan_drawers().append(MockFanDrawer()) fan = MockFan() - fan_list = chassis.get_all_fans() + fan_list = chassis.get_all_fan_drawers()[0].get_all_fans() fan_list.append(fan) fault_fan = MockFan() fault_fan.status = False @@ -206,8 +209,9 @@ def test_any_fan_fault_condition(): def test_all_fan_good_condition(): chassis = MockChassis() + chassis.get_all_fan_drawers().append(MockFanDrawer()) fan = MockFan() - fan_list = chassis.get_all_fans() + fan_list = chassis.get_all_fan_drawers()[0].get_all_fans() fan_list.append(fan) fault_fan = MockFan() fault_fan.status = False @@ -300,91 +304,23 @@ def test_load_set_fan_speed_action(): action.load_from_json(json_obj) +@patch('sonic_platform.thermal.Thermal.set_cooling_level', MagicMock()) def test_execute_set_fan_speed_action(): chassis = MockChassis() - fan_list = chassis.get_all_fans() + chassis.get_all_fan_drawers().append(MockFanDrawer()) + fan_list = chassis.get_all_fan_drawers()[0].get_all_fans() fan_list.append(MockFan()) fan_list.append(MockFan()) fan_info = FanInfo() fan_info.collect(chassis) + Thermal.expect_cooling_level = None from sonic_platform.thermal_actions import SetAllFanSpeedAction action = SetAllFanSpeedAction() - action.speed = 99 + action.speed = 20 action.execute({'fan_info': fan_info}) - assert fan_list[0].speed == 99 - assert fan_list[1].speed == 99 - - -def test_load_control_thermal_algo_action(): - from sonic_platform.thermal_actions import ControlThermalAlgoAction - action = ControlThermalAlgoAction() - json_str = '{\"status\": \"false\"}' - json_obj = json.loads(json_str) - action.load_from_json(json_obj) - assert not action.status - - json_str = '{\"status\": \"true\"}' - json_obj = json.loads(json_str) - action.load_from_json(json_obj) - assert action.status + assert Thermal.expect_cooling_level == 2 - json_str = '{\"status\": \"invalid\"}' - json_obj = json.loads(json_str) - with pytest.raises(ValueError): - action.load_from_json(json_obj) - - json_str = '{\"invalid\": \"true\"}' - json_obj = json.loads(json_str) - with pytest.raises(ValueError): - action.load_from_json(json_obj) - -def test_load_check_and_set_speed_action(): - from sonic_platform.thermal_actions import CheckAndSetAllFanSpeedAction - action = CheckAndSetAllFanSpeedAction() - json_str = '{\"speed\": \"40\"}' - json_obj = json.loads(json_str) - action.load_from_json(json_obj) - assert action.speed == 40 - - json_str = '{\"speed\": \"-1\"}' - json_obj = json.loads(json_str) - with pytest.raises(ValueError): - action.load_from_json(json_obj) - - json_str = '{\"speed\": \"101\"}' - json_obj = json.loads(json_str) - with pytest.raises(ValueError): - action.load_from_json(json_obj) - - json_str = '{\"invalid\": \"60\"}' - json_obj = json.loads(json_str) - with pytest.raises(ValueError): - action.load_from_json(json_obj) - -def test_execute_check_and_set_fan_speed_action(): - chassis = MockChassis() - fan_list = chassis.get_all_fans() - fan_list.append(MockFan()) - fan_list.append(MockFan()) - fan_info = FanInfo() - fan_info.collect(chassis) - Thermal.check_thermal_zone_temperature = MagicMock(return_value=True) - - from sonic_platform.thermal_actions import CheckAndSetAllFanSpeedAction - action = CheckAndSetAllFanSpeedAction() - action.speed = 99 - action.execute({'fan_info': fan_info}) - assert fan_list[0].speed == 99 - assert fan_list[1].speed == 99 - - Thermal.check_thermal_zone_temperature = MagicMock(return_value=False) - fan_list[0].speed = 100 - fan_list[1].speed = 100 - action.speed = 60 - action.execute({'fan_info': fan_info}) - assert fan_list[0].speed == 100 - assert fan_list[1].speed == 100 def test_load_duplicate_condition(): from sonic_platform_base.sonic_thermal_control.thermal_policy import ThermalPolicy @@ -425,7 +361,7 @@ class MockThermalManager(ThermalManagerBase): with pytest.raises(Exception): MockThermalManager.load(os.path.join(test_path, 'policy_with_same_conditions.json')) - + def test_dynamic_minimum_table_data(): from sonic_platform.device_data import DEVICE_DATA for platform, platform_data in DEVICE_DATA.items(): @@ -450,7 +386,7 @@ def check_minimum_table_data(platform, minimum_table): for item in data_list: cooling_level = item[0] range_str = item[1] - + ranges = range_str.split(':') low = int(ranges[0]) high = int(ranges[1]) @@ -467,48 +403,63 @@ def check_minimum_table_data(platform, minimum_table): assert cooling_level > previous_cooling_level previous_cooling_level = cooling_level -def test_dynamic_minimum_policy(thermal_manager): - from sonic_platform.thermal_conditions import MinCoolingLevelChangeCondition - from sonic_platform.thermal_actions import ChangeMinCoolingLevelAction - from sonic_platform.thermal_infos import ChassisInfo - from sonic_platform.thermal import Thermal - from sonic_platform.fan import Fan - ThermalManager.initialize() - assert 'DynamicMinCoolingLevelPolicy' in thermal_manager._policy_dict - policy = thermal_manager._policy_dict['DynamicMinCoolingLevelPolicy'] - assert MinCoolingLevelChangeCondition in policy.conditions - assert ChangeMinCoolingLevelAction in policy.actions - - condition = policy.conditions[MinCoolingLevelChangeCondition] - action = policy.actions[ChangeMinCoolingLevelAction] - Thermal.check_module_temperature_trustable = MagicMock(return_value='trust') - Thermal.get_min_amb_temperature = MagicMock(return_value=35000) - assert condition.is_match(None) - assert MinCoolingLevelChangeCondition.trust_state == 'trust' - assert MinCoolingLevelChangeCondition.temperature == 35 - assert not condition.is_match(None) - - Thermal.check_module_temperature_trustable = MagicMock(return_value='untrust') - assert condition.is_match(None) - assert MinCoolingLevelChangeCondition.trust_state == 'untrust' - - Thermal.get_min_amb_temperature = MagicMock(return_value=25000) - assert condition.is_match(None) - assert MinCoolingLevelChangeCondition.temperature == 25 +@patch('sonic_platform.thermal.Thermal.monitor_asic_themal_zone', MagicMock()) +@patch('sonic_platform.thermal.Thermal.get_min_allowed_cooling_level_by_thermal_zone') +@patch('sonic_platform.thermal.Thermal.get_min_amb_temperature') +@patch('sonic_platform.thermal.Thermal.check_module_temperature_trustable') +def test_thermal_recover_policy(mock_check_trustable, mock_get_min_amb, moc_get_min_allowed): + from sonic_platform.thermal_infos import ChassisInfo + from sonic_platform.thermal_actions import ThermalRecoverAction chassis = MockChassis() chassis.platform_name = 'invalid' info = ChassisInfo() info._chassis = chassis thermal_info_dict = {ChassisInfo.INFO_NAME: info} - Fan.get_cooling_level = MagicMock(return_value=5) - Fan.set_cooling_level = MagicMock() + + Thermal.expect_cooling_level = None + action = ThermalRecoverAction() + moc_get_min_allowed.return_value = 2 action.execute(thermal_info_dict) - assert Fan.min_cooling_level == 6 - Fan.set_cooling_level.assert_called_with(6, 6) - Fan.set_cooling_level.call_count = 0 + assert Thermal.expect_cooling_level == 6 + Thermal.last_set_cooling_level = Thermal.expect_cooling_level + Thermal.expect_cooling_level = None chassis.platform_name = 'x86_64-mlnx_msn2700-r0' + mock_check_trustable.return_value = 'trust' + mock_get_min_amb.return_value = 29999 + moc_get_min_allowed.return_value = None + action.execute(thermal_info_dict) + assert Thermal.expect_cooling_level is None + + moc_get_min_allowed.return_value = 4 action.execute(thermal_info_dict) - assert Fan.min_cooling_level == 3 - Fan.set_cooling_level.assert_called_with(3, 5) + assert Thermal.expect_cooling_level == 4 + Thermal.last_set_cooling_level = Thermal.expect_cooling_level + + mock_check_trustable.return_value = 'untrust' + mock_get_min_amb.return_value = 31001 + action.execute(thermal_info_dict) + assert Thermal.expect_cooling_level == 5 + + +@patch('sonic_platform.utils.read_int_from_file') +def test_monitor_asic_themal_zone(mock_read_int): + mock_read_int.side_effect = [111000, 105000] + Thermal.monitor_asic_themal_zone() + assert Thermal.expect_cooling_state == MAX_COOLING_LEVEL + mock_read_int.reset() + mock_read_int.side_effect = [104000, 105000] + Thermal.monitor_asic_themal_zone() + assert Thermal.expect_cooling_state is None + + +def test_set_expect_cooling_level(): + Thermal.set_expect_cooling_level(5) + assert Thermal.expect_cooling_level == 5 + + Thermal.set_expect_cooling_level(3) + assert Thermal.expect_cooling_level == 5 + + Thermal.set_expect_cooling_level(10) + assert Thermal.expect_cooling_level == 10 diff --git a/platform/mellanox/mlnx-platform-api/tests/thermal_policy.json b/platform/mellanox/mlnx-platform-api/tests/thermal_policy.json index 413211b21220..4a0dd28a2d15 100644 --- a/platform/mellanox/mlnx-platform-api/tests/thermal_policy.json +++ b/platform/mellanox/mlnx-platform-api/tests/thermal_policy.json @@ -23,10 +23,6 @@ } ], "actions": [ - { - "type": "thermal_control.control", - "status": "false" - }, { "type": "fan.all.set_speed", "speed": "100" @@ -41,10 +37,6 @@ } ], "actions": [ - { - "type": "thermal_control.control", - "status": "false" - }, { "type": "fan.all.set_speed", "speed": "100" @@ -59,10 +51,6 @@ } ], "actions": [ - { - "type": "thermal_control.control", - "status": "false" - }, { "type": "fan.all.set_speed", "speed": "100" @@ -84,12 +72,7 @@ ], "actions": [ { - "type": "thermal_control.control", - "status": "true" - }, - { - "type": "fan.all.check_and_set_speed", - "speed": "60" + "type": "thermal.recover" } ] } diff --git a/platform/mellanox/mlnx-sai.mk b/platform/mellanox/mlnx-sai.mk index 0c1795cf41a3..c8c87a61a723 100644 --- a/platform/mellanox/mlnx-sai.mk +++ b/platform/mellanox/mlnx-sai.mk @@ -1,6 +1,6 @@ # Mellanox SAI -MLNX_SAI_VERSION = SAIRel1.18.0.2-master +MLNX_SAI_VERSION = SAIRel1.22.0.0 export MLNX_SAI_VERSION diff --git a/platform/mellanox/mlnx-sai/SAI-Implementation b/platform/mellanox/mlnx-sai/SAI-Implementation index ad1e9c7279e5..9c4d6af340fc 160000 --- a/platform/mellanox/mlnx-sai/SAI-Implementation +++ b/platform/mellanox/mlnx-sai/SAI-Implementation @@ -1 +1 @@ -Subproject commit ad1e9c7279e544b93fef9a40fb41df375338b55e +Subproject commit 9c4d6af340fcacfc01f308b261484314cdfce6af diff --git a/platform/mellanox/rules.dep b/platform/mellanox/rules.dep index 8986eb2e0808..409857592159 100644 --- a/platform/mellanox/rules.dep +++ b/platform/mellanox/rules.dep @@ -11,7 +11,6 @@ include $(PLATFORM_PATH)/docker-syncd-mlnx-rpc.dep include $(PLATFORM_PATH)/docker-saiserver-mlnx.dep include $(PLATFORM_PATH)/one-image.dep include $(PLATFORM_PATH)/libsaithrift-dev.dep -include $(PLATFORM_PATH)/docker-ptf-mlnx.dep include $(PLATFORM_PATH)/mlnx-ffb.dep include $(PLATFORM_PATH)/issu-version.dep include $(PLATFORM_PATH)/mlnx-onie-fw-update.dep diff --git a/platform/mellanox/rules.mk b/platform/mellanox/rules.mk index 1e2ca78a195b..4414a0183bba 100644 --- a/platform/mellanox/rules.mk +++ b/platform/mellanox/rules.mk @@ -9,11 +9,11 @@ include $(PLATFORM_PATH)/docker-syncd-mlnx-rpc.mk include $(PLATFORM_PATH)/docker-saiserver-mlnx.mk include $(PLATFORM_PATH)/one-image.mk include $(PLATFORM_PATH)/libsaithrift-dev.mk -include $(PLATFORM_PATH)/docker-ptf-mlnx.mk include $(PLATFORM_PATH)/mlnx-ffb.mk include $(PLATFORM_PATH)/issu-version.mk include $(PLATFORM_PATH)/mlnx-onie-fw-update.mk include $(PLATFORM_PATH)/mlnx-ssd-fw-update.mk +include $(PLATFORM_PATH)/bios.mk SONIC_ALL += $(SONIC_ONE_IMAGE) \ $(DOCKER_FPM) diff --git a/platform/mellanox/sdk-src/python-sdk-api/Makefile b/platform/mellanox/sdk-src/python-sdk-api/Makefile index 9c41be75725b..47f0ad5a01ff 100644 --- a/platform/mellanox/sdk-src/python-sdk-api/Makefile +++ b/platform/mellanox/sdk-src/python-sdk-api/Makefile @@ -18,7 +18,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : ./autogen.sh fi - debuild -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) + debuild -e PYTHON_INTERPRETERS="\"python2 python3\"" -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) popd diff --git a/platform/mellanox/sdk-src/sx-kernel/Makefile b/platform/mellanox/sdk-src/sx-kernel/Makefile index 422f2ae95aae..179594798129 100644 --- a/platform/mellanox/sdk-src/sx-kernel/Makefile +++ b/platform/mellanox/sdk-src/sx-kernel/Makefile @@ -5,6 +5,8 @@ MAIN_TARGET = sx-kernel_1.mlnx.$(MLNX_SDK_DEB_VERSION)_amd64.deb DERIVED_TARGETS = sx-kernel-dev_1.mlnx.$(MLNX_SDK_DEB_VERSION)_amd64.deb PACKAGE_NAME = sx_kernel +MLNX_SX_KERNEL_GITHUB_URL_BASE = https://github.com/Mellanox/Spectrum-SDK-Drivers/archive/refs/heads + $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : # get sources @@ -13,9 +15,15 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : wget -c $(MLNX_SDK_SOURCE_BASE_URL)/$(PACKAGE_NAME)-$(MLNX_SDK_VERSION)-$(MLNX_SDK_ISSU_VERSION).tar.gz -O - | tar -xz pushd sx_kernel-$(MLNX_SDK_VERSION)-$(MLNX_SDK_ISSU_VERSION) else - pushd Switch-SDK-drivers - git reset --hard - git clean -xfd + rm -rf Spectrum-SDK-Drivers-$(MLNX_SDK_VERSION) + wget -c $(MLNX_SX_KERNEL_GITHUB_URL_BASE)/$(MLNX_SDK_VERSION).zip + unzip $(MLNX_SDK_VERSION).zip + rm -rf $(MLNX_SDK_VERSION).zip + + pushd Spectrum-SDK-Drivers-$(MLNX_SDK_VERSION) + ln -s ./sx_scripts/Makefile ./Makefile + ln -s ./sx_scripts/makefile ./makefile + ln -s ./sx_scripts/configure ./configure fi # build diff --git a/platform/mellanox/sdk-src/sx-kernel/Switch-SDK-drivers b/platform/mellanox/sdk-src/sx-kernel/Switch-SDK-drivers deleted file mode 160000 index f2d3ccc99c03..000000000000 --- a/platform/mellanox/sdk-src/sx-kernel/Switch-SDK-drivers +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f2d3ccc99c03a54a874278d33ae77c38586eb70b diff --git a/platform/mellanox/sdk-src/sxd-libs/Makefile b/platform/mellanox/sdk-src/sxd-libs/Makefile index 0b142c920828..892974e75e5f 100644 --- a/platform/mellanox/sdk-src/sxd-libs/Makefile +++ b/platform/mellanox/sdk-src/sxd-libs/Makefile @@ -20,7 +20,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : ./autogen.sh fi - debuild -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) + debuild -e 'configure_options=--enable-sniffer=yes' -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) popd diff --git a/platform/mellanox/sdk.dep b/platform/mellanox/sdk.dep index bf3ecb95d8ae..08c9f2e7c980 100644 --- a/platform/mellanox/sdk.dep +++ b/platform/mellanox/sdk.dep @@ -1,5 +1,15 @@ # DPKG FRK +# Append MLNX_SDK_DEB_VERSION to flags list. +# We use SONIC_OVERRIDE_BUILD_VARS in order to build SONiC with any SDK we want +# by passing it in environment variable. This approach does not work well with +# caching framework which assumes that if the corresponding makefile didn't change +# the version didn't change neither. There is no ultimate solution to support +# caching and anything user can pass in SONIC_OVERRIDE_BUILD_VARS, so as a W/A +# we append MLNX_SDK_DEB_VERSION to flags to invalidate cache in case we use +# SONIC_OVERRIDE_BUILD_VARS. +MLNX_SDK_COMMON_FLAGS_LIST = $(SONIC_COMMON_FLAGS_LIST) $(MLNX_SDK_DEB_VERSION) + # APPLIBS SPATH := $($(APPLIBS)_SRC_PATH) @@ -8,16 +18,16 @@ DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) DEP_FILES += $(shell git ls-files -- $(SPATH)) $(APPLIBS)_CACHE_MODE := GIT_CONTENT_SHA -$(APPLIBS)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(APPLIBS)_DEP_FLAGS := $(MLNX_SDK_COMMON_FLAGS_LIST) $(APPLIBS)_DEP_FILES := $(DEP_FILES) $(APPLIBS_DEV)_CACHE_MODE := GIT_CONTENT_SHA -$(APPLIBS_DEV)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(APPLIBS_DEV)_DEP_FLAGS := $(MLNX_SDK_COMMON_FLAGS_LIST) $(APPLIBS_DEV)_DEP_FILES := $(DEP_FILES) ifeq ($(SDK_FROM_SRC),y) $(APPLIBS_DBGSYM)_CACHE_MODE := GIT_CONTENT_SHA -$(APPLIBS_DBGSYM)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(APPLIBS_DBGSYM)_DEP_FLAGS := $(MLNX_SDK_COMMON_FLAGS_LIST) $(APPLIBS_DBGSYM)_DEP_FILES := $(DEP_FILES) endif @@ -29,16 +39,16 @@ DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) DEP_FILES += $(shell git ls-files -- $(SPATH)) $(IPROUTE2_MLNX)_CACHE_MODE := GIT_CONTENT_SHA -$(IPROUTE2_MLNX)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(IPROUTE2_MLNX)_DEP_FLAGS := $(MLNX_SDK_COMMON_FLAGS_LIST) $(IPROUTE2_MLNX)_DEP_FILES := $(DEP_FILES) $(IPROUTE2_MLNX_DEV)_CACHE_MODE := GIT_CONTENT_SHA -$(IPROUTE2_MLNX_DEV)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(IPROUTE2_MLNX_DEV)_DEP_FLAGS := $(MLNX_SDK_COMMON_FLAGS_LIST) $(IPROUTE2_MLNX_DEV)_DEP_FILES := $(DEP_FILES) ifeq ($(SDK_FROM_SRC),y) $(IPROUTE2_MLNX_DBGSYM)_CACHE_MODE := GIT_CONTENT_SHA -$(IPROUTE2_MLNX_DBGSYM)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(IPROUTE2_MLNX_DBGSYM)_DEP_FLAGS := $(MLNX_SDK_COMMON_FLAGS_LIST) $(IPROUTE2_MLNX_DBGSYM)_DEP_FILES := $(DEP_FILES) endif @@ -50,16 +60,16 @@ DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) DEP_FILES += $(shell git ls-files -- $(SPATH)) $(SX_COMPLIB)_CACHE_MODE := GIT_CONTENT_SHA -$(SX_COMPLIB)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(SX_COMPLIB)_DEP_FLAGS := $(MLNX_SDK_COMMON_FLAGS_LIST) $(SX_COMPLIB)_DEP_FILES := $(DEP_FILES) $(SX_COMPLIB_DEV)_CACHE_MODE := GIT_CONTENT_SHA -$(SX_COMPLIB_DEV)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(SX_COMPLIB_DEV)_DEP_FLAGS := $(MLNX_SDK_COMMON_FLAGS_LIST) $(SX_COMPLIB_DEV)_DEP_FILES := $(DEP_FILES) ifeq ($(SDK_FROM_SRC),y) $(SX_COMPLIB_DBGSYM)_CACHE_MODE := GIT_CONTENT_SHA -$(SX_COMPLIB_DBGSYM)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(SX_COMPLIB_DBGSYM)_DEP_FLAGS := $(MLNX_SDK_COMMON_FLAGS_LIST) $(SX_COMPLIB_DBGSYM)_DEP_FILES := $(DEP_FILES) endif @@ -71,16 +81,16 @@ DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) DEP_FILES += $(shell git ls-files -- $(SPATH)) $(SX_EXAMPLES)_CACHE_MODE := GIT_CONTENT_SHA -$(SX_EXAMPLES)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(SX_EXAMPLES)_DEP_FLAGS := $(MLNX_SDK_COMMON_FLAGS_LIST) $(SX_EXAMPLES)_DEP_FILES := $(DEP_FILES) $(SX_EXAMPLES_DEV)_CACHE_MODE := GIT_CONTENT_SHA -$(SX_EXAMPLES_DEV)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(SX_EXAMPLES_DEV)_DEP_FLAGS := $(MLNX_SDK_COMMON_FLAGS_LIST) $(SX_EXAMPLES_DEV)_DEP_FILES := $(DEP_FILES) ifeq ($(SDK_FROM_SRC),y) $(SX_EXAMPLES_DBGSYM)_CACHE_MODE := GIT_CONTENT_SHA -$(SX_EXAMPLES_DBGSYM)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(SX_EXAMPLES_DBGSYM)_DEP_FLAGS := $(MLNX_SDK_COMMON_FLAGS_LIST) $(SX_EXAMPLES_DBGSYM)_DEP_FILES := $(DEP_FILES) endif @@ -92,16 +102,16 @@ DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) DEP_FILES += $(shell git ls-files -- $(SPATH)) $(SX_GEN_UTILS)_CACHE_MODE := GIT_CONTENT_SHA -$(SX_GEN_UTILS)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(SX_GEN_UTILS)_DEP_FLAGS := $(MLNX_SDK_COMMON_FLAGS_LIST) $(SX_GEN_UTILS)_DEP_FILES := $(DEP_FILES) $(SX_GEN_UTILS_DEV)_CACHE_MODE := GIT_CONTENT_SHA -$(SX_GEN_UTILS_DEV)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(SX_GEN_UTILS_DEV)_DEP_FLAGS := $(MLNX_SDK_COMMON_FLAGS_LIST) $(SX_GEN_UTILS_DEV)_DEP_FILES := $(DEP_FILES) ifeq ($(SDK_FROM_SRC),y) $(SX_GEN_UTILS_DBGSYM)_CACHE_MODE := GIT_CONTENT_SHA -$(SX_GEN_UTILS_DBGSYM)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(SX_GEN_UTILS_DBGSYM)_DEP_FLAGS := $(MLNX_SDK_COMMON_FLAGS_LIST) $(SX_GEN_UTILS_DBGSYM)_DEP_FILES := $(DEP_FILES) endif @@ -113,16 +123,16 @@ DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) DEP_FILES += $(shell git ls-files -- $(SPATH)) $(SX_SCEW)_CACHE_MODE := GIT_CONTENT_SHA -$(SX_SCEW)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(SX_SCEW)_DEP_FLAGS := $(MLNX_SDK_COMMON_FLAGS_LIST) $(SX_SCEW)_DEP_FILES := $(DEP_FILES) $(SX_SCEW_DEV)_CACHE_MODE := GIT_CONTENT_SHA -$(SX_SCEW_DEV)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(SX_SCEW_DEV)_DEP_FLAGS := $(MLNX_SDK_COMMON_FLAGS_LIST) $(SX_SCEW_DEV)_DEP_FILES := $(DEP_FILES) ifeq ($(SDK_FROM_SRC),y) $(SX_SCEW_DBGSYM)_CACHE_MODE := GIT_CONTENT_SHA -$(SX_SCEW_DBGSYM)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(SX_SCEW_DBGSYM)_DEP_FLAGS := $(MLNX_SDK_COMMON_FLAGS_LIST) $(SX_SCEW_DBGSYM)_DEP_FILES := $(DEP_FILES) endif @@ -134,16 +144,16 @@ DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) DEP_FILES += $(shell git ls-files -- $(SPATH)) $(SXD_LIBS)_CACHE_MODE := GIT_CONTENT_SHA -$(SXD_LIBS)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(SXD_LIBS)_DEP_FLAGS := $(MLNX_SDK_COMMON_FLAGS_LIST) $(SXD_LIBS)_DEP_FILES := $(DEP_FILES) $(SXD_LIBS_DEV)_CACHE_MODE := GIT_CONTENT_SHA -$(SXD_LIBS_DEV)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(SXD_LIBS_DEV)_DEP_FLAGS := $(MLNX_SDK_COMMON_FLAGS_LIST) $(SXD_LIBS_DEV)_DEP_FILES := $(DEP_FILES) ifeq ($(SDK_FROM_SRC),y) $(SXD_LIBS_DBGSYM)_CACHE_MODE := GIT_CONTENT_SHA -$(SXD_LIBS_DBGSYM)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(SXD_LIBS_DBGSYM)_DEP_FLAGS := $(MLNX_SDK_COMMON_FLAGS_LIST) $(SXD_LIBS_DBGSYM)_DEP_FILES := $(DEP_FILES) endif @@ -155,12 +165,12 @@ DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) DEP_FILES += $(shell git ls-files -- $(SPATH)) $(PYTHON_SDK_API)_CACHE_MODE := GIT_CONTENT_SHA -$(PYTHON_SDK_API)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(PYTHON_SDK_API)_DEP_FLAGS := $(MLNX_SDK_COMMON_FLAGS_LIST) $(PYTHON_SDK_API)_DEP_FILES := $(DEP_FILES) ifeq ($(SDK_FROM_SRC),y) $(PYTHON_SDK_API_DBGSYM)_CACHE_MODE := GIT_CONTENT_SHA -$(PYTHON_SDK_API_DBGSYM)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(PYTHON_SDK_API_DBGSYM)_DEP_FLAGS := $(MLNX_SDK_COMMON_FLAGS_LIST) $(PYTHON_SDK_API_DBGSYM)_DEP_FILES := $(DEP_FILES) endif @@ -172,16 +182,16 @@ DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) DEP_FILES += $(shell git ls-files -- $(SPATH)) $(SX_ACL_HELPER)_CACHE_MODE := GIT_CONTENT_SHA -$(SX_ACL_HELPER)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(SX_ACL_HELPER)_DEP_FLAGS := $(MLNX_SDK_COMMON_FLAGS_LIST) $(SX_ACL_HELPER)_DEP_FILES := $(DEP_FILES) $(SX_ACL_HELPER_DEV)_CACHE_MODE := GIT_CONTENT_SHA -$(SX_ACL_HELPER_DEV)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(SX_ACL_HELPER_DEV)_DEP_FLAGS := $(MLNX_SDK_COMMON_FLAGS_LIST) $(SX_ACL_HELPER_DEV)_DEP_FILES := $(DEP_FILES) ifeq ($(SDK_FROM_SRC),y) $(SX_ACL_HELPER_DBGSYM)_CACHE_MODE := GIT_CONTENT_SHA -$(SX_ACL_HELPER_DBGSYM)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(SX_ACL_HELPER_DBGSYM)_DEP_FLAGS := $(MLNX_SDK_COMMON_FLAGS_LIST) $(SX_ACL_HELPER_DBGSYM)_DEP_FILES := $(DEP_FILES) endif @@ -193,16 +203,16 @@ DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) DEP_FILES += $(shell git ls-files -- $(SPATH)) $(WJH_LIBS)_CACHE_MODE := GIT_CONTENT_SHA -$(WJH_LIBS)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(WJH_LIBS)_DEP_FLAGS := $(MLNX_SDK_COMMON_FLAGS_LIST) $(WJH_LIBS)_DEP_FILES := $(DEP_FILES) $(WJH_LIBS_DEV)_CACHE_MODE := GIT_CONTENT_SHA -$(WJH_LIBS_DEV)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(WJH_LIBS_DEV)_DEP_FLAGS := $(MLNX_SDK_COMMON_FLAGS_LIST) $(WJH_LIBS_DEV)_DEP_FILES := $(DEP_FILES) ifeq ($(SDK_FROM_SRC),y) $(WJH_LIBS_DBGSYM)_CACHE_MODE := GIT_CONTENT_SHA -$(WJH_LIBS_DBGSYM)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(WJH_LIBS_DBGSYM)_DEP_FLAGS := $(MLNX_SDK_COMMON_FLAGS_LIST) $(WJH_LIBS_DBGSYM)_DEP_FILES := $(DEP_FILES) endif @@ -217,13 +227,13 @@ DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) DEP_FILES += $(filter-out $(SMDEP_PATHS),$(shell git ls-files -- $(SPATH) | grep -Ev ' ')) $(SX_KERNEL)_CACHE_MODE := GIT_CONTENT_SHA -$(SX_KERNEL)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(SX_KERNEL)_DEP_FLAGS := $(MLNX_SDK_COMMON_FLAGS_LIST) $(SX_KERNEL)_DEP_FILES := $(filter-out $(SLINKS),$(DEP_FILES)) $(SX_KERNEL)_SMDEP_FILES := $(filter-out $(SLINKS),$(SMDEP_FILES)) $(SX_KERNEL)_SMDEP_PATHS := $(SMDEP_PATHS) $(SX_KERNEL_DEV)_CACHE_MODE := GIT_CONTENT_SHA -$(SX_KERNEL_DEV)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(SX_KERNEL_DEV)_DEP_FLAGS := $(MLNX_SDK_COMMON_FLAGS_LIST) $(SX_KERNEL_DEV)_DEP_FILES := $(filter-out $(SLINKS),$(DEP_FILES)) $(SX_KERNEL_DEV)_SMDEP_FILES := $(filter-out $(SLINKS),$(SMDEP_FILES)) $(SX_KERNEL_DEV)_SMDEP_PATHS := $(SMDEP_PATHS) diff --git a/platform/mellanox/sdk.mk b/platform/mellanox/sdk.mk index e020d1a575cf..a7a2bb20b43a 100644 --- a/platform/mellanox/sdk.mk +++ b/platform/mellanox/sdk.mk @@ -1,8 +1,9 @@ -MLNX_SDK_BASE_PATH = $(PLATFORM_PATH)/sdk-src/sx-kernel/Switch-SDK-drivers/bin/ -MLNX_SDK_PKG_BASE_PATH = $(MLNX_SDK_BASE_PATH)/$(BLDENV)/ -MLNX_SDK_VERSION = 4.4.2208 +MLNX_SDK_VERSION = 4.5.3196 MLNX_SDK_ISSU_VERSION = 101 +MLNX_ASSETS_GITHUB_URL = https://github.com/Mellanox/Spectrum-SDK-Drivers-SONiC-Bins +MLNX_SDK_ASSETS_RELEASE_TAG = sdk-$(MLNX_SDK_VERSION)-$(BLDENV)-$(CONFIGURED_ARCH) +MLNX_SDK_ASSETS_URL = $(MLNX_ASSETS_GITHUB_URL)/releases/download/$(MLNX_SDK_ASSETS_RELEASE_TAG) MLNX_SDK_DEB_VERSION = $(subst -,.,$(subst _,.,$(MLNX_SDK_VERSION))) # Place here URL where SDK sources exist @@ -14,7 +15,7 @@ else SDK_FROM_SRC = n endif -export MLNX_SDK_SOURCE_BASE_URL MLNX_SDK_VERSION MLNX_SDK_ISSU_VERSION MLNX_SDK_DEB_VERSION +export MLNX_SDK_SOURCE_BASE_URL MLNX_SDK_VERSION MLNX_SDK_ISSU_VERSION MLNX_SDK_DEB_VERSION MLNX_ASSETS_GITHUB_URL MLNX_SDK_RDEBS += $(APPLIBS) $(IPROUTE2_MLNX) $(SX_COMPLIB) $(SX_EXAMPLES) \ $(SX_GEN_UTILS) $(SX_SCEW) $(SXD_LIBS) $(WJH_LIBS) $(SX_ACL_HELPER) @@ -136,21 +137,19 @@ $(SX_KERNEL)_SRC_PATH = $(PLATFORM_PATH)/sdk-src/sx-kernel SX_KERNEL_DEV = sx-kernel-dev_1.mlnx.$(MLNX_SDK_DEB_VERSION)_amd64.deb $(eval $(call add_derived_package,$(SX_KERNEL),$(SX_KERNEL_DEV))) -define make_path - $(1)_PATH = $(MLNX_SDK_PKG_BASE_PATH) +define make_url + $(1)_URL = $(MLNX_SDK_ASSETS_URL)/$(1) endef -$(eval $(foreach deb,$(MLNX_SDK_DEBS),$(call make_path,$(deb)))) -$(eval $(foreach deb,$(MLNX_SDK_RDEBS),$(call make_path,$(deb)))) -$(eval $(foreach deb,$(PYTHON_SDK_API) $(SX_KERNEL) $(SX_KERNEL_DEV),$(call make_path,$(deb)))) +$(eval $(foreach deb,$(MLNX_SDK_DEBS) $(MLNX_SDK_RDEBS) $(PYTHON_SDK_API),$(call make_url,$(deb)))) SONIC_MAKE_DEBS += $(SX_KERNEL) ifeq ($(SDK_FROM_SRC), y) SONIC_MAKE_DEBS += $(MLNX_SDK_RDEBS) $(PYTHON_SDK_API) else -SONIC_COPY_DEBS += $(MLNX_SDK_RDEBS) $(PYTHON_SDK_API) +SONIC_ONLINE_DEBS += $(MLNX_SDK_RDEBS) $(PYTHON_SDK_API) endif mlnx-sdk-packages: $(addprefix $(DEBS_PATH)/, $(MLNX_SDK_RDEBS) $(PYTHON_SDK_API) $(SX_KERNEL)) diff --git a/platform/mellanox/zero_profiles.j2 b/platform/mellanox/zero_profiles.j2 new file mode 100644 index 000000000000..bfbbb1af95fe --- /dev/null +++ b/platform/mellanox/zero_profiles.j2 @@ -0,0 +1,57 @@ +[ + { + "BUFFER_POOL_TABLE:ingress_zero_pool": { + "mode": "static", + "type": "ingress", + "size": "0" + }, + "OP": "SET" + }, + { + "BUFFER_PROFILE_TABLE:ingress_lossy_pg_zero_profile" : { + "pool":"[BUFFER_POOL_TABLE:ingress_zero_pool]", + "size":"0", + "static_th":"0" + }, + "OP": "SET" + }, + { + "BUFFER_PROFILE_TABLE:ingress_lossy_zero_profile" : { + "pool":"[BUFFER_POOL_TABLE:ingress_lossy_pool]", + "size":"0", + "dynamic_th":"-8" + }, + "OP": "SET" + }, + { + "BUFFER_PROFILE_TABLE:ingress_lossless_zero_profile" : { + "pool":"[BUFFER_POOL_TABLE:ingress_lossless_pool]", + "size":"0", + "dynamic_th":"-8" + }, + "OP": "SET" + }, + { + "BUFFER_PROFILE_TABLE:egress_lossy_zero_profile" : { + "pool":"[BUFFER_POOL_TABLE:egress_lossy_pool]", + "size":"0", + "dynamic_th":"-8" + }, + "OP": "SET" + }, + { + "BUFFER_PROFILE_TABLE:egress_lossless_zero_profile" : { + "pool":"[BUFFER_POOL_TABLE:egress_lossless_pool]", + "size":"0", + "dynamic_th":"-8" + }, + "OP": "SET" + }, + { + "control_fields" : { + "pgs_to_apply_zero_profile":"0", + "ingress_zero_profile":"[BUFFER_PROFILE_TABLE:ingress_lossy_pg_zero_profile]" + }, + "OP": "SET" + } +] diff --git a/platform/nephos/docker-ptf-nephos.mk b/platform/nephos/docker-ptf-nephos.mk deleted file mode 100644 index 15855bc89a1f..000000000000 --- a/platform/nephos/docker-ptf-nephos.mk +++ /dev/null @@ -1,8 +0,0 @@ -# docker image for docker-ptf-nephos - -DOCKER_PTF_NEPHOS = docker-ptf-nephos.gz -$(DOCKER_PTF_NEPHOS)_PATH = $(DOCKERS_PATH)/docker-ptf-saithrift -$(DOCKER_PTF_NEPHOS)_DEPENDS += $(PYTHON_SAITHRIFT_NEPHOS) -$(DOCKER_PTF_NEPHOS)_LOAD_DOCKERS += $(DOCKER_PTF) -SONIC_DOCKER_IMAGES += $(DOCKER_PTF_NEPHOS) -SONIC_STRETCH_DOCKERS += $(DOCKER_PTF_NEPHOS) diff --git a/platform/nephos/docker-syncd-nephos-rpc/Dockerfile.j2 b/platform/nephos/docker-syncd-nephos-rpc/Dockerfile.j2 index 95703448c371..6c63efb69bb6 100644 --- a/platform/nephos/docker-syncd-nephos-rpc/Dockerfile.j2 +++ b/platform/nephos/docker-syncd-nephos-rpc/Dockerfile.j2 @@ -11,11 +11,6 @@ debs/ RUN apt-get purge -y syncd -RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; } ; \ -{% for deb in docker_syncd_nephos_rpc_debs.split(' ') -%} -dpkg_apt debs/{{ deb }}{{'; '}} -{%- endfor %} - ## Pre-install the fundamental packages RUN apt-get update \ && apt-get -y install \ @@ -27,7 +22,16 @@ RUN apt-get update \ python-dev \ wget \ cmake \ - && wget https://github.com/nanomsg/nanomsg/archive/1.0.0.tar.gz \ + libqt5core5a \ + libqt5network5 \ + libboost-atomic1.71.0 + +RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; } ; \ +{% for deb in docker_syncd_nephos_rpc_debs.split(' ') -%} +dpkg_apt debs/{{ deb }}{{'; '}} +{%- endfor %} + +RUN wget https://github.com/nanomsg/nanomsg/archive/1.0.0.tar.gz \ && tar xvfz 1.0.0.tar.gz \ && cd nanomsg-1.0.0 \ && mkdir -p build \ diff --git a/platform/nephos/docker-syncd-nephos.mk b/platform/nephos/docker-syncd-nephos.mk index 146523ec1c64..a546b6860694 100644 --- a/platform/nephos/docker-syncd-nephos.mk +++ b/platform/nephos/docker-syncd-nephos.mk @@ -18,4 +18,3 @@ $(DOCKER_SYNCD_BASE)_RUN_OPT += -v /host/warmboot:/var/warmboot $(DOCKER_SYNCD_BASE)_RUN_OPT += -v /var/run/docker-syncd:/var/run/sswsyncd $(DOCKER_SYNCD_BASE)_BASE_IMAGE_FILES += npx_diag:/usr/bin/npx_diag -$(DOCKER_SYNCD_BASE)_BASE_IMAGE_FILES += monit_syncd:/etc/monit/conf.d diff --git a/platform/nephos/docker-syncd-nephos/base_image_files/monit_syncd b/platform/nephos/docker-syncd-nephos/base_image_files/monit_syncd deleted file mode 100644 index d63346d9ee20..000000000000 --- a/platform/nephos/docker-syncd-nephos/base_image_files/monit_syncd +++ /dev/null @@ -1,11 +0,0 @@ -############################################################################### -## Monit configuration for syncd container -## process list: -## syncd -## dsserve -############################################################################### -check program syncd|syncd with path "/usr/bin/process_checker syncd /usr/bin/syncd" - if status != 0 for 5 times within 5 cycles then alert repeat every 1 cycles - -check program syncd|dsserve with path "/usr/bin/process_checker syncd /usr/bin/dsserve /usr/bin/syncd" - if status != 0 for 5 times within 5 cycles then alert repeat every 1 cycles diff --git a/platform/nephos/docker-syncd-nephos/supervisord.conf b/platform/nephos/docker-syncd-nephos/supervisord.conf index a05bf7bfec73..944c3be9171e 100644 --- a/platform/nephos/docker-syncd-nephos/supervisord.conf +++ b/platform/nephos/docker-syncd-nephos/supervisord.conf @@ -10,13 +10,14 @@ autorestart=unexpected startretries=0 exitcodes=0,3 events=PROCESS_STATE -buffer_size=25 +buffer_size=1024 [eventlistener:supervisor-proc-exit-listener] command=python2 /usr/bin/supervisor-proc-exit-listener --container-name syncd -events=PROCESS_STATE_EXITED +events=PROCESS_STATE_EXITED,PROCESS_STATE_RUNNING autostart=true autorestart=unexpected +buffer_size=1024 [program:rsyslogd] command=/usr/sbin/rsyslogd -n -iNONE diff --git a/platform/nephos/nephos-modules/debian/control b/platform/nephos/nephos-modules/debian/control index 78eb7af671fe..1b485d808f3e 100644 --- a/platform/nephos/nephos-modules/debian/control +++ b/platform/nephos/nephos-modules/debian/control @@ -7,6 +7,6 @@ Standards-Version: 3.9.3 Package: nephos-modules Architecture: amd64 -Depends: linux-image-4.19.0-9-2-amd64-unsigned +Depends: linux-image-4.19.0-12-2-amd64-unsigned Description: kernel modules for nephos asic diff --git a/platform/nephos/rules.mk b/platform/nephos/rules.mk index 8950c665deef..4ee2443e7585 100644 --- a/platform/nephos/rules.mk +++ b/platform/nephos/rules.mk @@ -7,7 +7,6 @@ include $(PLATFORM_PATH)/docker-syncd-nephos.mk include $(PLATFORM_PATH)/docker-syncd-nephos-rpc.mk include $(PLATFORM_PATH)/one-image.mk include $(PLATFORM_PATH)/libsaithrift-dev.mk -include $(PLATFORM_PATH)/docker-ptf-nephos.mk NPX_DIAG = npx_diag $(NPX_DIAG)_URL = "https://github.com/NephosInc/SONiC/raw/master/sdk/npx_diag" diff --git a/platform/nephos/sonic-platform-modules-accton/debian/control b/platform/nephos/sonic-platform-modules-accton/debian/control index e2b67b03b9e4..3020b86408d6 100755 --- a/platform/nephos/sonic-platform-modules-accton/debian/control +++ b/platform/nephos/sonic-platform-modules-accton/debian/control @@ -7,5 +7,5 @@ Standards-Version: 3.9.3 Package: sonic-platform-accton-as7116-54x Architecture: amd64 -Depends: linux-image-4.19.0-9-2-amd64-unsigned +Depends: linux-image-4.19.0-12-2-amd64-unsigned Description: kernel modules for platform devices such as fan, led, sfp diff --git a/platform/nephos/sonic-platform-modules-cig/debian/control b/platform/nephos/sonic-platform-modules-cig/debian/control index 870edcf1a234..fc0c6736ffa2 100644 --- a/platform/nephos/sonic-platform-modules-cig/debian/control +++ b/platform/nephos/sonic-platform-modules-cig/debian/control @@ -7,15 +7,15 @@ Standards-Version: 3.9.3 Package: sonic-platform-cig-cs6436-56p Architecture: amd64 -Depends: linux-image-4.19.0-9-2-amd64-unsigned +Depends: linux-image-4.19.0-12-2-amd64-unsigned Description: kernel modules for platform devices such as fan, led, sfp Package: sonic-platform-cig-cs6436-54p Architecture: amd64 -Depends: linux-image-4.19.0-9-2-amd64-unsigned +Depends: linux-image-4.19.0-12-2-amd64-unsigned Description: kernel modules for platform devices such as fan, led, sfp Package: sonic-platform-cig-cs5435-54p Architecture: amd64 -Depends: linux-image-4.19.0-9-2-amd64-unsigned +Depends: linux-image-4.19.0-12-2-amd64-unsigned Description: kernel modules for platform devices such as fan, led, sfp diff --git a/platform/nephos/sonic-platform-modules-pegatron/debian/control b/platform/nephos/sonic-platform-modules-pegatron/debian/control index fc3054a4c876..8fc19980fc12 100755 --- a/platform/nephos/sonic-platform-modules-pegatron/debian/control +++ b/platform/nephos/sonic-platform-modules-pegatron/debian/control @@ -7,6 +7,6 @@ Standards-Version: 3.9.3 Package: sonic-platform-pegatron-porsche Architecture: amd64 -Depends: linux-image-4.19.0-9-2-amd64-unsigned +Depends: linux-image-4.19.0-12-2-amd64-unsigned Description: kernel modules for platform devices such as fan, led, sfp diff --git a/platform/pddf/platform-api-pddf-base.dep b/platform/pddf/platform-api-pddf-base.dep index 9184925b1e6f..aaaedb068384 100644 --- a/platform/pddf/platform-api-pddf-base.dep +++ b/platform/pddf/platform-api-pddf-base.dep @@ -7,3 +7,7 @@ DEP_FILES += $(shell git ls-files $(MPATH)) $(PDDF_PLATFORM_API_BASE_PY2)_CACHE_MODE := GIT_CONTENT_SHA $(PDDF_PLATFORM_API_BASE_PY2)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) $(PDDF_PLATFORM_API_BASE_PY2)_DEP_FILES := $(DEP_FILES) + +$(PDDF_PLATFORM_API_BASE_PY3)_CACHE_MODE := GIT_CONTENT_SHA +$(PDDF_PLATFORM_API_BASE_PY3)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(PDDF_PLATFORM_API_BASE_PY3)_DEP_FILES := $(DEP_FILES) diff --git a/platform/pddf/platform-api-pddf-base.mk b/platform/pddf/platform-api-pddf-base.mk index 80478d4f3db1..ce818707ba7e 100644 --- a/platform/pddf/platform-api-pddf-base.mk +++ b/platform/pddf/platform-api-pddf-base.mk @@ -13,3 +13,16 @@ SONIC_PYTHON_WHEELS += $(PDDF_PLATFORM_API_BASE_PY2) export pddf_platform_api_base_py2_wheel_path="$(addprefix $(PYTHON_WHEELS_PATH)/,$(PDDF_PLATFORM_API_BASE_PY2))" export PDDF_PLATFORM_API_BASE_PY2 + +PDDF_PLATFORM_API_BASE_PY3 = sonic_platform_pddf_common-$(PDDF_PLATFORM_API_BASE_VERSION)-py3-none-any.whl +$(PDDF_PLATFORM_API_BASE_PY3)_SRC_PATH = $(PLATFORM_PDDF_PATH)/platform-api-pddf-base +$(PDDF_PLATFORM_API_BASE_PY3)_PYTHON_VERSION = 3 +$(PDDF_PLATFORM_API_BASE_PY3)_DEPENDS = $(SONIC_CONFIG_ENGINE) +# Synthetic dependency to avoid building the Python 2 and 3 packages +# simultaneously and any potential conflicts which may arise +$(PDDF_PLATFORM_API_BASE_PY3)_DEPENDS += $(PDDF_PLATFORM_API_BASE_PY2) +$(PDDF_PLATFORM_API_BASE_PY3)_TEST = n +SONIC_PYTHON_WHEELS += $(PDDF_PLATFORM_API_BASE_PY3) + +export pddf_platform_api_base_py3_wheel_path="$(addprefix $(PYTHON_WHEELS_PATH)/,$(PDDF_PLATFORM_API_BASE_PY3))" +export PDDF_PLATFORM_API_BASE_PY3 diff --git a/platform/pddf/platform-api-pddf-base/setup.py b/platform/pddf/platform-api-pddf-base/setup.py index 5f5ac9194cd9..0d8b4a6b2df2 100755 --- a/platform/pddf/platform-api-pddf-base/setup.py +++ b/platform/pddf/platform-api-pddf-base/setup.py @@ -14,6 +14,9 @@ packages=[ 'sonic_platform_pddf_base', ], + install_requires=[ + 'jsonschema==2.6.0' + ], classifiers=[ 'Development Status :: 3 - Alpha', 'Environment :: Plugins', @@ -24,6 +27,7 @@ 'Natural Language :: English', 'Operating System :: POSIX :: Linux', 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3.7', 'Topic :: Utilities', ], keywords='sonic SONiC platform PLATFORM', diff --git a/platform/pddf/platform-api-pddf-base/sonic_platform_pddf_base/pddf_chassis.py b/platform/pddf/platform-api-pddf-base/sonic_platform_pddf_base/pddf_chassis.py index 942be25ed1c7..0e77a90dbab1 100755 --- a/platform/pddf/platform-api-pddf-base/sonic_platform_pddf_base/pddf_chassis.py +++ b/platform/pddf/platform-api-pddf-base/sonic_platform_pddf_base/pddf_chassis.py @@ -18,6 +18,7 @@ except ImportError as e: raise ImportError(str(e) + "- required module not found") + class PddfChassis(ChassisBase): """ PDDF Generic Chassis class @@ -33,7 +34,7 @@ def __init__(self, pddf_data=None, pddf_plugin_data=None): self.plugin_data = pddf_plugin_data if pddf_plugin_data else None if not self.pddf_obj or not self.plugin_data: try: - import pddfparse + from . import pddfparse import json self.pddf_obj = pddfparse.PddfParse() with open('/usr/share/sonic/platform/pddf/pd-plugin.json') as pd: @@ -67,8 +68,8 @@ def __init__(self, pddf_data=None, pddf_plugin_data=None): thermal = Thermal(i, self.pddf_obj, self.plugin_data) self._thermal_list.append(thermal) - # SYSTEM LED Test Cases - """ + # SYSTEM LED Test Cases + """ #comment out test cases sys_led_list= { "LOC":0, "DIAG":0, @@ -90,8 +91,6 @@ def __init__(self, pddf_data=None, pddf_plugin_data=None): print "Set off: " + color """ - - def get_name(self): """ Retrieves the name of the chassis @@ -438,34 +437,32 @@ def get_sfp(self, index): # System LED methods ############################################## def set_system_led(self, led_device_name, color): - result, msg = self.pddf_obj.is_supported_sysled_state(led_device_name, color); + result, msg = self.pddf_obj.is_supported_sysled_state(led_device_name, color) if result == False: - print msg - return (False) + print(msg) + return (False) - index=self.pddf_obj.data[led_device_name]['dev_attr']['index'] - device_name=self.pddf_obj.data[led_device_name]['dev_info']['device_name'] + index = self.pddf_obj.data[led_device_name]['dev_attr']['index'] + device_name = self.pddf_obj.data[led_device_name]['dev_info']['device_name'] self.pddf_obj.create_attr('device_name', device_name, self.pddf_obj.get_led_path()) self.pddf_obj.create_attr('index', index, self.pddf_obj.get_led_path()) self.pddf_obj.create_attr('color', color, self.pddf_obj.get_led_cur_state_path()) self.pddf_obj.create_attr('dev_ops', 'set_status', self.pddf_obj.get_led_path()) return (True) - def get_system_led(self, led_device_name): - if (not led_device_name in self.pddf_obj.data.keys()): - status= "[FAILED] " + led_device_name + " is not configured" - return (status) + if led_device_name not in self.pddf_obj.data.keys(): + status = "[FAILED] " + led_device_name + " is not configured" + return (status) - index=self.pddf_obj.data[led_device_name]['dev_attr']['index'] - device_name=self.pddf_obj.data[led_device_name]['dev_info']['device_name'] + index = self.pddf_obj.data[led_device_name]['dev_attr']['index'] + device_name = self.pddf_obj.data[led_device_name]['dev_info']['device_name'] self.pddf_obj.create_attr('device_name', device_name, self.pddf_obj.get_led_path()) self.pddf_obj.create_attr('index', index, self.pddf_obj.get_led_path()) self.pddf_obj.create_attr('dev_ops', 'get_status', self.pddf_obj.get_led_path()) - color=self.pddf_obj.get_led_color() + color = self.pddf_obj.get_led_color() return (color) - ############################################## # Other methods ############################################## @@ -513,4 +510,3 @@ def get_change_event(self, timeout=0): has been inserted and sfp 11 has been removed. """ raise NotImplementedError - diff --git a/platform/pddf/platform-api-pddf-base/sonic_platform_pddf_base/pddf_eeprom.py b/platform/pddf/platform-api-pddf-base/sonic_platform_pddf_base/pddf_eeprom.py index 222cdcf4edd3..592485d617e4 100644 --- a/platform/pddf/platform-api-pddf-base/sonic_platform_pddf_base/pddf_eeprom.py +++ b/platform/pddf/platform-api-pddf-base/sonic_platform_pddf_base/pddf_eeprom.py @@ -67,47 +67,41 @@ def __init__(self, pddf_data=None, pddf_plugin_data=None): tlv_index += ord(eeprom[tlv_index+1]) + 2 def serial_number_str(self): - (is_valid, results) = self.get_tlv_field( - self.eeprom_data, self._TLV_CODE_SERIAL_NUMBER) + (is_valid, results) = self.get_tlv_field(self.eeprom_data, self._TLV_CODE_SERIAL_NUMBER) if not is_valid: return "N/A" return results[2] def base_mac_addr(self): - (is_valid, t) = self.get_tlv_field( - self.eeprom_data, self._TLV_CODE_MAC_BASE) + (is_valid, t) = self.get_tlv_field(self.eeprom_data, self._TLV_CODE_MAC_BASE) if not is_valid or t[1] != 6: return super(TlvInfoDecoder, self).switchaddrstr(e) return ":".join([binascii.b2a_hex(T) for T in t[2]]) def modelstr(self): - (is_valid, results) = self.get_tlv_field( - self.eeprom_data, self._TLV_CODE_PRODUCT_NAME) + (is_valid, results) = self.get_tlv_field(self.eeprom_data, self._TLV_CODE_PRODUCT_NAME) if not is_valid: return "N/A" return results[2] def part_number_str(self): - (is_valid, results) = self.get_tlv_field( - self.eeprom_data, self._TLV_CODE_PART_NUMBER) + (is_valid, results) = self.get_tlv_field(self.eeprom_data, self._TLV_CODE_PART_NUMBER) if not is_valid: return "N/A" return results[2] def serial_str(self): - (is_valid, results) = self.get_tlv_field( - self.eeprom_data, self._TLV_CODE_SERVICE_TAG) + (is_valid, results) = self.get_tlv_field(self.eeprom_data, self._TLV_CODE_SERVICE_TAG) if not is_valid: return "N/A" return results[2] def revision_str(self): - (is_valid, results) = self.get_tlv_field( - self.eeprom_data, self._TLV_CODE_DEVICE_VERSION) + (is_valid, results) = self.get_tlv_field(self.eeprom_data, self._TLV_CODE_DEVICE_VERSION) if not is_valid: return "N/A" diff --git a/platform/pddf/platform-api-pddf-base/sonic_platform_pddf_base/pddf_fan.py b/platform/pddf/platform-api-pddf-base/sonic_platform_pddf_base/pddf_fan.py index f189ca2a4e2e..5930345070b4 100755 --- a/platform/pddf/platform-api-pddf-base/sonic_platform_pddf_base/pddf_fan.py +++ b/platform/pddf/platform-api-pddf-base/sonic_platform_pddf_base/pddf_fan.py @@ -22,7 +22,7 @@ class PddfFan(FanBase): plugin_data = {} def __init__(self, tray_idx, fan_idx=0, pddf_data=None, pddf_plugin_data=None, is_psu_fan=False, psu_index=0): - # idx is 0-based + # idx is 0-based if not pddf_data or not pddf_plugin_data: raise ValueError('PDDF JSON data error') @@ -30,12 +30,12 @@ def __init__(self, tray_idx, fan_idx=0, pddf_data=None, pddf_plugin_data=None, i self.plugin_data = pddf_plugin_data self.platform = self.pddf_obj.get_platform() - if tray_idx<0 or tray_idx>=self.platform['num_fantrays']: - print "Invalid fantray index %d\n"%tray_idx + if tray_idx < 0 or tray_idx >= self.platform['num_fantrays']: + print("Invalid fantray index %d\n" % tray_idx) return - - if fan_idx<0 or fan_idx>=self.platform['num_fans_pertray']: - print "Invalid fan index (within a tray) %d\n"%fan_idx + + if fan_idx < 0 or fan_idx >= self.platform['num_fans_pertray']: + print("Invalid fan index (within a tray) %d\n" % fan_idx) return self.fantray_index = tray_idx+1 @@ -160,7 +160,7 @@ def get_speed(self): if not output: return 0 - + output['status'] = output['status'].rstrip() if output['status'].isalpha(): return 0 @@ -185,7 +185,7 @@ def get_speed_rpm(self): output = self.pddf_obj.get_attr_name_output(device, attr) if not output: return 0 - + output['status'] = output['status'].rstrip() if output['status'].isalpha(): return 0 @@ -229,7 +229,7 @@ def get_target_speed(self): if not output: return 0 - + output['status'] = output['status'].rstrip() if output['status'].isalpha(): return 0 @@ -250,7 +250,7 @@ def get_speed_tolerance(self): An integer, the percentage of variance from target speed which is considered tolerable """ - # Fix the speed vairance to 10 percent. If it changes based on platforms, overwrite + # Fix the speed vairance to 10 percent. If it changes based on platforms, overwrite # this value in derived pddf fan class return 10 @@ -266,28 +266,27 @@ def set_speed(self, speed): A boolean, True if speed is set successfully, False if not """ if self.is_psu_fan: - print "Setting PSU fan speed is not allowed" + print("Setting PSU fan speed is not allowed") return False else: - if speed<0 or speed>100: - print "Error: Invalid speed %d. Please provide a valid speed percentage"%speed + if speed < 0 or speed > 100: + print("Error: Invalid speed %d. Please provide a valid speed percentage" % speed) return False if 'duty_cycle_to_pwm' not in self.plugin_data['FAN']: - print "Setting fan speed is not allowed !" + print("Setting fan speed is not allowed !") return False else: duty_cycle_to_pwm = eval(self.plugin_data['FAN']['duty_cycle_to_pwm']) pwm = int(round(duty_cycle_to_pwm(speed))) - status = False idx = (self.fantray_index-1)*self.platform['num_fans_pertray'] + self.fan_index attr = "fan" + str(idx) + "_pwm" output = self.pddf_obj.set_attr_name_output("FAN-CTRL", attr, pwm) if not output: return False - + status = output['status'] return status @@ -296,36 +295,34 @@ def set_status_led(self, color): index = str(self.fantray_index-1) led_device_name = "FANTRAY{}".format(self.fantray_index) + "_LED" - result, msg = self.pddf_obj.is_supported_sysled_state(led_device_name, color); + result, msg = self.pddf_obj.is_supported_sysled_state(led_device_name, color) if result == False: - print msg - return (False) + print(msg) + return (False) - - device_name=self.pddf_obj.data[led_device_name]['dev_info']['device_name'] + device_name = self.pddf_obj.data[led_device_name]['dev_info']['device_name'] self.pddf_obj.create_attr('device_name', device_name, self.pddf_obj.get_led_path()) self.pddf_obj.create_attr('index', index, self.pddf_obj.get_led_path()) self.pddf_obj.create_attr('color', color, self.pddf_obj.get_led_cur_state_path()) self.pddf_obj.create_attr('dev_ops', 'set_status', self.pddf_obj.get_led_path()) return (True) - def get_status_led(self): index = str(self.fantray_index-1) fan_led_device = "FANTRAY{}".format(self.fantray_index) + "_LED" - if (not fan_led_device in self.pddf_obj.data.keys()): + if fan_led_device not in self.pddf_obj.data.keys(): # Implement a generic status_led color scheme if self.get_status(): return self.STATUS_LED_COLOR_GREEN else: return self.STATUS_LED_COLOR_OFF - device_name=self.pddf_obj.data[fan_led_device]['dev_info']['device_name'] + device_name = self.pddf_obj.data[fan_led_device]['dev_info']['device_name'] self.pddf_obj.create_attr('device_name', device_name, self.pddf_obj.get_led_path()) self.pddf_obj.create_attr('index', index, self.pddf_obj.get_led_path()) self.pddf_obj.create_attr('dev_ops', 'get_status', self.pddf_obj.get_led_path()) - color=self.pddf_obj.get_led_color() + color = self.pddf_obj.get_led_color() return (color) def dump_sysfs(self): diff --git a/platform/pddf/platform-api-pddf-base/sonic_platform_pddf_base/pddf_platform.py b/platform/pddf/platform-api-pddf-base/sonic_platform_pddf_base/pddf_platform.py index 20b87db99910..00eefc9a815e 100755 --- a/platform/pddf/platform-api-pddf-base/sonic_platform_pddf_base/pddf_platform.py +++ b/platform/pddf/platform-api-pddf-base/sonic_platform_pddf_base/pddf_platform.py @@ -10,7 +10,7 @@ try: import json - import pddfparse + from . import pddfparse from sonic_platform_base.platform_base import PlatformBase from sonic_platform.chassis import Chassis except ImportError as e: @@ -23,6 +23,7 @@ class PddfPlatform(PlatformBase): """ pddf_data = {} pddf_plugin_data = {} + def __init__(self): # Initialize the JSON data self.pddf_data = pddfparse.PddfParse() @@ -30,7 +31,7 @@ def __init__(self): self.pddf_plugin_data = json.load(pd) if not self.pddf_data or not self.pddf_plugin_data: - print "Error: PDDF JSON data is not loaded properly ... Exiting" + print("Error: PDDF JSON data is not loaded properly ... Exiting") raise ValueError PlatformBase.__init__(self) diff --git a/platform/pddf/platform-api-pddf-base/sonic_platform_pddf_base/pddf_psu.py b/platform/pddf/platform-api-pddf-base/sonic_platform_pddf_base/pddf_psu.py index b378be7dad39..58b69ce0aa73 100755 --- a/platform/pddf/platform-api-pddf-base/sonic_platform_pddf_base/pddf_psu.py +++ b/platform/pddf/platform-api-pddf-base/sonic_platform_pddf_base/pddf_psu.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# All the supported PSU SysFS aattributes are +# All the supported PSU SysFS aattributes are #- psu_present #- psu_model_name #- psu_power_good @@ -18,7 +18,7 @@ from sonic_platform_base.psu_base import PsuBase from sonic_platform.fan import Fan except ImportError as e: - raise ImportError (str(e) + "- required module not found") + raise ImportError(str(e) + "- required module not found") class PddfPsu(PsuBase): @@ -27,7 +27,6 @@ class PddfPsu(PsuBase): pddf_obj = {} plugin_data = {} - def __init__(self, index, pddf_data=None, pddf_plugin_data=None): PsuBase.__init__(self) if not pddf_data or not pddf_plugin_data: @@ -37,7 +36,7 @@ def __init__(self, index, pddf_data=None, pddf_plugin_data=None): self.plugin_data = pddf_plugin_data self.platform = self.pddf_obj.get_platform() self.psu_index = index + 1 - + self._fan_list = [] # _fan_list under PsuBase class is a global variable, hence we need to use _fan_list per class instatiation self.num_psu_fans = int(self.pddf_obj.get_num_psu_fans('PSU{}'.format(index+1))) for psu_fan_idx in range(self.num_psu_fans): @@ -75,11 +74,11 @@ def get_presence(self): status = 0 device = "PSU{}".format(self.psu_index) output = self.pddf_obj.get_attr_name_output(device, "psu_present") - if not output: - return False + if not output: + return False mode = output['mode'] - status = output['status'] + status = output['status'] vmap = self.plugin_data['PSU']['psu_present'][mode]['valmap'] @@ -98,7 +97,7 @@ def get_model(self): device = "PSU{}".format(self.psu_index) output = self.pddf_obj.get_attr_name_output(device, "psu_model_name") if not output: - return None + return None model = output['status'] @@ -118,7 +117,7 @@ def get_serial(self): device = "PSU{}".format(self.psu_index) output = self.pddf_obj.get_attr_name_output(device, "psu_serial_num") if not output: - return None + return None serial = output['status'] @@ -138,7 +137,7 @@ def get_status(self): return False mode = output['mode'] - status = output ['status'] + status = output['status'] vmap = self.plugin_data['PSU']['psu_power_good'][mode]['valmap'] @@ -157,9 +156,9 @@ def get_mfr_id(self): device = "PSU{}".format(self.psu_index) output = self.pddf_obj.get_attr_name_output(device, "psu_mfr_id") if not output: - return None + return None - mfr = output['status'] + mfr = output['status'] return mfr.rstrip('\n') @@ -171,11 +170,11 @@ def get_voltage(self): A float number, the output voltage in volts, e.g. 12.1 """ - device = "PSU{}".format(self.psu_index) + device = "PSU{}".format(self.psu_index) output = self.pddf_obj.get_attr_name_output(device, "psu_v_out") if not output: return 0.0 - + v_out = output['status'] return float(v_out)/1000 @@ -230,12 +229,12 @@ def set_status_led(self, color): index = str(self.psu_index-1) led_device_name = "PSU{}".format(self.psu_index) + "_LED" - result, msg = self.pddf_obj.is_supported_sysled_state(led_device_name, color); + result, msg = self.pddf_obj.is_supported_sysled_state(led_device_name, color) if result == False: - print msg - return (False) + print(msg) + return (False) - device_name=self.pddf_obj.data[led_device_name]['dev_info']['device_name'] + device_name = self.pddf_obj.data[led_device_name]['dev_info']['device_name'] self.pddf_obj.create_attr('device_name', device_name, self.pddf_obj.get_led_path()) self.pddf_obj.create_attr('index', index, self.pddf_obj.get_led_path()) self.pddf_obj.create_attr('color', color, self.pddf_obj.get_led_cur_state_path()) @@ -245,18 +244,18 @@ def set_status_led(self, color): def get_status_led(self): index = str(self.psu_index-1) psu_led_device = "PSU{}_LED".format(self.psu_index) - if (not psu_led_device in self.pddf_obj.data.keys()): + if psu_led_device not in self.pddf_obj.data.keys(): # Implement a generic status_led color scheme if self.get_powergood_status(): return self.STATUS_LED_COLOR_GREEN else: return self.STATUS_LED_COLOR_OFF - device_name=self.pddf_obj.data[psu_led_device]['dev_info']['device_name'] + device_name = self.pddf_obj.data[psu_led_device]['dev_info']['device_name'] self.pddf_obj.create_attr('device_name', device_name, self.pddf_obj.get_led_path()) self.pddf_obj.create_attr('index', index, self.pddf_obj.get_led_path()) self.pddf_obj.create_attr('dev_ops', 'get_status', self.pddf_obj.get_led_path()) - color=self.pddf_obj.get_led_color() + color = self.pddf_obj.get_led_color() return (color) def get_input_voltage(self): diff --git a/platform/pddf/platform-api-pddf-base/sonic_platform_pddf_base/pddf_sfp.py b/platform/pddf/platform-api-pddf-base/sonic_platform_pddf_base/pddf_sfp.py index 856f4c748d10..dc37bba6e888 100755 --- a/platform/pddf/platform-api-pddf-base/sonic_platform_pddf_base/pddf_sfp.py +++ b/platform/pddf/platform-api-pddf-base/sonic_platform_pddf_base/pddf_sfp.py @@ -10,8 +10,8 @@ from sonic_platform_base.sonic_sfp.sff8472 import sff8472Dom from sonic_platform_base.sonic_sfp.sff8472 import sffbase from sonic_platform_base.sonic_sfp.inf8628 import inf8628InterfaceId -except ImportError, e: - raise ImportError (str(e) + "- required module not found") +except ImportError as e: + raise ImportError(str(e) + "- required module not found") # definitions of the offset and width for values in XCVR info eeprom XCVR_INTFACE_BULK_OFFSET = 0 @@ -58,7 +58,7 @@ OSFP_HW_REV_OFFSET = 164 OSFP_VENDOR_SN_OFFSET = 166 -#definitions of the offset and width for values in DOM info eeprom +# definitions of the offset and width for values in DOM info eeprom QSFP_DOM_REV_OFFSET = 1 QSFP_DOM_REV_WIDTH = 1 QSFP_TEMPE_OFFSET = 22 @@ -107,10 +107,10 @@ 'LengthCable(UnitsOfm)', 'LengthOM3(UnitsOf10m)') sfp_compliance_code_tup = ('10GEthernetComplianceCode', 'InfinibandComplianceCode', - 'ESCONComplianceCodes', 'SONETComplianceCodes', - 'EthernetComplianceCodes','FibreChannelLinkLength', - 'FibreChannelTechnology', 'SFP+CableTechnology', - 'FibreChannelTransmissionMedia','FibreChannelSpeed') + 'ESCONComplianceCodes', 'SONETComplianceCodes', + 'EthernetComplianceCodes', 'FibreChannelLinkLength', + 'FibreChannelTechnology', 'SFP+CableTechnology', + 'FibreChannelTransmissionMedia', 'FibreChannelSpeed') qsfp_compliance_code_tup = ('10/40G Ethernet Compliance Code', 'SONET Compliance codes', 'SAS/SATA compliance codes', 'Gigabit Ethernet Compliant codes', @@ -126,6 +126,7 @@ DOM_OFFSET = 0 DOM_OFFSET1 = 384 + class PddfSfp(SfpBase): """ PDDF generic Sfp class @@ -154,7 +155,7 @@ def __read_eeprom_specific_bytes(self, offset, num_bytes): for n in range(0, num_bytes): eeprom_raw[n] = hex(ord(raw[n]))[2:].zfill(2) except Exception as e: - print "Error: Unable to open eeprom_path: %s"%(str(e)) + print("Error: Unable to open eeprom_path: %s" % (str(e))) finally: if sysfsfile_eeprom: sysfsfile_eeprom.close() @@ -174,29 +175,29 @@ def __init__(self, index, pddf_data=None, pddf_plugin_data=None): self._port_start = 0 self._port_end = int(self.platform['num_ports']) if index < self._port_start or index >= self._port_end: - print "Invalid port index %d"%index - return + print("Invalid port index %d" % index) + return self.port_index = index+1 self.device = 'PORT{}'.format(self.port_index) self.sfp_type = self.pddf_obj.get_device_type(self.device) - self.is_qsfp_port = True if (self.sfp_type=='QSFP' or self.sfp_type=='QSFP28') else False - self.is_osfp_port = True if (self.sfp_type=='OSFP' or self.sfp_type=='QSFP-DD') else False + self.is_qsfp_port = True if (self.sfp_type == 'QSFP' or self.sfp_type == 'QSFP28') else False + self.is_osfp_port = True if (self.sfp_type == 'OSFP' or self.sfp_type == 'QSFP-DD') else False self.eeprom_path = self.pddf_obj.get_path(self.device, 'eeprom') - self.info_dict_keys = ['type', 'hardware_rev', 'serial', 'manufacturer', 'model', 'connector', 'encoding', - 'ext_identifier', 'ext_rateselect_compliance', 'cable_type', 'cable_length', 'nominal_bit_rate', - 'specification_compliance', 'vendor_date', 'vendor_oui', 'application_advertisement'] + self.info_dict_keys = ['type', 'hardware_rev', 'serial', 'manufacturer', 'model', 'connector', 'encoding', + 'ext_identifier', 'ext_rateselect_compliance', 'cable_type', 'cable_length', 'nominal_bit_rate', + 'specification_compliance', 'vendor_date', 'vendor_oui', 'application_advertisement'] self.dom_dict_keys = ['rx_los', 'tx_fault', 'reset_status', 'power_lpmode', 'tx_disable', 'tx_disable_channel', - 'temperature', 'voltage', 'rx1power', 'rx2power', 'rx3power', 'rx4power', 'tx1bias', 'tx2bias', - 'tx3bias', 'tx4bias', 'tx1power', 'tx2power', 'tx3power', 'tx4power'] + 'temperature', 'voltage', 'rx1power', 'rx2power', 'rx3power', 'rx4power', 'tx1bias', 'tx2bias', + 'tx3bias', 'tx4bias', 'tx1power', 'tx2power', 'tx3power', 'tx4power'] - self.threshold_dict_keys = ['temphighalarm', 'temphighwarning', 'templowalarm', 'templowwarning', - 'vcchighalarm', 'vcchighwarning', 'vcclowalarm', 'vcclowwarning', 'rxpowerhighalarm', - 'rxpowerhighwarning', 'rxpowerlowalarm', 'rxpowerlowwarning', 'txpowerhighalarm', 'txpowerhighwarning', - 'txpowerlowalarm', 'txpowerlowwarning', 'txbiashighalarm', 'txbiashighwarning', 'txbiaslowalarm', - 'txbiaslowwarning'] + self.threshold_dict_keys = ['temphighalarm', 'temphighwarning', 'templowalarm', 'templowwarning', + 'vcchighalarm', 'vcchighwarning', 'vcclowalarm', 'vcclowwarning', 'rxpowerhighalarm', + 'rxpowerhighwarning', 'rxpowerlowalarm', 'rxpowerlowwarning', 'txpowerhighalarm', 'txpowerhighwarning', + 'txpowerlowalarm', 'txpowerlowwarning', 'txbiashighalarm', 'txbiashighwarning', 'txbiaslowalarm', + 'txbiaslowwarning'] SfpBase.__init__(self) @@ -226,9 +227,8 @@ def get_transceiver_info(self): ======================================================================== """ # check present status - if not self.get_presence(): - return None - + if not self.get_presence(): + return None if self.is_osfp_port: sfpi_obj = inf8628InterfaceId() @@ -267,7 +267,6 @@ def get_transceiver_info(self): if sfpi_obj is None: return None - if self.is_osfp_port: sfp_type_raw = self.__read_eeprom_specific_bytes((offset + type_offset), XCVR_TYPE_WIDTH) @@ -275,19 +274,21 @@ def get_transceiver_info(self): sfp_type_data = sfpi_obj.parse_sfp_type(sfp_type_raw, 0) sfp_type_abbrv_name = sfpi_obj.parse_sfp_type_abbrv_name(sfp_typ_raw, 0) else: - sfp_interface_bulk_raw = self.__read_eeprom_specific_bytes((offset + XCVR_INTFACE_BULK_OFFSET), interface_info_bulk_width) + sfp_interface_bulk_raw = self.__read_eeprom_specific_bytes( + (offset + XCVR_INTFACE_BULK_OFFSET), interface_info_bulk_width) if sfp_interface_bulk_raw is not None: sfp_interface_bulk_data = sfpi_obj.parse_sfp_info_bulk(sfp_interface_bulk_raw, 0) - sfp_vendor_oui_raw = self.__read_eeprom_specific_bytes((offset + XCVR_VENDOR_OUI_OFFSET), XCVR_VENDOR_OUI_WIDTH) + sfp_vendor_oui_raw = self.__read_eeprom_specific_bytes( + (offset + XCVR_VENDOR_OUI_OFFSET), XCVR_VENDOR_OUI_WIDTH) if sfp_vendor_oui_raw is not None: sfp_vendor_oui_data = sfpi_obj.parse_vendor_oui(sfp_vendor_oui_raw, 0) - sfp_vendor_date_raw = self.__read_eeprom_specific_bytes((offset + XCVR_VENDOR_DATE_OFFSET), XCVR_VENDOR_DATE_WIDTH) + sfp_vendor_date_raw = self.__read_eeprom_specific_bytes( + (offset + XCVR_VENDOR_DATE_OFFSET), XCVR_VENDOR_DATE_WIDTH) if sfp_vendor_date_raw is not None: sfp_vendor_date_data = sfpi_obj.parse_vendor_date(sfp_vendor_date_raw, 0) - sfp_vendor_name_raw = self.__read_eeprom_specific_bytes( (offset + vendor_name_offset), XCVR_VENDOR_NAME_WIDTH) sfp_vendor_name_data = sfpi_obj.parse_vendor_name( @@ -327,7 +328,8 @@ def get_transceiver_info(self): xcvr_info_dict['hardware_rev'] = sfp_vendor_rev_data['data']['Vendor Rev']['value'] if sfp_vendor_rev_data else 'N/A' xcvr_info_dict['serial'] = sfp_vendor_sn_data['data']['Vendor SN']['value'] if sfp_vendor_sn_data else 'N/A' xcvr_info_dict['vendor_oui'] = sfp_vendor_oui_data['data']['Vendor OUI']['value'] if sfp_vendor_oui_data else 'N/A' - xcvr_info_dict['vendor_date'] = sfp_vendor_date_data['data']['VendorDataCode(YYYY-MM-DD Lot)']['value'] if sfp_vendor_date_data else 'N/A' + xcvr_info_dict['vendor_date'] = sfp_vendor_date_data['data'][ + 'VendorDataCode(YYYY-MM-DD Lot)']['value'] if sfp_vendor_date_data else 'N/A' xcvr_info_dict['cable_type'] = "Unknown" xcvr_info_dict['cable_length'] = "Unknown" @@ -342,9 +344,10 @@ def get_transceiver_info(self): compliance_code_dict[key] = sfp_interface_bulk_data['data']['Specification compliance']['value'][key]['value'] xcvr_info_dict['specification_compliance'] = str(compliance_code_dict) - nkey='Nominal Bit Rate(100Mbs)' + nkey = 'Nominal Bit Rate(100Mbs)' if nkey in sfp_interface_bulk_data['data']: - xcvr_info_dict['nominal_bit_rate'] = str(sfp_interface_bulk_data['data']['Nominal Bit Rate(100Mbs)']['value']) + xcvr_info_dict['nominal_bit_rate'] = str( + sfp_interface_bulk_data['data']['Nominal Bit Rate(100Mbs)']['value']) else: xcvr_info_dict['nominal_bit_rate'] = 'N/A' elif sfp_type == 'OSFP': @@ -360,7 +363,8 @@ def get_transceiver_info(self): compliance_code_dict[key] = sfp_interface_bulk_data['data']['Specification compliance']['value'][key]['value'] xcvr_info_dict['specification_compliance'] = str(compliance_code_dict) - xcvr_info_dict['nominal_bit_rate'] = str(sfp_interface_bulk_data['data']['NominalSignallingRate(UnitsOf100Mbd)']['value']) + xcvr_info_dict['nominal_bit_rate'] = str( + sfp_interface_bulk_data['data']['NominalSignallingRate(UnitsOf100Mbd)']['value']) return xcvr_info_dict @@ -414,24 +418,24 @@ def get_transceiver_bulk_status(self): qsfp_dom_capability_raw = self.__read_eeprom_specific_bytes( (offset_xcvr + XCVR_DOM_CAPABILITY_OFFSET), XCVR_DOM_CAPABILITY_WIDTH) if qsfp_dom_capability_raw is not None: - qspf_dom_capability_data = sfpi_obj.parse_qsfp_dom_capability( + qspf_dom_capability_data = sfpi_obj.parse_dom_capability( qsfp_dom_capability_raw, 0) else: return None - dom_temperature_raw = self.__read_eeprom_specific_bytes( (offset + QSFP_TEMPE_OFFSET), QSFP_TEMPE_WIDTH) + dom_temperature_raw = self.__read_eeprom_specific_bytes((offset + QSFP_TEMPE_OFFSET), QSFP_TEMPE_WIDTH) if dom_temperature_raw is not None: dom_temperature_data = sfpd_obj.parse_temperature(dom_temperature_raw, 0) else: return None - dom_voltage_raw = self.__read_eeprom_specific_bytes( (offset + QSFP_VOLT_OFFSET), QSFP_VOLT_WIDTH) + dom_voltage_raw = self.__read_eeprom_specific_bytes((offset + QSFP_VOLT_OFFSET), QSFP_VOLT_WIDTH) if dom_voltage_raw is not None: dom_voltage_data = sfpd_obj.parse_voltage(dom_voltage_raw, 0) else: return None - qsfp_dom_rev_raw = self.__read_eeprom_specific_bytes( (offset + QSFP_DOM_REV_OFFSET), QSFP_DOM_REV_WIDTH) + qsfp_dom_rev_raw = self.__read_eeprom_specific_bytes((offset + QSFP_DOM_REV_OFFSET), QSFP_DOM_REV_WIDTH) if qsfp_dom_rev_raw is not None: qsfp_dom_rev_data = sfpd_obj.parse_sfp_dom_rev(qsfp_dom_rev_raw, 0) else: @@ -446,7 +450,8 @@ def get_transceiver_bulk_status(self): qsfp_dom_rev = qsfp_dom_rev_data['data']['dom_rev']['value'] qsfp_tx_power_support = qspf_dom_capability_data['data']['Tx_power_support']['value'] if (qsfp_dom_rev[0:8] != 'SFF-8636' or (qsfp_dom_rev[0:8] == 'SFF-8636' and qsfp_tx_power_support != 'on')): - dom_channel_monitor_raw = self.__read_eeprom_specific_bytes((offset + QSFP_CHANNL_MON_OFFSET), QSFP_CHANNL_MON_WIDTH) + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_CHANNL_MON_OFFSET), QSFP_CHANNL_MON_WIDTH) if dom_channel_monitor_raw is not None: dom_channel_monitor_data = sfpd_obj.parse_channel_monitor_params(dom_channel_monitor_raw, 0) else: @@ -457,13 +462,14 @@ def get_transceiver_bulk_status(self): xcvr_dom_info_dict['tx3power'] = 'N/A' xcvr_dom_info_dict['tx4power'] = 'N/A' else: - dom_channel_monitor_raw = self.__read_eeprom_specific_bytes((offset + QSFP_CHANNL_MON_OFFSET), QSFP_CHANNL_MON_WITH_TX_POWER_WIDTH) + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + QSFP_CHANNL_MON_OFFSET), QSFP_CHANNL_MON_WITH_TX_POWER_WIDTH) if dom_channel_monitor_raw is not None: - dom_channel_monitor_data = sfpd_obj.parse_channel_monitor_params_with_tx_power(dom_channel_monitor_raw, 0) + dom_channel_monitor_data = sfpd_obj.parse_channel_monitor_params_with_tx_power( + dom_channel_monitor_raw, 0) else: return None - xcvr_dom_info_dict['tx1power'] = dom_channel_monitor_data['data']['TX1Power']['value'] xcvr_dom_info_dict['tx2power'] = dom_channel_monitor_data['data']['TX2Power']['value'] xcvr_dom_info_dict['tx3power'] = dom_channel_monitor_data['data']['TX3Power']['value'] @@ -489,19 +495,20 @@ def get_transceiver_bulk_status(self): if sfpd_obj is None: return None - dom_temperature_raw = self.__read_eeprom_specific_bytes( (offset + SFP_TEMPE_OFFSET), SFP_TEMPE_WIDTH) + dom_temperature_raw = self.__read_eeprom_specific_bytes((offset + SFP_TEMPE_OFFSET), SFP_TEMPE_WIDTH) if dom_temperature_raw is not None: dom_temperature_data = sfpd_obj.parse_temperature(dom_temperature_raw, 0) else: return None - dom_voltage_raw = self.__read_eeprom_specific_bytes( (offset + SFP_VOLT_OFFSET), SFP_VOLT_WIDTH) + dom_voltage_raw = self.__read_eeprom_specific_bytes((offset + SFP_VOLT_OFFSET), SFP_VOLT_WIDTH) if dom_voltage_raw is not None: dom_voltage_data = sfpd_obj.parse_voltage(dom_voltage_raw, 0) else: return None - dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( (offset + SFP_CHANNL_MON_OFFSET), SFP_CHANNL_MON_WIDTH) + dom_channel_monitor_raw = self.__read_eeprom_specific_bytes( + (offset + SFP_CHANNL_MON_OFFSET), SFP_CHANNL_MON_WIDTH) if dom_channel_monitor_raw is not None: dom_channel_monitor_data = sfpd_obj.parse_channel_monitor_params(dom_channel_monitor_raw, 0) else: @@ -527,7 +534,6 @@ def get_transceiver_bulk_status(self): xcvr_dom_info_dict['reset_status'] = self.get_reset_status() xcvr_dom_info_dict['lp_mode'] = self.get_lpmode() - return xcvr_dom_info_dict def get_transceiver_threshold_info(self): @@ -591,7 +597,8 @@ def get_transceiver_threshold_info(self): xcvr_dom_threshold_info_dict['vcchighwarning'] = module_threshold_data['VccHighWarning']['value'] xcvr_dom_threshold_info_dict['vcclowwarning'] = module_threshold_data['VccLowWarning']['value'] - dom_thres_raw = self.__read_eeprom_specific_bytes(QSFP_CHANNEL_THRESHOLD_OFFSET, QSFP_CHANNEL_THRESHOLD_WIDTH) + dom_thres_raw = self.__read_eeprom_specific_bytes( + QSFP_CHANNEL_THRESHOLD_OFFSET, QSFP_CHANNEL_THRESHOLD_WIDTH) if dom_thres_raw: channel_threshold_values = sfpd_obj.parse_channel_threshold_values( dom_thres_raw, 0) @@ -647,8 +654,6 @@ def get_transceiver_threshold_info(self): xcvr_dom_threshold_info_dict['rxpowerhighwarning'] = dom_module_threshold_data['data']['RXPowerHighWarning']['value'] xcvr_dom_threshold_info_dict['rxpowerlowwarning'] = dom_module_threshold_data['data']['RXPowerLowWarning']['value'] - - return xcvr_dom_threshold_info_dict def get_reset_status(self): @@ -668,7 +673,7 @@ def get_reset_status(self): status = int(output['status'].rstrip()) - if status==1: + if status == 1: reset_status = True else: reset_status = False @@ -715,13 +720,13 @@ def get_rx_los(self): else: status = int(output['status'].rstrip()) - if status==1: + if status == 1: rx_los = True else: rx_los = False return rx_los - + def get_tx_fault(self): """ Retrieves the TX fault status of SFP @@ -761,7 +766,7 @@ def get_tx_fault(self): else: status = int(output['status'].rstrip()) - if status==1: + if status == 1: tx_fault = True else: tx_fault = False @@ -821,7 +826,7 @@ def get_tx_disable(self): else: status = int(output['status'].rstrip()) - if status==1: + if status == 1: tx_disable = True else: tx_disable = False @@ -852,7 +857,7 @@ def get_tx_disable_channel(self): tx_disabled |= 1 << i return tx_disabled else: - # SFP doesnt support this + # SFP doesnt support this return 0 def get_lpmode(self): @@ -884,13 +889,15 @@ def get_lpmode(self): status = ord(eeprom.read(1)) if ((status & 0x3) == 0x3): - lpmode = True # Low Power Mode if "Power override" bit is 1 and "Power set" bit is 1 + # Low Power Mode if "Power override" bit is 1 and "Power set" bit is 1 + lpmode = True else: - lpmode = False # High Power Mode if one of the following conditions is matched: - # 1. "Power override" bit is 0 - # 2. "Power override" bit is 1 and "Power set" bit is 0 + # High Power Mode if one of the following conditions is matched: + # 1. "Power override" bit is 0 + # 2. "Power override" bit is 1 and "Power set" bit is 0 + lpmode = False except IOError as e: - print "Error: unable to open file: %s" % str(e) + print("Error: unable to open file: %s" % str(e)) return False finally: if eeprom is not None: @@ -919,7 +926,6 @@ def get_power_override(self): if not self.get_presence(): return power_override - if self.is_osfp_port: pass elif self.is_qsfp_port: @@ -1032,7 +1038,7 @@ def reset(self): # TODO: Implement a wrapper set function to write the sequence path = self.pddf_obj.get_path(device, 'xcvr_reset') - # TODO: put the optic based reset logic using EEPROM + # TODO: put the optic based reset logic using EEPROM if path is None: pass else: @@ -1040,7 +1046,7 @@ def reset(self): f = open(path, 'r+') except IOError as e: return False - + try: f.seek(0) f.write('1') @@ -1054,7 +1060,7 @@ def reset(self): status = False return status - + def tx_disable(self, tx_disable): """ Disable SFP TX for all channels @@ -1087,13 +1093,13 @@ def tx_disable(self, tx_disable): eeprom_f.seek(QSFP_CONTROL_OFFSET) eeprom_f.write(buf[0]) except IOError as e: - print "Error: unable to open file: %s" % str(e) + print("Error: unable to open file: %s" % str(e)) return False finally: if eeprom_f is not None: eeprom_f.close() time.sleep(0.01) - + status = True else: status_control_raw = self.__read_eeprom_specific_bytes( @@ -1113,7 +1119,7 @@ def tx_disable(self, tx_disable): eeprom_f.seek(SFP_STATUS_CONTROL_OFFSET) eeprom_f.write(buf[0]) except Exception as e: - print("Error: unable to open file: %s" % str(e)) + print(("Error: unable to open file: %s" % str(e))) return False finally: if eeprom_f: @@ -1168,7 +1174,7 @@ def tx_disable_channel(self, channel, disable): eeprom_f.seek(QSFP_CONTROL_OFFSET) eeprom_f.write(buf[0]) except IOError as e: - print "Error: unable to open file: %s" % str(e) + print("Error: unable to open file: %s" % str(e)) return False finally: if eeprom_f is not None: @@ -1208,7 +1214,7 @@ def set_lpmode(self, lpmode): return False # Fill in write buffer - regval = 0x3 if lpmode else 0x1 # 0x3:Low Power Mode, 0x1:High Power Mode + regval = 0x3 if lpmode else 0x1 # 0x3:Low Power Mode, 0x1:High Power Mode buffer = create_string_buffer(1) buffer[0] = chr(regval) @@ -1218,7 +1224,7 @@ def set_lpmode(self, lpmode): eeprom_f.write(buffer[0]) return True except IOError as e: - print "Error: unable to open file: %s" % str(e) + print("Error: unable to open file: %s" % str(e)) return False finally: if eeprom_f is not None: @@ -1286,7 +1292,7 @@ def set_power_override(self, power_override, power_set): eeprom_f.seek(QSFP_POWEROVERRIDE_OFFSET) eeprom_f.write(buffer[0]) except IOError as e: - print "Error: unable to open file: %s" % str(e) + print("Error: unable to open file: %s" % str(e)) return False finally: if eeprom_f is not None: @@ -1298,14 +1304,13 @@ def set_power_override(self, power_override, power_set): return status - def get_name(self): """ Retrieves the name of the device Returns: string: The name of the device """ - # Name of the port/sfp ? + # Name of the port/sfp ? return 'PORT{}'.format(self.port_index) def get_presence(self): diff --git a/platform/pddf/platform-api-pddf-base/sonic_platform_pddf_base/pddf_thermal.py b/platform/pddf/platform-api-pddf-base/sonic_platform_pddf_base/pddf_thermal.py index 01cd4080db10..cd09041e152f 100755 --- a/platform/pddf/platform-api-pddf-base/sonic_platform_pddf_base/pddf_thermal.py +++ b/platform/pddf/platform-api-pddf-base/sonic_platform_pddf_base/pddf_thermal.py @@ -1,6 +1,6 @@ #!/usr/bin/env python -# All the supported Temperature Sensor SysFS aattributes are +# All the supported Temperature Sensor SysFS aattributes are #- temp1_high_crit_threshold #- temp1_high_threshold #- temp1_input @@ -13,7 +13,6 @@ raise ImportError(str(e) + "- required module not found") - class PddfThermal(ThermalBase): """PDDF generic Thermal class""" pddf_obj = {} @@ -37,24 +36,23 @@ def get_name(self): if 'display_name' in self.thermal_obj['dev_attr']: return str(self.thermal_obj['dev_attr']['display_name']) # In case of errors - return (self.thermal_obj_name) + return (self.thermal_obj_name) def get_temperature(self): output = self.pddf_obj.get_attr_name_output(self.thermal_obj_name, "temp1_input") if not output: - return None + return None if output['status'].isalpha(): attr_value = None else: attr_value = float(output['status']) - - if output['mode']=='bmc': - return attr_value + + if output['mode'] == 'bmc': + return attr_value else: return (attr_value/float(1000)) - def get_high_threshold(self): output = self.pddf_obj.get_attr_name_output(self.thermal_obj_name, "temp1_high_threshold") if not output: @@ -65,12 +63,11 @@ def get_high_threshold(self): else: attr_value = float(output['status']) - if output['mode']=='bmc': - return attr_value + if output['mode'] == 'bmc': + return attr_value else: return (attr_value/float(1000)) - def get_low_threshold(self): output = self.pddf_obj.get_attr_name_output(self.thermal_obj_name, "temp1_low_threshold") if not output: @@ -80,31 +77,29 @@ def get_low_threshold(self): attr_value = None else: attr_value = float(output['status']) - - if output['mode']=='bmc': - return attr_value + + if output['mode'] == 'bmc': + return attr_value else: return (attr_value/float(1000)) - def set_high_threshold(self, temperature): node = self.pddf_obj.get_path(self.thermal_obj_name, "temp1_high_threshold") if node is None: - print "ERROR %s does not exist"%node + print("ERROR %s does not exist" % node) return None - - cmd = "echo '%d' > %s"%(temperature * 1000, node) - os.system(cmd) - return (True) + cmd = "echo '%d' > %s" % (temperature * 1000, node) + os.system(cmd) + return (True) def set_low_threshold(self, temperature): node = self.pddf_obj.get_path(self.thermal_obj_name, "temp1_low_threshold") if node is None: - print "ERROR %s does not exist"%node + print("ERROR %s does not exist" % node) return None - cmd = "echo '%d' > %s"%(temperature * 1000, node) + cmd = "echo '%d' > %s" % (temperature * 1000, node) os.system(cmd) return (True) @@ -126,12 +121,11 @@ def get_high_critical_threshold(self): else: attr_value = float(output['status']) - if output['mode']=='bmc': + if output['mode'] == 'bmc': return attr_value else: return (attr_value/float(1000)) - def get_low_critical_threshold(self): """ Retrieves the low critical threshold temperature of thermal @@ -149,26 +143,25 @@ def get_low_critical_threshold(self): else: attr_value = float(output['status']) - if output['mode']=='bmc': + if output['mode'] == 'bmc': return attr_value else: return (attr_value/float(1000)) - # Helper Functions + def get_temp_label(self): - if 'bmc' in self.pddf_obj.data[self.thermal_obj_name].keys(): - return None + if 'bmc' in self.pddf_obj.data[self.thermal_obj_name].keys(): + return None else: if self.thermal_obj_name in self.pddf_obj.data.keys(): - dev= self.pddf_obj.data[self.thermal_obj_name] + dev = self.pddf_obj.data[self.thermal_obj_name] topo_info = dev['i2c']['topo_info'] - label="%s-i2c-%d-%x" % (topo_info['dev_type'], int(topo_info['parent_bus'], 0), - int(topo_info['dev_addr'], 0)) - return (label) + label = "%s-i2c-%d-%x" % (topo_info['dev_type'], int(topo_info['parent_bus'], 0), + int(topo_info['dev_addr'], 0)) + return (label) else: return None - def dump_sysfs(self): return self.pddf_obj.cli_dump_dsysfs('temp-sensors') diff --git a/platform/pddf/platform-api-pddf-base/sonic_platform_pddf_base/pddfparse.py b/platform/pddf/platform-api-pddf-base/sonic_platform_pddf_base/pddfparse.py index aa47beaa0fc7..6ca59206fd56 100755 --- a/platform/pddf/platform-api-pddf-base/sonic_platform_pddf_base/pddfparse.py +++ b/platform/pddf/platform-api-pddf-base/sonic_platform_pddf_base/pddfparse.py @@ -8,24 +8,24 @@ import time import unicodedata -bmc_cache={} -cache={} +bmc_cache = {} +cache = {} SONIC_CFGGEN_PATH = '/usr/local/bin/sonic-cfggen' HWSKU_KEY = 'DEVICE_METADATA.localhost.hwsku' PLATFORM_KEY = 'DEVICE_METADATA.localhost.platform' -dirname=os.path.dirname(os.path.realpath(__file__)) +dirname = os.path.dirname(os.path.realpath(__file__)) color_map = { - "STATUS_LED_COLOR_GREEN" : "green", - "STATUS_LED_COLOR_RED" : "red", - "STATUS_LED_COLOR_AMBER" : "amber", - "STATUS_LED_COLOR_BLUE" : "blue", - "STATUS_LED_COLOR_GREEN_BLINK" : "blinking green", - "STATUS_LED_COLOR_RED_BLINK" : "blinking red", - "STATUS_LED_COLOR_AMBER_BLINK" : "blinking amber", - "STATUS_LED_COLOR_BLUE_BLINK" : "blinking blue", - "STATUS_LED_COLOR_OFF" : "off" + "STATUS_LED_COLOR_GREEN": "green", + "STATUS_LED_COLOR_RED": "red", + "STATUS_LED_COLOR_AMBER": "amber", + "STATUS_LED_COLOR_BLUE": "blue", + "STATUS_LED_COLOR_GREEN_BLINK": "blinking green", + "STATUS_LED_COLOR_RED_BLINK": "blinking red", + "STATUS_LED_COLOR_AMBER_BLINK": "blinking amber", + "STATUS_LED_COLOR_BLUE_BLINK": "blinking blue", + "STATUS_LED_COLOR_OFF": "off" } @@ -37,17 +37,16 @@ def __init__(self): try: with open('/usr/share/sonic/platform/pddf/pddf-device.json') as f: - self.data = json.load(f) + self.data = json.load(f) except IOError: if os.path.exists('/usr/share/sonic/platform'): os.unlink("/usr/share/sonic/platform") - - self.data_sysfs_obj={} - self.sysfs_obj={} - + self.data_sysfs_obj = {} + self.sysfs_obj = {} # Returns platform and HW SKU + def get_platform_and_hwsku(self): try: proc = subprocess.Popen([SONIC_CFGGEN_PATH, '-H', '-v', PLATFORM_KEY], @@ -65,7 +64,7 @@ def get_platform_and_hwsku(self): stdout = proc.communicate()[0] proc.wait() hwsku = stdout.rstrip('\n') - except OSError, e: + except OSError as e: raise OSError("Cannot detect platform") return (platform, hwsku) @@ -75,16 +74,15 @@ def get_platform_and_hwsku(self): ################################################################################################################# def runcmd(self, cmd): rc = os.system(cmd) - if rc!=0: - print "%s -- command failed"%cmd - return rc + if rc != 0: + print("%s -- command failed" % cmd) + return rc def get_dev_idx(self, dev, ops): - parent=dev['dev_info']['virt_parent'] - pdev=self.data[parent] - - return pdev['dev_attr']['dev_idx'] + parent = dev['dev_info']['virt_parent'] + pdev = self.data[parent] + return pdev['dev_attr']['dev_idx'] def get_path(self, target, attr): aa = target + attr @@ -95,88 +93,85 @@ def get_path(self, target, attr): string = None p = re.search(r'\d+$', target) if p is None: - for bb in filter(re.compile(target).search,self.data.keys()): - path = self.dev_parse(self.data[bb], { "cmd": "show_attr", "target":bb, "attr":attr }) + for bb in filter(re.compile(target).search, self.data.keys()): + path = self.dev_parse(self.data[bb], {"cmd": "show_attr", "target": bb, "attr": attr}) if path != "": string = path else: if target in self.data.keys(): - path = self.dev_parse(self.data[target], { "cmd": "show_attr", "target":target, "attr":attr }) + path = self.dev_parse(self.data[target], {"cmd": "show_attr", "target": target, "attr": attr}) if path != "": string = path - if string is not None: string = string.rstrip() - cache[aa]=string + cache[aa] = string return string - def get_device_type(self, key): - if not key in self.data.keys(): - return None + if key not in self.data.keys(): + return None return self.data[key]['dev_info']['device_type'] def get_platform(self): return self.data['PLATFORM'] def get_num_psu_fans(self, dev): - if not dev in self.data.keys(): + if dev not in self.data.keys(): return 0 - if not 'num_psu_fans' in self.data[dev]['dev_attr']: + if 'num_psu_fans' not in self.data[dev]['dev_attr']: return 0 - + return self.data[dev]['dev_attr']['num_psu_fans'] - def get_led_path(self): - return ("pddf/devices/led") + def get_led_path(self): + return ("pddf/devices/led") - def get_led_cur_state_path(self): - return ("pddf/devices/led/cur_state") + def get_led_cur_state_path(self): + return ("pddf/devices/led/cur_state") - def get_led_color(self): - color_f="/sys/kernel/pddf/devices/led/cur_state/color" + def get_led_color(self): + color_f = "/sys/kernel/pddf/devices/led/cur_state/color" try: - with open(color_f, 'r') as f: - color = f.read().strip("\r\n") + with open(color_f, 'r') as f: + color = f.read().strip("\r\n") except IOError: - return ("Error") + return ("Error") - return (color_map[color]) + return (color_map[color]) - def get_led_color_devtype(self, key): - attr_list=self.data[key]['i2c']['attr_list'] + attr_list = self.data[key]['i2c']['attr_list'] for attr in attr_list: if 'attr_devtype' in attr: - return attr['attr_devtype'].strip() + return attr['attr_devtype'].strip() else: - return 'cpld' + return 'cpld' def get_led_color_from_gpio(self, led_device_name): - attr_list=self.data[led_device_name]['i2c']['attr_list'] - attr=attr_list[0] + attr_list = self.data[led_device_name]['i2c']['attr_list'] + attr = attr_list[0] if ':' in attr['bits']: - bits_list=attr['bits'].split(':') + bits_list = attr['bits'].split(':') bits_list.sort(reverse=True) - max_bit=int(bits_list[0]) + max_bit = int(bits_list[0]) else: - max_bit=0 - base_offset=int(attr['swpld_addr_offset'], 16) + max_bit = 0 + base_offset = int(attr['swpld_addr_offset'], 16) value = 0 bit = 0 while bit <= max_bit: - offset=base_offset + bit + offset = base_offset + bit if 'attr_devname' in attr: attr_path = self.get_gpio_attr_path(self.data[attr['attr_devname']], hex(offset)) else: - status= "[FAILED] attr_devname is not configured" - return (status) + status = "[FAILED] attr_devname is not configured" + return (status) if not os.path.exists(attr_path): - status= "[FAILED] {} does not exist".format(attr_path) - return (status) + status = "[FAILED] {} does not exist".format(attr_path) + return (status) cmd = 'cat ' + attr_path gpio_value = subprocess.check_output(cmd, shell=True) value |= int(gpio_value) << bit @@ -184,110 +179,107 @@ def get_led_color_from_gpio(self, led_device_name): for attr in attr_list: if int(attr['value'].strip(), 16) == value: - return(color_map[attr['attr_name']]) - return (color_map['STATUS_LED_COLOR_OFF']) - + return(color_map[attr['attr_name']]) + return (color_map['STATUS_LED_COLOR_OFF']) def get_led_color_from_cpld(self, led_device_name): - index=self.data[led_device_name]['dev_attr']['index'] - device_name=self.data[led_device_name]['dev_info']['device_name'] + index = self.data[led_device_name]['dev_attr']['index'] + device_name = self.data[led_device_name]['dev_info']['device_name'] self.create_attr('device_name', device_name, self.get_led_path()) self.create_attr('index', index, self.get_led_path()) self.create_attr('dev_ops', 'get_status', self.get_led_path()) return self.get_led_color() def set_led_color_from_gpio(self, led_device_name, color): - attr_list=self.data[led_device_name]['i2c']['attr_list'] + attr_list = self.data[led_device_name]['i2c']['attr_list'] for attr in attr_list: if attr['attr_name'].strip() == color.strip(): - base_offset=int(attr['swpld_addr_offset'], 16) - if ':' in attr['bits']: - bits_list=attr['bits'].split(':') - bits_list.sort(reverse=True) - max_bit = int(bits_list[0]) - else: - max_bit=0 - value=int(attr['value'], 16) - i = 0 - while i <= max_bit: - _value =(value>>i) & 1 - base_offset += i - attr_path = self.get_gpio_attr_path(self.data[attr['attr_devname']], hex(base_offset)) - i += 1 - try: - cmd = "echo {} > {}".format(_value, attr_path) - self.runcmd(cmd) - except Exception as e: - print "Invalid gpio path : " + attr_path - return (False) + base_offset = int(attr['swpld_addr_offset'], 16) + if ':' in attr['bits']: + bits_list = attr['bits'].split(':') + bits_list.sort(reverse=True) + max_bit = int(bits_list[0]) + else: + max_bit = 0 + value = int(attr['value'], 16) + i = 0 + while i <= max_bit: + _value = (value >> i) & 1 + base_offset += i + attr_path = self.get_gpio_attr_path(self.data[attr['attr_devname']], hex(base_offset)) + i += 1 + try: + cmd = "echo {} > {}".format(_value, attr_path) + self.runcmd(cmd) + except Exception as e: + print("Invalid gpio path : " + attr_path) + return (False) return (True) def set_led_color_from_cpld(self, led_device_name, color): - index=self.data[led_device_name]['dev_attr']['index'] - device_name=self.data[led_device_name]['dev_info']['device_name'] + index = self.data[led_device_name]['dev_attr']['index'] + device_name = self.data[led_device_name]['dev_info']['device_name'] self.create_attr('device_name', device_name, self.get_led_path()) self.create_attr('index', index, self.get_led_path()) self.create_attr('color', color, self.get_led_cur_state_path()) self.create_attr('dev_ops', 'set_status', self.get_led_path()) - return (True) - + return (True) def get_system_led_color(self, led_device_name): - if (not led_device_name in self.data.keys()): - status= "[FAILED] " + led_device_name + " is not configured" + if led_device_name not in self.data.keys(): + status = "[FAILED] " + led_device_name + " is not configured" return (status) type = self.get_led_color_devtype(led_device_name) if type == 'gpio': - color = self.get_led_color_from_gpio(led_device_name) - elif type == 'cpld': - color = self.get_led_color_from_cpld(led_device_name) + color = self.get_led_color_from_gpio(led_device_name) + elif type == 'cpld': + color = self.get_led_color_from_cpld(led_device_name) return color def set_system_led_color(self, led_device_name, color): - result, msg = self.is_supported_sysled_state(led_device_name, color); + result, msg = self.is_supported_sysled_state(led_device_name, color) if result == False: - print msg - return (result) + print(msg) + return (result) type = self.get_led_color_devtype(led_device_name) if type == 'gpio': - return (self.set_led_color_from_gpio(led_device_name, color)) - else: - return (self.set_led_color_from_cpld(led_device_name, color)) + return (self.set_led_color_from_gpio(led_device_name, color)) + else: + return (self.set_led_color_from_cpld(led_device_name, color)) ################################################################################################################### # SHOW ATTRIBIUTES DEFS ################################################################################################################### def is_led_device_configured(self, device_name, attr_name): if device_name in self.data.keys(): - attr_list=self.data[device_name]['i2c']['attr_list'] + attr_list = self.data[device_name]['i2c']['attr_list'] for attr in attr_list: if attr['attr_name'].strip() == attr_name.strip(): return (True) return (False) - def show_device_sysfs(self, dev, ops): - parent=dev['dev_info']['device_parent'] - pdev=self.data[parent] + parent = dev['dev_info']['device_parent'] + pdev = self.data[parent] if pdev['dev_info']['device_parent'] == 'SYSTEM': - return "/sys/bus/i2c/devices/"+"i2c-%d"%int(pdev['i2c']['topo_info']['dev_addr'], 0) + return "/sys/bus/i2c/devices/"+"i2c-%d" % int(pdev['i2c']['topo_info']['dev_addr'], 0) return self.show_device_sysfs(pdev, ops) + "/" + "i2c-%d" % int(dev['i2c']['topo_info']['parent_bus'], 0) + # This is alid for 'at24' type of EEPROM devices. Only one attribtue 'eeprom' - # This is alid for 'at24' type of EEPROM devices. Only one attribtue 'eeprom' def show_attr_eeprom_device(self, dev, ops): str = "" - attr_name=ops['attr'] - attr_list=dev['i2c']['attr_list'] - KEY="eeprom" - dsysfs_path="" + attr_name = ops['attr'] + attr_list = dev['i2c']['attr_list'] + KEY = "eeprom" + dsysfs_path = "" - if not KEY in self.data_sysfs_obj: - self.data_sysfs_obj[KEY]=[] + if KEY not in self.data_sysfs_obj: + self.data_sysfs_obj[KEY] = [] for attr in attr_list: if attr_name == attr['attr_name'] or attr_name == 'all': @@ -297,28 +289,27 @@ def show_attr_eeprom_device(self, dev, ops): real_name = attr['attr_name'] dsysfs_path = self.show_device_sysfs(dev, ops) + \ - "/%d-00%x"%(int(dev['i2c']['topo_info']['parent_bus'], 0), - int(dev['i2c']['topo_info']['dev_addr'], 0)) + \ - "/%s"%real_name - if not dsysfs_path in self.data_sysfs_obj[KEY]: + "/%d-00%x" % (int(dev['i2c']['topo_info']['parent_bus'], 0), + int(dev['i2c']['topo_info']['dev_addr'], 0)) + \ + "/%s" % real_name + if dsysfs_path not in self.data_sysfs_obj[KEY]: self.data_sysfs_obj[KEY].append(dsysfs_path) str += dsysfs_path+"\n" return str def show_attr_gpio_device(self, dev, ops): ret = "" - KEY="gpio" - if not KEY in self.data_sysfs_obj: - self.data_sysfs_obj[KEY]=[] + KEY = "gpio" + if KEY not in self.data_sysfs_obj: + self.data_sysfs_obj[KEY] = [] return ret - def show_attr_mux_device(self, dev, ops): ret = "" - KEY="mux" - if not KEY in self.data_sysfs_obj: - self.data_sysfs_obj[KEY]=[] + KEY = "mux" + if KEY not in self.data_sysfs_obj: + self.data_sysfs_obj[KEY] = [] return ret @@ -330,24 +321,24 @@ def get_gpio_attr_path(self, dev, offset): return path def show_attr_psu_i2c_device(self, dev, ops): - target=ops['target'] - attr_name=ops['attr'] + target = ops['target'] + attr_name = ops['attr'] ret = "" - KEY="psu" - dsysfs_path="" + KEY = "psu" + dsysfs_path = "" - if not KEY in self.data_sysfs_obj: - self.data_sysfs_obj[KEY]=[] + if KEY not in self.data_sysfs_obj: + self.data_sysfs_obj[KEY] = [] - if target == 'all' or target == dev['dev_info']['virt_parent'] : - attr_list=dev['i2c']['attr_list'] + if target == 'all' or target == dev['dev_info']['virt_parent']: + attr_list = dev['i2c']['attr_list'] for attr in attr_list: - if attr_name == attr['attr_name'] or attr_name == 'all' : + if attr_name == attr['attr_name'] or attr_name == 'all': if 'attr_devtype' in attr.keys() and attr['attr_devtype'] == "gpio": # Check and enable the gpio from class attr_path = self.get_gpio_attr_path(self.data[attr['attr_devname']], attr['attr_offset']) if (os.path.exists(attr_path)): - if not attr_path in self.data_sysfs_obj[KEY]: + if attr_path not in self.data_sysfs_obj[KEY]: self.data_sysfs_obj[KEY].append(attr_path) ret += attr_path + '\n' else: @@ -357,29 +348,26 @@ def show_attr_psu_i2c_device(self, dev, ops): real_name = attr['attr_name'] dsysfs_path = self.show_device_sysfs(dev, ops) + \ - "/%d-00%x" %(int(dev['i2c']['topo_info']['parent_bus'], 0), - int(dev['i2c']['topo_info']['dev_addr'], 0)) + \ - "/%s"%real_name - if not dsysfs_path in self.data_sysfs_obj[KEY]: + "/%d-00%x" % (int(dev['i2c']['topo_info']['parent_bus'], 0), + int(dev['i2c']['topo_info']['dev_addr'], 0)) + \ + "/%s" % real_name + if dsysfs_path not in self.data_sysfs_obj[KEY]: self.data_sysfs_obj[KEY].append(dsysfs_path) ret += dsysfs_path+"\n" return ret - def show_attr_psu_device(self, dev, ops): - return self.show_attr_psu_i2c_device(dev, ops ) - + return self.show_attr_psu_i2c_device(dev, ops) def show_attr_fan_device(self, dev, ops): ret = "" - attr_name=ops['attr'] - attr_list=dev['i2c']['attr_list'] - KEY="fan" - dsysfs_path="" - - if not KEY in self.data_sysfs_obj: - self.data_sysfs_obj[KEY]=[] + attr_name = ops['attr'] + attr_list = dev['i2c']['attr_list'] + KEY = "fan" + dsysfs_path = "" + if KEY not in self.data_sysfs_obj: + self.data_sysfs_obj[KEY] = [] for attr in attr_list: if attr_name == attr['attr_name'] or attr_name == 'all': @@ -387,7 +375,7 @@ def show_attr_fan_device(self, dev, ops): # Check and enable the gpio from class attr_path = self.get_gpio_attr_path(self.data[attr['attr_devname']], attr['attr_offset']) if (os.path.exists(attr_path)): - if not attr_path in self.data_sysfs_obj[KEY]: + if attr_path not in self.data_sysfs_obj[KEY]: self.data_sysfs_obj[KEY].append(attr_path) ret += attr_path + '\n' else: @@ -396,11 +384,11 @@ def show_attr_fan_device(self, dev, ops): else: real_name = attr['attr_name'] - dsysfs_path= self.show_device_sysfs(dev, ops) + \ - "/%d-00%x" %(int(dev['i2c']['topo_info']['parent_bus'], 0), - int(dev['i2c']['topo_info']['dev_addr'], 0)) + \ - "/%s"%real_name - if not dsysfs_path in self.data_sysfs_obj[KEY]: + dsysfs_path = self.show_device_sysfs(dev, ops) + \ + "/%d-00%x" % (int(dev['i2c']['topo_info']['parent_bus'], 0), + int(dev['i2c']['topo_info']['dev_addr'], 0)) + \ + "/%s" % real_name + if dsysfs_path not in self.data_sysfs_obj[KEY]: self.data_sysfs_obj[KEY].append(dsysfs_path) ret += dsysfs_path+"\n" return ret @@ -408,19 +396,18 @@ def show_attr_fan_device(self, dev, ops): # This is only valid for LM75 def show_attr_temp_sensor_device(self, dev, ops): str = "" - attr_name=ops['attr'] - attr_list=dev['i2c']['attr_list'] - KEY="temp-sensors" - dsysfs_path="" - - if not KEY in self.data_sysfs_obj: - self.data_sysfs_obj[KEY]=[] + attr_name = ops['attr'] + attr_list = dev['i2c']['attr_list'] + KEY = "temp-sensors" + dsysfs_path = "" + if KEY not in self.data_sysfs_obj: + self.data_sysfs_obj[KEY] = [] for attr in attr_list: if attr_name == attr['attr_name'] or attr_name == 'all': - path = self.show_device_sysfs(dev, ops)+"/%d-00%x/" %(int(dev['i2c']['topo_info']['parent_bus'], 0), - int(dev['i2c']['topo_info']['dev_addr'], 0)) + path = self.show_device_sysfs(dev, ops)+"/%d-00%x/" % (int(dev['i2c']['topo_info']['parent_bus'], 0), + int(dev['i2c']['topo_info']['dev_addr'], 0)) if 'drv_attr_name' in attr.keys(): real_name = attr['drv_attr_name'] else: @@ -428,50 +415,48 @@ def show_attr_temp_sensor_device(self, dev, ops): if (os.path.exists(path)): full_path = glob.glob(path + 'hwmon/hwmon*/' + real_name)[0] - dsysfs_path=full_path - if not dsysfs_path in self.data_sysfs_obj[KEY]: + dsysfs_path = full_path + if dsysfs_path not in self.data_sysfs_obj[KEY]: self.data_sysfs_obj[KEY].append(dsysfs_path) str += full_path + "\n" return str def show_attr_sysstatus_device(self, dev, ops): ret = "" - attr_name=ops['attr'] - attr_list=dev['attr_list'] - KEY="sys-status" - dsysfs_path="" - - if not KEY in self.data_sysfs_obj: - self.data_sysfs_obj[KEY]=[] + attr_name = ops['attr'] + attr_list = dev['attr_list'] + KEY = "sys-status" + dsysfs_path = "" + if KEY not in self.data_sysfs_obj: + self.data_sysfs_obj[KEY] = [] for attr in attr_list: - if attr_name == attr['attr_name'] or attr_name == 'all': - dsysfs_path = "/sys/kernel/pddf/devices/sysstatus/sysstatus_data/" + attr['attr_name'] - if not dsysfs_path in self.data_sysfs_obj[KEY]: - self.data_sysfs_obj[KEY].append(dsysfs_path) - ret += dsysfs_path+"\n" + if attr_name == attr['attr_name'] or attr_name == 'all': + dsysfs_path = "/sys/kernel/pddf/devices/sysstatus/sysstatus_data/" + attr['attr_name'] + if dsysfs_path not in self.data_sysfs_obj[KEY]: + self.data_sysfs_obj[KEY].append(dsysfs_path) + ret += dsysfs_path+"\n" return ret - def show_attr_xcvr_i2c_device(self, dev, ops): - target=ops['target'] - attr_name=ops['attr'] + target = ops['target'] + attr_name = ops['attr'] ret = "" dsysfs_path = "" - KEY="xcvr" - if not KEY in self.data_sysfs_obj: - self.data_sysfs_obj[KEY]=[] + KEY = "xcvr" + if KEY not in self.data_sysfs_obj: + self.data_sysfs_obj[KEY] = [] - if target == 'all' or target == dev['dev_info']['virt_parent'] : - attr_list=dev['i2c']['attr_list'] + if target == 'all' or target == dev['dev_info']['virt_parent']: + attr_list = dev['i2c']['attr_list'] for attr in attr_list: - if attr_name == attr['attr_name'] or attr_name == 'all' : + if attr_name == attr['attr_name'] or attr_name == 'all': if 'attr_devtype' in attr.keys() and attr['attr_devtype'] == "gpio": # Check and enable the gpio from class attr_path = self.get_gpio_attr_path(self.data[attr['attr_devname']], attr['attr_offset']) if (os.path.exists(attr_path)): - if not attr_path in self.data_sysfs_obj[KEY]: + if attr_path not in self.data_sysfs_obj[KEY]: self.data_sysfs_obj[KEY].append(attr_path) ret += attr_path + '\n' else: @@ -481,238 +466,228 @@ def show_attr_xcvr_i2c_device(self, dev, ops): real_name = attr['attr_name'] dsysfs_path = self.show_device_sysfs(dev, ops) + \ - "/%d-00%x" %(int(dev['i2c']['topo_info']['parent_bus'], 0), - int(dev['i2c']['topo_info']['dev_addr'], 0)) + \ - "/%s"%real_name - if not dsysfs_path in self.data_sysfs_obj[KEY]: + "/%d-00%x" % (int(dev['i2c']['topo_info']['parent_bus'], 0), + int(dev['i2c']['topo_info']['dev_addr'], 0)) + \ + "/%s" % real_name + if dsysfs_path not in self.data_sysfs_obj[KEY]: self.data_sysfs_obj[KEY].append(dsysfs_path) ret += dsysfs_path+"\n" return ret - def show_attr_xcvr_device(self, dev, ops): - return self.show_attr_xcvr_i2c_device(dev, ops ) + return self.show_attr_xcvr_i2c_device(dev, ops) def show_attr_cpld_device(self, dev, ops): ret = "" - KEY="cpld" - if not KEY in self.data_sysfs_obj: - self.data_sysfs_obj[KEY]=[] + KEY = "cpld" + if KEY not in self.data_sysfs_obj: + self.data_sysfs_obj[KEY] = [] return ret - ################################################################################################################### # SHOW DEFS ################################################################################################################### + def check_led_cmds(self, key, ops): - name = ops['target']+'_LED' - if (ops['target']=='config' or ops['attr']=='all') or \ - (name==self.data[key]['dev_info']['device_name'] and - ops['attr']==self.data[key]['dev_attr']['index']): - return (True) - else: - return (False) + name = ops['target']+'_LED' + if (ops['target'] == 'config' or ops['attr'] == 'all') or \ + (name == self.data[key]['dev_info']['device_name'] and + ops['attr'] == self.data[key]['dev_attr']['index']): + return (True) + else: + return (False) def dump_sysfs_obj(self, obj, key_type): - if (key_type == 'keys'): - for key in obj.keys(): - print key - return + if (key_type == 'keys'): + for key in obj.keys(): + print(key) + return - for key in obj: - if (key == key_type or key_type == 'all'): - print key+":" - for entry in obj[key]: - print "\t"+entry + for key in obj: + if (key == key_type or key_type == 'all'): + print(key+":") + for entry in obj[key]: + print("\t"+entry) def add_list_sysfs_obj(self, obj, KEY, list): for sysfs in list: - if not sysfs in obj[KEY]: + if sysfs not in obj[KEY]: obj[KEY].append(sysfs) def sysfs_attr(self, key, value, path, obj, obj_key): - sysfs_path="/sys/kernel/%s/%s"%(path, key) - if not sysfs_path in obj[obj_key]: - obj[obj_key].append(sysfs_path) - + sysfs_path = "/sys/kernel/%s/%s" % (path, key) + if sysfs_path not in obj[obj_key]: + obj[obj_key].append(sysfs_path) def sysfs_device(self, attr, path, obj, obj_key): - for key in attr.keys(): - sysfs_path="/sys/kernel/%s/%s"%(path, key) - if not sysfs_path in obj[obj_key]: - obj[obj_key].append(sysfs_path) + for key in attr.keys(): + sysfs_path = "/sys/kernel/%s/%s" % (path, key) + if sysfs_path not in obj[obj_key]: + obj[obj_key].append(sysfs_path) def show_eeprom_device(self, dev, ops): - return - + return def show_mux_device(self, dev, ops): - KEY ='mux' - if not KEY in self.sysfs_obj: - self.sysfs_obj[KEY] = [] - self.sysfs_device(dev['i2c']['topo_info'], "pddf/devices/mux", self.sysfs_obj, KEY) - self.sysfs_device(dev['i2c']['dev_attr'], "pddf/devices/mux", self.sysfs_obj, KEY) - sysfs_path= "/sys/kernel/pddf/devices/mux/dev_ops" - if not sysfs_path in self.sysfs_obj[KEY]: - self.sysfs_obj[KEY].append(sysfs_path) - list=['/sys/kernel/pddf/devices/mux/i2c_type', - '/sys/kernel/pddf/devices/mux/i2c_name', - '/sys/kernel/pddf/devices/mux/error'] - self.add_list_sysfs_obj(self.sysfs_obj, KEY, list) + KEY = 'mux' + if KEY not in self.sysfs_obj: + self.sysfs_obj[KEY] = [] + self.sysfs_device(dev['i2c']['topo_info'], "pddf/devices/mux", self.sysfs_obj, KEY) + self.sysfs_device(dev['i2c']['dev_attr'], "pddf/devices/mux", self.sysfs_obj, KEY) + sysfs_path = "/sys/kernel/pddf/devices/mux/dev_ops" + if sysfs_path not in self.sysfs_obj[KEY]: + self.sysfs_obj[KEY].append(sysfs_path) + list = ['/sys/kernel/pddf/devices/mux/i2c_type', + '/sys/kernel/pddf/devices/mux/i2c_name', + '/sys/kernel/pddf/devices/mux/error'] + self.add_list_sysfs_obj(self.sysfs_obj, KEY, list) def show_gpio_device(self, dev, ops): - KEY ='gpio' - if not KEY in self.sysfs_obj: - self.sysfs_obj[KEY] = [] - self.sysfs_device(dev['i2c']['topo_info'], "pddf/devices/gpio", self.sysfs_obj, KEY) - self.sysfs_device(dev['i2c']['dev_attr'], "pddf/devices/gpio", self.sysfs_obj, KEY) - sysfs_path= "/sys/kernel/pddf/devices/gpio/dev_ops" - if not sysfs_path in self.sysfs_obj[KEY]: - self.sysfs_obj[KEY].append(sysfs_path) - list=['/sys/kernel/pddf/devices/gpio/i2c_type', - '/sys/kernel/pddf/devices/gpio/i2c_name', - '/sys/kernel/pddf/devices/gpio/error'] - self.add_list_sysfs_obj(self.sysfs_obj, KEY, list) - + KEY = 'gpio' + if KEY not in self.sysfs_obj: + self.sysfs_obj[KEY] = [] + self.sysfs_device(dev['i2c']['topo_info'], "pddf/devices/gpio", self.sysfs_obj, KEY) + self.sysfs_device(dev['i2c']['dev_attr'], "pddf/devices/gpio", self.sysfs_obj, KEY) + sysfs_path = "/sys/kernel/pddf/devices/gpio/dev_ops" + if sysfs_path not in self.sysfs_obj[KEY]: + self.sysfs_obj[KEY].append(sysfs_path) + list = ['/sys/kernel/pddf/devices/gpio/i2c_type', + '/sys/kernel/pddf/devices/gpio/i2c_name', + '/sys/kernel/pddf/devices/gpio/error'] + self.add_list_sysfs_obj(self.sysfs_obj, KEY, list) def show_psu_i2c_device(self, dev, ops): - KEY ='psu' - path='pddf/devices/psu/i2c' + KEY = 'psu' + path = 'pddf/devices/psu/i2c' if dev['i2c']['topo_info']['dev_type'] in self.data['PLATFORM']['pddf_dev_types']['PSU']: - if not KEY in self.sysfs_obj: - self.sysfs_obj[KEY] = [] - self.sysfs_device(dev['i2c']['topo_info'], path, self.sysfs_obj, KEY) - sysfs_path = "/sys/kernel/pddf/devices/psu/i2c/psu_idx" - self.sysfs_obj[KEY].append(sysfs_path) - - for attr in dev['i2c']['attr_list']: - self.sysfs_device(attr, "pddf/devices/psu/i2c", self.sysfs_obj, KEY) - sysfs_path = "/sys/kernel/pddf/devices/psu/i2c/dev_ops" - if not sysfs_path in self.sysfs_obj[KEY]: - self.sysfs_obj[KEY].append(sysfs_path) - list=['/sys/kernel/pddf/devices/psu/i2c/i2c_type', - '/sys/kernel/pddf/devices/fan/i2c/i2c_name', - '/sys/kernel/pddf/devices/psu/i2c/error', - '/sys/kernel/pddf/devices/psu/i2c/attr_ops'] - self.add_list_sysfs_obj(self.sysfs_obj, KEY, list) + if KEY not in self.sysfs_obj: + self.sysfs_obj[KEY] = [] + self.sysfs_device(dev['i2c']['topo_info'], path, self.sysfs_obj, KEY) + sysfs_path = "/sys/kernel/pddf/devices/psu/i2c/psu_idx" + self.sysfs_obj[KEY].append(sysfs_path) + for attr in dev['i2c']['attr_list']: + self.sysfs_device(attr, "pddf/devices/psu/i2c", self.sysfs_obj, KEY) + sysfs_path = "/sys/kernel/pddf/devices/psu/i2c/dev_ops" + if sysfs_path not in self.sysfs_obj[KEY]: + self.sysfs_obj[KEY].append(sysfs_path) + list = ['/sys/kernel/pddf/devices/psu/i2c/i2c_type', + '/sys/kernel/pddf/devices/fan/i2c/i2c_name', + '/sys/kernel/pddf/devices/psu/i2c/error', + '/sys/kernel/pddf/devices/psu/i2c/attr_ops'] + self.add_list_sysfs_obj(self.sysfs_obj, KEY, list) def show_psu_device(self, dev, ops): - self.show_psu_i2c_device(dev, ops ) - return + self.show_psu_i2c_device(dev, ops) + return def show_client_device(self): - KEY ='client' - if not KEY in self.sysfs_obj: - self.sysfs_obj[KEY] = [] - list=['/sys/kernel/pddf/devices/showall'] - self.add_list_sysfs_obj(self.sysfs_obj, KEY, list) - + KEY = 'client' + if KEY not in self.sysfs_obj: + self.sysfs_obj[KEY] = [] + list = ['/sys/kernel/pddf/devices/showall'] + self.add_list_sysfs_obj(self.sysfs_obj, KEY, list) def show_fan_device(self, dev, ops): - KEY ='fan' - path='pddf/devices/fan/i2c' + KEY = 'fan' + path = 'pddf/devices/fan/i2c' if dev['i2c']['topo_info']['dev_type'] in self.data['PLATFORM']['pddf_dev_types']['FAN']: - if not KEY in self.sysfs_obj: - self.sysfs_obj[KEY] = [] - - self.sysfs_device(dev['i2c']['topo_info'], path, self.sysfs_obj, KEY) - self.sysfs_device(dev['i2c']['dev_attr'], path, self.sysfs_obj, KEY) - for attr in dev['i2c']['attr_list']: - self.sysfs_device(attr, path, self.sysfs_obj, KEY) - list=['/sys/kernel/pddf/devices/fan/i2c/i2c_type', - '/sys/kernel/pddf/devices/fan/i2c/i2c_name', - '/sys/kernel/pddf/devices/fan/i2c/error', - '/sys/kernel/pddf/devices/fan/i2c/attr_ops', - '/sys/kernel/pddf/devices/fan/i2c/dev_ops'] - self.add_list_sysfs_obj(self.sysfs_obj, KEY, list) + if KEY not in self.sysfs_obj: + self.sysfs_obj[KEY] = [] + self.sysfs_device(dev['i2c']['topo_info'], path, self.sysfs_obj, KEY) + self.sysfs_device(dev['i2c']['dev_attr'], path, self.sysfs_obj, KEY) + for attr in dev['i2c']['attr_list']: + self.sysfs_device(attr, path, self.sysfs_obj, KEY) + list = ['/sys/kernel/pddf/devices/fan/i2c/i2c_type', + '/sys/kernel/pddf/devices/fan/i2c/i2c_name', + '/sys/kernel/pddf/devices/fan/i2c/error', + '/sys/kernel/pddf/devices/fan/i2c/attr_ops', + '/sys/kernel/pddf/devices/fan/i2c/dev_ops'] + self.add_list_sysfs_obj(self.sysfs_obj, KEY, list) def show_temp_sensor_device(self, dev, ops): - return + return def show_sysstatus_device(self, dev, ops): - KEY ='sysstatus' - if not KEY in self.sysfs_obj: + KEY = 'sysstatus' + if KEY not in self.sysfs_obj: self.sysfs_obj[KEY] = [] for attr in dev['attr_list']: - self.sysfs_device(attr, "pddf/devices/sysstatus", self.sysfs_obj, KEY) - sysfs_path= "/sys/kernel/pddf/devices/sysstatus/attr_ops" - if not sysfs_path in self.sysfs_obj[KEY]: - self.sysfs_obj[KEY].append(sysfs_path) - + self.sysfs_device(attr, "pddf/devices/sysstatus", self.sysfs_obj, KEY) + sysfs_path = "/sys/kernel/pddf/devices/sysstatus/attr_ops" + if sysfs_path not in self.sysfs_obj[KEY]: + self.sysfs_obj[KEY].append(sysfs_path) def show_xcvr_i2c_device(self, dev, ops): - KEY ='xcvr' + KEY = 'xcvr' if dev['i2c']['topo_info']['dev_type'] in self.data['PLATFORM']['pddf_dev_types']['PORT_MODULE']: - if not KEY in self.sysfs_obj: - self.sysfs_obj[KEY] = [] - self.sysfs_device(dev['i2c']['topo_info'], "pddf/devices/xcvr/i2c", self.sysfs_obj, KEY) - - for attr in dev['i2c']['attr_list']: - self.sysfs_device(attr, "pddf/devices/xcvr/i2c", self.sysfs_obj, KEY) - sysfs_path = "/sys/kernel/pddf/devices/xcvr/i2c/dev_ops" - if not sysfs_path in self.sysfs_obj[KEY]: - self.sysfs_obj[KEY].append(sysfs_path) - list=['/sys/kernel/pddf/devices/xcvr/i2c/i2c_type', - '/sys/kernel/pddf/devices/xcvr/i2c/i2c_name', - '/sys/kernel/pddf/devices/xcvr/i2c/error', - '/sys/kernel/pddf/devices/xcvr/i2c/attr_ops'] - self.add_list_sysfs_obj(self.sysfs_obj, KEY, list) + if KEY not in self.sysfs_obj: + self.sysfs_obj[KEY] = [] + self.sysfs_device(dev['i2c']['topo_info'], "pddf/devices/xcvr/i2c", self.sysfs_obj, KEY) + for attr in dev['i2c']['attr_list']: + self.sysfs_device(attr, "pddf/devices/xcvr/i2c", self.sysfs_obj, KEY) + sysfs_path = "/sys/kernel/pddf/devices/xcvr/i2c/dev_ops" + if sysfs_path not in self.sysfs_obj[KEY]: + self.sysfs_obj[KEY].append(sysfs_path) + list = ['/sys/kernel/pddf/devices/xcvr/i2c/i2c_type', + '/sys/kernel/pddf/devices/xcvr/i2c/i2c_name', + '/sys/kernel/pddf/devices/xcvr/i2c/error', + '/sys/kernel/pddf/devices/xcvr/i2c/attr_ops'] + self.add_list_sysfs_obj(self.sysfs_obj, KEY, list) def show_xcvr_device(self, dev, ops): - self.show_xcvr_i2c_device(dev, ops ) - return + self.show_xcvr_i2c_device(dev, ops) + return def show_cpld_device(self, dev, ops): - KEY ='cpld' + KEY = 'cpld' if dev['i2c']['topo_info']['dev_type'] in self.data['PLATFORM']['pddf_dev_types']['CPLD']: - if not KEY in self.sysfs_obj: - self.sysfs_obj[KEY] = [] - self.sysfs_device(dev['i2c']['topo_info'], "pddf/devices/cpld", self.sysfs_obj, KEY) - sysfs_path= "/sys/kernel/pddf/devices/cpld/dev_ops" - if not sysfs_path in self.sysfs_obj[KEY]: - self.sysfs_obj[KEY].append(sysfs_path) - list=['/sys/kernel/pddf/devices/cpld/i2c_type', - '/sys/kernel/pddf/devices/cpld/i2c_name', - '/sys/kernel/pddf/devices/cpld/error'] - self.add_list_sysfs_obj(self.sysfs_obj, KEY, list) + if KEY not in self.sysfs_obj: + self.sysfs_obj[KEY] = [] + self.sysfs_device(dev['i2c']['topo_info'], "pddf/devices/cpld", self.sysfs_obj, KEY) + sysfs_path = "/sys/kernel/pddf/devices/cpld/dev_ops" + if sysfs_path not in self.sysfs_obj[KEY]: + self.sysfs_obj[KEY].append(sysfs_path) + list = ['/sys/kernel/pddf/devices/cpld/i2c_type', + '/sys/kernel/pddf/devices/cpld/i2c_name', + '/sys/kernel/pddf/devices/cpld/error'] + self.add_list_sysfs_obj(self.sysfs_obj, KEY, list) def show_led_platform_device(self, key, ops): - if ops['attr']=='all' or ops['attr']=='PLATFORM': - KEY='platform' - if not KEY in self.sysfs_obj: + if ops['attr'] == 'all' or ops['attr'] == 'PLATFORM': + KEY = 'platform' + if KEY not in self.sysfs_obj: self.sysfs_obj[KEY] = [] - path='pddf/devices/platform' + path = 'pddf/devices/platform' self.sysfs_attr('num_psus', self.data['PLATFORM']['num_psus'], path, self.sysfs_obj, KEY) self.sysfs_attr('num_fantrays', self.data['PLATFORM']['num_fantrays'], path, self.sysfs_obj, KEY) def show_led_device(self, key, ops): if self.check_led_cmds(key, ops): - KEY='led' - if not KEY in self.sysfs_obj: + KEY = 'led' + if KEY not in self.sysfs_obj: self.sysfs_obj[KEY] = [] - path="pddf/devices/led" + path = "pddf/devices/led" for attr in self.data[key]['i2c']['attr_list']: - self.sysfs_attr('device_name', self.data[key]['dev_info']['device_name'],path,self.sysfs_obj,KEY) - self.sysfs_attr('swpld_addr', self.data[key]['dev_info']['device_name'],path,self.sysfs_obj,KEY) - self.sysfs_attr('swpld_addr_offset', self.data[key]['dev_info']['device_name'],path, - self.sysfs_obj, KEY) + self.sysfs_attr('device_name', self.data[key]['dev_info']['device_name'], path, self.sysfs_obj, KEY) + self.sysfs_attr('swpld_addr', self.data[key]['dev_info']['device_name'], path, self.sysfs_obj, KEY) + self.sysfs_attr('swpld_addr_offset', self.data[key]['dev_info']['device_name'], path, + self.sysfs_obj, KEY) self.sysfs_device(self.data[key]['dev_attr'], path, self.sysfs_obj, KEY) for attr_key in attr.keys(): - attr_path="pddf/devices/led/" + attr['attr_name'] + attr_path = "pddf/devices/led/" + attr['attr_name'] if (attr_key != 'attr_name' and attr_key != 'swpld_addr' and attr_key != 'swpld_addr_offset'): self.sysfs_attr(attr_key, attr[attr_key], attr_path, self.sysfs_obj, KEY) - sysfs_path="/sys/kernel/pddf/devices/led/dev_ops" - if not sysfs_path in self.sysfs_obj[KEY]: + sysfs_path = "/sys/kernel/pddf/devices/led/dev_ops" + if sysfs_path not in self.sysfs_obj[KEY]: self.sysfs_obj[KEY].append(sysfs_path) - list=['/sys/kernel/pddf/devices/led/cur_state/color', + list = ['/sys/kernel/pddf/devices/led/cur_state/color', '/sys/kernel/pddf/devices/led/cur_state/color_state'] self.add_list_sysfs_obj(self.sysfs_obj, KEY, list) - def validate_xcvr_device(self, dev, ops): devtype_list = ['optoe1', 'optoe2'] dev_attribs = ['xcvr_present', 'xcvr_reset', 'xcvr_intr_status', 'xcvr_lpmode'] @@ -723,7 +698,7 @@ def validate_xcvr_device(self, dev, ops): if 'attr_name' in attr.keys() and 'eeprom' in attr.values(): ret_val = "xcvr validation success" else: - print "xcvr validation Failed" + print("xcvr validation Failed") return elif dev['i2c']['topo_info']['dev_type'] in self.data['PLATFORM']['pddf_dev_types']['PORT_MODULE']: @@ -731,9 +706,9 @@ def validate_xcvr_device(self, dev, ops): if attr.get("attr_name") in dev_attribs: ret_val = "Success" else: - print "xcvr validation Failed" + print("xcvr validation Failed") return - print ret_val + print(ret_val) def validate_eeprom_device(self, dev, ops): devtype_list = ['24c02'] @@ -746,7 +721,7 @@ def validate_eeprom_device(self, dev, ops): for attr in dev['i2c']['attr_list']: if attr.get("attr_name") in dev_attribs: ret_val = "eeprom success" - print ret_val + print(ret_val) def validate_mux_device(self, dev, ops): devtype_list = ['pca9548', 'pca954x'] @@ -757,7 +732,7 @@ def validate_mux_device(self, dev, ops): for attr in dev['i2c']['channel']: if attr.get("chn") in dev_channels: ret_val = "Mux success" - print ret_val + print(ret_val) def validate_cpld_device(self, dev, ops): devtype_list = ['i2c_cpld'] @@ -765,20 +740,19 @@ def validate_cpld_device(self, dev, ops): if dev['i2c']['topo_info']['dev_type'] in devtype_list: ret_val = "cpld success" - print ret_val - + print(ret_val) def validate_sysstatus_device(self, dev, ops): dev_attribs = ['board_info', 'cpld1_version', 'power_module_status', 'system_reset5', - 'system_reset6', 'system_reset7', 'misc1', 'cpld2_version', 'cpld3_version' - ] + 'system_reset6', 'system_reset7', 'misc1', 'cpld2_version', 'cpld3_version' + ] ret_val = "sysstatus failed" if dev['dev_info']['device_type'] == "SYSSTAT": - for attr in dev['attr_list']: - if attr.get("attr_name") in dev_attribs: - ret_val = "sysstatus success" - print ret_val + for attr in dev['attr_list']: + if attr.get("attr_name") in dev_attribs: + ret_val = "sysstatus success" + print(ret_val) def validate_temp_sensor_device(self, dev, ops): devtype_list = ['lm75'] @@ -790,7 +764,7 @@ def validate_temp_sensor_device(self, dev, ops): for attr in dev['i2c']['attr_list']: if attr.get("attr_name") in dev_attribs: ret_val = "tempsensor success" - print ret_val + print(ret_val) def validate_fan_device(self, dev, ops): ret_val = "fan failed" @@ -799,12 +773,12 @@ def validate_fan_device(self, dev, ops): if dev['i2c']['dev_attr']['num_fan'] is not None: ret_val = "fan success" - print ret_val + print(ret_val) def validate_psu_device(self, dev, ops): dev_attribs = ['psu_present', 'psu_model_name', 'psu_power_good', 'psu_mfr_id', 'psu_serial_num', - 'psu_fan_dir', 'psu_v_out', 'psu_i_out', 'psu_p_out', 'psu_fan1_speed_rpm' - ] + 'psu_fan_dir', 'psu_v_out', 'psu_i_out', 'psu_p_out', 'psu_fan1_speed_rpm' + ] ret_val = "psu failed" if dev['i2c']['topo_info']['dev_type'] in self.data['PLATFORM']['pddf_dev_types']['PSU']: @@ -814,272 +788,263 @@ def validate_psu_device(self, dev, ops): if attr.get("attr_offset") is not None: if attr.get("attr_mask") is not None: if attr.get("attr_len") is not None: - ret_val = "psu success" + ret_val = "psu success" else: ret_val = "psu failed" - print ret_val + print(ret_val) ################################################################################################################### - # SPYTEST + # SPYTEST ################################################################################################################### def verify_attr(self, key, attr, path): - node="/sys/kernel/%s/%s"%(path, key) - try: - with open(node, 'r') as f: - status = f.read() - except IOError: - print "PDDF_VERIFY_ERR: IOError: node:%s key:%s"%(node, key) - return + node = "/sys/kernel/%s/%s" % (path, key) + try: + with open(node, 'r') as f: + status = f.read() + except IOError: + print("PDDF_VERIFY_ERR: IOError: node:%s key:%s" % (node, key)) + return - status=status.rstrip("\n\r") - if attr[key]!=status: - print "PDDF_VERIFY_ERR: node: %s switch:%s"%(node, status) + status = status.rstrip("\n\r") + if attr[key] != status: + print("PDDF_VERIFY_ERR: node: %s switch:%s" % (node, status)) def verify_device(self, attr, path, ops): - for key in attr.keys(): - self.verify_attr(key, attr, path) - + for key in attr.keys(): + self.verify_attr(key, attr, path) def get_led_device(self, device_name): self.create_attr('device_name', self.data[device_name]['dev_info']['device_name'], "pddf/devices/led") self.create_attr('index', self.data[device_name]['dev_attr']['index'], "pddf/devices/led") - cmd="echo 'verify' > /sys/kernel/pddf/devices/led/dev_ops" + cmd = "echo 'verify' > /sys/kernel/pddf/devices/led/dev_ops" self.runcmd(cmd) def validate_sysfs_creation(self, obj, validate_type): - dir = '/sys/kernel/pddf/devices/'+validate_type - if (os.path.exists(dir) or validate_type=='client'): - for sysfs in obj[validate_type]: - if(not os.path.exists(sysfs)): - print "[SYSFS FILE] " + sysfs + ": does not exist" - else: - print "[SYSFS DIR] " + dir + ": does not exist" + dir = '/sys/kernel/pddf/devices/'+validate_type + if (os.path.exists(dir) or validate_type == 'client'): + for sysfs in obj[validate_type]: + if not os.path.exists(sysfs): + print("[SYSFS FILE] " + sysfs + ": does not exist") + else: + print("[SYSFS DIR] " + dir + ": does not exist") def validate_dsysfs_creation(self, obj, validate_type): if validate_type in obj.keys(): # There is a possibility that some components dont have any device-self.data attr if not obj[validate_type]: - print "[SYSFS ATTR] for " + validate_type + ": empty" + print("[SYSFS ATTR] for " + validate_type + ": empty") else: - for sysfs in obj[validate_type]: - if(not os.path.exists(sysfs)): - print "[SYSFS FILE] " + sysfs + ": does not exist" + for sysfs in obj[validate_type]: + if not os.path.exists(sysfs): + print("[SYSFS FILE] " + sysfs + ": does not exist") else: - print "[SYSFS DIR] " + dir + ": not configured" - - + print("[SYSFS DIR] " + dir + ": not configured") def verify_sysfs_data(self, verify_type): - if (verify_type=='LED'): + if (verify_type == 'LED'): for key in self.data.keys(): if key != 'PLATFORM': - attr=self.data[key]['dev_info'] + attr = self.data[key]['dev_info'] if attr['device_type'] == 'LED': self.get_led_device(key) self.verify_attr('device_name', self.data[key]['dev_info'], "pddf/devices/led") self.verify_attr('index', self.data[key]['dev_attr'], "pddf/devices/led") for attr in self.data[key]['i2c']['attr_list']: - path="pddf/devices/led/" + attr['attr_name'] + path = "pddf/devices/led/" + attr['attr_name'] for entry in attr.keys(): if (entry != 'attr_name' and entry != 'swpld_addr' and entry != 'swpld_addr_offset'): - self.verify_attr(entry, attr, path) - if ( entry == 'swpld_addr' or entry == 'swpld_addr_offset'): - self.verify_attr(entry, attr, 'pddf/devices/led') - - + self.verify_attr(entry, attr, path) + if (entry == 'swpld_addr' or entry == 'swpld_addr_offset'): + self.verify_attr(entry, attr, 'pddf/devices/led') def schema_validation(self, validate_type): - process_validate_type = 0 - for key in self.data.keys(): - if (key != 'PLATFORM'): - temp_obj={} - schema_list=[] + process_validate_type = 0 + for key in self.data.keys(): + if (key != 'PLATFORM'): + temp_obj = {} + schema_list = [] + try: + device_type = self.data[key]["dev_info"]["device_type"] + except Exception as e: + print("dev_info or device_type ERROR: " + key) + print(e) + + if validate_type == 'mismatch': + process_validate_type = 1 + device_type = "PSU" + schema_file = "/usr/local/bin/schema/FAN.schema" + schema_list.append(schema_file) + elif validate_type == 'missing': + process_validate_type = 1 + schema_file = "/usr/local/bin/schema/PLATFORM.schema" + schema_list.append(schema_file) + + elif validate_type == 'empty': + process_validate_type = 1 + if not device_type: + print("Empty device_type for " + key) + continue + elif (validate_type == 'all' or validate_type == device_type): + process_validate_type = 1 + if "bmc" in self.data[key].keys(): + schema_file = "/usr/local/bin/schema/"+device_type + "_BMC.schema" + schema_list.append(schema_file) + + if "i2c" in self.data[key].keys(): + schema_file = "/usr/local/bin/schema/"+device_type + ".schema" + schema_list.append(schema_file) + if device_type: + temp_obj[device_type] = self.data[key] + for schema_file in schema_list: + if (os.path.exists(schema_file)): + print("Validate " + schema_file + ";" + key) + json_data = json.dumps(temp_obj) + with open(schema_file, 'r') as f: + schema = json.load(f) try: - device_type=self.data[key]["dev_info"]["device_type"] + validate(temp_obj, schema) except Exception as e: - print "dev_info or device_type ERROR: " + key - print e - - if validate_type == 'mismatch': - process_validate_type = 1 - device_type="PSU" - schema_file="/usr/local/bin/schema/FAN.schema" - schema_list.append(schema_file) - elif validate_type == 'missing': - process_validate_type = 1 - schema_file="/usr/local/bin/schema/PLATFORM.schema" - schema_list.append(schema_file) - - elif validate_type == 'empty': - process_validate_type = 1 - if not device_type: - print "Empty device_type for " + key - continue - elif (validate_type=='all' or validate_type==device_type): - process_validate_type = 1 - if "bmc" in self.data[key].keys(): - schema_file="/usr/local/bin/schema/"+device_type + "_BMC.schema" - schema_list.append(schema_file) - - if "i2c" in self.data[key].keys(): - schema_file="/usr/local/bin/schema/"+device_type + ".schema" - schema_list.append(schema_file) - if device_type: - temp_obj[device_type]=self.data[key] - for schema_file in schema_list: - if (os.path.exists(schema_file)): - print "Validate " + schema_file + ";" + key - json_data=json.dumps(temp_obj) - with open(schema_file, 'r') as f: - schema=json.load(f) - try: - validate(temp_obj, schema) - except Exception as e: - print "Validation ERROR: " + schema_file + ";" + key - if validate_type == 'mismatch': - return - else: - print e - else: - print "ERROR Missing File: " + schema_file - if not process_validate_type: - print "device_type: " + validate_type + " not configured" + print("Validation ERROR: " + schema_file + ";" + key) + if validate_type == 'mismatch': + return + else: + print(e) + else: + print("ERROR Missing File: " + schema_file) + if not process_validate_type: + print("device_type: " + validate_type + " not configured") def modules_validation(self, validate_type): kos = [] supported_type = False - module_validation_status=[] + module_validation_status = [] - if validate_type == "bmc": - kos=['ipmi_devintf', 'ipmi_si', 'ipmi_msghandler'] - validate_type = 'ipmi' + if validate_type == "bmc": + kos = ['ipmi_devintf', 'ipmi_si', 'ipmi_msghandler'] + validate_type = 'ipmi' else: - # generate the KOS list from pddf device JSON file - kos.extend(self.data['PLATFORM']['pddf_kos']) + # generate the KOS list from pddf device JSON file + kos.extend(self.data['PLATFORM']['pddf_kos']) - if 'custom_kos' in self.data['PLATFORM']: - kos.extend(self.data['PLATFORM']['custom_kos']) + if 'custom_kos' in self.data['PLATFORM']: + kos.extend(self.data['PLATFORM']['custom_kos']) for mod in kos: if validate_type in mod or validate_type == "pddf": - supported_type=True - cmd = "lsmod | grep " + mod - try: - subprocess.check_output(cmd, shell=True) - except Exception as e: - module_validation_status.append(mod) + supported_type = True + cmd = "lsmod | grep " + mod + try: + subprocess.check_output(cmd, shell=True) + except Exception as e: + module_validation_status.append(mod) if supported_type: if module_validation_status: - module_validation_status.append(":ERROR not loaded") - print str(module_validation_status)[1:-1] + module_validation_status.append(":ERROR not loaded") + print(str(module_validation_status)[1:-1]) else: - print "Loaded" + print("Loaded") else: - print validate_type + " not configured" - - + print(validate_type + " not configured") ################################################################################################################### # PARSE DEFS ################################################################################################################### + def psu_parse(self, dev, ops): - parse_str="" - ret="" + parse_str = "" + ret = "" for ifce in dev['i2c']['interface']: - ret=getattr(self, ops['cmd']+"_psu_device")(self.data[ifce['dev']], ops ) - if not ret is None: + ret = getattr(self, ops['cmd']+"_psu_device")(self.data[ifce['dev']], ops) + if ret is not None: if str(ret).isdigit(): - if ret!=0: + if ret != 0: # in case if 'create' functions - print "{}_psu_device failed".format(ops['cmd']) + print("{}_psu_device failed".format(ops['cmd'])) return ret else: pass else: # in case of 'show_attr' functions - parse_str+=ret + parse_str += ret return parse_str def fan_parse(self, dev, ops): - parse_str="" - ret=getattr(self, ops['cmd']+"_fan_device")(dev, ops ) - if not ret is None: + parse_str = "" + ret = getattr(self, ops['cmd']+"_fan_device")(dev, ops) + if ret is not None: if str(ret).isdigit(): - if ret!=0: + if ret != 0: # in case if 'create' functions - print "{}_fan_device failed".format(ops['cmd']) + print("{}_fan_device failed".format(ops['cmd'])) return ret else: pass else: # in case of 'show_attr' functions - parse_str+=ret + parse_str += ret return parse_str def temp_sensor_parse(self, dev, ops): - parse_str="" - ret=getattr(self, ops['cmd']+"_temp_sensor_device")(dev, ops ) - if not ret is None: - if str(ret).isdigit() : - if ret!=0: + parse_str = "" + ret = getattr(self, ops['cmd']+"_temp_sensor_device")(dev, ops) + if ret is not None: + if str(ret).isdigit(): + if ret != 0: # in case if 'create' functions - print "{}_temp_sensor_device failed".format(ops['cmd']) + print("{}_temp_sensor_device failed".format(ops['cmd'])) return ret else: pass else: # in case of 'show_attr' functions - parse_str+=ret + parse_str += ret return parse_str def cpld_parse(self, dev, ops): parse_str = "" ret = getattr(self, ops['cmd']+"_cpld_device")(dev, ops) - if not ret is None: + if ret is not None: if str(ret).isdigit(): - if ret!=0: + if ret != 0: # in case if 'create' functions - print "{}_cpld_device failed".format(ops['cmd']) + print("{}_cpld_device failed".format(ops['cmd'])) return ret else: pass else: # in case of 'show_attr' functions - parse_str+=ret + parse_str += ret return parse_str - - - - def sysstatus_parse(self, dev,ops): + def sysstatus_parse(self, dev, ops): parse_str = "" ret = getattr(self, ops['cmd']+"_sysstatus_device")(dev, ops) - if not ret is None: + if ret is not None: if str(ret).isdigit(): - if ret!=0: + if ret != 0: # in case if 'create' functions - print "{}_sysstatus_device failed".format(ops['cmd']) + print("{}_sysstatus_device failed".format(ops['cmd'])) return ret else: pass else: # in case of 'show_attr' functions - parse_str+=ret + parse_str += ret - return parse_str + return parse_str def gpio_parse(self, dev, ops): parse_str = "" ret = getattr(self, ops['cmd']+"_gpio_device")(dev, ops) - if not ret is None: + if ret is not None: if str(ret).isdigit(): - if ret!=0: + if ret != 0: # in case if 'create' functions - print "{}_temp_sensor_device failed".format(ops['cmd']) + print("{}_temp_sensor_device failed".format(ops['cmd'])) return ret else: pass @@ -1089,15 +1054,14 @@ def gpio_parse(self, dev, ops): return parse_str - def mux_parse(self, dev, ops): parse_str = "" ret = getattr(self, ops['cmd']+"_mux_device")(dev, ops) - if not ret is None: + if ret is not None: if str(ret).isdigit(): - if ret!=0: + if ret != 0: # in case if 'create' functions - print "{}_mux_device() cmd failed".format(ops['cmd']) + print("{}_mux_device() cmd failed".format(ops['cmd'])) return ret else: pass @@ -1105,10 +1069,10 @@ def mux_parse(self, dev, ops): parse_str += ret for ch in dev['i2c']['channel']: - ret = self.dev_parse(self.data[ch['dev']], ops) - if not ret is None: + ret = self.dev_parse(self.data[ch['dev']], ops) + if ret is not None: if str(ret).isdigit(): - if ret!=0: + if ret != 0: # in case if 'create' functions return ret else: @@ -1120,10 +1084,10 @@ def mux_parse(self, dev, ops): def mux_parse_reverse(self, dev, ops): parse_str = "" for ch in reversed(dev['i2c']['channel']): - ret = self.dev_parse(self.data[ch['dev']], ops) - if not ret is None: + ret = self.dev_parse(self.data[ch['dev']], ops) + if ret is not None: if str(ret).isdigit(): - if ret!=0: + if ret != 0: # in case if 'create' functions return ret else: @@ -1132,11 +1096,11 @@ def mux_parse_reverse(self, dev, ops): parse_str += ret ret = getattr(self, ops['cmd']+"_mux_device")(dev, ops) - if not ret is None: + if ret is not None: if str(ret).isdigit(): - if ret!=0: + if ret != 0: # in case if 'create' functions - print "{}_mux_device() cmd failed".format(ops['cmd']) + print("{}_mux_device() cmd failed".format(ops['cmd'])) return ret else: pass @@ -1145,15 +1109,14 @@ def mux_parse_reverse(self, dev, ops): return parse_str - def eeprom_parse(self, dev, ops): parse_str = "" ret = getattr(self, ops['cmd']+"_eeprom_device")(dev, ops) - if not ret is None: + if ret is not None: if str(ret).isdigit(): - if ret!=0: + if ret != 0: # in case if 'create' functions - print "{}_eeprom_device() cmd failed".format(ops['cmd']) + print("{}_eeprom_device() cmd failed".format(ops['cmd'])) return ret else: pass @@ -1163,20 +1126,20 @@ def eeprom_parse(self, dev, ops): return parse_str def optic_parse(self, dev, ops): - parse_str="" - ret="" + parse_str = "" + ret = "" for ifce in dev['i2c']['interface']: - ret=getattr(self, ops['cmd']+"_xcvr_device")(self.data[ifce['dev']], ops ) - if not ret is None: + ret = getattr(self, ops['cmd']+"_xcvr_device")(self.data[ifce['dev']], ops) + if ret is not None: if str(ret).isdigit(): - if ret!=0: + if ret != 0: # in case if 'create' functions - print "{}_eeprom_device() cmd failed".format(ops['cmd']) + print("{}_eeprom_device() cmd failed".format(ops['cmd'])) return ret else: pass else: - parse_str+=ret + parse_str += ret return parse_str def cpu_parse(self, bus, ops): @@ -1184,10 +1147,10 @@ def cpu_parse(self, bus, ops): for dev in bus['i2c']['CONTROLLERS']: dev1 = self.data[dev['dev']] for d in dev1['i2c']['DEVICES']: - ret=self.dev_parse(self.data[d['dev']], ops) - if not ret is None: + ret = self.dev_parse(self.data[d['dev']], ops) + if ret is not None: if str(ret).isdigit(): - if ret!=0: + if ret != 0: # in case if 'create' functions return ret else: @@ -1201,10 +1164,10 @@ def cpu_parse_reverse(self, bus, ops): for dev in reversed(bus['i2c']['CONTROLLERS']): dev1 = self.data[dev['dev']] for d in dev1['i2c']['DEVICES']: - ret=self.dev_parse(self.data[d['dev']], ops) - if not ret is None: + ret = self.dev_parse(self.data[d['dev']], ops) + if ret is not None: if str(ret).isdigit(): - if ret!=0: + if ret != 0: # in case if 'create' functions return ret else: @@ -1213,68 +1176,67 @@ def cpu_parse_reverse(self, bus, ops): parse_str += ret return parse_str - def dev_parse(self, dev, ops): - attr=dev['dev_info'] - if attr['device_type'] == 'CPU': - if ops['cmd']=='delete': - return self.cpu_parse_reverse(dev, ops) - else: - return self.cpu_parse(dev, ops) - - if attr['device_type'] == 'EEPROM': - return self.eeprom_parse(dev, ops) - - if attr['device_type'] == 'MUX': - if ops['cmd']=='delete': - return self.mux_parse_reverse(dev, ops) - else: - return self.mux_parse(dev, ops) + attr = dev['dev_info'] + if attr['device_type'] == 'CPU': + if ops['cmd'] == 'delete': + return self.cpu_parse_reverse(dev, ops) + else: + return self.cpu_parse(dev, ops) - if attr['device_type'] == 'GPIO': - return self.gpio_parse(dev, ops) + if attr['device_type'] == 'EEPROM': + return self.eeprom_parse(dev, ops) - if attr['device_type'] == 'PSU': - return self.psu_parse(dev, ops) + if attr['device_type'] == 'MUX': + if ops['cmd'] == 'delete': + return self.mux_parse_reverse(dev, ops) + else: + return self.mux_parse(dev, ops) + + if attr['device_type'] == 'GPIO': + return self.gpio_parse(dev, ops) - if attr['device_type'] == 'FAN': - return self.fan_parse(dev, ops) + if attr['device_type'] == 'PSU': + return self.psu_parse(dev, ops) - if attr['device_type'] == 'TEMP_SENSOR': - return self.temp_sensor_parse(dev, ops) + if attr['device_type'] == 'FAN': + return self.fan_parse(dev, ops) - if attr['device_type'] == 'SFP' or attr['device_type'] == 'QSFP' or \ - attr['device_type'] == 'SFP28' or attr['device_type'] == 'QSFP28' or \ - attr['device_type'] == 'QSFP-DD': - return self.optic_parse(dev, ops) + if attr['device_type'] == 'TEMP_SENSOR': + return self.temp_sensor_parse(dev, ops) - if attr['device_type'] == 'CPLD': - return self.cpld_parse(dev, ops) + if attr['device_type'] == 'SFP' or attr['device_type'] == 'QSFP' or \ + attr['device_type'] == 'SFP28' or attr['device_type'] == 'QSFP28' or \ + attr['device_type'] == 'QSFP-DD': + return self.optic_parse(dev, ops) - if attr['device_type'] == 'SYSSTAT': - return self.sysstatus_parse(dev,ops) + if attr['device_type'] == 'CPLD': + return self.cpld_parse(dev, ops) + + if attr['device_type'] == 'SYSSTAT': + return self.sysstatus_parse(dev, ops) def is_supported_sysled_state(self, sysled_name, sysled_state): - if not sysled_name in self.data.keys(): - return False, "[FAILED] " + sysled_name + " is not configured" - for attr in self.data[sysled_name]['i2c']['attr_list']: - if attr['attr_name'] == sysled_state: - return True, "supported" - return False, "[FAILED]: Invalid color" + if sysled_name not in self.data.keys(): + return False, "[FAILED] " + sysled_name + " is not configured" + for attr in self.data[sysled_name]['i2c']['attr_list']: + if attr['attr_name'] == sysled_state: + return True, "supported" + return False, "[FAILED]: Invalid color" def create_attr(self, key, value, path): - cmd = "echo '%s' > /sys/kernel/%s/%s"%(value, path, key) - self.runcmd(cmd) + cmd = "echo '%s' > /sys/kernel/%s/%s" % (value, path, key) + self.runcmd(cmd) def create_led_platform_device(self, key, ops): - if ops['attr']=='all' or ops['attr']=='PLATFORM': - path='pddf/devices/platform' + if ops['attr'] == 'all' or ops['attr'] == 'PLATFORM': + path = 'pddf/devices/platform' self.create_attr('num_psus', self.data['PLATFORM']['num_psus'], path) self.create_attr('num_fantrays', self.data['PLATFORM']['num_fantrays'], path) def create_led_device(self, key, ops): - if ops['attr']=='all' or ops['attr']==self.data[key]['dev_info']['device_name']: - path="pddf/devices/led" + if ops['attr'] == 'all' or ops['attr'] == self.data[key]['dev_info']['device_name']: + path = "pddf/devices/led" for attr in self.data[key]['i2c']['attr_list']: self.create_attr('device_name', self.data[key]['dev_info']['device_name'], path) self.create_device(self.data[key]['dev_attr'], path, ops) @@ -1283,111 +1245,107 @@ def create_led_device(self, key, ops): self.create_attr(attr_key, attr[attr_key], path) elif (attr_key != 'attr_name' and attr_key != 'descr' and attr_key != 'attr_devtype' and attr_key != 'attr_devname'): - state_path=path+'/state_attr' - self.create_attr(attr_key, attr[attr_key],state_path) - cmd="echo '" + attr['attr_name']+"' > /sys/kernel/pddf/devices/led/dev_ops" + state_path = path+'/state_attr' + self.create_attr(attr_key, attr[attr_key], state_path) + cmd = "echo '" + attr['attr_name']+"' > /sys/kernel/pddf/devices/led/dev_ops" self.runcmd(cmd) - def led_parse(self, ops): - getattr(self, ops['cmd']+"_led_platform_device")("PLATFORM", ops) - for key in self.data.keys(): - if key != 'PLATFORM' and 'dev_info' in self.data[key]: - attr=self.data[key]['dev_info'] - if attr['device_type'] == 'LED': - getattr(self, ops['cmd']+"_led_device")(key, ops) - + getattr(self, ops['cmd']+"_led_platform_device")("PLATFORM", ops) + for key in self.data.keys(): + if key != 'PLATFORM' and 'dev_info' in self.data[key]: + attr = self.data[key]['dev_info'] + if attr['device_type'] == 'LED': + getattr(self, ops['cmd']+"_led_device")(key, ops) def get_device_list(self, list, type): - for key in self.data.keys(): - if key != 'PLATFORM' and 'dev_info' in self.data[key]: - attr=self.data[key]['dev_info'] - if attr['device_type'] == type: - list.append(self.data[key]) - + for key in self.data.keys(): + if key != 'PLATFORM' and 'dev_info' in self.data[key]: + attr = self.data[key]['dev_info'] + if attr['device_type'] == type: + list.append(self.data[key]) def create_pddf_devices(self): - self.led_parse({ "cmd": "create", "target":"all", "attr":"all" }) + self.led_parse({"cmd": "create", "target": "all", "attr": "all"}) create_ret = 0 - create_ret = self.dev_parse(self.data['SYSTEM'], { "cmd": "create", "target":"all", "attr":"all" } ) - if create_ret!=0: + create_ret = self.dev_parse(self.data['SYSTEM'], {"cmd": "create", "target": "all", "attr": "all"}) + if create_ret != 0: return create_ret if 'SYSSTATUS' in self.data: - create_ret = self.dev_parse(self.data['SYSSTATUS'], { "cmd": "create", "target":"all", "attr":"all" } ) - if create_ret!=0: + create_ret = self.dev_parse(self.data['SYSSTATUS'], {"cmd": "create", "target": "all", "attr": "all"}) + if create_ret != 0: return create_ret - + def delete_pddf_devices(self): - self.dev_parse(self.data['SYSTEM'], { "cmd": "delete", "target":"all", "attr":"all" } ) + self.dev_parse(self.data['SYSTEM'], {"cmd": "delete", "target": "all", "attr": "all"}) if 'SYSSTATUS' in self.data: - self.dev_parse(self.data['SYSSTATUS'], { "cmd": "delete", "target":"all", "attr":"all" } ) + self.dev_parse(self.data['SYSSTATUS'], {"cmd": "delete", "target": "all", "attr": "all"}) def populate_pddf_sysfsobj(self): - self.dev_parse(self.data['SYSTEM'], { "cmd": "show", "target":"all", "attr":"all" } ) + self.dev_parse(self.data['SYSTEM'], {"cmd": "show", "target": "all", "attr": "all"}) if 'SYSSTATUS' in self.data: - self.dev_parse(self.data['SYSSTATUS'], { "cmd": "show", "target":"all", "attr":"all" } ) - self.led_parse({ "cmd": "show", "target":"all", "attr":"all" }) + self.dev_parse(self.data['SYSSTATUS'], {"cmd": "show", "target": "all", "attr": "all"}) + self.led_parse({"cmd": "show", "target": "all", "attr": "all"}) self.show_client_device() def cli_dump_dsysfs(self, component): - self.dev_parse(self.data['SYSTEM'], { "cmd": "show_attr", "target":"all", "attr":"all" } ) + self.dev_parse(self.data['SYSTEM'], {"cmd": "show_attr", "target": "all", "attr": "all"}) if 'SYSSTATUS' in self.data: - self.dev_parse(self.data['SYSSTATUS'], { "cmd": "show_attr", "target":"all", "attr":"all" } ) + self.dev_parse(self.data['SYSSTATUS'], {"cmd": "show_attr", "target": "all", "attr": "all"}) if component in self.data_sysfs_obj: return self.data_sysfs_obj[component] else: - return None - + return None def validate_pddf_devices(self, *args): - self.populate_pddf_sysfsobj() - v_ops = { 'cmd': 'validate', 'target':'all', 'attr':'all' } - self.dev_parse(self.data['SYSTEM'], v_ops ) + self.populate_pddf_sysfsobj() + v_ops = {'cmd': 'validate', 'target': 'all', 'attr': 'all'} + self.dev_parse(self.data['SYSTEM'], v_ops) ################################################################################################################### - # BMC APIs + # BMC APIs ################################################################################################################### def populate_bmc_cache_db(self, bmc_attr): bmc_cmd = str(bmc_attr['bmc_cmd']).strip() o_list = subprocess.check_output(bmc_cmd, shell=True).strip().split('\n') - bmc_cache[bmc_cmd]={} - bmc_cache[bmc_cmd]['time']=time.time() + bmc_cache[bmc_cmd] = {} + bmc_cache[bmc_cmd]['time'] = time.time() for entry in o_list: name = entry.split()[0] - bmc_cache[bmc_cmd][name]=entry + bmc_cache[bmc_cmd][name] = entry def non_raw_ipmi_get_request(self, bmc_attr): - bmc_db_update_time=1 + bmc_db_update_time = 1 value = 'N/A' bmc_cmd = str(bmc_attr['bmc_cmd']).strip() field_name = str(bmc_attr['field_name']).strip() - field_pos= int(bmc_attr['field_pos'])-1 + field_pos = int(bmc_attr['field_pos'])-1 - if not bmc_cmd in bmc_cache: - self.populate_bmc_cache_db(bmc_attr) + if bmc_cmd not in bmc_cache: + self.populate_bmc_cache_db(bmc_attr) else: - now = time.time() - if (int(now - bmc_cache[bmc_cmd]['time']) > bmc_db_update_time): - self.populate_bmc_cache_db(bmc_attr) + now = time.time() + if (int(now - bmc_cache[bmc_cmd]['time']) > bmc_db_update_time): + self.populate_bmc_cache_db(bmc_attr) try: - data=bmc_cache[bmc_cmd][field_name] - value = data.split()[field_pos] + data = bmc_cache[bmc_cmd][field_name] + value = data.split()[field_pos] except Exception as e: - pass + pass if 'mult' in bmc_attr.keys() and not value.isalpha(): if value.isalpha(): value = 0.0 value = float(value) * float(bmc_attr['mult']) - + return str(value) def raw_ipmi_get_request(self, bmc_attr): value = 'N/A' - cmd = bmc_attr['bmc_cmd'] + " 2>/dev/null" - if bmc_attr['type'] == 'raw': + cmd = bmc_attr['bmc_cmd'] + " 2>/dev/null" + if bmc_attr['type'] == 'raw': try: value = subprocess.check_output(cmd, shell=True).strip() except Exception as e: @@ -1397,7 +1355,7 @@ def raw_ipmi_get_request(self, bmc_attr): value = str(int(value, 16)) return value - if bmc_attr['type'] == 'mask': + if bmc_attr['type'] == 'mask': mask = int(bmc_attr['mask'].encode('utf-8'), 16) try: value = subprocess.check_output(cmd, shell=True).strip() @@ -1406,10 +1364,10 @@ def raw_ipmi_get_request(self, bmc_attr): if value != 'N/A': value = str(int(value, 16) & mask) - + return value - if bmc_attr['type'] == 'ascii': + if bmc_attr['type'] == 'ascii': try: value = subprocess.check_output(cmd, shell=True) except Exception as e: @@ -1417,19 +1375,19 @@ def raw_ipmi_get_request(self, bmc_attr): if value != 'N/A': tmp = ''.join(chr(int(i, 16)) for i in value.split()) - tmp = "".join(i for i in unicode(tmp) if unicodedata.category(i)[0]!="C") + tmp = "".join(i for i in str(tmp) if unicodedata.category(i)[0] != "C") value = str(tmp) return (value) - return value + return value - def bmc_get_cmd(self, bmc_attr): - if int(bmc_attr['raw']) == 1: + def bmc_get_cmd(self, bmc_attr): + if int(bmc_attr['raw']) == 1: value = self.raw_ipmi_get_request(bmc_attr) - else: + else: value = self.non_raw_ipmi_get_request(bmc_attr) - return (value) + return (value) def non_raw_ipmi_set_request(self, bmc_attr, val): value = 'N/A' @@ -1439,14 +1397,14 @@ def non_raw_ipmi_set_request(self, bmc_attr, val): def raw_ipmi_set_request(self, bmc_attr, val): value = 'N/A' # TODO: Implement this - return value + return value - def bmc_set_cmd(self, bmc_attr, val): - if int(bmc_attr['raw']) == 1: + def bmc_set_cmd(self, bmc_attr, val): + if int(bmc_attr['raw']) == 1: value = self.raw_ipmi_set_request(bmc_attr, val) - else: + else: value = self.non_raw_ipmi_set_request(bmc_attr, val) - return (value) + return (value) # bmc-based attr: return attr obj # non-bmc-based attr: return empty obj @@ -1459,43 +1417,43 @@ def check_bmc_based_attr(self, device_name, attr_name): return attr # Required attr_name is not supported in BMC object return {} - return None + return None def get_attr_name_output(self, device_name, attr_name): - bmc_attr = self.check_bmc_based_attr(device_name, attr_name) - output={"mode":"", "status":""} - + bmc_attr = self.check_bmc_based_attr(device_name, attr_name) + output = {"mode": "", "status": ""} + if bmc_attr is not None: - if bmc_attr=={}: - return {} - output['mode']="bmc" - output['status']=self.bmc_get_cmd(bmc_attr) + if bmc_attr == {}: + return {} + output['mode'] = "bmc" + output['status'] = self.bmc_get_cmd(bmc_attr) else: - output['mode']="i2c" - node = self.get_path(device_name, attr_name) - if node is None: - return {} - try: - with open(node, 'r') as f: - output['status'] = f.read() - except IOError: - return {} + output['mode'] = "i2c" + node = self.get_path(device_name, attr_name) + if node is None: + return {} + try: + with open(node, 'r') as f: + output['status'] = f.read() + except IOError: + return {} return output def set_attr_name_output(self, device_name, attr_name, val): - bmc_attr = self.check_bmc_based_attr(device_name, attr_name) - output={"mode":"", "status":""} - + bmc_attr = self.check_bmc_based_attr(device_name, attr_name) + output = {"mode": "", "status": ""} + if bmc_attr is not None: - if bmc_attr=={}: - return {} - output['mode']="bmc" - output['status']=False # No set operation allowed for BMC attributes as they are handled by BMC itself + if bmc_attr == {}: + return {} + output['mode'] = "bmc" + output['status'] = False # No set operation allowed for BMC attributes as they are handled by BMC itself else: - output['mode']="i2c" + output['mode'] = "i2c" node = self.get_path(device_name, attr_name) if node is None: - return {} + return {} try: with open(node, 'w') as f: f.write(str(val)) @@ -1505,4 +1463,3 @@ def set_attr_name_output(self, device_name, attr_name, val): output['status'] = True return output - diff --git a/platform/vs/docker-gbsyncd-vs/Dockerfile.j2 b/platform/vs/docker-gbsyncd-vs/Dockerfile.j2 index d740dca663cb..ae7e1c99b7c0 100644 --- a/platform/vs/docker-gbsyncd-vs/Dockerfile.j2 +++ b/platform/vs/docker-gbsyncd-vs/Dockerfile.j2 @@ -8,7 +8,7 @@ ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update -RUN apt-get install -f -y iproute2=4.20.0-2 libcap2-bin=1:2.25-2 +RUN apt-get install -f -y iproute2 libcap2-bin COPY \ {% for deb in docker_gbsyncd_vs_debs.split(' ') -%} diff --git a/platform/vs/docker-gbsyncd-vs/critical_processes b/platform/vs/docker-gbsyncd-vs/critical_processes index bdd6903c5690..4775a3e8af3b 100644 --- a/platform/vs/docker-gbsyncd-vs/critical_processes +++ b/platform/vs/docker-gbsyncd-vs/critical_processes @@ -1 +1 @@ -program:syncd +program:gbsyncdmgrd diff --git a/platform/vs/docker-gbsyncd-vs/supervisord.conf b/platform/vs/docker-gbsyncd-vs/supervisord.conf index 3583ef6b5a8f..b539349bcf47 100644 --- a/platform/vs/docker-gbsyncd-vs/supervisord.conf +++ b/platform/vs/docker-gbsyncd-vs/supervisord.conf @@ -10,12 +10,14 @@ autorestart=unexpected startretries=0 exitcodes=0,3 events=PROCESS_STATE +buffer_size=1024 [eventlistener:supervisor-proc-exit-listener] command=/usr/bin/supervisor-proc-exit-listener --container-name gbsyncd -events=PROCESS_STATE_EXITED +events=PROCESS_STATE_EXITED,PROCESS_STATE_RUNNING autostart=true autorestart=unexpected +buffer_size=1024 [program:rsyslogd] command=/usr/sbin/rsyslogd -n -iNONE @@ -37,8 +39,8 @@ stderr_logfile=syslog dependent_startup=true dependent_startup_wait_for=rsyslogd:running -[program:syncd] -command=/usr/bin/gbsyncd_start.sh +[program:gbsyncdmgrd] +command=/usr/bin/gbsyncdmgrd priority=3 autostart=false autorestart=false diff --git a/platform/vs/docker-ptf-sai.dep b/platform/vs/docker-ptf-sai.dep new file mode 100644 index 000000000000..697dc3b3cdcb --- /dev/null +++ b/platform/vs/docker-ptf-sai.dep @@ -0,0 +1,8 @@ +DPATH := $($(DOCKER_PTF_SAI)_PATH) +DEP_FILES := $(SONIC_COMMON_FILES_LIST) platform/vs/docker-ptf-sai.mk platform/vs/docker-ptf-sai.dep +DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) +DEP_FILES += $(shell git ls-files $(DPATH)) + +$(DOCKER_PTF_SAI)_CACHE_MODE := GIT_CONTENT_SHA +$(DOCKER_PTF_SAI)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(DOCKER_PTF_SAI)_DEP_FILES := $(DEP_FILES) diff --git a/platform/vs/docker-ptf-sai.mk b/platform/vs/docker-ptf-sai.mk new file mode 100644 index 000000000000..1a1480bf09cb --- /dev/null +++ b/platform/vs/docker-ptf-sai.mk @@ -0,0 +1,9 @@ +# docker image for docker-ptf-sai + +DOCKER_PTF_SAI = docker-ptf-sai.gz +DOCKER_PTF_BASE = docker-ptf.gz +$(DOCKER_PTF_SAI)_PATH = $(DOCKERS_PATH)/docker-ptf-sai +$(DOCKER_PTF_SAI)_DEPENDS += $(LIBTHRIFT_0_13_0) $(PYTHON3_THRIFT_0_13_0) +$(DOCKER_PTF_SAI)_LOAD_DOCKERS += $(DOCKER_PTF_BASE) +SONIC_DOCKER_IMAGES += $(DOCKER_PTF_SAI) +SONIC_STRETCH_DOCKERS += $(DOCKER_PTF_SAI) diff --git a/platform/vs/docker-ptf.dep b/platform/vs/docker-ptf.dep new file mode 100644 index 000000000000..8cd9f7b7a279 --- /dev/null +++ b/platform/vs/docker-ptf.dep @@ -0,0 +1,10 @@ + +DPATH := $($(DOCKER_PTF)_PATH) +DEP_FILES := $(SONIC_COMMON_FILES_LIST) platform/vs/docker-ptf.mk platform/vs/docker-ptf.dep +DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) +DEP_FILES += $(shell git ls-files $(DPATH)) + +$(DOCKER_PTF)_CACHE_MODE := GIT_CONTENT_SHA +$(DOCKER_PTF)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(DOCKER_PTF)_DEP_FILES := $(DEP_FILES) + diff --git a/platform/vs/docker-ptf.mk b/platform/vs/docker-ptf.mk new file mode 100644 index 000000000000..4fde844fe24b --- /dev/null +++ b/platform/vs/docker-ptf.mk @@ -0,0 +1,7 @@ +# docker image for docker-ptf + +DOCKER_PTF = docker-ptf.gz +$(DOCKER_PTF)_PATH = $(DOCKERS_PATH)/docker-ptf +$(DOCKER_PTF)_DEPENDS += $(LIBTHRIFT) $(PYTHON_THRIFT) $(PTF) $(PYTHON_SAITHRIFT) +SONIC_DOCKER_IMAGES += $(DOCKER_PTF) +SONIC_STRETCH_DOCKERS += $(DOCKER_PTF) diff --git a/platform/vs/docker-sonic-vs.mk b/platform/vs/docker-sonic-vs.mk index 7b82fce71ee0..6667c4abba9d 100644 --- a/platform/vs/docker-sonic-vs.mk +++ b/platform/vs/docker-sonic-vs.mk @@ -18,10 +18,9 @@ $(DOCKER_SONIC_VS)_DEPENDS += $(SWSS) \ # swsssdk is a dependency of sonic-py-common # TODO: sonic-py-common should depend on swsscommon instead -$(DOCKER_SONIC_VS)_PYTHON_WHEELS += $(SWSSSDK_PY2) \ - $(SWSSSDK_PY3) \ - $(SONIC_PY_COMMON_PY2) \ +$(DOCKER_SONIC_VS)_PYTHON_WHEELS += $(SWSSSDK_PY3) \ $(SONIC_PY_COMMON_PY3) \ + $(SONIC_PLATFORM_COMMON_PY3) \ $(SONIC_YANG_MODELS_PY3) \ $(SONIC_YANG_MGMT_PY3) \ $(SONIC_UTILITIES_PY3) \ @@ -35,9 +34,7 @@ $(DOCKER_SONIC_VS)_DEPENDS += $(SWSS_DBG) \ $(SYNCD_VS_DBG) endif -ifeq ($(SONIC_ROUTING_STACK), quagga) -$(DOCKER_SONIC_VS)_DEPENDS += $(QUAGGA) -else ifeq ($(SONIC_ROUTING_STACK), frr) +ifeq ($(SONIC_ROUTING_STACK), frr) $(DOCKER_SONIC_VS)_DEPENDS += $(FRR) else $(DOCKER_SONIC_VS)_DEPENDS += $(GOBGP) diff --git a/platform/vs/docker-sonic-vs/Dockerfile.j2 b/platform/vs/docker-sonic-vs/Dockerfile.j2 index a9f05f9b7421..4df8955f3920 100644 --- a/platform/vs/docker-sonic-vs/Dockerfile.j2 +++ b/platform/vs/docker-sonic-vs/Dockerfile.j2 @@ -101,33 +101,23 @@ RUN pip3 install \ {% if docker_sonic_vs_debs.strip() -%} # Copy locally-built Debian package dependencies -{%- for deb in docker_sonic_vs_debs.split(' ') %} -COPY debs/{{ deb }} /debs/ -{%- endfor %} +COPY {%- for deb in docker_sonic_vs_debs.split(' ') %} debs/{{ deb }}{%- endfor %} /debs/ # Install locally-built Debian packages and implicitly install their dependencies -{%- for deb in docker_sonic_vs_debs.split(' ') %} -RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; }; dpkg_apt /debs/{{ deb }} -{%- endfor %} +RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; }; {%- for deb in docker_sonic_vs_debs.split(' ') %} dpkg_apt /debs/{{ deb }};{%- endfor %} {%- endif %} {% if docker_sonic_vs_pydebs.strip() -%} # Copy locally-built Debian package dependencies -{%- for deb in docker_sonic_vs_pydebs.split(' ') %} -COPY python-debs/{{ deb }} /debs/ -{%- endfor %} +COPY {%- for deb in docker_sonic_vs_pydebs.split(' ') %} python-debs/{{ deb }}{%- endfor %} /debs/ # Install locally-built Debian packages and implicitly install their dependencies -{%- for deb in docker_sonic_vs_pydebs.split(' ') %} -RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; }; dpkg_apt /debs/{{ deb }} -{%- endfor %} +RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; }; {%- for deb in docker_sonic_vs_pydebs.split(' ') %} dpkg_apt /debs/{{ deb }};{%- endfor %} {%- endif %} {% if docker_sonic_vs_whls.strip() %} # copy all whl PKGs first, -{% for whl in docker_sonic_vs_whls.split(' ') -%} -COPY python-wheels/{{ whl }} python-wheels/ -{% endfor %} +copy {%- for whl in docker_sonic_vs_whls.split(' ') %} python-wheels/{{ whl }}{%- endfor %} python-wheels/ # install PKGs after copying all PKGs to avoid dependency failure # use py3 to find python3 package, which is forced by wheel as of now @@ -164,8 +154,10 @@ COPY ["files/sonic_version.yml", "/etc/sonic/"] COPY ["port_breakout_config_db.json", "/etc/sonic/"] COPY ["database_config.json", "/etc/default/sonic-db/"] COPY ["hostname.j2", "/usr/share/sonic/templates/"] +COPY ["init_cfg.json.j2", "/usr/share/sonic/templates/"] COPY ["default_chassis_cfg.json", "/etc/default/sonic-db/"] COPY ["asic_table.json", "/etc/sonic/"] +COPY ["zero_profiles.json", "/etc/sonic"] COPY ["buffermgrd.sh", "/usr/bin/"] COPY ["platform.json", "/usr/share/sonic/device/x86_64-kvm_x86_64-r0/"] diff --git a/platform/vs/docker-sonic-vs/buffermgrd.sh b/platform/vs/docker-sonic-vs/buffermgrd.sh index 9cdc57434a8f..a36fc7f94ca8 100755 --- a/platform/vs/docker-sonic-vs/buffermgrd.sh +++ b/platform/vs/docker-sonic-vs/buffermgrd.sh @@ -5,9 +5,13 @@ export ASIC_VENDOR=vs if [ "$BUFFER_CALCULATION_MODE" == "dynamic" ]; then BUFFERMGRD_ARGS="-a /etc/sonic/asic_table.json" + + if [ -f /etc/sonic/zero_profiles.json ]; then + BUFFERMGRD_ZERO_PROFILE_ARGS=" -z /etc/sonic/zero_profiles.json" + fi else # Should we use the fallback MAC in case it is not found in Device.Metadata BUFFERMGRD_ARGS="-l /usr/share/sonic/hwsku/pg_profile_lookup.ini" fi -exec /usr/bin/buffermgrd ${BUFFERMGRD_ARGS} +exec /usr/bin/buffermgrd ${BUFFERMGRD_ARGS} ${BUFFERMGRD_ZERO_PROFILE_ARGS} diff --git a/platform/vs/docker-sonic-vs/init_cfg.json.j2 b/platform/vs/docker-sonic-vs/init_cfg.json.j2 new file mode 100644 index 000000000000..7f41cbdaffca --- /dev/null +++ b/platform/vs/docker-sonic-vs/init_cfg.json.j2 @@ -0,0 +1,16 @@ +{ + "DEVICE_METADATA": { + "localhost": { + "mac": "{{ system_mac }}", + "buffer_model": "traditional" + } + }, +{% set features = ["swss", "bgp", "teamd", "nat", "database", "lldp", "dhcp_relay", "macsec"] %} + "FEATURE": { +{% for feature in features %} + "{{ feature }}": { + "state": "enabled" + }{% if not loop.last %},{% endif %} +{% endfor %} + } +} \ No newline at end of file diff --git a/platform/vs/docker-sonic-vs/start.sh b/platform/vs/docker-sonic-vs/start.sh index 7b246a49de1a..a3bed4c5f756 100755 --- a/platform/vs/docker-sonic-vs/start.sh +++ b/platform/vs/docker-sonic-vs/start.sh @@ -31,8 +31,13 @@ if [[ -f /usr/share/sonic/virtual_chassis/default_config.json ]]; then CHASS_CFG="-j /usr/share/sonic/virtual_chassis/default_config.json" fi +# Note: libswsscommon requires a dabase_config file in /var/run/redis/sonic-db/ +# Prepare this file before any dependent application, such as sonic-cfggen +mkdir -p /var/run/redis/sonic-db +cp /etc/default/sonic-db/database_config.json /var/run/redis/sonic-db/ + SYSTEM_MAC_ADDRESS=$(ip link show eth0 | grep ether | awk '{print $2}') -sonic-cfggen -a '{"DEVICE_METADATA":{"localhost": {"mac": "'$SYSTEM_MAC_ADDRESS'", "buffer_model": "traditional"}}}' $CHASS_CFG --print-data > /etc/sonic/init_cfg.json +sonic-cfggen -t /usr/share/sonic/templates/init_cfg.json.j2 -a "{\"system_mac\": \"$SYSTEM_MAC_ADDRESS\"}" $CHASS_CFG > /etc/sonic/init_cfg.json if [ -f /etc/sonic/config_db.json ]; then sonic-cfggen -j /etc/sonic/init_cfg.json -j /etc/sonic/config_db.json --print-data > /tmp/config_db.json @@ -68,9 +73,6 @@ else echo "10.8.1.200 redis_chassis.server" >> /etc/hosts fi -mkdir -p /var/run/redis/sonic-db -cp /etc/default/sonic-db/database_config.json /var/run/redis/sonic-db/ - supervisorctl start redis-server start_chassis_db=`sonic-cfggen -v DEVICE_METADATA.localhost.start_chassis_db -y $chassisdb_cfg_file` diff --git a/platform/vs/docker-sonic-vs/zero_profiles.json b/platform/vs/docker-sonic-vs/zero_profiles.json new file mode 100644 index 000000000000..fbd42bf7ec3e --- /dev/null +++ b/platform/vs/docker-sonic-vs/zero_profiles.json @@ -0,0 +1,57 @@ +[ + { + "BUFFER_POOL_TABLE:ingress_zero_pool": { + "mode": "static", + "type": "ingress", + "size": "0" + }, + "OP": "SET" + }, + { + "BUFFER_PROFILE_TABLE:ingress_lossy_pg_zero_profile" : { + "pool":"ingress_zero_pool", + "size":"0", + "static_th":"0" + }, + "OP": "SET" + }, + { + "BUFFER_PROFILE_TABLE:ingress_lossy_zero_profile" : { + "pool":"ingress_lossless_pool", + "size":"0", + "dynamic_th":"-8" + }, + "OP": "SET" + }, + { + "BUFFER_PROFILE_TABLE:ingress_lossless_zero_profile" : { + "pool":"ingress_lossless_pool", + "size":"0", + "dynamic_th":"-8" + }, + "OP": "SET" + }, + { + "BUFFER_PROFILE_TABLE:egress_lossy_zero_profile" : { + "pool":"egress_lossy_pool", + "size":"0", + "dynamic_th":"-8" + }, + "OP": "SET" + }, + { + "BUFFER_PROFILE_TABLE:egress_lossless_zero_profile" : { + "pool":"egress_lossless_pool", + "size":"0", + "dynamic_th":"-8" + }, + "OP": "SET" + }, + { + "control_fields" : { + "pgs_to_apply_zero_profile":"0", + "ingress_zero_profile":"ingress_lossy_pg_zero_profile" + }, + "OP": "SET" + } +] diff --git a/platform/vs/docker-syncd-vs/Dockerfile.j2 b/platform/vs/docker-syncd-vs/Dockerfile.j2 index 1ef1245e14fb..b3d7dcef490b 100644 --- a/platform/vs/docker-syncd-vs/Dockerfile.j2 +++ b/platform/vs/docker-syncd-vs/Dockerfile.j2 @@ -8,7 +8,7 @@ ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update -RUN apt-get install -f -y iproute2=4.20.0-2 libcap2-bin=1:2.25-2 +RUN apt-get install -f -y iproute2 libcap2-bin COPY \ {% for deb in docker_syncd_vs_debs.split(' ') -%} diff --git a/platform/vs/docker-syncd-vs/supervisord.conf b/platform/vs/docker-syncd-vs/supervisord.conf index 7416f23a45e5..7e18237b7dee 100644 --- a/platform/vs/docker-syncd-vs/supervisord.conf +++ b/platform/vs/docker-syncd-vs/supervisord.conf @@ -10,13 +10,14 @@ autorestart=unexpected startretries=0 exitcodes=0,3 events=PROCESS_STATE -buffer_size=25 +buffer_size=1024 [eventlistener:supervisor-proc-exit-listener] command=/usr/bin/supervisor-proc-exit-listener --container-name syncd -events=PROCESS_STATE_EXITED +events=PROCESS_STATE_EXITED,PROCESS_STATE_RUNNING autostart=true autorestart=unexpected +buffer_size=1024 [program:rsyslogd] command=/usr/sbin/rsyslogd -n -iNONE diff --git a/platform/vs/libsaithrift-dev.dep b/platform/vs/libsaithrift-dev.dep new file mode 100644 index 000000000000..be1d3f74b23f --- /dev/null +++ b/platform/vs/libsaithrift-dev.dep @@ -0,0 +1,13 @@ +#DPKG FRK +SPATH := $($(LIBSAITHRIFT_DEV)_SRC_PATH) +DEP_FILES := $(SONIC_COMMON_FILES_LIST) platform/broadcom/libsaithrift-dev.mk platform/broadcom/libsaithrift-dev.dep +DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) +SMDEP_PATHS := $(SPATH) $(SPATH)/bm/behavioral-model $(SPATH)/test/ptf $(SPATH)/test/saithrift/ctypesgen +$(foreach path, $(SMDEP_PATHS), $(eval $(path) :=$(filter-out $(SMDEP_PATHS),$(addprefix $(path)/, $(shell cd $(path) && git ls-files | grep -Ev " " ))))) + +$(LIBSAITHRIFT_DEV)_CACHE_MODE := GIT_CONTENT_SHA +$(LIBSAITHRIFT_DEV)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(LIBSAITHRIFT_DEV)_DEP_FILES := $(DEP_FILES) +$(LIBSAITHRIFT_DEV)_SMDEP_FILES := $(foreach path, $(SMDEP_PATHS), $($(path))) +$(LIBSAITHRIFT_DEV)_SMDEP_PATHS := $(SMDEP_PATHS) + diff --git a/platform/vs/libsaithrift-dev.mk b/platform/vs/libsaithrift-dev.mk new file mode 100644 index 000000000000..ba8a63d539ac --- /dev/null +++ b/platform/vs/libsaithrift-dev.mk @@ -0,0 +1,22 @@ +# libsaithrift-dev package + +SAI_VER = 0.9.4 + +LIBSAITHRIFT_DEV = libsaithrift-dev_$(SAI_VER)_$(CONFIGURED_ARCH).deb +$(LIBSAITHRIFT_DEV)_SRC_PATH = $(SRC_PATH)/sonic-sairedis/SAI +$(LIBSAITHRIFT_DEV)_DEPENDS += $(LIBTHRIFT) $(LIBTHRIFT_DEV) $(PYTHON_THRIFT) $(THRIFT_COMPILER) \ + $(LIBSAIVS) $(LIBSAIVS_DEV) $(LIBSAIMETADATA) $(LIBSAIMETADATA_DEV) +$(LIBSAITHRIFT_DEV)_RDEPENDS += $(LIBTHRIFT) $(LIBSAIVS) $(LIBSAIMETADATA) +$(LIBSAITHRIFT_DEV)_BUILD_ENV = platform=vs +SONIC_DPKG_DEBS += $(LIBSAITHRIFT_DEV) + +PYTHON_SAITHRIFT = python-saithrift_$(SAI_VER)_$(CONFIGURED_ARCH).deb +$(eval $(call add_extra_package,$(LIBSAITHRIFT_DEV),$(PYTHON_SAITHRIFT))) + +SAISERVER = saiserver_$(SAI_VER)_$(CONFIGURED_ARCH).deb +$(SAISERVER)_RDEPENDS += $(LIBTHRIFT) $(LIBSAIVS) +$(eval $(call add_extra_package,$(LIBSAITHRIFT_DEV),$(SAISERVER))) + +SAISERVER_DBG = saiserver-dbg_$(SAI_VER)_$(CONFIGURED_ARCH).deb +$(SAISERVER_DBG)_RDEPENDS += $(SAISERVER) +$(eval $(call add_extra_package,$(LIBSAITHRIFT_DEV),$(SAISERVER_DBG))) diff --git a/platform/vs/rules.dep b/platform/vs/rules.dep index 7d36c819509e..44c863612992 100644 --- a/platform/vs/rules.dep +++ b/platform/vs/rules.dep @@ -2,6 +2,10 @@ include $(PLATFORM_PATH)/syncd-vs.dep include $(PLATFORM_PATH)/sonic-version.dep include $(PLATFORM_PATH)/docker-sonic-vs.dep include $(PLATFORM_PATH)/docker-syncd-vs.dep +include $(PLATFORM_PATH)/docker-gbsyncd-vs.dep +include $(PLATFORM_PATH)/docker-ptf.dep +include $(PLATFORM_PATH)/docker-ptf-sai.dep +include $(PLATFORM_PATH)/libsaithrift-dev.dep include $(PLATFORM_PATH)/one-image.dep include $(PLATFORM_PATH)/onie.dep include $(PLATFORM_PATH)/kvm-image.dep diff --git a/platform/vs/rules.mk b/platform/vs/rules.mk index 66e8bad5fe78..461c3f84dd02 100644 --- a/platform/vs/rules.mk +++ b/platform/vs/rules.mk @@ -3,6 +3,9 @@ include $(PLATFORM_PATH)/sonic-version.mk include $(PLATFORM_PATH)/docker-sonic-vs.mk include $(PLATFORM_PATH)/docker-syncd-vs.mk include $(PLATFORM_PATH)/docker-gbsyncd-vs.mk +include $(PLATFORM_PATH)/docker-ptf.mk +include $(PLATFORM_PATH)/docker-ptf-sai.mk +include $(PLATFORM_PATH)/libsaithrift-dev.mk include $(PLATFORM_PATH)/one-image.mk include $(PLATFORM_PATH)/onie.mk include $(PLATFORM_PATH)/kvm-image.mk diff --git a/platform/vs/sonic-gns3a.sh b/platform/vs/sonic-gns3a.sh index 41e39cd8686a..2a772ce5a332 100644 --- a/platform/vs/sonic-gns3a.sh +++ b/platform/vs/sonic-gns3a.sh @@ -41,9 +41,9 @@ echo " \"category\": \"router\", \"description\": \"SONiC Virtual Switch/Router\", \"vendor_name\": \"SONiC\", - \"vendor_url\": \"https://azure.github.io/SONiC/\", + \"vendor_url\": \"https://sonic-net.github.io/SONiC/\", \"product_name\": \"SONiC\", - \"product_url\": \"https://azure.github.io/SONiC/\", + \"product_url\": \"https://sonic-net.github.io/SONiC/\", \"registry_version\": 3, \"status\": \"experimental\", \"maintainer\": \"SONiC\", diff --git a/platform/vs/sonic-version/build_sonic_version.sh b/platform/vs/sonic-version/build_sonic_version.sh index f118a1c20a6d..13c0be39bb79 100755 --- a/platform/vs/sonic-version/build_sonic_version.sh +++ b/platform/vs/sonic-version/build_sonic_version.sh @@ -2,6 +2,7 @@ tee $1 > /dev/null <> $(PROJECT_ROOT)/$@.log || { [ $$? -eq 0 ] || pushd $(PROJECT_ROOT) > /dev/null ; ./update_screen.sh -e $@ ; popd > /dev/null ; false ; } -LOG = |& $(PROJECT_ROOT)/scripts/process_log.sh $(PROCESS_LOG_OPTION) &>> $(PROJECT_ROOT)/$@.log ; test $${PIPESTATUS[-2]} -eq 0 || { [ $$? -eq 0 ] || pushd $(PROJECT_ROOT) > /dev/null ; ./update_screen.sh -e $@ ; popd > /dev/null ; false ; } +LOG = < /dev/null |& $(PROJECT_ROOT)/scripts/process_log.sh $(PROCESS_LOG_OPTION) &>> $(PROJECT_ROOT)/$@.log ; test $${PIPESTATUS[-2]} -eq 0 || { [ $$? -eq 0 ] || pushd $(PROJECT_ROOT) > /dev/null ; ./update_screen.sh -e $@ ; popd > /dev/null ; false ; } ############################################################################### ## Header and footer for each target @@ -117,6 +117,7 @@ define add_dbg_docker $(2)_PATH = $($(1)_PATH) $(2)_DBG_DEPENDS += $($(1)_DBG_DEPENDS) $(2)_DBG_IMAGE_PACKAGES += $($(1)_DBG_IMAGE_PACKAGES) +$(2)_PYTHON_DEBS += $($(1)_PYTHON_DEBS) $(2)_PYTHON_WHEELS += $($(1)_PYTHON_WHEELS) $(2)_LOAD_DOCKERS += $($(1)_LOAD_DOCKERS) $(2)_CACHE_MODE += $($(1)_CACHE_MODE) @@ -145,11 +146,23 @@ expand = $(foreach d,$(1),$(call expand,$($(d)_$(2)),$(2))) $(1) ## Uninstall debs ############################################################################### define UNINSTALL_DEBS -$(info $(1)) -$(foreach deb,$(1), \ - { while true; do \ - if mkdir $(DEBS_PATH)/dpkg_lock &> /dev/null; then \ - { sudo DEBIAN_FRONTEND=noninteractive dpkg -P $(firstword $(subst _, ,$(basename $(deb)))) $(LOG) && rm -d $(DEBS_PATH)/dpkg_lock && break; } || { rm -d $(DEBS_PATH)/dpkg_lock && exit 1 ; } \ - fi; \ - done; } ) +if [ -n "$(1)" ]; then \ + while true; do \ + if mkdir $(DEBS_PATH)/dpkg_lock &> /dev/null; then \ + { sudo DEBIAN_FRONTEND=noninteractive dpkg -P $(foreach deb,$(1),$(firstword $(subst _, ,$(basename $(deb))))) $(LOG) && rm -d $(DEBS_PATH)/dpkg_lock && break; } || { rm -d $(DEBS_PATH)/dpkg_lock && exit 1 ; } \ + fi; \ + done; \ +fi +endef + +############################################################################### +## Setup overlay fs for dpkg admin directory /var/lib/dpkg +############################################################################### +define SETUP_OVERLAYFS_FOR_DPKG_ADMINDIR +upperdir=$(shell mktemp -d -p $(DPKG_ADMINDIR_PATH)) +workdir=$(shell mktemp -d -p $(DPKG_ADMINDIR_PATH)) +mergedir=$(shell mktemp -d -p $(DPKG_ADMINDIR_PATH)) +sudo mount -t overlay overlay -olowerdir=/var/lib/dpkg,upperdir=$$upperdir,workdir=$$workdir $$mergedir +export SONIC_DPKG_ADMINDIR=$$mergedir +trap "sudo umount $$mergedir && rm -rf $$mergedir $$upperdir $$workdir" EXIT endef diff --git a/rules/hiredis.mk b/rules/hiredis.mk index 71a18a1d6aac..a97e0bf1bb83 100644 --- a/rules/hiredis.mk +++ b/rules/hiredis.mk @@ -1,7 +1,7 @@ # libhiredis package -HIREDIS_VERSION = 0.14.0 -HIREDIS_VERSION_FULL = $(HIREDIS_VERSION)-3~bpo9+1 +HIREDIS_VERSION = 0.14.1 +HIREDIS_VERSION_FULL = ${HIREDIS_VERSION}-1 export HIREDIS_VERSION HIREDIS_VERSION_FULL @@ -12,6 +12,7 @@ SONIC_MAKE_DEBS += $(LIBHIREDIS) LIBHIREDIS_DEV = libhiredis-dev_$(HIREDIS_VERSION_FULL)_$(CONFIGURED_ARCH).deb $(eval $(call add_derived_package,$(LIBHIREDIS),$(LIBHIREDIS_DEV))) -LIBHIREDIS_DBG = libhiredis-dbg_$(HIREDIS_VERSION_FULL)_$(CONFIGURED_ARCH).deb LIBHIREDIS_DBG = libhiredis0.14-dbgsym_$(HIREDIS_VERSION_FULL)_$(CONFIGURED_ARCH).deb $(eval $(call add_derived_package,$(LIBHIREDIS),$(LIBHIREDIS_DBG))) + +export LIBHIREDIS LIBHIREDIS_DEV LIBHIREDIS_DBG diff --git a/rules/isc-dhcp.mk b/rules/isc-dhcp.mk index 3edebfd0dde0..0951836470ce 100644 --- a/rules/isc-dhcp.mk +++ b/rules/isc-dhcp.mk @@ -1,7 +1,7 @@ # isc-dhcp packages ISC_DHCP_VERSION = 4.4.1 -ISC_DHCP_VERSION_FULL = ${ISC_DHCP_VERSION}-2 +ISC_DHCP_VERSION_FULL = ${ISC_DHCP_VERSION}-2.3+deb11u1 export ISC_DHCP_VERSION ISC_DHCP_VERSION_FULL diff --git a/rules/libyang.mk b/rules/libyang.mk index 5a5000d7c425..181db2368c6d 100644 --- a/rules/libyang.mk +++ b/rules/libyang.mk @@ -10,6 +10,9 @@ export LIBYANG_SUBVERSION LIBYANG = libyang_$(LIBYANG_VERSION)_$(CONFIGURED_ARCH).deb $(LIBYANG)_SRC_PATH = $(SRC_PATH)/libyang +# introduce artifical dependency between LIBYANG and FRR +# make sure LIBYANG is compile after FRR +$(LIBYANG)_AFTER = $(FRR) SONIC_MAKE_DEBS += $(LIBYANG) LIBYANG_DEV = libyang-dev_$(LIBYANG_VERSION)_$(CONFIGURED_ARCH).deb @@ -30,4 +33,7 @@ LIBYANG_PY2 = python2-yang_$(LIBYANG_VERSION)_$(CONFIGURED_ARCH).deb $(LIBYANG_PY2)_DEPENDS += $(LIBYANG) $(LIBYANG_CPP) $(eval $(call add_derived_package,$(LIBYANG),$(LIBYANG_PY2))) +$(eval $(call add_conflict_package,$(LIBYANG),$(LIBYANG1))) +$(eval $(call add_conflict_package,$(LIBYANG_DEV),$(LIBYANG1_DEV))) + export LIBYANG LIBYANG_DBG LIBYANG_DEV LIBYANG_CPP LIBYANG_PY3 LIBYANG_PY2 diff --git a/rules/linkmgrd.dep b/rules/linkmgrd.dep new file mode 100644 index 000000000000..31894e46d298 --- /dev/null +++ b/rules/linkmgrd.dep @@ -0,0 +1,11 @@ + +SPATH := $($(SONIC_LINKMGRD)_SRC_PATH) +DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/linkmgrd.mk rules/linkmgrd.dep +DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) +SMDEP_FILES := $(addprefix $(SPATH)/,$(shell cd $(SPATH) && git ls-files)) + +$(SONIC_LINKMGRD)_CACHE_MODE := GIT_CONTENT_SHA +$(SONIC_LINKMGRD)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(SONIC_LINKMGRD)_DEP_FILES := $(DEP_FILES) +$(SONIC_LINKMGRD)_SMDEP_FILES := $(SMDEP_FILES) +$(SONIC_LINKMGRD)_SMDEP_PATHS := $(SPATH) diff --git a/rules/linkmgrd.mk b/rules/linkmgrd.mk new file mode 100644 index 000000000000..07101f0c47fb --- /dev/null +++ b/rules/linkmgrd.mk @@ -0,0 +1,20 @@ +# SONiC LINK ManaGeR Daemon package + +SONIC_LINKMGRD_VERSION = 1.0.0-1 +SONIC_LINKMGRD_PKG_NAME = linkmgrd + +export SONIC_LINKMGRD_VERSION SONIC_LINKMGRD_PKG_NAME + +SONIC_LINKMGRD = sonic-$(SONIC_LINKMGRD_PKG_NAME)_$(SONIC_LINKMGRD_VERSION)_$(CONFIGURED_ARCH).deb +$(SONIC_LINKMGRD)_SRC_PATH = $(SRC_PATH)/$(SONIC_LINKMGRD_PKG_NAME) +$(SONIC_LINKMGRD)_DEPENDS = $(LIBSWSSCOMMON_DEV) $(LIBHIREDIS_DEV) +$(SONIC_LINKMGRD)_RDEPENDS = $(LIBSWSSCOMMON) $(LIBHIREDIS) + +SONIC_DPKG_DEBS += $(SONIC_LINKMGRD) + +SONIC_LINKMGRD_DBG = sonic-$(SONIC_LINKMGRD_PKG_NAME)-dbgsym_$(SONIC_LINKMGRD_VERSION)_$(CONFIGURED_ARCH).deb +$(SONIC_LINKMGRD)_DBG_DEPENDS = $(LIBSWSSCOMMON_DEV) $(LIBHIREDIS_DEV) +$(SONIC_LINKMGRD)_DBG_RDEPENDS = $(LIBSWSSCOMMON_DBG) $(LIBHIREDIS_DBG) +$(eval $(call add_derived_package,$(SONIC_LINKMGRD),$(SONIC_LINKMGRD_DBG))) + +export SONIC_LINKMGRD SONIC_LINKMGRD_DBG diff --git a/rules/linux-kernel.mk b/rules/linux-kernel.mk index 600600cc96f6..2d369361a9e5 100644 --- a/rules/linux-kernel.mk +++ b/rules/linux-kernel.mk @@ -1,9 +1,9 @@ # linux kernel package -KVERSION_SHORT = 4.19.0-9-2 +KVERSION_SHORT = 4.19.0-12-2 KVERSION = $(KVERSION_SHORT)-$(CONFIGURED_ARCH) -KERNEL_VERSION = 4.19.118 -KERNEL_SUBVERSION = 2+deb10u1 +KERNEL_VERSION = 4.19.152 +KERNEL_SUBVERSION = 1 ifeq ($(CONFIGURED_ARCH), armhf) # Override kernel version for ARMHF as it uses arm MP (multi-platform) for short version KVERSION = $(KVERSION_SHORT)-armmp @@ -18,5 +18,9 @@ SONIC_MAKE_DEBS += $(LINUX_HEADERS_COMMON) LINUX_HEADERS = linux-headers-$(KVERSION)_$(KERNEL_VERSION)-$(KERNEL_SUBVERSION)_$(CONFIGURED_ARCH).deb $(eval $(call add_derived_package,$(LINUX_HEADERS_COMMON),$(LINUX_HEADERS))) -LINUX_KERNEL = linux-image-$(KVERSION)-unsigned_$(KERNEL_VERSION)-$(KERNEL_SUBVERSION)_$(CONFIGURED_ARCH).deb +ifeq ($(CONFIGURED_ARCH), armhf) + LINUX_KERNEL = linux-image-$(KVERSION)_$(KERNEL_VERSION)-$(KERNEL_SUBVERSION)_$(CONFIGURED_ARCH).deb +else + LINUX_KERNEL = linux-image-$(KVERSION)-unsigned_$(KERNEL_VERSION)-$(KERNEL_SUBVERSION)_$(CONFIGURED_ARCH).deb +endif $(eval $(call add_derived_package,$(LINUX_HEADERS_COMMON),$(LINUX_KERNEL))) diff --git a/rules/phy-credo.mk b/rules/phy-credo.mk index f132498ec211..574afd7a39fe 100644 --- a/rules/phy-credo.mk +++ b/rules/phy-credo.mk @@ -1,3 +1,3 @@ PHY_CREDO = phy-credo_1.0_amd64.deb -$(PHY_CREDO)_URL = "https://github.com/aristanetworks/sonic-firmware/raw/78a3df2/phy/phy-credo_1.0_amd64.deb" +$(PHY_CREDO)_URL = "https://github.com/aristanetworks/sonic-firmware/raw/6d0d1661d92a342acedb6839dba970ae5778b478/phy/phy-credo_1.0_amd64.deb" SONIC_ONLINE_DEBS += $(PHY_CREDO) diff --git a/rules/quagga.dep b/rules/quagga.dep deleted file mode 100644 index abaf234a4fee..000000000000 --- a/rules/quagga.dep +++ /dev/null @@ -1,13 +0,0 @@ - -SPATH := $($(QUAGGA)_SRC_PATH) -DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/quagga.mk rules/quagga.dep -DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) -SMDEP_FILES := $(addprefix $(SPATH)/,$(shell cd $(SPATH) && git ls-files)) - -#DPKG_FRK -$(QUAGGA)_CACHE_MODE := GIT_CONTENT_SHA -$(QUAGGA)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) -$(QUAGGA)_DEP_FILES := $(DEP_FILES) -$(QUAGGA)_SMDEP_FILES := $(SMDEP_FILES) -$(QUAGGA)_SMDEP_PATHS := $(SPATH) - diff --git a/rules/quagga.mk b/rules/quagga.mk deleted file mode 100644 index 2caef76b2cfd..000000000000 --- a/rules/quagga.mk +++ /dev/null @@ -1,11 +0,0 @@ -# quagga package - -QUAGGA_VERSION_FULL = 0.99.24.1-2.1 - -QUAGGA = quagga_$(QUAGGA_VERSION_FULL)_$(CONFIGURED_ARCH).deb -$(QUAGGA)_DEPENDS += $(LIBSNMP_DEV) -$(QUAGGA)_SRC_PATH = $(SRC_PATH)/sonic-quagga -SONIC_DPKG_DEBS += $(QUAGGA) - -QUAGGA_DBG = quagga-dbg_$(QUAGGA_VERSION_FULL)_$(CONFIGURED_ARCH).deb -$(eval $(call add_derived_package,$(QUAGGA),$(QUAGGA_DBG))) diff --git a/rules/restapi.mk b/rules/restapi.mk index e66b4a1d976a..21eed4cfbb51 100644 --- a/rules/restapi.mk +++ b/rules/restapi.mk @@ -1,6 +1,6 @@ # sonic-rest-api package -RESTAPI = sonic-rest-api_1.0.1_amd64.deb +RESTAPI = sonic-rest-api_1.0.1_$(CONFIGURED_ARCH).deb $(RESTAPI)_SRC_PATH = $(SRC_PATH)/sonic-restapi $(RESTAPI)_DEPENDS += $(LIBHIREDIS_DEV) $(LIBNL3_DEV) $(LIBNL_GENL3_DEV) \ $(LIBNL_ROUTE3_DEV) $(LIBSWSSCOMMON_DEV) $(LIBSWSSCOMMON) diff --git a/rules/scapy.dep b/rules/scapy.dep new file mode 100644 index 000000000000..ef09fb12223b --- /dev/null +++ b/rules/scapy.dep @@ -0,0 +1,10 @@ +SPATH := $($(SCAPY)_SRC_PATH) +DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/scapy.mk rules/scapy.dep +DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) +SMDEP_FILES := $(addprefix $(SPATH)/,$(shell cd $(SPATH) && git ls-files -- ':!:doc/*')) + +$(SCAPY)_CACHE_MODE := GIT_CONTENT_SHA +$(SCAPY)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(SCAPY)_DEP_FILES := $(DEP_FILES) +$(SCAPY)_SMDEP_FILES := $(SMDEP_FILES) +$(SCAPY)_SMDEP_PATHS := $(SPATH) diff --git a/rules/scapy.mk b/rules/scapy.mk new file mode 100644 index 000000000000..6953c1ef10e2 --- /dev/null +++ b/rules/scapy.mk @@ -0,0 +1,7 @@ +# scapy python3 wheel + +SCAPY = scapy-2.4.5-py2.py3-none-any.whl +$(SCAPY)_SRC_PATH = $(SRC_PATH)/scapy +$(SCAPY)_PYTHON_VERSION = 3 +$(SCAPY)_TEST = n +SONIC_PYTHON_WHEELS += $(SCAPY) diff --git a/rules/sflow.mk b/rules/sflow.mk index f41bde774f02..7f0ac72bed3f 100644 --- a/rules/sflow.mk +++ b/rules/sflow.mk @@ -1,7 +1,7 @@ # host-sflow package -HSFLOWD_VERSION = 2.0.28 -HSFLOWD_SUBVERSION = 2 +HSFLOWD_VERSION = 2.0.32 +HSFLOWD_SUBVERSION = 1 export HSFLOWD_VERSION HSFLOWD_SUBVERSION HSFLOWD = hsflowd_$(HSFLOWD_VERSION)-$(HSFLOWD_SUBVERSION)_$(CONFIGURED_ARCH).deb diff --git a/rules/sonic-config.dep b/rules/sonic-config.dep index 148e43a96a5c..9df17ac3a080 100644 --- a/rules/sonic-config.dep +++ b/rules/sonic-config.dep @@ -4,6 +4,7 @@ SPATH := $($(SONIC_CONFIG_ENGINE_PY2)_SRC_PATH) DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/sonic-config.mk rules/sonic-config.dep DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) DEP_FILES += $(shell git ls-files $(SPATH)) +DEP_FILES += files/image_config/interfaces/interfaces.j2 dockers/docker-orchagent/ports.json.j2 dockers/docker-dhcp-relay/wait_for_intf.sh.j2 dockers/docker-dhcp-relay/docker-dhcp-relay.supervisord.conf.j2 dockers/docker-lldp/lldpd.conf.j2 dockers/docker-orchagent/ipinip.json.j2 $(shell find device -type f) files/build_templates/qos_config.j2 dockers/docker-orchagent/switch.json.j2 files/image_config/constants/constants.yml $(SONIC_CONFIG_ENGINE_PY2)_CACHE_MODE := GIT_CONTENT_SHA $(SONIC_CONFIG_ENGINE_PY2)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) diff --git a/rules/sonic-config.mk b/rules/sonic-config.mk index 996e311b5fee..e8e59fc1b92d 100644 --- a/rules/sonic-config.mk +++ b/rules/sonic-config.mk @@ -2,7 +2,8 @@ SONIC_CONFIG_ENGINE_PY2 = sonic_config_engine-1.0-py2-none-any.whl $(SONIC_CONFIG_ENGINE_PY2)_SRC_PATH = $(SRC_PATH)/sonic-config-engine -$(SONIC_CONFIG_ENGINE_PY2)_DEPENDS += $(SWSSSDK_PY2) $(SONIC_PY_COMMON_PY2) +$(SONIC_CONFIG_ENGINE_PY2)_DEPENDS += $(SONIC_PY_COMMON_PY2) +$(SONIC_CONFIG_ENGINE_PY2)_DEBS_DEPENDS += $(PYTHON_SWSSCOMMON) $(SONIC_CONFIG_ENGINE_PY2)_PYTHON_VERSION = 2 SONIC_PYTHON_WHEELS += $(SONIC_CONFIG_ENGINE_PY2) @@ -10,7 +11,8 @@ SONIC_PYTHON_WHEELS += $(SONIC_CONFIG_ENGINE_PY2) SONIC_CONFIG_ENGINE_PY3 = sonic_config_engine-1.0-py3-none-any.whl $(SONIC_CONFIG_ENGINE_PY3)_SRC_PATH = $(SRC_PATH)/sonic-config-engine -$(SONIC_CONFIG_ENGINE_PY3)_DEPENDS += $(SWSSSDK_PY3) $(SONIC_PY_COMMON_PY3) +$(SONIC_CONFIG_ENGINE_PY3)_DEPENDS += $(SONIC_PY_COMMON_PY3) +$(SONIC_CONFIG_ENGINE_PY3)_DEBS_DEPENDS += $(PYTHON3_SWSSCOMMON) # Synthetic dependency to avoid building the Python 2 and 3 packages # simultaneously and any potential conflicts which may arise $(SONIC_CONFIG_ENGINE_PY3)_DEPENDS += $(SONIC_CONFIG_ENGINE_PY2) diff --git a/rules/sonic-frr-mgmt-framework.dep b/rules/sonic-frr-mgmt-framework.dep new file mode 100644 index 000000000000..318c4edd1da8 --- /dev/null +++ b/rules/sonic-frr-mgmt-framework.dep @@ -0,0 +1,8 @@ +SPATH := $($(SONIC_FRR_MGMT_FRAMEWORK)_SRC_PATH) +DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/sonic-frr-mgmt-framework.mk rules/sonic-frr-mgmt-framework.dep +DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) +DEP_FILES += $(shell git ls-files $(SPATH)) + +$(SONIC_FRR_MGMT_FRAMEWORK)_CACHE_MODE := GIT_CONTENT_SHA +$(SONIC_FRR_MGMT_FRAMEWORK)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(SONIC_FRR_MGMT_FRAMEWORK)_DEP_FILES := $(DEP_FILES) diff --git a/rules/sonic-frr-mgmt-framework.mk b/rules/sonic-frr-mgmt-framework.mk new file mode 100644 index 000000000000..dfe981b440a9 --- /dev/null +++ b/rules/sonic-frr-mgmt-framework.mk @@ -0,0 +1,13 @@ +# sonic-frr-mgmt-framework package + +SONIC_FRR_MGMT_FRAMEWORK = sonic_frr_mgmt_framework-1.0-py3-none-any.whl +$(SONIC_FRR_MGMT_FRAMEWORK)_SRC_PATH = $(SRC_PATH)/sonic-frr-mgmt-framework +# These dependencies are only needed because they are dependencies +# of sonic-config-engine and frrcfgd explicitly calls sonic-cfggen +# as part of its unit tests. +# TODO: Refactor unit tests so that these dependencies are not needed + +$(SONIC_FRR_MGMT_FRAMEWORK)_DEPENDS += $(SONIC_CONFIG_ENGINE_PY3) +$(SONIC_FRR_MGMT_FRAMEWORK)_DEBS_DEPENDS += $(PYTHON_SWSSCOMMON) +$(SONIC_FRR_MGMT_FRAMEWORK)_PYTHON_VERSION = 3 +SONIC_PYTHON_WHEELS += $(SONIC_FRR_MGMT_FRAMEWORK) diff --git a/rules/sonic-host-services.mk b/rules/sonic-host-services.mk index 022c237ee950..87463d2ba8cc 100644 --- a/rules/sonic-host-services.mk +++ b/rules/sonic-host-services.mk @@ -5,4 +5,6 @@ $(SONIC_HOST_SERVICES_PY3)_SRC_PATH = $(SRC_PATH)/sonic-host-services $(SONIC_HOST_SERVICES_PY3)_PYTHON_VERSION = 3 $(SONIC_HOST_SERVICES_PY3)_DEPENDS += $(SONIC_PY_COMMON_PY3) \ $(SWSSSDK_PY3) +$(SONIC_HOST_SERVICES_PY3)_DEBS_DEPENDS = $(LIBSWSSCOMMON) \ + $(PYTHON3_SWSSCOMMON) SONIC_PYTHON_WHEELS += $(SONIC_HOST_SERVICES_PY3) diff --git a/rules/sonic-platform-common.dep b/rules/sonic-platform-common.dep index f93240135988..e921c4df01af 100644 --- a/rules/sonic-platform-common.dep +++ b/rules/sonic-platform-common.dep @@ -2,7 +2,7 @@ SPATH := $($(SONIC_PLATFORM_COMMON_PY2)_SRC_PATH) DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/sonic-platform-common.mk rules/sonic-platform-common.dep DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) -SMDEP_FILES := $(addprefix $(SPATH)/,$(shell cd $(SPATH) && git ls-files|grep -Ev "sonic_sfp|sonic_eeprom")) +SMDEP_FILES := $(addprefix $(SPATH)/,$(shell cd $(SPATH) && git ls-files|grep -Ev "^sonic_sfp|^sonic_eeprom")) $(SONIC_PLATFORM_COMMON_PY2)_CACHE_MODE := GIT_CONTENT_SHA $(SONIC_PLATFORM_COMMON_PY2)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) diff --git a/rules/sonic-platform-common.mk b/rules/sonic-platform-common.mk index a734abfd6d72..b3dd0155d59e 100644 --- a/rules/sonic-platform-common.mk +++ b/rules/sonic-platform-common.mk @@ -10,8 +10,7 @@ SONIC_PYTHON_WHEELS += $(SONIC_PLATFORM_COMMON_PY2) SONIC_PLATFORM_COMMON_PY3 = sonic_platform_common-1.0-py3-none-any.whl $(SONIC_PLATFORM_COMMON_PY3)_SRC_PATH = $(SRC_PATH)/sonic-platform-common $(SONIC_PLATFORM_COMMON_PY3)_PYTHON_VERSION = 3 -$(SONIC_PLATFORM_COMMON_PY3)_DEPENDS += $(SONIC_PY_COMMON_PY3) +$(SONIC_PLATFORM_COMMON_PY3)_DEPENDS += $(SONIC_PY_COMMON_PY3) $(SONIC_CONFIG_ENGINE_PY3) # Synthetic dependency just to avoid race condition $(SONIC_PLATFORM_COMMON_PY3)_DEPENDS += $(SONIC_PLATFORM_COMMON_PY2) -$(SONIC_PLATFORM_COMMON_PY3)_TEST = n SONIC_PYTHON_WHEELS += $(SONIC_PLATFORM_COMMON_PY3) diff --git a/rules/sonic-psud.mk b/rules/sonic-psud.mk index b07aa31b2002..a576be3ea03a 100644 --- a/rules/sonic-psud.mk +++ b/rules/sonic-psud.mk @@ -4,7 +4,7 @@ SONIC_PSUD_PY2 = sonic_psud-1.0-py2-none-any.whl $(SONIC_PSUD_PY2)_SRC_PATH = $(SRC_PATH)/sonic-platform-daemons/sonic-psud -$(SONIC_PSUD_PY2)_DEPENDS = $(SONIC_PY_COMMON_PY2) +$(SONIC_PSUD_PY2)_DEPENDS = $(SONIC_PY_COMMON_PY2) $(SONIC_PLATFORM_COMMON_PY2) $(SONIC_PSUD_PY2)_DEBS_DEPENDS = $(LIBSWSSCOMMON) $(PYTHON_SWSSCOMMON) $(SONIC_PSUD_PY2)_PYTHON_VERSION = 2 SONIC_PYTHON_WHEELS += $(SONIC_PSUD_PY2) @@ -13,7 +13,7 @@ SONIC_PYTHON_WHEELS += $(SONIC_PSUD_PY2) SONIC_PSUD_PY3 = sonic_psud-1.0-py3-none-any.whl $(SONIC_PSUD_PY3)_SRC_PATH = $(SRC_PATH)/sonic-platform-daemons/sonic-psud -$(SONIC_PSUD_PY3)_DEPENDS = $(SONIC_PY_COMMON_PY3) $(SONIC_PSUD_PY2) +$(SONIC_PSUD_PY3)_DEPENDS = $(SONIC_PY_COMMON_PY3) $(SONIC_PLATFORM_COMMON_PY3) $(SONIC_PSUD_PY2) $(SONIC_PSUD_PY3)_DEBS_DEPENDS = $(LIBSWSSCOMMON) $(PYTHON3_SWSSCOMMON) $(SONIC_PSUD_PY3)_PYTHON_VERSION = 3 SONIC_PYTHON_WHEELS += $(SONIC_PSUD_PY3) diff --git a/rules/sonic-syseepromd.mk b/rules/sonic-syseepromd.mk index 0732e3b531c5..03cc20a38f7a 100644 --- a/rules/sonic-syseepromd.mk +++ b/rules/sonic-syseepromd.mk @@ -4,7 +4,7 @@ SONIC_SYSEEPROMD_PY2 = sonic_syseepromd-1.0-py2-none-any.whl $(SONIC_SYSEEPROMD_PY2)_SRC_PATH = $(SRC_PATH)/sonic-platform-daemons/sonic-syseepromd -$(SONIC_SYSEEPROMD_PY2)_DEPENDS = $(SONIC_PY_COMMON_PY2) +$(SONIC_SYSEEPROMD_PY2)_DEPENDS = $(SONIC_PY_COMMON_PY2) $(SONIC_PLATFORM_COMMON_PY2) $(SONIC_SYSEEPROMD_PY2)_DEBS_DEPENDS = $(LIBSWSSCOMMON) $(PYTHON_SWSSCOMMON) $(SONIC_SYSEEPROMD_PY2)_PYTHON_VERSION = 2 SONIC_PYTHON_WHEELS += $(SONIC_SYSEEPROMD_PY2) @@ -13,7 +13,7 @@ SONIC_PYTHON_WHEELS += $(SONIC_SYSEEPROMD_PY2) SONIC_SYSEEPROMD_PY3 = sonic_syseepromd-1.0-py3-none-any.whl $(SONIC_SYSEEPROMD_PY3)_SRC_PATH = $(SRC_PATH)/sonic-platform-daemons/sonic-syseepromd -$(SONIC_SYSEEPROMD_PY3)_DEPENDS = $(SONIC_PY_COMMON_PY3) $(SONIC_SYSEEPROMD_PY2) +$(SONIC_SYSEEPROMD_PY3)_DEPENDS = $(SONIC_PY_COMMON_PY3) $(SONIC_PLATFORM_COMMON_PY3) $(SONIC_SYSEEPROMD_PY2) $(SONIC_SYSEEPROMD_PY3)_DEBS_DEPENDS = $(LIBSWSSCOMMON) $(PYTHON3_SWSSCOMMON) $(SONIC_SYSEEPROMD_PY3)_PYTHON_VERSION = 3 SONIC_PYTHON_WHEELS += $(SONIC_SYSEEPROMD_PY3) diff --git a/rules/sonic-thermalctld.mk b/rules/sonic-thermalctld.mk index 6eb16c5eb3f7..a73196e674c0 100644 --- a/rules/sonic-thermalctld.mk +++ b/rules/sonic-thermalctld.mk @@ -4,7 +4,7 @@ SONIC_THERMALCTLD_PY2 = sonic_thermalctld-1.0-py2-none-any.whl $(SONIC_THERMALCTLD_PY2)_SRC_PATH = $(SRC_PATH)/sonic-platform-daemons/sonic-thermalctld -$(SONIC_THERMALCTLD_PY2)_DEPENDS = $(SONIC_PY_COMMON_PY2) +$(SONIC_THERMALCTLD_PY2)_DEPENDS = $(SONIC_PY_COMMON_PY2) $(SONIC_PLATFORM_COMMON_PY2) $(SONIC_THERMALCTLD_PY2)_DEBS_DEPENDS = $(LIBSWSSCOMMON) $(PYTHON_SWSSCOMMON) $(SONIC_THERMALCTLD_PY2)_PYTHON_VERSION = 2 SONIC_PYTHON_WHEELS += $(SONIC_THERMALCTLD_PY2) @@ -13,7 +13,7 @@ SONIC_PYTHON_WHEELS += $(SONIC_THERMALCTLD_PY2) SONIC_THERMALCTLD_PY3 = sonic_thermalctld-1.0-py3-none-any.whl $(SONIC_THERMALCTLD_PY3)_SRC_PATH = $(SRC_PATH)/sonic-platform-daemons/sonic-thermalctld -$(SONIC_THERMALCTLD_PY3)_DEPENDS = $(SONIC_PY_COMMON_PY3) $(SONIC_THERMALCTLD_PY2) +$(SONIC_THERMALCTLD_PY3)_DEPENDS = $(SONIC_PY_COMMON_PY3) $(SONIC_PLATFORM_COMMON_PY3) $(SONIC_THERMALCTLD_PY2) $(SONIC_THERMALCTLD_PY3)_DEBS_DEPENDS = $(LIBSWSSCOMMON) $(PYTHON3_SWSSCOMMON) $(SONIC_THERMALCTLD_PY3)_PYTHON_VERSION = 3 SONIC_PYTHON_WHEELS += $(SONIC_THERMALCTLD_PY3) diff --git a/rules/sonic-utilities.mk b/rules/sonic-utilities.mk index 41d785b06283..4e5b5adbc5dc 100644 --- a/rules/sonic-utilities.mk +++ b/rules/sonic-utilities.mk @@ -6,6 +6,7 @@ $(SONIC_UTILITIES_PY3)_PYTHON_VERSION = 3 $(SONIC_UTILITIES_PY3)_DEPENDS += $(SONIC_PY_COMMON_PY3) \ $(SWSSSDK_PY3) \ $(SONIC_CONFIG_ENGINE_PY3) \ + $(SONIC_PLATFORM_COMMON_PY3) \ $(SONIC_YANG_MGMT_PY3) \ $(SONIC_YANG_MODELS_PY3) $(SONIC_UTILITIES_PY3)_DEBS_DEPENDS = $(LIBYANG) \ @@ -13,5 +14,4 @@ $(SONIC_UTILITIES_PY3)_DEBS_DEPENDS = $(LIBYANG) \ $(LIBYANG_PY3) \ $(LIBSWSSCOMMON) \ $(PYTHON3_SWSSCOMMON) -$(SONIC_UTILITIES_PY3)_TEST = n SONIC_PYTHON_WHEELS += $(SONIC_UTILITIES_PY3) diff --git a/rules/sonic-xcvrd.mk b/rules/sonic-xcvrd.mk index 5a0c6a44b89d..018363f367fd 100644 --- a/rules/sonic-xcvrd.mk +++ b/rules/sonic-xcvrd.mk @@ -4,7 +4,7 @@ SONIC_XCVRD_PY2 = sonic_xcvrd-1.0-py2-none-any.whl $(SONIC_XCVRD_PY2)_SRC_PATH = $(SRC_PATH)/sonic-platform-daemons/sonic-xcvrd -$(SONIC_XCVRD_PY2)_DEPENDS = $(SONIC_PY_COMMON_PY2) $(SONIC_PLATFORM_COMMON_PY2) $(SONIC_PLATFORM_API_PY2) +$(SONIC_XCVRD_PY2)_DEPENDS = $(SONIC_PY_COMMON_PY2) $(SONIC_PLATFORM_COMMON_PY2) $(SONIC_XCVRD_PY2)_DEBS_DEPENDS = $(LIBSWSSCOMMON) $(PYTHON_SWSSCOMMON) $(SONIC_XCVRD_PY2)_PYTHON_VERSION = 2 SONIC_PYTHON_WHEELS += $(SONIC_XCVRD_PY2) @@ -13,7 +13,7 @@ SONIC_PYTHON_WHEELS += $(SONIC_XCVRD_PY2) SONIC_XCVRD_PY3 = sonic_xcvrd-1.0-py3-none-any.whl $(SONIC_XCVRD_PY3)_SRC_PATH = $(SRC_PATH)/sonic-platform-daemons/sonic-xcvrd -$(SONIC_XCVRD_PY3)_DEPENDS = $(SONIC_PY_COMMON_PY3) $(SONIC_XCVRD_PY2) $(SONIC_PLATFORM_COMMON_PY3) $(SONIC_PLATFORM_API_PY3) +$(SONIC_XCVRD_PY3)_DEPENDS = $(SONIC_PY_COMMON_PY3) $(SONIC_XCVRD_PY2) $(SONIC_PLATFORM_COMMON_PY3) $(SONIC_XCVRD_PY3)_DEBS_DEPENDS = $(LIBSWSSCOMMON) $(PYTHON3_SWSSCOMMON) $(SONIC_XCVRD_PY3)_PYTHON_VERSION = 3 SONIC_PYTHON_WHEELS += $(SONIC_XCVRD_PY3) diff --git a/rules/sonic-ycabled.dep b/rules/sonic-ycabled.dep new file mode 100644 index 000000000000..b7eed99e8a59 --- /dev/null +++ b/rules/sonic-ycabled.dep @@ -0,0 +1,10 @@ +SPATH := $($(SONIC_YCABLED_PY3)_SRC_PATH) +DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/sonic-ycabled.mk rules/sonic-ycabled.dep +DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) +SMDEP_FILES := $(addprefix $(SPATH)/,$(shell cd $(SPATH) && git ls-files)) + +$(SONIC_YCABLED_PY3)_CACHE_MODE := GIT_CONTENT_SHA +$(SONIC_YCABLED_PY3)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(SONIC_YCABLED_PY3)_DEP_FILES := $(DEP_FILES) +$(SONIC_YCABLED_PY3)_SMDEP_FILES := $(SMDEP_FILES) +$(SONIC_YCABLED_PY3)_SMDEP_PATHS := $(SPATH) diff --git a/rules/sonic-ycabled.mk b/rules/sonic-ycabled.mk new file mode 100644 index 000000000000..ba3531d2db7d --- /dev/null +++ b/rules/sonic-ycabled.mk @@ -0,0 +1,10 @@ +# sonic-ycabled (SONiC Y-Cable daemon) Debian package + +# SONIC_YCABLED_PY3 package + +SONIC_YCABLED_PY3 = sonic_ycabled-1.0-py3-none-any.whl +$(SONIC_YCABLED_PY3)_SRC_PATH = $(SRC_PATH)/sonic-platform-daemons/sonic-ycabled +$(SONIC_YCABLED_PY3)_DEPENDS = $(SONIC_PY_COMMON_PY3) $(SONIC_PLATFORM_COMMON_PY3) +$(SONIC_YCABLED_PY3)_DEBS_DEPENDS = $(LIBSWSSCOMMON) $(PYTHON3_SWSSCOMMON) +$(SONIC_YCABLED_PY3)_PYTHON_VERSION = 3 +SONIC_PYTHON_WHEELS += $(SONIC_YCABLED_PY3) diff --git a/rules/sonic-ztp.dep b/rules/sonic-ztp.dep index 32890c5d74b6..bf6622ddb505 100644 --- a/rules/sonic-ztp.dep +++ b/rules/sonic-ztp.dep @@ -2,7 +2,7 @@ SPATH := $($(SONIC_ZTP)_SRC_PATH) DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/sonic-ztp.mk rules/sonic-ztp.dep DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) -SMDEP_FILES := $(addprefix $(SPATH)/,$(shell cd $(SPATH) && git ls-files|grep -Ev "inband-ztp-ip|dhclient-exit-hooks.d/ztp")) +SMDEP_FILES := $(addprefix $(SPATH)/,$(shell cd $(SPATH) && git ls-files|grep -Ev "dhclient-enter-hooks.d|dhclient-exit-hooks.d")) $(SONIC_ZTP)_CACHE_MODE := GIT_CONTENT_SHA diff --git a/rules/swss.mk b/rules/swss.mk index 210333614555..e4d18cf2eb3d 100644 --- a/rules/swss.mk +++ b/rules/swss.mk @@ -8,7 +8,7 @@ $(SWSS)_DEPENDS += $(LIBSAIREDIS_DEV) $(LIBSAIMETADATA_DEV) $(LIBTEAM_DEV) \ $(SWSS)_UNINSTALLS = $(LIBSAIVS_DEV) $(SWSS)_RDEPENDS += $(LIBSAIREDIS) $(LIBSAIMETADATA) $(LIBTEAM) \ - $(LIBTEAMDCTL) $(LIBSWSSCOMMON) $(PYTHON_SWSSCOMMON) + $(LIBTEAMDCTL) $(LIBSWSSCOMMON) $(PYTHON3_SWSSCOMMON) SONIC_DPKG_DEBS += $(SWSS) SWSS_DBG = swss-dbg_1.0.0_$(CONFIGURED_ARCH).deb diff --git a/rules/system-health.mk b/rules/system-health.mk index bafc09daa70f..d4748ce1582d 100644 --- a/rules/system-health.mk +++ b/rules/system-health.mk @@ -4,6 +4,7 @@ SYSTEM_HEALTH = system_health-1.0-py3-none-any.whl $(SYSTEM_HEALTH)_SRC_PATH = $(SRC_PATH)/system-health $(SYSTEM_HEALTH)_PYTHON_VERSION = 3 $(SYSTEM_HEALTH)_DEPENDS = $(SONIC_PY_COMMON_PY3) $(SWSSSDK_PY3) $(SONIC_CONFIG_ENGINE_PY3) +$(SYSTEM_HEALTH)_DEBS_DEPENDS = $(LIBSWSSCOMMON) $(PYTHON3_SWSSCOMMON) SONIC_PYTHON_WHEELS += $(SYSTEM_HEALTH) export system_health_py3_wheel_path="$(addprefix $(PYTHON_WHEELS_PATH)/,$(SYSTEM_HEALTH))" diff --git a/rules/tacacs.mk b/rules/tacacs.mk index 1c620ebcedc5..5112d31681a7 100644 --- a/rules/tacacs.mk +++ b/rules/tacacs.mk @@ -16,8 +16,6 @@ LIBTAC_DEV = libtac-dev_$(PAM_TACPLUS_VERSION)_$(CONFIGURED_ARCH).deb $(LIBTAC_DEV)_DEPENDS += $(LIBTAC2) $(eval $(call add_derived_package,$(LIBTAC2),$(LIBTAC_DEV))) - - # libnss-tacplus packages NSS_TACPLUS_VERSION = 1.0.4-1 @@ -29,6 +27,17 @@ $(LIBNSS_TACPLUS)_RDEPENDS += $(LIBTAC2) $(LIBNSS_TACPLUS)_SRC_PATH = $(SRC_PATH)/tacacs/nss SONIC_MAKE_DEBS += $(LIBNSS_TACPLUS) +# audisp-tacplus packages +AUDISP_TACPLUS_VERSION = 1.0.2 + +export AUDISP_TACPLUS_VERSION + +AUDISP_TACPLUS = audisp-tacplus_$(AUDISP_TACPLUS_VERSION)_$(CONFIGURED_ARCH).deb +$(AUDISP_TACPLUS)_DEPENDS += $(LIBTAC_DEV) +$(AUDISP_TACPLUS)_RDEPENDS += $(LIBTAC2) +$(AUDISP_TACPLUS)_SRC_PATH = $(SRC_PATH)/tacacs/audisp +SONIC_MAKE_DEBS += $(AUDISP_TACPLUS) + # The .c, .cpp, .h & .hpp files under src/{$DBG_SRC_ARCHIVE list} # are archived into debug one image to facilitate debugging. # diff --git a/rules/thrift_0_13_0.dep b/rules/thrift_0_13_0.dep new file mode 100644 index 000000000000..52d8b6a525f9 --- /dev/null +++ b/rules/thrift_0_13_0.dep @@ -0,0 +1,8 @@ +SPATH := $($(LIBTHRIFT_0_13_0)_SRC_PATH) +DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/thrift_0_13_0.mk rules/thrift_0_13_0.dep +DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) +DEP_FILES += $(shell git ls-files $(SPATH)) + +$(LIBTHRIFT_0_13_0)_CACHE_MODE := GIT_CONTENT_SHA +$(LIBTHRIFT_0_13_0)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) +$(LIBTHRIFT_0_13_0)_DEP_FILES := $(DEP_FILES) diff --git a/rules/thrift_0_13_0.mk b/rules/thrift_0_13_0.mk new file mode 100644 index 000000000000..18d333910904 --- /dev/null +++ b/rules/thrift_0_13_0.mk @@ -0,0 +1,17 @@ +# thrift package + +THRIFT_VERSION_0_13_0 = 0.13.0 +THRIFT_VERSION_0_13_0_FULL = $(THRIFT_VERSION_0_13_0)-6 + +LIBTHRIFT_0_13_0 = libthrift-$(THRIFT_VERSION_0_13_0)_$(THRIFT_VERSION_0_13_0_FULL)_$(CONFIGURED_ARCH).deb +$(LIBTHRIFT_0_13_0)_SRC_PATH = $(SRC_PATH)/thrift_0_13_0 +SONIC_MAKE_DEBS += $(LIBTHRIFT_0_13_0) + +LIBTHRIFT_DEV_0_13_0 = libthrift-dev_$(THRIFT_VERSION_0_13_0_FULL)_$(CONFIGURED_ARCH).deb +$(eval $(call add_derived_package,$(LIBTHRIFT_0_13_0),$(LIBTHRIFT_DEV_0_13_0))) + +PYTHON3_THRIFT_0_13_0 = python3-thrift_$(THRIFT_VERSION_0_13_0_FULL)_$(CONFIGURED_ARCH).deb +$(eval $(call add_derived_package,$(LIBTHRIFT_0_13_0),$(PYTHON3_THRIFT_0_13_0))) + +THRIFT_COMPILER_0_13_0 = thrift-compiler_$(THRIFT_VERSION_0_13_0_FULL)_$(CONFIGURED_ARCH).deb +$(eval $(call add_derived_package,$(LIBTHRIFT_0_13_0),$(THRIFT_COMPILER_0_13_0))) diff --git a/scripts/build_debian_base_system.sh b/scripts/build_debian_base_system.sh index a85b3b5bf0ee..63eb7555fe36 100755 --- a/scripts/build_debian_base_system.sh +++ b/scripts/build_debian_base_system.sh @@ -20,9 +20,11 @@ generate_version_file() if [ "$ENABLE_VERSION_CONTROL_DEB" != "y" ]; then if [[ $CONFIGURED_ARCH == armhf || $CONFIGURED_ARCH == arm64 ]]; then - # qemu arm bin executable for cross-building - sudo mkdir -p $FILESYSTEM_ROOT/usr/bin - sudo cp /usr/bin/qemu*static $FILESYSTEM_ROOT/usr/bin || true + if [ $MULTIARCH_QEMU_ENVIRON == y ]; then + # qemu arm bin executable for cross-building + sudo mkdir -p $FILESYSTEM_ROOT/usr/bin + sudo cp /usr/bin/qemu*static $FILESYSTEM_ROOT/usr/bin || true + fi sudo http_proxy=$HTTP_PROXY SKIP_BUILD_HOOK=y debootstrap --variant=minbase --arch $CONFIGURED_ARCH $IMAGE_DISTRO $FILESYSTEM_ROOT http://deb.debian.org/debian else sudo http_proxy=$HTTP_PROXY SKIP_BUILD_HOOK=y debootstrap --variant=minbase --arch $CONFIGURED_ARCH $IMAGE_DISTRO $FILESYSTEM_ROOT http://debian-archive.trafficmanager.net/debian @@ -61,14 +63,18 @@ mkdir -p $ARCHIEVES mkdir -p $APTLIST mkdir -p $TARGET_DEBOOTSTRAP PACKAGES=$(sed -E 's/=(=[^=]*)$/\1/' $BASE_VERSIONS) -URL_ARR=($(apt-get download --print-uris $PACKAGES | cut -d" " -f1 | tr -d "'")) +URL_ARR=$(apt-get download --print-uris $PACKAGES | cut -d" " -f1 | tr -d "'") PACKAGE_ARR=($PACKAGES) LENGTH=${#PACKAGE_ARR[@]} for ((i=0;i&1 + exit 1 + fi filename=$(basename "$url") SKIP_BUILD_HOOK=y wget $url -P $ARCHIEVES echo $packagename >> $DEBOOTSTRAP_REQUIRED @@ -76,7 +82,7 @@ do done touch $APTDEBIAN touch $DEBOOTSTRAP_BASE -(cd $BASEIMAGE_TARBALLPATH && tar -zcf $BASEIMAGE_TARBALL .) +(cd $BASEIMAGE_TARBALLPATH && fakeroot tar -zcf $BASEIMAGE_TARBALL .) sudo debootstrap --verbose --variant=minbase --arch $CONFIGURED_ARCH --unpack-tarball=$BASEIMAGE_TARBALL $IMAGE_DISTRO $FILESYSTEM_ROOT RET=$? diff --git a/scripts/build_kvm_image.sh b/scripts/build_kvm_image.sh index e0a7ec2feff4..4805f234483b 100755 --- a/scripts/build_kvm_image.sh +++ b/scripts/build_kvm_image.sh @@ -4,7 +4,7 @@ # # SPDX-License-Identifier: GPL-2.0 -MEM=3072 +MEM=4096 DISK=$1 ONIE_RECOVERY_ISO=$2 INSTALLER=$3 @@ -22,6 +22,7 @@ on_exit() on_error() { + netstat -antp echo "============= kvm_log ==============" cat $kvm_log } @@ -47,16 +48,29 @@ prepare_installer_disk() umount $tmpdir } +wait_kvm_ready() +{ + local count=30 + local waiting_in_seconds=2.0 + for ((i=1; i<=$count; i++)); do + sleep $waiting_in_seconds + echo "$(date) [$i/$count] waiting for the port $KVM_PORT ready" + if netstat -l | grep -q ":$KVM_PORT"; then + break + fi + done +} + create_disk prepare_installer_disk echo "Prepare memory for KVM build: $vs_build_prepare_mem" -sudo mount proc /proc -t proc || true +mount proc /proc -t proc || true free -m if [[ "$vs_build_prepare_mem" == "yes" ]]; then # Force o.s. to drop cache and compact memory so that KVM can get 2G memory - sudo bash -c 'echo 1 > /proc/sys/vm/drop_caches' - sudo bash -c 'echo 1 > /proc/sys/vm/compact_memory' + bash -c 'echo 1 > /proc/sys/vm/drop_caches' + bash -c 'echo 1 > /proc/sys/vm/compact_memory' free -m fi @@ -77,7 +91,7 @@ trap on_error ERR kvm_pid=$! -sleep 2.0 +wait_kvm_ready [ -d "/proc/$kvm_pid" ] || { echo "ERROR: kvm died." diff --git a/scripts/build_mirror_config.sh b/scripts/build_mirror_config.sh new file mode 100755 index 000000000000..aee56f23ae6a --- /dev/null +++ b/scripts/build_mirror_config.sh @@ -0,0 +1,55 @@ +#!/bin/bash + +# Generate the sources.list. in the config path +CONFIG_PATH=$1 +export ARCHITECTURE=$2 +export DISTRIBUTION=$3 + +DEFAULT_MIRROR_URL_PREFIX=http://packages.trafficmanager.net +MIRROR_VERSION_FILE= +[[ "$SONIC_VERSION_CONTROL_COMPONENTS" == *deb* || $SONIC_VERSION_CONTROL_COMPONENTS == *all* ]] && MIRROR_VERSION_FILE=files/build/versions/default/versions-mirror +[ -f target/versions/default/versions-mirror ] && MIRROR_VERSION_FILE=target/versions/default/versions-mirror + +# The default mirror urls +DEFAULT_MIRROR_URLS=http://debian-archive.trafficmanager.net/debian/,http://packages.trafficmanager.net/debian/debian/ +DEFAULT_MIRROR_SECURITY_URLS=http://debian-archive.trafficmanager.net/debian-security/,http://packages.trafficmanager.net/debian/debian-security/ + + +# The debian-archive.trafficmanager.net does not support armhf, use debian.org instead +if [ "$ARCHITECTURE" == "armhf" ]; then + DEFAULT_MIRROR_URLS=http://deb.debian.org/debian/,http://packages.trafficmanager.net/debian/debian/ + DEFAULT_MIRROR_SECURITY_URLS=http://deb.debian.org/debian-security/,http://packages.trafficmanager.net/debian/debian-security/ +fi + +if [ "$MIRROR_SNAPSHOT" == y ]; then + if [ -f "$MIRROR_VERSION_FILE" ]; then + DEBIAN_TIMESTAMP=$(grep "^debian==" $MIRROR_VERSION_FILE | tail -n 1 | sed 's/.*==//') + DEBIAN_SECURITY_TIMESTAMP=$(grep "^debian-security==" $MIRROR_VERSION_FILE | tail -n 1 | sed 's/.*==//') + elif [ -z "$DEBIAN_TIMESTAMP" ] || [ -z "$DEBIAN_SECURITY_TIMESTAMP" ]; then + DEBIAN_TIMESTAMP=$(curl $DEFAULT_MIRROR_URL_PREFIX/snapshot/debian/latest/timestamp) + DEBIAN_SECURITY_TIMESTAMP=$(curl $DEFAULT_MIRROR_URL_PREFIX/snapshot/debian-security/latest/timestamp) + fi + + DEFAULT_MIRROR_URLS=http://deb.debian.org/debian/,http://packages.trafficmanager.net/snapshot/debian/$DEBIAN_TIMESTAMP/ + DEFAULT_MIRROR_SECURITY_URLS=http://deb.debian.org/debian-security/,http://packages.trafficmanager.net/snapshot/debian-security/$DEBIAN_SECURITY_TIMESTAMP/ + + mkdir -p target/versions/default + if [ ! -f target/versions/default/versions-mirror ]; then + echo "debian==$DEBIAN_TIMESTAMP" > target/versions/default/versions-mirror + echo "debian-security==$DEBIAN_SECURITY_TIMESTAMP" >> target/versions/default/versions-mirror + fi +fi + +[ -z "$MIRROR_URLS" ] && MIRROR_URLS=$DEFAULT_MIRROR_URLS +[ -z "$MIRROR_SECURITY_URLS" ] && MIRROR_SECURITY_URLS=$DEFAULT_MIRROR_SECURITY_URLS + +TEMPLATE=files/apt/sources.list.j2 +[ -f files/apt/sources.list.$ARCHITECTURE.j2 ] && TEMPLATE=files/apt/sources.list.$ARCHITECTURE.j2 +[ -f $CONFIG_PATH/sources.list.j2 ] && TEMPLATE=$CONFIG_PATH/sources.list.j2 +[ -f $CONFIG_PATH/sources.list.$ARCHITECTURE.j2 ] && TEMPLATE=$CONFIG_PATH/sources.list.$ARCHITECTURE.j2 + +MIRROR_URLS=$MIRROR_URLS MIRROR_SECURITY_URLS=$MIRROR_SECURITY_URLS j2 $TEMPLATE | sed '/^$/N;/^\n$/D' > $CONFIG_PATH/sources.list.$ARCHITECTURE +if [ "$MIRROR_SNAPSHOT" == y ]; then + # Set the snapshot mirror, and add the SET_REPR_MIRRORS flag + sed -i -e "/^#*deb.*packages.trafficmanager.net/! s/^#*deb/#&/" -e "\$a#SET_REPR_MIRRORS" $CONFIG_PATH/sources.list.$ARCHITECTURE +fi diff --git a/scripts/collect_host_image_version_files.sh b/scripts/collect_host_image_version_files.sh index 3e06bcfb2345..2cabc049d9c7 100755 --- a/scripts/collect_host_image_version_files.sh +++ b/scripts/collect_host_image_version_files.sh @@ -4,6 +4,7 @@ TARGET=$1 FILESYSTEM_ROOT=$2 VERSIONS_PATH=$TARGET/versions/host-image +[ -d $VERSIONS_PATH ] && sudo rm -rf $VERSIONS_PATH mkdir -p $VERSIONS_PATH sudo LANG=C chroot $FILESYSTEM_ROOT post_run_buildinfo diff --git a/scripts/docker_version_control.sh b/scripts/docker_version_control.sh new file mode 100755 index 000000000000..e94370d0e2d9 --- /dev/null +++ b/scripts/docker_version_control.sh @@ -0,0 +1,49 @@ +# This script is for reproducible build. +# Reproducible build for docker enabled: Before build docker image, this script will change image:tag to image:sha256 in DOCKERFILE. +# And record image sha256 to a target file. +#!/bin/bash + +IMAGENAME=$1 +DOCKERFILE=$2 +ARCH=$3 +DOCKERFILE_TARGE=$4 +DISTRO=$5 + +version_file=files/build/versions/default/versions-docker +new_version_file=target/versions/default/versions-docker +mkdir -p target/versions/default + +. src/sonic-build-hooks/buildinfo/config/buildinfo.config + +image_tag=`grep "^FROM " $DOCKERFILE | awk '{print$2}'` +image_tag_noprefix=$image_tag +[ -n "$DEFAULT_CONTAINER_REGISTRY" ] && image_tag_noprefix=$(echo $image_tag | sed "s#$DEFAULT_CONTAINER_REGISTRY##") +image=`echo $image_tag | cut -f1 -d:` +tag=`echo $image_tag | cut -f2 -d:` + +if [[ ",$SONIC_VERSION_CONTROL_COMPONENTS," == *,all,* ]] || [[ ",$SONIC_VERSION_CONTROL_COMPONENTS," == *,docker,* ]]; then + # if docker image not in white list, exit + if [[ "$image_tag" != */debian:* ]] && [[ "$image_tag" != debian:* ]] && [[ "$image_tag" != multiarch/debian-debootstrap:* ]];then + exit 0 + fi + if [ -f $version_file ];then + hash_value=`grep "${ARCH}:${image_tag_noprefix}" $version_file | awk -F== '{print$2}'` + fi + if [ -z $hash_value ];then + hash_value=unknown + echo "$image_tag sha256 value is unknown" >> ${new_version_file}.log + exit 0 + fi + oldimage=${image_tag//\//\\/} + newimage="${oldimage}@$hash_value" + echo "sed -i \"s/$oldimage/$newimage/\" $DOCKERFILE" >> ${new_version_file}.log + sed -i "s/$oldimage/$newimage/" $DOCKERFILE +else + hash_value=`docker pull $image_tag 2> ${new_version_file}.log | grep Digest | awk '{print$2}'` + if [ -z "$hash_value" ];then + hash_value=unknown + fi +fi +if [[ "$hash_value" != "unknown" ]];then + echo -e "${ARCH}:${image_tag_noprefix}==$hash_value" >> $new_version_file +fi diff --git a/scripts/generate_buildinfo_config.sh b/scripts/generate_buildinfo_config.sh index fe7657a6b6c9..080e6a321a6b 100755 --- a/scripts/generate_buildinfo_config.sh +++ b/scripts/generate_buildinfo_config.sh @@ -8,3 +8,4 @@ mkdir -p $BUILDINFO_PATH/buildinfo/config echo "PACKAGE_URL_PREFIX=$PACKAGE_URL_PREFIX" > $BUILDINFO_CONFIG echo "SONIC_VERSION_CONTROL_COMPONENTS=$SONIC_VERSION_CONTROL_COMPONENTS" >> $BUILDINFO_CONFIG +echo "export MIRROR_SNAPSHOT=$MIRROR_SNAPSHOT" >> $BUILDINFO_CONFIG diff --git a/scripts/prepare_docker_buildinfo.sh b/scripts/prepare_docker_buildinfo.sh index aa3aaaa4bed5..f39fe711dd48 100755 --- a/scripts/prepare_docker_buildinfo.sh +++ b/scripts/prepare_docker_buildinfo.sh @@ -22,7 +22,14 @@ if [ -z "$DISTRO" ]; then [ -z "$DISTRO" ] && DISTRO=jessie fi -DOCKERFILE_PRE_SCRIPT='# Auto-Generated for buildinfo +if [[ "$IMAGENAME" == sonic-slave-* ]] || [[ "$IMAGENAME" == docker-base-* ]] || [[ "$IMAGENAME" == docker-ptf ]]; then + scripts/build_mirror_config.sh ${DOCKERFILE_PATH} $ARCH $DISTRO +fi + +# add script for reproducible build. using sha256 instead of tag for docker base image. +scripts/docker_version_control.sh $@ + +DOCKERFILE_PRE_SCRIPT='# Auto-Generated for buildinfo COPY ["buildinfo", "/usr/local/share/buildinfo"] RUN dpkg -i /usr/local/share/buildinfo/sonic-build-hooks_1.0_all.deb RUN pre_run_buildinfo' diff --git a/scripts/prepare_slave_container_buildinfo.sh b/scripts/prepare_slave_container_buildinfo.sh index d66bbe816104..1fb2f006640b 100755 --- a/scripts/prepare_slave_container_buildinfo.sh +++ b/scripts/prepare_slave_container_buildinfo.sh @@ -4,6 +4,9 @@ SLAVE_DIR=$1 ARCH=$2 DISTRO=$3 +# Install the latest debian package sonic-build-hooks in the slave container +sudo dpkg -i --force-overwrite $SLAVE_DIR/buildinfo/sonic-build-hooks_*.deb > /dev/null + # Enable the build hooks symlink_build_hooks @@ -11,6 +14,10 @@ symlink_build_hooks cp -rf $SLAVE_DIR/buildinfo/* /usr/local/share/buildinfo/ . /usr/local/share/buildinfo/scripts/buildinfo_base.sh +# Enable reproducible mirrors +set_reproducible_mirrors +apt-get update > /dev/null 2>&1 + # Build the slave version config [ -d /usr/local/share/buildinfo/versions ] && rm -rf /usr/local/share/buildinfo/versions scripts/versions_manager.py generate -t "/usr/local/share/buildinfo/versions" -n "build-${SLAVE_DIR}" -d "$DISTRO" -a "$ARCH" diff --git a/scripts/run_with_retry b/scripts/run_with_retry new file mode 100755 index 000000000000..9e709bbf1bda --- /dev/null +++ b/scripts/run_with_retry @@ -0,0 +1,17 @@ +#!/bin/bash + +run_with_retry(){ + [ "$SONIC_BUILD_RETRY_COUNT" -gt 0 ] || SONIC_BUILD_RETRY_COUNT=0 + [[ "$*" == "" ]] && { echo "run_with_retry: input command can't be empty." 1>&2;exit 1; } + for ((i=0; i<=$SONIC_BUILD_RETRY_COUNT; i++)) + do + if [[ $i != 0 ]];then + echo "==============================================================================" 1>&2 + echo "Waiting $SONIC_BUILD_RETRY_INTERVAL to run again, $i/$SONIC_BUILD_RETRY_COUNT" 1>&2 + echo "==============================================================================" 1>&2 + sleep $SONIC_BUILD_RETRY_INTERVAL + fi + "$@" && break + done +} +run_with_retry "$@" diff --git a/scripts/versions_manager.py b/scripts/versions_manager.py index 59621cdfbbc7..d4127dece932 100755 --- a/scripts/versions_manager.py +++ b/scripts/versions_manager.py @@ -22,7 +22,7 @@ class Component: ctype -- Component Type, such as deb, py2, etc dist -- Distribution, such as stretch, buster, etc arch -- Architectrue, such as amd64, arm64, etc - + ''' def __init__(self, versions, ctype, dist=ALL_DIST, arch=ALL_ARCH): self.versions = versions @@ -44,6 +44,8 @@ def get_versions(cls, version_file): offset = line.rfind('==') if offset > 0: package = line[:offset].strip() + if 'py2' in version_file.lower() or 'py3' in version_file.lower(): + package = package.lower() version = line[offset+2:].strip() result[package] = version return result @@ -86,7 +88,7 @@ def dump_to_path(self, file_path, config=False, priority=999): if config and self.ctype == 'deb': none_config_file_path = os.path.join(file_path, filename) self.dump_to_file(none_config_file_path, False, priority) - filename = VERSION_DEB_PREFERENCE + filename = VERSION_DEB_PREFERENCE file_path = os.path.join(file_path, filename) self.dump_to_file(file_path, config, priority) @@ -172,11 +174,20 @@ def overwrite(self, module, for_all_dist=False, for_all_arch=False): self.components.append(tmp_component) self.adjust() - def get_config_module(self, default_module, dist, arch): + def get_config_module(self, source_path, dist, arch): if self.is_individule_version(): return self + default_module_path = VersionModule.get_module_path_by_name(source_path, DEFAULT_MODULE) + default_module = VersionModule() + default_module.load(default_module_path, filter_dist=dist, filter_arch=arch) module = default_module - if not self.is_aggregatable_module(self.name): + if self.name == 'host-image': + base_module_path = VersionModule.get_module_path_by_name(source_path, 'host-base-image') + base_module = VersionModule() + base_module.load(base_module_path, filter_dist=dist, filter_arch=arch) + module = default_module.clone(exclude_ctypes=DEFAULT_OVERWRITE_COMPONENTS) + module.overwrite(base_module, True, True) + elif not self.is_aggregatable_module(self.name): module = default_module.clone(exclude_ctypes=DEFAULT_OVERWRITE_COMPONENTS) return self._get_config_module(module, dist, arch) @@ -190,6 +201,8 @@ def _get_config_module(self, default_module, dist, arch): if ctype not in ctype_components: ctype_components[ctype] = [] for components in ctype_components.values(): + if len(components) == 0: + continue config_component = self._get_config_for_ctype(components, dist, arch) config_components.append(config_component) config_module = VersionModule(self.name, config_components) @@ -276,11 +289,11 @@ def load(self, image_path, filter_ctype=None, filter_dist=None, filter_arch=None arch = '' if len(items) > 2: dist = items[2] - if filter_dist and dist and filter_dist != dist: + if filter_dist and dist and filter_dist != dist and dist != ALL_DIST: continue if len(items) > 3: arch = items[3] - if filter_arch and arch and filter_arch != arch: + if filter_arch and arch and filter_arch != arch and arch != ALL_ARCH: continue versions = Component.get_versions(file_path) component = Component(versions, ctype, dist, arch) @@ -370,10 +383,12 @@ def __init__(self, target_path="./target", source_path='.'): def load_from_target(self): dockers_path = os.path.join(self.target_path, 'versions/dockers') build_path = os.path.join(self.target_path, 'versions/build') + default_path = os.path.join(self.target_path, 'versions/default') modules = {} self.modules = modules file_paths = glob.glob(dockers_path + '/*') file_paths += glob.glob(build_path + '/build-*') + file_paths += glob.glob(default_path) file_paths.append(os.path.join(self.target_path, 'versions/host-image')) file_paths.append(os.path.join(self.target_path, 'versions/host-base-image')) for file_path in file_paths: @@ -460,12 +475,13 @@ def filter(self, ctypes=[]): module.filter(ctypes=ctypes) def get_default_module(self): - if DEFAULT_MODULE in self.modules: - return self.modules[DEFAULT_MODULE] + default_module = self.modules.get(DEFAULT_MODULE, VersionModule(DEFAULT_MODULE, [])) ctypes = self.get_component_types() dists = self.get_dists() components = [] for ctype in ctypes: + if ctype in DEFAULT_OVERWRITE_COMPONENTS: + continue if ctype == 'deb': for dist in dists: versions = self._get_versions(ctype, dist) @@ -477,7 +493,9 @@ def get_default_module(self): common_versions = self._get_common_versions(versions) component = Component(common_versions, ctype) components.append(component) - return VersionModule(DEFAULT_MODULE, components) + module = VersionModule(DEFAULT_MODULE, components) + module.overwrite(default_module, True, True) + return module def get_aggregatable_modules(self): modules = {} @@ -655,10 +673,7 @@ def generate(self): os.makedirs(args.target_path) module = VersionModule() module.load(module_path, filter_dist=args.distribution, filter_arch=args.architecture) - default_module_path = VersionModule.get_module_path_by_name(args.source_path, DEFAULT_MODULE) - default_module = VersionModule() - default_module.load(default_module_path, filter_dist=args.distribution, filter_arch=args.architecture) - config = module.get_config_module(default_module, args.distribution, args.architecture) + config = module.get_config_module(args.source_path, args.distribution, args.architecture) config.clean_info(force=True) config.dump(args.target_path, config=True, priority=args.priority) diff --git a/slave.mk b/slave.mk index c75bf15e75c4..b3a9c8f63d85 100644 --- a/slave.mk +++ b/slave.mk @@ -41,6 +41,7 @@ BUSTER_DEBS_PATH = $(TARGET_PATH)/debs/buster BUSTER_FILES_PATH = $(TARGET_PATH)/files/buster DBG_IMAGE_MARK = dbg DBG_SRC_ARCHIVE_FILE = $(TARGET_PATH)/sonic_src.tar.gz +DPKG_ADMINDIR_PATH = /sonic/dpkg CONFIGURED_PLATFORM := $(shell [ -f .platform ] && cat .platform || echo generic) PLATFORM_PATH = platform/$(CONFIGURED_PLATFORM) @@ -48,7 +49,19 @@ CONFIGURED_ARCH := $(shell [ -f .arch ] && cat .arch || echo amd64) ifeq ($(PLATFORM_ARCH),) override PLATFORM_ARCH = $(CONFIGURED_ARCH) endif +DOCKER_BASE_ARCH := $(CONFIGURED_ARCH) +ifeq ($(CONFIGURED_ARCH),armhf) + override DOCKER_BASE_ARCH = arm32v7 +else +ifeq ($(CONFIGURED_ARCH),arm64) + override DOCKER_BASE_ARCH = arm64v8 +endif +endif +ifeq ($(BLDENV),bullseye) +IMAGE_DISTRO := bullseye +else IMAGE_DISTRO := buster +endif IMAGE_DISTRO_DEBS_PATH = $(TARGET_PATH)/debs/$(IMAGE_DISTRO) IMAGE_DISTRO_FILES_PATH = $(TARGET_PATH)/files/$(IMAGE_DISTRO) @@ -60,6 +73,9 @@ export CONFIGURED_ARCH export PYTHON_WHEELS_PATH export IMAGE_DISTRO export IMAGE_DISTRO_DEBS_PATH +export MULTIARCH_QEMU_ENVIRON +export DOCKER_BASE_ARCH +export MIRROR_SNAPSHOT ############################################################################### ## Utility rules @@ -83,6 +99,7 @@ configure : @mkdir -p $(BUSTER_FILES_PATH) @mkdir -p $(PYTHON_DEBS_PATH) @mkdir -p $(PYTHON_WHEELS_PATH) + @mkdir -p $(DPKG_ADMINDIR_PATH) @echo $(PLATFORM) > .platform @echo $(PLATFORM_ARCH) > .arch @@ -107,6 +124,10 @@ include $(RULES_PATH)/config export PACKAGE_URL_PREFIX export TRUSTED_GPG_URLS export SONIC_VERSION_CONTROL_COMPONENTS +DEFAULT_CONTAINER_REGISTRY := $(SONIC_DEFAULT_CONTAINER_REGISTRY) +export DEFAULT_CONTAINER_REGISTRY +export MIRROR_URLS +export MIRROR_SECURITY_URLS ifeq ($(SONIC_ENABLE_PFCWD_ON_START),y) ENABLE_PFCWD_ON_START = y @@ -116,14 +137,6 @@ ifeq ($(SONIC_INCLUDE_SYSTEM_TELEMETRY),y) INCLUDE_SYSTEM_TELEMETRY = y endif -ifneq (,$(filter $(CONFIGURED_ARCH), armhf arm64)) - # Workaround: Force disable Telmetry for ARM, will be removed after fixing issue - # Issue: qemu crashes when it uses "go get url" - # Qemu Support: https://bugs.launchpad.net/qemu/+bug/1838946 - # Golang Support: https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!topic/golang-nuts/1txPOGa4aGc -INCLUDE_SYSTEM_TELEMETRY = n -endif - ifeq ($(SONIC_INCLUDE_RESTAPI),y) INCLUDE_RESTAPI = y endif @@ -136,6 +149,11 @@ ifeq ($(SONIC_INSTALL_DEBUG_TOOLS),y) INSTALL_DEBUG_TOOLS = y endif +ifeq ($(SONIC_SAITHRIFT_V2),y) +SAITHRIFT_V2 = y +SAITHRIFT_VER = v2 +endif + ifeq ($(SONIC_INCLUDE_SFLOW),y) INCLUDE_SFLOW = y endif @@ -145,6 +163,10 @@ INCLUDE_NAT = y endif +ifeq ($(SONIC_INCLUDE_MUX),y) +INCLUDE_MUX = y +endif + include $(RULES_PATH)/functions ifeq ($(SONIC_USE_PDDF_FRAMEWORK),y) @@ -238,6 +260,7 @@ $(info "FRR_USER_UID" : "$(FRR_USER_UID)") $(info "FRR_USER_GID" : "$(FRR_USER_GID)") endif $(info "ENABLE_SYNCD_RPC" : "$(ENABLE_SYNCD_RPC)") +$(info "SAITHRIFT_V2" : "$(SAITHRIFT_V2)") $(info "ENABLE_ORGANIZATION_EXTENSIONS" : "$(ENABLE_ORGANIZATION_EXTENSIONS)") $(info "HTTP_PROXY" : "$(HTTP_PROXY)") $(info "HTTPS_PROXY" : "$(HTTPS_PROXY)") @@ -258,8 +281,12 @@ $(info "INCLUDE_RESTAPI" : "$(INCLUDE_RESTAPI)") $(info "INCLUDE_SFLOW" : "$(INCLUDE_SFLOW)") $(info "INCLUDE_NAT" : "$(INCLUDE_NAT)") $(info "INCLUDE_KUBERNETES" : "$(INCLUDE_KUBERNETES)") +$(info "INCLUDE_MUX" : "$(INCLUDE_MUX)") $(info "TELEMETRY_WRITABLE" : "$(TELEMETRY_WRITABLE)") $(info "PDDF_SUPPORT" : "$(PDDF_SUPPORT)") +$(info "MULTIARCH_QEMU_ENVIRON" : "$(MULTIARCH_QEMU_ENVIRON)") +$(info "SONIC_VERSION_CONTROL_COMPONENTS": "$(SONIC_VERSION_CONTROL_COMPONENTS)") +$(info "DEFAULT_CONTAINER_REGISTRY" : "$(SONIC_DEFAULT_CONTAINER_REGISTRY)") $(info ) else $(info SONiC Build System for $(CONFIGURED_PLATFORM):$(CONFIGURED_ARCH)) @@ -334,7 +361,7 @@ $(addprefix $(DEBS_PATH)/, $(SONIC_ONLINE_DEBS)) : $(DEBS_PATH)/% : .platform \ if [ -z '$($*_CACHE_LOADED)' ] ; then $(foreach deb,$* $($*_DERIVED_DEBS), \ - { curl -L -f -o $(DEBS_PATH)/$(deb) $($(deb)_URL) $(LOG) || { exit 1 ; } } ; ) + { curl -L -f -o $(DEBS_PATH)/$(deb) $($(deb)_CURL_OPTIONS) $($(deb)_URL) $(LOG) || { exit 1 ; } } ; ) # Save the target deb into DPKG cache $(call SAVE_CACHE,$*,$@) @@ -351,7 +378,7 @@ SONIC_TARGET_LIST += $(addprefix $(DEBS_PATH)/, $(SONIC_ONLINE_DEBS)) # SONIC_ONLINE_FILES += $(SOME_NEW_FILE) $(addprefix $(FILES_PATH)/, $(SONIC_ONLINE_FILES)) : $(FILES_PATH)/% : .platform $(HEADER) - curl -L -f -o $@ $($*_URL) $(LOG) + curl -L -f -o $@ $($*_CURL_OPTIONS) $($*_URL) $(LOG) $(FOOTER) SONIC_TARGET_LIST += $(addprefix $(FILES_PATH)/, $(SONIC_ONLINE_FILES)) @@ -369,6 +396,7 @@ SONIC_TARGET_LIST += $(addprefix $(FILES_PATH)/, $(SONIC_ONLINE_FILES)) # $(SOME_NEW_FILE)_DEPENDS = $(SOME_OTHER_DEB1) $(SOME_OTHER_DEB2) ... # SONIC_MAKE_FILES += $(SOME_NEW_FILE) $(addprefix $(FILES_PATH)/, $(SONIC_MAKE_FILES)) : $(FILES_PATH)/% : .platform $$(addsuffix -install,$$(addprefix $(DEBS_PATH)/,$$($$*_DEPENDS))) \ + $$(addprefix $(DEBS_PATH)/,$$($$*_AFTER)) \ $(call dpkg_depend,$(FILES_PATH)/%.dep) $(HEADER) @@ -380,11 +408,11 @@ $(addprefix $(FILES_PATH)/, $(SONIC_MAKE_FILES)) : $(FILES_PATH)/% : .platform $ # Remove target to force rebuild rm -f $(addprefix $(FILES_PATH)/, $*) # Apply series of patches if exist - if [ -f $($*_SRC_PATH).patch/series ]; then pushd $($*_SRC_PATH) && QUILT_PATCHES=../$(notdir $($*_SRC_PATH)).patch quilt push -a; popd; fi + if [ -f $($*_SRC_PATH).patch/series ]; then pushd $($*_SRC_PATH) && quilt applied || QUILT_PATCHES=../$(notdir $($*_SRC_PATH)).patch quilt push -a; popd; fi $(LOG) # Build project and take package make DEST=$(shell pwd)/$(FILES_PATH) -C $($*_SRC_PATH) $(shell pwd)/$(FILES_PATH)/$* $(LOG) # Clean up - if [ -f $($*_SRC_PATH).patch/series ]; then pushd $($*_SRC_PATH) && quilt pop -a -f; [ -d .pc ] && rm -rf .pc; popd; fi + if [ -f $($*_SRC_PATH).patch/series ]; then pushd $($*_SRC_PATH) && quilt pop -a -f; [ -d .pc ] && rm -rf .pc; popd; fi $(LOG) # Save the target deb into DPKG cache $(call SAVE_CACHE,$*,$@) @@ -411,6 +439,7 @@ SONIC_TARGET_LIST += $(addprefix $(FILES_PATH)/, $(SONIC_MAKE_FILES)) # $(SOME_NEW_DEB)_DEPENDS = $(SOME_OTHER_DEB1) $(SOME_OTHER_DEB2) ... # SONIC_MAKE_DEBS += $(SOME_NEW_DEB) $(addprefix $(DEBS_PATH)/, $(SONIC_MAKE_DEBS)) : $(DEBS_PATH)/% : .platform $$(addsuffix -install,$$(addprefix $(DEBS_PATH)/,$$($$*_DEPENDS))) \ + $$(addprefix $(DEBS_PATH)/,$$($$*_AFTER)) \ $(call dpkg_depend,$(DEBS_PATH)/%.dep) $(HEADER) @@ -423,11 +452,12 @@ $(addprefix $(DEBS_PATH)/, $(SONIC_MAKE_DEBS)) : $(DEBS_PATH)/% : .platform $$(a # Remove target to force rebuild rm -f $(addprefix $(DEBS_PATH)/, $* $($*_DERIVED_DEBS) $($*_EXTRA_DEBS)) # Apply series of patches if exist - if [ -f $($*_SRC_PATH).patch/series ]; then pushd $($*_SRC_PATH) && QUILT_PATCHES=../$(notdir $($*_SRC_PATH)).patch quilt push -a; popd; fi + if [ -f $($*_SRC_PATH).patch/series ]; then pushd $($*_SRC_PATH) && quilt applied || QUILT_PATCHES=../$(notdir $($*_SRC_PATH)).patch quilt push -a; popd; fi $(LOG) # Build project and take package + $(SETUP_OVERLAYFS_FOR_DPKG_ADMINDIR) DEB_BUILD_OPTIONS="${DEB_BUILD_OPTIONS_GENERIC}" make DEST=$(shell pwd)/$(DEBS_PATH) -C $($*_SRC_PATH) $(shell pwd)/$(DEBS_PATH)/$* $(LOG) # Clean up - if [ -f $($*_SRC_PATH).patch/series ]; then pushd $($*_SRC_PATH) && quilt pop -a -f; [ -d .pc ] && rm -rf .pc; popd; fi + if [ -f $($*_SRC_PATH).patch/series ]; then pushd $($*_SRC_PATH) && quilt pop -a -f; [ -d .pc ] && rm -rf .pc; popd; fi $(LOG) # Save the target deb into DPKG cache $(call SAVE_CACHE,$*,$@) @@ -448,6 +478,7 @@ SONIC_TARGET_LIST += $(addprefix $(DEBS_PATH)/, $(SONIC_MAKE_DEBS)) # $(SOME_NEW_DEB)_DEPENDS = $(SOME_OTHER_DEB1) $(SOME_OTHER_DEB2) ... # SONIC_DPKG_DEBS += $(SOME_NEW_DEB) $(addprefix $(DEBS_PATH)/, $(SONIC_DPKG_DEBS)) : $(DEBS_PATH)/% : .platform $$(addsuffix -install,$$(addprefix $(DEBS_PATH)/,$$($$*_DEPENDS))) \ + $$(addprefix $(DEBS_PATH)/,$$($$*_AFTER)) \ $(call dpkg_depend,$(DEBS_PATH)/%.dep ) $(HEADER) @@ -460,19 +491,20 @@ $(addprefix $(DEBS_PATH)/, $(SONIC_DPKG_DEBS)) : $(DEBS_PATH)/% : .platform $$(a # Remove old build logs if they exist rm -f $($*_SRC_PATH)/debian/*.debhelper.log # Apply series of patches if exist - if [ -f $($*_SRC_PATH).patch/series ]; then pushd $($*_SRC_PATH) && QUILT_PATCHES=../$(notdir $($*_SRC_PATH)).patch quilt push -a; popd; fi + if [ -f $($*_SRC_PATH).patch/series ]; then pushd $($*_SRC_PATH) && quilt applied || QUILT_PATCHES=../$(notdir $($*_SRC_PATH)).patch quilt push -a; popd; fi $(LOG) # Build project pushd $($*_SRC_PATH) $(LOG_SIMPLE) if [ -f ./autogen.sh ]; then ./autogen.sh $(LOG); fi + $(SETUP_OVERLAYFS_FOR_DPKG_ADMINDIR) $(if $($*_DPKG_TARGET), - DEB_BUILD_OPTIONS="${DEB_BUILD_OPTIONS_GENERIC} ${$*_DEB_BUILD_OPTIONS}" dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) --as-root -T$($*_DPKG_TARGET) $(LOG), - DEB_BUILD_OPTIONS="${DEB_BUILD_OPTIONS_GENERIC} ${$*_DEB_BUILD_OPTIONS}" dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) $(LOG) + ${$*_BUILD_ENV} DEB_BUILD_OPTIONS="${DEB_BUILD_OPTIONS_GENERIC} ${$*_DEB_BUILD_OPTIONS}" dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) --as-root -T$($*_DPKG_TARGET) --admindir $$mergedir $(LOG), + ${$*_BUILD_ENV} DEB_BUILD_OPTIONS="${DEB_BUILD_OPTIONS_GENERIC} ${$*_DEB_BUILD_OPTIONS}" dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $$mergedir $(LOG) ) popd $(LOG_SIMPLE) # Clean up if [ -f $($*_SRC_PATH).patch/series ]; then pushd $($*_SRC_PATH) && quilt pop -a -f; [ -d .pc ] && rm -rf .pc; popd; fi # Take built package(s) - mv $(addprefix $($*_SRC_PATH)/../, $* $($*_DERIVED_DEBS) $($*_EXTRA_DEBS)) $(DEBS_PATH) $(LOG) + mv -f $(addprefix $($*_SRC_PATH)/../, $* $($*_DERIVED_DEBS) $($*_EXTRA_DEBS)) $(DEBS_PATH) $(LOG) # Save the target deb into DPKG cache $(call SAVE_CACHE,$*,$@) @@ -516,7 +548,7 @@ $(addprefix $(DEBS_PATH)/, $(SONIC_EXTRA_DEBS)) : $(DEBS_PATH)/% : .platform $$( SONIC_TARGET_LIST += $(addprefix $(DEBS_PATH)/, $(SONIC_EXTRA_DEBS)) # Targets for installing debian packages prior to build one that depends on them -SONIC_INSTALL_TARGETS = $(addsuffix -install,$(addprefix $(DEBS_PATH)/, \ +SONIC_INSTALL_DEBS = $(addsuffix -install,$(addprefix $(DEBS_PATH)/, \ $(SONIC_ONLINE_DEBS) \ $(SONIC_COPY_DEBS) \ $(SONIC_MAKE_DEBS) \ @@ -524,20 +556,22 @@ SONIC_INSTALL_TARGETS = $(addsuffix -install,$(addprefix $(DEBS_PATH)/, \ $(SONIC_PYTHON_STDEB_DEBS) \ $(SONIC_DERIVED_DEBS) \ $(SONIC_EXTRA_DEBS))) -$(SONIC_INSTALL_TARGETS) : $(DEBS_PATH)/%-install : .platform $$(addsuffix -install,$$(addprefix $(DEBS_PATH)/,$$($$*_DEPENDS))) $(DEBS_PATH)/$$* +$(SONIC_INSTALL_DEBS) : $(DEBS_PATH)/%-install : .platform $$(addsuffix -install,$$(addprefix $(DEBS_PATH)/,$$($$*_DEPENDS))) $(DEBS_PATH)/$$* $(HEADER) [ -f $(DEBS_PATH)/$* ] || { echo $(DEBS_PATH)/$* does not exist $(LOG) && false $(LOG) } while true; do # wait for conflicted packages to be uninstalled $(foreach deb, $($*_CONFLICT_DEBS), \ - { while dpkg -s $(firstword $(subst _, ,$(basename $(deb)))) &> /dev/null; do echo "waiting for $(deb) to be uninstalled" $(LOG); sleep 1; done } ) + { while dpkg -s $(firstword $(subst _, ,$(basename $(deb)))) | grep "^Version: $(word 2, $(subst _, ,$(basename $(deb))))" &> /dev/null; do echo "waiting for $(deb) to be uninstalled" $(LOG); sleep 1; done } ) # put a lock here because dpkg does not allow installing packages in parallel if mkdir $(DEBS_PATH)/dpkg_lock &> /dev/null; then - { sudo DEBIAN_FRONTEND=noninteractive dpkg -i $(DEBS_PATH)/$* $(LOG) && rm -d $(DEBS_PATH)/dpkg_lock && break; } || { rm -d $(DEBS_PATH)/dpkg_lock && exit 1 ; } + { sudo DEBIAN_FRONTEND=noninteractive dpkg -i $(DEBS_PATH)/$* $(LOG) && rm -d $(DEBS_PATH)/dpkg_lock && break; } || { set +e; rm -d $(DEBS_PATH)/dpkg_lock; sudo lsof /var/lib/dpkg/lock-frontend; ps aux; exit 1 ; } fi + sleep 10 done $(FOOTER) + ############################################################################### ## Python packages ############################################################################### @@ -563,16 +597,16 @@ $(addprefix $(PYTHON_DEBS_PATH)/, $(SONIC_PYTHON_STDEB_DEBS)) : $(PYTHON_DEBS_PA if [ -z '$($*_CACHE_LOADED)' ] ; then # Apply series of patches if exist - if [ -f $($*_SRC_PATH).patch/series ]; then pushd $($*_SRC_PATH) && QUILT_PATCHES=../$(notdir $($*_SRC_PATH)).patch quilt push -a; popd; fi + if [ -f $($*_SRC_PATH).patch/series ]; then pushd $($*_SRC_PATH) && quilt applied || QUILT_PATCHES=../$(notdir $($*_SRC_PATH)).patch quilt push -a; popd; fi $(LOG) # Build project pushd $($*_SRC_PATH) $(LOG_SIMPLE) rm -rf deb_dist/* $(LOG) python setup.py --command-packages=stdeb.command bdist_deb $(LOG) popd $(LOG_SIMPLE) # Clean up - if [ -f $($*_SRC_PATH).patch/series ]; then pushd $($*_SRC_PATH) && quilt pop -a -f; [ -d .pc ] && rm -rf .pc; popd; fi + if [ -f $($*_SRC_PATH).patch/series ]; then pushd $($*_SRC_PATH) && quilt pop -a -f; [ -d .pc ] && rm -rf .pc; popd; fi $(LOG) # Take built package(s) - mv $(addprefix $($*_SRC_PATH)/deb_dist/, $* $($*_DERIVED_DEBS)) $(PYTHON_DEBS_PATH) $(LOG) + mv -f $(addprefix $($*_SRC_PATH)/deb_dist/, $* $($*_DERIVED_DEBS)) $(PYTHON_DEBS_PATH) $(LOG) # Save the target deb into DPKG cache $(call SAVE_CACHE,$*,$@) @@ -603,18 +637,23 @@ $(addprefix $(PYTHON_WHEELS_PATH)/, $(SONIC_PYTHON_WHEELS)) : $(PYTHON_WHEELS_PA pushd $($*_SRC_PATH) $(LOG_SIMPLE) # apply series of patches if exist - if [ -f ../$(notdir $($*_SRC_PATH)).patch/series ]; then QUILT_PATCHES=../$(notdir $($*_SRC_PATH)).patch quilt push -a; fi + if [ -f ../$(notdir $($*_SRC_PATH)).patch/series ]; then quilt applied || QUILT_PATCHES=../$(notdir $($*_SRC_PATH)).patch quilt push -a; fi $(LOG) + # Use pip instead of later setup.py to install dependencies into user home, but uninstall self + pip$($*_PYTHON_VERSION) install . && pip$($*_PYTHON_VERSION) uninstall --yes `python setup.py --name` if [ ! "$($*_TEST)" = "n" ]; then python$($*_PYTHON_VERSION) setup.py test $(LOG); fi python$($*_PYTHON_VERSION) setup.py bdist_wheel $(LOG) # clean up if [ -f ../$(notdir $($*_SRC_PATH)).patch/series ]; then quilt pop -a -f; [ -d .pc ] && rm -rf .pc; fi popd $(LOG_SIMPLE) - mv $($*_SRC_PATH)/dist/$* $(PYTHON_WHEELS_PATH) $(LOG) + mv -f $($*_SRC_PATH)/dist/$* $(PYTHON_WHEELS_PATH) $(LOG) # Save the target deb into DPKG cache $(call SAVE_CACHE,$*,$@) fi + # Uninstall unneeded build dependency + $(call UNINSTALL_DEBS,$($*_UNINSTALLS)) + $(FOOTER) SONIC_TARGET_LIST += $(addprefix $(PYTHON_WHEELS_PATH)/, $(SONIC_PYTHON_WHEELS)) @@ -647,7 +686,7 @@ docker-start : $(addprefix $(TARGET_PATH)/, $(SONIC_SIMPLE_DOCKER_IMAGES)) : $(TARGET_PATH)/%.gz : .platform docker-start $$(addsuffix -load,$$(addprefix $(TARGET_PATH)/,$$($$*.gz_LOAD_DOCKERS))) $(HEADER) # Apply series of patches if exist - if [ -f $($*.gz_PATH).patch/series ]; then pushd $($*.gz_PATH) && QUILT_PATCHES=../$(notdir $($*.gz_PATH)).patch quilt push -a; popd; fi + if [ -f $($*.gz_PATH).patch/series ]; then pushd $($*.gz_PATH) && quilt applied || QUILT_PATCHES=../$(notdir $($*.gz_PATH)).patch quilt push -a; popd; fi $(LOG) # Prepare docker build info scripts/prepare_docker_buildinfo.sh $* $($*.gz_PATH)/Dockerfile $(CONFIGURED_ARCH) $(TARGET_DOCKERFILE)/Dockerfile.buildinfo docker info $(LOG) @@ -720,7 +759,7 @@ $(addprefix $(TARGET_PATH)/, $(DOCKER_IMAGES)) : $(TARGET_PATH)/%.gz : .platform if [ -z '$($*.gz_CACHE_LOADED)' ] ; then # Apply series of patches if exist - if [ -f $($*.gz_PATH).patch/series ]; then pushd $($*.gz_PATH) && QUILT_PATCHES=../$(notdir $($*.gz_PATH)).patch quilt push -a; popd; fi + if [ -f $($*.gz_PATH).patch/series ]; then pushd $($*.gz_PATH) && quilt applied || QUILT_PATCHES=../$(notdir $($*.gz_PATH)).patch quilt push -a; popd; fi $(LOG) mkdir -p $($*.gz_PATH)/debs $(LOG) mkdir -p $($*.gz_PATH)/files $(LOG) mkdir -p $($*.gz_PATH)/python-debs $(LOG) @@ -734,6 +773,7 @@ $(addprefix $(TARGET_PATH)/, $(DOCKER_IMAGES)) : $(TARGET_PATH)/%.gz : .platform $(eval export $(subst -,_,$(notdir $($*.gz_PATH)))_pydebs=$(shell printf "$(subst $(SPACE),\n,$(call expand,$($*.gz_PYTHON_DEBS)))\n" | awk '!a[$$0]++')) $(eval export $(subst -,_,$(notdir $($*.gz_PATH)))_whls=$(shell printf "$(subst $(SPACE),\n,$(call expand,$($*.gz_PYTHON_WHEELS)))\n" | awk '!a[$$0]++')) $(eval export $(subst -,_,$(notdir $($*.gz_PATH)))_dbgs=$(shell printf "$(subst $(SPACE),\n,$(call expand,$($*.gz_DBG_PACKAGES)))\n" | awk '!a[$$0]++')) + $(eval export $(subst -,_,$(notdir $($*.gz_PATH)))_pkgs=$(shell printf "$(subst $(SPACE),\n,$(call expand,$($*.gz_APT_PACKAGES)))\n" | awk '!a[$$0]++')) j2 $($*.gz_PATH)/Dockerfile.j2 > $($*.gz_PATH)/Dockerfile # Prepare docker build info PACKAGE_URL_PREFIX=$(PACKAGE_URL_PREFIX) \ @@ -784,6 +824,7 @@ $(addprefix $(TARGET_PATH)/, $(DOCKER_DBG_IMAGES)) : $(TARGET_PATH)/%-$(DBG_IMAG # Export variables for j2. Use path for unique variable names, e.g. docker_orchagent_debs $(eval export $(subst -,_,$(notdir $($*.gz_PATH)))_dbg_debs=$(shell printf "$(subst $(SPACE),\n,$(call expand,$($*.gz_DBG_DEPENDS),RDEPENDS))\n" | awk '!a[$$0]++')) $(eval export $(subst -,_,$(notdir $($*.gz_PATH)))_image_dbgs=$(shell printf "$(subst $(SPACE),\n,$(call expand,$($*.gz_DBG_IMAGE_PACKAGES)))\n" | awk '!a[$$0]++')) + $(eval export $(subst -,_,$(notdir $($*.gz_PATH)))_dbg_pkgs=$(shell printf "$(subst $(SPACE),\n,$(call expand,$($*.gz_DBG_APT_PACKAGES),RDEPENDS))\n" | awk '!a[$$0]++')) ./build_debug_docker_j2.sh $* $(subst -,_,$(notdir $($*.gz_PATH)))_dbg_debs $(subst -,_,$(notdir $($*.gz_PATH)))_image_dbgs > $($*.gz_PATH)/Dockerfile-dbg.j2 j2 $($*.gz_PATH)/Dockerfile-dbg.j2 > $($*.gz_PATH)/Dockerfile-dbg # Prepare docker build info @@ -839,7 +880,6 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_INSTALLERS)) : $(TARGET_PATH)/% : \ $(addprefix $(IMAGE_DISTRO_DEBS_PATH)/,$(INITRAMFS_TOOLS) \ $(LINUX_KERNEL) \ $(SONIC_DEVICE_DATA) \ - $(PYTHON_CLICK) \ $(IFUPDOWN2) \ $(KDUMP_TOOLS) \ $(NTP) \ @@ -850,7 +890,8 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_INSTALLERS)) : $(TARGET_PATH)/% : \ $(PYTHON_SWSSCOMMON) \ $(PYTHON3_SWSSCOMMON) \ $(SONIC_UTILITIES_DATA) \ - $(SONIC_HOST_SERVICES_DATA)) \ + $(SONIC_HOST_SERVICES_DATA) \ + $(AUDISP_TACPLUS)) \ $$(addprefix $(TARGET_PATH)/,$$($$*_DOCKERS)) \ $$(addprefix $(FILES_PATH)/,$$($$*_FILES)) \ $(if $(findstring y,$(ENABLE_ZTP)),$(addprefix $(IMAGE_DISTRO_DEBS_PATH)/,$(SONIC_ZTP))) \ @@ -865,6 +906,7 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_INSTALLERS)) : $(TARGET_PATH)/% : \ $(addprefix $(PYTHON_WHEELS_PATH)/,$(REDIS_DUMP_LOAD_PY2)) \ $(addprefix $(PYTHON_WHEELS_PATH)/,$(SONIC_PLATFORM_API_PY2)) \ $(if $(findstring y,$(PDDF_SUPPORT)),$(addprefix $(PYTHON_WHEELS_PATH)/,$(PDDF_PLATFORM_API_BASE_PY2))) \ + $(if $(findstring y,$(PDDF_SUPPORT)),$(addprefix $(PYTHON_WHEELS_PATH)/,$(PDDF_PLATFORM_API_BASE_PY3))) \ $(addprefix $(PYTHON_WHEELS_PATH)/,$(SONIC_YANG_MODELS_PY3)) \ $(addprefix $(PYTHON_WHEELS_PATH)/,$(SONIC_CTRMGRD)) \ $(addprefix $(FILES_PATH)/,$($(SONIC_CTRMGRD)_FILES)) \ @@ -897,6 +939,7 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_INSTALLERS)) : $(TARGET_PATH)/% : \ export shutdown_bgp_on_start="$(SHUTDOWN_BGP_ON_START)" export default_buffer_model="$(SONIC_BUFFER_MODEL)" export include_kubernetes="$(INCLUDE_KUBERNETES)" + export kube_docker_proxy="$(KUBE_DOCKER_PROXY)" export enable_pfcwd_on_start="$(ENABLE_PFCWD_ON_START)" export installer_debs="$(addprefix $(IMAGE_DISTRO_DEBS_PATH)/,$($*_INSTALLS))" export lazy_installer_debs="$(foreach deb, $($*_LAZY_INSTALLS),$(foreach device, $($(deb)_PLATFORM),$(addprefix $(device)@, $(IMAGE_DISTRO_DEBS_PATH)/$(deb))))" @@ -920,7 +963,7 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_INSTALLERS)) : $(TARGET_PATH)/% : \ export python_swss_debs+=" $(addprefix $(IMAGE_DISTRO_DEBS_PATH)/,$(LIBSWSSCOMMON)) $(addprefix $(IMAGE_DISTRO_DEBS_PATH)/,$(PYTHON_SWSSCOMMON)) $(addprefix $(IMAGE_DISTRO_DEBS_PATH)/,$(PYTHON3_SWSSCOMMON))" export sonic_utilities_py3_wheel_path="$(addprefix $(PYTHON_WHEELS_PATH)/,$(SONIC_UTILITIES_PY3))" export sonic_host_services_py3_wheel_path="$(addprefix $(PYTHON_WHEELS_PATH)/,$(SONIC_HOST_SERVICES_PY3))" - + export include_mux="$(INCLUDE_MUX)" $(foreach docker, $($*_DOCKERS),\ export docker_image="$(docker)" export docker_image_name="$(basename $(docker))" @@ -936,6 +979,14 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_INSTALLERS)) : $(TARGET_PATH)/% : \ $(eval $(docker:-dbg.gz=.gz)_GLOBAL = yes) ) fi + if [ -f files/build_templates/$($(docker:-dbg.gz=.gz)_CONTAINER_NAME).timer.j2 ]; then + j2 files/build_templates/$($(docker:-dbg.gz=.gz)_CONTAINER_NAME).timer.j2 > $($(docker:-dbg.gz=.gz)_CONTAINER_NAME).timer + + # Set the flag GLOBAL_TIMER for all the global system-wide dockers timers. + $(if $(shell ls files/build_templates/$($(docker:-dbg.gz=.gz)_CONTAINER_NAME).timer.j2 2>/dev/null),\ + $(eval $(docker:-dbg.gz=.gz)_GLOBAL_TIMER = yes) + ) + fi # Any service template, inside instance directory, will be used to generate .service and @.service file. if [ -f files/build_templates/per_namespace/$($(docker:-dbg.gz=.gz)_CONTAINER_NAME).service.j2 ]; then export multi_instance="true" @@ -946,6 +997,16 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_INSTALLERS)) : $(TARGET_PATH)/% : \ export multi_instance="false" j2 files/build_templates/per_namespace/$($(docker:-dbg.gz=.gz)_CONTAINER_NAME).service.j2 > $($(docker:-dbg.gz=.gz)_CONTAINER_NAME).service fi + # Any timer template, inside instance directory, will be used to generate .timer and @.timer file. + if [ -f files/build_templates/per_namespace/$($(docker:-dbg.gz=.gz)_CONTAINER_NAME).timer.j2 ]; then + export multi_instance="true" + j2 files/build_templates/per_namespace/$($(docker:-dbg.gz=.gz)_CONTAINER_NAME).timer.j2 > $($(docker:-dbg.gz=.gz)_CONTAINER_NAME)@.timer + $(if $(shell ls files/build_templates/per_namespace/$($(docker:-dbg.gz=.gz)_CONTAINER_NAME).timer.j2 2>/dev/null),\ + $(eval $(docker:-dbg.gz=.gz)_TEMPLATE_TIMER = yes) + ) + export multi_instance="false" + j2 files/build_templates/per_namespace/$($(docker:-dbg.gz=.gz)_CONTAINER_NAME).timer.j2 > $($(docker:-dbg.gz=.gz)_CONTAINER_NAME).timer + fi # Any service template, inside share_image directory, will be used to generate -chassis.service file. # TODO: need better way to name the image-shared service if [ -f files/build_templates/share_image/$($(docker:-dbg.gz=.gz)_CONTAINER_NAME).service.j2 ]; then @@ -978,7 +1039,20 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_INSTALLERS)) : $(TARGET_PATH)/% : \ $(eval SERVICES += "$(addsuffix -chassis.service, $($(docker:-dbg.gz=.gz)_CONTAINER_NAME))") ) ) + # Marks template timers with an "@" according to systemd convention + # If the $($docker)_TEMPLATE_TIMER) variable is set, the timer will be treated as a template + # If the $($docker)_GLOBAL_TIMER) and $($docker)_TEMPLATE_TIMER) variables are set the timer will be added both as a global and template timer. + $(foreach docker, $($*_DOCKERS),\ + $(if $($(docker:-dbg.gz=.gz)_TEMPLATE_TIMER),\ + $(if $($(docker:-dbg.gz=.gz)_GLOBAL_TIMER),\ + $(eval TIMERS += "$(addsuffix .timer, $($(docker:-dbg.gz=.gz)_CONTAINER_NAME))")\ + )\ + $(eval TIMERS += "$(addsuffix @.timer, $($(docker:-dbg.gz=.gz)_CONTAINER_NAME))"),\ + $(eval TIMERS += "$(addsuffix .timer, $($(docker:-dbg.gz=.gz)_CONTAINER_NAME))") + ) + ) export installer_services="$(SERVICES)" + export installer_timers="$(TIMERS)" export installer_extra_files="$(foreach docker, $($*_DOCKERS), $(foreach file, $($(docker:-dbg.gz=.gz)_BASE_IMAGE_FILES), $($(docker:-dbg.gz=.gz)_PATH)/base_image_files/$(file)))" @@ -1004,6 +1078,7 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_INSTALLERS)) : $(TARGET_PATH)/% : \ SONIC_ENFORCE_VERSIONS=$(SONIC_ENFORCE_VERSIONS) \ TRUSTED_GPG_URLS=$(TRUSTED_GPG_URLS) \ PACKAGE_URL_PREFIX=$(PACKAGE_URL_PREFIX) \ + MULTIARCH_QEMU_ENVIRON=$(MULTIARCH_QEMU_ENVIRON) \ ./build_debian.sh $(LOG) USERNAME="$(USERNAME)" \ @@ -1098,4 +1173,8 @@ jessie : $$(addprefix $(TARGET_PATH)/,$$(JESSIE_DOCKER_IMAGES)) \ .PHONY : $(SONIC_CLEAN_DEBS) $(SONIC_CLEAN_FILES) $(SONIC_CLEAN_TARGETS) $(SONIC_CLEAN_STDEB_DEBS) $(SONIC_CLEAN_WHEELS) $(SONIC_PHONY_TARGETS) clean distclean configure -.INTERMEDIATE : $(SONIC_INSTALL_TARGETS) $(SONIC_INSTALL_WHEELS) $(DOCKER_LOAD_TARGETS) docker-start .platform +.INTERMEDIATE : $(SONIC_INSTALL_DEBS) $(SONIC_INSTALL_WHEELS) $(DOCKER_LOAD_TARGETS) docker-start .platform + +## To build some commonly used libs. Some submodules depend on these libs. +## It is used in component pipelines. For example: swss needs libnl, libyang +lib-packages: $(addprefix $(DEBS_PATH)/,$(LIBNL3) $(LIBYANG)) diff --git a/sonic-slave-buster/Dockerfile.j2 b/sonic-slave-buster/Dockerfile.j2 index 412830f387d9..9e3fa0d3ad69 100644 --- a/sonic-slave-buster/Dockerfile.j2 +++ b/sonic-slave-buster/Dockerfile.j2 @@ -1,46 +1,18 @@ -{%- if CONFIGURED_ARCH == "armhf" %} -FROM multiarch/qemu-user-static:x86_64-arm-5.0.0-2 as qemu -FROM multiarch/debian-debootstrap:armhf-buster +{% set prefix = DEFAULT_CONTAINER_REGISTRY %} +{%- if CONFIGURED_ARCH == "armhf" and MULTIARCH_QEMU_ENVIRON == "y" %} +FROM {{ prefix }}multiarch/qemu-user-static:x86_64-arm-5.0.0-2 as qemu +FROM {{ prefix }}multiarch/debian-debootstrap:armhf-buster COPY --from=qemu /usr/bin/qemu-arm-static /usr/bin -{%- elif CONFIGURED_ARCH == "arm64" %} -FROM multiarch/debian-debootstrap:arm64-buster +{%- elif CONFIGURED_ARCH == "arm64" and MULTIARCH_QEMU_ENVIRON == "y" %} +FROM {{ prefix }}multiarch/debian-debootstrap:arm64-buster {%- else -%} -FROM debian:buster +FROM {{ prefix }}debian:buster {%- endif %} MAINTAINER gulv@microsoft.com COPY ["no-check-valid-until", "/etc/apt/apt.conf.d/"] - -RUN echo "deb [arch=amd64] http://debian-archive.trafficmanager.net/debian/ buster main contrib non-free" >> /etc/apt/sources.list && \ - echo "deb-src [arch=amd64] http://debian-archive.trafficmanager.net/debian/ buster main contrib non-free" >> /etc/apt/sources.list && \ - echo "deb [arch=amd64] http://debian-archive.trafficmanager.net/debian-security/ buster/updates main contrib non-free" >> /etc/apt/sources.list && \ - echo "deb-src [arch=amd64] http://debian-archive.trafficmanager.net/debian-security/ buster/updates main contrib non-free" >> /etc/apt/sources.list && \ - echo "deb [arch=amd64] http://debian-archive.trafficmanager.net/debian buster-backports main" >> /etc/apt/sources.list && \ - echo "deb [arch=amd64] http://packages.trafficmanager.net/debian/debian buster main contrib non-free" >> /etc/apt/sources.list && \ - echo "deb [arch=amd64] http://packages.trafficmanager.net/debian/debian buster-updates main contrib non-free" >> /etc/apt/sources.list - -{%- if CONFIGURED_ARCH == "armhf" %} -RUN echo "deb [arch=armhf] http://deb.debian.org/debian buster main contrib non-free" > /etc/apt/sources.list && \ - echo "deb-src [arch=armhf] http://deb.debian.org/debian buster main contrib non-free" >> /etc/apt/sources.list && \ - echo "deb [arch=armhf] http://deb.debian.org/debian buster-updates main contrib non-free" >> /etc/apt/sources.list && \ - echo "deb-src [arch=armhf] http://deb.debian.org/debian buster-updates main contrib non-free" >> /etc/apt/sources.list && \ - echo "deb [arch=armhf] http://security.debian.org buster/updates main contrib non-free" >> /etc/apt/sources.list && \ - echo "deb-src [arch=armhf] http://security.debian.org buster/updates main contrib non-free" >> /etc/apt/sources.list && \ - echo 'deb [arch=armhf] http://ftp.debian.org/debian buster-backports main' >> /etc/apt/sources.list && \ - echo "deb [arch=armhf] http://packages.trafficmanager.net/debian/debian buster main contrib non-free" >> /etc/apt/sources.list && \ - echo "deb [arch=armhf] http://packages.trafficmanager.net/debian/debian buster-updates main contrib non-free" >> /etc/apt/sources.list -{%- elif CONFIGURED_ARCH == "arm64" %} -RUN echo "deb [arch=arm64] http://deb.debian.org/debian buster main contrib non-free" > /etc/apt/sources.list && \ - echo "deb-src [arch=arm64] http://deb.debian.org/debian buster main contrib non-free" >> /etc/apt/sources.list && \ - echo "deb [arch=arm64] http://deb.debian.org/debian buster-updates main contrib non-free" >> /etc/apt/sources.list && \ - echo "deb-src [arch=arm64] http://deb.debian.org/debian buster-updates main contrib non-free" >> /etc/apt/sources.list && \ - echo "deb [arch=arm64] http://security.debian.org buster/updates main contrib non-free" >> /etc/apt/sources.list && \ - echo "deb-src [arch=arm64] http://security.debian.org buster/updates main contrib non-free" >> /etc/apt/sources.list && \ - echo 'deb [arch=arm64] http://ftp.debian.org/debian buster-backports main' >> /etc/apt/sources.list && \ - echo "deb [arch=arm64] http://packages.trafficmanager.net/debian/debian buster main contrib non-free" >> /etc/apt/sources.list && \ - echo "deb [arch=arm64] http://packages.trafficmanager.net/debian/debian buster-updates main contrib non-free" >> /etc/apt/sources.list -{%- endif %} +COPY ["sources.list.{{ CONFIGURED_ARCH }}", "/etc/apt/sources.list"] ## Make apt-get non-interactive ENV DEBIAN_FRONTEND=noninteractive @@ -61,7 +33,6 @@ RUN apt-get update && apt-get install -y \ dh-exec \ kmod \ libtinyxml2-6a \ - libboost-program-options1.67-dev \ libtinyxml2-dev \ python \ python-pip \ @@ -110,6 +81,13 @@ RUN apt-get update && apt-get install -y \ libxml-simple-perl \ graphviz \ aspell \ +# For SAI meta rpc build - make rpc + libgetopt-long-descriptive-perl \ + libconst-fast-perl \ + libtemplate-perl \ + libnamespace-autoclean-perl \ + libmoose-perl \ + libmoosex-aliases-perl \ # For linux build bc \ fakeroot \ @@ -121,7 +99,6 @@ RUN apt-get update && apt-get install -y \ module-assistant \ # For thrift build\ gem2deb \ - libboost-all-dev \ libevent-dev \ libglib2.0-dev \ libqt4-dev \ @@ -147,6 +124,7 @@ RUN apt-get update && apt-get install -y \ bison \ expat \ libexpat1-dev \ + aspell-en \ dpatch \ libdb-dev \ iptables-dev \ @@ -156,7 +134,7 @@ RUN apt-get update && apt-get install -y \ libxml2-dev \ # For BFN sdk build libusb-1.0-0-dev \ - libcurl3-nss-dev \ + libcurl4-openssl-dev \ libunwind8-dev \ telnet \ libc-ares2 \ @@ -197,24 +175,6 @@ RUN apt-get update && apt-get install -y \ lua-cjson-dev \ # For mft kernel module build dkms \ -# For python3.5 build - sharutils \ - libncursesw5-dev \ - libbz2-dev \ - liblzma-dev \ - libgdbm-dev \ - tk-dev \ - blt-dev \ - libmpdec-dev \ - libbluetooth-dev \ - locales \ - libsqlite3-dev \ - libgpm2 \ - time \ - net-tools \ - xvfb \ - python-sphinx \ - python3-sphinx \ # For Jenkins static analysis, unit testing and code coverage cppcheck \ clang \ @@ -262,6 +222,8 @@ RUN apt-get update && apt-get install -y \ # For gtest libgtest-dev \ cmake \ +# For gmock + libgmock-dev \ # For pam_tacplus build autoconf-archive \ # For iproute2 @@ -320,7 +282,34 @@ RUN apt-get update && apt-get install -y \ libxml2-utils \ xsltproc \ python-lxml \ - libexpat1-dev + libexpat1-dev \ +# For kdump-tools + libbz2-dev \ +# For linkmgrd + libboost1.71-dev \ + libboost-program-options1.71-dev \ + libboost-system1.71-dev \ + libboost-thread1.71-dev \ + libboost-atomic1.71-dev \ + libboost-chrono1.71-dev \ + libboost-container1.71-dev \ + libboost-context1.71-dev \ + libboost-contract1.71-dev \ + libboost-coroutine1.71-dev \ + libboost-date-time1.71-dev \ + libboost-fiber1.71-dev \ + libboost-filesystem1.71-dev \ + libboost-graph-parallel1.71-dev \ + libboost-log1.71-dev \ + libboost-regex1.71-dev \ + googletest \ + libgtest-dev \ + libgcc-8-dev \ +# For audisp-tacplus + libauparse-dev \ + auditd + +RUN apt-get -y build-dep openssh # Build fix for ARMHF buster libsairedis {%- if CONFIGURED_ARCH == "armhf" %} @@ -340,6 +329,9 @@ RUN apt-get update && apt-get install -y \ # Aspell is unable to locate the language dictionaries. # Re-installing aspell-en dictionary to fix it. RUN apt-get install --reinstall -y aspell-en + + # workaround because of https://bugs.launchpad.net/qemu/+bug/1805913, just disable aspell + RUN cp /bin/true /usr/bin/aspell {%- endif %} ## Config dpkg @@ -386,6 +378,8 @@ RUN pip3 install fastentrypoints # For running Python unit tests RUN pip2 install pytest-runner==4.4 RUN pip3 install pytest-runner==5.2 +RUN pip2 install nose==1.3.7 +RUN pip3 install nose==1.3.7 RUN pip2 install mockredispy==2.9.3 RUN pip3 install mockredispy==2.9.3 @@ -410,13 +404,14 @@ RUN pip3 uninstall -y enum34 RUN pip2 install j2cli==0.3.10 # For sonic-mgmt-framework -RUN pip2 install "PyYAML==5.3.1" -RUN pip3 install "PyYAML==5.3.1" -RUN pip2 install "lxml==4.6.1" -RUN pip3 install "lxml==4.6.1" +# The option --no-build-isolation can be removed when upgrading PyYAML to 6.0.1 +RUN pip2 install "PyYAML==5.4.1" --no-build-isolation +RUN pip3 install "PyYAML==5.4.1" --no-build-isolation +RUN pip2 install "lxml==4.6.5" +RUN pip3 install "lxml==4.6.5" # For sonic-platform-common testing -RUN pip3 install redis +RUN pip3 install redis==3.5.3 # For vs image build RUN pip2 install pexpect==4.6.0 @@ -427,13 +422,15 @@ RUN pip2 install Pympler==0.8 RUN pip3 install Pympler==0.8 # For sonic_yang_model build -RUN pip2 install pyang==2.1.1 -RUN pip3 install pyang==2.1.1 +RUN pip3 install pyang==2.4.0 # For mgmt-framework build RUN pip2 install mmh3==2.5.1 RUN pip3 install mmh3==2.5.1 +# For latest version error, use previous version +RUN pip3 install deepdiff==6.2.2 + RUN apt-get install -y xsltproc # Install dependencies for isc-dhcp-relay build @@ -472,18 +469,19 @@ RUN add-apt-repository \ stable" RUN apt-get update RUN apt-get install -y docker-ce=5:18.09.5~3-0~debian-buster docker-ce-cli=5:18.09.5~3-0~debian-buster -RUN echo "DOCKER_OPTS=\"--experimental --storage-driver=vfs\"" >> /etc/default/docker +RUN echo "DOCKER_OPTS=\"--experimental --storage-driver=vfs {{ DOCKER_EXTRA_OPTS }}\"" >> /etc/default/docker RUN update-alternatives --set iptables /usr/sbin/iptables-legacy # Install m2crypto package, needed by SWI tools RUN pip2 install m2crypto==0.36.0 # Install swi tools -RUN pip2 install git+https://github.com/aristanetworks/swi-tools.git@d51761ec0bb93c73039233f3c01ed48235ffad00 +RUN pip3 install git+https://github.com/aristanetworks/swi-tools.git@bead66bf261770237f7dd21ace3774ba04a017e9 {% if CONFIGURED_ARCH != "amd64" -%} # Install node.js for azure pipeline -RUN apt-get install -y node.js +RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - +RUN apt-get install -y nodejs # Tell azure pipeline to use node.js in the docker LABEL "com.azure.dev.pipelines.agent.handler.node.path"="/usr/bin/node" diff --git a/sonic-slave-buster/Dockerfile.user.j2 b/sonic-slave-buster/Dockerfile.user.j2 index a1181524bd91..8b17e482356c 100644 --- a/sonic-slave-buster/Dockerfile.user.j2 +++ b/sonic-slave-buster/Dockerfile.user.j2 @@ -1,8 +1,8 @@ ARG slave_base_tag_ref=latest -{%- if CONFIGURED_ARCH == "amd64" %} +{%- if MULTIARCH_QEMU_ENVIRON != "y" %} FROM sonic-slave-buster:${slave_base_tag_ref} {%- else %} -FROM sonic-slave-buster-{{ CONFIGURED_ARCH }}:${slave_base_tag_ref} +FROM sonic-slave-buster-march-{{ CONFIGURED_ARCH }}:${slave_base_tag_ref} {%- endif %} # Add user diff --git a/sonic-slave-jessie/Dockerfile.j2 b/sonic-slave-jessie/Dockerfile.j2 index 2914deb7842d..55bc9e048071 100644 --- a/sonic-slave-jessie/Dockerfile.j2 +++ b/sonic-slave-jessie/Dockerfile.j2 @@ -1,9 +1,10 @@ +{% set prefix = DEFAULT_CONTAINER_REGISTRY %} {%- if CONFIGURED_ARCH == "armhf" -%} -FROM multiarch/debian-debootstrap:armhf-jessie +FROM {{ prefix }}multiarch/debian-debootstrap:armhf-jessie {%- elif CONFIGURED_ARCH == "arm64" -%} -FROM multiarch/debian-debootstrap:arm64-jessie +FROM {{ prefix }}multiarch/debian-debootstrap:arm64-jessie {%- else -%} -FROM debian:jessie +FROM {{ prefix }}debian:jessie {%- endif %} MAINTAINER johnar@microsoft.com @@ -176,24 +177,6 @@ RUN apt-get update && apt-get install -y \ libjemalloc-dev \ # For mft kernel module build dkms \ -# For python3.5 build - sharutils \ - libncursesw5-dev \ - libbz2-dev \ - liblzma-dev \ - libgdbm-dev \ - tk-dev \ - blt-dev \ - libmpdec-dev \ - libbluetooth-dev \ - locales \ - libsqlite3-dev \ - libgpm2 \ - time \ - net-tools \ - xvfb \ - python-sphinx \ - python3-sphinx \ # For Jenkins static analysis, unit testing and code coverage cppcheck \ clang \ @@ -250,6 +233,9 @@ RUN apt-get update && apt-get install -y \ texi2html \ # For initramfs bash-completion \ +# For audisp-tacplus + libauparse-dev \ + auditd \ {% if CONFIGURED_ARCH == "amd64" -%} # For sonic vs image build dosfstools \ @@ -268,7 +254,7 @@ RUN apt-get -y build-dep linux {%- endif %} # For gobgp and telemetry build -RUN export VERSION=1.14.2 \ +RUN export VERSION=1.15.15 \ {%- if CONFIGURED_ARCH == "armhf" %} && wget https://storage.googleapis.com/golang/go$VERSION.linux-armv6l.tar.gz \ && tar -C /usr/local -xzf go$VERSION.linux-armv6l.tar.gz \ @@ -350,7 +336,7 @@ RUN apt-get install -y docker-ce=18.03.1~ce-0~debian {%- elif CONFIGURED_ARCH == "armhf" %} RUN apt-get install -y docker-ce=18.06.3~ce~3-0~debian {%- endif %} -RUN echo "DOCKER_OPTS=\"--experimental --storage-driver=vfs\"" >> /etc/default/docker +RUN echo "DOCKER_OPTS=\"--experimental --storage-driver=vfs {{ DOCKER_EXTRA_OPTS }}\"" >> /etc/default/docker # For jenkins slave RUN echo "deb [arch={{ CONFIGURED_ARCH }}] http://archive.debian.org/debian jessie-backports main" >> /etc/apt/sources.list diff --git a/sonic-slave-stretch/Dockerfile.j2 b/sonic-slave-stretch/Dockerfile.j2 index 95c294f4e4c6..7871d2ad76fc 100644 --- a/sonic-slave-stretch/Dockerfile.j2 +++ b/sonic-slave-stretch/Dockerfile.j2 @@ -1,45 +1,16 @@ -{%- if CONFIGURED_ARCH == "armhf" %} -FROM multiarch/debian-debootstrap:armhf-stretch -{%- elif CONFIGURED_ARCH == "arm64" %} -FROM multiarch/debian-debootstrap:arm64-stretch +{% set prefix = DEFAULT_CONTAINER_REGISTRY %} +{%- if CONFIGURED_ARCH == "armhf" and MULTIARCH_QEMU_ENVIRON == "y" %} +FROM {{ prefix }}multiarch/debian-debootstrap:armhf-stretch +{%- elif CONFIGURED_ARCH == "arm64" and MULTIARCH_QEMU_ENVIRON == "y" %} +FROM {{ prefix }}multiarch/debian-debootstrap:arm64-stretch {%- else -%} -FROM debian:stretch +FROM {{ prefix }}debian:stretch {%- endif %} MAINTAINER gulv@microsoft.com COPY ["no-check-valid-until", "/etc/apt/apt.conf.d/"] - -RUN echo "deb [arch=amd64] http://debian-archive.trafficmanager.net/debian/ stretch main contrib non-free" >> /etc/apt/sources.list && \ - echo "deb-src [arch=amd64] http://debian-archive.trafficmanager.net/debian/ stretch main contrib non-free" >> /etc/apt/sources.list && \ - echo "deb [arch=amd64] http://debian-archive.trafficmanager.net/debian-security/ stretch/updates main contrib non-free" >> /etc/apt/sources.list && \ - echo "deb-src [arch=amd64] http://debian-archive.trafficmanager.net/debian-security/ stretch/updates main contrib non-free" >> /etc/apt/sources.list && \ - echo "deb [arch=amd64] http://debian-archive.trafficmanager.net/debian stretch-backports main" >> /etc/apt/sources.list && \ - echo "deb [arch=amd64] http://packages.trafficmanager.net/debian/debian stretch main contrib non-free" >> /etc/apt/sources.list && \ - echo "deb [arch=amd64] http://packages.trafficmanager.net/debian/debian stretch-updates main contrib non-free" >> /etc/apt/sources.list && \ - echo "deb [arch=amd64] http://packages.microsoft.com/debian/9/prod stretch main" >> /etc/apt/sources.list - -{%- if CONFIGURED_ARCH == "armhf" %} -RUN echo "deb [arch=armhf] http://deb.debian.org/debian stretch main contrib non-free" > /etc/apt/sources.list && \ - echo "deb-src [arch=armhf] http://deb.debian.org/debian stretch main contrib non-free" >> /etc/apt/sources.list && \ - echo "deb [arch=armhf] http://deb.debian.org/debian stretch-updates main contrib non-free" >> /etc/apt/sources.list && \ - echo "deb-src [arch=armhf] http://deb.debian.org/debian stretch-updates main contrib non-free" >> /etc/apt/sources.list && \ - echo "deb [arch=armhf] http://security.debian.org stretch/updates main contrib non-free" >> /etc/apt/sources.list && \ - echo "deb-src [arch=armhf] http://security.debian.org stretch/updates main contrib non-free" >> /etc/apt/sources.list && \ - echo 'deb [arch=armhf] http://ftp.debian.org/debian stretch-backports main' >> /etc/apt/sources.list && \ - echo "deb [arch=armhf] http://packages.trafficmanager.net/debian/debian stretch main contrib non-free" >> /etc/apt/sources.list && \ - echo "deb [arch=armhf] http://packages.trafficmanager.net/debian/debian stretch-updates main contrib non-free" >> /etc/apt/sources.list -{%- elif CONFIGURED_ARCH == "arm64" %} -RUN echo "deb [arch=arm64] http://deb.debian.org/debian stretch main contrib non-free" > /etc/apt/sources.list && \ - echo "deb-src [arch=arm64] http://deb.debian.org/debian stretch main contrib non-free" >> /etc/apt/sources.list && \ - echo "deb [arch=arm64] http://deb.debian.org/debian stretch-updates main contrib non-free" >> /etc/apt/sources.list && \ - echo "deb-src [arch=arm64] http://deb.debian.org/debian stretch-updates main contrib non-free" >> /etc/apt/sources.list && \ - echo "deb [arch=arm64] http://security.debian.org stretch/updates main contrib non-free" >> /etc/apt/sources.list && \ - echo "deb-src [arch=arm64] http://security.debian.org stretch/updates main contrib non-free" >> /etc/apt/sources.list && \ - echo 'deb [arch=arm64] http://ftp.debian.org/debian stretch-backports main' >> /etc/apt/sources.list && \ - echo "deb [arch=arm64] http://packages.trafficmanager.net/debian/debian stretch main contrib non-free" >> /etc/apt/sources.list && \ - echo "deb [arch=arm64] http://packages.trafficmanager.net/debian/debian stretch-updates main contrib non-free" >> /etc/apt/sources.list -{%- endif %} +COPY ["sources.list.{{ CONFIGURED_ARCH }}", "/etc/apt/sources.list"] ## Make apt-get non-interactive ENV DEBIAN_FRONTEND=noninteractive @@ -196,24 +167,6 @@ RUN apt-get update && apt-get install -y \ lua-cjson-dev \ # For mft kernel module build dkms \ -# For python3.5 build - sharutils \ - libncursesw5-dev \ - libbz2-dev \ - liblzma-dev \ - libgdbm-dev \ - tk-dev \ - blt-dev \ - libmpdec-dev \ - libbluetooth-dev \ - locales \ - libsqlite3-dev \ - libgpm2 \ - time \ - net-tools \ - xvfb \ - python-sphinx \ - python3-sphinx \ # For Jenkins static analysis, unit testing and code coverage cppcheck \ clang \ @@ -306,7 +259,10 @@ RUN apt-get update && apt-get install -y \ libxml2-utils \ xsltproc \ python-lxml \ - libexpat1-dev + libexpat1-dev \ +# For audisp-tacplus + libauparse-dev \ + auditd ## Config dpkg ## install the configuration file if it’s currently missing @@ -361,22 +317,24 @@ RUN pip3 uninstall -y enum34 RUN pip2 install j2cli==0.3.10 # For sonic snmpagent mock testing +RUN pip3 install nose==1.3.7 RUN pip3 install mockredispy==2.9.3 # For sonic-mgmt-framework RUN pip2 install "PyYAML==5.3.1" RUN pip3 install "PyYAML==5.3.1" -RUN pip2 install "lxml==4.6.1" -RUN pip3 install "lxml==4.6.1" +RUN pip2 install "lxml==4.6.5" +RUN pip3 install "lxml==4.6.5" # For sonic-platform-common testing -RUN pip3 install redis +RUN pip3 install redis==3.5.3 # For vs image build RUN pip2 install pexpect==4.6.0 # For sonic-utilities build +RUN pip2 install nose==1.3.7 RUN pip2 install mockredispy==2.9.3 RUN pip2 install pytest-runner==4.4 RUN pip2 install setuptools==40.8.0 @@ -385,10 +343,10 @@ RUN pip2 install setuptools==40.8.0 RUN pip2 install Pympler==0.8 # For sonic_yang_model build -RUN pip2 install pyang==2.1.1 +RUN pip3 install pyang==2.4.0 # For mgmt-framework build -RUN pip2 install mmh3 +RUN pip2 install mmh3==2.5.1 # Install dependencies for isc-dhcp-relay build RUN apt-get -y build-dep isc-dhcp @@ -444,7 +402,7 @@ RUN apt-get install -y docker-ce=5:18.09.5~3-0~debian-stretch docker-ce-cli=5:18 {%- else %} RUN apt-get install -y docker-ce=18.06.3~ce~3-0~debian {%- endif %} -RUN echo "DOCKER_OPTS=\"--experimental --storage-driver=vfs\"" >> /etc/default/docker +RUN echo "DOCKER_OPTS=\"--experimental --storage-driver=vfs {{ DOCKER_EXTRA_OPTS }}\"" >> /etc/default/docker # Install m2crypto package, needed by SWI tools RUN pip install m2crypto==0.36.0 diff --git a/sonic-slave-stretch/Dockerfile.user.j2 b/sonic-slave-stretch/Dockerfile.user.j2 index 8e94b7046ae3..fd39b1fde954 100644 --- a/sonic-slave-stretch/Dockerfile.user.j2 +++ b/sonic-slave-stretch/Dockerfile.user.j2 @@ -1,8 +1,8 @@ ARG slave_base_tag_ref=latest -{%- if CONFIGURED_ARCH == "amd64" %} +{%- if MULTIARCH_QEMU_ENVIRON != "y" %} FROM sonic-slave-stretch:${slave_base_tag_ref} {%- else %} -FROM sonic-slave-stretch-{{ CONFIGURED_ARCH }}:${slave_base_tag_ref} +FROM sonic-slave-stretch-march-{{ CONFIGURED_ARCH }}:${slave_base_tag_ref} {%- endif %} # Add user diff --git a/src/bash/Makefile b/src/bash/Makefile index 602dc01ece70..6576ff92e74a 100644 --- a/src/bash/Makefile +++ b/src/bash/Makefile @@ -10,7 +10,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : dget -u https://launchpad.net/debian/+archive/primary/+sourcefiles/bash/$(BASH_VERSION_FULL)/bash_$(BASH_VERSION_FULL).dsc pushd bash-$(BASH_VERSION_MAJOR) - DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage -us -uc -b -j$(SONIC_CONFIG_MAKE_JOBS) + DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage -us -uc -b -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR) popd mv $* $(DEST)/ diff --git a/src/dhcpmon/Makefile b/src/dhcpmon/Makefile index 61cde376730b..4d21f57199f2 100644 --- a/src/dhcpmon/Makefile +++ b/src/dhcpmon/Makefile @@ -2,8 +2,9 @@ RM := rm -rf DHCPMON_TARGET := dhcpmon CP := cp MKDIR := mkdir -CC := gcc +CC := g++ MV := mv +PWD := $(shell pwd) # All of the sources participating in the build are defined here -include src/subdir.mk @@ -23,7 +24,7 @@ all: sonic-dhcpmon # Tool invocations sonic-dhcpmon: $(OBJS) $(USER_OBJS) @echo 'Building target: $@' - @echo 'Invoking: GCC C Linker' + @echo 'Invoking: G++ C Linker' $(CC) -o "$(DHCPMON_TARGET)" $(OBJS) $(USER_OBJS) $(LIBS) @echo 'Finished building target: $@' @echo ' ' diff --git a/src/dhcpmon/debian/rules b/src/dhcpmon/debian/rules index 00c628b6625f..76fc7ea1f839 100755 --- a/src/dhcpmon/debian/rules +++ b/src/dhcpmon/debian/rules @@ -1,5 +1,7 @@ #!/usr/bin/make -f +export DEB_BUILD_MAINT_OPTIONS=hardening=+all + DEB_CFLAGS_APPEND=-std=gnu11 export DEB_CFLAGS_APPEND diff --git a/src/dhcpmon/objects.mk b/src/dhcpmon/objects.mk index c9b774a53921..dc0d09e5021f 100644 --- a/src/dhcpmon/objects.mk +++ b/src/dhcpmon/objects.mk @@ -1,4 +1,4 @@ USER_OBJS := -LIBS := -levent -lexplain +LIBS := -levent -lexplain -lswsscommon -pthread -lboost_thread -lboost_system -lhiredis diff --git a/src/dhcpmon/src/dhcp_device.c b/src/dhcpmon/src/dhcp_device.c deleted file mode 100644 index f5cb705ee285..000000000000 --- a/src/dhcpmon/src/dhcp_device.c +++ /dev/null @@ -1,646 +0,0 @@ -/** - * @file dhcp_device.c - * - * device (interface) module - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "dhcp_device.h" - -/** Counter print width */ -#define DHCP_COUNTER_WIDTH 9 - -/** Start of Ether header of a captured frame */ -#define ETHER_START_OFFSET 0 -/** Start of IP header of a captured frame */ -#define IP_START_OFFSET (ETHER_START_OFFSET + ETHER_HDR_LEN) -/** Start of UDP header of a captured frame */ -#define UDP_START_OFFSET (IP_START_OFFSET + sizeof(struct ip)) -/** Start of DHCP header of a captured frame */ -#define DHCP_START_OFFSET (UDP_START_OFFSET + sizeof(struct udphdr)) -/** Start of DHCP Options segment of a captured frame */ -#define DHCP_OPTIONS_HEADER_SIZE 240 -/** Offset of DHCP GIADDR */ -#define DHCP_GIADDR_OFFSET 24 - -#define OP_LDHA (BPF_LD | BPF_H | BPF_ABS) /** bpf ldh Abs */ -#define OP_LDHI (BPF_LD | BPF_H | BPF_IND) /** bpf ldh Ind */ -#define OP_LDB (BPF_LD | BPF_B | BPF_ABS) /** bpf ldb Abs*/ -#define OP_JEQ (BPF_JMP | BPF_JEQ | BPF_K) /** bpf jeq */ -#define OP_JGT (BPF_JMP | BPF_JGT | BPF_K) /** bpf jgt */ -#define OP_RET (BPF_RET | BPF_K) /** bpf ret */ -#define OP_JSET (BPF_JMP | BPF_JSET | BPF_K) /** bpf jset */ -#define OP_LDXB (BPF_LDX | BPF_B | BPF_MSH) /** bpf ldxb */ - -/** Berkeley Packet Filter program for "udp and (port 67 or port 68)". - * This program is obtained using the following command tcpdump: - * `tcpdump -dd "udp and (port 67 or port 68)"` - */ -static struct sock_filter dhcp_bpf_code[] = { - {.code = OP_LDHA, .jt = 0, .jf = 0, .k = 0x0000000c}, // (000) ldh [12] - {.code = OP_JEQ, .jt = 0, .jf = 7, .k = 0x000086dd}, // (001) jeq #0x86dd jt 2 jf 9 - {.code = OP_LDB, .jt = 0, .jf = 0, .k = 0x00000014}, // (002) ldb [20] - {.code = OP_JEQ, .jt = 0, .jf = 18, .k = 0x00000011}, // (003) jeq #0x11 jt 4 jf 22 - {.code = OP_LDHA, .jt = 0, .jf = 0, .k = 0x00000036}, // (004) ldh [54] - {.code = OP_JEQ, .jt = 15, .jf = 0, .k = 0x00000043}, // (005) jeq #0x43 jt 21 jf 6 - {.code = OP_JEQ, .jt = 14, .jf = 0, .k = 0x00000044}, // (006) jeq #0x44 jt 21 jf 7 - {.code = OP_LDHA, .jt = 0, .jf = 0, .k = 0x00000038}, // (007) ldh [56] - {.code = OP_JEQ, .jt = 12, .jf = 11, .k = 0x00000043}, // (008) jeq #0x43 jt 21 jf 20 - {.code = OP_JEQ, .jt = 0, .jf = 12, .k = 0x00000800}, // (009) jeq #0x800 jt 10 jf 22 - {.code = OP_LDB, .jt = 0, .jf = 0, .k = 0x00000017}, // (010) ldb [23] - {.code = OP_JEQ, .jt = 0, .jf = 10, .k = 0x00000011}, // (011) jeq #0x11 jt 12 jf 22 - {.code = OP_LDHA, .jt = 0, .jf = 0, .k = 0x00000014}, // (012) ldh [20] - {.code = OP_JSET, .jt = 8, .jf = 0, .k = 0x00001fff}, // (013) jset #0x1fff jt 22 jf 14 - {.code = OP_LDXB, .jt = 0, .jf = 0, .k = 0x0000000e}, // (014) ldxb 4*([14]&0xf) - {.code = OP_LDHI, .jt = 0, .jf = 0, .k = 0x0000000e}, // (015) ldh [x + 14] - {.code = OP_JEQ, .jt = 4, .jf = 0, .k = 0x00000043}, // (016) jeq #0x43 jt 21 jf 17 - {.code = OP_JEQ, .jt = 3, .jf = 0, .k = 0x00000044}, // (017) jeq #0x44 jt 21 jf 18 - {.code = OP_LDHI, .jt = 0, .jf = 0, .k = 0x00000010}, // (018) ldh [x + 16] - {.code = OP_JEQ, .jt = 1, .jf = 0, .k = 0x00000043}, // (019) jeq #0x43 jt 21 jf 20 - {.code = OP_JEQ, .jt = 0, .jf = 1, .k = 0x00000044}, // (020) jeq #0x44 jt 21 jf 22 - {.code = OP_RET, .jt = 0, .jf = 0, .k = 0x00040000}, // (021) ret #262144 - {.code = OP_RET, .jt = 0, .jf = 0, .k = 0x00000000}, // (022) ret #0 -}; - -/** Filter program socket struct */ -static struct sock_fprog dhcp_sock_bfp = { - .len = sizeof(dhcp_bpf_code) / sizeof(*dhcp_bpf_code), .filter = dhcp_bpf_code -}; - -/** Aggregate device of DHCP interfaces. It contains aggregate counters from - all interfaces - */ -static dhcp_device_context_t aggregate_dev = {0}; - -/** Monitored DHCP message type */ -static dhcp_message_type_t monitored_msgs[] = { - DHCP_MESSAGE_TYPE_DISCOVER, - DHCP_MESSAGE_TYPE_OFFER, - DHCP_MESSAGE_TYPE_REQUEST, - DHCP_MESSAGE_TYPE_ACK -}; - -/** Number of monitored DHCP message type */ -static uint8_t monitored_msg_sz = sizeof(monitored_msgs) / sizeof(*monitored_msgs); - -/** - * @code handle_dhcp_option_53(context, dhcp_option, dir, iphdr, dhcphdr); - * - * @brief handle the logic related to DHCP option 53 - * - * @param context Device (interface) context - * @param dhcp_option pointer to DHCP option buffer space - * @param dir packet direction - * @param iphdr pointer to packet IP header - * @param dhcphdr pointer to DHCP header - * - * @return none - */ -static void handle_dhcp_option_53(dhcp_device_context_t *context, - const u_char *dhcp_option, - dhcp_packet_direction_t dir, - struct ip *iphdr, - uint8_t *dhcphdr) -{ - in_addr_t giaddr; - switch (dhcp_option[2]) - { - // DHCP messages send by client - case DHCP_MESSAGE_TYPE_DISCOVER: - case DHCP_MESSAGE_TYPE_REQUEST: - case DHCP_MESSAGE_TYPE_DECLINE: - case DHCP_MESSAGE_TYPE_RELEASE: - case DHCP_MESSAGE_TYPE_INFORM: - giaddr = ntohl(dhcphdr[DHCP_GIADDR_OFFSET] << 24 | dhcphdr[DHCP_GIADDR_OFFSET + 1] << 16 | - dhcphdr[DHCP_GIADDR_OFFSET + 2] << 8 | dhcphdr[DHCP_GIADDR_OFFSET + 3]); - if ((context->vlan_ip == giaddr && context->is_uplink && dir == DHCP_TX) || - (!context->is_uplink && dir == DHCP_RX && iphdr->ip_dst.s_addr == INADDR_BROADCAST)) { - context->counters[DHCP_COUNTERS_CURRENT][dir][dhcp_option[2]]++; - aggregate_dev.counters[DHCP_COUNTERS_CURRENT][dir][dhcp_option[2]]++; - } - break; - // DHCP messages send by server - case DHCP_MESSAGE_TYPE_OFFER: - case DHCP_MESSAGE_TYPE_ACK: - case DHCP_MESSAGE_TYPE_NAK: - if ((context->vlan_ip == iphdr->ip_dst.s_addr && context->is_uplink && dir == DHCP_RX) || - (!context->is_uplink && dir == DHCP_TX)) { - context->counters[DHCP_COUNTERS_CURRENT][dir][dhcp_option[2]]++; - aggregate_dev.counters[DHCP_COUNTERS_CURRENT][dir][dhcp_option[2]]++; - } - break; - default: - syslog(LOG_WARNING, "handle_dhcp_option_53(%s): Unknown DHCP option 53 type %d", context->intf, dhcp_option[2]); - break; - } -} - -/** - * @code read_callback(fd, event, arg); - * - * @brief callback for libevent which is called every time out in order to read queued packet capture - * - * @param fd socket to read from - * @param event libevent triggered event - * @param arg user provided argument for callback (interface context) - * - * @return none - */ -static void read_callback(int fd, short event, void *arg) -{ - dhcp_device_context_t *context = (dhcp_device_context_t*) arg; - ssize_t buffer_sz; - - while ((event == EV_READ) && - ((buffer_sz = recv(fd, context->buffer, context->snaplen, MSG_DONTWAIT)) > 0)) { - struct ether_header *ethhdr = (struct ether_header*) context->buffer; - struct ip *iphdr = (struct ip*) (context->buffer + IP_START_OFFSET); - struct udphdr *udp = (struct udphdr*) (context->buffer + UDP_START_OFFSET); - uint8_t *dhcphdr = context->buffer + DHCP_START_OFFSET; - int dhcp_option_offset = DHCP_START_OFFSET + DHCP_OPTIONS_HEADER_SIZE; - - if ((buffer_sz > UDP_START_OFFSET + sizeof(struct udphdr) + DHCP_OPTIONS_HEADER_SIZE) && - (ntohs(udp->len) > DHCP_OPTIONS_HEADER_SIZE)) { - int dhcp_sz = ntohs(udp->len) < buffer_sz - UDP_START_OFFSET - sizeof(struct udphdr) ? - ntohs(udp->len) : buffer_sz - UDP_START_OFFSET - sizeof(struct udphdr); - int dhcp_option_sz = dhcp_sz - DHCP_OPTIONS_HEADER_SIZE; - const u_char *dhcp_option = context->buffer + dhcp_option_offset; - dhcp_packet_direction_t dir = (ethhdr->ether_shost[0] == context->mac[0] && - ethhdr->ether_shost[1] == context->mac[1] && - ethhdr->ether_shost[2] == context->mac[2] && - ethhdr->ether_shost[3] == context->mac[3] && - ethhdr->ether_shost[4] == context->mac[4] && - ethhdr->ether_shost[5] == context->mac[5]) ? - DHCP_TX : DHCP_RX; - int offset = 0; - int stop_dhcp_processing = 0; - while ((offset < (dhcp_option_sz + 1)) && dhcp_option[offset] != 255) { - switch (dhcp_option[offset]) - { - case 53: - if (offset < (dhcp_option_sz + 2)) { - handle_dhcp_option_53(context, &dhcp_option[offset], dir, iphdr, dhcphdr); - } - stop_dhcp_processing = 1; // break while loop since we are only interested in Option 53 - break; - default: - break; - } - - if (stop_dhcp_processing == 1) { - break; - } - - if (dhcp_option[offset] == 0) { // DHCP Option Padding - offset++; - } else { - offset += dhcp_option[offset + 1] + 2; - } - } - } else { - syslog(LOG_WARNING, "read_callback(%s): read length (%ld) is too small to capture DHCP options", - context->intf, buffer_sz); - } - } -} - -/** - * @code dhcp_device_is_dhcp_inactive(counters); - * - * @brief Check if there were no DHCP activity - * - * @param counters current/snapshot counter - * - * @return true if there were no DHCP activity, false otherwise - */ -static bool dhcp_device_is_dhcp_inactive(uint64_t counters[][DHCP_DIR_COUNT][DHCP_MESSAGE_TYPE_COUNT]) -{ - uint64_t *rx_counters = counters[DHCP_COUNTERS_CURRENT][DHCP_RX]; - uint64_t *rx_counter_snapshot = counters[DHCP_COUNTERS_SNAPSHOT][DHCP_RX]; - - bool rv = true; - for (uint8_t i = 0; (i < monitored_msg_sz) && rv; i++) { - rv = rx_counters[monitored_msgs[i]] == rx_counter_snapshot[monitored_msgs[i]]; - } - - return rv; -} - -/** - * @code dhcp_device_is_dhcp_msg_unhealthy(type, counters); - * - * @brief Check if DHCP relay is functioning properly for message of type 'type'. - * For every rx of message 'type', there should be increment of the same message type. - * - * @param type DHCP message type - * @param counters current/snapshot counter - * - * @return true if DHCP message 'type' is transmitted,false otherwise - */ -static bool dhcp_device_is_dhcp_msg_unhealthy(dhcp_message_type_t type, - uint64_t counters[][DHCP_DIR_COUNT][DHCP_MESSAGE_TYPE_COUNT]) -{ - // check if DHCP message 'type' is being relayed - return ((counters[DHCP_COUNTERS_CURRENT][DHCP_RX][type] > counters[DHCP_COUNTERS_SNAPSHOT][DHCP_RX][type]) && - (counters[DHCP_COUNTERS_CURRENT][DHCP_TX][type] <= counters[DHCP_COUNTERS_SNAPSHOT][DHCP_TX][type]) ); -} - -/** - * @code dhcp_device_check_positive_health(counters, counters_snapshot); - * - * @brief Check if DHCP relay is functioning properly for monitored messages (Discover, Offer, Request, ACK.) - * For every rx of monitored messages, there should be increment of the same message type. - * - * @param counters current/snapshot counter - * - * @return DHCP_MON_STATUS_HEALTHY, DHCP_MON_STATUS_UNHEALTHY, or DHCP_MON_STATUS_INDETERMINATE - */ -static dhcp_mon_status_t dhcp_device_check_positive_health(uint64_t counters[][DHCP_DIR_COUNT][DHCP_MESSAGE_TYPE_COUNT]) -{ - dhcp_mon_status_t rv = DHCP_MON_STATUS_HEALTHY; - - bool is_dhcp_unhealthy = false; - for (uint8_t i = 0; (i < monitored_msg_sz) && !is_dhcp_unhealthy; i++) { - is_dhcp_unhealthy = dhcp_device_is_dhcp_msg_unhealthy(monitored_msgs[i], counters); - } - - // if we have rx DORA then we should have corresponding tx DORA (DORA being relayed) - if (is_dhcp_unhealthy) { - rv = DHCP_MON_STATUS_UNHEALTHY; - } - - return rv; -} - -/** - * @code dhcp_device_check_negative_health(counters); - * - * @brief Check that DHCP relayed messages are not being transmitted out of this interface/dev - * using its counters. The interface is negatively healthy if there are not DHCP message - * travelling through it. - * - * @param counters recent interface counter - * @param counters_snapshot snapshot counters - * - * @return DHCP_MON_STATUS_HEALTHY, DHCP_MON_STATUS_UNHEALTHY, or DHCP_MON_STATUS_INDETERMINATE - */ -static dhcp_mon_status_t dhcp_device_check_negative_health(uint64_t counters[][DHCP_DIR_COUNT][DHCP_MESSAGE_TYPE_COUNT]) -{ - dhcp_mon_status_t rv = DHCP_MON_STATUS_HEALTHY; - - uint64_t *tx_counters = counters[DHCP_COUNTERS_CURRENT][DHCP_TX]; - uint64_t *tx_counter_snapshot = counters[DHCP_COUNTERS_SNAPSHOT][DHCP_TX]; - - bool is_dhcp_unhealthy = false; - for (uint8_t i = 0; (i < monitored_msg_sz) && !is_dhcp_unhealthy; i++) { - is_dhcp_unhealthy = tx_counters[monitored_msgs[i]] > tx_counter_snapshot[monitored_msgs[i]]; - } - - // for negative validation, return unhealthy if DHCP packet are being - // transmitted out of the device/interface - if (is_dhcp_unhealthy) { - rv = DHCP_MON_STATUS_UNHEALTHY; - } - - return rv; -} - -/** - * @code dhcp_device_check_health(check_type, counters, counters_snapshot); - * - * @brief Check that DHCP relay is functioning properly given a check type. Positive check - * indicates for every rx of DHCP message of type 'type', there would increment of - * the corresponding TX of the same message type. While negative check indicates the - * device should not be actively transmitting any DHCP messages. If it does, it is - * considered unhealthy. - * - * @param check_type type of health check - * @param counters current/snapshot counter - * - * @return DHCP_MON_STATUS_HEALTHY, DHCP_MON_STATUS_UNHEALTHY, or DHCP_MON_STATUS_INDETERMINATE - */ -static dhcp_mon_status_t dhcp_device_check_health(dhcp_mon_check_t check_type, - uint64_t counters[][DHCP_DIR_COUNT][DHCP_MESSAGE_TYPE_COUNT]) -{ - dhcp_mon_status_t rv = DHCP_MON_STATUS_HEALTHY; - - if (dhcp_device_is_dhcp_inactive(aggregate_dev.counters)) { - rv = DHCP_MON_STATUS_INDETERMINATE; - } else if (check_type == DHCP_MON_CHECK_POSITIVE) { - rv = dhcp_device_check_positive_health(counters); - } else if (check_type == DHCP_MON_CHECK_NEGATIVE) { - rv = dhcp_device_check_negative_health(counters); - } - - return rv; -} - -/** - * @code dhcp_print_counters(vlan_intf, type, counters); - * - * @brief prints DHCP counters to sylsog. - * - * @param vlan_intf vlan interface name - * @param type counter type - * @param counters interface counter - * - * @return none - */ -static void dhcp_print_counters(const char *vlan_intf, - dhcp_counters_type_t type, - uint64_t counters[][DHCP_MESSAGE_TYPE_COUNT]) -{ - static const char *counter_desc[DHCP_COUNTERS_COUNT] = { - [DHCP_COUNTERS_CURRENT] = " Current", - [DHCP_COUNTERS_SNAPSHOT] = "Snapshot" - }; - - syslog( - LOG_NOTICE, - "[%*s-%*s rx/tx] Discover: %*lu/%*lu, Offer: %*lu/%*lu, Request: %*lu/%*lu, ACK: %*lu/%*lu\n", - IF_NAMESIZE, vlan_intf, - (int) strlen(counter_desc[type]), counter_desc[type], - DHCP_COUNTER_WIDTH, counters[DHCP_RX][DHCP_MESSAGE_TYPE_DISCOVER], - DHCP_COUNTER_WIDTH, counters[DHCP_TX][DHCP_MESSAGE_TYPE_DISCOVER], - DHCP_COUNTER_WIDTH, counters[DHCP_RX][DHCP_MESSAGE_TYPE_OFFER], - DHCP_COUNTER_WIDTH, counters[DHCP_TX][DHCP_MESSAGE_TYPE_OFFER], - DHCP_COUNTER_WIDTH, counters[DHCP_RX][DHCP_MESSAGE_TYPE_REQUEST], - DHCP_COUNTER_WIDTH, counters[DHCP_TX][DHCP_MESSAGE_TYPE_REQUEST], - DHCP_COUNTER_WIDTH, counters[DHCP_RX][DHCP_MESSAGE_TYPE_ACK], - DHCP_COUNTER_WIDTH, counters[DHCP_TX][DHCP_MESSAGE_TYPE_ACK] - ); -} - -/** - * @code init_socket(context, intf); - * - * @brief initializes socket, bind it to interface and bpf program, and - * associate with libevent base - * - * @param context pointer to device (interface) context - * @param intf interface name - * - * @return 0 on success, otherwise for failure - */ -static int init_socket(dhcp_device_context_t *context, const char *intf) -{ - int rv = -1; - - do { - context->sock = socket(AF_PACKET, SOCK_RAW | SOCK_NONBLOCK, htons(ETH_P_ALL)); - if (context->sock < 0) { - syslog(LOG_ALERT, "socket: failed to open socket with '%s'\n", strerror(errno)); - break; - } - - struct sockaddr_ll addr; - memset(&addr, 0, sizeof(addr)); - addr.sll_ifindex = if_nametoindex(intf); - addr.sll_family = AF_PACKET; - addr.sll_protocol = htons(ETH_P_ALL); - if (bind(context->sock, (struct sockaddr *) &addr, sizeof(addr))) { - syslog(LOG_ALERT, "bind: failed to bind to interface '%s' with '%s'\n", intf, strerror(errno)); - break; - } - - strncpy(context->intf, intf, sizeof(context->intf) - 1); - context->intf[sizeof(context->intf) - 1] = '\0'; - - rv = 0; - } while (0); - - return rv; -} - -/** - * @code initialize_intf_mac_and_ip_addr(context); - * - * @brief initializes device (interface) mac/ip addresses - * - * @param context pointer to device (interface) context - * - * @return 0 on success, otherwise for failure - */ -static int initialize_intf_mac_and_ip_addr(dhcp_device_context_t *context) -{ - int rv = -1; - - do { - int fd; - struct ifreq ifr; - if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) == -1) { - syslog(LOG_ALERT, "socket: %s", strerror(errno)); - break; - } - - ifr.ifr_addr.sa_family = AF_INET; - strncpy(ifr.ifr_name, context->intf, sizeof(ifr.ifr_name) - 1); - ifr.ifr_name[sizeof(ifr.ifr_name) - 1] = '\0'; - - // Get network address - if (ioctl(fd, SIOCGIFADDR, &ifr) == -1) { - syslog(LOG_ALERT, "ioctl: %s", explain_ioctl(fd, SIOCGIFADDR, &ifr)); - break; - } - context->ip = ((struct sockaddr_in*) &ifr.ifr_addr)->sin_addr.s_addr; - - // Get mac address - if (ioctl(fd, SIOCGIFHWADDR, &ifr) == -1) { - syslog(LOG_ALERT, "ioctl: %s", explain_ioctl(fd, SIOCGIFHWADDR, &ifr)); - break; - } - memcpy(context->mac, ifr.ifr_hwaddr.sa_data, sizeof(context->mac)); - - close(fd); - - rv = 0; - } while (0); - - return rv; -} - -/** - * @code dhcp_device_get_ip(context); - * - * @brief Accessor method - * - * @param context pointer to device (interface) context - * - * @return interface IP - */ -int dhcp_device_get_ip(dhcp_device_context_t *context, in_addr_t *ip) -{ - int rv = -1; - - if (context != NULL && ip != NULL) { - *ip = context->ip; - rv = 0; - } - - return rv; -} - -/** - * @code dhcp_device_get_aggregate_context(); - * - * @brief Accessor method - * - * @return pointer to aggregate device (interface) context - */ -dhcp_device_context_t* dhcp_device_get_aggregate_context() -{ - return &aggregate_dev; -} - -/** - * @code dhcp_device_init(context, intf, is_uplink); - * - * @brief initializes device (interface) that handles packet capture per interface. - */ -int dhcp_device_init(dhcp_device_context_t **context, const char *intf, uint8_t is_uplink) -{ - int rv = -1; - dhcp_device_context_t *dev_context = NULL; - - if ((context != NULL) && (strlen(intf) < sizeof(dev_context->intf))) { - - dev_context = (dhcp_device_context_t *) malloc(sizeof(dhcp_device_context_t)); - if (dev_context != NULL) { - if ((init_socket(dev_context, intf) == 0) && - (initialize_intf_mac_and_ip_addr(dev_context) == 0)) { - - dev_context->is_uplink = is_uplink; - - memset(dev_context->counters, 0, sizeof(dev_context->counters)); - - *context = dev_context; - rv = 0; - } - } - else { - syslog(LOG_ALERT, "malloc: failed to allocated device context memory for '%s'", dev_context->intf); - } - } - - return rv; -} - -/** - * @code dhcp_device_start_capture(context, snaplen, base, vlan_ip); - * - * @brief starts packet capture on this interface - */ -int dhcp_device_start_capture(dhcp_device_context_t *context, - size_t snaplen, - struct event_base *base, - in_addr_t vlan_ip) -{ - int rv = -1; - - do { - if (context == NULL) { - syslog(LOG_ALERT, "NULL interface context pointer'\n"); - break; - } - - if (snaplen < UDP_START_OFFSET + sizeof(struct udphdr) + DHCP_OPTIONS_HEADER_SIZE) { - syslog(LOG_ALERT, "dhcp_device_start_capture(%s): snap length is too low to capture DHCP options", context->intf); - break; - } - - context->vlan_ip = vlan_ip; - - context->buffer = (uint8_t *) malloc(snaplen); - if (context->buffer == NULL) { - syslog(LOG_ALERT, "malloc: failed to allocate memory for socket buffer '%s'\n", strerror(errno)); - break; - } - context->snaplen = snaplen; - - if (setsockopt(context->sock, SOL_SOCKET, SO_ATTACH_FILTER, &dhcp_sock_bfp, sizeof(dhcp_sock_bfp)) != 0) { - syslog(LOG_ALERT, "setsockopt: failed to attach filter with '%s'\n", strerror(errno)); - break; - } - - struct event *ev = event_new(base, context->sock, EV_READ | EV_PERSIST, read_callback, context); - if (ev == NULL) { - syslog(LOG_ALERT, "event_new: failed to allocate memory for libevent event '%s'\n", strerror(errno)); - break; - } - event_add(ev, NULL); - - rv = 0; - } while (0); - - return rv; -} - -/** - * @code dhcp_device_shutdown(context); - * - * @brief shuts down device (interface). Also, stops packet capture on interface and cleans up any allocated memory - */ -void dhcp_device_shutdown(dhcp_device_context_t *context) -{ - free(context); -} - -/** - * @code dhcp_device_get_status(check_type, context); - * - * @brief collects DHCP relay status info for a given interface. If context is null, it will report aggregate - * status - */ -dhcp_mon_status_t dhcp_device_get_status(dhcp_mon_check_t check_type, dhcp_device_context_t *context) -{ - dhcp_mon_status_t rv = DHCP_MON_STATUS_HEALTHY; - - if (context != NULL) { - rv = dhcp_device_check_health(check_type, context->counters); - } - - return rv; -} - -/** - * @code dhcp_device_update_snapshot(context); - * - * @brief Update device/interface counters snapshot - */ -void dhcp_device_update_snapshot(dhcp_device_context_t *context) -{ - if (context != NULL) { - memcpy(context->counters[DHCP_COUNTERS_SNAPSHOT], - context->counters[DHCP_COUNTERS_CURRENT], - sizeof(context->counters[DHCP_COUNTERS_SNAPSHOT])); - } -} - -/** - * @code dhcp_device_print_status(context, type); - * - * @brief prints status counters to syslog. - */ -void dhcp_device_print_status(dhcp_device_context_t *context, dhcp_counters_type_t type) -{ - if (context != NULL) { - dhcp_print_counters(context->intf, type, context->counters[type]); - } -} diff --git a/src/dhcpmon/src/dhcp_device.cpp b/src/dhcpmon/src/dhcp_device.cpp new file mode 100644 index 000000000000..12c0e1544903 --- /dev/null +++ b/src/dhcpmon/src/dhcp_device.cpp @@ -0,0 +1,869 @@ +/** + * @file dhcp_device.c + * + * device (interface) module + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "subscriberstatetable.h" +#include "select.h" + +#include "dhcp_devman.h" +#include "dhcp_device.h" + +/** Counter print width */ +#define DHCP_COUNTER_WIDTH 9 + +/** Start of Ether header of a captured frame */ +#define ETHER_START_OFFSET 0 +/** Start of IP header of a captured frame */ +#define IP_START_OFFSET (ETHER_START_OFFSET + ETHER_HDR_LEN) +/** Start of UDP header of a captured frame */ +#define UDP_START_OFFSET (IP_START_OFFSET + sizeof(struct ip)) +/** Start of DHCP header of a captured frame */ +#define DHCP_START_OFFSET (UDP_START_OFFSET + sizeof(struct udphdr)) +/** Start of DHCP Options segment of a captured frame */ +#define DHCP_OPTIONS_HEADER_SIZE 240 +/** Offset of DHCP GIADDR */ +#define DHCP_GIADDR_OFFSET 24 +#define CLIENT_IF_PREFIX "Ethernet" + +#define OP_LDHA (BPF_LD | BPF_H | BPF_ABS) /** bpf ldh Abs */ +#define OP_LDHI (BPF_LD | BPF_H | BPF_IND) /** bpf ldh Ind */ +#define OP_LDB (BPF_LD | BPF_B | BPF_ABS) /** bpf ldb Abs*/ +#define OP_JEQ (BPF_JMP | BPF_JEQ | BPF_K) /** bpf jeq */ +#define OP_JGT (BPF_JMP | BPF_JGT | BPF_K) /** bpf jgt */ +#define OP_RET (BPF_RET | BPF_K) /** bpf ret */ +#define OP_JSET (BPF_JMP | BPF_JSET | BPF_K) /** bpf jset */ +#define OP_LDXB (BPF_LDX | BPF_B | BPF_MSH) /** bpf ldxb */ + +std::shared_ptr mConfigDbPtr = std::make_shared ("CONFIG_DB", 0); +std::shared_ptr mStateDbPtr = std::make_shared ("STATE_DB", 0); +std::shared_ptr mStateDbMuxTablePtr = std::make_shared ( + mStateDbPtr.get(), "HW_MUX_CABLE_TABLE" + ); + +/* interface to vlan mapping */ +std::unordered_map vlan_map; + +/* interface to port-channel mapping */ +std::unordered_map portchan_map; + +/* interface to mgmt port mapping */ +std::unordered_map mgmt_map; + +/** Berkeley Packet Filter program for "udp and (port 67 or port 68)". + * This program is obtained using the following command tcpdump: + * `tcpdump -dd "outbound and udp and (port 67 or port 68)"` + */ +static struct sock_filter dhcp_outbound_bpf_code[] = { + {.code = OP_LDHA, .jt = 0, .jf = 0, .k = 0xfffff004}, // (000) ldh #fffff004 + {.code = OP_JEQ, .jt = 0, .jf = 22, .k = 0x00000004}, // (001) jeq #0x04 jt 0 jf 22 + {.code = OP_LDHA, .jt = 0, .jf = 0, .k = 0x0000000c}, // (002) ldh [12] + {.code = OP_JEQ, .jt = 0, .jf = 7, .k = 0x000086dd}, // (003) jeq #0x86dd jt 2 jf 9 + {.code = OP_LDB, .jt = 0, .jf = 0, .k = 0x00000014}, // (004) ldb [20] + {.code = OP_JEQ, .jt = 0, .jf = 18, .k = 0x00000011}, // (005) jeq #0x11 jt 4 jf 22 + {.code = OP_LDHA, .jt = 0, .jf = 0, .k = 0x00000036}, // (006) ldh [54] + {.code = OP_JEQ, .jt = 15, .jf = 0, .k = 0x00000043}, // (007) jeq #0x43 jt 21 jf 6 + {.code = OP_JEQ, .jt = 14, .jf = 0, .k = 0x00000044}, // (008) jeq #0x44 jt 21 jf 7 + {.code = OP_LDHA, .jt = 0, .jf = 0, .k = 0x00000038}, // (009) ldh [56] + {.code = OP_JEQ, .jt = 12, .jf = 11, .k = 0x00000043}, // (010) jeq #0x43 jt 21 jf 20 + {.code = OP_JEQ, .jt = 0, .jf = 12, .k = 0x00000800}, // (011) jeq #0x800 jt 10 jf 22 + {.code = OP_LDB, .jt = 0, .jf = 0, .k = 0x00000017}, // (012) ldb [23] + {.code = OP_JEQ, .jt = 0, .jf = 10, .k = 0x00000011}, // (013) jeq #0x11 jt 12 jf 22 + {.code = OP_LDHA, .jt = 0, .jf = 0, .k = 0x00000014}, // (014) ldh [20] + {.code = OP_JSET, .jt = 8, .jf = 0, .k = 0x00001fff}, // (015) jset #0x1fff jt 22 jf 14 + {.code = OP_LDXB, .jt = 0, .jf = 0, .k = 0x0000000e}, // (016) ldxb 4*([14]&0xf) + {.code = OP_LDHI, .jt = 0, .jf = 0, .k = 0x0000000e}, // (017) ldh [x + 14] + {.code = OP_JEQ, .jt = 4, .jf = 0, .k = 0x00000043}, // (018) jeq #0x43 jt 21 jf 17 + {.code = OP_JEQ, .jt = 3, .jf = 0, .k = 0x00000044}, // (019) jeq #0x44 jt 21 jf 18 + {.code = OP_LDHI, .jt = 0, .jf = 0, .k = 0x00000010}, // (020) ldh [x + 16] + {.code = OP_JEQ, .jt = 1, .jf = 0, .k = 0x00000043}, // (021) jeq #0x43 jt 21 jf 20 + {.code = OP_JEQ, .jt = 0, .jf = 1, .k = 0x00000044}, // (022) jeq #0x44 jt 21 jf 22 + {.code = OP_RET, .jt = 0, .jf = 0, .k = 0x00040000}, // (023) ret #262144 + {.code = OP_RET, .jt = 0, .jf = 0, .k = 0x00000000}, // (024) ret #0 +}; + +/** Berkeley Packet Filter program for "udp and (port 67 or port 68)". + * This program is obtained using the following command tcpdump: + * `tcpdump -dd "inbound and udp and (port 67 or port 68)"` + */ +static struct sock_filter dhcp_inbound_bpf_code[] = { + {.code = OP_LDHA, .jt = 0, .jf = 0, .k = 0xfffff004}, // (000) ldh #fffff004 + {.code = OP_JEQ, .jt = 22, .jf = 0, .k = 0x00000004}, // (001) jeq #0x04 jt 22 jf 0 + {.code = OP_LDHA, .jt = 0, .jf = 0, .k = 0x0000000c}, // (002) ldh [12] + {.code = OP_JEQ, .jt = 0, .jf = 7, .k = 0x000086dd}, // (003) jeq #0x86dd jt 2 jf 9 + {.code = OP_LDB, .jt = 0, .jf = 0, .k = 0x00000014}, // (004) ldb [20] + {.code = OP_JEQ, .jt = 0, .jf = 18, .k = 0x00000011}, // (005) jeq #0x11 jt 4 jf 22 + {.code = OP_LDHA, .jt = 0, .jf = 0, .k = 0x00000036}, // (006) ldh [54] + {.code = OP_JEQ, .jt = 15, .jf = 0, .k = 0x00000043}, // (007) jeq #0x43 jt 21 jf 6 + {.code = OP_JEQ, .jt = 14, .jf = 0, .k = 0x00000044}, // (008) jeq #0x44 jt 21 jf 7 + {.code = OP_LDHA, .jt = 0, .jf = 0, .k = 0x00000038}, // (009) ldh [56] + {.code = OP_JEQ, .jt = 12, .jf = 11, .k = 0x00000043}, // (010) jeq #0x43 jt 21 jf 20 + {.code = OP_JEQ, .jt = 0, .jf = 12, .k = 0x00000800}, // (011) jeq #0x800 jt 10 jf 22 + {.code = OP_LDB, .jt = 0, .jf = 0, .k = 0x00000017}, // (012) ldb [23] + {.code = OP_JEQ, .jt = 0, .jf = 10, .k = 0x00000011}, // (013) jeq #0x11 jt 12 jf 22 + {.code = OP_LDHA, .jt = 0, .jf = 0, .k = 0x00000014}, // (014) ldh [20] + {.code = OP_JSET, .jt = 8, .jf = 0, .k = 0x00001fff}, // (015) jset #0x1fff jt 22 jf 14 + {.code = OP_LDXB, .jt = 0, .jf = 0, .k = 0x0000000e}, // (016) ldxb 4*([14]&0xf) + {.code = OP_LDHI, .jt = 0, .jf = 0, .k = 0x0000000e}, // (017) ldh [x + 14] + {.code = OP_JEQ, .jt = 4, .jf = 0, .k = 0x00000043}, // (018) jeq #0x43 jt 21 jf 17 + {.code = OP_JEQ, .jt = 3, .jf = 0, .k = 0x00000044}, // (019) jeq #0x44 jt 21 jf 18 + {.code = OP_LDHI, .jt = 0, .jf = 0, .k = 0x00000010}, // (020) ldh [x + 16] + {.code = OP_JEQ, .jt = 1, .jf = 0, .k = 0x00000043}, // (021) jeq #0x43 jt 21 jf 20 + {.code = OP_JEQ, .jt = 0, .jf = 1, .k = 0x00000044}, // (022) jeq #0x44 jt 21 jf 22 + {.code = OP_RET, .jt = 0, .jf = 0, .k = 0x00040000}, // (023) ret #262144 + {.code = OP_RET, .jt = 0, .jf = 0, .k = 0x00000000}, // (024) ret #0 +}; + +/** Filter program socket struct */ +static struct sock_fprog dhcp_outbound_sock_bfp = { + .len = sizeof(dhcp_outbound_bpf_code) / sizeof(*dhcp_outbound_bpf_code), .filter = dhcp_outbound_bpf_code +}; +static struct sock_fprog dhcp_inbound_sock_bfp = { + .len = sizeof(dhcp_inbound_bpf_code) / sizeof(*dhcp_inbound_bpf_code), .filter = dhcp_inbound_bpf_code +}; + +static uint8_t *rx_recv_buffer = NULL; +static uint8_t *tx_recv_buffer = NULL; +static uint32_t snap_length; + +/** Aggregate device of DHCP interfaces. It contains aggregate counters from + all interfaces + */ +static dhcp_device_context_t aggregate_dev = {0}; + +/** Monitored DHCP message type */ +static dhcp_message_type_t monitored_msgs[] = { + DHCP_MESSAGE_TYPE_DISCOVER, + DHCP_MESSAGE_TYPE_OFFER, + DHCP_MESSAGE_TYPE_REQUEST, + DHCP_MESSAGE_TYPE_ACK +}; + +/** update ethernet interface to vlan map + * VLAN_MEMBER|Vlan1000|Ethernet48 + */ +void update_vlan_mapping(std::shared_ptr db_conn) { + auto match_pattern = std::string("VLAN_MEMBER|*"); + auto keys = db_conn->keys(match_pattern); + for (auto &itr : keys) { + auto first = itr.find_first_of('|'); + auto second = itr.find_last_of('|'); + auto vlan = itr.substr(first + 1, second - first - 1); + auto interface = itr.substr(second + 1); + vlan_map[interface] = vlan; + syslog(LOG_INFO, "add <%s, %s> into interface vlan map\n", interface.c_str(), vlan.c_str()); + } +} + +/** update ethernet interface to port-channel map + * PORTCHANNEL_MEMBER|PortChannel101|Ethernet112 + */ +void update_portchannel_mapping(std::shared_ptr db_conn) { + auto match_pattern = std::string("PORTCHANNEL_MEMBER|*"); + auto keys = db_conn->keys(match_pattern); + for (auto &itr : keys) { + auto first = itr.find_first_of('|'); + auto second = itr.find_last_of('|'); + auto portchannel = itr.substr(first + 1, second - first - 1); + auto interface = itr.substr(second + 1); + portchan_map[interface] = portchannel; + syslog(LOG_INFO, "add <%s, %s> into interface port-channel map\n", interface.c_str(), portchannel.c_str()); + } +} + +/** update interface to mgmt map + */ +void update_mgmt_mapping() { + auto mgmt = dhcp_devman_get_mgmt_dev(); + if (mgmt) { + auto name = std::string(mgmt->intf); + mgmt_map[name] = name; + } +} + +dhcp_device_context_t *find_device_context(std::unordered_map *intfs, std::string if_name) { + auto intf = intfs->find(if_name); + if (intf == intfs->end()) { + return NULL; + } + return intf->second->dev_context; +} + +/** Number of monitored DHCP message type */ +static uint8_t monitored_msg_sz = sizeof(monitored_msgs) / sizeof(*monitored_msgs); + +/** + * @code handle_dhcp_option_53(context, dhcp_option, dir, iphdr, dhcphdr); + * + * @brief handle the logic related to DHCP option 53 + * + * @param context Device (interface) context + * @param dhcp_option pointer to DHCP option buffer space + * @param dir packet direction + * @param iphdr pointer to packet IP header + * @param dhcphdr pointer to DHCP header + * + * @return none + */ +static void handle_dhcp_option_53(dhcp_device_context_t *context, + const u_char *dhcp_option, + dhcp_packet_direction_t dir, + struct ip *iphdr, + uint8_t *dhcphdr) +{ + in_addr_t giaddr; + switch (dhcp_option[2]) + { + // DHCP messages send by client + case DHCP_MESSAGE_TYPE_DISCOVER: + case DHCP_MESSAGE_TYPE_REQUEST: + case DHCP_MESSAGE_TYPE_DECLINE: + case DHCP_MESSAGE_TYPE_RELEASE: + case DHCP_MESSAGE_TYPE_INFORM: + giaddr = ntohl(dhcphdr[DHCP_GIADDR_OFFSET] << 24 | dhcphdr[DHCP_GIADDR_OFFSET + 1] << 16 | + dhcphdr[DHCP_GIADDR_OFFSET + 2] << 8 | dhcphdr[DHCP_GIADDR_OFFSET + 3]); + if ((context->giaddr_ip == giaddr && context->is_uplink && dir == DHCP_TX) || + (!context->is_uplink && dir == DHCP_RX && iphdr->ip_dst.s_addr == INADDR_BROADCAST)) { + context->counters[DHCP_COUNTERS_CURRENT][dir][dhcp_option[2]]++; + aggregate_dev.counters[DHCP_COUNTERS_CURRENT][dir][dhcp_option[2]]++; + } + break; + // DHCP messages send by server + case DHCP_MESSAGE_TYPE_OFFER: + case DHCP_MESSAGE_TYPE_ACK: + case DHCP_MESSAGE_TYPE_NAK: + if ((context->giaddr_ip == iphdr->ip_dst.s_addr && context->is_uplink && dir == DHCP_RX) || + (!context->is_uplink && dir == DHCP_TX)) { + context->counters[DHCP_COUNTERS_CURRENT][dir][dhcp_option[2]]++; + aggregate_dev.counters[DHCP_COUNTERS_CURRENT][dir][dhcp_option[2]]++; + } + break; + default: + syslog(LOG_WARNING, "handle_dhcp_option_53(%s): Unknown DHCP option 53 type %d", context->intf, dhcp_option[2]); + break; + } +} + +/** + * @code client_packet_handler(dhcp_device_context_t *context, ssize_t buffer_sz); + * + * @brief packet handler to process received rx and tx packets + * + * @param context pointer to device (interface) context + * @param buffer_sz buffer that stores received packet data + * + * @return none + */ +static void client_packet_handler(dhcp_device_context_t *context, uint8_t *buffer, + ssize_t buffer_sz, dhcp_packet_direction_t dir) +{ + struct ip *iphdr = (struct ip*) (buffer + IP_START_OFFSET); + struct udphdr *udp = (struct udphdr*) (buffer + UDP_START_OFFSET); + uint8_t *dhcphdr = buffer + DHCP_START_OFFSET; + int dhcp_option_offset = DHCP_START_OFFSET + DHCP_OPTIONS_HEADER_SIZE; + + if (((unsigned)buffer_sz > UDP_START_OFFSET + sizeof(struct udphdr) + DHCP_OPTIONS_HEADER_SIZE) && + (ntohs(udp->len) > DHCP_OPTIONS_HEADER_SIZE)) + { + int dhcp_sz = ntohs(udp->len) < buffer_sz - UDP_START_OFFSET - sizeof(struct udphdr) ? + ntohs(udp->len) : buffer_sz - UDP_START_OFFSET - sizeof(struct udphdr); + int dhcp_option_sz = dhcp_sz - DHCP_OPTIONS_HEADER_SIZE; + const u_char *dhcp_option = buffer + dhcp_option_offset; + + int offset = 0; + while ((offset < (dhcp_option_sz + 1)) && dhcp_option[offset] != 255) { + if (dhcp_option[offset] == OPTION_DHCP_MESSAGE_TYPE) { + if (offset < (dhcp_option_sz + 2)) { + handle_dhcp_option_53(context, &dhcp_option[offset], dir, iphdr, dhcphdr); + } + break; // break while loop since we are only interested in Option 53 + } + + if (dhcp_option[offset] == 0) { // DHCP Option Padding + offset++; + } else { + offset += dhcp_option[offset + 1] + 2; + } + } + } else { + syslog(LOG_WARNING, "read_callback(%s %s): read length (%ld) is too small to capture DHCP options", + context->intf, dir == DHCP_TX ? "TX" : "RX", buffer_sz); + } +} + +static dhcp_device_context_t *interface_to_dev_context(std::unordered_map *devices, + std::string ifname) +{ + auto vlan = vlan_map.find(ifname); + if (vlan != vlan_map.end()) { + if (dual_tor_sock) { + std::string state; + mStateDbMuxTablePtr->hget(ifname, "state", state); + if (state == "standby") { + return NULL; + } + } + return find_device_context(devices, vlan->second); + } else { + auto port_channel = portchan_map.find(ifname); + if (port_channel != portchan_map.end()) { + return find_device_context(devices, port_channel->second); + } + else { + // mgmt interface check + auto mgmt = mgmt_map.find(ifname); + if (mgmt != mgmt_map.end()) { + return find_device_context(devices, mgmt->second); + } + } + } + return NULL; +} + + +/** + * @code read_tx_callback(fd, event, arg); + * + * @brief callback for libevent which is called every time out in order to read queued outgoing packet capture + * + * @param fd socket to read from + * @param event libevent triggered event + * @param arg user provided argument for callback (interface context) + * + * @return none + */ +static void read_tx_callback(int fd, short event, void *arg) +{ + auto devices = (std::unordered_map *)arg; + ssize_t buffer_sz; + struct sockaddr_ll sll; + socklen_t slen = sizeof sll; + dhcp_device_context_t *context = NULL; + + while ((buffer_sz = recvfrom(fd, tx_recv_buffer, snap_length, MSG_DONTWAIT, (struct sockaddr *)&sll, &slen)) > 0) + { + char interfaceName[IF_NAMESIZE]; + if (if_indextoname(sll.sll_ifindex, interfaceName) == NULL) { + syslog(LOG_WARNING, "invalid output interface index %d\n", sll.sll_ifindex); + continue; + } + std::string intf(interfaceName); + context = find_device_context(devices, intf); + if (context) { + client_packet_handler(context, tx_recv_buffer, buffer_sz, DHCP_TX); + } + } +} + +/** + * @code read_rx_callback(fd, event, arg); + * + * @brief callback for libevent which is called every time out in order to read queued incoming packet capture + * + * @param fd socket to read from + * @param event libevent triggered event + * @param arg user provided argument for callback (interface context) + * + * @return none + */ +static void read_rx_callback(int fd, short event, void *arg) +{ + auto devices = (std::unordered_map *)arg; + ssize_t buffer_sz; + struct sockaddr_ll sll; + socklen_t slen = sizeof(sll); + dhcp_device_context_t *context = NULL; + + while ((buffer_sz = recvfrom(fd, rx_recv_buffer, snap_length, MSG_DONTWAIT, (struct sockaddr *)&sll, &slen)) > 0) + { + char interfaceName[IF_NAMESIZE]; + if (if_indextoname(sll.sll_ifindex, interfaceName) == NULL) { + syslog(LOG_WARNING, "invalid input interface index %d\n", sll.sll_ifindex); + continue; + } + std::string intf(interfaceName); + context = interface_to_dev_context(devices, intf); + if (context) { + client_packet_handler(context, rx_recv_buffer, buffer_sz, DHCP_RX); + } + } +} + +/** + * @code dhcp_device_is_dhcp_inactive(counters); + * + * @brief Check if there were no DHCP activity + * + * @param counters current/snapshot counter + * + * @return true if there were no DHCP activity, false otherwise + */ +static bool dhcp_device_is_dhcp_inactive(uint64_t counters[][DHCP_DIR_COUNT][DHCP_MESSAGE_TYPE_COUNT]) +{ + uint64_t *rx_counters = counters[DHCP_COUNTERS_CURRENT][DHCP_RX]; + uint64_t *rx_counter_snapshot = counters[DHCP_COUNTERS_SNAPSHOT][DHCP_RX]; + + bool rv = true; + for (uint8_t i = 0; (i < monitored_msg_sz) && rv; i++) { + rv = rx_counters[monitored_msgs[i]] == rx_counter_snapshot[monitored_msgs[i]]; + } + + return rv; +} + +/** + * @code dhcp_device_is_dhcp_msg_unhealthy(type, counters); + * + * @brief Check if DHCP relay is functioning properly for message of type 'type'. + * For every rx of message 'type', there should be increment of the same message type. + * + * @param type DHCP message type + * @param counters current/snapshot counter + * + * @return true if DHCP message 'type' is transmitted,false otherwise + */ +static bool dhcp_device_is_dhcp_msg_unhealthy(dhcp_message_type_t type, + uint64_t counters[][DHCP_DIR_COUNT][DHCP_MESSAGE_TYPE_COUNT]) +{ + // check if DHCP message 'type' is being relayed + return ((counters[DHCP_COUNTERS_CURRENT][DHCP_RX][type] > counters[DHCP_COUNTERS_SNAPSHOT][DHCP_RX][type]) && + (counters[DHCP_COUNTERS_CURRENT][DHCP_TX][type] <= counters[DHCP_COUNTERS_SNAPSHOT][DHCP_TX][type]) ); +} + +/** + * @code dhcp_device_check_positive_health(counters, counters_snapshot); + * + * @brief Check if DHCP relay is functioning properly for monitored messages (Discover, Offer, Request, ACK.) + * For every rx of monitored messages, there should be increment of the same message type. + * + * @param counters current/snapshot counter + * + * @return DHCP_MON_STATUS_HEALTHY, DHCP_MON_STATUS_UNHEALTHY, or DHCP_MON_STATUS_INDETERMINATE + */ +static dhcp_mon_status_t dhcp_device_check_positive_health(uint64_t counters[][DHCP_DIR_COUNT][DHCP_MESSAGE_TYPE_COUNT]) +{ + dhcp_mon_status_t rv = DHCP_MON_STATUS_HEALTHY; + + bool is_dhcp_unhealthy = false; + for (uint8_t i = 0; (i < monitored_msg_sz) && !is_dhcp_unhealthy; i++) { + is_dhcp_unhealthy = dhcp_device_is_dhcp_msg_unhealthy(monitored_msgs[i], counters); + } + + // if we have rx DORA then we should have corresponding tx DORA (DORA being relayed) + if (is_dhcp_unhealthy) { + rv = DHCP_MON_STATUS_UNHEALTHY; + } + + return rv; +} + +/** + * @code dhcp_device_check_negative_health(counters); + * + * @brief Check that DHCP relayed messages are not being transmitted out of this interface/dev + * using its counters. The interface is negatively healthy if there are not DHCP message + * travelling through it. + * + * @param counters recent interface counter + * @param counters_snapshot snapshot counters + * + * @return DHCP_MON_STATUS_HEALTHY, DHCP_MON_STATUS_UNHEALTHY, or DHCP_MON_STATUS_INDETERMINATE + */ +static dhcp_mon_status_t dhcp_device_check_negative_health(uint64_t counters[][DHCP_DIR_COUNT][DHCP_MESSAGE_TYPE_COUNT]) +{ + dhcp_mon_status_t rv = DHCP_MON_STATUS_HEALTHY; + + uint64_t *tx_counters = counters[DHCP_COUNTERS_CURRENT][DHCP_TX]; + uint64_t *tx_counter_snapshot = counters[DHCP_COUNTERS_SNAPSHOT][DHCP_TX]; + + bool is_dhcp_unhealthy = false; + for (uint8_t i = 0; (i < monitored_msg_sz) && !is_dhcp_unhealthy; i++) { + is_dhcp_unhealthy = tx_counters[monitored_msgs[i]] > tx_counter_snapshot[monitored_msgs[i]]; + } + + // for negative validation, return unhealthy if DHCP packet are being + // transmitted out of the device/interface + if (is_dhcp_unhealthy) { + rv = DHCP_MON_STATUS_UNHEALTHY; + } + + return rv; +} + +/** + * @code dhcp_device_check_health(check_type, counters, counters_snapshot); + * + * @brief Check that DHCP relay is functioning properly given a check type. Positive check + * indicates for every rx of DHCP message of type 'type', there would increment of + * the corresponding TX of the same message type. While negative check indicates the + * device should not be actively transmitting any DHCP messages. If it does, it is + * considered unhealthy. + * + * @param check_type type of health check + * @param counters current/snapshot counter + * + * @return DHCP_MON_STATUS_HEALTHY, DHCP_MON_STATUS_UNHEALTHY, or DHCP_MON_STATUS_INDETERMINATE + */ +static dhcp_mon_status_t dhcp_device_check_health(dhcp_mon_check_t check_type, + uint64_t counters[][DHCP_DIR_COUNT][DHCP_MESSAGE_TYPE_COUNT]) +{ + dhcp_mon_status_t rv = DHCP_MON_STATUS_HEALTHY; + + if (dhcp_device_is_dhcp_inactive(aggregate_dev.counters)) { + rv = DHCP_MON_STATUS_INDETERMINATE; + } else if (check_type == DHCP_MON_CHECK_POSITIVE) { + rv = dhcp_device_check_positive_health(counters); + } else if (check_type == DHCP_MON_CHECK_NEGATIVE) { + rv = dhcp_device_check_negative_health(counters); + } + + return rv; +} + +/** + * @code dhcp_print_counters(vlan_intf, type, counters); + * + * @brief prints DHCP counters to sylsog. + * + * @param vlan_intf vlan interface name + * @param type counter type + * @param counters interface counter + * + * @return none + */ +static void dhcp_print_counters(const char *vlan_intf, + dhcp_counters_type_t type, + uint64_t counters[][DHCP_MESSAGE_TYPE_COUNT]) +{ + static const char *counter_desc[DHCP_COUNTERS_COUNT] = { + [DHCP_COUNTERS_CURRENT] = " Current", + [DHCP_COUNTERS_SNAPSHOT] = "Snapshot" + }; + + syslog( + LOG_NOTICE, + "[%*s-%*s rx/tx] Discover: %*lu/%*lu, Offer: %*lu/%*lu, Request: %*lu/%*lu, ACK: %*lu/%*lu\n", + IF_NAMESIZE, vlan_intf, + (int) strlen(counter_desc[type]), counter_desc[type], + DHCP_COUNTER_WIDTH, counters[DHCP_RX][DHCP_MESSAGE_TYPE_DISCOVER], + DHCP_COUNTER_WIDTH, counters[DHCP_TX][DHCP_MESSAGE_TYPE_DISCOVER], + DHCP_COUNTER_WIDTH, counters[DHCP_RX][DHCP_MESSAGE_TYPE_OFFER], + DHCP_COUNTER_WIDTH, counters[DHCP_TX][DHCP_MESSAGE_TYPE_OFFER], + DHCP_COUNTER_WIDTH, counters[DHCP_RX][DHCP_MESSAGE_TYPE_REQUEST], + DHCP_COUNTER_WIDTH, counters[DHCP_TX][DHCP_MESSAGE_TYPE_REQUEST], + DHCP_COUNTER_WIDTH, counters[DHCP_RX][DHCP_MESSAGE_TYPE_ACK], + DHCP_COUNTER_WIDTH, counters[DHCP_TX][DHCP_MESSAGE_TYPE_ACK] + ); +} + +/** + * @code init_socket(); + * + * @brief initializes rx/tx sockets, bind it to interface and bpf program + * + * @return 0 on success, otherwise for failure + */ +static int init_socket() +{ + int rv = -1; + + do { + auto rx_sock = socket(AF_PACKET, SOCK_RAW | SOCK_NONBLOCK, htons(ETH_P_ALL)); + auto tx_sock = socket(AF_PACKET, SOCK_RAW | SOCK_NONBLOCK, htons(ETH_P_ALL)); + if (rx_sock < 0 || tx_sock < 0) { + syslog(LOG_ALERT, "socket: failed to open socket with '%s'\n", strerror(errno)); + exit(1); + } + + struct sockaddr_ll rx_addr; + memset(&rx_addr, 0, sizeof(rx_addr)); + rx_addr.sll_ifindex = 0; // any interface + rx_addr.sll_family = AF_PACKET; + rx_addr.sll_protocol = htons(ETH_P_ALL); + if (bind(rx_sock, (struct sockaddr *) &rx_addr, sizeof(rx_addr))) { + syslog(LOG_ALERT, "bind: failed to bind to all interface with '%s'\n", strerror(errno)); + break; + } + + struct sockaddr_ll tx_addr; + memset(&tx_addr, 0, sizeof(tx_addr)); + tx_addr.sll_ifindex = 0; // any interface + tx_addr.sll_family = AF_PACKET; + tx_addr.sll_protocol = htons(ETH_P_ALL); + if (bind(tx_sock, (struct sockaddr *) &tx_addr, sizeof(tx_addr))) { + syslog(LOG_ALERT, "bind: failed to bind to interface with '%s'\n", strerror(errno)); + exit(1); + } + + for (auto &itr : intfs) { + itr.second->dev_context->rx_sock = rx_sock; + itr.second->dev_context->tx_sock = tx_sock; + } + rv = 0; + } while (0); + + return rv; +} + +static void init_recv_buffers(int snaplen) +{ + snap_length = snaplen; + rx_recv_buffer = (uint8_t *) malloc(snaplen); + if (rx_recv_buffer == NULL) { + syslog(LOG_ALERT, "malloc: failed to allocate memory for socket rx buffer '%s'\n", strerror(errno)); + exit(1); + } + + tx_recv_buffer = (uint8_t *) malloc(snaplen); + if (tx_recv_buffer == NULL) { + syslog(LOG_ALERT, "malloc: failed to allocate memory for socket tx buffer '%s'\n", strerror(errno)); + exit(1); + } +} + +/** + * @code initialize_intf_mac_and_ip_addr(context); + * + * @brief initializes device (interface) mac/ip addresses + * + * @param context pointer to device (interface) context + * + * @return 0 on success, otherwise for failure + */ +int initialize_intf_mac_and_ip_addr(dhcp_device_context_t *context) +{ + int rv = -1; + + do { + int fd; + struct ifreq ifr; + if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) == -1) { + syslog(LOG_ALERT, "socket: %s", strerror(errno)); + break; + } + + ifr.ifr_addr.sa_family = AF_INET; + strncpy(ifr.ifr_name, context->intf, sizeof(ifr.ifr_name) - 1); + ifr.ifr_name[sizeof(ifr.ifr_name) - 1] = '\0'; + + // Get network address + if (ioctl(fd, SIOCGIFADDR, &ifr) == -1) { + syslog(LOG_ALERT, "ioctl: %s", explain_ioctl(fd, SIOCGIFADDR, &ifr)); + break; + } + context->ip = ((struct sockaddr_in*) &ifr.ifr_addr)->sin_addr.s_addr; + + // Get mac address + if (ioctl(fd, SIOCGIFHWADDR, &ifr) == -1) { + syslog(LOG_ALERT, "ioctl: %s", explain_ioctl(fd, SIOCGIFHWADDR, &ifr)); + break; + } + memcpy(context->mac, ifr.ifr_hwaddr.sa_data, sizeof(context->mac)); + + close(fd); + + rv = 0; + } while (0); + + return rv; +} + +/** + * @code dhcp_device_get_ip(context); + * + * @brief Accessor method + * + * @param context pointer to device (interface) context + * + * @return interface IP + */ +int dhcp_device_get_ip(dhcp_device_context_t *context, in_addr_t *ip) +{ + int rv = -1; + + if (context != NULL && ip != NULL) { + *ip = context->ip; + rv = 0; + } + + return rv; +} + +/** + * @code dhcp_device_get_aggregate_context(); + * + * @brief Accessor method + * + * @return pointer to aggregate device (interface) context + */ +dhcp_device_context_t* dhcp_device_get_aggregate_context() +{ + return &aggregate_dev; +} + +/** + * @code dhcp_device_init(context, intf, is_uplink); + * + * @brief initializes device (interface) that handles packet capture per interface. + */ +int dhcp_device_init(dhcp_device_context_t **context, const char *intf, uint8_t is_uplink) +{ + int rv = -1; + dhcp_device_context_t *dev_context = NULL; + + if ((context != NULL) && (strlen(intf) < sizeof(dev_context->intf))) { + dev_context = (dhcp_device_context_t *) malloc(sizeof(dhcp_device_context_t)); + if (dev_context != NULL) { + // set device name + strncpy(dev_context->intf, intf, sizeof(dev_context->intf) - 1); + dev_context->intf[sizeof(dev_context->intf) - 1] = '\0'; + // set device meta data + if (initialize_intf_mac_and_ip_addr(dev_context) == 0) { + dev_context->is_uplink = is_uplink; + memset(dev_context->counters, 0, sizeof(dev_context->counters)); + *context = dev_context; + rv = 0; + } + } + else { + syslog(LOG_ALERT, "malloc: failed to allocated device context memory for '%s'", dev_context->intf); + } + } + + return rv; +} + +/** + * @code dhcp_device_start_capture(snaplen, base, giaddr_ip); + * + * @brief starts packet capture on this interface + */ +int dhcp_device_start_capture(size_t snaplen, struct event_base *base, in_addr_t giaddr_ip) +{ + int rv = -1; + struct event *rx_ev; + struct event *tx_ev; + int rx_sock = -1, tx_sock = -1; + + do { + if (snaplen < UDP_START_OFFSET + sizeof(struct udphdr) + DHCP_OPTIONS_HEADER_SIZE) { + syslog(LOG_ALERT, "dhcp_device_start_capture: snap length is too low to capture DHCP options"); + exit(1); + } + + init_socket(); + + init_recv_buffers(snaplen); + + update_vlan_mapping(mConfigDbPtr); + update_portchannel_mapping(mConfigDbPtr); + update_mgmt_mapping(); + + for (auto &itr : intfs) { + itr.second->dev_context->snaplen = snaplen; + itr.second->dev_context->giaddr_ip = giaddr_ip; + // all interface dev context has same rx/tx socket + rx_sock = itr.second->dev_context->rx_sock; + tx_sock = itr.second->dev_context->tx_sock; + } + + if (rx_sock == -1 || tx_sock == -1) { + syslog(LOG_ALERT, "dhcp_device_start_capture: invalid rx_sock or tx_sock"); + exit(1); + } + if (setsockopt(rx_sock, SOL_SOCKET, SO_ATTACH_FILTER, &dhcp_inbound_sock_bfp, sizeof(dhcp_inbound_sock_bfp)) != 0) { + syslog(LOG_ALERT, "setsockopt: failed to attach filter with '%s'\n", strerror(errno)); + exit(1); + } + + if (setsockopt(tx_sock, SOL_SOCKET, SO_ATTACH_FILTER, &dhcp_outbound_sock_bfp, sizeof(dhcp_outbound_sock_bfp)) != 0) { + syslog(LOG_ALERT, "setsockopt: failed to attach filter with '%s'\n", strerror(errno)); + exit(1); + } + + rx_ev = event_new(base, rx_sock, EV_READ | EV_PERSIST, read_rx_callback, &intfs); + tx_ev = event_new(base, tx_sock, EV_READ | EV_PERSIST, read_tx_callback, &intfs); + + if (rx_ev == NULL || tx_ev == NULL) { + syslog(LOG_ALERT, "event_new: failed to allocate memory for libevent event '%s'\n", strerror(errno)); + exit(1); + } + event_add(rx_ev, NULL); + event_add(tx_ev, NULL); + + rv = 0; + } while (0); + + return rv; +} + +/** + * @code dhcp_device_shutdown(context); + * + * @brief shuts down device (interface). Also, stops packet capture on interface and cleans up any allocated memory + */ +void dhcp_device_shutdown(dhcp_device_context_t *context) +{ + free(context); +} + +/** + * @code dhcp_device_get_status(check_type, context); + * + * @brief collects DHCP relay status info for a given interface. If context is null, it will report aggregate + * status + */ +dhcp_mon_status_t dhcp_device_get_status(dhcp_mon_check_t check_type, dhcp_device_context_t *context) +{ + dhcp_mon_status_t rv = DHCP_MON_STATUS_HEALTHY; + + if (context != NULL) { + rv = dhcp_device_check_health(check_type, context->counters); + } + + return rv; +} + +/** + * @code dhcp_device_update_snapshot(context); + * + * @brief Update device/interface counters snapshot + */ +void dhcp_device_update_snapshot(dhcp_device_context_t *context) +{ + if (context != NULL) { + memcpy(context->counters[DHCP_COUNTERS_SNAPSHOT], + context->counters[DHCP_COUNTERS_CURRENT], + sizeof(context->counters[DHCP_COUNTERS_SNAPSHOT])); + } +} + +/** + * @code dhcp_device_print_status(context, type); + * + * @brief prints status counters to syslog. + */ +void dhcp_device_print_status(dhcp_device_context_t *context, dhcp_counters_type_t type) +{ + if (context != NULL) { + dhcp_print_counters(context->intf, type, context->counters[type]); + } +} diff --git a/src/dhcpmon/src/dhcp_device.h b/src/dhcpmon/src/dhcp_device.h index 133b9265a434..cd8eab1ee7eb 100644 --- a/src/dhcpmon/src/dhcp_device.h +++ b/src/dhcpmon/src/dhcp_device.h @@ -16,6 +16,8 @@ #include #include +extern bool dual_tor_sock; +extern std::unordered_map intfs; /** * DHCP message types @@ -34,6 +36,11 @@ typedef enum DHCP_MESSAGE_TYPE_COUNT } dhcp_message_type_t; +enum +{ + OPTION_DHCP_MESSAGE_TYPE = 53, +}; + /** packet direction */ typedef enum { @@ -70,18 +77,29 @@ typedef enum /** DHCP device (interface) context */ typedef struct { - int sock; /** Raw socket associated with this device/interface */ + int rx_sock; /** Raw socket associated with this device/interface to count rx packets */ + int tx_sock; /** Raw socket associated with this device/interface to count tx packets*/ in_addr_t ip; /** network address of this device (interface) */ uint8_t mac[ETHER_ADDR_LEN]; /** hardware address of this device (interface) */ - in_addr_t vlan_ip; /** Vlan IP address */ + in_addr_t giaddr_ip; /** Gateway IP address */ uint8_t is_uplink; /** north interface? */ char intf[IF_NAMESIZE]; /** device (interface) name */ - uint8_t *buffer; /** buffer used to read socket data */ size_t snaplen; /** snap length or buffer size */ uint64_t counters[DHCP_COUNTERS_COUNT][DHCP_DIR_COUNT][DHCP_MESSAGE_TYPE_COUNT]; /** current/snapshot counters of DHCP packets */ } dhcp_device_context_t; +/** + * @code initialize_intf_mac_and_ip_addr(context); + * + * @brief initializes device (interface) mac/ip addresses + * + * @param context pointer to device (interface) context + * + * @return 0 on success, otherwise for failure + */ +int initialize_intf_mac_and_ip_addr(dhcp_device_context_t *context); + /** * @code dhcp_device_get_ip(context, ip); * @@ -119,21 +137,17 @@ int dhcp_device_init(dhcp_device_context_t **context, uint8_t is_uplink); /** - * @code dhcp_device_start_capture(context, snaplen, base, vlan_ip); + * @code dhcp_device_start_capture(snaplen, base, giaddr_ip); * * @brief starts packet capture on this interface * - * @param context pointer to device (interface) context * @param snaplen length of packet capture * @param base pointer to libevent base - * @param vlan_ip vlan IP address + * @param giaddr_ip gateway IP address * * @return 0 on success, otherwise for failure */ -int dhcp_device_start_capture(dhcp_device_context_t *context, - size_t snaplen, - struct event_base *base, - in_addr_t vlan_ip); +int dhcp_device_start_capture(size_t snaplen, struct event_base *base, in_addr_t giaddr_ip); /** * @code dhcp_device_shutdown(context); diff --git a/src/dhcpmon/src/dhcp_devman.c b/src/dhcpmon/src/dhcp_devman.c deleted file mode 100644 index 35378a631ca7..000000000000 --- a/src/dhcpmon/src/dhcp_devman.c +++ /dev/null @@ -1,232 +0,0 @@ -/** - * @file dhcp_devman.c - * - * Device (interface) manager - */ -#include -#include -#include -#include -#include -#include - -#include "dhcp_devman.h" - -/** Prefix appended to Aggregation device */ -#define AGG_DEV_PREFIX "Agg-" - -/** struct for interface information */ -struct intf -{ - const char *name; /** interface name */ - uint8_t is_uplink; /** is uplink (north) interface */ - dhcp_device_context_t *dev_context; /** device (interface_ context */ - LIST_ENTRY(intf) entry; /** list link/pointers entries */ -}; - -/** intfs list of interfaces */ -static LIST_HEAD(intf_list, intf) intfs; -/** dhcp_num_south_intf number of south interfaces */ -static uint32_t dhcp_num_south_intf = 0; -/** dhcp_num_north_intf number of north interfaces */ -static uint32_t dhcp_num_north_intf = 0; -/** dhcp_num_mgmt_intf number of mgmt interfaces */ -static uint32_t dhcp_num_mgmt_intf = 0; - -/** On Device vlan interface IP address corresponding vlan downlink IP - * This IP is used to filter Offer/Ack packet coming from DHCP server */ -static in_addr_t vlan_ip = 0; - -/** mgmt interface */ -static struct intf *mgmt_intf = NULL; - -/** - * @code dhcp_devman_get_vlan_intf(); - * - * Accessor method - */ -dhcp_device_context_t* dhcp_devman_get_agg_dev() -{ - return dhcp_device_get_aggregate_context(); -} - -/** - * @code dhcp_devman_get_mgmt_dev(); - * - * Accessor method - */ -dhcp_device_context_t* dhcp_devman_get_mgmt_dev() -{ - return mgmt_intf ? mgmt_intf->dev_context : NULL; -} - -/** - * @code dhcp_devman_init(); - * - * initializes device (interface) manager that keeps track of interfaces and assert that there is one south - * interface and as many north interfaces - */ -void dhcp_devman_init() -{ - LIST_INIT(&intfs); -} - -/** - * @code dhcp_devman_shutdown(); - * - * shuts down device (interface) manager. Also, stops packet capture on interface and cleans up any allocated - * memory - */ -void dhcp_devman_shutdown() -{ - struct intf *int_ptr, *prev_intf = NULL; - - LIST_FOREACH(int_ptr, &intfs, entry) { - dhcp_device_shutdown(int_ptr->dev_context); - if (prev_intf) { - LIST_REMOVE(prev_intf, entry); - free(prev_intf); - prev_intf = int_ptr; - } - } - - if (prev_intf) { - LIST_REMOVE(prev_intf, entry); - free(prev_intf); - } -} - -/** - * @code dhcp_devman_add_intf(name, is_uplink); - * - * @brief adds interface to the device manager. - */ -int dhcp_devman_add_intf(const char *name, char intf_type) -{ - int rv = -1; - struct intf *dev = malloc(sizeof(struct intf)); - - if (dev != NULL) { - dev->name = name; - dev->is_uplink = intf_type != 'd'; - - switch (intf_type) - { - case 'u': - dhcp_num_north_intf++; - break; - case 'd': - dhcp_num_south_intf++; - assert(dhcp_num_south_intf <= 1); - break; - case 'm': - dhcp_num_mgmt_intf++; - assert(dhcp_num_mgmt_intf <= 1); - mgmt_intf = dev; - break; - default: - break; - } - - rv = dhcp_device_init(&dev->dev_context, dev->name, dev->is_uplink); - if (rv == 0 && intf_type == 'd') { - rv = dhcp_device_get_ip(dev->dev_context, &vlan_ip); - - dhcp_device_context_t *agg_dev = dhcp_device_get_aggregate_context(); - - strncpy(agg_dev->intf, AGG_DEV_PREFIX, sizeof(AGG_DEV_PREFIX)); - strncpy(agg_dev->intf + sizeof(AGG_DEV_PREFIX) - 1, name, sizeof(agg_dev->intf) - sizeof(AGG_DEV_PREFIX)); - agg_dev->intf[sizeof(agg_dev->intf) - 1] = '\0'; - } - - LIST_INSERT_HEAD(&intfs, dev, entry); - } - else { - syslog(LOG_ALERT, "malloc: failed to allocate memory for intf '%s'\n", name); - } - - return rv; -} - -/** - * @code dhcp_devman_start_capture(snaplen, base); - * - * @brief start packet capture on the devman interface list - */ -int dhcp_devman_start_capture(size_t snaplen, struct event_base *base) -{ - int rv = -1; - struct intf *int_ptr; - - if ((dhcp_num_south_intf == 1) && (dhcp_num_north_intf >= 1)) { - LIST_FOREACH(int_ptr, &intfs, entry) { - rv = dhcp_device_start_capture(int_ptr->dev_context, snaplen, base, vlan_ip); - if (rv == 0) { - syslog(LOG_INFO, - "Capturing DHCP packets on interface %s, ip: 0x%08x, mac [%02x:%02x:%02x:%02x:%02x:%02x] \n", - int_ptr->name, int_ptr->dev_context->ip, int_ptr->dev_context->mac[0], - int_ptr->dev_context->mac[1], int_ptr->dev_context->mac[2], int_ptr->dev_context->mac[3], - int_ptr->dev_context->mac[4], int_ptr->dev_context->mac[5]); - } - else { - break; - } - } - } - else { - syslog(LOG_ERR, "Invalid number of interfaces, downlink/south %d, uplink/north %d\n", - dhcp_num_south_intf, dhcp_num_north_intf); - } - - return rv; -} - -/** - * @code dhcp_devman_get_status(check_type, context); - * - * @brief collects DHCP relay status info. - */ -dhcp_mon_status_t dhcp_devman_get_status(dhcp_mon_check_t check_type, dhcp_device_context_t *context) -{ - return dhcp_device_get_status(check_type, context); -} - -/** - * @code dhcp_devman_update_snapshot(context); - * - * @brief Update device/interface counters snapshot - */ -void dhcp_devman_update_snapshot(dhcp_device_context_t *context) -{ - if (context == NULL) { - struct intf *int_ptr; - - LIST_FOREACH(int_ptr, &intfs, entry) { - dhcp_device_update_snapshot(int_ptr->dev_context); - } - - dhcp_device_update_snapshot(dhcp_devman_get_agg_dev()); - } else { - dhcp_device_update_snapshot(context); - } -} - -/** - * @code dhcp_devman_print_status(context, type); - * - * @brief prints status counters to syslog, if context is null, it prints status counters for all interfaces - */ -void dhcp_devman_print_status(dhcp_device_context_t *context, dhcp_counters_type_t type) -{ - if (context == NULL) { - struct intf *int_ptr; - - LIST_FOREACH(int_ptr, &intfs, entry) { - dhcp_device_print_status(int_ptr->dev_context, type); - } - - dhcp_device_print_status(dhcp_devman_get_agg_dev(), type); - } else { - dhcp_device_print_status(context, type); - } -} diff --git a/src/dhcpmon/src/dhcp_devman.cpp b/src/dhcpmon/src/dhcp_devman.cpp new file mode 100644 index 000000000000..0fa490d138bd --- /dev/null +++ b/src/dhcpmon/src/dhcp_devman.cpp @@ -0,0 +1,226 @@ +/** + * @file dhcp_devman.c + * + * Device (interface) manager + */ +#include +#include +#include +#include +#include + +#include "dhcp_devman.h" + +/** Prefix appended to Aggregation device */ +#define AGG_DEV_PREFIX "Agg-" + +/** intfs map of interfaces */ +std::unordered_map intfs; +/** dhcp_num_south_intf number of south interfaces */ +static uint32_t dhcp_num_south_intf = 0; +/** dhcp_num_north_intf number of north interfaces */ +static uint32_t dhcp_num_north_intf = 0; +/** dhcp_num_mgmt_intf number of mgmt interfaces */ +static uint32_t dhcp_num_mgmt_intf = 0; + +/** On Device vlan interface IP address corresponding vlan downlink IP + * This IP is used to filter Offer/Ack packet coming from DHCP server */ +static in_addr_t vlan_ip = 0; + +/* Device loopback interface ip, which will be used as the giaddr in dual tor setup. */ +static in_addr_t loopback_ip = 0; + +/* Whether the device is in dual tor mode, 0 as default for single tor mode. */ +static int dual_tor_mode = 0; + +/** mgmt interface */ +static struct intf *mgmt_intf = NULL; + +/** + * @code dhcp_devman_get_vlan_intf(); + * + * Accessor method + */ +dhcp_device_context_t* dhcp_devman_get_agg_dev() +{ + return dhcp_device_get_aggregate_context(); +} + +/** + * @code dhcp_devman_get_mgmt_dev(); + * + * Accessor method + */ +dhcp_device_context_t* dhcp_devman_get_mgmt_dev() +{ + return mgmt_intf ? mgmt_intf->dev_context : NULL; +} + +/** + * @code dhcp_devman_shutdown(); + * + * shuts down device (interface) manager. Also, stops packet capture on interface and cleans up any allocated + * memory + */ +void dhcp_devman_shutdown() +{ + for (auto it = intfs.begin(); it != intfs.end();) { + auto inf = it->second; + dhcp_device_shutdown(inf->dev_context); + it = intfs.erase(it); + free(inf); + } +} + +/** + * @code dhcp_devman_add_intf(name, is_uplink); + * + * @brief adds interface to the device manager. + */ +int dhcp_devman_add_intf(const char *name, char intf_type) +{ + int rv = -1; + struct intf *dev = (struct intf*) malloc(sizeof(struct intf)); + + if (dev != NULL) { + dev->name = name; + dev->is_uplink = intf_type != 'd'; + + switch (intf_type) + { + case 'u': + dhcp_num_north_intf++; + break; + case 'd': + dhcp_num_south_intf++; + assert(dhcp_num_south_intf <= 1); + break; + case 'm': + dhcp_num_mgmt_intf++; + assert(dhcp_num_mgmt_intf <= 1); + mgmt_intf = dev; + break; + default: + break; + } + + rv = dhcp_device_init(&dev->dev_context, dev->name, dev->is_uplink); + if (rv == 0 && intf_type == 'd') { + rv = dhcp_device_get_ip(dev->dev_context, &vlan_ip); + + dhcp_device_context_t *agg_dev = dhcp_device_get_aggregate_context(); + + strncpy(agg_dev->intf, AGG_DEV_PREFIX, strlen(AGG_DEV_PREFIX) + 1); + strncpy(agg_dev->intf + strlen(AGG_DEV_PREFIX), name, sizeof(agg_dev->intf) - strlen(AGG_DEV_PREFIX) - 1); + agg_dev->intf[sizeof(agg_dev->intf) - 1] = '\0'; + syslog(LOG_INFO, "dhcpmon add aggregate interface '%s'\n", agg_dev->intf); + } + std::string if_name; + if_name.assign(dev->name); + intfs[if_name] = dev; + } + else { + syslog(LOG_ALERT, "malloc: failed to allocate memory for intf '%s'\n", name); + } + + return rv; +} + +/** + * @code dhcp_devman_setup_dual_tor_mode(name); + * + * @brief set up dual tor mode: 1) set dual_tor_mode flag and 2) retrieve loopback_ip. + */ +int dhcp_devman_setup_dual_tor_mode(const char *name) +{ + int rv = -1; + + dhcp_device_context_t loopback_intf_context; + + if (strlen(name) < sizeof(loopback_intf_context.intf)) { + strncpy(loopback_intf_context.intf, name, sizeof(loopback_intf_context.intf) - 1); + loopback_intf_context.intf[sizeof(loopback_intf_context.intf) - 1] = '\0'; + } else { + syslog(LOG_ALERT, "loopback interface name (%s) is too long", name); + return rv; + } + + if (initialize_intf_mac_and_ip_addr(&loopback_intf_context) == 0 && + dhcp_device_get_ip(&loopback_intf_context, &loopback_ip) == 0) { + dual_tor_mode = 1; + } else { + syslog(LOG_ALERT, "failed to retrieve ip addr for loopback interface (%s)", name); + return rv; + } + + rv = 0; + return rv; +} + +/** + * @code dhcp_devman_start_capture(snaplen, base); + * + * @brief start packet capture on the devman interface list + */ +int dhcp_devman_start_capture(size_t snaplen, struct event_base *base) +{ + int rv = -1; + + if ((dhcp_num_south_intf == 1) && (dhcp_num_north_intf >= 1)) { + rv = dhcp_device_start_capture(snaplen, base, dual_tor_mode ? loopback_ip : vlan_ip); + if (rv != 0) { + syslog(LOG_ALERT, "Capturing DHCP packets on interface failed"); + exit(1); + } + } + else { + syslog(LOG_ERR, "Invalid number of interfaces, downlink/south %d, uplink/north %d\n", + dhcp_num_south_intf, dhcp_num_north_intf); + } + + return rv; +} + +/** + * @code dhcp_devman_get_status(check_type, context); + * + * @brief collects DHCP relay status info. + */ +dhcp_mon_status_t dhcp_devman_get_status(dhcp_mon_check_t check_type, dhcp_device_context_t *context) +{ + return dhcp_device_get_status(check_type, context); +} + +/** + * @code dhcp_devman_update_snapshot(context); + * + * @brief Update device/interface counters snapshot + */ +void dhcp_devman_update_snapshot(dhcp_device_context_t *context) +{ + if (context == NULL) { + for (auto &itr : intfs) { + dhcp_device_update_snapshot(itr.second->dev_context); + } + dhcp_device_update_snapshot(dhcp_devman_get_agg_dev()); + } else { + dhcp_device_update_snapshot(context); + } +} + +/** + * @code dhcp_devman_print_status(context, type); + * + * @brief prints status counters to syslog, if context is null, it prints status counters for all interfaces + */ +void dhcp_devman_print_status(dhcp_device_context_t *context, dhcp_counters_type_t type) +{ + if (context == NULL) { + for (auto &itr : intfs) { + dhcp_device_print_status(itr.second->dev_context, type); + } + dhcp_device_print_status(dhcp_devman_get_agg_dev(), type); + } else { + dhcp_device_print_status(context, type); + } +} diff --git a/src/dhcpmon/src/dhcp_devman.h b/src/dhcpmon/src/dhcp_devman.h index bba7076902cb..d1c80cf30e9f 100644 --- a/src/dhcpmon/src/dhcp_devman.h +++ b/src/dhcpmon/src/dhcp_devman.h @@ -8,9 +8,19 @@ #define DHCP_DEVMAN_H_ #include +#include +#include #include "dhcp_device.h" +/** struct for interface information */ +struct intf +{ + const char *name; /** interface name */ + uint8_t is_uplink; /** is uplink (north) interface */ + dhcp_device_context_t *dev_context; /** device (interface_ context */ +}; + /** * @code dhcp_devman_init(); * @@ -63,6 +73,17 @@ dhcp_device_context_t* dhcp_devman_get_mgmt_dev(); */ int dhcp_devman_add_intf(const char *name, char intf_type); +/** + * @code dhcp_devman_setup_dual_tor_mode(name); + * + * @brief set up dual tor mode: 1) set dual_tor_mode flag and 2) retrieve loopback_ip. + * + * @param name interface name + * + * @return 0 on success, nonzero otherwise + */ +int dhcp_devman_setup_dual_tor_mode(const char *name); + /** * @code dhcp_devman_start_capture(snaplen, base); * diff --git a/src/dhcpmon/src/dhcp_mon.c b/src/dhcpmon/src/dhcp_mon.c deleted file mode 100644 index 74d9869741d1..000000000000 --- a/src/dhcpmon/src/dhcp_mon.c +++ /dev/null @@ -1,263 +0,0 @@ -/** - * @file dhcp_mon.c - * - * @brief dhcp relay monitor module - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "dhcp_mon.h" -#include "dhcp_devman.h" - -/** DHCP device/interface state */ -typedef struct -{ - dhcp_mon_check_t check_type; /** check type */ - dhcp_device_context_t* (*get_context)(); /** functor to a device context accessor function */ - int count; /** count in the number of unhealthy checks */ - const char *msg; /** message to be printed if unhealthy state is determined */ -} dhcp_mon_state_t; - -/** window_interval_sec monitoring window for dhcp relay health checks */ -static int window_interval_sec = 18; -/** dhcp_unhealthy_max_count max count of consecutive unhealthy statuses before reporting to syslog */ -static int dhcp_unhealthy_max_count = 10; -/** libevent base struct */ -static struct event_base *base; -/** libevent timeout event struct */ -static struct event *ev_timeout = NULL; -/** libevent SIGINT signal event struct */ -static struct event *ev_sigint; -/** libevent SIGTERM signal event struct */ -static struct event *ev_sigterm; -/** libevent SIGUSR1 signal event struct */ -static struct event *ev_sigusr1; - -/** DHCP monitor state data for aggregate device for mgmt device */ -static dhcp_mon_state_t state_data[] = { - [0] = { - .check_type = DHCP_MON_CHECK_POSITIVE, - .get_context = dhcp_devman_get_agg_dev, - .count = 0, - .msg = "dhcpmon detected disparity in DHCP Relay behavior. Duration: %d (sec) for vlan: '%s'\n" - }, - [1] = { - .check_type = DHCP_MON_CHECK_NEGATIVE, - .get_context = dhcp_devman_get_mgmt_dev, - .count = 0, - .msg = "dhcpmon detected DHCP packets traveling through mgmt interface (please check BGP routes.)" - " Duration: %d (sec) for intf: '%s'\n" - } -}; - -/** - * @code signal_callback(fd, event, arg); - * - * @brief signal handler for dhcpmon. It will initiate shutdown when signal is caught - * - * @param fd libevent socket - * @param event event triggered - * @param arg pointer to user provided context (libevent base) - * - * @return none - */ -static void signal_callback(evutil_socket_t fd, short event, void *arg) -{ - syslog(LOG_ALERT, "Received signal: '%s'\n", strsignal(fd)); - dhcp_devman_print_status(NULL, DHCP_COUNTERS_CURRENT); - if ((fd == SIGTERM) || (fd == SIGINT)) { - dhcp_mon_stop(); - } -} - -/** - * @code check_dhcp_relay_health(state_data); - * - * @brief check DHCP relay overall health - * - * @param state_data pointer to dhcpmon state data - * - * @return none - */ -static void check_dhcp_relay_health(dhcp_mon_state_t *state_data) -{ - dhcp_device_context_t *context = state_data->get_context(); - dhcp_mon_status_t dhcp_mon_status = dhcp_devman_get_status(state_data->check_type, context); - - switch (dhcp_mon_status) - { - case DHCP_MON_STATUS_UNHEALTHY: - if (++state_data->count > dhcp_unhealthy_max_count) { - syslog(LOG_ALERT, state_data->msg, state_data->count * window_interval_sec, context->intf); - dhcp_devman_print_status(context, DHCP_COUNTERS_SNAPSHOT); - dhcp_devman_print_status(context, DHCP_COUNTERS_CURRENT); - } - break; - case DHCP_MON_STATUS_HEALTHY: - state_data->count = 0; - break; - case DHCP_MON_STATUS_INDETERMINATE: - if (state_data->count) { - state_data->count++; - } - break; - default: - syslog(LOG_ERR, "DHCP Relay returned unknown status %d\n", dhcp_mon_status); - break; - } -} - -/** - * @code timeout_callback(fd, event, arg); - * - * @brief periodic timer call back - * - * @param fd libevent socket - * @param event event triggered - * @param arg pointer user provided context (libevent base) - * - * @return none - */ -static void timeout_callback(evutil_socket_t fd, short event, void *arg) -{ - for (uint8_t i = 0; i < sizeof(state_data) / sizeof(*state_data); i++) { - check_dhcp_relay_health(&state_data[i]); - } - - dhcp_devman_update_snapshot(NULL); -} - -/** - * @code dhcp_mon_init(window_sec, max_count); - * - * initializes event base and periodic timer event that continuously collects dhcp relay health status every window_sec - * seconds. It also writes to syslog when dhcp relay has been unhealthy for consecutive max_count checks. - * - */ -int dhcp_mon_init(int window_sec, int max_count) -{ - int rv = -1; - - do { - window_interval_sec = window_sec; - dhcp_unhealthy_max_count = max_count; - - base = event_base_new(); - if (base == NULL) { - syslog(LOG_ERR, "Could not initialize libevent!\n"); - break; - } - - ev_sigint = evsignal_new(base, SIGINT, signal_callback, base); - if (ev_sigint == NULL) { - syslog(LOG_ERR, "Could not create SIGINT libevent signal!\n"); - break; - } - - ev_sigterm = evsignal_new(base, SIGTERM, signal_callback, base); - if (ev_sigterm == NULL) { - syslog(LOG_ERR, "Could not create SIGTERM libevent signal!\n"); - break; - } - - ev_sigusr1 = evsignal_new(base, SIGUSR1, signal_callback, base); - if (ev_sigusr1 == NULL) { - syslog(LOG_ERR, "Could not create SIGUSER1 libevent signal!\n"); - break; - } - - ev_timeout = event_new(base, -1, EV_PERSIST, timeout_callback, base); - if (ev_timeout == NULL) { - syslog(LOG_ERR, "Could not create libevent timer!\n"); - break; - } - - rv = 0; - } while (0); - - return rv; -} - -/** - * @code dhcp_mon_shutdown(); - * - * @brief shuts down libevent loop - */ -void dhcp_mon_shutdown() -{ - event_del(ev_timeout); - event_del(ev_sigint); - event_del(ev_sigterm); - event_del(ev_sigusr1); - - event_free(ev_timeout); - event_free(ev_sigint); - event_free(ev_sigterm); - event_free(ev_sigusr1); - - event_base_free(base); -} - -/** - * @code dhcp_mon_start(snaplen); - * - * @brief start monitoring DHCP Relay - */ -int dhcp_mon_start(size_t snaplen) -{ - int rv = -1; - - do - { - if (dhcp_devman_start_capture(snaplen, base) != 0) { - break; - } - - if (evsignal_add(ev_sigint, NULL) != 0) { - syslog(LOG_ERR, "Could not add SIGINT libevent signal!\n"); - break; - } - - if (evsignal_add(ev_sigterm, NULL) != 0) { - syslog(LOG_ERR, "Could not add SIGTERM libevent signal!\n"); - break; - } - - if (evsignal_add(ev_sigusr1, NULL) != 0) { - syslog(LOG_ERR, "Could not add SIGUSR1 libevent signal!\n"); - break; - } - - struct timeval event_time = {.tv_sec = window_interval_sec, .tv_usec = 0}; - if (evtimer_add(ev_timeout, &event_time) != 0) { - syslog(LOG_ERR, "Could not add event timer to libevent!\n"); - break; - } - - if (event_base_dispatch(base) != 0) { - syslog(LOG_ERR, "Could not start libevent dispatching loop!\n"); - break; - } - - rv = 0; - } while (0); - - return rv; -} - -/** - * @code dhcp_mon_stop(); - * - * @brief stop monitoring DHCP Relay - */ -void dhcp_mon_stop() -{ - event_base_loopexit(base, NULL); -} diff --git a/src/dhcpmon/src/dhcp_mon.cpp b/src/dhcpmon/src/dhcp_mon.cpp new file mode 100644 index 000000000000..21b0a363d874 --- /dev/null +++ b/src/dhcpmon/src/dhcp_mon.cpp @@ -0,0 +1,270 @@ +/** + * @file dhcp_mon.c + * + * @brief dhcp relay monitor module + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "dhcp_mon.h" +#include "dhcp_devman.h" + +/** DHCP device/interface state */ +typedef struct +{ + dhcp_mon_check_t check_type; /** check type */ + dhcp_device_context_t* (*get_context)(); /** functor to a device context accessor function */ + int count; /** count in the number of unhealthy checks */ + const char *msg; /** message to be printed if unhealthy state is determined */ +} dhcp_mon_state_t; + +/** window_interval_sec monitoring window for dhcp relay health checks */ +static int window_interval_sec = 18; +/** dhcp_unhealthy_max_count max count of consecutive unhealthy statuses before reporting to syslog */ +static int dhcp_unhealthy_max_count = 10; +/** dhcpmon debug mode control flag */ +static bool debug_on = false; +/** libevent base struct */ +static struct event_base *base; +/** libevent timeout event struct */ +static struct event *ev_timeout = NULL; +/** libevent SIGINT signal event struct */ +static struct event *ev_sigint; +/** libevent SIGTERM signal event struct */ +static struct event *ev_sigterm; +/** libevent SIGUSR1 signal event struct */ +static struct event *ev_sigusr1; + +/** DHCP monitor state data for aggregate device for mgmt device */ +static dhcp_mon_state_t state_data[] = { + [0] = { + .check_type = DHCP_MON_CHECK_POSITIVE, + .get_context = dhcp_devman_get_agg_dev, + .count = 0, + .msg = "dhcpmon detected disparity in DHCP Relay behavior. Duration: %d (sec) for vlan: '%s'\n" + }, + [1] = { + .check_type = DHCP_MON_CHECK_NEGATIVE, + .get_context = dhcp_devman_get_mgmt_dev, + .count = 0, + .msg = "dhcpmon detected DHCP packets traveling through mgmt interface (please check BGP routes.)" + " Duration: %d (sec) for intf: '%s'\n" + } +}; + +/** + * @code signal_callback(fd, event, arg); + * + * @brief signal handler for dhcpmon. It will initiate shutdown when signal is caught + * + * @param fd libevent socket + * @param event event triggered + * @param arg pointer to user provided context (libevent base) + * + * @return none + */ +static void signal_callback(evutil_socket_t fd, short event, void *arg) +{ + syslog(LOG_ALERT, "Received signal: '%s'\n", strsignal(fd)); + dhcp_devman_print_status(NULL, DHCP_COUNTERS_CURRENT); + if ((fd == SIGTERM) || (fd == SIGINT)) { + dhcp_mon_stop(); + } +} + +/** + * @code check_dhcp_relay_health(state_data); + * + * @brief check DHCP relay overall health + * + * @param state_data pointer to dhcpmon state data + * + * @return none + */ +static void check_dhcp_relay_health(dhcp_mon_state_t *state_data) +{ + dhcp_device_context_t *context = state_data->get_context(); + dhcp_mon_status_t dhcp_mon_status = dhcp_devman_get_status(state_data->check_type, context); + + switch (dhcp_mon_status) + { + case DHCP_MON_STATUS_UNHEALTHY: + if (++state_data->count > dhcp_unhealthy_max_count) { + syslog(LOG_ALERT, state_data->msg, state_data->count * window_interval_sec, context->intf); + dhcp_devman_print_status(context, DHCP_COUNTERS_SNAPSHOT); + dhcp_devman_print_status(context, DHCP_COUNTERS_CURRENT); + } + break; + case DHCP_MON_STATUS_HEALTHY: + state_data->count = 0; + break; + case DHCP_MON_STATUS_INDETERMINATE: + if (state_data->count) { + state_data->count++; + } + break; + default: + syslog(LOG_ERR, "DHCP Relay returned unknown status %d\n", dhcp_mon_status); + break; + } +} + +/** + * @code timeout_callback(fd, event, arg); + * + * @brief periodic timer call back + * + * @param fd libevent socket + * @param event event triggered + * @param arg pointer user provided context (libevent base) + * + * @return none + */ +static void timeout_callback(evutil_socket_t fd, short event, void *arg) +{ + for (uint8_t i = 0; i < sizeof(state_data) / sizeof(*state_data); i++) { + check_dhcp_relay_health(&state_data[i]); + } + + dhcp_devman_update_snapshot(NULL); + + if (debug_on) { + dhcp_devman_print_status(NULL, DHCP_COUNTERS_SNAPSHOT); + dhcp_devman_print_status(NULL, DHCP_COUNTERS_CURRENT); + } +} + +/** + * @code dhcp_mon_init(window_sec, max_count); + * + * initializes event base and periodic timer event that continuously collects dhcp relay health status every window_sec + * seconds. It also writes to syslog when dhcp relay has been unhealthy for consecutive max_count checks. + * + */ +int dhcp_mon_init(int window_sec, int max_count) +{ + int rv = -1; + + do { + window_interval_sec = window_sec; + dhcp_unhealthy_max_count = max_count; + + base = event_base_new(); + if (base == NULL) { + syslog(LOG_ERR, "Could not initialize libevent!\n"); + break; + } + + ev_sigint = evsignal_new(base, SIGINT, signal_callback, base); + if (ev_sigint == NULL) { + syslog(LOG_ERR, "Could not create SIGINT libevent signal!\n"); + break; + } + + ev_sigterm = evsignal_new(base, SIGTERM, signal_callback, base); + if (ev_sigterm == NULL) { + syslog(LOG_ERR, "Could not create SIGTERM libevent signal!\n"); + break; + } + + ev_sigusr1 = evsignal_new(base, SIGUSR1, signal_callback, base); + if (ev_sigusr1 == NULL) { + syslog(LOG_ERR, "Could not create SIGUSER1 libevent signal!\n"); + break; + } + + ev_timeout = event_new(base, -1, EV_PERSIST, timeout_callback, base); + if (ev_timeout == NULL) { + syslog(LOG_ERR, "Could not create libevent timer!\n"); + break; + } + + rv = 0; + } while (0); + + return rv; +} + +/** + * @code dhcp_mon_shutdown(); + * + * @brief shuts down libevent loop + */ +void dhcp_mon_shutdown() +{ + event_del(ev_timeout); + event_del(ev_sigint); + event_del(ev_sigterm); + event_del(ev_sigusr1); + + event_free(ev_timeout); + event_free(ev_sigint); + event_free(ev_sigterm); + event_free(ev_sigusr1); + + event_base_free(base); +} + +/** + * @code dhcp_mon_start(snaplen, debug_mode); + * + * @brief start monitoring DHCP Relay + */ +int dhcp_mon_start(size_t snaplen, bool debug_mode) +{ + int rv = -1; + debug_on = debug_mode; + + do + { + if (dhcp_devman_start_capture(snaplen, base) != 0) { + break; + } + + if (evsignal_add(ev_sigint, NULL) != 0) { + syslog(LOG_ERR, "Could not add SIGINT libevent signal!\n"); + break; + } + + if (evsignal_add(ev_sigterm, NULL) != 0) { + syslog(LOG_ERR, "Could not add SIGTERM libevent signal!\n"); + break; + } + + if (evsignal_add(ev_sigusr1, NULL) != 0) { + syslog(LOG_ERR, "Could not add SIGUSR1 libevent signal!\n"); + break; + } + + struct timeval event_time = {.tv_sec = window_interval_sec, .tv_usec = 0}; + if (evtimer_add(ev_timeout, &event_time) != 0) { + syslog(LOG_ERR, "Could not add event timer to libevent!\n"); + break; + } + + if (event_base_dispatch(base) != 0) { + syslog(LOG_ERR, "Could not start libevent dispatching loop!\n"); + break; + } + rv = 0; + } while (0); + + return rv; +} + +/** + * @code dhcp_mon_stop(); + * + * @brief stop monitoring DHCP Relay + */ +void dhcp_mon_stop() +{ + event_base_loopexit(base, NULL); +} diff --git a/src/dhcpmon/src/dhcp_mon.h b/src/dhcpmon/src/dhcp_mon.h index ae8911ab51fc..5bae01f5962b 100644 --- a/src/dhcpmon/src/dhcp_mon.h +++ b/src/dhcpmon/src/dhcp_mon.h @@ -32,15 +32,16 @@ int dhcp_mon_init(int window_sec, int max_count); void dhcp_mon_shutdown(); /** - * @code dhcp_mon_start(snaplen); + * @code dhcp_mon_start(snaplen, debug); * * @brief start monitoring DHCP Relay * * @param snaplen packet capture length + * @param debug turn on debug or not * * @return 0 upon success, otherwise upon failure */ -int dhcp_mon_start(size_t snaplen); +int dhcp_mon_start(size_t snaplen, bool debug); /** * @code dhcp_mon_stop(); diff --git a/src/dhcpmon/src/main.c b/src/dhcpmon/src/main.c deleted file mode 100644 index bb8c45867f66..000000000000 --- a/src/dhcpmon/src/main.c +++ /dev/null @@ -1,174 +0,0 @@ -/** - * @file main.c - * - * @brief: Main entry point for dhcpmon utility. - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "dhcp_mon.h" -#include "dhcp_devman.h" - -/** dhcpmon_default_snaplen: default snap length of packet being captured */ -static const size_t dhcpmon_default_snaplen = 65535; -/** dhcpmon_default_health_check_window: default value for a time window, during which DHCP DORA packet counts are being - * collected */ -static const uint32_t dhcpmon_default_health_check_window = 18; -/** dhcpmon_default_unhealthy_max_count: default max consecutive unhealthy status reported before reporting an issue - * with DHCP relay */ -static const uint32_t dhcpmon_default_unhealthy_max_count = 10; - -/** - * @code usage(prog); - * - * @brief prints help message about how to use dhcpmon utility - * - * @param prog program name - * - * @return none - */ -static void usage(const char *prog) -{ - printf("Usage: %s -id {-iu }+ -im [-w ]" - "[-c ] [-s ] [-d]\n", prog); - printf("where\n"); - printf("\tsouth interface: is a vlan interface,\n"); - printf("\tnorth interface: is a TOR-T1 interface,\n"); - printf("\tsnapshot window: during which DHCP counters are gathered and DHCP status is validated (default %d),\n", - dhcpmon_default_health_check_window); - printf("\tunhealthy status count: count of consecutive unhealthy status before writing an alert to syslog " - "(default %d),\n", - dhcpmon_default_unhealthy_max_count); - printf("\tsnap length: snap length of packet capture (default %ld),\n", dhcpmon_default_snaplen); - printf("\t-d: daemonize %s.\n", prog); - - exit(EXIT_SUCCESS); -} - -/** - * @code dhcpmon_daemonize(); - * - * @brief make this utility run as a daemon. - * - * @return none - */ -static void dhcpmon_daemonize() -{ - pid_t pid, sid; - pid = fork(); - if (pid < 0) { - syslog(LOG_ALERT, "fork: %s", strerror(errno)); - exit(EXIT_FAILURE); - } - - if (pid > 0) { - exit(EXIT_SUCCESS); - } - - // this is the daemon running now - umask(0); - // Create a new SID for the child process - sid = setsid(); - if (sid < 0) { - syslog(LOG_ALERT, "setsid: %s", strerror(errno)); - exit(EXIT_FAILURE); - } - - // Change the current working directory - if ((chdir("/")) < 0) { - syslog(LOG_ALERT, "chdir: %s", strerror(errno)); - exit(EXIT_FAILURE); - } - - close(STDIN_FILENO); - close(STDOUT_FILENO); - close(STDERR_FILENO); -} - -/** - * @code main(argc, argv); - * - * @brief main entry point of dhcpmon utility - * - * @return int 0 on success, otherwise on failure - */ -int main(int argc, char **argv) -{ - int rv = EXIT_FAILURE; - int i; - int window_interval = dhcpmon_default_health_check_window; - int max_unhealthy_count = dhcpmon_default_unhealthy_max_count; - size_t snaplen = dhcpmon_default_snaplen; - int make_daemon = 0; - - setlogmask(LOG_UPTO(LOG_INFO)); - openlog(basename(argv[0]), LOG_CONS | LOG_PID | LOG_NDELAY, LOG_DAEMON); - - dhcp_devman_init(); - - for (i = 1; i < argc;) { - if ((argv[i] == NULL) || (argv[i][0] != '-')) { - break; - } - switch (argv[i][1]) - { - case 'h': - usage(basename(argv[0])); - break; - case 'i': - if (dhcp_devman_add_intf(argv[i + 1], argv[i][2]) != 0) { - usage(basename(argv[0])); - } - i += 2; - break; - case 'd': - make_daemon = 1; - i++; - break; - case 's': - snaplen = atoi(argv[i + 1]); - i += 2; - break; - case 'w': - window_interval = atoi(argv[i + 1]); - i += 2; - break; - case 'c': - max_unhealthy_count = atoi(argv[i + 1]); - i += 2; - break; - default: - fprintf(stderr, "%s: %c: Unknown option\n", basename(argv[0]), argv[i][1]); - usage(basename(argv[0])); - } - } - - if (make_daemon) { - dhcpmon_daemonize(); - } - - if ((dhcp_mon_init(window_interval, max_unhealthy_count) == 0) && - (dhcp_mon_start(snaplen) == 0)) { - - rv = EXIT_SUCCESS; - - dhcp_mon_shutdown(); - } - - dhcp_devman_shutdown(); - - closelog(); - - return rv; -} diff --git a/src/dhcpmon/src/main.cpp b/src/dhcpmon/src/main.cpp new file mode 100644 index 000000000000..e660bbd908a9 --- /dev/null +++ b/src/dhcpmon/src/main.cpp @@ -0,0 +1,191 @@ +/** + * @file main.c + * + * @brief: Main entry point for dhcpmon utility. + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "subscriberstatetable.h" +#include "select.h" + +#include "dhcp_mon.h" +#include "dhcp_devman.h" +#include "dhcp_device.h" + +/** dhcpmon_default_snaplen: default snap length of packet being captured */ +static const size_t dhcpmon_default_snaplen = 65535; +/** dhcpmon_default_health_check_window: default value for a time window, during which DHCP DORA packet counts are being + * collected */ +static const uint32_t dhcpmon_default_health_check_window = 18; +/** dhcpmon_default_unhealthy_max_count: default max consecutive unhealthy status reported before reporting an issue + * with DHCP relay */ +static const uint32_t dhcpmon_default_unhealthy_max_count = 10; + +bool dual_tor_sock = false; + +/** + * @code usage(prog); + * + * @brief prints help message about how to use dhcpmon utility + * + * @param prog program name + * + * @return none + */ +static void usage(const char *prog) +{ + printf("Usage: %s -id {-iu }+ -im [-u ]" + "[-w ] [-c ] [-s ] [-D] [-d]\n", prog); + printf("where\n"); + printf("\tsouth interface: is a vlan interface,\n"); + printf("\tnorth interface: is a TOR-T1 interface,\n"); + printf("\tloopback interface: is the loopback interface for dual tor setup,\n"); + printf("\tsnapshot window: during which DHCP counters are gathered and DHCP status is validated (default %d),\n", + dhcpmon_default_health_check_window); + printf("\tunhealthy status count: count of consecutive unhealthy status before writing an alert to syslog " + "(default %d),\n", + dhcpmon_default_unhealthy_max_count); + printf("\tsnap length: snap length of packet capture (default %ld),\n", dhcpmon_default_snaplen); + printf("\t-D: debug mode: print counter to syslog\n"); + printf("\t-d: daemonize %s.\n", prog); + + exit(EXIT_SUCCESS); +} + +/** + * @code dhcpmon_daemonize(); + * + * @brief make this utility run as a daemon. + * + * @return none + */ +static void dhcpmon_daemonize() +{ + pid_t pid, sid; + pid = fork(); + if (pid < 0) { + syslog(LOG_ALERT, "fork: %s", strerror(errno)); + exit(EXIT_FAILURE); + } + + if (pid > 0) { + exit(EXIT_SUCCESS); + } + + // this is the daemon running now + umask(0); + // Create a new SID for the child process + sid = setsid(); + if (sid < 0) { + syslog(LOG_ALERT, "setsid: %s", strerror(errno)); + exit(EXIT_FAILURE); + } + + // Change the current working directory + if ((chdir("/")) < 0) { + syslog(LOG_ALERT, "chdir: %s", strerror(errno)); + exit(EXIT_FAILURE); + } + + close(STDIN_FILENO); + close(STDOUT_FILENO); + close(STDERR_FILENO); +} + +/** + * @code main(argc, argv); + * + * @brief main entry point of dhcpmon utility + * + * @return int 0 on success, otherwise on failure + */ +int main(int argc, char **argv) +{ + int rv = EXIT_FAILURE; + int i; + int window_interval = dhcpmon_default_health_check_window; + int max_unhealthy_count = dhcpmon_default_unhealthy_max_count; + size_t snaplen = dhcpmon_default_snaplen; + int make_daemon = 0; + bool debug_mode = false; + + setlogmask(LOG_UPTO(LOG_INFO)); + openlog(basename(argv[0]), LOG_CONS | LOG_PID | LOG_NDELAY, LOG_DAEMON); + + for (i = 1; i < argc;) { + if ((argv[i] == NULL) || (argv[i][0] != '-')) { + break; + } + switch (argv[i][1]) + { + case 'h': + usage(basename(argv[0])); + break; + case 'i': + if (dhcp_devman_add_intf(argv[i + 1], argv[i][2]) != 0) { + usage(basename(argv[0])); + } + i += 2; + break; + case 'u': + dual_tor_sock = true; + if (dhcp_devman_setup_dual_tor_mode(argv[i + 1]) != 0) { + usage(basename(argv[0])); + } + i += 2; + break; + case 'd': + make_daemon = 1; + i++; + break; + case 's': + snaplen = atoi(argv[i + 1]); + i += 2; + break; + case 'w': + window_interval = atoi(argv[i + 1]); + i += 2; + break; + case 'c': + max_unhealthy_count = atoi(argv[i + 1]); + i += 2; + break; + case 'D': + debug_mode = true; + i += 1; + break; + default: + fprintf(stderr, "%s: %c: Unknown option\n", basename(argv[0]), argv[i][1]); + usage(basename(argv[0])); + } + } + + if (make_daemon) { + dhcpmon_daemonize(); + } + + if ((dhcp_mon_init(window_interval, max_unhealthy_count) == 0) && + (dhcp_mon_start(snaplen, debug_mode) == 0)) { + + rv = EXIT_SUCCESS; + + dhcp_mon_shutdown(); + } + + dhcp_devman_shutdown(); + + closelog(); + + return rv; +} diff --git a/src/dhcpmon/src/subdir.mk b/src/dhcpmon/src/subdir.mk index 324977aa39f7..dd808aeb7202 100644 --- a/src/dhcpmon/src/subdir.mk +++ b/src/dhcpmon/src/subdir.mk @@ -1,11 +1,11 @@ # Add inputs and outputs from these tool invocations to the build variables -CC := gcc +CC := g++ C_SRCS += \ -../src/dhcp_device.c \ -../src/dhcp_devman.c \ -../src/dhcp_mon.c \ -../src/main.c +../src/dhcp_device.cpp \ +../src/dhcp_devman.cpp \ +../src/dhcp_mon.cpp \ +../src/main.cpp OBJS += \ ./src/dhcp_device.o \ @@ -21,9 +21,9 @@ C_DEPS += \ # Each subdirectory must supply rules for building sources it contributes -src/%.o: ../src/%.c +src/%.o: src/%.cpp @echo 'Building file: $<' @echo 'Invoking: GCC C Compiler' - $(CC) -O3 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<" + $(CC) -O3 -g3 -Wall -I$(PWD)/../sonic-swss-common/common -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<" @echo 'Finished building: $<' @echo ' ' diff --git a/src/dhcprelay b/src/dhcprelay new file mode 160000 index 000000000000..a4b15d8ba429 --- /dev/null +++ b/src/dhcprelay @@ -0,0 +1 @@ +Subproject commit a4b15d8ba429c2799d3927f8dca376745af08c1a diff --git a/src/ethtool/Makefile b/src/ethtool/Makefile new file mode 100644 index 000000000000..779a3b9e40ff --- /dev/null +++ b/src/ethtool/Makefile @@ -0,0 +1,24 @@ +.ONESHELL: +SHELL = /bin/bash +.SHELLFLAGS += -e + +MAIN_TARGET = $(ETHTOOL) +DERIVED_TARGET = $(ETHTOOL_DBG) + +$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : + # Obtaining the ethtool debian package + rm -rf ethtool* + git clone https://salsa.debian.org/kernel-team/ethtool/ + pushd ethtool + git checkout tags/debian/1%$(ETHTOOL_VERSION_BASE)-1 + # Build package +ifeq ($(MULTIARCH_QEMU_ENVIRON), y) + DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR) +else + dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR) +endif + + popd + mv $(DERIVED_TARGET) $* $(DEST)/ + +$(addprefix $(DEST)/, $(DERIVED_TARGET)): $(DEST)/% : $(DEST)/$(MAIN_TARGET) diff --git a/src/hiredis/Makefile b/src/hiredis/Makefile index 746056e51de5..c26028baff54 100644 --- a/src/hiredis/Makefile +++ b/src/hiredis/Makefile @@ -2,21 +2,22 @@ SHELL = /bin/bash .SHELLFLAGS += -e -MAIN_TARGET = libhiredis0.14_$(HIREDIS_VERSION_FULL)_$(CONFIGURED_ARCH).deb -DERIVED_TARGETS = libhiredis0.14-dbgsym_$(HIREDIS_VERSION_FULL)_$(CONFIGURED_ARCH).deb libhiredis-dev_$(HIREDIS_VERSION_FULL)_$(CONFIGURED_ARCH).deb +MAIN_TARGET = $(LIBHIREDIS) +DERIVED_TARGETS = $(LIBHIREDIS_DBG) $(LIBHIREDIS_DEV) $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : - rm -rf hiredis-$(HIREDIS_VERSION) + # Remove any stale files + rm -rf ./hiredis-$(HIREDIS_VERSION) - wget -O hiredis_$(HIREDIS_VERSION).orig.tar.gz http://http.debian.net/debian/pool/main/h/hiredis/hiredis_$(HIREDIS_VERSION).orig.tar.gz - wget -O hiredis_$(HIREDIS_VERSION_FULL).debian.tar.xz http://http.debian.net/debian/pool/main/h/hiredis/hiredis_$(HIREDIS_VERSION_FULL).debian.tar.xz - wget -O hiredis_$(HIREDIS_VERSION_FULL).dsc http://http.debian.net/debian/pool/main/h/hiredis/hiredis_$(HIREDIS_VERSION_FULL).dsc + # Get hiredis release, debian files + dget -u http://http.debian.net/debian/pool/main/h/hiredis/hiredis_$(HIREDIS_VERSION_FULL).dsc - dpkg-source -x hiredis_$(HIREDIS_VERSION_FULL).dsc - pushd hiredis-$(HIREDIS_VERSION) - fakeroot debian/rules -j$(SONIC_CONFIG_MAKE_JOBS) binary + # Build source and Debian packages + pushd ./hiredis-$(HIREDIS_VERSION) + dpkg-buildpackage -rfakeroot -d -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR) popd + # Move the newly-built .deb packages to the destination directory mv $* $(DERIVED_TARGETS) $(DEST)/ $(addprefix $(DEST)/, $(DERIVED_TARGETS)): $(DEST)/% : $(DEST)/$(MAIN_TARGET) diff --git a/src/ifupdown2/Makefile b/src/ifupdown2/Makefile index 66b4df2ec32f..89228bedafae 100644 --- a/src/ifupdown2/Makefile +++ b/src/ifupdown2/Makefile @@ -14,7 +14,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : pushd ./ifupdown2-$(IFUPDOWN2_VERSION) # Build source and Debian packages - dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) + dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR) popd # Move the newly-built .deb packages to the destination directory diff --git a/src/initramfs-tools/Makefile b/src/initramfs-tools/Makefile index 9ef8e78f5479..f57b943d2d4f 100644 --- a/src/initramfs-tools/Makefile +++ b/src/initramfs-tools/Makefile @@ -19,7 +19,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : # Build the package rm -f debian/*.debhelper.log - dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) + dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR) popd mv $(DERIVED_TARGETS) $* $(DEST)/ diff --git a/src/iproute2/Makefile b/src/iproute2/Makefile index 8748550a1d78..5b354ce8b019 100644 --- a/src/iproute2/Makefile +++ b/src/iproute2/Makefile @@ -17,7 +17,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : dpkg-source -x iproute2_$(IPROUTE2_VERSION_FULL).dsc pushd iproute2-$(IPROUTE2_VERSION) - dpkg-buildpackage -us -uc -b -j$(SONIC_CONFIG_MAKE_JOBS) + dpkg-buildpackage -us -uc -b -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR) popd mv $* $(DEST)/ diff --git a/src/iptables/Makefile b/src/iptables/Makefile index 3268ab5afea3..681ef5d2dcc3 100644 --- a/src/iptables/Makefile +++ b/src/iptables/Makefile @@ -38,7 +38,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : stg import -s ../patch/series # Build source and Debian packages - dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) + dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR) popd # Move the newly-built .deb packages to the destination directory diff --git a/src/isc-dhcp/Makefile b/src/isc-dhcp/Makefile index bd957a08a6f5..2adf6bba2aa3 100644 --- a/src/isc-dhcp/Makefile +++ b/src/isc-dhcp/Makefile @@ -23,7 +23,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : stg import -s ../patch/series # Build source and Debian packages - dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) + dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR) popd # Move the newly-built .deb packages to the destination directory diff --git a/src/isc-dhcp/patch/0009-Support-for-dual-tor-scenario.patch b/src/isc-dhcp/patch/0009-Support-for-dual-tor-scenario.patch index e918cc619106..0f7495f49e7c 100644 --- a/src/isc-dhcp/patch/0009-Support-for-dual-tor-scenario.patch +++ b/src/isc-dhcp/patch/0009-Support-for-dual-tor-scenario.patch @@ -238,7 +238,7 @@ index e158efe..055d97f 100644 (flags & INTERFACE_UPSTREAM ? 'Y' : 'N'), (flags & INTERFACE_DOWNSTREAM ? 'Y' : 'N')); -+ if (flags & INTERFACE_DOWNSTREAM) { ++ if (flags & INTERFACE_DOWNSTREAM || flags & INTERFACE_UPSTREAM) { /* include all vlan intf in downstream_intf_list */ + ci = ((struct downstream_intf_list *)dmalloc(sizeof *ci, MDL)); + if (!ci) + log_fatal("no memory for downstream interface pointer.\n"); diff --git a/src/isc-dhcp/patch/0012-add-option-si-to-support-using-src-intf-ip-in-relay.patch b/src/isc-dhcp/patch/0012-add-option-si-to-support-using-src-intf-ip-in-relay.patch new file mode 100644 index 000000000000..7fd9fc313406 --- /dev/null +++ b/src/isc-dhcp/patch/0012-add-option-si-to-support-using-src-intf-ip-in-relay.patch @@ -0,0 +1,192 @@ +From 16163f0693e30588216f0f280d5eba8bb53f7001 Mon Sep 17 00:00:00 2001 +From: Tianrong Zhang +Date: Fri, 12 Mar 2021 23:30:56 -0800 +Subject: [PATCH] add option -si to support using src intf ip in relay + +--- + common/socket.c | 119 ++++++++++++++++++++++++++++++++++++----------- + includes/dhcpd.h | 1 + + relay/dhcrelay.c | 8 ++++ + 3 files changed, 100 insertions(+), 28 deletions(-) + +diff --git a/common/socket.c b/common/socket.c +index 483eb9c..da9f501 100644 +--- a/common/socket.c ++++ b/common/socket.c +@@ -83,6 +83,29 @@ static unsigned int global_v4_socket_references = 0; + static int global_v4_socket = -1; + #endif + ++/* ++ * If set, uses "from" interface IP for packet Tx. ++ * If not set, kernel chooses appropriate src ip for tx pkts ++ */ ++int use_src_intf_ip_for_tx; ++ ++/* ++ * For both send_packet6() and receive_packet6() we need to allocate ++ * space for the cmsg header information. We do this once and reuse ++ * the buffer. We also need the control buf for send_packet() and ++ * receive_packet() when we use a single socket and IP_PKTINFO to ++ * send the packet out the correct interface. ++ */ ++static void *v4_control_buf = NULL; ++static size_t v4_control_buf_len = 0; ++ ++static void ++v4_allocate_cmsg_cbuf(void) { ++ v4_control_buf_len = CMSG_SPACE(sizeof(struct in_pktinfo)); ++ v4_control_buf = dmalloc(v4_control_buf_len, MDL); ++ return; ++} ++ + /* + * If we can't bind() to a specific interface, then we can only have + * a single socket. This variable insures that we don't try to listen +@@ -712,37 +735,77 @@ ssize_t send_packet (interface, packet, raw, len, from, to, hto) + struct hardware *hto; + { + int result; +-#ifdef IGNORE_HOSTUNREACH +- int retry = 0; +- do { +-#endif +-#if defined(IP_PKTINFO) && defined(IP_RECVPKTINFO) && defined(USE_V4_PKTINFO) +- struct in_pktinfo pktinfo; +- +- if (interface->ifp != NULL) { +- memset(&pktinfo, 0, sizeof (pktinfo)); +- pktinfo.ipi_ifindex = interface->ifp->ifr_index; +- if (setsockopt(interface->wfdesc, IPPROTO_IP, +- IP_PKTINFO, (char *)&pktinfo, +- sizeof(pktinfo)) < 0) +- log_fatal("setsockopt: IP_PKTINFO: %m"); ++ struct msghdr m; ++ struct iovec v; ++ struct sockaddr_in dst; ++ struct in_pktinfo *pktinfo; ++ struct cmsghdr *cmsg; ++ unsigned int ifindex; ++ ++ /* ++ * If necessary allocate space for the control message header. ++ * The space is common between send and receive. ++ */ ++ ++ if (v4_control_buf == NULL) { ++ v4_allocate_cmsg_cbuf(); ++ if (v4_control_buf == NULL) { ++ log_error("send_packet: unable to allocate cmsg header"); ++ return(ENOMEM); + } +-#endif +- result = sendto (interface -> wfdesc, (char *)raw, len, 0, +- (struct sockaddr *)to, sizeof *to); +-#ifdef IGNORE_HOSTUNREACH +- } while (to -> sin_addr.s_addr == htonl (INADDR_BROADCAST) && +- result < 0 && +- (errno == EHOSTUNREACH || +- errno == ECONNREFUSED) && +- retry++ < 10); +-#endif ++ } ++ memset(v4_control_buf, 0, v4_control_buf_len); ++ ++ /* ++ * Initialize our message header structure. ++ */ ++ memset(&m, 0, sizeof(m)); ++ ++ /* ++ * Set the target address we're sending to. ++ */ ++ memcpy(&dst, to, sizeof(dst)); ++ m.msg_name = &dst; ++ m.msg_namelen = sizeof(dst); ++ ifindex = if_nametoindex(interface->name); ++ ++ /* ++ * Set the data buffer we're sending. (Using this wacky ++ * "scatter-gather" stuff... we only have a single chunk ++ * of data to send, so we declare a single vector entry.) ++ */ ++ v.iov_base = (char *)raw; ++ v.iov_len = len; ++ m.msg_iov = &v; ++ m.msg_iovlen = 1; ++ ++ /* ++ * Setting the interface is a bit more involved. ++ * ++ * We have to create a "control message", and set that to ++ * define the IP packet information. We let he kernel decide ++ * the source IP address unless 'use_src_intf_ip_for_tx' is ++ * set, in which case we use the IP address of the ingress ++ * interface we received the request on as the source IP. ++ */ ++ m.msg_control = v4_control_buf; ++ m.msg_controllen = v4_control_buf_len; ++ cmsg = CMSG_FIRSTHDR(&m); ++ INSIST(cmsg != NULL); ++ cmsg->cmsg_level = IPPROTO_IP; ++ cmsg->cmsg_type = IP_PKTINFO; ++ cmsg->cmsg_len = CMSG_LEN(sizeof(*pktinfo)); ++ pktinfo = (struct in_pktinfo *)CMSG_DATA(cmsg); ++ memset(pktinfo, 0, sizeof(*pktinfo)); ++ pktinfo->ipi_ifindex = ifindex; ++ if (use_src_intf_ip_for_tx) ++ pktinfo->ipi_spec_dst = from; ++ ++ result = sendmsg(interface->wfdesc, &m, 0); + if (result < 0) { +- log_error ("send_packet: %m"); +- if (errno == ENETUNREACH) +- log_error ("send_packet: please consult README file%s", +- " regarding broadcast address."); ++ log_error("send_packet: %m"); + } ++ + return result; + } + +diff --git a/includes/dhcpd.h b/includes/dhcpd.h +index 36cd518..0c25582 100644 +--- a/includes/dhcpd.h ++++ b/includes/dhcpd.h +@@ -2660,6 +2660,7 @@ ssize_t send_fallback6(struct interface_info *, struct packet *, + #endif + + #ifdef USE_SOCKET_SEND ++extern int use_src_intf_ip_for_tx; + void if_reinitialize_send (struct interface_info *); + void if_register_send (struct interface_info *); + void if_deregister_send (struct interface_info *); +diff --git a/relay/dhcrelay.c b/relay/dhcrelay.c +index 221106a..c44a79d 100644 +--- a/relay/dhcrelay.c ++++ b/relay/dhcrelay.c +@@ -97,6 +97,12 @@ struct downstream_intf_list { + isc_boolean_t use_if_id = ISC_FALSE; + #endif + ++/* ++ * If not set, kernel chooses what the src ip is. ++ * If set, uses "from" interface IP for packet Tx. ++ */ ++extern int use_src_intf_ip_for_tx = 0; ++ + /* Maximum size of a packet with agent options added. */ + int dhcp_max_agent_option_packet_length = DHCP_MTU_MIN; + +@@ -431,6 +437,8 @@ main(int argc, char **argv) { + #endif + } else if (!strcmp(argv[i], "-d")) { + /* no_daemon = 1; */ ++ } else if (!strcmp(argv[i], "-si")) { ++ use_src_intf_ip_for_tx = 1; + } else if (!strcmp(argv[i], "-q")) { + quiet = 1; + quiet_interface_discovery = 1; +-- +2.17.1 + diff --git a/src/isc-dhcp/patch/0013-Fix-dhcrelay-agent-option-buffer-pointer-logic.patch b/src/isc-dhcp/patch/0013-Fix-dhcrelay-agent-option-buffer-pointer-logic.patch new file mode 100644 index 000000000000..051b58966cae --- /dev/null +++ b/src/isc-dhcp/patch/0013-Fix-dhcrelay-agent-option-buffer-pointer-logic.patch @@ -0,0 +1,53 @@ +From 0a2f9a62bceb90b0d30461add2e25c4ce7a24547 Mon Sep 17 00:00:00 2001 +From: Thomas Markwalder +Date: Fri, 20 Dec 2019 10:11:54 -0500 +Subject: [PATCH] [#71] Fix dhcrelay agent option buffer pointer logic + +relay/dhcrelay.c + strip_relay_agent_options() + strip_relay_agent_options() + - corrected buffer pointer logic + +--- + relay/dhcrelay.c | 18 ++++++++++++++---- + 1 file changed, 14 insertions(+), 4 deletions(-) + +diff --git a/relay/dhcrelay.c b/relay/dhcrelay.c +index 896e1e2e..980dacae 100644 +--- a/relay/dhcrelay.c ++++ b/relay/dhcrelay.c +@@ -1238,8 +1238,13 @@ strip_relay_agent_options(struct interface_info *in, + return (0); + + if (sp != op) { +- memmove(sp, op, op[1] + 2); +- sp += op[1] + 2; ++ size_t mlen = op[1] + 2; ++ memmove(sp, op, mlen); ++ sp += mlen; ++ if (sp > max) { ++ return (0); ++ } ++ + op = nextop; + } else + op = sp = nextop; +@@ -1620,8 +1620,13 @@ add_relay_agent_options(struct interface_info *ip, struct dhcp_packet *packet, + end_pad = NULL; + + if (sp != op) { +- memmove(sp, op, op[1] + 2); +- sp += op[1] + 2; ++ size_t mlen = op[1] + 2; ++ memmove(sp, op, mlen); ++ sp += mlen; ++ if (sp > max) { ++ return (0); ++ } ++ + op = nextop; + } else + op = sp = nextop; +-- +2.17.1 + diff --git a/src/isc-dhcp/patch/series b/src/isc-dhcp/patch/series index a34b5bf4b0df..b9efee0192f5 100644 --- a/src/isc-dhcp/patch/series +++ b/src/isc-dhcp/patch/series @@ -10,3 +10,5 @@ 0009-Support-for-dual-tor-scenario.patch 0010-Bugfix-correctly-set-interface-netmask.patch 0011-dhcp-relay-Prevent-Buffer-Overrun.patch +0012-add-option-si-to-support-using-src-intf-ip-in-relay.patch +0013-Fix-dhcrelay-agent-option-buffer-pointer-logic.patch diff --git a/src/kdump-tools/Makefile b/src/kdump-tools/Makefile index 18c2a369b5d7..dadf08503af1 100644 --- a/src/kdump-tools/Makefile +++ b/src/kdump-tools/Makefile @@ -25,7 +25,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : stg import -s ../patch/series # Build source and Debian packages - fakeroot debian/rules binary-indep + dpkg-buildpackage -rfakeroot -b -us -uc -Tbinary-indep -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR) popd # Move the newly-built .deb packages to the destination directory diff --git a/src/libnl3/Makefile b/src/libnl3/Makefile index a0e9891c9efc..c45ac85b7288 100644 --- a/src/libnl3/Makefile +++ b/src/libnl3/Makefile @@ -21,7 +21,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : git checkout tags/libnl$(subst .,_,$(LIBNL3_VERSION_BASE)) ln -s ../debian debian - dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) + dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR) popd mv $(DERIVED_TARGETS) $* $(DEST)/ diff --git a/src/libteam/Makefile b/src/libteam/Makefile index 9fd5f582ed4d..47f9d1dd21bf 100644 --- a/src/libteam/Makefile +++ b/src/libteam/Makefile @@ -31,7 +31,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : mv tmp/debian libteam/ rm -rf tmp pushd ./libteam - dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) + dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR) popd mv $(DERIVED_TARGETS) $* $(DEST)/ diff --git a/src/libteam/patch/0008-libteam-Add-warm_reboot-mode.patch b/src/libteam/patch/0008-libteam-Add-warm_reboot-mode.patch index 440d351a8b6e..4ef38ee138f3 100644 --- a/src/libteam/patch/0008-libteam-Add-warm_reboot-mode.patch +++ b/src/libteam/patch/0008-libteam-Add-warm_reboot-mode.patch @@ -1,4 +1,4 @@ -From a4ab4de68134f6425f704a2ddcda33a4930645de Mon Sep 17 00:00:00 2001 +From cdc7eb674bb779b9e5181921e4c7c2b2f0a0db41 Mon Sep 17 00:00:00 2001 From: Pavel Shirshov Date: Tue, 3 Mar 2020 13:04:57 -0800 Subject: [PATCH] [libteam]: Reimplement Warm-Reboot procedure' @@ -9,8 +9,8 @@ Subject: [PATCH] [libteam]: Reimplement Warm-Reboot procedure' teamd/teamd.h | 6 + teamd/teamd_events.c | 13 ++ teamd/teamd_per_port.c | 6 + - teamd/teamd_runner_lacp.c | 474 +++++++++++++++++++++++++++++++++++--- - 6 files changed, 512 insertions(+), 44 deletions(-) + teamd/teamd_runner_lacp.c | 475 +++++++++++++++++++++++++++++++++++--- + 6 files changed, 513 insertions(+), 44 deletions(-) diff --git a/libteam/ifinfo.c b/libteam/ifinfo.c index 46d56a2..b86d34c 100644 @@ -35,7 +35,7 @@ index 46d56a2..b86d34c 100644 } } diff --git a/teamd/teamd.c b/teamd/teamd.c -index bf42347..221d71d 100644 +index 421e34d..33512a6 100644 --- a/teamd/teamd.c +++ b/teamd/teamd.c @@ -117,7 +117,9 @@ static void print_help(const struct teamd_context *ctx) { @@ -203,7 +203,7 @@ index 221803e..bd4dcc1 100644 struct teamd_port *tdport) { diff --git a/teamd/teamd_per_port.c b/teamd/teamd_per_port.c -index 166da57..03f8d63 100644 +index 166da57..cefd6c2 100644 --- a/teamd/teamd_per_port.c +++ b/teamd/teamd_per_port.c @@ -350,6 +350,12 @@ static int teamd_port_remove(struct teamd_context *ctx, @@ -220,7 +220,7 @@ index 166da57..03f8d63 100644 tdport->ifname, tdport->ifindex); err = team_port_remove(ctx->th, tdport->ifindex); diff --git a/teamd/teamd_runner_lacp.c b/teamd/teamd_runner_lacp.c -index 55abe88..f225fb2 100644 +index 955ef0c..782fc05 100644 --- a/teamd/teamd_runner_lacp.c +++ b/teamd/teamd_runner_lacp.c @@ -31,6 +31,7 @@ @@ -523,7 +523,7 @@ index 55abe88..f225fb2 100644 + /* the port was up before the WR. Trying to restore it */ + struct lacpdu lacpdu; + err = lacpdu_read(lacp_port, &lacpdu); -+ if (err) /* Can't read, so the port will start from scratch */ ++ if (err) /* Can't read, so the port will start from scratch */ + continue; + teamd_log_info("WR-mode. State of the LAG member port '%s' was restored.", + tdport->ifname); @@ -810,7 +810,7 @@ index 55abe88..f225fb2 100644 static const struct teamd_event_watch_ops lacp_event_watch_ops = { .hwaddr_changed = lacp_event_watch_hwaddr_changed, .port_hwaddr_changed = lacp_event_watch_port_hwaddr_changed, -@@ -1469,21 +1848,35 @@ static const struct teamd_event_watch_ops lacp_event_watch_ops = { +@@ -1469,21 +1848,36 @@ static const struct teamd_event_watch_ops lacp_event_watch_ops = { .port_changed = lacp_event_watch_port_changed, .admin_state_changed = lacp_event_watch_admin_state_changed, .refresh = lacp_event_watch_refresh, @@ -832,6 +832,7 @@ index 55abe88..f225fb2 100644 + if (lacp->wr.carrier_up) { + teamd_log_info("WR-mode. Starting in WR mode"); + } else { ++ stop_wr_mode(lacp); + teamd_log_info("WR-mode. Starting in normal mode. The LAG interface was down before restart"); + } + ctx->warm_start_mode = lacp->wr.carrier_up; @@ -851,7 +852,7 @@ index 55abe88..f225fb2 100644 return 0; } -@@ -1951,6 +2344,12 @@ static int lacp_init(struct teamd_context *ctx, void *priv) +@@ -1951,6 +2345,12 @@ static int lacp_init(struct teamd_context *ctx, void *priv) } lacp->ctx = ctx; @@ -864,7 +865,7 @@ index 55abe88..f225fb2 100644 err = teamd_hash_func_set(ctx); if (err) return err; -@@ -1992,10 +2391,13 @@ static void lacp_fini(struct teamd_context *ctx, void *priv) +@@ -1992,10 +2392,13 @@ static void lacp_fini(struct teamd_context *ctx, void *priv) { struct lacp *lacp = priv; @@ -880,5 +881,5 @@ index 55abe88..f225fb2 100644 const struct teamd_runner teamd_runner_lacp = { -- -2.17.1.windows.2 +2.17.1 diff --git a/src/libyang1/Makefile b/src/libyang1/Makefile index acdd686b7965..834893eb0bbe 100644 --- a/src/libyang1/Makefile +++ b/src/libyang1/Makefile @@ -28,7 +28,10 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : pushd libyang-$(LIBYANG1_VERSION) sed -i 's/set(LIBYANG_MAJOR_SOVERSION 1)/set(LIBYANG_MAJOR_SOVERSION 2)/' CMakeLists.txt sed -i 's/libyang1/libyang2/' debian/libyang1.install - dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) + # Enable large file support for 32-bit arch + echo 'add_definitions(-D_FILE_OFFSET_BITS=64)' >> CMakeLists.txt + + dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR) popd # Move the newly-built .deb packages to the destination directory diff --git a/src/linkmgrd b/src/linkmgrd new file mode 160000 index 000000000000..35f7d1c257b2 --- /dev/null +++ b/src/linkmgrd @@ -0,0 +1 @@ +Subproject commit 35f7d1c257b2ec62cb79a5f637c11f2dd9782cbe diff --git a/src/lldpd/Makefile b/src/lldpd/Makefile index fa997e3486c8..a336f1e989ae 100644 --- a/src/lldpd/Makefile +++ b/src/lldpd/Makefile @@ -35,7 +35,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : stg import -s ../patch/series # Build source and Debian packages - env "with_netlink_receive_bufsize=1024*1024" dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) + env "with_netlink_receive_bufsize=1024*1024" dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR) popd # Move the newly-built .deb packages to the destination directory diff --git a/src/lldpd/patch/0010-Ported-fix-for-length-exceeded-from-lldp-community.patch b/src/lldpd/patch/0010-Ported-fix-for-length-exceeded-from-lldp-community.patch new file mode 100644 index 000000000000..072790641206 --- /dev/null +++ b/src/lldpd/patch/0010-Ported-fix-for-length-exceeded-from-lldp-community.patch @@ -0,0 +1,35 @@ +From fdb789c348fdcde6d5ef8b837d7f33718bc0862b Mon Sep 17 00:00:00 2001 +From: sudhanshukumar22 +Date: Mon, 23 Nov 2020 20:47:28 -0800 +Subject: [PATCH] Ported fix for https://github.com/lldpd/lldpd/issues/408 from + community + +--- + src/lib/atom.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/lib/atom.c b/src/lib/atom.c +index f81d3bb..75c1275 100644 +--- a/src/lib/atom.c ++++ b/src/lib/atom.c +@@ -327,7 +327,7 @@ _lldpctl_do_something(lldpctl_conn_t *conn, + conn->state_data[0] = 0; + } + if (conn->state == state_send && +- (state_data == NULL || !strncmp(conn->state_data, state_data, sizeof(conn->state_data)))) { ++ (state_data == NULL || !strncmp(conn->state_data, state_data, sizeof(conn->state_data) - 1))) { + /* We need to send the currently built message */ + rc = lldpctl_send(conn); + if (rc < 0) +@@ -335,7 +335,7 @@ _lldpctl_do_something(lldpctl_conn_t *conn, + conn->state = state_recv; + } + if (conn->state == state_recv && +- (state_data == NULL || !strncmp(conn->state_data, state_data, sizeof(conn->state_data)))) { ++ (state_data == NULL || !strncmp(conn->state_data, state_data, sizeof(conn->state_data) - 1))) { + /* We need to receive the answer */ + while ((rc = ctl_msg_recv_unserialized(&conn->input_buffer, + &conn->input_buffer_len, +-- +2.12.2 + diff --git a/src/lldpd/patch/0011-fix-med-location-len.patch b/src/lldpd/patch/0011-fix-med-location-len.patch new file mode 100644 index 000000000000..2290a94442c1 --- /dev/null +++ b/src/lldpd/patch/0011-fix-med-location-len.patch @@ -0,0 +1,47 @@ +From e9bf329eee94d6d49a17da35aea189179aeed3c6 Mon Sep 17 00:00:00 2001 +From: sudhanshukumar22 +Date: Thu, 24 Dec 2020 09:27:49 -0800 +Subject: [PATCH] From 5c3479463a919193213213e2d8634c754c09aa51 Mon Sep 17 + 00:00:00 2001 From: Vincent Bernat Date: Sun, 6 Dec 2020 + 14:21:04 +0100 Subject: [PATCH] lib: fix LLDP-MED location parsing in + liblldpctl + +Some bounds were not checked correctly when parsing LLDP-MED civic +location fields. This triggers out-of-bound reads (no write) in +lldpcli, ultimately leading to a crash. + +Fix #420 +Signed-off-by: sudhanshukumar22 +--- + src/lib/atoms/med.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/src/lib/atoms/med.c b/src/lib/atoms/med.c +index e1b20fd..595dba4 100644 +--- a/src/lib/atoms/med.c ++++ b/src/lib/atoms/med.c +@@ -540,6 +540,7 @@ _lldpctl_atom_get_str_med_location(lldpctl_atom_t *atom, lldpctl_key_t key) + return NULL; + case lldpctl_k_med_location_country: + if (m->location->format != LLDP_MED_LOCFORMAT_CIVIC) break; ++ if (m->location->data_len < 4) return NULL; + value = _lldpctl_alloc_in_atom(atom, 3); + if (!value) return NULL; + memcpy(value, m->location->data + 2, 2); +@@ -732,8 +733,11 @@ _lldpctl_atom_iter_med_caelements_list(lldpctl_atom_t *atom) + { + struct _lldpctl_atom_med_caelements_list_t *plist = + (struct _lldpctl_atom_med_caelements_list_t *)atom; +- struct ca_iter *iter = _lldpctl_alloc_in_atom(atom, sizeof(struct ca_iter)); +- if (!iter) return NULL; ++ struct ca_iter *iter; ++ if (plist->parent->location->data_len < 4 || ++ *(uint8_t*)plist->parent->location->data < 3 || ++ !(iter = _lldpctl_alloc_in_atom(atom, sizeof(struct ca_iter)))) ++ return NULL; + iter->data = (uint8_t*)plist->parent->location->data + 4; + iter->data_len = *(uint8_t*)plist->parent->location->data - 3; + return (lldpctl_atom_iter_t*)iter; +-- +2.12.2 + diff --git a/src/lldpd/patch/0012-fix-recreate-socket-on-ifindex-change.patch b/src/lldpd/patch/0012-fix-recreate-socket-on-ifindex-change.patch new file mode 100644 index 000000000000..632abce54919 --- /dev/null +++ b/src/lldpd/patch/0012-fix-recreate-socket-on-ifindex-change.patch @@ -0,0 +1,82 @@ +diff --git a/src/daemon/interfaces-linux.c b/src/daemon/interfaces-linux.c +index a8280c8..a51440a 100644 +--- a/src/daemon/interfaces-linux.c ++++ b/src/daemon/interfaces-linux.c +@@ -775,7 +775,7 @@ iflinux_handle_bond(struct lldpd *cfg, struct interfaces_device_list *interfaces + created = 1; + } + if (hardware->h_flags) continue; +- if (hardware->h_ops != &bond_ops) { ++ if (hardware->h_ops != &bond_ops || hardware->h_ifindex_changed) { + if (!created) { + log_debug("interfaces", + "bond %s is converted from another type of interface", +@@ -794,7 +794,7 @@ iflinux_handle_bond(struct lldpd *cfg, struct interfaces_device_list *interfaces + } else bmaster = hardware->h_data; + bmaster->index = master->index; + strlcpy(bmaster->name, master->name, IFNAMSIZ); +- if (hardware->h_ops != &bond_ops) { ++ if (hardware->h_ops != &bond_ops || hardware->h_ifindex_changed) { + if (iface_bond_init(cfg, hardware) != 0) { + log_warn("interfaces", "unable to initialize %s", + hardware->h_ifname); +diff --git a/src/daemon/interfaces.c b/src/daemon/interfaces.c +index 3c6c255..58db018 100644 +--- a/src/daemon/interfaces.c ++++ b/src/daemon/interfaces.c +@@ -623,7 +623,7 @@ interfaces_helper_physical(struct lldpd *cfg, + } + if (hardware->h_flags) + continue; +- if (hardware->h_ops != ops) { ++ if (hardware->h_ops != ops || hardware->h_ifindex_changed) { + if (!created) { + log_debug("interfaces", + "interface %s is converted from another type of interface", +diff --git a/src/daemon/lldpd.c b/src/daemon/lldpd.c +index 1d92dd3..f3e82e5 100644 +--- a/src/daemon/lldpd.c ++++ b/src/daemon/lldpd.c +@@ -147,6 +147,12 @@ lldpd_get_hardware(struct lldpd *cfg, char *name, int index) + TAILQ_FOREACH(hardware, &cfg->g_hardware, h_entries) { + if (strcmp(hardware->h_ifname, name) == 0) { + if (hardware->h_flags == 0) { ++ if (hardware->h_ifindex != 0 && ++ hardware->h_ifindex != index) { ++ log_debug("interfaces", "%s changed index: from %d to %d", ++ hardware->h_ifname, hardware->h_ifindex, index); ++ hardware->h_ifindex_changed = 1; ++ } + hardware->h_ifindex = index; + break; + } +@@ -392,7 +398,8 @@ lldpd_reset_timer(struct lldpd *cfg) + } + + /* Compare with the previous value */ +- if (hardware->h_lport_previous && ++ if (!hardware->h_ifindex_changed && ++ hardware->h_lport_previous && + output_len == hardware->h_lport_previous_len && + !memcmp(output, hardware->h_lport_previous, output_len)) { + log_debug("localchassis", +@@ -402,6 +409,7 @@ lldpd_reset_timer(struct lldpd *cfg) + log_debug("localchassis", + "change detected for port %s, resetting its timer", + hardware->h_ifname); ++ hardware->h_ifindex_changed = 0; + levent_schedule_pdu(hardware); + } + +diff --git a/src/lldpd-structs.h b/src/lldpd-structs.h +index f6b03d7..213f306 100644 +--- a/src/lldpd-structs.h ++++ b/src/lldpd-structs.h +@@ -454,6 +454,7 @@ struct lldpd_hardware { + removed if this is left + to 0. */ + int h_ifindex; /* Interface index, used by SNMP */ ++ int h_ifindex_changed; /* Interface index has changed */ + char h_ifname[IFNAMSIZ]; /* Should be unique */ + u_int8_t h_lladdr[ETHER_ADDR_LEN]; + \ No newline at end of file diff --git a/src/lldpd/patch/series b/src/lldpd/patch/series index 419fbc96a16f..d0b9904751cc 100644 --- a/src/lldpd/patch/series +++ b/src/lldpd/patch/series @@ -3,3 +3,6 @@ 0004-lldpctl-put-a-lock-around-some-commands-to-avoid-rac.patch 0006-lib-fix-memory-leak.patch 0007-lib-fix-memory-leak-when-handling-I-O.patch +0010-Ported-fix-for-length-exceeded-from-lldp-community.patch +0011-fix-med-location-len.patch +0012-fix-recreate-socket-on-ifindex-change.patch diff --git a/src/lm-sensors/Makefile b/src/lm-sensors/Makefile index af080a8dba55..a5aa3ba7d885 100644 --- a/src/lm-sensors/Makefile +++ b/src/lm-sensors/Makefile @@ -25,7 +25,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : stg init stg import -s ../patch/series - DEB_BUILD_OPTIONS=nocheck PROG_EXTRA=sensord dpkg-buildpackage -us -uc -b -j$(SONIC_CONFIG_MAKE_JOBS) + DEB_BUILD_OPTIONS=nocheck PROG_EXTRA=sensord dpkg-buildpackage -us -uc -b -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR) popd mv $(DERIVED_TARGETS) $* $(DEST)/ diff --git a/src/monit/Makefile b/src/monit/Makefile index 4ad9edd79143..570f30cf60f8 100644 --- a/src/monit/Makefile +++ b/src/monit/Makefile @@ -24,7 +24,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : stg import -s ../patch/series # Build source and Debian packages - dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) + dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR) popd # Move the newly-built .deb packages to the destination directory diff --git a/src/mpdecimal/Makefile b/src/mpdecimal/Makefile index c4ef5b78b49c..b7f82ba702e5 100644 --- a/src/mpdecimal/Makefile +++ b/src/mpdecimal/Makefile @@ -14,7 +14,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : dpkg-source -x mpdecimal_$(MPDECIMAL_VERSION_FULL).dsc pushd mpdecimal-$(MPDECIMAL_VERSION) - dpkg-buildpackage -us -uc -b -j$(SONIC_CONFIG_MAKE_JOBS) + dpkg-buildpackage -us -uc -b -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR) popd mv $* $(DERIVED_TARGETS) $(DEST)/ diff --git a/src/ntp/Makefile b/src/ntp/Makefile index a128ed6e9967..6d96010be156 100644 --- a/src/ntp/Makefile +++ b/src/ntp/Makefile @@ -39,7 +39,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : sed -i 's/\/usr\/sbin\/ntpd {/\/usr\/sbin\/ntpd flags=(attach_disconnected complain) {/' debian/apparmor-profile # Build source and Debian packages with the symbols - dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) + dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR) popd diff --git a/src/openssh/Makefile b/src/openssh/Makefile index 888cdb28d168..be05c6ffd675 100644 --- a/src/openssh/Makefile +++ b/src/openssh/Makefile @@ -19,8 +19,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : stg import -s ../patch/series # Build package - sudo http_proxy=$(http_proxy) apt-get -y build-dep openssh - dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) + dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR) popd mv $(DERIVED_TARGETS) $* $(DEST)/ diff --git a/src/python3/.gitignore b/src/python3/.gitignore deleted file mode 100644 index a0991ff4402b..000000000000 --- a/src/python3/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -* -!.gitignore -!Makefile diff --git a/src/python3/Makefile b/src/python3/Makefile deleted file mode 100644 index c5d8c386c1b0..000000000000 --- a/src/python3/Makefile +++ /dev/null @@ -1,43 +0,0 @@ -.ONESHELL: -SHELL = /bin/bash -.SHELLFLAGS += -e - -PYTHON_VER=3.6.0 -PYTHON_DEB_VER=1 -PYTHON_PNAME=python3.6 - -MAIN_TARGET = lib$(PYTHON_PNAME)-minimal_$(PYTHON_VER)-$(PYTHON_DEB_VER)_$(CONFIGURED_ARCH).deb -DERIVED_TARGETS = lib$(PYTHON_PNAME)-stdlib_$(PYTHON_VER)-$(PYTHON_DEB_VER)_$(CONFIGURED_ARCH).deb \ - lib$(PYTHON_PNAME)_$(PYTHON_VER)-$(PYTHON_DEB_VER)_$(CONFIGURED_ARCH).deb \ - $(PYTHON_PNAME)-minimal_$(PYTHON_VER)-$(PYTHON_DEB_VER)_$(CONFIGURED_ARCH).deb \ - $(PYTHON_PNAME)_$(PYTHON_VER)-$(PYTHON_DEB_VER)_$(CONFIGURED_ARCH).deb \ - lib$(PYTHON_PNAME)-dev_$(PYTHON_VER)-$(PYTHON_DEB_VER)_$(CONFIGURED_ARCH).deb - #$(PYTHON_PNAME)-dev_$(PYTHON_VER)-$(PYTHON_DEB_VER)_$(CONFIGURED_ARCH).deb - -$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : - # Remove any stale files - rm -rf $(PYTHON_PNAME)-$(PYTHON_VER) - - ## Obtaining the python3 - wget 'https://sonicstorage.blob.core.windows.net/packages/$(PYTHON_PNAME)_$(PYTHON_VER).orig.tar.xz?sv=2015-04-05&sr=b&sig=d42Wh1CA9NZvlskhW4fpWcHVgc7N3IKhdFzyeO2zbRA%3D&se=2027-02-02T01%3A00%3A57Z&sp=r' -O $(PYTHON_PNAME)_$(PYTHON_VER).orig.tar.xz - wget 'https://sonicstorage.blob.core.windows.net/packages/$(PYTHON_PNAME)_$(PYTHON_VER)-$(PYTHON_DEB_VER).debian.tar.xz?sv=2015-04-05&sr=b&sig=KLX9pMJ3zpQvGBo6ZjzoZXgooMJRUUwMx8ZaTJtywK0%3D&se=2027-02-02T00%3A59%3A34Z&sp=r' -O $(PYTHON_PNAME)_$(PYTHON_VER)-$(PYTHON_DEB_VER).debian.tar.xz - wget 'https://sonicstorage.blob.core.windows.net/packages/$(PYTHON_PNAME)_$(PYTHON_VER)-$(PYTHON_DEB_VER).dsc?sv=2015-04-05&sr=b&sig=95s%2FC4vKY6bRKtkUTz%2BmHLqOllBOYbfP3zV5ayAuzSM%3D&se=2027-02-02T01%3A00%3A26Z&sp=r' -O $(PYTHON_PNAME)_$(PYTHON_VER)-$(PYTHON_DEB_VER).dsc - - ## Build - dpkg-source -x $(PYTHON_PNAME)_$(PYTHON_VER)-$(PYTHON_DEB_VER).dsc - pushd $(PYTHON_PNAME)-$(PYTHON_VER) - mk-build-deps - - # put a lock here because dpkg does not allow installing packages in parallel - while true; do - if mkdir $(DEST)/dpkg_lock &> /dev/null; then - { echo here && (sudo dpkg -i $(PYTHON_PNAME)-build-deps_$(PYTHON_VER)-$(PYTHON_DEB_VER)_$(CONFIGURED_ARCH).deb || sudo apt-get install -f) && rm -d $(DEST)/dpkg_lock && break; } || { rm -d $(DEST)/dpkg_lock && exit 1 ; } - fi - done - - dpkg-buildpackage -rfakeroot -us -uc -b -j$(SONIC_CONFIG_MAKE_JOBS) - popd - - cp $(DERIVED_TARGETS) $* $(DEST)/ - -$(addprefix $(DEST)/, $(DERIVED_TARGETS)): $(DEST)/% : $(DEST)/$(MAIN_TARGET) diff --git a/src/redis/Makefile b/src/redis/Makefile index e2d9e5828f5b..3a4fe3f4844c 100644 --- a/src/redis/Makefile +++ b/src/redis/Makefile @@ -22,7 +22,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : pushd redis-$(REDIS_VERSION) export ARCH="" - DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage -us -uc -b -j$(SONIC_CONFIG_MAKE_JOBS) + DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage -us -uc -b -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR) popd mv $(DERIVED_TARGETS) $* $(DEST)/ diff --git a/src/scapy b/src/scapy new file mode 160000 index 000000000000..8b63d73a1726 --- /dev/null +++ b/src/scapy @@ -0,0 +1 @@ +Subproject commit 8b63d73a17266bae2a61513ea97ded5283a7ccd3 diff --git a/src/scapy.patch/0001-Fix-version-string-generation-when-scapy-is-a-submod.patch b/src/scapy.patch/0001-Fix-version-string-generation-when-scapy-is-a-submod.patch new file mode 100644 index 000000000000..37f5253db0cc --- /dev/null +++ b/src/scapy.patch/0001-Fix-version-string-generation-when-scapy-is-a-submod.patch @@ -0,0 +1,27 @@ +From 988c808af6065b740006aef0e94496821d41fb98 Mon Sep 17 00:00:00 2001 +From: Stepan Blyschak +Date: Mon, 4 Apr 2022 09:57:39 +0000 +Subject: [PATCH] Fix version string generation when scapy is a submodule + +Signed-off-by: Stepan Blyschak +--- + scapy/__init__.py | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/scapy/__init__.py b/scapy/__init__.py +index f920151e..2adbea19 100644 +--- a/scapy/__init__.py ++++ b/scapy/__init__.py +@@ -42,9 +42,6 @@ def _version_from_git_describe(): + :raises CalledProcessError: if git is unavailable + :return: Scapy's latest tag + """ +- if not os.path.isdir(os.path.join(os.path.dirname(_SCAPY_PKG_DIR), '.git')): # noqa: E501 +- raise ValueError('not in scapy git repo') +- + def _git(cmd): + # type: (str) -> str + process = subprocess.Popen( +-- +2.14.1 + diff --git a/src/scapy.patch/0002-Check-if-the-network-interface-still-exists.patch b/src/scapy.patch/0002-Check-if-the-network-interface-still-exists.patch new file mode 100644 index 000000000000..c42c12e1a8aa --- /dev/null +++ b/src/scapy.patch/0002-Check-if-the-network-interface-still-exists.patch @@ -0,0 +1,42 @@ +From 7ffd8101c1e535f9c3225db2c319958a64412686 Mon Sep 17 00:00:00 2001 +From: Guillaume Valadon +Date: Tue, 14 Sep 2021 19:34:43 +0200 +Subject: [PATCH] Check if the network interface still exists + +Signed-off-by: Stepan Blyschak +--- + scapy/arch/linux.py | 18 +++++++++++------- + 1 file changed, 11 insertions(+), 7 deletions(-) + +diff --git a/scapy/arch/linux.py b/scapy/arch/linux.py +index 94fac8f0..b86e98ab 100644 +--- a/scapy/arch/linux.py ++++ b/scapy/arch/linux.py +@@ -414,13 +414,17 @@ class LinuxInterfaceProvider(InterfaceProvider): + data = {} + ips = in6_getifaddr() + for i in _get_if_list(): +- ifflags = struct.unpack("16xH14x", get_if(i, SIOCGIFFLAGS))[0] +- index = get_if_index(i) +- mac = scapy.utils.str2mac( +- get_if_raw_hwaddr(i, siocgifhwaddr=SIOCGIFHWADDR)[1] +- ) +- ip = None # type: Optional[str] +- ip = inet_ntop(socket.AF_INET, get_if_raw_addr(i)) ++ try: ++ ifflags = struct.unpack("16xH14x", get_if(i, SIOCGIFFLAGS))[0] ++ index = get_if_index(i) ++ mac = scapy.utils.str2mac( ++ get_if_raw_hwaddr(i, siocgifhwaddr=SIOCGIFHWADDR)[1] ++ ) ++ ip = None # type: Optional[str] ++ ip = inet_ntop(socket.AF_INET, get_if_raw_addr(i)) ++ except IOError: ++ warning("Interface %s does not exist!", i) ++ continue + if ip == "0.0.0.0": + ip = None + ifflags = FlagValue(ifflags, _iff_flags) +-- +2.14.1 + diff --git a/src/scapy.patch/0003-Do-not-resolve-the-interface-name-globally.patch b/src/scapy.patch/0003-Do-not-resolve-the-interface-name-globally.patch new file mode 100644 index 000000000000..daaa182b641a --- /dev/null +++ b/src/scapy.patch/0003-Do-not-resolve-the-interface-name-globally.patch @@ -0,0 +1,112 @@ +From 430f8942fe086553fcd6ad1444e886a343bfd658 Mon Sep 17 00:00:00 2001 +From: Guillaume Valadon +Date: Mon, 10 May 2021 12:02:32 +0200 +Subject: [PATCH] Do not resolve the interface name globally + +--- + doc/scapy/usage.rst | 2 ++ + scapy/sendrecv.py | 16 ++++++++-------- + test/regression.uts | 31 +++++++++++++++++++++++++++++-- + 3 files changed, 39 insertions(+), 10 deletions(-) + +diff --git a/doc/scapy/usage.rst b/doc/scapy/usage.rst +index 45266430fe..c6cb273f62 100644 +--- a/doc/scapy/usage.rst ++++ b/doc/scapy/usage.rst +@@ -711,6 +711,8 @@ We can sniff and do passive OS fingerprinting:: + + The number before the OS guess is the accuracy of the guess. + ++.. note:: When sniffing on several interfaces (e.g. ``iface=["eth0", ...]``), you can check what interface a packet was sniffed on by using the ``sniffed_on`` attribute, as shown in one of the examples above. ++ + Asynchronous Sniffing + --------------------- + +diff --git a/scapy/sendrecv.py b/scapy/sendrecv.py +index 503c6a3b15..f97fc4153e 100644 +--- a/scapy/sendrecv.py ++++ b/scapy/sendrecv.py +@@ -1108,24 +1108,24 @@ def _run(self, + quiet=quiet) + )] = offline + if not sniff_sockets or iface is not None: +- iface = resolve_iface(iface or conf.iface) +- if L2socket is None: +- L2socket = iface.l2listen() ++ # The _RL2 function resolves the L2socket of an iface ++ _RL2 = lambda i: L2socket or resolve_iface(i).l2listen() # type: Callable[[_GlobInterfaceType], Callable[..., SuperSocket]] # noqa: E501 + if isinstance(iface, list): + sniff_sockets.update( +- (L2socket(type=ETH_P_ALL, iface=ifname, **karg), ++ (_RL2(ifname)(type=ETH_P_ALL, iface=ifname, **karg), + ifname) + for ifname in iface + ) + elif isinstance(iface, dict): + sniff_sockets.update( +- (L2socket(type=ETH_P_ALL, iface=ifname, **karg), ++ (_RL2(ifname)(type=ETH_P_ALL, iface=ifname, **karg), + iflabel) + for ifname, iflabel in six.iteritems(iface) + ) + else: +- sniff_sockets[L2socket(type=ETH_P_ALL, iface=iface, +- **karg)] = iface ++ iface = iface or conf.iface ++ sniff_sockets[_RL2(iface)(type=ETH_P_ALL, iface=iface, ++ **karg)] = iface + + # Get select information from the sockets + _main_socket = next(iter(sniff_sockets)) +@@ -1248,7 +1248,7 @@ def stop(self, join=True): + return self.results + return None + else: +- raise Scapy_Exception("Not started !") ++ raise Scapy_Exception("Not running ! (check .running attr)") + + def join(self, *args, **kwargs): + # type: (*Any, **Any) -> None +diff --git a/test/regression.uts b/test/regression.uts +index 38644b7d75..972af2f8cd 100644 +--- a/test/regression.uts ++++ b/test/regression.uts +@@ -1379,9 +1379,36 @@ def _test(): + assert (ans.time - req.sent_time) >= 0 + assert (ans.time - req.sent_time) <= 1e-3 + +-retry_test(_test) ++try: ++ retry_test(_test) ++finally: ++ conf.L3socket = sock ++ ++= Test sniffing on multiple sockets ++~ netaccess needs_root sniff ++ ++# This test sniffs on the same interface twice at the same time, to ++# simulate sniffing on multiple interfaces. ++ ++iface = conf.route.route("www.google.com")[0] ++port = int(RandShort()) ++pkt = IP(dst="www.google.com")/TCP(sport=port, dport=80, flags="S") ++ ++def cb(): ++ sr1(pkt, timeout=3) ++ ++sniffer = AsyncSniffer(started_callback=cb, ++ iface=[iface, iface], ++ lfilter=lambda x: TCP in x and x[TCP].dport == port, ++ prn=lambda x: x.summary(), ++ count=2) ++sniffer.start() ++sniffer.join(timeout=3) ++ ++assert len(sniffer.results) == 2 + +-conf.L3socket = sock ++for pkt in sniffer.results: ++ assert pkt.sniffed_on == iface + + = Sending a TCP syn 'forever' at layer 2 and layer 3 + ~ netaccess IP diff --git a/src/scapy.patch/series b/src/scapy.patch/series new file mode 100644 index 000000000000..7b231848ac1f --- /dev/null +++ b/src/scapy.patch/series @@ -0,0 +1,3 @@ +0001-Fix-version-string-generation-when-scapy-is-a-submod.patch +0002-Check-if-the-network-interface-still-exists.patch +0003-Do-not-resolve-the-interface-name-globally.patch diff --git a/src/sflow/hsflowd/Makefile b/src/sflow/hsflowd/Makefile index 3a521bfba158..e29dbcc199bb 100644 --- a/src/sflow/hsflowd/Makefile +++ b/src/sflow/hsflowd/Makefile @@ -21,7 +21,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : chmod u+x debian/rules sed -i -e s/_VERSION_/$(HSFLOWD_VERSION)-$(HSFLOWD_SUBVERSION)/g debian/changelog - dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) --buildinfo-option=-u. --changes-option=-u. + dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR) --buildinfo-option=-u. --changes-option=-u. mv $(DERIVED_TARGET) $* $(DEST)/ popd diff --git a/src/sflow/psample/Makefile b/src/sflow/psample/Makefile index 3f03c249989a..bbdefde2289b 100644 --- a/src/sflow/psample/Makefile +++ b/src/sflow/psample/Makefile @@ -13,7 +13,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : pushd ./libpsample git checkout -b libpsample -f e48fad2 - dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) + dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR) popd mv $* $(DEST)/ diff --git a/src/sflow/sflowtool/Makefile b/src/sflow/sflowtool/Makefile index 10a3f2d24dea..5f2ad995a585 100644 --- a/src/sflow/sflowtool/Makefile +++ b/src/sflow/sflowtool/Makefile @@ -12,7 +12,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : pushd ./sflowtool git checkout -b sflowtool -f 6c2963b - dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) + dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR) popd mv $* $(DEST)/ diff --git a/src/smartmontools/Makefile b/src/smartmontools/Makefile index 4ac3d6ac315e..8f0f0695659f 100644 --- a/src/smartmontools/Makefile +++ b/src/smartmontools/Makefile @@ -13,7 +13,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : dpkg-source -x smartmontools_$(SMARTMONTOOLS_VERSION_FULL).dsc pushd smartmontools-$(SMARTMONTOOLS_VERSION_MAJOR) - dpkg-buildpackage -us -uc -b -j$(SONIC_CONFIG_MAKE_JOBS) + dpkg-buildpackage -us -uc -b -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR) popd mv $* $(DEST)/ diff --git a/src/snmpd/Makefile b/src/snmpd/Makefile index 76a62137b1ef..50d0303540d6 100644 --- a/src/snmpd/Makefile +++ b/src/snmpd/Makefile @@ -29,7 +29,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : stg init stg import -s ../patch-$(SNMPD_VERSION)/series - fakeroot debian/rules -j$(SONIC_CONFIG_MAKE_JOBS) binary + dpkg-buildpackage -rfakeroot -b -d -us -uc -j1 --admindir $(SONIC_DPKG_ADMINDIR) popd mv $(DERIVED_TARGETS) $* $(DEST)/ diff --git a/src/socat/Makefile b/src/socat/Makefile index 50c2c8d96d2d..cc2cd7238684 100644 --- a/src/socat/Makefile +++ b/src/socat/Makefile @@ -18,7 +18,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : # Build source and Debian packages pushd socat-1.7.3.1 patch -p0 < ../enable_readline.patch - dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) + dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) --admindir $(SONIC_DPKG_ADMINDIR) popd # Move the newly-built .deb packages to the destination directory diff --git a/src/sonic-bgpcfgd/bgpcfgd/main.py b/src/sonic-bgpcfgd/bgpcfgd/main.py index 360b54dc11aa..e94597eb29f5 100644 --- a/src/sonic-bgpcfgd/bgpcfgd/main.py +++ b/src/sonic-bgpcfgd/bgpcfgd/main.py @@ -2,6 +2,7 @@ import signal import sys import syslog +import threading import traceback from swsscommon import swsscommon @@ -9,12 +10,16 @@ from .config import ConfigMgr from .directory import Directory from .log import log_notice, log_crit +from .managers_advertise_rt import AdvertiseRouteMgr from .managers_allow_list import BGPAllowListMgr from .managers_bbr import BBRMgr from .managers_bgp import BGPPeerMgrBase from .managers_db import BGPDataBaseMgr from .managers_intf import InterfaceMgr from .managers_setsrc import ZebraSetSrc +from .managers_static_rt import StaticRouteMgr +from .static_rt_timer import StaticRouteTimer +from .managers_rm import RouteMapMgr from .runner import Runner, signal_handler from .template import TemplateFabric from .utils import read_constants @@ -24,6 +29,9 @@ def do_work(): """ Main function """ + st_rt_timer = StaticRouteTimer() + thr = threading.Thread(target = st_rt_timer.run) + thr.start() frr = FRR(["bgpd", "zebra", "staticd"]) frr.wait_for_daemons(seconds=20) # @@ -42,6 +50,7 @@ def do_work(): InterfaceMgr(common_objs, "CONFIG_DB", swsscommon.CFG_LOOPBACK_INTERFACE_TABLE_NAME), InterfaceMgr(common_objs, "CONFIG_DB", swsscommon.CFG_VLAN_INTF_TABLE_NAME), InterfaceMgr(common_objs, "CONFIG_DB", swsscommon.CFG_LAG_INTF_TABLE_NAME), + InterfaceMgr(common_objs, "CONFIG_DB", swsscommon.CFG_VLAN_SUB_INTF_TABLE_NAME), # State DB managers ZebraSetSrc(common_objs, "STATE_DB", swsscommon.STATE_INTERFACE_TABLE_NAME), # Peer Managers @@ -53,11 +62,18 @@ def do_work(): BGPAllowListMgr(common_objs, "CONFIG_DB", "BGP_ALLOWED_PREFIXES"), # BBR Manager BBRMgr(common_objs, "CONFIG_DB", "BGP_BBR"), + # Static Route Managers + StaticRouteMgr(common_objs, "CONFIG_DB", "STATIC_ROUTE"), + StaticRouteMgr(common_objs, "APPL_DB", "STATIC_ROUTE"), + # Route Advertisement Managers + AdvertiseRouteMgr(common_objs, "STATE_DB", swsscommon.STATE_ADVERTISE_NETWORK_TABLE_NAME), + RouteMapMgr(common_objs, "APPL_DB", swsscommon.APP_BGP_PROFILE_TABLE_NAME), ] runner = Runner(common_objs['cfg_mgr']) for mgr in managers: runner.add_manager(mgr) runner.run() + thr.join() def main(): diff --git a/src/sonic-bgpcfgd/bgpcfgd/managers_advertise_rt.py b/src/sonic-bgpcfgd/bgpcfgd/managers_advertise_rt.py new file mode 100644 index 000000000000..68c48b044f61 --- /dev/null +++ b/src/sonic-bgpcfgd/bgpcfgd/managers_advertise_rt.py @@ -0,0 +1,135 @@ +from .manager import Manager +from .template import TemplateFabric +from swsscommon import swsscommon +from .managers_rm import ROUTE_MAPS +import ipaddress +from .log import log_info, log_err, log_debug + + +class AdvertiseRouteMgr(Manager): + """ This class Advertises routes when ADVERTISE_NETWORK_TABLE in STATE_DB is updated """ + + def __init__(self, common_objs, db, table): + """ + Initialize the object + :param common_objs: common object dictionary + :param db: name of the db + :param table: name of the table in the db + """ + super(AdvertiseRouteMgr, self).__init__( + common_objs, + [], + db, + table, + ) + + self.directory.subscribe([("CONFIG_DB", swsscommon.CFG_DEVICE_METADATA_TABLE_NAME, "localhost/bgp_asn"),], self.on_bgp_asn_change) + self.advertised_routes = dict() + + + OP_DELETE = "DELETE" + OP_ADD = "ADD" + + def set_handler(self, key, data): + log_debug("AdvertiseRouteMgr:: set handler") + if not self.__set_handler_validate(key, data): + return True + vrf, ip_prefix = self.split_key(key) + self.add_route_advertisement(vrf, ip_prefix, data) + + return True + + def del_handler(self, key): + log_debug("AdvertiseRouteMgr:: del handler") + vrf, ip_prefix = self.split_key(key) + self.remove_route_advertisement(vrf, ip_prefix) + + def __set_handler_validate(self, key, data): + if data: + if ("profile" in data and data["profile"] in ROUTE_MAPS) or data == {"":""}: + """ + APP which config the data should be responsible to pass a valid IP prefix + """ + return True + + log_err("BGPAdvertiseRouteMgr:: Invalid data %s for advertised route %s" % (data, key)) + return False + + def add_route_advertisement(self, vrf, ip_prefix, data): + if self.directory.path_exist("CONFIG_DB", swsscommon.CFG_DEVICE_METADATA_TABLE_NAME, "localhost/bgp_asn"): + if not self.advertised_routes.get(vrf, dict()): + self.bgp_network_import_check_commands(vrf, self.OP_ADD) + self.advertise_route_commands(ip_prefix, vrf, self.OP_ADD, data) + + self.advertised_routes.setdefault(vrf, dict()).update({ip_prefix: data}) + + def remove_route_advertisement(self, vrf, ip_prefix): + if ip_prefix not in self.advertised_routes.get(vrf, dict()): + log_info("BGPAdvertiseRouteMgr:: %s|%s does not exist" % (vrf, ip_prefix)) + return + self.advertised_routes.get(vrf, dict()).pop(ip_prefix) + if not self.advertised_routes.get(vrf, dict()): + self.advertised_routes.pop(vrf, None) + + if self.directory.path_exist("CONFIG_DB", swsscommon.CFG_DEVICE_METADATA_TABLE_NAME, "localhost/bgp_asn"): + if not self.advertised_routes.get(vrf, dict()): + self.bgp_network_import_check_commands(vrf, self.OP_DELETE) + self.advertise_route_commands(ip_prefix, vrf, self.OP_DELETE) + + def advertise_route_commands(self, ip_prefix, vrf, op, data=None): + is_ipv6 = TemplateFabric.is_ipv6(ip_prefix) + bgp_asn = self.directory.get_slot("CONFIG_DB", swsscommon.CFG_DEVICE_METADATA_TABLE_NAME)["localhost"]["bgp_asn"] + + cmd_list = [] + if vrf == "default": + cmd_list.append("router bgp %s" % bgp_asn) + else: + cmd_list.append("router bgp %s vrf %s" % (bgp_asn, vrf)) + + cmd_list.append(" address-family %s unicast" % ("ipv6" if is_ipv6 else "ipv4")) + + if data and "profile" in data: + cmd_list.append(" network %s route-map %s" % (ip_prefix, "%s_RM" % data["profile"])) + log_debug( + "BGPAdvertiseRouteMgr:: Update bgp %s network %s with route-map %s" + % (bgp_asn, vrf + "|" + ip_prefix, "%s_RM" % data["profile"]) + ) + else: + cmd_list.append(" %snetwork %s" % ("no " if op == self.OP_DELETE else "", ip_prefix)) + log_debug( + "BGPAdvertiseRouteMgr:: %sbgp %s network %s" + % ("Remove " if op == self.OP_DELETE else "Update ", bgp_asn, vrf + "|" + ip_prefix) + ) + + self.cfg_mgr.push_list(cmd_list) + log_debug("BGPAdvertiseRouteMgr::Done") + + def bgp_network_import_check_commands(self, vrf, op): + bgp_asn = self.directory.get_slot("CONFIG_DB", swsscommon.CFG_DEVICE_METADATA_TABLE_NAME)["localhost"]["bgp_asn"] + cmd_list = [] + if vrf == "default": + cmd_list.append("router bgp %s" % bgp_asn) + else: + cmd_list.append("router bgp %s vrf %s" % (bgp_asn, vrf)) + cmd_list.append(" %sbgp network import-check" % ("" if op == self.OP_DELETE else "no ")) + + self.cfg_mgr.push_list(cmd_list) + + def on_bgp_asn_change(self): + if self.directory.path_exist("CONFIG_DB", swsscommon.CFG_DEVICE_METADATA_TABLE_NAME, "localhost/bgp_asn"): + for vrf, ip_prefixes in self.advertised_routes.items(): + self.bgp_network_import_check_commands(vrf, self.OP_ADD) + for ip_prefix in ip_prefixes: + self.add_route_advertisement(vrf, ip_prefix, ip_prefixes[ip_prefix]) + + @staticmethod + def split_key(key): + """ + Split key into vrf name and prefix. + :param key: key to split + :return: vrf name extracted from the key, ip prefix extracted from the key + """ + if "|" not in key: + return "default", key + else: + return tuple(key.split("|", 1)) diff --git a/src/sonic-bgpcfgd/bgpcfgd/managers_allow_list.py b/src/sonic-bgpcfgd/bgpcfgd/managers_allow_list.py index b58d8bb885c9..4bdd488fc2eb 100644 --- a/src/sonic-bgpcfgd/bgpcfgd/managers_allow_list.py +++ b/src/sonic-bgpcfgd/bgpcfgd/managers_allow_list.py @@ -2,6 +2,7 @@ Implementation of "allow-list" feature """ import re +import ipaddress from .log import log_debug, log_info, log_err, log_warn from .template import TemplateFabric @@ -13,12 +14,16 @@ class BGPAllowListMgr(Manager): ALLOW_ADDRESS_PL_NAME_TMPL = "ALLOW_ADDRESS_%d_%s" # template for a name for the ALLOW_ADDRESS prefix-list ??? EMPTY_COMMUNITY = "empty" PL_NAME_TMPL = "PL_ALLOW_LIST_DEPLOYMENT_ID_%d_COMMUNITY_%s_V%s" + PL_NAME_TMPL_WITH_NEIGH = "PL_ALLOW_LIST_DEPLOYMENT_ID_%d_NEIGHBOR_%s_COMMUNITY_%s_V%s" COMMUNITY_NAME_TMPL = "COMMUNITY_ALLOW_LIST_DEPLOYMENT_ID_%d_COMMUNITY_%s" + COMMUNITY_NAME_TMPL_WITH_NEIGH = "COMMUNITY_ALLOW_LIST_DEPLOYMENT_ID_%d_NEIGHBOR_%s_COMMUNITY_%s" RM_NAME_TMPL = "ALLOW_LIST_DEPLOYMENT_ID_%d_V%s" + RM_NAME_TMPL_WITH_NEIGH = "ALLOW_LIST_DEPLOYMENT_ID_%d_NEIGHBOR_%s_V%s" ROUTE_MAP_ENTRY_WITH_COMMUNITY_START = 10 ROUTE_MAP_ENTRY_WITH_COMMUNITY_END = 29990 ROUTE_MAP_ENTRY_WITHOUT_COMMUNITY_START = 30000 ROUTE_MAP_ENTRY_WITHOUT_COMMUNITY_END = 65530 + PREFIX_LIST_POS = 1 # the position of the ip prefix in the permit string. V4 = "v4" # constant for af enum: V4 V6 = "v6" # constant for af enum: V6 @@ -36,10 +41,9 @@ def __init__(self, common_objs, db, table): db, table, ) - self.cfg_mgr = common_objs["cfg_mgr"] - self.constants = common_objs["constants"] - self.key_re = re.compile(r"^DEPLOYMENT_ID\|\d+\|\S+$|^DEPLOYMENT_ID\|\d+$") + self.key_re = re.compile(r"^DEPLOYMENT_ID\|\d+\|\S+$|^DEPLOYMENT_ID\|\d+$|^DEPLOYMENT_ID\|\d+\|\S+\|NEIGHBOR_TYPE\|\S+$|^DEPLOYMENT_ID\|\d+\|NEIGHBOR_TYPE\|\S+") self.enabled = self.__get_enabled() + self.prefix_match_tag = self.__get_routemap_tag() self.__load_constant_lists() def set_handler(self, key, data): @@ -54,8 +58,14 @@ def set_handler(self, key, data): return True if not self.__set_handler_validate(key, data): return True - key = key.replace("DEPLOYMENT_ID|", "") - deployment_id, community_value = key.split('|', 1) if '|' in key else (key, BGPAllowListMgr.EMPTY_COMMUNITY) + if 'NEIGHBOR_TYPE' in key: + keys = key.split('|NEIGHBOR_TYPE|', 1) + deployment_id = keys[0].replace("DEPLOYMENT_ID|", "") + neighbor_type, community_value = keys[1].split('|', 1) if '|' in keys[1] else (keys[1], BGPAllowListMgr.EMPTY_COMMUNITY) + else: + key = key.replace("DEPLOYMENT_ID|", "") + deployment_id, community_value = key.split('|', 1) if '|' in key else (key, BGPAllowListMgr.EMPTY_COMMUNITY) + neighbor_type = '' deployment_id = int(deployment_id) prefixes_v4 = [] prefixes_v6 = [] @@ -63,7 +73,8 @@ def set_handler(self, key, data): prefixes_v4 = str(data['prefixes_v4']).split(",") if "prefixes_v6" in data: prefixes_v6 = str(data['prefixes_v6']).split(",") - self.__update_policy(deployment_id, community_value, prefixes_v4, prefixes_v6) + default_action_community = self.__get_default_action_community(data) + self.__update_policy(deployment_id, community_value, prefixes_v4, prefixes_v6, default_action_community, neighbor_type) return True def __set_handler_validate(self, key, data): @@ -83,19 +94,22 @@ def __set_handler_validate(self, key, data): prefixes_v6 = [] if "prefixes_v4" in data: prefixes_v4 = str(data["prefixes_v4"]).split(",") - if not all(TemplateFabric.is_ipv4(prefix) for prefix in prefixes_v4): + if not all(TemplateFabric.is_ipv4(re.split('ge|le', prefix)[0]) for prefix in prefixes_v4): arguments = "prefixes_v4", str(data["prefixes_v4"]) log_err("BGPAllowListMgr::Received BGP ALLOWED 'SET' message with invalid input[%s]:'%s'" % arguments) return False if "prefixes_v6" in data: prefixes_v6 = str(data["prefixes_v6"]).split(",") - if not all(TemplateFabric.is_ipv6(prefix) for prefix in prefixes_v6): + if not all(TemplateFabric.is_ipv6(re.split('ge|le', prefix)[0]) for prefix in prefixes_v6): arguments = "prefixes_v6", str(data["prefixes_v6"]) log_err("BGPAllowListMgr::Received BGP ALLOWED 'SET' message with invalid input[%s]:'%s'" % arguments) return False if not prefixes_v4 and not prefixes_v6: log_err("BGPAllowListMgr::Received BGP ALLOWED 'SET' message with no prefixes specified: %s" % str(data)) return False + if "default_action" in data and data["default_action"] != "permit" and data["default_action"] != "deny": + log_err("BGPAllowListMgr::Received BGP ALLOWED 'SET' message with invalid 'default_action' field: '%s'" % str(data)) + return False return True def del_handler(self, key): @@ -108,10 +122,18 @@ def del_handler(self, key): return if not self.__del_handler_validate(key): return - key = key.replace('DEPLOYMENT_ID|', '') - deployment_id, community = key.split('|', 1) if '|' in key else (key, BGPAllowListMgr.EMPTY_COMMUNITY) + + if 'NEIGHBOR_TYPE' in key: + keys = key.split('|NEIGHBOR_TYPE|', 1) + deployment_id = keys[0].replace("DEPLOYMENT_ID|", "") + neighbor_type, community_value = keys[1].split('|', 1) if '|' in keys[1] else (keys[1], BGPAllowListMgr.EMPTY_COMMUNITY) + else: + key = key.replace("DEPLOYMENT_ID|", "") + deployment_id, community_value = key.split('|', 1) if '|' in key else (key, BGPAllowListMgr.EMPTY_COMMUNITY) + neighbor_type = '' + deployment_id = int(deployment_id) - self.__remove_policy(deployment_id, community) + self.__remove_policy(deployment_id, community_value, neighbor_type) def __del_handler_validate(self, key): """ @@ -124,21 +146,23 @@ def __del_handler_validate(self, key): return False return True - def __update_policy(self, deployment_id, community_value, prefixes_v4, prefixes_v6): + def __update_policy(self, deployment_id, community_value, prefixes_v4, prefixes_v6, default_action, neighbor_type): """ Update "allow list" policy with parameters :param deployment_id: deployment id which policy will be changed :param community_value: community value to match for the updated policy :param prefixes_v4: a list of v4 prefixes for the updated policy :param prefixes_v6: a list of v6 prefixes for the updated policy + :param default_action: the default action for the policy. should be either 'permit' or 'deny' """ # update all related entries with the information - info = deployment_id, community_value, str(prefixes_v4), str(prefixes_v6) + info = deployment_id, community_value, str(prefixes_v4), str(prefixes_v6), neighbor_type msg = "BGPAllowListMgr::Updating 'Allow list' policy." msg += " deployment_id '%s'. community: '%s'" msg += " prefix_v4 '%s'. prefix_v6: '%s'" + msg += " neighbor_type %s" log_info(msg % info) - names = self.__generate_names(deployment_id, community_value) + names = self.__generate_names(deployment_id, community_value, neighbor_type) self.cfg_mgr.update() cmds = [] cmds += self.__update_prefix_list(self.V4, names['pl_v4'], prefixes_v4) @@ -146,16 +170,18 @@ def __update_policy(self, deployment_id, community_value, prefixes_v4, prefixes_ cmds += self.__update_community(names['community'], community_value) cmds += self.__update_allow_route_map_entry(self.V4, names['pl_v4'], names['community'], names['rm_v4']) cmds += self.__update_allow_route_map_entry(self.V6, names['pl_v6'], names['community'], names['rm_v6']) + cmds += self.__update_default_route_map_entry(names['rm_v4'], default_action) + cmds += self.__update_default_route_map_entry(names['rm_v6'], default_action) if cmds: self.cfg_mgr.push_list(cmds) - peer_groups = self.__find_peer_group_by_deployment_id(deployment_id) + peer_groups = self.__find_peer_group(deployment_id, neighbor_type) self.cfg_mgr.restart_peer_groups(peer_groups) log_debug("BGPAllowListMgr::__update_policy. The peers configuration scheduled for updates") else: log_debug("BGPAllowListMgr::__update_policy. Nothing to update") log_info("BGPAllowListMgr::Done") - def __remove_policy(self, deployment_id, community_value): + def __remove_policy(self, deployment_id, community_value, neighbor_type): """ Remove "allow list" policy for given deployment_id and community_value :param deployment_id: deployment id which policy will be removed @@ -168,7 +194,8 @@ def __remove_policy(self, deployment_id, community_value): msg += " deployment_id '%s'. community: '%s'" log_info(msg % info) - names = self.__generate_names(deployment_id, community_value) + default_action = self.__get_default_action_community() + names = self.__generate_names(deployment_id, community_value, neighbor_type) self.cfg_mgr.update() cmds = [] cmds += self.__remove_allow_route_map_entry(self.V4, names['pl_v4'], names['community'], names['rm_v4']) @@ -176,9 +203,11 @@ def __remove_policy(self, deployment_id, community_value): cmds += self.__remove_prefix_list(self.V4, names['pl_v4']) cmds += self.__remove_prefix_list(self.V6, names['pl_v6']) cmds += self.__remove_community(names['community']) + cmds += self.__update_default_route_map_entry(names['rm_v4'], default_action) + cmds += self.__update_default_route_map_entry(names['rm_v6'], default_action) if cmds: self.cfg_mgr.push_list(cmds) - peer_groups = self.__find_peer_group_by_deployment_id(deployment_id) + peer_groups = self.__find_peer_group(deployment_id, neighbor_type) self.cfg_mgr.restart_peer_groups(peer_groups) log_debug("BGPAllowListMgr::__remove_policy. 'Allow list' policy was scheduled for removal") else: @@ -186,26 +215,42 @@ def __remove_policy(self, deployment_id, community_value): log_info('BGPAllowListMgr::Done') @staticmethod - def __generate_names(deployment_id, community_value): + def __generate_names(deployment_id, community_value, neighbor_type): """ Generate prefix-list names for a given peer_ip and community value :param deployment_id: deployment_id for which we're going to filter prefixes :param community_value: community, which we want to use to filter prefixes :return: a dictionary with names """ - if community_value == BGPAllowListMgr.EMPTY_COMMUNITY: - community_name = BGPAllowListMgr.EMPTY_COMMUNITY + if not neighbor_type: + if community_value == BGPAllowListMgr.EMPTY_COMMUNITY: + community_name = BGPAllowListMgr.EMPTY_COMMUNITY + else: + community_name = BGPAllowListMgr.COMMUNITY_NAME_TMPL % (deployment_id, community_value) + names = { + "pl_v4": BGPAllowListMgr.PL_NAME_TMPL % (deployment_id, community_value, '4'), + "pl_v6": BGPAllowListMgr.PL_NAME_TMPL % (deployment_id, community_value, '6'), + "rm_v4": BGPAllowListMgr.RM_NAME_TMPL % (deployment_id, '4'), + "rm_v6": BGPAllowListMgr.RM_NAME_TMPL % (deployment_id, '6'), + "community": community_name, + 'neigh_type': neighbor_type, + } + arguments = deployment_id, community_value, str(names) + log_debug("BGPAllowListMgr::__generate_names. deployment_id: %d, community: %s. names: %s" % arguments) else: - community_name = BGPAllowListMgr.COMMUNITY_NAME_TMPL % (deployment_id, community_value) - names = { - "pl_v4": BGPAllowListMgr.PL_NAME_TMPL % (deployment_id, community_value, '4'), - "pl_v6": BGPAllowListMgr.PL_NAME_TMPL % (deployment_id, community_value, '6'), - "rm_v4": BGPAllowListMgr.RM_NAME_TMPL % (deployment_id, '4'), - "rm_v6": BGPAllowListMgr.RM_NAME_TMPL % (deployment_id, '6'), - "community": community_name, - } - arguments = deployment_id, community_value, str(names) - log_debug("BGPAllowListMgr::__generate_names. deployment_id: %d, community: %s. names: %s" % arguments) + if community_value == BGPAllowListMgr.EMPTY_COMMUNITY: + community_name = BGPAllowListMgr.EMPTY_COMMUNITY + else: + community_name = BGPAllowListMgr.COMMUNITY_NAME_TMPL_WITH_NEIGH % (deployment_id, neighbor_type, community_value) + names = { + "pl_v4": BGPAllowListMgr.PL_NAME_TMPL_WITH_NEIGH % (deployment_id, neighbor_type, community_value, '4'), + "pl_v6": BGPAllowListMgr.PL_NAME_TMPL_WITH_NEIGH % (deployment_id, neighbor_type, community_value, '6'), + "rm_v4": BGPAllowListMgr.RM_NAME_TMPL_WITH_NEIGH % (deployment_id, neighbor_type, '4'), + "rm_v6": BGPAllowListMgr.RM_NAME_TMPL_WITH_NEIGH % (deployment_id, neighbor_type, '6'), + "community": community_name, + } + arguments = deployment_id, neighbor_type, community_value, str(names) + log_debug("BGPAllowListMgr::__generate_names. deployment_id: %d, neighbor_type: %s, community: %s. names: %s" % arguments) return names def __update_prefix_list(self, af, pl_name, allow_list): @@ -220,6 +265,12 @@ def __update_prefix_list(self, af, pl_name, allow_list): constant_list = self.__get_constant_list(af) allow_list = self.__to_prefix_list(af, allow_list) log_debug("BGPAllowListMgr::__update_prefix_list. af='%s' prefix-list name=%s" % (af, pl_name)) + ''' + Need to check exist and equality of the allowed prefix list. + A. If exist and equal, no operation needed. + B. If exist but not equal, first delete then add prefix based on the data from condig db and constants. + C. If non-exist, directly add prefix based on the data from condig db and constants. + ''' exist, correct = self.__is_prefix_list_valid(af, pl_name, allow_list, constant_list) if correct: log_debug("BGPAllowListMgr::__update_prefix_list. the prefix-list '%s' exists and correct" % pl_name) @@ -229,7 +280,7 @@ def __update_prefix_list(self, af, pl_name, allow_list): seq_no = 10 if exist: cmds.append('no %s prefix-list %s' % (family, pl_name)) - for entry in constant_list + allow_list: + for entry in self.__normalize_ipnetwork(af, constant_list + allow_list): cmds.append('%s prefix-list %s seq %d %s' % (family, pl_name, seq_no, entry)) seq_no += 10 return cmds @@ -250,6 +301,24 @@ def __remove_prefix_list(self, af, pl_name): family = self.__af_to_family(af) return ["no %s prefix-list %s" % (family, pl_name)] + def __normalize_ipnetwork(self, af, allow_prefix_list): + ''' + Normalize IPv6 addresses + for example: + 2001:cdba:0000:0000:0000:0000:3257:9652 + 2001:cdba:0:0:0:0:3257:9652 + 2001:cdba::3257:9652 + after normalize, all would be normalized to + 2001:cdba::3257:9652 + ''' + normalize_list = [] + for allow_item in allow_prefix_list: + tmp_list = allow_item.split(' ') + if af == self.V6: + tmp_list[self.PREFIX_LIST_POS] = str(ipaddress.IPv6Network(tmp_list[self.PREFIX_LIST_POS])) + normalize_list.append(' '.join(tmp_list)) + return normalize_list + def __is_prefix_list_valid(self, af, pl_name, allow_list, constant_list): """ Check that a prefix list exists and it has valid entries @@ -258,7 +327,8 @@ def __is_prefix_list_valid(self, af, pl_name, allow_list, constant_list): :param allow_list: a prefix-list which must be a part of the valid prefix list :param constant_list: a constant list which must be on top of each "allow" prefix list on the device :return: a tuple. The first element of the tuple has True if the prefix-list exists, False otherwise, - The second element of the tuple has True if the prefix-list contains correct entries, False if not + The second element of the tuple has True if allow prefix list in running configuraiton is + equal with ones in config db + constants, False if not """ assert af == self.V4 or af == self.V6 family = self.__af_to_family(af) @@ -266,20 +336,18 @@ def __is_prefix_list_valid(self, af, pl_name, allow_list, constant_list): conf = self.cfg_mgr.get_text() if not any(line.strip().startswith(match_string) for line in conf): return False, False # if the prefix list is not exists, it is not correct - constant_set = set(constant_list) - allow_set = set(allow_list) + expect_set = set(self.__normalize_ipnetwork(af, constant_list)) + expect_set.update(set(self.__normalize_ipnetwork(af, allow_list))) + + config_list = [] for line in conf: if line.startswith(match_string): found = line[len(match_string):].strip().split(' ') rule = " ".join(found[1:]) - if rule in constant_set: - constant_set.discard(rule) - elif rule in allow_set: - if constant_set: - return True, False # Not everything from constant set is presented - else: - allow_set.discard(rule) - return True, len(allow_set) == 0 # allow_set should be presented all + config_list.append(rule) + + # Return double Ture, when running configuraiton is identical with config db + constants. + return True, expect_set == set(self.__normalize_ipnetwork(af, config_list)) def __update_community(self, community_name, community_value): """ @@ -363,8 +431,56 @@ def __update_allow_route_map_entry(self, af, allow_address_pl_name, community_na ] if not community_name.endswith(self.EMPTY_COMMUNITY): cmds.append(" match community %s" % community_name) + elif self.prefix_match_tag: + cmds.append(" set tag %s" % self.prefix_match_tag) return cmds + def __update_default_route_map_entry(self, route_map_name, default_action_community): + """ + Add or update default action rule for the route-map. + Default action rule is hardcoded into route-map permit 65535 + :param route_map_name: name of the target route_map + :param default_action_community: community value to mark not-matched prefixes + """ + info = route_map_name, default_action_community + log_debug("BGPAllowListMgr::__update_default_route_map_entry. rm='%s' set_community='%s'" % info) + current_default_action_value = self.__parse_default_action_route_map_entry(route_map_name) + if current_default_action_value != default_action_community: + return [ + 'route-map %s permit 65535' % route_map_name, + ' set community %s additive' % default_action_community + ] + else: + return [] + + def __parse_default_action_route_map_entry(self, route_map_name): + """ + Parse default-action route-map entry + :param route_map_name: Name of the route-map to parse + :return: a community value used for default action + """ + log_debug("BGPAllowListMgr::__parse_default_action_route_map_entries. rm='%s'" % route_map_name) + match_string = 'route-map %s permit 65535' % route_map_name + match_community = re.compile(r'^set community (\S+) additive$') + inside_route_map = False + community_value = "" + conf = self.cfg_mgr.get_text() + for line in conf + [""]: + s_line = line.strip() + if inside_route_map: + matched = match_community.match(s_line) + if matched: + community_value = matched.group(1) + break + else: + log_err("BGPAllowListMgr::Found incomplete route-map '%s' entry. seq_no=65535" % route_map_name) + inside_route_map = False + elif s_line == match_string: + inside_route_map = True + if community_value == "": + log_err("BGPAllowListMgr::Default action community value is not found. route-map '%s' entry. seq_no=65535" % route_map_name) + return community_value + def __remove_allow_route_map_entry(self, af, allow_address_pl_name, community_name, route_map_name): """ Add or update a "Allow address" route-map entry with the parameters @@ -533,8 +649,22 @@ def __get_route_map_calls(self, rms): inside_name = result.group(1) return rm_2_call + def __get_routemap_tag(self): + """ + Find if any user define tag is provided to be used when allow prefifx list is matched + :return: string: prefix mix tag if define in constants.yml else None + """ + prefix_match_tag = None + if 'bgp' in self.constants and \ + 'allow_list' in self.constants["bgp"] and \ + 'prefix_match_tag' in \ + self.constants["bgp"]["allow_list"]: + prefix_match_tag = \ + self.constants["bgp"]["allow_list"]["prefix_match_tag"] + return prefix_match_tag + @staticmethod - def __get_peer_group_to_restart(deployment_id, pg_2_rm, rm_2_call): + def __get_peer_group_to_restart(deployment_id, pg_2_rm, rm_2_call, neighbor_type): """ Get peer_groups which are assigned to deployment_id :deployment_id: deployment_id number @@ -543,14 +673,17 @@ def __get_peer_group_to_restart(deployment_id, pg_2_rm, rm_2_call): :rm_2_call: a dictionary: key - name of a route-map, value - name of a route-map call defined for the route-map """ ret = set() - target_allow_list_prefix = 'ALLOW_LIST_DEPLOYMENT_ID_%d_V' % deployment_id + if not neighbor_type: + target_allow_list_prefix = 'ALLOW_LIST_DEPLOYMENT_ID_%d_V' % deployment_id + else: + target_allow_list_prefix = 'ALLOW_LIST_DEPLOYMENT_ID_%d_NEIGHBOR_%s_V' % (deployment_id, neighbor_type) for peer_group, route_map in pg_2_rm.items(): if route_map in rm_2_call: if rm_2_call[route_map].startswith(target_allow_list_prefix): ret.add(peer_group) return list(ret) - def __find_peer_group_by_deployment_id(self, deployment_id): + def __find_peer_group(self, deployment_id, neighbor_type): """ Deduce peer-group names which are connected to devices with requested deployment_id :param deployment_id: deployment_id number @@ -560,7 +693,7 @@ def __find_peer_group_by_deployment_id(self, deployment_id): peer_groups = self.__extract_peer_group_names() pg_2_rm = self.__get_peer_group_to_route_map(peer_groups) rm_2_call = self.__get_route_map_calls(set(pg_2_rm.values())) - ret = self.__get_peer_group_to_restart(deployment_id, pg_2_rm, rm_2_call) + ret = self.__get_peer_group_to_restart(deployment_id, pg_2_rm, rm_2_call, neighbor_type) return list(ret) def __get_enabled(self): @@ -610,11 +743,14 @@ def __to_prefix_list(self, af, allow_list): res = [] prefix_mask_default = 32 if af == self.V4 else 128 for prefix in allow_list: - prefix_mask = int(prefix.split("/")[1]) - if prefix_mask == prefix_mask_default: + if 'le' in prefix or 'ge' in prefix: res.append("permit %s" % prefix) else: - res.append("permit %s le %d" % (prefix, prefix_mask_default)) + prefix_mask = int(prefix.split("/")[1]) + if prefix_mask == prefix_mask_default: + res.append("permit %s" % prefix) + else: + res.append("permit %s le %d" % (prefix, prefix_mask_default)) return res def __af_to_family(self, af): @@ -624,3 +760,26 @@ def __af_to_family(self, af): :return: prefix list ip family """ return 'ip' if af == self.V4 else 'ipv6' + + def __get_default_action_community(self, data=None): + """ + Determine the default action community based on the request. + If request doesn't contain "default_action" field - the default_action value + from the constants is being used + :param data: SET request data + :return: returns community value for "default_action" + """ + drop_community = self.constants["bgp"]["allow_list"]["drop_community"] + if data and "default_action" in data: + if data["default_action"] == "deny": + return "no-export" + else: # "permit" + return drop_community + else: + if "default_action" in self.constants["bgp"]["allow_list"]: + if self.constants["bgp"]["allow_list"]["default_action"].strip() == "deny": + return "no-export" + else: + return drop_community + else: + return drop_community diff --git a/src/sonic-bgpcfgd/bgpcfgd/managers_bbr.py b/src/sonic-bgpcfgd/bgpcfgd/managers_bbr.py index 27f3646ac421..0e82d0a4b6d5 100644 --- a/src/sonic-bgpcfgd/bgpcfgd/managers_bbr.py +++ b/src/sonic-bgpcfgd/bgpcfgd/managers_bbr.py @@ -113,9 +113,10 @@ def __set_prepare_config(self, status): for af in ["ipv4", "ipv6"]: cmds.append(" address-family %s" % af) for pg_name in sorted(self.bbr_enabled_pgs.keys()): - if pg_name in available_peer_groups and af in self.bbr_enabled_pgs[pg_name]: - cmds.append(" %sneighbor %s allowas-in 1" % (prefix_of_commands, pg_name)) - peer_groups_to_restart.add(pg_name) + for peer_group_name in available_peer_groups: + if peer_group_name.startswith(pg_name) and af in self.bbr_enabled_pgs[pg_name]: + cmds.append(" %sneighbor %s allowas-in 1" % (prefix_of_commands, peer_group_name)) + peer_groups_to_restart.add(peer_group_name) return cmds, list(peer_groups_to_restart) def __get_available_peer_groups(self): diff --git a/src/sonic-bgpcfgd/bgpcfgd/managers_bgp.py b/src/sonic-bgpcfgd/bgpcfgd/managers_bgp.py index f6108bfb61c4..3ab7dba4f612 100644 --- a/src/sonic-bgpcfgd/bgpcfgd/managers_bgp.py +++ b/src/sonic-bgpcfgd/bgpcfgd/managers_bgp.py @@ -191,6 +191,8 @@ def add_peer(self, vrf, nbr, data): 'neighbor_addr': nbr, 'bgp_session': data, 'loopback0_ipv4': lo0_ipv4, + 'CONFIG_DB__LOOPBACK_INTERFACE':{ tuple(key.split('|')) : {} for key in self.directory.get_slot("CONFIG_DB", swsscommon.CFG_LOOPBACK_INTERFACE_TABLE_NAME) + if '|' in key } } if self.check_neig_meta: neigmeta = self.directory.get_slot("CONFIG_DB", swsscommon.CFG_DEVICE_NEIGHBOR_METADATA_TABLE_NAME) @@ -384,4 +386,4 @@ def load_peers(): log_crit("Can't read vrf '%s' neighbors: %s" % (vrf, str(err))) raise Exception("Can't read vrf '%s' neighbors: %s" % (vrf, str(err))) - return peers \ No newline at end of file + return peers diff --git a/src/sonic-bgpcfgd/bgpcfgd/managers_intf.py b/src/sonic-bgpcfgd/bgpcfgd/managers_intf.py index ef4958ad9207..c633c43046e0 100644 --- a/src/sonic-bgpcfgd/bgpcfgd/managers_intf.py +++ b/src/sonic-bgpcfgd/bgpcfgd/managers_intf.py @@ -30,7 +30,7 @@ def set_handler(self, key, data): try: network = netaddr.IPNetwork(str(network_str)) except (netaddr.NotRegisteredError, netaddr.AddrFormatError, netaddr.AddrConversionError): - log_warn("Subnet '%s' format is wrong for interface '%s'" % (network_str, data["interface"])) + log_warn("Subnet '%s' format is wrong for interface '%s'" % (network_str, interface_name)) return True data["interface"] = interface_name data["prefixlen"] = str(network.prefixlen) diff --git a/src/sonic-bgpcfgd/bgpcfgd/managers_rm.py b/src/sonic-bgpcfgd/bgpcfgd/managers_rm.py new file mode 100644 index 000000000000..35a3f864d55c --- /dev/null +++ b/src/sonic-bgpcfgd/bgpcfgd/managers_rm.py @@ -0,0 +1,99 @@ +from .manager import Manager +from swsscommon import swsscommon +from .log import log_err, log_debug + +ROUTE_MAPS = ["FROM_SDN_SLB_ROUTES"] +FROM_SDN_SLB_DEPLOYMENT_ID = '2' + +class RouteMapMgr(Manager): + """This class add route-map when BGP_PROFILE_TABLE in APPL_DB is updated""" + + def __init__(self, common_objs, db, table): + """ + Initialize the object + :param common_objs: common object dictionary + :param db: name of the db + :param table: name of the table in the db + """ + super(RouteMapMgr, self).__init__( + common_objs, + [], + db, + table, + ) + + def set_handler(self, key, data): + log_debug("BGPRouteMapMgr:: set handler") + """Only need a name as the key, and community id as the data""" + if not self.__set_handler_validate(key, data): + return True + + self.__update_rm(key, data) + return True + + def del_handler(self, key): + log_debug("BGPRouteMapMgr:: del handler") + if not self.__del_handler_validate(key): + return + self.__remove_rm(key) + + def __remove_rm(self, rm): + cmds = ["no route-map %s permit 100" % ("%s_RM" % rm)] + log_debug("BGPRouteMapMgr:: remove route-map %s" % ("%s_RM" % rm)) + self.cfg_mgr.push_list(cmds) + log_debug("BGPRouteMapMgr::Done") + + def __set_handler_validate(self, key, data): + if key not in ROUTE_MAPS: + log_err("BGPRouteMapMgr:: Invalid key for route-map %s" % key) + return False + + if not data: + log_err("BGPRouteMapMgr:: data is None") + return False + community_ids = data["community_id"].split(":") + try: + if ( + len(community_ids) != 2 + or int(community_ids[0]) not in range(0, 65536) + or int(community_ids[1]) not in range(0, 65536) + ): + log_err("BGPRouteMapMgr:: data %s doesn't include valid community id %s" % (data, community_ids)) + return False + except ValueError: + log_err("BGPRouteMapMgr:: data %s includes illegal input" % (data)) + return False + + return True + + def __del_handler_validate(self, key): + if key not in ROUTE_MAPS: + log_err("BGPRouteMapMgr:: Invalid key for route-map %s" % key) + return False + return True + + def __read_asn(self): + if not 'deployment_id_asn_map' in self.constants: + log_err("BGPRouteMapMgr:: 'deployment_id_asn_map' key is not found in constants") + return None + if FROM_SDN_SLB_DEPLOYMENT_ID in self.constants['deployment_id_asn_map']: + return self.constants['deployment_id_asn_map'][FROM_SDN_SLB_DEPLOYMENT_ID] + log_err("BGPRouteMapMgr:: deployment id %s is not found in constants" % (FROM_SDN_SLB_DEPLOYMENT_ID)) + return None + + def __update_rm(self, rm, data): + cmds = [] + if rm == "FROM_SDN_SLB_ROUTES": + cmds.append("route-map %s permit 100" % ("%s_RM" % rm)) + bgp_asn = self.__read_asn() + if bgp_asn is None or bgp_asn is '': + log_debug("BGPRouteMapMgr:: update route-map %s, but asn is not found in constants" % ("%s_RM" % rm)) + return + cmds.append(" set as-path prepend %s %s" % (bgp_asn, bgp_asn)) + cmds.append(" set community %s" % data["community_id"]) + cmds.append(" set origin incomplete") + log_debug("BGPRouteMapMgr:: update route-map %s community %s origin incomplete as-path prepend %s %s" % \ + ("%s_RM" % rm, data["community_id"], bgp_asn, bgp_asn)) + if cmds: + self.cfg_mgr.push_list(cmds) + log_debug("BGPRouteMapMgr::Done") diff --git a/src/sonic-bgpcfgd/bgpcfgd/managers_static_rt.py b/src/sonic-bgpcfgd/bgpcfgd/managers_static_rt.py new file mode 100644 index 000000000000..e479b8edf9de --- /dev/null +++ b/src/sonic-bgpcfgd/bgpcfgd/managers_static_rt.py @@ -0,0 +1,239 @@ +import traceback +from .log import log_crit, log_err, log_debug +from .manager import Manager +from .template import TemplateFabric +import socket +from swsscommon import swsscommon +from ipaddress import ip_network, IPv4Network + +class StaticRouteMgr(Manager): + """ This class updates static routes when STATIC_ROUTE table is updated """ + def __init__(self, common_objs, db, table): + """ + Initialize the object + :param common_objs: common object dictionary + :param db: name of the db + :param table: name of the table in the db + """ + super(StaticRouteMgr, self).__init__( + common_objs, + [], + db, + table, + ) + + self.directory.subscribe([("CONFIG_DB", swsscommon.CFG_DEVICE_METADATA_TABLE_NAME, "localhost/bgp_asn"),], self.on_bgp_asn_change) + self.static_routes = {} + self.vrf_pending_redistribution = set() + + OP_DELETE = 'DELETE' + OP_ADD = 'ADD' + + def set_handler(self, key, data): + vrf, ip_prefix = self.split_key(key) + is_ipv6 = TemplateFabric.is_ipv6(ip_prefix) + + arg_list = lambda v: v.split(',') if len(v.strip()) != 0 else None + bkh_list = arg_list(data['blackhole']) if 'blackhole' in data else None + nh_list = arg_list(data['nexthop']) if 'nexthop' in data else None + intf_list = arg_list(data['ifname']) if 'ifname' in data else None + dist_list = arg_list(data['distance']) if 'distance' in data else None + nh_vrf_list = arg_list(data['nexthop-vrf']) if 'nexthop-vrf' in data else None + + try: + ip_nh_set = IpNextHopSet(is_ipv6, bkh_list, nh_list, intf_list, dist_list, nh_vrf_list) + cur_nh_set = self.static_routes.get(vrf, {}).get(ip_prefix, IpNextHopSet(is_ipv6)) + cmd_list = self.static_route_commands(ip_nh_set, cur_nh_set, ip_prefix, vrf) + except Exception as exc: + log_crit("Got an exception %s: Traceback: %s" % (str(exc), traceback.format_exc())) + return False + + # Enable redistribution of static routes when it is the first one get set + if not self.static_routes.get(vrf, {}): + if self.directory.path_exist("CONFIG_DB", swsscommon.CFG_DEVICE_METADATA_TABLE_NAME, "localhost/bgp_asn"): + cmd_list.extend(self.enable_redistribution_command(vrf)) + else: + self.vrf_pending_redistribution.add(vrf) + + if cmd_list: + self.cfg_mgr.push_list(cmd_list) + log_debug("Static route {} is scheduled for updates".format(key)) + else: + log_debug("Nothing to update for static route {}".format(key)) + + self.static_routes.setdefault(vrf, {})[ip_prefix] = ip_nh_set + + return True + + + def del_handler(self, key): + vrf, ip_prefix = self.split_key(key) + is_ipv6 = TemplateFabric.is_ipv6(ip_prefix) + + ip_nh_set = IpNextHopSet(is_ipv6) + cur_nh_set = self.static_routes.get(vrf, {}).get(ip_prefix, IpNextHopSet(is_ipv6)) + cmd_list = self.static_route_commands(ip_nh_set, cur_nh_set, ip_prefix, vrf) + + # Disable redistribution of static routes when it is the last one to delete + if self.static_routes.get(vrf, {}).keys() == {ip_prefix}: + if self.directory.path_exist("CONFIG_DB", swsscommon.CFG_DEVICE_METADATA_TABLE_NAME, "localhost/bgp_asn"): + cmd_list.extend(self.disable_redistribution_command(vrf)) + self.vrf_pending_redistribution.discard(vrf) + + if cmd_list: + self.cfg_mgr.push_list(cmd_list) + log_debug("Static route {} is scheduled for updates".format(key)) + else: + log_debug("Nothing to update for static route {}".format(key)) + + self.static_routes.setdefault(vrf, {}).pop(ip_prefix, None) + + @staticmethod + def split_key(key): + """ + Split key into vrf name and prefix. + :param key: key to split + :return: vrf name extracted from the key, ip prefix extracted from the key + key example: APPL_DB vrf:5.5.5.0/24, 5.5.5.0/24, vrf:2001::0/64, 2001::0/64 + CONFIG_DB vrf|5.5.5.0/24, 5.5.5.0/24, vrf|2001::0/64, 2001::0/64 + """ + vrf = "" + prefix = "" + + if '|' in key: + return tuple(key.split('|', 1)) + else: + try: + _ = ip_network(key) + vrf, prefix = 'default', key + except ValueError: + # key in APPL_DB + log_debug("static route key {} is not prefix only formart, split with ':'".format(key)) + output = key.split(':', 1) + if len(output) < 2: + log_debug("invalid input in APPL_DB {}".format(key)) + raise ValueError + vrf = output[0] + prefix = key[len(vrf)+1:] + return vrf, prefix + + def static_route_commands(self, ip_nh_set, cur_nh_set, ip_prefix, vrf): + diff_set = ip_nh_set.symmetric_difference(cur_nh_set) + + op_cmd_list = {} + for ip_nh in diff_set: + if ip_nh in cur_nh_set: + op = self.OP_DELETE + else: + op = self.OP_ADD + + op_cmds = op_cmd_list.setdefault(op, []) + op_cmds.append(self.generate_command(op, ip_nh, ip_prefix, vrf)) + + cmd_list = op_cmd_list.get(self.OP_DELETE, []) + cmd_list += op_cmd_list.get(self.OP_ADD, []) + + return cmd_list + + def generate_command(self, op, ip_nh, ip_prefix, vrf): + return '{}{} route {}{}{}'.format( + 'no ' if op == self.OP_DELETE else '', + 'ipv6' if ip_nh.af == socket.AF_INET6 else 'ip', + ip_prefix, + ip_nh, + ' vrf {}'.format(vrf) if vrf != 'default' else '' + ) + + def enable_redistribution_command(self, vrf): + log_debug("Enabling static route redistribution") + cmd_list = [] + bgp_asn = self.directory.get_slot("CONFIG_DB", swsscommon.CFG_DEVICE_METADATA_TABLE_NAME)["localhost"]["bgp_asn"] + if vrf == 'default': + cmd_list.append("router bgp %s" % bgp_asn) + else: + cmd_list.append("router bgp %s vrf %s" % (bgp_asn, vrf)) + for af in ["ipv4", "ipv6"]: + cmd_list.append(" address-family %s" % af) + cmd_list.append(" redistribute static") + return cmd_list + + def disable_redistribution_command(self, vrf): + log_debug("Disabling static route redistribution") + cmd_list = [] + bgp_asn = self.directory.get_slot("CONFIG_DB", swsscommon.CFG_DEVICE_METADATA_TABLE_NAME)["localhost"]["bgp_asn"] + if vrf == 'default': + cmd_list.append("router bgp %s" % bgp_asn) + else: + cmd_list.append("router bgp %s vrf %s" % (bgp_asn, vrf)) + for af in ["ipv4", "ipv6"]: + cmd_list.append(" address-family %s" % af) + cmd_list.append(" no redistribute static") + return cmd_list + + def on_bgp_asn_change(self): + if self.directory.path_exist("CONFIG_DB", swsscommon.CFG_DEVICE_METADATA_TABLE_NAME, "localhost/bgp_asn"): + for vrf in self.vrf_pending_redistribution: + self.cfg_mgr.push_list(self.enable_redistribution_command(vrf)) + self.vrf_pending_redistribution.clear() + +class IpNextHop: + def __init__(self, af_id, blackhole, dst_ip, if_name, dist, vrf): + zero_ip = lambda af: '0.0.0.0' if af == socket.AF_INET else '::' + self.af = af_id + self.blackhole = 'false' if blackhole is None or blackhole == '' else blackhole + self.distance = 0 if dist is None else int(dist) + if self.blackhole == 'true': + dst_ip = if_name = vrf = None + self.ip = zero_ip(af_id) if dst_ip is None or dst_ip == '' else dst_ip + self.interface = '' if if_name is None else if_name + self.nh_vrf = '' if vrf is None else vrf + if self.blackhole != 'true' and self.is_zero_ip() and len(self.interface.strip()) == 0: + log_err('Mandatory attribute not found for nexthop') + raise ValueError + def __eq__(self, other): + return (self.af == other.af and self.blackhole == other.blackhole and + self.ip == other.ip and self.interface == other.interface and + self.distance == other.distance and self.nh_vrf == other.nh_vrf) + def __ne__(self, other): + return (self.af != other.af or self.blackhole != other.blackhole or + self.ip != other.ip or self.interface != other.interface or + self.distance != other.distance or self.nh_vrf != other.nh_vrf) + def __hash__(self): + return hash((self.af, self.blackhole, self.ip, self.interface, self.distance, self.nh_vrf)) + def is_zero_ip(self): + return sum([x for x in socket.inet_pton(self.af, self.ip)]) == 0 + def __format__(self, format): + ret_val = '' + if self.blackhole == 'true': + ret_val += ' blackhole' + if not (self.ip is None or self.is_zero_ip()): + ret_val += ' %s' % self.ip + if not (self.interface is None or self.interface == ''): + ret_val += ' %s' % self.interface + if not (self.distance is None or self.distance == 0): + ret_val += ' %d' % self.distance + if not (self.nh_vrf is None or self.nh_vrf == ''): + ret_val += ' nexthop-vrf %s' % self.nh_vrf + return ret_val + +class IpNextHopSet(set): + def __init__(self, is_ipv6, bkh_list = None, ip_list = None, intf_list = None, dist_list = None, vrf_list = None): + super(IpNextHopSet, self).__init__() + af = socket.AF_INET6 if is_ipv6 else socket.AF_INET + if bkh_list is None and ip_list is None and intf_list is None: + # empty set, for delete case + return + nums = {len(x) for x in [bkh_list, ip_list, intf_list, dist_list, vrf_list] if x is not None} + if len(nums) != 1: + log_err("Lists of next-hop attribute have different sizes: %s" % nums) + for x in [bkh_list, ip_list, intf_list, dist_list, vrf_list]: + log_debug("List: %s" % x) + raise ValueError + nh_cnt = nums.pop() + item = lambda lst, i: lst[i] if lst is not None else None + for idx in range(nh_cnt): + try: + self.add(IpNextHop(af, item(bkh_list, idx), item(ip_list, idx), item(intf_list, idx), + item(dist_list, idx), item(vrf_list, idx), )) + except ValueError: + continue diff --git a/src/sonic-bgpcfgd/bgpcfgd/static_rt_timer.py b/src/sonic-bgpcfgd/bgpcfgd/static_rt_timer.py new file mode 100644 index 000000000000..d6dfb621dad3 --- /dev/null +++ b/src/sonic-bgpcfgd/bgpcfgd/static_rt_timer.py @@ -0,0 +1,59 @@ +from .log import log_err, log_info, log_debug +from swsscommon import swsscommon +import time + +class StaticRouteTimer(object): + """ This class checks the static routes and deletes those entries that have not been refreshed """ + def __init__(self): + self.db = swsscommon.SonicV2Connector() + self.db.connect(self.db.APPL_DB) + self.timer = None + self.start = None + + DEFAULT_TIMER = 180 + DEFAULT_SLEEP = 60 + # keep same range as value defined in sonic-restapi/sonic_api.yaml + MAX_TIMER = 172800 + + def set_timer(self): + """ Check for custom route expiry time in STATIC_ROUTE_EXPIRY_TIME """ + timer = self.db.get(self.db.APPL_DB, "STATIC_ROUTE_EXPIRY_TIME", "time") + if timer is not None: + if timer.isdigit(): + timer = int(timer) + if timer > 0 and timer <= self.MAX_TIMER: + self.timer = timer + return + log_err("Custom static route expiry time of {}s is invalid!".format(timer)) + return + + def alarm(self): + """ Clear unrefreshed static routes """ + static_routes = self.db.keys(self.db.APPL_DB, "STATIC_ROUTE:*") + if static_routes is not None: + for sr in static_routes: + expiry = self.db.get(self.db.APPL_DB, sr, "expiry") + if expiry == "false": + continue + refresh = self.db.get(self.db.APPL_DB, sr, "refresh") + if refresh == "true": + self.db.set(self.db.APPL_DB, sr, "refresh", "false") + log_debug("Refresh status of static route {} is set to false".format(sr)) + else: + self.db.delete(self.db.APPL_DB, sr) + log_debug("Static route {} deleted".format(sr)) + self.start = time.time() + return + + def run(self): + self.start = time.time() + while True: + self.set_timer() + if self.timer: + log_info("Static route expiry set to {}s".format(self.timer)) + time.sleep(self.timer) + self.alarm() + else: + time.sleep(self.DEFAULT_SLEEP) + if time.time() - self.start >= self.DEFAULT_TIMER: + self.alarm() diff --git a/src/sonic-bgpcfgd/bgpmon/bgpmon.py b/src/sonic-bgpcfgd/bgpmon/bgpmon.py index c20c2110a6b2..2b50bd6cf58d 100755 --- a/src/sonic-bgpcfgd/bgpmon/bgpmon.py +++ b/src/sonic-bgpcfgd/bgpmon/bgpmon.py @@ -4,20 +4,20 @@ Description: bgpmon.py -- populating bgp related information in stateDB. script is started by supervisord in bgp docker when the docker is started. - Initial creation of this daemon is to assist SNMP agent in obtaining the + Initial creation of this daemon is to assist SNMP agent in obtaining the BGP related information for its MIB support. The MIB that this daemon is assisting is for the CiscoBgp4MIB (Neighbor state only). If there are other - BGP related items that needs to be updated in a periodic manner in the + BGP related items that needs to be updated in a periodic manner in the future, then more can be added into this process. The script check if there are any bgp activities by monitoring the bgp frr.log file timestamp. If activity is detected, then it will request bgp - neighbor state via vtysh cli interface. This bgp activity monitoring is + neighbor state via vtysh cli interface. This bgp activity monitoring is done periodically (every 15 second). When triggered, it looks specifically for the neighbor state in the json output of show ip bgp neighbors json and update the state DB for each neighbor accordingly. In order to not disturb and hold on to the State DB access too long and - removal of the stale neighbors (neighbors that was there previously on + removal of the stale neighbors (neighbors that was there previously on previous get request but no longer there in the current get request), a "previous" neighbor dictionary will be kept and used to determine if there is a need to perform update or the peer is stale to be removed from the @@ -34,13 +34,13 @@ class BgpStateGet: def __init__(self): - # list peer_l stores the Neighbor peer Ip address + # set peer_l stores the Neighbor peer Ip address # dic peer_state stores the Neighbor peer state entries - # list new_peer_l stores the new snapshot of Neighbor peer ip address + # set new_peer_l stores the new snapshot of Neighbor peer ip address # dic new_peer_state stores the new snapshot of Neighbor peer states - self.peer_l = [] + self.peer_l = set() self.peer_state = {} - self.new_peer_l = [] + self.new_peer_l = set() self.new_peer_state = {} self.cached_timestamp = 0 self.db = swsssdk.SonicV2Connector() @@ -67,7 +67,7 @@ def bgp_activity_detected(self): def update_new_peer_states(self, peer_dict): peer_l = peer_dict["peers"].keys() - self.new_peer_l.extend(peer_l) + self.new_peer_l.update(peer_l) for peer in peer_l: self.new_peer_state[peer] = peer_dict["peers"][peer]["state"] @@ -80,8 +80,8 @@ def get_all_neigh_states(self): return peer_info = json.loads(output) - # cmd ran successfully, safe to Clean the "new" lists/dic for new snapshot - del self.new_peer_l[:] + # cmd ran successfully, safe to Clean the "new" set/dict for new snapshot + self.new_peer_l.clear() self.new_peer_state.clear() for key, value in peer_info.items(): if key == "ipv4Unicast" or key == "ipv6Unicast": @@ -115,8 +115,7 @@ def flush_pipe(self, data): def update_neigh_states(self): data = {} - for i in range (0, len(self.new_peer_l)): - peer = self.new_peer_l[i] + for peer in self.new_peer_l: key = "NEIGH_STATE_TABLE|%s" % peer if peer in self.peer_l: # only update the entry if state changed @@ -125,7 +124,7 @@ def update_neigh_states(self): state = self.new_peer_state[peer] data[key] = {'state':state} self.peer_state[peer] = state - # remove this neighbor from old list since it is accounted for + # remove this neighbor from old set since it is accounted for self.peer_l.remove(peer) else: # New neighbor found case. Add to dictionary and state DB @@ -135,19 +134,19 @@ def update_neigh_states(self): if len(data) > PIPE_BATCH_MAX_COUNT: self.flush_pipe(data) # Check for stale state entries to be cleaned up - while len(self.peer_l) > 0: + for peer in self.peer_l: # remove this from the stateDB and the current neighbor state entry - peer = self.peer_l.pop(0) del_key = "NEIGH_STATE_TABLE|%s" % peer data[del_key] = None - del self.peer_state[peer] + if peer in self.peer_state: + del self.peer_state[peer] if len(data) > PIPE_BATCH_MAX_COUNT: self.flush_pipe(data) # If anything in the pipeline not yet flushed, flush them now if len(data) > 0: self.flush_pipe(data) - # Save the new List - self.peer_l = self.new_peer_l[:] + # Save the new set + self.peer_l = self.new_peer_l.copy() def main(): diff --git a/src/sonic-bgpcfgd/setup.py b/src/sonic-bgpcfgd/setup.py index d6290bccb2b3..b451accb9792 100755 --- a/src/sonic-bgpcfgd/setup.py +++ b/src/sonic-bgpcfgd/setup.py @@ -17,7 +17,8 @@ install_requires = [ 'jinja2>=2.10', 'netaddr==0.8.0', - 'pyyaml==5.3.1', + 'pyyaml==5.4.1', + 'ipaddress==1.0.23' ], setup_requires = [ 'pytest-runner', diff --git a/src/sonic-bgpcfgd/tests/data/general/instance.conf/result_all_v4.conf b/src/sonic-bgpcfgd/tests/data/general/instance.conf/result_all_v4.conf index a6102cdb87a2..73ea68eafc97 100644 --- a/src/sonic-bgpcfgd/tests/data/general/instance.conf/result_all_v4.conf +++ b/src/sonic-bgpcfgd/tests/data/general/instance.conf/result_all_v4.conf @@ -4,6 +4,7 @@ neighbor 10.10.10.10 remote-as 555 neighbor 10.10.10.10 description remote_peer neighbor 10.10.10.10 timers 5 30 + neighbor 10.10.10.10 timers connect 10 neighbor 10.10.10.10 shutdown address-family ipv4 neighbor 10.10.10.10 peer-group PEER_V4 diff --git a/src/sonic-bgpcfgd/tests/data/general/instance.conf/result_all_v6.conf b/src/sonic-bgpcfgd/tests/data/general/instance.conf/result_all_v6.conf index aa06657d91a8..d2efba293767 100644 --- a/src/sonic-bgpcfgd/tests/data/general/instance.conf/result_all_v6.conf +++ b/src/sonic-bgpcfgd/tests/data/general/instance.conf/result_all_v6.conf @@ -4,6 +4,7 @@ neighbor fc::10 remote-as 555 neighbor fc::10 description remote_peer neighbor fc::10 timers 5 30 + neighbor fc::10 timers connect 10 neighbor fc::10 shutdown address-family ipv6 neighbor fc::10 peer-group PEER_V6 diff --git a/src/sonic-bgpcfgd/tests/data/general/instance.conf/result_base_v4.conf b/src/sonic-bgpcfgd/tests/data/general/instance.conf/result_base_v4.conf index 2990d5aef7c7..077704d36468 100644 --- a/src/sonic-bgpcfgd/tests/data/general/instance.conf/result_base_v4.conf +++ b/src/sonic-bgpcfgd/tests/data/general/instance.conf/result_base_v4.conf @@ -3,6 +3,7 @@ ! neighbor 10.10.10.10 remote-as 555 neighbor 10.10.10.10 description remote_peer + neighbor 10.10.10.10 timers connect 10 address-family ipv4 neighbor 10.10.10.10 peer-group PEER_V4 neighbor 10.10.10.10 activate diff --git a/src/sonic-bgpcfgd/tests/data/general/instance.conf/result_base_v6.conf b/src/sonic-bgpcfgd/tests/data/general/instance.conf/result_base_v6.conf index 38ec714894ae..678eef780daf 100644 --- a/src/sonic-bgpcfgd/tests/data/general/instance.conf/result_base_v6.conf +++ b/src/sonic-bgpcfgd/tests/data/general/instance.conf/result_base_v6.conf @@ -3,6 +3,7 @@ ! neighbor fc00::2 remote-as 555 neighbor fc00::2 description remote_peer + neighbor fc00::2 timers connect 10 address-family ipv6 neighbor fc00::2 peer-group PEER_V6 neighbor fc00::2 activate diff --git a/src/sonic-bgpcfgd/tests/data/general/instance.conf/result_l2vpn.conf b/src/sonic-bgpcfgd/tests/data/general/instance.conf/result_l2vpn.conf index b30eaaa62a35..7efc4950d06d 100644 --- a/src/sonic-bgpcfgd/tests/data/general/instance.conf/result_l2vpn.conf +++ b/src/sonic-bgpcfgd/tests/data/general/instance.conf/result_l2vpn.conf @@ -3,6 +3,7 @@ ! neighbor 10.10.10.10 remote-as 555 neighbor 10.10.10.10 description remote_peer + neighbor 10.10.10.10 timers connect 10 address-family ipv4 neighbor 10.10.10.10 peer-group PEER_V4 neighbor 10.10.10.10 activate diff --git a/src/sonic-bgpcfgd/tests/data/general/instance.conf/result_shutdown_1.conf b/src/sonic-bgpcfgd/tests/data/general/instance.conf/result_shutdown_1.conf index 9303e3b9ab7f..617df7369b9c 100644 --- a/src/sonic-bgpcfgd/tests/data/general/instance.conf/result_shutdown_1.conf +++ b/src/sonic-bgpcfgd/tests/data/general/instance.conf/result_shutdown_1.conf @@ -3,6 +3,7 @@ ! neighbor 10.10.10.10 remote-as 555 neighbor 10.10.10.10 description remote_peer + neighbor 10.10.10.10 timers connect 10 neighbor 10.10.10.10 shutdown address-family ipv4 neighbor 10.10.10.10 peer-group PEER_V4 diff --git a/src/sonic-bgpcfgd/tests/data/general/instance.conf/result_shutdown_2.conf b/src/sonic-bgpcfgd/tests/data/general/instance.conf/result_shutdown_2.conf index 2990d5aef7c7..077704d36468 100644 --- a/src/sonic-bgpcfgd/tests/data/general/instance.conf/result_shutdown_2.conf +++ b/src/sonic-bgpcfgd/tests/data/general/instance.conf/result_shutdown_2.conf @@ -3,6 +3,7 @@ ! neighbor 10.10.10.10 remote-as 555 neighbor 10.10.10.10 description remote_peer + neighbor 10.10.10.10 timers connect 10 address-family ipv4 neighbor 10.10.10.10 peer-group PEER_V4 neighbor 10.10.10.10 activate diff --git a/src/sonic-bgpcfgd/tests/data/general/instance.conf/result_timers_1.conf b/src/sonic-bgpcfgd/tests/data/general/instance.conf/result_timers_1.conf index ffca0e6b69e6..53663f1d5173 100644 --- a/src/sonic-bgpcfgd/tests/data/general/instance.conf/result_timers_1.conf +++ b/src/sonic-bgpcfgd/tests/data/general/instance.conf/result_timers_1.conf @@ -4,6 +4,7 @@ neighbor 10.10.10.10 remote-as 555 neighbor 10.10.10.10 description remote_peer neighbor 10.10.10.10 timers 5 180 + neighbor 10.10.10.10 timers connect 10 address-family ipv4 neighbor 10.10.10.10 peer-group PEER_V4 neighbor 10.10.10.10 activate diff --git a/src/sonic-bgpcfgd/tests/data/general/instance.conf/result_timers_2.conf b/src/sonic-bgpcfgd/tests/data/general/instance.conf/result_timers_2.conf index 3a8ac3d90e3f..280e7396598f 100644 --- a/src/sonic-bgpcfgd/tests/data/general/instance.conf/result_timers_2.conf +++ b/src/sonic-bgpcfgd/tests/data/general/instance.conf/result_timers_2.conf @@ -4,6 +4,7 @@ neighbor 10.10.10.10 remote-as 555 neighbor 10.10.10.10 description remote_peer neighbor 10.10.10.10 timers 60 240 + neighbor 10.10.10.10 timers connect 10 address-family ipv4 neighbor 10.10.10.10 peer-group PEER_V4 neighbor 10.10.10.10 activate diff --git a/src/sonic-bgpcfgd/tests/data/general/policies.conf/param_all.json b/src/sonic-bgpcfgd/tests/data/general/policies.conf/param_all.json index 2ed388731ba0..0e08c6a51d03 100644 --- a/src/sonic-bgpcfgd/tests/data/general/policies.conf/param_all.json +++ b/src/sonic-bgpcfgd/tests/data/general/policies.conf/param_all.json @@ -4,9 +4,9 @@ "bgp": { "allow_list": { "enabled": true, - "default_action": "permit", "drop_community": "12345:12345" } } - } + }, + "allow_list_default_action": "permit" } diff --git a/src/sonic-bgpcfgd/tests/data/general/policies.conf/param_deny.json b/src/sonic-bgpcfgd/tests/data/general/policies.conf/param_deny.json index 47cb93082041..b2799abfaa0f 100644 --- a/src/sonic-bgpcfgd/tests/data/general/policies.conf/param_deny.json +++ b/src/sonic-bgpcfgd/tests/data/general/policies.conf/param_deny.json @@ -4,9 +4,9 @@ "bgp": { "allow_list": { "enabled": true, - "default_action": "deny", "drop_community": "12345:12345" } } - } + }, + "allow_list_default_action": "deny" } diff --git a/src/sonic-bgpcfgd/tests/data/general/policies.conf/result_all.conf b/src/sonic-bgpcfgd/tests/data/general/policies.conf/result_all.conf index e4f58f80c92c..8d0c17d592b8 100644 --- a/src/sonic-bgpcfgd/tests/data/general/policies.conf/result_all.conf +++ b/src/sonic-bgpcfgd/tests/data/general/policies.conf/result_all.conf @@ -1,20 +1,33 @@ ! ! template: bgpd/templates/general/policies.conf.j2 ! +! please don't remove. 65535 entries are default rules +! which works when allow_list is enabled, but new configuration +! is not applied +! route-map ALLOW_LIST_DEPLOYMENT_ID_0_V4 permit 65535 set community 12345:12345 additive ! route-map ALLOW_LIST_DEPLOYMENT_ID_0_V6 permit 65535 set community 12345:12345 additive ! -route-map FROM_BGP_PEER_V4 permit 2 +bgp community-list standard allow_list_default_community permit no-export +bgp community-list standard allow_list_default_community permit 12345:12345 +! +route-map FROM_BGP_PEER_V4 permit 10 call ALLOW_LIST_DEPLOYMENT_ID_0_V4 on-match next ! -route-map FROM_BGP_PEER_V6 permit 2 +route-map FROM_BGP_PEER_V4 permit 11 + match community allow_list_default_community +! +route-map FROM_BGP_PEER_V6 permit 10 call ALLOW_LIST_DEPLOYMENT_ID_0_V6 on-match next ! +route-map FROM_BGP_PEER_V6 permit 11 + match community allow_list_default_community +! route-map FROM_BGP_PEER_V4 permit 100 ! route-map TO_BGP_PEER_V4 permit 100 diff --git a/src/sonic-bgpcfgd/tests/data/general/policies.conf/result_deny.conf b/src/sonic-bgpcfgd/tests/data/general/policies.conf/result_deny.conf index 7f9137931e1c..661414bd579c 100644 --- a/src/sonic-bgpcfgd/tests/data/general/policies.conf/result_deny.conf +++ b/src/sonic-bgpcfgd/tests/data/general/policies.conf/result_deny.conf @@ -1,20 +1,33 @@ ! ! template: bgpd/templates/general/policies.conf.j2 ! +! please don't remove. 65535 entries are default rules +! which works when allow_list is enabled, but new configuration +! is not applied +! route-map ALLOW_LIST_DEPLOYMENT_ID_0_V4 permit 65535 set community no-export additive ! route-map ALLOW_LIST_DEPLOYMENT_ID_0_V6 permit 65535 set community no-export additive ! -route-map FROM_BGP_PEER_V4 permit 2 +bgp community-list standard allow_list_default_community permit no-export +bgp community-list standard allow_list_default_community permit 12345:12345 +! +route-map FROM_BGP_PEER_V4 permit 10 call ALLOW_LIST_DEPLOYMENT_ID_0_V4 on-match next ! -route-map FROM_BGP_PEER_V6 permit 2 +route-map FROM_BGP_PEER_V4 permit 11 + match community allow_list_default_community +! +route-map FROM_BGP_PEER_V6 permit 10 call ALLOW_LIST_DEPLOYMENT_ID_0_V6 on-match next ! +route-map FROM_BGP_PEER_V6 permit 11 + match community allow_list_default_community +! route-map FROM_BGP_PEER_V4 permit 100 ! route-map TO_BGP_PEER_V4 permit 100 diff --git a/src/sonic-bgpcfgd/tests/data/internal/instance.conf/result_back_v4.conf b/src/sonic-bgpcfgd/tests/data/internal/instance.conf/result_back_v4.conf index fc7b82a64acc..43fdc12921bc 100644 --- a/src/sonic-bgpcfgd/tests/data/internal/instance.conf/result_back_v4.conf +++ b/src/sonic-bgpcfgd/tests/data/internal/instance.conf/result_back_v4.conf @@ -4,11 +4,12 @@ neighbor 10.10.10.10 remote-as 555 neighbor 10.10.10.10 description remote_peer neighbor 10.10.10.10 timers 3 10 + neighbor 10.10.10.10 timers connect 10 address-family ipv4 neighbor 10.10.10.10 peer-group INTERNAL_PEER_V4 + neighbor 10.10.10.10 next-hop-self force neighbor 10.10.10.10 route-map FROM_BGP_INTERNAL_PEER_V4 in neighbor 10.10.10.10 route-reflector-client - neighbor 10.10.10.10 next-hop-self force neighbor 10.10.10.10 activate exit-address-family ! diff --git a/src/sonic-bgpcfgd/tests/data/internal/instance.conf/result_back_v6.conf b/src/sonic-bgpcfgd/tests/data/internal/instance.conf/result_back_v6.conf index 74cececad969..811f7b808478 100644 --- a/src/sonic-bgpcfgd/tests/data/internal/instance.conf/result_back_v6.conf +++ b/src/sonic-bgpcfgd/tests/data/internal/instance.conf/result_back_v6.conf @@ -4,11 +4,12 @@ neighbor fc::10 remote-as 555 neighbor fc::10 description remote_peer neighbor fc::10 timers 3 10 + neighbor fc::10 timers connect 10 address-family ipv6 neighbor fc::10 peer-group INTERNAL_PEER_V6 + neighbor fc::10 next-hop-self force neighbor fc::10 route-map FROM_BGP_INTERNAL_PEER_V6 in neighbor fc::10 route-reflector-client - neighbor fc::10 next-hop-self force neighbor fc::10 activate exit-address-family ! diff --git a/src/sonic-bgpcfgd/tests/data/internal/instance.conf/result_front_v4.conf b/src/sonic-bgpcfgd/tests/data/internal/instance.conf/result_front_v4.conf index 95eb985b1546..baabea0091e4 100644 --- a/src/sonic-bgpcfgd/tests/data/internal/instance.conf/result_front_v4.conf +++ b/src/sonic-bgpcfgd/tests/data/internal/instance.conf/result_front_v4.conf @@ -4,9 +4,9 @@ neighbor 10.10.10.10 remote-as 555 neighbor 10.10.10.10 description remote_peer neighbor 10.10.10.10 timers 3 10 + neighbor 10.10.10.10 timers connect 10 address-family ipv4 neighbor 10.10.10.10 peer-group INTERNAL_PEER_V4 - neighbor 10.10.10.10 next-hop-self force neighbor 10.10.10.10 activate exit-address-family ! diff --git a/src/sonic-bgpcfgd/tests/data/internal/instance.conf/result_front_v6.conf b/src/sonic-bgpcfgd/tests/data/internal/instance.conf/result_front_v6.conf index a4a4648e4855..b6c1355f73c2 100644 --- a/src/sonic-bgpcfgd/tests/data/internal/instance.conf/result_front_v6.conf +++ b/src/sonic-bgpcfgd/tests/data/internal/instance.conf/result_front_v6.conf @@ -4,9 +4,9 @@ neighbor fc::10 remote-as 555 neighbor fc::10 description remote_peer neighbor fc::10 timers 3 10 + neighbor fc::10 timers connect 10 address-family ipv6 neighbor fc::10 peer-group INTERNAL_PEER_V6 - neighbor fc::10 next-hop-self force neighbor fc::10 activate exit-address-family ! diff --git a/src/sonic-bgpcfgd/tests/data/internal/peer-group.conf/result_back.conf b/src/sonic-bgpcfgd/tests/data/internal/peer-group.conf/result_back.conf index 15076685eb1a..28a543841fef 100644 --- a/src/sonic-bgpcfgd/tests/data/internal/peer-group.conf/result_back.conf +++ b/src/sonic-bgpcfgd/tests/data/internal/peer-group.conf/result_back.conf @@ -6,12 +6,14 @@ address-family ipv4 neighbor INTERNAL_PEER_V4 route-reflector-client neighbor INTERNAL_PEER_V4 soft-reconfiguration inbound + neighbor INTERNAL_PEER_V4 allowas-in 1 neighbor INTERNAL_PEER_V4 route-map FROM_BGP_INTERNAL_PEER_V4 in neighbor INTERNAL_PEER_V4 route-map TO_BGP_INTERNAL_PEER_V4 out exit-address-family address-family ipv6 neighbor INTERNAL_PEER_V6 route-reflector-client neighbor INTERNAL_PEER_V6 soft-reconfiguration inbound + neighbor INTERNAL_PEER_V6 allowas-in 1 neighbor INTERNAL_PEER_V6 route-map FROM_BGP_INTERNAL_PEER_V6 in neighbor INTERNAL_PEER_V6 route-map TO_BGP_INTERNAL_PEER_V6 out exit-address-family diff --git a/src/sonic-bgpcfgd/tests/data/internal/peer-group.conf/result_front.conf b/src/sonic-bgpcfgd/tests/data/internal/peer-group.conf/result_front.conf index 8f4aa450f5db..5b061fa52b44 100644 --- a/src/sonic-bgpcfgd/tests/data/internal/peer-group.conf/result_front.conf +++ b/src/sonic-bgpcfgd/tests/data/internal/peer-group.conf/result_front.conf @@ -5,11 +5,13 @@ neighbor INTERNAL_PEER_V6 peer-group address-family ipv4 neighbor INTERNAL_PEER_V4 soft-reconfiguration inbound + neighbor INTERNAL_PEER_V4 allowas-in 1 neighbor INTERNAL_PEER_V4 route-map FROM_BGP_INTERNAL_PEER_V4 in neighbor INTERNAL_PEER_V4 route-map TO_BGP_INTERNAL_PEER_V4 out exit-address-family address-family ipv6 neighbor INTERNAL_PEER_V6 soft-reconfiguration inbound + neighbor INTERNAL_PEER_V6 allowas-in 1 neighbor INTERNAL_PEER_V6 route-map FROM_BGP_INTERNAL_PEER_V6 in neighbor INTERNAL_PEER_V6 route-map TO_BGP_INTERNAL_PEER_V6 out exit-address-family diff --git a/src/sonic-bgpcfgd/tests/data/internal/policies.conf/param_back.json b/src/sonic-bgpcfgd/tests/data/internal/policies.conf/param_back.json index 148456fe960f..37e54d785e27 100644 --- a/src/sonic-bgpcfgd/tests/data/internal/policies.conf/param_back.json +++ b/src/sonic-bgpcfgd/tests/data/internal/policies.conf/param_back.json @@ -4,5 +4,7 @@ "sub_role": "BackEnd" } }, - "loopback0_ipv4": "10.10.10.10/32" -} \ No newline at end of file + "CONFIG_DB__LOOPBACK_INTERFACE": { + "Loopback4096|10.10.10.10/32": {} + } +} diff --git a/src/sonic-bgpcfgd/tests/data/internal/policies.conf/result_back.conf b/src/sonic-bgpcfgd/tests/data/internal/policies.conf/result_back.conf index 81bf0808f77a..81b5aab193c6 100644 --- a/src/sonic-bgpcfgd/tests/data/internal/policies.conf/result_back.conf +++ b/src/sonic-bgpcfgd/tests/data/internal/policies.conf/result_back.conf @@ -6,8 +6,8 @@ route-map FROM_BGP_INTERNAL_PEER_V4 permit 100 route-map TO_BGP_INTERNAL_PEER_V4 permit 100 ! route-map FROM_BGP_INTERNAL_PEER_V6 permit 1 - on-match next set ipv6 next-hop prefer-global + on-match next ! route-map FROM_BGP_INTERNAL_PEER_V6 permit 100 ! diff --git a/src/sonic-bgpcfgd/tests/data/internal/policies.conf/result_front.conf b/src/sonic-bgpcfgd/tests/data/internal/policies.conf/result_front.conf index 94dc55a5458f..880530a2797e 100644 --- a/src/sonic-bgpcfgd/tests/data/internal/policies.conf/result_front.conf +++ b/src/sonic-bgpcfgd/tests/data/internal/policies.conf/result_front.conf @@ -6,8 +6,8 @@ route-map FROM_BGP_INTERNAL_PEER_V4 permit 100 route-map TO_BGP_INTERNAL_PEER_V4 permit 100 ! route-map FROM_BGP_INTERNAL_PEER_V6 permit 1 - on-match next set ipv6 next-hop prefer-global + on-match next ! route-map FROM_BGP_INTERNAL_PEER_V6 permit 100 ! diff --git a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.conf.j2/all.conf b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.conf.j2/all.conf index 43a65bd2dd61..b6f7a668bc8c 100644 --- a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.conf.j2/all.conf +++ b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.conf.j2/all.conf @@ -34,7 +34,11 @@ ip prefix-list LOCAL_VLAN_IPV4_PREFIX seq 5 permit 10.10.10.0/24 ipv6 prefix-list LOCAL_VLAN_IPV6_PREFIX seq 10 permit fc01::/64 ! route-map HIDE_INTERNAL permit 10 - set community local-AS + set community no-export + on-match next +route-map HIDE_INTERNAL permit 20 + set community 1234:5678 additive +! ! router bgp 55555 ! @@ -47,14 +51,19 @@ router bgp 55555 bgp graceful-restart restart-time 480 bgp graceful-restart bgp graceful-restart preserve-fw-state + bgp graceful-restart select-defer-time 45 ! bgp router-id 55.55.55.55 ! network 55.55.55.55/32 + network 55.55.55.56/32 route-map HIDE_INTERNAL ! address-family ipv6 network fc00::1/64 exit-address-family + address-family ipv6 + network fc00::2/128 route-map HIDE_INTERNAL + exit-address-family ! network 10.10.10.1/24 address-family ipv6 diff --git a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.conf.j2/all.json b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.conf.j2/all.json index 17e32589d84c..fc5016d8536e 100644 --- a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.conf.j2/all.json +++ b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.conf.j2/all.json @@ -3,12 +3,15 @@ "localhost": { "hostname": "new_hostname", "bgp_asn": "55555", - "sub_role": "FrontEnd" + "sub_role": "FrontEnd", + "type": "ToRRouter" } }, "LOOPBACK_INTERFACE": { "Loopback0|55.55.55.55/32": {}, - "Loopback0|fc00::1/128": {} + "Loopback0|fc00::1/128": {}, + "Loopback4096|55.55.55.56/32": {}, + "Loopback4096|fc00::2/128": {} }, "VLAN_INTERFACE": { "Vlan10|10.10.10.1/24": {}, @@ -27,6 +30,11 @@ "enabled": true, "ipv4": 32, "ipv6": 32 + }, + "peers": { + "internal": { + "community": "1234:5678" + } } } } diff --git a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/all.conf b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/all.conf index 4a749516fe18..5d09db596538 100644 --- a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/all.conf +++ b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/all.conf @@ -16,7 +16,8 @@ ip prefix-list LOCAL_VLAN_IPV4_PREFIX seq 5 permit 10.10.10.0/24 ipv6 prefix-list LOCAL_VLAN_IPV6_PREFIX seq 10 permit fc01::/64 ! route-map HIDE_INTERNAL permit 10 - set community local-AS + set community no-export +! ! router bgp 55555 ! @@ -29,14 +30,19 @@ router bgp 55555 bgp graceful-restart restart-time 480 bgp graceful-restart bgp graceful-restart preserve-fw-state + bgp graceful-restart select-defer-time 45 ! bgp router-id 55.55.55.55 ! network 55.55.55.55/32 + network 55.55.55.56/32 route-map HIDE_INTERNAL ! address-family ipv6 network fc00::1/64 exit-address-family + address-family ipv6 + network fc00::2/128 route-map HIDE_INTERNAL + exit-address-family ! network 10.10.10.1/24 address-family ipv6 diff --git a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/all.json b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/all.json index 3d5d07d95f09..47508bb3c001 100644 --- a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/all.json +++ b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/all.json @@ -2,12 +2,15 @@ "DEVICE_METADATA": { "localhost": { "bgp_asn": "55555", - "sub_role": "FrontEnd" + "sub_role": "FrontEnd", + "type": "ToRRouter" } }, "LOOPBACK_INTERFACE": { "Loopback0|55.55.55.55/32": {}, - "Loopback0|fc00::1/128": {} + "Loopback0|fc00::1/128": {}, + "Loopback4096|55.55.55.56/32": {}, + "Loopback4096|fc00::2/128": {} }, "VLAN_INTERFACE": { "Vlan10|10.10.10.1/24": {}, diff --git a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/defaults.conf b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/defaults.conf index 30fc479d6af8..14aa080efb5d 100644 --- a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/defaults.conf +++ b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/defaults.conf @@ -16,7 +16,8 @@ ip prefix-list LOCAL_VLAN_IPV4_PREFIX seq 5 permit 10.10.10.0/24 ipv6 prefix-list LOCAL_VLAN_IPV6_PREFIX seq 10 permit fc01::/64 ! route-map HIDE_INTERNAL permit 10 - set community local-AS + set community no-export +! ! router bgp 55555 ! @@ -29,14 +30,19 @@ router bgp 55555 bgp graceful-restart restart-time 240 bgp graceful-restart bgp graceful-restart preserve-fw-state + bgp graceful-restart select-defer-time 45 ! bgp router-id 55.55.55.55 ! network 55.55.55.55/32 + network 55.55.55.56/32 route-map HIDE_INTERNAL ! address-family ipv6 network fc00::1/64 exit-address-family + address-family ipv6 + network fc00::2/128 route-map HIDE_INTERNAL + exit-address-family ! network 10.10.10.1/24 address-family ipv6 diff --git a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/defaults.json b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/defaults.json index e841437650ac..c1b5ae8dc449 100644 --- a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/defaults.json +++ b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/bgpd.main.conf.j2/defaults.json @@ -2,12 +2,15 @@ "DEVICE_METADATA": { "localhost": { "bgp_asn": "55555", - "sub_role": "FrontEnd" + "sub_role": "FrontEnd", + "type": "ToRRouter" } }, "LOOPBACK_INTERFACE": { "Loopback0|55.55.55.55/32": {}, - "Loopback0|fc00::1/128": {} + "Loopback0|fc00::1/128": {}, + "Loopback4096|55.55.55.56/32": {}, + "Loopback4096|fc00::2/128": {} }, "VLAN_INTERFACE": { "Vlan10|10.10.10.1/24": {}, diff --git a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/frr.conf.j2/all.conf b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/frr.conf.j2/all.conf index 37b7691ad95f..1996dced8176 100644 --- a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/frr.conf.j2/all.conf +++ b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/frr.conf.j2/all.conf @@ -32,15 +32,10 @@ link-detect ! !! ! -! set static default route to mgmt gateway as a backup to learned default -ip route 0.0.0.0/0 10.10.10.1 200 -!! -! -! ! add static ipv6 /64 loopback route to allow bgpd to advertise the loopback route prefix ipv6 route fc00::/64 Loopback0 -! !! +! ! template: bgpd/bgpd.main.conf.j2 ! ! bgp multiple-instance @@ -58,7 +53,7 @@ ip prefix-list LOCAL_VLAN_IPV4_PREFIX seq 5 permit 10.10.10.0/24 ipv6 prefix-list LOCAL_VLAN_IPV6_PREFIX seq 10 permit fc01::/64 ! route-map HIDE_INTERNAL permit 10 - set community local-AS + set community no-export ! router bgp 55555 ! @@ -71,14 +66,19 @@ router bgp 55555 bgp graceful-restart restart-time 480 bgp graceful-restart bgp graceful-restart preserve-fw-state + bgp graceful-restart select-defer-time 45 ! bgp router-id 55.55.55.55 ! network 55.55.55.55/32 + network 55.55.55.56/32 route-map HIDE_INTERNAL ! address-family ipv6 network fc00::1/64 exit-address-family + address-family ipv6 + network fc00::2/128 route-map HIDE_INTERNAL + exit-address-family ! network 10.10.10.1/24 address-family ipv6 diff --git a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/frr.conf.j2/all.json b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/frr.conf.j2/all.json index d81eba2b0fe6..9c8a34fb4120 100644 --- a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/frr.conf.j2/all.json +++ b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/frr.conf.j2/all.json @@ -3,7 +3,8 @@ "localhost": { "bgp_asn": "55555", "hostname": "test_hostname", - "sub_role": "FrontEnd" + "sub_role": "FrontEnd", + "type": "ToRRouter" } }, "INTERFACE": { @@ -21,7 +22,9 @@ }, "LOOPBACK_INTERFACE": { "Loopback0|55.55.55.55/32": {}, - "Loopback0|fc00::1/128": {} + "Loopback0|fc00::1/128": {}, + "Loopback4096|55.55.55.56/32": {}, + "Loopback4096|fc00::2/128": {} }, "VLAN_INTERFACE": { "Vlan10|10.10.10.1/24": {}, @@ -43,4 +46,4 @@ } } } -} \ No newline at end of file +} diff --git a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/staticd/staticd.conf b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/staticd/staticd.conf index 59bbe983af76..0a2a7d4effba 100644 --- a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/staticd/staticd.conf +++ b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/staticd/staticd.conf @@ -14,8 +14,6 @@ log facility local4 ! ! end of template: common/daemons.common.conf.j2! ! -! set static default route to mgmt gateway as a backup to learned default -ip route 0.0.0.0/0 10.10.10.1 200 !! ! ! add static ipv6 /64 loopback route to allow bgpd to advertise the loopback route prefix diff --git a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/staticd/staticd.conf.json b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/staticd/staticd.conf.json index 0cbd67c7ef68..3b46cc276aee 100644 --- a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/staticd/staticd.conf.json +++ b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/staticd/staticd.conf.json @@ -4,11 +4,6 @@ "hostname": "new_hostname" } }, - "MGMT_INTERFACE": { - "eth0|10.10.10.10/24": { - "gwaddr": "10.10.10.1" - } - }, "LOOPBACK_INTERFACE": { "Loopback0|FC00:1::32/128": {} } diff --git a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/staticd/staticd.default_route.conf b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/staticd/staticd.default_route.conf deleted file mode 100644 index 11adb98ebc3c..000000000000 --- a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/staticd/staticd.default_route.conf +++ /dev/null @@ -1,4 +0,0 @@ -! -! set static default route to mgmt gateway as a backup to learned default -ip route 0.0.0.0/0 10.10.10.1 200 -! diff --git a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/staticd/staticd.default_route.conf.json b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/staticd/staticd.default_route.conf.json deleted file mode 100644 index 80cd218a790e..000000000000 --- a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/staticd/staticd.default_route.conf.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "MGMT_INTERFACE": { - "eth0|10.10.10.10/24": { - "gwaddr": "10.10.10.1" - } - } -} diff --git a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/tsa/isolate.conf b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/tsa/isolate.conf index 7bd155fcdb64..2ea4111dfc26 100644 --- a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/tsa/isolate.conf +++ b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/tsa/isolate.conf @@ -1,5 +1,5 @@ -route-map test_rm_name permit 2 +route-map test_rm_name permit 20 match ip address prefix-list PL_LoopbackV4 set community 12345:555 -route-map test_rm_name deny 3 +route-map test_rm_name deny 30 ! diff --git a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/tsa/unisolate.conf b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/tsa/unisolate.conf index db53a69e7ec4..2adeac6e0ef7 100644 --- a/src/sonic-bgpcfgd/tests/data/sonic-cfggen/tsa/unisolate.conf +++ b/src/sonic-bgpcfgd/tests/data/sonic-cfggen/tsa/unisolate.conf @@ -1,3 +1,3 @@ -no route-map test_rm permit 2 -no route-map test_rm deny 3 +no route-map test_rm permit 20 +no route-map test_rm deny 30 ! diff --git a/src/sonic-bgpcfgd/tests/test_advertise_rt.py b/src/sonic-bgpcfgd/tests/test_advertise_rt.py new file mode 100644 index 000000000000..751540600006 --- /dev/null +++ b/src/sonic-bgpcfgd/tests/test_advertise_rt.py @@ -0,0 +1,245 @@ +from unittest.mock import MagicMock, patch + +from bgpcfgd.directory import Directory +from bgpcfgd.template import TemplateFabric +from bgpcfgd.managers_advertise_rt import AdvertiseRouteMgr +from swsscommon import swsscommon + +def constructor(skip_bgp_asn=False): + cfg_mgr = MagicMock() + + common_objs = { + 'directory': Directory(), + 'cfg_mgr': cfg_mgr, + 'tf': TemplateFabric(), + 'constants': {}, + } + + mgr = AdvertiseRouteMgr(common_objs, "STATE_DB", swsscommon.STATE_ADVERTISE_NETWORK_TABLE_NAME) + if not skip_bgp_asn: + mgr.directory.put("CONFIG_DB", swsscommon.CFG_DEVICE_METADATA_TABLE_NAME, "localhost", {"bgp_asn": "65100"}) + assert len(mgr.advertised_routes) == 0 + + return mgr + +def set_del_test(mgr, op, args, expected_ret, expected_cmds): + set_del_test.push_list_called = False + def push_list(cmds): + set_del_test.push_list_called = True + assert cmds in expected_cmds + return True + mgr.cfg_mgr.push_list = push_list + + if op == "SET": + ret = mgr.set_handler(*args) + assert ret == expected_ret + elif op == "DEL": + mgr.del_handler(*args) + else: + assert False, "Wrong operation" + + if expected_cmds: + assert set_del_test.push_list_called, "cfg_mgr.push_list wasn't called" + else: + assert not set_del_test.push_list_called, "cfg_mgr.push_list was called" + +def test_set_del(): + mgr = constructor() + set_del_test( + mgr, + "SET", + ("10.1.0.0/24", {"":""}), + True, + [ + ["router bgp 65100", + " no bgp network import-check"], + ["router bgp 65100", + " address-family ipv4 unicast", + " network 10.1.0.0/24"] + ] + ) + + set_del_test( + mgr, + "SET", + ("fc00:10::/64", {"":""}), + True, + [ + ["router bgp 65100", + " address-family ipv6 unicast", + " network fc00:10::/64"] + ] + ) + + set_del_test( + mgr, + "DEL", + ("10.1.0.0/24",), + True, + [ + ["router bgp 65100", + " address-family ipv4 unicast", + " no network 10.1.0.0/24"] + ] + ) + + set_del_test( + mgr, + "DEL", + ("fc00:10::/64",), + True, + [ + ["router bgp 65100", + " bgp network import-check"], + ["router bgp 65100", + " address-family ipv6 unicast", + " no network fc00:10::/64"] + ] + ) + + +def test_set_del_vrf(): + mgr = constructor() + set_del_test( + mgr, + "SET", + ("vrfRED|10.2.0.0/24", {"":""}), + True, + [ + ["router bgp 65100 vrf vrfRED", + " no bgp network import-check"], + ["router bgp 65100 vrf vrfRED", + " address-family ipv4 unicast", + " network 10.2.0.0/24"] + ] + ) + + set_del_test( + mgr, + "SET", + ("vrfRED|fc00:20::/64", {"":""}), + True, + [ + ["router bgp 65100 vrf vrfRED", + " address-family ipv6 unicast", + " network fc00:20::/64"] + ] + ) + + set_del_test( + mgr, + "DEL", + ("vrfRED|10.2.0.0/24",), + True, + [ + ["router bgp 65100 vrf vrfRED", + " address-family ipv4 unicast", + " no network 10.2.0.0/24"] + ] + ) + + set_del_test( + mgr, + "DEL", + ("vrfRED|fc00:20::/64",), + True, + [ + ["router bgp 65100 vrf vrfRED", + " bgp network import-check"], + ["router bgp 65100 vrf vrfRED", + " address-family ipv6 unicast", + " no network fc00:20::/64"] + ] + ) + + +def test_set_del_bgp_asn_change(): + mgr = constructor(skip_bgp_asn=True) + set_del_test( + mgr, + "SET", + ("vrfRED|10.3.0.0/24", { + "profile": "FROM_SDN_SLB_ROUTES" + }), + True, + [] + ) + + + test_set_del_bgp_asn_change.push_list_called = False + expected_cmds = [ + ["router bgp 65100 vrf vrfRED", + " no bgp network import-check"], + ["router bgp 65100 vrf vrfRED", + " address-family ipv4 unicast", + " network 10.3.0.0/24 route-map FROM_SDN_SLB_ROUTES_RM"] + ] + def push_list(cmds): + test_set_del_bgp_asn_change.push_list_called = True + assert cmds in expected_cmds + return True + + mgr.cfg_mgr.push_list = push_list + assert not test_set_del_bgp_asn_change.push_list_called + + mgr.directory.put("CONFIG_DB", swsscommon.CFG_DEVICE_METADATA_TABLE_NAME, "localhost", {"bgp_asn": "65100"}) + + assert test_set_del_bgp_asn_change.push_list_called + +def test_set_del_with_community(): + mgr = constructor() + set_del_test( + mgr, + "SET", + ("10.1.0.0/24", { + "profile": "FROM_SDN_SLB_ROUTES" + }), + True, + [ + ["router bgp 65100", + " no bgp network import-check"], + ["router bgp 65100", + " address-family ipv4 unicast", + " network 10.1.0.0/24 route-map FROM_SDN_SLB_ROUTES_RM"] + ] + ) + + set_del_test( + mgr, + "SET", + ("fc00:10::/64", { + "profile": "FROM_SDN_SLB_ROUTES" + }), + True, + [ + ["router bgp 65100", + " address-family ipv6 unicast", + " network fc00:10::/64 route-map FROM_SDN_SLB_ROUTES_RM"] + ] + ) + + set_del_test( + mgr, + "DEL", + ("10.1.0.0/24",), + True, + [ + ["router bgp 65100", + " address-family ipv4 unicast", + " no network 10.1.0.0/24"] + ] + ) + + set_del_test( + mgr, + "DEL", + ("fc00:10::/64",), + True, + [ + ["router bgp 65100", + " bgp network import-check"], + ["router bgp 65100", + " address-family ipv6 unicast", + " no network fc00:10::/64"] + ] + ) \ No newline at end of file diff --git a/src/sonic-bgpcfgd/tests/test_allow_list.py b/src/sonic-bgpcfgd/tests/test_allow_list.py index 904ba14f2ecf..c5bec039c3e4 100644 --- a/src/sonic-bgpcfgd/tests/test_allow_list.py +++ b/src/sonic-bgpcfgd/tests/test_allow_list.py @@ -4,6 +4,7 @@ from bgpcfgd.directory import Directory from bgpcfgd.template import TemplateFabric import bgpcfgd +from copy import deepcopy swsscommon_module_mock = MagicMock() @@ -18,13 +19,33 @@ "deny 0::/0 le 59", "deny 0::/0 ge 65" ] - } + }, + "default_action": "permit", + "drop_community": "123:123" + } + } +} + +global_constants_with_prefix_match_tag = { + "bgp": { + "allow_list": { + "enabled": True, + "default_pl_rules": { + "v4": [ "deny 0.0.0.0/0 le 17" ], + "v6": [ + "deny 0::/0 le 59", + "deny 0::/0 ge 65" + ] + }, + "default_action": "permit", + "drop_community": "123:123", + "prefix_match_tag": "1001" } } } @patch.dict("sys.modules", swsscommon=swsscommon_module_mock) -def set_del_test(op, args, currect_config, expected_config): +def set_del_test(op, args, currect_config, expected_config, update_global_default_action=None, update_constant_prefix_match_tag=False): from bgpcfgd.managers_allow_list import BGPAllowListMgr set_del_test.push_list_called = False def push_list(args): @@ -42,10 +63,12 @@ def push_list(args): 'directory': Directory(), 'cfg_mgr': cfg_mgr, 'tf': TemplateFabric(), - 'constants': global_constants, + 'constants': deepcopy(global_constants) if not update_constant_prefix_match_tag else deepcopy(global_constants_with_prefix_match_tag) } mgr = BGPAllowListMgr(common_objs, "CONFIG_DB", "BGP_ALLOWED_PREFIXES") + if update_global_default_action: + mgr.constants["bgp"]["allow_list"]["default_action"] = update_global_default_action if op == "SET": mgr.set_handler(*args) elif op == "DEL": @@ -64,13 +87,18 @@ def test_set_handler_with_community(): "prefixes_v4": "10.20.30.0/24,30.50.0.0/16", "prefixes_v6": "fc00:20::/64,fc00:30::/64", }), - [], + [ + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V4 permit 65535', + ' set community 123:123 additive', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V6 permit 65535', + ' set community 123:123 additive' + ], [ 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 10 deny 0.0.0.0/0 le 17', 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 20 permit 10.20.30.0/24 le 32', 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 30 permit 30.50.0.0/16 le 32', - 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 10 deny 0::/0 le 59', - 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 20 deny 0::/0 ge 65', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 10 deny ::/0 le 59', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 20 deny ::/0 ge 65', 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 30 permit fc00:20::/64 le 128', 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 40 permit fc00:30::/64 le 128', 'bgp community-list standard COMMUNITY_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020 permit 1010:2020', @@ -83,6 +111,107 @@ def test_set_handler_with_community(): ] ) +def test_set_handler_with_community_and_prefix_match_tag(): + set_del_test( + "SET", + ("DEPLOYMENT_ID|5|1010:2020", { + "prefixes_v4": "10.20.30.0/24,30.50.0.0/16", + "prefixes_v6": "fc00:20::/64,fc00:30::/64", + }), + [ + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V4 permit 65535', + ' set community 123:123 additive', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V6 permit 65535', + ' set community 123:123 additive' + ], + [ + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 10 deny 0.0.0.0/0 le 17', + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 20 permit 10.20.30.0/24 le 32', + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 30 permit 30.50.0.0/16 le 32', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 10 deny ::/0 le 59', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 20 deny ::/0 ge 65', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 30 permit fc00:20::/64 le 128', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 40 permit fc00:30::/64 le 128', + 'bgp community-list standard COMMUNITY_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020 permit 1010:2020', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V4 permit 10', + ' match ip address prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4', + ' match community COMMUNITY_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V6 permit 10', + ' match ipv6 address prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6', + ' match community COMMUNITY_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020', + ], + None, True + ) + +def test_set_handler_with_community_and_permit_action(): + set_del_test( + "SET", + ("DEPLOYMENT_ID|5|1010:2020", { + "prefixes_v4": "10.20.30.0/24,30.50.0.0/16", + "prefixes_v6": "fc00:20::/64,fc00:30::/64", + "default_action":"permit" + }), + [ + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V4 permit 65535', + ' set community 123:123 additive', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V6 permit 65535', + ' set community 123:123 additive' + ], + [ + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 10 deny 0.0.0.0/0 le 17', + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 20 permit 10.20.30.0/24 le 32', + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 30 permit 30.50.0.0/16 le 32', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 10 deny ::/0 le 59', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 20 deny ::/0 ge 65', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 30 permit fc00:20::/64 le 128', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 40 permit fc00:30::/64 le 128', + 'bgp community-list standard COMMUNITY_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020 permit 1010:2020', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V4 permit 10', + ' match ip address prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4', + ' match community COMMUNITY_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V6 permit 10', + ' match ipv6 address prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6', + ' match community COMMUNITY_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020', + ] + ) + +def test_set_handler_with_community_and_deny_action(): + set_del_test( + "SET", + ("DEPLOYMENT_ID|5|1010:2020", { + "prefixes_v4": "10.20.30.0/24,30.50.0.0/16", + "prefixes_v6": "fc00:20::/64,fc00:30::/64", + "default_action":"deny" + }), + [ + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V4 permit 65535', + ' set community 123:123 additive', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V6 permit 65535', + ' set community 123:123 additive' + ], + [ + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 10 deny 0.0.0.0/0 le 17', + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 20 permit 10.20.30.0/24 le 32', + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 30 permit 30.50.0.0/16 le 32', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 10 deny ::/0 le 59', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 20 deny ::/0 ge 65', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 30 permit fc00:20::/64 le 128', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 40 permit fc00:30::/64 le 128', + 'bgp community-list standard COMMUNITY_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020 permit 1010:2020', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V4 permit 10', + ' match ip address prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4', + ' match community COMMUNITY_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V6 permit 10', + ' match ipv6 address prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6', + ' match community COMMUNITY_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V4 permit 65535', + ' set community no-export additive', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V6 permit 65535', + ' set community no-export additive' + ] + ) + + def test_set_handler_no_community(): set_del_test( "SET", @@ -90,19 +219,116 @@ def test_set_handler_no_community(): "prefixes_v4": "20.20.30.0/24,40.50.0.0/16", "prefixes_v6": "fc01:20::/64,fc01:30::/64", }), - [], + [ + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V4 permit 65535', + ' set community 123:123 additive', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V6 permit 65535', + ' set community 123:123 additive', + ], + [ + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4 seq 10 deny 0.0.0.0/0 le 17', + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4 seq 20 permit 20.20.30.0/24 le 32', + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4 seq 30 permit 40.50.0.0/16 le 32', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 10 deny ::/0 le 59', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 20 deny ::/0 ge 65', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 30 permit fc01:20::/64 le 128', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 40 permit fc01:30::/64 le 128', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V4 permit 30000', + ' match ip address prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V6 permit 30000', + ' match ipv6 address prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6', + ] + ) + +def test_set_handler_no_community_and_prefix_match_tag(): + set_del_test( + "SET", + ("DEPLOYMENT_ID|5", { + "prefixes_v4": "20.20.30.0/24,40.50.0.0/16", + "prefixes_v6": "fc01:20::/64,fc01:30::/64", + }), + [ + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V4 permit 65535', + ' set community 123:123 additive', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V6 permit 65535', + ' set community 123:123 additive', + ], + [ + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4 seq 10 deny 0.0.0.0/0 le 17', + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4 seq 20 permit 20.20.30.0/24 le 32', + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4 seq 30 permit 40.50.0.0/16 le 32', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 10 deny ::/0 le 59', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 20 deny ::/0 ge 65', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 30 permit fc01:20::/64 le 128', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 40 permit fc01:30::/64 le 128', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V4 permit 30000', + ' match ip address prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4', + ' set tag 1001', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V6 permit 30000', + ' match ipv6 address prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6', + ' set tag 1001', + ], + None,True + ) + +def test_set_handler_no_community_with_permit_action(): + set_del_test( + "SET", + ("DEPLOYMENT_ID|5", { + "prefixes_v4": "20.20.30.0/24,40.50.0.0/16", + "prefixes_v6": "fc01:20::/64,fc01:30::/64", + "default_action":"permit" + }), + [ + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V4 permit 65535', + ' set community 123:123 additive', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V6 permit 65535', + ' set community 123:123 additive', + ], + [ + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4 seq 10 deny 0.0.0.0/0 le 17', + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4 seq 20 permit 20.20.30.0/24 le 32', + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4 seq 30 permit 40.50.0.0/16 le 32', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 10 deny ::/0 le 59', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 20 deny ::/0 ge 65', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 30 permit fc01:20::/64 le 128', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 40 permit fc01:30::/64 le 128', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V4 permit 30000', + ' match ip address prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V6 permit 30000', + ' match ipv6 address prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6', + ] + ) +def test_set_handler_no_community_with_deny_action(): + set_del_test( + "SET", + ("DEPLOYMENT_ID|5", { + "prefixes_v4": "20.20.30.0/24,40.50.0.0/16", + "prefixes_v6": "fc01:20::/64,fc01:30::/64", + "default_action":"deny" + }), + [ + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V4 permit 65535', + ' set community 123:123 additive', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V6 permit 65535', + ' set community 123:123 additive', + ], [ 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4 seq 10 deny 0.0.0.0/0 le 17', 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4 seq 20 permit 20.20.30.0/24 le 32', 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4 seq 30 permit 40.50.0.0/16 le 32', - 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 10 deny 0::/0 le 59', - 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 20 deny 0::/0 ge 65', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 10 deny ::/0 le 59', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 20 deny ::/0 ge 65', 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 30 permit fc01:20::/64 le 128', 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 40 permit fc01:30::/64 le 128', 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V4 permit 30000', ' match ip address prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4', 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V6 permit 30000', ' match ipv6 address prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V4 permit 65535', + ' set community no-export additive', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V6 permit 65535', + ' set community no-export additive' ] ) @@ -114,8 +340,8 @@ def test_del_handler_with_community(): 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 10 deny 0.0.0.0/0 le 17', 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 20 permit 10.20.30.0/24 ge 25', 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 30 permit 30.50.0.0/16 ge 17', - 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 10 deny 0::/0 le 59', - 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 20 deny 0::/0 ge 65', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 10 deny ::/0 le 59', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 20 deny ::/0 ge 65', 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 30 permit fc00:20::/64 ge 65', 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 40 permit fc00:30::/64 ge 65', 'bgp community-list standard COMMUNITY_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020 permit 1010:2020', @@ -125,6 +351,11 @@ def test_del_handler_with_community(): 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V6 permit 10', ' match ipv6 address prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6', ' match community COMMUNITY_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V4 permit 65535', + ' set community 123:123 additive', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V6 permit 65535', + ' set community 123:123 additive', + "" ], [ @@ -136,6 +367,155 @@ def test_del_handler_with_community(): ] ) +def test_del_handler_with_exiting_community_deny_action(): + set_del_test( + "DEL", + ("DEPLOYMENT_ID|5|1010:2020",), + [ + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 10 deny 0.0.0.0/0 le 17', + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 20 permit 10.20.30.0/24 ge 25', + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 30 permit 30.50.0.0/16 ge 17', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 10 deny ::/0 le 59', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 20 deny ::/0 ge 65', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 30 permit fc00:20::/64 ge 65', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 40 permit fc00:30::/64 ge 65', + 'bgp community-list standard COMMUNITY_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020 permit 1010:2020', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V4 permit 10', + ' match ip address prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4', + ' match community COMMUNITY_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V6 permit 10', + ' match ipv6 address prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6', + ' match community COMMUNITY_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V4 permit 65535', + ' set community no-export additive', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V6 permit 65535', + ' set community no-export additive', + "" + ], + [ + 'no route-map ALLOW_LIST_DEPLOYMENT_ID_5_V4 permit 10', + 'no route-map ALLOW_LIST_DEPLOYMENT_ID_5_V6 permit 10', + 'no ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4', + 'no ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6', + 'no bgp community-list standard COMMUNITY_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V4 permit 65535', + ' set community 123:123 additive', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V6 permit 65535', + ' set community 123:123 additive', + ] + ) + + +def test_del_handler_with_exiting_community_permit_action(): + set_del_test( + "DEL", + ("DEPLOYMENT_ID|5|1010:2020",), + [ + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 10 deny 0.0.0.0/0 le 17', + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 20 permit 10.20.30.0/24 ge 25', + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 30 permit 30.50.0.0/16 ge 17', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 10 deny ::/0 le 59', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 20 deny ::/0 ge 65', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 30 permit fc00:20::/64 ge 65', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 40 permit fc00:30::/64 ge 65', + 'bgp community-list standard COMMUNITY_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020 permit 1010:2020', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V4 permit 10', + ' match ip address prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4', + ' match community COMMUNITY_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V6 permit 10', + ' match ipv6 address prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6', + ' match community COMMUNITY_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V4 permit 65535', + ' set community 123:123 additive', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V6 permit 65535', + ' set community 123:123 additive', + "" + ], + [ + 'no route-map ALLOW_LIST_DEPLOYMENT_ID_5_V4 permit 10', + 'no route-map ALLOW_LIST_DEPLOYMENT_ID_5_V6 permit 10', + 'no ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4', + 'no ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6', + 'no bgp community-list standard COMMUNITY_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020', + ] + ) + +def test_del_handler_with_exiting_community_deny_action_global_deny(): + set_del_test( + "DEL", + ("DEPLOYMENT_ID|5|1010:2020",), + [ + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 10 deny 0.0.0.0/0 le 17', + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 20 permit 10.20.30.0/24 ge 25', + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 30 permit 30.50.0.0/16 ge 17', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 10 deny ::/0 le 59', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 20 deny ::/0 ge 65', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 30 permit fc00:20::/64 ge 65', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 40 permit fc00:30::/64 ge 65', + 'bgp community-list standard COMMUNITY_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020 permit 1010:2020', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V4 permit 10', + ' match ip address prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4', + ' match community COMMUNITY_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V6 permit 10', + ' match ipv6 address prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6', + ' match community COMMUNITY_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V4 permit 65535', + ' set community no-export additive', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V6 permit 65535', + ' set community no-export additive', + "" + ], + [ + 'no route-map ALLOW_LIST_DEPLOYMENT_ID_5_V4 permit 10', + 'no route-map ALLOW_LIST_DEPLOYMENT_ID_5_V6 permit 10', + 'no ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4', + 'no ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6', + 'no bgp community-list standard COMMUNITY_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020', + ], + "deny" + ) + + +def test_del_handler_with_exiting_community_permit_action_global_deny(): + set_del_test( + "DEL", + ("DEPLOYMENT_ID|5|1010:2020",), + [ + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 10 deny 0.0.0.0/0 le 17', + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 20 permit 10.20.30.0/24 ge 25', + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 30 permit 30.50.0.0/16 ge 17', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 10 deny ::/0 le 59', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 20 deny ::/0 ge 65', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 30 permit fc00:20::/64 ge 65', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 40 permit fc00:30::/64 ge 65', + 'bgp community-list standard COMMUNITY_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020 permit 1010:2020', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V4 permit 10', + ' match ip address prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4', + ' match community COMMUNITY_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V6 permit 10', + ' match ipv6 address prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6', + ' match community COMMUNITY_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V4 permit 65535', + ' set community 123:123 additive', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V6 permit 65535', + ' set community 123:123 additive', + "" + ], + [ + 'no route-map ALLOW_LIST_DEPLOYMENT_ID_5_V4 permit 10', + 'no route-map ALLOW_LIST_DEPLOYMENT_ID_5_V6 permit 10', + 'no ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4', + 'no ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6', + 'no bgp community-list standard COMMUNITY_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V4 permit 65535', + ' set community no-export additive', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V6 permit 65535', + ' set community no-export additive', + ], + "deny" + ) + + def test_del_handler_no_community(): set_del_test( "DEL", @@ -144,14 +524,18 @@ def test_del_handler_no_community(): 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4 seq 10 deny 0.0.0.0/0 le 17', 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4 seq 20 permit 20.20.30.0/24 ge 25', 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4 seq 30 permit 40.50.0.0/16 ge 17', - 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 10 deny 0::/0 le 59', - 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 20 deny 0::/0 ge 65', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 10 deny ::/0 le 59', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 20 deny ::/0 ge 65', 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 30 permit fc01:20::/64 ge 65', 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 40 permit fc01:30::/64 ge 65', 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V4 permit 30000', ' match ip address prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4', 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V6 permit 30000', ' match ipv6 address prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V4 permit 65535', + ' set community 123:123 additive', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V6 permit 65535', + ' set community 123:123 additive', " " ], [ @@ -161,6 +545,75 @@ def test_del_handler_no_community(): 'no ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6', ] ) +def test_del_handler_with_no_community_deny_action(): + set_del_test( + "DEL", + ("DEPLOYMENT_ID|5",), + [ + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4 seq 10 deny 0.0.0.0/0 le 17', + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4 seq 20 permit 20.20.30.0/24 ge 25', + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4 seq 30 permit 40.50.0.0/16 ge 17', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 10 deny ::/0 le 59', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 20 deny ::/0 ge 65', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 30 permit fc01:20::/64 ge 65', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 40 permit fc01:30::/64 ge 65', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V4 permit 30000', + ' match ip address prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V6 permit 30000', + ' match ipv6 address prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V4 permit 65535', + ' set community no-export additive', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V6 permit 65535', + ' set community no-export additive', + "" + ], + [ + 'no route-map ALLOW_LIST_DEPLOYMENT_ID_5_V4 permit 30000', + 'no route-map ALLOW_LIST_DEPLOYMENT_ID_5_V6 permit 30000', + 'no ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4', + 'no ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V4 permit 65535', + ' set community 123:123 additive', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V6 permit 65535', + ' set community 123:123 additive', + ] + ) +def test_del_handler_with_no_community_permit_action_global_deny(): + set_del_test( + "DEL", + ("DEPLOYMENT_ID|5",), + [ + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4 seq 10 deny 0.0.0.0/0 le 17', + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4 seq 20 permit 20.20.30.0/24 ge 25', + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4 seq 30 permit 40.50.0.0/16 ge 17', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 10 deny ::/0 le 59', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 20 deny ::/0 ge 65', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 30 permit fc01:20::/64 ge 65', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 40 permit fc01:30::/64 ge 65', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V4 permit 30000', + ' match ip address prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V6 permit 30000', + ' match ipv6 address prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V4 permit 65535', + ' set community 123:123 additive', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V6 permit 65535', + ' set community 123:123 additive', + "" + ], + [ + 'no route-map ALLOW_LIST_DEPLOYMENT_ID_5_V4 permit 30000', + 'no route-map ALLOW_LIST_DEPLOYMENT_ID_5_V6 permit 30000', + 'no ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4', + 'no ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V4 permit 65535', + ' set community no-export additive', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V6 permit 65535', + ' set community no-export additive', + ], + "deny" + ) + + def test_set_handler_with_community_data_is_already_presented(): set_del_test( @@ -173,8 +626,8 @@ def test_set_handler_with_community_data_is_already_presented(): 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 10 deny 0.0.0.0/0 le 17', 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 20 permit 10.20.30.0/24 le 32', 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 30 permit 30.50.0.0/16 le 32', - 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 10 deny 0::/0 le 59', - 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 20 deny 0::/0 ge 65', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 10 deny ::/0 le 59', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 20 deny ::/0 ge 65', 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 30 permit fc00:20::/64 le 128', 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 40 permit fc00:30::/64 le 128', 'bgp community-list standard COMMUNITY_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020 permit 1010:2020', @@ -184,6 +637,10 @@ def test_set_handler_with_community_data_is_already_presented(): 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V6 permit 10', ' match ipv6 address prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6', ' match community COMMUNITY_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V4 permit 65535', + ' set community 123:123 additive', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V6 permit 65535', + ' set community 123:123 additive', "" ], [] @@ -198,14 +655,18 @@ def test_set_handler_no_community_data_is_already_presented(): 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4 seq 10 deny 0.0.0.0/0 le 17', 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4 seq 20 permit 20.20.30.0/24 le 32', 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4 seq 30 permit 40.50.0.0/16 le 32', - 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 10 deny 0::/0 le 59', - 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 20 deny 0::/0 ge 65', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 10 deny ::/0 le 59', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 20 deny ::/0 ge 65', 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 30 permit fc01:20::/64 le 128', 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 40 permit fc01:30::/64 le 128', 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V4 permit 30000', ' match ip address prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4', 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V6 permit 30000', ' match ipv6 address prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V4 permit 65535', + ' set community 123:123 additive', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V6 permit 65535', + ' set community 123:123 additive', "" ] common_objs = { @@ -225,7 +686,12 @@ def test_del_handler_with_community_no_data(): set_del_test( "DEL", ("DEPLOYMENT_ID|5|1010:2020",), - [""], + [ + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V4 permit 65535', + ' set community 123:123 additive', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V6 permit 65535', + ' set community 123:123 additive' + ], [] ) @@ -233,7 +699,12 @@ def test_del_handler_no_community_no_data(): set_del_test( "DEL", ("DEPLOYMENT_ID|5",), - [""], + [ + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V4 permit 65535', + ' set community 123:123 additive', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V6 permit 65535', + ' set community 123:123 additive' + ], [] ) @@ -248,8 +719,8 @@ def test_set_handler_with_community_update_prefixes_add(): 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 10 deny 0.0.0.0/0 le 17', 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 20 permit 10.20.30.0/24 le 32', 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 30 permit 30.50.0.0/16 le 32', - 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 10 deny 0::/0 le 59', - 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 20 deny 0::/0 ge 65', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 10 deny ::/0 le 59', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 20 deny ::/0 ge 65', 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 30 permit fc00:20::/64 le 128', 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 40 permit fc00:30::/64 le 128', 'bgp community-list standard COMMUNITY_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020 permit 1010:2020', @@ -259,6 +730,10 @@ def test_set_handler_with_community_update_prefixes_add(): 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V6 permit 10', ' match ipv6 address prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6', ' match community COMMUNITY_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V4 permit 65535', + ' set community 123:123 additive', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V6 permit 65535', + ' set community 123:123 additive', "" ], [ @@ -268,8 +743,8 @@ def test_set_handler_with_community_update_prefixes_add(): 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 30 permit 30.50.0.0/16 le 32', 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 40 permit 80.90.0.0/16 le 32', 'no ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6', - 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 10 deny 0::/0 le 59', - 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 20 deny 0::/0 ge 65', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 10 deny ::/0 le 59', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 20 deny ::/0 ge 65', 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 30 permit fc00:20::/64 le 128', 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 40 permit fc00:30::/64 le 128', 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 50 permit fc02::/64 le 128', @@ -287,14 +762,18 @@ def test_set_handler_no_community_update_prefixes_add(): 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4 seq 10 deny 0.0.0.0/0 le 17', 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4 seq 20 permit 20.20.30.0/24 le 32', 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4 seq 30 permit 40.50.0.0/16 le 32', - 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 10 deny 0::/0 le 59', - 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 20 deny 0::/0 ge 65', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 10 deny ::/0 le 59', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 20 deny ::/0 ge 65', 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 30 permit fc01:20::/64 le 128', 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 40 permit fc01:30::/64 le 128', 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V4 permit 30000', ' match ip address prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4', 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V6 permit 30000', ' match ipv6 address prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V4 permit 65535', + ' set community 123:123 additive', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V6 permit 65535', + ' set community 123:123 additive', "" ], [ @@ -304,14 +783,214 @@ def test_set_handler_no_community_update_prefixes_add(): 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4 seq 30 permit 40.50.0.0/16 le 32', 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4 seq 40 permit 80.90.0.0/16 le 32', 'no ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6', - 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 10 deny 0::/0 le 59', - 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 20 deny 0::/0 ge 65', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 10 deny ::/0 le 59', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 20 deny ::/0 ge 65', 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 30 permit fc01:20::/64 le 128', 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 40 permit fc01:30::/64 le 128', 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 50 permit fc02::/64 le 128', ] ) +def test_set_handler_with_community_update_prefixes_remove(): + set_del_test( + "SET", + ("DEPLOYMENT_ID|5|1010:2020", { + "prefixes_v4": "10.20.30.0/24", + "prefixes_v6": "fc00:20::/64", + }), + [ + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 10 deny 0.0.0.0/0 le 17', + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 20 permit 10.20.30.0/24 le 32', + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 30 permit 30.50.0.0/16 le 32', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 10 deny ::/0 le 59', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 20 deny ::/0 ge 65', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 30 permit fc00:20::/64 le 128', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 40 permit fc00:30::/64 le 128', + 'bgp community-list standard COMMUNITY_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020 permit 1010:2020', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V4 permit 10', + ' match ip address prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4', + ' match community COMMUNITY_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V6 permit 10', + ' match ipv6 address prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6', + ' match community COMMUNITY_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V4 permit 65535', + ' set community 123:123 additive', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V6 permit 65535', + ' set community 123:123 additive', + "" + ], + [ + 'no ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4', + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 10 deny 0.0.0.0/0 le 17', + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V4 seq 20 permit 10.20.30.0/24 le 32', + 'no ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 10 deny ::/0 le 59', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 20 deny ::/0 ge 65', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_1010:2020_V6 seq 30 permit fc00:20::/64 le 128', + ] + ) + +def test_set_handler_no_community_update_prefixes_remove(): + set_del_test( + "SET", + ("DEPLOYMENT_ID|5", { + "prefixes_v4": "20.20.30.0/24", + "prefixes_v6": "fc01:20::/64", + }), + [ + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4 seq 10 deny 0.0.0.0/0 le 17', + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4 seq 20 permit 20.20.30.0/24 le 32', + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4 seq 30 permit 40.50.0.0/16 le 32', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 10 deny ::/0 le 59', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 20 deny ::/0 ge 65', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 30 permit fc01:20::/64 le 128', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 40 permit fc01:30::/64 le 128', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V4 permit 30000', + ' match ip address prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V6 permit 30000', + ' match ipv6 address prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V4 permit 65535', + ' set community 123:123 additive', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_V6 permit 65535', + ' set community 123:123 additive', + "" + ], + [ + 'no ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4', + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4 seq 10 deny 0.0.0.0/0 le 17', + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V4 seq 20 permit 20.20.30.0/24 le 32', + 'no ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 10 deny ::/0 le 59', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 20 deny ::/0 ge 65', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_COMMUNITY_empty_V6 seq 30 permit fc01:20::/64 le 128', + ] + ) + +def test_set_handler_with_neighbor_type(): + set_del_test( + "SET", + ("DEPLOYMENT_ID|5|NEIGHBOR_TYPE|OpticalLonghaulTerminal", { + "prefixes_v4": "10.62.64.0/22 ge 30,"\ + "10.1.44.0/23 ge 30,"\ + "10.17.92.0/23 ge 30,"\ + "10.73.92.0/23 ge 30,"\ + "10.26.170.0/24 ge 30,"\ + "10.26.171.0/24 ge 30,"\ + "10.26.255.0/24 ge 30", + "prefixes_v6": "fc01:20::/64", + }), + [ + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_NEIGHBOR_OpticalLonghaulTerminal_COMMUNITY_empty_V4 seq 10 deny 0.0.0.0/0 le 17', + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_NEIGHBOR_OpticalLonghaulTerminal_COMMUNITY_empty_V4 seq 20 permit 20.20.30.0/24 le 32', + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_NEIGHBOR_OpticalLonghaulTerminal_COMMUNITY_empty_V4 seq 30 permit 40.50.0.0/16 le 32', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_NEIGHBOR_OpticalLonghaulTerminal_COMMUNITY_empty_V6 seq 10 deny ::/0 le 59', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_NEIGHBOR_OpticalLonghaulTerminal_COMMUNITY_empty_V6 seq 20 deny ::/0 ge 65', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_NEIGHBOR_OpticalLonghaulTerminal_COMMUNITY_empty_V6 seq 30 permit fc01:20::/64 le 128', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_NEIGHBOR_OpticalLonghaulTerminal_COMMUNITY_empty_V6 seq 40 permit fc01:30::/64 le 128', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_NEIGHBOR_OpticalLonghaulTerminal_V4 permit 30000', + ' match ip address prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_NEIGHBOR_OpticalLonghaulTerminal_COMMUNITY_empty_V4', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_NEIGHBOR_OpticalLonghaulTerminal_V6 permit 30000', + ' match ipv6 address prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_NEIGHBOR_OpticalLonghaulTerminal_COMMUNITY_empty_V6', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_NEIGHBOR_OpticalLonghaulTerminal_V4 permit 65535', + ' set community 123:123 additive', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_NEIGHBOR_OpticalLonghaulTerminal_V6 permit 65535', + ' set community 123:123 additive', + "" + ], + [ + 'no ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_NEIGHBOR_OpticalLonghaulTerminal_COMMUNITY_empty_V4', + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_NEIGHBOR_OpticalLonghaulTerminal_COMMUNITY_empty_V4 seq 10 deny 0.0.0.0/0 le 17', + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_NEIGHBOR_OpticalLonghaulTerminal_COMMUNITY_empty_V4 seq 20 permit 10.62.64.0/22 ge 30', + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_NEIGHBOR_OpticalLonghaulTerminal_COMMUNITY_empty_V4 seq 30 permit 10.1.44.0/23 ge 30', + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_NEIGHBOR_OpticalLonghaulTerminal_COMMUNITY_empty_V4 seq 40 permit 10.17.92.0/23 ge 30', + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_NEIGHBOR_OpticalLonghaulTerminal_COMMUNITY_empty_V4 seq 50 permit 10.73.92.0/23 ge 30', + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_NEIGHBOR_OpticalLonghaulTerminal_COMMUNITY_empty_V4 seq 60 permit 10.26.170.0/24 ge 30', + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_NEIGHBOR_OpticalLonghaulTerminal_COMMUNITY_empty_V4 seq 70 permit 10.26.171.0/24 ge 30', + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_NEIGHBOR_OpticalLonghaulTerminal_COMMUNITY_empty_V4 seq 80 permit 10.26.255.0/24 ge 30', + 'no ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_NEIGHBOR_OpticalLonghaulTerminal_COMMUNITY_empty_V6', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_NEIGHBOR_OpticalLonghaulTerminal_COMMUNITY_empty_V6 seq 10 deny ::/0 le 59', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_NEIGHBOR_OpticalLonghaulTerminal_COMMUNITY_empty_V6 seq 20 deny ::/0 ge 65', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_NEIGHBOR_OpticalLonghaulTerminal_COMMUNITY_empty_V6 seq 30 permit fc01:20::/64 le 128', + ] + ) + +def test_set_handler_with_neighbor_type_and_community(): + set_del_test( + "SET", + ("DEPLOYMENT_ID|5|NEIGHBOR_TYPE|OpticalLonghaulTerminal|1010:2020", { + "prefixes_v4": "10.62.64.0/22 ge 30,"\ + "10.1.44.0/23 ge 30,"\ + "10.17.92.0/23 ge 30,"\ + "10.73.92.0/23 ge 30,"\ + "10.26.170.0/24 ge 30,"\ + "10.26.171.0/24 ge 30,"\ + "10.26.255.0/24 ge 30", + "prefixes_v6": "fc01:20::/64", + }), + [ + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_NEIGHBOR_OpticalLonghaulTerminal_COMMUNITY_1010:2020_V4 seq 10 deny 0.0.0.0/0 le 17', + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_NEIGHBOR_OpticalLonghaulTerminal_COMMUNITY_1010:2020_V4 seq 20 permit 20.20.30.0/24 le 32', + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_NEIGHBOR_OpticalLonghaulTerminal_COMMUNITY_1010:2020_V4 seq 30 permit 40.50.0.0/16 le 32', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_NEIGHBOR_OpticalLonghaulTerminal_COMMUNITY_1010:2020_V6 seq 10 deny ::/0 le 59', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_NEIGHBOR_OpticalLonghaulTerminal_COMMUNITY_1010:2020_V6 seq 20 deny ::/0 ge 65', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_NEIGHBOR_OpticalLonghaulTerminal_COMMUNITY_1010:2020_V6 seq 30 permit fc01:20::/64 le 128', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_NEIGHBOR_OpticalLonghaulTerminal_COMMUNITY_1010:2020_V6 seq 40 permit fc01:30::/64 le 128', + 'bgp community-list standard COMMUNITY_ALLOW_LIST_DEPLOYMENT_ID_5_NEIGHBOR_OpticalLonghaulTerminal_COMMUNITY_1010:2020 permit 1010:2020', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_NEIGHBOR_OpticalLonghaulTerminal_V4 permit 10', + ' match ip address prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_NEIGHBOR_OpticalLonghaulTerminal_COMMUNITY_1010:2020_V4', + ' match community COMMUNITY_ALLOW_LIST_DEPLOYMENT_ID_5_NEIGHBOR_OpticalLonghaulTerminal_COMMUNITY_1010:2020', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_NEIGHBOR_OpticalLonghaulTerminal_V6 permit 10', + ' match ipv6 address prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_NEIGHBOR_OpticalLonghaulTerminal_COMMUNITY_1010:2020_V6', + ' match community COMMUNITY_ALLOW_LIST_DEPLOYMENT_ID_5_NEIGHBOR_OpticalLonghaulTerminal_COMMUNITY_1010:2020', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_NEIGHBOR_OpticalLonghaulTerminal_V4 permit 65535', + ' set community 123:123 additive', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_NEIGHBOR_OpticalLonghaulTerminal_V6 permit 65535', + ' set community 123:123 additive', + "" + ], + [ + 'no ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_NEIGHBOR_OpticalLonghaulTerminal_COMMUNITY_1010:2020_V4', + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_NEIGHBOR_OpticalLonghaulTerminal_COMMUNITY_1010:2020_V4 seq 10 deny 0.0.0.0/0 le 17', + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_NEIGHBOR_OpticalLonghaulTerminal_COMMUNITY_1010:2020_V4 seq 20 permit 10.62.64.0/22 ge 30', + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_NEIGHBOR_OpticalLonghaulTerminal_COMMUNITY_1010:2020_V4 seq 30 permit 10.1.44.0/23 ge 30', + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_NEIGHBOR_OpticalLonghaulTerminal_COMMUNITY_1010:2020_V4 seq 40 permit 10.17.92.0/23 ge 30', + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_NEIGHBOR_OpticalLonghaulTerminal_COMMUNITY_1010:2020_V4 seq 50 permit 10.73.92.0/23 ge 30', + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_NEIGHBOR_OpticalLonghaulTerminal_COMMUNITY_1010:2020_V4 seq 60 permit 10.26.170.0/24 ge 30', + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_NEIGHBOR_OpticalLonghaulTerminal_COMMUNITY_1010:2020_V4 seq 70 permit 10.26.171.0/24 ge 30', + 'ip prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_NEIGHBOR_OpticalLonghaulTerminal_COMMUNITY_1010:2020_V4 seq 80 permit 10.26.255.0/24 ge 30', + 'no ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_NEIGHBOR_OpticalLonghaulTerminal_COMMUNITY_1010:2020_V6', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_NEIGHBOR_OpticalLonghaulTerminal_COMMUNITY_1010:2020_V6 seq 10 deny ::/0 le 59', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_NEIGHBOR_OpticalLonghaulTerminal_COMMUNITY_1010:2020_V6 seq 20 deny ::/0 ge 65', + 'ipv6 prefix-list PL_ALLOW_LIST_DEPLOYMENT_ID_5_NEIGHBOR_OpticalLonghaulTerminal_COMMUNITY_1010:2020_V6 seq 30 permit fc01:20::/64 le 128', + ] + ) + +def test_del_handler_with_neighbor_type_community_no_data(): + set_del_test( + "DEL", + ("DEPLOYMENT_ID|5|NEIGHBOR_TYPE|OpticalLonghaulTerminal|1010:2020",), + [ + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_NEIGHBOR_OpticalLonghaulTerminal_V4 permit 65535', + ' set community 123:123 additive', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_NEIGHBOR_OpticalLonghaulTerminal_V6 permit 65535', + ' set community 123:123 additive' + ], + [] + ) + +def test_del_handler_with_neighbor_type_no_data(): + set_del_test( + "DEL", + ("DEPLOYMENT_ID|5|NEIGHBOR_TYPE|OpticalLonghaulTerminal",), + [ + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_NEIGHBOR_OpticalLonghaulTerminal_V4 permit 65535', + ' set community 123:123 additive', + 'route-map ALLOW_LIST_DEPLOYMENT_ID_5_NEIGHBOR_OpticalLonghaulTerminal_V6 permit 65535', + ' set community 123:123 additive' + ], + [] + ) + @patch.dict("sys.modules", swsscommon=swsscommon_module_mock) def test___set_handler_validate(): from bgpcfgd.managers_allow_list import BGPAllowListMgr @@ -340,7 +1019,7 @@ def test___set_handler_validate(): }) @patch.dict("sys.modules", swsscommon=swsscommon_module_mock) -def test___find_peer_group_by_deployment_id(): +def test___find_peer_group(): from bgpcfgd.managers_allow_list import BGPAllowListMgr cfg_mgr = MagicMock() cfg_mgr.update.return_value = None @@ -430,7 +1109,7 @@ def test___find_peer_group_by_deployment_id(): 'constants': global_constants, } mgr = BGPAllowListMgr(common_objs, "CONFIG_DB", "BGP_ALLOWED_PREFIXES") - values = mgr._BGPAllowListMgr__find_peer_group_by_deployment_id(0) + values = mgr._BGPAllowListMgr__find_peer_group(0, '') assert set(values) == {'PEER_V4_INT', 'PEER_V6_INT', 'PEER_V6', 'PEER_V4'} @patch.dict("sys.modules", swsscommon=swsscommon_module_mock) @@ -450,4 +1129,114 @@ def test___to_prefix_list(): res_v6 = mgr._BGPAllowListMgr__to_prefix_list(mgr.V6, ["fc00::1/128", "fc00::/64"]) assert res_v6 == ["permit fc00::1/128", "permit fc00::/64 le 128"] +@patch.dict("sys.modules", swsscommon=swsscommon_module_mock) +def construct_BGPAllowListMgr(constants): + from bgpcfgd.managers_allow_list import BGPAllowListMgr + cfg_mgr = MagicMock() + common_objs = { + 'directory': Directory(), + 'cfg_mgr': cfg_mgr, + 'tf': TemplateFabric(), + 'constants': constants, + } + mgr = BGPAllowListMgr(common_objs, "CONFIG_DB", "BGP_ALLOWED_PREFIXES") + return mgr + +def test___get_enabled_enabled(): + constants = { + "bgp": { + "allow_list": { + "enabled": True, + } + } + } + mgr = construct_BGPAllowListMgr(constants) + assert mgr._BGPAllowListMgr__get_enabled() + +def test___get_enabled_disabled_1(): + constants = { + "bgp": { + "allow_list": { + "enabled": False, + } + } + } + mgr = construct_BGPAllowListMgr(constants) + assert not mgr._BGPAllowListMgr__get_enabled() + +def test___get_enabled_disabled_2(): + constants = { + "bgp": { + "allow_list": {} + } + } + mgr = construct_BGPAllowListMgr(constants) + assert not mgr._BGPAllowListMgr__get_enabled() + +def test___get_enabled_disabled_3(): + constants = { + "bgp": {} + } + mgr = construct_BGPAllowListMgr(constants) + assert not mgr._BGPAllowListMgr__get_enabled() + +def test___get_enabled_disabled_4(): + constants = {} + mgr = construct_BGPAllowListMgr(constants) + assert not mgr._BGPAllowListMgr__get_enabled() + +def test___get_default_action_deny(): + constants = { + "bgp": { + "allow_list": { + "enabled": True, + "default_action": "deny", + "drop_community": "123:123" + } + } + } + data = {} + mgr = construct_BGPAllowListMgr(constants) + assert mgr._BGPAllowListMgr__get_default_action_community(data) == "no-export" + +def test___get_default_action_permit_1(): + constants = { + "bgp": { + "allow_list": { + "enabled": True, + "default_action": "permit", + "drop_community": "123:123" + } + } + } + data = {} + mgr = construct_BGPAllowListMgr(constants) + assert mgr._BGPAllowListMgr__get_default_action_community(data) == "123:123" + +def test___get_default_action_permit_2(): + constants = { + "bgp": { + "allow_list": { + "enabled": True, + "drop_community": "123:123" + } + } + } + data = {} + mgr = construct_BGPAllowListMgr(constants) + assert mgr._BGPAllowListMgr__get_default_action_community(data) == "123:123" + +def test___get_default_action_permit_3(): + constants = { + "bgp": { + "allow_list": { + "enabled": False, + "drop_community": "123:123" + } + } + } + data = {} + mgr = construct_BGPAllowListMgr(constants) + assert mgr._BGPAllowListMgr__get_default_action_community(data) == "123:123" + # FIXME: more testcases for coverage diff --git a/src/sonic-bgpcfgd/tests/test_bbr.py b/src/sonic-bgpcfgd/tests/test_bbr.py index 45b8aa7c8f07..b11277bae7b8 100644 --- a/src/sonic-bgpcfgd/tests/test_bbr.py +++ b/src/sonic-bgpcfgd/tests/test_bbr.py @@ -252,7 +252,7 @@ def test___set_validation_4(): def test___set_validation_5(): __set_validation_common("all", {"status": "disabled"}, None, True) -def __set_prepare_config_common(status, bbr_enabled_pgs, available_pgs, expected_cmds): +def __set_prepare_config_common(status, bbr_enabled_pgs, available_pgs, expected_cmds, bbr_applied_pgs=None): cfg_mgr = MagicMock() common_objs = { 'directory': Directory(), @@ -269,10 +269,10 @@ def __set_prepare_config_common(status, bbr_enabled_pgs, available_pgs, expected } } m.bbr_enabled_pgs = bbr_enabled_pgs - m._BBRMgr__get_available_peer_groups = MagicMock(return_value = available_pgs) + m._BBRMgr__get_available_peer_groups = MagicMock(return_value = sorted(available_pgs)) cmds, peer_groups = m._BBRMgr__set_prepare_config(status) assert cmds == expected_cmds - assert set(peer_groups) == available_pgs + assert set(peer_groups) == (available_pgs if not bbr_applied_pgs else bbr_applied_pgs) def test___set_prepare_config_enabled(): __set_prepare_config_common("enabled", { @@ -327,7 +327,41 @@ def test___set_prepare_config_disabled_part(): ' no neighbor PEER_V4 allowas-in 1', ' no neighbor PEER_V6 allowas-in 1', ]) +def test___set_prepare_config_enabled_multiple_peers(): + __set_prepare_config_common("enabled", { + "PEER_V4": ["ipv4"], + "PEER_V6": ["ipv6"], + }, {"PEER_V4", "PEER_V4_DEPLOYMENT_ID_0", "PEER_V4_DEPLOYMENT_ID_1", "PEER_V6", "PEER_V6_DEPLOYMENT_ID_0", "PEER_V6_DEPLOYMENT_ID_1", "PEER_INVALID"}, + [ + 'router bgp 65500', + ' address-family ipv4', + ' neighbor PEER_V4 allowas-in 1', + ' neighbor PEER_V4_DEPLOYMENT_ID_0 allowas-in 1', + ' neighbor PEER_V4_DEPLOYMENT_ID_1 allowas-in 1', + ' address-family ipv6', + ' neighbor PEER_V6 allowas-in 1', + ' neighbor PEER_V6_DEPLOYMENT_ID_0 allowas-in 1', + ' neighbor PEER_V6_DEPLOYMENT_ID_1 allowas-in 1', + ], + {"PEER_V4", "PEER_V4_DEPLOYMENT_ID_0", "PEER_V4_DEPLOYMENT_ID_1", "PEER_V6", "PEER_V6_DEPLOYMENT_ID_0", "PEER_V6_DEPLOYMENT_ID_1"}) +def test___set_prepare_config_disabled_multiple_peers(): + __set_prepare_config_common("disabled", { + "PEER_V4": ["ipv4"], + "PEER_V6": ["ipv6"], + }, {"PEER_V4", "PEER_V4_DEPLOYMENT_ID_0", "PEER_V4_DEPLOYMENT_ID_1", "PEER_V6", "PEER_V6_DEPLOYMENT_ID_0", "PEER_V6_DEPLOYMENT_ID_1", "PEER_INVALID"}, + [ + 'router bgp 65500', + ' address-family ipv4', + ' no neighbor PEER_V4 allowas-in 1', + ' no neighbor PEER_V4_DEPLOYMENT_ID_0 allowas-in 1', + ' no neighbor PEER_V4_DEPLOYMENT_ID_1 allowas-in 1', + ' address-family ipv6', + ' no neighbor PEER_V6 allowas-in 1', + ' no neighbor PEER_V6_DEPLOYMENT_ID_0 allowas-in 1', + ' no neighbor PEER_V6_DEPLOYMENT_ID_1 allowas-in 1', + ], + {"PEER_V4", "PEER_V4_DEPLOYMENT_ID_0", "PEER_V4_DEPLOYMENT_ID_1", "PEER_V6", "PEER_V6_DEPLOYMENT_ID_0", "PEER_V6_DEPLOYMENT_ID_1"}) def test__get_available_peer_groups(): cfg_mgr = MagicMock() diff --git a/src/sonic-bgpcfgd/tests/test_bgp.py b/src/sonic-bgpcfgd/tests/test_bgp.py new file mode 100644 index 000000000000..a4c5ef997725 --- /dev/null +++ b/src/sonic-bgpcfgd/tests/test_bgp.py @@ -0,0 +1,112 @@ +from unittest.mock import MagicMock, patch + +import os +from bgpcfgd.directory import Directory +from bgpcfgd.template import TemplateFabric +from . import swsscommon_test +from .util import load_constants +from swsscommon import swsscommon +import bgpcfgd.managers_bgp + +TEMPLATE_PATH = os.path.abspath('../../dockers/docker-fpm-frr/frr') + +def constructor(): + cfg_mgr = MagicMock() + constants = load_constants()['constants'] + common_objs = { + 'directory': Directory(), + 'cfg_mgr': cfg_mgr, + 'tf': TemplateFabric(TEMPLATE_PATH), + 'constants': constants + } + + return_value_map = { + "['vtysh', '-c', 'show bgp vrfs json']": (0, "{\"vrfs\": {\"default\": {}}}", ""), + "['vtysh', '-c', 'show bgp vrf default neighbors json']": (0, "{\"10.10.10.1\": {}, \"20.20.20.1\": {}, \"fc00:10::1\": {}}", "") + } + + bgpcfgd.managers_bgp.run_command = lambda cmd: return_value_map[str(cmd)] + m = bgpcfgd.managers_bgp.BGPPeerMgrBase(common_objs, "CONFIG_DB", swsscommon.CFG_BGP_NEIGHBOR_TABLE_NAME, "general", True) + assert m.peer_type == "general" + assert m.check_neig_meta == ('bgp' in constants and 'use_neighbors_meta' in constants['bgp'] and constants['bgp']['use_neighbors_meta']) + + m.directory.put("CONFIG_DB", swsscommon.CFG_DEVICE_METADATA_TABLE_NAME, "localhost", {"bgp_asn": "65100"}) + m.directory.put("CONFIG_DB", swsscommon.CFG_LOOPBACK_INTERFACE_TABLE_NAME, "Loopback0|11.11.11.11/32", {}) + m.directory.put("CONFIG_DB", swsscommon.CFG_LOOPBACK_INTERFACE_TABLE_NAME, "Loopback0|FC00:1::32/128", {}) + m.directory.put("LOCAL", "local_addresses", "30.30.30.30", {"interface": "Ethernet4|30.30.30.30/24"}) + m.directory.put("LOCAL", "local_addresses", "fc00:20::20", {"interface": "Ethernet8|fc00:20::20/96"}) + m.directory.put("LOCAL", "interfaces", "Ethernet4|30.30.30.30/24", {"anything": "anything"}) + m.directory.put("LOCAL", "interfaces", "Ethernet8|fc00:20::20/96", {"anything": "anything"}) + + return m + +@patch('bgpcfgd.managers_bgp.log_info') +def test_update_peer_up(mocked_log_info): + m = constructor() + res = m.set_handler("10.10.10.1", {"admin_status": "up"}) + assert res, "Expect True return value for peer update" + mocked_log_info.assert_called_with("Peer 'default|10.10.10.1' admin state is set to 'up'") + +@patch('bgpcfgd.managers_bgp.log_info') +def test_update_peer_up_ipv6(mocked_log_info): + m = constructor() + res = m.set_handler("fc00:10::1", {"admin_status": "up"}) + assert res, "Expect True return value for peer update" + mocked_log_info.assert_called_with("Peer 'default|fc00:10::1' admin state is set to 'up'") + +@patch('bgpcfgd.managers_bgp.log_info') +def test_update_peer_down(mocked_log_info): + m = constructor() + res = m.set_handler("10.10.10.1", {"admin_status": "down"}) + assert res, "Expect True return value for peer update" + mocked_log_info.assert_called_with("Peer 'default|10.10.10.1' admin state is set to 'down'") + +@patch('bgpcfgd.managers_bgp.log_err') +def test_update_peer_no_admin_status(mocked_log_err): + m = constructor() + res = m.set_handler("10.10.10.1", {"anything": "anything"}) + assert res, "Expect True return value for peer update" + mocked_log_err.assert_called_with("Peer '(default|10.10.10.1)': Can't update the peer. Only 'admin_status' attribute is supported") + +@patch('bgpcfgd.managers_bgp.log_err') +def test_update_peer_invalid_admin_status(mocked_log_err): + m = constructor() + res = m.set_handler("10.10.10.1", {"admin_status": "invalid"}) + assert res, "Expect True return value for peer update" + mocked_log_err.assert_called_with("Peer 'default|10.10.10.1': Can't update the peer. It has wrong attribute value attr['admin_status'] = 'invalid'") + +def test_add_peer(): + m = constructor() + res = m.set_handler("30.30.30.1", {"local_addr": "30.30.30.30", "admin_status": "up"}) + assert res, "Expect True return value" + +def test_add_peer_ipv6(): + m = constructor() + res = m.set_handler("fc00:20::1", {"local_addr": "fc00:20::20", "admin_status": "up"}) + assert res, "Expect True return value" + +@patch('bgpcfgd.managers_bgp.log_warn') +def test_add_peer_no_local_addr(mocked_log_warn): + m = constructor() + res = m.set_handler("30.30.30.1", {"admin_status": "up"}) + assert res, "Expect True return value" + mocked_log_warn.assert_called_with("Peer 30.30.30.1. Missing attribute 'local_addr'") + +@patch('bgpcfgd.managers_bgp.log_debug') +def test_add_peer_invalid_local_addr(mocked_log_debug): + m = constructor() + res = m.set_handler("30.30.30.1", {"local_addr": "40.40.40.40", "admin_status": "up"}) + assert not res, "Expect False return value" + mocked_log_debug.assert_called_with("Peer '30.30.30.1' with local address '40.40.40.40' wait for the corresponding interface to be set") + +@patch('bgpcfgd.managers_bgp.log_info') +def test_del_handler(mocked_log_info): + m = constructor() + m.del_handler("10.10.10.1") + mocked_log_info.assert_called_with("Peer '(default|10.10.10.1)' has been removed") + +@patch('bgpcfgd.managers_bgp.log_warn') +def test_del_handler_nonexist_peer(mocked_log_warn): + m = constructor() + m.del_handler("40.40.40.1") + mocked_log_warn.assert_called_with("Peer '(default|40.40.40.1)' has not been found") diff --git a/src/sonic-bgpcfgd/tests/test_db.py b/src/sonic-bgpcfgd/tests/test_db.py new file mode 100644 index 000000000000..7078bc2735f0 --- /dev/null +++ b/src/sonic-bgpcfgd/tests/test_db.py @@ -0,0 +1,40 @@ +from unittest.mock import MagicMock, patch + +from bgpcfgd.directory import Directory +from bgpcfgd.template import TemplateFabric +from . import swsscommon_test +from swsscommon import swsscommon + +with patch.dict("sys.modules", swsscommon=swsscommon_test): + from bgpcfgd.managers_db import BGPDataBaseMgr + +def test_set_del_handler(): + cfg_mgr = MagicMock() + common_objs = { + 'directory': Directory(), + 'cfg_mgr': cfg_mgr, + 'tf': TemplateFabric(), + 'constants': {}, + } + m = BGPDataBaseMgr(common_objs, "CONFIG_DB", swsscommon.CFG_DEVICE_METADATA_TABLE_NAME) + assert m.constants == {} + + # test set_handler + res = m.set_handler("test_key1", {"test_value1"}) + assert res, "Returns always True" + assert "test_key1" in m.directory.get_slot(m.db_name, m.table_name) + assert m.directory.get(m.db_name, m.table_name, "test_key1") == {"test_value1"} + + res = m.set_handler("test_key2", {}) + assert res, "Returns always True" + assert "test_key2" in m.directory.get_slot(m.db_name, m.table_name) + assert m.directory.get(m.db_name, m.table_name, "test_key2") == {} + + # test del_handler + m.del_handler("test_key") + assert "test_key" not in m.directory.get_slot(m.db_name, m.table_name) + assert "test_key2" in m.directory.get_slot(m.db_name, m.table_name) + assert m.directory.get(m.db_name, m.table_name, "test_key2") == {} + + m.del_handler("test_key2") + assert "test_key2" not in m.directory.get_slot(m.db_name, m.table_name) diff --git a/src/sonic-bgpcfgd/tests/test_directory.py b/src/sonic-bgpcfgd/tests/test_directory.py new file mode 100644 index 000000000000..b20803ed32c5 --- /dev/null +++ b/src/sonic-bgpcfgd/tests/test_directory.py @@ -0,0 +1,57 @@ +from unittest.mock import MagicMock, patch +from bgpcfgd.directory import Directory + +@patch('bgpcfgd.directory.log_err') +def test_directory(mocked_log_err): + test_values = { + "key1": { + "key1_1": { + "key1_1_1": "value1_1_1", + "key1_1_2": "value1_1_2", + "key1_1_3": "value1_1_3" + } + }, + "key2": { + "value2" + } + } + + directory = Directory() + + # Put test values + directory.put("db_name", "table", "key1", test_values["key1"]) + directory.put("db_name", "table", "key2", test_values["key2"]) + + # Test get_path() + assert directory.get_path("db_name", "table", "") == test_values + assert directory.get_path("db_name", "table", "key1/key1_1/key1_1_1") == "value1_1_1" + assert directory.get_path("db_name", "table", "key1/key_nonexist") == None + + # Test path_exist() + assert directory.path_exist("db_name", "table", "key1/key1_1/key1_1_1") + assert not directory.path_exist("db_name", "table_nonexist", "") + assert not directory.path_exist("db_name", "table", "key1/key_nonexist") + + # Test get_slot() + assert directory.get_slot("db_name", "table") == test_values + + # Test get() + assert directory.get("db_name", "table", "key2") == test_values["key2"] + + # Test remove() + directory.remove("db_name", "table", "key2") + assert not directory.path_exist("db_name", "table", "key2") + + # Test remove() with invalid input + directory.remove("db_name", "table_nonexist", "key2") + mocked_log_err.assert_called_with("Directory: Can't remove key 'key2' from slot 'db_name__table_nonexist'. The slot doesn't exist") + directory.remove("db_name", "table", "key_nonexist") + mocked_log_err.assert_called_with("Directory: Can't remove key 'key_nonexist' from slot 'db_name__table'. The key doesn't exist") + + # Test remove_slot() + directory.remove_slot("db_name", "table") + assert not directory.available("db_name", "table") + + # Test remove_slot() with nonexist table + directory.remove_slot("db_name", "table_nonexist") + mocked_log_err.assert_called_with("Directory: Can't remove slot 'db_name__table_nonexist'. The slot doesn't exist") diff --git a/src/sonic-bgpcfgd/tests/test_frr.py b/src/sonic-bgpcfgd/tests/test_frr.py index 47bdcaa82f10..5a20281fa553 100644 --- a/src/sonic-bgpcfgd/tests/test_frr.py +++ b/src/sonic-bgpcfgd/tests/test_frr.py @@ -1,6 +1,68 @@ -from bgpcfgd.frr import FRR - +from unittest.mock import patch +import bgpcfgd.frr +import pytest def test_constructor(): - f = FRR(["abc", "cde"]) + f = bgpcfgd.frr.FRR(["abc", "cde"]) assert f.daemons == ["abc", "cde"] + +def test_wait_for_daemons(): + bgpcfgd.frr.run_command = lambda cmd, **kwargs: (0, ["abc", "cde"], "") + f = bgpcfgd.frr.FRR(["abc", "cde"]) + f.wait_for_daemons(5) + +def test_wait_for_daemons_fail(): + bgpcfgd.frr.run_command = lambda cmd, **kwargs: (0, ["abc", "non_expected"], "") + f = bgpcfgd.frr.FRR(["abc", "cde"]) + with pytest.raises(Exception): + assert f.wait_for_daemons(5) + +def test_wait_for_daemons_error(): + bgpcfgd.frr.run_command = lambda cmd, **kwargs: (1, ["abc", "cde"], "some error") + f = bgpcfgd.frr.FRR(["abc", "cde"]) + with pytest.raises(Exception): + assert f.wait_for_daemons(5) + +def test_get_config(): + bgpcfgd.frr.run_command = lambda cmd: (0, "expected config", "") + f = bgpcfgd.frr.FRR(["abc", "cde"]) + out = f.get_config() + assert out == "expected config" + +@patch('bgpcfgd.frr.log_crit') +def test_get_config_fail(mocked_log_crit): + bgpcfgd.frr.run_command = lambda cmd: (1, "some config", "some error") + f = bgpcfgd.frr.FRR(["abc", "cde"]) + out = f.get_config() + assert out == "" + mocked_log_crit.assert_called_with("can't update running config: rc=1 out='some config' err='some error'") + +def test_write(): + bgpcfgd.frr.run_command = lambda cmd: (0, "some output", "") + f = bgpcfgd.frr.FRR(["abc", "cde"]) + res = f.write("config context") + assert res, "Expect True return value" + +def test_write_fail(): + bgpcfgd.frr.run_command = lambda cmd: (1, "some output", "some error") + f = bgpcfgd.frr.FRR(["abc", "cde"]) + res = f.write("config context") + assert not res, "Expect False return value" + +def test_restart_peer_groups(): + bgpcfgd.frr.run_command = lambda cmd: (0, "some output", "") + f = bgpcfgd.frr.FRR(["abc", "cde"]) + res = f.restart_peer_groups(["pg_1", "pg_2"]) + assert res, "Expect True return value" + +@patch('bgpcfgd.frr.log_crit') +def test_restart_peer_groups_fail(mocked_log_crit): + return_value_map = { + "['vtysh', '-c', 'clear bgp peer-group pg_1 soft in']": (0, "", ""), + "['vtysh', '-c', 'clear bgp peer-group pg_2 soft in']": (1, "some output", "some error") + } + bgpcfgd.frr.run_command = lambda cmd: return_value_map[str(cmd)] + f = bgpcfgd.frr.FRR(["abc", "cde"]) + res = f.restart_peer_groups(["pg_1", "pg_2"]) + assert not res, "Expect False return value" + mocked_log_crit.assert_called_with("Can't restart bgp peer-group 'pg_2'. rc='1', out='some output', err='some error'") diff --git a/src/sonic-bgpcfgd/tests/test_intf.py b/src/sonic-bgpcfgd/tests/test_intf.py new file mode 100644 index 000000000000..74fa8e471ac6 --- /dev/null +++ b/src/sonic-bgpcfgd/tests/test_intf.py @@ -0,0 +1,52 @@ +from unittest.mock import MagicMock, patch + +from bgpcfgd.directory import Directory +from bgpcfgd.template import TemplateFabric +from swsscommon import swsscommon +from bgpcfgd.managers_intf import InterfaceMgr + +def set_handler_test(manager, key, value): + res = manager.set_handler(key, value) + assert res, "Returns always True" + assert manager.directory.get(manager.db_name, manager.table_name, key) == value + +def del_handler_test(manager, key): + manager.del_handler(key) + assert manager.directory.get_path(manager.db_name, manager.table_name, key) == None + +@patch('bgpcfgd.managers_intf.log_warn') +def test_intf(mocked_log_warn): + cfg_mgr = MagicMock() + common_objs = { + 'directory': Directory(), + 'cfg_mgr': cfg_mgr, + 'tf': TemplateFabric(), + 'constants': {}, + } + m = InterfaceMgr(common_objs, "CONFIG_DB", swsscommon.CFG_VLAN_INTF_TABLE_NAME) + + set_handler_test(m, "Vlan1000", {}) + set_handler_test(m, "Vlan1000|192.168.0.1/21", {}) + + # test set handler with invalid ip network + res = m.set_handler("Vlan1000|invalid_netowrk", {}) + assert res, "Returns always True" + mocked_log_warn.assert_called_with("Subnet 'invalid_netowrk' format is wrong for interface 'Vlan1000'") + + del_handler_test(m, "Vlan1000") + del_handler_test(m, "Vlan1000|192.168.0.1/21") + del_handler_test(m, "Vlan1000|invalid_netowrk") + mocked_log_warn.assert_called_with("Subnet 'invalid_netowrk' format is wrong for interface 'Vlan1000'") + +def test_intf_ipv6(): + cfg_mgr = MagicMock() + common_objs = { + 'directory': Directory(), + 'cfg_mgr': cfg_mgr, + 'tf': TemplateFabric(), + 'constants': {}, + } + m = InterfaceMgr(common_objs, "CONFIG_DB", swsscommon.CFG_VLAN_INTF_TABLE_NAME) + + set_handler_test(m, "Vlan1000|fc02:1000::1/64", {}) + del_handler_test(m, "Vlan1000|fc02:1000::1/64") diff --git a/src/sonic-bgpcfgd/tests/test_rm.py b/src/sonic-bgpcfgd/tests/test_rm.py new file mode 100644 index 000000000000..867ae1a7a51c --- /dev/null +++ b/src/sonic-bgpcfgd/tests/test_rm.py @@ -0,0 +1,74 @@ +from unittest.mock import MagicMock +from bgpcfgd.directory import Directory +from bgpcfgd.managers_rm import RouteMapMgr +from swsscommon import swsscommon + + +test_rm_constants = { + "deployment_id_asn_map": { + "1": 12345, + "2": 12346, + "3": 12347, + "4": 12348, + } +} + +def constructor(): + cfg_mgr = MagicMock() + + common_objs = { + 'directory': Directory(), + 'cfg_mgr': cfg_mgr, + 'constants': test_rm_constants, + } + + mgr = RouteMapMgr(common_objs, "APPL_DB", "BGP_PROFILE_TABLE") + return mgr + +def set_del_test(mgr, op, args, expected_ret, expected_cmds): + set_del_test.push_list_called = False + def push_list(cmds): + set_del_test.push_list_called = True + assert cmds in expected_cmds + return True + mgr.cfg_mgr.push_list = push_list + + if op == "SET": + ret = mgr.set_handler(*args) + assert ret == expected_ret + elif op == "DEL": + mgr.del_handler(*args) + else: + assert False, "Wrong operation" + + if expected_cmds: + assert set_del_test.push_list_called, "cfg_mgr.push_list wasn't called" + else: + assert not set_del_test.push_list_called, "cfg_mgr.push_list was called" + +def test_set_del(): + mgr = constructor() + set_del_test( + mgr, + "SET", + ("FROM_SDN_SLB_ROUTES", { + "community_id": "1234:1234" + }), + True, + [ + ["route-map FROM_SDN_SLB_ROUTES_RM permit 100", + " set as-path prepend 12346 12346", + " set community 1234:1234", + " set origin incomplete"] + ] + ) + + set_del_test( + mgr, + "DEL", + ("FROM_SDN_SLB_ROUTES",), + True, + [ + ["no route-map FROM_SDN_SLB_ROUTES_RM permit 100"] + ] + ) diff --git a/src/sonic-bgpcfgd/tests/test_setsrc.py b/src/sonic-bgpcfgd/tests/test_setsrc.py new file mode 100644 index 000000000000..5d1a81908837 --- /dev/null +++ b/src/sonic-bgpcfgd/tests/test_setsrc.py @@ -0,0 +1,62 @@ +from unittest.mock import MagicMock, patch + +import os +from bgpcfgd.directory import Directory +from bgpcfgd.template import TemplateFabric +from copy import deepcopy +from . import swsscommon_test +from swsscommon import swsscommon + +with patch.dict("sys.modules", swsscommon=swsscommon_test): + from bgpcfgd.managers_setsrc import ZebraSetSrc + +TEMPLATE_PATH = os.path.abspath('../../dockers/docker-fpm-frr/frr') + +def constructor(): + cfg_mgr = MagicMock() + common_objs = { + 'directory': Directory(), + 'cfg_mgr': cfg_mgr, + 'tf': TemplateFabric(TEMPLATE_PATH), + 'constants': {}, + } + + m = ZebraSetSrc(common_objs, "STATE_DB", swsscommon.STATE_INTERFACE_TABLE_NAME) + assert m.lo_ipv4 == None + assert m.lo_ipv6 == None + + return m + +@patch('bgpcfgd.managers_setsrc.log_info') +def test_set_handler(mocked_log_info): + m = constructor() + res = m.set_handler("Loopback0|10.1.0.32/32", {"state": "ok"}) + assert res, "Returns always True" + mocked_log_info.assert_called_with("The 'set src' configuration with Loopback0 ip '10.1.0.32' has been scheduled to be added") + +@patch('bgpcfgd.managers_setsrc.log_err') +def test_set_handler_no_slash(mocked_log_err): + m = constructor() + res = m.set_handler("Loopback0|10.1.0.32", {"state": "ok"}) + assert res, "Returns always True" + mocked_log_err.assert_called_with("Wrong Loopback0 ip prefix: '10.1.0.32'") + +@patch('bgpcfgd.managers_setsrc.log_info') +def test_set_handler_ipv6(mocked_log_info): + m = constructor() + res = m.set_handler("Loopback0|FC00:1::32/128", {"state": "ok"}) + assert res, "Returns always True" + mocked_log_info.assert_called_with("The 'set src' configuration with Loopback0 ip 'FC00:1::32' has been scheduled to be added") + +@patch('bgpcfgd.managers_setsrc.log_err') +def test_set_handler_invalid_ip(mocked_log_err): + m = constructor() + res = m.set_handler("Loopback0|invalid/ip", {"state": "ok"}) + assert res, "Returns always True" + mocked_log_err.assert_called_with("Got ambiguous ip address 'invalid'") + +@patch('bgpcfgd.managers_setsrc.log_warn') +def test_del_handler(mocked_log_warn): + m = constructor() + m.del_handler("Loopback0|10.1.0.32/32") + mocked_log_warn.assert_called_with("Delete command is not supported for 'zebra set src' templates") diff --git a/src/sonic-bgpcfgd/tests/test_sonic-cfggen.py b/src/sonic-bgpcfgd/tests/test_sonic-cfggen.py index a9c93749d5c4..c11ddafa4838 100644 --- a/src/sonic-bgpcfgd/tests/test_sonic-cfggen.py +++ b/src/sonic-bgpcfgd/tests/test_sonic-cfggen.py @@ -69,12 +69,6 @@ def test_common_functions(): "common/functions.conf.json", "common/functions.conf") -def test_staticd_default_route(): - run_test("staticd.default_route.conf.j2", - "staticd/staticd.default_route.conf.j2", - "staticd/staticd.default_route.conf.json", - "staticd/staticd.default_route.conf") - def test_staticd_loopback_route(): run_test("staticd.loopback_route.conf.j2", "staticd/staticd.loopback_route.conf.j2", diff --git a/src/sonic-bgpcfgd/tests/test_static_rt.py b/src/sonic-bgpcfgd/tests/test_static_rt.py new file mode 100644 index 000000000000..e0b9b1b17ebf --- /dev/null +++ b/src/sonic-bgpcfgd/tests/test_static_rt.py @@ -0,0 +1,653 @@ +from unittest.mock import MagicMock, patch + +from bgpcfgd.directory import Directory +from bgpcfgd.template import TemplateFabric +from bgpcfgd.managers_static_rt import StaticRouteMgr +from collections import Counter +from swsscommon import swsscommon + +def constructor(skip_bgp_asn=False): + cfg_mgr = MagicMock() + + common_objs = { + 'directory': Directory(), + 'cfg_mgr': cfg_mgr, + 'tf': TemplateFabric(), + 'constants': {}, + } + + mgr = StaticRouteMgr(common_objs, "CONFIG_DB", "STATIC_ROUTE") + if not skip_bgp_asn: + mgr.directory.put("CONFIG_DB", swsscommon.CFG_DEVICE_METADATA_TABLE_NAME, "localhost", {"bgp_asn": "65100"}) + assert len(mgr.static_routes) == 0 + + return mgr + +def set_del_test(mgr, op, args, expected_ret, expected_cmds): + set_del_test.push_list_called = False + def push_list(cmds): + set_del_test.push_list_called = True + assert Counter(cmds) == Counter(expected_cmds) # check if commands are expected (regardless of the order) + max_del_idx = -1 + min_set_idx = len(cmds) + for idx in range(len(cmds)): + if cmds[idx].startswith('no ip') and idx > max_del_idx: + max_del_idx = idx + if cmds[idx].startswith('ip') and idx < min_set_idx: + min_set_idx = idx + assert max_del_idx < min_set_idx, "DEL command comes after SET command" # DEL commands should be done first + return True + mgr.cfg_mgr.push_list = push_list + + if op == "SET": + ret = mgr.set_handler(*args) + assert ret == expected_ret + elif op == "DEL": + mgr.del_handler(*args) + else: + assert False, "Wrong operation" + + if expected_cmds: + assert set_del_test.push_list_called, "cfg_mgr.push_list wasn't called" + else: + assert not set_del_test.push_list_called, "cfg_mgr.push_list was called" + +def test_set(): + mgr = constructor() + set_del_test( + mgr, + "SET", + ("10.1.0.0/24", { + "nexthop": "10.0.0.57", + }), + True, + [ + "ip route 10.1.0.0/24 10.0.0.57", + "router bgp 65100", + " address-family ipv4", + " redistribute static", + " address-family ipv6", + " redistribute static" + ] + ) + +def test_set_nhvrf(): + mgr = constructor() + set_del_test( + mgr, + "SET", + ("default|10.1.1.0/24", { + "nexthop": "10.0.0.57", + "ifname": "PortChannel0001", + "distance": "10", + "nexthop-vrf": "nh_vrf", + "blackhole": "false", + }), + True, + [ + "ip route 10.1.1.0/24 10.0.0.57 PortChannel0001 10 nexthop-vrf nh_vrf", + "router bgp 65100", + " address-family ipv4", + " redistribute static", + " address-family ipv6", + " redistribute static" + ] + ) + +def test_set_blackhole(): + mgr = constructor() + set_del_test( + mgr, + "SET", + ("default|10.1.2.0/24", { + "nexthop": "10.0.0.57", + "ifname": "PortChannel0001", + "distance": "10", + "nexthop-vrf": "nh_vrf", + "blackhole": "true", + }), + True, + [ + "ip route 10.1.2.0/24 blackhole 10", + "router bgp 65100", + " address-family ipv4", + " redistribute static", + " address-family ipv6", + " redistribute static" + ] + ) + +def test_set_vrf(): + mgr = constructor() + set_del_test( + mgr, + "SET", + ("vrfRED|10.1.3.0/24", { + "nexthop": "10.0.0.57", + "ifname": "PortChannel0001", + "distance": "10", + "nexthop-vrf": "nh_vrf", + "blackhole": "false", + }), + True, + [ + "ip route 10.1.3.0/24 10.0.0.57 PortChannel0001 10 nexthop-vrf nh_vrf vrf vrfRED", + "router bgp 65100 vrf vrfRED", + " address-family ipv4", + " redistribute static", + " address-family ipv6", + " redistribute static" + ] + ) + +def test_set_ipv6(): + mgr = constructor() + set_del_test( + mgr, + "SET", + ("default|fc00:10::/64", { + "nexthop": "fc00::72", + "ifname": "PortChannel0001", + "distance": "10", + "nexthop-vrf": "", + "blackhole": "false", + }), + True, + [ + "ipv6 route fc00:10::/64 fc00::72 PortChannel0001 10", + "router bgp 65100", + " address-family ipv4", + " redistribute static", + " address-family ipv6", + " redistribute static" + ] + ) + +def test_set_nh_only(): + mgr = constructor() + set_del_test( + mgr, + "SET", + ("vrfRED|10.1.3.0/24", { + "nexthop": "10.0.0.57,10.0.0.59,10.0.0.61", + "distance": "10,20,30", + "nexthop-vrf": "nh_vrf,,default", + "blackhole": "false,false,false", + }), + True, + [ + "ip route 10.1.3.0/24 10.0.0.57 10 nexthop-vrf nh_vrf vrf vrfRED", + "ip route 10.1.3.0/24 10.0.0.59 20 vrf vrfRED", + "ip route 10.1.3.0/24 10.0.0.61 30 nexthop-vrf default vrf vrfRED", + "router bgp 65100 vrf vrfRED", + " address-family ipv4", + " redistribute static", + " address-family ipv6", + " redistribute static" + ] + ) + +def test_set_ifname_only(): + mgr = constructor() + set_del_test( + mgr, + "SET", + ("vrfRED|10.1.3.0/24", { + "ifname": "PortChannel0001,PortChannel0002,PortChannel0003", + "distance": "10,20,30", + "nexthop-vrf": "nh_vrf,,default", + "blackhole": "false,false,false", + }), + True, + [ + "ip route 10.1.3.0/24 PortChannel0001 10 nexthop-vrf nh_vrf vrf vrfRED", + "ip route 10.1.3.0/24 PortChannel0002 20 vrf vrfRED", + "ip route 10.1.3.0/24 PortChannel0003 30 nexthop-vrf default vrf vrfRED", + "router bgp 65100 vrf vrfRED", + " address-family ipv4", + " redistribute static", + " address-family ipv6", + " redistribute static" + ] + ) + +def test_set_with_empty_ifname(): + mgr = constructor() + set_del_test( + mgr, + "SET", + ("vrfRED|10.1.3.0/24", { + "nexthop": "10.0.0.57,10.0.0.59,10.0.0.61", + "ifname": "PortChannel0001,,PortChannel0003", + "distance": "10,20,30", + "nexthop-vrf": "nh_vrf,,default", + "blackhole": "false,false,false", + }), + True, + [ + "ip route 10.1.3.0/24 10.0.0.57 PortChannel0001 10 nexthop-vrf nh_vrf vrf vrfRED", + "ip route 10.1.3.0/24 10.0.0.59 20 vrf vrfRED", + "ip route 10.1.3.0/24 10.0.0.61 PortChannel0003 30 nexthop-vrf default vrf vrfRED", + "router bgp 65100 vrf vrfRED", + " address-family ipv4", + " redistribute static", + " address-family ipv6", + " redistribute static" + ] + ) + +def test_set_with_empty_nh(): + mgr = constructor() + set_del_test( + mgr, + "SET", + ("vrfRED|10.1.3.0/24", { + "nexthop": "10.0.0.57,,", + "ifname": "PortChannel0001,PortChannel0002,PortChannel0003", + "distance": "10,20,30", + "nexthop-vrf": "nh_vrf,,default", + "blackhole": "false,false,false", + }), + True, + [ + "ip route 10.1.3.0/24 10.0.0.57 PortChannel0001 10 nexthop-vrf nh_vrf vrf vrfRED", + "ip route 10.1.3.0/24 PortChannel0002 20 vrf vrfRED", + "ip route 10.1.3.0/24 PortChannel0003 30 nexthop-vrf default vrf vrfRED", + "router bgp 65100 vrf vrfRED", + " address-family ipv4", + " redistribute static", + " address-family ipv6", + " redistribute static" + ] + ) + +def test_set_del(): + mgr = constructor() + set_del_test( + mgr, + "SET", + ("vrfRED|10.1.3.0/24", { + "nexthop": "10.0.0.57,10.0.0.59,10.0.0.61", + "ifname": "PortChannel0001,PortChannel0002,PortChannel0003", + "distance": "10,20,30", + "nexthop-vrf": "nh_vrf,,default", + "blackhole": "false,false,false", + }), + True, + [ + "ip route 10.1.3.0/24 10.0.0.57 PortChannel0001 10 nexthop-vrf nh_vrf vrf vrfRED", + "ip route 10.1.3.0/24 10.0.0.59 PortChannel0002 20 vrf vrfRED", + "ip route 10.1.3.0/24 10.0.0.61 PortChannel0003 30 nexthop-vrf default vrf vrfRED", + "router bgp 65100 vrf vrfRED", + " address-family ipv4", + " redistribute static", + " address-family ipv6", + " redistribute static" + ] + ) + set_del_test( + mgr, + "DEL", + ("vrfRED|10.1.3.0/24",), + True, + [ + "no ip route 10.1.3.0/24 10.0.0.57 PortChannel0001 10 nexthop-vrf nh_vrf vrf vrfRED", + "no ip route 10.1.3.0/24 10.0.0.59 PortChannel0002 20 vrf vrfRED", + "no ip route 10.1.3.0/24 10.0.0.61 PortChannel0003 30 nexthop-vrf default vrf vrfRED", + "router bgp 65100 vrf vrfRED", + " address-family ipv4", + " no redistribute static", + " address-family ipv6", + " no redistribute static" + ] + ) + set_del_test( + mgr, + "SET", + ("vrfRED|10.1.3.0/24", { + "nexthop": "10.0.0.57,10.0.0.59,10.0.0.61", + "ifname": "PortChannel0001,PortChannel0002,PortChannel0003", + "distance": "10,20,30", + "nexthop-vrf": "nh_vrf,,default", + "blackhole": "false,false,false", + }), + True, + [ + "ip route 10.1.3.0/24 10.0.0.57 PortChannel0001 10 nexthop-vrf nh_vrf vrf vrfRED", + "ip route 10.1.3.0/24 10.0.0.59 PortChannel0002 20 vrf vrfRED", + "ip route 10.1.3.0/24 10.0.0.61 PortChannel0003 30 nexthop-vrf default vrf vrfRED", + "router bgp 65100 vrf vrfRED", + " address-family ipv4", + " redistribute static", + " address-family ipv6", + " redistribute static" + ] + ) + +def test_set_same_route(): + mgr = constructor() + set_del_test( + mgr, + "SET", + ("vrfRED|10.1.3.0/24", { + "nexthop": "10.0.0.57,10.0.0.59,10.0.0.61", + "ifname": "PortChannel0001,PortChannel0002,PortChannel0003", + "distance": "10,20,30", + "nexthop-vrf": "nh_vrf,,default", + "blackhole": "false,false,false", + }), + True, + [ + "ip route 10.1.3.0/24 10.0.0.57 PortChannel0001 10 nexthop-vrf nh_vrf vrf vrfRED", + "ip route 10.1.3.0/24 10.0.0.59 PortChannel0002 20 vrf vrfRED", + "ip route 10.1.3.0/24 10.0.0.61 PortChannel0003 30 nexthop-vrf default vrf vrfRED", + "router bgp 65100 vrf vrfRED", + " address-family ipv4", + " redistribute static", + " address-family ipv6", + " redistribute static" + ] + ) + set_del_test( + mgr, + "SET", + ("vrfRED|10.1.3.0/24", { + "nexthop": "10.0.0.57,10.0.0.59,10.0.0.61", + "ifname": "PortChannel0001,PortChannel0002,PortChannel0003", + "distance": "40,50,60", + "nexthop-vrf": "nh_vrf,,default", + "blackhole": "false,false,false", + }), + True, + [ + "no ip route 10.1.3.0/24 10.0.0.57 PortChannel0001 10 nexthop-vrf nh_vrf vrf vrfRED", + "no ip route 10.1.3.0/24 10.0.0.59 PortChannel0002 20 vrf vrfRED", + "no ip route 10.1.3.0/24 10.0.0.61 PortChannel0003 30 nexthop-vrf default vrf vrfRED", + "ip route 10.1.3.0/24 10.0.0.57 PortChannel0001 40 nexthop-vrf nh_vrf vrf vrfRED", + "ip route 10.1.3.0/24 10.0.0.59 PortChannel0002 50 vrf vrfRED", + "ip route 10.1.3.0/24 10.0.0.61 PortChannel0003 60 nexthop-vrf default vrf vrfRED" + ] + ) + +def test_set_add_del_nh(): + mgr = constructor() + set_del_test( + mgr, + "SET", + ("vrfRED|10.1.3.0/24", { + "nexthop": "10.0.0.57,10.0.0.59,10.0.0.61", + "ifname": "PortChannel0001,PortChannel0002,PortChannel0003", + "distance": "10,20,30", + "nexthop-vrf": "nh_vrf,,default", + "blackhole": "false,false,false", + }), + True, + [ + "ip route 10.1.3.0/24 10.0.0.57 PortChannel0001 10 nexthop-vrf nh_vrf vrf vrfRED", + "ip route 10.1.3.0/24 10.0.0.59 PortChannel0002 20 vrf vrfRED", + "ip route 10.1.3.0/24 10.0.0.61 PortChannel0003 30 nexthop-vrf default vrf vrfRED", + "router bgp 65100 vrf vrfRED", + " address-family ipv4", + " redistribute static", + " address-family ipv6", + " redistribute static" + ] + ) + set_del_test( + mgr, + "SET", + ("vrfRED|10.1.3.0/24", { + "nexthop": "10.0.0.57,10.0.0.59,10.0.0.61,10.0.0.63", + "ifname": "PortChannel0001,PortChannel0002,PortChannel0003,PortChannel0004", + "distance": "10,20,30,30", + "nexthop-vrf": "nh_vrf,,default,", + "blackhole": "false,false,false,", + }), + True, + [ + "ip route 10.1.3.0/24 10.0.0.63 PortChannel0004 30 vrf vrfRED", + ] + ) + set_del_test( + mgr, + "SET", + ("vrfRED|10.1.3.0/24", { + "nexthop": "10.0.0.57,10.0.0.59", + "ifname": "PortChannel0001,PortChannel0002", + "distance": "10,20", + "nexthop-vrf": "nh_vrf,", + "blackhole": "false,false", + }), + True, + [ + "no ip route 10.1.3.0/24 10.0.0.61 PortChannel0003 30 nexthop-vrf default vrf vrfRED", + "no ip route 10.1.3.0/24 10.0.0.63 PortChannel0004 30 vrf vrfRED", + ] + ) + +def test_set_add_del_nh_ethernet(): + mgr = constructor() + set_del_test( + mgr, + "SET", + ("default|20.1.3.0/24", { + "nexthop": "20.0.0.57,20.0.0.59,20.0.0.61", + "ifname": "Ethernet4,Ethernet8,Ethernet12", + "distance": "10,20,30", + "nexthop-vrf": "default,,default", + "blackhole": "false,false,false", + }), + True, + [ + "ip route 20.1.3.0/24 20.0.0.57 Ethernet4 10 nexthop-vrf default", + "ip route 20.1.3.0/24 20.0.0.59 Ethernet8 20", + "ip route 20.1.3.0/24 20.0.0.61 Ethernet12 30 nexthop-vrf default", + "router bgp 65100", + " address-family ipv4", + " redistribute static", + " address-family ipv6", + " redistribute static" + ] + ) + set_del_test( + mgr, + "SET", + ("default|20.1.3.0/24", { + "nexthop": "20.0.0.57,20.0.0.59,20.0.0.61,20.0.0.63", + "ifname": "Ethernet4,Ethernet8,Ethernet12,Ethernet16", + "distance": "10,20,30,30", + "nexthop-vrf": "default,,default,", + "blackhole": "false,false,false,", + }), + True, + [ + "ip route 20.1.3.0/24 20.0.0.63 Ethernet16 30", + ] + ) + set_del_test( + mgr, + "SET", + ("default|20.1.3.0/24", { + "nexthop": "20.0.0.57,20.0.0.59", + "ifname": "Ethernet4,Ethernet8", + "distance": "10,20", + "nexthop-vrf": "default,", + "blackhole": "false,false", + }), + True, + [ + "no ip route 20.1.3.0/24 20.0.0.61 Ethernet12 30 nexthop-vrf default", + "no ip route 20.1.3.0/24 20.0.0.63 Ethernet16 30", + ] + ) + +@patch('bgpcfgd.managers_static_rt.log_debug') +def test_set_no_action(mocked_log_debug): + mgr = constructor() + set_del_test( + mgr, + "SET", + ("default|10.1.1.0/24", { + "nexthop": "10.0.0.57", + "ifname": "PortChannel0001", + "blackhole": "true", + }), + True, + [ + "ip route 10.1.1.0/24 blackhole", + "router bgp 65100", + " address-family ipv4", + " redistribute static", + " address-family ipv6", + " redistribute static" + ] + ) + + set_del_test( + mgr, + "SET", + ("default|10.1.1.0/24", { + "nexthop": "10.0.0.59", + "ifname": "PortChannel0002", + "blackhole": "true", + }), + True, + [] + ) + mocked_log_debug.assert_called_with("Nothing to update for static route default|10.1.1.0/24") + +@patch('bgpcfgd.managers_static_rt.log_debug') +def test_del_no_action(mocked_log_debug): + mgr = constructor() + set_del_test( + mgr, + "DEL", + ("default|10.1.1.0/24",), + True, + [] + ) + mocked_log_debug.assert_called_with("Nothing to update for static route default|10.1.1.0/24") + +def test_set_invalid_arg(): + mgr = constructor() + set_del_test( + mgr, + "SET", + ("default|10.1.1.0/24", { + "nexthop": "10.0.0.57,10.0.0.59", + "ifname": "PortChannel0001", + }), + False, + [] + ) + +@patch('bgpcfgd.managers_static_rt.log_err') +def test_set_invalid_blackhole(mocked_log_err): + mgr = constructor() + set_del_test( + mgr, + "SET", + ("default|10.1.1.0/24", { + "nexthop": "", + "ifname": "", + "blackhole": "false", + }), + True, + [ + "router bgp 65100", + " address-family ipv4", + " redistribute static", + " address-family ipv6", + " redistribute static" + ] + ) + mocked_log_err.assert_called_with("Mandatory attribute not found for nexthop") + +def test_set_invalid_ipaddr(): + mgr = constructor() + set_del_test( + mgr, + "SET", + ("10.1.0.0/24", { + "nexthop": "invalid_ipaddress", + }), + False, + [] + ) + +def test_set_del_no_bgp_asn(): + mgr = constructor(skip_bgp_asn=True) + set_del_test( + mgr, + "SET", + ("vrfRED|10.1.3.0/24", { + "nexthop": "10.0.0.57,10.0.0.59,10.0.0.61", + "ifname": "PortChannel0001,PortChannel0002,PortChannel0003", + "distance": "10,20,30", + "nexthop-vrf": "nh_vrf,,default", + "blackhole": "false,false,false", + }), + True, + [ + "ip route 10.1.3.0/24 10.0.0.57 PortChannel0001 10 nexthop-vrf nh_vrf vrf vrfRED", + "ip route 10.1.3.0/24 10.0.0.59 PortChannel0002 20 vrf vrfRED", + "ip route 10.1.3.0/24 10.0.0.61 PortChannel0003 30 nexthop-vrf default vrf vrfRED", + ] + ) + set_del_test( + mgr, + "DEL", + ("vrfRED|10.1.3.0/24",), + True, + [ + "no ip route 10.1.3.0/24 10.0.0.57 PortChannel0001 10 nexthop-vrf nh_vrf vrf vrfRED", + "no ip route 10.1.3.0/24 10.0.0.59 PortChannel0002 20 vrf vrfRED", + "no ip route 10.1.3.0/24 10.0.0.61 PortChannel0003 30 nexthop-vrf default vrf vrfRED", + ] + ) + +def test_set_del_bgp_asn_change(): + mgr = constructor(skip_bgp_asn=True) + set_del_test( + mgr, + "SET", + ("vrfRED|10.1.3.0/24", { + "nexthop": "10.0.0.57,10.0.0.59,10.0.0.61", + "ifname": "PortChannel0001,PortChannel0002,PortChannel0003", + "distance": "10,20,30", + "nexthop-vrf": "nh_vrf,,default", + "blackhole": "false,false,false", + }), + True, + [ + "ip route 10.1.3.0/24 10.0.0.57 PortChannel0001 10 nexthop-vrf nh_vrf vrf vrfRED", + "ip route 10.1.3.0/24 10.0.0.59 PortChannel0002 20 vrf vrfRED", + "ip route 10.1.3.0/24 10.0.0.61 PortChannel0003 30 nexthop-vrf default vrf vrfRED", + ] + ) + + assert mgr.vrf_pending_redistribution == {"vrfRED"} + + expected_cmds = [ + "router bgp 65100 vrf vrfRED", + " address-family ipv4", + " redistribute static", + " address-family ipv6", + " redistribute static" + ] + def push_list(cmds): + set_del_test.push_list_called = True + assert Counter(cmds) == Counter(expected_cmds) # check if commands are expected (regardless of the order) + max_del_idx = -1 + min_set_idx = len(cmds) + for idx in range(len(cmds)): + if cmds[idx].startswith('no ip') and idx > max_del_idx: + max_del_idx = idx + if cmds[idx].startswith('ip') and idx < min_set_idx: + min_set_idx = idx + assert max_del_idx < min_set_idx, "DEL command comes after SET command" # DEL commands should be done first + return True + mgr.cfg_mgr.push_list = push_list + mgr.directory.put("CONFIG_DB", swsscommon.CFG_DEVICE_METADATA_TABLE_NAME, "localhost", {"bgp_asn": "65100"}) + + assert not mgr.vrf_pending_redistribution diff --git a/src/sonic-build-hooks/Makefile b/src/sonic-build-hooks/Makefile index 786af9056332..b45be9dd07f6 100644 --- a/src/sonic-build-hooks/Makefile +++ b/src/sonic-build-hooks/Makefile @@ -21,7 +21,7 @@ DPKGTOOL = $(shell which dpkg-deb) ifeq ($(shell which dpkg-deb),) BUILD_COMMAND=docker run --user $(shell id -u):$(shell id -g) --rm -v $(shell pwd):/build debian:buster bash -c 'cd /build; dpkg-deb --build $(TMP_DIR)/$(SONIC_BUILD_HOOKS) $(SONIC_BUILD_HOOKS_TARGET)' else -BUILD_COMMAND=dpkg-deb --build $(TMP_DIR)/$(SONIC_BUILD_HOOKS) $(SONIC_BUILD_HOOKS_TARGET) +BUILD_COMMAND=dpkg-deb -Zxz --build $(TMP_DIR)/$(SONIC_BUILD_HOOKS) $(SONIC_BUILD_HOOKS_TARGET) endif DEPENDS := $(shell find scripts hooks debian -type f) diff --git a/src/sonic-build-hooks/hooks/apt b/src/sonic-build-hooks/hooks/apt new file mode 100755 index 000000000000..f4b0f97287b1 --- /dev/null +++ b/src/sonic-build-hooks/hooks/apt @@ -0,0 +1,5 @@ +#!/bin/bash + +. /usr/local/share/buildinfo/scripts/buildinfo_base.sh + +APT_REAL_COMMAND=$(get_command apt) $(dirname "$0")/apt-get "$@" diff --git a/src/sonic-build-hooks/hooks/apt-get b/src/sonic-build-hooks/hooks/apt-get index 9ae50a118650..58563ce36bf4 100755 --- a/src/sonic-build-hooks/hooks/apt-get +++ b/src/sonic-build-hooks/hooks/apt-get @@ -3,36 +3,28 @@ INSTALL= . /usr/local/share/buildinfo/scripts/buildinfo_base.sh -REAL_COMMAND=$(get_command apt-get) +REAL_COMMAND=$APT_REAL_COMMAND +[ -z "$REAL_COMMAND" ] && REAL_COMMAND=$(get_command apt-get) if [ -z "$REAL_COMMAND" ]; then echo "The command apt-get does not exist." 1>&2 exit 1 fi -VERSION_FILE="/usr/local/share/buildinfo/versions/versions-deb" -if [ "$ENABLE_VERSION_CONTROL_DEB" == "y" ]; then - for para in $@ - do - if [[ "$para" != -* ]]; then - continue - fi - if [ ! -z "$INSTALL" ]; then - if [[ "$para" == *=* ]]; then - continue - elif [[ "$para" == *=* ]]; then - continue - else - package=$para - if ! grep -q "^${package}=" $VERSION_FILE; then - echo "The version of the package ${package} is not specified." - exit 1 - fi - fi - elif [[ "$para" == "install" ]]; then - INSTALL=y - fi - done +INSTALL=$(check_apt_install) +COMMAND_INFO="Locked by command: $REAL_COMMAND $@" +if [ "$INSTALL" == y ]; then + check_apt_version + lock_result=$(acquire_apt_installation_lock "$COMMAND_INFO" ) + $REAL_COMMAND "$@" + command_result=$? + [ "$lock_result" == y ] && release_apt_installation_lock + exit $command_result +else + if [[ " $@ " == *" purge "* || " $@ " == *" remove "* ]]; then + # When running the purge command, collect the debian versions + dpkg-query -W -f '${Package}==${Version}\n' >> $POST_VERSION_PATH/purge-versions-deb + chmod a+wr $POST_VERSION_PATH/purge-versions-deb + fi + $REAL_COMMAND "$@" fi - -$REAL_COMMAND "$@" diff --git a/src/sonic-build-hooks/hooks/dpkg b/src/sonic-build-hooks/hooks/dpkg new file mode 100755 index 000000000000..294cb19f4c1f --- /dev/null +++ b/src/sonic-build-hooks/hooks/dpkg @@ -0,0 +1,18 @@ +#!/bin/bash + +. /usr/local/share/buildinfo/scripts/buildinfo_base.sh +REAL_COMMAND=$(get_command dpkg) +COMMAND_INFO="Locked by command: $REAL_COMMAND $@" +NEED_RELEASE_LOCK=n +if [[ "$DPKG_HOOK_LOCKED" != "y" ]];then + lock_result=$(acquire_apt_installation_lock "$COMMAND_INFO" ) + export DPKG_HOOK_LOCKED=y + NEED_RELEASE_LOCK=y +fi +$REAL_COMMAND "$@" +command_result=$? +if [[ "$NEED_RELEASE_LOCK" == "y" ]];then + unset DPKG_HOOK_LOCKED +fi +[ "$lock_result" == y ] && release_apt_installation_lock +exit $command_result diff --git a/src/sonic-build-hooks/hooks/git b/src/sonic-build-hooks/hooks/git new file mode 100755 index 000000000000..1bbffea603cf --- /dev/null +++ b/src/sonic-build-hooks/hooks/git @@ -0,0 +1,78 @@ +#!/bin/bash + +parse_config(){ + . /usr/local/share/buildinfo/scripts/buildinfo_base.sh + REAL_COMMAND=$(get_command git) + + version_file=$VERSION_PATH/versions-git + new_version_file=$BUILD_VERSION_PATH/versions-git + + MODE_CLONE=0 + # parse input parameters + for i in "$@" + do + if [[ $i == "clone" ]];then + MODE_CLONE=1 + fi + done +} + +get_clone_path(){ + # get parameter of clone path + while (( "$#" )); do + case $1 in + -b|--branch|--reference|--reference-if-able|-c|--config|--origin|-u|--upload-pack|-j|--jobs|--depth|--dissociate) + shift 2 + ;; + clone|-l|--local|--no-hardlinks|-s|--shared|--dissociate|-q|--quiet|-v|--verbose|--progress|--server-option=*|--bare|--sparse|--filter=*|--template=*|--mirror|--reference|--shallow-*|--no-tags|--recurse-submodules*|--remote-submodules|--no-remote-submodules|--separate-git-dir*) + shift 1 + ;; + *) + if [[ $URL == "" ]];then + URL=$1 + else + clone_PATH=$1 + fi + shift 1 + ;; + esac + done + + # if not specific clone path, get default clone path + # 1. trim tail slash sign. 2. trim all charactors before the last slash. 3.trim tail '.git' + [ -z $clone_PATH ] && clone_PATH=`echo $URL | sed 's/\/$//' | awk -F/ '{print$NF}' | awk -F. '{print$1}'` +} + +main(){ + parse_config "$@" + + # execute git. + $REAL_COMMAND "$@" + result=$? + + # if sub command is not "clone", exit + if [[ $MODE_CLONE != 1 ]];then + exit $result + fi + + get_clone_path "$@" + pushd $clone_PATH &> /dev/null + commit_latest=`$REAL_COMMAND log -n 1 | head -n 1| awk '{print$2}'` + [ -f $version_file ] && commit=`grep $URL $version_file | awk -F== '{print$2}'` + + # control version or record version file + if [[ $ENABLE_VERSION_CONTROL_GIT == "y" ]];then + # control version + [ -n $commit ] && echo "git reset --hard $commit" >> ${new_version_file}.log + [ -n $commit ] && $REAL_COMMAND reset --hard $commit &> ${new_version_file}.log + else + # record version file + echo "$URL==$commit_latest" >> $new_version_file + sort $new_version_file -o $new_version_file -u &> /dev/null + fi + popd &> /dev/null + + exit $result +} + +main "$@" diff --git a/src/sonic-build-hooks/hooks/pip3 b/src/sonic-build-hooks/hooks/pip3 index 36a8fd93a13d..728e642eacc0 100755 --- a/src/sonic-build-hooks/hooks/pip3 +++ b/src/sonic-build-hooks/hooks/pip3 @@ -9,4 +9,4 @@ if [ ! -x "$REAL_COMMAND" ]; then exit 1 fi -PIP_VERSION_FILE=$VERSION_FILE ENABLE_VERSION_CONTROL_PY=$ENABLE_VERSION_CONTROL_PY2 REAL_COMMAND=$REAL_COMMAND run_pip_command "$@" +PIP_VERSION_FILE=$VERSION_FILE ENABLE_VERSION_CONTROL_PY=$ENABLE_VERSION_CONTROL_PY3 REAL_COMMAND=$REAL_COMMAND run_pip_command "$@" diff --git a/src/sonic-build-hooks/scripts/buildinfo_base.sh b/src/sonic-build-hooks/scripts/buildinfo_base.sh index d19558c544e3..fc6e81340061 100755 --- a/src/sonic-build-hooks/scripts/buildinfo_base.sh +++ b/src/sonic-build-hooks/scripts/buildinfo_base.sh @@ -11,26 +11,39 @@ POST_VERSION_PATH=$BUILDINFO_PATH/post-versions VERSION_DEB_PREFERENCE=$BUILDINFO_PATH/versions/01-versions-deb WEB_VERSION_FILE=$VERSION_PATH/versions-web BUILD_WEB_VERSION_FILE=$BUILD_VERSION_PATH/versions-web +REPR_MIRROR_URL_PATTERN='http:\/\/packages.trafficmanager.net\/' +DPKG_INSTALLTION_LOCK_FILE=/tmp/.dpkg_installation.lock . $BUILDINFO_PATH/config/buildinfo.config URL_PREFIX=$(echo "${PACKAGE_URL_PREFIX}" | sed -E "s#(//[^/]*/).*#\1#") +if [ "$(whoami)" != "root" ] && [ -n "$(which sudo)" ];then + SUDO=sudo +else + SUDO='' +fi + log_err() { echo "$1" >> $LOG_PATH/error.log echo "$1" 1>&2 } +# Get the real command not hooked by sonic-build-hook package get_command() { - local path=$(echo $PATH | sed 's#[^:]*buildinfo/scripts:##' | sed "s#/usr/sbin:##") + # Change the PATH env to get the real command by excluding the command in the hooked folders + local path=$(echo $PATH | sed 's#[^:]*buildinfo/scripts:##' | sed "s#/usr/local/sbin:##") local command=$(PATH=$path which $1) echo $command } check_version_control() { + # The env variable SONIC_VERSION_CONTROL_COMPONENTS examples: + # all -- match all components + # py2,py3,deb -- match py2, py3 and deb only if [[ ",$SONIC_VERSION_CONTROL_COMPONENTS," == *,all,* ]] || [[ ",$SONIC_VERSION_CONTROL_COMPONENTS," == *,$1,* ]]; then echo "y" else @@ -41,7 +54,7 @@ check_version_control() get_url_version() { local package_url=$1 - /usr/bin/curl -ks $package_url | md5sum | cut -d' ' -f1 + /usr/bin/curl -Lks $package_url | md5sum | cut -d' ' -f1 } check_if_url_exist() @@ -54,6 +67,47 @@ check_if_url_exist() fi } +# Enable or disable the reproducible mirrors +set_reproducible_mirrors() +{ + # Remove the charater # in front of the line if matched + local expression="s/^#\s*\(.*$REPR_MIRROR_URL_PATTERN\)/\1/" + # Add the character # in front of the line, if not match the URL pattern condition + local expression2="/^#*deb.*$REPR_MIRROR_URL_PATTERN/! s/^#*deb/#&/" + local expression3="\$a#SET_REPR_MIRRORS" + if [ "$1" = "-d" ]; then + # Add the charater # in front of the line if match + expression="s/^deb.*$REPR_MIRROR_URL_PATTERN/#\0/" + # Remove the character # in front of the line, if not match the URL pattern condition + expression2="/^#*deb.*$REPR_MIRROR_URL_PATTERN/! s/^#\s*(#*deb)/\1/" + expression3="/#SET_REPR_MIRRORS/d" + fi + + local mirrors="/etc/apt/sources.list $(find /etc/apt/sources.list.d/ -type f)" + for mirror in $mirrors; do + if ! grep -iq "$REPR_MIRROR_URL_PATTERN" "$mirror"; then + continue + fi + + # Make sure no duplicate operations on the mirror config file + if ([ "$1" == "-d" ] && ! grep -iq "#SET_REPR_MIRRORS" "$mirror") || + ([ "$1" != "-d" ] && grep -iq "#SET_REPR_MIRRORS" "$mirror"); then + continue + fi + + # Enable or disable the reproducible mirrors + $SUDO sed -i "$expression" "$mirror" + + # Enable or disable the none reproducible mirrors + if [ "$MIRROR_SNAPSHOT" == y ]; then + $SUDO sed -ri "$expression2" "$mirror" + fi + + # Add or remove the SET_REPR_MIRRORS flag + $SUDO sed -i "$expression3" "$mirror" + done +} + download_packages() { local parameters=("$@") @@ -66,13 +120,19 @@ download_packages() if [[ "$para" == *://* ]]; then local url=$para local real_version= + + # Skip to use the proxy, if the url has already used the proxy server + if [[ $url == ${URL_PREFIX}* ]]; then + continue + fi + if [ "$ENABLE_VERSION_CONTROL_WEB" == y ]; then local version= local filename=$(echo $url | awk -F"/" '{print $NF}' | cut -d? -f1 | cut -d# -f1) [ -f $WEB_VERSION_FILE ] && version=$(grep "^${url}=" $WEB_VERSION_FILE | awk -F"==" '{print $NF}') if [ -z "$version" ]; then - echo "Failed to verify the package: $url, the version is not specified" 2>&1 - exit 1 + echo "Warning: Failed to verify the package: $url, the version is not specified" 1>&2 + continue fi local version_filename="${filename}-${version}" @@ -133,7 +193,11 @@ run_pip_command() install=y elif [[ "$para" == *.whl ]]; then package_name=$(echo $para | cut -d- -f1 | tr _ .) - sed "/^${package_name}==/d" -i $tmp_version_file + $SUDO sed "/^${package_name}==/d" -i $tmp_version_file + elif [[ "$para" == *==* ]]; then + # fix pip package constraint conflict issue + package_name=$(echo $para | cut -d= -f1) + $SUDO sed "/^${package_name}==/d" -i $tmp_version_file fi done @@ -144,10 +208,144 @@ run_pip_command() $REAL_COMMAND "${parameters[@]}" local result=$? + if [ "$result" != 0 ]; then + echo "Failed to run the command with constraint, try to install with the original command" 1>&2 + $REAL_COMMAND "$@" + result=$? + fi rm $tmp_version_file return $result } +# Check if the command is to install the debian packages +# The apt/apt-get command format: apt/apt-get [options] {update|install} +check_apt_install() +{ + for para in "$@" + do + if [[ "$para" == -* ]]; then + continue + fi + + if [[ "$para" == "install" ]]; then + echo y + fi + + break + done +} + +# Print warning message if a debian package version not specified when debian version control enabled. +check_apt_version() +{ + VERSION_FILE="/usr/local/share/buildinfo/versions/versions-deb" + local install=$(check_apt_install "$@") + if [ "$ENABLE_VERSION_CONTROL_DEB" == "y" ] && [ "$install" == "y" ]; then + for para in "$@" + do + if [[ "$para" == -* ]]; then + continue + fi + + if [[ "$para" == *=* ]]; then + continue + else + package=$para + if ! grep -q "^${package}=" $VERSION_FILE; then + echo "Warning: the version of the package ${package} is not specified." 1>&2 + fi + fi + done + fi +} + +acquire_apt_installation_lock() +{ + local result=n + local wait_in_second=10 + local count=60 + local info="$1" + for ((i=1; i<=$count; i++)); do + if [ -f $DPKG_INSTALLTION_LOCK_FILE ]; then + local lock_info=$(cat $DPKG_INSTALLTION_LOCK_FILE || true) + echo "Waiting dpkg lock for $wait_in_second, $i/$count, info: $lock_info" 1>&2 + sleep $wait_in_second + else + # Create file in an atomic operation + if (set -o noclobber; echo "$info">$DPKG_INSTALLTION_LOCK_FILE) &>/dev/null; then + result=y + break + else + echo "Failed to creat lock, Waiting dpkg lock for $wait_in_second, $i/$count, info: $lock_info" 1>&2 + sleep $wait_in_second + fi + fi + done + + echo $result +} + +release_apt_installation_lock() +{ + rm -f $DPKG_INSTALLTION_LOCK_FILE +} + +update_preference_deb() +{ + local version_file="$VERSION_PATH/versions-deb" + if [ -f "$version_file" ]; then + rm -f $VERSION_DEB_PREFERENCE + for pacakge_version in $(cat "$version_file"); do + package=$(echo $pacakge_version | awk -F"==" '{print $1}') + version=$(echo $pacakge_version | awk -F"==" '{print $2}') + echo -e "Package: $package\nPin: version $version\nPin-Priority: 999\n\n" >> $VERSION_DEB_PREFERENCE + done + fi +} + +update_version_file() +{ + local version_name=$1 + local pre_version_file="$(ls $PRE_VERSION_PATH/${version_name}-* 2>/dev/null | head -n 1)" + local version_file="$VERSION_PATH/$1" + if [ ! -f "$pre_version_file" ]; then + return 0 + fi + local pacakge_versions="$(cat $pre_version_file)" + [ -f "$version_file" ] && pacakge_versions="$pacakge_versions $(cat $version_file)" + declare -A versions + for pacakge_version in $pacakge_versions; do + package=$(echo $pacakge_version | awk -F"==" '{print $1}') + version=$(echo $pacakge_version | awk -F"==" '{print $2}') + if [ -z "$package" ] || [ -z "$version" ]; then + continue + fi + versions[$package]=$version + done + + tmp_file=$(mktemp) + for package in "${!versions[@]}"; do + echo "$package==${versions[$package]}" >> $tmp_file + done + sort -u $tmp_file > $version_file + rm -f $tmp_file + + if [[ "${version_name}" == *-deb ]]; then + update_preference_deb + fi +} + +update_version_files() +{ + local version_names="versions-deb versions-py2 versions-py3" + if [ "$MIRROR_SNAPSHOT" == y ]; then + version_names="versions-py2 versions-py3" + fi + for version_name in $version_names; do + update_version_file $version_name + done +} + ENABLE_VERSION_CONTROL_DEB=$(check_version_control "deb") ENABLE_VERSION_CONTROL_PY2=$(check_version_control "py2") ENABLE_VERSION_CONTROL_PY3=$(check_version_control "py3") diff --git a/src/sonic-build-hooks/scripts/collect_version_files b/src/sonic-build-hooks/scripts/collect_version_files index b62beb4a2115..3fcc99a87106 100755 --- a/src/sonic-build-hooks/scripts/collect_version_files +++ b/src/sonic-build-hooks/scripts/collect_version_files @@ -1,14 +1,40 @@ #!/bin/bash +. /usr/local/share/buildinfo/scripts/buildinfo_base.sh + TARGET_PATH=$1 +[ -z "$TARGET_PATH" ] && TARGET_PATH=$POST_VERSION_PATH ARCH=$(dpkg --print-architecture) DIST=$(grep VERSION_CODENAME /etc/os-release | cut -d= -f2) ([ -z "$DIST" ] && grep -q jessie /etc/os-release) && DIST=jessie mkdir -p $TARGET_PATH chmod a+rw $TARGET_PATH -dpkg-query -W -f '${Package}==${Version}\n' > "${TARGET_PATH}/versions-deb-${DIST}-${ARCH}" -([ -x "/usr/local/bin/pip2" ] || [ -x "/usr/bin/pip2" ]) && pip2 freeze > "${TARGET_PATH}/versions-py2-${DIST}-${ARCH}" -([ -x "/usr/local/bin/pip3" ] || [ -x "/usr/bin/pip3" ]) && pip3 freeze > "${TARGET_PATH}/versions-py3-${DIST}-${ARCH}" + +dpkg-query -W -f '${Package}==${Version}\n' >> "${TARGET_PATH}/versions-deb-${DIST}-${ARCH}" +([ -x "/usr/local/bin/pip2" ] || [ -x "/usr/bin/pip2" ]) && pip2 freeze >> "${TARGET_PATH}/versions-py2-${DIST}-${ARCH}" +([ -x "/usr/local/bin/pip3" ] || [ -x "/usr/bin/pip3" ]) && pip3 freeze >> "${TARGET_PATH}/versions-py3-${DIST}-${ARCH}" + +## Add the the packages purged +[ -f $POST_VERSION_PATH/purge-versions-deb ] && cat $POST_VERSION_PATH/purge-versions-deb >> "${TARGET_PATH}/versions-deb-${DIST}-${ARCH}" + +## Add mirror versions +while read -r line; do + mirror=$(echo "$line" | sed "s/.*\///" | sed "s/_InRelease.*//") + date=$(date --date="$(echo "$line" | cut -d: -f3-)" +%Y-%m-%dT%H:%M:%SZ) + echo "$mirror==$date" >> ${TARGET_PATH}/versions-mirror +done < <(grep Date: /var/lib/apt/lists/*_InRelease 2>/dev/null) + +## Print the unique and sorted result +sort -u "${TARGET_PATH}/versions-deb-${DIST}-${ARCH}" -o "${TARGET_PATH}/versions-deb-${DIST}-${ARCH}" +if [ -e "${TARGET_PATH}/versions-py2-${DIST}-${ARCH}" ]; then + sort -u "${TARGET_PATH}/versions-py2-${DIST}-${ARCH}" -o "${TARGET_PATH}/versions-py2-${DIST}-${ARCH}" +fi +if [ -e "${TARGET_PATH}/versions-py3-${DIST}-${ARCH}" ]; then + sort -u "${TARGET_PATH}/versions-py3-${DIST}-${ARCH}" -o "${TARGET_PATH}/versions-py3-${DIST}-${ARCH}" +fi +if [ -e "${TARGET_PATH}/versions-mirror" ]; then + sort -u "${TARGET_PATH}/versions-mirror" -o "${TARGET_PATH}/versions-mirror" +fi exit 0 diff --git a/src/sonic-build-hooks/scripts/post_run_buildinfo b/src/sonic-build-hooks/scripts/post_run_buildinfo index a8dab41021b1..f638dbc23e7c 100755 --- a/src/sonic-build-hooks/scripts/post_run_buildinfo +++ b/src/sonic-build-hooks/scripts/post_run_buildinfo @@ -2,8 +2,6 @@ . /usr/local/share/buildinfo/scripts/buildinfo_base.sh -[ -d $POST_VERSION_PATH ] && rm -rf $POST_VERSION_PATH - # Collect the version files collect_version_files $POST_VERSION_PATH @@ -12,3 +10,8 @@ rm -rf $BUILD_VERSION_PATH/* # Disable the build hooks symlink_build_hooks -d +set_reproducible_mirrors -d + +# Remove the version deb preference +rm -f $VERSION_DEB_PREFERENCE +rm -f /etc/apt/preferences.d/01-versions-deb diff --git a/src/sonic-build-hooks/scripts/pre_run_buildinfo b/src/sonic-build-hooks/scripts/pre_run_buildinfo index a8450690b6ff..5a8f00b55ecb 100755 --- a/src/sonic-build-hooks/scripts/pre_run_buildinfo +++ b/src/sonic-build-hooks/scripts/pre_run_buildinfo @@ -8,8 +8,12 @@ mkdir -p $BUILD_VERSION_PATH mkdir -p $LOG_PATH [ -d $PRE_VERSION_PATH ] && rm -rf $PRE_VERSION_PATH +[ -d $POST_VERSION_PATH ] && rm -rf $POST_VERSION_PATH +mkdir -p $POST_VERSION_PATH collect_version_files $PRE_VERSION_PATH +update_version_files symlink_build_hooks +set_reproducible_mirrors chmod -R a+rw $BUILDINFO_PATH diff --git a/src/sonic-build-hooks/scripts/symlink_build_hooks b/src/sonic-build-hooks/scripts/symlink_build_hooks index 7218575ee9ab..2ce5ec27720f 100755 --- a/src/sonic-build-hooks/scripts/symlink_build_hooks +++ b/src/sonic-build-hooks/scripts/symlink_build_hooks @@ -1,7 +1,7 @@ #!/bin/bash HOOK_PATH=/usr/local/share/buildinfo/hooks -TARGET_PATH=/usr/sbin +TARGET_PATH=/usr/local/sbin FILES=$(ls $HOOK_PATH) usage() diff --git a/src/sonic-config-engine/config_samples.py b/src/sonic-config-engine/config_samples.py index 9072e0209c3e..f8dc4b1c13b3 100644 --- a/src/sonic-config-engine/config_samples.py +++ b/src/sonic-config-engine/config_samples.py @@ -1,5 +1,40 @@ +import sys + +from collections import defaultdict +from ipaddress import ip_interface from natsort import natsorted +#TODO: Remove once Python 2 support is removed +if sys.version_info.major == 3: + UNICODE_TYPE = str +else: + UNICODE_TYPE = unicode + +# The following config generation methods exits: +# 't1': generate_t1_sample_config, +# 'l2': generate_l2_config, +# 'empty': generate_empty_config, +# 'l1': generate_l1_config, +# 'l3': generate_l3_config + +def generate_l1_config(data): + for port in natsorted(data['PORT']): + data['PORT'][port]['admin_status'] = 'up' + data['PORT'][port]['mtu'] = '9100' + return data; + +def generate_l3_config(data): + data['LOOPBACK_INTERFACE'] = {"Loopback0": {}, + "Loopback0|10.1.0.1/32": {}} + data['BGP_NEIGHBOR'] = {} + data['DEVICE_NEIGHBOR'] = {} + data['INTERFACE'] = {} + for port in natsorted(data['PORT']): + data['PORT'][port]['admin_status'] = 'up' + data['PORT'][port]['mtu'] = '9100' + data['INTERFACE']['{}'.format(port)] = {} + return data; + def generate_t1_sample_config(data): data['DEVICE_METADATA']['localhost']['hostname'] = 'sonic' data['DEVICE_METADATA']['localhost']['type'] = 'LeafRouter' @@ -28,7 +63,7 @@ def generate_t1_sample_config(data): 'keepalive': '60' } port_count += 1 - return data; + return data def generate_empty_config(data): new_data = {'DEVICE_METADATA': data['DEVICE_METADATA']} @@ -38,18 +73,87 @@ def generate_empty_config(data): new_data['DEVICE_METADATA']['localhost']['type'] = 'LeafRouter' return new_data +def generate_global_dualtor_tables(): + data = defaultdict(lambda: defaultdict(dict)) + data['LOOPBACK_INTERFACE'] = { + 'Loopback2': {}, + 'Loopback2|3.3.3.3': {} + } + data['MUX_CABLE'] = {} + data['PEER_SWITCH'] = { + "peer_switch_hostname": { + "address_ipv4": "1.1.1.1" + } + } + data['TUNNEL'] = { + "MuxTunnel0": { + "dscp_mode": "uniform", + "dst_ip": "2.2.2.2", + "ecn_mode": "copy_from_outer", + "encap_ecn_mode": "standard", + "ttl_mode": "pipe", + "tunnel_type": "IPINIP" + } + } + return data + def generate_l2_config(data): + # Check if dual ToR configs are needed + if 'is_dualtor' in data and data['is_dualtor']: + is_dualtor = True + data.pop('is_dualtor') + else: + is_dualtor = False + + if 'uplinks' in data: + uplinks = data['uplinks'] + data.pop('uplinks') + + if 'downlinks' in data: + downlinks = data['downlinks'] + data.pop('downlinks') + + # VLAN initial data data['VLAN'] = {'Vlan1000': {'vlanid': '1000'}} data['VLAN_MEMBER'] = {} + + if is_dualtor: + data['DEVICE_METADATA']['localhost']['subtype'] = 'DualToR' + data['DEVICE_METADATA']['localhost']['peer_switch'] = 'peer_switch_hostname' + data.update(generate_global_dualtor_tables()) + + server_ipv4_base = ip_interface(UNICODE_TYPE('192.168.0.1/32')) + server_ipv6_base = ip_interface(UNICODE_TYPE('fc02:1000::1/128')) + server_offset = 1 for port in natsorted(data['PORT']): - data['PORT'][port].setdefault('admin_status', 'up') - data['VLAN_MEMBER']['Vlan1000|{}'.format(port)] = {'tagging_mode': 'untagged'} + if is_dualtor: + # Ports in use should be admin up, unused ports default to admin down + if port in downlinks or port in uplinks: + data['PORT'][port].setdefault('admin_status', 'up') + data['VLAN_MEMBER']['Vlan1000|{}'.format(port)] = {'tagging_mode': 'untagged'} + + # Downlinks (connected to mux cable) need a MUX_CABLE entry + # as well as the `mux_cable` field in the PORT table + if port in downlinks: + mux_cable_entry = { + 'server_ipv4': str(server_ipv4_base + server_offset), + 'server_ipv6': str(server_ipv6_base + server_offset), + 'state': 'auto' + } + server_offset += 1 + data['MUX_CABLE'][port] = mux_cable_entry + data['PORT'][port]['mux_cable'] = 'true' + else: + data['PORT'][port].setdefault('admin_status', 'up') + data['VLAN_MEMBER']['Vlan1000|{}'.format(port)] = {'tagging_mode': 'untagged'} return data _sample_generators = { 't1': generate_t1_sample_config, 'l2': generate_l2_config, - 'empty': generate_empty_config + 'empty': generate_empty_config, + 'l1': generate_l1_config, + 'l3': generate_l3_config } def get_available_config(): diff --git a/src/sonic-config-engine/data/l1intf.j2 b/src/sonic-config-engine/data/l1intf.j2 new file mode 100644 index 000000000000..06222632e0da --- /dev/null +++ b/src/sonic-config-engine/data/l1intf.j2 @@ -0,0 +1,26 @@ +{ + "DEVICE_METADATA": { + "localhost" : { + "hwsku" : "{{ DEVICE_METADATA.localhost.hwsku }}" + } + }, + {% set ns = {'firstPrinted': False} -%} + "PORT": { + {%- for key, value in PORT.items() -%} + {%- if ns.firstPrinted %},{% endif %} + + "{{ key }}": { + {%- for keyPort, valuePort in value.items() %} + + {% if keyPort != "admin_status" %}"{{ keyPort }}": "{{ valuePort }}",{% endif %} + {%- endfor %} + + "admin_status": "{{ value.admin_status|default("up") }}", + "mtu": "9100" + } + {%- if ns.update({'firstPrinted': True}) %}{% endif -%} + {%- endfor %} + + } +} + diff --git a/src/sonic-config-engine/data/l3intf.j2 b/src/sonic-config-engine/data/l3intf.j2 new file mode 100644 index 000000000000..255868eb8257 --- /dev/null +++ b/src/sonic-config-engine/data/l3intf.j2 @@ -0,0 +1,65 @@ +{ + "DEVICE_METADATA": { + "localhost" : { + "hwsku" : "{{ DEVICE_METADATA.localhost.hwsku }}" + } + }, + {% set ns = {'firstPrinted': False} -%} + "PORT": { + {%- for key, value in PORT.items() -%} + {%- if ns.firstPrinted %},{% endif %} + + "{{ key }}": { + {%- for keyPort, valuePort in value.items() %} + + {% if keyPort != "admin_status" %}"{{ keyPort }}": "{{ valuePort }}",{% endif %} + {%- endfor %} + + "admin_status": "{{ value.admin_status|default("up") }}", + "mtu": "9100" + } + {%- if ns.update({'firstPrinted': True}) %}{% endif -%} + {%- endfor %} + + }, + "LOOPBACK_INTERFACE": { + "Loopback0": {}, + "Loopback0|10.1.0.1/32": {} + }, + "BGP_NEIGHBOR": {}, + "DEVICE_NEIGHBOR": {}, + "INTERFACE": { + "Ethernet0": {}, + "Ethernet1": {}, + "Ethernet2": {}, + "Ethernet3": {}, + "Ethernet4": {}, + "Ethernet5": {}, + "Ethernet6": {}, + "Ethernet7": {}, + "Ethernet8": {}, + "Ethernet9": {}, + "Ethernet10": {}, + "Ethernet11": {}, + "Ethernet12": {}, + "Ethernet13": {}, + "Ethernet14": {}, + "Ethernet15": {}, + "Ethernet16": {}, + "Ethernet17": {}, + "Ethernet18": {}, + "Ethernet19": {}, + "Ethernet20": {}, + "Ethernet21": {}, + "Ethernet22": {}, + "Ethernet23": {}, + "Ethernet24": {}, + "Ethernet25": {}, + "Ethernet26": {}, + "Ethernet27": {}, + "Ethernet28": {}, + "Ethernet29": {}, + "Ethernet30": {}, + "Ethernet31": {} + } +} diff --git a/src/sonic-config-engine/minigraph.py b/src/sonic-config-engine/minigraph.py index 660606b4519d..ac4fcf7e92cd 100644 --- a/src/sonic-config-engine/minigraph.py +++ b/src/sonic-config-engine/minigraph.py @@ -5,6 +5,7 @@ import os import sys import json +import subprocess from collections import defaultdict from lxml import etree as ET @@ -12,7 +13,6 @@ from portconfig import get_port_config -from sonic_py_common.multi_asic import get_asic_id_from_name from sonic_py_common.interface import backplane_prefix # TODO: Remove this once we no longer support Python 2 @@ -38,6 +38,7 @@ backend_device_types = ['BackEndToRRouter', 'BackEndLeafRouter'] console_device_types = ['MgmtTsToR'] +dhcp_server_enabled_device_types = ['BmcMgmtToRRouter'] VLAN_SUB_INTERFACE_SEPARATOR = '.' VLAN_SUB_INTERFACE_VLAN_ID = '10' @@ -62,9 +63,15 @@ def default(self, obj): return str(obj) return json.JSONEncoder.default(self, obj) +def exec_cmd(cmd): + p = subprocess.Popen(cmd, shell=False, stdout=subprocess.PIPE) + outs, errs = p.communicate() + def get_peer_switch_info(link_metadata, devices): peer_switch_table = {} - for data in link_metadata.values(): + peer_switch_ip = None + mux_tunnel_name = None + for port, data in link_metadata.items(): if "PeerSwitch" in data: peer_hostname = data["PeerSwitch"] peer_lo_addr_str = devices[peer_hostname]["lo_addr"] @@ -73,17 +80,21 @@ def get_peer_switch_info(link_metadata, devices): peer_switch_table[peer_hostname] = { 'address_ipv4': str(peer_lo_addr.network_address) if peer_lo_addr else peer_lo_addr_str } + mux_tunnel_name = port + peer_switch_ip = peer_switch_table[peer_hostname]['address_ipv4'] - return peer_switch_table + return peer_switch_table, mux_tunnel_name, peer_switch_ip def parse_device(device): lo_prefix = None lo_prefix_v6 = None mgmt_prefix = None + mgmt_prefix_v6 = None d_type = None # don't shadow type() hwsku = None name = None deployment_id = None + cluster = None for node in device: if node.tag == str(QName(ns, "Address")): @@ -92,6 +103,8 @@ def parse_device(device): lo_prefix_v6 = node.find(str(QName(ns2, "IPPrefix"))).text elif node.tag == str(QName(ns, "ManagementAddress")): mgmt_prefix = node.find(str(QName(ns2, "IPPrefix"))).text + elif node.tag == str(QName(ns, "ManagementAddressV6")): + mgmt_prefix_v6 = node.find(str(QName(ns2, "IPPrefix"))).text elif node.tag == str(QName(ns, "Hostname")): name = node.text elif node.tag == str(QName(ns, "HwSku")): @@ -100,11 +113,14 @@ def parse_device(device): deployment_id = node.text elif node.tag == str(QName(ns, "ElementType")): d_type = node.text + elif node.tag == str(QName(ns, "ClusterName")): + cluster = node.text if d_type is None and str(QName(ns3, "type")) in device.attrib: d_type = device.attrib[str(QName(ns3, "type"))] - return (lo_prefix, lo_prefix_v6, mgmt_prefix, name, hwsku, d_type, deployment_id) + return (lo_prefix, lo_prefix_v6, mgmt_prefix, mgmt_prefix_v6, name, hwsku, d_type, deployment_id, cluster) + def calculate_lcm_for_ecmp (nhdevices_bank_map, nhip_bank_map): banks_enumerated = {} @@ -143,7 +159,6 @@ def formulate_fine_grained_ecmp(version, dpg_ecmp_content, port_device_map, port tag = "fgnhg_v6" port_nhip_map = dpg_ecmp_content['port_nhip_map'] - nhgaddr = dpg_ecmp_content['nhgaddr'] nhg_int = dpg_ecmp_content['nhg_int'] nhip_device_map = {port_nhip_map[x]: port_device_map[x] for x in port_device_map @@ -156,20 +171,17 @@ def formulate_fine_grained_ecmp(version, dpg_ecmp_content, port_device_map, port FG_NHG_MEMBER = {ip: {"FG_NHG": tag, "bank": bank} for ip, bank in nhip_bank_map.items()} nhip_port_map = dict(zip(port_nhip_map.values(), port_nhip_map.keys())) - - for nhip, memberinfo in FG_NHG_MEMBER.items(): if nhip in nhip_port_map: memberinfo["link"] = port_alias_map[nhip_port_map[nhip]] FG_NHG_MEMBER[nhip] = memberinfo - FG_NHG_PREFIX = {nhgaddr: {"FG_NHG": tag}} - FG_NHG = {tag: {"bucket_size": LCM}} + FG_NHG = {tag: {"bucket_size": LCM, "match_mode": "nexthop-based"}} for ip in nhip_bank_map: neigh_key.append(str(nhg_int + "|" + ip)) NEIGH = {neigh_key: {"family": family} for neigh_key in neigh_key} - fine_grained_content = {"FG_NHG_MEMBER": FG_NHG_MEMBER, "FG_NHG": FG_NHG, "FG_NHG_PREFIX": FG_NHG_PREFIX, "NEIGH": NEIGH} + fine_grained_content = {"FG_NHG_MEMBER": FG_NHG_MEMBER, "FG_NHG": FG_NHG, "NEIGH": NEIGH} return fine_grained_content def parse_png(png, hname, dpg_ecmp_content = None): @@ -182,11 +194,9 @@ def parse_png(png, hname, dpg_ecmp_content = None): port_speeds = {} console_ports = {} mux_cable_ports = {} - is_storage_device = False port_device_map = {} png_ecmp_content = {} FG_NHG_MEMBER = {} - FG_NHG_PREFIX = {} FG_NHG = {} NEIGH = {} @@ -201,18 +211,18 @@ def parse_png(png, hname, dpg_ecmp_content = None): startport = link.find(str(QName(ns, "StartPort"))).text baudrate = link.find(str(QName(ns, "Bandwidth"))).text flowcontrol = 1 if link.find(str(QName(ns, "FlowControl"))) is not None and link.find(str(QName(ns, "FlowControl"))).text == 'true' else 0 - if enddevice.lower() == hname.lower(): + if enddevice.lower() == hname.lower() and endport.isdigit(): console_ports[endport] = { 'remote_device': startdevice, 'baud_rate': baudrate, 'flow_control': flowcontrol - } - else: + } + elif startport.isdigit(): console_ports[startport] = { 'remote_device': enddevice, 'baud_rate': baudrate, 'flow_control': flowcontrol - } + } continue if linktype == "DeviceInterfaceLink": @@ -220,7 +230,7 @@ def parse_png(png, hname, dpg_ecmp_content = None): startdevice = link.find(str(QName(ns, "StartDevice"))).text port_device_map[endport] = startdevice - if linktype != "DeviceInterfaceLink" and linktype != "UnderlayInterfaceLink": + if linktype != "DeviceInterfaceLink" and linktype != "UnderlayInterfaceLink" and linktype != "DeviceMgmtLink": continue enddevice = link.find(str(QName(ns, "EndDevice"))).text @@ -232,32 +242,30 @@ def parse_png(png, hname, dpg_ecmp_content = None): if enddevice.lower() == hname.lower(): if endport in port_alias_map: endport = port_alias_map[endport] - neighbors[endport] = {'name': startdevice, 'port': startport} + if linktype != "DeviceMgmtLink": + neighbors[endport] = {'name': startdevice, 'port': startport} if bandwidth: port_speeds[endport] = bandwidth elif startdevice.lower() == hname.lower(): if startport in port_alias_map: startport = port_alias_map[startport] - neighbors[startport] = {'name': enddevice, 'port': endport} + if linktype != "DeviceMgmtLink": + neighbors[startport] = {'name': enddevice, 'port': endport} if bandwidth: port_speeds[startport] = bandwidth if child.tag == str(QName(ns, "Devices")): for device in child.findall(str(QName(ns, "Device"))): - (lo_prefix, lo_prefix_v6, mgmt_prefix, name, hwsku, d_type, deployment_id) = parse_device(device) - device_data = {'lo_addr': lo_prefix, 'type': d_type, 'mgmt_addr': mgmt_prefix, 'hwsku': hwsku } + (lo_prefix, lo_prefix_v6, mgmt_prefix, mgmt_prefix_v6, name, hwsku, d_type, deployment_id, cluster) = parse_device(device) + device_data = {'lo_addr': lo_prefix, 'type': d_type, 'mgmt_addr': mgmt_prefix, 'hwsku': hwsku} + if cluster: + device_data['cluster'] = cluster if deployment_id: device_data['deployment_id'] = deployment_id if lo_prefix_v6: device_data['lo_addr_v6'] = lo_prefix_v6 devices[name] = device_data - if name == hname: - cluster = device.find(str(QName(ns, "ClusterName"))) - - if cluster != None and "str" in cluster.text.lower(): - is_storage_device = True - if child.tag == str(QName(ns, "DeviceInterfaceLinks")): for if_link in child.findall(str(QName(ns, 'DeviceLinkBase'))): if str(QName(ns3, "type")) in if_link.attrib: @@ -289,14 +297,12 @@ def parse_png(png, hname, dpg_ecmp_content = None): for version, content in dpg_ecmp_content.items(): # version is ipv4 or ipv6 fine_grained_content = formulate_fine_grained_ecmp(version, content, port_device_map, port_alias_map) # port_alias_map FG_NHG_MEMBER.update(fine_grained_content['FG_NHG_MEMBER']) - FG_NHG_PREFIX.update(fine_grained_content['FG_NHG_PREFIX']) FG_NHG.update(fine_grained_content['FG_NHG']) NEIGH.update(fine_grained_content['NEIGH']) - png_ecmp_content = {"FG_NHG_PREFIX": FG_NHG_PREFIX, "FG_NHG_MEMBER": FG_NHG_MEMBER, "FG_NHG": FG_NHG, - "NEIGH": NEIGH} + png_ecmp_content = {"FG_NHG_MEMBER": FG_NHG_MEMBER, "FG_NHG": FG_NHG, "NEIGH": NEIGH} - return (neighbors, devices, console_dev, console_port, mgmt_dev, mgmt_port, port_speeds, console_ports, mux_cable_ports, is_storage_device, png_ecmp_content) + return (neighbors, devices, console_dev, console_port, mgmt_dev, mgmt_port, port_speeds, console_ports, mux_cable_ports, png_ecmp_content) def parse_asic_external_link(link, asic_name, hostname): @@ -380,8 +386,10 @@ def parse_asic_png(png, asic_name, hostname): if child.tag == str(QName(ns, "Devices")): for device in child.findall(str(QName(ns, "Device"))): - (lo_prefix, lo_prefix_v6, mgmt_prefix, name, hwsku, d_type, deployment_id) = parse_device(device) + (lo_prefix, lo_prefix_v6, mgmt_prefix, mgmt_prefix_v6, name, hwsku, d_type, deployment_id, cluster) = parse_device(device) device_data = {'lo_addr': lo_prefix, 'type': d_type, 'mgmt_addr': mgmt_prefix, 'hwsku': hwsku } + if cluster: + device_data['cluster'] = cluster if deployment_id: device_data['deployment_id'] = deployment_id if lo_prefix_v6: @@ -403,7 +411,10 @@ def parse_loopback_intf(child): def parse_dpg(dpg, hname): aclintfs = None mgmtintfs = None + subintfs = None tunnelintfs = defaultdict(dict) + tunnelintfs_qos_remap_config = defaultdict(dict) + for child in dpg: """ In Multi-NPU platforms the acl intfs are defined only for the host not for individual asic. @@ -442,6 +453,16 @@ def parse_dpg(dpg, hname): ip_intfs_map[ipprefix] = intfalias lo_intfs = parse_loopback_intf(child) + subintfs = child.find(str(QName(ns, "SubInterfaces"))) + if subintfs is not None: + for subintf in subintfs.findall(str(QName(ns, "SubInterface"))): + intfalias = subintf.find(str(QName(ns, "AttachTo"))).text + intfname = port_alias_map.get(intfalias, intfalias) + ipprefix = subintf.find(str(QName(ns, "Prefix"))).text + subintfvlan = subintf.find(str(QName(ns, "Vlan"))).text + subintfname = intfname + VLAN_SUB_INTERFACE_SEPARATOR + subintfvlan + intfs[(subintfname, ipprefix)] = {} + mvrfConfigs = child.find(str(QName(ns, "MgmtVrfConfigs"))) mvrf = {} if mvrfConfigs != None: @@ -478,7 +499,6 @@ def parse_dpg(dpg, hname): pcs[pcintfname] = {'members': pcmbr_list, 'min_links': str(int(math.ceil(len(pcmbr_list) * 0.75)))} port_nhipv4_map = {} port_nhipv6_map = {} - nhgaddr = ["", ""] nhg_int = "" nhportlist = [] dpg_ecmp_content = {} @@ -502,42 +522,52 @@ def parse_dpg(dpg, hname): n = list(ipaddress.ip_network(UNICODE_TYPE(subnet_range), False).hosts()) if a in n: nhg_int = ip_intfs_map[subnet_range] - dwnstrms = child.find(str(QName(ns, "DownstreamSummarySet"))) - for dwnstrm in dwnstrms.findall(str(QName(ns, "DownstreamSummary"))): - dwnstrmentry = str(ET.tostring(dwnstrm)) - if ("FineGrainedECMPGroupDestination" in dwnstrmentry): - subnet_ip = dwnstrm.find(str(QName(ns1, "Subnet"))).text - truncsubnet_ip = subnet_ip.split("/")[0] - if "." in (truncsubnet_ip): - nhgaddr[0] = subnet_ip - elif ":" in (truncsubnet_ip): - nhgaddr[1] = subnet_ip - ipv4_content = {"port_nhip_map": port_nhipv4_map, "nhgaddr": nhgaddr[0], "nhg_int": nhg_int} - ipv6_content = {"port_nhip_map": port_nhipv6_map, "nhgaddr": nhgaddr[1], "nhg_int": nhg_int} + + ipv4_content = {"port_nhip_map": port_nhipv4_map, "nhg_int": nhg_int} + ipv6_content = {"port_nhip_map": port_nhipv6_map, "nhg_int": nhg_int} dpg_ecmp_content['ipv4'] = ipv4_content dpg_ecmp_content['ipv6'] = ipv6_content + vlanintfs = child.find(str(QName(ns, "VlanInterfaces"))) - vlan_intfs = [] vlans = {} vlan_members = {} - vlantype_name = "" + dhcp_relay_table = {} + # Dict: vlan member (port/PortChannel) -> set of VlanID, in which the member if an untagged vlan member + untagged_vlan_mbr = defaultdict(set) + for vintf in vlanintfs.findall(str(QName(ns, "VlanInterface"))): + vlanid = vintf.find(str(QName(ns, "VlanID"))).text + vlantype = vintf.find(str(QName(ns, "Type"))) + if vlantype is None: + vlantype_name = "" + else: + vlantype_name = vlantype.text + vintfmbr = vintf.find(str(QName(ns, "AttachTo"))).text + vmbr_list = vintfmbr.split(';') + if vlantype_name != "Tagged": + for member in vmbr_list: + untagged_vlan_mbr[member].add(vlanid) for vintf in vlanintfs.findall(str(QName(ns, "VlanInterface"))): vintfname = vintf.find(str(QName(ns, "Name"))).text vlanid = vintf.find(str(QName(ns, "VlanID"))).text vintfmbr = vintf.find(str(QName(ns, "AttachTo"))).text vlantype = vintf.find(str(QName(ns, "Type"))) - if vlantype != None: - vlantype_name = vintf.find(str(QName(ns, "Type"))).text + if vlantype is None: + vlantype_name = "" + else: + vlantype_name = vlantype.text vmbr_list = vintfmbr.split(';') for i, member in enumerate(vmbr_list): vmbr_list[i] = port_alias_map.get(member, member) sonic_vlan_member_name = "Vlan%s" % (vlanid) if vlantype_name == "Tagged": vlan_members[(sonic_vlan_member_name, vmbr_list[i])] = {'tagging_mode': 'tagged'} + elif len(untagged_vlan_mbr[member]) > 1: + vlan_members[(sonic_vlan_member_name, vmbr_list[i])] = {'tagging_mode': 'tagged'} else: vlan_members[(sonic_vlan_member_name, vmbr_list[i])] = {'tagging_mode': 'untagged'} - vlan_attributes = {'vlanid': vlanid} + vlan_attributes = {'vlanid': vlanid, 'members': vmbr_list } + dhcp_attributes = {} # If this VLAN requires a DHCP relay agent, it will contain a element # containing a list of DHCP server IPs @@ -547,8 +577,17 @@ def parse_dpg(dpg, hname): vdhcpserver_list = vintfdhcpservers.split(';') vlan_attributes['dhcp_servers'] = vdhcpserver_list + vintf_node = vintf.find(str(QName(ns, "Dhcpv6Relays"))) + if vintf_node is not None and vintf_node.text is not None: + vintfdhcpservers = vintf_node.text + vdhcpserver_list = vintfdhcpservers.split(';') + vlan_attributes['dhcpv6_servers'] = vdhcpserver_list + dhcp_attributes['dhcpv6_servers'] = vdhcpserver_list + sonic_vlan_member_name = "Vlan%s" % (vlanid) + dhcp_relay_table[sonic_vlan_member_name] = dhcp_attributes + vlanmac = vintf.find(str(QName(ns, "MacAddress"))) - if vlanmac != None: + if vlanmac is not None and vlanmac.text is not None: vlan_attributes['mac'] = vlanmac.text sonic_vlan_name = "Vlan%s" % vlanid @@ -565,11 +604,12 @@ def parse_dpg(dpg, hname): aclname = aclintf.find(str(QName(ns, "OutAcl"))).text.upper().replace(" ", "_").replace("-", "_") stage = "egress" else: - system.exit("Error: 'AclInterface' must contain either an 'InAcl' or 'OutAcl' subelement.") + sys.exit("Error: 'AclInterface' must contain either an 'InAcl' or 'OutAcl' subelement.") aclattach = aclintf.find(str(QName(ns, "AttachTo"))).text.split(';') acl_intfs = [] is_mirror = False is_mirror_v6 = False + is_mirror_dscp = False # TODO: Ensure that acl_intfs will only ever contain front-panel interfaces (e.g., # maybe we should explicity ignore management and loopback interfaces?) because we @@ -582,14 +622,20 @@ def parse_dpg(dpg, hname): # to LAG will be applied to all the LAG members internally by SAI/SDK acl_intfs.append(member) elif member in vlans: - acl_intfs.append(member) + # For egress ACL attaching to vlan, we break them into vlan members + if stage == "egress": + acl_intfs.extend(vlans[member]['members']) + else: + acl_intfs.append(member) elif member in port_alias_map: acl_intfs.append(port_alias_map[member]) # Give a warning if trying to attach ACL to a LAG member interface, correct way is to attach ACL to the LAG interface if port_alias_map[member] in intfs_inpc: print("Warning: ACL " + aclname + " is attached to a LAG member interface " + port_alias_map[member] + ", instead of LAG interface", file=sys.stderr) - elif member.lower().startswith('erspan') or member.lower().startswith('egress_erspan'): - if member.lower().startswith('erspanv6') or member.lower().startswith('egress_erspanv6'): + elif member.lower().startswith('erspan') or member.lower().startswith('egress_erspan') or member.lower().startswith('erspan_dscp'): + if 'dscp' in member.lower(): + is_mirror_dscp = True + elif member.lower().startswith('erspanv6') or member.lower().startswith('egress_erspanv6'): is_mirror_v6 = True else: is_mirror = True @@ -605,14 +651,26 @@ def parse_dpg(dpg, hname): if panel_port not in intfs_inpc and panel_port not in acl_intfs: acl_intfs.append(panel_port) break - if acl_intfs: + # if acl is classified as mirror (erpsan) or acl interface + # are binded then do not classify as Control plane. + # For multi-asic platforms it's possible there is no + # interface are binded to everflow in host namespace. + if acl_intfs or is_mirror_v6 or is_mirror or is_mirror_dscp: + # Remove duplications + dedup_intfs = [] + for intf in acl_intfs: + if intf not in dedup_intfs: + dedup_intfs.append(intf) + acls[aclname] = {'policy_desc': aclname, 'stage': stage, - 'ports': acl_intfs} + 'ports': dedup_intfs} if is_mirror: acls[aclname]['type'] = 'MIRROR' elif is_mirror_v6: acls[aclname]['type'] = 'MIRRORV6' + elif is_mirror_dscp: + acls[aclname]['type'] = 'MIRROR_DSCP' else: acls[aclname]['type'] = 'L3V6' if 'v6' in aclname.lower() else 'L3' else: @@ -644,6 +702,13 @@ def parse_dpg(dpg, hname): "ecn_mode": "EcnDecapsulationMode", "dscp_mode": "DifferentiatedServicesCodePointMode", "ttl_mode": "TtlMode"} + + tunnel_qos_remap_table_key_to_mg_key_map = { + "decap_dscp_to_tc_map": "DecapDscpToTcMap", + "decap_tc_to_pg_map": "DecapTcToPgMap", + "encap_tc_to_queue_map": "EncapTcToQueueMap", + "encap_tc_to_dscp_map": "EncapTcToDscpMap"} + for mg_tunnel in mg_tunnels.findall(str(QName(ns, "TunnelInterface"))): tunnel_type = mg_tunnel.attrib["Type"] tunnel_name = mg_tunnel.attrib["Name"] @@ -656,8 +721,16 @@ def parse_dpg(dpg, hname): if mg_key in mg_tunnel.attrib: tunnelintfs[tunnel_type][tunnel_name][table_key] = mg_tunnel.attrib[mg_key] - return intfs, lo_intfs, mvrf, mgmt_intf, vlans, vlan_members, pcs, pc_members, acls, vni, tunnelintfs, dpg_ecmp_content - return None, None, None, None, None, None, None, None, None, None + tunnelintfs_qos_remap_config[tunnel_type][tunnel_name] = { + "tunnel_type": mg_tunnel.attrib["Type"].upper(), + } + + for table_key, mg_key in tunnel_qos_remap_table_key_to_mg_key_map.items(): + if mg_key in mg_tunnel.attrib: + tunnelintfs_qos_remap_config[tunnel_type][tunnel_name][table_key] = mg_tunnel.attrib[mg_key] + + return intfs, lo_intfs, mvrf, mgmt_intf, vlans, vlan_members, dhcp_relay_table, pcs, pc_members, acls, vni, tunnelintfs, dpg_ecmp_content, tunnelintfs_qos_remap_config + return None, None, None, None, None, None, None, None, None, None, None, None, None, None def parse_host_loopback(dpg, hname): for child in dpg: @@ -772,6 +845,7 @@ def parse_cpg(cpg, hname, local_devices=[]): def parse_meta(meta, hname): syslog_servers = [] dhcp_servers = [] + dhcpv6_servers = [] ntp_servers = [] tacacs_servers = [] mgmt_routes = [] @@ -780,6 +854,12 @@ def parse_meta(meta, hname): region = None cloudtype = None resource_type = None + downstream_subrole = None + kube_data = {} + redundancy_type = None + downstream_redundancy_types = None + qos_profile = None + device_metas = meta.find(str(QName(ns, "Devices"))) for device in device_metas.findall(str(QName(ns1, "DeviceMetadata"))): if device.find(str(QName(ns1, "Name"))).text.lower() == hname.lower(): @@ -808,8 +888,19 @@ def parse_meta(meta, hname): cloudtype = value elif name == "ResourceType": resource_type = value - return syslog_servers, dhcp_servers, ntp_servers, tacacs_servers, mgmt_routes, erspan_dst, deployment_id, region, cloudtype, resource_type - + elif name == "DownStreamSubRole": + downstream_subrole = value + elif name == "KubernetesEnabled": + kube_data["enable"] = value + elif name == "KubernetesServerIp": + kube_data["ip"] = value + elif name == "DownstreamRedundancyTypes": + downstream_redundancy_types = value + elif name == "RedundancyType": + redundancy_type = value + elif name == "SonicQosProfile": + qos_profile = value + return syslog_servers, dhcp_servers, dhcpv6_servers, ntp_servers, tacacs_servers, mgmt_routes, erspan_dst, deployment_id, region, cloudtype, resource_type, downstream_subrole, kube_data, downstream_redundancy_types, redundancy_type, qos_profile def parse_linkmeta(meta, hname): link = meta.find(str(QName(ns, "Link"))) @@ -833,6 +924,7 @@ def parse_linkmeta(meta, hname): has_peer_switch = False upper_tor_hostname = '' lower_tor_hostname = '' + auto_negotiation = None properties = linkmeta.find(str(QName(ns1, "Properties"))) for device_property in properties.findall(str(QName(ns1, "DeviceProperty"))): @@ -846,6 +938,8 @@ def parse_linkmeta(meta, hname): upper_tor_hostname = value elif name == "LowerTOR": lower_tor_hostname = value + elif name == "AutoNegotiation": + auto_negotiation = value linkmetas[port] = {} if fec_disabled: @@ -855,6 +949,8 @@ def parse_linkmeta(meta, hname): linkmetas[port]["PeerSwitch"] = lower_tor_hostname else: linkmetas[port]["PeerSwitch"] = upper_tor_hostname + if auto_negotiation: + linkmetas[port]["AutoNegotiation"] = auto_negotiation return linkmetas @@ -964,7 +1060,26 @@ def parse_spine_chassis_fe(results, vni, lo_intfs, phyport_intfs, pc_intfs, pc_m # ############################################################################### -def filter_acl_table_bindings(acls, neighbors, port_channels, sub_role): +def filter_acl_table_for_backend(acls, vlan_members): + filter_acls = {} + for acl_name, value in acls.items(): + if 'everflow' not in acl_name.lower(): + filter_acls[acl_name] = value + + ports = set() + for vlan, member in vlan_members: + ports.add(member) + filter_acls['DATAACL'] = { 'policy_desc': 'DATAACL', + 'stage': 'ingress', + 'type': 'L3', + 'ports': list(ports) + } + return filter_acls + +def filter_acl_table_bindings(acls, neighbors, port_channels, sub_role, device_type, is_storage_device, vlan_members): + if device_type == 'BackEndToRRouter' and is_storage_device: + return filter_acl_table_for_backend(acls, vlan_members) + filter_acls = {} # If the asic role is BackEnd no ACL Table (Ctrl/Data/Everflow) is binded. @@ -993,7 +1108,7 @@ def filter_acl_table_bindings(acls, neighbors, port_channels, sub_role): # Control Plane ACL has no Interface associated and # Data Plane ACL Interface are attached via minigraph # AclInterface. - if group_type != 'MIRROR' and group_type != 'MIRRORV6': + if group_type != 'MIRROR' and group_type != 'MIRRORV6' and group_type != 'MIRROR_DSCP': continue # Filters out back-panel ports from the binding list for Everflow (Mirror) @@ -1037,6 +1152,38 @@ def enable_internal_bgp_session(bgp_sessions, filename, asic_name): (local_sub_role == BACKEND_ASIC_SUB_ROLE and peer_sub_role == FRONTEND_ASIC_SUB_ROLE)): bgp_sessions[peer_ip].update({'admin_status': 'up'}) +def select_mmu_profiles(profile, platform, hwsku): + """ + Select MMU files based on the device metadata attribute - SonicQosProfile + if no QosProfile exists in the minigraph, then no action is needed. + if a profile exists in the minigraph, + - create a dir path to search 1 level down from the base path. + - if no such dir path exists, no action is needed. + - if a dir path exists, check for the presence of each file from + the copy list in the dir path and copy it over to the base path. + """ + if not profile: + return + + files_to_copy = ['pg_profile_lookup.ini', 'qos.json.j2', 'buffers_defaults_t0.j2', 'buffers_defaults_t1.j2'] + + if os.environ.get("CFGGEN_UNIT_TESTING", "0") == "2": + for dir_path, dir_name, files in os.walk('/sonic/device'): + if platform in dir_path: + new_path = os.path.split(dir_path)[0] + break + else: + new_path = '/usr/share/sonic/device' + path = os.path.join(new_path, platform, hwsku) + + dir_path = os.path.join(path, profile) + if os.path.exists(dir_path): + for file_item in files_to_copy: + file_in_dir = os.path.join(dir_path, file_item) + if os.path.isfile(file_in_dir): + base_file = os.path.join(path, file_item) + exec_cmd(["sudo", "cp", file_in_dir, base_file]) + ############################################################################### # # Main functions @@ -1067,8 +1214,10 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw vlan_intfs = None pc_intfs = None tunnel_intfs = None + tunnel_intfs_qos_remap_config = None vlans = None vlan_members = None + dhcp_relay_table = None pcs = None mgmt_intf = None lo_intfs = None @@ -1076,6 +1225,7 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw devices = None sub_role = None resource_type = None + downstream_subrole = None docker_routing_config_mode = "separated" port_speeds_default = {} port_speed_png = {} @@ -1084,6 +1234,7 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw mux_cable_ports = {} syslog_servers = [] dhcp_servers = [] + dhcpv6_servers = [] ntp_servers = [] tacacs_servers = [] mgmt_routes = [] @@ -1097,12 +1248,11 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw host_lo_intfs = None is_storage_device = False local_devices = [] - - # hostname is the asic_name, get the asic_id from the asic_name - if asic_name is not None: - asic_id = get_asic_id_from_name(asic_name) - else: - asic_id = None + kube_data = {} + system_defaults = {} + downstream_redundancy_types = None + redundancy_type = None + qos_profile = None hwsku_qn = QName(ns, "HwSku") hostname_qn = QName(ns, "Hostname") @@ -1115,7 +1265,7 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw if child.tag == str(docker_routing_config_mode_qn): docker_routing_config_mode = child.text - (ports, alias_map, alias_asic_map) = get_port_config(hwsku=hwsku, platform=platform, port_config_file=port_config_file, asic=asic_id, hwsku_config_file=hwsku_config_file) + (ports, alias_map, alias_asic_map) = get_port_config(hwsku=hwsku, platform=platform, port_config_file=port_config_file, asic_name=asic_name, hwsku_config_file=hwsku_config_file) port_alias_map.update(alias_map) port_alias_asic_map.update(alias_asic_map) @@ -1125,22 +1275,22 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw for child in root: if asic_name is None: if child.tag == str(QName(ns, "DpgDec")): - (intfs, lo_intfs, mvrf, mgmt_intf, vlans, vlan_members, pcs, pc_members, acls, vni, tunnel_intfs, dpg_ecmp_content) = parse_dpg(child, hostname) + (intfs, lo_intfs, mvrf, mgmt_intf, vlans, vlan_members, dhcp_relay_table, pcs, pc_members, acls, vni, tunnel_intfs, dpg_ecmp_content, tunnel_intfs_qos_remap_config) = parse_dpg(child, hostname) elif child.tag == str(QName(ns, "CpgDec")): (bgp_sessions, bgp_internal_sessions, bgp_asn, bgp_peers_with_range, bgp_monitors) = parse_cpg(child, hostname) elif child.tag == str(QName(ns, "PngDec")): - (neighbors, devices, console_dev, console_port, mgmt_dev, mgmt_port, port_speed_png, console_ports, mux_cable_ports, is_storage_device, png_ecmp_content) = parse_png(child, hostname, dpg_ecmp_content) + (neighbors, devices, console_dev, console_port, mgmt_dev, mgmt_port, port_speed_png, console_ports, mux_cable_ports, png_ecmp_content) = parse_png(child, hostname, dpg_ecmp_content) elif child.tag == str(QName(ns, "UngDec")): (u_neighbors, u_devices, _, _, _, _, _, _) = parse_png(child, hostname, None) elif child.tag == str(QName(ns, "MetadataDeclaration")): - (syslog_servers, dhcp_servers, ntp_servers, tacacs_servers, mgmt_routes, erspan_dst, deployment_id, region, cloudtype, resource_type) = parse_meta(child, hostname) + (syslog_servers, dhcp_servers, dhcpv6_servers, ntp_servers, tacacs_servers, mgmt_routes, erspan_dst, deployment_id, region, cloudtype, resource_type, downstream_subrole, kube_data, downstream_redundancy_types, redundancy_type, qos_profile) = parse_meta(child, hostname) elif child.tag == str(QName(ns, "LinkMetadataDeclaration")): linkmetas = parse_linkmeta(child, hostname) elif child.tag == str(QName(ns, "DeviceInfos")): (port_speeds_default, port_descriptions) = parse_deviceinfo(child, hwsku) else: if child.tag == str(QName(ns, "DpgDec")): - (intfs, lo_intfs, mvrf, mgmt_intf, vlans, vlan_members, pcs, pc_members, acls, vni, tunnel_intfs, dpg_ecmp_content) = parse_dpg(child, asic_name) + (intfs, lo_intfs, mvrf, mgmt_intf, vlans, vlan_members, dhcp_relay_table, pcs, pc_members, acls, vni, tunnel_intfs, dpg_ecmp_content, tunnel_intfs_qos_remap_config) = parse_dpg(child, asic_name) host_lo_intfs = parse_host_loopback(child, hostname) elif child.tag == str(QName(ns, "CpgDec")): (bgp_sessions, bgp_internal_sessions, bgp_asn, bgp_peers_with_range, bgp_monitors) = parse_cpg(child, asic_name, local_devices) @@ -1153,6 +1303,7 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw elif child.tag == str(QName(ns, "DeviceInfos")): (port_speeds_default, port_descriptions) = parse_deviceinfo(child, hwsku) + select_mmu_profiles(qos_profile, platform, hwsku) # set the host device type in asic metadata also device_type = [devices[key]['type'] for key in devices if key.lower() == hostname.lower()][0] if asic_name is None: @@ -1174,14 +1325,40 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw } } - results['PEER_SWITCH'] = get_peer_switch_info(linkmetas, devices) + cluster = [devices[key] for key in devices if key.lower() == hostname.lower()][0].get('cluster', "") + if cluster: + results['DEVICE_METADATA']['localhost']['cluster'] = cluster + + if kube_data: + results['KUBERNETES_MASTER'] = { + 'SERVER': { + 'disable': str(kube_data.get('enable', '0') == '0'), + 'ip': kube_data.get('ip', '') + } + } + + results['PEER_SWITCH'], mux_tunnel_name, peer_switch_ip = get_peer_switch_info(linkmetas, devices) if bool(results['PEER_SWITCH']): results['DEVICE_METADATA']['localhost']['subtype'] = 'DualToR' + if len(results['PEER_SWITCH'].keys()) > 1: + print("Warning: more than one peer switch was found. Only the first will be parsed: {}".format(results['PEER_SWITCH'].keys()[0])) - if is_storage_device: - results['DEVICE_METADATA']['localhost']['storage_device'] = "true" - + results['DEVICE_METADATA']['localhost']['peer_switch'] = list(results['PEER_SWITCH'].keys())[0] + + # Enable tunnel_qos_remap if downstream_redundancy_types(T1) or redundancy_type(T0) = Gemini/Libra + enable_tunnel_qos_map = False + if results['DEVICE_METADATA']['localhost']['type'].lower() == 'leafrouter' and ('gemini' in str(downstream_redundancy_types).lower() or 'libra' in str(downstream_redundancy_types).lower()): + enable_tunnel_qos_map = True + elif results['DEVICE_METADATA']['localhost']['type'].lower() == 'torrouter' and ('gemini' in str(redundancy_type).lower() or 'libra' in str(redundancy_type).lower()): + enable_tunnel_qos_map = True + + if enable_tunnel_qos_map: + system_defaults['tunnel_qos_remap'] = {"status": "enabled"} + + if len(system_defaults) > 0: + results['SYSTEM_DEFAULTS'] = system_defaults + # for this hostname, if sub_role is defined, add sub_role in # device_metadata if sub_role is not None: @@ -1192,6 +1369,9 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw if resource_type is not None: results['DEVICE_METADATA']['localhost']['resource_type'] = resource_type + if downstream_subrole is not None: + results['DEVICE_METADATA']['localhost']['downstream_subrole'] = downstream_subrole + results['BGP_NEIGHBOR'] = bgp_sessions results['BGP_MONITORS'] = bgp_monitors results['BGP_PEER_RANGE'] = bgp_peers_with_range @@ -1257,6 +1437,9 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw elif intf[0][0:11] == 'PortChannel': pc_intfs[intf] = {} pc_intfs[intf[0]] = {} + elif VLAN_SUB_INTERFACE_SEPARATOR in intf[0]: + vlan_sub_intfs[intf] = {} + vlan_sub_intfs[intf[0]] = {'admin_status': 'up'} else: phyport_intfs[intf] = {} phyport_intfs[intf[0]] = {} @@ -1279,16 +1462,27 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw print("Warning: ignore interface '%s' as it is not in the port_config.ini" % port_name, file=sys.stderr) continue + # skip management ports + if port_name in mgmt_alias_reverse_mapping.keys(): + continue + ports.setdefault(port_name, {})['speed'] = port_speed_png[port_name] for port_name, port in list(ports.items()): # get port alias from port_config.ini alias = port.get('alias', port_name) - # generate default 100G FEC + # generate default 100G FEC only if FECDisabled is not true and 'fec' is not defined in port_config.ini # Note: FECDisabled only be effective on 100G port right now - if port.get('speed') == '100000' and linkmetas.get(alias, {}).get('FECDisabled', '').lower() != 'true': + if linkmetas.get(alias, {}).get('FECDisabled', '').lower() == 'true': + port['fec'] = 'none' + elif not port.get('fec') and port.get('speed') == '100000': port['fec'] = 'rs' + # If AutoNegotiation is available in the minigraph, we override any value we may have received from port_config.ini + autoneg = linkmetas.get(alias, {}).get('AutoNegotiation') + if autoneg: + port['autoneg'] = '1' if autoneg.lower() == 'true' else '0' + # If connected to a smart cable, get the connection position for port_name, port in ports.items(): if port_name in mux_cable_ports: @@ -1324,6 +1518,13 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw if port[0] in ports: ports.get(port[0])['admin_status'] = 'up' + if len(vlan_sub_intfs): + for subintf in vlan_sub_intfs: + if not isinstance(subintf, tuple): + parent_port = subintf.split(".")[0] + if parent_port in ports: + ports.get(parent_port)['admin_status'] = 'up' + for member in list(pc_members.keys()) + list(vlan_members.keys()): port = ports.get(member[1]) if port: @@ -1363,9 +1564,19 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw results['PORTCHANNEL_INTERFACE'] = pc_intfs - if current_device['type'] in backend_device_types and is_storage_device: + # for storage backend subinterface info present in minigraph takes precedence over ResourceType + if current_device['type'] in backend_device_types and bool(vlan_sub_intfs): + del results['INTERFACE'] + del results['PORTCHANNEL_INTERFACE'] + is_storage_device = True + results['VLAN_SUB_INTERFACE'] = vlan_sub_intfs + # storage backend T0 have all vlan members tagged + for vlan in vlan_members: + vlan_members[vlan]["tagging_mode"] = "tagged" + elif current_device['type'] in backend_device_types and (resource_type is None or 'Storage' in resource_type): del results['INTERFACE'] del results['PORTCHANNEL_INTERFACE'] + is_storage_device = True for intf in phyport_intfs.keys(): if isinstance(intf, tuple): @@ -1386,13 +1597,26 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw else: sub_intf = pc_intf + VLAN_SUB_INTERFACE_SEPARATOR + VLAN_SUB_INTERFACE_VLAN_ID vlan_sub_intfs[sub_intf] = {"admin_status" : "up"} - results['VLAN_SUB_INTERFACE'] = vlan_sub_intfs + # storage backend T0 have all vlan members tagged + for vlan in vlan_members: + vlan_members[vlan]["tagging_mode"] = "tagged" + elif resource_type is not None and 'Storage' in resource_type: + is_storage_device = True + + if is_storage_device: + results['DEVICE_METADATA']['localhost']['storage_device'] = "true" + + # remove bgp monitor and slb peers for storage backend + if is_storage_device and 'BackEnd' in current_device['type']: + results['BGP_MONITORS'] = {} + results['BGP_PEER_RANGE'] = {} results['VLAN'] = vlans results['VLAN_MEMBER'] = vlan_members - results['TUNNEL'] = get_tunnel_entries(tunnel_intfs, lo_intfs, hostname) + # Add src_ip and qos remapping config into TUNNEL table if tunnel_qos_remap is enabled + results['TUNNEL'] = get_tunnel_entries(tunnel_intfs, tunnel_intfs_qos_remap_config, lo_intfs, system_defaults.get('tunnel_qos_remap', {}), mux_tunnel_name, peer_switch_ip) results['MUX_CABLE'] = get_mux_cable_entries(mux_cable_ports, neighbors, devices) @@ -1409,9 +1633,10 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw results['DEVICE_NEIGHBOR_METADATA'] = { key:devices[key] for key in devices if key in {device['name'] for device in neighbors.values()} } results['SYSLOG_SERVER'] = dict((item, {}) for item in syslog_servers) results['DHCP_SERVER'] = dict((item, {}) for item in dhcp_servers) + results['DHCP_RELAY'] = dhcp_relay_table results['NTP_SERVER'] = dict((item, {}) for item in ntp_servers) results['TACPLUS_SERVER'] = dict((item, {'priority': '1', 'tcp_port': '49'}) for item in tacacs_servers) - results['ACL_TABLE'] = filter_acl_table_bindings(acls, neighbors, pcs, sub_role) + results['ACL_TABLE'] = filter_acl_table_bindings(acls, neighbors, pcs, sub_role, current_device['type'], is_storage_device, vlan_members) results['FEATURE'] = { 'telemetry': { 'status': 'enabled' @@ -1433,7 +1658,7 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw 'config': { 'client_auth': 'true', 'allow_insecure': 'false', - 'log_level': 'trace' + 'log_level': 'info' }, 'certs': { 'server_crt': '/etc/sonic/credentials/restapiserver.crt', @@ -1445,7 +1670,6 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw if len(png_ecmp_content): results['FG_NHG_MEMBER'] = png_ecmp_content['FG_NHG_MEMBER'] - results['FG_NHG_PREFIX'] = png_ecmp_content['FG_NHG_PREFIX'] results['FG_NHG'] = png_ecmp_content['FG_NHG'] results['NEIGH'] = png_ecmp_content['NEIGH'] @@ -1475,9 +1699,13 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw } } + # Enable DHCP Server feature for specific device type + if current_device['type'] in dhcp_server_enabled_device_types: + results['DEVICE_METADATA']['localhost']['dhcp_server'] = 'enabled' + return results -def get_tunnel_entries(tunnel_intfs, lo_intfs, hostname): +def get_tunnel_entries(tunnel_intfs, tunnel_intfs_qos_remap_config, lo_intfs, tunnel_qos_remap, mux_tunnel_name, peer_switch_ip): lo_addr = '' # Use the first IPv4 loopback as the tunnel destination IP for addr in lo_intfs.keys(): @@ -1487,9 +1715,28 @@ def get_tunnel_entries(tunnel_intfs, lo_intfs, hostname): break tunnels = {} + + default_qos_map_for_mux_tunnel = { + "decap_dscp_to_tc_map": "[DSCP_TO_TC_MAP|AZURE_TUNNEL]", + "decap_tc_to_pg_map": "[TC_TO_PRIORITY_GROUP_MAP|AZURE_TUNNEL]", + "encap_tc_to_dscp_map": "[TC_TO_DSCP_MAP|AZURE_TUNNEL]", + "encap_tc_to_queue_map": "[TC_TO_QUEUE_MAP|AZURE_TUNNEL]" + } + for type, tunnel_dict in tunnel_intfs.items(): for tunnel_key, tunnel_attr in tunnel_dict.items(): tunnel_attr['dst_ip'] = lo_addr + if (tunnel_qos_remap.get('status') == 'enabled') and (mux_tunnel_name == tunnel_key) and (peer_switch_ip is not None): + tunnel_attr['src_ip'] = peer_switch_ip + # The DSCP mode must be pipe if remap is enabled + tunnel_attr['dscp_mode'] = "pipe" + if tunnel_key in tunnel_intfs_qos_remap_config[type]: + tunnel_attr.update(tunnel_intfs_qos_remap_config[type][tunnel_key].items()) + # Use default value if qos remap attribute is missing + for k, v in default_qos_map_for_mux_tunnel.items(): + if k not in tunnel_attr: + tunnel_attr[k] = v + tunnels[tunnel_key] = tunnel_attr return tunnels @@ -1501,16 +1748,26 @@ def get_mux_cable_entries(mux_cable_ports, neighbors, devices): entry = {} neighbor = neighbors[intf]['name'] entry['state'] = 'auto' - entry['server_ipv4'] = devices[neighbor]['lo_addr'] - if 'lo_addr_v6' in devices[neighbor]: - entry['server_ipv6'] = devices[neighbor]['lo_addr_v6'] - mux_cable_table[intf] = entry + + if devices[neighbor]['lo_addr'] is not None: + # Always force a /32 prefix for server IPv4 loopbacks + server_ipv4_lo_addr = devices[neighbor]['lo_addr'].split("/")[0] + server_ipv4_lo_prefix = ipaddress.ip_network(UNICODE_TYPE(server_ipv4_lo_addr)) + entry['server_ipv4'] = str(server_ipv4_lo_prefix) + + if 'lo_addr_v6' in devices[neighbor] and devices[neighbor]['lo_addr_v6'] is not None: + server_ipv6_lo_addr = devices[neighbor]['lo_addr_v6'].split('/')[0] + server_ipv6_lo_prefix = ipaddress.ip_network(UNICODE_TYPE(server_ipv6_lo_addr)) + entry['server_ipv6'] = str(server_ipv6_lo_prefix) + mux_cable_table[intf] = entry + else: + print("Warning: no server IPv4 loopback found for {}, skipping mux cable table entry".format(neighbor)) return mux_cable_table def parse_device_desc_xml(filename): root = ET.parse(filename).getroot() - (lo_prefix, lo_prefix_v6, mgmt_prefix, hostname, hwsku, d_type, _) = parse_device(root) + (lo_prefix, lo_prefix_v6, mgmt_prefix, mgmt_prefix_v6, hostname, hwsku, d_type, _, _) = parse_device(root) results = {} results['DEVICE_METADATA'] = {'localhost': { @@ -1522,10 +1779,18 @@ def parse_device_desc_xml(filename): if lo_prefix_v6: results['LOOPBACK_INTERFACE'] = {('lo_v6', lo_prefix_v6): {}} - mgmt_intf = {} - mgmtipn = ipaddress.ip_network(UNICODE_TYPE(mgmt_prefix), False) - gwaddr = ipaddress.ip_address((next(mgmtipn.hosts()))) - results['MGMT_INTERFACE'] = {('eth0', mgmt_prefix): {'gwaddr': gwaddr}} + results['MGMT_INTERFACE'] = {} + if mgmt_prefix: + mgmtipn = ipaddress.ip_network(UNICODE_TYPE(mgmt_prefix), False) + if mgmtipn != ipaddress.ip_network(u'0.0.0.0/0', False): + gwaddr = ipaddress.ip_address((next(mgmtipn.hosts()))) + results['MGMT_INTERFACE'].update({('eth0', mgmt_prefix): {'gwaddr': gwaddr}}) + + if mgmt_prefix_v6: + mgmtipn_v6 = ipaddress.ip_network(UNICODE_TYPE(mgmt_prefix_v6), False) + if mgmtipn != ipaddress.ip_network(u'::/0', False): + gwaddr_v6 = ipaddress.ip_address((next(mgmtipn_v6.hosts()))) + results['MGMT_INTERFACE'].update({('eth0', mgmt_prefix_v6): {'gwaddr': gwaddr_v6}}) return results diff --git a/src/sonic-config-engine/openconfig_acl.py b/src/sonic-config-engine/openconfig_acl.py index c49f79c70175..5939bce44d6a 100644 --- a/src/sonic-config-engine/openconfig_acl.py +++ b/src/sonic-config-engine/openconfig_acl.py @@ -5,21 +5,45 @@ # 1. Sync openconfig ACL yang models from https://github.com/openconfig/public/tree/master/release/models/acl # 2. Sync inet yang models which contain type dependencies for openconfig ACL yang models from https://github.com/YangModels/yang/tree/master/standard/ietf/RFC , and put them in the same folder with models from step 1. # 3. Install PyangBind: -# pip install pyangbind +# pip3 install pyangbind # 4. Get PyangBind install path: -# export PYBINDPLUGIN=`/usr/bin/env python -c \ +# export PYBINDPLUGIN=`/usr/bin/env python3 -c \ # 'import pyangbind; import os; print "%s/plugin" % os.path.dirname(pyangbind.__file__)'` -# 5. Generate this file with pyang: -# pyang --plugindir $PYBINDPLUGIN -f pybind -o openconfig_acl.py openconfig-acl.yang +# 5. Generate this file with pyang: +# pyang --plugindir $PYBINDPLUGIN -f pybind -o openconfig_acl.py openconfig-acl.yang sonic-acl-extension.yang +# -*- coding: utf-8 -*- from operator import attrgetter -from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType -from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType +from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType +from pyangbind.lib.yangtypes import RestrictedClassType +from pyangbind.lib.yangtypes import TypedListType +from pyangbind.lib.yangtypes import YANGBool +from pyangbind.lib.yangtypes import YANGListType +from pyangbind.lib.yangtypes import YANGDynClass +from pyangbind.lib.yangtypes import ReferenceType from pyangbind.lib.base import PybindBase +from collections import OrderedDict from decimal import Decimal from bitarray import bitarray +import six -import builtins +# PY3 support of some PY2 keywords (needs improved) +if six.PY3: + import builtins as __builtin__ + long = int +elif six.PY2: + import __builtin__ + +class sonic_acl_extension(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module sonic-acl-extension - based on the path /sonic-acl-extension. Each member element of + the container is represented as a class variable - with a specific + YANG type. + """ + _pyangbind_elements = {} + + class yc_state_openconfig_acl__acl_state(PybindBase): """ @@ -30,14 +54,18 @@ class yc_state_openconfig_acl__acl_state(PybindBase): YANG Description: Global operational state data for ACLs """ - __slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_extmethods', '__counter_capability',) + __slots__ = ('_path_helper', '_extmethods', '__counter_capability',) + + _yang_name = 'state' + + _pybind_generated_by = 'container' def __init__(self, *args, **kwargs): - self._yang_name = 'state' - self._pybind_generated_by = 'container' + self._path_helper = False + self._extmethods = False - self.__counter_capability = YANGDynClass(base=RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'oc-acl:AGGREGATE_ONLY': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'oc-acl:INTERFACE_AGGREGATE': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'AGGREGATE_ONLY': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'INTERFACE_AGGREGATE': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'INTERFACE_ONLY': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'oc-acl:INTERFACE_ONLY': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}},), is_leaf=True, yang_name="counter-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=False) + self.__counter_capability = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'oc-acl:AGGREGATE_ONLY': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'oc-acl:INTERFACE_AGGREGATE': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'AGGREGATE_ONLY': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'INTERFACE_AGGREGATE': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'INTERFACE_ONLY': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'oc-acl:INTERFACE_ONLY': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}},), is_leaf=True, yang_name="counter-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=False) load = kwargs.pop("load", None) if args: @@ -64,7 +92,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return ['acl', 'state'] + return [u'acl', u'state'] def _get_counter_capability(self): """ @@ -89,12 +117,12 @@ def _set_counter_capability(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'oc-acl:AGGREGATE_ONLY': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'oc-acl:INTERFACE_AGGREGATE': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'AGGREGATE_ONLY': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'INTERFACE_AGGREGATE': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'INTERFACE_ONLY': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'oc-acl:INTERFACE_ONLY': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}},), is_leaf=True, yang_name="counter-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=False) + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'oc-acl:AGGREGATE_ONLY': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'oc-acl:INTERFACE_AGGREGATE': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'AGGREGATE_ONLY': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'INTERFACE_AGGREGATE': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'INTERFACE_ONLY': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'oc-acl:INTERFACE_ONLY': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}},), is_leaf=True, yang_name="counter-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """counter_capability must be of a type compatible with identityref""", 'defined-type': "openconfig-acl:identityref", - 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'oc-acl:AGGREGATE_ONLY': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'oc-acl:INTERFACE_AGGREGATE': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'AGGREGATE_ONLY': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'INTERFACE_AGGREGATE': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'INTERFACE_ONLY': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'oc-acl:INTERFACE_ONLY': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}},), is_leaf=True, yang_name="counter-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=False)""", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'oc-acl:AGGREGATE_ONLY': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'oc-acl:INTERFACE_AGGREGATE': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'AGGREGATE_ONLY': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'INTERFACE_AGGREGATE': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'INTERFACE_ONLY': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'oc-acl:INTERFACE_ONLY': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}},), is_leaf=True, yang_name="counter-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=False)""", }) self.__counter_capability = t @@ -102,12 +130,12 @@ def _set_counter_capability(self, v, load=False): self._set() def _unset_counter_capability(self): - self.__counter_capability = YANGDynClass(base=RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'oc-acl:AGGREGATE_ONLY': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'oc-acl:INTERFACE_AGGREGATE': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'AGGREGATE_ONLY': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'INTERFACE_AGGREGATE': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'INTERFACE_ONLY': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'oc-acl:INTERFACE_ONLY': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}},), is_leaf=True, yang_name="counter-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=False) + self.__counter_capability = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'oc-acl:AGGREGATE_ONLY': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'oc-acl:INTERFACE_AGGREGATE': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'AGGREGATE_ONLY': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'INTERFACE_AGGREGATE': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'INTERFACE_ONLY': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'oc-acl:INTERFACE_ONLY': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}},), is_leaf=True, yang_name="counter-capability", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=False) - counter_capability = builtins.property(_get_counter_capability) + counter_capability = __builtin__.property(_get_counter_capability) - _pyangbind_elements = {'counter_capability': counter_capability, } + _pyangbind_elements = OrderedDict([('counter_capability', counter_capability), ]) class yc_config_openconfig_acl__acl_acl_sets_acl_set_config(PybindBase): @@ -119,15 +147,19 @@ class yc_config_openconfig_acl__acl_acl_sets_acl_set_config(PybindBase): YANG Description: Access list config """ - __slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_extmethods', '__name','__description',) + __slots__ = ('_path_helper', '_extmethods', '__name','__description',) + + _yang_name = 'config' + + _pybind_generated_by = 'container' def __init__(self, *args, **kwargs): - self._yang_name = 'config' - self._pybind_generated_by = 'container' + self._path_helper = False + self._extmethods = False - self.__name = YANGDynClass(base=str, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=True) - self.__description = YANGDynClass(base=str, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=True) + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=True) + self.__description = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=True) load = kwargs.pop("load", None) if args: @@ -154,7 +186,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return ['acl', 'acl-sets', 'acl-set', 'config'] + return [u'acl', u'acl-sets', u'acl-set', u'config'] def _get_name(self): """ @@ -177,12 +209,12 @@ def _set_name(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=str, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=True) + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """name must be of a type compatible with string""", 'defined-type': "string", - 'generated-type': """YANGDynClass(base=unicode, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=True)""", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=True)""", }) self.__name = t @@ -190,7 +222,7 @@ def _set_name(self, v, load=False): self._set() def _unset_name(self): - self.__name = YANGDynClass(base=str, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=True) + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=True) def _get_description(self): @@ -214,12 +246,12 @@ def _set_description(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=str, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=True) + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """description must be of a type compatible with string""", 'defined-type': "string", - 'generated-type': """YANGDynClass(base=unicode, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=True)""", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=True)""", }) self.__description = t @@ -227,13 +259,13 @@ def _set_description(self, v, load=False): self._set() def _unset_description(self): - self.__description = YANGDynClass(base=str, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=True) + self.__description = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=True) - name = builtins.property(_get_name, _set_name) - description = builtins.property(_get_description, _set_description) + name = __builtin__.property(_get_name, _set_name) + description = __builtin__.property(_get_description, _set_description) - _pyangbind_elements = {'name': name, 'description': description, } + _pyangbind_elements = OrderedDict([('name', name), ('description', description), ]) class yc_state_openconfig_acl__acl_acl_sets_acl_set_state(PybindBase): @@ -245,15 +277,19 @@ class yc_state_openconfig_acl__acl_acl_sets_acl_set_state(PybindBase): YANG Description: Access list state information """ - __slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_extmethods', '__name','__description',) + __slots__ = ('_path_helper', '_extmethods', '__name','__description',) + + _yang_name = 'state' + + _pybind_generated_by = 'container' def __init__(self, *args, **kwargs): - self._yang_name = 'state' - self._pybind_generated_by = 'container' + self._path_helper = False + self._extmethods = False - self.__name = YANGDynClass(base=str, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=False) - self.__description = YANGDynClass(base=str, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=False) + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=False) + self.__description = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=False) load = kwargs.pop("load", None) if args: @@ -280,7 +316,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return ['acl', 'acl-sets', 'acl-set', 'state'] + return [u'acl', u'acl-sets', u'acl-set', u'state'] def _get_name(self): """ @@ -303,12 +339,12 @@ def _set_name(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=str, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=False) + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """name must be of a type compatible with string""", 'defined-type': "string", - 'generated-type': """YANGDynClass(base=unicode, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=False)""", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=False)""", }) self.__name = t @@ -316,7 +352,7 @@ def _set_name(self, v, load=False): self._set() def _unset_name(self): - self.__name = YANGDynClass(base=str, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=False) + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=False) def _get_description(self): @@ -340,12 +376,12 @@ def _set_description(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=str, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=False) + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """description must be of a type compatible with string""", 'defined-type': "string", - 'generated-type': """YANGDynClass(base=unicode, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=False)""", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=False)""", }) self.__description = t @@ -353,13 +389,13 @@ def _set_description(self, v, load=False): self._set() def _unset_description(self): - self.__description = YANGDynClass(base=str, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=False) + self.__description = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=False) - name = builtins.property(_get_name) - description = builtins.property(_get_description) + name = __builtin__.property(_get_name) + description = __builtin__.property(_get_description) - _pyangbind_elements = {'name': name, 'description': description, } + _pyangbind_elements = OrderedDict([('name', name), ('description', description), ]) class yc_config_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_config(PybindBase): @@ -371,15 +407,19 @@ class yc_config_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_confi YANG Description: Access list entries config """ - __slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_extmethods', '__sequence_id','__description',) + __slots__ = ('_path_helper', '_extmethods', '__sequence_id','__description',) + + _yang_name = 'config' + + _pybind_generated_by = 'container' def __init__(self, *args, **kwargs): - self._yang_name = 'config' - self._pybind_generated_by = 'container' + self._path_helper = False + self._extmethods = False - self.__sequence_id = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='uint32', is_config=True) - self.__description = YANGDynClass(base=str, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=True) + self.__sequence_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='uint32', is_config=True) + self.__description = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=True) load = kwargs.pop("load", None) if args: @@ -406,7 +446,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return ['acl', 'acl-sets', 'acl-set', 'acl-entries', 'acl-entry', 'config'] + return [u'acl', u'acl-sets', u'acl-set', u'acl-entries', u'acl-entry', u'config'] def _get_sequence_id(self): """ @@ -437,7 +477,7 @@ def _set_sequence_id(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='uint32', is_config=True) + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='uint32', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """sequence_id must be of a type compatible with uint32""", @@ -450,7 +490,7 @@ def _set_sequence_id(self, v, load=False): self._set() def _unset_sequence_id(self): - self.__sequence_id = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='uint32', is_config=True) + self.__sequence_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='uint32', is_config=True) def _get_description(self): @@ -476,12 +516,12 @@ def _set_description(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=str, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=True) + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """description must be of a type compatible with string""", 'defined-type': "string", - 'generated-type': """YANGDynClass(base=unicode, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=True)""", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=True)""", }) self.__description = t @@ -489,13 +529,13 @@ def _set_description(self, v, load=False): self._set() def _unset_description(self): - self.__description = YANGDynClass(base=str, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=True) + self.__description = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=True) - sequence_id = builtins.property(_get_sequence_id, _set_sequence_id) - description = builtins.property(_get_description, _set_description) + sequence_id = __builtin__.property(_get_sequence_id, _set_sequence_id) + description = __builtin__.property(_get_description, _set_description) - _pyangbind_elements = {'sequence_id': sequence_id, 'description': description, } + _pyangbind_elements = OrderedDict([('sequence_id', sequence_id), ('description', description), ]) class yc_state_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_state(PybindBase): @@ -507,17 +547,21 @@ class yc_state_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_state( YANG Description: State information for ACL entries """ - __slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_extmethods', '__sequence_id','__description','__matched_packets','__matched_octets',) + __slots__ = ('_path_helper', '_extmethods', '__sequence_id','__description','__matched_packets','__matched_octets',) + + _yang_name = 'state' + + _pybind_generated_by = 'container' def __init__(self, *args, **kwargs): - self._yang_name = 'state' - self._pybind_generated_by = 'container' + self._path_helper = False + self._extmethods = False - self.__matched_octets = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="matched-octets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:counter64', is_config=False) - self.__sequence_id = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='uint32', is_config=False) - self.__description = YANGDynClass(base=str, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=False) - self.__matched_packets = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="matched-packets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:counter64', is_config=False) + self.__matched_octets = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="matched-octets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:counter64', is_config=False) + self.__sequence_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='uint32', is_config=False) + self.__description = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=False) + self.__matched_packets = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="matched-packets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:counter64', is_config=False) load = kwargs.pop("load", None) if args: @@ -544,7 +588,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return ['acl', 'acl-sets', 'acl-set', 'acl-entries', 'acl-entry', 'state'] + return [u'acl', u'acl-sets', u'acl-set', u'acl-entries', u'acl-entry', u'state'] def _get_sequence_id(self): """ @@ -575,7 +619,7 @@ def _set_sequence_id(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='uint32', is_config=False) + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='uint32', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """sequence_id must be of a type compatible with uint32""", @@ -588,7 +632,7 @@ def _set_sequence_id(self, v, load=False): self._set() def _unset_sequence_id(self): - self.__sequence_id = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='uint32', is_config=False) + self.__sequence_id = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='uint32', is_config=False) def _get_description(self): @@ -614,12 +658,12 @@ def _set_description(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=str, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=False) + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """description must be of a type compatible with string""", 'defined-type': "string", - 'generated-type': """YANGDynClass(base=unicode, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=False)""", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=False)""", }) self.__description = t @@ -627,7 +671,7 @@ def _set_description(self, v, load=False): self._set() def _unset_description(self): - self.__description = YANGDynClass(base=str, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=False) + self.__description = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="description", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='string', is_config=False) def _get_matched_packets(self): @@ -677,7 +721,7 @@ def _set_matched_packets(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="matched-packets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:counter64', is_config=False) + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="matched-packets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:counter64', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """matched_packets must be of a type compatible with yang:counter64""", @@ -690,7 +734,7 @@ def _set_matched_packets(self, v, load=False): self._set() def _unset_matched_packets(self): - self.__matched_packets = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="matched-packets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:counter64', is_config=False) + self.__matched_packets = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="matched-packets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:counter64', is_config=False) def _get_matched_octets(self): @@ -740,7 +784,7 @@ def _set_matched_octets(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="matched-octets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:counter64', is_config=False) + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="matched-octets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:counter64', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """matched_octets must be of a type compatible with yang:counter64""", @@ -753,15 +797,15 @@ def _set_matched_octets(self, v, load=False): self._set() def _unset_matched_octets(self): - self.__matched_octets = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="matched-octets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:counter64', is_config=False) + self.__matched_octets = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="matched-octets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:counter64', is_config=False) - sequence_id = builtins.property(_get_sequence_id) - description = builtins.property(_get_description) - matched_packets = builtins.property(_get_matched_packets) - matched_octets = builtins.property(_get_matched_octets) + sequence_id = __builtin__.property(_get_sequence_id) + description = __builtin__.property(_get_description) + matched_packets = __builtin__.property(_get_matched_packets) + matched_octets = __builtin__.property(_get_matched_octets) - _pyangbind_elements = {'sequence_id': sequence_id, 'description': description, 'matched_packets': matched_packets, 'matched_octets': matched_octets, } + _pyangbind_elements = OrderedDict([('sequence_id', sequence_id), ('description', description), ('matched_packets', matched_packets), ('matched_octets', matched_octets), ]) class yc_config_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_l2_config(PybindBase): @@ -773,18 +817,23 @@ class yc_config_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_l2_co YANG Description: Configuration data """ - __slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_extmethods', '__source_mac','__source_mac_mask','__destination_mac','__destination_mac_mask','__ethertype',) + __slots__ = ('_path_helper', '_extmethods', '__source_mac','__source_mac_mask','__destination_mac','__destination_mac_mask','__ethertype','__vlan_id',) + + _yang_name = 'config' + + _pybind_generated_by = 'container' def __init__(self, *args, **kwargs): - self._yang_name = 'config' - self._pybind_generated_by = 'container' + self._path_helper = False + self._extmethods = False - self.__source_mac = YANGDynClass(base=RestrictedClassType(base_type=str, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="source-mac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=True) - self.__destination_mac = YANGDynClass(base=RestrictedClassType(base_type=str, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="destination-mac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=True) - self.__destination_mac_mask = YANGDynClass(base=RestrictedClassType(base_type=str, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="destination-mac-mask", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=True) - self.__ethertype = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..65535']}),RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'oc-pkt-match-types:ETHERTYPE_LLDP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:ETHERTYPE_VLAN': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_ROCE': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:ETHERTYPE_ARP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_IPV4': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_IPV6': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_ARP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:ETHERTYPE_MPLS': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_VLAN': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:ETHERTYPE_ROCE': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:ETHERTYPE_IPV6': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_MPLS': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:ETHERTYPE_IPV4': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_LLDP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}},),], is_leaf=True, yang_name="ethertype", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:ethertype-type', is_config=True) - self.__source_mac_mask = YANGDynClass(base=RestrictedClassType(base_type=str, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="source-mac-mask", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=True) + self.__ethertype = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={u'range': [u'1..65535']}),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'oc-pkt-match-types:ETHERTYPE_LLDP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_VLAN': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_ROCE': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_ARP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_IPV4': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_IPV6': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_ARP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_MPLS': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_VLAN': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_ROCE': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_IPV6': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_MPLS': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_IPV4': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_LLDP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}},),], is_leaf=True, yang_name="ethertype", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:ethertype-type', is_config=True) + self.__destination_mac_mask = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="destination-mac-mask", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=True) + self.__source_mac = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="source-mac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=True) + self.__source_mac_mask = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="source-mac-mask", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=True) + self.__vlan_id = YANGDynClass(base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'null'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={u'range': [u'1..4095']}),], is_leaf=True, yang_name="vlan-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='https://github.com/Azure/sonic-buildimage', defining_module='sonic-acl-extension', yang_type='vlan-id-type', is_config=True) + self.__destination_mac = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="destination-mac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=True) load = kwargs.pop("load", None) if args: @@ -811,7 +860,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return ['acl', 'acl-sets', 'acl-set', 'acl-entries', 'acl-entry', 'l2', 'config'] + return [u'acl', u'acl-sets', u'acl-set', u'acl-entries', u'acl-entry', u'l2', u'config'] def _get_source_mac(self): """ @@ -834,12 +883,12 @@ def _set_source_mac(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=RestrictedClassType(base_type=str, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="source-mac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=True) + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="source-mac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """source_mac must be of a type compatible with yang:mac-address""", 'defined-type': "yang:mac-address", - 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="source-mac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=True)""", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="source-mac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=True)""", }) self.__source_mac = t @@ -847,7 +896,7 @@ def _set_source_mac(self, v, load=False): self._set() def _unset_source_mac(self): - self.__source_mac = YANGDynClass(base=RestrictedClassType(base_type=str, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="source-mac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=True) + self.__source_mac = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="source-mac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=True) def _get_source_mac_mask(self): @@ -871,12 +920,12 @@ def _set_source_mac_mask(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=RestrictedClassType(base_type=str, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="source-mac-mask", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=True) + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="source-mac-mask", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """source_mac_mask must be of a type compatible with yang:mac-address""", 'defined-type': "yang:mac-address", - 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="source-mac-mask", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=True)""", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="source-mac-mask", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=True)""", }) self.__source_mac_mask = t @@ -884,7 +933,7 @@ def _set_source_mac_mask(self, v, load=False): self._set() def _unset_source_mac_mask(self): - self.__source_mac_mask = YANGDynClass(base=RestrictedClassType(base_type=str, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="source-mac-mask", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=True) + self.__source_mac_mask = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="source-mac-mask", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=True) def _get_destination_mac(self): @@ -908,12 +957,12 @@ def _set_destination_mac(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=RestrictedClassType(base_type=str, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="destination-mac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=True) + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="destination-mac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """destination_mac must be of a type compatible with yang:mac-address""", 'defined-type': "yang:mac-address", - 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="destination-mac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=True)""", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="destination-mac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=True)""", }) self.__destination_mac = t @@ -921,7 +970,7 @@ def _set_destination_mac(self, v, load=False): self._set() def _unset_destination_mac(self): - self.__destination_mac = YANGDynClass(base=RestrictedClassType(base_type=str, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="destination-mac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=True) + self.__destination_mac = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="destination-mac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=True) def _get_destination_mac_mask(self): @@ -945,12 +994,12 @@ def _set_destination_mac_mask(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=RestrictedClassType(base_type=str, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="destination-mac-mask", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=True) + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="destination-mac-mask", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """destination_mac_mask must be of a type compatible with yang:mac-address""", 'defined-type': "yang:mac-address", - 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="destination-mac-mask", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=True)""", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="destination-mac-mask", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=True)""", }) self.__destination_mac_mask = t @@ -958,7 +1007,7 @@ def _set_destination_mac_mask(self, v, load=False): self._set() def _unset_destination_mac_mask(self): - self.__destination_mac_mask = YANGDynClass(base=RestrictedClassType(base_type=str, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="destination-mac-mask", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=True) + self.__destination_mac_mask = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="destination-mac-mask", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=True) def _get_ethertype(self): @@ -982,12 +1031,12 @@ def _set_ethertype(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=[RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..65535']}),RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'oc-pkt-match-types:ETHERTYPE_LLDP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:ETHERTYPE_VLAN': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_ROCE': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:ETHERTYPE_ARP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_IPV4': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_IPV6': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_ARP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:ETHERTYPE_MPLS': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_VLAN': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:ETHERTYPE_ROCE': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:ETHERTYPE_IPV6': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_MPLS': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:ETHERTYPE_IPV4': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_LLDP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}},),], is_leaf=True, yang_name="ethertype", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:ethertype-type', is_config=True) + t = YANGDynClass(v,base=[RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={u'range': [u'1..65535']}),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'oc-pkt-match-types:ETHERTYPE_LLDP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_VLAN': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_ROCE': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_ARP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_IPV4': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_IPV6': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_ARP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_MPLS': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_VLAN': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_ROCE': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_IPV6': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_MPLS': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_IPV4': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_LLDP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}},),], is_leaf=True, yang_name="ethertype", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:ethertype-type', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """ethertype must be of a type compatible with oc-pkt-match-types:ethertype-type""", 'defined-type': "oc-pkt-match-types:ethertype-type", - 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': [u'1..65535']}),RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'oc-pkt-match-types:ETHERTYPE_LLDP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_VLAN': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_ROCE': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_ARP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_IPV4': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_IPV6': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_ARP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_MPLS': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_VLAN': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_ROCE': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_IPV6': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_MPLS': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_IPV4': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_LLDP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}},),], is_leaf=True, yang_name="ethertype", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:ethertype-type', is_config=True)""", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={u'range': [u'1..65535']}),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'oc-pkt-match-types:ETHERTYPE_LLDP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_VLAN': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_ROCE': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_ARP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_IPV4': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_IPV6': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_ARP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_MPLS': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_VLAN': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_ROCE': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_IPV6': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_MPLS': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_IPV4': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_LLDP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}},),], is_leaf=True, yang_name="ethertype", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:ethertype-type', is_config=True)""", }) self.__ethertype = t @@ -995,16 +1044,54 @@ def _set_ethertype(self, v, load=False): self._set() def _unset_ethertype(self): - self.__ethertype = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..65535']}),RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'oc-pkt-match-types:ETHERTYPE_LLDP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:ETHERTYPE_VLAN': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_ROCE': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:ETHERTYPE_ARP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_IPV4': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_IPV6': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_ARP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:ETHERTYPE_MPLS': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_VLAN': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:ETHERTYPE_ROCE': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:ETHERTYPE_IPV6': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_MPLS': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:ETHERTYPE_IPV4': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_LLDP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}},),], is_leaf=True, yang_name="ethertype", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:ethertype-type', is_config=True) + self.__ethertype = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={u'range': [u'1..65535']}),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'oc-pkt-match-types:ETHERTYPE_LLDP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_VLAN': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_ROCE': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_ARP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_IPV4': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_IPV6': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_ARP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_MPLS': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_VLAN': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_ROCE': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_IPV6': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_MPLS': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_IPV4': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_LLDP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}},),], is_leaf=True, yang_name="ethertype", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:ethertype-type', is_config=True) + + + def _get_vlan_id(self): + """ + Getter method for vlan_id, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/l2/config/vlan_id (vlan-id-type) + + YANG Description: VLAN ID field to match in DOT1Q packets + """ + return self.__vlan_id + + def _set_vlan_id(self, v, load=False): + """ + Setter method for vlan_id, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/l2/config/vlan_id (vlan-id-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_vlan_id is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_vlan_id() directly. + + YANG Description: VLAN ID field to match in DOT1Q packets + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'null'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={u'range': [u'1..4095']}),], is_leaf=True, yang_name="vlan-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='https://github.com/Azure/sonic-buildimage', defining_module='sonic-acl-extension', yang_type='vlan-id-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """vlan_id must be of a type compatible with vlan-id-type""", + 'defined-type': "sonic-acl-extension:vlan-id-type", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'null'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={u'range': [u'1..4095']}),], is_leaf=True, yang_name="vlan-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='https://github.com/Azure/sonic-buildimage', defining_module='sonic-acl-extension', yang_type='vlan-id-type', is_config=True)""", + }) + + self.__vlan_id = t + if hasattr(self, '_set'): + self._set() + + def _unset_vlan_id(self): + self.__vlan_id = YANGDynClass(base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'null'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={u'range': [u'1..4095']}),], is_leaf=True, yang_name="vlan-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='https://github.com/Azure/sonic-buildimage', defining_module='sonic-acl-extension', yang_type='vlan-id-type', is_config=True) - source_mac = builtins.property(_get_source_mac, _set_source_mac) - source_mac_mask = builtins.property(_get_source_mac_mask, _set_source_mac_mask) - destination_mac = builtins.property(_get_destination_mac, _set_destination_mac) - destination_mac_mask = builtins.property(_get_destination_mac_mask, _set_destination_mac_mask) - ethertype = builtins.property(_get_ethertype, _set_ethertype) + source_mac = __builtin__.property(_get_source_mac, _set_source_mac) + source_mac_mask = __builtin__.property(_get_source_mac_mask, _set_source_mac_mask) + destination_mac = __builtin__.property(_get_destination_mac, _set_destination_mac) + destination_mac_mask = __builtin__.property(_get_destination_mac_mask, _set_destination_mac_mask) + ethertype = __builtin__.property(_get_ethertype, _set_ethertype) + vlan_id = __builtin__.property(_get_vlan_id, _set_vlan_id) - _pyangbind_elements = {'source_mac': source_mac, 'source_mac_mask': source_mac_mask, 'destination_mac': destination_mac, 'destination_mac_mask': destination_mac_mask, 'ethertype': ethertype, } + _pyangbind_elements = OrderedDict([('source_mac', source_mac), ('source_mac_mask', source_mac_mask), ('destination_mac', destination_mac), ('destination_mac_mask', destination_mac_mask), ('ethertype', ethertype), ('vlan_id', vlan_id), ]) class yc_state_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_l2_state(PybindBase): @@ -1016,18 +1103,22 @@ class yc_state_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_l2_sta YANG Description: State Information. """ - __slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_extmethods', '__source_mac','__source_mac_mask','__destination_mac','__destination_mac_mask','__ethertype',) + __slots__ = ('_path_helper', '_extmethods', '__source_mac','__source_mac_mask','__destination_mac','__destination_mac_mask','__ethertype',) + + _yang_name = 'state' + + _pybind_generated_by = 'container' def __init__(self, *args, **kwargs): - self._yang_name = 'state' - self._pybind_generated_by = 'container' + self._path_helper = False + self._extmethods = False - self.__source_mac = YANGDynClass(base=RestrictedClassType(base_type=str, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="source-mac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=False) - self.__destination_mac = YANGDynClass(base=RestrictedClassType(base_type=str, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="destination-mac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=False) - self.__destination_mac_mask = YANGDynClass(base=RestrictedClassType(base_type=str, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="destination-mac-mask", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=False) - self.__ethertype = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..65535']}),RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'oc-pkt-match-types:ETHERTYPE_LLDP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:ETHERTYPE_VLAN': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_ROCE': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:ETHERTYPE_ARP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_IPV4': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_IPV6': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_ARP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:ETHERTYPE_MPLS': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_VLAN': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:ETHERTYPE_ROCE': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:ETHERTYPE_IPV6': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_MPLS': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:ETHERTYPE_IPV4': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_LLDP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}},),], is_leaf=True, yang_name="ethertype", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:ethertype-type', is_config=False) - self.__source_mac_mask = YANGDynClass(base=RestrictedClassType(base_type=str, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="source-mac-mask", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=False) + self.__source_mac = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="source-mac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=False) + self.__destination_mac = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="destination-mac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=False) + self.__destination_mac_mask = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="destination-mac-mask", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=False) + self.__ethertype = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={u'range': [u'1..65535']}),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'oc-pkt-match-types:ETHERTYPE_LLDP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_VLAN': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_ROCE': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_ARP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_IPV4': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_IPV6': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_ARP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_MPLS': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_VLAN': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_ROCE': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_IPV6': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_MPLS': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_IPV4': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_LLDP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}},),], is_leaf=True, yang_name="ethertype", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:ethertype-type', is_config=False) + self.__source_mac_mask = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="source-mac-mask", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=False) load = kwargs.pop("load", None) if args: @@ -1054,7 +1145,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return ['acl', 'acl-sets', 'acl-set', 'acl-entries', 'acl-entry', 'l2', 'state'] + return [u'acl', u'acl-sets', u'acl-set', u'acl-entries', u'acl-entry', u'l2', u'state'] def _get_source_mac(self): """ @@ -1077,12 +1168,12 @@ def _set_source_mac(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=RestrictedClassType(base_type=str, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="source-mac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=False) + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="source-mac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """source_mac must be of a type compatible with yang:mac-address""", 'defined-type': "yang:mac-address", - 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="source-mac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=False)""", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="source-mac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=False)""", }) self.__source_mac = t @@ -1090,7 +1181,7 @@ def _set_source_mac(self, v, load=False): self._set() def _unset_source_mac(self): - self.__source_mac = YANGDynClass(base=RestrictedClassType(base_type=str, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="source-mac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=False) + self.__source_mac = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="source-mac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=False) def _get_source_mac_mask(self): @@ -1114,12 +1205,12 @@ def _set_source_mac_mask(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=RestrictedClassType(base_type=str, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="source-mac-mask", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=False) + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="source-mac-mask", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """source_mac_mask must be of a type compatible with yang:mac-address""", 'defined-type': "yang:mac-address", - 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="source-mac-mask", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=False)""", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="source-mac-mask", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=False)""", }) self.__source_mac_mask = t @@ -1127,7 +1218,7 @@ def _set_source_mac_mask(self, v, load=False): self._set() def _unset_source_mac_mask(self): - self.__source_mac_mask = YANGDynClass(base=RestrictedClassType(base_type=str, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="source-mac-mask", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=False) + self.__source_mac_mask = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="source-mac-mask", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=False) def _get_destination_mac(self): @@ -1151,12 +1242,12 @@ def _set_destination_mac(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=RestrictedClassType(base_type=str, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="destination-mac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=False) + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="destination-mac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """destination_mac must be of a type compatible with yang:mac-address""", 'defined-type': "yang:mac-address", - 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="destination-mac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=False)""", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="destination-mac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=False)""", }) self.__destination_mac = t @@ -1164,7 +1255,7 @@ def _set_destination_mac(self, v, load=False): self._set() def _unset_destination_mac(self): - self.__destination_mac = YANGDynClass(base=RestrictedClassType(base_type=str, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="destination-mac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=False) + self.__destination_mac = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="destination-mac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=False) def _get_destination_mac_mask(self): @@ -1188,12 +1279,12 @@ def _set_destination_mac_mask(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=RestrictedClassType(base_type=str, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="destination-mac-mask", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=False) + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="destination-mac-mask", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """destination_mac_mask must be of a type compatible with yang:mac-address""", 'defined-type': "yang:mac-address", - 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="destination-mac-mask", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=False)""", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="destination-mac-mask", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=False)""", }) self.__destination_mac_mask = t @@ -1201,7 +1292,7 @@ def _set_destination_mac_mask(self, v, load=False): self._set() def _unset_destination_mac_mask(self): - self.__destination_mac_mask = YANGDynClass(base=RestrictedClassType(base_type=str, restriction_dict={'pattern': '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="destination-mac-mask", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=False) + self.__destination_mac_mask = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}'}), is_leaf=True, yang_name="destination-mac-mask", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:mac-address', is_config=False) def _get_ethertype(self): @@ -1225,12 +1316,12 @@ def _set_ethertype(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=[RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..65535']}),RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'oc-pkt-match-types:ETHERTYPE_LLDP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:ETHERTYPE_VLAN': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_ROCE': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:ETHERTYPE_ARP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_IPV4': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_IPV6': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_ARP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:ETHERTYPE_MPLS': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_VLAN': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:ETHERTYPE_ROCE': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:ETHERTYPE_IPV6': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_MPLS': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:ETHERTYPE_IPV4': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_LLDP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}},),], is_leaf=True, yang_name="ethertype", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:ethertype-type', is_config=False) + t = YANGDynClass(v,base=[RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={u'range': [u'1..65535']}),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'oc-pkt-match-types:ETHERTYPE_LLDP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_VLAN': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_ROCE': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_ARP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_IPV4': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_IPV6': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_ARP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_MPLS': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_VLAN': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_ROCE': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_IPV6': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_MPLS': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_IPV4': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_LLDP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}},),], is_leaf=True, yang_name="ethertype", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:ethertype-type', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """ethertype must be of a type compatible with oc-pkt-match-types:ethertype-type""", 'defined-type': "oc-pkt-match-types:ethertype-type", - 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': [u'1..65535']}),RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'oc-pkt-match-types:ETHERTYPE_LLDP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_VLAN': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_ROCE': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_ARP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_IPV4': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_IPV6': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_ARP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_MPLS': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_VLAN': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_ROCE': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_IPV6': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_MPLS': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_IPV4': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_LLDP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}},),], is_leaf=True, yang_name="ethertype", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:ethertype-type', is_config=False)""", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={u'range': [u'1..65535']}),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'oc-pkt-match-types:ETHERTYPE_LLDP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_VLAN': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_ROCE': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_ARP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_IPV4': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_IPV6': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_ARP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_MPLS': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_VLAN': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_ROCE': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_IPV6': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_MPLS': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_IPV4': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_LLDP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}},),], is_leaf=True, yang_name="ethertype", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:ethertype-type', is_config=False)""", }) self.__ethertype = t @@ -1238,16 +1329,16 @@ def _set_ethertype(self, v, load=False): self._set() def _unset_ethertype(self): - self.__ethertype = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['1..65535']}),RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'oc-pkt-match-types:ETHERTYPE_LLDP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:ETHERTYPE_VLAN': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_ROCE': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:ETHERTYPE_ARP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_IPV4': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_IPV6': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_ARP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:ETHERTYPE_MPLS': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_VLAN': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:ETHERTYPE_ROCE': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:ETHERTYPE_IPV6': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_MPLS': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:ETHERTYPE_IPV4': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'ETHERTYPE_LLDP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}},),], is_leaf=True, yang_name="ethertype", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:ethertype-type', is_config=False) + self.__ethertype = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={u'range': [u'1..65535']}),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'oc-pkt-match-types:ETHERTYPE_LLDP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_VLAN': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_ROCE': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_ARP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_IPV4': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_IPV6': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_ARP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_MPLS': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_VLAN': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_ROCE': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_IPV6': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_MPLS': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:ETHERTYPE_IPV4': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'ETHERTYPE_LLDP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}},),], is_leaf=True, yang_name="ethertype", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:ethertype-type', is_config=False) - source_mac = builtins.property(_get_source_mac) - source_mac_mask = builtins.property(_get_source_mac_mask) - destination_mac = builtins.property(_get_destination_mac) - destination_mac_mask = builtins.property(_get_destination_mac_mask) - ethertype = builtins.property(_get_ethertype) + source_mac = __builtin__.property(_get_source_mac) + source_mac_mask = __builtin__.property(_get_source_mac_mask) + destination_mac = __builtin__.property(_get_destination_mac) + destination_mac_mask = __builtin__.property(_get_destination_mac_mask) + ethertype = __builtin__.property(_get_ethertype) - _pyangbind_elements = {'source_mac': source_mac, 'source_mac_mask': source_mac_mask, 'destination_mac': destination_mac, 'destination_mac_mask': destination_mac_mask, 'ethertype': ethertype, } + _pyangbind_elements = OrderedDict([('source_mac', source_mac), ('source_mac_mask', source_mac_mask), ('destination_mac', destination_mac), ('destination_mac_mask', destination_mac_mask), ('ethertype', ethertype), ]) class yc_l2_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_l2(PybindBase): @@ -1259,12 +1350,16 @@ class yc_l2_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_l2(Pybind YANG Description: Ethernet header fields """ - __slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_extmethods', '__config','__state',) + __slots__ = ('_path_helper', '_extmethods', '__config','__state',) + + _yang_name = 'l2' + + _pybind_generated_by = 'container' def __init__(self, *args, **kwargs): - self._yang_name = 'l2' - self._pybind_generated_by = 'container' + self._path_helper = False + self._extmethods = False self.__state = YANGDynClass(base=yc_state_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_l2_state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) self.__config = YANGDynClass(base=yc_config_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_l2_config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) @@ -1294,7 +1389,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return ['acl', 'acl-sets', 'acl-set', 'acl-entries', 'acl-entry', 'l2'] + return [u'acl', u'acl-sets', u'acl-set', u'acl-entries', u'acl-entry', u'l2'] def _get_config(self): """ @@ -1369,11 +1464,11 @@ def _set_state(self, v, load=False): def _unset_state(self): self.__state = YANGDynClass(base=yc_state_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_l2_state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) - config = builtins.property(_get_config, _set_config) - state = builtins.property(_get_state, _set_state) + config = __builtin__.property(_get_config, _set_config) + state = __builtin__.property(_get_state, _set_state) - _pyangbind_elements = {'config': config, 'state': state, } + _pyangbind_elements = OrderedDict([('config', config), ('state', state), ]) class yc_config_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_ip_config(PybindBase): @@ -1385,21 +1480,25 @@ class yc_config_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_ip_co YANG Description: Configuration data """ - __slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_extmethods', '__ip_version','__source_ip_address','__source_ip_flow_label','__destination_ip_address','__destination_ip_flow_label','__dscp','__protocol','__hop_limit',) + __slots__ = ('_path_helper', '_extmethods', '__ip_version','__source_ip_address','__source_ip_flow_label','__destination_ip_address','__destination_ip_flow_label','__dscp','__protocol','__hop_limit',) + + _yang_name = 'config' + + _pybind_generated_by = 'container' def __init__(self, *args, **kwargs): - self._yang_name = 'config' - self._pybind_generated_by = 'container' + self._path_helper = False + self._extmethods = False - self.__hop_limit = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..255']}), is_leaf=True, yang_name="hop-limit", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='uint8', is_config=True) - self.__protocol = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..254']}),RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'oc-pkt-match-types:IP_TCP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_L2TP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_L2TP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_AUTH': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_RSVP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_GRE': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_TCP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_AUTH': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_UDP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_PIM': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_GRE': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_IGMP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_RSVP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_ICMP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_PIM': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_UDP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_IGMP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_ICMP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}},),], is_leaf=True, yang_name="protocol", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:ip-protocol-type', is_config=True) - self.__dscp = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..63']}), is_leaf=True, yang_name="dscp", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:dscp', is_config=True) - self.__source_ip_address = YANGDynClass(base=[RestrictedClassType(base_type=str, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))'}),RestrictedClassType(base_type=str, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))'}),], is_leaf=True, yang_name="source-ip-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-prefix', is_config=True) - self.__destination_ip_address = YANGDynClass(base=[RestrictedClassType(base_type=str, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))'}),RestrictedClassType(base_type=str, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))'}),], is_leaf=True, yang_name="destination-ip-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-prefix', is_config=True) - self.__ip_version = YANGDynClass(base=RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'unknown': {'value': 0}, 'ipv4': {'value': 1}, 'ipv6': {'value': 2}},), is_leaf=True, yang_name="ip-version", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-version', is_config=True) - self.__destination_ip_flow_label = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': ['0..1048575']}), is_leaf=True, yang_name="destination-ip-flow-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ipv6-flow-label', is_config=True) - self.__source_ip_flow_label = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': ['0..1048575']}), is_leaf=True, yang_name="source-ip-flow-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ipv6-flow-label', is_config=True) + self.__hop_limit = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={u'range': [u'0..255']}), is_leaf=True, yang_name="hop-limit", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='uint8', is_config=True) + self.__protocol = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={u'range': [u'0..254']}),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'oc-pkt-match-types:IP_TCP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'IP_L2TP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_L2TP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'IP_AUTH': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'IP_RSVP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'IP_GRE': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'IP_TCP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_AUTH': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'IP_UDP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'IP_PIM': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_GRE': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'IP_IGMP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_RSVP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_ICMP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_PIM': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_UDP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_IGMP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'IP_ICMP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}},),], is_leaf=True, yang_name="protocol", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:ip-protocol-type', is_config=True) + self.__dscp = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={u'range': [u'0..63']}), is_leaf=True, yang_name="dscp", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:dscp', is_config=True) + self.__source_ip_address = YANGDynClass(base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))'}),RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))'}),], is_leaf=True, yang_name="source-ip-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-prefix', is_config=True) + self.__destination_ip_address = YANGDynClass(base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))'}),RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))'}),], is_leaf=True, yang_name="destination-ip-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-prefix', is_config=True) + self.__ip_version = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'unknown': {u'value': 0}, u'ipv4': {u'value': 1}, u'ipv6': {u'value': 2}},), is_leaf=True, yang_name="ip-version", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-version', is_config=True) + self.__destination_ip_flow_label = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={u'range': [u'0..1048575']}), is_leaf=True, yang_name="destination-ip-flow-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ipv6-flow-label', is_config=True) + self.__source_ip_flow_label = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={u'range': [u'0..1048575']}), is_leaf=True, yang_name="source-ip-flow-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ipv6-flow-label', is_config=True) load = kwargs.pop("load", None) if args: @@ -1426,7 +1525,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return ['acl', 'acl-sets', 'acl-set', 'acl-entries', 'acl-entry', 'ip', 'config'] + return [u'acl', u'acl-sets', u'acl-set', u'acl-entries', u'acl-entry', u'ip', u'config'] def _get_ip_version(self): """ @@ -1449,12 +1548,12 @@ def _set_ip_version(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'unknown': {'value': 0}, 'ipv4': {'value': 1}, 'ipv6': {'value': 2}},), is_leaf=True, yang_name="ip-version", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-version', is_config=True) + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'unknown': {u'value': 0}, u'ipv4': {u'value': 1}, u'ipv6': {u'value': 2}},), is_leaf=True, yang_name="ip-version", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-version', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """ip_version must be of a type compatible with inet:ip-version""", 'defined-type': "inet:ip-version", - 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'unknown': {'value': 0}, u'ipv4': {'value': 1}, u'ipv6': {'value': 2}},), is_leaf=True, yang_name="ip-version", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-version', is_config=True)""", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'unknown': {u'value': 0}, u'ipv4': {u'value': 1}, u'ipv6': {u'value': 2}},), is_leaf=True, yang_name="ip-version", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-version', is_config=True)""", }) self.__ip_version = t @@ -1462,7 +1561,7 @@ def _set_ip_version(self, v, load=False): self._set() def _unset_ip_version(self): - self.__ip_version = YANGDynClass(base=RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'unknown': {'value': 0}, 'ipv4': {'value': 1}, 'ipv6': {'value': 2}},), is_leaf=True, yang_name="ip-version", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-version', is_config=True) + self.__ip_version = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'unknown': {u'value': 0}, u'ipv4': {u'value': 1}, u'ipv6': {u'value': 2}},), is_leaf=True, yang_name="ip-version", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-version', is_config=True) def _get_source_ip_address(self): @@ -1486,12 +1585,12 @@ def _set_source_ip_address(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=[RestrictedClassType(base_type=str, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))'}),RestrictedClassType(base_type=str, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))'}),], is_leaf=True, yang_name="source-ip-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-prefix', is_config=True) + t = YANGDynClass(v,base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))'}),RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))'}),], is_leaf=True, yang_name="source-ip-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-prefix', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """source_ip_address must be of a type compatible with inet:ip-prefix""", 'defined-type': "inet:ip-prefix", - 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))'}),RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))'}),], is_leaf=True, yang_name="source-ip-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-prefix', is_config=True)""", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))'}),RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))'}),], is_leaf=True, yang_name="source-ip-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-prefix', is_config=True)""", }) self.__source_ip_address = t @@ -1499,7 +1598,7 @@ def _set_source_ip_address(self, v, load=False): self._set() def _unset_source_ip_address(self): - self.__source_ip_address = YANGDynClass(base=[RestrictedClassType(base_type=str, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))'}),RestrictedClassType(base_type=str, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))'}),], is_leaf=True, yang_name="source-ip-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-prefix', is_config=True) + self.__source_ip_address = YANGDynClass(base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))'}),RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))'}),], is_leaf=True, yang_name="source-ip-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-prefix', is_config=True) def _get_source_ip_flow_label(self): @@ -1523,12 +1622,12 @@ def _set_source_ip_flow_label(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': ['0..1048575']}), is_leaf=True, yang_name="source-ip-flow-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ipv6-flow-label', is_config=True) + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={u'range': [u'0..1048575']}), is_leaf=True, yang_name="source-ip-flow-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ipv6-flow-label', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """source_ip_flow_label must be of a type compatible with inet:ipv6-flow-label""", 'defined-type': "inet:ipv6-flow-label", - 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'0..1048575']}), is_leaf=True, yang_name="source-ip-flow-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ipv6-flow-label', is_config=True)""", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={u'range': [u'0..1048575']}), is_leaf=True, yang_name="source-ip-flow-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ipv6-flow-label', is_config=True)""", }) self.__source_ip_flow_label = t @@ -1536,7 +1635,7 @@ def _set_source_ip_flow_label(self, v, load=False): self._set() def _unset_source_ip_flow_label(self): - self.__source_ip_flow_label = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': ['0..1048575']}), is_leaf=True, yang_name="source-ip-flow-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ipv6-flow-label', is_config=True) + self.__source_ip_flow_label = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={u'range': [u'0..1048575']}), is_leaf=True, yang_name="source-ip-flow-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ipv6-flow-label', is_config=True) def _get_destination_ip_address(self): @@ -1560,12 +1659,12 @@ def _set_destination_ip_address(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=[RestrictedClassType(base_type=str, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))'}),RestrictedClassType(base_type=str, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))'}),], is_leaf=True, yang_name="destination-ip-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-prefix', is_config=True) + t = YANGDynClass(v,base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))'}),RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))'}),], is_leaf=True, yang_name="destination-ip-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-prefix', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """destination_ip_address must be of a type compatible with inet:ip-prefix""", 'defined-type': "inet:ip-prefix", - 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))'}),RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))'}),], is_leaf=True, yang_name="destination-ip-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-prefix', is_config=True)""", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))'}),RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))'}),], is_leaf=True, yang_name="destination-ip-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-prefix', is_config=True)""", }) self.__destination_ip_address = t @@ -1573,7 +1672,7 @@ def _set_destination_ip_address(self, v, load=False): self._set() def _unset_destination_ip_address(self): - self.__destination_ip_address = YANGDynClass(base=[RestrictedClassType(base_type=str, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))'}),RestrictedClassType(base_type=str, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))'}),], is_leaf=True, yang_name="destination-ip-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-prefix', is_config=True) + self.__destination_ip_address = YANGDynClass(base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))'}),RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))'}),], is_leaf=True, yang_name="destination-ip-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-prefix', is_config=True) def _get_destination_ip_flow_label(self): @@ -1597,12 +1696,12 @@ def _set_destination_ip_flow_label(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': ['0..1048575']}), is_leaf=True, yang_name="destination-ip-flow-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ipv6-flow-label', is_config=True) + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={u'range': [u'0..1048575']}), is_leaf=True, yang_name="destination-ip-flow-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ipv6-flow-label', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """destination_ip_flow_label must be of a type compatible with inet:ipv6-flow-label""", 'defined-type': "inet:ipv6-flow-label", - 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'0..1048575']}), is_leaf=True, yang_name="destination-ip-flow-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ipv6-flow-label', is_config=True)""", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={u'range': [u'0..1048575']}), is_leaf=True, yang_name="destination-ip-flow-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ipv6-flow-label', is_config=True)""", }) self.__destination_ip_flow_label = t @@ -1610,7 +1709,7 @@ def _set_destination_ip_flow_label(self, v, load=False): self._set() def _unset_destination_ip_flow_label(self): - self.__destination_ip_flow_label = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': ['0..1048575']}), is_leaf=True, yang_name="destination-ip-flow-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ipv6-flow-label', is_config=True) + self.__destination_ip_flow_label = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={u'range': [u'0..1048575']}), is_leaf=True, yang_name="destination-ip-flow-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ipv6-flow-label', is_config=True) def _get_dscp(self): @@ -1634,12 +1733,12 @@ def _set_dscp(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..63']}), is_leaf=True, yang_name="dscp", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:dscp', is_config=True) + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={u'range': [u'0..63']}), is_leaf=True, yang_name="dscp", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:dscp', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """dscp must be of a type compatible with inet:dscp""", 'defined-type': "inet:dscp", - 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': [u'0..63']}), is_leaf=True, yang_name="dscp", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:dscp', is_config=True)""", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={u'range': [u'0..63']}), is_leaf=True, yang_name="dscp", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:dscp', is_config=True)""", }) self.__dscp = t @@ -1647,7 +1746,7 @@ def _set_dscp(self, v, load=False): self._set() def _unset_dscp(self): - self.__dscp = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..63']}), is_leaf=True, yang_name="dscp", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:dscp', is_config=True) + self.__dscp = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={u'range': [u'0..63']}), is_leaf=True, yang_name="dscp", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:dscp', is_config=True) def _get_protocol(self): @@ -1671,12 +1770,12 @@ def _set_protocol(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=[RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..254']}),RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'oc-pkt-match-types:IP_TCP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_L2TP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_L2TP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_AUTH': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_RSVP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_GRE': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_TCP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_AUTH': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_UDP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_PIM': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_GRE': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_IGMP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_RSVP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_ICMP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_PIM': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_UDP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_IGMP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_ICMP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}},),], is_leaf=True, yang_name="protocol", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:ip-protocol-type', is_config=True) + t = YANGDynClass(v,base=[RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={u'range': [u'0..254']}),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'oc-pkt-match-types:IP_TCP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'IP_L2TP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_L2TP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'IP_AUTH': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'IP_RSVP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'IP_GRE': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'IP_TCP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_AUTH': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'IP_UDP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'IP_PIM': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_GRE': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'IP_IGMP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_RSVP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_ICMP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_PIM': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_UDP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_IGMP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'IP_ICMP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}},),], is_leaf=True, yang_name="protocol", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:ip-protocol-type', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """protocol must be of a type compatible with oc-pkt-match-types:ip-protocol-type""", 'defined-type': "oc-pkt-match-types:ip-protocol-type", - 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': [u'0..254']}),RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'oc-pkt-match-types:IP_TCP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'IP_L2TP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_L2TP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'IP_AUTH': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'IP_RSVP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'IP_GRE': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'IP_TCP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_AUTH': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'IP_UDP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'IP_PIM': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_GRE': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'IP_IGMP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_RSVP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_ICMP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_PIM': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_UDP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_IGMP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'IP_ICMP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}},),], is_leaf=True, yang_name="protocol", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:ip-protocol-type', is_config=True)""", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={u'range': [u'0..254']}),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'oc-pkt-match-types:IP_TCP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'IP_L2TP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_L2TP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'IP_AUTH': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'IP_RSVP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'IP_GRE': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'IP_TCP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_AUTH': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'IP_UDP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'IP_PIM': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_GRE': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'IP_IGMP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_RSVP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_ICMP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_PIM': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_UDP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_IGMP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'IP_ICMP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}},),], is_leaf=True, yang_name="protocol", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:ip-protocol-type', is_config=True)""", }) self.__protocol = t @@ -1684,7 +1783,7 @@ def _set_protocol(self, v, load=False): self._set() def _unset_protocol(self): - self.__protocol = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..254']}),RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'oc-pkt-match-types:IP_TCP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_L2TP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_L2TP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_AUTH': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_RSVP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_GRE': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_TCP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_AUTH': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_UDP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_PIM': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_GRE': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_IGMP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_RSVP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_ICMP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_PIM': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_UDP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_IGMP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_ICMP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}},),], is_leaf=True, yang_name="protocol", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:ip-protocol-type', is_config=True) + self.__protocol = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={u'range': [u'0..254']}),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'oc-pkt-match-types:IP_TCP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'IP_L2TP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_L2TP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'IP_AUTH': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'IP_RSVP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'IP_GRE': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'IP_TCP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_AUTH': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'IP_UDP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'IP_PIM': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_GRE': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'IP_IGMP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_RSVP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_ICMP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_PIM': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_UDP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_IGMP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'IP_ICMP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}},),], is_leaf=True, yang_name="protocol", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:ip-protocol-type', is_config=True) def _get_hop_limit(self): @@ -1710,12 +1809,12 @@ def _set_hop_limit(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..255']}), is_leaf=True, yang_name="hop-limit", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='uint8', is_config=True) + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={u'range': [u'0..255']}), is_leaf=True, yang_name="hop-limit", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='uint8', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """hop_limit must be of a type compatible with uint8""", 'defined-type': "uint8", - 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': [u'0..255']}), is_leaf=True, yang_name="hop-limit", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='uint8', is_config=True)""", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={u'range': [u'0..255']}), is_leaf=True, yang_name="hop-limit", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='uint8', is_config=True)""", }) self.__hop_limit = t @@ -1723,19 +1822,19 @@ def _set_hop_limit(self, v, load=False): self._set() def _unset_hop_limit(self): - self.__hop_limit = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..255']}), is_leaf=True, yang_name="hop-limit", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='uint8', is_config=True) + self.__hop_limit = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={u'range': [u'0..255']}), is_leaf=True, yang_name="hop-limit", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='uint8', is_config=True) - ip_version = builtins.property(_get_ip_version, _set_ip_version) - source_ip_address = builtins.property(_get_source_ip_address, _set_source_ip_address) - source_ip_flow_label = builtins.property(_get_source_ip_flow_label, _set_source_ip_flow_label) - destination_ip_address = builtins.property(_get_destination_ip_address, _set_destination_ip_address) - destination_ip_flow_label = builtins.property(_get_destination_ip_flow_label, _set_destination_ip_flow_label) - dscp = builtins.property(_get_dscp, _set_dscp) - protocol = builtins.property(_get_protocol, _set_protocol) - hop_limit = builtins.property(_get_hop_limit, _set_hop_limit) + ip_version = __builtin__.property(_get_ip_version, _set_ip_version) + source_ip_address = __builtin__.property(_get_source_ip_address, _set_source_ip_address) + source_ip_flow_label = __builtin__.property(_get_source_ip_flow_label, _set_source_ip_flow_label) + destination_ip_address = __builtin__.property(_get_destination_ip_address, _set_destination_ip_address) + destination_ip_flow_label = __builtin__.property(_get_destination_ip_flow_label, _set_destination_ip_flow_label) + dscp = __builtin__.property(_get_dscp, _set_dscp) + protocol = __builtin__.property(_get_protocol, _set_protocol) + hop_limit = __builtin__.property(_get_hop_limit, _set_hop_limit) - _pyangbind_elements = {'ip_version': ip_version, 'source_ip_address': source_ip_address, 'source_ip_flow_label': source_ip_flow_label, 'destination_ip_address': destination_ip_address, 'destination_ip_flow_label': destination_ip_flow_label, 'dscp': dscp, 'protocol': protocol, 'hop_limit': hop_limit, } + _pyangbind_elements = OrderedDict([('ip_version', ip_version), ('source_ip_address', source_ip_address), ('source_ip_flow_label', source_ip_flow_label), ('destination_ip_address', destination_ip_address), ('destination_ip_flow_label', destination_ip_flow_label), ('dscp', dscp), ('protocol', protocol), ('hop_limit', hop_limit), ]) class yc_state_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_ip_state(PybindBase): @@ -1747,21 +1846,25 @@ class yc_state_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_ip_sta YANG Description: State information """ - __slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_extmethods', '__ip_version','__source_ip_address','__source_ip_flow_label','__destination_ip_address','__destination_ip_flow_label','__dscp','__protocol','__hop_limit',) + __slots__ = ('_path_helper', '_extmethods', '__ip_version','__source_ip_address','__source_ip_flow_label','__destination_ip_address','__destination_ip_flow_label','__dscp','__protocol','__hop_limit',) + + _yang_name = 'state' + + _pybind_generated_by = 'container' def __init__(self, *args, **kwargs): - self._yang_name = 'state' - self._pybind_generated_by = 'container' + self._path_helper = False + self._extmethods = False - self.__hop_limit = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..255']}), is_leaf=True, yang_name="hop-limit", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='uint8', is_config=False) - self.__protocol = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..254']}),RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'oc-pkt-match-types:IP_TCP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_L2TP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_L2TP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_AUTH': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_RSVP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_GRE': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_TCP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_AUTH': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_UDP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_PIM': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_GRE': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_IGMP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_RSVP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_ICMP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_PIM': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_UDP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_IGMP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_ICMP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}},),], is_leaf=True, yang_name="protocol", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:ip-protocol-type', is_config=False) - self.__dscp = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..63']}), is_leaf=True, yang_name="dscp", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:dscp', is_config=False) - self.__source_ip_address = YANGDynClass(base=[RestrictedClassType(base_type=str, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))'}),RestrictedClassType(base_type=str, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))'}),], is_leaf=True, yang_name="source-ip-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-prefix', is_config=False) - self.__destination_ip_address = YANGDynClass(base=[RestrictedClassType(base_type=str, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))'}),RestrictedClassType(base_type=str, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))'}),], is_leaf=True, yang_name="destination-ip-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-prefix', is_config=False) - self.__ip_version = YANGDynClass(base=RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'unknown': {'value': 0}, 'ipv4': {'value': 1}, 'ipv6': {'value': 2}},), is_leaf=True, yang_name="ip-version", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-version', is_config=False) - self.__destination_ip_flow_label = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': ['0..1048575']}), is_leaf=True, yang_name="destination-ip-flow-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ipv6-flow-label', is_config=False) - self.__source_ip_flow_label = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': ['0..1048575']}), is_leaf=True, yang_name="source-ip-flow-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ipv6-flow-label', is_config=False) + self.__hop_limit = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={u'range': [u'0..255']}), is_leaf=True, yang_name="hop-limit", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='uint8', is_config=False) + self.__protocol = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={u'range': [u'0..254']}),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'oc-pkt-match-types:IP_TCP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'IP_L2TP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_L2TP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'IP_AUTH': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'IP_RSVP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'IP_GRE': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'IP_TCP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_AUTH': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'IP_UDP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'IP_PIM': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_GRE': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'IP_IGMP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_RSVP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_ICMP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_PIM': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_UDP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_IGMP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'IP_ICMP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}},),], is_leaf=True, yang_name="protocol", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:ip-protocol-type', is_config=False) + self.__dscp = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={u'range': [u'0..63']}), is_leaf=True, yang_name="dscp", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:dscp', is_config=False) + self.__source_ip_address = YANGDynClass(base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))'}),RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))'}),], is_leaf=True, yang_name="source-ip-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-prefix', is_config=False) + self.__destination_ip_address = YANGDynClass(base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))'}),RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))'}),], is_leaf=True, yang_name="destination-ip-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-prefix', is_config=False) + self.__ip_version = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'unknown': {u'value': 0}, u'ipv4': {u'value': 1}, u'ipv6': {u'value': 2}},), is_leaf=True, yang_name="ip-version", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-version', is_config=False) + self.__destination_ip_flow_label = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={u'range': [u'0..1048575']}), is_leaf=True, yang_name="destination-ip-flow-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ipv6-flow-label', is_config=False) + self.__source_ip_flow_label = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={u'range': [u'0..1048575']}), is_leaf=True, yang_name="source-ip-flow-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ipv6-flow-label', is_config=False) load = kwargs.pop("load", None) if args: @@ -1788,7 +1891,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return ['acl', 'acl-sets', 'acl-set', 'acl-entries', 'acl-entry', 'ip', 'state'] + return [u'acl', u'acl-sets', u'acl-set', u'acl-entries', u'acl-entry', u'ip', u'state'] def _get_ip_version(self): """ @@ -1811,12 +1914,12 @@ def _set_ip_version(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'unknown': {'value': 0}, 'ipv4': {'value': 1}, 'ipv6': {'value': 2}},), is_leaf=True, yang_name="ip-version", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-version', is_config=False) + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'unknown': {u'value': 0}, u'ipv4': {u'value': 1}, u'ipv6': {u'value': 2}},), is_leaf=True, yang_name="ip-version", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-version', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """ip_version must be of a type compatible with inet:ip-version""", 'defined-type': "inet:ip-version", - 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'unknown': {'value': 0}, u'ipv4': {'value': 1}, u'ipv6': {'value': 2}},), is_leaf=True, yang_name="ip-version", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-version', is_config=False)""", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'unknown': {u'value': 0}, u'ipv4': {u'value': 1}, u'ipv6': {u'value': 2}},), is_leaf=True, yang_name="ip-version", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-version', is_config=False)""", }) self.__ip_version = t @@ -1824,7 +1927,7 @@ def _set_ip_version(self, v, load=False): self._set() def _unset_ip_version(self): - self.__ip_version = YANGDynClass(base=RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'unknown': {'value': 0}, 'ipv4': {'value': 1}, 'ipv6': {'value': 2}},), is_leaf=True, yang_name="ip-version", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-version', is_config=False) + self.__ip_version = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'unknown': {u'value': 0}, u'ipv4': {u'value': 1}, u'ipv6': {u'value': 2}},), is_leaf=True, yang_name="ip-version", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-version', is_config=False) def _get_source_ip_address(self): @@ -1848,12 +1951,12 @@ def _set_source_ip_address(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=[RestrictedClassType(base_type=str, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))'}),RestrictedClassType(base_type=str, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))'}),], is_leaf=True, yang_name="source-ip-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-prefix', is_config=False) + t = YANGDynClass(v,base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))'}),RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))'}),], is_leaf=True, yang_name="source-ip-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-prefix', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """source_ip_address must be of a type compatible with inet:ip-prefix""", 'defined-type': "inet:ip-prefix", - 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))'}),RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))'}),], is_leaf=True, yang_name="source-ip-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-prefix', is_config=False)""", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))'}),RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))'}),], is_leaf=True, yang_name="source-ip-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-prefix', is_config=False)""", }) self.__source_ip_address = t @@ -1861,7 +1964,7 @@ def _set_source_ip_address(self, v, load=False): self._set() def _unset_source_ip_address(self): - self.__source_ip_address = YANGDynClass(base=[RestrictedClassType(base_type=str, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))'}),RestrictedClassType(base_type=str, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))'}),], is_leaf=True, yang_name="source-ip-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-prefix', is_config=False) + self.__source_ip_address = YANGDynClass(base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))'}),RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))'}),], is_leaf=True, yang_name="source-ip-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-prefix', is_config=False) def _get_source_ip_flow_label(self): @@ -1885,12 +1988,12 @@ def _set_source_ip_flow_label(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': ['0..1048575']}), is_leaf=True, yang_name="source-ip-flow-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ipv6-flow-label', is_config=False) + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={u'range': [u'0..1048575']}), is_leaf=True, yang_name="source-ip-flow-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ipv6-flow-label', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """source_ip_flow_label must be of a type compatible with inet:ipv6-flow-label""", 'defined-type': "inet:ipv6-flow-label", - 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'0..1048575']}), is_leaf=True, yang_name="source-ip-flow-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ipv6-flow-label', is_config=False)""", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={u'range': [u'0..1048575']}), is_leaf=True, yang_name="source-ip-flow-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ipv6-flow-label', is_config=False)""", }) self.__source_ip_flow_label = t @@ -1898,7 +2001,7 @@ def _set_source_ip_flow_label(self, v, load=False): self._set() def _unset_source_ip_flow_label(self): - self.__source_ip_flow_label = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': ['0..1048575']}), is_leaf=True, yang_name="source-ip-flow-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ipv6-flow-label', is_config=False) + self.__source_ip_flow_label = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={u'range': [u'0..1048575']}), is_leaf=True, yang_name="source-ip-flow-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ipv6-flow-label', is_config=False) def _get_destination_ip_address(self): @@ -1922,12 +2025,12 @@ def _set_destination_ip_address(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=[RestrictedClassType(base_type=str, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))'}),RestrictedClassType(base_type=str, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))'}),], is_leaf=True, yang_name="destination-ip-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-prefix', is_config=False) + t = YANGDynClass(v,base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))'}),RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))'}),], is_leaf=True, yang_name="destination-ip-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-prefix', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """destination_ip_address must be of a type compatible with inet:ip-prefix""", 'defined-type': "inet:ip-prefix", - 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))'}),RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))'}),], is_leaf=True, yang_name="destination-ip-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-prefix', is_config=False)""", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))'}),RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))'}),], is_leaf=True, yang_name="destination-ip-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-prefix', is_config=False)""", }) self.__destination_ip_address = t @@ -1935,7 +2038,7 @@ def _set_destination_ip_address(self, v, load=False): self._set() def _unset_destination_ip_address(self): - self.__destination_ip_address = YANGDynClass(base=[RestrictedClassType(base_type=str, restriction_dict={'pattern': '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))'}),RestrictedClassType(base_type=str, restriction_dict={'pattern': '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))'}),], is_leaf=True, yang_name="destination-ip-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-prefix', is_config=False) + self.__destination_ip_address = YANGDynClass(base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))'}),RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))'}),], is_leaf=True, yang_name="destination-ip-address", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ip-prefix', is_config=False) def _get_destination_ip_flow_label(self): @@ -1959,12 +2062,12 @@ def _set_destination_ip_flow_label(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': ['0..1048575']}), is_leaf=True, yang_name="destination-ip-flow-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ipv6-flow-label', is_config=False) + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={u'range': [u'0..1048575']}), is_leaf=True, yang_name="destination-ip-flow-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ipv6-flow-label', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """destination_ip_flow_label must be of a type compatible with inet:ipv6-flow-label""", 'defined-type': "inet:ipv6-flow-label", - 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': [u'0..1048575']}), is_leaf=True, yang_name="destination-ip-flow-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ipv6-flow-label', is_config=False)""", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={u'range': [u'0..1048575']}), is_leaf=True, yang_name="destination-ip-flow-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ipv6-flow-label', is_config=False)""", }) self.__destination_ip_flow_label = t @@ -1972,7 +2075,7 @@ def _set_destination_ip_flow_label(self, v, load=False): self._set() def _unset_destination_ip_flow_label(self): - self.__destination_ip_flow_label = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={'range': ['0..1048575']}), is_leaf=True, yang_name="destination-ip-flow-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ipv6-flow-label', is_config=False) + self.__destination_ip_flow_label = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), restriction_dict={u'range': [u'0..1048575']}), is_leaf=True, yang_name="destination-ip-flow-label", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:ipv6-flow-label', is_config=False) def _get_dscp(self): @@ -1996,12 +2099,12 @@ def _set_dscp(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..63']}), is_leaf=True, yang_name="dscp", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:dscp', is_config=False) + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={u'range': [u'0..63']}), is_leaf=True, yang_name="dscp", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:dscp', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """dscp must be of a type compatible with inet:dscp""", 'defined-type': "inet:dscp", - 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': [u'0..63']}), is_leaf=True, yang_name="dscp", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:dscp', is_config=False)""", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={u'range': [u'0..63']}), is_leaf=True, yang_name="dscp", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:dscp', is_config=False)""", }) self.__dscp = t @@ -2009,7 +2112,7 @@ def _set_dscp(self, v, load=False): self._set() def _unset_dscp(self): - self.__dscp = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..63']}), is_leaf=True, yang_name="dscp", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:dscp', is_config=False) + self.__dscp = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={u'range': [u'0..63']}), is_leaf=True, yang_name="dscp", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='inet:dscp', is_config=False) def _get_protocol(self): @@ -2033,12 +2136,12 @@ def _set_protocol(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=[RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..254']}),RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'oc-pkt-match-types:IP_TCP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_L2TP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_L2TP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_AUTH': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_RSVP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_GRE': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_TCP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_AUTH': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_UDP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_PIM': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_GRE': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_IGMP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_RSVP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_ICMP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_PIM': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_UDP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_IGMP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_ICMP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}},),], is_leaf=True, yang_name="protocol", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:ip-protocol-type', is_config=False) + t = YANGDynClass(v,base=[RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={u'range': [u'0..254']}),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'oc-pkt-match-types:IP_TCP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'IP_L2TP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_L2TP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'IP_AUTH': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'IP_RSVP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'IP_GRE': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'IP_TCP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_AUTH': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'IP_UDP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'IP_PIM': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_GRE': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'IP_IGMP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_RSVP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_ICMP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_PIM': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_UDP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_IGMP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'IP_ICMP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}},),], is_leaf=True, yang_name="protocol", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:ip-protocol-type', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """protocol must be of a type compatible with oc-pkt-match-types:ip-protocol-type""", 'defined-type': "oc-pkt-match-types:ip-protocol-type", - 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': [u'0..254']}),RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'oc-pkt-match-types:IP_TCP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'IP_L2TP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_L2TP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'IP_AUTH': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'IP_RSVP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'IP_GRE': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'IP_TCP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_AUTH': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'IP_UDP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'IP_PIM': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_GRE': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'IP_IGMP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_RSVP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_ICMP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_PIM': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_UDP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_IGMP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'IP_ICMP': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}},),], is_leaf=True, yang_name="protocol", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:ip-protocol-type', is_config=False)""", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={u'range': [u'0..254']}),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'oc-pkt-match-types:IP_TCP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'IP_L2TP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_L2TP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'IP_AUTH': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'IP_RSVP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'IP_GRE': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'IP_TCP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_AUTH': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'IP_UDP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'IP_PIM': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_GRE': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'IP_IGMP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_RSVP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_ICMP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_PIM': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_UDP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_IGMP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'IP_ICMP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}},),], is_leaf=True, yang_name="protocol", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:ip-protocol-type', is_config=False)""", }) self.__protocol = t @@ -2046,7 +2149,7 @@ def _set_protocol(self, v, load=False): self._set() def _unset_protocol(self): - self.__protocol = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..254']}),RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'oc-pkt-match-types:IP_TCP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_L2TP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_L2TP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_AUTH': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_RSVP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_GRE': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_TCP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_AUTH': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_UDP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_PIM': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_GRE': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_IGMP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_RSVP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_ICMP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_PIM': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_UDP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:IP_IGMP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'IP_ICMP': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}},),], is_leaf=True, yang_name="protocol", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:ip-protocol-type', is_config=False) + self.__protocol = YANGDynClass(base=[RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={u'range': [u'0..254']}),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'oc-pkt-match-types:IP_TCP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'IP_L2TP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_L2TP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'IP_AUTH': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'IP_RSVP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'IP_GRE': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'IP_TCP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_AUTH': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'IP_UDP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'IP_PIM': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_GRE': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'IP_IGMP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_RSVP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_ICMP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_PIM': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_UDP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:IP_IGMP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'IP_ICMP': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}},),], is_leaf=True, yang_name="protocol", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:ip-protocol-type', is_config=False) def _get_hop_limit(self): @@ -2072,12 +2175,12 @@ def _set_hop_limit(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..255']}), is_leaf=True, yang_name="hop-limit", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='uint8', is_config=False) + t = YANGDynClass(v,base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={u'range': [u'0..255']}), is_leaf=True, yang_name="hop-limit", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='uint8', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """hop_limit must be of a type compatible with uint8""", 'defined-type': "uint8", - 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': [u'0..255']}), is_leaf=True, yang_name="hop-limit", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='uint8', is_config=False)""", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={u'range': [u'0..255']}), is_leaf=True, yang_name="hop-limit", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='uint8', is_config=False)""", }) self.__hop_limit = t @@ -2085,19 +2188,19 @@ def _set_hop_limit(self, v, load=False): self._set() def _unset_hop_limit(self): - self.__hop_limit = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['0..255']}), is_leaf=True, yang_name="hop-limit", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='uint8', is_config=False) + self.__hop_limit = YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={u'range': [u'0..255']}), is_leaf=True, yang_name="hop-limit", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='uint8', is_config=False) - ip_version = builtins.property(_get_ip_version) - source_ip_address = builtins.property(_get_source_ip_address) - source_ip_flow_label = builtins.property(_get_source_ip_flow_label) - destination_ip_address = builtins.property(_get_destination_ip_address) - destination_ip_flow_label = builtins.property(_get_destination_ip_flow_label) - dscp = builtins.property(_get_dscp) - protocol = builtins.property(_get_protocol) - hop_limit = builtins.property(_get_hop_limit) + ip_version = __builtin__.property(_get_ip_version) + source_ip_address = __builtin__.property(_get_source_ip_address) + source_ip_flow_label = __builtin__.property(_get_source_ip_flow_label) + destination_ip_address = __builtin__.property(_get_destination_ip_address) + destination_ip_flow_label = __builtin__.property(_get_destination_ip_flow_label) + dscp = __builtin__.property(_get_dscp) + protocol = __builtin__.property(_get_protocol) + hop_limit = __builtin__.property(_get_hop_limit) - _pyangbind_elements = {'ip_version': ip_version, 'source_ip_address': source_ip_address, 'source_ip_flow_label': source_ip_flow_label, 'destination_ip_address': destination_ip_address, 'destination_ip_flow_label': destination_ip_flow_label, 'dscp': dscp, 'protocol': protocol, 'hop_limit': hop_limit, } + _pyangbind_elements = OrderedDict([('ip_version', ip_version), ('source_ip_address', source_ip_address), ('source_ip_flow_label', source_ip_flow_label), ('destination_ip_address', destination_ip_address), ('destination_ip_flow_label', destination_ip_flow_label), ('dscp', dscp), ('protocol', protocol), ('hop_limit', hop_limit), ]) class yc_ip_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_ip(PybindBase): @@ -2109,12 +2212,16 @@ class yc_ip_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_ip(Pybind YANG Description: Top level container """ - __slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_extmethods', '__config','__state',) + __slots__ = ('_path_helper', '_extmethods', '__config','__state',) + + _yang_name = 'ip' + + _pybind_generated_by = 'container' def __init__(self, *args, **kwargs): - self._yang_name = 'ip' - self._pybind_generated_by = 'container' + self._path_helper = False + self._extmethods = False self.__state = YANGDynClass(base=yc_state_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_ip_state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) self.__config = YANGDynClass(base=yc_config_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_ip_config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) @@ -2144,7 +2251,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return ['acl', 'acl-sets', 'acl-set', 'acl-entries', 'acl-entry', 'ip'] + return [u'acl', u'acl-sets', u'acl-set', u'acl-entries', u'acl-entry', u'ip'] def _get_config(self): """ @@ -2219,11 +2326,11 @@ def _set_state(self, v, load=False): def _unset_state(self): self.__state = YANGDynClass(base=yc_state_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_ip_state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) - config = builtins.property(_get_config, _set_config) - state = builtins.property(_get_state, _set_state) + config = __builtin__.property(_get_config, _set_config) + state = __builtin__.property(_get_state, _set_state) - _pyangbind_elements = {'config': config, 'state': state, } + _pyangbind_elements = OrderedDict([('config', config), ('state', state), ]) class yc_config_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_transport_config(PybindBase): @@ -2235,16 +2342,20 @@ class yc_config_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_trans YANG Description: Configuration data """ - __slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_extmethods', '__source_port','__destination_port','__tcp_flags',) + __slots__ = ('_path_helper', '_extmethods', '__source_port','__destination_port','__tcp_flags',) + + _yang_name = 'config' + + _pybind_generated_by = 'container' def __init__(self, *args, **kwargs): - self._yang_name = 'config' - self._pybind_generated_by = 'container' + self._path_helper = False + self._extmethods = False - self.__source_port = YANGDynClass(base=[RestrictedClassType(base_type=str, restriction_dict={'pattern': '^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['0..65535']}),RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'ANY': {}},),], is_leaf=True, yang_name="source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=True) - self.__tcp_flags = YANGDynClass(base=TypedListType(allowed_type=RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'TCP_FIN': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_ACK': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_URG': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_RST': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_SYN': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_ECE': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_ACK': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_SYN': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_CWR': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_CWR': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_URG': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_RST': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_FIN': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_ECE': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_PSH': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_PSH': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}},)), is_leaf=False, yang_name="tcp-flags", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=True) - self.__destination_port = YANGDynClass(base=[RestrictedClassType(base_type=str, restriction_dict={'pattern': '^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['0..65535']}),RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'ANY': {}},),], is_leaf=True, yang_name="destination-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=True) + self.__source_port = YANGDynClass(base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={u'range': [u'0..65535']}),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'ANY': {}},),], is_leaf=True, yang_name="source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=True) + self.__tcp_flags = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'TCP_FIN': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'TCP_ACK': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'TCP_URG': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_RST': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_SYN': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'TCP_ECE': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_ACK': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'TCP_SYN': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_CWR': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'TCP_CWR': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_URG': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'TCP_RST': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_FIN': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_ECE': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'TCP_PSH': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_PSH': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}},)), is_leaf=False, yang_name="tcp-flags", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=True) + self.__destination_port = YANGDynClass(base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={u'range': [u'0..65535']}),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'ANY': {}},),], is_leaf=True, yang_name="destination-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=True) load = kwargs.pop("load", None) if args: @@ -2271,7 +2382,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return ['acl', 'acl-sets', 'acl-set', 'acl-entries', 'acl-entry', 'transport', 'config'] + return [u'acl', u'acl-sets', u'acl-set', u'acl-entries', u'acl-entry', u'transport', u'config'] def _get_source_port(self): """ @@ -2294,12 +2405,12 @@ def _set_source_port(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=[RestrictedClassType(base_type=str, restriction_dict={'pattern': '^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['0..65535']}),RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'ANY': {}},),], is_leaf=True, yang_name="source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=True) + t = YANGDynClass(v,base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={u'range': [u'0..65535']}),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'ANY': {}},),], is_leaf=True, yang_name="source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """source_port must be of a type compatible with oc-pkt-match-types:port-num-range""", 'defined-type': "oc-pkt-match-types:port-num-range", - 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': [u'0..65535']}),RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'ANY': {}},),], is_leaf=True, yang_name="source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=True)""", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={u'range': [u'0..65535']}),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'ANY': {}},),], is_leaf=True, yang_name="source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=True)""", }) self.__source_port = t @@ -2307,7 +2418,7 @@ def _set_source_port(self, v, load=False): self._set() def _unset_source_port(self): - self.__source_port = YANGDynClass(base=[RestrictedClassType(base_type=str, restriction_dict={'pattern': '^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['0..65535']}),RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'ANY': {}},),], is_leaf=True, yang_name="source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=True) + self.__source_port = YANGDynClass(base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={u'range': [u'0..65535']}),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'ANY': {}},),], is_leaf=True, yang_name="source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=True) def _get_destination_port(self): @@ -2331,12 +2442,12 @@ def _set_destination_port(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=[RestrictedClassType(base_type=str, restriction_dict={'pattern': '^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['0..65535']}),RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'ANY': {}},),], is_leaf=True, yang_name="destination-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=True) + t = YANGDynClass(v,base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={u'range': [u'0..65535']}),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'ANY': {}},),], is_leaf=True, yang_name="destination-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """destination_port must be of a type compatible with oc-pkt-match-types:port-num-range""", 'defined-type': "oc-pkt-match-types:port-num-range", - 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': [u'0..65535']}),RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'ANY': {}},),], is_leaf=True, yang_name="destination-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=True)""", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={u'range': [u'0..65535']}),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'ANY': {}},),], is_leaf=True, yang_name="destination-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=True)""", }) self.__destination_port = t @@ -2344,7 +2455,7 @@ def _set_destination_port(self, v, load=False): self._set() def _unset_destination_port(self): - self.__destination_port = YANGDynClass(base=[RestrictedClassType(base_type=str, restriction_dict={'pattern': '^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['0..65535']}),RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'ANY': {}},),], is_leaf=True, yang_name="destination-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=True) + self.__destination_port = YANGDynClass(base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={u'range': [u'0..65535']}),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'ANY': {}},),], is_leaf=True, yang_name="destination-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=True) def _get_tcp_flags(self): @@ -2368,12 +2479,12 @@ def _set_tcp_flags(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=TypedListType(allowed_type=RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'TCP_FIN': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_ACK': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_URG': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_RST': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_SYN': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_ECE': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_ACK': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_SYN': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_CWR': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_CWR': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_URG': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_RST': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_FIN': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_ECE': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_PSH': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_PSH': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}},)), is_leaf=False, yang_name="tcp-flags", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=True) + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'TCP_FIN': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'TCP_ACK': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'TCP_URG': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_RST': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_SYN': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'TCP_ECE': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_ACK': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'TCP_SYN': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_CWR': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'TCP_CWR': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_URG': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'TCP_RST': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_FIN': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_ECE': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'TCP_PSH': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_PSH': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}},)), is_leaf=False, yang_name="tcp-flags", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """tcp_flags must be of a type compatible with identityref""", 'defined-type': "openconfig-acl:identityref", - 'generated-type': """YANGDynClass(base=TypedListType(allowed_type=RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'TCP_FIN': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'TCP_ACK': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'TCP_URG': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_RST': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_SYN': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'TCP_ECE': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_ACK': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'TCP_SYN': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_CWR': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'TCP_CWR': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_URG': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'TCP_RST': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_FIN': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_ECE': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'TCP_PSH': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_PSH': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}},)), is_leaf=False, yang_name="tcp-flags", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=True)""", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'TCP_FIN': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'TCP_ACK': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'TCP_URG': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_RST': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_SYN': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'TCP_ECE': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_ACK': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'TCP_SYN': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_CWR': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'TCP_CWR': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_URG': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'TCP_RST': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_FIN': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_ECE': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'TCP_PSH': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_PSH': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}},)), is_leaf=False, yang_name="tcp-flags", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=True)""", }) self.__tcp_flags = t @@ -2381,14 +2492,14 @@ def _set_tcp_flags(self, v, load=False): self._set() def _unset_tcp_flags(self): - self.__tcp_flags = YANGDynClass(base=TypedListType(allowed_type=RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'TCP_FIN': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_ACK': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_URG': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_RST': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_SYN': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_ECE': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_ACK': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_SYN': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_CWR': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_CWR': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_URG': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_RST': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_FIN': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_ECE': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_PSH': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_PSH': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}},)), is_leaf=False, yang_name="tcp-flags", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=True) + self.__tcp_flags = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'TCP_FIN': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'TCP_ACK': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'TCP_URG': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_RST': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_SYN': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'TCP_ECE': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_ACK': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'TCP_SYN': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_CWR': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'TCP_CWR': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_URG': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'TCP_RST': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_FIN': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_ECE': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'TCP_PSH': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_PSH': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}},)), is_leaf=False, yang_name="tcp-flags", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=True) - source_port = builtins.property(_get_source_port, _set_source_port) - destination_port = builtins.property(_get_destination_port, _set_destination_port) - tcp_flags = builtins.property(_get_tcp_flags, _set_tcp_flags) + source_port = __builtin__.property(_get_source_port, _set_source_port) + destination_port = __builtin__.property(_get_destination_port, _set_destination_port) + tcp_flags = __builtin__.property(_get_tcp_flags, _set_tcp_flags) - _pyangbind_elements = {'source_port': source_port, 'destination_port': destination_port, 'tcp_flags': tcp_flags, } + _pyangbind_elements = OrderedDict([('source_port', source_port), ('destination_port', destination_port), ('tcp_flags', tcp_flags), ]) class yc_state_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_transport_state(PybindBase): @@ -2400,16 +2511,20 @@ class yc_state_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_transp YANG Description: State data """ - __slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_extmethods', '__source_port','__destination_port','__tcp_flags',) + __slots__ = ('_path_helper', '_extmethods', '__source_port','__destination_port','__tcp_flags',) + + _yang_name = 'state' + + _pybind_generated_by = 'container' def __init__(self, *args, **kwargs): - self._yang_name = 'state' - self._pybind_generated_by = 'container' + self._path_helper = False + self._extmethods = False - self.__source_port = YANGDynClass(base=[RestrictedClassType(base_type=str, restriction_dict={'pattern': '^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['0..65535']}),RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'ANY': {}},),], is_leaf=True, yang_name="source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=False) - self.__tcp_flags = YANGDynClass(base=TypedListType(allowed_type=RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'TCP_FIN': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_ACK': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_URG': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_RST': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_SYN': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_ECE': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_ACK': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_SYN': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_CWR': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_CWR': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_URG': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_RST': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_FIN': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_ECE': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_PSH': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_PSH': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}},)), is_leaf=False, yang_name="tcp-flags", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=False) - self.__destination_port = YANGDynClass(base=[RestrictedClassType(base_type=str, restriction_dict={'pattern': '^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['0..65535']}),RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'ANY': {}},),], is_leaf=True, yang_name="destination-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=False) + self.__source_port = YANGDynClass(base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={u'range': [u'0..65535']}),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'ANY': {}},),], is_leaf=True, yang_name="source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=False) + self.__tcp_flags = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'TCP_FIN': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'TCP_ACK': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'TCP_URG': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_RST': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_SYN': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'TCP_ECE': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_ACK': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'TCP_SYN': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_CWR': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'TCP_CWR': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_URG': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'TCP_RST': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_FIN': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_ECE': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'TCP_PSH': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_PSH': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}},)), is_leaf=False, yang_name="tcp-flags", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=False) + self.__destination_port = YANGDynClass(base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={u'range': [u'0..65535']}),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'ANY': {}},),], is_leaf=True, yang_name="destination-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=False) load = kwargs.pop("load", None) if args: @@ -2436,7 +2551,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return ['acl', 'acl-sets', 'acl-set', 'acl-entries', 'acl-entry', 'transport', 'state'] + return [u'acl', u'acl-sets', u'acl-set', u'acl-entries', u'acl-entry', u'transport', u'state'] def _get_source_port(self): """ @@ -2459,12 +2574,12 @@ def _set_source_port(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=[RestrictedClassType(base_type=str, restriction_dict={'pattern': '^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['0..65535']}),RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'ANY': {}},),], is_leaf=True, yang_name="source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=False) + t = YANGDynClass(v,base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={u'range': [u'0..65535']}),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'ANY': {}},),], is_leaf=True, yang_name="source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """source_port must be of a type compatible with oc-pkt-match-types:port-num-range""", 'defined-type': "oc-pkt-match-types:port-num-range", - 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': [u'0..65535']}),RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'ANY': {}},),], is_leaf=True, yang_name="source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=False)""", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={u'range': [u'0..65535']}),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'ANY': {}},),], is_leaf=True, yang_name="source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=False)""", }) self.__source_port = t @@ -2472,7 +2587,7 @@ def _set_source_port(self, v, load=False): self._set() def _unset_source_port(self): - self.__source_port = YANGDynClass(base=[RestrictedClassType(base_type=str, restriction_dict={'pattern': '^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['0..65535']}),RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'ANY': {}},),], is_leaf=True, yang_name="source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=False) + self.__source_port = YANGDynClass(base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={u'range': [u'0..65535']}),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'ANY': {}},),], is_leaf=True, yang_name="source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=False) def _get_destination_port(self): @@ -2496,12 +2611,12 @@ def _set_destination_port(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=[RestrictedClassType(base_type=str, restriction_dict={'pattern': '^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['0..65535']}),RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'ANY': {}},),], is_leaf=True, yang_name="destination-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=False) + t = YANGDynClass(v,base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={u'range': [u'0..65535']}),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'ANY': {}},),], is_leaf=True, yang_name="destination-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """destination_port must be of a type compatible with oc-pkt-match-types:port-num-range""", 'defined-type': "oc-pkt-match-types:port-num-range", - 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=unicode, restriction_dict={'pattern': u'^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': [u'0..65535']}),RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'ANY': {}},),], is_leaf=True, yang_name="destination-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=False)""", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={u'range': [u'0..65535']}),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'ANY': {}},),], is_leaf=True, yang_name="destination-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=False)""", }) self.__destination_port = t @@ -2509,7 +2624,7 @@ def _set_destination_port(self, v, load=False): self._set() def _unset_destination_port(self): - self.__destination_port = YANGDynClass(base=[RestrictedClassType(base_type=str, restriction_dict={'pattern': '^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={'range': ['0..65535']}),RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'ANY': {}},),], is_leaf=True, yang_name="destination-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=False) + self.__destination_port = YANGDynClass(base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)\\.\\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?[0-9]?)$'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..65535']},int_size=16), restriction_dict={u'range': [u'0..65535']}),RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'ANY': {}},),], is_leaf=True, yang_name="destination-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-pkt-match-types:port-num-range', is_config=False) def _get_tcp_flags(self): @@ -2533,12 +2648,12 @@ def _set_tcp_flags(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=TypedListType(allowed_type=RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'TCP_FIN': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_ACK': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_URG': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_RST': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_SYN': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_ECE': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_ACK': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_SYN': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_CWR': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_CWR': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_URG': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_RST': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_FIN': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_ECE': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_PSH': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_PSH': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}},)), is_leaf=False, yang_name="tcp-flags", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=False) + t = YANGDynClass(v,unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'TCP_FIN': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'TCP_ACK': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'TCP_URG': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_RST': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_SYN': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'TCP_ECE': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_ACK': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'TCP_SYN': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_CWR': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'TCP_CWR': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_URG': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'TCP_RST': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_FIN': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_ECE': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'TCP_PSH': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_PSH': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}},)), is_leaf=False, yang_name="tcp-flags", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """tcp_flags must be of a type compatible with identityref""", 'defined-type': "openconfig-acl:identityref", - 'generated-type': """YANGDynClass(base=TypedListType(allowed_type=RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'TCP_FIN': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'TCP_ACK': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'TCP_URG': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_RST': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_SYN': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'TCP_ECE': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_ACK': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'TCP_SYN': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_CWR': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'TCP_CWR': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_URG': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'TCP_RST': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_FIN': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_ECE': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'TCP_PSH': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_PSH': {'@namespace': u'http://openconfig.net/yang/packet-match-types', '@module': u'openconfig-packet-match-types'}},)), is_leaf=False, yang_name="tcp-flags", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=False)""", + 'generated-type': """YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'TCP_FIN': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'TCP_ACK': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'TCP_URG': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_RST': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_SYN': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'TCP_ECE': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_ACK': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'TCP_SYN': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_CWR': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'TCP_CWR': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_URG': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'TCP_RST': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_FIN': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_ECE': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'TCP_PSH': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_PSH': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}},)), is_leaf=False, yang_name="tcp-flags", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=False)""", }) self.__tcp_flags = t @@ -2546,14 +2661,14 @@ def _set_tcp_flags(self, v, load=False): self._set() def _unset_tcp_flags(self): - self.__tcp_flags = YANGDynClass(base=TypedListType(allowed_type=RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'TCP_FIN': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_ACK': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_URG': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_RST': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_SYN': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_ECE': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_ACK': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_SYN': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_CWR': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_CWR': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_URG': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_RST': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_FIN': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_ECE': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'TCP_PSH': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}, 'oc-pkt-match-types:TCP_PSH': {'@namespace': 'http://openconfig.net/yang/packet-match-types', '@module': 'openconfig-packet-match-types'}},)), is_leaf=False, yang_name="tcp-flags", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=False) + self.__tcp_flags = YANGDynClass(unique=True, base=TypedListType(allowed_type=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'TCP_FIN': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'TCP_ACK': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'TCP_URG': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_RST': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_SYN': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'TCP_ECE': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_ACK': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'TCP_SYN': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_CWR': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'TCP_CWR': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_URG': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'TCP_RST': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_FIN': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_ECE': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'TCP_PSH': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}, u'oc-pkt-match-types:TCP_PSH': {u'@namespace': u'http://openconfig.net/yang/packet-match-types', u'@module': u'openconfig-packet-match-types'}},)), is_leaf=False, yang_name="tcp-flags", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=False) - source_port = builtins.property(_get_source_port) - destination_port = builtins.property(_get_destination_port) - tcp_flags = builtins.property(_get_tcp_flags) + source_port = __builtin__.property(_get_source_port) + destination_port = __builtin__.property(_get_destination_port) + tcp_flags = __builtin__.property(_get_tcp_flags) - _pyangbind_elements = {'source_port': source_port, 'destination_port': destination_port, 'tcp_flags': tcp_flags, } + _pyangbind_elements = OrderedDict([('source_port', source_port), ('destination_port', destination_port), ('tcp_flags', tcp_flags), ]) class yc_transport_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_transport(PybindBase): @@ -2565,12 +2680,16 @@ class yc_transport_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_tr YANG Description: Transport fields container """ - __slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_extmethods', '__config','__state',) + __slots__ = ('_path_helper', '_extmethods', '__config','__state',) + + _yang_name = 'transport' + + _pybind_generated_by = 'container' def __init__(self, *args, **kwargs): - self._yang_name = 'transport' - self._pybind_generated_by = 'container' + self._path_helper = False + self._extmethods = False self.__state = YANGDynClass(base=yc_state_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_transport_state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) self.__config = YANGDynClass(base=yc_config_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_transport_config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) @@ -2600,7 +2719,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return ['acl', 'acl-sets', 'acl-set', 'acl-entries', 'acl-entry', 'transport'] + return [u'acl', u'acl-sets', u'acl-set', u'acl-entries', u'acl-entry', u'transport'] def _get_config(self): """ @@ -2675,11 +2794,11 @@ def _set_state(self, v, load=False): def _unset_state(self): self.__state = YANGDynClass(base=yc_state_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_transport_state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) - config = builtins.property(_get_config, _set_config) - state = builtins.property(_get_state, _set_state) + config = __builtin__.property(_get_config, _set_config) + state = __builtin__.property(_get_state, _set_state) - _pyangbind_elements = {'config': config, 'state': state, } + _pyangbind_elements = OrderedDict([('config', config), ('state', state), ]) class yc_config_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_input_interface_interface_ref_config(PybindBase): @@ -2691,15 +2810,19 @@ class yc_config_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_input YANG Description: Configured reference to interface / subinterface """ - __slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_extmethods', '__interface','__subinterface',) + __slots__ = ('_path_helper', '_extmethods', '__interface','__subinterface',) + + _yang_name = 'config' + + _pybind_generated_by = 'container' def __init__(self, *args, **kwargs): - self._yang_name = 'config' - self._pybind_generated_by = 'container' + self._path_helper = False + self._extmethods = False - self.__interface = YANGDynClass(base=str, is_leaf=True, yang_name="interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) - self.__subinterface = YANGDynClass(base=str, is_leaf=True, yang_name="subinterface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) + self.__interface = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) + self.__subinterface = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="subinterface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) load = kwargs.pop("load", None) if args: @@ -2726,7 +2849,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return ['acl', 'acl-sets', 'acl-set', 'acl-entries', 'acl-entry', 'input-interface', 'interface-ref', 'config'] + return [u'acl', u'acl-sets', u'acl-set', u'acl-entries', u'acl-entry', u'input-interface', u'interface-ref', u'config'] def _get_interface(self): """ @@ -2753,12 +2876,12 @@ def _set_interface(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=str, is_leaf=True, yang_name="interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """interface must be of a type compatible with leafref""", 'defined-type': "leafref", - 'generated-type': """YANGDynClass(base=unicode, is_leaf=True, yang_name="interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True)""", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True)""", }) self.__interface = t @@ -2766,7 +2889,7 @@ def _set_interface(self, v, load=False): self._set() def _unset_interface(self): - self.__interface = YANGDynClass(base=str, is_leaf=True, yang_name="interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) + self.__interface = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) def _get_subinterface(self): @@ -2796,12 +2919,12 @@ def _set_subinterface(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=str, is_leaf=True, yang_name="subinterface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="subinterface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """subinterface must be of a type compatible with leafref""", 'defined-type': "leafref", - 'generated-type': """YANGDynClass(base=unicode, is_leaf=True, yang_name="subinterface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True)""", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="subinterface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True)""", }) self.__subinterface = t @@ -2809,13 +2932,13 @@ def _set_subinterface(self, v, load=False): self._set() def _unset_subinterface(self): - self.__subinterface = YANGDynClass(base=str, is_leaf=True, yang_name="subinterface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) + self.__subinterface = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="subinterface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) - interface = builtins.property(_get_interface, _set_interface) - subinterface = builtins.property(_get_subinterface, _set_subinterface) + interface = __builtin__.property(_get_interface, _set_interface) + subinterface = __builtin__.property(_get_subinterface, _set_subinterface) - _pyangbind_elements = {'interface': interface, 'subinterface': subinterface, } + _pyangbind_elements = OrderedDict([('interface', interface), ('subinterface', subinterface), ]) class yc_state_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_input_interface_interface_ref_state(PybindBase): @@ -2827,15 +2950,19 @@ class yc_state_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_input_ YANG Description: Operational state for interface-ref """ - __slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_extmethods', '__interface','__subinterface',) + __slots__ = ('_path_helper', '_extmethods', '__interface','__subinterface',) + + _yang_name = 'state' + + _pybind_generated_by = 'container' def __init__(self, *args, **kwargs): - self._yang_name = 'state' - self._pybind_generated_by = 'container' + self._path_helper = False + self._extmethods = False - self.__interface = YANGDynClass(base=str, is_leaf=True, yang_name="interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) - self.__subinterface = YANGDynClass(base=str, is_leaf=True, yang_name="subinterface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) + self.__interface = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) + self.__subinterface = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="subinterface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) load = kwargs.pop("load", None) if args: @@ -2862,7 +2989,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return ['acl', 'acl-sets', 'acl-set', 'acl-entries', 'acl-entry', 'input-interface', 'interface-ref', 'state'] + return [u'acl', u'acl-sets', u'acl-set', u'acl-entries', u'acl-entry', u'input-interface', u'interface-ref', u'state'] def _get_interface(self): """ @@ -2889,12 +3016,12 @@ def _set_interface(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=str, is_leaf=True, yang_name="interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """interface must be of a type compatible with leafref""", 'defined-type': "leafref", - 'generated-type': """YANGDynClass(base=unicode, is_leaf=True, yang_name="interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False)""", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False)""", }) self.__interface = t @@ -2902,7 +3029,7 @@ def _set_interface(self, v, load=False): self._set() def _unset_interface(self): - self.__interface = YANGDynClass(base=str, is_leaf=True, yang_name="interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) + self.__interface = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) def _get_subinterface(self): @@ -2932,12 +3059,12 @@ def _set_subinterface(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=str, is_leaf=True, yang_name="subinterface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="subinterface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """subinterface must be of a type compatible with leafref""", 'defined-type': "leafref", - 'generated-type': """YANGDynClass(base=unicode, is_leaf=True, yang_name="subinterface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False)""", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="subinterface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False)""", }) self.__subinterface = t @@ -2945,13 +3072,13 @@ def _set_subinterface(self, v, load=False): self._set() def _unset_subinterface(self): - self.__subinterface = YANGDynClass(base=str, is_leaf=True, yang_name="subinterface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) + self.__subinterface = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="subinterface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) - interface = builtins.property(_get_interface) - subinterface = builtins.property(_get_subinterface) + interface = __builtin__.property(_get_interface) + subinterface = __builtin__.property(_get_subinterface) - _pyangbind_elements = {'interface': interface, 'subinterface': subinterface, } + _pyangbind_elements = OrderedDict([('interface', interface), ('subinterface', subinterface), ]) class yc_interface_ref_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_input_interface_interface_ref(PybindBase): @@ -2963,12 +3090,16 @@ class yc_interface_ref_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entr YANG Description: Reference to an interface or subinterface """ - __slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_extmethods', '__config','__state',) + __slots__ = ('_path_helper', '_extmethods', '__config','__state',) + + _yang_name = 'interface-ref' + + _pybind_generated_by = 'container' def __init__(self, *args, **kwargs): - self._yang_name = 'interface-ref' - self._pybind_generated_by = 'container' + self._path_helper = False + self._extmethods = False self.__state = YANGDynClass(base=yc_state_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_input_interface_interface_ref_state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) self.__config = YANGDynClass(base=yc_config_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_input_interface_interface_ref_config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) @@ -2998,7 +3129,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return ['acl', 'acl-sets', 'acl-set', 'acl-entries', 'acl-entry', 'input-interface', 'interface-ref'] + return [u'acl', u'acl-sets', u'acl-set', u'acl-entries', u'acl-entry', u'input-interface', u'interface-ref'] def _get_config(self): """ @@ -3073,11 +3204,11 @@ def _set_state(self, v, load=False): def _unset_state(self): self.__state = YANGDynClass(base=yc_state_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_input_interface_interface_ref_state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) - config = builtins.property(_get_config, _set_config) - state = builtins.property(_get_state, _set_state) + config = __builtin__.property(_get_config, _set_config) + state = __builtin__.property(_get_state, _set_state) - _pyangbind_elements = {'config': config, 'state': state, } + _pyangbind_elements = OrderedDict([('config', config), ('state', state), ]) class yc_input_interface_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_input_interface(PybindBase): @@ -3089,12 +3220,16 @@ class yc_input_interface_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_en YANG Description: Input interface container """ - __slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_extmethods', '__interface_ref',) + __slots__ = ('_path_helper', '_extmethods', '__interface_ref',) + + _yang_name = 'input-interface' + + _pybind_generated_by = 'container' def __init__(self, *args, **kwargs): - self._yang_name = 'input-interface' - self._pybind_generated_by = 'container' + self._path_helper = False + self._extmethods = False self.__interface_ref = YANGDynClass(base=yc_interface_ref_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_input_interface_interface_ref, is_container='container', yang_name="interface-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) @@ -3123,7 +3258,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return ['acl', 'acl-sets', 'acl-set', 'acl-entries', 'acl-entry', 'input-interface'] + return [u'acl', u'acl-sets', u'acl-set', u'acl-entries', u'acl-entry', u'input-interface'] def _get_interface_ref(self): """ @@ -3161,10 +3296,10 @@ def _set_interface_ref(self, v, load=False): def _unset_interface_ref(self): self.__interface_ref = YANGDynClass(base=yc_interface_ref_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_input_interface_interface_ref, is_container='container', yang_name="interface-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) - interface_ref = builtins.property(_get_interface_ref, _set_interface_ref) + interface_ref = __builtin__.property(_get_interface_ref, _set_interface_ref) - _pyangbind_elements = {'interface_ref': interface_ref, } + _pyangbind_elements = OrderedDict([('interface_ref', interface_ref), ]) class yc_config_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_actions_config(PybindBase): @@ -3176,15 +3311,19 @@ class yc_config_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_actio YANG Description: Config data for ACL actions """ - __slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_extmethods', '__forwarding_action','__log_action',) + __slots__ = ('_path_helper', '_extmethods', '__forwarding_action','__log_action',) + + _yang_name = 'config' + + _pybind_generated_by = 'container' def __init__(self, *args, **kwargs): - self._yang_name = 'config' - self._pybind_generated_by = 'container' + self._path_helper = False + self._extmethods = False - self.__forwarding_action = YANGDynClass(base=RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'DROP': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'oc-acl:REJECT': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'ACCEPT': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'REJECT': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'oc-acl:ACCEPT': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'oc-acl:DROP': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}},), is_leaf=True, yang_name="forwarding-action", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=True) - self.__log_action = YANGDynClass(base=RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'LOG_SYSLOG': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'oc-acl:LOG_SYSLOG': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'LOG_NONE': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'oc-acl:LOG_NONE': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}},), default=str("LOG_NONE"), is_leaf=True, yang_name="log-action", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=True) + self.__forwarding_action = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'DROP': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'oc-acl:REJECT': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'ACCEPT': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'REJECT': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'oc-acl:ACCEPT': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'oc-acl:DROP': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}},), is_leaf=True, yang_name="forwarding-action", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=True) + self.__log_action = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'LOG_SYSLOG': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'oc-acl:LOG_SYSLOG': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'LOG_NONE': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'oc-acl:LOG_NONE': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}},), default=six.text_type("LOG_NONE"), is_leaf=True, yang_name="log-action", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=True) load = kwargs.pop("load", None) if args: @@ -3211,7 +3350,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return ['acl', 'acl-sets', 'acl-set', 'acl-entries', 'acl-entry', 'actions', 'config'] + return [u'acl', u'acl-sets', u'acl-set', u'acl-entries', u'acl-entry', u'actions', u'config'] def _get_forwarding_action(self): """ @@ -3236,12 +3375,12 @@ def _set_forwarding_action(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'DROP': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'oc-acl:REJECT': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'ACCEPT': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'REJECT': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'oc-acl:ACCEPT': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'oc-acl:DROP': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}},), is_leaf=True, yang_name="forwarding-action", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=True) + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'DROP': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'oc-acl:REJECT': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'ACCEPT': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'REJECT': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'oc-acl:ACCEPT': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'oc-acl:DROP': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}},), is_leaf=True, yang_name="forwarding-action", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """forwarding_action must be of a type compatible with identityref""", 'defined-type': "openconfig-acl:identityref", - 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'DROP': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'oc-acl:REJECT': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'ACCEPT': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'REJECT': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'oc-acl:ACCEPT': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'oc-acl:DROP': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}},), is_leaf=True, yang_name="forwarding-action", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=True)""", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'DROP': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'oc-acl:REJECT': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'ACCEPT': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'REJECT': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'oc-acl:ACCEPT': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'oc-acl:DROP': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}},), is_leaf=True, yang_name="forwarding-action", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=True)""", }) self.__forwarding_action = t @@ -3249,7 +3388,7 @@ def _set_forwarding_action(self, v, load=False): self._set() def _unset_forwarding_action(self): - self.__forwarding_action = YANGDynClass(base=RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'DROP': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'oc-acl:REJECT': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'ACCEPT': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'REJECT': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'oc-acl:ACCEPT': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'oc-acl:DROP': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}},), is_leaf=True, yang_name="forwarding-action", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=True) + self.__forwarding_action = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'DROP': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'oc-acl:REJECT': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'ACCEPT': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'REJECT': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'oc-acl:ACCEPT': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'oc-acl:DROP': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}},), is_leaf=True, yang_name="forwarding-action", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=True) def _get_log_action(self): @@ -3277,12 +3416,12 @@ def _set_log_action(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'LOG_SYSLOG': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'oc-acl:LOG_SYSLOG': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'LOG_NONE': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'oc-acl:LOG_NONE': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}},), default=str("LOG_NONE"), is_leaf=True, yang_name="log-action", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=True) + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'LOG_SYSLOG': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'oc-acl:LOG_SYSLOG': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'LOG_NONE': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'oc-acl:LOG_NONE': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}},), default=six.text_type("LOG_NONE"), is_leaf=True, yang_name="log-action", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """log_action must be of a type compatible with identityref""", 'defined-type': "openconfig-acl:identityref", - 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'LOG_SYSLOG': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'oc-acl:LOG_SYSLOG': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'LOG_NONE': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'oc-acl:LOG_NONE': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}},), default=unicode("LOG_NONE"), is_leaf=True, yang_name="log-action", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=True)""", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'LOG_SYSLOG': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'oc-acl:LOG_SYSLOG': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'LOG_NONE': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'oc-acl:LOG_NONE': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}},), default=six.text_type("LOG_NONE"), is_leaf=True, yang_name="log-action", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=True)""", }) self.__log_action = t @@ -3290,13 +3429,13 @@ def _set_log_action(self, v, load=False): self._set() def _unset_log_action(self): - self.__log_action = YANGDynClass(base=RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'LOG_SYSLOG': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'oc-acl:LOG_SYSLOG': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'LOG_NONE': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'oc-acl:LOG_NONE': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}},), default=str("LOG_NONE"), is_leaf=True, yang_name="log-action", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=True) + self.__log_action = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'LOG_SYSLOG': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'oc-acl:LOG_SYSLOG': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'LOG_NONE': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'oc-acl:LOG_NONE': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}},), default=six.text_type("LOG_NONE"), is_leaf=True, yang_name="log-action", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=True) - forwarding_action = builtins.property(_get_forwarding_action, _set_forwarding_action) - log_action = builtins.property(_get_log_action, _set_log_action) + forwarding_action = __builtin__.property(_get_forwarding_action, _set_forwarding_action) + log_action = __builtin__.property(_get_log_action, _set_log_action) - _pyangbind_elements = {'forwarding_action': forwarding_action, 'log_action': log_action, } + _pyangbind_elements = OrderedDict([('forwarding_action', forwarding_action), ('log_action', log_action), ]) class yc_state_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_actions_state(PybindBase): @@ -3308,15 +3447,19 @@ class yc_state_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_action YANG Description: State information for ACL actions """ - __slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_extmethods', '__forwarding_action','__log_action',) + __slots__ = ('_path_helper', '_extmethods', '__forwarding_action','__log_action',) + + _yang_name = 'state' + + _pybind_generated_by = 'container' def __init__(self, *args, **kwargs): - self._yang_name = 'state' - self._pybind_generated_by = 'container' + self._path_helper = False + self._extmethods = False - self.__forwarding_action = YANGDynClass(base=RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'DROP': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'oc-acl:REJECT': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'ACCEPT': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'REJECT': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'oc-acl:ACCEPT': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'oc-acl:DROP': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}},), is_leaf=True, yang_name="forwarding-action", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=False) - self.__log_action = YANGDynClass(base=RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'LOG_SYSLOG': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'oc-acl:LOG_SYSLOG': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'LOG_NONE': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'oc-acl:LOG_NONE': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}},), default=str("LOG_NONE"), is_leaf=True, yang_name="log-action", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=False) + self.__forwarding_action = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'DROP': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'oc-acl:REJECT': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'ACCEPT': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'REJECT': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'oc-acl:ACCEPT': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'oc-acl:DROP': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}},), is_leaf=True, yang_name="forwarding-action", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=False) + self.__log_action = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'LOG_SYSLOG': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'oc-acl:LOG_SYSLOG': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'LOG_NONE': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'oc-acl:LOG_NONE': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}},), default=six.text_type("LOG_NONE"), is_leaf=True, yang_name="log-action", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=False) load = kwargs.pop("load", None) if args: @@ -3343,7 +3486,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return ['acl', 'acl-sets', 'acl-set', 'acl-entries', 'acl-entry', 'actions', 'state'] + return [u'acl', u'acl-sets', u'acl-set', u'acl-entries', u'acl-entry', u'actions', u'state'] def _get_forwarding_action(self): """ @@ -3368,12 +3511,12 @@ def _set_forwarding_action(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'DROP': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'oc-acl:REJECT': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'ACCEPT': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'REJECT': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'oc-acl:ACCEPT': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'oc-acl:DROP': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}},), is_leaf=True, yang_name="forwarding-action", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=False) + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'DROP': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'oc-acl:REJECT': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'ACCEPT': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'REJECT': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'oc-acl:ACCEPT': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'oc-acl:DROP': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}},), is_leaf=True, yang_name="forwarding-action", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """forwarding_action must be of a type compatible with identityref""", 'defined-type': "openconfig-acl:identityref", - 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'DROP': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'oc-acl:REJECT': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'ACCEPT': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'REJECT': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'oc-acl:ACCEPT': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'oc-acl:DROP': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}},), is_leaf=True, yang_name="forwarding-action", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=False)""", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'DROP': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'oc-acl:REJECT': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'ACCEPT': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'REJECT': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'oc-acl:ACCEPT': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'oc-acl:DROP': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}},), is_leaf=True, yang_name="forwarding-action", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=False)""", }) self.__forwarding_action = t @@ -3381,7 +3524,7 @@ def _set_forwarding_action(self, v, load=False): self._set() def _unset_forwarding_action(self): - self.__forwarding_action = YANGDynClass(base=RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'DROP': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'oc-acl:REJECT': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'ACCEPT': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'REJECT': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'oc-acl:ACCEPT': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'oc-acl:DROP': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}},), is_leaf=True, yang_name="forwarding-action", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=False) + self.__forwarding_action = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'DROP': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'oc-acl:REJECT': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'ACCEPT': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'REJECT': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'oc-acl:ACCEPT': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'oc-acl:DROP': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}},), is_leaf=True, yang_name="forwarding-action", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=False) def _get_log_action(self): @@ -3409,12 +3552,12 @@ def _set_log_action(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'LOG_SYSLOG': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'oc-acl:LOG_SYSLOG': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'LOG_NONE': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'oc-acl:LOG_NONE': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}},), default=str("LOG_NONE"), is_leaf=True, yang_name="log-action", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=False) + t = YANGDynClass(v,base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'LOG_SYSLOG': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'oc-acl:LOG_SYSLOG': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'LOG_NONE': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'oc-acl:LOG_NONE': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}},), default=six.text_type("LOG_NONE"), is_leaf=True, yang_name="log-action", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """log_action must be of a type compatible with identityref""", 'defined-type': "openconfig-acl:identityref", - 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u'LOG_SYSLOG': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'oc-acl:LOG_SYSLOG': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'LOG_NONE': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}, u'oc-acl:LOG_NONE': {'@namespace': u'http://openconfig.net/yang/acl', '@module': u'openconfig-acl'}},), default=unicode("LOG_NONE"), is_leaf=True, yang_name="log-action", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=False)""", + 'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'LOG_SYSLOG': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'oc-acl:LOG_SYSLOG': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'LOG_NONE': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'oc-acl:LOG_NONE': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}},), default=six.text_type("LOG_NONE"), is_leaf=True, yang_name="log-action", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=False)""", }) self.__log_action = t @@ -3422,13 +3565,13 @@ def _set_log_action(self, v, load=False): self._set() def _unset_log_action(self): - self.__log_action = YANGDynClass(base=RestrictedClassType(base_type=str, restriction_type="dict_key", restriction_arg={'LOG_SYSLOG': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'oc-acl:LOG_SYSLOG': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'LOG_NONE': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}, 'oc-acl:LOG_NONE': {'@namespace': 'http://openconfig.net/yang/acl', '@module': 'openconfig-acl'}},), default=str("LOG_NONE"), is_leaf=True, yang_name="log-action", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=False) + self.__log_action = YANGDynClass(base=RestrictedClassType(base_type=six.text_type, restriction_type="dict_key", restriction_arg={u'LOG_SYSLOG': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'oc-acl:LOG_SYSLOG': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'LOG_NONE': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}, u'oc-acl:LOG_NONE': {u'@namespace': u'http://openconfig.net/yang/acl', u'@module': u'openconfig-acl'}},), default=six.text_type("LOG_NONE"), is_leaf=True, yang_name="log-action", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='identityref', is_config=False) - forwarding_action = builtins.property(_get_forwarding_action) - log_action = builtins.property(_get_log_action) + forwarding_action = __builtin__.property(_get_forwarding_action) + log_action = __builtin__.property(_get_log_action) - _pyangbind_elements = {'forwarding_action': forwarding_action, 'log_action': log_action, } + _pyangbind_elements = OrderedDict([('forwarding_action', forwarding_action), ('log_action', log_action), ]) class yc_actions_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_actions(PybindBase): @@ -3441,12 +3584,16 @@ class yc_actions_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_acti YANG Description: Enclosing container for list of ACL actions associated with an entry """ - __slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_extmethods', '__config','__state',) + __slots__ = ('_path_helper', '_extmethods', '__config','__state',) + + _yang_name = 'actions' + + _pybind_generated_by = 'container' def __init__(self, *args, **kwargs): - self._yang_name = 'actions' - self._pybind_generated_by = 'container' + self._path_helper = False + self._extmethods = False self.__state = YANGDynClass(base=yc_state_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_actions_state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) self.__config = YANGDynClass(base=yc_config_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_actions_config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) @@ -3476,7 +3623,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return ['acl', 'acl-sets', 'acl-set', 'acl-entries', 'acl-entry', 'actions'] + return [u'acl', u'acl-sets', u'acl-set', u'acl-entries', u'acl-entry', u'actions'] def _get_config(self): """ @@ -3551,11 +3698,224 @@ def _set_state(self, v, load=False): def _unset_state(self): self.__state = YANGDynClass(base=yc_state_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_actions_state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) - config = builtins.property(_get_config, _set_config) - state = builtins.property(_get_state, _set_state) + config = __builtin__.property(_get_config, _set_config) + state = __builtin__.property(_get_state, _set_state) + + + _pyangbind_elements = OrderedDict([('config', config), ('state', state), ]) + + +class yc_config_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_icmp_config(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-acl - based on the path /acl/acl-sets/acl-set/acl-entries/acl-entry/icmp/config. Each member element of + the container is represented as a class variable - with a specific + YANG type. + """ + __slots__ = ('_path_helper', '_extmethods', '__type','__code',) + + _yang_name = 'config' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__code = YANGDynClass(base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'null'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={u'range': [u'0..255']}),], is_leaf=True, yang_name="code", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='https://github.com/Azure/sonic-buildimage', defining_module='sonic-acl-extension', yang_type='icmp-code-type', is_config=True) + self.__type = YANGDynClass(base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'null'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={u'range': [u'0..255']}),], is_leaf=True, yang_name="type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='https://github.com/Azure/sonic-buildimage', defining_module='sonic-acl-extension', yang_type='icmp-type-type', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return [u'acl', u'acl-sets', u'acl-set', u'acl-entries', u'acl-entry', u'icmp', u'config'] + + def _get_type(self): + """ + Getter method for type, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/icmp/config/type (icmp-type-type) + + YANG Description: ICMP(V6) type. + """ + return self.__type + + def _set_type(self, v, load=False): + """ + Setter method for type, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/icmp/config/type (icmp-type-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_type is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_type() directly. + + YANG Description: ICMP(V6) type. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'null'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={u'range': [u'0..255']}),], is_leaf=True, yang_name="type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='https://github.com/Azure/sonic-buildimage', defining_module='sonic-acl-extension', yang_type='icmp-type-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """type must be of a type compatible with icmp-type-type""", + 'defined-type': "sonic-acl-extension:icmp-type-type", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'null'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={u'range': [u'0..255']}),], is_leaf=True, yang_name="type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='https://github.com/Azure/sonic-buildimage', defining_module='sonic-acl-extension', yang_type='icmp-type-type', is_config=True)""", + }) + + self.__type = t + if hasattr(self, '_set'): + self._set() + + def _unset_type(self): + self.__type = YANGDynClass(base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'null'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={u'range': [u'0..255']}),], is_leaf=True, yang_name="type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='https://github.com/Azure/sonic-buildimage', defining_module='sonic-acl-extension', yang_type='icmp-type-type', is_config=True) + + + def _get_code(self): + """ + Getter method for code, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/icmp/config/code (icmp-code-type) + + YANG Description: ICMP(V6) code. + """ + return self.__code + + def _set_code(self, v, load=False): + """ + Setter method for code, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/icmp/config/code (icmp-code-type) + If this variable is read-only (config: false) in the + source YANG file, then _set_code is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_code() directly. + + YANG Description: ICMP(V6) code. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'null'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={u'range': [u'0..255']}),], is_leaf=True, yang_name="code", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='https://github.com/Azure/sonic-buildimage', defining_module='sonic-acl-extension', yang_type='icmp-code-type', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """code must be of a type compatible with icmp-code-type""", + 'defined-type': "sonic-acl-extension:icmp-code-type", + 'generated-type': """YANGDynClass(base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'null'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={u'range': [u'0..255']}),], is_leaf=True, yang_name="code", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='https://github.com/Azure/sonic-buildimage', defining_module='sonic-acl-extension', yang_type='icmp-code-type', is_config=True)""", + }) + + self.__code = t + if hasattr(self, '_set'): + self._set() + + def _unset_code(self): + self.__code = YANGDynClass(base=[RestrictedClassType(base_type=six.text_type, restriction_dict={u'pattern': u'null'}),RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={u'range': [u'0..255']}),], is_leaf=True, yang_name="code", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='https://github.com/Azure/sonic-buildimage', defining_module='sonic-acl-extension', yang_type='icmp-code-type', is_config=True) + + type = __builtin__.property(_get_type, _set_type) + code = __builtin__.property(_get_code, _set_code) + + + _pyangbind_elements = OrderedDict([('type', type), ('code', code), ]) - _pyangbind_elements = {'config': config, 'state': state, } +class yc_icmp_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_icmp(PybindBase): + """ + This class was auto-generated by the PythonClass plugin for PYANG + from YANG module openconfig-acl - based on the path /acl/acl-sets/acl-set/acl-entries/acl-entry/icmp. Each member element of + the container is represented as a class variable - with a specific + YANG type. + """ + __slots__ = ('_path_helper', '_extmethods', '__config',) + + _yang_name = 'icmp' + + _pybind_generated_by = 'container' + + def __init__(self, *args, **kwargs): + + self._path_helper = False + + self._extmethods = False + self.__config = YANGDynClass(base=yc_config_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_icmp_config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='https://github.com/Azure/sonic-buildimage', defining_module='sonic-acl-extension', yang_type='container', is_config=True) + + load = kwargs.pop("load", None) + if args: + if len(args) > 1: + raise TypeError("cannot create a YANG container with >1 argument") + all_attr = True + for e in self._pyangbind_elements: + if not hasattr(args[0], e): + all_attr = False + break + if not all_attr: + raise ValueError("Supplied object did not have the correct attributes") + for e in self._pyangbind_elements: + nobj = getattr(args[0], e) + if nobj._changed() is False: + continue + setmethod = getattr(self, "_set_%s" % e) + if load is None: + setmethod(getattr(args[0], e)) + else: + setmethod(getattr(args[0], e), load=load) + + def _path(self): + if hasattr(self, "_parent"): + return self._parent._path()+[self._yang_name] + else: + return [u'acl', u'acl-sets', u'acl-set', u'acl-entries', u'acl-entry', u'icmp'] + + def _get_config(self): + """ + Getter method for config, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/icmp/config (container) + """ + return self.__config + + def _set_config(self, v, load=False): + """ + Setter method for config, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/icmp/config (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_config is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_config() directly. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=yc_config_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_icmp_config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='https://github.com/Azure/sonic-buildimage', defining_module='sonic-acl-extension', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """config must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=yc_config_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_icmp_config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='https://github.com/Azure/sonic-buildimage', defining_module='sonic-acl-extension', yang_type='container', is_config=True)""", + }) + + self.__config = t + if hasattr(self, '_set'): + self._set() + + def _unset_config(self): + self.__config = YANGDynClass(base=yc_config_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_icmp_config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='https://github.com/Azure/sonic-buildimage', defining_module='sonic-acl-extension', yang_type='container', is_config=True) + + config = __builtin__.property(_get_config, _set_config) + + + _pyangbind_elements = OrderedDict([('config', config), ]) class yc_acl_entry_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry(PybindBase): @@ -3567,19 +3927,24 @@ class yc_acl_entry_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry(Py YANG Description: List of ACL entries comprising an ACL set """ - __slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_extmethods', '__sequence_id','__config','__state','__l2','__ip','__transport','__input_interface','__actions',) + __slots__ = ('_path_helper', '_extmethods', '__sequence_id','__config','__state','__l2','__ip','__transport','__input_interface','__actions','__icmp',) + + _yang_name = 'acl-entry' + + _pybind_generated_by = 'container' def __init__(self, *args, **kwargs): - self._yang_name = 'acl-entry' - self._pybind_generated_by = 'container' + self._path_helper = False + self._extmethods = False self.__ip = YANGDynClass(base=yc_ip_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_ip, is_container='container', yang_name="ip", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) self.__input_interface = YANGDynClass(base=yc_input_interface_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_input_interface, is_container='container', yang_name="input-interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) self.__state = YANGDynClass(base=yc_state_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) self.__actions = YANGDynClass(base=yc_actions_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_actions, is_container='container', yang_name="actions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) - self.__sequence_id = YANGDynClass(base=str, is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) + self.__sequence_id = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) self.__l2 = YANGDynClass(base=yc_l2_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_l2, is_container='container', yang_name="l2", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) + self.__icmp = YANGDynClass(base=yc_icmp_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_icmp, is_container='container', yang_name="icmp", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='https://github.com/Azure/sonic-buildimage', defining_module='sonic-acl-extension', yang_type='container', is_config=True) self.__config = YANGDynClass(base=yc_config_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) self.__transport = YANGDynClass(base=yc_transport_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_transport, is_container='container', yang_name="transport", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) @@ -3608,7 +3973,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return ['acl', 'acl-sets', 'acl-set', 'acl-entries', 'acl-entry'] + return [u'acl', u'acl-sets', u'acl-set', u'acl-entries', u'acl-entry'] def _get_sequence_id(self): """ @@ -3636,12 +4001,12 @@ def _set_sequence_id(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=str, is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """sequence_id must be of a type compatible with leafref""", 'defined-type': "leafref", - 'generated-type': """YANGDynClass(base=unicode, is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True)""", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True)""", }) self.__sequence_id = t @@ -3649,7 +4014,7 @@ def _set_sequence_id(self, v, load=False): self._set() def _unset_sequence_id(self): - self.__sequence_id = YANGDynClass(base=str, is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) + self.__sequence_id = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) def _get_config(self): @@ -3912,17 +4277,51 @@ def _set_actions(self, v, load=False): def _unset_actions(self): self.__actions = YANGDynClass(base=yc_actions_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_actions, is_container='container', yang_name="actions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) - sequence_id = builtins.property(_get_sequence_id, _set_sequence_id) - config = builtins.property(_get_config, _set_config) - state = builtins.property(_get_state, _set_state) - l2 = builtins.property(_get_l2, _set_l2) - ip = builtins.property(_get_ip, _set_ip) - transport = builtins.property(_get_transport, _set_transport) - input_interface = builtins.property(_get_input_interface, _set_input_interface) - actions = builtins.property(_get_actions, _set_actions) + + def _get_icmp(self): + """ + Getter method for icmp, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/icmp (container) + """ + return self.__icmp + + def _set_icmp(self, v, load=False): + """ + Setter method for icmp, mapped from YANG variable /acl/acl_sets/acl_set/acl_entries/acl_entry/icmp (container) + If this variable is read-only (config: false) in the + source YANG file, then _set_icmp is considered as a private + method. Backends looking to populate this variable should + do so via calling thisObj._set_icmp() directly. + """ + if hasattr(v, "_utype"): + v = v._utype(v) + try: + t = YANGDynClass(v,base=yc_icmp_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_icmp, is_container='container', yang_name="icmp", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='https://github.com/Azure/sonic-buildimage', defining_module='sonic-acl-extension', yang_type='container', is_config=True) + except (TypeError, ValueError): + raise ValueError({ + 'error-string': """icmp must be of a type compatible with container""", + 'defined-type': "container", + 'generated-type': """YANGDynClass(base=yc_icmp_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_icmp, is_container='container', yang_name="icmp", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='https://github.com/Azure/sonic-buildimage', defining_module='sonic-acl-extension', yang_type='container', is_config=True)""", + }) + + self.__icmp = t + if hasattr(self, '_set'): + self._set() + + def _unset_icmp(self): + self.__icmp = YANGDynClass(base=yc_icmp_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry_icmp, is_container='container', yang_name="icmp", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='https://github.com/Azure/sonic-buildimage', defining_module='sonic-acl-extension', yang_type='container', is_config=True) + + sequence_id = __builtin__.property(_get_sequence_id, _set_sequence_id) + config = __builtin__.property(_get_config, _set_config) + state = __builtin__.property(_get_state, _set_state) + l2 = __builtin__.property(_get_l2, _set_l2) + ip = __builtin__.property(_get_ip, _set_ip) + transport = __builtin__.property(_get_transport, _set_transport) + input_interface = __builtin__.property(_get_input_interface, _set_input_interface) + actions = __builtin__.property(_get_actions, _set_actions) + icmp = __builtin__.property(_get_icmp, _set_icmp) - _pyangbind_elements = {'sequence_id': sequence_id, 'config': config, 'state': state, 'l2': l2, 'ip': ip, 'transport': transport, 'input_interface': input_interface, 'actions': actions, } + _pyangbind_elements = OrderedDict([('sequence_id', sequence_id), ('config', config), ('state', state), ('l2', l2), ('ip', ip), ('transport', transport), ('input_interface', input_interface), ('actions', actions), ('icmp', icmp), ]) class yc_acl_entries_openconfig_acl__acl_acl_sets_acl_set_acl_entries(PybindBase): @@ -3934,12 +4333,16 @@ class yc_acl_entries_openconfig_acl__acl_acl_sets_acl_set_acl_entries(PybindBase YANG Description: Access list entries container """ - __slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_extmethods', '__acl_entry',) + __slots__ = ('_path_helper', '_extmethods', '__acl_entry',) + + _yang_name = 'acl-entries' + + _pybind_generated_by = 'container' def __init__(self, *args, **kwargs): - self._yang_name = 'acl-entries' - self._pybind_generated_by = 'container' + self._path_helper = False + self._extmethods = False self.__acl_entry = YANGDynClass(base=YANGListType("sequence_id",yc_acl_entry_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry, yang_name="acl-entry", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='sequence-id', extensions=None), is_container='list', yang_name="acl-entry", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='list', is_config=True) @@ -3968,7 +4371,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return ['acl', 'acl-sets', 'acl-set', 'acl-entries'] + return [u'acl', u'acl-sets', u'acl-set', u'acl-entries'] def _get_acl_entry(self): """ @@ -4006,10 +4409,10 @@ def _set_acl_entry(self, v, load=False): def _unset_acl_entry(self): self.__acl_entry = YANGDynClass(base=YANGListType("sequence_id",yc_acl_entry_openconfig_acl__acl_acl_sets_acl_set_acl_entries_acl_entry, yang_name="acl-entry", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='sequence-id', extensions=None), is_container='list', yang_name="acl-entry", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='list', is_config=True) - acl_entry = builtins.property(_get_acl_entry, _set_acl_entry) + acl_entry = __builtin__.property(_get_acl_entry, _set_acl_entry) - _pyangbind_elements = {'acl_entry': acl_entry, } + _pyangbind_elements = OrderedDict([('acl_entry', acl_entry), ]) class yc_acl_set_openconfig_acl__acl_acl_sets_acl_set(PybindBase): @@ -4022,16 +4425,20 @@ class yc_acl_set_openconfig_acl__acl_acl_sets_acl_set(PybindBase): YANG Description: List of ACL sets, each comprising of a list of ACL entries """ - __slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_extmethods', '__name','__config','__state','__acl_entries',) + __slots__ = ('_path_helper', '_extmethods', '__name','__config','__state','__acl_entries',) + + _yang_name = 'acl-set' + + _pybind_generated_by = 'container' def __init__(self, *args, **kwargs): - self._yang_name = 'acl-set' - self._pybind_generated_by = 'container' + self._path_helper = False + self._extmethods = False self.__state = YANGDynClass(base=yc_state_openconfig_acl__acl_acl_sets_acl_set_state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) self.__config = YANGDynClass(base=yc_config_openconfig_acl__acl_acl_sets_acl_set_config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) - self.__name = YANGDynClass(base=str, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) self.__acl_entries = YANGDynClass(base=yc_acl_entries_openconfig_acl__acl_acl_sets_acl_set_acl_entries, is_container='container', yang_name="acl-entries", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) load = kwargs.pop("load", None) @@ -4059,7 +4466,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return ['acl', 'acl-sets', 'acl-set'] + return [u'acl', u'acl-sets', u'acl-set'] def _get_name(self): """ @@ -4087,12 +4494,12 @@ def _set_name(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=str, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """name must be of a type compatible with leafref""", 'defined-type': "leafref", - 'generated-type': """YANGDynClass(base=unicode, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True)""", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True)""", }) self.__name = t @@ -4100,7 +4507,7 @@ def _set_name(self, v, load=False): self._set() def _unset_name(self): - self.__name = YANGDynClass(base=str, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) + self.__name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) def _get_config(self): @@ -4213,13 +4620,13 @@ def _set_acl_entries(self, v, load=False): def _unset_acl_entries(self): self.__acl_entries = YANGDynClass(base=yc_acl_entries_openconfig_acl__acl_acl_sets_acl_set_acl_entries, is_container='container', yang_name="acl-entries", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) - name = builtins.property(_get_name, _set_name) - config = builtins.property(_get_config, _set_config) - state = builtins.property(_get_state, _set_state) - acl_entries = builtins.property(_get_acl_entries, _set_acl_entries) + name = __builtin__.property(_get_name, _set_name) + config = __builtin__.property(_get_config, _set_config) + state = __builtin__.property(_get_state, _set_state) + acl_entries = __builtin__.property(_get_acl_entries, _set_acl_entries) - _pyangbind_elements = {'name': name, 'config': config, 'state': state, 'acl_entries': acl_entries, } + _pyangbind_elements = OrderedDict([('name', name), ('config', config), ('state', state), ('acl_entries', acl_entries), ]) class yc_acl_sets_openconfig_acl__acl_acl_sets(PybindBase): @@ -4231,12 +4638,16 @@ class yc_acl_sets_openconfig_acl__acl_acl_sets(PybindBase): YANG Description: Access list entries variables enclosing container """ - __slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_extmethods', '__acl_set',) + __slots__ = ('_path_helper', '_extmethods', '__acl_set',) + + _yang_name = 'acl-sets' + + _pybind_generated_by = 'container' def __init__(self, *args, **kwargs): - self._yang_name = 'acl-sets' - self._pybind_generated_by = 'container' + self._path_helper = False + self._extmethods = False self.__acl_set = YANGDynClass(base=YANGListType("name",yc_acl_set_openconfig_acl__acl_acl_sets_acl_set, yang_name="acl-set", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="acl-set", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='list', is_config=True) @@ -4265,7 +4676,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return ['acl', 'acl-sets'] + return [u'acl', u'acl-sets'] def _get_acl_set(self): """ @@ -4305,10 +4716,10 @@ def _set_acl_set(self, v, load=False): def _unset_acl_set(self): self.__acl_set = YANGDynClass(base=YANGListType("name",yc_acl_set_openconfig_acl__acl_acl_sets_acl_set, yang_name="acl-set", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='name', extensions=None), is_container='list', yang_name="acl-set", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='list', is_config=True) - acl_set = builtins.property(_get_acl_set, _set_acl_set) + acl_set = __builtin__.property(_get_acl_set, _set_acl_set) - _pyangbind_elements = {'acl_set': acl_set, } + _pyangbind_elements = OrderedDict([('acl_set', acl_set), ]) class yc_config_openconfig_acl__acl_interfaces_interface_config(PybindBase): @@ -4320,14 +4731,18 @@ class yc_config_openconfig_acl__acl_interfaces_interface_config(PybindBase): YANG Description: Configuration for ACL per-interface data """ - __slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_extmethods', '__id',) + __slots__ = ('_path_helper', '_extmethods', '__id',) + + _yang_name = 'config' + + _pybind_generated_by = 'container' def __init__(self, *args, **kwargs): - self._yang_name = 'config' - self._pybind_generated_by = 'container' + self._path_helper = False + self._extmethods = False - self.__id = YANGDynClass(base=str, is_leaf=True, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-if:interface-id', is_config=True) + self.__id = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-if:interface-id', is_config=True) load = kwargs.pop("load", None) if args: @@ -4354,7 +4769,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return ['acl', 'interfaces', 'interface', 'config'] + return [u'acl', u'interfaces', u'interface', u'config'] def _get_id(self): """ @@ -4379,12 +4794,12 @@ def _set_id(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=str, is_leaf=True, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-if:interface-id', is_config=True) + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-if:interface-id', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """id must be of a type compatible with oc-if:interface-id""", 'defined-type': "oc-if:interface-id", - 'generated-type': """YANGDynClass(base=unicode, is_leaf=True, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-if:interface-id', is_config=True)""", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-if:interface-id', is_config=True)""", }) self.__id = t @@ -4392,12 +4807,12 @@ def _set_id(self, v, load=False): self._set() def _unset_id(self): - self.__id = YANGDynClass(base=str, is_leaf=True, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-if:interface-id', is_config=True) + self.__id = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-if:interface-id', is_config=True) - id = builtins.property(_get_id, _set_id) + id = __builtin__.property(_get_id, _set_id) - _pyangbind_elements = {'id': id, } + _pyangbind_elements = OrderedDict([('id', id), ]) class yc_state_openconfig_acl__acl_interfaces_interface_state(PybindBase): @@ -4409,14 +4824,18 @@ class yc_state_openconfig_acl__acl_interfaces_interface_state(PybindBase): YANG Description: Operational state for ACL per-interface data """ - __slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_extmethods', '__id',) + __slots__ = ('_path_helper', '_extmethods', '__id',) + + _yang_name = 'state' + + _pybind_generated_by = 'container' def __init__(self, *args, **kwargs): - self._yang_name = 'state' - self._pybind_generated_by = 'container' + self._path_helper = False + self._extmethods = False - self.__id = YANGDynClass(base=str, is_leaf=True, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-if:interface-id', is_config=False) + self.__id = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-if:interface-id', is_config=False) load = kwargs.pop("load", None) if args: @@ -4443,7 +4862,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return ['acl', 'interfaces', 'interface', 'state'] + return [u'acl', u'interfaces', u'interface', u'state'] def _get_id(self): """ @@ -4468,12 +4887,12 @@ def _set_id(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=str, is_leaf=True, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-if:interface-id', is_config=False) + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-if:interface-id', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """id must be of a type compatible with oc-if:interface-id""", 'defined-type': "oc-if:interface-id", - 'generated-type': """YANGDynClass(base=unicode, is_leaf=True, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-if:interface-id', is_config=False)""", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-if:interface-id', is_config=False)""", }) self.__id = t @@ -4481,12 +4900,12 @@ def _set_id(self, v, load=False): self._set() def _unset_id(self): - self.__id = YANGDynClass(base=str, is_leaf=True, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-if:interface-id', is_config=False) + self.__id = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='oc-if:interface-id', is_config=False) - id = builtins.property(_get_id) + id = __builtin__.property(_get_id) - _pyangbind_elements = {'id': id, } + _pyangbind_elements = OrderedDict([('id', id), ]) class yc_config_openconfig_acl__acl_interfaces_interface_interface_ref_config(PybindBase): @@ -4498,15 +4917,19 @@ class yc_config_openconfig_acl__acl_interfaces_interface_interface_ref_config(Py YANG Description: Configured reference to interface / subinterface """ - __slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_extmethods', '__interface','__subinterface',) + __slots__ = ('_path_helper', '_extmethods', '__interface','__subinterface',) + + _yang_name = 'config' + + _pybind_generated_by = 'container' def __init__(self, *args, **kwargs): - self._yang_name = 'config' - self._pybind_generated_by = 'container' + self._path_helper = False + self._extmethods = False - self.__interface = YANGDynClass(base=str, is_leaf=True, yang_name="interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) - self.__subinterface = YANGDynClass(base=str, is_leaf=True, yang_name="subinterface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) + self.__interface = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) + self.__subinterface = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="subinterface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) load = kwargs.pop("load", None) if args: @@ -4533,7 +4956,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return ['acl', 'interfaces', 'interface', 'interface-ref', 'config'] + return [u'acl', u'interfaces', u'interface', u'interface-ref', u'config'] def _get_interface(self): """ @@ -4560,12 +4983,12 @@ def _set_interface(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=str, is_leaf=True, yang_name="interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """interface must be of a type compatible with leafref""", 'defined-type': "leafref", - 'generated-type': """YANGDynClass(base=unicode, is_leaf=True, yang_name="interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True)""", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True)""", }) self.__interface = t @@ -4573,7 +4996,7 @@ def _set_interface(self, v, load=False): self._set() def _unset_interface(self): - self.__interface = YANGDynClass(base=str, is_leaf=True, yang_name="interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) + self.__interface = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) def _get_subinterface(self): @@ -4603,12 +5026,12 @@ def _set_subinterface(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=str, is_leaf=True, yang_name="subinterface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="subinterface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """subinterface must be of a type compatible with leafref""", 'defined-type': "leafref", - 'generated-type': """YANGDynClass(base=unicode, is_leaf=True, yang_name="subinterface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True)""", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="subinterface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True)""", }) self.__subinterface = t @@ -4616,13 +5039,13 @@ def _set_subinterface(self, v, load=False): self._set() def _unset_subinterface(self): - self.__subinterface = YANGDynClass(base=str, is_leaf=True, yang_name="subinterface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) + self.__subinterface = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="subinterface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) - interface = builtins.property(_get_interface, _set_interface) - subinterface = builtins.property(_get_subinterface, _set_subinterface) + interface = __builtin__.property(_get_interface, _set_interface) + subinterface = __builtin__.property(_get_subinterface, _set_subinterface) - _pyangbind_elements = {'interface': interface, 'subinterface': subinterface, } + _pyangbind_elements = OrderedDict([('interface', interface), ('subinterface', subinterface), ]) class yc_state_openconfig_acl__acl_interfaces_interface_interface_ref_state(PybindBase): @@ -4634,15 +5057,19 @@ class yc_state_openconfig_acl__acl_interfaces_interface_interface_ref_state(Pybi YANG Description: Operational state for interface-ref """ - __slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_extmethods', '__interface','__subinterface',) + __slots__ = ('_path_helper', '_extmethods', '__interface','__subinterface',) + + _yang_name = 'state' + + _pybind_generated_by = 'container' def __init__(self, *args, **kwargs): - self._yang_name = 'state' - self._pybind_generated_by = 'container' + self._path_helper = False + self._extmethods = False - self.__interface = YANGDynClass(base=str, is_leaf=True, yang_name="interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) - self.__subinterface = YANGDynClass(base=str, is_leaf=True, yang_name="subinterface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) + self.__interface = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) + self.__subinterface = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="subinterface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) load = kwargs.pop("load", None) if args: @@ -4669,7 +5096,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return ['acl', 'interfaces', 'interface', 'interface-ref', 'state'] + return [u'acl', u'interfaces', u'interface', u'interface-ref', u'state'] def _get_interface(self): """ @@ -4696,12 +5123,12 @@ def _set_interface(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=str, is_leaf=True, yang_name="interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """interface must be of a type compatible with leafref""", 'defined-type': "leafref", - 'generated-type': """YANGDynClass(base=unicode, is_leaf=True, yang_name="interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False)""", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False)""", }) self.__interface = t @@ -4709,7 +5136,7 @@ def _set_interface(self, v, load=False): self._set() def _unset_interface(self): - self.__interface = YANGDynClass(base=str, is_leaf=True, yang_name="interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) + self.__interface = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) def _get_subinterface(self): @@ -4739,12 +5166,12 @@ def _set_subinterface(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=str, is_leaf=True, yang_name="subinterface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="subinterface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """subinterface must be of a type compatible with leafref""", 'defined-type': "leafref", - 'generated-type': """YANGDynClass(base=unicode, is_leaf=True, yang_name="subinterface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False)""", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="subinterface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False)""", }) self.__subinterface = t @@ -4752,13 +5179,13 @@ def _set_subinterface(self, v, load=False): self._set() def _unset_subinterface(self): - self.__subinterface = YANGDynClass(base=str, is_leaf=True, yang_name="subinterface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) + self.__subinterface = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="subinterface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) - interface = builtins.property(_get_interface) - subinterface = builtins.property(_get_subinterface) + interface = __builtin__.property(_get_interface) + subinterface = __builtin__.property(_get_subinterface) - _pyangbind_elements = {'interface': interface, 'subinterface': subinterface, } + _pyangbind_elements = OrderedDict([('interface', interface), ('subinterface', subinterface), ]) class yc_interface_ref_openconfig_acl__acl_interfaces_interface_interface_ref(PybindBase): @@ -4770,12 +5197,16 @@ class yc_interface_ref_openconfig_acl__acl_interfaces_interface_interface_ref(Py YANG Description: Reference to an interface or subinterface """ - __slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_extmethods', '__config','__state',) + __slots__ = ('_path_helper', '_extmethods', '__config','__state',) + + _yang_name = 'interface-ref' + + _pybind_generated_by = 'container' def __init__(self, *args, **kwargs): - self._yang_name = 'interface-ref' - self._pybind_generated_by = 'container' + self._path_helper = False + self._extmethods = False self.__state = YANGDynClass(base=yc_state_openconfig_acl__acl_interfaces_interface_interface_ref_state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) self.__config = YANGDynClass(base=yc_config_openconfig_acl__acl_interfaces_interface_interface_ref_config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) @@ -4805,7 +5236,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return ['acl', 'interfaces', 'interface', 'interface-ref'] + return [u'acl', u'interfaces', u'interface', u'interface-ref'] def _get_config(self): """ @@ -4880,11 +5311,11 @@ def _set_state(self, v, load=False): def _unset_state(self): self.__state = YANGDynClass(base=yc_state_openconfig_acl__acl_interfaces_interface_interface_ref_state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) - config = builtins.property(_get_config, _set_config) - state = builtins.property(_get_state, _set_state) + config = __builtin__.property(_get_config, _set_config) + state = __builtin__.property(_get_state, _set_state) - _pyangbind_elements = {'config': config, 'state': state, } + _pyangbind_elements = OrderedDict([('config', config), ('state', state), ]) class yc_config_openconfig_acl__acl_interfaces_interface_ingress_acl_sets_ingress_acl_set_config(PybindBase): @@ -4896,14 +5327,18 @@ class yc_config_openconfig_acl__acl_interfaces_interface_ingress_acl_sets_ingres YANG Description: Configuration data """ - __slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_extmethods', '__set_name',) + __slots__ = ('_path_helper', '_extmethods', '__set_name',) + + _yang_name = 'config' + + _pybind_generated_by = 'container' def __init__(self, *args, **kwargs): - self._yang_name = 'config' - self._pybind_generated_by = 'container' + self._path_helper = False + self._extmethods = False - self.__set_name = YANGDynClass(base=str, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) + self.__set_name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) load = kwargs.pop("load", None) if args: @@ -4930,7 +5365,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return ['acl', 'interfaces', 'interface', 'ingress-acl-sets', 'ingress-acl-set', 'config'] + return [u'acl', u'interfaces', u'interface', u'ingress-acl-sets', u'ingress-acl-set', u'config'] def _get_set_name(self): """ @@ -4953,12 +5388,12 @@ def _set_set_name(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=str, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """set_name must be of a type compatible with leafref""", 'defined-type': "leafref", - 'generated-type': """YANGDynClass(base=unicode, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True)""", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True)""", }) self.__set_name = t @@ -4966,12 +5401,12 @@ def _set_set_name(self, v, load=False): self._set() def _unset_set_name(self): - self.__set_name = YANGDynClass(base=str, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) + self.__set_name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) - set_name = builtins.property(_get_set_name, _set_set_name) + set_name = __builtin__.property(_get_set_name, _set_set_name) - _pyangbind_elements = {'set_name': set_name, } + _pyangbind_elements = OrderedDict([('set_name', set_name), ]) class yc_state_openconfig_acl__acl_interfaces_interface_ingress_acl_sets_ingress_acl_set_state(PybindBase): @@ -4983,14 +5418,18 @@ class yc_state_openconfig_acl__acl_interfaces_interface_ingress_acl_sets_ingress YANG Description: Operational state data for interface ingress ACLs """ - __slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_extmethods', '__set_name',) + __slots__ = ('_path_helper', '_extmethods', '__set_name',) + + _yang_name = 'state' + + _pybind_generated_by = 'container' def __init__(self, *args, **kwargs): - self._yang_name = 'state' - self._pybind_generated_by = 'container' + self._path_helper = False + self._extmethods = False - self.__set_name = YANGDynClass(base=str, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) + self.__set_name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) load = kwargs.pop("load", None) if args: @@ -5017,7 +5456,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return ['acl', 'interfaces', 'interface', 'ingress-acl-sets', 'ingress-acl-set', 'state'] + return [u'acl', u'interfaces', u'interface', u'ingress-acl-sets', u'ingress-acl-set', u'state'] def _get_set_name(self): """ @@ -5040,12 +5479,12 @@ def _set_set_name(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=str, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """set_name must be of a type compatible with leafref""", 'defined-type': "leafref", - 'generated-type': """YANGDynClass(base=unicode, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False)""", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False)""", }) self.__set_name = t @@ -5053,12 +5492,12 @@ def _set_set_name(self, v, load=False): self._set() def _unset_set_name(self): - self.__set_name = YANGDynClass(base=str, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) + self.__set_name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) - set_name = builtins.property(_get_set_name) + set_name = __builtin__.property(_get_set_name) - _pyangbind_elements = {'set_name': set_name, } + _pyangbind_elements = OrderedDict([('set_name', set_name), ]) class yc_state_openconfig_acl__acl_interfaces_interface_ingress_acl_sets_ingress_acl_set_acl_entries_acl_entry_state(PybindBase): @@ -5070,16 +5509,20 @@ class yc_state_openconfig_acl__acl_interfaces_interface_ingress_acl_sets_ingress YANG Description: Operational state data for per-interface ACL entries """ - __slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_extmethods', '__sequence_id','__matched_packets','__matched_octets',) + __slots__ = ('_path_helper', '_extmethods', '__sequence_id','__matched_packets','__matched_octets',) + + _yang_name = 'state' + + _pybind_generated_by = 'container' def __init__(self, *args, **kwargs): - self._yang_name = 'state' - self._pybind_generated_by = 'container' + self._path_helper = False + self._extmethods = False - self.__sequence_id = YANGDynClass(base=str, is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) - self.__matched_packets = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="matched-packets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:counter64', is_config=False) - self.__matched_octets = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="matched-octets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:counter64', is_config=False) + self.__sequence_id = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) + self.__matched_packets = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="matched-packets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:counter64', is_config=False) + self.__matched_octets = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="matched-octets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:counter64', is_config=False) load = kwargs.pop("load", None) if args: @@ -5106,7 +5549,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return ['acl', 'interfaces', 'interface', 'ingress-acl-sets', 'ingress-acl-set', 'acl-entries', 'acl-entry', 'state'] + return [u'acl', u'interfaces', u'interface', u'ingress-acl-sets', u'ingress-acl-set', u'acl-entries', u'acl-entry', u'state'] def _get_sequence_id(self): """ @@ -5131,12 +5574,12 @@ def _set_sequence_id(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=str, is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """sequence_id must be of a type compatible with leafref""", 'defined-type': "leafref", - 'generated-type': """YANGDynClass(base=unicode, is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False)""", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False)""", }) self.__sequence_id = t @@ -5144,7 +5587,7 @@ def _set_sequence_id(self, v, load=False): self._set() def _unset_sequence_id(self): - self.__sequence_id = YANGDynClass(base=str, is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) + self.__sequence_id = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) def _get_matched_packets(self): @@ -5194,7 +5637,7 @@ def _set_matched_packets(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="matched-packets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:counter64', is_config=False) + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="matched-packets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:counter64', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """matched_packets must be of a type compatible with yang:counter64""", @@ -5207,7 +5650,7 @@ def _set_matched_packets(self, v, load=False): self._set() def _unset_matched_packets(self): - self.__matched_packets = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="matched-packets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:counter64', is_config=False) + self.__matched_packets = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="matched-packets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:counter64', is_config=False) def _get_matched_octets(self): @@ -5257,7 +5700,7 @@ def _set_matched_octets(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="matched-octets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:counter64', is_config=False) + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="matched-octets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:counter64', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """matched_octets must be of a type compatible with yang:counter64""", @@ -5270,14 +5713,14 @@ def _set_matched_octets(self, v, load=False): self._set() def _unset_matched_octets(self): - self.__matched_octets = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="matched-octets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:counter64', is_config=False) + self.__matched_octets = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="matched-octets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:counter64', is_config=False) - sequence_id = builtins.property(_get_sequence_id) - matched_packets = builtins.property(_get_matched_packets) - matched_octets = builtins.property(_get_matched_octets) + sequence_id = __builtin__.property(_get_sequence_id) + matched_packets = __builtin__.property(_get_matched_packets) + matched_octets = __builtin__.property(_get_matched_octets) - _pyangbind_elements = {'sequence_id': sequence_id, 'matched_packets': matched_packets, 'matched_octets': matched_octets, } + _pyangbind_elements = OrderedDict([('sequence_id', sequence_id), ('matched_packets', matched_packets), ('matched_octets', matched_octets), ]) class yc_acl_entry_openconfig_acl__acl_interfaces_interface_ingress_acl_sets_ingress_acl_set_acl_entries_acl_entry(PybindBase): @@ -5289,14 +5732,18 @@ class yc_acl_entry_openconfig_acl__acl_interfaces_interface_ingress_acl_sets_ing YANG Description: List of ACL entries assigned to an interface """ - __slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_extmethods', '__sequence_id','__state',) + __slots__ = ('_path_helper', '_extmethods', '__sequence_id','__state',) + + _yang_name = 'acl-entry' + + _pybind_generated_by = 'container' def __init__(self, *args, **kwargs): - self._yang_name = 'acl-entry' - self._pybind_generated_by = 'container' + self._path_helper = False + self._extmethods = False - self.__sequence_id = YANGDynClass(base=str, is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) + self.__sequence_id = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) self.__state = YANGDynClass(base=yc_state_openconfig_acl__acl_interfaces_interface_ingress_acl_sets_ingress_acl_set_acl_entries_acl_entry_state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=False) load = kwargs.pop("load", None) @@ -5324,7 +5771,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return ['acl', 'interfaces', 'interface', 'ingress-acl-sets', 'ingress-acl-set', 'acl-entries', 'acl-entry'] + return [u'acl', u'interfaces', u'interface', u'ingress-acl-sets', u'ingress-acl-set', u'acl-entries', u'acl-entry'] def _get_sequence_id(self): """ @@ -5352,12 +5799,12 @@ def _set_sequence_id(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=str, is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """sequence_id must be of a type compatible with leafref""", 'defined-type': "leafref", - 'generated-type': """YANGDynClass(base=unicode, is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False)""", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False)""", }) self.__sequence_id = t @@ -5365,7 +5812,7 @@ def _set_sequence_id(self, v, load=False): self._set() def _unset_sequence_id(self): - self.__sequence_id = YANGDynClass(base=str, is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) + self.__sequence_id = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) def _get_state(self): @@ -5404,11 +5851,11 @@ def _set_state(self, v, load=False): def _unset_state(self): self.__state = YANGDynClass(base=yc_state_openconfig_acl__acl_interfaces_interface_ingress_acl_sets_ingress_acl_set_acl_entries_acl_entry_state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=False) - sequence_id = builtins.property(_get_sequence_id) - state = builtins.property(_get_state) + sequence_id = __builtin__.property(_get_sequence_id) + state = __builtin__.property(_get_state) - _pyangbind_elements = {'sequence_id': sequence_id, 'state': state, } + _pyangbind_elements = OrderedDict([('sequence_id', sequence_id), ('state', state), ]) class yc_acl_entries_openconfig_acl__acl_interfaces_interface_ingress_acl_sets_ingress_acl_set_acl_entries(PybindBase): @@ -5420,12 +5867,16 @@ class yc_acl_entries_openconfig_acl__acl_interfaces_interface_ingress_acl_sets_i YANG Description: Enclosing container for list of references to ACLs """ - __slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_extmethods', '__acl_entry',) + __slots__ = ('_path_helper', '_extmethods', '__acl_entry',) + + _yang_name = 'acl-entries' + + _pybind_generated_by = 'container' def __init__(self, *args, **kwargs): - self._yang_name = 'acl-entries' - self._pybind_generated_by = 'container' + self._path_helper = False + self._extmethods = False self.__acl_entry = YANGDynClass(base=YANGListType("sequence_id",yc_acl_entry_openconfig_acl__acl_interfaces_interface_ingress_acl_sets_ingress_acl_set_acl_entries_acl_entry, yang_name="acl-entry", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='sequence-id', extensions=None), is_container='list', yang_name="acl-entry", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='list', is_config=False) @@ -5454,7 +5905,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return ['acl', 'interfaces', 'interface', 'ingress-acl-sets', 'ingress-acl-set', 'acl-entries'] + return [u'acl', u'interfaces', u'interface', u'ingress-acl-sets', u'ingress-acl-set', u'acl-entries'] def _get_acl_entry(self): """ @@ -5492,10 +5943,10 @@ def _set_acl_entry(self, v, load=False): def _unset_acl_entry(self): self.__acl_entry = YANGDynClass(base=YANGListType("sequence_id",yc_acl_entry_openconfig_acl__acl_interfaces_interface_ingress_acl_sets_ingress_acl_set_acl_entries_acl_entry, yang_name="acl-entry", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='sequence-id', extensions=None), is_container='list', yang_name="acl-entry", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='list', is_config=False) - acl_entry = builtins.property(_get_acl_entry) + acl_entry = __builtin__.property(_get_acl_entry) - _pyangbind_elements = {'acl_entry': acl_entry, } + _pyangbind_elements = OrderedDict([('acl_entry', acl_entry), ]) class yc_ingress_acl_set_openconfig_acl__acl_interfaces_interface_ingress_acl_sets_ingress_acl_set(PybindBase): @@ -5507,14 +5958,18 @@ class yc_ingress_acl_set_openconfig_acl__acl_interfaces_interface_ingress_acl_se YANG Description: List of ingress ACLs on the interface """ - __slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_extmethods', '__set_name','__config','__state','__acl_entries',) + __slots__ = ('_path_helper', '_extmethods', '__set_name','__config','__state','__acl_entries',) + + _yang_name = 'ingress-acl-set' + + _pybind_generated_by = 'container' def __init__(self, *args, **kwargs): - self._yang_name = 'ingress-acl-set' - self._pybind_generated_by = 'container' + self._path_helper = False + self._extmethods = False - self.__set_name = YANGDynClass(base=str, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) + self.__set_name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) self.__config = YANGDynClass(base=yc_config_openconfig_acl__acl_interfaces_interface_ingress_acl_sets_ingress_acl_set_config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) self.__state = YANGDynClass(base=yc_state_openconfig_acl__acl_interfaces_interface_ingress_acl_sets_ingress_acl_set_state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) self.__acl_entries = YANGDynClass(base=yc_acl_entries_openconfig_acl__acl_interfaces_interface_ingress_acl_sets_ingress_acl_set_acl_entries, is_container='container', yang_name="acl-entries", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) @@ -5544,7 +5999,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return ['acl', 'interfaces', 'interface', 'ingress-acl-sets', 'ingress-acl-set'] + return [u'acl', u'interfaces', u'interface', u'ingress-acl-sets', u'ingress-acl-set'] def _get_set_name(self): """ @@ -5572,12 +6027,12 @@ def _set_set_name(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=str, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """set_name must be of a type compatible with leafref""", 'defined-type': "leafref", - 'generated-type': """YANGDynClass(base=unicode, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True)""", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True)""", }) self.__set_name = t @@ -5585,7 +6040,7 @@ def _set_set_name(self, v, load=False): self._set() def _unset_set_name(self): - self.__set_name = YANGDynClass(base=str, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) + self.__set_name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) def _get_config(self): @@ -5698,13 +6153,13 @@ def _set_acl_entries(self, v, load=False): def _unset_acl_entries(self): self.__acl_entries = YANGDynClass(base=yc_acl_entries_openconfig_acl__acl_interfaces_interface_ingress_acl_sets_ingress_acl_set_acl_entries, is_container='container', yang_name="acl-entries", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) - set_name = builtins.property(_get_set_name, _set_set_name) - config = builtins.property(_get_config, _set_config) - state = builtins.property(_get_state, _set_state) - acl_entries = builtins.property(_get_acl_entries, _set_acl_entries) + set_name = __builtin__.property(_get_set_name, _set_set_name) + config = __builtin__.property(_get_config, _set_config) + state = __builtin__.property(_get_state, _set_state) + acl_entries = __builtin__.property(_get_acl_entries, _set_acl_entries) - _pyangbind_elements = {'set_name': set_name, 'config': config, 'state': state, 'acl_entries': acl_entries, } + _pyangbind_elements = OrderedDict([('set_name', set_name), ('config', config), ('state', state), ('acl_entries', acl_entries), ]) class yc_ingress_acl_sets_openconfig_acl__acl_interfaces_interface_ingress_acl_sets(PybindBase): @@ -5717,12 +6172,16 @@ class yc_ingress_acl_sets_openconfig_acl__acl_interfaces_interface_ingress_acl_s YANG Description: Enclosing container the list of ingress ACLs on the interface """ - __slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_extmethods', '__ingress_acl_set',) + __slots__ = ('_path_helper', '_extmethods', '__ingress_acl_set',) + + _yang_name = 'ingress-acl-sets' + + _pybind_generated_by = 'container' def __init__(self, *args, **kwargs): - self._yang_name = 'ingress-acl-sets' - self._pybind_generated_by = 'container' + self._path_helper = False + self._extmethods = False self.__ingress_acl_set = YANGDynClass(base=YANGListType("set_name",yc_ingress_acl_set_openconfig_acl__acl_interfaces_interface_ingress_acl_sets_ingress_acl_set, yang_name="ingress-acl-set", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='set-name', extensions=None), is_container='list', yang_name="ingress-acl-set", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='list', is_config=True) @@ -5751,7 +6210,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return ['acl', 'interfaces', 'interface', 'ingress-acl-sets'] + return [u'acl', u'interfaces', u'interface', u'ingress-acl-sets'] def _get_ingress_acl_set(self): """ @@ -5789,10 +6248,10 @@ def _set_ingress_acl_set(self, v, load=False): def _unset_ingress_acl_set(self): self.__ingress_acl_set = YANGDynClass(base=YANGListType("set_name",yc_ingress_acl_set_openconfig_acl__acl_interfaces_interface_ingress_acl_sets_ingress_acl_set, yang_name="ingress-acl-set", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='set-name', extensions=None), is_container='list', yang_name="ingress-acl-set", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='list', is_config=True) - ingress_acl_set = builtins.property(_get_ingress_acl_set, _set_ingress_acl_set) + ingress_acl_set = __builtin__.property(_get_ingress_acl_set, _set_ingress_acl_set) - _pyangbind_elements = {'ingress_acl_set': ingress_acl_set, } + _pyangbind_elements = OrderedDict([('ingress_acl_set', ingress_acl_set), ]) class yc_config_openconfig_acl__acl_interfaces_interface_egress_acl_sets_egress_acl_set_config(PybindBase): @@ -5804,14 +6263,18 @@ class yc_config_openconfig_acl__acl_interfaces_interface_egress_acl_sets_egress_ YANG Description: Configuration data """ - __slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_extmethods', '__set_name',) + __slots__ = ('_path_helper', '_extmethods', '__set_name',) + + _yang_name = 'config' + + _pybind_generated_by = 'container' def __init__(self, *args, **kwargs): - self._yang_name = 'config' - self._pybind_generated_by = 'container' + self._path_helper = False + self._extmethods = False - self.__set_name = YANGDynClass(base=str, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) + self.__set_name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) load = kwargs.pop("load", None) if args: @@ -5838,7 +6301,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return ['acl', 'interfaces', 'interface', 'egress-acl-sets', 'egress-acl-set', 'config'] + return [u'acl', u'interfaces', u'interface', u'egress-acl-sets', u'egress-acl-set', u'config'] def _get_set_name(self): """ @@ -5861,12 +6324,12 @@ def _set_set_name(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=str, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """set_name must be of a type compatible with leafref""", 'defined-type': "leafref", - 'generated-type': """YANGDynClass(base=unicode, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True)""", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True)""", }) self.__set_name = t @@ -5874,12 +6337,12 @@ def _set_set_name(self, v, load=False): self._set() def _unset_set_name(self): - self.__set_name = YANGDynClass(base=str, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) + self.__set_name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) - set_name = builtins.property(_get_set_name, _set_set_name) + set_name = __builtin__.property(_get_set_name, _set_set_name) - _pyangbind_elements = {'set_name': set_name, } + _pyangbind_elements = OrderedDict([('set_name', set_name), ]) class yc_state_openconfig_acl__acl_interfaces_interface_egress_acl_sets_egress_acl_set_state(PybindBase): @@ -5891,14 +6354,18 @@ class yc_state_openconfig_acl__acl_interfaces_interface_egress_acl_sets_egress_a YANG Description: Operational state data for interface egress ACLs """ - __slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_extmethods', '__set_name',) + __slots__ = ('_path_helper', '_extmethods', '__set_name',) + + _yang_name = 'state' + + _pybind_generated_by = 'container' def __init__(self, *args, **kwargs): - self._yang_name = 'state' - self._pybind_generated_by = 'container' + self._path_helper = False + self._extmethods = False - self.__set_name = YANGDynClass(base=str, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) + self.__set_name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) load = kwargs.pop("load", None) if args: @@ -5925,7 +6392,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return ['acl', 'interfaces', 'interface', 'egress-acl-sets', 'egress-acl-set', 'state'] + return [u'acl', u'interfaces', u'interface', u'egress-acl-sets', u'egress-acl-set', u'state'] def _get_set_name(self): """ @@ -5948,12 +6415,12 @@ def _set_set_name(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=str, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """set_name must be of a type compatible with leafref""", 'defined-type': "leafref", - 'generated-type': """YANGDynClass(base=unicode, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False)""", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False)""", }) self.__set_name = t @@ -5961,12 +6428,12 @@ def _set_set_name(self, v, load=False): self._set() def _unset_set_name(self): - self.__set_name = YANGDynClass(base=str, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) + self.__set_name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) - set_name = builtins.property(_get_set_name) + set_name = __builtin__.property(_get_set_name) - _pyangbind_elements = {'set_name': set_name, } + _pyangbind_elements = OrderedDict([('set_name', set_name), ]) class yc_state_openconfig_acl__acl_interfaces_interface_egress_acl_sets_egress_acl_set_acl_entries_acl_entry_state(PybindBase): @@ -5978,16 +6445,20 @@ class yc_state_openconfig_acl__acl_interfaces_interface_egress_acl_sets_egress_a YANG Description: Operational state data for per-interface ACL entries """ - __slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_extmethods', '__sequence_id','__matched_packets','__matched_octets',) + __slots__ = ('_path_helper', '_extmethods', '__sequence_id','__matched_packets','__matched_octets',) + + _yang_name = 'state' + + _pybind_generated_by = 'container' def __init__(self, *args, **kwargs): - self._yang_name = 'state' - self._pybind_generated_by = 'container' + self._path_helper = False + self._extmethods = False - self.__sequence_id = YANGDynClass(base=str, is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) - self.__matched_packets = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="matched-packets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:counter64', is_config=False) - self.__matched_octets = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="matched-octets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:counter64', is_config=False) + self.__sequence_id = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) + self.__matched_packets = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="matched-packets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:counter64', is_config=False) + self.__matched_octets = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="matched-octets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:counter64', is_config=False) load = kwargs.pop("load", None) if args: @@ -6014,7 +6485,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return ['acl', 'interfaces', 'interface', 'egress-acl-sets', 'egress-acl-set', 'acl-entries', 'acl-entry', 'state'] + return [u'acl', u'interfaces', u'interface', u'egress-acl-sets', u'egress-acl-set', u'acl-entries', u'acl-entry', u'state'] def _get_sequence_id(self): """ @@ -6039,12 +6510,12 @@ def _set_sequence_id(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=str, is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """sequence_id must be of a type compatible with leafref""", 'defined-type': "leafref", - 'generated-type': """YANGDynClass(base=unicode, is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False)""", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False)""", }) self.__sequence_id = t @@ -6052,7 +6523,7 @@ def _set_sequence_id(self, v, load=False): self._set() def _unset_sequence_id(self): - self.__sequence_id = YANGDynClass(base=str, is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) + self.__sequence_id = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) def _get_matched_packets(self): @@ -6102,7 +6573,7 @@ def _set_matched_packets(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="matched-packets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:counter64', is_config=False) + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="matched-packets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:counter64', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """matched_packets must be of a type compatible with yang:counter64""", @@ -6115,7 +6586,7 @@ def _set_matched_packets(self, v, load=False): self._set() def _unset_matched_packets(self): - self.__matched_packets = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="matched-packets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:counter64', is_config=False) + self.__matched_packets = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="matched-packets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:counter64', is_config=False) def _get_matched_octets(self): @@ -6165,7 +6636,7 @@ def _set_matched_octets(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="matched-octets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:counter64', is_config=False) + t = YANGDynClass(v,base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="matched-octets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:counter64', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """matched_octets must be of a type compatible with yang:counter64""", @@ -6178,14 +6649,14 @@ def _set_matched_octets(self, v, load=False): self._set() def _unset_matched_octets(self): - self.__matched_octets = YANGDynClass(base=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="matched-octets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:counter64', is_config=False) + self.__matched_octets = YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name="matched-octets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='yang:counter64', is_config=False) - sequence_id = builtins.property(_get_sequence_id) - matched_packets = builtins.property(_get_matched_packets) - matched_octets = builtins.property(_get_matched_octets) + sequence_id = __builtin__.property(_get_sequence_id) + matched_packets = __builtin__.property(_get_matched_packets) + matched_octets = __builtin__.property(_get_matched_octets) - _pyangbind_elements = {'sequence_id': sequence_id, 'matched_packets': matched_packets, 'matched_octets': matched_octets, } + _pyangbind_elements = OrderedDict([('sequence_id', sequence_id), ('matched_packets', matched_packets), ('matched_octets', matched_octets), ]) class yc_acl_entry_openconfig_acl__acl_interfaces_interface_egress_acl_sets_egress_acl_set_acl_entries_acl_entry(PybindBase): @@ -6197,14 +6668,18 @@ class yc_acl_entry_openconfig_acl__acl_interfaces_interface_egress_acl_sets_egre YANG Description: List of ACL entries assigned to an interface """ - __slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_extmethods', '__sequence_id','__state',) + __slots__ = ('_path_helper', '_extmethods', '__sequence_id','__state',) + + _yang_name = 'acl-entry' + + _pybind_generated_by = 'container' def __init__(self, *args, **kwargs): - self._yang_name = 'acl-entry' - self._pybind_generated_by = 'container' + self._path_helper = False + self._extmethods = False - self.__sequence_id = YANGDynClass(base=str, is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) + self.__sequence_id = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) self.__state = YANGDynClass(base=yc_state_openconfig_acl__acl_interfaces_interface_egress_acl_sets_egress_acl_set_acl_entries_acl_entry_state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=False) load = kwargs.pop("load", None) @@ -6232,7 +6707,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return ['acl', 'interfaces', 'interface', 'egress-acl-sets', 'egress-acl-set', 'acl-entries', 'acl-entry'] + return [u'acl', u'interfaces', u'interface', u'egress-acl-sets', u'egress-acl-set', u'acl-entries', u'acl-entry'] def _get_sequence_id(self): """ @@ -6260,12 +6735,12 @@ def _set_sequence_id(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=str, is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) except (TypeError, ValueError): raise ValueError({ 'error-string': """sequence_id must be of a type compatible with leafref""", 'defined-type': "leafref", - 'generated-type': """YANGDynClass(base=unicode, is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False)""", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False)""", }) self.__sequence_id = t @@ -6273,7 +6748,7 @@ def _set_sequence_id(self, v, load=False): self._set() def _unset_sequence_id(self): - self.__sequence_id = YANGDynClass(base=str, is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) + self.__sequence_id = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="sequence-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=False) def _get_state(self): @@ -6312,11 +6787,11 @@ def _set_state(self, v, load=False): def _unset_state(self): self.__state = YANGDynClass(base=yc_state_openconfig_acl__acl_interfaces_interface_egress_acl_sets_egress_acl_set_acl_entries_acl_entry_state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=False) - sequence_id = builtins.property(_get_sequence_id) - state = builtins.property(_get_state) + sequence_id = __builtin__.property(_get_sequence_id) + state = __builtin__.property(_get_state) - _pyangbind_elements = {'sequence_id': sequence_id, 'state': state, } + _pyangbind_elements = OrderedDict([('sequence_id', sequence_id), ('state', state), ]) class yc_acl_entries_openconfig_acl__acl_interfaces_interface_egress_acl_sets_egress_acl_set_acl_entries(PybindBase): @@ -6328,12 +6803,16 @@ class yc_acl_entries_openconfig_acl__acl_interfaces_interface_egress_acl_sets_eg YANG Description: Enclosing container for list of references to ACLs """ - __slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_extmethods', '__acl_entry',) + __slots__ = ('_path_helper', '_extmethods', '__acl_entry',) + + _yang_name = 'acl-entries' + + _pybind_generated_by = 'container' def __init__(self, *args, **kwargs): - self._yang_name = 'acl-entries' - self._pybind_generated_by = 'container' + self._path_helper = False + self._extmethods = False self.__acl_entry = YANGDynClass(base=YANGListType("sequence_id",yc_acl_entry_openconfig_acl__acl_interfaces_interface_egress_acl_sets_egress_acl_set_acl_entries_acl_entry, yang_name="acl-entry", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='sequence-id', extensions=None), is_container='list', yang_name="acl-entry", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='list', is_config=False) @@ -6362,7 +6841,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return ['acl', 'interfaces', 'interface', 'egress-acl-sets', 'egress-acl-set', 'acl-entries'] + return [u'acl', u'interfaces', u'interface', u'egress-acl-sets', u'egress-acl-set', u'acl-entries'] def _get_acl_entry(self): """ @@ -6400,10 +6879,10 @@ def _set_acl_entry(self, v, load=False): def _unset_acl_entry(self): self.__acl_entry = YANGDynClass(base=YANGListType("sequence_id",yc_acl_entry_openconfig_acl__acl_interfaces_interface_egress_acl_sets_egress_acl_set_acl_entries_acl_entry, yang_name="acl-entry", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='sequence-id', extensions=None), is_container='list', yang_name="acl-entry", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='list', is_config=False) - acl_entry = builtins.property(_get_acl_entry) + acl_entry = __builtin__.property(_get_acl_entry) - _pyangbind_elements = {'acl_entry': acl_entry, } + _pyangbind_elements = OrderedDict([('acl_entry', acl_entry), ]) class yc_egress_acl_set_openconfig_acl__acl_interfaces_interface_egress_acl_sets_egress_acl_set(PybindBase): @@ -6415,14 +6894,18 @@ class yc_egress_acl_set_openconfig_acl__acl_interfaces_interface_egress_acl_sets YANG Description: List of egress ACLs on the interface """ - __slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_extmethods', '__set_name','__config','__state','__acl_entries',) + __slots__ = ('_path_helper', '_extmethods', '__set_name','__config','__state','__acl_entries',) + + _yang_name = 'egress-acl-set' + + _pybind_generated_by = 'container' def __init__(self, *args, **kwargs): - self._yang_name = 'egress-acl-set' - self._pybind_generated_by = 'container' + self._path_helper = False + self._extmethods = False - self.__set_name = YANGDynClass(base=str, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) + self.__set_name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) self.__config = YANGDynClass(base=yc_config_openconfig_acl__acl_interfaces_interface_egress_acl_sets_egress_acl_set_config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) self.__state = YANGDynClass(base=yc_state_openconfig_acl__acl_interfaces_interface_egress_acl_sets_egress_acl_set_state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) self.__acl_entries = YANGDynClass(base=yc_acl_entries_openconfig_acl__acl_interfaces_interface_egress_acl_sets_egress_acl_set_acl_entries, is_container='container', yang_name="acl-entries", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) @@ -6452,7 +6935,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return ['acl', 'interfaces', 'interface', 'egress-acl-sets', 'egress-acl-set'] + return [u'acl', u'interfaces', u'interface', u'egress-acl-sets', u'egress-acl-set'] def _get_set_name(self): """ @@ -6480,12 +6963,12 @@ def _set_set_name(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=str, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """set_name must be of a type compatible with leafref""", 'defined-type': "leafref", - 'generated-type': """YANGDynClass(base=unicode, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True)""", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True)""", }) self.__set_name = t @@ -6493,7 +6976,7 @@ def _set_set_name(self, v, load=False): self._set() def _unset_set_name(self): - self.__set_name = YANGDynClass(base=str, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) + self.__set_name = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="set-name", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) def _get_config(self): @@ -6606,13 +7089,13 @@ def _set_acl_entries(self, v, load=False): def _unset_acl_entries(self): self.__acl_entries = YANGDynClass(base=yc_acl_entries_openconfig_acl__acl_interfaces_interface_egress_acl_sets_egress_acl_set_acl_entries, is_container='container', yang_name="acl-entries", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) - set_name = builtins.property(_get_set_name, _set_set_name) - config = builtins.property(_get_config, _set_config) - state = builtins.property(_get_state, _set_state) - acl_entries = builtins.property(_get_acl_entries, _set_acl_entries) + set_name = __builtin__.property(_get_set_name, _set_set_name) + config = __builtin__.property(_get_config, _set_config) + state = __builtin__.property(_get_state, _set_state) + acl_entries = __builtin__.property(_get_acl_entries, _set_acl_entries) - _pyangbind_elements = {'set_name': set_name, 'config': config, 'state': state, 'acl_entries': acl_entries, } + _pyangbind_elements = OrderedDict([('set_name', set_name), ('config', config), ('state', state), ('acl_entries', acl_entries), ]) class yc_egress_acl_sets_openconfig_acl__acl_interfaces_interface_egress_acl_sets(PybindBase): @@ -6625,12 +7108,16 @@ class yc_egress_acl_sets_openconfig_acl__acl_interfaces_interface_egress_acl_set YANG Description: Enclosing container the list of egress ACLs on the interface """ - __slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_extmethods', '__egress_acl_set',) + __slots__ = ('_path_helper', '_extmethods', '__egress_acl_set',) + + _yang_name = 'egress-acl-sets' + + _pybind_generated_by = 'container' def __init__(self, *args, **kwargs): - self._yang_name = 'egress-acl-sets' - self._pybind_generated_by = 'container' + self._path_helper = False + self._extmethods = False self.__egress_acl_set = YANGDynClass(base=YANGListType("set_name",yc_egress_acl_set_openconfig_acl__acl_interfaces_interface_egress_acl_sets_egress_acl_set, yang_name="egress-acl-set", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='set-name', extensions=None), is_container='list', yang_name="egress-acl-set", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='list', is_config=True) @@ -6659,7 +7146,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return ['acl', 'interfaces', 'interface', 'egress-acl-sets'] + return [u'acl', u'interfaces', u'interface', u'egress-acl-sets'] def _get_egress_acl_set(self): """ @@ -6697,10 +7184,10 @@ def _set_egress_acl_set(self, v, load=False): def _unset_egress_acl_set(self): self.__egress_acl_set = YANGDynClass(base=YANGListType("set_name",yc_egress_acl_set_openconfig_acl__acl_interfaces_interface_egress_acl_sets_egress_acl_set, yang_name="egress-acl-set", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='set-name', extensions=None), is_container='list', yang_name="egress-acl-set", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='list', is_config=True) - egress_acl_set = builtins.property(_get_egress_acl_set, _set_egress_acl_set) + egress_acl_set = __builtin__.property(_get_egress_acl_set, _set_egress_acl_set) - _pyangbind_elements = {'egress_acl_set': egress_acl_set, } + _pyangbind_elements = OrderedDict([('egress_acl_set', egress_acl_set), ]) class yc_interface_openconfig_acl__acl_interfaces_interface(PybindBase): @@ -6712,18 +7199,22 @@ class yc_interface_openconfig_acl__acl_interfaces_interface(PybindBase): YANG Description: List of interfaces on which ACLs are set """ - __slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_extmethods', '__id','__config','__state','__interface_ref','__ingress_acl_sets','__egress_acl_sets',) + __slots__ = ('_path_helper', '_extmethods', '__id','__config','__state','__interface_ref','__ingress_acl_sets','__egress_acl_sets',) + + _yang_name = 'interface' + + _pybind_generated_by = 'container' def __init__(self, *args, **kwargs): - self._yang_name = 'interface' - self._pybind_generated_by = 'container' + self._path_helper = False + self._extmethods = False self.__ingress_acl_sets = YANGDynClass(base=yc_ingress_acl_sets_openconfig_acl__acl_interfaces_interface_ingress_acl_sets, is_container='container', yang_name="ingress-acl-sets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) self.__egress_acl_sets = YANGDynClass(base=yc_egress_acl_sets_openconfig_acl__acl_interfaces_interface_egress_acl_sets, is_container='container', yang_name="egress-acl-sets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) self.__state = YANGDynClass(base=yc_state_openconfig_acl__acl_interfaces_interface_state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) self.__config = YANGDynClass(base=yc_config_openconfig_acl__acl_interfaces_interface_config, is_container='container', yang_name="config", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) - self.__id = YANGDynClass(base=str, is_leaf=True, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) + self.__id = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) self.__interface_ref = YANGDynClass(base=yc_interface_ref_openconfig_acl__acl_interfaces_interface_interface_ref, is_container='container', yang_name="interface-ref", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) load = kwargs.pop("load", None) @@ -6751,7 +7242,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return ['acl', 'interfaces', 'interface'] + return [u'acl', u'interfaces', u'interface'] def _get_id(self): """ @@ -6779,12 +7270,12 @@ def _set_id(self, v, load=False): if hasattr(v, "_utype"): v = v._utype(v) try: - t = YANGDynClass(v,base=str, is_leaf=True, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) + t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) except (TypeError, ValueError): raise ValueError({ 'error-string': """id must be of a type compatible with leafref""", 'defined-type': "leafref", - 'generated-type': """YANGDynClass(base=unicode, is_leaf=True, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True)""", + 'generated-type': """YANGDynClass(base=six.text_type, is_leaf=True, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True)""", }) self.__id = t @@ -6792,7 +7283,7 @@ def _set_id(self, v, load=False): self._set() def _unset_id(self): - self.__id = YANGDynClass(base=str, is_leaf=True, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) + self.__id = YANGDynClass(base=six.text_type, is_leaf=True, yang_name="id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, is_keyval=True, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='leafref', is_config=True) def _get_config(self): @@ -6983,15 +7474,15 @@ def _set_egress_acl_sets(self, v, load=False): def _unset_egress_acl_sets(self): self.__egress_acl_sets = YANGDynClass(base=yc_egress_acl_sets_openconfig_acl__acl_interfaces_interface_egress_acl_sets, is_container='container', yang_name="egress-acl-sets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) - id = builtins.property(_get_id, _set_id) - config = builtins.property(_get_config, _set_config) - state = builtins.property(_get_state, _set_state) - interface_ref = builtins.property(_get_interface_ref, _set_interface_ref) - ingress_acl_sets = builtins.property(_get_ingress_acl_sets, _set_ingress_acl_sets) - egress_acl_sets = builtins.property(_get_egress_acl_sets, _set_egress_acl_sets) + id = __builtin__.property(_get_id, _set_id) + config = __builtin__.property(_get_config, _set_config) + state = __builtin__.property(_get_state, _set_state) + interface_ref = __builtin__.property(_get_interface_ref, _set_interface_ref) + ingress_acl_sets = __builtin__.property(_get_ingress_acl_sets, _set_ingress_acl_sets) + egress_acl_sets = __builtin__.property(_get_egress_acl_sets, _set_egress_acl_sets) - _pyangbind_elements = {'id': id, 'config': config, 'state': state, 'interface_ref': interface_ref, 'ingress_acl_sets': ingress_acl_sets, 'egress_acl_sets': egress_acl_sets, } + _pyangbind_elements = OrderedDict([('id', id), ('config', config), ('state', state), ('interface_ref', interface_ref), ('ingress_acl_sets', ingress_acl_sets), ('egress_acl_sets', egress_acl_sets), ]) class yc_interfaces_openconfig_acl__acl_interfaces(PybindBase): @@ -7004,12 +7495,16 @@ class yc_interfaces_openconfig_acl__acl_interfaces(PybindBase): YANG Description: Enclosing container for the list of interfaces on which ACLs are set """ - __slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_extmethods', '__interface',) + __slots__ = ('_path_helper', '_extmethods', '__interface',) + + _yang_name = 'interfaces' + + _pybind_generated_by = 'container' def __init__(self, *args, **kwargs): - self._yang_name = 'interfaces' - self._pybind_generated_by = 'container' + self._path_helper = False + self._extmethods = False self.__interface = YANGDynClass(base=YANGListType("id",yc_interface_openconfig_acl__acl_interfaces_interface, yang_name="interface", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='id', extensions=None), is_container='list', yang_name="interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='list', is_config=True) @@ -7038,7 +7533,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return ['acl', 'interfaces'] + return [u'acl', u'interfaces'] def _get_interface(self): """ @@ -7076,10 +7571,10 @@ def _set_interface(self, v, load=False): def _unset_interface(self): self.__interface = YANGDynClass(base=YANGListType("id",yc_interface_openconfig_acl__acl_interfaces_interface, yang_name="interface", parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='id', extensions=None), is_container='list', yang_name="interface", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='list', is_config=True) - interface = builtins.property(_get_interface, _set_interface) + interface = __builtin__.property(_get_interface, _set_interface) - _pyangbind_elements = {'interface': interface, } + _pyangbind_elements = OrderedDict([('interface', interface), ]) class yc_acl_openconfig_acl__acl(PybindBase): @@ -7092,12 +7587,16 @@ class yc_acl_openconfig_acl__acl(PybindBase): YANG Description: Top level enclosing container for ACL model config and operational state data """ - __slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_extmethods', '__state','__acl_sets','__interfaces',) + __slots__ = ('_path_helper', '_extmethods', '__state','__acl_sets','__interfaces',) + + _yang_name = 'acl' + + _pybind_generated_by = 'container' def __init__(self, *args, **kwargs): - self._yang_name = 'acl' - self._pybind_generated_by = 'container' + self._path_helper = False + self._extmethods = False self.__state = YANGDynClass(base=yc_state_openconfig_acl__acl_state, is_container='container', yang_name="state", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) self.__acl_sets = YANGDynClass(base=yc_acl_sets_openconfig_acl__acl_acl_sets, is_container='container', yang_name="acl-sets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) @@ -7128,7 +7627,7 @@ def _path(self): if hasattr(self, "_parent"): return self._parent._path()+[self._yang_name] else: - return ['acl'] + return [u'acl'] def _get_state(self): """ @@ -7242,12 +7741,12 @@ def _set_interfaces(self, v, load=False): def _unset_interfaces(self): self.__interfaces = YANGDynClass(base=yc_interfaces_openconfig_acl__acl_interfaces, is_container='container', yang_name="interfaces", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) - state = builtins.property(_get_state, _set_state) - acl_sets = builtins.property(_get_acl_sets, _set_acl_sets) - interfaces = builtins.property(_get_interfaces, _set_interfaces) + state = __builtin__.property(_get_state, _set_state) + acl_sets = __builtin__.property(_get_acl_sets, _set_acl_sets) + interfaces = __builtin__.property(_get_interfaces, _set_interfaces) - _pyangbind_elements = {'state': state, 'acl_sets': acl_sets, 'interfaces': interfaces, } + _pyangbind_elements = OrderedDict([('state', state), ('acl_sets', acl_sets), ('interfaces', interfaces), ]) class openconfig_acl(PybindBase): @@ -7272,12 +7771,16 @@ class openconfig_acl(PybindBase): criteria that cross protocol layers, e.g., MAC layer and IP layer matches. """ - __slots__ = ('_pybind_generated_by', '_path_helper', '_yang_name', '_extmethods', '__acl',) + __slots__ = ('_path_helper', '_extmethods', '__acl',) + + _yang_name = 'openconfig-acl' + + _pybind_generated_by = 'container' def __init__(self, *args, **kwargs): - self._yang_name = 'openconfig-acl' - self._pybind_generated_by = 'container' + self._path_helper = False + self._extmethods = False self.__acl = YANGDynClass(base=yc_acl_openconfig_acl__acl, is_container='container', yang_name="acl", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) @@ -7346,7 +7849,9 @@ def _set_acl(self, v, load=False): def _unset_acl(self): self.__acl = YANGDynClass(base=yc_acl_openconfig_acl__acl, is_container='container', yang_name="acl", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions=None, namespace='http://openconfig.net/yang/acl', defining_module='openconfig-acl', yang_type='container', is_config=True) - acl = builtins.property(_get_acl, _set_acl) + acl = __builtin__.property(_get_acl, _set_acl) + + + _pyangbind_elements = OrderedDict([('acl', acl), ]) - _pyangbind_elements = {'acl': acl, } diff --git a/src/sonic-config-engine/portconfig.py b/src/sonic-config-engine/portconfig.py index d20212eb55aa..c41878f567ae 100644 --- a/src/sonic-config-engine/portconfig.py +++ b/src/sonic-config-engine/portconfig.py @@ -5,11 +5,24 @@ import re import sys - from swsssdk import ConfigDBConnector + from swsscommon import swsscommon from sonic_py_common import device_info + from sonic_py_common.multi_asic import get_asic_id_from_name except ImportError as e: raise ImportError("%s - required module not found" % str(e)) +try: + if os.environ["CFGGEN_UNIT_TESTING"] == "2": + modules_path = os.path.join(os.path.dirname(__file__), ".") + tests_path = os.path.join(modules_path, "tests") + sys.path.insert(0, modules_path) + sys.path.insert(0, tests_path) + import mock_tables.dbconnector + mock_tables.dbconnector.load_namespace_config() + +except KeyError: + pass + # Global Variable PLATFORM_ROOT_PATH = '/usr/share/sonic/device' PLATFORM_ROOT_PATH_DOCKER = '/usr/share/sonic/platform' @@ -24,6 +37,7 @@ BRKOUT_MODE = "default_brkout_mode" CUR_BRKOUT_MODE = "brkout_mode" INTF_KEY = "interfaces" +OPTIONAL_HWSKU_ATTRIBUTES = ["fec", "autoneg"] BRKOUT_PATTERN = r'(\d{1,3})x(\d{1,3}G)(\[\d{1,3}G\])?(\((\d{1,3})\))?' @@ -31,25 +45,39 @@ # # Helper Functions # + +# For python2 compatibility +def py2JsonStrHook(j): + if isinstance(j, unicode): + return j.encode('utf-8', 'backslashreplace') + if isinstance(j, list): + return [py2JsonStrHook(item) for item in j] + if isinstance(j, dict): + return {py2JsonStrHook(key): py2JsonStrHook(value) + for key, value in j.iteritems()} + return j + def readJson(filename): # Read 'platform.json' or 'hwsku.json' file try: with open(filename) as fp: - try: - data = json.load(fp) - except json.JSONDecodeError: - print("Json file does not exist") - data_dict = ast.literal_eval(json.dumps(data)) - return data_dict + if sys.version_info.major == 2: + return json.load(fp, object_hook=py2JsonStrHook) + return json.load(fp) except Exception as e: print("error occurred while parsing json: {}".format(sys.exc_info()[1])) return None -def db_connect_configdb(): +def db_connect_configdb(namespace=None): """ Connect to configdb """ - config_db = ConfigDBConnector() + try: + if namespace is not None: + swsscommon.SonicDBConfig.load_sonic_global_db_config(namespace=namespace) + config_db = swsscommon.ConfigDBConnector(use_unix_socket_path=True, namespace=namespace) + except Exception as e: + return None if config_db is None: return None try: @@ -77,8 +105,8 @@ def get_hwsku_file_name(hwsku=None, platform=None): return candidate return None -def get_port_config(hwsku=None, platform=None, port_config_file=None, hwsku_config_file=None, asic=None): - config_db = db_connect_configdb() +def get_port_config(hwsku=None, platform=None, port_config_file=None, hwsku_config_file=None, asic_name=None): + config_db = db_connect_configdb(asic_name) # If available, Read from CONFIG DB first if config_db is not None and port_config_file is None: @@ -88,11 +116,18 @@ def get_port_config(hwsku=None, platform=None, port_config_file=None, hwsku_conf port_alias_map = {} port_alias_asic_map = {} for intf_name in ports.keys(): - port_alias_map[ports[intf_name]["alias"]] = intf_name + if "alias" in ports[intf_name]: + port_alias_map[ports[intf_name]["alias"]] = intf_name return (ports, port_alias_map, port_alias_asic_map) + if asic_name is not None: + asic_id = str(get_asic_id_from_name(asic_name)) + else: + asic_id = None + if not port_config_file: - port_config_file = device_info.get_path_to_port_config_file(hwsku, asic) + port_config_file = device_info.get_path_to_port_config_file(hwsku, asic_id) + if not port_config_file: return ({}, {}, {}) @@ -250,6 +285,12 @@ def parse_platform_json_file(hwsku_json_file, platform_json_file): brkout_mode = hwsku_dict[INTF_KEY][intf][BRKOUT_MODE] child_ports = get_child_ports(intf, brkout_mode, platform_json_file) + + # take optional fields from hwsku.json + for key, item in hwsku_dict[INTF_KEY][intf].items(): + if key in OPTIONAL_HWSKU_ATTRIBUTES: + child_ports.get(intf)[key] = item + ports.update(child_ports) if not ports: diff --git a/src/sonic-config-engine/redis_bcc.py b/src/sonic-config-engine/redis_bcc.py index 1045e0c5c8b8..c9d3ebca239f 100644 --- a/src/sonic-config-engine/redis_bcc.py +++ b/src/sonic-config-engine/redis_bcc.py @@ -19,11 +19,11 @@ def load_bytecode(self, bucket): return code = self._client.get(self._client.LOGLEVEL_DB, self.REDIS_HASH, bucket.key) if code is not None: - bucket.bytecode_from_string(b64decode(code)) + bucket.bytecode_from_string(b64decode(code.encode())) def dump_bytecode(self, bucket): if self._client is None: return self._client.set(self._client.LOGLEVEL_DB, self.REDIS_HASH, - bucket.key, b64encode(bucket.bytecode_to_string())) + bucket.key, b64encode(bucket.bytecode_to_string()).decode()) diff --git a/src/sonic-config-engine/setup.py b/src/sonic-config-engine/setup.py old mode 100755 new mode 100644 index 2483e8ebcf38..ea5b0853fab0 --- a/src/sonic-config-engine/setup.py +++ b/src/sonic-config-engine/setup.py @@ -7,9 +7,9 @@ dependencies = [ 'bitarray==1.5.3', 'ipaddress==1.0.23', - 'lxml==4.6.1', + 'lxml==4.9.1', 'netaddr==0.8.0', - 'pyyaml==5.3.1', + 'pyyaml==5.4.1', 'sonic-py-common', ] @@ -31,7 +31,8 @@ 'Jinja2<3.0.0', 'pyangbind==0.6.0', 'zipp==1.2.0', # importlib-resources needs zipp and seems to have a bug where it will try to install too new of a version for Python 2 - 'importlib-resources==3.3.1' # importlib-resources v4.0.0 was released 2020-12-23 and drops support for Python 2 + 'importlib-resources==3.3.1', # importlib-resources v4.0.0 was released 2020-12-23 and drops support for Python 2 + 'contextlib2==0.6.0.post1' ] diff --git a/src/sonic-config-engine/sonic-acl-extension.yang b/src/sonic-config-engine/sonic-acl-extension.yang new file mode 100644 index 000000000000..2ff9919b78d5 --- /dev/null +++ b/src/sonic-config-engine/sonic-acl-extension.yang @@ -0,0 +1,91 @@ +module sonic-acl-extension { + yang-version "1"; + namespace "https://github.com/Azure/sonic-buildimage"; + + prefix "sonic-acl-extension"; + + import openconfig-acl { prefix oc-acl; } + + typedef vlan-id-type { + type union { + type string { + pattern "null"; + } + type uint16 { + range 1..4095; + } + } + description + "The VLAN ID value may be expressed as a 12-bit number in decimal notation"; + } + + typedef icmp-type-type { + type union { + type string { + pattern "null"; + } + type uint8 { + range 0..255; + } + } + description + "The ICMP type value may be expressed as an 8-bit number in decimal notation"; + } + + typedef icmp-code-type { + type union { + type string { + pattern "null"; + } + type uint8 { + range 0..255; + } + } + description + "The ICMP code value may be expressed as an 8-bit number in decimal notation"; + } + + grouping extended-l2-match { + leaf vlan-id { + type vlan-id-type; + description + "VLAN ID field to match in DOT1Q packets"; + } + } + + grouping icmp-protocol-fields-config { + description + "Configuration data of ICMP protocol fields."; + + leaf type { + type icmp-type-type; + description + "ICMP(V6) type."; + } + + leaf code { + type icmp-code-type; + description + "ICMP(V6) code."; + } + } + + grouping icmp-protocol-fields-top { + description + "ICMP header fields for IPv4 and IPv6"; + + container icmp { + container config { + uses icmp-protocol-fields-config; + } + } + } + + augment "/oc-acl:acl/oc-acl:acl-sets/oc-acl:acl-set/oc-acl:acl-entries/oc-acl:acl-entry/oc-acl:l2/oc-acl:config" { + uses extended-l2-match; + } + + augment "/oc-acl:acl/oc-acl:acl-sets/oc-acl:acl-set/oc-acl:acl-entries/oc-acl:acl-entry" { + uses icmp-protocol-fields-top; + } +} diff --git a/src/sonic-config-engine/sonic-cfggen b/src/sonic-config-engine/sonic-cfggen index af638c2c2826..33133f2de154 100755 --- a/src/sonic-config-engine/sonic-cfggen +++ b/src/sonic-config-engine/sonic-cfggen @@ -41,9 +41,9 @@ from functools import partial from minigraph import minigraph_encoder, parse_xml, parse_device_desc_xml, parse_asic_sub_role from portconfig import get_port_config, get_breakout_mode from redis_bcc import RedisBytecodeCache -from sonic_py_common.multi_asic import get_asic_id_from_name, is_multi_asic +from sonic_py_common.multi_asic import get_asic_id_from_name, get_asic_device_id from sonic_py_common import device_info -from swsssdk import SonicV2Connector, ConfigDBConnector, SonicDBConfig, ConfigDBPipeConnector +from swsscommon.swsscommon import SonicV2Connector, ConfigDBConnector, SonicDBConfig, ConfigDBPipeConnector PY3x = sys.version_info >= (3, 0) @@ -251,8 +251,6 @@ def _get_jinja2_env(paths): env.filters['ip_network'] = ip_network for attr in ['ip', 'network', 'prefixlen', 'netmask', 'broadcast']: env.filters[attr] = partial(prefix_attr, attr) - # Pass the is_multi_asic function as global - env.globals['multi_asic'] = is_multi_asic return env @@ -304,10 +302,6 @@ def main(): 'localhost': {'namespace_id': namespace_id} } }) - # Load the database config for the namespace from global database json - if args.namespace is not None: - SonicDBConfig.load_sonic_global_db_config(namespace=args.namespace) - if hwsku is not None: hardware_data = {'DEVICE_METADATA': {'localhost': { 'hwsku': hwsku @@ -352,10 +346,12 @@ def main(): deep_update(data, json.loads(args.additional_data)) if args.from_db: + use_unix_sock = True if os.getuid() == 0 else False if args.namespace is None: - configdb = ConfigDBPipeConnector(use_unix_socket_path=True, **db_kwargs) + configdb = ConfigDBPipeConnector(use_unix_socket_path=use_unix_sock, **db_kwargs) else: - configdb = ConfigDBPipeConnector(use_unix_socket_path=True, namespace=args.namespace, **db_kwargs) + SonicDBConfig.load_sonic_global_db_config(namespace=args.namespace) + configdb = ConfigDBPipeConnector(use_unix_socket_path=use_unix_sock, namespace=args.namespace, **db_kwargs) configdb.connect() deep_update(data, FormatConverter.db_to_output(configdb.get_config())) @@ -381,7 +377,12 @@ def main(): }}} # The ID needs to be passed to the SAI to identify the asic. if asic_name is not None: - hardware_data['DEVICE_METADATA']['localhost'].update(asic_id=asic_id) + device_id = get_asic_device_id(asic_id) + # if the device_id obtained is None, exit with error + if device_id is None: + print('Failed to get device ID for', asic_name, file=sys.stderr) + sys.exit(1) + hardware_data['DEVICE_METADATA']['localhost'].update(asic_id=device_id) deep_update(data, hardware_data) paths = ['/', '/usr/share/sonic/templates'] @@ -415,6 +416,7 @@ def main(): if args.namespace is None: configdb = ConfigDBPipeConnector(use_unix_socket_path=True, **db_kwargs) else: + SonicDBConfig.load_sonic_global_db_config(namespace=args.namespace) configdb = ConfigDBPipeConnector(use_unix_socket_path=True, namespace=args.namespace, **db_kwargs) configdb.connect(False) diff --git a/src/sonic-config-engine/tests/common_utils.py b/src/sonic-config-engine/tests/common_utils.py index 3d8a3029dad9..47fe9f37f2a4 100644 --- a/src/sonic-config-engine/tests/common_utils.py +++ b/src/sonic-config-engine/tests/common_utils.py @@ -1,4 +1,6 @@ import json +import filecmp +import os import re import sys @@ -31,3 +33,14 @@ def liststr_to_dict(liststr): return list_obj +def cmp(file1, file2): + """ compare files """ + try: + with open(file1, 'r') as f: + obj1 = json.load(f) + with open(file2, 'r') as f: + obj2 = json.load(f) + return obj1 == obj2 + except: + return filecmp.cmp(file1, file2) + diff --git a/src/sonic-config-engine/tests/data/backend_acl/acl_multi_vlan.json b/src/sonic-config-engine/tests/data/backend_acl/acl_multi_vlan.json new file mode 100644 index 000000000000..53cd50d0f2d1 --- /dev/null +++ b/src/sonic-config-engine/tests/data/backend_acl/acl_multi_vlan.json @@ -0,0 +1,59 @@ + +{ + "acl": { + "acl-sets": { + "acl-set": { + "DATAACL": { + "acl-entries": { + "acl-entry": { + "1": { + "config": { + "sequence-id": 1 + }, + "actions": { + "config": { + "forwarding-action": "ACCEPT" + } + }, + "l2": { + "config": { + "vlan_id": "1000" + } + }, + "input_interface": { + "interface_ref": { + "config": { + "interface": "Ethernet12,Ethernet16,Ethernet20,Ethernet24,Ethernet28,Ethernet32,Ethernet36,Ethernet40,Ethernet44,Ethernet48,Ethernet52,Ethernet56,Ethernet60,Ethernet64,Ethernet68,Ethernet72,Ethernet76" + } + } + } + + }, "2": { + "config": { + "sequence-id": 2 + }, + "actions": { + "config": { + "forwarding-action": "ACCEPT" + } + }, + "l2": { + "config": { + "vlan_id": "2000" + } + }, + "input_interface": { + "interface_ref": { + "config": { + "interface": "Ethernet4,Ethernet8" + } + } + } + + } } + } + } + } + } + } +} diff --git a/src/sonic-config-engine/tests/data/backend_acl/acl_single_vlan.json b/src/sonic-config-engine/tests/data/backend_acl/acl_single_vlan.json new file mode 100644 index 000000000000..86dcc80d08d1 --- /dev/null +++ b/src/sonic-config-engine/tests/data/backend_acl/acl_single_vlan.json @@ -0,0 +1,38 @@ + +{ + "acl": { + "acl-sets": { + "acl-set": { + "DATAACL": { + "acl-entries": { + "acl-entry": { + "1": { + "config": { + "sequence-id": 1 + }, + "actions": { + "config": { + "forwarding-action": "ACCEPT" + } + }, + "l2": { + "config": { + "vlan_id": "1000" + } + }, + "input_interface": { + "interface_ref": { + "config": { + "interface": "Ethernet12,Ethernet16,Ethernet20,Ethernet24,Ethernet28,Ethernet32,Ethernet36,Ethernet4,Ethernet40,Ethernet44,Ethernet48,Ethernet52,Ethernet56,Ethernet60,Ethernet64,Ethernet68,Ethernet72,Ethernet76,Ethernet8" + } + } + } + + } + } + } + } + } + } + } +} diff --git a/src/sonic-config-engine/tests/data/backend_acl/multi_vlan.json b/src/sonic-config-engine/tests/data/backend_acl/multi_vlan.json new file mode 100644 index 000000000000..13acff414a1f --- /dev/null +++ b/src/sonic-config-engine/tests/data/backend_acl/multi_vlan.json @@ -0,0 +1,69 @@ +{ + "VLAN": { + "Vlan1000": { + "vlanid": "1000" + }, + "Vlan2000": { + "vlanid": "2000" + } + }, + "VLAN_MEMBER": { + "Vlan1000|Ethernet12": { + "tagging_mode": "tagged" + }, + "Vlan1000|Ethernet16": { + "tagging_mode": "tagged" + }, + "Vlan1000|Ethernet20": { + "tagging_mode": "tagged" + }, + "Vlan1000|Ethernet24": { + "tagging_mode": "tagged" + }, + "Vlan1000|Ethernet28": { + "tagging_mode": "tagged" + }, + "Vlan1000|Ethernet32": { + "tagging_mode": "tagged" + }, + "Vlan1000|Ethernet36": { + "tagging_mode": "tagged" + }, + "Vlan1000|Ethernet40": { + "tagging_mode": "tagged" + }, + "Vlan1000|Ethernet44": { + "tagging_mode": "tagged" + }, + "Vlan1000|Ethernet48": { + "tagging_mode": "tagged" + }, + "Vlan1000|Ethernet52": { + "tagging_mode": "tagged" + }, + "Vlan1000|Ethernet56": { + "tagging_mode": "tagged" + }, + "Vlan1000|Ethernet60": { + "tagging_mode": "tagged" + }, + "Vlan1000|Ethernet64": { + "tagging_mode": "tagged" + }, + "Vlan1000|Ethernet68": { + "tagging_mode": "tagged" + }, + "Vlan1000|Ethernet72": { + "tagging_mode": "tagged" + }, + "Vlan1000|Ethernet76": { + "tagging_mode": "tagged" + }, + "Vlan2000|Ethernet4": { + "tagging_mode": "tagged" + }, + "Vlan2000|Ethernet8": { + "tagging_mode": "tagged" + } + } +} diff --git a/src/sonic-config-engine/tests/data/backend_acl/single_vlan.json b/src/sonic-config-engine/tests/data/backend_acl/single_vlan.json new file mode 100644 index 000000000000..1023e990a72f --- /dev/null +++ b/src/sonic-config-engine/tests/data/backend_acl/single_vlan.json @@ -0,0 +1,66 @@ +{ + "VLAN": { + "Vlan1000": { + "vlanid": "1000" + } + }, + "VLAN_MEMBER": { + "Vlan1000|Ethernet4": { + "tagging_mode": "tagged" + }, + "Vlan1000|Ethernet8": { + "tagging_mode": "tagged" + }, + "Vlan1000|Ethernet12": { + "tagging_mode": "tagged" + }, + "Vlan1000|Ethernet16": { + "tagging_mode": "tagged" + }, + "Vlan1000|Ethernet20": { + "tagging_mode": "tagged" + }, + "Vlan1000|Ethernet24": { + "tagging_mode": "tagged" + }, + "Vlan1000|Ethernet28": { + "tagging_mode": "tagged" + }, + "Vlan1000|Ethernet32": { + "tagging_mode": "tagged" + }, + "Vlan1000|Ethernet36": { + "tagging_mode": "tagged" + }, + "Vlan1000|Ethernet40": { + "tagging_mode": "tagged" + }, + "Vlan1000|Ethernet44": { + "tagging_mode": "tagged" + }, + "Vlan1000|Ethernet48": { + "tagging_mode": "tagged" + }, + "Vlan1000|Ethernet52": { + "tagging_mode": "tagged" + }, + "Vlan1000|Ethernet56": { + "tagging_mode": "tagged" + }, + "Vlan1000|Ethernet60": { + "tagging_mode": "tagged" + }, + "Vlan1000|Ethernet64": { + "tagging_mode": "tagged" + }, + "Vlan1000|Ethernet68": { + "tagging_mode": "tagged" + }, + "Vlan1000|Ethernet72": { + "tagging_mode": "tagged" + }, + "Vlan1000|Ethernet76": { + "tagging_mode": "tagged" + } + } +} diff --git a/src/sonic-config-engine/tests/data/j2_template/config.bcm.j2 b/src/sonic-config-engine/tests/data/j2_template/config.bcm.j2 new file mode 100644 index 000000000000..187d40af2d4e --- /dev/null +++ b/src/sonic-config-engine/tests/data/j2_template/config.bcm.j2 @@ -0,0 +1,28 @@ +{# Construct config.bcm to include additional soc properties per specific device metadata requirement #} +{%- set mmu_sock = 'mmu_init_config="MSFT-TH2-Tier1"' -%} +{%- set IPinIP_sock = '' -%} +{%- set map_prio = '' -%} +{%- if DEVICE_METADATA is defined and DEVICE_METADATA['localhost'] is defined -%} +{%- if DEVICE_METADATA['localhost']['type'] is defined -%} +{%- set switch_role = DEVICE_METADATA['localhost']['type'] -%} +{%- if 'torrouter' in switch_role.lower() or 'torswitch' in switch_role.lower() %} +{%- set mmu_sock = 'mmu_init_config="MSFT-TH2-Tier0"' -%} +{%- endif %} +{%- endif %} +{%- if DEVICE_METADATA['localhost']['subtype'] is defined -%} +{%- set switch_subtype = DEVICE_METADATA['localhost']['subtype'] -%} +{%- if 'dualtor' in switch_subtype.lower() %} +{%- set IPinIP_sock = 'sai_tunnel_support=1 + sai_tunnel_underlay_route_mode=1 + host_as_route_disable=1 + l3_ecmp_levels=2' -%} +{%- set map_prio = 'sai_remap_prio_on_tnl_egress=1' -%} +{%- endif %} +{%- endif %} +{%- endif %} +{# The following is the common soc properties that used to be named "th2-a7260cx3-64-64x100G-t1.config.bcm" #} + +l3_alpm_hit_skip=1 +{{ map_prio }} +{{ mmu_sock }} +{{ IPinIP_sock }} diff --git a/src/sonic-config-engine/tests/data/j2_template/port_config.ini b/src/sonic-config-engine/tests/data/j2_template/port_config.ini new file mode 100644 index 000000000000..3940948a3541 --- /dev/null +++ b/src/sonic-config-engine/tests/data/j2_template/port_config.ini @@ -0,0 +1,67 @@ +# name lanes alias index speed +Ethernet0 77,78,79,80 Ethernet1/1 1 100000 +Ethernet4 65,66,67,68 Ethernet2/1 2 100000 +Ethernet8 85,86,87,88 Ethernet3/1 3 100000 +Ethernet12 89,90,91,92 Ethernet4/1 4 100000 +Ethernet16 109,110,111,112 Ethernet5/1 5 100000 +Ethernet20 97,98,99,100 Ethernet6/1 6 100000 +Ethernet24 5,6,7,8 Ethernet7/1 7 100000 +Ethernet28 13,14,15,16 Ethernet8/1 8 100000 +Ethernet32 25,26,27,28 Ethernet9/1 9 100000 +Ethernet36 21,22,23,24 Ethernet10/1 10 100000 +Ethernet40 37,38,39,40 Ethernet11/1 11 100000 +Ethernet44 45,46,47,48 Ethernet12/1 12 100000 +Ethernet48 57,58,59,60 Ethernet13/1 13 100000 +Ethernet52 53,54,55,56 Ethernet14/1 14 100000 +Ethernet56 117,118,119,120 Ethernet15/1 15 100000 +Ethernet60 121,122,123,124 Ethernet16/1 16 100000 +Ethernet64 141,142,143,144 Ethernet17/1 17 100000 +Ethernet68 133,134,135,136 Ethernet18/1 18 100000 +Ethernet72 197,198,199,200 Ethernet19/1 19 100000 +Ethernet76 205,206,207,208 Ethernet20/1 20 100000 +Ethernet80 217,218,219,220 Ethernet21/1 21 100000 +Ethernet84 213,214,215,216 Ethernet22/1 22 100000 +Ethernet88 229,230,231,232 Ethernet23/1 23 100000 +Ethernet92 237,238,239,240 Ethernet24/1 24 100000 +Ethernet96 249,250,251,252 Ethernet25/1 25 100000 +Ethernet100 245,246,247,248 Ethernet26/1 26 100000 +Ethernet104 149,150,151,152 Ethernet27/1 27 100000 +Ethernet108 153,154,155,156 Ethernet28/1 28 100000 +Ethernet112 173,174,175,176 Ethernet29/1 29 100000 +Ethernet116 161,162,163,164 Ethernet30/1 30 100000 +Ethernet120 181,182,183,184 Ethernet31/1 31 100000 +Ethernet124 185,186,187,188 Ethernet32/1 32 100000 +Ethernet128 69,70,71,72 Ethernet33/1 33 100000 +Ethernet132 73,74,75,76 Ethernet34/1 34 100000 +Ethernet136 93,94,95,96 Ethernet35/1 35 100000 +Ethernet140 81,82,83,84 Ethernet36/1 36 100000 +Ethernet144 101,102,103,104 Ethernet37/1 37 100000 +Ethernet148 105,106,107,108 Ethernet38/1 38 100000 +Ethernet152 9,10,11,12 Ethernet39/1 39 100000 +Ethernet156 1,2,3,4 Ethernet40/1 40 100000 +Ethernet160 17,18,19,20 Ethernet41/1 41 100000 +Ethernet164 29,30,31,32 Ethernet42/1 42 100000 +Ethernet168 41,42,43,44 Ethernet43/1 43 100000 +Ethernet172 33,34,35,36 Ethernet44/1 44 100000 +Ethernet176 49,50,51,52 Ethernet45/1 45 100000 +Ethernet180 61,62,63,64 Ethernet46/1 46 100000 +Ethernet184 125,126,127,128 Ethernet47/1 47 100000 +Ethernet188 113,114,115,116 Ethernet48/1 48 100000 +Ethernet192 129,130,131,132 Ethernet49/1 49 100000 +Ethernet196 137,138,139,140 Ethernet50/1 50 100000 +Ethernet200 201,202,203,204 Ethernet51/1 51 100000 +Ethernet204 193,194,195,196 Ethernet52/1 52 100000 +Ethernet208 209,210,211,212 Ethernet53/1 53 100000 +Ethernet212 221,222,223,224 Ethernet54/1 54 100000 +Ethernet216 233,234,235,236 Ethernet55/1 55 100000 +Ethernet220 225,226,227,228 Ethernet56/1 56 100000 +Ethernet224 241,242,243,244 Ethernet57/1 57 100000 +Ethernet228 253,254,255,256 Ethernet58/1 58 100000 +Ethernet232 157,158,159,160 Ethernet59/1 59 100000 +Ethernet236 145,146,147,148 Ethernet60/1 60 100000 +Ethernet240 165,166,167,168 Ethernet61/1 61 100000 +Ethernet244 169,170,171,172 Ethernet62/1 62 100000 +Ethernet248 189,190,191,192 Ethernet63/1 63 100000 +Ethernet252 177,178,179,180 Ethernet64/1 64 100000 +Ethernet256 257 Ethernet65 65 10000 +Ethernet260 259 Ethernet66 66 10000 diff --git a/src/sonic-config-engine/tests/data/ntp/ntp_interfaces.json b/src/sonic-config-engine/tests/data/ntp/ntp_interfaces.json new file mode 100644 index 000000000000..284758301411 --- /dev/null +++ b/src/sonic-config-engine/tests/data/ntp/ntp_interfaces.json @@ -0,0 +1,12 @@ +{ + "NTP": { + "global": { + "src_intf": "Ethernet0" + } + }, + "INTERFACE": { + "Ethernet0": {}, + "Ethernet0|10.0.0.0/31": {}, + "Ethernet0|192.168.0.122/24": {} + } +} diff --git a/src/sonic-config-engine/tests/dhcp-relay-sample.json b/src/sonic-config-engine/tests/dhcp-relay-sample.json new file mode 100644 index 000000000000..dfd29ed80f43 --- /dev/null +++ b/src/sonic-config-engine/tests/dhcp-relay-sample.json @@ -0,0 +1,5 @@ +{ + "VLAN_INTERFACE": { + "Vlan1000|fc02:2000::2/24": {} + } +} diff --git a/src/sonic-config-engine/tests/fg-ecmp-sample-minigraph.xml b/src/sonic-config-engine/tests/fg-ecmp-sample-minigraph.xml index f8fcf1e0fce7..9cca45e25241 100644 --- a/src/sonic-config-engine/tests/fg-ecmp-sample-minigraph.xml +++ b/src/sonic-config-engine/tests/fg-ecmp-sample-minigraph.xml @@ -685,12 +685,10 @@ - true DeviceInterface - true true 1 etp1 @@ -703,7 +701,6 @@ DeviceInterface - true true 1 etp2 @@ -716,7 +713,6 @@ DeviceInterface - true true 1 etp3 @@ -729,7 +725,6 @@ DeviceInterface - true true 1 etp4 @@ -742,7 +737,6 @@ DeviceInterface - true true 1 etp5 @@ -755,7 +749,6 @@ DeviceInterface - true true 1 etp6 @@ -768,7 +761,6 @@ DeviceInterface - true true 1 etp7 @@ -781,7 +773,6 @@ DeviceInterface - true true 1 etp8 @@ -794,7 +785,6 @@ DeviceInterface - true true 1 etp9 @@ -807,7 +797,6 @@ DeviceInterface - true true 1 etp10 @@ -820,7 +809,6 @@ DeviceInterface - true true 1 etp11 @@ -833,7 +821,6 @@ DeviceInterface - true true 1 etp12 @@ -846,7 +833,6 @@ DeviceInterface - true true 1 etp13 @@ -859,7 +845,6 @@ DeviceInterface - true true 1 etp14 @@ -872,7 +857,6 @@ DeviceInterface - true true 1 etp15 @@ -885,7 +869,6 @@ DeviceInterface - true true 1 etp16 @@ -898,7 +881,6 @@ DeviceInterface - true true 1 etp17 @@ -911,7 +893,6 @@ DeviceInterface - true true 1 etp18 @@ -924,7 +905,6 @@ DeviceInterface - true true 1 etp19 @@ -937,7 +917,6 @@ DeviceInterface - true true 1 etp20 @@ -950,7 +929,6 @@ DeviceInterface - true true 1 etp21 @@ -963,7 +941,6 @@ DeviceInterface - true true 1 etp22 @@ -976,7 +953,6 @@ DeviceInterface - true true 1 etp23 @@ -989,7 +965,6 @@ DeviceInterface - true true 1 etp24 @@ -1002,7 +977,6 @@ DeviceInterface - true true 1 etp25 @@ -1015,7 +989,6 @@ DeviceInterface - true true 1 etp26 @@ -1028,7 +1001,6 @@ DeviceInterface - true true 1 etp27 @@ -1041,7 +1013,6 @@ DeviceInterface - true true 1 etp28 @@ -1054,7 +1025,6 @@ DeviceInterface - true true 1 etp29 @@ -1067,7 +1037,6 @@ DeviceInterface - true true 1 etp30 @@ -1080,7 +1049,6 @@ DeviceInterface - true true 1 etp31 @@ -1093,7 +1061,6 @@ DeviceInterface - true true 1 etp32 @@ -1106,7 +1073,6 @@ DeviceInterface - true true 1 etp33 @@ -1119,7 +1085,6 @@ DeviceInterface - true true 1 etp34 @@ -1132,7 +1097,6 @@ DeviceInterface - true true 1 etp35 @@ -1145,7 +1109,6 @@ DeviceInterface - true true 1 etp36 @@ -1158,7 +1121,6 @@ DeviceInterface - true true 1 etp37 @@ -1171,7 +1133,6 @@ DeviceInterface - true true 1 etp38 @@ -1184,7 +1145,6 @@ DeviceInterface - true true 1 etp39 @@ -1197,7 +1157,6 @@ DeviceInterface - true true 1 etp40 @@ -1210,7 +1169,6 @@ DeviceInterface - true true 1 etp41 @@ -1223,7 +1181,6 @@ DeviceInterface - true true 1 etp42 @@ -1236,7 +1193,6 @@ DeviceInterface - true true 1 etp43 @@ -1249,7 +1205,6 @@ DeviceInterface - true true 1 etp44 @@ -1262,7 +1217,6 @@ DeviceInterface - true true 1 etp45 @@ -1275,7 +1229,6 @@ DeviceInterface - true true 1 etp46 @@ -1288,7 +1241,6 @@ DeviceInterface - true true 1 etp47 @@ -1301,7 +1253,6 @@ DeviceInterface - true true 1 etp48 @@ -1314,7 +1265,6 @@ DeviceInterface - true true 1 etp49 @@ -1327,7 +1277,6 @@ DeviceInterface - true true 1 etp50 @@ -1340,7 +1289,6 @@ DeviceInterface - true true 1 etp51 @@ -1353,7 +1301,6 @@ DeviceInterface - true true 1 etp52 @@ -1366,7 +1313,6 @@ DeviceInterface - true true 1 etp53 @@ -1379,7 +1325,6 @@ DeviceInterface - true true 1 etp54 @@ -1392,7 +1337,6 @@ DeviceInterface - true true 1 etp55 @@ -1405,7 +1349,6 @@ DeviceInterface - true true 1 etp56 @@ -1418,7 +1361,6 @@ DeviceInterface - true true 1 etp57 @@ -1431,7 +1373,6 @@ DeviceInterface - true true 1 etp58 @@ -1444,7 +1385,6 @@ DeviceInterface - true true 1 etp59 @@ -1457,7 +1397,6 @@ DeviceInterface - true true 1 etp60 @@ -1470,7 +1409,6 @@ DeviceInterface - true true 1 etp61 @@ -1483,7 +1421,6 @@ DeviceInterface - true true 1 etp62 @@ -1496,7 +1433,6 @@ DeviceInterface - true true 1 etp63 @@ -1509,7 +1445,6 @@ DeviceInterface - true true 1 etp64 @@ -1586,6 +1521,274 @@ + + + + + + + AutoNegotiation + + True + + + str2-sn3800-azd:etp29;ARISTA01T1:Ethernet1 + + + + + + AutoNegotiation + + True + + + str2-sn3800-azd:etp30;ARISTA02T1:Ethernet1 + + + + + + AutoNegotiation + + True + + + str2-sn3800-azd:etp31;ARISTA03T1:Ethernet1 + + + + + + AutoNegotiation + + True + + + str2-sn3800-azd:etp32;ARISTA04T1:Ethernet1 + + + + + + AutoNegotiation + + True + + + Servers0:eth0;str2-sn3800-azd:etp2 + + + + + + AutoNegotiation + + True + + + Servers3:eth0;str2-sn3800-azd:etp5 + + + + + + AutoNegotiation + + True + + + Servers4:eth0;str2-sn3800-azd:etp6 + + + + + + AutoNegotiation + + True + + + Servers7:eth0;str2-sn3800-azd:etp9 + + + + + + AutoNegotiation + + True + + + Servers10:eth0;str2-sn3800-azd:etp10 + + + + + + AutoNegotiation + + True + + + Servers11:eth0;str2-sn3800-azd:etp11 + + + + + + AutoNegotiation + + True + + + Servers10:eth0;str2-sn3800-azd:etp12 + + + + + + AutoNegotiation + + True + + + Servers11:eth0;str2-sn3800-azd:etp13 + + + + + + AutoNegotiation + + True + + + Servers10:eth0;str2-sn3800-azd:etp14 + + + + + + AutoNegotiation + + True + + + Servers11:eth0;str2-sn3800-azd:etp15 + + + + + + AutoNegotiation + + True + + + Servers10:eth0;str2-sn3800-azd:etp16 + + + + + + AutoNegotiation + + True + + + Servers11:eth0;str2-sn3800-azd:etp17 + + + + + + AutoNegotiation + + True + + + Servers10:eth0;str2-sn3800-azd:etp18 + + + + + + AutoNegotiation + + True + + + Servers11:eth0;str2-sn3800-azd:etp19 + + + + + + AutoNegotiation + + True + + + Servers10:eth0;str2-sn3800-azd:etp20 + + + + + + AutoNegotiation + + True + + + Servers11:eth0;str2-sn3800-azd:etp21 + + + + + + AutoNegotiation + + True + + + Servers20:eth0;str2-sn3800-azd:etp22 + + + + + + AutoNegotiation + + True + + + Servers21:eth0;str2-sn3800-azd:etp23 + + + + + + AutoNegotiation + + True + + + Servers22:eth0;str2-sn3800-azd:etp24 + + + + + + AutoNegotiation + + True + + + Servers23:eth0;str2-sn3800-azd:etp25 + + + str2-sn3800-azd ACS-MSN3800 - \ No newline at end of file + diff --git a/src/sonic-config-engine/tests/l1-l3-sample-port-config.ini b/src/sonic-config-engine/tests/l1-l3-sample-port-config.ini new file mode 100644 index 000000000000..f6a3ea049b85 --- /dev/null +++ b/src/sonic-config-engine/tests/l1-l3-sample-port-config.ini @@ -0,0 +1,33 @@ +# name lanes alias index speed +Ethernet0 1296,1297,1298,1299 Ethernet0 0 100000 +Ethernet1 1300,1301,1302,1303 Ethernet1 1 100000 +Ethernet2 1288,1289,1290,1291 Ethernet2 2 100000 +Ethernet3 1292,1293,1294,1295 Ethernet3 3 100000 +Ethernet4 1280,1281,1282,1283 Ethernet4 4 100000 +Ethernet5 1284,1285,1286,1287 Ethernet5 5 100000 +Ethernet6 1032,1033,1034,1035 Ethernet6 6 100000 +Ethernet7 1036,1037,1038,1039 Ethernet7 7 100000 +Ethernet8 1024,1025,1026,1027 Ethernet8 8 100000 +Ethernet9 1028,1029,1030,1031 Ethernet9 9 100000 +Ethernet10 772,773,774,775 Ethernet10 10 100000 +Ethernet11 768,769,770,771 Ethernet11 11 100000 +Ethernet12 780,781,782,783 Ethernet12 12 100000 +Ethernet13 776,777,778,779 Ethernet13 13 100000 +Ethernet14 528,529,530,531 Ethernet14 14 100000 +Ethernet15 532,533,534,535 Ethernet15 15 100000 +Ethernet16 520,521,522,523 Ethernet16 16 100000 +Ethernet17 524,525,526,527 Ethernet17 17 100000 +Ethernet18 512,513,514,515 Ethernet18 18 100000 +Ethernet19 516,517,518,519 Ethernet19 19 100000 +Ethernet20 272,273,274,275 Ethernet20 20 100000 +Ethernet21 276,277,278,279 Ethernet21 21 100000 +Ethernet22 264,265,266,267 Ethernet22 22 100000 +Ethernet23 268,269,270,271 Ethernet23 23 100000 +Ethernet24 256,257,258,259 Ethernet24 24 100000 +Ethernet25 260,261,262,263 Ethernet25 25 100000 +Ethernet26 16,17,18,19 Ethernet26 26 100000 +Ethernet27 20,21,22,23 Ethernet27 27 100000 +Ethernet28 8,9,10,11 Ethernet28 28 100000 +Ethernet29 12,13,14,15 Ethernet29 29 100000 +Ethernet30 0,1,2,3 Ethernet30 30 100000 +Ethernet31 4,5,6,7 Ethernet31 31 100000 diff --git a/src/sonic-config-engine/tests/mock_tables/__init__.py b/src/sonic-config-engine/tests/mock_tables/__init__.py new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/src/sonic-config-engine/tests/mock_tables/asic0/config_db.json b/src/sonic-config-engine/tests/mock_tables/asic0/config_db.json new file mode 100644 index 000000000000..ab29ea517ad9 --- /dev/null +++ b/src/sonic-config-engine/tests/mock_tables/asic0/config_db.json @@ -0,0 +1,98 @@ +{ + "PORT|Ethernet0": { + "index": "0", + "lanes": "33,34,35,36", + "description": "01T2:Ethernet1:config_db", + "pfc_asym": "off", + "mtu": "9100", + "alias": "Ethernet1/1", + "admin_status": "up", + "role": "Ext", + "speed": "40000", + "asic_port_name": "Eth0-ASIC0" + }, + "PORT|Ethernet4": { + "index": "1", + "lanes": "29,30,31,32", + "description": "01T2:Ethernet2:config_db", + "pfc_asym": "off", + "mtu": "9100", + "alias": "Ethernet1/2", + "admin_status": "up", + "role": "Ext", + "speed": "40000", + "asic_port_name": "Eth1-ASIC0" + }, + "PORT|Ethernet8": { + "index": "2", + "lanes": "41,42,43,44", + "description": "Ethernet1/3:config_db", + "pfc_asym": "off", + "mtu": "9100", + "alias": "Ethernet1/3", + "admin_status": "up", + "role": "Ext", + "speed": "40000", + "asic_port_name": "Eth2-ASIC0" + }, + "PORT|Ethernet12": { + "index": "3", + "lanes": "37,38,39,40", + "description": "Ethernet1/4:config_db", + "pfc_asym": "off", + "mtu": "9100", + "alias": "Ethernet1/4", + "admin_status": "up", + "role": "Ext", + "speed": "40000", + "asic_port_name": "Eth3-ASIC0" + }, + "PORT|Ethernet-BP0": { + "index": "0", + "lanes": "13,14,15,16", + "description": "ASIC2:Eth0-ASIC2:config_db", + "pfc_asym": "off", + "mtu": "9100", + "alias": "Eth4-ASIC0", + "admin_status": "up", + "role": "Int", + "speed": "40000", + "asic_port_name": "Eth4-ASIC0" + }, + "PORT|Ethernet-BP4": { + "index": "1", + "lanes": "17,18,19,20", + "description": "ASIC2:Eth1-ASIC2:config_db", + "pfc_asym": "off", + "mtu": "9100", + "alias": "Eth5-ASIC0", + "admin_status": "up", + "role": "Int", + "speed": "40000", + "asic_port_name": "Eth5-ASIC0" + }, + "PORT|Ethernet-BP8": { + "index": "2", + "lanes": "21,22,23,24", + "description": "ASIC3:Eth0-ASIC3:config_db", + "pfc_asym": "off", + "mtu": "9100", + "alias": "Eth6-ASIC0", + "admin_status": "up", + "role": "Int", + "speed": "40000", + "asic_port_name": "Eth6-ASIC0" + }, + "PORT|Ethernet-BP12": { + "index": "3", + "lanes": "25,26,27,28", + "description": "ASIC3:Eth1-ASIC3:config_db", + "pfc_asym": "off", + "mtu": "9100", + "alias": "Eth7-ASIC0", + "admin_status": "up", + "role": "Int", + "speed": "40000", + "asic_port_name": "Eth7-ASIC0" + } +} diff --git a/src/sonic-config-engine/tests/mock_tables/asic0/database_config.json b/src/sonic-config-engine/tests/mock_tables/asic0/database_config.json new file mode 100644 index 000000000000..33fdeb2d7092 --- /dev/null +++ b/src/sonic-config-engine/tests/mock_tables/asic0/database_config.json @@ -0,0 +1,57 @@ +{ + "INSTANCES": { + "redis": { + "hostname" : "127.0.0.1", + "port" : 6379, + "unix_socket_path" : "/var/run/redis/redis.sock" + } + }, + "DATABASES" : { + "APPL_DB" : { + "id" : 0, + "separator": ":", + "instance" : "redis" + }, + "ASIC_DB" : { + "id" : 1, + "separator": ":", + "instance" : "redis" + }, + "COUNTERS_DB" : { + "id" : 2, + "separator": ":", + "instance" : "redis" + }, + "LOGLEVEL_DB" : { + "id" : 3, + "separator": ":", + "instance" : "redis" + }, + "CONFIG_DB" : { + "id" : 4, + "separator": "|", + "instance" : "redis" + }, + "PFC_WD_DB" : { + "id" : 5, + "separator": ":", + "instance" : "redis" + }, + "FLEX_COUNTER_DB" : { + "id" : 5, + "separator": ":", + "instance" : "redis" + }, + "STATE_DB" : { + "id" : 6, + "separator": "|", + "instance" : "redis" + }, + "SNMP_OVERLAY_DB" : { + "id" : 7, + "separator": "|", + "instance" : "redis" + } + }, + "VERSION" : "1.1" +} diff --git a/src/sonic-config-engine/tests/mock_tables/asic1/config_db.json b/src/sonic-config-engine/tests/mock_tables/asic1/config_db.json new file mode 100644 index 000000000000..2c63c0851048 --- /dev/null +++ b/src/sonic-config-engine/tests/mock_tables/asic1/config_db.json @@ -0,0 +1,2 @@ +{ +} diff --git a/src/sonic-config-engine/tests/mock_tables/asic1/database_config.json b/src/sonic-config-engine/tests/mock_tables/asic1/database_config.json new file mode 100644 index 000000000000..33fdeb2d7092 --- /dev/null +++ b/src/sonic-config-engine/tests/mock_tables/asic1/database_config.json @@ -0,0 +1,57 @@ +{ + "INSTANCES": { + "redis": { + "hostname" : "127.0.0.1", + "port" : 6379, + "unix_socket_path" : "/var/run/redis/redis.sock" + } + }, + "DATABASES" : { + "APPL_DB" : { + "id" : 0, + "separator": ":", + "instance" : "redis" + }, + "ASIC_DB" : { + "id" : 1, + "separator": ":", + "instance" : "redis" + }, + "COUNTERS_DB" : { + "id" : 2, + "separator": ":", + "instance" : "redis" + }, + "LOGLEVEL_DB" : { + "id" : 3, + "separator": ":", + "instance" : "redis" + }, + "CONFIG_DB" : { + "id" : 4, + "separator": "|", + "instance" : "redis" + }, + "PFC_WD_DB" : { + "id" : 5, + "separator": ":", + "instance" : "redis" + }, + "FLEX_COUNTER_DB" : { + "id" : 5, + "separator": ":", + "instance" : "redis" + }, + "STATE_DB" : { + "id" : 6, + "separator": "|", + "instance" : "redis" + }, + "SNMP_OVERLAY_DB" : { + "id" : 7, + "separator": "|", + "instance" : "redis" + } + }, + "VERSION" : "1.1" +} diff --git a/src/sonic-config-engine/tests/mock_tables/asic2/config_db.json b/src/sonic-config-engine/tests/mock_tables/asic2/config_db.json new file mode 100644 index 000000000000..2c63c0851048 --- /dev/null +++ b/src/sonic-config-engine/tests/mock_tables/asic2/config_db.json @@ -0,0 +1,2 @@ +{ +} diff --git a/src/sonic-config-engine/tests/mock_tables/asic2/database_config.json b/src/sonic-config-engine/tests/mock_tables/asic2/database_config.json new file mode 100644 index 000000000000..33fdeb2d7092 --- /dev/null +++ b/src/sonic-config-engine/tests/mock_tables/asic2/database_config.json @@ -0,0 +1,57 @@ +{ + "INSTANCES": { + "redis": { + "hostname" : "127.0.0.1", + "port" : 6379, + "unix_socket_path" : "/var/run/redis/redis.sock" + } + }, + "DATABASES" : { + "APPL_DB" : { + "id" : 0, + "separator": ":", + "instance" : "redis" + }, + "ASIC_DB" : { + "id" : 1, + "separator": ":", + "instance" : "redis" + }, + "COUNTERS_DB" : { + "id" : 2, + "separator": ":", + "instance" : "redis" + }, + "LOGLEVEL_DB" : { + "id" : 3, + "separator": ":", + "instance" : "redis" + }, + "CONFIG_DB" : { + "id" : 4, + "separator": "|", + "instance" : "redis" + }, + "PFC_WD_DB" : { + "id" : 5, + "separator": ":", + "instance" : "redis" + }, + "FLEX_COUNTER_DB" : { + "id" : 5, + "separator": ":", + "instance" : "redis" + }, + "STATE_DB" : { + "id" : 6, + "separator": "|", + "instance" : "redis" + }, + "SNMP_OVERLAY_DB" : { + "id" : 7, + "separator": "|", + "instance" : "redis" + } + }, + "VERSION" : "1.1" +} diff --git a/src/sonic-config-engine/tests/mock_tables/asic3/config_db.json b/src/sonic-config-engine/tests/mock_tables/asic3/config_db.json new file mode 100644 index 000000000000..2c63c0851048 --- /dev/null +++ b/src/sonic-config-engine/tests/mock_tables/asic3/config_db.json @@ -0,0 +1,2 @@ +{ +} diff --git a/src/sonic-config-engine/tests/mock_tables/asic3/database_config.json b/src/sonic-config-engine/tests/mock_tables/asic3/database_config.json new file mode 100644 index 000000000000..33fdeb2d7092 --- /dev/null +++ b/src/sonic-config-engine/tests/mock_tables/asic3/database_config.json @@ -0,0 +1,57 @@ +{ + "INSTANCES": { + "redis": { + "hostname" : "127.0.0.1", + "port" : 6379, + "unix_socket_path" : "/var/run/redis/redis.sock" + } + }, + "DATABASES" : { + "APPL_DB" : { + "id" : 0, + "separator": ":", + "instance" : "redis" + }, + "ASIC_DB" : { + "id" : 1, + "separator": ":", + "instance" : "redis" + }, + "COUNTERS_DB" : { + "id" : 2, + "separator": ":", + "instance" : "redis" + }, + "LOGLEVEL_DB" : { + "id" : 3, + "separator": ":", + "instance" : "redis" + }, + "CONFIG_DB" : { + "id" : 4, + "separator": "|", + "instance" : "redis" + }, + "PFC_WD_DB" : { + "id" : 5, + "separator": ":", + "instance" : "redis" + }, + "FLEX_COUNTER_DB" : { + "id" : 5, + "separator": ":", + "instance" : "redis" + }, + "STATE_DB" : { + "id" : 6, + "separator": "|", + "instance" : "redis" + }, + "SNMP_OVERLAY_DB" : { + "id" : 7, + "separator": "|", + "instance" : "redis" + } + }, + "VERSION" : "1.1" +} diff --git a/src/sonic-config-engine/tests/mock_tables/config_db.json b/src/sonic-config-engine/tests/mock_tables/config_db.json new file mode 100644 index 000000000000..25937ca0dae1 --- /dev/null +++ b/src/sonic-config-engine/tests/mock_tables/config_db.json @@ -0,0 +1,236 @@ +{ + "PORT|Ethernet0": { + "lanes": "29,30,31,32", + "description": "config_db:switch-01t1:port1", + "pfc_asym": "off", + "mtu": "9100", + "alias": "fortyGigE0/0", + "admin_status": "up", + "speed": "10000" + }, + "PORT|Ethernet4": { + "lanes": "25,26,27,28", + "description": "config_db:server1:port1", + "pfc_asym": "off", + "mtu": "9100", + "alias": "fortyGigE0/4", + "admin_status": "up", + "speed": "25000", + "mux_cable": "true" + }, + "PORT|Ethernet8": { + "lanes": "37,38,39,40", + "description": "config_db:Interface description", + "pfc_asym": "off", + "mtu": "9100", + "alias": "fortyGigE0/8", + "admin_status": "up", + "speed": "40000", + "mux_cable": "true" + }, + "PORT|Ethernet12": { + "lanes": "33,34,35,36", + "description": "config_db:Interface description", + "pfc_asym": "off", + "mtu": "9100", + "alias": "fortyGigE0/12", + "admin_status": "up", + "speed": "10000" + }, + "PORT|Ethernet16": { + "alias": "fortyGigE0/16", + "pfc_asym": "off", + "lanes": "41,42,43,44", + "description": "config_db:fortyGigE0/16", + "mtu": "9100" + }, + "PORT|Ethernet20": { + "alias": "fortyGigE0/20", + "pfc_asym": "off", + "lanes": "45,46,47,48", + "description": "config_db:fortyGigE0/20", + "mtu": "9100" + }, + "PORT|Ethernet24": { + "alias": "fortyGigE0/24", + "pfc_asym": "off", + "lanes": "5,6,7,8", + "description": "config_db:fortyGigE0/24", + "mtu": "9100" + }, + "PORT|Ethernet28": { + "alias": "fortyGigE0/28", + "pfc_asym": "off", + "lanes": "1,2,3,4", + "description": "config_db:fortyGigE0/28", + "mtu": "9100" + }, + "PORT|Ethernet32": { + "alias": "fortyGigE0/32", + "pfc_asym": "off", + "lanes": "9,10,11,12", + "description": "config_db:fortyGigE0/32", + "mtu": "9100" + }, + "PORT|Ethernet36": { + "alias": "fortyGigE0/36", + "pfc_asym": "off", + "lanes": "13,14,15,16", + "description": "config_db:fortyGigE0/36", + "mtu": "9100" + }, + "PORT|Ethernet40": { + "alias": "fortyGigE0/40", + "pfc_asym": "off", + "lanes": "21,22,23,24", + "description": "config_db:fortyGigE0/40", + "mtu": "9100" + }, + "PORT|Ethernet44": { + "alias": "fortyGigE0/44", + "pfc_asym": "off", + "lanes": "17,18,19,20", + "description": "config_db:fortyGigE0/44", + "mtu": "9100" + }, + "PORT|Ethernet48": { + "alias": "fortyGigE0/48", + "pfc_asym": "off", + "lanes": "49,50,51,52", + "description": "config_db:fortyGigE0/48", + "mtu": "9100" + }, + "PORT|Ethernet52": { + "alias": "fortyGigE0/52", + "pfc_asym": "off", + "lanes": "53,54,55,56", + "description": "config_db:fortyGigE0/52", + "mtu": "9100" + }, + "PORT|Ethernet56": { + "alias": "fortyGigE0/56", + "pfc_asym": "off", + "lanes": "61,62,63,64", + "description": "config_db:fortyGigE0/56", + "mtu": "9100" + }, + "PORT|Ethernet60": { + "alias": "fortyGigE0/60", + "pfc_asym": "off", + "lanes": "57,58,59,60", + "description": "config_db:fortyGigE0/60", + "mtu": "9100" + }, + "PORT|Ethernet64": { + "alias": "fortyGigE0/64", + "pfc_asym": "off", + "lanes": "65,66,67,68", + "description": "config_db:fortyGigE0/64", + "mtu": "9100" + }, + "PORT|Ethernet68": { + "alias": "fortyGigE0/68", + "pfc_asym": "off", + "lanes": "69,70,71,72", + "description": "config_db:fortyGigE0/68", + "mtu": "9100" + }, + "PORT|Ethernet72": { + "alias": "fortyGigE0/72", + "pfc_asym": "off", + "lanes": "77,78,79,80", + "description": "config_db:fortyGigE0/72", + "mtu": "9100" + }, + "PORT|Ethernet76": { + "alias": "fortyGigE0/76", + "pfc_asym": "off", + "lanes": "73,74,75,76", + "description": "config_db:fortyGigE0/76", + "mtu": "9100" + }, + "PORT|Ethernet80": { + "alias": "fortyGigE0/80", + "pfc_asym": "off", + "lanes": "105,106,107,108", + "description": "config_db:fortyGigE0/80", + "mtu": "9100" + }, + "PORT|Ethernet84": { + "alias": "fortyGigE0/84", + "pfc_asym": "off", + "lanes": "109,110,111,112", + "description": "config_db:fortyGigE0/84", + "mtu": "9100" + }, + "PORT|Ethernet88": { + "alias": "fortyGigE0/88", + "pfc_asym": "off", + "lanes": "117,118,119,120", + "description": "config_db:fortyGigE0/88", + "mtu": "9100" + }, + "PORT|Ethernet92": { + "alias": "fortyGigE0/92", + "pfc_asym": "off", + "lanes": "113,114,115,116", + "description": "config_db:fortyGigE0/92", + "mtu": "9100" + }, + "PORT|Ethernet96": { + "alias": "fortyGigE0/96", + "pfc_asym": "off", + "lanes": "121,122,123,124", + "description": "config_db:fortyGigE0/96", + "mtu": "9100" + }, + "PORT|Ethernet100": { + "alias": "fortyGigE0/100", + "pfc_asym": "off", + "lanes": "125,126,127,128", + "description": "config_db:fortyGigE0/100", + "mtu": "9100" + }, + "PORT|Ethernet104": { + "alias": "fortyGigE0/104", + "pfc_asym": "off", + "lanes": "85,86,87,88", + "description": "config_db:fortyGigE0/104", + "mtu": "9100" + }, + "PORT|Ethernet108": { + "alias": "fortyGigE0/108", + "pfc_asym": "off", + "lanes": "81,82,83,84", + "description": "config_db:fortyGigE0/108", + "mtu": "9100" + }, + "PORT|Ethernet112": { + "alias": "fortyGigE0/112", + "pfc_asym": "off", + "lanes": "89,90,91,92", + "description": "config_db:fortyGigE0/112", + "mtu": "9100" + }, + "PORT|Ethernet116": { + "alias": "fortyGigE0/116", + "pfc_asym": "off", + "lanes": "93,94,95,96", + "description": "config_db:fortyGigE0/116", + "mtu": "9100" + }, + "PORT|Ethernet120": { + "alias": "fortyGigE0/120", + "pfc_asym": "off", + "lanes": "97,98,99,100", + "description": "config_db:fortyGigE0/120", + "mtu": "9100" + }, + "PORT|Ethernet124": { + "alias": "fortyGigE0/124", + "pfc_asym": "off", + "lanes": "101,102,103,104", + "description": "config_db:fortyGigE0/124", + "mtu": "9100" + } +} diff --git a/src/sonic-config-engine/tests/mock_tables/database_config.json b/src/sonic-config-engine/tests/mock_tables/database_config.json new file mode 100644 index 000000000000..33fdeb2d7092 --- /dev/null +++ b/src/sonic-config-engine/tests/mock_tables/database_config.json @@ -0,0 +1,57 @@ +{ + "INSTANCES": { + "redis": { + "hostname" : "127.0.0.1", + "port" : 6379, + "unix_socket_path" : "/var/run/redis/redis.sock" + } + }, + "DATABASES" : { + "APPL_DB" : { + "id" : 0, + "separator": ":", + "instance" : "redis" + }, + "ASIC_DB" : { + "id" : 1, + "separator": ":", + "instance" : "redis" + }, + "COUNTERS_DB" : { + "id" : 2, + "separator": ":", + "instance" : "redis" + }, + "LOGLEVEL_DB" : { + "id" : 3, + "separator": ":", + "instance" : "redis" + }, + "CONFIG_DB" : { + "id" : 4, + "separator": "|", + "instance" : "redis" + }, + "PFC_WD_DB" : { + "id" : 5, + "separator": ":", + "instance" : "redis" + }, + "FLEX_COUNTER_DB" : { + "id" : 5, + "separator": ":", + "instance" : "redis" + }, + "STATE_DB" : { + "id" : 6, + "separator": "|", + "instance" : "redis" + }, + "SNMP_OVERLAY_DB" : { + "id" : 7, + "separator": "|", + "instance" : "redis" + } + }, + "VERSION" : "1.1" +} diff --git a/src/sonic-config-engine/tests/mock_tables/database_global.json b/src/sonic-config-engine/tests/mock_tables/database_global.json new file mode 100644 index 000000000000..386bcc368836 --- /dev/null +++ b/src/sonic-config-engine/tests/mock_tables/database_global.json @@ -0,0 +1,24 @@ +{ + "INCLUDES" : [ + { + "include" : "database_config.json" + }, + { + "namespace" : "asic0", + "include" : "./asic0/database_config.json" + }, + { + "namespace" : "asic1", + "include" : "./asic1/database_config.json" + }, + { + "namespace" : "asic2", + "include" : "./asic2/database_config.json" + }, + { + "namespace" : "asic3", + "include" : "./asic3/database_config.json" + } + ], + "VERSION" : "1.0" +} diff --git a/src/sonic-config-engine/tests/mock_tables/dbconnector.py b/src/sonic-config-engine/tests/mock_tables/dbconnector.py new file mode 100644 index 000000000000..2b152c36a06a --- /dev/null +++ b/src/sonic-config-engine/tests/mock_tables/dbconnector.py @@ -0,0 +1,149 @@ +# MONKEY PATCH!!! +import json +import os +import sys +#from unittest import mock + +import mockredis +import redis +from sonic_py_common import multi_asic +import swsssdk +from swsssdk import SonicDBConfig, SonicV2Connector, ConfigDBConnector, ConfigDBPipeConnector +from swsscommon import swsscommon +#import swsscommon.swsscommon + + +topo = None +dedicated_dbs = {} + +def clean_up_config(): + # Set SonicDBConfig variables to initial state + # so that it can be loaded with single or multiple + # namespaces before the test begins. + SonicDBConfig._sonic_db_config = {} + SonicDBConfig._sonic_db_global_config_init = False + SonicDBConfig._sonic_db_config_init = False + +def load_namespace_config(): + # To support multi asic testing + # SonicDBConfig load_sonic_global_db_config + # is invoked to load multiple namespaces + clean_up_config() + SonicDBConfig.load_sonic_global_db_config( + global_db_file_path=os.path.join( + os.path.dirname(os.path.abspath(__file__)), 'database_global.json')) + +def load_database_config(): + # Load local database_config.json for single namespace test scenario + clean_up_config() + SonicDBConfig.load_sonic_db_config( + sonic_db_file_path=os.path.join( + os.path.dirname(os.path.abspath(__file__)), 'database_config.json')) + +_old_connect_ConfigDBConnector = ConfigDBConnector.connect + +def connect_ConfigDBConnector(self, wait_for_init=True, retry_on=False): + # add topo to kwargs for testing different topology + self.dbintf.redis_kwargs['topo'] = topo + # add the namespace to kwargs for testing multi asic + self.dbintf.redis_kwargs['namespace'] = self.namespace + self.dbintf.redis_kwargs['db_name'] = 'CONFIG_DB' + self.dbintf.redis_kwargs['decode_responses'] = True + _old_connect_ConfigDBConnector(self, wait_for_init, retry_on) + +def _subscribe_keyspace_notification(self, db_name, client): + pass + + +def config_set(self, *args): + pass + + +class MockPubSub: + def get_message(self): + return None + + def psubscribe(self, *args, **kwargs): + pass + + def __call__(self, *args, **kwargs): + return self + + def listen(self): + return [] + + def punsubscribe(self, *args, **kwargs): + pass + + def clear(self): + pass + +INPUT_DIR = os.path.dirname(os.path.abspath(__file__)) + + +class SwssSyncClient(mockredis.MockRedis): + def __init__(self, *args, **kwargs): + super(SwssSyncClient, self).__init__(strict=True, *args, **kwargs) + # Namespace is added in kwargs specifically for unit-test + # to identify the file path to load the db json files. + topo = kwargs.pop('topo') + namespace = kwargs.pop('namespace') + db_name = kwargs.pop('db_name') + self.decode_responses = kwargs.pop('decode_responses', False) == True + fname = db_name.lower() + ".json" + self.pubsub = MockPubSub() + + if namespace is not None and namespace is not multi_asic.DEFAULT_NAMESPACE: + fname = os.path.join(INPUT_DIR, namespace, fname) + elif topo is not None: + fname = os.path.join(INPUT_DIR, topo, fname) + else: + fname = os.path.join(INPUT_DIR, fname) + + if os.path.exists(fname): + with open(fname) as f: + js = json.load(f) + for k, v in js.items(): + if 'expireat' in v and 'ttl' in v and 'type' in v and 'value' in v: + # database is in redis-dump format + if v['type'] == 'hash': + # ignore other types for now since sonic has hset keys only in the db + for attr, value in v['value'].items(): + self.hset(k, attr, value) + else: + for attr, value in v.items(): + self.hset(k, attr, value) + + # Patch mockredis/mockredis/client.py + # The offical implementation assume decode_responses=False + # Here we detect the option and decode after doing encode + def _encode(self, value): + "Return a bytestring representation of the value. Taken from redis-py connection.py" + + value = super(SwssSyncClient, self)._encode(value) + + if self.decode_responses: + return value.decode('utf-8') + + # Patch mockredis/mockredis/client.py + # The official implementation will filter out keys with a slash '/' + # ref: https://github.com/locationlabs/mockredis/blob/master/mockredis/client.py + def keys(self, pattern='*'): + """Emulate keys.""" + import fnmatch + import re + + # Make regex out of glob styled pattern. + regex = fnmatch.translate(pattern) + regex = re.compile(regex) + + # Find every key that matches the pattern + return [key for key in self.redis if regex.match(key)] + +swsssdk.interface.DBInterface._subscribe_keyspace_notification = _subscribe_keyspace_notification +mockredis.MockRedis.config_set = config_set +redis.StrictRedis = SwssSyncClient +ConfigDBConnector.connect = connect_ConfigDBConnector +swsscommon.SonicV2Connector = SonicV2Connector +swsscommon.ConfigDBConnector = ConfigDBConnector +swsscommon.ConfigDBPipeConnector = ConfigDBPipeConnector diff --git a/src/sonic-config-engine/tests/multi_npu_data/py2/ipinip.json b/src/sonic-config-engine/tests/multi_npu_data/py2/ipinip.json index 3e8d4429d77d..82d583de6078 100644 --- a/src/sonic-config-engine/tests/multi_npu_data/py2/ipinip.json +++ b/src/sonic-config-engine/tests/multi_npu_data/py2/ipinip.json @@ -3,7 +3,7 @@ "TUNNEL_DECAP_TABLE:IPINIP_TUNNEL" : { "tunnel_type":"IPINIP", "dst_ip":"10.0.0.0,10.1.0.1,10.1.0.3,10.1.0.32,8.0.0.0", - "dscp_mode":"pipe", + "dscp_mode":"uniform", "ecn_mode":"copy_from_outer", "ttl_mode":"pipe" }, @@ -14,7 +14,7 @@ "TUNNEL_DECAP_TABLE:IPINIP_V6_TUNNEL" : { "tunnel_type":"IPINIP", "dst_ip":"fc00:1::32,fc00::1,fd00:1::32", - "dscp_mode":"pipe", + "dscp_mode":"uniform", "ecn_mode":"copy_from_outer", "ttl_mode":"pipe" }, diff --git a/src/sonic-config-engine/tests/multi_npu_data/py3/ipinip.json b/src/sonic-config-engine/tests/multi_npu_data/py3/ipinip.json index 3e8d4429d77d..82d583de6078 100644 --- a/src/sonic-config-engine/tests/multi_npu_data/py3/ipinip.json +++ b/src/sonic-config-engine/tests/multi_npu_data/py3/ipinip.json @@ -3,7 +3,7 @@ "TUNNEL_DECAP_TABLE:IPINIP_TUNNEL" : { "tunnel_type":"IPINIP", "dst_ip":"10.0.0.0,10.1.0.1,10.1.0.3,10.1.0.32,8.0.0.0", - "dscp_mode":"pipe", + "dscp_mode":"uniform", "ecn_mode":"copy_from_outer", "ttl_mode":"pipe" }, @@ -14,7 +14,7 @@ "TUNNEL_DECAP_TABLE:IPINIP_V6_TUNNEL" : { "tunnel_type":"IPINIP", "dst_ip":"fc00:1::32,fc00::1,fd00:1::32", - "dscp_mode":"pipe", + "dscp_mode":"uniform", "ecn_mode":"copy_from_outer", "ttl_mode":"pipe" }, diff --git a/src/sonic-config-engine/tests/multi_npu_data/sample-minigraph-noportchannel.xml b/src/sonic-config-engine/tests/multi_npu_data/sample-minigraph-noportchannel.xml new file mode 100644 index 000000000000..460f71e21c2a --- /dev/null +++ b/src/sonic-config-engine/tests/multi_npu_data/sample-minigraph-noportchannel.xml @@ -0,0 +1,1299 @@ + + + + + + false + multi_npu_platform_01 + 10.0.0.0 + 01T2 + 10.0.0.1 + 1 + 10 + 3 + + + multi_npu_platform_01 + FC00::1 + 01T2 + FC00::2 + 1 + 10 + 3 + + + false + multi_npu_platform_01 + 10.0.0.8 + 05T2 + 10.0.0.9 + 1 + 10 + 3 + + + multi_npu_platform_01 + FC00::9 + 05T2 + FC00::A + 1 + 10 + 3 + + + BGPSession + false + ASIC2 + 10.1.0.0 + ASIC0 + 10.1.0.1 + 1 + 0 + 0 + + + BGPSession + false + ASIC2 + 10.1.0.4 + ASIC1 + 10.1.0.5 + 1 + 0 + 0 + + + BGPSession + false + ASIC3 + 10.1.0.2 + ASIC0 + 10.1.0.3 + 1 + 0 + 0 + + + BGPSession + false + ASIC3 + 10.1.0.6 + ASIC1 + 10.1.0.7 + 1 + 0 + 0 + + + false + ASIC0 + 10.0.0.0 + 01T2 + 10.0.0.1 + 1 + 10 + 3 + + + ASIC0 + FC00::1 + 01T2 + FC00::2 + 1 + 10 + 3 + + + false + ASIC1 + 10.0.0.8 + 05T2 + 10.0.0.9 + 1 + 10 + 3 + + + ASIC1 + FC00::9 + 05T2 + FC00::A + 1 + 10 + 3 + + + + + 65100 + multi_npu_platform_01 + + +
10.0.0.1
+ + + +
+ +
10.0.0.9
+ + + +
+
+ +
+ + 65100 + + ASIC0 + + + BGPPeer +
10.1.0.1
+ + + +
+ + BGPPeer +
10.1.0.3
+ + + +
+ + BGPPeer +
10.0.0.1
+ + + +
+ + BGPPeer +
FC00::1
+ + + +
+
+ +
+ + 65100 + + ASIC1 + + + BGPPeer +
10.1.0.5
+ + + +
+ + BGPPeer +
10.1.0.7
+ + + +
+ + BGPPeer +
10.0.0.9
+ + + +
+ + BGPPeer +
FC00::A
+ + + +
+
+ +
+ + 65100 + + ASIC2 + + + BGPPeer +
10.1.0.0
+ + + +
+ + BGPPeer +
10.1.0.4
+ + + +
+
+ +
+ + 65100 + + ASIC3 + + + BGPPeer +
10.1.0.2
+ + + +
+ + BGPPeer +
10.1.0.6
+ + + +
+
+ +
+ + 65200 + 01T2 + + + + 65200 + 05T2 + + +
+
+ + + + + + HostIP + Loopback0 + + 10.1.0.32/32 + + 10.1.0.32/32 + + + HostIP1 + Loopback0 + + FC00:1::32/128 + + FC00:1::32/128 + + + + + HostIP + eth0 + + 3.10.147.150/23 + + 3.10.147.150/23 + + + V6HostIP + eth0 + + FC00:2::32/64 + + FC00:2::32/64 + + + + + + + multi_npu_platform_01 + + + + + + + Ethernet1/1 + 10.0.0.0/31 + + + + Ethernet1/1 + FC00::1/126 + + + + Ethernet1/2 + 10.0.0.2/31 + + + + Ethernet1/2 + FC00::2/126 + + + + Ethernet1/5 + 10.0.0.8/31 + + + + Ethernet1/5 + FC00::9/126 + + + + Ethernet1/8 + 10.0.0.10/31 + + + + Ethernet1/8 + FC00::10/126 + + + + + + SNMP_ACL + SNMP + SNMP + + + ERSPAN + Everflow + Everflow + + + ERSPANV6 + EverflowV6 + EverflowV6 + + + VTY_LINE + ssh-only + SSH + + + + + + + + + + LoopbackInterface + HostIP + Loopback4096 + + 8.0.0.0/32 + + 8.0.0.0/32 + + + HostIP1 + Loopback4096 + + FD00:1::32/128 + + FD00:1::32/128 + + + + + + + + ASIC0 + + + PortChannelInterface + PortChannel4001 + Eth4-ASIC0;Eth5-ASIC0 + + + + PortChannelInterface + PortChannel4002 + Eth6-ASIC0;Eth7-ASIC0 + + + + + + + + IPInterface + + PortChannel4001 + 10.1.0.1/31 + + + IPInterface + + PortChannel4002 + 10.1.0.3/31 + + + + Ethernet1/1 + 10.0.0.0/31 + + + + Ethernet1/1 + FC00::1/126 + + + + Ethernet1/2 + 10.0.0.2/31 + + + + Ethernet1/2 + FC00::2/126 + + + + + + + + + + + + LoopbackInterface + HostIP + Loopback4096 + + 8.0.0.1/32 + + 8.0.0.1/32 + + + HostIP1 + Loopback4096 + + FD00:2::32/128 + + FD00:2::32/128 + + + + + + + + ASIC1 + + + PortChannelInterface + PortChannel4003 + Eth4-ASIC1;Eth5-ASIC1 + + + + PortChannelInterface + PortChannel4004 + Eth6-ASIC1;Eth7-ASIC1 + + + + + + + + IPInterface + + PortChannel4003 + 10.1.0.5/31 + + + IPInterface + + PortChannel4004 + 10.1.0.7/31 + + + + Ethernet1/5 + 10.0.0.8/31 + + + + Ethernet1/5 + FC00::9/126 + + + + Ethernet1/8 + 10.0.0.10/31 + + + + Ethernet1/8 + FC00::10/126 + + + + + + + + + + + + LoopbackInterface + HostIP + Loopback4096 + + 8.0.0.4/32 + + 8.0.0.4/32 + + + HostIP1 + Loopback4096 + + FD00:3::32/128 + + FD00:3::32/128 + + + + + + + + ASIC2 + + + PortChannelInterface + PortChannel4009 + Eth0-ASIC2;Eth1-ASIC2 + + + + PortChannelInterface + PortChannel4010 + Eth2-ASIC2;Eth3-ASIC2 + + + + + + + + IPInterface + + PortChannel4009 + 10.1.0.0/31 + + + IPInterface + + PortChannel4010 + 10.1.0.4/31 + + + + + + + + + + + + LoopbackInterface + HostIP + Loopback4096 + + 8.0.0.5/32 + + 8.0.0.5/32 + + + HostIP1 + Loopback4096 + + FD00:4::32/128 + + FD00:4::32/128 + + + + + + + + ASIC3 + + + PortChannelInterface + PortChannel4013 + Eth0-ASIC3;Eth1-ASIC3 + + + + PortChannelInterface + PortChannel4014 + Eth2-ASIC3;Eth3-ASIC3 + + + + + + + + IPInterface + + PortChannel4013 + 10.1.0.2/31 + + + IPInterface + + PortChannel4014 + 10.1.0.6/31 + + + + + + + + + + + + DeviceInterfaceLink + 01T2 + Ethernet1 + multi_npu_platform_01 + Ethernet1/1 + + + DeviceInterfaceLink + 01T2 + Ethernet2 + multi_npu_platform_01 + Ethernet1/2 + + + DeviceInterfaceLink + 05T2 + Ethernet1 + multi_npu_platform_01 + Ethernet1/5 + + + DeviceInterfaceLink + 05T2 + Ethernet2 + multi_npu_platform_01 + Ethernet1/6 + + + DeviceInterfaceLink + 40000 + true + ASIC2 + Eth0-ASIC2 + true + ASIC0 + Eth4-ASIC0 + true + + + DeviceInterfaceLink + 40000 + true + ASIC2 + Eth1-ASIC2 + true + ASIC0 + Eth5-ASIC0 + true + + + DeviceInterfaceLink + 40000 + true + ASIC3 + Eth0-ASIC3 + true + ASIC0 + Eth6-ASIC0 + true + + + DeviceInterfaceLink + 40000 + true + ASIC3 + Eth1-ASIC3 + true + ASIC0 + Eth7-ASIC0 + true + + + DeviceInterfaceLink + 40000 + true + ASIC2 + Eth2-ASIC2 + true + ASIC1 + Eth4-ASIC1 + true + + + DeviceInterfaceLink + 40000 + true + ASIC2 + Eth3-ASIC2 + true + ASIC1 + Eth5-ASIC1 + true + + + DeviceInterfaceLink + 40000 + true + ASIC3 + Eth2-ASIC3 + true + ASIC1 + Eth6-ASIC1 + true + + + DeviceInterfaceLink + 40000 + true + ASIC3 + Eth3-ASIC3 + true + ASIC1 + Eth7-ASIC1 + true + + + DeviceInterfaceLink + 40000 + true + ASIC0 + Eth0-ASIC0 + true + multi_npu_platform_01 + Ethernet1/1 + true + + + DeviceInterfaceLink + 40000 + true + ASIC0 + Eth1-ASIC0 + true + multi_npu_platform_01 + Ethernet1/2 + true + + + DeviceInterfaceLink + 40000 + true + ASIC0 + Eth2-ASIC0 + true + multi_npu_platform_01 + Ethernet1/3 + true + + + DeviceInterfaceLink + 40000 + true + ASIC0 + Eth3-ASIC0 + true + multi_npu_platform_01 + Ethernet1/4 + true + + + DeviceInterfaceLink + 40000 + true + ASIC1 + Eth0-ASIC1 + true + multi_npu_platform_01 + Ethernet1/5 + true + + + DeviceInterfaceLink + 40000 + true + ASIC1 + Eth1-ASIC1 + true + multi_npu_platform_01 + Ethernet1/6 + true + + + DeviceInterfaceLink + 40000 + true + ASIC1 + Eth2-ASIC1 + true + multi_npu_platform_01 + Ethernet1/7 + true + + + DeviceInterfaceLink + 40000 + true + ASIC1 + Eth3-ASIC1 + true + multi_npu_platform_01 + Ethernet1/8 + true + + + + + multi_npu_platform_01 + multi-npu-01 + + 3.10.147.150 + + + + 07T2 + + 89.139.132.43 + + VM + + + 01T2 + + 89.139.132.40 + + VM + + + 05T2 + + 89.139.132.42 + + VM + + + 03T2 + + 89.139.132.41 + + VM + + + Asic +
+ 0.0.0.0/0 +
+ + ::/0 + + + + + + + + + + 0.0.0.0/0 + + + ::/0 + + + ASIC0 + multi-npu-asic +
+ + Asic +
+ 0.0.0.0/0 +
+ + ::/0 + + + + + + + + + + 0.0.0.0/0 + + + ::/0 + + + ASIC1 + multi-npu-asic +
+ + Asic +
+ 0.0.0.0/0 +
+ + ::/0 + + + + + + + + + + 0.0.0.0/0 + + + ::/0 + + + ASIC2 + multi-npu-asic +
+ + Asic +
+ 0.0.0.0/0 +
+ + ::/0 + + + + + + + + + + 0.0.0.0/0 + + + ::/0 + + + ASIC3 + multi-npu-asic +
+
+
+ + + + + DeviceInterface + + true + 1 + Ethernet1/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet1/2 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet1/3 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet1/4 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet1/5 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet1/6 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet1/7 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet1/8 + + false + 0 + 0 + 40000 + + + true + 0 + multi-npu-01 + + + + + + + multi_npu_platform_01 + + + DeploymentId + + 1 + + + QosProfile + + Profile0 + + + DhcpResources + + 169.118.23.1;169.118.23.2;169.118.23.3;169.118.23.4;169.118.23.5;169.118.23.6;169.118.23.7;169.118.23.8;169.118.23.9;169.118.23.10;169.118.23.11;169.118.23.12;169.118.23.13;169.118.23.14;169.118.23.15;169.118.23.16;169.118.23.17;169.118.23.18;169.118.23.19;169.118.23.20;169.118.23.21;169.118.23.22;169.118.23.23;169.118.23.24;169.118.23.25;169.118.23.26;169.118.23.27;169.118.23.28;169.118.23.29;169.118.23.30;169.118.23.31;169.118.23.32;169.118.23.33;169.118.23.34;169.118.23.35;169.118.23.36;169.118.23.37;169.118.23.38;169.118.23.39;169.118.23.40;169.118.23.41;169.118.23.42;169.118.23.43;169.118.23.44;169.118.23.45;169.118.23.46;169.118.23.47;169.118.23.48 + + + NtpResources + + 17.39.1.129;17.39.1.130 + + + SnmpResources + + 71.49.219.98 + + + SyslogResources + + 71.49.219.8;123.46.98.21 + + + TacacsGroup + + Starlab + + + TacacsServer + + 123.46.98.21 + + + ForcedMgmtRoutes + + 71.49.219.98/31;71.49.219.8;123.46.98.16/28;10.3.149.170/31;40.122.216.24;13.91.48.226;71.49.219.14 + + + ErspanDestinationIpv4 + + 10.20.6.16 + + + + + ASIC0 + + + SubRole + + FrontEnd + + + + + ASIC1 + + + SubRole + + FrontEnd + + + + + ASIC2 + + + SubRole + + FrontEnd + + + + + ASIC3 + + + SubRole + + FrontEnd + + + + + ASIC2 + + + SubRole + + BackEnd + + + + + ASIC3 + + + SubRole + + BackEnd + + + + + + + + + + + + + AutoNegotiation + + True + + + multi_npu_platform_01:Ethernet1/1;01T2:Ethernet1 + + + + + + AutoNegotiation + + True + + + multi_npu_platform_01:Ethernet1/2;01T2:Ethernet2 + + + + + + AutoNegotiation + + True + + + multi_npu_platform_01:Ethernet1/5;05T2:Ethernet1 + + + + + + AutoNegotiation + + True + + + multi_npu_platform_01:Ethernet1/6;05T2:Ethernet2 + + + + multi_npu_platform_01 + multi-npu-01 +
diff --git a/src/sonic-config-engine/tests/multi_npu_data/sample-minigraph.xml b/src/sonic-config-engine/tests/multi_npu_data/sample-minigraph.xml index 412262315b4e..5dac8e95bf1a 100644 --- a/src/sonic-config-engine/tests/multi_npu_data/sample-minigraph.xml +++ b/src/sonic-config-engine/tests/multi_npu_data/sample-minigraph.xml @@ -1008,12 +1008,10 @@ - true DeviceInterface - true true 1 Ethernet1/1 @@ -1026,7 +1024,6 @@ DeviceInterface - true true 1 Ethernet1/2 @@ -1039,7 +1036,6 @@ DeviceInterface - true true 1 Ethernet1/3 @@ -1052,7 +1048,6 @@ DeviceInterface - true true 1 Ethernet1/4 @@ -1065,7 +1060,6 @@ DeviceInterface - true true 1 Ethernet1/5 @@ -1078,7 +1072,6 @@ DeviceInterface - true true 1 Ethernet1/6 @@ -1091,7 +1084,6 @@ DeviceInterface - true true 1 Ethernet1/7 @@ -1104,7 +1096,6 @@ DeviceInterface - true true 1 Ethernet1/8 @@ -1241,6 +1232,54 @@ + + + + + + + AutoNegotiation + + True + + + multi_npu_platform_01:Ethernet1/1;01T2:Ethernet1 + + + + + + AutoNegotiation + + True + + + multi_npu_platform_01:Ethernet1/2;01T2:Ethernet2 + + + + + + AutoNegotiation + + True + + + multi_npu_platform_01:Ethernet1/5;05T2:Ethernet1 + + + + + + AutoNegotiation + + True + + + multi_npu_platform_01:Ethernet1/6;05T2:Ethernet2 + + + multi_npu_platform_01 multi-npu-01 diff --git a/src/sonic-config-engine/tests/ntp.conf.j2 b/src/sonic-config-engine/tests/ntp.conf.j2 new file mode 120000 index 000000000000..bc52df834e26 --- /dev/null +++ b/src/sonic-config-engine/tests/ntp.conf.j2 @@ -0,0 +1 @@ +../../../files/image_config/ntp/ntp.conf.j2 \ No newline at end of file diff --git a/src/sonic-config-engine/tests/radv-test-sample-graph.xml b/src/sonic-config-engine/tests/radv-test-sample-graph.xml new file mode 100644 index 000000000000..6945c8e175d2 --- /dev/null +++ b/src/sonic-config-engine/tests/radv-test-sample-graph.xml @@ -0,0 +1,579 @@ + + + + + + switch-t0 + 10.1.0.32 + BGPMonitor + 10.20.30.40 + 30 + 10 + 3 + + + false + switch-t0 + 10.0.0.56 + ARISTA01T1 + 10.0.0.57 + 1 + 180 + 60 + + + switch-t0 + FC00::71 + ARISTA01T1 + FC00::72 + 1 + 180 + 60 + + + false + switch-t0 + 10.0.0.58 + ARISTA02T1 + 10.0.0.59 + 1 + 180 + 60 + + + switch-t0 + FC00::75 + ARISTA02T1 + FC00::76 + 1 + 180 + 60 + + + false + switch-t0 + 10.0.0.60 + ARISTA03T1 + 10.0.0.61 + 1 + 180 + 60 + + + switch-t0 + FC00::79 + ARISTA03T1 + FC00::7A + 1 + 180 + 60 + + + false + switch-t0 + 10.0.0.62 + ARISTA04T1 + 10.0.0.63 + 1 + 180 + 60 + + + switch-t0 + FC00::7D + ARISTA04T1 + FC00::7E + 1 + 180 + 60 + + + + + 0 + + BGPMonitor + + + BGPPeer +
10.1.0.32
+ + + +
+
+ +
+ + 65100 + switch-t0 + + +
10.0.0.57
+ + + +
+ +
10.0.0.59
+ + + +
+ +
10.0.0.61
+ + + +
+ +
10.0.0.63
+ + + +
+
+ +
+ + 64600 + ARISTA01T1 + + + + 64600 + ARISTA02T1 + + + + 64600 + ARISTA03T1 + + + + 64600 + ARISTA04T1 + + +
+
+ + + + + + HostIP + Loopback0 + + 10.1.0.32/32 + + 10.1.0.32/32 + + + HostIP1 + Loopback0 + + FC00:1::32/128 + + FC00:1::32/128 + + + LoopbackIP1 + Loopback1 + + 10.10.0.99/32 + + 10.10.0.99/32 + + + LoopbackIP2 + Loopback2 + + 10.21.0.64/32 + + 10.21.0.64/32 + + + LoopbackIP3 + Loopback3 + + 10.21.64.2/32 + + 10.21.64.2/32 + + + + + HostIP + eth0 + + 10.0.0.100/24 + + 10.0.0.100/24 + + + HostIP + eth0 + + 2603:10e2:0:2902::8/64 + + 2603:10e2:0:2902::8/64 + + + + + + + switch-t0 + + + PortChannel01 + fortyGigE0/112 + + + + PortChannel02 + fortyGigE0/116 + + + + PortChannel03 + fortyGigE0/120 + + + + PortChannel04 + fortyGigE0/124 + + + + + + Vlan1000 + fortyGigE0/4;fortyGigE0/8;fortyGigE0/12;fortyGigE0/16;fortyGigE0/20;fortyGigE0/24;fortyGigE0/28;fortyGigE0/32;fortyGigE0/36;fortyGigE0/40;fortyGigE0/44;fortyGigE0/48;fortyGigE0/52;fortyGigE0/56;fortyGigE0/60;fortyGigE0/64;fortyGigE0/68;fortyGigE0/72;fortyGigE0/76;fortyGigE0/80;fortyGigE0/84;fortyGigE0/88;fortyGigE0/92;fortyGigE0/96 + False + 0.0.0.0/0 + + + 192.0.0.1;192.0.0.2 + fc02:2000::1;fc02:2000::2 + 1000 + 1000 + 192.168.0.0/27 + + + + + Vlan2000 + fortyGigE0/112;fortyGigE0/116;fortyGigE0/120 + False + 0.0.0.0/0 + + + + 2000 + 2000 + 192.168.200.0/27 + + + + + Vlan99 + fortyGigE0/100 + False + 0.0.0.0/0 + + UserDefinedL2Vlan + 192.0.0.1;192.0.0.2 + 99 + 99 + + + + + + Vlan98 + fortyGigE0/100;PortChannel01;PortChannel03 + False + 0.0.0.0/0 + + UserDefinedL2Vlan + 192.0.0.1;192.0.0.2 + 98 + 98 + + + + + + + + + PortChannel01 + 10.0.0.56/31 + + + + PortChannel01 + FC00::71/126 + + + + PortChannel02 + 10.0.0.58/31 + + + + PortChannel02 + FC00::75/126 + + + + PortChannel03 + 10.0.0.60/31 + + + + PortChannel03 + FC00::79/126 + + + + PortChannel04 + 10.0.0.62/31 + + + + PortChannel04 + FC00::7D/126 + + + + Vlan1000 + 192.168.0.1/27 + + + + Vlan1000 + fc02:1000::1/64 + + + + Vlan2000 + 192.168.200.1/27 + + + + Vlan1000 + fc02:2000::1/64 + + + + + + ERSPAN + everflow + Everflow + + + ERSPANv6 + everflowV6 + Everflow + + + EGRESS_ERSPAN + everflow_egress + Everflow + + + PortChannel01;PortChannel02;PortChannel03;PortChannel04 + DataAclIngress + DataPlane + + + PortChannel01;PortChannel02;Vlan98 + DataAclEgress + DataPlane + + + SNMP + SNMP_ACL + SNMP + + + NTP + NTP_ACL + NTP + + + SSH + SSH_ACL + SSH + + + SSH + ROUTER-PROTECT + SSH + + + SNMP + ROUTER-PROTECT + SNMP + + + NTP + NTP_ACL + + + + + + + + + + DeviceInterfaceLink + ARISTA01T1 + Ethernet1/1 + switch-t0 + fortyGigE0/112 + + + DeviceInterfaceLink + ARISTA02T1 + Ethernet1/1 + switch-t0 + fortyGigE0/116 + + + DeviceInterfaceLink + ARISTA03T1 + Ethernet1/1 + switch-t0 + fortyGigE0/120 + + + DeviceInterfaceLink + ARISTA04T1 + Ethernet1/1 + switch-t0 + fortyGigE0/124 + 100000 + + + DeviceInterfaceLink + 100000 + switch-t0 + fortyGigE0/4 + true + ARISTA05T1 + Ethernet1/33 + true + + + DeviceInterfaceLink + Servers0 + eth0 + switch-t0 + fortyGigE0/4 + + + DeviceInterfaceLink + Servers100 + eth0 + switch-t0 + fortyGigE0/100 + + + + + switch-t0 + Force10-S6000 + + + ARISTA01T1 + Arista + + + ARISTA02T1 + Arista + + + ARISTA03T1 + Arista + + + ARISTA04T1 + Arista + + + + + + + switch-t0 + + + ErspanDestinationIpv4 + + 2.2.2.2 + + + + + + + + + + + + + AutoNegotiation + + True + + + FECDisabled + + True + + + ARISTA05T1:Ethernet1/33;switch-t0:fortyGigE0/4 + + + + + + AutoNegotiation + + False + + + FECDisabled + + True + + + ARISTA06T1:Ethernet1/34;switch-t0:fortyGigE0/8 + + + + + + + switch-t0 + + + DeploymentId + + 1 + + + + + + + switch-t0 + Force10-S6000 +
diff --git a/src/sonic-config-engine/tests/sample-arista-7050-t0-minigraph.xml b/src/sonic-config-engine/tests/sample-arista-7050-t0-minigraph.xml index 4fd1ba9ba128..e6108561b571 100644 --- a/src/sonic-config-engine/tests/sample-arista-7050-t0-minigraph.xml +++ b/src/sonic-config-engine/tests/sample-arista-7050-t0-minigraph.xml @@ -462,12 +462,10 @@ - true DeviceInterface - true true 1 Ethernet5/1 @@ -480,7 +478,6 @@ DeviceInterface - true true 1 Ethernet6/1 @@ -493,7 +490,6 @@ DeviceInterface - true true 1 Ethernet7/1 @@ -506,7 +502,6 @@ DeviceInterface - true true 1 Ethernet8/1 @@ -519,7 +514,6 @@ DeviceInterface - true true 1 Ethernet9/1 @@ -532,7 +526,6 @@ DeviceInterface - true true 1 Ethernet10/1 @@ -545,7 +538,6 @@ DeviceInterface - true true 1 Ethernet11/1 @@ -558,7 +550,6 @@ DeviceInterface - true true 1 Ethernet12/1 @@ -571,7 +562,6 @@ DeviceInterface - true true 1 Ethernet13/1 @@ -584,7 +574,6 @@ DeviceInterface - true true 1 Ethernet14/1 @@ -597,7 +586,6 @@ DeviceInterface - true true 1 Ethernet15/1 @@ -610,7 +598,6 @@ DeviceInterface - true true 1 Ethernet16/1 @@ -623,7 +610,6 @@ DeviceInterface - true true 1 Ethernet17/1 @@ -636,7 +622,6 @@ DeviceInterface - true true 1 Ethernet18/1 @@ -649,7 +634,6 @@ DeviceInterface - true true 1 Ethernet19/1 @@ -662,7 +646,6 @@ DeviceInterface - true true 1 Ethernet20/1 @@ -675,7 +658,6 @@ DeviceInterface - true true 1 Ethernet21/1 @@ -688,7 +670,6 @@ DeviceInterface - true true 1 Ethernet22/1 @@ -701,7 +682,6 @@ DeviceInterface - true true 1 Ethernet23/1 @@ -714,7 +694,6 @@ DeviceInterface - true true 1 Ethernet24/1 @@ -727,7 +706,6 @@ DeviceInterface - true true 1 Ethernet25/1 @@ -740,7 +718,6 @@ DeviceInterface - true true 1 Ethernet26/1 @@ -753,7 +730,6 @@ DeviceInterface - true true 1 Ethernet27/1 @@ -766,7 +742,6 @@ DeviceInterface - true true 1 Ethernet28/1 @@ -779,7 +754,6 @@ DeviceInterface - true true 1 Ethernet29 @@ -792,7 +766,6 @@ DeviceInterface - true true 1 Ethernet30 @@ -805,7 +778,6 @@ DeviceInterface - true true 1 Ethernet31 @@ -818,7 +790,6 @@ DeviceInterface - true true 1 Ethernet32 @@ -831,7 +802,6 @@ DeviceInterface - true true 1 Ethernet33 @@ -844,7 +814,6 @@ DeviceInterface - true true 1 Ethernet34 @@ -857,7 +826,6 @@ DeviceInterface - true true 1 Ethernet35 @@ -870,7 +838,6 @@ DeviceInterface - true true 1 Ethernet36 @@ -897,11 +864,328 @@ 10.0.0.16 + + ResourceType + + Storage + + + + + + + + AutoNegotiation + + True + + + s7050-dev-1:Ethernet33;ARISTA01T1:Ethernet1 + + + + + + AutoNegotiation + + True + + + s7050-dev-1:Ethernet34;ARISTA02T1:Ethernet1 + + + + + + AutoNegotiation + + True + + + s7050-dev-1:Ethernet35;ARISTA03T1:Ethernet1 + + + + + + AutoNegotiation + + True + + + s7050-dev-1:Ethernet36;ARISTA04T1:Ethernet1 + + + + + + AutoNegotiation + + True + + + Servers0:eth0;s7050-dev-1:Ethernet6/1 + + + + + + AutoNegotiation + + True + + + Servers1:eth0;s7050-dev-1:Ethernet7/1 + + + + + + AutoNegotiation + + True + + + Servers2:eth0;s7050-dev-1:Ethernet8/1 + + + + + + AutoNegotiation + + True + + + Servers3:eth0;s7050-dev-1:Ethernet9/1 + + + + + + AutoNegotiation + + True + + + Servers4:eth0;s7050-dev-1:Ethernet10/1 + + + + + + AutoNegotiation + + True + + + Servers5:eth0;s7050-dev-1:Ethernet11/1 + + + + + + AutoNegotiation + + True + + + Servers6:eth0;s7050-dev-1:Ethernet12/1 + + + + + + AutoNegotiation + + True + + + Servers7:eth0;s7050-dev-1:Ethernet13/1 + + + + + + AutoNegotiation + + True + + + Servers8:eth0;s7050-dev-1:Ethernet14/1 + + + + + + AutoNegotiation + + True + + + Servers9:eth0;s7050-dev-1:Ethernet15/1 + + + + + + AutoNegotiation + + True + + + Servers10:eth0;s7050-dev-1:Ethernet16/1 + + + + + + AutoNegotiation + + True + + + Servers11:eth0;s7050-dev-1:Ethernet17/1 + + + + + + AutoNegotiation + + True + + + Servers12:eth0;s7050-dev-1:Ethernet18/1 + + + + + + AutoNegotiation + + True + + + Servers13:eth0;s7050-dev-1:Ethernet19/1 + + + + + + AutoNegotiation + + True + + + Servers14:eth0;s7050-dev-1:Ethernet20/1 + + + + + + AutoNegotiation + + True + + + Servers15:eth0;s7050-dev-1:Ethernet21/1 + + + + + + AutoNegotiation + + True + + + Servers16:eth0;s7050-dev-1:Ethernet22/1 + + + + + + AutoNegotiation + + True + + + Servers17:eth0;s7050-dev-1:Ethernet23/1 + + + + + + AutoNegotiation + + True + + + Servers18:eth0;s7050-dev-1:Ethernet24/1 + + + + + + AutoNegotiation + + True + + + Servers19:eth0;s7050-dev-1:Ethernet25/1 + + + + + + AutoNegotiation + + True + + + Servers20:eth0;s7050-dev-1:Ethernet26/1 + + + + + + AutoNegotiation + + True + + + Servers21:eth0;s7050-dev-1:Ethernet27/1 + + + + + + AutoNegotiation + + True + + + Servers22:eth0;s7050-dev-1:Ethernet28/1 + + + + + + AutoNegotiation + + True + + + Servers23:eth0;s7050-dev-1:Ethernet29/1 + + + s7050-dev-1 Arista-7050-QX-32S diff --git a/src/sonic-config-engine/tests/sample-arista-7050-t0-storage-backend-minigraph.xml b/src/sonic-config-engine/tests/sample-arista-7050-t0-storage-backend-minigraph.xml new file mode 100644 index 000000000000..cadd47217a71 --- /dev/null +++ b/src/sonic-config-engine/tests/sample-arista-7050-t0-storage-backend-minigraph.xml @@ -0,0 +1,781 @@ + + + + + + switch-t0 + 10.1.0.32 + BGPMonitor + 10.20.30.40 + 30 + 10 + 3 + + + false + switch-t0 + 10.0.0.58 + ARISTA02T1 + 10.0.0.59 + 1 + 180 + 60 + + + switch-t0 + FC00::75 + ARISTA02T1 + FC00::76 + 1 + 180 + 60 + + + switch-t0 + FC00::75 + ARISTA02T1 + FC00::76 + 1 + 180 + 60 + + + false + switch-t0 + 10.2.0.20 + CHASSIS_PEER + 10.2.0.21 + 1 + 180 + 60 + voq + + + + + 1 + + BGPMonitor + + + BGPPeer +
10.1.0.32
+ + + +
+
+ +
+ + 65100 + switch-t0 + + +
10.0.0.59
+ + + +
+ +
10.2.0.21
+ + + +
+
+ +
+ + 64600 + ARISTA01T1 + + + + 64600 + ARISTA02T1 + + + + 64600 + ARISTA03T1 + + + + 64600 + ARISTA04T1 + + + + 65100 + CHASSIS_PEER + + +
+
+ + + + + + HostIP + Loopback0 + + 10.1.0.32/32 + + 10.1.0.32/32 + + + HostIP1 + Loopback0 + + FC00:1::32/128 + + FC00:1::32/128 + + + + + HostIP + eth0 + + 10.0.0.100/24 + + 10.0.0.100/24 + + + + + + + switch-t0 + + + PortChannel1 + fortyGigE0/4 + + + + + + ab1 + fortyGigE0/8 + 192.0.0.1;192.0.0.2 + 1000 + 1000 + 192.168.0.0/27 + + + ab4 + fortyGigE0/8 + 192.0.0.1;192.0.0.2 + 1001 + 1001 + 192.168.0.32/27 + + + kk1 + fortyGigE0/12 + 192.0.0.1;192.0.0.2 + 2020 + 2020 + Tagged + 192.168.0.0/28 + + + ab2 + fortyGigE0/12 + 192.0.0.1;192.0.0.2 + 2000 + 2000 + Tagged + 192.168.0.240/27 + + + ab3 + fortyGigE0/12 + 192.0.0.1;192.0.0.2 + 2001 + 2001 + 192.168.0.240/27 + + + + + + PortChannel1 + 10.0.0.56/31 + + + + PortChannel1 + FC00::71/126 + + + + fortyGigE0/0 + 10.0.0.58/31 + + + + fortyGigE0/0 + FC00::75/126 + + + + ab1 + 192.168.0.1/27 + + + + + + DataAcl + + ERSPAN + everflow + Everflow + 0 + everflow.xml + + + DataAcl + + ERSPANv6 + everflowV6 + Everflow + 0 + everflow.xml + + + DataAcl + + Loopback0 + ipv6-mgmt-only + Management + 0 + + + + DataAcl + + Loopback0 + mgmt-only + Management + 0 + + + + DataAcl + + StaticERSPAN + everflowStatic + Everflow + 0 + everflow.xml + + + + + + + + + + DeviceInterfaceLink + 1000 + ARISTA01T1 + et1 + true + switch-t0 + fortyGigE0/8 + true + + + DeviceMgmtLink + 1000 + switch-t0 + fortyGigE0/16 + true + ChassisMTS1 + mgmt0 + true + + + + + switch-t0 + Arista-7050-QX-32S + AAA00PrdStr00 + + + ARISTA01T1 + Arista + + + ARISTA02T1 + Arista + + + ARISTA03T1 + Arista + + + ARISTA04T1 + Arista + + + + + + + + DeviceInterface + + true + 1 + fortyGigE0/0 + + false + 0 + 0 + 10000 + + + DeviceInterface + + true + 1 + Ethernet1 + + false + 0 + 0 + 10000 + + + DeviceInterface + + true + 1 + Ethernet2 + + false + 0 + 0 + 10000 + + + DeviceInterface + + true + 1 + fortyGigE0/4 + + false + 0 + 0 + 25000 + + + DeviceInterface + + true + 1 + fortyGigE0/8 + + false + 0 + 0 + 40000 + Interface description + + + DeviceInterface + + true + 1 + fortyGigE0/12 + + false + 0 + 0 + 100000 + Interface description + + + DeviceInterface + + true + 1 + fortyGigE0/16 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/20 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/24 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/28 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/32 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/36 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/40 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/44 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/48 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/52 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/56 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/60 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/64 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/68 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/72 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/76 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/80 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/84 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/88 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/92 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/96 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/100 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/104 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/108 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/112 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/116 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/120 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/124 + + false + 0 + 0 + 100000 + + + true + 0 + Arista-7050-QX-32S + + + DeviceInterface + + 1 + Management1 + false + mgmt1 + 1000 + + + + + + + + switch-t0 + + + DeploymentId + + 1 + + + ResourceType + + Storage + + + + + + + switch-t0 + Arista-7050-QX-32S +
diff --git a/src/sonic-config-engine/tests/sample-arista-7050cx3-dualtor-minigraph-remap-disabled.xml b/src/sonic-config-engine/tests/sample-arista-7050cx3-dualtor-minigraph-remap-disabled.xml new file mode 100644 index 000000000000..9ffb8230a6bf --- /dev/null +++ b/src/sonic-config-engine/tests/sample-arista-7050cx3-dualtor-minigraph-remap-disabled.xml @@ -0,0 +1,2369 @@ + + + + + + false + str2-7050cx3-acs-10 + 10.0.0.56 + ARISTA01T1 + 10.0.0.57 + 1 + 10 + 3 + + + str2-7050cx3-acs-10 + FC00::71 + ARISTA01T1 + FC00::72 + 1 + 10 + 3 + + + false + str2-7050cx3-acs-10 + 10.0.0.58 + ARISTA02T1 + 10.0.0.59 + 1 + 10 + 3 + + + str2-7050cx3-acs-10 + FC00::75 + ARISTA02T1 + FC00::76 + 1 + 10 + 3 + + + false + str2-7050cx3-acs-10 + 10.0.0.60 + ARISTA03T1 + 10.0.0.61 + 1 + 10 + 3 + + + str2-7050cx3-acs-10 + FC00::79 + ARISTA03T1 + FC00::7A + 1 + 10 + 3 + + + false + str2-7050cx3-acs-10 + 10.0.0.62 + ARISTA04T1 + 10.0.0.63 + 1 + 10 + 3 + + + str2-7050cx3-acs-10 + FC00::7D + ARISTA04T1 + FC00::7E + 1 + 10 + 3 + + + + + 65100 + str2-7050cx3-acs-10 + + +
10.0.0.57
+ + + +
+ +
10.0.0.59
+ + + +
+ +
10.0.0.61
+ + + +
+ +
10.0.0.63
+ + + +
+ + BGPPeer +
10.1.0.32
+ + + + BGPSLBPassive + 10.255.0.0/25 +
+ + BGPPeer +
10.1.0.32
+ + + + BGPVac + 192.168.0.0/21 +
+
+ +
+ + 64600 + ARISTA01T1 + + + + 64600 + ARISTA02T1 + + + + 64600 + ARISTA03T1 + + + + 64600 + ARISTA04T1 + + +
+
+ + + + + + HostIP + Loopback0 + + 10.1.0.32/32 + + 10.1.0.32/32 + + + HostIP1 + Loopback0 + + FC00:1::32/128 + + FC00:1::32/128 + + + HostIP2 + Loopback1 + + 10.1.0.34/32 + + 10.1.0.34/32 + + + HostIP3 + Loopback1 + + FC00:1::34/128 + + FC00:1::34/128 + + HostIP6 + Loopback3 + + 10.1.0.38/32 + + 10.1.0.38/32 + + + HostIP7 + Loopback3 + + FC00:1::38/128 + + FC00:1::38/128 + + HostIP4 + Loopback2 + + 10.1.0.36/32 + + 10.1.0.36/32 + + + HostIP5 + Loopback2 + + FC00:1::36/128 + + FC00:1::36/128 + + + + HostIP + eth0 + + 10.3.146.122/23 + + 10.3.146.122/23 + + + V6HostIP + eth0 + + FC00:2::32/64 + + FC00:2::32/64 + + + + + + + str2-7050cx3-acs-10 + + + PortChannel101 + Ethernet7/1;Ethernet8/1 + + + + PortChannel102 + Ethernet9/1;Ethernet10/1 + + + + PortChannel103 + Ethernet23/1;Ethernet24/1 + + + + PortChannel104 + Ethernet25/1;Ethernet26/1 + + + + + + + + + Vlan1000 + Ethernet1/1;Ethernet2/1;Ethernet3/1;Ethernet4/1;Ethernet5/1;Ethernet6/1;Ethernet11/1;Ethernet12/1;Ethernet13/1;Ethernet14/1;Ethernet15/1;Ethernet16/1;Ethernet17/1;Ethernet18/1;Ethernet19/1;Ethernet20/1;Ethernet21/1;Ethernet22/1;Ethernet27/1;Ethernet28/1;Ethernet29/1;Ethernet30/1;Ethernet31/1;Ethernet32/1 + False + 0.0.0.0/0 + 192.0.0.1;192.0.0.2;192.0.0.3;192.0.0.4;192.0.0.5;192.0.0.6;192.0.0.7;192.0.0.8;192.0.0.9;192.0.0.10;192.0.0.11;192.0.0.12;192.0.0.13;192.0.0.14;192.0.0.15;192.0.0.16;192.0.0.17;192.0.0.18;192.0.0.19;192.0.0.20;192.0.0.21;192.0.0.22;192.0.0.23;192.0.0.24;192.0.0.25;192.0.0.26;192.0.0.27;192.0.0.28;192.0.0.29;192.0.0.30;192.0.0.31;192.0.0.32;192.0.0.33;192.0.0.34;192.0.0.35;192.0.0.36;192.0.0.37;192.0.0.38;192.0.0.39;192.0.0.40;192.0.0.41;192.0.0.42;192.0.0.43;192.0.0.44;192.0.0.45;192.0.0.46;192.0.0.47;192.0.0.48 + fc02:2000::1;fc02:2000::2;fc02:2000::3;fc02:2000::4 + 1000 + 1000 + 192.168.0.0/21 + 00:aa:bb:cc:dd:ee + + + + + + PortChannel101 + 10.0.0.56/31 + + + + PortChannel101 + FC00::71/126 + + + + PortChannel102 + 10.0.0.58/31 + + + + PortChannel102 + FC00::75/126 + + + + PortChannel103 + 10.0.0.60/31 + + + + PortChannel103 + FC00::79/126 + + + + PortChannel104 + 10.0.0.62/31 + + + + PortChannel104 + FC00::7D/126 + + + + Vlan1000 + 192.168.0.1/21 + + + + Vlan1000 + fc02:1000::1/64 + + + + + + NTP_ACL + NTP + NTP + + + SNMP_ACL + SNMP + SNMP + + + ERSPAN + Everflow + Everflow + + + ERSPANV6 + EverflowV6 + EverflowV6 + + + VTY_LINE + ssh-only + SSH + + + + + + + + + + DeviceInterfaceLink + ARISTA01T1 + Ethernet1 + str2-7050cx3-acs-10 + Ethernet7/1 + + + DeviceInterfaceLink + ARISTA01T1 + Ethernet2 + str2-7050cx3-acs-10 + Ethernet8/1 + + + DeviceInterfaceLink + ARISTA02T1 + Ethernet1 + str2-7050cx3-acs-10 + Ethernet9/1 + + + DeviceInterfaceLink + ARISTA02T1 + Ethernet2 + str2-7050cx3-acs-10 + Ethernet10/1 + + + DeviceInterfaceLink + ARISTA03T1 + Ethernet1 + str2-7050cx3-acs-10 + Ethernet23/1 + + + DeviceInterfaceLink + ARISTA03T1 + Ethernet2 + str2-7050cx3-acs-10 + Ethernet24/1 + + + DeviceInterfaceLink + ARISTA04T1 + Ethernet1 + str2-7050cx3-acs-10 + Ethernet25/1 + + + DeviceInterfaceLink + ARISTA04T1 + Ethernet2 + str2-7050cx3-acs-10 + Ethernet26/1 + + + DeviceInterfaceLink + str2-7050cx3-acs-10 + Ethernet1/1 + Servers0 + eth0 + + + DeviceInterfaceLink + str2-7050cx3-acs-10 + Ethernet2/1 + Servers1 + eth0 + + + DeviceInterfaceLink + str2-7050cx3-acs-10 + Ethernet3/1 + Servers2 + eth0 + + + DeviceInterfaceLink + str2-7050cx3-acs-10 + Ethernet4/1 + Servers3 + eth0 + + + DeviceInterfaceLink + str2-7050cx3-acs-10 + Ethernet5/1 + Servers4 + eth0 + + + DeviceInterfaceLink + str2-7050cx3-acs-10 + Ethernet6/1 + Servers5 + eth0 + + + DeviceInterfaceLink + str2-7050cx3-acs-10 + Ethernet11/1 + Servers6 + eth0 + + + DeviceInterfaceLink + str2-7050cx3-acs-10 + Ethernet12/1 + Servers7 + eth0 + + + DeviceInterfaceLink + str2-7050cx3-acs-10 + Ethernet13/1 + Servers8 + eth0 + + + DeviceInterfaceLink + str2-7050cx3-acs-10 + Ethernet14/1 + Servers9 + eth0 + + + DeviceInterfaceLink + str2-7050cx3-acs-10 + Ethernet15/1 + Servers10 + eth0 + + + DeviceInterfaceLink + str2-7050cx3-acs-10 + Ethernet16/1 + Servers11 + eth0 + + + DeviceInterfaceLink + str2-7050cx3-acs-10 + Ethernet17/1 + Servers12 + eth0 + + + DeviceInterfaceLink + str2-7050cx3-acs-10 + Ethernet18/1 + Servers13 + eth0 + + + DeviceInterfaceLink + str2-7050cx3-acs-10 + Ethernet19/1 + Servers14 + eth0 + + + DeviceInterfaceLink + str2-7050cx3-acs-10 + Ethernet20/1 + Servers15 + eth0 + + + DeviceInterfaceLink + str2-7050cx3-acs-10 + Ethernet21/1 + Servers16 + eth0 + + + DeviceInterfaceLink + str2-7050cx3-acs-10 + Ethernet22/1 + Servers17 + eth0 + + + DeviceInterfaceLink + str2-7050cx3-acs-10 + Ethernet27/1 + Servers18 + eth0 + + + DeviceInterfaceLink + str2-7050cx3-acs-10 + Ethernet28/1 + Servers19 + eth0 + + + DeviceInterfaceLink + str2-7050cx3-acs-10 + Ethernet29/1 + Servers20 + eth0 + + + DeviceInterfaceLink + str2-7050cx3-acs-10 + Ethernet30/1 + Servers21 + eth0 + + + DeviceInterfaceLink + str2-7050cx3-acs-10 + Ethernet31/1 + Servers22 + eth0 + + + DeviceInterfaceLink + str2-7050cx3-acs-10 + Ethernet32/1 + Servers23 + eth0 + + + LogicalLink + str2-7050cx3-acs-10 + Ethernet1/1 + str2-7050cx3-acs-10-Servers0-SC + U + + + LogicalLink + str2-7050cx3-acs-10 + Ethernet2/1 + str2-7050cx3-acs-10-Servers1-SC + U + + + LogicalLink + str2-7050cx3-acs-10 + Ethernet3/1 + str2-7050cx3-acs-10-Servers2-SC + U + + + LogicalLink + str2-7050cx3-acs-10 + Ethernet4/1 + str2-7050cx3-acs-10-Servers3-SC + U + + + LogicalLink + str2-7050cx3-acs-10 + Ethernet5/1 + str2-7050cx3-acs-10-Servers4-SC + U + + + LogicalLink + str2-7050cx3-acs-10 + Ethernet6/1 + str2-7050cx3-acs-10-Servers5-SC + U + + + LogicalLink + str2-7050cx3-acs-10 + Ethernet11/1 + str2-7050cx3-acs-10-Servers6-SC + U + + + LogicalLink + str2-7050cx3-acs-10 + Ethernet12/1 + str2-7050cx3-acs-10-Servers7-SC + U + + + LogicalLink + str2-7050cx3-acs-10 + Ethernet13/1 + str2-7050cx3-acs-10-Servers8-SC + U + + + LogicalLink + str2-7050cx3-acs-10 + Ethernet14/1 + str2-7050cx3-acs-10-Servers9-SC + U + + + LogicalLink + str2-7050cx3-acs-10 + Ethernet15/1 + str2-7050cx3-acs-10-Servers10-SC + U + + + LogicalLink + str2-7050cx3-acs-10 + Ethernet16/1 + str2-7050cx3-acs-10-Servers11-SC + U + + + LogicalLink + str2-7050cx3-acs-10 + Ethernet17/1 + str2-7050cx3-acs-10-Servers12-SC + U + + + LogicalLink + str2-7050cx3-acs-10 + Ethernet18/1 + str2-7050cx3-acs-10-Servers13-SC + U + + + LogicalLink + str2-7050cx3-acs-10 + Ethernet19/1 + str2-7050cx3-acs-10-Servers14-SC + U + + + LogicalLink + str2-7050cx3-acs-10 + Ethernet20/1 + str2-7050cx3-acs-10-Servers15-SC + U + + + LogicalLink + str2-7050cx3-acs-10 + Ethernet21/1 + str2-7050cx3-acs-10-Servers16-SC + U + + + LogicalLink + str2-7050cx3-acs-10 + Ethernet22/1 + str2-7050cx3-acs-10-Servers17-SC + U + + + LogicalLink + str2-7050cx3-acs-10 + Ethernet27/1 + str2-7050cx3-acs-10-Servers18-SC + U + + + LogicalLink + str2-7050cx3-acs-10 + Ethernet28/1 + str2-7050cx3-acs-10-Servers19-SC + U + + + LogicalLink + str2-7050cx3-acs-10 + Ethernet29/1 + str2-7050cx3-acs-10-Servers20-SC + U + + + LogicalLink + str2-7050cx3-acs-10 + Ethernet30/1 + str2-7050cx3-acs-10-Servers21-SC + U + + + LogicalLink + str2-7050cx3-acs-10 + Ethernet31/1 + str2-7050cx3-acs-10-Servers22-SC + U + + + LogicalLink + str2-7050cx3-acs-10 + Ethernet32/1 + str2-7050cx3-acs-10-Servers23-SC + U + + + + + str2-7050cx3-acs-10 + Arista-7050CX3-32S-D48C8 +
+ 10.1.0.32/32 +
+ + FC00:1::32/128 + + + 10.3.146.122 + +
+ + str2-7050cx3-acs-11 + Arista-7050CX3-32S-D48C8 +
+ 10.1.0.33/32 +
+ + FC00:1::33/128 + + + 10.3.146.127 + +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7050cx3-acs-10-Servers0-SC +
+ + Server +
+ 192.168.0.2/26 +
+ + fc02:1000::2/96 + + + 0.0.0.0/0 + + Servers0 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7050cx3-acs-10-Servers1-SC +
+ + Server +
+ 192.168.0.3/26 +
+ + fc02:1000::3/96 + + + 0.0.0.0/0 + + Servers1 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7050cx3-acs-10-Servers2-SC +
+ + Server +
+ 192.168.0.4/26 +
+ + fc02:1000::4/96 + + + 0.0.0.0/0 + + Servers2 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7050cx3-acs-10-Servers3-SC +
+ + Server +
+ 192.168.0.5/26 +
+ + fc02:1000::5/96 + + + 0.0.0.0/0 + + Servers3 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7050cx3-acs-10-Servers4-SC +
+ + Server +
+ 192.168.0.6/26 +
+ + fc02:1000::6/96 + + + 0.0.0.0/0 + + Servers4 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7050cx3-acs-10-Servers5-SC +
+ + Server +
+ 192.168.0.7/26 +
+ + fc02:1000::7/96 + + + 0.0.0.0/0 + + Servers5 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7050cx3-acs-10-Servers6-SC +
+ + Server +
+ 192.168.0.8/26 +
+ + fc02:1000::8/96 + + + 0.0.0.0/0 + + Servers6 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7050cx3-acs-10-Servers7-SC +
+ + Server +
+ 192.168.0.9/26 +
+ + fc02:1000::9/96 + + + 0.0.0.0/0 + + Servers7 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7050cx3-acs-10-Servers8-SC +
+ + Server +
+ 192.168.0.10/26 +
+ + fc02:1000::a/96 + + + 0.0.0.0/0 + + Servers8 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7050cx3-acs-10-Servers9-SC +
+ + Server +
+ 192.168.0.11/26 +
+ + fc02:1000::b/96 + + + 0.0.0.0/0 + + Servers9 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7050cx3-acs-10-Servers10-SC +
+ + Server +
+ 192.168.0.12/26 +
+ + fc02:1000::c/96 + + + 0.0.0.0/0 + + Servers10 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7050cx3-acs-10-Servers11-SC +
+ + Server +
+ 192.168.0.13/26 +
+ + fc02:1000::d/96 + + + 0.0.0.0/0 + + Servers11 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7050cx3-acs-10-Servers12-SC +
+ + Server +
+ 192.168.0.14/26 +
+ + fc02:1000::e/96 + + + 0.0.0.0/0 + + Servers12 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7050cx3-acs-10-Servers13-SC +
+ + Server +
+ 192.168.0.15/26 +
+ + fc02:1000::f/96 + + + 0.0.0.0/0 + + Servers13 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7050cx3-acs-10-Servers14-SC +
+ + Server +
+ 192.168.0.16/26 +
+ + fc02:1000::10/96 + + + 0.0.0.0/0 + + Servers14 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7050cx3-acs-10-Servers15-SC +
+ + Server +
+ 192.168.0.17/26 +
+ + fc02:1000::11/96 + + + 0.0.0.0/0 + + Servers15 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7050cx3-acs-10-Servers16-SC +
+ + Server +
+ 192.168.0.18/26 +
+ + fc02:1000::12/96 + + + 0.0.0.0/0 + + Servers16 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7050cx3-acs-10-Servers17-SC +
+ + Server +
+ 192.168.0.19/26 +
+ + fc02:1000::13/96 + + + 0.0.0.0/0 + + Servers17 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7050cx3-acs-10-Servers18-SC +
+ + Server +
+ 192.168.0.20/26 +
+ + fc02:1000::14/96 + + + 0.0.0.0/0 + + Servers18 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7050cx3-acs-10-Servers19-SC +
+ + Server +
+ 192.168.0.21/26 +
+ + fc02:1000::15/96 + + + 0.0.0.0/0 + + Servers19 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7050cx3-acs-10-Servers20-SC +
+ + Server +
+ 192.168.0.22/26 +
+ + fc02:1000::16/96 + + + 0.0.0.0/0 + + Servers20 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7050cx3-acs-10-Servers21-SC +
+ + Server +
+ 192.168.0.23/26 +
+ + fc02:1000::17/96 + + + 0.0.0.0/0 + + Servers21 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7050cx3-acs-10-Servers22-SC +
+ + Server +
+ 192.168.0.24/26 +
+ + fc02:1000::18/96 + + + 0.0.0.0/0 + + Servers22 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7050cx3-acs-10-Servers23-SC +
+ + Server +
+ 192.168.0.25/26 +
+ + fc02:1000::19/96 + + + 0.0.0.0/0 + + Servers23 +
+ + ARISTA04T1 + + 172.16.142.63 + + Arista-VM + + + ARISTA03T1 + + 172.16.142.62 + + Arista-VM + + + ARISTA02T1 + + 172.16.142.61 + + Arista-VM + + + ARISTA01T1 + + 172.16.142.60 + + Arista-VM + +
+
+ + + true + + + DeviceInterface + + true + true + 1 + Ethernet1/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet1/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet2/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet2/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet3/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet3/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet4/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet4/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet5/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet5/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet6/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet6/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet7/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet8/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet9/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet10/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet11/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet11/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet12/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet12/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet13/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet13/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet14/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet14/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet15/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet15/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet16/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet16/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet17/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet17/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet18/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet18/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet19/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet19/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet20/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet20/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet21/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet21/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet22/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet22/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet23/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet24/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet25/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet26/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet27/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet27/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet28/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet28/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet29/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet29/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet30/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet30/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet31/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet31/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet32/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet32/3 + + false + 0 + 0 + 50000 + + + true + 0 + Arista-7050CX3-32S-D48C8 + + + + + + + str2-7050cx3-acs-10 + + + DeploymentId + + 1 + + + QosProfile + + Profile0 + + + GeminiEnabled + + True + + + DhcpResources + + 192.0.0.1;192.0.0.2;192.0.0.3;192.0.0.4;192.0.0.5;192.0.0.6;192.0.0.7;192.0.0.8;192.0.0.9;192.0.0.10;192.0.0.11;192.0.0.12;192.0.0.13;192.0.0.14;192.0.0.15;192.0.0.16;192.0.0.17;192.0.0.18;192.0.0.19;192.0.0.20;192.0.0.21;192.0.0.22;192.0.0.23;192.0.0.24;192.0.0.25;192.0.0.26;192.0.0.27;192.0.0.28;192.0.0.29;192.0.0.30;192.0.0.31;192.0.0.32;192.0.0.33;192.0.0.34;192.0.0.35;192.0.0.36;192.0.0.37;192.0.0.38;192.0.0.39;192.0.0.40;192.0.0.41;192.0.0.42;192.0.0.43;192.0.0.44;192.0.0.45;192.0.0.46;192.0.0.47;192.0.0.48 + + + NtpResources + + 10.20.8.129;10.20.8.130 + + + SnmpResources + + 10.3.145.98 + + + SyslogResources + + 10.64.246.95 + + + TacacsGroup + + Starlab + + + TacacsServer + + 100.127.20.21 + + + ForcedMgmtRoutes + + 10.3.145.98/31;10.3.145.8;100.127.20.16/28;10.3.149.170/31;40.122.216.24;13.91.48.226;10.3.145.14;10.64.246.0/24;10.3.146.0/23;10.64.5.5 + + + ErspanDestinationIpv4 + + 10.20.6.16 + + + + + + + + + + + + + GeminiPeeringLink + + True + + + UpperTOR + + str2-7050cx3-acs-10 + + + LowerTOR + + str2-7050cx3-acs-11 + + + str2-7050cx3-acs-11:MuxTunnel0;str2-7050cx3-acs-10:MuxTunnel0 + + + + str2-7050cx3-acs-10 + Arista-7050CX3-32S-D48C8 +
diff --git a/src/sonic-config-engine/tests/sample-arista-7050cx3-dualtor-minigraph.xml b/src/sonic-config-engine/tests/sample-arista-7050cx3-dualtor-minigraph.xml new file mode 100644 index 000000000000..521b5c5ae074 --- /dev/null +++ b/src/sonic-config-engine/tests/sample-arista-7050cx3-dualtor-minigraph.xml @@ -0,0 +1,2374 @@ + + + + + + false + str2-7050cx3-acs-10 + 10.0.0.56 + ARISTA01T1 + 10.0.0.57 + 1 + 10 + 3 + + + str2-7050cx3-acs-10 + FC00::71 + ARISTA01T1 + FC00::72 + 1 + 10 + 3 + + + false + str2-7050cx3-acs-10 + 10.0.0.58 + ARISTA02T1 + 10.0.0.59 + 1 + 10 + 3 + + + str2-7050cx3-acs-10 + FC00::75 + ARISTA02T1 + FC00::76 + 1 + 10 + 3 + + + false + str2-7050cx3-acs-10 + 10.0.0.60 + ARISTA03T1 + 10.0.0.61 + 1 + 10 + 3 + + + str2-7050cx3-acs-10 + FC00::79 + ARISTA03T1 + FC00::7A + 1 + 10 + 3 + + + false + str2-7050cx3-acs-10 + 10.0.0.62 + ARISTA04T1 + 10.0.0.63 + 1 + 10 + 3 + + + str2-7050cx3-acs-10 + FC00::7D + ARISTA04T1 + FC00::7E + 1 + 10 + 3 + + + + + 65100 + str2-7050cx3-acs-10 + + +
10.0.0.57
+ + + +
+ +
10.0.0.59
+ + + +
+ +
10.0.0.61
+ + + +
+ +
10.0.0.63
+ + + +
+ + BGPPeer +
10.1.0.32
+ + + + BGPSLBPassive + 10.255.0.0/25 +
+ + BGPPeer +
10.1.0.32
+ + + + BGPVac + 192.168.0.0/21 +
+
+ +
+ + 64600 + ARISTA01T1 + + + + 64600 + ARISTA02T1 + + + + 64600 + ARISTA03T1 + + + + 64600 + ARISTA04T1 + + +
+
+ + + + + + HostIP + Loopback0 + + 10.1.0.32/32 + + 10.1.0.32/32 + + + HostIP1 + Loopback0 + + FC00:1::32/128 + + FC00:1::32/128 + + + HostIP2 + Loopback1 + + 10.1.0.34/32 + + 10.1.0.34/32 + + + HostIP3 + Loopback1 + + FC00:1::34/128 + + FC00:1::34/128 + + HostIP6 + Loopback3 + + 10.1.0.38/32 + + 10.1.0.38/32 + + + HostIP7 + Loopback3 + + FC00:1::38/128 + + FC00:1::38/128 + + HostIP4 + Loopback2 + + 10.1.0.36/32 + + 10.1.0.36/32 + + + HostIP5 + Loopback2 + + FC00:1::36/128 + + FC00:1::36/128 + + + + HostIP + eth0 + + 10.3.146.122/23 + + 10.3.146.122/23 + + + V6HostIP + eth0 + + FC00:2::32/64 + + FC00:2::32/64 + + + + + + + str2-7050cx3-acs-10 + + + PortChannel101 + Ethernet7/1;Ethernet8/1 + + + + PortChannel102 + Ethernet9/1;Ethernet10/1 + + + + PortChannel103 + Ethernet23/1;Ethernet24/1 + + + + PortChannel104 + Ethernet25/1;Ethernet26/1 + + + + + + + + + Vlan1000 + Ethernet1/1;Ethernet2/1;Ethernet3/1;Ethernet4/1;Ethernet5/1;Ethernet6/1;Ethernet11/1;Ethernet12/1;Ethernet13/1;Ethernet14/1;Ethernet15/1;Ethernet16/1;Ethernet17/1;Ethernet18/1;Ethernet19/1;Ethernet20/1;Ethernet21/1;Ethernet22/1;Ethernet27/1;Ethernet28/1;Ethernet29/1;Ethernet30/1;Ethernet31/1;Ethernet32/1 + False + 0.0.0.0/0 + 192.0.0.1;192.0.0.2;192.0.0.3;192.0.0.4;192.0.0.5;192.0.0.6;192.0.0.7;192.0.0.8;192.0.0.9;192.0.0.10;192.0.0.11;192.0.0.12;192.0.0.13;192.0.0.14;192.0.0.15;192.0.0.16;192.0.0.17;192.0.0.18;192.0.0.19;192.0.0.20;192.0.0.21;192.0.0.22;192.0.0.23;192.0.0.24;192.0.0.25;192.0.0.26;192.0.0.27;192.0.0.28;192.0.0.29;192.0.0.30;192.0.0.31;192.0.0.32;192.0.0.33;192.0.0.34;192.0.0.35;192.0.0.36;192.0.0.37;192.0.0.38;192.0.0.39;192.0.0.40;192.0.0.41;192.0.0.42;192.0.0.43;192.0.0.44;192.0.0.45;192.0.0.46;192.0.0.47;192.0.0.48 + fc02:2000::1;fc02:2000::2;fc02:2000::3;fc02:2000::4 + 1000 + 1000 + 192.168.0.0/21 + 00:aa:bb:cc:dd:ee + + + + + + PortChannel101 + 10.0.0.56/31 + + + + PortChannel101 + FC00::71/126 + + + + PortChannel102 + 10.0.0.58/31 + + + + PortChannel102 + FC00::75/126 + + + + PortChannel103 + 10.0.0.60/31 + + + + PortChannel103 + FC00::79/126 + + + + PortChannel104 + 10.0.0.62/31 + + + + PortChannel104 + FC00::7D/126 + + + + Vlan1000 + 192.168.0.1/21 + + + + Vlan1000 + fc02:1000::1/64 + + + + + + NTP_ACL + NTP + NTP + + + SNMP_ACL + SNMP + SNMP + + + ERSPAN + Everflow + Everflow + + + ERSPANV6 + EverflowV6 + EverflowV6 + + + VTY_LINE + ssh-only + SSH + + + + + + + + + + DeviceInterfaceLink + ARISTA01T1 + Ethernet1 + str2-7050cx3-acs-10 + Ethernet7/1 + + + DeviceInterfaceLink + ARISTA01T1 + Ethernet2 + str2-7050cx3-acs-10 + Ethernet8/1 + + + DeviceInterfaceLink + ARISTA02T1 + Ethernet1 + str2-7050cx3-acs-10 + Ethernet9/1 + + + DeviceInterfaceLink + ARISTA02T1 + Ethernet2 + str2-7050cx3-acs-10 + Ethernet10/1 + + + DeviceInterfaceLink + ARISTA03T1 + Ethernet1 + str2-7050cx3-acs-10 + Ethernet23/1 + + + DeviceInterfaceLink + ARISTA03T1 + Ethernet2 + str2-7050cx3-acs-10 + Ethernet24/1 + + + DeviceInterfaceLink + ARISTA04T1 + Ethernet1 + str2-7050cx3-acs-10 + Ethernet25/1 + + + DeviceInterfaceLink + ARISTA04T1 + Ethernet2 + str2-7050cx3-acs-10 + Ethernet26/1 + + + DeviceInterfaceLink + str2-7050cx3-acs-10 + Ethernet1/1 + Servers0 + eth0 + + + DeviceInterfaceLink + str2-7050cx3-acs-10 + Ethernet2/1 + Servers1 + eth0 + + + DeviceInterfaceLink + str2-7050cx3-acs-10 + Ethernet3/1 + Servers2 + eth0 + + + DeviceInterfaceLink + str2-7050cx3-acs-10 + Ethernet4/1 + Servers3 + eth0 + + + DeviceInterfaceLink + str2-7050cx3-acs-10 + Ethernet5/1 + Servers4 + eth0 + + + DeviceInterfaceLink + str2-7050cx3-acs-10 + Ethernet6/1 + Servers5 + eth0 + + + DeviceInterfaceLink + str2-7050cx3-acs-10 + Ethernet11/1 + Servers6 + eth0 + + + DeviceInterfaceLink + str2-7050cx3-acs-10 + Ethernet12/1 + Servers7 + eth0 + + + DeviceInterfaceLink + str2-7050cx3-acs-10 + Ethernet13/1 + Servers8 + eth0 + + + DeviceInterfaceLink + str2-7050cx3-acs-10 + Ethernet14/1 + Servers9 + eth0 + + + DeviceInterfaceLink + str2-7050cx3-acs-10 + Ethernet15/1 + Servers10 + eth0 + + + DeviceInterfaceLink + str2-7050cx3-acs-10 + Ethernet16/1 + Servers11 + eth0 + + + DeviceInterfaceLink + str2-7050cx3-acs-10 + Ethernet17/1 + Servers12 + eth0 + + + DeviceInterfaceLink + str2-7050cx3-acs-10 + Ethernet18/1 + Servers13 + eth0 + + + DeviceInterfaceLink + str2-7050cx3-acs-10 + Ethernet19/1 + Servers14 + eth0 + + + DeviceInterfaceLink + str2-7050cx3-acs-10 + Ethernet20/1 + Servers15 + eth0 + + + DeviceInterfaceLink + str2-7050cx3-acs-10 + Ethernet21/1 + Servers16 + eth0 + + + DeviceInterfaceLink + str2-7050cx3-acs-10 + Ethernet22/1 + Servers17 + eth0 + + + DeviceInterfaceLink + str2-7050cx3-acs-10 + Ethernet27/1 + Servers18 + eth0 + + + DeviceInterfaceLink + str2-7050cx3-acs-10 + Ethernet28/1 + Servers19 + eth0 + + + DeviceInterfaceLink + str2-7050cx3-acs-10 + Ethernet29/1 + Servers20 + eth0 + + + DeviceInterfaceLink + str2-7050cx3-acs-10 + Ethernet30/1 + Servers21 + eth0 + + + DeviceInterfaceLink + str2-7050cx3-acs-10 + Ethernet31/1 + Servers22 + eth0 + + + DeviceInterfaceLink + str2-7050cx3-acs-10 + Ethernet32/1 + Servers23 + eth0 + + + LogicalLink + str2-7050cx3-acs-10 + Ethernet1/1 + str2-7050cx3-acs-10-Servers0-SC + U + + + LogicalLink + str2-7050cx3-acs-10 + Ethernet2/1 + str2-7050cx3-acs-10-Servers1-SC + U + + + LogicalLink + str2-7050cx3-acs-10 + Ethernet3/1 + str2-7050cx3-acs-10-Servers2-SC + U + + + LogicalLink + str2-7050cx3-acs-10 + Ethernet4/1 + str2-7050cx3-acs-10-Servers3-SC + U + + + LogicalLink + str2-7050cx3-acs-10 + Ethernet5/1 + str2-7050cx3-acs-10-Servers4-SC + U + + + LogicalLink + str2-7050cx3-acs-10 + Ethernet6/1 + str2-7050cx3-acs-10-Servers5-SC + U + + + LogicalLink + str2-7050cx3-acs-10 + Ethernet11/1 + str2-7050cx3-acs-10-Servers6-SC + U + + + LogicalLink + str2-7050cx3-acs-10 + Ethernet12/1 + str2-7050cx3-acs-10-Servers7-SC + U + + + LogicalLink + str2-7050cx3-acs-10 + Ethernet13/1 + str2-7050cx3-acs-10-Servers8-SC + U + + + LogicalLink + str2-7050cx3-acs-10 + Ethernet14/1 + str2-7050cx3-acs-10-Servers9-SC + U + + + LogicalLink + str2-7050cx3-acs-10 + Ethernet15/1 + str2-7050cx3-acs-10-Servers10-SC + U + + + LogicalLink + str2-7050cx3-acs-10 + Ethernet16/1 + str2-7050cx3-acs-10-Servers11-SC + U + + + LogicalLink + str2-7050cx3-acs-10 + Ethernet17/1 + str2-7050cx3-acs-10-Servers12-SC + U + + + LogicalLink + str2-7050cx3-acs-10 + Ethernet18/1 + str2-7050cx3-acs-10-Servers13-SC + U + + + LogicalLink + str2-7050cx3-acs-10 + Ethernet19/1 + str2-7050cx3-acs-10-Servers14-SC + U + + + LogicalLink + str2-7050cx3-acs-10 + Ethernet20/1 + str2-7050cx3-acs-10-Servers15-SC + U + + + LogicalLink + str2-7050cx3-acs-10 + Ethernet21/1 + str2-7050cx3-acs-10-Servers16-SC + U + + + LogicalLink + str2-7050cx3-acs-10 + Ethernet22/1 + str2-7050cx3-acs-10-Servers17-SC + U + + + LogicalLink + str2-7050cx3-acs-10 + Ethernet27/1 + str2-7050cx3-acs-10-Servers18-SC + U + + + LogicalLink + str2-7050cx3-acs-10 + Ethernet28/1 + str2-7050cx3-acs-10-Servers19-SC + U + + + LogicalLink + str2-7050cx3-acs-10 + Ethernet29/1 + str2-7050cx3-acs-10-Servers20-SC + U + + + LogicalLink + str2-7050cx3-acs-10 + Ethernet30/1 + str2-7050cx3-acs-10-Servers21-SC + U + + + LogicalLink + str2-7050cx3-acs-10 + Ethernet31/1 + str2-7050cx3-acs-10-Servers22-SC + U + + + LogicalLink + str2-7050cx3-acs-10 + Ethernet32/1 + str2-7050cx3-acs-10-Servers23-SC + U + + + + + str2-7050cx3-acs-10 + Arista-7050CX3-32S-D48C8 +
+ 10.1.0.32/32 +
+ + FC00:1::32/128 + + + 10.3.146.122 + +
+ + str2-7050cx3-acs-11 + Arista-7050CX3-32S-D48C8 +
+ 10.1.0.33/32 +
+ + FC00:1::33/128 + + + 10.3.146.127 + +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7050cx3-acs-10-Servers0-SC +
+ + Server +
+ 192.168.0.2/26 +
+ + fc02:1000::2/96 + + + 0.0.0.0/0 + + Servers0 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7050cx3-acs-10-Servers1-SC +
+ + Server +
+ 192.168.0.3/26 +
+ + fc02:1000::3/96 + + + 0.0.0.0/0 + + Servers1 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7050cx3-acs-10-Servers2-SC +
+ + Server +
+ 192.168.0.4/26 +
+ + fc02:1000::4/96 + + + 0.0.0.0/0 + + Servers2 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7050cx3-acs-10-Servers3-SC +
+ + Server +
+ 192.168.0.5/26 +
+ + fc02:1000::5/96 + + + 0.0.0.0/0 + + Servers3 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7050cx3-acs-10-Servers4-SC +
+ + Server +
+ 192.168.0.6/26 +
+ + fc02:1000::6/96 + + + 0.0.0.0/0 + + Servers4 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7050cx3-acs-10-Servers5-SC +
+ + Server +
+ 192.168.0.7/26 +
+ + fc02:1000::7/96 + + + 0.0.0.0/0 + + Servers5 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7050cx3-acs-10-Servers6-SC +
+ + Server +
+ 192.168.0.8/26 +
+ + fc02:1000::8/96 + + + 0.0.0.0/0 + + Servers6 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7050cx3-acs-10-Servers7-SC +
+ + Server +
+ 192.168.0.9/26 +
+ + fc02:1000::9/96 + + + 0.0.0.0/0 + + Servers7 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7050cx3-acs-10-Servers8-SC +
+ + Server +
+ 192.168.0.10/26 +
+ + fc02:1000::a/96 + + + 0.0.0.0/0 + + Servers8 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7050cx3-acs-10-Servers9-SC +
+ + Server +
+ 192.168.0.11/26 +
+ + fc02:1000::b/96 + + + 0.0.0.0/0 + + Servers9 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7050cx3-acs-10-Servers10-SC +
+ + Server +
+ 192.168.0.12/26 +
+ + fc02:1000::c/96 + + + 0.0.0.0/0 + + Servers10 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7050cx3-acs-10-Servers11-SC +
+ + Server +
+ 192.168.0.13/26 +
+ + fc02:1000::d/96 + + + 0.0.0.0/0 + + Servers11 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7050cx3-acs-10-Servers12-SC +
+ + Server +
+ 192.168.0.14/26 +
+ + fc02:1000::e/96 + + + 0.0.0.0/0 + + Servers12 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7050cx3-acs-10-Servers13-SC +
+ + Server +
+ 192.168.0.15/26 +
+ + fc02:1000::f/96 + + + 0.0.0.0/0 + + Servers13 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7050cx3-acs-10-Servers14-SC +
+ + Server +
+ 192.168.0.16/26 +
+ + fc02:1000::10/96 + + + 0.0.0.0/0 + + Servers14 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7050cx3-acs-10-Servers15-SC +
+ + Server +
+ 192.168.0.17/26 +
+ + fc02:1000::11/96 + + + 0.0.0.0/0 + + Servers15 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7050cx3-acs-10-Servers16-SC +
+ + Server +
+ 192.168.0.18/26 +
+ + fc02:1000::12/96 + + + 0.0.0.0/0 + + Servers16 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7050cx3-acs-10-Servers17-SC +
+ + Server +
+ 192.168.0.19/26 +
+ + fc02:1000::13/96 + + + 0.0.0.0/0 + + Servers17 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7050cx3-acs-10-Servers18-SC +
+ + Server +
+ 192.168.0.20/26 +
+ + fc02:1000::14/96 + + + 0.0.0.0/0 + + Servers18 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7050cx3-acs-10-Servers19-SC +
+ + Server +
+ 192.168.0.21/26 +
+ + fc02:1000::15/96 + + + 0.0.0.0/0 + + Servers19 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7050cx3-acs-10-Servers20-SC +
+ + Server +
+ 192.168.0.22/26 +
+ + fc02:1000::16/96 + + + 0.0.0.0/0 + + Servers20 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7050cx3-acs-10-Servers21-SC +
+ + Server +
+ 192.168.0.23/26 +
+ + fc02:1000::17/96 + + + 0.0.0.0/0 + + Servers21 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7050cx3-acs-10-Servers22-SC +
+ + Server +
+ 192.168.0.24/26 +
+ + fc02:1000::18/96 + + + 0.0.0.0/0 + + Servers22 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7050cx3-acs-10-Servers23-SC +
+ + Server +
+ 192.168.0.25/26 +
+ + fc02:1000::19/96 + + + 0.0.0.0/0 + + Servers23 +
+ + ARISTA04T1 + + 172.16.142.63 + + Arista-VM + + + ARISTA03T1 + + 172.16.142.62 + + Arista-VM + + + ARISTA02T1 + + 172.16.142.61 + + Arista-VM + + + ARISTA01T1 + + 172.16.142.60 + + Arista-VM + +
+
+ + + true + + + DeviceInterface + + true + true + 1 + Ethernet1/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet1/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet2/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet2/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet3/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet3/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet4/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet4/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet5/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet5/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet6/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet6/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet7/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet8/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet9/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet10/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet11/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet11/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet12/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet12/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet13/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet13/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet14/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet14/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet15/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet15/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet16/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet16/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet17/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet17/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet18/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet18/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet19/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet19/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet20/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet20/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet21/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet21/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet22/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet22/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet23/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet24/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet25/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet26/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet27/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet27/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet28/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet28/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet29/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet29/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet30/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet30/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet31/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet31/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet32/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet32/3 + + false + 0 + 0 + 50000 + + + true + 0 + Arista-7050CX3-32S-D48C8 + + + + + + + str2-7050cx3-acs-10 + + + DeploymentId + + 1 + + + QosProfile + + Profile0 + + + GeminiEnabled + + True + + + DhcpResources + + 192.0.0.1;192.0.0.2;192.0.0.3;192.0.0.4;192.0.0.5;192.0.0.6;192.0.0.7;192.0.0.8;192.0.0.9;192.0.0.10;192.0.0.11;192.0.0.12;192.0.0.13;192.0.0.14;192.0.0.15;192.0.0.16;192.0.0.17;192.0.0.18;192.0.0.19;192.0.0.20;192.0.0.21;192.0.0.22;192.0.0.23;192.0.0.24;192.0.0.25;192.0.0.26;192.0.0.27;192.0.0.28;192.0.0.29;192.0.0.30;192.0.0.31;192.0.0.32;192.0.0.33;192.0.0.34;192.0.0.35;192.0.0.36;192.0.0.37;192.0.0.38;192.0.0.39;192.0.0.40;192.0.0.41;192.0.0.42;192.0.0.43;192.0.0.44;192.0.0.45;192.0.0.46;192.0.0.47;192.0.0.48 + + + NtpResources + + 10.20.8.129;10.20.8.130 + + + SnmpResources + + 10.3.145.98 + + + SyslogResources + + 10.64.246.95 + + + TacacsGroup + + Starlab + + + TacacsServer + + 100.127.20.21 + + + ForcedMgmtRoutes + + 10.3.145.98/31;10.3.145.8;100.127.20.16/28;10.3.149.170/31;40.122.216.24;13.91.48.226;10.3.145.14;10.64.246.0/24;10.3.146.0/23;10.64.5.5 + + + ErspanDestinationIpv4 + + 10.20.6.16 + + + RedundancyType + + Gemini + + + + + + + + + + + + + GeminiPeeringLink + + True + + + UpperTOR + + str2-7050cx3-acs-10 + + + LowerTOR + + str2-7050cx3-acs-11 + + + str2-7050cx3-acs-11:MuxTunnel0;str2-7050cx3-acs-10:MuxTunnel0 + + + + str2-7050cx3-acs-10 + Arista-7050CX3-32S-D48C8 +
diff --git a/src/sonic-config-engine/tests/sample-arista-7060-t0-minigraph.xml b/src/sonic-config-engine/tests/sample-arista-7060-t0-minigraph.xml new file mode 100644 index 000000000000..eff3d88acbb9 --- /dev/null +++ b/src/sonic-config-engine/tests/sample-arista-7060-t0-minigraph.xml @@ -0,0 +1,1048 @@ + + + + + + false + str2-7060cx-32s-29 + 10.0.0.56 + ARISTA01T1 + 10.0.0.57 + 1 + 10 + 3 + + + str2-7060cx-32s-29 + FC00::71 + ARISTA01T1 + FC00::72 + 1 + 10 + 3 + + + false + str2-7060cx-32s-29 + 10.0.0.58 + ARISTA02T1 + 10.0.0.59 + 1 + 10 + 3 + + + str2-7060cx-32s-29 + FC00::75 + ARISTA02T1 + FC00::76 + 1 + 10 + 3 + + + false + str2-7060cx-32s-29 + 10.0.0.60 + ARISTA03T1 + 10.0.0.61 + 1 + 10 + 3 + + + str2-7060cx-32s-29 + FC00::79 + ARISTA03T1 + FC00::7A + 1 + 10 + 3 + + + false + str2-7060cx-32s-29 + 10.0.0.62 + ARISTA04T1 + 10.0.0.63 + 1 + 10 + 3 + + + str2-7060cx-32s-29 + FC00::7D + ARISTA04T1 + FC00::7E + 1 + 10 + 3 + + + + + 65100 + str2-7060cx-32s-29 + + +
10.0.0.57
+ + + +
+ +
10.0.0.59
+ + + +
+ +
10.0.0.61
+ + + +
+ +
10.0.0.63
+ + + +
+ + BGPPeer +
10.1.0.32
+ + + + BGPSLBPassive + 10.255.0.0/25 +
+ + BGPPeer +
10.1.0.32
+ + + + BGPVac + 192.168.0.0/21 +
+
+ +
+ + 64600 + ARISTA01T1 + + + + 64600 + ARISTA02T1 + + + + 64600 + ARISTA03T1 + + + + 64600 + ARISTA04T1 + + +
+
+ + + + + + HostIP + Loopback0 + + 10.1.0.32/32 + + 10.1.0.32/32 + + + HostIP1 + Loopback0 + + FC00:1::32/128 + + FC00:1::32/128 + + + + + HostIP + eth0 + + 10.3.146.57/23 + + 10.3.146.57/23 + + + V6HostIP + eth0 + + FC00:2::32/64 + + FC00:2::32/64 + + + + + + + str2-7060cx-32s-29 + + + PortChannel101 + Ethernet29/1 + + + + PortChannel102 + Ethernet30/1 + + + + PortChannel103 + Ethernet31/1 + + + + PortChannel104 + Ethernet32/1 + + + + + + Vlan1000 + Ethernet2/1;Ethernet3/1;Ethernet4/1;Ethernet5/1;Ethernet6/1;Ethernet7/1;Ethernet8/1;Ethernet9/1;Ethernet10/1;Ethernet11/1;Ethernet12/1;Ethernet13/1;Ethernet14/1;Ethernet15/1;Ethernet16/1;Ethernet17/1;Ethernet18/1;Ethernet19/1;Ethernet20/1;Ethernet21/1;Ethernet22/1;Ethernet23/1;Ethernet24/1;Ethernet25/1 + False + 0.0.0.0/0 + 192.0.0.1;192.0.0.2;192.0.0.3;192.0.0.4;192.0.0.5;192.0.0.6;192.0.0.7;192.0.0.8;192.0.0.9;192.0.0.10;192.0.0.11;192.0.0.12;192.0.0.13;192.0.0.14;192.0.0.15;192.0.0.16;192.0.0.17;192.0.0.18;192.0.0.19;192.0.0.20;192.0.0.21;192.0.0.22;192.0.0.23;192.0.0.24;192.0.0.25;192.0.0.26;192.0.0.27;192.0.0.28;192.0.0.29;192.0.0.30;192.0.0.31;192.0.0.32;192.0.0.33;192.0.0.34;192.0.0.35;192.0.0.36;192.0.0.37;192.0.0.38;192.0.0.39;192.0.0.40;192.0.0.41;192.0.0.42;192.0.0.43;192.0.0.44;192.0.0.45;192.0.0.46;192.0.0.47;192.0.0.48 + fc02:2000::1;fc02:2000::2;fc02:2000::3;fc02:2000::4 + 1000 + 1000 + 192.168.0.0/21 + + + + + + PortChannel101 + 10.0.0.56/31 + + + + PortChannel101 + FC00::71/126 + + + + PortChannel102 + 10.0.0.58/31 + + + + PortChannel102 + FC00::75/126 + + + + PortChannel103 + 10.0.0.60/31 + + + + PortChannel103 + FC00::79/126 + + + + PortChannel104 + 10.0.0.62/31 + + + + PortChannel104 + FC00::7D/126 + + + + Vlan1000 + 192.168.0.1/21 + + + + Vlan1000 + fc02:1000::1/64 + + + + + + NTP_ACL + NTP + NTP + + + SNMP_ACL + SNMP + SNMP + + + ERSPAN + Everflow + Everflow + + + ERSPANV6 + EverflowV6 + EverflowV6 + + + VTY_LINE + ssh-only + SSH + + + PortChannel101;PortChannel102;PortChannel103;PortChannel104 + DataAcl + DataPlane + + + + + + + + + + DeviceInterfaceLink + ARISTA01T1 + Ethernet1 + str2-7060cx-32s-29 + Ethernet29/1 + + + DeviceInterfaceLink + ARISTA02T1 + Ethernet1 + str2-7060cx-32s-29 + Ethernet30/1 + + + DeviceInterfaceLink + ARISTA03T1 + Ethernet1 + str2-7060cx-32s-29 + Ethernet31/1 + + + DeviceInterfaceLink + ARISTA04T1 + Ethernet1 + str2-7060cx-32s-29 + Ethernet32/1 + + + DeviceInterfaceLink + str2-7060cx-32s-29 + Ethernet2/1 + Servers0 + eth0 + + + DeviceInterfaceLink + str2-7060cx-32s-29 + Ethernet3/1 + Servers1 + eth0 + + + DeviceInterfaceLink + str2-7060cx-32s-29 + Ethernet4/1 + Servers2 + eth0 + + + DeviceInterfaceLink + str2-7060cx-32s-29 + Ethernet5/1 + Servers3 + eth0 + + + DeviceInterfaceLink + str2-7060cx-32s-29 + Ethernet6/1 + Servers4 + eth0 + + + DeviceInterfaceLink + str2-7060cx-32s-29 + Ethernet7/1 + Servers5 + eth0 + + + DeviceInterfaceLink + str2-7060cx-32s-29 + Ethernet8/1 + Servers6 + eth0 + + + DeviceInterfaceLink + str2-7060cx-32s-29 + Ethernet9/1 + Servers7 + eth0 + + + DeviceInterfaceLink + str2-7060cx-32s-29 + Ethernet10/1 + Servers8 + eth0 + + + DeviceInterfaceLink + str2-7060cx-32s-29 + Ethernet11/1 + Servers9 + eth0 + + + DeviceInterfaceLink + str2-7060cx-32s-29 + Ethernet12/1 + Servers10 + eth0 + + + DeviceInterfaceLink + str2-7060cx-32s-29 + Ethernet13/1 + Servers11 + eth0 + + + DeviceInterfaceLink + str2-7060cx-32s-29 + Ethernet14/1 + Servers12 + eth0 + + + DeviceInterfaceLink + str2-7060cx-32s-29 + Ethernet15/1 + Servers13 + eth0 + + + DeviceInterfaceLink + str2-7060cx-32s-29 + Ethernet16/1 + Servers14 + eth0 + + + DeviceInterfaceLink + str2-7060cx-32s-29 + Ethernet17/1 + Servers15 + eth0 + + + DeviceInterfaceLink + str2-7060cx-32s-29 + Ethernet18/1 + Servers16 + eth0 + + + DeviceInterfaceLink + str2-7060cx-32s-29 + Ethernet19/1 + Servers17 + eth0 + + + DeviceInterfaceLink + str2-7060cx-32s-29 + Ethernet20/1 + Servers18 + eth0 + + + DeviceInterfaceLink + str2-7060cx-32s-29 + Ethernet21/1 + Servers19 + eth0 + + + DeviceInterfaceLink + str2-7060cx-32s-29 + Ethernet22/1 + Servers20 + eth0 + + + DeviceInterfaceLink + str2-7060cx-32s-29 + Ethernet23/1 + Servers21 + eth0 + + + DeviceInterfaceLink + str2-7060cx-32s-29 + Ethernet24/1 + Servers22 + eth0 + + + DeviceInterfaceLink + str2-7060cx-32s-29 + Ethernet25/1 + Servers23 + eth0 + + + + + str2-7060cx-32s-29 + Arista-7060CX-32S-D48C8 + + 10.3.146.57 + + + + ARISTA04T1 + + 172.16.137.127 + + Arista-VM + + + ARISTA03T1 + + 172.16.137.126 + + Arista-VM + + + ARISTA02T1 + + 172.16.137.125 + + Arista-VM + + + ARISTA01T1 + + 172.16.137.124 + + Arista-VM + + + + + + true + + + DeviceInterface + + true + true + 1 + Ethernet1/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet2/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet3/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet4/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet5/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet6/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet7/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet8/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet9/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet10/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet11/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet12/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet13/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet14/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet15/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet16/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet17/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet18/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet19/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet20/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet21/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet22/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet23/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet24/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet25/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet26/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet27/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet28/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet29/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet30/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet31/1 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + true + 1 + Ethernet32/1 + + false + 0 + 0 + 40000 + + + true + 0 + Arista-7060CX-32S-D48C8 + + + + + + + str2-7060cx-32s-29 + + + DeploymentId + + 1 + + + QosProfile + + Profile0 + + + DhcpResources + + 192.0.0.1;192.0.0.2;192.0.0.3;192.0.0.4;192.0.0.5;192.0.0.6;192.0.0.7;192.0.0.8;192.0.0.9;192.0.0.10;192.0.0.11;192.0.0.12;192.0.0.13;192.0.0.14;192.0.0.15;192.0.0.16;192.0.0.17;192.0.0.18;192.0.0.19;192.0.0.20;192.0.0.21;192.0.0.22;192.0.0.23;192.0.0.24;192.0.0.25;192.0.0.26;192.0.0.27;192.0.0.28;192.0.0.29;192.0.0.30;192.0.0.31;192.0.0.32;192.0.0.33;192.0.0.34;192.0.0.35;192.0.0.36;192.0.0.37;192.0.0.38;192.0.0.39;192.0.0.40;192.0.0.41;192.0.0.42;192.0.0.43;192.0.0.44;192.0.0.45;192.0.0.46;192.0.0.47;192.0.0.48 + + + NtpResources + + 10.20.8.129;10.20.8.130 + + + SnmpResources + + 10.3.145.98 + + + SyslogResources + + 10.64.246.95 + + + TacacsGroup + + Starlab + + + TacacsServer + + 100.127.20.21 + + + ForcedMgmtRoutes + + 10.3.145.98/31;10.3.145.8;100.127.20.16/28;10.3.149.170/31;40.122.216.24;13.91.48.226;10.3.145.14;10.64.246.0/23;10.3.146.0/23;10.64.5.5;10.201.148.32/28;10.64.247.0/24 + + + ErspanDestinationIpv4 + + 10.20.6.16 + + + + + + + str2-7060cx-32s-29 + Arista-7060CX-32S-D48C8 +
diff --git a/src/sonic-config-engine/tests/sample-arista-7260-dualtor-minigraph-remap-disabled.xml b/src/sonic-config-engine/tests/sample-arista-7260-dualtor-minigraph-remap-disabled.xml new file mode 100644 index 000000000000..01a42f934726 --- /dev/null +++ b/src/sonic-config-engine/tests/sample-arista-7260-dualtor-minigraph-remap-disabled.xml @@ -0,0 +1,4635 @@ + + + + + + false + str2-7260cx3-acs-12 + 10.0.0.56 + ARISTA01T1 + 10.0.0.57 + 1 + 10 + 3 + + + str2-7260cx3-acs-12 + FC00::71 + ARISTA01T1 + FC00::72 + 1 + 10 + 3 + + + false + str2-7260cx3-acs-12 + 10.0.0.58 + ARISTA02T1 + 10.0.0.59 + 1 + 10 + 3 + + + str2-7260cx3-acs-12 + FC00::75 + ARISTA02T1 + FC00::76 + 1 + 10 + 3 + + + false + str2-7260cx3-acs-12 + 10.0.0.60 + ARISTA03T1 + 10.0.0.61 + 1 + 10 + 3 + + + str2-7260cx3-acs-12 + FC00::79 + ARISTA03T1 + FC00::7A + 1 + 10 + 3 + + + false + str2-7260cx3-acs-12 + 10.0.0.62 + ARISTA04T1 + 10.0.0.63 + 1 + 10 + 3 + + + str2-7260cx3-acs-12 + FC00::7D + ARISTA04T1 + FC00::7E + 1 + 10 + 3 + + + + + 65100 + str2-7260cx3-acs-12 + + +
10.0.0.57
+ + + +
+ +
10.0.0.59
+ + + +
+ +
10.0.0.61
+ + + +
+ +
10.0.0.63
+ + + +
+ + BGPPeer +
10.1.0.32
+ + + + BGPSLBPassive + 10.255.0.0/25 +
+ + BGPPeer +
10.1.0.32
+ + + + BGPVac + 192.168.0.0/21 +
+
+ +
+ + 64600 + ARISTA01T1 + + + + 64600 + ARISTA02T1 + + + + 64600 + ARISTA03T1 + + + + 64600 + ARISTA04T1 + + +
+
+ + + + + + HostIP + Loopback0 + + 10.1.0.32/32 + + 10.1.0.32/32 + + + HostIP1 + Loopback0 + + FC00:1::32/128 + + FC00:1::32/128 + + + HostIP2 + Loopback1 + + 10.1.0.34/32 + + 10.1.0.34/32 + + + HostIP3 + Loopback1 + + FC00:1::34/128 + + FC00:1::34/128 + + HostIP6 + Loopback3 + + 10.1.0.38/32 + + 10.1.0.38/32 + + + HostIP7 + Loopback3 + + FC00:1::38/128 + + FC00:1::38/128 + + HostIP4 + Loopback2 + + 10.1.0.36/32 + + 10.1.0.36/32 + + + HostIP5 + Loopback2 + + FC00:1::36/128 + + FC00:1::36/128 + + + + HostIP + eth0 + + 10.3.147.165/23 + + 10.3.147.165/23 + + + V6HostIP + eth0 + + FC00:2::32/64 + + FC00:2::32/64 + + + + + + + str2-7260cx3-acs-12 + + + PortChannel101 + Ethernet13/1;Ethernet14/1 + + + + PortChannel102 + Ethernet15/1;Ethernet16/1 + + + + PortChannel103 + Ethernet17/1;Ethernet18/1 + + + + PortChannel104 + Ethernet19/1;Ethernet20/1 + + + + + + + + + Vlan1000 + Ethernet1/1;Ethernet2/1;Ethernet3/1;Ethernet4/1;Ethernet5/1;Ethernet6/1;Ethernet7/1;Ethernet8/1;Ethernet9/1;Ethernet10/1;Ethernet11/1;Ethernet12/1;Ethernet21/1;Ethernet22/1;Ethernet23/1;Ethernet24/1;Ethernet25/1;Ethernet26/1;Ethernet27/1;Ethernet28/1;Ethernet29/1;Ethernet30/1;Ethernet31/1;Ethernet32/1;Ethernet33/1;Ethernet34/1;Ethernet35/1;Ethernet36/1;Ethernet37/1;Ethernet38/1;Ethernet39/1;Ethernet40/1;Ethernet41/1;Ethernet42/1;Ethernet43/1;Ethernet44/1;Ethernet45/1;Ethernet46/1;Ethernet47/1;Ethernet48/1;Ethernet49/1;Ethernet50/1;Ethernet51/1;Ethernet52/1;Ethernet53/1;Ethernet54/1;Ethernet55/1;Ethernet56/1;Ethernet57/1;Ethernet58/1;Ethernet59/1;Ethernet60/1;Ethernet61/1;Ethernet62/1;Ethernet63/1;Ethernet64/1 + False + 0.0.0.0/0 + 192.0.0.1;192.0.0.2;192.0.0.3;192.0.0.4;192.0.0.5;192.0.0.6;192.0.0.7;192.0.0.8;192.0.0.9;192.0.0.10;192.0.0.11;192.0.0.12;192.0.0.13;192.0.0.14;192.0.0.15;192.0.0.16;192.0.0.17;192.0.0.18;192.0.0.19;192.0.0.20;192.0.0.21;192.0.0.22;192.0.0.23;192.0.0.24;192.0.0.25;192.0.0.26;192.0.0.27;192.0.0.28;192.0.0.29;192.0.0.30;192.0.0.31;192.0.0.32;192.0.0.33;192.0.0.34;192.0.0.35;192.0.0.36;192.0.0.37;192.0.0.38;192.0.0.39;192.0.0.40;192.0.0.41;192.0.0.42;192.0.0.43;192.0.0.44;192.0.0.45;192.0.0.46;192.0.0.47;192.0.0.48 + fc02:2000::1;fc02:2000::2;fc02:2000::3;fc02:2000::4 + 1000 + 1000 + 192.168.0.0/21 + 00:aa:bb:cc:dd:ee + + + + + + PortChannel101 + 10.0.0.56/31 + + + + PortChannel101 + FC00::71/126 + + + + PortChannel102 + 10.0.0.58/31 + + + + PortChannel102 + FC00::75/126 + + + + PortChannel103 + 10.0.0.60/31 + + + + PortChannel103 + FC00::79/126 + + + + PortChannel104 + 10.0.0.62/31 + + + + PortChannel104 + FC00::7D/126 + + + + Vlan1000 + 192.168.0.1/21 + + + + Vlan1000 + fc02:1000::1/64 + + + + + + NTP_ACL + NTP + NTP + + + SNMP_ACL + SNMP + SNMP + + + ERSPAN + Everflow + Everflow + + + ERSPANV6 + EverflowV6 + EverflowV6 + + + VTY_LINE + ssh-only + SSH + + + + + + + + + + DeviceInterfaceLink + ARISTA01T1 + Ethernet1 + str2-7260cx3-acs-12 + Ethernet13/1 + + + DeviceInterfaceLink + ARISTA01T1 + Ethernet2 + str2-7260cx3-acs-12 + Ethernet14/1 + + + DeviceInterfaceLink + ARISTA02T1 + Ethernet1 + str2-7260cx3-acs-12 + Ethernet15/1 + + + DeviceInterfaceLink + ARISTA02T1 + Ethernet2 + str2-7260cx3-acs-12 + Ethernet16/1 + + + DeviceInterfaceLink + ARISTA03T1 + Ethernet1 + str2-7260cx3-acs-12 + Ethernet17/1 + + + DeviceInterfaceLink + ARISTA03T1 + Ethernet2 + str2-7260cx3-acs-12 + Ethernet18/1 + + + DeviceInterfaceLink + ARISTA04T1 + Ethernet1 + str2-7260cx3-acs-12 + Ethernet19/1 + + + DeviceInterfaceLink + ARISTA04T1 + Ethernet2 + str2-7260cx3-acs-12 + Ethernet20/1 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet1/1 + Servers0 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet2/1 + Servers1 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet3/1 + Servers2 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet4/1 + Servers3 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet5/1 + Servers4 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet6/1 + Servers5 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet7/1 + Servers6 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet8/1 + Servers7 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet9/1 + Servers8 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet10/1 + Servers9 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet11/1 + Servers10 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet12/1 + Servers11 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet21/1 + Servers12 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet22/1 + Servers13 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet23/1 + Servers14 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet24/1 + Servers15 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet25/1 + Servers16 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet26/1 + Servers17 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet27/1 + Servers18 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet28/1 + Servers19 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet29/1 + Servers20 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet30/1 + Servers21 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet31/1 + Servers22 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet32/1 + Servers23 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet33/1 + Servers24 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet34/1 + Servers25 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet35/1 + Servers26 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet36/1 + Servers27 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet37/1 + Servers28 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet38/1 + Servers29 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet39/1 + Servers30 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet40/1 + Servers31 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet41/1 + Servers32 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet42/1 + Servers33 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet43/1 + Servers34 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet44/1 + Servers35 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet45/1 + Servers36 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet46/1 + Servers37 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet47/1 + Servers38 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet48/1 + Servers39 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet49/1 + Servers40 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet50/1 + Servers41 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet51/1 + Servers42 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet52/1 + Servers43 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet53/1 + Servers44 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet54/1 + Servers45 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet55/1 + Servers46 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet56/1 + Servers47 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet57/1 + Servers48 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet58/1 + Servers49 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet59/1 + Servers50 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet60/1 + Servers51 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet61/1 + Servers52 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet62/1 + Servers53 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet63/1 + Servers54 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet64/1 + Servers55 + eth0 + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet1/1 + str2-7260cx3-acs-12-Servers0-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet2/1 + str2-7260cx3-acs-12-Servers1-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet3/1 + str2-7260cx3-acs-12-Servers2-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet4/1 + str2-7260cx3-acs-12-Servers3-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet5/1 + str2-7260cx3-acs-12-Servers4-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet6/1 + str2-7260cx3-acs-12-Servers5-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet7/1 + str2-7260cx3-acs-12-Servers6-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet8/1 + str2-7260cx3-acs-12-Servers7-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet9/1 + str2-7260cx3-acs-12-Servers8-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet10/1 + str2-7260cx3-acs-12-Servers9-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet11/1 + str2-7260cx3-acs-12-Servers10-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet12/1 + str2-7260cx3-acs-12-Servers11-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet21/1 + str2-7260cx3-acs-12-Servers12-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet22/1 + str2-7260cx3-acs-12-Servers13-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet23/1 + str2-7260cx3-acs-12-Servers14-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet24/1 + str2-7260cx3-acs-12-Servers15-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet25/1 + str2-7260cx3-acs-12-Servers16-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet26/1 + str2-7260cx3-acs-12-Servers17-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet27/1 + str2-7260cx3-acs-12-Servers18-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet28/1 + str2-7260cx3-acs-12-Servers19-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet29/1 + str2-7260cx3-acs-12-Servers20-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet30/1 + str2-7260cx3-acs-12-Servers21-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet31/1 + str2-7260cx3-acs-12-Servers22-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet32/1 + str2-7260cx3-acs-12-Servers23-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet33/1 + str2-7260cx3-acs-12-Servers24-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet34/1 + str2-7260cx3-acs-12-Servers25-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet35/1 + str2-7260cx3-acs-12-Servers26-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet36/1 + str2-7260cx3-acs-12-Servers27-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet37/1 + str2-7260cx3-acs-12-Servers28-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet38/1 + str2-7260cx3-acs-12-Servers29-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet39/1 + str2-7260cx3-acs-12-Servers30-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet40/1 + str2-7260cx3-acs-12-Servers31-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet41/1 + str2-7260cx3-acs-12-Servers32-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet42/1 + str2-7260cx3-acs-12-Servers33-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet43/1 + str2-7260cx3-acs-12-Servers34-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet44/1 + str2-7260cx3-acs-12-Servers35-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet45/1 + str2-7260cx3-acs-12-Servers36-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet46/1 + str2-7260cx3-acs-12-Servers37-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet47/1 + str2-7260cx3-acs-12-Servers38-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet48/1 + str2-7260cx3-acs-12-Servers39-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet49/1 + str2-7260cx3-acs-12-Servers40-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet50/1 + str2-7260cx3-acs-12-Servers41-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet51/1 + str2-7260cx3-acs-12-Servers42-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet52/1 + str2-7260cx3-acs-12-Servers43-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet53/1 + str2-7260cx3-acs-12-Servers44-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet54/1 + str2-7260cx3-acs-12-Servers45-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet55/1 + str2-7260cx3-acs-12-Servers46-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet56/1 + str2-7260cx3-acs-12-Servers47-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet57/1 + str2-7260cx3-acs-12-Servers48-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet58/1 + str2-7260cx3-acs-12-Servers49-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet59/1 + str2-7260cx3-acs-12-Servers50-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet60/1 + str2-7260cx3-acs-12-Servers51-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet61/1 + str2-7260cx3-acs-12-Servers52-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet62/1 + str2-7260cx3-acs-12-Servers53-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet63/1 + str2-7260cx3-acs-12-Servers54-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet64/1 + str2-7260cx3-acs-12-Servers55-SC + U + + + + + str2-7260cx3-acs-12 + Arista-7260CX3-D108C8 +
+ 10.1.0.32/32 +
+ + FC00:1::32/128 + + + 10.3.147.165 + +
+ + str2-7260cx3-acs-13 + Arista-7260CX3-D108C8 +
+ 10.1.0.33/32 +
+ + FC00:1::33/128 + + + 10.3.147.167 + +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers0-SC +
+ + Server +
+ 192.168.0.2/26 +
+ + fc02:1000::2/96 + + + 0.0.0.0/0 + + Servers0 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers1-SC +
+ + Server +
+ 192.168.0.3/26 +
+ + fc02:1000::3/96 + + + 0.0.0.0/0 + + Servers1 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers2-SC +
+ + Server +
+ 192.168.0.4/26 +
+ + fc02:1000::4/96 + + + 0.0.0.0/0 + + Servers2 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers3-SC +
+ + Server +
+ 192.168.0.5/26 +
+ + fc02:1000::5/96 + + + 0.0.0.0/0 + + Servers3 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers4-SC +
+ + Server +
+ 192.168.0.6/26 +
+ + fc02:1000::6/96 + + + 0.0.0.0/0 + + Servers4 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers5-SC +
+ + Server +
+ 192.168.0.7/26 +
+ + fc02:1000::7/96 + + + 0.0.0.0/0 + + Servers5 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers6-SC +
+ + Server +
+ 192.168.0.8/26 +
+ + fc02:1000::8/96 + + + 0.0.0.0/0 + + Servers6 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers7-SC +
+ + Server +
+ 192.168.0.9/26 +
+ + fc02:1000::9/96 + + + 0.0.0.0/0 + + Servers7 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers8-SC +
+ + Server +
+ 192.168.0.10/26 +
+ + fc02:1000::a/96 + + + 0.0.0.0/0 + + Servers8 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers9-SC +
+ + Server +
+ 192.168.0.11/26 +
+ + fc02:1000::b/96 + + + 0.0.0.0/0 + + Servers9 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers10-SC +
+ + Server +
+ 192.168.0.12/26 +
+ + fc02:1000::c/96 + + + 0.0.0.0/0 + + Servers10 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers11-SC +
+ + Server +
+ 192.168.0.13/26 +
+ + fc02:1000::d/96 + + + 0.0.0.0/0 + + Servers11 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers12-SC +
+ + Server +
+ 192.168.0.14/26 +
+ + fc02:1000::e/96 + + + 0.0.0.0/0 + + Servers12 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers13-SC +
+ + Server +
+ 192.168.0.15/26 +
+ + fc02:1000::f/96 + + + 0.0.0.0/0 + + Servers13 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers14-SC +
+ + Server +
+ 192.168.0.16/26 +
+ + fc02:1000::10/96 + + + 0.0.0.0/0 + + Servers14 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers15-SC +
+ + Server +
+ 192.168.0.17/26 +
+ + fc02:1000::11/96 + + + 0.0.0.0/0 + + Servers15 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers16-SC +
+ + Server +
+ 192.168.0.18/26 +
+ + fc02:1000::12/96 + + + 0.0.0.0/0 + + Servers16 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers17-SC +
+ + Server +
+ 192.168.0.19/26 +
+ + fc02:1000::13/96 + + + 0.0.0.0/0 + + Servers17 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers18-SC +
+ + Server +
+ 192.168.0.20/26 +
+ + fc02:1000::14/96 + + + 0.0.0.0/0 + + Servers18 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers19-SC +
+ + Server +
+ 192.168.0.21/26 +
+ + fc02:1000::15/96 + + + 0.0.0.0/0 + + Servers19 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers20-SC +
+ + Server +
+ 192.168.0.22/26 +
+ + fc02:1000::16/96 + + + 0.0.0.0/0 + + Servers20 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers21-SC +
+ + Server +
+ 192.168.0.23/26 +
+ + fc02:1000::17/96 + + + 0.0.0.0/0 + + Servers21 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers22-SC +
+ + Server +
+ 192.168.0.24/26 +
+ + fc02:1000::18/96 + + + 0.0.0.0/0 + + Servers22 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers23-SC +
+ + Server +
+ 192.168.0.25/26 +
+ + fc02:1000::19/96 + + + 0.0.0.0/0 + + Servers23 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers24-SC +
+ + Server +
+ 192.168.0.26/26 +
+ + fc02:1000::1a/96 + + + 0.0.0.0/0 + + Servers24 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers25-SC +
+ + Server +
+ 192.168.0.27/26 +
+ + fc02:1000::1b/96 + + + 0.0.0.0/0 + + Servers25 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers26-SC +
+ + Server +
+ 192.168.0.28/26 +
+ + fc02:1000::1c/96 + + + 0.0.0.0/0 + + Servers26 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers27-SC +
+ + Server +
+ 192.168.0.29/26 +
+ + fc02:1000::1d/96 + + + 0.0.0.0/0 + + Servers27 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers28-SC +
+ + Server +
+ 192.168.0.30/26 +
+ + fc02:1000::1e/96 + + + 0.0.0.0/0 + + Servers28 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers29-SC +
+ + Server +
+ 192.168.0.31/26 +
+ + fc02:1000::1f/96 + + + 0.0.0.0/0 + + Servers29 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers30-SC +
+ + Server +
+ 192.168.0.32/26 +
+ + fc02:1000::20/96 + + + 0.0.0.0/0 + + Servers30 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers31-SC +
+ + Server +
+ 192.168.0.33/26 +
+ + fc02:1000::21/96 + + + 0.0.0.0/0 + + Servers31 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers32-SC +
+ + Server +
+ 192.168.0.34/26 +
+ + fc02:1000::22/96 + + + 0.0.0.0/0 + + Servers32 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers33-SC +
+ + Server +
+ 192.168.0.35/26 +
+ + fc02:1000::23/96 + + + 0.0.0.0/0 + + Servers33 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers34-SC +
+ + Server +
+ 192.168.0.36/26 +
+ + fc02:1000::24/96 + + + 0.0.0.0/0 + + Servers34 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers35-SC +
+ + Server +
+ 192.168.0.37/26 +
+ + fc02:1000::25/96 + + + 0.0.0.0/0 + + Servers35 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers36-SC +
+ + Server +
+ 192.168.0.38/26 +
+ + fc02:1000::26/96 + + + 0.0.0.0/0 + + Servers36 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers37-SC +
+ + Server +
+ 192.168.0.39/26 +
+ + fc02:1000::27/96 + + + 0.0.0.0/0 + + Servers37 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers38-SC +
+ + Server +
+ 192.168.0.40/26 +
+ + fc02:1000::28/96 + + + 0.0.0.0/0 + + Servers38 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers39-SC +
+ + Server +
+ 192.168.0.41/26 +
+ + fc02:1000::29/96 + + + 0.0.0.0/0 + + Servers39 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers40-SC +
+ + Server +
+ 192.168.0.42/26 +
+ + fc02:1000::2a/96 + + + 0.0.0.0/0 + + Servers40 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers41-SC +
+ + Server +
+ 192.168.0.43/26 +
+ + fc02:1000::2b/96 + + + 0.0.0.0/0 + + Servers41 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers42-SC +
+ + Server +
+ 192.168.0.44/26 +
+ + fc02:1000::2c/96 + + + 0.0.0.0/0 + + Servers42 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers43-SC +
+ + Server +
+ 192.168.0.45/26 +
+ + fc02:1000::2d/96 + + + 0.0.0.0/0 + + Servers43 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers44-SC +
+ + Server +
+ 192.168.0.46/26 +
+ + fc02:1000::2e/96 + + + 0.0.0.0/0 + + Servers44 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers45-SC +
+ + Server +
+ 192.168.0.47/26 +
+ + fc02:1000::2f/96 + + + 0.0.0.0/0 + + Servers45 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers46-SC +
+ + Server +
+ 192.168.0.48/26 +
+ + fc02:1000::30/96 + + + 0.0.0.0/0 + + Servers46 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers47-SC +
+ + Server +
+ 192.168.0.49/26 +
+ + fc02:1000::31/96 + + + 0.0.0.0/0 + + Servers47 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers48-SC +
+ + Server +
+ 192.168.0.50/26 +
+ + fc02:1000::32/96 + + + 0.0.0.0/0 + + Servers48 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers49-SC +
+ + Server +
+ 192.168.0.51/26 +
+ + fc02:1000::33/96 + + + 0.0.0.0/0 + + Servers49 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers50-SC +
+ + Server +
+ 192.168.0.52/26 +
+ + fc02:1000::34/96 + + + 0.0.0.0/0 + + Servers50 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers51-SC +
+ + Server +
+ 192.168.0.53/26 +
+ + fc02:1000::35/96 + + + 0.0.0.0/0 + + Servers51 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers52-SC +
+ + Server +
+ 192.168.0.54/26 +
+ + fc02:1000::36/96 + + + 0.0.0.0/0 + + Servers52 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers53-SC +
+ + Server +
+ 192.168.0.55/26 +
+ + fc02:1000::37/96 + + + 0.0.0.0/0 + + Servers53 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers54-SC +
+ + Server +
+ 192.168.0.56/26 +
+ + fc02:1000::38/96 + + + 0.0.0.0/0 + + Servers54 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers55-SC +
+ + Server +
+ 192.168.0.57/26 +
+ + fc02:1000::39/96 + + + 0.0.0.0/0 + + Servers55 +
+ + ARISTA04T1 + + 172.16.147.75 + + Arista-VM + + + ARISTA03T1 + + 172.16.147.74 + + Arista-VM + + + ARISTA02T1 + + 172.16.147.73 + + Arista-VM + + + ARISTA01T1 + + 172.16.147.72 + + Arista-VM + +
+
+ + + true + + + DeviceInterface + + true + true + 1 + Ethernet1/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet1/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet2/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet2/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet3/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet3/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet4/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet4/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet5/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet5/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet6/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet6/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet7/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet7/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet8/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet8/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet9/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet9/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet10/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet10/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet11/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet11/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet12/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet12/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet13/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet14/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet15/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet16/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet17/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet18/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet19/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet20/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet21/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet21/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet22/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet22/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet23/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet23/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet24/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet24/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet25/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet25/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet26/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet26/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet27/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet27/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet28/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet28/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet29/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet29/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet30/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet30/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet31/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet31/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet32/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet32/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet33/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet33/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet34/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet34/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet35/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet35/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet36/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet36/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet37/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet37/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet38/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet38/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet39/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet39/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet40/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet40/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet41/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet41/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet42/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet42/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet43/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet43/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet44/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet44/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet45/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet45/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet46/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet46/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet47/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet47/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet48/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet48/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet49/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet49/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet50/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet50/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet51/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet51/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet52/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet52/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet53/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet53/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet54/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet54/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet55/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet55/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet56/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet56/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet57/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet57/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet58/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet58/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet59/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet59/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet60/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet60/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet61/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet61/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet62/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet62/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet63/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet63/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet64/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet64/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet65 + + false + 0 + 0 + 10000 + + + DeviceInterface + + true + true + 1 + Ethernet66 + + false + 0 + 0 + 10000 + + + true + 0 + Arista-7260CX3-D108C8 + + + + + + + str2-7260cx3-acs-12 + + + DeploymentId + + 1 + + + QosProfile + + Profile0 + + + GeminiEnabled + + True + + + DhcpResources + + 192.0.0.1;192.0.0.2;192.0.0.3;192.0.0.4;192.0.0.5;192.0.0.6;192.0.0.7;192.0.0.8;192.0.0.9;192.0.0.10;192.0.0.11;192.0.0.12;192.0.0.13;192.0.0.14;192.0.0.15;192.0.0.16;192.0.0.17;192.0.0.18;192.0.0.19;192.0.0.20;192.0.0.21;192.0.0.22;192.0.0.23;192.0.0.24;192.0.0.25;192.0.0.26;192.0.0.27;192.0.0.28;192.0.0.29;192.0.0.30;192.0.0.31;192.0.0.32;192.0.0.33;192.0.0.34;192.0.0.35;192.0.0.36;192.0.0.37;192.0.0.38;192.0.0.39;192.0.0.40;192.0.0.41;192.0.0.42;192.0.0.43;192.0.0.44;192.0.0.45;192.0.0.46;192.0.0.47;192.0.0.48 + + + NtpResources + + 10.20.8.129;10.20.8.130 + + + SnmpResources + + 10.3.145.98 + + + SyslogResources + + 10.64.246.95 + + + TacacsGroup + + Starlab + + + TacacsServer + + 100.127.20.21 + + + ForcedMgmtRoutes + + 10.3.145.98/31;10.3.145.8;100.127.20.16/28;10.3.149.170/31;40.122.216.24;13.91.48.226;10.3.145.14;10.64.246.0/24;10.3.146.0/23;10.64.5.5 + + + ErspanDestinationIpv4 + + 10.20.6.16 + + + + + + + + + + + + + GeminiPeeringLink + + True + + + UpperTOR + + str2-7260cx3-acs-12 + + + LowerTOR + + str2-7260cx3-acs-13 + + + str2-7260cx3-acs-13:MuxTunnel0;str2-7260cx3-acs-12:MuxTunnel0 + + + + str2-7260cx3-acs-12 + Arista-7260CX3-D108C8 +
diff --git a/src/sonic-config-engine/tests/sample-arista-7260-dualtor-minigraph.xml b/src/sonic-config-engine/tests/sample-arista-7260-dualtor-minigraph.xml new file mode 100644 index 000000000000..37e1a872887e --- /dev/null +++ b/src/sonic-config-engine/tests/sample-arista-7260-dualtor-minigraph.xml @@ -0,0 +1,4640 @@ + + + + + + false + str2-7260cx3-acs-12 + 10.0.0.56 + ARISTA01T1 + 10.0.0.57 + 1 + 10 + 3 + + + str2-7260cx3-acs-12 + FC00::71 + ARISTA01T1 + FC00::72 + 1 + 10 + 3 + + + false + str2-7260cx3-acs-12 + 10.0.0.58 + ARISTA02T1 + 10.0.0.59 + 1 + 10 + 3 + + + str2-7260cx3-acs-12 + FC00::75 + ARISTA02T1 + FC00::76 + 1 + 10 + 3 + + + false + str2-7260cx3-acs-12 + 10.0.0.60 + ARISTA03T1 + 10.0.0.61 + 1 + 10 + 3 + + + str2-7260cx3-acs-12 + FC00::79 + ARISTA03T1 + FC00::7A + 1 + 10 + 3 + + + false + str2-7260cx3-acs-12 + 10.0.0.62 + ARISTA04T1 + 10.0.0.63 + 1 + 10 + 3 + + + str2-7260cx3-acs-12 + FC00::7D + ARISTA04T1 + FC00::7E + 1 + 10 + 3 + + + + + 65100 + str2-7260cx3-acs-12 + + +
10.0.0.57
+ + + +
+ +
10.0.0.59
+ + + +
+ +
10.0.0.61
+ + + +
+ +
10.0.0.63
+ + + +
+ + BGPPeer +
10.1.0.32
+ + + + BGPSLBPassive + 10.255.0.0/25 +
+ + BGPPeer +
10.1.0.32
+ + + + BGPVac + 192.168.0.0/21 +
+
+ +
+ + 64600 + ARISTA01T1 + + + + 64600 + ARISTA02T1 + + + + 64600 + ARISTA03T1 + + + + 64600 + ARISTA04T1 + + +
+
+ + + + + + HostIP + Loopback0 + + 10.1.0.32/32 + + 10.1.0.32/32 + + + HostIP1 + Loopback0 + + FC00:1::32/128 + + FC00:1::32/128 + + + HostIP2 + Loopback1 + + 10.1.0.34/32 + + 10.1.0.34/32 + + + HostIP3 + Loopback1 + + FC00:1::34/128 + + FC00:1::34/128 + + HostIP6 + Loopback3 + + 10.1.0.38/32 + + 10.1.0.38/32 + + + HostIP7 + Loopback3 + + FC00:1::38/128 + + FC00:1::38/128 + + HostIP4 + Loopback2 + + 10.1.0.36/32 + + 10.1.0.36/32 + + + HostIP5 + Loopback2 + + FC00:1::36/128 + + FC00:1::36/128 + + + + HostIP + eth0 + + 10.3.147.165/23 + + 10.3.147.165/23 + + + V6HostIP + eth0 + + FC00:2::32/64 + + FC00:2::32/64 + + + + + + + str2-7260cx3-acs-12 + + + PortChannel101 + Ethernet13/1;Ethernet14/1 + + + + PortChannel102 + Ethernet15/1;Ethernet16/1 + + + + PortChannel103 + Ethernet17/1;Ethernet18/1 + + + + PortChannel104 + Ethernet19/1;Ethernet20/1 + + + + + + + + + Vlan1000 + Ethernet1/1;Ethernet2/1;Ethernet3/1;Ethernet4/1;Ethernet5/1;Ethernet6/1;Ethernet7/1;Ethernet8/1;Ethernet9/1;Ethernet10/1;Ethernet11/1;Ethernet12/1;Ethernet21/1;Ethernet22/1;Ethernet23/1;Ethernet24/1;Ethernet25/1;Ethernet26/1;Ethernet27/1;Ethernet28/1;Ethernet29/1;Ethernet30/1;Ethernet31/1;Ethernet32/1;Ethernet33/1;Ethernet34/1;Ethernet35/1;Ethernet36/1;Ethernet37/1;Ethernet38/1;Ethernet39/1;Ethernet40/1;Ethernet41/1;Ethernet42/1;Ethernet43/1;Ethernet44/1;Ethernet45/1;Ethernet46/1;Ethernet47/1;Ethernet48/1;Ethernet49/1;Ethernet50/1;Ethernet51/1;Ethernet52/1;Ethernet53/1;Ethernet54/1;Ethernet55/1;Ethernet56/1;Ethernet57/1;Ethernet58/1;Ethernet59/1;Ethernet60/1;Ethernet61/1;Ethernet62/1;Ethernet63/1;Ethernet64/1 + False + 0.0.0.0/0 + 192.0.0.1;192.0.0.2;192.0.0.3;192.0.0.4;192.0.0.5;192.0.0.6;192.0.0.7;192.0.0.8;192.0.0.9;192.0.0.10;192.0.0.11;192.0.0.12;192.0.0.13;192.0.0.14;192.0.0.15;192.0.0.16;192.0.0.17;192.0.0.18;192.0.0.19;192.0.0.20;192.0.0.21;192.0.0.22;192.0.0.23;192.0.0.24;192.0.0.25;192.0.0.26;192.0.0.27;192.0.0.28;192.0.0.29;192.0.0.30;192.0.0.31;192.0.0.32;192.0.0.33;192.0.0.34;192.0.0.35;192.0.0.36;192.0.0.37;192.0.0.38;192.0.0.39;192.0.0.40;192.0.0.41;192.0.0.42;192.0.0.43;192.0.0.44;192.0.0.45;192.0.0.46;192.0.0.47;192.0.0.48 + fc02:2000::1;fc02:2000::2;fc02:2000::3;fc02:2000::4 + 1000 + 1000 + 192.168.0.0/21 + 00:aa:bb:cc:dd:ee + + + + + + PortChannel101 + 10.0.0.56/31 + + + + PortChannel101 + FC00::71/126 + + + + PortChannel102 + 10.0.0.58/31 + + + + PortChannel102 + FC00::75/126 + + + + PortChannel103 + 10.0.0.60/31 + + + + PortChannel103 + FC00::79/126 + + + + PortChannel104 + 10.0.0.62/31 + + + + PortChannel104 + FC00::7D/126 + + + + Vlan1000 + 192.168.0.1/21 + + + + Vlan1000 + fc02:1000::1/64 + + + + + + NTP_ACL + NTP + NTP + + + SNMP_ACL + SNMP + SNMP + + + ERSPAN + Everflow + Everflow + + + ERSPANV6 + EverflowV6 + EverflowV6 + + + VTY_LINE + ssh-only + SSH + + + + + + + + + + DeviceInterfaceLink + ARISTA01T1 + Ethernet1 + str2-7260cx3-acs-12 + Ethernet13/1 + + + DeviceInterfaceLink + ARISTA01T1 + Ethernet2 + str2-7260cx3-acs-12 + Ethernet14/1 + + + DeviceInterfaceLink + ARISTA02T1 + Ethernet1 + str2-7260cx3-acs-12 + Ethernet15/1 + + + DeviceInterfaceLink + ARISTA02T1 + Ethernet2 + str2-7260cx3-acs-12 + Ethernet16/1 + + + DeviceInterfaceLink + ARISTA03T1 + Ethernet1 + str2-7260cx3-acs-12 + Ethernet17/1 + + + DeviceInterfaceLink + ARISTA03T1 + Ethernet2 + str2-7260cx3-acs-12 + Ethernet18/1 + + + DeviceInterfaceLink + ARISTA04T1 + Ethernet1 + str2-7260cx3-acs-12 + Ethernet19/1 + + + DeviceInterfaceLink + ARISTA04T1 + Ethernet2 + str2-7260cx3-acs-12 + Ethernet20/1 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet1/1 + Servers0 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet2/1 + Servers1 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet3/1 + Servers2 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet4/1 + Servers3 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet5/1 + Servers4 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet6/1 + Servers5 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet7/1 + Servers6 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet8/1 + Servers7 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet9/1 + Servers8 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet10/1 + Servers9 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet11/1 + Servers10 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet12/1 + Servers11 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet21/1 + Servers12 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet22/1 + Servers13 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet23/1 + Servers14 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet24/1 + Servers15 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet25/1 + Servers16 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet26/1 + Servers17 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet27/1 + Servers18 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet28/1 + Servers19 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet29/1 + Servers20 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet30/1 + Servers21 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet31/1 + Servers22 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet32/1 + Servers23 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet33/1 + Servers24 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet34/1 + Servers25 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet35/1 + Servers26 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet36/1 + Servers27 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet37/1 + Servers28 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet38/1 + Servers29 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet39/1 + Servers30 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet40/1 + Servers31 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet41/1 + Servers32 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet42/1 + Servers33 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet43/1 + Servers34 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet44/1 + Servers35 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet45/1 + Servers36 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet46/1 + Servers37 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet47/1 + Servers38 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet48/1 + Servers39 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet49/1 + Servers40 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet50/1 + Servers41 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet51/1 + Servers42 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet52/1 + Servers43 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet53/1 + Servers44 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet54/1 + Servers45 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet55/1 + Servers46 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet56/1 + Servers47 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet57/1 + Servers48 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet58/1 + Servers49 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet59/1 + Servers50 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet60/1 + Servers51 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet61/1 + Servers52 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet62/1 + Servers53 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet63/1 + Servers54 + eth0 + + + DeviceInterfaceLink + str2-7260cx3-acs-12 + Ethernet64/1 + Servers55 + eth0 + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet1/1 + str2-7260cx3-acs-12-Servers0-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet2/1 + str2-7260cx3-acs-12-Servers1-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet3/1 + str2-7260cx3-acs-12-Servers2-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet4/1 + str2-7260cx3-acs-12-Servers3-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet5/1 + str2-7260cx3-acs-12-Servers4-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet6/1 + str2-7260cx3-acs-12-Servers5-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet7/1 + str2-7260cx3-acs-12-Servers6-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet8/1 + str2-7260cx3-acs-12-Servers7-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet9/1 + str2-7260cx3-acs-12-Servers8-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet10/1 + str2-7260cx3-acs-12-Servers9-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet11/1 + str2-7260cx3-acs-12-Servers10-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet12/1 + str2-7260cx3-acs-12-Servers11-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet21/1 + str2-7260cx3-acs-12-Servers12-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet22/1 + str2-7260cx3-acs-12-Servers13-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet23/1 + str2-7260cx3-acs-12-Servers14-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet24/1 + str2-7260cx3-acs-12-Servers15-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet25/1 + str2-7260cx3-acs-12-Servers16-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet26/1 + str2-7260cx3-acs-12-Servers17-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet27/1 + str2-7260cx3-acs-12-Servers18-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet28/1 + str2-7260cx3-acs-12-Servers19-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet29/1 + str2-7260cx3-acs-12-Servers20-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet30/1 + str2-7260cx3-acs-12-Servers21-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet31/1 + str2-7260cx3-acs-12-Servers22-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet32/1 + str2-7260cx3-acs-12-Servers23-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet33/1 + str2-7260cx3-acs-12-Servers24-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet34/1 + str2-7260cx3-acs-12-Servers25-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet35/1 + str2-7260cx3-acs-12-Servers26-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet36/1 + str2-7260cx3-acs-12-Servers27-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet37/1 + str2-7260cx3-acs-12-Servers28-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet38/1 + str2-7260cx3-acs-12-Servers29-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet39/1 + str2-7260cx3-acs-12-Servers30-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet40/1 + str2-7260cx3-acs-12-Servers31-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet41/1 + str2-7260cx3-acs-12-Servers32-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet42/1 + str2-7260cx3-acs-12-Servers33-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet43/1 + str2-7260cx3-acs-12-Servers34-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet44/1 + str2-7260cx3-acs-12-Servers35-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet45/1 + str2-7260cx3-acs-12-Servers36-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet46/1 + str2-7260cx3-acs-12-Servers37-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet47/1 + str2-7260cx3-acs-12-Servers38-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet48/1 + str2-7260cx3-acs-12-Servers39-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet49/1 + str2-7260cx3-acs-12-Servers40-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet50/1 + str2-7260cx3-acs-12-Servers41-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet51/1 + str2-7260cx3-acs-12-Servers42-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet52/1 + str2-7260cx3-acs-12-Servers43-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet53/1 + str2-7260cx3-acs-12-Servers44-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet54/1 + str2-7260cx3-acs-12-Servers45-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet55/1 + str2-7260cx3-acs-12-Servers46-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet56/1 + str2-7260cx3-acs-12-Servers47-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet57/1 + str2-7260cx3-acs-12-Servers48-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet58/1 + str2-7260cx3-acs-12-Servers49-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet59/1 + str2-7260cx3-acs-12-Servers50-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet60/1 + str2-7260cx3-acs-12-Servers51-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet61/1 + str2-7260cx3-acs-12-Servers52-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet62/1 + str2-7260cx3-acs-12-Servers53-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet63/1 + str2-7260cx3-acs-12-Servers54-SC + U + + + LogicalLink + str2-7260cx3-acs-12 + Ethernet64/1 + str2-7260cx3-acs-12-Servers55-SC + U + + + + + str2-7260cx3-acs-12 + Arista-7260CX3-D108C8 +
+ 10.1.0.32/32 +
+ + FC00:1::32/128 + + + 10.3.147.165 + +
+ + str2-7260cx3-acs-13 + Arista-7260CX3-D108C8 +
+ 10.1.0.33/32 +
+ + FC00:1::33/128 + + + 10.3.147.167 + +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers0-SC +
+ + Server +
+ 192.168.0.2/26 +
+ + fc02:1000::2/96 + + + 0.0.0.0/0 + + Servers0 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers1-SC +
+ + Server +
+ 192.168.0.3/26 +
+ + fc02:1000::3/96 + + + 0.0.0.0/0 + + Servers1 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers2-SC +
+ + Server +
+ 192.168.0.4/26 +
+ + fc02:1000::4/96 + + + 0.0.0.0/0 + + Servers2 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers3-SC +
+ + Server +
+ 192.168.0.5/26 +
+ + fc02:1000::5/96 + + + 0.0.0.0/0 + + Servers3 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers4-SC +
+ + Server +
+ 192.168.0.6/26 +
+ + fc02:1000::6/96 + + + 0.0.0.0/0 + + Servers4 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers5-SC +
+ + Server +
+ 192.168.0.7/26 +
+ + fc02:1000::7/96 + + + 0.0.0.0/0 + + Servers5 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers6-SC +
+ + Server +
+ 192.168.0.8/26 +
+ + fc02:1000::8/96 + + + 0.0.0.0/0 + + Servers6 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers7-SC +
+ + Server +
+ 192.168.0.9/26 +
+ + fc02:1000::9/96 + + + 0.0.0.0/0 + + Servers7 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers8-SC +
+ + Server +
+ 192.168.0.10/26 +
+ + fc02:1000::a/96 + + + 0.0.0.0/0 + + Servers8 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers9-SC +
+ + Server +
+ 192.168.0.11/26 +
+ + fc02:1000::b/96 + + + 0.0.0.0/0 + + Servers9 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers10-SC +
+ + Server +
+ 192.168.0.12/26 +
+ + fc02:1000::c/96 + + + 0.0.0.0/0 + + Servers10 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers11-SC +
+ + Server +
+ 192.168.0.13/26 +
+ + fc02:1000::d/96 + + + 0.0.0.0/0 + + Servers11 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers12-SC +
+ + Server +
+ 192.168.0.14/26 +
+ + fc02:1000::e/96 + + + 0.0.0.0/0 + + Servers12 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers13-SC +
+ + Server +
+ 192.168.0.15/26 +
+ + fc02:1000::f/96 + + + 0.0.0.0/0 + + Servers13 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers14-SC +
+ + Server +
+ 192.168.0.16/26 +
+ + fc02:1000::10/96 + + + 0.0.0.0/0 + + Servers14 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers15-SC +
+ + Server +
+ 192.168.0.17/26 +
+ + fc02:1000::11/96 + + + 0.0.0.0/0 + + Servers15 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers16-SC +
+ + Server +
+ 192.168.0.18/26 +
+ + fc02:1000::12/96 + + + 0.0.0.0/0 + + Servers16 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers17-SC +
+ + Server +
+ 192.168.0.19/26 +
+ + fc02:1000::13/96 + + + 0.0.0.0/0 + + Servers17 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers18-SC +
+ + Server +
+ 192.168.0.20/26 +
+ + fc02:1000::14/96 + + + 0.0.0.0/0 + + Servers18 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers19-SC +
+ + Server +
+ 192.168.0.21/26 +
+ + fc02:1000::15/96 + + + 0.0.0.0/0 + + Servers19 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers20-SC +
+ + Server +
+ 192.168.0.22/26 +
+ + fc02:1000::16/96 + + + 0.0.0.0/0 + + Servers20 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers21-SC +
+ + Server +
+ 192.168.0.23/26 +
+ + fc02:1000::17/96 + + + 0.0.0.0/0 + + Servers21 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers22-SC +
+ + Server +
+ 192.168.0.24/26 +
+ + fc02:1000::18/96 + + + 0.0.0.0/0 + + Servers22 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers23-SC +
+ + Server +
+ 192.168.0.25/26 +
+ + fc02:1000::19/96 + + + 0.0.0.0/0 + + Servers23 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers24-SC +
+ + Server +
+ 192.168.0.26/26 +
+ + fc02:1000::1a/96 + + + 0.0.0.0/0 + + Servers24 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers25-SC +
+ + Server +
+ 192.168.0.27/26 +
+ + fc02:1000::1b/96 + + + 0.0.0.0/0 + + Servers25 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers26-SC +
+ + Server +
+ 192.168.0.28/26 +
+ + fc02:1000::1c/96 + + + 0.0.0.0/0 + + Servers26 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers27-SC +
+ + Server +
+ 192.168.0.29/26 +
+ + fc02:1000::1d/96 + + + 0.0.0.0/0 + + Servers27 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers28-SC +
+ + Server +
+ 192.168.0.30/26 +
+ + fc02:1000::1e/96 + + + 0.0.0.0/0 + + Servers28 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers29-SC +
+ + Server +
+ 192.168.0.31/26 +
+ + fc02:1000::1f/96 + + + 0.0.0.0/0 + + Servers29 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers30-SC +
+ + Server +
+ 192.168.0.32/26 +
+ + fc02:1000::20/96 + + + 0.0.0.0/0 + + Servers30 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers31-SC +
+ + Server +
+ 192.168.0.33/26 +
+ + fc02:1000::21/96 + + + 0.0.0.0/0 + + Servers31 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers32-SC +
+ + Server +
+ 192.168.0.34/26 +
+ + fc02:1000::22/96 + + + 0.0.0.0/0 + + Servers32 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers33-SC +
+ + Server +
+ 192.168.0.35/26 +
+ + fc02:1000::23/96 + + + 0.0.0.0/0 + + Servers33 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers34-SC +
+ + Server +
+ 192.168.0.36/26 +
+ + fc02:1000::24/96 + + + 0.0.0.0/0 + + Servers34 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers35-SC +
+ + Server +
+ 192.168.0.37/26 +
+ + fc02:1000::25/96 + + + 0.0.0.0/0 + + Servers35 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers36-SC +
+ + Server +
+ 192.168.0.38/26 +
+ + fc02:1000::26/96 + + + 0.0.0.0/0 + + Servers36 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers37-SC +
+ + Server +
+ 192.168.0.39/26 +
+ + fc02:1000::27/96 + + + 0.0.0.0/0 + + Servers37 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers38-SC +
+ + Server +
+ 192.168.0.40/26 +
+ + fc02:1000::28/96 + + + 0.0.0.0/0 + + Servers38 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers39-SC +
+ + Server +
+ 192.168.0.41/26 +
+ + fc02:1000::29/96 + + + 0.0.0.0/0 + + Servers39 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers40-SC +
+ + Server +
+ 192.168.0.42/26 +
+ + fc02:1000::2a/96 + + + 0.0.0.0/0 + + Servers40 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers41-SC +
+ + Server +
+ 192.168.0.43/26 +
+ + fc02:1000::2b/96 + + + 0.0.0.0/0 + + Servers41 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers42-SC +
+ + Server +
+ 192.168.0.44/26 +
+ + fc02:1000::2c/96 + + + 0.0.0.0/0 + + Servers42 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers43-SC +
+ + Server +
+ 192.168.0.45/26 +
+ + fc02:1000::2d/96 + + + 0.0.0.0/0 + + Servers43 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers44-SC +
+ + Server +
+ 192.168.0.46/26 +
+ + fc02:1000::2e/96 + + + 0.0.0.0/0 + + Servers44 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers45-SC +
+ + Server +
+ 192.168.0.47/26 +
+ + fc02:1000::2f/96 + + + 0.0.0.0/0 + + Servers45 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers46-SC +
+ + Server +
+ 192.168.0.48/26 +
+ + fc02:1000::30/96 + + + 0.0.0.0/0 + + Servers46 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers47-SC +
+ + Server +
+ 192.168.0.49/26 +
+ + fc02:1000::31/96 + + + 0.0.0.0/0 + + Servers47 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers48-SC +
+ + Server +
+ 192.168.0.50/26 +
+ + fc02:1000::32/96 + + + 0.0.0.0/0 + + Servers48 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers49-SC +
+ + Server +
+ 192.168.0.51/26 +
+ + fc02:1000::33/96 + + + 0.0.0.0/0 + + Servers49 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers50-SC +
+ + Server +
+ 192.168.0.52/26 +
+ + fc02:1000::34/96 + + + 0.0.0.0/0 + + Servers50 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers51-SC +
+ + Server +
+ 192.168.0.53/26 +
+ + fc02:1000::35/96 + + + 0.0.0.0/0 + + Servers51 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers52-SC +
+ + Server +
+ 192.168.0.54/26 +
+ + fc02:1000::36/96 + + + 0.0.0.0/0 + + Servers52 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers53-SC +
+ + Server +
+ 192.168.0.55/26 +
+ + fc02:1000::37/96 + + + 0.0.0.0/0 + + Servers53 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers54-SC +
+ + Server +
+ 192.168.0.56/26 +
+ + fc02:1000::38/96 + + + 0.0.0.0/0 + + Servers54 +
+ + SmartCable +
+ 0.0.0.0/0 +
+ + ::/0 + + + 0.0.0.0/0 + + + ::/0 + + + str2-7260cx3-acs-12-Servers55-SC +
+ + Server +
+ 192.168.0.57/26 +
+ + fc02:1000::39/96 + + + 0.0.0.0/0 + + Servers55 +
+ + ARISTA04T1 + + 172.16.147.75 + + Arista-VM + + + ARISTA03T1 + + 172.16.147.74 + + Arista-VM + + + ARISTA02T1 + + 172.16.147.73 + + Arista-VM + + + ARISTA01T1 + + 172.16.147.72 + + Arista-VM + +
+
+ + + true + + + DeviceInterface + + true + true + 1 + Ethernet1/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet1/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet2/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet2/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet3/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet3/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet4/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet4/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet5/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet5/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet6/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet6/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet7/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet7/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet8/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet8/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet9/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet9/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet10/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet10/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet11/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet11/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet12/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet12/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet13/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet14/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet15/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet16/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet17/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet18/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet19/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet20/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet21/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet21/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet22/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet22/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet23/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet23/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet24/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet24/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet25/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet25/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet26/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet26/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet27/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet27/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet28/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet28/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet29/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet29/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet30/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet30/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet31/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet31/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet32/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet32/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet33/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet33/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet34/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet34/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet35/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet35/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet36/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet36/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet37/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet37/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet38/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet38/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet39/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet39/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet40/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet40/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet41/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet41/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet42/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet42/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet43/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet43/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet44/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet44/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet45/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet45/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet46/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet46/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet47/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet47/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet48/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet48/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet49/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet49/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet50/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet50/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet51/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet51/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet52/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet52/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet53/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet53/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet54/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet54/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet55/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet55/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet56/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet56/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet57/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet57/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet58/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet58/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet59/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet59/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet60/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet60/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet61/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet61/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet62/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet62/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet63/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet63/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet64/1 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet64/3 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + Ethernet65 + + false + 0 + 0 + 10000 + + + DeviceInterface + + true + true + 1 + Ethernet66 + + false + 0 + 0 + 10000 + + + true + 0 + Arista-7260CX3-D108C8 + + + + + + + str2-7260cx3-acs-12 + + + DeploymentId + + 1 + + + QosProfile + + Profile0 + + + GeminiEnabled + + True + + + DhcpResources + + 192.0.0.1;192.0.0.2;192.0.0.3;192.0.0.4;192.0.0.5;192.0.0.6;192.0.0.7;192.0.0.8;192.0.0.9;192.0.0.10;192.0.0.11;192.0.0.12;192.0.0.13;192.0.0.14;192.0.0.15;192.0.0.16;192.0.0.17;192.0.0.18;192.0.0.19;192.0.0.20;192.0.0.21;192.0.0.22;192.0.0.23;192.0.0.24;192.0.0.25;192.0.0.26;192.0.0.27;192.0.0.28;192.0.0.29;192.0.0.30;192.0.0.31;192.0.0.32;192.0.0.33;192.0.0.34;192.0.0.35;192.0.0.36;192.0.0.37;192.0.0.38;192.0.0.39;192.0.0.40;192.0.0.41;192.0.0.42;192.0.0.43;192.0.0.44;192.0.0.45;192.0.0.46;192.0.0.47;192.0.0.48 + + + NtpResources + + 10.20.8.129;10.20.8.130 + + + SnmpResources + + 10.3.145.98 + + + SyslogResources + + 10.64.246.95 + + + TacacsGroup + + Starlab + + + TacacsServer + + 100.127.20.21 + + + ForcedMgmtRoutes + + 10.3.145.98/31;10.3.145.8;100.127.20.16/28;10.3.149.170/31;40.122.216.24;13.91.48.226;10.3.145.14;10.64.246.0/24;10.3.146.0/23;10.64.5.5 + + + ErspanDestinationIpv4 + + 10.20.6.16 + + + RedundancyType + + Gemini + + + + + + + + + + + + + GeminiPeeringLink + + True + + + UpperTOR + + str2-7260cx3-acs-12 + + + LowerTOR + + str2-7260cx3-acs-13 + + + str2-7260cx3-acs-13:MuxTunnel0;str2-7260cx3-acs-12:MuxTunnel0 + + + + str2-7260cx3-acs-12 + Arista-7260CX3-D108C8 +
diff --git a/src/sonic-config-engine/tests/sample-arista-7260-t1-minigraph-remap-disabled.xml b/src/sonic-config-engine/tests/sample-arista-7260-t1-minigraph-remap-disabled.xml new file mode 100644 index 000000000000..4367b705a11a --- /dev/null +++ b/src/sonic-config-engine/tests/sample-arista-7260-t1-minigraph-remap-disabled.xml @@ -0,0 +1,2491 @@ + + + + + + false + str-7260cx3-acs-7 + 10.0.0.32 + ARISTA01T0 + 10.0.0.33 + 1 + 10 + 3 + + + str-7260cx3-acs-7 + FC00::41 + ARISTA01T0 + FC00::42 + 1 + 10 + 3 + + + false + str-7260cx3-acs-7 + 10.0.0.0 + ARISTA01T2 + 10.0.0.1 + 1 + 10 + 3 + + + str-7260cx3-acs-7 + FC00::1 + ARISTA01T2 + FC00::2 + 1 + 10 + 3 + + + false + str-7260cx3-acs-7 + 10.0.0.34 + ARISTA02T0 + 10.0.0.35 + 1 + 10 + 3 + + + str-7260cx3-acs-7 + FC00::45 + ARISTA02T0 + FC00::46 + 1 + 10 + 3 + + + false + str-7260cx3-acs-7 + 10.0.0.36 + ARISTA03T0 + 10.0.0.37 + 1 + 10 + 3 + + + str-7260cx3-acs-7 + FC00::49 + ARISTA03T0 + FC00::4A + 1 + 10 + 3 + + + false + str-7260cx3-acs-7 + 10.0.0.4 + ARISTA03T2 + 10.0.0.5 + 1 + 10 + 3 + + + str-7260cx3-acs-7 + FC00::5 + ARISTA03T2 + FC00::6 + 1 + 10 + 3 + + + false + str-7260cx3-acs-7 + 10.0.0.38 + ARISTA04T0 + 10.0.0.39 + 1 + 10 + 3 + + + str-7260cx3-acs-7 + FC00::4D + ARISTA04T0 + FC00::4E + 1 + 10 + 3 + + + false + str-7260cx3-acs-7 + 10.0.0.40 + ARISTA05T0 + 10.0.0.41 + 1 + 10 + 3 + + + str-7260cx3-acs-7 + FC00::51 + ARISTA05T0 + FC00::52 + 1 + 10 + 3 + + + false + str-7260cx3-acs-7 + 10.0.0.8 + ARISTA05T2 + 10.0.0.9 + 1 + 10 + 3 + + + str-7260cx3-acs-7 + FC00::9 + ARISTA05T2 + FC00::A + 1 + 10 + 3 + + + false + str-7260cx3-acs-7 + 10.0.0.42 + ARISTA06T0 + 10.0.0.43 + 1 + 10 + 3 + + + str-7260cx3-acs-7 + FC00::55 + ARISTA06T0 + FC00::56 + 1 + 10 + 3 + + + false + str-7260cx3-acs-7 + 10.0.0.44 + ARISTA07T0 + 10.0.0.45 + 1 + 10 + 3 + + + str-7260cx3-acs-7 + FC00::59 + ARISTA07T0 + FC00::5A + 1 + 10 + 3 + + + false + str-7260cx3-acs-7 + 10.0.0.12 + ARISTA07T2 + 10.0.0.13 + 1 + 10 + 3 + + + str-7260cx3-acs-7 + FC00::D + ARISTA07T2 + FC00::E + 1 + 10 + 3 + + + false + str-7260cx3-acs-7 + 10.0.0.46 + ARISTA08T0 + 10.0.0.47 + 1 + 10 + 3 + + + str-7260cx3-acs-7 + FC00::5D + ARISTA08T0 + FC00::5E + 1 + 10 + 3 + + + false + str-7260cx3-acs-7 + 10.0.0.48 + ARISTA09T0 + 10.0.0.49 + 1 + 10 + 3 + + + str-7260cx3-acs-7 + FC00::61 + ARISTA09T0 + FC00::62 + 1 + 10 + 3 + + + false + str-7260cx3-acs-7 + 10.0.0.50 + ARISTA10T0 + 10.0.0.51 + 1 + 10 + 3 + + + str-7260cx3-acs-7 + FC00::65 + ARISTA10T0 + FC00::66 + 1 + 10 + 3 + + + false + str-7260cx3-acs-7 + 10.0.0.52 + ARISTA11T0 + 10.0.0.53 + 1 + 10 + 3 + + + str-7260cx3-acs-7 + FC00::69 + ARISTA11T0 + FC00::6A + 1 + 10 + 3 + + + false + str-7260cx3-acs-7 + 10.0.0.54 + ARISTA12T0 + 10.0.0.55 + 1 + 10 + 3 + + + str-7260cx3-acs-7 + FC00::6D + ARISTA12T0 + FC00::6E + 1 + 10 + 3 + + + false + str-7260cx3-acs-7 + 10.0.0.56 + ARISTA13T0 + 10.0.0.57 + 1 + 10 + 3 + + + str-7260cx3-acs-7 + FC00::71 + ARISTA13T0 + FC00::72 + 1 + 10 + 3 + + + false + str-7260cx3-acs-7 + 10.0.0.58 + ARISTA14T0 + 10.0.0.59 + 1 + 10 + 3 + + + str-7260cx3-acs-7 + FC00::75 + ARISTA14T0 + FC00::76 + 1 + 10 + 3 + + + false + str-7260cx3-acs-7 + 10.0.0.60 + ARISTA15T0 + 10.0.0.61 + 1 + 10 + 3 + + + str-7260cx3-acs-7 + FC00::79 + ARISTA15T0 + FC00::7A + 1 + 10 + 3 + + + false + str-7260cx3-acs-7 + 10.0.0.62 + ARISTA16T0 + 10.0.0.63 + 1 + 10 + 3 + + + str-7260cx3-acs-7 + FC00::7D + ARISTA16T0 + FC00::7E + 1 + 10 + 3 + + + false + str-7260cx3-acs-7 + 10.0.0.64 + ARISTA17T0 + 10.0.0.65 + 1 + 10 + 3 + + + str-7260cx3-acs-7 + FC00::81 + ARISTA17T0 + FC00::82 + 1 + 10 + 3 + + + false + str-7260cx3-acs-7 + 10.0.0.66 + ARISTA18T0 + 10.0.0.67 + 1 + 10 + 3 + + + str-7260cx3-acs-7 + FC00::85 + ARISTA18T0 + FC00::86 + 1 + 10 + 3 + + + false + str-7260cx3-acs-7 + 10.0.0.68 + ARISTA19T0 + 10.0.0.69 + 1 + 10 + 3 + + + str-7260cx3-acs-7 + FC00::89 + ARISTA19T0 + FC00::8A + 1 + 10 + 3 + + + false + str-7260cx3-acs-7 + 10.0.0.70 + ARISTA20T0 + 10.0.0.71 + 1 + 10 + 3 + + + str-7260cx3-acs-7 + FC00::8D + ARISTA20T0 + FC00::8E + 1 + 10 + 3 + + + + + 65100 + str-7260cx3-acs-7 + + +
10.0.0.33
+ + + +
+ +
10.0.0.1
+ + + +
+ +
10.0.0.35
+ + + +
+ +
10.0.0.37
+ + + +
+ +
10.0.0.5
+ + + +
+ +
10.0.0.39
+ + + +
+ +
10.0.0.41
+ + + +
+ +
10.0.0.9
+ + + +
+ +
10.0.0.43
+ + + +
+ +
10.0.0.45
+ + + +
+ +
10.0.0.13
+ + + +
+ +
10.0.0.47
+ + + +
+ +
10.0.0.49
+ + + +
+ +
10.0.0.51
+ + + +
+ +
10.0.0.53
+ + + +
+ +
10.0.0.55
+ + + +
+ +
10.0.0.57
+ + + +
+ +
10.0.0.59
+ + + +
+ +
10.0.0.61
+ + + +
+ +
10.0.0.63
+ + + +
+ +
10.0.0.65
+ + + +
+ +
10.0.0.67
+ + + +
+ +
10.0.0.69
+ + + +
+ +
10.0.0.71
+ + + +
+
+ +
+ + 64001 + ARISTA01T0 + + + + 65200 + ARISTA01T2 + + + + 64002 + ARISTA02T0 + + + + 64003 + ARISTA03T0 + + + + 65200 + ARISTA03T2 + + + + 64004 + ARISTA04T0 + + + + 64005 + ARISTA05T0 + + + + 65200 + ARISTA05T2 + + + + 64006 + ARISTA06T0 + + + + 64007 + ARISTA07T0 + + + + 65200 + ARISTA07T2 + + + + 64008 + ARISTA08T0 + + + + 64009 + ARISTA09T0 + + + + 64010 + ARISTA10T0 + + + + 64011 + ARISTA11T0 + + + + 64012 + ARISTA12T0 + + + + 64013 + ARISTA13T0 + + + + 64014 + ARISTA14T0 + + + + 64015 + ARISTA15T0 + + + + 64016 + ARISTA16T0 + + + + 64017 + ARISTA17T0 + + + + 64018 + ARISTA18T0 + + + + 64019 + ARISTA19T0 + + + + 64020 + ARISTA20T0 + + +
+
+ + + + + + HostIP + Loopback0 + + 10.1.0.32/32 + + 10.1.0.32/32 + + + HostIP1 + Loopback0 + + FC00:1::32/128 + + FC00:1::32/128 + + + + + HostIP + eth0 + + 10.64.246.78/23 + + 10.64.246.78/23 + + + V6HostIP + eth0 + + FC00:2::32/64 + + FC00:2::32/64 + + + + + + + str-7260cx3-acs-7 + + + PortChannel101 + Ethernet35/1 + + + + PortChannel102 + Ethernet1/1;Ethernet2/1 + + + + PortChannel103 + Ethernet37/1 + + + + PortChannel104 + Ethernet38/1 + + + + PortChannel105 + Ethernet5/1;Ethernet6/1 + + + + PortChannel106 + Ethernet39/1 + + + + PortChannel107 + Ethernet40/1 + + + + PortChannel108 + Ethernet17/1;Ethernet18/1 + + + + PortChannel109 + Ethernet43/1 + + + + PortChannel1010 + Ethernet45/1 + + + + PortChannel1011 + Ethernet21/1;Ethernet22/1 + + + + PortChannel1012 + Ethernet46/1 + + + + PortChannel1013 + Ethernet47/1 + + + + PortChannel1014 + Ethernet48/1 + + + + PortChannel1015 + Ethernet51/1 + + + + PortChannel1016 + Ethernet53/1 + + + + PortChannel1017 + Ethernet54/1 + + + + PortChannel1018 + Ethernet55/1 + + + + PortChannel1019 + Ethernet56/1 + + + + PortChannel1020 + Ethernet59/1 + + + + PortChannel1021 + Ethernet61/1 + + + + PortChannel1022 + Ethernet62/1 + + + + PortChannel1023 + Ethernet63/1 + + + + PortChannel1024 + Ethernet64/1 + + + + + + + + + PortChannel101 + 10.0.0.32/31 + + + + PortChannel101 + FC00::41/126 + + + + PortChannel102 + 10.0.0.0/31 + + + + PortChannel102 + FC00::1/126 + + + + PortChannel103 + 10.0.0.34/31 + + + + PortChannel103 + FC00::45/126 + + + + PortChannel104 + 10.0.0.36/31 + + + + PortChannel104 + FC00::49/126 + + + + PortChannel105 + 10.0.0.4/31 + + + + PortChannel105 + FC00::5/126 + + + + PortChannel106 + 10.0.0.38/31 + + + + PortChannel106 + FC00::4D/126 + + + + PortChannel107 + 10.0.0.40/31 + + + + PortChannel107 + FC00::51/126 + + + + PortChannel108 + 10.0.0.8/31 + + + + PortChannel108 + FC00::9/126 + + + + PortChannel109 + 10.0.0.42/31 + + + + PortChannel109 + FC00::55/126 + + + + PortChannel1010 + 10.0.0.44/31 + + + + PortChannel1010 + FC00::59/126 + + + + PortChannel1011 + 10.0.0.12/31 + + + + PortChannel1011 + FC00::D/126 + + + + PortChannel1012 + 10.0.0.46/31 + + + + PortChannel1012 + FC00::5D/126 + + + + PortChannel1013 + 10.0.0.48/31 + + + + PortChannel1013 + FC00::61/126 + + + + PortChannel1014 + 10.0.0.50/31 + + + + PortChannel1014 + FC00::65/126 + + + + PortChannel1015 + 10.0.0.52/31 + + + + PortChannel1015 + FC00::69/126 + + + + PortChannel1016 + 10.0.0.54/31 + + + + PortChannel1016 + FC00::6D/126 + + + + PortChannel1017 + 10.0.0.56/31 + + + + PortChannel1017 + FC00::71/126 + + + + PortChannel1018 + 10.0.0.58/31 + + + + PortChannel1018 + FC00::75/126 + + + + PortChannel1019 + 10.0.0.60/31 + + + + PortChannel1019 + FC00::79/126 + + + + PortChannel1020 + 10.0.0.62/31 + + + + PortChannel1020 + FC00::7D/126 + + + + PortChannel1021 + 10.0.0.64/31 + + + + PortChannel1021 + FC00::81/126 + + + + PortChannel1022 + 10.0.0.66/31 + + + + PortChannel1022 + FC00::85/126 + + + + PortChannel1023 + 10.0.0.68/31 + + + + PortChannel1023 + FC00::89/126 + + + + PortChannel1024 + 10.0.0.70/31 + + + + PortChannel1024 + FC00::8D/126 + + + + + + NTP_ACL + NTP + NTP + + + SNMP_ACL + SNMP + SNMP + + + ERSPAN + Everflow + Everflow + + + ERSPANV6 + EverflowV6 + EverflowV6 + + + VTY_LINE + ssh-only + SSH + + + PortChannel101;PortChannel102;PortChannel103;PortChannel104;PortChannel105;PortChannel106;PortChannel107;PortChannel108;PortChannel109;PortChannel1010;PortChannel1011;PortChannel1012;PortChannel1013;PortChannel1014;PortChannel1015;PortChannel1016;PortChannel1017;PortChannel1018;PortChannel1019;PortChannel1020;PortChannel1021;PortChannel1022;PortChannel1023;PortChannel1024 + DataAcl + DataPlane + + + + + + + + + + DeviceInterfaceLink + ARISTA01T0 + Ethernet1 + str-7260cx3-acs-7 + Ethernet35/1 + + + DeviceInterfaceLink + ARISTA01T2 + Ethernet1 + str-7260cx3-acs-7 + Ethernet1/1 + + + DeviceInterfaceLink + ARISTA01T2 + Ethernet2 + str-7260cx3-acs-7 + Ethernet2/1 + + + DeviceInterfaceLink + ARISTA02T0 + Ethernet1 + str-7260cx3-acs-7 + Ethernet37/1 + + + DeviceInterfaceLink + ARISTA03T0 + Ethernet1 + str-7260cx3-acs-7 + Ethernet38/1 + + + DeviceInterfaceLink + ARISTA03T2 + Ethernet1 + str-7260cx3-acs-7 + Ethernet5/1 + + + DeviceInterfaceLink + ARISTA03T2 + Ethernet2 + str-7260cx3-acs-7 + Ethernet6/1 + + + DeviceInterfaceLink + ARISTA04T0 + Ethernet1 + str-7260cx3-acs-7 + Ethernet39/1 + + + DeviceInterfaceLink + ARISTA05T0 + Ethernet1 + str-7260cx3-acs-7 + Ethernet40/1 + + + DeviceInterfaceLink + ARISTA05T2 + Ethernet1 + str-7260cx3-acs-7 + Ethernet17/1 + + + DeviceInterfaceLink + ARISTA05T2 + Ethernet2 + str-7260cx3-acs-7 + Ethernet18/1 + + + DeviceInterfaceLink + ARISTA06T0 + Ethernet1 + str-7260cx3-acs-7 + Ethernet43/1 + + + DeviceInterfaceLink + ARISTA07T0 + Ethernet1 + str-7260cx3-acs-7 + Ethernet45/1 + + + DeviceInterfaceLink + ARISTA07T2 + Ethernet1 + str-7260cx3-acs-7 + Ethernet21/1 + + + DeviceInterfaceLink + ARISTA07T2 + Ethernet2 + str-7260cx3-acs-7 + Ethernet22/1 + + + DeviceInterfaceLink + ARISTA08T0 + Ethernet1 + str-7260cx3-acs-7 + Ethernet46/1 + + + DeviceInterfaceLink + ARISTA09T0 + Ethernet1 + str-7260cx3-acs-7 + Ethernet47/1 + + + DeviceInterfaceLink + ARISTA10T0 + Ethernet1 + str-7260cx3-acs-7 + Ethernet48/1 + + + DeviceInterfaceLink + ARISTA11T0 + Ethernet1 + str-7260cx3-acs-7 + Ethernet51/1 + + + DeviceInterfaceLink + ARISTA12T0 + Ethernet1 + str-7260cx3-acs-7 + Ethernet53/1 + + + DeviceInterfaceLink + ARISTA13T0 + Ethernet1 + str-7260cx3-acs-7 + Ethernet54/1 + + + DeviceInterfaceLink + ARISTA14T0 + Ethernet1 + str-7260cx3-acs-7 + Ethernet55/1 + + + DeviceInterfaceLink + ARISTA15T0 + Ethernet1 + str-7260cx3-acs-7 + Ethernet56/1 + + + DeviceInterfaceLink + ARISTA16T0 + Ethernet1 + str-7260cx3-acs-7 + Ethernet59/1 + + + DeviceInterfaceLink + ARISTA17T0 + Ethernet1 + str-7260cx3-acs-7 + Ethernet61/1 + + + DeviceInterfaceLink + ARISTA18T0 + Ethernet1 + str-7260cx3-acs-7 + Ethernet62/1 + + + DeviceInterfaceLink + ARISTA19T0 + Ethernet1 + str-7260cx3-acs-7 + Ethernet63/1 + + + DeviceInterfaceLink + ARISTA20T0 + Ethernet1 + str-7260cx3-acs-7 + Ethernet64/1 + + + + + str-7260cx3-acs-7 + Arista-7260CX3-C64 + + 10.64.246.78 + + + + ARISTA16T0 + + 172.16.141.95 + + Arista-VM + + + ARISTA11T0 + + 172.16.141.90 + + Arista-VM + + + ARISTA10T0 + + 172.16.141.89 + + Arista-VM + + + ARISTA17T0 + + 172.16.141.96 + + Arista-VM + + + ARISTA09T0 + + 172.16.141.88 + + Arista-VM + + + ARISTA20T0 + + 172.16.141.99 + + Arista-VM + + + ARISTA08T0 + + 172.16.141.87 + + Arista-VM + + + ARISTA07T0 + + 172.16.141.86 + + Arista-VM + + + ARISTA07T2 + + 172.16.141.79 + + Arista-VM + + + ARISTA01T2 + + 172.16.141.76 + + Arista-VM + + + ARISTA01T0 + + 172.16.141.80 + + Arista-VM + + + ARISTA05T2 + + 172.16.141.78 + + Arista-VM + + + ARISTA05T0 + + 172.16.141.84 + + Arista-VM + + + ARISTA02T0 + + 172.16.141.81 + + Arista-VM + + + ARISTA03T0 + + 172.16.141.82 + + Arista-VM + + + ARISTA03T2 + + 172.16.141.77 + + Arista-VM + + + ARISTA04T0 + + 172.16.141.83 + + Arista-VM + + + ARISTA18T0 + + 172.16.141.97 + + Arista-VM + + + ARISTA15T0 + + 172.16.141.94 + + Arista-VM + + + ARISTA19T0 + + 172.16.141.98 + + Arista-VM + + + ARISTA14T0 + + 172.16.141.93 + + Arista-VM + + + ARISTA12T0 + + 172.16.141.91 + + Arista-VM + + + ARISTA13T0 + + 172.16.141.92 + + Arista-VM + + + ARISTA06T0 + + 172.16.141.85 + + Arista-VM + + + + + + true + + + DeviceInterface + + true + true + 1 + Ethernet1/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet2/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet3/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet4/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet5/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet6/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet7/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet8/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet9/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet10/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet11/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet12/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet13/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet14/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet15/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet16/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet17/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet18/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet19/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet20/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet21/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet22/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet23/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet24/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet25/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet26/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet27/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet28/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet29/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet30/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet31/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet32/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet33/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet34/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet35/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet36/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet37/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet38/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet39/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet40/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet41/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet42/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet43/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet44/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet45/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet46/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet47/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet48/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet49/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet50/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet51/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet52/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet53/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet54/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet55/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet56/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet57/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet58/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet59/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet60/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet61/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet62/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet63/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet64/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet65 + + false + 0 + 0 + 10000 + + + DeviceInterface + + true + true + 1 + Ethernet66 + + false + 0 + 0 + 10000 + + + true + 0 + Arista-7260CX3-C64 + + + + + + + str-7260cx3-acs-7 + + + DeploymentId + + 1 + + + QosProfile + + Profile0 + + + DhcpResources + + 192.0.0.1;192.0.0.2;192.0.0.3;192.0.0.4;192.0.0.5;192.0.0.6;192.0.0.7;192.0.0.8;192.0.0.9;192.0.0.10;192.0.0.11;192.0.0.12;192.0.0.13;192.0.0.14;192.0.0.15;192.0.0.16;192.0.0.17;192.0.0.18;192.0.0.19;192.0.0.20;192.0.0.21;192.0.0.22;192.0.0.23;192.0.0.24;192.0.0.25;192.0.0.26;192.0.0.27;192.0.0.28;192.0.0.29;192.0.0.30;192.0.0.31;192.0.0.32;192.0.0.33;192.0.0.34;192.0.0.35;192.0.0.36;192.0.0.37;192.0.0.38;192.0.0.39;192.0.0.40;192.0.0.41;192.0.0.42;192.0.0.43;192.0.0.44;192.0.0.45;192.0.0.46;192.0.0.47;192.0.0.48 + + + NtpResources + + 10.20.8.129;10.20.8.130 + + + SnmpResources + + 10.3.145.98 + + + SyslogResources + + 10.64.246.95 + + + TacacsGroup + + Starlab + + + TacacsServer + + 100.127.20.21 + + + ForcedMgmtRoutes + + 10.3.145.98/31;10.3.145.8;100.127.20.16/28;10.3.149.170/31;40.122.216.24;13.91.48.226;10.3.145.14;10.64.246.0/24;10.64.247.0/24;10.64.5.5 + + + ErspanDestinationIpv4 + + 10.20.6.16 + + + + + + + str-7260cx3-acs-7 + Arista-7260CX3-C64 +
diff --git a/src/sonic-config-engine/tests/sample-arista-7260-t1-minigraph.xml b/src/sonic-config-engine/tests/sample-arista-7260-t1-minigraph.xml new file mode 100644 index 000000000000..47dcdafcd404 --- /dev/null +++ b/src/sonic-config-engine/tests/sample-arista-7260-t1-minigraph.xml @@ -0,0 +1,2496 @@ + + + + + + false + str-7260cx3-acs-7 + 10.0.0.32 + ARISTA01T0 + 10.0.0.33 + 1 + 10 + 3 + + + str-7260cx3-acs-7 + FC00::41 + ARISTA01T0 + FC00::42 + 1 + 10 + 3 + + + false + str-7260cx3-acs-7 + 10.0.0.0 + ARISTA01T2 + 10.0.0.1 + 1 + 10 + 3 + + + str-7260cx3-acs-7 + FC00::1 + ARISTA01T2 + FC00::2 + 1 + 10 + 3 + + + false + str-7260cx3-acs-7 + 10.0.0.34 + ARISTA02T0 + 10.0.0.35 + 1 + 10 + 3 + + + str-7260cx3-acs-7 + FC00::45 + ARISTA02T0 + FC00::46 + 1 + 10 + 3 + + + false + str-7260cx3-acs-7 + 10.0.0.36 + ARISTA03T0 + 10.0.0.37 + 1 + 10 + 3 + + + str-7260cx3-acs-7 + FC00::49 + ARISTA03T0 + FC00::4A + 1 + 10 + 3 + + + false + str-7260cx3-acs-7 + 10.0.0.4 + ARISTA03T2 + 10.0.0.5 + 1 + 10 + 3 + + + str-7260cx3-acs-7 + FC00::5 + ARISTA03T2 + FC00::6 + 1 + 10 + 3 + + + false + str-7260cx3-acs-7 + 10.0.0.38 + ARISTA04T0 + 10.0.0.39 + 1 + 10 + 3 + + + str-7260cx3-acs-7 + FC00::4D + ARISTA04T0 + FC00::4E + 1 + 10 + 3 + + + false + str-7260cx3-acs-7 + 10.0.0.40 + ARISTA05T0 + 10.0.0.41 + 1 + 10 + 3 + + + str-7260cx3-acs-7 + FC00::51 + ARISTA05T0 + FC00::52 + 1 + 10 + 3 + + + false + str-7260cx3-acs-7 + 10.0.0.8 + ARISTA05T2 + 10.0.0.9 + 1 + 10 + 3 + + + str-7260cx3-acs-7 + FC00::9 + ARISTA05T2 + FC00::A + 1 + 10 + 3 + + + false + str-7260cx3-acs-7 + 10.0.0.42 + ARISTA06T0 + 10.0.0.43 + 1 + 10 + 3 + + + str-7260cx3-acs-7 + FC00::55 + ARISTA06T0 + FC00::56 + 1 + 10 + 3 + + + false + str-7260cx3-acs-7 + 10.0.0.44 + ARISTA07T0 + 10.0.0.45 + 1 + 10 + 3 + + + str-7260cx3-acs-7 + FC00::59 + ARISTA07T0 + FC00::5A + 1 + 10 + 3 + + + false + str-7260cx3-acs-7 + 10.0.0.12 + ARISTA07T2 + 10.0.0.13 + 1 + 10 + 3 + + + str-7260cx3-acs-7 + FC00::D + ARISTA07T2 + FC00::E + 1 + 10 + 3 + + + false + str-7260cx3-acs-7 + 10.0.0.46 + ARISTA08T0 + 10.0.0.47 + 1 + 10 + 3 + + + str-7260cx3-acs-7 + FC00::5D + ARISTA08T0 + FC00::5E + 1 + 10 + 3 + + + false + str-7260cx3-acs-7 + 10.0.0.48 + ARISTA09T0 + 10.0.0.49 + 1 + 10 + 3 + + + str-7260cx3-acs-7 + FC00::61 + ARISTA09T0 + FC00::62 + 1 + 10 + 3 + + + false + str-7260cx3-acs-7 + 10.0.0.50 + ARISTA10T0 + 10.0.0.51 + 1 + 10 + 3 + + + str-7260cx3-acs-7 + FC00::65 + ARISTA10T0 + FC00::66 + 1 + 10 + 3 + + + false + str-7260cx3-acs-7 + 10.0.0.52 + ARISTA11T0 + 10.0.0.53 + 1 + 10 + 3 + + + str-7260cx3-acs-7 + FC00::69 + ARISTA11T0 + FC00::6A + 1 + 10 + 3 + + + false + str-7260cx3-acs-7 + 10.0.0.54 + ARISTA12T0 + 10.0.0.55 + 1 + 10 + 3 + + + str-7260cx3-acs-7 + FC00::6D + ARISTA12T0 + FC00::6E + 1 + 10 + 3 + + + false + str-7260cx3-acs-7 + 10.0.0.56 + ARISTA13T0 + 10.0.0.57 + 1 + 10 + 3 + + + str-7260cx3-acs-7 + FC00::71 + ARISTA13T0 + FC00::72 + 1 + 10 + 3 + + + false + str-7260cx3-acs-7 + 10.0.0.58 + ARISTA14T0 + 10.0.0.59 + 1 + 10 + 3 + + + str-7260cx3-acs-7 + FC00::75 + ARISTA14T0 + FC00::76 + 1 + 10 + 3 + + + false + str-7260cx3-acs-7 + 10.0.0.60 + ARISTA15T0 + 10.0.0.61 + 1 + 10 + 3 + + + str-7260cx3-acs-7 + FC00::79 + ARISTA15T0 + FC00::7A + 1 + 10 + 3 + + + false + str-7260cx3-acs-7 + 10.0.0.62 + ARISTA16T0 + 10.0.0.63 + 1 + 10 + 3 + + + str-7260cx3-acs-7 + FC00::7D + ARISTA16T0 + FC00::7E + 1 + 10 + 3 + + + false + str-7260cx3-acs-7 + 10.0.0.64 + ARISTA17T0 + 10.0.0.65 + 1 + 10 + 3 + + + str-7260cx3-acs-7 + FC00::81 + ARISTA17T0 + FC00::82 + 1 + 10 + 3 + + + false + str-7260cx3-acs-7 + 10.0.0.66 + ARISTA18T0 + 10.0.0.67 + 1 + 10 + 3 + + + str-7260cx3-acs-7 + FC00::85 + ARISTA18T0 + FC00::86 + 1 + 10 + 3 + + + false + str-7260cx3-acs-7 + 10.0.0.68 + ARISTA19T0 + 10.0.0.69 + 1 + 10 + 3 + + + str-7260cx3-acs-7 + FC00::89 + ARISTA19T0 + FC00::8A + 1 + 10 + 3 + + + false + str-7260cx3-acs-7 + 10.0.0.70 + ARISTA20T0 + 10.0.0.71 + 1 + 10 + 3 + + + str-7260cx3-acs-7 + FC00::8D + ARISTA20T0 + FC00::8E + 1 + 10 + 3 + + + + + 65100 + str-7260cx3-acs-7 + + +
10.0.0.33
+ + + +
+ +
10.0.0.1
+ + + +
+ +
10.0.0.35
+ + + +
+ +
10.0.0.37
+ + + +
+ +
10.0.0.5
+ + + +
+ +
10.0.0.39
+ + + +
+ +
10.0.0.41
+ + + +
+ +
10.0.0.9
+ + + +
+ +
10.0.0.43
+ + + +
+ +
10.0.0.45
+ + + +
+ +
10.0.0.13
+ + + +
+ +
10.0.0.47
+ + + +
+ +
10.0.0.49
+ + + +
+ +
10.0.0.51
+ + + +
+ +
10.0.0.53
+ + + +
+ +
10.0.0.55
+ + + +
+ +
10.0.0.57
+ + + +
+ +
10.0.0.59
+ + + +
+ +
10.0.0.61
+ + + +
+ +
10.0.0.63
+ + + +
+ +
10.0.0.65
+ + + +
+ +
10.0.0.67
+ + + +
+ +
10.0.0.69
+ + + +
+ +
10.0.0.71
+ + + +
+
+ +
+ + 64001 + ARISTA01T0 + + + + 65200 + ARISTA01T2 + + + + 64002 + ARISTA02T0 + + + + 64003 + ARISTA03T0 + + + + 65200 + ARISTA03T2 + + + + 64004 + ARISTA04T0 + + + + 64005 + ARISTA05T0 + + + + 65200 + ARISTA05T2 + + + + 64006 + ARISTA06T0 + + + + 64007 + ARISTA07T0 + + + + 65200 + ARISTA07T2 + + + + 64008 + ARISTA08T0 + + + + 64009 + ARISTA09T0 + + + + 64010 + ARISTA10T0 + + + + 64011 + ARISTA11T0 + + + + 64012 + ARISTA12T0 + + + + 64013 + ARISTA13T0 + + + + 64014 + ARISTA14T0 + + + + 64015 + ARISTA15T0 + + + + 64016 + ARISTA16T0 + + + + 64017 + ARISTA17T0 + + + + 64018 + ARISTA18T0 + + + + 64019 + ARISTA19T0 + + + + 64020 + ARISTA20T0 + + +
+
+ + + + + + HostIP + Loopback0 + + 10.1.0.32/32 + + 10.1.0.32/32 + + + HostIP1 + Loopback0 + + FC00:1::32/128 + + FC00:1::32/128 + + + + + HostIP + eth0 + + 10.64.246.78/23 + + 10.64.246.78/23 + + + V6HostIP + eth0 + + FC00:2::32/64 + + FC00:2::32/64 + + + + + + + str-7260cx3-acs-7 + + + PortChannel101 + Ethernet35/1 + + + + PortChannel102 + Ethernet1/1;Ethernet2/1 + + + + PortChannel103 + Ethernet37/1 + + + + PortChannel104 + Ethernet38/1 + + + + PortChannel105 + Ethernet5/1;Ethernet6/1 + + + + PortChannel106 + Ethernet39/1 + + + + PortChannel107 + Ethernet40/1 + + + + PortChannel108 + Ethernet17/1;Ethernet18/1 + + + + PortChannel109 + Ethernet43/1 + + + + PortChannel1010 + Ethernet45/1 + + + + PortChannel1011 + Ethernet21/1;Ethernet22/1 + + + + PortChannel1012 + Ethernet46/1 + + + + PortChannel1013 + Ethernet47/1 + + + + PortChannel1014 + Ethernet48/1 + + + + PortChannel1015 + Ethernet51/1 + + + + PortChannel1016 + Ethernet53/1 + + + + PortChannel1017 + Ethernet54/1 + + + + PortChannel1018 + Ethernet55/1 + + + + PortChannel1019 + Ethernet56/1 + + + + PortChannel1020 + Ethernet59/1 + + + + PortChannel1021 + Ethernet61/1 + + + + PortChannel1022 + Ethernet62/1 + + + + PortChannel1023 + Ethernet63/1 + + + + PortChannel1024 + Ethernet64/1 + + + + + + + + + PortChannel101 + 10.0.0.32/31 + + + + PortChannel101 + FC00::41/126 + + + + PortChannel102 + 10.0.0.0/31 + + + + PortChannel102 + FC00::1/126 + + + + PortChannel103 + 10.0.0.34/31 + + + + PortChannel103 + FC00::45/126 + + + + PortChannel104 + 10.0.0.36/31 + + + + PortChannel104 + FC00::49/126 + + + + PortChannel105 + 10.0.0.4/31 + + + + PortChannel105 + FC00::5/126 + + + + PortChannel106 + 10.0.0.38/31 + + + + PortChannel106 + FC00::4D/126 + + + + PortChannel107 + 10.0.0.40/31 + + + + PortChannel107 + FC00::51/126 + + + + PortChannel108 + 10.0.0.8/31 + + + + PortChannel108 + FC00::9/126 + + + + PortChannel109 + 10.0.0.42/31 + + + + PortChannel109 + FC00::55/126 + + + + PortChannel1010 + 10.0.0.44/31 + + + + PortChannel1010 + FC00::59/126 + + + + PortChannel1011 + 10.0.0.12/31 + + + + PortChannel1011 + FC00::D/126 + + + + PortChannel1012 + 10.0.0.46/31 + + + + PortChannel1012 + FC00::5D/126 + + + + PortChannel1013 + 10.0.0.48/31 + + + + PortChannel1013 + FC00::61/126 + + + + PortChannel1014 + 10.0.0.50/31 + + + + PortChannel1014 + FC00::65/126 + + + + PortChannel1015 + 10.0.0.52/31 + + + + PortChannel1015 + FC00::69/126 + + + + PortChannel1016 + 10.0.0.54/31 + + + + PortChannel1016 + FC00::6D/126 + + + + PortChannel1017 + 10.0.0.56/31 + + + + PortChannel1017 + FC00::71/126 + + + + PortChannel1018 + 10.0.0.58/31 + + + + PortChannel1018 + FC00::75/126 + + + + PortChannel1019 + 10.0.0.60/31 + + + + PortChannel1019 + FC00::79/126 + + + + PortChannel1020 + 10.0.0.62/31 + + + + PortChannel1020 + FC00::7D/126 + + + + PortChannel1021 + 10.0.0.64/31 + + + + PortChannel1021 + FC00::81/126 + + + + PortChannel1022 + 10.0.0.66/31 + + + + PortChannel1022 + FC00::85/126 + + + + PortChannel1023 + 10.0.0.68/31 + + + + PortChannel1023 + FC00::89/126 + + + + PortChannel1024 + 10.0.0.70/31 + + + + PortChannel1024 + FC00::8D/126 + + + + + + NTP_ACL + NTP + NTP + + + SNMP_ACL + SNMP + SNMP + + + ERSPAN + Everflow + Everflow + + + ERSPANV6 + EverflowV6 + EverflowV6 + + + VTY_LINE + ssh-only + SSH + + + PortChannel101;PortChannel102;PortChannel103;PortChannel104;PortChannel105;PortChannel106;PortChannel107;PortChannel108;PortChannel109;PortChannel1010;PortChannel1011;PortChannel1012;PortChannel1013;PortChannel1014;PortChannel1015;PortChannel1016;PortChannel1017;PortChannel1018;PortChannel1019;PortChannel1020;PortChannel1021;PortChannel1022;PortChannel1023;PortChannel1024 + DataAcl + DataPlane + + + + + + + + + + DeviceInterfaceLink + ARISTA01T0 + Ethernet1 + str-7260cx3-acs-7 + Ethernet35/1 + + + DeviceInterfaceLink + ARISTA01T2 + Ethernet1 + str-7260cx3-acs-7 + Ethernet1/1 + + + DeviceInterfaceLink + ARISTA01T2 + Ethernet2 + str-7260cx3-acs-7 + Ethernet2/1 + + + DeviceInterfaceLink + ARISTA02T0 + Ethernet1 + str-7260cx3-acs-7 + Ethernet37/1 + + + DeviceInterfaceLink + ARISTA03T0 + Ethernet1 + str-7260cx3-acs-7 + Ethernet38/1 + + + DeviceInterfaceLink + ARISTA03T2 + Ethernet1 + str-7260cx3-acs-7 + Ethernet5/1 + + + DeviceInterfaceLink + ARISTA03T2 + Ethernet2 + str-7260cx3-acs-7 + Ethernet6/1 + + + DeviceInterfaceLink + ARISTA04T0 + Ethernet1 + str-7260cx3-acs-7 + Ethernet39/1 + + + DeviceInterfaceLink + ARISTA05T0 + Ethernet1 + str-7260cx3-acs-7 + Ethernet40/1 + + + DeviceInterfaceLink + ARISTA05T2 + Ethernet1 + str-7260cx3-acs-7 + Ethernet17/1 + + + DeviceInterfaceLink + ARISTA05T2 + Ethernet2 + str-7260cx3-acs-7 + Ethernet18/1 + + + DeviceInterfaceLink + ARISTA06T0 + Ethernet1 + str-7260cx3-acs-7 + Ethernet43/1 + + + DeviceInterfaceLink + ARISTA07T0 + Ethernet1 + str-7260cx3-acs-7 + Ethernet45/1 + + + DeviceInterfaceLink + ARISTA07T2 + Ethernet1 + str-7260cx3-acs-7 + Ethernet21/1 + + + DeviceInterfaceLink + ARISTA07T2 + Ethernet2 + str-7260cx3-acs-7 + Ethernet22/1 + + + DeviceInterfaceLink + ARISTA08T0 + Ethernet1 + str-7260cx3-acs-7 + Ethernet46/1 + + + DeviceInterfaceLink + ARISTA09T0 + Ethernet1 + str-7260cx3-acs-7 + Ethernet47/1 + + + DeviceInterfaceLink + ARISTA10T0 + Ethernet1 + str-7260cx3-acs-7 + Ethernet48/1 + + + DeviceInterfaceLink + ARISTA11T0 + Ethernet1 + str-7260cx3-acs-7 + Ethernet51/1 + + + DeviceInterfaceLink + ARISTA12T0 + Ethernet1 + str-7260cx3-acs-7 + Ethernet53/1 + + + DeviceInterfaceLink + ARISTA13T0 + Ethernet1 + str-7260cx3-acs-7 + Ethernet54/1 + + + DeviceInterfaceLink + ARISTA14T0 + Ethernet1 + str-7260cx3-acs-7 + Ethernet55/1 + + + DeviceInterfaceLink + ARISTA15T0 + Ethernet1 + str-7260cx3-acs-7 + Ethernet56/1 + + + DeviceInterfaceLink + ARISTA16T0 + Ethernet1 + str-7260cx3-acs-7 + Ethernet59/1 + + + DeviceInterfaceLink + ARISTA17T0 + Ethernet1 + str-7260cx3-acs-7 + Ethernet61/1 + + + DeviceInterfaceLink + ARISTA18T0 + Ethernet1 + str-7260cx3-acs-7 + Ethernet62/1 + + + DeviceInterfaceLink + ARISTA19T0 + Ethernet1 + str-7260cx3-acs-7 + Ethernet63/1 + + + DeviceInterfaceLink + ARISTA20T0 + Ethernet1 + str-7260cx3-acs-7 + Ethernet64/1 + + + + + str-7260cx3-acs-7 + Arista-7260CX3-C64 + + 10.64.246.78 + + + + ARISTA16T0 + + 172.16.141.95 + + Arista-VM + + + ARISTA11T0 + + 172.16.141.90 + + Arista-VM + + + ARISTA10T0 + + 172.16.141.89 + + Arista-VM + + + ARISTA17T0 + + 172.16.141.96 + + Arista-VM + + + ARISTA09T0 + + 172.16.141.88 + + Arista-VM + + + ARISTA20T0 + + 172.16.141.99 + + Arista-VM + + + ARISTA08T0 + + 172.16.141.87 + + Arista-VM + + + ARISTA07T0 + + 172.16.141.86 + + Arista-VM + + + ARISTA07T2 + + 172.16.141.79 + + Arista-VM + + + ARISTA01T2 + + 172.16.141.76 + + Arista-VM + + + ARISTA01T0 + + 172.16.141.80 + + Arista-VM + + + ARISTA05T2 + + 172.16.141.78 + + Arista-VM + + + ARISTA05T0 + + 172.16.141.84 + + Arista-VM + + + ARISTA02T0 + + 172.16.141.81 + + Arista-VM + + + ARISTA03T0 + + 172.16.141.82 + + Arista-VM + + + ARISTA03T2 + + 172.16.141.77 + + Arista-VM + + + ARISTA04T0 + + 172.16.141.83 + + Arista-VM + + + ARISTA18T0 + + 172.16.141.97 + + Arista-VM + + + ARISTA15T0 + + 172.16.141.94 + + Arista-VM + + + ARISTA19T0 + + 172.16.141.98 + + Arista-VM + + + ARISTA14T0 + + 172.16.141.93 + + Arista-VM + + + ARISTA12T0 + + 172.16.141.91 + + Arista-VM + + + ARISTA13T0 + + 172.16.141.92 + + Arista-VM + + + ARISTA06T0 + + 172.16.141.85 + + Arista-VM + + + + + + true + + + DeviceInterface + + true + true + 1 + Ethernet1/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet2/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet3/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet4/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet5/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet6/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet7/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet8/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet9/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet10/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet11/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet12/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet13/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet14/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet15/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet16/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet17/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet18/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet19/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet20/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet21/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet22/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet23/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet24/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet25/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet26/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet27/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet28/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet29/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet30/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet31/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet32/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet33/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet34/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet35/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet36/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet37/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet38/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet39/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet40/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet41/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet42/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet43/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet44/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet45/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet46/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet47/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet48/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet49/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet50/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet51/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet52/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet53/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet54/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet55/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet56/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet57/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet58/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet59/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet60/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet61/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet62/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet63/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet64/1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet65 + + false + 0 + 0 + 10000 + + + DeviceInterface + + true + true + 1 + Ethernet66 + + false + 0 + 0 + 10000 + + + true + 0 + Arista-7260CX3-C64 + + + + + + + str-7260cx3-acs-7 + + + DeploymentId + + 1 + + + QosProfile + + Profile0 + + + DhcpResources + + 192.0.0.1;192.0.0.2;192.0.0.3;192.0.0.4;192.0.0.5;192.0.0.6;192.0.0.7;192.0.0.8;192.0.0.9;192.0.0.10;192.0.0.11;192.0.0.12;192.0.0.13;192.0.0.14;192.0.0.15;192.0.0.16;192.0.0.17;192.0.0.18;192.0.0.19;192.0.0.20;192.0.0.21;192.0.0.22;192.0.0.23;192.0.0.24;192.0.0.25;192.0.0.26;192.0.0.27;192.0.0.28;192.0.0.29;192.0.0.30;192.0.0.31;192.0.0.32;192.0.0.33;192.0.0.34;192.0.0.35;192.0.0.36;192.0.0.37;192.0.0.38;192.0.0.39;192.0.0.40;192.0.0.41;192.0.0.42;192.0.0.43;192.0.0.44;192.0.0.45;192.0.0.46;192.0.0.47;192.0.0.48 + + + NtpResources + + 10.20.8.129;10.20.8.130 + + + SnmpResources + + 10.3.145.98 + + + SyslogResources + + 10.64.246.95 + + + TacacsGroup + + Starlab + + + TacacsServer + + 100.127.20.21 + + + ForcedMgmtRoutes + + 10.3.145.98/31;10.3.145.8;100.127.20.16/28;10.3.149.170/31;40.122.216.24;13.91.48.226;10.3.145.14;10.64.246.0/24;10.64.247.0/24;10.64.5.5 + + + ErspanDestinationIpv4 + + 10.20.6.16 + + + DownstreamRedundancyTypes + + Gemini + + + + + + + str-7260cx3-acs-7 + Arista-7260CX3-C64 +
diff --git a/src/sonic-config-engine/tests/sample-dell-6100-t0-minigraph.xml b/src/sonic-config-engine/tests/sample-dell-6100-t0-minigraph.xml index 536a2c8a73c7..fef3526bee28 100644 --- a/src/sonic-config-engine/tests/sample-dell-6100-t0-minigraph.xml +++ b/src/sonic-config-engine/tests/sample-dell-6100-t0-minigraph.xml @@ -301,7 +301,6 @@ DeviceInterfaceLink - true 40000 ARISTA01T1 Ethernet1 @@ -311,7 +310,6 @@ DeviceInterfaceLink - true 40000 ARISTA01T1 Ethernet2 @@ -321,7 +319,6 @@ DeviceInterfaceLink - true 40000 ARISTA02T1 Ethernet1 @@ -331,7 +328,6 @@ DeviceInterfaceLink - true 40000 ARISTA02T1 Ethernet2 @@ -341,7 +337,6 @@ DeviceInterfaceLink - true 40000 ARISTA03T1 Ethernet1 @@ -351,7 +346,6 @@ DeviceInterfaceLink - true 40000 ARISTA03T1 Ethernet2 @@ -361,7 +355,6 @@ DeviceInterfaceLink - true 40000 ARISTA04T1 Ethernet1 @@ -371,7 +364,6 @@ DeviceInterfaceLink - true 40000 ARISTA04T1 Ethernet2 @@ -381,7 +373,6 @@ DeviceInterfaceLink - true 40000 s6100-dev-1 fortyGigE1/1/7 @@ -391,7 +382,6 @@ DeviceInterfaceLink - true 40000 s6100-dev-1 fortyGigE1/1/8 @@ -401,7 +391,6 @@ DeviceInterfaceLink - true 40000 s6100-dev-1 fortyGigE1/1/9 @@ -411,7 +400,6 @@ DeviceInterfaceLink - true 40000 s6100-dev-1 fortyGigE1/1/10 @@ -421,7 +409,6 @@ DeviceInterfaceLink - true 40000 s6100-dev-1 fortyGigE1/1/11 @@ -431,7 +418,6 @@ DeviceInterfaceLink - true 40000 s6100-dev-1 fortyGigE1/1/12 @@ -441,7 +427,6 @@ DeviceInterfaceLink - true 40000 s6100-dev-1 fortyGigE1/1/13 @@ -451,7 +436,6 @@ DeviceInterfaceLink - true 40000 s6100-dev-1 fortyGigE1/1/14 @@ -461,7 +445,6 @@ DeviceInterfaceLink - true 40000 s6100-dev-1 fortyGigE1/1/15 @@ -471,7 +454,6 @@ DeviceInterfaceLink - true 40000 s6100-dev-1 fortyGigE1/1/16 @@ -481,7 +463,6 @@ DeviceInterfaceLink - true 40000 s6100-dev-1 fortyGigE1/3/1 @@ -491,7 +472,6 @@ DeviceInterfaceLink - true 40000 s6100-dev-1 fortyGigE1/3/5 @@ -501,7 +481,6 @@ DeviceInterfaceLink - true 40000 s6100-dev-1 fortyGigE1/3/6 @@ -511,7 +490,6 @@ DeviceInterfaceLink - true 40000 s6100-dev-1 fortyGigE1/3/7 @@ -521,7 +499,6 @@ DeviceInterfaceLink - true 40000 s6100-dev-1 fortyGigE1/3/8 @@ -531,7 +508,6 @@ DeviceInterfaceLink - true 40000 s6100-dev-1 fortyGigE1/3/9 @@ -541,7 +517,6 @@ DeviceInterfaceLink - true 40000 s6100-dev-1 fortyGigE1/3/10 @@ -551,7 +526,6 @@ DeviceInterfaceLink - true 40000 s6100-dev-1 fortyGigE1/3/11 @@ -561,7 +535,6 @@ DeviceInterfaceLink - true 40000 s6100-dev-1 fortyGigE1/2/7 @@ -571,7 +544,6 @@ DeviceInterfaceLink - true 40000 s6100-dev-1 fortyGigE1/2/8 @@ -581,7 +553,6 @@ DeviceInterfaceLink - true 40000 s6100-dev-1 fortyGigE1/2/9 @@ -591,7 +562,6 @@ DeviceInterfaceLink - true 40000 s6100-dev-1 fortyGigE1/2/10 @@ -601,7 +571,6 @@ DeviceInterfaceLink - true 40000 s6100-dev-1 fortyGigE1/2/11 @@ -611,7 +580,6 @@ DeviceInterfaceLink - true 40000 s6100-dev-1 fortyGigE1/2/12 @@ -621,7 +589,6 @@ DeviceInterfaceLink - true 40000 s6100-dev-1 fortyGigE1/2/13 @@ -631,7 +598,6 @@ DeviceInterfaceLink - true 40000 s6100-dev-1 fortyGigE1/2/14 @@ -641,7 +607,6 @@ DeviceInterfaceLink - true 40000 s6100-dev-1 fortyGigE1/2/15 @@ -651,7 +616,6 @@ DeviceInterfaceLink - true 40000 s6100-dev-1 fortyGigE1/2/16 @@ -661,7 +625,6 @@ DeviceInterfaceLink - true 40000 s6100-dev-1 fortyGigE1/4/1 @@ -671,7 +634,6 @@ DeviceInterfaceLink - true 40000 s6100-dev-1 fortyGigE1/4/5 @@ -681,7 +643,6 @@ DeviceInterfaceLink - true 40000 s6100-dev-1 fortyGigE1/4/6 @@ -691,7 +652,6 @@ DeviceInterfaceLink - true 40000 s6100-dev-1 fortyGigE1/4/7 @@ -701,7 +661,6 @@ DeviceInterfaceLink - true 40000 s6100-dev-1 fortyGigE1/4/8 @@ -711,7 +670,6 @@ DeviceInterfaceLink - true 40000 s6100-dev-1 fortyGigE1/4/9 @@ -721,7 +679,6 @@ DeviceInterfaceLink - true 40000 s6100-dev-1 fortyGigE1/4/10 @@ -731,7 +688,6 @@ DeviceInterfaceLink - true 40000 s6100-dev-1 fortyGigE1/4/11 @@ -760,11 +716,504 @@ 10.0.0.16 + + SonicQosProfile + + RDMA-CENTRIC + + + + + + + + AutoNegotiation + + True + + + ARISTA01T1:Ethernet1;s6100-dev-1:fortyGigE1/1/1 + + + + + + AutoNegotiation + + True + + + ARISTA01T1:Ethernet2;s6100-dev-1:fortyGigE1/1/2 + + + + + + AutoNegotiation + + True + + + ARISTA02T1:Ethernet1;s6100-dev-1:fortyGigE1/1/5 + + + + + + AutoNegotiation + + True + + + ARISTA02T1:Ethernet2;s6100-dev-1:fortyGigE1/1/6 + + + + + + AutoNegotiation + + True + + + ARISTA03T1:Ethernet1;s6100-dev-1:fortyGigE1/2/1 + + + + + + AutoNegotiation + + True + + + ARISTA03T1:Ethernet2;s6100-dev-1:fortyGigE1/2/2 + + + + + + AutoNegotiation + + True + + + ARISTA04T1:Ethernet1;s6100-dev-1:fortyGigE1/2/5 + + + + + + AutoNegotiation + + True + + + ARISTA04T1:Ethernet2;s6100-dev-1:fortyGigE1/2/6 + + + + + + AutoNegotiation + + True + + + s6100-dev-1:fortyGigE1/1/7;server-01:0 + + + + + + AutoNegotiation + + True + + + s6100-dev-1:fortyGigE1/1/8;server-02:0 + + + + + + AutoNegotiation + + True + + + s6100-dev-1:fortyGigE1/1/7;server-03:0 + + + + + + AutoNegotiation + + True + + + s6100-dev-1:fortyGigE1/1/7;server-04:0 + + + + + + AutoNegotiation + + True + + + s6100-dev-1:fortyGigE1/1/7;server-05:0 + + + + + + AutoNegotiation + + True + + + s6100-dev-1:fortyGigE1/1/7;server-06:0 + + + + + + AutoNegotiation + + True + + + s6100-dev-1:fortyGigE1/1/7;server-07:0 + + + + + + AutoNegotiation + + True + + + s6100-dev-1:fortyGigE1/1/7;server-08:0 + + + + + + AutoNegotiation + + True + + + s6100-dev-1:fortyGigE1/1/7;server-09:0 + + + + + + AutoNegotiation + + True + + + s6100-dev-1:fortyGigE1/1/7;server-10:0 + + + + + + AutoNegotiation + + True + + + s6100-dev-1:fortyGigE1/3/1;server-11:0 + + + + + + AutoNegotiation + + True + + + s6100-dev-1:fortyGigE1/3/5;server-12:0 + + + + + + AutoNegotiation + + True + + + s6100-dev-1:fortyGigE1/3/6;server-13:0 + + + + + + AutoNegotiation + + True + + + s6100-dev-1:fortyGigE1/3/7;server-14:0 + + + + + + AutoNegotiation + + True + + + s6100-dev-1:fortyGigE1/3/8;server-15:0 + + + + + + AutoNegotiation + + True + + + s6100-dev-1:fortyGigE1/3/9;server-16:0 + + + + + + AutoNegotiation + + True + + + s6100-dev-1:fortyGigE1/3/10;server-17:0 + + + + + + AutoNegotiation + + True + + + s6100-dev-1:fortyGigE1/3/11;server-18:0 + + + + + + AutoNegotiation + + True + + + s6100-dev-1:fortyGigE1/2/7;server-19:0 + + + + + + AutoNegotiation + + True + + + s6100-dev-1:fortyGigE1/2/8;server-20:0 + + + + + + AutoNegotiation + + True + + + s6100-dev-1:fortyGigE1/2/9;server-21:0 + + + + + + AutoNegotiation + + True + + + s6100-dev-1:fortyGigE1/2/10;server-22:0 + + + + + + AutoNegotiation + + True + + + s6100-dev-1:fortyGigE1/2/11;server-23:0 + + + + + + AutoNegotiation + + True + + + s6100-dev-1:fortyGigE1/2/12;server-24:0 + + + + + + AutoNegotiation + + True + + + s6100-dev-1:fortyGigE1/2/13;server-25:0 + + + + + + AutoNegotiation + + True + + + s6100-dev-1:fortyGigE1/2/14;server-26:0 + + + + + + AutoNegotiation + + True + + + s6100-dev-1:fortyGigE1/2/15;server-27:0 + + + + + + AutoNegotiation + + True + + + s6100-dev-1:fortyGigE1/2/16;server-28:0 + + + + + + AutoNegotiation + + True + + + s6100-dev-1:fortyGigE1/4/1;server-29:0 + + + + + + AutoNegotiation + + True + + + s6100-dev-1:fortyGigE1/4/5;server-30:0 + + + + + + AutoNegotiation + + True + + + s6100-dev-1:fortyGigE1/4/6;server-31:0 + + + + + + AutoNegotiation + + True + + + s6100-dev-1:fortyGigE1/4/7;server-32:0 + + + + + + AutoNegotiation + + True + + + s6100-dev-1:fortyGigE1/4/8;server-33:0 + + + + + + AutoNegotiation + + True + + + s6100-dev-1:fortyGigE1/4/9;server-34:0 + + + + + + AutoNegotiation + + True + + + s6100-dev-1:fortyGigE1/4/10;server-35:0 + + + + + + AutoNegotiation + + True + + + s6100-dev-1:fortyGigE1/4/11;server-36:0 + + + s6100-dev-1 Force10-S6100 - \ No newline at end of file + diff --git a/src/sonic-config-engine/tests/sample-dell-9332-t1-minigraph.xml b/src/sonic-config-engine/tests/sample-dell-9332-t1-minigraph.xml new file mode 100644 index 000000000000..460238486b4a --- /dev/null +++ b/src/sonic-config-engine/tests/sample-dell-9332-t1-minigraph.xml @@ -0,0 +1,2023 @@ + + + + + + false + str2-z9332f-01 + 10.0.0.32 + ARISTA01T0 + 10.0.0.33 + 1 + 10 + 3 + + + str2-z9332f-01 + FC00::41 + ARISTA01T0 + FC00::42 + 1 + 10 + 3 + + + false + str2-z9332f-01 + 10.0.0.0 + ARISTA01T2 + 10.0.0.1 + 1 + 10 + 3 + + + str2-z9332f-01 + FC00::1 + ARISTA01T2 + FC00::2 + 1 + 10 + 3 + + + false + str2-z9332f-01 + 10.0.0.34 + ARISTA02T0 + 10.0.0.35 + 1 + 10 + 3 + + + str2-z9332f-01 + FC00::45 + ARISTA02T0 + FC00::46 + 1 + 10 + 3 + + + false + str2-z9332f-01 + 10.0.0.36 + ARISTA03T0 + 10.0.0.37 + 1 + 10 + 3 + + + str2-z9332f-01 + FC00::49 + ARISTA03T0 + FC00::4A + 1 + 10 + 3 + + + false + str2-z9332f-01 + 10.0.0.4 + ARISTA03T2 + 10.0.0.5 + 1 + 10 + 3 + + + str2-z9332f-01 + FC00::9 + ARISTA03T2 + FC00::A + 1 + 10 + 3 + + + false + str2-z9332f-01 + 10.0.0.38 + ARISTA04T0 + 10.0.0.39 + 1 + 10 + 3 + + + str2-z9332f-01 + FC00::4D + ARISTA04T0 + FC00::4E + 1 + 10 + 3 + + + false + str2-z9332f-01 + 10.0.0.40 + ARISTA05T0 + 10.0.0.41 + 1 + 10 + 3 + + + str2-z9332f-01 + FC00::51 + ARISTA05T0 + FC00::52 + 1 + 10 + 3 + + + false + str2-z9332f-01 + 10.0.0.8 + ARISTA05T2 + 10.0.0.9 + 1 + 10 + 3 + + + str2-z9332f-01 + FC00::11 + ARISTA05T2 + FC00::12 + 1 + 10 + 3 + + + false + str2-z9332f-01 + 10.0.0.42 + ARISTA06T0 + 10.0.0.43 + 1 + 10 + 3 + + + str2-z9332f-01 + FC00::55 + ARISTA06T0 + FC00::56 + 1 + 10 + 3 + + + false + str2-z9332f-01 + 10.0.0.44 + ARISTA07T0 + 10.0.0.45 + 1 + 10 + 3 + + + str2-z9332f-01 + FC00::59 + ARISTA07T0 + FC00::5A + 1 + 10 + 3 + + + false + str2-z9332f-01 + 10.0.0.12 + ARISTA07T2 + 10.0.0.13 + 1 + 10 + 3 + + + str2-z9332f-01 + FC00::19 + ARISTA07T2 + FC00::1A + 1 + 10 + 3 + + + false + str2-z9332f-01 + 10.0.0.46 + ARISTA08T0 + 10.0.0.47 + 1 + 10 + 3 + + + str2-z9332f-01 + FC00::5D + ARISTA08T0 + FC00::5E + 1 + 10 + 3 + + + false + str2-z9332f-01 + 10.0.0.48 + ARISTA09T0 + 10.0.0.49 + 1 + 10 + 3 + + + str2-z9332f-01 + FC00::61 + ARISTA09T0 + FC00::62 + 1 + 10 + 3 + + + false + str2-z9332f-01 + 10.0.0.16 + ARISTA09T2 + 10.0.0.17 + 1 + 10 + 3 + + + str2-z9332f-01 + FC00::21 + ARISTA09T2 + FC00::22 + 1 + 10 + 3 + + + false + str2-z9332f-01 + 10.0.0.50 + ARISTA10T0 + 10.0.0.51 + 1 + 10 + 3 + + + str2-z9332f-01 + FC00::65 + ARISTA10T0 + FC00::66 + 1 + 10 + 3 + + + false + str2-z9332f-01 + 10.0.0.52 + ARISTA11T0 + 10.0.0.53 + 1 + 10 + 3 + + + str2-z9332f-01 + FC00::69 + ARISTA11T0 + FC00::6A + 1 + 10 + 3 + + + false + str2-z9332f-01 + 10.0.0.20 + ARISTA11T2 + 10.0.0.21 + 1 + 10 + 3 + + + str2-z9332f-01 + FC00::29 + ARISTA11T2 + FC00::2A + 1 + 10 + 3 + + + false + str2-z9332f-01 + 10.0.0.54 + ARISTA12T0 + 10.0.0.55 + 1 + 10 + 3 + + + str2-z9332f-01 + FC00::6D + ARISTA12T0 + FC00::6E + 1 + 10 + 3 + + + false + str2-z9332f-01 + 10.0.0.56 + ARISTA13T0 + 10.0.0.57 + 1 + 10 + 3 + + + str2-z9332f-01 + FC00::71 + ARISTA13T0 + FC00::72 + 1 + 10 + 3 + + + false + str2-z9332f-01 + 10.0.0.24 + ARISTA13T2 + 10.0.0.25 + 1 + 10 + 3 + + + str2-z9332f-01 + FC00::31 + ARISTA13T2 + FC00::32 + 1 + 10 + 3 + + + false + str2-z9332f-01 + 10.0.0.58 + ARISTA14T0 + 10.0.0.59 + 1 + 10 + 3 + + + str2-z9332f-01 + FC00::75 + ARISTA14T0 + FC00::76 + 1 + 10 + 3 + + + false + str2-z9332f-01 + 10.0.0.60 + ARISTA15T0 + 10.0.0.61 + 1 + 10 + 3 + + + str2-z9332f-01 + FC00::79 + ARISTA15T0 + FC00::7A + 1 + 10 + 3 + + + false + str2-z9332f-01 + 10.0.0.28 + ARISTA15T2 + 10.0.0.29 + 1 + 10 + 3 + + + str2-z9332f-01 + FC00::39 + ARISTA15T2 + FC00::3A + 1 + 10 + 3 + + + false + str2-z9332f-01 + 10.0.0.62 + ARISTA16T0 + 10.0.0.63 + 1 + 10 + 3 + + + str2-z9332f-01 + FC00::7D + ARISTA16T0 + FC00::7E + 1 + 10 + 3 + + + + + 65100 + str2-z9332f-01 + + +
10.0.0.33
+ + + +
+ +
10.0.0.1
+ + + +
+ +
10.0.0.35
+ + + +
+ +
10.0.0.37
+ + + +
+ +
10.0.0.5
+ + + +
+ +
10.0.0.39
+ + + +
+ +
10.0.0.41
+ + + +
+ +
10.0.0.9
+ + + +
+ +
10.0.0.43
+ + + +
+ +
10.0.0.45
+ + + +
+ +
10.0.0.13
+ + + +
+ +
10.0.0.47
+ + + +
+ +
10.0.0.49
+ + + +
+ +
10.0.0.17
+ + + +
+ +
10.0.0.51
+ + + +
+ +
10.0.0.53
+ + + +
+ +
10.0.0.21
+ + + +
+ +
10.0.0.55
+ + + +
+ +
10.0.0.57
+ + + +
+ +
10.0.0.25
+ + + +
+ +
10.0.0.59
+ + + +
+ +
10.0.0.61
+ + + +
+ +
10.0.0.29
+ + + +
+ +
10.0.0.63
+ + + +
+
+ +
+ + 64001 + ARISTA01T0 + + + + 65200 + ARISTA01T2 + + + + 64002 + ARISTA02T0 + + + + 64003 + ARISTA03T0 + + + + 65200 + ARISTA03T2 + + + + 64004 + ARISTA04T0 + + + + 64005 + ARISTA05T0 + + + + 65200 + ARISTA05T2 + + + + 64006 + ARISTA06T0 + + + + 64007 + ARISTA07T0 + + + + 65200 + ARISTA07T2 + + + + 64008 + ARISTA08T0 + + + + 64009 + ARISTA09T0 + + + + 65200 + ARISTA09T2 + + + + 64010 + ARISTA10T0 + + + + 64011 + ARISTA11T0 + + + + 65200 + ARISTA11T2 + + + + 64012 + ARISTA12T0 + + + + 64013 + ARISTA13T0 + + + + 65200 + ARISTA13T2 + + + + 64014 + ARISTA14T0 + + + + 64015 + ARISTA15T0 + + + + 65200 + ARISTA15T2 + + + + 64016 + ARISTA16T0 + + +
+
+ + + + + + HostIP + Loopback0 + + 10.1.0.32/32 + + 10.1.0.32/32 + + + HostIP1 + Loopback0 + + FC00:1::32/128 + + FC00:1::32/128 + + + + + HostIP + eth0 + + 10.3.146.248/23 + + 10.3.146.248/23 + + + V6HostIP + eth0 + + FC00:2::32/64 + + FC00:2::32/64 + + + + + + + str2-z9332f-01 + + + PortChannel102 + etp1;etp2 + + + + PortChannel105 + etp3;etp4 + + + + PortChannel108 + etp5;etp6 + + + + PortChannel1011 + etp7;etp8 + + + + PortChannel1014 + etp9;etp10 + + + + PortChannel1017 + etp11;etp12 + + + + PortChannel1020 + etp13;etp14 + + + + PortChannel1023 + etp15;etp16 + + + + + + + + + etp17 + 10.0.0.32/31 + + + + etp17 + FC00::41/126 + + + + PortChannel102 + 10.0.0.0/31 + + + + PortChannel102 + FC00::1/126 + + + + etp18 + 10.0.0.34/31 + + + + etp18 + FC00::45/126 + + + + etp19 + 10.0.0.36/31 + + + + etp19 + FC00::49/126 + + + + PortChannel105 + 10.0.0.4/31 + + + + PortChannel105 + FC00::9/126 + + + + etp20 + 10.0.0.38/31 + + + + etp20 + FC00::4D/126 + + + + etp21 + 10.0.0.40/31 + + + + etp21 + FC00::51/126 + + + + PortChannel108 + 10.0.0.8/31 + + + + PortChannel108 + FC00::11/126 + + + + etp22 + 10.0.0.42/31 + + + + etp22 + FC00::55/126 + + + + etp23 + 10.0.0.44/31 + + + + etp23 + FC00::59/126 + + + + PortChannel1011 + 10.0.0.12/31 + + + + PortChannel1011 + FC00::19/126 + + + + etp24 + 10.0.0.46/31 + + + + etp24 + FC00::5D/126 + + + + etp25 + 10.0.0.48/31 + + + + etp25 + FC00::61/126 + + + + PortChannel1014 + 10.0.0.16/31 + + + + PortChannel1014 + FC00::21/126 + + + + etp26 + 10.0.0.50/31 + + + + etp26 + FC00::65/126 + + + + etp27 + 10.0.0.52/31 + + + + etp27 + FC00::69/126 + + + + PortChannel1017 + 10.0.0.20/31 + + + + PortChannel1017 + FC00::29/126 + + + + etp28 + 10.0.0.54/31 + + + + etp28 + FC00::6D/126 + + + + etp29 + 10.0.0.56/31 + + + + etp29 + FC00::71/126 + + + + PortChannel1020 + 10.0.0.24/31 + + + + PortChannel1020 + FC00::31/126 + + + + etp30 + 10.0.0.58/31 + + + + etp30 + FC00::75/126 + + + + etp31 + 10.0.0.60/31 + + + + etp31 + FC00::79/126 + + + + PortChannel1023 + 10.0.0.28/31 + + + + PortChannel1023 + FC00::39/126 + + + + etp32 + 10.0.0.62/31 + + + + etp32 + FC00::7D/126 + + + + + + NTP_ACL + NTP + NTP + + + SNMP_ACL + SNMP + SNMP + + + ERSPAN + Everflow + Everflow + + + ERSPANV6 + EverflowV6 + EverflowV6 + + + VTY_LINE + ssh-only + SSH + + + + + + + + + + DeviceInterfaceLink + ARISTA01T0 + Ethernet1 + str2-z9332f-01 + etp17 + + + DeviceInterfaceLink + ARISTA01T2 + Ethernet1 + str2-z9332f-01 + etp1 + + + DeviceInterfaceLink + ARISTA01T2 + Ethernet2 + str2-z9332f-01 + etp2 + + + DeviceInterfaceLink + ARISTA02T0 + Ethernet1 + str2-z9332f-01 + etp18 + + + DeviceInterfaceLink + ARISTA03T0 + Ethernet1 + str2-z9332f-01 + etp19 + + + DeviceInterfaceLink + ARISTA03T2 + Ethernet1 + str2-z9332f-01 + etp3 + + + DeviceInterfaceLink + ARISTA03T2 + Ethernet2 + str2-z9332f-01 + etp4 + + + DeviceInterfaceLink + ARISTA04T0 + Ethernet1 + str2-z9332f-01 + etp20 + + + DeviceInterfaceLink + ARISTA05T0 + Ethernet1 + str2-z9332f-01 + etp21 + + + DeviceInterfaceLink + ARISTA05T2 + Ethernet1 + str2-z9332f-01 + etp5 + + + DeviceInterfaceLink + ARISTA05T2 + Ethernet2 + str2-z9332f-01 + etp6 + + + DeviceInterfaceLink + ARISTA06T0 + Ethernet1 + str2-z9332f-01 + etp22 + + + DeviceInterfaceLink + ARISTA07T0 + Ethernet1 + str2-z9332f-01 + etp23 + + + DeviceInterfaceLink + ARISTA07T2 + Ethernet1 + str2-z9332f-01 + etp7 + + + DeviceInterfaceLink + ARISTA07T2 + Ethernet2 + str2-z9332f-01 + etp8 + + + DeviceInterfaceLink + ARISTA08T0 + Ethernet1 + str2-z9332f-01 + etp24 + + + DeviceInterfaceLink + ARISTA09T0 + Ethernet1 + str2-z9332f-01 + etp25 + + + DeviceInterfaceLink + ARISTA09T2 + Ethernet1 + str2-z9332f-01 + etp9 + + + DeviceInterfaceLink + ARISTA09T2 + Ethernet2 + str2-z9332f-01 + etp10 + + + DeviceInterfaceLink + ARISTA10T0 + Ethernet1 + str2-z9332f-01 + etp26 + + + DeviceInterfaceLink + ARISTA11T0 + Ethernet1 + str2-z9332f-01 + etp27 + + + DeviceInterfaceLink + ARISTA11T2 + Ethernet1 + str2-z9332f-01 + etp11 + + + DeviceInterfaceLink + ARISTA11T2 + Ethernet2 + str2-z9332f-01 + etp12 + + + DeviceInterfaceLink + ARISTA12T0 + Ethernet1 + str2-z9332f-01 + etp28 + + + DeviceInterfaceLink + ARISTA13T0 + Ethernet1 + str2-z9332f-01 + etp29 + + + DeviceInterfaceLink + ARISTA13T2 + Ethernet1 + str2-z9332f-01 + etp13 + + + DeviceInterfaceLink + ARISTA13T2 + Ethernet2 + str2-z9332f-01 + etp14 + + + DeviceInterfaceLink + ARISTA14T0 + Ethernet1 + str2-z9332f-01 + etp30 + + + DeviceInterfaceLink + ARISTA15T0 + Ethernet1 + str2-z9332f-01 + etp31 + + + DeviceInterfaceLink + ARISTA15T2 + Ethernet1 + str2-z9332f-01 + etp15 + + + DeviceInterfaceLink + ARISTA15T2 + Ethernet2 + str2-z9332f-01 + etp16 + + + DeviceInterfaceLink + ARISTA16T0 + Ethernet1 + str2-z9332f-01 + etp32 + + + + + str2-z9332f-01 + DellEMC-Z9332f-O32 + + 10.3.146.248 + + + + ARISTA16T0 + + 172.16.142.111 + + Arista-VM + + + ARISTA11T0 + + 172.16.142.106 + + Arista-VM + + + ARISTA10T0 + + 172.16.142.105 + + Arista-VM + + + ARISTA11T2 + + 172.16.142.93 + + Arista-VM + + + ARISTA09T2 + + 172.16.142.92 + + Arista-VM + + + ARISTA09T0 + + 172.16.142.104 + + Arista-VM + + + ARISTA06T0 + + 172.16.142.101 + + Arista-VM + + + ARISTA08T0 + + 172.16.142.103 + + Arista-VM + + + ARISTA07T0 + + 172.16.142.102 + + Arista-VM + + + ARISTA07T2 + + 172.16.142.91 + + Arista-VM + + + ARISTA01T2 + + 172.16.142.88 + + Arista-VM + + + ARISTA01T0 + + 172.16.142.96 + + Arista-VM + + + ARISTA05T2 + + 172.16.142.90 + + Arista-VM + + + ARISTA05T0 + + 172.16.142.100 + + Arista-VM + + + ARISTA02T0 + + 172.16.142.97 + + Arista-VM + + + ARISTA03T0 + + 172.16.142.98 + + Arista-VM + + + ARISTA03T2 + + 172.16.142.89 + + Arista-VM + + + ARISTA04T0 + + 172.16.142.99 + + Arista-VM + + + ARISTA15T0 + + 172.16.142.110 + + Arista-VM + + + ARISTA15T2 + + 172.16.142.95 + + Arista-VM + + + ARISTA14T0 + + 172.16.142.109 + + Arista-VM + + + ARISTA12T0 + + 172.16.142.107 + + Arista-VM + + + ARISTA13T2 + + 172.16.142.94 + + Arista-VM + + + ARISTA13T0 + + 172.16.142.108 + + Arista-VM + + + + + + true + + + DeviceInterface + + true + true + 1 + etp1 + + false + 0 + 0 + 400000 + + + DeviceInterface + + true + true + 1 + etp2 + + false + 0 + 0 + 400000 + + + DeviceInterface + + true + true + 1 + etp3 + + false + 0 + 0 + 400000 + + + DeviceInterface + + true + true + 1 + etp4 + + false + 0 + 0 + 400000 + + + DeviceInterface + + true + true + 1 + etp5 + + false + 0 + 0 + 400000 + + + DeviceInterface + + true + true + 1 + etp6 + + false + 0 + 0 + 400000 + + + DeviceInterface + + true + true + 1 + etp7 + + false + 0 + 0 + 400000 + + + DeviceInterface + + true + true + 1 + etp8 + + false + 0 + 0 + 400000 + + + DeviceInterface + + true + true + 1 + etp9 + + false + 0 + 0 + 400000 + + + DeviceInterface + + true + true + 1 + etp10 + + false + 0 + 0 + 400000 + + + DeviceInterface + + true + true + 1 + etp11 + + false + 0 + 0 + 400000 + + + DeviceInterface + + true + true + 1 + etp12 + + false + 0 + 0 + 400000 + + + DeviceInterface + + true + true + 1 + etp13 + + false + 0 + 0 + 400000 + + + DeviceInterface + + true + true + 1 + etp14 + + false + 0 + 0 + 400000 + + + DeviceInterface + + true + true + 1 + etp15 + + false + 0 + 0 + 400000 + + + DeviceInterface + + true + true + 1 + etp16 + + false + 0 + 0 + 400000 + + + DeviceInterface + + true + true + 1 + etp17 + + false + 0 + 0 + 400000 + + + DeviceInterface + + true + true + 1 + etp18 + + false + 0 + 0 + 400000 + + + DeviceInterface + + true + true + 1 + etp19 + + false + 0 + 0 + 400000 + + + DeviceInterface + + true + true + 1 + etp20 + + false + 0 + 0 + 400000 + + + DeviceInterface + + true + true + 1 + etp21 + + false + 0 + 0 + 400000 + + + DeviceInterface + + true + true + 1 + etp22 + + false + 0 + 0 + 400000 + + + DeviceInterface + + true + true + 1 + etp23 + + false + 0 + 0 + 400000 + + + DeviceInterface + + true + true + 1 + etp24 + + false + 0 + 0 + 400000 + + + DeviceInterface + + true + true + 1 + etp25 + + false + 0 + 0 + 400000 + + + DeviceInterface + + true + true + 1 + etp26 + + false + 0 + 0 + 400000 + + + DeviceInterface + + true + true + 1 + etp27 + + false + 0 + 0 + 400000 + + + DeviceInterface + + true + true + 1 + etp28 + + false + 0 + 0 + 400000 + + + DeviceInterface + + true + true + 1 + etp29 + + false + 0 + 0 + 400000 + + + DeviceInterface + + true + true + 1 + etp30 + + false + 0 + 0 + 400000 + + + DeviceInterface + + true + true + 1 + etp31 + + false + 0 + 0 + 400000 + + + DeviceInterface + + true + true + 1 + etp32 + + false + 0 + 0 + 400000 + + + DeviceInterface + + true + true + 1 + etp33 + + false + 0 + 0 + 10000 + + + DeviceInterface + + true + true + 1 + etp34 + + false + 0 + 0 + 10000 + + + true + 0 + DellEMC-Z9332f-O32 + + + + + + + str2-z9332f-01 + + + DeploymentId + + 1 + + + QosProfile + + Profile0 + + + DhcpResources + + 192.0.0.1;192.0.0.2;192.0.0.3;192.0.0.4;192.0.0.5;192.0.0.6;192.0.0.7;192.0.0.8;192.0.0.9;192.0.0.10;192.0.0.11;192.0.0.12;192.0.0.13;192.0.0.14;192.0.0.15;192.0.0.16;192.0.0.17;192.0.0.18;192.0.0.19;192.0.0.20;192.0.0.21;192.0.0.22;192.0.0.23;192.0.0.24;192.0.0.25;192.0.0.26;192.0.0.27;192.0.0.28;192.0.0.29;192.0.0.30;192.0.0.31;192.0.0.32;192.0.0.33;192.0.0.34;192.0.0.35;192.0.0.36;192.0.0.37;192.0.0.38;192.0.0.39;192.0.0.40;192.0.0.41;192.0.0.42;192.0.0.43;192.0.0.44;192.0.0.45;192.0.0.46;192.0.0.47;192.0.0.48 + + + NtpResources + + 10.20.8.129;10.20.8.130 + + + SnmpResources + + 10.3.145.98 + + + SyslogResources + + 10.64.246.95 + + + TacacsGroup + + Starlab + + + TacacsServer + + 100.127.20.21 + + + ForcedMgmtRoutes + + 10.3.145.98/31;10.3.145.8;100.127.20.16/28;10.3.149.170/31;40.122.216.24;13.91.48.226;10.3.145.14;10.64.246.0/24;10.3.146.0/23;10.64.5.5 + + + ResourceType + + DL-NPU-Apollo + + + ErspanDestinationIpv4 + + 10.20.6.16 + + + + + + + str2-z9332f-01 + DellEMC-Z9332f-O32 +
diff --git a/src/sonic-config-engine/tests/sample-graph-resource-type.xml b/src/sonic-config-engine/tests/sample-graph-resource-type.xml new file mode 100644 index 000000000000..fd349ec70eac --- /dev/null +++ b/src/sonic-config-engine/tests/sample-graph-resource-type.xml @@ -0,0 +1,455 @@ + + + + + + switch-t0 + 10.1.0.32 + BGPMonitor + 10.20.30.40 + 30 + 10 + 3 + + + false + switch-t0 + 10.0.0.56 + ARISTA01T1 + 10.0.0.57 + 1 + 180 + 60 + + + switch-t0 + FC00::71 + ARISTA01T1 + FC00::72 + 1 + 180 + 60 + + + false + switch-t0 + 10.0.0.58 + ARISTA02T1 + 10.0.0.59 + 1 + 180 + 60 + + + switch-t0 + FC00::75 + ARISTA02T1 + FC00::76 + 1 + 180 + 60 + + + + + 0 + + BGPMonitor + + + BGPPeer +
10.1.0.32
+ + + +
+
+ +
+ + 65100 + switch-t0 + + +
10.0.0.57
+ + + +
+ +
10.0.0.59
+ + + +
+
+ +
+ + 64600 + ARISTA01T1 + + + + 64600 + ARISTA02T1 + + + + 64600 + ARISTA03T1 + + + + 64600 + ARISTA04T1 + + +
+
+ + + + + + HostIP + Loopback0 + + 10.1.0.32/32 + + 10.1.0.32/32 + + + HostIP1 + Loopback0 + + FC00:1::32/128 + + FC00:1::32/128 + + + + + HostIP + eth0 + + 10.0.0.100/24 + + 10.0.0.100/24 + + + + + + + switch-t0 + + + PortChannel01 + fortyGigE0/4 + + + + PortChannel1001 + fortyGigE0/1;fortyGigE0/2 + + + + + + ab1 + fortyGigE0/8 + 192.0.0.1;192.0.0.2 + 1000 + 1000 + 192.168.0.0/27 + + + ab4 + fortyGigE0/8 + 192.0.0.1;192.0.0.2 + 1001 + 1001 + 192.168.0.32/27 + + + kk1 + fortyGigE0/12 + 192.0.0.1;192.0.0.2 + 2020 + 2020 + Tagged + 192.168.0.0/28 + + + ab2 + fortyGigE0/12 + 192.0.0.1;192.0.0.2 + 2000 + 2000 + Tagged + 192.168.0.240/27 + + + ab3 + fortyGigE0/12 + 192.0.0.1;192.0.0.2 + 2001 + 2001 + 192.168.0.240/27 + + + + + + PortChannel01 + 10.0.0.56/31 + + + + PortChannel01 + FC00::71/126 + + + + PortChannel1001 + 10.0.0.57/31 + + + + PortChannel1001 + FC00::72/126 + + + + fortyGigE0/0 + 10.0.0.58/31 + + + + fortyGigE0/0 + FC00::75/126 + + + + ab1 + 192.168.0.1/27 + + + + + + PortChannel01 + DataAcl + DataPlane + + + SNMP + SNMP_ACL + SNMP + + + + + + + + + + DeviceInterfaceLink + 1000 + ARISTA01T1 + et1 + true + switch-t0 + fortyGigE0/8 + true + + + DeviceInterfaceLink + 10000 + switch-t0 + fortyGigE0/1 + true + ARISTA05T1 + Ethernet1/32 + true + + + DeviceInterfaceLink + 10000 + switch-t0 + fortyGigE0/2 + true + ARISTA06T1 + Ethernet1/33 + true + + + DeviceMgmtLink + 1000 + switch-t0 + fortyGigE0/16 + true + ChassisMTS1 + mgmt0 + true + + + DeviceMgmtLink + 1000 + switch-t0 + Management1 + switch-m0 + Management1 + true + + + + + switch-t0 + Arista-7050-QX-32S + AAA00PrdStr00 + + + ARISTA01T1 + Arista + + + ARISTA02T1 + Arista + + + ARISTA03T1 + Arista + + + ARISTA04T1 + Arista + + + + + + + + DeviceInterface + + true + 1 + fortyGigE0/0 + + false + 0 + 0 + 10000 + + + DeviceInterface + + true + 1 + Ethernet1 + + false + 0 + 0 + 10000 + + + DeviceInterface + + true + 1 + Ethernet2 + + false + 0 + 0 + 10000 + + + DeviceInterface + + true + 1 + fortyGigE0/4 + + false + 0 + 0 + 25000 + + + DeviceInterface + + true + 1 + fortyGigE0/8 + + false + 0 + 0 + 40000 + Interface description + + + DeviceInterface + + true + 1 + fortyGigE0/12 + + false + 0 + 0 + 100000 + Interface description + + + DeviceInterface + + true + 1 + fortyGigE0/16 + + false + 0 + 0 + 100000 + + + true + 0 + Arista-7050-QX-32S + + + DeviceInterface + + 1 + Management1 + false + mgmt1 + 1000 + + + + + + + + switch-t0 + + + ResourceType + + Storage + + + + + + + switch-t0 + Arista-7050-QX-32S +
diff --git a/src/sonic-config-engine/tests/sample-graph-storage-backend.xml b/src/sonic-config-engine/tests/sample-graph-storage-backend.xml new file mode 100644 index 000000000000..5333c073c8be --- /dev/null +++ b/src/sonic-config-engine/tests/sample-graph-storage-backend.xml @@ -0,0 +1,440 @@ + + + + + + switch-t0 + 10.1.0.32 + BGPMonitor + 10.20.30.40 + 30 + 10 + 3 + + + false + switch-t0 + 10.0.0.56 + ARISTA01T1 + 10.0.0.57 + 1 + 180 + 60 + + + switch-t0 + FC00::71 + ARISTA01T1 + FC00::72 + 1 + 180 + 60 + + + false + switch-t0 + 10.0.0.58 + ARISTA02T1 + 10.0.0.59 + 1 + 180 + 60 + + + switch-t0 + FC00::75 + ARISTA02T1 + FC00::76 + 1 + 180 + 60 + + + + + 0 + + BGPMonitor + + + BGPPeer +
10.1.0.32
+ + + +
+
+ +
+ + 65100 + switch-t0 + + +
10.0.0.59
+ + + +
+
+ +
+ + 64600 + ARISTA01T1 + + + + 64600 + ARISTA02T1 + + + + 64600 + ARISTA03T1 + + + + 64600 + ARISTA04T1 + + +
+
+ + + + + + HostIP + Loopback0 + + 10.1.0.32/32 + + 10.1.0.32/32 + + + HostIP1 + Loopback0 + + FC00:1::32/128 + + FC00:1::32/128 + + + + + HostIP + eth0 + + 10.0.0.100/24 + + 10.0.0.100/24 + + + + + + + switch-t0 + + + PortChannel01 + fortyGigE0/4 + + + + + + ab1 + fortyGigE0/8 + 192.0.0.1;192.0.0.2 + 1000 + 1000 + 192.168.0.0/27 + + + ab4 + fortyGigE0/8 + 192.0.0.1;192.0.0.2 + 1001 + 1001 + 192.168.0.32/27 + + + kk1 + fortyGigE0/12 + 192.0.0.1;192.0.0.2 + 2020 + 2020 + Tagged + 192.168.0.0/28 + + + ab2 + fortyGigE0/12 + 192.0.0.1;192.0.0.2 + 2000 + 2000 + Tagged + 192.168.0.240/27 + + + ab3 + fortyGigE0/12 + 192.0.0.1;192.0.0.2 + 2001 + 2001 + 192.168.0.240/27 + + + + + + PortChannel01 + 10.0.0.56/31 + + + + PortChannel01 + FC00::71/126 + + + + fortyGigE0/0 + 10.0.0.58/31 + + + + fortyGigE0/0 + FC00::75/126 + + + + ab1 + 192.168.0.1/27 + + + + + + DataAcl + + ERSPAN + everflow + Everflow + 0 + everflow.xml + + + DataAcl + + ERSPANv6 + everflowV6 + Everflow + 0 + everflow.xml + + + DataAcl + + Loopback0 + ipv6-mgmt-only + Management + 0 + + + + DataAcl + + Loopback0 + mgmt-only + Management + 0 + + + + DataAcl + + StaticERSPAN + everflowStatic + Everflow + 0 + everflow.xml + + + + + + + + + + DeviceInterfaceLink + 1000 + ARISTA01T1 + et1 + true + switch-t0 + fortyGigE0/8 + true + + + DeviceMgmtLink + 1000 + switch-t0 + fortyGigE0/16 + true + ChassisMTS1 + mgmt0 + true + + + + + switch-t0 + Arista-7050-QX-32S + AAA00PrdStr00 + + + ARISTA01T1 + Arista + + + ARISTA02T1 + Arista + + + ARISTA03T1 + Arista + + + ARISTA04T1 + Arista + + + + + + + + DeviceInterface + + true + 1 + fortyGigE0/0 + + false + 0 + 0 + 10000 + + + DeviceInterface + + true + 1 + Ethernet1 + + false + 0 + 0 + 10000 + + + DeviceInterface + + true + 1 + Ethernet2 + + false + 0 + 0 + 10000 + + + DeviceInterface + + true + 1 + fortyGigE0/4 + + false + 0 + 0 + 25000 + + + DeviceInterface + + true + 1 + fortyGigE0/8 + + false + 0 + 0 + 40000 + Interface description + + + DeviceInterface + + true + 1 + fortyGigE0/12 + + false + 0 + 0 + 100000 + Interface description + + + DeviceInterface + + true + 1 + fortyGigE0/16 + + false + 0 + 0 + 100000 + + + true + 0 + Arista-7050-QX-32S + + + DeviceInterface + + 1 + Management1 + false + mgmt1 + 1000 + + + + + + + + switch-t0 + + + ResourceType + + Storage + + + + + + + switch-t0 + Arista-7050-QX-32S +
diff --git a/src/sonic-config-engine/tests/sample-graph-subintf.xml b/src/sonic-config-engine/tests/sample-graph-subintf.xml new file mode 100644 index 000000000000..a5db5f55aac8 --- /dev/null +++ b/src/sonic-config-engine/tests/sample-graph-subintf.xml @@ -0,0 +1,378 @@ + + + + + + switch-t0 + 10.1.0.32 + BGPMonitor + 10.20.30.40 + 30 + 10 + 3 + + + false + switch-t0 + 10.0.0.58 + ARISTA02T1 + 10.0.0.59 + 1 + 180 + 60 + + + switch-t0 + FC00::75 + ARISTA02T1 + FC00::76 + 1 + 180 + 60 + + + + + 0 + + BGPMonitor + + + BGPPeer +
10.1.0.32
+ + + +
+
+ +
+ + 65100 + switch-t0 + + +
10.0.0.59
+ + + +
+
+ +
+ + 64600 + ARISTA01T1 + + + + 64600 + ARISTA02T1 + + + + 64600 + ARISTA03T1 + + + + 64600 + ARISTA04T1 + + +
+
+ + + + + + HostIP + Loopback0 + + 10.1.0.32/32 + + 10.1.0.32/32 + + + HostIP1 + Loopback0 + + FC00:1::32/128 + + FC00:1::32/128 + + + + + HostIP + eth0 + + 10.0.0.100/24 + + 10.0.0.100/24 + + + + + + + switch-t0 + + + PortChannel01 + fortyGigE0/4 + + + + + + ab1 + fortyGigE0/8 + 192.0.0.1;192.0.0.2 + 1000 + 1000 + 192.168.0.0/27 + + + ab4 + fortyGigE0/8 + 192.0.0.1;192.0.0.2 + 1001 + 1001 + 192.168.0.32/27 + + + kk1 + fortyGigE0/12 + 192.0.0.1;192.0.0.2 + 2020 + 2020 + Tagged + 192.168.0.0/28 + + + ab2 + fortyGigE0/12 + 192.0.0.1;192.0.0.2 + 2000 + 2000 + 192.168.0.240/27 + + + ab3 + fortyGigE0/12 + 192.0.0.1;192.0.0.2 + 2001 + 2001 + 192.168.0.240/27 + + + + + + fortyGigE0/0 + 10 + dot1q + 10.0.0.58/31 + 10 + + + + fortyGigE0/0 + 10 + dot1q + FC00::75/126 + 10 + + + + + + PortChannel01 + 10.0.0.56/31 + + + + PortChannel01 + FC00::71/126 + + + + ab1 + 192.168.0.1/27 + + + + + + PortChannel01 + DataAcl + DataPlane + + + SNMP + SNMP_ACL + SNMP + + + + + + + + + + DeviceInterfaceLink + 1000 + ARISTA01T1 + et1 + true + switch-t0 + fortyGigE0/8 + true + + + DeviceMgmtLink + 1000 + switch-t0 + fortyGigE0/16 + true + ChassisMTS1 + mgmt0 + true + + + + + switch-t0 + Force10-S6000 + AAA00PrdStr00 + + + ARISTA01T1 + Arista + + + ARISTA02T1 + Arista + + + ARISTA03T1 + Arista + + + ARISTA04T1 + Arista + + + + + + + + DeviceInterface + + true + 1 + fortyGigE0/0 + + false + 0 + 0 + 10000 + + + DeviceInterface + + true + 1 + Ethernet1 + + false + 0 + 0 + 10000 + + + DeviceInterface + + true + 1 + Ethernet2 + + false + 0 + 0 + 10000 + + + DeviceInterface + + true + 1 + fortyGigE0/4 + + false + 0 + 0 + 25000 + + + DeviceInterface + + true + 1 + fortyGigE0/8 + + false + 0 + 0 + 40000 + Interface description + + + DeviceInterface + + true + 1 + fortyGigE0/12 + + false + 0 + 0 + 100000 + Interface description + + + DeviceInterface + + true + 1 + fortyGigE0/16 + + false + 0 + 0 + 100000 + + + true + 0 + Force10-S6000 + + + DeviceInterface + + 1 + Management1 + false + mgmt1 + 1000 + + + + + switch-t0 + Force10-S6000 +
diff --git a/src/sonic-config-engine/tests/sample-mellanox-2410-t1-minigraph.xml b/src/sonic-config-engine/tests/sample-mellanox-2410-t1-minigraph.xml new file mode 100644 index 000000000000..b6d14c9451d8 --- /dev/null +++ b/src/sonic-config-engine/tests/sample-mellanox-2410-t1-minigraph.xml @@ -0,0 +1,2303 @@ + + + + + + false + sonic + 10.0.0.32 + ARISTA01T0 + 10.0.0.33 + 1 + 10 + 3 + + + sonic + FC00::41 + ARISTA01T0 + FC00::42 + 1 + 10 + 3 + + + false + sonic + 10.0.0.0 + ARISTA01T2 + 10.0.0.1 + 1 + 10 + 3 + + + sonic + FC00::1 + ARISTA01T2 + FC00::2 + 1 + 10 + 3 + + + false + sonic + 10.0.0.34 + ARISTA02T0 + 10.0.0.35 + 1 + 10 + 3 + + + sonic + FC00::45 + ARISTA02T0 + FC00::46 + 1 + 10 + 3 + + + false + sonic + 10.0.0.36 + ARISTA03T0 + 10.0.0.37 + 1 + 10 + 3 + + + sonic + FC00::49 + ARISTA03T0 + FC00::4A + 1 + 10 + 3 + + + false + sonic + 10.0.0.4 + ARISTA03T2 + 10.0.0.5 + 1 + 10 + 3 + + + sonic + FC00::9 + ARISTA03T2 + FC00::A + 1 + 10 + 3 + + + false + sonic + 10.0.0.38 + ARISTA04T0 + 10.0.0.39 + 1 + 10 + 3 + + + sonic + FC00::4D + ARISTA04T0 + FC00::4E + 1 + 10 + 3 + + + false + sonic + 10.0.0.40 + ARISTA05T0 + 10.0.0.41 + 1 + 10 + 3 + + + sonic + FC00::51 + ARISTA05T0 + FC00::52 + 1 + 10 + 3 + + + false + sonic + 10.0.0.8 + ARISTA05T2 + 10.0.0.9 + 1 + 10 + 3 + + + sonic + FC00::11 + ARISTA05T2 + FC00::12 + 1 + 10 + 3 + + + false + sonic + 10.0.0.42 + ARISTA06T0 + 10.0.0.43 + 1 + 10 + 3 + + + sonic + FC00::55 + ARISTA06T0 + FC00::56 + 1 + 10 + 3 + + + false + sonic + 10.0.0.44 + ARISTA07T0 + 10.0.0.45 + 1 + 10 + 3 + + + sonic + FC00::59 + ARISTA07T0 + FC00::5A + 1 + 10 + 3 + + + false + sonic + 10.0.0.12 + ARISTA07T2 + 10.0.0.13 + 1 + 10 + 3 + + + sonic + FC00::19 + ARISTA07T2 + FC00::1A + 1 + 10 + 3 + + + false + sonic + 10.0.0.46 + ARISTA08T0 + 10.0.0.47 + 1 + 10 + 3 + + + sonic + FC00::5D + ARISTA08T0 + FC00::5E + 1 + 10 + 3 + + + false + sonic + 10.0.0.48 + ARISTA09T0 + 10.0.0.49 + 1 + 10 + 3 + + + sonic + FC00::61 + ARISTA09T0 + FC00::62 + 1 + 10 + 3 + + + false + sonic + 10.0.0.16 + ARISTA09T2 + 10.0.0.17 + 1 + 10 + 3 + + + sonic + FC00::21 + ARISTA09T2 + FC00::22 + 1 + 10 + 3 + + + false + sonic + 10.0.0.50 + ARISTA10T0 + 10.0.0.51 + 1 + 10 + 3 + + + sonic + FC00::65 + ARISTA10T0 + FC00::66 + 1 + 10 + 3 + + + false + sonic + 10.0.0.52 + ARISTA11T0 + 10.0.0.53 + 1 + 10 + 3 + + + sonic + FC00::69 + ARISTA11T0 + FC00::6A + 1 + 10 + 3 + + + false + sonic + 10.0.0.20 + ARISTA11T2 + 10.0.0.21 + 1 + 10 + 3 + + + sonic + FC00::29 + ARISTA11T2 + FC00::2A + 1 + 10 + 3 + + + false + sonic + 10.0.0.54 + ARISTA12T0 + 10.0.0.55 + 1 + 10 + 3 + + + sonic + FC00::6D + ARISTA12T0 + FC00::6E + 1 + 10 + 3 + + + false + sonic + 10.0.0.56 + ARISTA13T0 + 10.0.0.57 + 1 + 10 + 3 + + + sonic + FC00::71 + ARISTA13T0 + FC00::72 + 1 + 10 + 3 + + + false + sonic + 10.0.0.24 + ARISTA13T2 + 10.0.0.25 + 1 + 10 + 3 + + + sonic + FC00::31 + ARISTA13T2 + FC00::32 + 1 + 10 + 3 + + + false + sonic + 10.0.0.58 + ARISTA14T0 + 10.0.0.59 + 1 + 10 + 3 + + + sonic + FC00::75 + ARISTA14T0 + FC00::76 + 1 + 10 + 3 + + + false + sonic + 10.0.0.60 + ARISTA15T0 + 10.0.0.61 + 1 + 10 + 3 + + + sonic + FC00::79 + ARISTA15T0 + FC00::7A + 1 + 10 + 3 + + + false + sonic + 10.0.0.28 + ARISTA15T2 + 10.0.0.29 + 1 + 10 + 3 + + + sonic + FC00::39 + ARISTA15T2 + FC00::3A + 1 + 10 + 3 + + + false + sonic + 10.0.0.62 + ARISTA16T0 + 10.0.0.63 + 1 + 10 + 3 + + + sonic + FC00::7D + ARISTA16T0 + FC00::7E + 1 + 10 + 3 + + + + + 65100 + sonic + + +
10.0.0.33
+ + + +
+ +
10.0.0.1
+ + + +
+ +
10.0.0.35
+ + + +
+ +
10.0.0.37
+ + + +
+ +
10.0.0.5
+ + + +
+ +
10.0.0.39
+ + + +
+ +
10.0.0.41
+ + + +
+ +
10.0.0.9
+ + + +
+ +
10.0.0.43
+ + + +
+ +
10.0.0.45
+ + + +
+ +
10.0.0.13
+ + + +
+ +
10.0.0.47
+ + + +
+ +
10.0.0.49
+ + + +
+ +
10.0.0.17
+ + + +
+ +
10.0.0.51
+ + + +
+ +
10.0.0.53
+ + + +
+ +
10.0.0.21
+ + + +
+ +
10.0.0.55
+ + + +
+ +
10.0.0.57
+ + + +
+ +
10.0.0.25
+ + + +
+ +
10.0.0.59
+ + + +
+ +
10.0.0.61
+ + + +
+ +
10.0.0.29
+ + + +
+ +
10.0.0.63
+ + + +
+
+ +
+ + 64001 + ARISTA01T0 + + + + 65200 + ARISTA01T2 + + + + 64002 + ARISTA02T0 + + + + 64003 + ARISTA03T0 + + + + 65200 + ARISTA03T2 + + + + 64004 + ARISTA04T0 + + + + 64005 + ARISTA05T0 + + + + 65200 + ARISTA05T2 + + + + 64006 + ARISTA06T0 + + + + 64007 + ARISTA07T0 + + + + 65200 + ARISTA07T2 + + + + 64008 + ARISTA08T0 + + + + 64009 + ARISTA09T0 + + + + 65200 + ARISTA09T2 + + + + 64010 + ARISTA10T0 + + + + 64011 + ARISTA11T0 + + + + 65200 + ARISTA11T2 + + + + 64012 + ARISTA12T0 + + + + 64013 + ARISTA13T0 + + + + 65200 + ARISTA13T2 + + + + 64014 + ARISTA14T0 + + + + 64015 + ARISTA15T0 + + + + 65200 + ARISTA15T2 + + + + 64016 + ARISTA16T0 + + +
+
+ + + + + + HostIP + Loopback0 + + 10.1.0.32/32 + + 10.1.0.32/32 + + + HostIP1 + Loopback0 + + FC00:1::32/128 + + FC00:1::32/128 + + + + HostIP + eth0 + + 10.100.0.100/24 + + 10.100.0.100/24 + + + V6HostIP + eth0 + + fe80::9a03:9bff:fe82:f226/64 + + fe80::9a03:9bff:fe82:f226/64 + + + + + + + sonic + + + PortChannel0002 + Ethernet0;Ethernet4 + + + + PortChannel0005 + Ethernet8;Ethernet12 + + + + PortChannel0008 + Ethernet16;Ethernet20 + + + + PortChannel0011 + Ethernet24;Ethernet28 + + + + PortChannel0014 + Ethernet32;Ethernet36 + + + + PortChannel0017 + Ethernet40;Ethernet44 + + + + PortChannel0020 + Ethernet48;Ethernet52 + + + + PortChannel0023 + Ethernet56;Ethernet60 + + + + + + + + + Ethernet64 + 10.0.0.32/31 + + + + Ethernet64 + FC00::41/126 + + + + PortChannel0002 + 10.0.0.0/31 + + + + PortChannel0002 + FC00::1/126 + + + + Ethernet68 + 10.0.0.34/31 + + + + Ethernet68 + FC00::45/126 + + + + Ethernet72 + 10.0.0.36/31 + + + + Ethernet72 + FC00::49/126 + + + + PortChannel0005 + 10.0.0.4/31 + + + + PortChannel0005 + FC00::9/126 + + + + Ethernet76 + 10.0.0.38/31 + + + + Ethernet76 + FC00::4D/126 + + + + Ethernet80 + 10.0.0.40/31 + + + + Ethernet80 + FC00::51/126 + + + + PortChannel0008 + 10.0.0.8/31 + + + + PortChannel0008 + FC00::11/126 + + + + Ethernet84 + 10.0.0.42/31 + + + + Ethernet84 + FC00::55/126 + + + + Ethernet88 + 10.0.0.44/31 + + + + Ethernet88 + FC00::59/126 + + + + PortChannel0011 + 10.0.0.12/31 + + + + PortChannel0011 + FC00::19/126 + + + + Ethernet92 + 10.0.0.46/31 + + + + Ethernet92 + FC00::5D/126 + + + + Ethernet96 + 10.0.0.48/31 + + + + Ethernet96 + FC00::61/126 + + + + PortChannel0014 + 10.0.0.16/31 + + + + PortChannel0014 + FC00::21/126 + + + + Ethernet100 + 10.0.0.50/31 + + + + Ethernet100 + FC00::65/126 + + + + Ethernet104 + 10.0.0.52/31 + + + + Ethernet104 + FC00::69/126 + + + + PortChannel0017 + 10.0.0.20/31 + + + + PortChannel0017 + FC00::29/126 + + + + Ethernet108 + 10.0.0.54/31 + + + + Ethernet108 + FC00::6D/126 + + + + Ethernet112 + 10.0.0.56/31 + + + + Ethernet112 + FC00::71/126 + + + + PortChannel0020 + 10.0.0.24/31 + + + + PortChannel0020 + FC00::31/126 + + + + Ethernet116 + 10.0.0.58/31 + + + + Ethernet116 + FC00::75/126 + + + + Ethernet120 + 10.0.0.60/31 + + + + Ethernet120 + FC00::79/126 + + + + PortChannel0023 + 10.0.0.28/31 + + + + PortChannel0023 + FC00::39/126 + + + + Ethernet124 + 10.0.0.62/31 + + + + Ethernet124 + FC00::7D/126 + + + + + + NTP_ACL + NTP + NTP + + + SNMP_ACL + SNMP + SNMP + + + ERSPAN + Everflow + Everflow + + + ERSPANV6 + EverflowV6 + EverflowV6 + + + VTY_LINE + ssh-only + SSH + + + PortChannel0002;PortChannel0005;PortChannel0008;PortChannel0011;PortChannel0014;PortChannel0017;PortChannel0020;PortChannel0023;Ethernet64;Ethernet68;Ethernet72;Ethernet76;Ethernet80;Ethernet84;Ethernet88;Ethernet92;Ethernet96;Ethernet100;Ethernet104;Ethernet108;Ethernet112;Ethernet116;Ethernet120;Ethernet124 + DataAcl + DataPlane + + + + + + + + + + DeviceInterfaceLink + ARISTA01T0 + Ethernet1 + sonic + Ethernet64 + + + DeviceInterfaceLink + ARISTA01T2 + Ethernet1 + sonic + Ethernet0 + + + DeviceInterfaceLink + ARISTA01T2 + Ethernet2 + sonic + Ethernet4 + + + DeviceInterfaceLink + ARISTA02T0 + Ethernet1 + sonic + Ethernet68 + + + DeviceInterfaceLink + ARISTA03T0 + Ethernet1 + sonic + Ethernet72 + + + DeviceInterfaceLink + ARISTA03T2 + Ethernet1 + sonic + Ethernet8 + + + DeviceInterfaceLink + ARISTA03T2 + Ethernet2 + sonic + Ethernet12 + + + DeviceInterfaceLink + ARISTA04T0 + Ethernet1 + sonic + Ethernet76 + + + DeviceInterfaceLink + ARISTA05T0 + Ethernet1 + sonic + Ethernet80 + + + DeviceInterfaceLink + ARISTA05T2 + Ethernet1 + sonic + Ethernet16 + + + DeviceInterfaceLink + ARISTA05T2 + Ethernet2 + sonic + Ethernet20 + + + DeviceInterfaceLink + ARISTA06T0 + Ethernet1 + sonic + Ethernet84 + + + DeviceInterfaceLink + ARISTA07T0 + Ethernet1 + sonic + Ethernet88 + + + DeviceInterfaceLink + ARISTA07T2 + Ethernet1 + sonic + Ethernet24 + + + DeviceInterfaceLink + ARISTA07T2 + Ethernet2 + sonic + Ethernet28 + + + DeviceInterfaceLink + ARISTA08T0 + Ethernet1 + sonic + Ethernet92 + + + DeviceInterfaceLink + ARISTA09T0 + Ethernet1 + sonic + Ethernet96 + + + DeviceInterfaceLink + ARISTA09T2 + Ethernet1 + sonic + Ethernet32 + + + DeviceInterfaceLink + ARISTA09T2 + Ethernet2 + sonic + Ethernet36 + + + DeviceInterfaceLink + ARISTA10T0 + Ethernet1 + sonic + Ethernet100 + + + DeviceInterfaceLink + ARISTA11T0 + Ethernet1 + sonic + Ethernet104 + + + DeviceInterfaceLink + ARISTA11T2 + Ethernet1 + sonic + Ethernet40 + + + DeviceInterfaceLink + ARISTA11T2 + Ethernet2 + sonic + Ethernet44 + + + DeviceInterfaceLink + ARISTA12T0 + Ethernet1 + sonic + Ethernet108 + + + DeviceInterfaceLink + ARISTA13T0 + Ethernet1 + sonic + Ethernet112 + + + DeviceInterfaceLink + ARISTA13T2 + Ethernet1 + sonic + Ethernet48 + + + DeviceInterfaceLink + ARISTA13T2 + Ethernet2 + sonic + Ethernet52 + + + DeviceInterfaceLink + ARISTA14T0 + Ethernet1 + sonic + Ethernet116 + + + DeviceInterfaceLink + ARISTA15T0 + Ethernet1 + sonic + Ethernet120 + + + DeviceInterfaceLink + ARISTA15T2 + Ethernet1 + sonic + Ethernet56 + + + DeviceInterfaceLink + ARISTA15T2 + Ethernet2 + sonic + Ethernet60 + + + DeviceInterfaceLink + ARISTA16T0 + Ethernet1 + sonic + Ethernet124 + + + + + sonic + ACS-MSN2410 + + 10.100.0.1 + + + + ARISTA16T0 + + 10.100.0.65 + + Arista-VM + + + ARISTA11T0 + + 10.100.0.60 + + Arista-VM + + + ARISTA10T0 + + 10.100.0.59 + + Arista-VM + + + ARISTA11T2 + + 10.100.0.47 + + Arista-VM + + + ARISTA09T2 + + 10.100.0.46 + + Arista-VM + + + ARISTA09T0 + + 10.100.0.58 + + Arista-VM + + + ARISTA06T0 + + 10.100.0.55 + + Arista-VM + + + ARISTA08T0 + + 10.100.0.57 + + Arista-VM + + + ARISTA07T0 + + 10.100.0.56 + + Arista-VM + + + ARISTA07T2 + + 10.100.0.45 + + Arista-VM + + + ARISTA01T2 + + 10.100.0.42 + + Arista-VM + + + ARISTA01T0 + + 10.100.0.50 + + Arista-VM + + + ARISTA05T2 + + 10.100.0.44 + + Arista-VM + + + ARISTA05T0 + + 10.100.0.54 + + Arista-VM + + + ARISTA02T0 + + 10.100.0.51 + + Arista-VM + + + ARISTA03T0 + + 10.100.0.52 + + Arista-VM + + + ARISTA03T2 + + 10.100.0.43 + + Arista-VM + + + ARISTA04T0 + + 10.100.0.53 + + Arista-VM + + + ARISTA15T0 + + 10.100.0.64 + + Arista-VM + + + ARISTA15T2 + + 10.100.0.49 + + Arista-VM + + + ARISTA14T0 + + 10.100.0.63 + + Arista-VM + + + ARISTA12T0 + + 10.100.0.61 + + Arista-VM + + + ARISTA13T2 + + 10.100.0.48 + + Arista-VM + + + ARISTA13T0 + + 10.100.0.62 + + Arista-VM + + + + + + true + + + DeviceInterface + + true + true + 1 + Ethernet0 + + false + 0 + 0 + 25000 + + + DeviceInterface + + true + true + 1 + Ethernet4 + + false + 0 + 0 + 25000 + + + DeviceInterface + + true + true + 1 + Ethernet8 + + false + 0 + 0 + 25000 + + + DeviceInterface + + true + true + 1 + Ethernet12 + + false + 0 + 0 + 25000 + + + DeviceInterface + + true + true + 1 + Ethernet16 + + false + 0 + 0 + 25000 + + + DeviceInterface + + true + true + 1 + Ethernet20 + + false + 0 + 0 + 25000 + + + DeviceInterface + + true + true + 1 + Ethernet24 + + false + 0 + 0 + 25000 + + + DeviceInterface + + true + true + 1 + Ethernet28 + + false + 0 + 0 + 25000 + + + DeviceInterface + + true + true + 1 + Ethernet32 + + false + 0 + 0 + 25000 + + + DeviceInterface + + true + true + 1 + Ethernet36 + + false + 0 + 0 + 25000 + + + DeviceInterface + + true + true + 1 + Ethernet40 + + false + 0 + 0 + 25000 + + + DeviceInterface + + true + true + 1 + Ethernet44 + + false + 0 + 0 + 25000 + + + DeviceInterface + + true + true + 1 + Ethernet48 + + false + 0 + 0 + 25000 + + + DeviceInterface + + true + true + 1 + Ethernet52 + + false + 0 + 0 + 25000 + + + DeviceInterface + + true + true + 1 + Ethernet56 + + false + 0 + 0 + 25000 + + + DeviceInterface + + true + true + 1 + Ethernet60 + + false + 0 + 0 + 25000 + + + DeviceInterface + + true + true + 1 + Ethernet64 + + false + 0 + 0 + 25000 + + + DeviceInterface + + true + true + 1 + Ethernet68 + + false + 0 + 0 + 25000 + + + DeviceInterface + + true + true + 1 + Ethernet72 + + false + 0 + 0 + 25000 + + + DeviceInterface + + true + true + 1 + Ethernet76 + + false + 0 + 0 + 25000 + + + DeviceInterface + + true + true + 1 + Ethernet80 + + false + 0 + 0 + 25000 + + + DeviceInterface + + true + true + 1 + Ethernet84 + + false + 0 + 0 + 25000 + + + DeviceInterface + + true + true + 1 + Ethernet88 + + false + 0 + 0 + 25000 + + + DeviceInterface + + true + true + 1 + Ethernet92 + + false + 0 + 0 + 25000 + + + DeviceInterface + + true + true + 1 + Ethernet96 + + false + 0 + 0 + 25000 + + + DeviceInterface + + true + true + 1 + Ethernet100 + + false + 0 + 0 + 25000 + + + DeviceInterface + + true + true + 1 + Ethernet104 + + false + 0 + 0 + 25000 + + + DeviceInterface + + true + true + 1 + Ethernet108 + + false + 0 + 0 + 25000 + + + DeviceInterface + + true + true + 1 + Ethernet112 + + false + 0 + 0 + 25000 + + + DeviceInterface + + true + true + 1 + Ethernet116 + + false + 0 + 0 + 25000 + + + DeviceInterface + + true + true + 1 + Ethernet120 + + false + 0 + 0 + 25000 + + + DeviceInterface + + true + true + 1 + Ethernet124 + + false + 0 + 0 + 25000 + + + DeviceInterface + + true + true + 1 + Ethernet128 + + false + 0 + 0 + 25000 + + + DeviceInterface + + true + true + 1 + Ethernet132 + + false + 0 + 0 + 25000 + + + DeviceInterface + + true + true + 1 + Ethernet136 + + false + 0 + 0 + 25000 + + + DeviceInterface + + true + true + 1 + Ethernet140 + + false + 0 + 0 + 25000 + + + DeviceInterface + + true + true + 1 + Ethernet144 + + false + 0 + 0 + 25000 + + + DeviceInterface + + true + true + 1 + Ethernet148 + + false + 0 + 0 + 25000 + + + DeviceInterface + + true + true + 1 + Ethernet152 + + false + 0 + 0 + 25000 + + + DeviceInterface + + true + true + 1 + Ethernet156 + + false + 0 + 0 + 25000 + + + DeviceInterface + + true + true + 1 + Ethernet160 + + false + 0 + 0 + 25000 + + + DeviceInterface + + true + true + 1 + Ethernet164 + + false + 0 + 0 + 25000 + + + DeviceInterface + + true + true + 1 + Ethernet168 + + false + 0 + 0 + 25000 + + + DeviceInterface + + true + true + 1 + Ethernet172 + + false + 0 + 0 + 25000 + + + DeviceInterface + + true + true + 1 + Ethernet176 + + false + 0 + 0 + 25000 + + + DeviceInterface + + true + true + 1 + Ethernet180 + + false + 0 + 0 + 25000 + + + DeviceInterface + + true + true + 1 + Ethernet184 + + false + 0 + 0 + 25000 + + + DeviceInterface + + true + true + 1 + Ethernet188 + + false + 0 + 0 + 25000 + + + DeviceInterface + + true + true + 1 + Ethernet192 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet196 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet200 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet204 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet208 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet212 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet216 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + Ethernet220 + + false + 0 + 0 + 100000 + + + true + 0 + ACS-MSN2410 + + + + + + + sonic + + + DeploymentId + + 1 + + + QosProfile + + Profile0 + + + DhcpResources + + 192.0.0.1;192.0.0.2;192.0.0.3;192.0.0.4 + + + NtpResources + + 10.100.0.250 + + + SnmpResources + + 10.0.0.9 + + + TacacsGroup + + sonicadmin + + + TacacsServer + + 10.100.0.20 + + + ForcedMgmtRoutes + + 10.100.0.0/16 + + + ErspanDestinationIpv4 + + 10.0.0.7 + + + + + + + sonic + ACS-MSN2410 +
diff --git a/src/sonic-config-engine/tests/sample-mellanox-2700-t0-minigraph.xml b/src/sonic-config-engine/tests/sample-mellanox-2700-t0-minigraph.xml new file mode 100644 index 000000000000..b7f259e3e2db --- /dev/null +++ b/src/sonic-config-engine/tests/sample-mellanox-2700-t0-minigraph.xml @@ -0,0 +1,1498 @@ + + + + + + false + mellanox-2700 + 10.0.0.56 + ARISTA01T1 + 10.0.0.57 + 1 + 10 + 3 + + + mellanox-2700 + FC00::71 + ARISTA01T1 + FC00::72 + 1 + 10 + 3 + + + false + mellanox-2700 + 10.0.0.58 + ARISTA02T1 + 10.0.0.59 + 1 + 10 + 3 + + + mellanox-2700 + FC00::75 + ARISTA02T1 + FC00::76 + 1 + 10 + 3 + + + false + mellanox-2700 + 10.0.0.60 + ARISTA03T1 + 10.0.0.61 + 1 + 10 + 3 + + + mellanox-2700 + FC00::79 + ARISTA03T1 + FC00::7A + 1 + 10 + 3 + + + false + mellanox-2700 + 10.0.0.62 + ARISTA04T1 + 10.0.0.63 + 1 + 10 + 3 + + + mellanox-2700 + FC00::7D + ARISTA04T1 + FC00::7E + 1 + 10 + 3 + + + + + 65100 + mellanox-2700 + + +
10.0.0.57
+ + + +
+ +
10.0.0.59
+ + + +
+ +
10.0.0.61
+ + + +
+ +
10.0.0.63
+ + + +
+ + BGPPeer +
10.1.0.32
+ + + + BGPSLBPassive + 10.255.0.0/25 +
+ + BGPPeer +
10.1.0.32
+ + + + BGPVac + 192.168.0.0/21 +
+
+ +
+ + 64600 + ARISTA01T1 + + + + 64600 + ARISTA02T1 + + + + 64600 + ARISTA03T1 + + + + 64600 + ARISTA04T1 + + +
+
+ + + + + + HostIP + Loopback0 + + 10.1.0.32/32 + + 10.1.0.32/32 + + + HostIP1 + Loopback0 + + FC00:1::32/128 + + FC00:1::32/128 + + + + + HostIP + eth0 + + 10.100.0.100/24 + + 10.100.0.0/24 + + + V6HostIP + eth0 + + fe80::526b:4bff:fecd:30cc/64 + + fe80::526b:4bff:fecd:30cc/64 + + + + + + + mellanox-2700 + + + PortChannel0001 + etp17a + + + + PortChannel0002 + etp17b + + + + PortChannel0003 + etp18a + + + + PortChannel0004 + etp18b + + + + + + Vlan1000 + etp1b;etp2a;etp2b;etp3a;etp3b;etp4a;etp4b;etp5a;etp5b;etp6a;etp6b;etp7;etp8;etp9;etp10;etp11a;etp11b;etp12a;etp12b;etp13a;etp13b;etp14a;etp14b;etp15a + False + 0.0.0.0/0 + + 192.0.0.1;192.0.0.2;192.0.0.3;192.0.0.4 + 1000 + 1000 + 192.168.0.0/21 + + + + + + PortChannel0001 + 10.0.0.56/31 + + + + PortChannel0001 + FC00::71/126 + + + + PortChannel0002 + 10.0.0.58/31 + + + + PortChannel0002 + FC00::75/126 + + + + PortChannel0003 + 10.0.0.60/31 + + + + PortChannel0003 + FC00::79/126 + + + + PortChannel0004 + 10.0.0.62/31 + + + + PortChannel0004 + FC00::7D/126 + + + + Vlan1000 + 192.168.0.1/21 + + + + Vlan1000 + fc02:1000::1/64 + + + + + + SNMP_ACL + SNMP + SNMP + + + ERSPAN + Everflow + Everflow + + + ERSPANV6 + EverflowV6 + EverflowV6 + + + VTY_LINE + ssh-only + SSH + + + PortChannel0001;PortChannel0002;PortChannel0003;PortChannel0004 + DataAcl + DataPlane + + + + + + + + + + DeviceInterfaceLink + ARISTA01T1 + Ethernet1 + mellanox-2700 + etp17a + + + DeviceInterfaceLink + ARISTA02T1 + Ethernet1 + mellanox-2700 + etp17b + + + DeviceInterfaceLink + ARISTA03T1 + Ethernet1 + mellanox-2700 + etp18a + + + DeviceInterfaceLink + ARISTA04T1 + Ethernet1 + mellanox-2700 + etp18b + + + DeviceInterfaceLink + mellanox-2700 + etp1b + Servers0 + eth0 + + + DeviceInterfaceLink + mellanox-2700 + etp2a + Servers1 + eth0 + + + DeviceInterfaceLink + mellanox-2700 + etp2b + Servers2 + eth0 + + + DeviceInterfaceLink + mellanox-2700 + etp3a + Servers3 + eth0 + + + DeviceInterfaceLink + mellanox-2700 + etp3b + Servers4 + eth0 + + + DeviceInterfaceLink + mellanox-2700 + etp4a + Servers5 + eth0 + + + DeviceInterfaceLink + mellanox-2700 + etp4b + Servers6 + eth0 + + + DeviceInterfaceLink + mellanox-2700 + etp5a + Servers7 + eth0 + + + DeviceInterfaceLink + mellanox-2700 + etp5b + Servers8 + eth0 + + + DeviceInterfaceLink + mellanox-2700 + etp6a + Servers9 + eth0 + + + DeviceInterfaceLink + mellanox-2700 + etp6b + Servers10 + eth0 + + + DeviceInterfaceLink + mellanox-2700 + etp7 + Servers11 + eth0 + + + DeviceInterfaceLink + mellanox-2700 + etp8 + Servers12 + eth0 + + + DeviceInterfaceLink + mellanox-2700 + etp9 + Servers13 + eth0 + + + DeviceInterfaceLink + mellanox-2700 + etp10 + Servers14 + eth0 + + + DeviceInterfaceLink + mellanox-2700 + etp11a + Servers15 + eth0 + + + DeviceInterfaceLink + mellanox-2700 + etp11b + Servers16 + eth0 + + + DeviceInterfaceLink + mellanox-2700 + etp12a + Servers17 + eth0 + + + DeviceInterfaceLink + mellanox-2700 + etp12b + Servers18 + eth0 + + + DeviceInterfaceLink + mellanox-2700 + etp13a + Servers19 + eth0 + + + DeviceInterfaceLink + mellanox-2700 + etp13b + Servers20 + eth0 + + + DeviceInterfaceLink + mellanox-2700 + etp14a + Servers21 + eth0 + + + DeviceInterfaceLink + mellanox-2700 + etp14b + Servers22 + eth0 + + + DeviceInterfaceLink + mellanox-2700 + etp15a + Servers23 + eth0 + + + DeviceInterfaceLink + mellanox-2700 + etp1b + Servers24 + eth0 + + + DeviceInterfaceLink + mellanox-2700 + etp2a + Servers25 + eth0 + + + DeviceInterfaceLink + mellanox-2700 + etp2b + Servers26 + eth0 + + + DeviceInterfaceLink + mellanox-2700 + etp3a + Servers27 + eth0 + + + DeviceInterfaceLink + mellanox-2700 + etp3b + Servers28 + eth0 + + + DeviceInterfaceLink + mellanox-2700 + etp4a + Servers29 + eth0 + + + DeviceInterfaceLink + mellanox-2700 + etp4b + Servers30 + eth0 + + + DeviceInterfaceLink + mellanox-2700 + etp5a + Servers31 + eth0 + + + DeviceInterfaceLink + mellanox-2700 + etp5b + Servers32 + eth0 + + + DeviceInterfaceLink + mellanox-2700 + etp6a + Servers33 + eth0 + + + DeviceInterfaceLink + mellanox-2700 + etp6b + Servers34 + eth0 + + + DeviceInterfaceLink + mellanox-2700 + etp7 + Servers35 + eth0 + + + DeviceInterfaceLink + mellanox-2700 + etp8 + Servers36 + eth0 + + + DeviceInterfaceLink + mellanox-2700 + etp9 + Servers37 + eth0 + + + DeviceInterfaceLink + mellanox-2700 + etp10 + Servers38 + eth0 + + + DeviceInterfaceLink + mellanox-2700 + etp11a + Servers39 + eth0 + + + DeviceInterfaceLink + mellanox-2700 + etp11b + Servers40 + eth0 + + + DeviceInterfaceLink + mellanox-2700 + etp12a + Servers41 + eth0 + + + DeviceInterfaceLink + mellanox-2700 + etp12b + Servers42 + eth0 + + + DeviceInterfaceLink + mellanox-2700 + etp13a + Servers43 + eth0 + + + DeviceInterfaceLink + mellanox-2700 + etp13b + Servers44 + eth0 + + + DeviceInterfaceLink + mellanox-2700 + etp14a + Servers45 + eth0 + + + DeviceInterfaceLink + mellanox-2700 + etp14b + Servers46 + eth0 + + + DeviceInterfaceLink + mellanox-2700 + etp15a + Servers47 + eth0 + + + + + mellanox-2700 + Mellanox-SN2700-D48C8 + + 10.100.0.1 + + + + ARISTA04T1 + + 10.100.0.2 + + Arista-VM + + + ARISTA03T1 + + 10.100.0.3 + + Arista-VM + + + ARISTA02T1 + + 10.100.0.4 + + Arista-VM + + + ARISTA01T1 + + 10.213.80.121 + + Arista-VM + + + + + + true + + + DeviceInterface + + true + true + 1 + etp1a + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + etp1b + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + etp2a + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + etp2b + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + etp3a + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + etp3b + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + etp4a + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + etp4b + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + etp5a + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + etp5b + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + etp6a + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + etp6b + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + etp7 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp8 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp9 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp10 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp11a + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + etp11b + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + etp12a + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + etp12b + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + etp13a + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + etp13b + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + etp14a + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + etp14b + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + etp15a + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + etp15b + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + etp16a + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + etp16b + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + etp17a + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + etp17b + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + etp18a + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + etp18b + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + etp19a + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + etp19b + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + etp20a + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + etp20b + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + etp21a + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + etp21b + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + etp22a + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + etp22b + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + etp23 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp24 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp25 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp26 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + etp27a + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + etp27b + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + etp28a + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + etp28b + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + etp29a + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + etp29b + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + etp30a + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + etp30b + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + etp31a + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + etp31b + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + etp32a + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + etp32b + + false + 0 + 0 + 50000 + + + true + 0 + Mellanox-SN2700-D48C8 + + + + + + + mellanox-2700 + + + DeploymentId + + 1 + + + QosProfile + + Profile0 + + + DhcpResources + + 192.0.0.1;192.0.0.2;192.0.0.3;192.0.0.4 + + + SnmpResources + + 10.0.0.9 + + + ErspanDestinationIpv4 + + 10.0.0.7 + + + + + + + mellanox-2700 + Mellanox-SN2700-D48C8 +
diff --git a/src/sonic-config-engine/tests/sample-mellanox-4600c-t1-minigraph-remap-disabled.xml b/src/sonic-config-engine/tests/sample-mellanox-4600c-t1-minigraph-remap-disabled.xml new file mode 100644 index 000000000000..3d08387d71a0 --- /dev/null +++ b/src/sonic-config-engine/tests/sample-mellanox-4600c-t1-minigraph-remap-disabled.xml @@ -0,0 +1,2460 @@ + + + + + + false + r-tigon-11 + 10.0.0.32 + ARISTA01T0 + 10.0.0.33 + 1 + 10 + 3 + + + r-tigon-11 + FC00::41 + ARISTA01T0 + FC00::42 + 1 + 10 + 3 + + + false + r-tigon-11 + 10.0.0.0 + ARISTA01T2 + 10.0.0.1 + 1 + 10 + 3 + + + r-tigon-11 + FC00::1 + ARISTA01T2 + FC00::2 + 1 + 10 + 3 + + + false + r-tigon-11 + 10.0.0.34 + ARISTA02T0 + 10.0.0.35 + 1 + 10 + 3 + + + r-tigon-11 + FC00::45 + ARISTA02T0 + FC00::46 + 1 + 10 + 3 + + + false + r-tigon-11 + 10.0.0.36 + ARISTA03T0 + 10.0.0.37 + 1 + 10 + 3 + + + r-tigon-11 + FC00::49 + ARISTA03T0 + FC00::4A + 1 + 10 + 3 + + + false + r-tigon-11 + 10.0.0.4 + ARISTA03T2 + 10.0.0.5 + 1 + 10 + 3 + + + r-tigon-11 + FC00::5 + ARISTA03T2 + FC00::6 + 1 + 10 + 3 + + + false + r-tigon-11 + 10.0.0.38 + ARISTA04T0 + 10.0.0.39 + 1 + 10 + 3 + + + r-tigon-11 + FC00::4D + ARISTA04T0 + FC00::4E + 1 + 10 + 3 + + + false + r-tigon-11 + 10.0.0.40 + ARISTA05T0 + 10.0.0.41 + 1 + 10 + 3 + + + r-tigon-11 + FC00::51 + ARISTA05T0 + FC00::52 + 1 + 10 + 3 + + + false + r-tigon-11 + 10.0.0.8 + ARISTA05T2 + 10.0.0.9 + 1 + 10 + 3 + + + r-tigon-11 + FC00::9 + ARISTA05T2 + FC00::A + 1 + 10 + 3 + + + false + r-tigon-11 + 10.0.0.42 + ARISTA06T0 + 10.0.0.43 + 1 + 10 + 3 + + + r-tigon-11 + FC00::55 + ARISTA06T0 + FC00::56 + 1 + 10 + 3 + + + false + r-tigon-11 + 10.0.0.44 + ARISTA07T0 + 10.0.0.45 + 1 + 10 + 3 + + + r-tigon-11 + FC00::59 + ARISTA07T0 + FC00::5A + 1 + 10 + 3 + + + false + r-tigon-11 + 10.0.0.12 + ARISTA07T2 + 10.0.0.13 + 1 + 10 + 3 + + + r-tigon-11 + FC00::D + ARISTA07T2 + FC00::E + 1 + 10 + 3 + + + false + r-tigon-11 + 10.0.0.46 + ARISTA08T0 + 10.0.0.47 + 1 + 10 + 3 + + + r-tigon-11 + FC00::5D + ARISTA08T0 + FC00::5E + 1 + 10 + 3 + + + false + r-tigon-11 + 10.0.0.48 + ARISTA09T0 + 10.0.0.49 + 1 + 10 + 3 + + + r-tigon-11 + FC00::61 + ARISTA09T0 + FC00::62 + 1 + 10 + 3 + + + false + r-tigon-11 + 10.0.0.50 + ARISTA10T0 + 10.0.0.51 + 1 + 10 + 3 + + + r-tigon-11 + FC00::65 + ARISTA10T0 + FC00::66 + 1 + 10 + 3 + + + false + r-tigon-11 + 10.0.0.52 + ARISTA11T0 + 10.0.0.53 + 1 + 10 + 3 + + + r-tigon-11 + FC00::69 + ARISTA11T0 + FC00::6A + 1 + 10 + 3 + + + false + r-tigon-11 + 10.0.0.54 + ARISTA12T0 + 10.0.0.55 + 1 + 10 + 3 + + + r-tigon-11 + FC00::6D + ARISTA12T0 + FC00::6E + 1 + 10 + 3 + + + false + r-tigon-11 + 10.0.0.56 + ARISTA13T0 + 10.0.0.57 + 1 + 10 + 3 + + + r-tigon-11 + FC00::71 + ARISTA13T0 + FC00::72 + 1 + 10 + 3 + + + false + r-tigon-11 + 10.0.0.58 + ARISTA14T0 + 10.0.0.59 + 1 + 10 + 3 + + + r-tigon-11 + FC00::75 + ARISTA14T0 + FC00::76 + 1 + 10 + 3 + + + false + r-tigon-11 + 10.0.0.60 + ARISTA15T0 + 10.0.0.61 + 1 + 10 + 3 + + + r-tigon-11 + FC00::79 + ARISTA15T0 + FC00::7A + 1 + 10 + 3 + + + false + r-tigon-11 + 10.0.0.62 + ARISTA16T0 + 10.0.0.63 + 1 + 10 + 3 + + + r-tigon-11 + FC00::7D + ARISTA16T0 + FC00::7E + 1 + 10 + 3 + + + false + r-tigon-11 + 10.0.0.64 + ARISTA17T0 + 10.0.0.65 + 1 + 10 + 3 + + + r-tigon-11 + FC00::81 + ARISTA17T0 + FC00::82 + 1 + 10 + 3 + + + false + r-tigon-11 + 10.0.0.66 + ARISTA18T0 + 10.0.0.67 + 1 + 10 + 3 + + + r-tigon-11 + FC00::85 + ARISTA18T0 + FC00::86 + 1 + 10 + 3 + + + false + r-tigon-11 + 10.0.0.68 + ARISTA19T0 + 10.0.0.69 + 1 + 10 + 3 + + + r-tigon-11 + FC00::89 + ARISTA19T0 + FC00::8A + 1 + 10 + 3 + + + false + r-tigon-11 + 10.0.0.70 + ARISTA20T0 + 10.0.0.71 + 1 + 10 + 3 + + + r-tigon-11 + FC00::8D + ARISTA20T0 + FC00::8E + 1 + 10 + 3 + + + + + 65100 + r-tigon-11 + + +
10.0.0.33
+ + + +
+ +
10.0.0.1
+ + + +
+ +
10.0.0.35
+ + + +
+ +
10.0.0.37
+ + + +
+ +
10.0.0.5
+ + + +
+ +
10.0.0.39
+ + + +
+ +
10.0.0.41
+ + + +
+ +
10.0.0.9
+ + + +
+ +
10.0.0.43
+ + + +
+ +
10.0.0.45
+ + + +
+ +
10.0.0.13
+ + + +
+ +
10.0.0.47
+ + + +
+ +
10.0.0.49
+ + + +
+ +
10.0.0.51
+ + + +
+ +
10.0.0.53
+ + + +
+ +
10.0.0.55
+ + + +
+ +
10.0.0.57
+ + + +
+ +
10.0.0.59
+ + + +
+ +
10.0.0.61
+ + + +
+ +
10.0.0.63
+ + + +
+ +
10.0.0.65
+ + + +
+ +
10.0.0.67
+ + + +
+ +
10.0.0.69
+ + + +
+ +
10.0.0.71
+ + + +
+
+ +
+ + 64001 + ARISTA01T0 + + + + 65200 + ARISTA01T2 + + + + 64002 + ARISTA02T0 + + + + 64003 + ARISTA03T0 + + + + 65200 + ARISTA03T2 + + + + 64004 + ARISTA04T0 + + + + 64005 + ARISTA05T0 + + + + 65200 + ARISTA05T2 + + + + 64006 + ARISTA06T0 + + + + 64007 + ARISTA07T0 + + + + 65200 + ARISTA07T2 + + + + 64008 + ARISTA08T0 + + + + 64009 + ARISTA09T0 + + + + 64010 + ARISTA10T0 + + + + 64011 + ARISTA11T0 + + + + 64012 + ARISTA12T0 + + + + 64013 + ARISTA13T0 + + + + 64014 + ARISTA14T0 + + + + 64015 + ARISTA15T0 + + + + 64016 + ARISTA16T0 + + + + 64017 + ARISTA17T0 + + + + 64018 + ARISTA18T0 + + + + 64019 + ARISTA19T0 + + + + 64020 + ARISTA20T0 + + +
+
+ + + + + + HostIP + Loopback0 + + 10.1.0.32/32 + + 10.1.0.32/32 + + + HostIP1 + Loopback0 + + FC00:1::32/128 + + FC00:1::32/128 + + + + + HostIP + eth0 + + 10.100.25.10/22 + + 10.100.25.10/22 + + + V6HostIP + eth0 + + fe80::e42:a1ff:fe60:65d8/64 + + fe80::e42:a1ff:fe60:65d8/64 + + + + + + + r-tigon-11 + + + PortChannel101 + etp35 + + + + PortChannel102 + etp1;etp2 + + + + PortChannel103 + etp37 + + + + PortChannel104 + etp38 + + + + PortChannel105 + etp5;etp6 + + + + PortChannel106 + etp39 + + + + PortChannel107 + etp40 + + + + PortChannel108 + etp17;etp18 + + + + PortChannel109 + etp43 + + + + PortChannel1010 + etp45 + + + + PortChannel1011 + etp21;etp22 + + + + PortChannel1012 + etp46 + + + + PortChannel1013 + etp47 + + + + PortChannel1014 + etp48 + + + + PortChannel1015 + etp51 + + + + PortChannel1016 + etp53 + + + + PortChannel1017 + etp54 + + + + PortChannel1018 + etp55 + + + + PortChannel1019 + etp56 + + + + PortChannel1020 + etp59 + + + + PortChannel1021 + etp61 + + + + PortChannel1022 + etp62 + + + + PortChannel1023 + etp63 + + + + PortChannel1024 + etp64 + + + + + + + + + PortChannel101 + 10.0.0.32/31 + + + + PortChannel101 + FC00::41/126 + + + + PortChannel102 + 10.0.0.0/31 + + + + PortChannel102 + FC00::1/126 + + + + PortChannel103 + 10.0.0.34/31 + + + + PortChannel103 + FC00::45/126 + + + + PortChannel104 + 10.0.0.36/31 + + + + PortChannel104 + FC00::49/126 + + + + PortChannel105 + 10.0.0.4/31 + + + + PortChannel105 + FC00::5/126 + + + + PortChannel106 + 10.0.0.38/31 + + + + PortChannel106 + FC00::4D/126 + + + + PortChannel107 + 10.0.0.40/31 + + + + PortChannel107 + FC00::51/126 + + + + PortChannel108 + 10.0.0.8/31 + + + + PortChannel108 + FC00::9/126 + + + + PortChannel109 + 10.0.0.42/31 + + + + PortChannel109 + FC00::55/126 + + + + PortChannel1010 + 10.0.0.44/31 + + + + PortChannel1010 + FC00::59/126 + + + + PortChannel1011 + 10.0.0.12/31 + + + + PortChannel1011 + FC00::D/126 + + + + PortChannel1012 + 10.0.0.46/31 + + + + PortChannel1012 + FC00::5D/126 + + + + PortChannel1013 + 10.0.0.48/31 + + + + PortChannel1013 + FC00::61/126 + + + + PortChannel1014 + 10.0.0.50/31 + + + + PortChannel1014 + FC00::65/126 + + + + PortChannel1015 + 10.0.0.52/31 + + + + PortChannel1015 + FC00::69/126 + + + + PortChannel1016 + 10.0.0.54/31 + + + + PortChannel1016 + FC00::6D/126 + + + + PortChannel1017 + 10.0.0.56/31 + + + + PortChannel1017 + FC00::71/126 + + + + PortChannel1018 + 10.0.0.58/31 + + + + PortChannel1018 + FC00::75/126 + + + + PortChannel1019 + 10.0.0.60/31 + + + + PortChannel1019 + FC00::79/126 + + + + PortChannel1020 + 10.0.0.62/31 + + + + PortChannel1020 + FC00::7D/126 + + + + PortChannel1021 + 10.0.0.64/31 + + + + PortChannel1021 + FC00::81/126 + + + + PortChannel1022 + 10.0.0.66/31 + + + + PortChannel1022 + FC00::85/126 + + + + PortChannel1023 + 10.0.0.68/31 + + + + PortChannel1023 + FC00::89/126 + + + + PortChannel1024 + 10.0.0.70/31 + + + + PortChannel1024 + FC00::8D/126 + + + + + + NTP_ACL + NTP + NTP + + + SNMP_ACL + SNMP + SNMP + + + ERSPAN + Everflow + Everflow + + + ERSPANV6 + EverflowV6 + EverflowV6 + + + VTY_LINE + ssh-only + SSH + + + PortChannel101;PortChannel102;PortChannel103;PortChannel104;PortChannel105;PortChannel106;PortChannel107;PortChannel108;PortChannel109;PortChannel1010;PortChannel1011;PortChannel1012;PortChannel1013;PortChannel1014;PortChannel1015;PortChannel1016;PortChannel1017;PortChannel1018;PortChannel1019;PortChannel1020;PortChannel1021;PortChannel1022;PortChannel1023;PortChannel1024 + DataAcl + DataPlane + + + + + + + + + + DeviceInterfaceLink + ARISTA01T0 + Ethernet1 + r-tigon-11 + etp35 + + + DeviceInterfaceLink + ARISTA01T2 + Ethernet1 + r-tigon-11 + etp1 + + + DeviceInterfaceLink + ARISTA01T2 + Ethernet2 + r-tigon-11 + etp2 + + + DeviceInterfaceLink + ARISTA02T0 + Ethernet1 + r-tigon-11 + etp37 + + + DeviceInterfaceLink + ARISTA03T0 + Ethernet1 + r-tigon-11 + etp38 + + + DeviceInterfaceLink + ARISTA03T2 + Ethernet1 + r-tigon-11 + etp5 + + + DeviceInterfaceLink + ARISTA03T2 + Ethernet2 + r-tigon-11 + etp6 + + + DeviceInterfaceLink + ARISTA04T0 + Ethernet1 + r-tigon-11 + etp39 + + + DeviceInterfaceLink + ARISTA05T0 + Ethernet1 + r-tigon-11 + etp40 + + + DeviceInterfaceLink + ARISTA05T2 + Ethernet1 + r-tigon-11 + etp17 + + + DeviceInterfaceLink + ARISTA05T2 + Ethernet2 + r-tigon-11 + etp18 + + + DeviceInterfaceLink + ARISTA06T0 + Ethernet1 + r-tigon-11 + etp43 + + + DeviceInterfaceLink + ARISTA07T0 + Ethernet1 + r-tigon-11 + etp45 + + + DeviceInterfaceLink + ARISTA07T2 + Ethernet1 + r-tigon-11 + etp21 + + + DeviceInterfaceLink + ARISTA07T2 + Ethernet2 + r-tigon-11 + etp22 + + + DeviceInterfaceLink + ARISTA08T0 + Ethernet1 + r-tigon-11 + etp46 + + + DeviceInterfaceLink + ARISTA09T0 + Ethernet1 + r-tigon-11 + etp47 + + + DeviceInterfaceLink + ARISTA10T0 + Ethernet1 + r-tigon-11 + etp48 + + + DeviceInterfaceLink + ARISTA11T0 + Ethernet1 + r-tigon-11 + etp51 + + + DeviceInterfaceLink + ARISTA12T0 + Ethernet1 + r-tigon-11 + etp53 + + + DeviceInterfaceLink + ARISTA13T0 + Ethernet1 + r-tigon-11 + etp54 + + + DeviceInterfaceLink + ARISTA14T0 + Ethernet1 + r-tigon-11 + etp55 + + + DeviceInterfaceLink + ARISTA15T0 + Ethernet1 + r-tigon-11 + etp56 + + + DeviceInterfaceLink + ARISTA16T0 + Ethernet1 + r-tigon-11 + etp59 + + + DeviceInterfaceLink + ARISTA17T0 + Ethernet1 + r-tigon-11 + etp61 + + + DeviceInterfaceLink + ARISTA18T0 + Ethernet1 + r-tigon-11 + etp62 + + + DeviceInterfaceLink + ARISTA19T0 + Ethernet1 + r-tigon-11 + etp63 + + + DeviceInterfaceLink + ARISTA20T0 + Ethernet1 + r-tigon-11 + etp64 + + + + + r-tigon-11 + Mellanox-SN4600C-C64 + + 10.100.25.10 + + + + ARISTA16T0 + + 10.101.14.82 + + Arista-VM + + + ARISTA11T0 + + 10.101.14.77 + + Arista-VM + + + ARISTA10T0 + + 10.101.14.76 + + Arista-VM + + + ARISTA17T0 + + 10.101.14.83 + + Arista-VM + + + ARISTA09T0 + + 10.101.14.75 + + Arista-VM + + + ARISTA20T0 + + 10.101.14.86 + + Arista-VM + + + ARISTA08T0 + + 10.101.14.74 + + Arista-VM + + + ARISTA07T0 + + 10.101.14.73 + + Arista-VM + + + ARISTA07T2 + + 10.101.14.66 + + Arista-VM + + + ARISTA01T2 + + 10.101.14.63 + + Arista-VM + + + ARISTA01T0 + + 10.101.14.67 + + Arista-VM + + + ARISTA05T2 + + 10.101.14.65 + + Arista-VM + + + ARISTA05T0 + + 10.101.14.71 + + Arista-VM + + + ARISTA02T0 + + 10.101.14.68 + + Arista-VM + + + ARISTA03T0 + + 10.101.14.69 + + Arista-VM + + + ARISTA03T2 + + 10.101.14.64 + + Arista-VM + + + ARISTA04T0 + + 10.101.14.70 + + Arista-VM + + + ARISTA18T0 + + 10.101.14.84 + + Arista-VM + + + ARISTA15T0 + + 10.101.14.81 + + Arista-VM + + + ARISTA19T0 + + 10.101.14.85 + + Arista-VM + + + ARISTA14T0 + + 10.101.14.80 + + Arista-VM + + + ARISTA12T0 + + 10.101.14.78 + + Arista-VM + + + ARISTA13T0 + + 10.101.14.79 + + Arista-VM + + + ARISTA06T0 + + 10.101.14.72 + + Arista-VM + + + + + + true + + + DeviceInterface + + true + true + 1 + etp1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp2 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp3 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp4 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp5 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp6 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp7 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp8 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp9 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp10 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp11 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp12 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp13 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp14 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp15 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp16 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp17 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp18 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp19 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp20 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp21 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp22 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp23 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp24 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp25 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp26 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp27 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp28 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp29 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp30 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp31 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp32 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp33 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp34 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp35 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp36 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp37 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp38 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp39 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp40 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp41 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp42 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp43 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp44 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp45 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp46 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp47 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp48 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp49 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp50 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp51 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp52 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp53 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp54 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp55 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp56 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp57 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp58 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp59 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp60 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp61 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp62 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp63 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + etp64 + + false + 0 + 0 + 50000 + + + true + 0 + Mellanox-SN4600C-C64 + + + + + + + r-tigon-11 + + + DeploymentId + + 1 + + + QosProfile + + Profile0 + + + DhcpResources + + 192.0.0.1;192.0.0.2;192.0.0.3;192.0.0.4 + + + NtpResources + + 10.100.25.32;10.102.202.2 + + + SnmpResources + + 10.0.0.9 + + + TacacsGroup + + testlab + + + TacacsServer + + 10.107.34.20 + + + ForcedMgmtRoutes + + 10.102.0.0/16;10.101.0.0/16 + + + ErspanDestinationIpv4 + + 10.0.0.7 + + + + + + + r-tigon-11 + Mellanox-SN4600C-C64 +
diff --git a/src/sonic-config-engine/tests/sample-mellanox-4600c-t1-minigraph.xml b/src/sonic-config-engine/tests/sample-mellanox-4600c-t1-minigraph.xml new file mode 100644 index 000000000000..bdb8acc63119 --- /dev/null +++ b/src/sonic-config-engine/tests/sample-mellanox-4600c-t1-minigraph.xml @@ -0,0 +1,2465 @@ + + + + + + false + r-tigon-11 + 10.0.0.32 + ARISTA01T0 + 10.0.0.33 + 1 + 10 + 3 + + + r-tigon-11 + FC00::41 + ARISTA01T0 + FC00::42 + 1 + 10 + 3 + + + false + r-tigon-11 + 10.0.0.0 + ARISTA01T2 + 10.0.0.1 + 1 + 10 + 3 + + + r-tigon-11 + FC00::1 + ARISTA01T2 + FC00::2 + 1 + 10 + 3 + + + false + r-tigon-11 + 10.0.0.34 + ARISTA02T0 + 10.0.0.35 + 1 + 10 + 3 + + + r-tigon-11 + FC00::45 + ARISTA02T0 + FC00::46 + 1 + 10 + 3 + + + false + r-tigon-11 + 10.0.0.36 + ARISTA03T0 + 10.0.0.37 + 1 + 10 + 3 + + + r-tigon-11 + FC00::49 + ARISTA03T0 + FC00::4A + 1 + 10 + 3 + + + false + r-tigon-11 + 10.0.0.4 + ARISTA03T2 + 10.0.0.5 + 1 + 10 + 3 + + + r-tigon-11 + FC00::5 + ARISTA03T2 + FC00::6 + 1 + 10 + 3 + + + false + r-tigon-11 + 10.0.0.38 + ARISTA04T0 + 10.0.0.39 + 1 + 10 + 3 + + + r-tigon-11 + FC00::4D + ARISTA04T0 + FC00::4E + 1 + 10 + 3 + + + false + r-tigon-11 + 10.0.0.40 + ARISTA05T0 + 10.0.0.41 + 1 + 10 + 3 + + + r-tigon-11 + FC00::51 + ARISTA05T0 + FC00::52 + 1 + 10 + 3 + + + false + r-tigon-11 + 10.0.0.8 + ARISTA05T2 + 10.0.0.9 + 1 + 10 + 3 + + + r-tigon-11 + FC00::9 + ARISTA05T2 + FC00::A + 1 + 10 + 3 + + + false + r-tigon-11 + 10.0.0.42 + ARISTA06T0 + 10.0.0.43 + 1 + 10 + 3 + + + r-tigon-11 + FC00::55 + ARISTA06T0 + FC00::56 + 1 + 10 + 3 + + + false + r-tigon-11 + 10.0.0.44 + ARISTA07T0 + 10.0.0.45 + 1 + 10 + 3 + + + r-tigon-11 + FC00::59 + ARISTA07T0 + FC00::5A + 1 + 10 + 3 + + + false + r-tigon-11 + 10.0.0.12 + ARISTA07T2 + 10.0.0.13 + 1 + 10 + 3 + + + r-tigon-11 + FC00::D + ARISTA07T2 + FC00::E + 1 + 10 + 3 + + + false + r-tigon-11 + 10.0.0.46 + ARISTA08T0 + 10.0.0.47 + 1 + 10 + 3 + + + r-tigon-11 + FC00::5D + ARISTA08T0 + FC00::5E + 1 + 10 + 3 + + + false + r-tigon-11 + 10.0.0.48 + ARISTA09T0 + 10.0.0.49 + 1 + 10 + 3 + + + r-tigon-11 + FC00::61 + ARISTA09T0 + FC00::62 + 1 + 10 + 3 + + + false + r-tigon-11 + 10.0.0.50 + ARISTA10T0 + 10.0.0.51 + 1 + 10 + 3 + + + r-tigon-11 + FC00::65 + ARISTA10T0 + FC00::66 + 1 + 10 + 3 + + + false + r-tigon-11 + 10.0.0.52 + ARISTA11T0 + 10.0.0.53 + 1 + 10 + 3 + + + r-tigon-11 + FC00::69 + ARISTA11T0 + FC00::6A + 1 + 10 + 3 + + + false + r-tigon-11 + 10.0.0.54 + ARISTA12T0 + 10.0.0.55 + 1 + 10 + 3 + + + r-tigon-11 + FC00::6D + ARISTA12T0 + FC00::6E + 1 + 10 + 3 + + + false + r-tigon-11 + 10.0.0.56 + ARISTA13T0 + 10.0.0.57 + 1 + 10 + 3 + + + r-tigon-11 + FC00::71 + ARISTA13T0 + FC00::72 + 1 + 10 + 3 + + + false + r-tigon-11 + 10.0.0.58 + ARISTA14T0 + 10.0.0.59 + 1 + 10 + 3 + + + r-tigon-11 + FC00::75 + ARISTA14T0 + FC00::76 + 1 + 10 + 3 + + + false + r-tigon-11 + 10.0.0.60 + ARISTA15T0 + 10.0.0.61 + 1 + 10 + 3 + + + r-tigon-11 + FC00::79 + ARISTA15T0 + FC00::7A + 1 + 10 + 3 + + + false + r-tigon-11 + 10.0.0.62 + ARISTA16T0 + 10.0.0.63 + 1 + 10 + 3 + + + r-tigon-11 + FC00::7D + ARISTA16T0 + FC00::7E + 1 + 10 + 3 + + + false + r-tigon-11 + 10.0.0.64 + ARISTA17T0 + 10.0.0.65 + 1 + 10 + 3 + + + r-tigon-11 + FC00::81 + ARISTA17T0 + FC00::82 + 1 + 10 + 3 + + + false + r-tigon-11 + 10.0.0.66 + ARISTA18T0 + 10.0.0.67 + 1 + 10 + 3 + + + r-tigon-11 + FC00::85 + ARISTA18T0 + FC00::86 + 1 + 10 + 3 + + + false + r-tigon-11 + 10.0.0.68 + ARISTA19T0 + 10.0.0.69 + 1 + 10 + 3 + + + r-tigon-11 + FC00::89 + ARISTA19T0 + FC00::8A + 1 + 10 + 3 + + + false + r-tigon-11 + 10.0.0.70 + ARISTA20T0 + 10.0.0.71 + 1 + 10 + 3 + + + r-tigon-11 + FC00::8D + ARISTA20T0 + FC00::8E + 1 + 10 + 3 + + + + + 65100 + r-tigon-11 + + +
10.0.0.33
+ + + +
+ +
10.0.0.1
+ + + +
+ +
10.0.0.35
+ + + +
+ +
10.0.0.37
+ + + +
+ +
10.0.0.5
+ + + +
+ +
10.0.0.39
+ + + +
+ +
10.0.0.41
+ + + +
+ +
10.0.0.9
+ + + +
+ +
10.0.0.43
+ + + +
+ +
10.0.0.45
+ + + +
+ +
10.0.0.13
+ + + +
+ +
10.0.0.47
+ + + +
+ +
10.0.0.49
+ + + +
+ +
10.0.0.51
+ + + +
+ +
10.0.0.53
+ + + +
+ +
10.0.0.55
+ + + +
+ +
10.0.0.57
+ + + +
+ +
10.0.0.59
+ + + +
+ +
10.0.0.61
+ + + +
+ +
10.0.0.63
+ + + +
+ +
10.0.0.65
+ + + +
+ +
10.0.0.67
+ + + +
+ +
10.0.0.69
+ + + +
+ +
10.0.0.71
+ + + +
+
+ +
+ + 64001 + ARISTA01T0 + + + + 65200 + ARISTA01T2 + + + + 64002 + ARISTA02T0 + + + + 64003 + ARISTA03T0 + + + + 65200 + ARISTA03T2 + + + + 64004 + ARISTA04T0 + + + + 64005 + ARISTA05T0 + + + + 65200 + ARISTA05T2 + + + + 64006 + ARISTA06T0 + + + + 64007 + ARISTA07T0 + + + + 65200 + ARISTA07T2 + + + + 64008 + ARISTA08T0 + + + + 64009 + ARISTA09T0 + + + + 64010 + ARISTA10T0 + + + + 64011 + ARISTA11T0 + + + + 64012 + ARISTA12T0 + + + + 64013 + ARISTA13T0 + + + + 64014 + ARISTA14T0 + + + + 64015 + ARISTA15T0 + + + + 64016 + ARISTA16T0 + + + + 64017 + ARISTA17T0 + + + + 64018 + ARISTA18T0 + + + + 64019 + ARISTA19T0 + + + + 64020 + ARISTA20T0 + + +
+
+ + + + + + HostIP + Loopback0 + + 10.1.0.32/32 + + 10.1.0.32/32 + + + HostIP1 + Loopback0 + + FC00:1::32/128 + + FC00:1::32/128 + + + + + HostIP + eth0 + + 10.100.25.10/22 + + 10.100.25.10/22 + + + V6HostIP + eth0 + + fe80::e42:a1ff:fe60:65d8/64 + + fe80::e42:a1ff:fe60:65d8/64 + + + + + + + r-tigon-11 + + + PortChannel101 + etp35 + + + + PortChannel102 + etp1;etp2 + + + + PortChannel103 + etp37 + + + + PortChannel104 + etp38 + + + + PortChannel105 + etp5;etp6 + + + + PortChannel106 + etp39 + + + + PortChannel107 + etp40 + + + + PortChannel108 + etp17;etp18 + + + + PortChannel109 + etp43 + + + + PortChannel1010 + etp45 + + + + PortChannel1011 + etp21;etp22 + + + + PortChannel1012 + etp46 + + + + PortChannel1013 + etp47 + + + + PortChannel1014 + etp48 + + + + PortChannel1015 + etp51 + + + + PortChannel1016 + etp53 + + + + PortChannel1017 + etp54 + + + + PortChannel1018 + etp55 + + + + PortChannel1019 + etp56 + + + + PortChannel1020 + etp59 + + + + PortChannel1021 + etp61 + + + + PortChannel1022 + etp62 + + + + PortChannel1023 + etp63 + + + + PortChannel1024 + etp64 + + + + + + + + + PortChannel101 + 10.0.0.32/31 + + + + PortChannel101 + FC00::41/126 + + + + PortChannel102 + 10.0.0.0/31 + + + + PortChannel102 + FC00::1/126 + + + + PortChannel103 + 10.0.0.34/31 + + + + PortChannel103 + FC00::45/126 + + + + PortChannel104 + 10.0.0.36/31 + + + + PortChannel104 + FC00::49/126 + + + + PortChannel105 + 10.0.0.4/31 + + + + PortChannel105 + FC00::5/126 + + + + PortChannel106 + 10.0.0.38/31 + + + + PortChannel106 + FC00::4D/126 + + + + PortChannel107 + 10.0.0.40/31 + + + + PortChannel107 + FC00::51/126 + + + + PortChannel108 + 10.0.0.8/31 + + + + PortChannel108 + FC00::9/126 + + + + PortChannel109 + 10.0.0.42/31 + + + + PortChannel109 + FC00::55/126 + + + + PortChannel1010 + 10.0.0.44/31 + + + + PortChannel1010 + FC00::59/126 + + + + PortChannel1011 + 10.0.0.12/31 + + + + PortChannel1011 + FC00::D/126 + + + + PortChannel1012 + 10.0.0.46/31 + + + + PortChannel1012 + FC00::5D/126 + + + + PortChannel1013 + 10.0.0.48/31 + + + + PortChannel1013 + FC00::61/126 + + + + PortChannel1014 + 10.0.0.50/31 + + + + PortChannel1014 + FC00::65/126 + + + + PortChannel1015 + 10.0.0.52/31 + + + + PortChannel1015 + FC00::69/126 + + + + PortChannel1016 + 10.0.0.54/31 + + + + PortChannel1016 + FC00::6D/126 + + + + PortChannel1017 + 10.0.0.56/31 + + + + PortChannel1017 + FC00::71/126 + + + + PortChannel1018 + 10.0.0.58/31 + + + + PortChannel1018 + FC00::75/126 + + + + PortChannel1019 + 10.0.0.60/31 + + + + PortChannel1019 + FC00::79/126 + + + + PortChannel1020 + 10.0.0.62/31 + + + + PortChannel1020 + FC00::7D/126 + + + + PortChannel1021 + 10.0.0.64/31 + + + + PortChannel1021 + FC00::81/126 + + + + PortChannel1022 + 10.0.0.66/31 + + + + PortChannel1022 + FC00::85/126 + + + + PortChannel1023 + 10.0.0.68/31 + + + + PortChannel1023 + FC00::89/126 + + + + PortChannel1024 + 10.0.0.70/31 + + + + PortChannel1024 + FC00::8D/126 + + + + + + NTP_ACL + NTP + NTP + + + SNMP_ACL + SNMP + SNMP + + + ERSPAN + Everflow + Everflow + + + ERSPANV6 + EverflowV6 + EverflowV6 + + + VTY_LINE + ssh-only + SSH + + + PortChannel101;PortChannel102;PortChannel103;PortChannel104;PortChannel105;PortChannel106;PortChannel107;PortChannel108;PortChannel109;PortChannel1010;PortChannel1011;PortChannel1012;PortChannel1013;PortChannel1014;PortChannel1015;PortChannel1016;PortChannel1017;PortChannel1018;PortChannel1019;PortChannel1020;PortChannel1021;PortChannel1022;PortChannel1023;PortChannel1024 + DataAcl + DataPlane + + + + + + + + + + DeviceInterfaceLink + ARISTA01T0 + Ethernet1 + r-tigon-11 + etp35 + + + DeviceInterfaceLink + ARISTA01T2 + Ethernet1 + r-tigon-11 + etp1 + + + DeviceInterfaceLink + ARISTA01T2 + Ethernet2 + r-tigon-11 + etp2 + + + DeviceInterfaceLink + ARISTA02T0 + Ethernet1 + r-tigon-11 + etp37 + + + DeviceInterfaceLink + ARISTA03T0 + Ethernet1 + r-tigon-11 + etp38 + + + DeviceInterfaceLink + ARISTA03T2 + Ethernet1 + r-tigon-11 + etp5 + + + DeviceInterfaceLink + ARISTA03T2 + Ethernet2 + r-tigon-11 + etp6 + + + DeviceInterfaceLink + ARISTA04T0 + Ethernet1 + r-tigon-11 + etp39 + + + DeviceInterfaceLink + ARISTA05T0 + Ethernet1 + r-tigon-11 + etp40 + + + DeviceInterfaceLink + ARISTA05T2 + Ethernet1 + r-tigon-11 + etp17 + + + DeviceInterfaceLink + ARISTA05T2 + Ethernet2 + r-tigon-11 + etp18 + + + DeviceInterfaceLink + ARISTA06T0 + Ethernet1 + r-tigon-11 + etp43 + + + DeviceInterfaceLink + ARISTA07T0 + Ethernet1 + r-tigon-11 + etp45 + + + DeviceInterfaceLink + ARISTA07T2 + Ethernet1 + r-tigon-11 + etp21 + + + DeviceInterfaceLink + ARISTA07T2 + Ethernet2 + r-tigon-11 + etp22 + + + DeviceInterfaceLink + ARISTA08T0 + Ethernet1 + r-tigon-11 + etp46 + + + DeviceInterfaceLink + ARISTA09T0 + Ethernet1 + r-tigon-11 + etp47 + + + DeviceInterfaceLink + ARISTA10T0 + Ethernet1 + r-tigon-11 + etp48 + + + DeviceInterfaceLink + ARISTA11T0 + Ethernet1 + r-tigon-11 + etp51 + + + DeviceInterfaceLink + ARISTA12T0 + Ethernet1 + r-tigon-11 + etp53 + + + DeviceInterfaceLink + ARISTA13T0 + Ethernet1 + r-tigon-11 + etp54 + + + DeviceInterfaceLink + ARISTA14T0 + Ethernet1 + r-tigon-11 + etp55 + + + DeviceInterfaceLink + ARISTA15T0 + Ethernet1 + r-tigon-11 + etp56 + + + DeviceInterfaceLink + ARISTA16T0 + Ethernet1 + r-tigon-11 + etp59 + + + DeviceInterfaceLink + ARISTA17T0 + Ethernet1 + r-tigon-11 + etp61 + + + DeviceInterfaceLink + ARISTA18T0 + Ethernet1 + r-tigon-11 + etp62 + + + DeviceInterfaceLink + ARISTA19T0 + Ethernet1 + r-tigon-11 + etp63 + + + DeviceInterfaceLink + ARISTA20T0 + Ethernet1 + r-tigon-11 + etp64 + + + + + r-tigon-11 + Mellanox-SN4600C-C64 + + 10.100.25.10 + + + + ARISTA16T0 + + 10.101.14.82 + + Arista-VM + + + ARISTA11T0 + + 10.101.14.77 + + Arista-VM + + + ARISTA10T0 + + 10.101.14.76 + + Arista-VM + + + ARISTA17T0 + + 10.101.14.83 + + Arista-VM + + + ARISTA09T0 + + 10.101.14.75 + + Arista-VM + + + ARISTA20T0 + + 10.101.14.86 + + Arista-VM + + + ARISTA08T0 + + 10.101.14.74 + + Arista-VM + + + ARISTA07T0 + + 10.101.14.73 + + Arista-VM + + + ARISTA07T2 + + 10.101.14.66 + + Arista-VM + + + ARISTA01T2 + + 10.101.14.63 + + Arista-VM + + + ARISTA01T0 + + 10.101.14.67 + + Arista-VM + + + ARISTA05T2 + + 10.101.14.65 + + Arista-VM + + + ARISTA05T0 + + 10.101.14.71 + + Arista-VM + + + ARISTA02T0 + + 10.101.14.68 + + Arista-VM + + + ARISTA03T0 + + 10.101.14.69 + + Arista-VM + + + ARISTA03T2 + + 10.101.14.64 + + Arista-VM + + + ARISTA04T0 + + 10.101.14.70 + + Arista-VM + + + ARISTA18T0 + + 10.101.14.84 + + Arista-VM + + + ARISTA15T0 + + 10.101.14.81 + + Arista-VM + + + ARISTA19T0 + + 10.101.14.85 + + Arista-VM + + + ARISTA14T0 + + 10.101.14.80 + + Arista-VM + + + ARISTA12T0 + + 10.101.14.78 + + Arista-VM + + + ARISTA13T0 + + 10.101.14.79 + + Arista-VM + + + ARISTA06T0 + + 10.101.14.72 + + Arista-VM + + + + + + true + + + DeviceInterface + + true + true + 1 + etp1 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp2 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp3 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp4 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp5 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp6 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp7 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp8 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp9 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp10 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp11 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp12 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp13 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp14 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp15 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp16 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp17 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp18 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp19 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp20 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp21 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp22 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp23 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp24 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp25 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp26 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp27 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp28 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp29 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp30 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp31 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp32 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp33 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp34 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp35 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp36 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp37 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp38 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp39 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp40 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp41 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp42 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp43 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp44 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp45 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp46 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp47 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp48 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp49 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp50 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp51 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp52 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp53 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp54 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp55 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp56 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp57 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp58 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp59 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp60 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp61 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp62 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + true + 1 + etp63 + + false + 0 + 0 + 50000 + + + DeviceInterface + + true + true + 1 + etp64 + + false + 0 + 0 + 50000 + + + true + 0 + Mellanox-SN4600C-C64 + + + + + + + r-tigon-11 + + + DeploymentId + + 1 + + + QosProfile + + Profile0 + + + DhcpResources + + 192.0.0.1;192.0.0.2;192.0.0.3;192.0.0.4 + + + NtpResources + + 10.100.25.32;10.102.202.2 + + + SnmpResources + + 10.0.0.9 + + + TacacsGroup + + testlab + + + TacacsServer + + 10.107.34.20 + + + ForcedMgmtRoutes + + 10.102.0.0/16;10.101.0.0/16 + + + ErspanDestinationIpv4 + + 10.0.0.7 + + + DownstreamRedundancyTypes + + Gemini + + + + + + + r-tigon-11 + Mellanox-SN4600C-C64 +
diff --git a/src/sonic-config-engine/tests/sample_output/py2/bgpd_frr.conf b/src/sonic-config-engine/tests/sample_output/py2/bgpd_frr.conf index a312e7532620..2c146698a960 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/bgpd_frr.conf +++ b/src/sonic-config-engine/tests/sample_output/py2/bgpd_frr.conf @@ -33,7 +33,9 @@ ip prefix-list PL_LoopbackV4 permit 10.1.0.32/32 ! ipv6 prefix-list PL_LoopbackV6 permit fc00:1::/64 ! -ip prefix-list LOCAL_VLAN_IPV4_PREFIX seq 5 permit 192.168.0.0/27 +ip prefix-list LOCAL_VLAN_IPV4_PREFIX seq 5 permit 192.168.200.0/27 +! +ip prefix-list LOCAL_VLAN_IPV4_PREFIX seq 10 permit 192.168.0.0/27 ! ! ! @@ -48,6 +50,7 @@ router bgp 65100 bgp graceful-restart restart-time 240 bgp graceful-restart bgp graceful-restart preserve-fw-state + bgp graceful-restart select-defer-time 45 ! bgp router-id 10.1.0.32 ! @@ -57,6 +60,7 @@ router bgp 65100 network fc00:1::32/64 exit-address-family ! + network 192.168.200.1/27 network 192.168.0.1/27 ! ! diff --git a/src/sonic-config-engine/tests/sample_output/py2/bgpd_frr_backend_asic.conf b/src/sonic-config-engine/tests/sample_output/py2/bgpd_frr_backend_asic.conf new file mode 100644 index 000000000000..20e1d2bc3241 --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py2/bgpd_frr_backend_asic.conf @@ -0,0 +1,75 @@ +! +! template: bgpd/bgpd.conf.j2 +! +! +! =========== Managed by sonic-cfggen DO NOT edit manually! ==================== +! generated by templates/quagga/bgpd.conf.j2 with config DB data +! file: bgpd.conf +! +! +! template: common/daemons.common.conf.j2 +! +hostname multi_npu_platform_01 +password zebra +enable password zebra +! +log syslog informational +log facility local4 +! +! end of template: common/daemons.common.conf.j2! +agentx +! +! +! +! template: bgpd/bgpd.main.conf.j2 +! +! bgp multiple-instance +! +! BGP configuration +! +! TSA configuration +! +ip prefix-list PL_LoopbackV4 permit 10.1.0.32/32 +! +ipv6 prefix-list PL_LoopbackV6 permit fc00:1::/64 +! +! +route-map HIDE_INTERNAL permit 10 + set community no-export +! +! +router bgp 65100 +! + bgp log-neighbor-changes + no bgp default ipv4-unicast + no bgp ebgp-requires-policy +! + bgp bestpath as-path multipath-relax +! +! + bgp router-id 8.0.0.5 +! + network 10.1.0.32/32 + network 8.0.0.5/32 route-map HIDE_INTERNAL +! + address-family ipv6 + network fc00:1::32/64 + exit-address-family + address-family ipv6 + network fd00:4::32/128 route-map HIDE_INTERNAL + exit-address-family +! +! +! +! + address-family ipv4 + maximum-paths 64 + exit-address-family + address-family ipv6 + maximum-paths 64 + exit-address-family +! +! end of template: bgpd/bgpd.main.conf.j2 +!! +! end of template: bgpd/bgpd.conf.j2 +! diff --git a/src/sonic-config-engine/tests/sample_output/py2/bgpd_frr_dualtor.conf b/src/sonic-config-engine/tests/sample_output/py2/bgpd_frr_dualtor.conf new file mode 100644 index 000000000000..364a2c34bcaa --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py2/bgpd_frr_dualtor.conf @@ -0,0 +1,79 @@ +! +! template: bgpd/bgpd.conf.j2 +! +! +! =========== Managed by sonic-cfggen DO NOT edit manually! ==================== +! generated by templates/quagga/bgpd.conf.j2 with config DB data +! file: bgpd.conf +! +! +! template: common/daemons.common.conf.j2 +! +hostname switch-t0 +password zebra +enable password zebra +! +log syslog informational +log facility local4 +! +! end of template: common/daemons.common.conf.j2! +agentx +! +! +! +! template: bgpd/bgpd.main.conf.j2 +! +! bgp multiple-instance +! +! BGP configuration +! +! TSA configuration +! +ip prefix-list PL_LoopbackV4 permit 10.1.0.32/32 +! +ipv6 prefix-list PL_LoopbackV6 permit fc00:1::/64 +! +ip prefix-list LOCAL_VLAN_IPV4_PREFIX seq 5 permit 192.168.200.0/27 +! +ip prefix-list LOCAL_VLAN_IPV4_PREFIX seq 10 permit 192.168.0.0/27 +! +! +! +router bgp 65100 +! + bgp log-neighbor-changes + no bgp default ipv4-unicast + no bgp ebgp-requires-policy + coalesce-time 10000 +! + bgp bestpath as-path multipath-relax +! + bgp graceful-restart restart-time 240 + bgp graceful-restart + bgp graceful-restart preserve-fw-state + bgp graceful-restart select-defer-time 45 +! + bgp router-id 10.1.0.32 +! + network 10.1.0.32/32 +! + address-family ipv6 + network fc00:1::32/64 + exit-address-family +! + network 192.168.200.1/27 + network 192.168.0.1/27 +! +! +! + address-family ipv4 + maximum-paths 64 + exit-address-family + address-family ipv6 + maximum-paths 64 + exit-address-family +! +! end of template: bgpd/bgpd.main.conf.j2 +!! +! end of template: bgpd/bgpd.conf.j2 +! diff --git a/src/sonic-config-engine/tests/sample_output/py2/bgpd_frr_frontend_asic.conf b/src/sonic-config-engine/tests/sample_output/py2/bgpd_frr_frontend_asic.conf new file mode 100644 index 000000000000..223b7c189e27 --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py2/bgpd_frr_frontend_asic.conf @@ -0,0 +1,81 @@ +! +! template: bgpd/bgpd.conf.j2 +! +! +! =========== Managed by sonic-cfggen DO NOT edit manually! ==================== +! generated by templates/quagga/bgpd.conf.j2 with config DB data +! file: bgpd.conf +! +! +! template: common/daemons.common.conf.j2 +! +hostname multi_npu_platform_01 +password zebra +enable password zebra +! +log syslog informational +log facility local4 +! +! end of template: common/daemons.common.conf.j2! +agentx +! +! +! +! template: bgpd/bgpd.main.conf.j2 +! +! bgp multiple-instance +! +! BGP configuration +! +! TSA configuration +! +ip prefix-list PL_LoopbackV4 permit 10.1.0.32/32 +! +ipv6 prefix-list PL_LoopbackV6 permit fc00:1::/64 +! +! +route-map HIDE_INTERNAL permit 10 + set community no-export +! +! +router bgp 65100 +! + bgp log-neighbor-changes + no bgp default ipv4-unicast + no bgp ebgp-requires-policy +! + bgp bestpath as-path multipath-relax +! +! + bgp router-id 10.1.0.32 +! + network 10.1.0.32/32 + network 8.0.0.0/32 route-map HIDE_INTERNAL +! + address-family ipv6 + network fc00:1::32/64 + exit-address-family + address-family ipv6 + network fd00:1::32/128 route-map HIDE_INTERNAL + exit-address-family +! +! +! + address-family ipv4 + redistribute connected route-map HIDE_INTERNAL + exit-address-family + address-family ipv6 + redistribute connected route-map HIDE_INTERNAL + exit-address-family +! + address-family ipv4 + maximum-paths 64 + exit-address-family + address-family ipv6 + maximum-paths 64 + exit-address-family +! +! end of template: bgpd/bgpd.main.conf.j2 +!! +! end of template: bgpd/bgpd.conf.j2 +! diff --git a/src/sonic-config-engine/tests/sample_output/py2/bgpd_quagga.conf b/src/sonic-config-engine/tests/sample_output/py2/bgpd_quagga.conf index f75d9de9a30e..43e8ade6a302 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/bgpd_quagga.conf +++ b/src/sonic-config-engine/tests/sample_output/py2/bgpd_quagga.conf @@ -23,10 +23,11 @@ router bgp 65100 bgp graceful-restart restart-time 240 bgp graceful-restart bgp router-id 10.1.0.32 + network 10.1.0.32/32 address-family ipv6 network fc00:1::32/64 exit-address-family - network 10.1.0.32/32 + network 192.168.200.1/27 network 192.168.0.1/27 neighbor 10.0.0.59 remote-as 64600 neighbor 10.0.0.59 description ARISTA02T1 diff --git a/src/sonic-config-engine/tests/sample_output/py2/buffer-arista7060-t0.json b/src/sonic-config-engine/tests/sample_output/py2/buffer-arista7060-t0.json new file mode 100644 index 000000000000..896016852140 --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py2/buffer-arista7060-t0.json @@ -0,0 +1,437 @@ +{ + "CABLE_LENGTH": { + "AZURE": { + "Ethernet0": "5m", + "Ethernet2": "5m", + "Ethernet4": "5m", + "Ethernet6": "5m", + "Ethernet8": "5m", + "Ethernet10": "5m", + "Ethernet12": "5m", + "Ethernet14": "5m", + "Ethernet16": "5m", + "Ethernet18": "5m", + "Ethernet20": "5m", + "Ethernet22": "5m", + "Ethernet24": "5m", + "Ethernet28": "5m", + "Ethernet32": "5m", + "Ethernet36": "5m", + "Ethernet40": "5m", + "Ethernet42": "5m", + "Ethernet44": "5m", + "Ethernet46": "5m", + "Ethernet48": "5m", + "Ethernet50": "5m", + "Ethernet52": "5m", + "Ethernet54": "5m", + "Ethernet56": "5m", + "Ethernet58": "5m", + "Ethernet60": "5m", + "Ethernet62": "5m", + "Ethernet64": "5m", + "Ethernet66": "5m", + "Ethernet68": "5m", + "Ethernet70": "5m", + "Ethernet72": "5m", + "Ethernet74": "5m", + "Ethernet76": "5m", + "Ethernet78": "5m", + "Ethernet80": "5m", + "Ethernet82": "5m", + "Ethernet84": "5m", + "Ethernet86": "5m", + "Ethernet88": "5m", + "Ethernet92": "5m", + "Ethernet96": "5m", + "Ethernet100": "5m", + "Ethernet104": "5m", + "Ethernet106": "5m", + "Ethernet108": "5m", + "Ethernet110": "5m", + "Ethernet112": "40m", + "Ethernet114": "5m", + "Ethernet116": "40m", + "Ethernet118": "5m", + "Ethernet120": "40m", + "Ethernet122": "5m", + "Ethernet124": "40m", + "Ethernet126": "5m" + } + }, + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "10875072", + "type": "ingress", + "mode": "dynamic", + "xoff": "4194112" + }, + "egress_lossy_pool": { + "size": "9243812", + "type": "egress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "15982720", + "type": "egress", + "mode": "static" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool": "[BUFFER_POOL|ingress_lossless_pool]", + "size": "0", + "dynamic_th": "3" + }, + "egress_lossless_profile": { + "pool": "[BUFFER_POOL|egress_lossless_pool]", + "size": "1518", + "static_th": "15982720" + }, + "egress_lossy_profile": { + "pool": "[BUFFER_POOL|egress_lossy_pool]", + "size": "1518", + "dynamic_th": "3" + } + }, + "BUFFER_PG": { + "Ethernet112|0": { + "profile": "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet116|0": { + "profile": "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet120|0": { + "profile": "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet124|0": { + "profile": "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet4|0": { + "profile": "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet8|0": { + "profile": "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet12|0": { + "profile": "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet16|0": { + "profile": "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet20|0": { + "profile": "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet24|0": { + "profile": "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet28|0": { + "profile": "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet32|0": { + "profile": "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet36|0": { + "profile": "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet40|0": { + "profile": "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet44|0": { + "profile": "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet48|0": { + "profile": "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet52|0": { + "profile": "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet56|0": { + "profile": "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet60|0": { + "profile": "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet64|0": { + "profile": "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet68|0": { + "profile": "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet72|0": { + "profile": "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet76|0": { + "profile": "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet80|0": { + "profile": "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet84|0": { + "profile": "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet88|0": { + "profile": "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet92|0": { + "profile": "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet96|0": { + "profile": "[BUFFER_PROFILE|ingress_lossy_profile]" + } + }, + "BUFFER_QUEUE": { + "Ethernet112|3-4": { + "profile": "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet116|3-4": { + "profile": "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet120|3-4": { + "profile": "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet124|3-4": { + "profile": "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet4|3-4": { + "profile": "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet8|3-4": { + "profile": "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet12|3-4": { + "profile": "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet16|3-4": { + "profile": "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet20|3-4": { + "profile": "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet24|3-4": { + "profile": "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet28|3-4": { + "profile": "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet32|3-4": { + "profile": "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet36|3-4": { + "profile": "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet40|3-4": { + "profile": "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet44|3-4": { + "profile": "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet48|3-4": { + "profile": "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet52|3-4": { + "profile": "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet56|3-4": { + "profile": "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet60|3-4": { + "profile": "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet64|3-4": { + "profile": "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet68|3-4": { + "profile": "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet72|3-4": { + "profile": "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet76|3-4": { + "profile": "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet80|3-4": { + "profile": "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet84|3-4": { + "profile": "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet88|3-4": { + "profile": "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet92|3-4": { + "profile": "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet96|3-4": { + "profile": "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet112|0-2": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet116|0-2": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet120|0-2": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet124|0-2": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet4|0-2": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet8|0-2": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet12|0-2": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet16|0-2": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet20|0-2": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet24|0-2": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet28|0-2": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet32|0-2": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet36|0-2": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet40|0-2": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet44|0-2": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet48|0-2": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet52|0-2": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet56|0-2": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet60|0-2": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet64|0-2": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet68|0-2": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet72|0-2": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet76|0-2": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet80|0-2": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet84|0-2": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet88|0-2": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet92|0-2": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet96|0-2": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet112|5-6": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet116|5-6": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet120|5-6": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet124|5-6": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet4|5-6": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet8|5-6": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet12|5-6": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet16|5-6": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet20|5-6": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet24|5-6": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet28|5-6": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet32|5-6": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet36|5-6": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet40|5-6": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet44|5-6": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet48|5-6": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet52|5-6": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet56|5-6": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet60|5-6": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet64|5-6": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet68|5-6": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet72|5-6": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet76|5-6": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet80|5-6": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet84|5-6": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet88|5-6": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet92|5-6": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet96|5-6": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + } + } +} diff --git a/src/sonic-config-engine/tests/sample_output/py2/buffers-dell6100.json b/src/sonic-config-engine/tests/sample_output/py2/buffers-dell6100.json index 56de7500c1ad..8c933783b4b2 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/buffers-dell6100.json +++ b/src/sonic-config-engine/tests/sample_output/py2/buffers-dell6100.json @@ -13,10 +13,11 @@ "Ethernet4": "5m", "Ethernet5": "5m", "Ethernet46": "5m", - "Ethernet34": "5m", + "Ethernet29": "5m", "Ethernet22": "5m", "Ethernet58": "5m", "Ethernet59": "5m", + "Ethernet28": "5m", "Ethernet50": "5m", "Ethernet51": "5m", "Ethernet52": "5m", @@ -41,6 +42,7 @@ "Ethernet32": "5m", "Ethernet33": "5m", "Ethernet30": "5m", + "Ethernet34": "5m", "Ethernet31": "5m", "Ethernet49": "5m", "Ethernet48": "5m", @@ -52,8 +54,8 @@ "Ethernet42": "5m", "Ethernet41": "5m", "Ethernet40": "5m", - "Ethernet29": "5m", - "Ethernet28": "5m", + "Ethernet65": "5m", + "Ethernet64": "5m", "Ethernet61": "5m", "Ethernet60": "5m", "Ethernet63": "5m", @@ -91,7 +93,7 @@ "ingress_lossy_profile": { "pool":"[BUFFER_POOL|ingress_lossless_pool]", "size":"0", - "dynamic_th":"3" + "static_th":"10875072" }, "egress_lossless_profile": { "pool":"[BUFFER_POOL|egress_lossless_pool]", diff --git a/src/sonic-config-engine/tests/sample_output/py2/buffers-mellanox2410.json b/src/sonic-config-engine/tests/sample_output/py2/buffers-mellanox2410.json new file mode 100644 index 000000000000..9c1638b9a83c --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py2/buffers-mellanox2410.json @@ -0,0 +1,1163 @@ + +{ + "CABLE_LENGTH": { + "AZURE": { + "Ethernet180": "5m", + "Ethernet8": "300m", + "Ethernet44": "300m", + "Ethernet184": "5m", + "Ethernet188": "5m", + "Ethernet0": "300m", + "Ethernet4": "300m", + "Ethernet108": "40m", + "Ethernet100": "40m", + "Ethernet128": "5m", + "Ethernet104": "40m", + "Ethernet40": "300m", + "Ethernet96": "40m", + "Ethernet124": "40m", + "Ethernet148": "5m", + "Ethernet92": "40m", + "Ethernet120": "40m", + "Ethernet220": "5m", + "Ethernet144": "5m", + "Ethernet52": "300m", + "Ethernet160": "5m", + "Ethernet140": "5m", + "Ethernet56": "300m", + "Ethernet164": "5m", + "Ethernet76": "40m", + "Ethernet72": "40m", + "Ethernet64": "40m", + "Ethernet32": "300m", + "Ethernet16": "300m", + "Ethernet36": "300m", + "Ethernet12": "300m", + "Ethernet196": "5m", + "Ethernet192": "5m", + "Ethernet200": "5m", + "Ethernet68": "40m", + "Ethernet168": "5m", + "Ethernet24": "300m", + "Ethernet116": "40m", + "Ethernet80": "40m", + "Ethernet112": "40m", + "Ethernet84": "40m", + "Ethernet152": "5m", + "Ethernet136": "5m", + "Ethernet156": "5m", + "Ethernet204": "5m", + "Ethernet132": "5m", + "Ethernet48": "300m", + "Ethernet172": "5m", + "Ethernet216": "5m", + "Ethernet176": "5m", + "Ethernet212": "5m", + "Ethernet28": "300m", + "Ethernet88": "40m", + "Ethernet60": "300m", + "Ethernet20": "300m", + "Ethernet208": "5m" + } + }, + + "BUFFER_POOL": { + "ingress_zero_pool" : { + "mode": "static", + "type": "ingress", + "size": "0" + }, + "ingress_lossless_pool": { + "size": "3302912", + "type": "ingress", + "mode": "dynamic" + }, + "ingress_lossy_pool": { + "size": "3302912", + "type": "ingress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "13945824", + "type": "egress", + "mode": "dynamic" + }, + "egress_lossy_pool": { + "size": "3302912", + "type": "egress", + "mode": "dynamic" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_pg_zero_profile" : { + "pool":"[BUFFER_POOL|ingress_zero_pool]", + "size":"0", + "static_th":"0" + }, + "ingress_lossless_zero_profile" : { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "dynamic_th":"-8" + }, + "ingress_lossy_zero_profile" : { + "pool":"[BUFFER_POOL|ingress_lossy_pool]", + "size":"0", + "dynamic_th":"-8" + }, + "egress_lossless_zero_profile" : { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"0", + "dynamic_th":"-8" + }, + "egress_lossy_zero_profile" : { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"0", + "dynamic_th":"-8" + }, + "ingress_lossless_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "dynamic_th":"7" + }, + "ingress_lossy_profile": { + "pool":"[BUFFER_POOL|ingress_lossy_pool]", + "size":"0", + "dynamic_th":"3" + }, + "egress_lossless_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"0", + "dynamic_th":"7" + }, + "egress_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"9216", + "dynamic_th":"7" + }, + "q_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"0", + "dynamic_th":"3" + } + }, + "BUFFER_PORT_INGRESS_PROFILE_LIST": { + "Ethernet8": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet0": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet4": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet108": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet100": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet104": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet96": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet124": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet92": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet120": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet52": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet56": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet76": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet72": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet32": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet16": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet36": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet12": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet28": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet88": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet24": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet116": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet80": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet112": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet84": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet48": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet44": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet40": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet64": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet60": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet20": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet68": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" + } +, + "Ethernet180": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile],[BUFFER_PROFILE|ingress_lossy_zero_profile]" + }, + "Ethernet184": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile],[BUFFER_PROFILE|ingress_lossy_zero_profile]" + }, + "Ethernet188": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile],[BUFFER_PROFILE|ingress_lossy_zero_profile]" + }, + "Ethernet128": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile],[BUFFER_PROFILE|ingress_lossy_zero_profile]" + }, + "Ethernet148": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile],[BUFFER_PROFILE|ingress_lossy_zero_profile]" + }, + "Ethernet220": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile],[BUFFER_PROFILE|ingress_lossy_zero_profile]" + }, + "Ethernet144": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile],[BUFFER_PROFILE|ingress_lossy_zero_profile]" + }, + "Ethernet160": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile],[BUFFER_PROFILE|ingress_lossy_zero_profile]" + }, + "Ethernet140": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile],[BUFFER_PROFILE|ingress_lossy_zero_profile]" + }, + "Ethernet164": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile],[BUFFER_PROFILE|ingress_lossy_zero_profile]" + }, + "Ethernet196": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile],[BUFFER_PROFILE|ingress_lossy_zero_profile]" + }, + "Ethernet192": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile],[BUFFER_PROFILE|ingress_lossy_zero_profile]" + }, + "Ethernet200": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile],[BUFFER_PROFILE|ingress_lossy_zero_profile]" + }, + "Ethernet168": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile],[BUFFER_PROFILE|ingress_lossy_zero_profile]" + }, + "Ethernet152": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile],[BUFFER_PROFILE|ingress_lossy_zero_profile]" + }, + "Ethernet136": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile],[BUFFER_PROFILE|ingress_lossy_zero_profile]" + }, + "Ethernet156": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile],[BUFFER_PROFILE|ingress_lossy_zero_profile]" + }, + "Ethernet204": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile],[BUFFER_PROFILE|ingress_lossy_zero_profile]" + }, + "Ethernet132": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile],[BUFFER_PROFILE|ingress_lossy_zero_profile]" + }, + "Ethernet172": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile],[BUFFER_PROFILE|ingress_lossy_zero_profile]" + }, + "Ethernet216": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile],[BUFFER_PROFILE|ingress_lossy_zero_profile]" + }, + "Ethernet176": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile],[BUFFER_PROFILE|ingress_lossy_zero_profile]" + }, + "Ethernet212": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile],[BUFFER_PROFILE|ingress_lossy_zero_profile]" + }, + "Ethernet208": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile],[BUFFER_PROFILE|ingress_lossy_zero_profile]" + } + }, + "BUFFER_PORT_EGRESS_PROFILE_LIST": { + "Ethernet8": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet0": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet4": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet108": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet100": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet104": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet96": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet124": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet92": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet120": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet52": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet56": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet76": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet72": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet32": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet16": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet36": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet12": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet28": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet88": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet24": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet116": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet80": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet112": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet84": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet48": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet44": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet40": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet64": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet60": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet20": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet68": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + } +, + "Ethernet180": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet184": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet188": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet128": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet148": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet220": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet144": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet160": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet140": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet164": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet196": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet192": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet200": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet168": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet152": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet136": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet156": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet204": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet132": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet172": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet216": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet176": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet212": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet208": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + } + }, + "BUFFER_PG": { + "Ethernet8|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet0|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet4|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet108|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet100|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet104|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet96|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet124|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet92|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet120|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet52|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet56|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet76|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet72|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet32|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet16|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet36|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet12|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet28|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet88|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet24|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet116|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet80|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet112|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet84|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet48|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet44|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet40|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet64|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet60|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet20|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet68|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + } +, "Ethernet180|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet184|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet188|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet128|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet148|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet220|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet144|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet160|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet140|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet164|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet196|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet192|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet200|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet168|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet152|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet136|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet156|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet204|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet132|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet172|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet216|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet176|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet212|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet208|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + } + }, + + "BUFFER_QUEUE": { + "Ethernet8|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet0|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet4|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet108|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet100|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet104|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet96|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet124|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet92|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet120|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet52|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet56|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet76|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet72|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet32|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet16|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet36|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet12|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet28|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet88|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet24|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet116|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet80|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet112|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet84|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet48|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet44|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet40|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet64|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet60|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet20|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet68|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet8|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet0|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet4|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet108|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet100|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet104|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet96|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet124|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet92|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet120|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet52|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet56|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet76|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet72|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet32|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet16|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet36|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet12|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet28|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet88|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet24|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet116|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet80|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet112|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet84|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet48|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet44|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet40|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet64|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet60|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet20|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet68|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet8|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet0|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet4|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet108|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet100|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet104|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet96|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet124|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet92|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet120|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet52|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet56|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet76|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet72|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet32|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet16|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet36|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet12|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet28|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet88|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet24|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet116|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet80|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet112|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet84|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet48|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet44|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet40|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet64|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet60|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet20|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet68|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + } +, + "Ethernet180|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet184|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet188|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet128|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet148|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet220|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet144|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet160|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet140|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet164|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet196|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet192|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet200|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet168|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet152|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet136|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet156|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet204|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet132|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet172|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet216|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet176|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet212|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet208|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet180|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet184|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet188|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet128|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet148|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet220|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet144|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet160|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet140|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet164|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet196|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet192|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet200|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet168|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet152|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet136|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet156|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet204|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet132|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet172|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet216|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet176|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet212|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet208|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet180|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet184|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet188|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet128|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet148|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet220|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet144|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet160|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet140|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet164|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet196|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet192|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet200|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet168|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet152|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet136|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet156|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet204|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet132|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet172|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet216|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet176|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet212|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet208|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + } + } +} diff --git a/src/sonic-config-engine/tests/sample_output/py2/buffers-mellanox2700.json b/src/sonic-config-engine/tests/sample_output/py2/buffers-mellanox2700.json new file mode 100644 index 000000000000..21c14374d42a --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py2/buffers-mellanox2700.json @@ -0,0 +1,1154 @@ + +{ + "CABLE_LENGTH": { + "AZURE": { + "Ethernet8": "5m", + "Ethernet2": "5m", + "Ethernet0": "5m", + "Ethernet6": "5m", + "Ethernet4": "5m", + "Ethernet108": "5m", + "Ethernet100": "5m", + "Ethernet104": "5m", + "Ethernet106": "5m", + "Ethernet58": "5m", + "Ethernet126": "5m", + "Ethernet96": "5m", + "Ethernet124": "5m", + "Ethernet122": "5m", + "Ethernet92": "5m", + "Ethernet120": "5m", + "Ethernet50": "5m", + "Ethernet52": "5m", + "Ethernet54": "5m", + "Ethernet56": "5m", + "Ethernet76": "5m", + "Ethernet74": "5m", + "Ethernet18": "5m", + "Ethernet70": "40m", + "Ethernet32": "5m", + "Ethernet72": "5m", + "Ethernet16": "5m", + "Ethernet36": "5m", + "Ethernet78": "5m", + "Ethernet60": "5m", + "Ethernet28": "5m", + "Ethernet62": "5m", + "Ethernet14": "5m", + "Ethernet88": "5m", + "Ethernet118": "5m", + "Ethernet24": "5m", + "Ethernet116": "5m", + "Ethernet82": "5m", + "Ethernet114": "5m", + "Ethernet80": "5m", + "Ethernet112": "5m", + "Ethernet86": "5m", + "Ethernet110": "5m", + "Ethernet84": "5m", + "Ethernet48": "5m", + "Ethernet10": "5m", + "Ethernet44": "5m", + "Ethernet42": "5m", + "Ethernet40": "5m", + "Ethernet64": "40m", + "Ethernet66": "40m", + "Ethernet12": "5m", + "Ethernet46": "5m", + "Ethernet20": "5m", + "Ethernet22": "5m", + "Ethernet68": "40m" + } + }, + + "BUFFER_POOL": { + "ingress_zero_pool" : { + "mode": "static", + "type": "ingress", + "size": "0" + }, + "ingress_lossless_pool": { + "size": "7719936", + "xoff": "1032192", + "type": "ingress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "13945824", + "type": "egress", + "mode": "dynamic" + }, + "egress_lossy_pool": { + "size": "7719936", + "type": "egress", + "mode": "dynamic" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_pg_zero_profile" : { + "pool":"[BUFFER_POOL|ingress_zero_pool]", + "size":"0", + "static_th":"0" + }, + "ingress_lossless_zero_profile" : { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "dynamic_th":"-8" + }, + "egress_lossless_zero_profile" : { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"0", + "dynamic_th":"-8" + }, + "egress_lossy_zero_profile" : { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"0", + "dynamic_th":"-8" + }, + "ingress_lossless_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "dynamic_th":"7" + }, + "ingress_lossy_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "dynamic_th":"3" + }, + "egress_lossless_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"0", + "dynamic_th":"7" + }, + "egress_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"9216", + "dynamic_th":"7" + }, + "q_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"0", + "dynamic_th":"3" + } + }, + "BUFFER_PORT_INGRESS_PROFILE_LIST": { + "Ethernet8": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet2": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet6": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet4": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet28": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet50": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet52": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet54": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet56": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet18": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet70": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet14": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet16": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet10": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet12": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet32": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet24": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet48": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet36": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet44": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet42": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet40": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet64": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet66": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet46": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet20": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet22": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet68": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + } +, + "Ethernet0": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet108": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet100": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet104": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet106": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet58": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet126": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet96": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet124": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet122": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet92": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet120": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet76": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet74": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet72": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet78": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet60": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet62": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet88": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet118": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet116": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet82": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet114": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet80": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet112": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet86": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet110": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet84": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + } + }, + "BUFFER_PORT_EGRESS_PROFILE_LIST": { + "Ethernet8": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet2": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet6": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet4": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet28": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet50": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet52": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet54": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet56": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet18": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet70": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet14": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet16": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet10": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet12": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet32": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet24": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet48": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet36": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet44": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet42": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet40": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet64": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet66": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet46": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet20": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet22": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet68": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + } +, + "Ethernet0": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet108": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet100": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet104": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet106": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet58": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet126": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet96": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet124": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet122": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet92": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet120": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet76": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet74": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet72": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet78": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet60": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet62": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet88": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet118": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet116": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet82": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet114": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet80": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet112": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet86": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet110": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet84": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + } + }, + "BUFFER_PG": { + "Ethernet8|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet2|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet6|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet4|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet28|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet50|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet52|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet54|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet56|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet18|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet70|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet14|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet16|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet10|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet12|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet32|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet24|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet48|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet36|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet44|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet42|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet40|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet64|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet66|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet46|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet20|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet22|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet68|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + } +, "Ethernet0|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet108|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet100|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet104|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet106|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet58|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet126|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet96|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet124|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet122|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet92|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet120|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet76|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet74|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet72|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet78|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet60|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet62|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet88|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet118|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet116|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet82|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet114|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet80|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet112|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet86|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet110|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet84|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + } + }, + + "BUFFER_QUEUE": { + "Ethernet8|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet2|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet6|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet4|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet28|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet50|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet52|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet54|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet56|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet18|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet70|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet14|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet16|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet10|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet12|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet32|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet24|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet48|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet36|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet44|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet42|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet40|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet64|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet66|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet46|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet20|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet22|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet68|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet8|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet2|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet6|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet4|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet28|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet50|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet52|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet54|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet56|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet18|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet70|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet14|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet16|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet10|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet12|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet32|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet24|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet48|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet36|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet44|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet42|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet40|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet64|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet66|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet46|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet20|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet22|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet68|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet8|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet2|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet6|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet4|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet28|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet50|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet52|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet54|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet56|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet18|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet70|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet14|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet16|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet10|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet12|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet32|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet24|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet48|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet36|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet44|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet42|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet40|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet64|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet66|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet46|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet20|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet22|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet68|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + } +, + "Ethernet0|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet108|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet100|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet104|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet106|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet58|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet126|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet96|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet124|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet122|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet92|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet120|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet76|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet74|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet72|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet78|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet60|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet62|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet88|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet118|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet116|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet82|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet114|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet80|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet112|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet86|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet110|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet84|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet0|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet108|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet100|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet104|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet106|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet58|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet126|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet96|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet124|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet122|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet92|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet120|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet76|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet74|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet72|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet78|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet60|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet62|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet88|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet118|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet116|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet82|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet114|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet80|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet112|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet86|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet110|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet84|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet0|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet108|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet100|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet104|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet106|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet58|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet126|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet96|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet124|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet122|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet92|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet120|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet76|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet74|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet72|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet78|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet60|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet62|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet88|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet118|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet116|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet82|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet114|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet80|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet112|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet86|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet110|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet84|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + } + } +} diff --git a/src/sonic-config-engine/tests/sample_output/py2/docker-dhcp-relay-no-ip-helper.supervisord.conf b/src/sonic-config-engine/tests/sample_output/py2/docker-dhcp-relay-no-ip-helper.supervisord.conf new file mode 100644 index 000000000000..c36dbe22533b --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py2/docker-dhcp-relay-no-ip-helper.supervisord.conf @@ -0,0 +1,80 @@ +[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 + +[eventlistener:supervisor-proc-exit-listener] +command=/usr/bin/supervisor-proc-exit-listener --container-name dhcp_relay +events=PROCESS_STATE_EXITED,PROCESS_STATE_RUNNING +autostart=true +autorestart=unexpected +buffer_size=1024 + +[program:rsyslogd] +command=/usr/sbin/rsyslogd -n -iNONE +priority=1 +autostart=false +autorestart=false +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 + +[group:dhcp-relay] +programs=isc-dhcpv4-relay-Vlan1000,dhcp6relay + + +[program:isc-dhcpv4-relay-Vlan1000] +command=/usr/sbin/dhcrelay -d -m discard -a %%h:%%p %%P --name-alias-map-file /tmp/port-name-alias-map.txt -id Vlan1000 -iu Vlan2000 -iu PortChannel02 -iu PortChannel03 -iu PortChannel04 -iu PortChannel01 192.0.0.1 192.0.0.2 +priority=3 +autostart=false +autorestart=false +stdout_logfile=syslog +stderr_logfile=syslog +dependent_startup=true +dependent_startup_wait_for=start:exited + + +[program:dhcp6relay] +command=/usr/sbin/dhcp6relay +priority=3 +autostart=false +autorestart=false +stdout_logfile=syslog +stderr_logfile=syslog +dependent_startup=true +dependent_startup_wait_for=start:exited + +[group:dhcpmon] +programs=dhcpmon-Vlan1000 + +[program:dhcpmon-Vlan1000] +command=/usr/sbin/dhcpmon -id Vlan1000 -iu Vlan2000 -iu PortChannel02 -iu PortChannel03 -iu PortChannel04 -iu PortChannel01 -im eth0 +priority=4 +autostart=false +autorestart=false +stdout_logfile=syslog +stderr_logfile=syslog +dependent_startup=true +dependent_startup_wait_for=isc-dhcpv4-relay-Vlan1000:running + + diff --git a/src/sonic-config-engine/tests/sample_output/py2/docker-dhcp-relay.supervisord.conf b/src/sonic-config-engine/tests/sample_output/py2/docker-dhcp-relay.supervisord.conf index a213a2517866..9d4a9d22de47 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/docker-dhcp-relay.supervisord.conf +++ b/src/sonic-config-engine/tests/sample_output/py2/docker-dhcp-relay.supervisord.conf @@ -10,13 +10,14 @@ autorestart=unexpected startretries=0 exitcodes=0,3 events=PROCESS_STATE -buffer_size=50 +buffer_size=1024 [eventlistener:supervisor-proc-exit-listener] command=/usr/bin/supervisor-proc-exit-listener --container-name dhcp_relay -events=PROCESS_STATE_EXITED +events=PROCESS_STATE_EXITED,PROCESS_STATE_RUNNING autostart=true autorestart=unexpected +buffer_size=1024 [program:rsyslogd] command=/usr/sbin/rsyslogd -n -iNONE @@ -38,11 +39,22 @@ stderr_logfile=syslog dependent_startup=true dependent_startup_wait_for=rsyslogd:running -[group:isc-dhcp-relay] -programs=isc-dhcp-relay-Vlan1000 +[group:dhcp-relay] +programs=isc-dhcpv4-relay-Vlan1000,isc-dhcpv4-relay-Vlan2000,dhcp6relay -[program:isc-dhcp-relay-Vlan1000] -command=/usr/sbin/dhcrelay -d -m discard -a %%h:%%p %%P --name-alias-map-file /tmp/port-name-alias-map.txt -id Vlan1000 -iu PortChannel02 -iu PortChannel03 -iu PortChannel04 -iu PortChannel01 192.0.0.1 192.0.0.2 + +[program:isc-dhcpv4-relay-Vlan1000] +command=/usr/sbin/dhcrelay -d -m discard -a %%h:%%p %%P --name-alias-map-file /tmp/port-name-alias-map.txt -id Vlan1000 -iu Vlan2000 -iu PortChannel02 -iu PortChannel03 -iu PortChannel04 -iu PortChannel01 192.0.0.1 192.0.0.2 +priority=3 +autostart=false +autorestart=false +stdout_logfile=syslog +stderr_logfile=syslog +dependent_startup=true +dependent_startup_wait_for=start:exited + +[program:isc-dhcpv4-relay-Vlan2000] +command=/usr/sbin/dhcrelay -d -m discard -a %%h:%%p %%P --name-alias-map-file /tmp/port-name-alias-map.txt -id Vlan2000 -iu Vlan1000 -iu PortChannel02 -iu PortChannel03 -iu PortChannel04 -iu PortChannel01 192.0.0.3 192.0.0.4 priority=3 autostart=false autorestart=false @@ -52,18 +64,37 @@ dependent_startup=true dependent_startup_wait_for=start:exited +[program:dhcp6relay] +command=/usr/sbin/dhcp6relay +priority=3 +autostart=false +autorestart=false +stdout_logfile=syslog +stderr_logfile=syslog +dependent_startup=true +dependent_startup_wait_for=start:exited + [group:dhcpmon] -programs=dhcpmon-Vlan1000 +programs=dhcpmon-Vlan1000,dhcpmon-Vlan2000 [program:dhcpmon-Vlan1000] -command=/usr/sbin/dhcpmon -id Vlan1000 -iu PortChannel02 -iu PortChannel03 -iu PortChannel04 -iu PortChannel01 -im eth0 +command=/usr/sbin/dhcpmon -id Vlan1000 -iu Vlan2000 -iu PortChannel02 -iu PortChannel03 -iu PortChannel04 -iu PortChannel01 -im eth0 priority=4 autostart=false autorestart=false stdout_logfile=syslog stderr_logfile=syslog dependent_startup=true -dependent_startup_wait_for=isc-dhcp-relay-Vlan1000:running +dependent_startup_wait_for=isc-dhcpv4-relay-Vlan1000:running +[program:dhcpmon-Vlan2000] +command=/usr/sbin/dhcpmon -id Vlan2000 -iu Vlan1000 -iu PortChannel02 -iu PortChannel03 -iu PortChannel04 -iu PortChannel01 -im eth0 +priority=4 +autostart=false +autorestart=false +stdout_logfile=syslog +stderr_logfile=syslog +dependent_startup=true +dependent_startup_wait_for=isc-dhcpv4-relay-Vlan2000:running diff --git a/src/sonic-config-engine/tests/sample_output/py2/frr.conf b/src/sonic-config-engine/tests/sample_output/py2/frr.conf index 43df66c3f4e7..7d985db93b97 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/frr.conf +++ b/src/sonic-config-engine/tests/sample_output/py2/frr.conf @@ -35,10 +35,6 @@ link-detect ! !! ! -! set static default route to mgmt gateway as a backup to learned default -ip route 0.0.0.0/0 10.0.0.1 200 -!! -! ! ! add static ipv6 /64 loopback route to allow bgpd to advertise the loopback route prefix ipv6 route fc00:1::/64 Loopback0 @@ -56,7 +52,9 @@ ip prefix-list PL_LoopbackV4 permit 10.1.0.32/32 ! ipv6 prefix-list PL_LoopbackV6 permit fc00:1::/64 ! -ip prefix-list LOCAL_VLAN_IPV4_PREFIX seq 5 permit 192.168.0.0/27 +ip prefix-list LOCAL_VLAN_IPV4_PREFIX seq 5 permit 192.168.200.0/27 +! +ip prefix-list LOCAL_VLAN_IPV4_PREFIX seq 10 permit 192.168.0.0/27 ! ! ! @@ -71,6 +69,7 @@ router bgp 65100 bgp graceful-restart restart-time 240 bgp graceful-restart bgp graceful-restart preserve-fw-state + bgp graceful-restart select-defer-time 45 ! bgp router-id 10.1.0.32 ! @@ -80,6 +79,7 @@ router bgp 65100 network fc00:1::32/64 exit-address-family ! + network 192.168.200.1/27 network 192.168.0.1/27 ! ! diff --git a/src/sonic-config-engine/tests/sample_output/py2/ipinip.json b/src/sonic-config-engine/tests/sample_output/py2/ipinip.json index db70ea403121..0a01058463bd 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/ipinip.json +++ b/src/sonic-config-engine/tests/sample_output/py2/ipinip.json @@ -2,8 +2,8 @@ { "TUNNEL_DECAP_TABLE:IPINIP_TUNNEL" : { "tunnel_type":"IPINIP", - "dst_ip":"10.0.0.56,10.0.0.58,10.0.0.60,10.0.0.62,10.1.0.32,192.168.0.1", - "dscp_mode":"pipe", + "dst_ip":"10.0.0.56,10.0.0.58,10.0.0.60,10.0.0.62,10.1.0.32,10.21.0.64,10.21.64.2,192.168.0.1,192.168.200.1", + "dscp_mode":"uniform", "ecn_mode":"copy_from_outer", "ttl_mode":"pipe" }, @@ -14,7 +14,7 @@ "TUNNEL_DECAP_TABLE:IPINIP_V6_TUNNEL" : { "tunnel_type":"IPINIP", "dst_ip":"fc00:1::32,fc00::71,fc00::75,fc00::79,fc00::7d", - "dscp_mode":"pipe", + "dscp_mode":"uniform", "ecn_mode":"copy_from_outer", "ttl_mode":"pipe" }, diff --git a/src/sonic-config-engine/tests/sample_output/py2/l1_intfs.json b/src/sonic-config-engine/tests/sample_output/py2/l1_intfs.json new file mode 100644 index 000000000000..bc2d533e87a1 --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py2/l1_intfs.json @@ -0,0 +1,261 @@ +{ + "DEVICE_METADATA": {"localhost": {"hwsku": "32x1000Gb"}}, + "PORT": { + "Ethernet0": { + "admin_status": "up", + "alias": "Ethernet0", + "index": "0", + "lanes": "1296,1297,1298,1299", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet1": { + "admin_status": "up", + "alias": "Ethernet1", + "index": "1", + "lanes": "1300,1301,1302,1303", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet10": { + "admin_status": "up", + "alias": "Ethernet10", + "index": "10", + "lanes": "772,773,774,775", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet11": { + "admin_status": "up", + "alias": "Ethernet11", + "index": "11", + "lanes": "768,769,770,771", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet12": { + "admin_status": "up", + "alias": "Ethernet12", + "index": "12", + "lanes": "780,781,782,783", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet13": { + "admin_status": "up", + "alias": "Ethernet13", + "index": "13", + "lanes": "776,777,778,779", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet14": { + "admin_status": "up", + "alias": "Ethernet14", + "index": "14", + "lanes": "528,529,530,531", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet15": { + "admin_status": "up", + "alias": "Ethernet15", + "index": "15", + "lanes": "532,533,534,535", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet16": { + "admin_status": "up", + "alias": "Ethernet16", + "index": "16", + "lanes": "520,521,522,523", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet17": { + "admin_status": "up", + "alias": "Ethernet17", + "index": "17", + "lanes": "524,525,526,527", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet18": { + "admin_status": "up", + "alias": "Ethernet18", + "index": "18", + "lanes": "512,513,514,515", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet19": { + "admin_status": "up", + "alias": "Ethernet19", + "index": "19", + "lanes": "516,517,518,519", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet2": { + "admin_status": "up", + "alias": "Ethernet2", + "index": "2", + "lanes": "1288,1289,1290,1291", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet20": { + "admin_status": "up", + "alias": "Ethernet20", + "index": "20", + "lanes": "272,273,274,275", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet21": { + "admin_status": "up", + "alias": "Ethernet21", + "index": "21", + "lanes": "276,277,278,279", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet22": { + "admin_status": "up", + "alias": "Ethernet22", + "index": "22", + "lanes": "264,265,266,267", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet23": { + "admin_status": "up", + "alias": "Ethernet23", + "index": "23", + "lanes": "268,269,270,271", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet24": { + "admin_status": "up", + "alias": "Ethernet24", + "index": "24", + "lanes": "256,257,258,259", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet25": { + "admin_status": "up", + "alias": "Ethernet25", + "index": "25", + "lanes": "260,261,262,263", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet26": { + "admin_status": "up", + "alias": "Ethernet26", + "index": "26", + "lanes": "16,17,18,19", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet27": { + "admin_status": "up", + "alias": "Ethernet27", + "index": "27", + "lanes": "20,21,22,23", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet28": { + "admin_status": "up", + "alias": "Ethernet28", + "index": "28", + "lanes": "8,9,10,11", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet29": { + "admin_status": "up", + "alias": "Ethernet29", + "index": "29", + "lanes": "12,13,14,15", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet3": { + "admin_status": "up", + "alias": "Ethernet3", + "index": "3", + "lanes": "1292,1293,1294,1295", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet30": { + "admin_status": "up", + "alias": "Ethernet30", + "index": "30", + "lanes": "0,1,2,3", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet31": { + "admin_status": "up", + "alias": "Ethernet31", + "index": "31", + "lanes": "4,5,6,7", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet4": { + "admin_status": "up", + "alias": "Ethernet4", + "index": "4", + "lanes": "1280,1281,1282,1283", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet5": { + "admin_status": "up", + "alias": "Ethernet5", + "index": "5", + "lanes": "1284,1285,1286,1287", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet6": { + "admin_status": "up", + "alias": "Ethernet6", + "index": "6", + "lanes": "1032,1033,1034,1035", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet7": { + "admin_status": "up", + "alias": "Ethernet7", + "index": "7", + "lanes": "1036,1037,1038,1039", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet8": { + "admin_status": "up", + "alias": "Ethernet8", + "index": "8", + "lanes": "1024,1025,1026,1027", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet9": { + "admin_status": "up", + "alias": "Ethernet9", + "index": "9", + "lanes": "1028,1029,1030,1031", + "mtu": "9100", + "speed": "100000" + } + } +} diff --git a/src/sonic-config-engine/tests/sample_output/py2/l2switch_dualtor.json b/src/sonic-config-engine/tests/sample_output/py2/l2switch_dualtor.json new file mode 100644 index 000000000000..44edd892ab91 --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py2/l2switch_dualtor.json @@ -0,0 +1,647 @@ +{ + "DEVICE_METADATA": { + "localhost": { + "hwsku": "Arista-7050CX3-32S-D48C8", + "subtype": "DualToR", + "peer_switch": "peer_switch_hostname" + } + }, + "PORT": { + "Ethernet0": { + "lanes": "1,2", + "alias": "Ethernet1/1", + "index": "1", + "speed": "50000", + "admin_status": "up", + "mux_cable": "true" + }, + "Ethernet2": { + "lanes": "3,4", + "alias": "Ethernet1/3", + "index": "1", + "speed": "50000" + }, + "Ethernet4": { + "lanes": "5,6", + "alias": "Ethernet2/1", + "index": "2", + "speed": "50000", + "admin_status": "up", + "mux_cable": "true" + }, + "Ethernet6": { + "lanes": "7,8", + "alias": "Ethernet2/3", + "index": "2", + "speed": "50000" + }, + "Ethernet8": { + "lanes": "9,10", + "alias": "Ethernet3/1", + "index": "3", + "speed": "50000", + "admin_status": "up", + "mux_cable": "true" + }, + "Ethernet10": { + "lanes": "11,12", + "alias": "Ethernet3/3", + "index": "3", + "speed": "50000" + }, + "Ethernet12": { + "lanes": "13,14", + "alias": "Ethernet4/1", + "index": "4", + "speed": "50000", + "admin_status": "up", + "mux_cable": "true" + }, + "Ethernet14": { + "lanes": "15,16", + "alias": "Ethernet4/3", + "index": "4", + "speed": "50000" + }, + "Ethernet16": { + "lanes": "21,22", + "alias": "Ethernet5/1", + "index": "5", + "speed": "50000", + "admin_status": "up", + "mux_cable": "true" + }, + "Ethernet18": { + "lanes": "23,24", + "alias": "Ethernet5/3", + "index": "5", + "speed": "50000" + }, + "Ethernet20": { + "lanes": "17,18", + "alias": "Ethernet6/1", + "index": "6", + "speed": "50000", + "admin_status": "up", + "mux_cable": "true" + }, + "Ethernet22": { + "lanes": "19,20", + "alias": "Ethernet6/3", + "index": "6", + "speed": "50000" + }, + "Ethernet24": { + "lanes": "25,26,27,28", + "alias": "Ethernet7/1", + "index": "7", + "speed": "100000", + "admin_status": "up" + }, + "Ethernet28": { + "lanes": "29,30,31,32", + "alias": "Ethernet8/1", + "index": "8", + "speed": "100000", + "admin_status": "up" + }, + "Ethernet32": { + "lanes": "37,38,39,40", + "alias": "Ethernet9/1", + "index": "9", + "speed": "100000", + "admin_status": "up" + }, + "Ethernet36": { + "lanes": "33,34,35,36", + "alias": "Ethernet10/1", + "index": "10", + "speed": "100000", + "admin_status": "up" + }, + "Ethernet40": { + "lanes": "41,42", + "alias": "Ethernet11/1", + "index": "11", + "speed": "50000", + "admin_status": "up", + "mux_cable": "true" + }, + "Ethernet42": { + "lanes": "43,44", + "alias": "Ethernet11/3", + "index": "11", + "speed": "50000" + }, + "Ethernet44": { + "lanes": "45,46", + "alias": "Ethernet12/1", + "index": "12", + "speed": "50000", + "admin_status": "up", + "mux_cable": "true" + }, + "Ethernet46": { + "lanes": "47,48", + "alias": "Ethernet12/3", + "index": "12", + "speed": "50000" + }, + "Ethernet48": { + "lanes": "53,54", + "alias": "Ethernet13/1", + "index": "13", + "speed": "50000", + "admin_status": "up", + "mux_cable": "true" + }, + "Ethernet50": { + "lanes": "55,56", + "alias": "Ethernet13/3", + "index": "13", + "speed": "50000" + }, + "Ethernet52": { + "lanes": "49,50", + "alias": "Ethernet14/1", + "index": "14", + "speed": "50000", + "admin_status": "up", + "mux_cable": "true" + }, + "Ethernet54": { + "lanes": "51,52", + "alias": "Ethernet14/3", + "index": "14", + "speed": "50000" + }, + "Ethernet56": { + "lanes": "57,58", + "alias": "Ethernet15/1", + "index": "15", + "speed": "50000", + "admin_status": "up", + "mux_cable": "true" + }, + "Ethernet58": { + "lanes": "59,60", + "alias": "Ethernet15/3", + "index": "15", + "speed": "50000" + }, + "Ethernet60": { + "lanes": "61,62", + "alias": "Ethernet16/1", + "index": "16", + "speed": "50000", + "admin_status": "up", + "mux_cable": "true" + }, + "Ethernet62": { + "lanes": "63,64", + "alias": "Ethernet16/3", + "index": "16", + "speed": "50000" + }, + "Ethernet64": { + "lanes": "69,70", + "alias": "Ethernet17/1", + "index": "17", + "speed": "50000", + "admin_status": "up", + "mux_cable": "true" + }, + "Ethernet66": { + "lanes": "71,72", + "alias": "Ethernet17/3", + "index": "17", + "speed": "50000" + }, + "Ethernet68": { + "lanes": "65,66", + "alias": "Ethernet18/1", + "index": "18", + "speed": "50000", + "admin_status": "up", + "mux_cable": "true" + }, + "Ethernet70": { + "lanes": "67,68", + "alias": "Ethernet18/3", + "index": "18", + "speed": "50000" + }, + "Ethernet72": { + "lanes": "73,74", + "alias": "Ethernet19/1", + "index": "19", + "speed": "50000", + "admin_status": "up", + "mux_cable": "true" + }, + "Ethernet74": { + "lanes": "75,76", + "alias": "Ethernet19/3", + "index": "19", + "speed": "50000" + }, + "Ethernet76": { + "lanes": "77,78", + "alias": "Ethernet20/1", + "index": "20", + "speed": "50000", + "admin_status": "up", + "mux_cable": "true" + }, + "Ethernet78": { + "lanes": "79,80", + "alias": "Ethernet20/3", + "index": "20", + "speed": "50000" + }, + "Ethernet80": { + "lanes": "85,86", + "alias": "Ethernet21/1", + "index": "21", + "speed": "50000", + "admin_status": "up", + "mux_cable": "true" + }, + "Ethernet82": { + "lanes": "87,88", + "alias": "Ethernet21/3", + "index": "21", + "speed": "50000" + }, + "Ethernet84": { + "lanes": "81,82", + "alias": "Ethernet22/1", + "index": "22", + "speed": "50000", + "admin_status": "up", + "mux_cable": "true" + }, + "Ethernet86": { + "lanes": "83,84", + "alias": "Ethernet22/3", + "index": "22", + "speed": "50000" + }, + "Ethernet88": { + "lanes": "89,90,91,92", + "alias": "Ethernet23/1", + "index": "23", + "speed": "100000", + "admin_status": "up" + }, + "Ethernet92": { + "lanes": "93,94,95,96", + "alias": "Ethernet24/1", + "index": "24", + "speed": "100000", + "admin_status": "up" + }, + "Ethernet96": { + "lanes": "101,102,103,104", + "alias": "Ethernet25/1", + "index": "25", + "speed": "100000", + "admin_status": "up" + }, + "Ethernet100": { + "lanes": "97,98,99,100", + "alias": "Ethernet26/1", + "index": "26", + "speed": "100000", + "admin_status": "up" + }, + "Ethernet104": { + "lanes": "105,106", + "alias": "Ethernet27/1", + "index": "27", + "speed": "50000", + "admin_status": "up", + "mux_cable": "true" + }, + "Ethernet106": { + "lanes": "107,108", + "alias": "Ethernet27/3", + "index": "27", + "speed": "50000" + }, + "Ethernet108": { + "lanes": "109,110", + "alias": "Ethernet28/1", + "index": "28", + "speed": "50000", + "admin_status": "up", + "mux_cable": "true" + }, + "Ethernet110": { + "lanes": "111,112", + "alias": "Ethernet28/3", + "index": "28", + "speed": "50000" + }, + "Ethernet112": { + "lanes": "117,118", + "alias": "Ethernet29/1", + "index": "29", + "speed": "50000", + "admin_status": "up", + "mux_cable": "true" + }, + "Ethernet114": { + "lanes": "119,120", + "alias": "Ethernet29/3", + "index": "29", + "speed": "50000" + }, + "Ethernet116": { + "lanes": "113,114", + "alias": "Ethernet30/1", + "index": "30", + "speed": "50000", + "admin_status": "up", + "mux_cable": "true" + }, + "Ethernet118": { + "lanes": "115,116", + "alias": "Ethernet30/3", + "index": "30", + "speed": "50000" + }, + "Ethernet120": { + "lanes": "121,122", + "alias": "Ethernet31/1", + "index": "31", + "speed": "50000", + "admin_status": "up", + "mux_cable": "true" + }, + "Ethernet122": { + "lanes": "123,124", + "alias": "Ethernet31/3", + "index": "31", + "speed": "50000" + }, + "Ethernet124": { + "lanes": "125,126", + "alias": "Ethernet32/1", + "index": "32", + "speed": "50000", + "admin_status": "up", + "mux_cable": "true" + }, + "Ethernet126": { + "lanes": "127,128", + "alias": "Ethernet32/3", + "index": "32", + "speed": "50000" + } + }, + "VLAN": { + "Vlan1000": { + "vlanid": "1000" + } + }, + "VLAN_MEMBER": { + "Vlan1000|Ethernet0": { + "tagging_mode": "untagged" + }, + "Vlan1000|Ethernet4": { + "tagging_mode": "untagged" + }, + "Vlan1000|Ethernet8": { + "tagging_mode": "untagged" + }, + "Vlan1000|Ethernet12": { + "tagging_mode": "untagged" + }, + "Vlan1000|Ethernet16": { + "tagging_mode": "untagged" + }, + "Vlan1000|Ethernet20": { + "tagging_mode": "untagged" + }, + "Vlan1000|Ethernet24": { + "tagging_mode": "untagged" + }, + "Vlan1000|Ethernet28": { + "tagging_mode": "untagged" + }, + "Vlan1000|Ethernet32": { + "tagging_mode": "untagged" + }, + "Vlan1000|Ethernet36": { + "tagging_mode": "untagged" + }, + "Vlan1000|Ethernet40": { + "tagging_mode": "untagged" + }, + "Vlan1000|Ethernet44": { + "tagging_mode": "untagged" + }, + "Vlan1000|Ethernet48": { + "tagging_mode": "untagged" + }, + "Vlan1000|Ethernet52": { + "tagging_mode": "untagged" + }, + "Vlan1000|Ethernet56": { + "tagging_mode": "untagged" + }, + "Vlan1000|Ethernet60": { + "tagging_mode": "untagged" + }, + "Vlan1000|Ethernet64": { + "tagging_mode": "untagged" + }, + "Vlan1000|Ethernet68": { + "tagging_mode": "untagged" + }, + "Vlan1000|Ethernet72": { + "tagging_mode": "untagged" + }, + "Vlan1000|Ethernet76": { + "tagging_mode": "untagged" + }, + "Vlan1000|Ethernet80": { + "tagging_mode": "untagged" + }, + "Vlan1000|Ethernet84": { + "tagging_mode": "untagged" + }, + "Vlan1000|Ethernet88": { + "tagging_mode": "untagged" + }, + "Vlan1000|Ethernet92": { + "tagging_mode": "untagged" + }, + "Vlan1000|Ethernet96": { + "tagging_mode": "untagged" + }, + "Vlan1000|Ethernet100": { + "tagging_mode": "untagged" + }, + "Vlan1000|Ethernet104": { + "tagging_mode": "untagged" + }, + "Vlan1000|Ethernet108": { + "tagging_mode": "untagged" + }, + "Vlan1000|Ethernet112": { + "tagging_mode": "untagged" + }, + "Vlan1000|Ethernet116": { + "tagging_mode": "untagged" + }, + "Vlan1000|Ethernet120": { + "tagging_mode": "untagged" + }, + "Vlan1000|Ethernet124": { + "tagging_mode": "untagged" + } + }, + "TUNNEL": { + "MuxTunnel0": { + "dscp_mode": "uniform", + "dst_ip": "2.2.2.2", + "ecn_mode": "copy_from_outer", + "encap_ecn_mode": "standard", + "ttl_mode": "pipe", + "tunnel_type": "IPINIP" + } + }, + "PEER_SWITCH": { + "peer_switch_hostname": { + "address_ipv4": "1.1.1.1" + } + }, + "LOOPBACK_INTERFACE": { + "Loopback2": {}, + "Loopback2|3.3.3.3": {} + }, + "MUX_CABLE": { + "Ethernet0": { + "server_ipv4": "192.168.0.2/32", + "server_ipv6": "fc02:1000::2/128", + "state": "auto" + }, + "Ethernet4": { + "server_ipv4": "192.168.0.3/32", + "server_ipv6": "fc02:1000::3/128", + "state": "auto" + }, + "Ethernet8": { + "server_ipv4": "192.168.0.4/32", + "server_ipv6": "fc02:1000::4/128", + "state": "auto" + }, + "Ethernet12": { + "server_ipv4": "192.168.0.5/32", + "server_ipv6": "fc02:1000::5/128", + "state": "auto" + }, + "Ethernet16": { + "server_ipv4": "192.168.0.6/32", + "server_ipv6": "fc02:1000::6/128", + "state": "auto" + }, + "Ethernet20": { + "server_ipv4": "192.168.0.7/32", + "server_ipv6": "fc02:1000::7/128", + "state": "auto" + }, + "Ethernet40": { + "server_ipv4": "192.168.0.8/32", + "server_ipv6": "fc02:1000::8/128", + "state": "auto" + }, + "Ethernet44": { + "server_ipv4": "192.168.0.9/32", + "server_ipv6": "fc02:1000::9/128", + "state": "auto" + }, + "Ethernet48": { + "server_ipv4": "192.168.0.10/32", + "server_ipv6": "fc02:1000::a/128", + "state": "auto" + }, + "Ethernet52": { + "server_ipv4": "192.168.0.11/32", + "server_ipv6": "fc02:1000::b/128", + "state": "auto" + }, + "Ethernet56": { + "server_ipv4": "192.168.0.12/32", + "server_ipv6": "fc02:1000::c/128", + "state": "auto" + }, + "Ethernet60": { + "server_ipv4": "192.168.0.13/32", + "server_ipv6": "fc02:1000::d/128", + "state": "auto" + }, + "Ethernet64": { + "server_ipv4": "192.168.0.14/32", + "server_ipv6": "fc02:1000::e/128", + "state": "auto" + }, + "Ethernet68": { + "server_ipv4": "192.168.0.15/32", + "server_ipv6": "fc02:1000::f/128", + "state": "auto" + }, + "Ethernet72": { + "server_ipv4": "192.168.0.16/32", + "server_ipv6": "fc02:1000::10/128", + "state": "auto" + }, + "Ethernet76": { + "server_ipv4": "192.168.0.17/32", + "server_ipv6": "fc02:1000::11/128", + "state": "auto" + }, + "Ethernet80": { + "server_ipv4": "192.168.0.18/32", + "server_ipv6": "fc02:1000::12/128", + "state": "auto" + }, + "Ethernet84": { + "server_ipv4": "192.168.0.19/32", + "server_ipv6": "fc02:1000::13/128", + "state": "auto" + }, + "Ethernet104": { + "server_ipv4": "192.168.0.20/32", + "server_ipv6": "fc02:1000::14/128", + "state": "auto" + }, + "Ethernet108": { + "server_ipv4": "192.168.0.21/32", + "server_ipv6": "fc02:1000::15/128", + "state": "auto" + }, + "Ethernet112": { + "server_ipv4": "192.168.0.22/32", + "server_ipv6": "fc02:1000::16/128", + "state": "auto" + }, + "Ethernet116": { + "server_ipv4": "192.168.0.23/32", + "server_ipv6": "fc02:1000::17/128", + "state": "auto" + }, + "Ethernet120": { + "server_ipv4": "192.168.0.24/32", + "server_ipv6": "fc02:1000::18/128", + "state": "auto" + }, + "Ethernet124": { + "server_ipv4": "192.168.0.25/32", + "server_ipv6": "fc02:1000::19/128", + "state": "auto" + } + } +} diff --git a/src/sonic-config-engine/tests/sample_output/py2/l3_intfs.json b/src/sonic-config-engine/tests/sample_output/py2/l3_intfs.json new file mode 100644 index 000000000000..9ca31832303f --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py2/l3_intfs.json @@ -0,0 +1,301 @@ +{ + "DEVICE_METADATA": {"localhost": {"hwsku": "32x1000Gb"}}, + "PORT": { + "Ethernet0": { + "admin_status": "up", + "alias": "Ethernet0", + "index": "0", + "lanes": "1296,1297,1298,1299", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet1": { + "admin_status": "up", + "alias": "Ethernet1", + "index": "1", + "lanes": "1300,1301,1302,1303", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet10": { + "admin_status": "up", + "alias": "Ethernet10", + "index": "10", + "lanes": "772,773,774,775", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet11": { + "admin_status": "up", + "alias": "Ethernet11", + "index": "11", + "lanes": "768,769,770,771", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet12": { + "admin_status": "up", + "alias": "Ethernet12", + "index": "12", + "lanes": "780,781,782,783", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet13": { + "admin_status": "up", + "alias": "Ethernet13", + "index": "13", + "lanes": "776,777,778,779", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet14": { + "admin_status": "up", + "alias": "Ethernet14", + "index": "14", + "lanes": "528,529,530,531", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet15": { + "admin_status": "up", + "alias": "Ethernet15", + "index": "15", + "lanes": "532,533,534,535", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet16": { + "admin_status": "up", + "alias": "Ethernet16", + "index": "16", + "lanes": "520,521,522,523", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet17": { + "admin_status": "up", + "alias": "Ethernet17", + "index": "17", + "lanes": "524,525,526,527", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet18": { + "admin_status": "up", + "alias": "Ethernet18", + "index": "18", + "lanes": "512,513,514,515", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet19": { + "admin_status": "up", + "alias": "Ethernet19", + "index": "19", + "lanes": "516,517,518,519", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet2": { + "admin_status": "up", + "alias": "Ethernet2", + "index": "2", + "lanes": "1288,1289,1290,1291", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet20": { + "admin_status": "up", + "alias": "Ethernet20", + "index": "20", + "lanes": "272,273,274,275", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet21": { + "admin_status": "up", + "alias": "Ethernet21", + "index": "21", + "lanes": "276,277,278,279", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet22": { + "admin_status": "up", + "alias": "Ethernet22", + "index": "22", + "lanes": "264,265,266,267", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet23": { + "admin_status": "up", + "alias": "Ethernet23", + "index": "23", + "lanes": "268,269,270,271", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet24": { + "admin_status": "up", + "alias": "Ethernet24", + "index": "24", + "lanes": "256,257,258,259", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet25": { + "admin_status": "up", + "alias": "Ethernet25", + "index": "25", + "lanes": "260,261,262,263", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet26": { + "admin_status": "up", + "alias": "Ethernet26", + "index": "26", + "lanes": "16,17,18,19", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet27": { + "admin_status": "up", + "alias": "Ethernet27", + "index": "27", + "lanes": "20,21,22,23", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet28": { + "admin_status": "up", + "alias": "Ethernet28", + "index": "28", + "lanes": "8,9,10,11", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet29": { + "admin_status": "up", + "alias": "Ethernet29", + "index": "29", + "lanes": "12,13,14,15", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet3": { + "admin_status": "up", + "alias": "Ethernet3", + "index": "3", + "lanes": "1292,1293,1294,1295", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet30": { + "admin_status": "up", + "alias": "Ethernet30", + "index": "30", + "lanes": "0,1,2,3", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet31": { + "admin_status": "up", + "alias": "Ethernet31", + "index": "31", + "lanes": "4,5,6,7", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet4": { + "admin_status": "up", + "alias": "Ethernet4", + "index": "4", + "lanes": "1280,1281,1282,1283", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet5": { + "admin_status": "up", + "alias": "Ethernet5", + "index": "5", + "lanes": "1284,1285,1286,1287", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet6": { + "admin_status": "up", + "alias": "Ethernet6", + "index": "6", + "lanes": "1032,1033,1034,1035", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet7": { + "admin_status": "up", + "alias": "Ethernet7", + "index": "7", + "lanes": "1036,1037,1038,1039", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet8": { + "admin_status": "up", + "alias": "Ethernet8", + "index": "8", + "lanes": "1024,1025,1026,1027", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet9": { + "admin_status": "up", + "alias": "Ethernet9", + "index": "9", + "lanes": "1028,1029,1030,1031", + "mtu": "9100", + "speed": "100000" + } + }, + "LOOPBACK_INTERFACE": { + "Loopback0": {}, + "Loopback0|10.1.0.1/32": {} + }, + "BGP_NEIGHBOR": {}, + "DEVICE_NEIGHBOR": {}, + "INTERFACE": { + "Ethernet0": {}, + "Ethernet1": {}, + "Ethernet2": {}, + "Ethernet3": {}, + "Ethernet4": {}, + "Ethernet5": {}, + "Ethernet6": {}, + "Ethernet7": {}, + "Ethernet8": {}, + "Ethernet9": {}, + "Ethernet10": {}, + "Ethernet11": {}, + "Ethernet12": {}, + "Ethernet13": {}, + "Ethernet14": {}, + "Ethernet15": {}, + "Ethernet16": {}, + "Ethernet17": {}, + "Ethernet18": {}, + "Ethernet19": {}, + "Ethernet20": {}, + "Ethernet21": {}, + "Ethernet22": {}, + "Ethernet23": {}, + "Ethernet24": {}, + "Ethernet25": {}, + "Ethernet26": {}, + "Ethernet27": {}, + "Ethernet28": {}, + "Ethernet29": {}, + "Ethernet30": {}, + "Ethernet31": {} + } +} diff --git a/src/sonic-config-engine/tests/sample_output/py2/ndppd.conf b/src/sonic-config-engine/tests/sample_output/py2/ndppd.conf index 71ff1dfaf9ca..edae81fffdb4 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/ndppd.conf +++ b/src/sonic-config-engine/tests/sample_output/py2/ndppd.conf @@ -4,6 +4,7 @@ # # Config file for ndppd, the NDP Proxy Daemon # See man page for ndppd.conf.5 for descriptions of all available options +route-ttl 2147483647 proxy Vlan1000 { rule fc02:1000::/64 { diff --git a/src/sonic-config-engine/tests/sample_output/py2/ntp.conf b/src/sonic-config-engine/tests/sample_output/py2/ntp.conf new file mode 100644 index 000000000000..bc98019e88f7 --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py2/ntp.conf @@ -0,0 +1,72 @@ +############################################################################### +# Managed by Ansible +# file: ansible/roles/acs/templates/ntp.conf.j2 +############################################################################### + +# /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help + +# To avoid ntpd from panic and exit if the drift between new time and +# current system time is large. +tinker panic 0 + +driftfile /var/lib/ntp/ntp.drift + + +# Enable this if you want statistics to be logged. +#statsdir /var/log/ntpstats/ + +statistics loopstats peerstats clockstats +filegen loopstats file loopstats type day enable +filegen peerstats file peerstats type day enable +filegen clockstats file clockstats type day enable + + +# You do need to talk to an NTP server or two (or three). +#server ntp.your-provider.example + +# pool.ntp.org maps to about 1000 low-stratum NTP servers. Your server will +# pick a different set every time it starts up. Please consider joining the +# pool: + +#listen on source interface if configured, else +#only listen on MGMT_INTERFACE, LOOPBACK_INTERFACE ip when MGMT_INTERFACE is not defined, or eth0 +# if we don't have both of them (default is to listen on all ip addresses) +interface ignore wildcard + +# set global variable for configured source interface name +# set global boolean to indicate if the ip of the configured source interface is configured +# if the source interface is configured but no ip on that interface, then listen on another +# interface based on existing logic + +interface listen Ethernet0 +interface listen 127.0.0.1 + +# Access control configuration; see /usr/share/doc/ntp-doc/html/accopt.html for +# details. The web page +# might also be helpful. +# +# Note that "restrict" applies to both servers and clients, so a configuration +# that might be intended to block requests from certain clients could also end +# up blocking replies from your own upstream servers. + +# By default, exchange time with everybody, but don't allow configuration. +restrict -4 default kod notrap nomodify nopeer noquery +restrict -6 default kod notrap nomodify nopeer noquery + +# Local users may interrogate the ntp server more closely. +restrict 127.0.0.1 +restrict ::1 + +# Clients from this (example!) subnet have unlimited access, but only if +# cryptographically authenticated. +#restrict 192.168.123.0 mask 255.255.255.0 notrust + + +# If you want to provide time to your local subnet, change the next line. +# (Again, the address is an example only.) +#broadcast 192.168.123.255 + +# If you want to listen to time broadcasts on your local subnet, de-comment the +# next lines. Please do this only if you trust everybody on the network! +#disable auth +#broadcastclient diff --git a/src/sonic-config-engine/tests/sample_output/py2/ports.json b/src/sonic-config-engine/tests/sample_output/py2/ports.json index 0e174972fbe4..4b36790c7cd0 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/ports.json +++ b/src/sonic-config-engine/tests/sample_output/py2/ports.json @@ -20,6 +20,13 @@ }, "OP": "SET" }, + { + "PORT_TABLE:Ethernet16": { + "speed": "1000", + "description": "fortyGigE0/16" + }, + "OP": "SET" + }, { "PORT_TABLE:Ethernet12": { "speed": "100000", diff --git a/src/sonic-config-engine/tests/sample_output/py2/qos-arista7050.json b/src/sonic-config-engine/tests/sample_output/py2/qos-arista7050.json index aa05ef4ec36c..b5f304dc133e 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/qos-arista7050.json +++ b/src/sonic-config-engine/tests/sample_output/py2/qos-arista7050.json @@ -114,201 +114,232 @@ } }, "PORT_QOS_MAP": { + "global": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]" + }, "Ethernet4": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet8": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet12": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet16": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet20": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet24": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet28": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet32": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet36": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet40": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet44": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet48": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet52": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet56": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet60": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet64": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet68": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet72": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet76": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet80": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet84": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet88": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet92": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet96": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet112": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet116": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet120": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet124": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" } }, "WRED_PROFILE": { diff --git a/src/sonic-config-engine/tests/sample_output/py2/qos-arista7260.json b/src/sonic-config-engine/tests/sample_output/py2/qos-arista7260.json new file mode 120000 index 000000000000..9362bae62029 --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py2/qos-arista7260.json @@ -0,0 +1 @@ +../py3/qos-arista7260-t1-remap-disabled.json \ No newline at end of file diff --git a/src/sonic-config-engine/tests/sample_output/py2/qos-arista7800r3-48cq2-lc.json b/src/sonic-config-engine/tests/sample_output/py2/qos-arista7800r3-48cq2-lc.json new file mode 100644 index 000000000000..898ad3345335 --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py2/qos-arista7800r3-48cq2-lc.json @@ -0,0 +1,1535 @@ +{ + "TC_TO_PRIORITY_GROUP_MAP": { + "AZURE": { + "0": "0", + "1": "0", + "2": "0", + "3": "3", + "4": "4", + "5": "0", + "6": "0", + "7": "7" + } + }, + "MAP_PFC_PRIORITY_TO_QUEUE": { + "AZURE": { + "0": "0", + "1": "1", + "2": "2", + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7" + } + }, + "TC_TO_QUEUE_MAP": { + "AZURE": { + "0": "0", + "1": "1", + "2": "2", + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7" + } + }, + "DSCP_TO_TC_MAP": { + "AZURE": { + "0" : "1", + "1" : "1", + "2" : "1", + "3" : "3", + "4" : "4", + "5" : "2", + "6" : "1", + "7" : "1", + "8" : "0", + "9" : "1", + "10": "1", + "11": "1", + "12": "1", + "13": "1", + "14": "1", + "15": "1", + "16": "1", + "17": "1", + "18": "1", + "19": "1", + "20": "1", + "21": "1", + "22": "1", + "23": "1", + "24": "1", + "25": "1", + "26": "1", + "27": "1", + "28": "1", + "29": "1", + "30": "1", + "31": "1", + "32": "1", + "33": "1", + "34": "1", + "35": "1", + "36": "1", + "37": "1", + "38": "1", + "39": "1", + "40": "1", + "41": "1", + "42": "1", + "43": "1", + "44": "1", + "45": "1", + "46": "5", + "47": "1", + "48": "6", + "49": "1", + "50": "1", + "51": "1", + "52": "1", + "53": "1", + "54": "1", + "55": "1", + "56": "1", + "57": "1", + "58": "1", + "59": "1", + "60": "1", + "61": "1", + "62": "1", + "63": "1" + } + }, + "SCHEDULER": { + "scheduler.0": { + "type" : "DWRR", + "weight": "14" + }, + "scheduler.1": { + "type" : "DWRR", + "weight": "15" + } + }, + "PORT_QOS_MAP": { + "global": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]" + }, + "Ethernet0": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet4": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet8": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet12": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet16": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet20": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet24": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet28": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet32": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet36": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet40": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet44": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet48": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet52": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet56": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet60": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet64": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet68": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet72": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet76": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet80": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet84": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet88": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet92": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet96": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet100": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet104": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet108": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet112": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet116": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet120": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet124": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet128": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet132": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet136": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet140": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet144": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet148": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet152": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet156": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet164": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet176": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet180": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet184": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet188": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + } + }, + "WRED_PROFILE": { + "AZURE_LOSSLESS" : { + "wred_green_enable" : "true", + "wred_yellow_enable" : "true", + "wred_red_enable" : "true", + "ecn" : "ecn_all", + "green_max_threshold" : "2097152", + "green_min_threshold" : "250000", + "yellow_max_threshold" : "2097152", + "yellow_min_threshold" : "1048576", + "red_max_threshold" : "2097152", + "red_min_threshold" : "1048576", + "green_drop_probability" : "5", + "yellow_drop_probability": "5", + "red_drop_probability" : "5" + } + }, + "QUEUE": { + "Ethernet0|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet4|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet8|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet12|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet16|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet20|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet24|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet28|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet32|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet36|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet40|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet44|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet48|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet52|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet56|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet60|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet64|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet68|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet72|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet76|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet80|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet84|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet88|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet92|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet96|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet100|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet104|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet108|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet112|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet116|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet120|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet124|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet128|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet132|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet136|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet140|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet144|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet148|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet152|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet156|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet164|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet176|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet180|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet184|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet188|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet0|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet4|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet8|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet12|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet16|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet20|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet24|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet28|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet32|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet36|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet40|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet44|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet48|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet52|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet56|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet60|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet64|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet68|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet72|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet76|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet80|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet84|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet88|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet92|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet96|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet100|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet104|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet108|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet112|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet116|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet120|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet124|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet128|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet132|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet136|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet140|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet144|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet148|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet152|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet156|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet164|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet176|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet180|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet184|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet188|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet0|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet4|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet8|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet12|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet16|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet20|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet24|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet28|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet32|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet36|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet40|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet44|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet48|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet52|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet56|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet60|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet64|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet68|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet72|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet76|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet80|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet84|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet88|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet92|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet96|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet100|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet104|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet108|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet112|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet116|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet120|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet124|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet128|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet132|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet136|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet140|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet144|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet148|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet152|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet156|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet164|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet176|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet180|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet184|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet188|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet0|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet4|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet8|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet12|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet16|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet20|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet24|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet28|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet32|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet36|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet40|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet44|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet48|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet52|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet56|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet60|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet64|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet68|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet72|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet76|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet80|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet84|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet88|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet92|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet96|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet100|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet104|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet108|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet112|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet116|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet120|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet124|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet128|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet132|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet136|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet140|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet144|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet148|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet152|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet156|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet164|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet176|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet180|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet184|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet188|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet0|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet4|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet8|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet12|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet16|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet20|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet24|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet28|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet32|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet36|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet40|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet44|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet48|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet52|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet56|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet60|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet64|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet68|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet72|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet76|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet80|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet84|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet88|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet92|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet96|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet100|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet104|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet108|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet112|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet116|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet120|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet124|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet128|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet132|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet136|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet140|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet144|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet148|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet152|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet156|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet164|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet176|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet180|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet184|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet188|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet0|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet4|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet8|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet12|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet16|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet20|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet24|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet28|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet32|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet36|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet40|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet44|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet48|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet52|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet56|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet60|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet64|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet68|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet72|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet76|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet80|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet84|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet88|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet92|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet96|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet100|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet104|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet108|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet112|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet116|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet120|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet124|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet128|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet132|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet136|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet140|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet144|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet148|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet152|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet156|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet164|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet176|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet180|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet184|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet188|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet0|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet4|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet8|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet12|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet16|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet20|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet24|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet28|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet32|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet36|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet40|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet44|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet48|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet52|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet56|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet60|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet64|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet68|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet72|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet76|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet80|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet84|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet88|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet92|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet96|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet100|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet104|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet108|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet112|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet116|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet120|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet124|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet128|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet132|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet136|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet140|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet144|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet148|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet152|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet156|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet164|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet176|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet180|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet184|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet188|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + } + } +} diff --git a/src/sonic-config-engine/tests/sample_output/py2/qos-dell6100.json b/src/sonic-config-engine/tests/sample_output/py2/qos-dell6100.json index 75d9b3a87eee..c059b4bdb735 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/qos-dell6100.json +++ b/src/sonic-config-engine/tests/sample_output/py2/qos-dell6100.json @@ -114,313 +114,360 @@ } }, "PORT_QOS_MAP": { + "global": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]" + }, "Ethernet0": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet1": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet4": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet5": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet6": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet7": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet8": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet9": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet10": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet11": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet12": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet13": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet14": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet15": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet16": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet17": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet20": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet21": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet22": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet23": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet24": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet25": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet26": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet27": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet28": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet29": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet30": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet31": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet32": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet36": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet37": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet38": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet39": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet40": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet41": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet42": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet48": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet52": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet53": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet54": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet55": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet56": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet57": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet58": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" } }, "WRED_PROFILE": { diff --git a/src/sonic-config-engine/tests/sample_output/py2/qos-dell9332.json b/src/sonic-config-engine/tests/sample_output/py2/qos-dell9332.json new file mode 100644 index 000000000000..ed692ba42558 --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py2/qos-dell9332.json @@ -0,0 +1,1136 @@ +{ + "TC_TO_PRIORITY_GROUP_MAP": { + "AZURE": { + "0": "0", + "1": "0", + "2": "0", + "3": "3", + "4": "4", + "5": "0", + "6": "0", + "7": "7" + } + }, + "MAP_PFC_PRIORITY_TO_QUEUE": { + "AZURE": { + "0": "0", + "1": "1", + "2": "2", + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7" + } + }, + "TC_TO_QUEUE_MAP": { + "AZURE": { + "0": "0", + "1": "1", + "2": "2", + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7" + } + }, + "DSCP_TO_TC_MAP": { + "AZURE": { + "0" : "1", + "1" : "1", + "2" : "1", + "3" : "3", + "4" : "4", + "5" : "2", + "6" : "1", + "7" : "1", + "8" : "0", + "9" : "1", + "10": "1", + "11": "1", + "12": "1", + "13": "1", + "14": "1", + "15": "1", + "16": "1", + "17": "1", + "18": "1", + "19": "1", + "20": "1", + "21": "1", + "22": "1", + "23": "1", + "24": "1", + "25": "1", + "26": "1", + "27": "1", + "28": "1", + "29": "1", + "30": "1", + "31": "1", + "32": "1", + "33": "1", + "34": "1", + "35": "1", + "36": "1", + "37": "1", + "38": "1", + "39": "1", + "40": "1", + "41": "1", + "42": "1", + "43": "1", + "44": "1", + "45": "1", + "46": "5", + "47": "1", + "48": "6", + "49": "1", + "50": "1", + "51": "1", + "52": "1", + "53": "1", + "54": "1", + "55": "1", + "56": "1", + "57": "1", + "58": "1", + "59": "1", + "60": "1", + "61": "1", + "62": "1", + "63": "1" + } + }, + "SCHEDULER": { + "scheduler.0": { + "type" : "DWRR", + "weight": "1" + }, + "scheduler.1": { + "type" : "DWRR", + "weight": "1" + }, + "scheduler.2": { + "type" : "DWRR", + "weight": "100" + } + }, + "PORT_QOS_MAP": { + "global": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]" + }, + "Ethernet0": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet8": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet16": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet24": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet32": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet40": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet48": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet56": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet64": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet72": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet80": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet88": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet96": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet104": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet112": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet120": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet128": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet136": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet144": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet152": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet160": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet168": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet176": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet184": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet192": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet200": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet208": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet216": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet224": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet232": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet240": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet248": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + } + }, + "WRED_PROFILE": { + "AZURE_LOSSLESS" : { + "wred_green_enable" : "true", + "wred_yellow_enable" : "true", + "wred_red_enable" : "true", + "ecn" : "ecn_all", + "green_max_threshold" : "2097152", + "green_min_threshold" : "1048576", + "yellow_max_threshold" : "2097152", + "yellow_min_threshold" : "1048576", + "red_max_threshold" : "2097152", + "red_min_threshold" : "1048576", + "green_drop_probability" : "5", + "yellow_drop_probability": "5", + "red_drop_probability" : "5" + } + }, + "QUEUE": { + "Ethernet0|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet8|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet16|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet24|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet32|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet40|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet48|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet56|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet64|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet72|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet80|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet88|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet96|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet104|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet112|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet120|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet128|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet136|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet144|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet152|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet160|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet168|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet176|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet184|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet192|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet200|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet208|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet216|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet224|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet232|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet240|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet248|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet0|4": { + "scheduler" : "[SCHEDULER|scheduler.2]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet8|4": { + "scheduler" : "[SCHEDULER|scheduler.2]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet16|4": { + "scheduler" : "[SCHEDULER|scheduler.2]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet24|4": { + "scheduler" : "[SCHEDULER|scheduler.2]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet32|4": { + "scheduler" : "[SCHEDULER|scheduler.2]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet40|4": { + "scheduler" : "[SCHEDULER|scheduler.2]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet48|4": { + "scheduler" : "[SCHEDULER|scheduler.2]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet56|4": { + "scheduler" : "[SCHEDULER|scheduler.2]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet64|4": { + "scheduler" : "[SCHEDULER|scheduler.2]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet72|4": { + "scheduler" : "[SCHEDULER|scheduler.2]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet80|4": { + "scheduler" : "[SCHEDULER|scheduler.2]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet88|4": { + "scheduler" : "[SCHEDULER|scheduler.2]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet96|4": { + "scheduler" : "[SCHEDULER|scheduler.2]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet104|4": { + "scheduler" : "[SCHEDULER|scheduler.2]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet112|4": { + "scheduler" : "[SCHEDULER|scheduler.2]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet120|4": { + "scheduler" : "[SCHEDULER|scheduler.2]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet128|4": { + "scheduler" : "[SCHEDULER|scheduler.2]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet136|4": { + "scheduler" : "[SCHEDULER|scheduler.2]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet144|4": { + "scheduler" : "[SCHEDULER|scheduler.2]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet152|4": { + "scheduler" : "[SCHEDULER|scheduler.2]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet160|4": { + "scheduler" : "[SCHEDULER|scheduler.2]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet168|4": { + "scheduler" : "[SCHEDULER|scheduler.2]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet176|4": { + "scheduler" : "[SCHEDULER|scheduler.2]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet184|4": { + "scheduler" : "[SCHEDULER|scheduler.2]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet192|4": { + "scheduler" : "[SCHEDULER|scheduler.2]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet200|4": { + "scheduler" : "[SCHEDULER|scheduler.2]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet208|4": { + "scheduler" : "[SCHEDULER|scheduler.2]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet216|4": { + "scheduler" : "[SCHEDULER|scheduler.2]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet224|4": { + "scheduler" : "[SCHEDULER|scheduler.2]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet232|4": { + "scheduler" : "[SCHEDULER|scheduler.2]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet240|4": { + "scheduler" : "[SCHEDULER|scheduler.2]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet248|4": { + "scheduler" : "[SCHEDULER|scheduler.2]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet0|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet8|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet16|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet24|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet32|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet40|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet48|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet56|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet64|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet72|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet80|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet88|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet96|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet104|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet112|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet120|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet128|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet136|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet144|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet152|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet160|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet168|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet176|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet184|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet192|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet200|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet208|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet216|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet224|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet232|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet240|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet248|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet0|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet8|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet16|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet24|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet32|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet40|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet48|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet56|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet64|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet72|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet80|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet88|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet96|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet104|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet112|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet120|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet128|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet136|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet144|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet152|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet160|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet168|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet176|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet184|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet192|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet200|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet208|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet216|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet224|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet232|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet240|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet248|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet0|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet8|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet16|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet24|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet32|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet40|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet48|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet56|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet64|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet72|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet80|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet88|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet96|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet104|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet112|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet120|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet128|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet136|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet144|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet152|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet160|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet168|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet176|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet184|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet192|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet200|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet208|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet216|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet224|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet232|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet240|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet248|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet0|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet8|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet16|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet24|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet32|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet40|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet48|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet56|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet64|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet72|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet80|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet88|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet96|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet104|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet112|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet120|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet128|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet136|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet144|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet152|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet160|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet168|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet176|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet184|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet192|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet200|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet208|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet216|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet224|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet232|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet240|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet248|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet0|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet8|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet16|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet24|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet32|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet40|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet48|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet56|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet64|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet72|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet80|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet88|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet96|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet104|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet112|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet120|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet128|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet136|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet144|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet152|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet160|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet168|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet176|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet184|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet192|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet200|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet208|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet216|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet224|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet232|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet240|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet248|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + } + } +} diff --git a/src/sonic-config-engine/tests/sample_output/py2/radvd.conf b/src/sonic-config-engine/tests/sample_output/py2/radvd.conf new file mode 100644 index 000000000000..9e716b7144bf --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py2/radvd.conf @@ -0,0 +1,35 @@ +# =========== Managed by sonic-cfggen -- DO NOT edit manually! ==================== +# Generated by /usr/share/sonic/templates/radvd.conf.j2 using config DB data +# File: /etc/radvd.conf +# +# Config file for radvd, the router advertisement daemon +# See man page for radvd.conf for descriptions of all available options +# + +interface Vlan1000 +{ + IgnoreIfMissing on; + AdvSendAdvert on; + MinRtrAdvInterval 60; + MaxRtrAdvInterval 180; + AdvManagedFlag on; + AdvOtherConfigFlag off; + AdvLinkMTU 9100; + AdvHomeAgentFlag off; + prefix fc02:2000::/64 { + AdvOnLink on; + AdvAutonomous off; + AdvRouterAddr off; + AdvValidLifetime infinity; + AdvPreferredLifetime infinity; + }; + prefix fc02:1000::/64 { + AdvOnLink on; + AdvAutonomous off; + AdvRouterAddr off; + AdvValidLifetime infinity; + AdvPreferredLifetime infinity; + }; +}; + + diff --git a/src/sonic-config-engine/tests/sample_output/py2/t2-chassis-fe-bgpd.conf b/src/sonic-config-engine/tests/sample_output/py2/t2-chassis-fe-bgpd.conf index 7633ac117bf7..20744efaa40f 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/t2-chassis-fe-bgpd.conf +++ b/src/sonic-config-engine/tests/sample_output/py2/t2-chassis-fe-bgpd.conf @@ -63,9 +63,6 @@ router bgp 4000 ! bgp bestpath as-path multipath-relax ! - bgp graceful-restart restart-time 240 - bgp graceful-restart - bgp graceful-restart preserve-fw-state ! bgp router-id 4.0.0.0 ! diff --git a/src/sonic-config-engine/tests/sample_output/py2/wait_for_intf.sh b/src/sonic-config-engine/tests/sample_output/py2/wait_for_intf.sh index 2af5cee2f005..1d58bc956bd1 100644 --- a/src/sonic-config-engine/tests/sample_output/py2/wait_for_intf.sh +++ b/src/sonic-config-engine/tests/sample_output/py2/wait_for_intf.sh @@ -21,11 +21,38 @@ function wait_until_iface_ready echo "Interface ${IFACE_NAME} is ready!" } +function check_for_ipv6_link_local +{ + IFACE_NAME=$1 + echo "Waiting until interface ${IFACE_NAME} has a link-local ipv6 address configured...." + + # Status of link local address is not populated in STATE_DB + while true; do + HAS_LL=$(ip -6 addr show ${IFACE_NAME} scope link 2> /dev/null) + RC=$? + if [[ ${RC} == "0" ]] && [[ ! -z ${HAS_LL} ]]; then + break + fi + + sleep 1 + done + + echo "Link-Local address is configured on ${IFACE_NAME}" +} # Wait for all interfaces with IPv4 addresses to be up and ready +# dhcp6relay binds to ipv6 addresses configured on these vlan ifaces +# Thus check if they are ready before launching dhcp6relay +wait_until_iface_ready Vlan2000 192.168.200.1/27 wait_until_iface_ready Vlan1000 192.168.0.1/27 +wait_until_iface_ready Vlan1000 fc02:2000::2/24 +check_for_ipv6_link_local Vlan1000 wait_until_iface_ready PortChannel02 10.0.0.58/31 wait_until_iface_ready PortChannel03 10.0.0.60/31 wait_until_iface_ready PortChannel04 10.0.0.62/31 wait_until_iface_ready PortChannel01 10.0.0.56/31 +# Wait 10 seconds for the rest of interfaces to get added/populated. +# dhcrelay listens on each of the interfaces (in addition to the port +# channels and vlan interfaces) +sleep 10 diff --git a/src/sonic-config-engine/tests/sample_output/py3/arista7050cx3-dualtor.config.bcm b/src/sonic-config-engine/tests/sample_output/py3/arista7050cx3-dualtor.config.bcm new file mode 100644 index 000000000000..7d21ac82f120 --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py3/arista7050cx3-dualtor.config.bcm @@ -0,0 +1,8 @@ + +l3_alpm_hit_skip=1 +sai_remap_prio_on_tnl_egress=1 +mmu_init_config="MSFT-TH2-Tier0" +sai_tunnel_support=1 + sai_tunnel_underlay_route_mode=1 + host_as_route_disable=1 + l3_ecmp_levels=2 diff --git a/src/sonic-config-engine/tests/sample_output/py3/arista7260-dualtor.config.bcm b/src/sonic-config-engine/tests/sample_output/py3/arista7260-dualtor.config.bcm new file mode 100644 index 000000000000..7d21ac82f120 --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py3/arista7260-dualtor.config.bcm @@ -0,0 +1,8 @@ + +l3_alpm_hit_skip=1 +sai_remap_prio_on_tnl_egress=1 +mmu_init_config="MSFT-TH2-Tier0" +sai_tunnel_support=1 + sai_tunnel_underlay_route_mode=1 + host_as_route_disable=1 + l3_ecmp_levels=2 diff --git a/src/sonic-config-engine/tests/sample_output/py3/arista7260-t1.config.bcm b/src/sonic-config-engine/tests/sample_output/py3/arista7260-t1.config.bcm new file mode 100644 index 000000000000..84a917290f24 --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py3/arista7260-t1.config.bcm @@ -0,0 +1,5 @@ + +l3_alpm_hit_skip=1 + +mmu_init_config="MSFT-TH2-Tier1" + diff --git a/src/sonic-config-engine/tests/sample_output/py3/bgpd_frr.conf b/src/sonic-config-engine/tests/sample_output/py3/bgpd_frr.conf index a312e7532620..e7534d4b9781 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/bgpd_frr.conf +++ b/src/sonic-config-engine/tests/sample_output/py3/bgpd_frr.conf @@ -35,6 +35,8 @@ ipv6 prefix-list PL_LoopbackV6 permit fc00:1::/64 ! ip prefix-list LOCAL_VLAN_IPV4_PREFIX seq 5 permit 192.168.0.0/27 ! +ip prefix-list LOCAL_VLAN_IPV4_PREFIX seq 10 permit 192.168.200.0/27 +! ! ! router bgp 65100 @@ -48,6 +50,7 @@ router bgp 65100 bgp graceful-restart restart-time 240 bgp graceful-restart bgp graceful-restart preserve-fw-state + bgp graceful-restart select-defer-time 45 ! bgp router-id 10.1.0.32 ! @@ -58,6 +61,7 @@ router bgp 65100 exit-address-family ! network 192.168.0.1/27 + network 192.168.200.1/27 ! ! ! diff --git a/src/sonic-config-engine/tests/sample_output/py3/bgpd_frr_backend_asic.conf b/src/sonic-config-engine/tests/sample_output/py3/bgpd_frr_backend_asic.conf new file mode 100644 index 000000000000..20e1d2bc3241 --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py3/bgpd_frr_backend_asic.conf @@ -0,0 +1,75 @@ +! +! template: bgpd/bgpd.conf.j2 +! +! +! =========== Managed by sonic-cfggen DO NOT edit manually! ==================== +! generated by templates/quagga/bgpd.conf.j2 with config DB data +! file: bgpd.conf +! +! +! template: common/daemons.common.conf.j2 +! +hostname multi_npu_platform_01 +password zebra +enable password zebra +! +log syslog informational +log facility local4 +! +! end of template: common/daemons.common.conf.j2! +agentx +! +! +! +! template: bgpd/bgpd.main.conf.j2 +! +! bgp multiple-instance +! +! BGP configuration +! +! TSA configuration +! +ip prefix-list PL_LoopbackV4 permit 10.1.0.32/32 +! +ipv6 prefix-list PL_LoopbackV6 permit fc00:1::/64 +! +! +route-map HIDE_INTERNAL permit 10 + set community no-export +! +! +router bgp 65100 +! + bgp log-neighbor-changes + no bgp default ipv4-unicast + no bgp ebgp-requires-policy +! + bgp bestpath as-path multipath-relax +! +! + bgp router-id 8.0.0.5 +! + network 10.1.0.32/32 + network 8.0.0.5/32 route-map HIDE_INTERNAL +! + address-family ipv6 + network fc00:1::32/64 + exit-address-family + address-family ipv6 + network fd00:4::32/128 route-map HIDE_INTERNAL + exit-address-family +! +! +! +! + address-family ipv4 + maximum-paths 64 + exit-address-family + address-family ipv6 + maximum-paths 64 + exit-address-family +! +! end of template: bgpd/bgpd.main.conf.j2 +!! +! end of template: bgpd/bgpd.conf.j2 +! diff --git a/src/sonic-config-engine/tests/sample_output/py3/bgpd_frr_dualtor.conf b/src/sonic-config-engine/tests/sample_output/py3/bgpd_frr_dualtor.conf new file mode 100644 index 000000000000..4f606b80838c --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py3/bgpd_frr_dualtor.conf @@ -0,0 +1,79 @@ +! +! template: bgpd/bgpd.conf.j2 +! +! +! =========== Managed by sonic-cfggen DO NOT edit manually! ==================== +! generated by templates/quagga/bgpd.conf.j2 with config DB data +! file: bgpd.conf +! +! +! template: common/daemons.common.conf.j2 +! +hostname switch-t0 +password zebra +enable password zebra +! +log syslog informational +log facility local4 +! +! end of template: common/daemons.common.conf.j2! +agentx +! +! +! +! template: bgpd/bgpd.main.conf.j2 +! +! bgp multiple-instance +! +! BGP configuration +! +! TSA configuration +! +ip prefix-list PL_LoopbackV4 permit 10.1.0.32/32 +! +ipv6 prefix-list PL_LoopbackV6 permit fc00:1::/64 +! +ip prefix-list LOCAL_VLAN_IPV4_PREFIX seq 5 permit 192.168.0.0/27 +! +ip prefix-list LOCAL_VLAN_IPV4_PREFIX seq 10 permit 192.168.200.0/27 +! +! +! +router bgp 65100 +! + bgp log-neighbor-changes + no bgp default ipv4-unicast + no bgp ebgp-requires-policy + coalesce-time 10000 +! + bgp bestpath as-path multipath-relax +! + bgp graceful-restart restart-time 240 + bgp graceful-restart + bgp graceful-restart preserve-fw-state + bgp graceful-restart select-defer-time 45 +! + bgp router-id 10.1.0.32 +! + network 10.1.0.32/32 +! + address-family ipv6 + network fc00:1::32/64 + exit-address-family +! + network 192.168.0.1/27 + network 192.168.200.1/27 +! +! +! + address-family ipv4 + maximum-paths 64 + exit-address-family + address-family ipv6 + maximum-paths 64 + exit-address-family +! +! end of template: bgpd/bgpd.main.conf.j2 +!! +! end of template: bgpd/bgpd.conf.j2 +! diff --git a/src/sonic-config-engine/tests/sample_output/py3/bgpd_frr_frontend_asic.conf b/src/sonic-config-engine/tests/sample_output/py3/bgpd_frr_frontend_asic.conf new file mode 100644 index 000000000000..223b7c189e27 --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py3/bgpd_frr_frontend_asic.conf @@ -0,0 +1,81 @@ +! +! template: bgpd/bgpd.conf.j2 +! +! +! =========== Managed by sonic-cfggen DO NOT edit manually! ==================== +! generated by templates/quagga/bgpd.conf.j2 with config DB data +! file: bgpd.conf +! +! +! template: common/daemons.common.conf.j2 +! +hostname multi_npu_platform_01 +password zebra +enable password zebra +! +log syslog informational +log facility local4 +! +! end of template: common/daemons.common.conf.j2! +agentx +! +! +! +! template: bgpd/bgpd.main.conf.j2 +! +! bgp multiple-instance +! +! BGP configuration +! +! TSA configuration +! +ip prefix-list PL_LoopbackV4 permit 10.1.0.32/32 +! +ipv6 prefix-list PL_LoopbackV6 permit fc00:1::/64 +! +! +route-map HIDE_INTERNAL permit 10 + set community no-export +! +! +router bgp 65100 +! + bgp log-neighbor-changes + no bgp default ipv4-unicast + no bgp ebgp-requires-policy +! + bgp bestpath as-path multipath-relax +! +! + bgp router-id 10.1.0.32 +! + network 10.1.0.32/32 + network 8.0.0.0/32 route-map HIDE_INTERNAL +! + address-family ipv6 + network fc00:1::32/64 + exit-address-family + address-family ipv6 + network fd00:1::32/128 route-map HIDE_INTERNAL + exit-address-family +! +! +! + address-family ipv4 + redistribute connected route-map HIDE_INTERNAL + exit-address-family + address-family ipv6 + redistribute connected route-map HIDE_INTERNAL + exit-address-family +! + address-family ipv4 + maximum-paths 64 + exit-address-family + address-family ipv6 + maximum-paths 64 + exit-address-family +! +! end of template: bgpd/bgpd.main.conf.j2 +!! +! end of template: bgpd/bgpd.conf.j2 +! diff --git a/src/sonic-config-engine/tests/sample_output/py3/bgpd_quagga.conf b/src/sonic-config-engine/tests/sample_output/py3/bgpd_quagga.conf index 16eb6095463b..72988e555261 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/bgpd_quagga.conf +++ b/src/sonic-config-engine/tests/sample_output/py3/bgpd_quagga.conf @@ -28,6 +28,7 @@ router bgp 65100 network fc00:1::32/64 exit-address-family network 192.168.0.1/27 + network 192.168.200.1/27 neighbor 10.0.0.57 remote-as 64600 neighbor 10.0.0.57 description ARISTA01T1 address-family ipv4 diff --git a/src/sonic-config-engine/tests/sample_output/py3/buffer-arista7050cx3-dualtor-remap-disabled.json b/src/sonic-config-engine/tests/sample_output/py3/buffer-arista7050cx3-dualtor-remap-disabled.json new file mode 100644 index 000000000000..7a5fb4589f94 --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py3/buffer-arista7050cx3-dualtor-remap-disabled.json @@ -0,0 +1,488 @@ + +{ + "CABLE_LENGTH": { + "AZURE": { + "Ethernet0": "5m", + "Ethernet2": "300m", + "Ethernet4": "5m", + "Ethernet6": "300m", + "Ethernet8": "5m", + "Ethernet10": "300m", + "Ethernet12": "5m", + "Ethernet14": "300m", + "Ethernet16": "5m", + "Ethernet18": "300m", + "Ethernet20": "5m", + "Ethernet22": "300m", + "Ethernet24": "40m", + "Ethernet28": "40m", + "Ethernet32": "40m", + "Ethernet36": "40m", + "Ethernet40": "5m", + "Ethernet42": "300m", + "Ethernet44": "5m", + "Ethernet46": "300m", + "Ethernet48": "5m", + "Ethernet50": "300m", + "Ethernet52": "5m", + "Ethernet54": "300m", + "Ethernet56": "5m", + "Ethernet58": "300m", + "Ethernet60": "5m", + "Ethernet62": "300m", + "Ethernet64": "5m", + "Ethernet66": "300m", + "Ethernet68": "5m", + "Ethernet70": "300m", + "Ethernet72": "5m", + "Ethernet74": "300m", + "Ethernet76": "5m", + "Ethernet78": "300m", + "Ethernet80": "5m", + "Ethernet82": "300m", + "Ethernet84": "5m", + "Ethernet86": "300m", + "Ethernet88": "40m", + "Ethernet92": "40m", + "Ethernet96": "40m", + "Ethernet100": "40m", + "Ethernet104": "5m", + "Ethernet106": "300m", + "Ethernet108": "5m", + "Ethernet110": "300m", + "Ethernet112": "5m", + "Ethernet114": "300m", + "Ethernet116": "5m", + "Ethernet118": "300m", + "Ethernet120": "5m", + "Ethernet122": "300m", + "Ethernet124": "5m", + "Ethernet126": "300m" + } + }, + + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "32689152", + "type": "ingress", + "mode": "dynamic", + "xoff": "2058240" + }, + "egress_lossy_pool": { + "size": "24192256", + "type": "egress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "32340992", + "type": "egress", + "mode": "static" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "static_th":"32689152" + }, + "egress_lossless_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"0", + "static_th":"32340992" + }, + "egress_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"1792", + "dynamic_th":"3" + } + }, + "BUFFER_PG": { + "Ethernet24|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet28|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet32|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet36|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet88|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet92|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet96|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet100|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet0|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet4|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet8|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet12|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet16|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet20|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet40|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet44|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet48|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet52|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet56|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet60|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet64|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet68|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet72|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet76|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet80|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet84|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet104|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet108|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet112|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet116|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet120|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet124|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + } + }, + + "BUFFER_QUEUE": { + "Ethernet24|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet28|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet32|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet36|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet88|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet92|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet96|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet100|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet0|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet4|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet8|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet12|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet16|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet20|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet40|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet44|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet48|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet52|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet56|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet60|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet64|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet68|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet72|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet76|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet80|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet84|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet104|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet108|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet112|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet116|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet120|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet124|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet24|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet28|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet32|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet36|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet88|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet92|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet96|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet100|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet0|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet4|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet8|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet12|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet16|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet20|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet40|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet44|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet48|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet52|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet56|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet60|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet64|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet68|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet72|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet76|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet80|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet84|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet104|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet108|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet112|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet116|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet120|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet124|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet24|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet28|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet32|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet36|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet88|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet92|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet96|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet100|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet0|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet4|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet8|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet12|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet16|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet20|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet40|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet44|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet48|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet52|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet56|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet60|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet64|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet68|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet72|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet76|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet80|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet84|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet104|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet108|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet112|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet116|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet120|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet124|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + } + } +} diff --git a/src/sonic-config-engine/tests/sample_output/py3/buffer-arista7050cx3-dualtor.json b/src/sonic-config-engine/tests/sample_output/py3/buffer-arista7050cx3-dualtor.json new file mode 100644 index 000000000000..01b927f86113 --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py3/buffer-arista7050cx3-dualtor.json @@ -0,0 +1,536 @@ +{ + "CABLE_LENGTH": { + "AZURE": { + "Ethernet0": "5m", + "Ethernet2": "300m", + "Ethernet4": "5m", + "Ethernet6": "300m", + "Ethernet8": "5m", + "Ethernet10": "300m", + "Ethernet12": "5m", + "Ethernet14": "300m", + "Ethernet16": "5m", + "Ethernet18": "300m", + "Ethernet20": "5m", + "Ethernet22": "300m", + "Ethernet24": "40m", + "Ethernet28": "40m", + "Ethernet32": "40m", + "Ethernet36": "40m", + "Ethernet40": "5m", + "Ethernet42": "300m", + "Ethernet44": "5m", + "Ethernet46": "300m", + "Ethernet48": "5m", + "Ethernet50": "300m", + "Ethernet52": "5m", + "Ethernet54": "300m", + "Ethernet56": "5m", + "Ethernet58": "300m", + "Ethernet60": "5m", + "Ethernet62": "300m", + "Ethernet64": "5m", + "Ethernet66": "300m", + "Ethernet68": "5m", + "Ethernet70": "300m", + "Ethernet72": "5m", + "Ethernet74": "300m", + "Ethernet76": "5m", + "Ethernet78": "300m", + "Ethernet80": "5m", + "Ethernet82": "300m", + "Ethernet84": "5m", + "Ethernet86": "300m", + "Ethernet88": "40m", + "Ethernet92": "40m", + "Ethernet96": "40m", + "Ethernet100": "40m", + "Ethernet104": "5m", + "Ethernet106": "300m", + "Ethernet108": "5m", + "Ethernet110": "300m", + "Ethernet112": "5m", + "Ethernet114": "300m", + "Ethernet116": "5m", + "Ethernet118": "300m", + "Ethernet120": "5m", + "Ethernet122": "300m", + "Ethernet124": "5m", + "Ethernet126": "300m" + } + }, + + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "32689152", + "type": "ingress", + "mode": "dynamic", + "xoff": "2058240" + }, + "egress_lossy_pool": { + "size": "24192256", + "type": "egress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "32340992", + "type": "egress", + "mode": "static" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "static_th":"32689152" + }, + "egress_lossless_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"0", + "static_th":"32340992" + }, + "egress_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"1792", + "dynamic_th":"3" + } + }, + "BUFFER_PG": { + "Ethernet24|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet28|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet32|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet36|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet88|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet92|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet96|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet100|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet0|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet4|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet8|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet12|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet16|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet20|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet40|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet44|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet48|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet52|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet56|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet60|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet64|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet68|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet72|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet76|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet80|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet84|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet104|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet108|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet112|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet116|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet120|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet124|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + } + }, + + "BUFFER_QUEUE": { + "Ethernet24|0-1": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet24|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet24|5": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet24|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet24|7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet28|0-1": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet28|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet28|5": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet28|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet28|7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet32|0-1": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet32|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet32|5": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet32|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet32|7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet36|0-1": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet36|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet36|5": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet36|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet36|7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet88|0-1": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet88|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet88|5": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet88|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet88|7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet92|0-1": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet92|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet92|5": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet92|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet92|7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet96|0-1": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet96|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet96|5": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet96|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet96|7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet100|0-1": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet100|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet100|5": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet100|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet100|7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet0|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet0|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet0|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet4|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet4|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet4|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet8|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet8|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet8|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet12|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet12|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet12|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet16|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet16|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet16|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet20|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet20|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet20|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet40|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet40|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet40|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet44|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet44|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet44|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet48|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet48|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet48|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet52|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet52|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet52|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet56|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet56|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet56|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet60|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet60|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet60|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet64|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet64|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet64|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet68|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet68|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet68|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet72|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet72|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet72|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet76|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet76|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet76|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet80|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet80|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet80|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet84|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet84|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet84|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet104|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet104|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet104|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet108|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet108|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet108|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet112|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet112|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet112|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet116|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet116|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet116|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet120|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet120|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet120|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet124|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet124|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet124|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + } + } + +} diff --git a/src/sonic-config-engine/tests/sample_output/py3/buffer-arista7060-t0.json b/src/sonic-config-engine/tests/sample_output/py3/buffer-arista7060-t0.json new file mode 100644 index 000000000000..896016852140 --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py3/buffer-arista7060-t0.json @@ -0,0 +1,437 @@ +{ + "CABLE_LENGTH": { + "AZURE": { + "Ethernet0": "5m", + "Ethernet2": "5m", + "Ethernet4": "5m", + "Ethernet6": "5m", + "Ethernet8": "5m", + "Ethernet10": "5m", + "Ethernet12": "5m", + "Ethernet14": "5m", + "Ethernet16": "5m", + "Ethernet18": "5m", + "Ethernet20": "5m", + "Ethernet22": "5m", + "Ethernet24": "5m", + "Ethernet28": "5m", + "Ethernet32": "5m", + "Ethernet36": "5m", + "Ethernet40": "5m", + "Ethernet42": "5m", + "Ethernet44": "5m", + "Ethernet46": "5m", + "Ethernet48": "5m", + "Ethernet50": "5m", + "Ethernet52": "5m", + "Ethernet54": "5m", + "Ethernet56": "5m", + "Ethernet58": "5m", + "Ethernet60": "5m", + "Ethernet62": "5m", + "Ethernet64": "5m", + "Ethernet66": "5m", + "Ethernet68": "5m", + "Ethernet70": "5m", + "Ethernet72": "5m", + "Ethernet74": "5m", + "Ethernet76": "5m", + "Ethernet78": "5m", + "Ethernet80": "5m", + "Ethernet82": "5m", + "Ethernet84": "5m", + "Ethernet86": "5m", + "Ethernet88": "5m", + "Ethernet92": "5m", + "Ethernet96": "5m", + "Ethernet100": "5m", + "Ethernet104": "5m", + "Ethernet106": "5m", + "Ethernet108": "5m", + "Ethernet110": "5m", + "Ethernet112": "40m", + "Ethernet114": "5m", + "Ethernet116": "40m", + "Ethernet118": "5m", + "Ethernet120": "40m", + "Ethernet122": "5m", + "Ethernet124": "40m", + "Ethernet126": "5m" + } + }, + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "10875072", + "type": "ingress", + "mode": "dynamic", + "xoff": "4194112" + }, + "egress_lossy_pool": { + "size": "9243812", + "type": "egress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "15982720", + "type": "egress", + "mode": "static" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool": "[BUFFER_POOL|ingress_lossless_pool]", + "size": "0", + "dynamic_th": "3" + }, + "egress_lossless_profile": { + "pool": "[BUFFER_POOL|egress_lossless_pool]", + "size": "1518", + "static_th": "15982720" + }, + "egress_lossy_profile": { + "pool": "[BUFFER_POOL|egress_lossy_pool]", + "size": "1518", + "dynamic_th": "3" + } + }, + "BUFFER_PG": { + "Ethernet112|0": { + "profile": "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet116|0": { + "profile": "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet120|0": { + "profile": "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet124|0": { + "profile": "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet4|0": { + "profile": "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet8|0": { + "profile": "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet12|0": { + "profile": "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet16|0": { + "profile": "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet20|0": { + "profile": "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet24|0": { + "profile": "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet28|0": { + "profile": "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet32|0": { + "profile": "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet36|0": { + "profile": "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet40|0": { + "profile": "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet44|0": { + "profile": "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet48|0": { + "profile": "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet52|0": { + "profile": "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet56|0": { + "profile": "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet60|0": { + "profile": "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet64|0": { + "profile": "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet68|0": { + "profile": "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet72|0": { + "profile": "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet76|0": { + "profile": "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet80|0": { + "profile": "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet84|0": { + "profile": "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet88|0": { + "profile": "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet92|0": { + "profile": "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet96|0": { + "profile": "[BUFFER_PROFILE|ingress_lossy_profile]" + } + }, + "BUFFER_QUEUE": { + "Ethernet112|3-4": { + "profile": "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet116|3-4": { + "profile": "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet120|3-4": { + "profile": "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet124|3-4": { + "profile": "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet4|3-4": { + "profile": "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet8|3-4": { + "profile": "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet12|3-4": { + "profile": "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet16|3-4": { + "profile": "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet20|3-4": { + "profile": "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet24|3-4": { + "profile": "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet28|3-4": { + "profile": "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet32|3-4": { + "profile": "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet36|3-4": { + "profile": "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet40|3-4": { + "profile": "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet44|3-4": { + "profile": "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet48|3-4": { + "profile": "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet52|3-4": { + "profile": "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet56|3-4": { + "profile": "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet60|3-4": { + "profile": "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet64|3-4": { + "profile": "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet68|3-4": { + "profile": "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet72|3-4": { + "profile": "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet76|3-4": { + "profile": "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet80|3-4": { + "profile": "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet84|3-4": { + "profile": "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet88|3-4": { + "profile": "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet92|3-4": { + "profile": "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet96|3-4": { + "profile": "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet112|0-2": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet116|0-2": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet120|0-2": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet124|0-2": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet4|0-2": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet8|0-2": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet12|0-2": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet16|0-2": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet20|0-2": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet24|0-2": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet28|0-2": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet32|0-2": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet36|0-2": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet40|0-2": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet44|0-2": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet48|0-2": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet52|0-2": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet56|0-2": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet60|0-2": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet64|0-2": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet68|0-2": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet72|0-2": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet76|0-2": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet80|0-2": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet84|0-2": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet88|0-2": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet92|0-2": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet96|0-2": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet112|5-6": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet116|5-6": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet120|5-6": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet124|5-6": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet4|5-6": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet8|5-6": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet12|5-6": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet16|5-6": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet20|5-6": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet24|5-6": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet28|5-6": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet32|5-6": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet36|5-6": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet40|5-6": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet44|5-6": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet48|5-6": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet52|5-6": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet56|5-6": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet60|5-6": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet64|5-6": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet68|5-6": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet72|5-6": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet76|5-6": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet80|5-6": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet84|5-6": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet88|5-6": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet92|5-6": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet96|5-6": { + "profile": "[BUFFER_PROFILE|egress_lossy_profile]" + } + } +} diff --git a/src/sonic-config-engine/tests/sample_output/py3/buffer-arista7260-dualtor-remap-disabled.json b/src/sonic-config-engine/tests/sample_output/py3/buffer-arista7260-dualtor-remap-disabled.json new file mode 100644 index 000000000000..1d9a90cdb13f --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py3/buffer-arista7260-dualtor-remap-disabled.json @@ -0,0 +1,938 @@ + +{ + "CABLE_LENGTH": { + "AZURE": { + "Ethernet0": "5m", + "Ethernet2": "5m", + "Ethernet4": "5m", + "Ethernet6": "5m", + "Ethernet8": "5m", + "Ethernet10": "5m", + "Ethernet12": "5m", + "Ethernet14": "5m", + "Ethernet16": "5m", + "Ethernet18": "5m", + "Ethernet20": "5m", + "Ethernet22": "5m", + "Ethernet24": "5m", + "Ethernet26": "5m", + "Ethernet28": "5m", + "Ethernet30": "5m", + "Ethernet32": "5m", + "Ethernet34": "5m", + "Ethernet36": "5m", + "Ethernet38": "5m", + "Ethernet40": "5m", + "Ethernet42": "5m", + "Ethernet44": "5m", + "Ethernet46": "5m", + "Ethernet48": "40m", + "Ethernet52": "40m", + "Ethernet56": "40m", + "Ethernet60": "40m", + "Ethernet64": "40m", + "Ethernet68": "40m", + "Ethernet72": "40m", + "Ethernet76": "40m", + "Ethernet80": "5m", + "Ethernet82": "5m", + "Ethernet84": "5m", + "Ethernet86": "5m", + "Ethernet88": "5m", + "Ethernet90": "5m", + "Ethernet92": "5m", + "Ethernet94": "5m", + "Ethernet96": "5m", + "Ethernet98": "5m", + "Ethernet100": "5m", + "Ethernet102": "5m", + "Ethernet104": "5m", + "Ethernet106": "5m", + "Ethernet108": "5m", + "Ethernet110": "5m", + "Ethernet112": "5m", + "Ethernet114": "5m", + "Ethernet116": "5m", + "Ethernet118": "5m", + "Ethernet120": "5m", + "Ethernet122": "5m", + "Ethernet124": "5m", + "Ethernet126": "5m", + "Ethernet128": "5m", + "Ethernet130": "5m", + "Ethernet132": "5m", + "Ethernet134": "5m", + "Ethernet136": "5m", + "Ethernet138": "5m", + "Ethernet140": "5m", + "Ethernet142": "5m", + "Ethernet144": "5m", + "Ethernet146": "5m", + "Ethernet148": "5m", + "Ethernet150": "5m", + "Ethernet152": "5m", + "Ethernet154": "5m", + "Ethernet156": "5m", + "Ethernet158": "5m", + "Ethernet160": "5m", + "Ethernet162": "5m", + "Ethernet164": "5m", + "Ethernet166": "5m", + "Ethernet168": "5m", + "Ethernet170": "5m", + "Ethernet172": "5m", + "Ethernet174": "5m", + "Ethernet176": "5m", + "Ethernet178": "5m", + "Ethernet180": "5m", + "Ethernet182": "5m", + "Ethernet184": "5m", + "Ethernet186": "5m", + "Ethernet188": "5m", + "Ethernet190": "5m", + "Ethernet192": "5m", + "Ethernet194": "5m", + "Ethernet196": "5m", + "Ethernet198": "5m", + "Ethernet200": "5m", + "Ethernet202": "5m", + "Ethernet204": "5m", + "Ethernet206": "5m", + "Ethernet208": "5m", + "Ethernet210": "5m", + "Ethernet212": "5m", + "Ethernet214": "5m", + "Ethernet216": "5m", + "Ethernet218": "5m", + "Ethernet220": "5m", + "Ethernet222": "5m", + "Ethernet224": "5m", + "Ethernet226": "5m", + "Ethernet228": "5m", + "Ethernet230": "5m", + "Ethernet232": "5m", + "Ethernet234": "5m", + "Ethernet236": "5m", + "Ethernet238": "5m", + "Ethernet240": "5m", + "Ethernet242": "5m", + "Ethernet244": "5m", + "Ethernet246": "5m", + "Ethernet248": "5m", + "Ethernet250": "5m", + "Ethernet252": "5m", + "Ethernet254": "5m", + "Ethernet256": "5m", + "Ethernet260": "5m" + } + }, + + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "33329088", + "type": "ingress", + "mode": "dynamic", + "xoff": "7827456" + }, + "egress_lossy_pool": { + "size": "26663272", + "type": "egress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "42349632", + "type": "egress", + "mode": "static" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "static_th":"44302336" + }, + "egress_lossless_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"0", + "static_th":"42349632" + }, + "egress_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"1664", + "dynamic_th":"-1" + } + }, + "BUFFER_PG": { + "Ethernet48|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet52|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet56|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet60|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet64|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet68|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet72|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet76|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet0|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet4|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet8|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet12|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet16|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet20|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet24|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet28|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet32|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet36|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet40|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet44|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet80|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet84|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet88|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet92|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet96|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet100|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet104|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet108|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet112|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet116|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet120|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet124|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet128|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet132|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet136|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet140|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet144|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet148|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet152|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet156|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet160|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet164|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet168|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet172|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet176|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet180|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet184|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet188|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet192|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet196|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet200|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet204|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet208|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet212|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet216|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet220|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet224|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet228|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet232|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet236|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet240|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet244|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet248|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet252|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + } + }, + + "BUFFER_QUEUE": { + "Ethernet48|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet52|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet56|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet60|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet64|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet68|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet72|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet76|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet0|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet4|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet8|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet12|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet16|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet20|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet24|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet28|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet32|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet36|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet40|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet44|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet80|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet84|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet88|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet92|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet96|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet100|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet104|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet108|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet112|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet116|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet120|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet124|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet128|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet132|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet136|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet140|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet144|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet148|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet152|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet156|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet160|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet164|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet168|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet172|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet176|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet180|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet184|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet188|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet192|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet196|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet200|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet204|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet208|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet212|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet216|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet220|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet224|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet228|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet232|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet236|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet240|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet244|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet248|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet252|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet48|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet52|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet56|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet60|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet64|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet68|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet72|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet76|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet0|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet4|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet8|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet12|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet16|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet20|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet24|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet28|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet32|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet36|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet40|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet44|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet80|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet84|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet88|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet92|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet96|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet100|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet104|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet108|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet112|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet116|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet120|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet124|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet128|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet132|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet136|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet140|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet144|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet148|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet152|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet156|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet160|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet164|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet168|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet172|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet176|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet180|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet184|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet188|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet192|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet196|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet200|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet204|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet208|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet212|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet216|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet220|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet224|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet228|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet232|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet236|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet240|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet244|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet248|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet252|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet48|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet52|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet56|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet60|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet64|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet68|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet72|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet76|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet0|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet4|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet8|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet12|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet16|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet20|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet24|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet28|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet32|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet36|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet40|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet44|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet80|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet84|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet88|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet92|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet96|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet100|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet104|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet108|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet112|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet116|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet120|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet124|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet128|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet132|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet136|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet140|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet144|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet148|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet152|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet156|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet160|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet164|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet168|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet172|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet176|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet180|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet184|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet188|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet192|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet196|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet200|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet204|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet208|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet212|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet216|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet220|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet224|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet228|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet232|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet236|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet240|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet244|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet248|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet252|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + } + } +} diff --git a/src/sonic-config-engine/tests/sample_output/py3/buffer-arista7260-dualtor.json b/src/sonic-config-engine/tests/sample_output/py3/buffer-arista7260-dualtor.json new file mode 100644 index 000000000000..7038bc974ef6 --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py3/buffer-arista7260-dualtor.json @@ -0,0 +1,986 @@ +{ + "CABLE_LENGTH": { + "AZURE": { + "Ethernet0": "5m", + "Ethernet2": "5m", + "Ethernet4": "5m", + "Ethernet6": "5m", + "Ethernet8": "5m", + "Ethernet10": "5m", + "Ethernet12": "5m", + "Ethernet14": "5m", + "Ethernet16": "5m", + "Ethernet18": "5m", + "Ethernet20": "5m", + "Ethernet22": "5m", + "Ethernet24": "5m", + "Ethernet26": "5m", + "Ethernet28": "5m", + "Ethernet30": "5m", + "Ethernet32": "5m", + "Ethernet34": "5m", + "Ethernet36": "5m", + "Ethernet38": "5m", + "Ethernet40": "5m", + "Ethernet42": "5m", + "Ethernet44": "5m", + "Ethernet46": "5m", + "Ethernet48": "40m", + "Ethernet52": "40m", + "Ethernet56": "40m", + "Ethernet60": "40m", + "Ethernet64": "40m", + "Ethernet68": "40m", + "Ethernet72": "40m", + "Ethernet76": "40m", + "Ethernet80": "5m", + "Ethernet82": "5m", + "Ethernet84": "5m", + "Ethernet86": "5m", + "Ethernet88": "5m", + "Ethernet90": "5m", + "Ethernet92": "5m", + "Ethernet94": "5m", + "Ethernet96": "5m", + "Ethernet98": "5m", + "Ethernet100": "5m", + "Ethernet102": "5m", + "Ethernet104": "5m", + "Ethernet106": "5m", + "Ethernet108": "5m", + "Ethernet110": "5m", + "Ethernet112": "5m", + "Ethernet114": "5m", + "Ethernet116": "5m", + "Ethernet118": "5m", + "Ethernet120": "5m", + "Ethernet122": "5m", + "Ethernet124": "5m", + "Ethernet126": "5m", + "Ethernet128": "5m", + "Ethernet130": "5m", + "Ethernet132": "5m", + "Ethernet134": "5m", + "Ethernet136": "5m", + "Ethernet138": "5m", + "Ethernet140": "5m", + "Ethernet142": "5m", + "Ethernet144": "5m", + "Ethernet146": "5m", + "Ethernet148": "5m", + "Ethernet150": "5m", + "Ethernet152": "5m", + "Ethernet154": "5m", + "Ethernet156": "5m", + "Ethernet158": "5m", + "Ethernet160": "5m", + "Ethernet162": "5m", + "Ethernet164": "5m", + "Ethernet166": "5m", + "Ethernet168": "5m", + "Ethernet170": "5m", + "Ethernet172": "5m", + "Ethernet174": "5m", + "Ethernet176": "5m", + "Ethernet178": "5m", + "Ethernet180": "5m", + "Ethernet182": "5m", + "Ethernet184": "5m", + "Ethernet186": "5m", + "Ethernet188": "5m", + "Ethernet190": "5m", + "Ethernet192": "5m", + "Ethernet194": "5m", + "Ethernet196": "5m", + "Ethernet198": "5m", + "Ethernet200": "5m", + "Ethernet202": "5m", + "Ethernet204": "5m", + "Ethernet206": "5m", + "Ethernet208": "5m", + "Ethernet210": "5m", + "Ethernet212": "5m", + "Ethernet214": "5m", + "Ethernet216": "5m", + "Ethernet218": "5m", + "Ethernet220": "5m", + "Ethernet222": "5m", + "Ethernet224": "5m", + "Ethernet226": "5m", + "Ethernet228": "5m", + "Ethernet230": "5m", + "Ethernet232": "5m", + "Ethernet234": "5m", + "Ethernet236": "5m", + "Ethernet238": "5m", + "Ethernet240": "5m", + "Ethernet242": "5m", + "Ethernet244": "5m", + "Ethernet246": "5m", + "Ethernet248": "5m", + "Ethernet250": "5m", + "Ethernet252": "5m", + "Ethernet254": "5m", + "Ethernet256": "5m", + "Ethernet260": "5m" + } + }, + + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "33169344", + "type": "ingress", + "mode": "dynamic", + "xoff": "7827456" + }, + "egress_lossy_pool": { + "size": "26535808", + "type": "egress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "42349632", + "type": "egress", + "mode": "static" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "static_th":"44302336" + }, + "egress_lossless_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"0", + "static_th":"42349632" + }, + "egress_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"1664", + "dynamic_th":"-1" + } + }, + "BUFFER_PG": { + "Ethernet48|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet52|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet56|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet60|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet64|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet68|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet72|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet76|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet0|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet4|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet8|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet12|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet16|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet20|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet24|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet28|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet32|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet36|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet40|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet44|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet80|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet84|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet88|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet92|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet96|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet100|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet104|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet108|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet112|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet116|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet120|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet124|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet128|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet132|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet136|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet140|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet144|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet148|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet152|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet156|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet160|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet164|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet168|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet172|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet176|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet180|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet184|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet188|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet192|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet196|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet200|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet204|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet208|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet212|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet216|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet220|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet224|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet228|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet232|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet236|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet240|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet244|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet248|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet252|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + } + }, + + "BUFFER_QUEUE": { + "Ethernet48|0-1": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet48|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet48|5": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet48|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet48|7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet52|0-1": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet52|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet52|5": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet52|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet52|7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet56|0-1": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet56|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet56|5": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet56|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet56|7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet60|0-1": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet60|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet60|5": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet60|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet60|7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet64|0-1": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet64|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet64|5": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet64|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet64|7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet68|0-1": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet68|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet68|5": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet68|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet68|7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet72|0-1": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet72|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet72|5": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet72|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet72|7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet76|0-1": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet76|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet76|5": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet76|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet76|7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet0|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet0|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet0|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet4|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet4|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet4|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet8|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet8|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet8|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet12|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet12|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet12|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet16|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet16|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet16|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet20|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet20|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet20|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet24|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet24|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet24|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet28|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet28|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet28|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet32|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet32|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet32|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet36|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet36|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet36|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet40|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet40|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet40|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet44|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet44|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet44|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet80|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet80|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet80|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet84|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet84|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet84|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet88|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet88|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet88|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet92|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet92|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet92|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet96|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet96|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet96|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet100|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet100|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet100|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet104|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet104|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet104|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet108|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet108|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet108|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet112|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet112|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet112|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet116|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet116|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet116|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet120|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet120|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet120|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet124|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet124|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet124|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet128|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet128|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet128|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet132|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet132|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet132|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet136|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet136|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet136|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet140|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet140|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet140|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet144|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet144|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet144|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet148|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet148|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet148|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet152|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet152|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet152|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet156|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet156|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet156|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet160|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet160|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet160|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet164|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet164|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet164|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet168|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet168|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet168|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet172|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet172|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet172|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet176|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet176|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet176|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet180|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet180|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet180|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet184|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet184|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet184|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet188|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet188|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet188|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet192|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet192|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet192|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet196|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet196|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet196|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet200|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet200|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet200|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet204|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet204|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet204|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet208|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet208|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet208|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet212|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet212|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet212|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet216|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet216|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet216|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet220|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet220|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet220|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet224|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet224|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet224|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet228|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet228|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet228|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet232|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet232|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet232|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet236|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet236|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet236|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet240|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet240|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet240|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet244|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet244|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet244|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet248|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet248|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet248|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet252|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet252|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet252|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + } + } + +} diff --git a/src/sonic-config-engine/tests/sample_output/py3/buffer-arista7260-t1-remap-disabled.json b/src/sonic-config-engine/tests/sample_output/py3/buffer-arista7260-t1-remap-disabled.json new file mode 100644 index 000000000000..344a2e74abd1 --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py3/buffer-arista7260-t1-remap-disabled.json @@ -0,0 +1,450 @@ + +{ + "CABLE_LENGTH": { + "AZURE": { + "Ethernet0": "300m", + "Ethernet4": "300m", + "Ethernet8": "300m", + "Ethernet12": "300m", + "Ethernet16": "300m", + "Ethernet20": "300m", + "Ethernet24": "300m", + "Ethernet28": "300m", + "Ethernet32": "300m", + "Ethernet36": "300m", + "Ethernet40": "300m", + "Ethernet44": "300m", + "Ethernet48": "300m", + "Ethernet52": "300m", + "Ethernet56": "300m", + "Ethernet60": "300m", + "Ethernet64": "300m", + "Ethernet68": "300m", + "Ethernet72": "300m", + "Ethernet76": "300m", + "Ethernet80": "300m", + "Ethernet84": "300m", + "Ethernet88": "300m", + "Ethernet92": "300m", + "Ethernet96": "300m", + "Ethernet100": "300m", + "Ethernet104": "300m", + "Ethernet108": "300m", + "Ethernet112": "300m", + "Ethernet116": "300m", + "Ethernet120": "300m", + "Ethernet124": "300m", + "Ethernet128": "300m", + "Ethernet132": "300m", + "Ethernet136": "40m", + "Ethernet140": "300m", + "Ethernet144": "40m", + "Ethernet148": "40m", + "Ethernet152": "40m", + "Ethernet156": "40m", + "Ethernet160": "300m", + "Ethernet164": "300m", + "Ethernet168": "40m", + "Ethernet172": "300m", + "Ethernet176": "40m", + "Ethernet180": "40m", + "Ethernet184": "40m", + "Ethernet188": "40m", + "Ethernet192": "300m", + "Ethernet196": "300m", + "Ethernet200": "40m", + "Ethernet204": "300m", + "Ethernet208": "40m", + "Ethernet212": "40m", + "Ethernet216": "40m", + "Ethernet220": "40m", + "Ethernet224": "300m", + "Ethernet228": "300m", + "Ethernet232": "40m", + "Ethernet236": "300m", + "Ethernet240": "40m", + "Ethernet244": "40m", + "Ethernet248": "40m", + "Ethernet252": "40m", + "Ethernet256": "300m", + "Ethernet260": "300m" + } + }, + + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "33582016", + "type": "ingress", + "mode": "dynamic", + "xoff": "8965632" + }, + "egress_lossy_pool": { + "size": "26866112", + "type": "egress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "43481152", + "type": "egress", + "mode": "static" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "static_th":"44302336" + }, + "egress_lossless_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"0", + "static_th":"43481152" + }, + "egress_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"1664", + "dynamic_th":"-1" + } + }, + "BUFFER_PG": { + "Ethernet136|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet0|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet4|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet144|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet148|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet16|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet20|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet152|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet156|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet64|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet68|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet168|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet176|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet80|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet84|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet180|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet184|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet188|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet200|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet208|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet212|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet216|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet220|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet232|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet240|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet244|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet248|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet252|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + } + }, + + "BUFFER_QUEUE": { + "Ethernet136|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet0|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet4|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet144|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet148|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet16|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet20|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet152|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet156|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet64|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet68|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet168|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet176|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet80|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet84|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet180|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet184|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet188|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet200|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet208|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet212|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet216|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet220|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet232|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet240|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet244|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet248|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet252|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet136|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet0|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet4|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet144|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet148|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet16|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet20|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet152|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet156|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet64|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet68|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet168|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet176|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet80|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet84|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet180|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet184|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet188|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet200|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet208|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet212|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet216|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet220|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet232|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet240|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet244|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet248|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet252|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet136|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet0|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet4|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet144|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet148|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet16|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet20|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet152|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet156|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet64|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet68|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet168|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet176|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet80|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet84|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet180|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet184|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet188|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet200|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet208|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet212|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet216|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet220|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet232|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet240|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet244|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet248|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet252|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + } + } +} diff --git a/src/sonic-config-engine/tests/sample_output/py3/buffer-arista7260-t1.json b/src/sonic-config-engine/tests/sample_output/py3/buffer-arista7260-t1.json new file mode 100644 index 000000000000..ecaa1a88db48 --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py3/buffer-arista7260-t1.json @@ -0,0 +1,570 @@ +{ + "CABLE_LENGTH": { + "AZURE": { + "Ethernet0": "300m", + "Ethernet4": "300m", + "Ethernet8": "300m", + "Ethernet12": "300m", + "Ethernet16": "300m", + "Ethernet20": "300m", + "Ethernet24": "300m", + "Ethernet28": "300m", + "Ethernet32": "300m", + "Ethernet36": "300m", + "Ethernet40": "300m", + "Ethernet44": "300m", + "Ethernet48": "300m", + "Ethernet52": "300m", + "Ethernet56": "300m", + "Ethernet60": "300m", + "Ethernet64": "300m", + "Ethernet68": "300m", + "Ethernet72": "300m", + "Ethernet76": "300m", + "Ethernet80": "300m", + "Ethernet84": "300m", + "Ethernet88": "300m", + "Ethernet92": "300m", + "Ethernet96": "300m", + "Ethernet100": "300m", + "Ethernet104": "300m", + "Ethernet108": "300m", + "Ethernet112": "300m", + "Ethernet116": "300m", + "Ethernet120": "300m", + "Ethernet124": "300m", + "Ethernet128": "300m", + "Ethernet132": "300m", + "Ethernet136": "40m", + "Ethernet140": "300m", + "Ethernet144": "40m", + "Ethernet148": "40m", + "Ethernet152": "40m", + "Ethernet156": "40m", + "Ethernet160": "300m", + "Ethernet164": "300m", + "Ethernet168": "40m", + "Ethernet172": "300m", + "Ethernet176": "40m", + "Ethernet180": "40m", + "Ethernet184": "40m", + "Ethernet188": "40m", + "Ethernet192": "300m", + "Ethernet196": "300m", + "Ethernet200": "40m", + "Ethernet204": "300m", + "Ethernet208": "40m", + "Ethernet212": "40m", + "Ethernet216": "40m", + "Ethernet220": "40m", + "Ethernet224": "300m", + "Ethernet228": "300m", + "Ethernet232": "40m", + "Ethernet236": "300m", + "Ethernet240": "40m", + "Ethernet244": "40m", + "Ethernet248": "40m", + "Ethernet252": "40m", + "Ethernet256": "300m", + "Ethernet260": "300m" + } + }, + + "BUFFER_POOL": { + "ingress_lossless_pool": { + "size": "33262528", + "type": "ingress", + "mode": "dynamic", + "xoff": "8965632" + }, + "egress_lossy_pool": { + "size": "26610688", + "type": "egress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "43481152", + "type": "egress", + "mode": "static" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "static_th":"44302336" + }, + "egress_lossless_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"0", + "static_th":"43481152" + }, + "egress_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"1664", + "dynamic_th":"-1" + } + }, + "BUFFER_PG": { + "Ethernet136|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet0|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet4|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet144|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet148|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet16|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet20|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet152|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet156|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet64|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet68|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet168|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet176|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet80|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet84|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet180|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet184|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet188|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet200|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet208|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet212|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet216|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet220|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet232|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet240|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet244|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet248|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet252|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + } + }, + + "BUFFER_QUEUE": { + "Ethernet136|0-1": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet136|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet136|5": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet136|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet136|7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet0|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet0|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet0|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet4|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet4|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet4|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet144|0-1": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet144|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet144|5": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet144|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet144|7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet148|0-1": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet148|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet148|5": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet148|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet148|7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet16|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet16|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet16|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet20|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet20|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet20|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet152|0-1": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet152|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet152|5": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet152|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet152|7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet156|0-1": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet156|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet156|5": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet156|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet156|7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet64|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet64|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet64|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet68|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet68|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet68|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet168|0-1": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet168|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet168|5": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet168|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet168|7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet176|0-1": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet176|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet176|5": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet176|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet176|7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet80|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet80|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet80|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet84|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet84|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet84|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet180|0-1": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet180|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet180|5": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet180|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet180|7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet184|0-1": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet184|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet184|5": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet184|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet184|7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet188|0-1": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet188|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet188|5": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet188|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet188|7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet200|0-1": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet200|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet200|5": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet200|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet200|7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet208|0-1": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet208|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet208|5": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet208|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet208|7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet212|0-1": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet212|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet212|5": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet212|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet212|7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet216|0-1": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet216|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet216|5": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet216|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet216|7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet220|0-1": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet220|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet220|5": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet220|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet220|7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet232|0-1": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet232|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet232|5": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet232|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet232|7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet240|0-1": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet240|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet240|5": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet240|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet240|7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet244|0-1": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet244|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet244|5": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet244|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet244|7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet248|0-1": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet248|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet248|5": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet248|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet248|7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet252|0-1": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet252|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet252|5": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet252|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet252|7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_profile]" + } + } + +} diff --git a/src/sonic-config-engine/tests/sample_output/py3/buffers-dell6100.json b/src/sonic-config-engine/tests/sample_output/py3/buffers-dell6100.json index 39fb042cc4cb..0c8bb58d3067 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/buffers-dell6100.json +++ b/src/sonic-config-engine/tests/sample_output/py3/buffers-dell6100.json @@ -65,7 +65,9 @@ "Ethernet60": "5m", "Ethernet61": "5m", "Ethernet62": "5m", - "Ethernet63": "5m" + "Ethernet63": "5m", + "Ethernet64": "5m", + "Ethernet65": "5m" } }, @@ -91,7 +93,7 @@ "ingress_lossy_profile": { "pool":"[BUFFER_POOL|ingress_lossless_pool]", "size":"0", - "dynamic_th":"3" + "static_th":"10875072" }, "egress_lossless_profile": { "pool":"[BUFFER_POOL|egress_lossless_pool]", diff --git a/src/sonic-config-engine/tests/sample_output/py3/buffers-mellanox2410.json b/src/sonic-config-engine/tests/sample_output/py3/buffers-mellanox2410.json new file mode 100644 index 000000000000..0e989b4c2cc5 --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py3/buffers-mellanox2410.json @@ -0,0 +1,1163 @@ + +{ + "CABLE_LENGTH": { + "AZURE": { + "Ethernet0": "300m", + "Ethernet4": "300m", + "Ethernet8": "300m", + "Ethernet12": "300m", + "Ethernet16": "300m", + "Ethernet20": "300m", + "Ethernet24": "300m", + "Ethernet28": "300m", + "Ethernet32": "300m", + "Ethernet36": "300m", + "Ethernet40": "300m", + "Ethernet44": "300m", + "Ethernet48": "300m", + "Ethernet52": "300m", + "Ethernet56": "300m", + "Ethernet60": "300m", + "Ethernet64": "40m", + "Ethernet68": "40m", + "Ethernet72": "40m", + "Ethernet76": "40m", + "Ethernet80": "40m", + "Ethernet84": "40m", + "Ethernet88": "40m", + "Ethernet92": "40m", + "Ethernet96": "40m", + "Ethernet100": "40m", + "Ethernet104": "40m", + "Ethernet108": "40m", + "Ethernet112": "40m", + "Ethernet116": "40m", + "Ethernet120": "40m", + "Ethernet124": "40m", + "Ethernet128": "5m", + "Ethernet132": "5m", + "Ethernet136": "5m", + "Ethernet140": "5m", + "Ethernet144": "5m", + "Ethernet148": "5m", + "Ethernet152": "5m", + "Ethernet156": "5m", + "Ethernet160": "5m", + "Ethernet164": "5m", + "Ethernet168": "5m", + "Ethernet172": "5m", + "Ethernet176": "5m", + "Ethernet180": "5m", + "Ethernet184": "5m", + "Ethernet188": "5m", + "Ethernet192": "5m", + "Ethernet196": "5m", + "Ethernet200": "5m", + "Ethernet204": "5m", + "Ethernet208": "5m", + "Ethernet212": "5m", + "Ethernet216": "5m", + "Ethernet220": "5m" + } + }, + + "BUFFER_POOL": { + "ingress_zero_pool" : { + "mode": "static", + "type": "ingress", + "size": "0" + }, + "ingress_lossless_pool": { + "size": "3302912", + "type": "ingress", + "mode": "dynamic" + }, + "ingress_lossy_pool": { + "size": "3302912", + "type": "ingress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "13945824", + "type": "egress", + "mode": "dynamic" + }, + "egress_lossy_pool": { + "size": "3302912", + "type": "egress", + "mode": "dynamic" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_pg_zero_profile" : { + "pool":"[BUFFER_POOL|ingress_zero_pool]", + "size":"0", + "static_th":"0" + }, + "ingress_lossless_zero_profile" : { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "dynamic_th":"-8" + }, + "ingress_lossy_zero_profile" : { + "pool":"[BUFFER_POOL|ingress_lossy_pool]", + "size":"0", + "dynamic_th":"-8" + }, + "egress_lossless_zero_profile" : { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"0", + "dynamic_th":"-8" + }, + "egress_lossy_zero_profile" : { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"0", + "dynamic_th":"-8" + }, + "ingress_lossless_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "dynamic_th":"7" + }, + "ingress_lossy_profile": { + "pool":"[BUFFER_POOL|ingress_lossy_pool]", + "size":"0", + "dynamic_th":"3" + }, + "egress_lossless_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"0", + "dynamic_th":"7" + }, + "egress_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"9216", + "dynamic_th":"7" + }, + "q_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"0", + "dynamic_th":"3" + } + }, + "BUFFER_PORT_INGRESS_PROFILE_LIST": { + "Ethernet64": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet0": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet4": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet68": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet72": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet8": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet12": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet76": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet80": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet16": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet20": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet84": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet88": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet24": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet28": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet92": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet96": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet32": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet36": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet100": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet104": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet40": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet44": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet108": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet112": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet48": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet52": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet116": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet120": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet56": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet60": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet124": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile],[BUFFER_PROFILE|ingress_lossy_profile]" + } +, + "Ethernet128": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile],[BUFFER_PROFILE|ingress_lossy_zero_profile]" + }, + "Ethernet132": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile],[BUFFER_PROFILE|ingress_lossy_zero_profile]" + }, + "Ethernet136": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile],[BUFFER_PROFILE|ingress_lossy_zero_profile]" + }, + "Ethernet140": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile],[BUFFER_PROFILE|ingress_lossy_zero_profile]" + }, + "Ethernet144": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile],[BUFFER_PROFILE|ingress_lossy_zero_profile]" + }, + "Ethernet148": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile],[BUFFER_PROFILE|ingress_lossy_zero_profile]" + }, + "Ethernet152": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile],[BUFFER_PROFILE|ingress_lossy_zero_profile]" + }, + "Ethernet156": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile],[BUFFER_PROFILE|ingress_lossy_zero_profile]" + }, + "Ethernet160": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile],[BUFFER_PROFILE|ingress_lossy_zero_profile]" + }, + "Ethernet164": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile],[BUFFER_PROFILE|ingress_lossy_zero_profile]" + }, + "Ethernet168": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile],[BUFFER_PROFILE|ingress_lossy_zero_profile]" + }, + "Ethernet172": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile],[BUFFER_PROFILE|ingress_lossy_zero_profile]" + }, + "Ethernet176": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile],[BUFFER_PROFILE|ingress_lossy_zero_profile]" + }, + "Ethernet180": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile],[BUFFER_PROFILE|ingress_lossy_zero_profile]" + }, + "Ethernet184": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile],[BUFFER_PROFILE|ingress_lossy_zero_profile]" + }, + "Ethernet188": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile],[BUFFER_PROFILE|ingress_lossy_zero_profile]" + }, + "Ethernet192": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile],[BUFFER_PROFILE|ingress_lossy_zero_profile]" + }, + "Ethernet196": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile],[BUFFER_PROFILE|ingress_lossy_zero_profile]" + }, + "Ethernet200": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile],[BUFFER_PROFILE|ingress_lossy_zero_profile]" + }, + "Ethernet204": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile],[BUFFER_PROFILE|ingress_lossy_zero_profile]" + }, + "Ethernet208": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile],[BUFFER_PROFILE|ingress_lossy_zero_profile]" + }, + "Ethernet212": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile],[BUFFER_PROFILE|ingress_lossy_zero_profile]" + }, + "Ethernet216": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile],[BUFFER_PROFILE|ingress_lossy_zero_profile]" + }, + "Ethernet220": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile],[BUFFER_PROFILE|ingress_lossy_zero_profile]" + } + }, + "BUFFER_PORT_EGRESS_PROFILE_LIST": { + "Ethernet64": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet0": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet4": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet68": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet72": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet8": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet12": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet76": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet80": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet16": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet20": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet84": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet88": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet24": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet28": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet92": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet96": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet32": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet36": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet100": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet104": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet40": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet44": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet108": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet112": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet48": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet52": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet116": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet120": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet56": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet60": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet124": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + } +, + "Ethernet128": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet132": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet136": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet140": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet144": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet148": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet152": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet156": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet160": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet164": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet168": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet172": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet176": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet180": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet184": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet188": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet192": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet196": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet200": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet204": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet208": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet212": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet216": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet220": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + } + }, + "BUFFER_PG": { + "Ethernet64|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet0|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet4|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet68|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet72|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet8|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet12|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet76|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet80|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet16|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet20|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet84|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet88|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet24|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet28|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet92|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet96|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet32|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet36|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet100|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet104|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet40|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet44|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet108|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet112|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet48|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet52|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet116|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet120|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet56|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet60|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet124|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + } +, "Ethernet128|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet132|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet136|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet140|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet144|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet148|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet152|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet156|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet160|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet164|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet168|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet172|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet176|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet180|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet184|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet188|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet192|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet196|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet200|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet204|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet208|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet212|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet216|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet220|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + } + }, + + "BUFFER_QUEUE": { + "Ethernet64|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet0|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet4|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet68|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet72|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet8|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet12|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet76|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet80|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet16|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet20|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet84|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet88|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet24|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet28|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet92|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet96|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet32|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet36|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet100|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet104|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet40|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet44|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet108|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet112|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet48|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet52|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet116|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet120|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet56|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet60|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet124|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet64|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet0|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet4|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet68|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet72|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet8|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet12|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet76|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet80|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet16|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet20|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet84|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet88|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet24|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet28|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet92|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet96|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet32|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet36|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet100|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet104|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet40|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet44|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet108|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet112|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet48|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet52|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet116|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet120|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet56|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet60|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet124|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet64|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet0|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet4|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet68|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet72|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet8|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet12|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet76|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet80|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet16|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet20|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet84|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet88|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet24|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet28|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet92|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet96|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet32|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet36|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet100|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet104|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet40|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet44|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet108|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet112|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet48|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet52|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet116|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet120|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet56|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet60|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet124|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + } +, + "Ethernet128|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet132|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet136|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet140|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet144|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet148|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet152|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet156|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet160|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet164|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet168|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet172|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet176|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet180|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet184|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet188|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet192|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet196|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet200|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet204|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet208|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet212|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet216|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet220|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet128|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet132|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet136|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet140|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet144|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet148|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet152|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet156|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet160|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet164|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet168|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet172|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet176|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet180|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet184|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet188|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet192|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet196|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet200|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet204|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet208|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet212|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet216|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet220|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet128|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet132|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet136|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet140|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet144|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet148|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet152|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet156|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet160|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet164|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet168|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet172|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet176|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet180|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet184|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet188|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet192|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet196|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet200|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet204|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet208|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet212|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet216|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet220|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + } + } +} diff --git a/src/sonic-config-engine/tests/sample_output/py3/buffers-mellanox2700.json b/src/sonic-config-engine/tests/sample_output/py3/buffers-mellanox2700.json new file mode 100644 index 000000000000..1042578564ef --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py3/buffers-mellanox2700.json @@ -0,0 +1,1154 @@ + +{ + "CABLE_LENGTH": { + "AZURE": { + "Ethernet0": "5m", + "Ethernet2": "5m", + "Ethernet4": "5m", + "Ethernet6": "5m", + "Ethernet8": "5m", + "Ethernet10": "5m", + "Ethernet12": "5m", + "Ethernet14": "5m", + "Ethernet16": "5m", + "Ethernet18": "5m", + "Ethernet20": "5m", + "Ethernet22": "5m", + "Ethernet24": "5m", + "Ethernet28": "5m", + "Ethernet32": "5m", + "Ethernet36": "5m", + "Ethernet40": "5m", + "Ethernet42": "5m", + "Ethernet44": "5m", + "Ethernet46": "5m", + "Ethernet48": "5m", + "Ethernet50": "5m", + "Ethernet52": "5m", + "Ethernet54": "5m", + "Ethernet56": "5m", + "Ethernet58": "5m", + "Ethernet60": "5m", + "Ethernet62": "5m", + "Ethernet64": "40m", + "Ethernet66": "40m", + "Ethernet68": "40m", + "Ethernet70": "40m", + "Ethernet72": "5m", + "Ethernet74": "5m", + "Ethernet76": "5m", + "Ethernet78": "5m", + "Ethernet80": "5m", + "Ethernet82": "5m", + "Ethernet84": "5m", + "Ethernet86": "5m", + "Ethernet88": "5m", + "Ethernet92": "5m", + "Ethernet96": "5m", + "Ethernet100": "5m", + "Ethernet104": "5m", + "Ethernet106": "5m", + "Ethernet108": "5m", + "Ethernet110": "5m", + "Ethernet112": "5m", + "Ethernet114": "5m", + "Ethernet116": "5m", + "Ethernet118": "5m", + "Ethernet120": "5m", + "Ethernet122": "5m", + "Ethernet124": "5m", + "Ethernet126": "5m" + } + }, + + "BUFFER_POOL": { + "ingress_zero_pool" : { + "mode": "static", + "type": "ingress", + "size": "0" + }, + "ingress_lossless_pool": { + "size": "7719936", + "xoff": "1032192", + "type": "ingress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "13945824", + "type": "egress", + "mode": "dynamic" + }, + "egress_lossy_pool": { + "size": "7719936", + "type": "egress", + "mode": "dynamic" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_pg_zero_profile" : { + "pool":"[BUFFER_POOL|ingress_zero_pool]", + "size":"0", + "static_th":"0" + }, + "ingress_lossless_zero_profile" : { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "dynamic_th":"-8" + }, + "egress_lossless_zero_profile" : { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"0", + "dynamic_th":"-8" + }, + "egress_lossy_zero_profile" : { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"0", + "dynamic_th":"-8" + }, + "ingress_lossless_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "dynamic_th":"7" + }, + "ingress_lossy_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "dynamic_th":"3" + }, + "egress_lossless_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"0", + "dynamic_th":"7" + }, + "egress_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"9216", + "dynamic_th":"7" + }, + "q_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"0", + "dynamic_th":"3" + } + }, + "BUFFER_PORT_INGRESS_PROFILE_LIST": { + "Ethernet64": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet66": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet68": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet70": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet2": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet4": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet6": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet8": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet10": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet12": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet14": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet16": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet18": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet20": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet22": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet24": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet28": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet32": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet36": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet40": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet42": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet44": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet46": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet48": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet50": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet52": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet54": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet56": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + } +, + "Ethernet0": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet58": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet60": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet62": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet72": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet74": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet76": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet78": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet80": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet82": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet84": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet86": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet88": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet92": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet96": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet100": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet104": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet106": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet108": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet110": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet112": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet114": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet116": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet118": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet120": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet122": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet124": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet126": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + } + }, + "BUFFER_PORT_EGRESS_PROFILE_LIST": { + "Ethernet64": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet66": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet68": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet70": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet2": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet4": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet6": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet8": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet10": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet12": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet14": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet16": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet18": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet20": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet22": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet24": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet28": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet32": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet36": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet40": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet42": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet44": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet46": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet48": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet50": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet52": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet54": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet56": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + } +, + "Ethernet0": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet58": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet60": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet62": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet72": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet74": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet76": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet78": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet80": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet82": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet84": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet86": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet88": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet92": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet96": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet100": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet104": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet106": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet108": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet110": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet112": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet114": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet116": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet118": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet120": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet122": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet124": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet126": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + } + }, + "BUFFER_PG": { + "Ethernet64|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet66|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet68|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet70|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet2|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet4|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet6|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet8|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet10|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet12|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet14|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet16|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet18|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet20|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet22|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet24|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet28|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet32|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet36|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet40|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet42|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet44|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet46|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet48|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet50|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet52|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet54|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet56|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + } +, "Ethernet0|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet58|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet60|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet62|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet72|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet74|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet76|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet78|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet80|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet82|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet84|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet86|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet88|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet92|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet96|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet100|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet104|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet106|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet108|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet110|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet112|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet114|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet116|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet118|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet120|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet122|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet124|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet126|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + } + }, + + "BUFFER_QUEUE": { + "Ethernet64|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet66|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet68|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet70|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet2|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet4|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet6|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet8|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet10|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet12|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet14|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet16|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet18|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet20|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet22|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet24|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet28|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet32|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet36|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet40|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet42|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet44|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet46|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet48|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet50|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet52|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet54|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet56|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet64|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet66|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet68|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet70|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet2|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet4|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet6|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet8|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet10|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet12|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet14|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet16|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet18|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet20|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet22|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet24|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet28|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet32|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet36|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet40|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet42|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet44|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet46|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet48|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet50|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet52|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet54|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet56|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet64|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet66|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet68|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet70|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet2|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet4|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet6|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet8|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet10|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet12|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet14|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet16|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet18|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet20|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet22|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet24|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet28|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet32|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet36|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet40|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet42|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet44|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet46|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet48|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet50|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet52|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet54|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet56|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + } +, + "Ethernet0|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet58|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet60|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet62|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet72|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet74|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet76|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet78|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet80|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet82|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet84|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet86|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet88|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet92|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet96|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet100|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet104|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet106|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet108|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet110|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet112|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet114|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet116|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet118|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet120|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet122|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet124|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet126|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet0|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet58|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet60|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet62|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet72|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet74|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet76|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet78|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet80|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet82|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet84|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet86|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet88|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet92|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet96|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet100|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet104|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet106|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet108|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet110|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet112|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet114|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet116|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet118|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet120|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet122|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet124|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet126|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet0|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet58|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet60|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet62|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet72|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet74|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet76|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet78|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet80|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet82|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet84|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet86|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet88|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet92|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet96|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet100|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet104|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet106|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet108|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet110|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet112|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet114|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet116|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet118|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet120|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet122|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet124|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet126|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + } + } +} diff --git a/src/sonic-config-engine/tests/sample_output/py3/buffers-mellanox4600c-t1-dynamic-remap-disabled.json b/src/sonic-config-engine/tests/sample_output/py3/buffers-mellanox4600c-t1-dynamic-remap-disabled.json new file mode 100644 index 000000000000..53147866a2cb --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py3/buffers-mellanox4600c-t1-dynamic-remap-disabled.json @@ -0,0 +1,1481 @@ + +{ + "CABLE_LENGTH": { + "AZURE": { + "Ethernet0": "300m", + "Ethernet4": "300m", + "Ethernet8": "5m", + "Ethernet12": "5m", + "Ethernet16": "300m", + "Ethernet20": "300m", + "Ethernet24": "5m", + "Ethernet28": "5m", + "Ethernet32": "5m", + "Ethernet36": "5m", + "Ethernet40": "5m", + "Ethernet44": "5m", + "Ethernet48": "5m", + "Ethernet52": "5m", + "Ethernet56": "5m", + "Ethernet60": "5m", + "Ethernet64": "300m", + "Ethernet68": "300m", + "Ethernet72": "5m", + "Ethernet76": "5m", + "Ethernet80": "300m", + "Ethernet84": "300m", + "Ethernet88": "5m", + "Ethernet92": "5m", + "Ethernet96": "5m", + "Ethernet100": "5m", + "Ethernet104": "5m", + "Ethernet108": "5m", + "Ethernet112": "5m", + "Ethernet116": "5m", + "Ethernet120": "5m", + "Ethernet124": "5m", + "Ethernet128": "5m", + "Ethernet132": "5m", + "Ethernet136": "40m", + "Ethernet140": "5m", + "Ethernet144": "40m", + "Ethernet148": "40m", + "Ethernet152": "40m", + "Ethernet156": "40m", + "Ethernet160": "5m", + "Ethernet164": "5m", + "Ethernet168": "40m", + "Ethernet172": "5m", + "Ethernet176": "40m", + "Ethernet180": "40m", + "Ethernet184": "40m", + "Ethernet188": "40m", + "Ethernet192": "5m", + "Ethernet196": "5m", + "Ethernet200": "40m", + "Ethernet204": "5m", + "Ethernet208": "40m", + "Ethernet212": "40m", + "Ethernet216": "40m", + "Ethernet220": "40m", + "Ethernet224": "5m", + "Ethernet228": "5m", + "Ethernet232": "40m", + "Ethernet236": "5m", + "Ethernet240": "40m", + "Ethernet244": "40m", + "Ethernet248": "40m", + "Ethernet252": "40m" + } + }, + + "BUFFER_POOL": { + "ingress_lossless_pool": { + "type": "ingress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "60817392", + "type": "egress", + "mode": "dynamic" + }, + "egress_lossy_pool": { + "type": "egress", + "mode": "dynamic" + } + }, + "BUFFER_PROFILE": { + "ingress_lossless_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "dynamic_th":"7" + }, + "ingress_lossy_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "dynamic_th":"3" + }, + "egress_lossless_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"0", + "dynamic_th":"7" + }, + "egress_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"9216", + "dynamic_th":"7" + }, + "q_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"0", + "dynamic_th":"3" + } + }, + "BUFFER_PORT_INGRESS_PROFILE_LIST": { + "Ethernet136": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet0": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet4": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet144": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet148": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet16": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet20": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet152": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet156": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet64": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet68": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet168": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet176": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet80": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet84": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet180": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet184": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet188": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet200": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet208": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet212": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet216": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet220": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet232": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet240": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet244": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet248": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet252": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + } +, + "Ethernet8": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet12": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet24": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet28": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet32": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet36": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet40": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet44": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet48": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet52": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet56": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet60": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet72": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet76": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet88": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet92": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet96": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet100": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet104": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet108": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet112": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet116": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet120": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet124": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet128": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet132": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet140": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet160": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet164": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet172": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet192": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet196": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet204": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet224": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet228": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet236": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + } + }, + "BUFFER_PORT_EGRESS_PROFILE_LIST": { + "Ethernet136": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet0": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet4": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet144": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet148": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet16": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet20": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet152": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet156": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet64": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet68": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet168": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet176": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet80": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet84": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet180": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet184": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet188": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet200": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet208": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet212": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet216": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet220": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet232": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet240": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet244": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet248": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet252": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + } +, + "Ethernet8": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet12": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet24": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet28": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet32": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet36": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet40": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet44": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet48": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet52": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet56": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet60": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet72": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet76": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet88": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet92": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet96": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet100": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet104": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet108": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet112": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet116": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet120": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet124": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet128": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet132": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet140": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet160": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet164": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet172": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet192": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet196": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet204": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet224": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet228": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet236": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + } + }, + "BUFFER_PG": { + "Ethernet0|3-4": { + "profile" : "NULL" + }, + "Ethernet0|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet4|3-4": { + "profile" : "NULL" + }, + "Ethernet4|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet16|3-4": { + "profile" : "NULL" + }, + "Ethernet16|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet20|3-4": { + "profile" : "NULL" + }, + "Ethernet20|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet64|3-4": { + "profile" : "NULL" + }, + "Ethernet64|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet68|3-4": { + "profile" : "NULL" + }, + "Ethernet68|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet80|3-4": { + "profile" : "NULL" + }, + "Ethernet80|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet84|3-4": { + "profile" : "NULL" + }, + "Ethernet84|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet136|3-4": { + "profile" : "NULL" + }, + "Ethernet136|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet144|3-4": { + "profile" : "NULL" + }, + "Ethernet144|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet148|3-4": { + "profile" : "NULL" + }, + "Ethernet148|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet152|3-4": { + "profile" : "NULL" + }, + "Ethernet152|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet156|3-4": { + "profile" : "NULL" + }, + "Ethernet156|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet168|3-4": { + "profile" : "NULL" + }, + "Ethernet168|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet176|3-4": { + "profile" : "NULL" + }, + "Ethernet176|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet180|3-4": { + "profile" : "NULL" + }, + "Ethernet180|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet184|3-4": { + "profile" : "NULL" + }, + "Ethernet184|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet188|3-4": { + "profile" : "NULL" + }, + "Ethernet188|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet200|3-4": { + "profile" : "NULL" + }, + "Ethernet200|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet208|3-4": { + "profile" : "NULL" + }, + "Ethernet208|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet212|3-4": { + "profile" : "NULL" + }, + "Ethernet212|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet216|3-4": { + "profile" : "NULL" + }, + "Ethernet216|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet220|3-4": { + "profile" : "NULL" + }, + "Ethernet220|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet232|3-4": { + "profile" : "NULL" + }, + "Ethernet232|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet240|3-4": { + "profile" : "NULL" + }, + "Ethernet240|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet244|3-4": { + "profile" : "NULL" + }, + "Ethernet244|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet248|3-4": { + "profile" : "NULL" + }, + "Ethernet248|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet252|3-4": { + "profile" : "NULL" + }, + "Ethernet252|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + } +, "Ethernet8|3-4": { + "profile" : "NULL" + }, + "Ethernet8|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet12|3-4": { + "profile" : "NULL" + }, + "Ethernet12|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet24|3-4": { + "profile" : "NULL" + }, + "Ethernet24|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet28|3-4": { + "profile" : "NULL" + }, + "Ethernet28|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet32|3-4": { + "profile" : "NULL" + }, + "Ethernet32|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet36|3-4": { + "profile" : "NULL" + }, + "Ethernet36|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet40|3-4": { + "profile" : "NULL" + }, + "Ethernet40|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet44|3-4": { + "profile" : "NULL" + }, + "Ethernet44|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet48|3-4": { + "profile" : "NULL" + }, + "Ethernet48|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet52|3-4": { + "profile" : "NULL" + }, + "Ethernet52|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet56|3-4": { + "profile" : "NULL" + }, + "Ethernet56|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet60|3-4": { + "profile" : "NULL" + }, + "Ethernet60|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet72|3-4": { + "profile" : "NULL" + }, + "Ethernet72|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet76|3-4": { + "profile" : "NULL" + }, + "Ethernet76|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet88|3-4": { + "profile" : "NULL" + }, + "Ethernet88|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet92|3-4": { + "profile" : "NULL" + }, + "Ethernet92|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet96|3-4": { + "profile" : "NULL" + }, + "Ethernet96|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet100|3-4": { + "profile" : "NULL" + }, + "Ethernet100|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet104|3-4": { + "profile" : "NULL" + }, + "Ethernet104|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet108|3-4": { + "profile" : "NULL" + }, + "Ethernet108|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet112|3-4": { + "profile" : "NULL" + }, + "Ethernet112|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet116|3-4": { + "profile" : "NULL" + }, + "Ethernet116|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet120|3-4": { + "profile" : "NULL" + }, + "Ethernet120|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet124|3-4": { + "profile" : "NULL" + }, + "Ethernet124|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet128|3-4": { + "profile" : "NULL" + }, + "Ethernet128|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet132|3-4": { + "profile" : "NULL" + }, + "Ethernet132|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet140|3-4": { + "profile" : "NULL" + }, + "Ethernet140|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet160|3-4": { + "profile" : "NULL" + }, + "Ethernet160|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet164|3-4": { + "profile" : "NULL" + }, + "Ethernet164|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet172|3-4": { + "profile" : "NULL" + }, + "Ethernet172|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet192|3-4": { + "profile" : "NULL" + }, + "Ethernet192|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet196|3-4": { + "profile" : "NULL" + }, + "Ethernet196|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet204|3-4": { + "profile" : "NULL" + }, + "Ethernet204|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet224|3-4": { + "profile" : "NULL" + }, + "Ethernet224|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet228|3-4": { + "profile" : "NULL" + }, + "Ethernet228|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet236|3-4": { + "profile" : "NULL" + }, + "Ethernet236|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + } + }, + + "BUFFER_QUEUE": { + "Ethernet0|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet4|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet16|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet20|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet64|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet68|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet80|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet84|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet0|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet4|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet16|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet20|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet64|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet68|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet80|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet84|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet0|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet4|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet16|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet20|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet64|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet68|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet80|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet84|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet136|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet136|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet136|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet144|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet144|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet144|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet148|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet148|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet148|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet152|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet152|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet152|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet156|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet156|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet156|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet168|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet168|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet168|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet176|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet176|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet176|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet180|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet180|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet180|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet184|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet184|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet184|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet188|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet188|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet188|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet200|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet200|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet200|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet208|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet208|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet208|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet212|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet212|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet212|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet216|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet216|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet216|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet220|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet220|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet220|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet232|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet232|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet232|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet240|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet240|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet240|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet244|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet244|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet244|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet248|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet248|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet248|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet252|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet252|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet252|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + } +, + "Ethernet8|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet12|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet24|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet28|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet32|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet36|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet40|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet44|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet48|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet52|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet56|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet60|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet72|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet76|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet88|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet92|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet96|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet100|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet104|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet108|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet112|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet116|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet120|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet124|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet128|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet132|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet140|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet160|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet164|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet172|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet192|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet196|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet204|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet224|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet228|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet236|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet8|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet12|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet24|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet28|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet32|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet36|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet40|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet44|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet48|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet52|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet56|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet60|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet72|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet76|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet88|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet92|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet96|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet100|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet104|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet108|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet112|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet116|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet120|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet124|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet128|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet132|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet140|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet160|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet164|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet172|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet192|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet196|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet204|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet224|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet228|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet236|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet8|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet12|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet24|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet28|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet32|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet36|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet40|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet44|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet48|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet52|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet56|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet60|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet72|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet76|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet88|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet92|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet96|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet100|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet104|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet108|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet112|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet116|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet120|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet124|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet128|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet132|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet140|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet160|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet164|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet172|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet192|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet196|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet204|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet224|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet228|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet236|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + } + } +, "DEFAULT_LOSSLESS_BUFFER_PARAMETER": { + "AZURE": { + "default_dynamic_th": "0" + } + }, + "LOSSLESS_TRAFFIC_PATTERN": { + "AZURE": { + "mtu": "1024", + "small_packet_percentage": "100" + } + } +} diff --git a/src/sonic-config-engine/tests/sample_output/py3/buffers-mellanox4600c-t1-dynamic.json b/src/sonic-config-engine/tests/sample_output/py3/buffers-mellanox4600c-t1-dynamic.json new file mode 100644 index 000000000000..21ab1aac0aeb --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py3/buffers-mellanox4600c-t1-dynamic.json @@ -0,0 +1,1661 @@ + +{ + "CABLE_LENGTH": { + "AZURE": { + "Ethernet0": "300m", + "Ethernet4": "300m", + "Ethernet8": "5m", + "Ethernet12": "5m", + "Ethernet16": "300m", + "Ethernet20": "300m", + "Ethernet24": "5m", + "Ethernet28": "5m", + "Ethernet32": "5m", + "Ethernet36": "5m", + "Ethernet40": "5m", + "Ethernet44": "5m", + "Ethernet48": "5m", + "Ethernet52": "5m", + "Ethernet56": "5m", + "Ethernet60": "5m", + "Ethernet64": "300m", + "Ethernet68": "300m", + "Ethernet72": "5m", + "Ethernet76": "5m", + "Ethernet80": "300m", + "Ethernet84": "300m", + "Ethernet88": "5m", + "Ethernet92": "5m", + "Ethernet96": "5m", + "Ethernet100": "5m", + "Ethernet104": "5m", + "Ethernet108": "5m", + "Ethernet112": "5m", + "Ethernet116": "5m", + "Ethernet120": "5m", + "Ethernet124": "5m", + "Ethernet128": "5m", + "Ethernet132": "5m", + "Ethernet136": "40m", + "Ethernet140": "5m", + "Ethernet144": "40m", + "Ethernet148": "40m", + "Ethernet152": "40m", + "Ethernet156": "40m", + "Ethernet160": "5m", + "Ethernet164": "5m", + "Ethernet168": "40m", + "Ethernet172": "5m", + "Ethernet176": "40m", + "Ethernet180": "40m", + "Ethernet184": "40m", + "Ethernet188": "40m", + "Ethernet192": "5m", + "Ethernet196": "5m", + "Ethernet200": "40m", + "Ethernet204": "5m", + "Ethernet208": "40m", + "Ethernet212": "40m", + "Ethernet216": "40m", + "Ethernet220": "40m", + "Ethernet224": "5m", + "Ethernet228": "5m", + "Ethernet232": "40m", + "Ethernet236": "5m", + "Ethernet240": "40m", + "Ethernet244": "40m", + "Ethernet248": "40m", + "Ethernet252": "40m" + } + }, + + "BUFFER_POOL": { + "ingress_lossless_pool": { + "type": "ingress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "60817392", + "type": "egress", + "mode": "dynamic" + }, + "egress_lossy_pool": { + "type": "egress", + "mode": "dynamic" + } + }, + "BUFFER_PROFILE": { + "ingress_lossless_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "dynamic_th":"7" + }, + "ingress_lossy_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "dynamic_th":"3" + }, + "egress_lossless_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"0", + "dynamic_th":"7" + }, + "egress_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"9216", + "dynamic_th":"7" + }, + "q_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"0", + "dynamic_th":"3" + } + }, + "BUFFER_PORT_INGRESS_PROFILE_LIST": { + "Ethernet136": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet0": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet4": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet144": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet148": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet16": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet20": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet152": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet156": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet64": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet68": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet168": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet176": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet80": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet84": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet180": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet184": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet188": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet200": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet208": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet212": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet216": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet220": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet232": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet240": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet244": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet248": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet252": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + } +, + "Ethernet8": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet12": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet24": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet28": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet32": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet36": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet40": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet44": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet48": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet52": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet56": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet60": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet72": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet76": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet88": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet92": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet96": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet100": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet104": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet108": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet112": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet116": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet120": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet124": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet128": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet132": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet140": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet160": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet164": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet172": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet192": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet196": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet204": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet224": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet228": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet236": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + } + }, + "BUFFER_PORT_EGRESS_PROFILE_LIST": { + "Ethernet136": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet0": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet4": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet144": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet148": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet16": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet20": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet152": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet156": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet64": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet68": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet168": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet176": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet80": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet84": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet180": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet184": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet188": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet200": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet208": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet212": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet216": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet220": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet232": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet240": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet244": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet248": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet252": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + } +, + "Ethernet8": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet12": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet24": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet28": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet32": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet36": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet40": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet44": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet48": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet52": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet56": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet60": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet72": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet76": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet88": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet92": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet96": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet100": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet104": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet108": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet112": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet116": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet120": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet124": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet128": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet132": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet140": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet160": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet164": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet172": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet192": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet196": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet204": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet224": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet228": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet236": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + } + }, + "BUFFER_PG": { + "Ethernet0|3-4": { + "profile" : "NULL" + }, + "Ethernet0|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet4|3-4": { + "profile" : "NULL" + }, + "Ethernet4|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet16|3-4": { + "profile" : "NULL" + }, + "Ethernet16|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet20|3-4": { + "profile" : "NULL" + }, + "Ethernet20|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet64|3-4": { + "profile" : "NULL" + }, + "Ethernet64|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet68|3-4": { + "profile" : "NULL" + }, + "Ethernet68|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet80|3-4": { + "profile" : "NULL" + }, + "Ethernet80|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet84|3-4": { + "profile" : "NULL" + }, + "Ethernet84|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet136|2-4": { + "profile" : "NULL" + }, + "Ethernet136|6": { + "profile" : "NULL" + }, + "Ethernet136|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet144|2-4": { + "profile" : "NULL" + }, + "Ethernet144|6": { + "profile" : "NULL" + }, + "Ethernet144|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet148|2-4": { + "profile" : "NULL" + }, + "Ethernet148|6": { + "profile" : "NULL" + }, + "Ethernet148|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet152|2-4": { + "profile" : "NULL" + }, + "Ethernet152|6": { + "profile" : "NULL" + }, + "Ethernet152|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet156|2-4": { + "profile" : "NULL" + }, + "Ethernet156|6": { + "profile" : "NULL" + }, + "Ethernet156|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet168|2-4": { + "profile" : "NULL" + }, + "Ethernet168|6": { + "profile" : "NULL" + }, + "Ethernet168|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet176|2-4": { + "profile" : "NULL" + }, + "Ethernet176|6": { + "profile" : "NULL" + }, + "Ethernet176|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet180|2-4": { + "profile" : "NULL" + }, + "Ethernet180|6": { + "profile" : "NULL" + }, + "Ethernet180|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet184|2-4": { + "profile" : "NULL" + }, + "Ethernet184|6": { + "profile" : "NULL" + }, + "Ethernet184|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet188|2-4": { + "profile" : "NULL" + }, + "Ethernet188|6": { + "profile" : "NULL" + }, + "Ethernet188|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet200|2-4": { + "profile" : "NULL" + }, + "Ethernet200|6": { + "profile" : "NULL" + }, + "Ethernet200|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet208|2-4": { + "profile" : "NULL" + }, + "Ethernet208|6": { + "profile" : "NULL" + }, + "Ethernet208|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet212|2-4": { + "profile" : "NULL" + }, + "Ethernet212|6": { + "profile" : "NULL" + }, + "Ethernet212|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet216|2-4": { + "profile" : "NULL" + }, + "Ethernet216|6": { + "profile" : "NULL" + }, + "Ethernet216|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet220|2-4": { + "profile" : "NULL" + }, + "Ethernet220|6": { + "profile" : "NULL" + }, + "Ethernet220|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet232|2-4": { + "profile" : "NULL" + }, + "Ethernet232|6": { + "profile" : "NULL" + }, + "Ethernet232|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet240|2-4": { + "profile" : "NULL" + }, + "Ethernet240|6": { + "profile" : "NULL" + }, + "Ethernet240|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet244|2-4": { + "profile" : "NULL" + }, + "Ethernet244|6": { + "profile" : "NULL" + }, + "Ethernet244|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet248|2-4": { + "profile" : "NULL" + }, + "Ethernet248|6": { + "profile" : "NULL" + }, + "Ethernet248|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet252|2-4": { + "profile" : "NULL" + }, + "Ethernet252|6": { + "profile" : "NULL" + }, + "Ethernet252|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + } +, "Ethernet8|3-4": { + "profile" : "NULL" + }, + "Ethernet8|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet12|3-4": { + "profile" : "NULL" + }, + "Ethernet12|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet24|3-4": { + "profile" : "NULL" + }, + "Ethernet24|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet28|3-4": { + "profile" : "NULL" + }, + "Ethernet28|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet32|3-4": { + "profile" : "NULL" + }, + "Ethernet32|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet36|3-4": { + "profile" : "NULL" + }, + "Ethernet36|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet40|3-4": { + "profile" : "NULL" + }, + "Ethernet40|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet44|3-4": { + "profile" : "NULL" + }, + "Ethernet44|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet48|3-4": { + "profile" : "NULL" + }, + "Ethernet48|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet52|3-4": { + "profile" : "NULL" + }, + "Ethernet52|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet56|3-4": { + "profile" : "NULL" + }, + "Ethernet56|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet60|3-4": { + "profile" : "NULL" + }, + "Ethernet60|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet72|3-4": { + "profile" : "NULL" + }, + "Ethernet72|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet76|3-4": { + "profile" : "NULL" + }, + "Ethernet76|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet88|3-4": { + "profile" : "NULL" + }, + "Ethernet88|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet92|3-4": { + "profile" : "NULL" + }, + "Ethernet92|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet96|3-4": { + "profile" : "NULL" + }, + "Ethernet96|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet100|3-4": { + "profile" : "NULL" + }, + "Ethernet100|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet104|3-4": { + "profile" : "NULL" + }, + "Ethernet104|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet108|3-4": { + "profile" : "NULL" + }, + "Ethernet108|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet112|3-4": { + "profile" : "NULL" + }, + "Ethernet112|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet116|3-4": { + "profile" : "NULL" + }, + "Ethernet116|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet120|3-4": { + "profile" : "NULL" + }, + "Ethernet120|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet124|3-4": { + "profile" : "NULL" + }, + "Ethernet124|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet128|3-4": { + "profile" : "NULL" + }, + "Ethernet128|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet132|3-4": { + "profile" : "NULL" + }, + "Ethernet132|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet140|3-4": { + "profile" : "NULL" + }, + "Ethernet140|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet160|3-4": { + "profile" : "NULL" + }, + "Ethernet160|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet164|3-4": { + "profile" : "NULL" + }, + "Ethernet164|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet172|3-4": { + "profile" : "NULL" + }, + "Ethernet172|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet192|3-4": { + "profile" : "NULL" + }, + "Ethernet192|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet196|3-4": { + "profile" : "NULL" + }, + "Ethernet196|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet204|3-4": { + "profile" : "NULL" + }, + "Ethernet204|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet224|3-4": { + "profile" : "NULL" + }, + "Ethernet224|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet228|3-4": { + "profile" : "NULL" + }, + "Ethernet228|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet236|3-4": { + "profile" : "NULL" + }, + "Ethernet236|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + } + }, + + "BUFFER_QUEUE": { + "Ethernet0|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet4|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet16|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet20|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet64|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet68|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet80|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet84|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet0|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet4|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet16|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet20|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet64|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet68|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet80|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet84|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet0|5-7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet4|5-7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet16|5-7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet20|5-7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet64|5-7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet68|5-7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet80|5-7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet84|5-7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet136|0-1": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet136|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet136|5": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet136|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet136|7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet144|0-1": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet144|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet144|5": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet144|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet144|7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet148|0-1": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet148|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet148|5": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet148|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet148|7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet152|0-1": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet152|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet152|5": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet152|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet152|7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet156|0-1": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet156|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet156|5": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet156|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet156|7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet168|0-1": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet168|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet168|5": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet168|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet168|7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet176|0-1": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet176|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet176|5": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet176|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet176|7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet180|0-1": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet180|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet180|5": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet180|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet180|7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet184|0-1": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet184|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet184|5": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet184|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet184|7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet188|0-1": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet188|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet188|5": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet188|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet188|7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet200|0-1": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet200|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet200|5": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet200|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet200|7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet208|0-1": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet208|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet208|5": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet208|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet208|7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet212|0-1": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet212|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet212|5": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet212|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet212|7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet216|0-1": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet216|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet216|5": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet216|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet216|7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet220|0-1": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet220|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet220|5": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet220|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet220|7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet232|0-1": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet232|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet232|5": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet232|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet232|7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet240|0-1": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet240|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet240|5": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet240|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet240|7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet244|0-1": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet244|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet244|5": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet244|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet244|7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet248|0-1": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet248|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet248|5": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet248|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet248|7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet252|0-1": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet252|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet252|5": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet252|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet252|7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + } +, + "Ethernet8|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet12|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet24|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet28|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet32|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet36|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet40|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet44|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet48|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet52|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet56|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet60|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet72|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet76|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet88|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet92|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet96|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet100|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet104|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet108|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet112|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet116|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet120|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet124|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet128|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet132|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet140|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet160|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet164|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet172|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet192|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet196|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet204|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet224|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet228|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet236|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet8|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet12|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet24|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet28|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet32|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet36|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet40|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet44|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet48|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet52|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet56|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet60|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet72|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet76|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet88|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet92|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet96|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet100|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet104|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet108|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet112|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet116|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet120|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet124|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet128|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet132|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet140|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet160|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet164|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet172|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet192|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet196|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet204|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet224|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet228|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet236|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet8|5-7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet12|5-7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet24|5-7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet28|5-7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet32|5-7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet36|5-7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet40|5-7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet44|5-7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet48|5-7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet52|5-7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet56|5-7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet60|5-7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet72|5-7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet76|5-7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet88|5-7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet92|5-7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet96|5-7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet100|5-7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet104|5-7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet108|5-7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet112|5-7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet116|5-7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet120|5-7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet124|5-7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet128|5-7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet132|5-7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet140|5-7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet160|5-7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet164|5-7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet172|5-7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet192|5-7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet196|5-7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet204|5-7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet224|5-7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet228|5-7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet236|5-7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + } + } +, "DEFAULT_LOSSLESS_BUFFER_PARAMETER": { + "AZURE": { + "default_dynamic_th": "0" + } + }, + "LOSSLESS_TRAFFIC_PATTERN": { + "AZURE": { + "mtu": "1024", + "small_packet_percentage": "100" + } + } +} diff --git a/src/sonic-config-engine/tests/sample_output/py3/buffers-mellanox4600c-t1-remap-disabled.json b/src/sonic-config-engine/tests/sample_output/py3/buffers-mellanox4600c-t1-remap-disabled.json new file mode 100644 index 000000000000..aa7693071228 --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py3/buffers-mellanox4600c-t1-remap-disabled.json @@ -0,0 +1,1306 @@ + +{ + "CABLE_LENGTH": { + "AZURE": { + "Ethernet0": "300m", + "Ethernet4": "300m", + "Ethernet8": "5m", + "Ethernet12": "5m", + "Ethernet16": "300m", + "Ethernet20": "300m", + "Ethernet24": "5m", + "Ethernet28": "5m", + "Ethernet32": "5m", + "Ethernet36": "5m", + "Ethernet40": "5m", + "Ethernet44": "5m", + "Ethernet48": "5m", + "Ethernet52": "5m", + "Ethernet56": "5m", + "Ethernet60": "5m", + "Ethernet64": "300m", + "Ethernet68": "300m", + "Ethernet72": "5m", + "Ethernet76": "5m", + "Ethernet80": "300m", + "Ethernet84": "300m", + "Ethernet88": "5m", + "Ethernet92": "5m", + "Ethernet96": "5m", + "Ethernet100": "5m", + "Ethernet104": "5m", + "Ethernet108": "5m", + "Ethernet112": "5m", + "Ethernet116": "5m", + "Ethernet120": "5m", + "Ethernet124": "5m", + "Ethernet128": "5m", + "Ethernet132": "5m", + "Ethernet136": "40m", + "Ethernet140": "5m", + "Ethernet144": "40m", + "Ethernet148": "40m", + "Ethernet152": "40m", + "Ethernet156": "40m", + "Ethernet160": "5m", + "Ethernet164": "5m", + "Ethernet168": "40m", + "Ethernet172": "5m", + "Ethernet176": "40m", + "Ethernet180": "40m", + "Ethernet184": "40m", + "Ethernet188": "40m", + "Ethernet192": "5m", + "Ethernet196": "5m", + "Ethernet200": "40m", + "Ethernet204": "5m", + "Ethernet208": "40m", + "Ethernet212": "40m", + "Ethernet216": "40m", + "Ethernet220": "40m", + "Ethernet224": "5m", + "Ethernet228": "5m", + "Ethernet232": "40m", + "Ethernet236": "5m", + "Ethernet240": "40m", + "Ethernet244": "40m", + "Ethernet248": "40m", + "Ethernet252": "40m" + } + }, + + "BUFFER_POOL": { + "ingress_zero_pool" : { + "mode": "static", + "type": "ingress", + "size": "0" + }, + "ingress_lossless_pool": { + "size": "48332800", + "xoff": "5275648", + "type": "ingress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "60817392", + "type": "egress", + "mode": "dynamic" + }, + "egress_lossy_pool": { + "size": "48332800", + "type": "egress", + "mode": "dynamic" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_pg_zero_profile" : { + "pool":"[BUFFER_POOL|ingress_zero_pool]", + "size":"0", + "static_th":"0" + }, + "ingress_lossless_zero_profile" : { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "dynamic_th":"-8" + }, + "egress_lossless_zero_profile" : { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"0", + "dynamic_th":"-8" + }, + "egress_lossy_zero_profile" : { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"0", + "dynamic_th":"-8" + }, + "ingress_lossless_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "dynamic_th":"7" + }, + "ingress_lossy_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "dynamic_th":"3" + }, + "egress_lossless_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"0", + "dynamic_th":"7" + }, + "egress_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"9216", + "dynamic_th":"7" + }, + "q_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"0", + "dynamic_th":"3" + } + }, + "BUFFER_PORT_INGRESS_PROFILE_LIST": { + "Ethernet136": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet0": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet4": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet144": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet148": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet16": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet20": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet152": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet156": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet64": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet68": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet168": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet176": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet80": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet84": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet180": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet184": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet188": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet200": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet208": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet212": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet216": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet220": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet232": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet240": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet244": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet248": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet252": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + } +, + "Ethernet8": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet12": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet24": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet28": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet32": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet36": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet40": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet44": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet48": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet52": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet56": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet60": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet72": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet76": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet88": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet92": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet96": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet100": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet104": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet108": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet112": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet116": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet120": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet124": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet128": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet132": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet140": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet160": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet164": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet172": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet192": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet196": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet204": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet224": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet228": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet236": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + } + }, + "BUFFER_PORT_EGRESS_PROFILE_LIST": { + "Ethernet136": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet0": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet4": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet144": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet148": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet16": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet20": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet152": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet156": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet64": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet68": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet168": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet176": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet80": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet84": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet180": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet184": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet188": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet200": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet208": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet212": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet216": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet220": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet232": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet240": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet244": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet248": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet252": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + } +, + "Ethernet8": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet12": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet24": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet28": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet32": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet36": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet40": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet44": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet48": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet52": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet56": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet60": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet72": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet76": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet88": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet92": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet96": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet100": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet104": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet108": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet112": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet116": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet120": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet124": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet128": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet132": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet140": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet160": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet164": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet172": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet192": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet196": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet204": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet224": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet228": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet236": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + } + }, + "BUFFER_PG": { + "Ethernet0|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet4|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet16|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet20|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet64|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet68|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet80|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet84|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet136|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet144|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet148|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet152|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet156|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet168|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet176|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet180|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet184|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet188|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet200|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet208|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet212|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet216|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet220|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet232|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet240|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet244|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet248|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet252|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + } +, "Ethernet8|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet12|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet24|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet28|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet32|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet36|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet40|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet44|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet48|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet52|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet56|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet60|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet72|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet76|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet88|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet92|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet96|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet100|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet104|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet108|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet112|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet116|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet120|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet124|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet128|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet132|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet140|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet160|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet164|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet172|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet192|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet196|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet204|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet224|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet228|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet236|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + } + }, + + "BUFFER_QUEUE": { + "Ethernet0|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet4|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet16|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet20|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet64|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet68|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet80|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet84|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet0|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet4|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet16|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet20|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet64|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet68|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet80|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet84|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet0|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet4|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet16|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet20|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet64|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet68|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet80|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet84|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet136|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet136|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet136|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet144|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet144|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet144|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet148|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet148|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet148|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet152|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet152|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet152|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet156|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet156|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet156|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet168|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet168|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet168|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet176|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet176|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet176|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet180|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet180|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet180|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet184|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet184|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet184|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet188|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet188|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet188|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet200|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet200|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet200|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet208|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet208|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet208|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet212|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet212|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet212|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet216|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet216|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet216|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet220|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet220|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet220|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet232|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet232|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet232|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet240|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet240|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet240|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet244|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet244|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet244|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet248|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet248|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet248|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet252|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet252|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet252|5-6": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + } +, + "Ethernet8|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet12|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet24|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet28|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet32|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet36|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet40|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet44|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet48|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet52|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet56|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet60|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet72|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet76|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet88|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet92|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet96|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet100|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet104|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet108|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet112|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet116|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet120|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet124|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet128|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet132|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet140|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet160|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet164|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet172|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet192|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet196|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet204|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet224|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet228|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet236|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet8|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet12|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet24|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet28|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet32|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet36|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet40|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet44|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet48|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet52|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet56|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet60|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet72|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet76|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet88|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet92|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet96|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet100|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet104|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet108|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet112|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet116|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet120|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet124|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet128|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet132|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet140|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet160|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet164|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet172|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet192|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet196|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet204|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet224|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet228|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet236|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet8|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet12|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet24|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet28|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet32|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet36|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet40|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet44|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet48|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet52|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet56|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet60|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet72|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet76|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet88|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet92|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet96|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet100|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet104|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet108|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet112|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet116|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet120|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet124|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet128|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet132|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet140|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet160|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet164|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet172|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet192|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet196|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet204|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet224|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet228|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet236|5-6": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + } + } +} diff --git a/src/sonic-config-engine/tests/sample_output/py3/buffers-mellanox4600c-t1.json b/src/sonic-config-engine/tests/sample_output/py3/buffers-mellanox4600c-t1.json new file mode 100644 index 000000000000..adef78b44e2a --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py3/buffers-mellanox4600c-t1.json @@ -0,0 +1,1426 @@ + +{ + "CABLE_LENGTH": { + "AZURE": { + "Ethernet0": "300m", + "Ethernet4": "300m", + "Ethernet8": "5m", + "Ethernet12": "5m", + "Ethernet16": "300m", + "Ethernet20": "300m", + "Ethernet24": "5m", + "Ethernet28": "5m", + "Ethernet32": "5m", + "Ethernet36": "5m", + "Ethernet40": "5m", + "Ethernet44": "5m", + "Ethernet48": "5m", + "Ethernet52": "5m", + "Ethernet56": "5m", + "Ethernet60": "5m", + "Ethernet64": "300m", + "Ethernet68": "300m", + "Ethernet72": "5m", + "Ethernet76": "5m", + "Ethernet80": "300m", + "Ethernet84": "300m", + "Ethernet88": "5m", + "Ethernet92": "5m", + "Ethernet96": "5m", + "Ethernet100": "5m", + "Ethernet104": "5m", + "Ethernet108": "5m", + "Ethernet112": "5m", + "Ethernet116": "5m", + "Ethernet120": "5m", + "Ethernet124": "5m", + "Ethernet128": "5m", + "Ethernet132": "5m", + "Ethernet136": "40m", + "Ethernet140": "5m", + "Ethernet144": "40m", + "Ethernet148": "40m", + "Ethernet152": "40m", + "Ethernet156": "40m", + "Ethernet160": "5m", + "Ethernet164": "5m", + "Ethernet168": "40m", + "Ethernet172": "5m", + "Ethernet176": "40m", + "Ethernet180": "40m", + "Ethernet184": "40m", + "Ethernet188": "40m", + "Ethernet192": "5m", + "Ethernet196": "5m", + "Ethernet200": "40m", + "Ethernet204": "5m", + "Ethernet208": "40m", + "Ethernet212": "40m", + "Ethernet216": "40m", + "Ethernet220": "40m", + "Ethernet224": "5m", + "Ethernet228": "5m", + "Ethernet232": "40m", + "Ethernet236": "5m", + "Ethernet240": "40m", + "Ethernet244": "40m", + "Ethernet248": "40m", + "Ethernet252": "40m" + } + }, + + "BUFFER_POOL": { + "ingress_zero_pool" : { + "mode": "static", + "type": "ingress", + "size": "0" + }, + "ingress_lossless_pool": { + "size": "44130304", + "xoff": "8790016", + "type": "ingress", + "mode": "dynamic" + }, + "egress_lossless_pool": { + "size": "60817392", + "type": "egress", + "mode": "dynamic" + }, + "egress_lossy_pool": { + "size": "44130304", + "type": "egress", + "mode": "dynamic" + } + }, + "BUFFER_PROFILE": { + "ingress_lossy_pg_zero_profile" : { + "pool":"[BUFFER_POOL|ingress_zero_pool]", + "size":"0", + "static_th":"0" + }, + "ingress_lossless_zero_profile" : { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "dynamic_th":"-8" + }, + "egress_lossless_zero_profile" : { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"0", + "dynamic_th":"-8" + }, + "egress_lossy_zero_profile" : { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"0", + "dynamic_th":"-8" + }, + "ingress_lossless_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "dynamic_th":"7" + }, + "ingress_lossy_profile": { + "pool":"[BUFFER_POOL|ingress_lossless_pool]", + "size":"0", + "dynamic_th":"3" + }, + "egress_lossless_profile": { + "pool":"[BUFFER_POOL|egress_lossless_pool]", + "size":"0", + "dynamic_th":"7" + }, + "egress_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"9216", + "dynamic_th":"7" + }, + "q_lossy_profile": { + "pool":"[BUFFER_POOL|egress_lossy_pool]", + "size":"0", + "dynamic_th":"3" + } + }, + "BUFFER_PORT_INGRESS_PROFILE_LIST": { + "Ethernet136": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet0": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet4": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet144": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet148": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet16": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet20": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet152": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet156": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet64": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet68": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet168": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet176": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet80": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet84": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet180": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet184": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet188": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet200": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet208": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet212": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet216": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet220": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet232": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet240": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet244": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet248": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + }, + "Ethernet252": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_profile]" + } +, + "Ethernet8": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet12": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet24": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet28": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet32": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet36": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet40": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet44": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet48": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet52": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet56": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet60": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet72": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet76": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet88": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet92": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet96": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet100": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet104": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet108": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet112": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet116": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet120": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet124": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet128": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet132": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet140": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet160": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet164": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet172": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet192": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet196": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet204": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet224": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet228": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + }, + "Ethernet236": { + "profile_list" : "[BUFFER_PROFILE|ingress_lossless_zero_profile]" + } + }, + "BUFFER_PORT_EGRESS_PROFILE_LIST": { + "Ethernet136": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet0": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet4": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet144": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet148": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet16": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet20": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet152": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet156": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet64": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet68": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet168": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet176": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet80": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet84": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet180": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet184": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet188": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet200": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet208": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet212": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet216": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet220": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet232": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet240": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet244": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet248": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + }, + "Ethernet252": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]" + } +, + "Ethernet8": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet12": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet24": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet28": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet32": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet36": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet40": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet44": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet48": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet52": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet56": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet60": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet72": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet76": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet88": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet92": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet96": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet100": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet104": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet108": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet112": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet116": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet120": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet124": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet128": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet132": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet140": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet160": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet164": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet172": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet192": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet196": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet204": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet224": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet228": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet236": { + "profile_list" : "[BUFFER_PROFILE|egress_lossless_zero_profile],[BUFFER_PROFILE|egress_lossy_zero_profile]" + } + }, + "BUFFER_PG": { + "Ethernet0|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet4|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet16|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet20|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet64|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet68|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet80|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet84|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet136|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet144|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet148|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet152|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet156|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet168|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet176|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet180|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet184|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet188|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet200|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet208|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet212|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet216|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet220|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet232|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet240|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet244|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet248|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + }, + "Ethernet252|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_profile]" + } +, "Ethernet8|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet12|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet24|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet28|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet32|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet36|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet40|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet44|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet48|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet52|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet56|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet60|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet72|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet76|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet88|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet92|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet96|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet100|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet104|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet108|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet112|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet116|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet120|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet124|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet128|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet132|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet140|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet160|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet164|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet172|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet192|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet196|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet204|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet224|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet228|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + }, + "Ethernet236|0": { + "profile" : "[BUFFER_PROFILE|ingress_lossy_pg_zero_profile]" + } + }, + + "BUFFER_QUEUE": { + "Ethernet0|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet4|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet16|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet20|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet64|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet68|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet80|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet84|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet0|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet4|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet16|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet20|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet64|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet68|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet80|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet84|0-2": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet0|5-7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet4|5-7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet16|5-7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet20|5-7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet64|5-7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet68|5-7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet80|5-7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet84|5-7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet136|0-1": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet136|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet136|5": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet136|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet136|7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet144|0-1": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet144|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet144|5": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet144|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet144|7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet148|0-1": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet148|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet148|5": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet148|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet148|7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet152|0-1": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet152|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet152|5": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet152|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet152|7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet156|0-1": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet156|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet156|5": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet156|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet156|7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet168|0-1": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet168|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet168|5": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet168|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet168|7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet176|0-1": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet176|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet176|5": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet176|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet176|7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet180|0-1": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet180|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet180|5": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet180|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet180|7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet184|0-1": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet184|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet184|5": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet184|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet184|7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet188|0-1": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet188|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet188|5": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet188|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet188|7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet200|0-1": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet200|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet200|5": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet200|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet200|7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet208|0-1": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet208|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet208|5": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet208|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet208|7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet212|0-1": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet212|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet212|5": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet212|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet212|7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet216|0-1": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet216|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet216|5": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet216|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet216|7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet220|0-1": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet220|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet220|5": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet220|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet220|7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet232|0-1": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet232|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet232|5": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet232|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet232|7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet240|0-1": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet240|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet240|5": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet240|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet240|7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet244|0-1": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet244|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet244|5": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet244|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet244|7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet248|0-1": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet248|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet248|5": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet248|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet248|7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet252|0-1": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet252|2-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet252|5": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + }, + "Ethernet252|6": { + "profile" : "[BUFFER_PROFILE|egress_lossless_profile]" + }, + "Ethernet252|7": { + "profile" : "[BUFFER_PROFILE|q_lossy_profile]" + } +, + "Ethernet8|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet12|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet24|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet28|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet32|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet36|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet40|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet44|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet48|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet52|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet56|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet60|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet72|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet76|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet88|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet92|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet96|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet100|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet104|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet108|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet112|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet116|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet120|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet124|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet128|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet132|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet140|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet160|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet164|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet172|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet192|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet196|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet204|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet224|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet228|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet236|3-4": { + "profile" : "[BUFFER_PROFILE|egress_lossless_zero_profile]" + }, + "Ethernet8|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet12|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet24|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet28|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet32|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet36|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet40|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet44|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet48|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet52|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet56|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet60|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet72|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet76|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet88|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet92|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet96|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet100|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet104|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet108|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet112|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet116|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet120|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet124|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet128|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet132|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet140|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet160|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet164|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet172|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet192|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet196|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet204|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet224|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet228|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet236|0-2": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet8|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet12|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet24|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet28|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet32|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet36|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet40|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet44|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet48|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet52|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet56|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet60|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet72|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet76|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet88|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet92|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet96|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet100|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet104|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet108|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet112|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet116|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet120|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet124|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet128|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet132|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet140|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet160|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet164|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet172|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet192|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet196|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet204|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet224|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet228|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + }, + "Ethernet236|5-7": { + "profile" : "[BUFFER_PROFILE|egress_lossy_zero_profile]" + } + } +} diff --git a/src/sonic-config-engine/tests/sample_output/py3/docker-dhcp-relay-no-ip-helper.supervisord.conf b/src/sonic-config-engine/tests/sample_output/py3/docker-dhcp-relay-no-ip-helper.supervisord.conf new file mode 100644 index 000000000000..35ad0c48b82f --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py3/docker-dhcp-relay-no-ip-helper.supervisord.conf @@ -0,0 +1,80 @@ +[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 + +[eventlistener:supervisor-proc-exit-listener] +command=/usr/bin/supervisor-proc-exit-listener --container-name dhcp_relay +events=PROCESS_STATE_EXITED,PROCESS_STATE_RUNNING +autostart=true +autorestart=unexpected +buffer_size=1024 + +[program:rsyslogd] +command=/usr/sbin/rsyslogd -n -iNONE +priority=1 +autostart=false +autorestart=false +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 + +[group:dhcp-relay] +programs=isc-dhcpv4-relay-Vlan1000,dhcp6relay + + +[program:isc-dhcpv4-relay-Vlan1000] +command=/usr/sbin/dhcrelay -d -m discard -a %%h:%%p %%P --name-alias-map-file /tmp/port-name-alias-map.txt -id Vlan1000 -iu Vlan2000 -iu PortChannel01 -iu PortChannel02 -iu PortChannel03 -iu PortChannel04 192.0.0.1 192.0.0.2 +priority=3 +autostart=false +autorestart=false +stdout_logfile=syslog +stderr_logfile=syslog +dependent_startup=true +dependent_startup_wait_for=start:exited + + +[program:dhcp6relay] +command=/usr/sbin/dhcp6relay +priority=3 +autostart=false +autorestart=false +stdout_logfile=syslog +stderr_logfile=syslog +dependent_startup=true +dependent_startup_wait_for=start:exited + +[group:dhcpmon] +programs=dhcpmon-Vlan1000 + +[program:dhcpmon-Vlan1000] +command=/usr/sbin/dhcpmon -id Vlan1000 -iu Vlan2000 -iu PortChannel01 -iu PortChannel02 -iu PortChannel03 -iu PortChannel04 -im eth0 +priority=4 +autostart=false +autorestart=false +stdout_logfile=syslog +stderr_logfile=syslog +dependent_startup=true +dependent_startup_wait_for=isc-dhcpv4-relay-Vlan1000:running + + diff --git a/src/sonic-config-engine/tests/sample_output/py3/docker-dhcp-relay.supervisord.conf b/src/sonic-config-engine/tests/sample_output/py3/docker-dhcp-relay.supervisord.conf index d5338b18cfa1..7ea29dfcd635 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/docker-dhcp-relay.supervisord.conf +++ b/src/sonic-config-engine/tests/sample_output/py3/docker-dhcp-relay.supervisord.conf @@ -10,13 +10,14 @@ autorestart=unexpected startretries=0 exitcodes=0,3 events=PROCESS_STATE -buffer_size=50 +buffer_size=1024 [eventlistener:supervisor-proc-exit-listener] command=/usr/bin/supervisor-proc-exit-listener --container-name dhcp_relay -events=PROCESS_STATE_EXITED +events=PROCESS_STATE_EXITED,PROCESS_STATE_RUNNING autostart=true autorestart=unexpected +buffer_size=1024 [program:rsyslogd] command=/usr/sbin/rsyslogd -n -iNONE @@ -38,11 +39,22 @@ stderr_logfile=syslog dependent_startup=true dependent_startup_wait_for=rsyslogd:running -[group:isc-dhcp-relay] -programs=isc-dhcp-relay-Vlan1000 +[group:dhcp-relay] +programs=isc-dhcpv4-relay-Vlan1000,isc-dhcpv4-relay-Vlan2000,dhcp6relay -[program:isc-dhcp-relay-Vlan1000] -command=/usr/sbin/dhcrelay -d -m discard -a %%h:%%p %%P --name-alias-map-file /tmp/port-name-alias-map.txt -id Vlan1000 -iu PortChannel01 -iu PortChannel02 -iu PortChannel03 -iu PortChannel04 192.0.0.1 192.0.0.2 + +[program:isc-dhcpv4-relay-Vlan1000] +command=/usr/sbin/dhcrelay -d -m discard -a %%h:%%p %%P --name-alias-map-file /tmp/port-name-alias-map.txt -id Vlan1000 -iu Vlan2000 -iu PortChannel01 -iu PortChannel02 -iu PortChannel03 -iu PortChannel04 192.0.0.1 192.0.0.2 +priority=3 +autostart=false +autorestart=false +stdout_logfile=syslog +stderr_logfile=syslog +dependent_startup=true +dependent_startup_wait_for=start:exited + +[program:isc-dhcpv4-relay-Vlan2000] +command=/usr/sbin/dhcrelay -d -m discard -a %%h:%%p %%P --name-alias-map-file /tmp/port-name-alias-map.txt -id Vlan2000 -iu Vlan1000 -iu PortChannel01 -iu PortChannel02 -iu PortChannel03 -iu PortChannel04 192.0.0.3 192.0.0.4 priority=3 autostart=false autorestart=false @@ -52,18 +64,37 @@ dependent_startup=true dependent_startup_wait_for=start:exited +[program:dhcp6relay] +command=/usr/sbin/dhcp6relay +priority=3 +autostart=false +autorestart=false +stdout_logfile=syslog +stderr_logfile=syslog +dependent_startup=true +dependent_startup_wait_for=start:exited + [group:dhcpmon] -programs=dhcpmon-Vlan1000 +programs=dhcpmon-Vlan1000,dhcpmon-Vlan2000 [program:dhcpmon-Vlan1000] -command=/usr/sbin/dhcpmon -id Vlan1000 -iu PortChannel01 -iu PortChannel02 -iu PortChannel03 -iu PortChannel04 -im eth0 +command=/usr/sbin/dhcpmon -id Vlan1000 -iu Vlan2000 -iu PortChannel01 -iu PortChannel02 -iu PortChannel03 -iu PortChannel04 -im eth0 priority=4 autostart=false autorestart=false stdout_logfile=syslog stderr_logfile=syslog dependent_startup=true -dependent_startup_wait_for=isc-dhcp-relay-Vlan1000:running +dependent_startup_wait_for=isc-dhcpv4-relay-Vlan1000:running +[program:dhcpmon-Vlan2000] +command=/usr/sbin/dhcpmon -id Vlan2000 -iu Vlan1000 -iu PortChannel01 -iu PortChannel02 -iu PortChannel03 -iu PortChannel04 -im eth0 +priority=4 +autostart=false +autorestart=false +stdout_logfile=syslog +stderr_logfile=syslog +dependent_startup=true +dependent_startup_wait_for=isc-dhcpv4-relay-Vlan2000:running diff --git a/src/sonic-config-engine/tests/sample_output/py3/frr.conf b/src/sonic-config-engine/tests/sample_output/py3/frr.conf index bb3c4e214e20..43bed33c4bd0 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/frr.conf +++ b/src/sonic-config-engine/tests/sample_output/py3/frr.conf @@ -35,10 +35,6 @@ link-detect ! !! ! -! set static default route to mgmt gateway as a backup to learned default -ip route 0.0.0.0/0 10.0.0.1 200 -!! -! ! ! add static ipv6 /64 loopback route to allow bgpd to advertise the loopback route prefix ipv6 route fc00:1::/64 Loopback0 @@ -58,6 +54,8 @@ ipv6 prefix-list PL_LoopbackV6 permit fc00:1::/64 ! ip prefix-list LOCAL_VLAN_IPV4_PREFIX seq 5 permit 192.168.0.0/27 ! +ip prefix-list LOCAL_VLAN_IPV4_PREFIX seq 10 permit 192.168.200.0/27 +! ! ! router bgp 65100 @@ -71,6 +69,7 @@ router bgp 65100 bgp graceful-restart restart-time 240 bgp graceful-restart bgp graceful-restart preserve-fw-state + bgp graceful-restart select-defer-time 45 ! bgp router-id 10.1.0.32 ! @@ -81,6 +80,7 @@ router bgp 65100 exit-address-family ! network 192.168.0.1/27 + network 192.168.200.1/27 ! ! ! diff --git a/src/sonic-config-engine/tests/sample_output/py3/ipinip.json b/src/sonic-config-engine/tests/sample_output/py3/ipinip.json index db70ea403121..0a01058463bd 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/ipinip.json +++ b/src/sonic-config-engine/tests/sample_output/py3/ipinip.json @@ -2,8 +2,8 @@ { "TUNNEL_DECAP_TABLE:IPINIP_TUNNEL" : { "tunnel_type":"IPINIP", - "dst_ip":"10.0.0.56,10.0.0.58,10.0.0.60,10.0.0.62,10.1.0.32,192.168.0.1", - "dscp_mode":"pipe", + "dst_ip":"10.0.0.56,10.0.0.58,10.0.0.60,10.0.0.62,10.1.0.32,10.21.0.64,10.21.64.2,192.168.0.1,192.168.200.1", + "dscp_mode":"uniform", "ecn_mode":"copy_from_outer", "ttl_mode":"pipe" }, @@ -14,7 +14,7 @@ "TUNNEL_DECAP_TABLE:IPINIP_V6_TUNNEL" : { "tunnel_type":"IPINIP", "dst_ip":"fc00:1::32,fc00::71,fc00::75,fc00::79,fc00::7d", - "dscp_mode":"pipe", + "dscp_mode":"uniform", "ecn_mode":"copy_from_outer", "ttl_mode":"pipe" }, diff --git a/src/sonic-config-engine/tests/sample_output/py3/l1_intfs.json b/src/sonic-config-engine/tests/sample_output/py3/l1_intfs.json new file mode 100644 index 000000000000..bc2d533e87a1 --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py3/l1_intfs.json @@ -0,0 +1,261 @@ +{ + "DEVICE_METADATA": {"localhost": {"hwsku": "32x1000Gb"}}, + "PORT": { + "Ethernet0": { + "admin_status": "up", + "alias": "Ethernet0", + "index": "0", + "lanes": "1296,1297,1298,1299", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet1": { + "admin_status": "up", + "alias": "Ethernet1", + "index": "1", + "lanes": "1300,1301,1302,1303", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet10": { + "admin_status": "up", + "alias": "Ethernet10", + "index": "10", + "lanes": "772,773,774,775", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet11": { + "admin_status": "up", + "alias": "Ethernet11", + "index": "11", + "lanes": "768,769,770,771", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet12": { + "admin_status": "up", + "alias": "Ethernet12", + "index": "12", + "lanes": "780,781,782,783", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet13": { + "admin_status": "up", + "alias": "Ethernet13", + "index": "13", + "lanes": "776,777,778,779", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet14": { + "admin_status": "up", + "alias": "Ethernet14", + "index": "14", + "lanes": "528,529,530,531", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet15": { + "admin_status": "up", + "alias": "Ethernet15", + "index": "15", + "lanes": "532,533,534,535", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet16": { + "admin_status": "up", + "alias": "Ethernet16", + "index": "16", + "lanes": "520,521,522,523", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet17": { + "admin_status": "up", + "alias": "Ethernet17", + "index": "17", + "lanes": "524,525,526,527", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet18": { + "admin_status": "up", + "alias": "Ethernet18", + "index": "18", + "lanes": "512,513,514,515", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet19": { + "admin_status": "up", + "alias": "Ethernet19", + "index": "19", + "lanes": "516,517,518,519", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet2": { + "admin_status": "up", + "alias": "Ethernet2", + "index": "2", + "lanes": "1288,1289,1290,1291", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet20": { + "admin_status": "up", + "alias": "Ethernet20", + "index": "20", + "lanes": "272,273,274,275", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet21": { + "admin_status": "up", + "alias": "Ethernet21", + "index": "21", + "lanes": "276,277,278,279", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet22": { + "admin_status": "up", + "alias": "Ethernet22", + "index": "22", + "lanes": "264,265,266,267", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet23": { + "admin_status": "up", + "alias": "Ethernet23", + "index": "23", + "lanes": "268,269,270,271", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet24": { + "admin_status": "up", + "alias": "Ethernet24", + "index": "24", + "lanes": "256,257,258,259", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet25": { + "admin_status": "up", + "alias": "Ethernet25", + "index": "25", + "lanes": "260,261,262,263", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet26": { + "admin_status": "up", + "alias": "Ethernet26", + "index": "26", + "lanes": "16,17,18,19", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet27": { + "admin_status": "up", + "alias": "Ethernet27", + "index": "27", + "lanes": "20,21,22,23", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet28": { + "admin_status": "up", + "alias": "Ethernet28", + "index": "28", + "lanes": "8,9,10,11", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet29": { + "admin_status": "up", + "alias": "Ethernet29", + "index": "29", + "lanes": "12,13,14,15", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet3": { + "admin_status": "up", + "alias": "Ethernet3", + "index": "3", + "lanes": "1292,1293,1294,1295", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet30": { + "admin_status": "up", + "alias": "Ethernet30", + "index": "30", + "lanes": "0,1,2,3", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet31": { + "admin_status": "up", + "alias": "Ethernet31", + "index": "31", + "lanes": "4,5,6,7", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet4": { + "admin_status": "up", + "alias": "Ethernet4", + "index": "4", + "lanes": "1280,1281,1282,1283", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet5": { + "admin_status": "up", + "alias": "Ethernet5", + "index": "5", + "lanes": "1284,1285,1286,1287", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet6": { + "admin_status": "up", + "alias": "Ethernet6", + "index": "6", + "lanes": "1032,1033,1034,1035", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet7": { + "admin_status": "up", + "alias": "Ethernet7", + "index": "7", + "lanes": "1036,1037,1038,1039", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet8": { + "admin_status": "up", + "alias": "Ethernet8", + "index": "8", + "lanes": "1024,1025,1026,1027", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet9": { + "admin_status": "up", + "alias": "Ethernet9", + "index": "9", + "lanes": "1028,1029,1030,1031", + "mtu": "9100", + "speed": "100000" + } + } +} diff --git a/src/sonic-config-engine/tests/sample_output/py3/l2switch_dualtor.json b/src/sonic-config-engine/tests/sample_output/py3/l2switch_dualtor.json new file mode 100644 index 000000000000..44edd892ab91 --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py3/l2switch_dualtor.json @@ -0,0 +1,647 @@ +{ + "DEVICE_METADATA": { + "localhost": { + "hwsku": "Arista-7050CX3-32S-D48C8", + "subtype": "DualToR", + "peer_switch": "peer_switch_hostname" + } + }, + "PORT": { + "Ethernet0": { + "lanes": "1,2", + "alias": "Ethernet1/1", + "index": "1", + "speed": "50000", + "admin_status": "up", + "mux_cable": "true" + }, + "Ethernet2": { + "lanes": "3,4", + "alias": "Ethernet1/3", + "index": "1", + "speed": "50000" + }, + "Ethernet4": { + "lanes": "5,6", + "alias": "Ethernet2/1", + "index": "2", + "speed": "50000", + "admin_status": "up", + "mux_cable": "true" + }, + "Ethernet6": { + "lanes": "7,8", + "alias": "Ethernet2/3", + "index": "2", + "speed": "50000" + }, + "Ethernet8": { + "lanes": "9,10", + "alias": "Ethernet3/1", + "index": "3", + "speed": "50000", + "admin_status": "up", + "mux_cable": "true" + }, + "Ethernet10": { + "lanes": "11,12", + "alias": "Ethernet3/3", + "index": "3", + "speed": "50000" + }, + "Ethernet12": { + "lanes": "13,14", + "alias": "Ethernet4/1", + "index": "4", + "speed": "50000", + "admin_status": "up", + "mux_cable": "true" + }, + "Ethernet14": { + "lanes": "15,16", + "alias": "Ethernet4/3", + "index": "4", + "speed": "50000" + }, + "Ethernet16": { + "lanes": "21,22", + "alias": "Ethernet5/1", + "index": "5", + "speed": "50000", + "admin_status": "up", + "mux_cable": "true" + }, + "Ethernet18": { + "lanes": "23,24", + "alias": "Ethernet5/3", + "index": "5", + "speed": "50000" + }, + "Ethernet20": { + "lanes": "17,18", + "alias": "Ethernet6/1", + "index": "6", + "speed": "50000", + "admin_status": "up", + "mux_cable": "true" + }, + "Ethernet22": { + "lanes": "19,20", + "alias": "Ethernet6/3", + "index": "6", + "speed": "50000" + }, + "Ethernet24": { + "lanes": "25,26,27,28", + "alias": "Ethernet7/1", + "index": "7", + "speed": "100000", + "admin_status": "up" + }, + "Ethernet28": { + "lanes": "29,30,31,32", + "alias": "Ethernet8/1", + "index": "8", + "speed": "100000", + "admin_status": "up" + }, + "Ethernet32": { + "lanes": "37,38,39,40", + "alias": "Ethernet9/1", + "index": "9", + "speed": "100000", + "admin_status": "up" + }, + "Ethernet36": { + "lanes": "33,34,35,36", + "alias": "Ethernet10/1", + "index": "10", + "speed": "100000", + "admin_status": "up" + }, + "Ethernet40": { + "lanes": "41,42", + "alias": "Ethernet11/1", + "index": "11", + "speed": "50000", + "admin_status": "up", + "mux_cable": "true" + }, + "Ethernet42": { + "lanes": "43,44", + "alias": "Ethernet11/3", + "index": "11", + "speed": "50000" + }, + "Ethernet44": { + "lanes": "45,46", + "alias": "Ethernet12/1", + "index": "12", + "speed": "50000", + "admin_status": "up", + "mux_cable": "true" + }, + "Ethernet46": { + "lanes": "47,48", + "alias": "Ethernet12/3", + "index": "12", + "speed": "50000" + }, + "Ethernet48": { + "lanes": "53,54", + "alias": "Ethernet13/1", + "index": "13", + "speed": "50000", + "admin_status": "up", + "mux_cable": "true" + }, + "Ethernet50": { + "lanes": "55,56", + "alias": "Ethernet13/3", + "index": "13", + "speed": "50000" + }, + "Ethernet52": { + "lanes": "49,50", + "alias": "Ethernet14/1", + "index": "14", + "speed": "50000", + "admin_status": "up", + "mux_cable": "true" + }, + "Ethernet54": { + "lanes": "51,52", + "alias": "Ethernet14/3", + "index": "14", + "speed": "50000" + }, + "Ethernet56": { + "lanes": "57,58", + "alias": "Ethernet15/1", + "index": "15", + "speed": "50000", + "admin_status": "up", + "mux_cable": "true" + }, + "Ethernet58": { + "lanes": "59,60", + "alias": "Ethernet15/3", + "index": "15", + "speed": "50000" + }, + "Ethernet60": { + "lanes": "61,62", + "alias": "Ethernet16/1", + "index": "16", + "speed": "50000", + "admin_status": "up", + "mux_cable": "true" + }, + "Ethernet62": { + "lanes": "63,64", + "alias": "Ethernet16/3", + "index": "16", + "speed": "50000" + }, + "Ethernet64": { + "lanes": "69,70", + "alias": "Ethernet17/1", + "index": "17", + "speed": "50000", + "admin_status": "up", + "mux_cable": "true" + }, + "Ethernet66": { + "lanes": "71,72", + "alias": "Ethernet17/3", + "index": "17", + "speed": "50000" + }, + "Ethernet68": { + "lanes": "65,66", + "alias": "Ethernet18/1", + "index": "18", + "speed": "50000", + "admin_status": "up", + "mux_cable": "true" + }, + "Ethernet70": { + "lanes": "67,68", + "alias": "Ethernet18/3", + "index": "18", + "speed": "50000" + }, + "Ethernet72": { + "lanes": "73,74", + "alias": "Ethernet19/1", + "index": "19", + "speed": "50000", + "admin_status": "up", + "mux_cable": "true" + }, + "Ethernet74": { + "lanes": "75,76", + "alias": "Ethernet19/3", + "index": "19", + "speed": "50000" + }, + "Ethernet76": { + "lanes": "77,78", + "alias": "Ethernet20/1", + "index": "20", + "speed": "50000", + "admin_status": "up", + "mux_cable": "true" + }, + "Ethernet78": { + "lanes": "79,80", + "alias": "Ethernet20/3", + "index": "20", + "speed": "50000" + }, + "Ethernet80": { + "lanes": "85,86", + "alias": "Ethernet21/1", + "index": "21", + "speed": "50000", + "admin_status": "up", + "mux_cable": "true" + }, + "Ethernet82": { + "lanes": "87,88", + "alias": "Ethernet21/3", + "index": "21", + "speed": "50000" + }, + "Ethernet84": { + "lanes": "81,82", + "alias": "Ethernet22/1", + "index": "22", + "speed": "50000", + "admin_status": "up", + "mux_cable": "true" + }, + "Ethernet86": { + "lanes": "83,84", + "alias": "Ethernet22/3", + "index": "22", + "speed": "50000" + }, + "Ethernet88": { + "lanes": "89,90,91,92", + "alias": "Ethernet23/1", + "index": "23", + "speed": "100000", + "admin_status": "up" + }, + "Ethernet92": { + "lanes": "93,94,95,96", + "alias": "Ethernet24/1", + "index": "24", + "speed": "100000", + "admin_status": "up" + }, + "Ethernet96": { + "lanes": "101,102,103,104", + "alias": "Ethernet25/1", + "index": "25", + "speed": "100000", + "admin_status": "up" + }, + "Ethernet100": { + "lanes": "97,98,99,100", + "alias": "Ethernet26/1", + "index": "26", + "speed": "100000", + "admin_status": "up" + }, + "Ethernet104": { + "lanes": "105,106", + "alias": "Ethernet27/1", + "index": "27", + "speed": "50000", + "admin_status": "up", + "mux_cable": "true" + }, + "Ethernet106": { + "lanes": "107,108", + "alias": "Ethernet27/3", + "index": "27", + "speed": "50000" + }, + "Ethernet108": { + "lanes": "109,110", + "alias": "Ethernet28/1", + "index": "28", + "speed": "50000", + "admin_status": "up", + "mux_cable": "true" + }, + "Ethernet110": { + "lanes": "111,112", + "alias": "Ethernet28/3", + "index": "28", + "speed": "50000" + }, + "Ethernet112": { + "lanes": "117,118", + "alias": "Ethernet29/1", + "index": "29", + "speed": "50000", + "admin_status": "up", + "mux_cable": "true" + }, + "Ethernet114": { + "lanes": "119,120", + "alias": "Ethernet29/3", + "index": "29", + "speed": "50000" + }, + "Ethernet116": { + "lanes": "113,114", + "alias": "Ethernet30/1", + "index": "30", + "speed": "50000", + "admin_status": "up", + "mux_cable": "true" + }, + "Ethernet118": { + "lanes": "115,116", + "alias": "Ethernet30/3", + "index": "30", + "speed": "50000" + }, + "Ethernet120": { + "lanes": "121,122", + "alias": "Ethernet31/1", + "index": "31", + "speed": "50000", + "admin_status": "up", + "mux_cable": "true" + }, + "Ethernet122": { + "lanes": "123,124", + "alias": "Ethernet31/3", + "index": "31", + "speed": "50000" + }, + "Ethernet124": { + "lanes": "125,126", + "alias": "Ethernet32/1", + "index": "32", + "speed": "50000", + "admin_status": "up", + "mux_cable": "true" + }, + "Ethernet126": { + "lanes": "127,128", + "alias": "Ethernet32/3", + "index": "32", + "speed": "50000" + } + }, + "VLAN": { + "Vlan1000": { + "vlanid": "1000" + } + }, + "VLAN_MEMBER": { + "Vlan1000|Ethernet0": { + "tagging_mode": "untagged" + }, + "Vlan1000|Ethernet4": { + "tagging_mode": "untagged" + }, + "Vlan1000|Ethernet8": { + "tagging_mode": "untagged" + }, + "Vlan1000|Ethernet12": { + "tagging_mode": "untagged" + }, + "Vlan1000|Ethernet16": { + "tagging_mode": "untagged" + }, + "Vlan1000|Ethernet20": { + "tagging_mode": "untagged" + }, + "Vlan1000|Ethernet24": { + "tagging_mode": "untagged" + }, + "Vlan1000|Ethernet28": { + "tagging_mode": "untagged" + }, + "Vlan1000|Ethernet32": { + "tagging_mode": "untagged" + }, + "Vlan1000|Ethernet36": { + "tagging_mode": "untagged" + }, + "Vlan1000|Ethernet40": { + "tagging_mode": "untagged" + }, + "Vlan1000|Ethernet44": { + "tagging_mode": "untagged" + }, + "Vlan1000|Ethernet48": { + "tagging_mode": "untagged" + }, + "Vlan1000|Ethernet52": { + "tagging_mode": "untagged" + }, + "Vlan1000|Ethernet56": { + "tagging_mode": "untagged" + }, + "Vlan1000|Ethernet60": { + "tagging_mode": "untagged" + }, + "Vlan1000|Ethernet64": { + "tagging_mode": "untagged" + }, + "Vlan1000|Ethernet68": { + "tagging_mode": "untagged" + }, + "Vlan1000|Ethernet72": { + "tagging_mode": "untagged" + }, + "Vlan1000|Ethernet76": { + "tagging_mode": "untagged" + }, + "Vlan1000|Ethernet80": { + "tagging_mode": "untagged" + }, + "Vlan1000|Ethernet84": { + "tagging_mode": "untagged" + }, + "Vlan1000|Ethernet88": { + "tagging_mode": "untagged" + }, + "Vlan1000|Ethernet92": { + "tagging_mode": "untagged" + }, + "Vlan1000|Ethernet96": { + "tagging_mode": "untagged" + }, + "Vlan1000|Ethernet100": { + "tagging_mode": "untagged" + }, + "Vlan1000|Ethernet104": { + "tagging_mode": "untagged" + }, + "Vlan1000|Ethernet108": { + "tagging_mode": "untagged" + }, + "Vlan1000|Ethernet112": { + "tagging_mode": "untagged" + }, + "Vlan1000|Ethernet116": { + "tagging_mode": "untagged" + }, + "Vlan1000|Ethernet120": { + "tagging_mode": "untagged" + }, + "Vlan1000|Ethernet124": { + "tagging_mode": "untagged" + } + }, + "TUNNEL": { + "MuxTunnel0": { + "dscp_mode": "uniform", + "dst_ip": "2.2.2.2", + "ecn_mode": "copy_from_outer", + "encap_ecn_mode": "standard", + "ttl_mode": "pipe", + "tunnel_type": "IPINIP" + } + }, + "PEER_SWITCH": { + "peer_switch_hostname": { + "address_ipv4": "1.1.1.1" + } + }, + "LOOPBACK_INTERFACE": { + "Loopback2": {}, + "Loopback2|3.3.3.3": {} + }, + "MUX_CABLE": { + "Ethernet0": { + "server_ipv4": "192.168.0.2/32", + "server_ipv6": "fc02:1000::2/128", + "state": "auto" + }, + "Ethernet4": { + "server_ipv4": "192.168.0.3/32", + "server_ipv6": "fc02:1000::3/128", + "state": "auto" + }, + "Ethernet8": { + "server_ipv4": "192.168.0.4/32", + "server_ipv6": "fc02:1000::4/128", + "state": "auto" + }, + "Ethernet12": { + "server_ipv4": "192.168.0.5/32", + "server_ipv6": "fc02:1000::5/128", + "state": "auto" + }, + "Ethernet16": { + "server_ipv4": "192.168.0.6/32", + "server_ipv6": "fc02:1000::6/128", + "state": "auto" + }, + "Ethernet20": { + "server_ipv4": "192.168.0.7/32", + "server_ipv6": "fc02:1000::7/128", + "state": "auto" + }, + "Ethernet40": { + "server_ipv4": "192.168.0.8/32", + "server_ipv6": "fc02:1000::8/128", + "state": "auto" + }, + "Ethernet44": { + "server_ipv4": "192.168.0.9/32", + "server_ipv6": "fc02:1000::9/128", + "state": "auto" + }, + "Ethernet48": { + "server_ipv4": "192.168.0.10/32", + "server_ipv6": "fc02:1000::a/128", + "state": "auto" + }, + "Ethernet52": { + "server_ipv4": "192.168.0.11/32", + "server_ipv6": "fc02:1000::b/128", + "state": "auto" + }, + "Ethernet56": { + "server_ipv4": "192.168.0.12/32", + "server_ipv6": "fc02:1000::c/128", + "state": "auto" + }, + "Ethernet60": { + "server_ipv4": "192.168.0.13/32", + "server_ipv6": "fc02:1000::d/128", + "state": "auto" + }, + "Ethernet64": { + "server_ipv4": "192.168.0.14/32", + "server_ipv6": "fc02:1000::e/128", + "state": "auto" + }, + "Ethernet68": { + "server_ipv4": "192.168.0.15/32", + "server_ipv6": "fc02:1000::f/128", + "state": "auto" + }, + "Ethernet72": { + "server_ipv4": "192.168.0.16/32", + "server_ipv6": "fc02:1000::10/128", + "state": "auto" + }, + "Ethernet76": { + "server_ipv4": "192.168.0.17/32", + "server_ipv6": "fc02:1000::11/128", + "state": "auto" + }, + "Ethernet80": { + "server_ipv4": "192.168.0.18/32", + "server_ipv6": "fc02:1000::12/128", + "state": "auto" + }, + "Ethernet84": { + "server_ipv4": "192.168.0.19/32", + "server_ipv6": "fc02:1000::13/128", + "state": "auto" + }, + "Ethernet104": { + "server_ipv4": "192.168.0.20/32", + "server_ipv6": "fc02:1000::14/128", + "state": "auto" + }, + "Ethernet108": { + "server_ipv4": "192.168.0.21/32", + "server_ipv6": "fc02:1000::15/128", + "state": "auto" + }, + "Ethernet112": { + "server_ipv4": "192.168.0.22/32", + "server_ipv6": "fc02:1000::16/128", + "state": "auto" + }, + "Ethernet116": { + "server_ipv4": "192.168.0.23/32", + "server_ipv6": "fc02:1000::17/128", + "state": "auto" + }, + "Ethernet120": { + "server_ipv4": "192.168.0.24/32", + "server_ipv6": "fc02:1000::18/128", + "state": "auto" + }, + "Ethernet124": { + "server_ipv4": "192.168.0.25/32", + "server_ipv6": "fc02:1000::19/128", + "state": "auto" + } + } +} diff --git a/src/sonic-config-engine/tests/sample_output/py3/l3_intfs.json b/src/sonic-config-engine/tests/sample_output/py3/l3_intfs.json new file mode 100644 index 000000000000..9ca31832303f --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py3/l3_intfs.json @@ -0,0 +1,301 @@ +{ + "DEVICE_METADATA": {"localhost": {"hwsku": "32x1000Gb"}}, + "PORT": { + "Ethernet0": { + "admin_status": "up", + "alias": "Ethernet0", + "index": "0", + "lanes": "1296,1297,1298,1299", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet1": { + "admin_status": "up", + "alias": "Ethernet1", + "index": "1", + "lanes": "1300,1301,1302,1303", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet10": { + "admin_status": "up", + "alias": "Ethernet10", + "index": "10", + "lanes": "772,773,774,775", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet11": { + "admin_status": "up", + "alias": "Ethernet11", + "index": "11", + "lanes": "768,769,770,771", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet12": { + "admin_status": "up", + "alias": "Ethernet12", + "index": "12", + "lanes": "780,781,782,783", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet13": { + "admin_status": "up", + "alias": "Ethernet13", + "index": "13", + "lanes": "776,777,778,779", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet14": { + "admin_status": "up", + "alias": "Ethernet14", + "index": "14", + "lanes": "528,529,530,531", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet15": { + "admin_status": "up", + "alias": "Ethernet15", + "index": "15", + "lanes": "532,533,534,535", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet16": { + "admin_status": "up", + "alias": "Ethernet16", + "index": "16", + "lanes": "520,521,522,523", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet17": { + "admin_status": "up", + "alias": "Ethernet17", + "index": "17", + "lanes": "524,525,526,527", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet18": { + "admin_status": "up", + "alias": "Ethernet18", + "index": "18", + "lanes": "512,513,514,515", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet19": { + "admin_status": "up", + "alias": "Ethernet19", + "index": "19", + "lanes": "516,517,518,519", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet2": { + "admin_status": "up", + "alias": "Ethernet2", + "index": "2", + "lanes": "1288,1289,1290,1291", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet20": { + "admin_status": "up", + "alias": "Ethernet20", + "index": "20", + "lanes": "272,273,274,275", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet21": { + "admin_status": "up", + "alias": "Ethernet21", + "index": "21", + "lanes": "276,277,278,279", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet22": { + "admin_status": "up", + "alias": "Ethernet22", + "index": "22", + "lanes": "264,265,266,267", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet23": { + "admin_status": "up", + "alias": "Ethernet23", + "index": "23", + "lanes": "268,269,270,271", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet24": { + "admin_status": "up", + "alias": "Ethernet24", + "index": "24", + "lanes": "256,257,258,259", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet25": { + "admin_status": "up", + "alias": "Ethernet25", + "index": "25", + "lanes": "260,261,262,263", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet26": { + "admin_status": "up", + "alias": "Ethernet26", + "index": "26", + "lanes": "16,17,18,19", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet27": { + "admin_status": "up", + "alias": "Ethernet27", + "index": "27", + "lanes": "20,21,22,23", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet28": { + "admin_status": "up", + "alias": "Ethernet28", + "index": "28", + "lanes": "8,9,10,11", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet29": { + "admin_status": "up", + "alias": "Ethernet29", + "index": "29", + "lanes": "12,13,14,15", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet3": { + "admin_status": "up", + "alias": "Ethernet3", + "index": "3", + "lanes": "1292,1293,1294,1295", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet30": { + "admin_status": "up", + "alias": "Ethernet30", + "index": "30", + "lanes": "0,1,2,3", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet31": { + "admin_status": "up", + "alias": "Ethernet31", + "index": "31", + "lanes": "4,5,6,7", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet4": { + "admin_status": "up", + "alias": "Ethernet4", + "index": "4", + "lanes": "1280,1281,1282,1283", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet5": { + "admin_status": "up", + "alias": "Ethernet5", + "index": "5", + "lanes": "1284,1285,1286,1287", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet6": { + "admin_status": "up", + "alias": "Ethernet6", + "index": "6", + "lanes": "1032,1033,1034,1035", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet7": { + "admin_status": "up", + "alias": "Ethernet7", + "index": "7", + "lanes": "1036,1037,1038,1039", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet8": { + "admin_status": "up", + "alias": "Ethernet8", + "index": "8", + "lanes": "1024,1025,1026,1027", + "mtu": "9100", + "speed": "100000" + }, + "Ethernet9": { + "admin_status": "up", + "alias": "Ethernet9", + "index": "9", + "lanes": "1028,1029,1030,1031", + "mtu": "9100", + "speed": "100000" + } + }, + "LOOPBACK_INTERFACE": { + "Loopback0": {}, + "Loopback0|10.1.0.1/32": {} + }, + "BGP_NEIGHBOR": {}, + "DEVICE_NEIGHBOR": {}, + "INTERFACE": { + "Ethernet0": {}, + "Ethernet1": {}, + "Ethernet2": {}, + "Ethernet3": {}, + "Ethernet4": {}, + "Ethernet5": {}, + "Ethernet6": {}, + "Ethernet7": {}, + "Ethernet8": {}, + "Ethernet9": {}, + "Ethernet10": {}, + "Ethernet11": {}, + "Ethernet12": {}, + "Ethernet13": {}, + "Ethernet14": {}, + "Ethernet15": {}, + "Ethernet16": {}, + "Ethernet17": {}, + "Ethernet18": {}, + "Ethernet19": {}, + "Ethernet20": {}, + "Ethernet21": {}, + "Ethernet22": {}, + "Ethernet23": {}, + "Ethernet24": {}, + "Ethernet25": {}, + "Ethernet26": {}, + "Ethernet27": {}, + "Ethernet28": {}, + "Ethernet29": {}, + "Ethernet30": {}, + "Ethernet31": {} + } +} diff --git a/src/sonic-config-engine/tests/sample_output/py3/ndppd.conf b/src/sonic-config-engine/tests/sample_output/py3/ndppd.conf index 28a239006d24..66117155cdbf 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/ndppd.conf +++ b/src/sonic-config-engine/tests/sample_output/py3/ndppd.conf @@ -4,6 +4,7 @@ # # Config file for ndppd, the NDP Proxy Daemon # See man page for ndppd.conf.5 for descriptions of all available options +route-ttl 2147483647 proxy Vlan1000 { rule fc01:1000::/64 { diff --git a/src/sonic-config-engine/tests/sample_output/py3/ntp.conf b/src/sonic-config-engine/tests/sample_output/py3/ntp.conf new file mode 100644 index 000000000000..bc98019e88f7 --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py3/ntp.conf @@ -0,0 +1,72 @@ +############################################################################### +# Managed by Ansible +# file: ansible/roles/acs/templates/ntp.conf.j2 +############################################################################### + +# /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help + +# To avoid ntpd from panic and exit if the drift between new time and +# current system time is large. +tinker panic 0 + +driftfile /var/lib/ntp/ntp.drift + + +# Enable this if you want statistics to be logged. +#statsdir /var/log/ntpstats/ + +statistics loopstats peerstats clockstats +filegen loopstats file loopstats type day enable +filegen peerstats file peerstats type day enable +filegen clockstats file clockstats type day enable + + +# You do need to talk to an NTP server or two (or three). +#server ntp.your-provider.example + +# pool.ntp.org maps to about 1000 low-stratum NTP servers. Your server will +# pick a different set every time it starts up. Please consider joining the +# pool: + +#listen on source interface if configured, else +#only listen on MGMT_INTERFACE, LOOPBACK_INTERFACE ip when MGMT_INTERFACE is not defined, or eth0 +# if we don't have both of them (default is to listen on all ip addresses) +interface ignore wildcard + +# set global variable for configured source interface name +# set global boolean to indicate if the ip of the configured source interface is configured +# if the source interface is configured but no ip on that interface, then listen on another +# interface based on existing logic + +interface listen Ethernet0 +interface listen 127.0.0.1 + +# Access control configuration; see /usr/share/doc/ntp-doc/html/accopt.html for +# details. The web page +# might also be helpful. +# +# Note that "restrict" applies to both servers and clients, so a configuration +# that might be intended to block requests from certain clients could also end +# up blocking replies from your own upstream servers. + +# By default, exchange time with everybody, but don't allow configuration. +restrict -4 default kod notrap nomodify nopeer noquery +restrict -6 default kod notrap nomodify nopeer noquery + +# Local users may interrogate the ntp server more closely. +restrict 127.0.0.1 +restrict ::1 + +# Clients from this (example!) subnet have unlimited access, but only if +# cryptographically authenticated. +#restrict 192.168.123.0 mask 255.255.255.0 notrust + + +# If you want to provide time to your local subnet, change the next line. +# (Again, the address is an example only.) +#broadcast 192.168.123.255 + +# If you want to listen to time broadcasts on your local subnet, de-comment the +# next lines. Please do this only if you trust everybody on the network! +#disable auth +#broadcastclient diff --git a/src/sonic-config-engine/tests/sample_output/py3/ports.json b/src/sonic-config-engine/tests/sample_output/py3/ports.json index 36f5ad117c39..1fee36338bd2 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/ports.json +++ b/src/sonic-config-engine/tests/sample_output/py3/ports.json @@ -26,5 +26,12 @@ "description": "Interface description" }, "OP": "SET" + }, + { + "PORT_TABLE:Ethernet16": { + "speed": "1000", + "description": "fortyGigE0/16" + }, + "OP": "SET" } ] diff --git a/src/sonic-config-engine/tests/sample_output/py3/qos-arista7050-t0-storage-backend.json b/src/sonic-config-engine/tests/sample_output/py3/qos-arista7050-t0-storage-backend.json new file mode 100644 index 000000000000..8070e38a0c99 --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py3/qos-arista7050-t0-storage-backend.json @@ -0,0 +1,81 @@ +{ + "TC_TO_PRIORITY_GROUP_MAP": { + "AZURE": { + "0": "0", + "1": "0", + "2": "0", + "3": "3", + "4": "4", + "5": "0", + "6": "0", + "7": "7" + } + }, + "MAP_PFC_PRIORITY_TO_QUEUE": { + "AZURE": { + "0": "0", + "1": "1", + "2": "2", + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7" + } + }, + "TC_TO_QUEUE_MAP": { + "AZURE": { + "0": "0", + "1": "1", + "2": "2", + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7" + } + }, + "DOT1P_TO_TC_MAP": { + "AZURE": { + "0": "1", + "1": "0", + "2": "2", + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7" + } + }, + "SCHEDULER": { + "scheduler.0": { + "type" : "DWRR", + "weight": "14" + }, + "scheduler.1": { + "type" : "DWRR", + "weight": "15" + } + }, + "PORT_QOS_MAP": { + }, + "WRED_PROFILE": { + "AZURE_LOSSLESS" : { + "wred_green_enable" : "true", + "wred_yellow_enable" : "true", + "wred_red_enable" : "true", + "ecn" : "ecn_all", + "green_max_threshold" : "12000144", + "green_min_threshold" : "1048576", + "yellow_max_threshold" : "2097152", + "yellow_min_threshold" : "1048576", + "red_max_threshold" : "2097152", + "red_min_threshold" : "1048576", + "green_drop_probability" : "5", + "yellow_drop_probability": "5", + "red_drop_probability" : "5" + } + }, + "QUEUE": { + } +} diff --git a/src/sonic-config-engine/tests/sample_output/py3/qos-arista7050.json b/src/sonic-config-engine/tests/sample_output/py3/qos-arista7050.json index aa05ef4ec36c..b5f304dc133e 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/qos-arista7050.json +++ b/src/sonic-config-engine/tests/sample_output/py3/qos-arista7050.json @@ -114,201 +114,232 @@ } }, "PORT_QOS_MAP": { + "global": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]" + }, "Ethernet4": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet8": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet12": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet16": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet20": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet24": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet28": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet32": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet36": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet40": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet44": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet48": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet52": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet56": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet60": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet64": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet68": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet72": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet76": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet80": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet84": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet88": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet92": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet96": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet112": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet116": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet120": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet124": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" } }, "WRED_PROFILE": { diff --git a/src/sonic-config-engine/tests/sample_output/py3/qos-arista7050cx3-dualtor-remap-disabled.json b/src/sonic-config-engine/tests/sample_output/py3/qos-arista7050cx3-dualtor-remap-disabled.json new file mode 100644 index 000000000000..4bf8cb473af6 --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py3/qos-arista7050cx3-dualtor-remap-disabled.json @@ -0,0 +1,1132 @@ +{ + "TC_TO_PRIORITY_GROUP_MAP": { + "AZURE": { + "0": "0", + "1": "0", + "2": "0", + "3": "3", + "4": "4", + "5": "0", + "6": "0", + "7": "7" + } + }, + "MAP_PFC_PRIORITY_TO_QUEUE": { + "AZURE": { + "0": "0", + "1": "1", + "2": "2", + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7" + } + }, + "TC_TO_QUEUE_MAP": { + "AZURE": { + "0": "0", + "1": "1", + "2": "2", + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7" + } + }, + "DSCP_TO_TC_MAP": { + "AZURE": { + "0" : "1", + "1" : "1", + "2" : "1", + "3" : "3", + "4" : "4", + "5" : "2", + "6" : "1", + "7" : "1", + "8" : "0", + "9" : "1", + "10": "1", + "11": "1", + "12": "1", + "13": "1", + "14": "1", + "15": "1", + "16": "1", + "17": "1", + "18": "1", + "19": "1", + "20": "1", + "21": "1", + "22": "1", + "23": "1", + "24": "1", + "25": "1", + "26": "1", + "27": "1", + "28": "1", + "29": "1", + "30": "1", + "31": "1", + "32": "1", + "33": "1", + "34": "1", + "35": "1", + "36": "1", + "37": "1", + "38": "1", + "39": "1", + "40": "1", + "41": "1", + "42": "1", + "43": "1", + "44": "1", + "45": "1", + "46": "5", + "47": "1", + "48": "6", + "49": "1", + "50": "1", + "51": "1", + "52": "1", + "53": "1", + "54": "1", + "55": "1", + "56": "1", + "57": "1", + "58": "1", + "59": "1", + "60": "1", + "61": "1", + "62": "1", + "63": "1" + } + }, + "SCHEDULER": { + "scheduler.0": { + "type" : "DWRR", + "weight": "14" + }, + "scheduler.1": { + "type" : "DWRR", + "weight": "15" + } + }, + "PORT_QOS_MAP": { + "global": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]" + }, + "Ethernet0": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet4": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet8": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet12": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet16": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet20": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet24": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet28": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet32": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet36": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet40": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet44": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet48": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet52": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet56": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet60": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet64": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet68": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet72": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet76": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet80": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet84": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet88": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet92": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet96": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet100": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet104": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet108": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet112": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet116": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet120": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet124": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + } + }, + "WRED_PROFILE": { + "AZURE_LOSSLESS" : { + "wred_green_enable" : "true", + "wred_yellow_enable" : "true", + "wred_red_enable" : "true", + "ecn" : "ecn_all", + "green_max_threshold" : "2097152", + "green_min_threshold" : "1048576", + "yellow_max_threshold" : "2097152", + "yellow_min_threshold" : "1048576", + "red_max_threshold" : "2097152", + "red_min_threshold" : "1048576", + "green_drop_probability" : "5", + "yellow_drop_probability": "5", + "red_drop_probability" : "5" + } + }, + "QUEUE": { + "Ethernet0|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet4|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet8|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet12|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet16|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet20|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet24|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet28|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet32|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet36|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet40|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet44|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet48|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet52|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet56|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet60|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet64|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet68|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet72|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet76|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet80|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet84|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet88|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet92|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet96|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet100|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet104|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet108|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet112|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet116|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet120|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet124|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet0|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet4|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet8|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet12|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet16|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet20|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet24|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet28|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet32|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet36|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet40|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet44|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet48|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet52|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet56|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet60|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet64|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet68|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet72|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet76|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet80|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet84|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet88|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet92|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet96|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet100|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet104|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet108|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet112|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet116|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet120|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet124|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet0|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet4|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet8|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet12|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet16|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet20|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet24|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet28|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet32|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet36|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet40|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet44|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet48|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet52|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet56|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet60|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet64|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet68|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet72|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet76|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet80|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet84|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet88|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet92|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet96|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet100|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet104|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet108|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet112|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet116|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet120|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet124|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet0|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet4|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet8|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet12|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet16|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet20|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet24|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet28|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet32|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet36|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet40|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet44|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet48|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet52|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet56|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet60|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet64|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet68|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet72|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet76|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet80|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet84|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet88|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet92|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet96|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet100|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet104|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet108|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet112|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet116|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet120|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet124|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet0|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet4|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet8|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet12|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet16|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet20|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet24|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet28|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet32|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet36|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet40|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet44|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet48|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet52|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet56|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet60|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet64|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet68|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet72|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet76|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet80|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet84|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet88|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet92|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet96|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet100|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet104|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet108|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet112|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet116|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet120|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet124|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet0|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet4|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet8|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet12|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet16|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet20|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet24|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet28|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet32|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet36|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet40|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet44|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet48|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet52|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet56|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet60|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet64|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet68|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet72|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet76|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet80|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet84|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet88|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet92|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet96|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet100|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet104|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet108|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet112|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet116|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet120|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet124|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet0|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet4|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet8|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet12|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet16|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet20|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet24|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet28|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet32|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet36|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet40|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet44|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet48|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet52|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet56|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet60|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet64|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet68|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet72|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet76|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet80|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet84|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet88|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet92|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet96|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet100|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet104|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet108|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet112|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet116|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet120|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet124|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + } + } +} diff --git a/src/sonic-config-engine/tests/sample_output/py3/qos-arista7050cx3-dualtor.json b/src/sonic-config-engine/tests/sample_output/py3/qos-arista7050cx3-dualtor.json new file mode 100644 index 000000000000..3ce939b36cae --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py3/qos-arista7050cx3-dualtor.json @@ -0,0 +1,1424 @@ +{ + "TC_TO_PRIORITY_GROUP_MAP": { + "AZURE": { + "0": "0", + "1": "0", + "2": "2", + "3": "3", + "4": "4", + "5": "0", + "6": "6", + "7": "0", + "8": "0" + }, + "AZURE_TUNNEL": { + "0": "0", + "1": "0", + "2": "0", + "3": "2", + "4": "6", + "5": "0", + "6": "0", + "7": "0", + "8": "0" + } + }, + "MAP_PFC_PRIORITY_TO_QUEUE": { + "AZURE": { + "0": "0", + "1": "1", + "2": "2", + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7" + } + }, + "TC_TO_QUEUE_MAP": { + "AZURE": { + "0": "0", + "1": "1", + "2": "1", + "3": "3", + "4": "4", + "5": "5", + "6": "1", + "7": "7", + "8": "1" + }, + "AZURE_UPLINK": { + "0": "0", + "1": "1", + "2": "2", + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7", + "8": "1" + }, + "AZURE_TUNNEL": { + "0": "0", + "1": "1", + "2": "1", + "3": "2", + "4": "6", + "5": "5", + "6": "1", + "7": "7", + "8": "1" + } + }, + "DSCP_TO_TC_MAP": { + "AZURE": { + "0" : "1", + "1" : "1", + "2" : "1", + "3" : "3", + "4" : "4", + "5" : "1", + "6" : "1", + "7" : "1", + "8" : "0", + "9" : "1", + "10": "1", + "11": "1", + "12": "1", + "13": "1", + "14": "1", + "15": "1", + "16": "1", + "17": "1", + "18": "1", + "19": "1", + "20": "1", + "21": "1", + "22": "1", + "23": "1", + "24": "1", + "25": "1", + "26": "1", + "27": "1", + "28": "1", + "29": "1", + "30": "1", + "31": "1", + "32": "1", + "33": "8", + "34": "1", + "35": "1", + "36": "1", + "37": "1", + "38": "1", + "39": "1", + "40": "1", + "41": "1", + "42": "1", + "43": "1", + "44": "1", + "45": "1", + "46": "5", + "47": "1", + "48": "7", + "49": "1", + "50": "1", + "51": "1", + "52": "1", + "53": "1", + "54": "1", + "55": "1", + "56": "1", + "57": "1", + "58": "1", + "59": "1", + "60": "1", + "61": "1", + "62": "1", + "63": "1" + }, + "AZURE_UPLINK": { + "0" : "1", + "1" : "1", + "2" : "2", + "3" : "3", + "4" : "4", + "5" : "1", + "6" : "6", + "7" : "1", + "8" : "0", + "9" : "1", + "10": "1", + "11": "1", + "12": "1", + "13": "1", + "14": "1", + "15": "1", + "16": "1", + "17": "1", + "18": "1", + "19": "1", + "20": "1", + "21": "1", + "22": "1", + "23": "1", + "24": "1", + "25": "1", + "26": "1", + "27": "1", + "28": "1", + "29": "1", + "30": "1", + "31": "1", + "32": "1", + "33": "8", + "34": "1", + "35": "1", + "36": "1", + "37": "1", + "38": "1", + "39": "1", + "40": "1", + "41": "1", + "42": "1", + "43": "1", + "44": "1", + "45": "1", + "46": "5", + "47": "1", + "48": "7", + "49": "1", + "50": "1", + "51": "1", + "52": "1", + "53": "1", + "54": "1", + "55": "1", + "56": "1", + "57": "1", + "58": "1", + "59": "1", + "60": "1", + "61": "1", + "62": "1", + "63": "1" + }, + "AZURE_TUNNEL": { + "0" : "1", + "1" : "1", + "2" : "1", + "3" : "3", + "4" : "4", + "5" : "1", + "6" : "1", + "7" : "1", + "8" : "0", + "9" : "1", + "10": "1", + "11": "1", + "12": "1", + "13": "1", + "14": "1", + "15": "1", + "16": "1", + "17": "1", + "18": "1", + "19": "1", + "20": "1", + "21": "1", + "22": "1", + "23": "1", + "24": "1", + "25": "1", + "26": "1", + "27": "1", + "28": "1", + "29": "1", + "30": "1", + "31": "1", + "32": "1", + "33": "8", + "34": "1", + "35": "1", + "36": "1", + "37": "1", + "38": "1", + "39": "1", + "40": "1", + "41": "1", + "42": "1", + "43": "1", + "44": "1", + "45": "1", + "46": "5", + "47": "1", + "48": "7", + "49": "1", + "50": "1", + "51": "1", + "52": "1", + "53": "1", + "54": "1", + "55": "1", + "56": "1", + "57": "1", + "58": "1", + "59": "1", + "60": "1", + "61": "1", + "62": "1", + "63": "1" + } + }, + "TC_TO_DSCP_MAP": { + "AZURE_TUNNEL": { + "0": "8", + "1": "0", + "2": "0", + "3": "2", + "4": "6", + "5": "46", + "6": "0", + "7": "48", + "8": "33" + } + }, + "SCHEDULER": { + "scheduler.0": { + "type" : "DWRR", + "weight": "14" + }, + "scheduler.1": { + "type" : "DWRR", + "weight": "15" + } + }, + "PORT_QOS_MAP": { + "global": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]" + }, + "Ethernet0": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet4": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet8": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet12": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet16": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet20": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet24": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE_UPLINK]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE_UPLINK]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet28": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE_UPLINK]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE_UPLINK]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet32": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE_UPLINK]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE_UPLINK]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet36": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE_UPLINK]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE_UPLINK]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet40": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet44": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet48": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet52": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet56": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet60": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet64": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet68": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet72": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet76": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet80": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet84": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet88": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE_UPLINK]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE_UPLINK]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet92": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE_UPLINK]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE_UPLINK]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet96": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE_UPLINK]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE_UPLINK]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet100": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE_UPLINK]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE_UPLINK]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet104": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet108": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet112": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet116": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet120": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet124": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + } + }, + "WRED_PROFILE": { + "AZURE_LOSSLESS" : { + "wred_green_enable" : "true", + "wred_yellow_enable" : "true", + "wred_red_enable" : "true", + "ecn" : "ecn_all", + "green_max_threshold" : "2097152", + "green_min_threshold" : "1048576", + "yellow_max_threshold" : "2097152", + "yellow_min_threshold" : "1048576", + "red_max_threshold" : "2097152", + "red_min_threshold" : "1048576", + "green_drop_probability" : "5", + "yellow_drop_probability": "5", + "red_drop_probability" : "5" + } + }, + "QUEUE": { + "Ethernet0|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet4|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet8|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet12|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet16|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet20|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet24|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet28|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet32|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet36|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet40|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet44|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet48|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet52|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet56|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet60|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet64|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet68|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet72|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet76|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet80|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet84|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet88|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet92|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet96|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet100|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet104|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet108|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet112|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet116|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet120|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet124|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet0|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet4|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet8|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet12|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet16|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet20|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet24|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet28|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet32|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet36|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet40|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet44|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet48|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet52|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet56|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet60|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet64|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet68|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet72|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet76|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet80|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet84|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet88|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet92|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet96|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet100|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet104|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet108|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet112|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet116|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet120|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet124|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet0|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet4|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet8|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet12|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet16|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet20|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet24|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet28|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet32|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet36|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet40|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet44|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet48|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet52|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet56|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet60|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet64|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet68|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet72|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet76|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet80|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet84|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet88|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet92|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet96|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet100|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet104|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet108|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet112|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet116|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet120|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet124|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet0|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet4|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet8|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet12|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet16|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet20|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet24|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet28|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet32|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet36|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet40|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet44|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet48|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet52|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet56|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet60|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet64|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet68|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet72|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet76|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet80|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet84|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet88|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet92|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet96|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet100|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet104|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet108|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet112|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet116|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet120|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet124|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet0|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet4|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet8|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet12|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet16|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet20|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet24|2": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet28|2": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet32|2": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet36|2": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet40|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet44|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet48|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet52|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet56|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet60|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet64|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet68|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet72|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet76|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet80|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet84|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet88|2": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet92|2": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet96|2": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet100|2": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet104|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet108|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet112|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet116|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet120|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet124|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet0|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet0|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet4|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet4|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet8|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet8|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet12|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet12|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet16|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet16|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet20|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet20|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet24|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet24|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet28|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet28|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet32|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet32|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet36|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet36|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet40|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet40|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet44|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet44|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet48|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet48|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet52|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet52|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet56|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet56|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet60|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet60|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet64|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet64|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet68|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet68|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet72|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet72|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet76|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet76|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet80|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet80|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet84|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet84|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet88|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet88|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet92|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet92|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet96|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet96|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet100|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet100|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet104|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet104|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet108|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet108|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet112|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet112|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet116|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet116|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet120|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet120|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet124|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet124|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet0|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet4|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet8|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet12|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet16|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet20|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet24|6": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet28|6": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet32|6": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet36|6": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet40|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet44|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet48|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet52|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet56|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet60|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet64|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet68|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet72|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet76|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet80|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet84|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet88|6": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet92|6": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet96|6": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet100|6": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet104|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet108|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet112|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet116|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet120|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet124|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + } + } +} diff --git a/src/sonic-config-engine/tests/sample_output/py3/qos-arista7260-dualtor-remap-disabled.json b/src/sonic-config-engine/tests/sample_output/py3/qos-arista7260-dualtor-remap-disabled.json new file mode 100644 index 000000000000..90eb9f0d8040 --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py3/qos-arista7260-dualtor-remap-disabled.json @@ -0,0 +1,2124 @@ +{ + "TC_TO_PRIORITY_GROUP_MAP": { + "AZURE": { + "0": "0", + "1": "0", + "2": "0", + "3": "3", + "4": "4", + "5": "0", + "6": "0", + "7": "7" + } + }, + "MAP_PFC_PRIORITY_TO_QUEUE": { + "AZURE": { + "0": "0", + "1": "1", + "2": "2", + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7" + } + }, + "TC_TO_QUEUE_MAP": { + "AZURE": { + "0": "0", + "1": "1", + "2": "2", + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7" + } + }, + "DSCP_TO_TC_MAP": { + "AZURE": { + "0" : "1", + "1" : "1", + "2" : "1", + "3" : "3", + "4" : "4", + "5" : "2", + "6" : "1", + "7" : "1", + "8" : "0", + "9" : "1", + "10": "1", + "11": "1", + "12": "1", + "13": "1", + "14": "1", + "15": "1", + "16": "1", + "17": "1", + "18": "1", + "19": "1", + "20": "1", + "21": "1", + "22": "1", + "23": "1", + "24": "1", + "25": "1", + "26": "1", + "27": "1", + "28": "1", + "29": "1", + "30": "1", + "31": "1", + "32": "1", + "33": "1", + "34": "1", + "35": "1", + "36": "1", + "37": "1", + "38": "1", + "39": "1", + "40": "1", + "41": "1", + "42": "1", + "43": "1", + "44": "1", + "45": "1", + "46": "5", + "47": "1", + "48": "6", + "49": "1", + "50": "1", + "51": "1", + "52": "1", + "53": "1", + "54": "1", + "55": "1", + "56": "1", + "57": "1", + "58": "1", + "59": "1", + "60": "1", + "61": "1", + "62": "1", + "63": "1" + } + }, + "SCHEDULER": { + "scheduler.0": { + "type" : "DWRR", + "weight": "14" + }, + "scheduler.1": { + "type" : "DWRR", + "weight": "15" + } + }, + "PORT_QOS_MAP": { + "global": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]" + }, + "Ethernet0": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet4": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet8": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet12": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet16": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet20": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet24": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet28": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet32": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet36": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet40": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet44": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet48": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet52": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet56": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet60": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet64": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet68": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet72": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet76": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet80": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet84": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet88": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet92": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet96": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet100": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet104": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet108": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet112": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet116": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet120": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet124": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet128": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet132": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet136": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet140": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet144": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet148": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet152": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet156": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet160": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet164": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet168": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet172": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet176": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet180": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet184": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet188": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet192": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet196": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet200": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet204": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet208": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet212": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet216": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet220": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet224": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet228": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet232": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet236": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet240": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet244": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet248": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet252": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + } + }, + "WRED_PROFILE": { + "AZURE_LOSSLESS" : { + "wred_green_enable" : "true", + "wred_yellow_enable" : "true", + "wred_red_enable" : "true", + "ecn" : "ecn_all", + "green_max_threshold" : "10000000", + "green_min_threshold" : "2000000", + "yellow_max_threshold" : "2097152", + "yellow_min_threshold" : "1048576", + "red_max_threshold" : "2097152", + "red_min_threshold" : "1048576", + "green_drop_probability" : "5", + "yellow_drop_probability": "5", + "red_drop_probability" : "5" + } + }, + "QUEUE": { + "Ethernet0|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet4|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet8|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet12|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet16|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet20|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet24|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet28|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet32|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet36|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet40|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet44|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet48|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet52|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet56|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet60|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet64|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet68|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet72|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet76|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet80|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet84|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet88|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet92|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet96|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet100|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet104|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet108|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet112|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet116|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet120|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet124|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet128|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet132|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet136|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet140|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet144|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet148|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet152|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet156|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet160|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet164|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet168|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet172|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet176|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet180|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet184|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet188|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet192|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet196|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet200|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet204|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet208|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet212|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet216|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet220|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet224|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet228|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet232|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet236|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet240|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet244|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet248|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet252|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet0|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet4|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet8|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet12|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet16|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet20|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet24|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet28|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet32|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet36|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet40|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet44|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet48|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet52|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet56|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet60|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet64|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet68|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet72|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet76|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet80|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet84|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet88|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet92|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet96|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet100|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet104|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet108|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet112|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet116|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet120|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet124|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet128|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet132|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet136|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet140|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet144|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet148|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet152|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet156|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet160|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet164|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet168|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet172|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet176|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet180|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet184|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet188|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet192|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet196|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet200|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet204|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet208|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet212|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet216|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet220|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet224|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet228|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet232|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet236|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet240|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet244|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet248|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet252|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet0|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet4|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet8|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet12|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet16|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet20|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet24|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet28|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet32|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet36|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet40|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet44|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet48|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet52|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet56|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet60|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet64|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet68|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet72|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet76|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet80|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet84|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet88|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet92|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet96|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet100|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet104|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet108|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet112|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet116|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet120|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet124|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet128|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet132|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet136|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet140|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet144|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet148|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet152|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet156|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet160|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet164|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet168|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet172|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet176|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet180|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet184|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet188|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet192|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet196|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet200|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet204|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet208|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet212|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet216|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet220|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet224|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet228|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet232|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet236|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet240|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet244|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet248|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet252|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet0|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet4|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet8|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet12|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet16|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet20|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet24|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet28|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet32|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet36|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet40|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet44|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet48|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet52|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet56|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet60|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet64|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet68|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet72|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet76|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet80|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet84|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet88|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet92|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet96|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet100|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet104|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet108|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet112|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet116|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet120|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet124|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet128|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet132|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet136|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet140|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet144|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet148|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet152|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet156|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet160|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet164|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet168|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet172|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet176|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet180|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet184|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet188|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet192|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet196|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet200|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet204|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet208|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet212|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet216|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet220|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet224|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet228|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet232|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet236|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet240|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet244|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet248|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet252|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet0|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet4|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet8|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet12|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet16|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet20|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet24|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet28|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet32|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet36|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet40|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet44|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet48|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet52|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet56|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet60|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet64|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet68|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet72|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet76|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet80|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet84|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet88|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet92|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet96|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet100|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet104|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet108|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet112|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet116|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet120|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet124|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet128|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet132|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet136|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet140|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet144|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet148|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet152|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet156|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet160|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet164|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet168|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet172|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet176|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet180|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet184|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet188|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet192|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet196|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet200|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet204|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet208|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet212|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet216|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet220|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet224|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet228|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet232|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet236|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet240|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet244|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet248|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet252|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet0|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet4|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet8|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet12|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet16|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet20|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet24|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet28|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet32|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet36|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet40|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet44|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet48|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet52|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet56|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet60|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet64|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet68|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet72|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet76|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet80|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet84|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet88|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet92|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet96|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet100|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet104|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet108|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet112|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet116|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet120|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet124|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet128|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet132|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet136|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet140|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet144|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet148|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet152|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet156|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet160|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet164|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet168|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet172|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet176|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet180|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet184|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet188|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet192|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet196|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet200|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet204|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet208|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet212|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet216|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet220|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet224|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet228|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet232|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet236|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet240|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet244|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet248|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet252|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet0|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet4|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet8|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet12|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet16|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet20|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet24|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet28|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet32|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet36|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet40|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet44|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet48|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet52|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet56|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet60|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet64|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet68|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet72|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet76|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet80|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet84|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet88|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet92|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet96|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet100|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet104|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet108|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet112|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet116|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet120|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet124|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet128|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet132|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet136|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet140|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet144|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet148|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet152|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet156|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet160|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet164|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet168|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet172|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet176|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet180|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet184|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet188|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet192|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet196|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet200|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet204|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet208|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet212|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet216|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet220|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet224|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet228|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet232|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet236|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet240|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet244|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet248|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet252|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + } + } +} diff --git a/src/sonic-config-engine/tests/sample_output/py3/qos-arista7260-dualtor.json b/src/sonic-config-engine/tests/sample_output/py3/qos-arista7260-dualtor.json new file mode 100644 index 000000000000..2e3a5ff4bd37 --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py3/qos-arista7260-dualtor.json @@ -0,0 +1,2512 @@ +{ + "TC_TO_PRIORITY_GROUP_MAP": { + "AZURE": { + "0": "0", + "1": "0", + "2": "2", + "3": "3", + "4": "4", + "5": "0", + "6": "6", + "7": "0", + "8": "0" + }, + "AZURE_TUNNEL": { + "0": "0", + "1": "0", + "2": "0", + "3": "2", + "4": "6", + "5": "0", + "6": "0", + "7": "0", + "8": "0" + } + }, + "MAP_PFC_PRIORITY_TO_QUEUE": { + "AZURE": { + "0": "0", + "1": "1", + "2": "2", + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7" + } + }, + "TC_TO_QUEUE_MAP": { + "AZURE": { + "0": "0", + "1": "1", + "2": "1", + "3": "3", + "4": "4", + "5": "5", + "6": "1", + "7": "7", + "8": "1" + }, + "AZURE_UPLINK": { + "0": "0", + "1": "1", + "2": "2", + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7", + "8": "1" + }, + "AZURE_TUNNEL": { + "0": "0", + "1": "1", + "2": "1", + "3": "2", + "4": "6", + "5": "5", + "6": "1", + "7": "7", + "8": "1" + } + }, + "DSCP_TO_TC_MAP": { + "AZURE": { + "0" : "1", + "1" : "1", + "2" : "1", + "3" : "3", + "4" : "4", + "5" : "1", + "6" : "1", + "7" : "1", + "8" : "0", + "9" : "1", + "10": "1", + "11": "1", + "12": "1", + "13": "1", + "14": "1", + "15": "1", + "16": "1", + "17": "1", + "18": "1", + "19": "1", + "20": "1", + "21": "1", + "22": "1", + "23": "1", + "24": "1", + "25": "1", + "26": "1", + "27": "1", + "28": "1", + "29": "1", + "30": "1", + "31": "1", + "32": "1", + "33": "8", + "34": "1", + "35": "1", + "36": "1", + "37": "1", + "38": "1", + "39": "1", + "40": "1", + "41": "1", + "42": "1", + "43": "1", + "44": "1", + "45": "1", + "46": "5", + "47": "1", + "48": "7", + "49": "1", + "50": "1", + "51": "1", + "52": "1", + "53": "1", + "54": "1", + "55": "1", + "56": "1", + "57": "1", + "58": "1", + "59": "1", + "60": "1", + "61": "1", + "62": "1", + "63": "1" + }, + "AZURE_UPLINK": { + "0" : "1", + "1" : "1", + "2" : "2", + "3" : "3", + "4" : "4", + "5" : "1", + "6" : "6", + "7" : "1", + "8" : "0", + "9" : "1", + "10": "1", + "11": "1", + "12": "1", + "13": "1", + "14": "1", + "15": "1", + "16": "1", + "17": "1", + "18": "1", + "19": "1", + "20": "1", + "21": "1", + "22": "1", + "23": "1", + "24": "1", + "25": "1", + "26": "1", + "27": "1", + "28": "1", + "29": "1", + "30": "1", + "31": "1", + "32": "1", + "33": "8", + "34": "1", + "35": "1", + "36": "1", + "37": "1", + "38": "1", + "39": "1", + "40": "1", + "41": "1", + "42": "1", + "43": "1", + "44": "1", + "45": "1", + "46": "5", + "47": "1", + "48": "7", + "49": "1", + "50": "1", + "51": "1", + "52": "1", + "53": "1", + "54": "1", + "55": "1", + "56": "1", + "57": "1", + "58": "1", + "59": "1", + "60": "1", + "61": "1", + "62": "1", + "63": "1" + }, + "AZURE_TUNNEL": { + "0" : "1", + "1" : "1", + "2" : "1", + "3" : "3", + "4" : "4", + "5" : "1", + "6" : "1", + "7" : "1", + "8" : "0", + "9" : "1", + "10": "1", + "11": "1", + "12": "1", + "13": "1", + "14": "1", + "15": "1", + "16": "1", + "17": "1", + "18": "1", + "19": "1", + "20": "1", + "21": "1", + "22": "1", + "23": "1", + "24": "1", + "25": "1", + "26": "1", + "27": "1", + "28": "1", + "29": "1", + "30": "1", + "31": "1", + "32": "1", + "33": "8", + "34": "1", + "35": "1", + "36": "1", + "37": "1", + "38": "1", + "39": "1", + "40": "1", + "41": "1", + "42": "1", + "43": "1", + "44": "1", + "45": "1", + "46": "5", + "47": "1", + "48": "7", + "49": "1", + "50": "1", + "51": "1", + "52": "1", + "53": "1", + "54": "1", + "55": "1", + "56": "1", + "57": "1", + "58": "1", + "59": "1", + "60": "1", + "61": "1", + "62": "1", + "63": "1" + } + }, + "TC_TO_DSCP_MAP": { + "AZURE_TUNNEL": { + "0": "8", + "1": "0", + "2": "0", + "3": "2", + "4": "6", + "5": "46", + "6": "0", + "7": "48", + "8": "33" + } + }, + "SCHEDULER": { + "scheduler.0": { + "type" : "DWRR", + "weight": "14" + }, + "scheduler.1": { + "type" : "DWRR", + "weight": "15" + } + }, + "PORT_QOS_MAP": { + "global": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]" + }, + "Ethernet0": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet4": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet8": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet12": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet16": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet20": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet24": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet28": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet32": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet36": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet40": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet44": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet48": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE_UPLINK]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE_UPLINK]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet52": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE_UPLINK]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE_UPLINK]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet56": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE_UPLINK]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE_UPLINK]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet60": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE_UPLINK]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE_UPLINK]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet64": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE_UPLINK]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE_UPLINK]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet68": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE_UPLINK]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE_UPLINK]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet72": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE_UPLINK]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE_UPLINK]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet76": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE_UPLINK]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE_UPLINK]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet80": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet84": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet88": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet92": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet96": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet100": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet104": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet108": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet112": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet116": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet120": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet124": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet128": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet132": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet136": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet140": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet144": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet148": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet152": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet156": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet160": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet164": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet168": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet172": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet176": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet180": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet184": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet188": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet192": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet196": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet200": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet204": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet208": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet212": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet216": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet220": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet224": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet228": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet232": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet236": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet240": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet244": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet248": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet252": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + } + }, + "WRED_PROFILE": { + "AZURE_LOSSLESS" : { + "wred_green_enable" : "true", + "wred_yellow_enable" : "true", + "wred_red_enable" : "true", + "ecn" : "ecn_all", + "green_max_threshold" : "10000000", + "green_min_threshold" : "2000000", + "yellow_max_threshold" : "2097152", + "yellow_min_threshold" : "1048576", + "red_max_threshold" : "2097152", + "red_min_threshold" : "1048576", + "green_drop_probability" : "5", + "yellow_drop_probability": "5", + "red_drop_probability" : "5" + } + }, + "QUEUE": { + "Ethernet0|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet4|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet8|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet12|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet16|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet20|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet24|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet28|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet32|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet36|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet40|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet44|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet48|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet52|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet56|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet60|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet64|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet68|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet72|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet76|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet80|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet84|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet88|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet92|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet96|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet100|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet104|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet108|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet112|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet116|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet120|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet124|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet128|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet132|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet136|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet140|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet144|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet148|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet152|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet156|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet160|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet164|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet168|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet172|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet176|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet180|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet184|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet188|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet192|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet196|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet200|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet204|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet208|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet212|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet216|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet220|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet224|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet228|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet232|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet236|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet240|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet244|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet248|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet252|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet0|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet4|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet8|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet12|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet16|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet20|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet24|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet28|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet32|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet36|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet40|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet44|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet48|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet52|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet56|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet60|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet64|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet68|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet72|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet76|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet80|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet84|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet88|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet92|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet96|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet100|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet104|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet108|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet112|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet116|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet120|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet124|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet128|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet132|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet136|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet140|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet144|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet148|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet152|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet156|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet160|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet164|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet168|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet172|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet176|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet180|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet184|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet188|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet192|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet196|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet200|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet204|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet208|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet212|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet216|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet220|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet224|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet228|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet232|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet236|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet240|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet244|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet248|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet252|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet0|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet4|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet8|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet12|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet16|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet20|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet24|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet28|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet32|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet36|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet40|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet44|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet48|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet52|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet56|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet60|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet64|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet68|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet72|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet76|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet80|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet84|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet88|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet92|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet96|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet100|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet104|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet108|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet112|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet116|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet120|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet124|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet128|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet132|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet136|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet140|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet144|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet148|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet152|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet156|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet160|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet164|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet168|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet172|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet176|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet180|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet184|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet188|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet192|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet196|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet200|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet204|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet208|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet212|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet216|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet220|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet224|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet228|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet232|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet236|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet240|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet244|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet248|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet252|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet0|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet4|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet8|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet12|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet16|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet20|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet24|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet28|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet32|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet36|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet40|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet44|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet48|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet52|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet56|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet60|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet64|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet68|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet72|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet76|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet80|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet84|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet88|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet92|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet96|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet100|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet104|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet108|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet112|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet116|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet120|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet124|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet128|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet132|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet136|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet140|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet144|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet148|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet152|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet156|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet160|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet164|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet168|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet172|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet176|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet180|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet184|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet188|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet192|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet196|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet200|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet204|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet208|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet212|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet216|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet220|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet224|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet228|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet232|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet236|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet240|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet244|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet248|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet252|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet0|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet4|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet8|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet12|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet16|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet20|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet24|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet28|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet32|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet36|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet40|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet44|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet48|2": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet52|2": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet56|2": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet60|2": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet64|2": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet68|2": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet72|2": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet76|2": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet80|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet84|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet88|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet92|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet96|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet100|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet104|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet108|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet112|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet116|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet120|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet124|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet128|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet132|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet136|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet140|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet144|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet148|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet152|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet156|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet160|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet164|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet168|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet172|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet176|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet180|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet184|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet188|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet192|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet196|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet200|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet204|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet208|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet212|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet216|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet220|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet224|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet228|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet232|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet236|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet240|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet244|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet248|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet252|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet0|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet0|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet4|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet4|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet8|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet8|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet12|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet12|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet16|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet16|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet20|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet20|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet24|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet24|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet28|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet28|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet32|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet32|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet36|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet36|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet40|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet40|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet44|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet44|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet48|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet48|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet52|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet52|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet56|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet56|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet60|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet60|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet64|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet64|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet68|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet68|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet72|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet72|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet76|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet76|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet80|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet80|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet84|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet84|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet88|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet88|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet92|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet92|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet96|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet96|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet100|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet100|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet104|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet104|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet108|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet108|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet112|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet112|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet116|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet116|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet120|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet120|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet124|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet124|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet128|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet128|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet132|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet132|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet136|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet136|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet140|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet140|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet144|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet144|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet148|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet148|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet152|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet152|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet156|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet156|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet160|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet160|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet164|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet164|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet168|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet168|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet172|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet172|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet176|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet176|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet180|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet180|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet184|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet184|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet188|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet188|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet192|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet192|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet196|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet196|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet200|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet200|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet204|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet204|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet208|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet208|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet212|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet212|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet216|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet216|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet220|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet220|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet224|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet224|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet228|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet228|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet232|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet232|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet236|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet236|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet240|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet240|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet244|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet244|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet248|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet248|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet252|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet252|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet0|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet4|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet8|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet12|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet16|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet20|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet24|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet28|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet32|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet36|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet40|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet44|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet48|6": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet52|6": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet56|6": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet60|6": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet64|6": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet68|6": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet72|6": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet76|6": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet80|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet84|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet88|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet92|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet96|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet100|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet104|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet108|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet112|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet116|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet120|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet124|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet128|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet132|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet136|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet140|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet144|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet148|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet152|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet156|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet160|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet164|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet168|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet172|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet176|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet180|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet184|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet188|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet192|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet196|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet200|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet204|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet208|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet212|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet216|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet220|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet224|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet228|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet232|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet236|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet240|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet244|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet248|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet252|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + } + } +} diff --git a/src/sonic-config-engine/tests/sample_output/py3/qos-arista7260-t1-remap-disabled.json b/src/sonic-config-engine/tests/sample_output/py3/qos-arista7260-t1-remap-disabled.json new file mode 100644 index 000000000000..1cba23d85ffe --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py3/qos-arista7260-t1-remap-disabled.json @@ -0,0 +1,1008 @@ +{ + "TC_TO_PRIORITY_GROUP_MAP": { + "AZURE": { + "0": "0", + "1": "0", + "2": "0", + "3": "3", + "4": "4", + "5": "0", + "6": "0", + "7": "7" + } + }, + "MAP_PFC_PRIORITY_TO_QUEUE": { + "AZURE": { + "0": "0", + "1": "1", + "2": "2", + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7" + } + }, + "TC_TO_QUEUE_MAP": { + "AZURE": { + "0": "0", + "1": "1", + "2": "2", + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7" + } + }, + "DSCP_TO_TC_MAP": { + "AZURE": { + "0" : "1", + "1" : "1", + "2" : "1", + "3" : "3", + "4" : "4", + "5" : "2", + "6" : "1", + "7" : "1", + "8" : "0", + "9" : "1", + "10": "1", + "11": "1", + "12": "1", + "13": "1", + "14": "1", + "15": "1", + "16": "1", + "17": "1", + "18": "1", + "19": "1", + "20": "1", + "21": "1", + "22": "1", + "23": "1", + "24": "1", + "25": "1", + "26": "1", + "27": "1", + "28": "1", + "29": "1", + "30": "1", + "31": "1", + "32": "1", + "33": "1", + "34": "1", + "35": "1", + "36": "1", + "37": "1", + "38": "1", + "39": "1", + "40": "1", + "41": "1", + "42": "1", + "43": "1", + "44": "1", + "45": "1", + "46": "5", + "47": "1", + "48": "6", + "49": "1", + "50": "1", + "51": "1", + "52": "1", + "53": "1", + "54": "1", + "55": "1", + "56": "1", + "57": "1", + "58": "1", + "59": "1", + "60": "1", + "61": "1", + "62": "1", + "63": "1" + } + }, + "SCHEDULER": { + "scheduler.0": { + "type" : "DWRR", + "weight": "14" + }, + "scheduler.1": { + "type" : "DWRR", + "weight": "15" + } + }, + "PORT_QOS_MAP": { + "global": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]" + }, + "Ethernet0": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet4": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet16": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet20": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet64": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet68": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet80": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet84": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet136": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet144": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet148": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet152": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet156": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet168": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet176": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet180": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet184": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet188": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet200": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet208": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet212": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet216": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet220": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet232": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet240": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet244": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet248": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet252": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + } + }, + "WRED_PROFILE": { + "AZURE_LOSSLESS" : { + "wred_green_enable" : "true", + "wred_yellow_enable" : "true", + "wred_red_enable" : "true", + "ecn" : "ecn_all", + "green_max_threshold" : "10000000", + "green_min_threshold" : "2000000", + "yellow_max_threshold" : "2097152", + "yellow_min_threshold" : "1048576", + "red_max_threshold" : "2097152", + "red_min_threshold" : "1048576", + "green_drop_probability" : "5", + "yellow_drop_probability": "5", + "red_drop_probability" : "5" + } + }, + "QUEUE": { + "Ethernet0|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet4|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet16|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet20|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet64|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet68|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet80|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet84|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet136|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet144|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet148|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet152|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet156|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet168|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet176|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet180|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet184|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet188|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet200|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet208|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet212|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet216|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet220|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet232|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet240|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet244|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet248|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet252|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet0|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet4|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet16|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet20|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet64|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet68|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet80|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet84|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet136|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet144|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet148|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet152|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet156|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet168|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet176|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet180|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet184|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet188|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet200|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet208|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet212|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet216|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet220|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet232|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet240|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet244|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet248|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet252|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet0|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet4|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet16|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet20|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet64|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet68|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet80|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet84|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet136|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet144|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet148|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet152|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet156|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet168|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet176|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet180|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet184|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet188|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet200|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet208|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet212|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet216|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet220|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet232|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet240|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet244|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet248|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet252|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet0|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet4|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet16|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet20|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet64|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet68|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet80|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet84|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet136|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet144|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet148|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet152|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet156|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet168|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet176|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet180|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet184|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet188|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet200|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet208|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet212|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet216|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet220|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet232|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet240|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet244|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet248|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet252|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet0|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet4|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet16|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet20|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet64|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet68|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet80|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet84|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet136|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet144|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet148|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet152|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet156|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet168|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet176|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet180|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet184|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet188|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet200|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet208|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet212|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet216|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet220|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet232|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet240|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet244|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet248|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet252|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet0|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet4|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet16|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet20|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet64|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet68|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet80|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet84|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet136|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet144|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet148|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet152|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet156|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet168|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet176|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet180|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet184|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet188|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet200|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet208|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet212|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet216|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet220|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet232|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet240|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet244|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet248|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet252|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet0|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet4|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet16|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet20|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet64|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet68|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet80|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet84|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet136|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet144|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet148|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet152|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet156|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet168|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet176|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet180|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet184|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet188|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet200|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet208|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet212|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet216|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet220|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet232|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet240|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet244|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet248|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet252|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + } + } +} diff --git a/src/sonic-config-engine/tests/sample_output/py3/qos-arista7260-t1.json b/src/sonic-config-engine/tests/sample_output/py3/qos-arista7260-t1.json new file mode 100644 index 000000000000..0d21f426cc47 --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py3/qos-arista7260-t1.json @@ -0,0 +1,1198 @@ +{ + "MAP_PFC_PRIORITY_TO_QUEUE": { + "AZURE": { + "0": "0", + "1": "1", + "2": "2", + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7" + } + }, + "TC_TO_QUEUE_MAP": { + "AZURE": { + "0": "0", + "1": "1", + "2": "2", + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7" + } + }, + "DSCP_TO_TC_MAP": { + "AZURE": { + "0" : "1", + "1" : "1", + "2" : "2", + "3" : "3", + "4" : "4", + "5" : "1", + "6" : "6", + "7" : "1", + "8" : "0", + "9" : "1", + "10": "1", + "11": "1", + "12": "1", + "13": "1", + "14": "1", + "15": "1", + "16": "1", + "17": "1", + "18": "1", + "19": "1", + "20": "1", + "21": "1", + "22": "1", + "23": "1", + "24": "1", + "25": "1", + "26": "1", + "27": "1", + "28": "1", + "29": "1", + "30": "1", + "31": "1", + "32": "1", + "33": "1", + "34": "1", + "35": "1", + "36": "1", + "37": "1", + "38": "1", + "39": "1", + "40": "1", + "41": "1", + "42": "1", + "43": "1", + "44": "1", + "45": "1", + "46": "5", + "47": "1", + "48": "7", + "49": "1", + "50": "1", + "51": "1", + "52": "1", + "53": "1", + "54": "1", + "55": "1", + "56": "1", + "57": "1", + "58": "1", + "59": "1", + "60": "1", + "61": "1", + "62": "1", + "63": "1" + }, + "AZURE_UPLINK": { + "0" : "1", + "1" : "1", + "2" : "1", + "3" : "3", + "4" : "4", + "5" : "1", + "6" : "1", + "7" : "1", + "8" : "0", + "9" : "1", + "10": "1", + "11": "1", + "12": "1", + "13": "1", + "14": "1", + "15": "1", + "16": "1", + "17": "1", + "18": "1", + "19": "1", + "20": "1", + "21": "1", + "22": "1", + "23": "1", + "24": "1", + "25": "1", + "26": "1", + "27": "1", + "28": "1", + "29": "1", + "30": "1", + "31": "1", + "32": "1", + "33": "1", + "34": "1", + "35": "1", + "36": "1", + "37": "1", + "38": "1", + "39": "1", + "40": "1", + "41": "1", + "42": "1", + "43": "1", + "44": "1", + "45": "1", + "46": "5", + "47": "1", + "48": "7", + "49": "1", + "50": "1", + "51": "1", + "52": "1", + "53": "1", + "54": "1", + "55": "1", + "56": "1", + "57": "1", + "58": "1", + "59": "1", + "60": "1", + "61": "1", + "62": "1", + "63": "1" + } + }, + "TC_TO_PRIORITY_GROUP_MAP": { + "AZURE": { + "0": "0", + "1": "0", + "2": "2", + "3": "3", + "4": "4", + "5": "0", + "6": "6", + "7": "0" + } + }, + "SCHEDULER": { + "scheduler.0": { + "type" : "DWRR", + "weight": "14" + }, + "scheduler.1": { + "type" : "DWRR", + "weight": "15" + } + }, + "PORT_QOS_MAP": { + "global": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]" + }, + "Ethernet0": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE_UPLINK]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet4": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE_UPLINK]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet16": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE_UPLINK]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet20": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE_UPLINK]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet64": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE_UPLINK]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet68": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE_UPLINK]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet80": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE_UPLINK]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet84": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE_UPLINK]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet136": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet144": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet148": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet152": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet156": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet168": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet176": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet180": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet184": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet188": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet200": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet208": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet212": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet216": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet220": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet232": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet240": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet244": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet248": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet252": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + } + }, + "WRED_PROFILE": { + "AZURE_LOSSLESS" : { + "wred_green_enable" : "true", + "wred_yellow_enable" : "true", + "wred_red_enable" : "true", + "ecn" : "ecn_all", + "green_max_threshold" : "10000000", + "green_min_threshold" : "2000000", + "yellow_max_threshold" : "2097152", + "yellow_min_threshold" : "1048576", + "red_max_threshold" : "2097152", + "red_min_threshold" : "1048576", + "green_drop_probability" : "5", + "yellow_drop_probability": "5", + "red_drop_probability" : "5" + } + }, + "QUEUE": { + "Ethernet0|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet4|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet16|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet20|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet64|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet68|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet80|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet84|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet136|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet144|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet148|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet152|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet156|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet168|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet176|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet180|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet184|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet188|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet200|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet208|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet212|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet216|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet220|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet232|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet240|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet244|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet248|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet252|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet0|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet4|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet16|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet20|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet64|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet68|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet80|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet84|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet136|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet144|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet148|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet152|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet156|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet168|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet176|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet180|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet184|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet188|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet200|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet208|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet212|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet216|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet220|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet232|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet240|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet244|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet248|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet252|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet0|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet4|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet16|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet20|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet64|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet68|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet80|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet84|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet136|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet144|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet148|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet152|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet156|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet168|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet176|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet180|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet184|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet188|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet200|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet208|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet212|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet216|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet220|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet232|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet240|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet244|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet248|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet252|0": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet0|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet4|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet16|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet20|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet64|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet68|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet80|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet84|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet136|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet144|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet148|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet152|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet156|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet168|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet176|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet180|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet184|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet188|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet200|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet208|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet212|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet216|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet220|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet232|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet240|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet244|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet248|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet252|1": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet0|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet4|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet16|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet20|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet64|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet68|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet80|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet84|2": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet136|2": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet144|2": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet148|2": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet152|2": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet156|2": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet168|2": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet176|2": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet180|2": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet184|2": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet188|2": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet200|2": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet208|2": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet212|2": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet216|2": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet220|2": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet232|2": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet240|2": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet244|2": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet248|2": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet252|2": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet0|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet0|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet4|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet4|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet16|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet16|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet20|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet20|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet64|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet64|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet68|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet68|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet80|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet80|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet84|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet84|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet136|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet136|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet144|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet144|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet148|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet148|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet152|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet152|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet156|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet156|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet168|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet168|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet176|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet176|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet180|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet180|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet184|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet184|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet188|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet188|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet200|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet200|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet208|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet208|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet212|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet212|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet216|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet216|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet220|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet220|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet232|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet232|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet240|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet240|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet244|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet244|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet248|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet248|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet252|5": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet252|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet0|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet4|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet16|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet20|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet64|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet68|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet80|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet84|6": { + "scheduler" : "[SCHEDULER|scheduler.0]" + }, + "Ethernet136|6": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet144|6": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet148|6": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet152|6": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet156|6": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet168|6": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet176|6": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet180|6": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet184|6": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet188|6": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet200|6": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet208|6": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet212|6": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet216|6": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet220|6": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet232|6": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet240|6": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet244|6": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet248|6": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet252|6": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + } + } +} diff --git a/src/sonic-config-engine/tests/sample_output/py3/qos-arista7260.json b/src/sonic-config-engine/tests/sample_output/py3/qos-arista7260.json new file mode 120000 index 000000000000..bb3adcf3a9a9 --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py3/qos-arista7260.json @@ -0,0 +1 @@ +qos-arista7260-t1-remap-disabled.json \ No newline at end of file diff --git a/src/sonic-config-engine/tests/sample_output/py3/qos-arista7800r3-48cq2-lc.json b/src/sonic-config-engine/tests/sample_output/py3/qos-arista7800r3-48cq2-lc.json new file mode 100644 index 000000000000..898ad3345335 --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py3/qos-arista7800r3-48cq2-lc.json @@ -0,0 +1,1535 @@ +{ + "TC_TO_PRIORITY_GROUP_MAP": { + "AZURE": { + "0": "0", + "1": "0", + "2": "0", + "3": "3", + "4": "4", + "5": "0", + "6": "0", + "7": "7" + } + }, + "MAP_PFC_PRIORITY_TO_QUEUE": { + "AZURE": { + "0": "0", + "1": "1", + "2": "2", + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7" + } + }, + "TC_TO_QUEUE_MAP": { + "AZURE": { + "0": "0", + "1": "1", + "2": "2", + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7" + } + }, + "DSCP_TO_TC_MAP": { + "AZURE": { + "0" : "1", + "1" : "1", + "2" : "1", + "3" : "3", + "4" : "4", + "5" : "2", + "6" : "1", + "7" : "1", + "8" : "0", + "9" : "1", + "10": "1", + "11": "1", + "12": "1", + "13": "1", + "14": "1", + "15": "1", + "16": "1", + "17": "1", + "18": "1", + "19": "1", + "20": "1", + "21": "1", + "22": "1", + "23": "1", + "24": "1", + "25": "1", + "26": "1", + "27": "1", + "28": "1", + "29": "1", + "30": "1", + "31": "1", + "32": "1", + "33": "1", + "34": "1", + "35": "1", + "36": "1", + "37": "1", + "38": "1", + "39": "1", + "40": "1", + "41": "1", + "42": "1", + "43": "1", + "44": "1", + "45": "1", + "46": "5", + "47": "1", + "48": "6", + "49": "1", + "50": "1", + "51": "1", + "52": "1", + "53": "1", + "54": "1", + "55": "1", + "56": "1", + "57": "1", + "58": "1", + "59": "1", + "60": "1", + "61": "1", + "62": "1", + "63": "1" + } + }, + "SCHEDULER": { + "scheduler.0": { + "type" : "DWRR", + "weight": "14" + }, + "scheduler.1": { + "type" : "DWRR", + "weight": "15" + } + }, + "PORT_QOS_MAP": { + "global": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]" + }, + "Ethernet0": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet4": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet8": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet12": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet16": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet20": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet24": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet28": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet32": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet36": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet40": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet44": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet48": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet52": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet56": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet60": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet64": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet68": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet72": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet76": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet80": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet84": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet88": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet92": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet96": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet100": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet104": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet108": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet112": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet116": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet120": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet124": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet128": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet132": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet136": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet140": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet144": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet148": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet152": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet156": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet164": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet176": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet180": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet184": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet188": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + } + }, + "WRED_PROFILE": { + "AZURE_LOSSLESS" : { + "wred_green_enable" : "true", + "wred_yellow_enable" : "true", + "wred_red_enable" : "true", + "ecn" : "ecn_all", + "green_max_threshold" : "2097152", + "green_min_threshold" : "250000", + "yellow_max_threshold" : "2097152", + "yellow_min_threshold" : "1048576", + "red_max_threshold" : "2097152", + "red_min_threshold" : "1048576", + "green_drop_probability" : "5", + "yellow_drop_probability": "5", + "red_drop_probability" : "5" + } + }, + "QUEUE": { + "Ethernet0|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet4|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet8|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet12|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet16|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet20|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet24|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet28|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet32|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet36|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet40|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet44|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet48|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet52|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet56|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet60|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet64|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet68|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet72|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet76|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet80|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet84|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet88|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet92|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet96|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet100|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet104|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet108|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet112|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet116|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet120|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet124|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet128|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet132|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet136|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet140|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet144|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet148|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet152|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet156|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet164|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet176|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet180|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet184|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet188|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet0|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet4|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet8|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet12|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet16|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet20|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet24|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet28|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet32|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet36|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet40|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet44|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet48|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet52|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet56|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet60|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet64|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet68|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet72|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet76|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet80|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet84|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet88|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet92|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet96|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet100|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet104|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet108|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet112|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet116|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet120|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet124|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet128|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet132|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet136|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet140|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet144|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet148|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet152|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet156|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet164|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet176|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet180|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet184|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet188|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet0|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet4|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet8|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet12|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet16|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet20|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet24|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet28|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet32|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet36|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet40|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet44|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet48|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet52|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet56|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet60|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet64|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet68|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet72|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet76|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet80|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet84|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet88|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet92|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet96|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet100|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet104|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet108|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet112|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet116|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet120|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet124|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet128|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet132|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet136|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet140|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet144|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet148|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet152|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet156|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet164|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet176|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet180|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet184|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet188|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet0|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet4|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet8|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet12|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet16|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet20|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet24|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet28|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet32|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet36|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet40|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet44|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet48|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet52|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet56|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet60|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet64|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet68|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet72|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet76|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet80|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet84|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet88|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet92|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet96|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet100|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet104|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet108|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet112|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet116|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet120|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet124|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet128|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet132|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet136|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet140|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet144|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet148|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet152|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet156|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet164|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet176|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet180|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet184|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet188|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet0|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet4|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet8|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet12|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet16|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet20|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet24|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet28|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet32|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet36|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet40|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet44|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet48|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet52|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet56|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet60|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet64|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet68|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet72|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet76|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet80|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet84|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet88|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet92|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet96|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet100|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet104|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet108|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet112|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet116|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet120|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet124|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet128|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet132|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet136|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet140|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet144|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet148|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet152|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet156|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet164|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet176|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet180|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet184|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet188|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet0|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet4|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet8|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet12|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet16|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet20|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet24|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet28|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet32|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet36|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet40|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet44|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet48|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet52|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet56|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet60|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet64|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet68|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet72|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet76|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet80|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet84|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet88|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet92|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet96|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet100|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet104|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet108|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet112|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet116|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet120|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet124|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet128|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet132|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet136|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet140|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet144|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet148|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet152|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet156|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet164|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet176|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet180|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet184|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet188|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet0|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet4|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet8|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet12|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet16|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet20|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet24|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet28|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet32|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet36|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet40|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet44|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet48|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet52|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet56|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet60|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet64|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet68|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet72|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet76|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet80|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet84|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet88|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet92|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet96|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet100|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet104|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet108|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet112|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet116|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet120|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet124|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet128|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet132|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet136|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet140|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet144|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet148|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet152|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet156|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet164|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet176|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet180|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet184|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet188|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + } + } +} diff --git a/src/sonic-config-engine/tests/sample_output/py3/qos-dell6100.json b/src/sonic-config-engine/tests/sample_output/py3/qos-dell6100.json index 75d9b3a87eee..c059b4bdb735 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/qos-dell6100.json +++ b/src/sonic-config-engine/tests/sample_output/py3/qos-dell6100.json @@ -114,313 +114,360 @@ } }, "PORT_QOS_MAP": { + "global": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]" + }, "Ethernet0": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet1": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet4": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet5": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet6": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet7": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet8": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet9": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet10": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet11": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet12": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet13": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet14": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet15": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet16": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet17": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet20": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet21": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet22": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet23": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet24": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet25": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet26": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet27": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet28": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet29": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet30": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet31": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet32": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet36": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet37": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet38": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet39": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet40": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet41": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet42": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet48": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet52": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet53": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet54": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet55": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet56": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet57": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" }, "Ethernet58": { "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", - "pfc_enable" : "3,4" + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" } }, "WRED_PROFILE": { diff --git a/src/sonic-config-engine/tests/sample_output/py3/qos-dell9332.json b/src/sonic-config-engine/tests/sample_output/py3/qos-dell9332.json new file mode 100644 index 000000000000..ed692ba42558 --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py3/qos-dell9332.json @@ -0,0 +1,1136 @@ +{ + "TC_TO_PRIORITY_GROUP_MAP": { + "AZURE": { + "0": "0", + "1": "0", + "2": "0", + "3": "3", + "4": "4", + "5": "0", + "6": "0", + "7": "7" + } + }, + "MAP_PFC_PRIORITY_TO_QUEUE": { + "AZURE": { + "0": "0", + "1": "1", + "2": "2", + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7" + } + }, + "TC_TO_QUEUE_MAP": { + "AZURE": { + "0": "0", + "1": "1", + "2": "2", + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7" + } + }, + "DSCP_TO_TC_MAP": { + "AZURE": { + "0" : "1", + "1" : "1", + "2" : "1", + "3" : "3", + "4" : "4", + "5" : "2", + "6" : "1", + "7" : "1", + "8" : "0", + "9" : "1", + "10": "1", + "11": "1", + "12": "1", + "13": "1", + "14": "1", + "15": "1", + "16": "1", + "17": "1", + "18": "1", + "19": "1", + "20": "1", + "21": "1", + "22": "1", + "23": "1", + "24": "1", + "25": "1", + "26": "1", + "27": "1", + "28": "1", + "29": "1", + "30": "1", + "31": "1", + "32": "1", + "33": "1", + "34": "1", + "35": "1", + "36": "1", + "37": "1", + "38": "1", + "39": "1", + "40": "1", + "41": "1", + "42": "1", + "43": "1", + "44": "1", + "45": "1", + "46": "5", + "47": "1", + "48": "6", + "49": "1", + "50": "1", + "51": "1", + "52": "1", + "53": "1", + "54": "1", + "55": "1", + "56": "1", + "57": "1", + "58": "1", + "59": "1", + "60": "1", + "61": "1", + "62": "1", + "63": "1" + } + }, + "SCHEDULER": { + "scheduler.0": { + "type" : "DWRR", + "weight": "1" + }, + "scheduler.1": { + "type" : "DWRR", + "weight": "1" + }, + "scheduler.2": { + "type" : "DWRR", + "weight": "100" + } + }, + "PORT_QOS_MAP": { + "global": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]" + }, + "Ethernet0": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet8": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet16": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet24": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet32": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet40": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet48": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet56": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet64": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet72": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet80": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet88": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet96": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet104": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet112": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet120": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet128": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet136": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet144": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet152": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet160": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet168": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet176": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet184": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet192": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet200": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet208": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet216": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet224": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet232": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet240": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet248": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + } + }, + "WRED_PROFILE": { + "AZURE_LOSSLESS" : { + "wred_green_enable" : "true", + "wred_yellow_enable" : "true", + "wred_red_enable" : "true", + "ecn" : "ecn_all", + "green_max_threshold" : "2097152", + "green_min_threshold" : "1048576", + "yellow_max_threshold" : "2097152", + "yellow_min_threshold" : "1048576", + "red_max_threshold" : "2097152", + "red_min_threshold" : "1048576", + "green_drop_probability" : "5", + "yellow_drop_probability": "5", + "red_drop_probability" : "5" + } + }, + "QUEUE": { + "Ethernet0|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet8|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet16|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet24|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet32|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet40|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet48|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet56|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet64|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet72|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet80|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet88|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet96|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet104|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet112|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet120|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet128|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet136|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet144|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet152|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet160|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet168|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet176|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet184|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet192|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet200|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet208|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet216|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet224|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet232|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet240|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet248|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet0|4": { + "scheduler" : "[SCHEDULER|scheduler.2]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet8|4": { + "scheduler" : "[SCHEDULER|scheduler.2]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet16|4": { + "scheduler" : "[SCHEDULER|scheduler.2]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet24|4": { + "scheduler" : "[SCHEDULER|scheduler.2]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet32|4": { + "scheduler" : "[SCHEDULER|scheduler.2]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet40|4": { + "scheduler" : "[SCHEDULER|scheduler.2]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet48|4": { + "scheduler" : "[SCHEDULER|scheduler.2]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet56|4": { + "scheduler" : "[SCHEDULER|scheduler.2]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet64|4": { + "scheduler" : "[SCHEDULER|scheduler.2]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet72|4": { + "scheduler" : "[SCHEDULER|scheduler.2]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet80|4": { + "scheduler" : "[SCHEDULER|scheduler.2]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet88|4": { + "scheduler" : "[SCHEDULER|scheduler.2]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet96|4": { + "scheduler" : "[SCHEDULER|scheduler.2]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet104|4": { + "scheduler" : "[SCHEDULER|scheduler.2]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet112|4": { + "scheduler" : "[SCHEDULER|scheduler.2]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet120|4": { + "scheduler" : "[SCHEDULER|scheduler.2]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet128|4": { + "scheduler" : "[SCHEDULER|scheduler.2]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet136|4": { + "scheduler" : "[SCHEDULER|scheduler.2]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet144|4": { + "scheduler" : "[SCHEDULER|scheduler.2]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet152|4": { + "scheduler" : "[SCHEDULER|scheduler.2]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet160|4": { + "scheduler" : "[SCHEDULER|scheduler.2]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet168|4": { + "scheduler" : "[SCHEDULER|scheduler.2]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet176|4": { + "scheduler" : "[SCHEDULER|scheduler.2]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet184|4": { + "scheduler" : "[SCHEDULER|scheduler.2]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet192|4": { + "scheduler" : "[SCHEDULER|scheduler.2]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet200|4": { + "scheduler" : "[SCHEDULER|scheduler.2]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet208|4": { + "scheduler" : "[SCHEDULER|scheduler.2]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet216|4": { + "scheduler" : "[SCHEDULER|scheduler.2]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet224|4": { + "scheduler" : "[SCHEDULER|scheduler.2]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet232|4": { + "scheduler" : "[SCHEDULER|scheduler.2]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet240|4": { + "scheduler" : "[SCHEDULER|scheduler.2]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet248|4": { + "scheduler" : "[SCHEDULER|scheduler.2]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet0|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet8|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet16|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet24|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet32|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet40|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet48|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet56|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet64|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet72|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet80|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet88|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet96|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet104|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet112|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet120|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet128|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet136|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet144|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet152|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet160|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet168|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet176|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet184|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet192|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet200|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet208|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet216|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet224|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet232|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet240|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet248|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet0|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet8|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet16|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet24|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet32|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet40|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet48|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet56|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet64|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet72|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet80|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet88|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet96|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet104|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet112|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet120|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet128|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet136|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet144|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet152|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet160|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet168|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet176|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet184|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet192|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet200|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet208|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet216|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet224|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet232|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet240|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet248|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet0|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet8|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet16|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet24|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet32|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet40|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet48|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet56|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet64|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet72|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet80|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet88|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet96|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet104|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet112|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet120|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet128|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet136|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet144|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet152|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet160|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet168|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet176|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet184|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet192|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet200|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet208|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet216|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet224|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet232|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet240|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet248|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet0|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet8|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet16|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet24|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet32|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet40|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet48|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet56|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet64|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet72|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet80|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet88|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet96|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet104|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet112|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet120|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet128|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet136|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet144|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet152|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet160|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet168|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet176|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet184|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet192|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet200|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet208|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet216|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet224|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet232|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet240|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet248|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet0|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet8|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet16|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet24|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet32|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet40|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet48|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet56|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet64|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet72|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet80|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet88|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet96|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet104|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet112|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet120|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet128|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet136|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet144|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet152|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet160|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet168|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet176|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet184|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet192|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet200|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet208|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet216|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet224|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet232|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet240|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet248|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + } + } +} diff --git a/src/sonic-config-engine/tests/sample_output/py3/qos-mellanox4600c-c64-remap-disabled.json b/src/sonic-config-engine/tests/sample_output/py3/qos-mellanox4600c-c64-remap-disabled.json new file mode 100644 index 000000000000..9bd54d64f37a --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py3/qos-mellanox4600c-c64-remap-disabled.json @@ -0,0 +1,1005 @@ +{ + "TC_TO_PRIORITY_GROUP_MAP": { + "AZURE": { + "0": "0", + "1": "0", + "2": "0", + "3": "3", + "4": "4", + "5": "0", + "6": "0", + "7": "7" + } + }, + "MAP_PFC_PRIORITY_TO_QUEUE": { + "AZURE": { + "0": "0", + "1": "1", + "2": "2", + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7" + } + }, + "TC_TO_QUEUE_MAP": { + "AZURE": { + "0": "0", + "1": "1", + "2": "2", + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7" + } + }, + "DSCP_TO_TC_MAP": { + "AZURE": { + "0" : "1", + "1" : "1", + "2" : "1", + "3" : "3", + "4" : "4", + "5" : "2", + "6" : "1", + "7" : "1", + "8" : "0", + "9" : "1", + "10": "1", + "11": "1", + "12": "1", + "13": "1", + "14": "1", + "15": "1", + "16": "1", + "17": "1", + "18": "1", + "19": "1", + "20": "1", + "21": "1", + "22": "1", + "23": "1", + "24": "1", + "25": "1", + "26": "1", + "27": "1", + "28": "1", + "29": "1", + "30": "1", + "31": "1", + "32": "1", + "33": "1", + "34": "1", + "35": "1", + "36": "1", + "37": "1", + "38": "1", + "39": "1", + "40": "1", + "41": "1", + "42": "1", + "43": "1", + "44": "1", + "45": "1", + "46": "5", + "47": "1", + "48": "6", + "49": "1", + "50": "1", + "51": "1", + "52": "1", + "53": "1", + "54": "1", + "55": "1", + "56": "1", + "57": "1", + "58": "1", + "59": "1", + "60": "1", + "61": "1", + "62": "1", + "63": "1" + } + }, + "SCHEDULER": { + "scheduler.0": { + "type" : "DWRR", + "weight": "14" + }, + "scheduler.1": { + "type" : "DWRR", + "weight": "15" + } + }, + "PORT_QOS_MAP": { + "Ethernet0": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet4": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet16": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet20": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet64": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet68": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet80": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet84": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet136": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet144": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet148": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet152": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet156": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet168": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet176": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet180": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet184": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet188": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet200": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet208": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet212": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet216": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet220": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet232": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet240": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet244": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet248": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet252": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + } + }, + "WRED_PROFILE": { + "AZURE_LOSSLESS" : { + "wred_green_enable" : "true", + "wred_yellow_enable" : "true", + "wred_red_enable" : "true", + "ecn" : "ecn_all", + "green_max_threshold" : "2097152", + "green_min_threshold" : "1048576", + "yellow_max_threshold" : "2097152", + "yellow_min_threshold" : "1048576", + "red_max_threshold" : "2097152", + "red_min_threshold" : "1048576", + "green_drop_probability" : "5", + "yellow_drop_probability": "5", + "red_drop_probability" : "5" + } + }, + "QUEUE": { + "Ethernet0|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet4|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet16|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet20|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet64|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet68|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet80|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet84|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet136|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet144|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet148|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet152|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet156|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet168|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet176|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet180|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet184|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet188|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet200|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet208|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet212|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet216|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet220|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet232|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet240|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet244|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet248|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet252|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet0|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet4|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet16|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet20|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet64|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet68|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet80|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet84|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet136|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet144|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet148|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet152|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet156|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet168|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet176|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet180|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet184|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet188|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet200|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet208|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet212|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet216|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet220|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet232|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet240|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet244|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet248|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet252|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet0|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet4|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet16|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet20|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet64|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet68|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet80|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet84|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet136|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet144|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet148|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet152|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet156|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet168|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet176|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet180|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet184|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet188|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet200|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet208|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet212|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet216|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet220|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet232|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet240|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet244|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet248|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet252|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet0|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet4|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet16|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet20|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet64|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet68|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet80|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet84|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet136|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet144|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet148|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet152|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet156|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet168|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet176|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet180|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet184|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet188|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet200|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet208|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet212|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet216|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet220|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet232|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet240|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet244|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet248|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet252|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet0|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet4|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet16|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet20|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet64|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet68|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet80|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet84|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet136|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet144|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet148|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet152|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet156|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet168|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet176|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet180|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet184|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet188|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet200|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet208|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet212|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet216|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet220|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet232|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet240|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet244|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet248|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet252|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet0|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet4|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet16|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet20|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet64|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet68|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet80|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet84|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet136|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet144|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet148|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet152|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet156|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet168|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet176|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet180|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet184|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet188|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet200|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet208|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet212|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet216|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet220|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet232|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet240|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet244|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet248|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet252|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet0|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet4|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet16|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet20|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet64|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet68|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet80|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet84|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet136|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet144|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet148|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet152|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet156|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet168|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet176|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet180|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet184|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet188|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet200|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet208|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet212|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet216|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet220|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet232|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet240|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet244|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet248|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet252|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + } + } +} diff --git a/src/sonic-config-engine/tests/sample_output/py3/qos-mellanox4600c-c64.json b/src/sonic-config-engine/tests/sample_output/py3/qos-mellanox4600c-c64.json new file mode 100644 index 000000000000..a12464056d9c --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py3/qos-mellanox4600c-c64.json @@ -0,0 +1,1196 @@ + +{ + "TC_TO_PRIORITY_GROUP_MAP": { + "AZURE": { + "0": "0", + "1": "0", + "2": "2", + "3": "3", + "4": "4", + "5": "0", + "6": "6", + "7": "0" + } + }, + "MAP_PFC_PRIORITY_TO_QUEUE": { + "AZURE": { + "0": "0", + "1": "1", + "2": "2", + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7" + } + }, + "TC_TO_QUEUE_MAP": { + "AZURE": { + "0": "0", + "1": "1", + "2": "2", + "3": "3", + "4": "4", + "5": "5", + "6": "6", + "7": "7" + } + }, + "DSCP_TO_TC_MAP": { + "AZURE": { + "0" : "1", + "1" : "1", + "2" : "2", + "3" : "3", + "4" : "4", + "5" : "1", + "6" : "6", + "7" : "1", + "8" : "0", + "9" : "1", + "10": "1", + "11": "1", + "12": "1", + "13": "1", + "14": "1", + "15": "1", + "16": "1", + "17": "1", + "18": "1", + "19": "1", + "20": "1", + "21": "1", + "22": "1", + "23": "1", + "24": "1", + "25": "1", + "26": "1", + "27": "1", + "28": "1", + "29": "1", + "30": "1", + "31": "1", + "32": "1", + "33": "1", + "34": "1", + "35": "1", + "36": "1", + "37": "1", + "38": "1", + "39": "1", + "40": "1", + "41": "1", + "42": "1", + "43": "1", + "44": "1", + "45": "1", + "46": "5", + "47": "1", + "48": "7", + "49": "1", + "50": "1", + "51": "1", + "52": "1", + "53": "1", + "54": "1", + "55": "1", + "56": "1", + "57": "1", + "58": "1", + "59": "1", + "60": "1", + "61": "1", + "62": "1", + "63": "1" + }, + "AZURE_UPLINK": { + "0" : "1", + "1" : "1", + "2" : "1", + "3" : "3", + "4" : "4", + "5" : "1", + "6" : "1", + "7" : "1", + "8" : "0", + "9" : "1", + "10": "1", + "11": "1", + "12": "1", + "13": "1", + "14": "1", + "15": "1", + "16": "1", + "17": "1", + "18": "1", + "19": "1", + "20": "1", + "21": "1", + "22": "1", + "23": "1", + "24": "1", + "25": "1", + "26": "1", + "27": "1", + "28": "1", + "29": "1", + "30": "1", + "31": "1", + "32": "1", + "33": "1", + "34": "1", + "35": "1", + "36": "1", + "37": "1", + "38": "1", + "39": "1", + "40": "1", + "41": "1", + "42": "1", + "43": "1", + "44": "1", + "45": "1", + "46": "5", + "47": "1", + "48": "7", + "49": "1", + "50": "1", + "51": "1", + "52": "1", + "53": "1", + "54": "1", + "55": "1", + "56": "1", + "57": "1", + "58": "1", + "59": "1", + "60": "1", + "61": "1", + "62": "1", + "63": "1" + } + }, + "SCHEDULER": { + "scheduler.0": { + "type" : "DWRR", + "weight": "14" + }, + "scheduler.1": { + "type" : "DWRR", + "weight": "15" + } + }, + "PORT_QOS_MAP": { + "Ethernet0": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE_UPLINK]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet4": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE_UPLINK]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet16": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE_UPLINK]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet20": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE_UPLINK]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet64": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE_UPLINK]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet68": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE_UPLINK]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet80": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE_UPLINK]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet84": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE_UPLINK]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "3,4", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet136": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet144": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet148": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet152": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet156": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet168": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet176": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet180": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet184": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet188": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet200": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet208": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet212": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet216": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet220": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet232": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet240": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet244": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet248": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + }, + "Ethernet252": { + "dscp_to_tc_map" : "[DSCP_TO_TC_MAP|AZURE]", + "tc_to_queue_map" : "[TC_TO_QUEUE_MAP|AZURE]", + "tc_to_pg_map" : "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", + "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", + "pfc_enable" : "2,3,4,6", + "pfcwd_sw_enable" : "3,4" + } + }, + "WRED_PROFILE": { + "AZURE_LOSSLESS" : { + "wred_green_enable" : "true", + "wred_yellow_enable" : "true", + "wred_red_enable" : "true", + "ecn" : "ecn_all", + "green_max_threshold" : "2097152", + "green_min_threshold" : "1048576", + "yellow_max_threshold" : "2097152", + "yellow_min_threshold" : "1048576", + "red_max_threshold" : "2097152", + "red_min_threshold" : "1048576", + "green_drop_probability" : "5", + "yellow_drop_probability": "5", + "red_drop_probability" : "5" + } + }, + "QUEUE": { + "Ethernet0|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet4|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet16|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet20|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet64|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet68|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet80|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet84|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet136|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet144|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet148|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet152|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet156|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet168|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet176|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet180|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet184|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet188|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet200|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet208|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet212|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet216|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet220|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet232|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet240|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet244|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet248|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet252|3": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet0|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet4|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet16|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet20|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet64|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet68|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet80|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet84|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet136|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet144|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet148|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet152|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet156|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet168|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet176|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet180|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet184|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet188|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet200|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet208|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet212|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet216|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet220|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet232|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet240|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet244|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet248|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet252|4": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet0|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet4|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet16|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet20|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet64|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet68|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet80|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet84|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet136|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet144|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet148|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet152|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet156|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet168|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet176|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet180|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet184|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet188|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet200|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet208|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet212|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet216|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet220|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet232|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet240|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet244|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet248|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet252|0": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet0|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet4|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet16|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet20|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet64|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet68|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet80|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet84|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet136|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet144|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet148|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet152|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet156|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet168|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet176|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet180|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet184|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet188|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet200|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet208|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet212|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet216|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet220|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet232|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet240|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet244|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet248|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet252|1": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet0|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet4|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet16|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet20|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet64|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet68|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet80|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet84|2": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet136|2": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet144|2": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet148|2": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet152|2": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet156|2": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet168|2": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet176|2": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet180|2": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet184|2": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet188|2": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet200|2": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet208|2": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet212|2": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet216|2": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet220|2": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet232|2": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet240|2": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet244|2": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet248|2": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet252|2": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet0|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet0|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet4|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet4|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet16|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet16|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet20|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet20|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet64|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet64|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet68|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet68|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet80|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet80|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet84|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet84|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet136|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet136|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet144|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet144|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet148|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet148|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet152|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet152|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet156|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet156|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet168|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet168|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet176|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet176|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet180|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet180|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet184|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet184|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet188|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet188|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet200|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet200|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet208|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet208|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet212|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet212|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet216|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet216|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet220|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet220|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet232|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet232|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet240|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet240|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet244|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet244|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet248|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet248|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet252|5": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet252|7": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet0|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet4|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet16|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet20|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet64|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet68|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet80|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet84|6": { + "scheduler": "[SCHEDULER|scheduler.0]" + }, + "Ethernet136|6": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet144|6": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet148|6": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet152|6": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet156|6": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet168|6": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet176|6": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet180|6": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet184|6": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet188|6": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet200|6": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet208|6": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet212|6": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet216|6": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet220|6": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet232|6": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet240|6": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet244|6": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet248|6": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + }, + "Ethernet252|6": { + "scheduler" : "[SCHEDULER|scheduler.1]", + "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" + } + } +} diff --git a/src/sonic-config-engine/tests/sample_output/py3/radvd.conf b/src/sonic-config-engine/tests/sample_output/py3/radvd.conf new file mode 100644 index 000000000000..43de8b847756 --- /dev/null +++ b/src/sonic-config-engine/tests/sample_output/py3/radvd.conf @@ -0,0 +1,35 @@ +# =========== Managed by sonic-cfggen -- DO NOT edit manually! ==================== +# Generated by /usr/share/sonic/templates/radvd.conf.j2 using config DB data +# File: /etc/radvd.conf +# +# Config file for radvd, the router advertisement daemon +# See man page for radvd.conf for descriptions of all available options +# + +interface Vlan1000 +{ + IgnoreIfMissing on; + AdvSendAdvert on; + MinRtrAdvInterval 60; + MaxRtrAdvInterval 180; + AdvManagedFlag on; + AdvOtherConfigFlag off; + AdvLinkMTU 9100; + AdvHomeAgentFlag off; + prefix fc02:1000::/64 { + AdvOnLink on; + AdvAutonomous off; + AdvRouterAddr off; + AdvValidLifetime infinity; + AdvPreferredLifetime infinity; + }; + prefix fc02:2000::/64 { + AdvOnLink on; + AdvAutonomous off; + AdvRouterAddr off; + AdvValidLifetime infinity; + AdvPreferredLifetime infinity; + }; +}; + + diff --git a/src/sonic-config-engine/tests/sample_output/py3/t2-chassis-fe-bgpd.conf b/src/sonic-config-engine/tests/sample_output/py3/t2-chassis-fe-bgpd.conf index 7633ac117bf7..20744efaa40f 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/t2-chassis-fe-bgpd.conf +++ b/src/sonic-config-engine/tests/sample_output/py3/t2-chassis-fe-bgpd.conf @@ -63,9 +63,6 @@ router bgp 4000 ! bgp bestpath as-path multipath-relax ! - bgp graceful-restart restart-time 240 - bgp graceful-restart - bgp graceful-restart preserve-fw-state ! bgp router-id 4.0.0.0 ! diff --git a/src/sonic-config-engine/tests/sample_output/py3/wait_for_intf.sh b/src/sonic-config-engine/tests/sample_output/py3/wait_for_intf.sh index 6d90afa60ad7..5f0f46a59147 100644 --- a/src/sonic-config-engine/tests/sample_output/py3/wait_for_intf.sh +++ b/src/sonic-config-engine/tests/sample_output/py3/wait_for_intf.sh @@ -21,11 +21,38 @@ function wait_until_iface_ready echo "Interface ${IFACE_NAME} is ready!" } +function check_for_ipv6_link_local +{ + IFACE_NAME=$1 + echo "Waiting until interface ${IFACE_NAME} has a link-local ipv6 address configured...." + + # Status of link local address is not populated in STATE_DB + while true; do + HAS_LL=$(ip -6 addr show ${IFACE_NAME} scope link 2> /dev/null) + RC=$? + if [[ ${RC} == "0" ]] && [[ ! -z ${HAS_LL} ]]; then + break + fi + + sleep 1 + done + + echo "Link-Local address is configured on ${IFACE_NAME}" +} # Wait for all interfaces with IPv4 addresses to be up and ready +# dhcp6relay binds to ipv6 addresses configured on these vlan ifaces +# Thus check if they are ready before launching dhcp6relay +wait_until_iface_ready Vlan1000 fc02:2000::2/24 +check_for_ipv6_link_local Vlan1000 wait_until_iface_ready Vlan1000 192.168.0.1/27 +wait_until_iface_ready Vlan2000 192.168.200.1/27 wait_until_iface_ready PortChannel01 10.0.0.56/31 wait_until_iface_ready PortChannel02 10.0.0.58/31 wait_until_iface_ready PortChannel03 10.0.0.60/31 wait_until_iface_ready PortChannel04 10.0.0.62/31 +# Wait 10 seconds for the rest of interfaces to get added/populated. +# dhcrelay listens on each of the interfaces (in addition to the port +# channels and vlan interfaces) +sleep 10 diff --git a/src/sonic-config-engine/tests/sample_platform.json b/src/sonic-config-engine/tests/sample_platform.json index fd11a49ed0a0..461e01e371c7 100644 --- a/src/sonic-config-engine/tests/sample_platform.json +++ b/src/sonic-config-engine/tests/sample_platform.json @@ -1,4 +1,16 @@ { + "chassis": { + "psus": [ + { + "name": "PSU 1", + "temperature": false + }, + { + "name": "PSU 2", + "temperature": false + } + ] + }, "interfaces": { "Ethernet0": { "index": "1,1,1,1", diff --git a/src/sonic-config-engine/tests/simple-sample-device-desc-ipv6-only.xml b/src/sonic-config-engine/tests/simple-sample-device-desc-ipv6-only.xml new file mode 100644 index 000000000000..c35d2354a900 --- /dev/null +++ b/src/sonic-config-engine/tests/simple-sample-device-desc-ipv6-only.xml @@ -0,0 +1,11 @@ + + switch-t0 + Force10-S6000 + AAA00PrdStr00 + + 0.0.0.0/0 + + + FC00:1::32/64 + + diff --git a/src/sonic-config-engine/tests/simple-sample-device-desc.xml b/src/sonic-config-engine/tests/simple-sample-device-desc.xml new file mode 100644 index 000000000000..72941dfcd9b6 --- /dev/null +++ b/src/sonic-config-engine/tests/simple-sample-device-desc.xml @@ -0,0 +1,11 @@ + + switch-t0 + Force10-S6000 + AAA00PrdStr00 + + 10.0.0.100/24 + + + FC00:1::32/64 + + diff --git a/src/sonic-config-engine/tests/simple-sample-graph-case-remap-disabled.xml b/src/sonic-config-engine/tests/simple-sample-graph-case-remap-disabled.xml new file mode 100644 index 000000000000..91c0aa46c10e --- /dev/null +++ b/src/sonic-config-engine/tests/simple-sample-graph-case-remap-disabled.xml @@ -0,0 +1,886 @@ + + + + + + false + switch-t0 + 10.0.0.56 + ARISTA01T1 + 10.0.0.57 + 1 + 180 + 60 + + + switch-t0 + FC00::71 + ARISTA01T1 + FC00::72 + 1 + 180 + 60 + + + false + switch-t0 + 10.0.0.58 + ARISTA02T1 + 10.0.0.59 + 1 + 180 + 60 + + + switch-t0 + FC00::75 + ARISTA02T1 + FC00::76 + 1 + 180 + 60 + + + + + 65100 + switch-t0 + + +
10.0.0.57
+ + + +
+ +
10.0.0.59
+ + + +
+
+ +
+ + 64600 + ARISTA01T1 + + + + 64600 + ARISTA02T1 + + + + 64600 + ARISTA03T1 + + + + 64600 + ARISTA04T1 + + +
+
+ + + + + + HostIP + Loopback0 + + 10.1.0.32/32 + + 10.1.0.32/32 + + + HostIP1 + Loopback0 + + FC00:1::32/128 + + FC00:1::32/128 + + + + + HostIP + eth0 + + 10.0.0.100/24 + + 10.0.0.100/24 + + + + + + + switch-t0 + + + PortChannel01 + fortyGigE0/4 + + + + + + + + + ab1 + fortyGigE0/8 + 192.0.0.1;192.0.0.2 + fc02:2000::1;fc02:2000::2 + 1000 + 1000 + 192.168.0.0/27 + 00:aa:bb:cc:dd:ee + + + ab2 + fortyGigE0/4 + 192.0.0.1 + fc02:2000::3;fc02:2000::4 + 2000 + 2000 + + + + + + + PortChannel01 + 10.0.0.56/31 + + + + PortChannel01 + FC00::71/126 + + + + fortyGigE0/0 + 10.0.0.58/31 + + + + fortyGigE0/0 + FC00::75/126 + + + + ab1 + 192.168.0.1/27 + + + + + + PortChannel01 + DataAcl + DataPlane + + + SNMP + SNMP_ACL + SNMP + + + ERSPAN_DSCP + Everflow_dscp + Everflow_dscp + + + + + + + + + + DeviceSerialLink + 9600 + switch-t0 + console + true + switch-t1 + 1 + + + DeviceSerialLink + 9600 + switch-t0 + 1 + true + managed_device + console + + + DeviceInterfaceLink + 10000 + switch-t0 + fortyGigE0/0 + switch-01t1 + port1 + + + DeviceInterfaceLink + 10000 + switch-t0 + fortyGigE0/12 + switch-02t1 + port1 + + + DeviceInterfaceLink + 25000 + switch-t0 + fortyGigE0/4 + server1 + port1 + + + DeviceInterfaceLink + 40000 + switch-t0 + fortyGigE0/8 + server2 + port1 + + + LogicalLink + 10000 + false + switch-t0 + fortyGigE0/4 + true + mux-cable + L + true + + + LogicalLink + 10000 + false + switch-t0 + fortyGigE0/8 + true + mux-cable + U + true + + + LogicalLink + 0 + false + switch-t0 + MuxTunnel0 + false + switch2-t0 + MuxTunnel0 + true + + + + + ToRRouter +
+ 26.1.1.10/32 +
+ switch-t0 + Force10-S6000 + AAA00PrdStr00 +
+ +
+ 25.1.1.10/32 +
+ + 10.7.0.196/26 + + switch2-t0 + Force10-S6000 +
+ + switch-01t1 +
+ 10.1.0.186/32 +
+ 2 + + + 10.7.0.196/26 + + Force10-S6000 +
+ + Server +
+ 10.10.10.1/32 +
+ + fe80::0001/80 + + + 10.0.0.1/32 + + server1 + server-sku +
+ + Server +
+ 10.10.10.2/32 +
+ + fe80::0002/128 + + + 10.0.0.2/32 + + server2 + server-sku +
+
+
+ + + + + + + GeminiPeeringLink + + True + + + UpperTOR + + switch-t0 + + + LowerTOR + + switch2-t0 + + + switch2-t0:MuxTunnel0;switch-t0:MuxTunnel0 + + + + + + AutoNegotiation + + True + + + switch-01t1:port1;switch-t0:fortyGigE0/0 + + + + + + AutoNegotiation + + True + + + switch-02t1:port1;switch-t0:fortyGigE0/12 + + + + + + AutoNegotiation + + True + + + server1:port1;switch-t0:fortyGigE0/4 + + + + + + AutoNegotiation + + True + + + server2:port1;switch-t0:fortyGigE0/8 + + + + + + + switch-t0 + + + DeploymentId + + 1 + + + ErspanDestinationIpv4 + + 10.0.100.1 + + + NtpResources + + 10.0.10.1;10.0.10.2 + + + + SnmpResources + + 10.0.10.3;10.0.10.4 + + + + SyslogResources + + 10.0.10.5;10.0.10.6 + + + + TacacsServer + + 10.0.10.7;10.0.10.8 + + + KubernetesEnabled + + 0 + + + KubernetesServerIp + + 10.10.10.10 + + + ResourceType + + Storage + + + + + + + + + + + DeviceInterface + + true + 1 + fortyGigE0/0 + + false + 0 + 0 + 10000 + + + DeviceInterface + + true + 1 + fortyGigE0/4 + + false + 0 + 0 + 25000 + + + DeviceInterface + + true + 1 + fortyGigE0/8 + + false + 0 + 0 + 40000 + Interface description + + + DeviceInterface + + true + 1 + fortyGigE0/12 + + false + 0 + 0 + 100000 + Interface description + + + DeviceInterface + + true + 1 + fortyGigE0/16 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/20 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/24 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/28 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/32 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/36 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/40 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/44 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/48 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/52 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/56 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/60 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/64 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/68 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/72 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/76 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/80 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/84 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/88 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/92 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/96 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/100 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/104 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/108 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/112 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/116 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/120 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/124 + + false + 0 + 0 + 100000 + + + true + 0 + Force10-S6000 + + + DeviceInterface + + true + 1 + eth0 + false + eth0 + 1000 + + + + + switch-t0 + Force10-S6000 +
diff --git a/src/sonic-config-engine/tests/simple-sample-graph-case-remap-enabled-no-tunnel-attributes.xml b/src/sonic-config-engine/tests/simple-sample-graph-case-remap-enabled-no-tunnel-attributes.xml new file mode 100644 index 000000000000..a88bc4e2adeb --- /dev/null +++ b/src/sonic-config-engine/tests/simple-sample-graph-case-remap-enabled-no-tunnel-attributes.xml @@ -0,0 +1,891 @@ + + + + + + false + switch-t0 + 10.0.0.56 + ARISTA01T1 + 10.0.0.57 + 1 + 180 + 60 + + + switch-t0 + FC00::71 + ARISTA01T1 + FC00::72 + 1 + 180 + 60 + + + false + switch-t0 + 10.0.0.58 + ARISTA02T1 + 10.0.0.59 + 1 + 180 + 60 + + + switch-t0 + FC00::75 + ARISTA02T1 + FC00::76 + 1 + 180 + 60 + + + + + 65100 + switch-t0 + + +
10.0.0.57
+ + + +
+ +
10.0.0.59
+ + + +
+
+ +
+ + 64600 + ARISTA01T1 + + + + 64600 + ARISTA02T1 + + + + 64600 + ARISTA03T1 + + + + 64600 + ARISTA04T1 + + +
+
+ + + + + + HostIP + Loopback0 + + 10.1.0.32/32 + + 10.1.0.32/32 + + + HostIP1 + Loopback0 + + FC00:1::32/128 + + FC00:1::32/128 + + + + + HostIP + eth0 + + 10.0.0.100/24 + + 10.0.0.100/24 + + + + + + + switch-t0 + + + PortChannel01 + fortyGigE0/4 + + + + + + + + + ab1 + fortyGigE0/8 + 192.0.0.1;192.0.0.2 + fc02:2000::1;fc02:2000::2 + 1000 + 1000 + 192.168.0.0/27 + 00:aa:bb:cc:dd:ee + + + ab2 + fortyGigE0/4 + 192.0.0.1 + fc02:2000::3;fc02:2000::4 + 2000 + 2000 + + + + + + + PortChannel01 + 10.0.0.56/31 + + + + PortChannel01 + FC00::71/126 + + + + fortyGigE0/0 + 10.0.0.58/31 + + + + fortyGigE0/0 + FC00::75/126 + + + + ab1 + 192.168.0.1/27 + + + + + + PortChannel01 + DataAcl + DataPlane + + + SNMP + SNMP_ACL + SNMP + + + ERSPAN_DSCP + Everflow_dscp + Everflow_dscp + + + + + + + + + + DeviceSerialLink + 9600 + switch-t0 + console + true + switch-t1 + 1 + + + DeviceSerialLink + 9600 + switch-t0 + 1 + true + managed_device + console + + + DeviceInterfaceLink + 10000 + switch-t0 + fortyGigE0/0 + switch-01t1 + port1 + + + DeviceInterfaceLink + 10000 + switch-t0 + fortyGigE0/12 + switch-02t1 + port1 + + + DeviceInterfaceLink + 25000 + switch-t0 + fortyGigE0/4 + server1 + port1 + + + DeviceInterfaceLink + 40000 + switch-t0 + fortyGigE0/8 + server2 + port1 + + + LogicalLink + 10000 + false + switch-t0 + fortyGigE0/4 + true + mux-cable + L + true + + + LogicalLink + 10000 + false + switch-t0 + fortyGigE0/8 + true + mux-cable + U + true + + + LogicalLink + 0 + false + switch-t0 + MuxTunnel0 + false + switch2-t0 + MuxTunnel0 + true + + + + + ToRRouter +
+ 26.1.1.10/32 +
+ switch-t0 + Force10-S6000 + AAA00PrdStr00 +
+ +
+ 25.1.1.10/32 +
+ + 10.7.0.196/26 + + switch2-t0 + Force10-S6000 +
+ + switch-01t1 +
+ 10.1.0.186/32 +
+ 2 + + + 10.7.0.196/26 + + Force10-S6000 +
+ + Server +
+ 10.10.10.1/32 +
+ + fe80::0001/80 + + + 10.0.0.1/32 + + server1 + server-sku +
+ + Server +
+ 10.10.10.2/32 +
+ + fe80::0002/128 + + + 10.0.0.2/32 + + server2 + server-sku +
+
+
+ + + + + + + GeminiPeeringLink + + True + + + UpperTOR + + switch-t0 + + + LowerTOR + + switch2-t0 + + + switch2-t0:MuxTunnel0;switch-t0:MuxTunnel0 + + + + + + AutoNegotiation + + True + + + switch-01t1:port1;switch-t0:fortyGigE0/0 + + + + + + AutoNegotiation + + True + + + switch-02t1:port1;switch-t0:fortyGigE0/12 + + + + + + AutoNegotiation + + True + + + server1:port1;switch-t0:fortyGigE0/4 + + + + + + AutoNegotiation + + True + + + server2:port1;switch-t0:fortyGigE0/8 + + + + + + + switch-t0 + + + DeploymentId + + 1 + + + ErspanDestinationIpv4 + + 10.0.100.1 + + + NtpResources + + 10.0.10.1;10.0.10.2 + + + + SnmpResources + + 10.0.10.3;10.0.10.4 + + + + SyslogResources + + 10.0.10.5;10.0.10.6 + + + + TacacsServer + + 10.0.10.7;10.0.10.8 + + + KubernetesEnabled + + 0 + + + KubernetesServerIp + + 10.10.10.10 + + + ResourceType + + Storage + + + RedundancyType + + Gemini + + + + + + + + + + + DeviceInterface + + true + 1 + fortyGigE0/0 + + false + 0 + 0 + 10000 + + + DeviceInterface + + true + 1 + fortyGigE0/4 + + false + 0 + 0 + 25000 + + + DeviceInterface + + true + 1 + fortyGigE0/8 + + false + 0 + 0 + 40000 + Interface description + + + DeviceInterface + + true + 1 + fortyGigE0/12 + + false + 0 + 0 + 100000 + Interface description + + + DeviceInterface + + true + 1 + fortyGigE0/16 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/20 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/24 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/28 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/32 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/36 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/40 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/44 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/48 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/52 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/56 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/60 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/64 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/68 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/72 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/76 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/80 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/84 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/88 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/92 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/96 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/100 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/104 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/108 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/112 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/116 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/120 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/124 + + false + 0 + 0 + 100000 + + + true + 0 + Force10-S6000 + + + DeviceInterface + + true + 1 + eth0 + false + eth0 + 1000 + + + + + switch-t0 + Force10-S6000 +
diff --git a/src/sonic-config-engine/tests/simple-sample-graph-case-remap-enabled.xml b/src/sonic-config-engine/tests/simple-sample-graph-case-remap-enabled.xml new file mode 100644 index 000000000000..1babc8ac5036 --- /dev/null +++ b/src/sonic-config-engine/tests/simple-sample-graph-case-remap-enabled.xml @@ -0,0 +1,891 @@ + + + + + + false + switch-t0 + 10.0.0.56 + ARISTA01T1 + 10.0.0.57 + 1 + 180 + 60 + + + switch-t0 + FC00::71 + ARISTA01T1 + FC00::72 + 1 + 180 + 60 + + + false + switch-t0 + 10.0.0.58 + ARISTA02T1 + 10.0.0.59 + 1 + 180 + 60 + + + switch-t0 + FC00::75 + ARISTA02T1 + FC00::76 + 1 + 180 + 60 + + + + + 65100 + switch-t0 + + +
10.0.0.57
+ + + +
+ +
10.0.0.59
+ + + +
+
+ +
+ + 64600 + ARISTA01T1 + + + + 64600 + ARISTA02T1 + + + + 64600 + ARISTA03T1 + + + + 64600 + ARISTA04T1 + + +
+
+ + + + + + HostIP + Loopback0 + + 10.1.0.32/32 + + 10.1.0.32/32 + + + HostIP1 + Loopback0 + + FC00:1::32/128 + + FC00:1::32/128 + + + + + HostIP + eth0 + + 10.0.0.100/24 + + 10.0.0.100/24 + + + + + + + switch-t0 + + + PortChannel01 + fortyGigE0/4 + + + + + + + + + ab1 + fortyGigE0/8 + 192.0.0.1;192.0.0.2 + fc02:2000::1;fc02:2000::2 + 1000 + 1000 + 192.168.0.0/27 + 00:aa:bb:cc:dd:ee + + + ab2 + fortyGigE0/4 + 192.0.0.1 + fc02:2000::3;fc02:2000::4 + 2000 + 2000 + + + + + + + PortChannel01 + 10.0.0.56/31 + + + + PortChannel01 + FC00::71/126 + + + + fortyGigE0/0 + 10.0.0.58/31 + + + + fortyGigE0/0 + FC00::75/126 + + + + ab1 + 192.168.0.1/27 + + + + + + PortChannel01 + DataAcl + DataPlane + + + SNMP + SNMP_ACL + SNMP + + + ERSPAN_DSCP + Everflow_dscp + Everflow_dscp + + + + + + + + + + DeviceSerialLink + 9600 + switch-t0 + console + true + switch-t1 + 1 + + + DeviceSerialLink + 9600 + switch-t0 + 1 + true + managed_device + console + + + DeviceInterfaceLink + 10000 + switch-t0 + fortyGigE0/0 + switch-01t1 + port1 + + + DeviceInterfaceLink + 10000 + switch-t0 + fortyGigE0/12 + switch-02t1 + port1 + + + DeviceInterfaceLink + 25000 + switch-t0 + fortyGigE0/4 + server1 + port1 + + + DeviceInterfaceLink + 40000 + switch-t0 + fortyGigE0/8 + server2 + port1 + + + LogicalLink + 10000 + false + switch-t0 + fortyGigE0/4 + true + mux-cable + L + true + + + LogicalLink + 10000 + false + switch-t0 + fortyGigE0/8 + true + mux-cable + U + true + + + LogicalLink + 0 + false + switch-t0 + MuxTunnel0 + false + switch2-t0 + MuxTunnel0 + true + + + + + ToRRouter +
+ 26.1.1.10/32 +
+ switch-t0 + Force10-S6000 + AAA00PrdStr00 +
+ +
+ 25.1.1.10/32 +
+ + 10.7.0.196/26 + + switch2-t0 + Force10-S6000 +
+ + switch-01t1 +
+ 10.1.0.186/32 +
+ 2 + + + 10.7.0.196/26 + + Force10-S6000 +
+ + Server +
+ 10.10.10.1/32 +
+ + fe80::0001/80 + + + 10.0.0.1/32 + + server1 + server-sku +
+ + Server +
+ 10.10.10.2/32 +
+ + fe80::0002/128 + + + 10.0.0.2/32 + + server2 + server-sku +
+
+
+ + + + + + + GeminiPeeringLink + + True + + + UpperTOR + + switch-t0 + + + LowerTOR + + switch2-t0 + + + switch2-t0:MuxTunnel0;switch-t0:MuxTunnel0 + + + + + + AutoNegotiation + + True + + + switch-01t1:port1;switch-t0:fortyGigE0/0 + + + + + + AutoNegotiation + + True + + + switch-02t1:port1;switch-t0:fortyGigE0/12 + + + + + + AutoNegotiation + + True + + + server1:port1;switch-t0:fortyGigE0/4 + + + + + + AutoNegotiation + + True + + + server2:port1;switch-t0:fortyGigE0/8 + + + + + + + switch-t0 + + + DeploymentId + + 1 + + + ErspanDestinationIpv4 + + 10.0.100.1 + + + NtpResources + + 10.0.10.1;10.0.10.2 + + + + SnmpResources + + 10.0.10.3;10.0.10.4 + + + + SyslogResources + + 10.0.10.5;10.0.10.6 + + + + TacacsServer + + 10.0.10.7;10.0.10.8 + + + KubernetesEnabled + + 0 + + + KubernetesServerIp + + 10.10.10.10 + + + ResourceType + + Storage + + + RedundancyType + + Gemini + + + + + + + + + + + DeviceInterface + + true + 1 + fortyGigE0/0 + + false + 0 + 0 + 10000 + + + DeviceInterface + + true + 1 + fortyGigE0/4 + + false + 0 + 0 + 25000 + + + DeviceInterface + + true + 1 + fortyGigE0/8 + + false + 0 + 0 + 40000 + Interface description + + + DeviceInterface + + true + 1 + fortyGigE0/12 + + false + 0 + 0 + 100000 + Interface description + + + DeviceInterface + + true + 1 + fortyGigE0/16 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/20 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/24 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/28 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/32 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/36 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/40 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/44 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/48 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/52 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/56 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/60 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/64 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/68 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/72 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/76 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/80 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/84 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/88 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/92 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/96 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/100 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/104 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/108 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/112 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/116 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/120 + + false + 0 + 0 + 100000 + + + DeviceInterface + + true + 1 + fortyGigE0/124 + + false + 0 + 0 + 100000 + + + true + 0 + Force10-S6000 + + + DeviceInterface + + true + 1 + eth0 + false + eth0 + 1000 + + + + + switch-t0 + Force10-S6000 +
diff --git a/src/sonic-config-engine/tests/simple-sample-graph-case.xml b/src/sonic-config-engine/tests/simple-sample-graph-case.xml index d9a21158c4a2..acaab2c4c7e3 100644 --- a/src/sonic-config-engine/tests/simple-sample-graph-case.xml +++ b/src/sonic-config-engine/tests/simple-sample-graph-case.xml @@ -134,11 +134,21 @@ ab1 fortyGigE0/8 192.0.0.1;192.0.0.2 + fc02:2000::1;fc02:2000::2 1000 1000 192.168.0.0/27 00:aa:bb:cc:dd:ee + + ab2 + fortyGigE0/4 + 192.0.0.1 + fc02:2000::3;fc02:2000::4 + 2000 + 2000 + + @@ -179,6 +189,11 @@ SNMP_ACL SNMP + + ERSPAN_DSCP + Everflow_dscp + Everflow_dscp + @@ -186,6 +201,15 @@ + + DeviceSerialLink + 9600 + switch-t0 + console + true + switch-t1 + 1 + DeviceSerialLink 9600 @@ -197,7 +221,6 @@ DeviceInterfaceLink - true 10000 switch-t0 fortyGigE0/0 @@ -206,7 +229,6 @@ DeviceInterfaceLink - true 10000 switch-t0 fortyGigE0/12 @@ -215,7 +237,6 @@ DeviceInterfaceLink - true 25000 switch-t0 fortyGigE0/4 @@ -224,7 +245,6 @@ DeviceInterfaceLink - true 40000 switch-t0 fortyGigE0/8 @@ -303,7 +323,7 @@ 10.10.10.1/32 - fe80::0001/128 + fe80::0001/80 10.0.0.1/32 @@ -330,26 +350,70 @@ - - - - GeminiPeeringLink - - True - - - UpperTOR - - switch-t0 - - - LowerTOR - - switch2-t0 - - - switch2-t0:MuxTunnel0;switch-t0:MuxTunnel0 - + + + + GeminiPeeringLink + + True + + + UpperTOR + + switch-t0 + + + LowerTOR + + switch2-t0 + + + switch2-t0:MuxTunnel0;switch-t0:MuxTunnel0 + + + + + + AutoNegotiation + + True + + + switch-01t1:port1;switch-t0:fortyGigE0/0 + + + + + + AutoNegotiation + + True + + + switch-02t1:port1;switch-t0:fortyGigE0/12 + + + + + + AutoNegotiation + + True + + + server1:port1;switch-t0:fortyGigE0/4 + + + + + + AutoNegotiation + + True + + + server2:port1;switch-t0:fortyGigE0/8 + @@ -390,6 +454,21 @@ 10.0.10.7;10.0.10.8 + + KubernetesEnabled + + 0 + + + KubernetesServerIp + + 10.10.10.10 + + + ResourceType + + Storage + @@ -397,12 +476,10 @@ - true DeviceInterface - true true 1 fortyGigE0/0 @@ -415,7 +492,6 @@ DeviceInterface - true true 1 fortyGigE0/4 @@ -428,7 +504,6 @@ DeviceInterface - true true 1 fortyGigE0/8 @@ -442,7 +517,6 @@ DeviceInterface - true true 1 fortyGigE0/12 @@ -461,7 +535,6 @@ DeviceInterface - true true 1 eth0 diff --git a/src/sonic-config-engine/tests/simple-sample-graph-metadata.xml b/src/sonic-config-engine/tests/simple-sample-graph-metadata.xml index 2b3368b7a9c7..80430633b1f8 100644 --- a/src/sonic-config-engine/tests/simple-sample-graph-metadata.xml +++ b/src/sonic-config-engine/tests/simple-sample-graph-metadata.xml @@ -258,6 +258,11 @@ resource_type_x + + DownStreamSubRole + + downstream_subrole_y + @@ -265,12 +270,10 @@ - true DeviceInterface - true true 1 fortyGigE0/0 @@ -283,7 +286,6 @@ DeviceInterface - true true 1 fortyGigE0/4 @@ -296,7 +298,6 @@ DeviceInterface - true true 1 fortyGigE0/8 @@ -310,7 +311,6 @@ DeviceInterface - true true 1 fortyGigE0/12 @@ -329,7 +329,6 @@ DeviceInterface - true true 1 Management1 diff --git a/src/sonic-config-engine/tests/simple-sample-graph.xml b/src/sonic-config-engine/tests/simple-sample-graph.xml index 7215209da545..196d0b191078 100644 --- a/src/sonic-config-engine/tests/simple-sample-graph.xml +++ b/src/sonic-config-engine/tests/simple-sample-graph.xml @@ -164,6 +164,14 @@ 1000 192.168.0.0/27 + + ab4 + fortyGigE0/8 + 192.0.0.1;192.0.0.2 + 1001 + 1001 + 192.168.0.32/27 + kk1 fortyGigE0/12 @@ -173,6 +181,23 @@ Tagged 192.168.0.0/28 + + ab2 + fortyGigE0/12 + 192.0.0.1;192.0.0.2 + 2000 + 2000 + Tagged + 192.168.0.240/27 + + + ab3 + fortyGigE0/12 + 192.0.0.1;192.0.0.2 + 2001 + 2001 + 192.168.0.240/27 + @@ -232,7 +257,6 @@ DeviceInterfaceLink - true 1000 ARISTA01T1 et1 @@ -243,7 +267,6 @@ DeviceInterfaceLink - true 10000 switch-t0 fortyGigE0/1 @@ -254,7 +277,6 @@ DeviceInterfaceLink - true 10000 switch-t0 fortyGigE0/2 @@ -263,6 +285,25 @@ Ethernet1/33 true + + DeviceMgmtLink + 1000 + switch-t0 + fortyGigE0/16 + true + ChassisMTS1 + mgmt0 + true + + + DeviceMgmtLink + 1000 + switch-t0 + Management1 + switch-m0 + Management1 + true + @@ -290,12 +331,10 @@ - true DeviceInterface - true true 1 fortyGigE0/0 @@ -308,7 +347,6 @@ DeviceInterface - true true 1 Ethernet1 @@ -321,7 +359,6 @@ DeviceInterface - true true 1 Ethernet2 @@ -334,7 +371,6 @@ DeviceInterface - true true 1 fortyGigE0/4 @@ -347,7 +383,6 @@ DeviceInterface - true true 1 fortyGigE0/8 @@ -361,7 +396,6 @@ DeviceInterface - true true 1 fortyGigE0/12 @@ -372,6 +406,18 @@ 100000 Interface description + + DeviceInterface + + true + 1 + fortyGigE0/16 + + false + 0 + 0 + 100000 + true 0 @@ -380,7 +426,6 @@ DeviceInterface - true 1 Management1 false diff --git a/src/sonic-config-engine/tests/t0-sample-autoneg-port-config.ini b/src/sonic-config-engine/tests/t0-sample-autoneg-port-config.ini new file mode 100644 index 000000000000..91555c6e111e --- /dev/null +++ b/src/sonic-config-engine/tests/t0-sample-autoneg-port-config.ini @@ -0,0 +1,33 @@ +# name lanes alias autoneg +Ethernet0 29,30,31,32 fortyGigE0/0 0 +Ethernet4 25,26,27,28 fortyGigE0/4 0 +Ethernet8 37,38,39,40 fortyGigE0/8 0 +Ethernet12 33,34,35,36 fortyGigE0/12 0 +Ethernet16 41,42,43,44 fortyGigE0/16 0 +Ethernet20 45,46,47,48 fortyGigE0/20 0 +Ethernet24 5,6,7,8 fortyGigE0/24 0 +Ethernet28 1,2,3,4 fortyGigE0/28 0 +Ethernet32 9,10,11,12 fortyGigE0/32 0 +Ethernet36 13,14,15,16 fortyGigE0/36 0 +Ethernet40 21,22,23,24 fortyGigE0/40 0 +Ethernet44 17,18,19,20 fortyGigE0/44 0 +Ethernet48 49,50,51,52 fortyGigE0/48 0 +Ethernet52 53,54,55,56 fortyGigE0/52 0 +Ethernet56 61,62,63,64 fortyGigE0/56 0 +Ethernet60 57,58,59,60 fortyGigE0/60 0 +Ethernet64 65,66,67,68 fortyGigE0/64 0 +Ethernet68 69,70,71,72 fortyGigE0/68 0 +Ethernet72 77,78,79,80 fortyGigE0/72 0 +Ethernet76 73,74,75,76 fortyGigE0/76 0 +Ethernet80 105,106,107,108 fortyGigE0/80 0 +Ethernet84 109,110,111,112 fortyGigE0/84 0 +Ethernet88 117,118,119,120 fortyGigE0/88 0 +Ethernet92 113,114,115,116 fortyGigE0/92 0 +Ethernet96 121,122,123,124 fortyGigE0/96 0 +Ethernet100 125,126,127,128 fortyGigE0/100 0 +Ethernet104 85,86,87,88 fortyGigE0/104 0 +Ethernet108 81,82,83,84 fortyGigE0/108 0 +Ethernet112 89,90,91,92 fortyGigE0/112 1 +Ethernet116 93,94,95,96 fortyGigE0/116 1 +Ethernet120 97,98,99,100 fortyGigE0/120 1 +Ethernet124 101,102,103,104 fortyGigE0/124 1 diff --git a/src/sonic-config-engine/tests/t0-sample-graph-mvrf.xml b/src/sonic-config-engine/tests/t0-sample-graph-mvrf.xml index ee633c18bd1e..e7e2b5789816 100644 --- a/src/sonic-config-engine/tests/t0-sample-graph-mvrf.xml +++ b/src/sonic-config-engine/tests/t0-sample-graph-mvrf.xml @@ -355,7 +355,6 @@
DeviceInterfaceLink - true 10000 switch-t0 fortyGigE0/2 @@ -408,6 +407,21 @@ + + + + + + + AutoNegotiation + + True + + + ARISTA05T1:Ethernet1/33;switch-t0:fortyGigE0/2 + + + switch-t0 Force10-S6000 diff --git a/src/sonic-config-engine/tests/t0-sample-graph.xml b/src/sonic-config-engine/tests/t0-sample-graph.xml index 237a2ff0f532..88d325b09d1b 100644 --- a/src/sonic-config-engine/tests/t0-sample-graph.xml +++ b/src/sonic-config-engine/tests/t0-sample-graph.xml @@ -185,6 +185,22 @@ 10.10.0.99/32 + + LoopbackIP2 + Loopback2 + + 10.21.0.64/32 + + 10.21.0.64/32 + + + LoopbackIP3 + Loopback3 + + 10.21.64.2/32 + + 10.21.64.2/32 + @@ -237,11 +253,58 @@ fortyGigE0/4;fortyGigE0/8;fortyGigE0/12;fortyGigE0/16;fortyGigE0/20;fortyGigE0/24;fortyGigE0/28;fortyGigE0/32;fortyGigE0/36;fortyGigE0/40;fortyGigE0/44;fortyGigE0/48;fortyGigE0/52;fortyGigE0/56;fortyGigE0/60;fortyGigE0/64;fortyGigE0/68;fortyGigE0/72;fortyGigE0/76;fortyGigE0/80;fortyGigE0/84;fortyGigE0/88;fortyGigE0/92;fortyGigE0/96 False 0.0.0.0/0 + 192.0.0.1;192.0.0.2 + fc02:2000::1;fc02:2000::2 1000 1000 192.168.0.0/27 + + + + + Vlan2000 + fortyGigE0/112;fortyGigE0/116;fortyGigE0/120 + False + 0.0.0.0/0 + + + 192.0.0.3;192.0.0.4 + fc02:2000::3;fc02:2000::4 + 2000 + 2000 + 192.168.200.0/27 + + + + + Vlan99 + fortyGigE0/100 + False + 0.0.0.0/0 + + UserDefinedL2Vlan + 192.0.0.1;192.0.0.2 + 99 + 99 + + + + + + Vlan98 + fortyGigE0/100;PortChannel01;PortChannel03 + False + 0.0.0.0/0 + + UserDefinedL2Vlan + 192.0.0.1;192.0.0.2 + 98 + 98 + + + @@ -290,6 +353,11 @@ Vlan1000 192.168.0.1/27 + + + Vlan2000 + 192.168.200.1/27 + @@ -314,7 +382,7 @@ DataPlane - PortChannel01;PortChannel02 + PortChannel01;PortChannel02;Vlan98 DataAclEgress DataPlane @@ -385,7 +453,6 @@ DeviceInterfaceLink - true 100000 switch-t0 fortyGigE0/4 @@ -452,6 +519,11 @@ + + AutoNegotiation + + True + FECDisabled @@ -463,6 +535,11 @@ + + AutoNegotiation + + False + FECDisabled diff --git a/src/sonic-config-engine/tests/t0-sample-no-ip-helper-graph.xml b/src/sonic-config-engine/tests/t0-sample-no-ip-helper-graph.xml new file mode 100644 index 000000000000..b02304a49e14 --- /dev/null +++ b/src/sonic-config-engine/tests/t0-sample-no-ip-helper-graph.xml @@ -0,0 +1,938 @@ + + + + + + switch-t0 + 10.1.0.32 + BGPMonitor + 10.20.30.40 + 30 + 10 + 3 + + + false + switch-t0 + 10.0.0.56 + ARISTA01T1 + 10.0.0.57 + 1 + 180 + 60 + + + switch-t0 + FC00::71 + ARISTA01T1 + FC00::72 + 1 + 180 + 60 + + + false + switch-t0 + 10.0.0.58 + ARISTA02T1 + 10.0.0.59 + 1 + 180 + 60 + + + switch-t0 + FC00::75 + ARISTA02T1 + FC00::76 + 1 + 180 + 60 + + + false + switch-t0 + 10.0.0.60 + ARISTA03T1 + 10.0.0.61 + 1 + 180 + 60 + + + switch-t0 + FC00::79 + ARISTA03T1 + FC00::7A + 1 + 180 + 60 + + + false + switch-t0 + 10.0.0.62 + ARISTA04T1 + 10.0.0.63 + 1 + 180 + 60 + + + switch-t0 + FC00::7D + ARISTA04T1 + FC00::7E + 1 + 180 + 60 + + + + + 1 + + BGPMonitor + + + BGPPeer +
10.1.0.32
+ + + +
+
+ +
+ + 65100 + switch-t0 + + +
10.0.0.57
+ + + +
+ +
10.0.0.59
+ + + +
+ +
10.0.0.61
+ + + +
+ +
10.0.0.63
+ + + +
+
+ +
+ + 64600 + ARISTA01T1 + + + + 64600 + ARISTA02T1 + + + + 64600 + ARISTA03T1 + + + + 64600 + ARISTA04T1 + + +
+
+ + + + + + HostIP + Loopback0 + + 10.1.0.32/32 + + 10.1.0.32/32 + + + HostIP1 + Loopback0 + + FC00:1::32/128 + + FC00:1::32/128 + + + LoopbackIP1 + Loopback1 + + 10.10.0.99/32 + + 10.10.0.99/32 + + + LoopbackIP2 + Loopback2 + + 10.21.0.64/32 + + 10.21.0.64/32 + + + LoopbackIP3 + Loopback3 + + 10.21.64.2/32 + + 10.21.64.2/32 + + + + + HostIP + eth0 + + 10.0.0.100/24 + + 10.0.0.100/24 + + + HostIP + eth0 + + 2603:10e2:0:2902::8/64 + + 2603:10e2:0:2902::8/64 + + + + + + + switch-t0 + + + PortChannel01 + fortyGigE0/112 + + + + PortChannel02 + fortyGigE0/116 + + + + PortChannel03 + fortyGigE0/120 + + + + PortChannel04 + fortyGigE0/124 + + + + + + Vlan1000 + fortyGigE0/4;fortyGigE0/8;fortyGigE0/12;fortyGigE0/16;fortyGigE0/20;fortyGigE0/24;fortyGigE0/28;fortyGigE0/32;fortyGigE0/36;fortyGigE0/40;fortyGigE0/44;fortyGigE0/48;fortyGigE0/52;fortyGigE0/56;fortyGigE0/60;fortyGigE0/64;fortyGigE0/68;fortyGigE0/72;fortyGigE0/76;fortyGigE0/80;fortyGigE0/84;fortyGigE0/88;fortyGigE0/92;fortyGigE0/96 + False + 0.0.0.0/0 + + + 192.0.0.1;192.0.0.2 + fc02:2000::1;fc02:2000::2 + 1000 + 1000 + 192.168.0.0/27 + + + + + Vlan2000 + fortyGigE0/112;fortyGigE0/116;fortyGigE0/120 + False + 0.0.0.0/0 + + + + + 2000 + 2000 + 192.168.200.0/27 + + + + + Vlan99 + fortyGigE0/100 + False + 0.0.0.0/0 + + UserDefinedL2Vlan + 192.0.0.1;192.0.0.2 + 99 + 99 + + + + + + Vlan98 + fortyGigE0/100;PortChannel01;PortChannel03 + False + 0.0.0.0/0 + + UserDefinedL2Vlan + 192.0.0.1;192.0.0.2 + 98 + 98 + + + + + + + + + PortChannel01 + 10.0.0.56/31 + + + + PortChannel01 + FC00::71/126 + + + + PortChannel02 + 10.0.0.58/31 + + + + PortChannel02 + FC00::75/126 + + + + PortChannel03 + 10.0.0.60/31 + + + + PortChannel03 + FC00::79/126 + + + + PortChannel04 + 10.0.0.62/31 + + + + PortChannel04 + FC00::7D/126 + + + + Vlan1000 + 192.168.0.1/27 + + + + Vlan2000 + 192.168.200.1/27 + + + + + + ERSPAN + everflow + Everflow + + + ERSPANv6 + everflowV6 + Everflow + + + EGRESS_ERSPAN + everflow_egress + Everflow + + + PortChannel01;PortChannel02;PortChannel03;PortChannel04 + DataAclIngress + DataPlane + + + PortChannel01;PortChannel02;Vlan98 + DataAclEgress + DataPlane + + + SNMP + SNMP_ACL + SNMP + + + NTP + NTP_ACL + NTP + + + SSH + SSH_ACL + SSH + + + SSH + ROUTER-PROTECT + SSH + + + SNMP + ROUTER-PROTECT + SNMP + + + NTP + NTP_ACL + + + + + + + + + + DeviceInterfaceLink + ARISTA01T1 + Ethernet1/1 + switch-t0 + fortyGigE0/112 + + + DeviceInterfaceLink + ARISTA02T1 + Ethernet1/1 + switch-t0 + fortyGigE0/116 + + + DeviceInterfaceLink + ARISTA03T1 + Ethernet1/1 + switch-t0 + fortyGigE0/120 + + + DeviceInterfaceLink + ARISTA04T1 + Ethernet1/1 + switch-t0 + fortyGigE0/124 + 100000 + + + DeviceInterfaceLink + 100000 + switch-t0 + fortyGigE0/4 + true + ARISTA05T1 + Ethernet1/33 + true + + + DeviceInterfaceLink + Servers0 + eth0 + switch-t0 + fortyGigE0/4 + + + DeviceInterfaceLink + Servers100 + eth0 + switch-t0 + fortyGigE0/100 + + + + + switch-t0 + Force10-S6000 + + + ARISTA01T1 + Arista + + + ARISTA02T1 + Arista + + + ARISTA03T1 + Arista + + + ARISTA04T1 + Arista + + + + + + + + DeviceInterface + + true + 1 + Ethernet0 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet8 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet12 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet16 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet20 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet24 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet28 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet32 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet36 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet40 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet44 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet48 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet52 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet56 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet60 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet64 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet68 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet72 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet76 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet80 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet84 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet88 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet92 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet96 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet100 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet104 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet108 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet112 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet116 + + false + 0 + 0 + 40000 + + + DeviceInterface + + true + 1 + Ethernet120 + + false + 0 + 0 + 40000 + + + Force10-S6000 + + + + + + + switch-t0 + + + ErspanDestinationIpv4 + + 2.2.2.2 + + + + + + + + + + + + + AutoNegotiation + + True + + + FECDisabled + + True + + + ARISTA05T1:Ethernet1/33;switch-t0:fortyGigE0/4 + + + + + + AutoNegotiation + + False + + + FECDisabled + + True + + + ARISTA06T1:Ethernet1/34;switch-t0:fortyGigE0/8 + + + + + + + switch-t0 + + + DeploymentId + + 1 + + + + + + + switch-t0 + Force10-S6000 +
diff --git a/src/sonic-config-engine/tests/t0_7050cx3_d48c8_port_config.ini b/src/sonic-config-engine/tests/t0_7050cx3_d48c8_port_config.ini new file mode 100644 index 000000000000..485905d9fcde --- /dev/null +++ b/src/sonic-config-engine/tests/t0_7050cx3_d48c8_port_config.ini @@ -0,0 +1,57 @@ +# name lanes alias index speed +Ethernet0 1,2 Ethernet1/1 1 50000 +Ethernet2 3,4 Ethernet1/3 1 50000 +Ethernet4 5,6 Ethernet2/1 2 50000 +Ethernet6 7,8 Ethernet2/3 2 50000 +Ethernet8 9,10 Ethernet3/1 3 50000 +Ethernet10 11,12 Ethernet3/3 3 50000 +Ethernet12 13,14 Ethernet4/1 4 50000 +Ethernet14 15,16 Ethernet4/3 4 50000 +Ethernet16 21,22 Ethernet5/1 5 50000 +Ethernet18 23,24 Ethernet5/3 5 50000 +Ethernet20 17,18 Ethernet6/1 6 50000 +Ethernet22 19,20 Ethernet6/3 6 50000 +Ethernet24 25,26,27,28 Ethernet7/1 7 100000 +Ethernet28 29,30,31,32 Ethernet8/1 8 100000 +Ethernet32 37,38,39,40 Ethernet9/1 9 100000 +Ethernet36 33,34,35,36 Ethernet10/1 10 100000 +Ethernet40 41,42 Ethernet11/1 11 50000 +Ethernet42 43,44 Ethernet11/3 11 50000 +Ethernet44 45,46 Ethernet12/1 12 50000 +Ethernet46 47,48 Ethernet12/3 12 50000 +Ethernet48 53,54 Ethernet13/1 13 50000 +Ethernet50 55,56 Ethernet13/3 13 50000 +Ethernet52 49,50 Ethernet14/1 14 50000 +Ethernet54 51,52 Ethernet14/3 14 50000 +Ethernet56 57,58 Ethernet15/1 15 50000 +Ethernet58 59,60 Ethernet15/3 15 50000 +Ethernet60 61,62 Ethernet16/1 16 50000 +Ethernet62 63,64 Ethernet16/3 16 50000 +Ethernet64 69,70 Ethernet17/1 17 50000 +Ethernet66 71,72 Ethernet17/3 17 50000 +Ethernet68 65,66 Ethernet18/1 18 50000 +Ethernet70 67,68 Ethernet18/3 18 50000 +Ethernet72 73,74 Ethernet19/1 19 50000 +Ethernet74 75,76 Ethernet19/3 19 50000 +Ethernet76 77,78 Ethernet20/1 20 50000 +Ethernet78 79,80 Ethernet20/3 20 50000 +Ethernet80 85,86 Ethernet21/1 21 50000 +Ethernet82 87,88 Ethernet21/3 21 50000 +Ethernet84 81,82 Ethernet22/1 22 50000 +Ethernet86 83,84 Ethernet22/3 22 50000 +Ethernet88 89,90,91,92 Ethernet23/1 23 100000 +Ethernet92 93,94,95,96 Ethernet24/1 24 100000 +Ethernet96 101,102,103,104 Ethernet25/1 25 100000 +Ethernet100 97,98,99,100 Ethernet26/1 26 100000 +Ethernet104 105,106 Ethernet27/1 27 50000 +Ethernet106 107,108 Ethernet27/3 27 50000 +Ethernet108 109,110 Ethernet28/1 28 50000 +Ethernet110 111,112 Ethernet28/3 28 50000 +Ethernet112 117,118 Ethernet29/1 29 50000 +Ethernet114 119,120 Ethernet29/3 29 50000 +Ethernet116 113,114 Ethernet30/1 30 50000 +Ethernet118 115,116 Ethernet30/3 30 50000 +Ethernet120 121,122 Ethernet31/1 31 50000 +Ethernet122 123,124 Ethernet31/3 31 50000 +Ethernet124 125,126 Ethernet32/1 32 50000 +Ethernet126 127,128 Ethernet32/3 32 50000 \ No newline at end of file diff --git a/src/sonic-config-engine/tests/t1-sample-graph-mlnx.xml b/src/sonic-config-engine/tests/t1-sample-graph-mlnx.xml index 04fc88c34370..cc6f5e95940b 100644 --- a/src/sonic-config-engine/tests/t1-sample-graph-mlnx.xml +++ b/src/sonic-config-engine/tests/t1-sample-graph-mlnx.xml @@ -1745,12 +1745,10 @@ - true DeviceInterface - true true 1 Ethernet0 @@ -1763,7 +1761,6 @@ DeviceInterface - true true 1 Ethernet4 @@ -1776,7 +1773,6 @@ DeviceInterface - true true 1 Ethernet8 @@ -1789,7 +1785,6 @@ DeviceInterface - true true 1 Ethernet12 @@ -1802,7 +1797,6 @@ DeviceInterface - true true 1 Ethernet16 @@ -1815,7 +1809,6 @@ DeviceInterface - true true 1 Ethernet20 @@ -1828,7 +1821,6 @@ DeviceInterface - true true 1 Ethernet24 @@ -1841,7 +1833,6 @@ DeviceInterface - true true 1 Ethernet28 @@ -1854,7 +1845,6 @@ DeviceInterface - true true 1 Ethernet32 @@ -1867,7 +1857,6 @@ DeviceInterface - true true 1 Ethernet36 @@ -1880,7 +1869,6 @@ DeviceInterface - true true 1 Ethernet40 @@ -1893,7 +1881,6 @@ DeviceInterface - true true 1 Ethernet44 @@ -1906,7 +1893,6 @@ DeviceInterface - true true 1 Ethernet48 @@ -1919,7 +1905,6 @@ DeviceInterface - true true 1 Ethernet52 @@ -1932,7 +1917,6 @@ DeviceInterface - true true 1 Ethernet56 @@ -1945,7 +1929,6 @@ DeviceInterface - true true 1 Ethernet60 @@ -1958,7 +1941,6 @@ DeviceInterface - true true 1 Ethernet64 @@ -1971,7 +1953,6 @@ DeviceInterface - true true 1 Ethernet68 @@ -1984,7 +1965,6 @@ DeviceInterface - true true 1 Ethernet72 @@ -1997,7 +1977,6 @@ DeviceInterface - true true 1 Ethernet76 @@ -2010,7 +1989,6 @@ DeviceInterface - true true 1 Ethernet80 @@ -2023,7 +2001,6 @@ DeviceInterface - true true 1 Ethernet84 @@ -2036,7 +2013,6 @@ DeviceInterface - true true 1 Ethernet88 @@ -2049,7 +2025,6 @@ DeviceInterface - true true 1 Ethernet92 @@ -2062,7 +2037,6 @@ DeviceInterface - true true 1 Ethernet96 @@ -2075,7 +2049,6 @@ DeviceInterface - true true 1 Ethernet100 @@ -2088,7 +2061,6 @@ DeviceInterface - true true 1 Ethernet104 @@ -2101,7 +2073,6 @@ DeviceInterface - true true 1 Ethernet108 @@ -2114,7 +2085,6 @@ DeviceInterface - true true 1 Ethernet112 @@ -2127,7 +2097,6 @@ DeviceInterface - true true 1 Ethernet116 @@ -2140,7 +2109,6 @@ DeviceInterface - true true 1 Ethernet120 @@ -2153,7 +2121,6 @@ DeviceInterface - true true 1 Ethernet124 @@ -2235,6 +2202,362 @@ + + + + + + + AutoNegotiation + + True + + + ARISTA01T2:Ethernet1;arc-switch1026:Ethernet0 + + + + + + AutoNegotiation + + True + + + ARISTA02T2:Ethernet1;arc-switch1026:Ethernet4 + + + + + + AutoNegotiation + + True + + + ARISTA03T2:Ethernet1;arc-switch1026:Ethernet8 + + + + + + AutoNegotiation + + True + + + ARISTA04T2:Ethernet1;arc-switch1026:Ethernet12 + + + + + + AutoNegotiation + + True + + + ARISTA05T2:Ethernet1;arc-switch1026:Ethernet16 + + + + + + AutoNegotiation + + True + + + ARISTA06T2:Ethernet1;arc-switch1026:Ethernet20 + + + + + + AutoNegotiation + + True + + + ARISTA07T2:Ethernet1;arc-switch1026:Ethernet24 + + + + + + AutoNegotiation + + True + + + ARISTA08T2:Ethernet1;arc-switch1026:Ethernet28 + + + + + + AutoNegotiation + + True + + + ARISTA09T2:Ethernet1;arc-switch1026:Ethernet32 + + + + + + AutoNegotiation + + True + + + ARISTA10T2:Ethernet1;arc-switch1026:Ethernet36 + + + + + + AutoNegotiation + + True + + + ARISTA11T2:Ethernet1;arc-switch1026:Ethernet40 + + + + + + AutoNegotiation + + True + + + ARISTA12T2:Ethernet1;arc-switch1026:Ethernet44 + + + + + + AutoNegotiation + + True + + + ARISTA13T2:Ethernet1;arc-switch1026:Ethernet48 + + + + + + AutoNegotiation + + True + + + ARISTA14T2:Ethernet1;arc-switch1026:Ethernet52 + + + + + + AutoNegotiation + + True + + + ARISTA15T2:Ethernet1;arc-switch1026:Ethernet56 + + + + + + AutoNegotiation + + True + + + ARISTA16T2:Ethernet1;arc-switch1026:Ethernet60 + + + + + + AutoNegotiation + + True + + + ARISTA01T0:Ethernet1;arc-switch1026:Ethernet64 + + + + + + AutoNegotiation + + True + + + ARISTA02T0:Ethernet1;arc-switch1026:Ethernet68 + + + + + + AutoNegotiation + + True + + + ARISTA03T0:Ethernet1;arc-switch1026:Ethernet72 + + + + + + AutoNegotiation + + True + + + ARISTA04T0:Ethernet1;arc-switch1026:Ethernet76 + + + + + + AutoNegotiation + + True + + + ARISTA05T0:Ethernet1;arc-switch1026:Ethernet80 + + + + + + AutoNegotiation + + True + + + ARISTA06T0:Ethernet1;arc-switch1026:Ethernet84 + + + + + + AutoNegotiation + + True + + + ARISTA07T0:Ethernet1;arc-switch1026:Ethernet88 + + + + + + AutoNegotiation + + True + + + ARISTA08T0:Ethernet1;arc-switch1026:Ethernet92 + + + + + + AutoNegotiation + + True + + + ARISTA09T0:Ethernet1;arc-switch1026:Ethernet96 + + + + + + AutoNegotiation + + True + + + ARISTA10T0:Ethernet1;arc-switch1026:Ethernet100 + + + + + + AutoNegotiation + + True + + + ARISTA11T0:Ethernet1;arc-switch1026:Ethernet104 + + + + + + AutoNegotiation + + True + + + ARISTA12T0:Ethernet1;arc-switch1026:Ethernet108 + + + + + + AutoNegotiation + + True + + + ARISTA13T0:Ethernet1;arc-switch1026:Ethernet112 + + + + + + AutoNegotiation + + True + + + ARISTA14T0:Ethernet1;arc-switch1026:Ethernet116 + + + + + + AutoNegotiation + + True + + + ARISTA15T0:Ethernet1;arc-switch1026:Ethernet120 + + + + + + AutoNegotiation + + True + + + ARISTA16T0:Ethernet1;arc-switch1026:Ethernet124 + + + arc-switch1026 ACS-MSN2700 diff --git a/src/sonic-config-engine/tests/t2-chassis-fe-graph-pc.xml b/src/sonic-config-engine/tests/t2-chassis-fe-graph-pc.xml index 3fb744ce91fd..bc1a5142fc86 100644 --- a/src/sonic-config-engine/tests/t2-chassis-fe-graph-pc.xml +++ b/src/sonic-config-engine/tests/t2-chassis-fe-graph-pc.xml @@ -223,12 +223,10 @@ - true DeviceInterface - true false 1 Ethernet0 @@ -241,7 +239,6 @@ DeviceInterface - true false 1 Ethernet4 @@ -254,7 +251,6 @@ DeviceInterface - true false 1 Ethernet8 @@ -267,7 +263,6 @@ DeviceInterface - true false 1 Ethernet12 @@ -280,7 +275,6 @@ DeviceInterface - true false 1 Ethernet16 @@ -293,7 +287,6 @@ DeviceInterface - true false 1 Ethernet20 @@ -319,6 +312,76 @@ + + + + + + + AutoNegotiation + + True + + + SpineFront01:Ethernet0;Leaf01:Ethernet0 + + + + + + AutoNegotiation + + True + + + SpineFront01:Ethernet4;Leaf01:Ethernet4 + + + + + + AutoNegotiation + + True + + + SpineFront01:Ethernet8;SpineBack01:Ethernet8 + + + + + + AutoNegotiation + + True + + + SpineFront01:Ethernet12;SpineBack01:Ethernet12 + + + + + + AutoNegotiation + + True + + + SpineFront01:Ethernet16;SpineBack02:Ethernet16 + + + + + + AutoNegotiation + + True + + + SpineFront01:Ethernet20;SpineBack02:Ethernet20 + + + SpineFront01 Force10-S6000 diff --git a/src/sonic-config-engine/tests/t2-chassis-fe-graph-vni.xml b/src/sonic-config-engine/tests/t2-chassis-fe-graph-vni.xml index f820b180f701..0dc534b3de88 100644 --- a/src/sonic-config-engine/tests/t2-chassis-fe-graph-vni.xml +++ b/src/sonic-config-engine/tests/t2-chassis-fe-graph-vni.xml @@ -187,12 +187,10 @@ - true DeviceInterface - true false 1 Ethernet0 @@ -205,7 +203,6 @@ DeviceInterface - true false 1 Ethernet4 @@ -218,7 +215,6 @@ DeviceInterface - true false 1 Ethernet8 @@ -244,6 +240,43 @@ + + + + + + + AutoNegotiation + + True + + + SpineFront01:Ethernet0;Leaf01:Ethernet4 + + + + + + AutoNegotiation + + True + + + SpineFront01:Ethernet4;SpineBack01:Ethernet0 + + + + + + AutoNegotiation + + True + + + SpineFront01:Ethernet8;SpineBack02:Ethernet4 + + + SpineFront01 Force10-S6000 diff --git a/src/sonic-config-engine/tests/t2-chassis-fe-graph.xml b/src/sonic-config-engine/tests/t2-chassis-fe-graph.xml index 76320b766be5..3b0c56a57a70 100644 --- a/src/sonic-config-engine/tests/t2-chassis-fe-graph.xml +++ b/src/sonic-config-engine/tests/t2-chassis-fe-graph.xml @@ -186,12 +186,10 @@ - true DeviceInterface - true false 1 Ethernet0 @@ -204,7 +202,6 @@ DeviceInterface - true false 1 Ethernet4 @@ -217,7 +214,6 @@ DeviceInterface - true false 1 Ethernet8 @@ -243,6 +239,43 @@ + + + + + + + AutoNegotiation + + True + + + SpineFront01:Ethernet0;Leaf01:Ethernet4 + + + + + + AutoNegotiation + + True + + + SpineFront01:Ethernet4;SpineBack01:Ethernet0 + + + + + + AutoNegotiation + + True + + + SpineFront01:Ethernet8;SpineBack02:Ethernet4 + + + SpineFront01 Force10-S6000 diff --git a/src/sonic-config-engine/tests/test_cfggen.py b/src/sonic-config-engine/tests/test_cfggen.py index 3a85346de2fd..605b70f9e61e 100644 --- a/src/sonic-config-engine/tests/test_cfggen.py +++ b/src/sonic-config-engine/tests/test_cfggen.py @@ -8,6 +8,8 @@ TOR_ROUTER = 'ToRRouter' BACKEND_TOR_ROUTER = 'BackEndToRRouter' +LEAF_ROUTER = 'LeafRouter' +BACKEND_LEAF_ROUTER = 'BackEndLeafRouter' class TestCfgGen(TestCase): @@ -23,12 +25,19 @@ def setUp(self): self.sample_graph_bgp_speaker = os.path.join(self.test_dir, 't0-sample-bgp-speaker.xml') self.sample_device_desc = os.path.join(self.test_dir, 'device.xml') self.port_config = os.path.join(self.test_dir, 't0-sample-port-config.ini') + self.port_config_autoneg = os.path.join(self.test_dir, 't0-sample-autoneg-port-config.ini') self.mlnx_port_config = os.path.join(self.test_dir, 'mellanox-sample-port-config.ini') self.output_file = os.path.join(self.test_dir, 'output') self.output2_file = os.path.join(self.test_dir, 'output2') self.ecmp_graph = os.path.join(self.test_dir, 'fg-ecmp-sample-minigraph.xml') + self.sample_resource_graph = os.path.join(self.test_dir, 'sample-graph-resource-type.xml') + self.sample_subintf_graph = os.path.join(self.test_dir, 'sample-graph-subintf.xml') + self.sample_backend_graph = os.path.join(self.test_dir, 'sample-graph-storage-backend.xml') + # To ensure that mock config_db data is used for unit-test cases + os.environ["CFGGEN_UNIT_TESTING"] = "2" def tearDown(self): + os.environ["CFGGEN_UNIT_TESTING"] = "" try: os.remove(self.output_file) os.remove(self.output2_file) @@ -87,6 +96,11 @@ def test_minigraph_resourcetype(self): output = self.run_script(argument) self.assertEqual(output.strip(), 'resource_type_x') + def test_minigraph_downstream_subrole(self): + argument = '-v "DEVICE_METADATA[\'localhost\'][\'downstream_subrole\']" -m "' + self.sample_graph_metadata + '"' + output = self.run_script(argument) + self.assertEqual(output.strip(), 'downstream_subrole_y') + def test_print_data(self): argument = '-m "' + self.sample_graph + '" --print-data' output = self.run_script(argument) @@ -114,16 +128,33 @@ def test_additional_json_data_level2_key(self): output = self.run_script(argument) self.assertEqual(utils.to_dict(output.strip()), utils.to_dict('{\n "k11": "v11"\n}')) - def test_var_json_data(self): - argument = '-m "' + self.sample_graph_simple + '" -p "' + self.port_config + '" --var-json VLAN_MEMBER' + def test_var_json_data(self, **kwargs): + graph_file = kwargs.get('graph_file', self.sample_graph_simple) + tag_mode = kwargs.get('tag_mode', 'untagged') + argument = '-m "' + graph_file + '" -p "' + self.port_config + '" --var-json VLAN_MEMBER' output = self.run_script(argument) - self.assertEqual( - utils.to_dict(output.strip()), - utils.to_dict( - '{\n "Vlan1000|Ethernet8": {\n "tagging_mode": "untagged"\n },' - ' \n "Vlan2020|Ethernet12": {\n "tagging_mode": "tagged"\n }\n}' + if tag_mode == "tagged": + self.assertEqual( + utils.to_dict(output.strip()), + utils.to_dict( + '{\n "Vlan1000|Ethernet8": {\n "tagging_mode": "tagged"\n },' + ' \n "Vlan1001|Ethernet8": {\n "tagging_mode": "tagged"\n },' + ' \n "Vlan2000|Ethernet12": {\n "tagging_mode": "tagged"\n },' + ' \n "Vlan2001|Ethernet12": {\n "tagging_mode": "tagged"\n },' + ' \n "Vlan2020|Ethernet12": {\n "tagging_mode": "tagged"\n }\n}' + ) + ) + else: + self.assertEqual( + utils.to_dict(output.strip()), + utils.to_dict( + '{\n "Vlan1000|Ethernet8": {\n "tagging_mode": "tagged"\n },' + ' \n "Vlan1001|Ethernet8": {\n "tagging_mode": "tagged"\n },' + ' \n "Vlan2000|Ethernet12": {\n "tagging_mode": "tagged"\n },' + ' \n "Vlan2001|Ethernet12": {\n "tagging_mode": "untagged"\n },' + ' \n "Vlan2020|Ethernet12": {\n "tagging_mode": "tagged"\n }\n}' + ) ) - ) def test_read_yaml(self): argument = '-v yml_item -y ' + os.path.join(self.test_dir, 'test.yml') @@ -175,7 +206,7 @@ def test_minigraph_acl(self): "'DATAACLINGRESS': {'stage': 'ingress', 'type': 'L3', 'ports': ['PortChannel01', 'PortChannel02', 'PortChannel03', 'PortChannel04'], 'policy_desc': 'DATAACLINGRESS'}, " "'SNMP_ACL': {'services': ['SNMP'], 'type': 'CTRLPLANE', 'policy_desc': 'SNMP_ACL', 'stage': 'ingress'}, " "'SSH_ACL': {'services': ['SSH'], 'type': 'CTRLPLANE', 'policy_desc': 'SSH_ACL', 'stage': 'ingress'}, " - "'DATAACLEGRESS': {'stage': 'egress', 'type': 'L3', 'ports': ['PortChannel01', 'PortChannel02'], 'policy_desc': 'DATAACLEGRESS'}, " + "'DATAACLEGRESS': {'stage': 'egress', 'type': 'L3', 'ports': ['PortChannel01', 'PortChannel02', 'Ethernet100', 'PortChannel03'], 'policy_desc': 'DATAACLEGRESS'}, " "'EVERFLOWV6': {'stage': 'ingress', 'type': 'MIRRORV6', 'ports': ['PortChannel01', 'PortChannel02', 'PortChannel03', 'PortChannel04', 'Ethernet4', 'Ethernet100'], 'policy_desc': 'EVERFLOWV6'}}" ) ) @@ -199,35 +230,64 @@ def test_minigraph_interfaces(self): output = self.run_script(argument) self.assertEqual(output.strip(), "[('Ethernet0', '10.0.0.58/31'), 'Ethernet0', ('Ethernet0', 'FC00::75/126')]") - def test_minigraph_vlans(self): - argument = '-m "' + self.sample_graph_simple + '" -p "' + self.port_config + '" -v VLAN' + def test_minigraph_vlans(self, **kwargs): + graph_file = kwargs.get('graph_file', self.sample_graph_simple) + argument = '-m "' + graph_file + '" -p "' + self.port_config + '" -v VLAN' output = self.run_script(argument) self.assertEqual( utils.to_dict(output.strip()), utils.to_dict( - "{'Vlan1000': {'alias': 'ab1', 'dhcp_servers': ['192.0.0.1', '192.0.0.2'], 'vlanid': '1000'}, " - "'Vlan2020': {'alias': 'kk1', 'dhcp_servers': ['192.0.0.1', '192.0.0.2'], 'vlanid': '2020'}}" + "{'Vlan1000': {'alias': 'ab1', 'dhcp_servers': ['192.0.0.1', '192.0.0.2'], 'vlanid': '1000', 'members': ['Ethernet8']}, " + "'Vlan1001': {'alias': 'ab4', 'dhcp_servers': ['192.0.0.1', '192.0.0.2'], 'vlanid': '1001', 'members': ['Ethernet8']}," + "'Vlan2001': {'alias': 'ab3', 'dhcp_servers': ['192.0.0.1', '192.0.0.2'], 'vlanid': '2001', 'members': ['Ethernet12']}," + "'Vlan2000': {'alias': 'ab2', 'dhcp_servers': ['192.0.0.1', '192.0.0.2'], 'vlanid': '2000', 'members': ['Ethernet12']}," + "'Vlan2020': {'alias': 'kk1', 'dhcp_servers': ['192.0.0.1', '192.0.0.2'], 'vlanid': '2020', 'members': ['Ethernet12']}}" ) ) - def test_minigraph_vlan_members(self): - argument = '-m "' + self.sample_graph_simple + '" -p "' + self.port_config + '" -v VLAN_MEMBER' + def test_minigraph_vlan_members(self, **kwargs): + graph_file = kwargs.get('graph_file', self.sample_graph_simple) + tag_mode = kwargs.get('tag_mode', 'untagged') + argument = '-m "' + graph_file + '" -p "' + self.port_config + '" -v VLAN_MEMBER' output = self.run_script(argument) - self.assertEqual( - output.strip(), - "{('Vlan1000', 'Ethernet8'): {'tagging_mode': 'untagged'}, " - "('Vlan2020', 'Ethernet12'): {'tagging_mode': 'tagged'}}" - ) + if tag_mode == "tagged": + self.assertEqual( + utils.to_dict(output.strip()), + utils.to_dict( + "{('Vlan2000', 'Ethernet12'): {'tagging_mode': 'tagged'}, " + "('Vlan1001', 'Ethernet8'): {'tagging_mode': 'tagged'}, " + "('Vlan1000', 'Ethernet8'): {'tagging_mode': 'tagged'}, " + "('Vlan2020', 'Ethernet12'): {'tagging_mode': 'tagged'}, " + "('Vlan2001', 'Ethernet12'): {'tagging_mode': 'tagged'}}" + ) + ) + else: + self.assertEqual( + utils.to_dict(output.strip()), + utils.to_dict( + "{('Vlan2000', 'Ethernet12'): {'tagging_mode': 'tagged'}, " + "('Vlan1000', 'Ethernet8'): {'tagging_mode': 'tagged'}, " + "('Vlan1001', 'Ethernet8'): {'tagging_mode': 'tagged'}, " + "('Vlan2020', 'Ethernet12'): {'tagging_mode': 'tagged'}, " + "('Vlan2001', 'Ethernet12'): {'tagging_mode': 'untagged'}}" + ) + ) - def test_minigraph_vlan_interfaces(self): - argument = '-m "' + self.sample_graph_simple + '" -p "' + self.port_config + '" -v "VLAN_INTERFACE.keys()|list"' + def test_minigraph_vlan_interfaces(self, **kwargs): + graph_file = kwargs.get('graph_file', self.sample_graph_simple) + argument = '-m "' + graph_file + '" -p "' + self.port_config + '" -v "VLAN_INTERFACE.keys()|list"' output = self.run_script(argument) self.assertEqual(output.strip(), "[('Vlan1000', '192.168.0.1/27'), 'Vlan1000']") def test_minigraph_ecmp_fg_nhg(self): - argument = '-m "' + self.ecmp_graph + '" -p "' + self.mlnx_port_config + '" -v \"FG_NHG.values()|list\"' + argument = '-m "' + self.ecmp_graph + '" -p "' + self.mlnx_port_config + '" -v FG_NHG' output = self.run_script(argument) - self.assertEqual(output.strip(), "[{'bucket_size': 120}, {'bucket_size': 120}]") + print(output.strip()) + self.assertEqual(utils.to_dict(output.strip()), + utils.to_dict( + "{'fgnhg_v4': {'match_mode': 'nexthop-based', 'bucket_size': 120}, " + "'fgnhg_v6': {'match_mode': 'nexthop-based', 'bucket_size': 120}}" + )) def test_minigraph_ecmp_members(self): argument = '-m "' + self.ecmp_graph + '" -p "' + self.mlnx_port_config + '" -v "FG_NHG_MEMBER.keys()|list|sort"' @@ -246,14 +306,9 @@ def test_minigraph_ecmp_neighbors(self): " 'Vlan31|200:200:200:200::2', 'Vlan31|200:200:200:200::3', 'Vlan31|200:200:200:200::4', 'Vlan31|200:200:200:200::5', " "'Vlan31|200:200:200:200::6', 'Vlan31|200:200:200:200::7', 'Vlan31|200:200:200:200::8', 'Vlan31|200:200:200:200::9']") - def test_minigraph_ecmp_prefixes(self): - argument = '-m "' + self.ecmp_graph + '" -p "' + self.mlnx_port_config + '" -v "FG_NHG_PREFIX.keys()|list|sort"' - output = self.run_script(argument) - self.assertEqual(output.strip(), "['100.50.25.12/32', 'fc:5::/128']") - - - def test_minigraph_portchannels(self): - argument = '-m "' + self.sample_graph_simple + '" -p "' + self.port_config + '" -v PORTCHANNEL' + def test_minigraph_portchannels(self, **kwargs): + graph_file = kwargs.get('graph_file', self.sample_graph_simple) + argument = '-m "' + graph_file + '" -p "' + self.port_config + '" -v PORTCHANNEL' output = self.run_script(argument) self.assertEqual( utils.to_dict(output.strip()), @@ -323,7 +378,90 @@ def test_minigraph_port_fec_disabled(self): output = self.run_script(argument) self.assertEqual( utils.to_dict(output.strip()), - utils.to_dict("{'lanes': '25,26,27,28', 'description': 'Servers0:eth0', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/4', 'admin_status': 'up', 'speed': '100000'}") + utils.to_dict("{'lanes': '25,26,27,28', 'description': 'Servers0:eth0', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/4', 'admin_status': 'up', 'speed': '100000', 'autoneg': '1', 'fec': 'none'}") + ) + + def test_minigraph_port_autonegotiation(self): + # Test with a port_config.ini file which doesn't have an 'autoneg' column + argument = '-m "' + self.sample_graph_t0 + '" -p "' + self.port_config + '" -v "PORT"' + output = self.run_script(argument) + self.assertEqual( + utils.to_dict(output.strip()), + utils.to_dict( + "{'Ethernet0': {'alias': 'fortyGigE0/0', 'pfc_asym': 'off', 'lanes': '29,30,31,32', 'description': 'fortyGigE0/0', 'mtu': '9100'}, " + "'Ethernet4': {'lanes': '25,26,27,28', 'description': 'Servers0:eth0', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/4', 'admin_status': 'up', 'autoneg': '1', 'speed': '100000', 'fec': 'none'}, " + "'Ethernet8': {'lanes': '37,38,39,40', 'description': 'fortyGigE0/8', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/8', 'admin_status': 'up', 'autoneg': '0', 'fec': 'none'}, " + "'Ethernet12': {'lanes': '33,34,35,36', 'description': 'fortyGigE0/12', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/12', 'admin_status': 'up'}, " + "'Ethernet16': {'lanes': '41,42,43,44', 'description': 'fortyGigE0/16', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/16', 'admin_status': 'up'}, " + "'Ethernet20': {'lanes': '45,46,47,48', 'description': 'fortyGigE0/20', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/20', 'admin_status': 'up'}, " + "'Ethernet24': {'lanes': '5,6,7,8', 'description': 'fortyGigE0/24', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/24', 'admin_status': 'up'}, " + "'Ethernet28': {'lanes': '1,2,3,4', 'description': 'fortyGigE0/28', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/28', 'admin_status': 'up'}, " + "'Ethernet32': {'lanes': '9,10,11,12', 'description': 'fortyGigE0/32', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/32', 'admin_status': 'up'}, " + "'Ethernet36': {'lanes': '13,14,15,16', 'description': 'fortyGigE0/36', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/36', 'admin_status': 'up'}, " + "'Ethernet40': {'lanes': '21,22,23,24', 'description': 'fortyGigE0/40', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/40', 'admin_status': 'up'}, " + "'Ethernet44': {'lanes': '17,18,19,20', 'description': 'fortyGigE0/44', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/44', 'admin_status': 'up'}, " + "'Ethernet48': {'lanes': '49,50,51,52', 'description': 'fortyGigE0/48', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/48', 'admin_status': 'up'}, " + "'Ethernet52': {'lanes': '53,54,55,56', 'description': 'fortyGigE0/52', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/52', 'admin_status': 'up'}, " + "'Ethernet56': {'lanes': '61,62,63,64', 'description': 'fortyGigE0/56', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/56', 'admin_status': 'up'}, " + "'Ethernet60': {'lanes': '57,58,59,60', 'description': 'fortyGigE0/60', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/60', 'admin_status': 'up'}, " + "'Ethernet64': {'lanes': '65,66,67,68', 'description': 'fortyGigE0/64', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/64', 'admin_status': 'up'}, " + "'Ethernet68': {'lanes': '69,70,71,72', 'description': 'fortyGigE0/68', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/68', 'admin_status': 'up'}, " + "'Ethernet72': {'lanes': '77,78,79,80', 'description': 'fortyGigE0/72', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/72', 'admin_status': 'up'}, " + "'Ethernet76': {'lanes': '73,74,75,76', 'description': 'fortyGigE0/76', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/76', 'admin_status': 'up'}, " + "'Ethernet80': {'lanes': '105,106,107,108', 'description': 'fortyGigE0/80', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/80', 'admin_status': 'up'}, " + "'Ethernet84': {'lanes': '109,110,111,112', 'description': 'fortyGigE0/84', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/84', 'admin_status': 'up'}, " + "'Ethernet88': {'lanes': '117,118,119,120', 'description': 'fortyGigE0/88', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/88', 'admin_status': 'up'}, " + "'Ethernet92': {'lanes': '113,114,115,116', 'description': 'fortyGigE0/92', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/92', 'admin_status': 'up'}, " + "'Ethernet96': {'lanes': '121,122,123,124', 'description': 'fortyGigE0/96', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/96', 'admin_status': 'up'}, " + "'Ethernet100': {'lanes': '125,126,127,128', 'description': 'Servers100:eth0', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/100', 'admin_status': 'up'}, " + "'Ethernet104': {'alias': 'fortyGigE0/104', 'pfc_asym': 'off', 'lanes': '85,86,87,88', 'description': 'fortyGigE0/104', 'mtu': '9100'}, " + "'Ethernet108': {'alias': 'fortyGigE0/108', 'pfc_asym': 'off', 'lanes': '81,82,83,84', 'description': 'fortyGigE0/108', 'mtu': '9100'}, " + "'Ethernet112': {'lanes': '89,90,91,92', 'description': 'ARISTA01T1:Ethernet1/1', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/112', 'admin_status': 'up'}, " + "'Ethernet116': {'lanes': '93,94,95,96', 'description': 'ARISTA02T1:Ethernet1/1', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/116', 'admin_status': 'up'}, " + "'Ethernet120': {'lanes': '97,98,99,100', 'description': 'ARISTA03T1:Ethernet1/1', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/120', 'admin_status': 'up'}, " + "'Ethernet124': {'lanes': '101,102,103,104', 'fec': 'rs', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/124', 'admin_status': 'up', 'speed': '100000', 'description': 'ARISTA04T1:Ethernet1/1'}}" + ) + ) + + # Test with a port_config.ini file which has an 'autoneg' column + argument = '-m "' + self.sample_graph_t0 + '" -p "' + self.port_config_autoneg + '" -v "PORT"' + output = self.run_script(argument) + self.assertEqual( + utils.to_dict(output.strip()), + utils.to_dict( + "{'Ethernet0': {'lanes': '29,30,31,32', 'description': 'fortyGigE0/0', 'mtu': '9100', 'alias': 'fortyGigE0/0', 'pfc_asym': 'off', 'autoneg': '0'}, " + "'Ethernet4': {'lanes': '25,26,27,28', 'description': 'Servers0:eth0', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/4', 'admin_status': 'up', 'autoneg': '1', 'speed': '100000', 'fec': 'none'}, " + "'Ethernet8': {'lanes': '37,38,39,40', 'description': 'fortyGigE0/8', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/8', 'admin_status': 'up', 'autoneg': '0', 'fec': 'none'}, " + "'Ethernet12': {'lanes': '33,34,35,36', 'description': 'fortyGigE0/12', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/12', 'admin_status': 'up', 'autoneg': '0'}, " + "'Ethernet16': {'lanes': '41,42,43,44', 'description': 'fortyGigE0/16', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/16', 'admin_status': 'up', 'autoneg': '0'}, " + "'Ethernet20': {'lanes': '45,46,47,48', 'description': 'fortyGigE0/20', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/20', 'admin_status': 'up', 'autoneg': '0'}, " + "'Ethernet24': {'lanes': '5,6,7,8', 'description': 'fortyGigE0/24', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/24', 'admin_status': 'up', 'autoneg': '0'}, " + "'Ethernet28': {'lanes': '1,2,3,4', 'description': 'fortyGigE0/28', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/28', 'admin_status': 'up', 'autoneg': '0'}, " + "'Ethernet32': {'lanes': '9,10,11,12', 'description': 'fortyGigE0/32', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/32', 'admin_status': 'up', 'autoneg': '0'}, " + "'Ethernet36': {'lanes': '13,14,15,16', 'description': 'fortyGigE0/36', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/36', 'admin_status': 'up', 'autoneg': '0'}, " + "'Ethernet40': {'lanes': '21,22,23,24', 'description': 'fortyGigE0/40', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/40', 'admin_status': 'up', 'autoneg': '0'}, " + "'Ethernet44': {'lanes': '17,18,19,20', 'description': 'fortyGigE0/44', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/44', 'admin_status': 'up', 'autoneg': '0'}, " + "'Ethernet48': {'lanes': '49,50,51,52', 'description': 'fortyGigE0/48', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/48', 'admin_status': 'up', 'autoneg': '0'}, " + "'Ethernet52': {'lanes': '53,54,55,56', 'description': 'fortyGigE0/52', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/52', 'admin_status': 'up', 'autoneg': '0'}, " + "'Ethernet56': {'lanes': '61,62,63,64', 'description': 'fortyGigE0/56', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/56', 'admin_status': 'up', 'autoneg': '0'}, " + "'Ethernet60': {'lanes': '57,58,59,60', 'description': 'fortyGigE0/60', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/60', 'admin_status': 'up', 'autoneg': '0'}, " + "'Ethernet64': {'lanes': '65,66,67,68', 'description': 'fortyGigE0/64', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/64', 'admin_status': 'up', 'autoneg': '0'}, " + "'Ethernet68': {'lanes': '69,70,71,72', 'description': 'fortyGigE0/68', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/68', 'admin_status': 'up', 'autoneg': '0'}, " + "'Ethernet72': {'lanes': '77,78,79,80', 'description': 'fortyGigE0/72', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/72', 'admin_status': 'up', 'autoneg': '0'}, " + "'Ethernet76': {'lanes': '73,74,75,76', 'description': 'fortyGigE0/76', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/76', 'admin_status': 'up', 'autoneg': '0'}, " + "'Ethernet80': {'lanes': '105,106,107,108', 'description': 'fortyGigE0/80', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/80', 'admin_status': 'up', 'autoneg': '0'}, " + "'Ethernet84': {'lanes': '109,110,111,112', 'description': 'fortyGigE0/84', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/84', 'admin_status': 'up', 'autoneg': '0'}, " + "'Ethernet88': {'lanes': '117,118,119,120', 'description': 'fortyGigE0/88', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/88', 'admin_status': 'up', 'autoneg': '0'}, " + "'Ethernet92': {'lanes': '113,114,115,116', 'description': 'fortyGigE0/92', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/92', 'admin_status': 'up', 'autoneg': '0'}, " + "'Ethernet96': {'lanes': '121,122,123,124', 'description': 'fortyGigE0/96', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/96', 'admin_status': 'up', 'autoneg': '0'}, " + "'Ethernet100': {'lanes': '125,126,127,128', 'description': 'Servers100:eth0', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/100', 'admin_status': 'up', 'autoneg': '0'}, " + "'Ethernet104': {'lanes': '85,86,87,88', 'description': 'fortyGigE0/104', 'mtu': '9100', 'alias': 'fortyGigE0/104', 'pfc_asym': 'off', 'autoneg': '0'}, " + "'Ethernet108': {'lanes': '81,82,83,84', 'description': 'fortyGigE0/108', 'mtu': '9100', 'alias': 'fortyGigE0/108', 'pfc_asym': 'off', 'autoneg': '0'}, " + "'Ethernet112': {'lanes': '89,90,91,92', 'description': 'ARISTA01T1:Ethernet1/1', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/112', 'admin_status': 'up', 'autoneg': '1'}, " + "'Ethernet116': {'lanes': '93,94,95,96', 'description': 'ARISTA02T1:Ethernet1/1', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/116', 'admin_status': 'up', 'autoneg': '1'}, " + "'Ethernet120': {'lanes': '97,98,99,100', 'description': 'ARISTA03T1:Ethernet1/1', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/120', 'admin_status': 'up', 'autoneg': '1'}, " + "'Ethernet124': {'lanes': '101,102,103,104', 'fec': 'rs', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/124', 'admin_status': 'up', 'autoneg': '1', 'speed': '100000', 'description': 'ARISTA04T1:Ethernet1/1'}}" + ) ) def test_minigraph_port_rs(self): @@ -355,14 +493,15 @@ def test_minigraph_deployment_id(self): output = self.run_script(argument) self.assertEqual(output.strip(), "1") - def test_minigraph_ethernet_interfaces(self): - argument = '-m "' + self.sample_graph_simple + '" -p "' + self.port_config + '" -v "PORT[\'Ethernet8\']"' + def test_minigraph_ethernet_interfaces(self, **kwargs): + graph_file = kwargs.get('graph_file', self.sample_graph_simple) + argument = '-m "' + graph_file + '" -p "' + self.port_config + '" -v "PORT[\'Ethernet8\']"' output = self.run_script(argument) self.assertEqual( utils.to_dict(output.strip()), utils.to_dict("{'lanes': '37,38,39,40', 'description': 'Interface description', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/8', 'admin_status': 'up', 'speed': '1000'}") ) - argument = '-m "' + self.sample_graph_simple + '" -p "' + self.port_config + '" -v "PORT[\'Ethernet12\']"' + argument = '-m "' + graph_file + '" -p "' + self.port_config + '" -v "PORT[\'Ethernet12\']"' output = self.run_script(argument) self.assertEqual( utils.to_dict(output.strip()), @@ -376,80 +515,124 @@ def test_minigraph_neighbor_interfaces(self): self.assertEqual( utils.to_dict(output.strip()), utils.to_dict( - "{'Ethernet8': {'lanes': '37,38,39,40', 'description': 'Interface description', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/8', 'admin_status': 'up', 'speed': '40000', 'mux_cable': 'true'}, " - "'Ethernet0': {'lanes': '29,30,31,32', 'description': 'switch-01t1:port1', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/0', 'admin_status': 'up', 'speed': '10000'}, " - "'Ethernet4': {'lanes': '25,26,27,28', 'description': 'server1:port1', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/4', 'admin_status': 'up', 'speed': '25000', 'mux_cable': 'true'}, " - "'Ethernet108': {'alias': 'fortyGigE0/108', 'pfc_asym': 'off', 'lanes': '81,82,83,84', 'description': 'fortyGigE0/108', 'mtu': '9100'}, " - "'Ethernet100': {'alias': 'fortyGigE0/100', 'pfc_asym': 'off', 'lanes': '125,126,127,128', 'description': 'fortyGigE0/100', 'mtu': '9100'}, " - "'Ethernet104': {'alias': 'fortyGigE0/104', 'pfc_asym': 'off', 'lanes': '85,86,87,88', 'description': 'fortyGigE0/104', 'mtu': '9100'}, " - "'Ethernet68': {'alias': 'fortyGigE0/68', 'pfc_asym': 'off', 'lanes': '69,70,71,72', 'description': 'fortyGigE0/68', 'mtu': '9100'}, " - "'Ethernet96': {'alias': 'fortyGigE0/96', 'pfc_asym': 'off', 'lanes': '121,122,123,124', 'description': 'fortyGigE0/96', 'mtu': '9100'}, " - "'Ethernet124': {'alias': 'fortyGigE0/124', 'pfc_asym': 'off', 'lanes': '101,102,103,104', 'description': 'fortyGigE0/124', 'mtu': '9100'}, " - "'Ethernet92': {'alias': 'fortyGigE0/92', 'pfc_asym': 'off', 'lanes': '113,114,115,116', 'description': 'fortyGigE0/92', 'mtu': '9100'}, " - "'Ethernet120': {'alias': 'fortyGigE0/120', 'pfc_asym': 'off', 'lanes': '97,98,99,100', 'description': 'fortyGigE0/120', 'mtu': '9100'}, " + "{'Ethernet0': {'lanes': '29,30,31,32', 'description': 'switch-01t1:port1', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/0', 'admin_status': 'up', 'speed': '10000', 'autoneg': '1'}, " + "'Ethernet4': {'lanes': '25,26,27,28', 'description': 'server1:port1', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/4', 'admin_status': 'up', 'speed': '25000', 'autoneg': '1', 'mux_cable': 'true'}, " + "'Ethernet8': {'lanes': '37,38,39,40', 'description': 'Interface description', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/8', 'admin_status': 'up', 'speed': '40000', 'autoneg': '1', 'mux_cable': 'true'}, " + "'Ethernet12': {'lanes': '33,34,35,36', 'description': 'Interface description', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/12', 'admin_status': 'up', 'speed': '10000', 'autoneg': '1'}, " + "'Ethernet16': {'alias': 'fortyGigE0/16', 'pfc_asym': 'off', 'lanes': '41,42,43,44', 'description': 'fortyGigE0/16', 'mtu': '9100'}, " + "'Ethernet20': {'alias': 'fortyGigE0/20', 'pfc_asym': 'off', 'lanes': '45,46,47,48', 'description': 'fortyGigE0/20', 'mtu': '9100'}, " + "'Ethernet24': {'alias': 'fortyGigE0/24', 'pfc_asym': 'off', 'lanes': '5,6,7,8', 'description': 'fortyGigE0/24', 'mtu': '9100'}, " + "'Ethernet28': {'alias': 'fortyGigE0/28', 'pfc_asym': 'off', 'lanes': '1,2,3,4', 'description': 'fortyGigE0/28', 'mtu': '9100'}, " + "'Ethernet32': {'alias': 'fortyGigE0/32', 'pfc_asym': 'off', 'lanes': '9,10,11,12', 'description': 'fortyGigE0/32', 'mtu': '9100'}, " + "'Ethernet36': {'alias': 'fortyGigE0/36', 'pfc_asym': 'off', 'lanes': '13,14,15,16', 'description': 'fortyGigE0/36', 'mtu': '9100'}, " + "'Ethernet40': {'alias': 'fortyGigE0/40', 'pfc_asym': 'off', 'lanes': '21,22,23,24', 'description': 'fortyGigE0/40', 'mtu': '9100'}, " + "'Ethernet44': {'alias': 'fortyGigE0/44', 'pfc_asym': 'off', 'lanes': '17,18,19,20', 'description': 'fortyGigE0/44', 'mtu': '9100'}, " + "'Ethernet48': {'alias': 'fortyGigE0/48', 'pfc_asym': 'off', 'lanes': '49,50,51,52', 'description': 'fortyGigE0/48', 'mtu': '9100'}, " "'Ethernet52': {'alias': 'fortyGigE0/52', 'pfc_asym': 'off', 'lanes': '53,54,55,56', 'description': 'fortyGigE0/52', 'mtu': '9100'}, " "'Ethernet56': {'alias': 'fortyGigE0/56', 'pfc_asym': 'off', 'lanes': '61,62,63,64', 'description': 'fortyGigE0/56', 'mtu': '9100'}, " - "'Ethernet76': {'alias': 'fortyGigE0/76', 'pfc_asym': 'off', 'lanes': '73,74,75,76', 'description': 'fortyGigE0/76', 'mtu': '9100'}, " - "'Ethernet72': {'alias': 'fortyGigE0/72', 'pfc_asym': 'off', 'lanes': '77,78,79,80', 'description': 'fortyGigE0/72', 'mtu': '9100'}, " + "'Ethernet60': {'alias': 'fortyGigE0/60', 'pfc_asym': 'off', 'lanes': '57,58,59,60', 'description': 'fortyGigE0/60', 'mtu': '9100'}, " "'Ethernet64': {'alias': 'fortyGigE0/64', 'pfc_asym': 'off', 'lanes': '65,66,67,68', 'description': 'fortyGigE0/64', 'mtu': '9100'}, " - "'Ethernet32': {'alias': 'fortyGigE0/32', 'pfc_asym': 'off', 'lanes': '9,10,11,12', 'description': 'fortyGigE0/32', 'mtu': '9100'}, " - "'Ethernet16': {'alias': 'fortyGigE0/16', 'pfc_asym': 'off', 'lanes': '41,42,43,44', 'description': 'fortyGigE0/16', 'mtu': '9100'}, " - "'Ethernet36': {'alias': 'fortyGigE0/36', 'pfc_asym': 'off', 'lanes': '13,14,15,16', 'description': 'fortyGigE0/36', 'mtu': '9100'}, " - "'Ethernet12': {'lanes': '33,34,35,36', 'description': 'Interface description', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/12', 'admin_status': 'up', 'speed': '10000'}, " - "'Ethernet88': {'alias': 'fortyGigE0/88', 'pfc_asym': 'off', 'lanes': '117,118,119,120', 'description': 'fortyGigE0/88', 'mtu': '9100'}, " - "'Ethernet116': {'alias': 'fortyGigE0/116', 'pfc_asym': 'off', 'lanes': '93,94,95,96', 'description': 'fortyGigE0/116', 'mtu': '9100'}, " + "'Ethernet68': {'alias': 'fortyGigE0/68', 'pfc_asym': 'off', 'lanes': '69,70,71,72', 'description': 'fortyGigE0/68', 'mtu': '9100'}, " + "'Ethernet72': {'alias': 'fortyGigE0/72', 'pfc_asym': 'off', 'lanes': '77,78,79,80', 'description': 'fortyGigE0/72', 'mtu': '9100'}, " + "'Ethernet76': {'alias': 'fortyGigE0/76', 'pfc_asym': 'off', 'lanes': '73,74,75,76', 'description': 'fortyGigE0/76', 'mtu': '9100'}, " "'Ethernet80': {'alias': 'fortyGigE0/80', 'pfc_asym': 'off', 'lanes': '105,106,107,108', 'description': 'fortyGigE0/80', 'mtu': '9100'}, " - "'Ethernet112': {'alias': 'fortyGigE0/112', 'pfc_asym': 'off', 'lanes': '89,90,91,92', 'description': 'fortyGigE0/112', 'mtu': '9100'}, " "'Ethernet84': {'alias': 'fortyGigE0/84', 'pfc_asym': 'off', 'lanes': '109,110,111,112', 'description': 'fortyGigE0/84', 'mtu': '9100'}, " - "'Ethernet48': {'alias': 'fortyGigE0/48', 'pfc_asym': 'off', 'lanes': '49,50,51,52', 'description': 'fortyGigE0/48', 'mtu': '9100'}, " - "'Ethernet44': {'alias': 'fortyGigE0/44', 'pfc_asym': 'off', 'lanes': '17,18,19,20', 'description': 'fortyGigE0/44', 'mtu': '9100'}, " - "'Ethernet40': {'alias': 'fortyGigE0/40', 'pfc_asym': 'off', 'lanes': '21,22,23,24', 'description': 'fortyGigE0/40', 'mtu': '9100'}, " - "'Ethernet28': {'alias': 'fortyGigE0/28', 'pfc_asym': 'off', 'lanes': '1,2,3,4', 'description': 'fortyGigE0/28', 'mtu': '9100'}, " - "'Ethernet60': {'alias': 'fortyGigE0/60', 'pfc_asym': 'off', 'lanes': '57,58,59,60', 'description': 'fortyGigE0/60', 'mtu': '9100'}, " - "'Ethernet20': {'alias': 'fortyGigE0/20', 'pfc_asym': 'off', 'lanes': '45,46,47,48', 'description': 'fortyGigE0/20', 'mtu': '9100'}, " - "'Ethernet24': {'alias': 'fortyGigE0/24', 'pfc_asym': 'off', 'lanes': '5,6,7,8', 'description': 'fortyGigE0/24', 'mtu': '9100'}}" + "'Ethernet88': {'alias': 'fortyGigE0/88', 'pfc_asym': 'off', 'lanes': '117,118,119,120', 'description': 'fortyGigE0/88', 'mtu': '9100'}, " + "'Ethernet92': {'alias': 'fortyGigE0/92', 'pfc_asym': 'off', 'lanes': '113,114,115,116', 'description': 'fortyGigE0/92', 'mtu': '9100'}, " + "'Ethernet96': {'alias': 'fortyGigE0/96', 'pfc_asym': 'off', 'lanes': '121,122,123,124', 'description': 'fortyGigE0/96', 'mtu': '9100'}, " + "'Ethernet100': {'alias': 'fortyGigE0/100', 'pfc_asym': 'off', 'lanes': '125,126,127,128', 'description': 'fortyGigE0/100', 'mtu': '9100'}, " + "'Ethernet104': {'alias': 'fortyGigE0/104', 'pfc_asym': 'off', 'lanes': '85,86,87,88', 'description': 'fortyGigE0/104', 'mtu': '9100'}, " + "'Ethernet108': {'alias': 'fortyGigE0/108', 'pfc_asym': 'off', 'lanes': '81,82,83,84', 'description': 'fortyGigE0/108', 'mtu': '9100'}, " + "'Ethernet112': {'alias': 'fortyGigE0/112', 'pfc_asym': 'off', 'lanes': '89,90,91,92', 'description': 'fortyGigE0/112', 'mtu': '9100'}, " + "'Ethernet116': {'alias': 'fortyGigE0/116', 'pfc_asym': 'off', 'lanes': '93,94,95,96', 'description': 'fortyGigE0/116', 'mtu': '9100'}, " + "'Ethernet120': {'alias': 'fortyGigE0/120', 'pfc_asym': 'off', 'lanes': '97,98,99,100', 'description': 'fortyGigE0/120', 'mtu': '9100'}, " + "'Ethernet124': {'alias': 'fortyGigE0/124', 'pfc_asym': 'off', 'lanes': '101,102,103,104', 'description': 'fortyGigE0/124', 'mtu': '9100'}}" + ) + ) + + def test_minigraph_neighbor_interfaces_config_db(self): + # test to check if PORT table is retrieved from config_db + argument = '-m "' + self.sample_graph_simple_case + '" -v "PORT"' + output = self.run_script(argument) + + self.assertEqual( + utils.to_dict(output.strip()), + utils.to_dict( + "{'Ethernet0': {'lanes': '29,30,31,32', 'description': 'config_db:switch-01t1:port1', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/0', 'admin_status': 'up', 'speed': '10000', 'autoneg': '1'}, " + "'Ethernet4': {'lanes': '25,26,27,28', 'description': 'config_db:server1:port1', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/4', 'admin_status': 'up', 'speed': '25000', 'autoneg': '1', 'mux_cable': 'true'}, " + "'Ethernet8': {'lanes': '37,38,39,40', 'description': 'Interface description', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/8', 'admin_status': 'up', 'speed': '40000', 'autoneg': '1', 'mux_cable': 'true'}, " + "'Ethernet12': {'lanes': '33,34,35,36', 'description': 'Interface description', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/12', 'admin_status': 'up', 'speed': '10000', 'autoneg': '1'}, " + "'Ethernet16': {'alias': 'fortyGigE0/16', 'pfc_asym': 'off', 'lanes': '41,42,43,44', 'description': 'config_db:fortyGigE0/16', 'mtu': '9100'}, " + "'Ethernet20': {'alias': 'fortyGigE0/20', 'pfc_asym': 'off', 'lanes': '45,46,47,48', 'description': 'config_db:fortyGigE0/20', 'mtu': '9100'}, " + "'Ethernet24': {'alias': 'fortyGigE0/24', 'pfc_asym': 'off', 'lanes': '5,6,7,8', 'description': 'config_db:fortyGigE0/24', 'mtu': '9100'}, " + "'Ethernet28': {'alias': 'fortyGigE0/28', 'pfc_asym': 'off', 'lanes': '1,2,3,4', 'description': 'config_db:fortyGigE0/28', 'mtu': '9100'}, " + "'Ethernet32': {'alias': 'fortyGigE0/32', 'pfc_asym': 'off', 'lanes': '9,10,11,12', 'description': 'config_db:fortyGigE0/32', 'mtu': '9100'}, " + "'Ethernet36': {'alias': 'fortyGigE0/36', 'pfc_asym': 'off', 'lanes': '13,14,15,16', 'description': 'config_db:fortyGigE0/36', 'mtu': '9100'}, " + "'Ethernet40': {'alias': 'fortyGigE0/40', 'pfc_asym': 'off', 'lanes': '21,22,23,24', 'description': 'config_db:fortyGigE0/40', 'mtu': '9100'}, " + "'Ethernet44': {'alias': 'fortyGigE0/44', 'pfc_asym': 'off', 'lanes': '17,18,19,20', 'description': 'config_db:fortyGigE0/44', 'mtu': '9100'}, " + "'Ethernet48': {'alias': 'fortyGigE0/48', 'pfc_asym': 'off', 'lanes': '49,50,51,52', 'description': 'config_db:fortyGigE0/48', 'mtu': '9100'}, " + "'Ethernet52': {'alias': 'fortyGigE0/52', 'pfc_asym': 'off', 'lanes': '53,54,55,56', 'description': 'config_db:fortyGigE0/52', 'mtu': '9100'}, " + "'Ethernet56': {'alias': 'fortyGigE0/56', 'pfc_asym': 'off', 'lanes': '61,62,63,64', 'description': 'config_db:fortyGigE0/56', 'mtu': '9100'}, " + "'Ethernet60': {'alias': 'fortyGigE0/60', 'pfc_asym': 'off', 'lanes': '57,58,59,60', 'description': 'config_db:fortyGigE0/60', 'mtu': '9100'}, " + "'Ethernet64': {'alias': 'fortyGigE0/64', 'pfc_asym': 'off', 'lanes': '65,66,67,68', 'description': 'config_db:fortyGigE0/64', 'mtu': '9100'}, " + "'Ethernet68': {'alias': 'fortyGigE0/68', 'pfc_asym': 'off', 'lanes': '69,70,71,72', 'description': 'config_db:fortyGigE0/68', 'mtu': '9100'}, " + "'Ethernet72': {'alias': 'fortyGigE0/72', 'pfc_asym': 'off', 'lanes': '77,78,79,80', 'description': 'config_db:fortyGigE0/72', 'mtu': '9100'}, " + "'Ethernet76': {'alias': 'fortyGigE0/76', 'pfc_asym': 'off', 'lanes': '73,74,75,76', 'description': 'config_db:fortyGigE0/76', 'mtu': '9100'}, " + "'Ethernet80': {'alias': 'fortyGigE0/80', 'pfc_asym': 'off', 'lanes': '105,106,107,108', 'description': 'config_db:fortyGigE0/80', 'mtu': '9100'}, " + "'Ethernet84': {'alias': 'fortyGigE0/84', 'pfc_asym': 'off', 'lanes': '109,110,111,112', 'description': 'config_db:fortyGigE0/84', 'mtu': '9100'}, " + "'Ethernet88': {'alias': 'fortyGigE0/88', 'pfc_asym': 'off', 'lanes': '117,118,119,120', 'description': 'config_db:fortyGigE0/88', 'mtu': '9100'}, " + "'Ethernet92': {'alias': 'fortyGigE0/92', 'pfc_asym': 'off', 'lanes': '113,114,115,116', 'description': 'config_db:fortyGigE0/92', 'mtu': '9100'}, " + "'Ethernet96': {'alias': 'fortyGigE0/96', 'pfc_asym': 'off', 'lanes': '121,122,123,124', 'description': 'config_db:fortyGigE0/96', 'mtu': '9100'}, " + "'Ethernet100': {'alias': 'fortyGigE0/100', 'pfc_asym': 'off', 'lanes': '125,126,127,128', 'description': 'config_db:fortyGigE0/100', 'mtu': '9100'}, " + "'Ethernet104': {'alias': 'fortyGigE0/104', 'pfc_asym': 'off', 'lanes': '85,86,87,88', 'description': 'config_db:fortyGigE0/104', 'mtu': '9100'}, " + "'Ethernet108': {'alias': 'fortyGigE0/108', 'pfc_asym': 'off', 'lanes': '81,82,83,84', 'description': 'config_db:fortyGigE0/108', 'mtu': '9100'}, " + "'Ethernet112': {'alias': 'fortyGigE0/112', 'pfc_asym': 'off', 'lanes': '89,90,91,92', 'description': 'config_db:fortyGigE0/112', 'mtu': '9100'}, " + "'Ethernet116': {'alias': 'fortyGigE0/116', 'pfc_asym': 'off', 'lanes': '93,94,95,96', 'description': 'config_db:fortyGigE0/116', 'mtu': '9100'}, " + "'Ethernet120': {'alias': 'fortyGigE0/120', 'pfc_asym': 'off', 'lanes': '97,98,99,100', 'description': 'config_db:fortyGigE0/120', 'mtu': '9100'}, " + "'Ethernet124': {'alias': 'fortyGigE0/124', 'pfc_asym': 'off', 'lanes': '101,102,103,104', 'description': 'config_db:fortyGigE0/124', 'mtu': '9100'}}" ) ) - def test_minigraph_extra_ethernet_interfaces(self): - argument = '-m "' + self.sample_graph_simple + '" -p "' + self.port_config + '" -v "PORT"' + def test_minigraph_extra_ethernet_interfaces(self, **kwargs): + graph_file = kwargs.get('graph_file', self.sample_graph_simple) + argument = '-m "' + graph_file + '" -p "' + self.port_config + '" -v "PORT"' output = self.run_script(argument) self.assertEqual( utils.to_dict(output.strip()), utils.to_dict( - "{'Ethernet8': {'lanes': '37,38,39,40', 'description': 'Interface description', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/8', 'admin_status': 'up', 'speed': '1000'}, " - "'Ethernet0': {'lanes': '29,30,31,32', 'description': 'fortyGigE0/0', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/0', 'admin_status': 'up', 'speed': '10000'}, " + "{'Ethernet0': {'lanes': '29,30,31,32', 'description': 'fortyGigE0/0', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/0', 'admin_status': 'up', 'speed': '10000'}, " "'Ethernet4': {'lanes': '25,26,27,28', 'description': 'fortyGigE0/4', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/4', 'admin_status': 'up', 'speed': '25000'}, " - "'Ethernet108': {'alias': 'fortyGigE0/108', 'pfc_asym': 'off', 'lanes': '81,82,83,84', 'description': 'fortyGigE0/108', 'mtu': '9100'}, " - "'Ethernet100': {'alias': 'fortyGigE0/100', 'pfc_asym': 'off', 'lanes': '125,126,127,128', 'description': 'fortyGigE0/100', 'mtu': '9100'}, " - "'Ethernet104': {'alias': 'fortyGigE0/104', 'pfc_asym': 'off', 'lanes': '85,86,87,88', 'description': 'fortyGigE0/104', 'mtu': '9100'}, " - "'Ethernet68': {'alias': 'fortyGigE0/68', 'pfc_asym': 'off', 'lanes': '69,70,71,72', 'description': 'fortyGigE0/68', 'mtu': '9100'}, " - "'Ethernet96': {'alias': 'fortyGigE0/96', 'pfc_asym': 'off', 'lanes': '121,122,123,124', 'description': 'fortyGigE0/96', 'mtu': '9100'}, " - "'Ethernet124': {'alias': 'fortyGigE0/124', 'pfc_asym': 'off', 'lanes': '101,102,103,104', 'description': 'fortyGigE0/124', 'mtu': '9100'}, " - "'Ethernet92': {'alias': 'fortyGigE0/92', 'pfc_asym': 'off', 'lanes': '113,114,115,116', 'description': 'fortyGigE0/92', 'mtu': '9100'}, " - "'Ethernet120': {'alias': 'fortyGigE0/120', 'pfc_asym': 'off', 'lanes': '97,98,99,100', 'description': 'fortyGigE0/120', 'mtu': '9100'}, " + "'Ethernet8': {'lanes': '37,38,39,40', 'description': 'Interface description', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/8', 'admin_status': 'up', 'speed': '1000'}, " + "'Ethernet12': {'lanes': '33,34,35,36', 'fec': 'rs', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/12', 'admin_status': 'up', 'speed': '100000', 'description': 'Interface description'}, " + "'Ethernet16': {'lanes': '41,42,43,44', 'pfc_asym': 'off', 'description': 'fortyGigE0/16', 'mtu': '9100', 'alias': 'fortyGigE0/16', 'speed': '1000'}, " + "'Ethernet20': {'alias': 'fortyGigE0/20', 'pfc_asym': 'off', 'lanes': '45,46,47,48', 'description': 'fortyGigE0/20', 'mtu': '9100'}, " + "'Ethernet24': {'alias': 'fortyGigE0/24', 'pfc_asym': 'off', 'lanes': '5,6,7,8', 'description': 'fortyGigE0/24', 'mtu': '9100'}, " + "'Ethernet28': {'alias': 'fortyGigE0/28', 'pfc_asym': 'off', 'lanes': '1,2,3,4', 'description': 'fortyGigE0/28', 'mtu': '9100'}, " + "'Ethernet32': {'alias': 'fortyGigE0/32', 'pfc_asym': 'off', 'lanes': '9,10,11,12', 'description': 'fortyGigE0/32', 'mtu': '9100'}, " + "'Ethernet36': {'alias': 'fortyGigE0/36', 'pfc_asym': 'off', 'lanes': '13,14,15,16', 'description': 'fortyGigE0/36', 'mtu': '9100'}, " + "'Ethernet40': {'alias': 'fortyGigE0/40', 'pfc_asym': 'off', 'lanes': '21,22,23,24', 'description': 'fortyGigE0/40', 'mtu': '9100'}, " + "'Ethernet44': {'alias': 'fortyGigE0/44', 'pfc_asym': 'off', 'lanes': '17,18,19,20', 'description': 'fortyGigE0/44', 'mtu': '9100'}, " + "'Ethernet48': {'alias': 'fortyGigE0/48', 'pfc_asym': 'off', 'lanes': '49,50,51,52', 'description': 'fortyGigE0/48', 'mtu': '9100'}, " "'Ethernet52': {'alias': 'fortyGigE0/52', 'pfc_asym': 'off', 'lanes': '53,54,55,56', 'description': 'fortyGigE0/52', 'mtu': '9100'}, " "'Ethernet56': {'alias': 'fortyGigE0/56', 'pfc_asym': 'off', 'lanes': '61,62,63,64', 'description': 'fortyGigE0/56', 'mtu': '9100'}, " - "'Ethernet76': {'alias': 'fortyGigE0/76', 'pfc_asym': 'off', 'lanes': '73,74,75,76', 'description': 'fortyGigE0/76', 'mtu': '9100'}, " - "'Ethernet72': {'alias': 'fortyGigE0/72', 'pfc_asym': 'off', 'lanes': '77,78,79,80', 'description': 'fortyGigE0/72', 'mtu': '9100'}, " + "'Ethernet60': {'alias': 'fortyGigE0/60', 'pfc_asym': 'off', 'lanes': '57,58,59,60', 'description': 'fortyGigE0/60', 'mtu': '9100'}, " "'Ethernet64': {'alias': 'fortyGigE0/64', 'pfc_asym': 'off', 'lanes': '65,66,67,68', 'description': 'fortyGigE0/64', 'mtu': '9100'}, " - "'Ethernet32': {'alias': 'fortyGigE0/32', 'pfc_asym': 'off', 'lanes': '9,10,11,12', 'description': 'fortyGigE0/32', 'mtu': '9100'}, " - "'Ethernet16': {'alias': 'fortyGigE0/16', 'pfc_asym': 'off', 'lanes': '41,42,43,44', 'description': 'fortyGigE0/16', 'mtu': '9100'}, " - "'Ethernet36': {'alias': 'fortyGigE0/36', 'pfc_asym': 'off', 'lanes': '13,14,15,16', 'description': 'fortyGigE0/36', 'mtu': '9100'}, " - "'Ethernet12': {'lanes': '33,34,35,36', 'fec': 'rs', 'pfc_asym': 'off', 'mtu': '9100', 'alias': 'fortyGigE0/12', 'admin_status': 'up', 'speed': '100000', 'description': 'Interface description'}, " - "'Ethernet88': {'alias': 'fortyGigE0/88', 'pfc_asym': 'off', 'lanes': '117,118,119,120', 'description': 'fortyGigE0/88', 'mtu': '9100'}, " - "'Ethernet116': {'alias': 'fortyGigE0/116', 'pfc_asym': 'off', 'lanes': '93,94,95,96', 'description': 'fortyGigE0/116', 'mtu': '9100'}, " + "'Ethernet68': {'alias': 'fortyGigE0/68', 'pfc_asym': 'off', 'lanes': '69,70,71,72', 'description': 'fortyGigE0/68', 'mtu': '9100'}, " + "'Ethernet72': {'alias': 'fortyGigE0/72', 'pfc_asym': 'off', 'lanes': '77,78,79,80', 'description': 'fortyGigE0/72', 'mtu': '9100'}, " + "'Ethernet76': {'alias': 'fortyGigE0/76', 'pfc_asym': 'off', 'lanes': '73,74,75,76', 'description': 'fortyGigE0/76', 'mtu': '9100'}, " "'Ethernet80': {'alias': 'fortyGigE0/80', 'pfc_asym': 'off', 'lanes': '105,106,107,108', 'description': 'fortyGigE0/80', 'mtu': '9100'}, " - "'Ethernet112': {'alias': 'fortyGigE0/112', 'pfc_asym': 'off', 'lanes': '89,90,91,92', 'description': 'fortyGigE0/112', 'mtu': '9100'}, " "'Ethernet84': {'alias': 'fortyGigE0/84', 'pfc_asym': 'off', 'lanes': '109,110,111,112', 'description': 'fortyGigE0/84', 'mtu': '9100'}, " - "'Ethernet48': {'alias': 'fortyGigE0/48', 'pfc_asym': 'off', 'lanes': '49,50,51,52', 'description': 'fortyGigE0/48', 'mtu': '9100'}, " - "'Ethernet44': {'alias': 'fortyGigE0/44', 'pfc_asym': 'off', 'lanes': '17,18,19,20', 'description': 'fortyGigE0/44', 'mtu': '9100'}, " - "'Ethernet40': {'alias': 'fortyGigE0/40', 'pfc_asym': 'off', 'lanes': '21,22,23,24', 'description': 'fortyGigE0/40', 'mtu': '9100'}, " - "'Ethernet28': {'alias': 'fortyGigE0/28', 'pfc_asym': 'off', 'lanes': '1,2,3,4', 'description': 'fortyGigE0/28', 'mtu': '9100'}, " - "'Ethernet60': {'alias': 'fortyGigE0/60', 'pfc_asym': 'off', 'lanes': '57,58,59,60', 'description': 'fortyGigE0/60', 'mtu': '9100'}, " - "'Ethernet20': {'alias': 'fortyGigE0/20', 'pfc_asym': 'off', 'lanes': '45,46,47,48', 'description': 'fortyGigE0/20', 'mtu': '9100'}, " - "'Ethernet24': {'alias': 'fortyGigE0/24', 'pfc_asym': 'off', 'lanes': '5,6,7,8', 'description': 'fortyGigE0/24', 'mtu': '9100'}}" + "'Ethernet88': {'alias': 'fortyGigE0/88', 'pfc_asym': 'off', 'lanes': '117,118,119,120', 'description': 'fortyGigE0/88', 'mtu': '9100'}, " + "'Ethernet92': {'alias': 'fortyGigE0/92', 'pfc_asym': 'off', 'lanes': '113,114,115,116', 'description': 'fortyGigE0/92', 'mtu': '9100'}, " + "'Ethernet96': {'alias': 'fortyGigE0/96', 'pfc_asym': 'off', 'lanes': '121,122,123,124', 'description': 'fortyGigE0/96', 'mtu': '9100'}, " + "'Ethernet100': {'alias': 'fortyGigE0/100', 'pfc_asym': 'off', 'lanes': '125,126,127,128', 'description': 'fortyGigE0/100', 'mtu': '9100'}, " + "'Ethernet104': {'alias': 'fortyGigE0/104', 'pfc_asym': 'off', 'lanes': '85,86,87,88', 'description': 'fortyGigE0/104', 'mtu': '9100'}, " + "'Ethernet108': {'alias': 'fortyGigE0/108', 'pfc_asym': 'off', 'lanes': '81,82,83,84', 'description': 'fortyGigE0/108', 'mtu': '9100'}, " + "'Ethernet112': {'alias': 'fortyGigE0/112', 'pfc_asym': 'off', 'lanes': '89,90,91,92', 'description': 'fortyGigE0/112', 'mtu': '9100'}, " + "'Ethernet116': {'alias': 'fortyGigE0/116', 'pfc_asym': 'off', 'lanes': '93,94,95,96', 'description': 'fortyGigE0/116', 'mtu': '9100'}, " + "'Ethernet120': {'alias': 'fortyGigE0/120', 'pfc_asym': 'off', 'lanes': '97,98,99,100', 'description': 'fortyGigE0/120', 'mtu': '9100'}, " + "'Ethernet124': {'alias': 'fortyGigE0/124', 'pfc_asym': 'off', 'lanes': '101,102,103,104', 'description': 'fortyGigE0/124', 'mtu': '9100'}}" ) ) @@ -472,13 +655,15 @@ def test_metadata_ntp(self): output = self.run_script(argument) self.assertEqual(utils.to_dict(output.strip()), utils.to_dict("{'10.0.10.1': {}, '10.0.10.2': {}}")) - def test_minigraph_vnet(self): - argument = '-m "' + self.sample_graph_simple + '" -p "' + self.port_config + '" -v "VNET"' + def test_minigraph_vnet(self, **kwargs): + graph_file = kwargs.get('graph_file', self.sample_graph_simple) + argument = '-m "' + graph_file + '" -p "' + self.port_config + '" -v "VNET"' output = self.run_script(argument) self.assertEqual(output.strip(), "") - def test_minigraph_vxlan(self): - argument = '-m "' + self.sample_graph_simple + '" -p "' + self.port_config + '" -v "VXLAN_TUNNEL"' + def test_minigraph_vxlan(self, **kwargs): + graph_file = kwargs.get('graph_file', self.sample_graph_simple) + argument = '-m "' + graph_file + '" -p "' + self.port_config + '" -v "VXLAN_TUNNEL"' output = self.run_script(argument) self.assertEqual(output.strip(), "") @@ -490,62 +675,161 @@ def test_minigraph_bgp_mon(self): utils.to_dict("{'10.20.30.40': {'rrclient': 0, 'name': 'BGPMonitor', 'local_addr': '10.1.0.32', 'nhopself': 0, 'holdtime': '10', 'asn': '0', 'keepalive': '3'}}") ) - def test_minigraph_sub_port_interfaces(self, check_stderr=True): + def test_minigraph_sub_port_intf_resource_type_non_backend_tor(self, check_stderr=True): + self.verify_sub_intf_non_backend_tor(graph_file=self.sample_resource_graph, check_stderr=check_stderr) + + def test_minigraph_sub_port_intf_hwsku(self, check_stderr=True): + self.verify_sub_intf(graph_file=self.sample_backend_graph, check_stderr=check_stderr) + + def test_minigraph_sub_port_intf_sub(self, check_stderr=True): + self.verify_sub_intf(graph_file=self.sample_subintf_graph, check_stderr=check_stderr) + + def test_minigraph_no_vlan_member(self, check_stderr=True): + self.verify_no_vlan_member() + + def test_minigraph_backend_acl_leaf(self, check_stderr=True): try: - print('\n Change device type to %s' % (BACKEND_TOR_ROUTER)) + print('\n Change device type to %s' % (BACKEND_LEAF_ROUTER)) + if check_stderr: + output = subprocess.check_output("sed -i \'s/%s/%s/g\' %s" % (TOR_ROUTER, BACKEND_LEAF_ROUTER, self.sample_backend_graph), stderr=subprocess.STDOUT, shell=True) + else: + output = subprocess.check_output("sed -i \'s/%s/%s/g\' %s" % (TOR_ROUTER, BACKEND_LEAF_ROUTER, self.sample_backend_graph), shell=True) + + self.test_jinja_expression(self.sample_backend_graph, BACKEND_LEAF_ROUTER) + + # ACL_TABLE should contain EVERFLOW related entries + argument = '-m "' + self.sample_backend_graph + '" -p "' + self.port_config + '" -v "ACL_TABLE"' + output = self.run_script(argument) + sample_output = utils.to_dict(output.strip()).keys() + assert 'DATAACL' not in sample_output, sample_output + assert 'EVERFLOW' in sample_output, sample_output + + finally: + print('\n Change device type back to %s' % (TOR_ROUTER)) + if check_stderr: + output = subprocess.check_output("sed -i \'s/%s/%s/g\' %s" % (BACKEND_LEAF_ROUTER, TOR_ROUTER, self.sample_backend_graph), stderr=subprocess.STDOUT, shell=True) + else: + output = subprocess.check_output("sed -i \'s/%s/%s/g\' %s" % (BACKEND_LEAF_ROUTER, TOR_ROUTER, self.sample_backend_graph), shell=True) + + self.test_jinja_expression(self.sample_backend_graph, TOR_ROUTER) + + def test_minigraph_sub_port_no_vlan_member(self, check_stderr=True): + try: + print('\n Change device type to %s' % (BACKEND_LEAF_ROUTER)) + if check_stderr: + output = subprocess.check_output("sed -i \'s/%s/%s/g\' %s" % (LEAF_ROUTER, BACKEND_LEAF_ROUTER, self.sample_graph), stderr=subprocess.STDOUT, shell=True) + else: + output = subprocess.check_output("sed -i \'s/%s/%s/g\' %s" % (LEAF_ROUTER, BACKEND_LEAF_ROUTER, self.sample_graph), shell=True) + + self.test_jinja_expression(self.sample_graph, BACKEND_LEAF_ROUTER) + self.verify_no_vlan_member() + finally: + print('\n Change device type back to %s' % (LEAF_ROUTER)) if check_stderr: - output = subprocess.check_output("sed -i \'s/%s/%s/g\' %s" % (TOR_ROUTER, BACKEND_TOR_ROUTER, self.sample_graph_simple), stderr=subprocess.STDOUT, shell=True) + output = subprocess.check_output("sed -i \'s/%s/%s/g\' %s" % (BACKEND_LEAF_ROUTER, LEAF_ROUTER, self.sample_graph), stderr=subprocess.STDOUT, shell=True) else: - output = subprocess.check_output("sed -i \'s/%s/%s/g\' %s" % (TOR_ROUTER, BACKEND_TOR_ROUTER, self.sample_graph_simple), shell=True) + output = subprocess.check_output("sed -i \'s/%s/%s/g\' %s" % (BACKEND_LEAF_ROUTER, LEAF_ROUTER, self.sample_graph), shell=True) + + self.test_jinja_expression(self.sample_graph, LEAF_ROUTER) + + def verify_no_vlan_member(self): + argument = '-m "' + self.sample_graph + '" -p "' + self.port_config + '" -v "VLAN_MEMBER"' + output = self.run_script(argument) + self.assertEqual(output.strip(), "{}") - self.test_jinja_expression(self.sample_graph_simple, BACKEND_TOR_ROUTER) + def verify_sub_intf_non_backend_tor(self, **kwargs): + graph_file = kwargs.get('graph_file', self.sample_graph_simple) + # All the other tables stay unchanged + self.test_var_json_data(graph_file=graph_file) + self.test_minigraph_vlans(graph_file=graph_file) + self.test_minigraph_vlan_members(graph_file=graph_file) + + def verify_sub_intf(self, **kwargs): + graph_file = kwargs.get('graph_file', self.sample_graph_simple) + check_stderr = kwargs.get('check_stderr', True) + try: + print('\n Change device type to %s' % (BACKEND_TOR_ROUTER)) + if check_stderr: + output = subprocess.check_output("sed -i \'s/%s/%s/g\' %s" % (TOR_ROUTER, BACKEND_TOR_ROUTER, graph_file), stderr=subprocess.STDOUT, shell=True) + else: + output = subprocess.check_output("sed -i \'s/%s/%s/g\' %s" % (TOR_ROUTER, BACKEND_TOR_ROUTER, graph_file), shell=True) + + self.test_jinja_expression(graph_file, BACKEND_TOR_ROUTER) # INTERFACE table does not exist - argument = '-m "' + self.sample_graph_simple + '" -p "' + self.port_config + '" -v "INTERFACE"' + argument = '-m "' + graph_file + '" -p "' + self.port_config + '" -v "INTERFACE"' output = self.run_script(argument) self.assertEqual(output.strip(), "") # PORTCHANNEL_INTERFACE table does not exist - argument = '-m "' + self.sample_graph_simple + '" -p "' + self.port_config + '" -v "PORTCHANNEL_INTERFACE"' + argument = '-m "' + graph_file + '" -p "' + self.port_config + '" -v "PORTCHANNEL_INTERFACE"' output = self.run_script(argument) self.assertEqual(output.strip(), "") + # SLB and BGP Monitor table does not exist + argument = '-m "' + graph_file + '" -p "' + self.port_config + '" -v "BGP_PEER_RANGE"' + output = self.run_script(argument) + self.assertEqual(output.strip(), "{}") + argument = '-m "' + graph_file + '" -p "' + self.port_config + '" -v "BGP_MONITORS"' + output = self.run_script(argument) + self.assertEqual(output.strip(), "{}") + + # ACL_TABLE should not contain EVERFLOW related entries + argument = '-m "' + graph_file + '" -p "' + self.port_config + '" -v "ACL_TABLE"' + output = self.run_script(argument) + sample_output = utils.to_dict(output.strip()).keys() + assert 'DATAACL' in sample_output, sample_output + assert 'EVERFLOW' not in sample_output, sample_output + # All the other tables stay unchanged - self.test_var_json_data() - self.test_minigraph_vlans() - self.test_minigraph_vlan_members() - self.test_minigraph_vlan_interfaces() - self.test_minigraph_portchannels() - self.test_minigraph_ethernet_interfaces() - self.test_minigraph_extra_ethernet_interfaces() - self.test_minigraph_vnet() - self.test_minigraph_vxlan() + self.test_minigraph_vlans(graph_file=graph_file) + self.test_minigraph_vlan_interfaces(graph_file=graph_file) + self.test_minigraph_portchannels(graph_file=graph_file) + self.test_minigraph_ethernet_interfaces(graph_file=graph_file) + self.test_minigraph_extra_ethernet_interfaces(graph_file=graph_file) + self.test_minigraph_vnet(graph_file=graph_file) + self.test_minigraph_vxlan(graph_file=graph_file) # VLAN_SUB_INTERFACE - argument = '-m "' + self.sample_graph_simple + '" -p "' + self.port_config + '" -v VLAN_SUB_INTERFACE' + argument = '-m "' + graph_file + '" -p "' + self.port_config + '" -v VLAN_SUB_INTERFACE' output = self.run_script(argument) print(output.strip()) - self.assertEqual( - utils.to_dict(output.strip()), - utils.to_dict( - "{('PortChannel01.10', '10.0.0.56/31'): {}, " - "'Ethernet0.10': {'admin_status': 'up'}, " - "('Ethernet0.10', '10.0.0.58/31'): {}, " - "('PortChannel01.10', 'FC00::71/126'): {}, " - "'PortChannel01.10': {'admin_status': 'up'}, " - "('Ethernet0.10', 'FC00::75/126'): {}}" + # not a usecase to parse SubInterfaces under PortChannel + if 'subintf' in graph_file: + self.assertEqual( + utils.to_dict(output.strip()), + utils.to_dict( + "{'Ethernet0.10': {'admin_status': 'up'}, " + "('Ethernet0.10', '10.0.0.58/31'): {}, " + "('Ethernet0.10', 'FC00::75/126'): {}}" + ) + ) + else: + self.assertEqual( + utils.to_dict(output.strip()), + utils.to_dict( + "{('PortChannel01.10', '10.0.0.56/31'): {}, " + "'Ethernet0.10': {'admin_status': 'up'}, " + "('Ethernet0.10', '10.0.0.58/31'): {}, " + "('PortChannel01.10', 'FC00::71/126'): {}, " + "'PortChannel01.10': {'admin_status': 'up'}, " + "('Ethernet0.10', 'FC00::75/126'): {}}" + ) ) - ) + + # VLAN_MEMBER table should have all tagged members + self.test_var_json_data(graph_file=graph_file, tag_mode='tagged') + self.test_minigraph_vlan_members(graph_file=graph_file, tag_mode='tagged') finally: print('\n Change device type back to %s' % (TOR_ROUTER)) if check_stderr: - output = subprocess.check_output("sed -i \'s/%s/%s/g\' %s" % (BACKEND_TOR_ROUTER, TOR_ROUTER, self.sample_graph_simple), stderr=subprocess.STDOUT, shell=True) + output = subprocess.check_output("sed -i \'s/%s/%s/g\' %s" % (BACKEND_TOR_ROUTER, TOR_ROUTER, graph_file), stderr=subprocess.STDOUT, shell=True) else: - output = subprocess.check_output("sed -i \'s/%s/%s/g\' %s" % (BACKEND_TOR_ROUTER, TOR_ROUTER, self.sample_graph_simple), shell=True) + output = subprocess.check_output("sed -i \'s/%s/%s/g\' %s" % (BACKEND_TOR_ROUTER, TOR_ROUTER, graph_file), shell=True) - self.test_jinja_expression(self.sample_graph_simple, TOR_ROUTER) + self.test_jinja_expression(graph_file, TOR_ROUTER) def test_show_run_acl(self): argument = '-a \'{"key1":"value"}\' --var-json ACL_RULE' @@ -556,3 +840,14 @@ def test_show_run_interfaces(self): argument = '-a \'{"key1":"value"}\' --var-json INTERFACE' output = self.run_script(argument) self.assertEqual(output, '') + + def test_minigraph_dhcp(self): + argument = '-m "' + self.sample_graph_simple_case + '" -p "' + self.port_config + '" -v DHCP_RELAY' + output = self.run_script(argument) + self.assertEqual( + utils.to_dict(output.strip()), + utils.to_dict( + "{'Vlan1000': {'dhcpv6_servers': ['fc02:2000::1', 'fc02:2000::2']}, " + "'Vlan2000': {'dhcpv6_servers': ['fc02:2000::3', 'fc02:2000::4']}}" + ) + ) diff --git a/src/sonic-config-engine/tests/test_frr.py b/src/sonic-config-engine/tests/test_frr.py index 4998db2d5b25..cad32eb5e402 100644 --- a/src/sonic-config-engine/tests/test_frr.py +++ b/src/sonic-config-engine/tests/test_frr.py @@ -1,4 +1,5 @@ import filecmp +import json import os import subprocess @@ -46,12 +47,16 @@ def run_diff(self, file1, file2): return output - def run_case(self, template, target): + def run_case(self, template, target, extra_data=None): template_dir = os.path.join(self.test_dir, '..', '..', '..', 'dockers', 'docker-fpm-frr', "frr") conf_template = os.path.join(template_dir, template) constants = os.path.join(self.test_dir, '..', '..', '..', 'files', 'image_config', 'constants', 'constants.yml') - cmd_args = self.t0_minigraph, self.t0_port_config, constants, conf_template, template_dir, self.output_file - cmd = "-m %s -p %s -y %s -t %s -T %s > %s" % cmd_args + if extra_data: + cmd_args = self.t0_minigraph, self.t0_port_config, constants, conf_template, template_dir, json.dumps(extra_data), self.output_file + cmd = "-m %s -p %s -y %s -t %s -T %s -a '%s' > %s" % cmd_args + else: + cmd_args = self.t0_minigraph, self.t0_port_config, constants, conf_template, template_dir, self.output_file + cmd = "-m %s -p %s -y %s -t %s -T %s > %s" % cmd_args self.run_script(cmd) original_filename = os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, target) @@ -69,6 +74,6 @@ def test_bgpd_frr(self): def test_zebra_frr(self): self.assertTrue(*self.run_case('zebra/zebra.conf.j2', 'zebra_frr.conf')) - def test_staticd_frr(self): - self.assertTrue(*self.run_case('staticd/staticd.conf.j2', 'staticd_frr.conf')) - + def test_bgpd_frr_dualtor(self): + extra_data = {"DEVICE_METADATA": {"localhost": {"subtype": "DualToR"}}} + self.assertTrue(*self.run_case('bgpd/bgpd.conf.j2', 'bgpd_frr_dualtor.conf', extra_data=extra_data)) diff --git a/src/sonic-config-engine/tests/test_j2files.py b/src/sonic-config-engine/tests/test_j2files.py index a66cd99820be..80f69a8b49ae 100644 --- a/src/sonic-config-engine/tests/test_j2files.py +++ b/src/sonic-config-engine/tests/test_j2files.py @@ -17,13 +17,16 @@ def setUp(self): self.t0_mvrf_minigraph = os.path.join(self.test_dir, 't0-sample-graph-mvrf.xml') self.pc_minigraph = os.path.join(self.test_dir, 'pc-test-graph.xml') self.t0_port_config = os.path.join(self.test_dir, 't0-sample-port-config.ini') + self.l1_l3_port_config = os.path.join(self.test_dir, 'l1-l3-sample-port-config.ini') + self.t0_7050cx3_port_config = os.path.join(self.test_dir, 't0_7050cx3_d48c8_port_config.ini') self.t1_mlnx_minigraph = os.path.join(self.test_dir, 't1-sample-graph-mlnx.xml') self.mlnx_port_config = os.path.join(self.test_dir, 'sample-port-config-mlnx.ini') - self.dell6100_t0_minigraph = os.path.join(self.test_dir, 'sample-dell-6100-t0-minigraph.xml') - self.arista7050_t0_minigraph = os.path.join(self.test_dir, 'sample-arista-7050-t0-minigraph.xml') self.multi_asic_minigraph = os.path.join(self.test_dir, 'multi_npu_data', 'sample-minigraph.xml') self.multi_asic_port_config = os.path.join(self.test_dir, 'multi_npu_data', 'sample_port_config-0.ini') + self.radv_test_minigraph = os.path.join(self.test_dir, 'radv-test-sample-graph.xml') + self.no_ip_helper_minigraph = os.path.join(self.test_dir, 't0-sample-no-ip-helper-graph.xml') self.output_file = os.path.join(self.test_dir, 'output') + os.environ["CFGGEN_UNIT_TESTING"] = "2" def run_script(self, argument): print('CMD: sonic-cfggen ' + argument) @@ -37,34 +40,87 @@ def run_script(self, argument): def run_diff(self, file1, file2): return subprocess.check_output('diff -u {} {} || true'.format(file1, file2), shell=True) + def create_machine_conf(self, platform, vendor): + file_exist = True + dir_exist = True + mode = {'arista': 'aboot', + 'dell': 'onie', + 'mellanox': 'onie' + } + echo_cmd = "echo '{}_platform={}' | sudo tee -a /host/machine.conf > /dev/null".format(mode[vendor], platform) + if not os.path.exists('/host/machine.conf'): + file_exist = False + if not os.path.isdir('/host'): + dir_exist = False + os.system('sudo mkdir /host') + os.system('sudo touch /host/machine.conf') + os.system(echo_cmd) + + return file_exist, dir_exist + + def remove_machine_conf(self, file_exist, dir_exist): + if not file_exist: + os.system('sudo rm -f /host/machine.conf') + + if not dir_exist: + os.system('sudo rmdir /host') + + def modify_cable_len(self, base_file, file_dir): + input_file = os.path.join(file_dir, base_file) + with open(input_file, 'r') as ifd: + object = json.load(ifd) + if 'CABLE_LENGTH' in object and 'AZURE' in object['CABLE_LENGTH']: + for key in object['CABLE_LENGTH']['AZURE']: + object['CABLE_LENGTH']['AZURE'][key] = '300m' + prefix, extension = base_file.split('.') + output_file = '{}_300m.{}'.format(prefix, extension) + out_file_path = os.path.join(file_dir, output_file) + with open(out_file_path, 'w') as wfd: + json.dump(object, wfd, indent=4) + return output_file + def test_interfaces(self): interfaces_template = os.path.join(self.test_dir, '..', '..', '..', 'files', 'image_config', 'interfaces', 'interfaces.j2') argument = '-m ' + self.t0_minigraph + ' -a \'{\"hwaddr\":\"e4:1d:2d:a5:f3:ad\"}\' -t ' + interfaces_template + ' > ' + self.output_file self.run_script(argument) - self.assertTrue(filecmp.cmp(os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, 'interfaces'), self.output_file)) + self.assertTrue(utils.cmp(os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, 'interfaces'), self.output_file)) argument = '-m ' + self.t0_mvrf_minigraph + ' -a \'{\"hwaddr\":\"e4:1d:2d:a5:f3:ad\"}\' -t ' + interfaces_template + ' > ' + self.output_file self.run_script(argument) - self.assertTrue(filecmp.cmp(os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, 'mvrf_interfaces'), self.output_file)) + self.assertTrue(utils.cmp(os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, 'mvrf_interfaces'), self.output_file)) def test_ports_json(self): ports_template = os.path.join(self.test_dir, '..', '..', '..', 'dockers', 'docker-orchagent', 'ports.json.j2') argument = '-m ' + self.simple_minigraph + ' -p ' + self.t0_port_config + ' -t ' + ports_template + ' > ' + self.output_file self.run_script(argument) - self.assertTrue(filecmp.cmp(os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, 'ports.json'), self.output_file)) + self.assertTrue(utils.cmp(os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, 'ports.json'), self.output_file)) def test_dhcp_relay(self): # Test generation of wait_for_intf.sh + dhc_sample_data = os.path.join(self.test_dir, "dhcp-relay-sample.json") template_path = os.path.join(self.test_dir, '..', '..', '..', 'dockers', 'docker-dhcp-relay', 'wait_for_intf.sh.j2') - argument = '-m ' + self.t0_minigraph + ' -p ' + self.t0_port_config + ' -t ' + template_path + ' > ' + self.output_file + argument = '-m ' + self.t0_minigraph + ' -j ' + dhc_sample_data + ' -p ' + self.t0_port_config + ' -t ' + template_path + ' > ' + self.output_file self.run_script(argument) - self.assertTrue(filecmp.cmp(os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, 'wait_for_intf.sh'), self.output_file)) + self.assertTrue(utils.cmp(os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, 'wait_for_intf.sh'), self.output_file)) # Test generation of docker-dhcp-relay.supervisord.conf template_path = os.path.join(self.test_dir, '..', '..', '..', 'dockers', 'docker-dhcp-relay', 'docker-dhcp-relay.supervisord.conf.j2') argument = '-m ' + self.t0_minigraph + ' -p ' + self.t0_port_config + ' -t ' + template_path + ' > ' + self.output_file self.run_script(argument) - self.assertTrue(filecmp.cmp(os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, 'docker-dhcp-relay.supervisord.conf'), self.output_file)) + self.assertTrue(utils.cmp(os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, 'docker-dhcp-relay.supervisord.conf'), self.output_file)) + + # Test generation of docker-dhcp-relay.supervisord.conf when a vlan is missing ip/ipv6 helpers + template_path = os.path.join(self.test_dir, '..', '..', '..', 'dockers', 'docker-dhcp-relay', 'docker-dhcp-relay.supervisord.conf.j2') + argument = '-m ' + self.no_ip_helper_minigraph + ' -p ' + self.t0_port_config + ' -t ' + template_path + ' > ' + self.output_file + self.run_script(argument) + self.assertTrue(utils.cmp(os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, 'docker-dhcp-relay-no-ip-helper.supervisord.conf'), self.output_file)) + + def test_radv(self): + # Test generation of radvd.conf with multiple ipv6 prefixes + template_path = os.path.join(self.test_dir, '..', '..', '..', 'dockers', 'docker-router-advertiser', 'radvd.conf.j2') + argument = '-m ' + self.radv_test_minigraph + ' -p ' + self.t0_port_config + ' -t ' + template_path + ' > ' + self.output_file + self.run_script(argument) + self.assertTrue(filecmp.cmp(os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, 'radvd.conf'), self.output_file)) def test_lldp(self): lldpd_conf_template = os.path.join(self.test_dir, '..', '..', '..', 'dockers', 'docker-lldp', 'lldpd.conf.j2') @@ -77,34 +133,19 @@ def test_lldp(self): mgmt_iface_ipv4_and_ipv6_json = os.path.join(self.test_dir, "data", "lldp", "mgmt_iface_ipv4_and_ipv6.json") argument = '-j {} -t {} > {}'.format(mgmt_iface_ipv4_and_ipv6_json, lldpd_conf_template, self.output_file) self.run_script(argument) - self.assertTrue(filecmp.cmp(expected_mgmt_ipv4_and_ipv6, self.output_file)) + self.assertTrue(utils.cmp(expected_mgmt_ipv4_and_ipv6, self.output_file)) # Test generation of lldpd.conf if management interface IPv4 only exist mgmt_iface_ipv4_json = os.path.join(self.test_dir, "data", "lldp", "mgmt_iface_ipv4.json") argument = '-j {} -t {} > {}'.format(mgmt_iface_ipv4_json, lldpd_conf_template, self.output_file) self.run_script(argument) - self.assertTrue(filecmp.cmp(expected_mgmt_ipv4, self.output_file)) + self.assertTrue(utils.cmp(expected_mgmt_ipv4, self.output_file)) # Test generation of lldpd.conf if Management interface IPv6 only exist mgmt_iface_ipv6_json = os.path.join(self.test_dir, "data", "lldp", "mgmt_iface_ipv6.json") argument = '-j {} -t {} > {}'.format(mgmt_iface_ipv6_json, lldpd_conf_template, self.output_file) self.run_script(argument) - self.assertTrue(filecmp.cmp(expected_mgmt_ipv6, self.output_file)) - - def test_bgpd_quagga(self): - conf_template = os.path.join(self.test_dir, '..', '..', '..', 'dockers', 'docker-fpm-quagga', 'bgpd.conf.j2') - argument = '-m ' + self.t0_minigraph + ' -p ' + self.t0_port_config + ' -t ' + conf_template + ' > ' + self.output_file - self.run_script(argument) - original_filename = os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, 'bgpd_quagga.conf') - r = filecmp.cmp(original_filename, self.output_file) - diff_output = self.run_diff(original_filename, self.output_file) if not r else "" - self.assertTrue(r, "Diff:\n" + diff_output) - - def test_zebra_quagga(self): - conf_template = os.path.join(self.test_dir, '..', '..', '..', 'dockers', 'docker-fpm-quagga', 'zebra.conf.j2') - argument = '-m ' + self.t0_minigraph + ' -p ' + self.t0_port_config + ' -t ' + conf_template + ' > ' + self.output_file - self.run_script(argument) - self.assertTrue(filecmp.cmp(os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, 'zebra_quagga.conf'), self.output_file)) + self.assertTrue(utils.cmp(expected_mgmt_ipv6, self.output_file)) def test_ipinip(self): ipinip_file = os.path.join(self.test_dir, '..', '..', '..', 'dockers', 'docker-orchagent', 'ipinip.json.j2') @@ -112,7 +153,7 @@ def test_ipinip(self): self.run_script(argument) sample_output_file = os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, 'ipinip.json') - assert filecmp.cmp(sample_output_file, self.output_file) + assert utils.cmp(sample_output_file, self.output_file) def test_l2switch_template(self): argument = '-k Mellanox-SN2700 --preset l2 -p ' + self.t0_port_config @@ -132,70 +173,303 @@ def test_l2switch_template(self): self.assertTrue(json.dumps(sample_output_json, sort_keys=True) == json.dumps(output_json, sort_keys=True)) - def test_qos_arista7050_render_template(self): - arista_dir_path = os.path.join(self.test_dir, '..', '..', '..', 'device', 'arista', 'x86_64-arista_7050_qx32s', 'Arista-7050-QX-32S') - qos_file = os.path.join(arista_dir_path, 'qos.json.j2') - port_config_ini_file = os.path.join(arista_dir_path, 'port_config.ini') + def test_l1_ports_template(self): + argument = '-k 32x1000Gb --preset l1 -p ' + self.l1_l3_port_config + output = self.run_script(argument) + output_json = json.loads(output) - # copy qos_config.j2 to the Arista 7050 directory to have all templates in one directory - qos_config_file = os.path.join(self.test_dir, '..', '..', '..', 'files', 'build_templates', 'qos_config.j2') - shutil.copy2(qos_config_file, arista_dir_path) + sample_output_file = os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, 'l1_intfs.json') + with open(sample_output_file) as sample_output_fd: + sample_output_json = json.load(sample_output_fd) - argument = '-m ' + self.arista7050_t0_minigraph + ' -p ' + port_config_ini_file + ' -t ' + qos_file + ' > ' + self.output_file - self.run_script(argument) + self.assertTrue(json.dumps(sample_output_json, sort_keys=True) == json.dumps(output_json, sort_keys=True)) - # cleanup - qos_config_file_new = os.path.join(arista_dir_path, 'qos_config.j2') - os.remove(qos_config_file_new) + template_dir = os.path.join(self.test_dir, '..', 'data', 'l1intf.j2') + argument = '-t ' + template_dir + ' -k 32x1000Gb -p ' + self.l1_l3_port_config + output = self.run_script(argument) + output_json = json.loads(output) + + self.assertTrue(json.dumps(sample_output_json, sort_keys=True) == json.dumps(output_json, sort_keys=True)) + + def test_l3_ports_template(self): + argument = '-k 32x1000Gb --preset l3 -p ' + self.l1_l3_port_config + output = self.run_script(argument) + output_json = json.loads(output) + + sample_output_file = os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, 'l3_intfs.json') + with open(sample_output_file) as sample_output_fd: + sample_output_json = json.load(sample_output_fd) - sample_output_file = os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, 'qos-arista7050.json') - assert filecmp.cmp(sample_output_file, self.output_file) + self.assertTrue(json.dumps(sample_output_json, sort_keys=True) == json.dumps(output_json, sort_keys=True)) + + template_dir = os.path.join(self.test_dir, '..', 'data', 'l3intf.j2') + argument = '-t ' + template_dir + ' -k 32x1000Gb -p ' + self.l1_l3_port_config + output = self.run_script(argument) + output_json = json.loads(output) + + self.assertTrue(json.dumps(sample_output_json, sort_keys=True) == json.dumps(output_json, sort_keys=True)) + + def test_l2switch_template_dualtor(self): + extra_args = { + "is_dualtor": True, + "uplinks": [ + "Ethernet24", "Ethernet28", "Ethernet32", "Ethernet36", + "Ethernet88", "Ethernet92", "Ethernet96", "Ethernet100" + ], + "downlinks": [ + "Ethernet0", "Ethernet4", "Ethernet8", "Ethernet12", + "Ethernet16", "Ethernet20", "Ethernet40", "Ethernet44", + "Ethernet48", "Ethernet52", "Ethernet56", "Ethernet60", + "Ethernet64", "Ethernet68", "Ethernet72", "Ethernet76", + "Ethernet80", "Ethernet84", "Ethernet104", "Ethernet108", + "Ethernet112", "Ethernet116", "Ethernet120", "Ethernet124" + ] + } + argument = '-a \'{}\' -k Arista-7050CX3-32S-D48C8 --preset l2 -p {}'.format( + json.dumps(extra_args), self.t0_7050cx3_port_config + ) + output = self.run_script(argument) + output_json = json.loads(output) + + sample_output_file = os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, 'l2switch_dualtor.json') + with open(sample_output_file) as sample_output_fd: + sample_output_json = json.load(sample_output_fd) + self.maxDiff = None + self.assertEqual(sample_output_json, output_json) + + def test_qos_arista7050_render_template(self): + self._test_qos_render_template('arista', 'x86_64-arista_7050_qx32s', 'Arista-7050-QX-32S', 'sample-arista-7050-t0-minigraph.xml', 'qos-arista7050.json') + + def test_qos_dell9332_render_template(self): + self._test_qos_render_template('dell', 'x86_64-dellemc_z9332f_d1508-r0', 'DellEMC-Z9332f-O32', 'sample-dell-9332-t1-minigraph.xml', 'qos-dell9332.json') def test_qos_dell6100_render_template(self): - dell_dir_path = os.path.join(self.test_dir, '..', '..', '..', 'device', 'dell', 'x86_64-dell_s6100_c2538-r0', 'Force10-S6100') - qos_file = os.path.join(dell_dir_path, 'qos.json.j2') - port_config_ini_file = os.path.join(dell_dir_path, 'port_config.ini') + self._test_qos_render_template('dell', 'x86_64-dell_s6100_c2538-r0', 'Force10-S6100', 'sample-dell-6100-t0-minigraph.xml', 'qos-dell6100.json', copy_files=True) + + def test_qos_arista7260_render_template(self): + self._test_qos_render_template('arista', 'x86_64-arista_7260cx3_64', 'Arista-7260CX3-D96C16', 'sample-arista-7260-t1-minigraph-remap-disabled.xml', 'qos-arista7260.json') + + def _test_qos_render_template(self, vendor, platform, sku, minigraph, expected, copy_files=False): + file_exist, dir_exist = self.create_machine_conf(platform, vendor) + dir_path = os.path.join(self.test_dir, '..', '..', '..', 'device', vendor, platform, sku) + + if copy_files: + self.copy_mmu_templates(dir_path, revert=False) - # copy qos_config.j2 to the Dell S6100 directory to have all templates in one directory + qos_file = os.path.join(dir_path, 'qos.json.j2') + port_config_ini_file = os.path.join(dir_path, 'port_config.ini') + + # copy qos_config.j2 to the SKU directory to have all templates in one directory qos_config_file = os.path.join(self.test_dir, '..', '..', '..', 'files', 'build_templates', 'qos_config.j2') - shutil.copy2(qos_config_file, dell_dir_path) + shutil.copy2(qos_config_file, dir_path) - argument = '-m ' + self.dell6100_t0_minigraph + ' -p ' + port_config_ini_file + ' -t ' + qos_file + ' > ' + self.output_file + minigraph = os.path.join(self.test_dir, minigraph) + argument = '-m ' + minigraph + ' -p ' + port_config_ini_file + ' -t ' + qos_file + ' > ' + self.output_file self.run_script(argument) # cleanup - qos_config_file_new = os.path.join(dell_dir_path, 'qos_config.j2') + qos_config_file_new = os.path.join(dir_path, 'qos_config.j2') os.remove(qos_config_file_new) + if copy_files: + self.copy_mmu_templates(dir_path, revert=True) + + self.remove_machine_conf(file_exist, dir_exist) - sample_output_file = os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, 'qos-dell6100.json') - assert filecmp.cmp(sample_output_file, self.output_file) + sample_output_file = os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, expected) + assert utils.cmp(sample_output_file, self.output_file) def test_buffers_dell6100_render_template(self): - dell_dir_path = os.path.join(self.test_dir, '..', '..', '..', 'device', 'dell', 'x86_64-dell_s6100_c2538-r0', 'Force10-S6100') - buffers_file = os.path.join(dell_dir_path, 'buffers.json.j2') - port_config_ini_file = os.path.join(dell_dir_path, 'port_config.ini') + self._test_buffers_render_template('dell', 'x86_64-dell_s6100_c2538-r0', 'Force10-S6100', 'sample-dell-6100-t0-minigraph.xml', 'buffers.json.j2', 'buffers-dell6100.json', copy_files=True) + + def test_buffers_mellanox2700_render_template(self): + # Mellanox buffer template rendering for single ingress pool mode + self._test_buffers_render_template('mellanox', 'x86_64-mlnx_msn2700-r0', 'Mellanox-SN2700-D48C8', 'sample-mellanox-2700-t0-minigraph.xml', 'buffers.json.j2', 'buffers-mellanox2700.json') + + def test_buffers_mellanox2410_render_template(self): + # Mellanox buffer template rendering for double ingress pools mode + self._test_buffers_render_template('mellanox', 'x86_64-mlnx_msn2410-r0', 'ACS-MSN2410', 'sample-mellanox-2410-t1-minigraph.xml', 'buffers.json.j2', 'buffers-mellanox2410.json') + + def test_config_brcm_render_template(self): + if utils.PYvX_DIR != 'py3': + #Skip on python2 as the change will not be backported to previous version + return + + config_bcm_sample_outputs = [ + 'arista7050cx3-dualtor.config.bcm', + 'arista7260-dualtor.config.bcm', + 'arista7260-t1.config.bcm' + ] + sample_minigraph_files = [ + 'sample-arista-7050cx3-dualtor-minigraph.xml', + 'sample-arista-7260-dualtor-minigraph.xml', + 'sample-arista-7260-t1-minigraph.xml' + ] + for i, config in enumerate(config_bcm_sample_outputs): + device_template_path = os.path.join(self.test_dir, './data/j2_template') + config_sample_output = config_bcm_sample_outputs[i] + sample_minigraph_file = os.path.join(self.test_dir,sample_minigraph_files[i]) + port_config_ini_file = os.path.join(device_template_path, 'port_config.ini') + config_bcm_file = os.path.join(device_template_path, 'config.bcm.j2') + config_test_output = os.path.join(self.test_dir, 'config_output.bcm') + + argument = '-m ' + sample_minigraph_file + ' -p ' + port_config_ini_file + ' -t ' + config_bcm_file + ' > ' + config_test_output + self.run_script(argument) + + #check output config.bcm + config_sample_output_file = os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, config_sample_output) + assert utils.cmp(config_sample_output_file, config_test_output) + os.remove(config_test_output) + + def copy_mmu_templates(self, dir_path, revert=False): + files_to_copy = ['pg_profile_lookup.ini', 'qos.json.j2', 'buffers_defaults_t0.j2', 'buffers_defaults_t1.j2'] + + for file_name in files_to_copy: + src_file = os.path.join(dir_path, file_name) + dst_file = os.path.join(self.test_dir, file_name) + + if not revert: + shutil.copy2(src_file, dst_file) + else: + shutil.copy2(dst_file, src_file) + os.remove(dst_file) + + def _test_buffers_render_template(self, vendor, platform, sku, minigraph, buffer_template, expected, copy_files=False): + file_exist, dir_exist = self.create_machine_conf(platform, vendor) + dir_path = os.path.join(self.test_dir, '..', '..', '..', 'device', vendor, platform, sku) + + if copy_files: + self.copy_mmu_templates(dir_path, revert=False) + + buffers_file = os.path.join(dir_path, buffer_template) + port_config_ini_file = os.path.join(dir_path, 'port_config.ini') - # copy buffers_config.j2 to the Dell S6100 directory to have all templates in one directory + # copy buffers_config.j2 to the SKU directory to have all templates in one directory buffers_config_file = os.path.join(self.test_dir, '..', '..', '..', 'files', 'build_templates', 'buffers_config.j2') - shutil.copy2(buffers_config_file, dell_dir_path) + shutil.copy2(buffers_config_file, dir_path) - argument = '-m ' + self.dell6100_t0_minigraph + ' -p ' + port_config_ini_file + ' -t ' + buffers_file + ' > ' + self.output_file + minigraph = os.path.join(self.test_dir, minigraph) + argument = '-m ' + minigraph + ' -p ' + port_config_ini_file + ' -t ' + buffers_file + ' > ' + self.output_file self.run_script(argument) # cleanup - buffers_config_file_new = os.path.join(dell_dir_path, 'buffers_config.j2') + buffers_config_file_new = os.path.join(dir_path, 'buffers_config.j2') os.remove(buffers_config_file_new) + self.remove_machine_conf(file_exist, dir_exist) + + out_file_dir = os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR) + expected_files = [expected, self.modify_cable_len(expected, out_file_dir)] + match = False + diff = '' + for out_file in expected_files: + sample_output_file = os.path.join(out_file_dir, out_file) + if utils.cmp(sample_output_file, self.output_file): + match = True + break + else: + diff = diff + str(self.run_diff(sample_output_file, self.output_file)) + + os.remove(os.path.join(out_file_dir, expected_files[1])) + if copy_files: + self.copy_mmu_templates(dir_path, revert=True) + + assert match, diff + + def test_extra_lossless_buffer_for_tunnel_remapping(self): + if utils.PYvX_DIR != 'py3': + # Skip on python2 as the change will not be backported to previous version + return + + TEST_DATA = [ + # (vendor, platform, sku, minigraph, buffer_template, sample_output ) + ('arista', 'x86_64-arista_7050cx3_32s', 'Arista-7050CX3-32S-D48C8', 'sample-arista-7050cx3-dualtor-minigraph.xml', 'buffers.json.j2', 'buffer-arista7050cx3-dualtor.json'), + ('arista', 'x86_64-arista_7050cx3_32s', 'Arista-7050CX3-32S-D48C8', 'sample-arista-7050cx3-dualtor-minigraph-remap-disabled.xml', 'buffers.json.j2', 'buffer-arista7050cx3-dualtor-remap-disabled.json'), + ('arista', 'x86_64-arista_7260cx3_64', 'Arista-7260CX3-D108C8', 'sample-arista-7260-dualtor-minigraph.xml', 'buffers.json.j2', 'buffer-arista7260-dualtor.json'), + ('arista', 'x86_64-arista_7260cx3_64', 'Arista-7260CX3-D108C8', 'sample-arista-7260-dualtor-minigraph-remap-disabled.xml', 'buffers.json.j2', 'buffer-arista7260-dualtor-remap-disabled.json'), + ('arista', 'x86_64-arista_7260cx3_64', 'Arista-7260CX3-C64', 'sample-arista-7260-t1-minigraph.xml', 'buffers.json.j2', 'buffer-arista7260-t1.json'), + ('arista', 'x86_64-arista_7260cx3_64', 'Arista-7260CX3-C64', 'sample-arista-7260-t1-minigraph-remap-disabled.xml', 'buffers.json.j2', 'buffer-arista7260-t1-remap-disabled.json'), + ('mellanox', 'x86_64-mlnx_msn4600c-r0', 'Mellanox-SN4600C-C64', 'sample-mellanox-4600c-t1-minigraph.xml', 'buffers_dynamic.json.j2', 'buffers-mellanox4600c-t1-dynamic.json'), + ('mellanox', 'x86_64-mlnx_msn4600c-r0', 'Mellanox-SN4600C-C64', 'sample-mellanox-4600c-t1-minigraph.xml', 'buffers.json.j2', 'buffers-mellanox4600c-t1.json'), + ('mellanox', 'x86_64-mlnx_msn4600c-r0', 'Mellanox-SN4600C-C64', 'sample-mellanox-4600c-t1-minigraph-remap-disabled.xml', 'buffers_dynamic.json.j2', 'buffers-mellanox4600c-t1-dynamic-remap-disabled.json'), + ('mellanox', 'x86_64-mlnx_msn4600c-r0', 'Mellanox-SN4600C-C64', 'sample-mellanox-4600c-t1-minigraph-remap-disabled.xml', 'buffers.json.j2', 'buffers-mellanox4600c-t1-remap-disabled.json') + ] + + for test_data in TEST_DATA: + self._test_buffers_render_template(vendor=test_data[0], + platform=test_data[1], + sku=test_data[2], + minigraph=test_data[3], + buffer_template=test_data[4], + expected=test_data[5]) + + def test_qos_dscp_remapping_render_template(self): + if utils.PYvX_DIR != 'py3': + # Skip on python2 as the change will not be backported to previous version + return + + dir_paths = [ + '../../../device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-D48C8', + '../../../device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8', + '../../../device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64', + '../../../device/arista/x86_64-arista_7050cx3_32s/Arista-7050CX3-32S-D48C8', + '../../../device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-D108C8', + '../../../device/arista/x86_64-arista_7260cx3_64/Arista-7260CX3-C64', + '../../../device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-C64', + '../../../device/mellanox/x86_64-mlnx_msn4600c-r0/Mellanox-SN4600C-C64', + '../../../device/arista/x86_64-arista_7050_qx32s/Arista-7050-QX-32S' + ] + sample_outputs = [ + 'qos-arista7050cx3-dualtor.json', + 'qos-arista7260-dualtor.json', + 'qos-arista7260-t1.json', + 'qos-arista7050cx3-dualtor-remap-disabled.json', + 'qos-arista7260-dualtor-remap-disabled.json', + 'qos-arista7260-t1-remap-disabled.json', + 'qos-mellanox4600c-c64.json', + 'qos-mellanox4600c-c64-remap-disabled.json', + 'qos-arista7050-t0-storage-backend.json' + ] + sample_minigraph_files = [ + 'sample-arista-7050cx3-dualtor-minigraph.xml', + 'sample-arista-7260-dualtor-minigraph.xml', + 'sample-arista-7260-t1-minigraph.xml', + 'sample-arista-7050cx3-dualtor-minigraph-remap-disabled.xml', + 'sample-arista-7260-dualtor-minigraph-remap-disabled.xml', + 'sample-arista-7260-t1-minigraph-remap-disabled.xml', + 'sample-mellanox-4600c-t1-minigraph.xml', + 'sample-mellanox-4600c-t1-minigraph-remap-disabled.xml', + 'sample-arista-7050-t0-storage-backend-minigraph.xml' + ] + + for i, path in enumerate(dir_paths): + device_template_path = os.path.join(self.test_dir, path) + sample_output = sample_outputs[i] + sample_minigraph_file = os.path.join(self.test_dir,sample_minigraph_files[i]) + qos_file = os.path.join(device_template_path, 'qos.json.j2') + port_config_ini_file = os.path.join(device_template_path, 'port_config.ini') + test_output = os.path.join(self.test_dir, 'output.json') + + # copy qos_config.j2 to the target directory to have all templates in one directory + qos_config_file = os.path.join(self.test_dir, '..', '..', '..', 'files', 'build_templates', 'qos_config.j2') + shutil.copy2(qos_config_file, device_template_path) + + argument = '-m ' + sample_minigraph_file + ' -p ' + port_config_ini_file + ' -t ' + qos_file + ' > ' + test_output + self.run_script(argument) + + # cleanup + qos_config_file_new = os.path.join(device_template_path, 'qos_config.j2') + os.remove(qos_config_file_new) - sample_output_file = os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, 'buffers-dell6100.json') - assert filecmp.cmp(sample_output_file, self.output_file) + sample_output_file = os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, sample_output) + assert utils.cmp(sample_output_file, test_output) + os.remove(test_output) def test_ipinip_multi_asic(self): ipinip_file = os.path.join(self.test_dir, '..', '..', '..', 'dockers', 'docker-orchagent', 'ipinip.json.j2') argument = '-m ' + self.multi_asic_minigraph + ' -p ' + self.multi_asic_port_config + ' -t ' + ipinip_file + ' -n asic0 ' + ' > ' + self.output_file print(argument) - self.run_script(argument) + self.run_script(argument) sample_output_file = os.path.join(self.test_dir, 'multi_npu_data', utils.PYvX_DIR, 'ipinip.json') - assert filecmp.cmp(sample_output_file, self.output_file) + assert utils.cmp(sample_output_file, self.output_file) def test_swss_switch_render_template(self): switch_template = os.path.join( @@ -224,7 +498,7 @@ def test_swss_switch_render_template(self): self.test_dir, 'sample_output', v["output"] ) self.run_script(argument) - assert filecmp.cmp(sample_output_file, self.output_file) + assert utils.cmp(sample_output_file, self.output_file) def test_swss_switch_render_template_multi_asic(self): # verify the ECMP hash seed changes per namespace @@ -256,7 +530,7 @@ def test_swss_switch_render_template_multi_asic(self): self.test_dir, 'sample_output', v["output"] ) self.run_script(argument) - assert filecmp.cmp(sample_output_file, self.output_file) + assert utils.cmp(sample_output_file, self.output_file) os.environ["NAMESPACE_ID"] = "" def test_ndppd_conf(self): @@ -266,9 +540,50 @@ def test_ndppd_conf(self): argument = '-j {} -t {} > {}'.format(vlan_interfaces_json, conf_template, self.output_file) self.run_script(argument) - assert filecmp.cmp(expected, self.output_file), self.run_diff(expected, self.output_file) + assert utils.cmp(expected, self.output_file), self.run_diff(expected, self.output_file) + + def test_ntp_conf(self): + conf_template = os.path.join(self.test_dir, "ntp.conf.j2") + ntp_interfaces_json = os.path.join(self.test_dir, "data", "ntp", "ntp_interfaces.json") + expected = os.path.join(self.test_dir, "sample_output", utils.PYvX_DIR, "ntp.conf") + + argument = '-j {} -t {} > {}'.format(ntp_interfaces_json, conf_template, self.output_file) + self.run_script(argument) + assert utils.cmp(expected, self.output_file), self.run_diff(expected, self.output_file) + + def test_backend_acl_template_render(self): + acl_template = os.path.join( + self.test_dir, '..', '..', '..', 'files', 'build_templates', + 'backend_acl.j2' + ) + test_list = { + 'single_vlan': { + 'input': 'single_vlan.json', + 'output': 'acl_single_vlan.json' + }, + 'multi_vlan': { + 'input': 'multi_vlan.json', + 'output': 'acl_multi_vlan.json' + }, + } + for _, v in test_list.items(): + input_file = os.path.join( + self.test_dir, 'data', 'backend_acl', v['input'] + ) + argument = " -j {} -t {} > {}".format( + input_file, acl_template, self.output_file + ) + sample_output_file = os.path.join( + self.test_dir, 'data', 'backend_acl', v['output'] + ) + self.run_script(argument) + assert utils.cmp(sample_output_file, self.output_file), self.run_diff(sample_output_file, self.output_file) + + def test_buffers_edgezone_aggregator_render_template(self): + self._test_buffers_render_template('arista', 'x86_64-arista_7060_cx32s', 'Arista-7060CX-32S-D48C8', 'sample-arista-7060-t0-minigraph.xml', 'buffers.json.j2', 'buffer-arista7060-t0.json') def tearDown(self): + os.environ["CFGGEN_UNIT_TESTING"] = "" try: os.remove(self.output_file) except OSError: diff --git a/src/sonic-config-engine/tests/test_minigraph_case.py b/src/sonic-config-engine/tests/test_minigraph_case.py index efa8a063b6e5..2f7a74bf3ed0 100644 --- a/src/sonic-config-engine/tests/test_minigraph_case.py +++ b/src/sonic-config-engine/tests/test_minigraph_case.py @@ -1,18 +1,28 @@ +import json import os import subprocess +import ipaddress import tests.common_utils as utils import minigraph from unittest import TestCase +TOR_ROUTER = 'ToRRouter' +BACKEND_TOR_ROUTER = 'BackEndToRRouter' +BMC_MGMT_TOR_ROUTER = 'BmcMgmtToRRouter' class TestCfgGenCaseInsensitive(TestCase): def setUp(self): self.test_dir = os.path.dirname(os.path.realpath(__file__)) self.script_file = utils.PYTHON_INTERPRETTER + ' ' + os.path.join(self.test_dir, '..', 'sonic-cfggen') + self.sample_simple_graph = os.path.join(self.test_dir, 'simple-sample-graph.xml') self.sample_graph = os.path.join(self.test_dir, 'simple-sample-graph-case.xml') + self.sample_resource_graph = os.path.join(self.test_dir, 'sample-graph-resource-type.xml') + self.sample_subintf_graph = os.path.join(self.test_dir, 'sample-graph-subintf.xml') + self.sample_simple_device_desc = os.path.join(self.test_dir, 'simple-sample-device-desc.xml') + self.sample_simple_device_desc_ipv6_only = os.path.join(self.test_dir, 'simple-sample-device-desc-ipv6-only.xml') self.port_config = os.path.join(self.test_dir, 't0-sample-port-config.ini') def run_script(self, argument, check_stderr=False): @@ -57,6 +67,11 @@ def test_minigraph_subtype(self): output = self.run_script(argument) self.assertEqual(output.strip(), 'DualToR') + def test_minigraph_peer_switch_hostname(self): + argument = '-m "' + self.sample_graph + '" -v "DEVICE_METADATA[\'localhost\'][\'peer_switch\']"' + output = self.run_script(argument) + self.assertEqual(output.strip(), 'switch2-t0') + def test_additional_json_data(self): argument = '-a \'{"key1":"value1"}\' -v key1' output = self.run_script(argument) @@ -86,15 +101,40 @@ def test_minigraph_interfaces(self): def test_minigraph_vlans(self): argument = '-m "' + self.sample_graph + '" -p "' + self.port_config + '" -v VLAN' output = self.run_script(argument) + + expected = { + 'Vlan1000': { + 'alias': 'ab1', + 'dhcp_servers': ['192.0.0.1', '192.0.0.2'], + 'dhcpv6_servers': ['fc02:2000::1', 'fc02:2000::2'], + 'vlanid': '1000', + 'mac': '00:aa:bb:cc:dd:ee', + 'members': ['Ethernet8'] + }, + 'Vlan2000': { + 'alias': 'ab2', + 'dhcp_servers': ['192.0.0.1'], + 'dhcpv6_servers': ['fc02:2000::3', 'fc02:2000::4'], + 'members': ['Ethernet4'], + 'vlanid': '2000' + } + } self.assertEqual( utils.to_dict(output.strip()), - utils.to_dict("{'Vlan1000': {'alias': 'ab1', 'dhcp_servers': ['192.0.0.1', '192.0.0.2'], 'vlanid': '1000', 'mac': '00:aa:bb:cc:dd:ee' }}") + expected ) def test_minigraph_vlan_members(self): argument = '-m "' + self.sample_graph + '" -p "' + self.port_config + '" -v VLAN_MEMBER' output = self.run_script(argument) - self.assertEqual(output.strip(), "{('Vlan1000', 'Ethernet8'): {'tagging_mode': 'untagged'}}") + expected = { + 'Vlan1000|Ethernet8': {'tagging_mode': 'untagged'}, + 'Vlan2000|Ethernet4': {'tagging_mode': 'untagged'} + } + self.assertEqual( + utils.to_dict(output.strip()), + expected + ) def test_minigraph_vlan_interfaces_keys(self): argument = '-m "' + self.sample_graph + '" -p "' + self.port_config + '" -v "VLAN_INTERFACE.keys()|list"' @@ -135,11 +175,29 @@ def test_minigraph_console_port(self): utils.to_dict(output.strip()), utils.to_dict("{'1': {'baud_rate': '9600', 'remote_device': 'managed_device', 'flow_control': 1}}")) + def test_minigraph_dhcp_server_feature(self): + argument = '-m "' + self.sample_graph + '" -p "' + self.port_config + '" -v "DEVICE_METADATA[\'localhost\'][\'dhcp_server\']"' + output = self.run_script(argument) + self.assertEqual(output.strip(), '') + + try: + # For DHCP server enabled device type + output = subprocess.check_output("sed -i \'s/%s/%s/g\' %s" % (TOR_ROUTER, BMC_MGMT_TOR_ROUTER, self.sample_graph), shell=True) + output = self.run_script(argument) + self.assertEqual(output.strip(), 'enabled') + finally: + output = subprocess.check_output("sed -i \'s/%s/%s/g\' %s" % (BMC_MGMT_TOR_ROUTER, TOR_ROUTER, self.sample_graph), shell=True) + def test_minigraph_deployment_id(self): argument = '-m "' + self.sample_graph + '" -p "' + self.port_config + '" -v "DEVICE_METADATA[\'localhost\'][\'deployment_id\']"' output = self.run_script(argument) self.assertEqual(output.strip(), "1") + def test_minigraph_cluster(self): + argument = '-m "' + self.sample_graph + '" -p "' + self.port_config + '" -v "DEVICE_METADATA[\'localhost\'][\'cluster\']"' + output = self.run_script(argument) + self.assertEqual(output.strip(), "AAA00PrdStr00") + def test_minigraph_neighbor_metadata(self): argument = '-m "' + self.sample_graph + '" -p "' + self.port_config + '" -v "DEVICE_NEIGHBOR_METADATA"' @@ -160,7 +218,7 @@ def test_minigraph_neighbor_metadata(self): 'server1': { 'hwsku': 'server-sku', 'lo_addr': '10.10.10.1/32', - 'lo_addr_v6': 'fe80::0001/128', + 'lo_addr_v6': 'fe80::0001/80', 'mgmt_addr': '10.0.0.1/32', 'type': 'Server' }, @@ -190,6 +248,12 @@ def test_metadata_tacacs(self): output = self.run_script(argument) self.assertEqual(output.strip(), "{'10.0.10.7': {'priority': '1', 'tcp_port': '49'}, '10.0.10.8': {'priority': '1', 'tcp_port': '49'}}") + def test_metadata_kube(self): + argument = '-m "' + self.sample_graph + '" -p "' + self.port_config + '" -v "KUBERNETES_MASTER[\'SERVER\']"' + output = self.run_script(argument) + self.assertEqual(json.loads(output.strip().replace("'", "\"")), + json.loads('{"ip": "10.10.10.10", "disable": "True"}')) + def test_minigraph_mgmt_port(self): argument = '-m "' + self.sample_graph + '" -p "' + self.port_config + '" -v "MGMT_PORT"' output = self.run_script(argument) @@ -244,7 +308,35 @@ def test_minigraph_storage_device(self): argument = '-m "' + self.sample_graph + '" -p "' + self.port_config + '" -v "DEVICE_METADATA[\'localhost\'][\'storage_device\']"' output = self.run_script(argument) self.assertEqual(output.strip(), "true") - + + def test_minigraph_storage_backend_no_resource_type(self): + self.verify_storage_device_set(self.sample_simple_graph) + + def test_minigraph_storage_backend_resource_type(self): + self.verify_storage_device_set(self.sample_resource_graph) + + def test_minigraph_storage_backend_subintf(self): + self.verify_storage_device_set(self.sample_subintf_graph) + + def verify_storage_device_set(self, graph_file, check_stderr=False): + try: + print('\n Change device type to %s' % (BACKEND_TOR_ROUTER)) + if check_stderr: + output = subprocess.check_output("sed -i \'s/%s/%s/g\' %s" % (TOR_ROUTER, BACKEND_TOR_ROUTER, graph_file), stderr=subprocess.STDOUT, shell=True) + else: + output = subprocess.check_output("sed -i \'s/%s/%s/g\' %s" % (TOR_ROUTER, BACKEND_TOR_ROUTER, graph_file), shell=True) + + argument = '-m "' + graph_file + '" -p "' + self.port_config + '" -v "DEVICE_METADATA[\'localhost\'][\'storage_device\']"' + output = self.run_script(argument) + self.assertEqual(output.strip(), "true") + + finally: + print('\n Change device type back to %s' % (TOR_ROUTER)) + if check_stderr: + output = subprocess.check_output("sed -i \'s/%s/%s/g\' %s" % (BACKEND_TOR_ROUTER, TOR_ROUTER, graph_file), stderr=subprocess.STDOUT, shell=True) + else: + output = subprocess.check_output("sed -i \'s/%s/%s/g\' %s" % (BACKEND_TOR_ROUTER, TOR_ROUTER, graph_file), shell=True) + def test_minigraph_tunnel_table(self): argument = '-m "' + self.sample_graph + '" -p "' + self.port_config + '" -v "TUNNEL"' expected_tunnel = { @@ -263,6 +355,50 @@ def test_minigraph_tunnel_table(self): utils.to_dict(output.strip()), expected_tunnel ) + + # Validate tunnel config is as before when tunnel_qos_remap = disabled + sample_graph_disabled_remap = os.path.join(self.test_dir, 'simple-sample-graph-case-remap-disabled.xml') + argument = '-m "' + sample_graph_disabled_remap + '" -p "' + self.port_config + '" -v "TUNNEL"' + + output = self.run_script(argument) + self.assertEqual( + utils.to_dict(output.strip()), + expected_tunnel + ) + + # Validate extra config is generated when tunnel_qos_remap = enabled + sample_graph_enabled_remap = os.path.join(self.test_dir, 'simple-sample-graph-case-remap-enabled.xml') + argument = '-m "' + sample_graph_enabled_remap + '" -p "' + self.port_config + '" -v "TUNNEL"' + expected_tunnel = { + "MuxTunnel0": { + "tunnel_type": "IPINIP", + "src_ip": "25.1.1.10", + "dst_ip": "10.1.0.32", + "dscp_mode": "pipe", + "encap_ecn_mode": "standard", + "ecn_mode": "copy_from_outer", + "ttl_mode": "pipe", + "decap_dscp_to_tc_map": "[DSCP_TO_TC_MAP|AZURE_TUNNEL]", + "decap_tc_to_pg_map": "[TC_TO_PRIORITY_GROUP_MAP|AZURE_TUNNEL]", + "encap_tc_to_dscp_map": "[TC_TO_DSCP_MAP|AZURE_TUNNEL]", + "encap_tc_to_queue_map": "[TC_TO_QUEUE_MAP|AZURE_TUNNEL]" + } + } + + output = self.run_script(argument) + self.assertEqual( + utils.to_dict(output.strip()), + expected_tunnel + ) + + # Validate extra config for mux tunnel is generated automatically when tunnel_qos_remap = enabled + sample_graph_enabled_remap = os.path.join(self.test_dir, 'simple-sample-graph-case-remap-enabled-no-tunnel-attributes.xml') + argument = '-m "' + sample_graph_enabled_remap + '" -p "' + self.port_config + '" -v "TUNNEL"' + output = self.run_script(argument) + self.assertEqual( + utils.to_dict(output.strip()), + expected_tunnel + ) def test_minigraph_mux_cable_table(self): argument = '-m "' + self.sample_graph + '" -p "' + self.port_config + '" -v "MUX_CABLE"' @@ -270,12 +406,12 @@ def test_minigraph_mux_cable_table(self): 'Ethernet4': { 'state': 'auto', 'server_ipv4': '10.10.10.1/32', - 'server_ipv6': 'fe80::0001/128' + 'server_ipv6': 'fe80::1/128' }, 'Ethernet8': { 'state': 'auto', 'server_ipv4': '10.10.10.2/32', - 'server_ipv6': 'fe80::0002/128' + 'server_ipv6': 'fe80::2/128' } } @@ -284,4 +420,55 @@ def test_minigraph_mux_cable_table(self): utils.to_dict(output.strip()), expected_table ) - \ No newline at end of file + + def test_dhcp_table(self): + argument = '-m "' + self.sample_graph + '" -p "' + self.port_config + '" -v "DHCP_RELAY"' + expected = { + 'Vlan1000': { + 'dhcpv6_servers': [ + "fc02:2000::1", + "fc02:2000::2" + ] + }, + 'Vlan2000': { + 'dhcpv6_servers': [ + "fc02:2000::3", + "fc02:2000::4" + ] + } + } + output = self.run_script(argument) + self.assertEqual( + utils.to_dict(output.strip()), + expected + ) + + def test_minigraph_mirror_dscp(self): + result = minigraph.parse_xml(self.sample_graph, port_config_file=self.port_config) + self.assertTrue('EVERFLOW_DSCP' in result['ACL_TABLE']) + everflow_dscp_entry = result['ACL_TABLE']['EVERFLOW_DSCP'] + + self.assertEqual(everflow_dscp_entry['type'], 'MIRROR_DSCP') + self.assertEqual(everflow_dscp_entry['stage'], 'ingress') + expected_ports = ['PortChannel01', 'Ethernet12', 'Ethernet8', 'Ethernet0'] + self.assertEqual( + everflow_dscp_entry['ports'].sort(), + expected_ports.sort() + ) + + def test_parse_device_desc_xml_mgmt_interface(self): + # Regular device_desc.xml with both IPv4 and IPv6 mgmt address + result = minigraph.parse_device_desc_xml(self.sample_simple_device_desc) + mgmt_intf = result['MGMT_INTERFACE'] + self.assertEqual(len(mgmt_intf.keys()), 2) + self.assertTrue(('eth0', '10.0.0.100/24') in mgmt_intf.keys()) + self.assertTrue(('eth0', 'FC00:1::32/64') in mgmt_intf.keys()) + self.assertTrue(ipaddress.ip_address(u'10.0.0.1') == mgmt_intf[('eth0', '10.0.0.100/24')]['gwaddr']) + self.assertTrue(ipaddress.ip_address(u'fc00:1::1') == mgmt_intf[('eth0', 'FC00:1::32/64')]['gwaddr']) + + # Special device_desc.xml with IPv6 mgmt address only + result = minigraph.parse_device_desc_xml(self.sample_simple_device_desc_ipv6_only) + mgmt_intf = result['MGMT_INTERFACE'] + self.assertEqual(len(mgmt_intf.keys()), 1) + self.assertTrue(('eth0', 'FC00:1::32/64') in mgmt_intf.keys()) + self.assertTrue(ipaddress.ip_address(u'fc00:1::1') == mgmt_intf[('eth0', 'FC00:1::32/64')]['gwaddr']) diff --git a/src/sonic-config-engine/tests/test_multinpu_cfggen.py b/src/sonic-config-engine/tests/test_multinpu_cfggen.py index 83955925c9e5..8c4e097ebff3 100644 --- a/src/sonic-config-engine/tests/test_multinpu_cfggen.py +++ b/src/sonic-config-engine/tests/test_multinpu_cfggen.py @@ -1,3 +1,4 @@ +import filecmp import json import os import shutil @@ -23,9 +24,12 @@ def setUp(self): self.test_data_dir = os.path.join(self.test_dir, 'multi_npu_data') self.script_file = utils.PYTHON_INTERPRETTER + ' ' + os.path.join(self.test_dir, '..', 'sonic-cfggen') self.sample_graph = os.path.join(self.test_data_dir, 'sample-minigraph.xml') + self.sample_graph1 = os.path.join(self.test_data_dir, 'sample-minigraph-noportchannel.xml') self.port_config = [] for asic in range(NUM_ASIC): self.port_config.append(os.path.join(self.test_data_dir, "sample_port_config-{}.ini".format(asic))) + self.output_file = os.path.join(self.test_dir, 'output') + os.environ["CFGGEN_UNIT_TESTING"] = "2" def run_script(self, argument, check_stderr=False): print('\n Running sonic-cfggen ' + argument) @@ -47,6 +51,22 @@ def run_script(self, argument, check_stderr=False): def run_diff(self, file1, file2): return subprocess.check_output('diff -u {} {} || true'.format(file1, file2), shell=True) + def run_frr_asic_case(self, template, target, asic, port_config): + template_dir = os.path.join(self.test_dir, '..', '..', '..', 'dockers', 'docker-fpm-frr', "frr") + conf_template = os.path.join(template_dir, template) + constants = os.path.join(self.test_dir, '..', '..', '..', 'files', 'image_config', 'constants', 'constants.yml') + cmd_args = asic, self.sample_graph, port_config, constants, conf_template, template_dir, self.output_file + cmd = "-n %s -m %s -p %s -y %s -t %s -T %s > %s" % cmd_args + self.run_script(cmd) + + original_filename = os.path.join(self.test_dir, 'sample_output', utils.PYvX_DIR, target) + r = filecmp.cmp(original_filename, self.output_file) + diff_output = self.run_diff(original_filename, self.output_file) if not r else "" + + return r, "Diff:\n" + diff_output + + + def run_script_for_asic(self,argument,asic, port_config=None): argument = "{} -n asic{} ".format(argument, asic) if port_config: @@ -165,6 +185,14 @@ def test_frontend_asic_portchannel_intf(self): utils.liststr_to_dict("['PortChannel4001|10.1.0.1/31', 'PortChannel0002|FC00::1/126', 'PortChannel4002|10.1.0.3/31', 'PortChannel0002', 'PortChannel0002|10.0.0.0/31', 'PortChannel4001', 'PortChannel4002']") ) + def test_frontend_asic_routerport_intf(self): + argument = "-m {} -p {} -n asic0 -v \"INTERFACE.keys()|list\"".format(self.sample_graph1, self.port_config[0]) + output = self.run_script(argument) + self.assertEqual( + utils.liststr_to_dict(output.strip()), + utils.liststr_to_dict("['Ethernet0', ('Ethernet0', '10.0.0.0/31'), 'Ethernet4', ('Ethernet0', 'FC00::1/126'), ('Ethernet4', 'FC00::2/126'), ('Ethernet4', '10.0.0.2/31')]") + ) + def test_backend_asic_portchannel_intf(self): argument = "-m {} -p {} -n asic3 -v \"PORTCHANNEL_INTERFACE.keys()|list\"".format(self.sample_graph, self.port_config[3]) output = self.run_script(argument) @@ -176,15 +204,28 @@ def test_backend_asic_portchannel_intf(self): def test_frontend_asic_ports(self): argument = "-m {} -p {} -n asic0 --var-json \"PORT\"".format(self.sample_graph, self.port_config[0]) output = json.loads(self.run_script(argument)) - self.assertDictEqual(output, \ - {"Ethernet0": { "admin_status": "up", "alias": "Ethernet1/1", "asic_port_name": "Eth0-ASIC0", "description": "01T2:Ethernet1", "index": "0", "lanes": "33,34,35,36", "mtu": "9100", "pfc_asym": "off", "role": "Ext", "speed": "40000" }, - "Ethernet4": { "admin_status": "up", "alias": "Ethernet1/2", "asic_port_name": "Eth1-ASIC0", "description": "01T2:Ethernet2", "index": "1", "lanes": "29,30,31,32", "mtu": "9100", "pfc_asym": "off", "role": "Ext", "speed": "40000" }, - "Ethernet8": { "alias": "Ethernet1/3", "asic_port_name": "Eth2-ASIC0", "description": "Ethernet1/3", "index": "2", "lanes": "41,42,43,44", "mtu": "9100", "pfc_asym": "off", "role": "Ext", "speed": "40000" }, - "Ethernet12": { "alias": "Ethernet1/4", "asic_port_name": "Eth3-ASIC0", "description": "Ethernet1/4", "index": "3", "lanes": "37,38,39,40", "mtu": "9100", "pfc_asym": "off", "role": "Ext", "speed": "40000" }, - "Ethernet-BP0": { "admin_status": "up", "alias": "Eth4-ASIC0", "asic_port_name": "Eth4-ASIC0", "description": "ASIC2:Eth0-ASIC2", "index": "0", "lanes": "13,14,15,16", "mtu": "9100", "pfc_asym": "off", "role": "Int", "speed": "40000" }, - "Ethernet-BP4": { "admin_status": "up", "alias": "Eth5-ASIC0", "asic_port_name": "Eth5-ASIC0", "description": "ASIC2:Eth1-ASIC2", "index": "1", "lanes": "17,18,19,20", "mtu": "9100", "pfc_asym": "off", "role": "Int", "speed": "40000" }, - "Ethernet-BP8": { "admin_status": "up", "alias": "Eth6-ASIC0", "asic_port_name": "Eth6-ASIC0", "description": "ASIC3:Eth0-ASIC3", "index": "2", "lanes": "21,22,23,24", "mtu": "9100", "pfc_asym": "off", "role": "Int", "speed": "40000" }, - "Ethernet-BP12": { "admin_status": "up", "alias": "Eth7-ASIC0", "asic_port_name": "Eth7-ASIC0", "description": "ASIC3:Eth1-ASIC3", "index": "3", "lanes": "25,26,27,28", "mtu": "9100", "pfc_asym": "off", "role": "Int", "speed": "40000" }}) + self.assertDictEqual(output, + {"Ethernet0": { "admin_status": "up", "alias": "Ethernet1/1", "asic_port_name": "Eth0-ASIC0", "description": "01T2:Ethernet1", "index": "0", "lanes": "33,34,35,36", "mtu": "9100", "pfc_asym": "off", "role": "Ext", "speed": "40000", "autoneg": "1" }, + "Ethernet4": { "admin_status": "up", "alias": "Ethernet1/2", "asic_port_name": "Eth1-ASIC0", "description": "01T2:Ethernet2", "index": "1", "lanes": "29,30,31,32", "mtu": "9100", "pfc_asym": "off", "role": "Ext", "speed": "40000", "autoneg": "1" }, + "Ethernet8": { "alias": "Ethernet1/3", "asic_port_name": "Eth2-ASIC0", "description": "Ethernet1/3", "index": "2", "lanes": "41,42,43,44", "mtu": "9100", "pfc_asym": "off", "role": "Ext", "speed": "40000" }, + "Ethernet12": { "alias": "Ethernet1/4", "asic_port_name": "Eth3-ASIC0", "description": "Ethernet1/4", "index": "3", "lanes": "37,38,39,40", "mtu": "9100", "pfc_asym": "off", "role": "Ext", "speed": "40000" }, + "Ethernet-BP0": { "admin_status": "up", "alias": "Eth4-ASIC0", "asic_port_name": "Eth4-ASIC0", "description": "ASIC2:Eth0-ASIC2", "index": "0", "lanes": "13,14,15,16", "mtu": "9100", "pfc_asym": "off", "role": "Int", "speed": "40000" }, + "Ethernet-BP4": { "admin_status": "up", "alias": "Eth5-ASIC0", "asic_port_name": "Eth5-ASIC0", "description": "ASIC2:Eth1-ASIC2", "index": "1", "lanes": "17,18,19,20", "mtu": "9100", "pfc_asym": "off", "role": "Int", "speed": "40000" }, + "Ethernet-BP8": { "admin_status": "up", "alias": "Eth6-ASIC0", "asic_port_name": "Eth6-ASIC0", "description": "ASIC3:Eth0-ASIC3", "index": "2", "lanes": "21,22,23,24", "mtu": "9100", "pfc_asym": "off", "role": "Int", "speed": "40000" }, + "Ethernet-BP12": { "admin_status": "up", "alias": "Eth7-ASIC0", "asic_port_name": "Eth7-ASIC0", "description": "ASIC3:Eth1-ASIC3", "index": "3", "lanes": "25,26,27,28", "mtu": "9100", "pfc_asym": "off", "role": "Int", "speed": "40000" }}) + + def test_frontend_asic_ports_config_db(self): + argument = "-m {} -n asic0 --var-json \"PORT\"".format(self.sample_graph) + output = json.loads(self.run_script(argument)) + self.assertDictEqual(output, + {"Ethernet0": { "admin_status": "up", "alias": "Ethernet1/1", "asic_port_name": "Eth0-ASIC0", "description": "01T2:Ethernet1:config_db", "index": "0", "lanes": "33,34,35,36", "mtu": "9100", "pfc_asym": "off", "role": "Ext", "speed": "40000", "autoneg": "1" }, + "Ethernet4": { "admin_status": "up", "alias": "Ethernet1/2", "asic_port_name": "Eth1-ASIC0", "description": "01T2:Ethernet2:config_db", "index": "1", "lanes": "29,30,31,32", "mtu": "9100", "pfc_asym": "off", "role": "Ext", "speed": "40000", "autoneg": "1" }, + "Ethernet8": { "admin_status": "up", "alias": "Ethernet1/3", "asic_port_name": "Eth2-ASIC0", "description": "Ethernet1/3:config_db", "index": "2", "lanes": "41,42,43,44", "mtu": "9100", "pfc_asym": "off", "role": "Ext", "speed": "40000" }, + "Ethernet12": { "admin_status": "up", "alias": "Ethernet1/4", "asic_port_name": "Eth3-ASIC0", "description": "Ethernet1/4:config_db", "index": "3", "lanes": "37,38,39,40", "mtu": "9100", "pfc_asym": "off", "role": "Ext", "speed": "40000" }, + "Ethernet-BP0": { "admin_status": "up", "alias": "Eth4-ASIC0", "asic_port_name": "Eth4-ASIC0", "description": "ASIC2:Eth0-ASIC2:config_db", "index": "0", "lanes": "13,14,15,16", "mtu": "9100", "pfc_asym": "off", "role": "Int", "speed": "40000" }, + "Ethernet-BP4": { "admin_status": "up", "alias": "Eth5-ASIC0", "asic_port_name": "Eth5-ASIC0", "description": "ASIC2:Eth1-ASIC2:config_db", "index": "1", "lanes": "17,18,19,20", "mtu": "9100", "pfc_asym": "off", "role": "Int", "speed": "40000" }, + "Ethernet-BP8": { "admin_status": "up", "alias": "Eth6-ASIC0", "asic_port_name": "Eth6-ASIC0", "description": "ASIC3:Eth0-ASIC3:config_db", "index": "2", "lanes": "21,22,23,24", "mtu": "9100", "pfc_asym": "off", "role": "Int", "speed": "40000" }, + "Ethernet-BP12": { "admin_status": "up", "alias": "Eth7-ASIC0", "asic_port_name": "Eth7-ASIC0", "description": "ASIC3:Eth1-ASIC3:config_db", "index": "3", "lanes": "25,26,27,28", "mtu": "9100", "pfc_asym": "off", "role": "Int", "speed": "40000" }}) def test_frontend_asic_device_neigh(self): argument = "-m {} -p {} -n asic0 --var-json \"DEVICE_NEIGHBOR\"".format(self.sample_graph, self.port_config[0]) @@ -264,6 +305,15 @@ def test_global_asic_acl(self): 'EVERFLOWV6':{'policy_desc': 'EVERFLOWV6', 'ports': ['PortChannel0002','PortChannel0008'], 'stage': 'ingress', 'type': 'MIRRORV6'}, 'SNMP_ACL': {'policy_desc': 'SNMP_ACL', 'services': ['SNMP'], 'stage': 'ingress', 'type': 'CTRLPLANE'}, 'SSH_ONLY': {'policy_desc': 'SSH_ONLY', 'services': ['SSH'], 'stage': 'ingress', 'type': 'CTRLPLANE'}}) + def test_global_asic_acl1(self): + argument = "-m {} --var-json \"ACL_TABLE\"".format(self.sample_graph1) + output = json.loads(self.run_script(argument)) + self.assertDictEqual(output, {\ + 'EVERFLOW': {'policy_desc': 'EVERFLOW', 'ports': [], 'stage': 'ingress', 'type': 'MIRROR'}, + 'EVERFLOWV6':{'policy_desc': 'EVERFLOWV6', 'ports': [], 'stage': 'ingress', 'type': 'MIRRORV6'}, + 'SNMP_ACL': {'policy_desc': 'SNMP_ACL', 'services': ['SNMP'], 'stage': 'ingress', 'type': 'CTRLPLANE'}, + 'SSH_ONLY': {'policy_desc': 'SSH_ONLY', 'services': ['SSH'], 'stage': 'ingress', 'type': 'CTRLPLANE'}}) + def test_front_end_asic_acl(self): argument = "-m {} -p {} -n asic0 --var-json \"ACL_TABLE\"".format(self.sample_graph, self.port_config[0]) @@ -275,11 +325,27 @@ def test_front_end_asic_acl(self): 'SNMP_ACL': {'policy_desc': 'SNMP_ACL', 'services': ['SNMP'], 'stage': 'ingress', 'type': 'CTRLPLANE'}, 'SSH_ONLY': {'policy_desc': 'SSH_ONLY', 'services': ['SSH'], 'stage': 'ingress', 'type': 'CTRLPLANE'}}) + def test_front_end_asic_acl1(self): + argument = "-m {} -p {} -n asic0 --var-json \"ACL_TABLE\"".format(self.sample_graph1, self.port_config[0]) + output = json.loads(self.run_script(argument)) + self.assertDictEqual(output, {\ + 'EVERFLOW': {'policy_desc': 'EVERFLOW', 'ports': ['Ethernet0','Ethernet4'], 'stage': 'ingress', 'type': 'MIRROR'}, + 'EVERFLOWV6':{'policy_desc': 'EVERFLOWV6', 'ports': ['Ethernet0','Ethernet4'], 'stage': 'ingress', 'type': 'MIRRORV6'}, + 'SNMP_ACL': {'policy_desc': 'SNMP_ACL', 'services': ['SNMP'], 'stage': 'ingress', 'type': 'CTRLPLANE'}, + 'SSH_ONLY': {'policy_desc': 'SSH_ONLY', 'services': ['SSH'], 'stage': 'ingress', 'type': 'CTRLPLANE'}}) + + def test_back_end_asic_acl(self): argument = "-m {} -p {} -n asic3 --var-json \"ACL_TABLE\"".format(self.sample_graph, self.port_config[3]) output = json.loads(self.run_script(argument)) self.assertDictEqual(output, {}) + def test_back_end_asic_acl1(self): + argument = "-m {} -p {} -n asic3 --var-json \"ACL_TABLE\"".format(self.sample_graph1, self.port_config[3]) + output = json.loads(self.run_script(argument)) + self.assertDictEqual(output, {}) + + def test_loopback_intfs(self): argument = "-m {} --var-json \"LOOPBACK_INTERFACE\"".format(self.sample_graph) output = json.loads(self.run_script(argument)) @@ -341,14 +407,22 @@ def test_buffers_multi_asic_template(self): output['CABLE_LENGTH'], { 'AZURE': { - 'Ethernet8': '300m', + 'Ethernet8': '0m', 'Ethernet0': '300m', 'Ethernet4': '300m', 'Ethernet-BP4': '5m', 'Ethernet-BP0': '5m', 'Ethernet-BP12': '5m', 'Ethernet-BP8': '5m', - 'Ethernet12': '300m' + 'Ethernet12': '0m' } } ) + def test_bgpd_frr_frontendasic(self): + self.assertTrue(*self.run_frr_asic_case('bgpd/bgpd.conf.j2', 'bgpd_frr_frontend_asic.conf', "asic0", self.port_config[0])) + + def test_bgpd_frr_backendasic(self): + self.assertTrue(*self.run_frr_asic_case('bgpd/bgpd.conf.j2', 'bgpd_frr_backend_asic.conf', "asic3", self.port_config[3])) + + def tearDown(self): + os.environ["CFGGEN_UNIT_TESTING"] = "" diff --git a/src/sonic-ctrmgrd/.gitignore b/src/sonic-ctrmgrd/.gitignore index bdebd5e838cd..2f42f4d2c5ea 100644 --- a/src/sonic-ctrmgrd/.gitignore +++ b/src/sonic-ctrmgrd/.gitignore @@ -10,3 +10,4 @@ tests/__pycache__/ ctrmgr/__pycache__/ venv tests/.coverage* +.pytest_cache/ \ No newline at end of file diff --git a/src/sonic-ctrmgrd/ctrmgr/container b/src/sonic-ctrmgrd/ctrmgr/container index ca0963946f4a..ca2394b057bb 100755 --- a/src/sonic-ctrmgrd/ctrmgr/container +++ b/src/sonic-ctrmgrd/ctrmgr/container @@ -26,9 +26,14 @@ CONTAINER_ID = "container_id" REMOTE_STATE = "remote_state" VERSION = "container_version" SYSTEM_STATE = "system_state" +STATE = "state" KUBE_LABEL_TABLE = "KUBE_LABELS" KUBE_LABEL_SET_KEY = "SET" +SERVER_TABLE = "KUBERNETES_MASTER" +SERVER_KEY = "SERVER" +ST_SER_CONNECTED = "connected" +ST_SER_UPDATE_TS = "update_time" # Get seconds to wait for remote docker to start. # If not, revert to local @@ -38,6 +43,9 @@ SONIC_CTR_CONFIG_PEND_SECS = "revert_to_local_on_wait_seconds" DEFAULT_PEND_SECS = ( 5 * 60 ) WAIT_POLL_SECS = 2 +SUCCESS = 0 +FAILURE = -1 + remote_ctr_enabled = False def debug_msg(m): @@ -71,8 +79,10 @@ def read_data(is_config, feature, fields): ret = [] db = cfg_db if is_config else state_db - - tbl = swsscommon.Table(db, FEATURE_TABLE) + if feature == SERVER_KEY: + tbl = swsscommon.Table(db, SERVER_TABLE) + else: + tbl = swsscommon.Table(db, FEATURE_TABLE) data = dict(tbl.get(feature)[1]) for (field, default) in fields: @@ -87,10 +97,10 @@ def read_data(is_config, feature, fields): def read_config(feature): """ Read requried feature config """ - set_owner, no_fallback = read_data(True, feature, - [(SET_OWNER, "local"), (NO_FALLBACK, False)]) + set_owner, no_fallback, state = read_data(True, feature, + [(SET_OWNER, "local"), (NO_FALLBACK, False), (STATE, "disabled")]) - return (set_owner, not no_fallback) + return (set_owner, not no_fallback, state) def read_state(feature): @@ -100,19 +110,26 @@ def read_state(feature): [(CURRENT_OWNER, "none"), (REMOTE_STATE, "none"), (CONTAINER_ID, "")]) -def docker_action(action, feature): +def read_server_state(): + """ Read requried feature state """ + + return read_data(False, SERVER_KEY, + [(ST_SER_CONNECTED, "false"), (ST_SER_UPDATE_TS, "")]) + + +def docker_action(action, feature, **kwargs): """ Execute docker action """ try: client = docker.from_env() container = client.containers.get(feature) - getattr(container, action)() + getattr(container, action)(**kwargs) syslog.syslog(syslog.LOG_INFO, "docker cmd: {} for {}".format(action, feature)) - return 0 + return SUCCESS except (docker.errors.NotFound, docker.errors.APIError) as err: syslog.syslog(syslog.LOG_ERR, "docker cmd: {} for {} failed with {}". format(action, feature, str(err))) - return -1 + return FAILURE def set_label(feature, create): @@ -161,7 +178,7 @@ def container_id(feature): return data.get(CONTAINER_ID, feature) -def container_start(feature): +def container_start(feature, **kwargs): """ Starts a container for given feature. @@ -186,11 +203,12 @@ def container_start(feature): init() - set_owner, fallback = read_config(feature) + set_owner, fallback, _ = read_config(feature) _, remote_state, _ = read_state(feature) + server_connected, _ = read_server_state() - debug_msg("{}: set_owner:{} fallback:{} remote_state:{}".format( - feature, set_owner, fallback, remote_state)) + debug_msg("{}: set_owner:{} fallback:{} remote_state:{} server_connected:{}".format( + feature, set_owner, fallback, remote_state, server_connected)) data = { SYSTEM_STATE: "up", @@ -203,8 +221,9 @@ def container_start(feature): start_val = START_LOCAL else: start_val = START_KUBE - if fallback and (remote_state == "none"): + if fallback and (remote_state == "none" or server_connected == "false"): start_val |= START_LOCAL + data[REMOTE_STATE] = "none" if start_val == START_LOCAL: # Implies *only* local. @@ -219,7 +238,7 @@ def container_start(feature): update_data(feature, data) if (start_val & START_LOCAL): - ret = docker_action("start", feature) + ret = docker_action("start", feature, **kwargs) if (start_val & START_KUBE): set_label(feature, True) @@ -227,7 +246,7 @@ def container_start(feature): return ret -def container_stop(feature): +def container_stop(feature, **kwargs): """ Stops the running container for this feature. @@ -244,8 +263,8 @@ def container_stop(feature): debug_msg("BEGIN") init() - - set_owner, _ = read_config(feature) + ret = SUCCESS + set_owner, _ , _ = read_config(feature) current_owner, remote_state, _ = read_state(feature) docker_id = container_id(feature) remove_label = (remote_state != "pending") or (set_owner == "local") @@ -257,7 +276,7 @@ def container_stop(feature): set_label(feature, False) if docker_id: - docker_action("stop", docker_id) + ret = docker_action("stop", docker_id, **kwargs) else: syslog.syslog( syslog.LOG_ERR if current_owner != "none" else syslog.LOG_INFO, @@ -278,7 +297,6 @@ def container_stop(feature): CURRENT_OWNER: "none", UPD_TIMESTAMP: str(datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")), CONTAINER_ID: "", - VERSION: "", SYSTEM_STATE: "down" } if remote_state == "running": @@ -287,9 +305,10 @@ def container_stop(feature): update_data(feature, data) debug_msg("END") + return ret -def container_kill(feature): +def container_kill(feature, **kwargs): """ Kills the running container for this feature. @@ -302,19 +321,25 @@ def container_kill(feature): init() - set_owner, _ = read_config(feature) + ret = SUCCESS + set_owner, _ , state = read_config(feature) current_owner, remote_state, _ = read_state(feature) docker_id = container_id(feature) remove_label = (set_owner != "local") or (current_owner != "local") - debug_msg("{}: set_owner:{} current_owner:{} remote_state:{} docker_id:{}".format( - feature, set_owner, current_owner, remote_state, docker_id)) + debug_msg("{}: set_owner:{} current_owner:{} remote_state:{} docker_id:{} state:{}".format( + feature, set_owner, current_owner, remote_state, docker_id, state)) if remove_label: set_label(feature, False) + if set_owner == "local": + if state not in ["enabled", "always_enabled"]: + debug_msg("{} is not enabled".format(feature)) + return FAILURE + if docker_id: - docker_action("kill", docker_id) + ret = docker_action("kill", docker_id, **kwargs) else: syslog.syslog( @@ -323,9 +348,10 @@ def container_kill(feature): debug_msg("END") + return ret -def container_wait(feature): +def container_wait(feature, **kwargs): """ Waits on the running container for this feature. @@ -342,10 +368,11 @@ def container_wait(feature): init() - set_owner, fallback = read_config(feature) + set_owner, fallback, _ = read_config(feature) current_owner, remote_state, _ = read_state(feature) docker_id = container_id(feature) pend_wait_secs = 0 + ret = SUCCESS if not docker_id and fallback: pend_wait_secs = get_config_data( @@ -378,32 +405,39 @@ def container_wait(feature): format(feature)) else: debug_msg("END -- transitioning to docker wait") - docker_action("wait", docker_id) + ret = docker_action("wait", docker_id, **kwargs) + return ret def main(): parser=argparse.ArgumentParser(description="container commands for start/stop/wait/kill/id") parser.add_argument("action", choices=["start", "stop", "wait", "kill", "id"]) + parser.add_argument('-t', '--timeout', type=int, help='container action timeout value', default=None) parser.add_argument("name") args = parser.parse_args() + kwargs = {} + ret = 0 if args.action == "start": - container_start(args.name) + ret = container_start(args.name, **kwargs) elif args.action == "stop": - container_stop(args.name) + if args.timeout is not None: + kwargs['timeout'] = args.timeout + ret = container_stop(args.name, **kwargs) elif args.action == "kill": - container_kill(args.name) + ret = container_kill(args.name, **kwargs) elif args.action == "wait": - container_wait(args.name) + ret = container_wait(args.name, **kwargs) elif args.action == "id": - id = container_id(args.name) + id = container_id(args.name, **kwargs) print(id) + return ret if __name__ == "__main__": main() diff --git a/src/sonic-ctrmgrd/ctrmgr/container_startup.py b/src/sonic-ctrmgrd/ctrmgr/container_startup.py index c56160aa488d..2af8e0b3845a 100755 --- a/src/sonic-ctrmgrd/ctrmgr/container_startup.py +++ b/src/sonic-ctrmgrd/ctrmgr/container_startup.py @@ -28,7 +28,6 @@ def debug_msg(m): msg = "{}: {}".format(inspect.stack()[1][3], m) - print(msg) syslog.syslog(syslog.LOG_DEBUG, msg) @@ -229,15 +228,6 @@ def container_up(feature, owner, version): do_freeze(feature, "This version is marked disabled. Exiting ...") return - if not instance_higher(feature, state_data[VERSION], version): - # TODO: May Remove label __enabled - # Else kubelet will continue to re-deploy every 5 mins, until - # master removes the lable to un-deploy. - # - do_freeze(feature, "bail out as current deploy version {} is not higher". - format(version)) - return - update_data(state_db, feature, { VERSION: version }) mode = state_data[REMOTE_STATE] diff --git a/src/sonic-ctrmgrd/ctrmgr/ctrmgr_iptables.py b/src/sonic-ctrmgrd/ctrmgr/ctrmgr_iptables.py new file mode 100644 index 000000000000..74b9bfe44fc9 --- /dev/null +++ b/src/sonic-ctrmgrd/ctrmgr/ctrmgr_iptables.py @@ -0,0 +1,135 @@ +#!/usr/bin/env python3 + +import ipaddress +import os +import re +import socket +import subprocess +import syslog + +UNIT_TESTING = 0 + +# NOTE: +# Unable to use python-iptables as that does not create rules per ip-tables default +# which is nf_tables. So rules added via iptc package will not be listed under +# "sudo iptables -t nat -L -n". But available in kernel. To list, we need to +# use legacy mode as "sudo iptables-legacy -t nat -L -n". +# As we can't use two modes and using non-default could make any debugging effort +# very tough. + + +from urllib.parse import urlparse + +DST_FILE = "/etc/systemd/system/docker.service.d/http_proxy.conf" +DST_IP = None +DST_PORT = None +SQUID_PORT = "3128" + +def _get_ip(ip_str): + ret = "" + if ip_str: + try: + ipaddress.ip_address(ip_str) + ret = ip_str + except ValueError: + pass + + if not ret: + try: + ret = socket.gethostbyname(ip_str) + except (OSError, socket.error): + pass + if not ret: + syslog.syslog(syslog.LOG_ERR, "{} is neither IP nor resolves to IP". + format(ip_str)) + return ret + + +def _get_dst_info(): + global DST_IP, DST_PORT + DST_IP = None + DST_PORT = None + print("DST_FILE={}".format(DST_FILE)) + if os.path.exists(DST_FILE): + with open(DST_FILE, "r") as s: + for line in s.readlines(): + url_match = re.search('^Environment=.HTTP_PROXY=(.+?)"', line) + if url_match: + url = urlparse(url_match.group(1)) + DST_IP = _get_ip(url.hostname) + DST_PORT = url.port + break + else: + print("{} not available".format(DST_FILE)) + print("DST_IP={}".format(DST_IP)) + + +def _is_rule_match(rule): + expect = "DNAT tcp -- 0.0.0.0/0 {} tcp dpt:{} to:".format( + DST_IP, DST_PORT) + + # Remove duplicate spaces + rule = " ".join(rule.split()).strip() + + if rule.startswith(expect): + return rule[len(expect):] + else: + return "" + + +def check_proc(proc): + if proc.returncode: + syslog.syslog(syslog.LOG_ERR, "Failed to run: cmd: {}".format(proc.args)) + syslog.syslog(syslog.LOG_ERR, "Failed to run: stdout: {}".format(proc.stdout)) + syslog.syslog(syslog.LOG_ERR, "Failed to run: stderr: {}".format(proc.stderr)) + if not UNIT_TESTING: + assert False + + +def iptable_proxy_rule_upd(ip_str, port = SQUID_PORT): + _get_dst_info() + if not DST_IP: + # There is no proxy in use. Bail out. + return "" + + destination = "" + if ip_str: + upd_ip = _get_ip(ip_str) + if not upd_ip: + return "" + destination = "{}:{}".format(upd_ip, port) + + found = False + num = 0 + + while True: + num += 1 + + cmd = "sudo iptables -t nat -n -L OUTPUT {}".format(num) + proc = subprocess.run(cmd, shell=True, capture_output=True) + check_proc(proc) + + if not proc.stdout: + # No more rule + break + + rule_dest = _is_rule_match(proc.stdout.decode("utf-8").strip()) + if rule_dest: + if not found and destination and (rule_dest == destination): + found = True + else: + # Duplicate or different IP - delete it + cmd = "sudo iptables -t nat -D OUTPUT {}".format(num) + proc = subprocess.run(cmd, shell=True, capture_output=True) + check_proc(proc) + # Decrement number to accommodate deleted rule + num -= 1 + + if destination and not found: + cmd = "sudo iptables -t nat -A OUTPUT -p tcp -d {} --dport {} -j DNAT --to-destination {}".format( + DST_IP, DST_PORT, destination) + proc = subprocess.run(cmd, shell=True, capture_output=True) + + check_proc(proc) + + return destination diff --git a/src/sonic-ctrmgrd/ctrmgr/ctrmgrd.py b/src/sonic-ctrmgrd/ctrmgr/ctrmgrd.py index ba4f0057bd05..277266025cb9 100755 --- a/src/sonic-ctrmgrd/ctrmgr/ctrmgrd.py +++ b/src/sonic-ctrmgrd/ctrmgr/ctrmgrd.py @@ -8,6 +8,7 @@ import syslog from collections import defaultdict +from ctrmgr.ctrmgr_iptables import iptable_proxy_rule_upd from swsscommon import swsscommon from sonic_py_common import device_info @@ -59,7 +60,7 @@ CFG_SER_IP: "", CFG_SER_PORT: "6443", CFG_SER_DISABLE: "false", - CFG_SER_INSECURE: "false" + CFG_SER_INSECURE: "true" } dflt_st_ser = { @@ -87,24 +88,29 @@ JOIN_LATENCY = "join_latency_on_boot_seconds" JOIN_RETRY = "retry_join_interval_seconds" LABEL_RETRY = "retry_labels_update_seconds" +TAG_IMAGE_LATEST = "tag_latest_image_on_wait_seconds" +USE_K8S_PROXY = "use_k8s_as_http_proxy" remote_ctr_config = { JOIN_LATENCY: 10, JOIN_RETRY: 10, - LABEL_RETRY: 2 + LABEL_RETRY: 2, + TAG_IMAGE_LATEST: 30, + USE_K8S_PROXY: "" } def log_debug(m): msg = "{}: {}".format(inspect.stack()[1][3], m) - print(msg) syslog.syslog(syslog.LOG_DEBUG, msg) def log_error(m): + msg = "{}: {}".format(inspect.stack()[1][3], m) syslog.syslog(syslog.LOG_ERR, msg) def log_info(m): + msg = "{}: {}".format(inspect.stack()[1][3], m) syslog.syslog(syslog.LOG_INFO, msg) @@ -143,6 +149,8 @@ def init(): with open(SONIC_CTR_CONFIG, "r") as s: d = json.load(s) remote_ctr_config.update(d) + if UNIT_TESTING: + remote_ctr_config[TAG_IMAGE_LATEST] = 0 class MainServer: @@ -167,11 +175,11 @@ def register_db(self, db_name): self.db_connectors[db_name] = swsscommon.DBConnector(db_name, 0) - def register_timer(self, ts, handler): + def register_timer(self, ts, handler, args=None): """ Register timer based handler. The handler will be called on/after give timestamp, ts """ - self.timer_handlers[ts].append(handler) + self.timer_handlers[ts].append((handler, args)) def register_handler(self, db_name, table_name, handler): @@ -201,7 +209,7 @@ def mod_db_entry(self, db_name, table_name, key, data): """ Modify entry for given table|key with given dict type data """ conn = self.db_connectors[db_name] tbl = swsscommon.Table(conn, table_name) - print("mod_db_entry: db={} tbl={} key={} data={}".format(db_name, table_name, key, str(data))) + log_debug("mod_db_entry: db={} tbl={} key={} data={}".format(db_name, table_name, key, str(data))) tbl.set(key, list(data.items())) @@ -230,7 +238,10 @@ def run(self): lst = self.timer_handlers[k] del self.timer_handlers[k] for fn in lst: - fn() + if fn[1] is None: + fn[0]() + else: + fn[0](*fn[1]) else: timeout = (k - ct_ts).seconds break @@ -242,7 +253,7 @@ def run(self): if not UNIT_TESTING: raise Exception("Received error from select") else: - print("Skipped Exception; Received error from select") + log_debug("Skipped Exception; Received error from select") return for subscriber in self.subscribers: @@ -309,6 +320,9 @@ def __init__(self, server): self.start_time = datetime.datetime.now() + if remote_ctr_config[USE_K8S_PROXY] == "y": + iptable_proxy_rule_upd(self.cfg_server[CFG_SER_IP]) + if not self.st_server[ST_FEAT_UPDATE_TS]: # This is upon system start. Sleep 10m before join self.start_time += datetime.timedelta( @@ -336,6 +350,9 @@ def on_config_update(self, key, op, data): log_debug("Received config update: {}".format(str(data))) self.cfg_server = cfg_data + if remote_ctr_config[USE_K8S_PROXY] == "y": + iptable_proxy_rule_upd(self.cfg_server[CFG_SER_IP]) + if self.pending: tnow = datetime.datetime.now() if tnow < self.start_time: @@ -359,7 +376,7 @@ def handle_update(self): ip = self.cfg_server[CFG_SER_IP] disable = self.cfg_server[CFG_SER_DISABLE] != "false" - + pre_state = dict(self.st_server) log_debug("server: handle_update: disable={} ip={}".format(disable, ip)) if disable or not ip: @@ -415,6 +432,54 @@ def do_join(self, ip, port, insecure): format(remote_ctr_config[JOIN_RETRY], self.start_time)) +def tag_latest_image(server, feat, docker_id, image_ver): + res = 1 + if not UNIT_TESTING: + status = os.system("docker ps |grep {} >/dev/null".format(docker_id)) + if status: + syslog.syslog(syslog.LOG_ERR, + "Feature {}:{} is not stable".format(feat, image_ver)) + else: + image_item = os.popen("docker inspect {} |jq -r .[].Image".format(docker_id)).read().strip() + if image_item: + image_id = image_item.split(":")[1][:12] + image_info = os.popen("docker images |grep {}".format(image_id)).read().split() + if image_info: + image_rep = image_info[0] + res = os.system("docker tag {} {}:latest".format(image_id, image_rep)) + if res != 0: + syslog.syslog(syslog.LOG_ERR, + "Failed to tag {}:{} to latest".format(image_rep, image_ver)) + else: + syslog.syslog(syslog.LOG_INFO, + "Successfully tag {}:{} to latest".format(image_rep, image_ver)) + feat_status = os.popen("docker inspect {} |jq -r .[].State.Running".format(feat)).read().strip() + if feat_status: + if feat_status == 'true': + os.system("docker stop {}".format(feat)) + syslog.syslog(syslog.LOG_ERR, + "{} should not run, stop it".format(feat)) + os.system("docker rm {}".format(feat)) + syslog.syslog(syslog.LOG_INFO, + "Delete previous {} container".format(feat)) + else: + syslog.syslog(syslog.LOG_ERR, + "Failed to docker images |grep {} to get image repo".format(image_id)) + else: + syslog.syslog(syslog.LOG_ERR, + "Failed to inspect container:{} to get image id".format(docker_id)) + else: + server.mod_db_entry(STATE_DB_NAME, + FEATURE_TABLE, feat, {"tag_latest": "true"}) + res = 0 + if res: + log_debug("failed to tag {}:{} to latest".format(feat, image_ver)) + else: + log_debug("successfully tag {}:{} to latest".format(feat, image_ver)) + + return res + + # # Feature changes # @@ -512,6 +577,19 @@ def on_state_update(self, key, op, data): self.st_data[key] = _update_entry(dflt_st_feat, data) remote_state = self.st_data[key][ST_FEAT_REMOTE_STATE] + if (old_remote_state != remote_state) and (remote_state == "running"): + # Tag latest + start_time = datetime.datetime.now() + datetime.timedelta( + seconds=remote_ctr_config[TAG_IMAGE_LATEST]) + self.server.register_timer(start_time, tag_latest_image, ( + self.server, + key, + self.st_data[key][ST_FEAT_CTR_ID], + self.st_data[key][ST_FEAT_CTR_VER])) + + log_debug("try to tag latest label after {} seconds @{}".format( + remote_ctr_config[TAG_IMAGE_LATEST], start_time)) + if (not init) and ( (old_remote_state == remote_state) or (remote_state != "pending")): # no change or nothing to do. @@ -588,7 +666,7 @@ def main(): FeatureTransitionHandler(server) LabelsPendingHandler(server) server.run() - print("ctrmgrd.py main called") + log_debug("ctrmgrd.py main called") return 0 diff --git a/src/sonic-ctrmgrd/ctrmgr/ctrmgrd.service b/src/sonic-ctrmgrd/ctrmgr/ctrmgrd.service index 6052c10785da..f59314259bc6 100644 --- a/src/sonic-ctrmgrd/ctrmgr/ctrmgrd.service +++ b/src/sonic-ctrmgrd/ctrmgr/ctrmgrd.service @@ -1,8 +1,9 @@ [Unit] Description=Container Manager watcher daemon -Requires=updategraph.service -After=updategraph.service - +Requires=caclmgrd.service +After=caclmgrd.service +BindsTo=sonic.target +After=sonic.target [Service] Type=simple @@ -11,4 +12,4 @@ Restart=always RestartSec=30 [Install] -WantedBy=multi-user.target +WantedBy=sonic.target diff --git a/src/sonic-ctrmgrd/ctrmgr/kube_commands.py b/src/sonic-ctrmgrd/ctrmgr/kube_commands.py index 1ebfa606f07f..783f122ec914 100755 --- a/src/sonic-ctrmgrd/ctrmgr/kube_commands.py +++ b/src/sonic-ctrmgrd/ctrmgr/kube_commands.py @@ -13,18 +13,24 @@ import syslog import tempfile import urllib.request +import base64 from urllib.parse import urlparse import yaml +import requests from sonic_py_common import device_info +from jinja2 import Template +from swsscommon import swsscommon KUBE_ADMIN_CONF = "/etc/sonic/kube_admin.conf" KUBELET_YAML = "/var/lib/kubelet/config.yaml" SERVER_ADMIN_URL = "https://{}/admin.conf" LOCK_FILE = "/var/lock/kube_join.lock" - -# kubectl --kubeconfig label nodes -#